@eka-care/ekascribe-ts-sdk 3.0.53 → 3.0.54

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.d.ts CHANGED
@@ -278,6 +278,8 @@ export declare enum RESULT_STATUS {
278
278
 
279
279
  export { SDKResult }
280
280
 
281
+ export { SessionUploadInfo }
282
+
281
283
  declare class SessionUtils {
282
284
  private transport;
283
285
  private hosts;
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ var Ls = Object.defineProperty;
2
2
  var Ms = (t, e, n) => e in t ? Ls(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var w = (t, e, n) => Ms(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  import { SessionStatus as Fs, ScribeError as yn, UploadError as Us, ScribeClient as Bs, TransportMode as En } from "med-scribe-alliance-ts-sdk";
5
- import { createWorkerBlobUrl as kd, getWorkerUrl as xd } from "med-scribe-alliance-ts-sdk";
5
+ import { createWorkerBlobUrl as Rd, getWorkerUrl as wd } from "med-scribe-alliance-ts-sdk";
6
6
  function Ir() {
7
7
  try {
8
8
  return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
@@ -309,8 +309,8 @@ const m = {
309
309
  warn: ei,
310
310
  /** Log an error. */
311
311
  error: ti
312
- }, Dr = 50, oe = "?", bn = /\(error: (.*)\)/, Sn = /captureMessage|captureException/;
313
- function Nr(...t) {
312
+ }, Nr = 50, oe = "?", bn = /\(error: (.*)\)/, Sn = /captureMessage|captureException/;
313
+ function Dr(...t) {
314
314
  const e = t.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
315
315
  return (n, r = 0, s = 0) => {
316
316
  const i = [], o = n.split(`
@@ -327,7 +327,7 @@ function Nr(...t) {
327
327
  break;
328
328
  }
329
329
  }
330
- if (i.length >= Dr + s)
330
+ if (i.length >= Nr + s)
331
331
  break;
332
332
  }
333
333
  }
@@ -335,13 +335,13 @@ function Nr(...t) {
335
335
  };
336
336
  }
337
337
  function ni(t) {
338
- return Array.isArray(t) ? Nr(...t) : t;
338
+ return Array.isArray(t) ? Dr(...t) : t;
339
339
  }
340
340
  function ri(t) {
341
341
  if (!t.length)
342
342
  return [];
343
343
  const e = Array.from(t);
344
- return /sentryWrapped/.test(Me(e).function || "") && e.pop(), e.reverse(), Sn.test(Me(e).function || "") && (e.pop(), Sn.test(Me(e).function || "") && e.pop()), e.slice(0, Dr).map((n) => ({
344
+ return /sentryWrapped/.test(Me(e).function || "") && e.pop(), e.reverse(), Sn.test(Me(e).function || "") && (e.pop(), Sn.test(Me(e).function || "") && e.pop()), e.slice(0, Nr).map((n) => ({
345
345
  ...n,
346
346
  filename: n.filename || Me(e).filename,
347
347
  function: n.function || oe
@@ -475,7 +475,7 @@ function li(t) {
475
475
  function ui(t) {
476
476
  return Ee(t, "RegExp");
477
477
  }
478
- function De(t) {
478
+ function Ne(t) {
479
479
  return !!(t?.then && typeof t.then == "function");
480
480
  }
481
481
  function di(t) {
@@ -742,13 +742,13 @@ function yi(t) {
742
742
  }
743
743
  }
744
744
  const zr = 1e3;
745
- function Ne() {
745
+ function De() {
746
746
  return ct() / zr;
747
747
  }
748
748
  function Ei() {
749
749
  const { performance: t } = R;
750
750
  if (!t?.now || !t.timeOrigin)
751
- return Ne;
751
+ return De;
752
752
  const e = t.timeOrigin;
753
753
  return () => (e + at(() => t.now())) / zr;
754
754
  }
@@ -822,10 +822,10 @@ function jr() {
822
822
  return P().substring(16);
823
823
  }
824
824
  const Ct = "_sentrySpan";
825
- function Dn(t, e) {
825
+ function Nn(t, e) {
826
826
  e ? Y(t, Ct, e) : delete t[Ct];
827
827
  }
828
- function Nn(t) {
828
+ function Dn(t) {
829
829
  return t[Ct];
830
830
  }
831
831
  const xi = 100;
@@ -871,7 +871,7 @@ class B {
871
871
  const e = new B();
872
872
  return e._breadcrumbs = [...this._breadcrumbs], e._tags = { ...this._tags }, e._attributes = { ...this._attributes }, e._extra = { ...this._extra }, e._contexts = { ...this._contexts }, this._contexts.flags && (e._contexts.flags = {
873
873
  values: [...this._contexts.flags.values]
874
- }), e._user = this._user, e._level = this._level, e._session = this._session, e._transactionName = this._transactionName, e._fingerprint = this._fingerprint, e._eventProcessors = [...this._eventProcessors], e._attachments = [...this._attachments], e._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, e._propagationContext = { ...this._propagationContext }, e._client = this._client, e._lastEventId = this._lastEventId, e._conversationId = this._conversationId, Dn(e, Nn(this)), e;
874
+ }), e._user = this._user, e._level = this._level, e._session = this._session, e._transactionName = this._transactionName, e._fingerprint = this._fingerprint, e._eventProcessors = [...this._eventProcessors], e._attachments = [...this._attachments], e._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, e._propagationContext = { ...this._propagationContext }, e._client = this._client, e._lastEventId = this._lastEventId, e._conversationId = this._conversationId, Nn(e, Dn(this)), e;
875
875
  }
876
876
  /**
877
877
  * Update the client assigned to this scope.
@@ -1109,7 +1109,7 @@ class B {
1109
1109
  * Note: The client will not be cleared.
1110
1110
  */
1111
1111
  clear() {
1112
- return this._breadcrumbs = [], this._tags = {}, this._attributes = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._session = void 0, this._conversationId = void 0, Dn(this, void 0), this._attachments = [], this.setPropagationContext({
1112
+ return this._breadcrumbs = [], this._tags = {}, this._attributes = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._session = void 0, this._conversationId = void 0, Nn(this, void 0), this._attachments = [], this.setPropagationContext({
1113
1113
  traceId: An(),
1114
1114
  sampleRand: Ze()
1115
1115
  }), this._notifyScopeListeners(), this;
@@ -1123,7 +1123,7 @@ class B {
1123
1123
  if (r <= 0)
1124
1124
  return this;
1125
1125
  const s = {
1126
- timestamp: Ne(),
1126
+ timestamp: De(),
1127
1127
  ...e,
1128
1128
  // Breadcrumb messages can theoretically be infinitely large and they're held in memory so we truncate them not to leak (too much) memory
1129
1129
  message: e.message ? vt(e.message, 2048) : e.message
@@ -1172,7 +1172,7 @@ class B {
1172
1172
  propagationContext: this._propagationContext,
1173
1173
  sdkProcessingMetadata: this._sdkProcessingMetadata,
1174
1174
  transactionName: this._transactionName,
1175
- span: Nn(this),
1175
+ span: Dn(this),
1176
1176
  conversationId: this._conversationId
1177
1177
  };
1178
1178
  }
@@ -1279,7 +1279,7 @@ class Ti {
1279
1279
  } catch (s) {
1280
1280
  throw this._popScope(), s;
1281
1281
  }
1282
- return De(r) ? r.then(
1282
+ return Ne(r) ? r.then(
1283
1283
  (s) => (this._popScope(), s),
1284
1284
  (s) => {
1285
1285
  throw this._popScope(), s;
@@ -1366,7 +1366,7 @@ function J() {
1366
1366
  function Ai() {
1367
1367
  return _e("globalScope", () => new B());
1368
1368
  }
1369
- function Di(...t) {
1369
+ function Ni(...t) {
1370
1370
  const e = nt(), n = Qt(e);
1371
1371
  if (t.length === 2) {
1372
1372
  const [r, s] = t;
@@ -1377,7 +1377,7 @@ function Di(...t) {
1377
1377
  function C() {
1378
1378
  return H().getClient();
1379
1379
  }
1380
- function Ni(t) {
1380
+ function Di(t) {
1381
1381
  const e = t.getPropagationContext(), { traceId: n, parentSpanId: r, propagationSpanId: s } = e, i = {
1382
1382
  trace_id: n,
1383
1383
  span_id: s || jr()
@@ -1760,7 +1760,7 @@ function ko(t, e) {
1760
1760
  const [n, r] = t;
1761
1761
  return [n, [...r, e]];
1762
1762
  }
1763
- function Dt(t, e) {
1763
+ function Nt(t, e) {
1764
1764
  const n = t[1];
1765
1765
  for (const r of n) {
1766
1766
  const s = r[0].type;
@@ -1770,9 +1770,9 @@ function Dt(t, e) {
1770
1770
  return !1;
1771
1771
  }
1772
1772
  function xo(t, e) {
1773
- return Dt(t, (n, r) => e.includes(r));
1773
+ return Nt(t, (n, r) => e.includes(r));
1774
1774
  }
1775
- function Nt(t) {
1775
+ function Dt(t) {
1776
1776
  const e = rt(R);
1777
1777
  return e.encodePolyfill ? e.encodePolyfill(t) : new TextEncoder().encode(t);
1778
1778
  }
@@ -1780,7 +1780,7 @@ function Ro(t) {
1780
1780
  const [e, n] = t;
1781
1781
  let r = JSON.stringify(e);
1782
1782
  function s(i) {
1783
- typeof r == "string" ? r = typeof i == "string" ? r + i : [Nt(r), i] : r.push(typeof i == "string" ? Nt(i) : i);
1783
+ typeof r == "string" ? r = typeof i == "string" ? r + i : [Dt(r), i] : r.push(typeof i == "string" ? Dt(i) : i);
1784
1784
  }
1785
1785
  for (const i of n) {
1786
1786
  const [o, a] = i;
@@ -1808,7 +1808,7 @@ function wo(t) {
1808
1808
  return n;
1809
1809
  }
1810
1810
  function To(t) {
1811
- const e = typeof t.data == "string" ? Nt(t.data) : t.data;
1811
+ const e = typeof t.data == "string" ? Dt(t.data) : t.data;
1812
1812
  return [
1813
1813
  {
1814
1814
  type: "attachment",
@@ -1885,7 +1885,7 @@ function Ao(t, e, n, r) {
1885
1885
  }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
1886
1886
  return be(i, [o]);
1887
1887
  }
1888
- function Do(t, e, n, r) {
1888
+ function No(t, e, n, r) {
1889
1889
  const s = Jr(n), i = t.type && t.type !== "replay_event" ? t.type : "event";
1890
1890
  Co(t, n?.sdk);
1891
1891
  const o = Io(t, s, r, e);
@@ -1971,7 +1971,7 @@ class Ce {
1971
1971
  _runExecutor(e) {
1972
1972
  const n = (i, o) => {
1973
1973
  if (this._state === yt) {
1974
- if (De(o)) {
1974
+ if (Ne(o)) {
1975
1975
  o.then(r, s);
1976
1976
  return;
1977
1977
  }
@@ -1989,10 +1989,10 @@ class Ce {
1989
1989
  }
1990
1990
  }
1991
1991
  }
1992
- function No(t, e, n, r = 0) {
1992
+ function Do(t, e, n, r = 0) {
1993
1993
  try {
1994
1994
  const s = Ot(e, n, t, r);
1995
- return De(s) ? s : Pe(s);
1995
+ return Ne(s) ? s : Pe(s);
1996
1996
  } catch (s) {
1997
1997
  return nn(s);
1998
1998
  }
@@ -2002,7 +2002,7 @@ function Ot(t, e, n, r) {
2002
2002
  if (!t || !s)
2003
2003
  return t;
2004
2004
  const i = s({ ...t }, e);
2005
- return _ && i === null && m.log(`Event processor "${s.id || "?"}" dropped event`), De(i) ? i.then((o) => Ot(o, e, n, r + 1)) : Ot(i, e, n, r + 1);
2005
+ return _ && i === null && m.log(`Event processor "${s.id || "?"}" dropped event`), Ne(i) ? i.then((o) => Ot(o, e, n, r + 1)) : Ot(i, e, n, r + 1);
2006
2006
  }
2007
2007
  let Q, qn, Gn, G;
2008
2008
  function Oo(t) {
@@ -2094,7 +2094,7 @@ function Bo(t, e, n, r, s, i) {
2094
2094
  const { normalizeDepth: o = 3, normalizeMaxBreadth: a = 1e3 } = t, c = {
2095
2095
  ...e,
2096
2096
  event_id: e.event_id || n.event_id || P(),
2097
- timestamp: e.timestamp || Ne()
2097
+ timestamp: e.timestamp || De()
2098
2098
  }, l = n.integrations || t.integrations.map((A) => A.name);
2099
2099
  Ho(c, t), qo(c, l), s && s.emit("applyFrameMetadata", e), e.type === void 0 && zo(c, t.stackParser);
2100
2100
  const d = Vo(r, n.captureContext);
@@ -2106,7 +2106,7 @@ function Bo(t, e, n, r, s, i) {
2106
2106
  // Run scope event processors _after_ all other processors
2107
2107
  ...p.eventProcessors
2108
2108
  ];
2109
- return (n.data && n.data.__sentry__ === !0 ? Pe(c) : No(f, c, n)).then((A) => (A && jo(A), typeof o == "number" && o > 0 ? Go(A, o, a) : A));
2109
+ return (n.data && n.data.__sentry__ === !0 ? Pe(c) : Do(f, c, n)).then((A) => (A && jo(A), typeof o == "number" && o > 0 ? Go(A, o, a) : A));
2110
2110
  }
2111
2111
  function Ho(t, e) {
2112
2112
  const { environment: n, release: r, dist: s, maxValueLength: i } = e;
@@ -2448,7 +2448,7 @@ function ya(t, e, n = sn(
2448
2448
  const s = (o) => n.drain(o);
2449
2449
  function i(o) {
2450
2450
  const a = [];
2451
- if (Dt(o, (u, p) => {
2451
+ if (Nt(o, (u, p) => {
2452
2452
  const h = Hn(p);
2453
2453
  ma(r, h) ? t.recordDroppedEvent("ratelimit_backoff", h) : a.push(u);
2454
2454
  }), a.length === 0)
@@ -2458,7 +2458,7 @@ function ya(t, e, n = sn(
2458
2458
  _ && m.warn(`Dropping client report. Will not send outcomes (reason: ${u}).`);
2459
2459
  return;
2460
2460
  }
2461
- Dt(c, (p, h) => {
2461
+ Nt(c, (p, h) => {
2462
2462
  t.recordDroppedEvent(u, Hn(h));
2463
2463
  });
2464
2464
  }, d = () => e({ body: Ro(c) }).then(
@@ -2487,7 +2487,7 @@ function Ea(t, e, n) {
2487
2487
  const r = [
2488
2488
  { type: "client_report" },
2489
2489
  {
2490
- timestamp: Ne(),
2490
+ timestamp: De(),
2491
2491
  discarded_events: t
2492
2492
  }
2493
2493
  ];
@@ -2784,7 +2784,7 @@ class xa {
2784
2784
  */
2785
2785
  sendEvent(e, n = {}) {
2786
2786
  this.emit("beforeSendEvent", e, n);
2787
- let r = Do(e, this._dsn, this._options._metadata, this._options.tunnel);
2787
+ let r = No(e, this._dsn, this._options._metadata, this._options.tunnel);
2788
2788
  for (const s of n.attachments || [])
2789
2789
  r = ko(r, To(s));
2790
2790
  this.sendEnvelope(r).then((s) => this.emit("afterSendEvent", e, s));
@@ -2932,7 +2932,7 @@ class xa {
2932
2932
  if (a === null)
2933
2933
  return a;
2934
2934
  this.emit("postprocessEvent", a, n), a.contexts = {
2935
- trace: { ...a.contexts?.trace, ...Ni(r) },
2935
+ trace: { ...a.contexts?.trace, ...Di(r) },
2936
2936
  ...a.contexts
2937
2937
  };
2938
2938
  const c = go(this, r);
@@ -2995,15 +2995,15 @@ class xa {
2995
2995
  }
2996
2996
  const f = r.getSession() || s.getSession();
2997
2997
  if (c && f && this._updateSessionFromEvent(f, h), a) {
2998
- const N = h.sdkProcessingMetadata?.spanCountBeforeProcessing || 0, A = h.spans ? h.spans.length : 0, ke = N - A;
2998
+ const D = h.sdkProcessingMetadata?.spanCountBeforeProcessing || 0, A = h.spans ? h.spans.length : 0, ke = D - A;
2999
2999
  ke > 0 && this.recordDroppedEvent("before_send", "span", ke);
3000
3000
  }
3001
3001
  const k = h.transaction_info;
3002
3002
  if (a && k && h.transaction !== e.transaction) {
3003
- const N = "custom";
3003
+ const D = "custom";
3004
3004
  h.transaction_info = {
3005
3005
  ...k,
3006
- source: N
3006
+ source: D
3007
3007
  };
3008
3008
  }
3009
3009
  return this.sendEvent(h, n), h;
@@ -3073,7 +3073,7 @@ function tr(t) {
3073
3073
  }
3074
3074
  function Ra(t, e) {
3075
3075
  const n = `${e} must return \`null\` or a valid event.`;
3076
- if (De(t))
3076
+ if (Ne(t))
3077
3077
  return t.then(
3078
3078
  (r) => {
3079
3079
  if (!Ie(r) && r !== null)
@@ -3190,7 +3190,7 @@ function St(t) {
3190
3190
  // everything minus origin
3191
3191
  };
3192
3192
  }
3193
- function Da(t, e = !0) {
3193
+ function Na(t, e = !0) {
3194
3194
  if (t.startsWith("data:")) {
3195
3195
  const n = t.match(/^data:([^;,]+)/), r = n ? n[1] : "text/plain", s = t.includes(";base64,"), i = t.indexOf(",");
3196
3196
  let o = "";
@@ -3202,7 +3202,7 @@ function Da(t, e = !0) {
3202
3202
  }
3203
3203
  return t;
3204
3204
  }
3205
- function Na(t) {
3205
+ function Da(t) {
3206
3206
  "aggregates" in t ? t.attrs?.ip_address === void 0 && (t.attrs = {
3207
3207
  ...t.attrs,
3208
3208
  ip_address: "{{auto}}"
@@ -3221,7 +3221,7 @@ function Z(t, e) {
3221
3221
  if (!n) return;
3222
3222
  const { beforeBreadcrumb: s = null, maxBreadcrumbs: i = $a } = n.getOptions();
3223
3223
  if (i <= 0) return;
3224
- const a = { timestamp: Ne(), ...t }, c = s ? ye(() => s(a, e)) : a;
3224
+ const a = { timestamp: De(), ...t }, c = s ? ye(() => s(a, e)) : a;
3225
3225
  c !== null && (n.emit && n.emit("beforeAddBreadcrumb", c, e), r.addBreadcrumb(c, i));
3226
3226
  }
3227
3227
  let sr;
@@ -3680,7 +3680,7 @@ function me(t, e = {}) {
3680
3680
  const i = s.map((o) => me(o, e));
3681
3681
  return t.apply(this, i);
3682
3682
  } catch (i) {
3683
- throw mc(), Di((o) => {
3683
+ throw mc(), Ni((o) => {
3684
3684
  o.addEventProcessor((a) => (e.mechanism && (It(a, void 0), he(a, e.mechanism)), a.extra = {
3685
3685
  ...a.extra,
3686
3686
  arguments: s
@@ -3868,7 +3868,7 @@ class Cc extends xa {
3868
3868
  } = this._options, l = c ?? a?.enableMetrics ?? !0;
3869
3869
  T.document && (i || o || l) && T.document.addEventListener("visibilitychange", () => {
3870
3870
  T.document.visibilityState === "hidden" && (i && this._flushOutcomes(), o && $t(this), l && os(this));
3871
- }), s && this.on("beforeSendSession", Na);
3871
+ }), s && this.on("beforeSendSession", Da);
3872
3872
  }
3873
3873
  /**
3874
3874
  * @inheritDoc
@@ -3899,17 +3899,17 @@ function Ac(t) {
3899
3899
  ...t
3900
3900
  };
3901
3901
  }
3902
- const Dc = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, D = R, Nc = 1e3;
3902
+ const Nc = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, N = R, Dc = 1e3;
3903
3903
  let dr, Bt, Ht;
3904
3904
  function Oc(t) {
3905
3905
  ce("dom", t), le("dom", $c);
3906
3906
  }
3907
3907
  function $c() {
3908
- if (!D.document)
3908
+ if (!N.document)
3909
3909
  return;
3910
3910
  const t = F.bind(null, "dom"), e = pr(t, !0);
3911
- D.document.addEventListener("click", e, !1), D.document.addEventListener("keypress", e, !1), ["EventTarget", "Node"].forEach((n) => {
3912
- const s = D[n]?.prototype;
3911
+ N.document.addEventListener("click", e, !1), N.document.addEventListener("keypress", e, !1), ["EventTarget", "Node"].forEach((n) => {
3912
+ const s = N[n]?.prototype;
3913
3913
  s?.hasOwnProperty?.("addEventListener") && ($(s, "addEventListener", function(i) {
3914
3914
  return function(o, a, c) {
3915
3915
  if (o === "click" || o == "keypress")
@@ -3963,9 +3963,9 @@ function pr(t, e = !1) {
3963
3963
  return;
3964
3964
  Y(n, "_sentryCaptured", !0), r && !r._sentryId && Y(r, "_sentryId", P());
3965
3965
  const s = n.type === "keypress" ? "input" : n.type;
3966
- Pc(n) || (t({ event: n, name: s, global: e }), Bt = n.type, Ht = r ? r._sentryId : void 0), clearTimeout(dr), dr = D.setTimeout(() => {
3966
+ Pc(n) || (t({ event: n, name: s, global: e }), Bt = n.type, Ht = r ? r._sentryId : void 0), clearTimeout(dr), dr = N.setTimeout(() => {
3967
3967
  Ht = void 0, Bt = void 0;
3968
- }, Nc);
3968
+ }, Dc);
3969
3969
  };
3970
3970
  }
3971
3971
  function Mc(t) {
@@ -3981,8 +3981,8 @@ function Ss(t) {
3981
3981
  ce(e, t), le(e, Fc);
3982
3982
  }
3983
3983
  function Fc() {
3984
- if (D.addEventListener("popstate", () => {
3985
- const e = D.location.href, n = Fe;
3984
+ if (N.addEventListener("popstate", () => {
3985
+ const e = N.location.href, n = Fe;
3986
3986
  if (Fe = e, n === e)
3987
3987
  return;
3988
3988
  F("history", { from: n, to: e });
@@ -4000,11 +4000,11 @@ function Fc() {
4000
4000
  return e.apply(this, n);
4001
4001
  };
4002
4002
  }
4003
- $(D.history, "pushState", t), $(D.history, "replaceState", t);
4003
+ $(N.history, "pushState", t), $(N.history, "replaceState", t);
4004
4004
  }
4005
4005
  function Uc(t) {
4006
4006
  try {
4007
- return new URL(t, D.location.origin).toString();
4007
+ return new URL(t, N.location.origin).toString();
4008
4008
  } catch {
4009
4009
  return t;
4010
4010
  }
@@ -4014,10 +4014,10 @@ function Bc(t) {
4014
4014
  const e = Xe[t];
4015
4015
  if (e)
4016
4016
  return e;
4017
- let n = D[t];
4017
+ let n = N[t];
4018
4018
  if (Mt(n))
4019
- return Xe[t] = n.bind(D);
4020
- const r = D.document;
4019
+ return Xe[t] = n.bind(N);
4020
+ const r = N.document;
4021
4021
  if (r && typeof r.createElement == "function")
4022
4022
  try {
4023
4023
  const s = r.createElement("iframe");
@@ -4025,9 +4025,9 @@ function Bc(t) {
4025
4025
  const i = s.contentWindow;
4026
4026
  i?.[t] && (n = i[t]), r.head.removeChild(s);
4027
4027
  } catch (s) {
4028
- Dc && m.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `, s);
4028
+ Nc && m.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `, s);
4029
4029
  }
4030
- return n && (Xe[t] = n.bind(D));
4030
+ return n && (Xe[t] = n.bind(N));
4031
4031
  }
4032
4032
  function Hc(t) {
4033
4033
  Xe[t] = void 0;
@@ -4037,7 +4037,7 @@ function zc(t) {
4037
4037
  ce("xhr", t), le("xhr", jc);
4038
4038
  }
4039
4039
  function jc() {
4040
- if (!D.XMLHttpRequest)
4040
+ if (!N.XMLHttpRequest)
4041
4041
  return;
4042
4042
  const t = XMLHttpRequest.prototype;
4043
4043
  t.open = new Proxy(t.open, {
@@ -4186,7 +4186,7 @@ const Kc = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Yc = /^\s*at (?:(.+?\)(?: \
4186
4186
  let r = e[3], s = e[1] || oe;
4187
4187
  return [s, r] = ks(s, r), zt(r, s, e[4] ? +e[4] : void 0, e[5] ? +e[5] : void 0);
4188
4188
  }
4189
- }, sl = [Xc, rl], il = [el, sl], ol = Nr(...il), ks = (t, e) => {
4189
+ }, sl = [Xc, rl], il = [el, sl], ol = Dr(...il), ks = (t, e) => {
4190
4190
  const n = t.indexOf("safari-extension") !== -1, r = t.indexOf("safari-web-extension") !== -1;
4191
4191
  return n || r ? [
4192
4192
  t.indexOf("@") !== -1 ? t.split("@")[0] : oe,
@@ -4552,14 +4552,14 @@ function Al() {
4552
4552
  return;
4553
4553
  }
4554
4554
  }
4555
- const Dl = "GlobalHandlers", Nl = ((t = {}) => {
4555
+ const Nl = "GlobalHandlers", Dl = ((t = {}) => {
4556
4556
  const e = {
4557
4557
  onerror: !0,
4558
4558
  onunhandledrejection: !0,
4559
4559
  ...t
4560
4560
  };
4561
4561
  return {
4562
- name: Dl,
4562
+ name: Nl,
4563
4563
  setupOnce() {
4564
4564
  Error.stackTraceLimit = 50;
4565
4565
  },
@@ -4567,7 +4567,7 @@ const Dl = "GlobalHandlers", Nl = ((t = {}) => {
4567
4567
  e.onerror && ($l(n), fr("onerror")), e.onunhandledrejection && (Pl(n), fr("onunhandledrejection"));
4568
4568
  }
4569
4569
  };
4570
- }), Ol = Nl;
4570
+ }), Ol = Dl;
4571
4571
  function $l(t) {
4572
4572
  si((e) => {
4573
4573
  const { stackParser: n, attachStacktrace: r } = xs();
@@ -4649,7 +4649,7 @@ function xs() {
4649
4649
  }
4650
4650
  function Ul(t) {
4651
4651
  if (!(!j(t) || t.length === 0))
4652
- return t.startsWith("data:") ? `<${Da(t, !1)}>` : t;
4652
+ return t.startsWith("data:") ? `<${Na(t, !1)}>` : t;
4653
4653
  }
4654
4654
  const Bl = () => ({
4655
4655
  name: "HttpContext",
@@ -5403,7 +5403,22 @@ function _r(t) {
5403
5403
  function pu(t, e) {
5404
5404
  return t.code === "txn_limit_exceeded" ? y.TXN_LIMIT_EXCEEDED : t.httpStatus === b.UNAUTHORIZED ? y.UNAUTHORIZED : t.httpStatus === b.FORBIDDEN ? y.FORBIDDEN : e;
5405
5405
  }
5406
- class hu {
5406
+ const hu = {
5407
+ "audio/mpeg": "mp3",
5408
+ "audio/mp3": "mp3",
5409
+ "audio/wav": "wav",
5410
+ "audio/x-wav": "wav",
5411
+ "audio/mp4": "mp4",
5412
+ "audio/m4a": "m4a",
5413
+ "audio/x-m4a": "m4a",
5414
+ "audio/webm": "webm",
5415
+ "audio/ogg": "ogg"
5416
+ };
5417
+ function fu(t) {
5418
+ const e = t.name, n = e && e.includes(".") ? e.split(".").pop()?.toLowerCase() : void 0, r = t.type?.split(";")[0]?.trim().toLowerCase();
5419
+ return `audio_1.${n || (r ? hu[r] : void 0) || "mp3"}`;
5420
+ }
5421
+ class gu {
5407
5422
  constructor(e, n, r, s) {
5408
5423
  this.allianceClient = e, this.transport = n, this.hosts = r, this.tracker = s, this.txnID = "", this.storedSession = null, this.sessionEnded = !1;
5409
5424
  }
@@ -5713,15 +5728,15 @@ class hu {
5713
5728
  async processPreRecordedAudio({
5714
5729
  upload: e,
5715
5730
  audioFile: n,
5716
- audioFileName: r = "audio_1.mp3"
5731
+ audioFileName: r
5717
5732
  }) {
5718
5733
  try {
5719
- const s = await this.allianceClient.uploadAudioFile(n, r, e);
5720
- return s.success ? {
5721
- status_code: ne(s),
5734
+ const s = r || fu(n), i = await this.allianceClient.uploadAudioFile(n, s, e);
5735
+ return i.success ? {
5736
+ status_code: ne(i),
5722
5737
  message: "Audio file uploaded successfully."
5723
5738
  } : ee(
5724
- s.error,
5739
+ i.error,
5725
5740
  y.AUDIO_UPLOAD_FAILED,
5726
5741
  "Audio upload failed."
5727
5742
  );
@@ -5785,7 +5800,7 @@ const yr = (t) => {
5785
5800
  } catch {
5786
5801
  return t;
5787
5802
  }
5788
- }, fu = (t) => {
5803
+ }, mu = (t) => {
5789
5804
  try {
5790
5805
  const e = atob(t), n = new Uint8Array(e.length);
5791
5806
  for (let s = 0; s < e.length; s++)
@@ -5794,9 +5809,9 @@ const yr = (t) => {
5794
5809
  } catch (e) {
5795
5810
  return console.error("Error decoding base64 string:", e), "";
5796
5811
  }
5797
- }, gu = (t, e) => {
5812
+ }, _u = (t, e) => {
5798
5813
  if (!e || e.trim() === "") return null;
5799
- const n = fu(e);
5814
+ const n = mu(e);
5800
5815
  switch (t) {
5801
5816
  case Ke.JSON:
5802
5817
  return yr(n);
@@ -5810,10 +5825,10 @@ const yr = (t) => {
5810
5825
  const { value: n } = e;
5811
5826
  return typeof n != "string" ? { ...e, value: n ?? null } : {
5812
5827
  ...e,
5813
- value: gu(e.type, n)
5828
+ value: _u(e.type, n)
5814
5829
  };
5815
5830
  }) : [];
5816
- class mu {
5831
+ class yu {
5817
5832
  constructor(e, n) {
5818
5833
  this.transport = e, this.hosts = n;
5819
5834
  }
@@ -5877,20 +5892,20 @@ class mu {
5877
5892
  return s && h.push(`template_id=${s}`), i && h.push(`document_id=${i}`), o && h.push("dlp=true"), h.join("&");
5878
5893
  }, p = async () => {
5879
5894
  try {
5880
- const h = u(), f = await this.fetchV3Status(n, h, 2e4), { status_code: k, response: N } = f;
5895
+ const h = u(), f = await this.fetchV3Status(n, h, 2e4), { status_code: k, response: D } = f;
5881
5896
  if (Date.now() >= l)
5882
5897
  return c(500, null, "Timeout while fetching analysis results.", "timeout");
5883
5898
  if (k === 401 || k === 403)
5884
5899
  return c(
5885
5900
  k,
5886
- N ?? null,
5901
+ D ?? null,
5887
5902
  "Unauthorized or Forbidden",
5888
5903
  "failed"
5889
5904
  );
5890
5905
  if (k === 202 || k === 400 || k >= 500) {
5891
- if (k === 202 && N && a?.({
5906
+ if (k === 202 && D && a?.({
5892
5907
  txn_id: n,
5893
- response: N,
5908
+ response: D,
5894
5909
  status_code: k,
5895
5910
  message: "Partial result received",
5896
5911
  poll_status: "in-progress"
@@ -5899,7 +5914,7 @@ class mu {
5899
5914
  return c(
5900
5915
  k,
5901
5916
  null,
5902
- N?.error?.message || f.message || "Backend error while fetching results.",
5917
+ D?.error?.message || f.message || "Backend error while fetching results.",
5903
5918
  "failed"
5904
5919
  );
5905
5920
  } else
@@ -5908,7 +5923,7 @@ class mu {
5908
5923
  }
5909
5924
  return c(
5910
5925
  k,
5911
- N ?? null,
5926
+ D ?? null,
5912
5927
  "Template results generated successfully.",
5913
5928
  "success"
5914
5929
  );
@@ -5954,8 +5969,8 @@ class mu {
5954
5969
  };
5955
5970
  }
5956
5971
  }
5957
- const _u = 5e3;
5958
- class yu {
5972
+ const Eu = 5e3;
5973
+ class bu {
5959
5974
  constructor(e, n) {
5960
5975
  this.transport = e, this.hosts = n, this.microphoneStream = null;
5961
5976
  }
@@ -5997,7 +6012,7 @@ class yu {
5997
6012
  "No internet connection detected",
5998
6013
  { isOnline: !1 }
5999
6014
  );
6000
- const r = new AbortController(), s = setTimeout(() => r.abort(), _u);
6015
+ const r = new AbortController(), s = setTimeout(() => r.abort(), Eu);
6001
6016
  try {
6002
6017
  await fetch("https://www.google.com/favicon.ico", {
6003
6018
  mode: "no-cors",
@@ -6247,14 +6262,14 @@ function E(t, e = "") {
6247
6262
  }, getRegex: () => new RegExp(n, e) };
6248
6263
  return r;
6249
6264
  }
6250
- var Eu = ((t = "") => {
6265
+ var Su = ((t = "") => {
6251
6266
  try {
6252
6267
  return !!new RegExp("(?<=1)(?<!1)" + t);
6253
6268
  } catch {
6254
6269
  return !1;
6255
6270
  }
6256
- })(), I = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: pe((t) => new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: pe((t) => new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: pe((t) => new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)), headingBeginRegex: pe((t) => new RegExp(`^ {0,${t}}#`)), htmlBeginRegex: pe((t) => new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: pe((t) => new RegExp(`^ {0,${t}}>`)) }, bu = /^(?:[ \t]*(?:\n|$))+/, Su = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ku = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Le = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, xu = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, un = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ws = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ts = E(ws).replace(/bull/g, un).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ru = E(ws).replace(/bull/g, un).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), dn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, wu = /^[^\n]+/, pn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Tu = E(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", pn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), vu = E(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, un).getRegex(), dt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", hn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Iu = E("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", hn).replace("tag", dt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), vs = E(dn).replace("hr", Le).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", dt).getRegex(), Cu = E(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", vs).getRegex(), fn = { blockquote: Cu, code: Su, def: Tu, fences: ku, heading: xu, hr: Le, html: Iu, lheading: Ts, list: vu, newline: bu, paragraph: vs, table: se, text: wu }, Er = E("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Le).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", dt).getRegex(), Au = { ...fn, lheading: Ru, table: Er, paragraph: E(dn).replace("hr", Le).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Er).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", dt).getRegex() }, Du = { ...fn, html: E(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", hn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: se, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: E(dn).replace("hr", Le).replace("heading", ` *#{1,6} *[^
6257
- ]`).replace("lheading", Ts).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Nu = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ou = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Is = /^( {2,}|\\)\n(?!\s*$)/, $u = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Se = /[\p{P}\p{S}]/u, pt = /[\s\p{P}\p{S}]/u, gn = /[^\s\p{P}\p{S}]/u, Pu = E(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, pt).getRegex(), Cs = /(?!~)[\p{P}\p{S}]/u, Lu = /(?!~)[\s\p{P}\p{S}]/u, Mu = /(?:[^\s\p{P}\p{S}]|~)/u, Fu = E(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Eu ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), As = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Uu = E(As, "u").replace(/punct/g, Se).getRegex(), Bu = E(As, "u").replace(/punct/g, Cs).getRegex(), Ds = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Hu = E(Ds, "gu").replace(/notPunctSpace/g, gn).replace(/punctSpace/g, pt).replace(/punct/g, Se).getRegex(), zu = E(Ds, "gu").replace(/notPunctSpace/g, Mu).replace(/punctSpace/g, Lu).replace(/punct/g, Cs).getRegex(), ju = E("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, gn).replace(/punctSpace/g, pt).replace(/punct/g, Se).getRegex(), qu = E(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Se).getRegex(), Gu = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Vu = E(Gu, "gu").replace(/notPunctSpace/g, gn).replace(/punctSpace/g, pt).replace(/punct/g, Se).getRegex(), Wu = E(/\\(punct)/, "gu").replace(/punct/g, Se).getRegex(), Xu = E(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ku = E(hn).replace("(?:-->|$)", "-->").getRegex(), Yu = E("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ku).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Qe = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Zu = E(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Qe).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ns = E(/^!?\[(label)\]\[(ref)\]/).replace("label", Qe).replace("ref", pn).getRegex(), Os = E(/^!?\[(ref)\](?:\[\])?/).replace("ref", pn).getRegex(), Ju = E("reflink|nolink(?!\\()", "g").replace("reflink", Ns).replace("nolink", Os).getRegex(), br = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, mn = { _backpedal: se, anyPunctuation: Wu, autolink: Xu, blockSkip: Fu, br: Is, code: Ou, del: se, delLDelim: se, delRDelim: se, emStrongLDelim: Uu, emStrongRDelimAst: Hu, emStrongRDelimUnd: ju, escape: Nu, link: Zu, nolink: Os, punctuation: Pu, reflink: Ns, reflinkSearch: Ju, tag: Yu, text: $u, url: se }, Qu = { ...mn, link: E(/^!?\[(label)\]\((.*?)\)/).replace("label", Qe).getRegex(), reflink: E(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Qe).getRegex() }, jt = { ...mn, emStrongRDelimAst: zu, emStrongLDelim: Bu, delLDelim: qu, delRDelim: Vu, url: E(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", br).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: E(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", br).getRegex() }, ed = { ...jt, br: E(Is).replace("{2,}", "*").getRegex(), text: E(jt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, He = { normal: fn, gfm: Au, pedantic: Du }, we = { normal: mn, gfm: jt, breaks: ed, pedantic: Qu }, td = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Sr = (t) => td[t];
6271
+ })(), I = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: pe((t) => new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: pe((t) => new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: pe((t) => new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)), headingBeginRegex: pe((t) => new RegExp(`^ {0,${t}}#`)), htmlBeginRegex: pe((t) => new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: pe((t) => new RegExp(`^ {0,${t}}>`)) }, ku = /^(?:[ \t]*(?:\n|$))+/, xu = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ru = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Le = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, wu = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, un = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ws = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ts = E(ws).replace(/bull/g, un).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Tu = E(ws).replace(/bull/g, un).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), dn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, vu = /^[^\n]+/, pn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Iu = E(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", pn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Cu = E(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, un).getRegex(), dt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", hn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Au = E("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", hn).replace("tag", dt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), vs = E(dn).replace("hr", Le).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", dt).getRegex(), Nu = E(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", vs).getRegex(), fn = { blockquote: Nu, code: xu, def: Iu, fences: Ru, heading: wu, hr: Le, html: Au, lheading: Ts, list: Cu, newline: ku, paragraph: vs, table: se, text: vu }, Er = E("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Le).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", dt).getRegex(), Du = { ...fn, lheading: Tu, table: Er, paragraph: E(dn).replace("hr", Le).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Er).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", dt).getRegex() }, Ou = { ...fn, html: E(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", hn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: se, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: E(dn).replace("hr", Le).replace("heading", ` *#{1,6} *[^
6272
+ ]`).replace("lheading", Ts).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, $u = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pu = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Is = /^( {2,}|\\)\n(?!\s*$)/, Lu = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Se = /[\p{P}\p{S}]/u, pt = /[\s\p{P}\p{S}]/u, gn = /[^\s\p{P}\p{S}]/u, Mu = E(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, pt).getRegex(), Cs = /(?!~)[\p{P}\p{S}]/u, Fu = /(?!~)[\s\p{P}\p{S}]/u, Uu = /(?:[^\s\p{P}\p{S}]|~)/u, Bu = E(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Su ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), As = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Hu = E(As, "u").replace(/punct/g, Se).getRegex(), zu = E(As, "u").replace(/punct/g, Cs).getRegex(), Ns = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ju = E(Ns, "gu").replace(/notPunctSpace/g, gn).replace(/punctSpace/g, pt).replace(/punct/g, Se).getRegex(), qu = E(Ns, "gu").replace(/notPunctSpace/g, Uu).replace(/punctSpace/g, Fu).replace(/punct/g, Cs).getRegex(), Gu = E("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, gn).replace(/punctSpace/g, pt).replace(/punct/g, Se).getRegex(), Vu = E(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Se).getRegex(), Wu = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Xu = E(Wu, "gu").replace(/notPunctSpace/g, gn).replace(/punctSpace/g, pt).replace(/punct/g, Se).getRegex(), Ku = E(/\\(punct)/, "gu").replace(/punct/g, Se).getRegex(), Yu = E(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Zu = E(hn).replace("(?:-->|$)", "-->").getRegex(), Ju = E("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Zu).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Qe = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Qu = E(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Qe).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ds = E(/^!?\[(label)\]\[(ref)\]/).replace("label", Qe).replace("ref", pn).getRegex(), Os = E(/^!?\[(ref)\](?:\[\])?/).replace("ref", pn).getRegex(), ed = E("reflink|nolink(?!\\()", "g").replace("reflink", Ds).replace("nolink", Os).getRegex(), br = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, mn = { _backpedal: se, anyPunctuation: Ku, autolink: Yu, blockSkip: Bu, br: Is, code: Pu, del: se, delLDelim: se, delRDelim: se, emStrongLDelim: Hu, emStrongRDelimAst: ju, emStrongRDelimUnd: Gu, escape: $u, link: Qu, nolink: Os, punctuation: Mu, reflink: Ds, reflinkSearch: ed, tag: Ju, text: Lu, url: se }, td = { ...mn, link: E(/^!?\[(label)\]\((.*?)\)/).replace("label", Qe).getRegex(), reflink: E(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Qe).getRegex() }, jt = { ...mn, emStrongRDelimAst: qu, emStrongLDelim: zu, delLDelim: Vu, delRDelim: Xu, url: E(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", br).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: E(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", br).getRegex() }, nd = { ...jt, br: E(Is).replace("{2,}", "*").getRegex(), text: E(jt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, He = { normal: fn, gfm: Du, pedantic: Ou }, we = { normal: mn, gfm: jt, breaks: nd, pedantic: td }, rd = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Sr = (t) => rd[t];
6258
6273
  function U(t, e) {
6259
6274
  if (e) {
6260
6275
  if (I.escapeTest.test(t)) return t.replace(I.escapeReplace, Sr);
@@ -6295,7 +6310,7 @@ function Rr(t) {
6295
6310
  return e.length - n <= 2 ? t : e.slice(0, n + 1).join(`
6296
6311
  `);
6297
6312
  }
6298
- function nd(t, e) {
6313
+ function sd(t, e) {
6299
6314
  if (t.indexOf(e[1]) === -1) return -1;
6300
6315
  let n = 0;
6301
6316
  for (let r = 0; r < t.length; r++) if (t[r] === "\\") r++;
@@ -6303,7 +6318,7 @@ function nd(t, e) {
6303
6318
  else if (t[r] === e[1] && (n--, n < 0)) return r;
6304
6319
  return n > 0 ? -2 : -1;
6305
6320
  }
6306
- function rd(t, e = 0) {
6321
+ function id(t, e = 0) {
6307
6322
  let n = e, r = "";
6308
6323
  for (let s of t) if (s === " ") {
6309
6324
  let i = 4 - n % 4;
@@ -6317,7 +6332,7 @@ function wr(t, e, n, r, s) {
6317
6332
  let c = { type: t[0].charAt(0) === "!" ? "image" : "link", raw: n, href: i, title: o, text: a, tokens: r.inlineTokens(a) };
6318
6333
  return r.state.inLink = !1, c;
6319
6334
  }
6320
- function sd(t, e, n) {
6335
+ function od(t, e, n) {
6321
6336
  let r = t.match(n.other.indentCodeCompensation);
6322
6337
  if (r === null) return e;
6323
6338
  let s = r[1];
@@ -6351,7 +6366,7 @@ var et = class {
6351
6366
  fences(t) {
6352
6367
  let e = this.rules.block.fences.exec(t);
6353
6368
  if (e) {
6354
- let n = e[0], r = sd(n, e[3] || "", this.rules);
6369
+ let n = e[0], r = od(n, e[3] || "", this.rules);
6355
6370
  return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
6356
6371
  }
6357
6372
  }
@@ -6422,20 +6437,20 @@ ${d}` : d;
6422
6437
  let c = !1, l = "", d = "";
6423
6438
  if (!(e = i.exec(t)) || this.rules.block.hr.test(t)) break;
6424
6439
  l = e[0], t = t.substring(l.length);
6425
- let u = rd(e[2].split(`
6440
+ let u = id(e[2].split(`
6426
6441
  `, 1)[0], e[1].length), p = t.split(`
6427
6442
  `, 1)[0], h = !u.trim(), f = 0;
6428
6443
  if (this.options.pedantic ? (f = 2, d = u.trimStart()) : h ? f = e[1].length + 1 : (f = u.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, d = u.slice(f), f += e[1].length), h && this.rules.other.blankLine.test(p) && (l += p + `
6429
6444
  `, t = t.substring(p.length + 1), c = !0), !c) {
6430
- let k = this.rules.other.nextBulletRegex(f), N = this.rules.other.hrRegex(f), A = this.rules.other.fencesBeginRegex(f), ke = this.rules.other.headingBeginRegex(f), $s = this.rules.other.htmlBeginRegex(f), Ps = this.rules.other.blockquoteBeginRegex(f);
6445
+ let k = this.rules.other.nextBulletRegex(f), D = this.rules.other.hrRegex(f), A = this.rules.other.fencesBeginRegex(f), ke = this.rules.other.headingBeginRegex(f), $s = this.rules.other.htmlBeginRegex(f), Ps = this.rules.other.blockquoteBeginRegex(f);
6431
6446
  for (; t; ) {
6432
6447
  let ht = t.split(`
6433
6448
  `, 1)[0], xe;
6434
- if (p = ht, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), xe = p) : xe = p.replace(this.rules.other.tabCharGlobal, " "), A.test(p) || ke.test(p) || $s.test(p) || Ps.test(p) || k.test(p) || N.test(p)) break;
6449
+ if (p = ht, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), xe = p) : xe = p.replace(this.rules.other.tabCharGlobal, " "), A.test(p) || ke.test(p) || $s.test(p) || Ps.test(p) || k.test(p) || D.test(p)) break;
6435
6450
  if (xe.search(this.rules.other.nonSpaceChar) >= f || !p.trim()) d += `
6436
6451
  ` + xe.slice(f);
6437
6452
  else {
6438
- if (h || u.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || A.test(u) || ke.test(u) || N.test(u)) break;
6453
+ if (h || u.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || A.test(u) || ke.test(u) || D.test(u)) break;
6439
6454
  d += `
6440
6455
  ` + p;
6441
6456
  }
@@ -6541,7 +6556,7 @@ ${d}` : d;
6541
6556
  let i = V(n.slice(0, -1), "\\");
6542
6557
  if ((n.length - i.length) % 2 === 0) return;
6543
6558
  } else {
6544
- let i = nd(e[2], "()");
6559
+ let i = sd(e[2], "()");
6545
6560
  if (i === -2) return;
6546
6561
  if (i > -1) {
6547
6562
  let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
@@ -7191,7 +7206,7 @@ ${t}</tr>
7191
7206
  provideParser(t = this.block) {
7192
7207
  return t ? M.parse : M.parseInline;
7193
7208
  }
7194
- }, w(je, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), w(je, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), je), id = class {
7209
+ }, w(je, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), w(je, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), je), ad = class {
7195
7210
  constructor(...t) {
7196
7211
  w(this, "defaults", ln());
7197
7212
  w(this, "options", this.setOptions);
@@ -7351,7 +7366,7 @@ Please report this to https://github.com/markedjs/marked.`, t) {
7351
7366
  throw n;
7352
7367
  };
7353
7368
  }
7354
- }, ae = new id();
7369
+ }, ae = new ad();
7355
7370
  function x(t, e) {
7356
7371
  return ae.parse(t, e);
7357
7372
  }
@@ -7384,7 +7399,7 @@ x.parseInline;
7384
7399
  M.parse;
7385
7400
  L.lex;
7386
7401
  var g = /* @__PURE__ */ ((t) => (t.COLLAPSED = "collapsed", t.RECORDING = "recording", t.PAUSED = "paused", t.PROCESSING = "processing", t.DONE = "done", t.ERROR = "error", t))(g || {});
7387
- const od = {
7402
+ const cd = {
7388
7403
  [g.COLLAPSED]: [g.RECORDING, g.ERROR],
7389
7404
  [g.RECORDING]: [
7390
7405
  g.PAUSED,
@@ -7400,7 +7415,7 @@ const od = {
7400
7415
  [g.DONE]: [g.COLLAPSED],
7401
7416
  [g.ERROR]: [g.COLLAPSED, g.RECORDING]
7402
7417
  };
7403
- class ad {
7418
+ class ld {
7404
7419
  constructor() {
7405
7420
  this.state = g.COLLAPSED, this.listeners = /* @__PURE__ */ new Set();
7406
7421
  }
@@ -7408,7 +7423,7 @@ class ad {
7408
7423
  return this.state;
7409
7424
  }
7410
7425
  canTransition(e) {
7411
- return od[this.state].includes(e);
7426
+ return cd[this.state].includes(e);
7412
7427
  }
7413
7428
  transition(e) {
7414
7429
  if (!this.canTransition(e))
@@ -7430,7 +7445,7 @@ class ad {
7430
7445
  this.state = g.COLLAPSED;
7431
7446
  }
7432
7447
  }
7433
- class cd {
7448
+ class ud {
7434
7449
  constructor(e) {
7435
7450
  this.startTime = 0, this.elapsed = 0, this.intervalId = null, this.tickCallback = e;
7436
7451
  }
@@ -7463,7 +7478,7 @@ class cd {
7463
7478
  this.intervalId !== null && (clearInterval(this.intervalId), this.intervalId = null);
7464
7479
  }
7465
7480
  }
7466
- function ld() {
7481
+ function dd() {
7467
7482
  return `
7468
7483
  :host {
7469
7484
  all: initial;
@@ -7860,7 +7875,7 @@ function ld() {
7860
7875
  }
7861
7876
  `;
7862
7877
  }
7863
- function ud(t, e) {
7878
+ function pd(t, e) {
7864
7879
  let n = 0, r = 0, s = !1;
7865
7880
  function i(c) {
7866
7881
  if (c.target.closest("button")) return;
@@ -7880,12 +7895,12 @@ function ud(t, e) {
7880
7895
  e.removeEventListener("mousedown", i), e.removeEventListener("touchstart", i), a();
7881
7896
  };
7882
7897
  }
7883
- const dd = '<svg viewBox="0 0 24 24"><rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/></svg>', pd = '<svg viewBox="0 0 24 24"><polygon points="8,4 20,12 8,20"/></svg>', Tr = '<svg viewBox="0 0 24 24"><rect x="5" y="5" width="14" height="14" rx="2"/></svg>', vr = '<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg>', ze = '<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>', hd = 20, fd = 14, wt = 3, Tt = 2;
7884
- class gd {
7898
+ const hd = '<svg viewBox="0 0 24 24"><rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/></svg>', fd = '<svg viewBox="0 0 24 24"><polygon points="8,4 20,12 8,20"/></svg>', Tr = '<svg viewBox="0 0 24 24"><rect x="5" y="5" width="14" height="14" rx="2"/></svg>', vr = '<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg>', ze = '<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>', gd = 20, md = 14, wt = 3, Tt = 2;
7899
+ class _d {
7885
7900
  constructor(e, n, r, s) {
7886
7901
  this.cleanupDrag = null, this.animationId = null, this.waveformBars = [], this.actions = s, this.orientation = r, this.host = document.createElement("eka-scribe-widget"), this.shadow = this.host.attachShadow({ mode: "closed" });
7887
7902
  const i = document.createElement("style");
7888
- i.textContent = ld(), this.shadow.appendChild(i), this.widgetEl = document.createElement("div"), this.widgetEl.className = "widget hidden", this.widgetEl.style.zIndex = String(e), this.applyPosition(n), this.shadow.appendChild(this.widgetEl), this.contentEl = document.createElement("div"), this.widgetEl.appendChild(this.contentEl), document.body.appendChild(this.host);
7903
+ i.textContent = dd(), this.shadow.appendChild(i), this.widgetEl = document.createElement("div"), this.widgetEl.className = "widget hidden", this.widgetEl.style.zIndex = String(e), this.applyPosition(n), this.shadow.appendChild(this.widgetEl), this.contentEl = document.createElement("div"), this.widgetEl.appendChild(this.contentEl), document.body.appendChild(this.host);
7889
7904
  }
7890
7905
  renderState(e, n) {
7891
7906
  switch (this.stopAnimation(), this.contentEl.className = "", e) {
@@ -7926,7 +7941,7 @@ class gd {
7926
7941
  this.waveformBars = s, n.appendChild(r);
7927
7942
  const i = document.createElement("span");
7928
7943
  i.className = "timer", i.textContent = e, n.appendChild(i);
7929
- const o = this.createButton("btn btn-play-pause", dd);
7944
+ const o = this.createButton("btn btn-play-pause", hd);
7930
7945
  o.addEventListener("click", this.actions.onPause), n.appendChild(o);
7931
7946
  const a = this.createButton("btn btn-stop", Tr);
7932
7947
  a.addEventListener("click", this.actions.onStop), n.appendChild(a), this.contentEl.appendChild(n), this.bindDrag(n), this.startAnimation();
@@ -7940,7 +7955,7 @@ class gd {
7940
7955
  n.appendChild(r);
7941
7956
  const i = document.createElement("span");
7942
7957
  i.className = "timer", i.textContent = e, n.appendChild(i);
7943
- const o = this.createButton("btn btn-play-pause", pd);
7958
+ const o = this.createButton("btn btn-play-pause", fd);
7944
7959
  o.addEventListener("click", this.actions.onResume), n.appendChild(o);
7945
7960
  const a = this.createButton("btn btn-stop", Tr);
7946
7961
  a.addEventListener("click", this.actions.onStop), n.appendChild(a), this.contentEl.appendChild(n), this.bindDrag(n);
@@ -8011,7 +8026,7 @@ class gd {
8011
8026
  }
8012
8027
  // ─── Waveform ─────────────────────────────────────────────────────────────
8013
8028
  createWaveform() {
8014
- const e = this.orientation === "vertical" ? fd : hd, n = 28, r = e * (wt + Tt) - Tt, s = n, i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
8029
+ const e = this.orientation === "vertical" ? md : gd, n = 28, r = e * (wt + Tt) - Tt, s = n, i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
8015
8030
  i.setAttribute("width", String(r)), i.setAttribute("height", String(s)), i.setAttribute("viewBox", `0 0 ${r} ${s}`);
8016
8031
  const o = [], a = n * 0.4;
8017
8032
  for (let c = 0; c < e; c++) {
@@ -8049,7 +8064,7 @@ class gd {
8049
8064
  return r.className = e, r.innerHTML = n, r;
8050
8065
  }
8051
8066
  bindDrag(e) {
8052
- this.cleanupDrag && this.cleanupDrag(), this.cleanupDrag = ud(this.widgetEl, e);
8067
+ this.cleanupDrag && this.cleanupDrag(), this.cleanupDrag = pd(this.widgetEl, e);
8053
8068
  }
8054
8069
  applyPosition(e) {
8055
8070
  e && (e.top != null && (this.widgetEl.style.top = `${e.top}px`, this.widgetEl.style.bottom = "auto"), e.bottom != null && (this.widgetEl.style.bottom = `${e.bottom}px`), e.left != null && (this.widgetEl.style.left = `${e.left}px`, this.widgetEl.style.right = "auto"), e.right != null && (this.widgetEl.style.right = `${e.right}px`));
@@ -8059,9 +8074,9 @@ class gd {
8059
8074
  return n.textContent = e, n.innerHTML;
8060
8075
  }
8061
8076
  }
8062
- class md {
8077
+ class yd {
8063
8078
  constructor(e, n) {
8064
- this.currentTxnId = "", this.isProcessing = !1, this.isStarting = !1, this.sdk = e, this.config = n, this.callbacks = n.callbacks || {}, this.stateMachine = new ad(), this.timer = new cd((r) => this.renderer.updateTimer(r)), this.renderer = new gd(
8079
+ this.currentTxnId = "", this.isProcessing = !1, this.isStarting = !1, this.sdk = e, this.config = n, this.callbacks = n.callbacks || {}, this.stateMachine = new ld(), this.timer = new ud((r) => this.renderer.updateTimer(r)), this.renderer = new _d(
8065
8080
  n.zIndex ?? 9999,
8066
8081
  n.position,
8067
8082
  n.orientation || "horizontal",
@@ -8246,12 +8261,12 @@ const O = class O {
8246
8261
  flavour: e.flavour
8247
8262
  }), this.allianceClient.init().catch((r) => {
8248
8263
  console.error("[EkaScribe] Alliance SDK init failed:", r);
8249
- }), this.documents = new uu(this.transport, this.hosts, this.allianceClient), this.sessions = new du(this.transport, this.hosts, this.allianceClient), this.output = new mu(this.transport, this.hosts), this.recording = new hu(
8264
+ }), this.documents = new uu(this.transport, this.hosts, this.allianceClient), this.sessions = new du(this.transport, this.hosts, this.allianceClient), this.output = new yu(this.transport, this.hosts), this.recording = new gu(
8250
8265
  this.allianceClient,
8251
8266
  this.transport,
8252
8267
  this.hosts,
8253
8268
  this.tracker
8254
- ), e.widget?.enabled && (this.widgetManager = new md(this, e.widget)), this.allianceClient.registerCallback("onTokenRequired", (r) => {
8269
+ ), e.widget?.enabled && (this.widgetManager = new yd(this, e.widget)), this.allianceClient.registerCallback("onTokenRequired", (r) => {
8255
8270
  this.handleUnauthorized().then((s) => {
8256
8271
  s ? r.resolve(s) : (console.error("[EkaScribe] Token refresh returned empty token."), r.resolve(""));
8257
8272
  }).catch((s) => {
@@ -8372,7 +8387,7 @@ const O = class O {
8372
8387
  }
8373
8388
  // ─── Compatibility ─────────────────────────────────────────────────────────
8374
8389
  async runSystemCompatibilityTest(e) {
8375
- return new yu(this.transport, this.hosts).runCompatibilityTest(e);
8390
+ return new bu(this.transport, this.hosts).runCompatibilityTest(e);
8376
8391
  }
8377
8392
  // ─── Lifecycle ─────────────────────────────────────────────────────────────
8378
8393
  async resetInstance() {
@@ -8391,7 +8406,7 @@ const O = class O {
8391
8406
  };
8392
8407
  O.instance = null;
8393
8408
  let Vt = O;
8394
- const Ed = (t) => Vt.getInstance(t);
8409
+ const Sd = (t) => Vt.getInstance(t);
8395
8410
  export {
8396
8411
  Jl as API_STATUS,
8397
8412
  ru as CALLBACK_TYPE,
@@ -8404,7 +8419,7 @@ export {
8404
8419
  Ke as TEMPLATE_TYPE,
8405
8420
  Ql as VAD_STATUS,
8406
8421
  g as WidgetState,
8407
- kd as createWorkerBlobUrl,
8408
- Ed as getEkaScribeInstance,
8409
- xd as getWorkerUrl
8422
+ Rd as createWorkerBlobUrl,
8423
+ Sd as getEkaScribeInstance,
8424
+ wd as getWorkerUrl
8410
8425
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "3.0.53",
3
+ "version": "3.0.54",
4
4
  "description": "EkaScribe TypeScript SDK - Modern ES2020 build",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "marked": "^18.0.4",
41
- "med-scribe-alliance-ts-sdk": "2.0.51"
41
+ "med-scribe-alliance-ts-sdk": "2.0.52"
42
42
  },
43
43
  "devDependencies": {
44
44
  "vite-bundle-analyzer": "^1.3.6"