@ikonai/sdk-ui 0.0.41 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { createLogger as zt, readOpcode as Jt, readProtocolMessageHeaders as at } from "@ikonai/sdk";
1
+ import { createLogger as zt, readOpcode as Jt, readProtocolMessageHeaders as nt } from "@ikonai/sdk";
2
2
  const P = 27;
3
3
  function qt(e) {
4
- const t = G(e), r = new DataView(t.buffer, t.byteOffset, t.byteLength);
4
+ const t = G(e), s = new DataView(t.buffer, t.byteOffset, t.byteLength);
5
5
  if (t.length < P)
6
6
  throw new Error("Protocol payload too short");
7
- const s = r.getUint32(0, !0), i = r.getUint32(4, !0), n = r.getUint32(8, !0), o = r.getUint32(12, !0), a = r.getUint32(16, !0), l = r.getUint32(20, !0), u = r.getUint8(24), I = r.getUint8(25), c = r.getUint8(26);
7
+ const r = s.getUint32(0, !0), i = s.getUint32(4, !0), n = s.getUint32(8, !0), o = s.getUint32(12, !0), a = s.getUint32(16, !0), l = s.getUint32(20, !0), u = s.getUint8(24), I = s.getUint8(25), c = s.getUint8(26);
8
8
  if (P + l * 4 > t.length)
9
9
  throw new Error("Protocol header exceeds payload length");
10
10
  const E = [];
11
- let d = P;
12
- for (let _ = 0; _ < l; _++)
13
- E.push(r.getUint32(d, !0)), d += 4;
11
+ let _ = P;
12
+ for (let y = 0; y < l; y++)
13
+ E.push(s.getUint32(_, !0)), _ += 4;
14
14
  return {
15
- length: s,
15
+ length: r,
16
16
  opcode: i,
17
17
  senderId: n,
18
18
  trackId: o,
@@ -23,104 +23,104 @@ function qt(e) {
23
23
  flags: c
24
24
  };
25
25
  }
26
- function $(e, t, r) {
27
- const s = G(e), i = qt(s);
26
+ function M(e, t, s) {
27
+ const r = G(e), i = qt(r);
28
28
  if (t !== void 0 && i.opcode !== t)
29
29
  throw new Error(`Unexpected opcode ${i.opcode}`);
30
- if (r !== void 0 && i.payloadVersion !== r)
30
+ if (s !== void 0 && i.payloadVersion !== s)
31
31
  throw new Error(`Unexpected payload version ${i.payloadVersion}`);
32
32
  if (i.payloadType !== 8)
33
33
  throw new Error(`Unexpected payload type ${i.payloadType}`);
34
34
  const n = P + i.targetIds.length * 4;
35
- return s.subarray(n, i.length);
35
+ return r.subarray(n, i.length);
36
36
  }
37
- function Qt(e, t, r, s, i) {
37
+ function Qt(e, t, s, r, i) {
38
38
  const n = i?.trackId ?? 0, o = i?.sequenceId ?? 0, a = i?.flags ?? 0, l = i?.targetIds ?? [], u = i?.payloadType ?? 8, I = P + l.length * 4, c = I + t.length, h = new Uint8Array(c), E = new DataView(h.buffer);
39
- E.setUint32(0, c, !0), E.setUint32(4, e >>> 0, !0), E.setUint32(8, s >>> 0, !0), E.setUint32(12, n >>> 0, !0), E.setUint32(16, o >>> 0, !0), E.setUint32(20, l.length >>> 0, !0), E.setUint8(24, r & 255), E.setUint8(25, u & 255), E.setUint8(26, a & 255);
40
- let d = P;
41
- for (let _ = 0; _ < l.length; _++)
42
- E.setUint32(d, l[_] >>> 0, !0), d += 4;
39
+ E.setUint32(0, c, !0), E.setUint32(4, e >>> 0, !0), E.setUint32(8, r >>> 0, !0), E.setUint32(12, n >>> 0, !0), E.setUint32(16, o >>> 0, !0), E.setUint32(20, l.length >>> 0, !0), E.setUint8(24, s & 255), E.setUint8(25, u & 255), E.setUint8(26, a & 255);
40
+ let _ = P;
41
+ for (let y = 0; y < l.length; y++)
42
+ E.setUint32(_, l[y] >>> 0, !0), _ += 4;
43
43
  return h.set(t, I), h;
44
44
  }
45
- var S = /* @__PURE__ */ ((e) => (e[e.Null = 1] = "Null", e[e.Bool = 2] = "Bool", e[e.Int32 = 3] = "Int32", e[e.Int64 = 4] = "Int64", e[e.UInt32 = 5] = "UInt32", e[e.UInt64 = 6] = "UInt64", e[e.Float32 = 7] = "Float32", e[e.Float64 = 8] = "Float64", e[e.Array = 9] = "Array", e[e.Dict = 10] = "Dict", e[e.Object = 11] = "Object", e[e.String = 12] = "String", e[e.Binary = 13] = "Binary", e[e.Guid = 14] = "Guid", e))(S || {});
46
- const ct = 161, ht = 162, W = new TextEncoder(), Zt = new TextDecoder("utf-8", { fatal: !0 });
47
- class v {
45
+ var C = /* @__PURE__ */ ((e) => (e[e.Null = 1] = "Null", e[e.Bool = 2] = "Bool", e[e.Int32 = 3] = "Int32", e[e.Int64 = 4] = "Int64", e[e.UInt32 = 5] = "UInt32", e[e.UInt64 = 6] = "UInt64", e[e.Float32 = 7] = "Float32", e[e.Float64 = 8] = "Float64", e[e.Array = 9] = "Array", e[e.Dict = 10] = "Dict", e[e.Object = 11] = "Object", e[e.String = 12] = "String", e[e.Binary = 13] = "Binary", e[e.Guid = 14] = "Guid", e))(C || {});
46
+ const lt = 161, It = 162, Y = new TextEncoder(), Zt = new TextDecoder("utf-8", { fatal: !0 });
47
+ class B {
48
48
  constructor(t = 1) {
49
- this.version = t, this.buffer.writeByte(ct), this.buffer.writeVarUInt(t >>> 0);
49
+ this.version = t, this.buffer.writeByte(lt), this.buffer.writeVarUInt(t >>> 0);
50
50
  }
51
- buffer = new M();
51
+ buffer = new O();
52
52
  closed = !1;
53
53
  cached;
54
- writeInt32Field(t, r) {
55
- this.writeFixedField(t, 3, () => this.buffer.writeInt32(r | 0));
54
+ writeInt32Field(t, s) {
55
+ this.writeFixedField(t, 3, () => this.buffer.writeInt32(s | 0));
56
56
  }
57
- writeUInt32Field(t, r) {
58
- this.writeFixedField(t, 5, () => this.buffer.writeUInt32(r >>> 0));
57
+ writeUInt32Field(t, s) {
58
+ this.writeFixedField(t, 5, () => this.buffer.writeUInt32(s >>> 0));
59
59
  }
60
- writeInt64Field(t, r) {
61
- this.writeFixedField(t, 4, () => this.buffer.writeBigInt64(r));
60
+ writeInt64Field(t, s) {
61
+ this.writeFixedField(t, 4, () => this.buffer.writeBigInt64(s));
62
62
  }
63
- writeUInt64Field(t, r) {
64
- this.writeFixedField(t, 6, () => this.buffer.writeBigUInt64(r));
63
+ writeUInt64Field(t, s) {
64
+ this.writeFixedField(t, 6, () => this.buffer.writeBigUInt64(s));
65
65
  }
66
- writeFloat32Field(t, r) {
67
- this.writeFixedField(t, 7, () => this.buffer.writeFloat32(r));
66
+ writeFloat32Field(t, s) {
67
+ this.writeFixedField(t, 7, () => this.buffer.writeFloat32(s));
68
68
  }
69
- writeFloat64Field(t, r) {
70
- this.writeFixedField(t, 8, () => this.buffer.writeFloat64(r));
69
+ writeFloat64Field(t, s) {
70
+ this.writeFixedField(t, 8, () => this.buffer.writeFloat64(s));
71
71
  }
72
- writeBoolField(t, r) {
73
- this.writeFixedField(t, 2, () => this.buffer.writeByte(r ? 1 : 0));
72
+ writeBoolField(t, s) {
73
+ this.writeFixedField(t, 2, () => this.buffer.writeByte(s ? 1 : 0));
74
74
  }
75
- writeGuidField(t, r) {
76
- const s = r instanceof f ? r.asBytes() : r;
77
- if (s.length !== 16)
75
+ writeGuidField(t, s) {
76
+ const r = s instanceof d ? s.asBytes() : s;
77
+ if (r.length !== 16)
78
78
  throw new Error("Guid payload must be 16 bytes");
79
- this.writeFixedField(t, 14, () => this.buffer.writeBytes(s));
79
+ this.writeFixedField(t, 14, () => this.buffer.writeBytes(r));
80
80
  }
81
- writeStringField(t, r) {
82
- const s = W.encode(r ?? "");
83
- this.writeVariableField(t, 12, s);
81
+ writeStringField(t, s) {
82
+ const r = Y.encode(s ?? "");
83
+ this.writeVariableField(t, 12, r);
84
84
  }
85
- writeBinaryField(t, r) {
86
- this.writeVariableField(t, 13, r);
85
+ writeBinaryField(t, s) {
86
+ this.writeVariableField(t, 13, s);
87
87
  }
88
- writeObjectField(t, r, s) {
89
- const i = new v(r);
90
- s(i);
88
+ writeObjectField(t, s, r) {
89
+ const i = new B(s);
90
+ r(i);
91
91
  const n = i.finish();
92
92
  this.writeVariableField(t, 11, n);
93
93
  }
94
- writeArrayField(t, r, s) {
95
- const i = new j(r);
96
- s(i);
94
+ writeArrayField(t, s, r) {
95
+ const i = new K(s);
96
+ r(i);
97
97
  const n = i.finish();
98
98
  this.writeVariableField(t, 9, n);
99
99
  }
100
- writeDictionaryField(t, r, s, i) {
101
- const n = new Q(r, s);
100
+ writeDictionaryField(t, s, r, i) {
101
+ const n = new Q(s, r);
102
102
  i(n);
103
103
  const o = n.finish();
104
104
  this.writeVariableField(t, 10, o);
105
105
  }
106
106
  finish() {
107
- return this.closed || (this.buffer.writeByte(ht), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
107
+ return this.closed || (this.buffer.writeByte(It), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
108
108
  }
109
- writeFixedField(t, r, s) {
110
- this.writeFieldHeader(t, r, 0), s();
109
+ writeFixedField(t, s, r) {
110
+ this.writeFieldHeader(t, s, 0), r();
111
111
  }
112
- writeVariableField(t, r, s) {
113
- this.writeFieldHeader(t, r, s.length), this.buffer.writeBytes(s);
112
+ writeVariableField(t, s, r) {
113
+ this.writeFieldHeader(t, s, r.length), this.buffer.writeBytes(r);
114
114
  }
115
- writeFieldHeader(t, r, s) {
116
- this.buffer.writeUInt32(t >>> 0), this.buffer.writeByte(Y(r)), ie(r) && this.buffer.writeVarUInt(s >>> 0);
115
+ writeFieldHeader(t, s, r) {
116
+ this.buffer.writeUInt32(t >>> 0), this.buffer.writeByte(W(s)), ie(s) && this.buffer.writeVarUInt(r >>> 0);
117
117
  }
118
118
  }
119
- class j {
119
+ class K {
120
120
  constructor(t) {
121
121
  this.elementType = t;
122
122
  }
123
- payload = new M();
123
+ payload = new O();
124
124
  count = 0;
125
125
  writeInt32(t) {
126
126
  this.ensureElementType(
@@ -169,18 +169,18 @@ class j {
169
169
  14
170
170
  /* Guid */
171
171
  ), this.count++;
172
- const r = t instanceof f ? t.asBytes() : t;
173
- if (r.length !== 16)
172
+ const s = t instanceof d ? t.asBytes() : t;
173
+ if (s.length !== 16)
174
174
  throw new Error("Guid payload must be 16 bytes");
175
- this.payload.writeBytes(r);
175
+ this.payload.writeBytes(s);
176
176
  }
177
177
  writeString(t) {
178
178
  this.ensureElementType(
179
179
  12
180
180
  /* String */
181
181
  ), this.count++;
182
- const r = W.encode(t ?? "");
183
- this.payload.writeVarUInt(r.length), this.payload.writeBytes(r);
182
+ const s = Y.encode(t ?? "");
183
+ this.payload.writeVarUInt(s.length), this.payload.writeBytes(s);
184
184
  }
185
185
  writeBinary(t) {
186
186
  this.ensureElementType(
@@ -188,50 +188,50 @@ class j {
188
188
  /* Binary */
189
189
  ), this.count++, this.payload.writeVarUInt(t.length), this.payload.writeBytes(t);
190
190
  }
191
- writeObject(t, r) {
191
+ writeObject(t, s) {
192
192
  this.ensureElementType(
193
193
  11
194
194
  /* Object */
195
195
  ), this.count++;
196
- const s = new v(t);
197
- r(s);
198
- const i = s.finish();
196
+ const r = new B(t);
197
+ s(r);
198
+ const i = r.finish();
199
199
  this.payload.writeVarUInt(i.length), this.payload.writeBytes(i);
200
200
  }
201
- writeArray(t, r) {
201
+ writeArray(t, s) {
202
202
  this.ensureElementType(
203
203
  9
204
204
  /* Array */
205
205
  ), this.count++;
206
- const s = new j(t);
207
- r(s);
208
- const i = s.finish();
206
+ const r = new K(t);
207
+ s(r);
208
+ const i = r.finish();
209
209
  this.payload.writeBytes(i);
210
210
  }
211
- writeDictionary(t, r, s) {
211
+ writeDictionary(t, s, r) {
212
212
  this.ensureElementType(
213
213
  10
214
214
  /* Dict */
215
215
  ), this.count++;
216
- const i = new Q(t, r);
217
- s(i);
216
+ const i = new Q(t, s);
217
+ r(i);
218
218
  const n = i.finish();
219
219
  this.payload.writeBytes(n);
220
220
  }
221
221
  finish() {
222
- const t = new M();
223
- return t.writeByte(Y(this.elementType)), t.writeVarUInt(this.count), t.writeBytes(this.payload.toUint8Array()), t.toUint8Array();
222
+ const t = new O();
223
+ return t.writeByte(W(this.elementType)), t.writeVarUInt(this.count), t.writeBytes(this.payload.toUint8Array()), t.toUint8Array();
224
224
  }
225
225
  ensureElementType(t) {
226
226
  if (this.elementType !== t)
227
- throw new Error(`Array element type is ${S[this.elementType]}, expected ${S[t]}`);
227
+ throw new Error(`Array element type is ${C[this.elementType]}, expected ${C[t]}`);
228
228
  }
229
229
  }
230
230
  class Q {
231
- constructor(t, r) {
232
- this.keyType = t, this.valueType = r, et(t);
231
+ constructor(t, s) {
232
+ this.keyType = t, this.valueType = s, et(t);
233
233
  }
234
- payload = new M();
234
+ payload = new O();
235
235
  count = 0;
236
236
  entryOpen = !1;
237
237
  beginEntry() {
@@ -244,13 +244,13 @@ class Q {
244
244
  finish() {
245
245
  if (this.entryOpen)
246
246
  throw new Error("Dictionary entry not completed");
247
- const t = new M();
248
- return t.writeByte(Y(this.keyType)), t.writeByte(Y(this.valueType)), t.writeVarUInt(this.count), t.writeBytes(this.payload.toUint8Array()), t.toUint8Array();
247
+ const t = new O();
248
+ return t.writeByte(W(this.keyType)), t.writeByte(W(this.valueType)), t.writeVarUInt(this.count), t.writeBytes(this.payload.toUint8Array()), t.toUint8Array();
249
249
  }
250
250
  }
251
251
  class te {
252
- constructor(t, r, s, i) {
253
- this.keyType = t, this.valueType = r, this.payload = s, this.onComplete = i;
252
+ constructor(t, s, r, i) {
253
+ this.keyType = t, this.valueType = s, this.payload = r, this.onComplete = i;
254
254
  }
255
255
  keyWritten = !1;
256
256
  valueWritten = !1;
@@ -302,18 +302,18 @@ class te {
302
302
  14
303
303
  /* Guid */
304
304
  );
305
- const r = t instanceof f ? t.asBytes() : t;
306
- if (r.length !== 16)
305
+ const s = t instanceof d ? t.asBytes() : t;
306
+ if (s.length !== 16)
307
307
  throw new Error("Guid payload must be 16 bytes");
308
- this.payload.writeBytes(r), this.keyWritten = !0;
308
+ this.payload.writeBytes(s), this.keyWritten = !0;
309
309
  }
310
310
  writeKeyString(t) {
311
311
  this.ensureKeyType(
312
312
  12
313
313
  /* String */
314
314
  );
315
- const r = W.encode(t ?? "");
316
- this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.keyWritten = !0;
315
+ const s = Y.encode(t ?? "");
316
+ this.payload.writeVarUInt(s.length), this.payload.writeBytes(s), this.keyWritten = !0;
317
317
  }
318
318
  writeKeyBinary(t) {
319
319
  this.ensureKeyType(
@@ -368,10 +368,10 @@ class te {
368
368
  14
369
369
  /* Guid */
370
370
  );
371
- const r = t instanceof f ? t.asBytes() : t;
372
- if (r.length !== 16)
371
+ const s = t instanceof d ? t.asBytes() : t;
372
+ if (s.length !== 16)
373
373
  throw new Error("Guid payload must be 16 bytes");
374
- this.payload.writeBytes(r), this.valueWritten = !0;
374
+ this.payload.writeBytes(s), this.valueWritten = !0;
375
375
  }
376
376
  writeNullValue() {
377
377
  this.ensureValueType(
@@ -390,36 +390,36 @@ class te {
390
390
  12
391
391
  /* String */
392
392
  );
393
- const r = W.encode(t ?? "");
394
- this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.valueWritten = !0;
393
+ const s = Y.encode(t ?? "");
394
+ this.payload.writeVarUInt(s.length), this.payload.writeBytes(s), this.valueWritten = !0;
395
395
  }
396
- writeValueObject(t, r) {
396
+ writeValueObject(t, s) {
397
397
  this.ensureValueType(
398
398
  11
399
399
  /* Object */
400
400
  );
401
- const s = new v(t);
402
- r(s);
403
- const i = s.finish();
401
+ const r = new B(t);
402
+ s(r);
403
+ const i = r.finish();
404
404
  this.payload.writeVarUInt(i.length), this.payload.writeBytes(i), this.valueWritten = !0;
405
405
  }
406
- writeValueArray(t, r) {
406
+ writeValueArray(t, s) {
407
407
  this.ensureValueType(
408
408
  9
409
409
  /* Array */
410
410
  );
411
- const s = new j(t);
412
- r(s);
413
- const i = s.finish();
411
+ const r = new K(t);
412
+ s(r);
413
+ const i = r.finish();
414
414
  this.payload.writeBytes(i), this.valueWritten = !0;
415
415
  }
416
- writeValueDictionary(t, r, s) {
416
+ writeValueDictionary(t, s, r) {
417
417
  this.ensureValueType(
418
418
  10
419
419
  /* Dict */
420
420
  );
421
- const i = new Q(t, r);
422
- s(i);
421
+ const i = new Q(t, s);
422
+ r(i);
423
423
  const n = i.finish();
424
424
  this.payload.writeBytes(n), this.valueWritten = !0;
425
425
  }
@@ -432,27 +432,27 @@ class te {
432
432
  }
433
433
  ensureKeyType(t) {
434
434
  if (this.keyType !== t)
435
- throw new Error(`Dictionary key type is ${S[this.keyType]}, expected ${S[t]}`);
435
+ throw new Error(`Dictionary key type is ${C[this.keyType]}, expected ${C[t]}`);
436
436
  }
437
437
  ensureValueType(t) {
438
438
  if (this.valueType !== t)
439
- throw new Error(`Dictionary value type is ${S[this.valueType]}, expected ${S[t]}`);
439
+ throw new Error(`Dictionary value type is ${C[this.valueType]}, expected ${C[t]}`);
440
440
  }
441
441
  }
442
- class g {
443
- constructor(t, r, s) {
444
- this.buffer = t, this.version = r, this.offset = s, this.end = t.length - 1;
442
+ class p {
443
+ constructor(t, s, r) {
444
+ this.buffer = t, this.version = s, this.offset = r, this.end = t.length - 1;
445
445
  }
446
446
  offset;
447
447
  end;
448
448
  static create(t) {
449
- const r = G(t);
450
- if (r.length < 2)
449
+ const s = G(t);
450
+ if (s.length < 2)
451
451
  throw new Error("Teleport payload too short");
452
- if (r[0] !== ct || r[r.length - 1] !== ht)
452
+ if (s[0] !== lt || s[s.length - 1] !== It)
453
453
  throw new Error("Teleport object missing markers");
454
- const s = { offset: 1 }, i = N(r, s, "InvalidLength");
455
- return new g(r, i, s.offset);
454
+ const r = { offset: 1 }, i = U(s, r, "InvalidLength");
455
+ return new p(s, i, r.offset);
456
456
  }
457
457
  next() {
458
458
  if (this.offset >= this.end)
@@ -461,23 +461,23 @@ class g {
461
461
  throw new Error("Teleport object truncated");
462
462
  const t = ne(this.buffer, this.offset);
463
463
  this.offset += 4;
464
- const r = this.buffer[this.offset++], s = r >> 4 & 15;
465
- if ((r & 15) !== 0)
464
+ const s = this.buffer[this.offset++], r = s >> 4 & 15;
465
+ if ((s & 15) !== 0)
466
466
  throw new Error("Teleport field flags must be zero");
467
- const i = F(s);
467
+ const i = F(r);
468
468
  let n;
469
469
  if (i >= 0)
470
- y(this.buffer, this.offset, i), n = this.buffer.subarray(this.offset, this.offset + i), this.offset += i;
470
+ N(this.buffer, this.offset, i), n = this.buffer.subarray(this.offset, this.offset + i), this.offset += i;
471
471
  else {
472
- const o = { offset: this.offset }, a = N(this.buffer, o, "InvalidLength");
473
- y(this.buffer, o.offset, a), n = this.buffer.subarray(o.offset, o.offset + a), this.offset = o.offset + a;
472
+ const o = { offset: this.offset }, a = U(this.buffer, o, "InvalidLength");
473
+ N(this.buffer, o.offset, a), n = this.buffer.subarray(o.offset, o.offset + a), this.offset = o.offset + a;
474
474
  }
475
- return new ee(t, s, n);
475
+ return new ee(t, r, n);
476
476
  }
477
477
  }
478
- class m {
479
- constructor(t, r) {
480
- this.type = t, this.payload = r;
478
+ class L {
479
+ constructor(t, s) {
480
+ this.type = t, this.payload = s;
481
481
  }
482
482
  asInt32() {
483
483
  return this.ensureType(
@@ -543,13 +543,13 @@ class m {
543
543
  return this.ensureType(
544
544
  14
545
545
  /* Guid */
546
- ), f.fromBytes(this.payload);
546
+ ), d.fromBytes(this.payload);
547
547
  }
548
548
  asObject() {
549
549
  return this.ensureType(
550
550
  11
551
551
  /* Object */
552
- ), g.create(this.payload);
552
+ ), p.create(this.payload);
553
553
  }
554
554
  asArray() {
555
555
  return this.ensureType(
@@ -565,12 +565,12 @@ class m {
565
565
  }
566
566
  ensureType(t) {
567
567
  if (this.type !== t)
568
- throw new Error(`Teleport value has type ${S[this.type]}, expected ${S[t]}`);
568
+ throw new Error(`Teleport value has type ${C[this.type]}, expected ${C[t]}`);
569
569
  }
570
570
  }
571
- class ee extends m {
572
- constructor(t, r, s) {
573
- super(r, s), this.fieldId = t;
571
+ class ee extends L {
572
+ constructor(t, s, r) {
573
+ super(s, r), this.fieldId = t;
574
574
  }
575
575
  get isNull() {
576
576
  return this.type === 1;
@@ -585,11 +585,11 @@ class Z {
585
585
  constructor(t) {
586
586
  if (this.payload = t, t.length === 0)
587
587
  throw new Error("Array payload too short");
588
- const r = t[0];
589
- if (this.elementType = r >> 4 & 15, (r & 15) !== 0)
588
+ const s = t[0];
589
+ if (this.elementType = s >> 4 & 15, (s & 15) !== 0)
590
590
  throw new Error("Array flags must be zero");
591
- const s = { offset: 1 };
592
- this.count = N(t, s, "ArrayMalformed"), this.offset = s.offset;
591
+ const r = { offset: 1 };
592
+ this.count = U(t, r, "ArrayMalformed"), this.offset = r.offset;
593
593
  }
594
594
  static create(t) {
595
595
  return new Z(G(t));
@@ -614,39 +614,39 @@ class Z {
614
614
  case 6:
615
615
  case 14: {
616
616
  const t = F(this.elementType);
617
- y(this.payload, this.offset, t);
618
- const r = this.payload.subarray(this.offset, this.offset + t);
619
- return this.offset += t, new V(this.elementType, r);
617
+ N(this.payload, this.offset, t);
618
+ const s = this.payload.subarray(this.offset, this.offset + t);
619
+ return this.offset += t, new v(this.elementType, s);
620
620
  }
621
621
  case 12:
622
622
  case 13: {
623
- const t = { offset: this.offset }, r = N(this.payload, t, "ArrayMalformed");
624
- y(this.payload, t.offset, r);
625
- const s = this.payload.subarray(t.offset, t.offset + r);
626
- return this.offset = t.offset + r, new V(this.elementType, s);
623
+ const t = { offset: this.offset }, s = U(this.payload, t, "ArrayMalformed");
624
+ N(this.payload, t.offset, s);
625
+ const r = this.payload.subarray(t.offset, t.offset + s);
626
+ return this.offset = t.offset + s, new v(this.elementType, r);
627
627
  }
628
628
  case 11: {
629
- const t = { offset: this.offset }, r = N(this.payload, t, "ArrayMalformed");
630
- y(this.payload, t.offset, r);
631
- const s = this.payload.subarray(t.offset, t.offset + r);
632
- return this.offset = t.offset + r, new V(11, s);
629
+ const t = { offset: this.offset }, s = U(this.payload, t, "ArrayMalformed");
630
+ N(this.payload, t.offset, s);
631
+ const r = this.payload.subarray(t.offset, t.offset + s);
632
+ return this.offset = t.offset + s, new v(11, r);
633
633
  }
634
634
  case 9: {
635
- const t = rt(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
636
- return this.offset += t, new V(9, r);
635
+ const t = st(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
636
+ return this.offset += t, new v(9, s);
637
637
  }
638
638
  case 10: {
639
- const t = st(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
640
- return this.offset += t, new V(10, r);
639
+ const t = rt(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
640
+ return this.offset += t, new v(10, s);
641
641
  }
642
642
  default:
643
- throw new Error(`Unsupported array element type ${S[this.elementType]}`);
643
+ throw new Error(`Unsupported array element type ${C[this.elementType]}`);
644
644
  }
645
645
  }
646
646
  }
647
- class V extends m {
648
- constructor(t, r) {
649
- super(t, r);
647
+ class v extends L {
648
+ constructor(t, s) {
649
+ super(t, s);
650
650
  }
651
651
  }
652
652
  class tt {
@@ -662,8 +662,8 @@ class tt {
662
662
  if (this.keyType = t[0] >> 4 & 15, this.valueType = t[1] >> 4 & 15, (t[0] & 15) !== 0 || (t[1] & 15) !== 0)
663
663
  throw new Error("Dictionary key/value flags must be zero");
664
664
  et(this.keyType);
665
- const r = { offset: 2 };
666
- this.count = N(t, r, "DictMalformed"), this.offset = r.offset;
665
+ const s = { offset: 2 };
666
+ this.count = U(t, s, "DictMalformed"), this.offset = s.offset;
667
667
  }
668
668
  static create(t) {
669
669
  return new tt(G(t));
@@ -674,21 +674,21 @@ class tt {
674
674
  throw new Error("Dictionary payload contains trailing data");
675
675
  return null;
676
676
  }
677
- const t = this.readKey(), r = this.readValue();
678
- return this.index++, new re(t, r);
677
+ const t = this.readKey(), s = this.readValue();
678
+ return this.index++, new se(t, s);
679
679
  }
680
680
  readKey() {
681
681
  const t = F(this.keyType);
682
682
  if (t >= 0) {
683
- y(this.payload, this.offset, t);
684
- const r = this.payload.subarray(this.offset, this.offset + t);
685
- return this.offset += t, new m(this.keyType, r);
683
+ N(this.payload, this.offset, t);
684
+ const s = this.payload.subarray(this.offset, this.offset + t);
685
+ return this.offset += t, new L(this.keyType, s);
686
686
  }
687
687
  if (this.keyType === 12 || this.keyType === 13) {
688
- const r = { offset: this.offset }, s = N(this.payload, r, "DictMalformed");
689
- y(this.payload, r.offset, s);
690
- const i = this.payload.subarray(r.offset, r.offset + s);
691
- return this.offset = r.offset + s, new m(this.keyType, i);
688
+ const s = { offset: this.offset }, r = U(this.payload, s, "DictMalformed");
689
+ N(this.payload, s.offset, r);
690
+ const i = this.payload.subarray(s.offset, s.offset + r);
691
+ return this.offset = s.offset + r, new L(this.keyType, i);
692
692
  }
693
693
  throw new Error("Unsupported dictionary key type");
694
694
  }
@@ -696,24 +696,24 @@ class tt {
696
696
  switch (this.valueType) {
697
697
  case 12:
698
698
  case 13: {
699
- const t = { offset: this.offset }, r = N(this.payload, t, "DictMalformed");
700
- y(this.payload, t.offset, r);
701
- const s = this.payload.subarray(t.offset, t.offset + r);
702
- return this.offset = t.offset + r, new m(this.valueType, s);
699
+ const t = { offset: this.offset }, s = U(this.payload, t, "DictMalformed");
700
+ N(this.payload, t.offset, s);
701
+ const r = this.payload.subarray(t.offset, t.offset + s);
702
+ return this.offset = t.offset + s, new L(this.valueType, r);
703
703
  }
704
704
  case 11: {
705
- const t = { offset: this.offset }, r = N(this.payload, t, "DictMalformed");
706
- y(this.payload, t.offset, r);
707
- const s = this.payload.subarray(t.offset, t.offset + r);
708
- return this.offset = t.offset + r, new m(11, s);
705
+ const t = { offset: this.offset }, s = U(this.payload, t, "DictMalformed");
706
+ N(this.payload, t.offset, s);
707
+ const r = this.payload.subarray(t.offset, t.offset + s);
708
+ return this.offset = t.offset + s, new L(11, r);
709
709
  }
710
710
  case 9: {
711
- const t = rt(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
712
- return this.offset += t, new m(9, r);
711
+ const t = st(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
712
+ return this.offset += t, new L(9, s);
713
713
  }
714
714
  case 10: {
715
- const t = st(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
716
- return this.offset += t, new m(10, r);
715
+ const t = rt(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
716
+ return this.offset += t, new L(10, s);
717
717
  }
718
718
  case 3:
719
719
  case 5:
@@ -725,151 +725,162 @@ class tt {
725
725
  case 14:
726
726
  case 1: {
727
727
  const t = F(this.valueType);
728
- y(this.payload, this.offset, t);
729
- const r = this.payload.subarray(this.offset, this.offset + t);
730
- return this.offset += t, new m(this.valueType, r);
728
+ N(this.payload, this.offset, t);
729
+ const s = this.payload.subarray(this.offset, this.offset + t);
730
+ return this.offset += t, new L(this.valueType, s);
731
731
  }
732
732
  default:
733
- throw new Error(`Unsupported dictionary value type ${S[this.valueType]}`);
733
+ throw new Error(`Unsupported dictionary value type ${C[this.valueType]}`);
734
734
  }
735
735
  }
736
736
  }
737
- class re {
738
- constructor(t, r) {
739
- this.key = t, this.value = r;
737
+ class se {
738
+ constructor(t, s) {
739
+ this.key = t, this.value = s;
740
740
  }
741
741
  }
742
- class f {
742
+ class d {
743
743
  constructor(t) {
744
744
  this.bytes = t;
745
745
  }
746
746
  static fromString(t) {
747
747
  if (!t)
748
748
  throw new Error("Guid string is empty");
749
- const r = t.replace(/-/g, "");
750
- if (r.length !== 32)
749
+ const s = t.replace(/-/g, "");
750
+ if (s.length !== 32)
751
751
  throw new Error("Guid string must be 32 hex characters");
752
- const s = new Uint8Array(16), i = f.parseHexSlice(r, 0, 8), n = f.parseHexSlice(r, 8, 4), o = f.parseHexSlice(r, 12, 4);
753
- f.writeUInt32LE(s, 0, i), f.writeUInt16LE(s, 4, n), f.writeUInt16LE(s, 6, o);
752
+ const r = new Uint8Array(16), i = d.parseHexSlice(s, 0, 8), n = d.parseHexSlice(s, 8, 4), o = d.parseHexSlice(s, 12, 4);
753
+ d.writeUInt32LE(r, 0, i), d.writeUInt16LE(r, 4, n), d.writeUInt16LE(r, 6, o);
754
754
  for (let a = 0; a < 8; a++)
755
- s[8 + a] = f.parseHexSlice(r, 16 + a * 2, 2);
756
- return new f(s);
755
+ r[8 + a] = d.parseHexSlice(s, 16 + a * 2, 2);
756
+ return new d(r);
757
757
  }
758
758
  static fromBytes(t) {
759
759
  if (t.length !== 16)
760
760
  throw new Error("Guid byte array must be 16 bytes");
761
- return new f(Uint8Array.from(t));
761
+ return new d(Uint8Array.from(t));
762
762
  }
763
763
  static createZero() {
764
- return new f(new Uint8Array(16));
764
+ return new d(new Uint8Array(16));
765
765
  }
766
766
  static createRandom() {
767
- const t = new Uint8Array(16), r = globalThis.crypto;
768
- if (r?.getRandomValues)
769
- r.getRandomValues(t);
767
+ const t = new Uint8Array(16), s = globalThis.crypto;
768
+ if (s?.getRandomValues)
769
+ s.getRandomValues(t);
770
770
  else
771
- for (let s = 0; s < t.length; s++)
772
- t[s] = Math.floor(Math.random() * 256);
773
- return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, new f(t);
771
+ for (let r = 0; r < t.length; r++)
772
+ t[r] = Math.floor(Math.random() * 256);
773
+ return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, new d(t);
774
774
  }
775
775
  toString() {
776
776
  const t = this.bytes;
777
777
  return [
778
- f.toHex(f.readUInt32LE(t, 0), 8),
779
- f.toHex(f.readUInt16LE(t, 4), 4),
780
- f.toHex(f.readUInt16LE(t, 6), 4),
781
- lt(t.subarray(8, 10)),
782
- lt(t.subarray(10, 16))
778
+ d.toHex(d.readUInt32LE(t, 0), 8),
779
+ d.toHex(d.readUInt16LE(t, 4), 4),
780
+ d.toHex(d.readUInt16LE(t, 6), 4),
781
+ ot(t.subarray(8, 10)),
782
+ ot(t.subarray(10, 16))
783
783
  ].join("-");
784
784
  }
785
785
  asBytes() {
786
786
  return this.bytes.slice();
787
787
  }
788
- static parseHexSlice(t, r, s) {
789
- const i = t.substr(r, s), n = Number.parseInt(i, 16);
788
+ static parseHexSlice(t, s, r) {
789
+ const i = t.substr(s, r), n = Number.parseInt(i, 16);
790
790
  if (Number.isNaN(n))
791
791
  throw new Error("Guid string contains invalid characters");
792
792
  return n >>> 0;
793
793
  }
794
- static writeUInt32LE(t, r, s) {
795
- const i = s >>> 0;
796
- t[r] = i & 255, t[r + 1] = i >>> 8 & 255, t[r + 2] = i >>> 16 & 255, t[r + 3] = i >>> 24 & 255;
794
+ static writeUInt32LE(t, s, r) {
795
+ const i = r >>> 0;
796
+ t[s] = i & 255, t[s + 1] = i >>> 8 & 255, t[s + 2] = i >>> 16 & 255, t[s + 3] = i >>> 24 & 255;
797
797
  }
798
- static writeUInt16LE(t, r, s) {
799
- const i = s & 65535;
800
- t[r] = i & 255, t[r + 1] = i >>> 8 & 255;
798
+ static writeUInt16LE(t, s, r) {
799
+ const i = r & 65535;
800
+ t[s] = i & 255, t[s + 1] = i >>> 8 & 255;
801
801
  }
802
- static readUInt32LE(t, r) {
803
- return (t[r] | t[r + 1] << 8 | t[r + 2] << 16 | t[r + 3] << 24) >>> 0;
802
+ static readUInt32LE(t, s) {
803
+ return (t[s] | t[s + 1] << 8 | t[s + 2] << 16 | t[s + 3] << 24) >>> 0;
804
804
  }
805
- static readUInt16LE(t, r) {
806
- return (t[r] | t[r + 1] << 8) & 65535;
805
+ static readUInt16LE(t, s) {
806
+ return (t[s] | t[s + 1] << 8) & 65535;
807
807
  }
808
- static toHex(t, r) {
809
- return (t >>> 0).toString(16).padStart(r, "0");
808
+ static toHex(t, s) {
809
+ return (t >>> 0).toString(16).padStart(s, "0");
810
810
  }
811
811
  }
812
- class M {
813
- bytes = [];
812
+ class O {
813
+ static INITIAL_CAPACITY = 256;
814
+ buffer;
815
+ dataView;
816
+ length = 0;
817
+ constructor() {
818
+ this.buffer = new Uint8Array(O.INITIAL_CAPACITY), this.dataView = new DataView(this.buffer.buffer);
819
+ }
820
+ ensureCapacity(t) {
821
+ const s = this.length + t;
822
+ if (s <= this.buffer.length)
823
+ return;
824
+ let r = this.buffer.length;
825
+ for (; r < s; )
826
+ r *= 2;
827
+ const i = new Uint8Array(r);
828
+ i.set(this.buffer.subarray(0, this.length)), this.buffer = i, this.dataView = new DataView(this.buffer.buffer);
829
+ }
814
830
  writeByte(t) {
815
- this.bytes.push(t & 255);
831
+ this.ensureCapacity(1), this.buffer[this.length++] = t & 255;
816
832
  }
817
833
  writeBytes(t) {
818
- for (let r = 0; r < t.length; r++)
819
- this.bytes.push(t[r]);
834
+ this.ensureCapacity(t.length), this.buffer.set(t, this.length), this.length += t.length;
820
835
  }
821
836
  writeUInt32(t) {
822
- this.bytes.push(t & 255), this.bytes.push(t >>> 8 & 255), this.bytes.push(t >>> 16 & 255), this.bytes.push(t >>> 24 & 255);
837
+ this.ensureCapacity(4), this.dataView.setUint32(this.length, t >>> 0, !0), this.length += 4;
823
838
  }
824
839
  writeInt32(t) {
825
- this.writeUInt32(t | 0);
840
+ this.ensureCapacity(4), this.dataView.setInt32(this.length, t | 0, !0), this.length += 4;
826
841
  }
827
842
  writeFloat32(t) {
828
- const r = new DataView(new ArrayBuffer(4));
829
- r.setFloat32(0, t, !0), this.writeBytes(new Uint8Array(r.buffer));
843
+ this.ensureCapacity(4), this.dataView.setFloat32(this.length, t, !0), this.length += 4;
830
844
  }
831
845
  writeFloat64(t) {
832
- const r = new DataView(new ArrayBuffer(8));
833
- r.setFloat64(0, t, !0), this.writeBytes(new Uint8Array(r.buffer));
846
+ this.ensureCapacity(8), this.dataView.setFloat64(this.length, t, !0), this.length += 8;
834
847
  }
835
848
  writeBigInt64(t) {
836
- const r = new DataView(new ArrayBuffer(8));
837
- r.setBigInt64(0, t, !0), this.writeBytes(new Uint8Array(r.buffer));
849
+ this.ensureCapacity(8), this.dataView.setBigInt64(this.length, t, !0), this.length += 8;
838
850
  }
839
851
  writeBigUInt64(t) {
840
- const r = new DataView(new ArrayBuffer(8));
841
- r.setBigUint64(0, t, !0), this.writeBytes(new Uint8Array(r.buffer));
852
+ this.ensureCapacity(8), this.dataView.setBigUint64(this.length, t, !0), this.length += 8;
842
853
  }
843
854
  writeVarUInt(t) {
844
- let r = t >>> 0;
845
- for (; r >= 128; )
846
- this.bytes.push(r & 127 | 128), r >>>= 7;
847
- this.bytes.push(r & 127);
855
+ let s = t >>> 0;
856
+ for (; s >= 128; )
857
+ this.ensureCapacity(1), this.buffer[this.length++] = s & 127 | 128, s >>>= 7;
858
+ this.ensureCapacity(1), this.buffer[this.length++] = s & 127;
848
859
  }
849
860
  toUint8Array() {
850
- return Uint8Array.from(this.bytes);
861
+ return this.buffer.slice(0, this.length);
851
862
  }
852
863
  }
853
- function N(e, t, r) {
864
+ function U(e, t, s) {
854
865
  if (t.offset >= e.length)
855
- throw new Error(r);
856
- let s = 0, i = 0, n = 0;
866
+ throw new Error(s);
867
+ let r = 0, i = 0, n = 0;
857
868
  for (; t.offset < e.length; ) {
858
869
  const o = e[t.offset++];
859
- if (n++, s |= (o & 127) << i, (o & 128) === 0) {
860
- if (n !== se(s))
870
+ if (n++, r |= (o & 127) << i, (o & 128) === 0) {
871
+ if (n !== re(r))
861
872
  throw new Error("Teleport VarUInt is not canonical");
862
- return s >>> 0;
873
+ return r >>> 0;
863
874
  }
864
875
  if (i += 7, i >= 35)
865
876
  throw new Error("Teleport VarUInt exceeds 32-bit range");
866
877
  }
867
- throw new Error(r);
878
+ throw new Error(s);
868
879
  }
869
- function se(e) {
880
+ function re(e) {
870
881
  return e < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5;
871
882
  }
872
- function Y(e, t = 0) {
883
+ function W(e, t = 0) {
873
884
  if ((t & 240) !== 0)
874
885
  throw new Error("Teleport flags must fit into 4 bits");
875
886
  return (e & 15) << 4 | t & 15;
@@ -901,1092 +912,1200 @@ function et(e) {
901
912
  if (e === 9 || e === 11 || e === 10 || e === 1)
902
913
  throw new Error("Dictionary keys must be primitive Teleport types");
903
914
  }
904
- function y(e, t, r) {
905
- if (t < 0 || r < 0 || t + r > e.length)
915
+ function N(e, t, s) {
916
+ if (t < 0 || s < 0 || t + s > e.length)
906
917
  throw new Error("Teleport payload exceeds bounds");
907
918
  }
908
919
  function ne(e, t) {
909
920
  return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0;
910
921
  }
911
- function rt(e, t) {
922
+ function st(e, t) {
912
923
  if (t >= e.length)
913
924
  throw new Error("Array payload exceeds bounds");
914
- const r = e[t], s = r >> 4 & 15;
915
- if ((r & 15) !== 0)
925
+ const s = e[t], r = s >> 4 & 15;
926
+ if ((s & 15) !== 0)
916
927
  throw new Error("Array flags must be zero");
917
- const i = { offset: t + 1 }, n = N(e, i, "ArrayMalformed"), o = F(s);
928
+ const i = { offset: t + 1 }, n = U(e, i, "ArrayMalformed"), o = F(r);
918
929
  if (o >= 0) {
919
930
  const l = o * n;
920
- return y(e, i.offset, l), i.offset + l - t;
931
+ return N(e, i.offset, l), i.offset + l - t;
921
932
  }
922
933
  let a = i.offset;
923
934
  for (let l = 0; l < n; l++)
924
- a = X(s, e, a, "ArrayMalformed");
935
+ a = X(r, e, a, "ArrayMalformed");
925
936
  return a - t;
926
937
  }
927
- function st(e, t) {
938
+ function rt(e, t) {
928
939
  if (t + 2 > e.length)
929
940
  throw new Error("Dictionary payload too short");
930
- const r = e[t] >> 4 & 15, s = e[t + 1] >> 4 & 15;
941
+ const s = e[t] >> 4 & 15, r = e[t + 1] >> 4 & 15;
931
942
  if ((e[t] & 15) !== 0 || (e[t + 1] & 15) !== 0)
932
943
  throw new Error("Dictionary key/value flags must be zero");
933
- et(r);
934
- const i = { offset: t + 2 }, n = N(e, i, "DictMalformed");
944
+ et(s);
945
+ const i = { offset: t + 2 }, n = U(e, i, "DictMalformed");
935
946
  let o = i.offset;
936
947
  for (let a = 0; a < n; a++)
937
- o = X(r, e, o, "DictMalformed"), o = X(s, e, o, "DictMalformed");
948
+ o = X(s, e, o, "DictMalformed"), o = X(r, e, o, "DictMalformed");
938
949
  return o - t;
939
950
  }
940
- function X(e, t, r, s) {
951
+ function X(e, t, s, r) {
941
952
  const i = F(e);
942
953
  if (i >= 0)
943
- return y(t, r, i), r + i;
954
+ return N(t, s, i), s + i;
944
955
  switch (e) {
945
956
  case 12:
946
957
  case 13: {
947
- const n = { offset: r }, o = N(t, n, s);
948
- return y(t, n.offset, o), n.offset + o;
958
+ const n = { offset: s }, o = U(t, n, r);
959
+ return N(t, n.offset, o), n.offset + o;
949
960
  }
950
961
  case 11: {
951
- const n = { offset: r }, o = N(t, n, s);
952
- return y(t, n.offset, o), n.offset + o;
962
+ const n = { offset: s }, o = U(t, n, r);
963
+ return N(t, n.offset, o), n.offset + o;
953
964
  }
954
965
  case 9:
955
- return r + rt(t, r);
966
+ return s + st(t, s);
956
967
  case 10:
957
- return r + st(t, r);
968
+ return s + rt(t, s);
958
969
  default:
959
- throw new Error(`Unsupported Teleport type ${S[e]}`);
970
+ throw new Error(`Unsupported Teleport type ${C[e]}`);
960
971
  }
961
972
  }
962
- function lt(e) {
973
+ function ot(e) {
963
974
  return Array.from(e).map((t) => t.toString(16).padStart(2, "0")).join("");
964
975
  }
965
976
  function G(e) {
966
977
  return e instanceof Uint8Array ? e : new Uint8Array(e);
967
978
  }
968
- var ut = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Opus = 1] = "Opus", e[e.Mp3 = 2] = "Mp3", e[e.RawPcm16 = 3] = "RawPcm16", e))(ut || {}), Et = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.MobileWeb = 1] = "MobileWeb", e[e.MobileApp = 2] = "MobileApp", e[e.DesktopWeb = 3] = "DesktopWeb", e[e.DesktopApp = 4] = "DesktopApp", e))(Et || {}), _t = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Backend = 2] = "Backend", e[e.Server = 4] = "Server", e[e.Plugin = 8] = "Plugin", e[e.Browser = 16] = "Browser", e))(_t || {}), ft = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.MessagePack = 1] = "MessagePack", e[e.MemoryPack = 2] = "MemoryPack", e[e.Json = 4] = "Json", e[e.Teleport = 8] = "Teleport", e[e.All = 15] = "All", e))(ft || {}), dt = /* @__PURE__ */ ((e) => (e[e.Face = 0] = "Face", e[e.Hands = 1] = "Hands", e[e.Pose = 2] = "Pose", e[e.All = 3] = "All", e))(dt || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Machine = 1] = "Machine", e[e.Human = 2] = "Human", e))(Tt || {}), yt = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.H264 = 1] = "H264", e[e.Hevc = 2] = "Hevc", e[e.Vp8 = 3] = "Vp8", e))(yt || {}), Nt = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.DotNet = 1] = "DotNet", e[e.TypeScript = 2] = "TypeScript", e[e.Cpp = 3] = "Cpp", e))(Nt || {}), R = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", e[e.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", e[e.GROUP_CORE = 65536] = "GROUP_CORE", e[e.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", e[e.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", e[e.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", e[e.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", e[e.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", e[e.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", e[e.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", e[e.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", e[e.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", e[e.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", e[e.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", e[e.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", e[e.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", e[e.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", e[e.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", e[e.CORE_SERVER_START = 65552] = "CORE_SERVER_START", e[e.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", e[e.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", e[e.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", e[e.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", e[e.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", e[e.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", e[e.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", e[e.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", e[e.GROUP_EVENTS = 262144] = "GROUP_EVENTS", e[e.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", e[e.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", e[e.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", e[e.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", e[e.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", e[e.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", e[e.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", e[e.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", e[e.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", e[e.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", e[e.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", e[e.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", e[e.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", e[e.ACTION_CALL = 1048577] = "ACTION_CALL", e[e.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", e[e.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", e[e.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", e[e.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", e[e.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", e[e.ACTION_TAP = 1048583] = "ACTION_TAP", e[e.ACTION_PAN = 1048584] = "ACTION_PAN", e[e.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", e[e.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", e[e.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", e[e.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", e[e.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", e[e.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", e[e.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", e[e.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", e[e.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", e[e.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", e[e.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", e[e.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", e[e.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", e[e.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", e[e.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", e[e.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", e[e.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", e[e.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", e[e.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", e[e.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", e[e.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", e[e.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", e[e.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", e[e.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", e[e.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", e[e.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", e[e.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", e[e.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", e[e.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", e[e.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", e[e.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", e[e.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", e[e.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", e[e.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", e[e.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", e[e.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", e[e.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", e[e.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", e[e.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", e[e.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", e[e.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", e[e.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", e[e.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", e[e.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", e[e.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", e[e.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", e[e.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", e[e.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", e[e.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", e[e.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", e[e.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", e[e.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", e[e.ACTION_CALL2 = 1048637] = "ACTION_CALL2", e[e.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", e[e.GROUP_UI = 2097152] = "GROUP_UI", e[e.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", e[e.UI_STREAM_END = 2097154] = "UI_STREAM_END", e[e.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", e[e.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", e[e.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", e[e.UI_SECTION_END = 2097158] = "UI_SECTION_END", e[e.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", e[e.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", e[e.UI_LIST_END = 2097161] = "UI_LIST_END", e[e.UI_TEXT = 2097162] = "UI_TEXT", e[e.UI_HEADER = 2097163] = "UI_HEADER", e[e.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", e[e.UI_BUTTON = 2097165] = "UI_BUTTON", e[e.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", e[e.UI_IMAGE = 2097167] = "UI_IMAGE", e[e.UI_FILE = 2097168] = "UI_FILE", e[e.UI_BADGE = 2097169] = "UI_BADGE", e[e.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", e[e.UI_MAP = 2097171] = "UI_MAP", e[e.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", e[e.UI_ICON = 2097173] = "UI_ICON", e[e.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", e[e.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", e[e.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", e[e.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", e[e.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", e[e.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", e[e.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", e[e.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", e[e.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", e[e.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", e[e.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", e[e.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", e[e.UI_QS = 2097186] = "UI_QS", e[e.UI_ELEMENT = 2097187] = "UI_ELEMENT", e[e.UI_STYLES = 2097188] = "UI_STYLES", e[e.UI_SVG = 2097189] = "UI_SVG", e[e.UI_UPDATE = 2097190] = "UI_UPDATE", e[e.UI_INIT = 2097191] = "UI_INIT", e[e.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", e[e.GROUP_COMMON = 4128768] = "GROUP_COMMON", e[e.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", e[e.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", e[e.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", e[e.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", e[e.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", e[e.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", e[e.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", e[e.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", e[e.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", e[e.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", e[e.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", e[e.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", e[e.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", e[e.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", e[e.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", e[e.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", e[e.GROUP_SCENE = 33554432] = "GROUP_SCENE", e[e.SCENE_MESH = 33554433] = "SCENE_MESH", e[e.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", e[e.GROUP_ALL = 67043328] = "GROUP_ALL", e[e.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", e))(R || {});
969
- const oe = 1368629611, ae = 2431514951, le = 2914494629, Ie = 3284746250, ce = 4101844078;
970
- function At(e) {
979
+ var ht = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Opus = 1] = "Opus", e[e.Mp3 = 2] = "Mp3", e[e.RawPcm16 = 3] = "RawPcm16", e))(ht || {}), ct = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.MobileWeb = 1] = "MobileWeb", e[e.MobileApp = 2] = "MobileApp", e[e.DesktopWeb = 3] = "DesktopWeb", e[e.DesktopApp = 4] = "DesktopApp", e))(ct || {}), ut = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Backend = 2] = "Backend", e[e.Server = 4] = "Server", e[e.Plugin = 8] = "Plugin", e[e.Browser = 16] = "Browser", e))(ut || {}), Et = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.MessagePack = 1] = "MessagePack", e[e.MemoryPack = 2] = "MemoryPack", e[e.Json = 4] = "Json", e[e.Teleport = 8] = "Teleport", e[e.All = 15] = "All", e))(Et || {}), _t = /* @__PURE__ */ ((e) => (e[e.Face = 0] = "Face", e[e.Hands = 1] = "Hands", e[e.Pose = 2] = "Pose", e[e.All = 3] = "All", e))(_t || {}), ft = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Machine = 1] = "Machine", e[e.Human = 2] = "Human", e))(ft || {}), dt = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.H264 = 1] = "H264", e[e.Vp8 = 2] = "Vp8", e[e.Vp9 = 3] = "Vp9", e[e.Av1 = 4] = "Av1", e))(dt || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.DotNet = 1] = "DotNet", e[e.TypeScript = 2] = "TypeScript", e[e.Cpp = 3] = "Cpp", e))(Tt || {}), m = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", e[e.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", e[e.GROUP_CORE = 65536] = "GROUP_CORE", e[e.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", e[e.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", e[e.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", e[e.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", e[e.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", e[e.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", e[e.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", e[e.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", e[e.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", e[e.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", e[e.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", e[e.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", e[e.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", e[e.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", e[e.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", e[e.CORE_SERVER_START = 65552] = "CORE_SERVER_START", e[e.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", e[e.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", e[e.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", e[e.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", e[e.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", e[e.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", e[e.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", e[e.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", e[e.GROUP_EVENTS = 262144] = "GROUP_EVENTS", e[e.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", e[e.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", e[e.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", e[e.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", e[e.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", e[e.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", e[e.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", e[e.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", e[e.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", e[e.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", e[e.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", e[e.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", e[e.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", e[e.ACTION_CALL = 1048577] = "ACTION_CALL", e[e.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", e[e.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", e[e.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", e[e.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", e[e.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", e[e.ACTION_TAP = 1048583] = "ACTION_TAP", e[e.ACTION_PAN = 1048584] = "ACTION_PAN", e[e.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", e[e.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", e[e.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", e[e.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", e[e.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", e[e.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", e[e.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", e[e.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", e[e.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", e[e.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", e[e.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", e[e.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", e[e.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", e[e.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", e[e.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", e[e.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", e[e.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", e[e.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", e[e.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", e[e.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", e[e.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", e[e.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", e[e.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", e[e.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", e[e.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", e[e.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", e[e.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", e[e.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", e[e.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", e[e.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", e[e.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", e[e.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", e[e.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", e[e.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", e[e.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", e[e.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", e[e.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", e[e.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", e[e.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", e[e.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", e[e.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", e[e.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", e[e.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", e[e.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", e[e.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", e[e.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", e[e.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", e[e.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", e[e.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", e[e.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", e[e.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", e[e.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", e[e.ACTION_CALL2 = 1048637] = "ACTION_CALL2", e[e.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", e[e.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", e[e.GROUP_UI = 2097152] = "GROUP_UI", e[e.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", e[e.UI_STREAM_END = 2097154] = "UI_STREAM_END", e[e.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", e[e.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", e[e.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", e[e.UI_SECTION_END = 2097158] = "UI_SECTION_END", e[e.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", e[e.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", e[e.UI_LIST_END = 2097161] = "UI_LIST_END", e[e.UI_TEXT = 2097162] = "UI_TEXT", e[e.UI_HEADER = 2097163] = "UI_HEADER", e[e.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", e[e.UI_BUTTON = 2097165] = "UI_BUTTON", e[e.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", e[e.UI_IMAGE = 2097167] = "UI_IMAGE", e[e.UI_FILE = 2097168] = "UI_FILE", e[e.UI_BADGE = 2097169] = "UI_BADGE", e[e.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", e[e.UI_MAP = 2097171] = "UI_MAP", e[e.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", e[e.UI_ICON = 2097173] = "UI_ICON", e[e.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", e[e.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", e[e.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", e[e.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", e[e.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", e[e.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", e[e.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", e[e.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", e[e.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", e[e.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", e[e.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", e[e.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", e[e.UI_QS = 2097186] = "UI_QS", e[e.UI_ELEMENT = 2097187] = "UI_ELEMENT", e[e.UI_STYLES = 2097188] = "UI_STYLES", e[e.UI_SVG = 2097189] = "UI_SVG", e[e.UI_UPDATE = 2097190] = "UI_UPDATE", e[e.UI_INIT = 2097191] = "UI_INIT", e[e.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", e[e.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", e[e.GROUP_COMMON = 4128768] = "GROUP_COMMON", e[e.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", e[e.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", e[e.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", e[e.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", e[e.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", e[e.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", e[e.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", e[e.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", e[e.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", e[e.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", e[e.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", e[e.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", e[e.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", e[e.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", e[e.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", e[e.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", e[e.GROUP_SCENE = 33554432] = "GROUP_SCENE", e[e.SCENE_MESH = 33554433] = "SCENE_MESH", e[e.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", e[e.GROUP_ALL = 67043328] = "GROUP_ALL", e[e.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", e))(m || {});
980
+ const oe = 265814330, ae = 1368629611, le = 2431514951, Ie = 2914494629, he = 3284746250, ce = 4101844078;
981
+ function yt(e) {
971
982
  const t = {};
972
983
  return St(t), t;
973
984
  }
974
985
  function St(e) {
975
- return e.Description = "", e.Codec = ut.Unknown, e.SampleRate = 0, e.Channels = 0, e.BitDepth = 0, e;
976
- }
977
- function he(e, t) {
978
- const r = t ?? At();
979
- return St(r), ue(e, r), r;
986
+ return e.Description = "", e.Codec = ht.Unknown, e.SampleRate = 0, e.Channels = 0, e.BitDepth = 0, e.ShapeSets = void 0, e;
980
987
  }
981
988
  function ue(e, t) {
982
- let r;
983
- for (; (r = e.next()) !== null; )
984
- switch (r.fieldId) {
989
+ const s = t ?? yt();
990
+ return St(s), Ee(e, s), s;
991
+ }
992
+ function Ee(e, t) {
993
+ let s;
994
+ for (; (s = e.next()) !== null; )
995
+ switch (s.fieldId) {
985
996
  case oe: {
986
- if (r.isNull) throw new Error();
987
- t.Description = r.asString();
997
+ if (s.isNull) {
998
+ t.ShapeSets = void 0;
999
+ break;
1000
+ }
1001
+ t.ShapeSets = _e(s.asArray());
988
1002
  break;
989
1003
  }
990
1004
  case ae: {
991
- if (r.isNull) throw new Error();
992
- t.Channels = r.asInt32();
1005
+ if (s.isNull) throw new Error();
1006
+ t.Description = s.asString();
993
1007
  break;
994
1008
  }
995
1009
  case le: {
996
- if (r.isNull) throw new Error();
997
- t.BitDepth = r.asInt32();
1010
+ if (s.isNull) throw new Error();
1011
+ t.Channels = s.asInt32();
998
1012
  break;
999
1013
  }
1000
1014
  case Ie: {
1001
- if (r.isNull) throw new Error();
1002
- t.Codec = r.asInt32();
1015
+ if (s.isNull) throw new Error();
1016
+ t.BitDepth = s.asInt32();
1017
+ break;
1018
+ }
1019
+ case he: {
1020
+ if (s.isNull) throw new Error();
1021
+ t.Codec = s.asInt32();
1003
1022
  break;
1004
1023
  }
1005
1024
  case ce: {
1006
- if (r.isNull) throw new Error();
1007
- t.SampleRate = r.asInt32();
1025
+ if (s.isNull) throw new Error();
1026
+ t.SampleRate = s.asInt32();
1008
1027
  break;
1009
1028
  }
1010
1029
  }
1011
1030
  }
1012
- const Ee = 76337612, _e = 185396121, fe = 388632637, de = 417197284, Te = 469070965, ye = 470595159, Ne = 781727218, Ae = 834078886, Se = 1043273762, we = 1236999138, Ue = 1368629611, Ce = 1715899485, De = 1942830531, Re = 1999510636, me = 2079864626, Le = 2142346422, pe = 2598291686, ge = 2719718823, Oe = 2810953526, be = 2840065720, Pe = 2885165957, Fe = 3586157513, ke = 3717933110, Ve = 4062655306;
1013
- function Be(e) {
1031
+ function _e(e) {
1032
+ const t = [];
1033
+ let s;
1034
+ for (; (s = e.next()) !== null; )
1035
+ t.push(Se(s.asObject()));
1036
+ return t;
1037
+ }
1038
+ const fe = 1107713536, de = 1154362099, Te = 1185721362;
1039
+ function ye(e) {
1014
1040
  const t = {};
1015
- return wt(t), t;
1041
+ return At(t), t;
1016
1042
  }
1017
- function wt(e) {
1018
- return e.ContextType = _t.Unknown, e.UserType = Tt.Unknown, e.PayloadType = ft.Unknown, e.Description = "", e.UserId = "", e.DeviceId = "", e.ProductId = "", e.VersionId = "", e.InstallId = "", e.Locale = "", e.SessionId = -1, e.IsInternal = !1, e.IsReady = !1, e.HasInput = !1, e.ChannelLocale = "", e.EmbeddedSpaceId = "", e.AuthSessionId = "", e.ReceiveAllMessages = !1, e.PreciseJoinedAt = 0n, e.UserAgent = "", e.ClientType = Et.Unknown, e.UniqueSessionId = "", e.Parameters = /* @__PURE__ */ Object.create(null), e.SdkType = Nt.Unknown, e;
1043
+ function At(e) {
1044
+ return e.SetId = 0, e.Name = "", e.ShapeNames = [], e;
1019
1045
  }
1020
- function Me(e, t) {
1021
- const r = t ?? Be();
1022
- return wt(r), ve(e, r), r;
1046
+ function Se(e, t) {
1047
+ const s = t ?? ye();
1048
+ return At(s), Ae(e, s), s;
1023
1049
  }
1024
- function ve(e, t) {
1025
- let r;
1026
- for (; (r = e.next()) !== null; )
1027
- switch (r.fieldId) {
1028
- case Ee: {
1029
- if (r.isNull) throw new Error();
1030
- t.DeviceId = r.asString();
1031
- break;
1032
- }
1033
- case _e: {
1034
- if (r.isNull) throw new Error();
1035
- t.InstallId = r.asString();
1036
- break;
1037
- }
1050
+ function Ae(e, t) {
1051
+ let s;
1052
+ for (; (s = e.next()) !== null; )
1053
+ switch (s.fieldId) {
1038
1054
  case fe: {
1039
- if (r.isNull) throw new Error();
1040
- t.UserAgent = r.asString();
1055
+ if (s.isNull) throw new Error();
1056
+ t.Name = s.asString();
1041
1057
  break;
1042
1058
  }
1043
1059
  case de: {
1044
- if (r.isNull) throw new Error();
1045
- t.ContextType = r.asInt32();
1060
+ if (s.isNull) throw new Error();
1061
+ t.SetId = s.asUInt32();
1046
1062
  break;
1047
1063
  }
1048
1064
  case Te: {
1049
- if (r.isNull) throw new Error();
1050
- t.HasInput = r.asBool();
1051
- break;
1052
- }
1053
- case ye: {
1054
- if (r.isNull) throw new Error();
1055
- t.UserType = r.asInt32();
1056
- break;
1057
- }
1058
- case Ne: {
1059
- if (r.isNull) throw new Error();
1060
- t.UserId = r.asString();
1061
- break;
1062
- }
1063
- case Ae: {
1064
- if (r.isNull) throw new Error();
1065
- t.ProductId = r.asString();
1066
- break;
1067
- }
1068
- case Se: {
1069
- if (r.isNull) throw new Error();
1070
- t.AuthSessionId = r.asString();
1065
+ if (s.isNull) throw new Error();
1066
+ t.ShapeNames = Ne(s.asArray());
1071
1067
  break;
1072
1068
  }
1069
+ }
1070
+ }
1071
+ function Ne(e) {
1072
+ const t = [];
1073
+ let s;
1074
+ for (; (s = e.next()) !== null; )
1075
+ t.push(s.asString());
1076
+ return t;
1077
+ }
1078
+ const we = 76337612, Ue = 185396121, Ce = 388632637, De = 417197284, Re = 469070965, me = 470595159, Le = 781727218, ge = 834078886, pe = 1043273762, Oe = 1236999138, be = 1368629611, Pe = 1715899485, Fe = 1942830531, ke = 1999510636, ve = 2079864626, Ve = 2142346422, Me = 2598291686, Be = 2719718823, Ge = 2810953526, xe = 2840065720, He = 2885165957, Ye = 3586157513, We = 3717933110, Ke = 4062655306;
1079
+ function $e(e) {
1080
+ const t = {};
1081
+ return Nt(t), t;
1082
+ }
1083
+ function Nt(e) {
1084
+ return e.ContextType = ut.Unknown, e.UserType = ft.Unknown, e.PayloadType = Et.Unknown, e.Description = "", e.UserId = "", e.DeviceId = "", e.ProductId = "", e.VersionId = "", e.InstallId = "", e.Locale = "", e.SessionId = -1, e.IsInternal = !1, e.IsReady = !1, e.HasInput = !1, e.ChannelLocale = "", e.EmbeddedSpaceId = "", e.AuthSessionId = "", e.ReceiveAllMessages = !1, e.PreciseJoinedAt = 0n, e.UserAgent = "", e.ClientType = ct.Unknown, e.UniqueSessionId = "", e.Parameters = /* @__PURE__ */ Object.create(null), e.SdkType = Tt.Unknown, e;
1085
+ }
1086
+ function je(e, t) {
1087
+ const s = t ?? $e();
1088
+ return Nt(s), Xe(e, s), s;
1089
+ }
1090
+ function Xe(e, t) {
1091
+ let s;
1092
+ for (; (s = e.next()) !== null; )
1093
+ switch (s.fieldId) {
1073
1094
  case we: {
1074
- if (r.isNull) throw new Error();
1075
- t.ReceiveAllMessages = r.asBool();
1095
+ if (s.isNull) throw new Error();
1096
+ t.DeviceId = s.asString();
1076
1097
  break;
1077
1098
  }
1078
1099
  case Ue: {
1079
- if (r.isNull) throw new Error();
1080
- t.Description = r.asString();
1100
+ if (s.isNull) throw new Error();
1101
+ t.InstallId = s.asString();
1081
1102
  break;
1082
1103
  }
1083
1104
  case Ce: {
1084
- if (r.isNull) throw new Error();
1085
- t.Locale = r.asString();
1105
+ if (s.isNull) throw new Error();
1106
+ t.UserAgent = s.asString();
1086
1107
  break;
1087
1108
  }
1088
1109
  case De: {
1089
- if (r.isNull) throw new Error();
1090
- t.SdkType = r.asInt32();
1110
+ if (s.isNull) throw new Error();
1111
+ t.ContextType = s.asInt32();
1091
1112
  break;
1092
1113
  }
1093
1114
  case Re: {
1094
- if (r.isNull) throw new Error();
1095
- t.SessionId = r.asInt32();
1115
+ if (s.isNull) throw new Error();
1116
+ t.HasInput = s.asBool();
1096
1117
  break;
1097
1118
  }
1098
1119
  case me: {
1099
- if (r.isNull) throw new Error();
1100
- t.PreciseJoinedAt = r.asUInt64();
1120
+ if (s.isNull) throw new Error();
1121
+ t.UserType = s.asInt32();
1101
1122
  break;
1102
1123
  }
1103
1124
  case Le: {
1104
- if (r.isNull) throw new Error();
1105
- t.PayloadType = r.asInt32();
1125
+ if (s.isNull) throw new Error();
1126
+ t.UserId = s.asString();
1106
1127
  break;
1107
1128
  }
1108
- case pe: {
1109
- if (r.isNull) throw new Error();
1110
- t.VersionId = r.asString();
1129
+ case ge: {
1130
+ if (s.isNull) throw new Error();
1131
+ t.ProductId = s.asString();
1111
1132
  break;
1112
1133
  }
1113
- case ge: {
1114
- if (r.isNull) throw new Error();
1115
- t.UniqueSessionId = r.asString();
1134
+ case pe: {
1135
+ if (s.isNull) throw new Error();
1136
+ t.AuthSessionId = s.asString();
1116
1137
  break;
1117
1138
  }
1118
1139
  case Oe: {
1119
- if (r.isNull) throw new Error();
1120
- t.ClientType = r.asInt32();
1140
+ if (s.isNull) throw new Error();
1141
+ t.ReceiveAllMessages = s.asBool();
1121
1142
  break;
1122
1143
  }
1123
1144
  case be: {
1124
- if (r.isNull) throw new Error();
1125
- t.IsReady = r.asBool();
1145
+ if (s.isNull) throw new Error();
1146
+ t.Description = s.asString();
1126
1147
  break;
1127
1148
  }
1128
1149
  case Pe: {
1129
- if (r.isNull) throw new Error();
1130
- t.Parameters = Ge(r.asDictionary());
1150
+ if (s.isNull) throw new Error();
1151
+ t.Locale = s.asString();
1131
1152
  break;
1132
1153
  }
1133
1154
  case Fe: {
1134
- if (r.isNull) throw new Error();
1135
- t.IsInternal = r.asBool();
1155
+ if (s.isNull) throw new Error();
1156
+ t.SdkType = s.asInt32();
1136
1157
  break;
1137
1158
  }
1138
1159
  case ke: {
1139
- if (r.isNull) throw new Error();
1140
- t.ChannelLocale = r.asString();
1160
+ if (s.isNull) throw new Error();
1161
+ t.SessionId = s.asInt32();
1162
+ break;
1163
+ }
1164
+ case ve: {
1165
+ if (s.isNull) throw new Error();
1166
+ t.PreciseJoinedAt = s.asUInt64();
1141
1167
  break;
1142
1168
  }
1143
1169
  case Ve: {
1144
- if (r.isNull) throw new Error();
1145
- t.EmbeddedSpaceId = r.asString();
1170
+ if (s.isNull) throw new Error();
1171
+ t.PayloadType = s.asInt32();
1172
+ break;
1173
+ }
1174
+ case Me: {
1175
+ if (s.isNull) throw new Error();
1176
+ t.VersionId = s.asString();
1177
+ break;
1178
+ }
1179
+ case Be: {
1180
+ if (s.isNull) throw new Error();
1181
+ t.UniqueSessionId = s.asString();
1182
+ break;
1183
+ }
1184
+ case Ge: {
1185
+ if (s.isNull) throw new Error();
1186
+ t.ClientType = s.asInt32();
1187
+ break;
1188
+ }
1189
+ case xe: {
1190
+ if (s.isNull) throw new Error();
1191
+ t.IsReady = s.asBool();
1192
+ break;
1193
+ }
1194
+ case He: {
1195
+ if (s.isNull) throw new Error();
1196
+ t.Parameters = ze(s.asDictionary());
1197
+ break;
1198
+ }
1199
+ case Ye: {
1200
+ if (s.isNull) throw new Error();
1201
+ t.IsInternal = s.asBool();
1202
+ break;
1203
+ }
1204
+ case We: {
1205
+ if (s.isNull) throw new Error();
1206
+ t.ChannelLocale = s.asString();
1207
+ break;
1208
+ }
1209
+ case Ke: {
1210
+ if (s.isNull) throw new Error();
1211
+ t.EmbeddedSpaceId = s.asString();
1146
1212
  break;
1147
1213
  }
1148
1214
  }
1149
1215
  }
1150
- function Ge(e) {
1216
+ function ze(e) {
1151
1217
  const t = /* @__PURE__ */ Object.create(null);
1152
- let r;
1153
- for (; (r = e.next()) !== null; ) {
1154
- const s = r.key.asString();
1155
- t[s] = r.value.asString();
1218
+ let s;
1219
+ for (; (s = e.next()) !== null; ) {
1220
+ const r = s.key.asString();
1221
+ t[r] = s.value.asString();
1156
1222
  }
1157
1223
  return t;
1158
1224
  }
1159
- const xe = 703025676, He = 814454131, Ke = 972460562, We = 976255570, Ye = 1368629611, $e = 1479280922, je = 1533537016, Xe = 2274386296, ze = 2603556958, Je = 2885165957, qe = 3568439632;
1160
- function Qe(e) {
1225
+ const Je = 703025676, qe = 814454131, Qe = 972460562, Ze = 976255570, ts = 1368629611, es = 1479280922, ss = 1533537016, rs = 2274386296, is = 2603556958, ns = 2885165957, os = 3568439632;
1226
+ function as(e) {
1161
1227
  const t = {};
1162
- return Ut(t), t;
1228
+ return wt(t), t;
1163
1229
  }
1164
- function Ut(e) {
1165
- return e.FunctionId = f.fromBytes(new Uint8Array(16)), e.FunctionName = "", e.Parameters = [], e.ResultTypeName = "", e.IsEnumerable = !1, e.EnumerableItemTypeName = "", e.IsCancellable = !1, e.Description = "", e.LlmInlineResult = !1, e.LlmCallOnlyOnce = !1, e.RequiresInstance = !1, e;
1230
+ function wt(e) {
1231
+ return e.FunctionId = d.fromBytes(new Uint8Array(16)), e.FunctionName = "", e.Parameters = [], e.ResultTypeName = "", e.IsEnumerable = !1, e.EnumerableItemTypeName = "", e.IsCancellable = !1, e.Description = "", e.LlmInlineResult = !1, e.LlmCallOnlyOnce = !1, e.RequiresInstance = !1, e;
1166
1232
  }
1167
- function Ze(e, t) {
1168
- const r = t ?? Qe();
1169
- return Ut(r), tr(e, r), r;
1233
+ function ls(e, t) {
1234
+ const s = t ?? as();
1235
+ return wt(s), Is(e, s), s;
1170
1236
  }
1171
- function tr(e, t) {
1172
- let r;
1173
- for (; (r = e.next()) !== null; )
1174
- switch (r.fieldId) {
1175
- case xe: {
1176
- if (r.isNull) throw new Error();
1177
- t.ResultTypeName = r.asString();
1237
+ function Is(e, t) {
1238
+ let s;
1239
+ for (; (s = e.next()) !== null; )
1240
+ switch (s.fieldId) {
1241
+ case Je: {
1242
+ if (s.isNull) throw new Error();
1243
+ t.ResultTypeName = s.asString();
1178
1244
  break;
1179
1245
  }
1180
- case He: {
1181
- if (r.isNull) throw new Error();
1182
- t.FunctionName = r.asString();
1246
+ case qe: {
1247
+ if (s.isNull) throw new Error();
1248
+ t.FunctionName = s.asString();
1183
1249
  break;
1184
1250
  }
1185
- case Ke: {
1186
- if (r.isNull) throw new Error();
1187
- t.EnumerableItemTypeName = r.asString();
1251
+ case Qe: {
1252
+ if (s.isNull) throw new Error();
1253
+ t.EnumerableItemTypeName = s.asString();
1188
1254
  break;
1189
1255
  }
1190
- case We: {
1191
- if (r.isNull) throw new Error();
1192
- t.FunctionId = r.asGuid();
1256
+ case Ze: {
1257
+ if (s.isNull) throw new Error();
1258
+ t.FunctionId = s.asGuid();
1193
1259
  break;
1194
1260
  }
1195
- case Ye: {
1196
- if (r.isNull) throw new Error();
1197
- t.Description = r.asString();
1261
+ case ts: {
1262
+ if (s.isNull) throw new Error();
1263
+ t.Description = s.asString();
1198
1264
  break;
1199
1265
  }
1200
- case $e: {
1201
- if (r.isNull) throw new Error();
1202
- t.IsCancellable = r.asBool();
1266
+ case es: {
1267
+ if (s.isNull) throw new Error();
1268
+ t.IsCancellable = s.asBool();
1203
1269
  break;
1204
1270
  }
1205
- case je: {
1206
- if (r.isNull) throw new Error();
1207
- t.RequiresInstance = r.asBool();
1271
+ case ss: {
1272
+ if (s.isNull) throw new Error();
1273
+ t.RequiresInstance = s.asBool();
1208
1274
  break;
1209
1275
  }
1210
- case Xe: {
1211
- if (r.isNull) throw new Error();
1212
- t.LlmInlineResult = r.asBool();
1276
+ case rs: {
1277
+ if (s.isNull) throw new Error();
1278
+ t.LlmInlineResult = s.asBool();
1213
1279
  break;
1214
1280
  }
1215
- case ze: {
1216
- if (r.isNull) throw new Error();
1217
- t.IsEnumerable = r.asBool();
1281
+ case is: {
1282
+ if (s.isNull) throw new Error();
1283
+ t.IsEnumerable = s.asBool();
1218
1284
  break;
1219
1285
  }
1220
- case Je: {
1221
- if (r.isNull) throw new Error();
1222
- t.Parameters = er(r.asArray());
1286
+ case ns: {
1287
+ if (s.isNull) throw new Error();
1288
+ t.Parameters = hs(s.asArray());
1223
1289
  break;
1224
1290
  }
1225
- case qe: {
1226
- if (r.isNull) throw new Error();
1227
- t.LlmCallOnlyOnce = r.asBool();
1291
+ case os: {
1292
+ if (s.isNull) throw new Error();
1293
+ t.LlmCallOnlyOnce = s.asBool();
1228
1294
  break;
1229
1295
  }
1230
1296
  }
1231
1297
  }
1232
- function er(e) {
1298
+ function hs(e) {
1233
1299
  const t = [];
1234
- let r;
1235
- for (; (r = e.next()) !== null; )
1236
- t.push(ur(r.asObject()));
1300
+ let s;
1301
+ for (; (s = e.next()) !== null; )
1302
+ t.push(Ns(s.asObject()));
1237
1303
  return t;
1238
1304
  }
1239
- const rr = 607861992, sr = 894485888, ir = 972460562, nr = 1368629611, or = 1883521406, ar = 2603556958, lr = 3609695522, Ir = 4075263697, cr = 4257460908;
1240
- function hr(e) {
1305
+ const cs = 607861992, us = 894485888, Es = 972460562, _s = 1368629611, fs = 1883521406, ds = 2603556958, Ts = 3609695522, ys = 4075263697, Ss = 4257460908;
1306
+ function As(e) {
1241
1307
  const t = {};
1242
- return Ct(t), t;
1308
+ return Ut(t), t;
1243
1309
  }
1244
- function Ct(e) {
1310
+ function Ut(e) {
1245
1311
  return e.ParameterIndex = 0, e.ParameterName = "", e.TypeName = "", e.HasDefaultValue = !1, e.DefaultValueJson = "", e.DefaultValueData = new Uint8Array(0), e.IsEnumerable = !1, e.EnumerableItemTypeName = "", e.Description = "", e;
1246
1312
  }
1247
- function ur(e, t) {
1248
- const r = t ?? hr();
1249
- return Ct(r), Er(e, r), r;
1313
+ function Ns(e, t) {
1314
+ const s = t ?? As();
1315
+ return Ut(s), ws(e, s), s;
1250
1316
  }
1251
- function Er(e, t) {
1252
- let r;
1253
- for (; (r = e.next()) !== null; )
1254
- switch (r.fieldId) {
1255
- case rr: {
1256
- if (r.isNull) throw new Error();
1257
- t.HasDefaultValue = r.asBool();
1317
+ function ws(e, t) {
1318
+ let s;
1319
+ for (; (s = e.next()) !== null; )
1320
+ switch (s.fieldId) {
1321
+ case cs: {
1322
+ if (s.isNull) throw new Error();
1323
+ t.HasDefaultValue = s.asBool();
1258
1324
  break;
1259
1325
  }
1260
- case sr: {
1261
- if (r.isNull) throw new Error();
1262
- t.DefaultValueJson = r.asString();
1326
+ case us: {
1327
+ if (s.isNull) throw new Error();
1328
+ t.DefaultValueJson = s.asString();
1263
1329
  break;
1264
1330
  }
1265
- case ir: {
1266
- if (r.isNull) throw new Error();
1267
- t.EnumerableItemTypeName = r.asString();
1331
+ case Es: {
1332
+ if (s.isNull) throw new Error();
1333
+ t.EnumerableItemTypeName = s.asString();
1268
1334
  break;
1269
1335
  }
1270
- case nr: {
1271
- if (r.isNull) throw new Error();
1272
- t.Description = r.asString();
1336
+ case _s: {
1337
+ if (s.isNull) throw new Error();
1338
+ t.Description = s.asString();
1273
1339
  break;
1274
1340
  }
1275
- case or: {
1276
- if (r.isNull) throw new Error();
1277
- t.DefaultValueData = r.asBinary();
1341
+ case fs: {
1342
+ if (s.isNull) throw new Error();
1343
+ t.DefaultValueData = s.asBinary();
1278
1344
  break;
1279
1345
  }
1280
- case ar: {
1281
- if (r.isNull) throw new Error();
1282
- t.IsEnumerable = r.asBool();
1346
+ case ds: {
1347
+ if (s.isNull) throw new Error();
1348
+ t.IsEnumerable = s.asBool();
1283
1349
  break;
1284
1350
  }
1285
- case lr: {
1286
- if (r.isNull) throw new Error();
1287
- t.TypeName = r.asString();
1351
+ case Ts: {
1352
+ if (s.isNull) throw new Error();
1353
+ t.TypeName = s.asString();
1288
1354
  break;
1289
1355
  }
1290
- case Ir: {
1291
- if (r.isNull) throw new Error();
1292
- t.ParameterName = r.asString();
1356
+ case ys: {
1357
+ if (s.isNull) throw new Error();
1358
+ t.ParameterName = s.asString();
1293
1359
  break;
1294
1360
  }
1295
- case cr: {
1296
- if (r.isNull) throw new Error();
1297
- t.ParameterIndex = r.asInt32();
1361
+ case Ss: {
1362
+ if (s.isNull) throw new Error();
1363
+ t.ParameterIndex = s.asInt32();
1298
1364
  break;
1299
1365
  }
1300
1366
  }
1301
1367
  }
1302
- const _r = 3167053791, fr = 3342364356, dr = 3612929027;
1303
- function Dt(e) {
1368
+ const Us = 3167053791, Cs = 3342364356, Ds = 3612929027;
1369
+ function Ct(e) {
1304
1370
  const t = {};
1305
- return Rt(t), t;
1371
+ return Dt(t), t;
1306
1372
  }
1307
- function Rt(e) {
1308
- return e.Category = "", e.Type = dt.Face, e.FaceBlendshapes = [], e;
1373
+ function Dt(e) {
1374
+ return e.Category = "", e.Type = _t.Face, e.FaceBlendshapes = [], e;
1309
1375
  }
1310
- function Tr(e, t) {
1311
- const r = t ?? Dt();
1312
- return Rt(r), yr(e, r), r;
1376
+ function Rs(e, t) {
1377
+ const s = t ?? Ct();
1378
+ return Dt(s), ms(e, s), s;
1313
1379
  }
1314
- function yr(e, t) {
1315
- let r;
1316
- for (; (r = e.next()) !== null; )
1317
- switch (r.fieldId) {
1318
- case _r: {
1319
- if (r.isNull) throw new Error();
1320
- t.Type = r.asInt32();
1380
+ function ms(e, t) {
1381
+ let s;
1382
+ for (; (s = e.next()) !== null; )
1383
+ switch (s.fieldId) {
1384
+ case Us: {
1385
+ if (s.isNull) throw new Error();
1386
+ t.Type = s.asInt32();
1321
1387
  break;
1322
1388
  }
1323
- case fr: {
1324
- if (r.isNull) throw new Error();
1325
- t.FaceBlendshapes = Nr(r.asArray());
1389
+ case Cs: {
1390
+ if (s.isNull) throw new Error();
1391
+ t.FaceBlendshapes = Ls(s.asArray());
1326
1392
  break;
1327
1393
  }
1328
- case dr: {
1329
- if (r.isNull) throw new Error();
1330
- t.Category = r.asString();
1394
+ case Ds: {
1395
+ if (s.isNull) throw new Error();
1396
+ t.Category = s.asString();
1331
1397
  break;
1332
1398
  }
1333
1399
  }
1334
1400
  }
1335
- function Nr(e) {
1401
+ function Ls(e) {
1336
1402
  const t = [];
1337
- let r;
1338
- for (; (r = e.next()) !== null; )
1339
- t.push(r.asString());
1403
+ let s;
1404
+ for (; (s = e.next()) !== null; )
1405
+ t.push(s.asString());
1340
1406
  return t;
1341
1407
  }
1342
- const Ar = 3612929027;
1343
- function mt(e) {
1408
+ const gs = 3612929027;
1409
+ function Rt(e) {
1344
1410
  const t = {};
1345
- return Lt(t), t;
1411
+ return mt(t), t;
1346
1412
  }
1347
- function Lt(e) {
1413
+ function mt(e) {
1348
1414
  return e.Category = "", e;
1349
1415
  }
1350
- function Sr(e, t) {
1351
- const r = t ?? mt();
1352
- return Lt(r), wr(e, r), r;
1416
+ function ps(e, t) {
1417
+ const s = t ?? Rt();
1418
+ return mt(s), Os(e, s), s;
1353
1419
  }
1354
- function wr(e, t) {
1355
- let r;
1356
- for (; (r = e.next()) !== null; )
1357
- switch (r.fieldId) {
1358
- case Ar: {
1359
- if (r.isNull) throw new Error();
1360
- t.Category = r.asString();
1420
+ function Os(e, t) {
1421
+ let s;
1422
+ for (; (s = e.next()) !== null; )
1423
+ switch (s.fieldId) {
1424
+ case gs: {
1425
+ if (s.isNull) throw new Error();
1426
+ t.Category = s.asString();
1361
1427
  break;
1362
1428
  }
1363
1429
  }
1364
1430
  }
1365
- const Ur = 1368629611, Cr = 2950031986, Dr = 3284746250, Rr = 4065070594;
1366
- function pt(e) {
1431
+ const bs = 164808083, Ps = 1368629611, Fs = 2739413426, ks = 2768375929, vs = 2950031986, Vs = 3284746250, Ms = 4065070594;
1432
+ function Lt(e) {
1367
1433
  const t = {};
1368
1434
  return gt(t), t;
1369
1435
  }
1370
1436
  function gt(e) {
1371
- return e.Description = "", e.Codec = yt.H264, e.Width = 0, e.Height = 0, e;
1437
+ return e.Description = "", e.Codec = dt.H264, e.Width = 0, e.Height = 0, e.Framerate = 30, e.Bitrate = 0, e.IsHardwareAccelerated = !1, e;
1372
1438
  }
1373
- function mr(e, t) {
1374
- const r = t ?? pt();
1375
- return gt(r), Lr(e, r), r;
1439
+ function Bs(e, t) {
1440
+ const s = t ?? Lt();
1441
+ return gt(s), Gs(e, s), s;
1376
1442
  }
1377
- function Lr(e, t) {
1378
- let r;
1379
- for (; (r = e.next()) !== null; )
1380
- switch (r.fieldId) {
1381
- case Ur: {
1382
- if (r.isNull) throw new Error();
1383
- t.Description = r.asString();
1443
+ function Gs(e, t) {
1444
+ let s;
1445
+ for (; (s = e.next()) !== null; )
1446
+ switch (s.fieldId) {
1447
+ case bs: {
1448
+ if (s.isNull) throw new Error();
1449
+ t.Framerate = s.asInt32();
1384
1450
  break;
1385
1451
  }
1386
- case Cr: {
1387
- if (r.isNull) throw new Error();
1388
- t.Height = r.asInt32();
1452
+ case Ps: {
1453
+ if (s.isNull) throw new Error();
1454
+ t.Description = s.asString();
1389
1455
  break;
1390
1456
  }
1391
- case Dr: {
1392
- if (r.isNull) throw new Error();
1393
- t.Codec = r.asInt32();
1457
+ case Fs: {
1458
+ if (s.isNull) throw new Error();
1459
+ t.IsHardwareAccelerated = s.asBool();
1394
1460
  break;
1395
1461
  }
1396
- case Rr: {
1397
- if (r.isNull) throw new Error();
1398
- t.Width = r.asInt32();
1462
+ case ks: {
1463
+ if (s.isNull) throw new Error();
1464
+ t.Bitrate = s.asInt32();
1465
+ break;
1466
+ }
1467
+ case vs: {
1468
+ if (s.isNull) throw new Error();
1469
+ t.Height = s.asInt32();
1470
+ break;
1471
+ }
1472
+ case Vs: {
1473
+ if (s.isNull) throw new Error();
1474
+ t.Codec = s.asInt32();
1475
+ break;
1476
+ }
1477
+ case Ms: {
1478
+ if (s.isNull) throw new Error();
1479
+ t.Width = s.asInt32();
1399
1480
  break;
1400
1481
  }
1401
1482
  }
1402
1483
  }
1403
- const pr = 3, gr = 65539, Or = 693643444, br = 1144553441, Pr = 1497620243, Fr = 1559330978, kr = 1999510636, Vr = 2277643855, Br = 2469008121, Mr = 3219210453, vr = 3678477544, Gr = 3696445035, xr = 3707543140, Hr = 3712281496, Kr = 3823842552, Wr = 3895362455, Yr = 3897397815, $r = 4225107827;
1404
- function jr(e) {
1484
+ const xs = 3, Hs = 65539, Ys = 693643444, Ws = 1144553441, Ks = 1497620243, $s = 1559330978, js = 1999510636, Xs = 2277643855, zs = 2469008121, Js = 3219210453, qs = 3678477544, Qs = 3696445035, Zs = 3707543140, tr = 3712281496, er = 3823842552, sr = 3895362455, rr = 3897397815, ir = 4225107827;
1485
+ function nr(e) {
1405
1486
  const t = {};
1406
- return Ot(t), t;
1487
+ return pt(t), t;
1407
1488
  }
1408
- function Ot(e) {
1489
+ function pt(e) {
1409
1490
  return e.Clients = /* @__PURE__ */ Object.create(null), e.UIStreams = /* @__PURE__ */ Object.create(null), e.AudioStreams = /* @__PURE__ */ Object.create(null), e.VideoStreams = /* @__PURE__ */ Object.create(null), e.TrackingStreams = /* @__PURE__ */ Object.create(null), e.SpaceId = "", e.ChannelInstanceId = "", e.FirstUserId = "", e.ChannelUrl = "", e.ChannelId = "", e.PrimaryUserId = "", e.OrganisationName = "", e.SpaceName = "", e.ChannelName = "", e.SessionId = "", e.Functions = /* @__PURE__ */ Object.create(null), e;
1410
1491
  }
1411
- function Xr(e, t) {
1412
- const r = g.create(e);
1413
- return zr(r, t);
1492
+ function or(e, t) {
1493
+ const s = p.create(e);
1494
+ return ar(s, t);
1414
1495
  }
1415
- function zr(e, t) {
1416
- const r = t ?? jr();
1417
- return Ot(r), Jr(e, r), r;
1496
+ function ar(e, t) {
1497
+ const s = t ?? nr();
1498
+ return pt(s), lr(e, s), s;
1418
1499
  }
1419
- function Jr(e, t) {
1420
- let r;
1421
- for (; (r = e.next()) !== null; )
1422
- switch (r.fieldId) {
1423
- case Or: {
1424
- if (r.isNull) throw new Error();
1425
- t.FirstUserId = r.asString();
1500
+ function lr(e, t) {
1501
+ let s;
1502
+ for (; (s = e.next()) !== null; )
1503
+ switch (s.fieldId) {
1504
+ case Ys: {
1505
+ if (s.isNull) throw new Error();
1506
+ t.FirstUserId = s.asString();
1426
1507
  break;
1427
1508
  }
1428
- case br: {
1429
- if (r.isNull) throw new Error();
1430
- t.Clients = Qr(r.asDictionary());
1509
+ case Ws: {
1510
+ if (s.isNull) throw new Error();
1511
+ t.Clients = hr(s.asDictionary());
1431
1512
  break;
1432
1513
  }
1433
- case Pr: {
1434
- if (r.isNull) throw new Error();
1435
- t.TrackingStreams = Zr(r.asDictionary());
1514
+ case Ks: {
1515
+ if (s.isNull) throw new Error();
1516
+ t.TrackingStreams = cr(s.asDictionary());
1436
1517
  break;
1437
1518
  }
1438
- case Fr: {
1439
- if (r.isNull) throw new Error();
1440
- t.ChannelId = r.asString();
1519
+ case $s: {
1520
+ if (s.isNull) throw new Error();
1521
+ t.ChannelId = s.asString();
1441
1522
  break;
1442
1523
  }
1443
- case kr: {
1444
- if (r.isNull) throw new Error();
1445
- t.SessionId = r.asString();
1524
+ case js: {
1525
+ if (s.isNull) throw new Error();
1526
+ t.SessionId = s.asString();
1446
1527
  break;
1447
1528
  }
1448
- case Vr: {
1449
- if (r.isNull) throw new Error();
1450
- t.ChannelUrl = r.asString();
1529
+ case Xs: {
1530
+ if (s.isNull) throw new Error();
1531
+ t.ChannelUrl = s.asString();
1451
1532
  break;
1452
1533
  }
1453
- case Br: {
1454
- if (r.isNull) throw new Error();
1455
- t.ChannelName = r.asString();
1534
+ case zs: {
1535
+ if (s.isNull) throw new Error();
1536
+ t.ChannelName = s.asString();
1456
1537
  break;
1457
1538
  }
1458
- case Mr: {
1459
- if (r.isNull) throw new Error();
1460
- t.OrganisationName = r.asString();
1539
+ case Js: {
1540
+ if (s.isNull) throw new Error();
1541
+ t.OrganisationName = s.asString();
1461
1542
  break;
1462
1543
  }
1463
- case vr: {
1464
- if (r.isNull) throw new Error();
1465
- t.Functions = ts(r.asDictionary());
1544
+ case qs: {
1545
+ if (s.isNull) throw new Error();
1546
+ t.Functions = ur(s.asDictionary());
1466
1547
  break;
1467
1548
  }
1468
- case Gr: {
1469
- if (r.isNull) throw new Error();
1470
- t.UIStreams = es(r.asDictionary());
1549
+ case Qs: {
1550
+ if (s.isNull) throw new Error();
1551
+ t.UIStreams = Er(s.asDictionary());
1471
1552
  break;
1472
1553
  }
1473
- case xr: {
1474
- if (r.isNull) throw new Error();
1475
- t.SpaceId = r.asString();
1554
+ case Zs: {
1555
+ if (s.isNull) throw new Error();
1556
+ t.SpaceId = s.asString();
1476
1557
  break;
1477
1558
  }
1478
- case Hr: {
1479
- if (r.isNull) throw new Error();
1480
- t.PrimaryUserId = r.asString();
1559
+ case tr: {
1560
+ if (s.isNull) throw new Error();
1561
+ t.PrimaryUserId = s.asString();
1481
1562
  break;
1482
1563
  }
1483
- case Kr: {
1484
- if (r.isNull) throw new Error();
1485
- t.ChannelInstanceId = r.asString();
1564
+ case er: {
1565
+ if (s.isNull) throw new Error();
1566
+ t.ChannelInstanceId = s.asString();
1486
1567
  break;
1487
1568
  }
1488
- case Wr: {
1489
- if (r.isNull) throw new Error();
1490
- t.AudioStreams = rs(r.asDictionary());
1569
+ case sr: {
1570
+ if (s.isNull) throw new Error();
1571
+ t.AudioStreams = _r(s.asDictionary());
1491
1572
  break;
1492
1573
  }
1493
- case Yr: {
1494
- if (r.isNull) throw new Error();
1495
- t.VideoStreams = ss(r.asDictionary());
1574
+ case rr: {
1575
+ if (s.isNull) throw new Error();
1576
+ t.VideoStreams = fr(s.asDictionary());
1496
1577
  break;
1497
1578
  }
1498
- case $r: {
1499
- if (r.isNull) throw new Error();
1500
- t.SpaceName = r.asString();
1579
+ case ir: {
1580
+ if (s.isNull) throw new Error();
1581
+ t.SpaceName = s.asString();
1501
1582
  break;
1502
1583
  }
1503
1584
  }
1504
1585
  }
1505
- function qr(e, t) {
1506
- const r = $(e, gr, pr);
1507
- return Xr(r, t);
1586
+ function Ir(e, t) {
1587
+ const s = M(e, Hs, xs);
1588
+ return or(s, t);
1508
1589
  }
1509
- function Qr(e) {
1590
+ function hr(e) {
1510
1591
  const t = /* @__PURE__ */ Object.create(null);
1511
- let r;
1512
- for (; (r = e.next()) !== null; ) {
1513
- const s = r.key.asInt32();
1514
- t[s] = Me(r.value.asObject());
1592
+ let s;
1593
+ for (; (s = e.next()) !== null; ) {
1594
+ const r = s.key.asInt32();
1595
+ t[r] = je(s.value.asObject());
1515
1596
  }
1516
1597
  return t;
1517
1598
  }
1518
- function Zr(e) {
1599
+ function cr(e) {
1519
1600
  const t = /* @__PURE__ */ Object.create(null);
1520
- let r;
1521
- for (; (r = e.next()) !== null; ) {
1522
- const s = r.key.asString();
1523
- t[s] = Os(r.value.asObject());
1601
+ let s;
1602
+ for (; (s = e.next()) !== null; ) {
1603
+ const r = s.key.asString();
1604
+ t[r] = Yr(s.value.asObject());
1524
1605
  }
1525
1606
  return t;
1526
1607
  }
1527
- function ts(e) {
1608
+ function ur(e) {
1528
1609
  const t = /* @__PURE__ */ Object.create(null);
1529
- let r;
1530
- for (; (r = e.next()) !== null; ) {
1531
- const s = r.key.asInt32();
1532
- t[s] = is(r.value.asArray());
1610
+ let s;
1611
+ for (; (s = e.next()) !== null; ) {
1612
+ const r = s.key.asInt32();
1613
+ t[r] = dr(s.value.asArray());
1533
1614
  }
1534
1615
  return t;
1535
1616
  }
1536
- function es(e) {
1617
+ function Er(e) {
1537
1618
  const t = /* @__PURE__ */ Object.create(null);
1538
- let r;
1539
- for (; (r = e.next()) !== null; ) {
1540
- const s = r.key.asString();
1541
- t[s] = cs(r.value.asObject());
1619
+ let s;
1620
+ for (; (s = e.next()) !== null; ) {
1621
+ const r = s.key.asString();
1622
+ t[r] = wr(s.value.asObject());
1542
1623
  }
1543
1624
  return t;
1544
1625
  }
1545
- function rs(e) {
1626
+ function _r(e) {
1546
1627
  const t = /* @__PURE__ */ Object.create(null);
1547
- let r;
1548
- for (; (r = e.next()) !== null; ) {
1549
- const s = r.key.asString();
1550
- t[s] = Ts(r.value.asObject());
1628
+ let s;
1629
+ for (; (s = e.next()) !== null; ) {
1630
+ const r = s.key.asString();
1631
+ t[r] = gr(s.value.asObject());
1551
1632
  }
1552
1633
  return t;
1553
1634
  }
1554
- function ss(e) {
1635
+ function fr(e) {
1555
1636
  const t = /* @__PURE__ */ Object.create(null);
1556
- let r;
1557
- for (; (r = e.next()) !== null; ) {
1558
- const s = r.key.asString();
1559
- t[s] = Cs(r.value.asObject());
1637
+ let s;
1638
+ for (; (s = e.next()) !== null; ) {
1639
+ const r = s.key.asString();
1640
+ t[r] = vr(s.value.asObject());
1560
1641
  }
1561
1642
  return t;
1562
1643
  }
1563
- function is(e) {
1644
+ function dr(e) {
1564
1645
  const t = [];
1565
- let r;
1566
- for (; (r = e.next()) !== null; )
1567
- t.push(Ze(r.asObject()));
1646
+ let s;
1647
+ for (; (s = e.next()) !== null; )
1648
+ t.push(ls(s.asObject()));
1568
1649
  return t;
1569
1650
  }
1570
- const ns = 161083277, os = 325678206, as = 3469892363, ls = 3645544153;
1571
- function Is(e) {
1651
+ const Tr = 161083277, yr = 325678206, Sr = 3469892363, Ar = 3645544153;
1652
+ function Nr(e) {
1572
1653
  const t = {};
1573
- return bt(t), t;
1654
+ return Ot(t), t;
1574
1655
  }
1575
- function bt(e) {
1576
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = mt(), e;
1656
+ function Ot(e) {
1657
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Rt(), e;
1577
1658
  }
1578
- function cs(e, t) {
1579
- const r = t ?? Is();
1580
- return bt(r), hs(e, r), r;
1659
+ function wr(e, t) {
1660
+ const s = t ?? Nr();
1661
+ return Ot(s), Ur(e, s), s;
1581
1662
  }
1582
- function hs(e, t) {
1583
- let r;
1584
- for (; (r = e.next()) !== null; )
1585
- switch (r.fieldId) {
1586
- case ns: {
1587
- if (r.isNull) throw new Error();
1588
- t.StreamId = r.asString();
1663
+ function Ur(e, t) {
1664
+ let s;
1665
+ for (; (s = e.next()) !== null; )
1666
+ switch (s.fieldId) {
1667
+ case Tr: {
1668
+ if (s.isNull) throw new Error();
1669
+ t.StreamId = s.asString();
1589
1670
  break;
1590
1671
  }
1591
- case os: {
1592
- if (r.isNull) throw new Error();
1593
- t.ClientSessionId = r.asInt32();
1672
+ case yr: {
1673
+ if (s.isNull) throw new Error();
1674
+ t.ClientSessionId = s.asInt32();
1594
1675
  break;
1595
1676
  }
1596
- case as: {
1597
- if (r.isNull) throw new Error();
1598
- t.TrackId = r.asInt32();
1677
+ case Sr: {
1678
+ if (s.isNull) throw new Error();
1679
+ t.TrackId = s.asInt32();
1599
1680
  break;
1600
1681
  }
1601
- case ls: {
1602
- if (r.isNull) throw new Error();
1603
- t.Info = Sr(r.asObject());
1682
+ case Ar: {
1683
+ if (s.isNull) throw new Error();
1684
+ t.Info = ps(s.asObject());
1604
1685
  break;
1605
1686
  }
1606
1687
  }
1607
1688
  }
1608
- const us = 161083277, Es = 325678206, _s = 3469892363, fs = 3645544153;
1609
- function ds(e) {
1689
+ const Cr = 161083277, Dr = 325678206, Rr = 3469892363, mr = 3645544153;
1690
+ function Lr(e) {
1610
1691
  const t = {};
1611
- return Pt(t), t;
1692
+ return bt(t), t;
1612
1693
  }
1613
- function Pt(e) {
1614
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = At(), e;
1694
+ function bt(e) {
1695
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = yt(), e;
1615
1696
  }
1616
- function Ts(e, t) {
1617
- const r = t ?? ds();
1618
- return Pt(r), ys(e, r), r;
1697
+ function gr(e, t) {
1698
+ const s = t ?? Lr();
1699
+ return bt(s), pr(e, s), s;
1619
1700
  }
1620
- function ys(e, t) {
1621
- let r;
1622
- for (; (r = e.next()) !== null; )
1623
- switch (r.fieldId) {
1624
- case us: {
1625
- if (r.isNull) throw new Error();
1626
- t.StreamId = r.asString();
1701
+ function pr(e, t) {
1702
+ let s;
1703
+ for (; (s = e.next()) !== null; )
1704
+ switch (s.fieldId) {
1705
+ case Cr: {
1706
+ if (s.isNull) throw new Error();
1707
+ t.StreamId = s.asString();
1627
1708
  break;
1628
1709
  }
1629
- case Es: {
1630
- if (r.isNull) throw new Error();
1631
- t.ClientSessionId = r.asInt32();
1710
+ case Dr: {
1711
+ if (s.isNull) throw new Error();
1712
+ t.ClientSessionId = s.asInt32();
1632
1713
  break;
1633
1714
  }
1634
- case _s: {
1635
- if (r.isNull) throw new Error();
1636
- t.TrackId = r.asInt32();
1715
+ case Rr: {
1716
+ if (s.isNull) throw new Error();
1717
+ t.TrackId = s.asInt32();
1637
1718
  break;
1638
1719
  }
1639
- case fs: {
1640
- if (r.isNull) throw new Error();
1641
- t.Info = he(r.asObject());
1720
+ case mr: {
1721
+ if (s.isNull) throw new Error();
1722
+ t.Info = ue(s.asObject());
1642
1723
  break;
1643
1724
  }
1644
1725
  }
1645
1726
  }
1646
- const Ns = 161083277, As = 325678206, Ss = 3469892363, ws = 3645544153;
1647
- function Us(e) {
1727
+ const Or = 161083277, br = 325678206, Pr = 3469892363, Fr = 3645544153;
1728
+ function kr(e) {
1648
1729
  const t = {};
1649
- return Ft(t), t;
1730
+ return Pt(t), t;
1650
1731
  }
1651
- function Ft(e) {
1652
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = pt(), e;
1732
+ function Pt(e) {
1733
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Lt(), e;
1653
1734
  }
1654
- function Cs(e, t) {
1655
- const r = t ?? Us();
1656
- return Ft(r), Ds(e, r), r;
1735
+ function vr(e, t) {
1736
+ const s = t ?? kr();
1737
+ return Pt(s), Vr(e, s), s;
1657
1738
  }
1658
- function Ds(e, t) {
1659
- let r;
1660
- for (; (r = e.next()) !== null; )
1661
- switch (r.fieldId) {
1662
- case Ns: {
1663
- if (r.isNull) throw new Error();
1664
- t.StreamId = r.asString();
1739
+ function Vr(e, t) {
1740
+ let s;
1741
+ for (; (s = e.next()) !== null; )
1742
+ switch (s.fieldId) {
1743
+ case Or: {
1744
+ if (s.isNull) throw new Error();
1745
+ t.StreamId = s.asString();
1665
1746
  break;
1666
1747
  }
1667
- case As: {
1668
- if (r.isNull) throw new Error();
1669
- t.ClientSessionId = r.asInt32();
1748
+ case br: {
1749
+ if (s.isNull) throw new Error();
1750
+ t.ClientSessionId = s.asInt32();
1670
1751
  break;
1671
1752
  }
1672
- case Ss: {
1673
- if (r.isNull) throw new Error();
1674
- t.TrackId = r.asInt32();
1753
+ case Pr: {
1754
+ if (s.isNull) throw new Error();
1755
+ t.TrackId = s.asInt32();
1675
1756
  break;
1676
1757
  }
1677
- case ws: {
1678
- if (r.isNull) throw new Error();
1679
- t.Info = mr(r.asObject());
1758
+ case Fr: {
1759
+ if (s.isNull) throw new Error();
1760
+ t.Info = Bs(s.asObject());
1680
1761
  break;
1681
1762
  }
1682
1763
  }
1683
1764
  }
1684
- const Rs = 161083277, ms = 325678206, Ls = 3469892363, ps = 3645544153;
1685
- function gs(e) {
1765
+ const Mr = 161083277, Br = 325678206, Gr = 3469892363, xr = 3645544153;
1766
+ function Hr(e) {
1686
1767
  const t = {};
1687
- return kt(t), t;
1768
+ return Ft(t), t;
1688
1769
  }
1689
- function kt(e) {
1690
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Dt(), e;
1770
+ function Ft(e) {
1771
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Ct(), e;
1691
1772
  }
1692
- function Os(e, t) {
1693
- const r = t ?? gs();
1694
- return kt(r), bs(e, r), r;
1773
+ function Yr(e, t) {
1774
+ const s = t ?? Hr();
1775
+ return Ft(s), Wr(e, s), s;
1695
1776
  }
1696
- function bs(e, t) {
1697
- let r;
1698
- for (; (r = e.next()) !== null; )
1699
- switch (r.fieldId) {
1700
- case Rs: {
1701
- if (r.isNull) throw new Error();
1702
- t.StreamId = r.asString();
1777
+ function Wr(e, t) {
1778
+ let s;
1779
+ for (; (s = e.next()) !== null; )
1780
+ switch (s.fieldId) {
1781
+ case Mr: {
1782
+ if (s.isNull) throw new Error();
1783
+ t.StreamId = s.asString();
1703
1784
  break;
1704
1785
  }
1705
- case ms: {
1706
- if (r.isNull) throw new Error();
1707
- t.ClientSessionId = r.asInt32();
1786
+ case Br: {
1787
+ if (s.isNull) throw new Error();
1788
+ t.ClientSessionId = s.asInt32();
1708
1789
  break;
1709
1790
  }
1710
- case Ls: {
1711
- if (r.isNull) throw new Error();
1712
- t.TrackId = r.asInt32();
1791
+ case Gr: {
1792
+ if (s.isNull) throw new Error();
1793
+ t.TrackId = s.asInt32();
1713
1794
  break;
1714
1795
  }
1715
- case ps: {
1716
- if (r.isNull) throw new Error();
1717
- t.Info = Tr(r.asObject());
1796
+ case xr: {
1797
+ if (s.isNull) throw new Error();
1798
+ t.Info = Rs(s.asObject());
1718
1799
  break;
1719
1800
  }
1720
1801
  }
1721
1802
  }
1722
- const Ps = 1405462580, Fs = 2968276160;
1723
- function ks(e) {
1803
+ const Kr = 1405462580, $r = 2968276160;
1804
+ function jr(e) {
1724
1805
  const t = {};
1725
- return Vt(t), t;
1806
+ return kt(t), t;
1726
1807
  }
1727
- function Vt(e) {
1808
+ function kt(e) {
1728
1809
  return e.MimeType = "", e.Value = new Uint8Array(0), e;
1729
1810
  }
1730
- function Vs(e, t) {
1731
- const r = t ?? ks();
1732
- return Vt(r), Bs(e, r), r;
1811
+ function Xr(e, t) {
1812
+ const s = t ?? jr();
1813
+ return kt(s), zr(e, s), s;
1733
1814
  }
1734
- function Bs(e, t) {
1735
- let r;
1736
- for (; (r = e.next()) !== null; )
1737
- switch (r.fieldId) {
1738
- case Ps: {
1739
- if (r.isNull) throw new Error();
1740
- t.Value = r.asBinary();
1815
+ function zr(e, t) {
1816
+ let s;
1817
+ for (; (s = e.next()) !== null; )
1818
+ switch (s.fieldId) {
1819
+ case Kr: {
1820
+ if (s.isNull) throw new Error();
1821
+ t.Value = s.asBinary();
1741
1822
  break;
1742
1823
  }
1743
- case Fs: {
1744
- if (r.isNull) throw new Error();
1745
- t.MimeType = r.asString();
1824
+ case $r: {
1825
+ if (s.isNull) throw new Error();
1826
+ t.MimeType = s.asString();
1746
1827
  break;
1747
1828
  }
1748
1829
  }
1749
1830
  }
1750
- const Ms = 1, vs = 2097188, Gs = 979822885, xs = 2374537704;
1751
- function Hs(e) {
1831
+ const Jr = 1, qr = 2097188, Qr = 979822885, Zr = 2374537704;
1832
+ function ti(e) {
1752
1833
  const t = {};
1753
- return Bt(t), t;
1834
+ return vt(t), t;
1754
1835
  }
1755
- function Bt(e) {
1836
+ function vt(e) {
1756
1837
  return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
1757
1838
  }
1758
- function Ks(e, t) {
1759
- const r = g.create(e);
1760
- return Ws(r, t);
1839
+ function ei(e, t) {
1840
+ const s = p.create(e);
1841
+ return si(s, t);
1761
1842
  }
1762
- function Ws(e, t) {
1763
- const r = t ?? Hs();
1764
- return Bt(r), Ys(e, r), r;
1843
+ function si(e, t) {
1844
+ const s = t ?? ti();
1845
+ return vt(s), ri(e, s), s;
1765
1846
  }
1766
- function Ys(e, t) {
1767
- let r;
1768
- for (; (r = e.next()) !== null; )
1769
- switch (r.fieldId) {
1770
- case Gs: {
1771
- if (r.isNull) throw new Error();
1772
- t.StyleId = r.asString();
1847
+ function ri(e, t) {
1848
+ let s;
1849
+ for (; (s = e.next()) !== null; )
1850
+ switch (s.fieldId) {
1851
+ case Qr: {
1852
+ if (s.isNull) throw new Error();
1853
+ t.StyleId = s.asString();
1773
1854
  break;
1774
1855
  }
1775
- case xs: {
1776
- if (r.isNull) throw new Error();
1777
- t.Style = js(r.asDictionary());
1856
+ case Zr: {
1857
+ if (s.isNull) throw new Error();
1858
+ t.Style = ni(s.asDictionary());
1778
1859
  break;
1779
1860
  }
1780
1861
  }
1781
1862
  }
1782
- function $s(e, t) {
1783
- const r = $(e, vs, Ms);
1784
- return Ks(r, t);
1863
+ function ii(e, t) {
1864
+ const s = M(e, qr, Jr);
1865
+ return ei(s, t);
1785
1866
  }
1786
- function js(e) {
1867
+ function ni(e) {
1787
1868
  const t = /* @__PURE__ */ Object.create(null);
1788
- let r;
1789
- for (; (r = e.next()) !== null; ) {
1790
- const s = r.key.asString();
1791
- t[s] = r.value.asString();
1869
+ let s;
1870
+ for (; (s = e.next()) !== null; ) {
1871
+ const r = s.key.asString();
1872
+ t[r] = s.value.asString();
1792
1873
  }
1793
1874
  return t;
1794
1875
  }
1795
- const Xs = 1, zs = 2097192, Js = 2136687806;
1796
- function qs(e) {
1876
+ const oi = 1, ai = 2097192, li = 2136687806;
1877
+ function Ii(e) {
1797
1878
  const t = {};
1798
- return Mt(t), t;
1879
+ return Vt(t), t;
1799
1880
  }
1800
- function Mt(e) {
1881
+ function Vt(e) {
1801
1882
  return e.Styles = [], e;
1802
1883
  }
1803
- function Qs(e, t) {
1804
- const r = g.create(e);
1805
- return Zs(r, t);
1884
+ function hi(e, t) {
1885
+ const s = p.create(e);
1886
+ return ci(s, t);
1806
1887
  }
1807
- function Zs(e, t) {
1808
- const r = t ?? qs();
1809
- return Mt(r), ti(e, r), r;
1888
+ function ci(e, t) {
1889
+ const s = t ?? Ii();
1890
+ return Vt(s), ui(e, s), s;
1810
1891
  }
1811
- function ti(e, t) {
1812
- let r;
1813
- for (; (r = e.next()) !== null; )
1814
- switch (r.fieldId) {
1815
- case Js: {
1816
- if (r.isNull) throw new Error();
1817
- t.Styles = ri(r.asArray());
1892
+ function ui(e, t) {
1893
+ let s;
1894
+ for (; (s = e.next()) !== null; )
1895
+ switch (s.fieldId) {
1896
+ case li: {
1897
+ if (s.isNull) throw new Error();
1898
+ t.Styles = _i(s.asArray());
1818
1899
  break;
1819
1900
  }
1820
1901
  }
1821
1902
  }
1822
- function ei(e, t) {
1823
- const r = $(e, zs, Xs);
1824
- return Qs(r, t);
1903
+ function Ei(e, t) {
1904
+ const s = M(e, ai, oi);
1905
+ return hi(s, t);
1825
1906
  }
1826
- function ri(e) {
1907
+ function _i(e) {
1827
1908
  const t = [];
1828
- let r;
1829
- for (; (r = e.next()) !== null; )
1830
- t.push(oi(r.asObject()));
1909
+ let s;
1910
+ for (; (s = e.next()) !== null; )
1911
+ t.push(yi(s.asObject()));
1831
1912
  return t;
1832
1913
  }
1833
- const si = 979822885, ii = 2374537704;
1834
- function ni(e) {
1914
+ const fi = 979822885, di = 2374537704;
1915
+ function Ti(e) {
1835
1916
  const t = {};
1836
- return vt(t), t;
1917
+ return Mt(t), t;
1837
1918
  }
1838
- function vt(e) {
1919
+ function Mt(e) {
1839
1920
  return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
1840
1921
  }
1841
- function oi(e, t) {
1842
- const r = t ?? ni();
1843
- return vt(r), ai(e, r), r;
1922
+ function yi(e, t) {
1923
+ const s = t ?? Ti();
1924
+ return Mt(s), Si(e, s), s;
1844
1925
  }
1845
- function ai(e, t) {
1846
- let r;
1847
- for (; (r = e.next()) !== null; )
1848
- switch (r.fieldId) {
1849
- case si: {
1850
- if (r.isNull) throw new Error();
1851
- t.StyleId = r.asString();
1926
+ function Si(e, t) {
1927
+ let s;
1928
+ for (; (s = e.next()) !== null; )
1929
+ switch (s.fieldId) {
1930
+ case fi: {
1931
+ if (s.isNull) throw new Error();
1932
+ t.StyleId = s.asString();
1852
1933
  break;
1853
1934
  }
1854
- case ii: {
1855
- if (r.isNull) throw new Error();
1856
- t.Style = li(r.asDictionary());
1935
+ case di: {
1936
+ if (s.isNull) throw new Error();
1937
+ t.Style = Ai(s.asDictionary());
1857
1938
  break;
1858
1939
  }
1859
1940
  }
1860
1941
  }
1861
- function li(e) {
1942
+ function Ai(e) {
1862
1943
  const t = /* @__PURE__ */ Object.create(null);
1863
- let r;
1864
- for (; (r = e.next()) !== null; ) {
1865
- const s = r.key.asString();
1866
- t[s] = r.value.asString();
1944
+ let s;
1945
+ for (; (s = e.next()) !== null; ) {
1946
+ const r = s.key.asString();
1947
+ t[r] = s.value.asString();
1867
1948
  }
1868
1949
  return t;
1869
1950
  }
1870
- const Ii = 1, ci = 2097190, hi = 425183262, ui = 653781469;
1871
- function Ei(e) {
1951
+ const Ni = 1, wi = 2097193, Ui = 1415642792;
1952
+ function Ci(e) {
1953
+ const t = {};
1954
+ return Bt(t), t;
1955
+ }
1956
+ function Bt(e) {
1957
+ return e.StyleIds = [], e;
1958
+ }
1959
+ function Di(e, t) {
1960
+ const s = p.create(e);
1961
+ return Ri(s, t);
1962
+ }
1963
+ function Ri(e, t) {
1964
+ const s = t ?? Ci();
1965
+ return Bt(s), mi(e, s), s;
1966
+ }
1967
+ function mi(e, t) {
1968
+ let s;
1969
+ for (; (s = e.next()) !== null; )
1970
+ switch (s.fieldId) {
1971
+ case Ui: {
1972
+ if (s.isNull) throw new Error();
1973
+ t.StyleIds = gi(s.asArray());
1974
+ break;
1975
+ }
1976
+ }
1977
+ }
1978
+ function Li(e, t) {
1979
+ const s = M(e, wi, Ni);
1980
+ return Di(s, t);
1981
+ }
1982
+ function gi(e) {
1983
+ const t = [];
1984
+ let s;
1985
+ for (; (s = e.next()) !== null; )
1986
+ t.push(s.asString());
1987
+ return t;
1988
+ }
1989
+ const pi = 1, Oi = 2097190, bi = 425183262, Pi = 653781469;
1990
+ function Fi(e) {
1872
1991
  const t = {};
1873
1992
  return Gt(t), t;
1874
1993
  }
1875
1994
  function Gt(e) {
1876
1995
  return e.Json = "", e.Payloads = /* @__PURE__ */ Object.create(null), e;
1877
1996
  }
1878
- function _i(e, t) {
1879
- const r = g.create(e);
1880
- return fi(r, t);
1997
+ function ki(e, t) {
1998
+ const s = p.create(e);
1999
+ return vi(s, t);
1881
2000
  }
1882
- function fi(e, t) {
1883
- const r = t ?? Ei();
1884
- return Gt(r), di(e, r), r;
2001
+ function vi(e, t) {
2002
+ const s = t ?? Fi();
2003
+ return Gt(s), Vi(e, s), s;
1885
2004
  }
1886
- function di(e, t) {
1887
- let r;
1888
- for (; (r = e.next()) !== null; )
1889
- switch (r.fieldId) {
1890
- case hi: {
1891
- if (r.isNull) throw new Error();
1892
- t.Json = r.asString();
2005
+ function Vi(e, t) {
2006
+ let s;
2007
+ for (; (s = e.next()) !== null; )
2008
+ switch (s.fieldId) {
2009
+ case bi: {
2010
+ if (s.isNull) throw new Error();
2011
+ t.Json = s.asString();
1893
2012
  break;
1894
2013
  }
1895
- case ui: {
1896
- if (r.isNull) throw new Error();
1897
- t.Payloads = yi(r.asDictionary());
2014
+ case Pi: {
2015
+ if (s.isNull) throw new Error();
2016
+ t.Payloads = Bi(s.asDictionary());
1898
2017
  break;
1899
2018
  }
1900
2019
  }
1901
2020
  }
1902
- function Ti(e, t) {
1903
- const r = $(e, ci, Ii);
1904
- return _i(r, t);
2021
+ function Mi(e, t) {
2022
+ const s = M(e, Oi, pi);
2023
+ return ki(s, t);
1905
2024
  }
1906
- function yi(e) {
2025
+ function Bi(e) {
1907
2026
  const t = /* @__PURE__ */ Object.create(null);
1908
- let r;
1909
- for (; (r = e.next()) !== null; ) {
1910
- const s = r.key.asString();
1911
- t[s] = Vs(r.value.asObject());
2027
+ let s;
2028
+ for (; (s = e.next()) !== null; ) {
2029
+ const r = s.key.asString();
2030
+ t[r] = Xr(s.value.asObject());
1912
2031
  }
1913
2032
  return t;
1914
2033
  }
1915
- const xt = 1, Ni = 1048636, Ai = 2610786289;
1916
- function Si(e) {
1917
- const t = new v(xt);
1918
- return wi(e, t), t.finish();
2034
+ const xt = 1, Gi = 1048636, xi = 2610786289;
2035
+ function Hi(e) {
2036
+ const t = new B(xt);
2037
+ return Yi(e, t), t.finish();
1919
2038
  }
1920
- function wi(e, t) {
1921
- t.writeUInt32Field(Ai, e.Version >>> 0);
2039
+ function Yi(e, t) {
2040
+ t.writeUInt32Field(xi, e.Version >>> 0);
1922
2041
  }
1923
- function Ui(e, t, r) {
1924
- const s = Si(e);
1925
- return Qt(Ni, s, xt, t, r);
2042
+ function Wi(e, t, s) {
2043
+ const r = Hi(e);
2044
+ return Qt(Gi, r, xt, t, s);
1926
2045
  }
1927
- function U(e) {
2046
+ function w(e) {
1928
2047
  return typeof e == "object" && e !== null && !Array.isArray(e);
1929
2048
  }
1930
2049
  function Ht(e) {
1931
- const t = {}, r = Object.keys(e);
1932
- for (let s = 0; s < r.length; s++) {
1933
- const i = r[s];
2050
+ const t = {}, s = Object.keys(e);
2051
+ for (let r = 0; r < s.length; r++) {
2052
+ const i = s[r];
1934
2053
  t[i] = e[i];
1935
2054
  }
1936
2055
  return t;
1937
2056
  }
1938
- function Kt(e, t, r, s) {
1939
- if (!(e === void 0 && s)) {
2057
+ function Yt(e, t, s, r) {
2058
+ if (!(e === void 0 && r)) {
1940
2059
  if (Array.isArray(e)) {
1941
2060
  const i = [];
1942
2061
  for (let n = 0; n < e.length; n++) {
1943
2062
  const o = e[n];
1944
2063
  if (typeof o != "string")
1945
- throw new Error(`Invalid styleIds entry at ${t}.styleIds[${n}] for element ${r}`);
2064
+ throw new Error(`Invalid styleIds entry at ${t}.styleIds[${n}] for element ${s}`);
1946
2065
  const a = o.trim();
1947
2066
  a.length !== 0 && i.push(a);
1948
2067
  }
1949
2068
  return i;
1950
2069
  }
1951
2070
  if (e != null)
1952
- throw new Error(`Invalid styleIds for element ${r}`);
2071
+ throw new Error(`Invalid styleIds for element ${s}`);
1953
2072
  return [];
1954
2073
  }
1955
2074
  }
1956
2075
  function it(e, t) {
1957
2076
  if (!e || typeof e != "object")
1958
2077
  throw new Error(`Invalid UI node at ${t}`);
1959
- const r = e.Id, s = e.Type, i = e.Props, n = e.Children, o = e.StyleIds;
1960
- if (typeof r != "string")
1961
- throw new Error(`Invalid or missing node id at ${t}`);
2078
+ const s = e.Id, r = e.Type, i = e.Props, n = e.Children, o = e.StyleIds;
1962
2079
  if (typeof s != "string")
1963
- throw new Error(`Invalid or missing node type for ${r}`);
2080
+ throw new Error(`Invalid or missing node id at ${t}`);
2081
+ if (typeof r != "string")
2082
+ throw new Error(`Invalid or missing node type for ${s}`);
1964
2083
  let a = {};
1965
2084
  if (i != null) {
1966
- if (!U(i))
1967
- throw new Error(`Invalid props for node ${r}`);
2085
+ if (!w(i))
2086
+ throw new Error(`Invalid props for node ${s}`);
1968
2087
  a = Ht(i);
1969
2088
  }
1970
2089
  let l = [];
1971
2090
  Array.isArray(n) && (l = n.map(
1972
2091
  (I, c) => it(I ?? {}, `${t}.children[${c}]`)
1973
2092
  ));
1974
- const u = Kt(o, t, r, !1);
2093
+ const u = Yt(o, t, s, !1);
1975
2094
  return {
1976
- id: r,
1977
- type: s,
2095
+ id: s,
2096
+ type: r,
1978
2097
  props: a,
1979
2098
  children: l,
1980
2099
  styleIds: u ?? []
1981
2100
  };
1982
2101
  }
1983
- function Ci(e, t) {
1984
- if (!U(e))
2102
+ function Ki(e, t) {
2103
+ if (!w(e))
1985
2104
  throw new Error(`Invalid text delta at ${t}`);
1986
- const r = e.NodeId, s = e.PropertyName, i = e.Start, n = e.End, o = e.InsertedText;
1987
- if (typeof r != "string" || r.length === 0)
1988
- throw new Error(`Invalid text delta node id at ${t}`);
2105
+ const s = e.NodeId, r = e.PropertyName, i = e.Start, n = e.End, o = e.InsertedText;
1989
2106
  if (typeof s != "string" || s.length === 0)
2107
+ throw new Error(`Invalid text delta node id at ${t}`);
2108
+ if (typeof r != "string" || r.length === 0)
1990
2109
  throw new Error(`Invalid text delta property name at ${t}`);
1991
2110
  if (typeof i != "number" || !Number.isFinite(i))
1992
2111
  throw new Error(`Invalid text delta start at ${t}`);
@@ -2000,89 +2119,123 @@ function Ci(e, t) {
2000
2119
  } else if (n != null)
2001
2120
  throw new Error(`Invalid text delta end at ${t}`);
2002
2121
  return {
2003
- nodeId: r,
2004
- propertyName: s,
2122
+ nodeId: s,
2123
+ propertyName: r,
2005
2124
  start: i,
2006
2125
  end: a,
2007
2126
  insertedText: o
2008
2127
  };
2009
2128
  }
2010
- function Wt(e, t) {
2011
- if (!U(e))
2012
- throw new Error(`Invalid UI diff node at ${t}`);
2013
- const r = e.Id, s = e.Type, i = e.StyleIds;
2014
- if (typeof r != "string" || r.length === 0)
2015
- throw new Error(`Invalid diff id at ${t}`);
2129
+ function $i(e, t) {
2130
+ if (!w(e))
2131
+ throw new Error(`Invalid child insert at ${t}`);
2132
+ const s = e.Index, r = e.Node;
2133
+ if (typeof s != "number" || !Number.isFinite(s))
2134
+ throw new Error(`Invalid child insert index at ${t}`);
2135
+ if (!w(r))
2136
+ throw new Error(`Invalid child insert node at ${t}`);
2137
+ return {
2138
+ index: s,
2139
+ node: it(r, `${t}.node`)
2140
+ };
2141
+ }
2142
+ function ji(e, t) {
2143
+ if (!w(e))
2144
+ throw new Error(`Invalid child move at ${t}`);
2145
+ const s = e.NodeId, r = e.FromIndex, i = e.ToIndex;
2016
2146
  if (typeof s != "string" || s.length === 0)
2017
- throw new Error(`Invalid diff type for ${r}`);
2018
- const n = Array.isArray(e.Added) ? e.Added.map(
2019
- (c, h) => it(c ?? {}, `${t}.added[${h}]`)
2020
- ) : [], o = [];
2021
- Array.isArray(e.Removed) && e.Removed.forEach((c, h) => {
2022
- if (typeof c == "string") {
2023
- o.push(c);
2024
- return;
2025
- }
2026
- if (U(c) && typeof c.Id == "string") {
2027
- o.push(c.Id);
2028
- return;
2029
- }
2030
- throw new Error(`Invalid removed node at ${t}.removed[${h}]`);
2031
- });
2032
- const a = Array.isArray(e.Updated) ? e.Updated.map(
2033
- (c, h) => Wt(c ?? {}, `${t}.updated[${h}]`)
2034
- ) : [], l = /* @__PURE__ */ new Map();
2035
- if (U(e.ChangedProps))
2036
- for (const [c, h] of Object.entries(e.ChangedProps)) {
2037
- if (!U(h))
2147
+ throw new Error(`Invalid child move nodeId at ${t}`);
2148
+ if (typeof r != "number" || !Number.isFinite(r))
2149
+ throw new Error(`Invalid child move fromIndex at ${t}`);
2150
+ if (typeof i != "number" || !Number.isFinite(i))
2151
+ throw new Error(`Invalid child move toIndex at ${t}`);
2152
+ return {
2153
+ nodeId: s,
2154
+ fromIndex: r,
2155
+ toIndex: i
2156
+ };
2157
+ }
2158
+ function Xi(e, t) {
2159
+ if (!w(e))
2160
+ throw new Error(`Invalid child remove at ${t}`);
2161
+ const s = e.NodeId, r = e.Index;
2162
+ if (typeof s != "string" || s.length === 0)
2163
+ throw new Error(`Invalid child remove nodeId at ${t}`);
2164
+ if (typeof r != "number" || !Number.isFinite(r))
2165
+ throw new Error(`Invalid child remove index at ${t}`);
2166
+ return {
2167
+ nodeId: s,
2168
+ index: r
2169
+ };
2170
+ }
2171
+ function zi(e, t) {
2172
+ if (!w(e))
2173
+ throw new Error(`Invalid node change at ${t}`);
2174
+ const s = e.nodeId;
2175
+ if (typeof s != "string" || s.length === 0)
2176
+ throw new Error(`Invalid node change nodeId at ${t}`);
2177
+ const r = Array.isArray(e.inserts) ? e.inserts.map(
2178
+ (I, c) => $i(I ?? {}, `${t}.inserts[${c}]`)
2179
+ ) : void 0, i = Array.isArray(e.moves) ? e.moves.map(
2180
+ (I, c) => ji(I ?? {}, `${t}.moves[${c}]`)
2181
+ ) : void 0, n = Array.isArray(e.removals) ? e.removals.map(
2182
+ (I, c) => Xi(I ?? {}, `${t}.removals[${c}]`)
2183
+ ) : void 0;
2184
+ let o;
2185
+ if (w(e.changedProps)) {
2186
+ o = /* @__PURE__ */ new Map();
2187
+ for (const [I, c] of Object.entries(e.changedProps)) {
2188
+ if (!w(c))
2038
2189
  continue;
2039
- const E = h.New;
2040
- E === void 0 ? l.set(c, void 0) : U(E) ? l.set(c, Ht(E)) : l.set(c, E);
2190
+ const h = c.New;
2191
+ h === void 0 ? o.set(I, void 0) : w(h) ? o.set(I, Ht(h)) : o.set(I, h);
2041
2192
  }
2042
- const u = Array.isArray(e.TextUpdates) ? e.TextUpdates.map(
2043
- (c, h) => Ci(c ?? {}, `${t}.textUpdates[${h}]`)
2044
- ) : [], I = Kt(i, t, r, !0);
2193
+ }
2194
+ const a = Array.isArray(e.textUpdates) ? e.textUpdates.map(
2195
+ (I, c) => Ki(I ?? {}, `${t}.textUpdates[${c}]`)
2196
+ ) : void 0, l = e.styleIds, u = l !== void 0 ? Yt(l, t, s, !0) : void 0;
2045
2197
  return {
2046
- id: r,
2047
- type: s,
2048
- added: n,
2049
- removed: o,
2050
- updated: a,
2051
- changedProps: l,
2052
- textUpdates: u,
2053
- ...I !== void 0 ? { styleIds: I } : {}
2198
+ nodeId: s,
2199
+ ...r && r.length > 0 ? { inserts: r } : {},
2200
+ ...i && i.length > 0 ? { moves: i } : {},
2201
+ ...n && n.length > 0 ? { removals: n } : {},
2202
+ ...o && o.size > 0 ? { changedProps: o } : {},
2203
+ ...a && a.length > 0 ? { textUpdates: a } : {},
2204
+ ...u !== void 0 ? { styleIds: u } : {}
2054
2205
  };
2055
2206
  }
2056
- function Di(e) {
2207
+ function Ji(e) {
2057
2208
  const t = /* @__PURE__ */ new Map();
2058
- for (const [r, s] of Object.entries(e))
2059
- t.set(r, s);
2209
+ for (const [s, r] of Object.entries(e))
2210
+ t.set(s, r);
2060
2211
  return t;
2061
2212
  }
2062
- function Ri(e, t, r) {
2213
+ function qi(e, t, s) {
2063
2214
  if (!e || typeof e != "object")
2064
- throw new C("UI update graph is missing");
2065
- const s = it(e, "graph");
2066
- if (s.type !== "root")
2067
- throw new C('UI update root element must have type "root"');
2068
- const i = Li(s.props, t);
2215
+ throw new D("UI update graph is missing");
2216
+ const r = it(e, "graph");
2217
+ if (r.type !== "root")
2218
+ throw new D('UI update root element must have type "root"');
2219
+ const i = Zi(r.props, t);
2069
2220
  return {
2070
2221
  type: "full",
2071
- version: r,
2072
- root: s,
2222
+ version: s,
2223
+ root: r,
2073
2224
  metadata: i
2074
2225
  };
2075
2226
  }
2076
- function mi(e, t, r) {
2077
- if (!e || typeof e != "object")
2078
- throw new C("UI diff payload is missing");
2079
- if (!U(t))
2080
- throw new C("UI diff metadata must be an object");
2081
- const s = t.viewId;
2082
- if (typeof s != "string" || s.length === 0)
2083
- throw new C("UI diff metadata is missing viewId");
2084
- const i = Wt(e, "diff"), n = t.optimisticActionId === null || typeof t.optimisticActionId == "string" ? t.optimisticActionId : void 0, o = typeof t.isOptimistic == "boolean" ? t.isOptimistic : void 0, a = typeof t.isUpdate == "boolean" ? t.isUpdate : void 0, l = z(t.optimisticPatch), u = J(t.optimisticReconcile), I = {
2085
- viewId: s,
2227
+ function Qi(e, t, s) {
2228
+ if (!Array.isArray(e))
2229
+ throw new D("UI diff changes must be an array");
2230
+ if (!w(t))
2231
+ throw new D("UI diff metadata must be an object");
2232
+ const r = t.viewId;
2233
+ if (typeof r != "string" || r.length === 0)
2234
+ throw new D("UI diff metadata is missing viewId");
2235
+ const i = e.map(
2236
+ (c, h) => zi(c ?? {}, `changes[${h}]`)
2237
+ ), n = t.optimisticActionId === null || typeof t.optimisticActionId == "string" ? t.optimisticActionId : void 0, o = typeof t.isOptimistic == "boolean" ? t.isOptimistic : void 0, a = typeof t.isUpdate == "boolean" ? t.isUpdate : void 0, l = z(t.optimisticPatch), u = J(t.optimisticReconcile), I = {
2238
+ viewId: r,
2086
2239
  ...n !== void 0 ? { optimisticActionId: n } : {},
2087
2240
  ...o !== void 0 ? { isOptimistic: o } : {},
2088
2241
  ...a !== void 0 ? { isUpdate: a } : {},
@@ -2091,18 +2244,18 @@ function mi(e, t, r) {
2091
2244
  };
2092
2245
  return {
2093
2246
  type: "diff",
2094
- version: r,
2095
- diff: i,
2247
+ version: s,
2248
+ changes: i,
2096
2249
  metadata: I
2097
2250
  };
2098
2251
  }
2099
- function Li(e, t) {
2100
- const r = e.viewId;
2101
- if (typeof r != "string" || r.length === 0)
2102
- throw new C("UI update root is missing viewId");
2103
- let s = r, i = e.optimisticActionId === null || typeof e.optimisticActionId == "string" ? e.optimisticActionId : void 0, n = typeof e.isOptimistic == "boolean" ? e.isOptimistic : void 0, o = typeof e.isUpdate == "boolean" ? e.isUpdate : void 0, a = z(e.optimisticPatch), l = J(e.optimisticReconcile);
2104
- return U(t) && (typeof t.viewId == "string" && t.viewId.length > 0 && (s = t.viewId), (t.optimisticActionId === null || typeof t.optimisticActionId == "string") && (i = t.optimisticActionId), typeof t.isOptimistic == "boolean" && (n = t.isOptimistic), typeof t.isUpdate == "boolean" && (o = t.isUpdate), t.optimisticPatch !== void 0 && (a = z(t.optimisticPatch)), t.optimisticReconcile !== void 0 && (l = J(t.optimisticReconcile))), {
2105
- viewId: s,
2252
+ function Zi(e, t) {
2253
+ const s = e.viewId;
2254
+ if (typeof s != "string" || s.length === 0)
2255
+ throw new D("UI update root is missing viewId");
2256
+ let r = s, i = e.optimisticActionId === null || typeof e.optimisticActionId == "string" ? e.optimisticActionId : void 0, n = typeof e.isOptimistic == "boolean" ? e.isOptimistic : void 0, o = typeof e.isUpdate == "boolean" ? e.isUpdate : void 0, a = z(e.optimisticPatch), l = J(e.optimisticReconcile);
2257
+ return w(t) && (typeof t.viewId == "string" && t.viewId.length > 0 && (r = t.viewId), (t.optimisticActionId === null || typeof t.optimisticActionId == "string") && (i = t.optimisticActionId), typeof t.isOptimistic == "boolean" && (n = t.isOptimistic), typeof t.isUpdate == "boolean" && (o = t.isUpdate), t.optimisticPatch !== void 0 && (a = z(t.optimisticPatch)), t.optimisticReconcile !== void 0 && (l = J(t.optimisticReconcile))), {
2258
+ viewId: r,
2106
2259
  ...i !== void 0 ? { optimisticActionId: i } : {},
2107
2260
  ...n !== void 0 ? { isOptimistic: n } : {},
2108
2261
  ...o !== void 0 ? { isUpdate: o } : {},
@@ -2111,10 +2264,10 @@ function Li(e, t) {
2111
2264
  };
2112
2265
  }
2113
2266
  function z(e) {
2114
- if (!U(e))
2267
+ if (!w(e))
2115
2268
  return;
2116
- const t = e, r = t.id, s = t.actionId, i = t.ordinal, n = t.baseVersion, o = t.supersedes;
2117
- if (typeof r != "string" || r.length === 0 || typeof s != "string" || s.length === 0 || typeof i != "number" || !Number.isFinite(i) || typeof n != "number" || !Number.isFinite(n))
2269
+ const t = e, s = t.id, r = t.actionId, i = t.ordinal, n = t.baseVersion, o = t.supersedes;
2270
+ if (typeof s != "string" || s.length === 0 || typeof r != "string" || r.length === 0 || typeof i != "number" || !Number.isFinite(i) || typeof n != "number" || !Number.isFinite(n))
2118
2271
  return;
2119
2272
  let a;
2120
2273
  if (Array.isArray(o)) {
@@ -2124,123 +2277,123 @@ function z(e) {
2124
2277
  a = l;
2125
2278
  }
2126
2279
  return {
2127
- id: r,
2128
- actionId: s,
2280
+ id: s,
2281
+ actionId: r,
2129
2282
  ordinal: i,
2130
2283
  baseVersion: n,
2131
2284
  ...a && a.length > 0 ? { supersedes: a } : {}
2132
2285
  };
2133
2286
  }
2134
2287
  function J(e) {
2135
- if (!U(e))
2288
+ if (!w(e))
2136
2289
  return;
2137
- const t = e, r = t.baseVersion, s = t.drop;
2138
- if (typeof r != "number" || !Number.isFinite(r))
2290
+ const t = e, s = t.baseVersion, r = t.drop;
2291
+ if (typeof s != "number" || !Number.isFinite(s))
2139
2292
  return;
2140
2293
  let i;
2141
- if (Array.isArray(s)) {
2294
+ if (Array.isArray(r)) {
2142
2295
  const n = [];
2143
- for (const o of s)
2296
+ for (const o of r)
2144
2297
  typeof o == "string" && o.length > 0 && n.push(o);
2145
2298
  i = n;
2146
2299
  }
2147
2300
  return {
2148
- baseVersion: r,
2301
+ baseVersion: s,
2149
2302
  ...i && i.length > 0 ? { drop: i } : {}
2150
2303
  };
2151
2304
  }
2152
- class C extends Error {
2153
- constructor(t, r) {
2154
- super(t), this.causeError = r, this.name = "UiUpdateParseError", r instanceof Error && (this.stack = r.stack);
2305
+ class D extends Error {
2306
+ constructor(t, s) {
2307
+ super(t), this.causeError = s, this.name = "UiUpdateParseError", s instanceof Error && (this.stack = s.stack);
2155
2308
  }
2156
2309
  }
2157
- function pi(e) {
2310
+ function tn(e) {
2158
2311
  let t;
2159
2312
  try {
2160
2313
  t = JSON.parse(e.Json);
2161
2314
  } catch (o) {
2162
- throw new C("Failed to parse UIUpdate.Json payload", o);
2315
+ throw new D("Failed to parse UIUpdate.Json payload", o);
2163
2316
  }
2164
2317
  if (!t || typeof t != "object")
2165
- throw new C("UI update snapshot must be an object");
2166
- const { type: r, version: s } = t;
2167
- if (r !== "full" && r !== "diff")
2168
- throw new C(`Unknown UI update type: ${String(r)}`);
2169
- if (typeof s != "number")
2170
- throw new C("UI update version must be a number");
2171
- const i = r === "full" ? Ri(t.graph, t.metadata, s) : mi(t.diff, t.metadata, s), n = e.Payloads ? Di(e.Payloads) : /* @__PURE__ */ new Map();
2318
+ throw new D("UI update snapshot must be an object");
2319
+ const { type: s, version: r } = t;
2320
+ if (s !== "full" && s !== "diff")
2321
+ throw new D(`Unknown UI update type: ${String(s)}`);
2322
+ if (typeof r != "number")
2323
+ throw new D("UI update version must be a number");
2324
+ const i = s === "full" ? qi(t.graph, t.metadata, r) : Qi(t.changes, t.metadata, r), n = e.Payloads ? Ji(e.Payloads) : /* @__PURE__ */ new Map();
2172
2325
  return {
2173
2326
  snapshot: i,
2174
2327
  payloads: n
2175
2328
  };
2176
2329
  }
2177
- class gi {
2330
+ class en {
2178
2331
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2179
2332
  cache = /* @__PURE__ */ new Map();
2180
2333
  /**
2181
2334
  * Get a cached void handler (no payload) for a node/action combination.
2182
2335
  * Creates and caches the handler if it doesn't exist.
2183
2336
  */
2184
- getHandler(t, r, s) {
2185
- const i = `${t}:${r}`;
2337
+ getHandler(t, s, r) {
2338
+ const i = `${t}:${s}`;
2186
2339
  let n = this.cache.get(i);
2187
- return n || (n = () => s(r), this.cache.set(i, n)), n;
2340
+ return n || (n = () => r(s), this.cache.set(i, n)), n;
2188
2341
  }
2189
2342
  /**
2190
2343
  * Get a cached handler that accepts a payload.
2191
2344
  * Creates and caches the handler if it doesn't exist.
2192
2345
  */
2193
- getHandlerWithPayload(t, r, s) {
2194
- const i = `${t}:${r}:payload`;
2346
+ getHandlerWithPayload(t, s, r) {
2347
+ const i = `${t}:${s}:payload`;
2195
2348
  let n = this.cache.get(i);
2196
- return n || (n = (o) => s(r, o), this.cache.set(i, n)), n;
2349
+ return n || (n = (o) => r(s, o), this.cache.set(i, n)), n;
2197
2350
  }
2198
2351
  /**
2199
2352
  * Get a cached handler for boolean payloads.
2200
2353
  */
2201
- getBooleanHandler(t, r, s) {
2202
- return this.getHandlerWithPayload(t, r, s);
2354
+ getBooleanHandler(t, s, r) {
2355
+ return this.getHandlerWithPayload(t, s, r);
2203
2356
  }
2204
2357
  /**
2205
2358
  * Get a cached handler for string payloads.
2206
2359
  */
2207
- getStringHandler(t, r, s) {
2208
- return this.getHandlerWithPayload(t, r, s);
2360
+ getStringHandler(t, s, r) {
2361
+ return this.getHandlerWithPayload(t, s, r);
2209
2362
  }
2210
2363
  /**
2211
2364
  * Get a cached handler for number payloads.
2212
2365
  */
2213
- getNumberHandler(t, r, s) {
2214
- return this.getHandlerWithPayload(t, r, s);
2366
+ getNumberHandler(t, s, r) {
2367
+ return this.getHandlerWithPayload(t, s, r);
2215
2368
  }
2216
2369
  /**
2217
2370
  * Get a cached handler for number array payloads.
2218
2371
  */
2219
- getNumberArrayHandler(t, r, s) {
2220
- return this.getHandlerWithPayload(t, r, s);
2372
+ getNumberArrayHandler(t, s, r) {
2373
+ return this.getHandlerWithPayload(t, s, r);
2221
2374
  }
2222
2375
  /**
2223
2376
  * Get a cached handler for nullable boolean payloads.
2224
2377
  */
2225
- getNullableBooleanHandler(t, r, s) {
2226
- const i = `${t}:${r}:nullable-bool`;
2378
+ getNullableBooleanHandler(t, s, r) {
2379
+ const i = `${t}:${s}:nullable-bool`;
2227
2380
  let n = this.cache.get(i);
2228
- return n || (n = (o) => s(r, o ?? null), this.cache.set(i, n)), n;
2381
+ return n || (n = (o) => r(s, o ?? null), this.cache.set(i, n)), n;
2229
2382
  }
2230
2383
  /**
2231
2384
  * Invalidate all cached handlers for a specific node.
2232
2385
  * Call this when a node is removed from the tree.
2233
2386
  */
2234
2387
  invalidateNode(t) {
2235
- const r = `${t}:`;
2236
- for (const s of this.cache.keys())
2237
- s.startsWith(r) && this.cache.delete(s);
2388
+ const s = `${t}:`;
2389
+ for (const r of this.cache.keys())
2390
+ r.startsWith(s) && this.cache.delete(r);
2238
2391
  }
2239
2392
  /**
2240
2393
  * Invalidate a specific handler.
2241
2394
  */
2242
- invalidateHandler(t, r) {
2243
- this.cache.delete(`${t}:${r}`), this.cache.delete(`${t}:${r}:payload`), this.cache.delete(`${t}:${r}:nullable-bool`);
2395
+ invalidateHandler(t, s) {
2396
+ this.cache.delete(`${t}:${s}`), this.cache.delete(`${t}:${s}:payload`), this.cache.delete(`${t}:${s}:nullable-bool`);
2244
2397
  }
2245
2398
  /**
2246
2399
  * Clear all cached handlers.
@@ -2255,7 +2408,7 @@ class gi {
2255
2408
  return this.cache.size;
2256
2409
  }
2257
2410
  }
2258
- class Oi {
2411
+ class sn {
2259
2412
  views = /* @__PURE__ */ new Map();
2260
2413
  listeners = /* @__PURE__ */ new Set();
2261
2414
  payloads = /* @__PURE__ */ new Map();
@@ -2277,20 +2430,20 @@ class Oi {
2277
2430
  patchesDirty = !0;
2278
2431
  payloadsDirty = !0;
2279
2432
  // Handler cache for stable event handlers
2280
- handlerCache = new gi();
2433
+ handlerCache = new en();
2281
2434
  getSortedPatches(t) {
2282
- const r = this.buildPatchCacheKey(t.patches);
2283
- if (t.sortedPatchesCacheKey === r && t.sortedPatchesCache)
2435
+ const s = this.buildPatchCacheKey(t.patches);
2436
+ if (t.sortedPatchesCacheKey === s && t.sortedPatchesCache)
2284
2437
  return t.sortedPatchesCache;
2285
- const s = [...t.patches.values()].sort((i, n) => i.ordinal - n.ordinal);
2286
- return t.sortedPatchesCache = s, t.sortedPatchesCacheKey = r, s;
2438
+ const r = [...t.patches.values()].sort((i, n) => i.ordinal - n.ordinal);
2439
+ return t.sortedPatchesCache = r, t.sortedPatchesCacheKey = s, r;
2287
2440
  }
2288
2441
  buildPatchCacheKey(t) {
2289
2442
  if (t.size === 0) return "";
2290
- let r = "";
2291
- for (const [s, i] of t)
2292
- r += r ? `,${s}:${i.ordinal}` : `${s}:${i.ordinal}`;
2293
- return r;
2443
+ let s = "";
2444
+ for (const [r, i] of t)
2445
+ s += s ? `,${r}:${i.ordinal}` : `${r}:${i.ordinal}`;
2446
+ return s;
2294
2447
  }
2295
2448
  invalidatePatchCache(t) {
2296
2449
  t.sortedPatchesCache = void 0, t.sortedPatchesCacheKey = void 0;
@@ -2306,15 +2459,15 @@ class Oi {
2306
2459
  version: -1
2307
2460
  };
2308
2461
  }
2309
- const { snapshot: r, payloads: s } = t, { metadata: i } = r, { viewId: n } = i;
2462
+ const { snapshot: s, payloads: r } = t, { metadata: i } = s, { viewId: n } = i;
2310
2463
  let o = this.views.get(n);
2311
2464
  o || (o = {
2312
2465
  version: 0,
2313
2466
  baselineVersion: 0,
2314
2467
  patches: /* @__PURE__ */ new Map()
2315
2468
  }, this.views.set(n, o));
2316
- const a = r.type === "diff" && i.isUpdate === !0;
2317
- if (r.version < o.version || r.version === o.version && !a)
2469
+ const a = s.type === "diff" && i.isUpdate === !0;
2470
+ if (s.version < o.version || s.version === o.version && !a)
2318
2471
  return !1;
2319
2472
  let l = !1;
2320
2473
  if (this.rootViewId || (this.rootViewId = n, l = !0, this.structureChanged = !0), i.optimisticReconcile?.drop)
@@ -2324,84 +2477,84 @@ class Oi {
2324
2477
  for (const I of i.optimisticPatch.supersedes)
2325
2478
  o.patches.delete(I) && (l = !0, this.patchesDirty = !0, this.invalidatePatchCache(o));
2326
2479
  const u = o.composite ?? o.baseline;
2327
- if (r.type === "full")
2328
- o.baseline = r.root, o.composite = r.root, o.baselineVersion = i.optimisticReconcile?.baseVersion ?? r.version, o.patches.clear(), this.invalidatePatchCache(o), o.version = r.version, l = !0, this.viewsDirty = !0, this.patchesDirty = !0, this.structureChanged = !0, r.root && b(r.root, this.changedNodeIds);
2480
+ if (s.type === "full")
2481
+ o.baseline = s.root, o.composite = s.root, o.baselineVersion = i.optimisticReconcile?.baseVersion ?? s.version, o.patches.clear(), this.invalidatePatchCache(o), o.version = s.version, l = !0, this.viewsDirty = !0, this.patchesDirty = !0, this.structureChanged = !0, s.root && b(s.root, this.changedNodeIds);
2329
2482
  else if (i.optimisticPatch) {
2330
2483
  if (!u)
2331
2484
  return !1;
2332
- const I = K(u, r.diff);
2485
+ const I = j(u, s.changes);
2333
2486
  I !== u && (o.composite = I, l = !0, this.viewsDirty = !0, H(u, I, this.changedNodeIds));
2334
2487
  const c = i.optimisticPatch, h = {
2335
2488
  id: c.id,
2336
2489
  actionId: c.actionId,
2337
2490
  ordinal: c.ordinal,
2338
2491
  baseVersion: c.baseVersion,
2339
- diff: r.diff
2492
+ changes: s.changes
2340
2493
  };
2341
- o.patches.set(h.id, h), this.invalidatePatchCache(o), l = !0, this.patchesDirty = !0, o.version = r.version;
2494
+ o.patches.set(h.id, h), this.invalidatePatchCache(o), l = !0, this.patchesDirty = !0, o.version = s.version;
2342
2495
  } else {
2343
2496
  const I = o.baseline ?? u;
2344
2497
  if (!I)
2345
2498
  return !1;
2346
- const c = K(I, r.diff);
2347
- c !== I ? (o.baseline = c, l = !0, this.viewsDirty = !0) : o.baseline = c, o.baselineVersion = i.optimisticReconcile?.baseVersion ?? r.version;
2499
+ const c = j(I, s.changes);
2500
+ c !== I ? (o.baseline = c, l = !0, this.viewsDirty = !0) : o.baseline = c, o.baselineVersion = i.optimisticReconcile?.baseVersion ?? s.version;
2348
2501
  let h = o.baseline ?? c;
2349
2502
  const E = this.getSortedPatches(o);
2350
- for (const d of E) {
2351
- const _ = K(h, d.diff);
2352
- _ !== h && (l = !0, this.viewsDirty = !0), h = _, d.baseVersion = o.baselineVersion;
2503
+ for (const _ of E) {
2504
+ const y = j(h, _.changes);
2505
+ y !== h && (l = !0, this.viewsDirty = !0), h = y, _.baseVersion = o.baselineVersion;
2353
2506
  }
2354
- o.composite !== h && (o.composite = h, l = !0, this.viewsDirty = !0), u && h ? H(u, h, this.changedNodeIds) : h && b(h, this.changedNodeIds), o.version = r.version;
2507
+ o.composite !== h && (o.composite = h, l = !0, this.viewsDirty = !0), u && h ? H(u, h, this.changedNodeIds) : h && b(h, this.changedNodeIds), o.version = s.version;
2355
2508
  }
2356
- for (const [I, c] of s)
2509
+ for (const [I, c] of r)
2357
2510
  this.payloads.get(I) !== c && (this.payloads.set(I, c), l = !0, this.payloadsDirty = !0);
2358
- return l ? (this.commitSnapshot(), this.notify(), !0) : (o.version = r.version, !1);
2511
+ return l ? (this.commitSnapshot(), this.notify(), !0) : (o.version = s.version, !1);
2359
2512
  }
2360
2513
  replaceFromWire(t) {
2361
- const r = {
2514
+ const s = {
2362
2515
  rootViewId: t.rootViewId,
2363
2516
  views: new Map(t.views),
2364
2517
  payloads: new Map(t.payloads),
2365
2518
  optimisticPatches: new Map(t.optimisticPatches),
2366
2519
  version: t.version
2367
2520
  };
2368
- return this.replaceSnapshot(r);
2521
+ return this.replaceSnapshot(s);
2369
2522
  }
2370
2523
  patchFromOp(t) {
2371
2524
  this.snapshotMode = !0;
2372
- const r = t.expectedBaseVersion;
2373
- if (r !== void 0 && this.snapshot.version !== r)
2525
+ const s = t.expectedBaseVersion;
2526
+ if (s !== void 0 && this.snapshot.version !== s)
2374
2527
  return !1;
2375
- let s = !1, i = null, n = null, o = null;
2528
+ let r = !1, i = null, n = null, o = null;
2376
2529
  const a = () => (i || (i = new Map(this.snapshot.views)), i), l = () => (n || (n = new Map(this.snapshot.payloads)), n), u = () => (o || (o = new Map(this.snapshot.optimisticPatches)), o);
2377
2530
  if (t.deleteViews && t.deleteViews.length > 0)
2378
2531
  for (const h of t.deleteViews)
2379
- a().delete(h) && (s = !0, this.structureChanged = !0);
2532
+ a().delete(h) && (r = !0, this.structureChanged = !0);
2380
2533
  if (t.upsertViews && t.upsertViews.length > 0)
2381
2534
  for (const [h, E] of t.upsertViews) {
2382
- const d = a(), _ = d.get(h);
2383
- _ !== E && (d.set(h, E), s = !0, _ ? H(_, E, this.changedNodeIds) : (b(E, this.changedNodeIds), this.structureChanged = !0));
2535
+ const _ = a(), y = _.get(h);
2536
+ y !== E && (_.set(h, E), r = !0, y ? H(y, E, this.changedNodeIds) : (b(E, this.changedNodeIds), this.structureChanged = !0));
2384
2537
  }
2385
2538
  if (t.deletePayloads && t.deletePayloads.length > 0)
2386
2539
  for (const h of t.deletePayloads)
2387
- l().delete(h) && (s = !0);
2540
+ l().delete(h) && (r = !0);
2388
2541
  if (t.upsertPayloads && t.upsertPayloads.length > 0)
2389
2542
  for (const [h, E] of t.upsertPayloads) {
2390
- const d = l();
2391
- d.get(h) !== E && (d.set(h, E), s = !0);
2543
+ const _ = l();
2544
+ _.get(h) !== E && (_.set(h, E), r = !0);
2392
2545
  }
2393
2546
  if (t.deleteOptimisticPatchesForViews && t.deleteOptimisticPatchesForViews.length > 0)
2394
2547
  for (const h of t.deleteOptimisticPatchesForViews)
2395
- u().delete(h) && (s = !0);
2548
+ u().delete(h) && (r = !0);
2396
2549
  if (t.upsertOptimisticPatches && t.upsertOptimisticPatches.length > 0)
2397
2550
  for (const [h, E] of t.upsertOptimisticPatches) {
2398
- const d = u(), _ = d.get(h);
2399
- ki(_, E) || (d.set(h, E), s = !0);
2551
+ const _ = u(), y = _.get(h);
2552
+ an(y, E) || (_.set(h, E), r = !0);
2400
2553
  }
2401
2554
  const I = t.rootViewId ?? this.snapshot.rootViewId;
2402
- I !== this.snapshot.rootViewId && (s = !0, this.structureChanged = !0);
2555
+ I !== this.snapshot.rootViewId && (r = !0, this.structureChanged = !0);
2403
2556
  const c = t.nextVersion;
2404
- if (c !== this.snapshot.version && (s = !0), !s)
2557
+ if (c !== this.snapshot.version && (r = !0), !r)
2405
2558
  return this.snapshot = { ...this.snapshot, version: c }, !1;
2406
2559
  for (const h of this.changedNodeIds)
2407
2560
  this.nodeVersions.set(h, (this.nodeVersions.get(h) ?? 0) + 1);
@@ -2415,15 +2568,15 @@ class Oi {
2415
2568
  }
2416
2569
  replaceSnapshot(t) {
2417
2570
  this.snapshotMode = !0;
2418
- const r = this.snapshot, s = r.version !== t.version || r.rootViewId !== t.rootViewId || r.views.size !== t.views.size || r.payloads.size !== t.payloads.size || r.optimisticPatches.size !== t.optimisticPatches.size;
2419
- (r.rootViewId !== t.rootViewId || r.views.size !== t.views.size) && (this.structureChanged = !0);
2571
+ const s = this.snapshot, r = s.version !== t.version || s.rootViewId !== t.rootViewId || s.views.size !== t.views.size || s.payloads.size !== t.payloads.size || s.optimisticPatches.size !== t.optimisticPatches.size;
2572
+ (s.rootViewId !== t.rootViewId || s.views.size !== t.views.size) && (this.structureChanged = !0);
2420
2573
  for (const [i, n] of t.views) {
2421
- const o = r.views.get(i);
2574
+ const o = s.views.get(i);
2422
2575
  o ? H(o, n, this.changedNodeIds) : (b(n, this.changedNodeIds), this.structureChanged = !0);
2423
2576
  }
2424
2577
  for (const i of this.changedNodeIds)
2425
2578
  this.nodeVersions.set(i, (this.nodeVersions.get(i) ?? 0) + 1);
2426
- return this.snapshot = t, s && this.notify(), s;
2579
+ return this.snapshot = t, r && this.notify(), r;
2427
2580
  }
2428
2581
  clear() {
2429
2582
  (this.snapshot.rootViewId === void 0 || this.snapshot.rootViewId.length === 0) && this.snapshot.views.size === 0 && this.snapshot.payloads.size === 0 && this.snapshot.optimisticPatches.size === 0 || (this.snapshotMode = !0, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.viewsDirty = !0, this.patchesDirty = !0, this.payloadsDirty = !0, this.snapshot = {
@@ -2441,18 +2594,18 @@ class Oi {
2441
2594
  this.listeners.delete(t);
2442
2595
  };
2443
2596
  }
2444
- subscribeNode(t, r) {
2445
- let s = this.nodeListeners.get(t);
2446
- return s || (s = /* @__PURE__ */ new Set(), this.nodeListeners.set(t, s)), s.add(r), () => {
2447
- s && (s.delete(r), s.size === 0 && this.nodeListeners.delete(t));
2597
+ subscribeNode(t, s) {
2598
+ let r = this.nodeListeners.get(t);
2599
+ return r || (r = /* @__PURE__ */ new Set(), this.nodeListeners.set(t, r)), r.add(s), () => {
2600
+ r && (r.delete(s), r.size === 0 && this.nodeListeners.delete(t));
2448
2601
  };
2449
2602
  }
2450
2603
  getNode(t) {
2451
- const r = this.snapshot.views.get(t);
2452
- if (r)
2453
- return r;
2454
- for (const s of this.snapshot.views.values()) {
2455
- const i = $t(s, t);
2604
+ const s = this.snapshot.views.get(t);
2605
+ if (s)
2606
+ return s;
2607
+ for (const r of this.snapshot.views.values()) {
2608
+ const i = $t(r, t);
2456
2609
  if (i)
2457
2610
  return i;
2458
2611
  }
@@ -2466,15 +2619,15 @@ class Oi {
2466
2619
  return;
2467
2620
  }
2468
2621
  for (const t of this.changedNodeIds) {
2469
- const r = this.nodeListeners.get(t);
2470
- if (r)
2471
- for (const s of r)
2472
- s();
2622
+ const s = this.nodeListeners.get(t);
2623
+ if (s)
2624
+ for (const r of s)
2625
+ r();
2473
2626
  }
2474
2627
  this.changedNodeIds.clear();
2475
2628
  }
2476
2629
  commitSnapshot() {
2477
- let t, r, s;
2630
+ let t, s, r;
2478
2631
  if (this.viewsDirty) {
2479
2632
  const n = /* @__PURE__ */ new Map();
2480
2633
  for (const [o, a] of this.views)
@@ -2497,10 +2650,10 @@ class Oi {
2497
2650
  }))
2498
2651
  );
2499
2652
  }
2500
- r = n, this.patchesDirty = !1;
2653
+ s = n, this.patchesDirty = !1;
2501
2654
  } else
2502
- r = this.snapshot.optimisticPatches;
2503
- this.payloadsDirty ? (s = new Map(this.payloads), this.payloadsDirty = !1) : s = this.snapshot.payloads;
2655
+ s = this.snapshot.optimisticPatches;
2656
+ this.payloadsDirty ? (r = new Map(this.payloads), this.payloadsDirty = !1) : r = this.snapshot.payloads;
2504
2657
  let i = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
2505
2658
  if (i === void 0)
2506
2659
  for (const n of this.views.values())
@@ -2508,8 +2661,8 @@ class Oi {
2508
2661
  this.snapshot = {
2509
2662
  rootViewId: this.rootViewId,
2510
2663
  views: t,
2511
- payloads: s,
2512
- optimisticPatches: r,
2664
+ payloads: r,
2665
+ optimisticPatches: s,
2513
2666
  version: i
2514
2667
  };
2515
2668
  for (const n of this.changedNodeIds)
@@ -2523,59 +2676,59 @@ class Oi {
2523
2676
  }
2524
2677
  }
2525
2678
  }
2526
- class bi {
2679
+ class rn {
2527
2680
  streams = /* @__PURE__ */ new Map();
2528
2681
  listeners = /* @__PURE__ */ new Set();
2529
- apply(t, r) {
2530
- const i = this.getOrCreateStreamEntry(t).store.apply(r);
2682
+ apply(t, s) {
2683
+ const i = this.getOrCreateStreamEntry(t).store.apply(s);
2531
2684
  return i && this.notify(t), i;
2532
2685
  }
2533
2686
  applyStoreOp(t) {
2534
2687
  if (t.type === "ReplaceStreamSnapshot") {
2535
- const r = this.getOrCreateStreamEntry(t.snapshot.streamId), s = r.category !== t.snapshot.category;
2536
- return r.category = t.snapshot.category, r.store.replaceFromWire(t.snapshot) || s ? (this.notify(t.snapshot.streamId), !0) : !1;
2688
+ const s = this.getOrCreateStreamEntry(t.snapshot.streamId), r = s.category !== t.snapshot.category;
2689
+ return s.category = t.snapshot.category, s.store.replaceFromWire(t.snapshot) || r ? (this.notify(t.snapshot.streamId), !0) : !1;
2537
2690
  }
2538
2691
  if (t.type === "PatchStreamSnapshot") {
2539
- const r = this.getOrCreateStreamEntry(t.streamId), s = t.category !== void 0 && r.category !== t.category;
2540
- return t.category !== void 0 && (r.category = t.category), r.store.patchFromOp(t) || s ? (this.notify(t.streamId), !0) : !1;
2692
+ const s = this.getOrCreateStreamEntry(t.streamId), r = t.category !== void 0 && s.category !== t.category;
2693
+ return t.category !== void 0 && (s.category = t.category), s.store.patchFromOp(t) || r ? (this.notify(t.streamId), !0) : !1;
2541
2694
  }
2542
2695
  if (t.type === "ClearStream") {
2543
- const r = this.streams.get(t.streamId);
2544
- return r ? (r.store.clear(), this.notify(t.streamId), !0) : !1;
2696
+ const s = this.streams.get(t.streamId);
2697
+ return s ? (s.store.clear(), this.notify(t.streamId), !0) : !1;
2545
2698
  }
2546
2699
  return t.type === "RemoveStream" ? this.streams.delete(t.streamId) ? (this.notify(t.streamId), !0) : !1 : t.type === "SetStreamCategory" ? (this.setCategory(t.streamId, t.category), !0) : !1;
2547
2700
  }
2548
2701
  applyStoreOps(t) {
2549
- for (const r of t)
2550
- this.applyStoreOp(r);
2702
+ for (const s of t)
2703
+ this.applyStoreOp(s);
2551
2704
  }
2552
2705
  clear(t) {
2553
- const r = this.streams.get(t);
2554
- r && (r.store.clear(), this.notify(t));
2706
+ const s = this.streams.get(t);
2707
+ s && (s.store.clear(), this.notify(t));
2555
2708
  }
2556
2709
  remove(t) {
2557
2710
  this.streams.delete(t) && this.notify(t);
2558
2711
  }
2559
- setCategory(t, r) {
2560
- const s = this.getOrCreateStreamEntry(t);
2561
- s.category !== r && (s.category = r, this.notify(t));
2712
+ setCategory(t, s) {
2713
+ const r = this.getOrCreateStreamEntry(t);
2714
+ r.category !== s && (r.category = s, this.notify(t));
2562
2715
  }
2563
2716
  getSnapshot(t) {
2564
- const r = this.streams.get(t);
2565
- return r ? {
2566
- ...r.store.getSnapshot(),
2717
+ const s = this.streams.get(t);
2718
+ return s ? {
2719
+ ...s.store.getSnapshot(),
2567
2720
  streamId: t,
2568
- category: r.category
2721
+ category: s.category
2569
2722
  } : void 0;
2570
2723
  }
2571
2724
  getSnapshots() {
2572
2725
  const t = [];
2573
- for (const [r, s] of this.streams) {
2574
- const i = s.store.getSnapshot();
2726
+ for (const [s, r] of this.streams) {
2727
+ const i = r.store.getSnapshot();
2575
2728
  t.push({
2576
2729
  ...i,
2577
- streamId: r,
2578
- category: s.category
2730
+ streamId: s,
2731
+ category: r.category
2579
2732
  });
2580
2733
  }
2581
2734
  return t;
@@ -2586,164 +2739,186 @@ class bi {
2586
2739
  };
2587
2740
  }
2588
2741
  getOrCreateStreamEntry(t) {
2589
- let r = this.streams.get(t);
2590
- return r || (r = { store: new Oi() }, this.streams.set(t, r)), r;
2742
+ let s = this.streams.get(t);
2743
+ return s || (s = { store: new sn() }, this.streams.set(t, s)), s;
2591
2744
  }
2592
2745
  notify(t) {
2593
- for (const r of this.listeners)
2594
- r(t);
2746
+ for (const s of this.listeners)
2747
+ s(t);
2595
2748
  }
2596
2749
  }
2597
- function K(e, t, r) {
2598
- if (e.id !== t.id)
2750
+ function j(e, t, s) {
2751
+ if (t.length === 0)
2599
2752
  return e;
2600
- let s = e, i = !1;
2601
- if (t.textUpdates.length > 0) {
2602
- const _ = Bi(e, t.textUpdates);
2603
- s = _.node, i = _.changed;
2604
- }
2605
- let n = !1, o = s.props;
2606
- if (t.changedProps.size > 0)
2607
- for (const [_, w] of t.changedProps.entries()) {
2608
- const p = o[_];
2609
- if (w === void 0)
2610
- (p !== void 0 || _ in o) && (n || (o = B(o), n = !0), delete o[_]);
2611
- else if (q(w)) {
2612
- const O = B(w);
2613
- k(O, p) || (n || (o = B(o), n = !0), o[_] = O);
2753
+ const r = /* @__PURE__ */ new Map();
2754
+ for (const i of t)
2755
+ r.set(i.nodeId, i);
2756
+ return Wt(e, r);
2757
+ }
2758
+ function Wt(e, t, s) {
2759
+ const r = t.get(e.id);
2760
+ let i = e, n = !1;
2761
+ if (r?.textUpdates && r.textUpdates.length > 0) {
2762
+ const f = In(e, r.textUpdates);
2763
+ i = f.node, n = f.changed;
2764
+ }
2765
+ let o = !1, a = i.props;
2766
+ if (r?.changedProps && r.changedProps.size > 0)
2767
+ for (const [f, A] of r.changedProps.entries()) {
2768
+ const T = a[f];
2769
+ if (A === void 0)
2770
+ (T !== void 0 || f in a) && (o || (a = V(a), o = !0), delete a[f]);
2771
+ else if (q(A)) {
2772
+ const S = V(A);
2773
+ k(S, T) || (o || (a = V(a), o = !0), a[f] = S);
2614
2774
  } else
2615
- k(w, p) || (n || (o = B(o), n = !0), o[_] = w);
2616
- }
2617
- let a = !1, l = s.styleIds;
2618
- t.styleIds !== void 0 && (jt(s.styleIds, t.styleIds) || (l = t.styleIds, a = !0));
2619
- const u = s.children ?? [];
2620
- let I = u, c = !1;
2621
- if (t.removed.length > 0) {
2622
- const _ = t.removed, w = _.length > 8, p = w ? new Set(_) : void 0, O = w ? (T) => p.has(T) : (T) => _.includes(T);
2623
- let A;
2624
- for (let T = 0; T < I.length; T++) {
2625
- const L = I[T];
2626
- O(L.id) ? A || (A = I.slice(0, T)) : A && A.push(L);
2627
- }
2628
- A && (I = A, c = !0);
2629
- }
2630
- if (t.updated.length > 0) {
2631
- const _ = t.updated, w = _.length > 8, p = w ? new Map(_.map((T) => [T.id, T])) : void 0, O = w ? (T) => p.get(T) : (T) => _.find((L) => L.id === T);
2632
- let A;
2633
- for (let T = 0; T < I.length; T++) {
2634
- const L = I[T], nt = O(L.id);
2635
- if (!nt)
2636
- continue;
2637
- const ot = K(L, nt);
2638
- ot !== L && (A || (A = I.slice()), A[T] = ot);
2639
- }
2640
- A && (I = A, c = !0);
2641
- }
2642
- t.added.length > 0 && (I = I.concat(t.added), c = !0);
2643
- const h = s.type !== t.type;
2644
- return i || n || h || a || c ? !n && !c && !h && !a ? s : {
2645
- id: t.id,
2646
- type: t.type,
2647
- props: n ? o : s.props,
2648
- children: c ? I : u,
2649
- styleIds: a ? l : s.styleIds
2775
+ k(A, T) || (o || (a = V(a), o = !0), a[f] = A);
2776
+ }
2777
+ let l = !1, u = i.styleIds;
2778
+ r?.styleIds !== void 0 && (jt(i.styleIds, r.styleIds) || (u = r.styleIds, l = !0));
2779
+ const I = i.children ?? [];
2780
+ let c = I, h = !1;
2781
+ if (r?.removals && r.removals.length > 0 || r?.moves && r.moves.length > 0 || r?.inserts && r.inserts.length > 0) {
2782
+ const f = c.slice();
2783
+ if (r?.removals && r.removals.length > 0) {
2784
+ const A = [...r.removals].sort((T, S) => S.index - T.index);
2785
+ for (const T of A)
2786
+ T.index >= 0 && T.index < f.length && f.splice(T.index, 1);
2787
+ h = !0;
2788
+ }
2789
+ if (r?.moves && r.moves.length > 0) {
2790
+ const A = [...r.moves].sort((S, g) => S.toIndex - g.toIndex), T = /* @__PURE__ */ new Map();
2791
+ for (const S of A) {
2792
+ const g = f.findIndex(($) => $.id === S.nodeId);
2793
+ g >= 0 && (T.set(S.nodeId, f[g]), f.splice(g, 1));
2794
+ }
2795
+ for (const S of A) {
2796
+ const g = T.get(S.nodeId);
2797
+ if (g) {
2798
+ const $ = Math.min(S.toIndex, f.length);
2799
+ f.splice($, 0, g);
2800
+ }
2801
+ }
2802
+ h = !0;
2803
+ }
2804
+ if (r?.inserts && r.inserts.length > 0) {
2805
+ const A = [...r.inserts].sort((T, S) => T.index - S.index);
2806
+ for (const T of A) {
2807
+ const S = Math.min(T.index, f.length);
2808
+ f.splice(S, 0, T.node);
2809
+ }
2810
+ h = !0;
2811
+ }
2812
+ c = f;
2813
+ }
2814
+ let _;
2815
+ for (let f = 0; f < c.length; f++) {
2816
+ const A = c[f], T = Wt(A, t);
2817
+ T !== A && (_ || (_ = c.slice()), _[f] = T);
2818
+ }
2819
+ return _ && (c = _, h = !0), n || o || l || h ? !o && !h && !l ? i : {
2820
+ id: e.id,
2821
+ type: e.type,
2822
+ props: o ? a : i.props,
2823
+ children: h ? c : I,
2824
+ styleIds: l ? u : i.styleIds
2650
2825
  } : e;
2651
2826
  }
2652
2827
  function b(e, t) {
2653
2828
  if (t.add(e.id), e.children)
2654
- for (const r of e.children)
2655
- b(r, t);
2829
+ for (const s of e.children)
2830
+ b(s, t);
2656
2831
  }
2657
2832
  const x = [];
2658
- function Pi(e) {
2833
+ function nn(e) {
2659
2834
  for (; x.length <= e; )
2660
2835
  x.push(/* @__PURE__ */ new Map());
2661
2836
  return x[e].clear(), x[e];
2662
2837
  }
2663
- function H(e, t, r) {
2664
- Yt(e, t, r, 0);
2838
+ function H(e, t, s) {
2839
+ Kt(e, t, s, 0);
2665
2840
  }
2666
- function Yt(e, t, r, s) {
2841
+ function Kt(e, t, s, r) {
2667
2842
  if (e === t)
2668
2843
  return;
2669
- (e.type !== t.type || !Fi(e.props, t.props) || !jt(e.styleIds, t.styleIds)) && r.add(t.id);
2844
+ (e.type !== t.type || !on(e.props, t.props) || !jt(e.styleIds, t.styleIds)) && s.add(t.id);
2670
2845
  const n = e.children ?? [], o = t.children ?? [];
2671
2846
  if (n !== o) {
2672
- const a = Pi(s);
2847
+ const a = nn(r);
2673
2848
  for (const l of n)
2674
2849
  a.set(l.id, l);
2675
2850
  for (const l of o) {
2676
2851
  const u = a.get(l.id);
2677
- u ? Yt(u, l, r, s + 1) : b(l, r);
2852
+ u ? Kt(u, l, s, r + 1) : b(l, s);
2678
2853
  }
2679
- n.length !== o.length && r.add(t.id);
2854
+ n.length !== o.length && s.add(t.id);
2680
2855
  }
2681
2856
  }
2682
- function Fi(e, t) {
2857
+ function on(e, t) {
2683
2858
  return k(e, t);
2684
2859
  }
2685
2860
  function $t(e, t) {
2686
2861
  if (e.id === t)
2687
2862
  return e;
2688
2863
  if (e.children)
2689
- for (const r of e.children) {
2690
- const s = $t(r, t);
2691
- if (s)
2692
- return s;
2864
+ for (const s of e.children) {
2865
+ const r = $t(s, t);
2866
+ if (r)
2867
+ return r;
2693
2868
  }
2694
2869
  }
2695
2870
  function jt(e, t) {
2696
2871
  return k(e, t);
2697
2872
  }
2698
- function ki(e, t) {
2873
+ function an(e, t) {
2699
2874
  if (e === t) return !0;
2700
2875
  if (!e || !t || e.length !== t.length) return !1;
2701
- for (let r = 0; r < e.length; r++) {
2702
- const s = e[r], i = t[r];
2703
- if (s.id !== i.id || s.actionId !== i.actionId || s.ordinal !== i.ordinal || s.baseVersion !== i.baseVersion)
2876
+ for (let s = 0; s < e.length; s++) {
2877
+ const r = e[s], i = t[s];
2878
+ if (r.id !== i.id || r.actionId !== i.actionId || r.ordinal !== i.ordinal || r.baseVersion !== i.baseVersion)
2704
2879
  return !1;
2705
2880
  }
2706
2881
  return !0;
2707
2882
  }
2708
- function Vi(e, t) {
2883
+ function ln(e, t) {
2709
2884
  if (t.length === 0)
2710
2885
  return e;
2711
- const r = [...t].sort((n, o) => n.start - o.start);
2712
- let s = e, i = 0;
2713
- for (const n of r) {
2714
- const o = It(n.start + i, 0, s.length);
2886
+ const s = [...t].sort((n, o) => n.start - o.start);
2887
+ let r = e, i = 0;
2888
+ for (const n of s) {
2889
+ const o = at(n.start + i, 0, r.length);
2715
2890
  if (n.end == null) {
2716
- const I = s.slice(o), c = Mi(I, n.insertedText);
2717
- s = s.slice(0, o) + n.insertedText + I.slice(c), i += n.insertedText.length - c;
2891
+ const I = r.slice(o), c = hn(I, n.insertedText);
2892
+ r = r.slice(0, o) + n.insertedText + I.slice(c), i += n.insertedText.length - c;
2718
2893
  continue;
2719
2894
  }
2720
- const a = n.end + i, l = It(a, o, s.length), u = l - o;
2721
- s = s.slice(0, o) + n.insertedText + s.slice(l), i += n.insertedText.length - u;
2895
+ const a = n.end + i, l = at(a, o, r.length), u = l - o;
2896
+ r = r.slice(0, o) + n.insertedText + r.slice(l), i += n.insertedText.length - u;
2722
2897
  }
2723
- return s;
2898
+ return r;
2724
2899
  }
2725
- function Bi(e, t, r) {
2900
+ function In(e, t, s) {
2726
2901
  if (t.length === 0)
2727
2902
  return { node: e, changed: !1 };
2728
- const s = /* @__PURE__ */ new Map();
2903
+ const r = /* @__PURE__ */ new Map();
2729
2904
  for (const i of t) {
2730
- const n = s.get(i.nodeId);
2731
- n ? n.push(i) : s.set(i.nodeId, [i]);
2905
+ const n = r.get(i.nodeId);
2906
+ n ? n.push(i) : r.set(i.nodeId, [i]);
2732
2907
  }
2733
- return Xt(e, s);
2908
+ return Xt(e, r);
2734
2909
  }
2735
- function Xt(e, t, r) {
2736
- const s = t.get(e.id) ?? [];
2910
+ function Xt(e, t, s) {
2911
+ const r = t.get(e.id) ?? [];
2737
2912
  let i = !1, n = e.props;
2738
- if (s.length > 0) {
2913
+ if (r.length > 0) {
2739
2914
  const u = /* @__PURE__ */ new Map();
2740
- for (const I of s) {
2915
+ for (const I of r) {
2741
2916
  const c = u.get(I.propertyName);
2742
2917
  c ? c.push(I) : u.set(I.propertyName, [I]);
2743
2918
  }
2744
2919
  for (const [I, c] of u.entries()) {
2745
- const h = n[I], d = Vi(typeof h == "string" ? h : "", c);
2746
- i || (n = B(n), i = !0), n[I] = d;
2920
+ const h = n[I], _ = ln(typeof h == "string" ? h : "", c);
2921
+ i || (n = V(n), i = !0), n[I] = _;
2747
2922
  }
2748
2923
  }
2749
2924
  let o = !1;
@@ -2768,20 +2943,20 @@ function Xt(e, t, r) {
2768
2943
  changed: !0
2769
2944
  };
2770
2945
  }
2771
- function It(e, t, r) {
2772
- return Math.max(t, Math.min(r, e));
2946
+ function at(e, t, s) {
2947
+ return Math.max(t, Math.min(s, e));
2773
2948
  }
2774
- function Mi(e, t) {
2775
- const r = Math.min(e.length, t.length);
2776
- let s = 0;
2777
- for (; s < r && e.charCodeAt(s) === t.charCodeAt(s); )
2778
- s++;
2779
- return s;
2780
- }
2781
- function B(e) {
2782
- const t = {}, r = Object.keys(e);
2783
- for (let s = 0; s < r.length; s++) {
2784
- const i = r[s];
2949
+ function hn(e, t) {
2950
+ const s = Math.min(e.length, t.length);
2951
+ let r = 0;
2952
+ for (; r < s && e.charCodeAt(r) === t.charCodeAt(r); )
2953
+ r++;
2954
+ return r;
2955
+ }
2956
+ function V(e) {
2957
+ const t = {}, s = Object.keys(e);
2958
+ for (let r = 0; r < s.length; r++) {
2959
+ const i = s[r];
2785
2960
  t[i] = e[i];
2786
2961
  }
2787
2962
  return t;
@@ -2795,48 +2970,49 @@ function k(e, t) {
2795
2970
  if (Array.isArray(e) && Array.isArray(t)) {
2796
2971
  if (e.length !== t.length)
2797
2972
  return !1;
2798
- for (let r = 0; r < e.length; r++)
2799
- if (!k(e[r], t[r]))
2973
+ for (let s = 0; s < e.length; s++)
2974
+ if (!k(e[s], t[s]))
2800
2975
  return !1;
2801
2976
  return !0;
2802
2977
  }
2803
2978
  if (q(e) && q(t)) {
2804
- const r = Object.keys(e), s = Object.keys(t);
2805
- if (r.length !== s.length)
2979
+ const s = Object.keys(e), r = Object.keys(t);
2980
+ if (s.length !== r.length)
2806
2981
  return !1;
2807
- for (const i of r)
2982
+ for (const i of s)
2808
2983
  if (!k(e[i], t[i]))
2809
2984
  return !1;
2810
2985
  return !0;
2811
2986
  }
2812
2987
  return !1;
2813
2988
  }
2814
- function vi(e) {
2989
+ function cn(e) {
2815
2990
  return new Worker(
2816
- "" + new URL("assets/ui-worker-CBwhM0DU.js", import.meta.url).href,
2991
+ "" + new URL("assets/ui-worker-B6ND4RDC.js", import.meta.url).href,
2817
2992
  {
2818
2993
  type: "module",
2819
2994
  name: e?.name
2820
2995
  }
2821
2996
  );
2822
2997
  }
2823
- const D = zt("IkonUICore");
2824
- class xi {
2998
+ const R = zt("IkonUICore");
2999
+ class _n {
2825
3000
  unsubscribeProtocolMessages;
2826
3001
  client = null;
2827
- uiStore = new bi();
3002
+ uiStore = new rn();
2828
3003
  uiWorker = null;
2829
3004
  uiStyles = /* @__PURE__ */ new Map();
2830
3005
  uiUpdateListeners = /* @__PURE__ */ new Set();
2831
3006
  uiStyleListeners = /* @__PURE__ */ new Set();
3007
+ uiStyleDeleteListeners = /* @__PURE__ */ new Set();
2832
3008
  uiStreamClearedListeners = /* @__PURE__ */ new Set();
2833
3009
  useUiWorker;
2834
3010
  constructor(t) {
2835
- const r = t?.threading?.uiWorker ?? "auto";
2836
- this.useUiWorker = r !== "disabled" && typeof Worker < "u", t?.client && this.initialize(t.client, t);
3011
+ const s = t?.threading?.uiWorker ?? "auto";
3012
+ this.useUiWorker = s !== "disabled" && typeof Worker < "u", t?.client && this.initialize(t.client, t);
2837
3013
  }
2838
3014
  dispose() {
2839
- this.unsubscribeProtocolMessages?.(), this.uiWorker?.terminate(), this.uiWorker = null, this.client = null, this.uiStyleListeners.clear(), this.uiStyles.clear();
3015
+ this.unsubscribeProtocolMessages?.(), this.uiWorker?.terminate(), this.uiWorker = null, this.client = null, this.uiStyleListeners.clear(), this.uiStyleDeleteListeners.clear(), this.uiStyles.clear();
2840
3016
  }
2841
3017
  subscribeToUiUpdates(t) {
2842
3018
  return this.uiUpdateListeners.add(t), () => {
@@ -2853,13 +3029,18 @@ class xi {
2853
3029
  this.uiStyleListeners.delete(t);
2854
3030
  };
2855
3031
  }
3032
+ subscribeToUiStyleDeletes(t) {
3033
+ return this.uiStyleDeleteListeners.add(t), () => {
3034
+ this.uiStyleDeleteListeners.delete(t);
3035
+ };
3036
+ }
2856
3037
  getUiStyles() {
2857
3038
  return Array.from(this.uiStyles.values());
2858
3039
  }
2859
- initialize(t, r) {
2860
- this.client = t, this.useUiWorker && this.startUiWorker(r);
2861
- const s = {
2862
- opcodeGroupsMask: R.GROUP_CORE | R.GROUP_UI | R.GROUP_ACTIONS
3040
+ initialize(t, s) {
3041
+ this.client = t, this.useUiWorker && this.startUiWorker(s);
3042
+ const r = {
3043
+ opcodeGroupsMask: m.GROUP_CORE | m.GROUP_UI | m.GROUP_ACTIONS
2863
3044
  };
2864
3045
  this.unsubscribeProtocolMessages = t.subscribeToProtocolMessages((i) => {
2865
3046
  if (this.uiWorker) {
@@ -2867,57 +3048,57 @@ class xi {
2867
3048
  return;
2868
3049
  }
2869
3050
  this.handleProtocolMessage(i);
2870
- }, s);
3051
+ }, r);
2871
3052
  }
2872
3053
  startUiWorker(t) {
2873
3054
  try {
2874
- this.uiWorker = new vi();
3055
+ this.uiWorker = new cn();
2875
3056
  } catch (i) {
2876
- D.warn("Failed to create UI worker, falling back to main thread", i), this.uiWorker = null;
3057
+ R.warn("Failed to create UI worker, falling back to main thread", i), this.uiWorker = null;
2877
3058
  return;
2878
3059
  }
2879
- const r = t?.threading?.flushIntervalMs, s = t?.threading?.maxLatencyMs;
2880
- this.uiWorker.postMessage({ type: "configure", flushIntervalMs: r, maxLatencyMs: s }), this.uiWorker.addEventListener("message", (i) => {
3060
+ const s = t?.threading?.flushIntervalMs, r = t?.threading?.maxLatencyMs;
3061
+ this.uiWorker.postMessage({ type: "configure", flushIntervalMs: s, maxLatencyMs: r }), this.uiWorker.addEventListener("message", (i) => {
2881
3062
  this.handleUiStoreOpBatch(i.data);
2882
3063
  }), this.uiWorker.addEventListener("error", (i) => {
2883
3064
  const n = [i.message, i.filename, i.lineno, i.colno].filter((o) => o != null && String(o).length > 0);
2884
- D.warn(`UI worker failed, falling back to main thread: ${n.join(" ")}`.trim()), this.uiWorker?.terminate(), this.uiWorker = null, this.rehydrateStoresForMainThread();
3065
+ R.warn(`UI worker failed, falling back to main thread: ${n.join(" ")}`.trim()), this.uiWorker?.terminate(), this.uiWorker = null, this.rehydrateStoresForMainThread();
2885
3066
  });
2886
3067
  }
2887
3068
  rehydrateStoresForMainThread() {
2888
3069
  for (const t of this.uiStore.getSnapshots()) {
2889
3070
  if (!t.rootViewId)
2890
3071
  continue;
2891
- const r = t.views.get(t.rootViewId);
2892
- if (!r)
3072
+ const s = t.views.get(t.rootViewId);
3073
+ if (!s)
2893
3074
  continue;
2894
- const s = {
3075
+ const r = {
2895
3076
  snapshot: {
2896
3077
  type: "full",
2897
3078
  version: t.version ?? 0,
2898
3079
  metadata: { viewId: t.rootViewId },
2899
- root: r
3080
+ root: s
2900
3081
  },
2901
3082
  payloads: t.payloads
2902
3083
  };
2903
- this.uiStore.apply(t.streamId, s);
3084
+ this.uiStore.apply(t.streamId, r);
2904
3085
  }
2905
3086
  }
2906
3087
  forwardMessageToWorker(t) {
2907
3088
  if (this.uiWorker)
2908
3089
  try {
2909
- const r = t.slice().buffer;
2910
- this.uiWorker.postMessage({ type: "protocol", message: r }, [r]);
2911
- } catch (r) {
2912
- D.warn("Failed to forward message to UI worker", r);
3090
+ const s = t.slice().buffer;
3091
+ this.uiWorker.postMessage({ type: "protocol", message: s }, [s]);
3092
+ } catch (s) {
3093
+ R.warn("Failed to forward message to UI worker", s);
2913
3094
  }
2914
3095
  }
2915
3096
  handleUiStoreOpBatch(t) {
2916
- for (const r of t.ops)
2917
- this.applyUiStoreOp(r);
3097
+ for (const s of t.ops)
3098
+ this.applyUiStoreOp(s);
2918
3099
  if (t.acks && t.acks.length > 0)
2919
- for (const r of t.acks)
2920
- this.sendUiUpdateAck(r.trackId, r.version);
3100
+ for (const s of t.acks)
3101
+ this.sendUiUpdateAck(s.trackId, s.version);
2921
3102
  }
2922
3103
  applyUiStoreOp(t) {
2923
3104
  if (t.type === "UpsertUiStyle") {
@@ -2925,7 +3106,7 @@ class xi {
2925
3106
  return;
2926
3107
  }
2927
3108
  if (t.type === "RemoveUiStyle") {
2928
- this.uiStyles.delete(t.styleId);
3109
+ this.uiStyles.delete(t.styleId) && this.notifyUiStyleDelete([t.styleId]);
2929
3110
  return;
2930
3111
  }
2931
3112
  if (t.type === "ClearStream") {
@@ -2943,7 +3124,7 @@ class xi {
2943
3124
  if (t.type === "ReplaceStreamSnapshot" || t.type === "PatchStreamSnapshot") {
2944
3125
  if (!this.uiStore.applyStoreOp(t))
2945
3126
  return;
2946
- const s = t.type === "ReplaceStreamSnapshot" ? t.snapshot.streamId : t.streamId, i = this.uiStore.getSnapshot(s);
3127
+ const r = t.type === "ReplaceStreamSnapshot" ? t.snapshot.streamId : t.streamId, i = this.uiStore.getSnapshot(r);
2947
3128
  if (!i?.rootViewId)
2948
3129
  return;
2949
3130
  const n = i.views.get(i.rootViewId);
@@ -2958,25 +3139,28 @@ class xi {
2958
3139
  },
2959
3140
  payloads: i.payloads
2960
3141
  };
2961
- this.notifyUiUpdate(s, o);
3142
+ this.notifyUiUpdate(r, o);
2962
3143
  return;
2963
3144
  }
2964
3145
  }
2965
3146
  handleProtocolMessage(t) {
2966
3147
  switch (Jt(t)) {
2967
- case R.CORE_GLOBAL_STATE:
3148
+ case m.CORE_GLOBAL_STATE:
2968
3149
  this.handleGlobalState(t);
2969
3150
  return;
2970
- case R.UI_UPDATE:
3151
+ case m.UI_UPDATE:
2971
3152
  this.handleUiUpdate(t);
2972
3153
  return;
2973
- case R.UI_STYLES:
3154
+ case m.UI_STYLES:
2974
3155
  this.handleUiStyles(t);
2975
3156
  return;
2976
- case R.UI_STYLES_BATCH:
3157
+ case m.UI_STYLES_BATCH:
2977
3158
  this.handleUiStylesBatch(t);
2978
3159
  return;
2979
- case R.ACTION_UI_CLEAR_STREAM:
3160
+ case m.UI_STYLES_DELETE:
3161
+ this.handleUiStylesDelete(t);
3162
+ return;
3163
+ case m.ACTION_UI_CLEAR_STREAM:
2980
3164
  this.handleClearStream(t);
2981
3165
  return;
2982
3166
  default:
@@ -2985,86 +3169,101 @@ class xi {
2985
3169
  }
2986
3170
  handleGlobalState(t) {
2987
3171
  try {
2988
- const r = qr(t), s = /* @__PURE__ */ new Set();
2989
- for (const i of Object.values(r.UIStreams ?? {}))
2990
- s.add(i.StreamId), this.uiStore.setCategory(i.StreamId, i.Info?.Category);
3172
+ const s = Ir(t), r = /* @__PURE__ */ new Set();
3173
+ for (const i of Object.values(s.UIStreams ?? {}))
3174
+ r.add(i.StreamId), this.uiStore.setCategory(i.StreamId, i.Info?.Category);
2991
3175
  for (const i of this.uiStore.getSnapshots())
2992
- s.has(i.streamId) || (this.uiStore.remove(i.streamId), this.notifyUiStreamCleared(i.streamId));
2993
- } catch (r) {
2994
- D.error("Failed to handle global state", r);
3176
+ r.has(i.streamId) || (this.uiStore.remove(i.streamId), this.notifyUiStreamCleared(i.streamId));
3177
+ } catch (s) {
3178
+ R.error("Failed to handle global state", s);
2995
3179
  }
2996
3180
  }
2997
3181
  handleUiUpdate(t) {
2998
- const r = at(t), s = `${r.senderId}_${r.trackId}`;
3182
+ const s = nt(t), r = `${s.senderId}_${s.trackId}`;
2999
3183
  try {
3000
- const i = Ti(t), n = pi(i);
3001
- this.notifyUiUpdate(s, n), this.uiStore.apply(s, n), this.sendUiUpdateAck(r.trackId, n.snapshot.version);
3184
+ const i = Mi(t), n = tn(i);
3185
+ this.notifyUiUpdate(r, n), this.uiStore.apply(r, n), this.sendUiUpdateAck(s.trackId, n.snapshot.version);
3002
3186
  } catch (i) {
3003
- i instanceof C ? D.warn("Failed to parse UI update", i.causeError ?? i) : D.error("Failed to apply UI update", i);
3187
+ i instanceof D ? R.warn("Failed to parse UI update", i.causeError ?? i) : R.error("Failed to apply UI update", i);
3004
3188
  }
3005
3189
  }
3006
3190
  handleUiStyles(t) {
3007
3191
  try {
3008
- const r = $s(t);
3009
- if (!r.StyleId) return;
3010
- const s = {
3011
- styleId: r.StyleId,
3012
- css: r.Style?.css,
3013
- common: r.Style?.common
3192
+ const s = ii(t);
3193
+ if (!s.StyleId) return;
3194
+ const r = {
3195
+ styleId: s.StyleId,
3196
+ css: s.Style?.css,
3197
+ common: s.Style?.common
3014
3198
  };
3015
- this.uiStyles.set(s.styleId, s), this.notifyUiStyle(s);
3016
- } catch (r) {
3017
- D.error("Failed to handle UI styles", r);
3199
+ this.uiStyles.set(r.styleId, r), this.notifyUiStyle(r);
3200
+ } catch (s) {
3201
+ R.error("Failed to handle UI styles", s);
3018
3202
  }
3019
3203
  }
3020
3204
  handleUiStylesBatch(t) {
3021
3205
  try {
3022
- const r = ei(t);
3023
- if (!r.Styles) return;
3024
- for (const s of r.Styles) {
3025
- if (!s.StyleId) continue;
3206
+ const s = Ei(t);
3207
+ if (!s.Styles) return;
3208
+ for (const r of s.Styles) {
3209
+ if (!r.StyleId) continue;
3026
3210
  const i = {
3027
- styleId: s.StyleId,
3028
- css: s.Style?.css,
3029
- common: s.Style?.common
3211
+ styleId: r.StyleId,
3212
+ css: r.Style?.css,
3213
+ common: r.Style?.common
3030
3214
  };
3031
3215
  this.uiStyles.set(i.styleId, i), this.notifyUiStyle(i);
3032
3216
  }
3033
- } catch (r) {
3034
- D.error("Failed to handle UI styles batch", r);
3217
+ } catch (s) {
3218
+ R.error("Failed to handle UI styles batch", s);
3219
+ }
3220
+ }
3221
+ handleUiStylesDelete(t) {
3222
+ try {
3223
+ const s = Li(t);
3224
+ if (!s.StyleIds || s.StyleIds.length === 0) return;
3225
+ for (const r of s.StyleIds)
3226
+ this.uiStyles.delete(r);
3227
+ this.notifyUiStyleDelete(s.StyleIds);
3228
+ } catch (s) {
3229
+ R.error("Failed to handle UI styles delete", s);
3035
3230
  }
3036
3231
  }
3037
3232
  handleClearStream(t) {
3038
- const r = at(t), s = `${r.senderId}_${r.trackId}`;
3039
- this.uiStore.clear(s), this.notifyUiStreamCleared(s);
3233
+ const s = nt(t), r = `${s.senderId}_${s.trackId}`;
3234
+ this.uiStore.clear(r), this.notifyUiStreamCleared(r);
3040
3235
  }
3041
- notifyUiUpdate(t, r) {
3042
- for (const s of this.uiUpdateListeners)
3043
- s(t, r);
3236
+ notifyUiUpdate(t, s) {
3237
+ for (const r of this.uiUpdateListeners)
3238
+ r(t, s);
3044
3239
  }
3045
3240
  notifyUiStyle(t) {
3046
- for (const r of this.uiStyleListeners)
3047
- r(t);
3241
+ for (const s of this.uiStyleListeners)
3242
+ s(t);
3243
+ }
3244
+ notifyUiStyleDelete(t) {
3245
+ for (const s of this.uiStyleDeleteListeners)
3246
+ s(t);
3048
3247
  }
3049
3248
  notifyUiStreamCleared(t) {
3050
- for (const r of this.uiStreamClearedListeners)
3051
- r(t);
3249
+ for (const s of this.uiStreamClearedListeners)
3250
+ s(t);
3052
3251
  }
3053
- sendUiUpdateAck(t, r) {
3054
- if (this.client && !(!Number.isFinite(r) || r < 0))
3252
+ sendUiUpdateAck(t, s) {
3253
+ if (this.client && !(!Number.isFinite(s) || s < 0))
3055
3254
  try {
3056
- const s = Ui({ Version: r }, this.client.sessionId ?? 0, { trackId: t });
3057
- this.client.sendProtocolMessage(s);
3058
- } catch (s) {
3059
- D.warn("Failed to send UI update ack", s);
3255
+ const r = Wi({ Version: s }, this.client.sessionId ?? 0, { trackId: t });
3256
+ this.client.sendProtocolMessage(r);
3257
+ } catch (r) {
3258
+ R.warn("Failed to send UI update ack", r);
3060
3259
  }
3061
3260
  }
3062
3261
  }
3063
3262
  export {
3064
- gi as HandlerCache,
3065
- xi as IkonUICore,
3066
- bi as UiStore,
3067
- Oi as UiStreamStore,
3068
- C as UiUpdateParseError,
3069
- pi as parseUiUpdate
3263
+ en as HandlerCache,
3264
+ _n as IkonUICore,
3265
+ rn as UiStore,
3266
+ sn as UiStreamStore,
3267
+ D as UiUpdateParseError,
3268
+ tn as parseUiUpdate
3070
3269
  };