@vindral/web-sdk 4.0.0-103-gf1770916 → 4.0.0-105-g107caaa1

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.
@@ -1,44 +1,44 @@
1
1
  var Sc = Object.create;
2
2
  var _n = Object.defineProperty, Uc = Object.defineProperties, Ec = Object.getOwnPropertyDescriptor, Tc = Object.getOwnPropertyDescriptors;
3
- var Wr = Object.getOwnPropertySymbols;
3
+ var $r = Object.getOwnPropertySymbols;
4
4
  var Za = Object.prototype.hasOwnProperty, Ka = Object.prototype.propertyIsEnumerable;
5
- var It = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), Bt = (r) => {
5
+ var vt = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), xt = (r) => {
6
6
  throw TypeError(r);
7
7
  };
8
- var $r = (r, t, e) => t in r ? _n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, Mt = (r, t) => {
8
+ var Mr = (r, t, e) => t in r ? _n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, zt = (r, t) => {
9
9
  for (var e in t || (t = {}))
10
- Za.call(t, e) && $r(r, e, t[e]);
11
- if (Wr)
12
- for (var e of Wr(t))
13
- Ka.call(t, e) && $r(r, e, t[e]);
10
+ Za.call(t, e) && Mr(r, e, t[e]);
11
+ if ($r)
12
+ for (var e of $r(t))
13
+ Ka.call(t, e) && Mr(r, e, t[e]);
14
14
  return r;
15
- }, Mr = (r, t) => Uc(r, Tc(t)), Ya = (r, t) => _n(r, "name", { value: t, configurable: !0 });
15
+ }, zr = (r, t) => Uc(r, Tc(t)), Ya = (r, t) => _n(r, "name", { value: t, configurable: !0 });
16
16
  var Ja = (r, t) => {
17
17
  var e = {};
18
18
  for (var i in r)
19
19
  Za.call(r, i) && t.indexOf(i) < 0 && (e[i] = r[i]);
20
- if (r != null && Wr)
21
- for (var i of Wr(r))
20
+ if (r != null && $r)
21
+ for (var i of $r(r))
22
22
  t.indexOf(i) < 0 && Ka.call(r, i) && (e[i] = r[i]);
23
23
  return e;
24
24
  };
25
25
  var ue = (r) => {
26
26
  var t;
27
- return [, , , Sc((t = r == null ? void 0 : r[It("metadata")]) != null ? t : null)];
28
- }, Qa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ni = (r) => r !== void 0 && typeof r != "function" ? Bt("Function expected") : r, Ac = (r, t, e, i, n) => ({ kind: Qa[r], name: t, metadata: i, addInitializer: (a) => e._ ? Bt("Already initialized") : n.push(ni(a || null)) }), zt = (r, t) => $r(t, It("metadata"), r[3]), he = (r, t, e, i) => {
27
+ return [, , , Sc((t = r == null ? void 0 : r[vt("metadata")]) != null ? t : null)];
28
+ }, Qa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ai = (r) => r !== void 0 && typeof r != "function" ? xt("Function expected") : r, Ac = (r, t, e, i, n) => ({ kind: Qa[r], name: t, metadata: i, addInitializer: (a) => e._ ? xt("Already initialized") : n.push(ai(a || null)) }), Ht = (r, t) => Mr(t, vt("metadata"), r[3]), he = (r, t, e, i) => {
29
29
  for (var n = 0, a = r[t >> 1], c = a && a.length; n < c; n++) t & 1 ? a[n].call(e) : i = a[n].call(e, i);
30
30
  return i;
31
31
  }, H = (r, t, e, i, n, a) => {
32
- var c, d, w, p, m, b = t & 7, I = !!(t & 8), g = !!(t & 16), E = b > 3 ? r.length + 1 : b ? I ? 1 : 2 : 0, z = Qa[b + 5], _ = b > 3 && (r[E - 1] = []), D = r[E] || (r[E] = []), S = b && (!g && !I && (n = n.prototype), b < 5 && (b > 3 || !g) && Ec(b < 4 ? n : { get [e]() {
32
+ var c, l, w, p, m, b = t & 7, I = !!(t & 8), g = !!(t & 16), E = b > 3 ? r.length + 1 : b ? I ? 1 : 2 : 0, z = Qa[b + 5], _ = b > 3 && (r[E - 1] = []), D = r[E] || (r[E] = []), S = b && (!g && !I && (n = n.prototype), b < 5 && (b > 3 || !g) && Ec(b < 4 ? n : { get [e]() {
33
33
  return s(this, a);
34
34
  }, set [e](v) {
35
35
  return u(this, a, v);
36
36
  } }, e));
37
37
  b ? g && b < 4 && Ya(a, (b > 2 ? "set " : b > 1 ? "get " : "") + e) : Ya(n, e);
38
38
  for (var W = i.length - 1; W >= 0; W--)
39
- p = Ac(b, e, w = {}, r[3], D), b && (p.static = I, p.private = g, m = p.access = { has: g ? (v) => Dc(n, v) : (v) => e in v }, b ^ 3 && (m.get = g ? (v) => (b ^ 1 ? s : f)(v, n, b ^ 4 ? a : S.get) : (v) => v[e]), b > 2 && (m.set = g ? (v, R) => u(v, n, R, b ^ 4 ? a : S.set) : (v, R) => v[e] = R)), d = (0, i[W])(b ? b < 4 ? g ? a : S[z] : b > 4 ? void 0 : { get: S.get, set: S.set } : n, p), w._ = 1, b ^ 4 || d === void 0 ? ni(d) && (b > 4 ? _.unshift(d) : b ? g ? a = d : S[z] = d : n = d) : typeof d != "object" || d === null ? Bt("Object expected") : (ni(c = d.get) && (S.get = c), ni(c = d.set) && (S.set = c), ni(c = d.init) && _.unshift(c));
40
- return b || zt(r, n), S && _n(n, e, S), g ? b ^ 4 ? a : S : n;
41
- }, l = (r, t, e) => $r(r, typeof t != "symbol" ? t + "" : t, e), ta = (r, t, e) => t.has(r) || Bt("Cannot " + e), Dc = (r, t) => Object(t) !== t ? Bt('Cannot use the "in" operator on this value') : r.has(t), s = (r, t, e) => (ta(r, t, "read from private field"), e ? e.call(r) : t.get(r)), o = (r, t, e) => t.has(r) ? Bt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), u = (r, t, e, i) => (ta(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e), f = (r, t, e) => (ta(r, t, "access private method"), e);
39
+ p = Ac(b, e, w = {}, r[3], D), b && (p.static = I, p.private = g, m = p.access = { has: g ? (v) => Dc(n, v) : (v) => e in v }, b ^ 3 && (m.get = g ? (v) => (b ^ 1 ? s : f)(v, n, b ^ 4 ? a : S.get) : (v) => v[e]), b > 2 && (m.set = g ? (v, R) => u(v, n, R, b ^ 4 ? a : S.set) : (v, R) => v[e] = R)), l = (0, i[W])(b ? b < 4 ? g ? a : S[z] : b > 4 ? void 0 : { get: S.get, set: S.set } : n, p), w._ = 1, b ^ 4 || l === void 0 ? ai(l) && (b > 4 ? _.unshift(l) : b ? g ? a = l : S[z] = l : n = l) : typeof l != "object" || l === null ? xt("Object expected") : (ai(c = l.get) && (S.get = c), ai(c = l.set) && (S.set = c), ai(c = l.init) && _.unshift(c));
40
+ return b || Ht(r, n), S && _n(n, e, S), g ? b ^ 4 ? a : S : n;
41
+ }, d = (r, t, e) => Mr(r, typeof t != "symbol" ? t + "" : t, e), ta = (r, t, e) => t.has(r) || xt("Cannot " + e), Dc = (r, t) => Object(t) !== t ? xt('Cannot use the "in" operator on this value') : r.has(t), s = (r, t, e) => (ta(r, t, "read from private field"), e ? e.call(r) : t.get(r)), o = (r, t, e) => t.has(r) ? xt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), u = (r, t, e, i) => (ta(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e), f = (r, t, e) => (ta(r, t, "access private method"), e);
42
42
  var ea = (r, t, e, i) => ({
43
43
  set _(n) {
44
44
  u(r, t, n, e);
@@ -50,63 +50,63 @@ var ea = (r, t, e, i) => ({
50
50
  var h = (r, t, e) => new Promise((i, n) => {
51
51
  var a = (w) => {
52
52
  try {
53
- d(e.next(w));
53
+ l(e.next(w));
54
54
  } catch (p) {
55
55
  n(p);
56
56
  }
57
57
  }, c = (w) => {
58
58
  try {
59
- d(e.throw(w));
59
+ l(e.throw(w));
60
60
  } catch (p) {
61
61
  n(p);
62
62
  }
63
- }, d = (w) => w.done ? i(w.value) : Promise.resolve(w.value).then(a, c);
64
- d((e = e.apply(r, t)).next());
63
+ }, l = (w) => w.done ? i(w.value) : Promise.resolve(w.value).then(a, c);
64
+ l((e = e.apply(r, t)).next());
65
65
  }), O = function(r, t) {
66
66
  this[0] = r, this[1] = t;
67
- }, xt = (r, t, e) => {
68
- var i = (c, d, w, p) => {
67
+ }, Pt = (r, t, e) => {
68
+ var i = (c, l, w, p) => {
69
69
  try {
70
- var m = e[c](d), b = (d = m.value) instanceof O, I = m.done;
71
- Promise.resolve(b ? d[0] : d).then((g) => b ? i(c === "return" ? c : "next", d[1] ? { done: g.done, value: g.value } : g, w, p) : w({ value: g, done: I })).catch((g) => i("throw", g, w, p));
70
+ var m = e[c](l), b = (l = m.value) instanceof O, I = m.done;
71
+ Promise.resolve(b ? l[0] : l).then((g) => b ? i(c === "return" ? c : "next", l[1] ? { done: g.done, value: g.value } : g, w, p) : w({ value: g, done: I })).catch((g) => i("throw", g, w, p));
72
72
  } catch (g) {
73
73
  p(g);
74
74
  }
75
- }, n = (c) => a[c] = (d) => new Promise((w, p) => i(c, d, w, p)), a = {};
76
- return e = e.apply(r, t), a[It("asyncIterator")] = () => a, n("next"), n("throw"), n("return"), a;
75
+ }, n = (c) => a[c] = (l) => new Promise((w, p) => i(c, l, w, p)), a = {};
76
+ return e = e.apply(r, t), a[vt("asyncIterator")] = () => a, n("next"), n("throw"), n("return"), a;
77
77
  }, sa = (r) => {
78
- var t = r[It("asyncIterator")], e = !1, i, n = {};
79
- return t == null ? (t = r[It("iterator")](), i = (a) => n[a] = (c) => t[a](c)) : (t = t.call(r), i = (a) => n[a] = (c) => {
78
+ var t = r[vt("asyncIterator")], e = !1, i, n = {};
79
+ return t == null ? (t = r[vt("iterator")](), i = (a) => n[a] = (c) => t[a](c)) : (t = t.call(r), i = (a) => n[a] = (c) => {
80
80
  if (e) {
81
81
  if (e = !1, a === "throw") throw c;
82
82
  return c;
83
83
  }
84
84
  return e = !0, {
85
85
  done: !1,
86
- value: new O(new Promise((d) => {
86
+ value: new O(new Promise((l) => {
87
87
  var w = t[a](c);
88
- w instanceof Object || Bt("Object expected"), d(w);
88
+ w instanceof Object || xt("Object expected"), l(w);
89
89
  }), 1)
90
90
  };
91
- }), n[It("iterator")] = () => n, i("next"), "throw" in t ? i("throw") : n.throw = (a) => {
91
+ }), n[vt("iterator")] = () => n, i("next"), "throw" in t ? i("throw") : n.throw = (a) => {
92
92
  throw a;
93
93
  }, "return" in t && i("return"), n;
94
- }, C = (r, t, e) => (t = r[It("asyncIterator")]) ? t.call(r) : (r = r[It("iterator")](), t = {}, e = (i, n) => (n = r[i]) && (t[i] = (a) => new Promise((c, d, w) => (a = n.call(r, a), w = a.done, Promise.resolve(a.value).then((p) => c({ value: p, done: w }), d)))), e("next"), e("return"), t);
94
+ }, C = (r, t, e) => (t = r[vt("asyncIterator")]) ? t.call(r) : (r = r[vt("iterator")](), t = {}, e = (i, n) => (n = r[i]) && (t[i] = (a) => new Promise((c, l, w) => (a = n.call(r, a), w = a.done, Promise.resolve(a.value).then((p) => c({ value: p, done: w }), l)))), e("next"), e("return"), t);
95
95
  var nt = (r, t, e) => {
96
96
  if (t != null) {
97
- typeof t != "object" && typeof t != "function" && Bt("Object expected");
97
+ typeof t != "object" && typeof t != "function" && xt("Object expected");
98
98
  var i;
99
- e && (i = t[It("asyncDispose")]), i === void 0 && (i = t[It("dispose")]), typeof i != "function" && Bt("Object not disposable"), r.push([e, i, t]);
99
+ e && (i = t[vt("asyncDispose")]), i === void 0 && (i = t[vt("dispose")]), typeof i != "function" && xt("Object not disposable"), r.push([e, i, t]);
100
100
  } else e && r.push([e]);
101
101
  return t;
102
102
  }, at = (r, t, e) => {
103
- var i = typeof SuppressedError == "function" ? SuppressedError : function(c, d, w, p) {
104
- return p = Error(w), p.name = "SuppressedError", p.error = c, p.suppressed = d, p;
103
+ var i = typeof SuppressedError == "function" ? SuppressedError : function(c, l, w, p) {
104
+ return p = Error(w), p.name = "SuppressedError", p.error = c, p.suppressed = l, p;
105
105
  }, n = (c) => t = e ? new i(c, t, "An error was suppressed during disposal") : (e = !0, c), a = (c) => {
106
106
  for (; c = r.pop(); )
107
107
  try {
108
- var d = c[1] && c[1].call(c[2]);
109
- if (c[0]) return Promise.resolve(d).then(a, (w) => (n(w), a()));
108
+ var l = c[1] && c[1].call(c[2]);
109
+ if (c[0]) return Promise.resolve(l).then(a, (w) => (n(w), a()));
110
110
  } catch (w) {
111
111
  n(w);
112
112
  }
@@ -114,31 +114,31 @@ var nt = (r, t, e) => {
114
114
  };
115
115
  return a();
116
116
  };
117
- import { D as V, F as Ba, n as A, B as Zn, L as rt, b as Oc, w as Kn, i as q, a as Vc, W as Cc, t as ko, m as Bc, c as xc, e as Pc } from "./CLh-e-53.js";
118
- import { a as Io, p as Rc, i as jc, c as Nc } from "./C80BN8Qb.js";
117
+ import { D as V, F as Ba, n as A, B as Zn, L as rt, b as Oc, w as Kn, i as q, a as Vc, W as Cc, t as ko, m as Bc, c as xc, e as Pc } from "./DqcFFMob.js";
118
+ import { a as Io, p as Rc, i as jc, c as Gc } from "./C80BN8Qb.js";
119
119
  function xa(r) {
120
120
  const t = new Jn(r);
121
121
  return [t, t];
122
122
  }
123
- var Pt, as, dt, Ci;
123
+ var Rt, os, dt, Bi;
124
124
  class Jn {
125
125
  constructor(t) {
126
126
  /// The internal queue
127
- o(this, Pt);
127
+ o(this, Rt);
128
128
  /// Slows down push when the queue is full
129
- o(this, as, new V());
129
+ o(this, os, new V());
130
130
  /// Slows down pop when the queue is empty
131
131
  o(this, dt);
132
132
  /// The channel is closed
133
- o(this, Ci, !1);
134
- u(this, Pt, new Ba(t));
133
+ o(this, Bi, !1);
134
+ u(this, Rt, new Ba(t));
135
135
  }
136
136
  isFull() {
137
- return s(this, Pt).isFull();
137
+ return s(this, Rt).isFull();
138
138
  }
139
139
  close() {
140
140
  var t;
141
- (t = s(this, dt)) == null || t.resolve(), u(this, Ci, !0);
141
+ (t = s(this, dt)) == null || t.resolve(), u(this, Bi, !0);
142
142
  }
143
143
  abort(t) {
144
144
  var e, i;
@@ -147,16 +147,16 @@ class Jn {
147
147
  push(t) {
148
148
  return h(this, null, function* () {
149
149
  var e;
150
- s(this, Pt).isFull() && (yield s(this, as).promise), s(this, Pt).push(t), (e = s(this, dt)) == null || e.resolve(), u(this, dt, new V());
150
+ s(this, Rt).isFull() && (yield s(this, os).promise), s(this, Rt).push(t), (e = s(this, dt)) == null || e.resolve(), u(this, dt, new V());
151
151
  });
152
152
  }
153
153
  pop() {
154
154
  return h(this, null, function* () {
155
155
  var t;
156
- for (; !(s(this, Ci) && s(this, Pt).isEmpty()); ) {
157
- const e = s(this, Pt).pop();
156
+ for (; !(s(this, Bi) && s(this, Rt).isEmpty()); ) {
157
+ const e = s(this, Rt).pop();
158
158
  if (e)
159
- return s(this, as).resolve(), u(this, as, new V()), e;
159
+ return s(this, os).resolve(), u(this, os, new V()), e;
160
160
  s(this, dt) || u(this, dt, new V()), yield (t = s(this, dt)) == null ? void 0 : t.promise;
161
161
  }
162
162
  });
@@ -186,7 +186,7 @@ class Jn {
186
186
  return this;
187
187
  }
188
188
  }
189
- Pt = new WeakMap(), as = new WeakMap(), dt = new WeakMap(), Ci = new WeakMap();
189
+ Rt = new WeakMap(), os = new WeakMap(), dt = new WeakMap(), Bi = new WeakMap();
190
190
  function vo(r) {
191
191
  const t = atob(r), e = new Uint8Array(t.length);
192
192
  for (let i = 0; i < t.length; i++)
@@ -196,18 +196,18 @@ function vo(r) {
196
196
  function k(r) {
197
197
  return typeof BigInt == "function" ? BigInt(r) : r;
198
198
  }
199
- function Ct() {
199
+ function Bt() {
200
200
  return typeof Symbol.asyncDispose != "symbol" && Object.defineProperty(Symbol, "asyncDispose", { value: Symbol.for("asyncDispose") }), Symbol.asyncDispose;
201
201
  }
202
202
  function So() {
203
203
  return typeof Symbol.dispose != "symbol" && Object.defineProperty(Symbol, "dispose", { value: Symbol.for("dispose") }), Symbol.dispose;
204
204
  }
205
- var Bi, ha;
206
- class Gc {
205
+ var xi, ha;
206
+ class Nc {
207
207
  constructor(t, e) {
208
- o(this, Bi);
209
- l(this, "value");
210
- l(this, "unlocker");
208
+ o(this, xi);
209
+ d(this, "value");
210
+ d(this, "unlocker");
211
211
  this.value = t, this.unlocker = e;
212
212
  }
213
213
  unlocked() {
@@ -215,13 +215,13 @@ class Gc {
215
215
  return (t = this.unlocker) == null ? void 0 : t.promise;
216
216
  }
217
217
  [So()]() {
218
- f(this, Bi, ha).call(this);
218
+ f(this, xi, ha).call(this);
219
219
  }
220
220
  [Symbol.dispose]() {
221
- f(this, Bi, ha).call(this);
221
+ f(this, xi, ha).call(this);
222
222
  }
223
223
  }
224
- Bi = new WeakSet(), ha = function() {
224
+ xi = new WeakSet(), ha = function() {
225
225
  this.unlocker.resolve(this.value);
226
226
  };
227
227
  var pe, be;
@@ -244,7 +244,7 @@ class Lc {
244
244
  u(this, pe, i);
245
245
  }).catch(A);
246
246
  const e = s(this, be).promise.then(() => t);
247
- return u(this, be, t), yield e, new Gc(s(this, pe), t);
247
+ return u(this, be, t), yield e, new Nc(s(this, pe), t);
248
248
  });
249
249
  }
250
250
  }
@@ -298,7 +298,7 @@ class Y {
298
298
  });
299
299
  }
300
300
  [Symbol.asyncIterator]() {
301
- return xt(this, null, function* () {
301
+ return Pt(this, null, function* () {
302
302
  for (; ; ) {
303
303
  const [t, e] = this.value();
304
304
  if (yield t, !e)
@@ -347,88 +347,88 @@ const _e = class _e {
347
347
  schemeIdUri: n,
348
348
  value: a,
349
349
  eventDuration: c,
350
- id: d,
350
+ id: l,
351
351
  data: w
352
352
  }) {
353
- l(this, "type", _e.type);
354
- l(this, "timescale");
355
- l(this, "presentationTime");
356
- l(this, "presentationTimeDelta");
357
- l(this, "schemeIdUri");
358
- l(this, "value");
359
- l(this, "eventDuration");
360
- l(this, "id");
361
- l(this, "data");
362
- this.timescale = t, this.presentationTime = e, this.presentationTimeDelta = i, this.schemeIdUri = n, this.value = a, this.eventDuration = c, this.id = d, this.data = w;
353
+ d(this, "type", _e.type);
354
+ d(this, "timescale");
355
+ d(this, "presentationTime");
356
+ d(this, "presentationTimeDelta");
357
+ d(this, "schemeIdUri");
358
+ d(this, "value");
359
+ d(this, "eventDuration");
360
+ d(this, "id");
361
+ d(this, "data");
362
+ this.timescale = t, this.presentationTime = e, this.presentationTimeDelta = i, this.schemeIdUri = n, this.value = a, this.eventDuration = c, this.id = l, this.data = w;
363
363
  }
364
364
  static decodeData(t) {
365
365
  const { version: e } = ce(t);
366
366
  switch (e) {
367
367
  case 1: {
368
- const i = t.readUint32(), n = t.readUint64(), a = t.readUint32(), c = t.readUint32(), d = t.readUtf8String(), w = t.readUtf8String(), p = t.remaining(), m = t.readBytes(p);
368
+ const i = t.readUint32(), n = t.readUint64(), a = t.readUint32(), c = t.readUint32(), l = t.readUtf8String(), w = t.readUtf8String(), p = t.remaining(), m = t.readBytes(p);
369
369
  return new _e({
370
370
  timescale: i,
371
371
  presentationTime: n,
372
372
  eventDuration: a,
373
373
  id: c,
374
- schemeIdUri: d,
374
+ schemeIdUri: l,
375
375
  value: w,
376
376
  data: m
377
377
  });
378
378
  }
379
379
  case 0: {
380
- const i = t.readUtf8String(), n = t.readUtf8String(), a = t.readUint32(), c = t.readUint32(), d = t.readUint32(), w = t.readUint32(), p = t.remaining(), m = t.readBytes(p);
381
- return new _e({ timescale: a, presentationTimeDelta: c, schemeIdUri: i, value: n, eventDuration: d, id: w, data: m });
380
+ const i = t.readUtf8String(), n = t.readUtf8String(), a = t.readUint32(), c = t.readUint32(), l = t.readUint32(), w = t.readUint32(), p = t.remaining(), m = t.readBytes(p);
381
+ return new _e({ timescale: a, presentationTimeDelta: c, schemeIdUri: i, value: n, eventDuration: l, id: w, data: m });
382
382
  }
383
383
  default:
384
384
  throw new Error(`unsupported version ${e}`);
385
385
  }
386
386
  }
387
387
  };
388
- l(_e, "type", "emsg");
389
- let tn = _e;
390
- const di = class di {
388
+ d(_e, "type", "emsg");
389
+ let en = _e;
390
+ const li = class li {
391
391
  constructor(t) {
392
- l(this, "type", di.type);
393
- l(this, "data");
392
+ d(this, "type", li.type);
393
+ d(this, "data");
394
394
  this.data = t;
395
395
  }
396
396
  static decodeData(t) {
397
397
  const e = t.readRemaining();
398
- return new di(e);
398
+ return new li(e);
399
399
  }
400
400
  };
401
- l(di, "type", "mdat");
402
- let en = di;
403
- const li = class li {
401
+ d(li, "type", "mdat");
402
+ let sn = li;
403
+ const wi = class wi {
404
404
  constructor(t, e, i) {
405
- l(this, "type", li.type);
406
- l(this, "extra");
405
+ d(this, "type", wi.type);
406
+ d(this, "extra");
407
407
  /**
408
408
  * The byte offset of the baseMediaDecodeTime field
409
409
  */
410
- l(this, "byteOffset");
411
- l(this, "baseMediaDecodeTime");
410
+ d(this, "byteOffset");
411
+ d(this, "baseMediaDecodeTime");
412
412
  this.extra = t, this.byteOffset = e, this.baseMediaDecodeTime = i;
413
413
  }
414
414
  static decodeData(t) {
415
415
  const e = ce(t), i = t.byteOffset();
416
416
  let n = 0;
417
- return e.version === 1 ? n = t.readUint64() : n = t.readUint32(), new li(e, i, n);
417
+ return e.version === 1 ? n = t.readUint64() : n = t.readUint32(), new wi(e, i, n);
418
418
  }
419
419
  };
420
- l(li, "type", "tfdt");
421
- let sn = li;
420
+ d(wi, "type", "tfdt");
421
+ let rn = wi;
422
422
  const x = class x {
423
423
  constructor(t, e, i) {
424
- l(this, "type", x.type);
425
- l(this, "dataOffset");
426
- l(this, "firstSampleFlags");
427
- l(this, "samplesCount");
428
- l(this, "sampleDurations", []);
429
- l(this, "sampleSizes", []);
430
- l(this, "sampleFlags", []);
431
- l(this, "sampleCts", []);
424
+ d(this, "type", x.type);
425
+ d(this, "dataOffset");
426
+ d(this, "firstSampleFlags");
427
+ d(this, "samplesCount");
428
+ d(this, "sampleDurations", []);
429
+ d(this, "sampleSizes", []);
430
+ d(this, "sampleFlags", []);
431
+ d(this, "sampleCts", []);
432
432
  this.dataOffset = e, this.firstSampleFlags = i, this.samplesCount = t;
433
433
  }
434
434
  is_sync_sample(t) {
@@ -443,64 +443,64 @@ const x = class x {
443
443
  let n, a;
444
444
  e & x.TRUN_DATA_OFFSET && (n = t.readUint32()), e & x.TRUN_FIRST_SAMPLE_FLAGS && (a = t.readUint32());
445
445
  const c = new x(i, n, a);
446
- for (let d = 0; d < i; d++)
446
+ for (let l = 0; l < i; l++)
447
447
  e & x.SAMPLE_DURATION && c.sampleDurations.push(t.readUint32()), e & x.SAMPLE_SIZE && c.sampleSizes.push(t.readUint32()), e & x.SAMPLE_FLAGS && c.sampleFlags.push(t.readUint32()), e & x.SAMPLE_CTS && c.sampleCts.push(t.readUint32());
448
448
  return c;
449
449
  }
450
450
  };
451
- l(x, "TRUN_DATA_OFFSET", 1), l(x, "TRUN_FIRST_SAMPLE_FLAGS", 4), l(x, "SAMPLE_DURATION", 256), l(x, "SAMPLE_SIZE", 512), l(x, "SAMPLE_FLAGS", 1024), l(x, "SAMPLE_CTS", 2048), l(x, "FLAG_SAMPLE_FLAG_IS_NON_SYNC", 65536), l(x, "FLAG_SAMPLE_DEPENDS_NO", 33554432), l(x, "FLAG_SAMPLE_DEPENDS_YES", 16777216), l(x, "type", "trun");
452
- let Oi = x;
453
- const wi = class wi {
451
+ d(x, "TRUN_DATA_OFFSET", 1), d(x, "TRUN_FIRST_SAMPLE_FLAGS", 4), d(x, "SAMPLE_DURATION", 256), d(x, "SAMPLE_SIZE", 512), d(x, "SAMPLE_FLAGS", 1024), d(x, "SAMPLE_CTS", 2048), d(x, "FLAG_SAMPLE_FLAG_IS_NON_SYNC", 65536), d(x, "FLAG_SAMPLE_DEPENDS_NO", 33554432), d(x, "FLAG_SAMPLE_DEPENDS_YES", 16777216), d(x, "type", "trun");
452
+ let Vi = x;
453
+ const fi = class fi {
454
454
  constructor(t, e) {
455
- l(this, "type", wi.type);
456
- l(this, "tfdt");
457
- l(this, "trun");
455
+ d(this, "type", fi.type);
456
+ d(this, "tfdt");
457
+ d(this, "trun");
458
458
  this.tfdt = t, this.trun = e;
459
459
  }
460
460
  static decodeData(t) {
461
461
  let e, i;
462
462
  for (; t.remaining() > 0; ) {
463
- const n = kt(t);
464
- n instanceof sn && (e = n), n instanceof Oi && (i = n);
463
+ const n = It(t);
464
+ n instanceof rn && (e = n), n instanceof Vi && (i = n);
465
465
  }
466
- return new wi(e, i);
466
+ return new fi(e, i);
467
467
  }
468
468
  };
469
- l(wi, "type", "traf");
470
- let rn = wi;
471
- const fi = class fi {
469
+ d(fi, "type", "traf");
470
+ let nn = fi;
471
+ const pi = class pi {
472
472
  constructor(t) {
473
- l(this, "type", fi.type);
474
- l(this, "traf");
473
+ d(this, "type", pi.type);
474
+ d(this, "traf");
475
475
  this.traf = t;
476
476
  }
477
477
  static decodeData(t) {
478
478
  let e;
479
479
  for (; t.remaining() > 0; ) {
480
- const i = kt(t);
481
- i instanceof rn && (e = i);
480
+ const i = It(t);
481
+ i instanceof nn && (e = i);
482
482
  }
483
483
  if (!e)
484
484
  throw new Error("No traf found");
485
- return new fi(e);
485
+ return new pi(e);
486
486
  }
487
487
  };
488
- l(fi, "type", "moof");
489
- let nn = fi;
490
- const pi = class pi {
488
+ d(pi, "type", "moof");
489
+ let an = pi;
490
+ const bi = class bi {
491
491
  constructor() {
492
- l(this, "type", pi.type);
492
+ d(this, "type", bi.type);
493
493
  }
494
494
  static decodeData(t) {
495
- return new pi();
495
+ return new bi();
496
496
  }
497
497
  };
498
- l(pi, "type", "mvhd");
499
- let an = pi;
500
- const bi = class bi {
498
+ d(bi, "type", "mvhd");
499
+ let on = bi;
500
+ const mi = class mi {
501
501
  constructor(t) {
502
- l(this, "type", bi.type);
503
- l(this, "fourCC");
502
+ d(this, "type", mi.type);
503
+ d(this, "fourCC");
504
504
  this.fourCC = t;
505
505
  }
506
506
  mediaType() {
@@ -518,39 +518,39 @@ const bi = class bi {
518
518
  static decodeData(t) {
519
519
  ce(t), t.readUint32();
520
520
  const e = String.fromCharCode(...t.readBytes(4));
521
- return new bi(e);
521
+ return new mi(e);
522
522
  }
523
523
  };
524
- l(bi, "type", "hdlr");
525
- let on = bi;
524
+ d(mi, "type", "hdlr");
525
+ let cn = mi;
526
526
  const ts = class ts {
527
527
  constructor(t, e, i, n) {
528
- l(this, "type", ts.type);
529
- l(this, "creationTime");
530
- l(this, "modificationTime");
531
- l(this, "timescale");
532
- l(this, "duration");
528
+ d(this, "type", ts.type);
529
+ d(this, "creationTime");
530
+ d(this, "modificationTime");
531
+ d(this, "timescale");
532
+ d(this, "duration");
533
533
  this.creationTime = t, this.modificationTime = e, this.timescale = i, this.duration = n;
534
534
  }
535
535
  static decodeData(t) {
536
536
  const { version: e } = ce(t);
537
537
  if (e === 1) {
538
- const d = t.readUint64(), w = t.readUint64(), p = t.readUint32(), m = t.readUint64();
539
- return new ts(d, w, p, m);
538
+ const l = t.readUint64(), w = t.readUint64(), p = t.readUint32(), m = t.readUint64();
539
+ return new ts(l, w, p, m);
540
540
  }
541
541
  const i = t.readUint32(), n = t.readUint32(), a = t.readUint32(), c = t.readUint32();
542
542
  return new ts(i, n, a, c);
543
543
  }
544
544
  };
545
- l(ts, "type", "mdhd");
546
- let cn = ts;
547
- const mi = class mi {
545
+ d(ts, "type", "mdhd");
546
+ let un = ts;
547
+ const yi = class yi {
548
548
  constructor(t, e, i, n) {
549
- l(this, "type", mi.type);
550
- l(this, "av01");
551
- l(this, "avc1");
552
- l(this, "opus");
553
- l(this, "codec");
549
+ d(this, "type", yi.type);
550
+ d(this, "av01");
551
+ d(this, "avc1");
552
+ d(this, "opus");
553
+ d(this, "codec");
554
554
  this.avc1 = t, this.av01 = e, this.opus = i, this.codec = n;
555
555
  }
556
556
  mediaType() {
@@ -568,9 +568,9 @@ const mi = class mi {
568
568
  ce(t);
569
569
  const e = t.readUint32();
570
570
  let i, n, a, c;
571
- for (let d = 0; d < e; d++)
571
+ for (let l = 0; l < e; l++)
572
572
  for (; t.remaining() > 0; ) {
573
- const w = kt(t);
573
+ const w = It(t);
574
574
  switch (w.type) {
575
575
  case "avc1":
576
576
  i = "h264", n = w;
@@ -586,62 +586,62 @@ const mi = class mi {
586
586
  break;
587
587
  }
588
588
  }
589
- return new mi(n, c, a, i);
589
+ return new yi(n, c, a, i);
590
590
  }
591
591
  };
592
- l(mi, "type", "stsd");
593
- let un = mi;
594
- const yi = class yi {
592
+ d(yi, "type", "stsd");
593
+ let hn = yi;
594
+ const gi = class gi {
595
595
  constructor(t) {
596
- l(this, "type", yi.type);
597
- l(this, "stsd");
596
+ d(this, "type", gi.type);
597
+ d(this, "stsd");
598
598
  this.stsd = t;
599
599
  }
600
600
  static decodeData(t) {
601
601
  let e;
602
602
  for (; t.remaining() > 0; ) {
603
- const i = kt(t);
604
- i instanceof un && (e = i);
603
+ const i = It(t);
604
+ i instanceof hn && (e = i);
605
605
  }
606
606
  if (!e)
607
607
  throw new Error("No stsd found");
608
- return new yi(e);
608
+ return new gi(e);
609
609
  }
610
610
  };
611
- l(yi, "type", "stbl");
612
- let hn = yi;
613
- const gi = class gi {
611
+ d(gi, "type", "stbl");
612
+ let dn = gi;
613
+ const ki = class ki {
614
614
  constructor(t) {
615
- l(this, "type", gi.type);
616
- l(this, "stbl");
615
+ d(this, "type", ki.type);
616
+ d(this, "stbl");
617
617
  this.stbl = t;
618
618
  }
619
619
  static decodeData(t) {
620
620
  let e;
621
621
  for (; t.remaining() > 0; ) {
622
- const i = kt(t);
623
- i instanceof hn && (e = i);
622
+ const i = It(t);
623
+ i instanceof dn && (e = i);
624
624
  }
625
625
  if (!e)
626
626
  throw new Error("No stbl found");
627
- return new gi(e);
627
+ return new ki(e);
628
628
  }
629
629
  };
630
- l(gi, "type", "minf");
631
- let dn = gi;
632
- const ki = class ki {
630
+ d(ki, "type", "minf");
631
+ let ln = ki;
632
+ const Ii = class Ii {
633
633
  constructor(t, e, i) {
634
- l(this, "type", ki.type);
635
- l(this, "hdlr");
636
- l(this, "minf");
637
- l(this, "mdhd");
634
+ d(this, "type", Ii.type);
635
+ d(this, "hdlr");
636
+ d(this, "minf");
637
+ d(this, "mdhd");
638
638
  this.hdlr = t, this.minf = e, this.mdhd = i;
639
639
  }
640
640
  static decodeData(t) {
641
641
  let e, i, n;
642
642
  for (; t.remaining() > 0; ) {
643
- const a = kt(t);
644
- a instanceof on && (e = a), a instanceof dn && (i = a), a instanceof cn && (n = a);
643
+ const a = It(t);
644
+ a instanceof cn && (e = a), a instanceof ln && (i = a), a instanceof un && (n = a);
645
645
  }
646
646
  if (!e)
647
647
  throw new Error("No hdlr found");
@@ -649,23 +649,23 @@ const ki = class ki {
649
649
  throw new Error("No minf found");
650
650
  if (!n)
651
651
  throw new Error("No mdhd found");
652
- return new ki(e, i, n);
652
+ return new Ii(e, i, n);
653
653
  }
654
654
  };
655
- l(ki, "type", "mdia");
656
- let ln = ki;
657
- const Ii = class Ii {
658
- constructor(t, e, i, n, a, c, d, w) {
659
- l(this, "type", Ii.type);
660
- l(this, "modificationTime");
661
- l(this, "creationTime");
662
- l(this, "trackId");
663
- l(this, "duration");
664
- l(this, "alternateGroup");
665
- l(this, "volume");
666
- l(this, "width");
667
- l(this, "height");
668
- this.modificationTime = t, this.creationTime = e, this.trackId = i, this.duration = n, this.alternateGroup = a, this.volume = c, this.width = d, this.height = w;
655
+ d(Ii, "type", "mdia");
656
+ let wn = Ii;
657
+ const vi = class vi {
658
+ constructor(t, e, i, n, a, c, l, w) {
659
+ d(this, "type", vi.type);
660
+ d(this, "modificationTime");
661
+ d(this, "creationTime");
662
+ d(this, "trackId");
663
+ d(this, "duration");
664
+ d(this, "alternateGroup");
665
+ d(this, "volume");
666
+ d(this, "width");
667
+ d(this, "height");
668
+ this.modificationTime = t, this.creationTime = e, this.trackId = i, this.duration = n, this.alternateGroup = a, this.volume = c, this.width = l, this.height = w;
669
669
  }
670
670
  static decodeData(t) {
671
671
  const e = ce(t);
@@ -675,74 +675,74 @@ const Ii = class Ii {
675
675
  t.readUint32();
676
676
  const c = t.readUint32();
677
677
  t.readUint32(), t.readUint32(), t.readUint16();
678
- const d = t.readUint16(), w = t.readUint16();
678
+ const l = t.readUint16(), w = t.readUint16();
679
679
  t.readUint16(), new Array(9).fill(0).map(() => t.readUint32());
680
680
  const p = t.readUint16();
681
681
  t.readUint16();
682
682
  const m = t.readUint16();
683
- return t.readUint16(), new Ii(i, n, a, c, d, w, p, m);
683
+ return t.readUint16(), new vi(i, n, a, c, l, w, p, m);
684
684
  }
685
685
  };
686
- l(Ii, "type", "tkhd");
687
- let wn = Ii;
688
- const vi = class vi {
686
+ d(vi, "type", "tkhd");
687
+ let fn = vi;
688
+ const Si = class Si {
689
689
  constructor(t, e) {
690
- l(this, "type", vi.type);
691
- l(this, "tkhd");
692
- l(this, "mdia");
690
+ d(this, "type", Si.type);
691
+ d(this, "tkhd");
692
+ d(this, "mdia");
693
693
  this.tkhd = t, this.mdia = e;
694
694
  }
695
695
  static decodeData(t) {
696
696
  let e, i;
697
697
  for (; t.remaining() > 0; ) {
698
- const n = kt(t);
699
- n instanceof wn && (e = n), n instanceof ln && (i = n);
698
+ const n = It(t);
699
+ n instanceof fn && (e = n), n instanceof wn && (i = n);
700
700
  }
701
701
  if (!e)
702
702
  throw new Error("No tkhd found");
703
703
  if (!i)
704
704
  throw new Error("No mdia found");
705
- return new vi(e, i);
705
+ return new Si(e, i);
706
706
  }
707
707
  };
708
- l(vi, "type", "trak");
709
- let fn = vi;
710
- const Si = class Si {
708
+ d(Si, "type", "trak");
709
+ let pn = Si;
710
+ const Ui = class Ui {
711
711
  constructor(t, e) {
712
- l(this, "type", Si.type);
713
- l(this, "mvhd");
714
- l(this, "traks");
712
+ d(this, "type", Ui.type);
713
+ d(this, "mvhd");
714
+ d(this, "traks");
715
715
  this.mvhd = t, this.traks = e;
716
716
  }
717
717
  static decodeData(t) {
718
718
  let e;
719
719
  const i = [];
720
720
  for (; t.remaining() > 0; ) {
721
- const n = kt(t);
722
- n instanceof fn && i.push(n), n instanceof an && (e = n);
721
+ const n = It(t);
722
+ n instanceof pn && i.push(n), n instanceof on && (e = n);
723
723
  }
724
724
  if (!e)
725
725
  throw new Error("No mvhd found");
726
- return new Si(e, i);
726
+ return new Ui(e, i);
727
727
  }
728
728
  };
729
- l(Si, "type", "moov");
730
- let pn = Si;
731
- const Ui = class Ui {
732
- constructor(t, e, i, n, a, c, d, w) {
733
- l(this, "type", Ui.type);
734
- l(this, "configurationVersion");
735
- l(this, "avcProfileIndication");
736
- l(this, "profileCompatibility");
737
- l(this, "avcLevelIndication");
738
- l(this, "lengthSizeMinusOne");
739
- l(this, "sequenceParameterSets");
740
- l(this, "pictureParameterSets");
741
- l(this, "bytes");
742
- this.configurationVersion = t, this.avcProfileIndication = e, this.profileCompatibility = i, this.avcLevelIndication = n, this.lengthSizeMinusOne = a, this.sequenceParameterSets = c, this.pictureParameterSets = d, this.bytes = w;
729
+ d(Ui, "type", "moov");
730
+ let bn = Ui;
731
+ const Ei = class Ei {
732
+ constructor(t, e, i, n, a, c, l, w) {
733
+ d(this, "type", Ei.type);
734
+ d(this, "configurationVersion");
735
+ d(this, "avcProfileIndication");
736
+ d(this, "profileCompatibility");
737
+ d(this, "avcLevelIndication");
738
+ d(this, "lengthSizeMinusOne");
739
+ d(this, "sequenceParameterSets");
740
+ d(this, "pictureParameterSets");
741
+ d(this, "bytes");
742
+ this.configurationVersion = t, this.avcProfileIndication = e, this.profileCompatibility = i, this.avcLevelIndication = n, this.lengthSizeMinusOne = a, this.sequenceParameterSets = c, this.pictureParameterSets = l, this.bytes = w;
743
743
  }
744
744
  static decodeData(t) {
745
- const e = t.buffer(), i = t.readUint8(), n = t.readUint8(), a = t.readUint8(), c = t.readUint8(), d = t.readUint8() & 3, w = t.readUint8() & 31, p = [];
745
+ const e = t.buffer(), i = t.readUint8(), n = t.readUint8(), a = t.readUint8(), c = t.readUint8(), l = t.readUint8() & 3, w = t.readUint8() & 31, p = [];
746
746
  for (let I = 0; I < w; I++) {
747
747
  const g = t.readBytes(t.readUint16());
748
748
  p.push(g);
@@ -752,28 +752,28 @@ const Ui = class Ui {
752
752
  const g = t.readBytes(t.readUint16());
753
753
  b.push(g);
754
754
  }
755
- return new Ui(
755
+ return new Ei(
756
756
  i,
757
757
  n,
758
758
  a,
759
759
  c,
760
- d,
760
+ l,
761
761
  p,
762
762
  b,
763
763
  e
764
764
  );
765
765
  }
766
766
  };
767
- l(Ui, "type", "avcC");
768
- let da = Ui;
769
- const Ei = class Ei {
767
+ d(Ei, "type", "avcC");
768
+ let da = Ei;
769
+ const Ti = class Ti {
770
770
  constructor(t, e, i, n, a) {
771
- l(this, "type", Ei.type);
772
- l(this, "avcC");
773
- l(this, "width");
774
- l(this, "height");
775
- l(this, "horizontalResolution");
776
- l(this, "verticalResolution");
771
+ d(this, "type", Ti.type);
772
+ d(this, "avcC");
773
+ d(this, "width");
774
+ d(this, "height");
775
+ d(this, "horizontalResolution");
776
+ d(this, "verticalResolution");
777
777
  this.avcC = t, this.width = e, this.height = i, this.horizontalResolution = n, this.verticalResolution = a;
778
778
  }
779
779
  static decodeData(t) {
@@ -782,36 +782,36 @@ const Ei = class Ei {
782
782
  t.readUint32(), t.readUint16(), t.readBytes(32), t.readUint16(), t.readUint16();
783
783
  let c;
784
784
  for (; t.remaining() > 0; ) {
785
- const d = kt(t);
786
- switch (d.type) {
785
+ const l = It(t);
786
+ switch (l.type) {
787
787
  case "avcC":
788
- c = d;
788
+ c = l;
789
789
  break;
790
790
  }
791
791
  }
792
792
  if (!c)
793
793
  throw new Error("no avcC");
794
- return new Ei(c, e, i, n, a);
794
+ return new Ti(c, e, i, n, a);
795
795
  }
796
796
  };
797
- l(Ei, "type", "avc1");
798
- let la = Ei;
799
- const Ti = class Ti {
797
+ d(Ti, "type", "avc1");
798
+ let la = Ti;
799
+ const Ai = class Ai {
800
800
  constructor() {
801
- l(this, "type", Ti.type);
801
+ d(this, "type", Ai.type);
802
802
  }
803
803
  static decodeData(t) {
804
- return new Ti();
804
+ return new Ai();
805
805
  }
806
806
  };
807
- l(Ti, "type", "dOps");
808
- let wa = Ti;
809
- const Ai = class Ai {
807
+ d(Ai, "type", "dOps");
808
+ let wa = Ai;
809
+ const Di = class Di {
810
810
  constructor(t, e, i) {
811
- l(this, "type", Ai.type);
812
- l(this, "dops");
813
- l(this, "channelCount");
814
- l(this, "sampleRate");
811
+ d(this, "type", Di.type);
812
+ d(this, "dops");
813
+ d(this, "channelCount");
814
+ d(this, "sampleRate");
815
815
  this.dops = t, this.channelCount = e, this.sampleRate = i;
816
816
  }
817
817
  static decodeData(t) {
@@ -823,16 +823,16 @@ const Ai = class Ai {
823
823
  const n = t.readUint16();
824
824
  t.readUint16(), e === 1 && (t.readUint64(), t.readUint64());
825
825
  const a = Fc(wa, t);
826
- return new Ai(a, i, n);
826
+ return new Di(a, i, n);
827
827
  }
828
828
  };
829
- l(Ai, "type", "Opus");
830
- let fa = Ai;
829
+ d(Di, "type", "Opus");
830
+ let fa = Di;
831
831
  const es = class es {
832
832
  constructor(t, e) {
833
- l(this, "type", es.type);
834
- l(this, "ntpTimestamp");
835
- l(this, "mediaTime");
833
+ d(this, "type", es.type);
834
+ d(this, "ntpTimestamp");
835
+ d(this, "mediaTime");
836
836
  this.ntpTimestamp = t, this.mediaTime = e;
837
837
  }
838
838
  static decodeData(t) {
@@ -847,46 +847,46 @@ const es = class es {
847
847
  return new es([i, n], a);
848
848
  }
849
849
  };
850
- l(es, "type", "prft");
851
- let bn = es;
852
- var xi, Pi;
850
+ d(es, "type", "prft");
851
+ let mn = es;
852
+ var Pi, Ri;
853
853
  class Wc {
854
854
  constructor(t, e) {
855
- o(this, xi);
856
855
  o(this, Pi);
857
- u(this, xi, t), u(this, Pi, e.readBytes(t.size));
856
+ o(this, Ri);
857
+ u(this, Pi, t), u(this, Ri, e.readBytes(t.size));
858
858
  }
859
859
  data() {
860
- return s(this, Pi);
860
+ return s(this, Ri);
861
861
  }
862
862
  get type() {
863
- return s(this, xi).type;
863
+ return s(this, Pi).type;
864
864
  }
865
865
  }
866
- xi = new WeakMap(), Pi = new WeakMap();
866
+ Pi = new WeakMap(), Ri = new WeakMap();
867
867
  const $c = {
868
- moov: pn,
869
- trak: fn,
870
- tkhd: wn,
871
- mvhd: an,
872
- moof: nn,
873
- traf: rn,
874
- tfdt: sn,
875
- trun: Oi,
876
- mdat: en,
877
- mdia: ln,
878
- hdlr: on,
879
- minf: dn,
880
- stbl: hn,
881
- mdhd: cn,
882
- stsd: un,
883
- prft: bn,
868
+ moov: bn,
869
+ trak: pn,
870
+ tkhd: fn,
871
+ mvhd: on,
872
+ moof: an,
873
+ traf: nn,
874
+ tfdt: rn,
875
+ trun: Vi,
876
+ mdat: sn,
877
+ mdia: wn,
878
+ hdlr: cn,
879
+ minf: ln,
880
+ stbl: dn,
881
+ mdhd: un,
882
+ stsd: hn,
883
+ prft: mn,
884
884
  avc1: la,
885
885
  avcC: da,
886
886
  Opus: fa,
887
- emsg: tn
887
+ emsg: en
888
888
  };
889
- function kt(r) {
889
+ function It(r) {
890
890
  const t = Eo(r), e = $c[t.type], i = new Zn(r.readBytes(t.size));
891
891
  if (!e) {
892
892
  const a = new Wc(t, i);
@@ -900,13 +900,13 @@ function Mc(r) {
900
900
  throw new Error("Buffer too small");
901
901
  const t = new Zn(r), e = /* @__PURE__ */ new Map();
902
902
  for (; t.remaining() > 0; ) {
903
- const a = kt(t);
903
+ const a = It(t);
904
904
  e.set(a.type, a);
905
905
  }
906
906
  const i = e.get("ftyp"), n = e.get("moov");
907
907
  if (!i)
908
908
  throw new Error("ftyp atom not found");
909
- if (!n || !(n instanceof pn))
909
+ if (!n || !(n instanceof bn))
910
910
  throw new Error("moov atom not found");
911
911
  return {
912
912
  ftyp: i,
@@ -918,15 +918,15 @@ function zc(r) {
918
918
  throw new Error("Buffer too small");
919
919
  const t = new Zn(r), e = /* @__PURE__ */ new Map(), i = [];
920
920
  for (; t.remaining() > 0; ) {
921
- const d = kt(t);
922
- d instanceof tn && i.push(d), e.set(d.type, d);
921
+ const l = It(t);
922
+ l instanceof en && i.push(l), e.set(l.type, l);
923
923
  }
924
924
  const n = e.get("moof"), a = e.get("mdat"), c = e.get("prft");
925
- if (!n || !(n instanceof nn))
925
+ if (!n || !(n instanceof an))
926
926
  throw new Error("moof atom not found");
927
- if (!a || !(a instanceof en))
927
+ if (!a || !(a instanceof sn))
928
928
  throw new Error("mdat atom not found");
929
- if (c && !(c instanceof bn))
929
+ if (c && !(c instanceof mn))
930
930
  throw new Error("invalid prft found");
931
931
  return {
932
932
  moof: n,
@@ -935,21 +935,21 @@ function zc(r) {
935
935
  emsgs: i
936
936
  };
937
937
  }
938
- var Ri, ji;
938
+ var ji, Gi;
939
939
  class Hc {
940
940
  constructor(t) {
941
- o(this, Ri);
942
941
  o(this, ji);
943
- u(this, Ri, t), u(this, ji, Mc(t));
942
+ o(this, Gi);
943
+ u(this, ji, t), u(this, Gi, Mc(t));
944
944
  }
945
945
  rawBytes() {
946
- return s(this, Ri);
946
+ return s(this, ji);
947
947
  }
948
948
  init() {
949
- return s(this, ji);
949
+ return s(this, Gi);
950
950
  }
951
951
  }
952
- Ri = new WeakMap(), ji = new WeakMap();
952
+ ji = new WeakMap(), Gi = new WeakMap();
953
953
  var wt, tt, T;
954
954
  class Xc {
955
955
  constructor(t, e) {
@@ -990,7 +990,7 @@ class Xc {
990
990
  }
991
991
  startsWithKeyframe() {
992
992
  const t = s(this, T).moof.traf.trun, e = (t == null ? void 0 : t.firstSampleFlags) || (t == null ? void 0 : t.sampleFlags[0]);
993
- return e ? (e & Oi.FLAG_SAMPLE_DEPENDS_NO) !== 0 : !1;
993
+ return e ? (e & Vi.FLAG_SAMPLE_DEPENDS_NO) !== 0 : !1;
994
994
  }
995
995
  timescale() {
996
996
  const t = s(this, tt).init().moov.traks[0];
@@ -1016,33 +1016,33 @@ class Xc {
1016
1016
  return ((t = s(this, T).moof.traf.trun) == null ? void 0 : t.samplesCount) || 0;
1017
1017
  }
1018
1018
  sample(t) {
1019
- var g, E, z, _, D, S, W, v, R, si, Lr, Fr, za, Ha, Xa;
1019
+ var g, E, z, _, D, S, W, v, R, ii, Fr, Wr, za, Ha, Xa;
1020
1020
  const e = (g = s(this, tt).init().moov.traks[0]) == null ? void 0 : g.mdia.minf.stbl.stsd.codec, i = ((E = s(this, T).moof.traf.trun) == null ? void 0 : E.samplesCount) || 0, n = (z = s(this, T).moof.traf.tfdt) == null ? void 0 : z.baseMediaDecodeTime;
1021
1021
  if (t >= i || typeof n == "undefined" || !e)
1022
1022
  return;
1023
- const a = ((_ = s(this, T).moof.traf.trun) == null ? void 0 : _.sampleDurations[t]) || 0, c = ((D = s(this, T).moof.traf.trun) == null ? void 0 : D.sampleDurations.slice(0, t).reduce((ii, ri) => ii + ri, 0)) || 0, d = n + c, w = ((S = s(this, tt).init().moov.traks[0]) == null ? void 0 : S.mdia.mdhd.timescale) || 1e3, p = ((W = s(this, T).moof.traf.trun) == null ? void 0 : W.sampleSizes[t]) || s(this, T).mdat.data.byteLength, m = ((v = s(this, T).moof.traf.trun) == null ? void 0 : v.sampleSizes.slice(0, t).reduce((ii, ri) => ii + ri, 0)) || 0, b = s(this, T).mdat.data.subarray(m, m + p), I = ((R = s(this, T).moof.traf.trun) == null ? void 0 : R.is_sync_sample(t)) || !1;
1023
+ const a = ((_ = s(this, T).moof.traf.trun) == null ? void 0 : _.sampleDurations[t]) || 0, c = ((D = s(this, T).moof.traf.trun) == null ? void 0 : D.sampleDurations.slice(0, t).reduce((ri, ni) => ri + ni, 0)) || 0, l = n + c, w = ((S = s(this, tt).init().moov.traks[0]) == null ? void 0 : S.mdia.mdhd.timescale) || 1e3, p = ((W = s(this, T).moof.traf.trun) == null ? void 0 : W.sampleSizes[t]) || s(this, T).mdat.data.byteLength, m = ((v = s(this, T).moof.traf.trun) == null ? void 0 : v.sampleSizes.slice(0, t).reduce((ri, ni) => ri + ni, 0)) || 0, b = s(this, T).mdat.data.subarray(m, m + p), I = ((R = s(this, T).moof.traf.trun) == null ? void 0 : R.is_sync_sample(t)) || !1;
1024
1024
  if (this.mediaType() === "video") {
1025
- const ii = ((si = s(this, tt).init().moov.traks[0]) == null ? void 0 : si.tkhd.width) || 0, ri = ((Lr = s(this, tt).init().moov.traks[0]) == null ? void 0 : Lr.tkhd.height) || 0;
1025
+ const ri = ((ii = s(this, tt).init().moov.traks[0]) == null ? void 0 : ii.tkhd.width) || 0, ni = ((Fr = s(this, tt).init().moov.traks[0]) == null ? void 0 : Fr.tkhd.height) || 0;
1026
1026
  return {
1027
1027
  type: "video",
1028
1028
  codec: e,
1029
- width: ii,
1030
- height: ri,
1029
+ width: ri,
1030
+ height: ni,
1031
1031
  duration: a,
1032
1032
  isSync: I,
1033
1033
  timescale: w,
1034
- timestamp: d,
1034
+ timestamp: l,
1035
1035
  data: b
1036
1036
  };
1037
1037
  }
1038
1038
  return {
1039
1039
  type: "audio",
1040
1040
  codec: e,
1041
- channels: ((za = (Fr = s(this, tt).init().moov.traks[0]) == null ? void 0 : Fr.mdia.minf.stbl.stsd.opus) == null ? void 0 : za.channelCount) || 0,
1041
+ channels: ((za = (Wr = s(this, tt).init().moov.traks[0]) == null ? void 0 : Wr.mdia.minf.stbl.stsd.opus) == null ? void 0 : za.channelCount) || 0,
1042
1042
  sampleRate: ((Xa = (Ha = s(this, tt).init().moov.traks[0]) == null ? void 0 : Ha.mdia.minf.stbl.stsd.opus) == null ? void 0 : Xa.sampleRate) || 0,
1043
1043
  duration: a,
1044
1044
  isSync: I,
1045
- timestamp: d,
1045
+ timestamp: l,
1046
1046
  data: b,
1047
1047
  timescale: w
1048
1048
  };
@@ -1055,21 +1055,21 @@ class Xc {
1055
1055
  }
1056
1056
  }
1057
1057
  wt = new WeakMap(), tt = new WeakMap(), T = new WeakMap();
1058
- var os;
1058
+ var cs;
1059
1059
  class qa {
1060
1060
  constructor(t) {
1061
- o(this, os);
1062
- u(this, os, new Hc(t));
1061
+ o(this, cs);
1062
+ u(this, cs, new Hc(t));
1063
1063
  }
1064
1064
  header() {
1065
- return s(this, os);
1065
+ return s(this, cs);
1066
1066
  }
1067
1067
  createFragment(t) {
1068
- return new Xc(s(this, os), t);
1068
+ return new Xc(s(this, cs), t);
1069
1069
  }
1070
1070
  }
1071
- os = new WeakMap();
1072
- var mn = /* @__PURE__ */ ((r) => (r[r.StreamHeaderGroup = 4] = "StreamHeaderGroup", r[r.FetchHeader = 5] = "FetchHeader", r[r.StreamHeaderTrack = 60] = "StreamHeaderTrack", r))(mn || {});
1071
+ cs = new WeakMap();
1072
+ var yn = /* @__PURE__ */ ((r) => (r[r.StreamHeaderGroup = 4] = "StreamHeaderGroup", r[r.FetchHeader = 5] = "FetchHeader", r[r.StreamHeaderTrack = 60] = "StreamHeaderTrack", r))(yn || {});
1073
1073
  const X = {
1074
1074
  Normal: 0,
1075
1075
  ObjectDoesNotExist: 1,
@@ -1088,46 +1088,46 @@ function To(r) {
1088
1088
  }
1089
1089
  throw new Error("Unknown object status " + r);
1090
1090
  }
1091
- var vt, cs, us, Ni, Gi, hs, Li, Fi;
1091
+ var St, us, hs, Ni, Li, ds, Fi, Wi;
1092
1092
  class Yc {
1093
1093
  constructor(t, e, i, n, a, c) {
1094
- o(this, vt);
1095
- o(this, cs);
1094
+ o(this, St);
1096
1095
  o(this, us);
1096
+ o(this, hs);
1097
1097
  o(this, Ni);
1098
- o(this, Gi);
1099
- o(this, hs, new V());
1100
- o(this, Li, 0);
1101
- o(this, Fi);
1102
- u(this, vt, t), u(this, cs, e), u(this, us, i), u(this, Ni, n), u(this, Gi, a), u(this, Fi, c);
1098
+ o(this, Li);
1099
+ o(this, ds, new V());
1100
+ o(this, Fi, 0);
1101
+ o(this, Wi);
1102
+ u(this, St, t), u(this, us, e), u(this, hs, i), u(this, Ni, n), u(this, Li, a), u(this, Wi, c);
1103
1103
  }
1104
1104
  endStatus() {
1105
- return s(this, hs).promise;
1105
+ return s(this, ds).promise;
1106
1106
  }
1107
1107
  groupId() {
1108
- return s(this, cs);
1108
+ return s(this, us);
1109
1109
  }
1110
1110
  subscribeId() {
1111
- return s(this, us);
1111
+ return s(this, hs);
1112
1112
  }
1113
1113
  next() {
1114
1114
  return h(this, null, function* () {
1115
- if (!s(this, hs).pending)
1115
+ if (!s(this, ds).pending)
1116
1116
  return { done: !0, value: void 0 };
1117
- if (yield s(this, vt).isDone())
1117
+ if (yield s(this, St).isDone())
1118
1118
  return { done: !0, value: void 0 };
1119
- const t = s(this, Li) === 0 ? s(this, cs) : yield s(this, vt).readBigVarInt(), e = yield s(this, vt).readBigVarInt(), i = yield s(this, vt).readVarInt();
1119
+ const t = s(this, Fi) === 0 ? s(this, us) : yield s(this, St).readBigVarInt(), e = yield s(this, St).readBigVarInt(), i = yield s(this, St).readVarInt();
1120
1120
  let n = 0, a = new Uint8Array();
1121
- return i > 0 ? a = yield s(this, vt).read(i) : n = yield s(this, vt).readVarInt(), To(n), (n === X.EndOfTrackAndGroup || n === X.EndOfGroup) && s(this, hs).resolve(n), ea(this, Li)._++, {
1121
+ return i > 0 ? a = yield s(this, St).read(i) : n = yield s(this, St).readVarInt(), To(n), (n === X.EndOfTrackAndGroup || n === X.EndOfGroup) && s(this, ds).resolve(n), ea(this, Fi)._++, {
1122
1122
  done: !1,
1123
1123
  value: {
1124
- subscribeId: s(this, us),
1124
+ subscribeId: s(this, hs),
1125
1125
  trackAlias: s(this, Ni),
1126
1126
  groupId: t,
1127
1127
  subGroupId: k(0),
1128
1128
  objectId: e,
1129
- subscriberPriority: s(this, Gi),
1130
- streamId: s(this, Fi),
1129
+ subscriberPriority: s(this, Li),
1130
+ streamId: s(this, Wi),
1131
1131
  objectStatus: n,
1132
1132
  payload: a
1133
1133
  }
@@ -1144,121 +1144,121 @@ class Yc {
1144
1144
  [Symbol.asyncIterator]() {
1145
1145
  return this;
1146
1146
  }
1147
- [Ct()]() {
1147
+ [Bt()]() {
1148
1148
  return Promise.resolve();
1149
1149
  }
1150
1150
  [Symbol.asyncDispose]() {
1151
1151
  return Promise.resolve();
1152
1152
  }
1153
1153
  }
1154
- vt = new WeakMap(), cs = new WeakMap(), us = new WeakMap(), Ni = new WeakMap(), Gi = new WeakMap(), hs = new WeakMap(), Li = new WeakMap(), Fi = new WeakMap();
1155
- var St, ds, Wi, $i, ls, Xe, Ao, pa;
1154
+ St = new WeakMap(), us = new WeakMap(), hs = new WeakMap(), Ni = new WeakMap(), Li = new WeakMap(), ds = new WeakMap(), Fi = new WeakMap(), Wi = new WeakMap();
1155
+ var Ut, ls, $i, Mi, ws, Xe, Ao, pa;
1156
1156
  class Zc {
1157
1157
  constructor(t, e, i, n, a) {
1158
1158
  o(this, Xe);
1159
- o(this, St);
1160
- o(this, ds);
1161
- o(this, Wi);
1162
- o(this, $i);
1159
+ o(this, Ut);
1163
1160
  o(this, ls);
1164
- u(this, St, t), u(this, ds, e), u(this, Wi, i), u(this, $i, n), u(this, ls, a);
1161
+ o(this, $i);
1162
+ o(this, Mi);
1163
+ o(this, ws);
1164
+ u(this, Ut, t), u(this, ls, e), u(this, $i, i), u(this, Mi, n), u(this, ws, a);
1165
1165
  }
1166
1166
  /**
1167
1167
  * @returns The underlying stream id that provided this object group
1168
1168
  */
1169
1169
  streamId() {
1170
- return s(this, ls);
1170
+ return s(this, ws);
1171
1171
  }
1172
1172
  groups() {
1173
1173
  return f(this, Xe, Ao).call(this);
1174
1174
  }
1175
1175
  subscribeId() {
1176
- return s(this, ds);
1176
+ return s(this, ls);
1177
1177
  }
1178
1178
  return() {
1179
1179
  return h(this, null, function* () {
1180
- return yield s(this, St).close(), { done: !0, value: void 0 };
1180
+ return yield s(this, Ut).close(), { done: !0, value: void 0 };
1181
1181
  });
1182
1182
  }
1183
1183
  [Symbol.asyncIterator]() {
1184
1184
  return this;
1185
1185
  }
1186
- [Ct()]() {
1186
+ [Bt()]() {
1187
1187
  return f(this, Xe, pa).call(this);
1188
1188
  }
1189
1189
  [Symbol.asyncDispose]() {
1190
1190
  return f(this, Xe, pa).call(this);
1191
1191
  }
1192
1192
  }
1193
- St = new WeakMap(), ds = new WeakMap(), Wi = new WeakMap(), $i = new WeakMap(), ls = new WeakMap(), Xe = new WeakSet(), Ao = function() {
1194
- return xt(this, null, function* () {
1195
- for (; !(yield new O(s(this, St).isDone())); ) {
1196
- const t = yield new O(s(this, St).readBigVarInt()), e = new Yc(
1197
- s(this, St),
1193
+ Ut = new WeakMap(), ls = new WeakMap(), $i = new WeakMap(), Mi = new WeakMap(), ws = new WeakMap(), Xe = new WeakSet(), Ao = function() {
1194
+ return Pt(this, null, function* () {
1195
+ for (; !(yield new O(s(this, Ut).isDone())); ) {
1196
+ const t = yield new O(s(this, Ut).readBigVarInt()), e = new Yc(
1197
+ s(this, Ut),
1198
1198
  t,
1199
- s(this, ds),
1200
- s(this, Wi),
1199
+ s(this, ls),
1201
1200
  s(this, $i),
1202
- s(this, ls)
1201
+ s(this, Mi),
1202
+ s(this, ws)
1203
1203
  );
1204
- if (yield e, (yield new O(Promise.race([e.endStatus(), s(this, St).closed()]))) === X.EndOfTrackAndGroup)
1204
+ if (yield e, (yield new O(Promise.race([e.endStatus(), s(this, Ut).closed()]))) === X.EndOfTrackAndGroup)
1205
1205
  return;
1206
1206
  }
1207
1207
  });
1208
1208
  }, pa = function() {
1209
- return s(this, St).close().catch(() => {
1209
+ return s(this, Ut).close().catch(() => {
1210
1210
  });
1211
1211
  };
1212
- var ft, ws, Mi, fs, zi, Hi, Xi, ps, En, Ye, Do, ba;
1212
+ var ft, fs, zi, ps, Hi, Xi, Yi, bs, Tn, Ye, Do, ba;
1213
1213
  class Kc {
1214
- constructor(t, e, i, n, a, c, d) {
1214
+ constructor(t, e, i, n, a, c, l) {
1215
1215
  o(this, Ye);
1216
1216
  o(this, ft);
1217
- o(this, ws);
1218
- o(this, Mi);
1219
1217
  o(this, fs);
1220
1218
  o(this, zi);
1221
- o(this, Hi);
1222
- o(this, Xi, !1);
1223
1219
  o(this, ps);
1224
- o(this, En, rt.get().createContext("GroupReader"));
1225
- u(this, ft, t), u(this, ws, e), u(this, Mi, i), u(this, fs, n), u(this, zi, a), u(this, Hi, c), u(this, ps, d);
1220
+ o(this, Hi);
1221
+ o(this, Xi);
1222
+ o(this, Yi, !1);
1223
+ o(this, bs);
1224
+ o(this, Tn, rt.get().createContext("GroupReader"));
1225
+ u(this, ft, t), u(this, fs, e), u(this, zi, i), u(this, ps, n), u(this, Hi, a), u(this, Xi, c), u(this, bs, l);
1226
1226
  }
1227
1227
  /**
1228
1228
  * @returns The underlying stream id that provided this object group
1229
1229
  */
1230
1230
  streamId() {
1231
- return s(this, ps);
1231
+ return s(this, bs);
1232
1232
  }
1233
1233
  groupId() {
1234
- return s(this, fs);
1234
+ return s(this, ps);
1235
1235
  }
1236
1236
  subscribeId() {
1237
- return s(this, ws);
1237
+ return s(this, fs);
1238
1238
  }
1239
1239
  next() {
1240
1240
  return h(this, null, function* () {
1241
1241
  try {
1242
- if ((yield s(this, ft).isDone()) || s(this, Xi))
1242
+ if ((yield s(this, ft).isDone()) || s(this, Yi))
1243
1243
  return { done: !0, value: void 0 };
1244
1244
  const t = yield s(this, ft).readBigVarInt(), e = yield s(this, ft).readVarInt();
1245
1245
  let i = 0, n = new Uint8Array();
1246
- return e > 0 ? n = yield s(this, ft).read(e) : i = yield s(this, ft).readVarInt(), To(i), i === X.EndOfGroup && u(this, Xi, !0), {
1246
+ return e > 0 ? n = yield s(this, ft).read(e) : i = yield s(this, ft).readVarInt(), To(i), i === X.EndOfGroup && u(this, Yi, !0), {
1247
1247
  done: !1,
1248
1248
  value: {
1249
- subscribeId: s(this, ws),
1250
- trackAlias: s(this, Mi),
1251
- groupId: s(this, fs),
1252
- subGroupId: s(this, zi),
1253
- subscriberPriority: s(this, Hi),
1254
- streamId: s(this, ps),
1249
+ subscribeId: s(this, fs),
1250
+ trackAlias: s(this, zi),
1251
+ groupId: s(this, ps),
1252
+ subGroupId: s(this, Hi),
1253
+ subscriberPriority: s(this, Xi),
1254
+ streamId: s(this, bs),
1255
1255
  objectId: t,
1256
1256
  objectStatus: i,
1257
1257
  payload: n
1258
1258
  }
1259
1259
  };
1260
1260
  } catch (t) {
1261
- return s(this, En).info("Error reading object", { error: t }), { done: !0, value: void 0 };
1261
+ return s(this, Tn).info("Error reading object", { error: t }), { done: !0, value: void 0 };
1262
1262
  }
1263
1263
  });
1264
1264
  }
@@ -1274,15 +1274,15 @@ class Kc {
1274
1274
  [Symbol.asyncIterator]() {
1275
1275
  return this;
1276
1276
  }
1277
- [Ct()]() {
1277
+ [Bt()]() {
1278
1278
  return f(this, Ye, ba).call(this);
1279
1279
  }
1280
1280
  [Symbol.asyncDispose]() {
1281
1281
  return f(this, Ye, ba).call(this);
1282
1282
  }
1283
1283
  }
1284
- ft = new WeakMap(), ws = new WeakMap(), Mi = new WeakMap(), fs = new WeakMap(), zi = new WeakMap(), Hi = new WeakMap(), Xi = new WeakMap(), ps = new WeakMap(), En = new WeakMap(), Ye = new WeakSet(), Do = function() {
1285
- return xt(this, null, function* () {
1284
+ ft = new WeakMap(), fs = new WeakMap(), zi = new WeakMap(), ps = new WeakMap(), Hi = new WeakMap(), Xi = new WeakMap(), Yi = new WeakMap(), bs = new WeakMap(), Tn = new WeakMap(), Ye = new WeakSet(), Do = function() {
1285
+ return Pt(this, null, function* () {
1286
1286
  yield this;
1287
1287
  });
1288
1288
  }, ba = function() {
@@ -1293,11 +1293,11 @@ function Oo(r, t) {
1293
1293
  return h(this, null, function* () {
1294
1294
  const e = yield r.readVarInt();
1295
1295
  switch (e) {
1296
- case mn.StreamHeaderGroup: {
1297
- const i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readBigVarInt(), c = yield r.readBigVarInt(), d = yield r.readUnsigned8();
1298
- return new Kc(r, i, n, a, c, d, t);
1296
+ case yn.StreamHeaderGroup: {
1297
+ const i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readBigVarInt(), c = yield r.readBigVarInt(), l = yield r.readUnsigned8();
1298
+ return new Kc(r, i, n, a, c, l, t);
1299
1299
  }
1300
- case mn.StreamHeaderTrack: {
1300
+ case yn.StreamHeaderTrack: {
1301
1301
  const i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readUnsigned8();
1302
1302
  return new Zc(r, i, n, a, t);
1303
1303
  }
@@ -1306,71 +1306,71 @@ function Oo(r, t) {
1306
1306
  }
1307
1307
  });
1308
1308
  }
1309
- var Xt, Yi;
1309
+ var Yt, Zi;
1310
1310
  class Jc {
1311
1311
  constructor(t, e) {
1312
- o(this, Xt);
1313
- o(this, Yi);
1314
- u(this, Xt, t), u(this, Yi, e);
1312
+ o(this, Yt);
1313
+ o(this, Zi);
1314
+ u(this, Yt, t), u(this, Zi, e);
1315
1315
  }
1316
1316
  start(t) {
1317
- s(this, Xt).addEventListener("message", (e) => {
1317
+ s(this, Yt).addEventListener("message", (e) => {
1318
1318
  if (typeof e.data == "object" && e.data instanceof ArrayBuffer) {
1319
1319
  const i = new Uint8Array(e.data);
1320
- i[0] == s(this, Yi) && t.enqueue(i.subarray(1));
1320
+ i[0] == s(this, Zi) && t.enqueue(i.subarray(1));
1321
1321
  }
1322
- }), s(this, Xt).addEventListener("error", (e) => t.error(e)), s(this, Xt).addEventListener("close", () => Uo(() => t.close()));
1322
+ }), s(this, Yt).addEventListener("error", (e) => t.error(e)), s(this, Yt).addEventListener("close", () => Uo(() => t.close()));
1323
1323
  }
1324
1324
  cancel(t) {
1325
- s(this, Xt).close(void 0, t);
1325
+ s(this, Yt).close(void 0, t);
1326
1326
  }
1327
1327
  }
1328
- Xt = new WeakMap(), Yi = new WeakMap();
1329
- var Ut, me, ye, ge;
1328
+ Yt = new WeakMap(), Zi = new WeakMap();
1329
+ var Et, me, ye, ge;
1330
1330
  class Qc {
1331
1331
  constructor(t) {
1332
- o(this, Ut);
1332
+ o(this, Et);
1333
1333
  o(this, me, null);
1334
1334
  o(this, ye, null);
1335
1335
  o(this, ge, null);
1336
- u(this, Ut, t);
1336
+ u(this, Et, t);
1337
1337
  }
1338
1338
  start(t) {
1339
1339
  u(this, me, (e) => {
1340
1340
  if (typeof e.data == "object" && e.data instanceof ArrayBuffer) {
1341
1341
  const i = new Uint8Array(e.data), n = i[0] || 0, a = n & 127, c = (n >> 7 & 1) > 0;
1342
1342
  if (a && a !== 0) {
1343
- const d = i.subarray(1);
1344
- t.enqueue([c, a, d]);
1343
+ const l = i.subarray(1);
1344
+ t.enqueue([c, a, l]);
1345
1345
  }
1346
1346
  }
1347
- }), u(this, ye, () => Uo(() => t.close())), u(this, ge, (e) => t.error(e)), s(this, Ut).addEventListener("message", s(this, me)), s(this, Ut).addEventListener("error", s(this, ge)), s(this, Ut).addEventListener("close", s(this, ye));
1347
+ }), u(this, ye, () => Uo(() => t.close())), u(this, ge, (e) => t.error(e)), s(this, Et).addEventListener("message", s(this, me)), s(this, Et).addEventListener("error", s(this, ge)), s(this, Et).addEventListener("close", s(this, ye));
1348
1348
  }
1349
1349
  cancel(t) {
1350
- s(this, me) && s(this, Ut).removeEventListener("message", s(this, me)), s(this, ge) && s(this, Ut).removeEventListener("error", s(this, ge)), s(this, ye) && s(this, Ut).removeEventListener("close", s(this, ye));
1350
+ s(this, me) && s(this, Et).removeEventListener("message", s(this, me)), s(this, ge) && s(this, Et).removeEventListener("error", s(this, ge)), s(this, ye) && s(this, Et).removeEventListener("close", s(this, ye));
1351
1351
  }
1352
1352
  }
1353
- Ut = new WeakMap(), me = new WeakMap(), ye = new WeakMap(), ge = new WeakMap();
1354
- var Et, Zi, ke, Tt, Tn, U, oi, Hr, le, Xr, Ht;
1355
- class yn {
1353
+ Et = new WeakMap(), me = new WeakMap(), ye = new WeakMap(), ge = new WeakMap();
1354
+ var Tt, Ki, ke, At, An, U, ci, Xr, le, Yr, Xt;
1355
+ class gn {
1356
1356
  constructor(t, e) {
1357
1357
  o(this, U);
1358
- o(this, Et);
1359
- o(this, Zi);
1358
+ o(this, Tt);
1359
+ o(this, Ki);
1360
1360
  o(this, ke);
1361
- o(this, Tt, 0);
1362
- o(this, Tn, new TextDecoder());
1363
- u(this, Et, t), u(this, Zi, e), u(this, ke, e.getReader());
1361
+ o(this, At, 0);
1362
+ o(this, An, new TextDecoder());
1363
+ u(this, Tt, t), u(this, Ki, e), u(this, ke, e.getReader());
1364
1364
  }
1365
1365
  readUnsigned8() {
1366
1366
  return h(this, null, function* () {
1367
- return yield f(this, U, le).call(this, 1), f(this, U, Ht).call(this, 1)[0];
1367
+ return yield f(this, U, le).call(this, 1), f(this, U, Xt).call(this, 1)[0];
1368
1368
  });
1369
1369
  }
1370
1370
  readString() {
1371
1371
  return h(this, null, function* () {
1372
1372
  const t = yield this.readVarInt(), e = yield this.read(t);
1373
- return s(this, Tn).decode(e);
1373
+ return s(this, An).decode(e);
1374
1374
  });
1375
1375
  }
1376
1376
  readVarInt() {
@@ -1384,23 +1384,23 @@ class yn {
1384
1384
  readBigVarInt() {
1385
1385
  return h(this, null, function* () {
1386
1386
  yield f(this, U, le).call(this, 1);
1387
- const t = (f(this, U, Xr).call(this, 1)[0] & 192) >> 6;
1388
- switch (s(this, Et)[s(this, Tt)] = f(this, U, Xr).call(this, 1)[0] & 63, t) {
1387
+ const t = (f(this, U, Yr).call(this, 1)[0] & 192) >> 6;
1388
+ switch (s(this, Tt)[s(this, At)] = f(this, U, Yr).call(this, 1)[0] & 63, t) {
1389
1389
  case 0:
1390
- return k(f(this, U, Ht).call(this, 1)[0]);
1390
+ return k(f(this, U, Xt).call(this, 1)[0]);
1391
1391
  case 1: {
1392
1392
  yield f(this, U, le).call(this, 2);
1393
- const e = f(this, U, Ht).call(this, 2), i = new DataView(e.buffer, e.byteOffset, e.byteLength);
1393
+ const e = f(this, U, Xt).call(this, 2), i = new DataView(e.buffer, e.byteOffset, e.byteLength);
1394
1394
  return k(i.getUint16(0));
1395
1395
  }
1396
1396
  case 2: {
1397
1397
  yield f(this, U, le).call(this, 4);
1398
- const e = f(this, U, Ht).call(this, 4), i = new DataView(e.buffer, e.byteOffset, e.byteLength);
1398
+ const e = f(this, U, Xt).call(this, 4), i = new DataView(e.buffer, e.byteOffset, e.byteLength);
1399
1399
  return k(i.getUint32(0));
1400
1400
  }
1401
1401
  case 3: {
1402
1402
  yield f(this, U, le).call(this, 8);
1403
- const e = f(this, U, Ht).call(this, 8), i = new DataView(e.buffer, e.byteOffset, e.byteLength);
1403
+ const e = f(this, U, Xt).call(this, 8), i = new DataView(e.buffer, e.byteOffset, e.byteLength);
1404
1404
  if (typeof i.getBigUint64 != "undefined")
1405
1405
  return k(i.getBigUint64(0));
1406
1406
  const n = Oc(e, 0, 7);
@@ -1413,19 +1413,19 @@ class yn {
1413
1413
  }
1414
1414
  read(t) {
1415
1415
  return h(this, null, function* () {
1416
- return yield f(this, U, le).call(this, t), f(this, U, Ht).call(this, t);
1416
+ return yield f(this, U, le).call(this, t), f(this, U, Xt).call(this, t);
1417
1417
  });
1418
1418
  }
1419
1419
  readAll() {
1420
1420
  return h(this, null, function* () {
1421
- for (; yield f(this, U, Hr).call(this); )
1421
+ for (; yield f(this, U, Xr).call(this); )
1422
1422
  ;
1423
- return f(this, U, Ht).call(this, f(this, U, oi).call(this));
1423
+ return f(this, U, Xt).call(this, f(this, U, ci).call(this));
1424
1424
  });
1425
1425
  }
1426
1426
  isDone() {
1427
1427
  return h(this, null, function* () {
1428
- return f(this, U, oi).call(this) > 0 ? !1 : (yield f(this, U, Hr).call(this)) == 0;
1428
+ return f(this, U, ci).call(this) > 0 ? !1 : (yield f(this, U, Xr).call(this)) == 0;
1429
1429
  });
1430
1430
  }
1431
1431
  closed() {
@@ -1435,63 +1435,63 @@ class yn {
1435
1435
  }
1436
1436
  close() {
1437
1437
  return h(this, null, function* () {
1438
- return s(this, ke).releaseLock(), s(this, Zi).cancel();
1438
+ return s(this, ke).releaseLock(), s(this, Ki).cancel();
1439
1439
  });
1440
1440
  }
1441
1441
  }
1442
- Et = new WeakMap(), Zi = new WeakMap(), ke = new WeakMap(), Tt = new WeakMap(), Tn = new WeakMap(), U = new WeakSet(), oi = function() {
1443
- return s(this, Et).length - s(this, Tt);
1444
- }, Hr = function() {
1442
+ Tt = new WeakMap(), Ki = new WeakMap(), ke = new WeakMap(), At = new WeakMap(), An = new WeakMap(), U = new WeakSet(), ci = function() {
1443
+ return s(this, Tt).length - s(this, At);
1444
+ }, Xr = function() {
1445
1445
  return h(this, null, function* () {
1446
1446
  const { value: t, done: e } = yield s(this, ke).read();
1447
1447
  if (e)
1448
1448
  return Promise.resolve(0);
1449
- if (f(this, U, oi).call(this) === 0)
1450
- u(this, Et, t);
1449
+ if (f(this, U, ci).call(this) === 0)
1450
+ u(this, Tt, t);
1451
1451
  else {
1452
- const n = s(this, Et).subarray(s(this, Tt)), a = new Uint8Array(n.length + t.length);
1453
- a.set(n), a.set(t, n.byteLength), u(this, Et, a);
1452
+ const n = s(this, Tt).subarray(s(this, At)), a = new Uint8Array(n.length + t.length);
1453
+ a.set(n), a.set(t, n.byteLength), u(this, Tt, a);
1454
1454
  }
1455
- return u(this, Tt, 0), Promise.resolve(t.length);
1455
+ return u(this, At, 0), Promise.resolve(t.length);
1456
1456
  });
1457
1457
  }, le = function(t) {
1458
1458
  return h(this, null, function* () {
1459
- for (; f(this, U, oi).call(this) < t; )
1460
- if ((yield f(this, U, Hr).call(this)) === 0)
1459
+ for (; f(this, U, ci).call(this) < t; )
1460
+ if ((yield f(this, U, Xr).call(this)) === 0)
1461
1461
  throw new Error("Read failed");
1462
1462
  });
1463
- }, Xr = function(t) {
1464
- return s(this, Et).subarray(s(this, Tt), s(this, Tt) + t);
1465
- }, Ht = function(t) {
1466
- const e = f(this, U, Xr).call(this, t);
1467
- return u(this, Tt, s(this, Tt) + e.length), e;
1463
+ }, Yr = function(t) {
1464
+ return s(this, Tt).subarray(s(this, At), s(this, At) + t);
1465
+ }, Xt = function(t) {
1466
+ const e = f(this, U, Yr).call(this, t);
1467
+ return u(this, At, s(this, At) + e.length), e;
1468
1468
  };
1469
- var bs, ms, Rt, An;
1469
+ var ms, ys, jt, Dn;
1470
1470
  class Vo {
1471
1471
  constructor(t) {
1472
- o(this, bs, new Uint8Array(8));
1473
- o(this, ms);
1474
- o(this, Rt);
1475
- o(this, An, new TextEncoder());
1476
- u(this, ms, t), u(this, Rt, s(this, ms).getWriter());
1472
+ o(this, ms, new Uint8Array(8));
1473
+ o(this, ys);
1474
+ o(this, jt);
1475
+ o(this, Dn, new TextEncoder());
1476
+ u(this, ys, t), u(this, jt, s(this, ys).getWriter());
1477
1477
  }
1478
1478
  writeString(t) {
1479
1479
  return h(this, null, function* () {
1480
- const e = s(this, An).encode(t);
1480
+ const e = s(this, Dn).encode(t);
1481
1481
  return yield this.writeVarInt(e.length), this.write(e);
1482
1482
  });
1483
1483
  }
1484
1484
  write(t) {
1485
- return s(this, Rt).write(t);
1485
+ return s(this, jt).write(t);
1486
1486
  }
1487
1487
  writeUnsigned8(t) {
1488
- return s(this, Rt).write(Qn(t, s(this, bs)));
1488
+ return s(this, jt).write(Qn(t, s(this, ms)));
1489
1489
  }
1490
1490
  writeVarInt(t) {
1491
- return s(this, Rt).write(Lo(t, s(this, bs)));
1491
+ return s(this, jt).write(Lo(t, s(this, ms)));
1492
1492
  }
1493
1493
  writeBigVarInt(t) {
1494
- return s(this, Rt).write(Fo(t, s(this, bs)));
1494
+ return s(this, jt).write(Fo(t, s(this, ms)));
1495
1495
  }
1496
1496
  flush() {
1497
1497
  return h(this, null, function* () {
@@ -1499,29 +1499,29 @@ class Vo {
1499
1499
  }
1500
1500
  close() {
1501
1501
  return h(this, null, function* () {
1502
- s(this, Rt).releaseLock(), yield s(this, ms).close();
1502
+ s(this, jt).releaseLock(), yield s(this, ys).close();
1503
1503
  });
1504
1504
  }
1505
1505
  }
1506
- bs = new WeakMap(), ms = new WeakMap(), Rt = new WeakMap(), An = new WeakMap();
1506
+ ms = new WeakMap(), ys = new WeakMap(), jt = new WeakMap(), Dn = new WeakMap();
1507
1507
  const Co = {
1508
1508
  CONNECTING: 0,
1509
1509
  OPEN: 1,
1510
1510
  CLOSING: 2,
1511
1511
  CLOSED: 3
1512
1512
  };
1513
- var J, et, Ie, Dn;
1514
- const Di = class Di {
1513
+ var J, et, Ie, On;
1514
+ const Oi = class Oi {
1515
1515
  constructor(t) {
1516
1516
  o(this, J, 0);
1517
- o(this, et, new Uint8Array(Di.DEFAULT_BUFFER_SIZE));
1517
+ o(this, et, new Uint8Array(Oi.DEFAULT_BUFFER_SIZE));
1518
1518
  o(this, Ie);
1519
- o(this, Dn, new TextEncoder());
1519
+ o(this, On, new TextEncoder());
1520
1520
  u(this, Ie, t);
1521
1521
  }
1522
1522
  writeString(t) {
1523
1523
  return h(this, null, function* () {
1524
- const e = s(this, Dn).encode(t);
1524
+ const e = s(this, On).encode(t);
1525
1525
  return yield this.writeVarInt(e.length), this.write(e);
1526
1526
  });
1527
1527
  }
@@ -1550,14 +1550,14 @@ const Di = class Di {
1550
1550
  flush() {
1551
1551
  if (s(this, Ie).readyState !== Co.OPEN)
1552
1552
  throw new Error("Writer is not open");
1553
- return s(this, Ie).send(s(this, et).subarray(0, s(this, J))), u(this, J, 0), u(this, et, new Uint8Array(Di.DEFAULT_BUFFER_SIZE)), Promise.resolve();
1553
+ return s(this, Ie).send(s(this, et).subarray(0, s(this, J))), u(this, J, 0), u(this, et, new Uint8Array(Oi.DEFAULT_BUFFER_SIZE)), Promise.resolve();
1554
1554
  }
1555
1555
  close() {
1556
1556
  return s(this, Ie).close(), Promise.resolve();
1557
1557
  }
1558
1558
  };
1559
- J = new WeakMap(), et = new WeakMap(), Ie = new WeakMap(), Dn = new WeakMap(), l(Di, "DEFAULT_BUFFER_SIZE", 1024);
1560
- let Vi = Di;
1559
+ J = new WeakMap(), et = new WeakMap(), Ie = new WeakMap(), On = new WeakMap(), d(Oi, "DEFAULT_BUFFER_SIZE", 1024);
1560
+ let Ci = Oi;
1561
1561
  const Bo = Math.pow(2, 6) - 1, xo = Math.pow(2, 14) - 1, Po = Math.pow(2, 30) - 1, qc = Number.MAX_SAFE_INTEGER, _c = typeof BigInt == "function" ? k(2) ** k(62) - k(1) : k(Number.MAX_SAFE_INTEGER);
1562
1562
  function Qn(r, t) {
1563
1563
  return t[0] = r, t.subarray(0, 1);
@@ -1570,11 +1570,11 @@ function jo(r, t) {
1570
1570
  const e = new DataView(t.buffer, t.byteOffset, 4);
1571
1571
  return e.setUint32(0, r), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
1572
1572
  }
1573
- function No(r, t) {
1573
+ function Go(r, t) {
1574
1574
  const e = new DataView(t.buffer, t.byteOffset, 8);
1575
1575
  return e.setBigUint64(0, r), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
1576
1576
  }
1577
- function Go(r, t) {
1577
+ function No(r, t) {
1578
1578
  const e = new DataView(t.buffer, t.byteOffset, 8);
1579
1579
  return e.setUint32(0, r / 4294967296), e.setUint32(4, r & 4294967295), t.set([192], 0), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
1580
1580
  }
@@ -1586,7 +1586,7 @@ function Lo(r, t) {
1586
1586
  if (r <= Po)
1587
1587
  return jo(r | 2147483648, t);
1588
1588
  if (r <= qc)
1589
- return typeof BigInt == "function" ? No(BigInt(r) | BigInt(3221225472) << BigInt(32), t) : Go(Number(r), t);
1589
+ return typeof BigInt == "function" ? Go(BigInt(r) | BigInt(3221225472) << BigInt(32), t) : No(Number(r), t);
1590
1590
  throw new Error(`overflow, value larger than 53-bits: ${r}`);
1591
1591
  }
1592
1592
  function Fo(r, t) {
@@ -1597,7 +1597,7 @@ function Fo(r, t) {
1597
1597
  if (r <= Po)
1598
1598
  return jo(Number(r) | 2147483648, t);
1599
1599
  if (r <= _c)
1600
- return typeof BigInt == "function" ? No(BigInt(r) | BigInt(3221225472) << BigInt(32), t) : Go(Number(r), t);
1600
+ return typeof BigInt == "function" ? Go(BigInt(r) | BigInt(3221225472) << BigInt(32), t) : No(Number(r), t);
1601
1601
  throw new Error(`overflow, value larger than 62-bits: ${r}`);
1602
1602
  }
1603
1603
  var y = /* @__PURE__ */ ((r) => (r[r.SubscribeUpdate = 2] = "SubscribeUpdate", r[r.Subscribe = 3] = "Subscribe", r[r.SubscribeOk = 4] = "SubscribeOk", r[r.SubscribeError = 5] = "SubscribeError", r[r.Announce = 6] = "Announce", r[r.AnnounceOk = 7] = "AnnounceOk", r[r.AnnounceError = 8] = "AnnounceError", r[r.Unannounce = 9] = "Unannounce", r[r.Unsubscribe = 10] = "Unsubscribe", r[r.SubscribeDone = 11] = "SubscribeDone", r[r.AnnounceCancel = 12] = "AnnounceCancel", r[r.TrackStatusRequest = 13] = "TrackStatusRequest", r[r.TrackStatus = 14] = "TrackStatus", r[r.Goaway = 16] = "Goaway", r[r.ClientSetup = 64] = "ClientSetup", r[r.ServerSetup = 65] = "ServerSetup", r[r.Unknown = 255] = "Unknown", r))(y || {});
@@ -1619,8 +1619,8 @@ function Pa(r, t) {
1619
1619
  yield r.writeString(e);
1620
1620
  });
1621
1621
  }
1622
- const gn = k(2);
1623
- function ti(r) {
1622
+ const kn = k(2);
1623
+ function ei(r) {
1624
1624
  return h(this, null, function* () {
1625
1625
  const t = yield r.readVarInt(), e = /* @__PURE__ */ new Map();
1626
1626
  for (let i = 0; i < t; i++) {
@@ -1630,7 +1630,7 @@ function ti(r) {
1630
1630
  return e;
1631
1631
  });
1632
1632
  }
1633
- function ei(r, t) {
1633
+ function si(r, t) {
1634
1634
  return h(this, null, function* () {
1635
1635
  yield r.writeVarInt(t.size);
1636
1636
  for (const [e, i] of t)
@@ -1642,13 +1642,13 @@ function tu(r) {
1642
1642
  return {
1643
1643
  type: y.Announce,
1644
1644
  namespace: yield qn(r),
1645
- params: yield ti(r)
1645
+ params: yield ei(r)
1646
1646
  };
1647
1647
  });
1648
1648
  }
1649
1649
  function eu(r, t) {
1650
1650
  return h(this, null, function* () {
1651
- yield Pa(r, t.namespace), yield ei(r, t.params);
1651
+ yield Pa(r, t.namespace), yield si(r, t.params);
1652
1652
  });
1653
1653
  }
1654
1654
  function su(r) {
@@ -1668,7 +1668,7 @@ const ru = {
1668
1668
  Publisher: 1,
1669
1669
  Subscriber: 2,
1670
1670
  Both: 3
1671
- }, kn = {
1671
+ }, In = {
1672
1672
  Role: k(0)
1673
1673
  }, Wo = {
1674
1674
  Draft07: 4278190087
@@ -1689,7 +1689,7 @@ function nu(r, t) {
1689
1689
  yield r.writeVarInt(t.supportedVersions.length);
1690
1690
  for (const e of t.supportedVersions)
1691
1691
  yield r.writeVarInt(e.value);
1692
- yield ei(r, t.parameters);
1692
+ yield si(r, t.parameters);
1693
1693
  });
1694
1694
  }
1695
1695
  function au(r) {
@@ -1697,8 +1697,8 @@ function au(r) {
1697
1697
  const t = [], e = yield r.readVarInt();
1698
1698
  for (let n = 0; n < e; n++)
1699
1699
  t.push(yield $o(r));
1700
- const i = yield ti(r);
1701
- if (!i.has(kn.Role))
1700
+ const i = yield ei(r);
1701
+ if (!i.has(In.Role))
1702
1702
  throw new Error("Role parameter is required");
1703
1703
  return {
1704
1704
  type: y.ClientSetup,
@@ -1709,7 +1709,7 @@ function au(r) {
1709
1709
  }
1710
1710
  function ou(r, t) {
1711
1711
  return h(this, null, function* () {
1712
- yield r.writeVarInt(t.selectedVersion.value), yield ei(r, t.parameters);
1712
+ yield r.writeVarInt(t.selectedVersion.value), yield si(r, t.parameters);
1713
1713
  });
1714
1714
  }
1715
1715
  function cu(r) {
@@ -1717,8 +1717,8 @@ function cu(r) {
1717
1717
  const t = yield $o(r);
1718
1718
  if (t.type !== "known")
1719
1719
  throw new Error("Expected known version");
1720
- const e = yield ti(r);
1721
- if (!e.has(kn.Role))
1720
+ const e = yield ei(r);
1721
+ if (!e.has(In.Role))
1722
1722
  throw new Error("Role parameter is required");
1723
1723
  return {
1724
1724
  type: y.ServerSetup,
@@ -1816,9 +1816,9 @@ function zo(r, t) {
1816
1816
  }
1817
1817
  function lu(r) {
1818
1818
  return h(this, null, function* () {
1819
- const t = yield r.readBigVarInt(), e = yield r.readBigVarInt(), i = yield qn(r), n = yield r.readString(), a = yield r.readUnsigned8(), c = yield Mo(r), d = yield hu(r), w = yield ti(r);
1820
- if (d.type === "absolute-range") {
1821
- const p = d.start.group > d.end.group, m = d.start.group === d.end.group && d.start.object > d.end.object;
1819
+ const t = yield r.readBigVarInt(), e = yield r.readBigVarInt(), i = yield qn(r), n = yield r.readString(), a = yield r.readUnsigned8(), c = yield Mo(r), l = yield hu(r), w = yield ei(r);
1820
+ if (l.type === "absolute-range") {
1821
+ const p = l.start.group > l.end.group, m = l.start.group === l.end.group && l.start.object > l.end.object;
1822
1822
  if (p || m)
1823
1823
  throw new Error("Invalid filter range");
1824
1824
  }
@@ -1830,14 +1830,14 @@ function lu(r) {
1830
1830
  name: n,
1831
1831
  subscriberPriority: a,
1832
1832
  groupOrder: c,
1833
- filterType: d,
1833
+ filterType: l,
1834
1834
  params: w
1835
1835
  };
1836
1836
  });
1837
1837
  }
1838
1838
  function wu(r, t) {
1839
1839
  return h(this, null, function* () {
1840
- yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.trackAlias), yield Pa(r, t.namespace), yield r.writeString(t.name), yield r.writeUnsigned8(t.subscriberPriority), yield zo(r, t.groupOrder), yield du(r, t.filterType), yield ei(r, t.params);
1840
+ yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.trackAlias), yield Pa(r, t.namespace), yield r.writeString(t.name), yield r.writeUnsigned8(t.subscriberPriority), yield zo(r, t.groupOrder), yield du(r, t.filterType), yield si(r, t.params);
1841
1841
  });
1842
1842
  }
1843
1843
  const ma = {
@@ -1896,7 +1896,7 @@ function yu(r) {
1896
1896
  group: yield r.readBigVarInt(),
1897
1897
  object: yield r.readBigVarInt()
1898
1898
  });
1899
- const c = yield ti(r);
1899
+ const c = yield ei(r);
1900
1900
  return {
1901
1901
  type: y.SubscribeOk,
1902
1902
  id: t,
@@ -1909,12 +1909,12 @@ function yu(r) {
1909
1909
  }
1910
1910
  function gu(r, t) {
1911
1911
  return h(this, null, function* () {
1912
- yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.expires), yield zo(r, t.groupOrder), yield r.writeUnsigned8(t.largestInfo ? 1 : 0), t.largestInfo && (yield r.writeBigVarInt(t.largestInfo.group), yield r.writeBigVarInt(t.largestInfo.object)), yield ei(r, t.params);
1912
+ yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.expires), yield zo(r, t.groupOrder), yield r.writeUnsigned8(t.largestInfo ? 1 : 0), t.largestInfo && (yield r.writeBigVarInt(t.largestInfo.group), yield r.writeBigVarInt(t.largestInfo.object)), yield si(r, t.params);
1913
1913
  });
1914
1914
  }
1915
1915
  function ku(r) {
1916
1916
  return h(this, null, function* () {
1917
- const t = yield r.readBigVarInt(), e = yield r.readBigVarInt(), i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readBigVarInt(), c = yield r.readUnsigned8(), d = yield ti(r), w = e > n, p = e === n && i > a;
1917
+ const t = yield r.readBigVarInt(), e = yield r.readBigVarInt(), i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readBigVarInt(), c = yield r.readUnsigned8(), l = yield ei(r), w = e > n, p = e === n && i > a;
1918
1918
  if (w || p)
1919
1919
  throw new Error("Invalid filter range");
1920
1920
  return {
@@ -1923,13 +1923,13 @@ function ku(r) {
1923
1923
  start: { group: e, object: i },
1924
1924
  end: { group: n, object: a },
1925
1925
  subscriberPriority: c,
1926
- params: d
1926
+ params: l
1927
1927
  };
1928
1928
  });
1929
1929
  }
1930
1930
  function Iu(r, t) {
1931
1931
  return h(this, null, function* () {
1932
- yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.start.group), yield r.writeBigVarInt(t.start.object), yield r.writeBigVarInt(t.end.group), yield r.writeBigVarInt(t.end.object), yield r.writeUnsigned8(t.subscriberPriority), yield ei(r, t.params);
1932
+ yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.start.group), yield r.writeBigVarInt(t.start.object), yield r.writeBigVarInt(t.end.group), yield r.writeBigVarInt(t.end.object), yield r.writeUnsigned8(t.subscriberPriority), yield si(r, t.params);
1933
1933
  });
1934
1934
  }
1935
1935
  function vu(r) {
@@ -1945,25 +1945,25 @@ function Su(r, t) {
1945
1945
  yield r.writeBigVarInt(t.id);
1946
1946
  });
1947
1947
  }
1948
- var jt, ys, P, Xo, Yo, Zo, Ko, Jo, Qo, qo, _o, tc, ec;
1948
+ var Gt, gs, P, Xo, Yo, Zo, Ko, Jo, Qo, qo, _o, tc, ec;
1949
1949
  class Ho {
1950
1950
  constructor(t) {
1951
1951
  o(this, P);
1952
- o(this, jt);
1952
+ o(this, Gt);
1953
1953
  // Temporary buffer that holds the message before it is written to the stream
1954
1954
  // This way we can calculate the byte length of the message before writing it
1955
- o(this, ys, new Uint8Array());
1956
- u(this, jt, t);
1955
+ o(this, gs, new Uint8Array());
1956
+ u(this, Gt, t);
1957
1957
  }
1958
1958
  write(t) {
1959
1959
  return h(this, null, function* () {
1960
- yield s(this, jt).writeVarInt(t.type);
1961
- const e = new Vi({
1960
+ yield s(this, Gt).writeVarInt(t.type);
1961
+ const e = new Ci({
1962
1962
  close: () => {
1963
1963
  },
1964
1964
  readyState: Co.OPEN,
1965
1965
  send: (i) => {
1966
- u(this, ys, new Uint8Array(i));
1966
+ u(this, gs, new Uint8Array(i));
1967
1967
  }
1968
1968
  });
1969
1969
  switch (t.type) {
@@ -2000,16 +2000,16 @@ class Ho {
2000
2000
  default:
2001
2001
  throw new Error(`Unknown message type: ${t.type}`);
2002
2002
  }
2003
- yield e.flush(), yield s(this, jt).writeVarInt(s(this, ys).byteLength), yield s(this, jt).write(s(this, ys)), yield s(this, jt).flush();
2003
+ yield e.flush(), yield s(this, Gt).writeVarInt(s(this, gs).byteLength), yield s(this, Gt).write(s(this, gs)), yield s(this, Gt).flush();
2004
2004
  });
2005
2005
  }
2006
2006
  close() {
2007
2007
  return h(this, null, function* () {
2008
- return s(this, jt).close();
2008
+ return s(this, Gt).close();
2009
2009
  });
2010
2010
  }
2011
2011
  }
2012
- jt = new WeakMap(), ys = new WeakMap(), P = new WeakSet(), Xo = function(t, e) {
2012
+ Gt = new WeakMap(), gs = new WeakMap(), P = new WeakSet(), Xo = function(t, e) {
2013
2013
  return h(this, null, function* () {
2014
2014
  yield nu(t, e);
2015
2015
  });
@@ -2050,24 +2050,24 @@ jt = new WeakMap(), ys = new WeakMap(), P = new WeakSet(), Xo = function(t, e) {
2050
2050
  yield iu(t, e);
2051
2051
  });
2052
2052
  };
2053
- var gs, Ki, Ji;
2053
+ var ks, Ji, Qi;
2054
2054
  class Uu {
2055
2055
  constructor(t, e) {
2056
- o(this, gs);
2057
- o(this, Ki);
2056
+ o(this, ks);
2058
2057
  o(this, Ji);
2059
- u(this, gs, t), u(this, Ki, new Ho(t)), u(this, Ji, e);
2058
+ o(this, Qi);
2059
+ u(this, ks, t), u(this, Ji, new Ho(t)), u(this, Qi, e);
2060
2060
  }
2061
2061
  write(t) {
2062
2062
  return h(this, null, function* () {
2063
- yield s(this, gs).write(s(this, Ji)), yield s(this, Ki).write(t);
2063
+ yield s(this, ks).write(s(this, Qi)), yield s(this, Ji).write(t);
2064
2064
  });
2065
2065
  }
2066
2066
  close() {
2067
- return s(this, gs).close();
2067
+ return s(this, ks).close();
2068
2068
  }
2069
2069
  }
2070
- gs = new WeakMap(), Ki = new WeakMap(), Ji = new WeakMap();
2070
+ ks = new WeakMap(), Ji = new WeakMap(), Qi = new WeakMap();
2071
2071
  function Eu(r) {
2072
2072
  return h(this, null, function* () {
2073
2073
  return {
@@ -2128,64 +2128,64 @@ class _a {
2128
2128
  }
2129
2129
  }
2130
2130
  j = new WeakMap();
2131
- var Qi, ks, Is, qi, On, sc, Vn;
2131
+ var qi, Is, vs, _i, Vn, sc, Cn;
2132
2132
  const ss = class ss {
2133
2133
  constructor(t, e) {
2134
- o(this, On);
2135
- o(this, Qi);
2136
- o(this, ks);
2137
- o(this, Is, new V());
2138
- o(this, qi, new V());
2139
- u(this, Qi, t), u(this, ks, e), s(this, Is).resolve();
2134
+ o(this, Vn);
2135
+ o(this, qi);
2136
+ o(this, Is);
2137
+ o(this, vs, new V());
2138
+ o(this, _i, new V());
2139
+ u(this, qi, t), u(this, Is, e), s(this, vs).resolve();
2140
2140
  }
2141
2141
  write(t) {
2142
2142
  return h(this, null, function* () {
2143
- const e = yield f(this, On, sc).call(this);
2143
+ const e = yield f(this, Vn, sc).call(this);
2144
2144
  try {
2145
- yield s(this, Qi).write(t);
2145
+ yield s(this, qi).write(t);
2146
2146
  } finally {
2147
2147
  e.resolve();
2148
2148
  }
2149
2149
  });
2150
2150
  }
2151
2151
  markPostHandshake() {
2152
- s(this, qi).resolve();
2152
+ s(this, _i).resolve();
2153
2153
  }
2154
2154
  postHandshake() {
2155
- return s(this, qi).promise;
2155
+ return s(this, _i).promise;
2156
2156
  }
2157
2157
  // Not "thread" safe (:
2158
2158
  read() {
2159
2159
  return h(this, null, function* () {
2160
- return s(this, ks).read();
2160
+ return s(this, Is).read();
2161
2161
  });
2162
2162
  }
2163
2163
  cancel() {
2164
- return s(this, ks).cancel();
2164
+ return s(this, Is).cancel();
2165
2165
  }
2166
2166
  static wrapWebsocket(t) {
2167
- const e = new ReadableStream(new Jc(t, s(ss, Vn))), i = new _a(new yn(new Uint8Array([]), e)), n = new Uu(new Vi(t), new Uint8Array([0]));
2167
+ const e = new ReadableStream(new Jc(t, s(ss, Cn))), i = new _a(new gn(new Uint8Array([]), e)), n = new Uu(new Ci(t), new Uint8Array([0]));
2168
2168
  return new ss(n, i);
2169
2169
  }
2170
2170
  static wrapWebTransport(t) {
2171
2171
  const e = t.writable, i = t.readable;
2172
2172
  return new ss(
2173
2173
  new Ho(new Vo(e)),
2174
- new _a(new yn(new Uint8Array(), i))
2174
+ new _a(new gn(new Uint8Array(), i))
2175
2175
  );
2176
2176
  }
2177
2177
  };
2178
- Qi = new WeakMap(), ks = new WeakMap(), Is = new WeakMap(), qi = new WeakMap(), On = new WeakSet(), sc = function() {
2179
- const t = new V(), e = s(this, Is).promise.then(() => t);
2180
- return u(this, Is, t), e;
2181
- }, Vn = new WeakMap(), o(ss, Vn, 0);
2182
- let In = ss;
2178
+ qi = new WeakMap(), Is = new WeakMap(), vs = new WeakMap(), _i = new WeakMap(), Vn = new WeakSet(), sc = function() {
2179
+ const t = new V(), e = s(this, vs).promise.then(() => t);
2180
+ return u(this, vs, t), e;
2181
+ }, Cn = new WeakMap(), o(ss, Cn, 0);
2182
+ let vn = ss;
2183
2183
  function ic(r, t) {
2184
2184
  return h(this, null, function* () {
2185
2185
  yield r.write({
2186
2186
  type: y.ClientSetup,
2187
2187
  supportedVersions: [{ type: "known", value: Wo.Draft07 }],
2188
- parameters: /* @__PURE__ */ new Map([[kn.Role, { type: kn.Role, payload: new Uint8Array([t]) }]])
2188
+ parameters: /* @__PURE__ */ new Map([[In.Role, { type: In.Role, payload: new Uint8Array([t]) }]])
2189
2189
  });
2190
2190
  const e = yield r.read();
2191
2191
  if (r.markPostHandshake(), e.type !== y.ServerSetup)
@@ -2194,43 +2194,43 @@ function ic(r, t) {
2194
2194
  throw new Error("Expected known version");
2195
2195
  });
2196
2196
  }
2197
- var vs;
2197
+ var Ss;
2198
2198
  class Au {
2199
2199
  constructor(t) {
2200
- l(this, "announce");
2201
- o(this, vs, new V());
2200
+ d(this, "announce");
2201
+ o(this, Ss, new V());
2202
2202
  this.announce = t;
2203
2203
  }
2204
2204
  onOk(t) {
2205
- s(this, vs).resolve(t);
2205
+ s(this, Ss).resolve(t);
2206
2206
  }
2207
2207
  onError(t) {
2208
2208
  const e = new Error(t.reason);
2209
- return s(this, vs).reject(e), e;
2209
+ return s(this, Ss).reject(e), e;
2210
2210
  }
2211
2211
  ok() {
2212
- return s(this, vs).promise;
2212
+ return s(this, Ss).promise;
2213
2213
  }
2214
2214
  }
2215
- vs = new WeakMap();
2215
+ Ss = new WeakMap();
2216
2216
  function Du(r) {
2217
2217
  const t = new Au(r);
2218
2218
  return new Ou(t);
2219
2219
  }
2220
2220
  class Ou {
2221
2221
  constructor(t) {
2222
- l(this, "state");
2222
+ d(this, "state");
2223
2223
  this.state = t;
2224
2224
  }
2225
2225
  }
2226
- var Ss, Yt, ve, Cn, Se, pt;
2227
- const Bn = class Bn {
2226
+ var Us, Zt, ve, Bn, Se, pt;
2227
+ const is = class is {
2228
2228
  constructor(t) {
2229
- l(this, "subscribe");
2230
- o(this, Ss, new V());
2231
- o(this, Yt, new V());
2229
+ d(this, "subscribe");
2230
+ o(this, Us, new V());
2231
+ o(this, Zt, new V());
2232
2232
  o(this, ve, new V());
2233
- o(this, Cn, Date.now());
2233
+ o(this, Bn, Date.now());
2234
2234
  o(this, Se, new V());
2235
2235
  o(this, pt);
2236
2236
  switch (this.subscribe = t, t.filterType.type) {
@@ -2247,27 +2247,27 @@ const Bn = class Bn {
2247
2247
  }
2248
2248
  onError(t) {
2249
2249
  const e = new Error(t.reason);
2250
- return s(this, Ss).reject(e), s(this, Yt).reject(e), e;
2250
+ return s(this, Us).reject(e), s(this, Zt).reject(e), e;
2251
2251
  }
2252
2252
  onDone(t) {
2253
- t.finalInfo && (s(this, pt) || u(this, pt, { startGroup: k(0) }), s(this, pt).endGroup = t.finalInfo.group), s(this, Yt).resolve(t);
2253
+ t.finalInfo && (s(this, pt) || u(this, pt, { startGroup: k(0) }), s(this, pt).endGroup = t.finalInfo.group), s(this, Zt).resolve(t);
2254
2254
  }
2255
2255
  onUnsubscribe(t) {
2256
2256
  s(this, ve).resolve(t);
2257
2257
  }
2258
2258
  onOk(t) {
2259
- const e = Math.max(0, Date.now() - s(this, Cn)), i = Number(t.expires);
2259
+ const e = Math.max(0, Date.now() - s(this, Bn)), i = Number(t.expires);
2260
2260
  if (i > 0) {
2261
- const n = Math.min(i / 10, Bn.maxGraceTime);
2261
+ const n = Math.max(is.minGraceTime, Math.min(i / 10, is.maxGraceTime));
2262
2262
  Promise.race([Kn(i - n - e), this.done().catch(A)]).then(() => s(this, Se).resolve(this.expiryState())).catch(A);
2263
2263
  }
2264
- s(this, Ss).resolve(t);
2264
+ s(this, Us).resolve(t);
2265
2265
  }
2266
2266
  done() {
2267
- return s(this, Yt).promise;
2267
+ return s(this, Zt).promise;
2268
2268
  }
2269
2269
  ok() {
2270
- return s(this, Ss).promise;
2270
+ return s(this, Us).promise;
2271
2271
  }
2272
2272
  range() {
2273
2273
  return s(this, pt);
@@ -2277,7 +2277,7 @@ const Bn = class Bn {
2277
2277
  }
2278
2278
  // Returns whether the subscription is still active - i.e. hasn't received a done or unsubscribe
2279
2279
  expiryState() {
2280
- return s(this, Yt).resolved && s(this, Yt).resolved.errorCode !== ma.Expired ? "done" : s(this, ve).pending ? "active" : "unsubscribed";
2280
+ return s(this, Zt).resolved && s(this, Zt).resolved.errorCode !== ma.Expired ? "done" : s(this, ve).pending ? "active" : "unsubscribed";
2281
2281
  }
2282
2282
  unsubscribed() {
2283
2283
  return s(this, ve).promise;
@@ -2293,18 +2293,18 @@ const Bn = class Bn {
2293
2293
  return s(this, Se).promise;
2294
2294
  }
2295
2295
  };
2296
- Ss = new WeakMap(), Yt = new WeakMap(), ve = new WeakMap(), Cn = new WeakMap(), Se = new WeakMap(), pt = new WeakMap(), l(Bn, "maxGraceTime", 15e3);
2297
- let vn = Bn;
2298
- var $, _i;
2296
+ Us = new WeakMap(), Zt = new WeakMap(), ve = new WeakMap(), Bn = new WeakMap(), Se = new WeakMap(), pt = new WeakMap(), d(is, "maxGraceTime", 15e3), d(is, "minGraceTime", 3e3);
2297
+ let Sn = is;
2298
+ var $, tr;
2299
2299
  class Vu {
2300
2300
  constructor(t) {
2301
2301
  o(this, $);
2302
- o(this, _i, !1);
2302
+ o(this, tr, !1);
2303
2303
  u(this, $, t);
2304
2304
  }
2305
2305
  write(t) {
2306
2306
  return h(this, null, function* () {
2307
- s(this, _i) || (yield s(this, $).writeVarInt(mn.StreamHeaderGroup), yield s(this, $).writeBigVarInt(t.subscribeId), yield s(this, $).writeBigVarInt(t.trackAlias), yield s(this, $).writeBigVarInt(t.groupId), yield s(this, $).writeBigVarInt(t.subGroupId), yield s(this, $).writeUnsigned8(t.subscriberPriority), u(this, _i, !0)), yield s(this, $).writeBigVarInt(t.objectId), yield s(this, $).writeVarInt(t.payload.length), t.payload.length > 0 ? yield s(this, $).write(t.payload) : yield s(this, $).writeVarInt(t.objectStatus), yield s(this, $).flush();
2307
+ s(this, tr) || (yield s(this, $).writeVarInt(yn.StreamHeaderGroup), yield s(this, $).writeBigVarInt(t.subscribeId), yield s(this, $).writeBigVarInt(t.trackAlias), yield s(this, $).writeBigVarInt(t.groupId), yield s(this, $).writeBigVarInt(t.subGroupId), yield s(this, $).writeUnsigned8(t.subscriberPriority), u(this, tr, !0)), yield s(this, $).writeBigVarInt(t.objectId), yield s(this, $).writeVarInt(t.payload.length), t.payload.length > 0 ? yield s(this, $).write(t.payload) : yield s(this, $).writeVarInt(t.objectStatus), yield s(this, $).flush();
2308
2308
  });
2309
2309
  }
2310
2310
  close() {
@@ -2313,26 +2313,26 @@ class Vu {
2313
2313
  });
2314
2314
  }
2315
2315
  }
2316
- $ = new WeakMap(), _i = new WeakMap();
2317
- var tr, ct, er, sr, Us, ir, xn, rc;
2316
+ $ = new WeakMap(), tr = new WeakMap();
2317
+ var er, ct, sr, ir, Es, rr, xn, rc;
2318
2318
  class Cu {
2319
2319
  constructor(t, e, i, n) {
2320
2320
  o(this, xn);
2321
- o(this, tr);
2322
- o(this, ct);
2323
2321
  o(this, er);
2322
+ o(this, ct);
2324
2323
  o(this, sr);
2325
- o(this, Us);
2326
2324
  o(this, ir);
2327
- u(this, tr, e), u(this, ct, t), u(this, er, i), u(this, sr, n), u(this, ir, rt.get().createContext(`SubscriptionWriter:${t.subscribe.name}`));
2325
+ o(this, Es);
2326
+ o(this, rr);
2327
+ u(this, er, e), u(this, ct, t), u(this, sr, i), u(this, ir, n), u(this, rr, rt.get().createContext(`SubscriptionWriter:${t.subscribe.name}`));
2328
2328
  }
2329
2329
  finalInfo() {
2330
- return s(this, Us);
2330
+ return s(this, Es);
2331
2331
  }
2332
2332
  run() {
2333
2333
  return h(this, null, function* () {
2334
2334
  yield Promise.race([
2335
- f(this, xn, rc).call(this).catch((t) => s(this, ir).error("error writing subscription", t)),
2335
+ f(this, xn, rc).call(this).catch((t) => s(this, rr).error("error writing subscription", t)),
2336
2336
  s(this, ct).unsubscribed(),
2337
2337
  s(this, ct).done(),
2338
2338
  s(this, ct).expiryNotification().catch(A)
@@ -2348,33 +2348,33 @@ class Cu {
2348
2348
  id: s(this, ct).subscribe.id,
2349
2349
  errorCode: t,
2350
2350
  reason: e,
2351
- finalInfo: s(this, Us)
2351
+ finalInfo: s(this, Es)
2352
2352
  };
2353
- s(this, ct).onDone(i), yield s(this, sr).push(i);
2353
+ s(this, ct).onDone(i), yield s(this, ir).push(i);
2354
2354
  });
2355
2355
  }
2356
- [Ct()]() {
2356
+ [Bt()]() {
2357
2357
  return this.done(ma.TrackEnded, "Track ended");
2358
2358
  }
2359
2359
  [Symbol.asyncDispose]() {
2360
2360
  return this.done(ma.TrackEnded, "Track ended");
2361
2361
  }
2362
2362
  }
2363
- tr = new WeakMap(), ct = new WeakMap(), er = new WeakMap(), sr = new WeakMap(), Us = new WeakMap(), ir = new WeakMap(), xn = new WeakSet(), rc = function() {
2363
+ er = new WeakMap(), ct = new WeakMap(), sr = new WeakMap(), ir = new WeakMap(), Es = new WeakMap(), rr = new WeakMap(), xn = new WeakSet(), rc = function() {
2364
2364
  return h(this, null, function* () {
2365
2365
  try {
2366
- for (var c = C(s(this, tr)), d, w, p; d = !(w = yield c.next()).done; d = !1) {
2366
+ for (var c = C(s(this, er)), l, w, p; l = !(w = yield c.next()).done; l = !1) {
2367
2367
  const m = w.value;
2368
2368
  var t = [];
2369
2369
  try {
2370
2370
  const b = s(this, ct).range();
2371
2371
  if (b && (b.startGroup > m.id || b.endGroup && b.endGroup < m.id))
2372
2372
  break;
2373
- const I = yield s(this, er).openSendStream();
2373
+ const I = yield s(this, sr).openSendStream();
2374
2374
  const g = new Vu(I);
2375
2375
  const E = nt(t, new Bu(g, m.consume(), s(this, ct)), !0);
2376
2376
  yield E.run();
2377
- u(this, Us, E.finalGroup());
2377
+ u(this, Es, E.finalGroup());
2378
2378
  } catch (e) {
2379
2379
  var i = e, n = !0;
2380
2380
  } finally {
@@ -2386,7 +2386,7 @@ tr = new WeakMap(), ct = new WeakMap(), er = new WeakMap(), sr = new WeakMap(),
2386
2386
  p = [w];
2387
2387
  } finally {
2388
2388
  try {
2389
- d && (w = c.return) && (yield w.call(c));
2389
+ l && (w = c.return) && (yield w.call(c));
2390
2390
  } finally {
2391
2391
  if (p)
2392
2392
  throw p[0];
@@ -2394,35 +2394,35 @@ tr = new WeakMap(), ct = new WeakMap(), er = new WeakMap(), sr = new WeakMap(),
2394
2394
  }
2395
2395
  });
2396
2396
  };
2397
- var Ue, rr, Es, nr, Ts;
2397
+ var Ue, nr, Ts, ar, As;
2398
2398
  class Bu {
2399
2399
  constructor(t, e, i) {
2400
2400
  o(this, Ue);
2401
- o(this, rr);
2402
- o(this, Es);
2403
2401
  o(this, nr);
2404
2402
  o(this, Ts);
2405
- u(this, Ue, t), u(this, rr, e), u(this, Es, i), u(this, Ts, rt.get().createContext(`GroupSubscriptionWriter:${i.subscribe.name}`));
2403
+ o(this, ar);
2404
+ o(this, As);
2405
+ u(this, Ue, t), u(this, nr, e), u(this, Ts, i), u(this, As, rt.get().createContext(`GroupSubscriptionWriter:${i.subscribe.name}`));
2406
2406
  }
2407
2407
  finalGroup() {
2408
- return s(this, nr);
2408
+ return s(this, ar);
2409
2409
  }
2410
2410
  run() {
2411
2411
  return h(this, null, function* () {
2412
- s(this, Ts).debug("write group");
2412
+ s(this, As).debug("write group");
2413
2413
  try {
2414
- for (var t = C(s(this, rr)), e, i, n; e = !(i = yield t.next()).done; e = !1) {
2414
+ for (var t = C(s(this, nr)), e, i, n; e = !(i = yield t.next()).done; e = !1) {
2415
2415
  const a = i.value;
2416
2416
  yield s(this, Ue).write({
2417
- subscribeId: s(this, Es).subscribe.id,
2418
- trackAlias: s(this, Es).subscribe.trackAlias,
2417
+ subscribeId: s(this, Ts).subscribe.id,
2418
+ trackAlias: s(this, Ts).subscribe.trackAlias,
2419
2419
  subGroupId: k(0),
2420
2420
  subscriberPriority: 0,
2421
2421
  groupId: a.groupId,
2422
2422
  objectId: a.objectId,
2423
2423
  objectStatus: a.objectStatus,
2424
2424
  payload: a.payload
2425
- }), u(this, nr, { group: a.groupId, object: a.objectId });
2425
+ }), u(this, ar, { group: a.groupId, object: a.objectId });
2426
2426
  }
2427
2427
  } catch (i) {
2428
2428
  n = [i];
@@ -2434,25 +2434,25 @@ class Bu {
2434
2434
  throw n[0];
2435
2435
  }
2436
2436
  }
2437
- s(this, Ts).debug("write group done");
2437
+ s(this, As).debug("write group done");
2438
2438
  });
2439
2439
  }
2440
- [Ct()]() {
2440
+ [Bt()]() {
2441
2441
  return s(this, Ue).close().catch(A);
2442
2442
  }
2443
2443
  [Symbol.asyncDispose]() {
2444
2444
  return s(this, Ue).close().catch(A);
2445
2445
  }
2446
2446
  }
2447
- Ue = new WeakMap(), rr = new WeakMap(), Es = new WeakMap(), nr = new WeakMap(), Ts = new WeakMap();
2448
- var ar, Ee, Zt, Qe;
2447
+ Ue = new WeakMap(), nr = new WeakMap(), Ts = new WeakMap(), ar = new WeakMap(), As = new WeakMap();
2448
+ var or, Ee, Kt, Qe;
2449
2449
  class xu {
2450
2450
  constructor(t, e, i) {
2451
- o(this, Zt);
2452
- l(this, "state");
2453
- o(this, ar);
2451
+ o(this, Kt);
2452
+ d(this, "state");
2453
+ o(this, or);
2454
2454
  o(this, Ee);
2455
- this.state = t, u(this, ar, e), u(this, Ee, i);
2455
+ this.state = t, u(this, or, e), u(this, Ee, i);
2456
2456
  }
2457
2457
  /**
2458
2458
  * Accept the subscription and provide a track cache for the subscription
@@ -2462,7 +2462,7 @@ class xu {
2462
2462
  ok(t) {
2463
2463
  return h(this, null, function* () {
2464
2464
  var w, p, m;
2465
- const e = (w = this.state.range()) == null ? void 0 : w.startGroup, i = t.latest(), n = i == null ? void 0 : i.id, a = (m = (p = i == null ? void 0 : i.latest()) == null ? void 0 : p.objectId) != null ? m : k(0), c = t.consume(e != null ? e : n), d = {
2465
+ const e = (w = this.state.range()) == null ? void 0 : w.startGroup, i = t.latest(), n = i == null ? void 0 : i.id, a = (m = (p = i == null ? void 0 : i.latest()) == null ? void 0 : p.objectId) != null ? m : k(0), c = t.consume(e != null ? e : n), l = {
2466
2466
  type: y.SubscribeOk,
2467
2467
  id: this.state.subscribe.id,
2468
2468
  expires: k(0),
@@ -2470,32 +2470,32 @@ class xu {
2470
2470
  params: /* @__PURE__ */ new Map(),
2471
2471
  largestInfo: n ? { group: n, object: a } : void 0
2472
2472
  };
2473
- return yield s(this, Ee).push(d), new Cu(this.state, c, s(this, ar), s(this, Ee));
2473
+ return yield s(this, Ee).push(l), new Cu(this.state, c, s(this, or), s(this, Ee));
2474
2474
  });
2475
2475
  }
2476
2476
  invalidRange() {
2477
- return f(this, Zt, Qe).call(this, k(1), "Invalid range");
2477
+ return f(this, Kt, Qe).call(this, k(1), "Invalid range");
2478
2478
  }
2479
2479
  retryTrackAlias() {
2480
- return f(this, Zt, Qe).call(this, k(2), "Retry track alias");
2480
+ return f(this, Kt, Qe).call(this, k(2), "Retry track alias");
2481
2481
  }
2482
2482
  trackDoesNotExist() {
2483
- return f(this, Zt, Qe).call(this, k(3), "Track does not exist");
2483
+ return f(this, Kt, Qe).call(this, k(3), "Track does not exist");
2484
2484
  }
2485
2485
  unauthorized() {
2486
- return f(this, Zt, Qe).call(this, k(4), "Unauthorized");
2486
+ return f(this, Kt, Qe).call(this, k(4), "Unauthorized");
2487
2487
  }
2488
2488
  timeout() {
2489
- return f(this, Zt, Qe).call(this, k(5), "Timeout");
2489
+ return f(this, Kt, Qe).call(this, k(5), "Timeout");
2490
2490
  }
2491
- [Ct()]() {
2491
+ [Bt()]() {
2492
2492
  return this.trackDoesNotExist();
2493
2493
  }
2494
2494
  [Symbol.asyncDispose]() {
2495
2495
  return this.trackDoesNotExist();
2496
2496
  }
2497
2497
  }
2498
- ar = new WeakMap(), Ee = new WeakMap(), Zt = new WeakSet(), Qe = function(t, e) {
2498
+ or = new WeakMap(), Ee = new WeakMap(), Kt = new WeakSet(), Qe = function(t, e) {
2499
2499
  const i = {
2500
2500
  type: y.SubscribeError,
2501
2501
  id: this.state.subscribe.id,
@@ -2505,77 +2505,77 @@ ar = new WeakMap(), Ee = new WeakMap(), Zt = new WeakSet(), Qe = function(t, e)
2505
2505
  };
2506
2506
  return s(this, Ee).push(i);
2507
2507
  };
2508
- var no, As, or, Ds, Te, Kt, Jt, Qt, oa;
2508
+ var no, Ds, cr, Os, Te, Jt, Qt, qt, oa;
2509
2509
  no = [q({ context: "Session", enter: "info", error: "error" })];
2510
2510
  class ya {
2511
2511
  constructor(t, e, i) {
2512
2512
  he(oa, 5, this);
2513
- o(this, As);
2514
- o(this, or);
2515
2513
  o(this, Ds);
2514
+ o(this, cr);
2515
+ o(this, Os);
2516
2516
  o(this, Te, rt.get().createContext("Publisher"));
2517
- o(this, Kt, new Y(/* @__PURE__ */ new Map()));
2518
2517
  o(this, Jt, new Y(/* @__PURE__ */ new Map()));
2519
- o(this, Qt, new Jn(10));
2520
- u(this, As, t), u(this, or, e), u(this, Ds, i);
2518
+ o(this, Qt, new Y(/* @__PURE__ */ new Map()));
2519
+ o(this, qt, new Jn(10));
2520
+ u(this, Ds, t), u(this, cr, e), u(this, Os, i);
2521
2521
  }
2522
2522
  announce(t) {
2523
2523
  return h(this, null, function* () {
2524
- if (s(this, Kt).current().has(t.join("/")))
2524
+ if (s(this, Jt).current().has(t.join("/")))
2525
2525
  throw new Error("Duplicate announcement");
2526
- const e = /* @__PURE__ */ new Map(), i = s(this, As).authToken();
2527
- i && e.set(gn, { type: gn, payload: new TextEncoder().encode(i) });
2526
+ const e = /* @__PURE__ */ new Map(), i = s(this, Ds).authToken();
2527
+ i && e.set(kn, { type: kn, payload: new TextEncoder().encode(i) });
2528
2528
  const n = {
2529
2529
  type: y.Announce,
2530
2530
  namespace: t,
2531
2531
  params: e
2532
2532
  }, a = Du(n);
2533
- if (s(this, Kt).update((d) => d.set(n.namespace.join("/"), a)), yield s(this, Ds).push(n), !(yield Promise.race([a.state.ok(), s(this, As).closed()])))
2533
+ if (s(this, Jt).update((l) => l.set(n.namespace.join("/"), a)), yield s(this, Os).push(n), !(yield Promise.race([a.state.ok(), s(this, Ds).closed()])))
2534
2534
  throw new Error("Session closed");
2535
2535
  });
2536
2536
  }
2537
2537
  close() {
2538
- s(this, Jt).current().forEach((t) => t.close()), s(this, Jt).close(), s(this, Kt).close(), s(this, Qt).close();
2538
+ s(this, Qt).current().forEach((t) => t.close()), s(this, Qt).close(), s(this, Jt).close(), s(this, qt).close();
2539
2539
  }
2540
2540
  incomingSubscriptions() {
2541
- return s(this, Qt);
2541
+ return s(this, qt);
2542
2542
  }
2543
2543
  onMessage(t) {
2544
2544
  return h(this, null, function* () {
2545
2545
  switch (t.type) {
2546
2546
  case y.Subscribe:
2547
2547
  {
2548
- const e = new vn(t);
2549
- if (s(this, Jt).update((i) => (i.set(t.id, e), i)), s(this, Qt).isFull()) {
2550
- const i = yield s(this, Qt).pop();
2548
+ const e = new Sn(t);
2549
+ if (s(this, Qt).update((i) => (i.set(t.id, e), i)), s(this, qt).isFull()) {
2550
+ const i = yield s(this, qt).pop();
2551
2551
  yield i == null ? void 0 : i.timeout();
2552
2552
  }
2553
- yield s(this, Qt).push(
2554
- new xu(e, s(this, or), s(this, Ds))
2553
+ yield s(this, qt).push(
2554
+ new xu(e, s(this, cr), s(this, Os))
2555
2555
  );
2556
2556
  }
2557
2557
  break;
2558
2558
  case y.SubscribeUpdate:
2559
2559
  {
2560
- const e = s(this, Jt).current().get(t.id);
2560
+ const e = s(this, Qt).current().get(t.id);
2561
2561
  e || s(this, Te).debug("No subscription found", t), e == null || e.onUpdate(t);
2562
2562
  }
2563
2563
  break;
2564
2564
  case y.Unsubscribe:
2565
2565
  {
2566
- const e = s(this, Jt).current().get(t.id);
2566
+ const e = s(this, Qt).current().get(t.id);
2567
2567
  e || s(this, Te).debug("No subscription found", t), e == null || e.onUnsubscribe(t);
2568
2568
  }
2569
2569
  break;
2570
2570
  case y.AnnounceOk:
2571
2571
  {
2572
- const e = s(this, Kt).current().get(t.namespace.join("/"));
2572
+ const e = s(this, Jt).current().get(t.namespace.join("/"));
2573
2573
  e || s(this, Te).debug("No announcement found", t), e == null || e.state.onOk(t);
2574
2574
  }
2575
2575
  break;
2576
2576
  case y.AnnounceError:
2577
2577
  {
2578
- const e = s(this, Kt).current().get(t.namespace.join("/"));
2578
+ const e = s(this, Jt).current().get(t.namespace.join("/"));
2579
2579
  e || s(this, Te).debug("No announcement found", t), e == null || e.state.onError(t);
2580
2580
  }
2581
2581
  break;
@@ -2583,15 +2583,15 @@ class ya {
2583
2583
  });
2584
2584
  }
2585
2585
  }
2586
- oa = ue(null), As = new WeakMap(), or = new WeakMap(), Ds = new WeakMap(), Te = new WeakMap(), Kt = new WeakMap(), Jt = new WeakMap(), Qt = new WeakMap(), H(oa, 1, "announce", no, ya), zt(oa, ya);
2586
+ oa = ue(null), Ds = new WeakMap(), cr = new WeakMap(), Os = new WeakMap(), Te = new WeakMap(), Jt = new WeakMap(), Qt = new WeakMap(), qt = new WeakMap(), H(oa, 1, "announce", no, ya), Ht(oa, ya);
2587
2587
  function Pu(r, t) {
2588
- const e = new vn(t), [i, n] = xa(100), a = new Ru(e, i), c = new nc(r, e, n);
2588
+ const e = new Sn(t), [i, n] = xa(100), a = new Ru(e, i), c = new nc(r, e, n);
2589
2589
  return [a, c];
2590
2590
  }
2591
2591
  var Ae;
2592
2592
  class Ru {
2593
2593
  constructor(t, e) {
2594
- l(this, "state");
2594
+ d(this, "state");
2595
2595
  o(this, Ae);
2596
2596
  this.state = t, u(this, Ae, e);
2597
2597
  }
@@ -2613,31 +2613,31 @@ class Ru {
2613
2613
  }
2614
2614
  }
2615
2615
  Ae = new WeakMap();
2616
- var ao, Os, G, Vs, Cs, ca, Bs, ci;
2616
+ var ao, Vs, N, Cs, Bs, ca, xs, ui;
2617
2617
  class nc {
2618
2618
  constructor(t, e, i) {
2619
2619
  he(ca, 5, this);
2620
- o(this, Bs);
2621
- o(this, Os);
2622
- o(this, G);
2620
+ o(this, xs);
2623
2621
  o(this, Vs);
2624
- o(this, Cs, new V());
2625
- u(this, Os, t), u(this, G, e), u(this, Vs, i);
2622
+ o(this, N);
2623
+ o(this, Cs);
2624
+ o(this, Bs, new V());
2625
+ u(this, Vs, t), u(this, N, e), u(this, Cs, i);
2626
2626
  }
2627
2627
  get id() {
2628
- return s(this, G).subscribe.id;
2628
+ return s(this, N).subscribe.id;
2629
2629
  }
2630
2630
  get trackAlias() {
2631
- return s(this, G).subscribe.trackAlias;
2631
+ return s(this, N).subscribe.trackAlias;
2632
2632
  }
2633
2633
  get name() {
2634
- return s(this, G).subscribe.name;
2634
+ return s(this, N).subscribe.name;
2635
2635
  }
2636
2636
  range() {
2637
- return s(this, G).range();
2637
+ return s(this, N).range();
2638
2638
  }
2639
2639
  expiryNotification() {
2640
- return s(this, G).expiryNotification();
2640
+ return s(this, N).expiryNotification();
2641
2641
  }
2642
2642
  /**
2643
2643
  * Update the subscription range
@@ -2648,60 +2648,60 @@ class nc {
2648
2648
  return h(this, null, function* () {
2649
2649
  const i = {
2650
2650
  type: y.SubscribeUpdate,
2651
- id: s(this, G).subscribe.id,
2651
+ id: s(this, N).subscribe.id,
2652
2652
  start: { group: t, object: k(0) },
2653
2653
  end: { group: e + k(1), object: k(0) },
2654
2654
  params: /* @__PURE__ */ new Map(),
2655
2655
  subscriberPriority: 0
2656
2656
  };
2657
- s(this, G).onUpdate(i), yield s(this, Os).push(i);
2657
+ s(this, N).onUpdate(i), yield s(this, Vs).push(i);
2658
2658
  });
2659
2659
  }
2660
2660
  unsubscribe() {
2661
2661
  return h(this, null, function* () {
2662
- const t = { type: y.Unsubscribe, id: s(this, G).subscribe.id };
2663
- s(this, G).onUnsubscribe(t), yield s(this, Os).push(t);
2662
+ const t = { type: y.Unsubscribe, id: s(this, N).subscribe.id };
2663
+ s(this, N).onUnsubscribe(t), yield s(this, Vs).push(t);
2664
2664
  });
2665
2665
  }
2666
2666
  /// Closes the object reader so any pending readData calls are resolved
2667
2667
  close() {
2668
2668
  var t, e;
2669
- return s(this, Cs).resolve(), (e = (t = s(this, Vs)).return) == null ? void 0 : e.call(t);
2669
+ return s(this, Bs).resolve(), (e = (t = s(this, Cs)).return) == null ? void 0 : e.call(t);
2670
2670
  }
2671
2671
  /// Closed is resolved when the subscription has been fully consumed which means no more objects will be available
2672
2672
  closed() {
2673
- return s(this, Cs).promise;
2673
+ return s(this, Bs).promise;
2674
2674
  }
2675
2675
  /// Await this subscription to become done
2676
2676
  /// Done does not mean that the subscription is closed,
2677
2677
  /// it means that the server has confirmed our unsubscribe request
2678
2678
  done() {
2679
- return s(this, G).done();
2679
+ return s(this, N).done();
2680
2680
  }
2681
2681
  expiryState() {
2682
- return s(this, G).expiryState();
2682
+ return s(this, N).expiryState();
2683
2683
  }
2684
2684
  unsubscribed() {
2685
- return s(this, G).isUnsubscribed();
2685
+ return s(this, N).isUnsubscribed();
2686
2686
  }
2687
2687
  return() {
2688
2688
  return h(this, null, function* () {
2689
- return s(this, Cs).resolve(), yield this.unsubscribe(), { done: !0, value: void 0 };
2689
+ return s(this, Bs).resolve(), yield this.unsubscribe(), { done: !0, value: void 0 };
2690
2690
  });
2691
2691
  }
2692
2692
  groups() {
2693
- return xt(this, null, function* () {
2693
+ return Pt(this, null, function* () {
2694
2694
  var t, e;
2695
2695
  try {
2696
- for (var g = C(s(this, Vs)), E, z, _; E = !(z = yield new O(g.next())).done; E = !1) {
2697
- var d = z.value;
2696
+ for (var g = C(s(this, Cs)), E, z, _; E = !(z = yield new O(g.next())).done; E = !1) {
2697
+ var l = z.value;
2698
2698
  var w = [];
2699
2699
  try {
2700
- const D = nt(w, d, !0);
2700
+ const D = nt(w, l, !0);
2701
2701
  try {
2702
2702
  for (var i = C(D.groups()), n, a, c; n = !(a = yield new O(i.next())).done; n = !1) {
2703
2703
  const S = a.value;
2704
- const W = (t = s(this, G).range()) == null ? void 0 : t.startGroup, v = (e = s(this, G).range()) == null ? void 0 : e.endGroup;
2704
+ const W = (t = s(this, N).range()) == null ? void 0 : t.startGroup, v = (e = s(this, N).range()) == null ? void 0 : e.endGroup;
2705
2705
  if (W && S.groupId() < W)
2706
2706
  return { done: !0, value: void 0 };
2707
2707
  if (v && S.groupId() > v)
@@ -2744,10 +2744,10 @@ class nc {
2744
2744
  * @returns the next object from the subscription
2745
2745
  */
2746
2746
  objects() {
2747
- return xt(this, null, function* () {
2747
+ return Pt(this, null, function* () {
2748
2748
  try {
2749
- for (var a = C(this.groups()), c, d, w; c = !(d = yield new O(a.next())).done; c = !1) {
2750
- const p = d.value;
2749
+ for (var a = C(this.groups()), c, l, w; c = !(l = yield new O(a.next())).done; c = !1) {
2750
+ const p = l.value;
2751
2751
  try {
2752
2752
  for (var t = C(p), e, i, n; e = !(i = yield new O(t.next())).done; e = !1) {
2753
2753
  const m = i.value;
@@ -2764,11 +2764,11 @@ class nc {
2764
2764
  }
2765
2765
  }
2766
2766
  }
2767
- } catch (d) {
2768
- w = [d];
2767
+ } catch (l) {
2768
+ w = [l];
2769
2769
  } finally {
2770
2770
  try {
2771
- c && (d = a.return) && (yield new O(d.call(a)));
2771
+ c && (l = a.return) && (yield new O(l.call(a)));
2772
2772
  } finally {
2773
2773
  if (w)
2774
2774
  throw w[0];
@@ -2776,39 +2776,39 @@ class nc {
2776
2776
  }
2777
2777
  });
2778
2778
  }
2779
- [(ao = [q({ context: "SubscriptionConsumer", enter: "info" })], Ct())]() {
2780
- return f(this, Bs, ci).call(this);
2779
+ [(ao = [q({ context: "SubscriptionConsumer", enter: "info" })], Bt())]() {
2780
+ return f(this, xs, ui).call(this);
2781
2781
  }
2782
2782
  [Symbol.asyncDispose]() {
2783
- return f(this, Bs, ci).call(this);
2783
+ return f(this, xs, ui).call(this);
2784
2784
  }
2785
2785
  }
2786
- ca = ue(null), Os = new WeakMap(), G = new WeakMap(), Vs = new WeakMap(), Cs = new WeakMap(), Bs = new WeakSet(), ci = function() {
2786
+ ca = ue(null), Vs = new WeakMap(), N = new WeakMap(), Cs = new WeakMap(), Bs = new WeakMap(), xs = new WeakSet(), ui = function() {
2787
2787
  return h(this, null, function* () {
2788
2788
  return yield this.close(), this.unsubscribe();
2789
2789
  });
2790
- }, ci = H(ca, 17, "#dispose", ao, Bs, ci), zt(ca, nc);
2790
+ }, ui = H(ca, 17, "#dispose", ao, xs, ui), Ht(ca, nc);
2791
2791
  const ju = 2e3;
2792
- var oo, co, uo, ho, Nt, st, De, Oe, Ke, Vt, Zr, qe;
2792
+ var oo, co, uo, ho, Nt, st, De, Oe, Ke, Ct, Kr, qe;
2793
2793
  ho = [q({ context: "Session", return: "debug" })], uo = [q({ context: "Session", enter: "info", error: "error" })], co = [q({ context: "Session", enter: "debug" })], oo = [q({ context: "Session", enter: "debug" })];
2794
- class Yr {
2794
+ class Zr {
2795
2795
  constructor(t, e) {
2796
2796
  he(Ke, 5, this);
2797
- o(this, Vt);
2797
+ o(this, Ct);
2798
2798
  // The owner session of the subscriber
2799
2799
  o(this, Nt);
2800
2800
  // The next subscribe id
2801
- l(this, "nextSubscribeId", k(0));
2801
+ d(this, "nextSubscribeId", k(0));
2802
2802
  // The active subscriptions
2803
2803
  o(this, st, new Y(/* @__PURE__ */ new Map()));
2804
2804
  o(this, De);
2805
2805
  o(this, Oe, rt.get().createContext("Subscriber"));
2806
- u(this, Nt, t), u(this, De, e), f(this, Vt, Zr).call(this).catch(A);
2806
+ u(this, Nt, t), u(this, De, e), f(this, Ct, Kr).call(this).catch(A);
2807
2807
  }
2808
2808
  subscribe(t, e) {
2809
2809
  return h(this, null, function* () {
2810
2810
  const i = this.nextSubscribeId++, n = /* @__PURE__ */ new Map(), a = s(this, Nt).authToken();
2811
- a && n.set(gn, { type: gn, payload: new TextEncoder().encode(a) });
2811
+ a && n.set(kn, { type: kn, payload: new TextEncoder().encode(a) });
2812
2812
  const c = {
2813
2813
  type: y.Subscribe,
2814
2814
  namespace: t,
@@ -2819,10 +2819,10 @@ class Yr {
2819
2819
  subscriberPriority: e.priority,
2820
2820
  filterType: e.filterType,
2821
2821
  params: n
2822
- }, [d, w] = Pu(s(this, De), c);
2823
- if (s(this, st).update((m) => m.set(i, d)), yield s(this, De).push(c), !(yield Promise.race([d.state.ok(), s(this, Nt).closed()])))
2822
+ }, [l, w] = Pu(s(this, De), c);
2823
+ if (s(this, st).update((m) => m.set(i, l)), yield s(this, De).push(c), !(yield Promise.race([l.state.ok(), s(this, Nt).closed()])))
2824
2824
  throw new Error("Session closed");
2825
- return w.closed().then(() => Promise.race([Kn(ju), this.closed()])).then(() => f(this, Vt, qe).call(this, w.id)).catch(() => f(this, Vt, qe).call(this, w.id)), w;
2825
+ return w.closed().then(() => Promise.race([Kn(ju), this.closed()])).then(() => f(this, Ct, qe).call(this, w.id)).catch(() => f(this, Ct, qe).call(this, w.id)), w;
2826
2826
  });
2827
2827
  }
2828
2828
  closed() {
@@ -2852,7 +2852,7 @@ class Yr {
2852
2852
  case y.SubscribeError:
2853
2853
  {
2854
2854
  const e = s(this, st).current().get(t.id);
2855
- e || s(this, Oe).debug("No subscription found", t), e == null || e.onError(t), f(this, Vt, qe).call(this, t.id);
2855
+ e || s(this, Oe).debug("No subscription found", t), e == null || e.onError(t), f(this, Ct, qe).call(this, t.id);
2856
2856
  }
2857
2857
  break;
2858
2858
  case y.SubscribeDone:
@@ -2878,12 +2878,12 @@ class Yr {
2878
2878
  s(this, st).current().forEach((t) => t.close()), s(this, st).close();
2879
2879
  }
2880
2880
  }
2881
- Ke = ue(null), Nt = new WeakMap(), st = new WeakMap(), De = new WeakMap(), Oe = new WeakMap(), Vt = new WeakSet(), Zr = function() {
2881
+ Ke = ue(null), Nt = new WeakMap(), st = new WeakMap(), De = new WeakMap(), Oe = new WeakMap(), Ct = new WeakSet(), Kr = function() {
2882
2882
  return h(this, null, function* () {
2883
2883
  try {
2884
2884
  for (var t = C(s(this, st)), e, i, n; e = !(i = yield t.next()).done; e = !1) {
2885
2885
  const a = i.value;
2886
- const c = [...a.values()].map((d) => d.state.subscribe);
2886
+ const c = [...a.values()].map((l) => l.state.subscribe);
2887
2887
  s(this, Oe).debug("current subscriptions", c);
2888
2888
  }
2889
2889
  } catch (i) {
@@ -2899,30 +2899,30 @@ Ke = ue(null), Nt = new WeakMap(), st = new WeakMap(), De = new WeakMap(), Oe =
2899
2899
  });
2900
2900
  }, qe = function(t) {
2901
2901
  s(this, st).isClosed() || s(this, st).update((e) => (e.delete(t), e));
2902
- }, Zr = H(Ke, 17, "#observeChanges", ho, Vt, Zr), H(Ke, 1, "subscribe", uo, Yr), H(Ke, 1, "close", co, Yr), qe = H(Ke, 17, "#deleteSubscription", oo, Vt, qe), zt(Ke, Yr);
2903
- var lo, wo, fo, po, bt, cr, Ve, xs, Ps, N, ac, oc, Je, Kr, Jr, Qr, ui;
2902
+ }, Kr = H(Ke, 17, "#observeChanges", ho, Ct, Kr), H(Ke, 1, "subscribe", uo, Zr), H(Ke, 1, "close", co, Zr), qe = H(Ke, 17, "#deleteSubscription", oo, Ct, qe), Ht(Ke, Zr);
2903
+ var lo, wo, fo, po, bt, ur, Ve, Ps, Rs, G, ac, oc, Je, Jr, Qr, qr, hi;
2904
2904
  class Ra {
2905
2905
  constructor(t, e) {
2906
2906
  he(Je, 5, this);
2907
- o(this, N);
2907
+ o(this, G);
2908
2908
  // The underlying transport implementation
2909
2909
  o(this, bt);
2910
2910
  // The background "thread" running the background tasks
2911
- o(this, cr);
2911
+ o(this, ur);
2912
2912
  // Outgoing messages
2913
2913
  o(this, Ve);
2914
- o(this, xs, rt.get().createContext("Session"));
2915
- l(this, "subscriber");
2916
- l(this, "publisher");
2917
- o(this, Ps);
2914
+ o(this, Ps, rt.get().createContext("Session"));
2915
+ d(this, "subscriber");
2916
+ d(this, "publisher");
2917
+ o(this, Rs);
2918
2918
  const [i, n] = xa(100);
2919
- u(this, bt, t), u(this, Ve, n), this.subscriber = new Yr(this, i), this.publisher = new ya(this, t, i), u(this, cr, f(this, N, oc).call(this)), u(this, Ps, new Y(e)), this.closed().then(() => this.close()).catch(A);
2919
+ u(this, bt, t), u(this, Ve, n), this.subscriber = new Zr(this, i), this.publisher = new ya(this, t, i), u(this, ur, f(this, G, oc).call(this)), u(this, Rs, new Y(e)), this.closed().then(() => this.close()).catch(A);
2920
2920
  }
2921
2921
  updateAuthToken(t) {
2922
- s(this, Ps).update(t);
2922
+ s(this, Rs).update(t);
2923
2923
  }
2924
2924
  authToken() {
2925
- return s(this, Ps).current();
2925
+ return s(this, Rs).current();
2926
2926
  }
2927
2927
  transportType() {
2928
2928
  return s(this, bt).transportType();
@@ -2931,41 +2931,41 @@ class Ra {
2931
2931
  return s(this, bt).url();
2932
2932
  }
2933
2933
  closed() {
2934
- return s(this, cr);
2934
+ return s(this, ur);
2935
2935
  }
2936
2936
  close() {
2937
2937
  try {
2938
2938
  this.subscriber.close(), this.publisher.close(), s(this, Ve).cancel("closing"), s(this, bt).close();
2939
2939
  } catch (t) {
2940
- s(this, xs).warn("Error closing session", t);
2940
+ s(this, Ps).warn("Error closing session", t);
2941
2941
  }
2942
2942
  }
2943
2943
  [(po = [q({ context: "Session", return: "info", error: "error" })], fo = [q({ context: "Session", return: "info", error: "error" })], wo = [q({ context: "Session", return: "info", error: "error" })], lo = [q({ context: "Session", enter: "debug" })], So())]() {
2944
- f(this, N, ui).call(this);
2944
+ f(this, G, hi).call(this);
2945
2945
  }
2946
2946
  [Symbol.dispose]() {
2947
- f(this, N, ui).call(this);
2947
+ f(this, G, hi).call(this);
2948
2948
  }
2949
2949
  }
2950
- Je = ue(null), bt = new WeakMap(), cr = new WeakMap(), Ve = new WeakMap(), xs = new WeakMap(), Ps = new WeakMap(), N = new WeakSet(), ac = function(t) {
2950
+ Je = ue(null), bt = new WeakMap(), ur = new WeakMap(), Ve = new WeakMap(), Ps = new WeakMap(), Rs = new WeakMap(), G = new WeakSet(), ac = function(t) {
2951
2951
  return h(this, null, function* () {
2952
2952
  var e, i;
2953
- switch (s(this, xs).debug("received message", t), yield (e = this.subscriber) == null ? void 0 : e.onMessage(t), yield (i = this.publisher) == null ? void 0 : i.onMessage(t), t.type) {
2953
+ switch (s(this, Ps).debug("received message", t), yield (e = this.subscriber) == null ? void 0 : e.onMessage(t), yield (i = this.publisher) == null ? void 0 : i.onMessage(t), t.type) {
2954
2954
  case y.Goaway:
2955
2955
  break;
2956
2956
  }
2957
2957
  });
2958
2958
  }, oc = function() {
2959
2959
  return h(this, null, function* () {
2960
- return (yield Promise.all([f(this, N, Jr).call(this), f(this, N, Qr).call(this), f(this, N, Kr).call(this)])).find((e) => e instanceof Error);
2960
+ return (yield Promise.all([f(this, G, Qr).call(this), f(this, G, qr).call(this), f(this, G, Jr).call(this)])).find((e) => e instanceof Error);
2961
2961
  });
2962
- }, Kr = function() {
2962
+ }, Jr = function() {
2963
2963
  return h(this, null, function* () {
2964
2964
  try {
2965
2965
  try {
2966
2966
  for (var t = C(s(this, Ve)), e, i, n; e = !(i = yield t.next()).done; e = !1) {
2967
2967
  const a = i.value;
2968
- s(this, xs).debug("sending message", a), yield s(this, bt).writeMessage(a);
2968
+ s(this, Ps).debug("sending message", a), yield s(this, bt).writeMessage(a);
2969
2969
  }
2970
2970
  } catch (i) {
2971
2971
  n = [i];
@@ -2981,7 +2981,7 @@ Je = ue(null), bt = new WeakMap(), cr = new WeakMap(), Ve = new WeakMap(), xs =
2981
2981
  return a;
2982
2982
  }
2983
2983
  });
2984
- }, Jr = function() {
2984
+ }, Qr = function() {
2985
2985
  return h(this, null, function* () {
2986
2986
  yield s(this, bt).afterHandshake();
2987
2987
  try {
@@ -2990,7 +2990,7 @@ Je = ue(null), bt = new WeakMap(), cr = new WeakMap(), Ve = new WeakMap(), xs =
2990
2990
  });
2991
2991
  if (!t)
2992
2992
  break;
2993
- yield f(this, N, ac).call(this, t);
2993
+ yield f(this, G, ac).call(this, t);
2994
2994
  }
2995
2995
  } catch (t) {
2996
2996
  return t;
@@ -2998,7 +2998,7 @@ Je = ue(null), bt = new WeakMap(), cr = new WeakMap(), Ve = new WeakMap(), xs =
2998
2998
  s(this, Ve).cancel("closing");
2999
2999
  }
3000
3000
  });
3001
- }, Qr = function() {
3001
+ }, qr = function() {
3002
3002
  return h(this, null, function* () {
3003
3003
  var t;
3004
3004
  try {
@@ -3012,20 +3012,20 @@ Je = ue(null), bt = new WeakMap(), cr = new WeakMap(), Ve = new WeakMap(), xs =
3012
3012
  return e;
3013
3013
  }
3014
3014
  });
3015
- }, ui = function() {
3015
+ }, hi = function() {
3016
3016
  this.close();
3017
- }, Kr = H(Je, 17, "#runOutgoingMessages", po, N, Kr), Jr = H(Je, 17, "#runControl", fo, N, Jr), Qr = H(Je, 17, "#runObjects", wo, N, Qr), ui = H(Je, 17, "#dispose", lo, N, ui), zt(Je, Ra);
3018
- const Nu = 128;
3019
- var ut, ur, Ce, Rs, hr, M, we, fe;
3020
- class Gu {
3017
+ }, Jr = H(Je, 17, "#runOutgoingMessages", po, G, Jr), Qr = H(Je, 17, "#runControl", fo, G, Qr), qr = H(Je, 17, "#runObjects", wo, G, qr), hi = H(Je, 17, "#dispose", lo, G, hi), Ht(Je, Ra);
3018
+ const Gu = 128;
3019
+ var ut, hr, Ce, js, dr, M, we, fe;
3020
+ class Nu {
3021
3021
  constructor(t, e, i) {
3022
3022
  o(this, M);
3023
3023
  o(this, ut);
3024
- o(this, ur);
3025
- o(this, Ce, !0);
3026
- o(this, Rs, !1);
3027
3024
  o(this, hr);
3028
- u(this, ut, t), u(this, ur, e), u(this, hr, i);
3025
+ o(this, Ce, !0);
3026
+ o(this, js, !1);
3027
+ o(this, dr);
3028
+ u(this, ut, t), u(this, hr, e), u(this, dr, i);
3029
3029
  }
3030
3030
  writeUnsigned8(t) {
3031
3031
  return h(this, null, function* () {
@@ -3059,68 +3059,68 @@ class Gu {
3059
3059
  }
3060
3060
  close() {
3061
3061
  return h(this, null, function* () {
3062
- s(this, Rs) || (u(this, Ce, !0), yield f(this, M, fe).call(this, !1), yield s(this, ut).flush(), u(this, Rs, !0), s(this, hr).call(this));
3062
+ s(this, js) || (u(this, Ce, !0), yield f(this, M, fe).call(this, !1), yield s(this, ut).flush(), u(this, js, !0), s(this, dr).call(this));
3063
3063
  });
3064
3064
  }
3065
3065
  }
3066
- ut = new WeakMap(), ur = new WeakMap(), Ce = new WeakMap(), Rs = new WeakMap(), hr = new WeakMap(), M = new WeakSet(), we = function() {
3067
- if (s(this, Rs))
3066
+ ut = new WeakMap(), hr = new WeakMap(), Ce = new WeakMap(), js = new WeakMap(), dr = new WeakMap(), M = new WeakSet(), we = function() {
3067
+ if (s(this, js))
3068
3068
  throw new Error("Stream is closed");
3069
3069
  }, fe = function(t = !0) {
3070
3070
  if (s(this, Ce))
3071
- return u(this, Ce, !1), s(this, ut).writeUnsigned8(s(this, ur) | (t ? Nu : 0));
3071
+ return u(this, Ce, !1), s(this, ut).writeUnsigned8(s(this, hr) | (t ? Gu : 0));
3072
3072
  };
3073
- var qt, _t, js, Be, Gt, Ns, Gs, Pn, cc;
3073
+ var _t, te, Gs, Be, Lt, Ns, Ls, Pn, cc;
3074
3074
  class Lu {
3075
3075
  constructor(t, e) {
3076
3076
  o(this, Pn);
3077
- o(this, qt);
3078
3077
  o(this, _t);
3079
- o(this, js);
3078
+ o(this, te);
3079
+ o(this, Gs);
3080
3080
  o(this, Be);
3081
- o(this, Gt, /* @__PURE__ */ new Map());
3081
+ o(this, Lt, /* @__PURE__ */ new Map());
3082
3082
  o(this, Ns, rt.get().createContext("WebSocketConnection"));
3083
- o(this, Gs, new Set(new Array(128).fill(0).map((t, e) => e + 1)));
3084
- u(this, qt, t), u(this, _t, e), u(this, js, new ReadableStream(new Qc(t))), s(this, qt).addEventListener("close", () => {
3085
- s(this, Gt).forEach((i) => i.close());
3083
+ o(this, Ls, new Set(new Array(128).fill(0).map((t, e) => e + 1)));
3084
+ u(this, _t, t), u(this, te, e), u(this, Gs, new ReadableStream(new Qc(t))), s(this, _t).addEventListener("close", () => {
3085
+ s(this, Lt).forEach((i) => i.close());
3086
3086
  });
3087
3087
  }
3088
3088
  openSendStream() {
3089
- const t = s(this, Gs).values().next().value;
3089
+ const t = s(this, Ls).values().next().value;
3090
3090
  if (!t)
3091
3091
  throw new Error("No stream IDs available");
3092
- return s(this, Gs).delete(t), Promise.resolve(
3093
- new Gu(new Vi(s(this, qt)), t, () => f(this, Pn, cc).call(this, t))
3092
+ return s(this, Ls).delete(t), Promise.resolve(
3093
+ new Nu(new Ci(s(this, _t)), t, () => f(this, Pn, cc).call(this, t))
3094
3094
  );
3095
3095
  }
3096
3096
  transportType() {
3097
3097
  return "websocket";
3098
3098
  }
3099
3099
  url() {
3100
- return s(this, qt).url;
3100
+ return s(this, _t).url;
3101
3101
  }
3102
3102
  afterHandshake() {
3103
- return s(this, _t).postHandshake();
3103
+ return s(this, te).postHandshake();
3104
3104
  }
3105
3105
  objectStream() {
3106
3106
  return h(this, null, function* () {
3107
3107
  var t;
3108
3108
  for (; ; ) {
3109
- u(this, Be, s(this, js).getReader());
3109
+ u(this, Be, s(this, Gs).getReader());
3110
3110
  try {
3111
3111
  const { value: e, done: i } = yield s(this, Be).read();
3112
3112
  if (i)
3113
3113
  return;
3114
3114
  const [n, a, c] = e;
3115
- if (s(this, Gt).has(k(a))) {
3116
- const d = s(this, Gt).get(k(a));
3117
- if (!d)
3115
+ if (s(this, Lt).has(k(a))) {
3116
+ const l = s(this, Lt).get(k(a));
3117
+ if (!l)
3118
3118
  throw new Error("Stream not found");
3119
- c.length > 0 && (yield d.push(c)), n || (s(this, Ns).debug("Closing stream", { streamId: a }), d.close(), s(this, Gt).delete(k(a)));
3119
+ c.length > 0 && (yield l.push(c)), n || (s(this, Ns).debug("Closing stream", { streamId: a }), l.close(), s(this, Lt).delete(k(a)));
3120
3120
  } else {
3121
3121
  let m;
3122
3122
  s(this, Ns).debug("Creating new stream", { streamId: a });
3123
- const [d, w] = xa(1e3), p = new ReadableStream({
3123
+ const [l, w] = xa(1e3), p = new ReadableStream({
3124
3124
  pull(b) {
3125
3125
  return h(this, null, function* () {
3126
3126
  const I = yield w.pop();
@@ -3128,8 +3128,8 @@ class Lu {
3128
3128
  });
3129
3129
  }
3130
3130
  });
3131
- if (s(this, Gt).set(k(a), d), n || (s(this, Ns).debug("Closing new stream", { streamId: a }), yield p.cancel(), s(this, Gt).delete(k(a))), c.length > 0)
3132
- return yield Oo(new yn(c, p), a);
3131
+ if (s(this, Lt).set(k(a), l), n || (s(this, Ns).debug("Closing new stream", { streamId: a }), yield p.cancel(), s(this, Lt).delete(k(a))), c.length > 0)
3132
+ return yield Oo(new gn(c, p), a);
3133
3133
  }
3134
3134
  } finally {
3135
3135
  (t = s(this, Be)) == null || t.releaseLock();
@@ -3139,46 +3139,46 @@ class Lu {
3139
3139
  }
3140
3140
  close() {
3141
3141
  var t;
3142
- return s(this, _t).cancel().catch(A), s(this, js).cancel("closing").catch(A), (t = s(this, Be)) == null || t.cancel("closing").catch(A), s(this, qt).close();
3142
+ return s(this, te).cancel().catch(A), s(this, Gs).cancel("closing").catch(A), (t = s(this, Be)) == null || t.cancel("closing").catch(A), s(this, _t).close();
3143
3143
  }
3144
3144
  closed() {
3145
3145
  return Promise.resolve();
3146
3146
  }
3147
3147
  writeMessage(t) {
3148
3148
  return h(this, null, function* () {
3149
- yield s(this, _t).write(t);
3149
+ yield s(this, te).write(t);
3150
3150
  });
3151
3151
  }
3152
3152
  readMessage() {
3153
3153
  return h(this, null, function* () {
3154
- return s(this, _t).read();
3154
+ return s(this, te).read();
3155
3155
  });
3156
3156
  }
3157
3157
  }
3158
- qt = new WeakMap(), _t = new WeakMap(), js = new WeakMap(), Be = new WeakMap(), Gt = new WeakMap(), Ns = new WeakMap(), Gs = new WeakMap(), Pn = new WeakSet(), /**
3158
+ _t = new WeakMap(), te = new WeakMap(), Gs = new WeakMap(), Be = new WeakMap(), Lt = new WeakMap(), Ns = new WeakMap(), Ls = new WeakMap(), Pn = new WeakSet(), /**
3159
3159
  * Return a stream ID to the pool of available stream IDs
3160
3160
  * @param streamId - The stream ID to return
3161
3161
  */
3162
3162
  cc = function(t) {
3163
- s(this, Gs).add(t);
3163
+ s(this, Ls).add(t);
3164
3164
  };
3165
- var te, xe, Pe, dr, lr, Rn, jn, uc;
3165
+ var ee, xe, Pe, lr, wr, Rn, jn, uc;
3166
3166
  class Fu {
3167
3167
  constructor(t, e, i) {
3168
3168
  o(this, jn);
3169
- o(this, te);
3169
+ o(this, ee);
3170
3170
  o(this, xe);
3171
3171
  o(this, Pe, new Jn(100));
3172
- o(this, dr);
3173
- o(this, lr, 0);
3172
+ o(this, lr);
3173
+ o(this, wr, 0);
3174
3174
  o(this, Rn, rt.get().createContext("WebTransportConnection"));
3175
- u(this, dr, i), u(this, te, t), u(this, xe, e), f(this, jn, uc).call(this).catch((n) => {
3175
+ u(this, lr, i), u(this, ee, t), u(this, xe, e), f(this, jn, uc).call(this).catch((n) => {
3176
3176
  s(this, Rn).debug("Incoming streams handling ended with error", n), s(this, Pe).close();
3177
3177
  });
3178
3178
  }
3179
3179
  openSendStream() {
3180
3180
  return h(this, null, function* () {
3181
- const t = yield s(this, te).createUnidirectionalStream();
3181
+ const t = yield s(this, ee).createUnidirectionalStream();
3182
3182
  return new Vo(t);
3183
3183
  });
3184
3184
  }
@@ -3186,18 +3186,18 @@ class Fu {
3186
3186
  return "webtransport";
3187
3187
  }
3188
3188
  url() {
3189
- return s(this, dr);
3189
+ return s(this, lr);
3190
3190
  }
3191
3191
  afterHandshake() {
3192
3192
  return s(this, xe).postHandshake();
3193
3193
  }
3194
3194
  closed() {
3195
3195
  return h(this, null, function* () {
3196
- yield s(this, te).closed;
3196
+ yield s(this, ee).closed;
3197
3197
  });
3198
3198
  }
3199
3199
  close() {
3200
- s(this, te).close();
3200
+ s(this, ee).close();
3201
3201
  }
3202
3202
  writeMessage(t) {
3203
3203
  return h(this, null, function* () {
@@ -3215,17 +3215,17 @@ class Fu {
3215
3215
  });
3216
3216
  }
3217
3217
  }
3218
- te = new WeakMap(), xe = new WeakMap(), Pe = new WeakMap(), dr = new WeakMap(), lr = new WeakMap(), Rn = new WeakMap(), jn = new WeakSet(), uc = function() {
3218
+ ee = new WeakMap(), xe = new WeakMap(), Pe = new WeakMap(), lr = new WeakMap(), wr = new WeakMap(), Rn = new WeakMap(), jn = new WeakSet(), uc = function() {
3219
3219
  return h(this, null, function* () {
3220
- const t = s(this, te).incomingUnidirectionalStreams.getReader();
3220
+ const t = s(this, ee).incomingUnidirectionalStreams.getReader();
3221
3221
  for (; ; ) {
3222
3222
  const { value: e, done: i } = yield t.read();
3223
3223
  if (i) {
3224
3224
  s(this, Pe).close();
3225
3225
  return;
3226
3226
  }
3227
- const n = new yn(new Uint8Array(), e);
3228
- yield s(this, Pe).push(Oo(n, s(this, lr))), ea(this, lr)._++;
3227
+ const n = new gn(new Uint8Array(), e);
3228
+ yield s(this, Pe).push(Oo(n, s(this, wr))), ea(this, wr)._++;
3229
3229
  }
3230
3230
  });
3231
3231
  };
@@ -3235,7 +3235,7 @@ function ia(r) {
3235
3235
  t.binaryType = "arraybuffer", yield new Promise((a, c) => {
3236
3236
  t.addEventListener("error", c, { once: !0 }), t.addEventListener("open", a, { once: !0 });
3237
3237
  });
3238
- const e = In.wrapWebsocket(t);
3238
+ const e = vn.wrapWebsocket(t);
3239
3239
  ic(e, r.role).catch(() => {
3240
3240
  t.close();
3241
3241
  });
@@ -3253,7 +3253,7 @@ function to(r) {
3253
3253
  // serverCertificateHashes: [{ algorithm: "sha-256", value: hexBytes }],
3254
3254
  });
3255
3255
  yield Promise.race([i.ready, i.closed.then(() => Promise.reject(new Error("WebTransport closed")))]);
3256
- const n = yield i.createBidirectionalStream(), a = In.wrapWebTransport(n);
3256
+ const n = yield i.createBidirectionalStream(), a = vn.wrapWebTransport(n);
3257
3257
  ic(a, r.role).catch(() => {
3258
3258
  i.close();
3259
3259
  });
@@ -3272,10 +3272,10 @@ function Wu(r) {
3272
3272
  return ia(r);
3273
3273
  });
3274
3274
  }
3275
- var Lt;
3276
- class $t {
3275
+ var Ft;
3276
+ class Mt {
3277
3277
  constructor() {
3278
- o(this, Lt, {
3278
+ o(this, Ft, {
3279
3279
  name: "",
3280
3280
  priority: 0,
3281
3281
  groupOrder: "descending",
@@ -3283,54 +3283,54 @@ class $t {
3283
3283
  });
3284
3284
  }
3285
3285
  name(t) {
3286
- return s(this, Lt).name = t, this;
3286
+ return s(this, Ft).name = t, this;
3287
3287
  }
3288
3288
  priority(t) {
3289
- return s(this, Lt).priority = t, this;
3289
+ return s(this, Ft).priority = t, this;
3290
3290
  }
3291
3291
  groupOrder(t) {
3292
- return s(this, Lt).groupOrder = t, this;
3292
+ return s(this, Ft).groupOrder = t, this;
3293
3293
  }
3294
3294
  /**
3295
3295
  * @param startGroup the group to start the subscription at
3296
3296
  * @returns the builder
3297
3297
  */
3298
3298
  startGroup(t) {
3299
- return s(this, Lt).filterType = {
3299
+ return s(this, Ft).filterType = {
3300
3300
  type: "absolute-start",
3301
3301
  start: { group: t, object: k(0) }
3302
3302
  }, this;
3303
3303
  }
3304
3304
  range(t, e) {
3305
- return s(this, Lt).filterType = {
3305
+ return s(this, Ft).filterType = {
3306
3306
  type: "absolute-range",
3307
3307
  start: { group: t, object: k(0) },
3308
3308
  end: { group: e, object: k(0) }
3309
3309
  }, this;
3310
3310
  }
3311
3311
  build() {
3312
- return s(this, Lt);
3312
+ return s(this, Ft);
3313
3313
  }
3314
3314
  }
3315
- Lt = new WeakMap();
3316
- var Ls, wr;
3315
+ Ft = new WeakMap();
3316
+ var Fs, fr;
3317
3317
  class hc {
3318
3318
  constructor(t, e) {
3319
- o(this, Ls);
3320
- o(this, wr);
3321
- u(this, Ls, t), u(this, wr, e);
3319
+ o(this, Fs);
3320
+ o(this, fr);
3321
+ u(this, Fs, t), u(this, fr, e);
3322
3322
  }
3323
3323
  subscribe(t) {
3324
- return s(this, Ls).subscribe(this.namespace(), t);
3324
+ return s(this, Fs).subscribe(this.namespace(), t);
3325
3325
  }
3326
3326
  closed() {
3327
- return s(this, Ls).closed();
3327
+ return s(this, Fs).closed();
3328
3328
  }
3329
3329
  namespace() {
3330
- return s(this, wr).namespace;
3330
+ return s(this, fr).namespace;
3331
3331
  }
3332
3332
  }
3333
- Ls = new WeakMap(), wr = new WeakMap();
3333
+ Fs = new WeakMap(), fr = new WeakMap();
3334
3334
  function $u(r, t) {
3335
3335
  return ["com.vindral.moq", r];
3336
3336
  }
@@ -3347,35 +3347,35 @@ function zu(r) {
3347
3347
  const t = new TextDecoder().decode(r);
3348
3348
  return JSON.parse(t);
3349
3349
  }
3350
- var it, At, Re, ht, fr, Nn, pr, ga;
3351
- const Na = class Na {
3350
+ var it, Dt, Re, ht, pr, Gn, br, ga;
3351
+ const Ga = class Ga {
3352
3352
  constructor(t, e) {
3353
- o(this, pr);
3353
+ o(this, br);
3354
3354
  o(this, it);
3355
3355
  // The largest group id seen so far - used to switch seamlessly between tracks
3356
- o(this, At);
3356
+ o(this, Dt);
3357
3357
  // We keep track of the most recent groups to ensure we haven't missed any due to re-ordering before we close subscriptions
3358
3358
  o(this, Re, new Ba(100));
3359
3359
  // This contains the unconsumed groups if this track has an absolute range
3360
3360
  o(this, ht);
3361
- o(this, fr);
3362
- o(this, Nn, (t) => h(this, null, function* () {
3361
+ o(this, pr);
3362
+ o(this, Gn, (t) => h(this, null, function* () {
3363
3363
  if (!t)
3364
3364
  return s(this, it).close();
3365
3365
  if (s(this, ht))
3366
3366
  return;
3367
3367
  const e = s(this, Re).items().reduce((i, n) => i < n ? i : n, t);
3368
- u(this, ht, f(this, pr, ga).call(this, e, t)), s(this, ht).size === 0 && (yield s(this, it).close());
3368
+ u(this, ht, f(this, br, ga).call(this, e, t)), s(this, ht).size === 0 && (yield s(this, it).close());
3369
3369
  }));
3370
- u(this, it, t), u(this, At, e), t.done().then((i) => h(this, null, function* () {
3370
+ u(this, it, t), u(this, Dt, e), t.done().then((i) => h(this, null, function* () {
3371
3371
  var n;
3372
- return s(this, Nn).call(this, (n = i.finalInfo) == null ? void 0 : n.group);
3373
- })).catch(A), u(this, fr, t.groups());
3372
+ return s(this, Gn).call(this, (n = i.finalInfo) == null ? void 0 : n.group);
3373
+ })).catch(A), u(this, pr, t.groups());
3374
3374
  }
3375
3375
  static subscribe(t, e) {
3376
3376
  return h(this, null, function* () {
3377
3377
  const i = yield t.subscribe(e);
3378
- return new Na(i, void 0);
3378
+ return new Ga(i, void 0);
3379
3379
  });
3380
3380
  }
3381
3381
  subscribeId() {
@@ -3385,7 +3385,7 @@ const Na = class Na {
3385
3385
  return s(this, it).name;
3386
3386
  }
3387
3387
  largestGroupId() {
3388
- return s(this, At);
3388
+ return s(this, Dt);
3389
3389
  }
3390
3390
  // The subscription needs renewal if it is still active and aren't finishing up the unconsumed group IDs.
3391
3391
  // If we are just finishing up the unconsumed group IDs we assume we'll finish up before the expiry.
@@ -3401,7 +3401,7 @@ const Na = class Na {
3401
3401
  }
3402
3402
  update(t, e) {
3403
3403
  return h(this, null, function* () {
3404
- return u(this, ht, f(this, pr, ga).call(this, t, e)), s(this, ht).size === 0 && (yield s(this, it).close()), s(this, it).update(t, e);
3404
+ return u(this, ht, f(this, br, ga).call(this, t, e)), s(this, ht).size === 0 && (yield s(this, it).close()), s(this, it).update(t, e);
3405
3405
  });
3406
3406
  }
3407
3407
  unsubscribe() {
@@ -3412,11 +3412,11 @@ const Na = class Na {
3412
3412
  var i;
3413
3413
  if (s(this, ht) && s(this, ht).size === 0)
3414
3414
  return { done: !0, value: void 0 };
3415
- const t = yield s(this, fr).next();
3415
+ const t = yield s(this, pr).next();
3416
3416
  if (t.done)
3417
3417
  return t;
3418
3418
  const e = t.value.groupId();
3419
- return (i = s(this, ht)) == null || i.delete(e), s(this, Re).push(e), s(this, At) || u(this, At, e), u(this, At, s(this, At) < e ? e : s(this, At)), t;
3419
+ return (i = s(this, ht)) == null || i.delete(e), s(this, Re).push(e), s(this, Dt) || u(this, Dt, e), u(this, Dt, s(this, Dt) < e ? e : s(this, Dt)), t;
3420
3420
  });
3421
3421
  }
3422
3422
  return() {
@@ -3426,7 +3426,7 @@ const Na = class Na {
3426
3426
  return this;
3427
3427
  }
3428
3428
  };
3429
- it = new WeakMap(), At = new WeakMap(), Re = new WeakMap(), ht = new WeakMap(), fr = new WeakMap(), Nn = new WeakMap(), pr = new WeakSet(), ga = function(t, e) {
3429
+ it = new WeakMap(), Dt = new WeakMap(), Re = new WeakMap(), ht = new WeakMap(), pr = new WeakMap(), Gn = new WeakMap(), br = new WeakSet(), ga = function(t, e) {
3430
3430
  const i = /* @__PURE__ */ new Set();
3431
3431
  for (let n = t; n <= e; n++)
3432
3432
  i == null || i.add(n);
@@ -3434,88 +3434,88 @@ it = new WeakMap(), At = new WeakMap(), Re = new WeakMap(), ht = new WeakMap(),
3434
3434
  i == null || i.delete(n);
3435
3435
  }), i;
3436
3436
  };
3437
- let Sn = Na;
3438
- var Dt, je, Ft, ee, br, ka, mr;
3439
- const Ga = class Ga {
3437
+ let Un = Ga;
3438
+ var mt, je, Wt, Ot, mr, ka, yr;
3439
+ const Na = class Na {
3440
3440
  constructor(t) {
3441
- o(this, br);
3441
+ o(this, mr);
3442
3442
  // The current active subscription
3443
- o(this, Dt);
3443
+ o(this, mt);
3444
3444
  // The current group iterator - gets replaced by the next in #groups when it runs out
3445
3445
  o(this, je);
3446
3446
  // The next group iterators to switch to when the current one runs out
3447
- o(this, Ft, new Jn(10));
3448
- o(this, ee);
3449
- o(this, mr, (t, e) => h(this, null, function* () {
3447
+ o(this, Wt, new Jn(10));
3448
+ o(this, Ot);
3449
+ o(this, yr, (t, e) => h(this, null, function* () {
3450
3450
  var b = [];
3451
3451
  try {
3452
- const i = nt(b, yield s(this, Dt).lock());
3452
+ const i = nt(b, yield s(this, mt).lock());
3453
3453
  const n = { subscribeId: i.value.subscribeId() };
3454
3454
  if (!i.value.needsRenewal()) {
3455
- s(this, ee).debug("Subscription does not need renewal", n);
3455
+ s(this, Ot).debug("Subscription does not need renewal", n);
3456
3456
  return;
3457
3457
  }
3458
3458
  const a = i.value.largestGroupId();
3459
3459
  const c = a !== void 0;
3460
- const d = new $t().name(e.name).priority(e.priority).groupOrder(e.groupOrder);
3460
+ const l = new Mt().name(e.name).priority(e.priority).groupOrder(e.groupOrder);
3461
3461
  n.largestGroupId = a;
3462
- s(this, ee).debug("Renewing subscription", n);
3462
+ s(this, Ot).debug("Renewing subscription", n);
3463
3463
  switch (e.filterType.type) {
3464
3464
  case "absolute-range":
3465
- s(this, ee).debug("Absolute range is not renewed", n);
3465
+ s(this, Ot).debug("Absolute range is not renewed", n);
3466
3466
  return;
3467
3467
  case "absolute-start":
3468
3468
  case "latest-group":
3469
3469
  case "latest-object":
3470
- c && d.startGroup(a + k(1));
3470
+ c && l.startGroup(a + k(1));
3471
3471
  break;
3472
3472
  }
3473
- const w = d.build();
3473
+ const w = l.build();
3474
3474
  n.newTrack = w;
3475
3475
  const [p] = yield Promise.all([
3476
3476
  t.subscribe(w),
3477
3477
  c ? i.value.update(a, a) : i.value.unsubscribe()
3478
3478
  ]);
3479
- p.done().then(() => f(this, br, ka).call(this, p)).catch(A);
3480
- p.expiryNotification().then(() => s(this, mr).call(this, t, w)).catch(A);
3481
- const m = new Sn(p, a);
3479
+ p.done().then(() => f(this, mr, ka).call(this, p)).catch(A);
3480
+ p.expiryNotification().then(() => s(this, yr).call(this, t, w)).catch(A);
3481
+ const m = new Un(p, a);
3482
3482
  i.value = m;
3483
- yield s(this, Ft).push(m);
3484
- s(this, ee).info("Subscription renewed", n);
3483
+ yield s(this, Wt).push(m);
3484
+ s(this, Ot).info("Subscription renewed", n);
3485
3485
  } catch (I) {
3486
3486
  var g = I, E = !0;
3487
3487
  } finally {
3488
3488
  at(b, g, E);
3489
3489
  }
3490
3490
  }));
3491
- u(this, Dt, new Lc(t)), u(this, je, t), u(this, ee, rt.get().createContext(`Renewable '${t.name()}'`));
3491
+ u(this, mt, new Lc(t)), u(this, je, t), u(this, Ot, rt.get().createContext(`Renewable '${t.name()}'`));
3492
3492
  }
3493
3493
  static subscribe(t, e, i) {
3494
3494
  return h(this, null, function* () {
3495
- const n = yield t.subscribe(e), a = new Ga(new Sn(n, i));
3495
+ const n = yield t.subscribe(e), a = new Na(new Un(n, i));
3496
3496
  return n.done().then(() => {
3497
3497
  var c;
3498
- return f(c = a, br, ka).call(c, n);
3498
+ return f(c = a, mr, ka).call(c, n);
3499
3499
  }).catch(A), n.expiryNotification().then(() => {
3500
3500
  var c;
3501
- return s(c = a, mr).call(c, t, e);
3501
+ return s(c = a, yr).call(c, t, e);
3502
3502
  }).catch(A), a;
3503
3503
  });
3504
3504
  }
3505
3505
  largestGroupId() {
3506
- return s(this, Dt).unsafeValue().largestGroupId();
3506
+ return s(this, mt).unsafeValue().largestGroupId();
3507
3507
  }
3508
3508
  update(t, e) {
3509
3509
  return h(this, null, function* () {
3510
3510
  var n = [];
3511
3511
  try {
3512
- const i = nt(n, yield s(this, Dt).lock());
3513
- s(this, Ft).close();
3512
+ const i = nt(n, yield s(this, mt).lock());
3513
+ s(this, Wt).close();
3514
3514
  return i.value.update(t, e);
3515
3515
  } catch (a) {
3516
- var c = a, d = !0;
3516
+ var c = a, l = !0;
3517
3517
  } finally {
3518
- at(n, c, d);
3518
+ at(n, c, l);
3519
3519
  }
3520
3520
  });
3521
3521
  }
@@ -3523,8 +3523,8 @@ const Ga = class Ga {
3523
3523
  return h(this, null, function* () {
3524
3524
  var i = [];
3525
3525
  try {
3526
- const e = nt(i, yield s(this, Dt).lock());
3527
- s(this, Ft).close();
3526
+ const e = nt(i, yield s(this, mt).lock());
3527
+ s(this, Wt).close();
3528
3528
  return e.value.endOfTrack(t);
3529
3529
  } catch (n) {
3530
3530
  var a = n, c = !0;
@@ -3537,8 +3537,8 @@ const Ga = class Ga {
3537
3537
  return h(this, null, function* () {
3538
3538
  var e = [];
3539
3539
  try {
3540
- const t = nt(e, yield s(this, Dt).lock());
3541
- s(this, Ft).close();
3540
+ const t = nt(e, yield s(this, mt).lock());
3541
+ s(this, Wt).close();
3542
3542
  return t.value.unsubscribe();
3543
3543
  } catch (i) {
3544
3544
  var n = i, a = !0;
@@ -3551,8 +3551,8 @@ const Ga = class Ga {
3551
3551
  return h(this, null, function* () {
3552
3552
  var e = [];
3553
3553
  try {
3554
- const t = nt(e, yield s(this, Dt).lock());
3555
- s(this, Ft).close();
3554
+ const t = nt(e, yield s(this, mt).lock());
3555
+ s(this, Wt).close();
3556
3556
  return t.value.return();
3557
3557
  } catch (i) {
3558
3558
  var n = i, a = !0;
@@ -3567,7 +3567,7 @@ const Ga = class Ga {
3567
3567
  const t = yield s(this, je).next();
3568
3568
  if (t.done) {
3569
3569
  yield (i = (e = s(this, je)).return) == null ? void 0 : i.call(e);
3570
- const n = yield s(this, Ft).pop();
3570
+ const n = yield s(this, Wt).pop();
3571
3571
  if (n)
3572
3572
  return u(this, je, n), this.next();
3573
3573
  }
@@ -3578,9 +3578,9 @@ const Ga = class Ga {
3578
3578
  return this;
3579
3579
  }
3580
3580
  objects() {
3581
- return xt(this, null, function* () {
3581
+ return Pt(this, null, function* () {
3582
3582
  try {
3583
- for (var d = C(this), w, p, m; w = !(p = yield new O(d.next())).done; w = !1) {
3583
+ for (var l = C(this), w, p, m; w = !(p = yield new O(l.next())).done; w = !1) {
3584
3584
  var t = p.value;
3585
3585
  var e = [];
3586
3586
  try {
@@ -3597,7 +3597,7 @@ const Ga = class Ga {
3597
3597
  m = [p];
3598
3598
  } finally {
3599
3599
  try {
3600
- w && (p = d.return) && (yield new O(p.call(d)));
3600
+ w && (p = l.return) && (yield new O(p.call(l)));
3601
3601
  } finally {
3602
3602
  if (m)
3603
3603
  throw m[0];
@@ -3606,14 +3606,21 @@ const Ga = class Ga {
3606
3606
  });
3607
3607
  }
3608
3608
  };
3609
- Dt = new WeakMap(), je = new WeakMap(), Ft = new WeakMap(), ee = new WeakMap(), br = new WeakSet(), ka = function(t) {
3609
+ mt = new WeakMap(), je = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), mr = new WeakSet(), ka = function(t) {
3610
3610
  return h(this, null, function* () {
3611
3611
  var e;
3612
- if (!(t.unsubscribed() || (e = t.range()) != null && e.endGroup))
3613
- return this.return();
3612
+ if (t.unsubscribed() || (e = t.range()) != null && e.endGroup) {
3613
+ s(this, Ot).info("Server initiated subscribe done but the subscription is already closing");
3614
+ return;
3615
+ }
3616
+ if (s(this, mt).unsafeValue().subscribeId() !== t.id) {
3617
+ s(this, Ot).info("subscribeId mismatch - the subscription already has been renewed");
3618
+ return;
3619
+ }
3620
+ return this.return();
3614
3621
  });
3615
- }, mr = new WeakMap();
3616
- let oe = Ga;
3622
+ }, yr = new WeakMap();
3623
+ let oe = Na;
3617
3624
  const Hu = "catalog";
3618
3625
  function eo(r) {
3619
3626
  const t = zu(r.payload);
@@ -3621,25 +3628,25 @@ function eo(r) {
3621
3628
  throw new Error("unexpected catalog type");
3622
3629
  return t;
3623
3630
  }
3624
- var Ne, yr, gr, kr, Gn, dc;
3631
+ var Ge, gr, kr, Ir, Nn, dc;
3625
3632
  const Ln = class Ln {
3626
3633
  constructor(t, e, i) {
3627
- o(this, Gn);
3628
- o(this, Ne);
3629
- o(this, yr);
3634
+ o(this, Nn);
3635
+ o(this, Ge);
3630
3636
  o(this, gr);
3631
3637
  o(this, kr);
3632
- u(this, yr, t), u(this, Ne, e), u(this, gr, i), u(this, kr, f(this, Gn, dc).call(this));
3638
+ o(this, Ir);
3639
+ u(this, gr, t), u(this, Ge, e), u(this, kr, i), u(this, Ir, f(this, Nn, dc).call(this));
3633
3640
  }
3634
3641
  catalog() {
3635
- return s(this, Ne);
3642
+ return s(this, Ge);
3636
3643
  }
3637
3644
  closed() {
3638
- return s(this, kr);
3645
+ return s(this, Ir);
3639
3646
  }
3640
3647
  close() {
3641
3648
  return h(this, null, function* () {
3642
- return s(this, Ne).close(), (yield s(this, yr).promise).unsubscribe();
3649
+ return s(this, Ge).close(), (yield s(this, gr).promise).unsubscribe();
3643
3650
  });
3644
3651
  }
3645
3652
  static start(t, e) {
@@ -3647,7 +3654,7 @@ const Ln = class Ln {
3647
3654
  const i = V.fromPromise(
3648
3655
  oe.subscribe(
3649
3656
  t,
3650
- new $t().name(e.catalogName || Hu).groupOrder("ascending").build()
3657
+ new Mt().name(e.catalogName || Hu).groupOrder("ascending").build()
3651
3658
  )
3652
3659
  ), n = V.fromPromise(i.promise.then((w) => w.objects()));
3653
3660
  if (e.catalog)
@@ -3655,21 +3662,21 @@ const Ln = class Ln {
3655
3662
  const c = yield (yield n.promise).next();
3656
3663
  if (!c.value)
3657
3664
  throw new Error("No catalog found");
3658
- const d = eo(c.value);
3659
- return new Ln(i, new Y(d), n);
3665
+ const l = eo(c.value);
3666
+ return new Ln(i, new Y(l), n);
3660
3667
  });
3661
3668
  }
3662
3669
  };
3663
- Ne = new WeakMap(), yr = new WeakMap(), gr = new WeakMap(), kr = new WeakMap(), Gn = new WeakSet(), dc = function() {
3670
+ Ge = new WeakMap(), gr = new WeakMap(), kr = new WeakMap(), Ir = new WeakMap(), Nn = new WeakSet(), dc = function() {
3664
3671
  return h(this, null, function* () {
3665
- const t = yield s(this, gr).promise;
3672
+ const t = yield s(this, kr).promise;
3666
3673
  try {
3667
3674
  for (var e = C(t), i, n, a; i = !(n = yield e.next()).done; i = !1) {
3668
3675
  const c = n.value;
3669
3676
  if (c.objectStatus !== X.Normal)
3670
3677
  continue;
3671
- const d = eo(c);
3672
- s(this, Ne).update(d);
3678
+ const l = eo(c);
3679
+ s(this, Ge).update(l);
3673
3680
  }
3674
3681
  } catch (n) {
3675
3682
  a = [n];
@@ -3684,39 +3691,39 @@ Ne = new WeakMap(), yr = new WeakMap(), gr = new WeakMap(), kr = new WeakMap(),
3684
3691
  });
3685
3692
  };
3686
3693
  let Ia = Ln;
3687
- var Ir, Fs, vr, Ws, Sr, va;
3694
+ var vr, Ws, Sr, $s, Ur, va;
3688
3695
  class Xu {
3689
3696
  constructor(t, e, i, n) {
3690
- o(this, Sr);
3691
- o(this, Ir);
3692
- o(this, Fs);
3697
+ o(this, Ur);
3693
3698
  o(this, vr);
3694
- l(this, "track");
3695
- o(this, Ws, rt.get().createContext("CmafGroup"));
3696
- this.track = n, u(this, Ir, i), u(this, Fs, t), u(this, vr, e);
3699
+ o(this, Ws);
3700
+ o(this, Sr);
3701
+ d(this, "track");
3702
+ o(this, $s, rt.get().createContext("CmafGroup"));
3703
+ this.track = n, u(this, vr, i), u(this, Ws, t), u(this, Sr, e);
3697
3704
  }
3698
3705
  [Symbol.asyncIterator]() {
3699
- return xt(this, null, function* () {
3706
+ return Pt(this, null, function* () {
3700
3707
  const t = { name: this.track.trackObject.name, namespace: this.track.namespace };
3701
- s(this, Ws).debug("start", Mt({}, t));
3708
+ s(this, $s).debug("start", zt({}, t));
3702
3709
  try {
3703
- for (var e = C(s(this, Fs)), i, n, a; i = !(n = yield new O(e.next())).done; i = !1) {
3710
+ for (var e = C(s(this, Ws)), i, n, a; i = !(n = yield new O(e.next())).done; i = !1) {
3704
3711
  const c = n.value;
3705
3712
  if (c.objectStatus === X.EndOfTrackAndGroup && (yield new O(this.track.endOfTrack(c.groupId))), c.objectStatus !== X.Normal)
3706
3713
  continue;
3707
- const d = s(this, vr).createFragment(c.payload), w = d.timescale(), p = d.baseMediaDecodeTime() / w * 1e3, m = d.duration() / w * 1e3, b = p + m, I = s(this, Ir) / 1e3 * w;
3708
- d.updateBaseMediaDecodeTime(d.baseMediaDecodeTime() - I);
3714
+ const l = s(this, Sr).createFragment(c.payload), w = l.timescale(), p = l.baseMediaDecodeTime() / w * 1e3, m = l.duration() / w * 1e3, b = p + m, I = s(this, vr) / 1e3 * w;
3715
+ l.updateBaseMediaDecodeTime(l.baseMediaDecodeTime() - I);
3709
3716
  const g = this.track.timestampRange();
3710
3717
  if (g && p >= g[1])
3711
3718
  break;
3712
- s(this, Ws).debug("fragment", Mr(Mt({}, t), {
3719
+ s(this, $s).debug("fragment", zr(zt({}, t), {
3713
3720
  startTime: p,
3714
3721
  endTime: b,
3715
3722
  subscribeId: c.subscribeId,
3716
3723
  groupId: c.groupId,
3717
3724
  objectId: c.objectId,
3718
3725
  streamId: c.streamId
3719
- })), yield [c.groupId, d];
3726
+ })), yield [c.groupId, l];
3720
3727
  }
3721
3728
  } catch (n) {
3722
3729
  a = [n];
@@ -3728,93 +3735,93 @@ class Xu {
3728
3735
  throw a[0];
3729
3736
  }
3730
3737
  }
3731
- s(this, Ws).debug("end", Mt({}, t));
3738
+ s(this, $s).debug("end", zt({}, t));
3732
3739
  });
3733
3740
  }
3734
- [Ct()]() {
3735
- return f(this, Sr, va).call(this);
3741
+ [Bt()]() {
3742
+ return f(this, Ur, va).call(this);
3736
3743
  }
3737
3744
  [Symbol.asyncDispose]() {
3738
- return f(this, Sr, va).call(this);
3745
+ return f(this, Ur, va).call(this);
3739
3746
  }
3740
3747
  }
3741
- Ir = new WeakMap(), Fs = new WeakMap(), vr = new WeakMap(), Ws = new WeakMap(), Sr = new WeakSet(), va = function() {
3748
+ vr = new WeakMap(), Ws = new WeakMap(), Sr = new WeakMap(), $s = new WeakMap(), Ur = new WeakSet(), va = function() {
3742
3749
  return h(this, null, function* () {
3743
3750
  var t, e;
3744
- return yield (e = (t = s(this, Fs)).return) == null ? void 0 : e.call(t), Promise.resolve();
3751
+ return yield (e = (t = s(this, Ws)).return) == null ? void 0 : e.call(t), Promise.resolve();
3745
3752
  });
3746
3753
  };
3747
- var Ur, Ot, Er, Tr, Fn, lc;
3748
- const is = class is {
3754
+ var Er, Vt, Tr, Ar, Fn, lc;
3755
+ const rs = class rs {
3749
3756
  constructor(t, e, i, n, a) {
3750
- o(this, Ur);
3751
- o(this, Ot);
3752
- // A static offset that will be applied to all fragments
3753
3757
  o(this, Er);
3754
- // Stop consuming the track after we have passed thig timestamp
3758
+ o(this, Vt);
3759
+ // A static offset that will be applied to all fragments
3755
3760
  o(this, Tr);
3756
- l(this, "trackObject");
3757
- l(this, "namespace");
3758
- this.trackObject = t, this.namespace = e, u(this, Ot, i), u(this, Ur, n), u(this, Er, a);
3761
+ // Stop consuming the track after we have passed thig timestamp
3762
+ o(this, Ar);
3763
+ d(this, "trackObject");
3764
+ d(this, "namespace");
3765
+ this.trackObject = t, this.namespace = e, u(this, Vt, i), u(this, Er, n), u(this, Tr, a);
3759
3766
  }
3760
3767
  static subscribe(t, e, i, n) {
3761
3768
  return h(this, null, function* () {
3762
3769
  var m;
3763
3770
  if (e.format !== "cmaf")
3764
3771
  throw new Error("format must be cmaf");
3765
- const a = new $t().name(e.name);
3772
+ const a = new Mt().name(e.name);
3766
3773
  n && a.startGroup(n);
3767
3774
  const c = a.build();
3768
3775
  if (e.initTrack) {
3769
- const b = new $t().name(e.initTrack).build(), [I, g] = yield Promise.all([
3770
- f(m = is, Fn, lc).call(m, t, b),
3776
+ const b = new Mt().name(e.initTrack).build(), [I, g] = yield Promise.all([
3777
+ f(m = rs, Fn, lc).call(m, t, b),
3771
3778
  oe.subscribe(t, c, n ? n - k(1) : void 0)
3772
3779
  ]), E = new qa(I);
3773
- return new is(e, t.namespace(), g, E, i);
3780
+ return new rs(e, t.namespace(), g, E, i);
3774
3781
  }
3775
3782
  Io(e.initData, "no init data found on track");
3776
- const d = vo(e.initData), w = new qa(new Uint8Array(d)), p = yield oe.subscribe(t, c, n ? n - k(1) : void 0);
3777
- return new is(e, t.namespace(), p, w, i);
3783
+ const l = vo(e.initData), w = new qa(new Uint8Array(l)), p = yield oe.subscribe(t, c, n ? n - k(1) : void 0);
3784
+ return new rs(e, t.namespace(), p, w, i);
3778
3785
  });
3779
3786
  }
3780
3787
  largestGroupId() {
3781
- return s(this, Ot).largestGroupId();
3788
+ return s(this, Vt).largestGroupId();
3782
3789
  }
3783
3790
  stopAfterTimestampReached(t) {
3784
- u(this, Tr, [0, t]);
3791
+ u(this, Ar, [0, t]);
3785
3792
  }
3786
3793
  timestampRange() {
3787
- return s(this, Tr);
3794
+ return s(this, Ar);
3788
3795
  }
3789
3796
  endOfTrack(t) {
3790
- return s(this, Ot).endOfTrack(t);
3797
+ return s(this, Vt).endOfTrack(t);
3791
3798
  }
3792
3799
  update(t, e) {
3793
- return s(this, Ot).update(t, e);
3800
+ return s(this, Vt).update(t, e);
3794
3801
  }
3795
3802
  unsubscribe() {
3796
3803
  return h(this, null, function* () {
3797
- return s(this, Ot).unsubscribe();
3804
+ return s(this, Vt).unsubscribe();
3798
3805
  });
3799
3806
  }
3800
3807
  next() {
3801
3808
  return h(this, null, function* () {
3802
- const t = yield s(this, Ot).next();
3809
+ const t = yield s(this, Vt).next();
3803
3810
  return t.done ? t : {
3804
3811
  done: !1,
3805
- value: new Xu(t.value, s(this, Ur), s(this, Er), this)
3812
+ value: new Xu(t.value, s(this, Er), s(this, Tr), this)
3806
3813
  };
3807
3814
  });
3808
3815
  }
3809
3816
  return() {
3810
3817
  return h(this, null, function* () {
3811
- return yield s(this, Ot).return(), { done: !0, value: void 0 };
3818
+ return yield s(this, Vt).return(), { done: !0, value: void 0 };
3812
3819
  });
3813
3820
  }
3814
3821
  [Symbol.asyncIterator]() {
3815
3822
  return this;
3816
3823
  }
3817
- [Ct()]() {
3824
+ [Bt()]() {
3818
3825
  return this.unsubscribe();
3819
3826
  }
3820
3827
  [Symbol.asyncDispose]() {
@@ -3823,7 +3830,7 @@ const is = class is {
3823
3830
  });
3824
3831
  }
3825
3832
  };
3826
- Ur = new WeakMap(), Ot = new WeakMap(), Er = new WeakMap(), Tr = new WeakMap(), Fn = new WeakSet(), lc = function(t, e) {
3833
+ Er = new WeakMap(), Vt = new WeakMap(), Tr = new WeakMap(), Ar = new WeakMap(), Fn = new WeakSet(), lc = function(t, e) {
3827
3834
  return h(this, null, function* () {
3828
3835
  var a = [];
3829
3836
  try {
@@ -3834,33 +3841,33 @@ Ur = new WeakMap(), Ot = new WeakMap(), Er = new WeakMap(), Tr = new WeakMap(),
3834
3841
  yield i.close();
3835
3842
  return n.value.payload;
3836
3843
  } catch (c) {
3837
- var d = c, w = !0;
3844
+ var l = c, w = !0;
3838
3845
  } finally {
3839
- var p = at(a, d, w);
3846
+ var p = at(a, l, w);
3840
3847
  p && (yield p);
3841
3848
  }
3842
3849
  });
3843
- }, o(is, Fn);
3844
- let Sa = is;
3850
+ }, o(rs, Fn);
3851
+ let Sa = rs;
3845
3852
  const so = 1e4, Yu = 3e4;
3846
- var Wn, se, Ge, Ar, Dr, Or, Ze, Ea, wc;
3853
+ var Wn, se, Ne, Dr, Or, Vr, Ze, Ea, wc;
3847
3854
  const La = class La {
3848
3855
  constructor(t, e, i) {
3849
3856
  o(this, Ze);
3850
3857
  o(this, Wn, rt.get().createContext("Timeline"));
3851
3858
  o(this, se, new Y([]));
3852
- o(this, Ge);
3853
- o(this, Ar);
3859
+ o(this, Ne);
3854
3860
  o(this, Dr);
3855
3861
  o(this, Or);
3856
- u(this, Ar, t), u(this, Dr, i), u(this, Ge, e), u(this, Or, f(this, Ze, Ea).call(this, s(this, Ge))), this.closed().finally(() => s(this, se).close()).catch(A);
3862
+ o(this, Vr);
3863
+ u(this, Dr, t), u(this, Or, i), u(this, Ne, e), u(this, Vr, f(this, Ze, Ea).call(this, s(this, Ne))), this.closed().finally(() => s(this, se).close()).catch(A);
3857
3864
  }
3858
3865
  closed() {
3859
- return s(this, Or);
3866
+ return s(this, Vr);
3860
3867
  }
3861
3868
  close() {
3862
3869
  return h(this, null, function* () {
3863
- return (yield s(this, Ge).promise).unsubscribe();
3870
+ return (yield s(this, Ne).promise).unsubscribe();
3864
3871
  });
3865
3872
  }
3866
3873
  timeline() {
@@ -3876,7 +3883,7 @@ const La = class La {
3876
3883
  }
3877
3884
  static start(t, e) {
3878
3885
  const i = V.fromPromise(
3879
- oe.subscribe(t, new $t().name(e).groupOrder("ascending").build())
3886
+ oe.subscribe(t, new Mt().name(e).groupOrder("ascending").build())
3880
3887
  );
3881
3888
  return new La(t, i, e);
3882
3889
  }
@@ -3894,15 +3901,15 @@ const La = class La {
3894
3901
  });
3895
3902
  }
3896
3903
  };
3897
- Wn = new WeakMap(), se = new WeakMap(), Ge = new WeakMap(), Ar = new WeakMap(), Dr = new WeakMap(), Or = new WeakMap(), Ze = new WeakSet(), Ea = function(t) {
3904
+ Wn = new WeakMap(), se = new WeakMap(), Ne = new WeakMap(), Dr = new WeakMap(), Or = new WeakMap(), Vr = new WeakMap(), Ze = new WeakSet(), Ea = function(t) {
3898
3905
  return h(this, null, function* () {
3899
3906
  const e = yield t.promise;
3900
3907
  try {
3901
3908
  for (var g = C(e), E, z, _; E = !(z = yield g.next()).done; E = !1) {
3902
- var d = z.value;
3909
+ var l = z.value;
3903
3910
  var w = [];
3904
3911
  try {
3905
- const D = nt(w, d, !0);
3912
+ const D = nt(w, l, !0);
3906
3913
  try {
3907
3914
  for (var i = C(D), n, a, c; n = !(a = yield i.next()).done; n = !1) {
3908
3915
  const S = a.value;
@@ -3910,11 +3917,11 @@ Wn = new WeakMap(), se = new WeakMap(), Ge = new WeakMap(), Ar = new WeakMap(),
3910
3917
  continue;
3911
3918
  const W = Zu(S.payload);
3912
3919
  s(this, se).update((v) => {
3913
- var R, si;
3914
- for (v.push(...W), v.sort((Lr, Fr) => Lr.wallclock - Fr.wallclock); v[0] && ((si = (R = v[v.length - 1]) == null ? void 0 : R.wallclock) != null ? si : 0) - v[0].wallclock > Yu; )
3920
+ var R, ii;
3921
+ for (v.push(...W), v.sort((Fr, Wr) => Fr.wallclock - Wr.wallclock); v[0] && ((ii = (R = v[v.length - 1]) == null ? void 0 : R.wallclock) != null ? ii : 0) - v[0].wallclock > Yu; )
3915
3922
  v.shift();
3916
3923
  return v;
3917
- }), e === s(this, Ge).resolved && S.groupId > k(0) && S.objectId == k(0) && f(this, Ze, wc).call(this, S.groupId).catch((v) => {
3924
+ }), e === s(this, Ne).resolved && S.groupId > k(0) && S.objectId == k(0) && f(this, Ze, wc).call(this, S.groupId).catch((v) => {
3918
3925
  s(this, Wn).warn("backfill failed", v);
3919
3926
  });
3920
3927
  }
@@ -3953,8 +3960,8 @@ Wn = new WeakMap(), se = new WeakMap(), Ge = new WeakMap(), Ar = new WeakMap(),
3953
3960
  return;
3954
3961
  const c = V.fromPromise(
3955
3962
  oe.subscribe(
3956
- s(this, Ar),
3957
- new $t().name(s(this, Dr)).groupOrder("ascending").range(e, e).build()
3963
+ s(this, Dr),
3964
+ new Mt().name(s(this, Or)).groupOrder("ascending").range(e, e).build()
3958
3965
  )
3959
3966
  );
3960
3967
  return f(this, Ze, Ea).call(this, c);
@@ -3966,14 +3973,14 @@ function Zu(r) {
3966
3973
  const t = new TextDecoder("utf-8").decode(r).split(`
3967
3974
  `);
3968
3975
  return (e = t[0]) != null && e.startsWith("MEDIA_PTS") && t.shift(), t.filter((i) => i.length > 0).map((i) => {
3969
- const [n, a, c, d, w] = i.split(",");
3970
- if (!n || !d)
3976
+ const [n, a, c, l, w] = i.split(",");
3977
+ if (!n || !l)
3971
3978
  throw new Error(`invalid timeline row: ${i}`);
3972
3979
  return {
3973
3980
  mediaPts: parseInt(n),
3974
3981
  groupId: a ? parseInt(a) : void 0,
3975
3982
  objectId: c ? parseInt(c) : void 0,
3976
- wallclock: parseInt(d),
3983
+ wallclock: parseInt(l),
3977
3984
  metadata: w
3978
3985
  };
3979
3986
  });
@@ -3981,22 +3988,22 @@ function Zu(r) {
3981
3988
  function Ku(r) {
3982
3989
  return typeof r.language == "string";
3983
3990
  }
3984
- var $n, Vr, ie, $s;
3991
+ var $n, Cr, ie, Ms;
3985
3992
  const Fa = class Fa {
3986
3993
  constructor(t, e, i, n, a) {
3987
3994
  o(this, $n, new Cc());
3988
- o(this, Vr);
3995
+ o(this, Cr);
3989
3996
  o(this, ie);
3990
- o(this, $s, 0);
3991
- l(this, "trackObject");
3992
- l(this, "namespace");
3993
- u(this, ie, t), u(this, Vr, e), this.trackObject = i, this.namespace = n, u(this, $s, a);
3997
+ o(this, Ms, 0);
3998
+ d(this, "trackObject");
3999
+ d(this, "namespace");
4000
+ u(this, ie, t), u(this, Cr, e), this.trackObject = i, this.namespace = n, u(this, Ms, a);
3994
4001
  }
3995
4002
  static subscribe(t, e, i) {
3996
4003
  return h(this, null, function* () {
3997
4004
  if (!Ku(e))
3998
4005
  throw new Error("track object language is required");
3999
- const n = new $t().name(e.name).build(), a = yield oe.subscribe(t, n), c = a.objects();
4006
+ const n = new Mt().name(e.name).build(), a = yield oe.subscribe(t, n), c = a.objects();
4000
4007
  return new Fa(a, c, e, t.namespace(), i);
4001
4008
  });
4002
4009
  }
@@ -4012,12 +4019,12 @@ const Fa = class Fa {
4012
4019
  next() {
4013
4020
  return h(this, null, function* () {
4014
4021
  for (; ; ) {
4015
- const t = yield s(this, Vr).next();
4022
+ const t = yield s(this, Cr).next();
4016
4023
  if (t.done)
4017
4024
  return t;
4018
4025
  if (t.value.objectStatus !== X.Normal)
4019
4026
  continue;
4020
- const e = new TextDecoder().decode(t.value.payload), i = s(this, $n).parse(e).map((a) => (a.startTime -= s(this, $s) / 1e3, a.endTime -= s(this, $s) / 1e3, a));
4027
+ const e = new TextDecoder().decode(t.value.payload), i = s(this, $n).parse(e).map((a) => (a.startTime -= s(this, Ms) / 1e3, a.endTime -= s(this, Ms) / 1e3, a));
4021
4028
  return {
4022
4029
  done: !1,
4023
4030
  value: { language: this.trackObject.language, cues: i }
@@ -4033,21 +4040,21 @@ const Fa = class Fa {
4033
4040
  [Symbol.asyncIterator]() {
4034
4041
  return this;
4035
4042
  }
4036
- [Ct()]() {
4043
+ [Bt()]() {
4037
4044
  return this.unsubscribe();
4038
4045
  }
4039
4046
  [Symbol.asyncDispose]() {
4040
4047
  return this.unsubscribe();
4041
4048
  }
4042
4049
  };
4043
- $n = new WeakMap(), Vr = new WeakMap(), ie = new WeakMap(), $s = new WeakMap();
4050
+ $n = new WeakMap(), Cr = new WeakMap(), ie = new WeakMap(), Ms = new WeakMap();
4044
4051
  let Ta = Fa;
4045
- var bo, Le, Fe, We, re, ua, Ms, qr;
4052
+ var bo, Le, Fe, We, re, ua, zs, _r;
4046
4053
  bo = [q({ context: "Channel", enter: "info" })];
4047
- const rs = class rs {
4054
+ const ns = class ns {
4048
4055
  constructor(t, e, i, n, a) {
4049
- o(this, Ms);
4050
- l(this, "namespace");
4056
+ o(this, zs);
4057
+ d(this, "namespace");
4051
4058
  o(this, Le);
4052
4059
  o(this, Fe);
4053
4060
  o(this, We);
@@ -4060,7 +4067,7 @@ const rs = class rs {
4060
4067
  Ua.start(i, "timeline"),
4061
4068
  Ia.start(i, { catalog: e.catalog, namespace: e.namespace })
4062
4069
  ]);
4063
- return new rs(i, n, a, e.namespace, 0);
4070
+ return new ns(i, n, a, e.namespace, 0);
4064
4071
  });
4065
4072
  }
4066
4073
  closed() {
@@ -4085,13 +4092,13 @@ const rs = class rs {
4085
4092
  const n = this.catalog().current().tracks.find(
4086
4093
  (a) => a["com.vindral.variant_uid"] === t["com.vindral.variant_uid"]
4087
4094
  );
4088
- return f(this, Ms, qr).call(this, () => Sa.subscribe(s(this, Le), n != null ? n : t, s(this, re), e));
4095
+ return f(this, zs, _r).call(this, () => Sa.subscribe(s(this, Le), n != null ? n : t, s(this, re), e));
4089
4096
  }
4090
4097
  subscribeWebVttTrack(t) {
4091
- return f(this, Ms, qr).call(this, () => Ta.subscribe(s(this, Le), t, s(this, re)));
4098
+ return f(this, zs, _r).call(this, () => Ta.subscribe(s(this, Le), t, s(this, re)));
4092
4099
  }
4093
4100
  subscribeTrack(t) {
4094
- return f(this, Ms, qr).call(this, () => s(this, Le).subscribe(t));
4101
+ return f(this, zs, _r).call(this, () => s(this, Le).subscribe(t));
4095
4102
  }
4096
4103
  /**
4097
4104
  * Closes the channel subscriptions
@@ -4100,7 +4107,7 @@ const rs = class rs {
4100
4107
  return Promise.all([s(this, We).close(), s(this, Fe).close()]);
4101
4108
  }
4102
4109
  };
4103
- ua = ue(null), Le = new WeakMap(), Fe = new WeakMap(), We = new WeakMap(), re = new WeakMap(), Ms = new WeakSet(), qr = function(t) {
4110
+ ua = ue(null), Le = new WeakMap(), Fe = new WeakMap(), We = new WeakMap(), re = new WeakMap(), zs = new WeakSet(), _r = function(t) {
4104
4111
  return h(this, null, function* () {
4105
4112
  const [e, i] = this.catalog().value();
4106
4113
  try {
@@ -4111,20 +4118,20 @@ ua = ue(null), Le = new WeakMap(), Fe = new WeakMap(), We = new WeakMap(), re =
4111
4118
  throw n;
4112
4119
  }
4113
4120
  });
4114
- }, H(ua, 9, "start", bo, rs), zt(ua, rs), he(ua, 3, rs);
4115
- let Un = rs;
4116
- var $e, Cr, Mn, fc;
4121
+ }, H(ua, 9, "start", bo, ns), Ht(ua, ns), he(ua, 3, ns);
4122
+ let En = ns;
4123
+ var $e, Br, Mn, fc;
4117
4124
  const Wa = class Wa {
4118
4125
  constructor(t) {
4119
4126
  o(this, Mn);
4120
4127
  o(this, $e);
4121
- o(this, Cr);
4128
+ o(this, Br);
4122
4129
  const [e, i] = t.value.value();
4123
4130
  u(this, $e, {
4124
4131
  createdAt: /* @__PURE__ */ new Date(),
4125
4132
  wallclock: new Date(e.ntpTimestamp),
4126
4133
  rtt: e.rtt
4127
- }), u(this, Cr, f(this, Mn, fc).call(this, t));
4134
+ }), u(this, Br, f(this, Mn, fc).call(this, t));
4128
4135
  }
4129
4136
  /**
4130
4137
  * @returns returns the current wallclock time in milliseconds based on the ntp timestamp of the stats track + the elapsed time since the last stats track.
@@ -4134,13 +4141,13 @@ const Wa = class Wa {
4134
4141
  return s(this, $e).wallclock.getTime() + e;
4135
4142
  }
4136
4143
  closed() {
4137
- return s(this, Cr);
4144
+ return s(this, Br);
4138
4145
  }
4139
4146
  static start(t) {
4140
4147
  return new Wa(t);
4141
4148
  }
4142
4149
  };
4143
- $e = new WeakMap(), Cr = new WeakMap(), Mn = new WeakSet(), fc = function(t) {
4150
+ $e = new WeakMap(), Br = new WeakMap(), Mn = new WeakSet(), fc = function(t) {
4144
4151
  return h(this, null, function* () {
4145
4152
  try {
4146
4153
  for (var e = C(t.value), i, n, a; i = !(n = yield e.next()).done; i = !1) {
@@ -4164,11 +4171,11 @@ $e = new WeakMap(), Cr = new WeakMap(), Mn = new WeakSet(), fc = function(t) {
4164
4171
  });
4165
4172
  };
4166
4173
  let Aa = Wa;
4167
- function zr(r) {
4174
+ function Hr(r) {
4168
4175
  return typeof r == "string" || r === null || r === void 0;
4169
4176
  }
4170
4177
  function Ju(r) {
4171
- return "provider" in r && typeof r.provider == "string" && (!("widevineLicenseUrl" in r) || zr(r.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in r) || zr(r.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in r) || zr(r.fairplayLicenseUrl)) && (!("fairplayCertificate" in r) || zr(r.fairplayCertificate));
4178
+ return "provider" in r && typeof r.provider == "string" && (!("widevineLicenseUrl" in r) || Hr(r.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in r) || Hr(r.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in r) || Hr(r.fairplayLicenseUrl)) && (!("fairplayCertificate" in r) || Hr(r.fairplayCertificate));
4172
4179
  }
4173
4180
  function Qu(r) {
4174
4181
  try {
@@ -4182,26 +4189,26 @@ function qu(r) {
4182
4189
  if (!Ju(e))
4183
4190
  throw new Error("Invalid drm object");
4184
4191
  const a = e, { fairplayCertificate: i } = a, n = Ja(a, ["fairplayCertificate"]);
4185
- return Mr(Mt({}, n), {
4192
+ return zr(zt({}, n), {
4186
4193
  fairplayCertificate: i ? Qu(i) : void 0
4187
4194
  });
4188
4195
  }
4189
4196
  class ja {
4190
4197
  constructor(t) {
4191
- l(this, "value");
4198
+ d(this, "value");
4192
4199
  this.value = t;
4193
4200
  }
4194
4201
  static create(t, e, i) {
4195
4202
  return h(this, null, function* () {
4196
4203
  var w = [];
4197
4204
  try {
4198
- const n = nt(w, yield t.subscribeTrack(new $t().name("drm").build()), !0);
4205
+ const n = nt(w, yield t.subscribeTrack(new Mt().name("drm").build()), !0);
4199
4206
  const a = n.objects();
4200
4207
  const c = yield a.next();
4201
4208
  if (c.done)
4202
4209
  throw new Error("No drm object received");
4203
- const d = qu(c.value.payload);
4204
- return new ja(Mr(Mt({}, d), { videoCodec: e, audioCodec: i }));
4210
+ const l = qu(c.value.payload);
4211
+ return new ja(zr(zt({}, l), { videoCodec: e, audioCodec: i }));
4205
4212
  } catch (p) {
4206
4213
  var m = p, b = !0;
4207
4214
  } finally {
@@ -4221,17 +4228,17 @@ function io(r) {
4221
4228
  return e;
4222
4229
  }
4223
4230
  const th = 1e4;
4224
- var Br, zn, pc;
4231
+ var xr, zn, pc;
4225
4232
  const $a = class $a {
4226
4233
  constructor(t, e, i) {
4227
4234
  o(this, zn);
4228
- l(this, "ip");
4229
- l(this, "value");
4230
- o(this, Br);
4231
- this.ip = i, this.value = new Y(e), u(this, Br, f(this, zn, pc).call(this, t));
4235
+ d(this, "ip");
4236
+ d(this, "value");
4237
+ o(this, xr);
4238
+ this.ip = i, this.value = new Y(e), u(this, xr, f(this, zn, pc).call(this, t));
4232
4239
  }
4233
4240
  closed() {
4234
- return s(this, Br);
4241
+ return s(this, xr);
4235
4242
  }
4236
4243
  idleTimeout() {
4237
4244
  return h(this, null, function* () {
@@ -4247,7 +4254,7 @@ const $a = class $a {
4247
4254
  }
4248
4255
  static start(t) {
4249
4256
  return h(this, null, function* () {
4250
- const i = (yield t.subscribe(new $t().name("stats").groupOrder("ascending").build())).objects(), n = yield i.next();
4257
+ const i = (yield t.subscribe(new Mt().name("stats").groupOrder("ascending").build())).objects(), n = yield i.next();
4251
4258
  if (n.done)
4252
4259
  throw new Error("No stats object received");
4253
4260
  const a = io(n.value.payload);
@@ -4257,15 +4264,15 @@ const $a = class $a {
4257
4264
  });
4258
4265
  }
4259
4266
  };
4260
- Br = new WeakMap(), zn = new WeakSet(), pc = function(t) {
4267
+ xr = new WeakMap(), zn = new WeakSet(), pc = function(t) {
4261
4268
  return h(this, null, function* () {
4262
4269
  try {
4263
4270
  for (var e = C(t), i, n, a; i = !(n = yield e.next()).done; i = !1) {
4264
4271
  const c = n.value;
4265
4272
  if (c.objectStatus !== X.Normal)
4266
4273
  continue;
4267
- const d = io(c.payload);
4268
- this.value.update(d);
4274
+ const l = io(c.payload);
4275
+ this.value.update(l);
4269
4276
  }
4270
4277
  } catch (n) {
4271
4278
  a = [n];
@@ -4280,21 +4287,21 @@ Br = new WeakMap(), zn = new WeakSet(), pc = function(t) {
4280
4287
  });
4281
4288
  };
4282
4289
  let Da = $a;
4283
- var Hn, zs;
4290
+ var Hn, Hs;
4284
4291
  class eh {
4285
4292
  constructor(t) {
4286
4293
  o(this, Hn, rt.get().createContext("UpstreamWatcher"));
4287
- o(this, zs);
4288
- u(this, zs, new Y(V.fromPromise(t.closed())));
4294
+ o(this, Hs);
4295
+ u(this, Hs, new Y(V.fromPromise(t.closed())));
4289
4296
  }
4290
4297
  update(t) {
4291
- s(this, zs).update(V.fromPromise(t.closed()));
4298
+ s(this, Hs).update(V.fromPromise(t.closed()));
4292
4299
  }
4293
4300
  closed() {
4294
4301
  return h(this, null, function* () {
4295
4302
  try {
4296
4303
  for (; ; ) {
4297
- const [t, e] = s(this, zs).value();
4304
+ const [t, e] = s(this, Hs).value();
4298
4305
  let i = !1;
4299
4306
  yield Promise.race([
4300
4307
  e == null ? void 0 : e.then(() => i = !0),
@@ -4310,28 +4317,28 @@ class eh {
4310
4317
  });
4311
4318
  }
4312
4319
  }
4313
- Hn = new WeakMap(), zs = new WeakMap();
4314
- var Hs, xr, Pr;
4320
+ Hn = new WeakMap(), Hs = new WeakMap();
4321
+ var Xs, Pr, Rr;
4315
4322
  class ra {
4316
4323
  constructor(t, e) {
4317
- o(this, Hs, rt.get().createContext("TracksIterator"));
4318
- o(this, xr);
4324
+ o(this, Xs, rt.get().createContext("TracksIterator"));
4319
4325
  o(this, Pr);
4320
- u(this, xr, t), u(this, Pr, e);
4326
+ o(this, Rr);
4327
+ u(this, Pr, t), u(this, Rr, e);
4321
4328
  }
4322
4329
  [Symbol.asyncIterator]() {
4323
- return xt(this, null, function* () {
4324
- const t = s(this, Pr);
4330
+ return Pt(this, null, function* () {
4331
+ const t = s(this, Rr);
4325
4332
  try {
4326
- for (var e = C(s(this, xr)), i, n, a; i = !(n = yield new O(e.next())).done; i = !1) {
4333
+ for (var e = C(s(this, Pr)), i, n, a; i = !(n = yield new O(e.next())).done; i = !1) {
4327
4334
  const c = n.value;
4328
4335
  if (!c)
4329
4336
  continue;
4330
- const d = {
4337
+ const l = {
4331
4338
  name: c.trackObject.name,
4332
4339
  namespace: c.namespace
4333
4340
  };
4334
- s(this, Hs).debug("track start", Mt({ mediaType: t }, d)), yield* sa(c), s(this, Hs).debug("track end", Mt({ mediaType: t }, d));
4341
+ s(this, Xs).debug("track start", zt({ mediaType: t }, l)), yield* sa(c), s(this, Xs).debug("track end", zt({ mediaType: t }, l));
4335
4342
  }
4336
4343
  } catch (n) {
4337
4344
  a = [n];
@@ -4343,45 +4350,45 @@ class ra {
4343
4350
  throw a[0];
4344
4351
  }
4345
4352
  }
4346
- s(this, Hs).debug("tracks ended", { mediaType: t });
4353
+ s(this, Xs).debug("tracks ended", { mediaType: t });
4347
4354
  });
4348
4355
  }
4349
4356
  }
4350
- Hs = new WeakMap(), xr = new WeakMap(), Pr = new WeakMap();
4351
- var mo, yo, go, Xs, Ys, Me, F, mt, yt, ne, Zs, Rr, ai, Z, _r, hi, bc, Va;
4357
+ Xs = new WeakMap(), Pr = new WeakMap(), Rr = new WeakMap();
4358
+ var mo, yo, go, Ys, Zs, Me, F, yt, gt, ne, Ks, jr, oi, Z, tn, di, bc, Va;
4352
4359
  go = [q({ context: "Player", enter: "info" })], yo = [q({ context: "Player", enter: "info", return: "info" })], mo = [q({ context: "Player", enter: "info" })];
4353
- const ns = class ns {
4360
+ const as = class as {
4354
4361
  constructor(t, e, i) {
4355
- he(ai, 5, this);
4362
+ he(oi, 5, this);
4356
4363
  o(this, Z);
4357
- o(this, Xs);
4358
4364
  o(this, Ys);
4365
+ o(this, Zs);
4359
4366
  o(this, Me);
4360
4367
  o(this, F);
4361
- o(this, mt, new Y(void 0));
4362
4368
  o(this, yt, new Y(void 0));
4369
+ o(this, gt, new Y(void 0));
4363
4370
  o(this, ne, new Y(void 0));
4364
- o(this, Zs);
4365
- o(this, Rr);
4366
- l(this, "subtitles", new ra(s(this, ne), "subtitles"));
4367
- l(this, "video", new ra(s(this, yt), "video"));
4368
- l(this, "audio", new ra(s(this, mt), "audio"));
4369
- u(this, Xs, t), u(this, Ys, Aa.start(i)), u(this, Me, i), u(this, F, new Y(e)), u(this, Zs, new eh(e)), u(this, Rr, Promise.race([i.idleTimeout(), f(this, Z, bc).call(this), s(this, Zs).closed()])), s(this, Xs).closed().then(() => this.close()).catch(A);
4371
+ o(this, Ks);
4372
+ o(this, jr);
4373
+ d(this, "subtitles", new ra(s(this, ne), "subtitles"));
4374
+ d(this, "video", new ra(s(this, gt), "video"));
4375
+ d(this, "audio", new ra(s(this, yt), "audio"));
4376
+ u(this, Ys, t), u(this, Zs, Aa.start(i)), u(this, Me, i), u(this, F, new Y(e)), u(this, Ks, new eh(e)), u(this, jr, Promise.race([i.idleTimeout(), f(this, Z, bc).call(this), s(this, Ks).closed()])), s(this, Ys).closed().then(() => this.close()).catch(A);
4370
4377
  }
4371
4378
  closed() {
4372
- return s(this, Rr);
4379
+ return s(this, jr);
4373
4380
  }
4374
4381
  static start(t, e) {
4375
4382
  return h(this, null, function* () {
4376
- const i = new hc(t, { namespace: $u("auxiliary") }), [[n, a, c], d] = yield Promise.all([
4377
- Un.start(t, e).then((p) => Promise.all([
4383
+ const i = new hc(t, { namespace: $u("auxiliary") }), [[n, a, c], l] = yield Promise.all([
4384
+ En.start(t, e).then((p) => Promise.all([
4378
4385
  Promise.resolve(p),
4379
4386
  e.videoTrack ? p.subscribeCmafTrack(e.videoTrack) : void 0,
4380
4387
  e.audioTrack ? p.subscribeCmafTrack(e.audioTrack) : void 0
4381
4388
  ])),
4382
4389
  Da.start(i)
4383
- ]), w = new ns(t, n, d);
4384
- return c && s(w, mt).update(c), a && s(w, yt).update(a), w;
4390
+ ]), w = new as(t, n, l);
4391
+ return c && s(w, yt).update(c), a && s(w, gt).update(a), w;
4385
4392
  });
4386
4393
  }
4387
4394
  connectionInfo() {
@@ -4403,14 +4410,14 @@ const ns = class ns {
4403
4410
  }
4404
4411
  videoTrack() {
4405
4412
  var t;
4406
- return (t = s(this, yt).current()) == null ? void 0 : t.trackObject;
4413
+ return (t = s(this, gt).current()) == null ? void 0 : t.trackObject;
4407
4414
  }
4408
4415
  audioTrack() {
4409
4416
  var t;
4410
- return (t = s(this, mt).current()) == null ? void 0 : t.trackObject;
4417
+ return (t = s(this, yt).current()) == null ? void 0 : t.trackObject;
4411
4418
  }
4412
4419
  referenceClock() {
4413
- return s(this, Ys);
4420
+ return s(this, Zs);
4414
4421
  }
4415
4422
  drm() {
4416
4423
  return h(this, null, function* () {
@@ -4426,20 +4433,20 @@ const ns = class ns {
4426
4433
  // Close the channel ObservableValue
4427
4434
  s(this, F).close(),
4428
4435
  // Close the consumers so that the iterators will stop
4429
- f(this, Z, _r).call(this, s(this, mt)),
4430
- f(this, Z, _r).call(this, s(this, yt)),
4431
- f(this, Z, _r).call(this, s(this, ne))
4436
+ f(this, Z, tn).call(this, s(this, yt)),
4437
+ f(this, Z, tn).call(this, s(this, gt)),
4438
+ f(this, Z, tn).call(this, s(this, ne))
4432
4439
  ]);
4433
4440
  }
4434
4441
  zap(t, e) {
4435
4442
  return h(this, null, function* () {
4436
4443
  var E, z;
4437
- const i = yield Un.start(s(this, Xs), t), n = s(this, Ys).wallclock() - e, a = s(this, F).current(), c = a.timestampWallclockOffset(), d = yield i.waitForWallclockTime(n);
4438
- s(this, Zs).update(i), yield s(this, F).current().close();
4439
- const w = d.toReversed().find((_) => _.wallclock <= n), p = w != null && w.mediaPts ? w.mediaPts - a.timestampOffsetMs() : void 0, I = i.timestampWallclockOffset() - c + a.timestampOffsetMs();
4444
+ const i = yield En.start(s(this, Ys), t), n = s(this, Zs).wallclock() - e, a = s(this, F).current(), c = a.timestampWallclockOffset(), l = yield i.waitForWallclockTime(n);
4445
+ s(this, Ks).update(i), yield s(this, F).current().close();
4446
+ const w = l.toReversed().find((_) => _.wallclock <= n), p = w != null && w.mediaPts ? w.mediaPts - a.timestampOffsetMs() : void 0, I = i.timestampWallclockOffset() - c + a.timestampOffsetMs();
4440
4447
  i.setTimestampOffsetMs(I);
4441
4448
  const g = w != null && w.groupId ? k(w.groupId) : void 0;
4442
- p && ((E = s(this, yt).current()) == null || E.stopAfterTimestampReached(p), (z = s(this, mt).current()) == null || z.stopAfterTimestampReached(p)), s(this, F).update(i), yield Promise.all([
4449
+ p && ((E = s(this, gt).current()) == null || E.stopAfterTimestampReached(p), (z = s(this, yt).current()) == null || z.stopAfterTimestampReached(p)), s(this, F).update(i), yield Promise.all([
4443
4450
  t.videoTrack ? this.setVideoTrack(t.videoTrack, g) : void 0,
4444
4451
  t.audioTrack ? this.setAudioTrack(t.audioTrack, g) : void 0
4445
4452
  ]);
@@ -4461,23 +4468,23 @@ const ns = class ns {
4461
4468
  }
4462
4469
  setVideoTrack(t, e) {
4463
4470
  return h(this, null, function* () {
4464
- const i = yield f(this, Z, hi).call(this, s(this, F).current(), t, s(this, yt).current(), e);
4465
- s(this, yt).update(i);
4471
+ const i = yield f(this, Z, di).call(this, s(this, F).current(), t, s(this, gt).current(), e);
4472
+ s(this, gt).update(i);
4466
4473
  });
4467
4474
  }
4468
4475
  setAudioTrack(t, e) {
4469
4476
  return h(this, null, function* () {
4470
- const i = yield f(this, Z, hi).call(this, s(this, F).current(), t, s(this, mt).current(), e);
4471
- s(this, mt).update(i);
4477
+ const i = yield f(this, Z, di).call(this, s(this, F).current(), t, s(this, yt).current(), e);
4478
+ s(this, yt).update(i);
4472
4479
  });
4473
4480
  }
4474
4481
  };
4475
- ai = ue(null), Xs = new WeakMap(), Ys = new WeakMap(), Me = new WeakMap(), F = new WeakMap(), mt = new WeakMap(), yt = new WeakMap(), ne = new WeakMap(), Zs = new WeakMap(), Rr = new WeakMap(), Z = new WeakSet(), _r = function(t) {
4482
+ oi = ue(null), Ys = new WeakMap(), Zs = new WeakMap(), Me = new WeakMap(), F = new WeakMap(), yt = new WeakMap(), gt = new WeakMap(), ne = new WeakMap(), Ks = new WeakMap(), jr = new WeakMap(), Z = new WeakSet(), tn = function(t) {
4476
4483
  const e = t.current(), i = e == null ? void 0 : e.largestGroupId();
4477
4484
  return t.isClosed() || t.update(void 0), t.close(), i ? e == null ? void 0 : e.update(i, i) : e == null ? void 0 : e.unsubscribe();
4478
- }, hi = function(t, e, i, n) {
4485
+ }, di = function(t, e, i, n) {
4479
4486
  return h(this, null, function* () {
4480
- const a = i == null ? void 0 : i.largestGroupId(), [c, d] = yield Promise.all([
4487
+ const a = i == null ? void 0 : i.largestGroupId(), [c, l] = yield Promise.all([
4481
4488
  t.subscribeCmafTrack(
4482
4489
  e,
4483
4490
  n || (a ? a + k(1) : void 0)
@@ -4489,14 +4496,14 @@ ai = ue(null), Xs = new WeakMap(), Ys = new WeakMap(), Me = new WeakMap(), F = n
4489
4496
  }, bc = function() {
4490
4497
  return h(this, null, function* () {
4491
4498
  try {
4492
- for (var a = C(s(this, F)), c, d, w; c = !(d = yield a.next()).done; c = !1) {
4493
- const p = d.value;
4499
+ for (var a = C(s(this, F)), c, l, w; c = !(l = yield a.next()).done; c = !1) {
4500
+ const p = l.value;
4494
4501
  try {
4495
4502
  for (var t = C(p.catalog()), e, i, n; e = !(i = yield t.next()).done; e = !1) {
4496
4503
  const m = i.value;
4497
4504
  yield Promise.all([
4498
- f(this, Z, Va).call(this, m, s(this, yt)),
4499
- f(this, Z, Va).call(this, m, s(this, mt))
4505
+ f(this, Z, Va).call(this, m, s(this, gt)),
4506
+ f(this, Z, Va).call(this, m, s(this, yt))
4500
4507
  ]);
4501
4508
  }
4502
4509
  } catch (i) {
@@ -4510,11 +4517,11 @@ ai = ue(null), Xs = new WeakMap(), Ys = new WeakMap(), Me = new WeakMap(), F = n
4510
4517
  }
4511
4518
  }
4512
4519
  }
4513
- } catch (d) {
4514
- w = [d];
4520
+ } catch (l) {
4521
+ w = [l];
4515
4522
  } finally {
4516
4523
  try {
4517
- c && (d = a.return) && (yield d.call(a));
4524
+ c && (l = a.return) && (yield l.call(a));
4518
4525
  } finally {
4519
4526
  if (w)
4520
4527
  throw w[0];
@@ -4526,39 +4533,39 @@ ai = ue(null), Xs = new WeakMap(), Ys = new WeakMap(), Me = new WeakMap(), F = n
4526
4533
  const i = e.current();
4527
4534
  if (!i)
4528
4535
  return;
4529
- const n = i.trackObject.name, a = i.trackObject["com.vindral.variant_uid"], c = t.tracks.find((w) => w.name === n), d = t.tracks.find((w) => w["com.vindral.variant_uid"] === a);
4536
+ const n = i.trackObject.name, a = i.trackObject["com.vindral.variant_uid"], c = t.tracks.find((w) => w.name === n), l = t.tracks.find((w) => w["com.vindral.variant_uid"] === a);
4530
4537
  if (!c) {
4531
- if (!d) {
4538
+ if (!l) {
4532
4539
  e.update(void 0);
4533
4540
  return;
4534
4541
  }
4535
- e.update(yield s(this, F).current().subscribeCmafTrack(d));
4542
+ e.update(yield s(this, F).current().subscribeCmafTrack(l));
4536
4543
  }
4537
4544
  });
4538
- }, H(ai, 1, "close", go, ns), H(ai, 1, "zap", yo, ns), hi = H(ai, 17, "#replaceTrack", mo, Z, hi), zt(ai, ns);
4539
- let Oa = ns;
4545
+ }, H(oi, 1, "close", go, as), H(oi, 1, "zap", yo, as), di = H(oi, 17, "#replaceTrack", mo, Z, di), Ht(oi, as);
4546
+ let Oa = as;
4540
4547
  function na(r, t, e) {
4541
4548
  const i = new URL("/voq/subscribe", r);
4542
4549
  return i.searchParams.set("sessionId", t.sessionId), i.searchParams.set("clientId", t.clientId), i.searchParams.set("channelId", t.channelId), e && i.searchParams.set("authToken", e), i;
4543
4550
  }
4544
4551
  const sh = 1e4;
4545
- var L, Q, gt, ze, Ks, Js, B, ae, jr, Nr, Xn, Qs, K, mc, qs, Gr, _s, yc, gc, kc, Ic, Ca;
4552
+ var L, Q, kt, ze, Js, Qs, B, ae, Gr, Nr, Xn, qs, K, mc, _s, Lr, ti, yc, gc, kc, Ic, Ca;
4546
4553
  const Ma = class Ma {
4547
4554
  constructor(t, e, i, n, a, c) {
4548
4555
  o(this, K);
4549
4556
  o(this, L);
4550
4557
  o(this, Q);
4551
- o(this, gt);
4558
+ o(this, kt);
4552
4559
  o(this, ze, "disconnected");
4553
- o(this, Ks);
4554
4560
  o(this, Js);
4561
+ o(this, Qs);
4555
4562
  o(this, B);
4556
4563
  o(this, ae, /* @__PURE__ */ new Map());
4557
- o(this, jr);
4564
+ o(this, Gr);
4558
4565
  o(this, Nr, new Ba(10));
4559
4566
  o(this, Xn, Number.MAX_SAFE_INTEGER);
4560
- o(this, Qs, /* @__PURE__ */ new Map());
4561
- o(this, qs, (t) => {
4567
+ o(this, qs, /* @__PURE__ */ new Map());
4568
+ o(this, _s, (t) => {
4562
4569
  if (!t) {
4563
4570
  s(this, B).setSubtitleTrack(void 0).catch(A);
4564
4571
  return;
@@ -4566,51 +4573,51 @@ const Ma = class Ma {
4566
4573
  const e = s(this, ae).get(de(s(this, B).namespace())), i = e == null ? void 0 : e.getTextTrack(t);
4567
4574
  i && s(this, B).setSubtitleTrack(i).catch(A);
4568
4575
  });
4569
- o(this, Gr, (t) => {
4576
+ o(this, Lr, (t) => {
4570
4577
  switch (t.type) {
4571
4578
  case "subscribe":
4572
4579
  {
4573
- if (s(this, _s)) {
4580
+ if (s(this, ti)) {
4574
4581
  s(this, Q).info("Ignoring - we are already switching");
4575
4582
  return;
4576
4583
  }
4577
- u(this, _s, !0), f(this, K, gc).call(this, t.subscription).catch((e) => {
4584
+ u(this, ti, !0), f(this, K, gc).call(this, t.subscription).catch((e) => {
4578
4585
  s(this, Q).error("error handling subscription", e), s(this, L).emit("received signal", {
4579
4586
  type: "subscription changed",
4580
4587
  subscription: t.subscription,
4581
4588
  reset: !0
4582
4589
  });
4583
- }).finally(() => u(this, _s, !1));
4590
+ }).finally(() => u(this, ti, !1));
4584
4591
  }
4585
4592
  break;
4586
4593
  case "telemetry":
4587
- Rc(new URL("/api/telemetry", s(this, gt).url().replace("wss://", "https://")), {
4594
+ Rc(new URL("/api/telemetry", s(this, kt).url().replace("wss://", "https://")), {
4588
4595
  body: t.body,
4589
4596
  headers: { "Content-Type": "text/plain" }
4590
4597
  }).catch(A);
4591
4598
  break;
4592
4599
  case "refresh auth":
4593
- s(this, gt).updateAuthToken(t.token);
4600
+ s(this, kt).updateAuthToken(t.token);
4594
4601
  break;
4595
4602
  }
4596
4603
  });
4597
- o(this, _s, !1);
4598
- l(this, "disconnect", (t = "Disconnect Requested") => {
4599
- s(this, Q).info("Disconnecting", t), s(this, gt).close(), s(this, B).close().catch(A), u(this, Qs, /* @__PURE__ */ new Map()), u(this, ze, "disconnected");
4604
+ o(this, ti, !1);
4605
+ d(this, "disconnect", (t = "Disconnect Requested") => {
4606
+ s(this, Q).info("Disconnecting", t), s(this, kt).close(), s(this, B).close().catch(A), u(this, qs, /* @__PURE__ */ new Map()), u(this, ze, "disconnected");
4600
4607
  });
4601
- u(this, L, t), u(this, Q, e), u(this, gt, i), u(this, B, n), u(this, ae, a), u(this, jr, c), s(this, L).on("send signal", s(this, Gr)), s(this, L).on("disconnect", this.disconnect), s(this, L).on("text track", s(this, qs)), f(this, K, mc).call(this).catch(A), f(this, K, kc).call(this).catch(A);
4608
+ u(this, L, t), u(this, Q, e), u(this, kt, i), u(this, B, n), u(this, ae, a), u(this, Gr, c), s(this, L).on("send signal", s(this, Lr)), s(this, L).on("disconnect", this.disconnect), s(this, L).on("text track", s(this, _s)), f(this, K, mc).call(this).catch(A), f(this, K, kc).call(this).catch(A);
4602
4609
  }
4603
4610
  get estimatedBandwidth() {
4604
4611
  return s(this, Xn);
4605
4612
  }
4606
4613
  get firstConnectionTime() {
4607
- return s(this, Ks);
4614
+ return s(this, Js);
4608
4615
  }
4609
4616
  get lastConnectionTime() {
4610
- return s(this, Js);
4617
+ return s(this, Qs);
4611
4618
  }
4612
4619
  unload() {
4613
- s(this, L).off("send signal", s(this, Gr)), s(this, L).off("disconnect", this.disconnect), s(this, L).off("text track", s(this, qs)), this.disconnect();
4620
+ s(this, L).off("send signal", s(this, Lr)), s(this, L).off("disconnect", this.disconnect), s(this, L).off("text track", s(this, _s)), this.disconnect();
4614
4621
  }
4615
4622
  suspend() {
4616
4623
  }
@@ -4623,7 +4630,7 @@ const Ma = class Ma {
4623
4630
  estimatedBandwidth: e,
4624
4631
  connectCount: 0,
4625
4632
  connectionAttemptCount: 0,
4626
- edgeUrl: s(this, gt).url(),
4633
+ edgeUrl: s(this, kt).url(),
4627
4634
  connectionProtocol: "moq"
4628
4635
  };
4629
4636
  }
@@ -4635,15 +4642,15 @@ const Ma = class Ma {
4635
4642
  de(R.catalog.namespace),
4636
4643
  new aa(new Y(R.catalog))
4637
4644
  ])
4638
- ), c = yield n.onConnectInfo(n.connectInfo), d = n.options.get("authenticationToken");
4645
+ ), c = yield n.onConnectInfo(n.connectInfo), l = n.options.get("authenticationToken");
4639
4646
  let w, p;
4640
4647
  switch (typeof n.edgeUrl) {
4641
4648
  case "string": {
4642
- w = na(n.edgeUrl, c, d);
4649
+ w = na(n.edgeUrl, c, l);
4643
4650
  break;
4644
4651
  }
4645
4652
  default:
4646
- w = na(n.edgeUrl.moqUrl || n.edgeUrl.moqWsUrl, c, d), p = na(n.edgeUrl.moqWsUrl, c, d);
4653
+ w = na(n.edgeUrl.moqUrl || n.edgeUrl.moqWsUrl, c, l), p = na(n.edgeUrl.moqWsUrl, c, l);
4647
4654
  break;
4648
4655
  }
4649
4656
  const m = (D = n.connectInfo.channels.find((R) => R.channelId === c.channelId)) == null ? void 0 : D.catalog;
@@ -4673,7 +4680,7 @@ const Ma = class Ma {
4673
4680
  e.error("Error getting DRM data", R);
4674
4681
  });
4675
4682
  const _ = new Ma(t, e, g, E, a, i);
4676
- return c.textTrack && s(v = _, qs).call(v, c.textTrack), _;
4683
+ return c.textTrack && s(v = _, _s).call(v, c.textTrack), _;
4677
4684
  });
4678
4685
  }
4679
4686
  getState() {
@@ -4683,13 +4690,13 @@ const Ma = class Ma {
4683
4690
  return s(this, B).connectionInfo().rtt;
4684
4691
  }
4685
4692
  close() {
4686
- s(this, gt).close();
4693
+ s(this, kt).close();
4687
4694
  }
4688
4695
  closed() {
4689
- return Promise.race([s(this, gt).closed(), s(this, B).closed()]);
4696
+ return Promise.race([s(this, kt).closed(), s(this, B).closed()]);
4690
4697
  }
4691
4698
  };
4692
- L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks = new WeakMap(), Js = new WeakMap(), B = new WeakMap(), ae = new WeakMap(), jr = new WeakMap(), Nr = new WeakMap(), Xn = new WeakMap(), Qs = new WeakMap(), K = new WeakSet(), mc = function() {
4699
+ L = new WeakMap(), Q = new WeakMap(), kt = new WeakMap(), ze = new WeakMap(), Js = new WeakMap(), Qs = new WeakMap(), B = new WeakMap(), ae = new WeakMap(), Gr = new WeakMap(), Nr = new WeakMap(), Xn = new WeakMap(), qs = new WeakMap(), K = new WeakSet(), mc = function() {
4693
4700
  return h(this, null, function* () {
4694
4701
  try {
4695
4702
  for (var t = C(s(this, B).stats()), e, i, n; e = !(i = yield t.next()).done; e = !1) {
@@ -4707,10 +4714,10 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
4707
4714
  }
4708
4715
  }
4709
4716
  });
4710
- }, qs = new WeakMap(), Gr = new WeakMap(), _s = new WeakMap(), yc = function(t) {
4717
+ }, _s = new WeakMap(), Lr = new WeakMap(), ti = new WeakMap(), yc = function(t) {
4711
4718
  return h(this, null, function* () {
4712
4719
  var n;
4713
- const e = yield s(this, jr).connect({ channelId: t });
4720
+ const e = yield s(this, Gr).connect({ channelId: t });
4714
4721
  if (!jc(e))
4715
4722
  throw new Error("no moq connect info found");
4716
4723
  const i = (n = e.channels.find((a) => a.channelId === t)) == null ? void 0 : n.catalog;
@@ -4720,7 +4727,7 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
4720
4727
  });
4721
4728
  }, gc = function(t) {
4722
4729
  return h(this, null, function* () {
4723
- var c, d, w;
4730
+ var c, l, w;
4724
4731
  s(this, Q).info("handle subscription", t);
4725
4732
  const e = s(this, B);
4726
4733
  let i = s(this, ae).get(t.channelId);
@@ -4743,7 +4750,7 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
4743
4750
  }
4744
4751
  const n = i.getVideoTrack(t.video), a = i.getAudioTrack(t.audio);
4745
4752
  yield Promise.all([
4746
- n && n.track.name !== ((d = s(this, B).videoTrack()) == null ? void 0 : d.name) ? s(this, B).setVideoTrack(n.track) : void 0,
4753
+ n && n.track.name !== ((l = s(this, B).videoTrack()) == null ? void 0 : l.name) ? s(this, B).setVideoTrack(n.track) : void 0,
4747
4754
  a && a.track.name !== ((w = s(this, B).audioTrack()) == null ? void 0 : w.name) ? s(this, B).setAudioTrack(a.track) : void 0
4748
4755
  ]), s(this, L).emit("received signal", {
4749
4756
  type: "subscription changed",
@@ -4753,11 +4760,11 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
4753
4760
  }, kc = function() {
4754
4761
  return h(this, null, function* () {
4755
4762
  try {
4756
- u(this, ze, "connecting"), s(this, Q).info("Connecting..."), u(this, Js, Date.now()), s(this, Ks) || u(this, Ks, s(this, Js)), u(this, ze, "connected"), yield Promise.all([
4763
+ u(this, ze, "connecting"), s(this, Q).info("Connecting..."), u(this, Qs, Date.now()), s(this, Js) || u(this, Js, s(this, Qs)), u(this, ze, "connected"), yield Promise.all([
4757
4764
  f(this, K, Ca).call(this, s(this, B).referenceClock(), s(this, B).audio),
4758
4765
  f(this, K, Ca).call(this, s(this, B).referenceClock(), s(this, B).video),
4759
4766
  f(this, K, Ic).call(this, s(this, B).subtitles)
4760
- ]), yield s(this, B).closed(), s(this, gt).close(), s(this, Q).info("Session closed");
4767
+ ]), yield s(this, B).closed(), s(this, kt).close(), s(this, Q).info("Session closed");
4761
4768
  } catch (t) {
4762
4769
  s(this, Q).warn("Session error", t);
4763
4770
  }
@@ -4788,8 +4795,8 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
4788
4795
  const g = b.value;
4789
4796
  const E = de(g.track.namespace), z = g.track.trackObject.language;
4790
4797
  try {
4791
- for (var a = C(g), c, d, w; c = !(d = yield a.next()).done; c = !1) {
4792
- const [_, D] = d.value;
4798
+ for (var a = C(g), c, l, w; c = !(l = yield a.next()).done; c = !1) {
4799
+ const [_, D] = l.value;
4793
4800
  i !== "" && i !== E && D.mediaType() === "video" && s(this, L).emit("add event", {
4794
4801
  type: "channel switch",
4795
4802
  channelId: E,
@@ -4799,9 +4806,9 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
4799
4806
  language: z,
4800
4807
  timestamp: D.baseMediaDecodeTime() / D.timescale() * 1e3
4801
4808
  }), n = z;
4802
- const S = D.producerReferenceTime(), W = s(this, Qs).get(g.track.namespace) || 0;
4809
+ const S = D.producerReferenceTime(), W = s(this, qs).get(g.track.namespace) || 0;
4803
4810
  if (S && Date.now() - W > 1e3) {
4804
- s(this, Qs).set(g.track.namespace, Date.now());
4811
+ s(this, qs).set(g.track.namespace, Date.now());
4805
4812
  const v = t.wallclock() - S.getTime();
4806
4813
  s(this, Q).info("ti", {
4807
4814
  medaiType: D.mediaType(),
@@ -4827,11 +4834,11 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
4827
4834
  renditionId: ih(g.track.trackObject.name)
4828
4835
  });
4829
4836
  }
4830
- } catch (d) {
4831
- w = [d];
4837
+ } catch (l) {
4838
+ w = [l];
4832
4839
  } finally {
4833
4840
  try {
4834
- c && (d = a.return) && (yield d.call(a));
4841
+ c && (l = a.return) && (yield l.call(a));
4835
4842
  } finally {
4836
4843
  if (w)
4837
4844
  throw w[0];
@@ -4857,25 +4864,25 @@ function ih(r) {
4857
4864
  0
4858
4865
  );
4859
4866
  }
4860
- var Wt, He, Yn, vc;
4867
+ var $t, He, Yn, vc;
4861
4868
  class aa {
4862
4869
  constructor(t) {
4863
4870
  o(this, Yn);
4864
- o(this, Wt);
4871
+ o(this, $t);
4865
4872
  o(this, He);
4866
- u(this, Wt, t), u(this, He, f(this, Yn, vc).call(this));
4873
+ u(this, $t, t), u(this, He, f(this, Yn, vc).call(this));
4867
4874
  }
4868
4875
  catalog() {
4869
- return s(this, Wt).current();
4876
+ return s(this, $t).current();
4870
4877
  }
4871
4878
  namespace() {
4872
- return s(this, Wt).current().namespace;
4879
+ return s(this, $t).current().namespace;
4873
4880
  }
4874
4881
  updateCatalog(t) {
4875
- u(this, Wt, t);
4882
+ u(this, $t, t);
4876
4883
  }
4877
4884
  getTextTrack(t) {
4878
- return s(this, Wt).current().tracks.find((e) => e.label === t);
4885
+ return s(this, $t).current().tracks.find((e) => e.label === t);
4879
4886
  }
4880
4887
  getAudioTrack(t) {
4881
4888
  return t.codec ? s(this, He).filter((i) => !(!xc(i) || i.bitRate > t.bitRate || t.codec && i.codec !== t.codec || t.language && i.language !== t.language)).at(-1) : void 0;
@@ -4887,9 +4894,9 @@ class aa {
4887
4894
  return s(this, He);
4888
4895
  }
4889
4896
  }
4890
- Wt = new WeakMap(), He = new WeakMap(), Yn = new WeakSet(), vc = function() {
4891
- const [t, e] = s(this, Wt).value();
4892
- return Nc(t);
4897
+ $t = new WeakMap(), He = new WeakMap(), Yn = new WeakSet(), vc = function() {
4898
+ const [t, e] = s(this, $t).value();
4899
+ return Gc(t);
4893
4900
  };
4894
4901
  export {
4895
4902
  aa as CatalogObserver,