@acrobits/ipc-sdk 0.8.1-alpha.0 → 0.8.1-alpha.2

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,24 +1,24 @@
1
- var Re = Object.defineProperty;
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 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) {
1
+ var Pe = Object.defineProperty;
2
+ var _e = (n, t, e) => t in n ? Pe(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var I = (n, t, e) => (_e(n, typeof t != "symbol" ? t + "" : t, e), e);
4
+ var w = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(w || {}), q = function(n, t) {
5
+ return q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
6
6
  e.__proto__ = r;
7
7
  } || function(e, r) {
8
- for (var i in r)
9
- Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
10
- }, B(n, t);
8
+ for (var s in r)
9
+ Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
10
+ }, q(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
- B(n, t);
15
+ q(n, t);
16
16
  function e() {
17
17
  this.constructor = n;
18
18
  }
19
19
  n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
20
20
  }
21
- function Q(n) {
21
+ function G(n) {
22
22
  var t = typeof Symbol == "function" && Symbol.iterator, e = t && n[t], r = 0;
23
23
  if (e)
24
24
  return e.call(n);
@@ -34,29 +34,29 @@ function $(n, t) {
34
34
  var e = typeof Symbol == "function" && n[Symbol.iterator];
35
35
  if (!e)
36
36
  return n;
37
- var r = e.call(n), i, s = [], o;
37
+ var r = e.call(n), s, i = [], o;
38
38
  try {
39
- for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
40
- s.push(i.value);
41
- } catch (c) {
42
- o = { error: c };
39
+ for (; (t === void 0 || t-- > 0) && !(s = r.next()).done; )
40
+ i.push(s.value);
41
+ } catch (a) {
42
+ o = { error: a };
43
43
  } finally {
44
44
  try {
45
- i && !i.done && (e = r.return) && e.call(r);
45
+ s && !s.done && (e = r.return) && e.call(r);
46
46
  } finally {
47
47
  if (o)
48
48
  throw o.error;
49
49
  }
50
50
  }
51
- return s;
51
+ return i;
52
52
  }
53
- function k(n, t, e) {
53
+ function D(n, t, e) {
54
54
  if (e || arguments.length === 2)
55
- for (var r = 0, i = t.length, s; r < i; r++)
56
- (s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
57
- return n.concat(s || Array.prototype.slice.call(t));
55
+ for (var r = 0, s = t.length, i; r < s; r++)
56
+ (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
57
+ return n.concat(i || Array.prototype.slice.call(t));
58
58
  }
59
- function w(n) {
59
+ function E(n) {
60
60
  return typeof n == "function";
61
61
  }
62
62
  function X(n) {
@@ -68,8 +68,8 @@ function X(n) {
68
68
  var N = X(function(n) {
69
69
  return function(e) {
70
70
  n(this), this.message = e ? e.length + ` errors occurred during unsubscription:
71
- ` + e.map(function(r, i) {
72
- return i + 1 + ") " + r.toString();
71
+ ` + e.map(function(r, s) {
72
+ return s + 1 + ") " + r.toString();
73
73
  }).join(`
74
74
  `) : "", this.name = "UnsubscriptionError", this.errors = e;
75
75
  };
@@ -80,27 +80,27 @@ function F(n, t) {
80
80
  0 <= e && n.splice(e, 1);
81
81
  }
82
82
  }
83
- var T = function() {
83
+ var R = function() {
84
84
  function n(t) {
85
85
  this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
86
86
  }
87
87
  return n.prototype.unsubscribe = function() {
88
- var t, e, r, i, s;
88
+ var t, e, r, s, i;
89
89
  if (!this.closed) {
90
90
  this.closed = !0;
91
91
  var o = this._parentage;
92
92
  if (o)
93
93
  if (this._parentage = null, Array.isArray(o))
94
94
  try {
95
- for (var c = Q(o), a = c.next(); !a.done; a = c.next()) {
96
- var u = a.value;
95
+ for (var a = G(o), c = a.next(); !c.done; c = a.next()) {
96
+ var u = c.value;
97
97
  u.remove(this);
98
98
  }
99
- } catch (g) {
100
- t = { error: g };
99
+ } catch (v) {
100
+ t = { error: v };
101
101
  } finally {
102
102
  try {
103
- a && !a.done && (e = c.return) && e.call(c);
103
+ c && !c.done && (e = a.return) && e.call(a);
104
104
  } finally {
105
105
  if (t)
106
106
  throw t.error;
@@ -109,43 +109,43 @@ var T = function() {
109
109
  else
110
110
  o.remove(this);
111
111
  var l = this.initialTeardown;
112
- if (w(l))
112
+ if (E(l))
113
113
  try {
114
114
  l();
115
- } catch (g) {
116
- s = g instanceof N ? g.errors : [g];
115
+ } catch (v) {
116
+ i = v instanceof N ? v.errors : [v];
117
117
  }
118
118
  var d = this._finalizers;
119
119
  if (d) {
120
120
  this._finalizers = null;
121
121
  try {
122
- for (var y = Q(d), S = y.next(); !S.done; S = y.next()) {
123
- var j = S.value;
122
+ for (var y = G(d), b = y.next(); !b.done; b = y.next()) {
123
+ var k = b.value;
124
124
  try {
125
- ie(j);
126
- } catch (g) {
127
- s = s ?? [], g instanceof N ? s = k(k([], $(s)), $(g.errors)) : s.push(g);
125
+ se(k);
126
+ } catch (v) {
127
+ i = i ?? [], v instanceof N ? i = D(D([], $(i)), $(v.errors)) : i.push(v);
128
128
  }
129
129
  }
130
- } catch (g) {
131
- r = { error: g };
130
+ } catch (v) {
131
+ r = { error: v };
132
132
  } finally {
133
133
  try {
134
- S && !S.done && (i = y.return) && i.call(y);
134
+ b && !b.done && (s = y.return) && s.call(y);
135
135
  } finally {
136
136
  if (r)
137
137
  throw r.error;
138
138
  }
139
139
  }
140
140
  }
141
- if (s)
142
- throw new N(s);
141
+ if (i)
142
+ throw new N(i);
143
143
  }
144
144
  }, n.prototype.add = function(t) {
145
145
  var e;
146
146
  if (t && t !== this)
147
147
  if (this.closed)
148
- ie(t);
148
+ se(t);
149
149
  else {
150
150
  if (t instanceof n) {
151
151
  if (t.closed || t._hasParent(this))
@@ -170,12 +170,12 @@ var T = function() {
170
170
  var t = new n();
171
171
  return t.closed = !0, t;
172
172
  }(), n;
173
- }(), be = T.EMPTY;
173
+ }(), be = R.EMPTY;
174
174
  function me(n) {
175
- return n instanceof T || n && "closed" in n && w(n.remove) && w(n.add) && w(n.unsubscribe);
175
+ return n instanceof R || n && "closed" in n && E(n.remove) && E(n.add) && E(n.unsubscribe);
176
176
  }
177
- function ie(n) {
178
- w(n) ? n() : n.unsubscribe();
177
+ function se(n) {
178
+ E(n) ? n() : n.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
+ }, Ee = {
187
187
  setTimeout: function(n, t) {
188
188
  for (var e = [], r = 2; r < arguments.length; r++)
189
189
  e[r - 2] = arguments[r];
190
- return setTimeout.apply(void 0, k([n, t], $(e)));
190
+ return setTimeout.apply(void 0, D([n, t], $(e)));
191
191
  },
192
192
  clearTimeout: function(n) {
193
- var t = Se.delegate;
193
+ var t = Ee.delegate;
194
194
  return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(n);
195
195
  },
196
196
  delegate: void 0
197
197
  };
198
198
  function Ae(n) {
199
- Se.setTimeout(function() {
199
+ Ee.setTimeout(function() {
200
200
  throw n;
201
201
  });
202
202
  }
203
- function se() {
203
+ function ie() {
204
204
  }
205
205
  function U(n) {
206
206
  n();
@@ -211,8 +211,8 @@ var Z = function(n) {
211
211
  var r = n.call(this) || this;
212
212
  return r.isStopped = !1, e ? (r.destination = e, me(e) && e.add(r)) : r.destination = $e, r;
213
213
  }
214
- return t.create = function(e, r, i) {
215
- return new V(e, r, i);
214
+ return t.create = function(e, r, s) {
215
+ return new H(e, r, s);
216
216
  }, t.prototype.next = function(e) {
217
217
  this.isStopped || this._next(e);
218
218
  }, t.prototype.error = function(e) {
@@ -236,8 +236,8 @@ var Z = function(n) {
236
236
  this.unsubscribe();
237
237
  }
238
238
  }, t;
239
- }(T), Oe = Function.prototype.bind;
240
- function D(n, t) {
239
+ }(R), Oe = Function.prototype.bind;
240
+ function V(n, t) {
241
241
  return Oe.call(n, t);
242
242
  }
243
243
  var Le = function() {
@@ -271,27 +271,27 @@ var Le = function() {
271
271
  A(e);
272
272
  }
273
273
  }, n;
274
- }(), V = function(n) {
274
+ }(), H = function(n) {
275
275
  M(t, n);
276
- function t(e, r, i) {
277
- var s = n.call(this) || this, o;
278
- if (w(e) || !e)
276
+ function t(e, r, s) {
277
+ var i = n.call(this) || this, o;
278
+ if (E(e) || !e)
279
279
  o = {
280
280
  next: e ?? void 0,
281
281
  error: r ?? void 0,
282
- complete: i ?? void 0
282
+ complete: s ?? void 0
283
283
  };
284
284
  else {
285
- var c;
286
- s && we.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
287
- return s.unsubscribe();
285
+ var a;
286
+ i && we.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
287
+ return i.unsubscribe();
288
288
  }, o = {
289
- next: e.next && D(e.next, c),
290
- error: e.error && D(e.error, c),
291
- complete: e.complete && D(e.complete, c)
289
+ next: e.next && V(e.next, a),
290
+ error: e.error && V(e.error, a),
291
+ complete: e.complete && V(e.complete, a)
292
292
  }) : o = e;
293
293
  }
294
- return s.destination = new Le(o), s;
294
+ return i.destination = new Le(o), i;
295
295
  }
296
296
  return t;
297
297
  }(Z);
@@ -303,23 +303,23 @@ function Ue(n) {
303
303
  }
304
304
  var $e = {
305
305
  closed: !0,
306
- next: se,
306
+ next: ie,
307
307
  error: Ue,
308
- complete: se
309
- }, ke = function() {
308
+ complete: ie
309
+ }, De = function() {
310
310
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
311
311
  }();
312
- function Ee(n) {
312
+ function Se(n) {
313
313
  return n;
314
314
  }
315
315
  function Fe(n) {
316
- return n.length === 0 ? Ee : n.length === 1 ? n[0] : function(e) {
317
- return n.reduce(function(r, i) {
318
- return i(r);
316
+ return n.length === 0 ? Se : n.length === 1 ? n[0] : function(e) {
317
+ return n.reduce(function(r, s) {
318
+ return s(r);
319
319
  }, e);
320
320
  };
321
321
  }
322
- var G = function() {
322
+ var B = function() {
323
323
  function n(t) {
324
324
  t && (this._subscribe = t);
325
325
  }
@@ -327,11 +327,11 @@ var G = function() {
327
327
  var e = new n();
328
328
  return e.source = this, e.operator = t, e;
329
329
  }, n.prototype.subscribe = function(t, e, r) {
330
- var i = this, s = je(t) ? t : new V(t, e, r);
330
+ var s = this, i = ke(t) ? t : new H(t, e, r);
331
331
  return U(function() {
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
- }), s;
332
+ var o = s, a = o.operator, c = o.source;
333
+ i.add(a ? a.call(i, c) : c ? s._subscribe(i) : s._trySubscribe(i));
334
+ }), i;
335
335
  }, n.prototype._trySubscribe = function(t) {
336
336
  try {
337
337
  return this._subscribe(t);
@@ -340,24 +340,24 @@ var G = function() {
340
340
  }
341
341
  }, n.prototype.forEach = function(t, e) {
342
342
  var r = this;
343
- return e = oe(e), new e(function(i, s) {
344
- var o = new V({
345
- next: function(c) {
343
+ return e = oe(e), new e(function(s, i) {
344
+ var o = new H({
345
+ next: function(a) {
346
346
  try {
347
- t(c);
348
- } catch (a) {
349
- s(a), o.unsubscribe();
347
+ t(a);
348
+ } catch (c) {
349
+ i(c), o.unsubscribe();
350
350
  }
351
351
  },
352
- error: s,
353
- complete: i
352
+ error: i,
353
+ complete: s
354
354
  });
355
355
  r.subscribe(o);
356
356
  });
357
357
  }, n.prototype._subscribe = function(t) {
358
358
  var e;
359
359
  return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
360
- }, n.prototype[ke] = function() {
360
+ }, n.prototype[De] = function() {
361
361
  return this;
362
362
  }, n.prototype.pipe = function() {
363
363
  for (var t = [], e = 0; e < arguments.length; e++)
@@ -365,14 +365,14 @@ var G = function() {
365
365
  return Fe(t)(this);
366
366
  }, n.prototype.toPromise = function(t) {
367
367
  var e = this;
368
- return t = oe(t), new t(function(r, i) {
369
- var s;
368
+ return t = oe(t), new t(function(r, s) {
369
+ var i;
370
370
  e.subscribe(function(o) {
371
- return s = o;
371
+ return i = o;
372
372
  }, function(o) {
373
- return i(o);
373
+ return s(o);
374
374
  }, function() {
375
- return r(s);
375
+ return r(i);
376
376
  });
377
377
  });
378
378
  }, n.create = function(t) {
@@ -383,14 +383,14 @@ function oe(n) {
383
383
  var t;
384
384
  return (t = n ?? we.Promise) !== null && t !== void 0 ? t : Promise;
385
385
  }
386
- function Ve(n) {
387
- return n && w(n.next) && w(n.error) && w(n.complete);
386
+ function He(n) {
387
+ return n && E(n.next) && E(n.error) && E(n.complete);
388
388
  }
389
- function je(n) {
390
- return n && n instanceof Z || Ve(n) && me(n);
389
+ function ke(n) {
390
+ return n && n instanceof Z || He(n) && me(n);
391
391
  }
392
392
  function Ne(n) {
393
- return w(n == null ? void 0 : n.lift);
393
+ return E(n == null ? void 0 : n.lift);
394
394
  }
395
395
  function Ce(n) {
396
396
  return function(t) {
@@ -405,36 +405,36 @@ function Ce(n) {
405
405
  throw new TypeError("Unable to lift unknown Observable type");
406
406
  };
407
407
  }
408
- function Me(n, t, e, r, i) {
409
- return new De(n, t, e, r, i);
408
+ function Me(n, t, e, r, s) {
409
+ return new Ve(n, t, e, r, s);
410
410
  }
411
- var De = function(n) {
411
+ var Ve = function(n) {
412
412
  M(t, n);
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) {
413
+ function t(e, r, s, i, o, a) {
414
+ var c = n.call(this, e) || this;
415
+ return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(u) {
416
416
  try {
417
417
  r(u);
418
418
  } catch (l) {
419
419
  e.error(l);
420
420
  }
421
- } : n.prototype._next, a._error = s ? function(u) {
421
+ } : n.prototype._next, c._error = i ? function(u) {
422
422
  try {
423
- s(u);
423
+ i(u);
424
424
  } catch (l) {
425
425
  e.error(l);
426
426
  } finally {
427
427
  this.unsubscribe();
428
428
  }
429
- } : n.prototype._error, a._complete = i ? function() {
429
+ } : n.prototype._error, c._complete = s ? function() {
430
430
  try {
431
- i();
431
+ s();
432
432
  } catch (u) {
433
433
  e.error(u);
434
434
  } finally {
435
435
  this.unsubscribe();
436
436
  }
437
- } : n.prototype._complete, a;
437
+ } : n.prototype._complete, c;
438
438
  }
439
439
  return t.prototype.unsubscribe = function() {
440
440
  var e;
@@ -443,7 +443,7 @@ var De = 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), qe = X(function(n) {
446
+ }(Z), je = X(function(n) {
447
447
  return function() {
448
448
  n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
449
449
  };
@@ -458,26 +458,26 @@ var De = function(n) {
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
  U(function() {
465
- var i, s;
465
+ var s, i;
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), c = o.next(); !c.done; c = o.next()) {
470
- var a = c.value;
471
- a.next(e);
469
+ for (var o = G(r.currentObservers), a = o.next(); !a.done; a = o.next()) {
470
+ var c = a.value;
471
+ c.next(e);
472
472
  }
473
473
  } catch (u) {
474
- i = { error: u };
474
+ s = { error: u };
475
475
  } finally {
476
476
  try {
477
- c && !c.done && (s = o.return) && s.call(o);
477
+ a && !a.done && (i = o.return) && i.call(o);
478
478
  } finally {
479
- if (i)
480
- throw i.error;
479
+ if (s)
480
+ throw s.error;
481
481
  }
482
482
  }
483
483
  }
@@ -487,8 +487,8 @@ var De = function(n) {
487
487
  U(function() {
488
488
  if (r._throwIfClosed(), !r.isStopped) {
489
489
  r.hasError = r.isStopped = !0, r.thrownError = e;
490
- for (var i = r.observers; i.length; )
491
- i.shift().error(e);
490
+ for (var s = r.observers; s.length; )
491
+ s.shift().error(e);
492
492
  }
493
493
  });
494
494
  }, t.prototype.complete = function() {
@@ -514,44 +514,44 @@ var De = 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, c = i.observers;
518
- return s || o ? be : (this.currentObservers = null, c.push(e), new T(function() {
519
- r.currentObservers = null, F(c, e);
517
+ var r = this, s = this, i = s.hasError, o = s.isStopped, a = s.observers;
518
+ return i || o ? be : (this.currentObservers = null, a.push(e), new R(function() {
519
+ r.currentObservers = null, F(a, e);
520
520
  }));
521
521
  }, t.prototype._checkFinalizedStatuses = function(e) {
522
- var r = this, i = r.hasError, s = r.thrownError, o = r.isStopped;
523
- i ? e.error(s) : o && e.complete();
522
+ var r = this, s = r.hasError, i = r.thrownError, o = r.isStopped;
523
+ s ? e.error(i) : o && e.complete();
524
524
  }, t.prototype.asObservable = function() {
525
- var e = new G();
525
+ var e = new B();
526
526
  return e.source = this, e;
527
527
  }, t.create = function(e, r) {
528
528
  return new ae(e, r);
529
529
  }, t;
530
- }(G), ae = function(n) {
530
+ }(B), ae = function(n) {
531
531
  M(t, n);
532
532
  function t(e, r) {
533
- var i = n.call(this) || this;
534
- return i.destination = e, i.source = r, i;
533
+ var s = n.call(this) || this;
534
+ return s.destination = e, s.source = r, s;
535
535
  }
536
536
  return t.prototype.next = function(e) {
537
- var r, i;
538
- (i = (r = this.destination) === null || r === void 0 ? void 0 : r.next) === null || i === void 0 || i.call(r, e);
537
+ var r, s;
538
+ (s = (r = this.destination) === null || r === void 0 ? void 0 : r.next) === null || s === void 0 || s.call(r, e);
539
539
  }, t.prototype.error = function(e) {
540
- var r, i;
541
- (i = (r = this.destination) === null || r === void 0 ? void 0 : r.error) === null || i === void 0 || i.call(r, e);
540
+ var r, s;
541
+ (s = (r = this.destination) === null || r === void 0 ? void 0 : r.error) === null || s === void 0 || s.call(r, e);
542
542
  }, t.prototype.complete = function() {
543
543
  var e, r;
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
- var r, i;
547
- return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i : be;
546
+ var r, s;
547
+ return (s = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && s !== void 0 ? s : be;
548
548
  }, t;
549
- }(xe), He = {
549
+ }(xe), Qe = {
550
550
  now: function() {
551
551
  return Date.now();
552
552
  },
553
553
  delegate: void 0
554
- }, Be = function(n) {
554
+ }, qe = function(n) {
555
555
  M(t, n);
556
556
  function t(e, r) {
557
557
  return n.call(this) || this;
@@ -559,72 +559,72 @@ var De = function(n) {
559
559
  return t.prototype.schedule = function(e, r) {
560
560
  return this;
561
561
  }, t;
562
- }(T), z = {
562
+ }(R), Y = {
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
- return setInterval.apply(void 0, k([n, t], $(e)));
566
+ return setInterval.apply(void 0, D([n, t], $(e)));
567
567
  },
568
568
  clearInterval: function(n) {
569
- var t = z.delegate;
569
+ var t = Y.delegate;
570
570
  return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
571
571
  },
572
572
  delegate: void 0
573
- }, Qe = function(n) {
573
+ }, Ge = function(n) {
574
574
  M(t, n);
575
575
  function t(e, r) {
576
- var i = n.call(this, e, r) || this;
577
- return i.scheduler = e, i.work = r, i.pending = !1, i;
576
+ var s = n.call(this, e, r) || this;
577
+ return s.scheduler = e, s.work = r, s.pending = !1, s;
578
578
  }
579
579
  return t.prototype.schedule = function(e, r) {
580
- var i;
580
+ var s;
581
581
  if (r === void 0 && (r = 0), this.closed)
582
582
  return this;
583
583
  this.state = e;
584
- var s = this.id, o = this.scheduler;
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
- }, t.prototype.requestAsyncId = function(e, r, i) {
587
- return i === void 0 && (i = 0), z.setInterval(e.flush.bind(e, this), i);
588
- }, t.prototype.recycleAsyncId = function(e, r, i) {
589
- if (i === void 0 && (i = 0), i != null && this.delay === i && this.pending === !1)
584
+ var i = this.id, o = this.scheduler;
585
+ return i != null && (this.id = this.recycleAsyncId(o, i, r)), this.pending = !0, this.delay = r, this.id = (s = this.id) !== null && s !== void 0 ? s : this.requestAsyncId(o, this.id, r), this;
586
+ }, t.prototype.requestAsyncId = function(e, r, s) {
587
+ return s === void 0 && (s = 0), Y.setInterval(e.flush.bind(e, this), s);
588
+ }, t.prototype.recycleAsyncId = function(e, r, s) {
589
+ if (s === void 0 && (s = 0), s != null && this.delay === s && this.pending === !1)
590
590
  return r;
591
- r != null && z.clearInterval(r);
591
+ r != null && Y.clearInterval(r);
592
592
  }, t.prototype.execute = function(e, r) {
593
593
  if (this.closed)
594
594
  return new Error("executing a cancelled action");
595
595
  this.pending = !1;
596
- var i = this._execute(e, r);
597
- if (i)
598
- return i;
596
+ var s = this._execute(e, r);
597
+ if (s)
598
+ return s;
599
599
  this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
600
600
  }, t.prototype._execute = function(e, r) {
601
- var i = !1, s;
601
+ var s = !1, i;
602
602
  try {
603
603
  this.work(e);
604
604
  } catch (o) {
605
- i = !0, s = o || new Error("Scheduled action threw falsy error");
605
+ s = !0, i = o || new Error("Scheduled action threw falsy error");
606
606
  }
607
- if (i)
608
- return this.unsubscribe(), s;
607
+ if (s)
608
+ return this.unsubscribe(), i;
609
609
  }, t.prototype.unsubscribe = function() {
610
610
  if (!this.closed) {
611
- var e = this, r = e.id, i = e.scheduler, s = i.actions;
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);
611
+ var e = this, r = e.id, s = e.scheduler, i = s.actions;
612
+ this.work = this.state = this.scheduler = null, this.pending = !1, F(i, this), r != null && (this.id = this.recycleAsyncId(s, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
613
613
  }
614
614
  }, t;
615
- }(Be), ce = function() {
615
+ }(qe), 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 = He.now, n;
622
- }(), Ge = function(n) {
621
+ }, n.now = Qe.now, n;
622
+ }(), Be = function(n) {
623
623
  M(t, n);
624
624
  function t(e, r) {
625
625
  r === void 0 && (r = ce.now);
626
- var i = n.call(this, e, r) || this;
627
- return i.actions = [], i._active = !1, i;
626
+ var s = n.call(this, e, r) || this;
627
+ return s.actions = [], s._active = !1, s;
628
628
  }
629
629
  return t.prototype.flush = function(e) {
630
630
  var r = this.actions;
@@ -632,85 +632,85 @@ var De = function(n) {
632
632
  r.push(e);
633
633
  return;
634
634
  }
635
- var i;
635
+ var s;
636
636
  this._active = !0;
637
637
  do
638
- if (i = e.execute(e.state, e.delay))
638
+ if (s = e.execute(e.state, e.delay))
639
639
  break;
640
640
  while (e = r.shift());
641
- if (this._active = !1, i) {
641
+ if (this._active = !1, s) {
642
642
  for (; e = r.shift(); )
643
643
  e.unsubscribe();
644
- throw i;
644
+ throw s;
645
645
  }
646
646
  }, t;
647
- }(ce), ze = new Ge(Qe), Ye = ze;
648
- function Ke(n) {
649
- return n && w(n.schedule);
647
+ }(ce), Ye = new Be(Ge), ze = Ye;
648
+ function We(n) {
649
+ return n && E(n.schedule);
650
650
  }
651
- var Je = X(function(n) {
651
+ var Ke = X(function(n) {
652
652
  return function() {
653
653
  n(this), this.name = "EmptyError", this.message = "no elements in sequence";
654
654
  };
655
655
  });
656
- function _(n, t) {
656
+ function T(n, t) {
657
657
  var e = typeof t == "object";
658
- return new Promise(function(r, i) {
659
- var s = new V({
658
+ return new Promise(function(r, s) {
659
+ var i = new H({
660
660
  next: function(o) {
661
- r(o), s.unsubscribe();
661
+ r(o), i.unsubscribe();
662
662
  },
663
- error: i,
663
+ error: s,
664
664
  complete: function() {
665
- e ? r(t.defaultValue) : i(new Je());
665
+ e ? r(t.defaultValue) : s(new Ke());
666
666
  }
667
667
  });
668
- n.subscribe(s);
668
+ n.subscribe(i);
669
669
  });
670
670
  }
671
- function We(n) {
671
+ function Je(n) {
672
672
  return n instanceof Date && !isNaN(n);
673
673
  }
674
674
  function O(n, t) {
675
675
  return Ce(function(e, r) {
676
- var i = 0;
677
- e.subscribe(Me(r, function(s) {
678
- r.next(n.call(t, s, i++));
676
+ var s = 0;
677
+ e.subscribe(Me(r, function(i) {
678
+ r.next(n.call(t, i, s++));
679
679
  }));
680
680
  });
681
681
  }
682
682
  function Xe(n, t, e) {
683
- n === void 0 && (n = 0), e === void 0 && (e = Ye);
683
+ n === void 0 && (n = 0), e === void 0 && (e = ze);
684
684
  var r = -1;
685
- return t != null && (Ke(t) ? e = t : r = t), new G(function(i) {
686
- var s = We(n) ? +n - e.now() : n;
687
- s < 0 && (s = 0);
685
+ return t != null && (We(t) ? e = t : r = t), new B(function(s) {
686
+ var i = Je(n) ? +n - e.now() : n;
687
+ i < 0 && (i = 0);
688
688
  var o = 0;
689
689
  return e.schedule(function() {
690
- i.closed || (i.next(o++), 0 <= r ? this.schedule(void 0, r) : i.complete());
691
- }, s);
690
+ s.closed || (s.next(o++), 0 <= r ? this.schedule(void 0, r) : s.complete());
691
+ }, i);
692
692
  });
693
693
  }
694
694
  function Ze(n, t, e) {
695
- var r = w(n) || t || e ? { next: n, error: t, complete: e } : n;
696
- return r ? Ce(function(i, s) {
695
+ var r = E(n) || t || e ? { next: n, error: t, complete: e } : n;
696
+ return r ? Ce(function(s, i) {
697
697
  var o;
698
698
  (o = r.subscribe) === null || o === void 0 || o.call(r);
699
- var c = !0;
700
- i.subscribe(Me(s, function(a) {
699
+ var a = !0;
700
+ s.subscribe(Me(i, function(c) {
701
701
  var u;
702
- (u = r.next) === null || u === void 0 || u.call(r, a), s.next(a);
702
+ (u = r.next) === null || u === void 0 || u.call(r, c), i.next(c);
703
703
  }, function() {
704
- var a;
705
- c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
706
- }, function(a) {
704
+ var c;
705
+ a = !1, (c = r.complete) === null || c === void 0 || c.call(r), i.complete();
706
+ }, function(c) {
707
707
  var u;
708
- c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
708
+ a = !1, (u = r.error) === null || u === void 0 || u.call(r, c), i.error(c);
709
709
  }, function() {
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);
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);
712
712
  }));
713
- }) : Ee;
713
+ }) : Se;
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
716
  class h extends Error {
@@ -746,15 +746,15 @@ class le extends Error {
746
746
  e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;
747
747
  }
748
748
  }
749
- function E(n) {
749
+ function S(n) {
750
750
  return typeof n == "function";
751
751
  }
752
- function it(n) {
753
- return E(n == null ? void 0 : n.lift);
752
+ function st(n) {
753
+ return S(n == null ? void 0 : n.lift);
754
754
  }
755
- function R(n) {
755
+ function P(n) {
756
756
  return function(t) {
757
- if (it(t))
757
+ if (st(t))
758
758
  return t.lift(function(e) {
759
759
  try {
760
760
  return n(e, this);
@@ -765,18 +765,18 @@ function R(n) {
765
765
  throw new TypeError("Unable to lift unknown Observable type");
766
766
  };
767
767
  }
768
- var Y = function(n, t) {
769
- return Y = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
768
+ var z = function(n, t) {
769
+ return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
770
770
  e.__proto__ = r;
771
771
  } || function(e, r) {
772
- for (var i in r)
773
- Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
774
- }, Y(n, t);
772
+ for (var s in r)
773
+ Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
774
+ }, z(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
- Y(n, t);
779
+ z(n, t);
780
780
  function e() {
781
781
  this.constructor = n;
782
782
  }
@@ -794,39 +794,39 @@ function he(n) {
794
794
  };
795
795
  throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
796
796
  }
797
- function K(n, t) {
797
+ function W(n, t) {
798
798
  var e = typeof Symbol == "function" && n[Symbol.iterator];
799
799
  if (!e)
800
800
  return n;
801
- var r = e.call(n), i, s = [], o;
801
+ var r = e.call(n), s, i = [], o;
802
802
  try {
803
- for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
804
- s.push(i.value);
805
- } catch (c) {
806
- o = { error: c };
803
+ for (; (t === void 0 || t-- > 0) && !(s = r.next()).done; )
804
+ i.push(s.value);
805
+ } catch (a) {
806
+ o = { error: a };
807
807
  } finally {
808
808
  try {
809
- i && !i.done && (e = r.return) && e.call(r);
809
+ s && !s.done && (e = r.return) && e.call(r);
810
810
  } finally {
811
811
  if (o)
812
812
  throw o.error;
813
813
  }
814
814
  }
815
- return s;
815
+ return i;
816
816
  }
817
- function J(n, t, e) {
817
+ function K(n, t, e) {
818
818
  if (e || arguments.length === 2)
819
- for (var r = 0, i = t.length, s; r < i; r++)
820
- (s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
821
- return n.concat(s || Array.prototype.slice.call(t));
819
+ for (var r = 0, s = t.length, i; r < s; r++)
820
+ (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
821
+ return n.concat(i || Array.prototype.slice.call(t));
822
822
  }
823
- function st(n) {
823
+ function it(n) {
824
824
  var t = function(r) {
825
825
  Error.call(r), r.stack = new Error().stack;
826
826
  }, e = n(t);
827
827
  return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
828
828
  }
829
- var q = st(function(n) {
829
+ var j = it(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) {
@@ -846,22 +846,22 @@ var te = function() {
846
846
  this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
847
847
  }
848
848
  return n.prototype.unsubscribe = function() {
849
- var t, e, r, i, s;
849
+ var t, e, r, s, i;
850
850
  if (!this.closed) {
851
851
  this.closed = !0;
852
852
  var o = this._parentage;
853
853
  if (o)
854
854
  if (this._parentage = null, Array.isArray(o))
855
855
  try {
856
- for (var c = he(o), a = c.next(); !a.done; a = c.next()) {
857
- var u = a.value;
856
+ for (var a = he(o), c = a.next(); !c.done; c = a.next()) {
857
+ var u = c.value;
858
858
  u.remove(this);
859
859
  }
860
- } catch (g) {
861
- t = { error: g };
860
+ } catch (v) {
861
+ t = { error: v };
862
862
  } finally {
863
863
  try {
864
- a && !a.done && (e = c.return) && e.call(c);
864
+ c && !c.done && (e = a.return) && e.call(a);
865
865
  } finally {
866
866
  if (t)
867
867
  throw t.error;
@@ -870,37 +870,37 @@ var te = function() {
870
870
  else
871
871
  o.remove(this);
872
872
  var l = this.initialTeardown;
873
- if (E(l))
873
+ if (S(l))
874
874
  try {
875
875
  l();
876
- } catch (g) {
877
- s = g instanceof q ? g.errors : [g];
876
+ } catch (v) {
877
+ i = v instanceof j ? v.errors : [v];
878
878
  }
879
879
  var d = this._finalizers;
880
880
  if (d) {
881
881
  this._finalizers = null;
882
882
  try {
883
- for (var y = he(d), S = y.next(); !S.done; S = y.next()) {
884
- var j = S.value;
883
+ for (var y = he(d), b = y.next(); !b.done; b = y.next()) {
884
+ var k = b.value;
885
885
  try {
886
- pe(j);
887
- } catch (g) {
888
- s = s ?? [], g instanceof q ? s = J(J([], K(s)), K(g.errors)) : s.push(g);
886
+ pe(k);
887
+ } catch (v) {
888
+ i = i ?? [], v instanceof j ? i = K(K([], W(i)), W(v.errors)) : i.push(v);
889
889
  }
890
890
  }
891
- } catch (g) {
892
- r = { error: g };
891
+ } catch (v) {
892
+ r = { error: v };
893
893
  } finally {
894
894
  try {
895
- S && !S.done && (i = y.return) && i.call(y);
895
+ b && !b.done && (s = y.return) && s.call(y);
896
896
  } finally {
897
897
  if (r)
898
898
  throw r.error;
899
899
  }
900
900
  }
901
901
  }
902
- if (s)
903
- throw new q(s);
902
+ if (i)
903
+ throw new j(i);
904
904
  }
905
905
  }, n.prototype.add = function(t) {
906
906
  var e;
@@ -934,12 +934,12 @@ var te = function() {
934
934
  }();
935
935
  te.EMPTY;
936
936
  function Ie(n) {
937
- return n instanceof te || n && "closed" in n && E(n.remove) && E(n.add) && E(n.unsubscribe);
937
+ return n instanceof te || n && "closed" in n && S(n.remove) && S(n.add) && S(n.unsubscribe);
938
938
  }
939
939
  function pe(n) {
940
- E(n) ? n() : n.unsubscribe();
940
+ S(n) ? n() : n.unsubscribe();
941
941
  }
942
- var _e = {
942
+ var Te = {
943
943
  onUnhandledError: null,
944
944
  onStoppedNotification: null,
945
945
  Promise: void 0,
@@ -949,7 +949,7 @@ var _e = {
949
949
  setTimeout: function(n, t) {
950
950
  for (var e = [], r = 2; r < arguments.length; r++)
951
951
  e[r - 2] = arguments[r];
952
- return setTimeout.apply(void 0, J([n, t], K(e)));
952
+ return setTimeout.apply(void 0, K([n, t], W(e)));
953
953
  },
954
954
  clearTimeout: function(n) {
955
955
  return clearTimeout(n);
@@ -972,8 +972,8 @@ var re = function(n) {
972
972
  var r = n.call(this) || this;
973
973
  return r.isStopped = !1, e ? (r.destination = e, Ie(e) && e.add(r)) : r.destination = dt, r;
974
974
  }
975
- return t.create = function(e, r, i) {
976
- return new W(e, r, i);
975
+ return t.create = function(e, r, s) {
976
+ return new J(e, r, s);
977
977
  }, t.prototype.next = function(e) {
978
978
  this.isStopped || this._next(e);
979
979
  }, t.prototype.error = function(e) {
@@ -998,7 +998,7 @@ var re = function(n) {
998
998
  }
999
999
  }, t;
1000
1000
  }(te), ut = Function.prototype.bind;
1001
- function H(n, t) {
1001
+ function Q(n, t) {
1002
1002
  return ut.call(n, t);
1003
1003
  }
1004
1004
  var lt = function() {
@@ -1032,27 +1032,27 @@ var lt = function() {
1032
1032
  L(e);
1033
1033
  }
1034
1034
  }, n;
1035
- }(), W = function(n) {
1035
+ }(), J = function(n) {
1036
1036
  ee(t, n);
1037
- function t(e, r, i) {
1038
- var s = n.call(this) || this, o;
1039
- if (E(e) || !e)
1037
+ function t(e, r, s) {
1038
+ var i = n.call(this) || this, o;
1039
+ if (S(e) || !e)
1040
1040
  o = {
1041
1041
  next: e ?? void 0,
1042
1042
  error: r ?? void 0,
1043
- complete: i ?? void 0
1043
+ complete: s ?? void 0
1044
1044
  };
1045
1045
  else {
1046
- var c;
1047
- s && _e.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
1048
- return s.unsubscribe();
1046
+ var a;
1047
+ i && Te.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
1048
+ return i.unsubscribe();
1049
1049
  }, o = {
1050
- next: e.next && H(e.next, c),
1051
- error: e.error && H(e.error, c),
1052
- complete: e.complete && H(e.complete, c)
1050
+ next: e.next && Q(e.next, a),
1051
+ error: e.error && Q(e.error, a),
1052
+ complete: e.complete && Q(e.complete, a)
1053
1053
  }) : o = e;
1054
1054
  }
1055
- return s.destination = new lt(o), s;
1055
+ return i.destination = new lt(o), i;
1056
1056
  }
1057
1057
  return t;
1058
1058
  }(re);
@@ -1070,11 +1070,11 @@ var dt = {
1070
1070
  }, pt = function() {
1071
1071
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
1072
1072
  }();
1073
- function Te(n) {
1073
+ function Re(n) {
1074
1074
  return n;
1075
1075
  }
1076
1076
  function ft(n) {
1077
- return n.length === 0 ? Te : n.length === 1 ? n[0] : function(t) {
1077
+ return n.length === 0 ? Re : n.length === 1 ? n[0] : function(t) {
1078
1078
  return n.reduce(function(e, r) {
1079
1079
  return r(e);
1080
1080
  }, t);
@@ -1088,11 +1088,11 @@ 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 = yt(t) ? t : new W(t, e, r);
1091
+ var s = this, i = yt(t) ? t : new J(t, e, r);
1092
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
- }), s;
1093
+ var o = s, a = o.operator, c = o.source;
1094
+ i.add(a ? a.call(i, c) : c ? s._subscribe(i) : s._trySubscribe(i));
1095
+ }), i;
1096
1096
  }, n.prototype._trySubscribe = function(t) {
1097
1097
  try {
1098
1098
  return this._subscribe(t);
@@ -1101,17 +1101,17 @@ var gt = function() {
1101
1101
  }
1102
1102
  }, n.prototype.forEach = function(t, e) {
1103
1103
  var r = this;
1104
- return e = ge(e), new e(function(i, s) {
1105
- var o = new W({
1106
- next: function(c) {
1104
+ return e = ge(e), new e(function(s, i) {
1105
+ var o = new J({
1106
+ next: function(a) {
1107
1107
  try {
1108
- t(c);
1109
- } catch (a) {
1110
- s(a), o.unsubscribe();
1108
+ t(a);
1109
+ } catch (c) {
1110
+ i(c), o.unsubscribe();
1111
1111
  }
1112
1112
  },
1113
- error: s,
1114
- complete: i
1113
+ error: i,
1114
+ complete: s
1115
1115
  });
1116
1116
  r.subscribe(o);
1117
1117
  });
@@ -1126,14 +1126,14 @@ var gt = function() {
1126
1126
  return ft(t)(this);
1127
1127
  }, n.prototype.toPromise = function(t) {
1128
1128
  var e = this;
1129
- return t = ge(t), new t(function(r, i) {
1130
- var s;
1129
+ return t = ge(t), new t(function(r, s) {
1130
+ var i;
1131
1131
  e.subscribe(function(o) {
1132
- return s = o;
1132
+ return i = o;
1133
1133
  }, function(o) {
1134
- return i(o);
1134
+ return s(o);
1135
1135
  }, function() {
1136
- return r(s);
1136
+ return r(i);
1137
1137
  });
1138
1138
  });
1139
1139
  }, n.create = function(t) {
@@ -1142,44 +1142,44 @@ var gt = function() {
1142
1142
  }();
1143
1143
  function ge(n) {
1144
1144
  var t;
1145
- return (t = n ?? _e.Promise) !== null && t !== void 0 ? t : Promise;
1145
+ return (t = n ?? Te.Promise) !== null && t !== void 0 ? t : Promise;
1146
1146
  }
1147
1147
  function vt(n) {
1148
- return n && E(n.next) && E(n.error) && E(n.complete);
1148
+ return n && S(n.next) && S(n.error) && S(n.complete);
1149
1149
  }
1150
1150
  function yt(n) {
1151
1151
  return n && n instanceof re || vt(n) && Ie(n);
1152
1152
  }
1153
- function P(n, t, e, r, i) {
1154
- return new bt(n, t, e, r, i);
1153
+ function _(n, t, e, r, s) {
1154
+ return new bt(n, t, e, r, s);
1155
1155
  }
1156
1156
  var bt = function(n) {
1157
1157
  ee(t, n);
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) {
1158
+ function t(e, r, s, i, o, a) {
1159
+ var c = n.call(this, e) || this;
1160
+ return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(u) {
1161
1161
  try {
1162
1162
  r(u);
1163
1163
  } catch (l) {
1164
1164
  e.error(l);
1165
1165
  }
1166
- } : n.prototype._next, a._error = s ? function(u) {
1166
+ } : n.prototype._next, c._error = i ? function(u) {
1167
1167
  try {
1168
- s(u);
1168
+ i(u);
1169
1169
  } catch (l) {
1170
1170
  e.error(l);
1171
1171
  } finally {
1172
1172
  this.unsubscribe();
1173
1173
  }
1174
- } : n.prototype._error, a._complete = i ? function() {
1174
+ } : n.prototype._error, c._complete = s ? function() {
1175
1175
  try {
1176
- i();
1176
+ s();
1177
1177
  } catch (u) {
1178
1178
  e.error(u);
1179
1179
  } finally {
1180
1180
  this.unsubscribe();
1181
1181
  }
1182
- } : n.prototype._complete, a;
1182
+ } : n.prototype._complete, c;
1183
1183
  }
1184
1184
  return t.prototype.unsubscribe = function() {
1185
1185
  var e;
@@ -1190,10 +1190,10 @@ var bt = function(n) {
1190
1190
  }, t;
1191
1191
  }(re);
1192
1192
  function p(n, t) {
1193
- return R(function(e, r) {
1194
- var i = 0;
1195
- e.subscribe(P(r, function(s) {
1196
- r.next(n.call(t, s, i++));
1193
+ return P(function(e, r) {
1194
+ var s = 0;
1195
+ e.subscribe(_(r, function(i) {
1196
+ r.next(n.call(t, i, s++));
1197
1197
  }));
1198
1198
  });
1199
1199
  }
@@ -1203,67 +1203,67 @@ var mt = new gt(function(n) {
1203
1203
  function m(n) {
1204
1204
  return n <= 0 ? function() {
1205
1205
  return mt;
1206
- } : R(function(t, e) {
1206
+ } : P(function(t, e) {
1207
1207
  var r = 0;
1208
- t.subscribe(P(e, function(i) {
1209
- ++r <= n && (e.next(i), n <= r && e.complete());
1208
+ t.subscribe(_(e, function(s) {
1209
+ ++r <= n && (e.next(s), n <= r && e.complete());
1210
1210
  }));
1211
1211
  });
1212
1212
  }
1213
- function v(n, t) {
1214
- return R(function(e, r) {
1215
- var i = 0;
1216
- e.subscribe(P(r, function(s) {
1217
- return n.call(t, s, i++) && r.next(s);
1213
+ function g(n, t) {
1214
+ return P(function(e, r) {
1215
+ var s = 0;
1216
+ e.subscribe(_(r, function(i) {
1217
+ return n.call(t, i, s++) && r.next(i);
1218
1218
  }));
1219
1219
  });
1220
1220
  }
1221
1221
  function wt(n, t) {
1222
- return t === void 0 && (t = !1), R(function(e, r) {
1223
- var i = 0;
1224
- e.subscribe(P(r, function(s) {
1225
- var o = n(s, i++);
1226
- (o || t) && r.next(s), !o && r.complete();
1222
+ return t === void 0 && (t = !1), P(function(e, r) {
1223
+ var s = 0;
1224
+ e.subscribe(_(r, function(i) {
1225
+ var o = n(i, s++);
1226
+ (o || t) && r.next(i), !o && r.complete();
1227
1227
  }));
1228
1228
  });
1229
1229
  }
1230
1230
  function f(n, t, e) {
1231
- var r = E(n) || t || e ? { next: n, error: t, complete: e } : n;
1232
- return r ? R(function(i, s) {
1231
+ var r = S(n) || t || e ? { next: n, error: t, complete: e } : n;
1232
+ return r ? P(function(s, i) {
1233
1233
  var o;
1234
1234
  (o = r.subscribe) === null || o === void 0 || o.call(r);
1235
- var c = !0;
1236
- i.subscribe(P(s, function(a) {
1235
+ var a = !0;
1236
+ s.subscribe(_(i, function(c) {
1237
1237
  var u;
1238
- (u = r.next) === null || u === void 0 || u.call(r, a), s.next(a);
1238
+ (u = r.next) === null || u === void 0 || u.call(r, c), i.next(c);
1239
1239
  }, function() {
1240
- var a;
1241
- c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
1242
- }, function(a) {
1240
+ var c;
1241
+ a = !1, (c = r.complete) === null || c === void 0 || c.call(r), i.complete();
1242
+ }, function(c) {
1243
1243
  var u;
1244
- c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
1244
+ a = !1, (u = r.error) === null || u === void 0 || u.call(r, c), i.error(c);
1245
1245
  }, function() {
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);
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);
1248
1248
  }));
1249
- }) : Te;
1249
+ }) : Re;
1250
1250
  }
1251
- const St = /^(\d+)\.(\d+)$/;
1252
- function Et(n) {
1251
+ const Et = /^(\d+)\.(\d+)$/;
1252
+ function St(n) {
1253
1253
  if (typeof n == "string") {
1254
- const t = n.match(St);
1254
+ const t = n.match(Et);
1255
1255
  if (t)
1256
1256
  return `${t[1]}.${t[2]}`;
1257
1257
  }
1258
1258
  throw new nt(n);
1259
1259
  }
1260
1260
  function ve(n) {
1261
- const t = Et(n), [e, r] = t.split("."), [i, s] = [parseInt(e), parseInt(r)];
1262
- return [i, s];
1261
+ const t = St(n), [e, r] = t.split("."), [s, i] = [parseInt(e), parseInt(r)];
1262
+ return [s, i];
1263
1263
  }
1264
1264
  function ne(n, t) {
1265
- const [e, r] = ve(n), [i, s] = ve(t);
1266
- return e < i ? -1 : e > i ? 1 : r < s ? -1 : r > s ? 1 : 0;
1265
+ const [e, r] = ve(n), [s, i] = ve(t);
1266
+ return e < s ? -1 : e > s ? 1 : r < i ? -1 : r > i ? 1 : 0;
1267
1267
  }
1268
1268
  function Ct(n, t) {
1269
1269
  return ne(n, t) === 1;
@@ -1303,7 +1303,7 @@ class xt {
1303
1303
  return this.inIframe ? this.iframePort1 : (e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) == null ? void 0 : e.port1;
1304
1304
  }
1305
1305
  get port2() {
1306
- var t, e, r, i;
1306
+ var t, e, r, s;
1307
1307
  if (this.inIframe) {
1308
1308
  if (!this.iframePort2)
1309
1309
  throw new ue("port2");
@@ -1311,7 +1311,7 @@ class xt {
1311
1311
  } else {
1312
1312
  if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))
1313
1313
  throw new ue("port2");
1314
- return (i = (r = window.Acrobits) == null ? void 0 : r.messageChannel) == null ? void 0 : i.port2;
1314
+ return (s = (r = window.Acrobits) == null ? void 0 : r.messageChannel) == null ? void 0 : s.port2;
1315
1315
  }
1316
1316
  }
1317
1317
  /**
@@ -1337,16 +1337,16 @@ class xt {
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
- v((i) => i.type === t && i.replyTo === e.id),
1341
- p((i) => i),
1340
+ g((s) => s.type === t && s.replyTo === e.id),
1341
+ p((s) => s),
1342
1342
  f(this.logReceived(t)),
1343
- p((i) => {
1344
- if (this.supportedVersions.some((s) => Ct(s, i.protocolVersion)))
1345
- throw new le(i.protocolVersion, this.supportedVersions[0]);
1346
- return i;
1343
+ p((s) => {
1344
+ if (this.supportedVersions.some((i) => Ct(i, s.protocolVersion)))
1345
+ throw new le(s.protocolVersion, this.supportedVersions[0]);
1346
+ return s;
1347
1347
  }),
1348
- f((i) => {
1349
- this.negotiatedProtocolVersion = i.protocolVersion, this.logService.info(
1348
+ f((s) => {
1349
+ this.negotiatedProtocolVersion = s.protocolVersion, this.logService.info(
1350
1350
  `[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
1351
1351
  );
1352
1352
  }),
@@ -1367,8 +1367,8 @@ class xt {
1367
1367
  const t = "TOKEN", e = this.createMessage(t);
1368
1368
  this.logCreated(t, e);
1369
1369
  const r = this.incomingMessages$.pipe(
1370
- v((i) => i.type === t && i.replyTo === e.id),
1371
- p((i) => i),
1370
+ g((s) => s.type === t && s.replyTo === e.id),
1371
+ p((s) => s),
1372
1372
  f(this.logReceived(t)),
1373
1373
  m(1)
1374
1374
  );
@@ -1393,14 +1393,14 @@ class xt {
1393
1393
  const {
1394
1394
  roomName: e,
1395
1395
  roomInvite: r,
1396
- displayName: i,
1397
- jwtToken: s,
1396
+ displayName: s,
1397
+ jwtToken: i,
1398
1398
  serverUrl: o,
1399
- region: c,
1400
- joinMicMuted: a,
1399
+ region: a,
1400
+ joinMicMuted: c,
1401
1401
  joinWithoutCamera: u
1402
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);
1403
+ d.roomName = e, d.jwtToken = i, d.serverUrl = o, d.region = a, d.roomInvite = r, d.joinMicMuted = c ?? !1, d.joinWithoutCamera = u ?? !1, d.displayName = s, 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.
@@ -1450,7 +1450,7 @@ class xt {
1450
1450
  throw new h(this.currentContext);
1451
1451
  const t = "JOIN ROOM";
1452
1452
  return this.incomingMessages$.pipe(
1453
- v((e) => e.type === t && e.target === "client"),
1453
+ g((e) => e.type === t && e.target === "client"),
1454
1454
  p((e) => e),
1455
1455
  f(this.logReceived(t)),
1456
1456
  p((e) => e)
@@ -1486,7 +1486,7 @@ class xt {
1486
1486
  throw new h(this.currentContext);
1487
1487
  const t = "LEAVE ROOM";
1488
1488
  return this.incomingMessages$.pipe(
1489
- v((e) => e.type === t && e.target === "client"),
1489
+ g((e) => e.type === t && e.target === "client"),
1490
1490
  p((e) => e),
1491
1491
  f(this.logReceived(t)),
1492
1492
  p((e) => e)
@@ -1523,7 +1523,7 @@ class xt {
1523
1523
  throw new h(this.currentContext);
1524
1524
  const t = "CONFIG";
1525
1525
  return this.incomingMessages$.pipe(
1526
- v((e) => e.type === t && e.target === "client"),
1526
+ g((e) => e.type === t && e.target === "client"),
1527
1527
  p((e) => e),
1528
1528
  f(this.logReceived(t)),
1529
1529
  p((e) => ({
@@ -1545,27 +1545,27 @@ class xt {
1545
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
- const i = this.incomingMessages$.pipe(
1549
- v((s) => s.type === e && s.replyTo === r.id),
1550
- p((s) => s),
1548
+ const s = this.incomingMessages$.pipe(
1549
+ g((i) => i.type === e && i.replyTo === r.id),
1550
+ p((i) => i),
1551
1551
  f(this.logReceived(e)),
1552
- p((s) => s),
1552
+ p((i) => i),
1553
1553
  m(1)
1554
1554
  );
1555
- return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
1555
+ return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;
1556
1556
  }
1557
1557
  layoutChange(t, e, r) {
1558
1558
  if (!this.isEmbedded())
1559
1559
  throw new h(this.currentContext);
1560
- const i = "LAYOUT CHANGE";
1561
- let s, o;
1562
- if (e && r ? (s = this.createMessage(i, !1, r), s.result = e) : (s = this.createMessage(i), o = this.incomingMessages$.pipe(
1563
- v((c) => c.type === i && c.replyTo === s.id),
1564
- p((c) => c),
1565
- f(this.logReceived(i)),
1566
- p((c) => c),
1560
+ const s = "LAYOUT CHANGE";
1561
+ let i, o;
1562
+ if (e && r ? (i = this.createMessage(s, !1, r), i.result = e) : (i = this.createMessage(s), o = this.incomingMessages$.pipe(
1563
+ g((a) => a.type === s && a.replyTo === i.id),
1564
+ p((a) => a),
1565
+ f(this.logReceived(s)),
1566
+ p((a) => a),
1567
1567
  m(1)
1568
- ), this.logService.debug(`Created ${i} Reply handler`)), s.layout = t, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s), o)
1568
+ ), this.logService.debug(`Created ${s} Reply handler`)), i.layout = t, this.logCreated(s, i), this.port2.postMessage(i), this.logSent(s, i), o)
1569
1569
  return o;
1570
1570
  }
1571
1571
  /**
@@ -1604,7 +1604,7 @@ class xt {
1604
1604
  throw new h(this.currentContext);
1605
1605
  const t = "LAYOUT CHANGE";
1606
1606
  return this.incomingMessages$.pipe(
1607
- v((e) => e.type === t && e.target === "client" && e.replyTo === null),
1607
+ g((e) => e.type === t && e.target === "client" && e.replyTo === null),
1608
1608
  p((e) => e),
1609
1609
  f(this.logReceived(t)),
1610
1610
  p((e) => e)
@@ -1616,50 +1616,50 @@ class xt {
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
- const i = this.incomingMessages$.pipe(
1620
- v((s) => s.type === e && s.replyTo === r.id),
1621
- p((s) => s),
1619
+ const s = this.incomingMessages$.pipe(
1620
+ g((i) => i.type === e && i.replyTo === r.id),
1621
+ p((i) => i),
1622
1622
  f(this.logReceived(e)),
1623
1623
  m(1)
1624
1624
  );
1625
- return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
1625
+ return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;
1626
1626
  }
1627
1627
  openUrl(t, e) {
1628
1628
  if (!this.isEmbedded())
1629
1629
  throw new h(this.currentContext);
1630
- const r = "OPEN URL", i = this.createMessage(r, !1);
1631
- i.url = t, i.data = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
1630
+ const r = "OPEN URL", s = this.createMessage(r, !1);
1631
+ s.url = t, s.data = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
1632
1632
  }
1633
- selectContacts(t, e, r, i) {
1633
+ selectContacts(t, e, r, s) {
1634
1634
  if (!this.isEmbedded())
1635
1635
  throw new h(this.currentContext);
1636
- if (e === "group" && i === void 0)
1636
+ if (e === "group" && s === void 0)
1637
1637
  throw new x(
1638
1638
  "currentContacts",
1639
- i,
1639
+ s,
1640
1640
  "currentContacts is required for group streams"
1641
1641
  );
1642
- if (e === "direct" && i !== void 0)
1642
+ if (e === "direct" && s !== void 0)
1643
1643
  throw new x(
1644
1644
  "currentContacts",
1645
- i,
1645
+ s,
1646
1646
  "currentContacts should not be passed for direct streams"
1647
1647
  );
1648
- const s = "SELECT CONTACTS", o = this.createMessage(s, !0);
1649
- o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = i, this.logCreated(s, o);
1650
- const c = this.incomingMessages$.pipe(
1651
- v((a) => a.type === s && a.replyTo === o.id),
1652
- f(this.logReceived(s)),
1648
+ const i = "SELECT CONTACTS", o = this.createMessage(i, !0);
1649
+ o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = s, this.logCreated(i, o);
1650
+ const a = this.incomingMessages$.pipe(
1651
+ g((c) => c.type === i && c.replyTo === o.id),
1652
+ f(this.logReceived(i)),
1653
1653
  // validate if `streamId` is the same as we sent
1654
- p((a) => {
1655
- const u = a;
1654
+ p((c) => {
1655
+ const u = c;
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), c;
1662
+ return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o), a;
1663
1663
  }
1664
1664
  /**
1665
1665
  * Request detailed contact information for the given Cloud usernames.
@@ -1676,13 +1676,13 @@ class xt {
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
- const i = this.incomingMessages$.pipe(
1680
- v((s) => s.type === e && s.replyTo === r.id),
1679
+ const s = this.incomingMessages$.pipe(
1680
+ g((i) => i.type === e && i.replyTo === r.id),
1681
1681
  f(this.logReceived(e)),
1682
- p((s) => s),
1682
+ p((i) => i),
1683
1683
  m(1)
1684
1684
  );
1685
- return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
1685
+ return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;
1686
1686
  }
1687
1687
  /**
1688
1688
  * Setup listener for {@link PushMessageMessage}, which can be sent by a Host app to forward an
@@ -1715,7 +1715,7 @@ class xt {
1715
1715
  throw new h(this.currentContext);
1716
1716
  const t = "PUSH MESSAGE";
1717
1717
  return this.incomingMessages$.pipe(
1718
- v((e) => e.type === t && e.target === "client"),
1718
+ g((e) => e.type === t && e.target === "client"),
1719
1719
  p((e) => e),
1720
1720
  f(this.logReceived(t))
1721
1721
  );
@@ -1735,9 +1735,9 @@ class xt {
1735
1735
  const t = "PUSH TOKEN", e = this.createMessage(t);
1736
1736
  this.logCreated(t, e);
1737
1737
  const r = this.incomingMessages$.pipe(
1738
- v((i) => i.type === t && i.replyTo === e.id),
1738
+ g((s) => s.type === t && s.replyTo === e.id),
1739
1739
  f(this.logReceived(t)),
1740
- p((i) => i),
1740
+ p((s) => s),
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;
@@ -1774,7 +1774,7 @@ class xt {
1774
1774
  throw new h(this.currentContext);
1775
1775
  const t = "PUSH TOKEN";
1776
1776
  return this.incomingMessages$.pipe(
1777
- v(
1777
+ g(
1778
1778
  (e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
1779
1779
  ),
1780
1780
  p((e) => {
@@ -1798,7 +1798,7 @@ class xt {
1798
1798
  throw new h(this.currentContext);
1799
1799
  const t = "BADGE QUERY";
1800
1800
  return this.incomingMessages$.pipe(
1801
- v((e) => e.type === t && e.target === "client"),
1801
+ g((e) => e.type === t && e.target === "client"),
1802
1802
  p((e) => e),
1803
1803
  f(this.logReceived(t))
1804
1804
  );
@@ -1818,8 +1818,8 @@ class xt {
1818
1818
  sendBadgeUpdateMessage(t, e, r) {
1819
1819
  if (!this.isEmbedded())
1820
1820
  throw new h(this.currentContext);
1821
- const i = "BADGE UPDATE", s = this.createMessage(i, !1, r);
1822
- s.count = t, s.activity = e ?? !1, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s);
1821
+ const s = "BADGE UPDATE", i = this.createMessage(s, !1, r);
1822
+ i.count = t, i.activity = e ?? !1, this.logCreated(s, i), this.port2.postMessage(i), this.logSent(s, i);
1823
1823
  }
1824
1824
  /**
1825
1825
  * Sends a {@link LifecycleMessage} to the Host app, to notify it of a lifecycle event.
@@ -1837,8 +1837,8 @@ class xt {
1837
1837
  sendLifecycleMessage(t, e) {
1838
1838
  if (!this.isEmbedded())
1839
1839
  throw new h(this.currentContext);
1840
- const r = "LIFECYCLE", i = this.createMessage(r, !1);
1841
- i.eventName = t, i.payload = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
1840
+ const r = "LIFECYCLE", s = this.createMessage(r, !1);
1841
+ s.eventName = t, s.payload = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
1842
1842
  }
1843
1843
  /**
1844
1844
  * Setup listener for {@link LifecycleMessage}, which can be sent by a `Host` app to notify the
@@ -1856,7 +1856,7 @@ class xt {
1856
1856
  throw new h(this.currentContext);
1857
1857
  const t = "LIFECYCLE";
1858
1858
  return this.incomingMessages$.pipe(
1859
- v((e) => e.type === t && e.target === "client"),
1859
+ g((e) => e.type === t && e.target === "client"),
1860
1860
  p((e) => e),
1861
1861
  f(this.logReceived(t))
1862
1862
  );
@@ -1876,8 +1876,8 @@ class xt {
1876
1876
  sendLogMessage(t, e) {
1877
1877
  if (!this.isEmbedded())
1878
1878
  throw new h(this.currentContext);
1879
- const r = "LOG", i = this.createMessage(r, !1);
1880
- i.level = t, i.message = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
1879
+ const r = "LOG", s = this.createMessage(r, !1);
1880
+ s.level = t, s.message = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
1881
1881
  }
1882
1882
  /**
1883
1883
  * Setup listener for {@link RequestLogsMessage}, which can be sent by a `Host` app to request
@@ -1896,7 +1896,7 @@ class xt {
1896
1896
  throw new h(this.currentContext);
1897
1897
  const t = "REQUEST LOGS";
1898
1898
  return this.incomingMessages$.pipe(
1899
- v((e) => e.type === t && e.target === "client"),
1899
+ g((e) => e.type === t && e.target === "client"),
1900
1900
  p((e) => e),
1901
1901
  f(this.logReceived(t))
1902
1902
  );
@@ -1917,8 +1917,8 @@ class xt {
1917
1917
  sendViewTransitionMessage(t, e) {
1918
1918
  if (!this.isEmbedded())
1919
1919
  throw new h(this.currentContext);
1920
- const r = "VIEW TRANSITION", i = this.createMessage(r, !1);
1921
- i.transitionType = t, i.targetView = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
1920
+ const r = "VIEW TRANSITION", s = this.createMessage(r, !1);
1921
+ s.transitionType = t, s.targetView = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
1922
1922
  }
1923
1923
  /**
1924
1924
  * Sends a {@link FileRequestMessage} to the Host app, to request a file by it's SHA256 hash.
@@ -1961,31 +1961,31 @@ class xt {
1961
1961
  * @returns An observable that either emits once if the result is `error` or `not found` or
1962
1962
  * emits as many times as the number of chunks in the file if the result is `success`.
1963
1963
  */
1964
- sendFileRequestMessage(t, e, r, i, s) {
1964
+ sendFileRequestMessage(t, e, r, s, i) {
1965
1965
  if (!this.isEmbedded())
1966
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)
1967
+ const o = "FILE REQUEST", a = this.createMessage(o);
1968
+ if (a.fileId = t, a.fileHash = e.toLowerCase(), a.intent = r, a.maxChunkSizeInBytes = i, r === "attachment") {
1969
+ if (!s)
1970
1970
  throw new x(
1971
1971
  "streamId",
1972
- i,
1972
+ s,
1973
1973
  "streamId is required for attachment intent"
1974
1974
  );
1975
- c.streamId = i;
1975
+ a.streamId = s;
1976
1976
  }
1977
- this.logCreated(o, c);
1978
- let a = 0;
1977
+ this.logCreated(o, a);
1978
+ let c = 0;
1979
1979
  const u = this.incomingMessages$.pipe(
1980
- v(
1981
- (l) => l.type === o && l.replyTo === c.id
1980
+ g(
1981
+ (l) => l.type === o && l.replyTo === a.id
1982
1982
  ),
1983
1983
  f(this.logReceived(o)),
1984
- f(() => a++),
1984
+ f(() => c++),
1985
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
+ wt((l) => l.result === "success" && c < l.totalChunks, !0)
1987
1987
  );
1988
- return this.port2.postMessage(c), this.logSent(o, c), u;
1988
+ return this.port2.postMessage(a), this.logSent(o, a), u;
1989
1989
  }
1990
1990
  /**
1991
1991
  * Sends a {@link FileRequestMessageReply} to the Host app, to reply to a
@@ -2009,11 +2009,11 @@ class xt {
2009
2009
  sendFileRequestMessageReply(t, e) {
2010
2010
  if (!this.isEmbedded())
2011
2011
  throw new h(this.currentContext);
2012
- const r = "FILE REQUEST", i = Object.assign(
2012
+ const r = "FILE REQUEST", s = Object.assign(
2013
2013
  e,
2014
2014
  this.createMessage(r, !1, t.id)
2015
2015
  );
2016
- this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
2016
+ this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
2017
2017
  }
2018
2018
  /**
2019
2019
  * Setup a listener for {@link FileRequestMessage}, which can be sent by a Host app to request a
@@ -2032,7 +2032,7 @@ class xt {
2032
2032
  throw new h(this.currentContext);
2033
2033
  const t = "FILE REQUEST";
2034
2034
  return this.incomingMessages$.pipe(
2035
- v(
2035
+ g(
2036
2036
  (e) => e.type === t && e.target === "client" && e.replyTo === null
2037
2037
  ),
2038
2038
  p((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
@@ -2061,11 +2061,11 @@ class xt {
2061
2061
  *
2062
2062
  * @returns This method returns void.
2063
2063
  */
2064
- sendFileSelectionMessage(t = "attachment", e, r, i, s, o) {
2064
+ sendFileSelectionMessage(t = "attachment", e, r, s, i, o) {
2065
2065
  if (!this.isEmbedded())
2066
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") {
2067
+ const a = "FILE SELECTION", c = this.createMessage(a);
2068
+ if (c.intent = t, c.maxCount = s, c.maxFileSizeInBytes = i, c.mimeTypes = o, t === "attachment") {
2069
2069
  if (!e)
2070
2070
  throw new x(
2071
2071
  "streamId",
@@ -2078,21 +2078,21 @@ class xt {
2078
2078
  r,
2079
2079
  "correlationId is required for attachment intent"
2080
2080
  );
2081
- a.streamId = e, a.correlationId = r;
2081
+ c.streamId = e, c.correlationId = r;
2082
2082
  }
2083
- this.logCreated(c, a);
2083
+ this.logCreated(a, c);
2084
2084
  const u = this.incomingMessages$.pipe(
2085
- v(
2086
- (l) => l.type === c && l.replyTo === a.id
2085
+ g(
2086
+ (l) => l.type === a && l.replyTo === c.id
2087
2087
  ),
2088
2088
  p((l) => {
2089
2089
  var d;
2090
- return l.files = (d = l.files) == null ? void 0 : d.map((y) => (y.fileHash = y.fileHash.toLowerCase(), y)), l;
2090
+ return l.files = (d = l.files) == null ? void 0 : d.map((y) => (y.original.fileHash = y.original.fileHash.toLowerCase(), y.preview && (y.preview.fileHash = y.preview.fileHash.toLowerCase()), y)), l;
2091
2091
  }),
2092
- f(this.logReceived(c)),
2092
+ f(this.logReceived(a)),
2093
2093
  m(1)
2094
2094
  );
2095
- return this.port2.postMessage(a), this.logSent(c, a), u;
2095
+ return this.port2.postMessage(c), this.logSent(a, c), u;
2096
2096
  }
2097
2097
  /**
2098
2098
  * Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
@@ -2108,21 +2108,128 @@ class xt {
2108
2108
  * @returns An observable which emits a {@link FileDownloadMessageReply} instance containing the
2109
2109
  * file ID and the file size in bytes. Emits once.
2110
2110
  */
2111
- sendFileDownloadMessage(t, e, r, i) {
2111
+ sendFileDownloadMessage(t, e, r, s) {
2112
2112
  if (!this.isEmbedded())
2113
2113
  throw new h(this.currentContext);
2114
- const s = "FILE DOWNLOAD", o = this.createMessage(s);
2115
- o.url = t, o.key = e, o.fileName = r, o.mimeType = i, this.logCreated(s, o);
2116
- const c = this.incomingMessages$.pipe(
2117
- v((a) => a.type === s && a.replyTo === o.id),
2114
+ const i = "FILE DOWNLOAD", o = this.createMessage(i);
2115
+ o.url = t, o.key = e, o.fileName = r, o.mimeType = s, this.logCreated(i, o);
2116
+ const a = this.incomingMessages$.pipe(
2117
+ g((c) => c.type === i && c.replyTo === o.id),
2118
+ f(this.logReceived(i)),
2119
+ p((c) => c),
2120
+ m(1)
2121
+ );
2122
+ return this.port2.postMessage(o), this.logSent(i, o), a;
2123
+ }
2124
+ /**
2125
+ * Sends a {@link FileDownloadProgressQueryMessage} to the Host app, to query the progress of a
2126
+ * file download that was initiated by a {@link FileDownloadMessage}.
2127
+ *
2128
+ * @remarks
2129
+ * The `fileHash` parameter is the SHA256 hash of the decrypted file, which is used as an
2130
+ * identifier for the target file in the `Host` app. The `url` parameter is the URL of the file
2131
+ * being downloaded.
2132
+ *
2133
+ * The `Host` app should reply with a {@link FileDownloadProgressUpdateMessage} containing the
2134
+ * progress of the file download.
2135
+ *
2136
+ * @param correlationId - A UUIDv4 string to identify the message this file was attached to.
2137
+ * @param fileHash - SHA256 hash of the decrypted file.
2138
+ * @param url - URL of the file being downloaded.
2139
+ * @returns An observable which emits a {@link FileDownloadProgressUpdateMessage} instance
2140
+ * containing the progress of the file download. Emits once.
2141
+ */
2142
+ sendFileDownloadProgressQueryMessage(t, e, r) {
2143
+ if (!this.isEmbedded())
2144
+ throw new h(this.currentContext);
2145
+ const s = "FILE DOWNLOAD PROGRESS QUERY", i = this.createMessage(
2146
+ s,
2147
+ !0
2148
+ );
2149
+ i.correlationId = t, i.fileHash = e.toLowerCase(), i.url = r, this.logCreated(s, i);
2150
+ const o = this.incomingMessages$.pipe(
2151
+ g(
2152
+ (a) => a.type === "FILE DOWNLOAD PROGRESS UPDATE" && a.replyTo === i.id
2153
+ ),
2118
2154
  f(this.logReceived(s)),
2119
- p((a) => a),
2155
+ p((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),
2120
2156
  m(1)
2121
2157
  );
2122
- return this.port2.postMessage(o), this.logSent(s, o), c;
2158
+ return this.port2.postMessage(i), this.logSent(s, i), o;
2123
2159
  }
2124
- sendFileUploadMessage() {
2125
- throw new Error("Not implemented");
2160
+ /**
2161
+ * Setup listener for {@link FileDownloadProgressQueryMessage}, which can be sent by a `Host` app
2162
+ * to update the progress of a file download which was initiated by a {@link FileOpenMessage}.
2163
+ *
2164
+ * @returns An observable which emits a {@link FileDownloadProgressUpdateMessage} instance
2165
+ * containing the progress of the file download. Emits once.
2166
+ */
2167
+ onFileDownloadProgressUpdateMessage() {
2168
+ if (!this.isEmbedded())
2169
+ throw new h(this.currentContext);
2170
+ const t = "FILE DOWNLOAD PROGRESS UPDATE";
2171
+ return this.incomingMessages$.pipe(
2172
+ g(
2173
+ (e) => e.type === t && e.target === "client" && e.replyTo === null
2174
+ ),
2175
+ p((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),
2176
+ f(this.logReceived(t))
2177
+ );
2178
+ }
2179
+ /**
2180
+ * Sends a {@link FileUploadProgressQueryMessage} to the Host app, to query the progress of a file
2181
+ * upload.
2182
+ *
2183
+ * @remarks
2184
+ * The `host` app should reply with a {@link FileUploadProgressUpdateMessage} containing the
2185
+ * progress of the file upload.
2186
+ *
2187
+ * @param correlationId - A UUIDv4 string to identify the message this file was attached to.
2188
+ * @param fileHash - SHA256 hash of the decrypted file.
2189
+ * @param fileId - ID of the original file being uploaded.
2190
+ * @returns An observable which emits a {@link FileUploadProgressUpdateMessage} instance
2191
+ * containing the progress of the file upload. Emits once.
2192
+ */
2193
+ sendFileUploadProgressQueryMessage(t, e, r) {
2194
+ if (!this.isEmbedded())
2195
+ throw new h(this.currentContext);
2196
+ const s = "FILE UPLOAD PROGRESS QUERY", i = this.createMessage(
2197
+ s,
2198
+ !0
2199
+ );
2200
+ i.correlationId = t, i.fileHash = e.toLowerCase(), i.fileId = r, this.logCreated(s, i);
2201
+ const o = this.incomingMessages$.pipe(
2202
+ g(
2203
+ (a) => a.type === "FILE DOWNLOAD PROGRESS UPDATE" && a.replyTo === i.id
2204
+ ),
2205
+ f(this.logReceived(s)),
2206
+ p((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),
2207
+ m(1)
2208
+ );
2209
+ return this.port2.postMessage(i), this.logSent(s, i), o;
2210
+ }
2211
+ /**
2212
+ * Setup listener for {@link FileUploadProgressQueryMessage}, which can be sent by a `Host` app to
2213
+ * update the progress of a file upload.
2214
+ *
2215
+ * @remarks
2216
+ * The `progressInBytesSent` and `fileSize` fields contain the combined size of the original file
2217
+ * and any preview that was generated.
2218
+ *
2219
+ * @returns An observable which emits a {@link FileUploadProgressUpdateMessage} instance
2220
+ * containing the progress of the file upload. Emits once.
2221
+ */
2222
+ onFileUploadProgressUpdateMessage() {
2223
+ if (!this.isEmbedded())
2224
+ throw new h(this.currentContext);
2225
+ const t = "FILE UPLOAD PROGRESS UPDATE";
2226
+ return this.incomingMessages$.pipe(
2227
+ g(
2228
+ (e) => e.type === t && e.target === "client" && e.replyTo === null
2229
+ ),
2230
+ p((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),
2231
+ f(this.logReceived(t))
2232
+ );
2126
2233
  }
2127
2234
  /**
2128
2235
  * Sends a {@link FileOpenMessage} to the Host app, to try and open a file the device may already
@@ -2141,13 +2248,34 @@ class xt {
2141
2248
  * @param key - _Optional_. Key used to encrypt the original attachment.
2142
2249
  * @param sender - _Optional_. The {@link ContactItem} of the sender of the file.
2143
2250
  *
2144
- * @returns This method returns void.
2251
+ * @returns An observable which emits a {@link FileOpenMessageReply} instance containing the
2252
+ * result of the request. Emits once.
2145
2253
  */
2146
- sendFileOpenMessage(t, e, r, i, s, o, c) {
2254
+ sendFileOpenMessage(t, e, r, s, i, o, a) {
2147
2255
  if (!this.isEmbedded())
2148
2256
  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);
2257
+ const c = "FILE OPEN", u = this.createMessage(c, !0);
2258
+ u.fileHash = t.toLowerCase(), u.fileName = e, u.streamId = r, u.url = s, u.correlationId = i, u.key = o, u.sender = a, this.logCreated(c, u);
2259
+ const l = this.incomingMessages$.pipe(
2260
+ g((d) => d.type === c && d.replyTo === u.id),
2261
+ f(this.logReceived(c)),
2262
+ p((d) => d),
2263
+ m(1)
2264
+ );
2265
+ return this.port2.postMessage(u), this.logSent(c, u), l;
2266
+ }
2267
+ /**
2268
+ * Sends a {@link CancelFileOpenMessage} to the Host app, to cancel opening or download of a file
2269
+ * that was initiated by a {@link FileOpenMessage} previously.
2270
+ *
2271
+ * @param correlationId - UUIDv4 string to identify the message this file was attached to.
2272
+ * @param fileHash - SHA256 hash of the file to cancel opening.
2273
+ */
2274
+ sendCancelFileOpenMessage(t, e) {
2275
+ if (!this.isEmbedded())
2276
+ throw new h(this.currentContext);
2277
+ const r = "CANCEL FILE OPEN", s = this.createMessage(r, !1);
2278
+ s.correlationId = t, s.fileHash = e.toLowerCase(), this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
2151
2279
  }
2152
2280
  /**
2153
2281
  * Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the
@@ -2167,15 +2295,15 @@ class xt {
2167
2295
  sendFileRemoveMessage(t, e) {
2168
2296
  if (!this.isEmbedded())
2169
2297
  throw new h(this.currentContext);
2170
- const r = "FILE REMOVE", i = this.createMessage(r, !0);
2171
- i.hash = t.toLowerCase(), i.streamId = e, this.logCreated(r, i);
2172
- const s = this.incomingMessages$.pipe(
2173
- v((o) => o.type === r && o.replyTo === i.id),
2298
+ const r = "FILE REMOVE", s = this.createMessage(r, !0);
2299
+ s.hash = t.toLowerCase(), s.streamId = e, this.logCreated(r, s);
2300
+ const i = this.incomingMessages$.pipe(
2301
+ g((o) => o.type === r && o.replyTo === s.id),
2174
2302
  f(this.logReceived(r)),
2175
2303
  p((o) => o),
2176
2304
  m(1)
2177
2305
  );
2178
- return this.port2.postMessage(i), this.logSent(r, i), s;
2306
+ return this.port2.postMessage(s), this.logSent(r, s), i;
2179
2307
  }
2180
2308
  /**
2181
2309
  * Sends a {@link AppResetMessage} to the Host app, to request logging out the user and resetting
@@ -2217,8 +2345,8 @@ class xt {
2217
2345
  sendMessageSentMessage(t, e) {
2218
2346
  if (!this.isEmbedded())
2219
2347
  throw new h(this.currentContext);
2220
- const r = "MESSAGE SENT", i = this.createMessage(r, !1);
2221
- i.streamId = t, i.correlationId = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
2348
+ const r = "MESSAGE SENT", s = this.createMessage(r, !1);
2349
+ s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
2222
2350
  }
2223
2351
  /**
2224
2352
  * Sends a {@link SendMessageMessage} to the Host app, to send a message to the specified stream.
@@ -2237,11 +2365,18 @@ class xt {
2237
2365
  *
2238
2366
  * @returns This method returns void.
2239
2367
  */
2240
- sendSendMessageMessage(t, e, r, i = "TEXT", s, o, c, a = !0, u) {
2368
+ sendSendMessageMessage(t, e, r, s = "TEXT", i, o, a, c = !0, u) {
2241
2369
  if (!this.isEmbedded())
2242
2370
  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);
2371
+ const l = "SEND MESSAGE", d = this.createMessage(l, !0);
2372
+ d.streamId = t, d.correlationId = e, d.body = r, d.messageType = s, d.mentions = i ?? [], d.attachments = (o == null ? void 0 : o.map((b) => b.toLowerCase())) ?? [], d.relatedMessageId = a, d.setCursors = c, d.threadId = u, this.logCreated(l, d);
2373
+ const y = this.incomingMessages$.pipe(
2374
+ g((b) => b.type === l && b.replyTo === d.id),
2375
+ f(this.logReceived(l)),
2376
+ p((b) => b),
2377
+ m(1)
2378
+ );
2379
+ return this.port2.postMessage(d), this.logSent(l, d), y;
2245
2380
  }
2246
2381
  /**
2247
2382
  * Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being
@@ -2255,8 +2390,66 @@ class xt {
2255
2390
  sendCancelSendMessageMessage(t, e) {
2256
2391
  if (!this.isEmbedded())
2257
2392
  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);
2393
+ const r = "CANCEL SEND MESSAGE", s = this.createMessage(r, !1);
2394
+ s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
2395
+ }
2396
+ /**
2397
+ * Sends a {@link DeleteMessageMessage} to the Host app, to notify deletion of a message from the
2398
+ * specified stream.
2399
+ *
2400
+ * @param correlationId - UUIDv4 string of the message to be deleted.
2401
+ * @param streamId - ID of the stream the message was sent to.
2402
+ */
2403
+ sendDeleteMessageMessage(t, e) {
2404
+ if (!this.isEmbedded())
2405
+ throw new h(this.currentContext);
2406
+ const r = "DELETE MESSAGE", s = this.createMessage(r, !1);
2407
+ s.correlationId = t, s.streamId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
2408
+ }
2409
+ /**
2410
+ * Sends a {@link SendMessageStatusQueryMessage} to the Host app, to query the status of a message
2411
+ * that was sent via a {@link SendMessageMessage}.
2412
+ *
2413
+ * @remarks
2414
+ * This message expects a {@link SendMessageStatusUpdateMessage} in response.
2415
+ *
2416
+ * @param correlationId - A UUIDv4 string to identify the message that was sent.
2417
+ * @param streamId - The ID of the message stream the message was sent to.
2418
+ *
2419
+ * @returns An observable which emits a {@link SendMessageStatusUpdateMessage} instance containing
2420
+ * the status of the message. Emits once.
2421
+ */
2422
+ sendSendMessageStatusQueryMessage(t, e) {
2423
+ if (!this.isEmbedded())
2424
+ throw new h(this.currentContext);
2425
+ const r = "SEND MESSAGE STATUS QUERY", s = this.createMessage(r, !0);
2426
+ s.correlationId = t, s.streamId = e, this.logCreated(r, s);
2427
+ const i = this.incomingMessages$.pipe(
2428
+ g(
2429
+ (o) => o.type === "SEND MESSAGE STATUS UPDATE" && o.replyTo === s.id
2430
+ ),
2431
+ f(this.logReceived(r)),
2432
+ p((o) => o),
2433
+ m(1)
2434
+ );
2435
+ return this.port2.postMessage(s), this.logSent(r, s), i;
2436
+ }
2437
+ /**
2438
+ * Setup a listener for {@link SendMessageStatusUpdateMessage}, which can be sent by a Host app to
2439
+ * notify the `Client` app of the status of a message that was sent via a
2440
+ * {@link SendMessageMessage}.
2441
+ *
2442
+ * @returns An observable that emits whenever a {@link SendMessageStatusUpdateMessage} is received
2443
+ */
2444
+ onSendMessageStatusUpdateMessage() {
2445
+ if (!this.isEmbedded())
2446
+ throw new h(this.currentContext);
2447
+ const t = "SEND MESSAGE STATUS UPDATE";
2448
+ return this.incomingMessages$.pipe(
2449
+ g((e) => e.type === t && e.target === "client" && e.replyTo === null),
2450
+ p((e) => e),
2451
+ f(this.logReceived(t))
2452
+ );
2260
2453
  }
2261
2454
  /**
2262
2455
  * Sends a {@link SipCallMessage} to the Host app to initiate a SIP call between the current user
@@ -2311,7 +2504,7 @@ class xt {
2311
2504
  }
2312
2505
  logReceived(t, e) {
2313
2506
  e && It(e) && (e = { ...e, data: "..." });
2314
- const r = (i) => this.logService.debug(`[IPC] Received ${t} message`, i);
2507
+ const r = (s) => this.logService.debug(`[IPC] Received ${t} message`, s);
2315
2508
  return e && r(e), r;
2316
2509
  }
2317
2510
  logSent(t, e) {
@@ -2346,18 +2539,18 @@ class xt {
2346
2539
  }
2347
2540
  generateId(t = 8, e = !1) {
2348
2541
  let r = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
2349
- const i = [];
2542
+ const s = [];
2350
2543
  e && (r = r.substr(0, r.indexOf("Q")));
2351
- for (let s = 0; s < t; s++)
2352
- i.push(r[Math.floor(Math.random() * r.length)]);
2353
- return i.join("");
2544
+ for (let i = 0; i < t; i++)
2545
+ s.push(r[Math.floor(Math.random() * r.length)]);
2546
+ return s.join("");
2354
2547
  }
2355
2548
  }
2356
2549
  function It(n) {
2357
2550
  return n.type === "FILE REQUEST" && n.replyTo !== null;
2358
2551
  }
2359
- const _t = ["2.0"];
2360
- class Rt {
2552
+ const Tt = ["2.0"];
2553
+ class Pt {
2361
2554
  /**
2362
2555
  * A class that manages the IPC communication between the `Client` and the `Host`.
2363
2556
  *
@@ -2380,7 +2573,7 @@ class Rt {
2380
2573
  I(this, "logger");
2381
2574
  I(this, "helper");
2382
2575
  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());
2576
+ this.logger = t ?? console, this.helper = new xt(Tt, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(w.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(w.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(w.PushToken, /* @__PURE__ */ new Set());
2384
2577
  }
2385
2578
  /**
2386
2579
  * Returns whether the app is running inside a native WebView (`host` context) or as a
@@ -2407,7 +2600,7 @@ class Rt {
2407
2600
  * @returns A promise with {@link IPCContext} the app is running under.
2408
2601
  */
2409
2602
  async determineContext() {
2410
- const t = await _(this.helper.determineContext(), {
2603
+ const t = await T(this.helper.determineContext(), {
2411
2604
  defaultValue: "guest"
2412
2605
  });
2413
2606
  return this.evaluateContext(t);
@@ -2416,24 +2609,24 @@ class Rt {
2416
2609
  * Initiates the IPC handshake with the `Host` app.
2417
2610
  */
2418
2611
  initiateConnection() {
2419
- return _(
2612
+ return T(
2420
2613
  this.helper.openBridge().pipe(
2421
2614
  Ze((t) => {
2422
2615
  this.helper.onBadgeQueryMessage().subscribe((e) => {
2423
2616
  var r;
2424
2617
  this.logger.debug("Received Badge Query: ", e);
2425
- for (const i of ((r = this.listeners.get(b.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
2426
- i();
2618
+ for (const s of ((r = this.listeners.get(w.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
2619
+ s();
2427
2620
  }), this.helper.onLifecycleMessage().subscribe((e) => {
2428
2621
  var r;
2429
2622
  this.logger.debug("Received Lifecycle Event: ", e);
2430
- for (const i of ((r = this.listeners.get(b.Lifecycle)) == null ? void 0 : r.values()) ?? [])
2431
- i(e.eventName, e.payload);
2623
+ for (const s of ((r = this.listeners.get(w.Lifecycle)) == null ? void 0 : r.values()) ?? [])
2624
+ s(e.eventName, e.payload);
2432
2625
  }), this.helper.onPushTokenMessage().subscribe((e) => {
2433
2626
  var r;
2434
2627
  this.logger.debug("Received Push Token: ", e);
2435
- for (const i of ((r = this.listeners.get(b.PushToken)) == null ? void 0 : r.values()) ?? [])
2436
- i(e.pushToken, e.appId, e.selector);
2628
+ for (const s of ((r = this.listeners.get(w.PushToken)) == null ? void 0 : r.values()) ?? [])
2629
+ s(e.pushToken, e.appId, e.selector);
2437
2630
  }), this.cloudId = t.cloudId, this.host = t.host;
2438
2631
  }),
2439
2632
  O(() => {
@@ -2441,9 +2634,9 @@ class Rt {
2441
2634
  )
2442
2635
  );
2443
2636
  }
2444
- selectContacts(t, e, r, i) {
2637
+ selectContacts(t, e, r, s) {
2445
2638
  this.logger.debug("Selecting Contacts: ", ...arguments);
2446
- let s;
2639
+ let i;
2447
2640
  if (e === "multi") {
2448
2641
  if (!r || !Array.isArray(r))
2449
2642
  throw new x(
@@ -2451,15 +2644,15 @@ class Rt {
2451
2644
  r,
2452
2645
  "currentContacts is required for group streams"
2453
2646
  );
2454
- i || (i = "cloudUsername"), s = this.helper.selectContacts(
2647
+ s || (s = "cloudUsername"), i = this.helper.selectContacts(
2455
2648
  t.toString(),
2456
2649
  "group",
2457
- i,
2650
+ s,
2458
2651
  r
2459
2652
  );
2460
2653
  } else
2461
- r ? i = r : i = "cloudUsername", s = this.helper.selectContacts(t.toString(), "direct", i);
2462
- return _(s.pipe(O((o) => o.contacts)));
2654
+ r ? s = r : s = "cloudUsername", i = this.helper.selectContacts(t.toString(), "direct", s);
2655
+ return T(i.pipe(O((o) => o.contacts)));
2463
2656
  }
2464
2657
  /**
2465
2658
  * Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
@@ -2471,7 +2664,7 @@ class Rt {
2471
2664
  * Host's contact list.
2472
2665
  */
2473
2666
  matchContacts(t) {
2474
- return this.logger.debug("Match Contacts: ", t), _(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
2667
+ return this.logger.debug("Match Contacts: ", t), T(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
2475
2668
  }
2476
2669
  /**
2477
2670
  * Requests the `Host` app to provide the Push Token for the current device.
@@ -2479,7 +2672,7 @@ class Rt {
2479
2672
  * @returns A promise with the Push Token as `string`.
2480
2673
  */
2481
2674
  requestPushToken() {
2482
- return this.logger.debug("Requesting Push Token"), _(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
2675
+ return this.logger.debug("Requesting Push Token"), T(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
2483
2676
  }
2484
2677
  /**
2485
2678
  * Sends the current badge count to the `Host` app.
@@ -2529,9 +2722,9 @@ class Rt {
2529
2722
  */
2530
2723
  onBadgeQueryRequest(t) {
2531
2724
  var e;
2532
- return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(b.BadgeQuery)) == null || e.add(t), () => {
2725
+ return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(w.BadgeQuery)) == null || e.add(t), () => {
2533
2726
  var r;
2534
- return (r = this.listeners.get(b.BadgeQuery)) == null ? void 0 : r.delete(t);
2727
+ return (r = this.listeners.get(w.BadgeQuery)) == null ? void 0 : r.delete(t);
2535
2728
  };
2536
2729
  }
2537
2730
  /**
@@ -2548,9 +2741,9 @@ class Rt {
2548
2741
  */
2549
2742
  onLifecycleEvent(t) {
2550
2743
  var e;
2551
- return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(b.Lifecycle)) == null || e.add(t), () => {
2744
+ return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(w.Lifecycle)) == null || e.add(t), () => {
2552
2745
  var r;
2553
- return (r = this.listeners.get(b.Lifecycle)) == null ? void 0 : r.delete(t);
2746
+ return (r = this.listeners.get(w.Lifecycle)) == null ? void 0 : r.delete(t);
2554
2747
  };
2555
2748
  }
2556
2749
  /**
@@ -2566,9 +2759,9 @@ class Rt {
2566
2759
  */
2567
2760
  onPushToken(t) {
2568
2761
  var e;
2569
- return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(b.PushToken)) == null || e.add(t), () => {
2762
+ return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(w.PushToken)) == null || e.add(t), () => {
2570
2763
  var r;
2571
- return (r = this.listeners.get(b.PushToken)) == null ? void 0 : r.delete(t);
2764
+ return (r = this.listeners.get(w.PushToken)) == null ? void 0 : r.delete(t);
2572
2765
  };
2573
2766
  }
2574
2767
  evaluateContext(t) {
@@ -2579,6 +2772,6 @@ class Rt {
2579
2772
  }
2580
2773
  }
2581
2774
  export {
2582
- b as IPCEvents,
2583
- Rt as IPCManager
2775
+ w as IPCEvents,
2776
+ Pt as IPCManager
2584
2777
  };