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