@grafana/faro-web-sdk 2.0.0-beta → 2.0.0-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/bundle/faro-web-sdk.iife.js +1 -1
  2. package/dist/bundle/types/index.d.ts +1 -1
  3. package/dist/bundle/types/instrumentations/console/instrumentation.d.ts +1 -1
  4. package/dist/bundle/types/instrumentations/csp/instrumentation.d.ts +1 -1
  5. package/dist/bundle/types/instrumentations/errors/instrumentation.d.ts +1 -1
  6. package/dist/bundle/types/instrumentations/performance/instrumentation.d.ts +1 -1
  7. package/dist/bundle/types/instrumentations/session/instrumentation.d.ts +1 -1
  8. package/dist/bundle/types/instrumentations/userActions/instrumentation.d.ts +1 -1
  9. package/dist/bundle/types/instrumentations/view/instrumentation.d.ts +1 -1
  10. package/dist/bundle/types/instrumentations/webVitals/instrumentation.d.ts +1 -1
  11. package/dist/bundle/types/transports/console/transport.d.ts +1 -1
  12. package/dist/bundle/types/transports/fetch/transport.d.ts +1 -1
  13. package/dist/cjs/index.js +2 -1
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/esm/index.js +1 -1
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/types/index.d.ts +1 -1
  18. package/dist/types/instrumentations/console/instrumentation.d.ts +1 -1
  19. package/dist/types/instrumentations/csp/instrumentation.d.ts +1 -1
  20. package/dist/types/instrumentations/errors/instrumentation.d.ts +1 -1
  21. package/dist/types/instrumentations/performance/instrumentation.d.ts +1 -1
  22. package/dist/types/instrumentations/session/instrumentation.d.ts +1 -1
  23. package/dist/types/instrumentations/userActions/instrumentation.d.ts +1 -1
  24. package/dist/types/instrumentations/view/instrumentation.d.ts +1 -1
  25. package/dist/types/instrumentations/webVitals/instrumentation.d.ts +1 -1
  26. package/dist/types/transports/console/transport.d.ts +1 -1
  27. package/dist/types/transports/fetch/transport.d.ts +1 -1
  28. package/package.json +3 -3
@@ -1 +1 @@
1
- var GrafanaFaroWebSdk=function(e){"use strict";class t{constructor(e,t){var i,n;this.signalBuffer=[],this.itemLimit=null!==(i=null==t?void 0:t.itemLimit)&&void 0!==i?i:50,this.sendTimeout=null!==(n=null==t?void 0:t.sendTimeout)&&void 0!==n?n:250,this.paused=(null==t?void 0:t.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.flush()})}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval(()=>this.flush(),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const t=new Map;return e.forEach(e=>{const i=JSON.stringify(e.meta);let n=t.get(i);n=void 0===n?[e]:[...n,e],t.set(i,n)}),Array.from(t.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var i;e.TransportItemType=void 0,(i=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",i.LOG="log",i.MEASUREMENT="measurement",i.TRACE="trace",i.EVENT="event";const n={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function r(e,i,n,r){var o;i.debug("Initializing transports");const a=[];let l=n.paused,u=[];const c=e=>{let t=e;for(const e of u){const i=t.map(e).filter(Boolean);if(0===i.length)return[];t=s(i,n)}return t},d=e=>{const t=c(e);if(0!==t.length)for(const e of a)i.debug(`Transporting item using ${e.name}\n`,t),e.isBatched()&&e.send(t)};let p;(null===(o=n.batching)||void 0===o?void 0:o.enabled)&&(p=new t(d,{sendTimeout:n.batching.sendTimeout,itemLimit:n.batching.itemLimit,paused:l}));return{add:(...t)=>{i.debug("Adding transports"),t.forEach(t=>{i.debug(`Adding "${t.name}" transport`);a.some(e=>e===t)?i.warn(`Transport ${t.name} is already added`):(t.unpatchedConsole=e,t.internalLogger=i,t.config=n,t.metas=r,a.push(t))})},addBeforeSendHooks:(...e)=>{i.debug("Adding beforeSendHooks\n",u),e.forEach(e=>{e&&u.push(e)})},getBeforeSendHooks:()=>[...u],execute:e=>{var t;l||((null===(t=n.batching)||void 0===t?void 0:t.enabled)&&(null==p||p.addItem(e)),(e=>{var t,r;if((null===(t=n.batching)||void 0===t?void 0:t.enabled)&&a.every(e=>e.isBatched()))return;const[s]=c([e]);if(void 0!==s)for(const e of a)i.debug(`Transporting item using ${e.name}\n`,s),e.isBatched()?(null===(r=n.batching)||void 0===r?void 0:r.enabled)||e.send([s]):e.send(s)})(e))},isPaused:()=>l,pause:()=>{i.debug("Pausing transports"),null==p||p.pause(),l=!0},remove:(...e)=>{i.debug("Removing transports"),e.forEach(e=>{i.debug(`Removing "${e.name}" transport`);const t=a.indexOf(e);-1!==t?a.splice(t,1):i.warn(`Transport "${e.name}" is not added`)})},removeBeforeSendHooks:(...e)=>{u.filter(t=>!e.includes(t))},get transports(){return[...a]},unpause:()=>{i.debug("Unpausing transports"),null==p||p.start(),l=!1}}}function s(t,i){if(i.preserveOriginalError)for(const i of t)i.type===e.TransportItemType.EXCEPTION&&delete i.payload.originalError;return t}function o(e,t){return typeof e===t}function a(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function l(e,t){try{return e instanceof t}catch(e){return!1}}const u=e=>o(e,"null"),c=e=>o(e,"string"),d=e=>o(e,"number")&&!isNaN(e)||o(e,"bigint"),p=e=>o(e,"boolean"),g=e=>!u(e)&&o(e,"object"),m=e=>o(e,"function"),f=e=>a(e,"Array"),h=e=>!g(e)&&!m(e),b="undefined"!=typeof Event,v=e=>b&&l(e,Event),w="undefined"!=typeof Error,y=e=>w&&l(e,Error),S=e=>a(e,"ErrorEvent"),T=e=>a(e,"DOMError"),E=e=>a(e,"DOMException"),I="undefined"!=typeof Element,k="undefined"!=typeof Map;function x(e){return null==e||(f(e)||c(e)?0===e.length:!!g(e)&&0===Object.keys(e).length)}function O(e,t){if(e===t)return!0;if(o(e,"number")&&isNaN(e))return o(t,"number")&&isNaN(t);const i=f(e),n=f(t);if(i!==n)return!1;if(i&&n){const i=e.length;if(i!==t.length)return!1;for(let n=i;0!==n--;)if(!O(e[n],t[n]))return!1;return!0}const r=g(e),s=g(t);if(r!==s)return!1;if(e&&t&&r&&s){const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(let e of i)if(!n.includes(e))return!1;for(let n of i)if(!O(e[n],t[n]))return!1;return!0}return!1}function L(){return Date.now()}function A(){return(new Date).toISOString()}function C(e){return new Date(e).toISOString()}var _;e.LogLevel=void 0,(_=e.LogLevel||(e.LogLevel={})).TRACE="trace",_.DEBUG="debug",_.INFO="info",_.LOG="log",_.WARN="warn",_.ERROR="error";const P=e.LogLevel.LOG,j=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function M(){}function N(e){const{size:t,concurrency:i}=e,n=[];let r=0;const s=()=>{if(r<i&&n.length){const{producer:e,resolve:t,reject:i}=n.shift();r++,e().then(e=>{r--,s(),t(e)},e=>{r--,s(),i(e)})}};return{add:e=>{if(n.length+r>=t)throw new Error("Task buffer full");return new Promise((t,i)=>{n.push({producer:e,resolve:t,reject:i}),s()})}}}const U="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function D(e=10){return Array.from(Array(e)).map(()=>U[Math.floor(59*Math.random())]).join("")}const R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;function B(e={}){return JSON.stringify(null!=e?e:{},function(){const e=new WeakSet;return function(t,i){if(g(i)&&null!==i){if(e.has(i))return null;e.add(i)}return i}}())}function F(e={}){const t={};for(const[i,n]of Object.entries(e))t[i]=g(n)&&null!==n?B(n):String(n);return t}class z{constructor(){this.subscribers=[]}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>this.unsubscribe(e)}}unsubscribe(e){this.subscribers=this.subscribers.filter(t=>t!==e)}notify(e){this.subscribers.forEach(t=>t(e))}first(){const e=new z,t=t=>{e.notify(t),i.unsubscribe()},i=this.subscribe(t),n=e.unsubscribe.bind(e);return this.withUnsubscribeOverride(e,n,t)}takeWhile(e){const t=new z,i=n=>{e(n)?t.notify(n):t.unsubscribe(i)};this.subscribe(i);const n=t.unsubscribe.bind(t);return this.withUnsubscribeOverride(t,n,i)}filter(e){const t=new z,i=i=>{e(i)&&t.notify(i)};this.subscribe(i);const n=t.unsubscribe.bind(t);return this.withUnsubscribeOverride(t,n,i)}merge(...e){const t=new z,i=[];e.forEach(e=>{const n=e.subscribe(e=>{t.notify(e)});i.push(n)});const n=t.unsubscribeAll.bind(t);return t.unsubscribe=()=>{i.forEach(e=>e.unsubscribe()),n()},t}withUnsubscribeOverride(e,t,i){return e.unsubscribe=e=>{t(e),this.unsubscribe(i)},e}unsubscribeAll(){this.subscribers=[]}}var q;e.InternalLoggerLevel=void 0,(q=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[q.OFF=0]="OFF",q[q.ERROR=1]="ERROR",q[q.WARN=2]="WARN",q[q.INFO=3]="INFO",q[q.VERBOSE=4]="VERBOSE";const V={debug:M,error:M,info:M,prefix:"Faro",warn:M},$=e.InternalLoggerLevel.ERROR,H=Object.assign({},console);let G=H;function W(e){var t;return G=null!==(t=e.unpatchedConsole)&&void 0!==t?t:G,G}function K(t=H,i=$){const n=V;return i>e.InternalLoggerLevel.OFF&&(n.error=i>=e.InternalLoggerLevel.ERROR?function(...e){t.error(`${n.prefix}\n`,...e)}:M,n.warn=i>=e.InternalLoggerLevel.WARN?function(...e){t.warn(`${n.prefix}\n`,...e)}:M,n.info=i>=e.InternalLoggerLevel.INFO?function(...e){t.info(`${n.prefix}\n`,...e)}:M,n.debug=i>=e.InternalLoggerLevel.VERBOSE?function(...e){t.debug(`${n.prefix}\n`,...e)}:M),n}let X=V;function J(e,t){return X=K(e,t.internalLoggerLevel),X}class Z{constructor(){this.unpatchedConsole=H,this.internalLogger=V,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 Z{isBatched(){return!1}getIgnoreUrls(){return[]}}function Q(e,t){var i,n;if(void 0===t)return e;if(void 0===e)return{resourceSpans:t};const r=null===(i=e.resourceSpans)||void 0===i?void 0:i[0];if(void 0===r)return e;const s=(null==r?void 0:r.scopeSpans)||[],o=(null===(n=null==t?void 0:t[0])||void 0===n?void 0:n.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...s,...o]})]})}function ee(t){let i={meta:{}};return void 0!==t[0]&&(i.meta=t[0].meta),t.forEach(t=>{switch(t.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const r=n[t.type],s=i[r];i=Object.assign(Object.assign({},i),{[r]:void 0===s?[t.payload]:[...s,t.payload]});break;case e.TransportItemType.TRACE:i=Object.assign(Object.assign({},i),{traces:Q(i.traces,t.payload.resourceSpans)})}}),i}const te="Error",ie=e=>e.map(e=>g(e)?B(e):String(e)).join(" ");let ne;function re({internalLogger:t,config:i,metas:n,transports:r,tracesApi:s,userActionsApi:o}){var a;t.debug("Initializing exceptions API");let l=null;ne=null!==(a=i.parseStacktrace)&&void 0!==a?a:ne;const d=e=>{t.debug("Changing stacktrace parser"),ne=null!=e?e:ne},{ignoreErrors:p=[],preserveOriginalError:m}=i;return d(i.parseStacktrace),{changeStacktraceParser:d,getStacktraceParser:()=>ne,pushError:(a,{skipDedupe:d,stackFrames:h,type:b,context:v,spanContext:w,timestampOverwriteMs:S,originalError:T}={})=>{if(!function(e,t){const{message:i,name:n,stack:r}=t;return s=e,o=i+" "+n+" "+r,s.some(e=>c(e)?o.includes(e):!!o.match(e));var s,o}(p,null!=T?T:a))try{const c=F(Object.assign(Object.assign({},function(e){let t=e.cause;y(t)?t=e.cause.toString():null!==t&&(g(e.cause)||f(e.cause))?t=B(e.cause):null!=t&&(t=e.cause.toString());return null==t?{}:{cause:t}}(null!=T?T:a)),null!=v?v:{})),p={meta:n.value,payload:Object.assign(Object.assign({type:b||a.name||te,value:a.message,timestamp:S?C(S):A(),trace:w?{trace_id:w.traceId,span_id:w.spanId}:s.getTraceContext()},x(c)?{}:{context:c}),m?{originalError:T}:{}),type:e.TransportItemType.EXCEPTION};(null==(h=null!=h?h:a.stack?null==ne?void 0:ne(a).frames:void 0)?void 0:h.length)&&(p.payload.stacktrace={frames:h});const E={type:p.payload.type,value:p.payload.value,stackTrace:p.payload.stacktrace,context:p.payload.context};if(!d&&i.dedupe&&!u(l)&&O(E,l))return void t.debug("Skipping error push because it is the same as the last one\n",p.payload);l=E,t.debug("Pushing exception\n",p);const I=o.getActiveUserAction();I?I.addItem(p):r.execute(p)}catch(e){t.error("Error pushing event",e)}}}}const se=e=>e.map(e=>{try{return String(e)}catch(e){return""}}).join(" ");var oe,ae;!function(e){e.Normal="normal",e.Critical="critical"}(oe||(oe={})),function(e){e[e.Started=0]="Started",e[e.Halted=1]="Halted",e[e.Cancelled=2]="Cancelled",e[e.Ended=3]="Ended"}(ae||(ae={}));const le="faro",ue={enabled:!0,sendTimeout:250,itemLimit:50};const ce="_faroInternal";function de(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(R,ce,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function pe(){return ce in R}function ge(t,i,n,r,s,o,a){return i.debug("Initializing Faro"),e.faro={api:o,config:n,instrumentations:a,internalLogger:i,metas:r,pause:s.pause,transports:s,unpatchedConsole:t,unpause:s.unpause},de(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 R)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(R,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}e.faro={};class me{constructor(){this.buffer=[]}addItem(e){this.buffer.push(e)}flushBuffer(e){if(m(e))for(const t of this.buffer)e(t);this.buffer.length=0}size(){return this.buffer.length}}class fe extends z{constructor({name:e,parentId:t,haltTimeout:i,trigger:n,transports:r,attributes:s,trackUserActionsExcludeItem:o,severity:a=oe.Normal}){super(),this.name=e,this.attributes=s,this.id=D(),this.trigger=n,this.cancelTimeout=100,this.haltTimeout=null!=i?i:1e4,this.parentId=null!=t?t:this.id,this.trackUserActionsExcludeItem=o,this.severity=a,this._itemBuffer=new me,this._transports=r,this._haltTimeoutId=-1,this._state=ae.Started,this._isValid=!1,this._start()}addItem(e){this._itemBuffer.addItem(e)}extend(e){this._isValid||(this._isValid=!0),this._setFollowupActionTimeout(e)}_setFollowupActionTimeout(e){this._timeoutId=function(e,t,i){e&&clearTimeout(e);return e=setTimeout(()=>{t()},i)}(this._timeoutId,()=>{this._state===ae.Started&&(null==e?void 0:e())?this.halt():this._isValid?this.end():this.cancel()},100)}_start(){this._state=ae.Started,this._state===ae.Started&&(this.startTime=L()),this._setFollowupActionTimeout()}halt(){this._state===ae.Started&&(this._state=ae.Halted,this._haltTimeoutId=setTimeout(()=>{this.end()},this.haltTimeout),this.notify(this._state))}cancel(){this._state===ae.Started&&this._itemBuffer.flushBuffer(),this._state=ae.Cancelled,this.notify(this._state)}end(){if(this._state===ae.Cancelled)return;clearTimeout(this._haltTimeoutId),clearTimeout(this._timeoutId);const t=L(),i=t-this.startTime;this._state=ae.Ended,this._itemBuffer.flushBuffer(t=>{if(function(t,i){return(null==i?void 0:i(t))||t.type===e.TransportItemType.MEASUREMENT&&"web-vitals"===t.payload.type}(t,this.trackUserActionsExcludeItem))return void this._transports.execute(t);const i=Object.assign(Object.assign({},t),{payload:Object.assign(Object.assign({},t.payload),{action:{parentId:this.id,name:this.name}})});this._transports.execute(i)}),this._state=ae.Ended,this.notify(this._state),e.faro.api.pushEvent(this.name,Object.assign({userActionStartTime:this.startTime.toString(),userActionEndTime:t.toString(),userActionDuration:i.toString(),userActionTrigger:this.trigger,userActionSeverity:this.severity},F(this.attributes)),void 0,{timestampOverwriteMs:this.startTime,customPayloadTransformer:e=>(e.action={id:this.id,name:this.name},e)})}getState(){return this._state}}const he=new z;function be(t,i,n,r,s){i.debug("Initializing API");const o=function({transports:e,internalLogger:t,config:i}){const n=i.trackUserActionsExcludeItem;let r;const s=()=>r;return{startUserAction:(i,o,a)=>{if(void 0===s()){const t=new fe({name:i,transports:e,attributes:o,trigger:(null==a?void 0:a.triggerName)||"faroApiCall",trackUserActionsExcludeItem:n});return t.filter(e=>[ae.Ended,ae.Cancelled].includes(e)).first().subscribe(()=>{r=void 0}),he.notify({type:"user_action_start",userAction:t}),r=t,r}t.error("Attempted to create a new user action while one is already running. This is not possible.")},getActiveUserAction:s}}({transports:s,config:n,internalLogger:i}),a=function(t,i,n,r,s){let o;return i.debug("Initializing traces API"),{getOTEL:()=>o,getTraceContext:()=>{const e=null==o?void 0:o.trace.getSpanContext(o.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,t)=>{i.debug("Initializing OpenTelemetry"),o={trace:e,context:t}},isOTELInitialized:()=>!!o,pushTraces:t=>{try{const n={type:e.TransportItemType.TRACE,payload:t,meta:r.value};i.debug("Pushing trace\n",n),s.execute(n)}catch(e){i.error("Error pushing trace\n",e)}}}}(0,i,0,r,s),l={internalLogger:i,userActionsApi:o,config:n,metas:r,transports:s,tracesApi:a};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),re(l)),function({internalLogger:e,metas:t}){let i,n,r,s;e.debug("Initializing meta API");const o=e=>{n&&t.remove(n),n={user:e},t.add(n)},a=(e,n)=>{var r;const s=null==n?void 0:n.overrides,o=s?{overrides:Object.assign(Object.assign({},null===(r=null==i?void 0:i.session)||void 0===r?void 0:r.overrides),s)}:{};i&&t.remove(i),i={session:Object.assign(Object.assign({},x(e)?void 0:e),o)},t.add(i)},l=()=>t.value.session,u=()=>t.value.page;return{setUser:o,resetUser:o,setSession:a,resetSession:a,getSession:l,setView:(e,i)=>{var n;if((null==i?void 0:i.overrides)&&a(l(),{overrides:i.overrides}),(null===(n=null==r?void 0:r.view)||void 0===n?void 0:n.name)===(null==e?void 0:e.name))return;const s=r;r={view:e},t.add(r),s&&t.remove(s)},getView:()=>t.value.view,setPage:e=>{var i;const n=c(e)?Object.assign(Object.assign({},null!==(i=null==s?void 0:s.page)&&void 0!==i?i:u()),{id:e}):e;s&&t.remove(s),s={page:n},t.add(s)},getPage:u}}(l)),function({internalLogger:t,config:i,metas:n,transports:r,tracesApi:s,userActionsApi:o}){var a;t.debug("Initializing logs API");let l=null;const c=null!==(a=i.logArgsSerializer)&&void 0!==a?a:se;return{pushLog:(a,{context:d,level:p,skipDedupe:g,spanContext:m,timestampOverwriteMs:f}={})=>{try{const h=F(d),b={type:e.TransportItemType.LOG,payload:{message:c(a),level:null!=p?p:P,context:x(h)?void 0:h,timestamp:f?C(f):A(),trace:m?{trace_id:m.traceId,span_id:m.spanId}:s.getTraceContext()},meta:n.value},v={message:b.payload.message,level:b.payload.level,context:b.payload.context};if(!g&&i.dedupe&&!u(l)&&O(v,l))return void t.debug("Skipping log push because it is the same as the last one\n",b.payload);l=v,t.debug("Pushing log\n",b);const w=o.getActiveUserAction();w?w.addItem(b):r.execute(b)}catch(e){t.error("Error pushing log\n",e)}}}}(l)),function({internalLogger:t,config:i,metas:n,transports:r,tracesApi:s,userActionsApi:o}){t.debug("Initializing measurements API");let a=null;return{pushMeasurement:(l,{skipDedupe:c,context:d,spanContext:p,timestampOverwriteMs:g}={})=>{try{const m=F(d),f={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},l),{trace:p?{trace_id:p.traceId,span_id:p.spanId}:s.getTraceContext(),timestamp:g?C(g):A(),context:x(m)?void 0:m}),meta:n.value},h={type:f.payload.type,values:f.payload.values,context:f.payload.context};if(!c&&i.dedupe&&!u(a)&&O(h,a))return void t.debug("Skipping measurement push because it is the same as the last one\n",f.payload);a=h,t.debug("Pushing measurement\n",f);const b=o.getActiveUserAction();b?b.addItem(f):r.execute(f)}catch(e){t.error("Error pushing measurement\n",e)}}}}(l)),function({internalLogger:t,config:i,metas:n,transports:r,tracesApi:s,userActionsApi:o}){let a=null;return{pushEvent:(l,c,d,{skipDedupe:p,spanContext:g,timestampOverwriteMs:m,customPayloadTransformer:f=e=>e}={})=>{try{const h=F(c),b={meta:n.value,payload:f({name:l,domain:null!=d?d:i.eventDomain,attributes:x(h)?void 0:h,timestamp:m?C(m):A(),trace:g?{trace_id:g.traceId,span_id:g.spanId}:s.getTraceContext()}),type:e.TransportItemType.EVENT},v={name:b.payload.name,attributes:b.payload.attributes,domain:b.payload.domain};if(!p&&i.dedupe&&!u(a)&&O(v,a))return void t.debug("Skipping event push because it is the same as the last one\n",b.payload);a=v,t.debug("Pushing event\n",b);const w=o.getActiveUserAction();w?w.addItem(b):r.execute(b)}catch(e){t.error("Error pushing event",e)}}}}(l)),o)}class ve extends Z{constructor(){super(...arguments),this.api={},this.transports={}}}const we="2.0.0-beta";function ye(e){const t=W(e),i=J(t,e);if(pe()&&!e.isolate)return void i.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');i.debug("Initializing");const n=function(e,t){let i=[],n=[];const r=()=>i.reduce((e,t)=>Object.assign(e,m(t)?t():t),{}),s=()=>{if(n.length){const e=r();n.forEach(t=>t(e))}};return{add:(...e)=>{t.debug("Adding metas\n",e),i.push(...e),s()},remove:(...e)=>{t.debug("Removing metas\n",e),i=i.filter(t=>!e.includes(t)),s()},addListener:e=>{t.debug("Adding metas listener\n",e),n.push(e)},removeListener:e=>{t.debug("Removing metas listener\n",e),n=n.filter(t=>t!==e)},get value(){return r()}}}(0,i),s=r(t,i,e,n),o=be(0,i,e,n,s),a=function(e,t,i,n,r,s){t.debug("Initializing instrumentations");const o=[];return{add:(...a)=>{t.debug("Adding instrumentations"),a.forEach(a=>{t.debug(`Adding "${a.name}" instrumentation`),o.some(e=>e.name===a.name)?t.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=t,a.config=i,a.metas=n,a.transports=r,a.api=s,o.push(a),a.initialize())})},get instrumentations(){return[...o]},remove:(...e)=>{t.debug("Removing instrumentations"),e.forEach(e=>{var i,n;t.debug(`Removing "${e.name}" instrumentation`);const r=o.reduce((t,i,n)=>null===t&&i.name===e.name?n:null,null);null!==r?(null===(n=(i=o[r]).destroy)||void 0===n||n.call(i),o.splice(r,1)):t.warn(`Instrumentation "${e.name}" is not added`)})}}}(t,i,e,n,s,o),l=ge(t,i,e,n,s,o,a);return function(e){var t,i;const n={sdk:{version:we},app:{bundleId:e.config.app.name&&(r=e.config.app.name,null==R?void 0:R[`__faroBundleId_${r}`])}};var r;const s=null===(t=e.config.sessionTracking)||void 0===t?void 0:t.session;s&&e.api.setSession(s),e.config.app&&(n.app=Object.assign(Object.assign({},e.config.app),n.app)),e.config.user&&(n.user=e.config.user),e.config.view&&(n.view=e.config.view),e.metas.add(n,...null!==(i=e.config.metas)&&void 0!==i?i:[])}(l),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend)}(l),function(e){e.instrumentations.add(...e.config.instrumentations)}(l),l}const Se="view_changed",Te="session_start",Ee="session_resume",Ie="session_extend",ke="service_name_override",xe="unknown";var Oe,Le={exports:{}},Ae=Le.exports;var Ce=(Oe||(Oe=1,function(e,t){!function(i,n){var r="function",s="undefined",o="object",a="string",l="major",u="model",c="name",d="type",p="vendor",g="version",m="architecture",f="console",h="mobile",b="tablet",v="smarttv",w="wearable",y="embedded",S="Amazon",T="Apple",E="ASUS",I="BlackBerry",k="Browser",x="Chrome",O="Firefox",L="Google",A="Honor",C="Huawei",_="LG",P="Microsoft",j="Motorola",M="Nvidia",N="OnePlus",U="Opera",D="OPPO",R="Samsung",B="Sharp",F="Sony",z="Xiaomi",q="Zebra",V="Facebook",$="Chromium OS",H="Mac OS",G=" Browser",W=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},K=function(e,t){return typeof e===a&&-1!==X(t).indexOf(X(e))},X=function(e){return e.toLowerCase()},J=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,500)},Z=function(e,t){for(var i,s,a,l,u,c,d=0;d<t.length&&!u;){var p=t[d],g=t[d+1];for(i=s=0;i<p.length&&!u&&p[i];)if(u=p[i++].exec(e))for(a=0;a<g.length;a++)c=u[++s],typeof(l=g[a])===o&&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]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;d+=2}},Y=function(e,t){for(var i in t)if(typeof t[i]===o&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(K(t[i][r],e))return"?"===i?n:i}else if(K(t[i],e))return"?"===i?n:i;return t.hasOwnProperty("*")?t["*"]:e},Q={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"},ee={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,g],[/opios[\/ ]+([\w\.]+)/i],[g,[c,U+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[c,U+" GX"]],[/\bopr\/([\w\.]+)/i],[g,[c,U]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[c,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[c,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[c,"Quark"]],[/\bddg\/([\w\.]+)/i],[g,[c,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[g,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[g,[c,"Smart Lenovo "+k]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],g],[/\bfocus\/([\w\.]+)/i],[g,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[g,[c,U+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[g,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[g,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[g,[c,U+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[g,[c,"MIUI"+G]],[/fxios\/([\w\.-]+)/i],[g,[c,O]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[c,"360"]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,"$1Browser"],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1"+G],g],[/samsungbrowser\/([\w\.]+)/i],[g,[c,R+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[g,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[c,g],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[c],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,V],g],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[c,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,x+" WebView"],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[g,Y,{"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,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[c,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[c,[g,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[c,[g,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[m,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[m,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[m,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[m,/ower/,"",X]],[/ sun4\w[;\)]/i],[[m,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[m,X]]],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,R],[d,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,R],[d,h]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[p,T],[d,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,T],[d,b]],[/(macintosh);/i],[u,[p,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,B],[d,h]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[u,[p,A],[d,b]],[/honor([-\w ]+)[;\)]/i],[u,[p,A],[d,h]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[u,[p,C],[d,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,C],[d,h]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[u,/_/g," "],[p,z],[d,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[u,/_/g," "],[p,z],[d,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,D],[d,h]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[u,[p,Y,{OnePlus:["304","403","203"],"*":D}],[d,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[d,h]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[d,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[p,j],[d,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,j],[d,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,_],[d,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,_],[d,h]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[u,[p,"Lenovo"],[d,b]],[/(nokia) (t[12][01])/i],[p,u,[d,b]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[u,/_/g," "],[d,h],[p,"Nokia"]],[/(pixel (c|tablet))\b/i],[u,[p,L],[d,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,L],[d,h]],[/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,F],[d,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,F],[d,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,N],[d,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,S],[d,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,S],[d,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[d,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,I],[d,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,E],[d,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,E],[d,h]],[/(nexus 9)/i],[u,[p,"HTC"],[d,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[d,h]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[u,[p,"TCL"],[d,b]],[/(itel) ((\w+))/i],[[p,X],u,[d,Y,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[d,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[d,h]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[p,"Ulefone"],[d,h]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[u,[p,"Energizer"],[d,h]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[u,[p,"Cat"],[d,h]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[u,[p,"Smartfren"],[d,h]],[/droid.+; (a(?:015|06[35]|142p?))/i],[u,[p,"Nothing"],[d,h]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[u,[p,"Archos"],[d,b]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[u,[p,"Archos"],[d,h]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[p,u,[d,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[d,h]],[/(kobo)\s(ereader|touch)/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,b]],[/(surface duo)/i],[u,[p,P],[d,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[d,h]],[/(u304aa)/i],[u,[p,"AT&T"],[d,h]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[d,h]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[d,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[d,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[d,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[d,b]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[d,b]],[/\b(k88) b/i],[u,[p,"ZTE"],[d,b]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[d,h]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[d,h]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[d,b]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[d,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[d,b]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[d,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[d,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[d,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[d,h]],[/\b(ph-1) /i],[u,[p,"Essential"],[d,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[d,b]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[d,b]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[d,b]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[u,[p,M],[d,b]],[/(sprint) (\w+)/i],[p,u,[d,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,P],[d,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,q],[d,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,q],[d,h]],[/smart-tv.+(samsung)/i],[p,[d,v]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,R],[d,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,_],[d,v]],[/(apple) ?tv/i],[p,[u,T+" TV"],[d,v]],[/crkey/i],[[u,x+"cast"],[p,L],[d,v]],[/droid.+aft(\w+)( bui|\))/i],[u,[p,S],[d,v]],[/(shield \w+ tv)/i],[u,[p,M],[d,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,B],[d,v]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,F],[d,v]],[/(mi(tv|box)-?\w+) bui/i],[u,[p,z],[d,v]],[/Hbbtv.*(technisat) (.*);/i],[p,u,[d,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,J],[u,J],[d,v]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[u,[d,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[d,f]],[/droid.+; (shield)( bui|\))/i],[u,[p,M],[d,f]],[/(playstation \w+)/i],[u,[p,F],[d,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,P],[d,f]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[u,[p,R],[d,w]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[p,u,[d,w]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[u,[p,D],[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[p,T],[d,w]],[/(opwwe\d{3})/i],[u,[p,N],[d,w]],[/(moto 360)/i],[u,[p,j],[d,w]],[/(smartwatch 3)/i],[u,[p,F],[d,w]],[/(g watch r)/i],[u,[p,_],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,q],[d,w]],[/droid.+; (glass) \d/i],[u,[p,L],[d,w]],[/(pico) (4|neo3(?: link|pro)?)/i],[p,u,[d,w]],[/; (quest( \d| pro)?)/i],[u,[p,V],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,y]],[/(aeobc)\b/i],[u,[p,S],[d,y]],[/(homepod).+mac os/i],[u,[p,T],[d,y]],[/windows iot/i],[[d,y]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[d,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,h]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[c,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[c,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,g],[/ladybird\//i],[[c,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,g],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[c,[g,Y,Q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,Y,Q],[c,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,H],[g,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,c],[/(ubuntu) ([\w\.]+) like android/i],[[c,/(.+)/,"$1 Touch"],g],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[c,g],[/\(bb(10);/i],[g,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[g,[c,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,$],g],[/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)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,g],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,g]]},te=function(e,t){if(typeof e===o&&(t=e,e=n),!(this instanceof te))return new te(e,t).getResult();var f=typeof i!==s&&i.navigator?i.navigator:n,v=e||(f&&f.userAgent?f.userAgent:""),w=f&&f.userAgentData?f.userAgentData:n,y=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(ee,t):ee,S=f&&f.userAgent==v;return this.getBrowser=function(){var e,t={};return t[c]=n,t[g]=n,Z.call(t,v,y.browser),t[l]=typeof(e=t[g])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,S&&f&&f.brave&&typeof f.brave.isBrave==r&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[m]=n,Z.call(e,v,y.cpu),e},this.getDevice=function(){var e={};return e[p]=n,e[u]=n,e[d]=n,Z.call(e,v,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=h),S&&"Macintosh"==e[u]&&f&&typeof f.standalone!==s&&f.maxTouchPoints&&f.maxTouchPoints>2&&(e[u]="iPad",e[d]=b),e},this.getEngine=function(){var e={};return e[c]=n,e[g]=n,Z.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[c]=n,e[g]=n,Z.call(e,v,y.os),S&&!e[c]&&w&&w.platform&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,$).replace(/macos/i,H)),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 v},this.setUA=function(e){return v=typeof e===a&&e.length>500?J(e,500):e,this},this.setUA(v),this};te.VERSION="1.0.41",te.BROWSER=W([c,g,l]),te.CPU=W([m]),te.DEVICE=W([u,p,d,f,h,v,b,w,y]),te.ENGINE=te.OS=W([c,g]),e.exports&&(t=e.exports=te),t.UAParser=te;var ie=typeof i!==s&&(i.jQuery||i.Zepto);if(ie&&!ie.ua){var ne=new te;ie.ua=ne.getResult(),ie.ua.get=function(){return ne.getUA()},ie.ua.set=function(e){ne.setUA(e);var t=ne.getResult();for(var i in t)ie.ua[i]=t[i]}}}("object"==typeof window?window:Ae)}(Le,Le.exports)),Le.exports);const _e=()=>{const e=new Ce.UAParser,{name:t,version:i}=e.getBrowser(),{name:n,version:r}=e.getOS(),s=e.getUA(),o=navigator.language,a=navigator.userAgent.includes("Mobi"),l=function(){if(!t||!i)return;if("userAgentData"in navigator&&navigator.userAgentData)return navigator.userAgentData.brands;return}();return{browser:{name:null!=t?t:xe,version:null!=i?i:xe,os:`${null!=n?n:xe} ${null!=r?r:xe}`,userAgent:null!=s?s:xe,language:null!=o?o:xe,mobile:a,brands:null!=l?l:xe,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}};function Pe(t){var i,n,r,s;return{id:null!==(s=null===(r=null===(n=null===(i=e.faro.config)||void 0===i?void 0:i.sessionTracking)||void 0===n?void 0:n.generateSessionId)||void 0===r?void 0:r.call(n))&&void 0!==s?s:D(),attributes:t}}const je="sessionStorage",Me="localStorage";function Ne(t){var i;try{let e;e=window[t];const i="__faro_storage_test__";return e.setItem(i,i),e.removeItem(i),!0}catch(n){return null===(i=e.faro.internalLogger)||void 0===i||i.info(`Web storage of type ${t} is not available. Reason: ${n}`),!1}}function Ue(e,t){return ze(t)?window[t].getItem(e):null}function De(e,t,i){if(ze(i))try{window[i].setItem(e,t)}catch(e){}}function Re(e,t){ze(t)&&window[t].removeItem(e)}const Be=Ne(Me),Fe=Ne(je);function ze(e){return e===Me?Be:e===je&&Fe}function qe(e,t){let i,n=!1;const r=()=>{null!=i?(e(...i),i=null,setTimeout(r,t)):n=!1};return(...s)=>{n?i=s:(e(...s),n=!0,setTimeout(r,t))}}function Ve(){return e.faro.transports.transports.flatMap(e=>e.getIgnoreUrls())}function $e(e=""){return Ve().some(t=>e&&null!=e.match(t))}function He(e){return c(e)?e:e instanceof URL?e.href:!x(e)&&m(null==e?void 0:e.toString)?e.toString():void 0}const Ge="com.grafana.faro.session",We=144e5,Ke=9e5,Xe=Ke,Je={enabled:!0,persistent:!1,maxSessionPersistenceTime:Xe};function Ze(){var t,i,n;const r=e.faro.config.sessionTracking;let s=null!==(n=null!==(i=null===(t=null==r?void 0:r.sampler)||void 0===t?void 0:t.call(r,{metas:e.faro.metas.value}))&&void 0!==i?i:null==r?void 0:r.samplingRate)&&void 0!==n?n:1;if("number"!=typeof s){s=0}return Math.random()<s}function Ye({sessionId:t,started:i,lastActivity:n,isSampled:r=!0}={}){var s,o;const a=L(),l=null===(o=null===(s=e.faro.config)||void 0===s?void 0:s.sessionTracking)||void 0===o?void 0:o.generateSessionId;return null==t&&(t="function"==typeof l?l():D()),{sessionId:t,lastActivity:null!=n?n:a,started:null!=i?i:a,isSampled:r}}function Qe(e){if(null==e)return!1;const t=L();if(!(t-e.started<We))return!1;return t-e.lastActivity<Ke}function et({fetchUserSession:t,storeUserSession:i}){return function({forceSessionExtend:n}={forceSessionExtend:!1}){var r,s,o;if(!t||!i)return;const a=e.faro.config.sessionTracking,l=null==a?void 0:a.persistent;if(l&&!Be||!l&&!Fe)return;const u=t();if(!1===n&&Qe(u))i(Object.assign(Object.assign({},u),{lastActivity:L()}));else{let t=tt(Ye({isSampled:Ze()}),u);i(t),null===(r=e.faro.api)||void 0===r||r.setSession(t.sessionMeta),null===(s=null==a?void 0:a.onSessionChange)||void 0===s||s.call(a,null!==(o=null==u?void 0:u.sessionMeta)&&void 0!==o?o:null,t.sessionMeta)}}}function tt(t,i){var n,r,s,o,a,l,u;const c=Object.assign(Object.assign({},t),{sessionMeta:{id:t.sessionId,attributes:Object.assign(Object.assign(Object.assign({},null===(r=null===(n=e.faro.config.sessionTracking)||void 0===n?void 0:n.session)||void 0===r?void 0:r.attributes),null!==(o=null===(s=e.faro.metas.value.session)||void 0===s?void 0:s.attributes)&&void 0!==o?o:{}),{isSampled:t.isSampled.toString()})}}),d=null!==(l=null===(a=e.faro.metas.value.session)||void 0===a?void 0:a.overrides)&&void 0!==l?l:null===(u=null==i?void 0:i.sessionMeta)||void 0===u?void 0:u.overrides;x(d)||(c.sessionMeta.overrides=d);const p=null==i?void 0:i.sessionId;return null!=p&&(c.sessionMeta.attributes.previousSession=p),c}function it({fetchUserSession:t,storeUserSession:i}){return function(n){const r=n.session,s=t();let o=null==r?void 0:r.id;const a=null==r?void 0:r.attributes,l=null==r?void 0:r.overrides,u=null==s?void 0:s.sessionMeta,c=null==u?void 0:u.overrides,d=!!l&&!O(l,c),p=!!a&&!O(a,null==u?void 0:u.attributes);if(!!r&&o!==(null==s?void 0:s.sessionId)||p||d){const t=tt(Ye({sessionId:o,isSampled:Ze()}),s);i(t),function(t,i={},n={}){var r,s,o;if(!t)return;const a=i.serviceName,l=null!==(o=null!==(r=n.serviceName)&&void 0!==r?r:null===(s=e.faro.metas.value.app)||void 0===s?void 0:s.name)&&void 0!==o?o:"";a&&a!==l&&e.faro.api.pushEvent(ke,{serviceName:a,previousServiceName:l})}(d,l,c),e.faro.api.setSession(t.sessionMeta)}}}class nt{constructor(){this.updateSession=qe(()=>this.updateUserSession(),1e3),this.updateUserSession=et({fetchUserSession:nt.fetchUserSession,storeUserSession:nt.storeUserSession}),this.init()}static removeUserSession(){Re(Ge,nt.storageTypeLocal)}static storeUserSession(e){De(Ge,B(e),nt.storageTypeLocal)}static fetchUserSession(){const e=Ue(Ge,nt.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.updateSession()}),e.faro.metas.addListener(it({fetchUserSession:nt.fetchUserSession,storeUserSession:nt.storeUserSession}))}}nt.storageTypeLocal=Me;class rt{constructor(){this.updateSession=qe(()=>this.updateUserSession(),1e3),this.updateUserSession=et({fetchUserSession:rt.fetchUserSession,storeUserSession:rt.storeUserSession}),this.init()}static removeUserSession(){Re(Ge,rt.storageTypeSession)}static storeUserSession(e){De(Ge,B(e),rt.storageTypeSession)}static fetchUserSession(){const e=Ue(Ge,rt.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.updateSession()}),e.faro.metas.addListener(it({fetchUserSession:rt.fetchUserSession,storeUserSession:rt.storeUserSession}))}}function st(e){return(null==e?void 0:e.persistent)?nt:rt}rt.storageTypeSession=je;class ot extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=we}sendSessionStartEvent(e){var t,i;const n=e.session;if(n&&n.id!==(null===(t=this.notifiedSession)||void 0===t?void 0:t.id)){if(this.notifiedSession&&this.notifiedSession.id===(null===(i=n.attributes)||void 0===i?void 0:i.previousSession))return this.api.pushEvent(Ie,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=n);this.notifiedSession=n,this.api.pushEvent(Te,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var i,n,r,s,o,a;let l,u,c=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&c){const e=L();c.lastActivity<e-t.maxSessionPersistenceTime&&(nt.removeUserSession(),c=null)}if(Qe(c)){const e=null==c?void 0:c.sessionId;u=Ye({sessionId:e,isSampled:c.isSampled||!1,started:null==c?void 0:c.started});const r=null==c?void 0:c.sessionMeta,s=Object.assign(Object.assign({},null===(i=t.session)||void 0===i?void 0:i.overrides),null==r?void 0:r.overrides);u.sessionMeta=Object.assign(Object.assign({},t.session),{id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.attributes),null==r?void 0:r.attributes),{isSampled:u.isSampled.toString()}),overrides:s}),l=Ee}else{const e=null!==(s=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==s?s:Pe().id;u=Ye({sessionId:e,isSampled:Ze()});const i=null===(o=t.session)||void 0===o?void 0:o.overrides;u.sessionMeta=Object.assign({id:e,attributes:Object.assign({isSampled:u.isSampled.toString()},null===(a=t.session)||void 0===a?void 0:a.attributes)},i?{overrides:i}:{}),l=Te}return{initialSession:u,lifecycleType:l}}registerBeforeSendHook(e){var t;const{updateSession:i}=new e;null===(t=this.transports)||void 0===t||t.addBeforeSendHooks(e=>{var t,n,r;i();const s=null===(t=e.meta.session)||void 0===t?void 0:t.attributes;if(s&&"true"===(null==s?void 0:s.isSampled)){let t=JSON.parse(JSON.stringify(e));const i=null===(n=t.meta.session)||void 0===n?void 0:n.attributes;return null==i||delete i.isSampled,0===Object.keys(null!=i?i:{}).length&&(null===(r=t.meta.session)||void 0===r||delete r.attributes),t}return null})}initialize(){this.logDebug("init session instrumentation");const e=this.config.sessionTracking;if(null==e?void 0:e.enabled){const t=st(e);this.registerBeforeSendHook(t);const{initialSession:i,lifecycleType:n}=this.createInitialSession(t,e);t.storeUserSession(i);const r=i.sessionMeta;this.notifiedSession=r,this.api.setSession(r),n===Te&&this.api.pushEvent(Te,{},void 0,{skipDedupe:!0}),n===Ee&&this.api.pushEvent(Ee,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}const at=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const lt=/^\s*at (?:(?![a-z]+:\/\/)([^(]+?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ut=/\((\S*)(?::(\d+))(?::(\d+))\)/,ct="address at ",dt=/^\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,pt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gt="safari-extension",mt="safari-web-extension",ft=/Minified React error #\d+;/i;function ht(e,t,i,n){const r={filename:e||document.location.href,function:t||"?"};return void 0!==i&&(r.lineno=i),void 0!==n&&(r.colno=n),r}function bt(e,t){const i=null==e?void 0:e.includes(gt),n=!i&&(null==e?void 0:e.includes(mt));return i||n?[(null==e?void 0:e.includes("@"))?e.split("@")[0]:e,i?`${gt}:${t}`:`${mt}:${t}`]:[e,t]}function vt(e){let t=[];e.stacktrace?t=e.stacktrace.split("\n").filter((e,t)=>t%2==0):e.stack&&(t=e.stack.split("\n"));const i=t.reduce((t,i,n)=>{let r,s,o,a,l;if(r=lt.exec(i)){if(s=r[1],o=r[2],a=r[3],l=r[4],null==o?void 0:o.startsWith("eval")){const e=ut.exec(o);e&&(o=e[1],a=e[2],l=e[3])}o=(null==o?void 0:o.startsWith(ct))?o.substring(11):o,[s,o]=bt(s,o)}else if(r=dt.exec(i)){if(s=r[1],o=r[3],a=r[4],l=r[5],o&&o.includes(" > eval")){const e=pt.exec(o);e&&(s=s||"eval",o=e[1],a=e[2])}else 0===n&&!l&&d(e.columnNumber)&&(l=String(e.columnNumber+1));[s,o]=bt(s,o)}return(o||s)&&t.push(ht(o,s,a?Number(a):void 0,l?Number(l):void 0)),t},[]);return ft.test(e.message)?i.slice(1):i}function wt(e){return{frames:vt(e)}}function yt(e){let t,i,n,r,s=[];if(S(e)&&e.error)t=e.error.message,i=e.error.name,s=vt(e.error);else if((n=T(e))||E(e)){const{name:r,message:s}=e;i=null!=r?r:n?"DOMError":"DOMException",t=s?`${i}: ${s}`:i}else y(e)?(t=e.message,s=vt(e)):(g(e)||(r=v(e)))&&(i=r?e.constructor.name:void 0,t=`Non-Error exception captured with keys: ${Object.keys(e)}`);return[t,i,s]}function St(e){const[t,i,n,r,s]=e;let o,a,l=[];const u=c(t),d=ht(i,"?",n,r);return s||!u?([o,a,l]=yt(null!=s?s:t),0===l.length&&(l=[d])):u&&([o,a]=function(e){var t,i;const n=e.match(at),r=null!==(t=null==n?void 0:n[1])&&void 0!==t?t:te;return[null!==(i=null==n?void 0:n[2])&&void 0!==i?i:e,r]}(t),l=[d]),{value:o,type:a,stackFrames:l}}function Tt(e,t){return y(e[0])?St(e):{value:t(e)}}class Et extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=we,this.errorSerializer=se}initialize(){var t;const i=this.config.consoleInstrumentation,n=(null==i?void 0:i.serializeErrors)||!!(null==i?void 0:i.errorSerializer);this.errorSerializer=n?null!==(t=null==i?void 0:i.errorSerializer)&&void 0!==t?t:ie:se,j.filter(e=>{var t;return!(null!==(t=null==i?void 0:i.disabledLevels)&&void 0!==t?t:Et.defaultDisabledLevels).includes(e)}).forEach(t=>{console[t]=(...n)=>{try{if(t!==e.LogLevel.ERROR||(null==i?void 0:i.consoleErrorAsLog))if(t===e.LogLevel.ERROR&&(null==i?void 0:i.consoleErrorAsLog)){const{value:e,type:i,stackFrames:r}=Tt(n,this.errorSerializer);this.api.pushLog(e?[Et.consoleErrorPrefix+e]:n,{level:t,context:{value:null!=e?e:"",type:null!=i?i:"",stackFrames:(null==r?void 0:r.length)?ie(r):""}})}else this.api.pushLog(n,{level:t});else{const{value:e,type:t,stackFrames:i}=Tt(n,this.errorSerializer);if(e&&!t&&!i)return void this.api.pushError(new Error(Et.consoleErrorPrefix+e));this.api.pushError(new Error(Et.consoleErrorPrefix+e),{type:t,stackFrames:i})}}catch(e){this.logError(e)}finally{this.unpatchedConsole[t](...n)}}})}}Et.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG],Et.consoleErrorPrefix="console.error: ";class It extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=we}initialize(){var e;this.logDebug("Initializing"),function(e){const t=window.onerror;window.onerror=(...i)=>{try{const{value:t,type:n,stackFrames:r}=St(i),s=i[4];if(t){const i={type:n,stackFrames:r};null!=s&&(i.originalError=s),e.pushError(new Error(t),i)}}finally{null==t||t.apply(window,i)}}}(this.api),e=this.api,window.addEventListener("unhandledrejection",t=>{var i,n;let r,s,o=t;o.reason?o=t.reason:(null===(i=t.detail)||void 0===i?void 0:i.reason)&&(o=null===(n=t.detail)||void 0===n?void 0:n.reason);let a=[];h(o)?(r=`Non-Error promise rejection captured with value: ${String(o)}`,s="UnhandledRejection"):[r,s,a]=yt(o),r&&e.pushError(new Error(r),{type:s,stackFrames:a})})}}class kt extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=we}sendViewChangedEvent(e){var t,i,n,r;const s=e.view;s&&s.name!==(null===(t=this.notifiedView)||void 0===t?void 0:t.name)&&(this.api.pushEvent(Se,{fromView:null!==(n=null===(i=this.notifiedView)||void 0===i?void 0:i.name)&&void 0!==n?n:xe,toView:null!==(r=s.name)&&void 0!==r?r:xe},void 0,{skipDedupe:!0}),this.notifiedView=s)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}let xt=-1;const Ot=e=>{addEventListener("pageshow",t=>{t.persisted&&(xt=t.timeStamp,e(t))},!0)},Lt=(e,t,i,n)=>{let r,s;return o=>{t.value>=0&&(o||n)&&(s=t.value-(r??0),(s||void 0===r)&&(r=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,i),e(t)))}},At=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},Ct=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},_t=()=>{const e=Ct();return e?.activationStart??0},Pt=(e,t=-1)=>{const i=Ct();let n="navigate";return xt>=0?n="back-forward-cache":i&&(document.prerendering||_t()>0?n="prerender":document.wasDiscarded?n="restore":i.type&&(n=i.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},jt=new WeakMap;function Mt(e,t){return jt.get(e)||jt.set(e,new t),jt.get(e)}let Nt=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],i=this.o.at(-1);this.i&&t&&i&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}};const Ut=(e,t,i={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...i}),n}}catch{}},Dt=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Rt=-1;const Bt=new Set,Ft=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,zt=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of Bt)e();isFinite(Rt)||(Rt="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",zt,!0))}},qt=()=>{if(Rt<0){const e=_t(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;Rt=t??Ft(),addEventListener("visibilitychange",zt,!0),addEventListener("prerenderingchange",zt,!0),Ot(()=>{setTimeout(()=>{Rt=Ft()})})}return{get firstHiddenTime(){return Rt},onHidden(e){Bt.add(e)}}},Vt=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},$t=[1800,3e3],Ht=(e,t={})=>{Vt(()=>{const i=qt();let n,r=Pt("FCP");const s=Ut("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<i.firstHiddenTime&&(r.value=Math.max(t.startTime-_t(),0),r.entries.push(t),n(!0)))});s&&(n=Lt(e,r,$t,t.reportAllChanges),Ot(i=>{r=Pt("FCP"),n=Lt(e,r,$t,t.reportAllChanges),At(()=>{r.value=performance.now()-i.timeStamp,n(!0)})}))})},Gt=[.1,.25];let Wt=0,Kt=1/0,Xt=0;const Jt=e=>{for(const t of e)t.interactionId&&(Kt=Math.min(Kt,t.interactionId),Xt=Math.max(Xt,t.interactionId),Wt=Xt?(Xt-Kt)/7+1:0)};let Zt;const Yt=()=>Zt?Wt:performance.interactionCount??0;let Qt=0,ei=class{u=[];l=new Map;m;p;v(){Qt=Yt(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((Yt()-Qt)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let i=this.l.get(e.interactionId);if(i||this.u.length<10||e.duration>t.P){if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],P:e.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(i)}}};const ti=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Dt(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},ii=[200,500];let ni=class{m;h(e){this.m?.(e)}};const ri=[2500,4e3],si=[800,1800],oi=e=>{document.prerendering?Vt(()=>oi(e)):"complete"!==document.readyState?addEventListener("load",()=>oi(e),!0):setTimeout(e)};class ai{constructor(e,t){this.pushMeasurement=e,this.webVitalConfig=t}initialize(){Object.entries(ai.mapping).forEach(([e,t])=>{var i;t(t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})},{reportAllChanges:null===(i=this.webVitalConfig)||void 0===i?void 0:i.reportAllChanges})})}}ai.mapping={cls:(e,t={})=>{const i=qt();Ht(Dt(()=>{let n,r=Pt("CLS",0);const s=Mt(t,Nt),o=e=>{for(const t of e)s.h(t);s.i>r.value&&(r.value=s.i,r.entries=s.o,n())},a=Ut("layout-shift",o);a&&(n=Lt(e,r,Gt,t.reportAllChanges),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),Ot(()=>{s.i=0,r=Pt("CLS",0),n=Lt(e,r,Gt,t.reportAllChanges),At(()=>n())}),setTimeout(n))}))},fcp:Ht,inp:(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const i=qt();Vt(()=>{"interactionCount"in performance||Zt||(Zt=Ut("event",Jt,{type:"event",buffered:!0,durationThreshold:0}));let n,r=Pt("INP");const s=Mt(t,ei),o=e=>{ti(()=>{for(const t of e)s.h(t);const t=s.L();t&&t.P!==r.value&&(r.value=t.P,r.entries=t.entries,n())})},a=Ut("event",o,{durationThreshold:t.durationThreshold??40});n=Lt(e,r,ii,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),Ot(()=>{s.v(),r=Pt("INP"),n=Lt(e,r,ii,t.reportAllChanges)}))})},lcp:(e,t={})=>{Vt(()=>{const i=qt();let n,r=Pt("LCP");const s=Mt(t,ni),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)s.h(t),t.startTime<i.firstHiddenTime&&(r.value=Math.max(t.startTime-_t(),0),r.entries=[t],n())},a=Ut("largest-contentful-paint",o);if(a){n=Lt(e,r,ri,t.reportAllChanges);const i=Dt(()=>{o(a.takeRecords()),a.disconnect(),n(!0)}),s=e=>{e.isTrusted&&(ti(i),removeEventListener(e.type,s,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,s,{capture:!0});Ot(i=>{r=Pt("LCP"),n=Lt(e,r,ri,t.reportAllChanges),At(()=>{r.value=performance.now()-i.timeStamp,n(!0)})})}})},ttfb:(e,t={})=>{let i=Pt("TTFB"),n=Lt(e,i,si,t.reportAllChanges);oi(()=>{const r=Ct();r&&(i.value=Math.max(r.responseStart-_t(),0),i.entries=[r],n(!0),Ot(()=>{i=Pt("TTFB",0),n=Lt(e,i,si,t.reportAllChanges),n(!0)}))})}};class li{t;o=0;i=[];u(e){if(e.hadRecentInput)return;const t=this.i[0],i=this.i.at(-1);this.o&&t&&i&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),this.t?.(e)}}const ui=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ci=e=>{if("loading"===document.readyState)return"loading";{const t=ui();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}}return"complete"},di=e=>{const t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},pi=e=>{let t="";try{for(;9!==e?.nodeType;){const i=e,n=i.id?"#"+i.id:[di(i),...Array.from(i.classList).sort()].join(".");if(t.length+n.length>99)return t||n;if(t=t?n+">"+t:n,i.id)break;e=i.parentNode}}catch{}return t},gi=new WeakMap;function mi(e,t){return gi.get(e)||gi.set(e,new t),gi.get(e)}let fi=-1;const hi=()=>fi,bi=e=>{addEventListener("pageshow",t=>{t.persisted&&(fi=t.timeStamp,e(t))},!0)},vi=(e,t,i,n)=>{let r,s;return o=>{t.value>=0&&(o||n)&&(s=t.value-(r??0),(s||void 0===r)&&(r=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,i),e(t)))}},wi=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},yi=()=>{const e=ui();return e?.activationStart??0},Si=(e,t=-1)=>{const i=ui();let n="navigate";return hi()>=0?n="back-forward-cache":i&&(document.prerendering||yi()>0?n="prerender":document.wasDiscarded?n="restore":i.type&&(n=i.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},Ti=(e,t,i={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...i}),n}}catch{}},Ei=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Ii=-1;const ki=new Set,xi=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Oi=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of ki)e();isFinite(Ii)||(Ii="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Oi,!0))}},Li=()=>{if(Ii<0){const e=yi(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;Ii=t??xi(),addEventListener("visibilitychange",Oi,!0),addEventListener("prerenderingchange",Oi,!0),bi(()=>{setTimeout(()=>{Ii=xi()})})}return{get firstHiddenTime(){return Ii},onHidden(e){ki.add(e)}}},Ai=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Ci=[1800,3e3],_i=(e,t={})=>{Ai(()=>{const i=Li();let n,r=Si("FCP");const s=Ti("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<i.firstHiddenTime&&(r.value=Math.max(t.startTime-yi(),0),r.entries.push(t),n(!0)))});s&&(n=vi(e,r,Ci,t.reportAllChanges),bi(i=>{r=Si("FCP"),n=vi(e,r,Ci,t.reportAllChanges),wi(()=>{r.value=performance.now()-i.timeStamp,n(!0)})}))})},Pi=[.1,.25],ji=e=>e.find(e=>1===e.node?.nodeType)||e[0];let Mi=0,Ni=1/0,Ui=0;const Di=e=>{for(const t of e)t.interactionId&&(Ni=Math.min(Ni,t.interactionId),Ui=Math.max(Ui,t.interactionId),Mi=Ui?(Ui-Ni)/7+1:0)};let Ri;const Bi=()=>Ri?Mi:performance.interactionCount??0;let Fi=0;class zi{l=[];h=new Map;m;p;v(){Fi=Bi(),this.l.length=0,this.h.clear()}M(){const e=Math.min(this.l.length-1,Math.floor((Bi()-Fi)/50));return this.l[e]}u(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.l.at(-1);let i=this.h.get(e.interactionId);if(i||this.l.length<10||e.duration>t.T){if(i?e.duration>i.T?(i.entries=[e],i.T=e.duration):e.duration===i.T&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],T:e.duration},this.h.set(i.id,i),this.l.push(i)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10){const e=this.l.splice(10);for(const t of e)this.h.delete(t.id)}this.p?.(i)}}}const qi=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Ei(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},Vi=[200,500],$i=(e,t={})=>{const i=mi(t=Object.assign({},t),zi);let n=[],r=[],s=0;const o=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(qi(c),l=!0)},c=()=>{const e=i.l.map(e=>o.get(e.entries[0])),t=r.length-50;r=r.filter((i,n)=>n>=t||e.includes(i));const a=new Set;for(const e of r){const t=d(e.startTime,e.processingEnd);for(const e of t)a.add(e)}const u=n.length-1-50;n=n.filter((e,t)=>e.startTime>s&&t>u||a.has(e)),l=!1};i.m=e=>{const t=e.startTime+e.duration;let i;s=Math.max(s,e.processingEnd);for(let n=r.length-1;n>=0;n--){const s=r[n];if(Math.abs(t-s.renderTime)<=8){i=s,i.startTime=Math.min(e.startTime,i.startTime),i.processingStart=Math.min(e.processingStart,i.processingStart),i.processingEnd=Math.max(e.processingEnd,i.processingEnd),i.entries.push(e);break}}i||(i={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:t,entries:[e]},r.push(i)),(e.interactionId||"first-input"===e.entryType)&&o.set(e,i),u()},i.p=e=>{if(!a.get(e)){const i=e.entries[0].target;if(i){const n=t.generateTarget?.(i)??pi(i);a.set(e,n)}}};const d=(e,t)=>{const i=[];for(const r of n)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;i.push(r)}return i},p=e=>{const t=e.entries[0],n=o.get(t),r=t.processingStart,s=Math.max(t.startTime+t.duration,r),l=Math.min(n.processingEnd,s),u=n.entries.sort((e,t)=>e.processingStart-t.processingStart),c=d(t.startTime,l),p=i.h.get(t.interactionId),g={interactionTarget:a.get(p),interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:c,inputDelay:r-t.startTime,processingDuration:l-r,presentationDelay:s-l,loadState:ci(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{if(!e.longAnimationFrameEntries?.length)return;const t=e.interactionTime,i=e.inputDelay,n=e.processingDuration;let r,s,o=0,a=0,l=0,u=0;for(const l of e.longAnimationFrameEntries){a=a+l.startTime+l.duration-l.styleAndLayoutStart;for(const e of l.scripts){const l=e.startTime+e.duration;if(l<t)continue;const c=l-Math.max(t,e.startTime),d=e.duration?c/e.duration*e.forcedStyleAndLayoutDuration:0;o+=c-d,a+=d,c>u&&(s=e.startTime<t+i?"input-delay":e.startTime>=t+i+n?"presentation-delay":"processing-duration",r=e,u=c)}}const c=e.longAnimationFrameEntries.at(-1),d=c?c.startTime+c.duration:0;d>=t+i+n&&(l=e.nextPaintTime-d),r&&s&&(e.longestScript={entry:r,subpart:s,intersectingDuration:u}),e.totalScriptDuration=o,e.totalStyleAndLayoutDuration=a,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-t-o-a-l})(g),Object.assign(e,{attribution:g})};Ti("long-animation-frame",e=>{n=n.concat(e),u()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const i=Li();Ai(()=>{"interactionCount"in performance||Ri||(Ri=Ti("event",Di,{type:"event",buffered:!0,durationThreshold:0}));let n,r=Si("INP");const s=mi(t,zi),o=e=>{qi(()=>{for(const t of e)s.u(t);const t=s.M();t&&t.T!==r.value&&(r.value=t.T,r.entries=t.entries,n())})},a=Ti("event",o,{durationThreshold:t.durationThreshold??40});n=vi(e,r,Vi,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),bi(()=>{s.v(),r=Si("INP"),n=vi(e,r,Vi,t.reportAllChanges)}))})})(t=>{const i=p(t);e(i)},t)};class Hi{m;u(e){this.m?.(e)}}const Gi=[2500,4e3],Wi=[800,1800],Ki=e=>{document.prerendering?Ai(()=>Ki(e)):"complete"!==document.readyState?addEventListener("load",()=>Ki(e),!0):setTimeout(e)},Xi="com.grafana.faro.lastNavigationId",Ji="load_state",Zi="time_to_first_byte";class Yi{constructor(e,t){this.corePushMeasurement=e,this.webVitalConfig=t}initialize(){this.measureCLS(),this.measureFCP(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){var e;((e,t={})=>{const i=mi(t=Object.assign({},t),li),n=new WeakMap;i.t=e=>{if(e?.sources?.length){const i=ji(e.sources),r=i?.node;if(r){const e=t.generateTarget?.(r)??pi(r);n.set(i,e)}}},((e,t={})=>{const i=Li();_i(Ei(()=>{let n,r=Si("CLS",0);const s=mi(t,li),o=e=>{for(const t of e)s.u(t);s.o>r.value&&(r.value=s.o,r.entries=s.i,n())},a=Ti("layout-shift",o);a&&(n=vi(e,r,Pi,t.reportAllChanges),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),bi(()=>{s.o=0,r=Si("CLS",0),n=vi(e,r,Pi,t.reportAllChanges),wi(()=>n())}),setTimeout(n))}))})(t=>{const i=(e=>{let t={};if(e.entries.length){const i=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(i?.sources?.length){const e=ji(i.sources);e&&(t={largestShiftTarget:n.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:ci(i.startTime)})}}return Object.assign(e,{attribution:t})})(t);e(i)},t)})(e=>{const{loadState:t,largestShiftValue:i,largestShiftTime:n,largestShiftTarget:r}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"largest_shift_value",i),this.addIfPresent(s,"largest_shift_time",n);const o=this.buildInitialContext(e);this.addIfPresent(o,Ji,t),this.addIfPresent(o,"largest_shift_target",r),this.pushMeasurement(s,o)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFCP(){var e;((e,t={})=>{_i(t=>{const i=(e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ci(hi())};if(e.entries.length){const i=ui(),n=e.entries.at(-1);if(i){const r=i.activationStart||0,s=Math.max(0,i.responseStart-r);t={timeToFirstByte:s,firstByteToFCP:e.value-s,loadState:ci(e.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}return Object.assign(e,{attribution:t})})(t);e(i)},t)})(e=>{const{firstByteToFCP:t,timeToFirstByte:i,loadState:n}=e.attribution,r=this.buildInitialValues(e);this.addIfPresent(r,"first_byte_to_fcp",t),this.addIfPresent(r,Zi,i);const s=this.buildInitialContext(e);this.addIfPresent(s,Ji,n),this.pushMeasurement(r,s)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureINP(){var e;$i(e=>{const{interactionTime:t,presentationDelay:i,inputDelay:n,processingDuration:r,nextPaintTime:s,loadState:o,interactionTarget:a,interactionType:l}=e.attribution,u=this.buildInitialValues(e);this.addIfPresent(u,"interaction_time",t),this.addIfPresent(u,"presentation_delay",i),this.addIfPresent(u,"input_delay",n),this.addIfPresent(u,"processing_duration",r),this.addIfPresent(u,"next_paint_time",s);const c=this.buildInitialContext(e);this.addIfPresent(c,Ji,o),this.addIfPresent(c,"interaction_target",a),this.addIfPresent(c,"interaction_type",l),this.pushMeasurement(u,c)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureLCP(){var e;((e,t={})=>{const i=mi(t=Object.assign({},t),Hi),n=new WeakMap;i.m=e=>{const i=e.element;if(i){const r=t.generateTarget?.(i)??pi(i);n.set(e,r)}},((e,t={})=>{Ai(()=>{const i=Li();let n,r=Si("LCP");const s=mi(t,Hi),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)s.u(t),t.startTime<i.firstHiddenTime&&(r.value=Math.max(t.startTime-yi(),0),r.entries=[t],n())},a=Ti("largest-contentful-paint",o);if(a){n=vi(e,r,Gi,t.reportAllChanges);const i=Ei(()=>{o(a.takeRecords()),a.disconnect(),n(!0)}),s=e=>{e.isTrusted&&(qi(i),removeEventListener(e.type,s,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,s,{capture:!0});bi(i=>{r=Si("LCP"),n=vi(e,r,Gi,t.reportAllChanges),wi(()=>{r.value=performance.now()-i.timeStamp,n(!0)})})}})})(t=>{const i=(e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){const i=ui();if(i){const r=i.activationStart||0,s=e.entries.at(-1),o=s.url&&performance.getEntriesByType("resource").filter(e=>e.name===s.url)[0],a=Math.max(0,i.responseStart-r),l=Math.max(a,o?(o.requestStart||o.startTime)-r:0),u=Math.min(e.value,Math.max(l,o?o.responseEnd-r:0));t={target:n.get(s),timeToFirstByte:a,resourceLoadDelay:l-a,resourceLoadDuration:u-l,elementRenderDelay:e.value-u,navigationEntry:i,lcpEntry:s},s.url&&(t.url=s.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})})(t);e(i)},t)})(e=>{const{elementRenderDelay:t,resourceLoadDelay:i,resourceLoadDuration:n,timeToFirstByte:r,target:s}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"element_render_delay",t),this.addIfPresent(o,"resource_load_delay",i),this.addIfPresent(o,"resource_load_duration",n),this.addIfPresent(o,Zi,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",s),this.pushMeasurement(o,a)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureTTFB(){var e;((e,t={})=>{((e,t={})=>{let i=Si("TTFB"),n=vi(e,i,Wi,t.reportAllChanges);Ki(()=>{const r=ui();r&&(i.value=Math.max(r.responseStart-yi(),0),i.entries=[r],n(!0),bi(()=>{i=Si("TTFB",0),n=vi(e,i,Wi,t.reportAllChanges),n(!0)}))})})(t=>{const i=(e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){const i=e.entries[0],n=i.activationStart||0,r=Math.max((i.workerStart||i.fetchStart)-n,0),s=Math.max(i.domainLookupStart-n,0),o=Math.max(i.connectStart-n,0),a=Math.max(i.connectEnd-n,0);t={waitingDuration:r,cacheDuration:s-r,dnsDuration:o-s,connectionDuration:a-o,requestDuration:e.value-a,navigationEntry:i}}return Object.assign(e,{attribution:t})})(t);e(i)},t)})(e=>{const{dnsDuration:t,connectionDuration:i,requestDuration:n,waitingDuration:r,cacheDuration:s}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"dns_duration",t),this.addIfPresent(o,"connection_duration",i),this.addIfPresent(o,"request_duration",n),this.addIfPresent(o,"waiting_duration",r),this.addIfPresent(o,"cache_duration",s);const a=this.buildInitialContext(e);this.pushMeasurement(o,a)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const i=null!==(t=Ue(Xi,je))&&void 0!==t?t:xe;return{id:e.id,rating:e.rating,navigation_type:e.navigationType,navigation_entry_id:i}}pushMeasurement(e,t){this.corePushMeasurement({type:"web-vitals",values:e},{context:t})}addIfPresent(e,t,i){i&&(e[t]=i)}}class Qi extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=we}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){var e,t,i;return!1===(null===(e=this.config)||void 0===e?void 0:e.trackWebVitalsAttribution)||!1===(null===(i=null===(t=this.config)||void 0===t?void 0:t.webVitalsInstrumentation)||void 0===i?void 0:i.trackAttribution)?new ai(this.api.pushMeasurement,this.config.webVitalsInstrumentation):new Yi(this.api.pushMeasurement,this.config.webVitalsInstrumentation)}}function en(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function tn(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const nn="resource",rn=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function sn(e=[]){for(const t of e)if("traceparent"===t.name){if(!rn.test(t.description))continue;const[,e,i]=t.description.split("-");if(null!=e&&null!=i)return{traceId:e,spanId:i};break}}function on(e,t={}){for(const[i,n]of Object.entries(t)){const t=e[i];return null!=t&&(f(n)?n.includes(t):t===n)}return!0}function an(e){const{connectEnd:t,connectStart:i,decodedBodySize:n,domainLookupEnd:r,domainLookupStart:s,duration:o,encodedBodySize:a,fetchStart:l,initiatorType:u,name:c,nextHopProtocol:d,redirectEnd:p,redirectStart:g,renderBlockingStatus:m,requestStart:f,responseEnd:h,responseStart:b,responseStatus:v,secureConnectionStart:w,transferSize:y,workerStart:S}=e;return{name:c,duration:un(o),tcpHandshakeTime:un(t-i),dnsLookupTime:un(r-s),tlsNegotiationTime:un(t-w),responseStatus:un(v),redirectTime:un(p-g),requestTime:un(b-f),responseTime:un(h-b),fetchTime:un(h-l),serviceWorkerTime:un(l-S),decodedBodySize:un(n),encodedBodySize:un(a),cacheHitStatus:function(){let e="fullLoad";0===y?n>0&&(e="cache"):null!=v?304===v&&(e="conditionalFetch"):a>0&&y<a&&(e="conditionalFetch");return e}(),renderBlockingStatus:un(m),protocol:d,initiatorType:u,visibilityState:document.visibilityState,ttfb:un(b-f),transferSize:un(y)}}function ln(e){const{activationStart:t,domComplete:i,domContentLoadedEventEnd:n,domContentLoadedEventStart:r,domInteractive:s,fetchStart:o,loadEventEnd:a,loadEventStart:l,responseStart:u,type:c}=e,d=function(){var e;if(null!=(null===(e=performance.timing)||void 0===e?void 0:e.domLoading))return performance.timing.domLoading-performance.timeOrigin;return null}();return Object.assign(Object.assign({},an(e)),{pageLoadTime:un(i-o),documentParsingTime:un(d?s-d:null),domProcessingTime:un(i-s),domContentLoadHandlerTime:un(n-r),onLoadTime:un(a-l),ttfb:un(Math.max(u-(null!=t?t:0),0)),type:c})}function un(e){return null==e?xe:"number"==typeof e?Math.round(e>0?e:0).toString():e.toString()}const cn={initiatorType:["xmlhttprequest","fetch"]};const dn=new z;class pn extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=we}initialize(){"PerformanceObserver"in window?function(e){if("complete"===document.readyState)e();else{const t=()=>{"complete"===document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}(()=>tn(this,void 0,void 0,function*(){const t=this.api.pushEvent,{faroNavigationId:i}=yield function(e){let t;const i=new Promise(e=>{t=e});return new PerformanceObserver(i=>{var n;const[r]=i.getEntries();if(null==r||$e(r.name))return;const s=r.toJSON();let o=sn(null==s?void 0:s.serverTiming);const a=null!==(n=Ue(Xi,je))&&void 0!==n?n:xe,l=Object.assign(Object.assign({},ln(s)),{faroNavigationId:D(),faroPreviousNavigationId:a});De(Xi,l.faroNavigationId,je),e("faro.performance.navigation",l,void 0,{spanContext:o,timestampOverwriteMs:performance.timeOrigin+s.startTime}),t(l)}).observe({type:"navigation",buffered:!0}),i}(t);null!=i&&function(t,i,n){const r=e.faro.config.trackResources;new PerformanceObserver(s=>{const o=s.getEntries();for(const s of o){if($e(s.name))return;const o=s.toJSON();let a=sn(null==o?void 0:o.serverTiming);if(null==r&&on(o,cn)||r){const r=Object.assign(Object.assign({},an(o)),{faroNavigationId:t,faroResourceId:D()});e.faro.config.trackUserActionsPreview&&(null==n||n.notify({type:nn})),i("faro.performance.resource",r,void 0,{spanContext:a,timestampOverwriteMs:performance.timeOrigin+o.startTime})}}}).observe({type:nn,buffered:!0})}(i,t,dn)})):this.logDebug("performance observer not supported. Disable performance instrumentation.")}}const gn="http-request-start",mn="http-request-end",fn="data-faro-user-action-name";const hn="fetch",bn="xhr";function vn(){const e=new z;function t(t){e.notify({type:gn,request:t})}function i(t){e.notify({type:mn,request:t})}return function({onRequestEnd:e,onRequestStart:t}){const i=window.fetch;window.fetch=function(){var n,r;const s=null!==(n=He(arguments[0]))&&void 0!==n?n:"",o=$e(s),a=(null!==(r=arguments[1])&&void 0!==r?r:{}).method,l=D();return o||t({url:s,method:a,requestId:l,apiType:hn}),i.apply(this,arguments).then(t=>(o||e({url:s,method:a,requestId:l,apiType:hn}),t)).catch(t=>{throw o||e({url:s,method:a,requestId:l,apiType:hn}),t})}}({onRequestStart:t,onRequestEnd:i}),function({onRequestStart:e,onRequestEnd:t}){const i=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){const n=arguments[1],r=$e(n),s=arguments[0],o=D();this.addEventListener("loadstart",function(){r||e({url:n,method:s,requestId:o,apiType:bn})}),this.addEventListener("load",function(){r||t({url:n,method:s,requestId:o,apiType:bn})}),this.addEventListener("error",function(){r||t({url:n,method:s,requestId:o,apiType:bn})}),this.addEventListener("abort",function(){r||t({url:n,method:s,requestId:o,apiType:bn})}),i.apply(this,arguments)}}({onRequestStart:t,onRequestEnd:i}),e}function wn(e){const{api:t,config:i}=e,n=vn(),r=function(){const e=new z;return new MutationObserver((t,i)=>{e.notify({type:"dom-mutation"})}).observe(document,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e}(),s=function(){const e=new z;return dn.subscribe(t=>{t.type===nn&&e.notify({type:"resource-entry"})}),e}();function o(e){const t=new Map,i=(new z).merge(n,r,s).takeWhile(()=>[ae.Started,ae.Halted].includes(e.getState())).filter(i=>!!(e.getState()!==ae.Halted||yn(i)&&t.has(i.request.requestId))).subscribe(i=>{(function(e){return e.type===gn})(i)&&t.set(i.request.requestId,i.request),yn(i)&&t.delete(i.request.requestId),yn(i)?e.getState()===ae.Halted&&0===t.size&&e.end():e.extend(()=>t.size>0)});e.filter(e=>[ae.Ended,ae.Cancelled].includes(e)).first().subscribe(()=>{!function(e){null==e||e.unsubscribe(),e=void 0}(i)})}return{processUserEvent:function(e){var n;const r=function(e,t){const i=function(e){const t=e.split("data-")[1],i=null==t?void 0:t.replace(/-(.)/g,(e,t)=>t.toUpperCase());return null==i?void 0:i.replace(/-/g,"")}(t),n=e.dataset;for(const e in n)if(e===i)return n[e];return}(e.target,null!==(n=i.trackUserActionsDataAttributeName)&&void 0!==n?n:"faroUserActionName");if(!r)return;const s=t.startUserAction(r,{},{triggerName:e.type});s&&o(s)},proceessUserActionStarted:o}}function yn(e){return e.type===mn}class Sn extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-user-action",this.version=we}initialize(){const{processUserEvent:t,proceessUserActionStarted:i}=wn(e.faro);window.addEventListener("pointerdown",t),window.addEventListener("keydown",e=>{[" ","Enter"].includes(e.key)&&t(e)}),this._userActionSub=he.subscribe(({type:e,userAction:t})=>{"user_action_start"===e&&i(t)})}destroy(){var e;null===(e=this._userActionSub)||void 0===e||e.unsubscribe()}}class Tn extends ve{constructor(){super(),this.name="@grafana/faro-web-sdk:instrumentation-csp",this.version=we}initialize(){document.addEventListener("securitypolicyviolation",this.securitypolicyviolationHandler.bind(this))}destroy(){document.removeEventListener("securitypolicyviolation",this.securitypolicyviolationHandler)}securitypolicyviolationHandler(e){this.api.pushEvent("securitypolicyviolation",F(e))}}function En(e={}){const t=[new Sn,new It,new Qi,new ot,new kt];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new pn),!1!==e.enableContentSecurityPolicyInstrumentation&&t.push(new Tn),!1!==e.captureConsole&&t.push(new Et),t}const In="browser",kn=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};let xn,On;function Ln({generatePageId:e,initialPageMeta:t}={}){return()=>{const i=location.href;return m(e)&&xn!==i&&(xn=i,On=e(location)),{page:Object.assign(Object.assign({url:i},On?{id:On}:{}),t)}}}class An extends Y{constructor(e){var t,i,n,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=we,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(t=e.defaultRateLimitBackoffMs)&&void 0!==t?t:5e3,this.getNow=null!==(i=e.getNow)&&void 0!==i?i:()=>Date.now(),this.promiseBuffer=N({size:null!==(n=e.bufferSize)&&void 0!==n?n:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return tn(this,void 0,void 0,function*(){try{if(this.disabledUntil>new Date(this.getNow()))return this.logWarn(`Dropping transport item due to too many requests. Backoff until ${this.disabledUntil}`),Promise.resolve();yield this.promiseBuffer.add(()=>{const t=JSON.stringify(ee(e)),{url:i,requestOptions:n,apiKey:r}=this.options,s=null!=n?n:{},{headers:o}=s,a=en(s,["headers"]);let l;const u=this.metas.value.session;return null!=u&&(l=u.id),fetch(i,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=o?o:{}),r?{"x-api-key":r}:{}),l?{"x-faro-session-id":l}:{}),body:t,keepalive:t.length<=6e4},null!=a?a:{})).then(e=>tn(this,void 0,void 0,function*(){if(202===e.status){"invalid"===e.headers.get("X-Faro-Session-Status")&&this.extendFaroSession(this.config,this.logDebug)}return 429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(M),e})).catch(e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(t),e)})})}catch(e){this.logError(e)}})}getIgnoreUrls(){var e;return[this.options.url].concat(null!==(e=this.config.ignoreUrls)&&void 0!==e?e:[])}isBatched(){return!0}getRetryAfterDate(e){const t=this.getNow(),i=e.headers.get("Retry-After");if(i){const e=Number(i);if(!isNaN(e))return new Date(1e3*e+t);const n=Date.parse(i);if(!isNaN(n))return new Date(n)}return new Date(t+this.rateLimitBackoffMs)}extendFaroSession(e,t){const i="Session expired",n=e.sessionTracking;if(null==n?void 0:n.enabled){const{fetchUserSession:e,storeUserSession:r}=st(n);et({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${i} created new session.`)}else t(`${i}.`)}}function Cn(e){var t;const i=[],n=K(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&n.error('if "transports" is defined, "url" and "apiKey" should not be defined'),i.push(...e.transports)):e.url?i.push(new An({url:e.url,apiKey:e.apiKey})):n.error('either "url" or "transports" must be defined');const{dedupe:r=!0,eventDomain:s=In,globalObjectKey:o=le,instrumentations:a=En(),internalLoggerLevel:l=$,isolate:u=!1,logArgsSerializer:c=se,metas:d=Pn(e),paused:p=!1,preventGlobalExposure:g=!1,unpatchedConsole:m=H,trackUserActionsPreview:f=!1,trackUserActionsDataAttributeName:h=fn,url:b}=e,v=en(e,["dedupe","eventDomain","globalObjectKey","instrumentations","internalLoggerLevel","isolate","logArgsSerializer","metas","paused","preventGlobalExposure","unpatchedConsole","trackUserActionsPreview","trackUserActionsDataAttributeName","url"]);return Object.assign(Object.assign({},v),{batching:Object.assign(Object.assign({},ue),e.batching),dedupe:r,globalObjectKey:o,instrumentations:_n(a,e),internalLoggerLevel:l,isolate:u,logArgsSerializer:c,metas:d,parseStacktrace:wt,paused:p,preventGlobalExposure:g,transports:i,unpatchedConsole:m,eventDomain:s,ignoreUrls:[...null!==(t=e.ignoreUrls)&&void 0!==t?t:[],...b?[b]:[],/\/collect(?:\/[\w]*)?$/],sessionTracking:Object.assign(Object.assign(Object.assign({},Je),e.sessionTracking),jn({trackGeolocation:e.trackGeolocation,sessionTracking:e.sessionTracking})),trackUserActionsPreview:f,trackUserActionsDataAttributeName:h})}function _n(e,{trackUserActionsPreview:t}){return e.filter(e=>!("@grafana/faro-web-sdk:instrumentation-user-action"===e.name&&!t))}function Pn(e){var t,i;const{page:n,generatePageId:r}=null!==(t=null==e?void 0:e.pageTracking)&&void 0!==t?t:{},s=[_e,Ln({generatePageId:r,initialPageMeta:n}),...null!==(i=e.metas)&&void 0!==i?i:[]];return g(window.k6)?[...s,kn]:s}function jn({trackGeolocation:e,sessionTracking:t}){var i;const n={};return p(e)&&(n.geoLocationTrackingEnabled=e),x(n)?{}:{session:Object.assign(Object.assign({},null!==(i=null==t?void 0:t.session)&&void 0!==i?i:{}),{overrides:n})}}return e.BaseExtension=Z,e.BaseInstrumentation=ve,e.BaseTransport=Y,e.CSPInstrumentation=Tn,e.ConsoleInstrumentation=Et,e.ConsoleTransport=class extends Y{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=we}send(t){var i;return this.unpatchedConsole[null!==(i=this.options.level)&&void 0!==i?i:e.LogLevel.DEBUG]("New event",ee([t]))}},e.EVENT_CLICK="click",e.EVENT_NAVIGATION="navigation",e.EVENT_ROUTE_CHANGE="route_change",e.EVENT_SESSION_EXTEND=Ie,e.EVENT_SESSION_RESUME=Ee,e.EVENT_SESSION_START=Te,e.EVENT_VIEW_CHANGED=Se,e.ErrorsInstrumentation=It,e.FetchTransport=An,e.MAX_SESSION_PERSISTENCE_TIME=Xe,e.Observable=z,e.PerformanceInstrumentation=pn,e.PersistentSessionsManager=nt,e.SESSION_EXPIRATION_TIME=We,e.SESSION_INACTIVITY_TIME=Ke,e.STORAGE_KEY=Ge,e.SessionInstrumentation=ot,e.UserActionInstrumentation=Sn,e.VERSION=we,e.ViewInstrumentation=kt,e.VolatileSessionsManager=rt,e.WebVitalsInstrumentation=Qi,e.allLogLevels=j,e.browserMeta=_e,e.buildStackFrame=ht,e.createInternalLogger=K,e.createPromiseBuffer=N,e.createSession=Pe,e.deepEqual=O,e.defaultEventDomain=In,e.defaultExceptionType=te,e.defaultGlobalObjectKey=le,e.defaultInternalLoggerLevel=$,e.defaultLogLevel=P,e.genShortID=D,e.getCurrentTimestamp=A,e.getDataFromSafariExtensions=bt,e.getIgnoreUrls=Ve,e.getInternalFaroFromGlobalObject=function(){return R[ce]},e.getStackFramesFromError=vt,e.getTransportBody=ee,e.getUrlFromResource=He,e.getWebInstrumentations=En,e.globalObject=R,e.initializeFaro=function(e){const t=Cn(e);if(t)return ye(t)},e.internalGlobalObjectKey=ce,e.isArray=f,e.isBoolean=p,e.isDomError=T,e.isDomException=E,e.isElement=e=>I&&l(e,Element),e.isElementDefined=I,e.isEmpty=x,e.isError=y,e.isErrorDefined=w,e.isErrorEvent=S,e.isEvent=v,e.isEventDefined=b,e.isFunction=m,e.isInstanceOf=l,e.isInt=e=>d(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=pe,e.isMap=e=>k&&l(e,Map),e.isMapDefined=k,e.isNull=u,e.isNumber=d,e.isObject=g,e.isPrimitive=h,e.isRegExp=e=>a(e,"RegExp"),e.isString=c,e.isSymbol=e=>o(e,"symbol"),e.isSyntheticEvent=e=>g(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>m(null==e?void 0:e.then),e.isToString=a,e.isTypeof=o,e.isUndefined=e=>o(e,"undefined"),e.makeCoreConfig=Cn,e.noop=M,e.parseStacktrace=wt,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:we,integrations:e.faro.config.instrumentations.map(({name:e,version:t})=>({name:e,version:t}))}}),e.setInternalFaroOnGlobalObject=de,e.transportItemTypeToBodyKey=n,e.unknownString=xe,e.userActionDataAttribute=fn,e}({});
1
+ var GrafanaFaroWebSdk=function(e){"use strict";class t{constructor(e,t){var i,n;this.signalBuffer=[],this.itemLimit=null!==(i=null==t?void 0:t.itemLimit)&&void 0!==i?i:50,this.sendTimeout=null!==(n=null==t?void 0:t.sendTimeout)&&void 0!==n?n:250,this.paused=(null==t?void 0:t.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.flush()})}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval(()=>this.flush(),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const t=new Map;return e.forEach(e=>{const i=JSON.stringify(e.meta);let n=t.get(i);n=void 0===n?[e]:[...n,e],t.set(i,n)}),Array.from(t.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var i;e.TransportItemType=void 0,(i=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",i.LOG="log",i.MEASUREMENT="measurement",i.TRACE="trace",i.EVENT="event";const n={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function r(e,i,n,r){var o;i.debug("Initializing transports");const a=[];let l=n.paused,u=[];const c=e=>{let t=e;for(const e of u){const i=t.map(e).filter(Boolean);if(0===i.length)return[];t=s(i,n)}return t},d=e=>{const t=c(e);if(0!==t.length)for(const e of a)i.debug(`Transporting item using ${e.name}\n`,t),e.isBatched()&&e.send(t)};let p;(null===(o=n.batching)||void 0===o?void 0:o.enabled)&&(p=new t(d,{sendTimeout:n.batching.sendTimeout,itemLimit:n.batching.itemLimit,paused:l}));return{add:(...t)=>{i.debug("Adding transports"),t.forEach(t=>{i.debug(`Adding "${t.name}" transport`);a.some(e=>e===t)?i.warn(`Transport ${t.name} is already added`):(t.unpatchedConsole=e,t.internalLogger=i,t.config=n,t.metas=r,a.push(t))})},addBeforeSendHooks:(...e)=>{i.debug("Adding beforeSendHooks\n",u),e.forEach(e=>{e&&u.push(e)})},getBeforeSendHooks:()=>[...u],execute:e=>{var t;l||((null===(t=n.batching)||void 0===t?void 0:t.enabled)&&(null==p||p.addItem(e)),(e=>{var t,r;if((null===(t=n.batching)||void 0===t?void 0:t.enabled)&&a.every(e=>e.isBatched()))return;const[s]=c([e]);if(void 0!==s)for(const e of a)i.debug(`Transporting item using ${e.name}\n`,s),e.isBatched()?(null===(r=n.batching)||void 0===r?void 0:r.enabled)||e.send([s]):e.send(s)})(e))},isPaused:()=>l,pause:()=>{i.debug("Pausing transports"),null==p||p.pause(),l=!0},remove:(...e)=>{i.debug("Removing transports"),e.forEach(e=>{i.debug(`Removing "${e.name}" transport`);const t=a.indexOf(e);-1!==t?a.splice(t,1):i.warn(`Transport "${e.name}" is not added`)})},removeBeforeSendHooks:(...e)=>{u.filter(t=>!e.includes(t))},get transports(){return[...a]},unpause:()=>{i.debug("Unpausing transports"),null==p||p.start(),l=!1}}}function s(t,i){if(i.preserveOriginalError)for(const i of t)i.type===e.TransportItemType.EXCEPTION&&delete i.payload.originalError;return t}function o(e,t){return typeof e===t}function a(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function l(e,t){try{return e instanceof t}catch(e){return!1}}const u=e=>o(e,"null"),c=e=>o(e,"string"),d=e=>o(e,"number")&&!isNaN(e)||o(e,"bigint"),p=e=>o(e,"boolean"),g=e=>!u(e)&&o(e,"object"),m=e=>o(e,"function"),f=e=>a(e,"Array"),h=e=>!g(e)&&!m(e),b="undefined"!=typeof Event,v=e=>b&&l(e,Event),w="undefined"!=typeof Error,y=e=>w&&l(e,Error),S=e=>a(e,"ErrorEvent"),T=e=>a(e,"DOMError"),E=e=>a(e,"DOMException"),I="undefined"!=typeof Element,k="undefined"!=typeof Map;function x(e){return null==e||(f(e)||c(e)?0===e.length:!!g(e)&&0===Object.keys(e).length)}function O(e,t){if(e===t)return!0;if(o(e,"number")&&isNaN(e))return o(t,"number")&&isNaN(t);const i=f(e),n=f(t);if(i!==n)return!1;if(i&&n){const i=e.length;if(i!==t.length)return!1;for(let n=i;0!==n--;)if(!O(e[n],t[n]))return!1;return!0}const r=g(e),s=g(t);if(r!==s)return!1;if(e&&t&&r&&s){const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(let e of i)if(!n.includes(e))return!1;for(let n of i)if(!O(e[n],t[n]))return!1;return!0}return!1}function A(){return Date.now()}function L(){return(new Date).toISOString()}function C(e){return new Date(e).toISOString()}var _;e.LogLevel=void 0,(_=e.LogLevel||(e.LogLevel={})).TRACE="trace",_.DEBUG="debug",_.INFO="info",_.LOG="log",_.WARN="warn",_.ERROR="error";const P=e.LogLevel.LOG,j=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function U(){}function M(e){const{size:t,concurrency:i}=e,n=[];let r=0;const s=()=>{if(r<i&&n.length){const{producer:e,resolve:t,reject:i}=n.shift();r++,e().then(e=>{r--,s(),t(e)},e=>{r--,s(),i(e)})}};return{add:e=>{if(n.length+r>=t)throw new Error("Task buffer full");return new Promise((t,i)=>{n.push({producer:e,resolve:t,reject:i}),s()})}}}const N="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function D(e=10){return Array.from(Array(e)).map(()=>N[Math.floor(59*Math.random())]).join("")}const R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;function B(e={}){return JSON.stringify(null!=e?e:{},function(){const e=new WeakSet;return function(t,i){if(g(i)&&null!==i){if(e.has(i))return null;e.add(i)}return i}}())}function F(e={}){const t={};for(const[i,n]of Object.entries(e))t[i]=g(n)&&null!==n?B(n):String(n);return t}class z{constructor(){this.subscribers=[]}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>this.unsubscribe(e)}}unsubscribe(e){this.subscribers=this.subscribers.filter(t=>t!==e)}notify(e){this.subscribers.forEach(t=>t(e))}first(){const e=new z,t=t=>{e.notify(t),i.unsubscribe()},i=this.subscribe(t),n=e.unsubscribe.bind(e);return this.withUnsubscribeOverride(e,n,t)}takeWhile(e){const t=new z,i=n=>{e(n)?t.notify(n):t.unsubscribe(i)};this.subscribe(i);const n=t.unsubscribe.bind(t);return this.withUnsubscribeOverride(t,n,i)}filter(e){const t=new z,i=i=>{e(i)&&t.notify(i)};this.subscribe(i);const n=t.unsubscribe.bind(t);return this.withUnsubscribeOverride(t,n,i)}merge(...e){const t=new z,i=[];e.forEach(e=>{const n=e.subscribe(e=>{t.notify(e)});i.push(n)});const n=t.unsubscribeAll.bind(t);return t.unsubscribe=()=>{i.forEach(e=>e.unsubscribe()),n()},t}withUnsubscribeOverride(e,t,i){return e.unsubscribe=e=>{t(e),this.unsubscribe(i)},e}unsubscribeAll(){this.subscribers=[]}}var q;e.InternalLoggerLevel=void 0,(q=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[q.OFF=0]="OFF",q[q.ERROR=1]="ERROR",q[q.WARN=2]="WARN",q[q.INFO=3]="INFO",q[q.VERBOSE=4]="VERBOSE";const V={debug:U,error:U,info:U,prefix:"Faro",warn:U},$=e.InternalLoggerLevel.ERROR,H=Object.assign({},console);let G=H;function W(e){var t;return G=null!==(t=e.unpatchedConsole)&&void 0!==t?t:G,G}function K(t=H,i=$){const n=V;return i>e.InternalLoggerLevel.OFF&&(n.error=i>=e.InternalLoggerLevel.ERROR?function(...e){t.error(`${n.prefix}\n`,...e)}:U,n.warn=i>=e.InternalLoggerLevel.WARN?function(...e){t.warn(`${n.prefix}\n`,...e)}:U,n.info=i>=e.InternalLoggerLevel.INFO?function(...e){t.info(`${n.prefix}\n`,...e)}:U,n.debug=i>=e.InternalLoggerLevel.VERBOSE?function(...e){t.debug(`${n.prefix}\n`,...e)}:U),n}let X=V;function J(e,t){return X=K(e,t.internalLoggerLevel),X}class Z{constructor(){this.unpatchedConsole=H,this.internalLogger=V,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 Z{isBatched(){return!1}getIgnoreUrls(){return[]}}function Q(e,t){var i,n;if(void 0===t)return e;if(void 0===e)return{resourceSpans:t};const r=null===(i=e.resourceSpans)||void 0===i?void 0:i[0];if(void 0===r)return e;const s=(null==r?void 0:r.scopeSpans)||[],o=(null===(n=null==t?void 0:t[0])||void 0===n?void 0:n.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...s,...o]})]})}function ee(t){let i={meta:{}};return void 0!==t[0]&&(i.meta=t[0].meta),t.forEach(t=>{switch(t.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const r=n[t.type],s=i[r];i=Object.assign(Object.assign({},i),{[r]:void 0===s?[t.payload]:[...s,t.payload]});break;case e.TransportItemType.TRACE:i=Object.assign(Object.assign({},i),{traces:Q(i.traces,t.payload.resourceSpans)})}}),i}const te="Error",ie=e=>e.map(e=>g(e)?B(e):String(e)).join(" ");let ne;function re({internalLogger:t,config:i,metas:n,transports:r,tracesApi:s,userActionsApi:o}){var a;t.debug("Initializing exceptions API");let l=null;ne=null!==(a=i.parseStacktrace)&&void 0!==a?a:ne;const d=e=>{t.debug("Changing stacktrace parser"),ne=null!=e?e:ne},{ignoreErrors:p=[],preserveOriginalError:m}=i;return d(i.parseStacktrace),{changeStacktraceParser:d,getStacktraceParser:()=>ne,pushError:(a,{skipDedupe:d,stackFrames:h,type:b,context:v,spanContext:w,timestampOverwriteMs:S,originalError:T}={})=>{if(!function(e,t){const{message:i,name:n,stack:r}=t;return s=e,o=i+" "+n+" "+r,s.some(e=>c(e)?o.includes(e):!!o.match(e));var s,o}(p,null!=T?T:a))try{const c=F(Object.assign(Object.assign({},function(e){let t=e.cause;y(t)?t=e.cause.toString():null!==t&&(g(e.cause)||f(e.cause))?t=B(e.cause):null!=t&&(t=e.cause.toString());return null==t?{}:{cause:t}}(null!=T?T:a)),null!=v?v:{})),p={meta:n.value,payload:Object.assign(Object.assign({type:b||a.name||te,value:a.message,timestamp:S?C(S):L(),trace:w?{trace_id:w.traceId,span_id:w.spanId}:s.getTraceContext()},x(c)?{}:{context:c}),m?{originalError:T}:{}),type:e.TransportItemType.EXCEPTION};(null==(h=null!=h?h:a.stack?null==ne?void 0:ne(a).frames:void 0)?void 0:h.length)&&(p.payload.stacktrace={frames:h});const E={type:p.payload.type,value:p.payload.value,stackTrace:p.payload.stacktrace,context:p.payload.context};if(!d&&i.dedupe&&!u(l)&&O(E,l))return void t.debug("Skipping error push because it is the same as the last one\n",p.payload);l=E,t.debug("Pushing exception\n",p);const I=o.getActiveUserAction();I?I.addItem(p):r.execute(p)}catch(e){t.error("Error pushing event",e)}}}}const se=e=>e.map(e=>{try{return String(e)}catch(e){return""}}).join(" ");var oe,ae;!function(e){e.Normal="normal",e.Critical="critical"}(oe||(oe={})),e.UserActionState=void 0,(ae=e.UserActionState||(e.UserActionState={}))[ae.Started=0]="Started",ae[ae.Halted=1]="Halted",ae[ae.Cancelled=2]="Cancelled",ae[ae.Ended=3]="Ended";const le="faro",ue={enabled:!0,sendTimeout:250,itemLimit:50};const ce="_faroInternal";function de(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(R,ce,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function pe(){return ce in R}function ge(t,i,n,r,s,o,a){return i.debug("Initializing Faro"),e.faro={api:o,config:n,instrumentations:a,internalLogger:i,metas:r,pause:s.pause,transports:s,unpatchedConsole:t,unpause:s.unpause},de(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 R)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(R,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}e.faro={};class me{constructor(){this.buffer=[]}addItem(e){this.buffer.push(e)}flushBuffer(e){if(m(e))for(const t of this.buffer)e(t);this.buffer.length=0}size(){return this.buffer.length}}class fe extends z{constructor({name:t,parentId:i,haltTimeout:n,trigger:r,transports:s,attributes:o,trackUserActionsExcludeItem:a,severity:l=oe.Normal}){super(),this.name=t,this.attributes=o,this.id=D(),this.trigger=r,this.cancelTimeout=100,this.haltTimeout=null!=n?n:1e4,this.parentId=null!=i?i:this.id,this.trackUserActionsExcludeItem=a,this.severity=l,this._itemBuffer=new me,this._transports=s,this._haltTimeoutId=-1,this._state=e.UserActionState.Started,this._isValid=!1,this._start()}addItem(e){this._itemBuffer.addItem(e)}extend(e){this._isValid||(this._isValid=!0),this._setFollowupActionTimeout(e)}_setFollowupActionTimeout(t){this._timeoutId=function(e,t,i){e&&clearTimeout(e);return e=setTimeout(()=>{t()},i)}(this._timeoutId,()=>{this._state===e.UserActionState.Started&&(null==t?void 0:t())?this.halt():this._isValid?this.end():this.cancel()},100)}_start(){this._state=e.UserActionState.Started,this._state===e.UserActionState.Started&&(this.startTime=A()),this._setFollowupActionTimeout()}halt(){this._state===e.UserActionState.Started&&(this._state=e.UserActionState.Halted,this._haltTimeoutId=setTimeout(()=>{this.end()},this.haltTimeout),this.notify(this._state))}cancel(){this._state===e.UserActionState.Started&&this._itemBuffer.flushBuffer(),this._state=e.UserActionState.Cancelled,this.notify(this._state)}end(){if(this._state===e.UserActionState.Cancelled)return;clearTimeout(this._haltTimeoutId),clearTimeout(this._timeoutId);const t=A(),i=t-this.startTime;this._state=e.UserActionState.Ended,this._itemBuffer.flushBuffer(t=>{if(function(t,i){return(null==i?void 0:i(t))||t.type===e.TransportItemType.MEASUREMENT&&"web-vitals"===t.payload.type}(t,this.trackUserActionsExcludeItem))return void this._transports.execute(t);const i=Object.assign(Object.assign({},t),{payload:Object.assign(Object.assign({},t.payload),{action:{parentId:this.id,name:this.name}})});this._transports.execute(i)}),this._state=e.UserActionState.Ended,this.notify(this._state),e.faro.api.pushEvent(this.name,Object.assign({userActionStartTime:this.startTime.toString(),userActionEndTime:t.toString(),userActionDuration:i.toString(),userActionTrigger:this.trigger,userActionSeverity:this.severity},F(this.attributes)),void 0,{timestampOverwriteMs:this.startTime,customPayloadTransformer:e=>(e.action={id:this.id,name:this.name},e)})}getState(){return this._state}}const he=new z;function be(t,i,n,r,s){i.debug("Initializing API");const o=function({transports:t,internalLogger:i,config:n}){const r=n.trackUserActionsExcludeItem;let s;const o=()=>s;return{startUserAction:(n,a,l)=>{if(void 0===o()){const i=new fe({name:n,transports:t,attributes:a,trigger:(null==l?void 0:l.triggerName)||"faroApiCall",trackUserActionsExcludeItem:r});return i.filter(t=>[e.UserActionState.Ended,e.UserActionState.Cancelled].includes(t)).first().subscribe(()=>{s=void 0}),he.notify({type:"user_action_start",userAction:i}),s=i,s}i.error("Attempted to create a new user action while one is already running. This is not possible.")},getActiveUserAction:o}}({transports:s,config:n,internalLogger:i}),a=function(t,i,n,r,s){let o;return i.debug("Initializing traces API"),{getOTEL:()=>o,getTraceContext:()=>{const e=null==o?void 0:o.trace.getSpanContext(o.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,t)=>{i.debug("Initializing OpenTelemetry"),o={trace:e,context:t}},isOTELInitialized:()=>!!o,pushTraces:t=>{try{const n={type:e.TransportItemType.TRACE,payload:t,meta:r.value};i.debug("Pushing trace\n",n),s.execute(n)}catch(e){i.error("Error pushing trace\n",e)}}}}(0,i,0,r,s),l={internalLogger:i,userActionsApi:o,config:n,metas:r,transports:s,tracesApi:a};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),re(l)),function({internalLogger:e,metas:t}){let i,n,r,s;e.debug("Initializing meta API");const o=e=>{n&&t.remove(n),n={user:e},t.add(n)},a=(e,n)=>{var r;const s=null==n?void 0:n.overrides,o=s?{overrides:Object.assign(Object.assign({},null===(r=null==i?void 0:i.session)||void 0===r?void 0:r.overrides),s)}:{};i&&t.remove(i),i={session:Object.assign(Object.assign({},x(e)?void 0:e),o)},t.add(i)},l=()=>t.value.session,u=()=>t.value.page;return{setUser:o,resetUser:o,setSession:a,resetSession:a,getSession:l,setView:(e,i)=>{var n;if((null==i?void 0:i.overrides)&&a(l(),{overrides:i.overrides}),(null===(n=null==r?void 0:r.view)||void 0===n?void 0:n.name)===(null==e?void 0:e.name))return;const s=r;r={view:e},t.add(r),s&&t.remove(s)},getView:()=>t.value.view,setPage:e=>{var i;const n=c(e)?Object.assign(Object.assign({},null!==(i=null==s?void 0:s.page)&&void 0!==i?i:u()),{id:e}):e;s&&t.remove(s),s={page:n},t.add(s)},getPage:u}}(l)),function({internalLogger:t,config:i,metas:n,transports:r,tracesApi:s,userActionsApi:o}){var a;t.debug("Initializing logs API");let l=null;const c=null!==(a=i.logArgsSerializer)&&void 0!==a?a:se;return{pushLog:(a,{context:d,level:p,skipDedupe:g,spanContext:m,timestampOverwriteMs:f}={})=>{try{const h=F(d),b={type:e.TransportItemType.LOG,payload:{message:c(a),level:null!=p?p:P,context:x(h)?void 0:h,timestamp:f?C(f):L(),trace:m?{trace_id:m.traceId,span_id:m.spanId}:s.getTraceContext()},meta:n.value},v={message:b.payload.message,level:b.payload.level,context:b.payload.context};if(!g&&i.dedupe&&!u(l)&&O(v,l))return void t.debug("Skipping log push because it is the same as the last one\n",b.payload);l=v,t.debug("Pushing log\n",b);const w=o.getActiveUserAction();w?w.addItem(b):r.execute(b)}catch(e){t.error("Error pushing log\n",e)}}}}(l)),function({internalLogger:t,config:i,metas:n,transports:r,tracesApi:s,userActionsApi:o}){t.debug("Initializing measurements API");let a=null;return{pushMeasurement:(l,{skipDedupe:c,context:d,spanContext:p,timestampOverwriteMs:g}={})=>{try{const m=F(d),f={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},l),{trace:p?{trace_id:p.traceId,span_id:p.spanId}:s.getTraceContext(),timestamp:g?C(g):L(),context:x(m)?void 0:m}),meta:n.value},h={type:f.payload.type,values:f.payload.values,context:f.payload.context};if(!c&&i.dedupe&&!u(a)&&O(h,a))return void t.debug("Skipping measurement push because it is the same as the last one\n",f.payload);a=h,t.debug("Pushing measurement\n",f);const b=o.getActiveUserAction();b?b.addItem(f):r.execute(f)}catch(e){t.error("Error pushing measurement\n",e)}}}}(l)),function({internalLogger:t,config:i,metas:n,transports:r,tracesApi:s,userActionsApi:o}){let a=null;return{pushEvent:(l,c,d,{skipDedupe:p,spanContext:g,timestampOverwriteMs:m,customPayloadTransformer:f=e=>e}={})=>{try{const h=F(c),b={meta:n.value,payload:f({name:l,domain:null!=d?d:i.eventDomain,attributes:x(h)?void 0:h,timestamp:m?C(m):L(),trace:g?{trace_id:g.traceId,span_id:g.spanId}:s.getTraceContext()}),type:e.TransportItemType.EVENT},v={name:b.payload.name,attributes:b.payload.attributes,domain:b.payload.domain};if(!p&&i.dedupe&&!u(a)&&O(v,a))return void t.debug("Skipping event push because it is the same as the last one\n",b.payload);a=v,t.debug("Pushing event\n",b);const w=o.getActiveUserAction();w?w.addItem(b):r.execute(b)}catch(e){t.error("Error pushing event",e)}}}}(l)),o)}class ve extends Z{constructor(){super(...arguments),this.api={},this.transports={}}}const we="2.0.0-beta-2";function ye(e){const t=W(e),i=J(t,e);if(pe()&&!e.isolate)return void i.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');i.debug("Initializing");const n=function(e,t){let i=[],n=[];const r=()=>i.reduce((e,t)=>Object.assign(e,m(t)?t():t),{}),s=()=>{if(n.length){const e=r();n.forEach(t=>t(e))}};return{add:(...e)=>{t.debug("Adding metas\n",e),i.push(...e),s()},remove:(...e)=>{t.debug("Removing metas\n",e),i=i.filter(t=>!e.includes(t)),s()},addListener:e=>{t.debug("Adding metas listener\n",e),n.push(e)},removeListener:e=>{t.debug("Removing metas listener\n",e),n=n.filter(t=>t!==e)},get value(){return r()}}}(0,i),s=r(t,i,e,n),o=be(0,i,e,n,s),a=function(e,t,i,n,r,s){t.debug("Initializing instrumentations");const o=[];return{add:(...a)=>{t.debug("Adding instrumentations"),a.forEach(a=>{t.debug(`Adding "${a.name}" instrumentation`),o.some(e=>e.name===a.name)?t.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=t,a.config=i,a.metas=n,a.transports=r,a.api=s,o.push(a),a.initialize())})},get instrumentations(){return[...o]},remove:(...e)=>{t.debug("Removing instrumentations"),e.forEach(e=>{var i,n;t.debug(`Removing "${e.name}" instrumentation`);const r=o.reduce((t,i,n)=>null===t&&i.name===e.name?n:null,null);null!==r?(null===(n=(i=o[r]).destroy)||void 0===n||n.call(i),o.splice(r,1)):t.warn(`Instrumentation "${e.name}" is not added`)})}}}(t,i,e,n,s,o),l=ge(t,i,e,n,s,o,a);return function(e){var t,i;const n={sdk:{version:we},app:{bundleId:e.config.app.name&&(r=e.config.app.name,null==R?void 0:R[`__faroBundleId_${r}`])}};var r;const s=null===(t=e.config.sessionTracking)||void 0===t?void 0:t.session;s&&e.api.setSession(s),e.config.app&&(n.app=Object.assign(Object.assign({},e.config.app),n.app)),e.config.user&&(n.user=e.config.user),e.config.view&&(n.view=e.config.view),e.metas.add(n,...null!==(i=e.config.metas)&&void 0!==i?i:[])}(l),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend)}(l),function(e){e.instrumentations.add(...e.config.instrumentations)}(l),l}const Se="view_changed",Te="session_start",Ee="session_resume",Ie="session_extend",ke="service_name_override",xe="unknown";var Oe,Ae={exports:{}},Le=Ae.exports;var Ce=(Oe||(Oe=1,function(e,t){!function(i,n){var r="function",s="undefined",o="object",a="string",l="major",u="model",c="name",d="type",p="vendor",g="version",m="architecture",f="console",h="mobile",b="tablet",v="smarttv",w="wearable",y="embedded",S="Amazon",T="Apple",E="ASUS",I="BlackBerry",k="Browser",x="Chrome",O="Firefox",A="Google",L="Honor",C="Huawei",_="LG",P="Microsoft",j="Motorola",U="Nvidia",M="OnePlus",N="Opera",D="OPPO",R="Samsung",B="Sharp",F="Sony",z="Xiaomi",q="Zebra",V="Facebook",$="Chromium OS",H="Mac OS",G=" Browser",W=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},K=function(e,t){return typeof e===a&&-1!==X(t).indexOf(X(e))},X=function(e){return e.toLowerCase()},J=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,500)},Z=function(e,t){for(var i,s,a,l,u,c,d=0;d<t.length&&!u;){var p=t[d],g=t[d+1];for(i=s=0;i<p.length&&!u&&p[i];)if(u=p[i++].exec(e))for(a=0;a<g.length;a++)c=u[++s],typeof(l=g[a])===o&&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]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;d+=2}},Y=function(e,t){for(var i in t)if(typeof t[i]===o&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(K(t[i][r],e))return"?"===i?n:i}else if(K(t[i],e))return"?"===i?n:i;return t.hasOwnProperty("*")?t["*"]:e},Q={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"},ee={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,g],[/opios[\/ ]+([\w\.]+)/i],[g,[c,N+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[c,N+" GX"]],[/\bopr\/([\w\.]+)/i],[g,[c,N]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[c,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[c,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[c,"Quark"]],[/\bddg\/([\w\.]+)/i],[g,[c,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[g,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[g,[c,"Smart Lenovo "+k]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],g],[/\bfocus\/([\w\.]+)/i],[g,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[g,[c,N+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[g,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[g,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[g,[c,N+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[g,[c,"MIUI"+G]],[/fxios\/([\w\.-]+)/i],[g,[c,O]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[c,"360"]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,"$1Browser"],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1"+G],g],[/samsungbrowser\/([\w\.]+)/i],[g,[c,R+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[g,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[c,g],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[c],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,V],g],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[c,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,x+" WebView"],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[g,Y,{"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,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[c,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[c,[g,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[c,[g,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[m,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[m,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[m,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[m,/ower/,"",X]],[/ sun4\w[;\)]/i],[[m,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[m,X]]],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,R],[d,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,R],[d,h]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[p,T],[d,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,T],[d,b]],[/(macintosh);/i],[u,[p,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,B],[d,h]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[u,[p,L],[d,b]],[/honor([-\w ]+)[;\)]/i],[u,[p,L],[d,h]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[u,[p,C],[d,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,C],[d,h]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[u,/_/g," "],[p,z],[d,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[u,/_/g," "],[p,z],[d,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,D],[d,h]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[u,[p,Y,{OnePlus:["304","403","203"],"*":D}],[d,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[d,h]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[d,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[p,j],[d,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,j],[d,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,_],[d,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,_],[d,h]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[u,[p,"Lenovo"],[d,b]],[/(nokia) (t[12][01])/i],[p,u,[d,b]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[u,/_/g," "],[d,h],[p,"Nokia"]],[/(pixel (c|tablet))\b/i],[u,[p,A],[d,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,A],[d,h]],[/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,F],[d,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,F],[d,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,M],[d,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,S],[d,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,S],[d,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[d,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,I],[d,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,E],[d,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,E],[d,h]],[/(nexus 9)/i],[u,[p,"HTC"],[d,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[d,h]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[u,[p,"TCL"],[d,b]],[/(itel) ((\w+))/i],[[p,X],u,[d,Y,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[d,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[d,h]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[p,"Ulefone"],[d,h]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[u,[p,"Energizer"],[d,h]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[u,[p,"Cat"],[d,h]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[u,[p,"Smartfren"],[d,h]],[/droid.+; (a(?:015|06[35]|142p?))/i],[u,[p,"Nothing"],[d,h]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[u,[p,"Archos"],[d,b]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[u,[p,"Archos"],[d,h]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[p,u,[d,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[d,h]],[/(kobo)\s(ereader|touch)/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,b]],[/(surface duo)/i],[u,[p,P],[d,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[d,h]],[/(u304aa)/i],[u,[p,"AT&T"],[d,h]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[d,h]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[d,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[d,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[d,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[d,b]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[d,b]],[/\b(k88) b/i],[u,[p,"ZTE"],[d,b]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[d,h]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[d,h]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[d,b]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[d,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[d,b]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[d,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[d,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[d,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[d,h]],[/\b(ph-1) /i],[u,[p,"Essential"],[d,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[d,b]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[d,b]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[d,b]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[u,[p,U],[d,b]],[/(sprint) (\w+)/i],[p,u,[d,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,P],[d,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,q],[d,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,q],[d,h]],[/smart-tv.+(samsung)/i],[p,[d,v]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,R],[d,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,_],[d,v]],[/(apple) ?tv/i],[p,[u,T+" TV"],[d,v]],[/crkey/i],[[u,x+"cast"],[p,A],[d,v]],[/droid.+aft(\w+)( bui|\))/i],[u,[p,S],[d,v]],[/(shield \w+ tv)/i],[u,[p,U],[d,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,B],[d,v]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,F],[d,v]],[/(mi(tv|box)-?\w+) bui/i],[u,[p,z],[d,v]],[/Hbbtv.*(technisat) (.*);/i],[p,u,[d,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,J],[u,J],[d,v]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[u,[d,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[d,f]],[/droid.+; (shield)( bui|\))/i],[u,[p,U],[d,f]],[/(playstation \w+)/i],[u,[p,F],[d,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,P],[d,f]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[u,[p,R],[d,w]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[p,u,[d,w]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[u,[p,D],[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[p,T],[d,w]],[/(opwwe\d{3})/i],[u,[p,M],[d,w]],[/(moto 360)/i],[u,[p,j],[d,w]],[/(smartwatch 3)/i],[u,[p,F],[d,w]],[/(g watch r)/i],[u,[p,_],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,q],[d,w]],[/droid.+; (glass) \d/i],[u,[p,A],[d,w]],[/(pico) (4|neo3(?: link|pro)?)/i],[p,u,[d,w]],[/; (quest( \d| pro)?)/i],[u,[p,V],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,y]],[/(aeobc)\b/i],[u,[p,S],[d,y]],[/(homepod).+mac os/i],[u,[p,T],[d,y]],[/windows iot/i],[[d,y]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[d,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,h]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[c,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[c,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,g],[/ladybird\//i],[[c,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,g],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[c,[g,Y,Q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,Y,Q],[c,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,H],[g,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,c],[/(ubuntu) ([\w\.]+) like android/i],[[c,/(.+)/,"$1 Touch"],g],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[c,g],[/\(bb(10);/i],[g,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[g,[c,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,$],g],[/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)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,g],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,g]]},te=function(e,t){if(typeof e===o&&(t=e,e=n),!(this instanceof te))return new te(e,t).getResult();var f=typeof i!==s&&i.navigator?i.navigator:n,v=e||(f&&f.userAgent?f.userAgent:""),w=f&&f.userAgentData?f.userAgentData:n,y=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(ee,t):ee,S=f&&f.userAgent==v;return this.getBrowser=function(){var e,t={};return t[c]=n,t[g]=n,Z.call(t,v,y.browser),t[l]=typeof(e=t[g])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,S&&f&&f.brave&&typeof f.brave.isBrave==r&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[m]=n,Z.call(e,v,y.cpu),e},this.getDevice=function(){var e={};return e[p]=n,e[u]=n,e[d]=n,Z.call(e,v,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=h),S&&"Macintosh"==e[u]&&f&&typeof f.standalone!==s&&f.maxTouchPoints&&f.maxTouchPoints>2&&(e[u]="iPad",e[d]=b),e},this.getEngine=function(){var e={};return e[c]=n,e[g]=n,Z.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[c]=n,e[g]=n,Z.call(e,v,y.os),S&&!e[c]&&w&&w.platform&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,$).replace(/macos/i,H)),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 v},this.setUA=function(e){return v=typeof e===a&&e.length>500?J(e,500):e,this},this.setUA(v),this};te.VERSION="1.0.41",te.BROWSER=W([c,g,l]),te.CPU=W([m]),te.DEVICE=W([u,p,d,f,h,v,b,w,y]),te.ENGINE=te.OS=W([c,g]),e.exports&&(t=e.exports=te),t.UAParser=te;var ie=typeof i!==s&&(i.jQuery||i.Zepto);if(ie&&!ie.ua){var ne=new te;ie.ua=ne.getResult(),ie.ua.get=function(){return ne.getUA()},ie.ua.set=function(e){ne.setUA(e);var t=ne.getResult();for(var i in t)ie.ua[i]=t[i]}}}("object"==typeof window?window:Le)}(Ae,Ae.exports)),Ae.exports);const _e=()=>{const e=new Ce.UAParser,{name:t,version:i}=e.getBrowser(),{name:n,version:r}=e.getOS(),s=e.getUA(),o=navigator.language,a=navigator.userAgent.includes("Mobi"),l=function(){if(!t||!i)return;if("userAgentData"in navigator&&navigator.userAgentData)return navigator.userAgentData.brands;return}();return{browser:{name:null!=t?t:xe,version:null!=i?i:xe,os:`${null!=n?n:xe} ${null!=r?r:xe}`,userAgent:null!=s?s:xe,language:null!=o?o:xe,mobile:a,brands:null!=l?l:xe,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}};function Pe(t){var i,n,r,s;return{id:null!==(s=null===(r=null===(n=null===(i=e.faro.config)||void 0===i?void 0:i.sessionTracking)||void 0===n?void 0:n.generateSessionId)||void 0===r?void 0:r.call(n))&&void 0!==s?s:D(),attributes:t}}const je="sessionStorage",Ue="localStorage";function Me(t){var i;try{let e;e=window[t];const i="__faro_storage_test__";return e.setItem(i,i),e.removeItem(i),!0}catch(n){return null===(i=e.faro.internalLogger)||void 0===i||i.info(`Web storage of type ${t} is not available. Reason: ${n}`),!1}}function Ne(e,t){return ze(t)?window[t].getItem(e):null}function De(e,t,i){if(ze(i))try{window[i].setItem(e,t)}catch(e){}}function Re(e,t){ze(t)&&window[t].removeItem(e)}const Be=Me(Ue),Fe=Me(je);function ze(e){return e===Ue?Be:e===je&&Fe}function qe(e,t){let i,n=!1;const r=()=>{null!=i?(e(...i),i=null,setTimeout(r,t)):n=!1};return(...s)=>{n?i=s:(e(...s),n=!0,setTimeout(r,t))}}function Ve(){return e.faro.transports.transports.flatMap(e=>e.getIgnoreUrls())}function $e(e=""){return Ve().some(t=>e&&null!=e.match(t))}function He(e){return c(e)?e:e instanceof URL?e.href:!x(e)&&m(null==e?void 0:e.toString)?e.toString():void 0}const Ge="com.grafana.faro.session",We=144e5,Ke=9e5,Xe=Ke,Je={enabled:!0,persistent:!1,maxSessionPersistenceTime:Xe};function Ze(){var t,i,n;const r=e.faro.config.sessionTracking;let s=null!==(n=null!==(i=null===(t=null==r?void 0:r.sampler)||void 0===t?void 0:t.call(r,{metas:e.faro.metas.value}))&&void 0!==i?i:null==r?void 0:r.samplingRate)&&void 0!==n?n:1;if("number"!=typeof s){s=0}return Math.random()<s}function Ye({sessionId:t,started:i,lastActivity:n,isSampled:r=!0}={}){var s,o;const a=A(),l=null===(o=null===(s=e.faro.config)||void 0===s?void 0:s.sessionTracking)||void 0===o?void 0:o.generateSessionId;return null==t&&(t="function"==typeof l?l():D()),{sessionId:t,lastActivity:null!=n?n:a,started:null!=i?i:a,isSampled:r}}function Qe(e){if(null==e)return!1;const t=A();if(!(t-e.started<We))return!1;return t-e.lastActivity<Ke}function et({fetchUserSession:t,storeUserSession:i}){return function({forceSessionExtend:n}={forceSessionExtend:!1}){var r,s,o;if(!t||!i)return;const a=e.faro.config.sessionTracking,l=null==a?void 0:a.persistent;if(l&&!Be||!l&&!Fe)return;const u=t();if(!1===n&&Qe(u))i(Object.assign(Object.assign({},u),{lastActivity:A()}));else{let t=tt(Ye({isSampled:Ze()}),u);i(t),null===(r=e.faro.api)||void 0===r||r.setSession(t.sessionMeta),null===(s=null==a?void 0:a.onSessionChange)||void 0===s||s.call(a,null!==(o=null==u?void 0:u.sessionMeta)&&void 0!==o?o:null,t.sessionMeta)}}}function tt(t,i){var n,r,s,o,a,l,u;const c=Object.assign(Object.assign({},t),{sessionMeta:{id:t.sessionId,attributes:Object.assign(Object.assign(Object.assign({},null===(r=null===(n=e.faro.config.sessionTracking)||void 0===n?void 0:n.session)||void 0===r?void 0:r.attributes),null!==(o=null===(s=e.faro.metas.value.session)||void 0===s?void 0:s.attributes)&&void 0!==o?o:{}),{isSampled:t.isSampled.toString()})}}),d=null!==(l=null===(a=e.faro.metas.value.session)||void 0===a?void 0:a.overrides)&&void 0!==l?l:null===(u=null==i?void 0:i.sessionMeta)||void 0===u?void 0:u.overrides;x(d)||(c.sessionMeta.overrides=d);const p=null==i?void 0:i.sessionId;return null!=p&&(c.sessionMeta.attributes.previousSession=p),c}function it({fetchUserSession:t,storeUserSession:i}){return function(n){const r=n.session,s=t();let o=null==r?void 0:r.id;const a=null==r?void 0:r.attributes,l=null==r?void 0:r.overrides,u=null==s?void 0:s.sessionMeta,c=null==u?void 0:u.overrides,d=!!l&&!O(l,c),p=!!a&&!O(a,null==u?void 0:u.attributes);if(!!r&&o!==(null==s?void 0:s.sessionId)||p||d){const t=tt(Ye({sessionId:o,isSampled:Ze()}),s);i(t),function(t,i={},n={}){var r,s,o;if(!t)return;const a=i.serviceName,l=null!==(o=null!==(r=n.serviceName)&&void 0!==r?r:null===(s=e.faro.metas.value.app)||void 0===s?void 0:s.name)&&void 0!==o?o:"";a&&a!==l&&e.faro.api.pushEvent(ke,{serviceName:a,previousServiceName:l})}(d,l,c),e.faro.api.setSession(t.sessionMeta)}}}class nt{constructor(){this.updateSession=qe(()=>this.updateUserSession(),1e3),this.updateUserSession=et({fetchUserSession:nt.fetchUserSession,storeUserSession:nt.storeUserSession}),this.init()}static removeUserSession(){Re(Ge,nt.storageTypeLocal)}static storeUserSession(e){De(Ge,B(e),nt.storageTypeLocal)}static fetchUserSession(){const e=Ne(Ge,nt.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.updateSession()}),e.faro.metas.addListener(it({fetchUserSession:nt.fetchUserSession,storeUserSession:nt.storeUserSession}))}}nt.storageTypeLocal=Ue;class rt{constructor(){this.updateSession=qe(()=>this.updateUserSession(),1e3),this.updateUserSession=et({fetchUserSession:rt.fetchUserSession,storeUserSession:rt.storeUserSession}),this.init()}static removeUserSession(){Re(Ge,rt.storageTypeSession)}static storeUserSession(e){De(Ge,B(e),rt.storageTypeSession)}static fetchUserSession(){const e=Ne(Ge,rt.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.updateSession()}),e.faro.metas.addListener(it({fetchUserSession:rt.fetchUserSession,storeUserSession:rt.storeUserSession}))}}function st(e){return(null==e?void 0:e.persistent)?nt:rt}rt.storageTypeSession=je;class ot extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=we}sendSessionStartEvent(e){var t,i;const n=e.session;if(n&&n.id!==(null===(t=this.notifiedSession)||void 0===t?void 0:t.id)){if(this.notifiedSession&&this.notifiedSession.id===(null===(i=n.attributes)||void 0===i?void 0:i.previousSession))return this.api.pushEvent(Ie,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=n);this.notifiedSession=n,this.api.pushEvent(Te,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var i,n,r,s,o,a;let l,u,c=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&c){const e=A();c.lastActivity<e-t.maxSessionPersistenceTime&&(nt.removeUserSession(),c=null)}if(Qe(c)){const e=null==c?void 0:c.sessionId;u=Ye({sessionId:e,isSampled:c.isSampled||!1,started:null==c?void 0:c.started});const r=null==c?void 0:c.sessionMeta,s=Object.assign(Object.assign({},null===(i=t.session)||void 0===i?void 0:i.overrides),null==r?void 0:r.overrides);u.sessionMeta=Object.assign(Object.assign({},t.session),{id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.attributes),null==r?void 0:r.attributes),{isSampled:u.isSampled.toString()}),overrides:s}),l=Ee}else{const e=null!==(s=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==s?s:Pe().id;u=Ye({sessionId:e,isSampled:Ze()});const i=null===(o=t.session)||void 0===o?void 0:o.overrides;u.sessionMeta=Object.assign({id:e,attributes:Object.assign({isSampled:u.isSampled.toString()},null===(a=t.session)||void 0===a?void 0:a.attributes)},i?{overrides:i}:{}),l=Te}return{initialSession:u,lifecycleType:l}}registerBeforeSendHook(e){var t;const{updateSession:i}=new e;null===(t=this.transports)||void 0===t||t.addBeforeSendHooks(e=>{var t,n,r;i();const s=null===(t=e.meta.session)||void 0===t?void 0:t.attributes;if(s&&"true"===(null==s?void 0:s.isSampled)){let t=JSON.parse(JSON.stringify(e));const i=null===(n=t.meta.session)||void 0===n?void 0:n.attributes;return null==i||delete i.isSampled,0===Object.keys(null!=i?i:{}).length&&(null===(r=t.meta.session)||void 0===r||delete r.attributes),t}return null})}initialize(){this.logDebug("init session instrumentation");const e=this.config.sessionTracking;if(null==e?void 0:e.enabled){const t=st(e);this.registerBeforeSendHook(t);const{initialSession:i,lifecycleType:n}=this.createInitialSession(t,e);t.storeUserSession(i);const r=i.sessionMeta;this.notifiedSession=r,this.api.setSession(r),n===Te&&this.api.pushEvent(Te,{},void 0,{skipDedupe:!0}),n===Ee&&this.api.pushEvent(Ee,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}const at=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const lt=/^\s*at (?:(?![a-z]+:\/\/)([^(]+?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ut=/\((\S*)(?::(\d+))(?::(\d+))\)/,ct="address at ",dt=/^\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,pt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gt="safari-extension",mt="safari-web-extension",ft=/Minified React error #\d+;/i;function ht(e,t,i,n){const r={filename:e||document.location.href,function:t||"?"};return void 0!==i&&(r.lineno=i),void 0!==n&&(r.colno=n),r}function bt(e,t){const i=null==e?void 0:e.includes(gt),n=!i&&(null==e?void 0:e.includes(mt));return i||n?[(null==e?void 0:e.includes("@"))?e.split("@")[0]:e,i?`${gt}:${t}`:`${mt}:${t}`]:[e,t]}function vt(e){let t=[];e.stacktrace?t=e.stacktrace.split("\n").filter((e,t)=>t%2==0):e.stack&&(t=e.stack.split("\n"));const i=t.reduce((t,i,n)=>{let r,s,o,a,l;if(r=lt.exec(i)){if(s=r[1],o=r[2],a=r[3],l=r[4],null==o?void 0:o.startsWith("eval")){const e=ut.exec(o);e&&(o=e[1],a=e[2],l=e[3])}o=(null==o?void 0:o.startsWith(ct))?o.substring(11):o,[s,o]=bt(s,o)}else if(r=dt.exec(i)){if(s=r[1],o=r[3],a=r[4],l=r[5],o&&o.includes(" > eval")){const e=pt.exec(o);e&&(s=s||"eval",o=e[1],a=e[2])}else 0===n&&!l&&d(e.columnNumber)&&(l=String(e.columnNumber+1));[s,o]=bt(s,o)}return(o||s)&&t.push(ht(o,s,a?Number(a):void 0,l?Number(l):void 0)),t},[]);return ft.test(e.message)?i.slice(1):i}function wt(e){return{frames:vt(e)}}function yt(e){let t,i,n,r,s=[];if(S(e)&&e.error)t=e.error.message,i=e.error.name,s=vt(e.error);else if((n=T(e))||E(e)){const{name:r,message:s}=e;i=null!=r?r:n?"DOMError":"DOMException",t=s?`${i}: ${s}`:i}else y(e)?(t=e.message,s=vt(e)):(g(e)||(r=v(e)))&&(i=r?e.constructor.name:void 0,t=`Non-Error exception captured with keys: ${Object.keys(e)}`);return[t,i,s]}function St(e){const[t,i,n,r,s]=e;let o,a,l=[];const u=c(t),d=ht(i,"?",n,r);return s||!u?([o,a,l]=yt(null!=s?s:t),0===l.length&&(l=[d])):u&&([o,a]=function(e){var t,i;const n=e.match(at),r=null!==(t=null==n?void 0:n[1])&&void 0!==t?t:te;return[null!==(i=null==n?void 0:n[2])&&void 0!==i?i:e,r]}(t),l=[d]),{value:o,type:a,stackFrames:l}}function Tt(e,t){return y(e[0])?St(e):{value:t(e)}}class Et extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=we,this.errorSerializer=se}initialize(){var t;const i=this.config.consoleInstrumentation,n=(null==i?void 0:i.serializeErrors)||!!(null==i?void 0:i.errorSerializer);this.errorSerializer=n?null!==(t=null==i?void 0:i.errorSerializer)&&void 0!==t?t:ie:se,j.filter(e=>{var t;return!(null!==(t=null==i?void 0:i.disabledLevels)&&void 0!==t?t:Et.defaultDisabledLevels).includes(e)}).forEach(t=>{console[t]=(...n)=>{try{if(t!==e.LogLevel.ERROR||(null==i?void 0:i.consoleErrorAsLog))if(t===e.LogLevel.ERROR&&(null==i?void 0:i.consoleErrorAsLog)){const{value:e,type:i,stackFrames:r}=Tt(n,this.errorSerializer);this.api.pushLog(e?[Et.consoleErrorPrefix+e]:n,{level:t,context:{value:null!=e?e:"",type:null!=i?i:"",stackFrames:(null==r?void 0:r.length)?ie(r):""}})}else this.api.pushLog(n,{level:t});else{const{value:e,type:t,stackFrames:i}=Tt(n,this.errorSerializer);if(e&&!t&&!i)return void this.api.pushError(new Error(Et.consoleErrorPrefix+e));this.api.pushError(new Error(Et.consoleErrorPrefix+e),{type:t,stackFrames:i})}}catch(e){this.logError(e)}finally{this.unpatchedConsole[t](...n)}}})}}Et.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG],Et.consoleErrorPrefix="console.error: ";class It extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=we}initialize(){var e;this.logDebug("Initializing"),function(e){const t=window.onerror;window.onerror=(...i)=>{try{const{value:t,type:n,stackFrames:r}=St(i),s=i[4];if(t){const i={type:n,stackFrames:r};null!=s&&(i.originalError=s),e.pushError(new Error(t),i)}}finally{null==t||t.apply(window,i)}}}(this.api),e=this.api,window.addEventListener("unhandledrejection",t=>{var i,n;let r,s,o=t;o.reason?o=t.reason:(null===(i=t.detail)||void 0===i?void 0:i.reason)&&(o=null===(n=t.detail)||void 0===n?void 0:n.reason);let a=[];h(o)?(r=`Non-Error promise rejection captured with value: ${String(o)}`,s="UnhandledRejection"):[r,s,a]=yt(o),r&&e.pushError(new Error(r),{type:s,stackFrames:a})})}}class kt extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=we}sendViewChangedEvent(e){var t,i,n,r;const s=e.view;s&&s.name!==(null===(t=this.notifiedView)||void 0===t?void 0:t.name)&&(this.api.pushEvent(Se,{fromView:null!==(n=null===(i=this.notifiedView)||void 0===i?void 0:i.name)&&void 0!==n?n:xe,toView:null!==(r=s.name)&&void 0!==r?r:xe},void 0,{skipDedupe:!0}),this.notifiedView=s)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}let xt=-1;const Ot=e=>{addEventListener("pageshow",t=>{t.persisted&&(xt=t.timeStamp,e(t))},!0)},At=(e,t,i,n)=>{let r,s;return o=>{t.value>=0&&(o||n)&&(s=t.value-(r??0),(s||void 0===r)&&(r=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,i),e(t)))}},Lt=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},Ct=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},_t=()=>{const e=Ct();return e?.activationStart??0},Pt=(e,t=-1)=>{const i=Ct();let n="navigate";return xt>=0?n="back-forward-cache":i&&(document.prerendering||_t()>0?n="prerender":document.wasDiscarded?n="restore":i.type&&(n=i.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},jt=new WeakMap;function Ut(e,t){return jt.get(e)||jt.set(e,new t),jt.get(e)}let Mt=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],i=this.o.at(-1);this.i&&t&&i&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}};const Nt=(e,t,i={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...i}),n}}catch{}},Dt=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Rt=-1;const Bt=new Set,Ft=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,zt=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of Bt)e();isFinite(Rt)||(Rt="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",zt,!0))}},qt=()=>{if(Rt<0){const e=_t(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;Rt=t??Ft(),addEventListener("visibilitychange",zt,!0),addEventListener("prerenderingchange",zt,!0),Ot(()=>{setTimeout(()=>{Rt=Ft()})})}return{get firstHiddenTime(){return Rt},onHidden(e){Bt.add(e)}}},Vt=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},$t=[1800,3e3],Ht=(e,t={})=>{Vt(()=>{const i=qt();let n,r=Pt("FCP");const s=Nt("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<i.firstHiddenTime&&(r.value=Math.max(t.startTime-_t(),0),r.entries.push(t),n(!0)))});s&&(n=At(e,r,$t,t.reportAllChanges),Ot(i=>{r=Pt("FCP"),n=At(e,r,$t,t.reportAllChanges),Lt(()=>{r.value=performance.now()-i.timeStamp,n(!0)})}))})},Gt=[.1,.25];let Wt=0,Kt=1/0,Xt=0;const Jt=e=>{for(const t of e)t.interactionId&&(Kt=Math.min(Kt,t.interactionId),Xt=Math.max(Xt,t.interactionId),Wt=Xt?(Xt-Kt)/7+1:0)};let Zt;const Yt=()=>Zt?Wt:performance.interactionCount??0;let Qt=0,ei=class{u=[];l=new Map;m;p;v(){Qt=Yt(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((Yt()-Qt)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let i=this.l.get(e.interactionId);if(i||this.u.length<10||e.duration>t.P){if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],P:e.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(i)}}};const ti=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Dt(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},ii=[200,500];let ni=class{m;h(e){this.m?.(e)}};const ri=[2500,4e3],si=[800,1800],oi=e=>{document.prerendering?Vt(()=>oi(e)):"complete"!==document.readyState?addEventListener("load",()=>oi(e),!0):setTimeout(e)};class ai{constructor(e,t){this.pushMeasurement=e,this.webVitalConfig=t}initialize(){Object.entries(ai.mapping).forEach(([e,t])=>{var i;t(t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})},{reportAllChanges:null===(i=this.webVitalConfig)||void 0===i?void 0:i.reportAllChanges})})}}ai.mapping={cls:(e,t={})=>{const i=qt();Ht(Dt(()=>{let n,r=Pt("CLS",0);const s=Ut(t,Mt),o=e=>{for(const t of e)s.h(t);s.i>r.value&&(r.value=s.i,r.entries=s.o,n())},a=Nt("layout-shift",o);a&&(n=At(e,r,Gt,t.reportAllChanges),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),Ot(()=>{s.i=0,r=Pt("CLS",0),n=At(e,r,Gt,t.reportAllChanges),Lt(()=>n())}),setTimeout(n))}))},fcp:Ht,inp:(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const i=qt();Vt(()=>{"interactionCount"in performance||Zt||(Zt=Nt("event",Jt,{type:"event",buffered:!0,durationThreshold:0}));let n,r=Pt("INP");const s=Ut(t,ei),o=e=>{ti(()=>{for(const t of e)s.h(t);const t=s.L();t&&t.P!==r.value&&(r.value=t.P,r.entries=t.entries,n())})},a=Nt("event",o,{durationThreshold:t.durationThreshold??40});n=At(e,r,ii,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),Ot(()=>{s.v(),r=Pt("INP"),n=At(e,r,ii,t.reportAllChanges)}))})},lcp:(e,t={})=>{Vt(()=>{const i=qt();let n,r=Pt("LCP");const s=Ut(t,ni),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)s.h(t),t.startTime<i.firstHiddenTime&&(r.value=Math.max(t.startTime-_t(),0),r.entries=[t],n())},a=Nt("largest-contentful-paint",o);if(a){n=At(e,r,ri,t.reportAllChanges);const i=Dt(()=>{o(a.takeRecords()),a.disconnect(),n(!0)}),s=e=>{e.isTrusted&&(ti(i),removeEventListener(e.type,s,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,s,{capture:!0});Ot(i=>{r=Pt("LCP"),n=At(e,r,ri,t.reportAllChanges),Lt(()=>{r.value=performance.now()-i.timeStamp,n(!0)})})}})},ttfb:(e,t={})=>{let i=Pt("TTFB"),n=At(e,i,si,t.reportAllChanges);oi(()=>{const r=Ct();r&&(i.value=Math.max(r.responseStart-_t(),0),i.entries=[r],n(!0),Ot(()=>{i=Pt("TTFB",0),n=At(e,i,si,t.reportAllChanges),n(!0)}))})}};class li{t;o=0;i=[];u(e){if(e.hadRecentInput)return;const t=this.i[0],i=this.i.at(-1);this.o&&t&&i&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),this.t?.(e)}}const ui=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ci=e=>{if("loading"===document.readyState)return"loading";{const t=ui();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}}return"complete"},di=e=>{const t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},pi=e=>{let t="";try{for(;9!==e?.nodeType;){const i=e,n=i.id?"#"+i.id:[di(i),...Array.from(i.classList).sort()].join(".");if(t.length+n.length>99)return t||n;if(t=t?n+">"+t:n,i.id)break;e=i.parentNode}}catch{}return t},gi=new WeakMap;function mi(e,t){return gi.get(e)||gi.set(e,new t),gi.get(e)}let fi=-1;const hi=()=>fi,bi=e=>{addEventListener("pageshow",t=>{t.persisted&&(fi=t.timeStamp,e(t))},!0)},vi=(e,t,i,n)=>{let r,s;return o=>{t.value>=0&&(o||n)&&(s=t.value-(r??0),(s||void 0===r)&&(r=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,i),e(t)))}},wi=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},yi=()=>{const e=ui();return e?.activationStart??0},Si=(e,t=-1)=>{const i=ui();let n="navigate";return hi()>=0?n="back-forward-cache":i&&(document.prerendering||yi()>0?n="prerender":document.wasDiscarded?n="restore":i.type&&(n=i.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},Ti=(e,t,i={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...i}),n}}catch{}},Ei=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Ii=-1;const ki=new Set,xi=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Oi=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of ki)e();isFinite(Ii)||(Ii="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Oi,!0))}},Ai=()=>{if(Ii<0){const e=yi(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;Ii=t??xi(),addEventListener("visibilitychange",Oi,!0),addEventListener("prerenderingchange",Oi,!0),bi(()=>{setTimeout(()=>{Ii=xi()})})}return{get firstHiddenTime(){return Ii},onHidden(e){ki.add(e)}}},Li=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Ci=[1800,3e3],_i=(e,t={})=>{Li(()=>{const i=Ai();let n,r=Si("FCP");const s=Ti("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<i.firstHiddenTime&&(r.value=Math.max(t.startTime-yi(),0),r.entries.push(t),n(!0)))});s&&(n=vi(e,r,Ci,t.reportAllChanges),bi(i=>{r=Si("FCP"),n=vi(e,r,Ci,t.reportAllChanges),wi(()=>{r.value=performance.now()-i.timeStamp,n(!0)})}))})},Pi=[.1,.25],ji=e=>e.find(e=>1===e.node?.nodeType)||e[0];let Ui=0,Mi=1/0,Ni=0;const Di=e=>{for(const t of e)t.interactionId&&(Mi=Math.min(Mi,t.interactionId),Ni=Math.max(Ni,t.interactionId),Ui=Ni?(Ni-Mi)/7+1:0)};let Ri;const Bi=()=>Ri?Ui:performance.interactionCount??0;let Fi=0;class zi{l=[];h=new Map;m;p;v(){Fi=Bi(),this.l.length=0,this.h.clear()}M(){const e=Math.min(this.l.length-1,Math.floor((Bi()-Fi)/50));return this.l[e]}u(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.l.at(-1);let i=this.h.get(e.interactionId);if(i||this.l.length<10||e.duration>t.T){if(i?e.duration>i.T?(i.entries=[e],i.T=e.duration):e.duration===i.T&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],T:e.duration},this.h.set(i.id,i),this.l.push(i)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10){const e=this.l.splice(10);for(const t of e)this.h.delete(t.id)}this.p?.(i)}}}const qi=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Ei(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},Vi=[200,500],$i=(e,t={})=>{const i=mi(t=Object.assign({},t),zi);let n=[],r=[],s=0;const o=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(qi(c),l=!0)},c=()=>{const e=i.l.map(e=>o.get(e.entries[0])),t=r.length-50;r=r.filter((i,n)=>n>=t||e.includes(i));const a=new Set;for(const e of r){const t=d(e.startTime,e.processingEnd);for(const e of t)a.add(e)}const u=n.length-1-50;n=n.filter((e,t)=>e.startTime>s&&t>u||a.has(e)),l=!1};i.m=e=>{const t=e.startTime+e.duration;let i;s=Math.max(s,e.processingEnd);for(let n=r.length-1;n>=0;n--){const s=r[n];if(Math.abs(t-s.renderTime)<=8){i=s,i.startTime=Math.min(e.startTime,i.startTime),i.processingStart=Math.min(e.processingStart,i.processingStart),i.processingEnd=Math.max(e.processingEnd,i.processingEnd),i.entries.push(e);break}}i||(i={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:t,entries:[e]},r.push(i)),(e.interactionId||"first-input"===e.entryType)&&o.set(e,i),u()},i.p=e=>{if(!a.get(e)){const i=e.entries[0].target;if(i){const n=t.generateTarget?.(i)??pi(i);a.set(e,n)}}};const d=(e,t)=>{const i=[];for(const r of n)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;i.push(r)}return i},p=e=>{const t=e.entries[0],n=o.get(t),r=t.processingStart,s=Math.max(t.startTime+t.duration,r),l=Math.min(n.processingEnd,s),u=n.entries.sort((e,t)=>e.processingStart-t.processingStart),c=d(t.startTime,l),p=i.h.get(t.interactionId),g={interactionTarget:a.get(p),interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:c,inputDelay:r-t.startTime,processingDuration:l-r,presentationDelay:s-l,loadState:ci(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{if(!e.longAnimationFrameEntries?.length)return;const t=e.interactionTime,i=e.inputDelay,n=e.processingDuration;let r,s,o=0,a=0,l=0,u=0;for(const l of e.longAnimationFrameEntries){a=a+l.startTime+l.duration-l.styleAndLayoutStart;for(const e of l.scripts){const l=e.startTime+e.duration;if(l<t)continue;const c=l-Math.max(t,e.startTime),d=e.duration?c/e.duration*e.forcedStyleAndLayoutDuration:0;o+=c-d,a+=d,c>u&&(s=e.startTime<t+i?"input-delay":e.startTime>=t+i+n?"presentation-delay":"processing-duration",r=e,u=c)}}const c=e.longAnimationFrameEntries.at(-1),d=c?c.startTime+c.duration:0;d>=t+i+n&&(l=e.nextPaintTime-d),r&&s&&(e.longestScript={entry:r,subpart:s,intersectingDuration:u}),e.totalScriptDuration=o,e.totalStyleAndLayoutDuration=a,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-t-o-a-l})(g),Object.assign(e,{attribution:g})};Ti("long-animation-frame",e=>{n=n.concat(e),u()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const i=Ai();Li(()=>{"interactionCount"in performance||Ri||(Ri=Ti("event",Di,{type:"event",buffered:!0,durationThreshold:0}));let n,r=Si("INP");const s=mi(t,zi),o=e=>{qi(()=>{for(const t of e)s.u(t);const t=s.M();t&&t.T!==r.value&&(r.value=t.T,r.entries=t.entries,n())})},a=Ti("event",o,{durationThreshold:t.durationThreshold??40});n=vi(e,r,Vi,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),bi(()=>{s.v(),r=Si("INP"),n=vi(e,r,Vi,t.reportAllChanges)}))})})(t=>{const i=p(t);e(i)},t)};class Hi{m;u(e){this.m?.(e)}}const Gi=[2500,4e3],Wi=[800,1800],Ki=e=>{document.prerendering?Li(()=>Ki(e)):"complete"!==document.readyState?addEventListener("load",()=>Ki(e),!0):setTimeout(e)},Xi="com.grafana.faro.lastNavigationId",Ji="load_state",Zi="time_to_first_byte";class Yi{constructor(e,t){this.corePushMeasurement=e,this.webVitalConfig=t}initialize(){this.measureCLS(),this.measureFCP(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){var e;((e,t={})=>{const i=mi(t=Object.assign({},t),li),n=new WeakMap;i.t=e=>{if(e?.sources?.length){const i=ji(e.sources),r=i?.node;if(r){const e=t.generateTarget?.(r)??pi(r);n.set(i,e)}}},((e,t={})=>{const i=Ai();_i(Ei(()=>{let n,r=Si("CLS",0);const s=mi(t,li),o=e=>{for(const t of e)s.u(t);s.o>r.value&&(r.value=s.o,r.entries=s.i,n())},a=Ti("layout-shift",o);a&&(n=vi(e,r,Pi,t.reportAllChanges),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),bi(()=>{s.o=0,r=Si("CLS",0),n=vi(e,r,Pi,t.reportAllChanges),wi(()=>n())}),setTimeout(n))}))})(t=>{const i=(e=>{let t={};if(e.entries.length){const i=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(i?.sources?.length){const e=ji(i.sources);e&&(t={largestShiftTarget:n.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:ci(i.startTime)})}}return Object.assign(e,{attribution:t})})(t);e(i)},t)})(e=>{const{loadState:t,largestShiftValue:i,largestShiftTime:n,largestShiftTarget:r}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"largest_shift_value",i),this.addIfPresent(s,"largest_shift_time",n);const o=this.buildInitialContext(e);this.addIfPresent(o,Ji,t),this.addIfPresent(o,"largest_shift_target",r),this.pushMeasurement(s,o)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFCP(){var e;((e,t={})=>{_i(t=>{const i=(e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ci(hi())};if(e.entries.length){const i=ui(),n=e.entries.at(-1);if(i){const r=i.activationStart||0,s=Math.max(0,i.responseStart-r);t={timeToFirstByte:s,firstByteToFCP:e.value-s,loadState:ci(e.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}return Object.assign(e,{attribution:t})})(t);e(i)},t)})(e=>{const{firstByteToFCP:t,timeToFirstByte:i,loadState:n}=e.attribution,r=this.buildInitialValues(e);this.addIfPresent(r,"first_byte_to_fcp",t),this.addIfPresent(r,Zi,i);const s=this.buildInitialContext(e);this.addIfPresent(s,Ji,n),this.pushMeasurement(r,s)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureINP(){var e;$i(e=>{const{interactionTime:t,presentationDelay:i,inputDelay:n,processingDuration:r,nextPaintTime:s,loadState:o,interactionTarget:a,interactionType:l}=e.attribution,u=this.buildInitialValues(e);this.addIfPresent(u,"interaction_time",t),this.addIfPresent(u,"presentation_delay",i),this.addIfPresent(u,"input_delay",n),this.addIfPresent(u,"processing_duration",r),this.addIfPresent(u,"next_paint_time",s);const c=this.buildInitialContext(e);this.addIfPresent(c,Ji,o),this.addIfPresent(c,"interaction_target",a),this.addIfPresent(c,"interaction_type",l),this.pushMeasurement(u,c)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureLCP(){var e;((e,t={})=>{const i=mi(t=Object.assign({},t),Hi),n=new WeakMap;i.m=e=>{const i=e.element;if(i){const r=t.generateTarget?.(i)??pi(i);n.set(e,r)}},((e,t={})=>{Li(()=>{const i=Ai();let n,r=Si("LCP");const s=mi(t,Hi),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)s.u(t),t.startTime<i.firstHiddenTime&&(r.value=Math.max(t.startTime-yi(),0),r.entries=[t],n())},a=Ti("largest-contentful-paint",o);if(a){n=vi(e,r,Gi,t.reportAllChanges);const i=Ei(()=>{o(a.takeRecords()),a.disconnect(),n(!0)}),s=e=>{e.isTrusted&&(qi(i),removeEventListener(e.type,s,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,s,{capture:!0});bi(i=>{r=Si("LCP"),n=vi(e,r,Gi,t.reportAllChanges),wi(()=>{r.value=performance.now()-i.timeStamp,n(!0)})})}})})(t=>{const i=(e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){const i=ui();if(i){const r=i.activationStart||0,s=e.entries.at(-1),o=s.url&&performance.getEntriesByType("resource").filter(e=>e.name===s.url)[0],a=Math.max(0,i.responseStart-r),l=Math.max(a,o?(o.requestStart||o.startTime)-r:0),u=Math.min(e.value,Math.max(l,o?o.responseEnd-r:0));t={target:n.get(s),timeToFirstByte:a,resourceLoadDelay:l-a,resourceLoadDuration:u-l,elementRenderDelay:e.value-u,navigationEntry:i,lcpEntry:s},s.url&&(t.url=s.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})})(t);e(i)},t)})(e=>{const{elementRenderDelay:t,resourceLoadDelay:i,resourceLoadDuration:n,timeToFirstByte:r,target:s}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"element_render_delay",t),this.addIfPresent(o,"resource_load_delay",i),this.addIfPresent(o,"resource_load_duration",n),this.addIfPresent(o,Zi,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",s),this.pushMeasurement(o,a)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureTTFB(){var e;((e,t={})=>{((e,t={})=>{let i=Si("TTFB"),n=vi(e,i,Wi,t.reportAllChanges);Ki(()=>{const r=ui();r&&(i.value=Math.max(r.responseStart-yi(),0),i.entries=[r],n(!0),bi(()=>{i=Si("TTFB",0),n=vi(e,i,Wi,t.reportAllChanges),n(!0)}))})})(t=>{const i=(e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){const i=e.entries[0],n=i.activationStart||0,r=Math.max((i.workerStart||i.fetchStart)-n,0),s=Math.max(i.domainLookupStart-n,0),o=Math.max(i.connectStart-n,0),a=Math.max(i.connectEnd-n,0);t={waitingDuration:r,cacheDuration:s-r,dnsDuration:o-s,connectionDuration:a-o,requestDuration:e.value-a,navigationEntry:i}}return Object.assign(e,{attribution:t})})(t);e(i)},t)})(e=>{const{dnsDuration:t,connectionDuration:i,requestDuration:n,waitingDuration:r,cacheDuration:s}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"dns_duration",t),this.addIfPresent(o,"connection_duration",i),this.addIfPresent(o,"request_duration",n),this.addIfPresent(o,"waiting_duration",r),this.addIfPresent(o,"cache_duration",s);const a=this.buildInitialContext(e);this.pushMeasurement(o,a)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const i=null!==(t=Ne(Xi,je))&&void 0!==t?t:xe;return{id:e.id,rating:e.rating,navigation_type:e.navigationType,navigation_entry_id:i}}pushMeasurement(e,t){this.corePushMeasurement({type:"web-vitals",values:e},{context:t})}addIfPresent(e,t,i){i&&(e[t]=i)}}class Qi extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=we}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){var e,t,i;return!1===(null===(e=this.config)||void 0===e?void 0:e.trackWebVitalsAttribution)||!1===(null===(i=null===(t=this.config)||void 0===t?void 0:t.webVitalsInstrumentation)||void 0===i?void 0:i.trackAttribution)?new ai(this.api.pushMeasurement,this.config.webVitalsInstrumentation):new Yi(this.api.pushMeasurement,this.config.webVitalsInstrumentation)}}function en(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function tn(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const nn="resource",rn=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function sn(e=[]){for(const t of e)if("traceparent"===t.name){if(!rn.test(t.description))continue;const[,e,i]=t.description.split("-");if(null!=e&&null!=i)return{traceId:e,spanId:i};break}}function on(e,t={}){for(const[i,n]of Object.entries(t)){const t=e[i];return null!=t&&(f(n)?n.includes(t):t===n)}return!0}function an(e){const{connectEnd:t,connectStart:i,decodedBodySize:n,domainLookupEnd:r,domainLookupStart:s,duration:o,encodedBodySize:a,fetchStart:l,initiatorType:u,name:c,nextHopProtocol:d,redirectEnd:p,redirectStart:g,renderBlockingStatus:m,requestStart:f,responseEnd:h,responseStart:b,responseStatus:v,secureConnectionStart:w,transferSize:y,workerStart:S}=e;return{name:c,duration:un(o),tcpHandshakeTime:un(t-i),dnsLookupTime:un(r-s),tlsNegotiationTime:un(t-w),responseStatus:un(v),redirectTime:un(p-g),requestTime:un(b-f),responseTime:un(h-b),fetchTime:un(h-l),serviceWorkerTime:un(l-S),decodedBodySize:un(n),encodedBodySize:un(a),cacheHitStatus:function(){let e="fullLoad";0===y?n>0&&(e="cache"):null!=v?304===v&&(e="conditionalFetch"):a>0&&y<a&&(e="conditionalFetch");return e}(),renderBlockingStatus:un(m),protocol:d,initiatorType:u,visibilityState:document.visibilityState,ttfb:un(b-f),transferSize:un(y)}}function ln(e){const{activationStart:t,domComplete:i,domContentLoadedEventEnd:n,domContentLoadedEventStart:r,domInteractive:s,fetchStart:o,loadEventEnd:a,loadEventStart:l,responseStart:u,type:c}=e,d=function(){var e;if(null!=(null===(e=performance.timing)||void 0===e?void 0:e.domLoading))return performance.timing.domLoading-performance.timeOrigin;return null}();return Object.assign(Object.assign({},an(e)),{pageLoadTime:un(i-o),documentParsingTime:un(d?s-d:null),domProcessingTime:un(i-s),domContentLoadHandlerTime:un(n-r),onLoadTime:un(a-l),ttfb:un(Math.max(u-(null!=t?t:0),0)),type:c})}function un(e){return null==e?xe:"number"==typeof e?Math.round(e>0?e:0).toString():e.toString()}const cn={initiatorType:["xmlhttprequest","fetch"]};const dn=new z;class pn extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=we}initialize(){"PerformanceObserver"in window?function(e){if("complete"===document.readyState)e();else{const t=()=>{"complete"===document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}(()=>tn(this,void 0,void 0,function*(){const t=this.api.pushEvent,{faroNavigationId:i}=yield function(e){let t;const i=new Promise(e=>{t=e});return new PerformanceObserver(i=>{var n;const[r]=i.getEntries();if(null==r||$e(r.name))return;const s=r.toJSON();let o=sn(null==s?void 0:s.serverTiming);const a=null!==(n=Ne(Xi,je))&&void 0!==n?n:xe,l=Object.assign(Object.assign({},ln(s)),{faroNavigationId:D(),faroPreviousNavigationId:a});De(Xi,l.faroNavigationId,je),e("faro.performance.navigation",l,void 0,{spanContext:o,timestampOverwriteMs:performance.timeOrigin+s.startTime}),t(l)}).observe({type:"navigation",buffered:!0}),i}(t);null!=i&&function(t,i,n){const r=e.faro.config.trackResources;new PerformanceObserver(s=>{const o=s.getEntries();for(const s of o){if($e(s.name))return;const o=s.toJSON();let a=sn(null==o?void 0:o.serverTiming);if(null==r&&on(o,cn)||r){const r=Object.assign(Object.assign({},an(o)),{faroNavigationId:t,faroResourceId:D()});e.faro.config.trackUserActionsPreview&&(null==n||n.notify({type:nn})),i("faro.performance.resource",r,void 0,{spanContext:a,timestampOverwriteMs:performance.timeOrigin+o.startTime})}}}).observe({type:nn,buffered:!0})}(i,t,dn)})):this.logDebug("performance observer not supported. Disable performance instrumentation.")}}const gn="http-request-start",mn="http-request-end",fn="data-faro-user-action-name";const hn="fetch",bn="xhr";function vn(){const e=new z;function t(t){e.notify({type:gn,request:t})}function i(t){e.notify({type:mn,request:t})}return function({onRequestEnd:e,onRequestStart:t}){const i=window.fetch;window.fetch=function(){var n,r;const s=null!==(n=He(arguments[0]))&&void 0!==n?n:"",o=$e(s),a=(null!==(r=arguments[1])&&void 0!==r?r:{}).method,l=D();return o||t({url:s,method:a,requestId:l,apiType:hn}),i.apply(this,arguments).then(t=>(o||e({url:s,method:a,requestId:l,apiType:hn}),t)).catch(t=>{throw o||e({url:s,method:a,requestId:l,apiType:hn}),t})}}({onRequestStart:t,onRequestEnd:i}),function({onRequestStart:e,onRequestEnd:t}){const i=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){const n=arguments[1],r=$e(n),s=arguments[0],o=D();this.addEventListener("loadstart",function(){r||e({url:n,method:s,requestId:o,apiType:bn})}),this.addEventListener("load",function(){r||t({url:n,method:s,requestId:o,apiType:bn})}),this.addEventListener("error",function(){r||t({url:n,method:s,requestId:o,apiType:bn})}),this.addEventListener("abort",function(){r||t({url:n,method:s,requestId:o,apiType:bn})}),i.apply(this,arguments)}}({onRequestStart:t,onRequestEnd:i}),e}function wn(t){const{api:i,config:n}=t,r=vn(),s=function(){const e=new z;return new MutationObserver((t,i)=>{e.notify({type:"dom-mutation"})}).observe(document,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e}(),o=function(){const e=new z;return dn.subscribe(t=>{t.type===nn&&e.notify({type:"resource-entry"})}),e}();function a(t){const i=new Map,n=(new z).merge(r,s,o).takeWhile(()=>[e.UserActionState.Started,e.UserActionState.Halted].includes(t.getState())).filter(n=>!!(t.getState()!==e.UserActionState.Halted||yn(n)&&i.has(n.request.requestId))).subscribe(n=>{(function(e){return e.type===gn})(n)&&i.set(n.request.requestId,n.request),yn(n)&&i.delete(n.request.requestId),yn(n)?t.getState()===e.UserActionState.Halted&&0===i.size&&t.end():t.extend(()=>i.size>0)});t.filter(t=>[e.UserActionState.Ended,e.UserActionState.Cancelled].includes(t)).first().subscribe(()=>{!function(e){null==e||e.unsubscribe(),e=void 0}(n)})}return{processUserEvent:function(e){var t;const r=function(e,t){const i=function(e){const t=e.split("data-")[1],i=null==t?void 0:t.replace(/-(.)/g,(e,t)=>t.toUpperCase());return null==i?void 0:i.replace(/-/g,"")}(t),n=e.dataset;for(const e in n)if(e===i)return n[e];return}(e.target,null!==(t=n.trackUserActionsDataAttributeName)&&void 0!==t?t:"faroUserActionName");if(!r)return;const s=i.startUserAction(r,{},{triggerName:e.type});s&&a(s)},proceessUserActionStarted:a}}function yn(e){return e.type===mn}class Sn extends ve{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-user-action",this.version=we}initialize(){const{processUserEvent:t,proceessUserActionStarted:i}=wn(e.faro);window.addEventListener("pointerdown",t),window.addEventListener("keydown",e=>{[" ","Enter"].includes(e.key)&&t(e)}),this._userActionSub=he.subscribe(({type:e,userAction:t})=>{"user_action_start"===e&&i(t)})}destroy(){var e;null===(e=this._userActionSub)||void 0===e||e.unsubscribe()}}class Tn extends ve{constructor(){super(),this.name="@grafana/faro-web-sdk:instrumentation-csp",this.version=we}initialize(){document.addEventListener("securitypolicyviolation",this.securitypolicyviolationHandler.bind(this))}destroy(){document.removeEventListener("securitypolicyviolation",this.securitypolicyviolationHandler)}securitypolicyviolationHandler(e){this.api.pushEvent("securitypolicyviolation",F(e))}}function En(e={}){const t=[new Sn,new It,new Qi,new ot,new kt];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new pn),!1!==e.enableContentSecurityPolicyInstrumentation&&t.push(new Tn),!1!==e.captureConsole&&t.push(new Et),t}const In="browser",kn=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};let xn,On;function An({generatePageId:e,initialPageMeta:t}={}){return()=>{const i=location.href;return m(e)&&xn!==i&&(xn=i,On=e(location)),{page:Object.assign(Object.assign({url:i},On?{id:On}:{}),t)}}}class Ln extends Y{constructor(e){var t,i,n,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=we,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(t=e.defaultRateLimitBackoffMs)&&void 0!==t?t:5e3,this.getNow=null!==(i=e.getNow)&&void 0!==i?i:()=>Date.now(),this.promiseBuffer=M({size:null!==(n=e.bufferSize)&&void 0!==n?n:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return tn(this,void 0,void 0,function*(){try{if(this.disabledUntil>new Date(this.getNow()))return this.logWarn(`Dropping transport item due to too many requests. Backoff until ${this.disabledUntil}`),Promise.resolve();yield this.promiseBuffer.add(()=>{const t=JSON.stringify(ee(e)),{url:i,requestOptions:n,apiKey:r}=this.options,s=null!=n?n:{},{headers:o}=s,a=en(s,["headers"]);let l;const u=this.metas.value.session;return null!=u&&(l=u.id),fetch(i,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=o?o:{}),r?{"x-api-key":r}:{}),l?{"x-faro-session-id":l}:{}),body:t,keepalive:t.length<=6e4},null!=a?a:{})).then(e=>tn(this,void 0,void 0,function*(){if(202===e.status){"invalid"===e.headers.get("X-Faro-Session-Status")&&this.extendFaroSession(this.config,this.logDebug)}return 429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(U),e})).catch(e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(t),e)})})}catch(e){this.logError(e)}})}getIgnoreUrls(){var e;return[this.options.url].concat(null!==(e=this.config.ignoreUrls)&&void 0!==e?e:[])}isBatched(){return!0}getRetryAfterDate(e){const t=this.getNow(),i=e.headers.get("Retry-After");if(i){const e=Number(i);if(!isNaN(e))return new Date(1e3*e+t);const n=Date.parse(i);if(!isNaN(n))return new Date(n)}return new Date(t+this.rateLimitBackoffMs)}extendFaroSession(e,t){const i="Session expired",n=e.sessionTracking;if(null==n?void 0:n.enabled){const{fetchUserSession:e,storeUserSession:r}=st(n);et({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${i} created new session.`)}else t(`${i}.`)}}function Cn(e){var t;const i=[],n=K(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&n.error('if "transports" is defined, "url" and "apiKey" should not be defined'),i.push(...e.transports)):e.url?i.push(new Ln({url:e.url,apiKey:e.apiKey})):n.error('either "url" or "transports" must be defined');const{dedupe:r=!0,eventDomain:s=In,globalObjectKey:o=le,instrumentations:a=En(),internalLoggerLevel:l=$,isolate:u=!1,logArgsSerializer:c=se,metas:d=Pn(e),paused:p=!1,preventGlobalExposure:g=!1,unpatchedConsole:m=H,trackUserActionsPreview:f=!1,trackUserActionsDataAttributeName:h=fn,url:b}=e,v=en(e,["dedupe","eventDomain","globalObjectKey","instrumentations","internalLoggerLevel","isolate","logArgsSerializer","metas","paused","preventGlobalExposure","unpatchedConsole","trackUserActionsPreview","trackUserActionsDataAttributeName","url"]);return Object.assign(Object.assign({},v),{batching:Object.assign(Object.assign({},ue),e.batching),dedupe:r,globalObjectKey:o,instrumentations:_n(a,e),internalLoggerLevel:l,isolate:u,logArgsSerializer:c,metas:d,parseStacktrace:wt,paused:p,preventGlobalExposure:g,transports:i,unpatchedConsole:m,eventDomain:s,ignoreUrls:[...null!==(t=e.ignoreUrls)&&void 0!==t?t:[],...b?[b]:[],/\/collect(?:\/[\w]*)?$/],sessionTracking:Object.assign(Object.assign(Object.assign({},Je),e.sessionTracking),jn({trackGeolocation:e.trackGeolocation,sessionTracking:e.sessionTracking})),trackUserActionsPreview:f,trackUserActionsDataAttributeName:h})}function _n(e,{trackUserActionsPreview:t}){return e.filter(e=>!("@grafana/faro-web-sdk:instrumentation-user-action"===e.name&&!t))}function Pn(e){var t,i;const{page:n,generatePageId:r}=null!==(t=null==e?void 0:e.pageTracking)&&void 0!==t?t:{},s=[_e,An({generatePageId:r,initialPageMeta:n}),...null!==(i=e.metas)&&void 0!==i?i:[]];return g(window.k6)?[...s,kn]:s}function jn({trackGeolocation:e,sessionTracking:t}){var i;const n={};return p(e)&&(n.geoLocationTrackingEnabled=e),x(n)?{}:{session:Object.assign(Object.assign({},null!==(i=null==t?void 0:t.session)&&void 0!==i?i:{}),{overrides:n})}}return e.BaseExtension=Z,e.BaseInstrumentation=ve,e.BaseTransport=Y,e.CSPInstrumentation=Tn,e.ConsoleInstrumentation=Et,e.ConsoleTransport=class extends Y{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=we}send(t){var i;return this.unpatchedConsole[null!==(i=this.options.level)&&void 0!==i?i:e.LogLevel.DEBUG]("New event",ee([t]))}},e.EVENT_CLICK="click",e.EVENT_NAVIGATION="navigation",e.EVENT_ROUTE_CHANGE="route_change",e.EVENT_SESSION_EXTEND=Ie,e.EVENT_SESSION_RESUME=Ee,e.EVENT_SESSION_START=Te,e.EVENT_VIEW_CHANGED=Se,e.ErrorsInstrumentation=It,e.FetchTransport=Ln,e.MAX_SESSION_PERSISTENCE_TIME=Xe,e.Observable=z,e.PerformanceInstrumentation=pn,e.PersistentSessionsManager=nt,e.SESSION_EXPIRATION_TIME=We,e.SESSION_INACTIVITY_TIME=Ke,e.STORAGE_KEY=Ge,e.SessionInstrumentation=ot,e.UserActionInstrumentation=Sn,e.VERSION=we,e.ViewInstrumentation=kt,e.VolatileSessionsManager=rt,e.WebVitalsInstrumentation=Qi,e.allLogLevels=j,e.browserMeta=_e,e.buildStackFrame=ht,e.createInternalLogger=K,e.createPromiseBuffer=M,e.createSession=Pe,e.deepEqual=O,e.defaultEventDomain=In,e.defaultExceptionType=te,e.defaultGlobalObjectKey=le,e.defaultInternalLoggerLevel=$,e.defaultLogLevel=P,e.genShortID=D,e.getCurrentTimestamp=L,e.getDataFromSafariExtensions=bt,e.getIgnoreUrls=Ve,e.getInternalFaroFromGlobalObject=function(){return R[ce]},e.getStackFramesFromError=vt,e.getTransportBody=ee,e.getUrlFromResource=He,e.getWebInstrumentations=En,e.globalObject=R,e.initializeFaro=function(e){const t=Cn(e);if(t)return ye(t)},e.internalGlobalObjectKey=ce,e.isArray=f,e.isBoolean=p,e.isDomError=T,e.isDomException=E,e.isElement=e=>I&&l(e,Element),e.isElementDefined=I,e.isEmpty=x,e.isError=y,e.isErrorDefined=w,e.isErrorEvent=S,e.isEvent=v,e.isEventDefined=b,e.isFunction=m,e.isInstanceOf=l,e.isInt=e=>d(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=pe,e.isMap=e=>k&&l(e,Map),e.isMapDefined=k,e.isNull=u,e.isNumber=d,e.isObject=g,e.isPrimitive=h,e.isRegExp=e=>a(e,"RegExp"),e.isString=c,e.isSymbol=e=>o(e,"symbol"),e.isSyntheticEvent=e=>g(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>m(null==e?void 0:e.then),e.isToString=a,e.isTypeof=o,e.isUndefined=e=>o(e,"undefined"),e.makeCoreConfig=Cn,e.noop=U,e.parseStacktrace=wt,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:we,integrations:e.faro.config.instrumentations.map(({name:e,version:t})=>({name:e,version:t}))}}),e.setInternalFaroOnGlobalObject=de,e.transportItemTypeToBodyKey=n,e.unknownString=xe,e.userActionDataAttribute=fn,e}({});
@@ -7,7 +7,7 @@ export type { ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentatio
7
7
  export { browserMeta, createSession, sdkMeta } from './metas';
8
8
  export { ConsoleTransport, FetchTransport } from './transports';
9
9
  export type { ClockFn, ConsoleTransportOptions, FetchTransportOptions, FetchTransportRequestOptions, } from './transports';
10
- export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, isEmpty, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, Observable, unknownString, } from '@grafana/faro-core';
10
+ export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, isEmpty, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, Observable, unknownString, UserActionState, } from '@grafana/faro-core';
11
11
  export type { Faro, API, APIEvent, BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BeforeSendHook, BufferItem, Config, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionEventExtended, ExceptionStackFrame, ExceptionsAPI, ExtendedError, Extension, GlobalObject, Instrumentation, Instrumentations, InternalLogger, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, Meta, MetaAPI, MetaApp, MetaAttributes, MetaBrowser, MetaGetter, MetaItem, MetaPage, Metas, MetaSDK, MetaSDKIntegration, MetaSession, MetaUser, MetaView, OTELApi, Patterns, PromiseBuffer, PromiseBufferOptions, PromiseProducer, PushErrorOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, UnpatchedConsole, } from '@grafana/faro-core';
12
12
  export { PersistentSessionsManager, VolatileSessionsManager, MAX_SESSION_PERSISTENCE_TIME, SESSION_EXPIRATION_TIME, SESSION_INACTIVITY_TIME, STORAGE_KEY, } from './instrumentations/session';
13
13
  export { getIgnoreUrls, getUrlFromResource } from './utils/url';
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation, LogLevel } from '@grafana/faro-core';
2
2
  export declare class ConsoleInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-console";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  static defaultDisabledLevels: LogLevel[];
6
6
  static consoleErrorPrefix: string;
7
7
  private errorSerializer;
@@ -2,7 +2,7 @@ import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  import type { Instrumentation } from '@grafana/faro-core';
3
3
  export declare class CSPInstrumentation extends BaseInstrumentation implements Instrumentation {
4
4
  readonly name = "@grafana/faro-web-sdk:instrumentation-csp";
5
- readonly version = "2.0.0-beta";
5
+ readonly version = "2.0.0-beta-2";
6
6
  constructor();
7
7
  initialize(): void;
8
8
  destroy(): void;
@@ -1,6 +1,6 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class ErrorsInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-errors";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  initialize(): void;
6
6
  }
@@ -3,6 +3,6 @@ import type { ResourceEntryMessage } from './types';
3
3
  export declare const performanceEntriesSubscription: Observable<ResourceEntryMessage>;
4
4
  export declare class PerformanceInstrumentation extends BaseInstrumentation {
5
5
  readonly name = "@grafana/faro-web-sdk:instrumentation-performance";
6
- readonly version = "2.0.0-beta";
6
+ readonly version = "2.0.0-beta-2";
7
7
  initialize(): void;
8
8
  }
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class SessionInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-session";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  private notifiedSession;
6
6
  private sendSessionStartEvent;
7
7
  private createInitialSession;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class UserActionInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-user-action";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  private _userActionSub?;
6
6
  initialize(): void;
7
7
  destroy(): void;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class ViewInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-view";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  private notifiedView;
6
6
  private sendViewChangedEvent;
7
7
  initialize(): void;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class WebVitalsInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  initialize(): void;
6
6
  private intializeWebVitalsInstrumentation;
7
7
  }
@@ -4,7 +4,7 @@ import type { ConsoleTransportOptions } from './types';
4
4
  export declare class ConsoleTransport extends BaseTransport {
5
5
  private options;
6
6
  readonly name = "@grafana/faro-web-sdk:transport-console";
7
- readonly version = "2.0.0-beta";
7
+ readonly version = "2.0.0-beta-2";
8
8
  constructor(options?: ConsoleTransportOptions);
9
9
  send(item: TransportItem): void;
10
10
  }
@@ -4,7 +4,7 @@ import type { FetchTransportOptions } from './types';
4
4
  export declare class FetchTransport extends BaseTransport {
5
5
  private options;
6
6
  readonly name = "@grafana/faro-web-sdk:transport-fetch";
7
- readonly version = "2.0.0-beta";
7
+ readonly version = "2.0.0-beta-2";
8
8
  promiseBuffer: PromiseBuffer<Response | void>;
9
9
  private readonly rateLimitBackoffMs;
10
10
  private readonly getNow;
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.internalGlobalObjectKey = exports.globalObject = exports.getTransportBody = exports.getInternalFaroFromGlobalObject = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultExceptionType = exports.deepEqual = exports.createPromiseBuffer = exports.createInternalLogger = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.FetchTransport = exports.ConsoleTransport = exports.sdkMeta = exports.createSession = exports.browserMeta = exports.UserActionInstrumentation = exports.CSPInstrumentation = exports.PerformanceInstrumentation = exports.SessionInstrumentation = exports.WebVitalsInstrumentation = exports.ViewInstrumentation = exports.parseStacktrace = exports.getStackFramesFromError = exports.getDataFromSafariExtensions = exports.ErrorsInstrumentation = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.initializeFaro = exports.defaultEventDomain = exports.makeCoreConfig = exports.getWebInstrumentations = void 0;
4
- exports.userActionDataAttribute = exports.getUrlFromResource = exports.getIgnoreUrls = exports.STORAGE_KEY = exports.SESSION_INACTIVITY_TIME = exports.SESSION_EXPIRATION_TIME = exports.MAX_SESSION_PERSISTENCE_TIME = exports.VolatileSessionsManager = exports.PersistentSessionsManager = exports.unknownString = exports.Observable = exports.EVENT_VIEW_CHANGED = exports.EVENT_SESSION_START = exports.EVENT_SESSION_RESUME = exports.EVENT_SESSION_EXTEND = exports.EVENT_ROUTE_CHANGE = exports.EVENT_NAVIGATION = exports.EVENT_CLICK = exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isEmpty = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = void 0;
4
+ exports.userActionDataAttribute = exports.getUrlFromResource = exports.getIgnoreUrls = exports.STORAGE_KEY = exports.SESSION_INACTIVITY_TIME = exports.SESSION_EXPIRATION_TIME = exports.MAX_SESSION_PERSISTENCE_TIME = exports.VolatileSessionsManager = exports.PersistentSessionsManager = exports.UserActionState = exports.unknownString = exports.Observable = exports.EVENT_VIEW_CHANGED = exports.EVENT_SESSION_START = exports.EVENT_SESSION_RESUME = exports.EVENT_SESSION_EXTEND = exports.EVENT_ROUTE_CHANGE = exports.EVENT_NAVIGATION = exports.EVENT_CLICK = exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isEmpty = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = void 0;
5
5
  var config_1 = require("./config");
6
6
  Object.defineProperty(exports, "getWebInstrumentations", { enumerable: true, get: function () { return config_1.getWebInstrumentations; } });
7
7
  Object.defineProperty(exports, "makeCoreConfig", { enumerable: true, get: function () { return config_1.makeCoreConfig; } });
@@ -94,6 +94,7 @@ Object.defineProperty(exports, "EVENT_SESSION_START", { enumerable: true, get: f
94
94
  Object.defineProperty(exports, "EVENT_VIEW_CHANGED", { enumerable: true, get: function () { return faro_core_1.EVENT_VIEW_CHANGED; } });
95
95
  Object.defineProperty(exports, "Observable", { enumerable: true, get: function () { return faro_core_1.Observable; } });
96
96
  Object.defineProperty(exports, "unknownString", { enumerable: true, get: function () { return faro_core_1.unknownString; } });
97
+ Object.defineProperty(exports, "UserActionState", { enumerable: true, get: function () { return faro_core_1.UserActionState; } });
97
98
  var session_1 = require("./instrumentations/session");
98
99
  Object.defineProperty(exports, "PersistentSessionsManager", { enumerable: true, get: function () { return session_1.PersistentSessionsManager; } });
99
100
  Object.defineProperty(exports, "VolatileSessionsManager", { enumerable: true, get: function () { return session_1.VolatileSessionsManager; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,mCAAkE;AAAzD,gHAAA,sBAAsB,OAAA;AAAE,wGAAA,cAAc,OAAA;AAG/C,mCAA8C;AAArC,4GAAA,kBAAkB,OAAA;AAE3B,2CAA8C;AAArC,4GAAA,cAAc,OAAA;AAEvB,uDAa4B;AAZ1B,mHAAA,eAAe,OAAA;AACf,0HAAA,sBAAsB,OAAA;AACtB,yHAAA,qBAAqB,OAAA;AACrB,+HAAA,2BAA2B,OAAA;AAC3B,2HAAA,uBAAuB,OAAA;AACvB,mHAAA,eAAe,OAAA;AACf,uHAAA,mBAAmB,OAAA;AACnB,4HAAA,wBAAwB,OAAA;AACxB,0HAAA,sBAAsB,OAAA;AACtB,8HAAA,0BAA0B,OAAA;AAC1B,sHAAA,kBAAkB,OAAA;AAClB,6HAAA,yBAAyB,OAAA;AAI3B,iCAA8D;AAArD,oGAAA,WAAW,OAAA;AAAE,sGAAA,aAAa,OAAA;AAAE,gGAAA,OAAO,OAAA;AAE5C,2CAAgE;AAAvD,8GAAA,gBAAgB,OAAA;AAAE,4GAAA,cAAc,OAAA;AAQzC,gDAiE4B;AAhE1B,iGAAA,IAAI,OAAA;AACJ,yGAAA,YAAY,OAAA;AACZ,0GAAA,aAAa,OAAA;AACb,gHAAA,mBAAmB,OAAA;AACnB,0GAAA,aAAa,OAAA;AACb,iHAAA,oBAAoB,OAAA;AACpB,gHAAA,mBAAmB,OAAA;AACnB,sGAAA,SAAS,OAAA;AACT,iHAAA,oBAAoB,OAAA;AACpB,mHAAA,sBAAsB,OAAA;AACtB,uHAAA,0BAA0B,OAAA;AAC1B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AACV,gHAAA,mBAAmB,OAAA;AACnB,4HAAA,+BAA+B,OAAA;AAC/B,6GAAA,gBAAgB,OAAA;AAChB,yGAAA,YAAY,OAAA;AACZ,oHAAA,uBAAuB,OAAA;AACvB,oGAAA,OAAO,OAAA;AACP,sGAAA,SAAS,OAAA;AACT,uGAAA,UAAU,OAAA;AACV,2GAAA,cAAc,OAAA;AACd,sGAAA,SAAS,OAAA;AACT,6GAAA,gBAAgB,OAAA;AAChB,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AACZ,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,uGAAA,UAAU,OAAA;AACV,yGAAA,YAAY,OAAA;AACZ,kGAAA,KAAK,OAAA;AACL,yHAAA,4BAA4B,OAAA;AAC5B,kGAAA,KAAK,OAAA;AACL,yGAAA,YAAY,OAAA;AACZ,mGAAA,MAAM,OAAA;AACN,qGAAA,QAAQ,OAAA;AACR,qGAAA,QAAQ,OAAA;AACR,wGAAA,WAAW,OAAA;AACX,qGAAA,QAAQ,OAAA;AACR,qGAAA,QAAQ,OAAA;AACR,qGAAA,QAAQ,OAAA;AACR,6GAAA,gBAAgB,OAAA;AAChB,uGAAA,UAAU,OAAA;AACV,uGAAA,UAAU,OAAA;AACV,qGAAA,QAAQ,OAAA;AACR,wGAAA,WAAW,OAAA;AACX,oGAAA,OAAO,OAAA;AACP,gHAAA,mBAAmB,OAAA;AACnB,qGAAA,QAAQ,OAAA;AACR,iGAAA,IAAI,OAAA;AACJ,0HAAA,6BAA6B,OAAA;AAC7B,8GAAA,iBAAiB,OAAA;AACjB,uHAAA,0BAA0B,OAAA;AAC1B,oGAAA,OAAO,OAAA;AACP,wGAAA,WAAW,OAAA;AACX,6GAAA,gBAAgB,OAAA;AAChB,+GAAA,kBAAkB,OAAA;AAClB,iHAAA,oBAAoB,OAAA;AACpB,iHAAA,oBAAoB,OAAA;AACpB,gHAAA,mBAAmB,OAAA;AACnB,+GAAA,kBAAkB,OAAA;AAClB,uGAAA,UAAU,OAAA;AACV,0GAAA,aAAa,OAAA;AAmEf,sDAOoC;AANlC,oHAAA,yBAAyB,OAAA;AACzB,kHAAA,uBAAuB,OAAA;AACvB,uHAAA,4BAA4B,OAAA;AAC5B,kHAAA,uBAAuB,OAAA;AACvB,kHAAA,uBAAuB,OAAA;AACvB,sGAAA,WAAW,OAAA;AAGb,mCAAgE;AAAvD,oGAAA,aAAa,OAAA;AAAE,yGAAA,kBAAkB,OAAA;AAE1C,8DAAyE;AAAhE,sHAAA,uBAAuB,OAAA","sourcesContent":["export { getWebInstrumentations, makeCoreConfig } from './config';\nexport type { BrowserConfig } from './config';\n\nexport { defaultEventDomain } from './consts';\n\nexport { initializeFaro } from './initialize';\n\nexport {\n buildStackFrame,\n ConsoleInstrumentation,\n ErrorsInstrumentation,\n getDataFromSafariExtensions,\n getStackFramesFromError,\n parseStacktrace,\n ViewInstrumentation,\n WebVitalsInstrumentation,\n SessionInstrumentation,\n PerformanceInstrumentation,\n CSPInstrumentation,\n UserActionInstrumentation,\n} from './instrumentations';\nexport type { ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations';\n\nexport { browserMeta, createSession, sdkMeta } from './metas';\n\nexport { ConsoleTransport, FetchTransport } from './transports';\nexport type {\n ClockFn,\n ConsoleTransportOptions,\n FetchTransportOptions,\n FetchTransportRequestOptions,\n} from './transports';\n\nexport {\n faro,\n allLogLevels,\n BaseExtension,\n BaseInstrumentation,\n BaseTransport,\n createInternalLogger,\n createPromiseBuffer,\n deepEqual,\n defaultExceptionType,\n defaultGlobalObjectKey,\n defaultInternalLoggerLevel,\n defaultLogLevel,\n genShortID,\n getCurrentTimestamp,\n getInternalFaroFromGlobalObject,\n getTransportBody,\n globalObject,\n internalGlobalObjectKey,\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isInternalFaroOnGlobalObject,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n isEmpty,\n InternalLoggerLevel,\n LogLevel,\n noop,\n setInternalFaroOnGlobalObject,\n TransportItemType,\n transportItemTypeToBodyKey,\n VERSION,\n EVENT_CLICK,\n EVENT_NAVIGATION,\n EVENT_ROUTE_CHANGE,\n EVENT_SESSION_EXTEND,\n EVENT_SESSION_RESUME,\n EVENT_SESSION_START,\n EVENT_VIEW_CHANGED,\n Observable,\n unknownString,\n} from '@grafana/faro-core';\n\nexport type {\n Faro,\n API,\n APIEvent,\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BeforeSendHook,\n BufferItem,\n Config,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionEventExtended,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n Extension,\n GlobalObject,\n Instrumentation,\n Instrumentations,\n InternalLogger,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n Meta,\n MetaAPI,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n OTELApi,\n Patterns,\n PromiseBuffer,\n PromiseBufferOptions,\n PromiseProducer,\n PushErrorOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n UnpatchedConsole,\n} from '@grafana/faro-core';\n\nexport {\n PersistentSessionsManager,\n VolatileSessionsManager,\n MAX_SESSION_PERSISTENCE_TIME,\n SESSION_EXPIRATION_TIME,\n SESSION_INACTIVITY_TIME,\n STORAGE_KEY,\n} from './instrumentations/session';\n\nexport { getIgnoreUrls, getUrlFromResource } from './utils/url';\n\nexport { userActionDataAttribute } from './instrumentations/userActions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,mCAAkE;AAAzD,gHAAA,sBAAsB,OAAA;AAAE,wGAAA,cAAc,OAAA;AAG/C,mCAA8C;AAArC,4GAAA,kBAAkB,OAAA;AAE3B,2CAA8C;AAArC,4GAAA,cAAc,OAAA;AAEvB,uDAa4B;AAZ1B,mHAAA,eAAe,OAAA;AACf,0HAAA,sBAAsB,OAAA;AACtB,yHAAA,qBAAqB,OAAA;AACrB,+HAAA,2BAA2B,OAAA;AAC3B,2HAAA,uBAAuB,OAAA;AACvB,mHAAA,eAAe,OAAA;AACf,uHAAA,mBAAmB,OAAA;AACnB,4HAAA,wBAAwB,OAAA;AACxB,0HAAA,sBAAsB,OAAA;AACtB,8HAAA,0BAA0B,OAAA;AAC1B,sHAAA,kBAAkB,OAAA;AAClB,6HAAA,yBAAyB,OAAA;AAI3B,iCAA8D;AAArD,oGAAA,WAAW,OAAA;AAAE,sGAAA,aAAa,OAAA;AAAE,gGAAA,OAAO,OAAA;AAE5C,2CAAgE;AAAvD,8GAAA,gBAAgB,OAAA;AAAE,4GAAA,cAAc,OAAA;AAQzC,gDAkE4B;AAjE1B,iGAAA,IAAI,OAAA;AACJ,yGAAA,YAAY,OAAA;AACZ,0GAAA,aAAa,OAAA;AACb,gHAAA,mBAAmB,OAAA;AACnB,0GAAA,aAAa,OAAA;AACb,iHAAA,oBAAoB,OAAA;AACpB,gHAAA,mBAAmB,OAAA;AACnB,sGAAA,SAAS,OAAA;AACT,iHAAA,oBAAoB,OAAA;AACpB,mHAAA,sBAAsB,OAAA;AACtB,uHAAA,0BAA0B,OAAA;AAC1B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AACV,gHAAA,mBAAmB,OAAA;AACnB,4HAAA,+BAA+B,OAAA;AAC/B,6GAAA,gBAAgB,OAAA;AAChB,yGAAA,YAAY,OAAA;AACZ,oHAAA,uBAAuB,OAAA;AACvB,oGAAA,OAAO,OAAA;AACP,sGAAA,SAAS,OAAA;AACT,uGAAA,UAAU,OAAA;AACV,2GAAA,cAAc,OAAA;AACd,sGAAA,SAAS,OAAA;AACT,6GAAA,gBAAgB,OAAA;AAChB,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AACZ,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,uGAAA,UAAU,OAAA;AACV,yGAAA,YAAY,OAAA;AACZ,kGAAA,KAAK,OAAA;AACL,yHAAA,4BAA4B,OAAA;AAC5B,kGAAA,KAAK,OAAA;AACL,yGAAA,YAAY,OAAA;AACZ,mGAAA,MAAM,OAAA;AACN,qGAAA,QAAQ,OAAA;AACR,qGAAA,QAAQ,OAAA;AACR,wGAAA,WAAW,OAAA;AACX,qGAAA,QAAQ,OAAA;AACR,qGAAA,QAAQ,OAAA;AACR,qGAAA,QAAQ,OAAA;AACR,6GAAA,gBAAgB,OAAA;AAChB,uGAAA,UAAU,OAAA;AACV,uGAAA,UAAU,OAAA;AACV,qGAAA,QAAQ,OAAA;AACR,wGAAA,WAAW,OAAA;AACX,oGAAA,OAAO,OAAA;AACP,gHAAA,mBAAmB,OAAA;AACnB,qGAAA,QAAQ,OAAA;AACR,iGAAA,IAAI,OAAA;AACJ,0HAAA,6BAA6B,OAAA;AAC7B,8GAAA,iBAAiB,OAAA;AACjB,uHAAA,0BAA0B,OAAA;AAC1B,oGAAA,OAAO,OAAA;AACP,wGAAA,WAAW,OAAA;AACX,6GAAA,gBAAgB,OAAA;AAChB,+GAAA,kBAAkB,OAAA;AAClB,iHAAA,oBAAoB,OAAA;AACpB,iHAAA,oBAAoB,OAAA;AACpB,gHAAA,mBAAmB,OAAA;AACnB,+GAAA,kBAAkB,OAAA;AAClB,uGAAA,UAAU,OAAA;AACV,0GAAA,aAAa,OAAA;AACb,4GAAA,eAAe,OAAA;AAmEjB,sDAOoC;AANlC,oHAAA,yBAAyB,OAAA;AACzB,kHAAA,uBAAuB,OAAA;AACvB,uHAAA,4BAA4B,OAAA;AAC5B,kHAAA,uBAAuB,OAAA;AACvB,kHAAA,uBAAuB,OAAA;AACvB,sGAAA,WAAW,OAAA;AAGb,mCAAgE;AAAvD,oGAAA,aAAa,OAAA;AAAE,yGAAA,kBAAkB,OAAA;AAE1C,8DAAyE;AAAhE,sHAAA,uBAAuB,OAAA","sourcesContent":["export { getWebInstrumentations, makeCoreConfig } from './config';\nexport type { BrowserConfig } from './config';\n\nexport { defaultEventDomain } from './consts';\n\nexport { initializeFaro } from './initialize';\n\nexport {\n buildStackFrame,\n ConsoleInstrumentation,\n ErrorsInstrumentation,\n getDataFromSafariExtensions,\n getStackFramesFromError,\n parseStacktrace,\n ViewInstrumentation,\n WebVitalsInstrumentation,\n SessionInstrumentation,\n PerformanceInstrumentation,\n CSPInstrumentation,\n UserActionInstrumentation,\n} from './instrumentations';\nexport type { ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations';\n\nexport { browserMeta, createSession, sdkMeta } from './metas';\n\nexport { ConsoleTransport, FetchTransport } from './transports';\nexport type {\n ClockFn,\n ConsoleTransportOptions,\n FetchTransportOptions,\n FetchTransportRequestOptions,\n} from './transports';\n\nexport {\n faro,\n allLogLevels,\n BaseExtension,\n BaseInstrumentation,\n BaseTransport,\n createInternalLogger,\n createPromiseBuffer,\n deepEqual,\n defaultExceptionType,\n defaultGlobalObjectKey,\n defaultInternalLoggerLevel,\n defaultLogLevel,\n genShortID,\n getCurrentTimestamp,\n getInternalFaroFromGlobalObject,\n getTransportBody,\n globalObject,\n internalGlobalObjectKey,\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isInternalFaroOnGlobalObject,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n isEmpty,\n InternalLoggerLevel,\n LogLevel,\n noop,\n setInternalFaroOnGlobalObject,\n TransportItemType,\n transportItemTypeToBodyKey,\n VERSION,\n EVENT_CLICK,\n EVENT_NAVIGATION,\n EVENT_ROUTE_CHANGE,\n EVENT_SESSION_EXTEND,\n EVENT_SESSION_RESUME,\n EVENT_SESSION_START,\n EVENT_VIEW_CHANGED,\n Observable,\n unknownString,\n UserActionState,\n} from '@grafana/faro-core';\n\nexport type {\n Faro,\n API,\n APIEvent,\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BeforeSendHook,\n BufferItem,\n Config,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionEventExtended,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n Extension,\n GlobalObject,\n Instrumentation,\n Instrumentations,\n InternalLogger,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n Meta,\n MetaAPI,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n OTELApi,\n Patterns,\n PromiseBuffer,\n PromiseBufferOptions,\n PromiseProducer,\n PushErrorOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n UnpatchedConsole,\n} from '@grafana/faro-core';\n\nexport {\n PersistentSessionsManager,\n VolatileSessionsManager,\n MAX_SESSION_PERSISTENCE_TIME,\n SESSION_EXPIRATION_TIME,\n SESSION_INACTIVITY_TIME,\n STORAGE_KEY,\n} from './instrumentations/session';\n\nexport { getIgnoreUrls, getUrlFromResource } from './utils/url';\n\nexport { userActionDataAttribute } from './instrumentations/userActions';\n"]}
package/dist/esm/index.js CHANGED
@@ -4,7 +4,7 @@ export { initializeFaro } from './initialize';
4
4
  export { buildStackFrame, ConsoleInstrumentation, ErrorsInstrumentation, getDataFromSafariExtensions, getStackFramesFromError, parseStacktrace, ViewInstrumentation, WebVitalsInstrumentation, SessionInstrumentation, PerformanceInstrumentation, CSPInstrumentation, UserActionInstrumentation, } from './instrumentations';
5
5
  export { browserMeta, createSession, sdkMeta } from './metas';
6
6
  export { ConsoleTransport, FetchTransport } from './transports';
7
- export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, isEmpty, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, Observable, unknownString, } from '@grafana/faro-core';
7
+ export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, isEmpty, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, Observable, unknownString, UserActionState, } from '@grafana/faro-core';
8
8
  export { PersistentSessionsManager, VolatileSessionsManager, MAX_SESSION_PERSISTENCE_TIME, SESSION_EXPIRATION_TIME, SESSION_INACTIVITY_TIME, STORAGE_KEY, } from './instrumentations/session';
9
9
  export { getIgnoreUrls, getUrlFromResource } from './utils/url';
10
10
  export { userActionDataAttribute } from './instrumentations/userActions';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQhE,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,+BAA+B,EAC/B,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,OAAO,EACP,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAK,EACL,4BAA4B,EAC5B,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,mBAAmB,EACnB,QAAQ,EACR,IAAI,EACJ,6BAA6B,EAC7B,iBAAiB,EACjB,0BAA0B,EAC1B,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,aAAa,GACd,MAAM,oBAAoB,CAAC;AAkE5B,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,uBAAuB,EACvB,WAAW,GACZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC","sourcesContent":["export { getWebInstrumentations, makeCoreConfig } from './config';\nexport type { BrowserConfig } from './config';\n\nexport { defaultEventDomain } from './consts';\n\nexport { initializeFaro } from './initialize';\n\nexport {\n buildStackFrame,\n ConsoleInstrumentation,\n ErrorsInstrumentation,\n getDataFromSafariExtensions,\n getStackFramesFromError,\n parseStacktrace,\n ViewInstrumentation,\n WebVitalsInstrumentation,\n SessionInstrumentation,\n PerformanceInstrumentation,\n CSPInstrumentation,\n UserActionInstrumentation,\n} from './instrumentations';\nexport type { ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations';\n\nexport { browserMeta, createSession, sdkMeta } from './metas';\n\nexport { ConsoleTransport, FetchTransport } from './transports';\nexport type {\n ClockFn,\n ConsoleTransportOptions,\n FetchTransportOptions,\n FetchTransportRequestOptions,\n} from './transports';\n\nexport {\n faro,\n allLogLevels,\n BaseExtension,\n BaseInstrumentation,\n BaseTransport,\n createInternalLogger,\n createPromiseBuffer,\n deepEqual,\n defaultExceptionType,\n defaultGlobalObjectKey,\n defaultInternalLoggerLevel,\n defaultLogLevel,\n genShortID,\n getCurrentTimestamp,\n getInternalFaroFromGlobalObject,\n getTransportBody,\n globalObject,\n internalGlobalObjectKey,\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isInternalFaroOnGlobalObject,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n isEmpty,\n InternalLoggerLevel,\n LogLevel,\n noop,\n setInternalFaroOnGlobalObject,\n TransportItemType,\n transportItemTypeToBodyKey,\n VERSION,\n EVENT_CLICK,\n EVENT_NAVIGATION,\n EVENT_ROUTE_CHANGE,\n EVENT_SESSION_EXTEND,\n EVENT_SESSION_RESUME,\n EVENT_SESSION_START,\n EVENT_VIEW_CHANGED,\n Observable,\n unknownString,\n} from '@grafana/faro-core';\n\nexport type {\n Faro,\n API,\n APIEvent,\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BeforeSendHook,\n BufferItem,\n Config,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionEventExtended,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n Extension,\n GlobalObject,\n Instrumentation,\n Instrumentations,\n InternalLogger,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n Meta,\n MetaAPI,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n OTELApi,\n Patterns,\n PromiseBuffer,\n PromiseBufferOptions,\n PromiseProducer,\n PushErrorOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n UnpatchedConsole,\n} from '@grafana/faro-core';\n\nexport {\n PersistentSessionsManager,\n VolatileSessionsManager,\n MAX_SESSION_PERSISTENCE_TIME,\n SESSION_EXPIRATION_TIME,\n SESSION_INACTIVITY_TIME,\n STORAGE_KEY,\n} from './instrumentations/session';\n\nexport { getIgnoreUrls, getUrlFromResource } from './utils/url';\n\nexport { userActionDataAttribute } from './instrumentations/userActions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQhE,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,+BAA+B,EAC/B,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,OAAO,EACP,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAK,EACL,4BAA4B,EAC5B,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,mBAAmB,EACnB,QAAQ,EACR,IAAI,EACJ,6BAA6B,EAC7B,iBAAiB,EACjB,0BAA0B,EAC1B,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAkE5B,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,uBAAuB,EACvB,WAAW,GACZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC","sourcesContent":["export { getWebInstrumentations, makeCoreConfig } from './config';\nexport type { BrowserConfig } from './config';\n\nexport { defaultEventDomain } from './consts';\n\nexport { initializeFaro } from './initialize';\n\nexport {\n buildStackFrame,\n ConsoleInstrumentation,\n ErrorsInstrumentation,\n getDataFromSafariExtensions,\n getStackFramesFromError,\n parseStacktrace,\n ViewInstrumentation,\n WebVitalsInstrumentation,\n SessionInstrumentation,\n PerformanceInstrumentation,\n CSPInstrumentation,\n UserActionInstrumentation,\n} from './instrumentations';\nexport type { ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations';\n\nexport { browserMeta, createSession, sdkMeta } from './metas';\n\nexport { ConsoleTransport, FetchTransport } from './transports';\nexport type {\n ClockFn,\n ConsoleTransportOptions,\n FetchTransportOptions,\n FetchTransportRequestOptions,\n} from './transports';\n\nexport {\n faro,\n allLogLevels,\n BaseExtension,\n BaseInstrumentation,\n BaseTransport,\n createInternalLogger,\n createPromiseBuffer,\n deepEqual,\n defaultExceptionType,\n defaultGlobalObjectKey,\n defaultInternalLoggerLevel,\n defaultLogLevel,\n genShortID,\n getCurrentTimestamp,\n getInternalFaroFromGlobalObject,\n getTransportBody,\n globalObject,\n internalGlobalObjectKey,\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isInternalFaroOnGlobalObject,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n isEmpty,\n InternalLoggerLevel,\n LogLevel,\n noop,\n setInternalFaroOnGlobalObject,\n TransportItemType,\n transportItemTypeToBodyKey,\n VERSION,\n EVENT_CLICK,\n EVENT_NAVIGATION,\n EVENT_ROUTE_CHANGE,\n EVENT_SESSION_EXTEND,\n EVENT_SESSION_RESUME,\n EVENT_SESSION_START,\n EVENT_VIEW_CHANGED,\n Observable,\n unknownString,\n UserActionState,\n} from '@grafana/faro-core';\n\nexport type {\n Faro,\n API,\n APIEvent,\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BeforeSendHook,\n BufferItem,\n Config,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionEventExtended,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n Extension,\n GlobalObject,\n Instrumentation,\n Instrumentations,\n InternalLogger,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n Meta,\n MetaAPI,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n OTELApi,\n Patterns,\n PromiseBuffer,\n PromiseBufferOptions,\n PromiseProducer,\n PushErrorOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n UnpatchedConsole,\n} from '@grafana/faro-core';\n\nexport {\n PersistentSessionsManager,\n VolatileSessionsManager,\n MAX_SESSION_PERSISTENCE_TIME,\n SESSION_EXPIRATION_TIME,\n SESSION_INACTIVITY_TIME,\n STORAGE_KEY,\n} from './instrumentations/session';\n\nexport { getIgnoreUrls, getUrlFromResource } from './utils/url';\n\nexport { userActionDataAttribute } from './instrumentations/userActions';\n"]}
@@ -7,7 +7,7 @@ export type { ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentatio
7
7
  export { browserMeta, createSession, sdkMeta } from './metas';
8
8
  export { ConsoleTransport, FetchTransport } from './transports';
9
9
  export type { ClockFn, ConsoleTransportOptions, FetchTransportOptions, FetchTransportRequestOptions, } from './transports';
10
- export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, isEmpty, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, Observable, unknownString, } from '@grafana/faro-core';
10
+ export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, isEmpty, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, Observable, unknownString, UserActionState, } from '@grafana/faro-core';
11
11
  export type { Faro, API, APIEvent, BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BeforeSendHook, BufferItem, Config, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionEventExtended, ExceptionStackFrame, ExceptionsAPI, ExtendedError, Extension, GlobalObject, Instrumentation, Instrumentations, InternalLogger, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, Meta, MetaAPI, MetaApp, MetaAttributes, MetaBrowser, MetaGetter, MetaItem, MetaPage, Metas, MetaSDK, MetaSDKIntegration, MetaSession, MetaUser, MetaView, OTELApi, Patterns, PromiseBuffer, PromiseBufferOptions, PromiseProducer, PushErrorOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, UnpatchedConsole, } from '@grafana/faro-core';
12
12
  export { PersistentSessionsManager, VolatileSessionsManager, MAX_SESSION_PERSISTENCE_TIME, SESSION_EXPIRATION_TIME, SESSION_INACTIVITY_TIME, STORAGE_KEY, } from './instrumentations/session';
13
13
  export { getIgnoreUrls, getUrlFromResource } from './utils/url';
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation, LogLevel } from '@grafana/faro-core';
2
2
  export declare class ConsoleInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-console";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  static defaultDisabledLevels: LogLevel[];
6
6
  static consoleErrorPrefix: string;
7
7
  private errorSerializer;
@@ -2,7 +2,7 @@ import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  import type { Instrumentation } from '@grafana/faro-core';
3
3
  export declare class CSPInstrumentation extends BaseInstrumentation implements Instrumentation {
4
4
  readonly name = "@grafana/faro-web-sdk:instrumentation-csp";
5
- readonly version = "2.0.0-beta";
5
+ readonly version = "2.0.0-beta-2";
6
6
  constructor();
7
7
  initialize(): void;
8
8
  destroy(): void;
@@ -1,6 +1,6 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class ErrorsInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-errors";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  initialize(): void;
6
6
  }
@@ -3,6 +3,6 @@ import type { ResourceEntryMessage } from './types';
3
3
  export declare const performanceEntriesSubscription: Observable<ResourceEntryMessage>;
4
4
  export declare class PerformanceInstrumentation extends BaseInstrumentation {
5
5
  readonly name = "@grafana/faro-web-sdk:instrumentation-performance";
6
- readonly version = "2.0.0-beta";
6
+ readonly version = "2.0.0-beta-2";
7
7
  initialize(): void;
8
8
  }
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class SessionInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-session";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  private notifiedSession;
6
6
  private sendSessionStartEvent;
7
7
  private createInitialSession;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class UserActionInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-user-action";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  private _userActionSub?;
6
6
  initialize(): void;
7
7
  destroy(): void;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class ViewInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-view";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  private notifiedView;
6
6
  private sendViewChangedEvent;
7
7
  initialize(): void;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class WebVitalsInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals";
4
- readonly version = "2.0.0-beta";
4
+ readonly version = "2.0.0-beta-2";
5
5
  initialize(): void;
6
6
  private intializeWebVitalsInstrumentation;
7
7
  }
@@ -4,7 +4,7 @@ import type { ConsoleTransportOptions } from './types';
4
4
  export declare class ConsoleTransport extends BaseTransport {
5
5
  private options;
6
6
  readonly name = "@grafana/faro-web-sdk:transport-console";
7
- readonly version = "2.0.0-beta";
7
+ readonly version = "2.0.0-beta-2";
8
8
  constructor(options?: ConsoleTransportOptions);
9
9
  send(item: TransportItem): void;
10
10
  }
@@ -4,7 +4,7 @@ import type { FetchTransportOptions } from './types';
4
4
  export declare class FetchTransport extends BaseTransport {
5
5
  private options;
6
6
  readonly name = "@grafana/faro-web-sdk:transport-fetch";
7
- readonly version = "2.0.0-beta";
7
+ readonly version = "2.0.0-beta-2";
8
8
  promiseBuffer: PromiseBuffer<Response | void>;
9
9
  private readonly rateLimitBackoffMs;
10
10
  private readonly getNow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/faro-web-sdk",
3
- "version": "2.0.0-beta",
3
+ "version": "2.0.0-beta-2",
4
4
  "description": "Faro instrumentations, metas, transports for web.",
5
5
  "keywords": [
6
6
  "observability",
@@ -52,7 +52,7 @@
52
52
  "quality:circular-deps": "madge --circular ."
53
53
  },
54
54
  "dependencies": {
55
- "@grafana/faro-core": "^2.0.0-beta",
55
+ "@grafana/faro-core": "^2.0.0-beta-2",
56
56
  "ua-parser-js": "^1.0.32",
57
57
  "web-vitals": "^5.0.3"
58
58
  },
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "45be1a46e697add78addde51fce36f14176afa62"
67
+ "gitHead": "f633489cdfedf7b5b5f6545781cd07b4c0aa5c27"
68
68
  }