@launchdarkly/o11y 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
1
  var qe = Object.defineProperty, Ge = Object.defineProperties;
2
2
  var je = Object.getOwnPropertyDescriptors;
3
3
  var $ = Object.getOwnPropertySymbols;
4
- var fe = Object.prototype.hasOwnProperty, me = Object.prototype.propertyIsEnumerable;
4
+ var me = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable;
5
5
  var pe = (i) => {
6
6
  throw TypeError(i);
7
7
  };
8
8
  var q = (i, e, t) => e in i ? qe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, w = (i, e) => {
9
9
  for (var t in e || (e = {}))
10
- fe.call(e, t) && q(i, t, e[t]);
10
+ me.call(e, t) && q(i, t, e[t]);
11
11
  if ($)
12
12
  for (var t of $(e))
13
- me.call(e, t) && q(i, t, e[t]);
13
+ fe.call(e, t) && q(i, t, e[t]);
14
14
  return i;
15
15
  }, y = (i, e) => Ge(i, je(e));
16
16
  var G = (i, e) => {
17
17
  var t = {};
18
18
  for (var s in i)
19
- fe.call(i, s) && e.indexOf(s) < 0 && (t[s] = i[s]);
19
+ me.call(i, s) && e.indexOf(s) < 0 && (t[s] = i[s]);
20
20
  if (i != null && $)
21
21
  for (var s of $(i))
22
- e.indexOf(s) < 0 && me.call(i, s) && (t[s] = i[s]);
22
+ e.indexOf(s) < 0 && fe.call(i, s) && (t[s] = i[s]);
23
23
  return t;
24
24
  };
25
25
  var a = (i, e, t) => q(i, typeof e != "symbol" ? e + "" : e, t), we = (i, e, t) => e.has(i) || pe("Cannot " + t);
@@ -40,28 +40,28 @@ var _ = (i, e, t) => new Promise((s, n) => {
40
40
  }, l = (d) => d.done ? s(d.value) : Promise.resolve(d.value).then(o, r);
41
41
  l((t = t.apply(i, e)).next());
42
42
  });
43
- import { W as Je, M as L, r as j, I as ve, a as ke, S as Qe, C as Ye, F as Xe, b as Ze, P as et, c as _e, g as tt, p as st, d as it, e as nt, f as rt, s as ot, h as at } from "./record-C_yieA7u.js";
44
- import { R as os } from "./record-C_yieA7u.js";
45
- import { s as x, G as O, g as M, S as E, r as Re, a as J, b as ct, c as lt, d as Q, e as Y, f as U, F as De, V as dt, P as ht, h as gt, H as X, M as ut, i as ft, L as Ue, j as We, p as mt, k as Ie, l as Ce, m as pt, n as wt, o as St, q as yt, t as bt, u as vt, v as kt, w as _t, x as Rt } from "./common-DQ61tUu9.js";
46
- import { X as Dt, F as It, A as Ct, C as Lt, E as Et, s as ze, D as Nt, a as Ot, m as Le, d as Be, b as Ee, c as Ne, r as Me, e as Tt, p as Pt, f as Ht, g as Ut, M as D, h as N, W as Wt, N as zt, P as Bt, J as Mt, i as V, j as A, k as Ft, l as $t, n as Vt, o as Oe } from "./observe-CFB6c1lu.js";
47
- import { O as cs } from "./observe-CFB6c1lu.js";
43
+ import { W as Je, M as L, r as j, I as ve, a as ke, S as Qe, C as Ye, F as Xe, b as Ze, P as et, c as _e, g as tt, p as st, d as it, e as nt, f as rt, h as ot, s as at, i as ct } from "./record-DTawahUk.js";
44
+ import { R as as } from "./record-DTawahUk.js";
45
+ import { s as A, G as O, g as M, S as E, r as Re, a as J, b as lt, c as dt, d as Q, e as Y, f as U, F as De, V as ht, P as gt, h as ut, H as X, M as mt, i as ft, L as Ue, j as We, p as pt, k as Ie, l as Ce, m as wt, n as St, o as yt, q as bt, t as vt, u as kt, v as _t, w as Rt, x as Dt } from "./common-BkAGcE30.js";
46
+ import { X as It, F as Ct, A as Lt, C as Et, E as Nt, s as ze, D as Ot, a as Tt, m as Le, d as Be, b as Ee, c as Ne, r as Me, e as Pt, p as Ht, f as Ut, g as Wt, M as D, h as N, W as zt, N as Bt, P as Mt, J as Ft, i as V, j as x, k as $t, l as Vt, n as xt, o as Oe } from "./observe-xxoYHNEh.js";
47
+ import { O as ls } from "./observe-xxoYHNEh.js";
48
48
  import { L as At } from "./buffer-DIFxvF2Q.js";
49
49
  import { g as Te } from "./LDObserve-CHIjcqIn.js";
50
- import { L as ds } from "./LDObserve-CHIjcqIn.js";
51
- import { LDRecord as gs } from "./LDRecord.js";
52
- const xt = (i, e, t) => {
50
+ import { L as hs } from "./LDObserve-CHIjcqIn.js";
51
+ import { LDRecord as us } from "./LDRecord.js";
52
+ const Kt = (i, e, t) => {
53
53
  const s = window._highlightWebSocketRequestCallback;
54
54
  window._highlightWebSocketRequestCallback = i;
55
55
  const n = window._highlightWebSocketEventCallback;
56
56
  return window._highlightWebSocketEventCallback = (o) => {
57
57
  const h = o, { message: r, size: l } = h, d = G(h, ["message", "size"]), g = t.some(
58
- (f) => o.name.toLowerCase().includes(f)
58
+ (m) => o.name.toLowerCase().includes(m)
59
59
  ) ? d : o;
60
60
  e(g);
61
61
  }, () => {
62
62
  window._highlightWebSocketRequestCallback = s, window._highlightWebSocketEventCallback = n;
63
63
  };
64
- }, Kt = ({
64
+ }, qt = ({
65
65
  xhrCallback: i,
66
66
  fetchCallback: e,
67
67
  webSocketRequestCallback: t,
@@ -73,28 +73,28 @@ const xt = (i, e, t) => {
73
73
  urlBlocklist: d,
74
74
  bodyKeysToRecord: c
75
75
  }) => {
76
- const g = Dt(
76
+ const g = It(
77
77
  i,
78
78
  r,
79
79
  l,
80
80
  d,
81
81
  o,
82
82
  c
83
- ), h = It(
83
+ ), h = Ct(
84
84
  e,
85
85
  r,
86
86
  l,
87
87
  d,
88
88
  o,
89
89
  c
90
- ), f = n ? () => {
91
- } : xt(
90
+ ), m = n ? () => {
91
+ } : Kt(
92
92
  t,
93
93
  s,
94
94
  d
95
95
  );
96
96
  return () => {
97
- g(), h(), f();
97
+ g(), h(), m();
98
98
  };
99
99
  };
100
100
  class I {
@@ -127,7 +127,7 @@ class I {
127
127
  a(this, "requestResponseSanitizer");
128
128
  var t, s;
129
129
  this.options = e, this.disableConsoleRecording = !!e.disableConsoleRecording, this.reportConsoleErrors = (t = e.reportConsoleErrors) != null ? t : !1, this.enablePromisePatch = (s = e.enablePromisePatch) != null ? s : !1, this.consoleMethodsToRecord = e.consoleMethodsToRecord || [
130
- ...Ct
130
+ ...Lt
131
131
  ], this.listeners = [], this.errors = [], this.messages = [], this.lastNetworkRequestTimestamp = 0;
132
132
  }
133
133
  isListening() {
@@ -137,11 +137,11 @@ class I {
137
137
  if (this.isListening()) return;
138
138
  const e = this;
139
139
  this.disableConsoleRecording || this.listeners.push(
140
- Lt(
140
+ Et(
141
141
  (t) => {
142
142
  var s, n, o;
143
143
  if (this.reportConsoleErrors && (t.type === "Error" || t.type === "error") && t.value && t.trace) {
144
- const r = x(t.value);
144
+ const r = A(t.value);
145
145
  if (Ee.includes(r) || Ne.some(
146
146
  (l) => r.includes(l)
147
147
  ))
@@ -165,7 +165,7 @@ class I {
165
165
  })
166
166
  )
167
167
  ), this.listeners.push(
168
- Et(
168
+ Nt(
169
169
  (t) => {
170
170
  Ee.includes(t.event) || Ne.some(
171
171
  (s) => t.event.includes(s)
@@ -181,7 +181,7 @@ class I {
181
181
  // We define this as a static method because versions earlier than 4.0.0 (Feb 2022) don't have this code.
182
182
  // For those versions, calling this from client will monkey-patch the network listeners onto the old FirstLoadListener object.
183
183
  static setupNetworkListener(e, t) {
184
- var o, r, l, d, c, g, h, f, m, R, v, C;
184
+ var o, r, l, d, c, g, h, m, f, R, v, C;
185
185
  const s = (t == null ? void 0 : t.backendUrl) || void 0 || "https://pub.highlight.io", n = t.otlpEndpoint || "https://otel.highlight.io";
186
186
  e.highlightEndpoints = [
187
187
  s,
@@ -192,17 +192,17 @@ class I {
192
192
  (S) => S.toLowerCase()
193
193
  )) || [], e.networkBodyKeysToRedact = ((h = (g = t.networkRecording) == null ? void 0 : g.networkBodyKeysToRedact) == null ? void 0 : h.map(
194
194
  (S) => S.toLowerCase()
195
- )) || [], e.urlBlocklist = ((m = (f = t.networkRecording) == null ? void 0 : f.urlBlocklist) == null ? void 0 : m.map(
195
+ )) || [], e.urlBlocklist = ((f = (m = t.networkRecording) == null ? void 0 : m.urlBlocklist) == null ? void 0 : f.map(
196
196
  (S) => S.toLowerCase()
197
197
  )) || [], e.urlBlocklist = [
198
198
  ...e.urlBlocklist,
199
- ...Nt
199
+ ...Ot
200
200
  ], e.requestResponseSanitizer = (R = t.networkRecording) == null ? void 0 : R.requestResponseSanitizer, e.networkHeaderKeysToRecord = (v = t.networkRecording) == null ? void 0 : v.headerKeysToRecord, e.networkHeaderKeysToRecord && (e.networkHeadersToRedact = [], e.networkHeaderKeysToRecord = e.networkHeaderKeysToRecord.map(
201
201
  (S) => S.toLocaleLowerCase()
202
202
  )), e.networkBodyKeysToRecord = (C = t.networkRecording) == null ? void 0 : C.bodyKeysToRecord, e.networkBodyKeysToRecord && (e.networkBodyKeysToRedact = [], e.networkBodyKeysToRecord = e.networkBodyKeysToRecord.map(
203
203
  (S) => S.toLocaleLowerCase()
204
204
  ))), !e.disableNetworkRecording && e.enableRecordingNetworkContents && (e.hasNetworkRecording = !0, e.listeners.push(
205
- Kt({
205
+ qt({
206
206
  xhrCallback: (S) => {
207
207
  e.xhrNetworkContents.push(S);
208
208
  },
@@ -233,7 +233,7 @@ class I {
233
233
  "resource"
234
234
  );
235
235
  const d = (t - l) * 2;
236
- if (s = s.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 : Ot(
236
+ if (s = s.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 : Tt(
237
237
  c.name,
238
238
  e.highlightEndpoints
239
239
  )).map((c) => y(w({}, c.toJSON()), {
@@ -332,15 +332,15 @@ const te = class te {
332
332
  var n, o, r, l, d;
333
333
  e.sessionSecureID || (e.sessionSecureID = O()), this.options = e, typeof ((n = this.options) == null ? void 0 : n.debug) == "boolean" ? this.debugOptions = this.options.debug ? { clientInteractions: !0 } : {} : this.debugOptions = (r = (o = this.options) == null ? void 0 : o.debug) != null ? r : {}, this.logger = new At(this.debugOptions.clientInteractions), e.storageMode && (this.logger.log(
334
334
  `initializing in ${e.storageMode} session mode`
335
- ), pt(e.storageMode)), We(!!(e != null && e.sessionCookie)), this._worker = new Je(), this._worker.onmessage = (c) => {
336
- var g, h, f;
335
+ ), wt(e.storageMode)), We(!!(e != null && e.sessionCookie)), this._worker = new Je(), this._worker.onmessage = (c) => {
336
+ var g, h, m;
337
337
  ((g = c.data.response) == null ? void 0 : g.type) === L.AsyncEvents ? (this._eventBytesSinceSnapshot += c.data.response.eventsSize, this.logger.log(
338
338
  `Web worker sent payloadID ${c.data.response.id} size ${c.data.response.eventsSize} bytes, compression ratio ${c.data.response.eventsSize / c.data.response.compressedSize}.
339
339
  Total since snapshot: ${(this._eventBytesSinceSnapshot / 1e6).toFixed(1)}MB`
340
340
  )) : ((h = c.data.response) == null ? void 0 : h.type) === L.CustomEvent ? this.addCustomEvent(
341
341
  c.data.response.tag,
342
342
  c.data.response.payload
343
- ) : ((f = c.data.response) == null ? void 0 : f.type) === L.Stop && (W(
343
+ ) : ((m = c.data.response) == null ? void 0 : m.type) === L.Stop && (W(
344
344
  "Stopping recording due to worker failure",
345
345
  c.data.response
346
346
  ), this.stopRecording(!1));
@@ -393,19 +393,19 @@ const te = class te {
393
393
  });
394
394
  }
395
395
  _initMembers(e) {
396
- var o, r, l, d, c, g, h, f, m, R, v;
396
+ var o, r, l, d, c, g, h, m, f, R, v;
397
397
  this.sessionShortcut = !1, this._recordingStartTime = 0, this._isOnLocalHost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "", this.ready = !1, this.state = "NotRecording", this.manualStopped = !1, this.enableSegmentIntegration = !!e.enableSegmentIntegration, this.privacySetting = (o = e.privacySetting) != null ? o : "default", this.enableCanvasRecording = (r = e.enableCanvasRecording) != null ? r : !1, this.enablePerformanceRecording = (l = e.enablePerformanceRecording) != null ? l : !0, this.inlineImages = (d = e.inlineImages) != null ? d : this._isOnLocalHost, this.inlineVideos = (c = e.inlineVideos) != null ? c : this._isOnLocalHost, this.inlineStylesheet = (g = e.inlineStylesheet) != null ? g : this._isOnLocalHost, this.styleSheetResyncInterval = (h = e.styleSheetResyncInterval) != null ? h : 2e3, this.samplingStrategy = w({
398
398
  canvasFactor: 0.5,
399
399
  canvasMaxSnapshotDimension: 360,
400
400
  canvasClearWebGLBuffer: !0,
401
- dataUrlOptions: ct()
402
- }, (f = e.samplingStrategy) != null ? f : {
401
+ dataUrlOptions: lt()
402
+ }, (m = e.samplingStrategy) != null ? m : {
403
403
  canvas: 2
404
- }), this._backendUrl = (m = e == null ? void 0 : e.backendUrl) != null ? m : "https://pub.highlight.io", this._backendUrl[0] === "/" && (this._backendUrl = new URL(this._backendUrl, document.baseURI).href);
405
- const t = new St(`${this._backendUrl}`, {
404
+ }), this._backendUrl = (f = e == null ? void 0 : e.backendUrl) != null ? f : "https://pub.highlight.io", this._backendUrl[0] === "/" && (this._backendUrl = new URL(this._backendUrl, document.baseURI).href);
405
+ const t = new yt(`${this._backendUrl}`, {
406
406
  headers: {}
407
407
  });
408
- be(this, F, lt(t, wt())), this.environment = (R = e.environment) != null ? R : "production", this.appVersion = e.appVersion, this.serviceName = (v = e.serviceName) != null ? v : "", typeof e.organizationID == "string" ? this.organizationID = e.organizationID : this.organizationID = e.organizationID.toString(), this.isRunningOnHighlight = this.organizationID === "1" || this.organizationID === "1jdkoe52", this.firstloadVersion = e.firstloadVersion || "unknown", this.sessionShortcut = e.sessionShortcut || !1, this._onToggleFeedbackFormVisibility = () => {
408
+ be(this, F, dt(t, St())), this.environment = (R = e.environment) != null ? R : "production", this.appVersion = e.appVersion, this.serviceName = (v = e.serviceName) != null ? v : "", typeof e.organizationID == "string" ? this.organizationID = e.organizationID : this.organizationID = e.organizationID.toString(), this.isRunningOnHighlight = this.organizationID === "1" || this.organizationID === "1jdkoe52", this.firstloadVersion = e.firstloadVersion || "unknown", this.sessionShortcut = e.sessionShortcut || !1, this._onToggleFeedbackFormVisibility = () => {
409
409
  };
410
410
  const C = e, { firstloadVersion: s } = C, n = G(C, ["firstloadVersion"]);
411
411
  this._optionsInternal = n, this.listeners = [], this.events = [], this.hasSessionUnloaded = !1, this.hasPushedData = !1, window.Intercom && window.Intercom("onShow", () => {
@@ -443,7 +443,7 @@ const te = class te {
443
443
  }
444
444
  log(e, t, s) {
445
445
  this._firstLoadListeners.messages.push(
446
- Tt(t, Be, e, s)
446
+ Pt(t, Be, e, s)
447
447
  );
448
448
  }
449
449
  pushCustomError(e, t) {
@@ -467,25 +467,25 @@ const te = class te {
467
467
  source: n,
468
468
  type: o
469
469
  }) {
470
- var c, g, h, f;
470
+ var c, g, h, m;
471
471
  e.cause && (s = y(w({}, s), { "exception.cause": e.cause }));
472
472
  let r = t ? t + ":" + e.message : e.message;
473
473
  o === "React.ErrorBoundary" && (r = "ErrorBoundary: " + r);
474
- const l = Pt(e), d = {
474
+ const l = Ht(e), d = {
475
475
  event: r,
476
476
  type: o != null ? o : "custom",
477
477
  url: window.location.href,
478
478
  source: n != null ? n : "",
479
479
  lineNumber: (c = l[0]) != null && c.lineNumber ? (g = l[0]) == null ? void 0 : g.lineNumber : 0,
480
- columnNumber: (h = l[0]) != null && h.columnNumber ? (f = l[0]) == null ? void 0 : f.columnNumber : 0,
480
+ columnNumber: (h = l[0]) != null && h.columnNumber ? (m = l[0]) == null ? void 0 : m.columnNumber : 0,
481
481
  stackTrace: l,
482
482
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
483
483
  payload: JSON.stringify(s),
484
484
  id: Me()
485
485
  };
486
486
  this._firstLoadListeners.errors.push(d);
487
- for (const m of this._integrations)
488
- m.error(this.sessionData.sessionSecureID, d);
487
+ for (const f of this._integrations)
488
+ f.error(this.sessionData.sessionSecureID, d);
489
489
  }
490
490
  addProperties(e = {}, t) {
491
491
  const s = w({}, e);
@@ -510,7 +510,7 @@ const te = class te {
510
510
  }
511
511
  initialize(e) {
512
512
  return _(this, null, function* () {
513
- var t, s, n, o, r, l, d, c, g, h, f, m, R, v, C, S, se, ie, ne, re, oe, ae, ce, le, de;
513
+ var t, s, n, o, r, l, d, c, g, h, m, f, R, v, C, S, se, ie, ne, re, oe, ae, ce, le, de;
514
514
  if (navigator != null && navigator.webdriver && !window.Cypress || (t = navigator == null ? void 0 : navigator.userAgent) != null && t.includes("Googlebot") || (s = navigator == null ? void 0 : navigator.userAgent) != null && s.includes("AdsBot")) {
515
515
  (n = this._firstLoadListeners) == null || n.stopListening();
516
516
  return;
@@ -524,15 +524,15 @@ const te = class te {
524
524
  yield this._reset(y(w({}, e), { forceNew: !0 }));
525
525
  return;
526
526
  }
527
- const T = new Ut();
528
- Ht(
527
+ const T = new Wt();
528
+ Ut(
529
529
  {
530
530
  backendUrl: (r = (o = this.options) == null ? void 0 : o.backendUrl) != null ? r : "https://pub.highlight.io",
531
531
  otlpEndpoint: (d = (l = this.options) == null ? void 0 : l.otlpEndpoint) != null ? d : "https://otel.highlight.io",
532
532
  projectId: (c = this.options) == null ? void 0 : c.organizationID,
533
533
  sessionSecureId: (g = this.options) == null ? void 0 : g.sessionSecureID,
534
- environment: (f = (h = this.options) == null ? void 0 : h.environment) != null ? f : "production",
535
- networkRecordingOptions: typeof ((m = this.options) == null ? void 0 : m.networkRecording) == "object" ? this.options.networkRecording : void 0,
534
+ environment: (m = (h = this.options) == null ? void 0 : h.environment) != null ? m : "production",
535
+ networkRecordingOptions: typeof ((f = this.options) == null ? void 0 : f.networkRecording) == "object" ? this.options.networkRecording : void 0,
536
536
  tracingOrigins: (R = this.options) == null ? void 0 : R.tracingOrigins,
537
537
  serviceName: (C = (v = this.options) == null ? void 0 : v.serviceName) != null ? C : "highlight-browser",
538
538
  instrumentations: (se = (S = this.options) == null ? void 0 : S.otel) == null ? void 0 : se.instrumentations,
@@ -614,7 +614,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
614
614
  ), this.ready = !0, this.state = "Recording", this.manualStopped = !1;
615
615
  return;
616
616
  }
617
- const { getDeviceDetails: ge } = Ft();
617
+ const { getDeviceDetails: ge } = $t();
618
618
  ge && this.recordGauge({
619
619
  name: N.DeviceMemory,
620
620
  value: ge().deviceMemory,
@@ -627,7 +627,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
627
627
  ue.bind(this);
628
628
  const Ve = !!this._recordStop;
629
629
  this._recordStop && (this._recordStop(), this._recordStop = void 0);
630
- const [Ae, xe] = rt(
630
+ const [xe, Ae] = ot(
631
631
  this.privacySetting,
632
632
  this.options.maskAllInputs,
633
633
  this.options.maskInputOptions
@@ -639,9 +639,12 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
639
639
  blockSelector: this.options.blockSelector,
640
640
  emit: ue,
641
641
  recordCrossOriginIframes: this.options.recordCrossOriginIframe,
642
- privacySetting: this.privacySetting,
643
- maskAllInputs: Ae,
644
- maskInputOptions: xe,
642
+ privacySetting: rt(
643
+ this.privacySetting,
644
+ this.options.maskPiiText
645
+ ),
646
+ maskAllInputs: xe,
647
+ maskInputOptions: Ae,
645
648
  maskTextClass: this.options.maskTextClass,
646
649
  maskTextSelector: this.options.maskTextSelector,
647
650
  recordCanvas: this.enableCanvasRecording,
@@ -703,7 +706,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
703
706
  this.logger.log("Ignoring visibility event due to manual stop.");
704
707
  return;
705
708
  }
706
- (/* @__PURE__ */ new Date()).getTime() - this._lastVisibilityChangeTime < dt || (this._lastVisibilityChangeTime = (/* @__PURE__ */ new Date()).getTime(), this.logger.log(`Detected window ${e ? "hidden" : "visible"}.`), e ? (this.addCustomEvent("TabHidden", !0), this.options.disableBackgroundRecording && this.stopRecording()) : (this.options.disableBackgroundRecording && (yield this.initialize()), this.addCustomEvent("TabHidden", !1)));
709
+ (/* @__PURE__ */ new Date()).getTime() - this._lastVisibilityChangeTime < ht || (this._lastVisibilityChangeTime = (/* @__PURE__ */ new Date()).getTime(), this.logger.log(`Detected window ${e ? "hidden" : "visible"}.`), e ? (this.addCustomEvent("TabHidden", !0), this.options.disableBackgroundRecording && this.stopRecording()) : (this.options.disableBackgroundRecording && (yield this.initialize()), this.addCustomEvent("TabHidden", !1)));
707
710
  });
708
711
  }
709
712
  _setupCrossOriginIframe() {
@@ -770,14 +773,14 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
770
773
  }
771
774
  })
772
775
  ), this.listeners.push(
773
- ht((r) => {
776
+ gt((r) => {
774
777
  this.reloaded ? (this.addCustomEvent("Reload", r), this.reloaded = !1, n.addProperties(
775
778
  { reload: !0 },
776
779
  { type: "session" }
777
780
  )) : this.addCustomEvent("Navigate", r);
778
781
  })
779
782
  ), this.listeners.push(
780
- gt(
783
+ ut(
781
784
  (r) => {
782
785
  this.addCustomEvent("Viewport", r), this.submitViewportMetrics(r);
783
786
  }
@@ -787,7 +790,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
787
790
  let d = null, c = null;
788
791
  if (l && l.target) {
789
792
  const g = l.target;
790
- d = yt(g), c = g.textContent, c && c.length > 2e3 && (c = c.substring(0, 2e3));
793
+ d = bt(g), c = g.textContent, c && c.length > 2e3 && (c = c.substring(0, 2e3));
791
794
  }
792
795
  this.addCustomEvent("Click", {
793
796
  clickTarget: r,
@@ -800,16 +803,16 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
800
803
  r && this.addCustomEvent("Focus", r);
801
804
  })
802
805
  ), this.listeners.push(
803
- Wt((r) => {
804
- const { name: l, value: d } = r, c = [], g = (h, f) => {
805
- f && c.push({ name: h, value: f });
806
+ zt((r) => {
807
+ const { name: l, value: d } = r, c = [], g = (h, m) => {
808
+ m && c.push({ name: h, value: m });
806
809
  };
807
810
  switch (r.name) {
808
811
  case "LCP": {
809
812
  const h = r.attribution;
810
813
  g("web_vital.element", h.element), g(
811
814
  "web_vital.attribution.url",
812
- h.url ? $t(h.url) : void 0
815
+ h.url ? Vt(h.url) : void 0
813
816
  );
814
817
  break;
815
818
  }
@@ -843,7 +846,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
843
846
  });
844
847
  })
845
848
  ), this.listeners.push(
846
- zt(
849
+ Bt(
847
850
  (r) => {
848
851
  const l = [];
849
852
  r.saveData !== void 0 && l.push({
@@ -856,7 +859,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
856
859
  name: "type",
857
860
  value: r.type.toString()
858
861
  }), Object.entries(r).forEach(([d, c]) => {
859
- bt(c) && this.recordGauge({
862
+ vt(c) && this.recordGauge({
860
863
  name: d,
861
864
  value: c,
862
865
  category: D.Performance,
@@ -875,8 +878,8 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
875
878
  );
876
879
  })
877
880
  ), this.enablePerformanceRecording && (this.listeners.push(
878
- Bt((r) => {
879
- this.addCustomEvent("Performance", x(r)), Object.entries(r).filter(([l]) => l !== "relativeTimestamp").forEach(
881
+ Mt((r) => {
882
+ this.addCustomEvent("Performance", A(r)), Object.entries(r).filter(([l]) => l !== "relativeTimestamp").forEach(
880
883
  ([l, d]) => d && this.recordGauge({
881
884
  name: l,
882
885
  value: d,
@@ -886,8 +889,8 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
886
889
  );
887
890
  }, this._recordingStartTime)
888
891
  ), this.listeners.push(
889
- Mt((r) => {
890
- this.addCustomEvent("Jank", x(r)), this.recordGauge({
892
+ Ft((r) => {
893
+ this.addCustomEvent("Jank", A(r)), this.recordGauge({
891
894
  name: "Jank",
892
895
  value: r.jankAmount,
893
896
  category: D.WebVital,
@@ -964,7 +967,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
964
967
  if (!t) {
965
968
  if (t = (s = V()) == null ? void 0 : s.createGauge(
966
969
  e.name,
967
- A(e.name, e.unit)
970
+ x(e.name, e.unit)
968
971
  ), !t) return;
969
972
  this._gauges.set(e.name, t);
970
973
  }
@@ -982,7 +985,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
982
985
  if (!t) {
983
986
  if (t = (s = V()) == null ? void 0 : s.createCounter(
984
987
  e.name,
985
- A(e.name, e.unit)
988
+ x(e.name, e.unit)
986
989
  ), !t) return;
987
990
  this._counters.set(e.name, t);
988
991
  }
@@ -1001,7 +1004,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1001
1004
  if (!t) {
1002
1005
  if (t = (s = V()) == null ? void 0 : s.createHistogram(
1003
1006
  e.name,
1004
- A(e.name, e.unit)
1007
+ x(e.name, e.unit)
1005
1008
  ), !t) return;
1006
1009
  this._histograms.set(e.name, t);
1007
1010
  }
@@ -1017,7 +1020,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1017
1020
  if (!t) {
1018
1021
  if (t = (s = V()) == null ? void 0 : s.createUpDownCounter(
1019
1022
  e.name,
1020
- A(e.name, e.unit)
1023
+ x(e.name, e.unit)
1021
1024
  ), !t) return;
1022
1025
  this._up_down_counters.set(e.name, t);
1023
1026
  }
@@ -1078,7 +1081,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1078
1081
  return _(this, null, function* () {
1079
1082
  var e;
1080
1083
  try {
1081
- this.state === "Recording" && this.listeners && !this.sessionData.sessionKey && this.sessionData.sessionStartTime && Date.now() - this.sessionData.sessionStartTime > ut && (this.logger.log("Resetting session", {
1084
+ this.state === "Recording" && this.listeners && !this.sessionData.sessionKey && this.sessionData.sessionStartTime && Date.now() - this.sessionData.sessionStartTime > mt && (this.logger.log("Resetting session", {
1082
1085
  start: this.sessionData.sessionStartTime
1083
1086
  }), yield this._reset({}));
1084
1087
  let t;
@@ -1086,7 +1089,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1086
1089
  let n = new Blob(
1087
1090
  [
1088
1091
  JSON.stringify({
1089
- query: mt(vt),
1092
+ query: pt(kt),
1090
1093
  variables: s
1091
1094
  })
1092
1095
  ],
@@ -1138,22 +1141,22 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1138
1141
  );
1139
1142
  const g = (/* @__PURE__ */ new Date()).getTime(), h = tt();
1140
1143
  if (e) {
1141
- const f = {
1144
+ const m = {
1142
1145
  session_secure_id: this.sessionData.sessionSecureID,
1143
1146
  payload_id: g.toString(),
1144
1147
  events: { events: o },
1145
- messages: x({ messages: r }),
1148
+ messages: A({ messages: r }),
1146
1149
  resources: JSON.stringify({ resources: s }),
1147
1150
  web_socket_events: JSON.stringify({ webSocketEvents: n }),
1148
1151
  errors: l,
1149
1152
  is_beacon: !1,
1150
1153
  has_session_unloaded: this.hasSessionUnloaded,
1151
1154
  highlight_logs: h || void 0
1152
- }, { compressedBase64: m } = yield st(f);
1155
+ }, { compressedBase64: f } = yield st(m);
1153
1156
  yield e({
1154
1157
  session_secure_id: this.sessionData.sessionSecureID,
1155
1158
  payload_id: (/* @__PURE__ */ new Date()).getTime().toString(),
1156
- data: m
1159
+ data: f
1157
1160
  });
1158
1161
  } else
1159
1162
  this._worker.postMessage({
@@ -1194,7 +1197,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1194
1197
  };
1195
1198
  F = new WeakMap();
1196
1199
  let Z = te;
1197
- const qt = () => {
1200
+ const Gt = () => {
1198
1201
  var i, e;
1199
1202
  typeof chrome != "undefined" && ((i = chrome == null ? void 0 : chrome.runtime) != null && i.onMessage) && ((e = chrome == null ? void 0 : chrome.runtime) == null || e.onMessage.addListener(
1200
1203
  (t, s, n) => {
@@ -1219,7 +1222,7 @@ const qt = () => {
1219
1222
  }
1220
1223
  ));
1221
1224
  };
1222
- function ts(i) {
1225
+ function ss(i) {
1223
1226
  var e;
1224
1227
  i.on && ((e = i.webContents) != null && e.send) && (i.on("focus", () => {
1225
1228
  i.webContents.send("highlight.run", { visible: !0 });
@@ -1229,7 +1232,7 @@ function ts(i) {
1229
1232
  i.webContents.send("highlight.run", { visible: !1 });
1230
1233
  }));
1231
1234
  }
1232
- const ss = ({
1235
+ const is = ({
1233
1236
  next: i,
1234
1237
  payload: e
1235
1238
  }) => {
@@ -1259,7 +1262,7 @@ const ss = ({
1259
1262
  window._highlightWebSocketRequestCallback = Pe, window._highlightWebSocketEventCallback = Pe;
1260
1263
  const i = new Proxy(window.WebSocket, {
1261
1264
  construct(e, t) {
1262
- const [, s] = Vt(), n = new e(...t), o = (g) => {
1265
+ const [, s] = xt(), n = new e(...t), o = (g) => {
1263
1266
  window._highlightWebSocketRequestCallback({
1264
1267
  socketId: s,
1265
1268
  initiatorType: "websocket",
@@ -1276,15 +1279,15 @@ const ss = ({
1276
1279
  responseEndAbs: performance.timeOrigin + g.timeStamp
1277
1280
  }), n.removeEventListener("open", o), n.removeEventListener("error", d), n.removeEventListener("message", l), n.removeEventListener("close", r);
1278
1281
  }, l = (g) => {
1279
- const { data: h } = g, f = typeof h == "string" ? g.data : void 0;
1280
- let m;
1281
- typeof h == "string" ? m = h.length : h instanceof Blob ? m = h.size : m = h.byteLength || 0, window._highlightWebSocketEventCallback({
1282
+ const { data: h } = g, m = typeof h == "string" ? g.data : void 0;
1283
+ let f;
1284
+ typeof h == "string" ? f = h.length : h instanceof Blob ? f = h.size : f = h.byteLength || 0, window._highlightWebSocketEventCallback({
1282
1285
  socketId: s,
1283
1286
  type: "received",
1284
1287
  name: n.url,
1285
1288
  timeStamp: performance.timeOrigin + g.timeStamp,
1286
- size: m,
1287
- message: f
1289
+ size: f,
1290
+ message: m
1288
1291
  });
1289
1292
  }, d = (g) => {
1290
1293
  window._highlightWebSocketEventCallback({
@@ -1297,17 +1300,17 @@ const ss = ({
1297
1300
  };
1298
1301
  n.addEventListener("open", o), n.addEventListener("error", d), n.addEventListener("message", l), n.addEventListener("close", r);
1299
1302
  const c = new Proxy(n.send, {
1300
- apply: function(g, h, f) {
1301
- const m = f[0], R = typeof m == "string" ? m : void 0;
1303
+ apply: function(g, h, m) {
1304
+ const f = m[0], R = typeof f == "string" ? f : void 0;
1302
1305
  let v;
1303
- typeof m == "string" ? v = m.length : m instanceof Blob ? v = m.size : v = m.byteLength || 0, window._highlightWebSocketEventCallback({
1306
+ typeof f == "string" ? v = f.length : f instanceof Blob ? v = f.size : v = f.byteLength || 0, window._highlightWebSocketEventCallback({
1304
1307
  socketId: s,
1305
1308
  type: "sent",
1306
1309
  name: n.url,
1307
1310
  timeStamp: performance.timeOrigin + performance.now(),
1308
1311
  size: v,
1309
1312
  message: R
1310
- }), g.apply(h, f);
1313
+ }), g.apply(h, m);
1311
1314
  }
1312
1315
  });
1313
1316
  return n.send = c, n;
@@ -1316,10 +1319,10 @@ const ss = ({
1316
1319
  window.WebSocket = i;
1317
1320
  }
1318
1321
  };
1319
- var Gt = /* @__PURE__ */ ((i) => (i.Device = "Device", i.WebVital = "WebVital", i.Frontend = "Frontend", i.Backend = "Backend", i))(Gt || {});
1322
+ var jt = /* @__PURE__ */ ((i) => (i.Device = "Device", i.WebVital = "WebVital", i.Frontend = "Frontend", i.Backend = "Backend", i))(jt || {});
1320
1323
  const b = (i, e) => {
1321
1324
  console.warn(`highlight.run warning: (${i}): `, e);
1322
- }, jt = 200;
1325
+ }, Jt = 200;
1323
1326
  let z = [], K, u, B, He = [], ee = !1;
1324
1327
  const p = {
1325
1328
  options: void 0,
@@ -1334,7 +1337,7 @@ const p = {
1334
1337
  );
1335
1338
  return;
1336
1339
  }
1337
- e != null && e.sessionCookie ? _t() : We(!1);
1340
+ e != null && e.sessionCookie ? Rt() : We(!1);
1338
1341
  const g = M();
1339
1342
  let h = O();
1340
1343
  if (e != null && e.sessionKey ? h = O(
@@ -1342,14 +1345,14 @@ const p = {
1342
1345
  ) : g != null && g.sessionSecureID && (h = g.sessionSecureID), ee)
1343
1346
  return { sessionSecureID: h };
1344
1347
  ee = !0, Fe(), $e();
1345
- const f = y(w({}, e), {
1348
+ const m = y(w({}, e), {
1346
1349
  organizationID: i,
1347
- firstloadVersion: Rt,
1350
+ firstloadVersion: Dt,
1348
1351
  environment: (e == null ? void 0 : e.environment) || "production",
1349
1352
  appVersion: e == null ? void 0 : e.version,
1350
1353
  sessionSecureID: h
1351
1354
  });
1352
- return B = new I(f), e != null && e.manualStart || B.startListening(), u = u != null ? u : new Z(f, B), e != null && e.manualStart || u.initialize(), !((s = (t = e == null ? void 0 : e.integrations) == null ? void 0 : t.mixpanel) != null && s.disabled) && ((o = (n = e == null ? void 0 : e.integrations) == null ? void 0 : n.mixpanel) != null && o.projectToken) && ot(e.integrations.mixpanel), !((l = (r = e == null ? void 0 : e.integrations) == null ? void 0 : r.amplitude) != null && l.disabled) && ((c = (d = e == null ? void 0 : e.integrations) == null ? void 0 : d.amplitude) != null && c.apiKey) && at(e.integrations.amplitude), { sessionSecureID: h };
1355
+ return B = new I(m), e != null && e.manualStart || B.startListening(), u = u != null ? u : new Z(m, B), e != null && e.manualStart || u.initialize(), !((s = (t = e == null ? void 0 : e.integrations) == null ? void 0 : t.mixpanel) != null && s.disabled) && ((o = (n = e == null ? void 0 : e.integrations) == null ? void 0 : n.mixpanel) != null && o.projectToken) && at(e.integrations.mixpanel), !((l = (r = e == null ? void 0 : e.integrations) == null ? void 0 : r.amplitude) != null && l.disabled) && ((c = (d = e == null ? void 0 : e.integrations) == null ? void 0 : d.amplitude) != null && c.apiKey) && ct(e.integrations.amplitude), { sessionSecureID: h };
1353
1356
  } catch (g) {
1354
1357
  b("init", g);
1355
1358
  }
@@ -1411,21 +1414,21 @@ const p = {
1411
1414
  }
1412
1415
  },
1413
1416
  track: (i, e = {}) => {
1414
- var t, s, n, o, r, l, d, c, g, h, f;
1417
+ var t, s, n, o, r, l, d, c, g, h, m;
1415
1418
  try {
1416
1419
  p.onHighlightReady(() => {
1417
1420
  u.addProperties(y(w({}, e), { event: i })), u.log("H.track", "INFO", y(w({}, e != null ? e : {}), {
1418
1421
  event: i
1419
1422
  }));
1420
1423
  });
1421
- const m = u == null ? void 0 : u.getCurrentSessionURL();
1424
+ const f = u == null ? void 0 : u.getCurrentSessionURL();
1422
1425
  (n = (s = (t = p.options) == null ? void 0 : t.integrations) == null ? void 0 : s.mixpanel) != null && n.disabled || (o = window.mixpanel) != null && o.track && window.mixpanel.track(i, y(w({}, e), {
1423
- highlightSessionURL: m
1426
+ highlightSessionURL: f
1424
1427
  })), (d = (l = (r = p.options) == null ? void 0 : r.integrations) == null ? void 0 : l.amplitude) != null && d.disabled || (c = window.amplitude) != null && c.getInstance && window.amplitude.getInstance().logEvent(i, y(w({}, e), {
1425
- highlightSessionURL: m
1426
- })), (f = (h = (g = p.options) == null ? void 0 : g.integrations) == null ? void 0 : h.intercom) != null && f.disabled || window.Intercom && window.Intercom("trackEvent", i, e);
1427
- } catch (m) {
1428
- b("track", m);
1428
+ highlightSessionURL: f
1429
+ })), (m = (h = (g = p.options) == null ? void 0 : g.integrations) == null ? void 0 : h.intercom) != null && m.disabled || window.Intercom && window.Intercom("trackEvent", i, e);
1430
+ } catch (f) {
1431
+ b("track", f);
1429
1432
  }
1430
1433
  },
1431
1434
  log: (i, e, t) => {
@@ -1467,7 +1470,7 @@ const p = {
1467
1470
  ), e && (window.mixpanel.track("identify", e), window.mixpanel.people.set(e))), !((c = (d = (l = p.options) == null ? void 0 : l.integrations) == null ? void 0 : d.amplitude) != null && c.disabled) && (g = window.amplitude) != null && g.getInstance && (window.amplitude.getInstance().setUserId(i), Object.keys(e).length > 0)) {
1468
1471
  const h = Object.keys(
1469
1472
  e
1470
- ).reduce((f, m) => (f.set(m, e[m]), f), new window.amplitude.Identify());
1473
+ ).reduce((m, f) => (m.set(f, e[f]), m), new window.amplitude.Identify());
1471
1474
  window.amplitude.getInstance().identify(h);
1472
1475
  }
1473
1476
  },
@@ -1619,7 +1622,7 @@ const p = {
1619
1622
  return !u || ((o = n.options) == null ? void 0 : o.waitForReady) !== !1 && !u.ready ? !0 : (n.func(), !1);
1620
1623
  }), K = void 0, z.length > 0 && (K = setTimeout(
1621
1624
  t,
1622
- jt
1625
+ Jt
1623
1626
  ));
1624
1627
  };
1625
1628
  t();
@@ -1627,14 +1630,14 @@ const p = {
1627
1630
  registerLD(i) {
1628
1631
  He.length || (p.onHighlightReady(() => {
1629
1632
  u.registerLD(i);
1630
- }), kt(this, i, p.options), He.push(new Ue(i)));
1633
+ }), _t(this, i, p.options), He.push(new Ue(i)));
1631
1634
  }
1632
1635
  };
1633
1636
  typeof window != "undefined" && (window.H = p);
1634
- qt();
1637
+ Gt();
1635
1638
  Fe();
1636
1639
  $e();
1637
- const is = {
1640
+ const ns = {
1638
1641
  reset: () => {
1639
1642
  ee = !1, u = void 0, z = [], K = void 0, B = void 0;
1640
1643
  },
@@ -1645,13 +1648,13 @@ const is = {
1645
1648
  export {
1646
1649
  O as GenerateSecureID,
1647
1650
  p as H,
1648
- ss as HighlightSegmentMiddleware,
1649
- ds as LDObserve,
1650
- gs as LDRecord,
1651
- Gt as MetricCategory,
1652
- cs as Observe,
1653
- os as Record,
1654
- is as __testing,
1655
- ts as configureElectronHighlight
1651
+ is as HighlightSegmentMiddleware,
1652
+ hs as LDObserve,
1653
+ us as LDRecord,
1654
+ jt as MetricCategory,
1655
+ ls as Observe,
1656
+ as as Record,
1657
+ ns as __testing,
1658
+ ss as configureElectronHighlight
1656
1659
  };
1657
1660
  //# sourceMappingURL=index.js.map