@acrobits/ipc-sdk 0.8.0-alpha.6 → 0.8.1-alpha.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/lib/ipc-sdk.js CHANGED
@@ -1,18 +1,18 @@
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
- var _ = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
4
- var y = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(y || {}), H = function(n, t) {
5
- return H = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
3
+ var I = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
4
+ var b = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(b || {}), B = function(n, t) {
5
+ return B = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
6
6
  e.__proto__ = r;
7
7
  } || function(e, r) {
8
8
  for (var i in r)
9
9
  Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
10
- }, H(n, t);
10
+ }, B(n, t);
11
11
  };
12
12
  function M(n, t) {
13
13
  if (typeof t != "function" && t !== null)
14
14
  throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
15
- H(n, t);
15
+ B(n, t);
16
16
  function e() {
17
17
  this.constructor = n;
18
18
  }
@@ -38,8 +38,8 @@ function $(n, t) {
38
38
  try {
39
39
  for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
40
40
  s.push(i.value);
41
- } catch (a) {
42
- o = { error: a };
41
+ } catch (c) {
42
+ o = { error: c };
43
43
  } finally {
44
44
  try {
45
45
  i && !i.done && (e = r.return) && e.call(r);
@@ -92,15 +92,15 @@ var T = function() {
92
92
  if (o)
93
93
  if (this._parentage = null, Array.isArray(o))
94
94
  try {
95
- for (var a = Q(o), c = a.next(); !c.done; c = a.next()) {
96
- var u = c.value;
95
+ for (var c = Q(o), a = c.next(); !a.done; a = c.next()) {
96
+ var u = a.value;
97
97
  u.remove(this);
98
98
  }
99
- } catch (f) {
100
- t = { error: f };
99
+ } catch (g) {
100
+ t = { error: g };
101
101
  } finally {
102
102
  try {
103
- c && !c.done && (e = a.return) && e.call(a);
103
+ a && !a.done && (e = c.return) && e.call(c);
104
104
  } finally {
105
105
  if (t)
106
106
  throw t.error;
@@ -108,30 +108,30 @@ var T = function() {
108
108
  }
109
109
  else
110
110
  o.remove(this);
111
- var p = this.initialTeardown;
112
- if (w(p))
111
+ var l = this.initialTeardown;
112
+ if (w(l))
113
113
  try {
114
- p();
115
- } catch (f) {
116
- s = f instanceof N ? f.errors : [f];
114
+ l();
115
+ } catch (g) {
116
+ s = g instanceof N ? g.errors : [g];
117
117
  }
118
- var v = this._finalizers;
119
- if (v) {
118
+ var d = this._finalizers;
119
+ if (d) {
120
120
  this._finalizers = null;
121
121
  try {
122
- for (var b = Q(v), S = b.next(); !S.done; S = b.next()) {
122
+ for (var y = Q(d), S = y.next(); !S.done; S = y.next()) {
123
123
  var j = S.value;
124
124
  try {
125
125
  ie(j);
126
- } catch (f) {
127
- s = s ?? [], f instanceof N ? s = k(k([], $(s)), $(f.errors)) : s.push(f);
126
+ } catch (g) {
127
+ s = s ?? [], g instanceof N ? s = k(k([], $(s)), $(g.errors)) : s.push(g);
128
128
  }
129
129
  }
130
- } catch (f) {
131
- r = { error: f };
130
+ } catch (g) {
131
+ r = { error: g };
132
132
  } finally {
133
133
  try {
134
- S && !S.done && (i = b.return) && i.call(b);
134
+ S && !S.done && (i = y.return) && i.call(y);
135
135
  } finally {
136
136
  if (r)
137
137
  throw r.error;
@@ -170,7 +170,7 @@ var T = function() {
170
170
  var t = new n();
171
171
  return t.closed = !0, t;
172
172
  }(), n;
173
- }(), ye = T.EMPTY;
173
+ }(), be = T.EMPTY;
174
174
  function me(n) {
175
175
  return n instanceof T || n && "closed" in n && w(n.remove) && w(n.add) && w(n.unsubscribe);
176
176
  }
@@ -237,7 +237,7 @@ var Z = function(n) {
237
237
  }
238
238
  }, t;
239
239
  }(T), Oe = Function.prototype.bind;
240
- function q(n, t) {
240
+ function D(n, t) {
241
241
  return Oe.call(n, t);
242
242
  }
243
243
  var Le = function() {
@@ -282,13 +282,13 @@ var Le = function() {
282
282
  complete: i ?? void 0
283
283
  };
284
284
  else {
285
- var a;
286
- s && we.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
285
+ var c;
286
+ s && we.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
287
287
  return s.unsubscribe();
288
288
  }, o = {
289
- next: e.next && q(e.next, a),
290
- error: e.error && q(e.error, a),
291
- complete: e.complete && q(e.complete, a)
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;
@@ -319,7 +319,7 @@ function Fe(n) {
319
319
  }, e);
320
320
  };
321
321
  }
322
- var z = function() {
322
+ var G = function() {
323
323
  function n(t) {
324
324
  t && (this._subscribe = t);
325
325
  }
@@ -329,8 +329,8 @@ var z = function() {
329
329
  }, n.prototype.subscribe = function(t, e, r) {
330
330
  var i = this, s = je(t) ? t : new V(t, e, r);
331
331
  return U(function() {
332
- var o = i, a = o.operator, c = o.source;
333
- s.add(a ? a.call(s, c) : c ? i._subscribe(s) : i._trySubscribe(s));
332
+ var o = i, c = o.operator, a = o.source;
333
+ s.add(c ? c.call(s, a) : a ? i._subscribe(s) : i._trySubscribe(s));
334
334
  }), s;
335
335
  }, n.prototype._trySubscribe = function(t) {
336
336
  try {
@@ -342,11 +342,11 @@ var z = function() {
342
342
  var r = this;
343
343
  return e = oe(e), new e(function(i, s) {
344
344
  var o = new V({
345
- next: function(a) {
345
+ next: function(c) {
346
346
  try {
347
- t(a);
348
- } catch (c) {
349
- s(c), o.unsubscribe();
347
+ t(c);
348
+ } catch (a) {
349
+ s(a), o.unsubscribe();
350
350
  }
351
351
  },
352
352
  error: s,
@@ -406,27 +406,27 @@ function Ce(n) {
406
406
  };
407
407
  }
408
408
  function Me(n, t, e, r, i) {
409
- return new qe(n, t, e, r, i);
409
+ return new De(n, t, e, r, i);
410
410
  }
411
- var qe = function(n) {
411
+ var De = function(n) {
412
412
  M(t, n);
413
- function t(e, r, i, s, o, a) {
414
- var c = n.call(this, e) || this;
415
- return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(u) {
413
+ function t(e, r, i, s, o, c) {
414
+ var a = n.call(this, e) || this;
415
+ return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
416
416
  try {
417
417
  r(u);
418
- } catch (p) {
419
- e.error(p);
418
+ } catch (l) {
419
+ e.error(l);
420
420
  }
421
- } : n.prototype._next, c._error = s ? function(u) {
421
+ } : n.prototype._next, a._error = s ? function(u) {
422
422
  try {
423
423
  s(u);
424
- } catch (p) {
425
- e.error(p);
424
+ } catch (l) {
425
+ e.error(l);
426
426
  } finally {
427
427
  this.unsubscribe();
428
428
  }
429
- } : n.prototype._error, c._complete = i ? function() {
429
+ } : n.prototype._error, a._complete = i ? function() {
430
430
  try {
431
431
  i();
432
432
  } catch (u) {
@@ -434,7 +434,7 @@ var qe = function(n) {
434
434
  } finally {
435
435
  this.unsubscribe();
436
436
  }
437
- } : n.prototype._complete, c;
437
+ } : n.prototype._complete, a;
438
438
  }
439
439
  return t.prototype.unsubscribe = function() {
440
440
  var e;
@@ -443,7 +443,7 @@ var qe = 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), qe = X(function(n) {
447
447
  return function() {
448
448
  n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
449
449
  };
@@ -454,11 +454,11 @@ var qe = function(n) {
454
454
  return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
455
455
  }
456
456
  return t.prototype.lift = function(e) {
457
- var r = new ce(this, this);
457
+ var r = new ae(this, this);
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 qe();
462
462
  }, t.prototype.next = function(e) {
463
463
  var r = this;
464
464
  U(function() {
@@ -466,15 +466,15 @@ var qe = function(n) {
466
466
  if (r._throwIfClosed(), !r.isStopped) {
467
467
  r.currentObservers || (r.currentObservers = Array.from(r.observers));
468
468
  try {
469
- for (var o = Q(r.currentObservers), a = o.next(); !a.done; a = o.next()) {
470
- var c = a.value;
471
- c.next(e);
469
+ for (var o = Q(r.currentObservers), c = o.next(); !c.done; c = o.next()) {
470
+ var a = c.value;
471
+ a.next(e);
472
472
  }
473
473
  } catch (u) {
474
474
  i = { error: u };
475
475
  } finally {
476
476
  try {
477
- a && !a.done && (s = o.return) && s.call(o);
477
+ c && !c.done && (s = o.return) && s.call(o);
478
478
  } finally {
479
479
  if (i)
480
480
  throw i.error;
@@ -514,20 +514,20 @@ var qe = function(n) {
514
514
  }, t.prototype._subscribe = function(e) {
515
515
  return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
516
516
  }, t.prototype._innerSubscribe = function(e) {
517
- var r = this, i = this, s = i.hasError, o = i.isStopped, a = i.observers;
518
- return s || o ? ye : (this.currentObservers = null, a.push(e), new T(function() {
519
- r.currentObservers = null, F(a, e);
517
+ var r = this, i = this, s = i.hasError, o = i.isStopped, c = i.observers;
518
+ return s || o ? be : (this.currentObservers = null, c.push(e), new T(function() {
519
+ r.currentObservers = null, F(c, e);
520
520
  }));
521
521
  }, t.prototype._checkFinalizedStatuses = function(e) {
522
522
  var r = this, i = r.hasError, s = r.thrownError, o = r.isStopped;
523
523
  i ? e.error(s) : o && e.complete();
524
524
  }, t.prototype.asObservable = function() {
525
- var e = new z();
525
+ var e = new G();
526
526
  return e.source = this, e;
527
527
  }, t.create = function(e, r) {
528
- return new ce(e, r);
528
+ return new ae(e, r);
529
529
  }, t;
530
- }(z), ce = function(n) {
530
+ }(G), ae = function(n) {
531
531
  M(t, n);
532
532
  function t(e, r) {
533
533
  var i = n.call(this) || this;
@@ -544,14 +544,14 @@ var qe = function(n) {
544
544
  (r = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || r === void 0 || r.call(e);
545
545
  }, t.prototype._subscribe = function(e) {
546
546
  var r, i;
547
- return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i : ye;
547
+ return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i : be;
548
548
  }, t;
549
- }(xe), Be = {
549
+ }(xe), He = {
550
550
  now: function() {
551
551
  return Date.now();
552
552
  },
553
553
  delegate: void 0
554
- }, He = function(n) {
554
+ }, Be = function(n) {
555
555
  M(t, n);
556
556
  function t(e, r) {
557
557
  return n.call(this) || this;
@@ -559,14 +559,14 @@ var qe = function(n) {
559
559
  return t.prototype.schedule = function(e, r) {
560
560
  return this;
561
561
  }, t;
562
- }(T), Y = {
562
+ }(T), z = {
563
563
  setInterval: function(n, t) {
564
564
  for (var e = [], r = 2; r < arguments.length; r++)
565
565
  e[r - 2] = arguments[r];
566
566
  return setInterval.apply(void 0, k([n, t], $(e)));
567
567
  },
568
568
  clearInterval: function(n) {
569
- var t = Y.delegate;
569
+ var t = z.delegate;
570
570
  return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
571
571
  },
572
572
  delegate: void 0
@@ -584,11 +584,11 @@ var qe = function(n) {
584
584
  var s = this.id, o = this.scheduler;
585
585
  return s != null && (this.id = this.recycleAsyncId(o, s, r)), this.pending = !0, this.delay = r, this.id = (i = this.id) !== null && i !== void 0 ? i : this.requestAsyncId(o, this.id, r), this;
586
586
  }, t.prototype.requestAsyncId = function(e, r, i) {
587
- return i === void 0 && (i = 0), Y.setInterval(e.flush.bind(e, this), i);
587
+ return i === void 0 && (i = 0), z.setInterval(e.flush.bind(e, this), i);
588
588
  }, t.prototype.recycleAsyncId = function(e, r, i) {
589
589
  if (i === void 0 && (i = 0), i != null && this.delay === i && this.pending === !1)
590
590
  return r;
591
- r != null && Y.clearInterval(r);
591
+ r != null && z.clearInterval(r);
592
592
  }, t.prototype.execute = function(e, r) {
593
593
  if (this.closed)
594
594
  return new Error("executing a cancelled action");
@@ -612,17 +612,17 @@ var qe = function(n) {
612
612
  this.work = this.state = this.scheduler = null, this.pending = !1, F(s, this), r != null && (this.id = this.recycleAsyncId(i, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
613
613
  }
614
614
  }, t;
615
- }(He), ae = function() {
615
+ }(Be), ce = function() {
616
616
  function n(t, e) {
617
617
  e === void 0 && (e = n.now), this.schedulerActionCtor = t, this.now = e;
618
618
  }
619
619
  return n.prototype.schedule = function(t, e, r) {
620
620
  return e === void 0 && (e = 0), new this.schedulerActionCtor(this, t).schedule(r, e);
621
- }, n.now = Be.now, n;
622
- }(), ze = function(n) {
621
+ }, n.now = He.now, n;
622
+ }(), Ge = function(n) {
623
623
  M(t, n);
624
624
  function t(e, r) {
625
- r === void 0 && (r = ae.now);
625
+ r === void 0 && (r = ce.now);
626
626
  var i = n.call(this, e, r) || this;
627
627
  return i.actions = [], i._active = !1, i;
628
628
  }
@@ -644,7 +644,7 @@ var qe = function(n) {
644
644
  throw i;
645
645
  }
646
646
  }, t;
647
- }(ae), Ye = new ze(Qe), Ge = Ye;
647
+ }(ce), ze = new Ge(Qe), Ye = ze;
648
648
  function Ke(n) {
649
649
  return n && w(n.schedule);
650
650
  }
@@ -653,7 +653,7 @@ var Je = X(function(n) {
653
653
  n(this), this.name = "EmptyError", this.message = "no elements in sequence";
654
654
  };
655
655
  });
656
- function I(n, t) {
656
+ function _(n, t) {
657
657
  var e = typeof t == "object";
658
658
  return new Promise(function(r, i) {
659
659
  var s = new V({
@@ -680,9 +680,9 @@ function O(n, t) {
680
680
  });
681
681
  }
682
682
  function Xe(n, t, e) {
683
- n === void 0 && (n = 0), e === void 0 && (e = Ge);
683
+ n === void 0 && (n = 0), e === void 0 && (e = Ye);
684
684
  var r = -1;
685
- return t != null && (Ke(t) ? e = t : r = t), new z(function(i) {
685
+ return t != null && (Ke(t) ? e = t : r = t), new G(function(i) {
686
686
  var s = We(n) ? +n - e.now() : n;
687
687
  s < 0 && (s = 0);
688
688
  var o = 0;
@@ -696,24 +696,24 @@ function Ze(n, t, e) {
696
696
  return r ? Ce(function(i, s) {
697
697
  var o;
698
698
  (o = r.subscribe) === null || o === void 0 || o.call(r);
699
- var a = !0;
700
- i.subscribe(Me(s, function(c) {
699
+ var c = !0;
700
+ i.subscribe(Me(s, function(a) {
701
701
  var u;
702
- (u = r.next) === null || u === void 0 || u.call(r, c), s.next(c);
702
+ (u = r.next) === null || u === void 0 || u.call(r, a), s.next(a);
703
703
  }, function() {
704
- var c;
705
- a = !1, (c = r.complete) === null || c === void 0 || c.call(r), s.complete();
706
- }, function(c) {
704
+ var a;
705
+ c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
706
+ }, function(a) {
707
707
  var u;
708
- a = !1, (u = r.error) === null || u === void 0 || u.call(r, c), s.error(c);
708
+ c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
709
709
  }, function() {
710
- var c, u;
711
- a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
710
+ var a, u;
711
+ c && ((a = r.unsubscribe) === null || a === void 0 || a.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
712
712
  }));
713
713
  }) : Ee;
714
714
  }
715
715
  var et = Object.defineProperty, tt = (n, t, e) => t in n ? et(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, C = (n, t, e) => (tt(n, typeof t != "symbol" ? t + "" : t, e), e);
716
- class l extends Error {
716
+ class h extends Error {
717
717
  constructor(t) {
718
718
  super(`Incorrect context (${t}). Cannot perform the requested operation.`), C(this, "context"), this.context = t;
719
719
  }
@@ -765,18 +765,18 @@ function R(n) {
765
765
  throw new TypeError("Unable to lift unknown Observable type");
766
766
  };
767
767
  }
768
- var G = function(n, t) {
769
- return G = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
768
+ var Y = function(n, t) {
769
+ return Y = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
770
770
  e.__proto__ = r;
771
771
  } || function(e, r) {
772
772
  for (var i in r)
773
773
  Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
774
- }, G(n, t);
774
+ }, Y(n, t);
775
775
  };
776
776
  function ee(n, t) {
777
777
  if (typeof t != "function" && t !== null)
778
778
  throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
779
- G(n, t);
779
+ Y(n, t);
780
780
  function e() {
781
781
  this.constructor = n;
782
782
  }
@@ -802,8 +802,8 @@ function K(n, t) {
802
802
  try {
803
803
  for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
804
804
  s.push(i.value);
805
- } catch (a) {
806
- o = { error: a };
805
+ } catch (c) {
806
+ o = { error: c };
807
807
  } finally {
808
808
  try {
809
809
  i && !i.done && (e = r.return) && e.call(r);
@@ -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 q = 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) {
@@ -853,15 +853,15 @@ var te = function() {
853
853
  if (o)
854
854
  if (this._parentage = null, Array.isArray(o))
855
855
  try {
856
- for (var a = he(o), c = a.next(); !c.done; c = a.next()) {
857
- var u = c.value;
856
+ for (var c = he(o), a = c.next(); !a.done; a = c.next()) {
857
+ var u = a.value;
858
858
  u.remove(this);
859
859
  }
860
- } catch (f) {
861
- t = { error: f };
860
+ } catch (g) {
861
+ t = { error: g };
862
862
  } finally {
863
863
  try {
864
- c && !c.done && (e = a.return) && e.call(a);
864
+ a && !a.done && (e = c.return) && e.call(c);
865
865
  } finally {
866
866
  if (t)
867
867
  throw t.error;
@@ -869,30 +869,30 @@ var te = function() {
869
869
  }
870
870
  else
871
871
  o.remove(this);
872
- var p = this.initialTeardown;
873
- if (E(p))
872
+ var l = this.initialTeardown;
873
+ if (E(l))
874
874
  try {
875
- p();
876
- } catch (f) {
877
- s = f instanceof D ? f.errors : [f];
875
+ l();
876
+ } catch (g) {
877
+ s = g instanceof q ? g.errors : [g];
878
878
  }
879
- var v = this._finalizers;
880
- if (v) {
879
+ var d = this._finalizers;
880
+ if (d) {
881
881
  this._finalizers = null;
882
882
  try {
883
- for (var b = he(v), S = b.next(); !S.done; S = b.next()) {
883
+ for (var y = he(d), S = y.next(); !S.done; S = y.next()) {
884
884
  var j = S.value;
885
885
  try {
886
886
  pe(j);
887
- } catch (f) {
888
- s = s ?? [], f instanceof D ? s = J(J([], K(s)), K(f.errors)) : s.push(f);
887
+ } catch (g) {
888
+ s = s ?? [], g instanceof q ? s = J(J([], K(s)), K(g.errors)) : s.push(g);
889
889
  }
890
890
  }
891
- } catch (f) {
892
- r = { error: f };
891
+ } catch (g) {
892
+ r = { error: g };
893
893
  } finally {
894
894
  try {
895
- S && !S.done && (i = b.return) && i.call(b);
895
+ S && !S.done && (i = y.return) && i.call(y);
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 q(s);
904
904
  }
905
905
  }, n.prototype.add = function(t) {
906
906
  var e;
@@ -933,13 +933,13 @@ var te = function() {
933
933
  }(), n;
934
934
  }();
935
935
  te.EMPTY;
936
- function _e(n) {
936
+ function Ie(n) {
937
937
  return n instanceof te || n && "closed" in n && E(n.remove) && E(n.add) && E(n.unsubscribe);
938
938
  }
939
939
  function pe(n) {
940
940
  E(n) ? n() : n.unsubscribe();
941
941
  }
942
- var Ie = {
942
+ var _e = {
943
943
  onUnhandledError: null,
944
944
  onStoppedNotification: null,
945
945
  Promise: void 0,
@@ -956,21 +956,21 @@ var Ie = {
956
956
  },
957
957
  delegate: void 0
958
958
  };
959
- function ct(n) {
959
+ function at(n) {
960
960
  ot.setTimeout(function() {
961
961
  throw n;
962
962
  });
963
963
  }
964
964
  function fe() {
965
965
  }
966
- function at(n) {
966
+ function ct(n) {
967
967
  n();
968
968
  }
969
969
  var re = function(n) {
970
970
  ee(t, n);
971
971
  function t(e) {
972
972
  var r = n.call(this) || this;
973
- return r.isStopped = !1, e ? (r.destination = e, _e(e) && e.add(r)) : r.destination = dt, r;
973
+ return r.isStopped = !1, e ? (r.destination = e, Ie(e) && e.add(r)) : r.destination = dt, r;
974
974
  }
975
975
  return t.create = function(e, r, i) {
976
976
  return new W(e, r, i);
@@ -998,7 +998,7 @@ var re = function(n) {
998
998
  }
999
999
  }, t;
1000
1000
  }(te), ut = Function.prototype.bind;
1001
- function B(n, t) {
1001
+ function H(n, t) {
1002
1002
  return ut.call(n, t);
1003
1003
  }
1004
1004
  var lt = function() {
@@ -1043,13 +1043,13 @@ var lt = function() {
1043
1043
  complete: i ?? void 0
1044
1044
  };
1045
1045
  else {
1046
- var a;
1047
- s && Ie.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
1046
+ var c;
1047
+ s && _e.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
1048
1048
  return s.unsubscribe();
1049
1049
  }, o = {
1050
- next: e.next && B(e.next, a),
1051
- error: e.error && B(e.error, a),
1052
- complete: e.complete && B(e.complete, a)
1050
+ next: e.next && H(e.next, c),
1051
+ error: e.error && H(e.error, c),
1052
+ complete: e.complete && H(e.complete, c)
1053
1053
  }) : o = e;
1054
1054
  }
1055
1055
  return s.destination = new lt(o), s;
@@ -1057,7 +1057,7 @@ var lt = function() {
1057
1057
  return t;
1058
1058
  }(re);
1059
1059
  function L(n) {
1060
- ct(n);
1060
+ at(n);
1061
1061
  }
1062
1062
  function ht(n) {
1063
1063
  throw n;
@@ -1088,10 +1088,10 @@ var gt = function() {
1088
1088
  var e = new n();
1089
1089
  return e.source = this, e.operator = t, e;
1090
1090
  }, n.prototype.subscribe = function(t, e, r) {
1091
- var i = this, s = bt(t) ? t : new W(t, e, r);
1092
- return at(function() {
1093
- var o = i, a = o.operator, c = o.source;
1094
- s.add(a ? a.call(s, c) : c ? i._subscribe(s) : i._trySubscribe(s));
1091
+ var i = this, s = yt(t) ? t : new W(t, e, r);
1092
+ return ct(function() {
1093
+ var o = i, c = o.operator, a = o.source;
1094
+ s.add(c ? c.call(s, a) : a ? i._subscribe(s) : i._trySubscribe(s));
1095
1095
  }), s;
1096
1096
  }, n.prototype._trySubscribe = function(t) {
1097
1097
  try {
@@ -1103,11 +1103,11 @@ var gt = function() {
1103
1103
  var r = this;
1104
1104
  return e = ge(e), new e(function(i, s) {
1105
1105
  var o = new W({
1106
- next: function(a) {
1106
+ next: function(c) {
1107
1107
  try {
1108
- t(a);
1109
- } catch (c) {
1110
- s(c), o.unsubscribe();
1108
+ t(c);
1109
+ } catch (a) {
1110
+ s(a), o.unsubscribe();
1111
1111
  }
1112
1112
  },
1113
1113
  error: s,
@@ -1142,36 +1142,36 @@ var gt = function() {
1142
1142
  }();
1143
1143
  function ge(n) {
1144
1144
  var t;
1145
- return (t = n ?? Ie.Promise) !== null && t !== void 0 ? t : Promise;
1145
+ return (t = n ?? _e.Promise) !== null && t !== void 0 ? t : Promise;
1146
1146
  }
1147
1147
  function vt(n) {
1148
1148
  return n && E(n.next) && E(n.error) && E(n.complete);
1149
1149
  }
1150
- function bt(n) {
1151
- return n && n instanceof re || vt(n) && _e(n);
1150
+ function yt(n) {
1151
+ return n && n instanceof re || vt(n) && Ie(n);
1152
1152
  }
1153
1153
  function P(n, t, e, r, i) {
1154
- return new yt(n, t, e, r, i);
1154
+ return new bt(n, t, e, r, i);
1155
1155
  }
1156
- var yt = function(n) {
1156
+ var bt = function(n) {
1157
1157
  ee(t, n);
1158
- function t(e, r, i, s, o, a) {
1159
- var c = n.call(this, e) || this;
1160
- return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(u) {
1158
+ function t(e, r, i, s, o, c) {
1159
+ var a = n.call(this, e) || this;
1160
+ return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
1161
1161
  try {
1162
1162
  r(u);
1163
- } catch (p) {
1164
- e.error(p);
1163
+ } catch (l) {
1164
+ e.error(l);
1165
1165
  }
1166
- } : n.prototype._next, c._error = s ? function(u) {
1166
+ } : n.prototype._next, a._error = s ? function(u) {
1167
1167
  try {
1168
1168
  s(u);
1169
- } catch (p) {
1170
- e.error(p);
1169
+ } catch (l) {
1170
+ e.error(l);
1171
1171
  } finally {
1172
1172
  this.unsubscribe();
1173
1173
  }
1174
- } : n.prototype._error, c._complete = i ? function() {
1174
+ } : n.prototype._error, a._complete = i ? function() {
1175
1175
  try {
1176
1176
  i();
1177
1177
  } catch (u) {
@@ -1179,7 +1179,7 @@ var yt = function(n) {
1179
1179
  } finally {
1180
1180
  this.unsubscribe();
1181
1181
  }
1182
- } : n.prototype._complete, c;
1182
+ } : n.prototype._complete, a;
1183
1183
  }
1184
1184
  return t.prototype.unsubscribe = function() {
1185
1185
  var e;
@@ -1189,7 +1189,7 @@ var yt = function(n) {
1189
1189
  }
1190
1190
  }, t;
1191
1191
  }(re);
1192
- function h(n, t) {
1192
+ function p(n, t) {
1193
1193
  return R(function(e, r) {
1194
1194
  var i = 0;
1195
1195
  e.subscribe(P(r, function(s) {
@@ -1210,7 +1210,7 @@ function m(n) {
1210
1210
  }));
1211
1211
  });
1212
1212
  }
1213
- function g(n, t) {
1213
+ function v(n, t) {
1214
1214
  return R(function(e, r) {
1215
1215
  var i = 0;
1216
1216
  e.subscribe(P(r, function(s) {
@@ -1227,24 +1227,24 @@ function wt(n, t) {
1227
1227
  }));
1228
1228
  });
1229
1229
  }
1230
- function d(n, t, e) {
1230
+ function f(n, t, e) {
1231
1231
  var r = E(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);
1235
- var a = !0;
1236
- i.subscribe(P(s, function(c) {
1235
+ var c = !0;
1236
+ i.subscribe(P(s, function(a) {
1237
1237
  var u;
1238
- (u = r.next) === null || u === void 0 || u.call(r, c), s.next(c);
1238
+ (u = r.next) === null || u === void 0 || u.call(r, a), s.next(a);
1239
1239
  }, function() {
1240
- var c;
1241
- a = !1, (c = r.complete) === null || c === void 0 || c.call(r), s.complete();
1242
- }, function(c) {
1240
+ var a;
1241
+ c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
1242
+ }, function(a) {
1243
1243
  var u;
1244
- a = !1, (u = r.error) === null || u === void 0 || u.call(r, c), s.error(c);
1244
+ c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
1245
1245
  }, function() {
1246
- var c, u;
1247
- a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
1246
+ var a, u;
1247
+ c && ((a = r.unsubscribe) === null || a === void 0 || a.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
1248
1248
  }));
1249
1249
  }) : Te;
1250
1250
  }
@@ -1271,7 +1271,7 @@ function Ct(n, t) {
1271
1271
  function Mt(n, t) {
1272
1272
  return ne(n, t) >= 0;
1273
1273
  }
1274
- const be = "2.0";
1274
+ const ye = "2.0";
1275
1275
  class xt {
1276
1276
  /**
1277
1277
  * Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.
@@ -1283,8 +1283,8 @@ class xt {
1283
1283
  * @param logService - An instance of a logging service or utility
1284
1284
  */
1285
1285
  constructor(t, e) {
1286
- if (C(this, "negotiatedProtocolVersion"), C(this, "currentContext"), C(this, "incomingMessages$"), C(this, "inIframe", !1), C(this, "embeddedResult"), C(this, "iframePort1"), C(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new xe(), this.supportedVersions = t.filter((r) => Mt(r, be)), !this.supportedVersions.length)
1287
- throw new le(t, be);
1286
+ if (C(this, "negotiatedProtocolVersion"), C(this, "currentContext"), C(this, "incomingMessages$"), C(this, "inIframe", !1), C(this, "embeddedResult"), C(this, "iframePort1"), C(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new xe(), this.supportedVersions = t.filter((r) => Mt(r, ye)), !this.supportedVersions.length)
1287
+ throw new le(t, ye);
1288
1288
  this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
1289
1289
  }
1290
1290
  get parent() {
@@ -1321,7 +1321,7 @@ class xt {
1321
1321
  */
1322
1322
  determineContext() {
1323
1323
  return Xe(1e3).pipe(
1324
- h(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
1324
+ p(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
1325
1325
  m(1)
1326
1326
  );
1327
1327
  }
@@ -1333,19 +1333,19 @@ class xt {
1333
1333
  */
1334
1334
  openBridge() {
1335
1335
  if (!this.isEmbedded())
1336
- throw new l(this.currentContext);
1336
+ throw new h(this.currentContext);
1337
1337
  const t = "HELLO", e = this.createMessage(t);
1338
1338
  e.protocolVersions = this.supportedVersions, this.logCreated(t, e);
1339
1339
  const r = this.incomingMessages$.pipe(
1340
- g((i) => i.type === t && i.replyTo === e.id),
1341
- h((i) => i),
1342
- d(this.logReceived(t)),
1343
- h((i) => {
1340
+ v((i) => i.type === t && i.replyTo === e.id),
1341
+ p((i) => i),
1342
+ f(this.logReceived(t)),
1343
+ p((i) => {
1344
1344
  if (this.supportedVersions.some((s) => Ct(s, i.protocolVersion)))
1345
1345
  throw new le(i.protocolVersion, this.supportedVersions[0]);
1346
1346
  return i;
1347
1347
  }),
1348
- d((i) => {
1348
+ f((i) => {
1349
1349
  this.negotiatedProtocolVersion = i.protocolVersion, this.logService.info(
1350
1350
  `[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
1351
1351
  );
@@ -1363,13 +1363,13 @@ class xt {
1363
1363
  */
1364
1364
  requestSSOToken() {
1365
1365
  if (!this.isEmbedded())
1366
- throw new l(this.currentContext);
1366
+ throw new h(this.currentContext);
1367
1367
  const t = "TOKEN", e = this.createMessage(t);
1368
1368
  this.logCreated(t, e);
1369
1369
  const r = this.incomingMessages$.pipe(
1370
- g((i) => i.type === t && i.replyTo === e.id),
1371
- h((i) => i),
1372
- d(this.logReceived(t)),
1370
+ v((i) => i.type === t && i.replyTo === e.id),
1371
+ p((i) => i),
1372
+ f(this.logReceived(t)),
1373
1373
  m(1)
1374
1374
  );
1375
1375
  return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
@@ -1389,18 +1389,18 @@ class xt {
1389
1389
  */
1390
1390
  sendJoiningRoomMessage(t) {
1391
1391
  if (!this.isEmbedded())
1392
- throw new l(this.currentContext);
1392
+ throw new h(this.currentContext);
1393
1393
  const {
1394
1394
  roomName: e,
1395
1395
  roomInvite: r,
1396
1396
  displayName: i,
1397
1397
  jwtToken: s,
1398
1398
  serverUrl: o,
1399
- region: a,
1400
- joinMicMuted: c,
1399
+ region: c,
1400
+ joinMicMuted: a,
1401
1401
  joinWithoutCamera: u
1402
- } = t, p = "JOINING ROOM", v = this.createMessage(p, !1);
1403
- v.roomName = e, v.jwtToken = s, v.serverUrl = o, v.region = a, v.roomInvite = r, v.joinMicMuted = c ?? !1, v.joinWithoutCamera = u ?? !1, v.displayName = i, this.logCreated(p, v), this.port2.postMessage(v), this.logSent(p, v);
1402
+ } = t, l = "JOINING ROOM", d = this.createMessage(l, !1);
1403
+ d.roomName = e, d.jwtToken = s, d.serverUrl = o, d.region = c, d.roomInvite = r, d.joinMicMuted = a ?? !1, d.joinWithoutCamera = u ?? !1, d.displayName = i, this.logCreated(l, d), this.port2.postMessage(d), this.logSent(l, d);
1404
1404
  }
1405
1405
  /**
1406
1406
  * Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
@@ -1415,7 +1415,7 @@ class xt {
1415
1415
  */
1416
1416
  sendLeavingRoomMessage(t) {
1417
1417
  if (!this.isEmbedded())
1418
- throw new l(this.currentContext);
1418
+ throw new h(this.currentContext);
1419
1419
  const e = "LEAVING ROOM", r = this.createMessage(e, !1);
1420
1420
  r.roomName = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
1421
1421
  }
@@ -1447,13 +1447,13 @@ class xt {
1447
1447
  */
1448
1448
  onJoinRoomMessage() {
1449
1449
  if (!this.isEmbedded())
1450
- throw new l(this.currentContext);
1450
+ throw new h(this.currentContext);
1451
1451
  const t = "JOIN ROOM";
1452
1452
  return this.incomingMessages$.pipe(
1453
- g((e) => e.type === t && e.target === "client"),
1454
- h((e) => e),
1455
- d(this.logReceived(t)),
1456
- h((e) => e)
1453
+ v((e) => e.type === t && e.target === "client"),
1454
+ p((e) => e),
1455
+ f(this.logReceived(t)),
1456
+ p((e) => e)
1457
1457
  );
1458
1458
  }
1459
1459
  /**
@@ -1483,13 +1483,13 @@ class xt {
1483
1483
  */
1484
1484
  onLeaveRoomMessage() {
1485
1485
  if (!this.isEmbedded())
1486
- throw new l(this.currentContext);
1486
+ throw new h(this.currentContext);
1487
1487
  const t = "LEAVE ROOM";
1488
1488
  return this.incomingMessages$.pipe(
1489
- g((e) => e.type === t && e.target === "client"),
1490
- h((e) => e),
1491
- d(this.logReceived(t)),
1492
- h((e) => e)
1489
+ v((e) => e.type === t && e.target === "client"),
1490
+ p((e) => e),
1491
+ f(this.logReceived(t)),
1492
+ p((e) => e)
1493
1493
  );
1494
1494
  }
1495
1495
  /**
@@ -1520,13 +1520,13 @@ class xt {
1520
1520
  */
1521
1521
  onConfigMessage() {
1522
1522
  if (!this.isEmbedded())
1523
- throw new l(this.currentContext);
1523
+ throw new h(this.currentContext);
1524
1524
  const t = "CONFIG";
1525
1525
  return this.incomingMessages$.pipe(
1526
- g((e) => e.type === t && e.target === "client"),
1527
- h((e) => e),
1528
- d(this.logReceived(t)),
1529
- h((e) => ({
1526
+ v((e) => e.type === t && e.target === "client"),
1527
+ p((e) => e),
1528
+ f(this.logReceived(t)),
1529
+ p((e) => ({
1530
1530
  preferredCameraType: e.preferredCameraType,
1531
1531
  preferredMicType: e.preferredMicType,
1532
1532
  preferredOutputType: e.preferredOutputType,
@@ -1542,28 +1542,28 @@ class xt {
1542
1542
  }
1543
1543
  sendScreenshareSourceMessage(t) {
1544
1544
  if (!this.isEmbedded())
1545
- throw new l(this.currentContext);
1545
+ throw new h(this.currentContext);
1546
1546
  const e = "SCREENSHARE SOURCE", r = this.createMessage(e);
1547
1547
  r.sourceTypes = t, this.logCreated(e, r);
1548
1548
  const i = this.incomingMessages$.pipe(
1549
- g((s) => s.type === e && s.replyTo === r.id),
1550
- h((s) => s),
1551
- d(this.logReceived(e)),
1552
- h((s) => s),
1549
+ v((s) => s.type === e && s.replyTo === r.id),
1550
+ p((s) => s),
1551
+ f(this.logReceived(e)),
1552
+ p((s) => s),
1553
1553
  m(1)
1554
1554
  );
1555
1555
  return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
1556
1556
  }
1557
1557
  layoutChange(t, e, r) {
1558
1558
  if (!this.isEmbedded())
1559
- throw new l(this.currentContext);
1559
+ throw new h(this.currentContext);
1560
1560
  const i = "LAYOUT CHANGE";
1561
1561
  let s, o;
1562
1562
  if (e && r ? (s = this.createMessage(i, !1, r), s.result = e) : (s = this.createMessage(i), o = this.incomingMessages$.pipe(
1563
- g((a) => a.type === i && a.replyTo === s.id),
1564
- h((a) => a),
1565
- d(this.logReceived(i)),
1566
- h((a) => a),
1563
+ v((c) => c.type === i && c.replyTo === s.id),
1564
+ p((c) => c),
1565
+ f(this.logReceived(i)),
1566
+ p((c) => c),
1567
1567
  m(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;
@@ -1601,38 +1601,38 @@ class xt {
1601
1601
  */
1602
1602
  onLayoutChangeMessage() {
1603
1603
  if (!this.isEmbedded())
1604
- throw new l(this.currentContext);
1604
+ throw new h(this.currentContext);
1605
1605
  const t = "LAYOUT CHANGE";
1606
1606
  return this.incomingMessages$.pipe(
1607
- g((e) => e.type === t && e.target === "client" && e.replyTo === null),
1608
- h((e) => e),
1609
- d(this.logReceived(t)),
1610
- h((e) => e)
1607
+ v((e) => e.type === t && e.target === "client" && e.replyTo === null),
1608
+ p((e) => e),
1609
+ f(this.logReceived(t)),
1610
+ p((e) => e)
1611
1611
  );
1612
1612
  }
1613
1613
  requestOAuthToken(t) {
1614
1614
  if (!this.isEmbedded())
1615
- throw new l(this.currentContext);
1615
+ throw new h(this.currentContext);
1616
1616
  Array.isArray(t) || (t = [t]);
1617
1617
  const e = "OAUTH TOKEN", r = this.createMessage(e);
1618
1618
  r.providerTypes = t, this.logCreated(e, r);
1619
1619
  const i = this.incomingMessages$.pipe(
1620
- g((s) => s.type === e && s.replyTo === r.id),
1621
- h((s) => s),
1622
- d(this.logReceived(e)),
1620
+ v((s) => s.type === e && s.replyTo === r.id),
1621
+ p((s) => s),
1622
+ f(this.logReceived(e)),
1623
1623
  m(1)
1624
1624
  );
1625
1625
  return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
1626
1626
  }
1627
1627
  openUrl(t, e) {
1628
1628
  if (!this.isEmbedded())
1629
- throw new l(this.currentContext);
1629
+ throw new h(this.currentContext);
1630
1630
  const r = "OPEN URL", i = this.createMessage(r, !1);
1631
1631
  i.url = t, i.data = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
1632
1632
  }
1633
1633
  selectContacts(t, e, r, i) {
1634
1634
  if (!this.isEmbedded())
1635
- throw new l(this.currentContext);
1635
+ throw new h(this.currentContext);
1636
1636
  if (e === "group" && i === void 0)
1637
1637
  throw new x(
1638
1638
  "currentContacts",
@@ -1647,19 +1647,19 @@ class xt {
1647
1647
  );
1648
1648
  const s = "SELECT CONTACTS", o = this.createMessage(s, !0);
1649
1649
  o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = i, this.logCreated(s, o);
1650
- const a = this.incomingMessages$.pipe(
1651
- g((c) => c.type === s && c.replyTo === o.id),
1652
- d(this.logReceived(s)),
1650
+ const c = this.incomingMessages$.pipe(
1651
+ v((a) => a.type === s && a.replyTo === o.id),
1652
+ f(this.logReceived(s)),
1653
1653
  // validate if `streamId` is the same as we sent
1654
- h((c) => {
1655
- const u = c;
1654
+ p((a) => {
1655
+ const u = a;
1656
1656
  if (u.streamId !== t)
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
1660
  m(1)
1661
1661
  );
1662
- return this.logService.debug(`Created ${s} Reply handler`), this.port2.postMessage(o), this.logSent(s, o), a;
1662
+ return this.logService.debug(`Created ${s} Reply handler`), this.port2.postMessage(o), this.logSent(s, o), c;
1663
1663
  }
1664
1664
  /**
1665
1665
  * Request detailed contact information for the given Cloud usernames.
@@ -1671,15 +1671,15 @@ class xt {
1671
1671
  */
1672
1672
  matchContacts(t) {
1673
1673
  if (!this.isEmbedded())
1674
- throw new l(this.currentContext);
1674
+ throw new h(this.currentContext);
1675
1675
  if (!t.length)
1676
1676
  throw new x("contacts", t, "At least one contact is required");
1677
1677
  const e = "MATCH CONTACTS", r = this.createMessage(e);
1678
1678
  r.contacts = [...t], this.logCreated(e, r);
1679
1679
  const i = this.incomingMessages$.pipe(
1680
- g((s) => s.type === e && s.replyTo === r.id),
1681
- d(this.logReceived(e)),
1682
- h((s) => s),
1680
+ v((s) => s.type === e && s.replyTo === r.id),
1681
+ f(this.logReceived(e)),
1682
+ p((s) => s),
1683
1683
  m(1)
1684
1684
  );
1685
1685
  return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
@@ -1712,12 +1712,12 @@ class xt {
1712
1712
  */
1713
1713
  onPushMessageMessage() {
1714
1714
  if (!this.isEmbedded())
1715
- throw new l(this.currentContext);
1715
+ throw new h(this.currentContext);
1716
1716
  const t = "PUSH MESSAGE";
1717
1717
  return this.incomingMessages$.pipe(
1718
- g((e) => e.type === t && e.target === "client"),
1719
- h((e) => e),
1720
- d(this.logReceived(t))
1718
+ v((e) => e.type === t && e.target === "client"),
1719
+ p((e) => e),
1720
+ f(this.logReceived(t))
1721
1721
  );
1722
1722
  }
1723
1723
  /**
@@ -1731,13 +1731,13 @@ class xt {
1731
1731
  */
1732
1732
  requestPushToken() {
1733
1733
  if (!this.isEmbedded())
1734
- throw new l(this.currentContext);
1734
+ throw new h(this.currentContext);
1735
1735
  const t = "PUSH TOKEN", e = this.createMessage(t);
1736
1736
  this.logCreated(t, e);
1737
1737
  const r = this.incomingMessages$.pipe(
1738
- g((i) => i.type === t && i.replyTo === e.id),
1739
- d(this.logReceived(t)),
1740
- h((i) => i),
1738
+ v((i) => i.type === t && i.replyTo === e.id),
1739
+ f(this.logReceived(t)),
1740
+ p((i) => i),
1741
1741
  m(1)
1742
1742
  );
1743
1743
  return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
@@ -1771,19 +1771,19 @@ class xt {
1771
1771
  */
1772
1772
  onPushTokenMessage() {
1773
1773
  if (!this.isEmbedded())
1774
- throw new l(this.currentContext);
1774
+ throw new h(this.currentContext);
1775
1775
  const t = "PUSH TOKEN";
1776
1776
  return this.incomingMessages$.pipe(
1777
- g(
1777
+ v(
1778
1778
  (e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
1779
1779
  ),
1780
- h((e) => {
1780
+ p((e) => {
1781
1781
  if (e.pushToken && e.selector && e.appId)
1782
1782
  return e;
1783
1783
  throw new Error("PushTokenMessage is missing required PushTokenPayload fields");
1784
1784
  }),
1785
- d((e) => e.pushToken),
1786
- d(this.logReceived(t))
1785
+ f((e) => e.pushToken),
1786
+ f(this.logReceived(t))
1787
1787
  );
1788
1788
  }
1789
1789
  /**
@@ -1795,12 +1795,12 @@ class xt {
1795
1795
  */
1796
1796
  onBadgeQueryMessage() {
1797
1797
  if (!this.isEmbedded())
1798
- throw new l(this.currentContext);
1798
+ throw new h(this.currentContext);
1799
1799
  const t = "BADGE QUERY";
1800
1800
  return this.incomingMessages$.pipe(
1801
- g((e) => e.type === t && e.target === "client"),
1802
- h((e) => e),
1803
- d(this.logReceived(t))
1801
+ v((e) => e.type === t && e.target === "client"),
1802
+ p((e) => e),
1803
+ f(this.logReceived(t))
1804
1804
  );
1805
1805
  }
1806
1806
  /**
@@ -1817,7 +1817,7 @@ class xt {
1817
1817
  */
1818
1818
  sendBadgeUpdateMessage(t, e, r) {
1819
1819
  if (!this.isEmbedded())
1820
- throw new l(this.currentContext);
1820
+ throw new h(this.currentContext);
1821
1821
  const i = "BADGE UPDATE", s = this.createMessage(i, !1, r);
1822
1822
  s.count = t, s.activity = e ?? !1, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s);
1823
1823
  }
@@ -1836,7 +1836,7 @@ class xt {
1836
1836
  */
1837
1837
  sendLifecycleMessage(t, e) {
1838
1838
  if (!this.isEmbedded())
1839
- throw new l(this.currentContext);
1839
+ throw new h(this.currentContext);
1840
1840
  const r = "LIFECYCLE", i = this.createMessage(r, !1);
1841
1841
  i.eventName = t, i.payload = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
1842
1842
  }
@@ -1853,12 +1853,12 @@ class xt {
1853
1853
  */
1854
1854
  onLifecycleMessage() {
1855
1855
  if (!this.isEmbedded())
1856
- throw new l(this.currentContext);
1856
+ throw new h(this.currentContext);
1857
1857
  const t = "LIFECYCLE";
1858
1858
  return this.incomingMessages$.pipe(
1859
- g((e) => e.type === t && e.target === "client"),
1860
- h((e) => e),
1861
- d(this.logReceived(t))
1859
+ v((e) => e.type === t && e.target === "client"),
1860
+ p((e) => e),
1861
+ f(this.logReceived(t))
1862
1862
  );
1863
1863
  }
1864
1864
  /**
@@ -1875,7 +1875,7 @@ class xt {
1875
1875
  */
1876
1876
  sendLogMessage(t, e) {
1877
1877
  if (!this.isEmbedded())
1878
- throw new l(this.currentContext);
1878
+ throw new h(this.currentContext);
1879
1879
  const r = "LOG", i = this.createMessage(r, !1);
1880
1880
  i.level = t, i.message = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
1881
1881
  }
@@ -1893,12 +1893,12 @@ class xt {
1893
1893
  */
1894
1894
  onRequestLogsMessage() {
1895
1895
  if (!this.isEmbedded())
1896
- throw new l(this.currentContext);
1896
+ throw new h(this.currentContext);
1897
1897
  const t = "REQUEST LOGS";
1898
1898
  return this.incomingMessages$.pipe(
1899
- g((e) => e.type === t && e.target === "client"),
1900
- h((e) => e),
1901
- d(this.logReceived(t))
1899
+ v((e) => e.type === t && e.target === "client"),
1900
+ p((e) => e),
1901
+ f(this.logReceived(t))
1902
1902
  );
1903
1903
  }
1904
1904
  /**
@@ -1916,7 +1916,7 @@ class xt {
1916
1916
  */
1917
1917
  sendViewTransitionMessage(t, e) {
1918
1918
  if (!this.isEmbedded())
1919
- throw new l(this.currentContext);
1919
+ throw new h(this.currentContext);
1920
1920
  const r = "VIEW TRANSITION", i = this.createMessage(r, !1);
1921
1921
  i.transitionType = t, i.targetView = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
1922
1922
  }
@@ -1950,6 +1950,7 @@ class xt {
1950
1950
  * });
1951
1951
  * ```
1952
1952
  *
1953
+ * @param fileId - An identifier for the file being requested. This should be a UUIDv4 string.
1953
1954
  * @param fileHash - An SHA256 hash of the file being requested.
1954
1955
  * @param intent - The intent of the file request. Can be either `attachment` or `general`.
1955
1956
  * @param streamId - _Optional_. The ID of the message stream to which the files will be attached
@@ -1960,31 +1961,31 @@ class xt {
1960
1961
  * @returns An observable that either emits once if the result is `error` or `not found` or
1961
1962
  * emits as many times as the number of chunks in the file if the result is `success`.
1962
1963
  */
1963
- sendFileRequestMessage(t, e, r, i) {
1964
+ sendFileRequestMessage(t, e, r, i, s) {
1964
1965
  if (!this.isEmbedded())
1965
- throw new l(this.currentContext);
1966
- const s = "FILE REQUEST", o = this.createMessage(s);
1967
- if (o.fileHash = t.toLowerCase(), o.intent = e, o.maxChunkSizeInBytes = i, e === "attachment") {
1968
- if (!r)
1966
+ throw new h(this.currentContext);
1967
+ const o = "FILE REQUEST", c = this.createMessage(o);
1968
+ if (c.fileId = t, c.fileHash = e.toLowerCase(), c.intent = r, c.maxChunkSizeInBytes = s, r === "attachment") {
1969
+ if (!i)
1969
1970
  throw new x(
1970
1971
  "streamId",
1971
- r,
1972
+ i,
1972
1973
  "streamId is required for attachment intent"
1973
1974
  );
1974
- o.streamId = r;
1975
+ c.streamId = i;
1975
1976
  }
1976
- this.logCreated(s, o);
1977
+ this.logCreated(o, c);
1977
1978
  let a = 0;
1978
- const c = this.incomingMessages$.pipe(
1979
- g(
1980
- (u) => u.type === s && u.replyTo === o.id
1979
+ const u = this.incomingMessages$.pipe(
1980
+ v(
1981
+ (l) => l.type === o && l.replyTo === c.id
1981
1982
  ),
1982
- d(this.logReceived(s)),
1983
- d(() => a++),
1984
- h((u) => (u.result === "success" && (u.chunkHash = u.chunkHash.toLowerCase()), u)),
1985
- wt((u) => u.result === "success" && a < u.totalChunks, !0)
1983
+ f(this.logReceived(o)),
1984
+ f(() => a++),
1985
+ p((l) => (l.result === "success" && (l.chunkHash = l.chunkHash.toLowerCase(), l.fileHash = l.fileHash.toLowerCase()), l)),
1986
+ wt((l) => l.result === "success" && a < l.totalChunks, !0)
1986
1987
  );
1987
- return this.port2.postMessage(o), this.logSent(s, o), c;
1988
+ return this.port2.postMessage(c), this.logSent(o, c), u;
1988
1989
  }
1989
1990
  /**
1990
1991
  * Sends a {@link FileRequestMessageReply} to the Host app, to reply to a
@@ -2007,7 +2008,7 @@ class xt {
2007
2008
  */
2008
2009
  sendFileRequestMessageReply(t, e) {
2009
2010
  if (!this.isEmbedded())
2010
- throw new l(this.currentContext);
2011
+ throw new h(this.currentContext);
2011
2012
  const r = "FILE REQUEST", i = Object.assign(
2012
2013
  e,
2013
2014
  this.createMessage(r, !1, t.id)
@@ -2028,14 +2029,14 @@ class xt {
2028
2029
  */
2029
2030
  onFileRequestMessage() {
2030
2031
  if (!this.isEmbedded())
2031
- throw new l(this.currentContext);
2032
+ throw new h(this.currentContext);
2032
2033
  const t = "FILE REQUEST";
2033
2034
  return this.incomingMessages$.pipe(
2034
- g(
2035
+ v(
2035
2036
  (e) => e.type === t && e.target === "client" && e.replyTo === null
2036
2037
  ),
2037
- h((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
2038
- d(this.logReceived(t))
2038
+ p((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
2039
+ f(this.logReceived(t))
2039
2040
  );
2040
2041
  }
2041
2042
  /**
@@ -2050,6 +2051,8 @@ class xt {
2050
2051
  * `general`. Defaults to `attachment`.
2051
2052
  * @param streamId - _Optional_. The ID of the message stream to which the files will be attached
2052
2053
  * to. Only used if `intent` is set to `attachment`.
2054
+ * @param correlationId - _Optional_. The correlation ID of the message the attachments are being
2055
+ * selected for. This should be a UUIDv4 string. Only used if `intent` is set to `attachment`.
2053
2056
  * @param maxCount - _Optional_. The maximum number of files the user can select. Defaults to
2054
2057
  * unlimited.
2055
2058
  * @param maxFileSize - _Optional_. The maximum size of the files to select in bytes. Defaults to
@@ -2060,9 +2063,9 @@ class xt {
2060
2063
  */
2061
2064
  sendFileSelectionMessage(t = "attachment", e, r, i, s, o) {
2062
2065
  if (!this.isEmbedded())
2063
- throw new l(this.currentContext);
2064
- const a = "FILE SELECTION", c = this.createMessage(a);
2065
- if (c.intent = t, c.maxCount = i, c.maxFileSizeInBytes = s, c.mimeTypes = o, t === "attachment") {
2066
+ throw new h(this.currentContext);
2067
+ const c = "FILE SELECTION", a = this.createMessage(c);
2068
+ if (a.intent = t, a.maxCount = i, a.maxFileSizeInBytes = s, a.mimeTypes = o, t === "attachment") {
2066
2069
  if (!e)
2067
2070
  throw new x(
2068
2071
  "streamId",
@@ -2075,21 +2078,21 @@ class xt {
2075
2078
  r,
2076
2079
  "correlationId is required for attachment intent"
2077
2080
  );
2078
- c.streamId = e, c.correlationId = r;
2081
+ a.streamId = e, a.correlationId = r;
2079
2082
  }
2080
- this.logCreated(a, c);
2083
+ this.logCreated(c, a);
2081
2084
  const u = this.incomingMessages$.pipe(
2082
- g(
2083
- (p) => p.type === a && p.replyTo === c.id
2085
+ v(
2086
+ (l) => l.type === c && l.replyTo === a.id
2084
2087
  ),
2085
- h((p) => {
2086
- var v;
2087
- return p.files = (v = p.files) == null ? void 0 : v.map((b) => (b.fileHash = b.fileHash.toLowerCase(), b)), p;
2088
+ p((l) => {
2089
+ var d;
2090
+ return l.files = (d = l.files) == null ? void 0 : d.map((y) => (y.fileHash = y.fileHash.toLowerCase(), y)), l;
2088
2091
  }),
2089
- d(this.logReceived(a)),
2092
+ f(this.logReceived(c)),
2090
2093
  m(1)
2091
2094
  );
2092
- return this.port2.postMessage(c), this.logSent(a, c), u;
2095
+ return this.port2.postMessage(a), this.logSent(c, a), u;
2093
2096
  }
2094
2097
  /**
2095
2098
  * Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
@@ -2107,16 +2110,16 @@ class xt {
2107
2110
  */
2108
2111
  sendFileDownloadMessage(t, e, r, i) {
2109
2112
  if (!this.isEmbedded())
2110
- throw new l(this.currentContext);
2113
+ throw new h(this.currentContext);
2111
2114
  const s = "FILE DOWNLOAD", o = this.createMessage(s);
2112
2115
  o.url = t, o.key = e, o.fileName = r, o.mimeType = i, this.logCreated(s, o);
2113
- const a = this.incomingMessages$.pipe(
2114
- g((c) => c.type === s && c.replyTo === o.id),
2115
- d(this.logReceived(s)),
2116
- h((c) => c),
2116
+ const c = this.incomingMessages$.pipe(
2117
+ v((a) => a.type === s && a.replyTo === o.id),
2118
+ f(this.logReceived(s)),
2119
+ p((a) => a),
2117
2120
  m(1)
2118
2121
  );
2119
- return this.port2.postMessage(o), this.logSent(s, o), a;
2122
+ return this.port2.postMessage(o), this.logSent(s, o), c;
2120
2123
  }
2121
2124
  sendFileUploadMessage() {
2122
2125
  throw new Error("Not implemented");
@@ -2140,11 +2143,11 @@ class xt {
2140
2143
  *
2141
2144
  * @returns This method returns void.
2142
2145
  */
2143
- sendFileOpenMessage(t, e, r, i, s, o, a) {
2146
+ sendFileOpenMessage(t, e, r, i, s, o, c) {
2144
2147
  if (!this.isEmbedded())
2145
- throw new l(this.currentContext);
2146
- const c = "FILE OPEN", u = this.createMessage(c, !1);
2147
- u.fileHash = t.toLowerCase(), u.fileName = e, u.streamId = r, u.url = i, u.correlationId = s, u.key = o, u.sender = a, this.logCreated(c, u), this.port2.postMessage(u), this.logSent(c, u);
2148
+ throw new h(this.currentContext);
2149
+ const a = "FILE OPEN", u = this.createMessage(a, !1);
2150
+ u.fileHash = t.toLowerCase(), u.fileName = e, u.streamId = r, u.url = i, u.correlationId = s, u.key = o, u.sender = c, this.logCreated(a, u), this.port2.postMessage(u), this.logSent(a, u);
2148
2151
  }
2149
2152
  /**
2150
2153
  * Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the
@@ -2163,13 +2166,13 @@ class xt {
2163
2166
  */
2164
2167
  sendFileRemoveMessage(t, e) {
2165
2168
  if (!this.isEmbedded())
2166
- throw new l(this.currentContext);
2169
+ throw new h(this.currentContext);
2167
2170
  const r = "FILE REMOVE", i = this.createMessage(r, !0);
2168
2171
  i.hash = t.toLowerCase(), i.streamId = e, this.logCreated(r, i);
2169
2172
  const s = this.incomingMessages$.pipe(
2170
- g((o) => o.type === r && o.replyTo === i.id),
2171
- d(this.logReceived(r)),
2172
- h((o) => o),
2173
+ v((o) => o.type === r && o.replyTo === i.id),
2174
+ f(this.logReceived(r)),
2175
+ p((o) => o),
2173
2176
  m(1)
2174
2177
  );
2175
2178
  return this.port2.postMessage(i), this.logSent(r, i), s;
@@ -2189,29 +2192,71 @@ class xt {
2189
2192
  */
2190
2193
  sendAppResetMessage() {
2191
2194
  if (!this.isEmbedded())
2192
- throw new l(this.currentContext);
2195
+ throw new h(this.currentContext);
2193
2196
  const t = "APP RESET", e = this.createMessage(t, !1);
2194
2197
  this.logCreated(t, e), this.port2.postMessage(e), this.logSent(t, e);
2195
2198
  }
2196
2199
  /**
2197
2200
  * Sends a {@link MessageSentMessage} to the Host app, to notify it of a message that has been
2198
- * sent to the specified stream along with any attachments.
2201
+ * sent to the specified stream.
2199
2202
  *
2200
2203
  * @remarks
2201
- * The number of items in the `attachments` array should be equal to the number of files sent
2202
- * with the message. If no files were sent, the `attachments` array should be undefined or empty.
2204
+ * @remarks
2205
+ * The `streamId` field is used to specify the ID of the message stream the message is being sent
2206
+ * to. The `correlationId` field is used to identify the message being composed and as an
2207
+ * idempotency key.
2208
+ *
2209
+ * The `host` app can use the `correlationId` to identify any attachments associated with the
2210
+ * message in it's storage
2203
2211
  *
2204
2212
  * @param streamId - ID of the stream the message was sent to.
2205
- * @param attachments - _Optional_. A list of file hashes of the attachments sent with the
2206
- * message.
2213
+ * @param correlationId - Correlation ID of the message that was sent.
2207
2214
  *
2208
2215
  * @returns This method returns void.
2209
2216
  */
2210
2217
  sendMessageSentMessage(t, e) {
2211
2218
  if (!this.isEmbedded())
2212
- throw new l(this.currentContext);
2219
+ throw new h(this.currentContext);
2213
2220
  const r = "MESSAGE SENT", i = this.createMessage(r, !1);
2214
- 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);
2221
+ i.streamId = t, i.correlationId = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
2222
+ }
2223
+ /**
2224
+ * Sends a {@link SendMessageMessage} to the Host app, to send a message to the specified stream.
2225
+ *
2226
+ * @param streamId - ID of the stream the message is being sent to.
2227
+ * @param correlationId - Correlation ID of the message being sent.
2228
+ * @param body - The body of the message.
2229
+ * @param messageType - The type of the message. Defaults to `TEXT`.
2230
+ * @param mentions - _Optional_. A list of mentions in the message.
2231
+ * @param attachments - _Optional_. A list of file IDs of the attachments being sent with the
2232
+ * message.
2233
+ * @param relatedMessageId - _Optional_. The ID of the related message in case `messageType` is
2234
+ * `REPLY` or `UPDATE`.
2235
+ * @param setCursors - _Optional_. Whether to set the cursors for the message. Defaults to `true`.
2236
+ * @param threadId - _Optional_. The ID of the thread the message is being sent to.
2237
+ *
2238
+ * @returns This method returns void.
2239
+ */
2240
+ sendSendMessageMessage(t, e, r, i = "TEXT", s, o, c, a = !0, u) {
2241
+ if (!this.isEmbedded())
2242
+ throw new h(this.currentContext);
2243
+ const l = "SEND MESSAGE", d = this.createMessage(l, !1);
2244
+ d.streamId = t, d.correlationId = e, d.body = r, d.messageType = i, d.mentions = s ?? [], d.attachments = (o == null ? void 0 : o.map((y) => y.toLowerCase())) ?? [], d.relatedMessageId = c, d.setCursors = a, d.threadId = u, this.logCreated(l, d), this.port2.postMessage(d), this.logSent(l, d);
2245
+ }
2246
+ /**
2247
+ * Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being
2248
+ * sent to the specified stream.
2249
+ *
2250
+ * @param streamId - ID of the stream the message was being sent to.
2251
+ * @param correlationId - Correlation ID of the message that was being sent.
2252
+ *
2253
+ * @returns This method returns void.
2254
+ */
2255
+ sendCancelSendMessageMessage(t, e) {
2256
+ if (!this.isEmbedded())
2257
+ throw new h(this.currentContext);
2258
+ const r = "CANCEL SEND MESSAGE", i = this.createMessage(r, !1);
2259
+ i.streamId = t, i.correlationId = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
2215
2260
  }
2216
2261
  /**
2217
2262
  * Sends a {@link SipCallMessage} to the Host app to initiate a SIP call between the current user
@@ -2221,7 +2266,7 @@ class xt {
2221
2266
  */
2222
2267
  sendSipCallMessage(t) {
2223
2268
  if (!this.isEmbedded())
2224
- throw new l(this.currentContext);
2269
+ throw new h(this.currentContext);
2225
2270
  const e = "SIP CALL", r = this.createMessage(e, !1);
2226
2271
  r.contact = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
2227
2272
  }
@@ -2265,7 +2310,7 @@ class xt {
2265
2310
  return ne(this.negotiatedProtocolVersion, t);
2266
2311
  }
2267
2312
  logReceived(t, e) {
2268
- e && _t(e) && (e = { ...e, data: "..." });
2313
+ e && It(e) && (e = { ...e, data: "..." });
2269
2314
  const r = (i) => this.logService.debug(`[IPC] Received ${t} message`, i);
2270
2315
  return e && r(e), r;
2271
2316
  }
@@ -2308,10 +2353,10 @@ class xt {
2308
2353
  return i.join("");
2309
2354
  }
2310
2355
  }
2311
- function _t(n) {
2356
+ function It(n) {
2312
2357
  return n.type === "FILE REQUEST" && n.replyTo !== null;
2313
2358
  }
2314
- const It = ["2.0"];
2359
+ const _t = ["2.0"];
2315
2360
  class Rt {
2316
2361
  /**
2317
2362
  * A class that manages the IPC communication between the `Client` and the `Host`.
@@ -2327,15 +2372,15 @@ class Rt {
2327
2372
  /**
2328
2373
  * The type of the `Host` app the `Client` is embedded in.
2329
2374
  */
2330
- _(this, "host");
2375
+ I(this, "host");
2331
2376
  /**
2332
2377
  * The cloud ID of the `Host` app the `Client` is embedded in.
2333
2378
  */
2334
- _(this, "cloudId");
2335
- _(this, "logger");
2336
- _(this, "helper");
2337
- _(this, "listeners");
2338
- this.logger = t ?? console, this.helper = new xt(It, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(y.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(y.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(y.PushToken, /* @__PURE__ */ new Set());
2379
+ I(this, "cloudId");
2380
+ I(this, "logger");
2381
+ I(this, "helper");
2382
+ I(this, "listeners");
2383
+ this.logger = t ?? console, this.helper = new xt(_t, 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());
2339
2384
  }
2340
2385
  /**
2341
2386
  * Returns whether the app is running inside a native WebView (`host` context) or as a
@@ -2362,7 +2407,7 @@ class Rt {
2362
2407
  * @returns A promise with {@link IPCContext} the app is running under.
2363
2408
  */
2364
2409
  async determineContext() {
2365
- const t = await I(this.helper.determineContext(), {
2410
+ const t = await _(this.helper.determineContext(), {
2366
2411
  defaultValue: "guest"
2367
2412
  });
2368
2413
  return this.evaluateContext(t);
@@ -2371,23 +2416,23 @@ class Rt {
2371
2416
  * Initiates the IPC handshake with the `Host` app.
2372
2417
  */
2373
2418
  initiateConnection() {
2374
- return I(
2419
+ return _(
2375
2420
  this.helper.openBridge().pipe(
2376
2421
  Ze((t) => {
2377
2422
  this.helper.onBadgeQueryMessage().subscribe((e) => {
2378
2423
  var r;
2379
2424
  this.logger.debug("Received Badge Query: ", e);
2380
- for (const i of ((r = this.listeners.get(y.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
2425
+ for (const i of ((r = this.listeners.get(b.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
2381
2426
  i();
2382
2427
  }), this.helper.onLifecycleMessage().subscribe((e) => {
2383
2428
  var r;
2384
2429
  this.logger.debug("Received Lifecycle Event: ", e);
2385
- for (const i of ((r = this.listeners.get(y.Lifecycle)) == null ? void 0 : r.values()) ?? [])
2430
+ for (const i of ((r = this.listeners.get(b.Lifecycle)) == null ? void 0 : r.values()) ?? [])
2386
2431
  i(e.eventName, e.payload);
2387
2432
  }), this.helper.onPushTokenMessage().subscribe((e) => {
2388
2433
  var r;
2389
2434
  this.logger.debug("Received Push Token: ", e);
2390
- for (const i of ((r = this.listeners.get(y.PushToken)) == null ? void 0 : r.values()) ?? [])
2435
+ for (const i of ((r = this.listeners.get(b.PushToken)) == null ? void 0 : r.values()) ?? [])
2391
2436
  i(e.pushToken, e.appId, e.selector);
2392
2437
  }), this.cloudId = t.cloudId, this.host = t.host;
2393
2438
  }),
@@ -2414,7 +2459,7 @@ class Rt {
2414
2459
  );
2415
2460
  } else
2416
2461
  r ? i = r : i = "cloudUsername", s = this.helper.selectContacts(t.toString(), "direct", i);
2417
- return I(s.pipe(O((o) => o.contacts)));
2462
+ return _(s.pipe(O((o) => o.contacts)));
2418
2463
  }
2419
2464
  /**
2420
2465
  * Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
@@ -2426,7 +2471,7 @@ class Rt {
2426
2471
  * Host's contact list.
2427
2472
  */
2428
2473
  matchContacts(t) {
2429
- return this.logger.debug("Match Contacts: ", t), I(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
2474
+ return this.logger.debug("Match Contacts: ", t), _(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
2430
2475
  }
2431
2476
  /**
2432
2477
  * Requests the `Host` app to provide the Push Token for the current device.
@@ -2434,7 +2479,7 @@ class Rt {
2434
2479
  * @returns A promise with the Push Token as `string`.
2435
2480
  */
2436
2481
  requestPushToken() {
2437
- return this.logger.debug("Requesting Push Token"), I(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
2482
+ return this.logger.debug("Requesting Push Token"), _(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
2438
2483
  }
2439
2484
  /**
2440
2485
  * Sends the current badge count to the `Host` app.
@@ -2484,9 +2529,9 @@ class Rt {
2484
2529
  */
2485
2530
  onBadgeQueryRequest(t) {
2486
2531
  var e;
2487
- return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(y.BadgeQuery)) == null || e.add(t), () => {
2532
+ return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(b.BadgeQuery)) == null || e.add(t), () => {
2488
2533
  var r;
2489
- return (r = this.listeners.get(y.BadgeQuery)) == null ? void 0 : r.delete(t);
2534
+ return (r = this.listeners.get(b.BadgeQuery)) == null ? void 0 : r.delete(t);
2490
2535
  };
2491
2536
  }
2492
2537
  /**
@@ -2503,9 +2548,9 @@ class Rt {
2503
2548
  */
2504
2549
  onLifecycleEvent(t) {
2505
2550
  var e;
2506
- return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(y.Lifecycle)) == null || e.add(t), () => {
2551
+ return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(b.Lifecycle)) == null || e.add(t), () => {
2507
2552
  var r;
2508
- return (r = this.listeners.get(y.Lifecycle)) == null ? void 0 : r.delete(t);
2553
+ return (r = this.listeners.get(b.Lifecycle)) == null ? void 0 : r.delete(t);
2509
2554
  };
2510
2555
  }
2511
2556
  /**
@@ -2521,9 +2566,9 @@ class Rt {
2521
2566
  */
2522
2567
  onPushToken(t) {
2523
2568
  var e;
2524
- return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(y.PushToken)) == null || e.add(t), () => {
2569
+ return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(b.PushToken)) == null || e.add(t), () => {
2525
2570
  var r;
2526
- return (r = this.listeners.get(y.PushToken)) == null ? void 0 : r.delete(t);
2571
+ return (r = this.listeners.get(b.PushToken)) == null ? void 0 : r.delete(t);
2527
2572
  };
2528
2573
  }
2529
2574
  evaluateContext(t) {
@@ -2534,6 +2579,6 @@ class Rt {
2534
2579
  }
2535
2580
  }
2536
2581
  export {
2537
- y as IPCEvents,
2582
+ b as IPCEvents,
2538
2583
  Rt as IPCManager
2539
2584
  };