@ikonai/sdk-ui 0.0.29 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,33 @@
1
- function zt(t) {
1
+ function Jt(t) {
2
2
  if (t.length < 8)
3
3
  throw new Error("Protocol message too short");
4
4
  return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
5
5
  }
6
- function q(t) {
7
- const e = H(t), s = new DataView(e.buffer, e.byteOffset, e.byteLength);
6
+ function Q(t) {
7
+ const e = x(t), s = new DataView(e.buffer, e.byteOffset, e.byteLength);
8
8
  if (e.length < 27)
9
9
  throw new Error("Protocol payload too short");
10
- const r = s.getUint32(0, !0), n = s.getUint32(4, !0), i = s.getUint32(8, !0), o = s.getUint32(12, !0), a = s.getUint32(16, !0), I = s.getUint32(20, !0), E = s.getUint8(24), l = s.getUint8(25), c = s.getUint8(26);
11
- if (27 + I * 4 > e.length)
10
+ const r = s.getUint32(0, !0), n = s.getUint32(4, !0), i = s.getUint32(8, !0), o = s.getUint32(12, !0), a = s.getUint32(16, !0), l = s.getUint32(20, !0), I = s.getUint8(24), c = s.getUint8(25), E = s.getUint8(26);
11
+ if (27 + l * 4 > e.length)
12
12
  throw new Error("Protocol header exceeds payload length");
13
- const u = [];
13
+ const h = [];
14
14
  let T = 27;
15
- for (let f = 0; f < I; f++)
16
- u.push(s.getUint32(T, !0)), T += 4;
15
+ for (let f = 0; f < l; f++)
16
+ h.push(s.getUint32(T, !0)), T += 4;
17
17
  return {
18
18
  length: r,
19
19
  opcode: n,
20
20
  senderId: i,
21
21
  trackId: o,
22
22
  sequenceId: a,
23
- targetIds: u,
24
- payloadVersion: E,
25
- payloadType: l,
26
- flags: c
23
+ targetIds: h,
24
+ payloadVersion: I,
25
+ payloadType: c,
26
+ flags: E
27
27
  };
28
28
  }
29
- function K(t, e, s) {
30
- const r = H(t), n = q(r);
29
+ function X(t, e, s) {
30
+ const r = x(t), n = Q(r);
31
31
  if (e !== void 0 && n.opcode !== e)
32
32
  throw new Error(`Unexpected opcode ${n.opcode}`);
33
33
  if (s !== void 0 && n.payloadVersion !== s)
@@ -38,30 +38,30 @@ function K(t, e, s) {
38
38
  return r.subarray(i, n.length);
39
39
  }
40
40
  var g = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(g || {});
41
- const Wt = 161, Jt = 162;
41
+ const qt = 161, Qt = 162;
42
42
  new TextEncoder();
43
- const qt = new TextDecoder("utf-8", { fatal: !0 });
44
- class D {
43
+ const Zt = new TextDecoder("utf-8", { fatal: !0 });
44
+ class R {
45
45
  constructor(e, s, r) {
46
46
  this.buffer = e, this.version = s, this.offset = r, this.end = e.length - 1;
47
47
  }
48
48
  offset;
49
49
  end;
50
50
  static create(e) {
51
- const s = H(e);
51
+ const s = x(e);
52
52
  if (s.length < 2)
53
53
  throw new Error("Teleport payload too short");
54
- if (s[0] !== Wt || s[s.length - 1] !== Jt)
54
+ if (s[0] !== qt || s[s.length - 1] !== Qt)
55
55
  throw new Error("Teleport object missing markers");
56
56
  const r = { offset: 1 }, n = d(s, r, "InvalidLength");
57
- return new D(s, n, r.offset);
57
+ return new R(s, n, r.offset);
58
58
  }
59
59
  next() {
60
60
  if (this.offset >= this.end)
61
61
  return null;
62
62
  if (this.offset + 5 > this.buffer.length)
63
63
  throw new Error("Teleport object truncated");
64
- const e = ee(this.buffer, this.offset);
64
+ const e = re(this.buffer, this.offset);
65
65
  this.offset += 4;
66
66
  const s = this.buffer[this.offset++], r = s >> 4 & 15;
67
67
  if ((s & 15) !== 0)
@@ -74,7 +74,7 @@ class D {
74
74
  const o = { offset: this.offset }, a = d(this.buffer, o, "InvalidLength");
75
75
  A(this.buffer, o.offset, a), i = this.buffer.subarray(o.offset, o.offset + a), this.offset = o.offset + a;
76
76
  }
77
- return new Qt(e, r, i);
77
+ return new te(e, r, i);
78
78
  }
79
79
  }
80
80
  class w {
@@ -139,38 +139,38 @@ class w {
139
139
  return this.ensureType(
140
140
  12
141
141
  /* String */
142
- ), qt.decode(this.payload);
142
+ ), Zt.decode(this.payload);
143
143
  }
144
144
  asGuid() {
145
145
  return this.ensureType(
146
146
  14
147
147
  /* Guid */
148
- ), h.fromBytes(this.payload);
148
+ ), u.fromBytes(this.payload);
149
149
  }
150
150
  asObject() {
151
151
  return this.ensureType(
152
152
  11
153
153
  /* Object */
154
- ), D.create(this.payload);
154
+ ), R.create(this.payload);
155
155
  }
156
156
  asArray() {
157
157
  return this.ensureType(
158
158
  9
159
159
  /* Array */
160
- ), Q.create(this.payload);
160
+ ), Z.create(this.payload);
161
161
  }
162
162
  asDictionary() {
163
163
  return this.ensureType(
164
164
  10
165
165
  /* Dict */
166
- ), Z.create(this.payload);
166
+ ), tt.create(this.payload);
167
167
  }
168
168
  ensureType(e) {
169
169
  if (this.type !== e)
170
170
  throw new Error(`Teleport value has type ${g[this.type]}, expected ${g[e]}`);
171
171
  }
172
172
  }
173
- class Qt extends w {
173
+ class te extends w {
174
174
  constructor(e, s, r) {
175
175
  super(s, r), this.fieldId = e;
176
176
  }
@@ -178,7 +178,7 @@ class Qt extends w {
178
178
  return this.type === 1;
179
179
  }
180
180
  }
181
- class Q {
181
+ class Z {
182
182
  payload;
183
183
  elementType;
184
184
  count;
@@ -194,7 +194,7 @@ class Q {
194
194
  this.count = d(e, r, "ArrayMalformed"), this.offset = r.offset;
195
195
  }
196
196
  static create(e) {
197
- return new Q(H(e));
197
+ return new Z(x(e));
198
198
  }
199
199
  next() {
200
200
  if (this.index >= this.count) {
@@ -218,40 +218,40 @@ class Q {
218
218
  const e = P(this.elementType);
219
219
  A(this.payload, this.offset, e);
220
220
  const s = this.payload.subarray(this.offset, this.offset + e);
221
- return this.offset += e, new p(this.elementType, s);
221
+ return this.offset += e, new F(this.elementType, s);
222
222
  }
223
223
  case 12:
224
224
  case 13: {
225
225
  const e = { offset: this.offset }, s = d(this.payload, e, "ArrayMalformed");
226
226
  A(this.payload, e.offset, s);
227
227
  const r = this.payload.subarray(e.offset, e.offset + s);
228
- return this.offset = e.offset + s, new p(this.elementType, r);
228
+ return this.offset = e.offset + s, new F(this.elementType, r);
229
229
  }
230
230
  case 11: {
231
231
  const e = { offset: this.offset }, s = d(this.payload, e, "ArrayMalformed");
232
232
  A(this.payload, e.offset, s);
233
233
  const r = this.payload.subarray(e.offset, e.offset + s);
234
- return this.offset = e.offset + s, new p(11, r);
234
+ return this.offset = e.offset + s, new F(11, r);
235
235
  }
236
236
  case 9: {
237
- const e = tt(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + e);
238
- return this.offset += e, new p(9, s);
237
+ const e = et(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + e);
238
+ return this.offset += e, new F(9, s);
239
239
  }
240
240
  case 10: {
241
- const e = et(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + e);
242
- return this.offset += e, new p(10, s);
241
+ const e = st(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + e);
242
+ return this.offset += e, new F(10, s);
243
243
  }
244
244
  default:
245
245
  throw new Error(`Unsupported array element type ${g[this.elementType]}`);
246
246
  }
247
247
  }
248
248
  }
249
- class p extends w {
249
+ class F extends w {
250
250
  constructor(e, s) {
251
251
  super(e, s);
252
252
  }
253
253
  }
254
- class Z {
254
+ class tt {
255
255
  payload;
256
256
  keyType;
257
257
  valueType;
@@ -263,12 +263,12 @@ class Z {
263
263
  throw new Error("Dictionary payload too short");
264
264
  if (this.keyType = e[0] >> 4 & 15, this.valueType = e[1] >> 4 & 15, (e[0] & 15) !== 0 || (e[1] & 15) !== 0)
265
265
  throw new Error("Dictionary key/value flags must be zero");
266
- lt(this.keyType);
266
+ It(this.keyType);
267
267
  const s = { offset: 2 };
268
268
  this.count = d(e, s, "DictMalformed"), this.offset = s.offset;
269
269
  }
270
270
  static create(e) {
271
- return new Z(H(e));
271
+ return new tt(x(e));
272
272
  }
273
273
  next() {
274
274
  if (this.index >= this.count) {
@@ -277,7 +277,7 @@ class Z {
277
277
  return null;
278
278
  }
279
279
  const e = this.readKey(), s = this.readValue();
280
- return this.index++, new Zt(e, s);
280
+ return this.index++, new ee(e, s);
281
281
  }
282
282
  readKey() {
283
283
  const e = P(this.keyType);
@@ -310,11 +310,11 @@ class Z {
310
310
  return this.offset = e.offset + s, new w(11, r);
311
311
  }
312
312
  case 9: {
313
- const e = tt(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + e);
313
+ const e = et(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + e);
314
314
  return this.offset += e, new w(9, s);
315
315
  }
316
316
  case 10: {
317
- const e = et(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + e);
317
+ const e = st(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + e);
318
318
  return this.offset += e, new w(10, s);
319
319
  }
320
320
  case 3:
@@ -336,12 +336,12 @@ class Z {
336
336
  }
337
337
  }
338
338
  }
339
- class Zt {
339
+ class ee {
340
340
  constructor(e, s) {
341
341
  this.key = e, this.value = s;
342
342
  }
343
343
  }
344
- class h {
344
+ class u {
345
345
  constructor(e) {
346
346
  this.bytes = e;
347
347
  }
@@ -351,19 +351,19 @@ class h {
351
351
  const s = e.replace(/-/g, "");
352
352
  if (s.length !== 32)
353
353
  throw new Error("Guid string must be 32 hex characters");
354
- const r = new Uint8Array(16), n = h.parseHexSlice(s, 0, 8), i = h.parseHexSlice(s, 8, 4), o = h.parseHexSlice(s, 12, 4);
355
- h.writeUInt32LE(r, 0, n), h.writeUInt16LE(r, 4, i), h.writeUInt16LE(r, 6, o);
354
+ const r = new Uint8Array(16), n = u.parseHexSlice(s, 0, 8), i = u.parseHexSlice(s, 8, 4), o = u.parseHexSlice(s, 12, 4);
355
+ u.writeUInt32LE(r, 0, n), u.writeUInt16LE(r, 4, i), u.writeUInt16LE(r, 6, o);
356
356
  for (let a = 0; a < 8; a++)
357
- r[8 + a] = h.parseHexSlice(s, 16 + a * 2, 2);
358
- return new h(r);
357
+ r[8 + a] = u.parseHexSlice(s, 16 + a * 2, 2);
358
+ return new u(r);
359
359
  }
360
360
  static fromBytes(e) {
361
361
  if (e.length !== 16)
362
362
  throw new Error("Guid byte array must be 16 bytes");
363
- return new h(Uint8Array.from(e));
363
+ return new u(Uint8Array.from(e));
364
364
  }
365
365
  static createZero() {
366
- return new h(new Uint8Array(16));
366
+ return new u(new Uint8Array(16));
367
367
  }
368
368
  static createRandom() {
369
369
  const e = new Uint8Array(16), s = globalThis.crypto;
@@ -372,16 +372,16 @@ class h {
372
372
  else
373
373
  for (let r = 0; r < e.length; r++)
374
374
  e[r] = Math.floor(Math.random() * 256);
375
- return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new h(e);
375
+ return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new u(e);
376
376
  }
377
377
  toString() {
378
378
  const e = this.bytes;
379
379
  return [
380
- h.toHex(h.readUInt32LE(e, 0), 8),
381
- h.toHex(h.readUInt16LE(e, 4), 4),
382
- h.toHex(h.readUInt16LE(e, 6), 4),
383
- it(e.subarray(8, 10)),
384
- it(e.subarray(10, 16))
380
+ u.toHex(u.readUInt32LE(e, 0), 8),
381
+ u.toHex(u.readUInt16LE(e, 4), 4),
382
+ u.toHex(u.readUInt16LE(e, 6), 4),
383
+ ot(e.subarray(8, 10)),
384
+ ot(e.subarray(10, 16))
385
385
  ].join("-");
386
386
  }
387
387
  asBytes() {
@@ -418,7 +418,7 @@ function d(t, e, s) {
418
418
  for (; e.offset < t.length; ) {
419
419
  const o = t[e.offset++];
420
420
  if (i++, r |= (o & 127) << n, (o & 128) === 0) {
421
- if (i !== te(r))
421
+ if (i !== se(r))
422
422
  throw new Error("Teleport VarUInt is not canonical");
423
423
  return r >>> 0;
424
424
  }
@@ -427,7 +427,7 @@ function d(t, e, s) {
427
427
  }
428
428
  throw new Error(s);
429
429
  }
430
- function te(t) {
430
+ function se(t) {
431
431
  return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
432
432
  }
433
433
  function P(t) {
@@ -450,7 +450,7 @@ function P(t) {
450
450
  return -1;
451
451
  }
452
452
  }
453
- function lt(t) {
453
+ function It(t) {
454
454
  if (t === 9 || t === 11 || t === 10 || t === 1)
455
455
  throw new Error("Dictionary keys must be primitive Teleport types");
456
456
  }
@@ -458,10 +458,10 @@ function A(t, e, s) {
458
458
  if (e < 0 || s < 0 || e + s > t.length)
459
459
  throw new Error("Teleport payload exceeds bounds");
460
460
  }
461
- function ee(t, e) {
461
+ function re(t, e) {
462
462
  return (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0;
463
463
  }
464
- function tt(t, e) {
464
+ function et(t, e) {
465
465
  if (e >= t.length)
466
466
  throw new Error("Array payload exceeds bounds");
467
467
  const s = t[e], r = s >> 4 & 15;
@@ -469,28 +469,28 @@ function tt(t, e) {
469
469
  throw new Error("Array flags must be zero");
470
470
  const n = { offset: e + 1 }, i = d(t, n, "ArrayMalformed"), o = P(r);
471
471
  if (o >= 0) {
472
- const I = o * i;
473
- return A(t, n.offset, I), n.offset + I - e;
472
+ const l = o * i;
473
+ return A(t, n.offset, l), n.offset + l - e;
474
474
  }
475
475
  let a = n.offset;
476
- for (let I = 0; I < i; I++)
477
- a = X(r, t, a, "ArrayMalformed");
476
+ for (let l = 0; l < i; l++)
477
+ a = z(r, t, a, "ArrayMalformed");
478
478
  return a - e;
479
479
  }
480
- function et(t, e) {
480
+ function st(t, e) {
481
481
  if (e + 2 > t.length)
482
482
  throw new Error("Dictionary payload too short");
483
483
  const s = t[e] >> 4 & 15, r = t[e + 1] >> 4 & 15;
484
484
  if ((t[e] & 15) !== 0 || (t[e + 1] & 15) !== 0)
485
485
  throw new Error("Dictionary key/value flags must be zero");
486
- lt(s);
486
+ It(s);
487
487
  const n = { offset: e + 2 }, i = d(t, n, "DictMalformed");
488
488
  let o = n.offset;
489
489
  for (let a = 0; a < i; a++)
490
- o = X(s, t, o, "DictMalformed"), o = X(r, t, o, "DictMalformed");
490
+ o = z(s, t, o, "DictMalformed"), o = z(r, t, o, "DictMalformed");
491
491
  return o - e;
492
492
  }
493
- function X(t, e, s, r) {
493
+ function z(t, e, s, r) {
494
494
  const n = P(t);
495
495
  if (n >= 0)
496
496
  return A(e, s, n), s + n;
@@ -505,202 +505,202 @@ function X(t, e, s, r) {
505
505
  return A(e, i.offset, o), i.offset + o;
506
506
  }
507
507
  case 9:
508
- return s + tt(e, s);
509
- case 10:
510
508
  return s + et(e, s);
509
+ case 10:
510
+ return s + st(e, s);
511
511
  default:
512
512
  throw new Error(`Unsupported Teleport type ${g[t]}`);
513
513
  }
514
514
  }
515
- function it(t) {
515
+ function ot(t) {
516
516
  return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
517
517
  }
518
- function H(t) {
518
+ function x(t) {
519
519
  return t instanceof Uint8Array ? t : new Uint8Array(t);
520
520
  }
521
- var It = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(It || {}), ct = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MobileWeb = 1] = "MobileWeb", t[t.MobileApp = 2] = "MobileApp", t[t.DesktopWeb = 3] = "DesktopWeb", t[t.DesktopApp = 4] = "DesktopApp", t))(ct || {}), Et = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Backend = 2] = "Backend", t[t.Server = 4] = "Server", t[t.Plugin = 8] = "Plugin", t[t.Browser = 16] = "Browser", t))(Et || {}), _t = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MessagePack = 1] = "MessagePack", t[t.MemoryPack = 2] = "MemoryPack", t[t.Json = 4] = "Json", t[t.Teleport = 8] = "Teleport", t[t.All = 15] = "All", t))(_t || {}), ft = /* @__PURE__ */ ((t) => (t[t.Face = 0] = "Face", t[t.Hands = 1] = "Hands", t[t.Pose = 2] = "Pose", t[t.All = 3] = "All", t))(ft || {}), ut = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Machine = 1] = "Machine", t[t.Human = 2] = "Human", t))(ut || {}), ht = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Hevc = 2] = "Hevc", t[t.Vp8 = 3] = "Vp8", t))(ht || {}), Tt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.DotNet = 1] = "DotNet", t[t.TypeScript = 2] = "TypeScript", t[t.Cpp = 3] = "Cpp", t))(Tt || {}), m = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(m || {});
522
- const se = 1368629611, re = 2431514951, ne = 2914494629, ie = 3284746250, oe = 4101844078;
523
- function Nt(t) {
521
+ var ct = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(ct || {}), Et = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MobileWeb = 1] = "MobileWeb", t[t.MobileApp = 2] = "MobileApp", t[t.DesktopWeb = 3] = "DesktopWeb", t[t.DesktopApp = 4] = "DesktopApp", t))(Et || {}), _t = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Backend = 2] = "Backend", t[t.Server = 4] = "Server", t[t.Plugin = 8] = "Plugin", t[t.Browser = 16] = "Browser", t))(_t || {}), ft = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MessagePack = 1] = "MessagePack", t[t.MemoryPack = 2] = "MemoryPack", t[t.Json = 4] = "Json", t[t.Teleport = 8] = "Teleport", t[t.All = 15] = "All", t))(ft || {}), ht = /* @__PURE__ */ ((t) => (t[t.Face = 0] = "Face", t[t.Hands = 1] = "Hands", t[t.Pose = 2] = "Pose", t[t.All = 3] = "All", t))(ht || {}), ut = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Machine = 1] = "Machine", t[t.Human = 2] = "Human", t))(ut || {}), Tt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Hevc = 2] = "Hevc", t[t.Vp8 = 3] = "Vp8", t))(Tt || {}), Nt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.DotNet = 1] = "DotNet", t[t.TypeScript = 2] = "TypeScript", t[t.Cpp = 3] = "Cpp", t))(Nt || {}), L = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(L || {});
522
+ const ne = 1368629611, ie = 2431514951, oe = 2914494629, ae = 3284746250, le = 4101844078;
523
+ function At(t) {
524
524
  const e = {};
525
- return At(e), e;
525
+ return St(e), e;
526
526
  }
527
- function At(t) {
528
- return t.Description = "", t.Codec = It.Unknown, t.SampleRate = 0, t.Channels = 0, t.BitDepth = 0, t;
527
+ function St(t) {
528
+ return t.Description = "", t.Codec = ct.Unknown, t.SampleRate = 0, t.Channels = 0, t.BitDepth = 0, t;
529
529
  }
530
- function ae(t, e) {
531
- const s = e ?? Nt();
532
- return At(s), le(t, s), s;
530
+ function Ie(t, e) {
531
+ const s = e ?? At();
532
+ return St(s), ce(t, s), s;
533
533
  }
534
- function le(t, e) {
534
+ function ce(t, e) {
535
535
  let s;
536
536
  for (; (s = t.next()) !== null; )
537
537
  switch (s.fieldId) {
538
- case se: {
538
+ case ne: {
539
539
  if (s.isNull) throw new Error();
540
540
  e.Description = s.asString();
541
541
  break;
542
542
  }
543
- case re: {
543
+ case ie: {
544
544
  if (s.isNull) throw new Error();
545
545
  e.Channels = s.asInt32();
546
546
  break;
547
547
  }
548
- case ne: {
548
+ case oe: {
549
549
  if (s.isNull) throw new Error();
550
550
  e.BitDepth = s.asInt32();
551
551
  break;
552
552
  }
553
- case ie: {
553
+ case ae: {
554
554
  if (s.isNull) throw new Error();
555
555
  e.Codec = s.asInt32();
556
556
  break;
557
557
  }
558
- case oe: {
558
+ case le: {
559
559
  if (s.isNull) throw new Error();
560
560
  e.SampleRate = s.asInt32();
561
561
  break;
562
562
  }
563
563
  }
564
564
  }
565
- const Ie = 76337612, ce = 185396121, Ee = 388632637, _e = 417197284, fe = 469070965, ue = 470595159, he = 781727218, Te = 834078886, Ne = 1043273762, Ae = 1236999138, Se = 1368629611, de = 1715899485, ye = 1942830531, Ce = 1999510636, we = 2079864626, Ue = 2142346422, Re = 2598291686, De = 2719718823, Le = 2810953526, me = 2840065720, Oe = 2885165957, ge = 3586157513, Pe = 3717933110, be = 4062655306;
566
- function Fe(t) {
565
+ const Ee = 76337612, _e = 185396121, fe = 388632637, he = 417197284, ue = 469070965, Te = 470595159, Ne = 781727218, Ae = 834078886, Se = 1043273762, de = 1236999138, ye = 1368629611, Ce = 1715899485, we = 1942830531, Ue = 1999510636, De = 2079864626, Re = 2142346422, me = 2598291686, Le = 2719718823, Oe = 2810953526, ge = 2840065720, Pe = 2885165957, be = 3586157513, pe = 3717933110, Fe = 4062655306;
566
+ function ve(t) {
567
567
  const e = {};
568
- return St(e), e;
569
- }
570
- function St(t) {
571
- return t.ContextType = Et.Unknown, t.UserType = ut.Unknown, t.PayloadType = _t.Unknown, t.Description = "", t.UserId = "", t.DeviceId = "", t.ProductId = "", t.VersionId = "", t.InstallId = "", t.Locale = "", t.SessionId = -1, t.IsInternal = !1, t.IsReady = !1, t.HasInput = !1, t.ChannelLocale = "", t.EmbeddedSpaceId = "", t.AuthSessionId = "", t.ReceiveAllMessages = !1, t.PreciseJoinedAt = 0n, t.UserAgent = "", t.ClientType = ct.Unknown, t.UniqueSessionId = "", t.Parameters = /* @__PURE__ */ Object.create(null), t.SdkType = Tt.Unknown, t;
568
+ return dt(e), e;
572
569
  }
573
- function pe(t, e) {
574
- const s = e ?? Fe();
575
- return St(s), Me(t, s), s;
570
+ function dt(t) {
571
+ return t.ContextType = _t.Unknown, t.UserType = ut.Unknown, t.PayloadType = ft.Unknown, t.Description = "", t.UserId = "", t.DeviceId = "", t.ProductId = "", t.VersionId = "", t.InstallId = "", t.Locale = "", t.SessionId = -1, t.IsInternal = !1, t.IsReady = !1, t.HasInput = !1, t.ChannelLocale = "", t.EmbeddedSpaceId = "", t.AuthSessionId = "", t.ReceiveAllMessages = !1, t.PreciseJoinedAt = 0n, t.UserAgent = "", t.ClientType = Et.Unknown, t.UniqueSessionId = "", t.Parameters = /* @__PURE__ */ Object.create(null), t.SdkType = Nt.Unknown, t;
576
572
  }
577
573
  function Me(t, e) {
574
+ const s = e ?? ve();
575
+ return dt(s), Ve(t, s), s;
576
+ }
577
+ function Ve(t, e) {
578
578
  let s;
579
579
  for (; (s = t.next()) !== null; )
580
580
  switch (s.fieldId) {
581
- case Ie: {
581
+ case Ee: {
582
582
  if (s.isNull) throw new Error();
583
583
  e.DeviceId = s.asString();
584
584
  break;
585
585
  }
586
- case ce: {
586
+ case _e: {
587
587
  if (s.isNull) throw new Error();
588
588
  e.InstallId = s.asString();
589
589
  break;
590
590
  }
591
- case Ee: {
591
+ case fe: {
592
592
  if (s.isNull) throw new Error();
593
593
  e.UserAgent = s.asString();
594
594
  break;
595
595
  }
596
- case _e: {
596
+ case he: {
597
597
  if (s.isNull) throw new Error();
598
598
  e.ContextType = s.asInt32();
599
599
  break;
600
600
  }
601
- case fe: {
601
+ case ue: {
602
602
  if (s.isNull) throw new Error();
603
603
  e.HasInput = s.asBool();
604
604
  break;
605
605
  }
606
- case ue: {
606
+ case Te: {
607
607
  if (s.isNull) throw new Error();
608
608
  e.UserType = s.asInt32();
609
609
  break;
610
610
  }
611
- case he: {
611
+ case Ne: {
612
612
  if (s.isNull) throw new Error();
613
613
  e.UserId = s.asString();
614
614
  break;
615
615
  }
616
- case Te: {
616
+ case Ae: {
617
617
  if (s.isNull) throw new Error();
618
618
  e.ProductId = s.asString();
619
619
  break;
620
620
  }
621
- case Ne: {
621
+ case Se: {
622
622
  if (s.isNull) throw new Error();
623
623
  e.AuthSessionId = s.asString();
624
624
  break;
625
625
  }
626
- case Ae: {
626
+ case de: {
627
627
  if (s.isNull) throw new Error();
628
628
  e.ReceiveAllMessages = s.asBool();
629
629
  break;
630
630
  }
631
- case Se: {
631
+ case ye: {
632
632
  if (s.isNull) throw new Error();
633
633
  e.Description = s.asString();
634
634
  break;
635
635
  }
636
- case de: {
636
+ case Ce: {
637
637
  if (s.isNull) throw new Error();
638
638
  e.Locale = s.asString();
639
639
  break;
640
640
  }
641
- case ye: {
641
+ case we: {
642
642
  if (s.isNull) throw new Error();
643
643
  e.SdkType = s.asInt32();
644
644
  break;
645
645
  }
646
- case Ce: {
646
+ case Ue: {
647
647
  if (s.isNull) throw new Error();
648
648
  e.SessionId = s.asInt32();
649
649
  break;
650
650
  }
651
- case we: {
651
+ case De: {
652
652
  if (s.isNull) throw new Error();
653
653
  e.PreciseJoinedAt = s.asUInt64();
654
654
  break;
655
655
  }
656
- case Ue: {
656
+ case Re: {
657
657
  if (s.isNull) throw new Error();
658
658
  e.PayloadType = s.asInt32();
659
659
  break;
660
660
  }
661
- case Re: {
661
+ case me: {
662
662
  if (s.isNull) throw new Error();
663
663
  e.VersionId = s.asString();
664
664
  break;
665
665
  }
666
- case De: {
666
+ case Le: {
667
667
  if (s.isNull) throw new Error();
668
668
  e.UniqueSessionId = s.asString();
669
669
  break;
670
670
  }
671
- case Le: {
671
+ case Oe: {
672
672
  if (s.isNull) throw new Error();
673
673
  e.ClientType = s.asInt32();
674
674
  break;
675
675
  }
676
- case me: {
676
+ case ge: {
677
677
  if (s.isNull) throw new Error();
678
678
  e.IsReady = s.asBool();
679
679
  break;
680
680
  }
681
- case Oe: {
681
+ case Pe: {
682
682
  if (s.isNull) throw new Error();
683
- e.Parameters = ve(s.asDictionary());
683
+ e.Parameters = ke(s.asDictionary());
684
684
  break;
685
685
  }
686
- case ge: {
686
+ case be: {
687
687
  if (s.isNull) throw new Error();
688
688
  e.IsInternal = s.asBool();
689
689
  break;
690
690
  }
691
- case Pe: {
691
+ case pe: {
692
692
  if (s.isNull) throw new Error();
693
693
  e.ChannelLocale = s.asString();
694
694
  break;
695
695
  }
696
- case be: {
696
+ case Fe: {
697
697
  if (s.isNull) throw new Error();
698
698
  e.EmbeddedSpaceId = s.asString();
699
699
  break;
700
700
  }
701
701
  }
702
702
  }
703
- function ve(t) {
703
+ function ke(t) {
704
704
  const e = /* @__PURE__ */ Object.create(null);
705
705
  let s;
706
706
  for (; (s = t.next()) !== null; ) {
@@ -709,53 +709,53 @@ function ve(t) {
709
709
  }
710
710
  return e;
711
711
  }
712
- const Ve = 703025676, ke = 814454131, Ge = 972460562, Be = 976255570, xe = 1368629611, He = 1479280922, Ye = 1533537016, je = 2274386296, $e = 2603556958, Ke = 2885165957, Xe = 3568439632;
713
- function ze(t) {
712
+ const Ge = 703025676, Be = 814454131, xe = 972460562, He = 976255570, Ye = 1368629611, Ke = 1479280922, $e = 1533537016, je = 2274386296, Xe = 2603556958, ze = 2885165957, We = 3568439632;
713
+ function Je(t) {
714
714
  const e = {};
715
- return dt(e), e;
715
+ return yt(e), e;
716
716
  }
717
- function dt(t) {
718
- return t.FunctionId = h.fromBytes(new Uint8Array(16)), t.FunctionName = "", t.Parameters = [], t.ResultTypeName = "", t.IsEnumerable = !1, t.EnumerableItemTypeName = "", t.IsCancellable = !1, t.Description = "", t.LlmInlineResult = !1, t.LlmCallOnlyOnce = !1, t.RequiresInstance = !1, t;
717
+ function yt(t) {
718
+ return t.FunctionId = u.fromBytes(new Uint8Array(16)), t.FunctionName = "", t.Parameters = [], t.ResultTypeName = "", t.IsEnumerable = !1, t.EnumerableItemTypeName = "", t.IsCancellable = !1, t.Description = "", t.LlmInlineResult = !1, t.LlmCallOnlyOnce = !1, t.RequiresInstance = !1, t;
719
719
  }
720
- function We(t, e) {
721
- const s = e ?? ze();
722
- return dt(s), Je(t, s), s;
720
+ function qe(t, e) {
721
+ const s = e ?? Je();
722
+ return yt(s), Qe(t, s), s;
723
723
  }
724
- function Je(t, e) {
724
+ function Qe(t, e) {
725
725
  let s;
726
726
  for (; (s = t.next()) !== null; )
727
727
  switch (s.fieldId) {
728
- case Ve: {
728
+ case Ge: {
729
729
  if (s.isNull) throw new Error();
730
730
  e.ResultTypeName = s.asString();
731
731
  break;
732
732
  }
733
- case ke: {
733
+ case Be: {
734
734
  if (s.isNull) throw new Error();
735
735
  e.FunctionName = s.asString();
736
736
  break;
737
737
  }
738
- case Ge: {
738
+ case xe: {
739
739
  if (s.isNull) throw new Error();
740
740
  e.EnumerableItemTypeName = s.asString();
741
741
  break;
742
742
  }
743
- case Be: {
743
+ case He: {
744
744
  if (s.isNull) throw new Error();
745
745
  e.FunctionId = s.asGuid();
746
746
  break;
747
747
  }
748
- case xe: {
748
+ case Ye: {
749
749
  if (s.isNull) throw new Error();
750
750
  e.Description = s.asString();
751
751
  break;
752
752
  }
753
- case He: {
753
+ case Ke: {
754
754
  if (s.isNull) throw new Error();
755
755
  e.IsCancellable = s.asBool();
756
756
  break;
757
757
  }
758
- case Ye: {
758
+ case $e: {
759
759
  if (s.isNull) throw new Error();
760
760
  e.RequiresInstance = s.asBool();
761
761
  break;
@@ -765,578 +765,578 @@ function Je(t, e) {
765
765
  e.LlmInlineResult = s.asBool();
766
766
  break;
767
767
  }
768
- case $e: {
768
+ case Xe: {
769
769
  if (s.isNull) throw new Error();
770
770
  e.IsEnumerable = s.asBool();
771
771
  break;
772
772
  }
773
- case Ke: {
773
+ case ze: {
774
774
  if (s.isNull) throw new Error();
775
- e.Parameters = qe(s.asArray());
775
+ e.Parameters = Ze(s.asArray());
776
776
  break;
777
777
  }
778
- case Xe: {
778
+ case We: {
779
779
  if (s.isNull) throw new Error();
780
780
  e.LlmCallOnlyOnce = s.asBool();
781
781
  break;
782
782
  }
783
783
  }
784
784
  }
785
- function qe(t) {
785
+ function Ze(t) {
786
786
  const e = [];
787
787
  let s;
788
788
  for (; (s = t.next()) !== null; )
789
- e.push(ls(s.asObject()));
789
+ e.push(cs(s.asObject()));
790
790
  return e;
791
791
  }
792
- const Qe = 607861992, Ze = 894485888, ts = 972460562, es = 1368629611, ss = 1883521406, rs = 2603556958, ns = 3609695522, is = 4075263697, os = 4257460908;
793
- function as(t) {
792
+ const ts = 607861992, es = 894485888, ss = 972460562, rs = 1368629611, ns = 1883521406, is = 2603556958, os = 3609695522, as = 4075263697, ls = 4257460908;
793
+ function Is(t) {
794
794
  const e = {};
795
- return yt(e), e;
795
+ return Ct(e), e;
796
796
  }
797
- function yt(t) {
797
+ function Ct(t) {
798
798
  return t.ParameterIndex = 0, t.ParameterName = "", t.TypeName = "", t.HasDefaultValue = !1, t.DefaultValueJson = "", t.DefaultValueData = new Uint8Array(0), t.IsEnumerable = !1, t.EnumerableItemTypeName = "", t.Description = "", t;
799
799
  }
800
- function ls(t, e) {
801
- const s = e ?? as();
802
- return yt(s), Is(t, s), s;
800
+ function cs(t, e) {
801
+ const s = e ?? Is();
802
+ return Ct(s), Es(t, s), s;
803
803
  }
804
- function Is(t, e) {
804
+ function Es(t, e) {
805
805
  let s;
806
806
  for (; (s = t.next()) !== null; )
807
807
  switch (s.fieldId) {
808
- case Qe: {
808
+ case ts: {
809
809
  if (s.isNull) throw new Error();
810
810
  e.HasDefaultValue = s.asBool();
811
811
  break;
812
812
  }
813
- case Ze: {
813
+ case es: {
814
814
  if (s.isNull) throw new Error();
815
815
  e.DefaultValueJson = s.asString();
816
816
  break;
817
817
  }
818
- case ts: {
818
+ case ss: {
819
819
  if (s.isNull) throw new Error();
820
820
  e.EnumerableItemTypeName = s.asString();
821
821
  break;
822
822
  }
823
- case es: {
823
+ case rs: {
824
824
  if (s.isNull) throw new Error();
825
825
  e.Description = s.asString();
826
826
  break;
827
827
  }
828
- case ss: {
828
+ case ns: {
829
829
  if (s.isNull) throw new Error();
830
830
  e.DefaultValueData = s.asBinary();
831
831
  break;
832
832
  }
833
- case rs: {
833
+ case is: {
834
834
  if (s.isNull) throw new Error();
835
835
  e.IsEnumerable = s.asBool();
836
836
  break;
837
837
  }
838
- case ns: {
838
+ case os: {
839
839
  if (s.isNull) throw new Error();
840
840
  e.TypeName = s.asString();
841
841
  break;
842
842
  }
843
- case is: {
843
+ case as: {
844
844
  if (s.isNull) throw new Error();
845
845
  e.ParameterName = s.asString();
846
846
  break;
847
847
  }
848
- case os: {
848
+ case ls: {
849
849
  if (s.isNull) throw new Error();
850
850
  e.ParameterIndex = s.asInt32();
851
851
  break;
852
852
  }
853
853
  }
854
854
  }
855
- const cs = 3167053791, Es = 3342364356, _s = 3612929027;
856
- function Ct(t) {
857
- const e = {};
858
- return wt(e), e;
859
- }
855
+ const _s = 3167053791, fs = 3342364356, hs = 3612929027;
860
856
  function wt(t) {
861
- return t.Category = "", t.Type = ft.Face, t.FaceBlendshapes = [], t;
857
+ const e = {};
858
+ return Ut(e), e;
862
859
  }
863
- function fs(t, e) {
864
- const s = e ?? Ct();
865
- return wt(s), us(t, s), s;
860
+ function Ut(t) {
861
+ return t.Category = "", t.Type = ht.Face, t.FaceBlendshapes = [], t;
866
862
  }
867
863
  function us(t, e) {
864
+ const s = e ?? wt();
865
+ return Ut(s), Ts(t, s), s;
866
+ }
867
+ function Ts(t, e) {
868
868
  let s;
869
869
  for (; (s = t.next()) !== null; )
870
870
  switch (s.fieldId) {
871
- case cs: {
871
+ case _s: {
872
872
  if (s.isNull) throw new Error();
873
873
  e.Type = s.asInt32();
874
874
  break;
875
875
  }
876
- case Es: {
876
+ case fs: {
877
877
  if (s.isNull) throw new Error();
878
- e.FaceBlendshapes = hs(s.asArray());
878
+ e.FaceBlendshapes = Ns(s.asArray());
879
879
  break;
880
880
  }
881
- case _s: {
881
+ case hs: {
882
882
  if (s.isNull) throw new Error();
883
883
  e.Category = s.asString();
884
884
  break;
885
885
  }
886
886
  }
887
887
  }
888
- function hs(t) {
888
+ function Ns(t) {
889
889
  const e = [];
890
890
  let s;
891
891
  for (; (s = t.next()) !== null; )
892
892
  e.push(s.asString());
893
893
  return e;
894
894
  }
895
- const Ts = 3612929027;
896
- function Ut(t) {
895
+ const As = 3612929027;
896
+ function Dt(t) {
897
897
  const e = {};
898
898
  return Rt(e), e;
899
899
  }
900
900
  function Rt(t) {
901
901
  return t.Category = "", t;
902
902
  }
903
- function Ns(t, e) {
904
- const s = e ?? Ut();
905
- return Rt(s), As(t, s), s;
903
+ function Ss(t, e) {
904
+ const s = e ?? Dt();
905
+ return Rt(s), ds(t, s), s;
906
906
  }
907
- function As(t, e) {
907
+ function ds(t, e) {
908
908
  let s;
909
909
  for (; (s = t.next()) !== null; )
910
910
  switch (s.fieldId) {
911
- case Ts: {
911
+ case As: {
912
912
  if (s.isNull) throw new Error();
913
913
  e.Category = s.asString();
914
914
  break;
915
915
  }
916
916
  }
917
917
  }
918
- const Ss = 1368629611, ds = 2950031986, ys = 3284746250, Cs = 4065070594;
919
- function Dt(t) {
918
+ const ys = 1368629611, Cs = 2950031986, ws = 3284746250, Us = 4065070594;
919
+ function mt(t) {
920
920
  const e = {};
921
921
  return Lt(e), e;
922
922
  }
923
923
  function Lt(t) {
924
- return t.Description = "", t.Codec = ht.H264, t.Width = 0, t.Height = 0, t;
924
+ return t.Description = "", t.Codec = Tt.H264, t.Width = 0, t.Height = 0, t;
925
925
  }
926
- function ws(t, e) {
927
- const s = e ?? Dt();
928
- return Lt(s), Us(t, s), s;
926
+ function Ds(t, e) {
927
+ const s = e ?? mt();
928
+ return Lt(s), Rs(t, s), s;
929
929
  }
930
- function Us(t, e) {
930
+ function Rs(t, e) {
931
931
  let s;
932
932
  for (; (s = t.next()) !== null; )
933
933
  switch (s.fieldId) {
934
- case Ss: {
934
+ case ys: {
935
935
  if (s.isNull) throw new Error();
936
936
  e.Description = s.asString();
937
937
  break;
938
938
  }
939
- case ds: {
939
+ case Cs: {
940
940
  if (s.isNull) throw new Error();
941
941
  e.Height = s.asInt32();
942
942
  break;
943
943
  }
944
- case ys: {
944
+ case ws: {
945
945
  if (s.isNull) throw new Error();
946
946
  e.Codec = s.asInt32();
947
947
  break;
948
948
  }
949
- case Cs: {
949
+ case Us: {
950
950
  if (s.isNull) throw new Error();
951
951
  e.Width = s.asInt32();
952
952
  break;
953
953
  }
954
954
  }
955
955
  }
956
- const Rs = 3, Ds = 65539, Ls = 693643444, ms = 1144553441, Os = 1497620243, gs = 1559330978, Ps = 1999510636, bs = 2277643855, Fs = 2469008121, ps = 3219210453, Ms = 3678477544, vs = 3696445035, Vs = 3707543140, ks = 3712281496, Gs = 3823842552, Bs = 3895362455, xs = 3897397815, Hs = 4225107827;
957
- function Ys(t) {
956
+ const ms = 3, Ls = 65539, Os = 693643444, gs = 1144553441, Ps = 1497620243, bs = 1559330978, ps = 1999510636, Fs = 2277643855, vs = 2469008121, Ms = 3219210453, Vs = 3678477544, ks = 3696445035, Gs = 3707543140, Bs = 3712281496, xs = 3823842552, Hs = 3895362455, Ys = 3897397815, Ks = 4225107827;
957
+ function $s(t) {
958
958
  const e = {};
959
- return mt(e), e;
959
+ return Ot(e), e;
960
960
  }
961
- function mt(t) {
961
+ function Ot(t) {
962
962
  return t.Clients = /* @__PURE__ */ Object.create(null), t.UIStreams = /* @__PURE__ */ Object.create(null), t.AudioStreams = /* @__PURE__ */ Object.create(null), t.VideoStreams = /* @__PURE__ */ Object.create(null), t.TrackingStreams = /* @__PURE__ */ Object.create(null), t.SpaceId = "", t.ChannelInstanceId = "", t.FirstUserId = "", t.ChannelUrl = "", t.ChannelId = "", t.PrimaryUserId = "", t.OrganisationName = "", t.SpaceName = "", t.ChannelName = "", t.SessionId = "", t.Functions = /* @__PURE__ */ Object.create(null), t;
963
963
  }
964
964
  function js(t, e) {
965
- const s = D.create(t);
966
- return $s(s, e);
965
+ const s = R.create(t);
966
+ return Xs(s, e);
967
967
  }
968
- function $s(t, e) {
969
- const s = e ?? Ys();
970
- return mt(s), Ks(t, s), s;
968
+ function Xs(t, e) {
969
+ const s = e ?? $s();
970
+ return Ot(s), zs(t, s), s;
971
971
  }
972
- function Ks(t, e) {
972
+ function zs(t, e) {
973
973
  let s;
974
974
  for (; (s = t.next()) !== null; )
975
975
  switch (s.fieldId) {
976
- case Ls: {
976
+ case Os: {
977
977
  if (s.isNull) throw new Error();
978
978
  e.FirstUserId = s.asString();
979
979
  break;
980
980
  }
981
- case ms: {
981
+ case gs: {
982
982
  if (s.isNull) throw new Error();
983
- e.Clients = zs(s.asDictionary());
983
+ e.Clients = Js(s.asDictionary());
984
984
  break;
985
985
  }
986
- case Os: {
986
+ case Ps: {
987
987
  if (s.isNull) throw new Error();
988
- e.TrackingStreams = Ws(s.asDictionary());
988
+ e.TrackingStreams = qs(s.asDictionary());
989
989
  break;
990
990
  }
991
- case gs: {
991
+ case bs: {
992
992
  if (s.isNull) throw new Error();
993
993
  e.ChannelId = s.asString();
994
994
  break;
995
995
  }
996
- case Ps: {
996
+ case ps: {
997
997
  if (s.isNull) throw new Error();
998
998
  e.SessionId = s.asString();
999
999
  break;
1000
1000
  }
1001
- case bs: {
1001
+ case Fs: {
1002
1002
  if (s.isNull) throw new Error();
1003
1003
  e.ChannelUrl = s.asString();
1004
1004
  break;
1005
1005
  }
1006
- case Fs: {
1006
+ case vs: {
1007
1007
  if (s.isNull) throw new Error();
1008
1008
  e.ChannelName = s.asString();
1009
1009
  break;
1010
1010
  }
1011
- case ps: {
1011
+ case Ms: {
1012
1012
  if (s.isNull) throw new Error();
1013
1013
  e.OrganisationName = s.asString();
1014
1014
  break;
1015
1015
  }
1016
- case Ms: {
1016
+ case Vs: {
1017
1017
  if (s.isNull) throw new Error();
1018
- e.Functions = Js(s.asDictionary());
1018
+ e.Functions = Qs(s.asDictionary());
1019
1019
  break;
1020
1020
  }
1021
- case vs: {
1021
+ case ks: {
1022
1022
  if (s.isNull) throw new Error();
1023
- e.UIStreams = qs(s.asDictionary());
1023
+ e.UIStreams = Zs(s.asDictionary());
1024
1024
  break;
1025
1025
  }
1026
- case Vs: {
1026
+ case Gs: {
1027
1027
  if (s.isNull) throw new Error();
1028
1028
  e.SpaceId = s.asString();
1029
1029
  break;
1030
1030
  }
1031
- case ks: {
1031
+ case Bs: {
1032
1032
  if (s.isNull) throw new Error();
1033
1033
  e.PrimaryUserId = s.asString();
1034
1034
  break;
1035
1035
  }
1036
- case Gs: {
1036
+ case xs: {
1037
1037
  if (s.isNull) throw new Error();
1038
1038
  e.ChannelInstanceId = s.asString();
1039
1039
  break;
1040
1040
  }
1041
- case Bs: {
1041
+ case Hs: {
1042
1042
  if (s.isNull) throw new Error();
1043
- e.AudioStreams = Qs(s.asDictionary());
1043
+ e.AudioStreams = tr(s.asDictionary());
1044
1044
  break;
1045
1045
  }
1046
- case xs: {
1046
+ case Ys: {
1047
1047
  if (s.isNull) throw new Error();
1048
- e.VideoStreams = Zs(s.asDictionary());
1048
+ e.VideoStreams = er(s.asDictionary());
1049
1049
  break;
1050
1050
  }
1051
- case Hs: {
1051
+ case Ks: {
1052
1052
  if (s.isNull) throw new Error();
1053
1053
  e.SpaceName = s.asString();
1054
1054
  break;
1055
1055
  }
1056
1056
  }
1057
1057
  }
1058
- function Xs(t, e) {
1059
- const s = K(t, Ds, Rs);
1058
+ function Ws(t, e) {
1059
+ const s = X(t, Ls, ms);
1060
1060
  return js(s, e);
1061
1061
  }
1062
- function zs(t) {
1062
+ function Js(t) {
1063
1063
  const e = /* @__PURE__ */ Object.create(null);
1064
1064
  let s;
1065
1065
  for (; (s = t.next()) !== null; ) {
1066
1066
  const r = s.key.asInt32();
1067
- e[r] = pe(s.value.asObject());
1067
+ e[r] = Me(s.value.asObject());
1068
1068
  }
1069
1069
  return e;
1070
1070
  }
1071
- function Ws(t) {
1071
+ function qs(t) {
1072
1072
  const e = /* @__PURE__ */ Object.create(null);
1073
1073
  let s;
1074
1074
  for (; (s = t.next()) !== null; ) {
1075
1075
  const r = s.key.asString();
1076
- e[r] = Lr(s.value.asObject());
1076
+ e[r] = Or(s.value.asObject());
1077
1077
  }
1078
1078
  return e;
1079
1079
  }
1080
- function Js(t) {
1080
+ function Qs(t) {
1081
1081
  const e = /* @__PURE__ */ Object.create(null);
1082
1082
  let s;
1083
1083
  for (; (s = t.next()) !== null; ) {
1084
1084
  const r = s.key.asInt32();
1085
- e[r] = tr(s.value.asArray());
1085
+ e[r] = sr(s.value.asArray());
1086
1086
  }
1087
1087
  return e;
1088
1088
  }
1089
- function qs(t) {
1089
+ function Zs(t) {
1090
1090
  const e = /* @__PURE__ */ Object.create(null);
1091
1091
  let s;
1092
1092
  for (; (s = t.next()) !== null; ) {
1093
1093
  const r = s.key.asString();
1094
- e[r] = or(s.value.asObject());
1094
+ e[r] = lr(s.value.asObject());
1095
1095
  }
1096
1096
  return e;
1097
1097
  }
1098
- function Qs(t) {
1098
+ function tr(t) {
1099
1099
  const e = /* @__PURE__ */ Object.create(null);
1100
1100
  let s;
1101
1101
  for (; (s = t.next()) !== null; ) {
1102
1102
  const r = s.key.asString();
1103
- e[r] = fr(s.value.asObject());
1103
+ e[r] = ur(s.value.asObject());
1104
1104
  }
1105
1105
  return e;
1106
1106
  }
1107
- function Zs(t) {
1107
+ function er(t) {
1108
1108
  const e = /* @__PURE__ */ Object.create(null);
1109
1109
  let s;
1110
1110
  for (; (s = t.next()) !== null; ) {
1111
1111
  const r = s.key.asString();
1112
- e[r] = dr(s.value.asObject());
1112
+ e[r] = Cr(s.value.asObject());
1113
1113
  }
1114
1114
  return e;
1115
1115
  }
1116
- function tr(t) {
1116
+ function sr(t) {
1117
1117
  const e = [];
1118
1118
  let s;
1119
1119
  for (; (s = t.next()) !== null; )
1120
- e.push(We(s.asObject()));
1120
+ e.push(qe(s.asObject()));
1121
1121
  return e;
1122
1122
  }
1123
- const er = 161083277, sr = 325678206, rr = 3469892363, nr = 3645544153;
1124
- function ir(t) {
1123
+ const rr = 161083277, nr = 325678206, ir = 3469892363, or = 3645544153;
1124
+ function ar(t) {
1125
1125
  const e = {};
1126
- return Ot(e), e;
1126
+ return gt(e), e;
1127
1127
  }
1128
- function Ot(t) {
1129
- return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = Ut(), t;
1128
+ function gt(t) {
1129
+ return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = Dt(), t;
1130
1130
  }
1131
- function or(t, e) {
1132
- const s = e ?? ir();
1133
- return Ot(s), ar(t, s), s;
1131
+ function lr(t, e) {
1132
+ const s = e ?? ar();
1133
+ return gt(s), Ir(t, s), s;
1134
1134
  }
1135
- function ar(t, e) {
1135
+ function Ir(t, e) {
1136
1136
  let s;
1137
1137
  for (; (s = t.next()) !== null; )
1138
1138
  switch (s.fieldId) {
1139
- case er: {
1139
+ case rr: {
1140
1140
  if (s.isNull) throw new Error();
1141
1141
  e.StreamId = s.asString();
1142
1142
  break;
1143
1143
  }
1144
- case sr: {
1144
+ case nr: {
1145
1145
  if (s.isNull) throw new Error();
1146
1146
  e.ClientSessionId = s.asInt32();
1147
1147
  break;
1148
1148
  }
1149
- case rr: {
1149
+ case ir: {
1150
1150
  if (s.isNull) throw new Error();
1151
1151
  e.TrackId = s.asInt32();
1152
1152
  break;
1153
1153
  }
1154
- case nr: {
1154
+ case or: {
1155
1155
  if (s.isNull) throw new Error();
1156
- e.Info = Ns(s.asObject());
1156
+ e.Info = Ss(s.asObject());
1157
1157
  break;
1158
1158
  }
1159
1159
  }
1160
1160
  }
1161
- const lr = 161083277, Ir = 325678206, cr = 3469892363, Er = 3645544153;
1162
- function _r(t) {
1161
+ const cr = 161083277, Er = 325678206, _r = 3469892363, fr = 3645544153;
1162
+ function hr(t) {
1163
1163
  const e = {};
1164
- return gt(e), e;
1165
- }
1166
- function gt(t) {
1167
- return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = Nt(), t;
1164
+ return Pt(e), e;
1168
1165
  }
1169
- function fr(t, e) {
1170
- const s = e ?? _r();
1171
- return gt(s), ur(t, s), s;
1166
+ function Pt(t) {
1167
+ return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = At(), t;
1172
1168
  }
1173
1169
  function ur(t, e) {
1170
+ const s = e ?? hr();
1171
+ return Pt(s), Tr(t, s), s;
1172
+ }
1173
+ function Tr(t, e) {
1174
1174
  let s;
1175
1175
  for (; (s = t.next()) !== null; )
1176
1176
  switch (s.fieldId) {
1177
- case lr: {
1177
+ case cr: {
1178
1178
  if (s.isNull) throw new Error();
1179
1179
  e.StreamId = s.asString();
1180
1180
  break;
1181
1181
  }
1182
- case Ir: {
1182
+ case Er: {
1183
1183
  if (s.isNull) throw new Error();
1184
1184
  e.ClientSessionId = s.asInt32();
1185
1185
  break;
1186
1186
  }
1187
- case cr: {
1187
+ case _r: {
1188
1188
  if (s.isNull) throw new Error();
1189
1189
  e.TrackId = s.asInt32();
1190
1190
  break;
1191
1191
  }
1192
- case Er: {
1192
+ case fr: {
1193
1193
  if (s.isNull) throw new Error();
1194
- e.Info = ae(s.asObject());
1194
+ e.Info = Ie(s.asObject());
1195
1195
  break;
1196
1196
  }
1197
1197
  }
1198
1198
  }
1199
- const hr = 161083277, Tr = 325678206, Nr = 3469892363, Ar = 3645544153;
1200
- function Sr(t) {
1199
+ const Nr = 161083277, Ar = 325678206, Sr = 3469892363, dr = 3645544153;
1200
+ function yr(t) {
1201
1201
  const e = {};
1202
- return Pt(e), e;
1202
+ return bt(e), e;
1203
1203
  }
1204
- function Pt(t) {
1205
- return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = Dt(), t;
1204
+ function bt(t) {
1205
+ return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = mt(), t;
1206
1206
  }
1207
- function dr(t, e) {
1208
- const s = e ?? Sr();
1209
- return Pt(s), yr(t, s), s;
1207
+ function Cr(t, e) {
1208
+ const s = e ?? yr();
1209
+ return bt(s), wr(t, s), s;
1210
1210
  }
1211
- function yr(t, e) {
1211
+ function wr(t, e) {
1212
1212
  let s;
1213
1213
  for (; (s = t.next()) !== null; )
1214
1214
  switch (s.fieldId) {
1215
- case hr: {
1215
+ case Nr: {
1216
1216
  if (s.isNull) throw new Error();
1217
1217
  e.StreamId = s.asString();
1218
1218
  break;
1219
1219
  }
1220
- case Tr: {
1220
+ case Ar: {
1221
1221
  if (s.isNull) throw new Error();
1222
1222
  e.ClientSessionId = s.asInt32();
1223
1223
  break;
1224
1224
  }
1225
- case Nr: {
1225
+ case Sr: {
1226
1226
  if (s.isNull) throw new Error();
1227
1227
  e.TrackId = s.asInt32();
1228
1228
  break;
1229
1229
  }
1230
- case Ar: {
1230
+ case dr: {
1231
1231
  if (s.isNull) throw new Error();
1232
- e.Info = ws(s.asObject());
1232
+ e.Info = Ds(s.asObject());
1233
1233
  break;
1234
1234
  }
1235
1235
  }
1236
1236
  }
1237
- const Cr = 161083277, wr = 325678206, Ur = 3469892363, Rr = 3645544153;
1238
- function Dr(t) {
1237
+ const Ur = 161083277, Dr = 325678206, Rr = 3469892363, mr = 3645544153;
1238
+ function Lr(t) {
1239
1239
  const e = {};
1240
- return bt(e), e;
1240
+ return pt(e), e;
1241
1241
  }
1242
- function bt(t) {
1243
- return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = Ct(), t;
1242
+ function pt(t) {
1243
+ return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = wt(), t;
1244
1244
  }
1245
- function Lr(t, e) {
1246
- const s = e ?? Dr();
1247
- return bt(s), mr(t, s), s;
1245
+ function Or(t, e) {
1246
+ const s = e ?? Lr();
1247
+ return pt(s), gr(t, s), s;
1248
1248
  }
1249
- function mr(t, e) {
1249
+ function gr(t, e) {
1250
1250
  let s;
1251
1251
  for (; (s = t.next()) !== null; )
1252
1252
  switch (s.fieldId) {
1253
- case Cr: {
1253
+ case Ur: {
1254
1254
  if (s.isNull) throw new Error();
1255
1255
  e.StreamId = s.asString();
1256
1256
  break;
1257
1257
  }
1258
- case wr: {
1258
+ case Dr: {
1259
1259
  if (s.isNull) throw new Error();
1260
1260
  e.ClientSessionId = s.asInt32();
1261
1261
  break;
1262
1262
  }
1263
- case Ur: {
1263
+ case Rr: {
1264
1264
  if (s.isNull) throw new Error();
1265
1265
  e.TrackId = s.asInt32();
1266
1266
  break;
1267
1267
  }
1268
- case Rr: {
1268
+ case mr: {
1269
1269
  if (s.isNull) throw new Error();
1270
- e.Info = fs(s.asObject());
1270
+ e.Info = us(s.asObject());
1271
1271
  break;
1272
1272
  }
1273
1273
  }
1274
1274
  }
1275
- const Or = 1405462580, gr = 2968276160;
1276
- function Pr(t) {
1275
+ const Pr = 1405462580, br = 2968276160;
1276
+ function pr(t) {
1277
1277
  const e = {};
1278
1278
  return Ft(e), e;
1279
1279
  }
1280
1280
  function Ft(t) {
1281
1281
  return t.MimeType = "", t.Value = new Uint8Array(0), t;
1282
1282
  }
1283
- function br(t, e) {
1284
- const s = e ?? Pr();
1285
- return Ft(s), Fr(t, s), s;
1286
- }
1287
1283
  function Fr(t, e) {
1284
+ const s = e ?? pr();
1285
+ return Ft(s), vr(t, s), s;
1286
+ }
1287
+ function vr(t, e) {
1288
1288
  let s;
1289
1289
  for (; (s = t.next()) !== null; )
1290
1290
  switch (s.fieldId) {
1291
- case Or: {
1291
+ case Pr: {
1292
1292
  if (s.isNull) throw new Error();
1293
1293
  e.Value = s.asBinary();
1294
1294
  break;
1295
1295
  }
1296
- case gr: {
1296
+ case br: {
1297
1297
  if (s.isNull) throw new Error();
1298
1298
  e.MimeType = s.asString();
1299
1299
  break;
1300
1300
  }
1301
1301
  }
1302
1302
  }
1303
- const pr = 1, Mr = 2097188, vr = 979822885, Vr = 2374537704;
1304
- function kr(t) {
1303
+ const Mr = 1, Vr = 2097188, kr = 979822885, Gr = 2374537704;
1304
+ function Br(t) {
1305
1305
  const e = {};
1306
- return pt(e), e;
1306
+ return vt(e), e;
1307
1307
  }
1308
- function pt(t) {
1308
+ function vt(t) {
1309
1309
  return t.StyleId = "", t.Style = /* @__PURE__ */ Object.create(null), t;
1310
1310
  }
1311
- function Gr(t, e) {
1312
- const s = D.create(t);
1313
- return Br(s, e);
1311
+ function xr(t, e) {
1312
+ const s = R.create(t);
1313
+ return Hr(s, e);
1314
1314
  }
1315
- function Br(t, e) {
1316
- const s = e ?? kr();
1317
- return pt(s), xr(t, s), s;
1315
+ function Hr(t, e) {
1316
+ const s = e ?? Br();
1317
+ return vt(s), Yr(t, s), s;
1318
1318
  }
1319
- function xr(t, e) {
1319
+ function Yr(t, e) {
1320
1320
  let s;
1321
1321
  for (; (s = t.next()) !== null; )
1322
1322
  switch (s.fieldId) {
1323
- case vr: {
1323
+ case kr: {
1324
1324
  if (s.isNull) throw new Error();
1325
1325
  e.StyleId = s.asString();
1326
1326
  break;
1327
1327
  }
1328
- case Vr: {
1328
+ case Gr: {
1329
1329
  if (s.isNull) throw new Error();
1330
- e.Style = Yr(s.asDictionary());
1330
+ e.Style = $r(s.asDictionary());
1331
1331
  break;
1332
1332
  }
1333
1333
  }
1334
1334
  }
1335
- function Hr(t, e) {
1336
- const s = K(t, Mr, pr);
1337
- return Gr(s, e);
1335
+ function Kr(t, e) {
1336
+ const s = X(t, Vr, Mr);
1337
+ return xr(s, e);
1338
1338
  }
1339
- function Yr(t) {
1339
+ function $r(t) {
1340
1340
  const e = /* @__PURE__ */ Object.create(null);
1341
1341
  let s;
1342
1342
  for (; (s = t.next()) !== null; ) {
@@ -1345,73 +1345,73 @@ function Yr(t) {
1345
1345
  }
1346
1346
  return e;
1347
1347
  }
1348
- const jr = 1, $r = 2097192, Kr = 2136687806;
1349
- function Xr(t) {
1348
+ const jr = 1, Xr = 2097192, zr = 2136687806;
1349
+ function Wr(t) {
1350
1350
  const e = {};
1351
1351
  return Mt(e), e;
1352
1352
  }
1353
1353
  function Mt(t) {
1354
1354
  return t.Styles = [], t;
1355
1355
  }
1356
- function zr(t, e) {
1357
- const s = D.create(t);
1358
- return Wr(s, e);
1356
+ function Jr(t, e) {
1357
+ const s = R.create(t);
1358
+ return qr(s, e);
1359
1359
  }
1360
- function Wr(t, e) {
1361
- const s = e ?? Xr();
1362
- return Mt(s), Jr(t, s), s;
1360
+ function qr(t, e) {
1361
+ const s = e ?? Wr();
1362
+ return Mt(s), Qr(t, s), s;
1363
1363
  }
1364
- function Jr(t, e) {
1364
+ function Qr(t, e) {
1365
1365
  let s;
1366
1366
  for (; (s = t.next()) !== null; )
1367
1367
  switch (s.fieldId) {
1368
- case Kr: {
1368
+ case zr: {
1369
1369
  if (s.isNull) throw new Error();
1370
- e.Styles = Qr(s.asArray());
1370
+ e.Styles = tn(s.asArray());
1371
1371
  break;
1372
1372
  }
1373
1373
  }
1374
1374
  }
1375
- function qr(t, e) {
1376
- const s = K(t, $r, jr);
1377
- return zr(s, e);
1375
+ function Zr(t, e) {
1376
+ const s = X(t, Xr, jr);
1377
+ return Jr(s, e);
1378
1378
  }
1379
- function Qr(t) {
1379
+ function tn(t) {
1380
1380
  const e = [];
1381
1381
  let s;
1382
1382
  for (; (s = t.next()) !== null; )
1383
- e.push(sn(s.asObject()));
1383
+ e.push(nn(s.asObject()));
1384
1384
  return e;
1385
1385
  }
1386
- const Zr = 979822885, tn = 2374537704;
1387
- function en(t) {
1386
+ const en = 979822885, sn = 2374537704;
1387
+ function rn(t) {
1388
1388
  const e = {};
1389
- return vt(e), e;
1389
+ return Vt(e), e;
1390
1390
  }
1391
- function vt(t) {
1391
+ function Vt(t) {
1392
1392
  return t.StyleId = "", t.Style = /* @__PURE__ */ Object.create(null), t;
1393
1393
  }
1394
- function sn(t, e) {
1395
- const s = e ?? en();
1396
- return vt(s), rn(t, s), s;
1394
+ function nn(t, e) {
1395
+ const s = e ?? rn();
1396
+ return Vt(s), on(t, s), s;
1397
1397
  }
1398
- function rn(t, e) {
1398
+ function on(t, e) {
1399
1399
  let s;
1400
1400
  for (; (s = t.next()) !== null; )
1401
1401
  switch (s.fieldId) {
1402
- case Zr: {
1402
+ case en: {
1403
1403
  if (s.isNull) throw new Error();
1404
1404
  e.StyleId = s.asString();
1405
1405
  break;
1406
1406
  }
1407
- case tn: {
1407
+ case sn: {
1408
1408
  if (s.isNull) throw new Error();
1409
- e.Style = nn(s.asDictionary());
1409
+ e.Style = an(s.asDictionary());
1410
1410
  break;
1411
1411
  }
1412
1412
  }
1413
1413
  }
1414
- function nn(t) {
1414
+ function an(t) {
1415
1415
  const e = /* @__PURE__ */ Object.create(null);
1416
1416
  let s;
1417
1417
  for (; (s = t.next()) !== null; ) {
@@ -1420,61 +1420,61 @@ function nn(t) {
1420
1420
  }
1421
1421
  return e;
1422
1422
  }
1423
- const on = 1, an = 2097190, ln = 425183262, In = 653781469;
1424
- function cn(t) {
1423
+ const ln = 1, In = 2097190, cn = 425183262, En = 653781469;
1424
+ function _n(t) {
1425
1425
  const e = {};
1426
- return Vt(e), e;
1426
+ return kt(e), e;
1427
1427
  }
1428
- function Vt(t) {
1428
+ function kt(t) {
1429
1429
  return t.Json = "", t.Payloads = /* @__PURE__ */ Object.create(null), t;
1430
1430
  }
1431
- function En(t, e) {
1432
- const s = D.create(t);
1433
- return _n(s, e);
1431
+ function fn(t, e) {
1432
+ const s = R.create(t);
1433
+ return hn(s, e);
1434
1434
  }
1435
- function _n(t, e) {
1436
- const s = e ?? cn();
1437
- return Vt(s), fn(t, s), s;
1435
+ function hn(t, e) {
1436
+ const s = e ?? _n();
1437
+ return kt(s), un(t, s), s;
1438
1438
  }
1439
- function fn(t, e) {
1439
+ function un(t, e) {
1440
1440
  let s;
1441
1441
  for (; (s = t.next()) !== null; )
1442
1442
  switch (s.fieldId) {
1443
- case ln: {
1443
+ case cn: {
1444
1444
  if (s.isNull) throw new Error();
1445
1445
  e.Json = s.asString();
1446
1446
  break;
1447
1447
  }
1448
- case In: {
1448
+ case En: {
1449
1449
  if (s.isNull) throw new Error();
1450
- e.Payloads = hn(s.asDictionary());
1450
+ e.Payloads = Nn(s.asDictionary());
1451
1451
  break;
1452
1452
  }
1453
1453
  }
1454
1454
  }
1455
- function un(t, e) {
1456
- const s = K(t, an, on);
1457
- return En(s, e);
1455
+ function Tn(t, e) {
1456
+ const s = X(t, In, ln);
1457
+ return fn(s, e);
1458
1458
  }
1459
- function hn(t) {
1459
+ function Nn(t) {
1460
1460
  const e = /* @__PURE__ */ Object.create(null);
1461
1461
  let s;
1462
1462
  for (; (s = t.next()) !== null; ) {
1463
1463
  const r = s.key.asString();
1464
- e[r] = br(s.value.asObject());
1464
+ e[r] = Fr(s.value.asObject());
1465
1465
  }
1466
1466
  return e;
1467
1467
  }
1468
1468
  function y(t) {
1469
1469
  return typeof t == "object" && t !== null && !Array.isArray(t);
1470
1470
  }
1471
- function kt(t) {
1471
+ function Gt(t) {
1472
1472
  const e = {};
1473
1473
  for (const [s, r] of Object.entries(t))
1474
1474
  e[s] = r;
1475
1475
  return e;
1476
1476
  }
1477
- function Gt(t, e, s, r) {
1477
+ function Bt(t, e, s, r) {
1478
1478
  if (!(t === void 0 && r)) {
1479
1479
  if (Array.isArray(t)) {
1480
1480
  const n = [];
@@ -1492,7 +1492,7 @@ function Gt(t, e, s, r) {
1492
1492
  return [];
1493
1493
  }
1494
1494
  }
1495
- function st(t, e) {
1495
+ function rt(t, e) {
1496
1496
  if (!t || typeof t != "object")
1497
1497
  throw new Error(`Invalid UI node at ${e}`);
1498
1498
  const s = t.Id, r = t.Type, n = t.Props, i = t.Children, o = t.StyleIds;
@@ -1504,22 +1504,22 @@ function st(t, e) {
1504
1504
  if (n != null) {
1505
1505
  if (!y(n))
1506
1506
  throw new Error(`Invalid props for node ${s}`);
1507
- a = kt(n);
1507
+ a = Gt(n);
1508
1508
  }
1509
- let I = [];
1510
- Array.isArray(i) && (I = i.map(
1511
- (l, c) => st(l ?? {}, `${e}.children[${c}]`)
1509
+ let l = [];
1510
+ Array.isArray(i) && (l = i.map(
1511
+ (c, E) => rt(c ?? {}, `${e}.children[${E}]`)
1512
1512
  ));
1513
- const E = Gt(o, e, s, !1);
1513
+ const I = Bt(o, e, s, !1);
1514
1514
  return {
1515
1515
  id: s,
1516
1516
  type: r,
1517
1517
  props: a,
1518
- children: I,
1519
- styleIds: E ?? []
1518
+ children: l,
1519
+ styleIds: I ?? []
1520
1520
  };
1521
1521
  }
1522
- function Tn(t, e) {
1522
+ function An(t, e) {
1523
1523
  if (!y(t))
1524
1524
  throw new Error(`Invalid text delta at ${e}`);
1525
1525
  const s = t.NodeId, r = t.PropertyName, n = t.Start, i = t.End, o = t.InsertedText;
@@ -1546,7 +1546,7 @@ function Tn(t, e) {
1546
1546
  insertedText: o
1547
1547
  };
1548
1548
  }
1549
- function Bt(t, e) {
1549
+ function xt(t, e) {
1550
1550
  if (!y(t))
1551
1551
  throw new Error(`Invalid UI diff node at ${e}`);
1552
1552
  const s = t.Id, r = t.Type, n = t.StyleIds;
@@ -1555,56 +1555,56 @@ function Bt(t, e) {
1555
1555
  if (typeof r != "string" || r.length === 0)
1556
1556
  throw new Error(`Invalid diff type for ${s}`);
1557
1557
  const i = Array.isArray(t.Added) ? t.Added.map(
1558
- (c, _) => st(c ?? {}, `${e}.added[${_}]`)
1558
+ (E, _) => rt(E ?? {}, `${e}.added[${_}]`)
1559
1559
  ) : [], o = [];
1560
- Array.isArray(t.Removed) && t.Removed.forEach((c, _) => {
1561
- if (typeof c == "string") {
1562
- o.push(c);
1560
+ Array.isArray(t.Removed) && t.Removed.forEach((E, _) => {
1561
+ if (typeof E == "string") {
1562
+ o.push(E);
1563
1563
  return;
1564
1564
  }
1565
- if (y(c) && typeof c.Id == "string") {
1566
- o.push(c.Id);
1565
+ if (y(E) && typeof E.Id == "string") {
1566
+ o.push(E.Id);
1567
1567
  return;
1568
1568
  }
1569
1569
  throw new Error(`Invalid removed node at ${e}.removed[${_}]`);
1570
1570
  });
1571
1571
  const a = Array.isArray(t.Updated) ? t.Updated.map(
1572
- (c, _) => Bt(c ?? {}, `${e}.updated[${_}]`)
1573
- ) : [], I = /* @__PURE__ */ new Map();
1572
+ (E, _) => xt(E ?? {}, `${e}.updated[${_}]`)
1573
+ ) : [], l = /* @__PURE__ */ new Map();
1574
1574
  if (y(t.ChangedProps))
1575
- for (const [c, _] of Object.entries(t.ChangedProps)) {
1575
+ for (const [E, _] of Object.entries(t.ChangedProps)) {
1576
1576
  if (!y(_))
1577
1577
  continue;
1578
- const u = _.New;
1579
- u === void 0 ? I.set(c, void 0) : y(u) ? I.set(c, kt(u)) : I.set(c, u);
1578
+ const h = _.New;
1579
+ h === void 0 ? l.set(E, void 0) : y(h) ? l.set(E, Gt(h)) : l.set(E, h);
1580
1580
  }
1581
- const E = Array.isArray(t.TextUpdates) ? t.TextUpdates.map(
1582
- (c, _) => Tn(c ?? {}, `${e}.textUpdates[${_}]`)
1583
- ) : [], l = Gt(n, e, s, !0);
1581
+ const I = Array.isArray(t.TextUpdates) ? t.TextUpdates.map(
1582
+ (E, _) => An(E ?? {}, `${e}.textUpdates[${_}]`)
1583
+ ) : [], c = Bt(n, e, s, !0);
1584
1584
  return {
1585
1585
  id: s,
1586
1586
  type: r,
1587
1587
  added: i,
1588
1588
  removed: o,
1589
1589
  updated: a,
1590
- changedProps: I,
1591
- textUpdates: E,
1592
- ...l !== void 0 ? { styleIds: l } : {}
1590
+ changedProps: l,
1591
+ textUpdates: I,
1592
+ ...c !== void 0 ? { styleIds: c } : {}
1593
1593
  };
1594
1594
  }
1595
- function Nn(t) {
1595
+ function Sn(t) {
1596
1596
  const e = /* @__PURE__ */ new Map();
1597
1597
  for (const [s, r] of Object.entries(t))
1598
1598
  e.set(s, r);
1599
1599
  return e;
1600
1600
  }
1601
- function An(t, e, s) {
1601
+ function dn(t, e, s) {
1602
1602
  if (!t || typeof t != "object")
1603
1603
  throw new C("UI update graph is missing");
1604
- const r = st(t, "graph");
1604
+ const r = rt(t, "graph");
1605
1605
  if (r.type !== "root")
1606
1606
  throw new C('UI update root element must have type "root"');
1607
- const n = dn(r.props, e);
1607
+ const n = Cn(r.props, e);
1608
1608
  return {
1609
1609
  type: "full",
1610
1610
  version: s,
@@ -1612,7 +1612,7 @@ function An(t, e, s) {
1612
1612
  metadata: n
1613
1613
  };
1614
1614
  }
1615
- function Sn(t, e, s) {
1615
+ function yn(t, e, s) {
1616
1616
  if (!t || typeof t != "object")
1617
1617
  throw new C("UI diff payload is missing");
1618
1618
  if (!y(e))
@@ -1620,36 +1620,36 @@ function Sn(t, e, s) {
1620
1620
  const r = e.viewId;
1621
1621
  if (typeof r != "string" || r.length === 0)
1622
1622
  throw new C("UI diff metadata is missing viewId");
1623
- const n = Bt(t, "diff"), i = e.optimisticActionId === null || typeof e.optimisticActionId == "string" ? e.optimisticActionId : void 0, o = typeof e.isOptimistic == "boolean" ? e.isOptimistic : void 0, a = typeof e.isUpdate == "boolean" ? e.isUpdate : void 0, I = z(e.optimisticPatch), E = W(e.optimisticReconcile), l = {
1623
+ const n = xt(t, "diff"), i = e.optimisticActionId === null || typeof e.optimisticActionId == "string" ? e.optimisticActionId : void 0, o = typeof e.isOptimistic == "boolean" ? e.isOptimistic : void 0, a = typeof e.isUpdate == "boolean" ? e.isUpdate : void 0, l = W(e.optimisticPatch), I = J(e.optimisticReconcile), c = {
1624
1624
  viewId: r,
1625
1625
  ...i !== void 0 ? { optimisticActionId: i } : {},
1626
1626
  ...o !== void 0 ? { isOptimistic: o } : {},
1627
1627
  ...a !== void 0 ? { isUpdate: a } : {},
1628
- ...I ? { optimisticPatch: I } : {},
1629
- ...E ? { optimisticReconcile: E } : {}
1628
+ ...l ? { optimisticPatch: l } : {},
1629
+ ...I ? { optimisticReconcile: I } : {}
1630
1630
  };
1631
1631
  return {
1632
1632
  type: "diff",
1633
1633
  version: s,
1634
1634
  diff: n,
1635
- metadata: l
1635
+ metadata: c
1636
1636
  };
1637
1637
  }
1638
- function dn(t, e) {
1638
+ function Cn(t, e) {
1639
1639
  const s = t.viewId;
1640
1640
  if (typeof s != "string" || s.length === 0)
1641
1641
  throw new C("UI update root is missing viewId");
1642
- let r = s, n = t.optimisticActionId === null || typeof t.optimisticActionId == "string" ? t.optimisticActionId : void 0, i = typeof t.isOptimistic == "boolean" ? t.isOptimistic : void 0, o = typeof t.isUpdate == "boolean" ? t.isUpdate : void 0, a = z(t.optimisticPatch), I = W(t.optimisticReconcile);
1643
- return y(e) && (typeof e.viewId == "string" && e.viewId.length > 0 && (r = e.viewId), (e.optimisticActionId === null || typeof e.optimisticActionId == "string") && (n = e.optimisticActionId), typeof e.isOptimistic == "boolean" && (i = e.isOptimistic), typeof e.isUpdate == "boolean" && (o = e.isUpdate), e.optimisticPatch !== void 0 && (a = z(e.optimisticPatch)), e.optimisticReconcile !== void 0 && (I = W(e.optimisticReconcile))), {
1642
+ let r = s, n = t.optimisticActionId === null || typeof t.optimisticActionId == "string" ? t.optimisticActionId : void 0, i = typeof t.isOptimistic == "boolean" ? t.isOptimistic : void 0, o = typeof t.isUpdate == "boolean" ? t.isUpdate : void 0, a = W(t.optimisticPatch), l = J(t.optimisticReconcile);
1643
+ return y(e) && (typeof e.viewId == "string" && e.viewId.length > 0 && (r = e.viewId), (e.optimisticActionId === null || typeof e.optimisticActionId == "string") && (n = e.optimisticActionId), typeof e.isOptimistic == "boolean" && (i = e.isOptimistic), typeof e.isUpdate == "boolean" && (o = e.isUpdate), e.optimisticPatch !== void 0 && (a = W(e.optimisticPatch)), e.optimisticReconcile !== void 0 && (l = J(e.optimisticReconcile))), {
1644
1644
  viewId: r,
1645
1645
  ...n !== void 0 ? { optimisticActionId: n } : {},
1646
1646
  ...i !== void 0 ? { isOptimistic: i } : {},
1647
1647
  ...o !== void 0 ? { isUpdate: o } : {},
1648
1648
  ...a ? { optimisticPatch: a } : {},
1649
- ...I ? { optimisticReconcile: I } : {}
1649
+ ...l ? { optimisticReconcile: l } : {}
1650
1650
  };
1651
1651
  }
1652
- function z(t) {
1652
+ function W(t) {
1653
1653
  if (!y(t))
1654
1654
  return;
1655
1655
  const e = t, s = e.id, r = e.actionId, n = e.ordinal, i = e.baseVersion, o = e.supersedes;
@@ -1657,10 +1657,10 @@ function z(t) {
1657
1657
  return;
1658
1658
  let a;
1659
1659
  if (Array.isArray(o)) {
1660
- const I = [];
1661
- for (const E of o)
1662
- typeof E == "string" && E.length > 0 && I.push(E);
1663
- a = I;
1660
+ const l = [];
1661
+ for (const I of o)
1662
+ typeof I == "string" && I.length > 0 && l.push(I);
1663
+ a = l;
1664
1664
  }
1665
1665
  return {
1666
1666
  id: s,
@@ -1670,7 +1670,7 @@ function z(t) {
1670
1670
  ...a && a.length > 0 ? { supersedes: a } : {}
1671
1671
  };
1672
1672
  }
1673
- function W(t) {
1673
+ function J(t) {
1674
1674
  if (!y(t))
1675
1675
  return;
1676
1676
  const e = t, s = e.baseVersion, r = e.drop;
@@ -1693,7 +1693,7 @@ class C extends Error {
1693
1693
  super(e), this.causeError = s, this.name = "UiUpdateParseError", s instanceof Error && (this.stack = s.stack);
1694
1694
  }
1695
1695
  }
1696
- function yn(t) {
1696
+ function wn(t) {
1697
1697
  let e;
1698
1698
  try {
1699
1699
  e = JSON.parse(t.Json);
@@ -1707,13 +1707,13 @@ function yn(t) {
1707
1707
  throw new C(`Unknown UI update type: ${String(s)}`);
1708
1708
  if (typeof r != "number")
1709
1709
  throw new C("UI update version must be a number");
1710
- const n = s === "full" ? An(e.graph, e.metadata, r) : Sn(e.diff, e.metadata, r), i = t.Payloads ? Nn(t.Payloads) : /* @__PURE__ */ new Map();
1710
+ const n = s === "full" ? dn(e.graph, e.metadata, r) : yn(e.diff, e.metadata, r), i = t.Payloads ? Sn(t.Payloads) : /* @__PURE__ */ new Map();
1711
1711
  return {
1712
1712
  snapshot: n,
1713
1713
  payloads: i
1714
1714
  };
1715
1715
  }
1716
- class Cn {
1716
+ class Un {
1717
1717
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1718
1718
  cache = /* @__PURE__ */ new Map();
1719
1719
  /**
@@ -1794,7 +1794,7 @@ class Cn {
1794
1794
  return this.cache.size;
1795
1795
  }
1796
1796
  }
1797
- class wn {
1797
+ class Dn {
1798
1798
  views = /* @__PURE__ */ new Map();
1799
1799
  listeners = /* @__PURE__ */ new Set();
1800
1800
  payloads = /* @__PURE__ */ new Map();
@@ -1811,13 +1811,34 @@ class wn {
1811
1811
  changedNodeIds = /* @__PURE__ */ new Set();
1812
1812
  nodeVersions = /* @__PURE__ */ new Map();
1813
1813
  structureChanged = !1;
1814
+ // Dirty flags for lazy snapshot rebuilding - start true to ensure first snapshot builds correctly
1815
+ viewsDirty = !0;
1816
+ patchesDirty = !0;
1817
+ payloadsDirty = !0;
1814
1818
  // Handler cache for stable event handlers
1815
- handlerCache = new Cn();
1819
+ handlerCache = new Un();
1820
+ getSortedPatches(e) {
1821
+ const s = this.buildPatchCacheKey(e.patches);
1822
+ if (e.sortedPatchesCacheKey === s && e.sortedPatchesCache)
1823
+ return e.sortedPatchesCache;
1824
+ const r = [...e.patches.values()].sort((n, i) => n.ordinal - i.ordinal);
1825
+ return e.sortedPatchesCache = r, e.sortedPatchesCacheKey = s, r;
1826
+ }
1827
+ buildPatchCacheKey(e) {
1828
+ if (e.size === 0) return "";
1829
+ let s = "";
1830
+ for (const [r, n] of e)
1831
+ s += s ? `,${r}:${n.ordinal}` : `${r}:${n.ordinal}`;
1832
+ return s;
1833
+ }
1834
+ invalidatePatchCache(e) {
1835
+ e.sortedPatchesCache = void 0, e.sortedPatchesCacheKey = void 0;
1836
+ }
1816
1837
  apply(e) {
1817
1838
  if (this.snapshotMode) {
1818
1839
  if (e.snapshot.type !== "full")
1819
1840
  return !1;
1820
- this.snapshotMode = !1, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.snapshot = {
1841
+ this.snapshotMode = !1, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.viewsDirty = !0, this.patchesDirty = !0, this.payloadsDirty = !0, this.snapshot = {
1821
1842
  views: /* @__PURE__ */ new Map(),
1822
1843
  payloads: /* @__PURE__ */ new Map(),
1823
1844
  optimisticPatches: /* @__PURE__ */ new Map(),
@@ -1834,46 +1855,46 @@ class wn {
1834
1855
  const a = s.type === "diff" && n.isUpdate === !0;
1835
1856
  if (s.version < o.version || s.version === o.version && !a)
1836
1857
  return !1;
1837
- let I = !1;
1838
- if (this.rootViewId || (this.rootViewId = i, I = !0, this.structureChanged = !0), n.optimisticReconcile?.drop)
1839
- for (const l of n.optimisticReconcile.drop)
1840
- o.patches.delete(l) && (I = !0);
1858
+ let l = !1;
1859
+ if (this.rootViewId || (this.rootViewId = i, l = !0, this.structureChanged = !0), n.optimisticReconcile?.drop)
1860
+ for (const c of n.optimisticReconcile.drop)
1861
+ o.patches.delete(c) && (l = !0, this.patchesDirty = !0, this.invalidatePatchCache(o));
1841
1862
  if (n.optimisticPatch?.supersedes)
1842
- for (const l of n.optimisticPatch.supersedes)
1843
- o.patches.delete(l) && (I = !0);
1844
- const E = o.composite ?? o.baseline;
1863
+ for (const c of n.optimisticPatch.supersedes)
1864
+ o.patches.delete(c) && (l = !0, this.patchesDirty = !0, this.invalidatePatchCache(o));
1865
+ const I = o.composite ?? o.baseline;
1845
1866
  if (s.type === "full")
1846
- o.baseline = s.root, o.composite = s.root, o.baselineVersion = n.optimisticReconcile?.baseVersion ?? s.version, o.patches.clear(), o.version = s.version, I = !0, this.structureChanged = !0, s.root && O(s.root, this.changedNodeIds);
1867
+ o.baseline = s.root, o.composite = s.root, o.baselineVersion = n.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 && O(s.root, this.changedNodeIds);
1847
1868
  else if (n.optimisticPatch) {
1848
- if (!E)
1869
+ if (!I)
1849
1870
  return !1;
1850
- const l = Y(E, s.diff);
1851
- l !== E && (o.composite = l, I = !0, M(E, l, this.changedNodeIds));
1852
- const c = n.optimisticPatch, _ = {
1853
- id: c.id,
1854
- actionId: c.actionId,
1855
- ordinal: c.ordinal,
1856
- baseVersion: c.baseVersion,
1871
+ const c = K(I, s.diff);
1872
+ c !== I && (o.composite = c, l = !0, this.viewsDirty = !0, Y(I, c, this.changedNodeIds));
1873
+ const E = n.optimisticPatch, _ = {
1874
+ id: E.id,
1875
+ actionId: E.actionId,
1876
+ ordinal: E.ordinal,
1877
+ baseVersion: E.baseVersion,
1857
1878
  diff: s.diff
1858
1879
  };
1859
- o.patches.set(_.id, _), I = !0, o.version = s.version;
1880
+ o.patches.set(_.id, _), this.invalidatePatchCache(o), l = !0, this.patchesDirty = !0, o.version = s.version;
1860
1881
  } else {
1861
- const l = o.baseline ?? E;
1862
- if (!l)
1882
+ const c = o.baseline ?? I;
1883
+ if (!c)
1863
1884
  return !1;
1864
- const c = Y(l, s.diff);
1865
- c !== l ? (o.baseline = c, I = !0) : o.baseline = c, o.baselineVersion = n.optimisticReconcile?.baseVersion ?? s.version;
1866
- let _ = o.baseline ?? c;
1867
- const u = [...o.patches.values()].sort((T, f) => T.ordinal - f.ordinal);
1868
- for (const T of u) {
1869
- const f = Y(_, T.diff);
1870
- f !== _ && (I = !0), _ = f, T.baseVersion = o.baselineVersion;
1871
- }
1872
- o.composite !== _ && (o.composite = _, I = !0), E && _ ? M(E, _, this.changedNodeIds) : _ && O(_, this.changedNodeIds), o.version = s.version;
1885
+ const E = K(c, s.diff);
1886
+ E !== c ? (o.baseline = E, l = !0, this.viewsDirty = !0) : o.baseline = E, o.baselineVersion = n.optimisticReconcile?.baseVersion ?? s.version;
1887
+ let _ = o.baseline ?? E;
1888
+ const h = this.getSortedPatches(o);
1889
+ for (const T of h) {
1890
+ const f = K(_, T.diff);
1891
+ f !== _ && (l = !0, this.viewsDirty = !0), _ = f, T.baseVersion = o.baselineVersion;
1892
+ }
1893
+ o.composite !== _ && (o.composite = _, l = !0, this.viewsDirty = !0), I && _ ? Y(I, _, this.changedNodeIds) : _ && O(_, this.changedNodeIds), o.version = s.version;
1873
1894
  }
1874
- for (const [l, c] of r)
1875
- this.payloads.get(l) !== c && (this.payloads.set(l, c), I = !0);
1876
- return I ? (this.commitSnapshot(), this.notify(), !0) : (o.version = s.version, !1);
1895
+ for (const [c, E] of r)
1896
+ this.payloads.get(c) !== E && (this.payloads.set(c, E), l = !0, this.payloadsDirty = !0);
1897
+ return l ? (this.commitSnapshot(), this.notify(), !0) : (o.version = s.version, !1);
1877
1898
  }
1878
1899
  replaceFromWire(e) {
1879
1900
  const s = {
@@ -1891,44 +1912,44 @@ class wn {
1891
1912
  if (s !== void 0 && this.snapshot.version !== s)
1892
1913
  return !1;
1893
1914
  let r = !1, n = null, i = null, o = null;
1894
- const a = () => (n || (n = new Map(this.snapshot.views)), n), I = () => (i || (i = new Map(this.snapshot.payloads)), i), E = () => (o || (o = new Map(this.snapshot.optimisticPatches)), o);
1915
+ const a = () => (n || (n = new Map(this.snapshot.views)), n), l = () => (i || (i = new Map(this.snapshot.payloads)), i), I = () => (o || (o = new Map(this.snapshot.optimisticPatches)), o);
1895
1916
  if (e.deleteViews && e.deleteViews.length > 0)
1896
1917
  for (const _ of e.deleteViews)
1897
1918
  a().delete(_) && (r = !0, this.structureChanged = !0);
1898
1919
  if (e.upsertViews && e.upsertViews.length > 0)
1899
- for (const [_, u] of e.upsertViews) {
1920
+ for (const [_, h] of e.upsertViews) {
1900
1921
  const T = a(), f = T.get(_);
1901
- f !== u && (T.set(_, u), r = !0, f ? M(f, u, this.changedNodeIds) : (O(u, this.changedNodeIds), this.structureChanged = !0));
1922
+ f !== h && (T.set(_, h), r = !0, f ? Y(f, h, this.changedNodeIds) : (O(h, this.changedNodeIds), this.structureChanged = !0));
1902
1923
  }
1903
1924
  if (e.deletePayloads && e.deletePayloads.length > 0)
1904
1925
  for (const _ of e.deletePayloads)
1905
- I().delete(_) && (r = !0);
1926
+ l().delete(_) && (r = !0);
1906
1927
  if (e.upsertPayloads && e.upsertPayloads.length > 0)
1907
- for (const [_, u] of e.upsertPayloads) {
1908
- const T = I();
1909
- T.get(_) !== u && (T.set(_, u), r = !0);
1928
+ for (const [_, h] of e.upsertPayloads) {
1929
+ const T = l();
1930
+ T.get(_) !== h && (T.set(_, h), r = !0);
1910
1931
  }
1911
1932
  if (e.deleteOptimisticPatchesForViews && e.deleteOptimisticPatchesForViews.length > 0)
1912
1933
  for (const _ of e.deleteOptimisticPatchesForViews)
1913
- E().delete(_) && (r = !0);
1934
+ I().delete(_) && (r = !0);
1914
1935
  if (e.upsertOptimisticPatches && e.upsertOptimisticPatches.length > 0)
1915
- for (const [_, u] of e.upsertOptimisticPatches) {
1916
- const T = E(), f = T.get(_);
1917
- Dn(f, u) || (T.set(_, u), r = !0);
1918
- }
1919
- const l = e.rootViewId ?? this.snapshot.rootViewId;
1920
- l !== this.snapshot.rootViewId && (r = !0, this.structureChanged = !0);
1921
- const c = e.nextVersion;
1922
- if (c !== this.snapshot.version && (r = !0), !r)
1923
- return this.snapshot = { ...this.snapshot, version: c }, !1;
1936
+ for (const [_, h] of e.upsertOptimisticPatches) {
1937
+ const T = I(), f = T.get(_);
1938
+ On(f, h) || (T.set(_, h), r = !0);
1939
+ }
1940
+ const c = e.rootViewId ?? this.snapshot.rootViewId;
1941
+ c !== this.snapshot.rootViewId && (r = !0, this.structureChanged = !0);
1942
+ const E = e.nextVersion;
1943
+ if (E !== this.snapshot.version && (r = !0), !r)
1944
+ return this.snapshot = { ...this.snapshot, version: E }, !1;
1924
1945
  for (const _ of this.changedNodeIds)
1925
1946
  this.nodeVersions.set(_, (this.nodeVersions.get(_) ?? 0) + 1);
1926
1947
  return this.snapshot = {
1927
- rootViewId: l,
1948
+ rootViewId: c,
1928
1949
  views: n ?? new Map(this.snapshot.views),
1929
1950
  payloads: i ?? new Map(this.snapshot.payloads),
1930
1951
  optimisticPatches: o ?? new Map(this.snapshot.optimisticPatches),
1931
- version: c
1952
+ version: E
1932
1953
  }, this.notify(), !0;
1933
1954
  }
1934
1955
  replaceSnapshot(e) {
@@ -1937,14 +1958,14 @@ class wn {
1937
1958
  (s.rootViewId !== e.rootViewId || s.views.size !== e.views.size) && (this.structureChanged = !0);
1938
1959
  for (const [n, i] of e.views) {
1939
1960
  const o = s.views.get(n);
1940
- o ? M(o, i, this.changedNodeIds) : (O(i, this.changedNodeIds), this.structureChanged = !0);
1961
+ o ? Y(o, i, this.changedNodeIds) : (O(i, this.changedNodeIds), this.structureChanged = !0);
1941
1962
  }
1942
1963
  for (const n of this.changedNodeIds)
1943
1964
  this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
1944
1965
  return this.snapshot = e, r && this.notify(), r;
1945
1966
  }
1946
1967
  clear() {
1947
- (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.snapshot = {
1968
+ (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 = {
1948
1969
  views: /* @__PURE__ */ new Map(),
1949
1970
  payloads: /* @__PURE__ */ new Map(),
1950
1971
  optimisticPatches: /* @__PURE__ */ new Map(),
@@ -1962,7 +1983,7 @@ class wn {
1962
1983
  subscribeNode(e, s) {
1963
1984
  let r = this.nodeListeners.get(e);
1964
1985
  return r || (r = /* @__PURE__ */ new Set(), this.nodeListeners.set(e, r)), r.add(s), () => {
1965
- r.delete(s), r.size === 0 && this.nodeListeners.delete(e);
1986
+ r && (r.delete(s), r.size === 0 && this.nodeListeners.delete(e));
1966
1987
  };
1967
1988
  }
1968
1989
  getNode(e) {
@@ -1970,7 +1991,7 @@ class wn {
1970
1991
  if (s)
1971
1992
  return s;
1972
1993
  for (const r of this.snapshot.views.values()) {
1973
- const n = xt(r, e);
1994
+ const n = Yt(r, e);
1974
1995
  if (n)
1975
1996
  return n;
1976
1997
  }
@@ -1992,33 +2013,46 @@ class wn {
1992
2013
  this.changedNodeIds.clear();
1993
2014
  }
1994
2015
  commitSnapshot() {
1995
- const e = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1996
- for (const [n, i] of this.views)
1997
- if (i.composite ? e.set(n, i.composite) : i.baseline && e.set(n, i.baseline), i.patches.size > 0) {
1998
- const o = [...i.patches.values()].sort((a, I) => a.ordinal - I.ordinal);
1999
- s.set(
2000
- n,
2001
- o.map((a) => ({
2002
- id: a.id,
2003
- actionId: a.actionId,
2004
- ordinal: a.ordinal,
2005
- baseVersion: a.baseVersion
2006
- }))
2007
- );
2008
- }
2009
- let r = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
2010
- if (r === void 0)
2011
- for (const n of this.views.values())
2012
- r = r === void 0 ? n.version : Math.max(r, n.version);
2016
+ let e, s, r;
2017
+ if (this.viewsDirty) {
2018
+ const i = /* @__PURE__ */ new Map();
2019
+ for (const [o, a] of this.views)
2020
+ a.composite ? i.set(o, a.composite) : a.baseline && i.set(o, a.baseline);
2021
+ e = i, this.viewsDirty = !1;
2022
+ } else
2023
+ e = this.snapshot.views;
2024
+ if (this.patchesDirty) {
2025
+ const i = /* @__PURE__ */ new Map();
2026
+ for (const [o, a] of this.views)
2027
+ if (a.patches.size > 0) {
2028
+ const l = this.getSortedPatches(a);
2029
+ i.set(
2030
+ o,
2031
+ l.map((I) => ({
2032
+ id: I.id,
2033
+ actionId: I.actionId,
2034
+ ordinal: I.ordinal,
2035
+ baseVersion: I.baseVersion
2036
+ }))
2037
+ );
2038
+ }
2039
+ s = i, this.patchesDirty = !1;
2040
+ } else
2041
+ s = this.snapshot.optimisticPatches;
2042
+ this.payloadsDirty ? (r = new Map(this.payloads), this.payloadsDirty = !1) : r = this.snapshot.payloads;
2043
+ let n = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
2044
+ if (n === void 0)
2045
+ for (const i of this.views.values())
2046
+ n = n === void 0 ? i.version : Math.max(n, i.version);
2013
2047
  this.snapshot = {
2014
2048
  rootViewId: this.rootViewId,
2015
2049
  views: e,
2016
- payloads: new Map(this.payloads),
2050
+ payloads: r,
2017
2051
  optimisticPatches: s,
2018
- version: r
2052
+ version: n
2019
2053
  };
2020
- for (const n of this.changedNodeIds)
2021
- this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
2054
+ for (const i of this.changedNodeIds)
2055
+ this.nodeVersions.set(i, (this.nodeVersions.get(i) ?? 0) + 1);
2022
2056
  }
2023
2057
  notify() {
2024
2058
  if (this.notifyNodes(), this.structureChanged) {
@@ -2028,7 +2062,7 @@ class wn {
2028
2062
  }
2029
2063
  }
2030
2064
  }
2031
- class Un {
2065
+ class Rn {
2032
2066
  streams = /* @__PURE__ */ new Map();
2033
2067
  listeners = /* @__PURE__ */ new Set();
2034
2068
  apply(e, s) {
@@ -2092,19 +2126,19 @@ class Un {
2092
2126
  }
2093
2127
  getOrCreateStreamEntry(e) {
2094
2128
  let s = this.streams.get(e);
2095
- return s || (s = { store: new wn() }, this.streams.set(e, s)), s;
2129
+ return s || (s = { store: new Dn() }, this.streams.set(e, s)), s;
2096
2130
  }
2097
2131
  notify(e) {
2098
2132
  for (const s of this.listeners)
2099
2133
  s(e);
2100
2134
  }
2101
2135
  }
2102
- function Y(t, e, s) {
2136
+ function K(t, e, s) {
2103
2137
  if (t.id !== e.id)
2104
2138
  return t;
2105
2139
  let r = t, n = !1;
2106
2140
  if (e.textUpdates.length > 0) {
2107
- const f = mn(t, e.textUpdates);
2141
+ const f = Pn(t, e.textUpdates);
2108
2142
  r = f.node, n = f.changed;
2109
2143
  }
2110
2144
  let i = !1, o = r.props;
@@ -2113,40 +2147,40 @@ function Y(t, e, s) {
2113
2147
  const S = o[f];
2114
2148
  if (N === void 0)
2115
2149
  (S !== void 0 || f in o) && (i || (o = v(o), i = !0), delete o[f]);
2116
- else if (J(N)) {
2117
- const L = v(N);
2118
- b(L, S) || (i || (o = v(o), i = !0), o[f] = L);
2150
+ else if (q(N)) {
2151
+ const m = v(N);
2152
+ b(m, S) || (i || (o = v(o), i = !0), o[f] = m);
2119
2153
  } else
2120
2154
  b(N, S) || (i || (o = v(o), i = !0), o[f] = N);
2121
2155
  }
2122
- let a = !1, I = r.styleIds;
2123
- e.styleIds !== void 0 && (Ht(r.styleIds, e.styleIds) || (I = e.styleIds, a = !0));
2124
- const E = r.children ?? [];
2125
- let l = E, c = !1;
2156
+ let a = !1, l = r.styleIds;
2157
+ e.styleIds !== void 0 && (Kt(r.styleIds, e.styleIds) || (l = e.styleIds, a = !0));
2158
+ const I = r.children ?? [];
2159
+ let c = I, E = !1;
2126
2160
  if (e.removed.length > 0) {
2127
- const f = new Set(e.removed), N = l.filter((S) => !f.has(S.id));
2128
- N.length !== l.length && (l = N, c = !0);
2161
+ const f = new Set(e.removed), N = c.filter((S) => !f.has(S.id));
2162
+ N.length !== c.length && (c = N, E = !0);
2129
2163
  }
2130
2164
  if (e.updated.length > 0) {
2131
2165
  const f = new Map(e.updated.map((S) => [S.id, S]));
2132
2166
  let N;
2133
- for (let S = 0; S < l.length; S++) {
2134
- const L = l[S], rt = f.get(L.id);
2135
- if (!rt)
2167
+ for (let S = 0; S < c.length; S++) {
2168
+ const m = c[S], nt = f.get(m.id);
2169
+ if (!nt)
2136
2170
  continue;
2137
- const nt = Y(L, rt);
2138
- nt !== L && (N || (N = [...l]), N[S] = nt);
2171
+ const it = K(m, nt);
2172
+ it !== m && (N || (N = [...c]), N[S] = it);
2139
2173
  }
2140
- N && (l = N, c = !0);
2174
+ N && (c = N, E = !0);
2141
2175
  }
2142
- e.added.length > 0 && (l = [...l, ...e.added], c = !0);
2176
+ e.added.length > 0 && (c = [...c, ...e.added], E = !0);
2143
2177
  const _ = r.type !== e.type;
2144
- return n || i || _ || a || c ? !i && !c && !_ && !a ? r : {
2178
+ return n || i || _ || a || E ? !i && !E && !_ && !a ? r : {
2145
2179
  id: e.id,
2146
2180
  type: e.type,
2147
2181
  props: i ? o : r.props,
2148
- children: c ? l : E,
2149
- styleIds: a ? I : r.styleIds
2182
+ children: E ? c : I,
2183
+ styleIds: a ? l : r.styleIds
2150
2184
  } : t;
2151
2185
  }
2152
2186
  function O(t, e) {
@@ -2154,39 +2188,48 @@ function O(t, e) {
2154
2188
  for (const s of t.children)
2155
2189
  O(s, e);
2156
2190
  }
2157
- function M(t, e, s) {
2191
+ const H = [];
2192
+ function mn(t) {
2193
+ for (; H.length <= t; )
2194
+ H.push(/* @__PURE__ */ new Map());
2195
+ return H[t].clear(), H[t];
2196
+ }
2197
+ function Y(t, e, s) {
2198
+ Ht(t, e, s, 0);
2199
+ }
2200
+ function Ht(t, e, s, r) {
2158
2201
  if (t === e)
2159
2202
  return;
2160
- (t.type !== e.type || !Rn(t.props, e.props) || !Ht(t.styleIds, e.styleIds)) && s.add(e.id);
2161
- const n = t.children ?? [], i = e.children ?? [];
2162
- if (n !== i) {
2163
- const o = /* @__PURE__ */ new Map();
2164
- for (const a of n)
2165
- o.set(a.id, a);
2166
- for (const a of i) {
2167
- const I = o.get(a.id);
2168
- I ? M(I, a, s) : O(a, s);
2203
+ (t.type !== e.type || !Ln(t.props, e.props) || !Kt(t.styleIds, e.styleIds)) && s.add(e.id);
2204
+ const i = t.children ?? [], o = e.children ?? [];
2205
+ if (i !== o) {
2206
+ const a = mn(r);
2207
+ for (const l of i)
2208
+ a.set(l.id, l);
2209
+ for (const l of o) {
2210
+ const I = a.get(l.id);
2211
+ I ? Ht(I, l, s, r + 1) : O(l, s);
2169
2212
  }
2170
- n.length !== i.length && s.add(e.id);
2213
+ i.length !== o.length && s.add(e.id);
2171
2214
  }
2172
2215
  }
2173
- function Rn(t, e) {
2216
+ function Ln(t, e) {
2174
2217
  return b(t, e);
2175
2218
  }
2176
- function xt(t, e) {
2219
+ function Yt(t, e) {
2177
2220
  if (t.id === e)
2178
2221
  return t;
2179
2222
  if (t.children)
2180
2223
  for (const s of t.children) {
2181
- const r = xt(s, e);
2224
+ const r = Yt(s, e);
2182
2225
  if (r)
2183
2226
  return r;
2184
2227
  }
2185
2228
  }
2186
- function Ht(t, e) {
2229
+ function Kt(t, e) {
2187
2230
  return b(t, e);
2188
2231
  }
2189
- function Dn(t, e) {
2232
+ function On(t, e) {
2190
2233
  if (t === e) return !0;
2191
2234
  if (!t || !e || t.length !== e.length) return !1;
2192
2235
  for (let s = 0; s < t.length; s++) {
@@ -2196,24 +2239,24 @@ function Dn(t, e) {
2196
2239
  }
2197
2240
  return !0;
2198
2241
  }
2199
- function Ln(t, e) {
2242
+ function gn(t, e) {
2200
2243
  if (e.length === 0)
2201
2244
  return t;
2202
2245
  const s = [...e].sort((i, o) => i.start - o.start);
2203
2246
  let r = t, n = 0;
2204
2247
  for (const i of s) {
2205
- const o = ot(i.start + n, 0, r.length);
2248
+ const o = at(i.start + n, 0, r.length);
2206
2249
  if (i.end == null) {
2207
- const l = r.slice(o), c = On(l, i.insertedText);
2208
- r = r.slice(0, o) + i.insertedText + l.slice(c), n += i.insertedText.length - c;
2250
+ const c = r.slice(o), E = bn(c, i.insertedText);
2251
+ r = r.slice(0, o) + i.insertedText + c.slice(E), n += i.insertedText.length - E;
2209
2252
  continue;
2210
2253
  }
2211
- const a = i.end + n, I = ot(a, o, r.length), E = I - o;
2212
- r = r.slice(0, o) + i.insertedText + r.slice(I), n += i.insertedText.length - E;
2254
+ const a = i.end + n, l = at(a, o, r.length), I = l - o;
2255
+ r = r.slice(0, o) + i.insertedText + r.slice(l), n += i.insertedText.length - I;
2213
2256
  }
2214
2257
  return r;
2215
2258
  }
2216
- function mn(t, e, s) {
2259
+ function Pn(t, e, s) {
2217
2260
  if (e.length === 0)
2218
2261
  return { node: t, changed: !1 };
2219
2262
  const r = /* @__PURE__ */ new Map();
@@ -2221,48 +2264,48 @@ function mn(t, e, s) {
2221
2264
  const i = r.get(n.nodeId);
2222
2265
  i ? i.push(n) : r.set(n.nodeId, [n]);
2223
2266
  }
2224
- return Yt(t, r);
2267
+ return $t(t, r);
2225
2268
  }
2226
- function Yt(t, e, s) {
2269
+ function $t(t, e, s) {
2227
2270
  const r = e.get(t.id) ?? [];
2228
2271
  let n = !1, i = t.props;
2229
2272
  if (r.length > 0) {
2230
- const E = /* @__PURE__ */ new Map();
2231
- for (const l of r) {
2232
- const c = E.get(l.propertyName);
2233
- c ? c.push(l) : E.set(l.propertyName, [l]);
2273
+ const I = /* @__PURE__ */ new Map();
2274
+ for (const c of r) {
2275
+ const E = I.get(c.propertyName);
2276
+ E ? E.push(c) : I.set(c.propertyName, [c]);
2234
2277
  }
2235
- for (const [l, c] of E.entries()) {
2236
- const _ = i[l], T = Ln(typeof _ == "string" ? _ : "", c);
2237
- n || (i = v(i), n = !0), i[l] = T;
2278
+ for (const [c, E] of I.entries()) {
2279
+ const _ = i[c], T = gn(typeof _ == "string" ? _ : "", E);
2280
+ n || (i = v(i), n = !0), i[c] = T;
2238
2281
  }
2239
2282
  }
2240
2283
  let o = !1;
2241
2284
  const a = t.children ?? [];
2242
- let I = a;
2285
+ let l = a;
2243
2286
  if (a.length > 0) {
2244
- let E;
2245
- for (let l = 0; l < a.length; l++) {
2246
- const c = a[l], _ = Yt(c, e);
2247
- _.changed && (E || (E = [...a]), E[l] = _.node);
2287
+ let I;
2288
+ for (let c = 0; c < a.length; c++) {
2289
+ const E = a[c], _ = $t(E, e);
2290
+ _.changed && (I || (I = [...a]), I[c] = _.node);
2248
2291
  }
2249
- E && (I = E, o = !0);
2292
+ I && (l = I, o = !0);
2250
2293
  }
2251
2294
  return !n && !o ? { node: t, changed: !1 } : {
2252
2295
  node: {
2253
2296
  id: t.id,
2254
2297
  type: t.type,
2255
2298
  props: n ? i : t.props,
2256
- children: o ? I : a,
2299
+ children: o ? l : a,
2257
2300
  styleIds: t.styleIds
2258
2301
  },
2259
2302
  changed: !0
2260
2303
  };
2261
2304
  }
2262
- function ot(t, e, s) {
2305
+ function at(t, e, s) {
2263
2306
  return Math.max(e, Math.min(s, t));
2264
2307
  }
2265
- function On(t, e) {
2308
+ function bn(t, e) {
2266
2309
  const s = Math.min(t.length, e.length);
2267
2310
  let r = 0;
2268
2311
  for (; r < s && t.charCodeAt(r) === e.charCodeAt(r); )
@@ -2275,7 +2318,7 @@ function v(t) {
2275
2318
  e[s] = r;
2276
2319
  return e;
2277
2320
  }
2278
- function J(t) {
2321
+ function q(t) {
2279
2322
  return typeof t == "object" && t !== null && !Array.isArray(t);
2280
2323
  }
2281
2324
  function b(t, e) {
@@ -2289,7 +2332,7 @@ function b(t, e) {
2289
2332
  return !1;
2290
2333
  return !0;
2291
2334
  }
2292
- if (J(t) && J(e)) {
2335
+ if (q(t) && q(e)) {
2293
2336
  const s = Object.keys(t), r = Object.keys(e);
2294
2337
  if (s.length !== r.length)
2295
2338
  return !1;
@@ -2300,20 +2343,20 @@ function b(t, e) {
2300
2343
  }
2301
2344
  return !1;
2302
2345
  }
2303
- const gn = 16, Pn = 50, R = new Un(), $ = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
2304
- let jt = gn, $t = Pn, V = [], k = null, G = null, U = 0, j = 0;
2305
- const B = /* @__PURE__ */ new Map();
2306
- function bn() {
2346
+ const pn = 16, Fn = 50, D = new Rn(), j = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
2347
+ let jt = pn, Xt = Fn, M = [], V = null, k = null, U = 0, $ = 0;
2348
+ const G = /* @__PURE__ */ new Map();
2349
+ function vn() {
2307
2350
  return typeof performance < "u" ? performance.now() : Date.now();
2308
2351
  }
2309
- function Fn() {
2352
+ function Mn() {
2310
2353
  try {
2311
2354
  return crypto.randomUUID();
2312
2355
  } catch {
2313
2356
  return `${Date.now()}_${Math.random().toString(16).slice(2)}`;
2314
2357
  }
2315
2358
  }
2316
- function pn(t) {
2359
+ function Vn(t) {
2317
2360
  return {
2318
2361
  streamId: t.streamId,
2319
2362
  category: t.category,
@@ -2324,7 +2367,7 @@ function pn(t) {
2324
2367
  optimisticPatches: Array.from(t.optimisticPatches.entries()).map(([e, s]) => [e, [...s]])
2325
2368
  };
2326
2369
  }
2327
- function Mn(t, e) {
2370
+ function kn(t, e) {
2328
2371
  if (t === e) return !0;
2329
2372
  if (!t || !e || t.length !== e.length) return !1;
2330
2373
  for (let s = 0; s < t.length; s++) {
@@ -2334,26 +2377,26 @@ function Mn(t, e) {
2334
2377
  }
2335
2378
  return !0;
2336
2379
  }
2337
- function vn(t, e, s) {
2380
+ function Gn(t, e, s) {
2338
2381
  if (!s || s.version === -1)
2339
- return { type: "ReplaceStreamSnapshot", snapshot: pn(e) };
2382
+ return { type: "ReplaceStreamSnapshot", snapshot: Vn(e) };
2340
2383
  const r = [], n = [];
2341
- for (const [E, l] of e.views.entries())
2342
- s.views.get(E) !== l && r.push([E, l]);
2343
- for (const E of s.views.keys())
2344
- e.views.has(E) || n.push(E);
2384
+ for (const [I, c] of e.views.entries())
2385
+ s.views.get(I) !== c && r.push([I, c]);
2386
+ for (const I of s.views.keys())
2387
+ e.views.has(I) || n.push(I);
2345
2388
  const i = [], o = [];
2346
- for (const [E, l] of e.payloads.entries())
2347
- s.payloads.get(E) !== l && i.push([E, l]);
2348
- for (const E of s.payloads.keys())
2349
- e.payloads.has(E) || o.push(E);
2350
- const a = [], I = [];
2351
- for (const [E, l] of e.optimisticPatches.entries()) {
2352
- const c = s.optimisticPatches.get(E);
2353
- Mn(c, l) || a.push([E, [...l]]);
2354
- }
2355
- for (const E of s.optimisticPatches.keys())
2356
- e.optimisticPatches.has(E) || I.push(E);
2389
+ for (const [I, c] of e.payloads.entries())
2390
+ s.payloads.get(I) !== c && i.push([I, c]);
2391
+ for (const I of s.payloads.keys())
2392
+ e.payloads.has(I) || o.push(I);
2393
+ const a = [], l = [];
2394
+ for (const [I, c] of e.optimisticPatches.entries()) {
2395
+ const E = s.optimisticPatches.get(I);
2396
+ kn(E, c) || a.push([I, [...c]]);
2397
+ }
2398
+ for (const I of s.optimisticPatches.keys())
2399
+ e.optimisticPatches.has(I) || l.push(I);
2357
2400
  return {
2358
2401
  type: "PatchStreamSnapshot",
2359
2402
  streamId: t,
@@ -2366,66 +2409,66 @@ function vn(t, e, s) {
2366
2409
  upsertPayloads: i.length ? i : void 0,
2367
2410
  deletePayloads: o.length ? o : void 0,
2368
2411
  upsertOptimisticPatches: a.length ? a : void 0,
2369
- deleteOptimisticPatchesForViews: I.length ? I : void 0
2412
+ deleteOptimisticPatchesForViews: l.length ? l : void 0
2370
2413
  };
2371
2414
  }
2372
- function Kt() {
2373
- k || (k = setTimeout(at, jt)), G || (G = setTimeout(at, $t));
2415
+ function zt() {
2416
+ V || (V = setTimeout(lt, jt)), k || (k = setTimeout(lt, Xt));
2374
2417
  }
2375
- function F(t) {
2376
- V.push(t), Kt();
2418
+ function p(t) {
2419
+ M.push(t), zt();
2377
2420
  }
2378
- function at() {
2379
- if (k && (clearTimeout(k), k = null), G && (clearTimeout(G), G = null), V.length === 0 && B.size === 0) {
2380
- U = 0, j = 0;
2421
+ function lt() {
2422
+ if (V && (clearTimeout(V), V = null), k && (clearTimeout(k), k = null), M.length === 0 && G.size === 0) {
2423
+ U = 0, $ = 0;
2381
2424
  return;
2382
2425
  }
2383
- const t = Array.from(B.entries()).map(([s, r]) => ({ trackId: s, version: r })), e = {
2384
- batchId: Fn(),
2385
- createdAtMs: bn(),
2386
- ops: V,
2426
+ const t = Array.from(G.entries()).map(([s, r]) => ({ trackId: s, version: r })), e = {
2427
+ batchId: Mn(),
2428
+ createdAtMs: vn(),
2429
+ ops: M,
2387
2430
  ...t.length > 0 ? { acks: t } : {},
2388
- stats: { uiMessagesConsumed: U, bytesConsumed: j }
2431
+ stats: { uiMessagesConsumed: U, bytesConsumed: $ }
2389
2432
  };
2390
- V = [], U = 0, j = 0, B.clear(), self.postMessage(e);
2433
+ M = [], U = 0, $ = 0, G.clear(), self.postMessage(e);
2391
2434
  }
2392
- function Xt(t) {
2435
+ function Wt(t) {
2393
2436
  return `${t.senderId}_${t.trackId}`;
2394
2437
  }
2395
- function Vn(t) {
2396
- const e = Xs(t), s = /* @__PURE__ */ new Set();
2438
+ function Bn(t) {
2439
+ const e = Ws(t), s = /* @__PURE__ */ new Set();
2397
2440
  for (const r of Object.values(e.UIStreams ?? {})) {
2398
2441
  const n = r.StreamId;
2399
2442
  s.add(n);
2400
2443
  const i = r.Info?.Category;
2401
- R.getSnapshot(n)?.category !== i && (R.setCategory(n, i), F({ type: "SetStreamCategory", streamId: n, category: i }));
2444
+ D.getSnapshot(n)?.category !== i && (D.setCategory(n, i), p({ type: "SetStreamCategory", streamId: n, category: i }));
2402
2445
  }
2403
- for (const r of R.getSnapshots())
2404
- s.has(r.streamId) || (R.remove(r.streamId), x.delete(r.streamId), F({ type: "RemoveStream", streamId: r.streamId }));
2446
+ for (const r of D.getSnapshots())
2447
+ s.has(r.streamId) || (D.remove(r.streamId), B.delete(r.streamId), p({ type: "RemoveStream", streamId: r.streamId }));
2405
2448
  }
2406
- function kn(t) {
2407
- const e = q(t), s = Xt(e), r = un(t), n = yn(r), i = B.get(e.trackId);
2408
- if ((i === void 0 || n.snapshot.version > i) && (B.set(e.trackId, n.snapshot.version), Kt()), !R.apply(s, n))
2449
+ function xn(t) {
2450
+ const e = Q(t), s = Wt(e), r = Tn(t), n = wn(r), i = G.get(e.trackId);
2451
+ if ((i === void 0 || n.snapshot.version > i) && (G.set(e.trackId, n.snapshot.version), zt()), !D.apply(s, n))
2409
2452
  return;
2410
- const a = R.getSnapshot(s);
2453
+ const a = D.getSnapshot(s);
2411
2454
  if (!a)
2412
2455
  return;
2413
- const I = x.get(s);
2414
- x.set(s, a), F(vn(s, a, I));
2456
+ const l = B.get(s);
2457
+ B.set(s, a), p(Gn(s, a, l));
2415
2458
  }
2416
- function Gn(t) {
2417
- const e = Hr(t);
2459
+ function Hn(t) {
2460
+ const e = Kr(t);
2418
2461
  if (!e.StyleId)
2419
2462
  return;
2420
2463
  const s = {
2421
2464
  styleId: e.StyleId,
2422
2465
  css: e.Style?.css,
2423
2466
  common: e.Style?.common
2424
- }, r = $.get(s.styleId);
2425
- r && r.css === s.css && r.common === s.common || ($.set(s.styleId, s), F({ type: "UpsertUiStyle", style: s }));
2467
+ }, r = j.get(s.styleId);
2468
+ r && r.css === s.css && r.common === s.common || (j.set(s.styleId, s), p({ type: "UpsertUiStyle", style: s }));
2426
2469
  }
2427
- function Bn(t) {
2428
- const e = qr(t);
2470
+ function Yn(t) {
2471
+ const e = Zr(t);
2429
2472
  if (e.Styles)
2430
2473
  for (const s of e.Styles) {
2431
2474
  if (!s.StyleId)
@@ -2434,39 +2477,39 @@ function Bn(t) {
2434
2477
  styleId: s.StyleId,
2435
2478
  css: s.Style?.css,
2436
2479
  common: s.Style?.common
2437
- }, n = $.get(r.styleId);
2438
- n && n.css === r.css && n.common === r.common || ($.set(r.styleId, r), F({ type: "UpsertUiStyle", style: r }));
2480
+ }, n = j.get(r.styleId);
2481
+ n && n.css === r.css && n.common === r.common || (j.set(r.styleId, r), p({ type: "UpsertUiStyle", style: r }));
2439
2482
  }
2440
2483
  }
2441
- function xn(t) {
2442
- const e = q(t), s = Xt(e);
2443
- R.clear(s), x.delete(s), F({ type: "ClearStream", streamId: s });
2484
+ function Kn(t) {
2485
+ const e = Q(t), s = Wt(e);
2486
+ D.clear(s), B.delete(s), p({ type: "ClearStream", streamId: s });
2444
2487
  }
2445
- function Hn(t) {
2488
+ function $n(t) {
2446
2489
  const e = new Uint8Array(t);
2447
- j += e.byteLength;
2490
+ $ += e.byteLength;
2448
2491
  const s = e;
2449
- switch (zt(s)) {
2450
- case m.CORE_GLOBAL_STATE:
2451
- Vn(s), U++;
2492
+ switch (Jt(s)) {
2493
+ case L.CORE_GLOBAL_STATE:
2494
+ Bn(s), U++;
2452
2495
  return;
2453
- case m.UI_UPDATE:
2496
+ case L.UI_UPDATE:
2454
2497
  try {
2455
- kn(s);
2498
+ xn(s);
2456
2499
  } catch (n) {
2457
2500
  return n instanceof C, void 0;
2458
2501
  } finally {
2459
2502
  U++;
2460
2503
  }
2461
2504
  return;
2462
- case m.UI_STYLES:
2463
- Gn(s), U++;
2505
+ case L.UI_STYLES:
2506
+ Hn(s), U++;
2464
2507
  return;
2465
- case m.UI_STYLES_BATCH:
2466
- Bn(s), U++;
2508
+ case L.UI_STYLES_BATCH:
2509
+ Yn(s), U++;
2467
2510
  return;
2468
- case m.ACTION_UI_CLEAR_STREAM:
2469
- xn(s), U++;
2511
+ case L.ACTION_UI_CLEAR_STREAM:
2512
+ Kn(s), U++;
2470
2513
  return;
2471
2514
  default:
2472
2515
  return;
@@ -2475,12 +2518,12 @@ function Hn(t) {
2475
2518
  self.addEventListener("message", (t) => {
2476
2519
  const e = t.data;
2477
2520
  if (e.type === "configure") {
2478
- typeof e.flushIntervalMs == "number" && Number.isFinite(e.flushIntervalMs) && e.flushIntervalMs >= 0 && (jt = e.flushIntervalMs), typeof e.maxLatencyMs == "number" && Number.isFinite(e.maxLatencyMs) && e.maxLatencyMs >= 0 && ($t = e.maxLatencyMs);
2521
+ typeof e.flushIntervalMs == "number" && Number.isFinite(e.flushIntervalMs) && e.flushIntervalMs >= 0 && (jt = e.flushIntervalMs), typeof e.maxLatencyMs == "number" && Number.isFinite(e.maxLatencyMs) && e.maxLatencyMs >= 0 && (Xt = e.maxLatencyMs);
2479
2522
  return;
2480
2523
  }
2481
2524
  if (e.type === "clear") {
2482
- V = [], x.clear();
2525
+ M = [], B.clear();
2483
2526
  return;
2484
2527
  }
2485
- e.type === "protocol" && Hn(e.message);
2528
+ e.type === "protocol" && $n(e.message);
2486
2529
  });