@acrobits/ipc-sdk 0.0.15 → 0.1.1

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,1541 +1,404 @@
1
- var Ar = Object.defineProperty;
2
- var Tr = (r, e, t) => e in r ? Ar(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var re = (r, e, t) => (Tr(r, typeof e != "symbol" ? e + "" : e, t), t), Cr = (r, e, t) => {
4
- if (!e.has(r))
5
- throw TypeError("Cannot " + t);
6
- };
7
- var vt = (r, e, t) => {
8
- if (e.has(r))
9
- throw TypeError("Cannot add the same private member more than once");
10
- e instanceof WeakSet ? e.add(r) : e.set(r, t);
11
- };
12
- var Fe = (r, e, t) => (Cr(r, e, "access private method"), t);
13
- var H = /* @__PURE__ */ ((r) => (r.BadgeQuery = "BADGE QUERY", r.HostInForeground = "HOST IN FOREGROUND", r))(H || {}), Nr = Object.defineProperty, xr = (r, e, t) => e in r ? Nr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, q = (r, e, t) => (xr(r, typeof e != "symbol" ? e + "" : e, t), t), We = { exports: {} };
14
- const Lr = "2.0.0", Zt = 256, Pr = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
15
- 9007199254740991, Mr = 16, _r = Zt - 6, Dr = [
16
- "major",
17
- "premajor",
18
- "minor",
19
- "preminor",
20
- "patch",
21
- "prepatch",
22
- "prerelease"
23
- ];
24
- var xe = {
25
- MAX_LENGTH: Zt,
26
- MAX_SAFE_COMPONENT_LENGTH: Mr,
27
- MAX_SAFE_BUILD_LENGTH: _r,
28
- MAX_SAFE_INTEGER: Pr,
29
- RELEASE_TYPES: Dr,
30
- SEMVER_SPEC_VERSION: Lr,
31
- FLAG_INCLUDE_PRERELEASE: 1,
32
- FLAG_LOOSE: 2
33
- };
34
- const Ur = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...r) => console.error("SEMVER", ...r) : () => {
35
- };
36
- var Le = Ur;
37
- (function(r, e) {
38
- const {
39
- MAX_SAFE_COMPONENT_LENGTH: t,
40
- MAX_SAFE_BUILD_LENGTH: n,
41
- MAX_LENGTH: i
42
- } = xe, s = Le;
43
- e = r.exports = {};
44
- const a = e.re = [], c = e.safeRe = [], o = e.src = [], l = e.t = {};
45
- let u = 0;
46
- const p = "[a-zA-Z0-9-]", w = [
47
- ["\\s", 1],
48
- ["\\d", i],
49
- [p, n]
50
- ], f = (R) => {
51
- for (const [D, Q] of w)
52
- R = R.split(`${D}*`).join(`${D}{0,${Q}}`).split(`${D}+`).join(`${D}{1,${Q}}`);
53
- return R;
54
- }, g = (R, D, Q) => {
55
- const L = f(D), W = u++;
56
- s(R, W, D), l[R] = W, o[W] = D, a[W] = new RegExp(D, Q ? "g" : void 0), c[W] = new RegExp(L, Q ? "g" : void 0);
57
- };
58
- g("NUMERICIDENTIFIER", "0|[1-9]\\d*"), g("NUMERICIDENTIFIERLOOSE", "\\d+"), g("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${p}*`), g("MAINVERSION", `(${o[l.NUMERICIDENTIFIER]})\\.(${o[l.NUMERICIDENTIFIER]})\\.(${o[l.NUMERICIDENTIFIER]})`), g("MAINVERSIONLOOSE", `(${o[l.NUMERICIDENTIFIERLOOSE]})\\.(${o[l.NUMERICIDENTIFIERLOOSE]})\\.(${o[l.NUMERICIDENTIFIERLOOSE]})`), g("PRERELEASEIDENTIFIER", `(?:${o[l.NUMERICIDENTIFIER]}|${o[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASEIDENTIFIERLOOSE", `(?:${o[l.NUMERICIDENTIFIERLOOSE]}|${o[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASE", `(?:-(${o[l.PRERELEASEIDENTIFIER]}(?:\\.${o[l.PRERELEASEIDENTIFIER]})*))`), g("PRERELEASELOOSE", `(?:-?(${o[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[l.PRERELEASEIDENTIFIERLOOSE]})*))`), g("BUILDIDENTIFIER", `${p}+`), g("BUILD", `(?:\\+(${o[l.BUILDIDENTIFIER]}(?:\\.${o[l.BUILDIDENTIFIER]})*))`), g("FULLPLAIN", `v?${o[l.MAINVERSION]}${o[l.PRERELEASE]}?${o[l.BUILD]}?`), g("FULL", `^${o[l.FULLPLAIN]}$`), g("LOOSEPLAIN", `[v=\\s]*${o[l.MAINVERSIONLOOSE]}${o[l.PRERELEASELOOSE]}?${o[l.BUILD]}?`), g("LOOSE", `^${o[l.LOOSEPLAIN]}$`), g("GTLT", "((?:<|>)?=?)"), g("XRANGEIDENTIFIERLOOSE", `${o[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), g("XRANGEIDENTIFIER", `${o[l.NUMERICIDENTIFIER]}|x|X|\\*`), g("XRANGEPLAIN", `[v=\\s]*(${o[l.XRANGEIDENTIFIER]})(?:\\.(${o[l.XRANGEIDENTIFIER]})(?:\\.(${o[l.XRANGEIDENTIFIER]})(?:${o[l.PRERELEASE]})?${o[l.BUILD]}?)?)?`), g("XRANGEPLAINLOOSE", `[v=\\s]*(${o[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[l.XRANGEIDENTIFIERLOOSE]})(?:${o[l.PRERELEASELOOSE]})?${o[l.BUILD]}?)?)?`), g("XRANGE", `^${o[l.GTLT]}\\s*${o[l.XRANGEPLAIN]}$`), g("XRANGELOOSE", `^${o[l.GTLT]}\\s*${o[l.XRANGEPLAINLOOSE]}$`), g("COERCE", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?(?:$|[^\\d])`), g("COERCERTL", o[l.COERCE], !0), g("LONETILDE", "(?:~>?)"), g("TILDETRIM", `(\\s*)${o[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", g("TILDE", `^${o[l.LONETILDE]}${o[l.XRANGEPLAIN]}$`), g("TILDELOOSE", `^${o[l.LONETILDE]}${o[l.XRANGEPLAINLOOSE]}$`), g("LONECARET", "(?:\\^)"), g("CARETTRIM", `(\\s*)${o[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", g("CARET", `^${o[l.LONECARET]}${o[l.XRANGEPLAIN]}$`), g("CARETLOOSE", `^${o[l.LONECARET]}${o[l.XRANGEPLAINLOOSE]}$`), g("COMPARATORLOOSE", `^${o[l.GTLT]}\\s*(${o[l.LOOSEPLAIN]})$|^$`), g("COMPARATOR", `^${o[l.GTLT]}\\s*(${o[l.FULLPLAIN]})$|^$`), g("COMPARATORTRIM", `(\\s*)${o[l.GTLT]}\\s*(${o[l.LOOSEPLAIN]}|${o[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", g("HYPHENRANGE", `^\\s*(${o[l.XRANGEPLAIN]})\\s+-\\s+(${o[l.XRANGEPLAIN]})\\s*$`), g("HYPHENRANGELOOSE", `^\\s*(${o[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[l.XRANGEPLAINLOOSE]})\\s*$`), g("STAR", "(<|>)?=?\\s*\\*"), g("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), g("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
59
- })(We, We.exports);
60
- var ve = We.exports;
61
- const Fr = Object.freeze({ loose: !0 }), jr = Object.freeze({}), Gr = (r) => r ? typeof r != "object" ? Fr : r : jr;
62
- var it = Gr;
63
- const gt = /^[0-9]+$/, er = (r, e) => {
64
- const t = gt.test(r), n = gt.test(e);
65
- return t && n && (r = +r, e = +e), r === e ? 0 : t && !n ? -1 : n && !t ? 1 : r < e ? -1 : 1;
66
- }, kr = (r, e) => er(e, r);
67
- var tr = {
68
- compareIdentifiers: er,
69
- rcompareIdentifiers: kr
70
- };
71
- const me = Le, { MAX_LENGTH: mt, MAX_SAFE_INTEGER: Ee } = xe, { safeRe: Et, t: yt } = ve, Vr = it, { compareIdentifiers: ne } = tr;
72
- let Hr = class k {
73
- constructor(e, t) {
74
- if (t = Vr(t), e instanceof k) {
75
- if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
76
- return e;
77
- e = e.version;
78
- } else if (typeof e != "string")
79
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
80
- if (e.length > mt)
81
- throw new TypeError(
82
- `version is longer than ${mt} characters`
83
- );
84
- me("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
85
- const n = e.trim().match(t.loose ? Et[yt.LOOSE] : Et[yt.FULL]);
86
- if (!n)
87
- throw new TypeError(`Invalid Version: ${e}`);
88
- if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > Ee || this.major < 0)
89
- throw new TypeError("Invalid major version");
90
- if (this.minor > Ee || this.minor < 0)
91
- throw new TypeError("Invalid minor version");
92
- if (this.patch > Ee || this.patch < 0)
93
- throw new TypeError("Invalid patch version");
94
- n[4] ? this.prerelease = n[4].split(".").map((i) => {
95
- if (/^[0-9]+$/.test(i)) {
96
- const s = +i;
97
- if (s >= 0 && s < Ee)
98
- return s;
99
- }
100
- return i;
101
- }) : this.prerelease = [], this.build = n[5] ? n[5].split(".") : [], this.format();
102
- }
103
- format() {
104
- return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
105
- }
106
- toString() {
107
- return this.version;
108
- }
109
- compare(e) {
110
- if (me("SemVer.compare", this.version, this.options, e), !(e instanceof k)) {
111
- if (typeof e == "string" && e === this.version)
112
- return 0;
113
- e = new k(e, this.options);
114
- }
115
- return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
116
- }
117
- compareMain(e) {
118
- return e instanceof k || (e = new k(e, this.options)), ne(this.major, e.major) || ne(this.minor, e.minor) || ne(this.patch, e.patch);
119
- }
120
- comparePre(e) {
121
- if (e instanceof k || (e = new k(e, this.options)), this.prerelease.length && !e.prerelease.length)
122
- return -1;
123
- if (!this.prerelease.length && e.prerelease.length)
124
- return 1;
125
- if (!this.prerelease.length && !e.prerelease.length)
126
- return 0;
127
- let t = 0;
128
- do {
129
- const n = this.prerelease[t], i = e.prerelease[t];
130
- if (me("prerelease compare", t, n, i), n === void 0 && i === void 0)
131
- return 0;
132
- if (i === void 0)
133
- return 1;
134
- if (n === void 0)
135
- return -1;
136
- if (n !== i)
137
- return ne(n, i);
138
- } while (++t);
139
- }
140
- compareBuild(e) {
141
- e instanceof k || (e = new k(e, this.options));
142
- let t = 0;
143
- do {
144
- const n = this.build[t], i = e.build[t];
145
- if (me("prerelease compare", t, n, i), n === void 0 && i === void 0)
146
- return 0;
147
- if (i === void 0)
148
- return 1;
149
- if (n === void 0)
150
- return -1;
151
- if (n !== i)
152
- return ne(n, i);
153
- } while (++t);
154
- }
155
- // preminor will bump the version up to the next minor release, and immediately
156
- // down to pre-release. premajor and prepatch work the same way.
157
- inc(e, t, n) {
158
- switch (e) {
159
- case "premajor":
160
- this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, n);
161
- break;
162
- case "preminor":
163
- this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t, n);
164
- break;
165
- case "prepatch":
166
- this.prerelease.length = 0, this.inc("patch", t, n), this.inc("pre", t, n);
167
- break;
168
- case "prerelease":
169
- this.prerelease.length === 0 && this.inc("patch", t, n), this.inc("pre", t, n);
170
- break;
171
- case "major":
172
- (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
173
- break;
174
- case "minor":
175
- (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
176
- break;
177
- case "patch":
178
- this.prerelease.length === 0 && this.patch++, this.prerelease = [];
179
- break;
180
- case "pre": {
181
- const i = Number(n) ? 1 : 0;
182
- if (!t && n === !1)
183
- throw new Error("invalid increment argument: identifier is empty");
184
- if (this.prerelease.length === 0)
185
- this.prerelease = [i];
186
- else {
187
- let s = this.prerelease.length;
188
- for (; --s >= 0; )
189
- typeof this.prerelease[s] == "number" && (this.prerelease[s]++, s = -2);
190
- if (s === -1) {
191
- if (t === this.prerelease.join(".") && n === !1)
192
- throw new Error("invalid increment argument: identifier already exists");
193
- this.prerelease.push(i);
194
- }
195
- }
196
- if (t) {
197
- let s = [t, i];
198
- n === !1 && (s = [t]), ne(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = s) : this.prerelease = s;
199
- }
200
- break;
201
- }
202
- default:
203
- throw new Error(`invalid increment argument: ${e}`);
204
- }
205
- return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
206
- }
207
- };
208
- var _ = Hr;
209
- const bt = _, Xr = (r, e, t = !1) => {
210
- if (r instanceof bt)
211
- return r;
212
- try {
213
- return new bt(r, e);
214
- } catch (n) {
215
- if (!t)
216
- return null;
217
- throw n;
218
- }
219
- };
220
- var oe = Xr;
221
- const Br = oe, qr = (r, e) => {
222
- const t = Br(r, e);
223
- return t ? t.version : null;
224
- };
225
- var Yr = qr;
226
- const zr = oe, Qr = (r, e) => {
227
- const t = zr(r.trim().replace(/^[=v]+/, ""), e);
228
- return t ? t.version : null;
229
- };
230
- var Wr = Qr;
231
- const wt = _, Jr = (r, e, t, n, i) => {
232
- typeof t == "string" && (i = n, n = t, t = void 0);
233
- try {
234
- return new wt(
235
- r instanceof wt ? r.version : r,
236
- t
237
- ).inc(e, n, i).version;
238
- } catch {
239
- return null;
240
- }
241
- };
242
- var Kr = Jr;
243
- const Rt = oe, Zr = (r, e) => {
244
- const t = Rt(r, null, !0), n = Rt(e, null, !0), i = t.compare(n);
245
- if (i === 0)
246
- return null;
247
- const s = i > 0, a = s ? t : n, c = s ? n : t, o = !!a.prerelease.length;
248
- if (c.prerelease.length && !o)
249
- return !c.patch && !c.minor ? "major" : a.patch ? "patch" : a.minor ? "minor" : "major";
250
- const l = o ? "pre" : "";
251
- return t.major !== n.major ? l + "major" : t.minor !== n.minor ? l + "minor" : t.patch !== n.patch ? l + "patch" : "prerelease";
252
- };
253
- var en = Zr;
254
- const tn = _, rn = (r, e) => new tn(r, e).major;
255
- var nn = rn;
256
- const sn = _, on = (r, e) => new sn(r, e).minor;
257
- var an = on;
258
- const ln = _, cn = (r, e) => new ln(r, e).patch;
259
- var un = cn;
260
- const hn = oe, pn = (r, e) => {
261
- const t = hn(r, e);
262
- return t && t.prerelease.length ? t.prerelease : null;
263
- };
264
- var fn = pn;
265
- const It = _, dn = (r, e, t) => new It(r, t).compare(new It(e, t));
266
- var j = dn;
267
- const vn = j, gn = (r, e, t) => vn(e, r, t);
268
- var mn = gn;
269
- const En = j, yn = (r, e) => En(r, e, !0);
270
- var bn = yn;
271
- const $t = _, wn = (r, e, t) => {
272
- const n = new $t(r, t), i = new $t(e, t);
273
- return n.compare(i) || n.compareBuild(i);
274
- };
275
- var st = wn;
276
- const Rn = st, In = (r, e) => r.sort((t, n) => Rn(t, n, e));
277
- var $n = In;
278
- const Sn = st, On = (r, e) => r.sort((t, n) => Sn(n, t, e));
279
- var An = On;
280
- const Tn = j, Cn = (r, e, t) => Tn(r, e, t) > 0;
281
- var Pe = Cn;
282
- const Nn = j, xn = (r, e, t) => Nn(r, e, t) < 0;
283
- var ot = xn;
284
- const Ln = j, Pn = (r, e, t) => Ln(r, e, t) === 0;
285
- var rr = Pn;
286
- const Mn = j, _n = (r, e, t) => Mn(r, e, t) !== 0;
287
- var nr = _n;
288
- const Dn = j, Un = (r, e, t) => Dn(r, e, t) >= 0;
289
- var at = Un;
290
- const Fn = j, jn = (r, e, t) => Fn(r, e, t) <= 0;
291
- var lt = jn;
292
- const Gn = rr, kn = nr, Vn = Pe, Hn = at, Xn = ot, Bn = lt, qn = (r, e, t, n) => {
293
- switch (e) {
294
- case "===":
295
- return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r === t;
296
- case "!==":
297
- return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r !== t;
298
- case "":
299
- case "=":
300
- case "==":
301
- return Gn(r, t, n);
302
- case "!=":
303
- return kn(r, t, n);
304
- case ">":
305
- return Vn(r, t, n);
306
- case ">=":
307
- return Hn(r, t, n);
308
- case "<":
309
- return Xn(r, t, n);
310
- case "<=":
311
- return Bn(r, t, n);
312
- default:
313
- throw new TypeError(`Invalid operator: ${e}`);
314
- }
315
- };
316
- var ir = qn;
317
- const Yn = _, zn = oe, { safeRe: ye, t: be } = ve, Qn = (r, e) => {
318
- if (r instanceof Yn)
319
- return r;
320
- if (typeof r == "number" && (r = String(r)), typeof r != "string")
321
- return null;
322
- e = e || {};
323
- let t = null;
324
- if (!e.rtl)
325
- t = r.match(ye[be.COERCE]);
326
- else {
327
- let n;
328
- for (; (n = ye[be.COERCERTL].exec(r)) && (!t || t.index + t[0].length !== r.length); )
329
- (!t || n.index + n[0].length !== t.index + t[0].length) && (t = n), ye[be.COERCERTL].lastIndex = n.index + n[1].length + n[2].length;
330
- ye[be.COERCERTL].lastIndex = -1;
331
- }
332
- return t === null ? null : zn(`${t[2]}.${t[3] || "0"}.${t[4] || "0"}`, e);
333
- };
334
- var Wn = Qn, St, Ot;
335
- function Jn() {
336
- return Ot || (Ot = 1, St = function(r) {
337
- r.prototype[Symbol.iterator] = function* () {
338
- for (let e = this.head; e; e = e.next)
339
- yield e.value;
340
- };
341
- }), St;
342
- }
343
- var Kn = $;
344
- $.Node = ee;
345
- $.create = $;
346
- function $(r) {
347
- var e = this;
348
- if (e instanceof $ || (e = new $()), e.tail = null, e.head = null, e.length = 0, r && typeof r.forEach == "function")
349
- r.forEach(function(i) {
350
- e.push(i);
351
- });
352
- else if (arguments.length > 0)
353
- for (var t = 0, n = arguments.length; t < n; t++)
354
- e.push(arguments[t]);
355
- return e;
356
- }
357
- $.prototype.removeNode = function(r) {
358
- if (r.list !== this)
359
- throw new Error("removing node which does not belong to this list");
360
- var e = r.next, t = r.prev;
361
- return e && (e.prev = t), t && (t.next = e), r === this.head && (this.head = e), r === this.tail && (this.tail = t), r.list.length--, r.next = null, r.prev = null, r.list = null, e;
362
- };
363
- $.prototype.unshiftNode = function(r) {
364
- if (r !== this.head) {
365
- r.list && r.list.removeNode(r);
366
- var e = this.head;
367
- r.list = this, r.next = e, e && (e.prev = r), this.head = r, this.tail || (this.tail = r), this.length++;
368
- }
369
- };
370
- $.prototype.pushNode = function(r) {
371
- if (r !== this.tail) {
372
- r.list && r.list.removeNode(r);
373
- var e = this.tail;
374
- r.list = this, r.prev = e, e && (e.next = r), this.tail = r, this.head || (this.head = r), this.length++;
375
- }
376
- };
377
- $.prototype.push = function() {
378
- for (var r = 0, e = arguments.length; r < e; r++)
379
- ei(this, arguments[r]);
380
- return this.length;
381
- };
382
- $.prototype.unshift = function() {
383
- for (var r = 0, e = arguments.length; r < e; r++)
384
- ti(this, arguments[r]);
385
- return this.length;
386
- };
387
- $.prototype.pop = function() {
388
- if (this.tail) {
389
- var r = this.tail.value;
390
- return this.tail = this.tail.prev, this.tail ? this.tail.next = null : this.head = null, this.length--, r;
391
- }
392
- };
393
- $.prototype.shift = function() {
394
- if (this.head) {
395
- var r = this.head.value;
396
- return this.head = this.head.next, this.head ? this.head.prev = null : this.tail = null, this.length--, r;
397
- }
398
- };
399
- $.prototype.forEach = function(r, e) {
400
- e = e || this;
401
- for (var t = this.head, n = 0; t !== null; n++)
402
- r.call(e, t.value, n, this), t = t.next;
403
- };
404
- $.prototype.forEachReverse = function(r, e) {
405
- e = e || this;
406
- for (var t = this.tail, n = this.length - 1; t !== null; n--)
407
- r.call(e, t.value, n, this), t = t.prev;
408
- };
409
- $.prototype.get = function(r) {
410
- for (var e = 0, t = this.head; t !== null && e < r; e++)
411
- t = t.next;
412
- if (e === r && t !== null)
413
- return t.value;
414
- };
415
- $.prototype.getReverse = function(r) {
416
- for (var e = 0, t = this.tail; t !== null && e < r; e++)
417
- t = t.prev;
418
- if (e === r && t !== null)
419
- return t.value;
420
- };
421
- $.prototype.map = function(r, e) {
422
- e = e || this;
423
- for (var t = new $(), n = this.head; n !== null; )
424
- t.push(r.call(e, n.value, this)), n = n.next;
425
- return t;
426
- };
427
- $.prototype.mapReverse = function(r, e) {
428
- e = e || this;
429
- for (var t = new $(), n = this.tail; n !== null; )
430
- t.push(r.call(e, n.value, this)), n = n.prev;
431
- return t;
432
- };
433
- $.prototype.reduce = function(r, e) {
434
- var t, n = this.head;
435
- if (arguments.length > 1)
436
- t = e;
437
- else if (this.head)
438
- n = this.head.next, t = this.head.value;
439
- else
440
- throw new TypeError("Reduce of empty list with no initial value");
441
- for (var i = 0; n !== null; i++)
442
- t = r(t, n.value, i), n = n.next;
443
- return t;
444
- };
445
- $.prototype.reduceReverse = function(r, e) {
446
- var t, n = this.tail;
447
- if (arguments.length > 1)
448
- t = e;
449
- else if (this.tail)
450
- n = this.tail.prev, t = this.tail.value;
451
- else
452
- throw new TypeError("Reduce of empty list with no initial value");
453
- for (var i = this.length - 1; n !== null; i--)
454
- t = r(t, n.value, i), n = n.prev;
455
- return t;
456
- };
457
- $.prototype.toArray = function() {
458
- for (var r = new Array(this.length), e = 0, t = this.head; t !== null; e++)
459
- r[e] = t.value, t = t.next;
460
- return r;
461
- };
462
- $.prototype.toArrayReverse = function() {
463
- for (var r = new Array(this.length), e = 0, t = this.tail; t !== null; e++)
464
- r[e] = t.value, t = t.prev;
465
- return r;
466
- };
467
- $.prototype.slice = function(r, e) {
468
- e = e || this.length, e < 0 && (e += this.length), r = r || 0, r < 0 && (r += this.length);
469
- var t = new $();
470
- if (e < r || e < 0)
471
- return t;
472
- r < 0 && (r = 0), e > this.length && (e = this.length);
473
- for (var n = 0, i = this.head; i !== null && n < r; n++)
474
- i = i.next;
475
- for (; i !== null && n < e; n++, i = i.next)
476
- t.push(i.value);
477
- return t;
478
- };
479
- $.prototype.sliceReverse = function(r, e) {
480
- e = e || this.length, e < 0 && (e += this.length), r = r || 0, r < 0 && (r += this.length);
481
- var t = new $();
482
- if (e < r || e < 0)
483
- return t;
484
- r < 0 && (r = 0), e > this.length && (e = this.length);
485
- for (var n = this.length, i = this.tail; i !== null && n > e; n--)
486
- i = i.prev;
487
- for (; i !== null && n > r; n--, i = i.prev)
488
- t.push(i.value);
489
- return t;
490
- };
491
- $.prototype.splice = function(r, e, ...t) {
492
- r > this.length && (r = this.length - 1), r < 0 && (r = this.length + r);
493
- for (var n = 0, i = this.head; i !== null && n < r; n++)
494
- i = i.next;
495
- for (var s = [], n = 0; i && n < e; n++)
496
- s.push(i.value), i = this.removeNode(i);
497
- i === null && (i = this.tail), i !== this.head && i !== this.tail && (i = i.prev);
498
- for (var n = 0; n < t.length; n++)
499
- i = Zn(this, i, t[n]);
500
- return s;
501
- };
502
- $.prototype.reverse = function() {
503
- for (var r = this.head, e = this.tail, t = r; t !== null; t = t.prev) {
504
- var n = t.prev;
505
- t.prev = t.next, t.next = n;
506
- }
507
- return this.head = e, this.tail = r, this;
508
- };
509
- function Zn(r, e, t) {
510
- var n = e === r.head ? new ee(t, null, e, r) : new ee(t, e, e.next, r);
511
- return n.next === null && (r.tail = n), n.prev === null && (r.head = n), r.length++, n;
512
- }
513
- function ei(r, e) {
514
- r.tail = new ee(e, r.tail, null, r), r.head || (r.head = r.tail), r.length++;
515
- }
516
- function ti(r, e) {
517
- r.head = new ee(e, null, r.head, r), r.tail || (r.tail = r.head), r.length++;
518
- }
519
- function ee(r, e, t, n) {
520
- if (!(this instanceof ee))
521
- return new ee(r, e, t, n);
522
- this.list = n, this.value = r, e ? (e.next = this, this.prev = e) : this.prev = null, t ? (t.prev = this, this.next = t) : this.next = null;
523
- }
524
- try {
525
- Jn()($);
526
- } catch {
527
- }
528
- const ri = Kn, J = Symbol("max"), B = Symbol("length"), ie = Symbol("lengthCalculator"), he = Symbol("allowStale"), K = Symbol("maxAge"), X = Symbol("dispose"), At = Symbol("noDisposeOnSet"), x = Symbol("lruList"), F = Symbol("cache"), sr = Symbol("updateAgeOnGet"), je = () => 1;
529
- class ni {
530
- constructor(e) {
531
- if (typeof e == "number" && (e = { max: e }), e || (e = {}), e.max && (typeof e.max != "number" || e.max < 0))
532
- throw new TypeError("max must be a non-negative number");
533
- this[J] = e.max || 1 / 0;
534
- const t = e.length || je;
535
- if (this[ie] = typeof t != "function" ? je : t, this[he] = e.stale || !1, e.maxAge && typeof e.maxAge != "number")
536
- throw new TypeError("maxAge must be a number");
537
- this[K] = e.maxAge || 0, this[X] = e.dispose, this[At] = e.noDisposeOnSet || !1, this[sr] = e.updateAgeOnGet || !1, this.reset();
538
- }
539
- // resize the cache when the max changes.
540
- set max(e) {
541
- if (typeof e != "number" || e < 0)
542
- throw new TypeError("max must be a non-negative number");
543
- this[J] = e || 1 / 0, le(this);
544
- }
545
- get max() {
546
- return this[J];
547
- }
548
- set allowStale(e) {
549
- this[he] = !!e;
550
- }
551
- get allowStale() {
552
- return this[he];
553
- }
554
- set maxAge(e) {
555
- if (typeof e != "number")
556
- throw new TypeError("maxAge must be a non-negative number");
557
- this[K] = e, le(this);
558
- }
559
- get maxAge() {
560
- return this[K];
561
- }
562
- // resize the cache when the lengthCalculator changes.
563
- set lengthCalculator(e) {
564
- typeof e != "function" && (e = je), e !== this[ie] && (this[ie] = e, this[B] = 0, this[x].forEach((t) => {
565
- t.length = this[ie](t.value, t.key), this[B] += t.length;
566
- })), le(this);
567
- }
568
- get lengthCalculator() {
569
- return this[ie];
570
- }
571
- get length() {
572
- return this[B];
573
- }
574
- get itemCount() {
575
- return this[x].length;
576
- }
577
- rforEach(e, t) {
578
- t = t || this;
579
- for (let n = this[x].tail; n !== null; ) {
580
- const i = n.prev;
581
- Tt(this, e, n, t), n = i;
582
- }
583
- }
584
- forEach(e, t) {
585
- t = t || this;
586
- for (let n = this[x].head; n !== null; ) {
587
- const i = n.next;
588
- Tt(this, e, n, t), n = i;
589
- }
590
- }
591
- keys() {
592
- return this[x].toArray().map((e) => e.key);
593
- }
594
- values() {
595
- return this[x].toArray().map((e) => e.value);
596
- }
597
- reset() {
598
- this[X] && this[x] && this[x].length && this[x].forEach((e) => this[X](e.key, e.value)), this[F] = /* @__PURE__ */ new Map(), this[x] = new ri(), this[B] = 0;
599
- }
600
- dump() {
601
- return this[x].map((e) => Oe(this, e) ? !1 : {
602
- k: e.key,
603
- v: e.value,
604
- e: e.now + (e.maxAge || 0)
605
- }).toArray().filter((e) => e);
606
- }
607
- dumpLru() {
608
- return this[x];
609
- }
610
- set(e, t, n) {
611
- if (n = n || this[K], n && typeof n != "number")
612
- throw new TypeError("maxAge must be a number");
613
- const i = n ? Date.now() : 0, s = this[ie](t, e);
614
- if (this[F].has(e)) {
615
- if (s > this[J])
616
- return se(this, this[F].get(e)), !1;
617
- const c = this[F].get(e).value;
618
- return this[X] && (this[At] || this[X](e, c.value)), c.now = i, c.maxAge = n, c.value = t, this[B] += s - c.length, c.length = s, this.get(e), le(this), !0;
619
- }
620
- const a = new ii(e, t, s, i, n);
621
- return a.length > this[J] ? (this[X] && this[X](e, t), !1) : (this[B] += a.length, this[x].unshift(a), this[F].set(e, this[x].head), le(this), !0);
622
- }
623
- has(e) {
624
- if (!this[F].has(e))
625
- return !1;
626
- const t = this[F].get(e).value;
627
- return !Oe(this, t);
628
- }
629
- get(e) {
630
- return Ge(this, e, !0);
631
- }
632
- peek(e) {
633
- return Ge(this, e, !1);
634
- }
635
- pop() {
636
- const e = this[x].tail;
637
- return e ? (se(this, e), e.value) : null;
638
- }
639
- del(e) {
640
- se(this, this[F].get(e));
641
- }
642
- load(e) {
643
- this.reset();
644
- const t = Date.now();
645
- for (let n = e.length - 1; n >= 0; n--) {
646
- const i = e[n], s = i.e || 0;
647
- if (s === 0)
648
- this.set(i.k, i.v);
649
- else {
650
- const a = s - t;
651
- a > 0 && this.set(i.k, i.v, a);
652
- }
653
- }
654
- }
655
- prune() {
656
- this[F].forEach((e, t) => Ge(this, t, !1));
657
- }
658
- }
659
- const Ge = (r, e, t) => {
660
- const n = r[F].get(e);
661
- if (n) {
662
- const i = n.value;
663
- if (Oe(r, i)) {
664
- if (se(r, n), !r[he])
665
- return;
666
- } else
667
- t && (r[sr] && (n.value.now = Date.now()), r[x].unshiftNode(n));
668
- return i.value;
669
- }
670
- }, Oe = (r, e) => {
671
- if (!e || !e.maxAge && !r[K])
672
- return !1;
673
- const t = Date.now() - e.now;
674
- return e.maxAge ? t > e.maxAge : r[K] && t > r[K];
675
- }, le = (r) => {
676
- if (r[B] > r[J])
677
- for (let e = r[x].tail; r[B] > r[J] && e !== null; ) {
678
- const t = e.prev;
679
- se(r, e), e = t;
680
- }
681
- }, se = (r, e) => {
682
- if (e) {
683
- const t = e.value;
684
- r[X] && r[X](t.key, t.value), r[B] -= t.length, r[F].delete(t.key), r[x].removeNode(e);
685
- }
686
- };
687
- class ii {
688
- constructor(e, t, n, i, s) {
689
- this.key = e, this.value = t, this.length = n, this.now = i, this.maxAge = s || 0;
690
- }
691
- }
692
- const Tt = (r, e, t, n) => {
693
- let i = t.value;
694
- Oe(r, i) && (se(r, t), r[he] || (i = void 0)), i && e.call(n, i.value, i.key, r);
695
- };
696
- var si = ni, ke, Ct;
697
- function G() {
698
- if (Ct)
699
- return ke;
700
- Ct = 1;
701
- class r {
702
- constructor(h, y) {
703
- if (y = n(y), h instanceof r)
704
- return h.loose === !!y.loose && h.includePrerelease === !!y.includePrerelease ? h : new r(h.raw, y);
705
- if (h instanceof i)
706
- return this.raw = h.value, this.set = [[h]], this.format(), this;
707
- if (this.options = y, this.loose = !!y.loose, this.includePrerelease = !!y.includePrerelease, this.raw = h.trim().split(/\s+/).join(" "), this.set = this.raw.split("||").map((m) => this.parseRange(m.trim())).filter((m) => m.length), !this.set.length)
708
- throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
709
- if (this.set.length > 1) {
710
- const m = this.set[0];
711
- if (this.set = this.set.filter((E) => !g(E[0])), this.set.length === 0)
712
- this.set = [m];
713
- else if (this.set.length > 1) {
714
- for (const E of this.set)
715
- if (E.length === 1 && R(E[0])) {
716
- this.set = [E];
717
- break;
718
- }
719
- }
720
- }
721
- this.format();
722
- }
723
- format() {
724
- return this.range = this.set.map((h) => h.join(" ").trim()).join("||").trim(), this.range;
725
- }
726
- toString() {
727
- return this.range;
728
- }
729
- parseRange(h) {
730
- const y = ((this.options.includePrerelease && w) | (this.options.loose && f)) + ":" + h, m = t.get(y);
731
- if (m)
732
- return m;
733
- const E = this.options.loose, v = E ? c[o.HYPHENRANGELOOSE] : c[o.HYPHENRANGE];
734
- h = h.replace(v, Sr(this.options.includePrerelease)), s("hyphen replace", h), h = h.replace(c[o.COMPARATORTRIM], l), s("comparator trim", h), h = h.replace(c[o.TILDETRIM], u), s("tilde trim", h), h = h.replace(c[o.CARETTRIM], p), s("caret trim", h);
735
- let b = h.split(" ").map((A) => Q(A, this.options)).join(" ").split(/\s+/).map((A) => $r(A, this.options));
736
- E && (b = b.filter((A) => (s("loose invalid filter", A, this.options), !!A.match(c[o.COMPARATORLOOSE])))), s("range list", b);
737
- const S = /* @__PURE__ */ new Map(), I = b.map((A) => new i(A, this.options));
738
- for (const A of I) {
739
- if (g(A))
740
- return [A];
741
- S.set(A.value, A);
742
- }
743
- S.size > 1 && S.has("") && S.delete("");
744
- const O = [...S.values()];
745
- return t.set(y, O), O;
746
- }
747
- intersects(h, y) {
748
- if (!(h instanceof r))
749
- throw new TypeError("a Range is required");
750
- return this.set.some((m) => D(m, y) && h.set.some((E) => D(E, y) && m.every((v) => E.every((b) => v.intersects(b, y)))));
751
- }
752
- // if ANY of the sets match ALL of its comparators, then pass
753
- test(h) {
754
- if (!h)
755
- return !1;
756
- if (typeof h == "string")
757
- try {
758
- h = new a(h, this.options);
759
- } catch {
760
- return !1;
761
- }
762
- for (let y = 0; y < this.set.length; y++)
763
- if (Or(this.set[y], h, this.options))
764
- return !0;
765
- return !1;
766
- }
767
- }
768
- ke = r;
769
- const e = si, t = new e({ max: 1e3 }), n = it, i = Me(), s = Le, a = _, {
770
- safeRe: c,
771
- t: o,
772
- comparatorTrimReplace: l,
773
- tildeTrimReplace: u,
774
- caretTrimReplace: p
775
- } = ve, { FLAG_INCLUDE_PRERELEASE: w, FLAG_LOOSE: f } = xe, g = (d) => d.value === "<0.0.0-0", R = (d) => d.value === "", D = (d, h) => {
776
- let y = !0;
777
- const m = d.slice();
778
- let E = m.pop();
779
- for (; y && m.length; )
780
- y = m.every((v) => E.intersects(v, h)), E = m.pop();
781
- return y;
782
- }, Q = (d, h) => (s("comp", d, h), d = yr(d, h), s("caret", d), d = W(d, h), s("tildes", d), d = wr(d, h), s("xrange", d), d = Ir(d, h), s("stars", d), d), L = (d) => !d || d.toLowerCase() === "x" || d === "*", W = (d, h) => d.trim().split(/\s+/).map((y) => Er(y, h)).join(" "), Er = (d, h) => {
783
- const y = h.loose ? c[o.TILDELOOSE] : c[o.TILDE];
784
- return d.replace(y, (m, E, v, b, S) => {
785
- s("tilde", d, m, E, v, b, S);
786
- let I;
787
- return L(E) ? I = "" : L(v) ? I = `>=${E}.0.0 <${+E + 1}.0.0-0` : L(b) ? I = `>=${E}.${v}.0 <${E}.${+v + 1}.0-0` : S ? (s("replaceTilde pr", S), I = `>=${E}.${v}.${b}-${S} <${E}.${+v + 1}.0-0`) : I = `>=${E}.${v}.${b} <${E}.${+v + 1}.0-0`, s("tilde return", I), I;
788
- });
789
- }, yr = (d, h) => d.trim().split(/\s+/).map((y) => br(y, h)).join(" "), br = (d, h) => {
790
- s("caret", d, h);
791
- const y = h.loose ? c[o.CARETLOOSE] : c[o.CARET], m = h.includePrerelease ? "-0" : "";
792
- return d.replace(y, (E, v, b, S, I) => {
793
- s("caret", d, E, v, b, S, I);
794
- let O;
795
- return L(v) ? O = "" : L(b) ? O = `>=${v}.0.0${m} <${+v + 1}.0.0-0` : L(S) ? v === "0" ? O = `>=${v}.${b}.0${m} <${v}.${+b + 1}.0-0` : O = `>=${v}.${b}.0${m} <${+v + 1}.0.0-0` : I ? (s("replaceCaret pr", I), v === "0" ? b === "0" ? O = `>=${v}.${b}.${S}-${I} <${v}.${b}.${+S + 1}-0` : O = `>=${v}.${b}.${S}-${I} <${v}.${+b + 1}.0-0` : O = `>=${v}.${b}.${S}-${I} <${+v + 1}.0.0-0`) : (s("no pr"), v === "0" ? b === "0" ? O = `>=${v}.${b}.${S}${m} <${v}.${b}.${+S + 1}-0` : O = `>=${v}.${b}.${S}${m} <${v}.${+b + 1}.0-0` : O = `>=${v}.${b}.${S} <${+v + 1}.0.0-0`), s("caret return", O), O;
796
- });
797
- }, wr = (d, h) => (s("replaceXRanges", d, h), d.split(/\s+/).map((y) => Rr(y, h)).join(" ")), Rr = (d, h) => {
798
- d = d.trim();
799
- const y = h.loose ? c[o.XRANGELOOSE] : c[o.XRANGE];
800
- return d.replace(y, (m, E, v, b, S, I) => {
801
- s("xRange", d, m, E, v, b, S, I);
802
- const O = L(v), A = O || L(b), te = A || L(S), ae = te;
803
- return E === "=" && ae && (E = ""), I = h.includePrerelease ? "-0" : "", O ? E === ">" || E === "<" ? m = "<0.0.0-0" : m = "*" : E && ae ? (A && (b = 0), S = 0, E === ">" ? (E = ">=", A ? (v = +v + 1, b = 0, S = 0) : (b = +b + 1, S = 0)) : E === "<=" && (E = "<", A ? v = +v + 1 : b = +b + 1), E === "<" && (I = "-0"), m = `${E + v}.${b}.${S}${I}`) : A ? m = `>=${v}.0.0${I} <${+v + 1}.0.0-0` : te && (m = `>=${v}.${b}.0${I} <${v}.${+b + 1}.0-0`), s("xRange return", m), m;
804
- });
805
- }, Ir = (d, h) => (s("replaceStars", d, h), d.trim().replace(c[o.STAR], "")), $r = (d, h) => (s("replaceGTE0", d, h), d.trim().replace(c[h.includePrerelease ? o.GTE0PRE : o.GTE0], "")), Sr = (d) => (h, y, m, E, v, b, S, I, O, A, te, ae, mo) => (L(m) ? y = "" : L(E) ? y = `>=${m}.0.0${d ? "-0" : ""}` : L(v) ? y = `>=${m}.${E}.0${d ? "-0" : ""}` : b ? y = `>=${y}` : y = `>=${y}${d ? "-0" : ""}`, L(O) ? I = "" : L(A) ? I = `<${+O + 1}.0.0-0` : L(te) ? I = `<${O}.${+A + 1}.0-0` : ae ? I = `<=${O}.${A}.${te}-${ae}` : d ? I = `<${O}.${A}.${+te + 1}-0` : I = `<=${I}`, `${y} ${I}`.trim()), Or = (d, h, y) => {
806
- for (let m = 0; m < d.length; m++)
807
- if (!d[m].test(h))
808
- return !1;
809
- if (h.prerelease.length && !y.includePrerelease) {
810
- for (let m = 0; m < d.length; m++)
811
- if (s(d[m].semver), d[m].semver !== i.ANY && d[m].semver.prerelease.length > 0) {
812
- const E = d[m].semver;
813
- if (E.major === h.major && E.minor === h.minor && E.patch === h.patch)
814
- return !0;
815
- }
816
- return !1;
817
- }
818
- return !0;
819
- };
820
- return ke;
821
- }
822
- var Ve, Nt;
823
- function Me() {
824
- if (Nt)
825
- return Ve;
826
- Nt = 1;
827
- const r = Symbol("SemVer ANY");
828
- class e {
829
- static get ANY() {
830
- return r;
831
- }
832
- constructor(u, p) {
833
- if (p = t(p), u instanceof e) {
834
- if (u.loose === !!p.loose)
835
- return u;
836
- u = u.value;
837
- }
838
- u = u.trim().split(/\s+/).join(" "), a("comparator", u, p), this.options = p, this.loose = !!p.loose, this.parse(u), this.semver === r ? this.value = "" : this.value = this.operator + this.semver.version, a("comp", this);
839
- }
840
- parse(u) {
841
- const p = this.options.loose ? n[i.COMPARATORLOOSE] : n[i.COMPARATOR], w = u.match(p);
842
- if (!w)
843
- throw new TypeError(`Invalid comparator: ${u}`);
844
- this.operator = w[1] !== void 0 ? w[1] : "", this.operator === "=" && (this.operator = ""), w[2] ? this.semver = new c(w[2], this.options.loose) : this.semver = r;
845
- }
846
- toString() {
847
- return this.value;
848
- }
849
- test(u) {
850
- if (a("Comparator.test", u, this.options.loose), this.semver === r || u === r)
851
- return !0;
852
- if (typeof u == "string")
853
- try {
854
- u = new c(u, this.options);
855
- } catch {
856
- return !1;
857
- }
858
- return s(u, this.operator, this.semver, this.options);
859
- }
860
- intersects(u, p) {
861
- if (!(u instanceof e))
862
- throw new TypeError("a Comparator is required");
863
- return this.operator === "" ? this.value === "" ? !0 : new o(u.value, p).test(this.value) : u.operator === "" ? u.value === "" ? !0 : new o(this.value, p).test(u.semver) : (p = t(p), p.includePrerelease && (this.value === "<0.0.0-0" || u.value === "<0.0.0-0") || !p.includePrerelease && (this.value.startsWith("<0.0.0") || u.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && u.operator.startsWith(">") || this.operator.startsWith("<") && u.operator.startsWith("<") || this.semver.version === u.semver.version && this.operator.includes("=") && u.operator.includes("=") || s(this.semver, "<", u.semver, p) && this.operator.startsWith(">") && u.operator.startsWith("<") || s(this.semver, ">", u.semver, p) && this.operator.startsWith("<") && u.operator.startsWith(">")));
864
- }
865
- }
866
- Ve = e;
867
- const t = it, { safeRe: n, t: i } = ve, s = ir, a = Le, c = _, o = G();
868
- return Ve;
869
- }
870
- const oi = G(), ai = (r, e, t) => {
871
- try {
872
- e = new oi(e, t);
873
- } catch {
874
- return !1;
875
- }
876
- return e.test(r);
877
- };
878
- var _e = ai;
879
- const li = G(), ci = (r, e) => new li(r, e).set.map((t) => t.map((n) => n.value).join(" ").trim().split(" "));
880
- var ui = ci;
881
- const hi = _, pi = G(), fi = (r, e, t) => {
882
- let n = null, i = null, s = null;
883
- try {
884
- s = new pi(e, t);
885
- } catch {
886
- return null;
887
- }
888
- return r.forEach((a) => {
889
- s.test(a) && (!n || i.compare(a) === -1) && (n = a, i = new hi(n, t));
890
- }), n;
891
- };
892
- var di = fi;
893
- const vi = _, gi = G(), mi = (r, e, t) => {
894
- let n = null, i = null, s = null;
895
- try {
896
- s = new gi(e, t);
897
- } catch {
898
- return null;
899
- }
900
- return r.forEach((a) => {
901
- s.test(a) && (!n || i.compare(a) === 1) && (n = a, i = new vi(n, t));
902
- }), n;
903
- };
904
- var Ei = mi;
905
- const He = _, yi = G(), xt = Pe, bi = (r, e) => {
906
- r = new yi(r, e);
907
- let t = new He("0.0.0");
908
- if (r.test(t) || (t = new He("0.0.0-0"), r.test(t)))
909
- return t;
910
- t = null;
911
- for (let n = 0; n < r.set.length; ++n) {
912
- const i = r.set[n];
913
- let s = null;
914
- i.forEach((a) => {
915
- const c = new He(a.semver.version);
916
- switch (a.operator) {
917
- case ">":
918
- c.prerelease.length === 0 ? c.patch++ : c.prerelease.push(0), c.raw = c.format();
919
- case "":
920
- case ">=":
921
- (!s || xt(c, s)) && (s = c);
922
- break;
923
- case "<":
924
- case "<=":
925
- break;
926
- default:
927
- throw new Error(`Unexpected operation: ${a.operator}`);
928
- }
929
- }), s && (!t || xt(t, s)) && (t = s);
930
- }
931
- return t && r.test(t) ? t : null;
932
- };
933
- var wi = bi;
934
- const Ri = G(), Ii = (r, e) => {
935
- try {
936
- return new Ri(r, e).range || "*";
937
- } catch {
938
- return null;
939
- }
940
- };
941
- var $i = Ii;
942
- const Si = _, or = Me(), { ANY: Oi } = or, Ai = G(), Ti = _e, Lt = Pe, Pt = ot, Ci = lt, Ni = at, xi = (r, e, t, n) => {
943
- r = new Si(r, n), e = new Ai(e, n);
944
- let i, s, a, c, o;
945
- switch (t) {
946
- case ">":
947
- i = Lt, s = Ci, a = Pt, c = ">", o = ">=";
948
- break;
949
- case "<":
950
- i = Pt, s = Ni, a = Lt, c = "<", o = "<=";
951
- break;
952
- default:
953
- throw new TypeError('Must provide a hilo val of "<" or ">"');
954
- }
955
- if (Ti(r, e, n))
956
- return !1;
957
- for (let l = 0; l < e.set.length; ++l) {
958
- const u = e.set[l];
959
- let p = null, w = null;
960
- if (u.forEach((f) => {
961
- f.semver === Oi && (f = new or(">=0.0.0")), p = p || f, w = w || f, i(f.semver, p.semver, n) ? p = f : a(f.semver, w.semver, n) && (w = f);
962
- }), p.operator === c || p.operator === o || (!w.operator || w.operator === c) && s(r, w.semver) || w.operator === o && a(r, w.semver))
963
- return !1;
964
- }
965
- return !0;
966
- };
967
- var ct = xi;
968
- const Li = ct, Pi = (r, e, t) => Li(r, e, ">", t);
969
- var Mi = Pi;
970
- const _i = ct, Di = (r, e, t) => _i(r, e, "<", t);
971
- var Ui = Di;
972
- const Mt = G(), Fi = (r, e, t) => (r = new Mt(r, t), e = new Mt(e, t), r.intersects(e, t));
973
- var ji = Fi;
974
- const Gi = _e, ki = j;
975
- var Vi = (r, e, t) => {
976
- const n = [];
977
- let i = null, s = null;
978
- const a = r.sort((u, p) => ki(u, p, t));
979
- for (const u of a)
980
- Gi(u, e, t) ? (s = u, i || (i = u)) : (s && n.push([i, s]), s = null, i = null);
981
- i && n.push([i, null]);
982
- const c = [];
983
- for (const [u, p] of n)
984
- u === p ? c.push(u) : !p && u === a[0] ? c.push("*") : p ? u === a[0] ? c.push(`<=${p}`) : c.push(`${u} - ${p}`) : c.push(`>=${u}`);
985
- const o = c.join(" || "), l = typeof e.raw == "string" ? e.raw : String(e);
986
- return o.length < l.length ? o : e;
987
- };
988
- const _t = G(), ut = Me(), { ANY: Xe } = ut, ce = _e, ht = j, Hi = (r, e, t = {}) => {
989
- if (r === e)
990
- return !0;
991
- r = new _t(r, t), e = new _t(e, t);
992
- let n = !1;
993
- e:
994
- for (const i of r.set) {
995
- for (const s of e.set) {
996
- const a = Bi(i, s, t);
997
- if (n = n || a !== null, a)
998
- continue e;
999
- }
1000
- if (n)
1001
- return !1;
1002
- }
1003
- return !0;
1004
- }, Xi = [new ut(">=0.0.0-0")], Dt = [new ut(">=0.0.0")], Bi = (r, e, t) => {
1005
- if (r === e)
1006
- return !0;
1007
- if (r.length === 1 && r[0].semver === Xe) {
1008
- if (e.length === 1 && e[0].semver === Xe)
1009
- return !0;
1010
- t.includePrerelease ? r = Xi : r = Dt;
1011
- }
1012
- if (e.length === 1 && e[0].semver === Xe) {
1013
- if (t.includePrerelease)
1014
- return !0;
1015
- e = Dt;
1016
- }
1017
- const n = /* @__PURE__ */ new Set();
1018
- let i, s;
1019
- for (const f of r)
1020
- f.operator === ">" || f.operator === ">=" ? i = Ut(i, f, t) : f.operator === "<" || f.operator === "<=" ? s = Ft(s, f, t) : n.add(f.semver);
1021
- if (n.size > 1)
1022
- return null;
1023
- let a;
1024
- if (i && s && (a = ht(i.semver, s.semver, t), a > 0 || a === 0 && (i.operator !== ">=" || s.operator !== "<=")))
1025
- return null;
1026
- for (const f of n) {
1027
- if (i && !ce(f, String(i), t) || s && !ce(f, String(s), t))
1028
- return null;
1029
- for (const g of e)
1030
- if (!ce(f, String(g), t))
1031
- return !1;
1032
- return !0;
1033
- }
1034
- let c, o, l, u, p = s && !t.includePrerelease && s.semver.prerelease.length ? s.semver : !1, w = i && !t.includePrerelease && i.semver.prerelease.length ? i.semver : !1;
1035
- p && p.prerelease.length === 1 && s.operator === "<" && p.prerelease[0] === 0 && (p = !1);
1036
- for (const f of e) {
1037
- if (u = u || f.operator === ">" || f.operator === ">=", l = l || f.operator === "<" || f.operator === "<=", i) {
1038
- if (w && f.semver.prerelease && f.semver.prerelease.length && f.semver.major === w.major && f.semver.minor === w.minor && f.semver.patch === w.patch && (w = !1), f.operator === ">" || f.operator === ">=") {
1039
- if (c = Ut(i, f, t), c === f && c !== i)
1040
- return !1;
1041
- } else if (i.operator === ">=" && !ce(i.semver, String(f), t))
1042
- return !1;
1043
- }
1044
- if (s) {
1045
- if (p && f.semver.prerelease && f.semver.prerelease.length && f.semver.major === p.major && f.semver.minor === p.minor && f.semver.patch === p.patch && (p = !1), f.operator === "<" || f.operator === "<=") {
1046
- if (o = Ft(s, f, t), o === f && o !== s)
1047
- return !1;
1048
- } else if (s.operator === "<=" && !ce(s.semver, String(f), t))
1049
- return !1;
1050
- }
1051
- if (!f.operator && (s || i) && a !== 0)
1052
- return !1;
1053
- }
1054
- return !(i && l && !s && a !== 0 || s && u && !i && a !== 0 || w || p);
1055
- }, Ut = (r, e, t) => {
1056
- if (!r)
1057
- return e;
1058
- const n = ht(r.semver, e.semver, t);
1059
- return n > 0 ? r : n < 0 || e.operator === ">" && r.operator === ">=" ? e : r;
1060
- }, Ft = (r, e, t) => {
1061
- if (!r)
1062
- return e;
1063
- const n = ht(r.semver, e.semver, t);
1064
- return n < 0 ? r : n > 0 || e.operator === "<" && r.operator === "<=" ? e : r;
1065
- };
1066
- var qi = Hi;
1067
- const Be = ve, jt = xe, Yi = _, Gt = tr, zi = oe, Qi = Yr, Wi = Wr, Ji = Kr, Ki = en, Zi = nn, es = an, ts = un, rs = fn, ns = j, is = mn, ss = bn, os = st, as = $n, ls = An, cs = Pe, us = ot, hs = rr, ps = nr, fs = at, ds = lt, vs = ir, gs = Wn, ms = Me(), Es = G(), ys = _e, bs = ui, ws = di, Rs = Ei, Is = wi, $s = $i, Ss = ct, Os = Mi, As = Ui, Ts = ji, Cs = Vi, Ns = qi;
1068
- var C = {
1069
- parse: zi,
1070
- valid: Qi,
1071
- clean: Wi,
1072
- inc: Ji,
1073
- diff: Ki,
1074
- major: Zi,
1075
- minor: es,
1076
- patch: ts,
1077
- prerelease: rs,
1078
- compare: ns,
1079
- rcompare: is,
1080
- compareLoose: ss,
1081
- compareBuild: os,
1082
- sort: as,
1083
- rsort: ls,
1084
- gt: cs,
1085
- lt: us,
1086
- eq: hs,
1087
- neq: ps,
1088
- gte: fs,
1089
- lte: ds,
1090
- cmp: vs,
1091
- coerce: gs,
1092
- Comparator: ms,
1093
- Range: Es,
1094
- satisfies: ys,
1095
- toComparators: bs,
1096
- maxSatisfying: ws,
1097
- minSatisfying: Rs,
1098
- minVersion: Is,
1099
- validRange: $s,
1100
- outside: Ss,
1101
- gtr: Os,
1102
- ltr: As,
1103
- intersects: Ts,
1104
- simplifyRange: Cs,
1105
- subset: Ns,
1106
- SemVer: Yi,
1107
- re: Be.re,
1108
- src: Be.src,
1109
- tokens: Be.t,
1110
- SEMVER_SPEC_VERSION: jt.SEMVER_SPEC_VERSION,
1111
- RELEASE_TYPES: jt.RELEASE_TYPES,
1112
- compareIdentifiers: Gt.compareIdentifiers,
1113
- rcompareIdentifiers: Gt.rcompareIdentifiers
1114
- };
1115
- class N extends Error {
1116
- constructor(e) {
1117
- super(`Incorrect context (${e}). Cannot perform the requested operation.`), q(this, "context"), this.context = e;
1118
- }
1119
- }
1120
- class $e extends Error {
1121
- constructor(e, t, n) {
1122
- super(`Invalid parameter (${e}). ${n}`), this.param = e, this.value = t, this.reason = n;
1123
- }
1124
- }
1125
- class xs extends Error {
1126
- constructor(e, t) {
1127
- super(
1128
- `'streamId' value of "${e}" is different from what we expected ("${t}")`
1129
- ), this.streamId = e, this.expectedStreamId = t;
1130
- }
1131
- }
1132
- class kt extends Error {
1133
- constructor(e) {
1134
- super(`${e} needs to be initialized before it can be used.`);
1135
- }
1136
- }
1137
- class Vt extends Error {
1138
- constructor(e, t) {
1139
- let n = `Unsupported Protocol ${Array.isArray(e) ? "versions" : "version"}: (${e}).`;
1140
- t && (n += ` Minimum version supported is ${t}.`), super(n), this.version = e;
1141
- }
1142
- }
1143
- var Je = function(r, e) {
1144
- return Je = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) {
1145
- t.__proto__ = n;
1146
- } || function(t, n) {
1
+ var Ae = Object.defineProperty;
2
+ var Te = (r, t, e) => t in r ? Ae(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var _ = (r, t, e) => (Te(r, typeof t != "symbol" ? t + "" : t, e), e);
4
+ var C = /* @__PURE__ */ ((r) => (r.BadgeQuery = "BADGE QUERY", r.HostInForeground = "HOST IN FOREGROUND", r))(C || {}), z = function(r, t) {
5
+ return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
6
+ e.__proto__ = n;
7
+ } || function(e, n) {
1147
8
  for (var i in n)
1148
- Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
1149
- }, Je(r, e);
9
+ Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
10
+ }, z(r, t);
1150
11
  };
1151
- function z(r, e) {
1152
- if (typeof e != "function" && e !== null)
1153
- throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
1154
- Je(r, e);
1155
- function t() {
12
+ function x(r, t) {
13
+ if (typeof t != "function" && t !== null)
14
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
15
+ z(r, t);
16
+ function e() {
1156
17
  this.constructor = r;
1157
18
  }
1158
- r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
19
+ r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
1159
20
  }
1160
- function Ke(r) {
1161
- var e = typeof Symbol == "function" && Symbol.iterator, t = e && r[e], n = 0;
1162
- if (t)
1163
- return t.call(r);
21
+ function Q(r) {
22
+ var t = typeof Symbol == "function" && Symbol.iterator, e = t && r[t], n = 0;
23
+ if (e)
24
+ return e.call(r);
1164
25
  if (r && typeof r.length == "number")
1165
26
  return {
1166
27
  next: function() {
1167
28
  return r && n >= r.length && (r = void 0), { value: r && r[n++], done: !r };
1168
29
  }
1169
30
  };
1170
- throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
31
+ throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
1171
32
  }
1172
- function pe(r, e) {
1173
- var t = typeof Symbol == "function" && r[Symbol.iterator];
1174
- if (!t)
33
+ function M(r, t) {
34
+ var e = typeof Symbol == "function" && r[Symbol.iterator];
35
+ if (!e)
1175
36
  return r;
1176
- var n = t.call(r), i, s = [], a;
37
+ var n = e.call(r), i, o = [], s;
1177
38
  try {
1178
- for (; (e === void 0 || e-- > 0) && !(i = n.next()).done; )
1179
- s.push(i.value);
39
+ for (; (t === void 0 || t-- > 0) && !(i = n.next()).done; )
40
+ o.push(i.value);
1180
41
  } catch (c) {
1181
- a = { error: c };
42
+ s = { error: c };
1182
43
  } finally {
1183
44
  try {
1184
- i && !i.done && (t = n.return) && t.call(n);
45
+ i && !i.done && (e = n.return) && e.call(n);
1185
46
  } finally {
1186
- if (a)
1187
- throw a.error;
47
+ if (s)
48
+ throw s.error;
1188
49
  }
1189
50
  }
1190
- return s;
51
+ return o;
1191
52
  }
1192
- function fe(r, e, t) {
1193
- if (t || arguments.length === 2)
1194
- for (var n = 0, i = e.length, s; n < i; n++)
1195
- (s || !(n in e)) && (s || (s = Array.prototype.slice.call(e, 0, n)), s[n] = e[n]);
1196
- return r.concat(s || Array.prototype.slice.call(e));
53
+ function I(r, t, e) {
54
+ if (e || arguments.length === 2)
55
+ for (var n = 0, i = t.length, o; n < i; n++)
56
+ (o || !(n in t)) && (o || (o = Array.prototype.slice.call(t, 0, n)), o[n] = t[n]);
57
+ return r.concat(o || Array.prototype.slice.call(t));
1197
58
  }
1198
- function U(r) {
59
+ function b(r) {
1199
60
  return typeof r == "function";
1200
61
  }
1201
- function ar(r) {
1202
- var e = function(n) {
62
+ function Z(r) {
63
+ var t = function(n) {
1203
64
  Error.call(n), n.stack = new Error().stack;
1204
- }, t = r(e);
1205
- return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
65
+ }, e = r(t);
66
+ return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
1206
67
  }
1207
- var qe = ar(function(r) {
68
+ var k = Z(function(r) {
1208
69
  return function(e) {
1209
70
  r(this), this.message = e ? e.length + ` errors occurred during unsubscription:
1210
- ` + e.map(function(t, n) {
1211
- return n + 1 + ") " + t.toString();
71
+ ` + e.map(function(n, i) {
72
+ return i + 1 + ") " + n.toString();
1212
73
  }).join(`
1213
74
  `) : "", this.name = "UnsubscriptionError", this.errors = e;
1214
75
  };
1215
76
  });
1216
- function Ae(r, e) {
77
+ function j(r, t) {
1217
78
  if (r) {
1218
- var t = r.indexOf(e);
1219
- 0 <= t && r.splice(t, 1);
79
+ var e = r.indexOf(t);
80
+ 0 <= e && r.splice(e, 1);
1220
81
  }
1221
82
  }
1222
- var ge = function() {
1223
- function r(e) {
1224
- this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
83
+ var P = function() {
84
+ function r(t) {
85
+ this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
1225
86
  }
1226
87
  return r.prototype.unsubscribe = function() {
1227
- var e, t, n, i, s;
88
+ var t, e, n, i, o;
1228
89
  if (!this.closed) {
1229
90
  this.closed = !0;
1230
- var a = this._parentage;
1231
- if (a)
1232
- if (this._parentage = null, Array.isArray(a))
91
+ var s = this._parentage;
92
+ if (s)
93
+ if (this._parentage = null, Array.isArray(s))
1233
94
  try {
1234
- for (var c = Ke(a), o = c.next(); !o.done; o = c.next()) {
1235
- var l = o.value;
1236
- l.remove(this);
95
+ for (var c = Q(s), u = c.next(); !u.done; u = c.next()) {
96
+ var a = u.value;
97
+ a.remove(this);
1237
98
  }
1238
- } catch (R) {
1239
- e = { error: R };
99
+ } catch (l) {
100
+ t = { error: l };
1240
101
  } finally {
1241
102
  try {
1242
- o && !o.done && (t = c.return) && t.call(c);
103
+ u && !u.done && (e = c.return) && e.call(c);
1243
104
  } finally {
1244
- if (e)
1245
- throw e.error;
105
+ if (t)
106
+ throw t.error;
1246
107
  }
1247
108
  }
1248
109
  else
1249
- a.remove(this);
1250
- var u = this.initialTeardown;
1251
- if (U(u))
110
+ s.remove(this);
111
+ var d = this.initialTeardown;
112
+ if (b(d))
1252
113
  try {
1253
- u();
1254
- } catch (R) {
1255
- s = R instanceof qe ? R.errors : [R];
114
+ d();
115
+ } catch (l) {
116
+ o = l instanceof k ? l.errors : [l];
1256
117
  }
1257
- var p = this._finalizers;
1258
- if (p) {
118
+ var f = this._finalizers;
119
+ if (f) {
1259
120
  this._finalizers = null;
1260
121
  try {
1261
- for (var w = Ke(p), f = w.next(); !f.done; f = w.next()) {
1262
- var g = f.value;
122
+ for (var w = Q(f), y = w.next(); !y.done; y = w.next()) {
123
+ var L = y.value;
1263
124
  try {
1264
- Ht(g);
1265
- } catch (R) {
1266
- s = s ?? [], R instanceof qe ? s = fe(fe([], pe(s)), pe(R.errors)) : s.push(R);
125
+ ie(L);
126
+ } catch (l) {
127
+ o = o ?? [], l instanceof k ? o = I(I([], M(o)), M(l.errors)) : o.push(l);
1267
128
  }
1268
129
  }
1269
- } catch (R) {
1270
- n = { error: R };
130
+ } catch (l) {
131
+ n = { error: l };
1271
132
  } finally {
1272
133
  try {
1273
- f && !f.done && (i = w.return) && i.call(w);
134
+ y && !y.done && (i = w.return) && i.call(w);
1274
135
  } finally {
1275
136
  if (n)
1276
137
  throw n.error;
1277
138
  }
1278
139
  }
1279
140
  }
1280
- if (s)
1281
- throw new qe(s);
141
+ if (o)
142
+ throw new k(o);
1282
143
  }
1283
- }, r.prototype.add = function(e) {
1284
- var t;
1285
- if (e && e !== this)
144
+ }, r.prototype.add = function(t) {
145
+ var e;
146
+ if (t && t !== this)
1286
147
  if (this.closed)
1287
- Ht(e);
148
+ ie(t);
1288
149
  else {
1289
- if (e instanceof r) {
1290
- if (e.closed || e._hasParent(this))
150
+ if (t instanceof r) {
151
+ if (t.closed || t._hasParent(this))
1291
152
  return;
1292
- e._addParent(this);
153
+ t._addParent(this);
1293
154
  }
1294
- (this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(e);
155
+ (this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);
1295
156
  }
1296
- }, r.prototype._hasParent = function(e) {
1297
- var t = this._parentage;
1298
- return t === e || Array.isArray(t) && t.includes(e);
1299
- }, r.prototype._addParent = function(e) {
1300
- var t = this._parentage;
1301
- this._parentage = Array.isArray(t) ? (t.push(e), t) : t ? [t, e] : e;
1302
- }, r.prototype._removeParent = function(e) {
1303
- var t = this._parentage;
1304
- t === e ? this._parentage = null : Array.isArray(t) && Ae(t, e);
1305
- }, r.prototype.remove = function(e) {
1306
- var t = this._finalizers;
1307
- t && Ae(t, e), e instanceof r && e._removeParent(this);
157
+ }, r.prototype._hasParent = function(t) {
158
+ var e = this._parentage;
159
+ return e === t || Array.isArray(e) && e.includes(t);
160
+ }, r.prototype._addParent = function(t) {
161
+ var e = this._parentage;
162
+ this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
163
+ }, r.prototype._removeParent = function(t) {
164
+ var e = this._parentage;
165
+ e === t ? this._parentage = null : Array.isArray(e) && j(e, t);
166
+ }, r.prototype.remove = function(t) {
167
+ var e = this._finalizers;
168
+ e && j(e, t), t instanceof r && t._removeParent(this);
1308
169
  }, r.EMPTY = function() {
1309
- var e = new r();
1310
- return e.closed = !0, e;
170
+ var t = new r();
171
+ return t.closed = !0, t;
1311
172
  }(), r;
1312
- }(), lr = ge.EMPTY;
1313
- function cr(r) {
1314
- return r instanceof ge || r && "closed" in r && U(r.remove) && U(r.add) && U(r.unsubscribe);
173
+ }(), ye = P.EMPTY;
174
+ function me(r) {
175
+ return r instanceof P || r && "closed" in r && b(r.remove) && b(r.add) && b(r.unsubscribe);
1315
176
  }
1316
- function Ht(r) {
1317
- U(r) ? r() : r.unsubscribe();
177
+ function ie(r) {
178
+ b(r) ? r() : r.unsubscribe();
1318
179
  }
1319
- var ur = {
180
+ var we = {
1320
181
  onUnhandledError: null,
1321
182
  onStoppedNotification: null,
1322
183
  Promise: void 0,
1323
184
  useDeprecatedSynchronousErrorHandling: !1,
1324
185
  useDeprecatedNextContext: !1
1325
- }, Ls = {
1326
- setTimeout: function(r, e) {
1327
- for (var t = [], n = 2; n < arguments.length; n++)
1328
- t[n - 2] = arguments[n];
1329
- return setTimeout.apply(void 0, fe([r, e], pe(t)));
186
+ }, G = {
187
+ setTimeout: function(r, t) {
188
+ for (var e = [], n = 2; n < arguments.length; n++)
189
+ e[n - 2] = arguments[n];
190
+ var i = G.delegate;
191
+ return i != null && i.setTimeout ? i.setTimeout.apply(i, I([r, t], M(e))) : setTimeout.apply(void 0, I([r, t], M(e)));
1330
192
  },
1331
193
  clearTimeout: function(r) {
1332
- return clearTimeout(r);
194
+ var t = G.delegate;
195
+ return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(r);
1333
196
  },
1334
197
  delegate: void 0
1335
198
  };
1336
- function Ps(r) {
1337
- Ls.setTimeout(function() {
199
+ function Re(r) {
200
+ G.setTimeout(function() {
1338
201
  throw r;
1339
202
  });
1340
203
  }
1341
- function Xt() {
204
+ function oe() {
1342
205
  }
1343
- function Se(r) {
206
+ function U(r) {
1344
207
  r();
1345
208
  }
1346
- var pt = function(r) {
1347
- z(e, r);
1348
- function e(t) {
209
+ var ee = function(r) {
210
+ x(t, r);
211
+ function t(e) {
1349
212
  var n = r.call(this) || this;
1350
- return n.isStopped = !1, t ? (n.destination = t, cr(t) && t.add(n)) : n.destination = Us, n;
1351
- }
1352
- return e.create = function(t, n, i) {
1353
- return new Ze(t, n, i);
1354
- }, e.prototype.next = function(t) {
1355
- this.isStopped || this._next(t);
1356
- }, e.prototype.error = function(t) {
1357
- this.isStopped || (this.isStopped = !0, this._error(t));
1358
- }, e.prototype.complete = function() {
213
+ return n.isStopped = !1, e ? (n.destination = e, me(e) && e.add(n)) : n.destination = Ve, n;
214
+ }
215
+ return t.create = function(e, n, i) {
216
+ return new V(e, n, i);
217
+ }, t.prototype.next = function(e) {
218
+ this.isStopped || this._next(e);
219
+ }, t.prototype.error = function(e) {
220
+ this.isStopped || (this.isStopped = !0, this._error(e));
221
+ }, t.prototype.complete = function() {
1359
222
  this.isStopped || (this.isStopped = !0, this._complete());
1360
- }, e.prototype.unsubscribe = function() {
223
+ }, t.prototype.unsubscribe = function() {
1361
224
  this.closed || (this.isStopped = !0, r.prototype.unsubscribe.call(this), this.destination = null);
1362
- }, e.prototype._next = function(t) {
1363
- this.destination.next(t);
1364
- }, e.prototype._error = function(t) {
225
+ }, t.prototype._next = function(e) {
226
+ this.destination.next(e);
227
+ }, t.prototype._error = function(e) {
1365
228
  try {
1366
- this.destination.error(t);
229
+ this.destination.error(e);
1367
230
  } finally {
1368
231
  this.unsubscribe();
1369
232
  }
1370
- }, e.prototype._complete = function() {
233
+ }, t.prototype._complete = function() {
1371
234
  try {
1372
235
  this.destination.complete();
1373
236
  } finally {
1374
237
  this.unsubscribe();
1375
238
  }
1376
- }, e;
1377
- }(ge), Ms = Function.prototype.bind;
1378
- function Ye(r, e) {
1379
- return Ms.call(r, e);
239
+ }, t;
240
+ }(P), Ue = Function.prototype.bind;
241
+ function B(r, t) {
242
+ return Ue.call(r, t);
1380
243
  }
1381
- var _s = function() {
1382
- function r(e) {
1383
- this.partialObserver = e;
244
+ var $e = function() {
245
+ function r(t) {
246
+ this.partialObserver = t;
1384
247
  }
1385
- return r.prototype.next = function(e) {
1386
- var t = this.partialObserver;
1387
- if (t.next)
248
+ return r.prototype.next = function(t) {
249
+ var e = this.partialObserver;
250
+ if (e.next)
1388
251
  try {
1389
- t.next(e);
252
+ e.next(t);
1390
253
  } catch (n) {
1391
- we(n);
254
+ A(n);
1392
255
  }
1393
- }, r.prototype.error = function(e) {
1394
- var t = this.partialObserver;
1395
- if (t.error)
256
+ }, r.prototype.error = function(t) {
257
+ var e = this.partialObserver;
258
+ if (e.error)
1396
259
  try {
1397
- t.error(e);
260
+ e.error(t);
1398
261
  } catch (n) {
1399
- we(n);
262
+ A(n);
1400
263
  }
1401
264
  else
1402
- we(e);
265
+ A(t);
1403
266
  }, r.prototype.complete = function() {
1404
- var e = this.partialObserver;
1405
- if (e.complete)
267
+ var t = this.partialObserver;
268
+ if (t.complete)
1406
269
  try {
1407
- e.complete();
1408
- } catch (t) {
1409
- we(t);
270
+ t.complete();
271
+ } catch (e) {
272
+ A(e);
1410
273
  }
1411
274
  }, r;
1412
- }(), Ze = function(r) {
1413
- z(e, r);
1414
- function e(t, n, i) {
1415
- var s = r.call(this) || this, a;
1416
- if (U(t) || !t)
1417
- a = {
1418
- next: t ?? void 0,
275
+ }(), V = function(r) {
276
+ x(t, r);
277
+ function t(e, n, i) {
278
+ var o = r.call(this) || this, s;
279
+ if (b(e) || !e)
280
+ s = {
281
+ next: e ?? void 0,
1419
282
  error: n ?? void 0,
1420
283
  complete: i ?? void 0
1421
284
  };
1422
285
  else {
1423
286
  var c;
1424
- s && ur.useDeprecatedNextContext ? (c = Object.create(t), c.unsubscribe = function() {
1425
- return s.unsubscribe();
1426
- }, a = {
1427
- next: t.next && Ye(t.next, c),
1428
- error: t.error && Ye(t.error, c),
1429
- complete: t.complete && Ye(t.complete, c)
1430
- }) : a = t;
287
+ o && we.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
288
+ return o.unsubscribe();
289
+ }, s = {
290
+ next: e.next && B(e.next, c),
291
+ error: e.error && B(e.error, c),
292
+ complete: e.complete && B(e.complete, c)
293
+ }) : s = e;
1431
294
  }
1432
- return s.destination = new _s(a), s;
295
+ return o.destination = new $e(s), o;
1433
296
  }
1434
- return e;
1435
- }(pt);
1436
- function we(r) {
1437
- Ps(r);
297
+ return t;
298
+ }(ee);
299
+ function A(r) {
300
+ Re(r);
1438
301
  }
1439
- function Ds(r) {
302
+ function je(r) {
1440
303
  throw r;
1441
304
  }
1442
- var Us = {
305
+ var Ve = {
1443
306
  closed: !0,
1444
- next: Xt,
1445
- error: Ds,
1446
- complete: Xt
1447
- }, Fs = function() {
307
+ next: oe,
308
+ error: je,
309
+ complete: oe
310
+ }, Fe = function() {
1448
311
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
1449
312
  }();
1450
- function hr(r) {
313
+ function Se(r) {
1451
314
  return r;
1452
315
  }
1453
- function js(r) {
1454
- return r.length === 0 ? hr : r.length === 1 ? r[0] : function(e) {
1455
- return r.reduce(function(t, n) {
1456
- return n(t);
316
+ function He(r) {
317
+ return r.length === 0 ? Se : r.length === 1 ? r[0] : function(e) {
318
+ return r.reduce(function(n, i) {
319
+ return i(n);
1457
320
  }, e);
1458
321
  };
1459
322
  }
1460
- var Te = function() {
1461
- function r(e) {
1462
- e && (this._subscribe = e);
323
+ var Y = function() {
324
+ function r(t) {
325
+ t && (this._subscribe = t);
1463
326
  }
1464
- return r.prototype.lift = function(e) {
1465
- var t = new r();
1466
- return t.source = this, t.operator = e, t;
1467
- }, r.prototype.subscribe = function(e, t, n) {
1468
- var i = this, s = ks(e) ? e : new Ze(e, t, n);
1469
- return Se(function() {
1470
- var a = i, c = a.operator, o = a.source;
1471
- s.add(c ? c.call(s, o) : o ? i._subscribe(s) : i._trySubscribe(s));
1472
- }), s;
1473
- }, r.prototype._trySubscribe = function(e) {
327
+ return r.prototype.lift = function(t) {
328
+ var e = new r();
329
+ return e.source = this, e.operator = t, e;
330
+ }, r.prototype.subscribe = function(t, e, n) {
331
+ var i = this, o = Le(t) ? t : new V(t, e, n);
332
+ return U(function() {
333
+ var s = i, c = s.operator, u = s.source;
334
+ o.add(c ? c.call(o, u) : u ? i._subscribe(o) : i._trySubscribe(o));
335
+ }), o;
336
+ }, r.prototype._trySubscribe = function(t) {
1474
337
  try {
1475
- return this._subscribe(e);
1476
- } catch (t) {
1477
- e.error(t);
338
+ return this._subscribe(t);
339
+ } catch (e) {
340
+ t.error(e);
1478
341
  }
1479
- }, r.prototype.forEach = function(e, t) {
342
+ }, r.prototype.forEach = function(t, e) {
1480
343
  var n = this;
1481
- return t = Bt(t), new t(function(i, s) {
1482
- var a = new Ze({
344
+ return e = se(e), new e(function(i, o) {
345
+ var s = new V({
1483
346
  next: function(c) {
1484
347
  try {
1485
- e(c);
1486
- } catch (o) {
1487
- s(o), a.unsubscribe();
348
+ t(c);
349
+ } catch (u) {
350
+ o(u), s.unsubscribe();
1488
351
  }
1489
352
  },
1490
- error: s,
353
+ error: o,
1491
354
  complete: i
1492
355
  });
1493
- n.subscribe(a);
356
+ n.subscribe(s);
1494
357
  });
1495
- }, r.prototype._subscribe = function(e) {
1496
- var t;
1497
- return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
1498
- }, r.prototype[Fs] = function() {
358
+ }, r.prototype._subscribe = function(t) {
359
+ var e;
360
+ return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
361
+ }, r.prototype[Fe] = function() {
1499
362
  return this;
1500
363
  }, r.prototype.pipe = function() {
1501
- for (var e = [], t = 0; t < arguments.length; t++)
1502
- e[t] = arguments[t];
1503
- return js(e)(this);
1504
- }, r.prototype.toPromise = function(e) {
1505
- var t = this;
1506
- return e = Bt(e), new e(function(n, i) {
1507
- var s;
1508
- t.subscribe(function(a) {
1509
- return s = a;
1510
- }, function(a) {
1511
- return i(a);
364
+ for (var t = [], e = 0; e < arguments.length; e++)
365
+ t[e] = arguments[e];
366
+ return He(t)(this);
367
+ }, r.prototype.toPromise = function(t) {
368
+ var e = this;
369
+ return t = se(t), new t(function(n, i) {
370
+ var o;
371
+ e.subscribe(function(s) {
372
+ return o = s;
373
+ }, function(s) {
374
+ return i(s);
1512
375
  }, function() {
1513
- return n(s);
376
+ return n(o);
1514
377
  });
1515
378
  });
1516
- }, r.create = function(e) {
1517
- return new r(e);
379
+ }, r.create = function(t) {
380
+ return new r(t);
1518
381
  }, r;
1519
382
  }();
1520
- function Bt(r) {
1521
- var e;
1522
- return (e = r ?? ur.Promise) !== null && e !== void 0 ? e : Promise;
383
+ function se(r) {
384
+ var t;
385
+ return (t = r ?? we.Promise) !== null && t !== void 0 ? t : Promise;
1523
386
  }
1524
- function Gs(r) {
1525
- return r && U(r.next) && U(r.error) && U(r.complete);
387
+ function De(r) {
388
+ return r && b(r.next) && b(r.error) && b(r.complete);
1526
389
  }
1527
- function ks(r) {
1528
- return r && r instanceof pt || Gs(r) && cr(r);
390
+ function Le(r) {
391
+ return r && r instanceof ee || De(r) && me(r);
1529
392
  }
1530
- function Vs(r) {
1531
- return U(r == null ? void 0 : r.lift);
393
+ function ke(r) {
394
+ return b(r == null ? void 0 : r.lift);
1532
395
  }
1533
- function De(r) {
1534
- return function(e) {
1535
- if (Vs(e))
1536
- return e.lift(function(t) {
396
+ function Ce(r) {
397
+ return function(t) {
398
+ if (ke(t))
399
+ return t.lift(function(e) {
1537
400
  try {
1538
- return r(t, this);
401
+ return r(e, this);
1539
402
  } catch (n) {
1540
403
  this.error(n);
1541
404
  }
@@ -1543,76 +406,76 @@ function De(r) {
1543
406
  throw new TypeError("Unable to lift unknown Observable type");
1544
407
  };
1545
408
  }
1546
- function Ue(r, e, t, n, i) {
1547
- return new Hs(r, e, t, n, i);
409
+ function Ee(r, t, e, n, i) {
410
+ return new Be(r, t, e, n, i);
1548
411
  }
1549
- var Hs = function(r) {
1550
- z(e, r);
1551
- function e(t, n, i, s, a, c) {
1552
- var o = r.call(this, t) || this;
1553
- return o.onFinalize = a, o.shouldUnsubscribe = c, o._next = n ? function(l) {
412
+ var Be = function(r) {
413
+ x(t, r);
414
+ function t(e, n, i, o, s, c) {
415
+ var u = r.call(this, e) || this;
416
+ return u.onFinalize = s, u.shouldUnsubscribe = c, u._next = n ? function(a) {
1554
417
  try {
1555
- n(l);
1556
- } catch (u) {
1557
- t.error(u);
418
+ n(a);
419
+ } catch (d) {
420
+ e.error(d);
1558
421
  }
1559
- } : r.prototype._next, o._error = s ? function(l) {
422
+ } : r.prototype._next, u._error = o ? function(a) {
1560
423
  try {
1561
- s(l);
1562
- } catch (u) {
1563
- t.error(u);
424
+ o(a);
425
+ } catch (d) {
426
+ e.error(d);
1564
427
  } finally {
1565
428
  this.unsubscribe();
1566
429
  }
1567
- } : r.prototype._error, o._complete = i ? function() {
430
+ } : r.prototype._error, u._complete = i ? function() {
1568
431
  try {
1569
432
  i();
1570
- } catch (l) {
1571
- t.error(l);
433
+ } catch (a) {
434
+ e.error(a);
1572
435
  } finally {
1573
436
  this.unsubscribe();
1574
437
  }
1575
- } : r.prototype._complete, o;
438
+ } : r.prototype._complete, u;
1576
439
  }
1577
- return e.prototype.unsubscribe = function() {
1578
- var t;
440
+ return t.prototype.unsubscribe = function() {
441
+ var e;
1579
442
  if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
1580
443
  var n = this.closed;
1581
- r.prototype.unsubscribe.call(this), !n && ((t = this.onFinalize) === null || t === void 0 || t.call(this));
444
+ r.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
1582
445
  }
1583
- }, e;
1584
- }(pt), Xs = ar(function(r) {
446
+ }, t;
447
+ }(ee), Ne = Z(function(r) {
1585
448
  return function() {
1586
449
  r(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
1587
450
  };
1588
- }), pr = function(r) {
1589
- z(e, r);
1590
- function e() {
1591
- var t = r.call(this) || this;
1592
- return t.closed = !1, t.currentObservers = null, t.observers = [], t.isStopped = !1, t.hasError = !1, t.thrownError = null, t;
451
+ }), xe = function(r) {
452
+ x(t, r);
453
+ function t() {
454
+ var e = r.call(this) || this;
455
+ return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
1593
456
  }
1594
- return e.prototype.lift = function(t) {
1595
- var n = new qt(this, this);
1596
- return n.operator = t, n;
1597
- }, e.prototype._throwIfClosed = function() {
457
+ return t.prototype.lift = function(e) {
458
+ var n = new ue(this, this);
459
+ return n.operator = e, n;
460
+ }, t.prototype._throwIfClosed = function() {
1598
461
  if (this.closed)
1599
- throw new Xs();
1600
- }, e.prototype.next = function(t) {
462
+ throw new Ne();
463
+ }, t.prototype.next = function(e) {
1601
464
  var n = this;
1602
- Se(function() {
1603
- var i, s;
465
+ U(function() {
466
+ var i, o;
1604
467
  if (n._throwIfClosed(), !n.isStopped) {
1605
468
  n.currentObservers || (n.currentObservers = Array.from(n.observers));
1606
469
  try {
1607
- for (var a = Ke(n.currentObservers), c = a.next(); !c.done; c = a.next()) {
1608
- var o = c.value;
1609
- o.next(t);
470
+ for (var s = Q(n.currentObservers), c = s.next(); !c.done; c = s.next()) {
471
+ var u = c.value;
472
+ u.next(e);
1610
473
  }
1611
- } catch (l) {
1612
- i = { error: l };
474
+ } catch (a) {
475
+ i = { error: a };
1613
476
  } finally {
1614
477
  try {
1615
- c && !c.done && (s = a.return) && s.call(a);
478
+ c && !c.done && (o = s.return) && o.call(s);
1616
479
  } finally {
1617
480
  if (i)
1618
481
  throw i.error;
@@ -1620,283 +483,789 @@ var Hs = function(r) {
1620
483
  }
1621
484
  }
1622
485
  });
1623
- }, e.prototype.error = function(t) {
486
+ }, t.prototype.error = function(e) {
1624
487
  var n = this;
1625
- Se(function() {
488
+ U(function() {
1626
489
  if (n._throwIfClosed(), !n.isStopped) {
1627
- n.hasError = n.isStopped = !0, n.thrownError = t;
490
+ n.hasError = n.isStopped = !0, n.thrownError = e;
1628
491
  for (var i = n.observers; i.length; )
1629
- i.shift().error(t);
492
+ i.shift().error(e);
1630
493
  }
1631
494
  });
1632
- }, e.prototype.complete = function() {
1633
- var t = this;
1634
- Se(function() {
1635
- if (t._throwIfClosed(), !t.isStopped) {
1636
- t.isStopped = !0;
1637
- for (var n = t.observers; n.length; )
495
+ }, t.prototype.complete = function() {
496
+ var e = this;
497
+ U(function() {
498
+ if (e._throwIfClosed(), !e.isStopped) {
499
+ e.isStopped = !0;
500
+ for (var n = e.observers; n.length; )
1638
501
  n.shift().complete();
1639
502
  }
1640
503
  });
1641
- }, e.prototype.unsubscribe = function() {
504
+ }, t.prototype.unsubscribe = function() {
1642
505
  this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
1643
- }, Object.defineProperty(e.prototype, "observed", {
506
+ }, Object.defineProperty(t.prototype, "observed", {
1644
507
  get: function() {
1645
- var t;
1646
- return ((t = this.observers) === null || t === void 0 ? void 0 : t.length) > 0;
508
+ var e;
509
+ return ((e = this.observers) === null || e === void 0 ? void 0 : e.length) > 0;
1647
510
  },
1648
511
  enumerable: !1,
1649
512
  configurable: !0
1650
- }), e.prototype._trySubscribe = function(t) {
1651
- return this._throwIfClosed(), r.prototype._trySubscribe.call(this, t);
1652
- }, e.prototype._subscribe = function(t) {
1653
- return this._throwIfClosed(), this._checkFinalizedStatuses(t), this._innerSubscribe(t);
1654
- }, e.prototype._innerSubscribe = function(t) {
1655
- var n = this, i = this, s = i.hasError, a = i.isStopped, c = i.observers;
1656
- return s || a ? lr : (this.currentObservers = null, c.push(t), new ge(function() {
1657
- n.currentObservers = null, Ae(c, t);
513
+ }), t.prototype._trySubscribe = function(e) {
514
+ return this._throwIfClosed(), r.prototype._trySubscribe.call(this, e);
515
+ }, t.prototype._subscribe = function(e) {
516
+ return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
517
+ }, t.prototype._innerSubscribe = function(e) {
518
+ var n = this, i = this, o = i.hasError, s = i.isStopped, c = i.observers;
519
+ return o || s ? ye : (this.currentObservers = null, c.push(e), new P(function() {
520
+ n.currentObservers = null, j(c, e);
1658
521
  }));
1659
- }, e.prototype._checkFinalizedStatuses = function(t) {
1660
- var n = this, i = n.hasError, s = n.thrownError, a = n.isStopped;
1661
- i ? t.error(s) : a && t.complete();
1662
- }, e.prototype.asObservable = function() {
1663
- var t = new Te();
1664
- return t.source = this, t;
1665
- }, e.create = function(t, n) {
1666
- return new qt(t, n);
1667
- }, e;
1668
- }(Te), qt = function(r) {
1669
- z(e, r);
1670
- function e(t, n) {
522
+ }, t.prototype._checkFinalizedStatuses = function(e) {
523
+ var n = this, i = n.hasError, o = n.thrownError, s = n.isStopped;
524
+ i ? e.error(o) : s && e.complete();
525
+ }, t.prototype.asObservable = function() {
526
+ var e = new Y();
527
+ return e.source = this, e;
528
+ }, t.create = function(e, n) {
529
+ return new ue(e, n);
530
+ }, t;
531
+ }(Y), ue = function(r) {
532
+ x(t, r);
533
+ function t(e, n) {
1671
534
  var i = r.call(this) || this;
1672
- return i.destination = t, i.source = n, i;
535
+ return i.destination = e, i.source = n, i;
1673
536
  }
1674
- return e.prototype.next = function(t) {
537
+ return t.prototype.next = function(e) {
1675
538
  var n, i;
1676
- (i = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || i === void 0 || i.call(n, t);
1677
- }, e.prototype.error = function(t) {
539
+ (i = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || i === void 0 || i.call(n, e);
540
+ }, t.prototype.error = function(e) {
1678
541
  var n, i;
1679
- (i = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || i === void 0 || i.call(n, t);
1680
- }, e.prototype.complete = function() {
1681
- var t, n;
1682
- (n = (t = this.destination) === null || t === void 0 ? void 0 : t.complete) === null || n === void 0 || n.call(t);
1683
- }, e.prototype._subscribe = function(t) {
542
+ (i = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || i === void 0 || i.call(n, e);
543
+ }, t.prototype.complete = function() {
544
+ var e, n;
545
+ (n = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || n === void 0 || n.call(e);
546
+ }, t.prototype._subscribe = function(e) {
1684
547
  var n, i;
1685
- return (i = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(t)) !== null && i !== void 0 ? i : lr;
1686
- }, e;
1687
- }(pr), Bs = {
548
+ return (i = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e)) !== null && i !== void 0 ? i : ye;
549
+ }, t;
550
+ }(xe), _e = {
1688
551
  now: function() {
1689
- return Date.now();
552
+ return (_e.delegate || Date).now();
1690
553
  },
1691
554
  delegate: void 0
1692
- }, qs = function(r) {
1693
- z(e, r);
1694
- function e(t, n) {
555
+ }, qe = function(r) {
556
+ x(t, r);
557
+ function t(e, n) {
1695
558
  return r.call(this) || this;
1696
559
  }
1697
- return e.prototype.schedule = function(t, n) {
560
+ return t.prototype.schedule = function(e, n) {
1698
561
  return this;
1699
- }, e;
1700
- }(ge), et = {
1701
- setInterval: function(r, e) {
1702
- for (var t = [], n = 2; n < arguments.length; n++)
1703
- t[n - 2] = arguments[n];
1704
- var i = et.delegate;
1705
- return i != null && i.setInterval ? i.setInterval.apply(i, fe([r, e], pe(t))) : setInterval.apply(void 0, fe([r, e], pe(t)));
562
+ }, t;
563
+ }(P), F = {
564
+ setInterval: function(r, t) {
565
+ for (var e = [], n = 2; n < arguments.length; n++)
566
+ e[n - 2] = arguments[n];
567
+ var i = F.delegate;
568
+ return i != null && i.setInterval ? i.setInterval.apply(i, I([r, t], M(e))) : setInterval.apply(void 0, I([r, t], M(e)));
1706
569
  },
1707
570
  clearInterval: function(r) {
1708
- return clearInterval(r);
571
+ var t = F.delegate;
572
+ return ((t == null ? void 0 : t.clearInterval) || clearInterval)(r);
1709
573
  },
1710
574
  delegate: void 0
1711
- }, Ys = function(r) {
1712
- z(e, r);
1713
- function e(t, n) {
1714
- var i = r.call(this, t, n) || this;
1715
- return i.scheduler = t, i.work = n, i.pending = !1, i;
575
+ }, ze = function(r) {
576
+ x(t, r);
577
+ function t(e, n) {
578
+ var i = r.call(this, e, n) || this;
579
+ return i.scheduler = e, i.work = n, i.pending = !1, i;
1716
580
  }
1717
- return e.prototype.schedule = function(t, n) {
581
+ return t.prototype.schedule = function(e, n) {
1718
582
  var i;
1719
583
  if (n === void 0 && (n = 0), this.closed)
1720
584
  return this;
1721
- this.state = t;
1722
- var s = this.id, a = this.scheduler;
1723
- return s != null && (this.id = this.recycleAsyncId(a, s, n)), this.pending = !0, this.delay = n, this.id = (i = this.id) !== null && i !== void 0 ? i : this.requestAsyncId(a, this.id, n), this;
1724
- }, e.prototype.requestAsyncId = function(t, n, i) {
1725
- return i === void 0 && (i = 0), et.setInterval(t.flush.bind(t, this), i);
1726
- }, e.prototype.recycleAsyncId = function(t, n, i) {
585
+ this.state = e;
586
+ var o = this.id, s = this.scheduler;
587
+ return o != null && (this.id = this.recycleAsyncId(s, o, n)), this.pending = !0, this.delay = n, this.id = (i = this.id) !== null && i !== void 0 ? i : this.requestAsyncId(s, this.id, n), this;
588
+ }, t.prototype.requestAsyncId = function(e, n, i) {
589
+ return i === void 0 && (i = 0), F.setInterval(e.flush.bind(e, this), i);
590
+ }, t.prototype.recycleAsyncId = function(e, n, i) {
1727
591
  if (i === void 0 && (i = 0), i != null && this.delay === i && this.pending === !1)
1728
592
  return n;
1729
- n != null && et.clearInterval(n);
1730
- }, e.prototype.execute = function(t, n) {
593
+ n != null && F.clearInterval(n);
594
+ }, t.prototype.execute = function(e, n) {
1731
595
  if (this.closed)
1732
596
  return new Error("executing a cancelled action");
1733
597
  this.pending = !1;
1734
- var i = this._execute(t, n);
598
+ var i = this._execute(e, n);
1735
599
  if (i)
1736
600
  return i;
1737
601
  this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
1738
- }, e.prototype._execute = function(t, n) {
1739
- var i = !1, s;
602
+ }, t.prototype._execute = function(e, n) {
603
+ var i = !1, o;
1740
604
  try {
1741
- this.work(t);
1742
- } catch (a) {
1743
- i = !0, s = a || new Error("Scheduled action threw falsy error");
605
+ this.work(e);
606
+ } catch (s) {
607
+ i = !0, o = s || new Error("Scheduled action threw falsy error");
1744
608
  }
1745
609
  if (i)
1746
- return this.unsubscribe(), s;
1747
- }, e.prototype.unsubscribe = function() {
610
+ return this.unsubscribe(), o;
611
+ }, t.prototype.unsubscribe = function() {
1748
612
  if (!this.closed) {
1749
- var t = this, n = t.id, i = t.scheduler, s = i.actions;
1750
- this.work = this.state = this.scheduler = null, this.pending = !1, Ae(s, this), n != null && (this.id = this.recycleAsyncId(i, n, null)), this.delay = null, r.prototype.unsubscribe.call(this);
613
+ var e = this, n = e.id, i = e.scheduler, o = i.actions;
614
+ this.work = this.state = this.scheduler = null, this.pending = !1, j(o, this), n != null && (this.id = this.recycleAsyncId(i, n, null)), this.delay = null, r.prototype.unsubscribe.call(this);
1751
615
  }
1752
- }, e;
1753
- }(qs), Yt = function() {
1754
- function r(e, t) {
1755
- t === void 0 && (t = r.now), this.schedulerActionCtor = e, this.now = t;
1756
- }
1757
- return r.prototype.schedule = function(e, t, n) {
1758
- return t === void 0 && (t = 0), new this.schedulerActionCtor(this, e).schedule(n, t);
1759
- }, r.now = Bs.now, r;
1760
- }(), zs = function(r) {
1761
- z(e, r);
1762
- function e(t, n) {
1763
- n === void 0 && (n = Yt.now);
1764
- var i = r.call(this, t, n) || this;
616
+ }, t;
617
+ }(qe), ce = function() {
618
+ function r(t, e) {
619
+ e === void 0 && (e = r.now), this.schedulerActionCtor = t, this.now = e;
620
+ }
621
+ return r.prototype.schedule = function(t, e, n) {
622
+ return e === void 0 && (e = 0), new this.schedulerActionCtor(this, t).schedule(n, e);
623
+ }, r.now = _e.now, r;
624
+ }(), Qe = function(r) {
625
+ x(t, r);
626
+ function t(e, n) {
627
+ n === void 0 && (n = ce.now);
628
+ var i = r.call(this, e, n) || this;
1765
629
  return i.actions = [], i._active = !1, i;
1766
630
  }
1767
- return e.prototype.flush = function(t) {
631
+ return t.prototype.flush = function(e) {
1768
632
  var n = this.actions;
1769
633
  if (this._active) {
1770
- n.push(t);
634
+ n.push(e);
1771
635
  return;
1772
636
  }
1773
637
  var i;
1774
638
  this._active = !0;
1775
639
  do
1776
- if (i = t.execute(t.state, t.delay))
640
+ if (i = e.execute(e.state, e.delay))
1777
641
  break;
1778
- while (t = n.shift());
642
+ while (e = n.shift());
1779
643
  if (this._active = !1, i) {
1780
- for (; t = n.shift(); )
1781
- t.unsubscribe();
644
+ for (; e = n.shift(); )
645
+ e.unsubscribe();
1782
646
  throw i;
1783
647
  }
1784
- }, e;
1785
- }(Yt), Qs = new zs(Ys), Ws = Qs, Js = new Te(function(r) {
1786
- return r.complete();
1787
- });
1788
- function Ks(r) {
1789
- return r && U(r.schedule);
648
+ }, t;
649
+ }(ce), Ge = new Qe(ze), Ye = Ge;
650
+ function Je(r) {
651
+ return r && b(r.schedule);
652
+ }
653
+ var Ke = Z(function(r) {
654
+ return function() {
655
+ r(this), this.name = "EmptyError", this.message = "no elements in sequence";
656
+ };
657
+ });
658
+ function O(r, t) {
659
+ var e = typeof t == "object";
660
+ return new Promise(function(n, i) {
661
+ var o = new V({
662
+ next: function(s) {
663
+ n(s), o.unsubscribe();
664
+ },
665
+ error: i,
666
+ complete: function() {
667
+ e ? n(t.defaultValue) : i(new Ke());
668
+ }
669
+ });
670
+ r.subscribe(o);
671
+ });
672
+ }
673
+ function We(r) {
674
+ return r instanceof Date && !isNaN(r);
675
+ }
676
+ function T(r, t) {
677
+ return Ce(function(e, n) {
678
+ var i = 0;
679
+ e.subscribe(Ee(n, function(o) {
680
+ n.next(r.call(t, o, i++));
681
+ }));
682
+ });
683
+ }
684
+ function Xe(r, t, e) {
685
+ r === void 0 && (r = 0), e === void 0 && (e = Ye);
686
+ var n = -1;
687
+ return t != null && (Je(t) ? e = t : n = t), new Y(function(i) {
688
+ var o = We(r) ? +r - e.now() : r;
689
+ o < 0 && (o = 0);
690
+ var s = 0;
691
+ return e.schedule(function() {
692
+ i.closed || (i.next(s++), 0 <= n ? this.schedule(void 0, n) : i.complete());
693
+ }, o);
694
+ });
695
+ }
696
+ function Ze(r, t, e) {
697
+ var n = b(r) || t || e ? { next: r, error: t, complete: e } : r;
698
+ return n ? Ce(function(i, o) {
699
+ var s;
700
+ (s = n.subscribe) === null || s === void 0 || s.call(n);
701
+ var c = !0;
702
+ i.subscribe(Ee(o, function(u) {
703
+ var a;
704
+ (a = n.next) === null || a === void 0 || a.call(n, u), o.next(u);
705
+ }, function() {
706
+ var u;
707
+ c = !1, (u = n.complete) === null || u === void 0 || u.call(n), o.complete();
708
+ }, function(u) {
709
+ var a;
710
+ c = !1, (a = n.error) === null || a === void 0 || a.call(n, u), o.error(u);
711
+ }, function() {
712
+ var u, a;
713
+ c && ((u = n.unsubscribe) === null || u === void 0 || u.call(n)), (a = n.finalize) === null || a === void 0 || a.call(n);
714
+ }));
715
+ }) : Se;
716
+ }
717
+ var et = Object.defineProperty, tt = (r, t, e) => t in r ? et(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, E = (r, t, e) => (tt(r, typeof t != "symbol" ? t + "" : t, e), e);
718
+ class p extends Error {
719
+ constructor(t) {
720
+ super(`Incorrect context (${t}). Cannot perform the requested operation.`), E(this, "context"), this.context = t;
721
+ }
722
+ }
723
+ class $ extends Error {
724
+ constructor(t, e, n) {
725
+ super(`Invalid parameter (${t}). ${n}`), this.param = t, this.value = e, this.reason = n;
726
+ }
727
+ }
728
+ class rt extends Error {
729
+ constructor(t, e) {
730
+ super(
731
+ `'streamId' value of "${t}" is different from what we expected ("${e}")`
732
+ ), this.streamId = t, this.expectedStreamId = e;
733
+ }
734
+ }
735
+ class nt extends Error {
736
+ constructor(t) {
737
+ super(`Invalid version format: ${t}`);
738
+ }
739
+ }
740
+ class ae extends Error {
741
+ constructor(t) {
742
+ super(`${t} needs to be initialized before it can be used.`);
743
+ }
744
+ }
745
+ class le extends Error {
746
+ constructor(t, e) {
747
+ let n = `Unsupported Protocol ${Array.isArray(t) ? "versions" : "version"}: (${t}).`;
748
+ e && (n += ` Minimum version supported is ${e}.`), super(n), this.version = t;
749
+ }
750
+ }
751
+ function m(r) {
752
+ return typeof r == "function";
753
+ }
754
+ function it(r) {
755
+ return m(r == null ? void 0 : r.lift);
756
+ }
757
+ function H(r) {
758
+ return function(t) {
759
+ if (it(t))
760
+ return t.lift(function(e) {
761
+ try {
762
+ return r(e, this);
763
+ } catch (n) {
764
+ this.error(n);
765
+ }
766
+ });
767
+ throw new TypeError("Unable to lift unknown Observable type");
768
+ };
769
+ }
770
+ var J = function(r, t) {
771
+ return J = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
772
+ e.__proto__ = n;
773
+ } || function(e, n) {
774
+ for (var i in n)
775
+ Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
776
+ }, J(r, t);
777
+ };
778
+ function te(r, t) {
779
+ if (typeof t != "function" && t !== null)
780
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
781
+ J(r, t);
782
+ function e() {
783
+ this.constructor = r;
784
+ }
785
+ r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
786
+ }
787
+ function he(r) {
788
+ var t = typeof Symbol == "function" && Symbol.iterator, e = t && r[t], n = 0;
789
+ if (e)
790
+ return e.call(r);
791
+ if (r && typeof r.length == "number")
792
+ return {
793
+ next: function() {
794
+ return r && n >= r.length && (r = void 0), { value: r && r[n++], done: !r };
795
+ }
796
+ };
797
+ throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
798
+ }
799
+ function K(r, t) {
800
+ var e = typeof Symbol == "function" && r[Symbol.iterator];
801
+ if (!e)
802
+ return r;
803
+ var n = e.call(r), i, o = [], s;
804
+ try {
805
+ for (; (t === void 0 || t-- > 0) && !(i = n.next()).done; )
806
+ o.push(i.value);
807
+ } catch (c) {
808
+ s = { error: c };
809
+ } finally {
810
+ try {
811
+ i && !i.done && (e = n.return) && e.call(n);
812
+ } finally {
813
+ if (s)
814
+ throw s.error;
815
+ }
816
+ }
817
+ return o;
818
+ }
819
+ function W(r, t, e) {
820
+ if (e || arguments.length === 2)
821
+ for (var n = 0, i = t.length, o; n < i; n++)
822
+ (o || !(n in t)) && (o || (o = Array.prototype.slice.call(t, 0, n)), o[n] = t[n]);
823
+ return r.concat(o || Array.prototype.slice.call(t));
824
+ }
825
+ function ot(r) {
826
+ var t = function(n) {
827
+ Error.call(n), n.stack = new Error().stack;
828
+ }, e = r(t);
829
+ return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
830
+ }
831
+ var N = ot(function(r) {
832
+ return function(t) {
833
+ r(this), this.message = t ? t.length + ` errors occurred during unsubscription:
834
+ ` + t.map(function(e, n) {
835
+ return n + 1 + ") " + e.toString();
836
+ }).join(`
837
+ `) : "", this.name = "UnsubscriptionError", this.errors = t;
838
+ };
839
+ });
840
+ function pe(r, t) {
841
+ if (r) {
842
+ var e = r.indexOf(t);
843
+ 0 <= e && r.splice(e, 1);
844
+ }
845
+ }
846
+ var re = function() {
847
+ function r(t) {
848
+ this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
849
+ }
850
+ return r.prototype.unsubscribe = function() {
851
+ var t, e, n, i, o;
852
+ if (!this.closed) {
853
+ this.closed = !0;
854
+ var s = this._parentage;
855
+ if (s)
856
+ if (this._parentage = null, Array.isArray(s))
857
+ try {
858
+ for (var c = he(s), u = c.next(); !u.done; u = c.next()) {
859
+ var a = u.value;
860
+ a.remove(this);
861
+ }
862
+ } catch (l) {
863
+ t = { error: l };
864
+ } finally {
865
+ try {
866
+ u && !u.done && (e = c.return) && e.call(c);
867
+ } finally {
868
+ if (t)
869
+ throw t.error;
870
+ }
871
+ }
872
+ else
873
+ s.remove(this);
874
+ var d = this.initialTeardown;
875
+ if (m(d))
876
+ try {
877
+ d();
878
+ } catch (l) {
879
+ o = l instanceof N ? l.errors : [l];
880
+ }
881
+ var f = this._finalizers;
882
+ if (f) {
883
+ this._finalizers = null;
884
+ try {
885
+ for (var w = he(f), y = w.next(); !y.done; y = w.next()) {
886
+ var L = y.value;
887
+ try {
888
+ de(L);
889
+ } catch (l) {
890
+ o = o ?? [], l instanceof N ? o = W(W([], K(o)), K(l.errors)) : o.push(l);
891
+ }
892
+ }
893
+ } catch (l) {
894
+ n = { error: l };
895
+ } finally {
896
+ try {
897
+ y && !y.done && (i = w.return) && i.call(w);
898
+ } finally {
899
+ if (n)
900
+ throw n.error;
901
+ }
902
+ }
903
+ }
904
+ if (o)
905
+ throw new N(o);
906
+ }
907
+ }, r.prototype.add = function(t) {
908
+ var e;
909
+ if (t && t !== this)
910
+ if (this.closed)
911
+ de(t);
912
+ else {
913
+ if (t instanceof r) {
914
+ if (t.closed || t._hasParent(this))
915
+ return;
916
+ t._addParent(this);
917
+ }
918
+ (this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);
919
+ }
920
+ }, r.prototype._hasParent = function(t) {
921
+ var e = this._parentage;
922
+ return e === t || Array.isArray(e) && e.includes(t);
923
+ }, r.prototype._addParent = function(t) {
924
+ var e = this._parentage;
925
+ this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
926
+ }, r.prototype._removeParent = function(t) {
927
+ var e = this._parentage;
928
+ e === t ? this._parentage = null : Array.isArray(e) && pe(e, t);
929
+ }, r.prototype.remove = function(t) {
930
+ var e = this._finalizers;
931
+ e && pe(e, t), t instanceof r && t._removeParent(this);
932
+ }, r.EMPTY = function() {
933
+ var t = new r();
934
+ return t.closed = !0, t;
935
+ }(), r;
936
+ }();
937
+ re.EMPTY;
938
+ function Me(r) {
939
+ return r instanceof re || r && "closed" in r && m(r.remove) && m(r.add) && m(r.unsubscribe);
940
+ }
941
+ function de(r) {
942
+ m(r) ? r() : r.unsubscribe();
943
+ }
944
+ var Ie = {
945
+ onUnhandledError: null,
946
+ onStoppedNotification: null,
947
+ Promise: void 0,
948
+ useDeprecatedSynchronousErrorHandling: !1,
949
+ useDeprecatedNextContext: !1
950
+ }, st = {
951
+ setTimeout: function(r, t) {
952
+ for (var e = [], n = 2; n < arguments.length; n++)
953
+ e[n - 2] = arguments[n];
954
+ return setTimeout.apply(void 0, W([r, t], K(e)));
955
+ },
956
+ clearTimeout: function(r) {
957
+ return clearTimeout(r);
958
+ },
959
+ delegate: void 0
960
+ };
961
+ function ut(r) {
962
+ st.setTimeout(function() {
963
+ throw r;
964
+ });
965
+ }
966
+ function fe() {
967
+ }
968
+ function ct(r) {
969
+ r();
970
+ }
971
+ var ne = function(r) {
972
+ te(t, r);
973
+ function t(e) {
974
+ var n = r.call(this) || this;
975
+ return n.isStopped = !1, e ? (n.destination = e, Me(e) && e.add(n)) : n.destination = pt, n;
976
+ }
977
+ return t.create = function(e, n, i) {
978
+ return new X(e, n, i);
979
+ }, t.prototype.next = function(e) {
980
+ this.isStopped || this._next(e);
981
+ }, t.prototype.error = function(e) {
982
+ this.isStopped || (this.isStopped = !0, this._error(e));
983
+ }, t.prototype.complete = function() {
984
+ this.isStopped || (this.isStopped = !0, this._complete());
985
+ }, t.prototype.unsubscribe = function() {
986
+ this.closed || (this.isStopped = !0, r.prototype.unsubscribe.call(this), this.destination = null);
987
+ }, t.prototype._next = function(e) {
988
+ this.destination.next(e);
989
+ }, t.prototype._error = function(e) {
990
+ try {
991
+ this.destination.error(e);
992
+ } finally {
993
+ this.unsubscribe();
994
+ }
995
+ }, t.prototype._complete = function() {
996
+ try {
997
+ this.destination.complete();
998
+ } finally {
999
+ this.unsubscribe();
1000
+ }
1001
+ }, t;
1002
+ }(re), at = Function.prototype.bind;
1003
+ function q(r, t) {
1004
+ return at.call(r, t);
1005
+ }
1006
+ var lt = function() {
1007
+ function r(t) {
1008
+ this.partialObserver = t;
1009
+ }
1010
+ return r.prototype.next = function(t) {
1011
+ var e = this.partialObserver;
1012
+ if (e.next)
1013
+ try {
1014
+ e.next(t);
1015
+ } catch (n) {
1016
+ R(n);
1017
+ }
1018
+ }, r.prototype.error = function(t) {
1019
+ var e = this.partialObserver;
1020
+ if (e.error)
1021
+ try {
1022
+ e.error(t);
1023
+ } catch (n) {
1024
+ R(n);
1025
+ }
1026
+ else
1027
+ R(t);
1028
+ }, r.prototype.complete = function() {
1029
+ var t = this.partialObserver;
1030
+ if (t.complete)
1031
+ try {
1032
+ t.complete();
1033
+ } catch (e) {
1034
+ R(e);
1035
+ }
1036
+ }, r;
1037
+ }(), X = function(r) {
1038
+ te(t, r);
1039
+ function t(e, n, i) {
1040
+ var o = r.call(this) || this, s;
1041
+ if (m(e) || !e)
1042
+ s = {
1043
+ next: e ?? void 0,
1044
+ error: n ?? void 0,
1045
+ complete: i ?? void 0
1046
+ };
1047
+ else {
1048
+ var c;
1049
+ o && Ie.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
1050
+ return o.unsubscribe();
1051
+ }, s = {
1052
+ next: e.next && q(e.next, c),
1053
+ error: e.error && q(e.error, c),
1054
+ complete: e.complete && q(e.complete, c)
1055
+ }) : s = e;
1056
+ }
1057
+ return o.destination = new lt(s), o;
1058
+ }
1059
+ return t;
1060
+ }(ne);
1061
+ function R(r) {
1062
+ ut(r);
1063
+ }
1064
+ function ht(r) {
1065
+ throw r;
1066
+ }
1067
+ var pt = {
1068
+ closed: !0,
1069
+ next: fe,
1070
+ error: ht,
1071
+ complete: fe
1072
+ }, dt = function() {
1073
+ return typeof Symbol == "function" && Symbol.observable || "@@observable";
1074
+ }();
1075
+ function Oe(r) {
1076
+ return r;
1077
+ }
1078
+ function ft(r) {
1079
+ return r.length === 0 ? Oe : r.length === 1 ? r[0] : function(t) {
1080
+ return r.reduce(function(e, n) {
1081
+ return n(e);
1082
+ }, t);
1083
+ };
1084
+ }
1085
+ var vt = function() {
1086
+ function r(t) {
1087
+ t && (this._subscribe = t);
1088
+ }
1089
+ return r.prototype.lift = function(t) {
1090
+ var e = new r();
1091
+ return e.source = this, e.operator = t, e;
1092
+ }, r.prototype.subscribe = function(t, e, n) {
1093
+ var i = this, o = bt(t) ? t : new X(t, e, n);
1094
+ return ct(function() {
1095
+ var s = i, c = s.operator, u = s.source;
1096
+ o.add(c ? c.call(o, u) : u ? i._subscribe(o) : i._trySubscribe(o));
1097
+ }), o;
1098
+ }, r.prototype._trySubscribe = function(t) {
1099
+ try {
1100
+ return this._subscribe(t);
1101
+ } catch (e) {
1102
+ t.error(e);
1103
+ }
1104
+ }, r.prototype.forEach = function(t, e) {
1105
+ var n = this;
1106
+ return e = ve(e), new e(function(i, o) {
1107
+ var s = new X({
1108
+ next: function(c) {
1109
+ try {
1110
+ t(c);
1111
+ } catch (u) {
1112
+ o(u), s.unsubscribe();
1113
+ }
1114
+ },
1115
+ error: o,
1116
+ complete: i
1117
+ });
1118
+ n.subscribe(s);
1119
+ });
1120
+ }, r.prototype._subscribe = function(t) {
1121
+ var e;
1122
+ return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
1123
+ }, r.prototype[dt] = function() {
1124
+ return this;
1125
+ }, r.prototype.pipe = function() {
1126
+ for (var t = [], e = 0; e < arguments.length; e++)
1127
+ t[e] = arguments[e];
1128
+ return ft(t)(this);
1129
+ }, r.prototype.toPromise = function(t) {
1130
+ var e = this;
1131
+ return t = ve(t), new t(function(n, i) {
1132
+ var o;
1133
+ e.subscribe(function(s) {
1134
+ return o = s;
1135
+ }, function(s) {
1136
+ return i(s);
1137
+ }, function() {
1138
+ return n(o);
1139
+ });
1140
+ });
1141
+ }, r.create = function(t) {
1142
+ return new r(t);
1143
+ }, r;
1144
+ }();
1145
+ function ve(r) {
1146
+ var t;
1147
+ return (t = r ?? Ie.Promise) !== null && t !== void 0 ? t : Promise;
1790
1148
  }
1791
- function Zs(r) {
1792
- return r instanceof Date && !isNaN(r);
1149
+ function gt(r) {
1150
+ return r && m(r.next) && m(r.error) && m(r.complete);
1793
1151
  }
1794
- function T(r, e) {
1795
- return De(function(t, n) {
1796
- var i = 0;
1797
- t.subscribe(Ue(n, function(s) {
1798
- n.next(r.call(e, s, i++));
1799
- }));
1800
- });
1152
+ function bt(r) {
1153
+ return r && r instanceof ne || gt(r) && Me(r);
1801
1154
  }
1802
- function eo(r, e, t) {
1803
- r === void 0 && (r = 0), t === void 0 && (t = Ws);
1804
- var n = -1;
1805
- return e != null && (Ks(e) ? t = e : n = e), new Te(function(i) {
1806
- var s = Zs(r) ? +r - t.now() : r;
1807
- s < 0 && (s = 0);
1808
- var a = 0;
1809
- return t.schedule(function() {
1810
- i.closed || (i.next(a++), 0 <= n ? this.schedule(void 0, n) : i.complete());
1811
- }, s);
1812
- });
1155
+ function D(r, t, e, n, i) {
1156
+ return new yt(r, t, e, n, i);
1813
1157
  }
1814
- function M(r, e) {
1815
- return De(function(t, n) {
1158
+ var yt = function(r) {
1159
+ te(t, r);
1160
+ function t(e, n, i, o, s, c) {
1161
+ var u = r.call(this, e) || this;
1162
+ return u.onFinalize = s, u.shouldUnsubscribe = c, u._next = n ? function(a) {
1163
+ try {
1164
+ n(a);
1165
+ } catch (d) {
1166
+ e.error(d);
1167
+ }
1168
+ } : r.prototype._next, u._error = o ? function(a) {
1169
+ try {
1170
+ o(a);
1171
+ } catch (d) {
1172
+ e.error(d);
1173
+ } finally {
1174
+ this.unsubscribe();
1175
+ }
1176
+ } : r.prototype._error, u._complete = i ? function() {
1177
+ try {
1178
+ i();
1179
+ } catch (a) {
1180
+ e.error(a);
1181
+ } finally {
1182
+ this.unsubscribe();
1183
+ }
1184
+ } : r.prototype._complete, u;
1185
+ }
1186
+ return t.prototype.unsubscribe = function() {
1187
+ var e;
1188
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
1189
+ var n = this.closed;
1190
+ r.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
1191
+ }
1192
+ }, t;
1193
+ }(ne);
1194
+ function h(r, t) {
1195
+ return H(function(e, n) {
1816
1196
  var i = 0;
1817
- t.subscribe(Ue(n, function(s) {
1818
- return r.call(e, s, i++) && n.next(s);
1197
+ e.subscribe(D(n, function(o) {
1198
+ n.next(r.call(t, o, i++));
1819
1199
  }));
1820
1200
  });
1821
1201
  }
1822
- function V(r) {
1202
+ var mt = new vt(function(r) {
1203
+ return r.complete();
1204
+ });
1205
+ function S(r) {
1823
1206
  return r <= 0 ? function() {
1824
- return Js;
1825
- } : De(function(e, t) {
1207
+ return mt;
1208
+ } : H(function(t, e) {
1826
1209
  var n = 0;
1827
- e.subscribe(Ue(t, function(i) {
1828
- ++n <= r && (t.next(i), r <= n && t.complete());
1210
+ t.subscribe(D(e, function(i) {
1211
+ ++n <= r && (e.next(i), r <= n && e.complete());
1212
+ }));
1213
+ });
1214
+ }
1215
+ function g(r, t) {
1216
+ return H(function(e, n) {
1217
+ var i = 0;
1218
+ e.subscribe(D(n, function(o) {
1219
+ return r.call(t, o, i++) && n.next(o);
1829
1220
  }));
1830
1221
  });
1831
1222
  }
1832
- function P(r, e, t) {
1833
- var n = U(r) || e || t ? { next: r, error: e, complete: t } : r;
1834
- return n ? De(function(i, s) {
1835
- var a;
1836
- (a = n.subscribe) === null || a === void 0 || a.call(n);
1223
+ function v(r, t, e) {
1224
+ var n = m(r) || t || e ? { next: r, error: t, complete: e } : r;
1225
+ return n ? H(function(i, o) {
1226
+ var s;
1227
+ (s = n.subscribe) === null || s === void 0 || s.call(n);
1837
1228
  var c = !0;
1838
- i.subscribe(Ue(s, function(o) {
1839
- var l;
1840
- (l = n.next) === null || l === void 0 || l.call(n, o), s.next(o);
1229
+ i.subscribe(D(o, function(u) {
1230
+ var a;
1231
+ (a = n.next) === null || a === void 0 || a.call(n, u), o.next(u);
1841
1232
  }, function() {
1842
- var o;
1843
- c = !1, (o = n.complete) === null || o === void 0 || o.call(n), s.complete();
1844
- }, function(o) {
1845
- var l;
1846
- c = !1, (l = n.error) === null || l === void 0 || l.call(n, o), s.error(o);
1233
+ var u;
1234
+ c = !1, (u = n.complete) === null || u === void 0 || u.call(n), o.complete();
1235
+ }, function(u) {
1236
+ var a;
1237
+ c = !1, (a = n.error) === null || a === void 0 || a.call(n, u), o.error(u);
1847
1238
  }, function() {
1848
- var o, l;
1849
- c && ((o = n.unsubscribe) === null || o === void 0 || o.call(n)), (l = n.finalize) === null || l === void 0 || l.call(n);
1239
+ var u, a;
1240
+ c && ((u = n.unsubscribe) === null || u === void 0 || u.call(n)), (a = n.finalize) === null || a === void 0 || a.call(n);
1850
1241
  }));
1851
- }) : hr;
1242
+ }) : Oe;
1852
1243
  }
1853
- class Z {
1854
- static gte(e, t) {
1855
- return t === void 0 ? (n) => Z.gte(n, e) ? n : !1 : C.gte(C.coerce(e), C.coerce(t));
1856
- }
1857
- static lte(e, t) {
1858
- return t === void 0 ? (n) => Z.lte(n, e) ? n : !1 : C.lte(C.coerce(e), C.coerce(t));
1859
- }
1860
- static gt(e, t) {
1861
- return t === void 0 ? (n) => Z.gt(n, e) ? n : !1 : C.gt(C.coerce(e), C.coerce(t));
1862
- }
1863
- static lt(e, t) {
1864
- return t === void 0 ? (n) => Z.lt(n, e) ? n : !1 : C.lt(C.coerce(e), C.coerce(t));
1865
- }
1866
- /**
1867
- * Check if the two {@link IpcProtocolVersion} values are logically (==) equal.
1868
- *
1869
- * @param v1 - First version to compare
1870
- * @param v2 - Second version to compare
1871
- * @returns Return true if the versions are logically (==) equal.
1872
- */
1873
- static eq(e, t) {
1874
- return C.eq(C.coerce(e), C.coerce(t));
1875
- }
1876
- /**
1877
- * Check if the two {@link IpcProtocolVersion} values are not equal.
1878
- *
1879
- * @param v1 - First version to compare
1880
- * @param v2 - Second version to compare
1881
- * @returns Return true if the versions are not equal.
1882
- */
1883
- static neq(e, t) {
1884
- return C.neq(C.coerce(e), C.coerce(t));
1885
- }
1886
- /**
1887
- * Compare two {@link IpcProtocolVersion} values.
1888
- *
1889
- * @param v1 - First version to compare
1890
- * @param v2 - Second version to compare
1891
- * @returns Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in
1892
- * ascending order if passed to Array.sort().
1893
- */
1894
- static compare(e, t) {
1895
- return C.compare(C.coerce(e), C.coerce(t));
1244
+ const wt = /^(\d+)\.(\d+)$/;
1245
+ function St(r) {
1246
+ if (typeof r == "string") {
1247
+ const t = r.match(wt);
1248
+ if (t)
1249
+ return `${t[1]}.${t[2]}`;
1896
1250
  }
1251
+ throw new nt(r);
1252
+ }
1253
+ function ge(r) {
1254
+ const t = St(r), [e, n] = t.split("."), [i, o] = [parseInt(e), parseInt(n)];
1255
+ return [i, o];
1897
1256
  }
1898
- const zt = "1.0";
1899
- class to {
1257
+ function Pe(r, t) {
1258
+ const [e, n] = ge(r), [i, o] = ge(t);
1259
+ return e < i ? -1 : e > i ? 1 : n < o ? -1 : n > o ? 1 : 0;
1260
+ }
1261
+ function Ct(r, t) {
1262
+ return Pe(r, t) === 1;
1263
+ }
1264
+ function Et(r, t) {
1265
+ return Pe(r, t) >= 0;
1266
+ }
1267
+ const be = "2.0";
1268
+ class xt {
1900
1269
  /**
1901
1270
  * Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.
1902
1271
  *
@@ -1906,9 +1275,9 @@ class to {
1906
1275
  * @param supportedVersions - An array of supported protocol versions to choose from
1907
1276
  * @param logService - An instance of a logging service or utility
1908
1277
  */
1909
- constructor(e, t) {
1910
- if (q(this, "negotiatedProtocolVersion"), q(this, "currentContext"), q(this, "incomingMessages$"), q(this, "inIframe", !1), q(this, "embeddedResult"), q(this, "iframePort1"), q(this, "iframePort2"), this.supportedVersions = e, this.logService = t, this.incomingMessages$ = new pr(), this.supportedVersions = e.filter(Z.gte(zt)), !this.supportedVersions.length)
1911
- throw new Vt(e, zt);
1278
+ constructor(t, e) {
1279
+ if (E(this, "negotiatedProtocolVersion"), E(this, "currentContext"), E(this, "incomingMessages$"), E(this, "inIframe", !1), E(this, "embeddedResult"), E(this, "iframePort1"), E(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new xe(), this.supportedVersions = t.filter((n) => Et(n, be)), !this.supportedVersions.length)
1280
+ throw new le(t, be);
1912
1281
  this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
1913
1282
  }
1914
1283
  get parent() {
@@ -1923,18 +1292,18 @@ class to {
1923
1292
  // only used by remote party, not used locally
1924
1293
  // @ts-expect-error
1925
1294
  get port1() {
1926
- var e, t;
1927
- return this.inIframe ? this.iframePort1 : (t = (e = window.Acrobits) == null ? void 0 : e.messageChannel) == null ? void 0 : t.port1;
1295
+ var t, e;
1296
+ return this.inIframe ? this.iframePort1 : (e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) == null ? void 0 : e.port1;
1928
1297
  }
1929
1298
  get port2() {
1930
- var e, t, n, i;
1299
+ var t, e, n, i;
1931
1300
  if (this.inIframe) {
1932
1301
  if (!this.iframePort2)
1933
- throw new kt("port2");
1302
+ throw new ae("port2");
1934
1303
  return this.iframePort2;
1935
1304
  } else {
1936
- if (!((t = (e = window.Acrobits) == null ? void 0 : e.messageChannel) != null && t.port2))
1937
- throw new kt("port2");
1305
+ if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))
1306
+ throw new ae("port2");
1938
1307
  return (i = (n = window.Acrobits) == null ? void 0 : n.messageChannel) == null ? void 0 : i.port2;
1939
1308
  }
1940
1309
  }
@@ -1944,9 +1313,9 @@ class to {
1944
1313
  * @returns Observable with the {@link AppContext} the app is running under. Emits once.
1945
1314
  */
1946
1315
  determineContext() {
1947
- return eo(1e3).pipe(
1948
- T(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
1949
- V(1)
1316
+ return Xe(1e3).pipe(
1317
+ h(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
1318
+ S(1)
1950
1319
  );
1951
1320
  }
1952
1321
  /**
@@ -1957,26 +1326,26 @@ class to {
1957
1326
  */
1958
1327
  openBridge() {
1959
1328
  if (!this.isEmbedded())
1960
- throw new N(this.currentContext);
1961
- const e = "HELLO", t = this.createMessage(e);
1962
- t.protocolVersions = this.supportedVersions, this.logCreated(e, t);
1329
+ throw new p(this.currentContext);
1330
+ const t = "HELLO", e = this.createMessage(t);
1331
+ e.protocolVersions = this.supportedVersions, this.logCreated(t, e);
1963
1332
  const n = this.incomingMessages$.pipe(
1964
- M((i) => i.type === e && i.replyTo === t.id),
1965
- T((i) => i),
1966
- P(this.logReceived(e)),
1967
- T((i) => {
1968
- if (this.supportedVersions.some(Z.gt(i.protocolVersion)))
1969
- throw new Vt(i.protocolVersion, this.supportedVersions[0]);
1333
+ g((i) => i.type === t && i.replyTo === e.id),
1334
+ h((i) => i),
1335
+ v(this.logReceived(t)),
1336
+ h((i) => {
1337
+ if (this.supportedVersions.some((o) => Ct(o, i.protocolVersion)))
1338
+ throw new le(i.protocolVersion, this.supportedVersions[0]);
1970
1339
  return i;
1971
1340
  }),
1972
- P((i) => {
1341
+ v((i) => {
1973
1342
  this.negotiatedProtocolVersion = i.protocolVersion, this.logService.info(
1974
1343
  `[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
1975
1344
  );
1976
1345
  }),
1977
- V(1)
1346
+ S(1)
1978
1347
  );
1979
- return this.logService.debug(`Created ${e} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(t)) : this.finishIpcSetup(t), n;
1348
+ return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), n;
1980
1349
  }
1981
1350
  /**
1982
1351
  * Request an SSO Token from the Host app to authenticate the current user and make further API
@@ -1987,16 +1356,16 @@ class to {
1987
1356
  */
1988
1357
  requestSSOToken() {
1989
1358
  if (!this.isEmbedded())
1990
- throw new N(this.currentContext);
1991
- const e = "TOKEN", t = this.createMessage(e);
1992
- this.logCreated(e, t);
1359
+ throw new p(this.currentContext);
1360
+ const t = "TOKEN", e = this.createMessage(t);
1361
+ this.logCreated(t, e);
1993
1362
  const n = this.incomingMessages$.pipe(
1994
- M((i) => i.type === e && i.replyTo === t.id),
1995
- T((i) => i),
1996
- P(this.logReceived(e)),
1997
- V(1)
1363
+ g((i) => i.type === t && i.replyTo === e.id),
1364
+ h((i) => i),
1365
+ v(this.logReceived(t)),
1366
+ S(1)
1998
1367
  );
1999
- return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(t), this.logSent(e, t), n;
1368
+ return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), n;
2000
1369
  }
2001
1370
  /**
2002
1371
  * Sends the {@link JoiningRoomMessage} lifecycle message to the Host application based on the
@@ -2011,20 +1380,20 @@ class to {
2011
1380
  *
2012
1381
  * @returns This method returns void.
2013
1382
  */
2014
- sendJoiningRoomMessage(e) {
1383
+ sendJoiningRoomMessage(t) {
2015
1384
  if (!this.isEmbedded())
2016
- throw new N(this.currentContext);
1385
+ throw new p(this.currentContext);
2017
1386
  const {
2018
- roomName: t,
1387
+ roomName: e,
2019
1388
  roomInvite: n,
2020
1389
  displayName: i,
2021
- jwtToken: s,
2022
- serverUrl: a,
1390
+ jwtToken: o,
1391
+ serverUrl: s,
2023
1392
  region: c,
2024
- joinMicMuted: o,
2025
- joinWithoutCamera: l
2026
- } = e, u = "JOINING ROOM", p = this.createMessage(u, !1);
2027
- p.roomName = t, p.jwtToken = s, p.serverUrl = a, p.region = c, p.roomInvite = n, p.joinMicMuted = o ?? !1, p.joinWithoutCamera = l ?? !1, p.displayName = i, this.logCreated(u, p), this.port2.postMessage(p), this.logSent(u, p);
1393
+ joinMicMuted: u,
1394
+ joinWithoutCamera: a
1395
+ } = t, d = "JOINING ROOM", f = this.createMessage(d, !1);
1396
+ f.roomName = e, f.jwtToken = o, f.serverUrl = s, f.region = c, f.roomInvite = n, f.joinMicMuted = u ?? !1, f.joinWithoutCamera = a ?? !1, f.displayName = i, this.logCreated(d, f), this.port2.postMessage(f), this.logSent(d, f);
2028
1397
  }
2029
1398
  /**
2030
1399
  * Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
@@ -2037,11 +1406,11 @@ class to {
2037
1406
  *
2038
1407
  * @returns This method returns void.
2039
1408
  */
2040
- sendLeavingRoomMessage(e) {
1409
+ sendLeavingRoomMessage(t) {
2041
1410
  if (!this.isEmbedded())
2042
- throw new N(this.currentContext);
2043
- const t = "LEAVING ROOM", n = this.createMessage(t, !1);
2044
- n.roomName = e, this.logCreated(t, n), this.port2.postMessage(n), this.logSent(t, n);
1411
+ throw new p(this.currentContext);
1412
+ const e = "LEAVING ROOM", n = this.createMessage(e, !1);
1413
+ n.roomName = t, this.logCreated(e, n), this.port2.postMessage(n), this.logSent(e, n);
2045
1414
  }
2046
1415
  /**
2047
1416
  * Setup listener for {@link JoinRoomMessage}, which can be sent by a host app to ask the client
@@ -2056,7 +1425,7 @@ class to {
2056
1425
  * Here is an example of how a listener can be setup:
2057
1426
  *
2058
1427
  * ```ts
2059
- * const ipcHelper = new IpcHelper(['1.0'], console);
1428
+ * const ipcHelper = new IpcHelper(['2.0'], console);
2060
1429
  *
2061
1430
  * const joinRoomSubscription = ipcHelper.onJoinRoomMessage().subscribe((msg) => {
2062
1431
  * // your logic for handling the message goes here
@@ -2071,13 +1440,13 @@ class to {
2071
1440
  */
2072
1441
  onJoinRoomMessage() {
2073
1442
  if (!this.isEmbedded())
2074
- throw new N(this.currentContext);
2075
- const e = "JOIN ROOM";
1443
+ throw new p(this.currentContext);
1444
+ const t = "JOIN ROOM";
2076
1445
  return this.incomingMessages$.pipe(
2077
- M((t) => t.type === e && t.target === "client"),
2078
- T((t) => t),
2079
- P(this.logReceived(e)),
2080
- T((t) => t)
1446
+ g((e) => e.type === t && e.target === "client"),
1447
+ h((e) => e),
1448
+ v(this.logReceived(t)),
1449
+ h((e) => e)
2081
1450
  );
2082
1451
  }
2083
1452
  /**
@@ -2092,7 +1461,7 @@ class to {
2092
1461
  * Here is an example of how a listener can be setup:
2093
1462
  *
2094
1463
  * ```ts
2095
- * const ipcHelper = new IpcHelper(['1.0'], console);
1464
+ * const ipcHelper = new IpcHelper(['2.0'], console);
2096
1465
  *
2097
1466
  * const leaveRoomSubscription = ipcHelper.onLeaveRoomMessage().subscribe((msg) => {
2098
1467
  * // your logic for handling the message goes here
@@ -2107,13 +1476,13 @@ class to {
2107
1476
  */
2108
1477
  onLeaveRoomMessage() {
2109
1478
  if (!this.isEmbedded())
2110
- throw new N(this.currentContext);
2111
- const e = "LEAVE ROOM";
1479
+ throw new p(this.currentContext);
1480
+ const t = "LEAVE ROOM";
2112
1481
  return this.incomingMessages$.pipe(
2113
- M((t) => t.type === e && t.target === "client"),
2114
- T((t) => t),
2115
- P(this.logReceived(e)),
2116
- T((t) => t)
1482
+ g((e) => e.type === t && e.target === "client"),
1483
+ h((e) => e),
1484
+ v(this.logReceived(t)),
1485
+ h((e) => e)
2117
1486
  );
2118
1487
  }
2119
1488
  /**
@@ -2129,7 +1498,7 @@ class to {
2129
1498
  * Here is an example of how a listener can be setup:
2130
1499
  *
2131
1500
  * ```ts
2132
- * const ipcHelper = new IpcHelper(['1.0'], console);
1501
+ * const ipcHelper = new IpcHelper(['2.0'], console);
2133
1502
  *
2134
1503
  * const configSubscription = ipcHelper.onConfigMessage().subscribe((msg) => {
2135
1504
  * // your logic for handling the configuration goes here
@@ -2144,53 +1513,53 @@ class to {
2144
1513
  */
2145
1514
  onConfigMessage() {
2146
1515
  if (!this.isEmbedded())
2147
- throw new N(this.currentContext);
2148
- const e = "CONFIG";
1516
+ throw new p(this.currentContext);
1517
+ const t = "CONFIG";
2149
1518
  return this.incomingMessages$.pipe(
2150
- M((t) => t.type === e && t.target === "client"),
2151
- T((t) => t),
2152
- P(this.logReceived(e)),
2153
- T((t) => ({
2154
- preferredCameraType: t.preferredCameraType,
2155
- preferredMicType: t.preferredMicType,
2156
- preferredOutputType: t.preferredOutputType,
2157
- preferredCameraDeviceLabel: t.preferredCameraDeviceLabel,
2158
- preferredMicDeviceLabel: t.preferredMicDeviceLabel,
2159
- preferredOutputDeviceLabel: t.preferredOutputDeviceLabel,
2160
- performanceProfile: t.performanceProfile,
2161
- cloudUsername: t.cloudUsername,
2162
- configuredOAuthProviders: t.configuredOAuthProviders,
2163
- locales: t.locales ? [...t.locales] : []
1519
+ g((e) => e.type === t && e.target === "client"),
1520
+ h((e) => e),
1521
+ v(this.logReceived(t)),
1522
+ h((e) => ({
1523
+ preferredCameraType: e.preferredCameraType,
1524
+ preferredMicType: e.preferredMicType,
1525
+ preferredOutputType: e.preferredOutputType,
1526
+ preferredCameraDeviceLabel: e.preferredCameraDeviceLabel,
1527
+ preferredMicDeviceLabel: e.preferredMicDeviceLabel,
1528
+ preferredOutputDeviceLabel: e.preferredOutputDeviceLabel,
1529
+ performanceProfile: e.performanceProfile,
1530
+ cloudUsername: e.cloudUsername,
1531
+ configuredOAuthProviders: e.configuredOAuthProviders,
1532
+ locales: e.locales ? [...e.locales] : []
2164
1533
  }))
2165
1534
  );
2166
1535
  }
2167
- sendScreenshareSourceMessage(e) {
1536
+ sendScreenshareSourceMessage(t) {
2168
1537
  if (!this.isEmbedded())
2169
- throw new N(this.currentContext);
2170
- const t = "SCREENSHARE SOURCE", n = this.createMessage(t);
2171
- n.sourceTypes = e, this.logCreated(t, n);
1538
+ throw new p(this.currentContext);
1539
+ const e = "SCREENSHARE SOURCE", n = this.createMessage(e);
1540
+ n.sourceTypes = t, this.logCreated(e, n);
2172
1541
  const i = this.incomingMessages$.pipe(
2173
- M((s) => s.type === t && s.replyTo === n.id),
2174
- T((s) => s),
2175
- P(this.logReceived(t)),
2176
- T((s) => s),
2177
- V(1)
1542
+ g((o) => o.type === e && o.replyTo === n.id),
1543
+ h((o) => o),
1544
+ v(this.logReceived(e)),
1545
+ h((o) => o),
1546
+ S(1)
2178
1547
  );
2179
- return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(n), this.logSent(t, n), i;
1548
+ return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(n), this.logSent(e, n), i;
2180
1549
  }
2181
- layoutChange(e, t, n) {
1550
+ layoutChange(t, e, n) {
2182
1551
  if (!this.isEmbedded())
2183
- throw new N(this.currentContext);
1552
+ throw new p(this.currentContext);
2184
1553
  const i = "LAYOUT CHANGE";
2185
- let s, a;
2186
- if (t && n ? (s = this.createMessage(i, !1, n), s.result = t) : (s = this.createMessage(i), a = this.incomingMessages$.pipe(
2187
- M((c) => c.type === i && c.replyTo === s.id),
2188
- T((c) => c),
2189
- P(this.logReceived(i)),
2190
- T((c) => c),
2191
- V(1)
2192
- ), this.logService.debug(`Created ${i} Reply handler`)), s.layout = e, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s), a)
2193
- return a;
1554
+ let o, s;
1555
+ if (e && n ? (o = this.createMessage(i, !1, n), o.result = e) : (o = this.createMessage(i), s = this.incomingMessages$.pipe(
1556
+ g((c) => c.type === i && c.replyTo === o.id),
1557
+ h((c) => c),
1558
+ v(this.logReceived(i)),
1559
+ h((c) => c),
1560
+ S(1)
1561
+ ), this.logService.debug(`Created ${i} Reply handler`)), o.layout = t, this.logCreated(i, o), this.port2.postMessage(o), this.logSent(i, o), s)
1562
+ return s;
2194
1563
  }
2195
1564
  /**
2196
1565
  * Setup listener for {@link LayoutChangeMessage}, which can be sent by a host app if it needs to
@@ -2207,7 +1576,7 @@ class to {
2207
1576
  * Here is an example of how a listener can be setup:
2208
1577
  *
2209
1578
  * ```ts
2210
- * const ipcHelper = new IpcHelper(['1.0'], console);
1579
+ * const ipcHelper = new IpcHelper(['2.0'], console);
2211
1580
  *
2212
1581
  * const layoutChangeSubscription = ipcHelper.onLayoutChangeMessage().subscribe((msg) => {
2213
1582
  * // your logic for handling the request goes here
@@ -2225,65 +1594,65 @@ class to {
2225
1594
  */
2226
1595
  onLayoutChangeMessage() {
2227
1596
  if (!this.isEmbedded())
2228
- throw new N(this.currentContext);
2229
- const e = "LAYOUT CHANGE";
1597
+ throw new p(this.currentContext);
1598
+ const t = "LAYOUT CHANGE";
2230
1599
  return this.incomingMessages$.pipe(
2231
- M((t) => t.type === e && t.target === "client" && t.replyTo === null),
2232
- T((t) => t),
2233
- P(this.logReceived(e)),
2234
- T((t) => t)
1600
+ g((e) => e.type === t && e.target === "client" && e.replyTo === null),
1601
+ h((e) => e),
1602
+ v(this.logReceived(t)),
1603
+ h((e) => e)
2235
1604
  );
2236
1605
  }
2237
- requestOAuthToken(e) {
1606
+ requestOAuthToken(t) {
2238
1607
  if (!this.isEmbedded())
2239
- throw new N(this.currentContext);
2240
- Array.isArray(e) || (e = [e]);
2241
- const t = "OAUTH TOKEN", n = this.createMessage(t);
2242
- n.providerTypes = e, this.logCreated(t, n);
1608
+ throw new p(this.currentContext);
1609
+ Array.isArray(t) || (t = [t]);
1610
+ const e = "OAUTH TOKEN", n = this.createMessage(e);
1611
+ n.providerTypes = t, this.logCreated(e, n);
2243
1612
  const i = this.incomingMessages$.pipe(
2244
- M((s) => s.type === t && s.replyTo === n.id),
2245
- T((s) => s),
2246
- P(this.logReceived(t)),
2247
- V(1)
1613
+ g((o) => o.type === e && o.replyTo === n.id),
1614
+ h((o) => o),
1615
+ v(this.logReceived(e)),
1616
+ S(1)
2248
1617
  );
2249
- return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(n), this.logSent(t, n), i;
1618
+ return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(n), this.logSent(e, n), i;
2250
1619
  }
2251
- openUrl(e, t) {
1620
+ openUrl(t, e) {
2252
1621
  if (!this.isEmbedded())
2253
- throw new N(this.currentContext);
1622
+ throw new p(this.currentContext);
2254
1623
  const n = "OPEN URL", i = this.createMessage(n, !1);
2255
- i.url = e, i.data = t, this.logCreated(n, i), this.port2.postMessage(i), this.logSent(n, i);
1624
+ i.url = t, i.data = e, this.logCreated(n, i), this.port2.postMessage(i), this.logSent(n, i);
2256
1625
  }
2257
- selectContacts(e, t, n) {
1626
+ selectContacts(t, e, n) {
2258
1627
  if (!this.isEmbedded())
2259
- throw new N(this.currentContext);
2260
- if (t === "group" && n === void 0)
2261
- throw new $e(
1628
+ throw new p(this.currentContext);
1629
+ if (e === "group" && n === void 0)
1630
+ throw new $(
2262
1631
  "currentContacts",
2263
1632
  n,
2264
1633
  "currentContacts is required for group streams"
2265
1634
  );
2266
- if (t === "direct" && n !== void 0)
2267
- throw new $e(
1635
+ if (e === "direct" && n !== void 0)
1636
+ throw new $(
2268
1637
  "currentContacts",
2269
1638
  n,
2270
1639
  "currentContacts should not be passed for direct streams"
2271
1640
  );
2272
- const i = "SELECT CONTACTS", s = this.createMessage(i, !0);
2273
- s.streamType = t, s.streamId = e, s.currentContacts = n, this.logCreated(i, s);
2274
- const a = this.incomingMessages$.pipe(
2275
- M((c) => c.type === i && c.replyTo === s.id),
2276
- P(this.logReceived(i)),
1641
+ const i = "SELECT CONTACTS", o = this.createMessage(i, !0);
1642
+ o.streamType = e, o.streamId = t, o.currentContacts = n, this.logCreated(i, o);
1643
+ const s = this.incomingMessages$.pipe(
1644
+ g((c) => c.type === i && c.replyTo === o.id),
1645
+ v(this.logReceived(i)),
2277
1646
  // validate if `streamId` is the same as we sent
2278
- T((c) => {
2279
- const o = c;
2280
- if (o.streamId !== e)
2281
- throw new xs(o.streamId, e);
2282
- return t === "direct" && o.contacts.length > 1 && (o.contacts = [o.contacts[0]]), o;
1647
+ h((c) => {
1648
+ const u = c;
1649
+ if (u.streamId !== t)
1650
+ throw new rt(u.streamId, t);
1651
+ return e === "direct" && u.contacts.length > 1 && (u.contacts = [u.contacts[0]]), u;
2283
1652
  }),
2284
- V(1)
1653
+ S(1)
2285
1654
  );
2286
- return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(s), this.logSent(i, s), a;
1655
+ return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o), s;
2287
1656
  }
2288
1657
  /**
2289
1658
  * Request detailed contact information for the given Cloud usernames.
@@ -2293,20 +1662,20 @@ class to {
2293
1662
  * @returns Observable with a {@link MatchContactsMessageReply} instance containing the requested
2294
1663
  * {@link ContactItem} information. Emits once.
2295
1664
  */
2296
- matchContacts(e) {
1665
+ matchContacts(t) {
2297
1666
  if (!this.isEmbedded())
2298
- throw new N(this.currentContext);
2299
- if (!e.length)
2300
- throw new $e("contacts", e, "At least one contact is required");
2301
- const t = "MATCH CONTACTS", n = this.createMessage(t);
2302
- n.contacts = [...e], this.logCreated(t, n);
1667
+ throw new p(this.currentContext);
1668
+ if (!t.length)
1669
+ throw new $("contacts", t, "At least one contact is required");
1670
+ const e = "MATCH CONTACTS", n = this.createMessage(e);
1671
+ n.contacts = [...t], this.logCreated(e, n);
2303
1672
  const i = this.incomingMessages$.pipe(
2304
- M((s) => s.type === t && s.replyTo === n.id),
2305
- P(this.logReceived(t)),
2306
- T((s) => s),
2307
- V(1)
1673
+ g((o) => o.type === e && o.replyTo === n.id),
1674
+ v(this.logReceived(e)),
1675
+ h((o) => o),
1676
+ S(1)
2308
1677
  );
2309
- return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(n), this.logSent(t, n), i;
1678
+ return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(n), this.logSent(e, n), i;
2310
1679
  }
2311
1680
  /**
2312
1681
  * Setup listener for {@link PushMessageMessage}, which can be sent by a Host app to forward an
@@ -2320,7 +1689,7 @@ class to {
2320
1689
  * Here is an example of how a listener can be setup:
2321
1690
  *
2322
1691
  * ```ts
2323
- * const ipcHelper = new IpcHelper(['1.0'], console);
1692
+ * const ipcHelper = new IpcHelper(['2.0'], console);
2324
1693
  *
2325
1694
  * const pushMessageSubscription = ipcHelper.onPushMessageMessage().subscribe((msg) => {
2326
1695
  * // your logic for handling the incoming push message goes here
@@ -2335,12 +1704,12 @@ class to {
2335
1704
  */
2336
1705
  onPushMessageMessage() {
2337
1706
  if (!this.isEmbedded())
2338
- throw new N(this.currentContext);
2339
- const e = "PUSH MESSAGE";
1707
+ throw new p(this.currentContext);
1708
+ const t = "PUSH MESSAGE";
2340
1709
  return this.incomingMessages$.pipe(
2341
- M((t) => t.type === e && t.target === "client"),
2342
- T((t) => t),
2343
- P(this.logReceived(e))
1710
+ g((e) => e.type === t && e.target === "client"),
1711
+ h((e) => e),
1712
+ v(this.logReceived(t))
2344
1713
  );
2345
1714
  }
2346
1715
  /**
@@ -2354,16 +1723,16 @@ class to {
2354
1723
  */
2355
1724
  requestPushToken() {
2356
1725
  if (!this.isEmbedded())
2357
- throw new N(this.currentContext);
2358
- const e = "PUSH TOKEN", t = this.createMessage(e);
2359
- this.logCreated(e, t);
1726
+ throw new p(this.currentContext);
1727
+ const t = "PUSH TOKEN", e = this.createMessage(t);
1728
+ this.logCreated(t, e);
2360
1729
  const n = this.incomingMessages$.pipe(
2361
- M((i) => i.type === e && i.replyTo === t.id),
2362
- P(this.logReceived(e)),
2363
- T((i) => i),
2364
- V(1)
1730
+ g((i) => i.type === t && i.replyTo === e.id),
1731
+ v(this.logReceived(t)),
1732
+ h((i) => i),
1733
+ S(1)
2365
1734
  );
2366
- return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(t), this.logSent(e, t), n;
1735
+ return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), n;
2367
1736
  }
2368
1737
  /**
2369
1738
  * Setup listener for {@link BadgeQueryMessage}, which can be sent by a `Host` app to request the
@@ -2374,12 +1743,12 @@ class to {
2374
1743
  */
2375
1744
  onBadgeQueryMessage() {
2376
1745
  if (!this.isEmbedded())
2377
- throw new N(this.currentContext);
2378
- const e = "BADGE QUERY";
1746
+ throw new p(this.currentContext);
1747
+ const t = "BADGE QUERY";
2379
1748
  return this.incomingMessages$.pipe(
2380
- M((t) => t.type === e && t.target === "client"),
2381
- T((t) => t),
2382
- P(this.logReceived(e))
1749
+ g((e) => e.type === t && e.target === "client"),
1750
+ h((e) => e),
1751
+ v(this.logReceived(t))
2383
1752
  );
2384
1753
  }
2385
1754
  /**
@@ -2393,11 +1762,11 @@ class to {
2393
1762
  * @param count - The counter's value
2394
1763
  * @param replyTo - _Optional_. The message ID to which the reply should be sent
2395
1764
  */
2396
- sendBadgeUpdateMessage(e, t) {
1765
+ sendBadgeUpdateMessage(t, e) {
2397
1766
  if (!this.isEmbedded())
2398
- throw new N(this.currentContext);
2399
- const n = "BADGE UPDATE", i = this.createMessage(n, !1, t);
2400
- i.count = e, this.logCreated(n, i), this.port2.postMessage(i), this.logSent(n, i);
1767
+ throw new p(this.currentContext);
1768
+ const n = "BADGE UPDATE", i = this.createMessage(n, !1, e);
1769
+ i.count = t, this.logCreated(n, i), this.port2.postMessage(i), this.logSent(n, i);
2401
1770
  }
2402
1771
  /**
2403
1772
  * Setup listener for {@link HostInForegroundMessage}, which can be sent by a `Host` app to
@@ -2412,12 +1781,12 @@ class to {
2412
1781
  */
2413
1782
  onHostInForegroundMessage() {
2414
1783
  if (!this.isEmbedded())
2415
- throw new N(this.currentContext);
2416
- const e = "HOST IN FOREGROUND";
1784
+ throw new p(this.currentContext);
1785
+ const t = "HOST IN FOREGROUND";
2417
1786
  return this.incomingMessages$.pipe(
2418
- M((t) => t.type === e && t.target === "client"),
2419
- T((t) => t),
2420
- P(this.logReceived(e))
1787
+ g((e) => e.type === t && e.target === "client"),
1788
+ h((e) => e),
1789
+ v(this.logReceived(t))
2421
1790
  );
2422
1791
  }
2423
1792
  /**
@@ -2430,469 +1799,54 @@ class to {
2430
1799
  isEmbedded() {
2431
1800
  if (this.embeddedResult !== null)
2432
1801
  return this.embeddedResult;
2433
- let e = !1;
2434
- return this.logService.debug("Checking if running in iframe..."), e = !!this.frameElement, e || (e = this.self !== this.parent), e ? (this.logService.debug("In iframe"), this.inIframe = !0, this.embeddedResult = !0, !0) : (this.logService.debug("Not in iframe"), this.logService.debug("Checking if running in native app..."), !e && (e = !!window.Acrobits, e) ? (this.logService.debug("In native app"), this.embeddedResult = !0, e) : (this.logService.debug("Not running in native app"), this.embeddedResult = !1, this.embeddedResult));
1802
+ let t = !1;
1803
+ return this.logService.debug("Checking if running in iframe..."), t = !!this.frameElement, t || (t = this.self !== this.parent), t ? (this.logService.debug("In iframe"), this.inIframe = !0, this.embeddedResult = !0, !0) : (this.logService.debug("Not in iframe"), this.logService.debug("Checking if running in native app..."), !t && (t = !!window.Acrobits, t) ? (this.logService.debug("In native app"), this.embeddedResult = !0, t) : (this.logService.debug("Not running in native app"), this.embeddedResult = !1, this.embeddedResult));
2435
1804
  }
2436
- logReceived(e, t) {
2437
- const n = (i) => this.logService.debug(`[IPC] Received ${e} message`, i);
2438
- return t && n(t), n;
1805
+ logReceived(t, e) {
1806
+ const n = (i) => this.logService.debug(`[IPC] Received ${t} message`, i);
1807
+ return e && n(e), n;
2439
1808
  }
2440
- logSent(e, t) {
2441
- this.logService.debug(`[IPC] Sent ${e} message`, t);
1809
+ logSent(t, e) {
1810
+ this.logService.debug(`[IPC] Sent ${t} message`, e);
2442
1811
  }
2443
- logCreated(e, t) {
2444
- this.logService.debug(`[IPC] Created ${e} message`, t);
1812
+ logCreated(t, e) {
1813
+ this.logService.debug(`[IPC] Created ${t} message`, e);
2445
1814
  }
2446
1815
  async createIframeChannel() {
2447
- return new Promise((e) => {
2448
- const t = (n) => {
2449
- n.data === "message channel port" && (this.iframePort2 = n.ports[0], this.self.removeEventListener("message", t), e());
1816
+ return new Promise((t) => {
1817
+ const e = (n) => {
1818
+ n.data === "message channel port" && (this.iframePort2 = n.ports[0], this.self.removeEventListener("message", e), t());
2450
1819
  };
2451
- this.self.addEventListener("message", t), this.parent.postMessage("get channel", "*");
1820
+ this.self.addEventListener("message", e), this.parent.postMessage("get channel", "*");
2452
1821
  });
2453
1822
  }
2454
- finishIpcSetup(e) {
2455
- this.logService.debug("Registering listener on port2..."), this.port2.addEventListener("message", this.handleIpcMessage.bind(this)), this.port2.start(), this.logService.debug("Started listening on port2"), this.port2.postMessage(e), this.logSent("HELLO", e);
1823
+ finishIpcSetup(t) {
1824
+ this.logService.debug("Registering listener on port2..."), this.port2.addEventListener("message", this.handleIpcMessage.bind(this)), this.port2.start(), this.logService.debug("Started listening on port2"), this.port2.postMessage(t), this.logSent("HELLO", t);
2456
1825
  }
2457
- handleIpcMessage(e) {
2458
- const { data: t } = e;
2459
- !t.id || t.target !== "client" || this.incomingMessages$.next(t);
1826
+ handleIpcMessage(t) {
1827
+ const { data: e } = t;
1828
+ !e.id || e.target !== "client" || this.incomingMessages$.next(e);
2460
1829
  }
2461
- createMessage(e, t = !0, n) {
1830
+ createMessage(t, e = !0, n) {
2462
1831
  return {
2463
- type: e,
1832
+ type: t,
2464
1833
  id: this.generateId(),
2465
1834
  target: "host",
2466
- expectReply: t,
1835
+ expectReply: e,
2467
1836
  replyTo: n ?? null
2468
1837
  };
2469
1838
  }
2470
- generateId(e = 8, t = !1) {
1839
+ generateId(t = 8, e = !1) {
2471
1840
  let n = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
2472
1841
  const i = [];
2473
- t && (n = n.substr(0, n.indexOf("Q")));
2474
- for (let s = 0; s < e; s++)
1842
+ e && (n = n.substr(0, n.indexOf("Q")));
1843
+ for (let o = 0; o < t; o++)
2475
1844
  i.push(n[Math.floor(Math.random() * n.length)]);
2476
1845
  return i.join("");
2477
1846
  }
2478
1847
  }
2479
- var tt = function(r, e) {
2480
- return tt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) {
2481
- t.__proto__ = n;
2482
- } || function(t, n) {
2483
- for (var i in n)
2484
- Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
2485
- }, tt(r, e);
2486
- };
2487
- function ft(r, e) {
2488
- if (typeof e != "function" && e !== null)
2489
- throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
2490
- tt(r, e);
2491
- function t() {
2492
- this.constructor = r;
2493
- }
2494
- r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
2495
- }
2496
- function Qt(r) {
2497
- var e = typeof Symbol == "function" && Symbol.iterator, t = e && r[e], n = 0;
2498
- if (t)
2499
- return t.call(r);
2500
- if (r && typeof r.length == "number")
2501
- return {
2502
- next: function() {
2503
- return r && n >= r.length && (r = void 0), { value: r && r[n++], done: !r };
2504
- }
2505
- };
2506
- throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
2507
- }
2508
- function Ce(r, e) {
2509
- var t = typeof Symbol == "function" && r[Symbol.iterator];
2510
- if (!t)
2511
- return r;
2512
- var n = t.call(r), i, s = [], a;
2513
- try {
2514
- for (; (e === void 0 || e-- > 0) && !(i = n.next()).done; )
2515
- s.push(i.value);
2516
- } catch (c) {
2517
- a = { error: c };
2518
- } finally {
2519
- try {
2520
- i && !i.done && (t = n.return) && t.call(n);
2521
- } finally {
2522
- if (a)
2523
- throw a.error;
2524
- }
2525
- }
2526
- return s;
2527
- }
2528
- function Ne(r, e, t) {
2529
- if (t || arguments.length === 2)
2530
- for (var n = 0, i = e.length, s; n < i; n++)
2531
- (s || !(n in e)) && (s || (s = Array.prototype.slice.call(e, 0, n)), s[n] = e[n]);
2532
- return r.concat(s || Array.prototype.slice.call(e));
2533
- }
2534
- function Y(r) {
2535
- return typeof r == "function";
2536
- }
2537
- function fr(r) {
2538
- var e = function(n) {
2539
- Error.call(n), n.stack = new Error().stack;
2540
- }, t = r(e);
2541
- return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
2542
- }
2543
- var ze = fr(function(r) {
2544
- return function(t) {
2545
- r(this), this.message = t ? t.length + ` errors occurred during unsubscription:
2546
- ` + t.map(function(n, i) {
2547
- return i + 1 + ") " + n.toString();
2548
- }).join(`
2549
- `) : "", this.name = "UnsubscriptionError", this.errors = t;
2550
- };
2551
- });
2552
- function Wt(r, e) {
2553
- if (r) {
2554
- var t = r.indexOf(e);
2555
- 0 <= t && r.splice(t, 1);
2556
- }
2557
- }
2558
- var dt = function() {
2559
- function r(e) {
2560
- this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
2561
- }
2562
- return r.prototype.unsubscribe = function() {
2563
- var e, t, n, i, s;
2564
- if (!this.closed) {
2565
- this.closed = !0;
2566
- var a = this._parentage;
2567
- if (a)
2568
- if (this._parentage = null, Array.isArray(a))
2569
- try {
2570
- for (var c = Qt(a), o = c.next(); !o.done; o = c.next()) {
2571
- var l = o.value;
2572
- l.remove(this);
2573
- }
2574
- } catch (R) {
2575
- e = { error: R };
2576
- } finally {
2577
- try {
2578
- o && !o.done && (t = c.return) && t.call(c);
2579
- } finally {
2580
- if (e)
2581
- throw e.error;
2582
- }
2583
- }
2584
- else
2585
- a.remove(this);
2586
- var u = this.initialTeardown;
2587
- if (Y(u))
2588
- try {
2589
- u();
2590
- } catch (R) {
2591
- s = R instanceof ze ? R.errors : [R];
2592
- }
2593
- var p = this._finalizers;
2594
- if (p) {
2595
- this._finalizers = null;
2596
- try {
2597
- for (var w = Qt(p), f = w.next(); !f.done; f = w.next()) {
2598
- var g = f.value;
2599
- try {
2600
- Jt(g);
2601
- } catch (R) {
2602
- s = s ?? [], R instanceof ze ? s = Ne(Ne([], Ce(s)), Ce(R.errors)) : s.push(R);
2603
- }
2604
- }
2605
- } catch (R) {
2606
- n = { error: R };
2607
- } finally {
2608
- try {
2609
- f && !f.done && (i = w.return) && i.call(w);
2610
- } finally {
2611
- if (n)
2612
- throw n.error;
2613
- }
2614
- }
2615
- }
2616
- if (s)
2617
- throw new ze(s);
2618
- }
2619
- }, r.prototype.add = function(e) {
2620
- var t;
2621
- if (e && e !== this)
2622
- if (this.closed)
2623
- Jt(e);
2624
- else {
2625
- if (e instanceof r) {
2626
- if (e.closed || e._hasParent(this))
2627
- return;
2628
- e._addParent(this);
2629
- }
2630
- (this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(e);
2631
- }
2632
- }, r.prototype._hasParent = function(e) {
2633
- var t = this._parentage;
2634
- return t === e || Array.isArray(t) && t.includes(e);
2635
- }, r.prototype._addParent = function(e) {
2636
- var t = this._parentage;
2637
- this._parentage = Array.isArray(t) ? (t.push(e), t) : t ? [t, e] : e;
2638
- }, r.prototype._removeParent = function(e) {
2639
- var t = this._parentage;
2640
- t === e ? this._parentage = null : Array.isArray(t) && Wt(t, e);
2641
- }, r.prototype.remove = function(e) {
2642
- var t = this._finalizers;
2643
- t && Wt(t, e), e instanceof r && e._removeParent(this);
2644
- }, r.EMPTY = function() {
2645
- var e = new r();
2646
- return e.closed = !0, e;
2647
- }(), r;
2648
- }();
2649
- dt.EMPTY;
2650
- function ro(r) {
2651
- return r instanceof dt || r && "closed" in r && Y(r.remove) && Y(r.add) && Y(r.unsubscribe);
2652
- }
2653
- function Jt(r) {
2654
- Y(r) ? r() : r.unsubscribe();
2655
- }
2656
- var no = {
2657
- onUnhandledError: null,
2658
- onStoppedNotification: null,
2659
- Promise: void 0,
2660
- useDeprecatedSynchronousErrorHandling: !1,
2661
- useDeprecatedNextContext: !1
2662
- }, rt = {
2663
- setTimeout: function(r, e) {
2664
- for (var t = [], n = 2; n < arguments.length; n++)
2665
- t[n - 2] = arguments[n];
2666
- var i = rt.delegate;
2667
- return i != null && i.setTimeout ? i.setTimeout.apply(i, Ne([r, e], Ce(t))) : setTimeout.apply(void 0, Ne([r, e], Ce(t)));
2668
- },
2669
- clearTimeout: function(r) {
2670
- var e = rt.delegate;
2671
- return ((e == null ? void 0 : e.clearTimeout) || clearTimeout)(r);
2672
- },
2673
- delegate: void 0
2674
- };
2675
- function io(r) {
2676
- rt.setTimeout(function() {
2677
- throw r;
2678
- });
2679
- }
2680
- function Kt() {
2681
- }
2682
- var dr = function(r) {
2683
- ft(e, r);
2684
- function e(t) {
2685
- var n = r.call(this) || this;
2686
- return n.isStopped = !1, t ? (n.destination = t, ro(t) && t.add(n)) : n.destination = lo, n;
2687
- }
2688
- return e.create = function(t, n, i) {
2689
- return new vr(t, n, i);
2690
- }, e.prototype.next = function(t) {
2691
- this.isStopped || this._next(t);
2692
- }, e.prototype.error = function(t) {
2693
- this.isStopped || (this.isStopped = !0, this._error(t));
2694
- }, e.prototype.complete = function() {
2695
- this.isStopped || (this.isStopped = !0, this._complete());
2696
- }, e.prototype.unsubscribe = function() {
2697
- this.closed || (this.isStopped = !0, r.prototype.unsubscribe.call(this), this.destination = null);
2698
- }, e.prototype._next = function(t) {
2699
- this.destination.next(t);
2700
- }, e.prototype._error = function(t) {
2701
- try {
2702
- this.destination.error(t);
2703
- } finally {
2704
- this.unsubscribe();
2705
- }
2706
- }, e.prototype._complete = function() {
2707
- try {
2708
- this.destination.complete();
2709
- } finally {
2710
- this.unsubscribe();
2711
- }
2712
- }, e;
2713
- }(dt), so = Function.prototype.bind;
2714
- function Qe(r, e) {
2715
- return so.call(r, e);
2716
- }
2717
- var oo = function() {
2718
- function r(e) {
2719
- this.partialObserver = e;
2720
- }
2721
- return r.prototype.next = function(e) {
2722
- var t = this.partialObserver;
2723
- if (t.next)
2724
- try {
2725
- t.next(e);
2726
- } catch (n) {
2727
- Re(n);
2728
- }
2729
- }, r.prototype.error = function(e) {
2730
- var t = this.partialObserver;
2731
- if (t.error)
2732
- try {
2733
- t.error(e);
2734
- } catch (n) {
2735
- Re(n);
2736
- }
2737
- else
2738
- Re(e);
2739
- }, r.prototype.complete = function() {
2740
- var e = this.partialObserver;
2741
- if (e.complete)
2742
- try {
2743
- e.complete();
2744
- } catch (t) {
2745
- Re(t);
2746
- }
2747
- }, r;
2748
- }(), vr = function(r) {
2749
- ft(e, r);
2750
- function e(t, n, i) {
2751
- var s = r.call(this) || this, a;
2752
- if (Y(t) || !t)
2753
- a = {
2754
- next: t ?? void 0,
2755
- error: n ?? void 0,
2756
- complete: i ?? void 0
2757
- };
2758
- else {
2759
- var c;
2760
- s && no.useDeprecatedNextContext ? (c = Object.create(t), c.unsubscribe = function() {
2761
- return s.unsubscribe();
2762
- }, a = {
2763
- next: t.next && Qe(t.next, c),
2764
- error: t.error && Qe(t.error, c),
2765
- complete: t.complete && Qe(t.complete, c)
2766
- }) : a = t;
2767
- }
2768
- return s.destination = new oo(a), s;
2769
- }
2770
- return e;
2771
- }(dr);
2772
- function Re(r) {
2773
- io(r);
2774
- }
2775
- function ao(r) {
2776
- throw r;
2777
- }
2778
- var lo = {
2779
- closed: !0,
2780
- next: Kt,
2781
- error: ao,
2782
- complete: Kt
2783
- };
2784
- function co(r) {
2785
- return r;
2786
- }
2787
- function uo(r) {
2788
- return Y(r == null ? void 0 : r.lift);
2789
- }
2790
- function gr(r) {
2791
- return function(e) {
2792
- if (uo(e))
2793
- return e.lift(function(t) {
2794
- try {
2795
- return r(t, this);
2796
- } catch (n) {
2797
- this.error(n);
2798
- }
2799
- });
2800
- throw new TypeError("Unable to lift unknown Observable type");
2801
- };
2802
- }
2803
- function mr(r, e, t, n, i) {
2804
- return new ho(r, e, t, n, i);
2805
- }
2806
- var ho = function(r) {
2807
- ft(e, r);
2808
- function e(t, n, i, s, a, c) {
2809
- var o = r.call(this, t) || this;
2810
- return o.onFinalize = a, o.shouldUnsubscribe = c, o._next = n ? function(l) {
2811
- try {
2812
- n(l);
2813
- } catch (u) {
2814
- t.error(u);
2815
- }
2816
- } : r.prototype._next, o._error = s ? function(l) {
2817
- try {
2818
- s(l);
2819
- } catch (u) {
2820
- t.error(u);
2821
- } finally {
2822
- this.unsubscribe();
2823
- }
2824
- } : r.prototype._error, o._complete = i ? function() {
2825
- try {
2826
- i();
2827
- } catch (l) {
2828
- t.error(l);
2829
- } finally {
2830
- this.unsubscribe();
2831
- }
2832
- } : r.prototype._complete, o;
2833
- }
2834
- return e.prototype.unsubscribe = function() {
2835
- var t;
2836
- if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
2837
- var n = this.closed;
2838
- r.prototype.unsubscribe.call(this), !n && ((t = this.onFinalize) === null || t === void 0 || t.call(this));
2839
- }
2840
- }, e;
2841
- }(dr), po = fr(function(r) {
2842
- return function() {
2843
- r(this), this.name = "EmptyError", this.message = "no elements in sequence";
2844
- };
2845
- });
2846
- function ue(r, e) {
2847
- var t = typeof e == "object";
2848
- return new Promise(function(n, i) {
2849
- var s = new vr({
2850
- next: function(a) {
2851
- n(a), s.unsubscribe();
2852
- },
2853
- error: i,
2854
- complete: function() {
2855
- t ? n(e.defaultValue) : i(new po());
2856
- }
2857
- });
2858
- r.subscribe(s);
2859
- });
2860
- }
2861
- function Ie(r, e) {
2862
- return gr(function(t, n) {
2863
- var i = 0;
2864
- t.subscribe(mr(n, function(s) {
2865
- n.next(r.call(e, s, i++));
2866
- }));
2867
- });
2868
- }
2869
- function fo(r, e, t) {
2870
- var n = Y(r) || e || t ? { next: r, error: e, complete: t } : r;
2871
- return n ? gr(function(i, s) {
2872
- var a;
2873
- (a = n.subscribe) === null || a === void 0 || a.call(n);
2874
- var c = !0;
2875
- i.subscribe(mr(s, function(o) {
2876
- var l;
2877
- (l = n.next) === null || l === void 0 || l.call(n, o), s.next(o);
2878
- }, function() {
2879
- var o;
2880
- c = !1, (o = n.complete) === null || o === void 0 || o.call(n), s.complete();
2881
- }, function(o) {
2882
- var l;
2883
- c = !1, (l = n.error) === null || l === void 0 || l.call(n, o), s.error(o);
2884
- }, function() {
2885
- var o, l;
2886
- c && ((o = n.unsubscribe) === null || o === void 0 || o.call(n)), (l = n.finalize) === null || l === void 0 || l.call(n);
2887
- }));
2888
- }) : co;
2889
- }
2890
- function vo() {
2891
- return import("@acrobits/log-helper").then((r) => r.LogHelper.getLogger("IpcSDK")).catch(() => (console.log("Failed to load @acrobits/log-helper, using console logger"), Promise.resolve(console)));
2892
- }
2893
- const go = ["1.0"];
2894
- var de, nt;
2895
- class yo {
1848
+ const _t = ["2.0"];
1849
+ class It {
2896
1850
  /**
2897
1851
  * A class that manages the IPC communication between the `Client` and the `Host`.
2898
1852
  *
@@ -2903,29 +1857,26 @@ class yo {
2903
1857
  * @param logger - An optional logger instance to use for logging. If not provided, a default logger
2904
1858
  * will be used.
2905
1859
  */
2906
- constructor(e) {
2907
- vt(this, de);
1860
+ constructor(t) {
2908
1861
  /**
2909
1862
  * The type of the `Host` app the `Client` is embedded in.
2910
1863
  */
2911
- re(this, "host");
1864
+ _(this, "host");
2912
1865
  /**
2913
1866
  * The cloud ID of the `Host` app the `Client` is embedded in.
2914
1867
  */
2915
- re(this, "cloudId");
2916
- re(this, "logger");
2917
- re(this, "helper");
2918
- re(this, "listeners");
2919
- e ? this.logger = e : (this.logger = console, vo().then((t) => {
2920
- this.logger = t;
2921
- })), this.helper = new to(go, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(H.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(H.HostInForeground, /* @__PURE__ */ new Set());
1868
+ _(this, "cloudId");
1869
+ _(this, "logger");
1870
+ _(this, "helper");
1871
+ _(this, "listeners");
1872
+ this.logger = t ?? console, this.helper = new xt(_t, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(C.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(C.HostInForeground, /* @__PURE__ */ new Set());
2922
1873
  }
2923
1874
  /**
2924
1875
  * Returns whether the app is running inside a native WebView (`host` context) or as a
2925
1876
  * `standalone` app.
2926
1877
  */
2927
1878
  get context() {
2928
- return Fe(this, de, nt).call(this, this.helper.currentContext);
1879
+ return this.evaluateContext(this.helper.currentContext);
2929
1880
  }
2930
1881
  /**
2931
1882
  * Determines if the app is connected to a `Host` app.
@@ -2945,49 +1896,49 @@ class yo {
2945
1896
  * @returns A promise with {@link IPCContext} the app is running under.
2946
1897
  */
2947
1898
  async determineContext() {
2948
- const e = await ue(this.helper.determineContext(), {
1899
+ const t = await O(this.helper.determineContext(), {
2949
1900
  defaultValue: "guest"
2950
1901
  });
2951
- return Fe(this, de, nt).call(this, e);
1902
+ return this.evaluateContext(t);
2952
1903
  }
2953
1904
  /**
2954
1905
  * Initiates the IPC handshake with the `Host` app.
2955
1906
  */
2956
1907
  initiateConnection() {
2957
- return ue(
1908
+ return O(
2958
1909
  this.helper.openBridge().pipe(
2959
- fo((e) => {
2960
- this.helper.onBadgeQueryMessage().subscribe((t) => {
1910
+ Ze((t) => {
1911
+ this.helper.onBadgeQueryMessage().subscribe((e) => {
2961
1912
  var n;
2962
- this.logger.debug("Received Badge Query: ", t);
2963
- for (const i of ((n = this.listeners.get(H.BadgeQuery)) == null ? void 0 : n.values()) ?? [])
1913
+ this.logger.debug("Received Badge Query: ", e);
1914
+ for (const i of ((n = this.listeners.get(C.BadgeQuery)) == null ? void 0 : n.values()) ?? [])
2964
1915
  i();
2965
- }), this.helper.onHostInForegroundMessage().subscribe((t) => {
1916
+ }), this.helper.onHostInForegroundMessage().subscribe((e) => {
2966
1917
  var n;
2967
- this.logger.debug("Received Host In Foreground: ", t);
2968
- for (const i of ((n = this.listeners.get(H.HostInForeground)) == null ? void 0 : n.values()) ?? [])
1918
+ this.logger.debug("Received Host In Foreground: ", e);
1919
+ for (const i of ((n = this.listeners.get(C.HostInForeground)) == null ? void 0 : n.values()) ?? [])
2969
1920
  i();
2970
- }), this.cloudId = e.cloudId, this.host = e.host;
1921
+ }), this.cloudId = t.cloudId, this.host = t.host;
2971
1922
  }),
2972
- Ie(() => {
1923
+ T(() => {
2973
1924
  })
2974
1925
  )
2975
1926
  );
2976
1927
  }
2977
- selectContacts(e, t, n) {
1928
+ selectContacts(t, e, n) {
2978
1929
  this.logger.debug("Selecting Contacts: ", ...arguments);
2979
1930
  let i;
2980
- if (t === "multi") {
1931
+ if (e === "multi") {
2981
1932
  if (!n)
2982
- throw new $e(
1933
+ throw new $(
2983
1934
  "currentContacts",
2984
1935
  n,
2985
1936
  "currentContacts is required for group streams"
2986
1937
  );
2987
- i = this.helper.selectContacts(e.toString(), "group", n);
1938
+ i = this.helper.selectContacts(t.toString(), "group", n);
2988
1939
  } else
2989
- i = this.helper.selectContacts(e.toString(), "direct");
2990
- return ue(i.pipe(Ie((s) => s.contacts)));
1940
+ i = this.helper.selectContacts(t.toString(), "direct");
1941
+ return O(i.pipe(T((o) => o.contacts)));
2991
1942
  }
2992
1943
  /**
2993
1944
  * Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
@@ -2998,8 +1949,8 @@ class yo {
2998
1949
  * @returns A collection of {@link DetailedContactItem} objects which were matched against the
2999
1950
  * Host's contact list.
3000
1951
  */
3001
- matchContacts(e) {
3002
- return this.logger.debug("Match Contacts: ", e), ue(this.helper.matchContacts(e).pipe(Ie((t) => t.contacts)));
1952
+ matchContacts(t) {
1953
+ return this.logger.debug("Match Contacts: ", t), O(this.helper.matchContacts(t).pipe(T((e) => e.contacts)));
3003
1954
  }
3004
1955
  /**
3005
1956
  * Requests the `Host` app to provide the Push Token for the current device.
@@ -3007,15 +1958,15 @@ class yo {
3007
1958
  * @returns A promise with the Push Token as `string`.
3008
1959
  */
3009
1960
  requestPushToken() {
3010
- return this.logger.debug("Requesting Push Token"), ue(this.helper.requestPushToken().pipe(Ie((e) => e.pushToken)));
1961
+ return this.logger.debug("Requesting Push Token"), O(this.helper.requestPushToken().pipe(T((t) => t.pushToken)));
3011
1962
  }
3012
1963
  /**
3013
1964
  * Sends the current badge count to the `Host` app.
3014
1965
  *
3015
1966
  * @param count - The count to update the badge to.
3016
1967
  */
3017
- badgeUpdate(e) {
3018
- this.logger.debug("Sending Badge Update: ", e), this.helper.sendBadgeUpdateMessage(e);
1968
+ badgeUpdate(t) {
1969
+ this.logger.debug("Sending Badge Update: ", t), this.helper.sendBadgeUpdateMessage(t);
3019
1970
  }
3020
1971
  /**
3021
1972
  * Registers a callback to be invoked when a {@link IPCEvents.BadgeQuery} is received.
@@ -3024,11 +1975,11 @@ class yo {
3024
1975
  * is received.
3025
1976
  * @returns An unsubscribe callback to remove the listener.
3026
1977
  */
3027
- onBadgeQueryRequest(e) {
3028
- var t;
3029
- return this.logger.debug("Registering for Badge Query"), (t = this.listeners.get(H.BadgeQuery)) == null || t.add(e), () => {
1978
+ onBadgeQueryRequest(t) {
1979
+ var e;
1980
+ return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(C.BadgeQuery)) == null || e.add(t), () => {
3030
1981
  var n;
3031
- return (n = this.listeners.get(H.BadgeQuery)) == null ? void 0 : n.delete(e);
1982
+ return (n = this.listeners.get(C.BadgeQuery)) == null ? void 0 : n.delete(t);
3032
1983
  };
3033
1984
  }
3034
1985
  /**
@@ -3038,21 +1989,21 @@ class yo {
3038
1989
  * event is received.
3039
1990
  * @returns An unsubscribe callback to remove the listener.
3040
1991
  */
3041
- onHostInForeground(e) {
3042
- var t;
3043
- return this.logger.debug("Registering for Host In Foreground"), (t = this.listeners.get(H.HostInForeground)) == null || t.add(e), () => {
1992
+ onHostInForeground(t) {
1993
+ var e;
1994
+ return this.logger.debug("Registering for Host In Foreground"), (e = this.listeners.get(C.HostInForeground)) == null || e.add(t), () => {
3044
1995
  var n;
3045
- return (n = this.listeners.get(H.HostInForeground)) == null ? void 0 : n.delete(e);
1996
+ return (n = this.listeners.get(C.HostInForeground)) == null ? void 0 : n.delete(t);
3046
1997
  };
3047
1998
  }
1999
+ evaluateContext(t) {
2000
+ if (t === "user")
2001
+ return "host";
2002
+ if (t === "guest")
2003
+ return "standalone";
2004
+ }
3048
2005
  }
3049
- de = new WeakSet(), nt = function(e) {
3050
- if (e === "user")
3051
- return "host";
3052
- if (e === "guest")
3053
- return "standalone";
3054
- };
3055
2006
  export {
3056
- H as IPCEvents,
3057
- yo as IPCManager
2007
+ C as IPCEvents,
2008
+ It as IPCManager
3058
2009
  };