@ikonai/sdk 1.0.33 → 1.0.35
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/{audio-playback-worker-CVB6ftYO.js → audio-playback-worker-Box5TifN.js} +207 -207
- package/assets/{protocol-worker-BNeN5rOx.js → protocol-worker-C3oOno6C.js} +375 -372
- package/assets/{video-capture-worker-g7UF_osl.js → video-capture-worker-reG7QGzz.js} +176 -176
- package/assets/{video-playback-worker-DSozRiYd.js → video-playback-worker-CpHuZKgE.js} +404 -404
- package/client/endpoint-selector.d.ts +2 -2
- package/client/ikon-client-config.d.ts +12 -4
- package/client/ikon-client.d.ts +7 -0
- package/functions/function-registry.d.ts +8 -1
- package/index.js +1994 -1869
- package/media/video-constants.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,99 +2,99 @@ const J = {
|
|
|
2
2
|
Compressed: 8
|
|
3
3
|
};
|
|
4
4
|
function Z(t) {
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
5
|
+
const r = g(t), e = new DataView(r.buffer, r.byteOffset, r.byteLength);
|
|
6
|
+
if (r.length < 27)
|
|
7
7
|
throw new Error("Protocol payload too short");
|
|
8
|
-
const n =
|
|
9
|
-
if (27 + N * 4 >
|
|
8
|
+
const n = e.getUint32(0, !0), s = e.getUint32(4, !0), _ = e.getUint32(8, !0), E = e.getUint32(12, !0), i = e.getUint32(16, !0), N = e.getUint32(20, !0), C = e.getUint8(24), m = e.getUint8(25), Q = e.getUint8(26);
|
|
9
|
+
if (27 + N * 4 > r.length)
|
|
10
10
|
throw new Error("Protocol header exceeds payload length");
|
|
11
11
|
const H = [];
|
|
12
12
|
let K = 27;
|
|
13
13
|
for (let x = 0; x < N; x++)
|
|
14
|
-
H.push(
|
|
14
|
+
H.push(e.getUint32(K, !0)), K += 4;
|
|
15
15
|
return {
|
|
16
16
|
length: n,
|
|
17
17
|
opcode: s,
|
|
18
|
-
senderId:
|
|
19
|
-
trackId:
|
|
18
|
+
senderId: _,
|
|
19
|
+
trackId: E,
|
|
20
20
|
sequenceId: i,
|
|
21
21
|
targetIds: H,
|
|
22
|
-
payloadVersion:
|
|
22
|
+
payloadVersion: C,
|
|
23
23
|
payloadType: m,
|
|
24
24
|
flags: Q
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
async function k(t,
|
|
28
|
-
const n =
|
|
29
|
-
if (
|
|
27
|
+
async function k(t, r, e) {
|
|
28
|
+
const n = g(t), s = Z(n);
|
|
29
|
+
if (r !== void 0 && s.opcode !== r)
|
|
30
30
|
throw new Error(`Unexpected opcode ${s.opcode}`);
|
|
31
31
|
if (s.payloadType !== 8)
|
|
32
32
|
throw new Error(`Unexpected payload type ${s.payloadType}`);
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
return (s.flags & J.Compressed) !== 0 && (
|
|
33
|
+
const _ = 27 + s.targetIds.length * 4;
|
|
34
|
+
let E = n.subarray(_, s.length);
|
|
35
|
+
return (s.flags & J.Compressed) !== 0 && (E = await p(E)), E;
|
|
36
36
|
}
|
|
37
37
|
async function p(t) {
|
|
38
38
|
if (typeof DecompressionStream > "u")
|
|
39
39
|
throw new Error("DecompressionStream not supported");
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const s =
|
|
43
|
-
let
|
|
40
|
+
const r = new DecompressionStream("gzip"), e = r.writable.getWriter(), n = new Uint8Array(t);
|
|
41
|
+
e.write(n), e.close();
|
|
42
|
+
const s = r.readable.getReader(), _ = [];
|
|
43
|
+
let E = 0;
|
|
44
44
|
for (; ; ) {
|
|
45
|
-
const { done:
|
|
46
|
-
if (
|
|
47
|
-
|
|
45
|
+
const { done: C, value: m } = await s.read();
|
|
46
|
+
if (C) break;
|
|
47
|
+
_.push(m), E += m.length;
|
|
48
48
|
}
|
|
49
|
-
const i = new Uint8Array(
|
|
49
|
+
const i = new Uint8Array(E);
|
|
50
50
|
let N = 0;
|
|
51
|
-
for (let
|
|
52
|
-
i.set(
|
|
51
|
+
for (let C = 0; C < _.length; C++)
|
|
52
|
+
i.set(_[C], N), N += _[C].length;
|
|
53
53
|
return i;
|
|
54
54
|
}
|
|
55
|
-
var
|
|
56
|
-
const tt = 161,
|
|
55
|
+
var l = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(l || {});
|
|
56
|
+
const tt = 161, rt = 162;
|
|
57
57
|
new TextEncoder();
|
|
58
|
-
const
|
|
59
|
-
class
|
|
60
|
-
constructor(
|
|
61
|
-
this.buffer =
|
|
58
|
+
const et = new TextDecoder("utf-8", { fatal: !0 });
|
|
59
|
+
class P {
|
|
60
|
+
constructor(r, e, n) {
|
|
61
|
+
this.buffer = r, this.version = e, this.offset = n, this.end = r.length - 1;
|
|
62
62
|
}
|
|
63
63
|
offset;
|
|
64
64
|
end;
|
|
65
|
-
static create(
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
65
|
+
static create(r) {
|
|
66
|
+
const e = g(r);
|
|
67
|
+
if (e.length < 2)
|
|
68
68
|
throw new Error("Teleport payload too short");
|
|
69
|
-
if (
|
|
69
|
+
if (e[0] !== tt || e[e.length - 1] !== rt)
|
|
70
70
|
throw new Error("Teleport object missing markers");
|
|
71
|
-
const n = { offset: 1 }, s =
|
|
72
|
-
return new
|
|
71
|
+
const n = { offset: 1 }, s = A(e, n, "InvalidLength");
|
|
72
|
+
return new P(e, s, n.offset);
|
|
73
73
|
}
|
|
74
74
|
next() {
|
|
75
75
|
if (this.offset >= this.end)
|
|
76
76
|
return null;
|
|
77
77
|
if (this.offset + 5 > this.buffer.length)
|
|
78
78
|
throw new Error("Teleport object truncated");
|
|
79
|
-
const
|
|
79
|
+
const r = Et(this.buffer, this.offset);
|
|
80
80
|
this.offset += 4;
|
|
81
|
-
const
|
|
82
|
-
if ((
|
|
81
|
+
const e = this.buffer[this.offset++], n = e >> 4 & 15;
|
|
82
|
+
if ((e & 15) !== 0)
|
|
83
83
|
throw new Error("Teleport field flags must be zero");
|
|
84
|
-
const s =
|
|
85
|
-
let
|
|
84
|
+
const s = S(n);
|
|
85
|
+
let _;
|
|
86
86
|
if (s >= 0)
|
|
87
|
-
a(this.buffer, this.offset, s),
|
|
87
|
+
a(this.buffer, this.offset, s), _ = this.buffer.subarray(this.offset, this.offset + s), this.offset += s;
|
|
88
88
|
else {
|
|
89
|
-
const
|
|
90
|
-
a(this.buffer,
|
|
89
|
+
const E = { offset: this.offset }, i = A(this.buffer, E, "InvalidLength");
|
|
90
|
+
a(this.buffer, E.offset, i), _ = this.buffer.subarray(E.offset, E.offset + i), this.offset = E.offset + i;
|
|
91
91
|
}
|
|
92
|
-
return new nt(
|
|
92
|
+
return new nt(r, n, _);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
class
|
|
96
|
-
constructor(
|
|
97
|
-
this.type =
|
|
95
|
+
class f {
|
|
96
|
+
constructor(r, e) {
|
|
97
|
+
this.type = r, this.payload = e;
|
|
98
98
|
}
|
|
99
99
|
asInt32() {
|
|
100
100
|
return this.ensureType(
|
|
@@ -154,7 +154,7 @@ class o {
|
|
|
154
154
|
return this.ensureType(
|
|
155
155
|
12
|
|
156
156
|
/* String */
|
|
157
|
-
),
|
|
157
|
+
), et.decode(this.payload);
|
|
158
158
|
}
|
|
159
159
|
asGuid() {
|
|
160
160
|
return this.ensureType(
|
|
@@ -166,7 +166,7 @@ class o {
|
|
|
166
166
|
return this.ensureType(
|
|
167
167
|
11
|
|
168
168
|
/* Object */
|
|
169
|
-
),
|
|
169
|
+
), P.create(this.payload);
|
|
170
170
|
}
|
|
171
171
|
asArray() {
|
|
172
172
|
return this.ensureType(
|
|
@@ -180,14 +180,14 @@ class o {
|
|
|
180
180
|
/* Dict */
|
|
181
181
|
), G.create(this.payload);
|
|
182
182
|
}
|
|
183
|
-
ensureType(
|
|
184
|
-
if (this.type !==
|
|
185
|
-
throw new Error(`Teleport value has type ${
|
|
183
|
+
ensureType(r) {
|
|
184
|
+
if (this.type !== r)
|
|
185
|
+
throw new Error(`Teleport value has type ${l[this.type]}, expected ${l[r]}`);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
class nt extends
|
|
189
|
-
constructor(
|
|
190
|
-
super(
|
|
188
|
+
class nt extends f {
|
|
189
|
+
constructor(r, e, n) {
|
|
190
|
+
super(e, n), this.fieldId = r;
|
|
191
191
|
}
|
|
192
192
|
get isNull() {
|
|
193
193
|
return this.type === 1;
|
|
@@ -199,17 +199,17 @@ class V {
|
|
|
199
199
|
count;
|
|
200
200
|
offset;
|
|
201
201
|
index = 0;
|
|
202
|
-
constructor(
|
|
203
|
-
if (this.payload =
|
|
202
|
+
constructor(r) {
|
|
203
|
+
if (this.payload = r, r.length === 0)
|
|
204
204
|
throw new Error("Array payload too short");
|
|
205
|
-
const
|
|
206
|
-
if (this.elementType =
|
|
205
|
+
const e = r[0];
|
|
206
|
+
if (this.elementType = e >> 4 & 15, (e & 15) !== 0)
|
|
207
207
|
throw new Error("Array flags must be zero");
|
|
208
208
|
const n = { offset: 1 };
|
|
209
|
-
this.count =
|
|
209
|
+
this.count = A(r, n, "ArrayMalformed"), this.offset = n.offset;
|
|
210
210
|
}
|
|
211
|
-
static create(
|
|
212
|
-
return new V(
|
|
211
|
+
static create(r) {
|
|
212
|
+
return new V(g(r));
|
|
213
213
|
}
|
|
214
214
|
next() {
|
|
215
215
|
if (this.index >= this.count) {
|
|
@@ -217,8 +217,8 @@ class V {
|
|
|
217
217
|
throw new Error("Array payload contains trailing data");
|
|
218
218
|
return null;
|
|
219
219
|
}
|
|
220
|
-
const
|
|
221
|
-
return this.index++,
|
|
220
|
+
const r = this.readValue();
|
|
221
|
+
return this.index++, r;
|
|
222
222
|
}
|
|
223
223
|
readValue() {
|
|
224
224
|
switch (this.elementType) {
|
|
@@ -230,40 +230,40 @@ class V {
|
|
|
230
230
|
case 4:
|
|
231
231
|
case 6:
|
|
232
232
|
case 14: {
|
|
233
|
-
const
|
|
234
|
-
a(this.payload, this.offset,
|
|
235
|
-
const
|
|
236
|
-
return this.offset +=
|
|
233
|
+
const r = S(this.elementType);
|
|
234
|
+
a(this.payload, this.offset, r);
|
|
235
|
+
const e = this.payload.subarray(this.offset, this.offset + r);
|
|
236
|
+
return this.offset += r, new D(this.elementType, e);
|
|
237
237
|
}
|
|
238
238
|
case 12:
|
|
239
239
|
case 13: {
|
|
240
|
-
const
|
|
241
|
-
a(this.payload,
|
|
242
|
-
const n = this.payload.subarray(
|
|
243
|
-
return this.offset =
|
|
240
|
+
const r = { offset: this.offset }, e = A(this.payload, r, "ArrayMalformed");
|
|
241
|
+
a(this.payload, r.offset, e);
|
|
242
|
+
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
243
|
+
return this.offset = r.offset + e, new D(this.elementType, n);
|
|
244
244
|
}
|
|
245
245
|
case 11: {
|
|
246
|
-
const
|
|
247
|
-
a(this.payload,
|
|
248
|
-
const n = this.payload.subarray(
|
|
249
|
-
return this.offset =
|
|
246
|
+
const r = { offset: this.offset }, e = A(this.payload, r, "ArrayMalformed");
|
|
247
|
+
a(this.payload, r.offset, e);
|
|
248
|
+
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
249
|
+
return this.offset = r.offset + e, new D(11, n);
|
|
250
250
|
}
|
|
251
251
|
case 9: {
|
|
252
|
-
const
|
|
253
|
-
return this.offset +=
|
|
252
|
+
const r = B(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
253
|
+
return this.offset += r, new D(9, e);
|
|
254
254
|
}
|
|
255
255
|
case 10: {
|
|
256
|
-
const
|
|
257
|
-
return this.offset +=
|
|
256
|
+
const r = b(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
257
|
+
return this.offset += r, new D(10, e);
|
|
258
258
|
}
|
|
259
259
|
default:
|
|
260
|
-
throw new Error(`Unsupported array element type ${
|
|
260
|
+
throw new Error(`Unsupported array element type ${l[this.elementType]}`);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
class D extends
|
|
265
|
-
constructor(
|
|
266
|
-
super(
|
|
264
|
+
class D extends f {
|
|
265
|
+
constructor(r, e) {
|
|
266
|
+
super(r, e);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
class G {
|
|
@@ -273,17 +273,17 @@ class G {
|
|
|
273
273
|
count;
|
|
274
274
|
offset;
|
|
275
275
|
index = 0;
|
|
276
|
-
constructor(
|
|
277
|
-
if (this.payload =
|
|
276
|
+
constructor(r) {
|
|
277
|
+
if (this.payload = r, r.length < 2)
|
|
278
278
|
throw new Error("Dictionary payload too short");
|
|
279
|
-
if (this.keyType =
|
|
279
|
+
if (this.keyType = r[0] >> 4 & 15, this.valueType = r[1] >> 4 & 15, (r[0] & 15) !== 0 || (r[1] & 15) !== 0)
|
|
280
280
|
throw new Error("Dictionary key/value flags must be zero");
|
|
281
281
|
W(this.keyType);
|
|
282
|
-
const
|
|
283
|
-
this.count =
|
|
282
|
+
const e = { offset: 2 };
|
|
283
|
+
this.count = A(r, e, "DictMalformed"), this.offset = e.offset;
|
|
284
284
|
}
|
|
285
|
-
static create(
|
|
286
|
-
return new G(
|
|
285
|
+
static create(r) {
|
|
286
|
+
return new G(g(r));
|
|
287
287
|
}
|
|
288
288
|
next() {
|
|
289
289
|
if (this.index >= this.count) {
|
|
@@ -291,21 +291,21 @@ class G {
|
|
|
291
291
|
throw new Error("Dictionary payload contains trailing data");
|
|
292
292
|
return null;
|
|
293
293
|
}
|
|
294
|
-
const
|
|
295
|
-
return this.index++, new st(
|
|
294
|
+
const r = this.readKey(), e = this.readValue();
|
|
295
|
+
return this.index++, new st(r, e);
|
|
296
296
|
}
|
|
297
297
|
readKey() {
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
-
a(this.payload, this.offset,
|
|
301
|
-
const
|
|
302
|
-
return this.offset +=
|
|
298
|
+
const r = S(this.keyType);
|
|
299
|
+
if (r >= 0) {
|
|
300
|
+
a(this.payload, this.offset, r);
|
|
301
|
+
const e = this.payload.subarray(this.offset, this.offset + r);
|
|
302
|
+
return this.offset += r, new f(this.keyType, e);
|
|
303
303
|
}
|
|
304
304
|
if (this.keyType === 12 || this.keyType === 13) {
|
|
305
|
-
const
|
|
306
|
-
a(this.payload,
|
|
307
|
-
const s = this.payload.subarray(
|
|
308
|
-
return this.offset =
|
|
305
|
+
const e = { offset: this.offset }, n = A(this.payload, e, "DictMalformed");
|
|
306
|
+
a(this.payload, e.offset, n);
|
|
307
|
+
const s = this.payload.subarray(e.offset, e.offset + n);
|
|
308
|
+
return this.offset = e.offset + n, new f(this.keyType, s);
|
|
309
309
|
}
|
|
310
310
|
throw new Error("Unsupported dictionary key type");
|
|
311
311
|
}
|
|
@@ -313,24 +313,24 @@ class G {
|
|
|
313
313
|
switch (this.valueType) {
|
|
314
314
|
case 12:
|
|
315
315
|
case 13: {
|
|
316
|
-
const
|
|
317
|
-
a(this.payload,
|
|
318
|
-
const n = this.payload.subarray(
|
|
319
|
-
return this.offset =
|
|
316
|
+
const r = { offset: this.offset }, e = A(this.payload, r, "DictMalformed");
|
|
317
|
+
a(this.payload, r.offset, e);
|
|
318
|
+
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
319
|
+
return this.offset = r.offset + e, new f(this.valueType, n);
|
|
320
320
|
}
|
|
321
321
|
case 11: {
|
|
322
|
-
const
|
|
323
|
-
a(this.payload,
|
|
324
|
-
const n = this.payload.subarray(
|
|
325
|
-
return this.offset =
|
|
322
|
+
const r = { offset: this.offset }, e = A(this.payload, r, "DictMalformed");
|
|
323
|
+
a(this.payload, r.offset, e);
|
|
324
|
+
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
325
|
+
return this.offset = r.offset + e, new f(11, n);
|
|
326
326
|
}
|
|
327
327
|
case 9: {
|
|
328
|
-
const
|
|
329
|
-
return this.offset +=
|
|
328
|
+
const r = B(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
329
|
+
return this.offset += r, new f(9, e);
|
|
330
330
|
}
|
|
331
331
|
case 10: {
|
|
332
|
-
const
|
|
333
|
-
return this.offset +=
|
|
332
|
+
const r = b(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
333
|
+
return this.offset += r, new f(10, e);
|
|
334
334
|
}
|
|
335
335
|
case 3:
|
|
336
336
|
case 5:
|
|
@@ -341,111 +341,111 @@ class G {
|
|
|
341
341
|
case 6:
|
|
342
342
|
case 14:
|
|
343
343
|
case 1: {
|
|
344
|
-
const
|
|
345
|
-
a(this.payload, this.offset,
|
|
346
|
-
const
|
|
347
|
-
return this.offset +=
|
|
344
|
+
const r = S(this.valueType);
|
|
345
|
+
a(this.payload, this.offset, r);
|
|
346
|
+
const e = this.payload.subarray(this.offset, this.offset + r);
|
|
347
|
+
return this.offset += r, new f(this.valueType, e);
|
|
348
348
|
}
|
|
349
349
|
default:
|
|
350
|
-
throw new Error(`Unsupported dictionary value type ${
|
|
350
|
+
throw new Error(`Unsupported dictionary value type ${l[this.valueType]}`);
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
class st {
|
|
355
|
-
constructor(
|
|
356
|
-
this.key =
|
|
355
|
+
constructor(r, e) {
|
|
356
|
+
this.key = r, this.value = e;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
class I {
|
|
360
|
-
constructor(
|
|
361
|
-
this.bytes =
|
|
360
|
+
constructor(r) {
|
|
361
|
+
this.bytes = r;
|
|
362
362
|
}
|
|
363
|
-
static fromString(
|
|
364
|
-
if (!
|
|
363
|
+
static fromString(r) {
|
|
364
|
+
if (!r)
|
|
365
365
|
throw new Error("Guid string is empty");
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
366
|
+
const e = r.replace(/-/g, "");
|
|
367
|
+
if (e.length !== 32)
|
|
368
368
|
throw new Error("Guid string must be 32 hex characters");
|
|
369
|
-
const n = new Uint8Array(16), s = I.parseHexSlice(
|
|
370
|
-
I.writeUInt32LE(n, 0, s), I.writeUInt16LE(n, 4,
|
|
369
|
+
const n = new Uint8Array(16), s = I.parseHexSlice(e, 0, 8), _ = I.parseHexSlice(e, 8, 4), E = I.parseHexSlice(e, 12, 4);
|
|
370
|
+
I.writeUInt32LE(n, 0, s), I.writeUInt16LE(n, 4, _), I.writeUInt16LE(n, 6, E);
|
|
371
371
|
for (let i = 0; i < 8; i++)
|
|
372
|
-
n[8 + i] = I.parseHexSlice(
|
|
372
|
+
n[8 + i] = I.parseHexSlice(e, 16 + i * 2, 2);
|
|
373
373
|
return new I(n);
|
|
374
374
|
}
|
|
375
|
-
static fromBytes(
|
|
376
|
-
if (
|
|
375
|
+
static fromBytes(r) {
|
|
376
|
+
if (r.length !== 16)
|
|
377
377
|
throw new Error("Guid byte array must be 16 bytes");
|
|
378
|
-
return new I(Uint8Array.from(
|
|
378
|
+
return new I(Uint8Array.from(r));
|
|
379
379
|
}
|
|
380
380
|
static createZero() {
|
|
381
381
|
return new I(new Uint8Array(16));
|
|
382
382
|
}
|
|
383
383
|
static createRandom() {
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
386
|
-
|
|
384
|
+
const r = new Uint8Array(16), e = globalThis.crypto;
|
|
385
|
+
if (e?.getRandomValues)
|
|
386
|
+
e.getRandomValues(r);
|
|
387
387
|
else
|
|
388
|
-
for (let n = 0; n <
|
|
389
|
-
|
|
390
|
-
return
|
|
388
|
+
for (let n = 0; n < r.length; n++)
|
|
389
|
+
r[n] = Math.floor(Math.random() * 256);
|
|
390
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, new I(r);
|
|
391
391
|
}
|
|
392
392
|
toString() {
|
|
393
|
-
const
|
|
393
|
+
const r = this.bytes;
|
|
394
394
|
return [
|
|
395
|
-
I.toHex(I.readUInt32LE(
|
|
396
|
-
I.toHex(I.readUInt16LE(
|
|
397
|
-
I.toHex(I.readUInt16LE(
|
|
398
|
-
v(
|
|
399
|
-
v(
|
|
395
|
+
I.toHex(I.readUInt32LE(r, 0), 8),
|
|
396
|
+
I.toHex(I.readUInt16LE(r, 4), 4),
|
|
397
|
+
I.toHex(I.readUInt16LE(r, 6), 4),
|
|
398
|
+
v(r.subarray(8, 10)),
|
|
399
|
+
v(r.subarray(10, 16))
|
|
400
400
|
].join("-");
|
|
401
401
|
}
|
|
402
402
|
asBytes() {
|
|
403
403
|
return this.bytes.slice();
|
|
404
404
|
}
|
|
405
|
-
static parseHexSlice(
|
|
406
|
-
const s =
|
|
407
|
-
if (Number.isNaN(
|
|
405
|
+
static parseHexSlice(r, e, n) {
|
|
406
|
+
const s = r.substr(e, n), _ = Number.parseInt(s, 16);
|
|
407
|
+
if (Number.isNaN(_))
|
|
408
408
|
throw new Error("Guid string contains invalid characters");
|
|
409
|
-
return
|
|
409
|
+
return _ >>> 0;
|
|
410
410
|
}
|
|
411
|
-
static writeUInt32LE(
|
|
411
|
+
static writeUInt32LE(r, e, n) {
|
|
412
412
|
const s = n >>> 0;
|
|
413
|
-
e
|
|
413
|
+
r[e] = s & 255, r[e + 1] = s >>> 8 & 255, r[e + 2] = s >>> 16 & 255, r[e + 3] = s >>> 24 & 255;
|
|
414
414
|
}
|
|
415
|
-
static writeUInt16LE(
|
|
415
|
+
static writeUInt16LE(r, e, n) {
|
|
416
416
|
const s = n & 65535;
|
|
417
|
-
e
|
|
417
|
+
r[e] = s & 255, r[e + 1] = s >>> 8 & 255;
|
|
418
418
|
}
|
|
419
|
-
static readUInt32LE(
|
|
420
|
-
return (e
|
|
419
|
+
static readUInt32LE(r, e) {
|
|
420
|
+
return (r[e] | r[e + 1] << 8 | r[e + 2] << 16 | r[e + 3] << 24) >>> 0;
|
|
421
421
|
}
|
|
422
|
-
static readUInt16LE(
|
|
423
|
-
return (e
|
|
422
|
+
static readUInt16LE(r, e) {
|
|
423
|
+
return (r[e] | r[e + 1] << 8) & 65535;
|
|
424
424
|
}
|
|
425
|
-
static toHex(
|
|
426
|
-
return (
|
|
425
|
+
static toHex(r, e) {
|
|
426
|
+
return (r >>> 0).toString(16).padStart(e, "0");
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
if (
|
|
431
|
-
throw new Error(
|
|
432
|
-
let n = 0, s = 0,
|
|
433
|
-
for (;
|
|
434
|
-
const
|
|
435
|
-
if (
|
|
436
|
-
if (
|
|
429
|
+
function A(t, r, e) {
|
|
430
|
+
if (r.offset >= t.length)
|
|
431
|
+
throw new Error(e);
|
|
432
|
+
let n = 0, s = 0, _ = 0;
|
|
433
|
+
for (; r.offset < t.length; ) {
|
|
434
|
+
const E = t[r.offset++];
|
|
435
|
+
if (_++, n |= (E & 127) << s, (E & 128) === 0) {
|
|
436
|
+
if (_ !== _t(n))
|
|
437
437
|
throw new Error("Teleport VarUInt is not canonical");
|
|
438
438
|
return n >>> 0;
|
|
439
439
|
}
|
|
440
440
|
if (s += 7, s >= 35)
|
|
441
441
|
throw new Error("Teleport VarUInt exceeds 32-bit range");
|
|
442
442
|
}
|
|
443
|
-
throw new Error(
|
|
443
|
+
throw new Error(e);
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function _t(t) {
|
|
446
446
|
return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function S(t) {
|
|
449
449
|
switch (t) {
|
|
450
450
|
case 3:
|
|
451
451
|
case 5:
|
|
@@ -469,203 +469,203 @@ function W(t) {
|
|
|
469
469
|
if (t === 9 || t === 11 || t === 10 || t === 1)
|
|
470
470
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
471
471
|
}
|
|
472
|
-
function a(t,
|
|
473
|
-
if (
|
|
472
|
+
function a(t, r, e) {
|
|
473
|
+
if (r < 0 || e < 0 || r + e > t.length)
|
|
474
474
|
throw new Error("Teleport payload exceeds bounds");
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
return (t[
|
|
476
|
+
function Et(t, r) {
|
|
477
|
+
return (t[r] | t[r + 1] << 8 | t[r + 2] << 16 | t[r + 3] << 24) >>> 0;
|
|
478
478
|
}
|
|
479
|
-
function B(t,
|
|
480
|
-
if (
|
|
479
|
+
function B(t, r) {
|
|
480
|
+
if (r >= t.length)
|
|
481
481
|
throw new Error("Array payload exceeds bounds");
|
|
482
|
-
const
|
|
483
|
-
if ((
|
|
482
|
+
const e = t[r], n = e >> 4 & 15;
|
|
483
|
+
if ((e & 15) !== 0)
|
|
484
484
|
throw new Error("Array flags must be zero");
|
|
485
|
-
const s = { offset:
|
|
486
|
-
if (
|
|
487
|
-
const N =
|
|
488
|
-
return a(t, s.offset, N), s.offset + N -
|
|
485
|
+
const s = { offset: r + 1 }, _ = A(t, s, "ArrayMalformed"), E = S(n);
|
|
486
|
+
if (E >= 0) {
|
|
487
|
+
const N = E * _;
|
|
488
|
+
return a(t, s.offset, N), s.offset + N - r;
|
|
489
489
|
}
|
|
490
490
|
let i = s.offset;
|
|
491
|
-
for (let N = 0; N <
|
|
492
|
-
i =
|
|
493
|
-
return i -
|
|
491
|
+
for (let N = 0; N < _; N++)
|
|
492
|
+
i = d(n, t, i, "ArrayMalformed");
|
|
493
|
+
return i - r;
|
|
494
494
|
}
|
|
495
|
-
function b(t,
|
|
496
|
-
if (
|
|
495
|
+
function b(t, r) {
|
|
496
|
+
if (r + 2 > t.length)
|
|
497
497
|
throw new Error("Dictionary payload too short");
|
|
498
|
-
const
|
|
499
|
-
if ((t[
|
|
498
|
+
const e = t[r] >> 4 & 15, n = t[r + 1] >> 4 & 15;
|
|
499
|
+
if ((t[r] & 15) !== 0 || (t[r + 1] & 15) !== 0)
|
|
500
500
|
throw new Error("Dictionary key/value flags must be zero");
|
|
501
|
-
W(
|
|
502
|
-
const s = { offset:
|
|
503
|
-
let
|
|
504
|
-
for (let i = 0; i <
|
|
505
|
-
|
|
506
|
-
return
|
|
507
|
-
}
|
|
508
|
-
function
|
|
509
|
-
const s =
|
|
501
|
+
W(e);
|
|
502
|
+
const s = { offset: r + 2 }, _ = A(t, s, "DictMalformed");
|
|
503
|
+
let E = s.offset;
|
|
504
|
+
for (let i = 0; i < _; i++)
|
|
505
|
+
E = d(e, t, E, "DictMalformed"), E = d(n, t, E, "DictMalformed");
|
|
506
|
+
return E - r;
|
|
507
|
+
}
|
|
508
|
+
function d(t, r, e, n) {
|
|
509
|
+
const s = S(t);
|
|
510
510
|
if (s >= 0)
|
|
511
|
-
return a(
|
|
511
|
+
return a(r, e, s), e + s;
|
|
512
512
|
switch (t) {
|
|
513
513
|
case 12:
|
|
514
514
|
case 13: {
|
|
515
|
-
const
|
|
516
|
-
return a(
|
|
515
|
+
const _ = { offset: e }, E = A(r, _, n);
|
|
516
|
+
return a(r, _.offset, E), _.offset + E;
|
|
517
517
|
}
|
|
518
518
|
case 11: {
|
|
519
|
-
const
|
|
520
|
-
return a(
|
|
519
|
+
const _ = { offset: e }, E = A(r, _, n);
|
|
520
|
+
return a(r, _.offset, E), _.offset + E;
|
|
521
521
|
}
|
|
522
522
|
case 9:
|
|
523
|
-
return
|
|
523
|
+
return e + B(r, e);
|
|
524
524
|
case 10:
|
|
525
|
-
return
|
|
525
|
+
return e + b(r, e);
|
|
526
526
|
default:
|
|
527
|
-
throw new Error(`Unsupported Teleport type ${
|
|
527
|
+
throw new Error(`Unsupported Teleport type ${l[t]}`);
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
function v(t) {
|
|
531
|
-
return Array.from(t).map((
|
|
531
|
+
return Array.from(t).map((r) => r.toString(16).padStart(2, "0")).join("");
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function g(t) {
|
|
534
534
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
535
535
|
}
|
|
536
|
-
var h = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(h || {}), L = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(L || {});
|
|
537
|
-
const it = 8388609, It = 161083277, at = 164808083,
|
|
536
|
+
var h = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(h || {}), L = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(L || {});
|
|
537
|
+
const it = 8388609, It = 161083277, at = 164808083, At = 1368629611, Tt = 2745379226, Nt = 2950031986, ft = 3282782683, Ct = 3284746250, ot = 4065070594;
|
|
538
538
|
function ut(t) {
|
|
539
|
-
const
|
|
540
|
-
return X(
|
|
539
|
+
const r = {};
|
|
540
|
+
return X(r), r;
|
|
541
541
|
}
|
|
542
542
|
function X(t) {
|
|
543
543
|
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = h.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t;
|
|
544
544
|
}
|
|
545
|
-
function Rt(t,
|
|
546
|
-
const
|
|
547
|
-
return ht(
|
|
545
|
+
function Rt(t, r) {
|
|
546
|
+
const e = P.create(t);
|
|
547
|
+
return ht(e, r);
|
|
548
548
|
}
|
|
549
|
-
function ht(t,
|
|
550
|
-
const
|
|
551
|
-
return X(
|
|
549
|
+
function ht(t, r) {
|
|
550
|
+
const e = r ?? ut();
|
|
551
|
+
return X(e), Ut(t, e), e;
|
|
552
552
|
}
|
|
553
|
-
function
|
|
554
|
-
let
|
|
555
|
-
for (; (
|
|
556
|
-
switch (
|
|
553
|
+
function Ut(t, r) {
|
|
554
|
+
let e;
|
|
555
|
+
for (; (e = t.next()) !== null; )
|
|
556
|
+
switch (e.fieldId) {
|
|
557
557
|
case It: {
|
|
558
|
-
if (
|
|
559
|
-
|
|
558
|
+
if (e.isNull) throw new Error();
|
|
559
|
+
r.StreamId = e.asString();
|
|
560
560
|
break;
|
|
561
561
|
}
|
|
562
562
|
case at: {
|
|
563
|
-
if (
|
|
564
|
-
|
|
565
|
-
break;
|
|
566
|
-
}
|
|
567
|
-
case Tt: {
|
|
568
|
-
if (r.isNull) throw new Error();
|
|
569
|
-
e.Description = r.asString();
|
|
563
|
+
if (e.isNull) throw new Error();
|
|
564
|
+
r.Framerate = e.asFloat64();
|
|
570
565
|
break;
|
|
571
566
|
}
|
|
572
567
|
case At: {
|
|
573
|
-
if (
|
|
574
|
-
|
|
568
|
+
if (e.isNull) throw new Error();
|
|
569
|
+
r.Description = e.asString();
|
|
575
570
|
break;
|
|
576
571
|
}
|
|
577
|
-
case
|
|
578
|
-
if (
|
|
579
|
-
|
|
572
|
+
case Tt: {
|
|
573
|
+
if (e.isNull) throw new Error();
|
|
574
|
+
r.CodecDetails = e.asString();
|
|
580
575
|
break;
|
|
581
576
|
}
|
|
582
|
-
case
|
|
583
|
-
if (
|
|
584
|
-
|
|
577
|
+
case Nt: {
|
|
578
|
+
if (e.isNull) throw new Error();
|
|
579
|
+
r.Height = e.asInt32();
|
|
585
580
|
break;
|
|
586
581
|
}
|
|
587
582
|
case ft: {
|
|
588
|
-
if (
|
|
589
|
-
|
|
583
|
+
if (e.isNull) throw new Error();
|
|
584
|
+
r.SourceType = e.asString();
|
|
590
585
|
break;
|
|
591
586
|
}
|
|
592
587
|
case Ct: {
|
|
593
|
-
if (
|
|
594
|
-
|
|
588
|
+
if (e.isNull) throw new Error();
|
|
589
|
+
r.Codec = e.asInt32();
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
case ot: {
|
|
593
|
+
if (e.isNull) throw new Error();
|
|
594
|
+
r.Width = e.asInt32();
|
|
595
595
|
break;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
async function
|
|
600
|
-
const
|
|
601
|
-
return Rt(
|
|
599
|
+
async function lt(t, r) {
|
|
600
|
+
const e = await k(t, it);
|
|
601
|
+
return Rt(e, r);
|
|
602
602
|
}
|
|
603
|
-
const
|
|
604
|
-
function
|
|
605
|
-
const
|
|
606
|
-
return z(
|
|
603
|
+
const St = 8388611, ct = 271275304, Dt = 2541432218, Lt = 2986785889, yt = 3105403172, Ot = 3456383222;
|
|
604
|
+
function Pt(t) {
|
|
605
|
+
const r = {};
|
|
606
|
+
return z(r), r;
|
|
607
607
|
}
|
|
608
608
|
function z(t) {
|
|
609
609
|
return t.Data = new Uint8Array(0), t.FrameNumber = 0, t.IsKey = !1, t.TimestampInUs = 0n, t.DurationInUs = 0, t;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
const
|
|
613
|
-
return
|
|
614
|
-
}
|
|
615
|
-
function
|
|
616
|
-
const
|
|
617
|
-
return z(
|
|
618
|
-
}
|
|
619
|
-
function mt(t,
|
|
620
|
-
let
|
|
621
|
-
for (; (
|
|
622
|
-
switch (
|
|
623
|
-
case
|
|
624
|
-
if (
|
|
625
|
-
|
|
611
|
+
function gt(t, r) {
|
|
612
|
+
const e = P.create(t);
|
|
613
|
+
return wt(e, r);
|
|
614
|
+
}
|
|
615
|
+
function wt(t, r) {
|
|
616
|
+
const e = r ?? Pt();
|
|
617
|
+
return z(e), mt(t, e), e;
|
|
618
|
+
}
|
|
619
|
+
function mt(t, r) {
|
|
620
|
+
let e;
|
|
621
|
+
for (; (e = t.next()) !== null; )
|
|
622
|
+
switch (e.fieldId) {
|
|
623
|
+
case ct: {
|
|
624
|
+
if (e.isNull) throw new Error();
|
|
625
|
+
r.TimestampInUs = e.asUInt64();
|
|
626
626
|
break;
|
|
627
627
|
}
|
|
628
628
|
case Dt: {
|
|
629
|
-
if (
|
|
630
|
-
|
|
629
|
+
if (e.isNull) throw new Error();
|
|
630
|
+
r.DurationInUs = e.asUInt32();
|
|
631
631
|
break;
|
|
632
632
|
}
|
|
633
633
|
case Lt: {
|
|
634
|
-
if (
|
|
635
|
-
|
|
634
|
+
if (e.isNull) throw new Error();
|
|
635
|
+
r.Data = e.asBinary();
|
|
636
636
|
break;
|
|
637
637
|
}
|
|
638
638
|
case yt: {
|
|
639
|
-
if (
|
|
640
|
-
|
|
639
|
+
if (e.isNull) throw new Error();
|
|
640
|
+
r.IsKey = e.asBool();
|
|
641
641
|
break;
|
|
642
642
|
}
|
|
643
|
-
case
|
|
644
|
-
if (
|
|
645
|
-
|
|
643
|
+
case Ot: {
|
|
644
|
+
if (e.isNull) throw new Error();
|
|
645
|
+
r.FrameNumber = e.asInt32();
|
|
646
646
|
break;
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
async function
|
|
651
|
-
const
|
|
652
|
-
return
|
|
650
|
+
async function Ft(t, r) {
|
|
651
|
+
const e = await k(t, St);
|
|
652
|
+
return gt(e, r);
|
|
653
653
|
}
|
|
654
|
-
const
|
|
655
|
-
let
|
|
656
|
-
const
|
|
654
|
+
const dt = "avc1.42E01E", Mt = "vp8", Vt = "vp09.00.10.08", Gt = "av01.0.04M.08", Bt = 8, c = (t, r) => self.postMessage(t, r ?? []);
|
|
655
|
+
let U = null, O = !0;
|
|
656
|
+
const T = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
657
657
|
function R(t) {
|
|
658
|
-
const
|
|
659
|
-
|
|
658
|
+
const r = t instanceof Error ? t : new Error(String(t));
|
|
659
|
+
c({ type: "error", error: { name: r.name, message: r.message, stack: r.stack } });
|
|
660
660
|
}
|
|
661
|
-
function
|
|
662
|
-
return t << 16 |
|
|
661
|
+
function w(t, r) {
|
|
662
|
+
return t << 16 | r & 65535;
|
|
663
663
|
}
|
|
664
664
|
function M(t) {
|
|
665
|
-
const
|
|
666
|
-
if (
|
|
667
|
-
return
|
|
668
|
-
const
|
|
665
|
+
const r = T.get(t);
|
|
666
|
+
if (r)
|
|
667
|
+
return r;
|
|
668
|
+
const e = {
|
|
669
669
|
streamId: t,
|
|
670
670
|
numericKey: 0,
|
|
671
671
|
watched: !1,
|
|
@@ -683,71 +683,71 @@ function M(t) {
|
|
|
683
683
|
isReconfiguring: !1,
|
|
684
684
|
pendingDecodeCount: 0
|
|
685
685
|
};
|
|
686
|
-
return
|
|
686
|
+
return T.set(t, e), e;
|
|
687
687
|
}
|
|
688
688
|
function Y(t) {
|
|
689
|
-
if (t === h.H264) return
|
|
689
|
+
if (t === h.H264) return dt;
|
|
690
690
|
if (t === h.Vp8) return Mt;
|
|
691
691
|
if (t === h.Vp9) return Vt;
|
|
692
692
|
if (t === h.Av1) return Gt;
|
|
693
693
|
throw new Error(`Unknown codec: ${t}`);
|
|
694
694
|
}
|
|
695
695
|
function u(t) {
|
|
696
|
-
const
|
|
697
|
-
if (!
|
|
696
|
+
const r = T.get(t);
|
|
697
|
+
if (!r || r.numericKey === 0)
|
|
698
698
|
return;
|
|
699
|
-
const
|
|
700
|
-
|
|
699
|
+
const e = r.numericKey >> 16 & 65535, n = r.numericKey & 65535;
|
|
700
|
+
c({ type: "requestIdr", streamId: t, senderId: e, trackId: n });
|
|
701
701
|
}
|
|
702
|
-
async function bt(t,
|
|
702
|
+
async function bt(t, r) {
|
|
703
703
|
try {
|
|
704
|
-
if (!
|
|
704
|
+
if (!O || !t.watched)
|
|
705
705
|
return;
|
|
706
706
|
if (typeof createImageBitmap == "function") {
|
|
707
|
-
const
|
|
708
|
-
|
|
707
|
+
const e = await createImageBitmap(r);
|
|
708
|
+
c({ type: "frame", streamId: t.streamId, width: t.width, height: t.height, bitmap: e }, [e]);
|
|
709
709
|
}
|
|
710
|
-
} catch (
|
|
711
|
-
R(
|
|
710
|
+
} catch (e) {
|
|
711
|
+
R(e);
|
|
712
712
|
} finally {
|
|
713
713
|
t.pendingDecodeCount--;
|
|
714
714
|
try {
|
|
715
|
-
|
|
715
|
+
r.close();
|
|
716
716
|
} catch {
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
|
-
async function Ht(t,
|
|
720
|
+
async function Ht(t, r, e) {
|
|
721
721
|
const n = {
|
|
722
722
|
codec: t,
|
|
723
|
-
codedWidth:
|
|
724
|
-
codedHeight:
|
|
723
|
+
codedWidth: r > 0 ? r : void 0,
|
|
724
|
+
codedHeight: e > 0 ? e : void 0,
|
|
725
725
|
optimizeForLatency: !0
|
|
726
726
|
};
|
|
727
727
|
if (typeof VideoDecoder?.isConfigSupported != "function")
|
|
728
728
|
return { config: { ...n, hardwareAcceleration: "prefer-hardware" }, isHardwareAccelerated: !0 };
|
|
729
729
|
const s = { ...n, hardwareAcceleration: "prefer-hardware" };
|
|
730
730
|
try {
|
|
731
|
-
const
|
|
732
|
-
if (
|
|
733
|
-
return { config:
|
|
731
|
+
const _ = await VideoDecoder.isConfigSupported(s);
|
|
732
|
+
if (_.supported)
|
|
733
|
+
return { config: _.config ?? s, isHardwareAccelerated: !0 };
|
|
734
734
|
} catch {
|
|
735
735
|
}
|
|
736
736
|
try {
|
|
737
|
-
const
|
|
738
|
-
if (
|
|
739
|
-
return { config:
|
|
737
|
+
const _ = await VideoDecoder.isConfigSupported(n);
|
|
738
|
+
if (_.supported)
|
|
739
|
+
return { config: _.config ?? n, isHardwareAccelerated: !1 };
|
|
740
740
|
} catch {
|
|
741
741
|
}
|
|
742
742
|
return null;
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function F(t) {
|
|
745
745
|
return new VideoDecoder({
|
|
746
|
-
output: (
|
|
747
|
-
if (t.pendingDecodeCount++, !
|
|
746
|
+
output: (r) => {
|
|
747
|
+
if (t.pendingDecodeCount++, !O || !t.watched) {
|
|
748
748
|
t.pendingDecodeCount--;
|
|
749
749
|
try {
|
|
750
|
-
|
|
750
|
+
r.close();
|
|
751
751
|
} catch {
|
|
752
752
|
}
|
|
753
753
|
return;
|
|
@@ -755,30 +755,30 @@ function d(t) {
|
|
|
755
755
|
if (t.pendingDecodeCount > Bt) {
|
|
756
756
|
t.pendingDecodeCount--;
|
|
757
757
|
try {
|
|
758
|
-
|
|
758
|
+
r.close();
|
|
759
759
|
} catch {
|
|
760
760
|
}
|
|
761
761
|
return;
|
|
762
762
|
}
|
|
763
|
-
const
|
|
763
|
+
const e = t.width, n = t.height;
|
|
764
764
|
if (t.ctx2d && t.surface) {
|
|
765
765
|
try {
|
|
766
|
-
t.ctx2d.drawImage(
|
|
766
|
+
t.ctx2d.drawImage(r, 0, 0, e, n);
|
|
767
767
|
} catch (s) {
|
|
768
768
|
R(s);
|
|
769
769
|
} finally {
|
|
770
770
|
t.pendingDecodeCount--;
|
|
771
771
|
try {
|
|
772
|
-
|
|
772
|
+
r.close();
|
|
773
773
|
} catch {
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
return;
|
|
777
777
|
}
|
|
778
|
-
bt(t,
|
|
778
|
+
bt(t, r);
|
|
779
779
|
},
|
|
780
|
-
error: (
|
|
781
|
-
if (R(
|
|
780
|
+
error: (r) => {
|
|
781
|
+
if (R(r), t.isKeyFrameRequired = !0, t.isReconfiguring = !0, t.decoder && t.decoder.state !== "closed")
|
|
782
782
|
try {
|
|
783
783
|
t.decoder.close();
|
|
784
784
|
} catch {
|
|
@@ -792,23 +792,23 @@ async function y(t) {
|
|
|
792
792
|
t.isReconfiguring = !1;
|
|
793
793
|
return;
|
|
794
794
|
}
|
|
795
|
-
const
|
|
796
|
-
(!t.decoder || t.decoder.state === "closed") && (t.decoder && (t.decoderCodec = null, t.decoderWidth = 0, t.decoderHeight = 0), t.decoder =
|
|
797
|
-
const
|
|
798
|
-
if (!(t.decoderCodec !==
|
|
795
|
+
const r = Y(t.codec);
|
|
796
|
+
(!t.decoder || t.decoder.state === "closed") && (t.decoder && (t.decoderCodec = null, t.decoderWidth = 0, t.decoderHeight = 0), t.decoder = F(t));
|
|
797
|
+
const e = t.decoderCodec !== null && t.decoderCodec !== r;
|
|
798
|
+
if (!(t.decoderCodec !== r || t.decoderWidth !== t.width || t.decoderHeight !== t.height)) {
|
|
799
799
|
t.isReconfiguring = !1;
|
|
800
800
|
return;
|
|
801
801
|
}
|
|
802
|
-
if (t.isReconfiguring = !0, t.decoderCodec = null,
|
|
802
|
+
if (t.isReconfiguring = !0, t.decoderCodec = null, e && t.decoder) {
|
|
803
803
|
try {
|
|
804
804
|
t.decoder.close();
|
|
805
805
|
} catch {
|
|
806
806
|
}
|
|
807
|
-
t.decoder =
|
|
807
|
+
t.decoder = F(t);
|
|
808
808
|
}
|
|
809
809
|
try {
|
|
810
|
-
const s = await Ht(
|
|
811
|
-
if (Y(t.codec) !==
|
|
810
|
+
const s = await Ht(r, t.width, t.height);
|
|
811
|
+
if (Y(t.codec) !== r) {
|
|
812
812
|
if (t.decoder && t.decoder.state !== "closed")
|
|
813
813
|
try {
|
|
814
814
|
t.decoder.close();
|
|
@@ -818,34 +818,34 @@ async function y(t) {
|
|
|
818
818
|
return;
|
|
819
819
|
}
|
|
820
820
|
if (!s) {
|
|
821
|
-
R(new Error(`Decoder not supported for codec ${
|
|
821
|
+
R(new Error(`Decoder not supported for codec ${r}`));
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
|
-
(!t.decoder || t.decoder.state === "closed") && (t.decoder =
|
|
824
|
+
(!t.decoder || t.decoder.state === "closed") && (t.decoder = F(t)), t.decoderCodec = r, t.decoderWidth = t.width, t.decoderHeight = t.height;
|
|
825
825
|
try {
|
|
826
826
|
t.decoder.configure(s.config), t.isKeyFrameRequired = !0, u(t.streamId);
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
} catch (
|
|
830
|
-
R(
|
|
827
|
+
const E = s.isHardwareAccelerated ? "hardware" : "software", i = t.framerate > 0 ? `@${Math.round(t.framerate)}fps` : "";
|
|
828
|
+
c({ type: "debug", message: `Decoder configured: codec=${r}, ${t.width}x${t.height}${i}, hw=${E}` });
|
|
829
|
+
} catch (E) {
|
|
830
|
+
R(E);
|
|
831
831
|
}
|
|
832
832
|
t.surface && t.ctx2d && t.width > 0 && t.height > 0 && (t.surface.width !== t.width || t.surface.height !== t.height) && (t.surface.width = t.width, t.surface.height = t.height);
|
|
833
833
|
} finally {
|
|
834
834
|
t.isReconfiguring = !1;
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
|
-
async function Kt(t,
|
|
838
|
-
const
|
|
839
|
-
|
|
837
|
+
async function Kt(t, r) {
|
|
838
|
+
const e = await lt(t), n = e.StreamId, s = w(r.senderId, r.trackId), _ = M(n);
|
|
839
|
+
_.numericKey = s, _.codec = e.Codec, _.width = e.Width, _.height = e.Height, _.framerate = e.Framerate, o.set(s, n), c({ type: "streamBegin", streamId: n, width: e.Width, height: e.Height, codec: e.Codec }), _.watched ? (_.surface && _.ctx2d && e.Width > 0 && e.Height > 0 && (_.surface.width !== e.Width || _.surface.height !== e.Height) && (_.surface.width = e.Width, _.surface.height = e.Height), y(_)) : _.isReconfiguring = !1;
|
|
840
840
|
}
|
|
841
841
|
function xt(t) {
|
|
842
|
-
const
|
|
843
|
-
if (!
|
|
842
|
+
const r = w(t.senderId, t.trackId), e = o.get(r);
|
|
843
|
+
if (!e)
|
|
844
844
|
return;
|
|
845
|
-
|
|
846
|
-
const n =
|
|
845
|
+
c({ type: "streamEnd", streamId: e });
|
|
846
|
+
const n = T.get(e);
|
|
847
847
|
if (!n) {
|
|
848
|
-
|
|
848
|
+
o.delete(r);
|
|
849
849
|
return;
|
|
850
850
|
}
|
|
851
851
|
if (n.decoder)
|
|
@@ -853,36 +853,36 @@ function xt(t) {
|
|
|
853
853
|
n.decoder.close();
|
|
854
854
|
} catch {
|
|
855
855
|
}
|
|
856
|
-
|
|
856
|
+
T.delete(e), o.delete(r);
|
|
857
857
|
}
|
|
858
858
|
function $(t) {
|
|
859
|
-
const
|
|
860
|
-
|
|
859
|
+
const r = T.get(t);
|
|
860
|
+
r && (r.surface = null, r.ctx2d = null);
|
|
861
861
|
}
|
|
862
862
|
function q(t) {
|
|
863
|
-
const
|
|
864
|
-
if (
|
|
865
|
-
if (
|
|
863
|
+
const r = T.get(t);
|
|
864
|
+
if (r) {
|
|
865
|
+
if (r.watched = !1, r.isKeyFrameRequired = !0, $(t), r.decoder) {
|
|
866
866
|
try {
|
|
867
|
-
|
|
867
|
+
r.decoder.close();
|
|
868
868
|
} catch {
|
|
869
869
|
}
|
|
870
|
-
|
|
870
|
+
r.decoder = null, r.decoderCodec = null, r.decoderWidth = 0, r.decoderHeight = 0;
|
|
871
871
|
}
|
|
872
|
-
|
|
872
|
+
r.isReconfiguring = !1;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
async function vt(t,
|
|
876
|
-
const
|
|
875
|
+
async function vt(t, r) {
|
|
876
|
+
const e = w(r.senderId, r.trackId), n = o.get(e);
|
|
877
877
|
if (!n)
|
|
878
878
|
return;
|
|
879
|
-
const s =
|
|
880
|
-
if (!s || !
|
|
879
|
+
const s = T.get(n);
|
|
880
|
+
if (!s || !O || !s.watched || s.isReconfiguring || ((!s.decoder || !s.decoderCodec) && y(s), !s.decoder || !s.decoderCodec))
|
|
881
881
|
return;
|
|
882
|
-
const
|
|
882
|
+
const _ = await Ft(t);
|
|
883
883
|
if (!(s.isReconfiguring || !s.decoder || !s.decoderCodec) && s.decoder.state !== "closed") {
|
|
884
884
|
if (s.isKeyFrameRequired) {
|
|
885
|
-
if (!
|
|
885
|
+
if (!_.IsKey)
|
|
886
886
|
return;
|
|
887
887
|
s.isKeyFrameRequired = !1;
|
|
888
888
|
}
|
|
@@ -891,105 +891,105 @@ async function vt(t, e) {
|
|
|
891
891
|
return;
|
|
892
892
|
s.decoder.decode(
|
|
893
893
|
new EncodedVideoChunk({
|
|
894
|
-
type:
|
|
895
|
-
timestamp: Number(
|
|
896
|
-
duration:
|
|
897
|
-
data:
|
|
894
|
+
type: _.IsKey ? "key" : "delta",
|
|
895
|
+
timestamp: Number(_.TimestampInUs),
|
|
896
|
+
duration: _.DurationInUs,
|
|
897
|
+
data: _.Data
|
|
898
898
|
})
|
|
899
899
|
);
|
|
900
|
-
} catch (
|
|
901
|
-
if (
|
|
900
|
+
} catch (E) {
|
|
901
|
+
if (E instanceof DOMException && E.message.includes("closed"))
|
|
902
902
|
return;
|
|
903
|
-
s.isKeyFrameRequired = !0, u(s.streamId), R(
|
|
903
|
+
s.isKeyFrameRequired = !0, u(s.streamId), R(E);
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
907
|
function Yt(t) {
|
|
908
|
-
const
|
|
909
|
-
if (!
|
|
908
|
+
const r = w(t.senderId, t.trackId), e = o.get(r);
|
|
909
|
+
if (!e)
|
|
910
910
|
return;
|
|
911
|
-
const n =
|
|
911
|
+
const n = T.get(e);
|
|
912
912
|
n && (n.isKeyFrameRequired = !0, n.watched && u(n.streamId));
|
|
913
913
|
}
|
|
914
|
-
function kt(t,
|
|
915
|
-
switch (
|
|
914
|
+
function kt(t, r) {
|
|
915
|
+
switch (r.opcode) {
|
|
916
916
|
case L.VIDEO_STREAM_BEGIN: {
|
|
917
|
-
const
|
|
917
|
+
const e = w(r.senderId, r.trackId), n = o.get(e);
|
|
918
918
|
if (n) {
|
|
919
|
-
const s =
|
|
919
|
+
const s = T.get(n);
|
|
920
920
|
s && (s.isReconfiguring = !0);
|
|
921
921
|
}
|
|
922
|
-
Kt(t,
|
|
922
|
+
Kt(t, r);
|
|
923
923
|
return;
|
|
924
924
|
}
|
|
925
925
|
case L.VIDEO_STREAM_END:
|
|
926
|
-
xt(
|
|
926
|
+
xt(r);
|
|
927
927
|
return;
|
|
928
928
|
case L.VIDEO_FRAME:
|
|
929
|
-
vt(t,
|
|
929
|
+
vt(t, r);
|
|
930
930
|
return;
|
|
931
931
|
case L.VIDEO_INVALIDATE_FRAME:
|
|
932
|
-
Yt(
|
|
932
|
+
Yt(r);
|
|
933
933
|
return;
|
|
934
934
|
default:
|
|
935
935
|
return;
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
938
|
function j() {
|
|
939
|
-
if (
|
|
939
|
+
if (U) {
|
|
940
940
|
try {
|
|
941
|
-
|
|
941
|
+
U.close();
|
|
942
942
|
} catch {
|
|
943
943
|
}
|
|
944
|
-
|
|
944
|
+
U = null;
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
947
|
function Wt() {
|
|
948
948
|
j();
|
|
949
|
-
for (const t of
|
|
949
|
+
for (const t of T.values())
|
|
950
950
|
q(t.streamId);
|
|
951
|
-
|
|
951
|
+
T.clear(), o.clear();
|
|
952
952
|
}
|
|
953
953
|
self.addEventListener("message", (t) => {
|
|
954
|
-
const
|
|
955
|
-
if (
|
|
956
|
-
if (
|
|
957
|
-
const
|
|
958
|
-
n.watched = !0, n.surface =
|
|
954
|
+
const r = t.data;
|
|
955
|
+
if (r.type !== "configure") {
|
|
956
|
+
if (r.type === "attachSurface") {
|
|
957
|
+
const e = r.streamId, n = M(e);
|
|
958
|
+
n.watched = !0, n.surface = r.canvas;
|
|
959
959
|
try {
|
|
960
960
|
n.ctx2d = n.surface.getContext("2d", { alpha: !1, desynchronized: !0 });
|
|
961
961
|
} catch (s) {
|
|
962
962
|
R(s), n.ctx2d = null;
|
|
963
963
|
}
|
|
964
|
-
n.isKeyFrameRequired = !0, y(n), u(
|
|
964
|
+
n.isKeyFrameRequired = !0, y(n), u(e);
|
|
965
965
|
return;
|
|
966
966
|
}
|
|
967
|
-
if (
|
|
968
|
-
$(
|
|
967
|
+
if (r.type === "detachSurface") {
|
|
968
|
+
$(r.streamId);
|
|
969
969
|
return;
|
|
970
970
|
}
|
|
971
|
-
if (
|
|
972
|
-
j(),
|
|
973
|
-
const n =
|
|
971
|
+
if (r.type === "attachProtocolPort") {
|
|
972
|
+
j(), U = r.port, U.addEventListener("message", (e) => {
|
|
973
|
+
const n = e.data;
|
|
974
974
|
n?.type === "protocol" && n.message instanceof ArrayBuffer && n.headers && kt(new Uint8Array(n.message), n.headers);
|
|
975
|
-
}),
|
|
975
|
+
}), U.start?.();
|
|
976
976
|
return;
|
|
977
977
|
}
|
|
978
|
-
if (
|
|
979
|
-
const
|
|
980
|
-
|
|
978
|
+
if (r.type === "watchStream") {
|
|
979
|
+
const e = M(r.streamId);
|
|
980
|
+
e.watched = !0, e.isKeyFrameRequired = !0, y(e), u(e.streamId);
|
|
981
981
|
return;
|
|
982
982
|
}
|
|
983
|
-
if (
|
|
984
|
-
q(
|
|
983
|
+
if (r.type === "unwatchStream") {
|
|
984
|
+
q(r.streamId);
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
987
|
-
if (
|
|
988
|
-
if (
|
|
989
|
-
for (const
|
|
990
|
-
|
|
987
|
+
if (r.type === "setEnabled") {
|
|
988
|
+
if (O = r.enabled, O)
|
|
989
|
+
for (const e of T.values())
|
|
990
|
+
e.watched && (e.isKeyFrameRequired = !0, y(e), u(e.streamId));
|
|
991
991
|
return;
|
|
992
992
|
}
|
|
993
|
-
|
|
993
|
+
r.type === "dispose" && Wt();
|
|
994
994
|
}
|
|
995
995
|
});
|