@ikonai/sdk-ui 0.0.42 → 1.0.0

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,1205 @@ 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();
1450
+ break;
1451
+ }
1452
+ case Ps: {
1453
+ if (s.isNull) throw new Error();
1454
+ t.Description = s.asString();
1384
1455
  break;
1385
1456
  }
1386
- case Cr: {
1387
- if (r.isNull) throw new Error();
1388
- t.Height = r.asInt32();
1457
+ case Fs: {
1458
+ if (s.isNull) throw new Error();
1459
+ t.IsHardwareAccelerated = s.asBool();
1389
1460
  break;
1390
1461
  }
1391
- case Dr: {
1392
- if (r.isNull) throw new Error();
1393
- t.Codec = r.asInt32();
1462
+ case ks: {
1463
+ if (s.isNull) throw new Error();
1464
+ t.Bitrate = s.asInt32();
1394
1465
  break;
1395
1466
  }
1396
- case Rr: {
1397
- if (r.isNull) throw new Error();
1398
- t.Width = r.asInt32();
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 = 2589786682, qs = 3219210453, Qs = 3678477544, Zs = 3696445035, tr = 3707543140, er = 3712281496, sr = 3823842552, rr = 3895362455, ir = 3897397815, nr = 4225107827;
1485
+ function or(e) {
1405
1486
  const t = {};
1406
- return Ot(t), t;
1487
+ return pt(t), t;
1407
1488
  }
1408
- function Ot(e) {
1409
- 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;
1489
+ function pt(e) {
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.IsGitSourceMode = !1, 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 ar(e, t) {
1493
+ const s = p.create(e);
1494
+ return lr(s, t);
1414
1495
  }
1415
- function zr(e, t) {
1416
- const r = t ?? jr();
1417
- return Ot(r), Jr(e, r), r;
1496
+ function lr(e, t) {
1497
+ const s = t ?? or();
1498
+ return pt(s), Ir(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 Ir(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 = cr(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 = ur(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.IsGitSourceMode = s.asBool();
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.OrganisationName = s.asString();
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.Functions = 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.UIStreams = _r(s.asDictionary());
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.SpaceId = 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.PrimaryUserId = 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.ChannelInstanceId = s.asString();
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.AudioStreams = 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.VideoStreams = dr(s.asDictionary());
1582
+ break;
1583
+ }
1584
+ case nr: {
1585
+ if (s.isNull) throw new Error();
1586
+ t.SpaceName = s.asString();
1501
1587
  break;
1502
1588
  }
1503
1589
  }
1504
1590
  }
1505
- function qr(e, t) {
1506
- const r = $(e, gr, pr);
1507
- return Xr(r, t);
1591
+ function hr(e, t) {
1592
+ const s = M(e, Hs, xs);
1593
+ return ar(s, t);
1508
1594
  }
1509
- function Qr(e) {
1595
+ function cr(e) {
1510
1596
  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());
1597
+ let s;
1598
+ for (; (s = e.next()) !== null; ) {
1599
+ const r = s.key.asInt32();
1600
+ t[r] = je(s.value.asObject());
1515
1601
  }
1516
1602
  return t;
1517
1603
  }
1518
- function Zr(e) {
1604
+ function ur(e) {
1519
1605
  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());
1606
+ let s;
1607
+ for (; (s = e.next()) !== null; ) {
1608
+ const r = s.key.asString();
1609
+ t[r] = Wr(s.value.asObject());
1524
1610
  }
1525
1611
  return t;
1526
1612
  }
1527
- function ts(e) {
1613
+ function Er(e) {
1528
1614
  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());
1615
+ let s;
1616
+ for (; (s = e.next()) !== null; ) {
1617
+ const r = s.key.asInt32();
1618
+ t[r] = Tr(s.value.asArray());
1533
1619
  }
1534
1620
  return t;
1535
1621
  }
1536
- function es(e) {
1622
+ function _r(e) {
1537
1623
  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());
1624
+ let s;
1625
+ for (; (s = e.next()) !== null; ) {
1626
+ const r = s.key.asString();
1627
+ t[r] = Ur(s.value.asObject());
1542
1628
  }
1543
1629
  return t;
1544
1630
  }
1545
- function rs(e) {
1631
+ function fr(e) {
1546
1632
  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());
1633
+ let s;
1634
+ for (; (s = e.next()) !== null; ) {
1635
+ const r = s.key.asString();
1636
+ t[r] = pr(s.value.asObject());
1551
1637
  }
1552
1638
  return t;
1553
1639
  }
1554
- function ss(e) {
1640
+ function dr(e) {
1555
1641
  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());
1642
+ let s;
1643
+ for (; (s = e.next()) !== null; ) {
1644
+ const r = s.key.asString();
1645
+ t[r] = Vr(s.value.asObject());
1560
1646
  }
1561
1647
  return t;
1562
1648
  }
1563
- function is(e) {
1649
+ function Tr(e) {
1564
1650
  const t = [];
1565
- let r;
1566
- for (; (r = e.next()) !== null; )
1567
- t.push(Ze(r.asObject()));
1651
+ let s;
1652
+ for (; (s = e.next()) !== null; )
1653
+ t.push(ls(s.asObject()));
1568
1654
  return t;
1569
1655
  }
1570
- const ns = 161083277, os = 325678206, as = 3469892363, ls = 3645544153;
1571
- function Is(e) {
1656
+ const yr = 161083277, Sr = 325678206, Ar = 3469892363, Nr = 3645544153;
1657
+ function wr(e) {
1572
1658
  const t = {};
1573
- return bt(t), t;
1659
+ return Ot(t), t;
1574
1660
  }
1575
- function bt(e) {
1576
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = mt(), e;
1661
+ function Ot(e) {
1662
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Rt(), e;
1577
1663
  }
1578
- function cs(e, t) {
1579
- const r = t ?? Is();
1580
- return bt(r), hs(e, r), r;
1664
+ function Ur(e, t) {
1665
+ const s = t ?? wr();
1666
+ return Ot(s), Cr(e, s), s;
1581
1667
  }
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();
1668
+ function Cr(e, t) {
1669
+ let s;
1670
+ for (; (s = e.next()) !== null; )
1671
+ switch (s.fieldId) {
1672
+ case yr: {
1673
+ if (s.isNull) throw new Error();
1674
+ t.StreamId = s.asString();
1589
1675
  break;
1590
1676
  }
1591
- case os: {
1592
- if (r.isNull) throw new Error();
1593
- t.ClientSessionId = r.asInt32();
1677
+ case Sr: {
1678
+ if (s.isNull) throw new Error();
1679
+ t.ClientSessionId = s.asInt32();
1594
1680
  break;
1595
1681
  }
1596
- case as: {
1597
- if (r.isNull) throw new Error();
1598
- t.TrackId = r.asInt32();
1682
+ case Ar: {
1683
+ if (s.isNull) throw new Error();
1684
+ t.TrackId = s.asInt32();
1599
1685
  break;
1600
1686
  }
1601
- case ls: {
1602
- if (r.isNull) throw new Error();
1603
- t.Info = Sr(r.asObject());
1687
+ case Nr: {
1688
+ if (s.isNull) throw new Error();
1689
+ t.Info = ps(s.asObject());
1604
1690
  break;
1605
1691
  }
1606
1692
  }
1607
1693
  }
1608
- const us = 161083277, Es = 325678206, _s = 3469892363, fs = 3645544153;
1609
- function ds(e) {
1694
+ const Dr = 161083277, Rr = 325678206, mr = 3469892363, Lr = 3645544153;
1695
+ function gr(e) {
1610
1696
  const t = {};
1611
- return Pt(t), t;
1697
+ return bt(t), t;
1612
1698
  }
1613
- function Pt(e) {
1614
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = At(), e;
1699
+ function bt(e) {
1700
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = yt(), e;
1615
1701
  }
1616
- function Ts(e, t) {
1617
- const r = t ?? ds();
1618
- return Pt(r), ys(e, r), r;
1702
+ function pr(e, t) {
1703
+ const s = t ?? gr();
1704
+ return bt(s), Or(e, s), s;
1619
1705
  }
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();
1706
+ function Or(e, t) {
1707
+ let s;
1708
+ for (; (s = e.next()) !== null; )
1709
+ switch (s.fieldId) {
1710
+ case Dr: {
1711
+ if (s.isNull) throw new Error();
1712
+ t.StreamId = s.asString();
1627
1713
  break;
1628
1714
  }
1629
- case Es: {
1630
- if (r.isNull) throw new Error();
1631
- t.ClientSessionId = r.asInt32();
1715
+ case Rr: {
1716
+ if (s.isNull) throw new Error();
1717
+ t.ClientSessionId = s.asInt32();
1632
1718
  break;
1633
1719
  }
1634
- case _s: {
1635
- if (r.isNull) throw new Error();
1636
- t.TrackId = r.asInt32();
1720
+ case mr: {
1721
+ if (s.isNull) throw new Error();
1722
+ t.TrackId = s.asInt32();
1637
1723
  break;
1638
1724
  }
1639
- case fs: {
1640
- if (r.isNull) throw new Error();
1641
- t.Info = he(r.asObject());
1725
+ case Lr: {
1726
+ if (s.isNull) throw new Error();
1727
+ t.Info = ue(s.asObject());
1642
1728
  break;
1643
1729
  }
1644
1730
  }
1645
1731
  }
1646
- const Ns = 161083277, As = 325678206, Ss = 3469892363, ws = 3645544153;
1647
- function Us(e) {
1732
+ const br = 161083277, Pr = 325678206, Fr = 3469892363, kr = 3645544153;
1733
+ function vr(e) {
1648
1734
  const t = {};
1649
- return Ft(t), t;
1735
+ return Pt(t), t;
1650
1736
  }
1651
- function Ft(e) {
1652
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = pt(), e;
1737
+ function Pt(e) {
1738
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Lt(), e;
1653
1739
  }
1654
- function Cs(e, t) {
1655
- const r = t ?? Us();
1656
- return Ft(r), Ds(e, r), r;
1740
+ function Vr(e, t) {
1741
+ const s = t ?? vr();
1742
+ return Pt(s), Mr(e, s), s;
1657
1743
  }
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();
1744
+ function Mr(e, t) {
1745
+ let s;
1746
+ for (; (s = e.next()) !== null; )
1747
+ switch (s.fieldId) {
1748
+ case br: {
1749
+ if (s.isNull) throw new Error();
1750
+ t.StreamId = s.asString();
1665
1751
  break;
1666
1752
  }
1667
- case As: {
1668
- if (r.isNull) throw new Error();
1669
- t.ClientSessionId = r.asInt32();
1753
+ case Pr: {
1754
+ if (s.isNull) throw new Error();
1755
+ t.ClientSessionId = s.asInt32();
1670
1756
  break;
1671
1757
  }
1672
- case Ss: {
1673
- if (r.isNull) throw new Error();
1674
- t.TrackId = r.asInt32();
1758
+ case Fr: {
1759
+ if (s.isNull) throw new Error();
1760
+ t.TrackId = s.asInt32();
1675
1761
  break;
1676
1762
  }
1677
- case ws: {
1678
- if (r.isNull) throw new Error();
1679
- t.Info = mr(r.asObject());
1763
+ case kr: {
1764
+ if (s.isNull) throw new Error();
1765
+ t.Info = Bs(s.asObject());
1680
1766
  break;
1681
1767
  }
1682
1768
  }
1683
1769
  }
1684
- const Rs = 161083277, ms = 325678206, Ls = 3469892363, ps = 3645544153;
1685
- function gs(e) {
1770
+ const Br = 161083277, Gr = 325678206, xr = 3469892363, Hr = 3645544153;
1771
+ function Yr(e) {
1686
1772
  const t = {};
1687
- return kt(t), t;
1773
+ return Ft(t), t;
1688
1774
  }
1689
- function kt(e) {
1690
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Dt(), e;
1775
+ function Ft(e) {
1776
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Ct(), e;
1691
1777
  }
1692
- function Os(e, t) {
1693
- const r = t ?? gs();
1694
- return kt(r), bs(e, r), r;
1778
+ function Wr(e, t) {
1779
+ const s = t ?? Yr();
1780
+ return Ft(s), Kr(e, s), s;
1695
1781
  }
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();
1782
+ function Kr(e, t) {
1783
+ let s;
1784
+ for (; (s = e.next()) !== null; )
1785
+ switch (s.fieldId) {
1786
+ case Br: {
1787
+ if (s.isNull) throw new Error();
1788
+ t.StreamId = s.asString();
1703
1789
  break;
1704
1790
  }
1705
- case ms: {
1706
- if (r.isNull) throw new Error();
1707
- t.ClientSessionId = r.asInt32();
1791
+ case Gr: {
1792
+ if (s.isNull) throw new Error();
1793
+ t.ClientSessionId = s.asInt32();
1708
1794
  break;
1709
1795
  }
1710
- case Ls: {
1711
- if (r.isNull) throw new Error();
1712
- t.TrackId = r.asInt32();
1796
+ case xr: {
1797
+ if (s.isNull) throw new Error();
1798
+ t.TrackId = s.asInt32();
1713
1799
  break;
1714
1800
  }
1715
- case ps: {
1716
- if (r.isNull) throw new Error();
1717
- t.Info = Tr(r.asObject());
1801
+ case Hr: {
1802
+ if (s.isNull) throw new Error();
1803
+ t.Info = Rs(s.asObject());
1718
1804
  break;
1719
1805
  }
1720
1806
  }
1721
1807
  }
1722
- const Ps = 1405462580, Fs = 2968276160;
1723
- function ks(e) {
1808
+ const $r = 1405462580, jr = 2968276160;
1809
+ function Xr(e) {
1724
1810
  const t = {};
1725
- return Vt(t), t;
1811
+ return kt(t), t;
1726
1812
  }
1727
- function Vt(e) {
1813
+ function kt(e) {
1728
1814
  return e.MimeType = "", e.Value = new Uint8Array(0), e;
1729
1815
  }
1730
- function Vs(e, t) {
1731
- const r = t ?? ks();
1732
- return Vt(r), Bs(e, r), r;
1816
+ function zr(e, t) {
1817
+ const s = t ?? Xr();
1818
+ return kt(s), Jr(e, s), s;
1733
1819
  }
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();
1820
+ function Jr(e, t) {
1821
+ let s;
1822
+ for (; (s = e.next()) !== null; )
1823
+ switch (s.fieldId) {
1824
+ case $r: {
1825
+ if (s.isNull) throw new Error();
1826
+ t.Value = s.asBinary();
1741
1827
  break;
1742
1828
  }
1743
- case Fs: {
1744
- if (r.isNull) throw new Error();
1745
- t.MimeType = r.asString();
1829
+ case jr: {
1830
+ if (s.isNull) throw new Error();
1831
+ t.MimeType = s.asString();
1746
1832
  break;
1747
1833
  }
1748
1834
  }
1749
1835
  }
1750
- const Ms = 1, vs = 2097188, Gs = 979822885, xs = 2374537704;
1751
- function Hs(e) {
1836
+ const qr = 1, Qr = 2097188, Zr = 979822885, ti = 2374537704;
1837
+ function ei(e) {
1752
1838
  const t = {};
1753
- return Bt(t), t;
1839
+ return vt(t), t;
1754
1840
  }
1755
- function Bt(e) {
1841
+ function vt(e) {
1756
1842
  return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
1757
1843
  }
1758
- function Ks(e, t) {
1759
- const r = g.create(e);
1760
- return Ws(r, t);
1844
+ function si(e, t) {
1845
+ const s = p.create(e);
1846
+ return ri(s, t);
1761
1847
  }
1762
- function Ws(e, t) {
1763
- const r = t ?? Hs();
1764
- return Bt(r), Ys(e, r), r;
1848
+ function ri(e, t) {
1849
+ const s = t ?? ei();
1850
+ return vt(s), ii(e, s), s;
1765
1851
  }
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();
1852
+ function ii(e, t) {
1853
+ let s;
1854
+ for (; (s = e.next()) !== null; )
1855
+ switch (s.fieldId) {
1856
+ case Zr: {
1857
+ if (s.isNull) throw new Error();
1858
+ t.StyleId = s.asString();
1773
1859
  break;
1774
1860
  }
1775
- case xs: {
1776
- if (r.isNull) throw new Error();
1777
- t.Style = js(r.asDictionary());
1861
+ case ti: {
1862
+ if (s.isNull) throw new Error();
1863
+ t.Style = oi(s.asDictionary());
1778
1864
  break;
1779
1865
  }
1780
1866
  }
1781
1867
  }
1782
- function $s(e, t) {
1783
- const r = $(e, vs, Ms);
1784
- return Ks(r, t);
1868
+ function ni(e, t) {
1869
+ const s = M(e, Qr, qr);
1870
+ return si(s, t);
1785
1871
  }
1786
- function js(e) {
1872
+ function oi(e) {
1787
1873
  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();
1874
+ let s;
1875
+ for (; (s = e.next()) !== null; ) {
1876
+ const r = s.key.asString();
1877
+ t[r] = s.value.asString();
1792
1878
  }
1793
1879
  return t;
1794
1880
  }
1795
- const Xs = 1, zs = 2097192, Js = 2136687806;
1796
- function qs(e) {
1881
+ const ai = 1, li = 2097192, Ii = 2136687806;
1882
+ function hi(e) {
1797
1883
  const t = {};
1798
- return Mt(t), t;
1884
+ return Vt(t), t;
1799
1885
  }
1800
- function Mt(e) {
1886
+ function Vt(e) {
1801
1887
  return e.Styles = [], e;
1802
1888
  }
1803
- function Qs(e, t) {
1804
- const r = g.create(e);
1805
- return Zs(r, t);
1889
+ function ci(e, t) {
1890
+ const s = p.create(e);
1891
+ return ui(s, t);
1806
1892
  }
1807
- function Zs(e, t) {
1808
- const r = t ?? qs();
1809
- return Mt(r), ti(e, r), r;
1893
+ function ui(e, t) {
1894
+ const s = t ?? hi();
1895
+ return Vt(s), Ei(e, s), s;
1810
1896
  }
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());
1897
+ function Ei(e, t) {
1898
+ let s;
1899
+ for (; (s = e.next()) !== null; )
1900
+ switch (s.fieldId) {
1901
+ case Ii: {
1902
+ if (s.isNull) throw new Error();
1903
+ t.Styles = fi(s.asArray());
1818
1904
  break;
1819
1905
  }
1820
1906
  }
1821
1907
  }
1822
- function ei(e, t) {
1823
- const r = $(e, zs, Xs);
1824
- return Qs(r, t);
1908
+ function _i(e, t) {
1909
+ const s = M(e, li, ai);
1910
+ return ci(s, t);
1825
1911
  }
1826
- function ri(e) {
1912
+ function fi(e) {
1827
1913
  const t = [];
1828
- let r;
1829
- for (; (r = e.next()) !== null; )
1830
- t.push(oi(r.asObject()));
1914
+ let s;
1915
+ for (; (s = e.next()) !== null; )
1916
+ t.push(Si(s.asObject()));
1831
1917
  return t;
1832
1918
  }
1833
- const si = 979822885, ii = 2374537704;
1834
- function ni(e) {
1919
+ const di = 979822885, Ti = 2374537704;
1920
+ function yi(e) {
1835
1921
  const t = {};
1836
- return vt(t), t;
1922
+ return Mt(t), t;
1837
1923
  }
1838
- function vt(e) {
1924
+ function Mt(e) {
1839
1925
  return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
1840
1926
  }
1841
- function oi(e, t) {
1842
- const r = t ?? ni();
1843
- return vt(r), ai(e, r), r;
1927
+ function Si(e, t) {
1928
+ const s = t ?? yi();
1929
+ return Mt(s), Ai(e, s), s;
1844
1930
  }
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();
1931
+ function Ai(e, t) {
1932
+ let s;
1933
+ for (; (s = e.next()) !== null; )
1934
+ switch (s.fieldId) {
1935
+ case di: {
1936
+ if (s.isNull) throw new Error();
1937
+ t.StyleId = s.asString();
1852
1938
  break;
1853
1939
  }
1854
- case ii: {
1855
- if (r.isNull) throw new Error();
1856
- t.Style = li(r.asDictionary());
1940
+ case Ti: {
1941
+ if (s.isNull) throw new Error();
1942
+ t.Style = Ni(s.asDictionary());
1857
1943
  break;
1858
1944
  }
1859
1945
  }
1860
1946
  }
1861
- function li(e) {
1947
+ function Ni(e) {
1862
1948
  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();
1949
+ let s;
1950
+ for (; (s = e.next()) !== null; ) {
1951
+ const r = s.key.asString();
1952
+ t[r] = s.value.asString();
1867
1953
  }
1868
1954
  return t;
1869
1955
  }
1870
- const Ii = 1, ci = 2097190, hi = 425183262, ui = 653781469;
1871
- function Ei(e) {
1956
+ const wi = 1, Ui = 2097193, Ci = 1415642792;
1957
+ function Di(e) {
1958
+ const t = {};
1959
+ return Bt(t), t;
1960
+ }
1961
+ function Bt(e) {
1962
+ return e.StyleIds = [], e;
1963
+ }
1964
+ function Ri(e, t) {
1965
+ const s = p.create(e);
1966
+ return mi(s, t);
1967
+ }
1968
+ function mi(e, t) {
1969
+ const s = t ?? Di();
1970
+ return Bt(s), Li(e, s), s;
1971
+ }
1972
+ function Li(e, t) {
1973
+ let s;
1974
+ for (; (s = e.next()) !== null; )
1975
+ switch (s.fieldId) {
1976
+ case Ci: {
1977
+ if (s.isNull) throw new Error();
1978
+ t.StyleIds = pi(s.asArray());
1979
+ break;
1980
+ }
1981
+ }
1982
+ }
1983
+ function gi(e, t) {
1984
+ const s = M(e, Ui, wi);
1985
+ return Ri(s, t);
1986
+ }
1987
+ function pi(e) {
1988
+ const t = [];
1989
+ let s;
1990
+ for (; (s = e.next()) !== null; )
1991
+ t.push(s.asString());
1992
+ return t;
1993
+ }
1994
+ const Oi = 1, bi = 2097190, Pi = 425183262, Fi = 653781469;
1995
+ function ki(e) {
1872
1996
  const t = {};
1873
1997
  return Gt(t), t;
1874
1998
  }
1875
1999
  function Gt(e) {
1876
2000
  return e.Json = "", e.Payloads = /* @__PURE__ */ Object.create(null), e;
1877
2001
  }
1878
- function _i(e, t) {
1879
- const r = g.create(e);
1880
- return fi(r, t);
2002
+ function vi(e, t) {
2003
+ const s = p.create(e);
2004
+ return Vi(s, t);
1881
2005
  }
1882
- function fi(e, t) {
1883
- const r = t ?? Ei();
1884
- return Gt(r), di(e, r), r;
2006
+ function Vi(e, t) {
2007
+ const s = t ?? ki();
2008
+ return Gt(s), Mi(e, s), s;
1885
2009
  }
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();
2010
+ function Mi(e, t) {
2011
+ let s;
2012
+ for (; (s = e.next()) !== null; )
2013
+ switch (s.fieldId) {
2014
+ case Pi: {
2015
+ if (s.isNull) throw new Error();
2016
+ t.Json = s.asString();
1893
2017
  break;
1894
2018
  }
1895
- case ui: {
1896
- if (r.isNull) throw new Error();
1897
- t.Payloads = yi(r.asDictionary());
2019
+ case Fi: {
2020
+ if (s.isNull) throw new Error();
2021
+ t.Payloads = Gi(s.asDictionary());
1898
2022
  break;
1899
2023
  }
1900
2024
  }
1901
2025
  }
1902
- function Ti(e, t) {
1903
- const r = $(e, ci, Ii);
1904
- return _i(r, t);
2026
+ function Bi(e, t) {
2027
+ const s = M(e, bi, Oi);
2028
+ return vi(s, t);
1905
2029
  }
1906
- function yi(e) {
2030
+ function Gi(e) {
1907
2031
  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());
2032
+ let s;
2033
+ for (; (s = e.next()) !== null; ) {
2034
+ const r = s.key.asString();
2035
+ t[r] = zr(s.value.asObject());
1912
2036
  }
1913
2037
  return t;
1914
2038
  }
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();
2039
+ const xt = 1, xi = 1048636, Hi = 2610786289;
2040
+ function Yi(e) {
2041
+ const t = new B(xt);
2042
+ return Wi(e, t), t.finish();
1919
2043
  }
1920
- function wi(e, t) {
1921
- t.writeUInt32Field(Ai, e.Version >>> 0);
2044
+ function Wi(e, t) {
2045
+ t.writeUInt32Field(Hi, e.Version >>> 0);
1922
2046
  }
1923
- function Ui(e, t, r) {
1924
- const s = Si(e);
1925
- return Qt(Ni, s, xt, t, r);
2047
+ function Ki(e, t, s) {
2048
+ const r = Yi(e);
2049
+ return Qt(xi, r, xt, t, s);
1926
2050
  }
1927
- function U(e) {
2051
+ function w(e) {
1928
2052
  return typeof e == "object" && e !== null && !Array.isArray(e);
1929
2053
  }
1930
2054
  function Ht(e) {
1931
- const t = {}, r = Object.keys(e);
1932
- for (let s = 0; s < r.length; s++) {
1933
- const i = r[s];
2055
+ const t = {}, s = Object.keys(e);
2056
+ for (let r = 0; r < s.length; r++) {
2057
+ const i = s[r];
1934
2058
  t[i] = e[i];
1935
2059
  }
1936
2060
  return t;
1937
2061
  }
1938
- function Kt(e, t, r, s) {
1939
- if (!(e === void 0 && s)) {
2062
+ function Yt(e, t, s, r) {
2063
+ if (!(e === void 0 && r)) {
1940
2064
  if (Array.isArray(e)) {
1941
2065
  const i = [];
1942
2066
  for (let n = 0; n < e.length; n++) {
1943
2067
  const o = e[n];
1944
2068
  if (typeof o != "string")
1945
- throw new Error(`Invalid styleIds entry at ${t}.styleIds[${n}] for element ${r}`);
2069
+ throw new Error(`Invalid styleIds entry at ${t}.styleIds[${n}] for element ${s}`);
1946
2070
  const a = o.trim();
1947
2071
  a.length !== 0 && i.push(a);
1948
2072
  }
1949
2073
  return i;
1950
2074
  }
1951
2075
  if (e != null)
1952
- throw new Error(`Invalid styleIds for element ${r}`);
2076
+ throw new Error(`Invalid styleIds for element ${s}`);
1953
2077
  return [];
1954
2078
  }
1955
2079
  }
1956
2080
  function it(e, t) {
1957
2081
  if (!e || typeof e != "object")
1958
2082
  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}`);
2083
+ const s = e.Id, r = e.Type, i = e.Props, n = e.Children, o = e.StyleIds;
1962
2084
  if (typeof s != "string")
1963
- throw new Error(`Invalid or missing node type for ${r}`);
2085
+ throw new Error(`Invalid or missing node id at ${t}`);
2086
+ if (typeof r != "string")
2087
+ throw new Error(`Invalid or missing node type for ${s}`);
1964
2088
  let a = {};
1965
2089
  if (i != null) {
1966
- if (!U(i))
1967
- throw new Error(`Invalid props for node ${r}`);
2090
+ if (!w(i))
2091
+ throw new Error(`Invalid props for node ${s}`);
1968
2092
  a = Ht(i);
1969
2093
  }
1970
2094
  let l = [];
1971
2095
  Array.isArray(n) && (l = n.map(
1972
2096
  (I, c) => it(I ?? {}, `${t}.children[${c}]`)
1973
2097
  ));
1974
- const u = Kt(o, t, r, !1);
2098
+ const u = Yt(o, t, s, !1);
1975
2099
  return {
1976
- id: r,
1977
- type: s,
2100
+ id: s,
2101
+ type: r,
1978
2102
  props: a,
1979
2103
  children: l,
1980
2104
  styleIds: u ?? []
1981
2105
  };
1982
2106
  }
1983
- function Ci(e, t) {
1984
- if (!U(e))
2107
+ function $i(e, t) {
2108
+ if (!w(e))
1985
2109
  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}`);
2110
+ const s = e.NodeId, r = e.PropertyName, i = e.Start, n = e.End, o = e.InsertedText;
1989
2111
  if (typeof s != "string" || s.length === 0)
2112
+ throw new Error(`Invalid text delta node id at ${t}`);
2113
+ if (typeof r != "string" || r.length === 0)
1990
2114
  throw new Error(`Invalid text delta property name at ${t}`);
1991
2115
  if (typeof i != "number" || !Number.isFinite(i))
1992
2116
  throw new Error(`Invalid text delta start at ${t}`);
@@ -2000,89 +2124,123 @@ function Ci(e, t) {
2000
2124
  } else if (n != null)
2001
2125
  throw new Error(`Invalid text delta end at ${t}`);
2002
2126
  return {
2003
- nodeId: r,
2004
- propertyName: s,
2127
+ nodeId: s,
2128
+ propertyName: r,
2005
2129
  start: i,
2006
2130
  end: a,
2007
2131
  insertedText: o
2008
2132
  };
2009
2133
  }
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}`);
2134
+ function ji(e, t) {
2135
+ if (!w(e))
2136
+ throw new Error(`Invalid child insert at ${t}`);
2137
+ const s = e.Index, r = e.Node;
2138
+ if (typeof s != "number" || !Number.isFinite(s))
2139
+ throw new Error(`Invalid child insert index at ${t}`);
2140
+ if (!w(r))
2141
+ throw new Error(`Invalid child insert node at ${t}`);
2142
+ return {
2143
+ index: s,
2144
+ node: it(r, `${t}.node`)
2145
+ };
2146
+ }
2147
+ function Xi(e, t) {
2148
+ if (!w(e))
2149
+ throw new Error(`Invalid child move at ${t}`);
2150
+ const s = e.NodeId, r = e.FromIndex, i = e.ToIndex;
2016
2151
  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))
2152
+ throw new Error(`Invalid child move nodeId at ${t}`);
2153
+ if (typeof r != "number" || !Number.isFinite(r))
2154
+ throw new Error(`Invalid child move fromIndex at ${t}`);
2155
+ if (typeof i != "number" || !Number.isFinite(i))
2156
+ throw new Error(`Invalid child move toIndex at ${t}`);
2157
+ return {
2158
+ nodeId: s,
2159
+ fromIndex: r,
2160
+ toIndex: i
2161
+ };
2162
+ }
2163
+ function zi(e, t) {
2164
+ if (!w(e))
2165
+ throw new Error(`Invalid child remove at ${t}`);
2166
+ const s = e.NodeId, r = e.Index;
2167
+ if (typeof s != "string" || s.length === 0)
2168
+ throw new Error(`Invalid child remove nodeId at ${t}`);
2169
+ if (typeof r != "number" || !Number.isFinite(r))
2170
+ throw new Error(`Invalid child remove index at ${t}`);
2171
+ return {
2172
+ nodeId: s,
2173
+ index: r
2174
+ };
2175
+ }
2176
+ function Ji(e, t) {
2177
+ if (!w(e))
2178
+ throw new Error(`Invalid node change at ${t}`);
2179
+ const s = e.nodeId;
2180
+ if (typeof s != "string" || s.length === 0)
2181
+ throw new Error(`Invalid node change nodeId at ${t}`);
2182
+ const r = Array.isArray(e.inserts) ? e.inserts.map(
2183
+ (I, c) => ji(I ?? {}, `${t}.inserts[${c}]`)
2184
+ ) : void 0, i = Array.isArray(e.moves) ? e.moves.map(
2185
+ (I, c) => Xi(I ?? {}, `${t}.moves[${c}]`)
2186
+ ) : void 0, n = Array.isArray(e.removals) ? e.removals.map(
2187
+ (I, c) => zi(I ?? {}, `${t}.removals[${c}]`)
2188
+ ) : void 0;
2189
+ let o;
2190
+ if (w(e.changedProps)) {
2191
+ o = /* @__PURE__ */ new Map();
2192
+ for (const [I, c] of Object.entries(e.changedProps)) {
2193
+ if (!w(c))
2038
2194
  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);
2195
+ const h = c.New;
2196
+ h === void 0 ? o.set(I, void 0) : w(h) ? o.set(I, Ht(h)) : o.set(I, h);
2041
2197
  }
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);
2198
+ }
2199
+ const a = Array.isArray(e.textUpdates) ? e.textUpdates.map(
2200
+ (I, c) => $i(I ?? {}, `${t}.textUpdates[${c}]`)
2201
+ ) : void 0, l = e.styleIds, u = l !== void 0 ? Yt(l, t, s, !0) : void 0;
2045
2202
  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 } : {}
2203
+ nodeId: s,
2204
+ ...r && r.length > 0 ? { inserts: r } : {},
2205
+ ...i && i.length > 0 ? { moves: i } : {},
2206
+ ...n && n.length > 0 ? { removals: n } : {},
2207
+ ...o && o.size > 0 ? { changedProps: o } : {},
2208
+ ...a && a.length > 0 ? { textUpdates: a } : {},
2209
+ ...u !== void 0 ? { styleIds: u } : {}
2054
2210
  };
2055
2211
  }
2056
- function Di(e) {
2212
+ function qi(e) {
2057
2213
  const t = /* @__PURE__ */ new Map();
2058
- for (const [r, s] of Object.entries(e))
2059
- t.set(r, s);
2214
+ for (const [s, r] of Object.entries(e))
2215
+ t.set(s, r);
2060
2216
  return t;
2061
2217
  }
2062
- function Ri(e, t, r) {
2218
+ function Qi(e, t, s) {
2063
2219
  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);
2220
+ throw new D("UI update graph is missing");
2221
+ const r = it(e, "graph");
2222
+ if (r.type !== "root")
2223
+ throw new D('UI update root element must have type "root"');
2224
+ const i = tn(r.props, t);
2069
2225
  return {
2070
2226
  type: "full",
2071
- version: r,
2072
- root: s,
2227
+ version: s,
2228
+ root: r,
2073
2229
  metadata: i
2074
2230
  };
2075
2231
  }
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,
2232
+ function Zi(e, t, s) {
2233
+ if (!Array.isArray(e))
2234
+ throw new D("UI diff changes must be an array");
2235
+ if (!w(t))
2236
+ throw new D("UI diff metadata must be an object");
2237
+ const r = t.viewId;
2238
+ if (typeof r != "string" || r.length === 0)
2239
+ throw new D("UI diff metadata is missing viewId");
2240
+ const i = e.map(
2241
+ (c, h) => Ji(c ?? {}, `changes[${h}]`)
2242
+ ), 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 = {
2243
+ viewId: r,
2086
2244
  ...n !== void 0 ? { optimisticActionId: n } : {},
2087
2245
  ...o !== void 0 ? { isOptimistic: o } : {},
2088
2246
  ...a !== void 0 ? { isUpdate: a } : {},
@@ -2091,18 +2249,18 @@ function mi(e, t, r) {
2091
2249
  };
2092
2250
  return {
2093
2251
  type: "diff",
2094
- version: r,
2095
- diff: i,
2252
+ version: s,
2253
+ changes: i,
2096
2254
  metadata: I
2097
2255
  };
2098
2256
  }
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,
2257
+ function tn(e, t) {
2258
+ const s = e.viewId;
2259
+ if (typeof s != "string" || s.length === 0)
2260
+ throw new D("UI update root is missing viewId");
2261
+ 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);
2262
+ 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))), {
2263
+ viewId: r,
2106
2264
  ...i !== void 0 ? { optimisticActionId: i } : {},
2107
2265
  ...n !== void 0 ? { isOptimistic: n } : {},
2108
2266
  ...o !== void 0 ? { isUpdate: o } : {},
@@ -2111,10 +2269,10 @@ function Li(e, t) {
2111
2269
  };
2112
2270
  }
2113
2271
  function z(e) {
2114
- if (!U(e))
2272
+ if (!w(e))
2115
2273
  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))
2274
+ const t = e, s = t.id, r = t.actionId, i = t.ordinal, n = t.baseVersion, o = t.supersedes;
2275
+ 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
2276
  return;
2119
2277
  let a;
2120
2278
  if (Array.isArray(o)) {
@@ -2124,123 +2282,123 @@ function z(e) {
2124
2282
  a = l;
2125
2283
  }
2126
2284
  return {
2127
- id: r,
2128
- actionId: s,
2285
+ id: s,
2286
+ actionId: r,
2129
2287
  ordinal: i,
2130
2288
  baseVersion: n,
2131
2289
  ...a && a.length > 0 ? { supersedes: a } : {}
2132
2290
  };
2133
2291
  }
2134
2292
  function J(e) {
2135
- if (!U(e))
2293
+ if (!w(e))
2136
2294
  return;
2137
- const t = e, r = t.baseVersion, s = t.drop;
2138
- if (typeof r != "number" || !Number.isFinite(r))
2295
+ const t = e, s = t.baseVersion, r = t.drop;
2296
+ if (typeof s != "number" || !Number.isFinite(s))
2139
2297
  return;
2140
2298
  let i;
2141
- if (Array.isArray(s)) {
2299
+ if (Array.isArray(r)) {
2142
2300
  const n = [];
2143
- for (const o of s)
2301
+ for (const o of r)
2144
2302
  typeof o == "string" && o.length > 0 && n.push(o);
2145
2303
  i = n;
2146
2304
  }
2147
2305
  return {
2148
- baseVersion: r,
2306
+ baseVersion: s,
2149
2307
  ...i && i.length > 0 ? { drop: i } : {}
2150
2308
  };
2151
2309
  }
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);
2310
+ class D extends Error {
2311
+ constructor(t, s) {
2312
+ super(t), this.causeError = s, this.name = "UiUpdateParseError", s instanceof Error && (this.stack = s.stack);
2155
2313
  }
2156
2314
  }
2157
- function pi(e) {
2315
+ function en(e) {
2158
2316
  let t;
2159
2317
  try {
2160
2318
  t = JSON.parse(e.Json);
2161
2319
  } catch (o) {
2162
- throw new C("Failed to parse UIUpdate.Json payload", o);
2320
+ throw new D("Failed to parse UIUpdate.Json payload", o);
2163
2321
  }
2164
2322
  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();
2323
+ throw new D("UI update snapshot must be an object");
2324
+ const { type: s, version: r } = t;
2325
+ if (s !== "full" && s !== "diff")
2326
+ throw new D(`Unknown UI update type: ${String(s)}`);
2327
+ if (typeof r != "number")
2328
+ throw new D("UI update version must be a number");
2329
+ const i = s === "full" ? Qi(t.graph, t.metadata, r) : Zi(t.changes, t.metadata, r), n = e.Payloads ? qi(e.Payloads) : /* @__PURE__ */ new Map();
2172
2330
  return {
2173
2331
  snapshot: i,
2174
2332
  payloads: n
2175
2333
  };
2176
2334
  }
2177
- class gi {
2335
+ class sn {
2178
2336
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2179
2337
  cache = /* @__PURE__ */ new Map();
2180
2338
  /**
2181
2339
  * Get a cached void handler (no payload) for a node/action combination.
2182
2340
  * Creates and caches the handler if it doesn't exist.
2183
2341
  */
2184
- getHandler(t, r, s) {
2185
- const i = `${t}:${r}`;
2342
+ getHandler(t, s, r) {
2343
+ const i = `${t}:${s}`;
2186
2344
  let n = this.cache.get(i);
2187
- return n || (n = () => s(r), this.cache.set(i, n)), n;
2345
+ return n || (n = () => r(s), this.cache.set(i, n)), n;
2188
2346
  }
2189
2347
  /**
2190
2348
  * Get a cached handler that accepts a payload.
2191
2349
  * Creates and caches the handler if it doesn't exist.
2192
2350
  */
2193
- getHandlerWithPayload(t, r, s) {
2194
- const i = `${t}:${r}:payload`;
2351
+ getHandlerWithPayload(t, s, r) {
2352
+ const i = `${t}:${s}:payload`;
2195
2353
  let n = this.cache.get(i);
2196
- return n || (n = (o) => s(r, o), this.cache.set(i, n)), n;
2354
+ return n || (n = (o) => r(s, o), this.cache.set(i, n)), n;
2197
2355
  }
2198
2356
  /**
2199
2357
  * Get a cached handler for boolean payloads.
2200
2358
  */
2201
- getBooleanHandler(t, r, s) {
2202
- return this.getHandlerWithPayload(t, r, s);
2359
+ getBooleanHandler(t, s, r) {
2360
+ return this.getHandlerWithPayload(t, s, r);
2203
2361
  }
2204
2362
  /**
2205
2363
  * Get a cached handler for string payloads.
2206
2364
  */
2207
- getStringHandler(t, r, s) {
2208
- return this.getHandlerWithPayload(t, r, s);
2365
+ getStringHandler(t, s, r) {
2366
+ return this.getHandlerWithPayload(t, s, r);
2209
2367
  }
2210
2368
  /**
2211
2369
  * Get a cached handler for number payloads.
2212
2370
  */
2213
- getNumberHandler(t, r, s) {
2214
- return this.getHandlerWithPayload(t, r, s);
2371
+ getNumberHandler(t, s, r) {
2372
+ return this.getHandlerWithPayload(t, s, r);
2215
2373
  }
2216
2374
  /**
2217
2375
  * Get a cached handler for number array payloads.
2218
2376
  */
2219
- getNumberArrayHandler(t, r, s) {
2220
- return this.getHandlerWithPayload(t, r, s);
2377
+ getNumberArrayHandler(t, s, r) {
2378
+ return this.getHandlerWithPayload(t, s, r);
2221
2379
  }
2222
2380
  /**
2223
2381
  * Get a cached handler for nullable boolean payloads.
2224
2382
  */
2225
- getNullableBooleanHandler(t, r, s) {
2226
- const i = `${t}:${r}:nullable-bool`;
2383
+ getNullableBooleanHandler(t, s, r) {
2384
+ const i = `${t}:${s}:nullable-bool`;
2227
2385
  let n = this.cache.get(i);
2228
- return n || (n = (o) => s(r, o ?? null), this.cache.set(i, n)), n;
2386
+ return n || (n = (o) => r(s, o ?? null), this.cache.set(i, n)), n;
2229
2387
  }
2230
2388
  /**
2231
2389
  * Invalidate all cached handlers for a specific node.
2232
2390
  * Call this when a node is removed from the tree.
2233
2391
  */
2234
2392
  invalidateNode(t) {
2235
- const r = `${t}:`;
2236
- for (const s of this.cache.keys())
2237
- s.startsWith(r) && this.cache.delete(s);
2393
+ const s = `${t}:`;
2394
+ for (const r of this.cache.keys())
2395
+ r.startsWith(s) && this.cache.delete(r);
2238
2396
  }
2239
2397
  /**
2240
2398
  * Invalidate a specific handler.
2241
2399
  */
2242
- invalidateHandler(t, r) {
2243
- this.cache.delete(`${t}:${r}`), this.cache.delete(`${t}:${r}:payload`), this.cache.delete(`${t}:${r}:nullable-bool`);
2400
+ invalidateHandler(t, s) {
2401
+ this.cache.delete(`${t}:${s}`), this.cache.delete(`${t}:${s}:payload`), this.cache.delete(`${t}:${s}:nullable-bool`);
2244
2402
  }
2245
2403
  /**
2246
2404
  * Clear all cached handlers.
@@ -2255,7 +2413,7 @@ class gi {
2255
2413
  return this.cache.size;
2256
2414
  }
2257
2415
  }
2258
- class Oi {
2416
+ class rn {
2259
2417
  views = /* @__PURE__ */ new Map();
2260
2418
  listeners = /* @__PURE__ */ new Set();
2261
2419
  payloads = /* @__PURE__ */ new Map();
@@ -2277,20 +2435,20 @@ class Oi {
2277
2435
  patchesDirty = !0;
2278
2436
  payloadsDirty = !0;
2279
2437
  // Handler cache for stable event handlers
2280
- handlerCache = new gi();
2438
+ handlerCache = new sn();
2281
2439
  getSortedPatches(t) {
2282
- const r = this.buildPatchCacheKey(t.patches);
2283
- if (t.sortedPatchesCacheKey === r && t.sortedPatchesCache)
2440
+ const s = this.buildPatchCacheKey(t.patches);
2441
+ if (t.sortedPatchesCacheKey === s && t.sortedPatchesCache)
2284
2442
  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;
2443
+ const r = [...t.patches.values()].sort((i, n) => i.ordinal - n.ordinal);
2444
+ return t.sortedPatchesCache = r, t.sortedPatchesCacheKey = s, r;
2287
2445
  }
2288
2446
  buildPatchCacheKey(t) {
2289
2447
  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;
2448
+ let s = "";
2449
+ for (const [r, i] of t)
2450
+ s += s ? `,${r}:${i.ordinal}` : `${r}:${i.ordinal}`;
2451
+ return s;
2294
2452
  }
2295
2453
  invalidatePatchCache(t) {
2296
2454
  t.sortedPatchesCache = void 0, t.sortedPatchesCacheKey = void 0;
@@ -2306,15 +2464,15 @@ class Oi {
2306
2464
  version: -1
2307
2465
  };
2308
2466
  }
2309
- const { snapshot: r, payloads: s } = t, { metadata: i } = r, { viewId: n } = i;
2467
+ const { snapshot: s, payloads: r } = t, { metadata: i } = s, { viewId: n } = i;
2310
2468
  let o = this.views.get(n);
2311
2469
  o || (o = {
2312
2470
  version: 0,
2313
2471
  baselineVersion: 0,
2314
2472
  patches: /* @__PURE__ */ new Map()
2315
2473
  }, 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)
2474
+ const a = s.type === "diff" && i.isUpdate === !0;
2475
+ if (s.version < o.version || s.version === o.version && !a)
2318
2476
  return !1;
2319
2477
  let l = !1;
2320
2478
  if (this.rootViewId || (this.rootViewId = n, l = !0, this.structureChanged = !0), i.optimisticReconcile?.drop)
@@ -2324,84 +2482,84 @@ class Oi {
2324
2482
  for (const I of i.optimisticPatch.supersedes)
2325
2483
  o.patches.delete(I) && (l = !0, this.patchesDirty = !0, this.invalidatePatchCache(o));
2326
2484
  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);
2485
+ if (s.type === "full")
2486
+ 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
2487
  else if (i.optimisticPatch) {
2330
2488
  if (!u)
2331
2489
  return !1;
2332
- const I = K(u, r.diff);
2490
+ const I = j(u, s.changes);
2333
2491
  I !== u && (o.composite = I, l = !0, this.viewsDirty = !0, H(u, I, this.changedNodeIds));
2334
2492
  const c = i.optimisticPatch, h = {
2335
2493
  id: c.id,
2336
2494
  actionId: c.actionId,
2337
2495
  ordinal: c.ordinal,
2338
2496
  baseVersion: c.baseVersion,
2339
- diff: r.diff
2497
+ changes: s.changes
2340
2498
  };
2341
- o.patches.set(h.id, h), this.invalidatePatchCache(o), l = !0, this.patchesDirty = !0, o.version = r.version;
2499
+ o.patches.set(h.id, h), this.invalidatePatchCache(o), l = !0, this.patchesDirty = !0, o.version = s.version;
2342
2500
  } else {
2343
2501
  const I = o.baseline ?? u;
2344
2502
  if (!I)
2345
2503
  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;
2504
+ const c = j(I, s.changes);
2505
+ c !== I ? (o.baseline = c, l = !0, this.viewsDirty = !0) : o.baseline = c, o.baselineVersion = i.optimisticReconcile?.baseVersion ?? s.version;
2348
2506
  let h = o.baseline ?? c;
2349
2507
  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;
2508
+ for (const _ of E) {
2509
+ const y = j(h, _.changes);
2510
+ y !== h && (l = !0, this.viewsDirty = !0), h = y, _.baseVersion = o.baselineVersion;
2353
2511
  }
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;
2512
+ 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
2513
  }
2356
- for (const [I, c] of s)
2514
+ for (const [I, c] of r)
2357
2515
  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);
2516
+ return l ? (this.commitSnapshot(), this.notify(), !0) : (o.version = s.version, !1);
2359
2517
  }
2360
2518
  replaceFromWire(t) {
2361
- const r = {
2519
+ const s = {
2362
2520
  rootViewId: t.rootViewId,
2363
2521
  views: new Map(t.views),
2364
2522
  payloads: new Map(t.payloads),
2365
2523
  optimisticPatches: new Map(t.optimisticPatches),
2366
2524
  version: t.version
2367
2525
  };
2368
- return this.replaceSnapshot(r);
2526
+ return this.replaceSnapshot(s);
2369
2527
  }
2370
2528
  patchFromOp(t) {
2371
2529
  this.snapshotMode = !0;
2372
- const r = t.expectedBaseVersion;
2373
- if (r !== void 0 && this.snapshot.version !== r)
2530
+ const s = t.expectedBaseVersion;
2531
+ if (s !== void 0 && this.snapshot.version !== s)
2374
2532
  return !1;
2375
- let s = !1, i = null, n = null, o = null;
2533
+ let r = !1, i = null, n = null, o = null;
2376
2534
  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
2535
  if (t.deleteViews && t.deleteViews.length > 0)
2378
2536
  for (const h of t.deleteViews)
2379
- a().delete(h) && (s = !0, this.structureChanged = !0);
2537
+ a().delete(h) && (r = !0, this.structureChanged = !0);
2380
2538
  if (t.upsertViews && t.upsertViews.length > 0)
2381
2539
  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));
2540
+ const _ = a(), y = _.get(h);
2541
+ y !== E && (_.set(h, E), r = !0, y ? H(y, E, this.changedNodeIds) : (b(E, this.changedNodeIds), this.structureChanged = !0));
2384
2542
  }
2385
2543
  if (t.deletePayloads && t.deletePayloads.length > 0)
2386
2544
  for (const h of t.deletePayloads)
2387
- l().delete(h) && (s = !0);
2545
+ l().delete(h) && (r = !0);
2388
2546
  if (t.upsertPayloads && t.upsertPayloads.length > 0)
2389
2547
  for (const [h, E] of t.upsertPayloads) {
2390
- const d = l();
2391
- d.get(h) !== E && (d.set(h, E), s = !0);
2548
+ const _ = l();
2549
+ _.get(h) !== E && (_.set(h, E), r = !0);
2392
2550
  }
2393
2551
  if (t.deleteOptimisticPatchesForViews && t.deleteOptimisticPatchesForViews.length > 0)
2394
2552
  for (const h of t.deleteOptimisticPatchesForViews)
2395
- u().delete(h) && (s = !0);
2553
+ u().delete(h) && (r = !0);
2396
2554
  if (t.upsertOptimisticPatches && t.upsertOptimisticPatches.length > 0)
2397
2555
  for (const [h, E] of t.upsertOptimisticPatches) {
2398
- const d = u(), _ = d.get(h);
2399
- ki(_, E) || (d.set(h, E), s = !0);
2556
+ const _ = u(), y = _.get(h);
2557
+ ln(y, E) || (_.set(h, E), r = !0);
2400
2558
  }
2401
2559
  const I = t.rootViewId ?? this.snapshot.rootViewId;
2402
- I !== this.snapshot.rootViewId && (s = !0, this.structureChanged = !0);
2560
+ I !== this.snapshot.rootViewId && (r = !0, this.structureChanged = !0);
2403
2561
  const c = t.nextVersion;
2404
- if (c !== this.snapshot.version && (s = !0), !s)
2562
+ if (c !== this.snapshot.version && (r = !0), !r)
2405
2563
  return this.snapshot = { ...this.snapshot, version: c }, !1;
2406
2564
  for (const h of this.changedNodeIds)
2407
2565
  this.nodeVersions.set(h, (this.nodeVersions.get(h) ?? 0) + 1);
@@ -2415,15 +2573,15 @@ class Oi {
2415
2573
  }
2416
2574
  replaceSnapshot(t) {
2417
2575
  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);
2576
+ 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;
2577
+ (s.rootViewId !== t.rootViewId || s.views.size !== t.views.size) && (this.structureChanged = !0);
2420
2578
  for (const [i, n] of t.views) {
2421
- const o = r.views.get(i);
2579
+ const o = s.views.get(i);
2422
2580
  o ? H(o, n, this.changedNodeIds) : (b(n, this.changedNodeIds), this.structureChanged = !0);
2423
2581
  }
2424
2582
  for (const i of this.changedNodeIds)
2425
2583
  this.nodeVersions.set(i, (this.nodeVersions.get(i) ?? 0) + 1);
2426
- return this.snapshot = t, s && this.notify(), s;
2584
+ return this.snapshot = t, r && this.notify(), r;
2427
2585
  }
2428
2586
  clear() {
2429
2587
  (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 +2599,18 @@ class Oi {
2441
2599
  this.listeners.delete(t);
2442
2600
  };
2443
2601
  }
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));
2602
+ subscribeNode(t, s) {
2603
+ let r = this.nodeListeners.get(t);
2604
+ return r || (r = /* @__PURE__ */ new Set(), this.nodeListeners.set(t, r)), r.add(s), () => {
2605
+ r && (r.delete(s), r.size === 0 && this.nodeListeners.delete(t));
2448
2606
  };
2449
2607
  }
2450
2608
  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);
2609
+ const s = this.snapshot.views.get(t);
2610
+ if (s)
2611
+ return s;
2612
+ for (const r of this.snapshot.views.values()) {
2613
+ const i = $t(r, t);
2456
2614
  if (i)
2457
2615
  return i;
2458
2616
  }
@@ -2466,15 +2624,15 @@ class Oi {
2466
2624
  return;
2467
2625
  }
2468
2626
  for (const t of this.changedNodeIds) {
2469
- const r = this.nodeListeners.get(t);
2470
- if (r)
2471
- for (const s of r)
2472
- s();
2627
+ const s = this.nodeListeners.get(t);
2628
+ if (s)
2629
+ for (const r of s)
2630
+ r();
2473
2631
  }
2474
2632
  this.changedNodeIds.clear();
2475
2633
  }
2476
2634
  commitSnapshot() {
2477
- let t, r, s;
2635
+ let t, s, r;
2478
2636
  if (this.viewsDirty) {
2479
2637
  const n = /* @__PURE__ */ new Map();
2480
2638
  for (const [o, a] of this.views)
@@ -2497,10 +2655,10 @@ class Oi {
2497
2655
  }))
2498
2656
  );
2499
2657
  }
2500
- r = n, this.patchesDirty = !1;
2658
+ s = n, this.patchesDirty = !1;
2501
2659
  } else
2502
- r = this.snapshot.optimisticPatches;
2503
- this.payloadsDirty ? (s = new Map(this.payloads), this.payloadsDirty = !1) : s = this.snapshot.payloads;
2660
+ s = this.snapshot.optimisticPatches;
2661
+ this.payloadsDirty ? (r = new Map(this.payloads), this.payloadsDirty = !1) : r = this.snapshot.payloads;
2504
2662
  let i = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
2505
2663
  if (i === void 0)
2506
2664
  for (const n of this.views.values())
@@ -2508,8 +2666,8 @@ class Oi {
2508
2666
  this.snapshot = {
2509
2667
  rootViewId: this.rootViewId,
2510
2668
  views: t,
2511
- payloads: s,
2512
- optimisticPatches: r,
2669
+ payloads: r,
2670
+ optimisticPatches: s,
2513
2671
  version: i
2514
2672
  };
2515
2673
  for (const n of this.changedNodeIds)
@@ -2523,59 +2681,59 @@ class Oi {
2523
2681
  }
2524
2682
  }
2525
2683
  }
2526
- class bi {
2684
+ class nn {
2527
2685
  streams = /* @__PURE__ */ new Map();
2528
2686
  listeners = /* @__PURE__ */ new Set();
2529
- apply(t, r) {
2530
- const i = this.getOrCreateStreamEntry(t).store.apply(r);
2687
+ apply(t, s) {
2688
+ const i = this.getOrCreateStreamEntry(t).store.apply(s);
2531
2689
  return i && this.notify(t), i;
2532
2690
  }
2533
2691
  applyStoreOp(t) {
2534
2692
  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;
2693
+ const s = this.getOrCreateStreamEntry(t.snapshot.streamId), r = s.category !== t.snapshot.category;
2694
+ return s.category = t.snapshot.category, s.store.replaceFromWire(t.snapshot) || r ? (this.notify(t.snapshot.streamId), !0) : !1;
2537
2695
  }
2538
2696
  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;
2697
+ const s = this.getOrCreateStreamEntry(t.streamId), r = t.category !== void 0 && s.category !== t.category;
2698
+ return t.category !== void 0 && (s.category = t.category), s.store.patchFromOp(t) || r ? (this.notify(t.streamId), !0) : !1;
2541
2699
  }
2542
2700
  if (t.type === "ClearStream") {
2543
- const r = this.streams.get(t.streamId);
2544
- return r ? (r.store.clear(), this.notify(t.streamId), !0) : !1;
2701
+ const s = this.streams.get(t.streamId);
2702
+ return s ? (s.store.clear(), this.notify(t.streamId), !0) : !1;
2545
2703
  }
2546
2704
  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
2705
  }
2548
2706
  applyStoreOps(t) {
2549
- for (const r of t)
2550
- this.applyStoreOp(r);
2707
+ for (const s of t)
2708
+ this.applyStoreOp(s);
2551
2709
  }
2552
2710
  clear(t) {
2553
- const r = this.streams.get(t);
2554
- r && (r.store.clear(), this.notify(t));
2711
+ const s = this.streams.get(t);
2712
+ s && (s.store.clear(), this.notify(t));
2555
2713
  }
2556
2714
  remove(t) {
2557
2715
  this.streams.delete(t) && this.notify(t);
2558
2716
  }
2559
- setCategory(t, r) {
2560
- const s = this.getOrCreateStreamEntry(t);
2561
- s.category !== r && (s.category = r, this.notify(t));
2717
+ setCategory(t, s) {
2718
+ const r = this.getOrCreateStreamEntry(t);
2719
+ r.category !== s && (r.category = s, this.notify(t));
2562
2720
  }
2563
2721
  getSnapshot(t) {
2564
- const r = this.streams.get(t);
2565
- return r ? {
2566
- ...r.store.getSnapshot(),
2722
+ const s = this.streams.get(t);
2723
+ return s ? {
2724
+ ...s.store.getSnapshot(),
2567
2725
  streamId: t,
2568
- category: r.category
2726
+ category: s.category
2569
2727
  } : void 0;
2570
2728
  }
2571
2729
  getSnapshots() {
2572
2730
  const t = [];
2573
- for (const [r, s] of this.streams) {
2574
- const i = s.store.getSnapshot();
2731
+ for (const [s, r] of this.streams) {
2732
+ const i = r.store.getSnapshot();
2575
2733
  t.push({
2576
2734
  ...i,
2577
- streamId: r,
2578
- category: s.category
2735
+ streamId: s,
2736
+ category: r.category
2579
2737
  });
2580
2738
  }
2581
2739
  return t;
@@ -2586,164 +2744,186 @@ class bi {
2586
2744
  };
2587
2745
  }
2588
2746
  getOrCreateStreamEntry(t) {
2589
- let r = this.streams.get(t);
2590
- return r || (r = { store: new Oi() }, this.streams.set(t, r)), r;
2747
+ let s = this.streams.get(t);
2748
+ return s || (s = { store: new rn() }, this.streams.set(t, s)), s;
2591
2749
  }
2592
2750
  notify(t) {
2593
- for (const r of this.listeners)
2594
- r(t);
2751
+ for (const s of this.listeners)
2752
+ s(t);
2595
2753
  }
2596
2754
  }
2597
- function K(e, t, r) {
2598
- if (e.id !== t.id)
2755
+ function j(e, t, s) {
2756
+ if (t.length === 0)
2599
2757
  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);
2758
+ const r = /* @__PURE__ */ new Map();
2759
+ for (const i of t)
2760
+ r.set(i.nodeId, i);
2761
+ return Wt(e, r);
2762
+ }
2763
+ function Wt(e, t, s) {
2764
+ const r = t.get(e.id);
2765
+ let i = e, n = !1;
2766
+ if (r?.textUpdates && r.textUpdates.length > 0) {
2767
+ const f = hn(e, r.textUpdates);
2768
+ i = f.node, n = f.changed;
2769
+ }
2770
+ let o = !1, a = i.props;
2771
+ if (r?.changedProps && r.changedProps.size > 0)
2772
+ for (const [f, A] of r.changedProps.entries()) {
2773
+ const T = a[f];
2774
+ if (A === void 0)
2775
+ (T !== void 0 || f in a) && (o || (a = V(a), o = !0), delete a[f]);
2776
+ else if (q(A)) {
2777
+ const S = V(A);
2778
+ k(S, T) || (o || (a = V(a), o = !0), a[f] = S);
2614
2779
  } 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
2780
+ k(A, T) || (o || (a = V(a), o = !0), a[f] = A);
2781
+ }
2782
+ let l = !1, u = i.styleIds;
2783
+ r?.styleIds !== void 0 && (jt(i.styleIds, r.styleIds) || (u = r.styleIds, l = !0));
2784
+ const I = i.children ?? [];
2785
+ let c = I, h = !1;
2786
+ if (r?.removals && r.removals.length > 0 || r?.moves && r.moves.length > 0 || r?.inserts && r.inserts.length > 0) {
2787
+ const f = c.slice();
2788
+ if (r?.removals && r.removals.length > 0) {
2789
+ const A = [...r.removals].sort((T, S) => S.index - T.index);
2790
+ for (const T of A)
2791
+ T.index >= 0 && T.index < f.length && f.splice(T.index, 1);
2792
+ h = !0;
2793
+ }
2794
+ if (r?.moves && r.moves.length > 0) {
2795
+ const A = [...r.moves].sort((S, g) => S.toIndex - g.toIndex), T = /* @__PURE__ */ new Map();
2796
+ for (const S of A) {
2797
+ const g = f.findIndex(($) => $.id === S.nodeId);
2798
+ g >= 0 && (T.set(S.nodeId, f[g]), f.splice(g, 1));
2799
+ }
2800
+ for (const S of A) {
2801
+ const g = T.get(S.nodeId);
2802
+ if (g) {
2803
+ const $ = Math.min(S.toIndex, f.length);
2804
+ f.splice($, 0, g);
2805
+ }
2806
+ }
2807
+ h = !0;
2808
+ }
2809
+ if (r?.inserts && r.inserts.length > 0) {
2810
+ const A = [...r.inserts].sort((T, S) => T.index - S.index);
2811
+ for (const T of A) {
2812
+ const S = Math.min(T.index, f.length);
2813
+ f.splice(S, 0, T.node);
2814
+ }
2815
+ h = !0;
2816
+ }
2817
+ c = f;
2818
+ }
2819
+ let _;
2820
+ for (let f = 0; f < c.length; f++) {
2821
+ const A = c[f], T = Wt(A, t);
2822
+ T !== A && (_ || (_ = c.slice()), _[f] = T);
2823
+ }
2824
+ return _ && (c = _, h = !0), n || o || l || h ? !o && !h && !l ? i : {
2825
+ id: e.id,
2826
+ type: e.type,
2827
+ props: o ? a : i.props,
2828
+ children: h ? c : I,
2829
+ styleIds: l ? u : i.styleIds
2650
2830
  } : e;
2651
2831
  }
2652
2832
  function b(e, t) {
2653
2833
  if (t.add(e.id), e.children)
2654
- for (const r of e.children)
2655
- b(r, t);
2834
+ for (const s of e.children)
2835
+ b(s, t);
2656
2836
  }
2657
2837
  const x = [];
2658
- function Pi(e) {
2838
+ function on(e) {
2659
2839
  for (; x.length <= e; )
2660
2840
  x.push(/* @__PURE__ */ new Map());
2661
2841
  return x[e].clear(), x[e];
2662
2842
  }
2663
- function H(e, t, r) {
2664
- Yt(e, t, r, 0);
2843
+ function H(e, t, s) {
2844
+ Kt(e, t, s, 0);
2665
2845
  }
2666
- function Yt(e, t, r, s) {
2846
+ function Kt(e, t, s, r) {
2667
2847
  if (e === t)
2668
2848
  return;
2669
- (e.type !== t.type || !Fi(e.props, t.props) || !jt(e.styleIds, t.styleIds)) && r.add(t.id);
2849
+ (e.type !== t.type || !an(e.props, t.props) || !jt(e.styleIds, t.styleIds)) && s.add(t.id);
2670
2850
  const n = e.children ?? [], o = t.children ?? [];
2671
2851
  if (n !== o) {
2672
- const a = Pi(s);
2852
+ const a = on(r);
2673
2853
  for (const l of n)
2674
2854
  a.set(l.id, l);
2675
2855
  for (const l of o) {
2676
2856
  const u = a.get(l.id);
2677
- u ? Yt(u, l, r, s + 1) : b(l, r);
2857
+ u ? Kt(u, l, s, r + 1) : b(l, s);
2678
2858
  }
2679
- n.length !== o.length && r.add(t.id);
2859
+ n.length !== o.length && s.add(t.id);
2680
2860
  }
2681
2861
  }
2682
- function Fi(e, t) {
2862
+ function an(e, t) {
2683
2863
  return k(e, t);
2684
2864
  }
2685
2865
  function $t(e, t) {
2686
2866
  if (e.id === t)
2687
2867
  return e;
2688
2868
  if (e.children)
2689
- for (const r of e.children) {
2690
- const s = $t(r, t);
2691
- if (s)
2692
- return s;
2869
+ for (const s of e.children) {
2870
+ const r = $t(s, t);
2871
+ if (r)
2872
+ return r;
2693
2873
  }
2694
2874
  }
2695
2875
  function jt(e, t) {
2696
2876
  return k(e, t);
2697
2877
  }
2698
- function ki(e, t) {
2878
+ function ln(e, t) {
2699
2879
  if (e === t) return !0;
2700
2880
  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)
2881
+ for (let s = 0; s < e.length; s++) {
2882
+ const r = e[s], i = t[s];
2883
+ if (r.id !== i.id || r.actionId !== i.actionId || r.ordinal !== i.ordinal || r.baseVersion !== i.baseVersion)
2704
2884
  return !1;
2705
2885
  }
2706
2886
  return !0;
2707
2887
  }
2708
- function Vi(e, t) {
2888
+ function In(e, t) {
2709
2889
  if (t.length === 0)
2710
2890
  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);
2891
+ const s = [...t].sort((n, o) => n.start - o.start);
2892
+ let r = e, i = 0;
2893
+ for (const n of s) {
2894
+ const o = at(n.start + i, 0, r.length);
2715
2895
  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;
2896
+ const I = r.slice(o), c = cn(I, n.insertedText);
2897
+ r = r.slice(0, o) + n.insertedText + I.slice(c), i += n.insertedText.length - c;
2718
2898
  continue;
2719
2899
  }
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;
2900
+ const a = n.end + i, l = at(a, o, r.length), u = l - o;
2901
+ r = r.slice(0, o) + n.insertedText + r.slice(l), i += n.insertedText.length - u;
2722
2902
  }
2723
- return s;
2903
+ return r;
2724
2904
  }
2725
- function Bi(e, t, r) {
2905
+ function hn(e, t, s) {
2726
2906
  if (t.length === 0)
2727
2907
  return { node: e, changed: !1 };
2728
- const s = /* @__PURE__ */ new Map();
2908
+ const r = /* @__PURE__ */ new Map();
2729
2909
  for (const i of t) {
2730
- const n = s.get(i.nodeId);
2731
- n ? n.push(i) : s.set(i.nodeId, [i]);
2910
+ const n = r.get(i.nodeId);
2911
+ n ? n.push(i) : r.set(i.nodeId, [i]);
2732
2912
  }
2733
- return Xt(e, s);
2913
+ return Xt(e, r);
2734
2914
  }
2735
- function Xt(e, t, r) {
2736
- const s = t.get(e.id) ?? [];
2915
+ function Xt(e, t, s) {
2916
+ const r = t.get(e.id) ?? [];
2737
2917
  let i = !1, n = e.props;
2738
- if (s.length > 0) {
2918
+ if (r.length > 0) {
2739
2919
  const u = /* @__PURE__ */ new Map();
2740
- for (const I of s) {
2920
+ for (const I of r) {
2741
2921
  const c = u.get(I.propertyName);
2742
2922
  c ? c.push(I) : u.set(I.propertyName, [I]);
2743
2923
  }
2744
2924
  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;
2925
+ const h = n[I], _ = In(typeof h == "string" ? h : "", c);
2926
+ i || (n = V(n), i = !0), n[I] = _;
2747
2927
  }
2748
2928
  }
2749
2929
  let o = !1;
@@ -2768,20 +2948,20 @@ function Xt(e, t, r) {
2768
2948
  changed: !0
2769
2949
  };
2770
2950
  }
2771
- function It(e, t, r) {
2772
- return Math.max(t, Math.min(r, e));
2951
+ function at(e, t, s) {
2952
+ return Math.max(t, Math.min(s, e));
2773
2953
  }
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];
2954
+ function cn(e, t) {
2955
+ const s = Math.min(e.length, t.length);
2956
+ let r = 0;
2957
+ for (; r < s && e.charCodeAt(r) === t.charCodeAt(r); )
2958
+ r++;
2959
+ return r;
2960
+ }
2961
+ function V(e) {
2962
+ const t = {}, s = Object.keys(e);
2963
+ for (let r = 0; r < s.length; r++) {
2964
+ const i = s[r];
2785
2965
  t[i] = e[i];
2786
2966
  }
2787
2967
  return t;
@@ -2795,48 +2975,49 @@ function k(e, t) {
2795
2975
  if (Array.isArray(e) && Array.isArray(t)) {
2796
2976
  if (e.length !== t.length)
2797
2977
  return !1;
2798
- for (let r = 0; r < e.length; r++)
2799
- if (!k(e[r], t[r]))
2978
+ for (let s = 0; s < e.length; s++)
2979
+ if (!k(e[s], t[s]))
2800
2980
  return !1;
2801
2981
  return !0;
2802
2982
  }
2803
2983
  if (q(e) && q(t)) {
2804
- const r = Object.keys(e), s = Object.keys(t);
2805
- if (r.length !== s.length)
2984
+ const s = Object.keys(e), r = Object.keys(t);
2985
+ if (s.length !== r.length)
2806
2986
  return !1;
2807
- for (const i of r)
2987
+ for (const i of s)
2808
2988
  if (!k(e[i], t[i]))
2809
2989
  return !1;
2810
2990
  return !0;
2811
2991
  }
2812
2992
  return !1;
2813
2993
  }
2814
- function vi(e) {
2994
+ function un(e) {
2815
2995
  return new Worker(
2816
- "" + new URL("assets/ui-worker-CBwhM0DU.js", import.meta.url).href,
2996
+ "" + new URL("assets/ui-worker-CcCXE6uz.js", import.meta.url).href,
2817
2997
  {
2818
2998
  type: "module",
2819
2999
  name: e?.name
2820
3000
  }
2821
3001
  );
2822
3002
  }
2823
- const D = zt("IkonUICore");
2824
- class xi {
3003
+ const R = zt("IkonUICore");
3004
+ class fn {
2825
3005
  unsubscribeProtocolMessages;
2826
3006
  client = null;
2827
- uiStore = new bi();
3007
+ uiStore = new nn();
2828
3008
  uiWorker = null;
2829
3009
  uiStyles = /* @__PURE__ */ new Map();
2830
3010
  uiUpdateListeners = /* @__PURE__ */ new Set();
2831
3011
  uiStyleListeners = /* @__PURE__ */ new Set();
3012
+ uiStyleDeleteListeners = /* @__PURE__ */ new Set();
2832
3013
  uiStreamClearedListeners = /* @__PURE__ */ new Set();
2833
3014
  useUiWorker;
2834
3015
  constructor(t) {
2835
- const r = t?.threading?.uiWorker ?? "auto";
2836
- this.useUiWorker = r !== "disabled" && typeof Worker < "u", t?.client && this.initialize(t.client, t);
3016
+ const s = t?.threading?.uiWorker ?? "auto";
3017
+ this.useUiWorker = s !== "disabled" && typeof Worker < "u", t?.client && this.initialize(t.client, t);
2837
3018
  }
2838
3019
  dispose() {
2839
- this.unsubscribeProtocolMessages?.(), this.uiWorker?.terminate(), this.uiWorker = null, this.client = null, this.uiStyleListeners.clear(), this.uiStyles.clear();
3020
+ this.unsubscribeProtocolMessages?.(), this.uiWorker?.terminate(), this.uiWorker = null, this.client = null, this.uiStyleListeners.clear(), this.uiStyleDeleteListeners.clear(), this.uiStyles.clear();
2840
3021
  }
2841
3022
  subscribeToUiUpdates(t) {
2842
3023
  return this.uiUpdateListeners.add(t), () => {
@@ -2853,13 +3034,18 @@ class xi {
2853
3034
  this.uiStyleListeners.delete(t);
2854
3035
  };
2855
3036
  }
3037
+ subscribeToUiStyleDeletes(t) {
3038
+ return this.uiStyleDeleteListeners.add(t), () => {
3039
+ this.uiStyleDeleteListeners.delete(t);
3040
+ };
3041
+ }
2856
3042
  getUiStyles() {
2857
3043
  return Array.from(this.uiStyles.values());
2858
3044
  }
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
3045
+ initialize(t, s) {
3046
+ this.client = t, this.useUiWorker && this.startUiWorker(s);
3047
+ const r = {
3048
+ opcodeGroupsMask: m.GROUP_CORE | m.GROUP_UI | m.GROUP_ACTIONS
2863
3049
  };
2864
3050
  this.unsubscribeProtocolMessages = t.subscribeToProtocolMessages((i) => {
2865
3051
  if (this.uiWorker) {
@@ -2867,57 +3053,57 @@ class xi {
2867
3053
  return;
2868
3054
  }
2869
3055
  this.handleProtocolMessage(i);
2870
- }, s);
3056
+ }, r);
2871
3057
  }
2872
3058
  startUiWorker(t) {
2873
3059
  try {
2874
- this.uiWorker = new vi();
3060
+ this.uiWorker = new un();
2875
3061
  } catch (i) {
2876
- D.warn("Failed to create UI worker, falling back to main thread", i), this.uiWorker = null;
3062
+ R.warn("Failed to create UI worker, falling back to main thread", i), this.uiWorker = null;
2877
3063
  return;
2878
3064
  }
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) => {
3065
+ const s = t?.threading?.flushIntervalMs, r = t?.threading?.maxLatencyMs;
3066
+ this.uiWorker.postMessage({ type: "configure", flushIntervalMs: s, maxLatencyMs: r }), this.uiWorker.addEventListener("message", (i) => {
2881
3067
  this.handleUiStoreOpBatch(i.data);
2882
3068
  }), this.uiWorker.addEventListener("error", (i) => {
2883
3069
  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();
3070
+ R.warn(`UI worker failed, falling back to main thread: ${n.join(" ")}`.trim()), this.uiWorker?.terminate(), this.uiWorker = null, this.rehydrateStoresForMainThread();
2885
3071
  });
2886
3072
  }
2887
3073
  rehydrateStoresForMainThread() {
2888
3074
  for (const t of this.uiStore.getSnapshots()) {
2889
3075
  if (!t.rootViewId)
2890
3076
  continue;
2891
- const r = t.views.get(t.rootViewId);
2892
- if (!r)
3077
+ const s = t.views.get(t.rootViewId);
3078
+ if (!s)
2893
3079
  continue;
2894
- const s = {
3080
+ const r = {
2895
3081
  snapshot: {
2896
3082
  type: "full",
2897
3083
  version: t.version ?? 0,
2898
3084
  metadata: { viewId: t.rootViewId },
2899
- root: r
3085
+ root: s
2900
3086
  },
2901
3087
  payloads: t.payloads
2902
3088
  };
2903
- this.uiStore.apply(t.streamId, s);
3089
+ this.uiStore.apply(t.streamId, r);
2904
3090
  }
2905
3091
  }
2906
3092
  forwardMessageToWorker(t) {
2907
3093
  if (this.uiWorker)
2908
3094
  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);
3095
+ const s = t.slice().buffer;
3096
+ this.uiWorker.postMessage({ type: "protocol", message: s }, [s]);
3097
+ } catch (s) {
3098
+ R.warn("Failed to forward message to UI worker", s);
2913
3099
  }
2914
3100
  }
2915
3101
  handleUiStoreOpBatch(t) {
2916
- for (const r of t.ops)
2917
- this.applyUiStoreOp(r);
3102
+ for (const s of t.ops)
3103
+ this.applyUiStoreOp(s);
2918
3104
  if (t.acks && t.acks.length > 0)
2919
- for (const r of t.acks)
2920
- this.sendUiUpdateAck(r.trackId, r.version);
3105
+ for (const s of t.acks)
3106
+ this.sendUiUpdateAck(s.trackId, s.version);
2921
3107
  }
2922
3108
  applyUiStoreOp(t) {
2923
3109
  if (t.type === "UpsertUiStyle") {
@@ -2925,7 +3111,7 @@ class xi {
2925
3111
  return;
2926
3112
  }
2927
3113
  if (t.type === "RemoveUiStyle") {
2928
- this.uiStyles.delete(t.styleId);
3114
+ this.uiStyles.delete(t.styleId) && this.notifyUiStyleDelete([t.styleId]);
2929
3115
  return;
2930
3116
  }
2931
3117
  if (t.type === "ClearStream") {
@@ -2943,7 +3129,7 @@ class xi {
2943
3129
  if (t.type === "ReplaceStreamSnapshot" || t.type === "PatchStreamSnapshot") {
2944
3130
  if (!this.uiStore.applyStoreOp(t))
2945
3131
  return;
2946
- const s = t.type === "ReplaceStreamSnapshot" ? t.snapshot.streamId : t.streamId, i = this.uiStore.getSnapshot(s);
3132
+ const r = t.type === "ReplaceStreamSnapshot" ? t.snapshot.streamId : t.streamId, i = this.uiStore.getSnapshot(r);
2947
3133
  if (!i?.rootViewId)
2948
3134
  return;
2949
3135
  const n = i.views.get(i.rootViewId);
@@ -2958,25 +3144,28 @@ class xi {
2958
3144
  },
2959
3145
  payloads: i.payloads
2960
3146
  };
2961
- this.notifyUiUpdate(s, o);
3147
+ this.notifyUiUpdate(r, o);
2962
3148
  return;
2963
3149
  }
2964
3150
  }
2965
3151
  handleProtocolMessage(t) {
2966
3152
  switch (Jt(t)) {
2967
- case R.CORE_GLOBAL_STATE:
3153
+ case m.CORE_GLOBAL_STATE:
2968
3154
  this.handleGlobalState(t);
2969
3155
  return;
2970
- case R.UI_UPDATE:
3156
+ case m.UI_UPDATE:
2971
3157
  this.handleUiUpdate(t);
2972
3158
  return;
2973
- case R.UI_STYLES:
3159
+ case m.UI_STYLES:
2974
3160
  this.handleUiStyles(t);
2975
3161
  return;
2976
- case R.UI_STYLES_BATCH:
3162
+ case m.UI_STYLES_BATCH:
2977
3163
  this.handleUiStylesBatch(t);
2978
3164
  return;
2979
- case R.ACTION_UI_CLEAR_STREAM:
3165
+ case m.UI_STYLES_DELETE:
3166
+ this.handleUiStylesDelete(t);
3167
+ return;
3168
+ case m.ACTION_UI_CLEAR_STREAM:
2980
3169
  this.handleClearStream(t);
2981
3170
  return;
2982
3171
  default:
@@ -2985,86 +3174,101 @@ class xi {
2985
3174
  }
2986
3175
  handleGlobalState(t) {
2987
3176
  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);
3177
+ const s = hr(t), r = /* @__PURE__ */ new Set();
3178
+ for (const i of Object.values(s.UIStreams ?? {}))
3179
+ r.add(i.StreamId), this.uiStore.setCategory(i.StreamId, i.Info?.Category);
2991
3180
  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);
3181
+ r.has(i.streamId) || (this.uiStore.remove(i.streamId), this.notifyUiStreamCleared(i.streamId));
3182
+ } catch (s) {
3183
+ R.error("Failed to handle global state", s);
2995
3184
  }
2996
3185
  }
2997
3186
  handleUiUpdate(t) {
2998
- const r = at(t), s = `${r.senderId}_${r.trackId}`;
3187
+ const s = nt(t), r = `${s.senderId}_${s.trackId}`;
2999
3188
  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);
3189
+ const i = Bi(t), n = en(i);
3190
+ this.notifyUiUpdate(r, n), this.uiStore.apply(r, n), this.sendUiUpdateAck(s.trackId, n.snapshot.version);
3002
3191
  } catch (i) {
3003
- i instanceof C ? D.warn("Failed to parse UI update", i.causeError ?? i) : D.error("Failed to apply UI update", i);
3192
+ i instanceof D ? R.warn("Failed to parse UI update", i.causeError ?? i) : R.error("Failed to apply UI update", i);
3004
3193
  }
3005
3194
  }
3006
3195
  handleUiStyles(t) {
3007
3196
  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
3197
+ const s = ni(t);
3198
+ if (!s.StyleId) return;
3199
+ const r = {
3200
+ styleId: s.StyleId,
3201
+ css: s.Style?.css,
3202
+ common: s.Style?.common
3014
3203
  };
3015
- this.uiStyles.set(s.styleId, s), this.notifyUiStyle(s);
3016
- } catch (r) {
3017
- D.error("Failed to handle UI styles", r);
3204
+ this.uiStyles.set(r.styleId, r), this.notifyUiStyle(r);
3205
+ } catch (s) {
3206
+ R.error("Failed to handle UI styles", s);
3018
3207
  }
3019
3208
  }
3020
3209
  handleUiStylesBatch(t) {
3021
3210
  try {
3022
- const r = ei(t);
3023
- if (!r.Styles) return;
3024
- for (const s of r.Styles) {
3025
- if (!s.StyleId) continue;
3211
+ const s = _i(t);
3212
+ if (!s.Styles) return;
3213
+ for (const r of s.Styles) {
3214
+ if (!r.StyleId) continue;
3026
3215
  const i = {
3027
- styleId: s.StyleId,
3028
- css: s.Style?.css,
3029
- common: s.Style?.common
3216
+ styleId: r.StyleId,
3217
+ css: r.Style?.css,
3218
+ common: r.Style?.common
3030
3219
  };
3031
3220
  this.uiStyles.set(i.styleId, i), this.notifyUiStyle(i);
3032
3221
  }
3033
- } catch (r) {
3034
- D.error("Failed to handle UI styles batch", r);
3222
+ } catch (s) {
3223
+ R.error("Failed to handle UI styles batch", s);
3224
+ }
3225
+ }
3226
+ handleUiStylesDelete(t) {
3227
+ try {
3228
+ const s = gi(t);
3229
+ if (!s.StyleIds || s.StyleIds.length === 0) return;
3230
+ for (const r of s.StyleIds)
3231
+ this.uiStyles.delete(r);
3232
+ this.notifyUiStyleDelete(s.StyleIds);
3233
+ } catch (s) {
3234
+ R.error("Failed to handle UI styles delete", s);
3035
3235
  }
3036
3236
  }
3037
3237
  handleClearStream(t) {
3038
- const r = at(t), s = `${r.senderId}_${r.trackId}`;
3039
- this.uiStore.clear(s), this.notifyUiStreamCleared(s);
3238
+ const s = nt(t), r = `${s.senderId}_${s.trackId}`;
3239
+ this.uiStore.clear(r), this.notifyUiStreamCleared(r);
3040
3240
  }
3041
- notifyUiUpdate(t, r) {
3042
- for (const s of this.uiUpdateListeners)
3043
- s(t, r);
3241
+ notifyUiUpdate(t, s) {
3242
+ for (const r of this.uiUpdateListeners)
3243
+ r(t, s);
3044
3244
  }
3045
3245
  notifyUiStyle(t) {
3046
- for (const r of this.uiStyleListeners)
3047
- r(t);
3246
+ for (const s of this.uiStyleListeners)
3247
+ s(t);
3248
+ }
3249
+ notifyUiStyleDelete(t) {
3250
+ for (const s of this.uiStyleDeleteListeners)
3251
+ s(t);
3048
3252
  }
3049
3253
  notifyUiStreamCleared(t) {
3050
- for (const r of this.uiStreamClearedListeners)
3051
- r(t);
3254
+ for (const s of this.uiStreamClearedListeners)
3255
+ s(t);
3052
3256
  }
3053
- sendUiUpdateAck(t, r) {
3054
- if (this.client && !(!Number.isFinite(r) || r < 0))
3257
+ sendUiUpdateAck(t, s) {
3258
+ if (this.client && !(!Number.isFinite(s) || s < 0))
3055
3259
  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);
3260
+ const r = Ki({ Version: s }, this.client.sessionId ?? 0, { trackId: t });
3261
+ this.client.sendProtocolMessage(r);
3262
+ } catch (r) {
3263
+ R.warn("Failed to send UI update ack", r);
3060
3264
  }
3061
3265
  }
3062
3266
  }
3063
3267
  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
3268
+ sn as HandlerCache,
3269
+ fn as IkonUICore,
3270
+ nn as UiStore,
3271
+ rn as UiStreamStore,
3272
+ D as UiUpdateParseError,
3273
+ en as parseUiUpdate
3070
3274
  };