@acrobits/ipc-sdk 0.11.2-alpha.8 → 0.12.0-alpha.9

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
- var Pe = Object.defineProperty;
2
- var Ae = (s, t, e) => t in s ? Pe(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var M = (s, t, e) => (Ae(s, typeof t != "symbol" ? t + "" : t, e), e);
4
- var S = /* @__PURE__ */ ((s) => (s.BadgeQuery = "BADGE QUERY", s.Lifecycle = "LIFECYCLE", s.PushToken = "PUSH TOKEN", s.RequestLogs = "REQUEST LOGS", s))(S || {}), B = function(s, t) {
1
+ var Ae = Object.defineProperty;
2
+ var Pe = (s, t, e) => t in s ? Ae(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var I = (s, t, e) => (Pe(s, typeof t != "symbol" ? t + "" : t, e), e);
4
+ var C = /* @__PURE__ */ ((s) => (s.BadgeQuery = "BADGE QUERY", s.Lifecycle = "LIFECYCLE", s.PushToken = "PUSH TOKEN", s.RequestLogs = "REQUEST LOGS", s))(C || {}), B = function(s, t) {
5
5
  return B = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
6
6
  e.__proto__ = r;
7
7
  } || function(e, r) {
@@ -18,7 +18,7 @@ function U(s, t) {
18
18
  }
19
19
  s.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
20
20
  }
21
- function Q(s) {
21
+ function G(s) {
22
22
  var t = typeof Symbol == "function" && Symbol.iterator, e = t && s[t], r = 0;
23
23
  if (e)
24
24
  return e.call(s);
@@ -56,7 +56,7 @@ function k(s, t, e) {
56
56
  (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
57
57
  return s.concat(i || Array.prototype.slice.call(t));
58
58
  }
59
- function C(s) {
59
+ function S(s) {
60
60
  return typeof s == "function";
61
61
  }
62
62
  function X(s) {
@@ -74,7 +74,7 @@ var V = X(function(s) {
74
74
  `) : "", this.name = "UnsubscriptionError", this.errors = e;
75
75
  };
76
76
  });
77
- function D(s, t) {
77
+ function N(s, t) {
78
78
  if (s) {
79
79
  var e = s.indexOf(t);
80
80
  0 <= e && s.splice(e, 1);
@@ -92,7 +92,7 @@ var x = 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()) {
95
+ for (var a = G(o), c = a.next(); !c.done; c = a.next()) {
96
96
  var l = c.value;
97
97
  l.remove(this);
98
98
  }
@@ -108,10 +108,10 @@ var x = function() {
108
108
  }
109
109
  else
110
110
  o.remove(this);
111
- var h = this.initialTeardown;
112
- if (C(h))
111
+ var d = this.initialTeardown;
112
+ if (S(d))
113
113
  try {
114
- h();
114
+ d();
115
115
  } catch (v) {
116
116
  i = v instanceof V ? v.errors : [v];
117
117
  }
@@ -119,10 +119,10 @@ var x = function() {
119
119
  if (u) {
120
120
  this._finalizers = null;
121
121
  try {
122
- for (var b = Q(u), p = b.next(); !p.done; p = b.next()) {
122
+ for (var b = G(u), p = b.next(); !p.done; p = b.next()) {
123
123
  var F = p.value;
124
124
  try {
125
- se(F);
125
+ ne(F);
126
126
  } catch (v) {
127
127
  i = i ?? [], v instanceof V ? i = k(k([], $(i)), $(v.errors)) : i.push(v);
128
128
  }
@@ -145,7 +145,7 @@ var x = function() {
145
145
  var e;
146
146
  if (t && t !== this)
147
147
  if (this.closed)
148
- se(t);
148
+ ne(t);
149
149
  else {
150
150
  if (t instanceof s) {
151
151
  if (t.closed || t._hasParent(this))
@@ -162,20 +162,20 @@ var x = function() {
162
162
  this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
163
163
  }, s.prototype._removeParent = function(t) {
164
164
  var e = this._parentage;
165
- e === t ? this._parentage = null : Array.isArray(e) && D(e, t);
165
+ e === t ? this._parentage = null : Array.isArray(e) && N(e, t);
166
166
  }, s.prototype.remove = function(t) {
167
167
  var e = this._finalizers;
168
- e && D(e, t), t instanceof s && t._removeParent(this);
168
+ e && N(e, t), t instanceof s && t._removeParent(this);
169
169
  }, s.EMPTY = function() {
170
170
  var t = new s();
171
171
  return t.closed = !0, t;
172
172
  }(), s;
173
173
  }(), ve = x.EMPTY;
174
174
  function be(s) {
175
- return s instanceof x || s && "closed" in s && C(s.remove) && C(s.add) && C(s.unsubscribe);
175
+ return s instanceof x || s && "closed" in s && S(s.remove) && S(s.add) && S(s.unsubscribe);
176
176
  }
177
- function se(s) {
178
- C(s) ? s() : s.unsubscribe();
177
+ function ne(s) {
178
+ S(s) ? s() : s.unsubscribe();
179
179
  }
180
180
  var we = {
181
181
  onUnhandledError: null,
@@ -183,24 +183,24 @@ var we = {
183
183
  Promise: void 0,
184
184
  useDeprecatedSynchronousErrorHandling: !1,
185
185
  useDeprecatedNextContext: !1
186
- }, Se = {
186
+ }, Ce = {
187
187
  setTimeout: function(s, t) {
188
188
  for (var e = [], r = 2; r < arguments.length; r++)
189
189
  e[r - 2] = arguments[r];
190
190
  return setTimeout.apply(void 0, k([s, t], $(e)));
191
191
  },
192
192
  clearTimeout: function(s) {
193
- var t = Se.delegate;
193
+ var t = Ce.delegate;
194
194
  return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(s);
195
195
  },
196
196
  delegate: void 0
197
197
  };
198
198
  function _e(s) {
199
- Se.setTimeout(function() {
199
+ Ce.setTimeout(function() {
200
200
  throw s;
201
201
  });
202
202
  }
203
- function ne() {
203
+ function se() {
204
204
  }
205
205
  function O(s) {
206
206
  s();
@@ -212,7 +212,7 @@ var Z = function(s) {
212
212
  return r.isStopped = !1, e ? (r.destination = e, be(e) && e.add(r)) : r.destination = ke, r;
213
213
  }
214
214
  return t.create = function(e, r, n) {
215
- return new N(e, r, n);
215
+ return new D(e, r, n);
216
216
  }, t.prototype.next = function(e) {
217
217
  this.isStopped || this._next(e);
218
218
  }, t.prototype.error = function(e) {
@@ -250,7 +250,7 @@ var Oe = function() {
250
250
  try {
251
251
  e.next(t);
252
252
  } catch (r) {
253
- A(r);
253
+ P(r);
254
254
  }
255
255
  }, s.prototype.error = function(t) {
256
256
  var e = this.partialObserver;
@@ -258,24 +258,24 @@ var Oe = function() {
258
258
  try {
259
259
  e.error(t);
260
260
  } catch (r) {
261
- A(r);
261
+ P(r);
262
262
  }
263
263
  else
264
- A(t);
264
+ P(t);
265
265
  }, s.prototype.complete = function() {
266
266
  var t = this.partialObserver;
267
267
  if (t.complete)
268
268
  try {
269
269
  t.complete();
270
270
  } catch (e) {
271
- A(e);
271
+ P(e);
272
272
  }
273
273
  }, s;
274
- }(), N = function(s) {
274
+ }(), D = function(s) {
275
275
  U(t, s);
276
276
  function t(e, r, n) {
277
277
  var i = s.call(this) || this, o;
278
- if (C(e) || !e)
278
+ if (S(e) || !e)
279
279
  o = {
280
280
  next: e ?? void 0,
281
281
  error: r ?? void 0,
@@ -295,7 +295,7 @@ var Oe = function() {
295
295
  }
296
296
  return t;
297
297
  }(Z);
298
- function A(s) {
298
+ function P(s) {
299
299
  _e(s);
300
300
  }
301
301
  function $e(s) {
@@ -303,23 +303,23 @@ function $e(s) {
303
303
  }
304
304
  var ke = {
305
305
  closed: !0,
306
- next: ne,
306
+ next: se,
307
307
  error: $e,
308
- complete: ne
309
- }, De = function() {
308
+ complete: se
309
+ }, Ne = function() {
310
310
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
311
311
  }();
312
- function Ce(s) {
312
+ function Se(s) {
313
313
  return s;
314
314
  }
315
- function Ne(s) {
316
- return s.length === 0 ? Ce : s.length === 1 ? s[0] : function(e) {
315
+ function De(s) {
316
+ return s.length === 0 ? Se : s.length === 1 ? s[0] : function(e) {
317
317
  return s.reduce(function(r, n) {
318
318
  return n(r);
319
319
  }, e);
320
320
  };
321
321
  }
322
- var G = function() {
322
+ var Q = function() {
323
323
  function s(t) {
324
324
  t && (this._subscribe = t);
325
325
  }
@@ -327,7 +327,7 @@ var G = function() {
327
327
  var e = new s();
328
328
  return e.source = this, e.operator = t, e;
329
329
  }, s.prototype.subscribe = function(t, e, r) {
330
- var n = this, i = Ve(t) ? t : new N(t, e, r);
330
+ var n = this, i = Ve(t) ? t : new D(t, e, r);
331
331
  return O(function() {
332
332
  var o = n, a = o.operator, c = o.source;
333
333
  i.add(a ? a.call(i, c) : c ? n._subscribe(i) : n._trySubscribe(i));
@@ -341,7 +341,7 @@ var G = function() {
341
341
  }, s.prototype.forEach = function(t, e) {
342
342
  var r = this;
343
343
  return e = ie(e), new e(function(n, i) {
344
- var o = new N({
344
+ var o = new D({
345
345
  next: function(a) {
346
346
  try {
347
347
  t(a);
@@ -357,12 +357,12 @@ var G = function() {
357
357
  }, s.prototype._subscribe = function(t) {
358
358
  var e;
359
359
  return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
360
- }, s.prototype[De] = function() {
360
+ }, s.prototype[Ne] = function() {
361
361
  return this;
362
362
  }, s.prototype.pipe = function() {
363
363
  for (var t = [], e = 0; e < arguments.length; e++)
364
364
  t[e] = arguments[e];
365
- return Ne(t)(this);
365
+ return De(t)(this);
366
366
  }, s.prototype.toPromise = function(t) {
367
367
  var e = this;
368
368
  return t = ie(t), new t(function(r, n) {
@@ -384,13 +384,13 @@ function ie(s) {
384
384
  return (t = s ?? we.Promise) !== null && t !== void 0 ? t : Promise;
385
385
  }
386
386
  function Fe(s) {
387
- return s && C(s.next) && C(s.error) && C(s.complete);
387
+ return s && S(s.next) && S(s.error) && S(s.complete);
388
388
  }
389
389
  function Ve(s) {
390
390
  return s && s instanceof Z || Fe(s) && be(s);
391
391
  }
392
392
  function He(s) {
393
- return C(s == null ? void 0 : s.lift);
393
+ return S(s == null ? void 0 : s.lift);
394
394
  }
395
395
  function Ee(s) {
396
396
  return function(t) {
@@ -405,24 +405,24 @@ function Ee(s) {
405
405
  throw new TypeError("Unable to lift unknown Observable type");
406
406
  };
407
407
  }
408
- function Me(s, t, e, r, n) {
409
- return new je(s, t, e, r, n);
408
+ function Ie(s, t, e, r, n) {
409
+ return new qe(s, t, e, r, n);
410
410
  }
411
- var je = function(s) {
411
+ var qe = function(s) {
412
412
  U(t, s);
413
413
  function t(e, r, n, i, o, a) {
414
414
  var c = s.call(this, e) || this;
415
415
  return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
416
416
  try {
417
417
  r(l);
418
- } catch (h) {
419
- e.error(h);
418
+ } catch (d) {
419
+ e.error(d);
420
420
  }
421
421
  } : s.prototype._next, c._error = i ? function(l) {
422
422
  try {
423
423
  i(l);
424
- } catch (h) {
425
- e.error(h);
424
+ } catch (d) {
425
+ e.error(d);
426
426
  } finally {
427
427
  this.unsubscribe();
428
428
  }
@@ -443,11 +443,11 @@ var je = function(s) {
443
443
  s.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
444
444
  }
445
445
  }, t;
446
- }(Z), qe = X(function(s) {
446
+ }(Z), je = X(function(s) {
447
447
  return function() {
448
448
  s(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
449
449
  };
450
- }), Ie = function(s) {
450
+ }), Me = function(s) {
451
451
  U(t, s);
452
452
  function t() {
453
453
  var e = s.call(this) || this;
@@ -458,7 +458,7 @@ var je = function(s) {
458
458
  return r.operator = e, r;
459
459
  }, t.prototype._throwIfClosed = function() {
460
460
  if (this.closed)
461
- throw new qe();
461
+ throw new je();
462
462
  }, t.prototype.next = function(e) {
463
463
  var r = this;
464
464
  O(function() {
@@ -466,7 +466,7 @@ var je = function(s) {
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()) {
469
+ for (var o = G(r.currentObservers), a = o.next(); !a.done; a = o.next()) {
470
470
  var c = a.value;
471
471
  c.next(e);
472
472
  }
@@ -516,18 +516,18 @@ var je = function(s) {
516
516
  }, t.prototype._innerSubscribe = function(e) {
517
517
  var r = this, n = this, i = n.hasError, o = n.isStopped, a = n.observers;
518
518
  return i || o ? ve : (this.currentObservers = null, a.push(e), new x(function() {
519
- r.currentObservers = null, D(a, e);
519
+ r.currentObservers = null, N(a, e);
520
520
  }));
521
521
  }, t.prototype._checkFinalizedStatuses = function(e) {
522
522
  var r = this, n = r.hasError, i = r.thrownError, o = r.isStopped;
523
523
  n ? e.error(i) : o && e.complete();
524
524
  }, t.prototype.asObservable = function() {
525
- var e = new G();
525
+ var e = new Q();
526
526
  return e.source = this, e;
527
527
  }, t.create = function(e, r) {
528
528
  return new oe(e, r);
529
529
  }, t;
530
- }(G), oe = function(s) {
530
+ }(Q), oe = function(s) {
531
531
  U(t, s);
532
532
  function t(e, r) {
533
533
  var n = s.call(this) || this;
@@ -546,12 +546,12 @@ var je = function(s) {
546
546
  var r, n;
547
547
  return (n = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && n !== void 0 ? n : ve;
548
548
  }, t;
549
- }(Ie), Be = {
549
+ }(Me), Be = {
550
550
  now: function() {
551
551
  return Date.now();
552
552
  },
553
553
  delegate: void 0
554
- }, Qe = function(s) {
554
+ }, Ge = function(s) {
555
555
  U(t, s);
556
556
  function t(e, r) {
557
557
  return s.call(this) || this;
@@ -570,7 +570,7 @@ var je = function(s) {
570
570
  return ((t == null ? void 0 : t.clearInterval) || clearInterval)(s);
571
571
  },
572
572
  delegate: void 0
573
- }, Ge = function(s) {
573
+ }, Qe = function(s) {
574
574
  U(t, s);
575
575
  function t(e, r) {
576
576
  var n = s.call(this, e, r) || this;
@@ -609,10 +609,10 @@ var je = function(s) {
609
609
  }, t.prototype.unsubscribe = function() {
610
610
  if (!this.closed) {
611
611
  var e = this, r = e.id, n = e.scheduler, i = n.actions;
612
- this.work = this.state = this.scheduler = null, this.pending = !1, D(i, this), r != null && (this.id = this.recycleAsyncId(n, r, null)), this.delay = null, s.prototype.unsubscribe.call(this);
612
+ this.work = this.state = this.scheduler = null, this.pending = !1, N(i, this), r != null && (this.id = this.recycleAsyncId(n, r, null)), this.delay = null, s.prototype.unsubscribe.call(this);
613
613
  }
614
614
  }, t;
615
- }(Qe), ce = function() {
615
+ }(Ge), ce = function() {
616
616
  function s(t, e) {
617
617
  e === void 0 && (e = s.now), this.schedulerActionCtor = t, this.now = e;
618
618
  }
@@ -644,9 +644,9 @@ var je = function(s) {
644
644
  throw n;
645
645
  }
646
646
  }, t;
647
- }(ce), ze = new Ye(Ge), Je = ze;
647
+ }(ce), ze = new Ye(Qe), Je = ze;
648
648
  function We(s) {
649
- return s && C(s.schedule);
649
+ return s && S(s.schedule);
650
650
  }
651
651
  var Ke = X(function(s) {
652
652
  return function() {
@@ -656,7 +656,7 @@ var Ke = X(function(s) {
656
656
  function T(s, t) {
657
657
  var e = typeof t == "object";
658
658
  return new Promise(function(r, n) {
659
- var i = new N({
659
+ var i = new D({
660
660
  next: function(o) {
661
661
  r(o), i.unsubscribe();
662
662
  },
@@ -674,7 +674,7 @@ function Xe(s) {
674
674
  function _(s, t) {
675
675
  return Ee(function(e, r) {
676
676
  var n = 0;
677
- e.subscribe(Me(r, function(i) {
677
+ e.subscribe(Ie(r, function(i) {
678
678
  r.next(s.call(t, i, n++));
679
679
  }));
680
680
  });
@@ -682,7 +682,7 @@ function _(s, t) {
682
682
  function Ze(s, t, e) {
683
683
  s === void 0 && (s = 0), e === void 0 && (e = Je);
684
684
  var r = -1;
685
- return t != null && (We(t) ? e = t : r = t), new G(function(n) {
685
+ return t != null && (We(t) ? e = t : r = t), new Q(function(n) {
686
686
  var i = Xe(s) ? +s - e.now() : s;
687
687
  i < 0 && (i = 0);
688
688
  var o = 0;
@@ -692,12 +692,12 @@ function Ze(s, t, e) {
692
692
  });
693
693
  }
694
694
  function et(s, t, e) {
695
- var r = C(s) || t || e ? { next: s, error: t, complete: e } : s;
695
+ var r = S(s) || t || e ? { next: s, error: t, complete: e } : s;
696
696
  return r ? Ee(function(n, i) {
697
697
  var o;
698
698
  (o = r.subscribe) === null || o === void 0 || o.call(r);
699
699
  var a = !0;
700
- n.subscribe(Me(i, function(c) {
700
+ n.subscribe(Ie(i, function(c) {
701
701
  var l;
702
702
  (l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
703
703
  }, function() {
@@ -710,12 +710,12 @@ function et(s, t, e) {
710
710
  var c, l;
711
711
  a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);
712
712
  }));
713
- }) : Ce;
713
+ }) : Se;
714
714
  }
715
- var tt = Object.defineProperty, rt = (s, t, e) => t in s ? tt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, I = (s, t, e) => (rt(s, typeof t != "symbol" ? t + "" : t, e), e);
716
- class d extends Error {
715
+ var tt = Object.defineProperty, rt = (s, t, e) => t in s ? tt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, M = (s, t, e) => (rt(s, typeof t != "symbol" ? t + "" : t, e), e);
716
+ class h extends Error {
717
717
  constructor(t) {
718
- super(`Incorrect context (${t}). Cannot perform the requested operation.`), I(this, "context"), this.context = t;
718
+ super(`Incorrect context (${t}). Cannot perform the requested operation.`), M(this, "context"), this.context = t;
719
719
  }
720
720
  }
721
721
  class m extends Error {
@@ -730,7 +730,7 @@ class ae extends Error {
730
730
  ), this.streamId = t, this.expectedStreamId = e;
731
731
  }
732
732
  }
733
- class st extends Error {
733
+ class nt extends Error {
734
734
  constructor(t) {
735
735
  super(`Invalid version format: ${t}`);
736
736
  }
@@ -749,12 +749,12 @@ class ue extends Error {
749
749
  function E(s) {
750
750
  return typeof s == "function";
751
751
  }
752
- function nt(s) {
752
+ function st(s) {
753
753
  return E(s == null ? void 0 : s.lift);
754
754
  }
755
755
  function R(s) {
756
756
  return function(t) {
757
- if (nt(t))
757
+ if (st(t))
758
758
  return t.lift(function(e) {
759
759
  try {
760
760
  return s(e, this);
@@ -826,7 +826,7 @@ function it(s) {
826
826
  }, e = s(t);
827
827
  return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
828
828
  }
829
- var j = it(function(s) {
829
+ var q = it(function(s) {
830
830
  return function(t) {
831
831
  s(this), this.message = t ? t.length + ` errors occurred during unsubscription:
832
832
  ` + t.map(function(e, r) {
@@ -869,12 +869,12 @@ var te = function() {
869
869
  }
870
870
  else
871
871
  o.remove(this);
872
- var h = this.initialTeardown;
873
- if (E(h))
872
+ var d = this.initialTeardown;
873
+ if (E(d))
874
874
  try {
875
- h();
875
+ d();
876
876
  } catch (v) {
877
- i = v instanceof j ? v.errors : [v];
877
+ i = v instanceof q ? v.errors : [v];
878
878
  }
879
879
  var u = this._finalizers;
880
880
  if (u) {
@@ -885,7 +885,7 @@ var te = function() {
885
885
  try {
886
886
  pe(F);
887
887
  } catch (v) {
888
- i = i ?? [], v instanceof j ? i = W(W([], J(i)), J(v.errors)) : i.push(v);
888
+ i = i ?? [], v instanceof q ? i = W(W([], J(i)), J(v.errors)) : i.push(v);
889
889
  }
890
890
  }
891
891
  } catch (v) {
@@ -900,7 +900,7 @@ var te = function() {
900
900
  }
901
901
  }
902
902
  if (i)
903
- throw new j(i);
903
+ throw new q(i);
904
904
  }
905
905
  }, s.prototype.add = function(t) {
906
906
  var e;
@@ -998,7 +998,7 @@ var re = function(s) {
998
998
  }
999
999
  }, t;
1000
1000
  }(te), lt = Function.prototype.bind;
1001
- function q(s, t) {
1001
+ function j(s, t) {
1002
1002
  return lt.call(s, t);
1003
1003
  }
1004
1004
  var ut = function() {
@@ -1047,9 +1047,9 @@ var ut = function() {
1047
1047
  i && Te.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
1048
1048
  return i.unsubscribe();
1049
1049
  }, o = {
1050
- next: e.next && q(e.next, a),
1051
- error: e.error && q(e.error, a),
1052
- complete: e.complete && q(e.complete, a)
1050
+ next: e.next && j(e.next, a),
1051
+ error: e.error && j(e.error, a),
1052
+ complete: e.complete && j(e.complete, a)
1053
1053
  }) : o = e;
1054
1054
  }
1055
1055
  return i.destination = new ut(o), i;
@@ -1150,7 +1150,7 @@ function yt(s) {
1150
1150
  function mt(s) {
1151
1151
  return s && s instanceof re || yt(s) && Ue(s);
1152
1152
  }
1153
- function P(s, t, e, r, n) {
1153
+ function A(s, t, e, r, n) {
1154
1154
  return new vt(s, t, e, r, n);
1155
1155
  }
1156
1156
  var vt = function(s) {
@@ -1160,14 +1160,14 @@ var vt = function(s) {
1160
1160
  return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
1161
1161
  try {
1162
1162
  r(l);
1163
- } catch (h) {
1164
- e.error(h);
1163
+ } catch (d) {
1164
+ e.error(d);
1165
1165
  }
1166
1166
  } : s.prototype._next, c._error = i ? function(l) {
1167
1167
  try {
1168
1168
  i(l);
1169
- } catch (h) {
1170
- e.error(h);
1169
+ } catch (d) {
1170
+ e.error(d);
1171
1171
  } finally {
1172
1172
  this.unsubscribe();
1173
1173
  }
@@ -1192,7 +1192,7 @@ var vt = function(s) {
1192
1192
  function f(s, t) {
1193
1193
  return R(function(e, r) {
1194
1194
  var n = 0;
1195
- e.subscribe(P(r, function(i) {
1195
+ e.subscribe(A(r, function(i) {
1196
1196
  r.next(s.call(t, i, n++));
1197
1197
  }));
1198
1198
  });
@@ -1205,7 +1205,7 @@ function w(s) {
1205
1205
  return bt;
1206
1206
  } : R(function(t, e) {
1207
1207
  var r = 0;
1208
- t.subscribe(P(e, function(n) {
1208
+ t.subscribe(A(e, function(n) {
1209
1209
  ++r <= s && (e.next(n), s <= r && e.complete());
1210
1210
  }));
1211
1211
  });
@@ -1213,7 +1213,7 @@ function w(s) {
1213
1213
  function y(s, t) {
1214
1214
  return R(function(e, r) {
1215
1215
  var n = 0;
1216
- e.subscribe(P(r, function(i) {
1216
+ e.subscribe(A(r, function(i) {
1217
1217
  return s.call(t, i, n++) && r.next(i);
1218
1218
  }));
1219
1219
  });
@@ -1221,7 +1221,7 @@ function y(s, t) {
1221
1221
  function wt(s, t) {
1222
1222
  return t === void 0 && (t = !1), R(function(e, r) {
1223
1223
  var n = 0;
1224
- e.subscribe(P(r, function(i) {
1224
+ e.subscribe(A(r, function(i) {
1225
1225
  var o = s(i, n++);
1226
1226
  (o || t) && r.next(i), !o && r.complete();
1227
1227
  }));
@@ -1233,7 +1233,7 @@ function g(s, t, e) {
1233
1233
  var o;
1234
1234
  (o = r.subscribe) === null || o === void 0 || o.call(r);
1235
1235
  var a = !0;
1236
- n.subscribe(P(i, function(c) {
1236
+ n.subscribe(A(i, function(c) {
1237
1237
  var l;
1238
1238
  (l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
1239
1239
  }, function() {
@@ -1248,17 +1248,17 @@ function g(s, t, e) {
1248
1248
  }));
1249
1249
  }) : xe;
1250
1250
  }
1251
- const St = /^(\d+)\.(\d+)$/;
1252
- function Ct(s) {
1251
+ const Ct = /^(\d+)\.(\d+)$/;
1252
+ function St(s) {
1253
1253
  if (typeof s == "string") {
1254
- const t = s.match(St);
1254
+ const t = s.match(Ct);
1255
1255
  if (t)
1256
1256
  return `${t[1]}.${t[2]}`;
1257
1257
  }
1258
- throw new st(s);
1258
+ throw new nt(s);
1259
1259
  }
1260
1260
  function ye(s) {
1261
- const t = Ct(s), [e, r] = t.split("."), [n, i] = [parseInt(e), parseInt(r)];
1261
+ const t = St(s), [e, r] = t.split("."), [n, i] = [parseInt(e), parseInt(r)];
1262
1262
  return [n, i];
1263
1263
  }
1264
1264
  function Re(s, t) {
@@ -1269,7 +1269,7 @@ function Et(s, t) {
1269
1269
  return Re(s, t) >= 0;
1270
1270
  }
1271
1271
  const me = "2.0";
1272
- class Mt {
1272
+ class It {
1273
1273
  /**
1274
1274
  * Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.
1275
1275
  *
@@ -1280,7 +1280,7 @@ class Mt {
1280
1280
  * @param logService - An instance of a logging service or utility
1281
1281
  */
1282
1282
  constructor(t, e) {
1283
- if (I(this, "negotiatedProtocolVersion"), I(this, "currentContext"), I(this, "incomingMessages$"), I(this, "inIframe", !1), I(this, "embeddedResult"), I(this, "iframePort1"), I(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new Ie(), this.supportedVersions = t.filter((r) => Et(r, me)), !this.supportedVersions.length)
1283
+ if (M(this, "negotiatedProtocolVersion"), M(this, "currentContext"), M(this, "incomingMessages$"), M(this, "inIframe", !1), M(this, "embeddedResult"), M(this, "iframePort1"), M(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new Me(), this.supportedVersions = t.filter((r) => Et(r, me)), !this.supportedVersions.length)
1284
1284
  throw new ue(t, me);
1285
1285
  this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
1286
1286
  }
@@ -1330,7 +1330,7 @@ class Mt {
1330
1330
  */
1331
1331
  openBridge() {
1332
1332
  if (!this.isEmbedded())
1333
- throw new d(this.currentContext);
1333
+ throw new h(this.currentContext);
1334
1334
  const t = "HELLO", e = this.createMessage(t);
1335
1335
  e.protocolVersions = this.supportedVersions, this.logCreated(t, e);
1336
1336
  const r = this.incomingMessages$.pipe(
@@ -1362,7 +1362,7 @@ class Mt {
1362
1362
  */
1363
1363
  requestSSOToken() {
1364
1364
  if (!this.isEmbedded())
1365
- throw new d(this.currentContext);
1365
+ throw new h(this.currentContext);
1366
1366
  const t = "TOKEN", e = this.createMessage(t);
1367
1367
  this.logCreated(t, e);
1368
1368
  const r = this.incomingMessages$.pipe(
@@ -1388,7 +1388,7 @@ class Mt {
1388
1388
  */
1389
1389
  sendJoiningRoomMessage(t) {
1390
1390
  if (!this.isEmbedded())
1391
- throw new d(this.currentContext);
1391
+ throw new h(this.currentContext);
1392
1392
  const {
1393
1393
  roomName: e,
1394
1394
  roomInvite: r,
@@ -1398,8 +1398,8 @@ class Mt {
1398
1398
  region: a,
1399
1399
  joinMicMuted: c,
1400
1400
  joinWithoutCamera: l
1401
- } = t, h = "JOINING ROOM", u = this.createMessage(h, !1);
1402
- u.roomName = e, u.jwtToken = i, u.serverUrl = o, u.region = a, u.roomInvite = r, u.joinMicMuted = c ?? !1, u.joinWithoutCamera = l ?? !1, u.displayName = n, this.logCreated(h, u), this.port2.postMessage(u), this.logSent(h, u);
1401
+ } = t, d = "JOINING ROOM", u = this.createMessage(d, !1);
1402
+ u.roomName = e, u.jwtToken = i, u.serverUrl = o, u.region = a, u.roomInvite = r, u.joinMicMuted = c ?? !1, u.joinWithoutCamera = l ?? !1, u.displayName = n, this.logCreated(d, u), this.port2.postMessage(u), this.logSent(d, u);
1403
1403
  }
1404
1404
  /**
1405
1405
  * Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
@@ -1414,7 +1414,7 @@ class Mt {
1414
1414
  */
1415
1415
  sendLeavingRoomMessage(t) {
1416
1416
  if (!this.isEmbedded())
1417
- throw new d(this.currentContext);
1417
+ throw new h(this.currentContext);
1418
1418
  const e = "LEAVING ROOM", r = this.createMessage(e, !1);
1419
1419
  r.roomName = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
1420
1420
  }
@@ -1446,7 +1446,7 @@ class Mt {
1446
1446
  */
1447
1447
  onJoinRoomMessage() {
1448
1448
  if (!this.isEmbedded())
1449
- throw new d(this.currentContext);
1449
+ throw new h(this.currentContext);
1450
1450
  const t = "JOIN ROOM";
1451
1451
  return this.incomingMessages$.pipe(
1452
1452
  y((e) => e.type === t && e.target === "client"),
@@ -1482,7 +1482,7 @@ class Mt {
1482
1482
  */
1483
1483
  onLeaveRoomMessage() {
1484
1484
  if (!this.isEmbedded())
1485
- throw new d(this.currentContext);
1485
+ throw new h(this.currentContext);
1486
1486
  const t = "LEAVE ROOM";
1487
1487
  return this.incomingMessages$.pipe(
1488
1488
  y((e) => e.type === t && e.target === "client"),
@@ -1519,7 +1519,7 @@ class Mt {
1519
1519
  */
1520
1520
  onConfigMessage() {
1521
1521
  if (!this.isEmbedded())
1522
- throw new d(this.currentContext);
1522
+ throw new h(this.currentContext);
1523
1523
  const t = "CONFIG";
1524
1524
  return this.incomingMessages$.pipe(
1525
1525
  y((e) => e.type === t && e.target === "client"),
@@ -1542,7 +1542,7 @@ class Mt {
1542
1542
  }
1543
1543
  sendScreenshareSourceMessage(t) {
1544
1544
  if (!this.isEmbedded())
1545
- throw new d(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 n = this.incomingMessages$.pipe(
@@ -1556,7 +1556,7 @@ class Mt {
1556
1556
  }
1557
1557
  layoutChange(t, e, r) {
1558
1558
  if (!this.isEmbedded())
1559
- throw new d(this.currentContext);
1559
+ throw new h(this.currentContext);
1560
1560
  const n = "LAYOUT CHANGE";
1561
1561
  let i, o;
1562
1562
  if (e && r ? (i = this.createMessage(n, !1, r), i.result = e) : (i = this.createMessage(n), o = this.incomingMessages$.pipe(
@@ -1601,7 +1601,7 @@ class Mt {
1601
1601
  */
1602
1602
  onLayoutChangeMessage() {
1603
1603
  if (!this.isEmbedded())
1604
- throw new d(this.currentContext);
1604
+ throw new h(this.currentContext);
1605
1605
  const t = "LAYOUT CHANGE";
1606
1606
  return this.incomingMessages$.pipe(
1607
1607
  y((e) => e.type === t && e.target === "client" && e.replyTo === null),
@@ -1612,7 +1612,7 @@ class Mt {
1612
1612
  }
1613
1613
  requestOAuthToken(t) {
1614
1614
  if (!this.isEmbedded())
1615
- throw new d(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);
@@ -1626,13 +1626,13 @@ class Mt {
1626
1626
  }
1627
1627
  openUrl(t, e) {
1628
1628
  if (!this.isEmbedded())
1629
- throw new d(this.currentContext);
1629
+ throw new h(this.currentContext);
1630
1630
  const r = "OPEN URL", n = this.createMessage(r, !1);
1631
1631
  n.url = t, n.data = e, this.logCreated(r, n), this.port2.postMessage(n), this.logSent(r, n);
1632
1632
  }
1633
1633
  selectContacts(t, e, r, n) {
1634
1634
  if (!this.isEmbedded())
1635
- throw new d(this.currentContext);
1635
+ throw new h(this.currentContext);
1636
1636
  if (this.negotiatedProtocolVersion === "2.0") {
1637
1637
  if (e === void 0 || typeof e == "object")
1638
1638
  throw new m(
@@ -1665,7 +1665,7 @@ class Mt {
1665
1665
  }
1666
1666
  selectContactsV2_0(t, e, r, n) {
1667
1667
  if (!this.isEmbedded())
1668
- throw new d(this.currentContext);
1668
+ throw new h(this.currentContext);
1669
1669
  n && n.length > 0 && (n = n.map((c) => c.type === "cloudUsername" && c.contactUser ? {
1670
1670
  ...c,
1671
1671
  cloudId: c.cloudId || c.contactUser.cloudId,
@@ -1692,7 +1692,7 @@ class Mt {
1692
1692
  }
1693
1693
  selectContactsV2_1(t, e, r) {
1694
1694
  if (!this.isEmbedded())
1695
- throw new d(this.currentContext);
1695
+ throw new h(this.currentContext);
1696
1696
  const n = {
1697
1697
  allowMultipleSelection: (e == null ? void 0 : e.allowMultipleSelection) ?? !1,
1698
1698
  filterToSelectedType: (e == null ? void 0 : e.filterToSelectedType) ?? !1,
@@ -1751,11 +1751,11 @@ class Mt {
1751
1751
  if (l.result === "success") {
1752
1752
  if (l.streamId !== t)
1753
1753
  throw new ae(l.streamId, t);
1754
- const h = l.contacts.length;
1754
+ const d = l.contacts.length;
1755
1755
  if (l.contacts = l.contacts.filter(
1756
1756
  (u) => n.resultTypes.includes(u.type)
1757
- ), l.contacts.length !== h && this.logService.debug(
1758
- `[IPC] [SelectContactsReply] Filtered ${h - l.contacts.length} contacts from reply`
1757
+ ), l.contacts.length !== d && this.logService.debug(
1758
+ `[IPC] [SelectContactsReply] Filtered ${d - l.contacts.length} contacts from reply`
1759
1759
  ), !n.allowMultipleSelection && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]), n.filterToSelectedType && l.contacts.length > 1) {
1760
1760
  const u = l.contacts[0].type;
1761
1761
  if (l.contacts.some(
@@ -1791,7 +1791,7 @@ class Mt {
1791
1791
  }
1792
1792
  matchContacts(t) {
1793
1793
  if (!this.isEmbedded())
1794
- throw new d(this.currentContext);
1794
+ throw new h(this.currentContext);
1795
1795
  if (!Array.isArray(t))
1796
1796
  throw new m("contacts", t, "contacts is not an array");
1797
1797
  if (!t.length)
@@ -1915,7 +1915,7 @@ class Mt {
1915
1915
  */
1916
1916
  onPushMessageMessage() {
1917
1917
  if (!this.isEmbedded())
1918
- throw new d(this.currentContext);
1918
+ throw new h(this.currentContext);
1919
1919
  const t = "PUSH MESSAGE";
1920
1920
  return this.incomingMessages$.pipe(
1921
1921
  y((e) => e.type === t && e.target === "client"),
@@ -1923,6 +1923,48 @@ class Mt {
1923
1923
  g(this.logReceived())
1924
1924
  );
1925
1925
  }
1926
+ /**
1927
+ * Setup listener for {@link DirectChannelCreateAndNavigateMessage}, which can be sent by a Host app to
1928
+ * instruct the Client to create (if needed) and navigate to a direct channel.
1929
+ *
1930
+ * @remarks
1931
+ * The Host app does not expect a reply to this message.
1932
+ *
1933
+ * @returns An observable that emits whenever {@link DirectChannelCreateAndNavigateMessage} is received so it
1934
+ * can be subscribed to indefinitely.
1935
+ */
1936
+ onDirectChannelCreateAndNavigateMessage() {
1937
+ if (!this.isEmbedded())
1938
+ throw new h(this.currentContext);
1939
+ const t = "DIRECT CHANNEL CREATE AND NAVIGATE";
1940
+ return this.incomingMessages$.pipe(
1941
+ y(
1942
+ (e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
1943
+ ),
1944
+ g(this.logReceived())
1945
+ );
1946
+ }
1947
+ /**
1948
+ * Setup listener for {@link NavigateToRouteMessage}, which can be sent by a Host app to instruct the
1949
+ * Client application to navigate to a specific in-app route.
1950
+ *
1951
+ * @remarks
1952
+ * The Host app does not expect a reply to this message.
1953
+ *
1954
+ * @returns An observable that emits whenever {@link NavigateToRouteMessage} is received so it can be
1955
+ * subscribed to indefinitely.
1956
+ */
1957
+ onNavigateToRouteMessage() {
1958
+ if (!this.isEmbedded())
1959
+ throw new h(this.currentContext);
1960
+ const t = "NAVIGATE TO ROUTE";
1961
+ return this.incomingMessages$.pipe(
1962
+ y(
1963
+ (e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
1964
+ ),
1965
+ g(this.logReceived())
1966
+ );
1967
+ }
1926
1968
  /**
1927
1969
  * Sends a {@link PushTokenMessage} to the Host app, to request the Push Token for the current
1928
1970
  * device.
@@ -1934,7 +1976,7 @@ class Mt {
1934
1976
  */
1935
1977
  requestPushToken() {
1936
1978
  if (!this.isEmbedded())
1937
- throw new d(this.currentContext);
1979
+ throw new h(this.currentContext);
1938
1980
  const t = "PUSH TOKEN", e = this.createMessage(t);
1939
1981
  this.logCreated(t, e);
1940
1982
  const r = this.incomingMessages$.pipe(
@@ -1974,7 +2016,7 @@ class Mt {
1974
2016
  */
1975
2017
  onPushTokenMessage() {
1976
2018
  if (!this.isEmbedded())
1977
- throw new d(this.currentContext);
2019
+ throw new h(this.currentContext);
1978
2020
  const t = "PUSH TOKEN";
1979
2021
  return this.incomingMessages$.pipe(
1980
2022
  y(
@@ -1989,6 +2031,66 @@ class Mt {
1989
2031
  g(this.logReceived())
1990
2032
  );
1991
2033
  }
2034
+ /**
2035
+ * Request current call information from the `Host` app.
2036
+ *
2037
+ * @remarks
2038
+ * The Host app should reply with a {@link CallInfoMessageReply} containing the current call
2039
+ * information.
2040
+ *
2041
+ * @returns Observable with a {@link CallInfoMessageReply} instance containing the call info.
2042
+ */
2043
+ requestCallInfo() {
2044
+ if (!this.isEmbedded())
2045
+ throw new h(this.currentContext);
2046
+ const t = "CALL INFO", e = this.createMessage(t);
2047
+ this.logCreated(t, e);
2048
+ const r = this.incomingMessages$.pipe(
2049
+ y((n) => n.type === t && n.replyTo === e.id),
2050
+ g(this.logReceived()),
2051
+ f((n) => n),
2052
+ w(1)
2053
+ );
2054
+ return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
2055
+ }
2056
+ /**
2057
+ * Setup a listener for {@link CallInfoMessageReply}, which can be sent by a Host app to notify
2058
+ * of call information changes.
2059
+ *
2060
+ * @remarks
2061
+ * The Host app should send this message whenever call properties change. The Client app can
2062
+ * use this to update its call state accordingly.
2063
+ *
2064
+ * The Host app does not expect a reply to this message.
2065
+ *
2066
+ * @example
2067
+ * Here is an example of how a listener can be setup:
2068
+ *
2069
+ * ```ts
2070
+ * const ipcHelper = new IpcHelper(['2.0'], console);
2071
+ *
2072
+ * const callInfoSubscription = ipcHelper.onCallInfoMessage().subscribe((msg) => {
2073
+ * // your logic for handling call info updates goes here
2074
+ * });
2075
+ *
2076
+ * // don't forget to unsubscribe when you're cleaning up
2077
+ * callInfoSubscription.unsubscribe();
2078
+ * ```
2079
+ *
2080
+ * @returns An observable that emits whenever {@link CallInfoMessageReply} is received so it can
2081
+ * be subscribed to indefinitely.
2082
+ */
2083
+ onCallInfoMessage() {
2084
+ if (!this.isEmbedded())
2085
+ throw new h(this.currentContext);
2086
+ const t = "CALL INFO";
2087
+ return this.incomingMessages$.pipe(
2088
+ y(
2089
+ (e) => e.type === t && e.target === "client" && e.replyTo === null
2090
+ ),
2091
+ g(this.logReceived())
2092
+ );
2093
+ }
1992
2094
  /**
1993
2095
  * Setup listener for {@link BadgeQueryMessage}, which can be sent by a `Host` app to request the
1994
2096
  * current badge counter from the `Client` app.
@@ -1998,7 +2100,7 @@ class Mt {
1998
2100
  */
1999
2101
  onBadgeQueryMessage() {
2000
2102
  if (!this.isEmbedded())
2001
- throw new d(this.currentContext);
2103
+ throw new h(this.currentContext);
2002
2104
  const t = "BADGE QUERY";
2003
2105
  return this.incomingMessages$.pipe(
2004
2106
  y((e) => e.type === t && e.target === "client"),
@@ -2020,7 +2122,7 @@ class Mt {
2020
2122
  */
2021
2123
  sendBadgeUpdateMessage(t, e, r) {
2022
2124
  if (!this.isEmbedded())
2023
- throw new d(this.currentContext);
2125
+ throw new h(this.currentContext);
2024
2126
  const n = "BADGE UPDATE", i = this.createMessage(n, !1, r);
2025
2127
  i.count = t, i.activity = e ?? !1, this.logCreated(n, i), this.port2.postMessage(i), this.logSent(n, i);
2026
2128
  }
@@ -2039,7 +2141,7 @@ class Mt {
2039
2141
  */
2040
2142
  sendLifecycleMessage(t, e) {
2041
2143
  if (!this.isEmbedded())
2042
- throw new d(this.currentContext);
2144
+ throw new h(this.currentContext);
2043
2145
  const r = "LIFECYCLE", n = this.createMessage(r, !1);
2044
2146
  n.eventName = t, n.payload = e, this.logCreated(r, n), this.port2.postMessage(n), this.logSent(r, n);
2045
2147
  }
@@ -2056,7 +2158,7 @@ class Mt {
2056
2158
  */
2057
2159
  onLifecycleMessage() {
2058
2160
  if (!this.isEmbedded())
2059
- throw new d(this.currentContext);
2161
+ throw new h(this.currentContext);
2060
2162
  const t = "LIFECYCLE";
2061
2163
  return this.incomingMessages$.pipe(
2062
2164
  y((e) => e.type === t && e.target === "client"),
@@ -2078,7 +2180,7 @@ class Mt {
2078
2180
  */
2079
2181
  sendLogMessage(t, e) {
2080
2182
  if (!this.isEmbedded())
2081
- throw new d(this.currentContext);
2183
+ throw new h(this.currentContext);
2082
2184
  const r = "LOG", n = this.createMessage(r, !1);
2083
2185
  n.level = t, n.message = e, this.logCreated(r, n), this.port2.postMessage(n), this.logSent(r, n);
2084
2186
  }
@@ -2096,7 +2198,7 @@ class Mt {
2096
2198
  */
2097
2199
  onRequestLogsMessage() {
2098
2200
  if (!this.isEmbedded())
2099
- throw new d(this.currentContext);
2201
+ throw new h(this.currentContext);
2100
2202
  const t = "REQUEST LOGS";
2101
2203
  return this.incomingMessages$.pipe(
2102
2204
  y((e) => e.type === t && e.target === "client"),
@@ -2116,7 +2218,7 @@ class Mt {
2116
2218
  */
2117
2219
  sendRequestLogsMessageReply(t, e, r, n, i) {
2118
2220
  if (!this.isEmbedded())
2119
- throw new d(this.currentContext);
2221
+ throw new h(this.currentContext);
2120
2222
  const o = "REQUEST LOGS", a = this.createMessage(o, !1, i);
2121
2223
  a.fileId = t, a.fileHash = e, a.fileSize = r, a.format = n, this.logCreated(o, a), this.port2.postMessage(a), this.logSent(o, a);
2122
2224
  }
@@ -2135,7 +2237,7 @@ class Mt {
2135
2237
  */
2136
2238
  sendViewTransitionMessage(t, e) {
2137
2239
  if (!this.isEmbedded())
2138
- throw new d(this.currentContext);
2240
+ throw new h(this.currentContext);
2139
2241
  const r = "VIEW TRANSITION", n = this.createMessage(r, !1);
2140
2242
  n.transitionType = t, n.targetView = e, this.logCreated(r, n), this.port2.postMessage(n), this.logSent(r, n);
2141
2243
  }
@@ -2182,7 +2284,7 @@ class Mt {
2182
2284
  */
2183
2285
  sendFileRequestMessage(t, e, r, n, i) {
2184
2286
  if (!this.isEmbedded())
2185
- throw new d(this.currentContext);
2287
+ throw new h(this.currentContext);
2186
2288
  const o = "FILE REQUEST", a = this.createMessage(o);
2187
2289
  if (a.fileId = t, a.fileHash = e.toLowerCase(), a.intent = r, a.maxChunkSizeInBytes = i, r === "attachment") {
2188
2290
  if (!n)
@@ -2197,12 +2299,12 @@ class Mt {
2197
2299
  let c = 0;
2198
2300
  const l = this.incomingMessages$.pipe(
2199
2301
  y(
2200
- (h) => h.type === o && h.replyTo === a.id
2302
+ (d) => d.type === o && d.replyTo === a.id
2201
2303
  ),
2202
2304
  g(this.logReceived()),
2203
2305
  g(() => c++),
2204
- f((h) => (h.result === "success" && (h.chunkHash = h.chunkHash.toLowerCase(), h.fileHash = h.fileHash.toLowerCase()), h)),
2205
- wt((h) => h.result === "success" && c < h.totalChunks, !0)
2306
+ f((d) => (d.result === "success" && (d.chunkHash = d.chunkHash.toLowerCase(), d.fileHash = d.fileHash.toLowerCase()), d)),
2307
+ wt((d) => d.result === "success" && c < d.totalChunks, !0)
2206
2308
  );
2207
2309
  return this.port2.postMessage(a), this.logSent(o, a), l;
2208
2310
  }
@@ -2227,7 +2329,7 @@ class Mt {
2227
2329
  */
2228
2330
  sendFileRequestMessageReply(t, e) {
2229
2331
  if (!this.isEmbedded())
2230
- throw new d(this.currentContext);
2332
+ throw new h(this.currentContext);
2231
2333
  const r = "FILE REQUEST", n = Object.assign(
2232
2334
  e,
2233
2335
  this.createMessage(r, !1, t.id)
@@ -2248,7 +2350,7 @@ class Mt {
2248
2350
  */
2249
2351
  onFileRequestMessage() {
2250
2352
  if (!this.isEmbedded())
2251
- throw new d(this.currentContext);
2353
+ throw new h(this.currentContext);
2252
2354
  const t = "FILE REQUEST";
2253
2355
  return this.incomingMessages$.pipe(
2254
2356
  y(
@@ -2282,7 +2384,7 @@ class Mt {
2282
2384
  */
2283
2385
  sendFileSelectionMessage(t = "attachment", e, r, n, i, o) {
2284
2386
  if (!this.isEmbedded())
2285
- throw new d(this.currentContext);
2387
+ throw new h(this.currentContext);
2286
2388
  const a = "FILE SELECTION", c = this.createMessage(a);
2287
2389
  if (c.intent = t, c.maxCount = n, c.maxFileSizeInBytes = i, c.mimeTypes = o, t === "attachment") {
2288
2390
  if (!e)
@@ -2302,11 +2404,11 @@ class Mt {
2302
2404
  this.logCreated(a, c);
2303
2405
  const l = this.incomingMessages$.pipe(
2304
2406
  y(
2305
- (h) => h.type === a && h.replyTo === c.id
2407
+ (d) => d.type === a && d.replyTo === c.id
2306
2408
  ),
2307
- f((h) => {
2409
+ f((d) => {
2308
2410
  var u;
2309
- return h.result === "success" && (h.files = (u = h.files) == null ? void 0 : u.map((b) => (b.original.fileHash = b.original.fileHash.toLowerCase(), b.preview && (b.preview.fileHash = b.preview.fileHash.toLowerCase()), b))), h;
2411
+ return d.result === "success" && (d.files = (u = d.files) == null ? void 0 : u.map((b) => (b.original.fileHash = b.original.fileHash.toLowerCase(), b.preview && (b.preview.fileHash = b.preview.fileHash.toLowerCase()), b))), d;
2310
2412
  }),
2311
2413
  g(this.logReceived()),
2312
2414
  w(1)
@@ -2334,7 +2436,7 @@ class Mt {
2334
2436
  */
2335
2437
  sendFileDownloadProgressQueryMessage(t, e, r) {
2336
2438
  if (!this.isEmbedded())
2337
- throw new d(this.currentContext);
2439
+ throw new h(this.currentContext);
2338
2440
  const n = "FILE DOWNLOAD PROGRESS QUERY", i = this.createMessage(
2339
2441
  n,
2340
2442
  !0
@@ -2359,7 +2461,7 @@ class Mt {
2359
2461
  */
2360
2462
  onFileDownloadProgressUpdateMessage() {
2361
2463
  if (!this.isEmbedded())
2362
- throw new d(this.currentContext);
2464
+ throw new h(this.currentContext);
2363
2465
  const t = "FILE DOWNLOAD PROGRESS UPDATE";
2364
2466
  return this.incomingMessages$.pipe(
2365
2467
  y(
@@ -2385,7 +2487,7 @@ class Mt {
2385
2487
  */
2386
2488
  sendFileUploadProgressQueryMessage(t, e, r) {
2387
2489
  if (!this.isEmbedded())
2388
- throw new d(this.currentContext);
2490
+ throw new h(this.currentContext);
2389
2491
  const n = "FILE UPLOAD PROGRESS QUERY", i = this.createMessage(
2390
2492
  n,
2391
2493
  !0
@@ -2414,7 +2516,7 @@ class Mt {
2414
2516
  */
2415
2517
  onFileUploadProgressUpdateMessage() {
2416
2518
  if (!this.isEmbedded())
2417
- throw new d(this.currentContext);
2519
+ throw new h(this.currentContext);
2418
2520
  const t = "FILE UPLOAD PROGRESS UPDATE";
2419
2521
  return this.incomingMessages$.pipe(
2420
2522
  y(
@@ -2451,7 +2553,7 @@ class Mt {
2451
2553
  */
2452
2554
  sendFileDownloadMessage(t, e, r, n, i, o, a, c, l) {
2453
2555
  if (!this.isEmbedded())
2454
- throw new d(this.currentContext);
2556
+ throw new h(this.currentContext);
2455
2557
  if (c && this.compareVersion("2.1") < 0)
2456
2558
  c.type === "cloudUsername" && c.contactUser && (c = {
2457
2559
  ...c,
@@ -2473,15 +2575,15 @@ class Mt {
2473
2575
  "CloudContact must define cloudUsername, cloudId, and networkId since v2.1"
2474
2576
  );
2475
2577
  }
2476
- const h = "FILE DOWNLOAD", u = this.createMessage(h, !0);
2477
- u.url = t, u.key = e, u.fileHash = r.toLowerCase(), u.mimeType = n, u.fileName = i, u.streamId = o, u.correlationId = a, u.sender = c, u.intent = l ?? "download", this.logCreated(h, u);
2578
+ const d = "FILE DOWNLOAD", u = this.createMessage(d, !0);
2579
+ u.url = t, u.key = e, u.fileHash = r.toLowerCase(), u.mimeType = n, u.fileName = i, u.streamId = o, u.correlationId = a, u.sender = c, u.intent = l ?? "download", this.logCreated(d, u);
2478
2580
  const b = this.incomingMessages$.pipe(
2479
- y((p) => p.type === h && p.replyTo === u.id),
2581
+ y((p) => p.type === d && p.replyTo === u.id),
2480
2582
  g(this.logReceived()),
2481
2583
  f((p) => p),
2482
2584
  w(1)
2483
2585
  );
2484
- return this.port2.postMessage(u), this.logSent(h, u), b;
2586
+ return this.port2.postMessage(u), this.logSent(d, u), b;
2485
2587
  }
2486
2588
  /**
2487
2589
  * Sends a {@link CancelFileDownloadMessage} to the Host app, to cancel downloading of a file
@@ -2493,7 +2595,7 @@ class Mt {
2493
2595
  */
2494
2596
  sendCancelFileDownloadMessage(t, e, r) {
2495
2597
  if (!this.isEmbedded())
2496
- throw new d(this.currentContext);
2598
+ throw new h(this.currentContext);
2497
2599
  const n = "CANCEL FILE DOWNLOAD", i = this.createMessage(n, !1);
2498
2600
  i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(n, i), this.port2.postMessage(i), this.logSent(n, i);
2499
2601
  }
@@ -2514,7 +2616,7 @@ class Mt {
2514
2616
  */
2515
2617
  sendFileRemoveMessage(t, e) {
2516
2618
  if (!this.isEmbedded())
2517
- throw new d(this.currentContext);
2619
+ throw new h(this.currentContext);
2518
2620
  const r = "FILE REMOVE", n = this.createMessage(r, !0);
2519
2621
  n.hash = t.toLowerCase(), n.streamId = e, this.logCreated(r, n);
2520
2622
  const i = this.incomingMessages$.pipe(
@@ -2540,7 +2642,7 @@ class Mt {
2540
2642
  */
2541
2643
  sendAppResetMessage() {
2542
2644
  if (!this.isEmbedded())
2543
- throw new d(this.currentContext);
2645
+ throw new h(this.currentContext);
2544
2646
  const t = "APP RESET", e = this.createMessage(t, !1);
2545
2647
  this.logCreated(t, e), this.port2.postMessage(e), this.logSent(t, e);
2546
2648
  }
@@ -2564,7 +2666,7 @@ class Mt {
2564
2666
  */
2565
2667
  sendMessageSentMessage(t, e) {
2566
2668
  if (!this.isEmbedded())
2567
- throw new d(this.currentContext);
2669
+ throw new h(this.currentContext);
2568
2670
  const r = "MESSAGE SENT", n = this.createMessage(r, !1);
2569
2671
  n.streamId = t, n.correlationId = e, this.logCreated(r, n), this.port2.postMessage(n), this.logSent(r, n);
2570
2672
  }
@@ -2588,8 +2690,8 @@ class Mt {
2588
2690
  */
2589
2691
  sendSendMessageMessage(t, e, r, n = "TEXT", i, o, a, c = !0, l) {
2590
2692
  if (!this.isEmbedded())
2591
- throw new d(this.currentContext);
2592
- const h = "SEND MESSAGE", u = this.createMessage(h, !0);
2693
+ throw new h(this.currentContext);
2694
+ const d = "SEND MESSAGE", u = this.createMessage(d, !0);
2593
2695
  if (u.streamId = t, u.correlationId = e, u.body = r, u.messageType = n, i && i.length > 0)
2594
2696
  if (this.compareVersion("2.1") < 0)
2595
2697
  u.mentions = i.map((p) => p.contactUser ? {
@@ -2617,14 +2719,14 @@ class Mt {
2617
2719
  }
2618
2720
  else
2619
2721
  u.mentions = [];
2620
- u.attachments = (o == null ? void 0 : o.map((p) => p.toLowerCase())) ?? [], u.relatedMessageId = a, u.setCursors = c, u.threadId = l, this.logCreated(h, u);
2722
+ u.attachments = (o == null ? void 0 : o.map((p) => p.toLowerCase())) ?? [], u.relatedMessageId = a, u.setCursors = c, u.threadId = l, this.logCreated(d, u);
2621
2723
  const b = this.incomingMessages$.pipe(
2622
- y((p) => p.type === h && p.replyTo === u.id),
2724
+ y((p) => p.type === d && p.replyTo === u.id),
2623
2725
  g(this.logReceived()),
2624
2726
  f((p) => p),
2625
2727
  w(1)
2626
2728
  );
2627
- return this.port2.postMessage(u), this.logSent(h, u), b;
2729
+ return this.port2.postMessage(u), this.logSent(d, u), b;
2628
2730
  }
2629
2731
  /**
2630
2732
  * Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being
@@ -2637,7 +2739,7 @@ class Mt {
2637
2739
  */
2638
2740
  sendCancelSendMessageMessage(t, e) {
2639
2741
  if (!this.isEmbedded())
2640
- throw new d(this.currentContext);
2742
+ throw new h(this.currentContext);
2641
2743
  const r = "CANCEL SEND MESSAGE", n = this.createMessage(r, !1);
2642
2744
  n.streamId = t, n.correlationId = e, this.logCreated(r, n), this.port2.postMessage(n), this.logSent(r, n);
2643
2745
  }
@@ -2650,7 +2752,7 @@ class Mt {
2650
2752
  */
2651
2753
  sendMessageDeletedMessage(t, e) {
2652
2754
  if (!this.isEmbedded())
2653
- throw new d(this.currentContext);
2755
+ throw new h(this.currentContext);
2654
2756
  const r = "MESSAGE DELETED", n = this.createMessage(r, !1);
2655
2757
  n.correlationId = t, n.streamId = e, this.logCreated(r, n), this.port2.postMessage(n), this.logSent(r, n);
2656
2758
  }
@@ -2669,7 +2771,7 @@ class Mt {
2669
2771
  */
2670
2772
  sendSendMessageStatusQueryMessage(t, e) {
2671
2773
  if (!this.isEmbedded())
2672
- throw new d(this.currentContext);
2774
+ throw new h(this.currentContext);
2673
2775
  const r = "SEND MESSAGE STATUS QUERY", n = this.createMessage(r, !0);
2674
2776
  n.correlationId = t, n.streamId = e, this.logCreated(r, n);
2675
2777
  const i = this.incomingMessages$.pipe(
@@ -2691,7 +2793,7 @@ class Mt {
2691
2793
  */
2692
2794
  onSendMessageStatusUpdateMessage() {
2693
2795
  if (!this.isEmbedded())
2694
- throw new d(this.currentContext);
2796
+ throw new h(this.currentContext);
2695
2797
  const t = "SEND MESSAGE STATUS UPDATE";
2696
2798
  return this.incomingMessages$.pipe(
2697
2799
  y((e) => e.type === t && e.target === "client" && e.replyTo === null),
@@ -2709,7 +2811,7 @@ class Mt {
2709
2811
  */
2710
2812
  sendSipCallMessage(t) {
2711
2813
  if (!this.isEmbedded())
2712
- throw new d(this.currentContext);
2814
+ throw new h(this.currentContext);
2713
2815
  if (this.compareVersion("2.1") < 0)
2714
2816
  t.type === "cloudUsername" && t.contactUser && (t = {
2715
2817
  ...t,
@@ -2736,7 +2838,7 @@ class Mt {
2736
2838
  }
2737
2839
  sendCustomFunctionMessage(t, e) {
2738
2840
  if (!this.isEmbedded())
2739
- throw new d(this.currentContext);
2841
+ throw new h(this.currentContext);
2740
2842
  const r = "CUSTOM FUNCTION", n = this.createMessage(r, !1);
2741
2843
  n.customFunctionId = t, n.context = e, this.logCreated(r, n), this.port2.postMessage(n), this.logSent(r, n);
2742
2844
  }
@@ -2754,7 +2856,7 @@ class Mt {
2754
2856
  */
2755
2857
  sendSubscribeButtonsMessage(t) {
2756
2858
  if (!this.isEmbedded())
2757
- throw new d(this.currentContext);
2859
+ throw new h(this.currentContext);
2758
2860
  const e = "SUBSCRIBE BUTTONS", r = this.createMessage(e, !1);
2759
2861
  r.subscribe = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
2760
2862
  }
@@ -2785,7 +2887,7 @@ class Mt {
2785
2887
  */
2786
2888
  onButtonsMessage() {
2787
2889
  if (!this.isEmbedded())
2788
- throw new d(this.currentContext);
2890
+ throw new h(this.currentContext);
2789
2891
  const t = "BUTTONS";
2790
2892
  return this.incomingMessages$.pipe(
2791
2893
  y((e) => e.type === t && e.target === "client"),
@@ -2838,7 +2940,7 @@ class Mt {
2838
2940
  r
2839
2941
  );
2840
2942
  if (t) {
2841
- It(t) && (t = { ...t, data: "..." }), e(t);
2943
+ Mt(t) && (t = { ...t, data: "..." }), e(t);
2842
2944
  return;
2843
2945
  } else
2844
2946
  return e;
@@ -2882,7 +2984,7 @@ class Mt {
2882
2984
  return n.join("");
2883
2985
  }
2884
2986
  }
2885
- function It(s) {
2987
+ function Mt(s) {
2886
2988
  return s.type === "FILE REQUEST" && s.replyTo !== null;
2887
2989
  }
2888
2990
  const Ut = ["2.0", "2.1"];
@@ -2901,23 +3003,23 @@ class xt {
2901
3003
  /**
2902
3004
  * The type of the `Host` app the `Client` is embedded in.
2903
3005
  */
2904
- M(this, "host");
3006
+ I(this, "host");
2905
3007
  /**
2906
3008
  * The cloud ID of the `Host` app the `Client` is embedded in.
2907
3009
  */
2908
- M(this, "cloudId");
3010
+ I(this, "cloudId");
2909
3011
  /**
2910
3012
  * The cloud username of the logged in user.
2911
3013
  */
2912
- M(this, "cloudUsername");
3014
+ I(this, "cloudUsername");
2913
3015
  /**
2914
3016
  * The display name of the logged in user.
2915
3017
  */
2916
- M(this, "displayName");
2917
- M(this, "logger");
2918
- M(this, "helper");
2919
- M(this, "listeners");
2920
- this.logger = t ?? console, this.helper = new Mt(Ut, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(S.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(S.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(S.PushToken, /* @__PURE__ */ new Set()), this.listeners.set(S.RequestLogs, /* @__PURE__ */ new Set());
3018
+ I(this, "displayName");
3019
+ I(this, "logger");
3020
+ I(this, "helper");
3021
+ I(this, "listeners");
3022
+ this.logger = t ?? console, this.helper = new It(Ut, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(C.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(C.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(C.PushToken, /* @__PURE__ */ new Set()), this.listeners.set(C.RequestLogs, /* @__PURE__ */ new Set());
2921
3023
  }
2922
3024
  /**
2923
3025
  * Returns whether the app is running inside a native WebView (`host` context) or as a
@@ -2959,23 +3061,23 @@ class xt {
2959
3061
  this.helper.onBadgeQueryMessage().subscribe((e) => {
2960
3062
  var r;
2961
3063
  this.logger.debug("Received Badge Query: ", e);
2962
- for (const n of ((r = this.listeners.get(S.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
3064
+ for (const n of ((r = this.listeners.get(C.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
2963
3065
  n();
2964
3066
  }), this.helper.onLifecycleMessage().subscribe((e) => {
2965
3067
  var r;
2966
3068
  this.logger.debug("Received Lifecycle Event: ", e);
2967
- for (const n of ((r = this.listeners.get(S.Lifecycle)) == null ? void 0 : r.values()) ?? [])
3069
+ for (const n of ((r = this.listeners.get(C.Lifecycle)) == null ? void 0 : r.values()) ?? [])
2968
3070
  n(e.eventName, e.payload);
2969
3071
  }), this.helper.onPushTokenMessage().subscribe((e) => {
2970
3072
  var r;
2971
3073
  this.logger.debug("Received Push Token: ", e);
2972
- for (const n of ((r = this.listeners.get(S.PushToken)) == null ? void 0 : r.values()) ?? [])
3074
+ for (const n of ((r = this.listeners.get(C.PushToken)) == null ? void 0 : r.values()) ?? [])
2973
3075
  n(e.pushToken, e.appId, e.selector);
2974
3076
  }), this.helper.onRequestLogsMessage().subscribe((e) => {
2975
3077
  var r;
2976
3078
  if (this.logger.debug("Received Request Logs Message: ", e), e.responseType === "file")
2977
3079
  throw this.logger.error("File response type not supported"), new Error("File response type not supported");
2978
- for (const n of ((r = this.listeners.get(S.RequestLogs)) == null ? void 0 : r.values()) ?? [])
3080
+ for (const n of ((r = this.listeners.get(C.RequestLogs)) == null ? void 0 : r.values()) ?? [])
2979
3081
  n(e.skipCompression);
2980
3082
  }), this.cloudId = t.cloudId, this.cloudUsername = t.cloudUsername, this.displayName = t.displayName, this.host = t.host;
2981
3083
  }),
@@ -3154,9 +3256,9 @@ class xt {
3154
3256
  */
3155
3257
  onBadgeQueryRequest(t) {
3156
3258
  var e;
3157
- return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(S.BadgeQuery)) == null || e.add(t), () => {
3259
+ return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(C.BadgeQuery)) == null || e.add(t), () => {
3158
3260
  var r;
3159
- return (r = this.listeners.get(S.BadgeQuery)) == null ? void 0 : r.delete(t);
3261
+ return (r = this.listeners.get(C.BadgeQuery)) == null ? void 0 : r.delete(t);
3160
3262
  };
3161
3263
  }
3162
3264
  /**
@@ -3173,9 +3275,9 @@ class xt {
3173
3275
  */
3174
3276
  onLifecycleEvent(t) {
3175
3277
  var e;
3176
- return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(S.Lifecycle)) == null || e.add(t), () => {
3278
+ return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(C.Lifecycle)) == null || e.add(t), () => {
3177
3279
  var r;
3178
- return (r = this.listeners.get(S.Lifecycle)) == null ? void 0 : r.delete(t);
3280
+ return (r = this.listeners.get(C.Lifecycle)) == null ? void 0 : r.delete(t);
3179
3281
  };
3180
3282
  }
3181
3283
  /**
@@ -3191,9 +3293,9 @@ class xt {
3191
3293
  */
3192
3294
  onPushToken(t) {
3193
3295
  var e;
3194
- return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(S.PushToken)) == null || e.add(t), () => {
3296
+ return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(C.PushToken)) == null || e.add(t), () => {
3195
3297
  var r;
3196
- return (r = this.listeners.get(S.PushToken)) == null ? void 0 : r.delete(t);
3298
+ return (r = this.listeners.get(C.PushToken)) == null ? void 0 : r.delete(t);
3197
3299
  };
3198
3300
  }
3199
3301
  /**
@@ -3213,9 +3315,9 @@ class xt {
3213
3315
  */
3214
3316
  onRequestLogsMessage(t) {
3215
3317
  var e;
3216
- return this.logger.debug("Registering for Request Logs Message"), (e = this.listeners.get(S.RequestLogs)) == null || e.add(t), () => {
3318
+ return this.logger.debug("Registering for Request Logs Message"), (e = this.listeners.get(C.RequestLogs)) == null || e.add(t), () => {
3217
3319
  var r;
3218
- return (r = this.listeners.get(S.RequestLogs)) == null ? void 0 : r.delete(t);
3320
+ return (r = this.listeners.get(C.RequestLogs)) == null ? void 0 : r.delete(t);
3219
3321
  };
3220
3322
  }
3221
3323
  evaluateContext(t) {
@@ -3226,6 +3328,6 @@ class xt {
3226
3328
  }
3227
3329
  }
3228
3330
  export {
3229
- S as IPCEvents,
3331
+ C as IPCEvents,
3230
3332
  xt as IPCManager
3231
3333
  };