@ikonai/sdk-ui 1.0.19 → 1.0.21

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
@@ -3,18 +3,18 @@ const P = 27, Zt = {
3
3
  Compressed: 8
4
4
  };
5
5
  function te(e) {
6
- const t = G(e), s = new DataView(t.buffer, t.byteOffset, t.byteLength);
6
+ const t = G(e), r = new DataView(t.buffer, t.byteOffset, t.byteLength);
7
7
  if (t.length < P)
8
8
  throw new Error("Protocol payload too short");
9
- 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), h = s.getUint8(24), I = s.getUint8(25), E = s.getUint8(26);
9
+ 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), h = r.getUint8(24), I = r.getUint8(25), E = r.getUint8(26);
10
10
  if (P + l * 4 > t.length)
11
11
  throw new Error("Protocol header exceeds payload length");
12
12
  const u = [];
13
13
  let _ = P;
14
14
  for (let y = 0; y < l; y++)
15
- u.push(s.getUint32(_, !0)), _ += 4;
15
+ u.push(r.getUint32(_, !0)), _ += 4;
16
16
  return {
17
- length: r,
17
+ length: s,
18
18
  opcode: i,
19
19
  senderId: n,
20
20
  trackId: o,
@@ -25,29 +25,29 @@ function te(e) {
25
25
  flags: E
26
26
  };
27
27
  }
28
- async function M(e, t, s) {
29
- const r = G(e), i = te(r);
28
+ async function M(e, t, r) {
29
+ const s = G(e), i = te(s);
30
30
  if (t !== void 0 && i.opcode !== t)
31
31
  throw new Error(`Unexpected opcode ${i.opcode}`);
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
- let o = r.subarray(n, i.length);
36
- return (i.flags & Zt.Compressed) !== 0 && (o = await se(o)), o;
35
+ let o = s.subarray(n, i.length);
36
+ return (i.flags & Zt.Compressed) !== 0 && (o = await re(o)), o;
37
37
  }
38
- function ee(e, t, s, r, i) {
38
+ function ee(e, t, r, s, i) {
39
39
  const n = i?.trackId ?? 0, o = i?.sequenceId ?? 0, a = i?.flags ?? 0, l = i?.targetIds ?? [], h = i?.payloadType ?? 8, I = P + l.length * 4, E = I + t.length, c = new Uint8Array(E), u = new DataView(c.buffer);
40
- u.setUint32(0, E, !0), u.setUint32(4, e >>> 0, !0), u.setUint32(8, r >>> 0, !0), u.setUint32(12, n >>> 0, !0), u.setUint32(16, o >>> 0, !0), u.setUint32(20, l.length >>> 0, !0), u.setUint8(24, s & 255), u.setUint8(25, h & 255), u.setUint8(26, a & 255);
40
+ u.setUint32(0, E, !0), u.setUint32(4, e >>> 0, !0), u.setUint32(8, s >>> 0, !0), u.setUint32(12, n >>> 0, !0), u.setUint32(16, o >>> 0, !0), u.setUint32(20, l.length >>> 0, !0), u.setUint8(24, r & 255), u.setUint8(25, h & 255), u.setUint8(26, a & 255);
41
41
  let _ = P;
42
42
  for (let y = 0; y < l.length; y++)
43
43
  u.setUint32(_, l[y] >>> 0, !0), _ += 4;
44
44
  return c.set(t, I), c;
45
45
  }
46
- async function se(e) {
46
+ async function re(e) {
47
47
  if (typeof DecompressionStream > "u")
48
48
  throw new Error("DecompressionStream not supported");
49
- const t = new DecompressionStream("gzip"), s = t.writable.getWriter(), r = new Uint8Array(e);
50
- s.write(r), s.close();
49
+ const t = new DecompressionStream("gzip"), r = t.writable.getWriter(), s = new Uint8Array(e);
50
+ r.write(s), r.close();
51
51
  const i = t.readable.getReader(), n = [];
52
52
  let o = 0;
53
53
  for (; ; ) {
@@ -62,7 +62,7 @@ async function se(e) {
62
62
  return a;
63
63
  }
64
64
  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 || {});
65
- const lt = 161, It = 162, W = new TextEncoder(), re = new TextDecoder("utf-8", { fatal: !0 });
65
+ const lt = 161, It = 162, W = new TextEncoder(), se = new TextDecoder("utf-8", { fatal: !0 });
66
66
  class B {
67
67
  constructor(t = 1) {
68
68
  this.version = t, this.buffer.writeByte(lt), this.buffer.writeVarUInt(t >>> 0);
@@ -70,54 +70,54 @@ class B {
70
70
  buffer = new p();
71
71
  closed = !1;
72
72
  cached;
73
- writeInt32Field(t, s) {
74
- this.writeFixedField(t, 3, () => this.buffer.writeInt32(s | 0));
73
+ writeInt32Field(t, r) {
74
+ this.writeFixedField(t, 3, () => this.buffer.writeInt32(r | 0));
75
75
  }
76
- writeUInt32Field(t, s) {
77
- this.writeFixedField(t, 5, () => this.buffer.writeUInt32(s >>> 0));
76
+ writeUInt32Field(t, r) {
77
+ this.writeFixedField(t, 5, () => this.buffer.writeUInt32(r >>> 0));
78
78
  }
79
- writeInt64Field(t, s) {
80
- this.writeFixedField(t, 4, () => this.buffer.writeBigInt64(s));
79
+ writeInt64Field(t, r) {
80
+ this.writeFixedField(t, 4, () => this.buffer.writeBigInt64(r));
81
81
  }
82
- writeUInt64Field(t, s) {
83
- this.writeFixedField(t, 6, () => this.buffer.writeBigUInt64(s));
82
+ writeUInt64Field(t, r) {
83
+ this.writeFixedField(t, 6, () => this.buffer.writeBigUInt64(r));
84
84
  }
85
- writeFloat32Field(t, s) {
86
- this.writeFixedField(t, 7, () => this.buffer.writeFloat32(s));
85
+ writeFloat32Field(t, r) {
86
+ this.writeFixedField(t, 7, () => this.buffer.writeFloat32(r));
87
87
  }
88
- writeFloat64Field(t, s) {
89
- this.writeFixedField(t, 8, () => this.buffer.writeFloat64(s));
88
+ writeFloat64Field(t, r) {
89
+ this.writeFixedField(t, 8, () => this.buffer.writeFloat64(r));
90
90
  }
91
- writeBoolField(t, s) {
92
- this.writeFixedField(t, 2, () => this.buffer.writeByte(s ? 1 : 0));
91
+ writeBoolField(t, r) {
92
+ this.writeFixedField(t, 2, () => this.buffer.writeByte(r ? 1 : 0));
93
93
  }
94
- writeGuidField(t, s) {
95
- const r = s instanceof d ? s.asBytes() : s;
96
- if (r.length !== 16)
94
+ writeGuidField(t, r) {
95
+ const s = r instanceof d ? r.asBytes() : r;
96
+ if (s.length !== 16)
97
97
  throw new Error("Guid payload must be 16 bytes");
98
- this.writeFixedField(t, 14, () => this.buffer.writeBytes(r));
98
+ this.writeFixedField(t, 14, () => this.buffer.writeBytes(s));
99
99
  }
100
- writeStringField(t, s) {
101
- const r = W.encode(s ?? "");
102
- this.writeVariableField(t, 12, r);
100
+ writeStringField(t, r) {
101
+ const s = W.encode(r ?? "");
102
+ this.writeVariableField(t, 12, s);
103
103
  }
104
- writeBinaryField(t, s) {
105
- this.writeVariableField(t, 13, s);
104
+ writeBinaryField(t, r) {
105
+ this.writeVariableField(t, 13, r);
106
106
  }
107
- writeObjectField(t, s, r) {
108
- const i = new B(s);
109
- r(i);
107
+ writeObjectField(t, r, s) {
108
+ const i = new B(r);
109
+ s(i);
110
110
  const n = i.finish();
111
111
  this.writeVariableField(t, 11, n);
112
112
  }
113
- writeArrayField(t, s, r) {
114
- const i = new Y(s);
115
- r(i);
113
+ writeArrayField(t, r, s) {
114
+ const i = new Y(r);
115
+ s(i);
116
116
  const n = i.finish();
117
117
  this.writeVariableField(t, 9, n);
118
118
  }
119
- writeDictionaryField(t, s, r, i) {
120
- const n = new Q(s, r);
119
+ writeDictionaryField(t, r, s, i) {
120
+ const n = new Q(r, s);
121
121
  i(n);
122
122
  const o = n.finish();
123
123
  this.writeVariableField(t, 10, o);
@@ -125,14 +125,14 @@ class B {
125
125
  finish() {
126
126
  return this.closed || (this.buffer.writeByte(It), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
127
127
  }
128
- writeFixedField(t, s, r) {
129
- this.writeFieldHeader(t, s, 0), r();
128
+ writeFixedField(t, r, s) {
129
+ this.writeFieldHeader(t, r, 0), s();
130
130
  }
131
- writeVariableField(t, s, r) {
132
- this.writeFieldHeader(t, s, r.length), this.buffer.writeBytes(r);
131
+ writeVariableField(t, r, s) {
132
+ this.writeFieldHeader(t, r, s.length), this.buffer.writeBytes(s);
133
133
  }
134
- writeFieldHeader(t, s, r) {
135
- this.buffer.writeUInt32(t >>> 0), this.buffer.writeByte(K(s)), le(s) && this.buffer.writeVarUInt(r >>> 0);
134
+ writeFieldHeader(t, r, s) {
135
+ this.buffer.writeUInt32(t >>> 0), this.buffer.writeByte(K(r)), le(r) && this.buffer.writeVarUInt(s >>> 0);
136
136
  }
137
137
  }
138
138
  class Y {
@@ -188,18 +188,18 @@ class Y {
188
188
  14
189
189
  /* Guid */
190
190
  ), this.count++;
191
- const s = t instanceof d ? t.asBytes() : t;
192
- if (s.length !== 16)
191
+ const r = t instanceof d ? t.asBytes() : t;
192
+ if (r.length !== 16)
193
193
  throw new Error("Guid payload must be 16 bytes");
194
- this.payload.writeBytes(s);
194
+ this.payload.writeBytes(r);
195
195
  }
196
196
  writeString(t) {
197
197
  this.ensureElementType(
198
198
  12
199
199
  /* String */
200
200
  ), this.count++;
201
- const s = W.encode(t ?? "");
202
- this.payload.writeVarUInt(s.length), this.payload.writeBytes(s);
201
+ const r = W.encode(t ?? "");
202
+ this.payload.writeVarUInt(r.length), this.payload.writeBytes(r);
203
203
  }
204
204
  writeBinary(t) {
205
205
  this.ensureElementType(
@@ -207,33 +207,33 @@ class Y {
207
207
  /* Binary */
208
208
  ), this.count++, this.payload.writeVarUInt(t.length), this.payload.writeBytes(t);
209
209
  }
210
- writeObject(t, s) {
210
+ writeObject(t, r) {
211
211
  this.ensureElementType(
212
212
  11
213
213
  /* Object */
214
214
  ), this.count++;
215
- const r = new B(t);
216
- s(r);
217
- const i = r.finish();
215
+ const s = new B(t);
216
+ r(s);
217
+ const i = s.finish();
218
218
  this.payload.writeVarUInt(i.length), this.payload.writeBytes(i);
219
219
  }
220
- writeArray(t, s) {
220
+ writeArray(t, r) {
221
221
  this.ensureElementType(
222
222
  9
223
223
  /* Array */
224
224
  ), this.count++;
225
- const r = new Y(t);
226
- s(r);
227
- const i = r.finish();
225
+ const s = new Y(t);
226
+ r(s);
227
+ const i = s.finish();
228
228
  this.payload.writeBytes(i);
229
229
  }
230
- writeDictionary(t, s, r) {
230
+ writeDictionary(t, r, s) {
231
231
  this.ensureElementType(
232
232
  10
233
233
  /* Dict */
234
234
  ), this.count++;
235
- const i = new Q(t, s);
236
- r(i);
235
+ const i = new Q(t, r);
236
+ s(i);
237
237
  const n = i.finish();
238
238
  this.payload.writeBytes(n);
239
239
  }
@@ -247,8 +247,8 @@ class Y {
247
247
  }
248
248
  }
249
249
  class Q {
250
- constructor(t, s) {
251
- this.keyType = t, this.valueType = s, et(t);
250
+ constructor(t, r) {
251
+ this.keyType = t, this.valueType = r, et(t);
252
252
  }
253
253
  payload = new p();
254
254
  count = 0;
@@ -268,8 +268,8 @@ class Q {
268
268
  }
269
269
  }
270
270
  class ie {
271
- constructor(t, s, r, i) {
272
- this.keyType = t, this.valueType = s, this.payload = r, this.onComplete = i;
271
+ constructor(t, r, s, i) {
272
+ this.keyType = t, this.valueType = r, this.payload = s, this.onComplete = i;
273
273
  }
274
274
  keyWritten = !1;
275
275
  valueWritten = !1;
@@ -321,18 +321,18 @@ class ie {
321
321
  14
322
322
  /* Guid */
323
323
  );
324
- const s = t instanceof d ? t.asBytes() : t;
325
- if (s.length !== 16)
324
+ const r = t instanceof d ? t.asBytes() : t;
325
+ if (r.length !== 16)
326
326
  throw new Error("Guid payload must be 16 bytes");
327
- this.payload.writeBytes(s), this.keyWritten = !0;
327
+ this.payload.writeBytes(r), this.keyWritten = !0;
328
328
  }
329
329
  writeKeyString(t) {
330
330
  this.ensureKeyType(
331
331
  12
332
332
  /* String */
333
333
  );
334
- const s = W.encode(t ?? "");
335
- this.payload.writeVarUInt(s.length), this.payload.writeBytes(s), this.keyWritten = !0;
334
+ const r = W.encode(t ?? "");
335
+ this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.keyWritten = !0;
336
336
  }
337
337
  writeKeyBinary(t) {
338
338
  this.ensureKeyType(
@@ -387,10 +387,10 @@ class ie {
387
387
  14
388
388
  /* Guid */
389
389
  );
390
- const s = t instanceof d ? t.asBytes() : t;
391
- if (s.length !== 16)
390
+ const r = t instanceof d ? t.asBytes() : t;
391
+ if (r.length !== 16)
392
392
  throw new Error("Guid payload must be 16 bytes");
393
- this.payload.writeBytes(s), this.valueWritten = !0;
393
+ this.payload.writeBytes(r), this.valueWritten = !0;
394
394
  }
395
395
  writeNullValue() {
396
396
  this.ensureValueType(
@@ -409,36 +409,36 @@ class ie {
409
409
  12
410
410
  /* String */
411
411
  );
412
- const s = W.encode(t ?? "");
413
- this.payload.writeVarUInt(s.length), this.payload.writeBytes(s), this.valueWritten = !0;
412
+ const r = W.encode(t ?? "");
413
+ this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.valueWritten = !0;
414
414
  }
415
- writeValueObject(t, s) {
415
+ writeValueObject(t, r) {
416
416
  this.ensureValueType(
417
417
  11
418
418
  /* Object */
419
419
  );
420
- const r = new B(t);
421
- s(r);
422
- const i = r.finish();
420
+ const s = new B(t);
421
+ r(s);
422
+ const i = s.finish();
423
423
  this.payload.writeVarUInt(i.length), this.payload.writeBytes(i), this.valueWritten = !0;
424
424
  }
425
- writeValueArray(t, s) {
425
+ writeValueArray(t, r) {
426
426
  this.ensureValueType(
427
427
  9
428
428
  /* Array */
429
429
  );
430
- const r = new Y(t);
431
- s(r);
432
- const i = r.finish();
430
+ const s = new Y(t);
431
+ r(s);
432
+ const i = s.finish();
433
433
  this.payload.writeBytes(i), this.valueWritten = !0;
434
434
  }
435
- writeValueDictionary(t, s, r) {
435
+ writeValueDictionary(t, r, s) {
436
436
  this.ensureValueType(
437
437
  10
438
438
  /* Dict */
439
439
  );
440
- const i = new Q(t, s);
441
- r(i);
440
+ const i = new Q(t, r);
441
+ s(i);
442
442
  const n = i.finish();
443
443
  this.payload.writeBytes(n), this.valueWritten = !0;
444
444
  }
@@ -459,19 +459,19 @@ class ie {
459
459
  }
460
460
  }
461
461
  class O {
462
- constructor(t, s, r) {
463
- this.buffer = t, this.version = s, this.offset = r, this.end = t.length - 1;
462
+ constructor(t, r, s) {
463
+ this.buffer = t, this.version = r, this.offset = s, this.end = t.length - 1;
464
464
  }
465
465
  offset;
466
466
  end;
467
467
  static create(t) {
468
- const s = G(t);
469
- if (s.length < 2)
468
+ const r = G(t);
469
+ if (r.length < 2)
470
470
  throw new Error("Teleport payload too short");
471
- if (s[0] !== lt || s[s.length - 1] !== It)
471
+ if (r[0] !== lt || r[r.length - 1] !== It)
472
472
  throw new Error("Teleport object missing markers");
473
- const r = { offset: 1 }, i = U(s, r, "InvalidLength");
474
- return new O(s, i, r.offset);
473
+ const s = { offset: 1 }, i = U(r, s, "InvalidLength");
474
+ return new O(r, i, s.offset);
475
475
  }
476
476
  next() {
477
477
  if (this.offset >= this.end)
@@ -480,10 +480,10 @@ class O {
480
480
  throw new Error("Teleport object truncated");
481
481
  const t = Ie(this.buffer, this.offset);
482
482
  this.offset += 4;
483
- const s = this.buffer[this.offset++], r = s >> 4 & 15;
484
- if ((s & 15) !== 0)
483
+ const r = this.buffer[this.offset++], s = r >> 4 & 15;
484
+ if ((r & 15) !== 0)
485
485
  throw new Error("Teleport field flags must be zero");
486
- const i = F(r);
486
+ const i = F(s);
487
487
  let n;
488
488
  if (i >= 0)
489
489
  N(this.buffer, this.offset, i), n = this.buffer.subarray(this.offset, this.offset + i), this.offset += i;
@@ -491,12 +491,12 @@ class O {
491
491
  const o = { offset: this.offset }, a = U(this.buffer, o, "InvalidLength");
492
492
  N(this.buffer, o.offset, a), n = this.buffer.subarray(o.offset, o.offset + a), this.offset = o.offset + a;
493
493
  }
494
- return new ne(t, r, n);
494
+ return new ne(t, s, n);
495
495
  }
496
496
  }
497
497
  class L {
498
- constructor(t, s) {
499
- this.type = t, this.payload = s;
498
+ constructor(t, r) {
499
+ this.type = t, this.payload = r;
500
500
  }
501
501
  asInt32() {
502
502
  return this.ensureType(
@@ -556,7 +556,7 @@ class L {
556
556
  return this.ensureType(
557
557
  12
558
558
  /* String */
559
- ), re.decode(this.payload);
559
+ ), se.decode(this.payload);
560
560
  }
561
561
  asGuid() {
562
562
  return this.ensureType(
@@ -588,8 +588,8 @@ class L {
588
588
  }
589
589
  }
590
590
  class ne extends L {
591
- constructor(t, s, r) {
592
- super(s, r), this.fieldId = t;
591
+ constructor(t, r, s) {
592
+ super(r, s), this.fieldId = t;
593
593
  }
594
594
  get isNull() {
595
595
  return this.type === 1;
@@ -604,11 +604,11 @@ class Z {
604
604
  constructor(t) {
605
605
  if (this.payload = t, t.length === 0)
606
606
  throw new Error("Array payload too short");
607
- const s = t[0];
608
- if (this.elementType = s >> 4 & 15, (s & 15) !== 0)
607
+ const r = t[0];
608
+ if (this.elementType = r >> 4 & 15, (r & 15) !== 0)
609
609
  throw new Error("Array flags must be zero");
610
- const r = { offset: 1 };
611
- this.count = U(t, r, "ArrayMalformed"), this.offset = r.offset;
610
+ const s = { offset: 1 };
611
+ this.count = U(t, s, "ArrayMalformed"), this.offset = s.offset;
612
612
  }
613
613
  static create(t) {
614
614
  return new Z(G(t));
@@ -634,29 +634,29 @@ class Z {
634
634
  case 14: {
635
635
  const t = F(this.elementType);
636
636
  N(this.payload, this.offset, t);
637
- const s = this.payload.subarray(this.offset, this.offset + t);
638
- return this.offset += t, new V(this.elementType, s);
637
+ const r = this.payload.subarray(this.offset, this.offset + t);
638
+ return this.offset += t, new V(this.elementType, r);
639
639
  }
640
640
  case 12:
641
641
  case 13: {
642
- const t = { offset: this.offset }, s = U(this.payload, t, "ArrayMalformed");
643
- N(this.payload, t.offset, s);
644
- const r = this.payload.subarray(t.offset, t.offset + s);
645
- return this.offset = t.offset + s, new V(this.elementType, r);
642
+ const t = { offset: this.offset }, r = U(this.payload, t, "ArrayMalformed");
643
+ N(this.payload, t.offset, r);
644
+ const s = this.payload.subarray(t.offset, t.offset + r);
645
+ return this.offset = t.offset + r, new V(this.elementType, s);
646
646
  }
647
647
  case 11: {
648
- const t = { offset: this.offset }, s = U(this.payload, t, "ArrayMalformed");
649
- N(this.payload, t.offset, s);
650
- const r = this.payload.subarray(t.offset, t.offset + s);
651
- return this.offset = t.offset + s, new V(11, r);
648
+ const t = { offset: this.offset }, r = U(this.payload, t, "ArrayMalformed");
649
+ N(this.payload, t.offset, r);
650
+ const s = this.payload.subarray(t.offset, t.offset + r);
651
+ return this.offset = t.offset + r, new V(11, s);
652
652
  }
653
653
  case 9: {
654
- const t = st(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
655
- return this.offset += t, new V(9, s);
654
+ const t = rt(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
655
+ return this.offset += t, new V(9, r);
656
656
  }
657
657
  case 10: {
658
- const t = rt(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
659
- return this.offset += t, new V(10, s);
658
+ const t = st(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
659
+ return this.offset += t, new V(10, r);
660
660
  }
661
661
  default:
662
662
  throw new Error(`Unsupported array element type ${C[this.elementType]}`);
@@ -664,8 +664,8 @@ class Z {
664
664
  }
665
665
  }
666
666
  class V extends L {
667
- constructor(t, s) {
668
- super(t, s);
667
+ constructor(t, r) {
668
+ super(t, r);
669
669
  }
670
670
  }
671
671
  class tt {
@@ -681,8 +681,8 @@ class tt {
681
681
  if (this.keyType = t[0] >> 4 & 15, this.valueType = t[1] >> 4 & 15, (t[0] & 15) !== 0 || (t[1] & 15) !== 0)
682
682
  throw new Error("Dictionary key/value flags must be zero");
683
683
  et(this.keyType);
684
- const s = { offset: 2 };
685
- this.count = U(t, s, "DictMalformed"), this.offset = s.offset;
684
+ const r = { offset: 2 };
685
+ this.count = U(t, r, "DictMalformed"), this.offset = r.offset;
686
686
  }
687
687
  static create(t) {
688
688
  return new tt(G(t));
@@ -693,21 +693,21 @@ class tt {
693
693
  throw new Error("Dictionary payload contains trailing data");
694
694
  return null;
695
695
  }
696
- const t = this.readKey(), s = this.readValue();
697
- return this.index++, new oe(t, s);
696
+ const t = this.readKey(), r = this.readValue();
697
+ return this.index++, new oe(t, r);
698
698
  }
699
699
  readKey() {
700
700
  const t = F(this.keyType);
701
701
  if (t >= 0) {
702
702
  N(this.payload, this.offset, t);
703
- const s = this.payload.subarray(this.offset, this.offset + t);
704
- return this.offset += t, new L(this.keyType, s);
703
+ const r = this.payload.subarray(this.offset, this.offset + t);
704
+ return this.offset += t, new L(this.keyType, r);
705
705
  }
706
706
  if (this.keyType === 12 || this.keyType === 13) {
707
- const s = { offset: this.offset }, r = U(this.payload, s, "DictMalformed");
708
- N(this.payload, s.offset, r);
709
- const i = this.payload.subarray(s.offset, s.offset + r);
710
- return this.offset = s.offset + r, new L(this.keyType, i);
707
+ const r = { offset: this.offset }, s = U(this.payload, r, "DictMalformed");
708
+ N(this.payload, r.offset, s);
709
+ const i = this.payload.subarray(r.offset, r.offset + s);
710
+ return this.offset = r.offset + s, new L(this.keyType, i);
711
711
  }
712
712
  throw new Error("Unsupported dictionary key type");
713
713
  }
@@ -715,24 +715,24 @@ class tt {
715
715
  switch (this.valueType) {
716
716
  case 12:
717
717
  case 13: {
718
- const t = { offset: this.offset }, s = U(this.payload, t, "DictMalformed");
719
- N(this.payload, t.offset, s);
720
- const r = this.payload.subarray(t.offset, t.offset + s);
721
- return this.offset = t.offset + s, new L(this.valueType, r);
718
+ const t = { offset: this.offset }, r = U(this.payload, t, "DictMalformed");
719
+ N(this.payload, t.offset, r);
720
+ const s = this.payload.subarray(t.offset, t.offset + r);
721
+ return this.offset = t.offset + r, new L(this.valueType, s);
722
722
  }
723
723
  case 11: {
724
- const t = { offset: this.offset }, s = U(this.payload, t, "DictMalformed");
725
- N(this.payload, t.offset, s);
726
- const r = this.payload.subarray(t.offset, t.offset + s);
727
- return this.offset = t.offset + s, new L(11, r);
724
+ const t = { offset: this.offset }, r = U(this.payload, t, "DictMalformed");
725
+ N(this.payload, t.offset, r);
726
+ const s = this.payload.subarray(t.offset, t.offset + r);
727
+ return this.offset = t.offset + r, new L(11, s);
728
728
  }
729
729
  case 9: {
730
- const t = st(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
731
- return this.offset += t, new L(9, s);
730
+ const t = rt(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
731
+ return this.offset += t, new L(9, r);
732
732
  }
733
733
  case 10: {
734
- const t = rt(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
735
- return this.offset += t, new L(10, s);
734
+ const t = st(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
735
+ return this.offset += t, new L(10, r);
736
736
  }
737
737
  case 3:
738
738
  case 5:
@@ -745,8 +745,8 @@ class tt {
745
745
  case 1: {
746
746
  const t = F(this.valueType);
747
747
  N(this.payload, this.offset, t);
748
- const s = this.payload.subarray(this.offset, this.offset + t);
749
- return this.offset += t, new L(this.valueType, s);
748
+ const r = this.payload.subarray(this.offset, this.offset + t);
749
+ return this.offset += t, new L(this.valueType, r);
750
750
  }
751
751
  default:
752
752
  throw new Error(`Unsupported dictionary value type ${C[this.valueType]}`);
@@ -754,8 +754,8 @@ class tt {
754
754
  }
755
755
  }
756
756
  class oe {
757
- constructor(t, s) {
758
- this.key = t, this.value = s;
757
+ constructor(t, r) {
758
+ this.key = t, this.value = r;
759
759
  }
760
760
  }
761
761
  class d {
@@ -765,14 +765,14 @@ class d {
765
765
  static fromString(t) {
766
766
  if (!t)
767
767
  throw new Error("Guid string is empty");
768
- const s = t.replace(/-/g, "");
769
- if (s.length !== 32)
768
+ const r = t.replace(/-/g, "");
769
+ if (r.length !== 32)
770
770
  throw new Error("Guid string must be 32 hex characters");
771
- const r = new Uint8Array(16), i = d.parseHexSlice(s, 0, 8), n = d.parseHexSlice(s, 8, 4), o = d.parseHexSlice(s, 12, 4);
772
- d.writeUInt32LE(r, 0, i), d.writeUInt16LE(r, 4, n), d.writeUInt16LE(r, 6, o);
771
+ const s = new Uint8Array(16), i = d.parseHexSlice(r, 0, 8), n = d.parseHexSlice(r, 8, 4), o = d.parseHexSlice(r, 12, 4);
772
+ d.writeUInt32LE(s, 0, i), d.writeUInt16LE(s, 4, n), d.writeUInt16LE(s, 6, o);
773
773
  for (let a = 0; a < 8; a++)
774
- r[8 + a] = d.parseHexSlice(s, 16 + a * 2, 2);
775
- return new d(r);
774
+ s[8 + a] = d.parseHexSlice(r, 16 + a * 2, 2);
775
+ return new d(s);
776
776
  }
777
777
  static fromBytes(t) {
778
778
  if (t.length !== 16)
@@ -783,12 +783,12 @@ class d {
783
783
  return new d(new Uint8Array(16));
784
784
  }
785
785
  static createRandom() {
786
- const t = new Uint8Array(16), s = globalThis.crypto;
787
- if (s?.getRandomValues)
788
- s.getRandomValues(t);
786
+ const t = new Uint8Array(16), r = globalThis.crypto;
787
+ if (r?.getRandomValues)
788
+ r.getRandomValues(t);
789
789
  else
790
- for (let r = 0; r < t.length; r++)
791
- t[r] = Math.floor(Math.random() * 256);
790
+ for (let s = 0; s < t.length; s++)
791
+ t[s] = Math.floor(Math.random() * 256);
792
792
  return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, new d(t);
793
793
  }
794
794
  toString() {
@@ -804,28 +804,28 @@ class d {
804
804
  asBytes() {
805
805
  return this.bytes.slice();
806
806
  }
807
- static parseHexSlice(t, s, r) {
808
- const i = t.substr(s, r), n = Number.parseInt(i, 16);
807
+ static parseHexSlice(t, r, s) {
808
+ const i = t.substr(r, s), n = Number.parseInt(i, 16);
809
809
  if (Number.isNaN(n))
810
810
  throw new Error("Guid string contains invalid characters");
811
811
  return n >>> 0;
812
812
  }
813
- static writeUInt32LE(t, s, r) {
814
- const i = r >>> 0;
815
- t[s] = i & 255, t[s + 1] = i >>> 8 & 255, t[s + 2] = i >>> 16 & 255, t[s + 3] = i >>> 24 & 255;
813
+ static writeUInt32LE(t, r, s) {
814
+ const i = s >>> 0;
815
+ t[r] = i & 255, t[r + 1] = i >>> 8 & 255, t[r + 2] = i >>> 16 & 255, t[r + 3] = i >>> 24 & 255;
816
816
  }
817
- static writeUInt16LE(t, s, r) {
818
- const i = r & 65535;
819
- t[s] = i & 255, t[s + 1] = i >>> 8 & 255;
817
+ static writeUInt16LE(t, r, s) {
818
+ const i = s & 65535;
819
+ t[r] = i & 255, t[r + 1] = i >>> 8 & 255;
820
820
  }
821
- static readUInt32LE(t, s) {
822
- return (t[s] | t[s + 1] << 8 | t[s + 2] << 16 | t[s + 3] << 24) >>> 0;
821
+ static readUInt32LE(t, r) {
822
+ return (t[r] | t[r + 1] << 8 | t[r + 2] << 16 | t[r + 3] << 24) >>> 0;
823
823
  }
824
- static readUInt16LE(t, s) {
825
- return (t[s] | t[s + 1] << 8) & 65535;
824
+ static readUInt16LE(t, r) {
825
+ return (t[r] | t[r + 1] << 8) & 65535;
826
826
  }
827
- static toHex(t, s) {
828
- return (t >>> 0).toString(16).padStart(s, "0");
827
+ static toHex(t, r) {
828
+ return (t >>> 0).toString(16).padStart(r, "0");
829
829
  }
830
830
  }
831
831
  class p {
@@ -837,13 +837,13 @@ class p {
837
837
  this.buffer = new Uint8Array(p.INITIAL_CAPACITY), this.dataView = new DataView(this.buffer.buffer);
838
838
  }
839
839
  ensureCapacity(t) {
840
- const s = this.length + t;
841
- if (s <= this.buffer.length)
840
+ const r = this.length + t;
841
+ if (r <= this.buffer.length)
842
842
  return;
843
- let r = this.buffer.length;
844
- for (; r < s; )
845
- r *= 2;
846
- const i = new Uint8Array(r);
843
+ let s = this.buffer.length;
844
+ for (; s < r; )
845
+ s *= 2;
846
+ const i = new Uint8Array(s);
847
847
  i.set(this.buffer.subarray(0, this.length)), this.buffer = i, this.dataView = new DataView(this.buffer.buffer);
848
848
  }
849
849
  writeByte(t) {
@@ -871,30 +871,30 @@ class p {
871
871
  this.ensureCapacity(8), this.dataView.setBigUint64(this.length, t, !0), this.length += 8;
872
872
  }
873
873
  writeVarUInt(t) {
874
- let s = t >>> 0;
875
- for (; s >= 128; )
876
- this.ensureCapacity(1), this.buffer[this.length++] = s & 127 | 128, s >>>= 7;
877
- this.ensureCapacity(1), this.buffer[this.length++] = s & 127;
874
+ let r = t >>> 0;
875
+ for (; r >= 128; )
876
+ this.ensureCapacity(1), this.buffer[this.length++] = r & 127 | 128, r >>>= 7;
877
+ this.ensureCapacity(1), this.buffer[this.length++] = r & 127;
878
878
  }
879
879
  toUint8Array() {
880
880
  return this.buffer.slice(0, this.length);
881
881
  }
882
882
  }
883
- function U(e, t, s) {
883
+ function U(e, t, r) {
884
884
  if (t.offset >= e.length)
885
- throw new Error(s);
886
- let r = 0, i = 0, n = 0;
885
+ throw new Error(r);
886
+ let s = 0, i = 0, n = 0;
887
887
  for (; t.offset < e.length; ) {
888
888
  const o = e[t.offset++];
889
- if (n++, r |= (o & 127) << i, (o & 128) === 0) {
890
- if (n !== ae(r))
889
+ if (n++, s |= (o & 127) << i, (o & 128) === 0) {
890
+ if (n !== ae(s))
891
891
  throw new Error("Teleport VarUInt is not canonical");
892
- return r >>> 0;
892
+ return s >>> 0;
893
893
  }
894
894
  if (i += 7, i >= 35)
895
895
  throw new Error("Teleport VarUInt exceeds 32-bit range");
896
896
  }
897
- throw new Error(s);
897
+ throw new Error(r);
898
898
  }
899
899
  function ae(e) {
900
900
  return e < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5;
@@ -931,60 +931,60 @@ function et(e) {
931
931
  if (e === 9 || e === 11 || e === 10 || e === 1)
932
932
  throw new Error("Dictionary keys must be primitive Teleport types");
933
933
  }
934
- function N(e, t, s) {
935
- if (t < 0 || s < 0 || t + s > e.length)
934
+ function N(e, t, r) {
935
+ if (t < 0 || r < 0 || t + r > e.length)
936
936
  throw new Error("Teleport payload exceeds bounds");
937
937
  }
938
938
  function Ie(e, t) {
939
939
  return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0;
940
940
  }
941
- function st(e, t) {
941
+ function rt(e, t) {
942
942
  if (t >= e.length)
943
943
  throw new Error("Array payload exceeds bounds");
944
- const s = e[t], r = s >> 4 & 15;
945
- if ((s & 15) !== 0)
944
+ const r = e[t], s = r >> 4 & 15;
945
+ if ((r & 15) !== 0)
946
946
  throw new Error("Array flags must be zero");
947
- const i = { offset: t + 1 }, n = U(e, i, "ArrayMalformed"), o = F(r);
947
+ const i = { offset: t + 1 }, n = U(e, i, "ArrayMalformed"), o = F(s);
948
948
  if (o >= 0) {
949
949
  const l = o * n;
950
950
  return N(e, i.offset, l), i.offset + l - t;
951
951
  }
952
952
  let a = i.offset;
953
953
  for (let l = 0; l < n; l++)
954
- a = X(r, e, a, "ArrayMalformed");
954
+ a = X(s, e, a, "ArrayMalformed");
955
955
  return a - t;
956
956
  }
957
- function rt(e, t) {
957
+ function st(e, t) {
958
958
  if (t + 2 > e.length)
959
959
  throw new Error("Dictionary payload too short");
960
- const s = e[t] >> 4 & 15, r = e[t + 1] >> 4 & 15;
960
+ const r = e[t] >> 4 & 15, s = e[t + 1] >> 4 & 15;
961
961
  if ((e[t] & 15) !== 0 || (e[t + 1] & 15) !== 0)
962
962
  throw new Error("Dictionary key/value flags must be zero");
963
- et(s);
963
+ et(r);
964
964
  const i = { offset: t + 2 }, n = U(e, i, "DictMalformed");
965
965
  let o = i.offset;
966
966
  for (let a = 0; a < n; a++)
967
- o = X(s, e, o, "DictMalformed"), o = X(r, e, o, "DictMalformed");
967
+ o = X(r, e, o, "DictMalformed"), o = X(s, e, o, "DictMalformed");
968
968
  return o - t;
969
969
  }
970
- function X(e, t, s, r) {
970
+ function X(e, t, r, s) {
971
971
  const i = F(e);
972
972
  if (i >= 0)
973
- return N(t, s, i), s + i;
973
+ return N(t, r, i), r + i;
974
974
  switch (e) {
975
975
  case 12:
976
976
  case 13: {
977
- const n = { offset: s }, o = U(t, n, r);
977
+ const n = { offset: r }, o = U(t, n, s);
978
978
  return N(t, n.offset, o), n.offset + o;
979
979
  }
980
980
  case 11: {
981
- const n = { offset: s }, o = U(t, n, r);
981
+ const n = { offset: r }, o = U(t, n, s);
982
982
  return N(t, n.offset, o), n.offset + o;
983
983
  }
984
984
  case 9:
985
- return s + st(t, s);
985
+ return r + rt(t, r);
986
986
  case 10:
987
- return s + rt(t, s);
987
+ return r + st(t, r);
988
988
  default:
989
989
  throw new Error(`Unsupported Teleport type ${C[e]}`);
990
990
  }
@@ -1005,63 +1005,63 @@ function Nt(e) {
1005
1005
  return e.StreamId = "", e.Description = "", e.SourceType = "", e.Codec = ht.Unknown, e.CodecDetails = "", e.SampleRate = 0, e.Channels = 0, e.ShapeSets = void 0, e;
1006
1006
  }
1007
1007
  function ye(e, t) {
1008
- const s = t ?? At();
1009
- return Nt(s), Se(e, s), s;
1008
+ const r = t ?? At();
1009
+ return Nt(r), Se(e, r), r;
1010
1010
  }
1011
1011
  function Se(e, t) {
1012
- let s;
1013
- for (; (s = e.next()) !== null; )
1014
- switch (s.fieldId) {
1012
+ let r;
1013
+ for (; (r = e.next()) !== null; )
1014
+ switch (r.fieldId) {
1015
1015
  case he: {
1016
- if (s.isNull) throw new Error();
1017
- t.StreamId = s.asString();
1016
+ if (r.isNull) throw new Error();
1017
+ t.StreamId = r.asString();
1018
1018
  break;
1019
1019
  }
1020
1020
  case ce: {
1021
- if (s.isNull) {
1021
+ if (r.isNull) {
1022
1022
  t.ShapeSets = void 0;
1023
1023
  break;
1024
1024
  }
1025
- t.ShapeSets = Ae(s.asArray());
1025
+ t.ShapeSets = Ae(r.asArray());
1026
1026
  break;
1027
1027
  }
1028
1028
  case Ee: {
1029
- if (s.isNull) throw new Error();
1030
- t.Description = s.asString();
1029
+ if (r.isNull) throw new Error();
1030
+ t.Description = r.asString();
1031
1031
  break;
1032
1032
  }
1033
1033
  case ue: {
1034
- if (s.isNull) throw new Error();
1035
- t.Channels = s.asInt32();
1034
+ if (r.isNull) throw new Error();
1035
+ t.Channels = r.asInt32();
1036
1036
  break;
1037
1037
  }
1038
1038
  case _e: {
1039
- if (s.isNull) throw new Error();
1040
- t.CodecDetails = s.asString();
1039
+ if (r.isNull) throw new Error();
1040
+ t.CodecDetails = r.asString();
1041
1041
  break;
1042
1042
  }
1043
1043
  case fe: {
1044
- if (s.isNull) throw new Error();
1045
- t.SourceType = s.asString();
1044
+ if (r.isNull) throw new Error();
1045
+ t.SourceType = r.asString();
1046
1046
  break;
1047
1047
  }
1048
1048
  case de: {
1049
- if (s.isNull) throw new Error();
1050
- t.Codec = s.asInt32();
1049
+ if (r.isNull) throw new Error();
1050
+ t.Codec = r.asInt32();
1051
1051
  break;
1052
1052
  }
1053
1053
  case Te: {
1054
- if (s.isNull) throw new Error();
1055
- t.SampleRate = s.asInt32();
1054
+ if (r.isNull) throw new Error();
1055
+ t.SampleRate = r.asInt32();
1056
1056
  break;
1057
1057
  }
1058
1058
  }
1059
1059
  }
1060
1060
  function Ae(e) {
1061
1061
  const t = [];
1062
- let s;
1063
- for (; (s = e.next()) !== null; )
1064
- t.push(De(s.asObject()));
1062
+ let r;
1063
+ for (; (r = e.next()) !== null; )
1064
+ t.push(De(r.asObject()));
1065
1065
  return t;
1066
1066
  }
1067
1067
  const Ne = 1107713536, we = 1154362099, Ue = 1185721362;
@@ -1073,365 +1073,370 @@ function wt(e) {
1073
1073
  return e.SetId = 0, e.Name = "", e.ShapeNames = [], e;
1074
1074
  }
1075
1075
  function De(e, t) {
1076
- const s = t ?? Ce();
1077
- return wt(s), Re(e, s), s;
1076
+ const r = t ?? Ce();
1077
+ return wt(r), Re(e, r), r;
1078
1078
  }
1079
1079
  function Re(e, t) {
1080
- let s;
1081
- for (; (s = e.next()) !== null; )
1082
- switch (s.fieldId) {
1080
+ let r;
1081
+ for (; (r = e.next()) !== null; )
1082
+ switch (r.fieldId) {
1083
1083
  case Ne: {
1084
- if (s.isNull) throw new Error();
1085
- t.Name = s.asString();
1084
+ if (r.isNull) throw new Error();
1085
+ t.Name = r.asString();
1086
1086
  break;
1087
1087
  }
1088
1088
  case we: {
1089
- if (s.isNull) throw new Error();
1090
- t.SetId = s.asUInt32();
1089
+ if (r.isNull) throw new Error();
1090
+ t.SetId = r.asUInt32();
1091
1091
  break;
1092
1092
  }
1093
1093
  case Ue: {
1094
- if (s.isNull) throw new Error();
1095
- t.ShapeNames = me(s.asArray());
1094
+ if (r.isNull) throw new Error();
1095
+ t.ShapeNames = me(r.asArray());
1096
1096
  break;
1097
1097
  }
1098
1098
  }
1099
1099
  }
1100
1100
  function me(e) {
1101
1101
  const t = [];
1102
- let s;
1103
- for (; (s = e.next()) !== null; )
1104
- t.push(s.asString());
1102
+ let r;
1103
+ for (; (r = e.next()) !== null; )
1104
+ t.push(r.asString());
1105
1105
  return t;
1106
1106
  }
1107
- const Le = 76337612, ge = 185396121, Oe = 250031587, pe = 388632637, be = 417197284, Pe = 469070965, Fe = 470595159, ke = 781727218, Ve = 834078886, ve = 1043273762, Me = 1236999138, Be = 1286979607, Ge = 1368629611, xe = 1715899485, He = 1942830531, We = 1999510636, Ke = 2033288346, Ye = 2079864626, $e = 2142346422, je = 2232517119, Xe = 2598291686, ze = 2719718823, Je = 2810953526, qe = 2840065720, Qe = 2885165957, Ze = 3542818975, ts = 3586157513, es = 3717933110, ss = 4062655306;
1108
- function rs(e) {
1107
+ const Le = 76337612, ge = 185396121, Oe = 227309410, pe = 250031587, be = 388632637, Pe = 417197284, Fe = 469070965, ke = 470595159, Ve = 781727218, ve = 834078886, Me = 1043273762, Be = 1236999138, Ge = 1286979607, xe = 1368629611, He = 1715899485, We = 1942830531, Ke = 1999510636, Ye = 2033288346, $e = 2079864626, je = 2142346422, Xe = 2232517119, ze = 2598291686, Je = 2719718823, qe = 2810953526, Qe = 2840065720, Ze = 2885165957, tr = 3542818975, er = 3586157513, rr = 3717933110, sr = 4062655306;
1108
+ function ir(e) {
1109
1109
  const t = {};
1110
1110
  return Ut(t), t;
1111
1111
  }
1112
1112
  function Ut(e) {
1113
- return e.ContextType = Et.Unknown, e.UserType = ft.Unknown, e.PayloadType = ut.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.ViewportWidth = 0, e.ViewportHeight = 0, e.Theme = "", e.Timezone = "", e.IsTouchDevice = !1, e;
1113
+ return e.ContextType = Et.Unknown, e.UserType = ft.Unknown, e.PayloadType = ut.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.ViewportWidth = 0, e.ViewportHeight = 0, e.Theme = "", e.Timezone = "", e.IsTouchDevice = !1, e.InitialUrl = "", e;
1114
1114
  }
1115
- function is(e, t) {
1116
- const s = t ?? rs();
1117
- return Ut(s), ns(e, s), s;
1115
+ function nr(e, t) {
1116
+ const r = t ?? ir();
1117
+ return Ut(r), or(e, r), r;
1118
1118
  }
1119
- function ns(e, t) {
1120
- let s;
1121
- for (; (s = e.next()) !== null; )
1122
- switch (s.fieldId) {
1119
+ function or(e, t) {
1120
+ let r;
1121
+ for (; (r = e.next()) !== null; )
1122
+ switch (r.fieldId) {
1123
1123
  case Le: {
1124
- if (s.isNull) throw new Error();
1125
- t.DeviceId = s.asString();
1124
+ if (r.isNull) throw new Error();
1125
+ t.DeviceId = r.asString();
1126
1126
  break;
1127
1127
  }
1128
1128
  case ge: {
1129
- if (s.isNull) throw new Error();
1130
- t.InstallId = s.asString();
1129
+ if (r.isNull) throw new Error();
1130
+ t.InstallId = r.asString();
1131
1131
  break;
1132
1132
  }
1133
1133
  case Oe: {
1134
- if (s.isNull) throw new Error();
1135
- t.Theme = s.asString();
1134
+ if (r.isNull) throw new Error();
1135
+ t.InitialUrl = r.asString();
1136
1136
  break;
1137
1137
  }
1138
1138
  case pe: {
1139
- if (s.isNull) throw new Error();
1140
- t.UserAgent = s.asString();
1139
+ if (r.isNull) throw new Error();
1140
+ t.Theme = r.asString();
1141
1141
  break;
1142
1142
  }
1143
1143
  case be: {
1144
- if (s.isNull) throw new Error();
1145
- t.ContextType = s.asInt32();
1144
+ if (r.isNull) throw new Error();
1145
+ t.UserAgent = r.asString();
1146
1146
  break;
1147
1147
  }
1148
1148
  case Pe: {
1149
- if (s.isNull) throw new Error();
1150
- t.HasInput = s.asBool();
1149
+ if (r.isNull) throw new Error();
1150
+ t.ContextType = r.asInt32();
1151
1151
  break;
1152
1152
  }
1153
1153
  case Fe: {
1154
- if (s.isNull) throw new Error();
1155
- t.UserType = s.asInt32();
1154
+ if (r.isNull) throw new Error();
1155
+ t.HasInput = r.asBool();
1156
1156
  break;
1157
1157
  }
1158
1158
  case ke: {
1159
- if (s.isNull) throw new Error();
1160
- t.UserId = s.asString();
1159
+ if (r.isNull) throw new Error();
1160
+ t.UserType = r.asInt32();
1161
1161
  break;
1162
1162
  }
1163
1163
  case Ve: {
1164
- if (s.isNull) throw new Error();
1165
- t.ProductId = s.asString();
1164
+ if (r.isNull) throw new Error();
1165
+ t.UserId = r.asString();
1166
1166
  break;
1167
1167
  }
1168
1168
  case ve: {
1169
- if (s.isNull) throw new Error();
1170
- t.AuthSessionId = s.asString();
1169
+ if (r.isNull) throw new Error();
1170
+ t.ProductId = r.asString();
1171
1171
  break;
1172
1172
  }
1173
1173
  case Me: {
1174
- if (s.isNull) throw new Error();
1175
- t.ReceiveAllMessages = s.asBool();
1174
+ if (r.isNull) throw new Error();
1175
+ t.AuthSessionId = r.asString();
1176
1176
  break;
1177
1177
  }
1178
1178
  case Be: {
1179
- if (s.isNull) throw new Error();
1180
- t.ViewportHeight = s.asInt32();
1179
+ if (r.isNull) throw new Error();
1180
+ t.ReceiveAllMessages = r.asBool();
1181
1181
  break;
1182
1182
  }
1183
1183
  case Ge: {
1184
- if (s.isNull) throw new Error();
1185
- t.Description = s.asString();
1184
+ if (r.isNull) throw new Error();
1185
+ t.ViewportHeight = r.asInt32();
1186
1186
  break;
1187
1187
  }
1188
1188
  case xe: {
1189
- if (s.isNull) throw new Error();
1190
- t.Locale = s.asString();
1189
+ if (r.isNull) throw new Error();
1190
+ t.Description = r.asString();
1191
1191
  break;
1192
1192
  }
1193
1193
  case He: {
1194
- if (s.isNull) throw new Error();
1195
- t.SdkType = s.asInt32();
1194
+ if (r.isNull) throw new Error();
1195
+ t.Locale = r.asString();
1196
1196
  break;
1197
1197
  }
1198
1198
  case We: {
1199
- if (s.isNull) throw new Error();
1200
- t.SessionId = s.asInt32();
1199
+ if (r.isNull) throw new Error();
1200
+ t.SdkType = r.asInt32();
1201
1201
  break;
1202
1202
  }
1203
1203
  case Ke: {
1204
- if (s.isNull) throw new Error();
1205
- t.ViewportWidth = s.asInt32();
1204
+ if (r.isNull) throw new Error();
1205
+ t.SessionId = r.asInt32();
1206
1206
  break;
1207
1207
  }
1208
1208
  case Ye: {
1209
- if (s.isNull) throw new Error();
1210
- t.PreciseJoinedAt = s.asUInt64();
1209
+ if (r.isNull) throw new Error();
1210
+ t.ViewportWidth = r.asInt32();
1211
1211
  break;
1212
1212
  }
1213
1213
  case $e: {
1214
- if (s.isNull) throw new Error();
1215
- t.PayloadType = s.asInt32();
1214
+ if (r.isNull) throw new Error();
1215
+ t.PreciseJoinedAt = r.asUInt64();
1216
1216
  break;
1217
1217
  }
1218
1218
  case je: {
1219
- if (s.isNull) throw new Error();
1220
- t.IsTouchDevice = s.asBool();
1219
+ if (r.isNull) throw new Error();
1220
+ t.PayloadType = r.asInt32();
1221
1221
  break;
1222
1222
  }
1223
1223
  case Xe: {
1224
- if (s.isNull) throw new Error();
1225
- t.VersionId = s.asString();
1224
+ if (r.isNull) throw new Error();
1225
+ t.IsTouchDevice = r.asBool();
1226
1226
  break;
1227
1227
  }
1228
1228
  case ze: {
1229
- if (s.isNull) throw new Error();
1230
- t.UniqueSessionId = s.asString();
1229
+ if (r.isNull) throw new Error();
1230
+ t.VersionId = r.asString();
1231
1231
  break;
1232
1232
  }
1233
1233
  case Je: {
1234
- if (s.isNull) throw new Error();
1235
- t.ClientType = s.asInt32();
1234
+ if (r.isNull) throw new Error();
1235
+ t.UniqueSessionId = r.asString();
1236
1236
  break;
1237
1237
  }
1238
1238
  case qe: {
1239
- if (s.isNull) throw new Error();
1240
- t.IsReady = s.asBool();
1239
+ if (r.isNull) throw new Error();
1240
+ t.ClientType = r.asInt32();
1241
1241
  break;
1242
1242
  }
1243
1243
  case Qe: {
1244
- if (s.isNull) throw new Error();
1245
- t.Parameters = os(s.asDictionary());
1244
+ if (r.isNull) throw new Error();
1245
+ t.IsReady = r.asBool();
1246
1246
  break;
1247
1247
  }
1248
1248
  case Ze: {
1249
- if (s.isNull) throw new Error();
1250
- t.Timezone = s.asString();
1249
+ if (r.isNull) throw new Error();
1250
+ t.Parameters = ar(r.asDictionary());
1251
1251
  break;
1252
1252
  }
1253
- case ts: {
1254
- if (s.isNull) throw new Error();
1255
- t.IsInternal = s.asBool();
1253
+ case tr: {
1254
+ if (r.isNull) throw new Error();
1255
+ t.Timezone = r.asString();
1256
1256
  break;
1257
1257
  }
1258
- case es: {
1259
- if (s.isNull) throw new Error();
1260
- t.ChannelLocale = s.asString();
1258
+ case er: {
1259
+ if (r.isNull) throw new Error();
1260
+ t.IsInternal = r.asBool();
1261
1261
  break;
1262
1262
  }
1263
- case ss: {
1264
- if (s.isNull) throw new Error();
1265
- t.EmbeddedSpaceId = s.asString();
1263
+ case rr: {
1264
+ if (r.isNull) throw new Error();
1265
+ t.ChannelLocale = r.asString();
1266
+ break;
1267
+ }
1268
+ case sr: {
1269
+ if (r.isNull) throw new Error();
1270
+ t.EmbeddedSpaceId = r.asString();
1266
1271
  break;
1267
1272
  }
1268
1273
  }
1269
1274
  }
1270
- function os(e) {
1275
+ function ar(e) {
1271
1276
  const t = /* @__PURE__ */ Object.create(null);
1272
- let s;
1273
- for (; (s = e.next()) !== null; ) {
1274
- const r = s.key.asString();
1275
- t[r] = s.value.asString();
1277
+ let r;
1278
+ for (; (r = e.next()) !== null; ) {
1279
+ const s = r.key.asString();
1280
+ t[s] = r.value.asString();
1276
1281
  }
1277
1282
  return t;
1278
1283
  }
1279
- const as = 703025676, ls = 814454131, Is = 972460562, hs = 976255570, cs = 1368629611, Es = 1479280922, us = 1533537016, _s = 1909301063, fs = 2274386296, ds = 2603556958, Ts = 2885165957, ys = 3568439632;
1280
- function Ss(e) {
1284
+ const lr = 703025676, Ir = 814454131, hr = 972460562, cr = 976255570, Er = 1368629611, ur = 1479280922, _r = 1533537016, fr = 1909301063, dr = 2274386296, Tr = 2603556958, yr = 2885165957, Sr = 3568439632;
1285
+ function Ar(e) {
1281
1286
  const t = {};
1282
1287
  return Ct(t), t;
1283
1288
  }
1284
1289
  function Ct(e) {
1285
1290
  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.Versions = [], e;
1286
1291
  }
1287
- function As(e, t) {
1288
- const s = t ?? Ss();
1289
- return Ct(s), Ns(e, s), s;
1292
+ function Nr(e, t) {
1293
+ const r = t ?? Ar();
1294
+ return Ct(r), wr(e, r), r;
1290
1295
  }
1291
- function Ns(e, t) {
1292
- let s;
1293
- for (; (s = e.next()) !== null; )
1294
- switch (s.fieldId) {
1295
- case as: {
1296
- if (s.isNull) throw new Error();
1297
- t.ResultTypeName = s.asString();
1296
+ function wr(e, t) {
1297
+ let r;
1298
+ for (; (r = e.next()) !== null; )
1299
+ switch (r.fieldId) {
1300
+ case lr: {
1301
+ if (r.isNull) throw new Error();
1302
+ t.ResultTypeName = r.asString();
1298
1303
  break;
1299
1304
  }
1300
- case ls: {
1301
- if (s.isNull) throw new Error();
1302
- t.FunctionName = s.asString();
1305
+ case Ir: {
1306
+ if (r.isNull) throw new Error();
1307
+ t.FunctionName = r.asString();
1303
1308
  break;
1304
1309
  }
1305
- case Is: {
1306
- if (s.isNull) throw new Error();
1307
- t.EnumerableItemTypeName = s.asString();
1310
+ case hr: {
1311
+ if (r.isNull) throw new Error();
1312
+ t.EnumerableItemTypeName = r.asString();
1308
1313
  break;
1309
1314
  }
1310
- case hs: {
1311
- if (s.isNull) throw new Error();
1312
- t.FunctionId = s.asGuid();
1315
+ case cr: {
1316
+ if (r.isNull) throw new Error();
1317
+ t.FunctionId = r.asGuid();
1313
1318
  break;
1314
1319
  }
1315
- case cs: {
1316
- if (s.isNull) throw new Error();
1317
- t.Description = s.asString();
1320
+ case Er: {
1321
+ if (r.isNull) throw new Error();
1322
+ t.Description = r.asString();
1318
1323
  break;
1319
1324
  }
1320
- case Es: {
1321
- if (s.isNull) throw new Error();
1322
- t.IsCancellable = s.asBool();
1325
+ case ur: {
1326
+ if (r.isNull) throw new Error();
1327
+ t.IsCancellable = r.asBool();
1323
1328
  break;
1324
1329
  }
1325
- case us: {
1326
- if (s.isNull) throw new Error();
1327
- t.RequiresInstance = s.asBool();
1330
+ case _r: {
1331
+ if (r.isNull) throw new Error();
1332
+ t.RequiresInstance = r.asBool();
1328
1333
  break;
1329
1334
  }
1330
- case _s: {
1331
- if (s.isNull) throw new Error();
1332
- t.Versions = ws(s.asArray());
1335
+ case fr: {
1336
+ if (r.isNull) throw new Error();
1337
+ t.Versions = Ur(r.asArray());
1333
1338
  break;
1334
1339
  }
1335
- case fs: {
1336
- if (s.isNull) throw new Error();
1337
- t.LlmInlineResult = s.asBool();
1340
+ case dr: {
1341
+ if (r.isNull) throw new Error();
1342
+ t.LlmInlineResult = r.asBool();
1338
1343
  break;
1339
1344
  }
1340
- case ds: {
1341
- if (s.isNull) throw new Error();
1342
- t.IsEnumerable = s.asBool();
1345
+ case Tr: {
1346
+ if (r.isNull) throw new Error();
1347
+ t.IsEnumerable = r.asBool();
1343
1348
  break;
1344
1349
  }
1345
- case Ts: {
1346
- if (s.isNull) throw new Error();
1347
- t.Parameters = Us(s.asArray());
1350
+ case yr: {
1351
+ if (r.isNull) throw new Error();
1352
+ t.Parameters = Cr(r.asArray());
1348
1353
  break;
1349
1354
  }
1350
- case ys: {
1351
- if (s.isNull) throw new Error();
1352
- t.LlmCallOnlyOnce = s.asBool();
1355
+ case Sr: {
1356
+ if (r.isNull) throw new Error();
1357
+ t.LlmCallOnlyOnce = r.asBool();
1353
1358
  break;
1354
1359
  }
1355
1360
  }
1356
1361
  }
1357
- function ws(e) {
1362
+ function Ur(e) {
1358
1363
  const t = [];
1359
- let s;
1360
- for (; (s = e.next()) !== null; )
1361
- t.push(s.asString());
1364
+ let r;
1365
+ for (; (r = e.next()) !== null; )
1366
+ t.push(r.asString());
1362
1367
  return t;
1363
1368
  }
1364
- function Us(e) {
1369
+ function Cr(e) {
1365
1370
  const t = [];
1366
- let s;
1367
- for (; (s = e.next()) !== null; )
1368
- t.push(Fs(s.asObject()));
1371
+ let r;
1372
+ for (; (r = e.next()) !== null; )
1373
+ t.push(kr(r.asObject()));
1369
1374
  return t;
1370
1375
  }
1371
- const Cs = 607861992, Ds = 894485888, Rs = 972460562, ms = 1368629611, Ls = 1883521406, gs = 2603556958, Os = 3609695522, ps = 4075263697, bs = 4257460908;
1372
- function Ps(e) {
1376
+ const Dr = 607861992, Rr = 894485888, mr = 972460562, Lr = 1368629611, gr = 1883521406, Or = 2603556958, pr = 3609695522, br = 4075263697, Pr = 4257460908;
1377
+ function Fr(e) {
1373
1378
  const t = {};
1374
1379
  return Dt(t), t;
1375
1380
  }
1376
1381
  function Dt(e) {
1377
1382
  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;
1378
1383
  }
1379
- function Fs(e, t) {
1380
- const s = t ?? Ps();
1381
- return Dt(s), ks(e, s), s;
1384
+ function kr(e, t) {
1385
+ const r = t ?? Fr();
1386
+ return Dt(r), Vr(e, r), r;
1382
1387
  }
1383
- function ks(e, t) {
1384
- let s;
1385
- for (; (s = e.next()) !== null; )
1386
- switch (s.fieldId) {
1387
- case Cs: {
1388
- if (s.isNull) throw new Error();
1389
- t.HasDefaultValue = s.asBool();
1388
+ function Vr(e, t) {
1389
+ let r;
1390
+ for (; (r = e.next()) !== null; )
1391
+ switch (r.fieldId) {
1392
+ case Dr: {
1393
+ if (r.isNull) throw new Error();
1394
+ t.HasDefaultValue = r.asBool();
1390
1395
  break;
1391
1396
  }
1392
- case Ds: {
1393
- if (s.isNull) throw new Error();
1394
- t.DefaultValueJson = s.asString();
1397
+ case Rr: {
1398
+ if (r.isNull) throw new Error();
1399
+ t.DefaultValueJson = r.asString();
1395
1400
  break;
1396
1401
  }
1397
- case Rs: {
1398
- if (s.isNull) throw new Error();
1399
- t.EnumerableItemTypeName = s.asString();
1402
+ case mr: {
1403
+ if (r.isNull) throw new Error();
1404
+ t.EnumerableItemTypeName = r.asString();
1400
1405
  break;
1401
1406
  }
1402
- case ms: {
1403
- if (s.isNull) throw new Error();
1404
- t.Description = s.asString();
1407
+ case Lr: {
1408
+ if (r.isNull) throw new Error();
1409
+ t.Description = r.asString();
1405
1410
  break;
1406
1411
  }
1407
- case Ls: {
1408
- if (s.isNull) throw new Error();
1409
- t.DefaultValueData = s.asBinary();
1412
+ case gr: {
1413
+ if (r.isNull) throw new Error();
1414
+ t.DefaultValueData = r.asBinary();
1410
1415
  break;
1411
1416
  }
1412
- case gs: {
1413
- if (s.isNull) throw new Error();
1414
- t.IsEnumerable = s.asBool();
1417
+ case Or: {
1418
+ if (r.isNull) throw new Error();
1419
+ t.IsEnumerable = r.asBool();
1415
1420
  break;
1416
1421
  }
1417
- case Os: {
1418
- if (s.isNull) throw new Error();
1419
- t.TypeName = s.asString();
1422
+ case pr: {
1423
+ if (r.isNull) throw new Error();
1424
+ t.TypeName = r.asString();
1420
1425
  break;
1421
1426
  }
1422
- case ps: {
1423
- if (s.isNull) throw new Error();
1424
- t.ParameterName = s.asString();
1427
+ case br: {
1428
+ if (r.isNull) throw new Error();
1429
+ t.ParameterName = r.asString();
1425
1430
  break;
1426
1431
  }
1427
- case bs: {
1428
- if (s.isNull) throw new Error();
1429
- t.ParameterIndex = s.asInt32();
1432
+ case Pr: {
1433
+ if (r.isNull) throw new Error();
1434
+ t.ParameterIndex = r.asInt32();
1430
1435
  break;
1431
1436
  }
1432
1437
  }
1433
1438
  }
1434
- const Vs = 3167053791, vs = 3342364356, Ms = 3612929027;
1439
+ const vr = 3167053791, Mr = 3342364356, Br = 3612929027;
1435
1440
  function Rt(e) {
1436
1441
  const t = {};
1437
1442
  return mt(t), t;
@@ -1439,39 +1444,39 @@ function Rt(e) {
1439
1444
  function mt(e) {
1440
1445
  return e.Category = "", e.Type = _t.Face, e.FaceBlendshapes = [], e;
1441
1446
  }
1442
- function Bs(e, t) {
1443
- const s = t ?? Rt();
1444
- return mt(s), Gs(e, s), s;
1447
+ function Gr(e, t) {
1448
+ const r = t ?? Rt();
1449
+ return mt(r), xr(e, r), r;
1445
1450
  }
1446
- function Gs(e, t) {
1447
- let s;
1448
- for (; (s = e.next()) !== null; )
1449
- switch (s.fieldId) {
1450
- case Vs: {
1451
- if (s.isNull) throw new Error();
1452
- t.Type = s.asInt32();
1451
+ function xr(e, t) {
1452
+ let r;
1453
+ for (; (r = e.next()) !== null; )
1454
+ switch (r.fieldId) {
1455
+ case vr: {
1456
+ if (r.isNull) throw new Error();
1457
+ t.Type = r.asInt32();
1453
1458
  break;
1454
1459
  }
1455
- case vs: {
1456
- if (s.isNull) throw new Error();
1457
- t.FaceBlendshapes = xs(s.asArray());
1460
+ case Mr: {
1461
+ if (r.isNull) throw new Error();
1462
+ t.FaceBlendshapes = Hr(r.asArray());
1458
1463
  break;
1459
1464
  }
1460
- case Ms: {
1461
- if (s.isNull) throw new Error();
1462
- t.Category = s.asString();
1465
+ case Br: {
1466
+ if (r.isNull) throw new Error();
1467
+ t.Category = r.asString();
1463
1468
  break;
1464
1469
  }
1465
1470
  }
1466
1471
  }
1467
- function xs(e) {
1472
+ function Hr(e) {
1468
1473
  const t = [];
1469
- let s;
1470
- for (; (s = e.next()) !== null; )
1471
- t.push(s.asString());
1474
+ let r;
1475
+ for (; (r = e.next()) !== null; )
1476
+ t.push(r.asString());
1472
1477
  return t;
1473
1478
  }
1474
- const Hs = 3612929027;
1479
+ const Wr = 3612929027;
1475
1480
  function Lt(e) {
1476
1481
  const t = {};
1477
1482
  return gt(t), t;
@@ -1479,22 +1484,22 @@ function Lt(e) {
1479
1484
  function gt(e) {
1480
1485
  return e.Category = "", e;
1481
1486
  }
1482
- function Ws(e, t) {
1483
- const s = t ?? Lt();
1484
- return gt(s), Ks(e, s), s;
1487
+ function Kr(e, t) {
1488
+ const r = t ?? Lt();
1489
+ return gt(r), Yr(e, r), r;
1485
1490
  }
1486
- function Ks(e, t) {
1487
- let s;
1488
- for (; (s = e.next()) !== null; )
1489
- switch (s.fieldId) {
1490
- case Hs: {
1491
- if (s.isNull) throw new Error();
1492
- t.Category = s.asString();
1491
+ function Yr(e, t) {
1492
+ let r;
1493
+ for (; (r = e.next()) !== null; )
1494
+ switch (r.fieldId) {
1495
+ case Wr: {
1496
+ if (r.isNull) throw new Error();
1497
+ t.Category = r.asString();
1493
1498
  break;
1494
1499
  }
1495
1500
  }
1496
1501
  }
1497
- const Ys = 161083277, $s = 164808083, js = 1368629611, Xs = 2745379226, zs = 2950031986, Js = 3282782683, qs = 3284746250, Qs = 4065070594;
1502
+ const $r = 161083277, jr = 164808083, Xr = 1368629611, zr = 2745379226, Jr = 2950031986, qr = 3282782683, Qr = 3284746250, Zr = 4065070594;
1498
1503
  function Ot(e) {
1499
1504
  const t = {};
1500
1505
  return pt(t), t;
@@ -1502,701 +1507,701 @@ function Ot(e) {
1502
1507
  function pt(e) {
1503
1508
  return e.StreamId = "", e.Description = "", e.SourceType = "", e.Codec = dt.H264, e.CodecDetails = "", e.Width = 0, e.Height = 0, e.Framerate = 30, e;
1504
1509
  }
1505
- function Zs(e, t) {
1506
- const s = t ?? Ot();
1507
- return pt(s), tr(e, s), s;
1510
+ function ts(e, t) {
1511
+ const r = t ?? Ot();
1512
+ return pt(r), es(e, r), r;
1508
1513
  }
1509
- function tr(e, t) {
1510
- let s;
1511
- for (; (s = e.next()) !== null; )
1512
- switch (s.fieldId) {
1513
- case Ys: {
1514
- if (s.isNull) throw new Error();
1515
- t.StreamId = s.asString();
1514
+ function es(e, t) {
1515
+ let r;
1516
+ for (; (r = e.next()) !== null; )
1517
+ switch (r.fieldId) {
1518
+ case $r: {
1519
+ if (r.isNull) throw new Error();
1520
+ t.StreamId = r.asString();
1516
1521
  break;
1517
1522
  }
1518
- case $s: {
1519
- if (s.isNull) throw new Error();
1520
- t.Framerate = s.asFloat64();
1523
+ case jr: {
1524
+ if (r.isNull) throw new Error();
1525
+ t.Framerate = r.asFloat64();
1521
1526
  break;
1522
1527
  }
1523
- case js: {
1524
- if (s.isNull) throw new Error();
1525
- t.Description = s.asString();
1528
+ case Xr: {
1529
+ if (r.isNull) throw new Error();
1530
+ t.Description = r.asString();
1526
1531
  break;
1527
1532
  }
1528
- case Xs: {
1529
- if (s.isNull) throw new Error();
1530
- t.CodecDetails = s.asString();
1533
+ case zr: {
1534
+ if (r.isNull) throw new Error();
1535
+ t.CodecDetails = r.asString();
1531
1536
  break;
1532
1537
  }
1533
- case zs: {
1534
- if (s.isNull) throw new Error();
1535
- t.Height = s.asInt32();
1538
+ case Jr: {
1539
+ if (r.isNull) throw new Error();
1540
+ t.Height = r.asInt32();
1536
1541
  break;
1537
1542
  }
1538
- case Js: {
1539
- if (s.isNull) throw new Error();
1540
- t.SourceType = s.asString();
1543
+ case qr: {
1544
+ if (r.isNull) throw new Error();
1545
+ t.SourceType = r.asString();
1541
1546
  break;
1542
1547
  }
1543
- case qs: {
1544
- if (s.isNull) throw new Error();
1545
- t.Codec = s.asInt32();
1548
+ case Qr: {
1549
+ if (r.isNull) throw new Error();
1550
+ t.Codec = r.asInt32();
1546
1551
  break;
1547
1552
  }
1548
- case Qs: {
1549
- if (s.isNull) throw new Error();
1550
- t.Width = s.asInt32();
1553
+ case Zr: {
1554
+ if (r.isNull) throw new Error();
1555
+ t.Width = r.asInt32();
1551
1556
  break;
1552
1557
  }
1553
1558
  }
1554
1559
  }
1555
- const er = 65539, sr = 693643444, rr = 1144553441, ir = 1497620243, nr = 1559330978, or = 1976546434, ar = 1999510636, lr = 2271236852, Ir = 2277643855, hr = 2469008121, cr = 3042922213, Er = 3064612128, ur = 3219210453, _r = 3504054055, fr = 3678477544, dr = 3696445035, Tr = 3707543140, yr = 3712281496, Sr = 3895362455, Ar = 3897397815, Nr = 4225107827;
1556
- function wr(e) {
1560
+ const rs = 65539, ss = 693643444, is = 1144553441, ns = 1497620243, os = 1559330978, as = 1976546434, ls = 1999510636, Is = 2271236852, hs = 2277643855, cs = 2469008121, Es = 3042922213, us = 3064612128, _s = 3219210453, fs = 3504054055, ds = 3678477544, Ts = 3696445035, ys = 3707543140, Ss = 3712281496, As = 3895362455, Ns = 3897397815, ws = 4225107827;
1561
+ function Us(e) {
1557
1562
  const t = {};
1558
1563
  return bt(t), t;
1559
1564
  }
1560
1565
  function bt(e) {
1561
1566
  return e.Clients = /* @__PURE__ */ Object.create(null), e.Functions = /* @__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.ChannelId = "", e.SessionId = "", e.ChannelUrl = "", e.SessionChannelUrl = "", e.FirstUserId = "", e.PrimaryUserId = "", e.OrganisationName = "", e.SpaceName = "", e.ChannelName = "", e.ServerRunType = yt.Local, e.AppSourceType = St.Bundle, e.PublicAccess = !1, e.DebugMode = !1, e;
1562
1567
  }
1563
- function Ur(e, t) {
1564
- const s = O.create(e);
1565
- return Cr(s, t);
1568
+ function Cs(e, t) {
1569
+ const r = O.create(e);
1570
+ return Ds(r, t);
1566
1571
  }
1567
- function Cr(e, t) {
1568
- const s = t ?? wr();
1569
- return bt(s), Dr(e, s), s;
1572
+ function Ds(e, t) {
1573
+ const r = t ?? Us();
1574
+ return bt(r), Rs(e, r), r;
1570
1575
  }
1571
- function Dr(e, t) {
1572
- let s;
1573
- for (; (s = e.next()) !== null; )
1574
- switch (s.fieldId) {
1575
- case sr: {
1576
- if (s.isNull) throw new Error();
1577
- t.FirstUserId = s.asString();
1576
+ function Rs(e, t) {
1577
+ let r;
1578
+ for (; (r = e.next()) !== null; )
1579
+ switch (r.fieldId) {
1580
+ case ss: {
1581
+ if (r.isNull) throw new Error();
1582
+ t.FirstUserId = r.asString();
1578
1583
  break;
1579
1584
  }
1580
- case rr: {
1581
- if (s.isNull) throw new Error();
1582
- t.Clients = mr(s.asDictionary());
1585
+ case is: {
1586
+ if (r.isNull) throw new Error();
1587
+ t.Clients = Ls(r.asDictionary());
1583
1588
  break;
1584
1589
  }
1585
- case ir: {
1586
- if (s.isNull) throw new Error();
1587
- t.TrackingStreams = Lr(s.asDictionary());
1590
+ case ns: {
1591
+ if (r.isNull) throw new Error();
1592
+ t.TrackingStreams = gs(r.asDictionary());
1588
1593
  break;
1589
1594
  }
1590
- case nr: {
1591
- if (s.isNull) throw new Error();
1592
- t.ChannelId = s.asString();
1595
+ case os: {
1596
+ if (r.isNull) throw new Error();
1597
+ t.ChannelId = r.asString();
1593
1598
  break;
1594
1599
  }
1595
- case or: {
1596
- if (s.isNull) throw new Error();
1597
- t.AppSourceType = s.asInt32();
1600
+ case as: {
1601
+ if (r.isNull) throw new Error();
1602
+ t.AppSourceType = r.asInt32();
1598
1603
  break;
1599
1604
  }
1600
- case ar: {
1601
- if (s.isNull) throw new Error();
1602
- t.SessionId = s.asString();
1605
+ case ls: {
1606
+ if (r.isNull) throw new Error();
1607
+ t.SessionId = r.asString();
1603
1608
  break;
1604
1609
  }
1605
- case lr: {
1606
- if (s.isNull) throw new Error();
1607
- t.SessionChannelUrl = s.asString();
1610
+ case Is: {
1611
+ if (r.isNull) throw new Error();
1612
+ t.SessionChannelUrl = r.asString();
1608
1613
  break;
1609
1614
  }
1610
- case Ir: {
1611
- if (s.isNull) throw new Error();
1612
- t.ChannelUrl = s.asString();
1615
+ case hs: {
1616
+ if (r.isNull) throw new Error();
1617
+ t.ChannelUrl = r.asString();
1613
1618
  break;
1614
1619
  }
1615
- case hr: {
1616
- if (s.isNull) throw new Error();
1617
- t.ChannelName = s.asString();
1620
+ case cs: {
1621
+ if (r.isNull) throw new Error();
1622
+ t.ChannelName = r.asString();
1618
1623
  break;
1619
1624
  }
1620
- case cr: {
1621
- if (s.isNull) throw new Error();
1622
- t.PublicAccess = s.asBool();
1625
+ case Es: {
1626
+ if (r.isNull) throw new Error();
1627
+ t.PublicAccess = r.asBool();
1623
1628
  break;
1624
1629
  }
1625
- case Er: {
1626
- if (s.isNull) throw new Error();
1627
- t.ServerRunType = s.asInt32();
1630
+ case us: {
1631
+ if (r.isNull) throw new Error();
1632
+ t.ServerRunType = r.asInt32();
1628
1633
  break;
1629
1634
  }
1630
- case ur: {
1631
- if (s.isNull) throw new Error();
1632
- t.OrganisationName = s.asString();
1635
+ case _s: {
1636
+ if (r.isNull) throw new Error();
1637
+ t.OrganisationName = r.asString();
1633
1638
  break;
1634
1639
  }
1635
- case _r: {
1636
- if (s.isNull) throw new Error();
1637
- t.DebugMode = s.asBool();
1640
+ case fs: {
1641
+ if (r.isNull) throw new Error();
1642
+ t.DebugMode = r.asBool();
1638
1643
  break;
1639
1644
  }
1640
- case fr: {
1641
- if (s.isNull) throw new Error();
1642
- t.Functions = gr(s.asDictionary());
1645
+ case ds: {
1646
+ if (r.isNull) throw new Error();
1647
+ t.Functions = Os(r.asDictionary());
1643
1648
  break;
1644
1649
  }
1645
- case dr: {
1646
- if (s.isNull) throw new Error();
1647
- t.UIStreams = Or(s.asDictionary());
1650
+ case Ts: {
1651
+ if (r.isNull) throw new Error();
1652
+ t.UIStreams = ps(r.asDictionary());
1648
1653
  break;
1649
1654
  }
1650
- case Tr: {
1651
- if (s.isNull) throw new Error();
1652
- t.SpaceId = s.asString();
1655
+ case ys: {
1656
+ if (r.isNull) throw new Error();
1657
+ t.SpaceId = r.asString();
1653
1658
  break;
1654
1659
  }
1655
- case yr: {
1656
- if (s.isNull) throw new Error();
1657
- t.PrimaryUserId = s.asString();
1660
+ case Ss: {
1661
+ if (r.isNull) throw new Error();
1662
+ t.PrimaryUserId = r.asString();
1658
1663
  break;
1659
1664
  }
1660
- case Sr: {
1661
- if (s.isNull) throw new Error();
1662
- t.AudioStreams = pr(s.asDictionary());
1665
+ case As: {
1666
+ if (r.isNull) throw new Error();
1667
+ t.AudioStreams = bs(r.asDictionary());
1663
1668
  break;
1664
1669
  }
1665
- case Ar: {
1666
- if (s.isNull) throw new Error();
1667
- t.VideoStreams = br(s.asDictionary());
1670
+ case Ns: {
1671
+ if (r.isNull) throw new Error();
1672
+ t.VideoStreams = Ps(r.asDictionary());
1668
1673
  break;
1669
1674
  }
1670
- case Nr: {
1671
- if (s.isNull) throw new Error();
1672
- t.SpaceName = s.asString();
1675
+ case ws: {
1676
+ if (r.isNull) throw new Error();
1677
+ t.SpaceName = r.asString();
1673
1678
  break;
1674
1679
  }
1675
1680
  }
1676
1681
  }
1677
- async function Rr(e, t) {
1678
- const s = await M(e, er);
1679
- return Ur(s, t);
1682
+ async function ms(e, t) {
1683
+ const r = await M(e, rs);
1684
+ return Cs(r, t);
1680
1685
  }
1681
- function mr(e) {
1686
+ function Ls(e) {
1682
1687
  const t = /* @__PURE__ */ Object.create(null);
1683
- let s;
1684
- for (; (s = e.next()) !== null; ) {
1685
- const r = s.key.asInt32();
1686
- t[r] = is(s.value.asObject());
1688
+ let r;
1689
+ for (; (r = e.next()) !== null; ) {
1690
+ const s = r.key.asInt32();
1691
+ t[s] = nr(r.value.asObject());
1687
1692
  }
1688
1693
  return t;
1689
1694
  }
1690
- function Lr(e) {
1695
+ function gs(e) {
1691
1696
  const t = /* @__PURE__ */ Object.create(null);
1692
- let s;
1693
- for (; (s = e.next()) !== null; ) {
1694
- const r = s.key.asString();
1695
- t[r] = oi(s.value.asObject());
1697
+ let r;
1698
+ for (; (r = e.next()) !== null; ) {
1699
+ const s = r.key.asString();
1700
+ t[s] = ai(r.value.asObject());
1696
1701
  }
1697
1702
  return t;
1698
1703
  }
1699
- function gr(e) {
1704
+ function Os(e) {
1700
1705
  const t = /* @__PURE__ */ Object.create(null);
1701
- let s;
1702
- for (; (s = e.next()) !== null; ) {
1703
- const r = s.key.asInt32();
1704
- t[r] = Pr(s.value.asArray());
1706
+ let r;
1707
+ for (; (r = e.next()) !== null; ) {
1708
+ const s = r.key.asInt32();
1709
+ t[s] = Fs(r.value.asArray());
1705
1710
  }
1706
1711
  return t;
1707
1712
  }
1708
- function Or(e) {
1713
+ function ps(e) {
1709
1714
  const t = /* @__PURE__ */ Object.create(null);
1710
- let s;
1711
- for (; (s = e.next()) !== null; ) {
1712
- const r = s.key.asString();
1713
- t[r] = Br(s.value.asObject());
1715
+ let r;
1716
+ for (; (r = e.next()) !== null; ) {
1717
+ const s = r.key.asString();
1718
+ t[s] = Gs(r.value.asObject());
1714
1719
  }
1715
1720
  return t;
1716
1721
  }
1717
- function pr(e) {
1722
+ function bs(e) {
1718
1723
  const t = /* @__PURE__ */ Object.create(null);
1719
- let s;
1720
- for (; (s = e.next()) !== null; ) {
1721
- const r = s.key.asString();
1722
- t[r] = $r(s.value.asObject());
1724
+ let r;
1725
+ for (; (r = e.next()) !== null; ) {
1726
+ const s = r.key.asString();
1727
+ t[s] = js(r.value.asObject());
1723
1728
  }
1724
1729
  return t;
1725
1730
  }
1726
- function br(e) {
1731
+ function Ps(e) {
1727
1732
  const t = /* @__PURE__ */ Object.create(null);
1728
- let s;
1729
- for (; (s = e.next()) !== null; ) {
1730
- const r = s.key.asString();
1731
- t[r] = Zr(s.value.asObject());
1733
+ let r;
1734
+ for (; (r = e.next()) !== null; ) {
1735
+ const s = r.key.asString();
1736
+ t[s] = ti(r.value.asObject());
1732
1737
  }
1733
1738
  return t;
1734
1739
  }
1735
- function Pr(e) {
1740
+ function Fs(e) {
1736
1741
  const t = [];
1737
- let s;
1738
- for (; (s = e.next()) !== null; )
1739
- t.push(As(s.asObject()));
1742
+ let r;
1743
+ for (; (r = e.next()) !== null; )
1744
+ t.push(Nr(r.asObject()));
1740
1745
  return t;
1741
1746
  }
1742
- const Fr = 161083277, kr = 325678206, Vr = 3469892363, vr = 3645544153;
1743
- function Mr(e) {
1747
+ const ks = 161083277, Vs = 325678206, vs = 3469892363, Ms = 3645544153;
1748
+ function Bs(e) {
1744
1749
  const t = {};
1745
1750
  return Pt(t), t;
1746
1751
  }
1747
1752
  function Pt(e) {
1748
1753
  return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Lt(), e;
1749
1754
  }
1750
- function Br(e, t) {
1751
- const s = t ?? Mr();
1752
- return Pt(s), Gr(e, s), s;
1755
+ function Gs(e, t) {
1756
+ const r = t ?? Bs();
1757
+ return Pt(r), xs(e, r), r;
1753
1758
  }
1754
- function Gr(e, t) {
1755
- let s;
1756
- for (; (s = e.next()) !== null; )
1757
- switch (s.fieldId) {
1758
- case Fr: {
1759
- if (s.isNull) throw new Error();
1760
- t.StreamId = s.asString();
1759
+ function xs(e, t) {
1760
+ let r;
1761
+ for (; (r = e.next()) !== null; )
1762
+ switch (r.fieldId) {
1763
+ case ks: {
1764
+ if (r.isNull) throw new Error();
1765
+ t.StreamId = r.asString();
1761
1766
  break;
1762
1767
  }
1763
- case kr: {
1764
- if (s.isNull) throw new Error();
1765
- t.ClientSessionId = s.asInt32();
1768
+ case Vs: {
1769
+ if (r.isNull) throw new Error();
1770
+ t.ClientSessionId = r.asInt32();
1766
1771
  break;
1767
1772
  }
1768
- case Vr: {
1769
- if (s.isNull) throw new Error();
1770
- t.TrackId = s.asInt32();
1773
+ case vs: {
1774
+ if (r.isNull) throw new Error();
1775
+ t.TrackId = r.asInt32();
1771
1776
  break;
1772
1777
  }
1773
- case vr: {
1774
- if (s.isNull) throw new Error();
1775
- t.Info = Ws(s.asObject());
1778
+ case Ms: {
1779
+ if (r.isNull) throw new Error();
1780
+ t.Info = Kr(r.asObject());
1776
1781
  break;
1777
1782
  }
1778
1783
  }
1779
1784
  }
1780
- const xr = 161083277, Hr = 325678206, Wr = 3469892363, Kr = 3645544153;
1781
- function Yr(e) {
1785
+ const Hs = 161083277, Ws = 325678206, Ks = 3469892363, Ys = 3645544153;
1786
+ function $s(e) {
1782
1787
  const t = {};
1783
1788
  return Ft(t), t;
1784
1789
  }
1785
1790
  function Ft(e) {
1786
1791
  return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = At(), e;
1787
1792
  }
1788
- function $r(e, t) {
1789
- const s = t ?? Yr();
1790
- return Ft(s), jr(e, s), s;
1793
+ function js(e, t) {
1794
+ const r = t ?? $s();
1795
+ return Ft(r), Xs(e, r), r;
1791
1796
  }
1792
- function jr(e, t) {
1793
- let s;
1794
- for (; (s = e.next()) !== null; )
1795
- switch (s.fieldId) {
1796
- case xr: {
1797
- if (s.isNull) throw new Error();
1798
- t.StreamId = s.asString();
1797
+ function Xs(e, t) {
1798
+ let r;
1799
+ for (; (r = e.next()) !== null; )
1800
+ switch (r.fieldId) {
1801
+ case Hs: {
1802
+ if (r.isNull) throw new Error();
1803
+ t.StreamId = r.asString();
1799
1804
  break;
1800
1805
  }
1801
- case Hr: {
1802
- if (s.isNull) throw new Error();
1803
- t.ClientSessionId = s.asInt32();
1806
+ case Ws: {
1807
+ if (r.isNull) throw new Error();
1808
+ t.ClientSessionId = r.asInt32();
1804
1809
  break;
1805
1810
  }
1806
- case Wr: {
1807
- if (s.isNull) throw new Error();
1808
- t.TrackId = s.asInt32();
1811
+ case Ks: {
1812
+ if (r.isNull) throw new Error();
1813
+ t.TrackId = r.asInt32();
1809
1814
  break;
1810
1815
  }
1811
- case Kr: {
1812
- if (s.isNull) throw new Error();
1813
- t.Info = ye(s.asObject());
1816
+ case Ys: {
1817
+ if (r.isNull) throw new Error();
1818
+ t.Info = ye(r.asObject());
1814
1819
  break;
1815
1820
  }
1816
1821
  }
1817
1822
  }
1818
- const Xr = 161083277, zr = 325678206, Jr = 3469892363, qr = 3645544153;
1819
- function Qr(e) {
1823
+ const zs = 161083277, Js = 325678206, qs = 3469892363, Qs = 3645544153;
1824
+ function Zs(e) {
1820
1825
  const t = {};
1821
1826
  return kt(t), t;
1822
1827
  }
1823
1828
  function kt(e) {
1824
1829
  return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Ot(), e;
1825
1830
  }
1826
- function Zr(e, t) {
1827
- const s = t ?? Qr();
1828
- return kt(s), ti(e, s), s;
1829
- }
1830
1831
  function ti(e, t) {
1831
- let s;
1832
- for (; (s = e.next()) !== null; )
1833
- switch (s.fieldId) {
1834
- case Xr: {
1835
- if (s.isNull) throw new Error();
1836
- t.StreamId = s.asString();
1832
+ const r = t ?? Zs();
1833
+ return kt(r), ei(e, r), r;
1834
+ }
1835
+ function ei(e, t) {
1836
+ let r;
1837
+ for (; (r = e.next()) !== null; )
1838
+ switch (r.fieldId) {
1839
+ case zs: {
1840
+ if (r.isNull) throw new Error();
1841
+ t.StreamId = r.asString();
1837
1842
  break;
1838
1843
  }
1839
- case zr: {
1840
- if (s.isNull) throw new Error();
1841
- t.ClientSessionId = s.asInt32();
1844
+ case Js: {
1845
+ if (r.isNull) throw new Error();
1846
+ t.ClientSessionId = r.asInt32();
1842
1847
  break;
1843
1848
  }
1844
- case Jr: {
1845
- if (s.isNull) throw new Error();
1846
- t.TrackId = s.asInt32();
1849
+ case qs: {
1850
+ if (r.isNull) throw new Error();
1851
+ t.TrackId = r.asInt32();
1847
1852
  break;
1848
1853
  }
1849
- case qr: {
1850
- if (s.isNull) throw new Error();
1851
- t.Info = Zs(s.asObject());
1854
+ case Qs: {
1855
+ if (r.isNull) throw new Error();
1856
+ t.Info = ts(r.asObject());
1852
1857
  break;
1853
1858
  }
1854
1859
  }
1855
1860
  }
1856
- const ei = 161083277, si = 325678206, ri = 3469892363, ii = 3645544153;
1857
- function ni(e) {
1861
+ const ri = 161083277, si = 325678206, ii = 3469892363, ni = 3645544153;
1862
+ function oi(e) {
1858
1863
  const t = {};
1859
1864
  return Vt(t), t;
1860
1865
  }
1861
1866
  function Vt(e) {
1862
1867
  return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Rt(), e;
1863
1868
  }
1864
- function oi(e, t) {
1865
- const s = t ?? ni();
1866
- return Vt(s), ai(e, s), s;
1867
- }
1868
1869
  function ai(e, t) {
1869
- let s;
1870
- for (; (s = e.next()) !== null; )
1871
- switch (s.fieldId) {
1872
- case ei: {
1873
- if (s.isNull) throw new Error();
1874
- t.StreamId = s.asString();
1870
+ const r = t ?? oi();
1871
+ return Vt(r), li(e, r), r;
1872
+ }
1873
+ function li(e, t) {
1874
+ let r;
1875
+ for (; (r = e.next()) !== null; )
1876
+ switch (r.fieldId) {
1877
+ case ri: {
1878
+ if (r.isNull) throw new Error();
1879
+ t.StreamId = r.asString();
1875
1880
  break;
1876
1881
  }
1877
1882
  case si: {
1878
- if (s.isNull) throw new Error();
1879
- t.ClientSessionId = s.asInt32();
1883
+ if (r.isNull) throw new Error();
1884
+ t.ClientSessionId = r.asInt32();
1880
1885
  break;
1881
1886
  }
1882
- case ri: {
1883
- if (s.isNull) throw new Error();
1884
- t.TrackId = s.asInt32();
1887
+ case ii: {
1888
+ if (r.isNull) throw new Error();
1889
+ t.TrackId = r.asInt32();
1885
1890
  break;
1886
1891
  }
1887
- case ii: {
1888
- if (s.isNull) throw new Error();
1889
- t.Info = Bs(s.asObject());
1892
+ case ni: {
1893
+ if (r.isNull) throw new Error();
1894
+ t.Info = Gr(r.asObject());
1890
1895
  break;
1891
1896
  }
1892
1897
  }
1893
1898
  }
1894
- const li = 1405462580, Ii = 2968276160;
1895
- function hi(e) {
1899
+ const Ii = 1405462580, hi = 2968276160;
1900
+ function ci(e) {
1896
1901
  const t = {};
1897
1902
  return vt(t), t;
1898
1903
  }
1899
1904
  function vt(e) {
1900
1905
  return e.MimeType = "", e.Value = new Uint8Array(0), e;
1901
1906
  }
1902
- function ci(e, t) {
1903
- const s = t ?? hi();
1904
- return vt(s), Ei(e, s), s;
1905
- }
1906
1907
  function Ei(e, t) {
1907
- let s;
1908
- for (; (s = e.next()) !== null; )
1909
- switch (s.fieldId) {
1910
- case li: {
1911
- if (s.isNull) throw new Error();
1912
- t.Value = s.asBinary();
1908
+ const r = t ?? ci();
1909
+ return vt(r), ui(e, r), r;
1910
+ }
1911
+ function ui(e, t) {
1912
+ let r;
1913
+ for (; (r = e.next()) !== null; )
1914
+ switch (r.fieldId) {
1915
+ case Ii: {
1916
+ if (r.isNull) throw new Error();
1917
+ t.Value = r.asBinary();
1913
1918
  break;
1914
1919
  }
1915
- case Ii: {
1916
- if (s.isNull) throw new Error();
1917
- t.MimeType = s.asString();
1920
+ case hi: {
1921
+ if (r.isNull) throw new Error();
1922
+ t.MimeType = r.asString();
1918
1923
  break;
1919
1924
  }
1920
1925
  }
1921
1926
  }
1922
- const ui = 2097188, _i = 979822885, fi = 2374537704;
1923
- function di(e) {
1927
+ const _i = 2097188, fi = 979822885, di = 2374537704;
1928
+ function Ti(e) {
1924
1929
  const t = {};
1925
1930
  return Mt(t), t;
1926
1931
  }
1927
1932
  function Mt(e) {
1928
1933
  return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
1929
1934
  }
1930
- function Ti(e, t) {
1931
- const s = O.create(e);
1932
- return yi(s, t);
1933
- }
1934
1935
  function yi(e, t) {
1935
- const s = t ?? di();
1936
- return Mt(s), Si(e, s), s;
1936
+ const r = O.create(e);
1937
+ return Si(r, t);
1937
1938
  }
1938
1939
  function Si(e, t) {
1939
- let s;
1940
- for (; (s = e.next()) !== null; )
1941
- switch (s.fieldId) {
1942
- case _i: {
1943
- if (s.isNull) throw new Error();
1944
- t.StyleId = s.asString();
1940
+ const r = t ?? Ti();
1941
+ return Mt(r), Ai(e, r), r;
1942
+ }
1943
+ function Ai(e, t) {
1944
+ let r;
1945
+ for (; (r = e.next()) !== null; )
1946
+ switch (r.fieldId) {
1947
+ case fi: {
1948
+ if (r.isNull) throw new Error();
1949
+ t.StyleId = r.asString();
1945
1950
  break;
1946
1951
  }
1947
- case fi: {
1948
- if (s.isNull) throw new Error();
1949
- t.Style = Ni(s.asDictionary());
1952
+ case di: {
1953
+ if (r.isNull) throw new Error();
1954
+ t.Style = wi(r.asDictionary());
1950
1955
  break;
1951
1956
  }
1952
1957
  }
1953
1958
  }
1954
- async function Ai(e, t) {
1955
- const s = await M(e, ui);
1956
- return Ti(s, t);
1959
+ async function Ni(e, t) {
1960
+ const r = await M(e, _i);
1961
+ return yi(r, t);
1957
1962
  }
1958
- function Ni(e) {
1963
+ function wi(e) {
1959
1964
  const t = /* @__PURE__ */ Object.create(null);
1960
- let s;
1961
- for (; (s = e.next()) !== null; ) {
1962
- const r = s.key.asString();
1963
- t[r] = s.value.asString();
1965
+ let r;
1966
+ for (; (r = e.next()) !== null; ) {
1967
+ const s = r.key.asString();
1968
+ t[s] = r.value.asString();
1964
1969
  }
1965
1970
  return t;
1966
1971
  }
1967
- const wi = 2097192, Ui = 2136687806;
1968
- function Ci(e) {
1972
+ const Ui = 2097192, Ci = 2136687806;
1973
+ function Di(e) {
1969
1974
  const t = {};
1970
1975
  return Bt(t), t;
1971
1976
  }
1972
1977
  function Bt(e) {
1973
1978
  return e.Styles = [], e;
1974
1979
  }
1975
- function Di(e, t) {
1976
- const s = O.create(e);
1977
- return Ri(s, t);
1978
- }
1979
1980
  function Ri(e, t) {
1980
- const s = t ?? Ci();
1981
- return Bt(s), mi(e, s), s;
1981
+ const r = O.create(e);
1982
+ return mi(r, t);
1982
1983
  }
1983
1984
  function mi(e, t) {
1984
- let s;
1985
- for (; (s = e.next()) !== null; )
1986
- switch (s.fieldId) {
1987
- case Ui: {
1988
- if (s.isNull) throw new Error();
1989
- t.Styles = gi(s.asArray());
1985
+ const r = t ?? Di();
1986
+ return Bt(r), Li(e, r), r;
1987
+ }
1988
+ function Li(e, t) {
1989
+ let r;
1990
+ for (; (r = e.next()) !== null; )
1991
+ switch (r.fieldId) {
1992
+ case Ci: {
1993
+ if (r.isNull) throw new Error();
1994
+ t.Styles = Oi(r.asArray());
1990
1995
  break;
1991
1996
  }
1992
1997
  }
1993
1998
  }
1994
- async function Li(e, t) {
1995
- const s = await M(e, wi);
1996
- return Di(s, t);
1999
+ async function gi(e, t) {
2000
+ const r = await M(e, Ui);
2001
+ return Ri(r, t);
1997
2002
  }
1998
- function gi(e) {
2003
+ function Oi(e) {
1999
2004
  const t = [];
2000
- let s;
2001
- for (; (s = e.next()) !== null; )
2002
- t.push(Pi(s.asObject()));
2005
+ let r;
2006
+ for (; (r = e.next()) !== null; )
2007
+ t.push(Fi(r.asObject()));
2003
2008
  return t;
2004
2009
  }
2005
- const Oi = 979822885, pi = 2374537704;
2006
- function bi(e) {
2010
+ const pi = 979822885, bi = 2374537704;
2011
+ function Pi(e) {
2007
2012
  const t = {};
2008
2013
  return Gt(t), t;
2009
2014
  }
2010
2015
  function Gt(e) {
2011
2016
  return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
2012
2017
  }
2013
- function Pi(e, t) {
2014
- const s = t ?? bi();
2015
- return Gt(s), Fi(e, s), s;
2016
- }
2017
2018
  function Fi(e, t) {
2018
- let s;
2019
- for (; (s = e.next()) !== null; )
2020
- switch (s.fieldId) {
2021
- case Oi: {
2022
- if (s.isNull) throw new Error();
2023
- t.StyleId = s.asString();
2019
+ const r = t ?? Pi();
2020
+ return Gt(r), ki(e, r), r;
2021
+ }
2022
+ function ki(e, t) {
2023
+ let r;
2024
+ for (; (r = e.next()) !== null; )
2025
+ switch (r.fieldId) {
2026
+ case pi: {
2027
+ if (r.isNull) throw new Error();
2028
+ t.StyleId = r.asString();
2024
2029
  break;
2025
2030
  }
2026
- case pi: {
2027
- if (s.isNull) throw new Error();
2028
- t.Style = ki(s.asDictionary());
2031
+ case bi: {
2032
+ if (r.isNull) throw new Error();
2033
+ t.Style = Vi(r.asDictionary());
2029
2034
  break;
2030
2035
  }
2031
2036
  }
2032
2037
  }
2033
- function ki(e) {
2038
+ function Vi(e) {
2034
2039
  const t = /* @__PURE__ */ Object.create(null);
2035
- let s;
2036
- for (; (s = e.next()) !== null; ) {
2037
- const r = s.key.asString();
2038
- t[r] = s.value.asString();
2040
+ let r;
2041
+ for (; (r = e.next()) !== null; ) {
2042
+ const s = r.key.asString();
2043
+ t[s] = r.value.asString();
2039
2044
  }
2040
2045
  return t;
2041
2046
  }
2042
- const Vi = 2097193, vi = 1415642792;
2043
- function Mi(e) {
2047
+ const vi = 2097193, Mi = 1415642792;
2048
+ function Bi(e) {
2044
2049
  const t = {};
2045
2050
  return xt(t), t;
2046
2051
  }
2047
2052
  function xt(e) {
2048
2053
  return e.StyleIds = [], e;
2049
2054
  }
2050
- function Bi(e, t) {
2051
- const s = O.create(e);
2052
- return Gi(s, t);
2053
- }
2054
2055
  function Gi(e, t) {
2055
- const s = t ?? Mi();
2056
- return xt(s), xi(e, s), s;
2056
+ const r = O.create(e);
2057
+ return xi(r, t);
2057
2058
  }
2058
2059
  function xi(e, t) {
2059
- let s;
2060
- for (; (s = e.next()) !== null; )
2061
- switch (s.fieldId) {
2062
- case vi: {
2063
- if (s.isNull) throw new Error();
2064
- t.StyleIds = Wi(s.asArray());
2060
+ const r = t ?? Bi();
2061
+ return xt(r), Hi(e, r), r;
2062
+ }
2063
+ function Hi(e, t) {
2064
+ let r;
2065
+ for (; (r = e.next()) !== null; )
2066
+ switch (r.fieldId) {
2067
+ case Mi: {
2068
+ if (r.isNull) throw new Error();
2069
+ t.StyleIds = Ki(r.asArray());
2065
2070
  break;
2066
2071
  }
2067
2072
  }
2068
2073
  }
2069
- async function Hi(e, t) {
2070
- const s = await M(e, Vi);
2071
- return Bi(s, t);
2074
+ async function Wi(e, t) {
2075
+ const r = await M(e, vi);
2076
+ return Gi(r, t);
2072
2077
  }
2073
- function Wi(e) {
2078
+ function Ki(e) {
2074
2079
  const t = [];
2075
- let s;
2076
- for (; (s = e.next()) !== null; )
2077
- t.push(s.asString());
2080
+ let r;
2081
+ for (; (r = e.next()) !== null; )
2082
+ t.push(r.asString());
2078
2083
  return t;
2079
2084
  }
2080
- const Ki = 2097190, Yi = 425183262, $i = 653781469;
2081
- function ji(e) {
2085
+ const Yi = 2097190, $i = 425183262, ji = 653781469;
2086
+ function Xi(e) {
2082
2087
  const t = {};
2083
2088
  return Ht(t), t;
2084
2089
  }
2085
2090
  function Ht(e) {
2086
2091
  return e.Json = "", e.Payloads = /* @__PURE__ */ Object.create(null), e;
2087
2092
  }
2088
- function Xi(e, t) {
2089
- const s = O.create(e);
2090
- return zi(s, t);
2091
- }
2092
2093
  function zi(e, t) {
2093
- const s = t ?? ji();
2094
- return Ht(s), Ji(e, s), s;
2094
+ const r = O.create(e);
2095
+ return Ji(r, t);
2095
2096
  }
2096
2097
  function Ji(e, t) {
2097
- let s;
2098
- for (; (s = e.next()) !== null; )
2099
- switch (s.fieldId) {
2100
- case Yi: {
2101
- if (s.isNull) throw new Error();
2102
- t.Json = s.asString();
2098
+ const r = t ?? Xi();
2099
+ return Ht(r), qi(e, r), r;
2100
+ }
2101
+ function qi(e, t) {
2102
+ let r;
2103
+ for (; (r = e.next()) !== null; )
2104
+ switch (r.fieldId) {
2105
+ case $i: {
2106
+ if (r.isNull) throw new Error();
2107
+ t.Json = r.asString();
2103
2108
  break;
2104
2109
  }
2105
- case $i: {
2106
- if (s.isNull) throw new Error();
2107
- t.Payloads = Qi(s.asDictionary());
2110
+ case ji: {
2111
+ if (r.isNull) throw new Error();
2112
+ t.Payloads = Zi(r.asDictionary());
2108
2113
  break;
2109
2114
  }
2110
2115
  }
2111
2116
  }
2112
- async function qi(e, t) {
2113
- const s = await M(e, Ki);
2114
- return Xi(s, t);
2117
+ async function Qi(e, t) {
2118
+ const r = await M(e, Yi);
2119
+ return zi(r, t);
2115
2120
  }
2116
- function Qi(e) {
2121
+ function Zi(e) {
2117
2122
  const t = /* @__PURE__ */ Object.create(null);
2118
- let s;
2119
- for (; (s = e.next()) !== null; ) {
2120
- const r = s.key.asString();
2121
- t[r] = ci(s.value.asObject());
2123
+ let r;
2124
+ for (; (r = e.next()) !== null; ) {
2125
+ const s = r.key.asString();
2126
+ t[s] = Ei(r.value.asObject());
2122
2127
  }
2123
2128
  return t;
2124
2129
  }
2125
- const Wt = 1, Zi = 1048636, tn = 2610786289;
2126
- function en(e) {
2130
+ const Wt = 1, tn = 1048636, en = 2610786289;
2131
+ function rn(e) {
2127
2132
  const t = new B(Wt);
2128
2133
  return sn(e, t), t.finish();
2129
2134
  }
2130
2135
  function sn(e, t) {
2131
- t.writeUInt32Field(tn, e.Version >>> 0);
2136
+ t.writeUInt32Field(en, e.Version >>> 0);
2132
2137
  }
2133
- function rn(e, t, s) {
2134
- const r = en(e);
2135
- return ee(Zi, r, Wt, t, s);
2138
+ function nn(e, t, r) {
2139
+ const s = rn(e);
2140
+ return ee(tn, s, Wt, t, r);
2136
2141
  }
2137
2142
  function w(e) {
2138
2143
  return typeof e == "object" && e !== null && !Array.isArray(e);
2139
2144
  }
2140
2145
  function Kt(e) {
2141
- const t = {}, s = Object.keys(e);
2142
- for (let r = 0; r < s.length; r++) {
2143
- const i = s[r];
2146
+ const t = {}, r = Object.keys(e);
2147
+ for (let s = 0; s < r.length; s++) {
2148
+ const i = r[s];
2144
2149
  t[i] = e[i];
2145
2150
  }
2146
2151
  return t;
2147
2152
  }
2148
- function Yt(e, t, s, r) {
2149
- if (!(e === void 0 && r)) {
2153
+ function Yt(e, t, r, s) {
2154
+ if (!(e === void 0 && s)) {
2150
2155
  if (Array.isArray(e)) {
2151
2156
  const i = [];
2152
2157
  for (let n = 0; n < e.length; n++) {
2153
2158
  const o = e[n];
2154
2159
  if (typeof o != "string")
2155
- throw new Error(`Invalid styleIds entry at ${t}.styleIds[${n}] for element ${s}`);
2160
+ throw new Error(`Invalid styleIds entry at ${t}.styleIds[${n}] for element ${r}`);
2156
2161
  const a = o.trim();
2157
2162
  a.length !== 0 && i.push(a);
2158
2163
  }
2159
2164
  return i;
2160
2165
  }
2161
2166
  if (e != null)
2162
- throw new Error(`Invalid styleIds for element ${s}`);
2167
+ throw new Error(`Invalid styleIds for element ${r}`);
2163
2168
  return [];
2164
2169
  }
2165
2170
  }
2166
2171
  function it(e, t) {
2167
2172
  if (!e || typeof e != "object")
2168
2173
  throw new Error(`Invalid UI node at ${t}`);
2169
- const s = e.Id, r = e.Type, i = e.Props, n = e.Children, o = e.StyleIds;
2170
- if (typeof s != "string")
2171
- throw new Error(`Invalid or missing node id at ${t}`);
2174
+ const r = e.Id, s = e.Type, i = e.Props, n = e.Children, o = e.StyleIds;
2172
2175
  if (typeof r != "string")
2173
- throw new Error(`Invalid or missing node type for ${s}`);
2176
+ throw new Error(`Invalid or missing node id at ${t}`);
2177
+ if (typeof s != "string")
2178
+ throw new Error(`Invalid or missing node type for ${r}`);
2174
2179
  let a = {};
2175
2180
  if (i != null) {
2176
2181
  if (!w(i))
2177
- throw new Error(`Invalid props for node ${s}`);
2182
+ throw new Error(`Invalid props for node ${r}`);
2178
2183
  a = Kt(i);
2179
2184
  }
2180
2185
  let l = [];
2181
2186
  Array.isArray(n) && (l = n.map(
2182
2187
  (I, E) => it(I ?? {}, `${t}.children[${E}]`)
2183
2188
  ));
2184
- const h = Yt(o, t, s, !1);
2189
+ const h = Yt(o, t, r, !1);
2185
2190
  return {
2186
- id: s,
2187
- type: r,
2191
+ id: r,
2192
+ type: s,
2188
2193
  props: a,
2189
2194
  children: l,
2190
2195
  styleIds: h ?? []
2191
2196
  };
2192
2197
  }
2193
- function nn(e, t) {
2198
+ function on(e, t) {
2194
2199
  if (!w(e))
2195
2200
  throw new Error(`Invalid text delta at ${t}`);
2196
- const s = e.NodeId, r = e.PropertyName, i = e.Start, n = e.End, o = e.InsertedText;
2197
- if (typeof s != "string" || s.length === 0)
2198
- throw new Error(`Invalid text delta node id at ${t}`);
2201
+ const r = e.NodeId, s = e.PropertyName, i = e.Start, n = e.End, o = e.InsertedText;
2199
2202
  if (typeof r != "string" || r.length === 0)
2203
+ throw new Error(`Invalid text delta node id at ${t}`);
2204
+ if (typeof s != "string" || s.length === 0)
2200
2205
  throw new Error(`Invalid text delta property name at ${t}`);
2201
2206
  if (typeof i != "number" || !Number.isFinite(i))
2202
2207
  throw new Error(`Invalid text delta start at ${t}`);
@@ -2210,67 +2215,67 @@ function nn(e, t) {
2210
2215
  } else if (n != null)
2211
2216
  throw new Error(`Invalid text delta end at ${t}`);
2212
2217
  return {
2213
- nodeId: s,
2214
- propertyName: r,
2218
+ nodeId: r,
2219
+ propertyName: s,
2215
2220
  start: i,
2216
2221
  end: a,
2217
2222
  insertedText: o
2218
2223
  };
2219
2224
  }
2220
- function on(e, t) {
2225
+ function an(e, t) {
2221
2226
  if (!w(e))
2222
2227
  throw new Error(`Invalid child insert at ${t}`);
2223
- const s = e.Index, r = e.Node;
2224
- if (typeof s != "number" || !Number.isFinite(s))
2228
+ const r = e.Index, s = e.Node;
2229
+ if (typeof r != "number" || !Number.isFinite(r))
2225
2230
  throw new Error(`Invalid child insert index at ${t}`);
2226
- if (!w(r))
2231
+ if (!w(s))
2227
2232
  throw new Error(`Invalid child insert node at ${t}`);
2228
2233
  return {
2229
- index: s,
2230
- node: it(r, `${t}.node`)
2234
+ index: r,
2235
+ node: it(s, `${t}.node`)
2231
2236
  };
2232
2237
  }
2233
- function an(e, t) {
2238
+ function ln(e, t) {
2234
2239
  if (!w(e))
2235
2240
  throw new Error(`Invalid child move at ${t}`);
2236
- const s = e.NodeId, r = e.FromIndex, i = e.ToIndex;
2237
- if (typeof s != "string" || s.length === 0)
2241
+ const r = e.NodeId, s = e.FromIndex, i = e.ToIndex;
2242
+ if (typeof r != "string" || r.length === 0)
2238
2243
  throw new Error(`Invalid child move nodeId at ${t}`);
2239
- if (typeof r != "number" || !Number.isFinite(r))
2244
+ if (typeof s != "number" || !Number.isFinite(s))
2240
2245
  throw new Error(`Invalid child move fromIndex at ${t}`);
2241
2246
  if (typeof i != "number" || !Number.isFinite(i))
2242
2247
  throw new Error(`Invalid child move toIndex at ${t}`);
2243
2248
  return {
2244
- nodeId: s,
2245
- fromIndex: r,
2249
+ nodeId: r,
2250
+ fromIndex: s,
2246
2251
  toIndex: i
2247
2252
  };
2248
2253
  }
2249
- function ln(e, t) {
2254
+ function In(e, t) {
2250
2255
  if (!w(e))
2251
2256
  throw new Error(`Invalid child remove at ${t}`);
2252
- const s = e.NodeId, r = e.Index;
2253
- if (typeof s != "string" || s.length === 0)
2257
+ const r = e.NodeId, s = e.Index;
2258
+ if (typeof r != "string" || r.length === 0)
2254
2259
  throw new Error(`Invalid child remove nodeId at ${t}`);
2255
- if (typeof r != "number" || !Number.isFinite(r))
2260
+ if (typeof s != "number" || !Number.isFinite(s))
2256
2261
  throw new Error(`Invalid child remove index at ${t}`);
2257
2262
  return {
2258
- nodeId: s,
2259
- index: r
2263
+ nodeId: r,
2264
+ index: s
2260
2265
  };
2261
2266
  }
2262
- function In(e, t) {
2267
+ function hn(e, t) {
2263
2268
  if (!w(e))
2264
2269
  throw new Error(`Invalid node change at ${t}`);
2265
- const s = e.nodeId;
2266
- if (typeof s != "string" || s.length === 0)
2270
+ const r = e.nodeId;
2271
+ if (typeof r != "string" || r.length === 0)
2267
2272
  throw new Error(`Invalid node change nodeId at ${t}`);
2268
- const r = Array.isArray(e.inserts) ? e.inserts.map(
2269
- (I, E) => on(I ?? {}, `${t}.inserts[${E}]`)
2273
+ const s = Array.isArray(e.inserts) ? e.inserts.map(
2274
+ (I, E) => an(I ?? {}, `${t}.inserts[${E}]`)
2270
2275
  ) : void 0, i = Array.isArray(e.moves) ? e.moves.map(
2271
- (I, E) => an(I ?? {}, `${t}.moves[${E}]`)
2276
+ (I, E) => ln(I ?? {}, `${t}.moves[${E}]`)
2272
2277
  ) : void 0, n = Array.isArray(e.removals) ? e.removals.map(
2273
- (I, E) => ln(I ?? {}, `${t}.removals[${E}]`)
2278
+ (I, E) => In(I ?? {}, `${t}.removals[${E}]`)
2274
2279
  ) : void 0;
2275
2280
  let o;
2276
2281
  if (w(e.changedProps)) {
@@ -2283,11 +2288,11 @@ function In(e, t) {
2283
2288
  }
2284
2289
  }
2285
2290
  const a = Array.isArray(e.textUpdates) ? e.textUpdates.map(
2286
- (I, E) => nn(I ?? {}, `${t}.textUpdates[${E}]`)
2287
- ) : void 0, l = e.styleIds, h = l !== void 0 ? Yt(l, t, s, !0) : void 0;
2291
+ (I, E) => on(I ?? {}, `${t}.textUpdates[${E}]`)
2292
+ ) : void 0, l = e.styleIds, h = l !== void 0 ? Yt(l, t, r, !0) : void 0;
2288
2293
  return {
2289
- nodeId: s,
2290
- ...r && r.length > 0 ? { inserts: r } : {},
2294
+ nodeId: r,
2295
+ ...s && s.length > 0 ? { inserts: s } : {},
2291
2296
  ...i && i.length > 0 ? { moves: i } : {},
2292
2297
  ...n && n.length > 0 ? { removals: n } : {},
2293
2298
  ...o && o.size > 0 ? { changedProps: o } : {},
@@ -2295,38 +2300,38 @@ function In(e, t) {
2295
2300
  ...h !== void 0 ? { styleIds: h } : {}
2296
2301
  };
2297
2302
  }
2298
- function hn(e) {
2303
+ function cn(e) {
2299
2304
  const t = /* @__PURE__ */ new Map();
2300
- for (const [s, r] of Object.entries(e))
2301
- t.set(s, r);
2305
+ for (const [r, s] of Object.entries(e))
2306
+ t.set(r, s);
2302
2307
  return t;
2303
2308
  }
2304
- function cn(e, t, s) {
2309
+ function En(e, t, r) {
2305
2310
  if (!e || typeof e != "object")
2306
2311
  throw new D("UI update graph is missing");
2307
- const r = it(e, "graph");
2308
- if (r.type !== "root")
2312
+ const s = it(e, "graph");
2313
+ if (s.type !== "root")
2309
2314
  throw new D('UI update root element must have type "root"');
2310
- const i = un(r.props, t);
2315
+ const i = _n(s.props, t);
2311
2316
  return {
2312
2317
  type: "full",
2313
- version: s,
2314
- root: r,
2318
+ version: r,
2319
+ root: s,
2315
2320
  metadata: i
2316
2321
  };
2317
2322
  }
2318
- function En(e, t, s) {
2323
+ function un(e, t, r) {
2319
2324
  if (!Array.isArray(e))
2320
2325
  throw new D("UI diff changes must be an array");
2321
2326
  if (!w(t))
2322
2327
  throw new D("UI diff metadata must be an object");
2323
- const r = t.viewId;
2324
- if (typeof r != "string" || r.length === 0)
2328
+ const s = t.viewId;
2329
+ if (typeof s != "string" || s.length === 0)
2325
2330
  throw new D("UI diff metadata is missing viewId");
2326
2331
  const i = e.map(
2327
- (E, c) => In(E ?? {}, `changes[${c}]`)
2332
+ (E, c) => hn(E ?? {}, `changes[${c}]`)
2328
2333
  ), 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), h = J(t.optimisticReconcile), I = {
2329
- viewId: r,
2334
+ viewId: s,
2330
2335
  ...n !== void 0 ? { optimisticActionId: n } : {},
2331
2336
  ...o !== void 0 ? { isOptimistic: o } : {},
2332
2337
  ...a !== void 0 ? { isUpdate: a } : {},
@@ -2335,18 +2340,18 @@ function En(e, t, s) {
2335
2340
  };
2336
2341
  return {
2337
2342
  type: "diff",
2338
- version: s,
2343
+ version: r,
2339
2344
  changes: i,
2340
2345
  metadata: I
2341
2346
  };
2342
2347
  }
2343
- function un(e, t) {
2344
- const s = e.viewId;
2345
- if (typeof s != "string" || s.length === 0)
2348
+ function _n(e, t) {
2349
+ const r = e.viewId;
2350
+ if (typeof r != "string" || r.length === 0)
2346
2351
  throw new D("UI update root is missing viewId");
2347
- 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);
2348
- 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))), {
2349
- viewId: r,
2352
+ 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);
2353
+ return w(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))), {
2354
+ viewId: s,
2350
2355
  ...i !== void 0 ? { optimisticActionId: i } : {},
2351
2356
  ...n !== void 0 ? { isOptimistic: n } : {},
2352
2357
  ...o !== void 0 ? { isUpdate: o } : {},
@@ -2357,8 +2362,8 @@ function un(e, t) {
2357
2362
  function z(e) {
2358
2363
  if (!w(e))
2359
2364
  return;
2360
- const t = e, s = t.id, r = t.actionId, i = t.ordinal, n = t.baseVersion, o = t.supersedes;
2361
- 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))
2365
+ const t = e, r = t.id, s = t.actionId, i = t.ordinal, n = t.baseVersion, o = t.supersedes;
2366
+ 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))
2362
2367
  return;
2363
2368
  let a;
2364
2369
  if (Array.isArray(o)) {
@@ -2368,8 +2373,8 @@ function z(e) {
2368
2373
  a = l;
2369
2374
  }
2370
2375
  return {
2371
- id: s,
2372
- actionId: r,
2376
+ id: r,
2377
+ actionId: s,
2373
2378
  ordinal: i,
2374
2379
  baseVersion: n,
2375
2380
  ...a && a.length > 0 ? { supersedes: a } : {}
@@ -2378,27 +2383,27 @@ function z(e) {
2378
2383
  function J(e) {
2379
2384
  if (!w(e))
2380
2385
  return;
2381
- const t = e, s = t.baseVersion, r = t.drop;
2382
- if (typeof s != "number" || !Number.isFinite(s))
2386
+ const t = e, r = t.baseVersion, s = t.drop;
2387
+ if (typeof r != "number" || !Number.isFinite(r))
2383
2388
  return;
2384
2389
  let i;
2385
- if (Array.isArray(r)) {
2390
+ if (Array.isArray(s)) {
2386
2391
  const n = [];
2387
- for (const o of r)
2392
+ for (const o of s)
2388
2393
  typeof o == "string" && o.length > 0 && n.push(o);
2389
2394
  i = n;
2390
2395
  }
2391
2396
  return {
2392
- baseVersion: s,
2397
+ baseVersion: r,
2393
2398
  ...i && i.length > 0 ? { drop: i } : {}
2394
2399
  };
2395
2400
  }
2396
2401
  class D extends Error {
2397
- constructor(t, s) {
2398
- super(t), this.causeError = s, this.name = "UiUpdateParseError", s instanceof Error && (this.stack = s.stack);
2402
+ constructor(t, r) {
2403
+ super(t), this.causeError = r, this.name = "UiUpdateParseError", r instanceof Error && (this.stack = r.stack);
2399
2404
  }
2400
2405
  }
2401
- function _n(e) {
2406
+ function fn(e) {
2402
2407
  let t;
2403
2408
  try {
2404
2409
  t = JSON.parse(e.Json);
@@ -2407,84 +2412,84 @@ function _n(e) {
2407
2412
  }
2408
2413
  if (!t || typeof t != "object")
2409
2414
  throw new D("UI update snapshot must be an object");
2410
- const { type: s, version: r } = t;
2411
- if (s !== "full" && s !== "diff")
2412
- throw new D(`Unknown UI update type: ${String(s)}`);
2413
- if (typeof r != "number")
2415
+ const { type: r, version: s } = t;
2416
+ if (r !== "full" && r !== "diff")
2417
+ throw new D(`Unknown UI update type: ${String(r)}`);
2418
+ if (typeof s != "number")
2414
2419
  throw new D("UI update version must be a number");
2415
- const i = s === "full" ? cn(t.graph, t.metadata, r) : En(t.changes, t.metadata, r), n = e.Payloads ? hn(e.Payloads) : /* @__PURE__ */ new Map();
2420
+ const i = r === "full" ? En(t.graph, t.metadata, s) : un(t.changes, t.metadata, s), n = e.Payloads ? cn(e.Payloads) : /* @__PURE__ */ new Map();
2416
2421
  return {
2417
2422
  snapshot: i,
2418
2423
  payloads: n
2419
2424
  };
2420
2425
  }
2421
- class fn {
2426
+ class dn {
2422
2427
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2423
2428
  cache = /* @__PURE__ */ new Map();
2424
2429
  /**
2425
2430
  * Get a cached void handler (no payload) for a node/action combination.
2426
2431
  * Creates and caches the handler if it doesn't exist.
2427
2432
  */
2428
- getHandler(t, s, r) {
2429
- const i = `${t}:${s}`;
2433
+ getHandler(t, r, s) {
2434
+ const i = `${t}:${r}`;
2430
2435
  let n = this.cache.get(i);
2431
- return n || (n = () => r(s), this.cache.set(i, n)), n;
2436
+ return n || (n = () => s(r), this.cache.set(i, n)), n;
2432
2437
  }
2433
2438
  /**
2434
2439
  * Get a cached handler that accepts a payload.
2435
2440
  * Creates and caches the handler if it doesn't exist.
2436
2441
  */
2437
- getHandlerWithPayload(t, s, r) {
2438
- const i = `${t}:${s}:payload`;
2442
+ getHandlerWithPayload(t, r, s) {
2443
+ const i = `${t}:${r}:payload`;
2439
2444
  let n = this.cache.get(i);
2440
- return n || (n = (o) => r(s, o), this.cache.set(i, n)), n;
2445
+ return n || (n = (o) => s(r, o), this.cache.set(i, n)), n;
2441
2446
  }
2442
2447
  /**
2443
2448
  * Get a cached handler for boolean payloads.
2444
2449
  */
2445
- getBooleanHandler(t, s, r) {
2446
- return this.getHandlerWithPayload(t, s, r);
2450
+ getBooleanHandler(t, r, s) {
2451
+ return this.getHandlerWithPayload(t, r, s);
2447
2452
  }
2448
2453
  /**
2449
2454
  * Get a cached handler for string payloads.
2450
2455
  */
2451
- getStringHandler(t, s, r) {
2452
- return this.getHandlerWithPayload(t, s, r);
2456
+ getStringHandler(t, r, s) {
2457
+ return this.getHandlerWithPayload(t, r, s);
2453
2458
  }
2454
2459
  /**
2455
2460
  * Get a cached handler for number payloads.
2456
2461
  */
2457
- getNumberHandler(t, s, r) {
2458
- return this.getHandlerWithPayload(t, s, r);
2462
+ getNumberHandler(t, r, s) {
2463
+ return this.getHandlerWithPayload(t, r, s);
2459
2464
  }
2460
2465
  /**
2461
2466
  * Get a cached handler for number array payloads.
2462
2467
  */
2463
- getNumberArrayHandler(t, s, r) {
2464
- return this.getHandlerWithPayload(t, s, r);
2468
+ getNumberArrayHandler(t, r, s) {
2469
+ return this.getHandlerWithPayload(t, r, s);
2465
2470
  }
2466
2471
  /**
2467
2472
  * Get a cached handler for nullable boolean payloads.
2468
2473
  */
2469
- getNullableBooleanHandler(t, s, r) {
2470
- const i = `${t}:${s}:nullable-bool`;
2474
+ getNullableBooleanHandler(t, r, s) {
2475
+ const i = `${t}:${r}:nullable-bool`;
2471
2476
  let n = this.cache.get(i);
2472
- return n || (n = (o) => r(s, o ?? null), this.cache.set(i, n)), n;
2477
+ return n || (n = (o) => s(r, o ?? null), this.cache.set(i, n)), n;
2473
2478
  }
2474
2479
  /**
2475
2480
  * Invalidate all cached handlers for a specific node.
2476
2481
  * Call this when a node is removed from the tree.
2477
2482
  */
2478
2483
  invalidateNode(t) {
2479
- const s = `${t}:`;
2480
- for (const r of this.cache.keys())
2481
- r.startsWith(s) && this.cache.delete(r);
2484
+ const r = `${t}:`;
2485
+ for (const s of this.cache.keys())
2486
+ s.startsWith(r) && this.cache.delete(s);
2482
2487
  }
2483
2488
  /**
2484
2489
  * Invalidate a specific handler.
2485
2490
  */
2486
- invalidateHandler(t, s) {
2487
- this.cache.delete(`${t}:${s}`), this.cache.delete(`${t}:${s}:payload`), this.cache.delete(`${t}:${s}:nullable-bool`);
2491
+ invalidateHandler(t, r) {
2492
+ this.cache.delete(`${t}:${r}`), this.cache.delete(`${t}:${r}:payload`), this.cache.delete(`${t}:${r}:nullable-bool`);
2488
2493
  }
2489
2494
  /**
2490
2495
  * Clear all cached handlers.
@@ -2499,7 +2504,7 @@ class fn {
2499
2504
  return this.cache.size;
2500
2505
  }
2501
2506
  }
2502
- class dn {
2507
+ class Tn {
2503
2508
  views = /* @__PURE__ */ new Map();
2504
2509
  listeners = /* @__PURE__ */ new Set();
2505
2510
  payloads = /* @__PURE__ */ new Map();
@@ -2521,20 +2526,20 @@ class dn {
2521
2526
  patchesDirty = !0;
2522
2527
  payloadsDirty = !0;
2523
2528
  // Handler cache for stable event handlers
2524
- handlerCache = new fn();
2529
+ handlerCache = new dn();
2525
2530
  getSortedPatches(t) {
2526
- const s = this.buildPatchCacheKey(t.patches);
2527
- if (t.sortedPatchesCacheKey === s && t.sortedPatchesCache)
2531
+ const r = this.buildPatchCacheKey(t.patches);
2532
+ if (t.sortedPatchesCacheKey === r && t.sortedPatchesCache)
2528
2533
  return t.sortedPatchesCache;
2529
- const r = [...t.patches.values()].sort((i, n) => i.ordinal - n.ordinal);
2530
- return t.sortedPatchesCache = r, t.sortedPatchesCacheKey = s, r;
2534
+ const s = [...t.patches.values()].sort((i, n) => i.ordinal - n.ordinal);
2535
+ return t.sortedPatchesCache = s, t.sortedPatchesCacheKey = r, s;
2531
2536
  }
2532
2537
  buildPatchCacheKey(t) {
2533
2538
  if (t.size === 0) return "";
2534
- let s = "";
2535
- for (const [r, i] of t)
2536
- s += s ? `,${r}:${i.ordinal}` : `${r}:${i.ordinal}`;
2537
- return s;
2539
+ let r = "";
2540
+ for (const [s, i] of t)
2541
+ r += r ? `,${s}:${i.ordinal}` : `${s}:${i.ordinal}`;
2542
+ return r;
2538
2543
  }
2539
2544
  invalidatePatchCache(t) {
2540
2545
  t.sortedPatchesCache = void 0, t.sortedPatchesCacheKey = void 0;
@@ -2550,15 +2555,15 @@ class dn {
2550
2555
  version: -1
2551
2556
  };
2552
2557
  }
2553
- const { snapshot: s, payloads: r } = t, { metadata: i } = s, { viewId: n } = i;
2558
+ const { snapshot: r, payloads: s } = t, { metadata: i } = r, { viewId: n } = i;
2554
2559
  let o = this.views.get(n);
2555
2560
  o || (o = {
2556
2561
  version: 0,
2557
2562
  baselineVersion: 0,
2558
2563
  patches: /* @__PURE__ */ new Map()
2559
2564
  }, this.views.set(n, o));
2560
- const a = s.type === "diff" && i.isUpdate === !0;
2561
- if (s.version < o.version || s.version === o.version && !a)
2565
+ const a = r.type === "diff" && i.isUpdate === !0;
2566
+ if (r.version < o.version || r.version === o.version && !a)
2562
2567
  return !1;
2563
2568
  let l = !1;
2564
2569
  if (this.rootViewId || (this.rootViewId = n, l = !0, this.structureChanged = !0), i.optimisticReconcile?.drop)
@@ -2568,84 +2573,84 @@ class dn {
2568
2573
  for (const I of i.optimisticPatch.supersedes)
2569
2574
  o.patches.delete(I) && (l = !0, this.patchesDirty = !0, this.invalidatePatchCache(o));
2570
2575
  const h = o.composite ?? o.baseline;
2571
- if (s.type === "full")
2572
- 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);
2576
+ if (r.type === "full")
2577
+ 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);
2573
2578
  else if (i.optimisticPatch) {
2574
2579
  if (!h)
2575
2580
  return !1;
2576
- const I = j(h, s.changes);
2581
+ const I = j(h, r.changes);
2577
2582
  I !== h && (o.composite = I, l = !0, this.viewsDirty = !0, H(h, I, this.changedNodeIds));
2578
2583
  const E = i.optimisticPatch, c = {
2579
2584
  id: E.id,
2580
2585
  actionId: E.actionId,
2581
2586
  ordinal: E.ordinal,
2582
2587
  baseVersion: E.baseVersion,
2583
- changes: s.changes
2588
+ changes: r.changes
2584
2589
  };
2585
- o.patches.set(c.id, c), this.invalidatePatchCache(o), l = !0, this.patchesDirty = !0, o.version = s.version;
2590
+ o.patches.set(c.id, c), this.invalidatePatchCache(o), l = !0, this.patchesDirty = !0, o.version = r.version;
2586
2591
  } else {
2587
2592
  const I = o.baseline ?? h;
2588
2593
  if (!I)
2589
2594
  return !1;
2590
- const E = j(I, s.changes);
2591
- E !== I ? (o.baseline = E, l = !0, this.viewsDirty = !0) : o.baseline = E, o.baselineVersion = i.optimisticReconcile?.baseVersion ?? s.version;
2595
+ const E = j(I, r.changes);
2596
+ E !== I ? (o.baseline = E, l = !0, this.viewsDirty = !0) : o.baseline = E, o.baselineVersion = i.optimisticReconcile?.baseVersion ?? r.version;
2592
2597
  let c = o.baseline ?? E;
2593
2598
  const u = this.getSortedPatches(o);
2594
2599
  for (const _ of u) {
2595
2600
  const y = j(c, _.changes);
2596
2601
  y !== c && (l = !0, this.viewsDirty = !0), c = y, _.baseVersion = o.baselineVersion;
2597
2602
  }
2598
- o.composite !== c && (o.composite = c, l = !0, this.viewsDirty = !0), h && c ? H(h, c, this.changedNodeIds) : c && b(c, this.changedNodeIds), o.version = s.version;
2603
+ o.composite !== c && (o.composite = c, l = !0, this.viewsDirty = !0), h && c ? H(h, c, this.changedNodeIds) : c && b(c, this.changedNodeIds), o.version = r.version;
2599
2604
  }
2600
- for (const [I, E] of r)
2605
+ for (const [I, E] of s)
2601
2606
  this.payloads.get(I) !== E && (this.payloads.set(I, E), l = !0, this.payloadsDirty = !0);
2602
- return l ? (this.commitSnapshot(), this.notify(), !0) : (o.version = s.version, !1);
2607
+ return l ? (this.commitSnapshot(), this.notify(), !0) : (o.version = r.version, !1);
2603
2608
  }
2604
2609
  replaceFromWire(t) {
2605
- const s = {
2610
+ const r = {
2606
2611
  rootViewId: t.rootViewId,
2607
2612
  views: new Map(t.views),
2608
2613
  payloads: new Map(t.payloads),
2609
2614
  optimisticPatches: new Map(t.optimisticPatches),
2610
2615
  version: t.version
2611
2616
  };
2612
- return this.replaceSnapshot(s);
2617
+ return this.replaceSnapshot(r);
2613
2618
  }
2614
2619
  patchFromOp(t) {
2615
2620
  this.snapshotMode = !0;
2616
- const s = t.expectedBaseVersion;
2617
- if (s !== void 0 && this.snapshot.version !== s)
2621
+ const r = t.expectedBaseVersion;
2622
+ if (r !== void 0 && this.snapshot.version !== r)
2618
2623
  return !1;
2619
- let r = !1, i = null, n = null, o = null;
2624
+ let s = !1, i = null, n = null, o = null;
2620
2625
  const a = () => (i || (i = new Map(this.snapshot.views)), i), l = () => (n || (n = new Map(this.snapshot.payloads)), n), h = () => (o || (o = new Map(this.snapshot.optimisticPatches)), o);
2621
2626
  if (t.deleteViews && t.deleteViews.length > 0)
2622
2627
  for (const c of t.deleteViews)
2623
- a().delete(c) && (r = !0, this.structureChanged = !0);
2628
+ a().delete(c) && (s = !0, this.structureChanged = !0);
2624
2629
  if (t.upsertViews && t.upsertViews.length > 0)
2625
2630
  for (const [c, u] of t.upsertViews) {
2626
2631
  const _ = a(), y = _.get(c);
2627
- y !== u && (_.set(c, u), r = !0, y ? H(y, u, this.changedNodeIds) : (b(u, this.changedNodeIds), this.structureChanged = !0));
2632
+ y !== u && (_.set(c, u), s = !0, y ? H(y, u, this.changedNodeIds) : (b(u, this.changedNodeIds), this.structureChanged = !0));
2628
2633
  }
2629
2634
  if (t.deletePayloads && t.deletePayloads.length > 0)
2630
2635
  for (const c of t.deletePayloads)
2631
- l().delete(c) && (r = !0);
2636
+ l().delete(c) && (s = !0);
2632
2637
  if (t.upsertPayloads && t.upsertPayloads.length > 0)
2633
2638
  for (const [c, u] of t.upsertPayloads) {
2634
2639
  const _ = l();
2635
- _.get(c) !== u && (_.set(c, u), r = !0);
2640
+ _.get(c) !== u && (_.set(c, u), s = !0);
2636
2641
  }
2637
2642
  if (t.deleteOptimisticPatchesForViews && t.deleteOptimisticPatchesForViews.length > 0)
2638
2643
  for (const c of t.deleteOptimisticPatchesForViews)
2639
- h().delete(c) && (r = !0);
2644
+ h().delete(c) && (s = !0);
2640
2645
  if (t.upsertOptimisticPatches && t.upsertOptimisticPatches.length > 0)
2641
2646
  for (const [c, u] of t.upsertOptimisticPatches) {
2642
2647
  const _ = h(), y = _.get(c);
2643
- An(y, u) || (_.set(c, u), r = !0);
2648
+ Nn(y, u) || (_.set(c, u), s = !0);
2644
2649
  }
2645
2650
  const I = t.rootViewId ?? this.snapshot.rootViewId;
2646
- I !== this.snapshot.rootViewId && (r = !0, this.structureChanged = !0);
2651
+ I !== this.snapshot.rootViewId && (s = !0, this.structureChanged = !0);
2647
2652
  const E = t.nextVersion;
2648
- if (E !== this.snapshot.version && (r = !0), !r)
2653
+ if (E !== this.snapshot.version && (s = !0), !s)
2649
2654
  return this.snapshot = { ...this.snapshot, version: E }, !1;
2650
2655
  for (const c of this.changedNodeIds)
2651
2656
  this.nodeVersions.set(c, (this.nodeVersions.get(c) ?? 0) + 1);
@@ -2659,15 +2664,15 @@ class dn {
2659
2664
  }
2660
2665
  replaceSnapshot(t) {
2661
2666
  this.snapshotMode = !0;
2662
- 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;
2663
- (s.rootViewId !== t.rootViewId || s.views.size !== t.views.size) && (this.structureChanged = !0);
2667
+ 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;
2668
+ (r.rootViewId !== t.rootViewId || r.views.size !== t.views.size) && (this.structureChanged = !0);
2664
2669
  for (const [i, n] of t.views) {
2665
- const o = s.views.get(i);
2670
+ const o = r.views.get(i);
2666
2671
  o ? H(o, n, this.changedNodeIds) : (b(n, this.changedNodeIds), this.structureChanged = !0);
2667
2672
  }
2668
2673
  for (const i of this.changedNodeIds)
2669
2674
  this.nodeVersions.set(i, (this.nodeVersions.get(i) ?? 0) + 1);
2670
- return this.snapshot = t, r && this.notify(), r;
2675
+ return this.snapshot = t, s && this.notify(), s;
2671
2676
  }
2672
2677
  clear() {
2673
2678
  (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 = {
@@ -2685,18 +2690,18 @@ class dn {
2685
2690
  this.listeners.delete(t);
2686
2691
  };
2687
2692
  }
2688
- subscribeNode(t, s) {
2689
- let r = this.nodeListeners.get(t);
2690
- return r || (r = /* @__PURE__ */ new Set(), this.nodeListeners.set(t, r)), r.add(s), () => {
2691
- r && (r.delete(s), r.size === 0 && this.nodeListeners.delete(t));
2693
+ subscribeNode(t, r) {
2694
+ let s = this.nodeListeners.get(t);
2695
+ return s || (s = /* @__PURE__ */ new Set(), this.nodeListeners.set(t, s)), s.add(r), () => {
2696
+ s && (s.delete(r), s.size === 0 && this.nodeListeners.delete(t));
2692
2697
  };
2693
2698
  }
2694
2699
  getNode(t) {
2695
- const s = this.snapshot.views.get(t);
2696
- if (s)
2697
- return s;
2698
- for (const r of this.snapshot.views.values()) {
2699
- const i = Xt(r, t);
2700
+ const r = this.snapshot.views.get(t);
2701
+ if (r)
2702
+ return r;
2703
+ for (const s of this.snapshot.views.values()) {
2704
+ const i = Xt(s, t);
2700
2705
  if (i)
2701
2706
  return i;
2702
2707
  }
@@ -2710,15 +2715,15 @@ class dn {
2710
2715
  return;
2711
2716
  }
2712
2717
  for (const t of this.changedNodeIds) {
2713
- const s = this.nodeListeners.get(t);
2714
- if (s)
2715
- for (const r of s)
2716
- r();
2718
+ const r = this.nodeListeners.get(t);
2719
+ if (r)
2720
+ for (const s of r)
2721
+ s();
2717
2722
  }
2718
2723
  this.changedNodeIds.clear();
2719
2724
  }
2720
2725
  commitSnapshot() {
2721
- let t, s, r;
2726
+ let t, r, s;
2722
2727
  if (this.viewsDirty) {
2723
2728
  const n = /* @__PURE__ */ new Map();
2724
2729
  for (const [o, a] of this.views)
@@ -2741,10 +2746,10 @@ class dn {
2741
2746
  }))
2742
2747
  );
2743
2748
  }
2744
- s = n, this.patchesDirty = !1;
2749
+ r = n, this.patchesDirty = !1;
2745
2750
  } else
2746
- s = this.snapshot.optimisticPatches;
2747
- this.payloadsDirty ? (r = new Map(this.payloads), this.payloadsDirty = !1) : r = this.snapshot.payloads;
2751
+ r = this.snapshot.optimisticPatches;
2752
+ this.payloadsDirty ? (s = new Map(this.payloads), this.payloadsDirty = !1) : s = this.snapshot.payloads;
2748
2753
  let i = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
2749
2754
  if (i === void 0)
2750
2755
  for (const n of this.views.values())
@@ -2752,8 +2757,8 @@ class dn {
2752
2757
  this.snapshot = {
2753
2758
  rootViewId: this.rootViewId,
2754
2759
  views: t,
2755
- payloads: r,
2756
- optimisticPatches: s,
2760
+ payloads: s,
2761
+ optimisticPatches: r,
2757
2762
  version: i
2758
2763
  };
2759
2764
  for (const n of this.changedNodeIds)
@@ -2767,59 +2772,59 @@ class dn {
2767
2772
  }
2768
2773
  }
2769
2774
  }
2770
- class Tn {
2775
+ class yn {
2771
2776
  streams = /* @__PURE__ */ new Map();
2772
2777
  listeners = /* @__PURE__ */ new Set();
2773
- apply(t, s) {
2774
- const i = this.getOrCreateStreamEntry(t).store.apply(s);
2778
+ apply(t, r) {
2779
+ const i = this.getOrCreateStreamEntry(t).store.apply(r);
2775
2780
  return i && this.notify(t), i;
2776
2781
  }
2777
2782
  applyStoreOp(t) {
2778
2783
  if (t.type === "ReplaceStreamSnapshot") {
2779
- const s = this.getOrCreateStreamEntry(t.snapshot.streamId), r = s.category !== t.snapshot.category;
2780
- return s.category = t.snapshot.category, s.store.replaceFromWire(t.snapshot) || r ? (this.notify(t.snapshot.streamId), !0) : !1;
2784
+ const r = this.getOrCreateStreamEntry(t.snapshot.streamId), s = r.category !== t.snapshot.category;
2785
+ return r.category = t.snapshot.category, r.store.replaceFromWire(t.snapshot) || s ? (this.notify(t.snapshot.streamId), !0) : !1;
2781
2786
  }
2782
2787
  if (t.type === "PatchStreamSnapshot") {
2783
- const s = this.getOrCreateStreamEntry(t.streamId), r = t.category !== void 0 && s.category !== t.category;
2784
- return t.category !== void 0 && (s.category = t.category), s.store.patchFromOp(t) || r ? (this.notify(t.streamId), !0) : !1;
2788
+ const r = this.getOrCreateStreamEntry(t.streamId), s = t.category !== void 0 && r.category !== t.category;
2789
+ return t.category !== void 0 && (r.category = t.category), r.store.patchFromOp(t) || s ? (this.notify(t.streamId), !0) : !1;
2785
2790
  }
2786
2791
  if (t.type === "ClearStream") {
2787
- const s = this.streams.get(t.streamId);
2788
- return s ? (s.store.clear(), this.notify(t.streamId), !0) : !1;
2792
+ const r = this.streams.get(t.streamId);
2793
+ return r ? (r.store.clear(), this.notify(t.streamId), !0) : !1;
2789
2794
  }
2790
2795
  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;
2791
2796
  }
2792
2797
  applyStoreOps(t) {
2793
- for (const s of t)
2794
- this.applyStoreOp(s);
2798
+ for (const r of t)
2799
+ this.applyStoreOp(r);
2795
2800
  }
2796
2801
  clear(t) {
2797
- const s = this.streams.get(t);
2798
- s && (s.store.clear(), this.notify(t));
2802
+ const r = this.streams.get(t);
2803
+ r && (r.store.clear(), this.notify(t));
2799
2804
  }
2800
2805
  remove(t) {
2801
2806
  this.streams.delete(t) && this.notify(t);
2802
2807
  }
2803
- setCategory(t, s) {
2804
- const r = this.getOrCreateStreamEntry(t);
2805
- r.category !== s && (r.category = s, this.notify(t));
2808
+ setCategory(t, r) {
2809
+ const s = this.getOrCreateStreamEntry(t);
2810
+ s.category !== r && (s.category = r, this.notify(t));
2806
2811
  }
2807
2812
  getSnapshot(t) {
2808
- const s = this.streams.get(t);
2809
- return s ? {
2810
- ...s.store.getSnapshot(),
2813
+ const r = this.streams.get(t);
2814
+ return r ? {
2815
+ ...r.store.getSnapshot(),
2811
2816
  streamId: t,
2812
- category: s.category
2817
+ category: r.category
2813
2818
  } : void 0;
2814
2819
  }
2815
2820
  getSnapshots() {
2816
2821
  const t = [];
2817
- for (const [s, r] of this.streams) {
2818
- const i = r.store.getSnapshot();
2822
+ for (const [r, s] of this.streams) {
2823
+ const i = s.store.getSnapshot();
2819
2824
  t.push({
2820
2825
  ...i,
2821
- streamId: s,
2822
- category: r.category
2826
+ streamId: r,
2827
+ category: s.category
2823
2828
  });
2824
2829
  }
2825
2830
  return t;
@@ -2830,32 +2835,32 @@ class Tn {
2830
2835
  };
2831
2836
  }
2832
2837
  getOrCreateStreamEntry(t) {
2833
- let s = this.streams.get(t);
2834
- return s || (s = { store: new dn() }, this.streams.set(t, s)), s;
2838
+ let r = this.streams.get(t);
2839
+ return r || (r = { store: new Tn() }, this.streams.set(t, r)), r;
2835
2840
  }
2836
2841
  notify(t) {
2837
- for (const s of this.listeners)
2838
- s(t);
2842
+ for (const r of this.listeners)
2843
+ r(t);
2839
2844
  }
2840
2845
  }
2841
- function j(e, t, s) {
2846
+ function j(e, t, r) {
2842
2847
  if (t.length === 0)
2843
2848
  return e;
2844
- const r = /* @__PURE__ */ new Map();
2849
+ const s = /* @__PURE__ */ new Map();
2845
2850
  for (const i of t)
2846
- r.set(i.nodeId, i);
2847
- return $t(e, r);
2851
+ s.set(i.nodeId, i);
2852
+ return $t(e, s);
2848
2853
  }
2849
- function $t(e, t, s) {
2850
- const r = t.get(e.id);
2854
+ function $t(e, t, r) {
2855
+ const s = t.get(e.id);
2851
2856
  let i = e, n = !1;
2852
- if (r?.textUpdates && r.textUpdates.length > 0) {
2853
- const f = wn(e, r.textUpdates);
2857
+ if (s?.textUpdates && s.textUpdates.length > 0) {
2858
+ const f = Un(e, s.textUpdates);
2854
2859
  i = f.node, n = f.changed;
2855
2860
  }
2856
2861
  let o = !1, a = i.props;
2857
- if (r?.changedProps && r.changedProps.size > 0)
2858
- for (const [f, A] of r.changedProps.entries()) {
2862
+ if (s?.changedProps && s.changedProps.size > 0)
2863
+ for (const [f, A] of s.changedProps.entries()) {
2859
2864
  const T = a[f];
2860
2865
  if (A === void 0)
2861
2866
  (T !== void 0 || f in a) && (o || (a = v(a), o = !0), delete a[f]);
@@ -2866,19 +2871,19 @@ function $t(e, t, s) {
2866
2871
  k(A, T) || (o || (a = v(a), o = !0), a[f] = A);
2867
2872
  }
2868
2873
  let l = !1, h = i.styleIds;
2869
- r?.styleIds !== void 0 && (zt(i.styleIds, r.styleIds) || (h = r.styleIds, l = !0));
2874
+ s?.styleIds !== void 0 && (zt(i.styleIds, s.styleIds) || (h = s.styleIds, l = !0));
2870
2875
  const I = i.children ?? [];
2871
2876
  let E = I, c = !1;
2872
- if (r?.removals && r.removals.length > 0 || r?.moves && r.moves.length > 0 || r?.inserts && r.inserts.length > 0) {
2877
+ if (s?.removals && s.removals.length > 0 || s?.moves && s.moves.length > 0 || s?.inserts && s.inserts.length > 0) {
2873
2878
  const f = E.slice();
2874
- if (r?.removals && r.removals.length > 0) {
2875
- const A = [...r.removals].sort((T, S) => S.index - T.index);
2879
+ if (s?.removals && s.removals.length > 0) {
2880
+ const A = [...s.removals].sort((T, S) => S.index - T.index);
2876
2881
  for (const T of A)
2877
2882
  T.index >= 0 && T.index < f.length && f.splice(T.index, 1);
2878
2883
  c = !0;
2879
2884
  }
2880
- if (r?.moves && r.moves.length > 0) {
2881
- const A = [...r.moves].sort((S, g) => S.toIndex - g.toIndex), T = /* @__PURE__ */ new Map();
2885
+ if (s?.moves && s.moves.length > 0) {
2886
+ const A = [...s.moves].sort((S, g) => S.toIndex - g.toIndex), T = /* @__PURE__ */ new Map();
2882
2887
  for (const S of A) {
2883
2888
  const g = f.findIndex(($) => $.id === S.nodeId);
2884
2889
  g >= 0 && (T.set(S.nodeId, f[g]), f.splice(g, 1));
@@ -2892,8 +2897,8 @@ function $t(e, t, s) {
2892
2897
  }
2893
2898
  c = !0;
2894
2899
  }
2895
- if (r?.inserts && r.inserts.length > 0) {
2896
- const A = [...r.inserts].sort((T, S) => T.index - S.index);
2900
+ if (s?.inserts && s.inserts.length > 0) {
2901
+ const A = [...s.inserts].sort((T, S) => T.index - S.index);
2897
2902
  for (const T of A) {
2898
2903
  const S = Math.min(T.index, f.length);
2899
2904
  f.splice(S, 0, T.node);
@@ -2917,99 +2922,99 @@ function $t(e, t, s) {
2917
2922
  }
2918
2923
  function b(e, t) {
2919
2924
  if (t.add(e.id), e.children)
2920
- for (const s of e.children)
2921
- b(s, t);
2925
+ for (const r of e.children)
2926
+ b(r, t);
2922
2927
  }
2923
2928
  const x = [];
2924
- function yn(e) {
2929
+ function Sn(e) {
2925
2930
  for (; x.length <= e; )
2926
2931
  x.push(/* @__PURE__ */ new Map());
2927
2932
  return x[e].clear(), x[e];
2928
2933
  }
2929
- function H(e, t, s) {
2930
- jt(e, t, s, 0);
2934
+ function H(e, t, r) {
2935
+ jt(e, t, r, 0);
2931
2936
  }
2932
- function jt(e, t, s, r) {
2937
+ function jt(e, t, r, s) {
2933
2938
  if (e === t)
2934
2939
  return;
2935
- (e.type !== t.type || !Sn(e.props, t.props) || !zt(e.styleIds, t.styleIds)) && s.add(t.id);
2940
+ (e.type !== t.type || !An(e.props, t.props) || !zt(e.styleIds, t.styleIds)) && r.add(t.id);
2936
2941
  const n = e.children ?? [], o = t.children ?? [];
2937
2942
  if (n !== o) {
2938
- const a = yn(r);
2943
+ const a = Sn(s);
2939
2944
  for (const h of n)
2940
2945
  a.set(h.id, h);
2941
2946
  let l = !1;
2942
2947
  for (const h of o) {
2943
2948
  const I = a.get(h.id);
2944
- I ? jt(I, h, s, r + 1) : (b(h, s), l = !0);
2949
+ I ? jt(I, h, r, s + 1) : (b(h, r), l = !0);
2945
2950
  }
2946
- (n.length !== o.length || l) && s.add(t.id);
2951
+ (n.length !== o.length || l) && r.add(t.id);
2947
2952
  }
2948
2953
  }
2949
- function Sn(e, t) {
2954
+ function An(e, t) {
2950
2955
  return k(e, t);
2951
2956
  }
2952
2957
  function Xt(e, t) {
2953
2958
  if (e.id === t)
2954
2959
  return e;
2955
2960
  if (e.children)
2956
- for (const s of e.children) {
2957
- const r = Xt(s, t);
2958
- if (r)
2959
- return r;
2961
+ for (const r of e.children) {
2962
+ const s = Xt(r, t);
2963
+ if (s)
2964
+ return s;
2960
2965
  }
2961
2966
  }
2962
2967
  function zt(e, t) {
2963
2968
  return k(e, t);
2964
2969
  }
2965
- function An(e, t) {
2970
+ function Nn(e, t) {
2966
2971
  if (e === t) return !0;
2967
2972
  if (!e || !t || e.length !== t.length) return !1;
2968
- for (let s = 0; s < e.length; s++) {
2969
- const r = e[s], i = t[s];
2970
- if (r.id !== i.id || r.actionId !== i.actionId || r.ordinal !== i.ordinal || r.baseVersion !== i.baseVersion)
2973
+ for (let r = 0; r < e.length; r++) {
2974
+ const s = e[r], i = t[r];
2975
+ if (s.id !== i.id || s.actionId !== i.actionId || s.ordinal !== i.ordinal || s.baseVersion !== i.baseVersion)
2971
2976
  return !1;
2972
2977
  }
2973
2978
  return !0;
2974
2979
  }
2975
- function Nn(e, t) {
2980
+ function wn(e, t) {
2976
2981
  if (t.length === 0)
2977
2982
  return e;
2978
- const s = [...t].sort((n, o) => n.start - o.start);
2979
- let r = e, i = 0;
2980
- for (const n of s) {
2981
- const o = at(n.start + i, 0, r.length);
2983
+ const r = [...t].sort((n, o) => n.start - o.start);
2984
+ let s = e, i = 0;
2985
+ for (const n of r) {
2986
+ const o = at(n.start + i, 0, s.length);
2982
2987
  if (n.end == null) {
2983
- const I = r.slice(o), E = Un(I, n.insertedText);
2984
- r = r.slice(0, o) + n.insertedText + I.slice(E), i += n.insertedText.length - E;
2988
+ const I = s.slice(o), E = Cn(I, n.insertedText);
2989
+ s = s.slice(0, o) + n.insertedText + I.slice(E), i += n.insertedText.length - E;
2985
2990
  continue;
2986
2991
  }
2987
- const a = n.end + i, l = at(a, o, r.length), h = l - o;
2988
- r = r.slice(0, o) + n.insertedText + r.slice(l), i += n.insertedText.length - h;
2992
+ const a = n.end + i, l = at(a, o, s.length), h = l - o;
2993
+ s = s.slice(0, o) + n.insertedText + s.slice(l), i += n.insertedText.length - h;
2989
2994
  }
2990
- return r;
2995
+ return s;
2991
2996
  }
2992
- function wn(e, t, s) {
2997
+ function Un(e, t, r) {
2993
2998
  if (t.length === 0)
2994
2999
  return { node: e, changed: !1 };
2995
- const r = /* @__PURE__ */ new Map();
3000
+ const s = /* @__PURE__ */ new Map();
2996
3001
  for (const i of t) {
2997
- const n = r.get(i.nodeId);
2998
- n ? n.push(i) : r.set(i.nodeId, [i]);
3002
+ const n = s.get(i.nodeId);
3003
+ n ? n.push(i) : s.set(i.nodeId, [i]);
2999
3004
  }
3000
- return Jt(e, r);
3005
+ return Jt(e, s);
3001
3006
  }
3002
- function Jt(e, t, s) {
3003
- const r = t.get(e.id) ?? [];
3007
+ function Jt(e, t, r) {
3008
+ const s = t.get(e.id) ?? [];
3004
3009
  let i = !1, n = e.props;
3005
- if (r.length > 0) {
3010
+ if (s.length > 0) {
3006
3011
  const h = /* @__PURE__ */ new Map();
3007
- for (const I of r) {
3012
+ for (const I of s) {
3008
3013
  const E = h.get(I.propertyName);
3009
3014
  E ? E.push(I) : h.set(I.propertyName, [I]);
3010
3015
  }
3011
3016
  for (const [I, E] of h.entries()) {
3012
- const c = n[I], _ = Nn(typeof c == "string" ? c : "", E);
3017
+ const c = n[I], _ = wn(typeof c == "string" ? c : "", E);
3013
3018
  i || (n = v(n), i = !0), n[I] = _;
3014
3019
  }
3015
3020
  }
@@ -3035,20 +3040,20 @@ function Jt(e, t, s) {
3035
3040
  changed: !0
3036
3041
  };
3037
3042
  }
3038
- function at(e, t, s) {
3039
- return Math.max(t, Math.min(s, e));
3043
+ function at(e, t, r) {
3044
+ return Math.max(t, Math.min(r, e));
3040
3045
  }
3041
- function Un(e, t) {
3042
- const s = Math.min(e.length, t.length);
3043
- let r = 0;
3044
- for (; r < s && e.charCodeAt(r) === t.charCodeAt(r); )
3045
- r++;
3046
- return r;
3046
+ function Cn(e, t) {
3047
+ const r = Math.min(e.length, t.length);
3048
+ let s = 0;
3049
+ for (; s < r && e.charCodeAt(s) === t.charCodeAt(s); )
3050
+ s++;
3051
+ return s;
3047
3052
  }
3048
3053
  function v(e) {
3049
- const t = {}, s = Object.keys(e);
3050
- for (let r = 0; r < s.length; r++) {
3051
- const i = s[r];
3054
+ const t = {}, r = Object.keys(e);
3055
+ for (let s = 0; s < r.length; s++) {
3056
+ const i = r[s];
3052
3057
  t[i] = e[i];
3053
3058
  }
3054
3059
  return t;
@@ -3062,25 +3067,25 @@ function k(e, t) {
3062
3067
  if (Array.isArray(e) && Array.isArray(t)) {
3063
3068
  if (e.length !== t.length)
3064
3069
  return !1;
3065
- for (let s = 0; s < e.length; s++)
3066
- if (!k(e[s], t[s]))
3070
+ for (let r = 0; r < e.length; r++)
3071
+ if (!k(e[r], t[r]))
3067
3072
  return !1;
3068
3073
  return !0;
3069
3074
  }
3070
3075
  if (q(e) && q(t)) {
3071
- const s = Object.keys(e), r = Object.keys(t);
3072
- if (s.length !== r.length)
3076
+ const r = Object.keys(e), s = Object.keys(t);
3077
+ if (r.length !== s.length)
3073
3078
  return !1;
3074
- for (const i of s)
3079
+ for (const i of r)
3075
3080
  if (!k(e[i], t[i]))
3076
3081
  return !1;
3077
3082
  return !0;
3078
3083
  }
3079
3084
  return !1;
3080
3085
  }
3081
- function Cn(e) {
3086
+ function Dn(e) {
3082
3087
  return new Worker(
3083
- "" + new URL("assets/ui-worker-9tm_v9mw.js", import.meta.url).href,
3088
+ "" + new URL("assets/ui-worker-BIfzqCdM.js", import.meta.url).href,
3084
3089
  {
3085
3090
  type: "module",
3086
3091
  name: e?.name
@@ -3088,10 +3093,10 @@ function Cn(e) {
3088
3093
  );
3089
3094
  }
3090
3095
  const R = qt("IkonUiCore");
3091
- class mn {
3096
+ class Ln {
3092
3097
  unsubscribeProtocolMessages;
3093
3098
  client = null;
3094
- uiStore = new Tn();
3099
+ uiStore = new yn();
3095
3100
  uiWorker = null;
3096
3101
  uiStyles = /* @__PURE__ */ new Map();
3097
3102
  uiUpdateListeners = /* @__PURE__ */ new Set();
@@ -3100,8 +3105,8 @@ class mn {
3100
3105
  uiStreamClearedListeners = /* @__PURE__ */ new Set();
3101
3106
  useUiWorker;
3102
3107
  constructor(t) {
3103
- const s = t?.threading?.uiWorker ?? "auto";
3104
- this.useUiWorker = s !== "disabled" && typeof Worker < "u", t?.client && this.initialize(t.client, t);
3108
+ const r = t?.threading?.uiWorker ?? "auto";
3109
+ this.useUiWorker = r !== "disabled" && typeof Worker < "u", t?.client && this.initialize(t.client, t);
3105
3110
  }
3106
3111
  dispose() {
3107
3112
  this.unsubscribeProtocolMessages?.(), this.uiWorker?.terminate(), this.uiWorker = null, this.client = null, this.uiStyleListeners.clear(), this.uiStyleDeleteListeners.clear(), this.uiStyles.clear();
@@ -3129,9 +3134,9 @@ class mn {
3129
3134
  getUiStyles() {
3130
3135
  return Array.from(this.uiStyles.values());
3131
3136
  }
3132
- initialize(t, s) {
3133
- this.client = t, this.useUiWorker && this.startUiWorker(s);
3134
- const r = {
3137
+ initialize(t, r) {
3138
+ this.client = t, this.useUiWorker && this.startUiWorker(r);
3139
+ const s = {
3135
3140
  opcodeGroupsMask: m.GROUP_CORE | m.GROUP_UI | m.GROUP_ACTIONS
3136
3141
  };
3137
3142
  this.unsubscribeProtocolMessages = t.subscribeToProtocolMessages((i) => {
@@ -3140,17 +3145,17 @@ class mn {
3140
3145
  return;
3141
3146
  }
3142
3147
  this.handleProtocolMessage(i);
3143
- }, r);
3148
+ }, s);
3144
3149
  }
3145
3150
  startUiWorker(t) {
3146
3151
  try {
3147
- this.uiWorker = new Cn();
3152
+ this.uiWorker = new Dn();
3148
3153
  } catch (i) {
3149
3154
  R.warn("Failed to create UI worker, falling back to main thread", i), this.uiWorker = null;
3150
3155
  return;
3151
3156
  }
3152
- const s = t?.threading?.flushIntervalMs, r = t?.threading?.maxLatencyMs;
3153
- this.uiWorker.postMessage({ type: "configure", flushIntervalMs: s, maxLatencyMs: r }), this.uiWorker.addEventListener("message", (i) => {
3157
+ const r = t?.threading?.flushIntervalMs, s = t?.threading?.maxLatencyMs;
3158
+ this.uiWorker.postMessage({ type: "configure", flushIntervalMs: r, maxLatencyMs: s }), this.uiWorker.addEventListener("message", (i) => {
3154
3159
  this.handleUiStoreOpBatch(i.data);
3155
3160
  }), this.uiWorker.addEventListener("error", (i) => {
3156
3161
  const n = [i.message, i.filename, i.lineno, i.colno].filter((o) => o != null && String(o).length > 0);
@@ -3161,36 +3166,36 @@ class mn {
3161
3166
  for (const t of this.uiStore.getSnapshots()) {
3162
3167
  if (!t.rootViewId)
3163
3168
  continue;
3164
- const s = t.views.get(t.rootViewId);
3165
- if (!s)
3169
+ const r = t.views.get(t.rootViewId);
3170
+ if (!r)
3166
3171
  continue;
3167
- const r = {
3172
+ const s = {
3168
3173
  snapshot: {
3169
3174
  type: "full",
3170
3175
  version: t.version ?? 0,
3171
3176
  metadata: { viewId: t.rootViewId },
3172
- root: s
3177
+ root: r
3173
3178
  },
3174
3179
  payloads: t.payloads
3175
3180
  };
3176
- this.uiStore.apply(t.streamId, r);
3181
+ this.uiStore.apply(t.streamId, s);
3177
3182
  }
3178
3183
  }
3179
3184
  forwardMessageToWorker(t) {
3180
3185
  if (this.uiWorker)
3181
3186
  try {
3182
- const s = t.slice().buffer;
3183
- this.uiWorker.postMessage({ type: "protocol", message: s }, [s]);
3184
- } catch (s) {
3185
- R.warn("Failed to forward message to UI worker", s);
3187
+ const r = t.slice().buffer;
3188
+ this.uiWorker.postMessage({ type: "protocol", message: r }, [r]);
3189
+ } catch (r) {
3190
+ R.warn("Failed to forward message to UI worker", r);
3186
3191
  }
3187
3192
  }
3188
3193
  handleUiStoreOpBatch(t) {
3189
- for (const s of t.ops)
3190
- this.applyUiStoreOp(s);
3194
+ for (const r of t.ops)
3195
+ this.applyUiStoreOp(r);
3191
3196
  if (t.acks && t.acks.length > 0)
3192
- for (const s of t.acks)
3193
- this.sendUiUpdateAck(s.trackId, s.version, s.senderId);
3197
+ for (const r of t.acks)
3198
+ this.sendUiUpdateAck(r.trackId, r.version, r.senderId);
3194
3199
  }
3195
3200
  applyUiStoreOp(t) {
3196
3201
  if (t.type === "UpsertUiStyle") {
@@ -3216,7 +3221,7 @@ class mn {
3216
3221
  if (t.type === "ReplaceStreamSnapshot" || t.type === "PatchStreamSnapshot") {
3217
3222
  if (!this.uiStore.applyStoreOp(t))
3218
3223
  return;
3219
- const r = t.type === "ReplaceStreamSnapshot" ? t.snapshot.streamId : t.streamId, i = this.uiStore.getSnapshot(r);
3224
+ const s = t.type === "ReplaceStreamSnapshot" ? t.snapshot.streamId : t.streamId, i = this.uiStore.getSnapshot(s);
3220
3225
  if (!i?.rootViewId)
3221
3226
  return;
3222
3227
  const n = i.views.get(i.rootViewId);
@@ -3231,7 +3236,7 @@ class mn {
3231
3236
  },
3232
3237
  payloads: i.payloads
3233
3238
  };
3234
- this.notifyUiUpdate(r, o);
3239
+ this.notifyUiUpdate(s, o);
3235
3240
  return;
3236
3241
  }
3237
3242
  }
@@ -3260,89 +3265,89 @@ class mn {
3260
3265
  }
3261
3266
  }
3262
3267
  handleGlobalState(t) {
3263
- Rr(t).then((s) => {
3264
- const r = /* @__PURE__ */ new Set();
3265
- for (const i of Object.values(s.UIStreams ?? {}))
3266
- r.add(i.StreamId), this.uiStore.setCategory(i.StreamId, i.Info?.Category);
3268
+ ms(t).then((r) => {
3269
+ const s = /* @__PURE__ */ new Set();
3270
+ for (const i of Object.values(r.UIStreams ?? {}))
3271
+ s.add(i.StreamId), this.uiStore.setCategory(i.StreamId, i.Info?.Category);
3267
3272
  for (const i of this.uiStore.getSnapshots())
3268
- r.has(i.streamId) || (this.uiStore.remove(i.streamId), this.notifyUiStreamCleared(i.streamId));
3269
- }).catch((s) => {
3270
- R.error("Failed to handle global state", s);
3273
+ s.has(i.streamId) || (this.uiStore.remove(i.streamId), this.notifyUiStreamCleared(i.streamId));
3274
+ }).catch((r) => {
3275
+ R.error("Failed to handle global state", r);
3271
3276
  });
3272
3277
  }
3273
3278
  handleUiUpdate(t) {
3274
- const s = nt(t), r = `${s.senderId}_${s.trackId}`;
3275
- qi(t).then((i) => {
3276
- const n = _n(i);
3277
- this.notifyUiUpdate(r, n), this.uiStore.apply(r, n), this.sendUiUpdateAck(s.trackId, n.snapshot.version, s.senderId);
3279
+ const r = nt(t), s = `${r.senderId}_${r.trackId}`;
3280
+ Qi(t).then((i) => {
3281
+ const n = fn(i);
3282
+ this.notifyUiUpdate(s, n), this.uiStore.apply(s, n), this.sendUiUpdateAck(r.trackId, n.snapshot.version, r.senderId);
3278
3283
  }).catch((i) => {
3279
3284
  i instanceof D ? R.warn("Failed to parse UI update", i.causeError ?? i) : R.error("Failed to apply UI update", i);
3280
3285
  });
3281
3286
  }
3282
3287
  handleUiStyles(t) {
3283
- Ai(t).then((s) => {
3284
- if (!s.StyleId) return;
3285
- const r = {
3286
- styleId: s.StyleId,
3287
- css: s.Style?.css,
3288
- common: s.Style?.common
3288
+ Ni(t).then((r) => {
3289
+ if (!r.StyleId) return;
3290
+ const s = {
3291
+ styleId: r.StyleId,
3292
+ css: r.Style?.css,
3293
+ common: r.Style?.common
3289
3294
  };
3290
- this.uiStyles.set(r.styleId, r), this.notifyUiStyle(r);
3291
- }).catch((s) => {
3292
- R.error("Failed to handle UI styles", s);
3295
+ this.uiStyles.set(s.styleId, s), this.notifyUiStyle(s);
3296
+ }).catch((r) => {
3297
+ R.error("Failed to handle UI styles", r);
3293
3298
  });
3294
3299
  }
3295
3300
  handleUiStylesBatch(t) {
3296
- Li(t).then((s) => {
3297
- if (s.Styles)
3298
- for (const r of s.Styles) {
3299
- if (!r.StyleId) continue;
3301
+ gi(t).then((r) => {
3302
+ if (r.Styles)
3303
+ for (const s of r.Styles) {
3304
+ if (!s.StyleId) continue;
3300
3305
  const i = {
3301
- styleId: r.StyleId,
3302
- css: r.Style?.css,
3303
- common: r.Style?.common
3306
+ styleId: s.StyleId,
3307
+ css: s.Style?.css,
3308
+ common: s.Style?.common
3304
3309
  };
3305
3310
  this.uiStyles.set(i.styleId, i), this.notifyUiStyle(i);
3306
3311
  }
3307
- }).catch((s) => {
3308
- R.error("Failed to handle UI styles batch", s);
3312
+ }).catch((r) => {
3313
+ R.error("Failed to handle UI styles batch", r);
3309
3314
  });
3310
3315
  }
3311
3316
  handleUiStylesDelete(t) {
3312
- Hi(t).then((s) => {
3313
- if (!(!s.StyleIds || s.StyleIds.length === 0)) {
3314
- for (const r of s.StyleIds)
3315
- this.uiStyles.delete(r);
3316
- this.notifyUiStyleDelete(s.StyleIds);
3317
- }
3318
- }).catch((s) => {
3319
- R.error("Failed to handle UI styles delete", s);
3317
+ Wi(t).then((r) => {
3318
+ if (!(!r.StyleIds || r.StyleIds.length === 0)) {
3319
+ for (const s of r.StyleIds)
3320
+ this.uiStyles.delete(s);
3321
+ this.notifyUiStyleDelete(r.StyleIds);
3322
+ }
3323
+ }).catch((r) => {
3324
+ R.error("Failed to handle UI styles delete", r);
3320
3325
  });
3321
3326
  }
3322
3327
  handleClearStream(t) {
3323
- const s = nt(t), r = `${s.senderId}_${s.trackId}`;
3324
- this.uiStore.clear(r), this.notifyUiStreamCleared(r);
3328
+ const r = nt(t), s = `${r.senderId}_${r.trackId}`;
3329
+ this.uiStore.clear(s), this.notifyUiStreamCleared(s);
3325
3330
  }
3326
- notifyUiUpdate(t, s) {
3327
- for (const r of this.uiUpdateListeners)
3328
- r(t, s);
3331
+ notifyUiUpdate(t, r) {
3332
+ for (const s of this.uiUpdateListeners)
3333
+ s(t, r);
3329
3334
  }
3330
3335
  notifyUiStyle(t) {
3331
- for (const s of this.uiStyleListeners)
3332
- s(t);
3336
+ for (const r of this.uiStyleListeners)
3337
+ r(t);
3333
3338
  }
3334
3339
  notifyUiStyleDelete(t) {
3335
- for (const s of this.uiStyleDeleteListeners)
3336
- s(t);
3340
+ for (const r of this.uiStyleDeleteListeners)
3341
+ r(t);
3337
3342
  }
3338
3343
  notifyUiStreamCleared(t) {
3339
- for (const s of this.uiStreamClearedListeners)
3340
- s(t);
3344
+ for (const r of this.uiStreamClearedListeners)
3345
+ r(t);
3341
3346
  }
3342
- sendUiUpdateAck(t, s, r) {
3343
- if (this.client && !(!Number.isFinite(s) || s < 0))
3347
+ sendUiUpdateAck(t, r, s) {
3348
+ if (this.client && !(!Number.isFinite(r) || r < 0))
3344
3349
  try {
3345
- const i = r !== void 0 ? { trackId: t, targetIds: [r] } : { trackId: t }, n = rn({ Version: s }, this.client.sessionId ?? 0, i);
3350
+ const i = s !== void 0 ? { trackId: t, targetIds: [s] } : { trackId: t }, n = nn({ Version: r }, this.client.sessionId ?? 0, i);
3346
3351
  this.client.sendProtocolMessage(n);
3347
3352
  } catch (i) {
3348
3353
  R.warn("Failed to send UI update ack", i);
@@ -3350,10 +3355,10 @@ class mn {
3350
3355
  }
3351
3356
  }
3352
3357
  export {
3353
- fn as HandlerCache,
3354
- mn as IkonUiCore,
3355
- Tn as UiStore,
3356
- dn as UiStreamStore,
3358
+ dn as HandlerCache,
3359
+ Ln as IkonUiCore,
3360
+ yn as UiStore,
3361
+ Tn as UiStreamStore,
3357
3362
  D as UiUpdateParseError,
3358
- _n as parseUiUpdate
3363
+ fn as parseUiUpdate
3359
3364
  };