@acrobits/ipc-sdk 0.7.2-alpha.4 → 0.7.2-alpha.6

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/lib/ipc-sdk.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var Re = Object.defineProperty;
2
2
  var Pe = (n, t, e) => t in n ? Re(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var T = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
4
- var m = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(m || {}), B = function(n, t) {
4
+ var b = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(b || {}), B = function(n, t) {
5
5
  return B = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
6
6
  e.__proto__ = r;
7
7
  } || function(e, r) {
@@ -56,7 +56,7 @@ function F(n, t, e) {
56
56
  (s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
57
57
  return n.concat(s || Array.prototype.slice.call(t));
58
58
  }
59
- function w(n) {
59
+ function m(n) {
60
60
  return typeof n == "function";
61
61
  }
62
62
  function X(n) {
@@ -108,19 +108,19 @@ var I = function() {
108
108
  }
109
109
  else
110
110
  o.remove(this);
111
- var g = this.initialTeardown;
112
- if (w(g))
111
+ var v = this.initialTeardown;
112
+ if (m(v))
113
113
  try {
114
- g();
114
+ v();
115
115
  } catch (f) {
116
116
  s = f instanceof j ? f.errors : [f];
117
117
  }
118
- var v = this._finalizers;
119
- if (v) {
118
+ var g = this._finalizers;
119
+ if (g) {
120
120
  this._finalizers = null;
121
121
  try {
122
- for (var y = z(v), S = y.next(); !S.done; S = y.next()) {
123
- var V = S.value;
122
+ for (var E = z(g), w = E.next(); !w.done; w = E.next()) {
123
+ var V = w.value;
124
124
  try {
125
125
  ie(V);
126
126
  } catch (f) {
@@ -131,7 +131,7 @@ var I = function() {
131
131
  r = { error: f };
132
132
  } finally {
133
133
  try {
134
- S && !S.done && (i = y.return) && i.call(y);
134
+ w && !w.done && (i = E.return) && i.call(E);
135
135
  } finally {
136
136
  if (r)
137
137
  throw r.error;
@@ -172,10 +172,10 @@ var I = function() {
172
172
  }(), n;
173
173
  }(), be = I.EMPTY;
174
174
  function me(n) {
175
- return n instanceof I || n && "closed" in n && w(n.remove) && w(n.add) && w(n.unsubscribe);
175
+ return n instanceof I || n && "closed" in n && m(n.remove) && m(n.add) && m(n.unsubscribe);
176
176
  }
177
177
  function ie(n) {
178
- w(n) ? n() : n.unsubscribe();
178
+ m(n) ? n() : n.unsubscribe();
179
179
  }
180
180
  var we = {
181
181
  onUnhandledError: null,
@@ -237,7 +237,7 @@ var Z = function(n) {
237
237
  }
238
238
  }, t;
239
239
  }(I), Oe = Function.prototype.bind;
240
- function H(n, t) {
240
+ function D(n, t) {
241
241
  return Oe.call(n, t);
242
242
  }
243
243
  var Le = function() {
@@ -275,7 +275,7 @@ var Le = function() {
275
275
  M(t, n);
276
276
  function t(e, r, i) {
277
277
  var s = n.call(this) || this, o;
278
- if (w(e) || !e)
278
+ if (m(e) || !e)
279
279
  o = {
280
280
  next: e ?? void 0,
281
281
  error: r ?? void 0,
@@ -286,9 +286,9 @@ var Le = function() {
286
286
  s && we.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
287
287
  return s.unsubscribe();
288
288
  }, o = {
289
- next: e.next && H(e.next, c),
290
- error: e.error && H(e.error, c),
291
- complete: e.complete && H(e.complete, c)
289
+ next: e.next && D(e.next, c),
290
+ error: e.error && D(e.error, c),
291
+ complete: e.complete && D(e.complete, c)
292
292
  }) : o = e;
293
293
  }
294
294
  return s.destination = new Le(o), s;
@@ -384,13 +384,13 @@ function oe(n) {
384
384
  return (t = n ?? we.Promise) !== null && t !== void 0 ? t : Promise;
385
385
  }
386
386
  function Ne(n) {
387
- return n && w(n.next) && w(n.error) && w(n.complete);
387
+ return n && m(n.next) && m(n.error) && m(n.complete);
388
388
  }
389
389
  function Ve(n) {
390
390
  return n && n instanceof Z || Ne(n) && me(n);
391
391
  }
392
392
  function je(n) {
393
- return w(n == null ? void 0 : n.lift);
393
+ return m(n == null ? void 0 : n.lift);
394
394
  }
395
395
  function Ce(n) {
396
396
  return function(t) {
@@ -406,23 +406,23 @@ function Ce(n) {
406
406
  };
407
407
  }
408
408
  function Me(n, t, e, r, i) {
409
- return new He(n, t, e, r, i);
409
+ return new De(n, t, e, r, i);
410
410
  }
411
- var He = function(n) {
411
+ var De = function(n) {
412
412
  M(t, n);
413
413
  function t(e, r, i, s, o, c) {
414
414
  var a = n.call(this, e) || this;
415
415
  return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
416
416
  try {
417
417
  r(u);
418
- } catch (g) {
419
- e.error(g);
418
+ } catch (v) {
419
+ e.error(v);
420
420
  }
421
421
  } : n.prototype._next, a._error = s ? function(u) {
422
422
  try {
423
423
  s(u);
424
- } catch (g) {
425
- e.error(g);
424
+ } catch (v) {
425
+ e.error(v);
426
426
  } finally {
427
427
  this.unsubscribe();
428
428
  }
@@ -443,7 +443,7 @@ var He = function(n) {
443
443
  n.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
444
444
  }
445
445
  }, t;
446
- }(Z), De = X(function(n) {
446
+ }(Z), He = X(function(n) {
447
447
  return function() {
448
448
  n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
449
449
  };
@@ -458,7 +458,7 @@ var He = function(n) {
458
458
  return r.operator = e, r;
459
459
  }, t.prototype._throwIfClosed = function() {
460
460
  if (this.closed)
461
- throw new De();
461
+ throw new He();
462
462
  }, t.prototype.next = function(e) {
463
463
  var r = this;
464
464
  U(function() {
@@ -646,7 +646,7 @@ var He = function(n) {
646
646
  }, t;
647
647
  }(ce), Ye = new Qe(ze), Ge = Ye;
648
648
  function Ke(n) {
649
- return n && w(n.schedule);
649
+ return n && m(n.schedule);
650
650
  }
651
651
  var Je = X(function(n) {
652
652
  return function() {
@@ -692,7 +692,7 @@ function Xe(n, t, e) {
692
692
  });
693
693
  }
694
694
  function Ze(n, t, e) {
695
- var r = w(n) || t || e ? { next: n, error: t, complete: e } : n;
695
+ var r = m(n) || t || e ? { next: n, error: t, complete: e } : n;
696
696
  return r ? Ce(function(i, s) {
697
697
  var o;
698
698
  (o = r.subscribe) === null || o === void 0 || o.call(r);
@@ -746,11 +746,11 @@ class le extends Error {
746
746
  e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;
747
747
  }
748
748
  }
749
- function E(n) {
749
+ function S(n) {
750
750
  return typeof n == "function";
751
751
  }
752
752
  function it(n) {
753
- return E(n == null ? void 0 : n.lift);
753
+ return S(n == null ? void 0 : n.lift);
754
754
  }
755
755
  function R(n) {
756
756
  return function(t) {
@@ -826,7 +826,7 @@ function st(n) {
826
826
  }, e = n(t);
827
827
  return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
828
828
  }
829
- var D = st(function(n) {
829
+ var H = st(function(n) {
830
830
  return function(t) {
831
831
  n(this), this.message = t ? t.length + ` errors occurred during unsubscription:
832
832
  ` + t.map(function(e, r) {
@@ -869,30 +869,30 @@ var te = function() {
869
869
  }
870
870
  else
871
871
  o.remove(this);
872
- var g = this.initialTeardown;
873
- if (E(g))
872
+ var v = this.initialTeardown;
873
+ if (S(v))
874
874
  try {
875
- g();
875
+ v();
876
876
  } catch (f) {
877
- s = f instanceof D ? f.errors : [f];
877
+ s = f instanceof H ? f.errors : [f];
878
878
  }
879
- var v = this._finalizers;
880
- if (v) {
879
+ var g = this._finalizers;
880
+ if (g) {
881
881
  this._finalizers = null;
882
882
  try {
883
- for (var y = he(v), S = y.next(); !S.done; S = y.next()) {
884
- var V = S.value;
883
+ for (var E = he(g), w = E.next(); !w.done; w = E.next()) {
884
+ var V = w.value;
885
885
  try {
886
886
  pe(V);
887
887
  } catch (f) {
888
- s = s ?? [], f instanceof D ? s = J(J([], K(s)), K(f.errors)) : s.push(f);
888
+ s = s ?? [], f instanceof H ? s = J(J([], K(s)), K(f.errors)) : s.push(f);
889
889
  }
890
890
  }
891
891
  } catch (f) {
892
892
  r = { error: f };
893
893
  } finally {
894
894
  try {
895
- S && !S.done && (i = y.return) && i.call(y);
895
+ w && !w.done && (i = E.return) && i.call(E);
896
896
  } finally {
897
897
  if (r)
898
898
  throw r.error;
@@ -900,7 +900,7 @@ var te = function() {
900
900
  }
901
901
  }
902
902
  if (s)
903
- throw new D(s);
903
+ throw new H(s);
904
904
  }
905
905
  }, n.prototype.add = function(t) {
906
906
  var e;
@@ -934,10 +934,10 @@ var te = function() {
934
934
  }();
935
935
  te.EMPTY;
936
936
  function Te(n) {
937
- return n instanceof te || n && "closed" in n && E(n.remove) && E(n.add) && E(n.unsubscribe);
937
+ return n instanceof te || n && "closed" in n && S(n.remove) && S(n.add) && S(n.unsubscribe);
938
938
  }
939
939
  function pe(n) {
940
- E(n) ? n() : n.unsubscribe();
940
+ S(n) ? n() : n.unsubscribe();
941
941
  }
942
942
  var _e = {
943
943
  onUnhandledError: null,
@@ -1036,7 +1036,7 @@ var lt = function() {
1036
1036
  ee(t, n);
1037
1037
  function t(e, r, i) {
1038
1038
  var s = n.call(this) || this, o;
1039
- if (E(e) || !e)
1039
+ if (S(e) || !e)
1040
1040
  o = {
1041
1041
  next: e ?? void 0,
1042
1042
  error: r ?? void 0,
@@ -1145,7 +1145,7 @@ function ge(n) {
1145
1145
  return (t = n ?? _e.Promise) !== null && t !== void 0 ? t : Promise;
1146
1146
  }
1147
1147
  function vt(n) {
1148
- return n && E(n.next) && E(n.error) && E(n.complete);
1148
+ return n && S(n.next) && S(n.error) && S(n.complete);
1149
1149
  }
1150
1150
  function yt(n) {
1151
1151
  return n && n instanceof re || vt(n) && Te(n);
@@ -1160,14 +1160,14 @@ var bt = function(n) {
1160
1160
  return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
1161
1161
  try {
1162
1162
  r(u);
1163
- } catch (g) {
1164
- e.error(g);
1163
+ } catch (v) {
1164
+ e.error(v);
1165
1165
  }
1166
1166
  } : n.prototype._next, a._error = s ? function(u) {
1167
1167
  try {
1168
1168
  s(u);
1169
- } catch (g) {
1170
- e.error(g);
1169
+ } catch (v) {
1170
+ e.error(v);
1171
1171
  } finally {
1172
1172
  this.unsubscribe();
1173
1173
  }
@@ -1200,7 +1200,7 @@ function h(n, t) {
1200
1200
  var mt = new gt(function(n) {
1201
1201
  return n.complete();
1202
1202
  });
1203
- function b(n) {
1203
+ function y(n) {
1204
1204
  return n <= 0 ? function() {
1205
1205
  return mt;
1206
1206
  } : R(function(t, e) {
@@ -1228,7 +1228,7 @@ function wt(n, t) {
1228
1228
  });
1229
1229
  }
1230
1230
  function d(n, t, e) {
1231
- var r = E(n) || t || e ? { next: n, error: t, complete: e } : n;
1231
+ var r = S(n) || t || e ? { next: n, error: t, complete: e } : n;
1232
1232
  return r ? R(function(i, s) {
1233
1233
  var o;
1234
1234
  (o = r.subscribe) === null || o === void 0 || o.call(r);
@@ -1322,7 +1322,7 @@ class xt {
1322
1322
  determineContext() {
1323
1323
  return Xe(1e3).pipe(
1324
1324
  h(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
1325
- b(1)
1325
+ y(1)
1326
1326
  );
1327
1327
  }
1328
1328
  /**
@@ -1350,7 +1350,7 @@ class xt {
1350
1350
  `[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
1351
1351
  );
1352
1352
  }),
1353
- b(1)
1353
+ y(1)
1354
1354
  );
1355
1355
  return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), r;
1356
1356
  }
@@ -1370,7 +1370,7 @@ class xt {
1370
1370
  p((i) => i.type === t && i.replyTo === e.id),
1371
1371
  h((i) => i),
1372
1372
  d(this.logReceived(t)),
1373
- b(1)
1373
+ y(1)
1374
1374
  );
1375
1375
  return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
1376
1376
  }
@@ -1399,8 +1399,8 @@ class xt {
1399
1399
  region: c,
1400
1400
  joinMicMuted: a,
1401
1401
  joinWithoutCamera: u
1402
- } = t, g = "JOINING ROOM", v = this.createMessage(g, !1);
1403
- v.roomName = e, v.jwtToken = s, v.serverUrl = o, v.region = c, v.roomInvite = r, v.joinMicMuted = a ?? !1, v.joinWithoutCamera = u ?? !1, v.displayName = i, this.logCreated(g, v), this.port2.postMessage(v), this.logSent(g, v);
1402
+ } = t, v = "JOINING ROOM", g = this.createMessage(v, !1);
1403
+ g.roomName = e, g.jwtToken = s, g.serverUrl = o, g.region = c, g.roomInvite = r, g.joinMicMuted = a ?? !1, g.joinWithoutCamera = u ?? !1, g.displayName = i, this.logCreated(v, g), this.port2.postMessage(g), this.logSent(v, g);
1404
1404
  }
1405
1405
  /**
1406
1406
  * Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
@@ -1550,7 +1550,7 @@ class xt {
1550
1550
  h((s) => s),
1551
1551
  d(this.logReceived(e)),
1552
1552
  h((s) => s),
1553
- b(1)
1553
+ y(1)
1554
1554
  );
1555
1555
  return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
1556
1556
  }
@@ -1564,7 +1564,7 @@ class xt {
1564
1564
  h((c) => c),
1565
1565
  d(this.logReceived(i)),
1566
1566
  h((c) => c),
1567
- b(1)
1567
+ y(1)
1568
1568
  ), this.logService.debug(`Created ${i} Reply handler`)), s.layout = t, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s), o)
1569
1569
  return o;
1570
1570
  }
@@ -1620,7 +1620,7 @@ class xt {
1620
1620
  p((s) => s.type === e && s.replyTo === r.id),
1621
1621
  h((s) => s),
1622
1622
  d(this.logReceived(e)),
1623
- b(1)
1623
+ y(1)
1624
1624
  );
1625
1625
  return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
1626
1626
  }
@@ -1657,7 +1657,7 @@ class xt {
1657
1657
  throw new rt(u.streamId, t);
1658
1658
  return e === "direct" && u.contacts.length > 1 && (u.contacts = [u.contacts[0]]), u;
1659
1659
  }),
1660
- b(1)
1660
+ y(1)
1661
1661
  );
1662
1662
  return this.logService.debug(`Created ${s} Reply handler`), this.port2.postMessage(o), this.logSent(s, o), c;
1663
1663
  }
@@ -1680,7 +1680,7 @@ class xt {
1680
1680
  p((s) => s.type === e && s.replyTo === r.id),
1681
1681
  d(this.logReceived(e)),
1682
1682
  h((s) => s),
1683
- b(1)
1683
+ y(1)
1684
1684
  );
1685
1685
  return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
1686
1686
  }
@@ -1738,7 +1738,7 @@ class xt {
1738
1738
  p((i) => i.type === t && i.replyTo === e.id),
1739
1739
  d(this.logReceived(t)),
1740
1740
  h((i) => i),
1741
- b(1)
1741
+ y(1)
1742
1742
  );
1743
1743
  return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
1744
1744
  }
@@ -1955,7 +1955,7 @@ class xt {
1955
1955
  p((a) => a.type === s && a.replyTo === o.id),
1956
1956
  d(this.logReceived(s)),
1957
1957
  h((a) => a),
1958
- b(1)
1958
+ y(1)
1959
1959
  );
1960
1960
  return this.port2.postMessage(o), this.logSent(s, o), c;
1961
1961
  }
@@ -1999,6 +1999,46 @@ class xt {
1999
1999
  d(this.logReceived(t))
2000
2000
  );
2001
2001
  }
2002
+ /**
2003
+ * Sends a {@link FileRequestMessage} to the Host app, to request a file by it's SHA256 hash.
2004
+ *
2005
+ * @remarks
2006
+ * The initiating party can optionally suggest the other party to limit the size of the chunks
2007
+ * sent in the response by setting the `maxChunkSizeInBytes` field. However, this is only a
2008
+ * suggestion and the other party can still choose to send chunks of a different size.
2009
+ *
2010
+ * A client should subscribe to the returned observable to receive the file chunks by setting up
2011
+ * listeners for `next`, `error` and `complete` events.
2012
+ *
2013
+ * @example
2014
+ * Here is an example of how a listener can be setup:
2015
+ *
2016
+ * ```ts
2017
+ * const ipcHelper = new IpcHelper(['2.0'], console);
2018
+ *
2019
+ * ipcManager.sendFileRequestMessage(fileHash, 'attachment', streamId?.toString()).subscribe({
2020
+ * next: (msg) => {
2021
+ * // next listener. Fired for each chunk.
2022
+ * },
2023
+ * error: (err) => {
2024
+ * // error listener
2025
+ * },
2026
+ * complete: () => {
2027
+ * // complete listener. Fired once all chunks are complete.
2028
+ * }
2029
+ * });
2030
+ * ```
2031
+ *
2032
+ * @param fileHash - An SHA256 hash of the file being requested.
2033
+ * @param intent - The intent of the file request. Can be either `attachment` or `general`.
2034
+ * @param streamId - _Optional_. The ID of the message stream to which the files will be attached
2035
+ * to. Only used if `intent` is set to `attachment`.
2036
+ * @param maxChunkSizeInBytes - _Optional_. The maximum size of the file chunk in bytes. Only
2037
+ * used as a suggestion to the other party.
2038
+ *
2039
+ * @returns An observable that either emits once if the result is `error` or `not found` or
2040
+ * emits as many times as the number of chunks in the file if the result is `success`.
2041
+ */
2002
2042
  sendFileRequestMessage(t, e, r, i) {
2003
2043
  if (!this.isEmbedded())
2004
2044
  throw new l(this.currentContext);
@@ -2065,11 +2105,11 @@ class xt {
2065
2105
  (u) => u.type === o && u.replyTo === c.id
2066
2106
  ),
2067
2107
  h((u) => {
2068
- var g, v;
2069
- return u.files = (g = u.files) == null ? void 0 : g.map((y) => (y.fileHash = y.fileHash.toLowerCase(), y)), u.fileHashes = (v = u.fileHashes) == null ? void 0 : v.map((y) => y.toLowerCase()), u;
2108
+ var v;
2109
+ return u.files = (v = u.files) == null ? void 0 : v.map((g) => (g.fileHash = g.fileHash.toLowerCase(), g)), u;
2070
2110
  }),
2071
2111
  d(this.logReceived(o)),
2072
- b(1)
2112
+ y(1)
2073
2113
  );
2074
2114
  return this.port2.postMessage(c), this.logSent(o, c), a;
2075
2115
  }
@@ -2099,7 +2139,7 @@ class xt {
2099
2139
  p((a) => a.type === s && a.replyTo === o.id),
2100
2140
  d(this.logReceived(s)),
2101
2141
  h((a) => a),
2102
- b(1)
2142
+ y(1)
2103
2143
  );
2104
2144
  return this.port2.postMessage(o), this.logSent(s, o), c;
2105
2145
  }
@@ -2126,7 +2166,7 @@ class xt {
2126
2166
  p((o) => o.type === r && o.replyTo === i.id),
2127
2167
  d(this.logReceived(r)),
2128
2168
  h((o) => o),
2129
- b(1)
2169
+ y(1)
2130
2170
  );
2131
2171
  return this.port2.postMessage(i), this.logSent(r, i), s;
2132
2172
  }
@@ -2154,7 +2194,7 @@ class xt {
2154
2194
  p((o) => o.type === r && o.replyTo === i.id),
2155
2195
  d(this.logReceived(r)),
2156
2196
  h((o) => o),
2157
- b(1)
2197
+ y(1)
2158
2198
  );
2159
2199
  return this.port2.postMessage(i), this.logSent(r, i), s;
2160
2200
  }
@@ -2197,6 +2237,19 @@ class xt {
2197
2237
  const r = "MESSAGE SENT", i = this.createMessage(r, !1);
2198
2238
  i.streamId = t, i.attachments = (e == null ? void 0 : e.map((s) => s.toLowerCase())) ?? [], this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
2199
2239
  }
2240
+ /**
2241
+ * Sends a {@link SipCallMessage} to the Host app to initiate a SIP call between the current user
2242
+ * and the callee.
2243
+ *
2244
+ * @param uri - The SIP URI of the callee
2245
+ * @param cloudUsername - _Optional_. The cloud username of the callee
2246
+ */
2247
+ sendSipCallMessage(t, e) {
2248
+ if (!this.isEmbedded())
2249
+ throw new l(this.currentContext);
2250
+ const r = "SIP CALL", i = this.createMessage(r, !1);
2251
+ i.uri = t, i.cloudUsername = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
2252
+ }
2200
2253
  /**
2201
2254
  * Checks if the client app is either embedded in an iframe or in a native webview.
2202
2255
  *
@@ -2304,7 +2357,7 @@ class It {
2304
2357
  T(this, "logger");
2305
2358
  T(this, "helper");
2306
2359
  T(this, "listeners");
2307
- this.logger = t ?? console, this.helper = new xt(Tt, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(m.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(m.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(m.PushToken, /* @__PURE__ */ new Set());
2360
+ this.logger = t ?? console, this.helper = new xt(Tt, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(b.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(b.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(b.PushToken, /* @__PURE__ */ new Set());
2308
2361
  }
2309
2362
  /**
2310
2363
  * Returns whether the app is running inside a native WebView (`host` context) or as a
@@ -2346,17 +2399,17 @@ class It {
2346
2399
  this.helper.onBadgeQueryMessage().subscribe((e) => {
2347
2400
  var r;
2348
2401
  this.logger.debug("Received Badge Query: ", e);
2349
- for (const i of ((r = this.listeners.get(m.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
2402
+ for (const i of ((r = this.listeners.get(b.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
2350
2403
  i();
2351
2404
  }), this.helper.onLifecycleMessage().subscribe((e) => {
2352
2405
  var r;
2353
2406
  this.logger.debug("Received Lifecycle Event: ", e);
2354
- for (const i of ((r = this.listeners.get(m.Lifecycle)) == null ? void 0 : r.values()) ?? [])
2407
+ for (const i of ((r = this.listeners.get(b.Lifecycle)) == null ? void 0 : r.values()) ?? [])
2355
2408
  i(e.eventName, e.payload);
2356
2409
  }), this.helper.onPushTokenMessage().subscribe((e) => {
2357
2410
  var r;
2358
2411
  this.logger.debug("Received Push Token: ", e);
2359
- for (const i of ((r = this.listeners.get(m.PushToken)) == null ? void 0 : r.values()) ?? [])
2412
+ for (const i of ((r = this.listeners.get(b.PushToken)) == null ? void 0 : r.values()) ?? [])
2360
2413
  i(e.pushToken, e.appId, e.selector);
2361
2414
  }), this.cloudId = t.cloudId, this.host = t.host;
2362
2415
  }),
@@ -2445,9 +2498,9 @@ class It {
2445
2498
  */
2446
2499
  onBadgeQueryRequest(t) {
2447
2500
  var e;
2448
- return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(m.BadgeQuery)) == null || e.add(t), () => {
2501
+ return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(b.BadgeQuery)) == null || e.add(t), () => {
2449
2502
  var r;
2450
- return (r = this.listeners.get(m.BadgeQuery)) == null ? void 0 : r.delete(t);
2503
+ return (r = this.listeners.get(b.BadgeQuery)) == null ? void 0 : r.delete(t);
2451
2504
  };
2452
2505
  }
2453
2506
  /**
@@ -2464,9 +2517,9 @@ class It {
2464
2517
  */
2465
2518
  onLifecycleEvent(t) {
2466
2519
  var e;
2467
- return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(m.Lifecycle)) == null || e.add(t), () => {
2520
+ return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(b.Lifecycle)) == null || e.add(t), () => {
2468
2521
  var r;
2469
- return (r = this.listeners.get(m.Lifecycle)) == null ? void 0 : r.delete(t);
2522
+ return (r = this.listeners.get(b.Lifecycle)) == null ? void 0 : r.delete(t);
2470
2523
  };
2471
2524
  }
2472
2525
  /**
@@ -2482,9 +2535,9 @@ class It {
2482
2535
  */
2483
2536
  onPushToken(t) {
2484
2537
  var e;
2485
- return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(m.PushToken)) == null || e.add(t), () => {
2538
+ return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(b.PushToken)) == null || e.add(t), () => {
2486
2539
  var r;
2487
- return (r = this.listeners.get(m.PushToken)) == null ? void 0 : r.delete(t);
2540
+ return (r = this.listeners.get(b.PushToken)) == null ? void 0 : r.delete(t);
2488
2541
  };
2489
2542
  }
2490
2543
  evaluateContext(t) {
@@ -2495,6 +2548,6 @@ class It {
2495
2548
  }
2496
2549
  }
2497
2550
  export {
2498
- m as IPCEvents,
2551
+ b as IPCEvents,
2499
2552
  It as IPCManager
2500
2553
  };