@avaturn-live/web-sdk 0.4.7 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Fa = Object.defineProperty;
2
2
  var Ua = (t, e, n) => e in t ? Fa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var Q = (t, e, n) => Ua(t, typeof e != "symbol" ? e + "" : e, n);
3
+ var K = (t, e, n) => Ua(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  function di(t, e) {
5
5
  if (t == null) return {};
6
6
  var n, r, i = function(a, c) {
@@ -115,8 +115,8 @@ function re(t, e) {
115
115
  if (Object(i) !== i) return;
116
116
  h = !1;
117
117
  } else for (; !(h = (s = c.call(i)).done) && (f.push(s.value), f.length !== r); h = !0) ;
118
- } catch (E) {
119
- v = !0, a = E;
118
+ } catch (k) {
119
+ v = !0, a = k;
120
120
  } finally {
121
121
  try {
122
122
  if (!h && i.return != null && (l = i.return(), Object(l) !== l)) return;
@@ -201,9 +201,9 @@ var mi, Jt = { exports: {} }, sr = function() {
201
201
  return A === void 0 ? [] : typeof A == "function" ? w ? [A.listener || A] : [A] : w ? function(j) {
202
202
  for (var x = new Array(j.length), R = 0; R < x.length; ++R) x[R] = j[R].listener || j[R];
203
203
  return x;
204
- }(A) : k(A, A.length);
204
+ }(A) : E(A, A.length);
205
205
  }
206
- function E(m) {
206
+ function k(m) {
207
207
  var y = this._events;
208
208
  if (y !== void 0) {
209
209
  var w = y[m];
@@ -212,7 +212,7 @@ var mi, Jt = { exports: {} }, sr = function() {
212
212
  }
213
213
  return 0;
214
214
  }
215
- function k(m, y) {
215
+ function E(m, y) {
216
216
  for (var w = new Array(y), M = 0; M < y; ++M) w[M] = m[M];
217
217
  return w;
218
218
  }
@@ -252,7 +252,7 @@ var mi, Jt = { exports: {} }, sr = function() {
252
252
  if (R === void 0) return !1;
253
253
  if (typeof R == "function") n(R, this, y);
254
254
  else {
255
- var J = R.length, X = k(R, J);
255
+ var J = R.length, X = E(R, J);
256
256
  for (w = 0; w < J; ++w) n(X[w], this, y);
257
257
  }
258
258
  return !0;
@@ -298,8 +298,8 @@ var mi, Jt = { exports: {} }, sr = function() {
298
298
  }, i.prototype.rawListeners = function(m) {
299
299
  return v(this, m, !1);
300
300
  }, i.listenerCount = function(m, y) {
301
- return typeof m.listenerCount == "function" ? m.listenerCount(y) : E.call(m, y);
302
- }, i.prototype.listenerCount = E, i.prototype.eventNames = function() {
301
+ return typeof m.listenerCount == "function" ? m.listenerCount(y) : k.call(m, y);
302
+ }, i.prototype.listenerCount = k, i.prototype.eventNames = function() {
303
303
  return this._eventsCount > 0 ? t(this._events) : [];
304
304
  }, Jt.exports;
305
305
  }(), qt = Ba(sr), gi = Object.prototype.hasOwnProperty;
@@ -345,7 +345,7 @@ function se(t, e) {
345
345
  }
346
346
  return t != t && e != e;
347
347
  }
348
- const Va = { "Amazon Silk": "amazon_silk", "Android Browser": "android", Bada: "bada", BlackBerry: "blackberry", Chrome: "chrome", Chromium: "chromium", Electron: "electron", Epiphany: "epiphany", Firefox: "firefox", Focus: "focus", Generic: "generic", "Google Search": "google_search", Googlebot: "googlebot", "Internet Explorer": "ie", "K-Meleon": "k_meleon", Maxthon: "maxthon", "Microsoft Edge": "edge", "MZ Browser": "mz", "NAVER Whale Browser": "naver", Opera: "opera", "Opera Coast": "opera_coast", PhantomJS: "phantomjs", Puffin: "puffin", QupZilla: "qupzilla", QQ: "qq", QQLite: "qqlite", Safari: "safari", Sailfish: "sailfish", "Samsung Internet for Android": "samsung_internet", SeaMonkey: "seamonkey", Sleipnir: "sleipnir", Swing: "swing", Tizen: "tizen", "UC Browser": "uc", Vivaldi: "vivaldi", "WebOS Browser": "webos", WeChat: "wechat", "Yandex Browser": "yandex", Roku: "roku" }, wo = { amazon_silk: "Amazon Silk", android: "Android Browser", bada: "Bada", blackberry: "BlackBerry", chrome: "Chrome", chromium: "Chromium", electron: "Electron", epiphany: "Epiphany", firefox: "Firefox", focus: "Focus", generic: "Generic", googlebot: "Googlebot", google_search: "Google Search", ie: "Internet Explorer", k_meleon: "K-Meleon", maxthon: "Maxthon", edge: "Microsoft Edge", mz: "MZ Browser", naver: "NAVER Whale Browser", opera: "Opera", opera_coast: "Opera Coast", phantomjs: "PhantomJS", puffin: "Puffin", qupzilla: "QupZilla", qq: "QQ Browser", qqlite: "QQ Browser Lite", safari: "Safari", sailfish: "Sailfish", samsung_internet: "Samsung Internet for Android", seamonkey: "SeaMonkey", sleipnir: "Sleipnir", swing: "Swing", tizen: "Tizen", uc: "UC Browser", vivaldi: "Vivaldi", webos: "WebOS Browser", wechat: "WeChat", yandex: "Yandex Browser" }, K = { tablet: "tablet", mobile: "mobile", desktop: "desktop", tv: "tv" }, ie = { WindowsPhone: "Windows Phone", Windows: "Windows", MacOS: "macOS", iOS: "iOS", Android: "Android", WebOS: "WebOS", BlackBerry: "BlackBerry", Bada: "Bada", Tizen: "Tizen", Linux: "Linux", ChromeOS: "Chrome OS", PlayStation4: "PlayStation 4", Roku: "Roku" }, Ne = { EdgeHTML: "EdgeHTML", Blink: "Blink", Trident: "Trident", Presto: "Presto", Gecko: "Gecko", WebKit: "WebKit" };
348
+ const Va = { "Amazon Silk": "amazon_silk", "Android Browser": "android", Bada: "bada", BlackBerry: "blackberry", Chrome: "chrome", Chromium: "chromium", Electron: "electron", Epiphany: "epiphany", Firefox: "firefox", Focus: "focus", Generic: "generic", "Google Search": "google_search", Googlebot: "googlebot", "Internet Explorer": "ie", "K-Meleon": "k_meleon", Maxthon: "maxthon", "Microsoft Edge": "edge", "MZ Browser": "mz", "NAVER Whale Browser": "naver", Opera: "opera", "Opera Coast": "opera_coast", PhantomJS: "phantomjs", Puffin: "puffin", QupZilla: "qupzilla", QQ: "qq", QQLite: "qqlite", Safari: "safari", Sailfish: "sailfish", "Samsung Internet for Android": "samsung_internet", SeaMonkey: "seamonkey", Sleipnir: "sleipnir", Swing: "swing", Tizen: "tizen", "UC Browser": "uc", Vivaldi: "vivaldi", "WebOS Browser": "webos", WeChat: "wechat", "Yandex Browser": "yandex", Roku: "roku" }, wo = { amazon_silk: "Amazon Silk", android: "Android Browser", bada: "Bada", blackberry: "BlackBerry", chrome: "Chrome", chromium: "Chromium", electron: "Electron", epiphany: "Epiphany", firefox: "Firefox", focus: "Focus", generic: "Generic", googlebot: "Googlebot", google_search: "Google Search", ie: "Internet Explorer", k_meleon: "K-Meleon", maxthon: "Maxthon", edge: "Microsoft Edge", mz: "MZ Browser", naver: "NAVER Whale Browser", opera: "Opera", opera_coast: "Opera Coast", phantomjs: "PhantomJS", puffin: "Puffin", qupzilla: "QupZilla", qq: "QQ Browser", qqlite: "QQ Browser Lite", safari: "Safari", sailfish: "Sailfish", samsung_internet: "Samsung Internet for Android", seamonkey: "SeaMonkey", sleipnir: "Sleipnir", swing: "Swing", tizen: "Tizen", uc: "UC Browser", vivaldi: "Vivaldi", webos: "WebOS Browser", wechat: "WeChat", yandex: "Yandex Browser" }, Q = { tablet: "tablet", mobile: "mobile", desktop: "desktop", tv: "tv" }, ie = { WindowsPhone: "Windows Phone", Windows: "Windows", MacOS: "macOS", iOS: "iOS", Android: "Android", WebOS: "WebOS", BlackBerry: "BlackBerry", Bada: "Bada", Tizen: "Tizen", Linux: "Linux", ChromeOS: "Chrome OS", PlayStation4: "PlayStation 4", Roku: "Roku" }, Ne = { EdgeHTML: "EdgeHTML", Blink: "Blink", Trident: "Trident", Presto: "Presto", Gecko: "Gecko", WebKit: "WebKit" };
349
349
  class T {
350
350
  static getFirstMatch(e, n) {
351
351
  const r = n.match(e);
@@ -424,7 +424,7 @@ class T {
424
424
  let a = Math.max(i, s), c = 0;
425
425
  const l = T.map([e, n], (f) => {
426
426
  const h = a - T.getVersionPrecision(f), v = f + new Array(h + 1).join(".0");
427
- return T.map(v.split("."), (E) => new Array(20 - E.length).join("0") + E).reverse();
427
+ return T.map(v.split("."), (k) => new Array(20 - k.length).join("0") + k).reverse();
428
428
  });
429
429
  for (r && (c = a - Math.min(i, s)), a -= 1; a >= c; ) {
430
430
  if (l[0][a] > l[1][a]) return 1;
@@ -641,18 +641,18 @@ var qa = [{ test: [/Roku\/DVP/], describe(t) {
641
641
  const e = T.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, t);
642
642
  return { name: ie.PlayStation4, version: e };
643
643
  } }], $a = [{ test: [/googlebot/i], describe: () => ({ type: "bot", vendor: "Google" }) }, { test: [/huawei/i], describe(t) {
644
- const e = T.getFirstMatch(/(can-l01)/i, t) && "Nova", n = { type: K.mobile, vendor: "Huawei" };
644
+ const e = T.getFirstMatch(/(can-l01)/i, t) && "Nova", n = { type: Q.mobile, vendor: "Huawei" };
645
645
  return e && (n.model = e), n;
646
- } }, { test: [/nexus\s*(?:7|8|9|10).*/i], describe: () => ({ type: K.tablet, vendor: "Nexus" }) }, { test: [/ipad/i], describe: () => ({ type: K.tablet, vendor: "Apple", model: "iPad" }) }, { test: [/Macintosh(.*?) FxiOS(.*?)\//], describe: () => ({ type: K.tablet, vendor: "Apple", model: "iPad" }) }, { test: [/kftt build/i], describe: () => ({ type: K.tablet, vendor: "Amazon", model: "Kindle Fire HD 7" }) }, { test: [/silk/i], describe: () => ({ type: K.tablet, vendor: "Amazon" }) }, { test: [/tablet(?! pc)/i], describe: () => ({ type: K.tablet }) }, { test(t) {
646
+ } }, { test: [/nexus\s*(?:7|8|9|10).*/i], describe: () => ({ type: Q.tablet, vendor: "Nexus" }) }, { test: [/ipad/i], describe: () => ({ type: Q.tablet, vendor: "Apple", model: "iPad" }) }, { test: [/Macintosh(.*?) FxiOS(.*?)\//], describe: () => ({ type: Q.tablet, vendor: "Apple", model: "iPad" }) }, { test: [/kftt build/i], describe: () => ({ type: Q.tablet, vendor: "Amazon", model: "Kindle Fire HD 7" }) }, { test: [/silk/i], describe: () => ({ type: Q.tablet, vendor: "Amazon" }) }, { test: [/tablet(?! pc)/i], describe: () => ({ type: Q.tablet }) }, { test(t) {
647
647
  const e = t.test(/ipod|iphone/i), n = t.test(/like (ipod|iphone)/i);
648
648
  return e && !n;
649
649
  }, describe(t) {
650
650
  const e = T.getFirstMatch(/(ipod|iphone)/i, t);
651
- return { type: K.mobile, vendor: "Apple", model: e };
652
- } }, { test: [/nexus\s*[0-6].*/i, /galaxy nexus/i], describe: () => ({ type: K.mobile, vendor: "Nexus" }) }, { test: [/[^-]mobi/i], describe: () => ({ type: K.mobile }) }, { test: (t) => t.getBrowserName(!0) === "blackberry", describe: () => ({ type: K.mobile, vendor: "BlackBerry" }) }, { test: (t) => t.getBrowserName(!0) === "bada", describe: () => ({ type: K.mobile }) }, { test: (t) => t.getBrowserName() === "windows phone", describe: () => ({ type: K.mobile, vendor: "Microsoft" }) }, { test(t) {
651
+ return { type: Q.mobile, vendor: "Apple", model: e };
652
+ } }, { test: [/nexus\s*[0-6].*/i, /galaxy nexus/i], describe: () => ({ type: Q.mobile, vendor: "Nexus" }) }, { test: [/[^-]mobi/i], describe: () => ({ type: Q.mobile }) }, { test: (t) => t.getBrowserName(!0) === "blackberry", describe: () => ({ type: Q.mobile, vendor: "BlackBerry" }) }, { test: (t) => t.getBrowserName(!0) === "bada", describe: () => ({ type: Q.mobile }) }, { test: (t) => t.getBrowserName() === "windows phone", describe: () => ({ type: Q.mobile, vendor: "Microsoft" }) }, { test(t) {
653
653
  const e = Number(String(t.getOSVersion()).split(".")[0]);
654
654
  return t.getOSName(!0) === "android" && e >= 3;
655
- }, describe: () => ({ type: K.tablet }) }, { test: (t) => t.getOSName(!0) === "android", describe: () => ({ type: K.mobile }) }, { test: (t) => t.getOSName(!0) === "macos", describe: () => ({ type: K.desktop, vendor: "Apple" }) }, { test: (t) => t.getOSName(!0) === "windows", describe: () => ({ type: K.desktop }) }, { test: (t) => t.getOSName(!0) === "linux", describe: () => ({ type: K.desktop }) }, { test: (t) => t.getOSName(!0) === "playstation 4", describe: () => ({ type: K.tv }) }, { test: (t) => t.getOSName(!0) === "roku", describe: () => ({ type: K.tv }) }], za = [{ test: (t) => t.getBrowserName(!0) === "microsoft edge", describe(t) {
655
+ }, describe: () => ({ type: Q.tablet }) }, { test: (t) => t.getOSName(!0) === "android", describe: () => ({ type: Q.mobile }) }, { test: (t) => t.getOSName(!0) === "macos", describe: () => ({ type: Q.desktop, vendor: "Apple" }) }, { test: (t) => t.getOSName(!0) === "windows", describe: () => ({ type: Q.desktop }) }, { test: (t) => t.getOSName(!0) === "linux", describe: () => ({ type: Q.desktop }) }, { test: (t) => t.getOSName(!0) === "playstation 4", describe: () => ({ type: Q.tv }) }, { test: (t) => t.getOSName(!0) === "roku", describe: () => ({ type: Q.tv }) }], za = [{ test: (t) => t.getBrowserName(!0) === "microsoft edge", describe(t) {
656
656
  if (/\sedg\//i.test(t)) return { name: Ne.Blink };
657
657
  const e = T.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, t);
658
658
  return { name: Ne.EdgeHTML, version: e };
@@ -833,7 +833,7 @@ class Ha {
833
833
  return ie;
834
834
  }
835
835
  static get PLATFORMS_MAP() {
836
- return K;
836
+ return Q;
837
837
  }
838
838
  }
839
839
  function En() {
@@ -1612,13 +1612,13 @@ function cc(t) {
1612
1612
  if (a) return a;
1613
1613
  const c = xo(t.spanContext().traceId, e), l = qr(n), f = l.data || {}, h = f["sentry.sample_rate"];
1614
1614
  h != null && (c.sample_rate = `${h}`);
1615
- const v = f["sentry.source"], E = l.description;
1616
- return v !== "url" && E && (c.transaction = E), function(k) {
1615
+ const v = f["sentry.source"], k = l.description;
1616
+ return v !== "url" && k && (c.transaction = k), function(E) {
1617
1617
  if (typeof __SENTRY_TRACING__ == "boolean" && !__SENTRY_TRACING__) return !1;
1618
1618
  const b = te(), m = b && b.getOptions();
1619
1619
  return !!m && (m.enableTracing || "tracesSampleRate" in m || "tracesSampler" in m);
1620
- }() && (c.sampled = String(function(k) {
1621
- const { traceFlags: b } = k.spanContext();
1620
+ }() && (c.sampled = String(function(E) {
1621
+ const { traceFlags: b } = E.spanContext();
1622
1622
  return b === 1;
1623
1623
  }(n))), e.emit("createDsc", c, n), c;
1624
1624
  }
@@ -1638,10 +1638,10 @@ function uc(t) {
1638
1638
  });
1639
1639
  const [i, s, a = "", c = "", l = "", f = ""] = r.slice(1);
1640
1640
  let h = "", v = f;
1641
- const E = v.split("/");
1642
- if (E.length > 1 && (h = E.slice(0, -1).join("/"), v = E.pop()), v) {
1643
- const k = v.match(/^\d+/);
1644
- k && (v = k[0]);
1641
+ const k = v.split("/");
1642
+ if (k.length > 1 && (h = k.slice(0, -1).join("/"), v = k.pop()), v) {
1643
+ const E = v.match(/^\d+/);
1644
+ E && (v = E[0]);
1645
1645
  }
1646
1646
  return Ni({ host: c, pass: a, path: h, projectId: v, port: l, protocol: i, publicKey: s });
1647
1647
  }(t) : Ni(t);
@@ -1683,10 +1683,10 @@ function fr(t, e, n = 1 / 0, r = 1 / 0, i = /* @__PURE__ */ function() {
1683
1683
  }()) {
1684
1684
  const [s, a] = i;
1685
1685
  if (e == null || ["boolean", "string"].includes(typeof e) || typeof e == "number" && Number.isFinite(e)) return e;
1686
- const c = function(k, b) {
1686
+ const c = function(E, b) {
1687
1687
  try {
1688
- if (k === "domain" && b && typeof b == "object" && b._events) return "[Domain]";
1689
- if (k === "domainEmitter") return "[DomainEmitter]";
1688
+ if (E === "domain" && b && typeof b == "object" && b._events) return "[Domain]";
1689
+ if (E === "domainEmitter") return "[DomainEmitter]";
1690
1690
  if (typeof global < "u" && b === global) return "[Global]";
1691
1691
  if (typeof window < "u" && b === window) return "[Window]";
1692
1692
  if (typeof document < "u" && b === document) return "[Document]";
@@ -1718,15 +1718,15 @@ function fr(t, e, n = 1 / 0, r = 1 / 0, i = /* @__PURE__ */ function() {
1718
1718
  }
1719
1719
  const h = Array.isArray(e) ? [] : {};
1720
1720
  let v = 0;
1721
- const E = Oo(e);
1722
- for (const k in E) {
1723
- if (!Object.prototype.hasOwnProperty.call(E, k)) continue;
1721
+ const k = Oo(e);
1722
+ for (const E in k) {
1723
+ if (!Object.prototype.hasOwnProperty.call(k, E)) continue;
1724
1724
  if (v >= r) {
1725
- h[k] = "[MaxProperties ~]";
1725
+ h[E] = "[MaxProperties ~]";
1726
1726
  break;
1727
1727
  }
1728
- const b = E[k];
1729
- h[k] = fr(k, b, l - 1, r, i), v++;
1728
+ const b = k[E];
1729
+ h[E] = fr(E, b, l - 1, r, i), v++;
1730
1730
  }
1731
1731
  return a(e), h;
1732
1732
  }
@@ -1812,14 +1812,14 @@ let Ht, Bi, Fn;
1812
1812
  function gc(t, e) {
1813
1813
  const { fingerprint: n, span: r, breadcrumbs: i, sdkProcessingMetadata: s } = e;
1814
1814
  (function(a, c) {
1815
- const { extra: l, tags: f, user: h, contexts: v, level: E, transactionName: k } = c, b = me(l);
1815
+ const { extra: l, tags: f, user: h, contexts: v, level: k, transactionName: E } = c, b = me(l);
1816
1816
  b && Object.keys(b).length && (a.extra = { ...b, ...a.extra });
1817
1817
  const m = me(f);
1818
1818
  m && Object.keys(m).length && (a.tags = { ...m, ...a.tags });
1819
1819
  const y = me(h);
1820
1820
  y && Object.keys(y).length && (a.user = { ...y, ...a.user });
1821
1821
  const w = me(v);
1822
- w && Object.keys(w).length && (a.contexts = { ...w, ...a.contexts }), E && (a.level = E), k && a.type !== "transaction" && (a.transaction = k);
1822
+ w && Object.keys(w).length && (a.contexts = { ...w, ...a.contexts }), k && (a.level = k), E && a.type !== "transaction" && (a.transaction = E);
1823
1823
  })(t, e), r && function(a, c) {
1824
1824
  a.contexts = { trace: sc(c), ...a.contexts }, a.sdkProcessingMetadata = { dynamicSamplingContext: cc(c), ...a.sdkProcessingMetadata };
1825
1825
  const l = Po(c), f = qr(l).description;
@@ -1834,8 +1834,8 @@ function gc(t, e) {
1834
1834
  }(t, s);
1835
1835
  }
1836
1836
  function Vi(t, e) {
1837
- const { extra: n, tags: r, user: i, contexts: s, level: a, sdkProcessingMetadata: c, breadcrumbs: l, fingerprint: f, eventProcessors: h, attachments: v, propagationContext: E, transactionName: k, span: b } = e;
1838
- Wt(t, "extra", n), Wt(t, "tags", r), Wt(t, "user", i), Wt(t, "contexts", s), t.sdkProcessingMetadata = On(t.sdkProcessingMetadata, c, 2), a && (t.level = a), k && (t.transactionName = k), b && (t.span = b), l.length && (t.breadcrumbs = [...t.breadcrumbs, ...l]), f.length && (t.fingerprint = [...t.fingerprint, ...f]), h.length && (t.eventProcessors = [...t.eventProcessors, ...h]), v.length && (t.attachments = [...t.attachments, ...v]), t.propagationContext = { ...t.propagationContext, ...E };
1837
+ const { extra: n, tags: r, user: i, contexts: s, level: a, sdkProcessingMetadata: c, breadcrumbs: l, fingerprint: f, eventProcessors: h, attachments: v, propagationContext: k, transactionName: E, span: b } = e;
1838
+ Wt(t, "extra", n), Wt(t, "tags", r), Wt(t, "user", i), Wt(t, "contexts", s), t.sdkProcessingMetadata = On(t.sdkProcessingMetadata, c, 2), a && (t.level = a), E && (t.transactionName = E), b && (t.span = b), l.length && (t.breadcrumbs = [...t.breadcrumbs, ...l]), f.length && (t.fingerprint = [...t.fingerprint, ...f]), h.length && (t.eventProcessors = [...t.eventProcessors, ...h]), v.length && (t.attachments = [...t.attachments, ...v]), t.propagationContext = { ...t.propagationContext, ...k };
1839
1839
  }
1840
1840
  function Wt(t, e, n) {
1841
1841
  t[e] = On(t[e], n, 1);
@@ -1888,10 +1888,10 @@ function vc(t, e, n, r, i, s) {
1888
1888
  return y.update(m), y;
1889
1889
  }(r, n.captureContext);
1890
1890
  n.mechanism && ht(l, n.mechanism);
1891
- const v = i ? i.getEventProcessors() : [], E = hn("globalScope", () => new Be()).getScopeData();
1892
- s && Vi(E, s.getScopeData()), h && Vi(E, h.getScopeData());
1893
- const k = [...n.attachments || [], ...E.attachments];
1894
- return k.length && (n.attachments = k), gc(l, E), pr([...v, ...E.eventProcessors], l, n).then((b) => (b && function(m) {
1891
+ const v = i ? i.getEventProcessors() : [], k = hn("globalScope", () => new Be()).getScopeData();
1892
+ s && Vi(k, s.getScopeData()), h && Vi(k, h.getScopeData());
1893
+ const E = [...n.attachments || [], ...k.attachments];
1894
+ return E.length && (n.attachments = E), gc(l, k), pr([...v, ...k.eventProcessors], l, n).then((b) => (b && function(m) {
1895
1895
  const y = {};
1896
1896
  try {
1897
1897
  m.exception.values.forEach((M) => {
@@ -2122,17 +2122,17 @@ class bc {
2122
2122
  });
2123
2123
  }
2124
2124
  _processEvent(e, n, r) {
2125
- const i = this.getOptions(), { sampleRate: s } = i, a = Qi(e), c = Ki(e), l = e.type || "error", f = `before send for type \`${l}\``, h = s === void 0 ? void 0 : function(k) {
2126
- if (typeof k == "boolean") return Number(k);
2127
- const b = typeof k == "string" ? parseFloat(k) : k;
2125
+ const i = this.getOptions(), { sampleRate: s } = i, a = Qi(e), c = Ki(e), l = e.type || "error", f = `before send for type \`${l}\``, h = s === void 0 ? void 0 : function(E) {
2126
+ if (typeof E == "boolean") return Number(E);
2127
+ const b = typeof E == "string" ? parseFloat(E) : E;
2128
2128
  if (!(typeof b != "number" || isNaN(b) || b < 0 || b > 1)) return b;
2129
- W && N.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(k)} of type ${JSON.stringify(typeof k)}.`);
2129
+ W && N.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(E)} of type ${JSON.stringify(typeof E)}.`);
2130
2130
  }(s);
2131
2131
  if (c && typeof h == "number" && Math.random() > h) return this.recordDroppedEvent("sample_rate", "error", e), mn(new be(`Discarding event because it's not included in the random sample (sampling rate = ${s})`, "log"));
2132
- const v = l === "replay_event" ? "replay" : l, E = (e.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
2133
- return this._prepareEvent(e, n, r, E).then((k) => {
2134
- if (k === null) throw this.recordDroppedEvent("event_processor", v, e), new be("An event processor returned `null`, will not send event.", "log");
2135
- if (n.data && n.data.__sentry__ === !0) return k;
2132
+ const v = l === "replay_event" ? "replay" : l, k = (e.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
2133
+ return this._prepareEvent(e, n, r, k).then((E) => {
2134
+ if (E === null) throw this.recordDroppedEvent("event_processor", v, e), new be("An event processor returned `null`, will not send event.", "log");
2135
+ if (n.data && n.data.__sentry__ === !0) return E;
2136
2136
  const b = function(m, y, w, M) {
2137
2137
  const { beforeSend: A, beforeSendTransaction: j, beforeSendSpan: x } = y;
2138
2138
  if (Ki(w) && A) return A(w, M);
@@ -2154,7 +2154,7 @@ class bc {
2154
2154
  }
2155
2155
  }
2156
2156
  return w;
2157
- }(this, i, k, n);
2157
+ }(this, i, E, n);
2158
2158
  return function(m, y) {
2159
2159
  const w = `${y} must return \`null\` or a valid event.`;
2160
2160
  if (Mn(m)) return m.then((M) => {
@@ -2166,8 +2166,8 @@ class bc {
2166
2166
  if (!ft(m) && m !== null) throw new be(w);
2167
2167
  return m;
2168
2168
  }(b, f);
2169
- }).then((k) => {
2170
- if (k === null) {
2169
+ }).then((E) => {
2170
+ if (E === null) {
2171
2171
  if (this.recordDroppedEvent("before_send", v, e), a) {
2172
2172
  const y = 1 + (e.spans || []).length;
2173
2173
  this.recordDroppedEvent("before_send", "span", y);
@@ -2175,19 +2175,19 @@ class bc {
2175
2175
  throw new be(`${f} returned \`null\`, will not send event.`, "log");
2176
2176
  }
2177
2177
  const b = r && r.getSession();
2178
- if (!a && b && this._updateSessionFromEvent(b, k), a) {
2179
- const y = (k.sdkProcessingMetadata && k.sdkProcessingMetadata.spanCountBeforeProcessing || 0) - (k.spans ? k.spans.length : 0);
2178
+ if (!a && b && this._updateSessionFromEvent(b, E), a) {
2179
+ const y = (E.sdkProcessingMetadata && E.sdkProcessingMetadata.spanCountBeforeProcessing || 0) - (E.spans ? E.spans.length : 0);
2180
2180
  y > 0 && this.recordDroppedEvent("before_send", "span", y);
2181
2181
  }
2182
- const m = k.transaction_info;
2183
- if (a && m && k.transaction !== e.transaction) {
2182
+ const m = E.transaction_info;
2183
+ if (a && m && E.transaction !== e.transaction) {
2184
2184
  const y = "custom";
2185
- k.transaction_info = { ...m, source: y };
2185
+ E.transaction_info = { ...m, source: y };
2186
2186
  }
2187
- return this.sendEvent(k, n), k;
2188
- }).then(null, (k) => {
2189
- throw k instanceof be ? k : (this.captureException(k, { data: { __sentry__: !0 }, originalException: k }), new be(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
2190
- Reason: ${k}`));
2187
+ return this.sendEvent(E, n), E;
2188
+ }).then(null, (E) => {
2189
+ throw E instanceof be ? E : (this.captureException(E, { data: { __sentry__: !0 }, originalException: E }), new be(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
2190
+ Reason: ${E}`));
2191
2191
  });
2192
2192
  }
2193
2193
  _process(e) {
@@ -2245,9 +2245,9 @@ function _c(t) {
2245
2245
  function wc(t, { statusCode: e, headers: n }, r = Date.now()) {
2246
2246
  const i = { ...t }, s = n && n["x-sentry-rate-limits"], a = n && n["retry-after"];
2247
2247
  if (s) for (const c of s.trim().split(",")) {
2248
- const [l, f, , , h] = c.split(":", 5), v = parseInt(l, 10), E = 1e3 * (isNaN(v) ? 60 : v);
2249
- if (f) for (const k of f.split(";")) k === "metric_bucket" && h && !h.split(";").includes("custom") || (i[k] = r + E);
2250
- else i.all = r + E;
2248
+ const [l, f, , , h] = c.split(":", 5), v = parseInt(l, 10), k = 1e3 * (isNaN(v) ? 60 : v);
2249
+ if (f) for (const E of f.split(";")) E === "metric_bucket" && h && !h.split(";").includes("custom") || (i[E] = r + k);
2250
+ else i.all = r + k;
2251
2251
  }
2252
2252
  else a ? i.all = r + function(c, l = Date.now()) {
2253
2253
  const f = parseInt(`${c}`, 10);
@@ -2263,10 +2263,10 @@ function Sc(t, e, n = _c(t.bufferSize || 64)) {
2263
2263
  const s = [];
2264
2264
  if (Fi(i, (l, f) => {
2265
2265
  const h = Ui(f);
2266
- if (function(v, E, k = Date.now()) {
2266
+ if (function(v, k, E = Date.now()) {
2267
2267
  return function(b, m) {
2268
2268
  return b[m] || b.all || 0;
2269
- }(v, E) > k;
2269
+ }(v, k) > E;
2270
2270
  }(r, h)) {
2271
2271
  const v = Xi(l, f);
2272
2272
  t.recordDroppedEvent("ratelimit_backoff", h, v);
@@ -2326,12 +2326,12 @@ Event: ${Fe(a)}`), !0) : function(l, f) {
2326
2326
  return l.type || !f || !f.length ? !1 : function(h) {
2327
2327
  const v = [];
2328
2328
  h.message && v.push(h.message);
2329
- let E;
2329
+ let k;
2330
2330
  try {
2331
- E = h.exception.values[h.exception.values.length - 1];
2331
+ k = h.exception.values[h.exception.values.length - 1];
2332
2332
  } catch {
2333
2333
  }
2334
- return E && E.value && (v.push(E.value), E.type && v.push(`${E.type}: ${E.value}`)), v;
2334
+ return k && k.value && (v.push(k.value), k.type && v.push(`${k.type}: ${k.value}`)), v;
2335
2335
  }(l).some((h) => zt(h, f));
2336
2336
  }(a, c.ignoreErrors) ? (W && N.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
2337
2337
  Event: ${Fe(a)}`), !0) : function(l) {
@@ -2392,8 +2392,8 @@ function mr(t, e, n, r, i, s, a, c) {
2392
2392
  return Array.isArray(r.errors) && r.errors.forEach((f, h) => {
2393
2393
  if (Ze(f, Error)) {
2394
2394
  es(a, c);
2395
- const v = t(e, f), E = l.length;
2396
- ts(v, `errors[${h}]`, E, c), l = mr(t, e, n, f, i, [v, ...l], v, E);
2395
+ const v = t(e, f), k = l.length;
2396
+ ts(v, `errors[${h}]`, k, c), l = mr(t, e, n, f, i, [v, ...l], v, k);
2397
2397
  }
2398
2398
  }), l;
2399
2399
  }
@@ -2502,11 +2502,11 @@ function jc(t, e) {
2502
2502
  const c = new Error(), { method: l, url: f } = function(v) {
2503
2503
  if (v.length === 0) return { method: "GET", url: "" };
2504
2504
  if (v.length === 2) {
2505
- const [k, b] = v;
2506
- return { url: os(k), method: vr(b, "method") ? String(b.method).toUpperCase() : "GET" };
2505
+ const [E, b] = v;
2506
+ return { url: os(E), method: vr(b, "method") ? String(b.method).toUpperCase() : "GET" };
2507
2507
  }
2508
- const E = v[0];
2509
- return { url: os(E), method: vr(E, "method") ? String(E.method).toUpperCase() : "GET" };
2508
+ const k = v[0];
2509
+ return { url: os(k), method: vr(k, "method") ? String(k.method).toUpperCase() : "GET" };
2510
2510
  }(a), h = { args: a, fetchData: { method: l, url: f }, startTimestamp: 1e3 * Ie(), virtualError: c };
2511
2511
  return r || _e("fetch", { ...h }), s.apply($, a).then(async (v) => (r ? r(v) : _e("fetch", { ...h, endTimestamp: 1e3 * Ie(), response: v }), v), (v) => {
2512
2512
  throw _e("fetch", { ...h, endTimestamp: 1e3 * Ie(), error: v }), Nr(v) && v.stack === void 0 && (v.stack = c.stack, et(v, "framesToPop", 1)), v;
@@ -2815,8 +2815,8 @@ function Jc() {
2815
2815
  }
2816
2816
  };
2817
2817
  return "onreadystatechange" in n && typeof n.onreadystatechange == "function" ? n.onreadystatechange = new Proxy(n.onreadystatechange, { apply: (f, h, v) => (l(), f.apply(h, v)) }) : n.addEventListener("readystatechange", l), n.setRequestHeader = new Proxy(n.setRequestHeader, { apply(f, h, v) {
2818
- const [E, k] = v, b = h[Mt];
2819
- return b && xe(E) && xe(k) && (b.request_headers[E.toLowerCase()] = k), f.apply(h, v);
2818
+ const [k, E] = v, b = h[Mt];
2819
+ return b && xe(k) && xe(E) && (b.request_headers[k.toLowerCase()] = E), f.apply(h, v);
2820
2820
  } }), e.apply(n, r);
2821
2821
  } }), t.send = new Proxy(t.send, { apply(e, n, r) {
2822
2822
  const i = n[Mt];
@@ -2933,10 +2933,10 @@ const $c = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, zc = /^\s*at (?:(.+?\)(?: \
2933
2933
  let c, l, f = typeof s == "object" ? s.serializeAttribute : void 0, h = typeof s == "object" && typeof s.maxStringLength == "number" ? s.maxStringLength : void 0;
2934
2934
  h && h > fs && (An && N.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${h} was configured. Sentry will use 1024 instead.`), h = fs), typeof f == "string" && (f = [f]);
2935
2935
  try {
2936
- const E = a.event, k = function(b) {
2936
+ const k = a.event, E = function(b) {
2937
2937
  return !!b && !!b.target;
2938
- }(E) ? E.target : E;
2939
- c = Co(k, { keyAttrs: f, maxStringLength: h }), l = function(b) {
2938
+ }(k) ? k.target : k;
2939
+ c = Co(E, { keyAttrs: f, maxStringLength: h }), l = function(b) {
2940
2940
  if (!Ur.HTMLElement) return null;
2941
2941
  let m = b;
2942
2942
  for (let y = 0; y < 5; y++) {
@@ -2948,7 +2948,7 @@ const $c = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, zc = /^\s*at (?:(.+?\)(?: \
2948
2948
  m = m.parentNode;
2949
2949
  }
2950
2950
  return null;
2951
- }(k);
2951
+ }(E);
2952
2952
  } catch {
2953
2953
  c = "<unknown>";
2954
2954
  }
@@ -2963,8 +2963,8 @@ const $c = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, zc = /^\s*at (?:(.+?\)(?: \
2963
2963
  if (te() !== i) return;
2964
2964
  const { startTimestamp: a, endTimestamp: c } = s, l = s.xhr[Mt];
2965
2965
  if (!a || !c || !l) return;
2966
- const { method: f, url: h, status_code: v, body: E } = l, k = { method: f, url: h, status_code: v }, b = { xhr: s.xhr, input: E, startTimestamp: a, endTimestamp: c };
2967
- qe({ category: "xhr", data: k, type: "http", level: ss(v) }, b);
2966
+ const { method: f, url: h, status_code: v, body: k } = l, E = { method: f, url: h, status_code: v }, b = { xhr: s.xhr, input: k, startTimestamp: a, endTimestamp: c };
2967
+ qe({ category: "xhr", data: E, type: "http", level: ss(v) }, b);
2968
2968
  };
2969
2969
  }(n)), e.fetch && jc(/* @__PURE__ */ function(i) {
2970
2970
  return function(s) {
@@ -3059,17 +3059,17 @@ const nl = () => ({ name: "BrowserSession", setupOnce() {
3059
3059
  })((i) => {
3060
3060
  const { stackParser: s, attachStacktrace: a } = ms();
3061
3061
  if (te() !== r || as()) return;
3062
- const { msg: c, url: l, line: f, column: h, error: v } = i, E = function(k, b, m, y) {
3063
- const w = k.exception = k.exception || {}, M = w.values = w.values || [], A = M[0] = M[0] || {}, j = A.stacktrace = A.stacktrace || {}, x = j.frames = j.frames || [], R = y, J = m, X = xe(b) && b.length > 0 ? b : function() {
3062
+ const { msg: c, url: l, line: f, column: h, error: v } = i, k = function(E, b, m, y) {
3063
+ const w = E.exception = E.exception || {}, M = w.values = w.values || [], A = M[0] = M[0] || {}, j = A.stacktrace = A.stacktrace || {}, x = j.frames = j.frames || [], R = y, J = m, X = xe(b) && b.length > 0 ? b : function() {
3064
3064
  try {
3065
3065
  return Ur.document.location.href;
3066
3066
  } catch {
3067
3067
  return "";
3068
3068
  }
3069
3069
  }();
3070
- return x.length === 0 && x.push({ colno: R, filename: X, function: We, in_app: !0, lineno: J }), k;
3070
+ return x.length === 0 && x.push({ colno: R, filename: X, function: We, in_app: !0, lineno: J }), E;
3071
3071
  }(br(s, v || c, void 0, a, !1), l, f, h);
3072
- E.level = "error", Ji(E, { originalException: v, mechanism: { handled: !1, type: "onerror" } });
3072
+ k.level = "error", Ji(k, { originalException: v, mechanism: { handled: !1, type: "onerror" } });
3073
3073
  });
3074
3074
  }(n), ps("onerror")), e.onunhandledrejection && (function(r) {
3075
3075
  (function(i) {
@@ -4022,8 +4022,8 @@ var Xo = function() {
4022
4022
  } else {
4023
4023
  if (q(e[s]) !== "object") return [!1, "invalid (non-object) value for field '".concat(s, "' in canReceive")];
4024
4024
  for (var f = 0, h = Object.values(e[s]); f < h.length; f++) {
4025
- var v = h[f], E = re(ee.validateJSONObject(v), 2), k = E[0], b = E[1];
4026
- if (!k) return [!1, b];
4025
+ var v = h[f], k = re(ee.validateJSONObject(v), 2), E = k[0], b = k[1];
4026
+ if (!E) return [!1, b];
4027
4027
  }
4028
4028
  }
4029
4029
  }
@@ -4278,15 +4278,15 @@ var $e = {}, Ks = "video", Lu = "voice", Qs = B() ? { data: {} } : { data: {}, t
4278
4278
  (s instanceof Array || Array.isArray(s)) && (t.canSend = new Set(s));
4279
4279
  break;
4280
4280
  case "canReceive":
4281
- var h = re(Xo.validateJSONObject(s), 2), v = h[0], E = h[1];
4282
- if (!v) return console.error(E), !1;
4281
+ var h = re(Xo.validateJSONObject(s), 2), v = h[0], k = h[1];
4282
+ if (!v) return console.error(k), !1;
4283
4283
  break;
4284
4284
  case "canAdmin":
4285
4285
  if (s instanceof Set || s instanceof Array || Array.isArray(s)) {
4286
- var k, b = ["participants", "streaming", "transcription"], m = Ws(s);
4286
+ var E, b = ["participants", "streaming", "transcription"], m = Ws(s);
4287
4287
  try {
4288
- for (m.s(); !(k = m.n()).done; ) {
4289
- var y = k.value;
4288
+ for (m.s(); !(E = m.n()).done; ) {
4289
+ var y = E.value;
4290
4290
  if (!b.includes(y)) return !1;
4291
4291
  }
4292
4292
  } catch (w) {
@@ -5039,7 +5039,7 @@ var Ru = function() {
5039
5039
  });
5040
5040
  }), function(o) {
5041
5041
  return b.apply(this, arguments);
5042
- }) }, { key: "sendDTMF", value: (k = L(function* (o) {
5042
+ }) }, { key: "sendDTMF", value: (E = L(function* (o) {
5043
5043
  var d = this;
5044
5044
  return H(this._callState, "sendDTMF()"), function(u) {
5045
5045
  var p = u.sessionId, g = u.tones;
@@ -5054,7 +5054,7 @@ var Ru = function() {
5054
5054
  });
5055
5055
  });
5056
5056
  }), function(o) {
5057
- return k.apply(this, arguments);
5057
+ return E.apply(this, arguments);
5058
5058
  }) }, { key: "getNetworkStats", value: function() {
5059
5059
  var o = this;
5060
5060
  return this._callState !== He ? Promise.resolve(I({ stats: { latest: {} } }, this._network)) : new Promise(function(d) {
@@ -5062,7 +5062,7 @@ var Ru = function() {
5062
5062
  d(I(I({}, o._network), {}, { stats: u.stats }));
5063
5063
  });
5064
5064
  });
5065
- } }, { key: "testWebsocketConnectivity", value: (E = L(function* () {
5065
+ } }, { key: "testWebsocketConnectivity", value: (k = L(function* () {
5066
5066
  var o = this;
5067
5067
  if (er(this._testCallInProgress, "testWebsocketConnectivity()"), this.needsLoad()) try {
5068
5068
  yield this.load();
@@ -5075,7 +5075,7 @@ var Ru = function() {
5075
5075
  });
5076
5076
  });
5077
5077
  }), function() {
5078
- return E.apply(this, arguments);
5078
+ return k.apply(this, arguments);
5079
5079
  }) }, { key: "abortTestWebsocketConnectivity", value: function() {
5080
5080
  this.sendMessageToCallMachine({ action: "abort-test-websocket-connectivity" });
5081
5081
  } }, { key: "_validateVideoTrackForNetworkTests", value: function(o) {
@@ -5764,7 +5764,7 @@ var Ru = function() {
5764
5764
  var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
5765
5765
  return o ? $e[o] : Object.values($e)[0];
5766
5766
  } }]);
5767
- var e, n, r, i, s, a, c, l, f, h, v, E, k, b, m, y, w, M, A, j, x, R, J, X, Oe, ot, at, Zr, ei, ti, ni, ri, ii, si, oi, ai, ci, li;
5767
+ var e, n, r, i, s, a, c, l, f, h, v, k, E, b, m, y, w, M, A, j, x, R, J, X, Oe, ot, at, Zr, ei, ti, ni, ri, ii, si, oi, ai, ci, li;
5768
5768
  }();
5769
5769
  function eo(t) {
5770
5770
  if (t.extension) {
@@ -5855,8 +5855,8 @@ function ea(t) {
5855
5855
  }
5856
5856
  function ta(t, e) {
5857
5857
  for (var n = e.allowAllParticipantsKey, r = function(v) {
5858
- var E = ["local"];
5859
- return n || E.push("*"), v && !E.includes(v);
5858
+ var k = ["local"];
5859
+ return n || k.push("*"), v && !k.includes(v);
5860
5860
  }, i = function(v) {
5861
5861
  return !!(v.layer === void 0 || Number.isInteger(v.layer) && v.layer >= 0 || v.layer === "inherit");
5862
5862
  }, s = function(v) {
@@ -5890,8 +5890,8 @@ function na(t) {
5890
5890
  break;
5891
5891
  case "audio":
5892
5892
  if (q(s) !== "object") return !1;
5893
- for (var v = 0, E = Object.entries(s); v < E.length; v++) {
5894
- var k = re(E[v], 2), b = k[0], m = k[1];
5893
+ for (var v = 0, k = Object.entries(s); v < k.length; v++) {
5894
+ var E = re(k[v], 2), b = E[0], m = E[1];
5895
5895
  switch (b) {
5896
5896
  case "processor":
5897
5897
  if (!Du(m)) return !1;
@@ -5944,13 +5944,13 @@ function Nu(t) {
5944
5944
  if (fn(a.source)) return a.type = "url", !!function(f) {
5945
5945
  var h = new URL(f), v = h.pathname;
5946
5946
  if (h.protocol === "data:") try {
5947
- var E = v.substring(v.indexOf(":") + 1, v.indexOf(";")).split("/")[1];
5948
- return Gn.includes(E);
5947
+ var k = v.substring(v.indexOf(":") + 1, v.indexOf(";")).split("/")[1];
5948
+ return Gn.includes(k);
5949
5949
  } catch (b) {
5950
5950
  return console.error("failed to deduce blob content type", b), !1;
5951
5951
  }
5952
- var k = v.split(".").at(-1).toLowerCase().trim();
5953
- return Gn.includes(k);
5952
+ var E = v.split(".").at(-1).toLowerCase().trim();
5953
+ return Gn.includes(E);
5954
5954
  }(a.source) || (console.error("invalid image type; supported types: [".concat(Gn.join(", "), "]")), !1);
5955
5955
  return c = a.source, l = Number(c), isNaN(l) || !Number.isInteger(l) || l <= 0 || l > 10 ? (console.error("invalid image selection; must be an int, > 0, <= ".concat(10)), !1) : (a.type = "daily-preselect", !0);
5956
5956
  var c, l;
@@ -6001,8 +6001,8 @@ function aa(t) {
6001
6001
  if (!t || t && q(t) !== "object" || Array.isArray(t)) return console.error(sa()), !1;
6002
6002
  for (var e = function(v) {
6003
6003
  return "".concat(v, " should be ").concat(Mr.id[v]);
6004
- }, n = function(v, E) {
6005
- return console.error("customIntegration ".concat(v, ": ").concat(E));
6004
+ }, n = function(v, k) {
6005
+ return console.error("customIntegration ".concat(v, ": ").concat(k));
6006
6006
  }, r = 0, i = Object.entries(t); r < i.length; r++) {
6007
6007
  var s = re(i[r], 1)[0];
6008
6008
  if (!("label" in t[s])) return n(s, "label is required"), !1;
@@ -6430,12 +6430,12 @@ function In(t, e, n) {
6430
6430
  }
6431
6431
  return Pr(b) ? !0 : (e.append(oo(y, m, s), f(b)), !1);
6432
6432
  }
6433
- const v = [], E = Object.assign(Td, {
6433
+ const v = [], k = Object.assign(Td, {
6434
6434
  defaultVisitor: h,
6435
6435
  convertValue: f,
6436
6436
  isVisitable: Pr
6437
6437
  });
6438
- function k(b, m) {
6438
+ function E(b, m) {
6439
6439
  if (!_.isUndefined(b)) {
6440
6440
  if (v.indexOf(b) !== -1)
6441
6441
  throw Error("Circular reference detected in " + m.join("."));
@@ -6445,14 +6445,14 @@ function In(t, e, n) {
6445
6445
  w,
6446
6446
  _.isString(M) ? M.trim() : M,
6447
6447
  m,
6448
- E
6449
- )) === !0 && k(w, m ? m.concat(M) : [M]);
6448
+ k
6449
+ )) === !0 && E(w, m ? m.concat(M) : [M]);
6450
6450
  }), v.pop();
6451
6451
  }
6452
6452
  }
6453
6453
  if (!_.isObject(t))
6454
6454
  throw new TypeError("data must be an object");
6455
- return k(t), e;
6455
+ return E(t), e;
6456
6456
  }
6457
6457
  function ao(t) {
6458
6458
  const e = {
@@ -6931,13 +6931,13 @@ function Hd(t, e) {
6931
6931
  return e = e !== void 0 ? e : 1e3, function(l) {
6932
6932
  const f = Date.now(), h = r[s];
6933
6933
  a || (a = f), n[i] = l, r[i] = f;
6934
- let v = s, E = 0;
6934
+ let v = s, k = 0;
6935
6935
  for (; v !== i; )
6936
- E += n[v++], v = v % t;
6936
+ k += n[v++], v = v % t;
6937
6937
  if (i = (i + 1) % t, i === s && (s = (s + 1) % t), f - a < e)
6938
6938
  return;
6939
- const k = h && f - h;
6940
- return k ? Math.round(E * 1e3 / k) : void 0;
6939
+ const E = h && f - h;
6940
+ return E ? Math.round(k * 1e3 / E) : void 0;
6941
6941
  };
6942
6942
  }
6943
6943
  function Wd(t, e) {
@@ -7022,14 +7022,14 @@ const ho = (t) => t instanceof ce ? { ...t } : t;
7022
7022
  function rt(t, e) {
7023
7023
  e = e || {};
7024
7024
  const n = {};
7025
- function r(f, h, v, E) {
7026
- return _.isPlainObject(f) && _.isPlainObject(h) ? _.merge.call({ caseless: E }, f, h) : _.isPlainObject(h) ? _.merge({}, h) : _.isArray(h) ? h.slice() : h;
7025
+ function r(f, h, v, k) {
7026
+ return _.isPlainObject(f) && _.isPlainObject(h) ? _.merge.call({ caseless: k }, f, h) : _.isPlainObject(h) ? _.merge({}, h) : _.isArray(h) ? h.slice() : h;
7027
7027
  }
7028
- function i(f, h, v, E) {
7028
+ function i(f, h, v, k) {
7029
7029
  if (_.isUndefined(h)) {
7030
7030
  if (!_.isUndefined(f))
7031
- return r(void 0, f, v, E);
7032
- } else return r(f, h, v, E);
7031
+ return r(void 0, f, v, k);
7032
+ } else return r(f, h, v, k);
7033
7033
  }
7034
7034
  function s(f, h) {
7035
7035
  if (!_.isUndefined(h))
@@ -7079,8 +7079,8 @@ function rt(t, e) {
7079
7079
  headers: (f, h, v) => i(ho(f), ho(h), v, !0)
7080
7080
  };
7081
7081
  return _.forEach(Object.keys({ ...t, ...e }), function(h) {
7082
- const v = l[h] || i, E = v(t[h], e[h], h);
7083
- _.isUndefined(E) && v !== c || (n[h] = E);
7082
+ const v = l[h] || i, k = v(t[h], e[h], h);
7083
+ _.isUndefined(k) && v !== c || (n[h] = k);
7084
7084
  }), n;
7085
7085
  }
7086
7086
  const Ma = (t) => {
@@ -7109,9 +7109,9 @@ const Ma = (t) => {
7109
7109
  const i = Ma(t);
7110
7110
  let s = i.data;
7111
7111
  const a = ce.from(i.headers).normalize();
7112
- let { responseType: c, onUploadProgress: l, onDownloadProgress: f } = i, h, v, E, k, b;
7112
+ let { responseType: c, onUploadProgress: l, onDownloadProgress: f } = i, h, v, k, E, b;
7113
7113
  function m() {
7114
- k && k(), b && b(), i.cancelToken && i.cancelToken.unsubscribe(h), i.signal && i.signal.removeEventListener("abort", h);
7114
+ E && E(), b && b(), i.cancelToken && i.cancelToken.unsubscribe(h), i.signal && i.signal.removeEventListener("abort", h);
7115
7115
  }
7116
7116
  let y = new XMLHttpRequest();
7117
7117
  y.open(i.method.toUpperCase(), i.url, !0), y.timeout = i.timeout;
@@ -7151,7 +7151,7 @@ const Ma = (t) => {
7151
7151
  )), y = null;
7152
7152
  }, s === void 0 && a.setContentType(null), "setRequestHeader" in y && _.forEach(a.toJSON(), function(j, x) {
7153
7153
  y.setRequestHeader(x, j);
7154
- }), _.isUndefined(i.withCredentials) || (y.withCredentials = !!i.withCredentials), c && c !== "json" && (y.responseType = i.responseType), f && ([E, b] = _n(f, !0), y.addEventListener("progress", E)), l && y.upload && ([v, k] = _n(l), y.upload.addEventListener("progress", v), y.upload.addEventListener("loadend", k)), (i.cancelToken || i.signal) && (h = (A) => {
7154
+ }), _.isUndefined(i.withCredentials) || (y.withCredentials = !!i.withCredentials), c && c !== "json" && (y.responseType = i.responseType), f && ([k, b] = _n(f, !0), y.addEventListener("progress", k)), l && y.upload && ([v, E] = _n(l), y.upload.addEventListener("progress", v), y.upload.addEventListener("loadend", E)), (i.cancelToken || i.signal) && (h = (A) => {
7155
7155
  y && (r(!A || A.type ? new bt(null, t, y) : A), y.abort(), y = null);
7156
7156
  }, i.cancelToken && i.cancelToken.subscribe(h), i.signal && (i.signal.aborted ? h() : i.signal.addEventListener("abort", h)));
7157
7157
  const M = zd(i.url);
@@ -7227,8 +7227,8 @@ const Ma = (t) => {
7227
7227
  }
7228
7228
  let v = h.byteLength;
7229
7229
  if (n) {
7230
- let E = s += v;
7231
- n(E);
7230
+ let k = s += v;
7231
+ n(k);
7232
7232
  }
7233
7233
  l.enqueue(new Uint8Array(h));
7234
7234
  } catch (f) {
@@ -7297,12 +7297,12 @@ const af = async (t) => {
7297
7297
  responseType: f,
7298
7298
  headers: h,
7299
7299
  withCredentials: v = "same-origin",
7300
- fetchOptions: E
7300
+ fetchOptions: k
7301
7301
  } = Ma(t);
7302
7302
  f = f ? (f + "").toLowerCase() : "text";
7303
- let k = ef([i, s && s.toAbortSignal()], a), b;
7304
- const m = k && k.unsubscribe && (() => {
7305
- k.unsubscribe();
7303
+ let E = ef([i, s && s.toAbortSignal()], a), b;
7304
+ const m = E && E.unsubscribe && (() => {
7305
+ E.unsubscribe();
7306
7306
  });
7307
7307
  let y;
7308
7308
  try {
@@ -7323,15 +7323,15 @@ const af = async (t) => {
7323
7323
  _.isString(v) || (v = v ? "include" : "omit");
7324
7324
  const w = "credentials" in Request.prototype;
7325
7325
  b = new Request(e, {
7326
- ...E,
7327
- signal: k,
7326
+ ...k,
7327
+ signal: E,
7328
7328
  method: n.toUpperCase(),
7329
7329
  headers: h.normalize().toJSON(),
7330
7330
  body: r,
7331
7331
  duplex: "half",
7332
7332
  credentials: w ? v : void 0
7333
7333
  });
7334
- let M = await fetch(b, E);
7334
+ let M = await fetch(b, k);
7335
7335
  const A = jr && (f === "stream" || f === "response");
7336
7336
  if (jr && (c || A && m)) {
7337
7337
  const x = {};
@@ -7552,30 +7552,30 @@ let Ye = class {
7552
7552
  this.interceptors.response.forEach(function(m) {
7553
7553
  f.push(m.fulfilled, m.rejected);
7554
7554
  });
7555
- let h, v = 0, E;
7555
+ let h, v = 0, k;
7556
7556
  if (!l) {
7557
7557
  const b = [vo.bind(this), void 0];
7558
- for (b.unshift(...c), b.push(...f), E = b.length, h = Promise.resolve(n); v < E; )
7558
+ for (b.unshift(...c), b.push(...f), k = b.length, h = Promise.resolve(n); v < k; )
7559
7559
  h = h.then(b[v++], b[v++]);
7560
7560
  return h;
7561
7561
  }
7562
- E = c.length;
7563
- let k = n;
7564
- for (v = 0; v < E; ) {
7562
+ k = c.length;
7563
+ let E = n;
7564
+ for (v = 0; v < k; ) {
7565
7565
  const b = c[v++], m = c[v++];
7566
7566
  try {
7567
- k = b(k);
7567
+ E = b(E);
7568
7568
  } catch (y) {
7569
7569
  m.call(this, y);
7570
7570
  break;
7571
7571
  }
7572
7572
  }
7573
7573
  try {
7574
- h = vo.call(this, k);
7574
+ h = vo.call(this, E);
7575
7575
  } catch (b) {
7576
7576
  return Promise.reject(b);
7577
7577
  }
7578
- for (v = 0, E = f.length; v < E; )
7578
+ for (v = 0, k = f.length; v < k; )
7579
7579
  h = h.then(f[v++], f[v++]);
7580
7580
  return h;
7581
7581
  }
@@ -7913,23 +7913,25 @@ class wf {
7913
7913
  * @param param2 Configuration options if the first parameter is a DOM element.
7914
7914
  */
7915
7915
  constructor(e, n) {
7916
- Q(this, "inited", !1);
7917
- Q(this, "mediaStream");
7918
- Q(this, "session_id", "");
7919
- Q(this, "sessionData", null);
7920
- Q(this, "uiConfig", {
7916
+ K(this, "inited", !1);
7917
+ K(this, "mediaStream");
7918
+ K(this, "session_id", "");
7919
+ K(this, "sessionData", null);
7920
+ K(this, "uiConfig", {
7921
7921
  background: { transparent: !0 }
7922
7922
  });
7923
- Q(this, "config");
7924
- Q(this, "shadow", null);
7925
- Q(this, "frameHandle", 0);
7926
- Q(this, "rootElement");
7927
- Q(this, "abortController");
7928
- Q(this, "timeout", 0);
7929
- Q(this, "keepAlive", !1);
7930
- Q(this, "fetcher");
7931
- Q(this, "call");
7932
- Q(this, "handlers", {});
7923
+ K(this, "config");
7924
+ K(this, "shadow", null);
7925
+ K(this, "frameHandle", 0);
7926
+ K(this, "rootElement");
7927
+ K(this, "abortController");
7928
+ K(this, "timeout", 0);
7929
+ K(this, "keepAlive", !1);
7930
+ K(this, "fetcher");
7931
+ K(this, "call");
7932
+ K(this, "handlers", {});
7933
+ K(this, "lastLocalAudioState", null);
7934
+ K(this, "lastLocalMicState", null);
7933
7935
  if (typeof window > "u")
7934
7936
  throw new Error("Unfortunately, SDK only works on the client side.");
7935
7937
  const [r, i] = this.parseConfig(e, n), { apiHost: s = Ra, sessionToken: a, preloadBundle: c, preconnect: l, keepAlive: f } = this.config = r;
@@ -7950,7 +7952,7 @@ class wf {
7950
7952
  i = n;
7951
7953
  } else
7952
7954
  i = e;
7953
- return typeof i.immediatelyJoin > "u" && (i.immediatelyJoin = !0), typeof i.audioSource > "u" && (i.audioSource = !1), [i, r];
7955
+ return typeof i.immediatelyJoin > "u" && (i.immediatelyJoin = !0), typeof i.audioSource > "u" && (i.audioSource = !1), typeof i.startAudioOff > "u" && (i.startAudioOff = !i.audioSource), [i, r];
7954
7956
  } catch {
7955
7957
  throw new Error("Filed to parse configuration object. Bad configuration!");
7956
7958
  }
@@ -7996,13 +7998,17 @@ class wf {
7996
7998
  });
7997
7999
  }
7998
8000
  toggleLocalAudio(e) {
8001
+ if (!this.call)
8002
+ throw new Error("Session not initialized");
7999
8003
  const n = this.call.localAudio();
8000
8004
  this.call.setLocalAudio(e ?? !n);
8001
8005
  }
8002
8006
  setOutputDevice(e) {
8003
8007
  if (!this.call)
8004
8008
  throw new Error("Session not initialized");
8005
- return !e.outputDeviceId || typeof e.outputDeviceId != "string" ? this.call.getInputDevices() : this.call.setOutputDeviceAsync({ outputDeviceId: e.outputDeviceId });
8009
+ return !e.outputDeviceId || typeof e.outputDeviceId != "string" ? this.call.getInputDevices() : this.call.setOutputDeviceAsync({
8010
+ outputDeviceId: e.outputDeviceId
8011
+ });
8006
8012
  }
8007
8013
  setInputDevices(e) {
8008
8014
  return this.call.setInputDevicesAsync(e);
@@ -8025,29 +8031,29 @@ class wf {
8025
8031
  }
8026
8032
  });
8027
8033
  }
8028
- applyEventHandlers(e) {
8029
- return new Promise((n, r) => {
8034
+ applyEventHandlers() {
8035
+ var e, n;
8036
+ (e = this.call) == null || e.on("participant-updated", ({ participant: r }) => {
8030
8037
  var a, c;
8031
- const i = e != null && e.timeout && e.timeout > 0 ? e == null ? void 0 : e.timeout : 3e4, s = e != null && e.timeout ? setTimeout(() => r("Connection timeout"), i) : null;
8032
- (a = this.call) == null || a.on("participant-updated", ({ participant: l }) => {
8033
- var v, E;
8034
- if (l.local && (this.dispatch("local_audio_change", this.call.localAudio()), this.dispatch("local_mic_state_change", l.tracks.audio.state)), !l.owner)
8035
- return;
8036
- this.config.immediatelyJoin || n();
8037
- const { video: f, audio: h } = l.tracks;
8038
- f.persistentTrack && (this.mediaStream.getVideoTracks().forEach((k) => this.mediaStream.removeTrack(k)), (v = this.mediaStream) == null || v.addTrack(f.persistentTrack)), h.persistentTrack && (this.mediaStream.getAudioTracks().forEach((k) => this.mediaStream.removeTrack(k)), (E = this.mediaStream) == null || E.addTrack(h.persistentTrack)), s && clearTimeout(s), f.persistentTrack && (this.inited = !0, this.drawUI(), n());
8039
- }), this.call.on("error", (l) => {
8040
- console.error("[SKD_ERROR]: ", l);
8041
- }), (c = this.call) == null || c.on("app-message", ({ data: l }) => {
8042
- var f;
8043
- this.restartIdleTimeout(), l.type && ((f = this.handlers[l.type]) == null || f.forEach((h) => h(l)), this.handlers.event && this.handlers.event.length > 0 && this.handlers.event.forEach((h) => h({ event: l.type, value: l })));
8044
- });
8038
+ if (r.local) {
8039
+ const l = this.call.localAudio(), f = r.tracks.audio.state;
8040
+ this.lastLocalAudioState !== l && (this.lastLocalAudioState = l, this.dispatch("local_audio_change", l)), this.lastLocalMicState !== f && (this.lastLocalMicState = f, this.dispatch("local_mic_state_change", f));
8041
+ }
8042
+ if (!r.owner)
8043
+ return;
8044
+ const { video: i, audio: s } = r.tracks;
8045
+ i.persistentTrack && (this.mediaStream.getVideoTracks().forEach((l) => this.mediaStream.removeTrack(l)), (a = this.mediaStream) == null || a.addTrack(i.persistentTrack)), s.persistentTrack && (this.mediaStream.getAudioTracks().forEach((l) => this.mediaStream.removeTrack(l)), (c = this.mediaStream) == null || c.addTrack(s.persistentTrack)), i.persistentTrack && !this.inited && (this.inited = !0, this.drawUI(), this.dispatch("init", { data: null }));
8046
+ }), this.call.on("error", (r) => {
8047
+ console.error("[SDK_ERROR]: ", r);
8048
+ }), (n = this.call) == null || n.on("app-message", ({ data: r }) => {
8049
+ var i;
8050
+ this.restartIdleTimeout(), r.type && ((i = this.handlers[r.type]) == null || i.forEach((s) => s(r)), this.handlers.event && this.handlers.event.length > 0 && this.handlers.event.forEach((s) => s({ event: r.type, value: r })));
8045
8051
  });
8046
8052
  }
8047
8053
  attachDOMNode(e) {
8048
8054
  cancelAnimationFrame(this.frameHandle), this.rootElement && (this.rootElement.innerHTML = ""), this.rootElement = e, this.shadow = null, this.drawUI();
8049
8055
  }
8050
- async init(e) {
8056
+ async init() {
8051
8057
  if (this.inited)
8052
8058
  return;
8053
8059
  this.call = Ru.createCallObject({
@@ -8057,19 +8063,25 @@ class wf {
8057
8063
  dailyConfig: {
8058
8064
  avoidEval: !0
8059
8065
  }
8060
- }), this.config.preloadBundle && this.call.load(), this.startIdleTimeout();
8066
+ }), this.config.preloadBundle && this.call.load(), this.applyEventHandlers();
8067
+ const e = new Promise((r) => {
8068
+ this.on("init", () => r());
8069
+ });
8070
+ this.startIdleTimeout();
8061
8071
  const { data: n } = await this.fetcher.get("/sessions");
8062
- return this.session_id = n.id, this.sessionData = n, this.uiConfig.background.transparent = n.session_config.uses_stacked_alpha, !this.abortController.signal.aborted && this.config.immediatelyJoin && await this.join({ startAudioOff: !1 }), this.applyEventHandlers(e);
8072
+ return this.session_id = n.id, this.sessionData = n, this.uiConfig.background.transparent = n.session_config.uses_stacked_alpha, !this.abortController.signal.aborted && this.config.immediatelyJoin && await this.join({ startAudioOff: this.config.startAudioOff }), e;
8063
8073
  }
8064
8074
  async join(e) {
8065
8075
  if (!this.sessionData)
8066
8076
  throw new Error("Session not initialized");
8067
8077
  await this.call.join({
8068
- token: this.sessionData.limited_access_token,
8069
8078
  url: this.sessionData.room_url,
8070
- ...e
8079
+ token: this.sessionData.limited_access_token,
8080
+ audioSource: this.config.audioSource,
8081
+ videoSource: !1,
8082
+ startAudioOff: e == null ? void 0 : e.startAudioOff
8071
8083
  }).catch((n) => {
8072
- console.log("join err: ", n);
8084
+ console.error("[SDK_ERROR]: join failed", n);
8073
8085
  });
8074
8086
  }
8075
8087
  async task(e) {
@@ -8088,15 +8100,16 @@ class wf {
8088
8100
  this.handlers[e] && (this.handlers[e] = this.handlers[e].filter((r) => r !== n));
8089
8101
  }
8090
8102
  async dispose() {
8091
- this.inited = !1, this.mediaStream = new MediaStream(), this.timeout && clearTimeout(this.timeout), this.frameHandle && cancelAnimationFrame(this.frameHandle), await this.call.destroy(), this.abortController.abort(), this.abortController = new AbortController(), this.fetcher.defaults.signal = this.abortController.signal;
8103
+ var e;
8104
+ this.inited = !1, this.mediaStream.getTracks().forEach((n) => n.stop()), this.mediaStream = new MediaStream(), this.lastLocalAudioState = null, this.lastLocalMicState = null, this.timeout && clearTimeout(this.timeout), this.frameHandle && cancelAnimationFrame(this.frameHandle), await ((e = this.call) == null ? void 0 : e.destroy()), this.abortController.abort(), this.abortController = new AbortController(), this.fetcher.defaults.signal = this.abortController.signal;
8092
8105
  }
8093
8106
  }
8094
8107
  class Vf extends wf {
8095
8108
  constructor(n) {
8096
8109
  super(n);
8097
- Q(this, "assistantSessionToken", "");
8098
- Q(this, "assistantFetcher");
8099
- Q(this, "sessionToken", "");
8110
+ K(this, "assistantSessionToken", "");
8111
+ K(this, "assistantFetcher");
8112
+ K(this, "sessionToken", "");
8100
8113
  this.assistantSessionToken = n.assistantSessionToken, this.sessionToken = n.sessionToken, this.assistantFetcher = G.create({
8101
8114
  baseURL: `${n.apiHost || Ra}/`,
8102
8115
  headers: {
@@ -8116,7 +8129,7 @@ class Vf extends wf {
8116
8129
  }
8117
8130
  async dispose() {
8118
8131
  var n;
8119
- this.inited = !1, this.mediaStream = new MediaStream(), this.timeout && clearTimeout(this.timeout), this.frameHandle && cancelAnimationFrame(this.frameHandle), await ((n = this.call) == null ? void 0 : n.destroy()), await this.assistantFetcher.delete("/assistants/sessions"), this.abortController.abort(), this.abortController = new AbortController(), this.fetcher.defaults.signal = this.abortController.signal, this.assistantFetcher.defaults.signal = this.abortController.signal;
8132
+ this.inited = !1, this.mediaStream.getTracks().forEach((r) => r.stop()), this.mediaStream = new MediaStream(), this.lastLocalAudioState = null, this.lastLocalMicState = null, this.timeout && clearTimeout(this.timeout), this.frameHandle && cancelAnimationFrame(this.frameHandle), await ((n = this.call) == null ? void 0 : n.destroy()), await this.assistantFetcher.delete("/assistants/sessions"), this.abortController.abort(), this.abortController = new AbortController(), this.fetcher.defaults.signal = this.abortController.signal, this.assistantFetcher.defaults.signal = this.abortController.signal;
8120
8133
  }
8121
8134
  }
8122
8135
  export {