@eka-care/ekascribe-ts-sdk 3.0.23 → 3.0.24

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { SessionStatus as xr, ScribeError as De, ScribeClient as Cr, TransportMode as Ae } from "med-scribe-alliance-ts-sdk";
1
+ import { SessionStatus as xr, ScribeError as Oe, ScribeClient as Cr, TransportMode as Ae } from "med-scribe-alliance-ts-sdk";
2
2
  import { createWorkerBlobUrl as _u, getWorkerUrl as Eu } from "med-scribe-alliance-ts-sdk";
3
3
  const Nr = 1e4;
4
- class Or {
4
+ class Dr {
5
5
  constructor(t) {
6
6
  this.tokenRefreshPromise = null, this.accessToken = t.access_token, this.clientId = t.clientId, this.flavour = t.flavour, this.defaultTimeout = t.defaultTimeout ?? Nr, this.onUnauthorized = t.onUnauthorized;
7
7
  }
@@ -67,10 +67,10 @@ class L extends Error {
67
67
  super(t), this.status = n, this.name = "TransportError";
68
68
  }
69
69
  }
70
- const Dr = 1e4;
70
+ const Or = 1e4;
71
71
  class Ar {
72
72
  constructor(t, n) {
73
- this.tokenRefreshPromise = null, this.pendingRequests = /* @__PURE__ */ new Map(), this.accessToken = t.access_token, this.clientId = t.clientId, this.flavour = t.flavour, this.defaultTimeout = t.defaultTimeout ?? Dr, this.onUnauthorized = t.onUnauthorized, this.bridge = n, this.bridge.onResponse((r) => {
73
+ this.tokenRefreshPromise = null, this.pendingRequests = /* @__PURE__ */ new Map(), this.accessToken = t.access_token, this.clientId = t.clientId, this.flavour = t.flavour, this.defaultTimeout = t.defaultTimeout ?? Or, this.onUnauthorized = t.onUnauthorized, this.bridge = n, this.bridge.onResponse((r) => {
74
74
  const s = r;
75
75
  if (s?.type !== "response" || !s.correlationId) return;
76
76
  const o = this.pendingRequests.get(s.correlationId);
@@ -199,7 +199,7 @@ class Fr {
199
199
  }
200
200
  }
201
201
  const g = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, S = globalThis, X = "10.43.0";
202
- function Dt() {
202
+ function Ot() {
203
203
  return At(S), S;
204
204
  }
205
205
  function At(e) {
@@ -244,10 +244,10 @@ function Br() {
244
244
  function Mn() {
245
245
  return _e().enabled;
246
246
  }
247
- function jr(...e) {
247
+ function Vr(...e) {
248
248
  ge("log", ...e);
249
249
  }
250
- function Vr(...e) {
250
+ function jr(...e) {
251
251
  ge("warn", ...e);
252
252
  }
253
253
  function Gr(...e) {
@@ -269,9 +269,9 @@ const m = {
269
269
  /** Check if logging is enabled. */
270
270
  isEnabled: Mn,
271
271
  /** Log a message. */
272
- log: jr,
272
+ log: Vr,
273
273
  /** Log a warning. */
274
- warn: Vr,
274
+ warn: jr,
275
275
  /** Log an error. */
276
276
  error: Gr
277
277
  }, Pn = 50, K = "?", Me = /\(error: (.*)\)/, Pe = /captureMessage|captureException/;
@@ -353,7 +353,7 @@ function J(e, t) {
353
353
  }
354
354
  }
355
355
  }
356
- function D(e, t) {
356
+ function O(e, t) {
357
357
  const n = e && Tt[e];
358
358
  if (n)
359
359
  for (const r of n)
@@ -369,30 +369,30 @@ Error:`,
369
369
  );
370
370
  }
371
371
  }
372
- let jt = null;
372
+ let Vt = null;
373
373
  function qr(e) {
374
374
  const t = "error";
375
375
  Y(t, e), J(t, Xr);
376
376
  }
377
377
  function Xr() {
378
- jt = S.onerror, S.onerror = function(e, t, n, r, s) {
379
- return D("error", {
378
+ Vt = S.onerror, S.onerror = function(e, t, n, r, s) {
379
+ return O("error", {
380
380
  column: r,
381
381
  error: s,
382
382
  line: n,
383
383
  msg: e,
384
384
  url: t
385
- }), jt ? jt.apply(this, arguments) : !1;
385
+ }), Vt ? Vt.apply(this, arguments) : !1;
386
386
  }, S.onerror.__SENTRY_INSTRUMENTED__ = !0;
387
387
  }
388
- let Vt = null;
388
+ let jt = null;
389
389
  function Kr(e) {
390
390
  const t = "unhandledrejection";
391
391
  Y(t, e), J(t, Yr);
392
392
  }
393
393
  function Yr() {
394
- Vt = S.onunhandledrejection, S.onunhandledrejection = function(e) {
395
- return D("unhandledrejection", e), Vt ? Vt.apply(this, arguments) : !0;
394
+ jt = S.onunhandledrejection, S.onunhandledrejection = function(e) {
395
+ return O("unhandledrejection", e), jt ? jt.apply(this, arguments) : !0;
396
396
  }, S.onunhandledrejection.__SENTRY_INSTRUMENTED__ = !0;
397
397
  }
398
398
  const $n = Object.prototype.toString;
@@ -460,7 +460,7 @@ function Bn(e) {
460
460
  return typeof Request < "u" && B(e, Request);
461
461
  }
462
462
  const ye = S, es = 80;
463
- function jn(e, t = {}) {
463
+ function Vn(e, t = {}) {
464
464
  if (!e)
465
465
  return "<unknown>";
466
466
  try {
@@ -541,14 +541,14 @@ function x(e, t, n) {
541
541
  if (typeof r != "function")
542
542
  return;
543
543
  const s = n(r);
544
- typeof s == "function" && Vn(s, r);
544
+ typeof s == "function" && jn(s, r);
545
545
  try {
546
546
  e[t] = s;
547
547
  } catch {
548
548
  g && m.log(`Failed to replace method "${t}" in object`, e);
549
549
  }
550
550
  }
551
- function j(e, t, n) {
551
+ function V(e, t, n) {
552
552
  try {
553
553
  Object.defineProperty(e, t, {
554
554
  // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
@@ -560,14 +560,14 @@ function j(e, t, n) {
560
560
  g && m.log(`Failed to add non-enumerable property "${t}" to object`, e);
561
561
  }
562
562
  }
563
- function Vn(e, t) {
563
+ function jn(e, t) {
564
564
  try {
565
565
  const n = t.prototype || {};
566
- e.prototype = t.prototype = n, j(e, "__sentry_original__", t);
566
+ e.prototype = t.prototype = n, V(e, "__sentry_original__", t);
567
567
  } catch {
568
568
  }
569
569
  }
570
- function be(e) {
570
+ function Re(e) {
571
571
  return e.__sentry_original__;
572
572
  }
573
573
  function Gn(e) {
@@ -591,7 +591,7 @@ function Gn(e) {
591
591
  }
592
592
  function Ue(e) {
593
593
  try {
594
- return Zr(e) ? jn(e) : Object.prototype.toString.call(e);
594
+ return Zr(e) ? Vn(e) : Object.prototype.toString.call(e);
595
595
  } catch {
596
596
  return "<unknown>";
597
597
  }
@@ -691,11 +691,11 @@ function et(e, t) {
691
691
  n.mechanism.data = o;
692
692
  }
693
693
  }
694
- function je(e) {
694
+ function Ve(e) {
695
695
  if (as(e))
696
696
  return !0;
697
697
  try {
698
- j(e, "__sentry_captured__", !0);
698
+ V(e, "__sentry_captured__", !0);
699
699
  } catch {
700
700
  }
701
701
  return !1;
@@ -717,9 +717,9 @@ function cs() {
717
717
  const t = e.timeOrigin;
718
718
  return () => (t + Ft(() => e.now())) / zn;
719
719
  }
720
- let Ve;
720
+ let je;
721
721
  function $() {
722
- return (Ve ?? (Ve = cs()))();
722
+ return (je ?? (je = cs()))();
723
723
  }
724
724
  function us(e) {
725
725
  const t = $(), n = {
@@ -788,7 +788,7 @@ function qn() {
788
788
  }
789
789
  const ee = "_sentrySpan";
790
790
  function We(e, t) {
791
- t ? j(e, ee, t) : delete e[ee];
791
+ t ? V(e, ee, t) : delete e[ee];
792
792
  }
793
793
  function ze(e) {
794
794
  return e[ee];
@@ -1293,7 +1293,7 @@ class ms {
1293
1293
  }
1294
1294
  }
1295
1295
  function rt() {
1296
- const e = Dt(), t = At(e);
1296
+ const e = Ot(), t = At(e);
1297
1297
  return t.stack = t.stack || new ms(hs(), fs());
1298
1298
  }
1299
1299
  function gs(e) {
@@ -1316,23 +1316,23 @@ function Es() {
1316
1316
  getIsolationScope: () => rt().getIsolationScope()
1317
1317
  };
1318
1318
  }
1319
- function Re(e) {
1319
+ function be(e) {
1320
1320
  const t = At(e);
1321
1321
  return t.acs ? t.acs : Es();
1322
1322
  }
1323
1323
  function M() {
1324
- const e = Dt();
1325
- return Re(e).getCurrentScope();
1324
+ const e = Ot();
1325
+ return be(e).getCurrentScope();
1326
1326
  }
1327
1327
  function G() {
1328
- const e = Dt();
1329
- return Re(e).getIsolationScope();
1328
+ const e = Ot();
1329
+ return be(e).getIsolationScope();
1330
1330
  }
1331
1331
  function ys() {
1332
1332
  return ot("globalScope", () => new A());
1333
1333
  }
1334
1334
  function Ss(...e) {
1335
- const t = Dt(), n = Re(t);
1335
+ const t = Ot(), n = be(t);
1336
1336
  if (e.length === 2) {
1337
1337
  const [r, s] = e;
1338
1338
  return r ? n.withSetScope(r, s) : n.withScope(s);
@@ -1342,15 +1342,15 @@ function Ss(...e) {
1342
1342
  function I() {
1343
1343
  return M().getClient();
1344
1344
  }
1345
- function bs(e) {
1345
+ function Rs(e) {
1346
1346
  const t = e.getPropagationContext(), { traceId: n, parentSpanId: r, propagationSpanId: s } = t, o = {
1347
1347
  trace_id: n,
1348
1348
  span_id: s || qn()
1349
1349
  };
1350
1350
  return r && (o.parent_span_id = r), o;
1351
1351
  }
1352
- const Rs = "sentry.source", Ts = "sentry.sample_rate", vs = "sentry.previous_trace_sample_rate", Is = "sentry.op", ws = "sentry.origin", Xn = "sentry.profile_id", Kn = "sentry.exclusive_time", ks = "gen_ai.conversation.id", xs = 0, Cs = 1, Ns = "_sentryScope", Os = "_sentryIsolationScope";
1353
- function Ds(e) {
1352
+ const bs = "sentry.source", Ts = "sentry.sample_rate", vs = "sentry.previous_trace_sample_rate", Is = "sentry.op", ws = "sentry.origin", Xn = "sentry.profile_id", Kn = "sentry.exclusive_time", ks = "gen_ai.conversation.id", xs = 0, Cs = 1, Ns = "_sentryScope", Ds = "_sentryIsolationScope";
1353
+ function Os(e) {
1354
1354
  if (e) {
1355
1355
  if (typeof e == "object" && "deref" in e && typeof e.deref == "function")
1356
1356
  try {
@@ -1365,7 +1365,7 @@ function Yn(e) {
1365
1365
  const t = e;
1366
1366
  return {
1367
1367
  scope: t[Ns],
1368
- isolationScope: Ds(t[Os])
1368
+ isolationScope: Os(t[Ds])
1369
1369
  };
1370
1370
  }
1371
1371
  const As = "sentry-", Ms = /^sentry-/;
@@ -1449,13 +1449,13 @@ function Bs(e) {
1449
1449
  const { port: t, projectId: n, protocol: r } = e;
1450
1450
  return ["protocol", "publicKey", "host", "projectId"].find((i) => e[i] ? !1 : (m.error(`Invalid Sentry Dsn: ${i} missing`), !0)) ? !1 : n.match(/^\d+$/) ? Us(r) ? t && isNaN(parseInt(t, 10)) ? (m.error(`Invalid Sentry Dsn: Invalid port ${t}`), !1) : !0 : (m.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), !1) : (m.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), !1);
1451
1451
  }
1452
- function js(e) {
1452
+ function Vs(e) {
1453
1453
  return e.match(Fs)?.[1];
1454
1454
  }
1455
- function Vs(e) {
1455
+ function js(e) {
1456
1456
  const t = e.getOptions(), { host: n } = e.getDsn() || {};
1457
1457
  let r;
1458
- return t.orgId ? r = String(t.orgId) : n && (r = js(n)), r;
1458
+ return t.orgId ? r = String(t.orgId) : n && (r = Vs(n)), r;
1459
1459
  }
1460
1460
  function Gs(e) {
1461
1461
  const t = typeof e == "string" ? Hs(e) : Jn(e);
@@ -1592,7 +1592,7 @@ function tr(e, t) {
1592
1592
  release: n.release,
1593
1593
  public_key: r,
1594
1594
  trace_id: e,
1595
- org_id: Vs(t)
1595
+ org_id: js(t)
1596
1596
  };
1597
1597
  return t.emit("createDsc", s), s;
1598
1598
  }
@@ -1605,8 +1605,8 @@ function so(e) {
1605
1605
  if (!t)
1606
1606
  return {};
1607
1607
  const n = Qn(e), r = Te(n), s = r.data, o = n.spanContext().traceState, i = o?.get("sentry.sample_rate") ?? s[Ts] ?? s[vs];
1608
- function a(b) {
1609
- return (typeof i == "number" || typeof i == "string") && (b.sample_rate = `${i}`), b;
1608
+ function a(R) {
1609
+ return (typeof i == "number" || typeof i == "string") && (R.sample_rate = `${i}`), R;
1610
1610
  }
1611
1611
  const c = n[no];
1612
1612
  if (c)
@@ -1614,7 +1614,7 @@ function so(e) {
1614
1614
  const u = o?.get("sentry.dsc"), d = u && Ps(u);
1615
1615
  if (d)
1616
1616
  return a(d);
1617
- const l = tr(e.spanContext().traceId, t), h = s[Rs], p = r.description;
1617
+ const l = tr(e.spanContext().traceId, t), h = s[bs], p = r.description;
1618
1618
  return h !== "url" && p && (l.transaction = p), Qs() && (l.sampled = String(Ys(n)), l.sample_rand = // In OTEL we store the sample rand on the trace state because we cannot access scopes for NonRecordingSpans
1619
1619
  // The Sentry OTEL SpanSampler takes care of writing the sample rand on the root span
1620
1620
  o?.get("sentry.sample_rand") ?? // On all other platforms we can actually get the scopes from a root span (we use this as a fallback)
@@ -1663,8 +1663,8 @@ function ne(e, t, n = 1 / 0, r = 1 / 0, s = uo()) {
1663
1663
  d[p] = "[MaxProperties ~]";
1664
1664
  break;
1665
1665
  }
1666
- const b = h[p];
1667
- d[p] = ne(p, b, c - 1, r, s), l++;
1666
+ const R = h[p];
1667
+ d[p] = ne(p, R, c - 1, r, s), l++;
1668
1668
  }
1669
1669
  return i(t), d;
1670
1670
  }
@@ -1954,7 +1954,7 @@ class pt {
1954
1954
  }
1955
1955
  }
1956
1956
  }
1957
- function bo(e, t, n, r = 0) {
1957
+ function Ro(e, t, n, r = 0) {
1958
1958
  try {
1959
1959
  const s = oe(t, n, e, r);
1960
1960
  return ft(s) ? s : Et(s);
@@ -1970,7 +1970,7 @@ function oe(e, t, n, r) {
1970
1970
  return g && o === null && m.log(`Event processor "${s.id || "?"}" dropped event`), ft(o) ? o.then((i) => oe(i, t, n, r + 1)) : oe(o, t, n, r + 1);
1971
1971
  }
1972
1972
  let W, sn, on, U;
1973
- function Ro(e) {
1973
+ function bo(e) {
1974
1974
  const t = S._sentryDebugIds, n = S._debugIds;
1975
1975
  if (!t && !n)
1976
1976
  return {};
@@ -1986,9 +1986,9 @@ function Ro(e) {
1986
1986
  else if (u) {
1987
1987
  const l = e(c);
1988
1988
  for (let h = l.length - 1; h >= 0; h--) {
1989
- const b = l[h]?.filename;
1990
- if (b && U && W) {
1991
- U[b] = u, W[c] = [b, u];
1989
+ const R = l[h]?.filename;
1990
+ if (R && U && W) {
1991
+ U[R] = u, W[c] = [R, u];
1992
1992
  break;
1993
1993
  }
1994
1994
  }
@@ -2015,10 +2015,10 @@ function an(e, t) {
2015
2015
  eventProcessors: l,
2016
2016
  attachments: h,
2017
2017
  propagationContext: p,
2018
- transactionName: b,
2018
+ transactionName: R,
2019
2019
  span: T
2020
2020
  } = t;
2021
- ut(e, "extra", n), ut(e, "tags", r), ut(e, "attributes", s), ut(e, "user", o), ut(e, "contexts", i), e.sdkProcessingMetadata = gt(e.sdkProcessingMetadata, c, 2), a && (e.level = a), b && (e.transactionName = b), T && (e.span = T), u.length && (e.breadcrumbs = [...e.breadcrumbs, ...u]), d.length && (e.fingerprint = [...e.fingerprint, ...d]), l.length && (e.eventProcessors = [...e.eventProcessors, ...l]), h.length && (e.attachments = [...e.attachments, ...h]), e.propagationContext = { ...e.propagationContext, ...p };
2021
+ ut(e, "extra", n), ut(e, "tags", r), ut(e, "attributes", s), ut(e, "user", o), ut(e, "contexts", i), e.sdkProcessingMetadata = gt(e.sdkProcessingMetadata, c, 2), a && (e.level = a), R && (e.transactionName = R), T && (e.span = T), u.length && (e.breadcrumbs = [...e.breadcrumbs, ...u]), d.length && (e.fingerprint = [...e.fingerprint, ...d]), l.length && (e.eventProcessors = [...e.eventProcessors, ...l]), h.length && (e.attachments = [...e.attachments, ...h]), e.propagationContext = { ...e.propagationContext, ...p };
2022
2022
  }
2023
2023
  function ut(e, t, n) {
2024
2024
  e[t] = gt(e[t], n, 1);
@@ -2061,17 +2061,17 @@ function Co(e, t, n, r, s, o) {
2061
2061
  event_id: t.event_id || n.event_id || N(),
2062
2062
  timestamp: t.timestamp || mt()
2063
2063
  }, u = n.integrations || e.integrations.map((C) => C.name);
2064
- No(c, e), Ao(c, u), s && s.emit("applyFrameMetadata", t), t.type === void 0 && Oo(c, e.stackParser);
2064
+ No(c, e), Ao(c, u), s && s.emit("applyFrameMetadata", t), t.type === void 0 && Do(c, e.stackParser);
2065
2065
  const d = Po(r, n.captureContext);
2066
2066
  n.mechanism && et(c, n.mechanism);
2067
2067
  const l = s ? s.getEventProcessors() : [], h = rr(o, d), p = [...n.attachments || [], ...h.attachments];
2068
2068
  p.length && (n.attachments = p), To(c, h);
2069
- const b = [
2069
+ const R = [
2070
2070
  ...l,
2071
2071
  // Run scope event processors _after_ all other processors
2072
2072
  ...h.eventProcessors
2073
2073
  ];
2074
- return (n.data && n.data.__sentry__ === !0 ? Et(c) : bo(b, c, n)).then((C) => (C && Do(C), typeof i == "number" && i > 0 ? Mo(C, i, a) : C));
2074
+ return (n.data && n.data.__sentry__ === !0 ? Et(c) : Ro(R, c, n)).then((C) => (C && Oo(C), typeof i == "number" && i > 0 ? Mo(C, i, a) : C));
2075
2075
  }
2076
2076
  function No(e, t) {
2077
2077
  const { environment: n, release: r, dist: s, maxValueLength: o } = t;
@@ -2081,15 +2081,15 @@ function No(e, t) {
2081
2081
  a.value && (a.value = Qt(a.value, o));
2082
2082
  });
2083
2083
  }
2084
- function Oo(e, t) {
2085
- const n = Ro(t);
2084
+ function Do(e, t) {
2085
+ const n = bo(t);
2086
2086
  e.exception?.values?.forEach((r) => {
2087
2087
  r.stacktrace?.frames?.forEach((s) => {
2088
2088
  s.filename && (s.debug_id = n[s.filename]);
2089
2089
  });
2090
2090
  });
2091
2091
  }
2092
- function Do(e) {
2092
+ function Oo(e) {
2093
2093
  const t = {};
2094
2094
  if (e.exception?.values?.forEach((r) => {
2095
2095
  r.stacktrace?.frames?.forEach((s) => {
@@ -2203,17 +2203,17 @@ function zt(e = !1) {
2203
2203
  }
2204
2204
  ar();
2205
2205
  }
2206
- const jo = "7";
2207
- function Vo(e) {
2206
+ const Vo = "7";
2207
+ function jo(e) {
2208
2208
  const t = e.protocol ? `${e.protocol}:` : "", n = e.port ? `:${e.port}` : "";
2209
2209
  return `${t}//${e.host}${n}${e.path ? `/${e.path}` : ""}/api/`;
2210
2210
  }
2211
2211
  function Go(e) {
2212
- return `${Vo(e)}${e.projectId}/envelope/`;
2212
+ return `${jo(e)}${e.projectId}/envelope/`;
2213
2213
  }
2214
2214
  function Wo(e, t) {
2215
2215
  const n = {
2216
- sentry_version: jo
2216
+ sentry_version: Vo
2217
2217
  };
2218
2218
  return e.publicKey && (n.sentry_key = e.publicKey), t && (n.sentry_client = `${t.name}/${t.version}`), new URLSearchParams(n).toString();
2219
2219
  }
@@ -2585,7 +2585,7 @@ class pi {
2585
2585
  */
2586
2586
  captureException(t, n, r) {
2587
2587
  const s = N();
2588
- if (je(t))
2588
+ if (Ve(t))
2589
2589
  return g && m.log(ln), s;
2590
2590
  const o = {
2591
2591
  event_id: s,
@@ -2618,7 +2618,7 @@ class pi {
2618
2618
  */
2619
2619
  captureEvent(t, n, r) {
2620
2620
  const s = N();
2621
- if (n?.originalException && je(n.originalException))
2621
+ if (n?.originalException && Ve(n.originalException))
2622
2622
  return g && m.log(ln), s;
2623
2623
  const o = {
2624
2624
  event_id: s,
@@ -2897,7 +2897,7 @@ class pi {
2897
2897
  if (a === null)
2898
2898
  return a;
2899
2899
  this.emit("postprocessEvent", a, n), a.contexts = {
2900
- trace: { ...a.contexts?.trace, ...bs(r) },
2900
+ trace: { ...a.contexts?.trace, ...Rs(r) },
2901
2901
  ...a.contexts
2902
2902
  };
2903
2903
  const c = ro(this, r);
@@ -2958,17 +2958,17 @@ class pi {
2958
2958
  }
2959
2959
  throw qt(`${d} returned \`null\`, will not send event.`);
2960
2960
  }
2961
- const b = r.getSession() || s.getSession();
2962
- if (c && b && this._updateSessionFromEvent(b, p), a) {
2963
- const O = p.sdkProcessingMetadata?.spanCountBeforeProcessing || 0, C = p.spans ? p.spans.length : 0, Oe = O - C;
2964
- Oe > 0 && this.recordDroppedEvent("before_send", "span", Oe);
2961
+ const R = r.getSession() || s.getSession();
2962
+ if (c && R && this._updateSessionFromEvent(R, p), a) {
2963
+ const D = p.sdkProcessingMetadata?.spanCountBeforeProcessing || 0, C = p.spans ? p.spans.length : 0, De = D - C;
2964
+ De > 0 && this.recordDroppedEvent("before_send", "span", De);
2965
2965
  }
2966
2966
  const T = p.transaction_info;
2967
2967
  if (a && T && p.transaction !== t.transaction) {
2968
- const O = "custom";
2968
+ const D = "custom";
2969
2969
  p.transaction_info = {
2970
2970
  ...T,
2971
- source: O
2971
+ source: D
2972
2972
  };
2973
2973
  }
2974
2974
  return this.sendEvent(p, n), p;
@@ -3075,8 +3075,8 @@ function fi(e, t, n, r) {
3075
3075
  continue;
3076
3076
  }
3077
3077
  if (i) {
3078
- const b = i(p);
3079
- b ? d.push(b) : (Ze(), d.push(p));
3078
+ const R = i(p);
3079
+ R ? d.push(R) : (Ze(), d.push(p));
3080
3080
  } else
3081
3081
  d.push(p);
3082
3082
  }
@@ -3167,13 +3167,13 @@ function Si(e, t = !0) {
3167
3167
  }
3168
3168
  return e;
3169
3169
  }
3170
- function bi(e) {
3170
+ function Ri(e) {
3171
3171
  "aggregates" in e ? e.attrs?.ip_address === void 0 && (e.attrs = {
3172
3172
  ...e.attrs,
3173
3173
  ip_address: "{{auto}}"
3174
3174
  }) : e.ipAddress === void 0 && (e.ipAddress = "{{auto}}");
3175
3175
  }
3176
- function Ri(e, t, n = [t], r = "npm") {
3176
+ function bi(e, t, n = [t], r = "npm") {
3177
3177
  const s = (e._metadata = e._metadata || {}).sdk = e._metadata.sdk || {};
3178
3178
  s.name || (s.name = `sentry.javascript.${t}`, s.packages = n.map((o) => ({
3179
3179
  name: `${r}:@sentry/${o}`,
@@ -3181,7 +3181,7 @@ function Ri(e, t, n = [t], r = "npm") {
3181
3181
  })), s.version = X);
3182
3182
  }
3183
3183
  const Ti = 100;
3184
- function V(e, t) {
3184
+ function j(e, t) {
3185
3185
  const n = I(), r = G();
3186
3186
  if (!n) return;
3187
3187
  const { beforeBreadcrumb: s = null, maxBreadcrumbs: o = Ti } = n.getOptions();
@@ -3196,7 +3196,7 @@ const vi = "FunctionToString", Sn = /* @__PURE__ */ new WeakMap(), Ii = (() => (
3196
3196
  yn = Function.prototype.toString;
3197
3197
  try {
3198
3198
  Function.prototype.toString = function(...e) {
3199
- const t = be(this), n = Sn.has(I()) && t !== void 0 ? t : this;
3199
+ const t = Re(this), n = Sn.has(I()) && t !== void 0 ? t : this;
3200
3200
  return yn.apply(n, e);
3201
3201
  };
3202
3202
  } catch {
@@ -3232,21 +3232,21 @@ const vi = "FunctionToString", Sn = /* @__PURE__ */ new WeakMap(), Ii = (() => (
3232
3232
  name: xi,
3233
3233
  setup(n) {
3234
3234
  const r = n.getOptions();
3235
- t = bn(e, r);
3235
+ t = Rn(e, r);
3236
3236
  },
3237
3237
  processEvent(n, r, s) {
3238
3238
  if (!t) {
3239
3239
  const o = s.getOptions();
3240
- t = bn(e, o);
3240
+ t = Rn(e, o);
3241
3241
  }
3242
- return Oi(n, t) ? null : n;
3242
+ return Di(n, t) ? null : n;
3243
3243
  }
3244
3244
  };
3245
3245
  }, Ni = ((e = {}) => ({
3246
3246
  ...Ci(e),
3247
3247
  name: "InboundFilters"
3248
3248
  }));
3249
- function bn(e = {}, t = {}) {
3249
+ function Rn(e = {}, t = {}) {
3250
3250
  return {
3251
3251
  allowUrls: [...e.allowUrls || [], ...t.allowUrls || []],
3252
3252
  denyUrls: [...e.denyUrls || [], ...t.denyUrls || []],
@@ -3258,7 +3258,7 @@ function bn(e = {}, t = {}) {
3258
3258
  ignoreTransactions: [...e.ignoreTransactions || [], ...t.ignoreTransactions || []]
3259
3259
  };
3260
3260
  }
3261
- function Oi(e, t) {
3261
+ function Di(e, t) {
3262
3262
  if (e.type) {
3263
3263
  if (e.type === "transaction" && Ai(e, t.ignoreTransactions))
3264
3264
  return g && m.warn(
@@ -3266,7 +3266,7 @@ function Oi(e, t) {
3266
3266
  Event: ${q(e)}`
3267
3267
  ), !0;
3268
3268
  } else {
3269
- if (Di(e, t.ignoreErrors))
3269
+ if (Oi(e, t.ignoreErrors))
3270
3270
  return g && m.warn(
3271
3271
  `Event dropped due to being matched by \`ignoreErrors\` option.
3272
3272
  Event: ${q(e)}`
@@ -3284,7 +3284,7 @@ Event: ${q(
3284
3284
  Event: ${q(
3285
3285
  e
3286
3286
  )}.
3287
- Url: ${Ot(e)}`
3287
+ Url: ${Dt(e)}`
3288
3288
  ), !0;
3289
3289
  if (!Pi(e, t.allowUrls))
3290
3290
  return g && m.warn(
@@ -3292,12 +3292,12 @@ Url: ${Ot(e)}`
3292
3292
  Event: ${q(
3293
3293
  e
3294
3294
  )}.
3295
- Url: ${Ot(e)}`
3295
+ Url: ${Dt(e)}`
3296
3296
  ), !0;
3297
3297
  }
3298
3298
  return !1;
3299
3299
  }
3300
- function Di(e, t) {
3300
+ function Oi(e, t) {
3301
3301
  return t?.length ? fr(e).some((n) => Ut(n, t)) : !1;
3302
3302
  }
3303
3303
  function Ai(e, t) {
@@ -3309,13 +3309,13 @@ function Ai(e, t) {
3309
3309
  function Mi(e, t) {
3310
3310
  if (!t?.length)
3311
3311
  return !1;
3312
- const n = Ot(e);
3312
+ const n = Dt(e);
3313
3313
  return n ? Ut(n, t) : !1;
3314
3314
  }
3315
3315
  function Pi(e, t) {
3316
3316
  if (!t?.length)
3317
3317
  return !0;
3318
- const n = Ot(e);
3318
+ const n = Dt(e);
3319
3319
  return n ? Ut(n, t) : !0;
3320
3320
  }
3321
3321
  function Li(e = []) {
@@ -3326,7 +3326,7 @@ function Li(e = []) {
3326
3326
  }
3327
3327
  return null;
3328
3328
  }
3329
- function Ot(e) {
3329
+ function Dt(e) {
3330
3330
  try {
3331
3331
  const n = [...e.exception?.values ?? []].reverse().find((r) => r.mechanism?.parent_id === void 0 && r.stacktrace?.frames?.length)?.stacktrace?.frames;
3332
3332
  return n ? Li(n) : null;
@@ -3361,7 +3361,7 @@ function ce(e, t, n, r, s, o, i, a) {
3361
3361
  return o;
3362
3362
  let c = [...o];
3363
3363
  if (B(r[s], Error)) {
3364
- Rn(i, a, r);
3364
+ bn(i, a, r);
3365
3365
  const u = e(t, r[s]), d = c.length;
3366
3366
  Tn(u, s, d, a), c = ce(
3367
3367
  e,
@@ -3376,7 +3376,7 @@ function ce(e, t, n, r, s, o, i, a) {
3376
3376
  }
3377
3377
  return yr(r) && r.errors.forEach((u, d) => {
3378
3378
  if (B(u, Error)) {
3379
- Rn(i, a, r);
3379
+ bn(i, a, r);
3380
3380
  const l = e(t, u), h = c.length;
3381
3381
  Tn(l, `errors[${d}]`, h, a), c = ce(
3382
3382
  e,
@@ -3394,7 +3394,7 @@ function ce(e, t, n, r, s, o, i, a) {
3394
3394
  function yr(e) {
3395
3395
  return Array.isArray(e.errors);
3396
3396
  }
3397
- function Rn(e, t, n) {
3397
+ function bn(e, t, n) {
3398
3398
  e.mechanism = {
3399
3399
  handled: !0,
3400
3400
  type: "auto.core.linked_errors",
@@ -3421,7 +3421,7 @@ function Hi() {
3421
3421
  "console" in S && $r.forEach(function(e) {
3422
3422
  e in S.console && x(S.console, e, function(t) {
3423
3423
  return Ct[e] = t, function(...n) {
3424
- D("console", { args: n, level: e }), Ct[e]?.apply(S.console, n);
3424
+ O("console", { args: n, level: e }), Ct[e]?.apply(S.console, n);
3425
3425
  };
3426
3426
  });
3427
3427
  });
@@ -3429,10 +3429,10 @@ function Hi() {
3429
3429
  function Bi(e) {
3430
3430
  return e === "warn" ? "warning" : ["fatal", "error", "warning", "log", "info", "debug"].includes(e) ? e : "log";
3431
3431
  }
3432
- const ji = "Dedupe", Vi = (() => {
3432
+ const Vi = "Dedupe", ji = (() => {
3433
3433
  let e;
3434
3434
  return {
3435
- name: ji,
3435
+ name: Vi,
3436
3436
  processEvent(t) {
3437
3437
  if (t.type)
3438
3438
  return t;
@@ -3444,17 +3444,17 @@ const ji = "Dedupe", Vi = (() => {
3444
3444
  return e = t;
3445
3445
  }
3446
3446
  };
3447
- }), Gi = Vi;
3447
+ }), Gi = ji;
3448
3448
  function Wi(e, t) {
3449
3449
  return t ? !!(zi(e, t) || qi(e, t)) : !1;
3450
3450
  }
3451
3451
  function zi(e, t) {
3452
3452
  const n = e.message, r = t.message;
3453
- return !(!n && !r || n && !r || !n && r || n !== r || !br(e, t) || !Sr(e, t));
3453
+ return !(!n && !r || n && !r || !n && r || n !== r || !Rr(e, t) || !Sr(e, t));
3454
3454
  }
3455
3455
  function qi(e, t) {
3456
3456
  const n = vn(t), r = vn(e);
3457
- return !(!n || !r || n.type !== r.type || n.value !== r.value || !br(e, t) || !Sr(e, t));
3457
+ return !(!n || !r || n.type !== r.type || n.value !== r.value || !Rr(e, t) || !Sr(e, t));
3458
3458
  }
3459
3459
  function Sr(e, t) {
3460
3460
  let n = Le(e), r = Le(t);
@@ -3469,7 +3469,7 @@ function Sr(e, t) {
3469
3469
  }
3470
3470
  return !0;
3471
3471
  }
3472
- function br(e, t) {
3472
+ function Rr(e, t) {
3473
3473
  let n = e.fingerprint, r = t.fingerprint;
3474
3474
  if (!n && !r)
3475
3475
  return !0;
@@ -3494,7 +3494,7 @@ const Xi = "ConversationId", Ki = (() => ({
3494
3494
  });
3495
3495
  }
3496
3496
  })), Yi = Ki;
3497
- function Rr(e) {
3497
+ function br(e) {
3498
3498
  if (e !== void 0)
3499
3499
  return e >= 400 && e < 500 ? "warning" : e >= 500 ? "error" : void 0;
3500
3500
  }
@@ -3550,25 +3550,25 @@ function ea(e, t = !1) {
3550
3550
  virtualError: s,
3551
3551
  headers: ra(r)
3552
3552
  };
3553
- return D("fetch", {
3553
+ return O("fetch", {
3554
3554
  ...a
3555
3555
  }), n.apply(S, r).then(
3556
- async (c) => (D("fetch", {
3556
+ async (c) => (O("fetch", {
3557
3557
  ...a,
3558
3558
  endTimestamp: $() * 1e3,
3559
3559
  response: c
3560
3560
  }), c),
3561
3561
  (c) => {
3562
- D("fetch", {
3562
+ O("fetch", {
3563
3563
  ...a,
3564
3564
  endTimestamp: $() * 1e3,
3565
3565
  error: c
3566
- }), Mt(c) && c.stack === void 0 && (c.stack = s.stack, j(c, "framesToPop", 1));
3566
+ }), Mt(c) && c.stack === void 0 && (c.stack = s.stack, V(c, "framesToPop", 1));
3567
3567
  const d = I()?.getOptions().enhanceFetchErrorMessages ?? "always";
3568
3568
  if (d !== !1 && c instanceof TypeError && (c.message === "Failed to fetch" || c.message === "Load failed" || c.message === "NetworkError when attempting to fetch resource."))
3569
3569
  try {
3570
3570
  const p = new URL(a.fetchData.url).host;
3571
- d === "always" ? c.message = `${c.message} (${p})` : j(c, "__sentry_fetch_url_host__", p);
3571
+ d === "always" ? c.message = `${c.message} (${p})` : V(c, "__sentry_fetch_url_host__", p);
3572
3572
  } catch {
3573
3573
  }
3574
3574
  throw c;
@@ -3615,7 +3615,7 @@ function ra(e) {
3615
3615
  function sa() {
3616
3616
  return "npm";
3617
3617
  }
3618
- const R = S;
3618
+ const b = S;
3619
3619
  let de = 0;
3620
3620
  function Tr() {
3621
3621
  return de > 0;
@@ -3635,7 +3635,7 @@ function st(e, t = {}) {
3635
3635
  const s = e.__sentry_wrapped__;
3636
3636
  if (s)
3637
3637
  return typeof s == "function" ? s : e;
3638
- if (be(e))
3638
+ if (Re(e))
3639
3639
  return e;
3640
3640
  } catch {
3641
3641
  return e;
@@ -3658,7 +3658,7 @@ function st(e, t = {}) {
3658
3658
  Object.prototype.hasOwnProperty.call(e, s) && (r[s] = e[s]);
3659
3659
  } catch {
3660
3660
  }
3661
- Vn(r, e), j(e, "__sentry_wrapped__", r);
3661
+ jn(r, e), V(e, "__sentry_wrapped__", r);
3662
3662
  try {
3663
3663
  Object.getOwnPropertyDescriptor(r, "name").configurable && Object.defineProperty(r, "name", {
3664
3664
  get() {
@@ -3670,7 +3670,7 @@ function st(e, t = {}) {
3670
3670
  return r;
3671
3671
  }
3672
3672
  function ia() {
3673
- const e = Se(), { referrer: t } = R.document || {}, { userAgent: n } = R.navigator || {}, r = {
3673
+ const e = Se(), { referrer: t } = b.document || {}, { userAgent: n } = b.navigator || {}, r = {
3674
3674
  ...t && { Referer: t },
3675
3675
  ...n && { "User-Agent": n }
3676
3676
  };
@@ -3818,8 +3818,8 @@ class Ea extends pi {
3818
3818
  * @param options Configuration options for this SDK.
3819
3819
  */
3820
3820
  constructor(t) {
3821
- const n = ya(t), r = R.SENTRY_SDK_SOURCE || sa();
3822
- Ri(n, "browser", ["browser"], r), n._metadata?.sdk && (n._metadata.sdk.settings = {
3821
+ const n = ya(t), r = b.SENTRY_SDK_SOURCE || sa();
3822
+ bi(n, "browser", ["browser"], r), n._metadata?.sdk && (n._metadata.sdk.settings = {
3823
3823
  infer_ip: n.sendDefaultPii ? "auto" : "never",
3824
3824
  // purposefully allowing already passed settings to override the default
3825
3825
  ...n._metadata.sdk.settings
@@ -3831,9 +3831,9 @@ class Ea extends pi {
3831
3831
  _experiments: a,
3832
3832
  enableMetrics: c
3833
3833
  } = this._options, u = c ?? a?.enableMetrics ?? !0;
3834
- R.document && (o || i || u) && R.document.addEventListener("visibilitychange", () => {
3835
- R.document.visibilityState === "hidden" && (o && this._flushOutcomes(), i && ie(this), u && dr(this));
3836
- }), s && this.on("beforeSendSession", bi);
3834
+ b.document && (o || i || u) && b.document.addEventListener("visibilitychange", () => {
3835
+ b.document.visibilityState === "hidden" && (o && this._flushOutcomes(), i && ie(this), u && dr(this));
3836
+ }), s && this.on("beforeSendSession", Ri);
3837
3837
  }
3838
3838
  /**
3839
3839
  * @inheritDoc
@@ -3856,7 +3856,7 @@ class Ea extends pi {
3856
3856
  }
3857
3857
  function ya(e) {
3858
3858
  return {
3859
- release: typeof __SENTRY_RELEASE__ == "string" ? __SENTRY_RELEASE__ : R.SENTRY_RELEASE?.id,
3859
+ release: typeof __SENTRY_RELEASE__ == "string" ? __SENTRY_RELEASE__ : b.SENTRY_RELEASE?.id,
3860
3860
  // This supports the variable that sentry-webpack-plugin injects
3861
3861
  sendClientReports: !0,
3862
3862
  // We default this to true, as it is the safer scenario
@@ -3864,15 +3864,15 @@ function ya(e) {
3864
3864
  ...e
3865
3865
  };
3866
3866
  }
3867
- const Sa = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, w = S, ba = 1e3;
3867
+ const Sa = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, w = S, Ra = 1e3;
3868
3868
  let wn, pe, he;
3869
- function Ra(e) {
3869
+ function ba(e) {
3870
3870
  Y("dom", e), J("dom", Ta);
3871
3871
  }
3872
3872
  function Ta() {
3873
3873
  if (!w.document)
3874
3874
  return;
3875
- const e = D.bind(null, "dom"), t = kn(e, !0);
3875
+ const e = O.bind(null, "dom"), t = kn(e, !0);
3876
3876
  w.document.addEventListener("click", t, !1), w.document.addEventListener("keypress", t, !1), ["EventTarget", "Node"].forEach((n) => {
3877
3877
  const s = w[n]?.prototype;
3878
3878
  s?.hasOwnProperty?.("addEventListener") && (x(s, "addEventListener", function(o) {
@@ -3926,11 +3926,11 @@ function kn(e, t = !1) {
3926
3926
  const r = wa(n);
3927
3927
  if (Ia(n.type, r))
3928
3928
  return;
3929
- j(n, "_sentryCaptured", !0), r && !r._sentryId && j(r, "_sentryId", N());
3929
+ V(n, "_sentryCaptured", !0), r && !r._sentryId && V(r, "_sentryId", N());
3930
3930
  const s = n.type === "keypress" ? "input" : n.type;
3931
3931
  va(n) || (e({ event: n, name: s, global: t }), pe = n.type, he = r ? r._sentryId : void 0), clearTimeout(wn), wn = w.setTimeout(() => {
3932
3932
  he = void 0, pe = void 0;
3933
- }, ba);
3933
+ }, Ra);
3934
3934
  };
3935
3935
  }
3936
3936
  function wa(e) {
@@ -3950,7 +3950,7 @@ function ka() {
3950
3950
  const t = w.location.href, n = St;
3951
3951
  if (St = t, n === t)
3952
3952
  return;
3953
- D("history", { from: n, to: t });
3953
+ O("history", { from: n, to: t });
3954
3954
  }), !Ji())
3955
3955
  return;
3956
3956
  function e(t) {
@@ -3960,7 +3960,7 @@ function ka() {
3960
3960
  const s = St, o = xa(String(r));
3961
3961
  if (St = o, s === o)
3962
3962
  return t.apply(this, n);
3963
- D("history", { from: s, to: o });
3963
+ O("history", { from: s, to: o });
3964
3964
  }
3965
3965
  return t.apply(this, n);
3966
3966
  };
@@ -3998,10 +3998,10 @@ function Na(e) {
3998
3998
  kt[e] = void 0;
3999
3999
  }
4000
4000
  const dt = "__sentry_xhr_v3__";
4001
- function Oa(e) {
4002
- Y("xhr", e), J("xhr", Da);
4001
+ function Da(e) {
4002
+ Y("xhr", e), J("xhr", Oa);
4003
4003
  }
4004
- function Da() {
4004
+ function Oa() {
4005
4005
  if (!w.XMLHttpRequest)
4006
4006
  return;
4007
4007
  const e = XMLHttpRequest.prototype;
@@ -4028,7 +4028,7 @@ function Da() {
4028
4028
  xhr: n,
4029
4029
  virtualError: s
4030
4030
  };
4031
- D("xhr", d);
4031
+ O("xhr", d);
4032
4032
  }
4033
4033
  };
4034
4034
  return "onreadystatechange" in n && typeof n.onreadystatechange == "function" ? n.onreadystatechange = new Proxy(n.onreadystatechange, {
@@ -4037,8 +4037,8 @@ function Da() {
4037
4037
  }
4038
4038
  }) : n.addEventListener("readystatechange", c), n.setRequestHeader = new Proxy(n.setRequestHeader, {
4039
4039
  apply(u, d, l) {
4040
- const [h, p] = l, b = d[dt];
4041
- return b && F(h) && F(p) && (b.request_headers[h.toLowerCase()] = p), u.apply(d, l);
4040
+ const [h, p] = l, R = d[dt];
4041
+ return R && F(h) && F(p) && (R.request_headers[h.toLowerCase()] = p), u.apply(d, l);
4042
4042
  }
4043
4043
  }), t.apply(n, r);
4044
4044
  }
@@ -4052,7 +4052,7 @@ function Da() {
4052
4052
  startTimestamp: $() * 1e3,
4053
4053
  xhr: n
4054
4054
  };
4055
- return D("xhr", o), t.apply(n, r);
4055
+ return O("xhr", o), t.apply(n, r);
4056
4056
  }
4057
4057
  });
4058
4058
  }
@@ -4120,7 +4120,7 @@ function fe(e, t, n, r) {
4120
4120
  };
4121
4121
  return n !== void 0 && (s.lineno = n), r !== void 0 && (s.colno = r), s;
4122
4122
  }
4123
- const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Ua = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, Ha = /\((\S*)(?::(\d+))(?::(\d+))\)/, Ba = /at (.+?) ?\(data:(.+?),/, ja = (e) => {
4123
+ const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Ua = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, Ha = /\((\S*)(?::(\d+))(?::(\d+))\)/, Ba = /at (.+?) ?\(data:(.+?),/, Va = (e) => {
4124
4124
  const t = e.match(Ba);
4125
4125
  if (t)
4126
4126
  return {
@@ -4141,7 +4141,7 @@ const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Ua = /^\s*at (?:(.+?\)(?: \
4141
4141
  const [o, i] = wr(r[1] || K, r[2]);
4142
4142
  return fe(i, o, r[3] ? +r[3] : void 0, r[4] ? +r[4] : void 0);
4143
4143
  }
4144
- }, Va = [La, ja], Ga = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i, Wa = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, za = (e) => {
4144
+ }, ja = [La, Va], Ga = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i, Wa = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, za = (e) => {
4145
4145
  const t = Ga.exec(e);
4146
4146
  if (t) {
4147
4147
  if (t[3] && t[3].indexOf(" > eval") > -1) {
@@ -4151,13 +4151,13 @@ const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Ua = /^\s*at (?:(.+?\)(?: \
4151
4151
  let r = t[3], s = t[1] || K;
4152
4152
  return [s, r] = wr(s, r), fe(r, s, t[4] ? +t[4] : void 0, t[5] ? +t[5] : void 0);
4153
4153
  }
4154
- }, qa = [Fa, za], Xa = [Va, qa], Ka = Ln(...Xa), wr = (e, t) => {
4154
+ }, qa = [Fa, za], Xa = [ja, qa], Ka = Ln(...Xa), wr = (e, t) => {
4155
4155
  const n = e.indexOf("safari-extension") !== -1, r = e.indexOf("safari-web-extension") !== -1;
4156
4156
  return n || r ? [
4157
4157
  e.indexOf("@") !== -1 ? e.split("@")[0] : K,
4158
4158
  n ? `safari-extension:${t}` : `safari-web-extension:${t}`
4159
4159
  ] : [e, t];
4160
- }, bt = 1024, Ya = "Breadcrumbs", Ja = ((e = {}) => {
4160
+ }, Rt = 1024, Ya = "Breadcrumbs", Ja = ((e = {}) => {
4161
4161
  const t = {
4162
4162
  console: !0,
4163
4163
  dom: !0,
@@ -4170,13 +4170,13 @@ const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Ua = /^\s*at (?:(.+?\)(?: \
4170
4170
  return {
4171
4171
  name: Ya,
4172
4172
  setup(n) {
4173
- t.console && Ui(ec(n)), t.dom && Ra(tc(n, t.dom)), t.xhr && Oa(nc(n)), t.fetch && ta(rc(n)), t.history && Ir(sc(n)), t.sentry && n.on("beforeSendEvent", Qa(n));
4173
+ t.console && Ui(ec(n)), t.dom && ba(tc(n, t.dom)), t.xhr && Da(nc(n)), t.fetch && ta(rc(n)), t.history && Ir(sc(n)), t.sentry && n.on("beforeSendEvent", Qa(n));
4174
4174
  }
4175
4175
  };
4176
4176
  }), Za = Ja;
4177
4177
  function Qa(e) {
4178
4178
  return function(n) {
4179
- I() === e && V(
4179
+ I() === e && j(
4180
4180
  {
4181
4181
  category: `sentry.${n.type === "transaction" ? "transaction" : "event"}`,
4182
4182
  event_id: n.event_id,
@@ -4194,12 +4194,12 @@ function tc(e, t) {
4194
4194
  if (I() !== e)
4195
4195
  return;
4196
4196
  let s, o, i = typeof t == "object" ? t.serializeAttribute : void 0, a = typeof t == "object" && typeof t.maxStringLength == "number" ? t.maxStringLength : void 0;
4197
- a && a > bt && (Ht && m.warn(
4198
- `\`dom.maxStringLength\` cannot exceed ${bt}, but a value of ${a} was configured. Sentry will use ${bt} instead.`
4199
- ), a = bt), typeof i == "string" && (i = [i]);
4197
+ a && a > Rt && (Ht && m.warn(
4198
+ `\`dom.maxStringLength\` cannot exceed ${Rt}, but a value of ${a} was configured. Sentry will use ${Rt} instead.`
4199
+ ), a = Rt), typeof i == "string" && (i = [i]);
4200
4200
  try {
4201
4201
  const u = r.event, d = oc(u) ? u.target : u;
4202
- s = jn(d, { keyAttrs: i, maxStringLength: a }), o = rs(d);
4202
+ s = Vn(d, { keyAttrs: i, maxStringLength: a }), o = rs(d);
4203
4203
  } catch {
4204
4204
  s = "<unknown>";
4205
4205
  }
@@ -4209,7 +4209,7 @@ function tc(e, t) {
4209
4209
  category: `ui.${r.name}`,
4210
4210
  message: s
4211
4211
  };
4212
- o && (c.data = { "ui.component_name": o }), V(c, {
4212
+ o && (c.data = { "ui.component_name": o }), j(c, {
4213
4213
  event: r.event,
4214
4214
  name: r.name,
4215
4215
  global: r.global
@@ -4234,7 +4234,7 @@ function ec(e) {
4234
4234
  r.message = `Assertion failed: ${Be(n.args.slice(1), " ") || "console.assert"}`, r.data.arguments = n.args.slice(1);
4235
4235
  else
4236
4236
  return;
4237
- V(r, {
4237
+ j(r, {
4238
4238
  input: n.args,
4239
4239
  level: n.level
4240
4240
  });
@@ -4260,9 +4260,9 @@ function nc(e) {
4260
4260
  category: "xhr",
4261
4261
  data: d,
4262
4262
  type: "http",
4263
- level: Rr(c)
4263
+ level: br(c)
4264
4264
  };
4265
- e.emit("beforeOutgoingRequestBreadcrumb", h, l), V(h, l);
4265
+ e.emit("beforeOutgoingRequestBreadcrumb", h, l), j(h, l);
4266
4266
  };
4267
4267
  }
4268
4268
  function rc(e) {
@@ -4283,7 +4283,7 @@ function rc(e) {
4283
4283
  level: "error",
4284
4284
  type: "http"
4285
4285
  };
4286
- e.emit("beforeOutgoingRequestBreadcrumb", a, i), V(a, i);
4286
+ e.emit("beforeOutgoingRequestBreadcrumb", a, i), j(a, i);
4287
4287
  } else {
4288
4288
  const o = n.response, i = {
4289
4289
  ...n.fetchData,
@@ -4299,9 +4299,9 @@ function rc(e) {
4299
4299
  category: "fetch",
4300
4300
  data: i,
4301
4301
  type: "http",
4302
- level: Rr(i.status_code)
4302
+ level: br(i.status_code)
4303
4303
  };
4304
- e.emit("beforeOutgoingRequestBreadcrumb", c, a), V(c, a);
4304
+ e.emit("beforeOutgoingRequestBreadcrumb", c, a), j(c, a);
4305
4305
  }
4306
4306
  };
4307
4307
  }
@@ -4310,10 +4310,10 @@ function sc(e) {
4310
4310
  if (I() !== e)
4311
4311
  return;
4312
4312
  let r = n.from, s = n.to;
4313
- const o = Xt(R.location.href);
4313
+ const o = Xt(b.location.href);
4314
4314
  let i = r ? Xt(r) : void 0;
4315
4315
  const a = Xt(s);
4316
- i?.path || (i = o), o.protocol === a.protocol && o.host === a.host && (s = a.relative), o.protocol === i.protocol && o.host === i.host && (r = i.relative), V({
4316
+ i?.path || (i = o), o.protocol === a.protocol && o.host === a.host && (s = a.relative), o.protocol === i.protocol && o.host === i.host && (r = i.relative), j({
4317
4317
  category: "navigation",
4318
4318
  data: {
4319
4319
  from: r,
@@ -4372,7 +4372,7 @@ const ic = [
4372
4372
  // TODO: This currently only works for the first client this is setup
4373
4373
  // We may want to adjust this to check for client etc.
4374
4374
  setupOnce() {
4375
- t.setTimeout && x(R, "setTimeout", xn), t.setInterval && x(R, "setInterval", xn), t.requestAnimationFrame && x(R, "requestAnimationFrame", dc), t.XMLHttpRequest && "XMLHttpRequest" in R && x(XMLHttpRequest.prototype, "send", lc);
4375
+ t.setTimeout && x(b, "setTimeout", xn), t.setInterval && x(b, "setInterval", xn), t.requestAnimationFrame && x(b, "requestAnimationFrame", dc), t.XMLHttpRequest && "XMLHttpRequest" in b && x(XMLHttpRequest.prototype, "send", lc);
4376
4376
  const n = t.eventTarget;
4377
4377
  n && (Array.isArray(n) ? n : ic).forEach((s) => pc(s, t));
4378
4378
  }
@@ -4417,14 +4417,14 @@ function lc(e) {
4417
4417
  handled: !1,
4418
4418
  type: `auto.browser.browserapierrors.xhr.${s}`
4419
4419
  }
4420
- }, a = be(o);
4420
+ }, a = Re(o);
4421
4421
  return a && (i.mechanism.data.handler = H(a)), st(o, i);
4422
4422
  });
4423
4423
  }), e.apply(this, t);
4424
4424
  };
4425
4425
  }
4426
4426
  function pc(e, t) {
4427
- const r = R[e]?.prototype;
4427
+ const r = b[e]?.prototype;
4428
4428
  r?.hasOwnProperty?.("addEventListener") && (x(r, "addEventListener", function(s) {
4429
4429
  return function(o, i, a) {
4430
4430
  try {
@@ -4477,7 +4477,7 @@ const mc = (e = {}) => {
4477
4477
  return {
4478
4478
  name: "BrowserSession",
4479
4479
  setupOnce() {
4480
- if (typeof R.document > "u") {
4480
+ if (typeof b.document > "u") {
4481
4481
  Ht && m.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");
4482
4482
  return;
4483
4483
  }
@@ -4504,7 +4504,7 @@ const mc = (e = {}) => {
4504
4504
  })), Ec = _c;
4505
4505
  function yc() {
4506
4506
  try {
4507
- const e = R.Intl;
4507
+ const e = b.Intl;
4508
4508
  if (!e)
4509
4509
  return;
4510
4510
  const t = e.DateTimeFormat().resolvedOptions();
@@ -4517,7 +4517,7 @@ function yc() {
4517
4517
  return;
4518
4518
  }
4519
4519
  }
4520
- const Sc = "GlobalHandlers", bc = ((e = {}) => {
4520
+ const Sc = "GlobalHandlers", Rc = ((e = {}) => {
4521
4521
  const t = {
4522
4522
  onerror: !0,
4523
4523
  onunhandledrejection: !0,
@@ -4532,7 +4532,7 @@ const Sc = "GlobalHandlers", bc = ((e = {}) => {
4532
4532
  t.onerror && (Tc(n), Cn("onerror")), t.onunhandledrejection && (vc(n), Cn("onunhandledrejection"));
4533
4533
  }
4534
4534
  };
4535
- }), Rc = bc;
4535
+ }), bc = Rc;
4536
4536
  function Tc(e) {
4537
4537
  qr((t) => {
4538
4538
  const { stackParser: n, attachStacktrace: r } = kr();
@@ -4619,7 +4619,7 @@ function xc(e) {
4619
4619
  const Cc = () => ({
4620
4620
  name: "HttpContext",
4621
4621
  preprocessEvent(e) {
4622
- if (!R.navigator && !R.location && !R.document)
4622
+ if (!b.navigator && !b.location && !b.document)
4623
4623
  return;
4624
4624
  const t = ia(), n = {
4625
4625
  ...t.headers,
@@ -4631,10 +4631,10 @@ const Cc = () => ({
4631
4631
  headers: n
4632
4632
  };
4633
4633
  }
4634
- }), Nc = "cause", Oc = 5, Dc = "LinkedErrors", Ac = ((e = {}) => {
4635
- const t = e.limit || Oc, n = e.key || Nc;
4634
+ }), Nc = "cause", Dc = 5, Oc = "LinkedErrors", Ac = ((e = {}) => {
4635
+ const t = e.limit || Dc, n = e.key || Nc;
4636
4636
  return {
4637
- name: Dc,
4637
+ name: Oc,
4638
4638
  preprocessEvent(r, s, o) {
4639
4639
  const i = o.getOptions();
4640
4640
  $i(
@@ -4657,13 +4657,13 @@ function Pc() {
4657
4657
  }), !0) : !1;
4658
4658
  }
4659
4659
  function Lc() {
4660
- if (typeof R.window > "u")
4660
+ if (typeof b.window > "u")
4661
4661
  return !1;
4662
- const e = R;
4662
+ const e = b;
4663
4663
  if (e.nw || !(e.chrome || e.browser)?.runtime?.id)
4664
4664
  return !1;
4665
4665
  const n = Se(), r = ["chrome-extension", "moz-extension", "ms-browser-extension", "safari-web-extension"];
4666
- return !(R === R.top && r.some((o) => n.startsWith(`${o}://`)));
4666
+ return !(b === b.top && r.some((o) => n.startsWith(`${o}://`)));
4667
4667
  }
4668
4668
  function Fc(e) {
4669
4669
  return [
@@ -4674,7 +4674,7 @@ function Fc(e) {
4674
4674
  Yi(),
4675
4675
  uc(),
4676
4676
  Za(),
4677
- Rc(),
4677
+ bc(),
4678
4678
  Mc(),
4679
4679
  Gi(),
4680
4680
  Cc(),
@@ -4717,7 +4717,7 @@ class Hc {
4717
4717
  this.txnId = t;
4718
4718
  }
4719
4719
  addBreadcrumb(t, n, r) {
4720
- this.enabled && V({ category: t, message: n, data: r, level: "info", timestamp: Date.now() / 1e3 });
4720
+ this.enabled && j({ category: t, message: n, data: r, level: "info", timestamp: Date.now() / 1e3 });
4721
4721
  }
4722
4722
  captureEvent(t, n) {
4723
4723
  this.enabled && Ho(t, {
@@ -4743,7 +4743,7 @@ const _ = {
4743
4743
  UNAUTHORIZED: 401,
4744
4744
  FORBIDDEN: 403
4745
4745
  };
4746
- var Bc = /* @__PURE__ */ ((e) => (e.NOT_INITIALIZED = "na", e.INIT = "init", e.STOP = "stop", e.COMMIT = "commit", e))(Bc || {}), jc = /* @__PURE__ */ ((e) => (e.START = "start", e.PAUSE = "pause", e.RESUME = "resume", e.STOP = "stop", e))(jc || {}), Vc = /* @__PURE__ */ ((e) => (e.EKA_EMR_TEMPLATE = "eka_emr_template", e.CLINICAL_NOTE_TEMPLATE = "clinical_notes_template", e.TRANSCRIPT_TEMPLATE = "transcript_template", e.EKA_EMR_TO_FHIR_TEMPLATE = "eka_emr_to_fhir_template", e.NIC_TEMPLATE = "nic_template", e))(Vc || {}), Gc = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.FAILURE = "failure", e.PARTIAL_COMPLETE = "partial_complete", e.IN_PROGRESS = "in-progress", e))(Gc || {}), y = /* @__PURE__ */ ((e) => (e.MICROPHONE = "microphone", e.TXN_INIT_FAILED = "txn_init_failed", e.TXN_LIMIT_EXCEEDED = "txn_limit_exceeded", e.INTERNAL_SERVER_ERROR = "internal_server_error", e.END_RECORDING_FAILED = "end_recording_failed", e.AUDIO_UPLOAD_FAILED = "audio_upload_failed", e.TXN_COMMIT_FAILED = "txn_commit_failed", e.TXN_STATUS_MISMATCH = "txn_status_mismatch", e.NETWORK_ERROR = "network_error", e.UNKNOWN_ERROR = "unknown_error", e.UNAUTHORIZED = "unauthorized", e.FORBIDDEN = "forbidden", e))(y || {}), Wc = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.IN_PROGRESS = "in-progress", e.FAILED = "failed", e.CANCELLED = "cancelled", e))(Wc || {}), zc = /* @__PURE__ */ ((e) => (e.AWS_CONFIGURE_STATUS = "aws_configure_status", e.FILE_UPLOAD_STATUS = "file_upload_status", e.TRANSACTION_STATUS = "transaction_status", e.TEMPLATE_OPERATION_STATUS = "template_operation_status", e.AUTHENTICATION_STATUS = "authentication_status", e.NETWORK_STATUS = "network_status", e.STORAGE_STATUS = "storage_status", e))(zc || {}), xt = /* @__PURE__ */ ((e) => (e.JSON = "json", e.TRANSCRIPT = "transcript", e.MARKDOWN = "markdown", e))(xt || {}), z = /* @__PURE__ */ ((e) => (e.INTERNET_CONNECTIVITY = "INTERNET_CONNECTIVITY", e.SYSTEM_INFO = "SYSTEM_INFO", e.MICROPHONE = "MICROPHONE", e.SHARED_WORKER = "SHARED_WORKER", e.NETWORK_API = "NETWORK_API", e))(z || {}), v = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.ERROR = "error", e.WARNING = "warning", e))(v || {});
4746
+ var Bc = /* @__PURE__ */ ((e) => (e.NOT_INITIALIZED = "na", e.INIT = "init", e.STOP = "stop", e.COMMIT = "commit", e))(Bc || {}), Vc = /* @__PURE__ */ ((e) => (e.START = "start", e.PAUSE = "pause", e.RESUME = "resume", e.STOP = "stop", e))(Vc || {}), jc = /* @__PURE__ */ ((e) => (e.EKA_EMR_TEMPLATE = "eka_emr_template", e.CLINICAL_NOTE_TEMPLATE = "clinical_notes_template", e.TRANSCRIPT_TEMPLATE = "transcript_template", e.EKA_EMR_TO_FHIR_TEMPLATE = "eka_emr_to_fhir_template", e.NIC_TEMPLATE = "nic_template", e))(jc || {}), Gc = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.FAILURE = "failure", e.PARTIAL_COMPLETE = "partial_complete", e.IN_PROGRESS = "in-progress", e))(Gc || {}), y = /* @__PURE__ */ ((e) => (e.MICROPHONE = "microphone", e.TXN_INIT_FAILED = "txn_init_failed", e.TXN_LIMIT_EXCEEDED = "txn_limit_exceeded", e.INTERNAL_SERVER_ERROR = "internal_server_error", e.END_RECORDING_FAILED = "end_recording_failed", e.AUDIO_UPLOAD_FAILED = "audio_upload_failed", e.TXN_COMMIT_FAILED = "txn_commit_failed", e.TXN_STATUS_MISMATCH = "txn_status_mismatch", e.NETWORK_ERROR = "network_error", e.UNKNOWN_ERROR = "unknown_error", e.UNAUTHORIZED = "unauthorized", e.FORBIDDEN = "forbidden", e))(y || {}), Wc = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.IN_PROGRESS = "in-progress", e.FAILED = "failed", e.CANCELLED = "cancelled", e))(Wc || {}), zc = /* @__PURE__ */ ((e) => (e.AWS_CONFIGURE_STATUS = "aws_configure_status", e.FILE_UPLOAD_STATUS = "file_upload_status", e.TRANSACTION_STATUS = "transaction_status", e.TEMPLATE_OPERATION_STATUS = "template_operation_status", e.AUTHENTICATION_STATUS = "authentication_status", e.NETWORK_STATUS = "network_status", e.STORAGE_STATUS = "storage_status", e))(zc || {}), xt = /* @__PURE__ */ ((e) => (e.JSON = "json", e.TRANSCRIPT = "transcript", e.MARKDOWN = "markdown", e))(xt || {}), z = /* @__PURE__ */ ((e) => (e.INTERNET_CONNECTIVITY = "INTERNET_CONNECTIVITY", e.SYSTEM_INFO = "SYSTEM_INFO", e.MICROPHONE = "MICROPHONE", e.SHARED_WORKER = "SHARED_WORKER", e.NETWORK_API = "NETWORK_API", e))(z || {}), v = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.ERROR = "error", e.WARNING = "warning", e))(v || {});
4747
4747
  function E(e, t) {
4748
4748
  return e instanceof L ? e.status === 401 ? {
4749
4749
  error_code: y.UNAUTHORIZED,
@@ -5067,7 +5067,7 @@ class qc {
5067
5067
  }
5068
5068
  }
5069
5069
  }
5070
- const Nn = "https://cdn.eka.care/vagus/cmlf0ip4a00000td1dmth2wk3.png", On = "https://cdn.eka.care/vagus/cmlf0j9ea00010td1h3mi6zqk.png", Yt = "3cm", Jt = "3.5cm";
5070
+ const Nn = "https://cdn.eka.care/vagus/cmlf0ip4a00000td1dmth2wk3.png", Dn = "https://cdn.eka.care/vagus/cmlf0j9ea00010td1h3mi6zqk.png", Yt = "3cm", Jt = "3.5cm";
5071
5071
  class Xc {
5072
5072
  constructor(t, n, r) {
5073
5073
  this.transport = t, this.hosts = n, this.allianceClient = r;
@@ -5178,7 +5178,7 @@ class Xc {
5178
5178
  };
5179
5179
  }
5180
5180
  }
5181
- // @deprecated
5181
+ /** @deprecated Backward compatible */
5182
5182
  async updateResultSummary({
5183
5183
  txnId: t,
5184
5184
  data: n
@@ -5347,7 +5347,7 @@ class Xc {
5347
5347
  header_img: Nn,
5348
5348
  header_height: Yt,
5349
5349
  header_top_margin: null,
5350
- footer_img: On,
5350
+ footer_img: Dn,
5351
5351
  footer_height: Jt,
5352
5352
  margin_left: null,
5353
5353
  margin_right: null,
@@ -5369,7 +5369,7 @@ class Xc {
5369
5369
  header_img: t.header_img || Nn,
5370
5370
  header_height: t.header_img && t.header_height || Yt,
5371
5371
  header_top_margin: t.header_top_margin || null,
5372
- footer_img: t.footer_img || On,
5372
+ footer_img: t.footer_img || Dn,
5373
5373
  footer_height: t.footer_img && t.footer_height || Jt,
5374
5374
  margin_left: t.margin_left || null,
5375
5375
  margin_right: t.margin_right || null,
@@ -5433,7 +5433,7 @@ class Kc {
5433
5433
  message: "Transaction initialized successfully.",
5434
5434
  txn_id: r.data.session_id
5435
5435
  }) : {
5436
- error_code: r.error.code === "rate_limit_exceeded" ? y.TXN_LIMIT_EXCEEDED : y.TXN_INIT_FAILED,
5436
+ error_code: r.error.code === "txn_limit_exceeded" ? y.TXN_LIMIT_EXCEEDED : y.TXN_INIT_FAILED,
5437
5437
  status_code: r.error.httpStatus ?? _.INTERNAL_SERVER_ERROR,
5438
5438
  message: r.error.message || "Transaction initialization failed."
5439
5439
  };
@@ -5445,6 +5445,32 @@ class Kc {
5445
5445
  };
5446
5446
  }
5447
5447
  }
5448
+ async startRecordingV2(t) {
5449
+ try {
5450
+ this.allianceClient.clearRecordingState(), this.tracker.addBreadcrumb("recording", "startRecordingV2", {
5451
+ sessionId: t.sessionId
5452
+ });
5453
+ const n = await this.allianceClient.startRecording(t);
5454
+ return n.success ? (this.storedSession = n.data, this.txnID = n.data.session_id, this.tracker.setTransactionId(this.txnID), this.tracker.captureEvent("Session started (v2)", {
5455
+ txn_id: this.txnID,
5456
+ status_code: n.httpStatus ?? _.SUCCESS
5457
+ }), {
5458
+ status_code: n.httpStatus ?? _.SUCCESS,
5459
+ message: "Recording started successfully.",
5460
+ txn_id: n.data.session_id
5461
+ }) : {
5462
+ error_code: n.error.code === "txn_limit_exceeded" ? y.TXN_LIMIT_EXCEEDED : y.TXN_INIT_FAILED,
5463
+ status_code: n.error.httpStatus ?? _.INTERNAL_SERVER_ERROR,
5464
+ message: n.error.message || "Failed to start recording."
5465
+ };
5466
+ } catch (n) {
5467
+ return {
5468
+ error_code: y.INTERNAL_SERVER_ERROR,
5469
+ status_code: _.INTERNAL_SERVER_ERROR,
5470
+ message: `Failed to start recording. ${n}`
5471
+ };
5472
+ }
5473
+ }
5448
5474
  // Backward compatible - ideally it should call startRecording() of Alliance SDK directly
5449
5475
  async startRecording(t) {
5450
5476
  try {
@@ -5549,11 +5575,16 @@ class Kc {
5549
5575
  txn_id: this.txnID,
5550
5576
  total_files: t.data.totalFiles,
5551
5577
  failed_files: t.data.failedUploads.length
5552
- }), this.storedSession = null, {
5578
+ }), this.storedSession = null, t.data.failedUploads.length > 0 ? {
5579
+ error_code: y.AUDIO_UPLOAD_FAILED,
5553
5580
  status_code: t.httpStatus ?? _.SUCCESS,
5554
- message: "Recording ended successfully.",
5581
+ message: `Recording ended but ${t.data.failedUploads.length} audio file(s) failed to upload.`,
5555
5582
  failed_files: t.data.failedUploads,
5556
5583
  total_audio_files: t.data.endSessionResponse?.audio_files
5584
+ } : {
5585
+ status_code: t.httpStatus ?? _.SUCCESS,
5586
+ message: "Recording ended successfully.",
5587
+ total_audio_files: t.data.endSessionResponse?.audio_files
5557
5588
  }) : (this.tracker.captureEvent("Session end failed", {
5558
5589
  txn_id: this.txnID,
5559
5590
  error: t.error.message
@@ -5576,7 +5607,7 @@ class Kc {
5576
5607
  return {
5577
5608
  success: !1,
5578
5609
  status_code: _.TXN_ERROR,
5579
- error: new De(
5610
+ error: new Oe(
5580
5611
  "No session ID available. Call initTransaction() first or pass a sessionId.",
5581
5612
  y.TXN_STATUS_MISMATCH
5582
5613
  )
@@ -5613,7 +5644,7 @@ class Kc {
5613
5644
  return {
5614
5645
  success: !1,
5615
5646
  status_code: _.TXN_ERROR,
5616
- error: new De(
5647
+ error: new Oe(
5617
5648
  "No session ID available. Call initTransaction() first or pass a sessionId.",
5618
5649
  y.TXN_STATUS_MISMATCH
5619
5650
  )
@@ -5652,7 +5683,6 @@ class Kc {
5652
5683
  };
5653
5684
  }
5654
5685
  }
5655
- /** @deprecated Backward compatible */
5656
5686
  async commitTransactionCall() {
5657
5687
  try {
5658
5688
  if (!this.txnID)
@@ -5683,7 +5713,6 @@ class Kc {
5683
5713
  };
5684
5714
  }
5685
5715
  }
5686
- /** @deprecated Backward compatible */
5687
5716
  async stopTransactionCall() {
5688
5717
  try {
5689
5718
  if (!this.txnID)
@@ -5714,7 +5743,7 @@ class Kc {
5714
5743
  await this.allianceClient.reset(), this.txnID = "", this.storedSession = null;
5715
5744
  }
5716
5745
  }
5717
- const Dn = (e) => {
5746
+ const On = (e) => {
5718
5747
  try {
5719
5748
  return JSON.parse(e);
5720
5749
  } catch {
@@ -5734,14 +5763,14 @@ const Dn = (e) => {
5734
5763
  const n = Yc(t);
5735
5764
  switch (e) {
5736
5765
  case xt.JSON:
5737
- return Dn(n);
5766
+ return On(n);
5738
5767
  case xt.TRANSCRIPT:
5739
5768
  case xt.MARKDOWN:
5740
5769
  return n;
5741
5770
  default:
5742
- return Dn(n);
5771
+ return On(n);
5743
5772
  }
5744
- }, Rt = (e) => e?.length ? e.map((t) => {
5773
+ }, bt = (e) => e?.length ? e.map((t) => {
5745
5774
  const { value: n } = t;
5746
5775
  return typeof n != "string" ? { ...t, value: n ?? null } : {
5747
5776
  ...t,
@@ -5814,20 +5843,20 @@ class Zc {
5814
5843
  return s && p.push(`template_id=${s}`), o && p.push(`document_id=${o}`), i && p.push("dlp=true"), p.join("&");
5815
5844
  }, h = async () => {
5816
5845
  try {
5817
- const p = l(), b = await this.fetchV3Status(n, p, 2e4), { status_code: T, response: O } = b;
5846
+ const p = l(), R = await this.fetchV3Status(n, p, 2e4), { status_code: T, response: D } = R;
5818
5847
  if (Date.now() >= u)
5819
5848
  return c(500, null, "Timeout while fetching analysis results.", "timeout");
5820
5849
  if (T === 401 || T === 403)
5821
5850
  return c(
5822
5851
  T,
5823
- O ?? null,
5852
+ D ?? null,
5824
5853
  "Unauthorized or Forbidden",
5825
5854
  "failed"
5826
5855
  );
5827
5856
  if (T === 202 || T === 400 || T >= 500) {
5828
- if (T === 202 && O && a?.({
5857
+ if (T === 202 && D && a?.({
5829
5858
  txn_id: n,
5830
- response: O,
5859
+ response: D,
5831
5860
  status_code: T,
5832
5861
  message: "Partial result received",
5833
5862
  poll_status: "in-progress"
@@ -5836,7 +5865,7 @@ class Zc {
5836
5865
  return c(
5837
5866
  T,
5838
5867
  null,
5839
- O?.error?.message || "Backend error while fetching results.",
5868
+ D?.error?.message || "Backend error while fetching results.",
5840
5869
  "failed"
5841
5870
  );
5842
5871
  } else
@@ -5845,7 +5874,7 @@ class Zc {
5845
5874
  }
5846
5875
  return c(
5847
5876
  T,
5848
- O ?? null,
5877
+ D ?? null,
5849
5878
  "Template results generated successfully.",
5850
5879
  "success"
5851
5880
  );
@@ -5881,12 +5910,12 @@ class Zc {
5881
5910
  ...t,
5882
5911
  data: {
5883
5912
  ...n,
5884
- output: Rt(n.output),
5913
+ output: bt(n.output),
5885
5914
  template_results: {
5886
5915
  ...n.template_results ?? {},
5887
- integration: Rt(n.template_results?.integration),
5888
- custom: Rt(n.template_results?.custom),
5889
- transcript: Rt(n.template_results?.transcript)
5916
+ integration: bt(n.template_results?.integration),
5917
+ custom: bt(n.template_results?.custom),
5918
+ transcript: bt(n.template_results?.transcript)
5890
5919
  }
5891
5920
  }
5892
5921
  };
@@ -6473,8 +6502,8 @@ function ou(e, t) {
6473
6502
  }
6474
6503
  function i(c) {
6475
6504
  if (!s) return;
6476
- const u = "touches" in c ? c.touches[0].clientX : c.clientX, d = "touches" in c ? c.touches[0].clientY : c.clientY, l = window.innerWidth - e.offsetWidth, h = window.innerHeight - e.offsetHeight, p = Math.min(Math.max(0, u - n), l), b = Math.min(Math.max(0, d - r), h);
6477
- e.style.left = `${p}px`, e.style.top = `${b}px`, c.preventDefault();
6505
+ const u = "touches" in c ? c.touches[0].clientX : c.clientX, d = "touches" in c ? c.touches[0].clientY : c.clientY, l = window.innerWidth - e.offsetWidth, h = window.innerHeight - e.offsetHeight, p = Math.min(Math.max(0, u - n), l), R = Math.min(Math.max(0, d - r), h);
6506
+ e.style.left = `${p}px`, e.style.top = `${R}px`, c.preventDefault();
6478
6507
  }
6479
6508
  function a() {
6480
6509
  s = !1, document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", a), document.removeEventListener("touchmove", i), document.removeEventListener("touchend", a);
@@ -6663,26 +6692,24 @@ class pu {
6663
6692
  }
6664
6693
  this.isStarting = !0;
6665
6694
  try {
6666
- const r = this.config.sessionDefaults, s = await this.sdk.initTransaction({
6667
- txn_id: t.txn_id,
6668
- mode: r.mode,
6669
- input_language: r.input_language,
6670
- output_format_template: r.output_format_template,
6671
- model_type: r.model_type,
6672
- patient_details: t.patient_details,
6673
- additional_data: t.additional_data
6695
+ const r = this.config.sessionDefaults, s = await this.sdk.startRecordingV2({
6696
+ templates: r.output_format_template.map((o) => o.template_id),
6697
+ sessionMode: r.mode,
6698
+ languageHint: r.input_language,
6699
+ model: r.model_type,
6700
+ sessionId: t.txn_id,
6701
+ patientDetails: t.patient_details ? {
6702
+ name: t.patient_details.username,
6703
+ age: t.patient_details.age != null ? String(t.patient_details.age) : void 0,
6704
+ gender: t.patient_details.biologicalSex
6705
+ } : void 0,
6706
+ additionalData: t.additional_data
6674
6707
  });
6675
6708
  if (s.error_code) {
6676
6709
  this.showError(s.error_code, s.message);
6677
6710
  return;
6678
6711
  }
6679
- this.currentTxnId = s.txn_id || t.txn_id;
6680
- const o = await this.sdk.startRecording();
6681
- if (o.error_code) {
6682
- this.showError(o.error_code, o.message);
6683
- return;
6684
- }
6685
- this.stateMachine.transition(f.RECORDING), this.renderer.renderState(f.RECORDING), this.timer.start(), this.callbacks.onRecordingStart?.({ txn_id: this.currentTxnId });
6712
+ this.currentTxnId = s.txn_id || t.txn_id, this.stateMachine.transition(f.RECORDING), this.renderer.renderState(f.RECORDING), this.timer.start(), this.callbacks.onRecordingStart?.({ txn_id: this.currentTxnId });
6686
6713
  } catch (r) {
6687
6714
  this.showError(
6688
6715
  "unexpected_error",
@@ -6777,7 +6804,7 @@ const k = class k {
6777
6804
  flavour: t.flavour,
6778
6805
  onUnauthorized: () => this.handleUnauthorized()
6779
6806
  };
6780
- if (t.mode === "ipc" && t.ipcBridge ? this.transport = new Ar(n, t.ipcBridge) : this.transport = new Or(n), t.enableTracking && (this.tracker.init(t.env), t.flavour && this.tracker.setUser(t.flavour)), !t.allianceConfig?.baseUrl)
6807
+ if (t.mode === "ipc" && t.ipcBridge ? this.transport = new Ar(n, t.ipcBridge) : this.transport = new Dr(n), t.enableTracking && (this.tracker.init(t.env), t.flavour && this.tracker.setUser(t.flavour)), !t.allianceConfig?.baseUrl)
6781
6808
  throw new Error("[EkaScribe] allianceConfig.baseUrl is required.");
6782
6809
  this.allianceClient = new Cr({
6783
6810
  baseUrl: t.allianceConfig.baseUrl,
@@ -6823,10 +6850,17 @@ const k = class k {
6823
6850
  initTransaction(t) {
6824
6851
  return this.recording.initTransaction(t);
6825
6852
  }
6826
- // TODO: change to createSession with startRecording
6853
+ /** @deprecated Backward compatible */
6827
6854
  startRecording(t) {
6828
6855
  return this.recording.startRecording(t);
6829
6856
  }
6857
+ /**
6858
+ * Creates a session and starts recording in one step.
6859
+ * This is the recommended method for new integrations.
6860
+ */
6861
+ startRecordingV2(t) {
6862
+ return this.recording.startRecordingV2(t);
6863
+ }
6830
6864
  startRecordingForExistingSession(t) {
6831
6865
  return this.recording.startRecordingForExistingSession(t);
6832
6866
  }
@@ -6836,7 +6870,6 @@ const k = class k {
6836
6870
  resumeRecording() {
6837
6871
  return this.recording.resumeRecording();
6838
6872
  }
6839
- // TODO: change to endSession
6840
6873
  endRecording() {
6841
6874
  return this.recording.endRecording();
6842
6875
  }
@@ -6932,9 +6965,9 @@ export {
6932
6965
  y as ERROR_CODE,
6933
6966
  Wc as PROCESSING_STATUS,
6934
6967
  Gc as RESULT_STATUS,
6935
- Vc as TEMPLATE_ID,
6968
+ jc as TEMPLATE_ID,
6936
6969
  xt as TEMPLATE_TYPE,
6937
- jc as VAD_STATUS,
6970
+ Vc as VAD_STATUS,
6938
6971
  f as WidgetState,
6939
6972
  _u as createWorkerBlobUrl,
6940
6973
  fu as getEkaScribeInstance,