@ikonai/sdk 1.0.7 → 1.0.8

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,16 +1,16 @@
1
- const ht = {
1
+ const ct = {
2
2
  Compressed: 8
3
3
  };
4
- function ft(t) {
4
+ function Tt(t) {
5
5
  if (t.length < 8)
6
6
  throw new Error("Protocol message too short");
7
7
  return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
8
8
  }
9
- function q(t) {
10
- const e = M(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
9
+ function et(t) {
10
+ const e = F(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
11
11
  if (e.length < 27)
12
12
  throw new Error("Protocol payload too short");
13
- const s = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), i = r.getUint32(12, !0), o = r.getUint32(16, !0), _ = r.getUint32(20, !0), E = r.getUint8(24), l = r.getUint8(25), I = r.getUint8(26);
13
+ const s = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), i = r.getUint32(12, !0), o = r.getUint32(16, !0), _ = r.getUint32(20, !0), E = r.getUint8(24), l = r.getUint8(25), u = r.getUint8(26);
14
14
  if (27 + _ * 4 > e.length)
15
15
  throw new Error("Protocol header exceeds payload length");
16
16
  const N = [];
@@ -26,20 +26,20 @@ function q(t) {
26
26
  targetIds: N,
27
27
  payloadVersion: E,
28
28
  payloadType: l,
29
- flags: I
29
+ flags: u
30
30
  };
31
31
  }
32
- async function tt(t, e, r) {
33
- const s = M(t), n = q(s);
32
+ async function rt(t, e, r) {
33
+ const s = F(t), n = et(s);
34
34
  if (e !== void 0 && n.opcode !== e)
35
35
  throw new Error(`Unexpected opcode ${n.opcode}`);
36
36
  if (n.payloadType !== 8)
37
37
  throw new Error(`Unexpected payload type ${n.payloadType}`);
38
38
  const a = 27 + n.targetIds.length * 4;
39
39
  let i = s.subarray(a, n.length);
40
- return (n.flags & ht.Compressed) !== 0 && (i = await At(i)), i;
40
+ return (n.flags & ct.Compressed) !== 0 && (i = await Nt(i)), i;
41
41
  }
42
- async function At(t) {
42
+ async function Nt(t) {
43
43
  if (typeof DecompressionStream > "u")
44
44
  throw new Error("DecompressionStream not supported");
45
45
  const e = new DecompressionStream("gzip"), r = e.writable.getWriter(), s = new Uint8Array(t);
@@ -57,36 +57,36 @@ async function At(t) {
57
57
  o.set(a[E], _), _ += a[E].length;
58
58
  return o;
59
59
  }
60
- var D = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(D || {});
61
- const ct = 161, Tt = 162;
60
+ var y = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(y || {});
61
+ const St = 161, Ct = 162;
62
62
  new TextEncoder();
63
- const Nt = new TextDecoder("utf-8", { fatal: !0 });
64
- class F {
63
+ const Rt = new TextDecoder("utf-8", { fatal: !0 });
64
+ class M {
65
65
  constructor(e, r, s) {
66
66
  this.buffer = e, this.version = r, this.offset = s, this.end = e.length - 1;
67
67
  }
68
68
  offset;
69
69
  end;
70
70
  static create(e) {
71
- const r = M(e);
71
+ const r = F(e);
72
72
  if (r.length < 2)
73
73
  throw new Error("Teleport payload too short");
74
- if (r[0] !== ct || r[r.length - 1] !== Tt)
74
+ if (r[0] !== St || r[r.length - 1] !== Ct)
75
75
  throw new Error("Teleport object missing markers");
76
76
  const s = { offset: 1 }, n = A(r, s, "InvalidLength");
77
- return new F(r, n, s.offset);
77
+ return new M(r, n, s.offset);
78
78
  }
79
79
  next() {
80
80
  if (this.offset >= this.end)
81
81
  return null;
82
82
  if (this.offset + 5 > this.buffer.length)
83
83
  throw new Error("Teleport object truncated");
84
- const e = mt(this.buffer, this.offset);
84
+ const e = dt(this.buffer, this.offset);
85
85
  this.offset += 4;
86
86
  const r = this.buffer[this.offset++], s = r >> 4 & 15;
87
87
  if ((r & 15) !== 0)
88
88
  throw new Error("Teleport field flags must be zero");
89
- const n = d(s);
89
+ const n = D(s);
90
90
  let a;
91
91
  if (n >= 0)
92
92
  f(this.buffer, this.offset, n), a = this.buffer.subarray(this.offset, this.offset + n), this.offset += n;
@@ -94,7 +94,7 @@ class F {
94
94
  const i = { offset: this.offset }, o = A(this.buffer, i, "InvalidLength");
95
95
  f(this.buffer, i.offset, o), a = this.buffer.subarray(i.offset, i.offset + o), this.offset = i.offset + o;
96
96
  }
97
- return new St(e, s, a);
97
+ return new mt(e, s, a);
98
98
  }
99
99
  }
100
100
  class S {
@@ -159,38 +159,38 @@ class S {
159
159
  return this.ensureType(
160
160
  12
161
161
  /* String */
162
- ), Nt.decode(this.payload);
162
+ ), Rt.decode(this.payload);
163
163
  }
164
164
  asGuid() {
165
165
  return this.ensureType(
166
166
  14
167
167
  /* Guid */
168
- ), u.fromBytes(this.payload);
168
+ ), I.fromBytes(this.payload);
169
169
  }
170
170
  asObject() {
171
171
  return this.ensureType(
172
172
  11
173
173
  /* Object */
174
- ), F.create(this.payload);
174
+ ), M.create(this.payload);
175
175
  }
176
176
  asArray() {
177
177
  return this.ensureType(
178
178
  9
179
179
  /* Array */
180
- ), x.create(this.payload);
180
+ ), H.create(this.payload);
181
181
  }
182
182
  asDictionary() {
183
183
  return this.ensureType(
184
184
  10
185
185
  /* Dict */
186
- ), H.create(this.payload);
186
+ ), Y.create(this.payload);
187
187
  }
188
188
  ensureType(e) {
189
189
  if (this.type !== e)
190
- throw new Error(`Teleport value has type ${D[this.type]}, expected ${D[e]}`);
190
+ throw new Error(`Teleport value has type ${y[this.type]}, expected ${y[e]}`);
191
191
  }
192
192
  }
193
- class St extends S {
193
+ class mt extends S {
194
194
  constructor(e, r, s) {
195
195
  super(r, s), this.fieldId = e;
196
196
  }
@@ -198,7 +198,7 @@ class St extends S {
198
198
  return this.type === 1;
199
199
  }
200
200
  }
201
- class x {
201
+ class H {
202
202
  payload;
203
203
  elementType;
204
204
  count;
@@ -214,7 +214,7 @@ class x {
214
214
  this.count = A(e, s, "ArrayMalformed"), this.offset = s.offset;
215
215
  }
216
216
  static create(e) {
217
- return new x(M(e));
217
+ return new H(F(e));
218
218
  }
219
219
  next() {
220
220
  if (this.index >= this.count) {
@@ -235,7 +235,7 @@ class x {
235
235
  case 4:
236
236
  case 6:
237
237
  case 14: {
238
- const e = d(this.elementType);
238
+ const e = D(this.elementType);
239
239
  f(this.payload, this.offset, e);
240
240
  const r = this.payload.subarray(this.offset, this.offset + e);
241
241
  return this.offset += e, new O(this.elementType, r);
@@ -254,15 +254,15 @@ class x {
254
254
  return this.offset = e.offset + r, new O(11, s);
255
255
  }
256
256
  case 9: {
257
- const e = Y(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
257
+ const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
258
258
  return this.offset += e, new O(9, r);
259
259
  }
260
260
  case 10: {
261
- const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
261
+ const e = W(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
262
262
  return this.offset += e, new O(10, r);
263
263
  }
264
264
  default:
265
- throw new Error(`Unsupported array element type ${D[this.elementType]}`);
265
+ throw new Error(`Unsupported array element type ${y[this.elementType]}`);
266
266
  }
267
267
  }
268
268
  }
@@ -271,7 +271,7 @@ class O extends S {
271
271
  super(e, r);
272
272
  }
273
273
  }
274
- class H {
274
+ class Y {
275
275
  payload;
276
276
  keyType;
277
277
  valueType;
@@ -283,12 +283,12 @@ class H {
283
283
  throw new Error("Dictionary payload too short");
284
284
  if (this.keyType = e[0] >> 4 & 15, this.valueType = e[1] >> 4 & 15, (e[0] & 15) !== 0 || (e[1] & 15) !== 0)
285
285
  throw new Error("Dictionary key/value flags must be zero");
286
- et(this.keyType);
286
+ st(this.keyType);
287
287
  const r = { offset: 2 };
288
288
  this.count = A(e, r, "DictMalformed"), this.offset = r.offset;
289
289
  }
290
290
  static create(e) {
291
- return new H(M(e));
291
+ return new Y(F(e));
292
292
  }
293
293
  next() {
294
294
  if (this.index >= this.count) {
@@ -297,10 +297,10 @@ class H {
297
297
  return null;
298
298
  }
299
299
  const e = this.readKey(), r = this.readValue();
300
- return this.index++, new Ct(e, r);
300
+ return this.index++, new Ut(e, r);
301
301
  }
302
302
  readKey() {
303
- const e = d(this.keyType);
303
+ const e = D(this.keyType);
304
304
  if (e >= 0) {
305
305
  f(this.payload, this.offset, e);
306
306
  const r = this.payload.subarray(this.offset, this.offset + e);
@@ -330,11 +330,11 @@ class H {
330
330
  return this.offset = e.offset + r, new S(11, s);
331
331
  }
332
332
  case 9: {
333
- const e = Y(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
333
+ const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
334
334
  return this.offset += e, new S(9, r);
335
335
  }
336
336
  case 10: {
337
- const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
337
+ const e = W(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
338
338
  return this.offset += e, new S(10, r);
339
339
  }
340
340
  case 3:
@@ -346,22 +346,22 @@ class H {
346
346
  case 6:
347
347
  case 14:
348
348
  case 1: {
349
- const e = d(this.valueType);
349
+ const e = D(this.valueType);
350
350
  f(this.payload, this.offset, e);
351
351
  const r = this.payload.subarray(this.offset, this.offset + e);
352
352
  return this.offset += e, new S(this.valueType, r);
353
353
  }
354
354
  default:
355
- throw new Error(`Unsupported dictionary value type ${D[this.valueType]}`);
355
+ throw new Error(`Unsupported dictionary value type ${y[this.valueType]}`);
356
356
  }
357
357
  }
358
358
  }
359
- class Ct {
359
+ class Ut {
360
360
  constructor(e, r) {
361
361
  this.key = e, this.value = r;
362
362
  }
363
363
  }
364
- class u {
364
+ class I {
365
365
  constructor(e) {
366
366
  this.bytes = e;
367
367
  }
@@ -371,19 +371,19 @@ class u {
371
371
  const r = e.replace(/-/g, "");
372
372
  if (r.length !== 32)
373
373
  throw new Error("Guid string must be 32 hex characters");
374
- const s = new Uint8Array(16), n = u.parseHexSlice(r, 0, 8), a = u.parseHexSlice(r, 8, 4), i = u.parseHexSlice(r, 12, 4);
375
- u.writeUInt32LE(s, 0, n), u.writeUInt16LE(s, 4, a), u.writeUInt16LE(s, 6, i);
374
+ const s = new Uint8Array(16), n = I.parseHexSlice(r, 0, 8), a = I.parseHexSlice(r, 8, 4), i = I.parseHexSlice(r, 12, 4);
375
+ I.writeUInt32LE(s, 0, n), I.writeUInt16LE(s, 4, a), I.writeUInt16LE(s, 6, i);
376
376
  for (let o = 0; o < 8; o++)
377
- s[8 + o] = u.parseHexSlice(r, 16 + o * 2, 2);
378
- return new u(s);
377
+ s[8 + o] = I.parseHexSlice(r, 16 + o * 2, 2);
378
+ return new I(s);
379
379
  }
380
380
  static fromBytes(e) {
381
381
  if (e.length !== 16)
382
382
  throw new Error("Guid byte array must be 16 bytes");
383
- return new u(Uint8Array.from(e));
383
+ return new I(Uint8Array.from(e));
384
384
  }
385
385
  static createZero() {
386
- return new u(new Uint8Array(16));
386
+ return new I(new Uint8Array(16));
387
387
  }
388
388
  static createRandom() {
389
389
  const e = new Uint8Array(16), r = globalThis.crypto;
@@ -392,16 +392,16 @@ class u {
392
392
  else
393
393
  for (let s = 0; s < e.length; s++)
394
394
  e[s] = Math.floor(Math.random() * 256);
395
- return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new u(e);
395
+ return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new I(e);
396
396
  }
397
397
  toString() {
398
398
  const e = this.bytes;
399
399
  return [
400
- u.toHex(u.readUInt32LE(e, 0), 8),
401
- u.toHex(u.readUInt16LE(e, 4), 4),
402
- u.toHex(u.readUInt16LE(e, 6), 4),
403
- X(e.subarray(8, 10)),
404
- X(e.subarray(10, 16))
400
+ I.toHex(I.readUInt32LE(e, 0), 8),
401
+ I.toHex(I.readUInt16LE(e, 4), 4),
402
+ I.toHex(I.readUInt16LE(e, 6), 4),
403
+ j(e.subarray(8, 10)),
404
+ j(e.subarray(10, 16))
405
405
  ].join("-");
406
406
  }
407
407
  asBytes() {
@@ -438,7 +438,7 @@ function A(t, e, r) {
438
438
  for (; e.offset < t.length; ) {
439
439
  const i = t[e.offset++];
440
440
  if (a++, s |= (i & 127) << n, (i & 128) === 0) {
441
- if (a !== Rt(s))
441
+ if (a !== Lt(s))
442
442
  throw new Error("Teleport VarUInt is not canonical");
443
443
  return s >>> 0;
444
444
  }
@@ -447,10 +447,10 @@ function A(t, e, r) {
447
447
  }
448
448
  throw new Error(r);
449
449
  }
450
- function Rt(t) {
450
+ function Lt(t) {
451
451
  return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
452
452
  }
453
- function d(t) {
453
+ function D(t) {
454
454
  switch (t) {
455
455
  case 3:
456
456
  case 5:
@@ -470,7 +470,7 @@ function d(t) {
470
470
  return -1;
471
471
  }
472
472
  }
473
- function et(t) {
473
+ function st(t) {
474
474
  if (t === 9 || t === 11 || t === 10 || t === 1)
475
475
  throw new Error("Dictionary keys must be primitive Teleport types");
476
476
  }
@@ -478,40 +478,40 @@ function f(t, e, r) {
478
478
  if (e < 0 || r < 0 || e + r > t.length)
479
479
  throw new Error("Teleport payload exceeds bounds");
480
480
  }
481
- function mt(t, e) {
481
+ function dt(t, e) {
482
482
  return (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0;
483
483
  }
484
- function Y(t, e) {
484
+ function K(t, e) {
485
485
  if (e >= t.length)
486
486
  throw new Error("Array payload exceeds bounds");
487
487
  const r = t[e], s = r >> 4 & 15;
488
488
  if ((r & 15) !== 0)
489
489
  throw new Error("Array flags must be zero");
490
- const n = { offset: e + 1 }, a = A(t, n, "ArrayMalformed"), i = d(s);
490
+ const n = { offset: e + 1 }, a = A(t, n, "ArrayMalformed"), i = D(s);
491
491
  if (i >= 0) {
492
492
  const _ = i * a;
493
493
  return f(t, n.offset, _), n.offset + _ - e;
494
494
  }
495
495
  let o = n.offset;
496
496
  for (let _ = 0; _ < a; _++)
497
- o = p(s, t, o, "ArrayMalformed");
497
+ o = x(s, t, o, "ArrayMalformed");
498
498
  return o - e;
499
499
  }
500
- function K(t, e) {
500
+ function W(t, e) {
501
501
  if (e + 2 > t.length)
502
502
  throw new Error("Dictionary payload too short");
503
503
  const r = t[e] >> 4 & 15, s = t[e + 1] >> 4 & 15;
504
504
  if ((t[e] & 15) !== 0 || (t[e + 1] & 15) !== 0)
505
505
  throw new Error("Dictionary key/value flags must be zero");
506
- et(r);
506
+ st(r);
507
507
  const n = { offset: e + 2 }, a = A(t, n, "DictMalformed");
508
508
  let i = n.offset;
509
509
  for (let o = 0; o < a; o++)
510
- i = p(r, t, i, "DictMalformed"), i = p(s, t, i, "DictMalformed");
510
+ i = x(r, t, i, "DictMalformed"), i = x(s, t, i, "DictMalformed");
511
511
  return i - e;
512
512
  }
513
- function p(t, e, r, s) {
514
- const n = d(t);
513
+ function x(t, e, r, s) {
514
+ const n = D(t);
515
515
  if (n >= 0)
516
516
  return f(e, r, n), r + n;
517
517
  switch (t) {
@@ -525,248 +525,248 @@ function p(t, e, r, s) {
525
525
  return f(e, a.offset, i), a.offset + i;
526
526
  }
527
527
  case 9:
528
- return r + Y(e, r);
529
- case 10:
530
528
  return r + K(e, r);
529
+ case 10:
530
+ return r + W(e, r);
531
531
  default:
532
- throw new Error(`Unsupported Teleport type ${D[t]}`);
532
+ throw new Error(`Unsupported Teleport type ${y[t]}`);
533
533
  }
534
534
  }
535
- function X(t) {
535
+ function j(t) {
536
536
  return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
537
537
  }
538
- function M(t) {
538
+ function F(t) {
539
539
  return t instanceof Uint8Array ? t : new Uint8Array(t);
540
540
  }
541
- var c = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(c || {}), G = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(G || {});
542
- const Ut = 4194309, Lt = 205938238, yt = 717315017, Dt = 1594075008, dt = 2026534360, Pt = 3409001585, wt = 3466650495, Ot = 4007456593, gt = 4017217601, Ft = 4065417427, Mt = 4086360332;
543
- function Bt(t) {
541
+ var c = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(c || {}), V = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(V || {});
542
+ const yt = 4194309, Dt = 205938238, Pt = 717315017, wt = 1594075008, Ot = 2026534360, gt = 3409001585, Mt = 3466650495, Ft = 4007456593, Bt = 4017217601, bt = 4065417427, Gt = 4086360332;
543
+ function Vt(t) {
544
544
  const e = {};
545
- return rt(e), e;
545
+ return nt(e), e;
546
546
  }
547
- function rt(t) {
547
+ function nt(t) {
548
548
  return t.Samples = new Uint8Array(0), t.Epoch = 0, t.Sequence = 0, t.FrameSizeInInterleavedSamples = 0, t.TimeStampInInterleavedSamples = 0n, t.IsFirst = !1, t.IsLast = !1, t.AverageVolume = 0, t.AudioEventEstimatedDuration = 0, t.ShapeSetValues = void 0, t;
549
549
  }
550
- function bt(t, e) {
551
- const r = F.create(t);
552
- return Gt(r, e);
550
+ function pt(t, e) {
551
+ const r = M.create(t);
552
+ return vt(r, e);
553
553
  }
554
- function Gt(t, e) {
555
- const r = e ?? Bt();
556
- return rt(r), Vt(t, r), r;
554
+ function vt(t, e) {
555
+ const r = e ?? Vt();
556
+ return nt(r), kt(t, r), r;
557
557
  }
558
- function Vt(t, e) {
558
+ function kt(t, e) {
559
559
  let r;
560
560
  for (; (r = t.next()) !== null; )
561
561
  switch (r.fieldId) {
562
- case Lt: {
562
+ case Dt: {
563
563
  if (r.isNull) throw new Error();
564
564
  e.AverageVolume = r.asFloat32();
565
565
  break;
566
566
  }
567
- case yt: {
567
+ case Pt: {
568
568
  if (r.isNull) {
569
569
  e.ShapeSetValues = void 0;
570
570
  break;
571
571
  }
572
- e.ShapeSetValues = kt(r.asArray());
572
+ e.ShapeSetValues = Ht(r.asArray());
573
573
  break;
574
574
  }
575
- case Dt: {
575
+ case wt: {
576
576
  if (r.isNull) throw new Error();
577
577
  e.IsFirst = r.asBool();
578
578
  break;
579
579
  }
580
- case dt: {
580
+ case Ot: {
581
581
  if (r.isNull) throw new Error();
582
582
  e.TimeStampInInterleavedSamples = r.asUInt64();
583
583
  break;
584
584
  }
585
- case Pt: {
585
+ case gt: {
586
586
  if (r.isNull) throw new Error();
587
587
  e.Samples = r.asBinary();
588
588
  break;
589
589
  }
590
- case wt: {
590
+ case Mt: {
591
591
  if (r.isNull) throw new Error();
592
592
  e.AudioEventEstimatedDuration = r.asFloat32();
593
593
  break;
594
594
  }
595
- case Ot: {
595
+ case Ft: {
596
596
  if (r.isNull) throw new Error();
597
597
  e.FrameSizeInInterleavedSamples = r.asUInt32();
598
598
  break;
599
599
  }
600
- case gt: {
600
+ case Bt: {
601
601
  if (r.isNull) throw new Error();
602
602
  e.IsLast = r.asBool();
603
603
  break;
604
604
  }
605
- case Ft: {
605
+ case bt: {
606
606
  if (r.isNull) throw new Error();
607
607
  e.Sequence = r.asUInt32();
608
608
  break;
609
609
  }
610
- case Mt: {
610
+ case Gt: {
611
611
  if (r.isNull) throw new Error();
612
612
  e.Epoch = r.asUInt32();
613
613
  break;
614
614
  }
615
615
  }
616
616
  }
617
- async function vt(t, e) {
618
- const r = await tt(t, Ut);
619
- return bt(r, e);
617
+ async function xt(t, e) {
618
+ const r = await rt(t, yt);
619
+ return pt(r, e);
620
620
  }
621
- function kt(t) {
621
+ function Ht(t) {
622
622
  const e = [];
623
623
  let r;
624
624
  for (; (r = t.next()) !== null; )
625
- e.push(Yt(r.asObject()));
625
+ e.push(zt(r.asObject()));
626
626
  return e;
627
627
  }
628
- const pt = 1154362099, xt = 3974819915;
629
- function Ht(t) {
628
+ const Yt = 1154362099, Kt = 3974819915;
629
+ function Wt(t) {
630
630
  const e = {};
631
- return st(e), e;
631
+ return it(e), e;
632
632
  }
633
- function st(t) {
633
+ function it(t) {
634
634
  return t.SetId = 0, t.Values = [], t;
635
635
  }
636
- function Yt(t, e) {
637
- const r = e ?? Ht();
638
- return st(r), Kt(t, r), r;
636
+ function zt(t, e) {
637
+ const r = e ?? Wt();
638
+ return it(r), Xt(t, r), r;
639
639
  }
640
- function Kt(t, e) {
640
+ function Xt(t, e) {
641
641
  let r;
642
642
  for (; (r = t.next()) !== null; )
643
643
  switch (r.fieldId) {
644
- case pt: {
644
+ case Yt: {
645
645
  if (r.isNull) throw new Error();
646
646
  e.SetId = r.asUInt32();
647
647
  break;
648
648
  }
649
- case xt: {
649
+ case Kt: {
650
650
  if (r.isNull) throw new Error();
651
- e.Values = Wt(r.asArray());
651
+ e.Values = $t(r.asArray());
652
652
  break;
653
653
  }
654
654
  }
655
655
  }
656
- function Wt(t) {
656
+ function $t(t) {
657
657
  const e = [];
658
658
  let r;
659
659
  for (; (r = t.next()) !== null; )
660
660
  e.push(r.asFloat32());
661
661
  return e;
662
662
  }
663
- const zt = 4194305, Xt = 265814330, jt = 1368629611, $t = 2431514951, Qt = 2914494629, Jt = 3284746250, Zt = 4101844078;
664
- function qt(t) {
663
+ const jt = 4194305, Qt = 265814330, Jt = 1368629611, Zt = 2431514951, qt = 2914494629, te = 3284746250, ee = 4101844078;
664
+ function re(t) {
665
665
  const e = {};
666
- return nt(e), e;
666
+ return at(e), e;
667
667
  }
668
- function nt(t) {
668
+ function at(t) {
669
669
  return t.Description = "", t.Codec = c.Unknown, t.SampleRate = 0, t.Channels = 0, t.BitDepth = 0, t.ShapeSets = void 0, t;
670
670
  }
671
- function te(t, e) {
672
- const r = F.create(t);
673
- return ee(r, e);
671
+ function se(t, e) {
672
+ const r = M.create(t);
673
+ return ne(r, e);
674
674
  }
675
- function ee(t, e) {
676
- const r = e ?? qt();
677
- return nt(r), re(t, r), r;
675
+ function ne(t, e) {
676
+ const r = e ?? re();
677
+ return at(r), ie(t, r), r;
678
678
  }
679
- function re(t, e) {
679
+ function ie(t, e) {
680
680
  let r;
681
681
  for (; (r = t.next()) !== null; )
682
682
  switch (r.fieldId) {
683
- case Xt: {
683
+ case Qt: {
684
684
  if (r.isNull) {
685
685
  e.ShapeSets = void 0;
686
686
  break;
687
687
  }
688
- e.ShapeSets = ne(r.asArray());
688
+ e.ShapeSets = oe(r.asArray());
689
689
  break;
690
690
  }
691
- case jt: {
691
+ case Jt: {
692
692
  if (r.isNull) throw new Error();
693
693
  e.Description = r.asString();
694
694
  break;
695
695
  }
696
- case $t: {
696
+ case Zt: {
697
697
  if (r.isNull) throw new Error();
698
698
  e.Channels = r.asInt32();
699
699
  break;
700
700
  }
701
- case Qt: {
701
+ case qt: {
702
702
  if (r.isNull) throw new Error();
703
703
  e.BitDepth = r.asInt32();
704
704
  break;
705
705
  }
706
- case Jt: {
706
+ case te: {
707
707
  if (r.isNull) throw new Error();
708
708
  e.Codec = r.asInt32();
709
709
  break;
710
710
  }
711
- case Zt: {
711
+ case ee: {
712
712
  if (r.isNull) throw new Error();
713
713
  e.SampleRate = r.asInt32();
714
714
  break;
715
715
  }
716
716
  }
717
717
  }
718
- async function se(t, e) {
719
- const r = await tt(t, zt);
720
- return te(r, e);
718
+ async function ae(t, e) {
719
+ const r = await rt(t, jt);
720
+ return se(r, e);
721
721
  }
722
- function ne(t) {
722
+ function oe(t) {
723
723
  const e = [];
724
724
  let r;
725
725
  for (; (r = t.next()) !== null; )
726
- e.push(Ee(r.asObject()));
726
+ e.push(Ie(r.asObject()));
727
727
  return e;
728
728
  }
729
- const ie = 1107713536, ae = 1154362099, oe = 1185721362;
730
- function _e(t) {
729
+ const _e = 1107713536, Ee = 1154362099, le = 1185721362;
730
+ function ue(t) {
731
731
  const e = {};
732
- return it(e), e;
732
+ return ot(e), e;
733
733
  }
734
- function it(t) {
734
+ function ot(t) {
735
735
  return t.SetId = 0, t.Name = "", t.ShapeNames = [], t;
736
736
  }
737
- function Ee(t, e) {
738
- const r = e ?? _e();
739
- return it(r), le(t, r), r;
737
+ function Ie(t, e) {
738
+ const r = e ?? ue();
739
+ return ot(r), he(t, r), r;
740
740
  }
741
- function le(t, e) {
741
+ function he(t, e) {
742
742
  let r;
743
743
  for (; (r = t.next()) !== null; )
744
744
  switch (r.fieldId) {
745
- case ie: {
745
+ case _e: {
746
746
  if (r.isNull) throw new Error();
747
747
  e.Name = r.asString();
748
748
  break;
749
749
  }
750
- case ae: {
750
+ case Ee: {
751
751
  if (r.isNull) throw new Error();
752
752
  e.SetId = r.asUInt32();
753
753
  break;
754
754
  }
755
- case oe: {
755
+ case le: {
756
756
  if (r.isNull) throw new Error();
757
- e.ShapeNames = Ie(r.asArray());
757
+ e.ShapeNames = fe(r.asArray());
758
758
  break;
759
759
  }
760
760
  }
761
761
  }
762
- function Ie(t) {
762
+ function fe(t) {
763
763
  const e = [];
764
764
  let r;
765
765
  for (; (r = t.next()) !== null; )
766
766
  e.push(r.asString());
767
767
  return e;
768
768
  }
769
- class j {
769
+ class Q {
770
770
  static getStorageForCapacity(e, r) {
771
771
  const s = Int32Array.BYTES_PER_ELEMENT * 2, n = r.BYTES_PER_ELEMENT * e;
772
772
  return new SharedArrayBuffer(s + n);
@@ -820,41 +820,53 @@ class j {
820
820
  return s = (s + r) % this.capacity, Atomics.store(this.readWrite, 0, s), r;
821
821
  }
822
822
  }
823
- const ue = globalThis;
824
- function he() {
825
- if (typeof SharedArrayBuffer > "u" || typeof Atomics > "u" || ue.crossOriginIsolated === !1)
826
- return !1;
827
- try {
828
- new SharedArrayBuffer(1);
829
- } catch {
830
- return !1;
831
- }
832
- return !0;
833
- }
834
- let fe = 1;
835
- function Ae(t, e) {
823
+ let Ae = 1;
824
+ const ce = /* @__PURE__ */ new Map(), Te = {
825
+ 0: "DEBUG",
826
+ 1: "INFO",
827
+ 2: "WARN",
828
+ 3: "ERROR",
829
+ 4: "NONE"
830
+ };
831
+ function Ne(t, e) {
836
832
  return `[${t}] ${e}`;
837
833
  }
838
834
  function b(t, e, r, s) {
839
- if ((/* @__PURE__ */ new Date()).toISOString(), fe <= t) {
840
- const n = Ae(e, r);
835
+ const n = (/* @__PURE__ */ new Date()).toISOString(), a = Te[t], i = {
836
+ timestamp: n,
837
+ level: t,
838
+ levelName: a,
839
+ component: e,
840
+ message: r,
841
+ args: s
842
+ };
843
+ for (const [o, _] of ce) {
844
+ const E = _?.minLevel ?? 2;
845
+ if (t >= E)
846
+ try {
847
+ o(i);
848
+ } catch {
849
+ }
850
+ }
851
+ if (Ae <= t) {
852
+ const o = Ne(e, r);
841
853
  switch (t) {
842
854
  case 0:
843
- console.debug(n, ...s);
855
+ console.debug(o, ...s);
844
856
  break;
845
857
  case 1:
846
- console.info(n, ...s);
858
+ console.info(o, ...s);
847
859
  break;
848
860
  case 2:
849
- console.warn(n, ...s);
861
+ console.warn(o, ...s);
850
862
  break;
851
863
  case 3:
852
- console.error(n, ...s);
864
+ console.error(o, ...s);
853
865
  break;
854
866
  }
855
867
  }
856
868
  }
857
- function ce(t) {
869
+ function _t(t) {
858
870
  return {
859
871
  debug(e, ...r) {
860
872
  b(0, t, e, r);
@@ -870,19 +882,34 @@ function ce(t) {
870
882
  }
871
883
  };
872
884
  }
873
- const at = 48e3, ot = 2, Te = 1500, Ne = 10, $ = 80, Se = 50, Q = 64, Ce = ce("AudioPlaybackWorker"), P = (t, e) => {
885
+ const G = _t("Capabilities"), Se = globalThis;
886
+ function Ce() {
887
+ if (typeof SharedArrayBuffer > "u")
888
+ return G.debug("SharedArrayBuffer not supported: SharedArrayBuffer is undefined"), !1;
889
+ if (typeof Atomics > "u")
890
+ return G.debug("SharedArrayBuffer not supported: Atomics is undefined"), !1;
891
+ if (Se.crossOriginIsolated === !1)
892
+ return G.debug("SharedArrayBuffer not supported: crossOriginIsolated is false (missing COOP/COEP headers)"), !1;
893
+ try {
894
+ new SharedArrayBuffer(1);
895
+ } catch (t) {
896
+ return G.debug(`SharedArrayBuffer not supported: construction failed - ${t instanceof Error ? t.message : String(t)}`), !1;
897
+ }
898
+ return !0;
899
+ }
900
+ const Et = 48e3, lt = 2, Re = 1500, me = 10, J = 80, Ue = 50, Z = 64, z = _t("AudioPlaybackWorker"), P = (t, e) => {
874
901
  self.postMessage(t, e ?? []);
875
- }, Re = he();
876
- let V = "pcm", _t = !0, R = at, C = ot, y = null;
902
+ }, Le = Ce();
903
+ let p = "pcm", ut = !0, R = Et, C = lt, d = null;
877
904
  function L(t, e) {
878
905
  const r = t instanceof Error ? t : new Error(String(t));
879
906
  P({ type: "error", error: { name: r.name, message: r.message, stack: r.stack }, streamId: e });
880
907
  }
881
- function W(t) {
882
- const e = q(t);
908
+ function X(t) {
909
+ const e = et(t);
883
910
  return `${e.senderId}_${e.trackId}`;
884
911
  }
885
- class me {
912
+ class de {
886
913
  mode;
887
914
  ring = null;
888
915
  sab = void 0;
@@ -895,7 +922,7 @@ class me {
895
922
  pcmBatchOffset = 0;
896
923
  lastPcmFlushTimeMs = 0;
897
924
  constructor(e) {
898
- this.streamId = e, this.mode = "pcm", this.outputSampleRate = R, this.outputChannels = C, this.rebind(V);
925
+ this.streamId = e, this.mode = "pcm", this.outputSampleRate = R, this.outputChannels = C, this.rebind(p);
899
926
  }
900
927
  close() {
901
928
  this.closed = !0, this.pcmBatchBuffer = null, this.pcmBatchOffset = 0, this.ring = null, this.sab = void 0;
@@ -905,8 +932,8 @@ class me {
905
932
  }
906
933
  rebind(e) {
907
934
  if (!this.closed) {
908
- if (this.mode = e, e === "sab" && Re) {
909
- const r = Math.floor(Te * this.outputSampleRate * this.outputChannels / 1e3), s = j.getStorageForCapacity(r, Float32Array), n = new j(s, Float32Array);
935
+ if (this.mode = e, e === "sab" && Le) {
936
+ const r = Math.floor(Re * this.outputSampleRate * this.outputChannels / 1e3), s = Q.getStorageForCapacity(r, Float32Array), n = new Q(s, Float32Array);
910
937
  n.flush(), this.sab = s, this.ring = n;
911
938
  return;
912
939
  }
@@ -916,8 +943,8 @@ class me {
916
943
  flushPendingPcm(e) {
917
944
  if (this.closed || this.mode !== "pcm" || this.pcmBatchOffset <= 0)
918
945
  return;
919
- const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * $ / 1e3));
920
- if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >= Se))
946
+ const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * J / 1e3));
947
+ if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >= Ue))
921
948
  return;
922
949
  const a = new Float32Array(this.pcmBatchOffset);
923
950
  a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = r, P({ type: "pcm", streamId: this.streamId, pcm: a }, [a.buffer]);
@@ -939,7 +966,7 @@ class me {
939
966
  i.length > _ && (i = i.subarray(i.length - _)), n.push(i);
940
967
  return;
941
968
  }
942
- const r = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * $ / 1e3)), s = this.pcmBatchOffset + e.length;
969
+ const r = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * J / 1e3)), s = this.pcmBatchOffset + e.length;
943
970
  if (!this.pcmBatchBuffer || this.pcmBatchBuffer.length < s) {
944
971
  const n = Math.max(s, r * 2), a = new Float32Array(n);
945
972
  this.pcmBatchBuffer && this.pcmBatchOffset > 0 && a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchBuffer = a;
@@ -953,7 +980,7 @@ class me {
953
980
  this.closed || (this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = 0, this.ring?.flush());
954
981
  }
955
982
  }
956
- function Ue(t) {
983
+ function ye(t) {
957
984
  switch (t) {
958
985
  case c.Opus:
959
986
  return "opus";
@@ -964,14 +991,14 @@ function Ue(t) {
964
991
  }
965
992
  }
966
993
  let g = null;
967
- function Le(t) {
994
+ function De(t) {
968
995
  const e = new DataView(t.buffer, t.byteOffset, t.byteLength), r = Math.floor(t.byteLength / 2);
969
996
  (!g || g.length < r) && (g = new Float32Array(r));
970
997
  for (let s = 0; s < r; s++)
971
998
  g[s] = e.getInt16(s * 2, !0) / 32768;
972
999
  return g.subarray(0, r);
973
1000
  }
974
- class z {
1001
+ class $ {
975
1002
  inputSampleRate;
976
1003
  inputChannels;
977
1004
  sink;
@@ -999,22 +1026,22 @@ class z {
999
1026
  }
1000
1027
  convertAudioData(e) {
1001
1028
  const r = e.numberOfFrames, s = e.numberOfChannels, n = e.format, a = typeof n == "string" && n.includes("planar"), i = "f32-planar", o = "f32", _ = () => {
1002
- const I = new Array(s);
1029
+ const u = new Array(s);
1003
1030
  for (let h = 0; h < s; h++) {
1004
1031
  const N = new Float32Array(r);
1005
- e.copyTo(N, { planeIndex: h, format: i }), I[h] = N;
1032
+ e.copyTo(N, { planeIndex: h, format: i }), u[h] = N;
1006
1033
  }
1007
- return Ge(I, r);
1034
+ return ve(u, r);
1008
1035
  }, E = () => {
1009
- const I = new Float32Array(r * s);
1010
- return e.copyTo(I, { planeIndex: 0, format: o }), I;
1036
+ const u = new Float32Array(r * s);
1037
+ return e.copyTo(u, { planeIndex: 0, format: o }), u;
1011
1038
  };
1012
1039
  let l;
1013
1040
  if (a)
1014
1041
  try {
1015
1042
  l = _();
1016
- } catch (I) {
1017
- Ce.debug(`Failed to read planar audio data, falling back to interleaved copy: ${I}`), l = E();
1043
+ } catch (u) {
1044
+ z.debug(`Failed to read planar audio data, falling back to interleaved copy: ${u}`), l = E();
1018
1045
  }
1019
1046
  else
1020
1047
  l = E();
@@ -1026,25 +1053,25 @@ class z {
1026
1053
  let n = e, a = e.length, i = r;
1027
1054
  if (s !== R) {
1028
1055
  const o = a / i, E = Math.max(1, Math.round(o * R / s)) * i, l = this.getResampleBuffer(E);
1029
- a = ve(n, l, i, s, R), n = l;
1056
+ a = xe(n, l, i, s, R), n = l;
1030
1057
  }
1031
1058
  if (i !== C) {
1032
1059
  const _ = a / i * C, E = this.getRemixBuffer(_);
1033
- a = ke(n.subarray(0, a), E, i, C), n = E, i = C;
1060
+ a = He(n.subarray(0, a), E, i, C), n = E, i = C;
1034
1061
  }
1035
1062
  return n.subarray(0, a);
1036
1063
  }
1037
1064
  }
1038
- class ye extends z {
1065
+ class Pe extends $ {
1039
1066
  feedChunk(e) {
1040
1067
  e.isFirst && this.reset();
1041
- const r = Le(e.data);
1068
+ const r = De(e.data);
1042
1069
  this.writeConvertedPcm(r, this.inputChannels, this.inputSampleRate), e.isLast && this.reset();
1043
1070
  }
1044
1071
  close() {
1045
1072
  }
1046
1073
  }
1047
- class De extends z {
1074
+ class we extends $ {
1048
1075
  decoder;
1049
1076
  codec;
1050
1077
  constructor(e) {
@@ -1103,7 +1130,7 @@ class De extends z {
1103
1130
  }
1104
1131
  }
1105
1132
  }
1106
- class de extends z {
1133
+ class Oe extends $ {
1107
1134
  decoder = null;
1108
1135
  isReady = !1;
1109
1136
  decoderSampleRate = 48e3;
@@ -1144,15 +1171,15 @@ class de extends z {
1144
1171
  const o = a * i, _ = this.getInterleavedBuffer(o);
1145
1172
  if (i === 2) {
1146
1173
  const E = n[0], l = n[1];
1147
- for (let I = 0, h = 0; I < a; I++)
1148
- _[h++] = E[I], _[h++] = l[I];
1174
+ for (let u = 0, h = 0; u < a; u++)
1175
+ _[h++] = E[u], _[h++] = l[u];
1149
1176
  } else if (i === 1)
1150
1177
  _.set(n[0].subarray(0, a));
1151
1178
  else {
1152
1179
  let E = 0;
1153
1180
  for (let l = 0; l < a; l++)
1154
- for (let I = 0; I < i; I++)
1155
- _[E++] = n[I][l];
1181
+ for (let u = 0; u < i; u++)
1182
+ _[E++] = n[u][l];
1156
1183
  }
1157
1184
  this.writeConvertedPcm(_.subarray(0, o), i, this.decoderSampleRate), e.isLast && this.reset();
1158
1185
  } catch (r) {
@@ -1175,20 +1202,20 @@ class de extends z {
1175
1202
  }
1176
1203
  }
1177
1204
  const T = /* @__PURE__ */ new Map();
1178
- async function Pe(t) {
1205
+ async function ge(t) {
1179
1206
  if (t.closed || t.decoder)
1180
1207
  return;
1181
1208
  if (t.codec === c.RawPcm16) {
1182
- t.decoder = new ye({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
1209
+ t.decoder = new Pe({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
1183
1210
  return;
1184
1211
  }
1185
1212
  if (t.codec !== c.Opus && t.codec !== c.Mp3)
1186
1213
  throw new Error(`Unsupported audio codec: ${c[t.codec] ?? t.codec}`);
1187
- const e = Ue(t.codec);
1188
- if (_t && typeof AudioDecoder < "u" && e !== null)
1214
+ const e = ye(t.codec);
1215
+ if (ut && typeof AudioDecoder < "u" && e !== null)
1189
1216
  try {
1190
1217
  if ((await AudioDecoder.isConfigSupported({ codec: e, numberOfChannels: t.inputChannels, sampleRate: t.inputSampleRate })).supported) {
1191
- const n = new De({
1218
+ const n = new we({
1192
1219
  codec: e,
1193
1220
  inputChannels: t.inputChannels,
1194
1221
  inputSampleRate: t.inputSampleRate,
@@ -1201,10 +1228,11 @@ async function Pe(t) {
1201
1228
  t.decoder = n;
1202
1229
  return;
1203
1230
  }
1204
- } catch {
1231
+ } catch (s) {
1232
+ z.warn(`WebCodecs AudioDecoder failed, falling back to WASM: ${s instanceof Error ? s.message : String(s)}`);
1205
1233
  }
1206
1234
  if (t.codec === c.Opus) {
1207
- const s = new de({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
1235
+ const s = new Oe({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
1208
1236
  if (await s.initialise(t.inputChannels, t.inputSampleRate), t.closed) {
1209
1237
  s.close();
1210
1238
  return;
@@ -1214,7 +1242,7 @@ async function Pe(t) {
1214
1242
  }
1215
1243
  throw new Error(`No available decoder for codec: ${c[t.codec] ?? t.codec}`);
1216
1244
  }
1217
- function we(t) {
1245
+ function Me(t) {
1218
1246
  if (t.closed) {
1219
1247
  t.pendingFrames.splice(0);
1220
1248
  try {
@@ -1228,9 +1256,9 @@ function we(t) {
1228
1256
  return;
1229
1257
  const e = t.pendingFrames.splice(0);
1230
1258
  for (const r of e)
1231
- Et(t, r);
1259
+ It(t, r);
1232
1260
  }
1233
- function Et(t, e) {
1261
+ function It(t, e) {
1234
1262
  if (t.closed || !t.decoder)
1235
1263
  return;
1236
1264
  const r = e.Epoch, s = Number(e.TimeStampInInterleavedSamples), n = e.FrameSizeInInterleavedSamples;
@@ -1242,10 +1270,10 @@ function Et(t, e) {
1242
1270
  const a = performance.now();
1243
1271
  if (t.lastArrivalTimeMs > 0) {
1244
1272
  const h = a - t.lastArrivalTimeMs, N = Math.abs(h - t.expectedIntervalMs);
1245
- t.jitterMs = t.jitterMs + (N - t.jitterMs) / Ne;
1273
+ t.jitterMs = t.jitterMs + (N - t.jitterMs) / me;
1246
1274
  }
1247
1275
  t.lastArrivalTimeMs = a;
1248
- const i = t.inputSampleRate * t.inputChannels, o = R * C, _ = Math.round(s * o / i), E = Math.round(n * o / i), l = Math.round(s * 1e6 / i), I = Math.round(n * 1e6 / i);
1276
+ const i = t.inputSampleRate * t.inputChannels, o = R * C, _ = Math.round(s * o / i), E = Math.round(n * o / i), l = Math.round(s * 1e6 / i), u = Math.round(n * 1e6 / i);
1249
1277
  P({
1250
1278
  type: "frame",
1251
1279
  streamId: t.streamId,
@@ -1261,11 +1289,11 @@ function Et(t, e) {
1261
1289
  isFirst: e.IsFirst,
1262
1290
  isLast: e.IsLast,
1263
1291
  timestampUs: l,
1264
- durationUs: I
1292
+ durationUs: u
1265
1293
  });
1266
1294
  }
1267
- async function Oe(t) {
1268
- const e = W(t), r = await se(t), s = T.get(e);
1295
+ async function Fe(t) {
1296
+ const e = X(t), r = await ae(t), s = T.get(e);
1269
1297
  if (s) {
1270
1298
  s.closed = !0, s.pendingFrames.splice(0);
1271
1299
  try {
@@ -1278,7 +1306,7 @@ async function Oe(t) {
1278
1306
  }
1279
1307
  T.delete(e);
1280
1308
  }
1281
- const n = new me(e), a = {
1309
+ const n = new de(e), a = {
1282
1310
  streamId: e,
1283
1311
  codec: r.Codec,
1284
1312
  inputSampleRate: r.SampleRate,
@@ -1302,7 +1330,7 @@ async function Oe(t) {
1302
1330
  shapeSets: r.ShapeSets
1303
1331
  });
1304
1332
  }
1305
- function ge() {
1333
+ function Be() {
1306
1334
  for (const t of T.values())
1307
1335
  P({
1308
1336
  type: "streamBegin",
@@ -1311,8 +1339,8 @@ function ge() {
1311
1339
  shapeSets: t.shapeSets
1312
1340
  });
1313
1341
  }
1314
- function Fe(t) {
1315
- const e = W(t), r = T.get(e);
1342
+ function be(t) {
1343
+ const e = X(t), r = T.get(e);
1316
1344
  if (r) {
1317
1345
  r.closed = !0, r.pendingFrames.splice(0);
1318
1346
  try {
@@ -1326,45 +1354,49 @@ function Fe(t) {
1326
1354
  r.decoder = null, T.delete(e), P({ type: "streamEnd", streamId: e });
1327
1355
  }
1328
1356
  }
1329
- async function Me(t) {
1330
- const e = W(t), r = T.get(e);
1357
+ async function Ge(t) {
1358
+ const e = X(t), r = T.get(e);
1331
1359
  if (!r || r.closed)
1332
1360
  return;
1333
- const s = await vt(t);
1361
+ const s = await xt(t);
1334
1362
  if (!r.decoder) {
1335
- r.pendingFrames.length >= Q && r.pendingFrames.splice(0, r.pendingFrames.length - Q + 1), r.pendingFrames.push(s), r.initTask || (r.initTask = Pe(r).then(() => we(r)).catch((n) => {
1363
+ if (r.pendingFrames.length >= Z) {
1364
+ const n = r.pendingFrames.length - Z + 1;
1365
+ r.pendingFrames.splice(0, n), z.warn(`Dropped ${n} frames waiting for decoder, streamId=${e.substring(0, 8)}`);
1366
+ }
1367
+ r.pendingFrames.push(s), r.initTask || (r.initTask = ge(r).then(() => Me(r)).catch((n) => {
1336
1368
  r.closed || L(n, e);
1337
1369
  }));
1338
1370
  return;
1339
1371
  }
1340
- Et(r, s);
1372
+ It(r, s);
1341
1373
  }
1342
- function Be(t) {
1343
- switch (ft(t)) {
1344
- case G.AUDIO_STREAM_BEGIN:
1345
- Oe(t);
1346
- return;
1347
- case G.AUDIO_STREAM_END:
1374
+ function Ve(t) {
1375
+ switch (Tt(t)) {
1376
+ case V.AUDIO_STREAM_BEGIN:
1348
1377
  Fe(t);
1349
1378
  return;
1350
- case G.AUDIO_FRAME2:
1351
- Me(t);
1379
+ case V.AUDIO_STREAM_END:
1380
+ be(t);
1381
+ return;
1382
+ case V.AUDIO_FRAME2:
1383
+ Ge(t);
1352
1384
  return;
1353
1385
  default:
1354
1386
  return;
1355
1387
  }
1356
1388
  }
1357
- function lt() {
1358
- if (y) {
1389
+ function ht() {
1390
+ if (d) {
1359
1391
  try {
1360
- y.close();
1392
+ d.close();
1361
1393
  } catch {
1362
1394
  }
1363
- y = null;
1395
+ d = null;
1364
1396
  }
1365
1397
  }
1366
- function be() {
1367
- lt();
1398
+ function pe() {
1399
+ ht();
1368
1400
  for (const t of T.values()) {
1369
1401
  try {
1370
1402
  t.sink.drainPcm(), t.sink.close();
@@ -1380,27 +1412,27 @@ function be() {
1380
1412
  self.addEventListener("message", (t) => {
1381
1413
  const e = t.data;
1382
1414
  if (e.type === "configure") {
1383
- V = e.transport, _t = e.preferWebCodecs ?? !0, R = Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 ? e.outputSampleRate : at, C = Number.isFinite(e.outputChannels) && e.outputChannels > 0 ? e.outputChannels : ot;
1415
+ p = e.transport, ut = e.preferWebCodecs ?? !0, R = Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 ? e.outputSampleRate : Et, C = Number.isFinite(e.outputChannels) && e.outputChannels > 0 ? e.outputChannels : lt;
1384
1416
  return;
1385
1417
  }
1386
1418
  if (e.type === "attachProtocolPort") {
1387
- lt(), y = e.port, y.addEventListener("message", (r) => {
1419
+ ht(), d = e.port, d.addEventListener("message", (r) => {
1388
1420
  const s = r.data;
1389
- s?.type === "protocol" && s.message instanceof ArrayBuffer && Be(new Uint8Array(s.message));
1390
- }), y.start?.();
1421
+ s?.type === "protocol" && s.message instanceof ArrayBuffer && Ve(new Uint8Array(s.message));
1422
+ }), d.start?.();
1391
1423
  return;
1392
1424
  }
1393
1425
  if (e.type === "rebind") {
1394
- V = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (R = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (C = e.outputChannels);
1426
+ p = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (R = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (C = e.outputChannels);
1395
1427
  for (const r of T.values())
1396
- r.sink.setOutputFormat(R, C), r.sink.rebind(V);
1397
- ge();
1428
+ r.sink.setOutputFormat(R, C), r.sink.rebind(p);
1429
+ Be();
1398
1430
  return;
1399
1431
  }
1400
- e.type === "dispose" && be();
1432
+ e.type === "dispose" && pe();
1401
1433
  });
1402
1434
  let m = null;
1403
- function Ge(t, e) {
1435
+ function ve(t, e) {
1404
1436
  const r = t.length;
1405
1437
  if (r === 1)
1406
1438
  return t[0];
@@ -1417,39 +1449,39 @@ function Ge(t, e) {
1417
1449
  }
1418
1450
  return m.subarray(0, s);
1419
1451
  }
1420
- const J = 3;
1421
- function Z(t) {
1452
+ const q = 3;
1453
+ function tt(t) {
1422
1454
  if (t === 0)
1423
1455
  return 1;
1424
1456
  const e = Math.PI * t;
1425
1457
  return Math.sin(e) / e;
1426
1458
  }
1427
- function Ve(t, e) {
1428
- return t === 0 ? 1 : Math.abs(t) >= e ? 0 : Z(t) * Z(t / e);
1459
+ function ke(t, e) {
1460
+ return t === 0 ? 1 : Math.abs(t) >= e ? 0 : tt(t) * tt(t / e);
1429
1461
  }
1430
- function ve(t, e, r, s, n) {
1462
+ function xe(t, e, r, s, n) {
1431
1463
  if (s === n)
1432
1464
  return e.set(t), t.length;
1433
- const a = t.length / r, i = Math.max(1, Math.round(a * n / s)), o = s / n, _ = o > 1 ? o : 1, E = Math.ceil(J * _);
1465
+ const a = t.length / r, i = Math.max(1, Math.round(a * n / s)), o = s / n, _ = o > 1 ? o : 1, E = Math.ceil(q * _);
1434
1466
  for (let l = 0; l < r; l++)
1435
- for (let I = 0; I < i; I++) {
1436
- const h = I * o, N = Math.floor(h);
1467
+ for (let u = 0; u < i; u++) {
1468
+ const h = u * o, N = Math.floor(h);
1437
1469
  let w = 0, U = 0;
1438
1470
  for (let v = -E + 1; v <= E; v++) {
1439
1471
  const B = N + v;
1440
1472
  if (B < 0 || B >= a)
1441
1473
  continue;
1442
- const It = (h - B) / _, k = Ve(It, J);
1474
+ const ft = (h - B) / _, k = ke(ft, q);
1443
1475
  if (k !== 0) {
1444
- const ut = t[B * r + l] ?? 0;
1445
- w += ut * k, U += k;
1476
+ const At = t[B * r + l] ?? 0;
1477
+ w += At * k, U += k;
1446
1478
  }
1447
1479
  }
1448
- e[I * r + l] = U > 0 ? w / U : 0;
1480
+ e[u * r + l] = U > 0 ? w / U : 0;
1449
1481
  }
1450
1482
  return i * r;
1451
1483
  }
1452
- function ke(t, e, r, s) {
1484
+ function He(t, e, r, s) {
1453
1485
  const n = t.length / r;
1454
1486
  if (r === s)
1455
1487
  return e.set(t), t.length;