@busy-app/busy-lib 0.14.2 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +627 -627
- package/dist/index.d.ts +24 -3
- package/dist/index.js +906 -886
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
var F = Object.defineProperty;
|
|
2
|
+
var B = (e, n, t) => n in e ? F(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var u = (e, n, t) => B(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import j from "openapi-fetch";
|
|
5
|
+
const M = (e, n) => {
|
|
6
6
|
if (typeof FormData < "u" && e instanceof FormData || typeof Buffer < "u" && typeof Buffer.isBuffer == "function" && Buffer.isBuffer(e) || typeof File < "u" && e instanceof File || typeof Blob < "u" && e instanceof Blob || typeof ArrayBuffer < "u" && e instanceof ArrayBuffer || typeof ArrayBuffer < "u" && ArrayBuffer.isView && ArrayBuffer.isView(e))
|
|
7
7
|
return e;
|
|
8
8
|
let t;
|
|
@@ -16,50 +16,50 @@ async function w(e) {
|
|
|
16
16
|
body: r
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let i, o = t ?? void 0, s,
|
|
19
|
+
function G(e, n, t, r = 3e3) {
|
|
20
|
+
let i, o = t ?? void 0, s, l = null;
|
|
21
21
|
const a = async () => {
|
|
22
|
-
i || (
|
|
22
|
+
i || (l || (l = (async () => {
|
|
23
23
|
const f = await n();
|
|
24
24
|
if (!f.api_semver)
|
|
25
25
|
throw new Error("Empty API version");
|
|
26
26
|
i = f.api_semver;
|
|
27
27
|
})().finally(() => {
|
|
28
|
-
|
|
29
|
-
})), await
|
|
30
|
-
},
|
|
28
|
+
l = null;
|
|
29
|
+
})), await l);
|
|
30
|
+
}, U = {
|
|
31
31
|
async onRequest({ request: f, schemaPath: p }) {
|
|
32
32
|
return o && f.headers.set("Authorization", `Bearer ${o}`), p !== "/version" && (await a(), i && f.headers.set("X-API-Sem-Ver", i), s && f.headers.set("X-API-Token", s)), f;
|
|
33
33
|
},
|
|
34
|
-
async onResponse({ request: f, response: p, options:
|
|
34
|
+
async onResponse({ request: f, response: p, options: A, schemaPath: O }) {
|
|
35
35
|
if (p.ok)
|
|
36
36
|
return p;
|
|
37
|
-
if (
|
|
37
|
+
if (O === "/version")
|
|
38
38
|
throw await w(p);
|
|
39
39
|
if (p.status !== 405)
|
|
40
40
|
throw await w(p);
|
|
41
41
|
i = void 0, await a(), i && f.headers.set("X-API-Sem-Ver", i), o && f.headers.set("Authorization", `Bearer ${o}`);
|
|
42
|
-
const h = await (
|
|
42
|
+
const h = await (A.fetch ?? fetch)(f);
|
|
43
43
|
if (h.ok)
|
|
44
44
|
return h;
|
|
45
45
|
throw await w(h);
|
|
46
46
|
}
|
|
47
|
-
}, R =
|
|
47
|
+
}, R = j({
|
|
48
48
|
baseUrl: e,
|
|
49
|
-
bodySerializer:
|
|
49
|
+
bodySerializer: M
|
|
50
50
|
});
|
|
51
51
|
return R.withTimeout = async (f, p = r) => {
|
|
52
52
|
if (p <= 0)
|
|
53
53
|
return await f();
|
|
54
|
-
const
|
|
54
|
+
const A = new AbortController(), O = setTimeout(() => A.abort(), p);
|
|
55
55
|
try {
|
|
56
|
-
return await f(
|
|
56
|
+
return await f(A.signal);
|
|
57
57
|
} catch (h) {
|
|
58
58
|
throw h instanceof DOMException && h.name === "AbortError" ? new Error(`Request timed out after ${p}ms`) : h;
|
|
59
59
|
} finally {
|
|
60
|
-
clearTimeout(
|
|
60
|
+
clearTimeout(O);
|
|
61
61
|
}
|
|
62
|
-
}, R.use(
|
|
62
|
+
}, R.use(U), {
|
|
63
63
|
client: R,
|
|
64
64
|
setApiKey: (f) => {
|
|
65
65
|
s = f;
|
|
@@ -69,25 +69,25 @@ function M(e, n, t, r = 3e3) {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
async function
|
|
72
|
+
async function V(e, n) {
|
|
73
73
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/version", { signal: i }), n == null ? void 0 : n.timeout);
|
|
74
74
|
if (r)
|
|
75
75
|
throw r;
|
|
76
76
|
return t;
|
|
77
77
|
}
|
|
78
|
-
async function
|
|
78
|
+
async function W(e, n) {
|
|
79
79
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/status", { signal: i }), n == null ? void 0 : n.timeout);
|
|
80
80
|
if (r)
|
|
81
81
|
throw r;
|
|
82
82
|
return t;
|
|
83
83
|
}
|
|
84
|
-
async function
|
|
84
|
+
async function $(e, n) {
|
|
85
85
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/status/system", { signal: i }), n == null ? void 0 : n.timeout);
|
|
86
86
|
if (r)
|
|
87
87
|
throw r;
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
async function
|
|
90
|
+
async function H(e, n) {
|
|
91
91
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/status/power", { signal: i }), n == null ? void 0 : n.timeout);
|
|
92
92
|
if (r)
|
|
93
93
|
throw r;
|
|
@@ -99,19 +99,19 @@ async function z(e, n) {
|
|
|
99
99
|
throw r;
|
|
100
100
|
return t;
|
|
101
101
|
}
|
|
102
|
-
async function
|
|
102
|
+
async function J(e, n) {
|
|
103
103
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/status/firmware", { signal: i }), n == null ? void 0 : n.timeout);
|
|
104
104
|
if (r)
|
|
105
105
|
throw r;
|
|
106
106
|
return t;
|
|
107
107
|
}
|
|
108
|
-
async function
|
|
108
|
+
async function K(e, n) {
|
|
109
109
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/transport", { signal: i }), n == null ? void 0 : n.timeout);
|
|
110
110
|
if (r)
|
|
111
111
|
throw r;
|
|
112
112
|
return t;
|
|
113
113
|
}
|
|
114
|
-
class
|
|
114
|
+
class Y {
|
|
115
115
|
/**
|
|
116
116
|
* Get API version information.
|
|
117
117
|
*
|
|
@@ -120,7 +120,7 @@ class K {
|
|
|
120
120
|
* @returns {Promise<VersionInfo>} A promise that resolves to an object containing the `api_semver` string.
|
|
121
121
|
*/
|
|
122
122
|
async SystemVersionGet(n) {
|
|
123
|
-
const t = await
|
|
123
|
+
const t = await V(this.apiClient, n);
|
|
124
124
|
return this.apiSemver = t.api_semver, t;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
@@ -131,7 +131,7 @@ class K {
|
|
|
131
131
|
* @returns {Promise<Status>} Current status of the device.
|
|
132
132
|
*/
|
|
133
133
|
async SystemStatusGet(n) {
|
|
134
|
-
return await
|
|
134
|
+
return await W(this.apiClient, n);
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* Get system status.
|
|
@@ -141,7 +141,7 @@ class K {
|
|
|
141
141
|
* @returns {Promise<StatusSystem>} Current system status.
|
|
142
142
|
*/
|
|
143
143
|
async SystemInfoGet(n) {
|
|
144
|
-
return await
|
|
144
|
+
return await $(this.apiClient, n);
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
147
|
* Get power status.
|
|
@@ -151,7 +151,7 @@ class K {
|
|
|
151
151
|
* @returns {Promise<StatusPower>} Current power status.
|
|
152
152
|
*/
|
|
153
153
|
async SystemStatusPowerGet(n) {
|
|
154
|
-
return await
|
|
154
|
+
return await H(this.apiClient, n);
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
157
157
|
* Get device status.
|
|
@@ -171,7 +171,7 @@ class K {
|
|
|
171
171
|
* @returns {Promise<StatusFirmware>} Current firmware status.
|
|
172
172
|
*/
|
|
173
173
|
async SystemStatusFirmwareGet(n) {
|
|
174
|
-
return await
|
|
174
|
+
return await J(this.apiClient, n);
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Get device transport information.
|
|
@@ -181,10 +181,10 @@ class K {
|
|
|
181
181
|
* @returns {Promise<NetworkInterfaceInfo>} Current transport info (usb/wifi).
|
|
182
182
|
*/
|
|
183
183
|
async SystemTransportGet(n) {
|
|
184
|
-
return await
|
|
184
|
+
return await K(this.apiClient, n);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
async function
|
|
187
|
+
async function X(e, n) {
|
|
188
188
|
const { file: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
189
189
|
(o) => e.POST("/update", {
|
|
190
190
|
headers: {
|
|
@@ -199,19 +199,19 @@ async function Y(e, n) {
|
|
|
199
199
|
throw i;
|
|
200
200
|
return r;
|
|
201
201
|
}
|
|
202
|
-
async function
|
|
202
|
+
async function Z(e, n) {
|
|
203
203
|
const { data: t, error: r } = await e.withTimeout((i) => e.POST("/update/check", { signal: i }), n == null ? void 0 : n.timeout);
|
|
204
204
|
if (r)
|
|
205
205
|
throw r;
|
|
206
206
|
return t;
|
|
207
207
|
}
|
|
208
|
-
async function
|
|
208
|
+
async function Q(e, n) {
|
|
209
209
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/update/status", { signal: i }), n == null ? void 0 : n.timeout);
|
|
210
210
|
if (r)
|
|
211
211
|
throw r;
|
|
212
212
|
return t;
|
|
213
213
|
}
|
|
214
|
-
async function
|
|
214
|
+
async function nn(e, n) {
|
|
215
215
|
const { version: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
216
216
|
(o) => e.GET("/update/changelog", {
|
|
217
217
|
params: {
|
|
@@ -227,7 +227,7 @@ async function Q(e, n) {
|
|
|
227
227
|
throw i;
|
|
228
228
|
return r;
|
|
229
229
|
}
|
|
230
|
-
async function
|
|
230
|
+
async function en(e, n) {
|
|
231
231
|
const { version: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
232
232
|
(o) => e.POST("/update/install", {
|
|
233
233
|
params: {
|
|
@@ -243,23 +243,23 @@ async function nn(e, n) {
|
|
|
243
243
|
throw i;
|
|
244
244
|
return r;
|
|
245
245
|
}
|
|
246
|
-
async function
|
|
246
|
+
async function tn(e, n) {
|
|
247
247
|
const { data: t, error: r } = await e.withTimeout((i) => e.POST("/update/abort_download", { signal: i }), n == null ? void 0 : n.timeout);
|
|
248
248
|
if (r)
|
|
249
249
|
throw r;
|
|
250
250
|
return t;
|
|
251
251
|
}
|
|
252
|
-
async function
|
|
252
|
+
async function rn(e, n) {
|
|
253
253
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/update/autoupdate", { signal: i }), n == null ? void 0 : n.timeout);
|
|
254
254
|
if (r)
|
|
255
255
|
throw r;
|
|
256
256
|
return t;
|
|
257
257
|
}
|
|
258
|
-
async function
|
|
258
|
+
async function on(e, n) {
|
|
259
259
|
const { is_enabled: t, interval_start: r, interval_end: i } = n, { data: o, error: s } = await e.withTimeout(
|
|
260
|
-
(
|
|
260
|
+
(l) => e.POST("/update/autoupdate", {
|
|
261
261
|
body: { is_enabled: t, interval_start: r, interval_end: i },
|
|
262
|
-
signal:
|
|
262
|
+
signal: l
|
|
263
263
|
}),
|
|
264
264
|
n.timeout
|
|
265
265
|
);
|
|
@@ -267,7 +267,7 @@ async function rn(e, n) {
|
|
|
267
267
|
throw s;
|
|
268
268
|
return o;
|
|
269
269
|
}
|
|
270
|
-
class
|
|
270
|
+
class sn {
|
|
271
271
|
/**
|
|
272
272
|
* Upload firmware update package.
|
|
273
273
|
*
|
|
@@ -277,7 +277,7 @@ class on {
|
|
|
277
277
|
* @returns {Promise<SuccessResponse>} A promise that resolves when upload is complete.
|
|
278
278
|
*/
|
|
279
279
|
async UpdateFromFile(n) {
|
|
280
|
-
return await
|
|
280
|
+
return await X(this.apiClient, n);
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
283
283
|
* Start firmware update check.
|
|
@@ -287,7 +287,7 @@ class on {
|
|
|
287
287
|
* @returns {Promise<SuccessResponse>} A promise that resolves to the update check result.
|
|
288
288
|
*/
|
|
289
289
|
async UpdateCheck(n) {
|
|
290
|
-
return await
|
|
290
|
+
return await Z(this.apiClient, n);
|
|
291
291
|
}
|
|
292
292
|
/**
|
|
293
293
|
* Get firmware update status.
|
|
@@ -297,7 +297,7 @@ class on {
|
|
|
297
297
|
* @returns {Promise<UpdateStatus>} A promise that resolves to the update status.
|
|
298
298
|
*/
|
|
299
299
|
async UpdateStatusGet(n) {
|
|
300
|
-
return await
|
|
300
|
+
return await Q(this.apiClient, n);
|
|
301
301
|
}
|
|
302
302
|
/**
|
|
303
303
|
* Get firmware update changelog.
|
|
@@ -308,7 +308,7 @@ class on {
|
|
|
308
308
|
* @returns {Promise<UpdateChangelog>} A promise that resolves to the changelog content.
|
|
309
309
|
*/
|
|
310
310
|
async UpdateChangelogGet(n) {
|
|
311
|
-
return await
|
|
311
|
+
return await nn(this.apiClient, n);
|
|
312
312
|
}
|
|
313
313
|
/**
|
|
314
314
|
* Start firmware update installation.
|
|
@@ -319,7 +319,7 @@ class on {
|
|
|
319
319
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful initiation.
|
|
320
320
|
*/
|
|
321
321
|
async UpdateInstall(n) {
|
|
322
|
-
return await
|
|
322
|
+
return await en(this.apiClient, n);
|
|
323
323
|
}
|
|
324
324
|
/**
|
|
325
325
|
* Abort firmware update download.
|
|
@@ -329,7 +329,7 @@ class on {
|
|
|
329
329
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful abort.
|
|
330
330
|
*/
|
|
331
331
|
async UpdateAbort(n) {
|
|
332
|
-
return await
|
|
332
|
+
return await tn(this.apiClient, n);
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
335
335
|
* Get current auto-update settings.
|
|
@@ -339,7 +339,7 @@ class on {
|
|
|
339
339
|
* @returns {Promise<AutoUpdateSettings>} A promise that resolves to the current auto-update settings.
|
|
340
340
|
*/
|
|
341
341
|
async UpdateAutoUpdateGet(n) {
|
|
342
|
-
return await
|
|
342
|
+
return await rn(this.apiClient, n);
|
|
343
343
|
}
|
|
344
344
|
/**
|
|
345
345
|
* Set auto-update settings.
|
|
@@ -352,16 +352,16 @@ class on {
|
|
|
352
352
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful update of settings.
|
|
353
353
|
*/
|
|
354
354
|
async UpdateAutoUpdateSet(n) {
|
|
355
|
-
return await
|
|
355
|
+
return await on(this.apiClient, n);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
async function
|
|
358
|
+
async function an(e, n) {
|
|
359
359
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/time", { signal: i }), n == null ? void 0 : n.timeout);
|
|
360
360
|
if (r)
|
|
361
361
|
throw r;
|
|
362
362
|
return t;
|
|
363
363
|
}
|
|
364
|
-
async function
|
|
364
|
+
async function un(e, n) {
|
|
365
365
|
const { timestamp: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
366
366
|
(o) => e.POST("/time/timestamp", {
|
|
367
367
|
params: {
|
|
@@ -375,13 +375,13 @@ async function an(e, n) {
|
|
|
375
375
|
throw i;
|
|
376
376
|
return r;
|
|
377
377
|
}
|
|
378
|
-
async function
|
|
378
|
+
async function ln(e, n) {
|
|
379
379
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/time/timezone", { signal: i }), n == null ? void 0 : n.timeout);
|
|
380
380
|
if (r)
|
|
381
381
|
throw r;
|
|
382
382
|
return t;
|
|
383
383
|
}
|
|
384
|
-
async function
|
|
384
|
+
async function fn(e, n) {
|
|
385
385
|
const { timezone: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
386
386
|
(o) => e.POST("/time/timezone", {
|
|
387
387
|
params: {
|
|
@@ -395,13 +395,13 @@ async function ln(e, n) {
|
|
|
395
395
|
throw i;
|
|
396
396
|
return r;
|
|
397
397
|
}
|
|
398
|
-
async function
|
|
398
|
+
async function cn(e, n) {
|
|
399
399
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/time/tzlist", { signal: i }), n == null ? void 0 : n.timeout);
|
|
400
400
|
if (r)
|
|
401
401
|
throw r;
|
|
402
402
|
return t;
|
|
403
403
|
}
|
|
404
|
-
class
|
|
404
|
+
class dn {
|
|
405
405
|
/**
|
|
406
406
|
* Get current timestamp info.
|
|
407
407
|
*
|
|
@@ -410,7 +410,7 @@ class cn {
|
|
|
410
410
|
* @returns {Promise<TimestampInfo>} A promise that resolves to the timestamp information.
|
|
411
411
|
*/
|
|
412
412
|
async TimeGet(n) {
|
|
413
|
-
return await
|
|
413
|
+
return await an(this.apiClient, n);
|
|
414
414
|
}
|
|
415
415
|
/**
|
|
416
416
|
* Set system timestamp.
|
|
@@ -421,7 +421,7 @@ class cn {
|
|
|
421
421
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
422
422
|
*/
|
|
423
423
|
async TimeTimestampSet(n) {
|
|
424
|
-
return await
|
|
424
|
+
return await un(this.apiClient, n);
|
|
425
425
|
}
|
|
426
426
|
/**
|
|
427
427
|
* Get current timezone.
|
|
@@ -431,7 +431,7 @@ class cn {
|
|
|
431
431
|
* @returns {Promise<TimezoneInfo>} A promise that resolves to the timezone information.
|
|
432
432
|
*/
|
|
433
433
|
async TimeTimezoneGet(n) {
|
|
434
|
-
return await
|
|
434
|
+
return await ln(this.apiClient, n);
|
|
435
435
|
}
|
|
436
436
|
/**
|
|
437
437
|
* Set system timezone.
|
|
@@ -442,7 +442,7 @@ class cn {
|
|
|
442
442
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
443
443
|
*/
|
|
444
444
|
async TimeTimezoneSet(n) {
|
|
445
|
-
return await
|
|
445
|
+
return await fn(this.apiClient, n);
|
|
446
446
|
}
|
|
447
447
|
/**
|
|
448
448
|
* Get list of supported timezones.
|
|
@@ -452,28 +452,28 @@ class cn {
|
|
|
452
452
|
* @returns {Promise<TimezoneList>} A promise that resolves to a list of timezone items.
|
|
453
453
|
*/
|
|
454
454
|
async TimeTzListGet(n) {
|
|
455
|
-
return await
|
|
455
|
+
return await cn(this.apiClient, n);
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
|
-
async function
|
|
458
|
+
async function pn(e, n) {
|
|
459
459
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/account/status", { signal: i }), n == null ? void 0 : n.timeout);
|
|
460
460
|
if (r)
|
|
461
461
|
throw r;
|
|
462
462
|
return t;
|
|
463
463
|
}
|
|
464
|
-
async function
|
|
464
|
+
async function hn(e, n) {
|
|
465
465
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/account/info", { signal: i }), n == null ? void 0 : n.timeout);
|
|
466
466
|
if (r)
|
|
467
467
|
throw r;
|
|
468
468
|
return t;
|
|
469
469
|
}
|
|
470
|
-
async function
|
|
470
|
+
async function yn(e, n) {
|
|
471
471
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/account/profile", { signal: i }), n == null ? void 0 : n.timeout);
|
|
472
472
|
if (r)
|
|
473
473
|
throw r;
|
|
474
474
|
return t;
|
|
475
475
|
}
|
|
476
|
-
async function
|
|
476
|
+
async function mn(e, n) {
|
|
477
477
|
const { profile: t, custom_url: r } = n, { data: i, error: o } = await e.withTimeout(
|
|
478
478
|
(s) => e.POST("/account/profile", {
|
|
479
479
|
params: {
|
|
@@ -490,19 +490,19 @@ async function yn(e, n) {
|
|
|
490
490
|
throw o;
|
|
491
491
|
return i;
|
|
492
492
|
}
|
|
493
|
-
async function
|
|
493
|
+
async function vn(e, n) {
|
|
494
494
|
const { data: t, error: r } = await e.withTimeout((i) => e.DELETE("/account", { signal: i }), n == null ? void 0 : n.timeout);
|
|
495
495
|
if (r)
|
|
496
496
|
throw r;
|
|
497
497
|
return t;
|
|
498
498
|
}
|
|
499
|
-
async function
|
|
499
|
+
async function gn(e, n) {
|
|
500
500
|
const { data: t, error: r } = await e.withTimeout((i) => e.POST("/account/link", { signal: i }), n == null ? void 0 : n.timeout);
|
|
501
501
|
if (r)
|
|
502
502
|
throw r;
|
|
503
503
|
return t;
|
|
504
504
|
}
|
|
505
|
-
class
|
|
505
|
+
class bn {
|
|
506
506
|
/**
|
|
507
507
|
* Get account info.
|
|
508
508
|
*
|
|
@@ -511,7 +511,7 @@ class gn {
|
|
|
511
511
|
* @returns {Promise<AccountInfo>} A promise that resolves to the account information.
|
|
512
512
|
*/
|
|
513
513
|
async AccountInfoGet(n) {
|
|
514
|
-
return await
|
|
514
|
+
return await hn(this.apiClient, n);
|
|
515
515
|
}
|
|
516
516
|
/**
|
|
517
517
|
* Get account state.
|
|
@@ -521,7 +521,7 @@ class gn {
|
|
|
521
521
|
* @returns {Promise<AccountStatus>} A promise that resolves to the account state.
|
|
522
522
|
*/
|
|
523
523
|
async AccountStateGet(n) {
|
|
524
|
-
return await
|
|
524
|
+
return await pn(this.apiClient, n);
|
|
525
525
|
}
|
|
526
526
|
/**
|
|
527
527
|
* Get account profile.
|
|
@@ -531,7 +531,7 @@ class gn {
|
|
|
531
531
|
* @returns {Promise<AccountProfile>} A promise that resolves to the account profile.
|
|
532
532
|
*/
|
|
533
533
|
async AccountProfileGet(n) {
|
|
534
|
-
return await
|
|
534
|
+
return await yn(this.apiClient, n);
|
|
535
535
|
}
|
|
536
536
|
/**
|
|
537
537
|
* Set account profile.
|
|
@@ -543,7 +543,7 @@ class gn {
|
|
|
543
543
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
544
544
|
*/
|
|
545
545
|
async AccountProfileSet(n) {
|
|
546
|
-
return await
|
|
546
|
+
return await mn(this.apiClient, n);
|
|
547
547
|
}
|
|
548
548
|
/**
|
|
549
549
|
* Unlink device from account. Removes association with the current account.
|
|
@@ -553,7 +553,7 @@ class gn {
|
|
|
553
553
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful unlinking.
|
|
554
554
|
*/
|
|
555
555
|
async AccountUnlink(n) {
|
|
556
|
-
return await
|
|
556
|
+
return await vn(this.apiClient, n);
|
|
557
557
|
}
|
|
558
558
|
/**
|
|
559
559
|
* Link device to account. Requests account link PIN. Works only if device is connected to MQTT and is not linked to account.
|
|
@@ -563,11 +563,11 @@ class gn {
|
|
|
563
563
|
* @returns {Promise<AccountLink>} A promise that resolves to the link information (e.g., PIN).
|
|
564
564
|
*/
|
|
565
565
|
async AccountLink(n) {
|
|
566
|
-
return await
|
|
566
|
+
return await gn(this.apiClient, n);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
async function
|
|
570
|
-
const { application_name: t, elements: r, priority: i = 50, timeout: o } = n, { data: s, error:
|
|
569
|
+
async function En(e, n) {
|
|
570
|
+
const { application_name: t, elements: r, priority: i = 50, timeout: o } = n, { data: s, error: l } = await e.withTimeout(
|
|
571
571
|
(a) => e.POST("/display/draw", {
|
|
572
572
|
body: {
|
|
573
573
|
application_name: t,
|
|
@@ -578,11 +578,11 @@ async function bn(e, n) {
|
|
|
578
578
|
}),
|
|
579
579
|
o
|
|
580
580
|
);
|
|
581
|
-
if (
|
|
582
|
-
throw
|
|
581
|
+
if (l)
|
|
582
|
+
throw l;
|
|
583
583
|
return s;
|
|
584
584
|
}
|
|
585
|
-
async function
|
|
585
|
+
async function _n(e, n) {
|
|
586
586
|
const { data: t, error: r } = await e.withTimeout(
|
|
587
587
|
(i) => e.DELETE("/display/draw", {
|
|
588
588
|
params: {
|
|
@@ -598,7 +598,7 @@ async function En(e, n) {
|
|
|
598
598
|
throw r;
|
|
599
599
|
return t;
|
|
600
600
|
}
|
|
601
|
-
async function
|
|
601
|
+
async function An(e, n) {
|
|
602
602
|
const { display: t, timeout: r } = n, { data: i, error: o } = await e.withTimeout(
|
|
603
603
|
(s) => e.GET("/screen", {
|
|
604
604
|
params: {
|
|
@@ -621,22 +621,22 @@ async function Tn(e, n) {
|
|
|
621
621
|
throw r;
|
|
622
622
|
return t;
|
|
623
623
|
}
|
|
624
|
-
async function
|
|
625
|
-
const { value: t } = n, i = ((
|
|
626
|
-
if (typeof
|
|
627
|
-
if (
|
|
624
|
+
async function Rn(e, n) {
|
|
625
|
+
const { value: t } = n, i = ((l) => {
|
|
626
|
+
if (typeof l == "number") {
|
|
627
|
+
if (l < 0 || l > 100)
|
|
628
628
|
throw new Error("Brightness value must be between 0 and 100 or 'auto'");
|
|
629
|
-
return String(
|
|
629
|
+
return String(l);
|
|
630
630
|
}
|
|
631
631
|
return "auto";
|
|
632
632
|
})(t), { data: o, error: s } = await e.withTimeout(
|
|
633
|
-
(
|
|
633
|
+
(l) => e.POST("/display/brightness", {
|
|
634
634
|
params: {
|
|
635
635
|
query: {
|
|
636
636
|
value: i
|
|
637
637
|
}
|
|
638
638
|
},
|
|
639
|
-
signal:
|
|
639
|
+
signal: l
|
|
640
640
|
}),
|
|
641
641
|
n.timeout
|
|
642
642
|
);
|
|
@@ -644,7 +644,7 @@ async function On(e, n) {
|
|
|
644
644
|
throw s;
|
|
645
645
|
return o;
|
|
646
646
|
}
|
|
647
|
-
class
|
|
647
|
+
class On {
|
|
648
648
|
/**
|
|
649
649
|
* Draw on display. Sends drawing data to the display. Supports JSON-defined display elements.
|
|
650
650
|
*
|
|
@@ -656,7 +656,7 @@ class Rn {
|
|
|
656
656
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful draw command.
|
|
657
657
|
*/
|
|
658
658
|
async DisplayDraw(n) {
|
|
659
|
-
return await
|
|
659
|
+
return await En(this.apiClient, n);
|
|
660
660
|
}
|
|
661
661
|
/**
|
|
662
662
|
* Clear display. Deletes display elements drawn by the Canvas application.
|
|
@@ -668,7 +668,7 @@ class Rn {
|
|
|
668
668
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful clear command.
|
|
669
669
|
*/
|
|
670
670
|
async DisplayClear(n) {
|
|
671
|
-
return await
|
|
671
|
+
return await _n(this.apiClient, n);
|
|
672
672
|
}
|
|
673
673
|
/**
|
|
674
674
|
* Get single frame for requested screen.
|
|
@@ -679,7 +679,7 @@ class Rn {
|
|
|
679
679
|
* @returns {Promise<Blob>} A promise that resolves to the screen frame as a Blob.
|
|
680
680
|
*/
|
|
681
681
|
async DisplayScreenFrameGet(n) {
|
|
682
|
-
return await
|
|
682
|
+
return await An(this.apiClient, n);
|
|
683
683
|
}
|
|
684
684
|
/**
|
|
685
685
|
* Get display brightness.
|
|
@@ -700,10 +700,10 @@ class Rn {
|
|
|
700
700
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
701
701
|
*/
|
|
702
702
|
async DisplayBrightnessSet(n) {
|
|
703
|
-
return await
|
|
703
|
+
return await Rn(this.apiClient, n);
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
|
-
async function
|
|
706
|
+
async function wn(e, n) {
|
|
707
707
|
const { application_name: t, path: r } = n, { data: i, error: o } = await e.withTimeout(
|
|
708
708
|
(s) => e.POST("/audio/play", {
|
|
709
709
|
params: {
|
|
@@ -720,7 +720,7 @@ async function An(e, n) {
|
|
|
720
720
|
throw o;
|
|
721
721
|
return i;
|
|
722
722
|
}
|
|
723
|
-
async function
|
|
723
|
+
async function Nn(e, n) {
|
|
724
724
|
const { data: t, error: r } = await e.withTimeout((i) => e.DELETE("/audio/play", { signal: i }), n == null ? void 0 : n.timeout);
|
|
725
725
|
if (r)
|
|
726
726
|
throw r;
|
|
@@ -732,7 +732,7 @@ async function Sn(e, n) {
|
|
|
732
732
|
throw r;
|
|
733
733
|
return t;
|
|
734
734
|
}
|
|
735
|
-
async function
|
|
735
|
+
async function In(e, n) {
|
|
736
736
|
const { volume: t, silent: r } = n;
|
|
737
737
|
if (typeof t != "number" || t < 0 || t > 100)
|
|
738
738
|
throw new Error("Volume must be a number between 0 and 100");
|
|
@@ -752,7 +752,7 @@ async function Nn(e, n) {
|
|
|
752
752
|
throw o;
|
|
753
753
|
return i;
|
|
754
754
|
}
|
|
755
|
-
class
|
|
755
|
+
class Cn {
|
|
756
756
|
/**
|
|
757
757
|
* Play audio file. Plays a file from internal storage.
|
|
758
758
|
*
|
|
@@ -763,7 +763,7 @@ class In {
|
|
|
763
763
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful play command.
|
|
764
764
|
*/
|
|
765
765
|
async AudioPlay(n) {
|
|
766
|
-
return await
|
|
766
|
+
return await wn(this.apiClient, n);
|
|
767
767
|
}
|
|
768
768
|
/**
|
|
769
769
|
* Stop audio playback. Stops any currently playing audio.
|
|
@@ -773,7 +773,7 @@ class In {
|
|
|
773
773
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful stop command.
|
|
774
774
|
*/
|
|
775
775
|
async AudioStop(n) {
|
|
776
|
-
return await
|
|
776
|
+
return await Nn(this.apiClient, n);
|
|
777
777
|
}
|
|
778
778
|
/**
|
|
779
779
|
* Get audio volume.
|
|
@@ -794,17 +794,17 @@ class In {
|
|
|
794
794
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
795
795
|
*/
|
|
796
796
|
async AudioVolumeSet(n) {
|
|
797
|
-
return await
|
|
797
|
+
return await In(this.apiClient, n);
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
|
-
async function
|
|
800
|
+
async function kn(e, n) {
|
|
801
801
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/wifi/status", { signal: i }), n == null ? void 0 : n.timeout);
|
|
802
802
|
if (r)
|
|
803
803
|
throw r;
|
|
804
804
|
return t;
|
|
805
805
|
}
|
|
806
|
-
async function
|
|
807
|
-
const { ssid: t, password: r, security: i, ip_config: o } = n, { data: s, error:
|
|
806
|
+
async function qn(e, n) {
|
|
807
|
+
const { ssid: t, password: r, security: i, ip_config: o } = n, { data: s, error: l } = await e.withTimeout(
|
|
808
808
|
(a) => e.POST("/wifi/connect", {
|
|
809
809
|
body: {
|
|
810
810
|
ssid: t,
|
|
@@ -816,17 +816,17 @@ async function kn(e, n) {
|
|
|
816
816
|
}),
|
|
817
817
|
n.timeout
|
|
818
818
|
);
|
|
819
|
-
if (
|
|
820
|
-
throw
|
|
819
|
+
if (l)
|
|
820
|
+
throw l;
|
|
821
821
|
return s;
|
|
822
822
|
}
|
|
823
|
-
async function
|
|
823
|
+
async function Pn(e, n) {
|
|
824
824
|
const { data: t, error: r } = await e.withTimeout((i) => e.POST("/wifi/disconnect", { signal: i }), n == null ? void 0 : n.timeout);
|
|
825
825
|
if (r)
|
|
826
826
|
throw r;
|
|
827
827
|
return t;
|
|
828
828
|
}
|
|
829
|
-
async function
|
|
829
|
+
async function Dn(e, n) {
|
|
830
830
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/wifi/networks", { signal: i }), n == null ? void 0 : n.timeout);
|
|
831
831
|
if (r)
|
|
832
832
|
throw r;
|
|
@@ -841,7 +841,7 @@ class jn {
|
|
|
841
841
|
* @returns {Promise<WifiStatusResponse>} A promise that resolves to the Wi-Fi status.
|
|
842
842
|
*/
|
|
843
843
|
async WifiStatusGet(n) {
|
|
844
|
-
return await
|
|
844
|
+
return await kn(this.apiClient, n);
|
|
845
845
|
}
|
|
846
846
|
/**
|
|
847
847
|
* Connects to Wi-Fi network.
|
|
@@ -855,7 +855,7 @@ class jn {
|
|
|
855
855
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful connection initiation.
|
|
856
856
|
*/
|
|
857
857
|
async WifiConnect(n) {
|
|
858
|
-
return await
|
|
858
|
+
return await qn(this.apiClient, n);
|
|
859
859
|
}
|
|
860
860
|
/**
|
|
861
861
|
* Disconnects from Wi-Fi.
|
|
@@ -865,7 +865,7 @@ class jn {
|
|
|
865
865
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful disconnection.
|
|
866
866
|
*/
|
|
867
867
|
async WifiDisconnect(n) {
|
|
868
|
-
return await
|
|
868
|
+
return await Pn(this.apiClient, n);
|
|
869
869
|
}
|
|
870
870
|
/**
|
|
871
871
|
* Scans environment for available Wi-Fi networks.
|
|
@@ -875,10 +875,10 @@ class jn {
|
|
|
875
875
|
* @returns {Promise<WifiNetworkResponse>} A promise that resolves to a list of available networks.
|
|
876
876
|
*/
|
|
877
877
|
async WifiNetworksGet(n) {
|
|
878
|
-
return await
|
|
878
|
+
return await Dn(this.apiClient, n);
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
|
-
async function
|
|
881
|
+
async function Ln(e, n) {
|
|
882
882
|
const { path: t, file: r } = n, { data: i, error: o } = await e.withTimeout(
|
|
883
883
|
(s) => e.POST("/storage/write", {
|
|
884
884
|
params: {
|
|
@@ -898,7 +898,7 @@ async function Dn(e, n) {
|
|
|
898
898
|
throw o;
|
|
899
899
|
return i;
|
|
900
900
|
}
|
|
901
|
-
async function
|
|
901
|
+
async function xn(e, n) {
|
|
902
902
|
const { path: t, as_array_buffer: r } = n, { data: i, error: o } = await e.withTimeout(
|
|
903
903
|
(s) => e.GET("/storage/read", {
|
|
904
904
|
params: {
|
|
@@ -915,7 +915,7 @@ async function Ln(e, n) {
|
|
|
915
915
|
throw o;
|
|
916
916
|
return i;
|
|
917
917
|
}
|
|
918
|
-
async function
|
|
918
|
+
async function Un(e, n) {
|
|
919
919
|
const { path: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
920
920
|
(o) => e.GET("/storage/list", {
|
|
921
921
|
params: {
|
|
@@ -931,7 +931,7 @@ async function Fn(e, n) {
|
|
|
931
931
|
throw i;
|
|
932
932
|
return r;
|
|
933
933
|
}
|
|
934
|
-
async function
|
|
934
|
+
async function Fn(e, n) {
|
|
935
935
|
const { path: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
936
936
|
(o) => e.DELETE("/storage/remove", {
|
|
937
937
|
params: {
|
|
@@ -947,7 +947,7 @@ async function xn(e, n) {
|
|
|
947
947
|
throw i;
|
|
948
948
|
return r;
|
|
949
949
|
}
|
|
950
|
-
async function
|
|
950
|
+
async function Bn(e, n) {
|
|
951
951
|
const { path: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
952
952
|
(o) => e.POST("/storage/mkdir", {
|
|
953
953
|
params: {
|
|
@@ -963,13 +963,13 @@ async function Un(e, n) {
|
|
|
963
963
|
throw i;
|
|
964
964
|
return r;
|
|
965
965
|
}
|
|
966
|
-
async function
|
|
966
|
+
async function Mn(e, n) {
|
|
967
967
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/storage/status", { signal: i }), n == null ? void 0 : n.timeout);
|
|
968
968
|
if (r)
|
|
969
969
|
throw r;
|
|
970
970
|
return t;
|
|
971
971
|
}
|
|
972
|
-
async function
|
|
972
|
+
async function Gn(e, n) {
|
|
973
973
|
const { path: t, new_path: r } = n, { data: i, error: o } = await e.withTimeout(
|
|
974
974
|
(s) => e.POST("/storage/rename", {
|
|
975
975
|
params: {
|
|
@@ -986,7 +986,7 @@ async function Mn(e, n) {
|
|
|
986
986
|
throw o;
|
|
987
987
|
return i;
|
|
988
988
|
}
|
|
989
|
-
class
|
|
989
|
+
class Vn {
|
|
990
990
|
/**
|
|
991
991
|
* Upload file to internal storage. Uploads a file to a specified path.
|
|
992
992
|
*
|
|
@@ -997,7 +997,7 @@ class Gn {
|
|
|
997
997
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful upload.
|
|
998
998
|
*/
|
|
999
999
|
async StorageWrite(n) {
|
|
1000
|
-
return await
|
|
1000
|
+
return await Ln(this.apiClient, n);
|
|
1001
1001
|
}
|
|
1002
1002
|
/**
|
|
1003
1003
|
* Download file from internal storage. Downloads a file from a specified path.
|
|
@@ -1009,7 +1009,7 @@ class Gn {
|
|
|
1009
1009
|
* @returns {Promise<StorageReadResponse>} A promise that resolves to the file content (Blob or ArrayBuffer).
|
|
1010
1010
|
*/
|
|
1011
1011
|
async StorageRead(n) {
|
|
1012
|
-
return await
|
|
1012
|
+
return await xn(this.apiClient, n);
|
|
1013
1013
|
}
|
|
1014
1014
|
/**
|
|
1015
1015
|
* List files on internal storage.
|
|
@@ -1020,7 +1020,7 @@ class Gn {
|
|
|
1020
1020
|
* @returns {Promise<StorageList>} A promise that resolves to a list of files and directories.
|
|
1021
1021
|
*/
|
|
1022
1022
|
async StorageListGet(n) {
|
|
1023
|
-
return await
|
|
1023
|
+
return await Un(this.apiClient, n);
|
|
1024
1024
|
}
|
|
1025
1025
|
/**
|
|
1026
1026
|
* Remove a file on internal storage. Removes a file with a specified path.
|
|
@@ -1031,7 +1031,7 @@ class Gn {
|
|
|
1031
1031
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful removal.
|
|
1032
1032
|
*/
|
|
1033
1033
|
async StorageRemove(n) {
|
|
1034
|
-
return await
|
|
1034
|
+
return await Fn(this.apiClient, n);
|
|
1035
1035
|
}
|
|
1036
1036
|
/**
|
|
1037
1037
|
* Create a directory on internal storage. Creates a new directory with a specified path.
|
|
@@ -1042,7 +1042,7 @@ class Gn {
|
|
|
1042
1042
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful creation.
|
|
1043
1043
|
*/
|
|
1044
1044
|
async StorageMkdir(n) {
|
|
1045
|
-
return await
|
|
1045
|
+
return await Bn(this.apiClient, n);
|
|
1046
1046
|
}
|
|
1047
1047
|
/**
|
|
1048
1048
|
* Show storage usage.
|
|
@@ -1052,7 +1052,7 @@ class Gn {
|
|
|
1052
1052
|
* @returns {Promise<StorageStatus>} A promise that resolves to the storage status.
|
|
1053
1053
|
*/
|
|
1054
1054
|
async StorageStatusGet(n) {
|
|
1055
|
-
return await
|
|
1055
|
+
return await Mn(this.apiClient, n);
|
|
1056
1056
|
}
|
|
1057
1057
|
/**
|
|
1058
1058
|
* Rename/move a file. Moves a file to a new location.
|
|
@@ -1064,28 +1064,28 @@ class Gn {
|
|
|
1064
1064
|
* @returns {Promise<SuccessResponse>} A promise that resolves on successful rename.
|
|
1065
1065
|
*/
|
|
1066
1066
|
async StorageRename(n) {
|
|
1067
|
-
return await
|
|
1067
|
+
return await Gn(this.apiClient, n);
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
async function
|
|
1070
|
+
async function Wn(e, n) {
|
|
1071
1071
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/access", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1072
1072
|
if (r)
|
|
1073
1073
|
throw r;
|
|
1074
1074
|
return t;
|
|
1075
1075
|
}
|
|
1076
|
-
async function
|
|
1076
|
+
async function $n(e, n) {
|
|
1077
1077
|
const { mode: t, key: r } = n, i = r ?? "";
|
|
1078
1078
|
if (String(i).trim() && !/^\d{4,10}$/.test(String(i)))
|
|
1079
1079
|
throw new Error("Key must be a string of 4 to 10 digits");
|
|
1080
1080
|
const { data: o, error: s } = await e.withTimeout(
|
|
1081
|
-
(
|
|
1081
|
+
(l) => e.POST("/access", {
|
|
1082
1082
|
params: {
|
|
1083
1083
|
query: {
|
|
1084
1084
|
mode: t,
|
|
1085
1085
|
key: i
|
|
1086
1086
|
}
|
|
1087
1087
|
},
|
|
1088
|
-
signal:
|
|
1088
|
+
signal: l
|
|
1089
1089
|
}),
|
|
1090
1090
|
n.timeout
|
|
1091
1091
|
);
|
|
@@ -1093,7 +1093,7 @@ async function Wn(e, n) {
|
|
|
1093
1093
|
throw s;
|
|
1094
1094
|
return o;
|
|
1095
1095
|
}
|
|
1096
|
-
async function
|
|
1096
|
+
async function Hn(e, n) {
|
|
1097
1097
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/name", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1098
1098
|
if (r)
|
|
1099
1099
|
throw r;
|
|
@@ -1111,7 +1111,7 @@ async function zn(e, n) {
|
|
|
1111
1111
|
throw i;
|
|
1112
1112
|
return r;
|
|
1113
1113
|
}
|
|
1114
|
-
class
|
|
1114
|
+
class Jn {
|
|
1115
1115
|
/**
|
|
1116
1116
|
* Get HTTP API access over Wi-Fi configuration.
|
|
1117
1117
|
*
|
|
@@ -1120,7 +1120,7 @@ class Hn {
|
|
|
1120
1120
|
* @returns {Promise<HttpAccessInfo>} A promise that resolves to the access configuration.
|
|
1121
1121
|
*/
|
|
1122
1122
|
async SettingsAccessGet(n) {
|
|
1123
|
-
return await
|
|
1123
|
+
return await Wn(this.apiClient, n);
|
|
1124
1124
|
}
|
|
1125
1125
|
/**
|
|
1126
1126
|
* Set HTTP API access over Wi-Fi configuration.
|
|
@@ -1132,7 +1132,7 @@ class Hn {
|
|
|
1132
1132
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
1133
1133
|
*/
|
|
1134
1134
|
async SettingsAccessSet(n) {
|
|
1135
|
-
const t = await
|
|
1135
|
+
const t = await $n(this.apiClient, n);
|
|
1136
1136
|
return n.mode === "key" && n.key && this.setApiKey(n.key), t;
|
|
1137
1137
|
}
|
|
1138
1138
|
/**
|
|
@@ -1143,7 +1143,7 @@ class Hn {
|
|
|
1143
1143
|
* @returns {Promise<NameInfo>} A promise that resolves to the device name.
|
|
1144
1144
|
*/
|
|
1145
1145
|
async SettingsNameGet(n) {
|
|
1146
|
-
return await
|
|
1146
|
+
return await Hn(this.apiClient, n);
|
|
1147
1147
|
}
|
|
1148
1148
|
/**
|
|
1149
1149
|
* Set device name.
|
|
@@ -1157,31 +1157,31 @@ class Hn {
|
|
|
1157
1157
|
return await zn(this.apiClient, n);
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
|
-
async function
|
|
1160
|
+
async function Kn(e, n) {
|
|
1161
1161
|
const { data: t, error: r } = await e.withTimeout((i) => e.POST("/ble/enable", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1162
1162
|
if (r)
|
|
1163
1163
|
throw r;
|
|
1164
1164
|
return t;
|
|
1165
1165
|
}
|
|
1166
|
-
async function
|
|
1166
|
+
async function Yn(e, n) {
|
|
1167
1167
|
const { data: t, error: r } = await e.withTimeout((i) => e.POST("/ble/disable", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1168
1168
|
if (r)
|
|
1169
1169
|
throw r;
|
|
1170
1170
|
return t;
|
|
1171
1171
|
}
|
|
1172
|
-
async function
|
|
1172
|
+
async function Xn(e, n) {
|
|
1173
1173
|
const { data: t, error: r } = await e.withTimeout((i) => e.DELETE("/ble/pairing", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1174
1174
|
if (r)
|
|
1175
1175
|
throw r;
|
|
1176
1176
|
return t;
|
|
1177
1177
|
}
|
|
1178
|
-
async function
|
|
1178
|
+
async function Zn(e, n) {
|
|
1179
1179
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/ble/status", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1180
1180
|
if (r)
|
|
1181
1181
|
throw r;
|
|
1182
1182
|
return t;
|
|
1183
1183
|
}
|
|
1184
|
-
class
|
|
1184
|
+
class Qn {
|
|
1185
1185
|
/**
|
|
1186
1186
|
* Enable BLE. Starts advertising.
|
|
1187
1187
|
*
|
|
@@ -1190,7 +1190,7 @@ class Zn {
|
|
|
1190
1190
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
1191
1191
|
*/
|
|
1192
1192
|
async BleEnable(n) {
|
|
1193
|
-
return await
|
|
1193
|
+
return await Kn(this.apiClient, n);
|
|
1194
1194
|
}
|
|
1195
1195
|
/**
|
|
1196
1196
|
* Disable BLE. Stops advertising.
|
|
@@ -1200,7 +1200,7 @@ class Zn {
|
|
|
1200
1200
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
1201
1201
|
*/
|
|
1202
1202
|
async BleDisable(n) {
|
|
1203
|
-
return await
|
|
1203
|
+
return await Yn(this.apiClient, n);
|
|
1204
1204
|
}
|
|
1205
1205
|
/**
|
|
1206
1206
|
* Remove pairing. Remove pairing with previous device.
|
|
@@ -1210,7 +1210,7 @@ class Zn {
|
|
|
1210
1210
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
1211
1211
|
*/
|
|
1212
1212
|
async BleUnpair(n) {
|
|
1213
|
-
return await
|
|
1213
|
+
return await Xn(this.apiClient, n);
|
|
1214
1214
|
}
|
|
1215
1215
|
/**
|
|
1216
1216
|
* Returns current BLE status.
|
|
@@ -1220,10 +1220,10 @@ class Zn {
|
|
|
1220
1220
|
* @returns {Promise<BleStatusResponse>} A promise that resolves to the BLE status.
|
|
1221
1221
|
*/
|
|
1222
1222
|
async BleStatusGet(n) {
|
|
1223
|
-
return await
|
|
1223
|
+
return await Zn(this.apiClient, n);
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
async function
|
|
1226
|
+
async function ne(e, n) {
|
|
1227
1227
|
const { key: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
1228
1228
|
(o) => e.POST("/input", {
|
|
1229
1229
|
params: {
|
|
@@ -1239,7 +1239,7 @@ async function Qn(e, n) {
|
|
|
1239
1239
|
throw i;
|
|
1240
1240
|
return r;
|
|
1241
1241
|
}
|
|
1242
|
-
class
|
|
1242
|
+
class ee {
|
|
1243
1243
|
/**
|
|
1244
1244
|
* Send input event. Send single key press event.
|
|
1245
1245
|
*
|
|
@@ -1249,40 +1249,40 @@ class ne {
|
|
|
1249
1249
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
1250
1250
|
*/
|
|
1251
1251
|
async InputSend(n) {
|
|
1252
|
-
return await
|
|
1252
|
+
return await ne(this.apiClient, n);
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
|
-
async function
|
|
1255
|
+
async function te(e, n) {
|
|
1256
1256
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/smart_home/pairing", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1257
1257
|
if (r)
|
|
1258
1258
|
throw r;
|
|
1259
1259
|
return t;
|
|
1260
1260
|
}
|
|
1261
|
-
async function
|
|
1261
|
+
async function re(e, n) {
|
|
1262
1262
|
const { data: t, error: r } = await e.withTimeout((i) => e.POST("/smart_home/pairing", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1263
1263
|
if (r)
|
|
1264
1264
|
throw r;
|
|
1265
1265
|
return t;
|
|
1266
1266
|
}
|
|
1267
|
-
async function
|
|
1267
|
+
async function ie(e, n) {
|
|
1268
1268
|
const { data: t, error: r } = await e.withTimeout((i) => e.DELETE("/smart_home/pairing", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1269
1269
|
if (r)
|
|
1270
1270
|
throw r;
|
|
1271
1271
|
return t;
|
|
1272
1272
|
}
|
|
1273
|
-
async function
|
|
1273
|
+
async function oe(e, n) {
|
|
1274
1274
|
const { data: t, error: r } = await e.withTimeout((i) => e.GET("/smart_home/switch", { signal: i }), n == null ? void 0 : n.timeout);
|
|
1275
1275
|
if (r)
|
|
1276
1276
|
throw r;
|
|
1277
1277
|
return t;
|
|
1278
1278
|
}
|
|
1279
|
-
async function
|
|
1279
|
+
async function se(e, n) {
|
|
1280
1280
|
const { timeout: t, ...r } = n, { data: i, error: o } = await e.withTimeout((s) => e.POST("/smart_home/switch", { body: r, signal: s }), t);
|
|
1281
1281
|
if (o)
|
|
1282
1282
|
throw o;
|
|
1283
1283
|
return i;
|
|
1284
1284
|
}
|
|
1285
|
-
class
|
|
1285
|
+
class ae {
|
|
1286
1286
|
/**
|
|
1287
1287
|
* Smart home commissioning status.
|
|
1288
1288
|
*
|
|
@@ -1291,7 +1291,7 @@ class se {
|
|
|
1291
1291
|
* @returns {Promise<SmartHomePairingInfo>} A promise that resolves to the pairing info.
|
|
1292
1292
|
*/
|
|
1293
1293
|
async SmartHomePairingGet(n) {
|
|
1294
|
-
return await
|
|
1294
|
+
return await te(this.apiClient, n);
|
|
1295
1295
|
}
|
|
1296
1296
|
/**
|
|
1297
1297
|
* Link device to a smart home.
|
|
@@ -1300,7 +1300,7 @@ class se {
|
|
|
1300
1300
|
* @returns {Promise<SmartHomePairingPayload>} A promise that resolves to the pairing payload.
|
|
1301
1301
|
*/
|
|
1302
1302
|
async SmartHomePair(n) {
|
|
1303
|
-
return await
|
|
1303
|
+
return await re(this.apiClient, n);
|
|
1304
1304
|
}
|
|
1305
1305
|
/**
|
|
1306
1306
|
* Erase all smart home links.
|
|
@@ -1310,7 +1310,7 @@ class se {
|
|
|
1310
1310
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
1311
1311
|
*/
|
|
1312
1312
|
async SmartHomeErase(n) {
|
|
1313
|
-
return await
|
|
1313
|
+
return await ie(this.apiClient, n);
|
|
1314
1314
|
}
|
|
1315
1315
|
/**
|
|
1316
1316
|
* Get state of emulated smart home switch.
|
|
@@ -1320,7 +1320,7 @@ class se {
|
|
|
1320
1320
|
* @returns {Promise<SmartHomeSwitchState>} A promise that resolves to the switch state.
|
|
1321
1321
|
*/
|
|
1322
1322
|
async SmartHomeSwitchStateGet(n) {
|
|
1323
|
-
return await
|
|
1323
|
+
return await oe(this.apiClient, n);
|
|
1324
1324
|
}
|
|
1325
1325
|
/**
|
|
1326
1326
|
* Set state of emulated smart home switch.
|
|
@@ -1329,7 +1329,7 @@ class se {
|
|
|
1329
1329
|
* @returns {Promise<SuccessResponse>} A promise that resolves on success.
|
|
1330
1330
|
*/
|
|
1331
1331
|
async SmartHomeSwitchStateSet(n) {
|
|
1332
|
-
return await
|
|
1332
|
+
return await se(this.apiClient, n);
|
|
1333
1333
|
}
|
|
1334
1334
|
// ALIASES for backward compatibility (Matter -> SmartHome)
|
|
1335
1335
|
/**
|
|
@@ -1351,9 +1351,9 @@ class se {
|
|
|
1351
1351
|
return await this.SmartHomeErase(n);
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
|
-
async function
|
|
1354
|
+
async function ue(e, n) {
|
|
1355
1355
|
const { application_name: t, file: r, data: i } = n, { data: o, error: s } = await e.withTimeout(
|
|
1356
|
-
(
|
|
1356
|
+
(l) => e.POST("/assets/upload", {
|
|
1357
1357
|
params: {
|
|
1358
1358
|
query: {
|
|
1359
1359
|
application_name: t,
|
|
@@ -1364,7 +1364,7 @@ async function ae(e, n) {
|
|
|
1364
1364
|
"Content-Type": "application/octet-stream"
|
|
1365
1365
|
},
|
|
1366
1366
|
body: i,
|
|
1367
|
-
signal:
|
|
1367
|
+
signal: l
|
|
1368
1368
|
}),
|
|
1369
1369
|
n.timeout
|
|
1370
1370
|
);
|
|
@@ -1372,7 +1372,7 @@ async function ae(e, n) {
|
|
|
1372
1372
|
throw s;
|
|
1373
1373
|
return o;
|
|
1374
1374
|
}
|
|
1375
|
-
async function
|
|
1375
|
+
async function le(e, n) {
|
|
1376
1376
|
const { application_name: t } = n, { data: r, error: i } = await e.withTimeout(
|
|
1377
1377
|
(o) => e.DELETE("/assets/upload", {
|
|
1378
1378
|
params: {
|
|
@@ -1388,7 +1388,7 @@ async function ue(e, n) {
|
|
|
1388
1388
|
throw i;
|
|
1389
1389
|
return r;
|
|
1390
1390
|
}
|
|
1391
|
-
class
|
|
1391
|
+
class fe {
|
|
1392
1392
|
/**
|
|
1393
1393
|
* Upload asset file with app ID. Uploads a file to a specific app's assets directory.
|
|
1394
1394
|
*
|
|
@@ -1400,7 +1400,7 @@ class le {
|
|
|
1400
1400
|
* @returns {Promise<SuccessResponse>} Result of the upload operation.
|
|
1401
1401
|
*/
|
|
1402
1402
|
async AssetsUpload(n) {
|
|
1403
|
-
return await
|
|
1403
|
+
return await ue(this.apiClient, n);
|
|
1404
1404
|
}
|
|
1405
1405
|
/**
|
|
1406
1406
|
* Delete app assets. Deletes all assets for a specific app ID.
|
|
@@ -1411,11 +1411,11 @@ class le {
|
|
|
1411
1411
|
* @returns {Promise<SuccessResponse>} Result of the delete operation.
|
|
1412
1412
|
*/
|
|
1413
1413
|
async AssetsDelete(n) {
|
|
1414
|
-
return await
|
|
1414
|
+
return await le(this.apiClient, n);
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
|
-
const
|
|
1418
|
-
function
|
|
1417
|
+
const ce = "http://10.0.4.20", de = "https://proxy.busy.app", pe = /^https?:\/\/proxy(?:\.(?:dev|test|stage))?\.busy\.app$/i;
|
|
1418
|
+
function he(e) {
|
|
1419
1419
|
const n = e.split(".");
|
|
1420
1420
|
if (n.length !== 4)
|
|
1421
1421
|
return !1;
|
|
@@ -1428,10 +1428,10 @@ function pe(e) {
|
|
|
1428
1428
|
}
|
|
1429
1429
|
return !0;
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1431
|
+
function ye(e) {
|
|
1432
1432
|
return /\.local$/i.test(e);
|
|
1433
1433
|
}
|
|
1434
|
-
class
|
|
1434
|
+
class me {
|
|
1435
1435
|
/**
|
|
1436
1436
|
* Creates an instance of BUSY Bar.
|
|
1437
1437
|
* Initializes the API client with the provided host address.
|
|
@@ -1465,37 +1465,37 @@ class ye {
|
|
|
1465
1465
|
* @type {BusyBarConfig['host']}
|
|
1466
1466
|
* @readonly
|
|
1467
1467
|
*/
|
|
1468
|
-
|
|
1468
|
+
u(this, "addr");
|
|
1469
1469
|
/**
|
|
1470
1470
|
* Current API semantic version.
|
|
1471
1471
|
* @type {ApiSemver}
|
|
1472
1472
|
*/
|
|
1473
|
-
|
|
1473
|
+
u(this, "apiSemver");
|
|
1474
1474
|
/**
|
|
1475
1475
|
* API Client instance.
|
|
1476
1476
|
*/
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1477
|
+
u(this, "apiClient");
|
|
1478
|
+
u(this, "setApiKeyFn");
|
|
1479
|
+
u(this, "setTokenFn");
|
|
1480
1480
|
/**
|
|
1481
1481
|
* Detected connection type based on auth requirements.
|
|
1482
1482
|
* - "wifi": Device requires authentication (returned 401/403).
|
|
1483
1483
|
* - "usb": Device allows access without token (returned 200).
|
|
1484
1484
|
* - "unknown": Detection failed or not yet completed.
|
|
1485
1485
|
*/
|
|
1486
|
-
|
|
1486
|
+
u(this, "connectionType", "unknown");
|
|
1487
1487
|
if (!n || !n.addr && !n.token)
|
|
1488
|
-
this.addr = fe;
|
|
1489
|
-
else if (!n.addr)
|
|
1490
1488
|
this.addr = ce;
|
|
1489
|
+
else if (!n.addr)
|
|
1490
|
+
this.addr = de;
|
|
1491
1491
|
else {
|
|
1492
1492
|
let o = n.addr.trim();
|
|
1493
|
-
if (/^https?:\/\//i.test(o) || (o = `http://${o}`),
|
|
1493
|
+
if (/^https?:\/\//i.test(o) || (o = `http://${o}`), pe.test(o) && !n.token)
|
|
1494
1494
|
throw new Error("Token is required. Please provide it.");
|
|
1495
1495
|
this.addr = o;
|
|
1496
1496
|
}
|
|
1497
1497
|
this.apiSemver = "";
|
|
1498
|
-
const { client: t, setApiKey: r, setToken: i } =
|
|
1498
|
+
const { client: t, setApiKey: r, setToken: i } = G(`${this.addr}/api/`, this.SystemVersionGet.bind(this), n == null ? void 0 : n.token, n == null ? void 0 : n.timeout);
|
|
1499
1499
|
this.apiClient = t, this.setApiKeyFn = r, this.setTokenFn = i, this.detectConnectionType();
|
|
1500
1500
|
}
|
|
1501
1501
|
/**
|
|
@@ -1504,11 +1504,11 @@ class ye {
|
|
|
1504
1504
|
*/
|
|
1505
1505
|
async detectConnectionType() {
|
|
1506
1506
|
const n = new URL(this.addr).hostname;
|
|
1507
|
-
if (!
|
|
1507
|
+
if (!he(n) && !ye(n)) {
|
|
1508
1508
|
this.connectionType = "wifi";
|
|
1509
1509
|
return;
|
|
1510
1510
|
}
|
|
1511
|
-
const t =
|
|
1511
|
+
const t = j({
|
|
1512
1512
|
baseUrl: `${this.addr}/api/`
|
|
1513
1513
|
});
|
|
1514
1514
|
try {
|
|
@@ -1538,27 +1538,27 @@ class ye {
|
|
|
1538
1538
|
this.setTokenFn(n);
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1541
|
+
function ve(e, n) {
|
|
1542
1542
|
n.forEach((t) => {
|
|
1543
1543
|
Object.getOwnPropertyNames(t.prototype).forEach((r) => {
|
|
1544
1544
|
Object.defineProperty(e.prototype, r, Object.getOwnPropertyDescriptor(t.prototype, r) || /* @__PURE__ */ Object.create(null));
|
|
1545
1545
|
});
|
|
1546
1546
|
});
|
|
1547
1547
|
}
|
|
1548
|
-
me
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1548
|
+
ve(me, [
|
|
1549
|
+
Y,
|
|
1550
|
+
sn,
|
|
1551
|
+
dn,
|
|
1552
|
+
bn,
|
|
1553
|
+
On,
|
|
1554
|
+
Cn,
|
|
1555
1555
|
jn,
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1556
|
+
Vn,
|
|
1557
|
+
Jn,
|
|
1558
|
+
Qn,
|
|
1559
|
+
ee,
|
|
1560
|
+
ae,
|
|
1561
|
+
fe
|
|
1562
1562
|
]);
|
|
1563
1563
|
var c = /* @__PURE__ */ ((e) => (e.CONNECTION_FAILED = "CONNECTION_FAILED", e.RECONNECT_FAILED = "RECONNECT_FAILED", e.CONNECTION_LOST = "CONNECTION_LOST", e.CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT", e.AUTH_FAILED = "AUTH_FAILED", e.AUTH_REFRESH_FAILED = "AUTH_REFRESH_FAILED", e.DEVICE_ERROR = "DEVICE_ERROR", e.DECODE_ERROR = "DECODE_ERROR", e.FRAME_PROCESS_ERROR = "FRAME_PROCESS_ERROR", e.STREAM_ALREADY_STARTED = "STREAM_ALREADY_STARTED", e.WORKER_INIT_FAILED = "WORKER_INIT_FAILED", e.UNKNOWN_ERROR = "UNKNOWN_ERROR", e))(c || {});
|
|
1564
1564
|
class y extends Error {
|
|
@@ -1566,8 +1566,8 @@ class y extends Error {
|
|
|
1566
1566
|
super(t), this.code = n, this.data = r, this.name = "StateStreamError";
|
|
1567
1567
|
}
|
|
1568
1568
|
}
|
|
1569
|
-
var d = /* @__PURE__ */ ((e) => (e.IDLE = "IDLE", e.STARTING = "STARTING", e.RUNNING = "RUNNING", e.STOPPED = "STOPPED", e.FAILED = "FAILED", e))(d || {}), m = /* @__PURE__ */ ((e) => (e.DISCONNECTED = "DISCONNECTED", e.CONNECTING = "CONNECTING", e.CONNECTED = "CONNECTED", e.RECONNECTING = "RECONNECTING", e))(m || {}),
|
|
1570
|
-
const L = `var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, src = { exports: {} }, indexLight = { exports: {} }, indexMinimal = {}, minimal = {}, aspromise, hasRequiredAspromise;
|
|
1569
|
+
var d = /* @__PURE__ */ ((e) => (e.IDLE = "IDLE", e.STARTING = "STARTING", e.RUNNING = "RUNNING", e.STOPPED = "STOPPED", e.FAILED = "FAILED", e))(d || {}), m = /* @__PURE__ */ ((e) => (e.DISCONNECTED = "DISCONNECTED", e.CONNECTING = "CONNECTING", e.CONNECTED = "CONNECTED", e.RECONNECTING = "RECONNECTING", e))(m || {}), v = /* @__PURE__ */ ((e) => (e.UNAUTHENTICATED = "UNAUTHENTICATED", e.AUTHENTICATING = "AUTHENTICATING", e.AUTHENTICATED = "AUTHENTICATED", e.REAUTHENTICATING = "REAUTHENTICATING", e.FAILED = "FAILED", e))(v || {}), E = /* @__PURE__ */ ((e) => (e.NONE = "NONE", e.ACTIVE = "ACTIVE", e.STALE = "STALE", e))(E || {}), _ = /* @__PURE__ */ ((e) => (e.OFF = "OFF", e.INITIALIZING = "INITIALIZING", e.READY = "READY", e.ERROR = "ERROR", e))(_ || {});
|
|
1570
|
+
const ge = 5, L = 5, x = `var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, src = { exports: {} }, indexLight = { exports: {} }, indexMinimal = {}, minimal = {}, aspromise, hasRequiredAspromise;
|
|
1571
1571
|
function requireAspromise() {
|
|
1572
1572
|
if (hasRequiredAspromise) return aspromise;
|
|
1573
1573
|
hasRequiredAspromise = 1, aspromise = u;
|
|
@@ -2133,8 +2133,8 @@ function requireWriter() {
|
|
|
2133
2133
|
var y = u.Array.prototype.set ? function(v, m, _) {
|
|
2134
2134
|
m.set(v, _);
|
|
2135
2135
|
} : function(v, m, _) {
|
|
2136
|
-
for (var
|
|
2137
|
-
m[_ +
|
|
2136
|
+
for (var A = 0; A < v.length; ++A)
|
|
2137
|
+
m[_ + A] = v[A];
|
|
2138
2138
|
};
|
|
2139
2139
|
return i.prototype.bytes = function(v) {
|
|
2140
2140
|
var m = v.length >>> 0;
|
|
@@ -3275,10 +3275,10 @@ function requireType() {
|
|
|
3275
3275
|
return this._fieldsById;
|
|
3276
3276
|
this._fieldsById = {};
|
|
3277
3277
|
for (var v = Object.keys(this.fields), m = 0; m < v.length; ++m) {
|
|
3278
|
-
var _ = this.fields[v[m]],
|
|
3279
|
-
if (this._fieldsById[
|
|
3280
|
-
throw Error("duplicate id " +
|
|
3281
|
-
this._fieldsById[
|
|
3278
|
+
var _ = this.fields[v[m]], A = _.id;
|
|
3279
|
+
if (this._fieldsById[A])
|
|
3280
|
+
throw Error("duplicate id " + A + " in " + this);
|
|
3281
|
+
this._fieldsById[A] = _;
|
|
3282
3282
|
}
|
|
3283
3283
|
return this._fieldsById;
|
|
3284
3284
|
}
|
|
@@ -3321,45 +3321,45 @@ function requireType() {
|
|
|
3321
3321
|
for (var _ = 0; _ < /* initializes */
|
|
3322
3322
|
this.fieldsArray.length; ++_)
|
|
3323
3323
|
this._fieldsArray[_].resolve();
|
|
3324
|
-
var
|
|
3324
|
+
var A = {};
|
|
3325
3325
|
for (_ = 0; _ < /* initializes */
|
|
3326
3326
|
this.oneofsArray.length; ++_)
|
|
3327
|
-
|
|
3327
|
+
A[this._oneofsArray[_].resolve().name] = {
|
|
3328
3328
|
get: t.oneOfGetter(this._oneofsArray[_].oneof),
|
|
3329
3329
|
set: t.oneOfSetter(this._oneofsArray[_].oneof)
|
|
3330
3330
|
};
|
|
3331
|
-
_ && Object.defineProperties(v.prototype,
|
|
3331
|
+
_ && Object.defineProperties(v.prototype, A);
|
|
3332
3332
|
}
|
|
3333
3333
|
}
|
|
3334
3334
|
}), y.generateConstructor = function(m) {
|
|
3335
|
-
for (var _ = t.codegen(["p"], m.name),
|
|
3336
|
-
(I = m._fieldsArray[
|
|
3335
|
+
for (var _ = t.codegen(["p"], m.name), A = 0, I; A < m.fieldsArray.length; ++A)
|
|
3336
|
+
(I = m._fieldsArray[A]).map ? _("this%s={}", t.safeProp(I.name)) : I.repeated && _("this%s=[]", t.safeProp(I.name));
|
|
3337
3337
|
return _("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]");
|
|
3338
3338
|
};
|
|
3339
3339
|
function E(v) {
|
|
3340
3340
|
return v._fieldsById = v._fieldsArray = v._oneofsArray = null, delete v.encode, delete v.decode, delete v.verify, v;
|
|
3341
3341
|
}
|
|
3342
3342
|
return y.fromJSON = function(m, _) {
|
|
3343
|
-
var
|
|
3344
|
-
|
|
3343
|
+
var A = new y(m, _.options);
|
|
3344
|
+
A.extensions = _.extensions, A.reserved = _.reserved;
|
|
3345
3345
|
for (var I = Object.keys(_.fields), C = 0; C < I.length; ++C)
|
|
3346
|
-
|
|
3346
|
+
A.add(
|
|
3347
3347
|
(typeof _.fields[I[C]].keyType < "u" ? d.fromJSON : c.fromJSON)(I[C], _.fields[I[C]])
|
|
3348
3348
|
);
|
|
3349
3349
|
if (_.oneofs)
|
|
3350
3350
|
for (I = Object.keys(_.oneofs), C = 0; C < I.length; ++C)
|
|
3351
|
-
|
|
3351
|
+
A.add(h.fromJSON(I[C], _.oneofs[I[C]]));
|
|
3352
3352
|
if (_.nested)
|
|
3353
3353
|
for (I = Object.keys(_.nested), C = 0; C < I.length; ++C) {
|
|
3354
3354
|
var j = _.nested[I[C]];
|
|
3355
|
-
|
|
3355
|
+
A.add(
|
|
3356
3356
|
// most to least likely
|
|
3357
3357
|
(j.id !== void 0 ? c.fromJSON : j.fields !== void 0 ? y.fromJSON : j.values !== void 0 ? f.fromJSON : j.methods !== void 0 ? n.fromJSON : u.fromJSON)(I[C], j)
|
|
3358
3358
|
);
|
|
3359
3359
|
}
|
|
3360
|
-
return _.extensions && _.extensions.length && (
|
|
3360
|
+
return _.extensions && _.extensions.length && (A.extensions = _.extensions), _.reserved && _.reserved.length && (A.reserved = _.reserved), _.group && (A.group = !0), _.comment && (A.comment = _.comment), _.edition && (A._edition = _.edition), A._defaultEdition = "proto3", A;
|
|
3361
3361
|
}, y.prototype.toJSON = function(m) {
|
|
3362
|
-
var _ = u.prototype.toJSON.call(this, m),
|
|
3362
|
+
var _ = u.prototype.toJSON.call(this, m), A = m ? !!m.keepComments : !1;
|
|
3363
3363
|
return t.toObject([
|
|
3364
3364
|
"edition",
|
|
3365
3365
|
this._editionToJSON(),
|
|
@@ -3380,16 +3380,16 @@ function requireType() {
|
|
|
3380
3380
|
"nested",
|
|
3381
3381
|
_ && _.nested || void 0,
|
|
3382
3382
|
"comment",
|
|
3383
|
-
|
|
3383
|
+
A ? this.comment : void 0
|
|
3384
3384
|
]);
|
|
3385
3385
|
}, y.prototype.resolveAll = function() {
|
|
3386
3386
|
if (!this._needsRecursiveResolve) return this;
|
|
3387
3387
|
u.prototype.resolveAll.call(this);
|
|
3388
3388
|
var m = this.oneofsArray;
|
|
3389
|
-
for (
|
|
3390
|
-
m[
|
|
3391
|
-
for (var _ = this.fieldsArray,
|
|
3392
|
-
_[
|
|
3389
|
+
for (A = 0; A < m.length; )
|
|
3390
|
+
m[A++].resolve();
|
|
3391
|
+
for (var _ = this.fieldsArray, A = 0; A < _.length; )
|
|
3392
|
+
_[A++].resolve();
|
|
3393
3393
|
return this;
|
|
3394
3394
|
}, y.prototype._resolveFeaturesRecursive = function(m) {
|
|
3395
3395
|
return this._needsRecursiveFeatureResolution ? (m = this._edition || m, u.prototype._resolveFeaturesRecursive.call(this, m), this.oneofsArray.forEach((_) => {
|
|
@@ -3434,9 +3434,9 @@ function requireType() {
|
|
|
3434
3434
|
}, y.prototype.create = function(m) {
|
|
3435
3435
|
return new this.ctor(m);
|
|
3436
3436
|
}, y.prototype.setup = function() {
|
|
3437
|
-
for (var m = this.fullName, _ = [],
|
|
3438
|
-
this.fieldsArray.length; ++
|
|
3439
|
-
_.push(this._fieldsArray[
|
|
3437
|
+
for (var m = this.fullName, _ = [], A = 0; A < /* initializes */
|
|
3438
|
+
this.fieldsArray.length; ++A)
|
|
3439
|
+
_.push(this._fieldsArray[A].resolve().resolvedType);
|
|
3440
3440
|
this.encode = l(this)({
|
|
3441
3441
|
Writer: i,
|
|
3442
3442
|
types: _,
|
|
@@ -3476,8 +3476,8 @@ function requireType() {
|
|
|
3476
3476
|
}, y.prototype.toObject = function(m, _) {
|
|
3477
3477
|
return this.setup().toObject(m, _);
|
|
3478
3478
|
}, y.d = function(m) {
|
|
3479
|
-
return function(
|
|
3480
|
-
t.decorateType(
|
|
3479
|
+
return function(A) {
|
|
3480
|
+
t.decorateType(A, m);
|
|
3481
3481
|
};
|
|
3482
3482
|
}, type;
|
|
3483
3483
|
}
|
|
@@ -3502,67 +3502,67 @@ function requireRoot() {
|
|
|
3502
3502
|
if (!y)
|
|
3503
3503
|
return d.asPromise(a, E, o, p);
|
|
3504
3504
|
var v = y === t;
|
|
3505
|
-
function m(
|
|
3505
|
+
function m(B, L) {
|
|
3506
3506
|
if (y) {
|
|
3507
3507
|
if (v)
|
|
3508
|
-
throw
|
|
3509
|
-
|
|
3508
|
+
throw B;
|
|
3509
|
+
L && L.resolveAll();
|
|
3510
3510
|
var S = y;
|
|
3511
|
-
y = null, S(
|
|
3511
|
+
y = null, S(B, L);
|
|
3512
3512
|
}
|
|
3513
3513
|
}
|
|
3514
|
-
function _(
|
|
3515
|
-
var
|
|
3516
|
-
if (
|
|
3517
|
-
var S =
|
|
3514
|
+
function _(B) {
|
|
3515
|
+
var L = B.lastIndexOf("google/protobuf/");
|
|
3516
|
+
if (L > -1) {
|
|
3517
|
+
var S = B.substring(L);
|
|
3518
3518
|
if (S in r) return S;
|
|
3519
3519
|
}
|
|
3520
3520
|
return null;
|
|
3521
3521
|
}
|
|
3522
|
-
function
|
|
3522
|
+
function A(B, L) {
|
|
3523
3523
|
try {
|
|
3524
|
-
if (d.isString(
|
|
3525
|
-
E.setOptions(
|
|
3524
|
+
if (d.isString(L) && L.charAt(0) === "{" && (L = JSON.parse(L)), !d.isString(L))
|
|
3525
|
+
E.setOptions(L.options).addJSON(L.nested);
|
|
3526
3526
|
else {
|
|
3527
|
-
e.filename =
|
|
3528
|
-
var S = e(
|
|
3527
|
+
e.filename = B;
|
|
3528
|
+
var S = e(L, E, p), J, M = 0;
|
|
3529
3529
|
if (S.imports)
|
|
3530
|
-
for (;
|
|
3531
|
-
(J = _(S.imports[
|
|
3530
|
+
for (; M < S.imports.length; ++M)
|
|
3531
|
+
(J = _(S.imports[M]) || E.resolvePath(B, S.imports[M])) && I(J);
|
|
3532
3532
|
if (S.weakImports)
|
|
3533
|
-
for (
|
|
3534
|
-
(J = _(S.weakImports[
|
|
3533
|
+
for (M = 0; M < S.weakImports.length; ++M)
|
|
3534
|
+
(J = _(S.weakImports[M]) || E.resolvePath(B, S.weakImports[M])) && I(J, !0);
|
|
3535
3535
|
}
|
|
3536
3536
|
} catch (T) {
|
|
3537
3537
|
m(T);
|
|
3538
3538
|
}
|
|
3539
3539
|
!v && !C && m(null, E);
|
|
3540
3540
|
}
|
|
3541
|
-
function I(
|
|
3542
|
-
if (
|
|
3543
|
-
if (E.files.push(
|
|
3544
|
-
v ?
|
|
3545
|
-
--C,
|
|
3541
|
+
function I(B, L) {
|
|
3542
|
+
if (B = _(B) || B, !(E.files.indexOf(B) > -1)) {
|
|
3543
|
+
if (E.files.push(B), B in r) {
|
|
3544
|
+
v ? A(B, r[B]) : (++C, setTimeout(function() {
|
|
3545
|
+
--C, A(B, r[B]);
|
|
3546
3546
|
}));
|
|
3547
3547
|
return;
|
|
3548
3548
|
}
|
|
3549
3549
|
if (v) {
|
|
3550
3550
|
var S;
|
|
3551
3551
|
try {
|
|
3552
|
-
S = d.fs.readFileSync(
|
|
3552
|
+
S = d.fs.readFileSync(B).toString("utf8");
|
|
3553
3553
|
} catch (J) {
|
|
3554
|
-
|
|
3554
|
+
L || m(J);
|
|
3555
3555
|
return;
|
|
3556
3556
|
}
|
|
3557
|
-
|
|
3557
|
+
A(B, S);
|
|
3558
3558
|
} else
|
|
3559
|
-
++C, E.fetch(
|
|
3559
|
+
++C, E.fetch(B, function(J, M) {
|
|
3560
3560
|
if (--C, !!y) {
|
|
3561
3561
|
if (J) {
|
|
3562
|
-
|
|
3562
|
+
L ? C || m(null, E) : m(J);
|
|
3563
3563
|
return;
|
|
3564
3564
|
}
|
|
3565
|
-
|
|
3565
|
+
A(B, M);
|
|
3566
3566
|
}
|
|
3567
3567
|
});
|
|
3568
3568
|
}
|
|
@@ -4306,93 +4306,93 @@ function requireTokenize() {
|
|
|
4306
4306
|
function l(s, a) {
|
|
4307
4307
|
s = s.toString();
|
|
4308
4308
|
var o = 0, p = s.length, y = 1, E = 0, v = {}, m = [], _ = null;
|
|
4309
|
-
function
|
|
4309
|
+
function A(k) {
|
|
4310
4310
|
return Error("illegal " + k + " (line " + y + ")");
|
|
4311
4311
|
}
|
|
4312
4312
|
function I() {
|
|
4313
4313
|
var k = _ === "'" ? h : f;
|
|
4314
4314
|
k.lastIndex = o - 1;
|
|
4315
|
-
var
|
|
4316
|
-
if (!
|
|
4317
|
-
throw
|
|
4318
|
-
return o = k.lastIndex, S(_), _ = null, t(
|
|
4315
|
+
var P = k.exec(s);
|
|
4316
|
+
if (!P)
|
|
4317
|
+
throw A("string");
|
|
4318
|
+
return o = k.lastIndex, S(_), _ = null, t(P[1]);
|
|
4319
4319
|
}
|
|
4320
4320
|
function C(k) {
|
|
4321
4321
|
return s.charAt(k);
|
|
4322
4322
|
}
|
|
4323
|
-
function j(k,
|
|
4323
|
+
function j(k, P, F) {
|
|
4324
4324
|
var W = {
|
|
4325
4325
|
type: s.charAt(k++),
|
|
4326
4326
|
lineEmpty: !1,
|
|
4327
4327
|
leading: F
|
|
4328
4328
|
}, H;
|
|
4329
4329
|
a ? H = 2 : H = 3;
|
|
4330
|
-
var
|
|
4330
|
+
var D = k - H, $;
|
|
4331
4331
|
do
|
|
4332
|
-
if (--
|
|
4332
|
+
if (--D < 0 || ($ = s.charAt(D)) === \`
|
|
4333
4333
|
\`) {
|
|
4334
4334
|
W.lineEmpty = !0;
|
|
4335
4335
|
break;
|
|
4336
4336
|
}
|
|
4337
4337
|
while ($ === " " || $ === " ");
|
|
4338
|
-
for (var X = s.substring(k,
|
|
4338
|
+
for (var X = s.substring(k, P).split(n), z = 0; z < X.length; ++z)
|
|
4339
4339
|
X[z] = X[z].replace(a ? d : c, "").trim();
|
|
4340
4340
|
W.text = X.join(\`
|
|
4341
4341
|
\`).trim(), v[y] = W, E = y;
|
|
4342
4342
|
}
|
|
4343
4343
|
function K(k) {
|
|
4344
|
-
var
|
|
4344
|
+
var P = B(k), F = s.substring(k, P), W = /^\\s*\\/\\//.test(F);
|
|
4345
4345
|
return W;
|
|
4346
4346
|
}
|
|
4347
|
-
function
|
|
4348
|
-
for (var
|
|
4347
|
+
function B(k) {
|
|
4348
|
+
for (var P = k; P < p && C(P) !== \`
|
|
4349
4349
|
\`; )
|
|
4350
|
-
|
|
4351
|
-
return
|
|
4350
|
+
P++;
|
|
4351
|
+
return P;
|
|
4352
4352
|
}
|
|
4353
|
-
function
|
|
4353
|
+
function L() {
|
|
4354
4354
|
if (m.length > 0)
|
|
4355
4355
|
return m.shift();
|
|
4356
4356
|
if (_)
|
|
4357
4357
|
return I();
|
|
4358
|
-
var k,
|
|
4358
|
+
var k, P, F, W, H, D = o === 0;
|
|
4359
4359
|
do {
|
|
4360
4360
|
if (o === p)
|
|
4361
4361
|
return null;
|
|
4362
4362
|
for (k = !1; e.test(F = C(o)); )
|
|
4363
4363
|
if (F === \`
|
|
4364
|
-
\` && (
|
|
4364
|
+
\` && (D = !0, ++y), ++o === p)
|
|
4365
4365
|
return null;
|
|
4366
4366
|
if (C(o) === "/") {
|
|
4367
4367
|
if (++o === p)
|
|
4368
|
-
throw
|
|
4368
|
+
throw A("comment");
|
|
4369
4369
|
if (C(o) === "/")
|
|
4370
4370
|
if (a) {
|
|
4371
4371
|
if (W = o, H = !1, K(o - 1)) {
|
|
4372
4372
|
H = !0;
|
|
4373
4373
|
do
|
|
4374
|
-
if (o =
|
|
4374
|
+
if (o = B(o), o === p || (o++, !D))
|
|
4375
4375
|
break;
|
|
4376
4376
|
while (K(o));
|
|
4377
4377
|
} else
|
|
4378
|
-
o = Math.min(p,
|
|
4379
|
-
H && (j(W, o,
|
|
4378
|
+
o = Math.min(p, B(o) + 1);
|
|
4379
|
+
H && (j(W, o, D), D = !0), y++, k = !0;
|
|
4380
4380
|
} else {
|
|
4381
4381
|
for (H = C(W = o + 1) === "/"; C(++o) !== \`
|
|
4382
4382
|
\`; )
|
|
4383
4383
|
if (o === p)
|
|
4384
4384
|
return null;
|
|
4385
|
-
++o, H && (j(W, o - 1,
|
|
4385
|
+
++o, H && (j(W, o - 1, D), D = !0), ++y, k = !0;
|
|
4386
4386
|
}
|
|
4387
4387
|
else if ((F = C(o)) === "*") {
|
|
4388
4388
|
W = o + 1, H = a || C(W) === "*";
|
|
4389
4389
|
do {
|
|
4390
4390
|
if (F === \`
|
|
4391
4391
|
\` && ++y, ++o === p)
|
|
4392
|
-
throw
|
|
4393
|
-
|
|
4394
|
-
} while (
|
|
4395
|
-
++o, H && (j(W, o - 2,
|
|
4392
|
+
throw A("comment");
|
|
4393
|
+
P = F, F = C(o);
|
|
4394
|
+
} while (P !== "*" || F !== "/");
|
|
4395
|
+
++o, H && (j(W, o - 2, D), D = !0), k = !0;
|
|
4396
4396
|
} else
|
|
4397
4397
|
return "/";
|
|
4398
4398
|
}
|
|
@@ -4411,30 +4411,30 @@ function requireTokenize() {
|
|
|
4411
4411
|
}
|
|
4412
4412
|
function J() {
|
|
4413
4413
|
if (!m.length) {
|
|
4414
|
-
var k =
|
|
4414
|
+
var k = L();
|
|
4415
4415
|
if (k === null)
|
|
4416
4416
|
return null;
|
|
4417
4417
|
S(k);
|
|
4418
4418
|
}
|
|
4419
4419
|
return m[0];
|
|
4420
4420
|
}
|
|
4421
|
-
function
|
|
4421
|
+
function M(k, P) {
|
|
4422
4422
|
var F = J(), W = F === k;
|
|
4423
4423
|
if (W)
|
|
4424
|
-
return
|
|
4425
|
-
if (!
|
|
4426
|
-
throw
|
|
4424
|
+
return L(), !0;
|
|
4425
|
+
if (!P)
|
|
4426
|
+
throw A("token '" + F + "', '" + k + "' expected");
|
|
4427
4427
|
return !1;
|
|
4428
4428
|
}
|
|
4429
4429
|
function T(k) {
|
|
4430
|
-
var
|
|
4431
|
-
return k === void 0 ? (F = v[y - 1], delete v[y - 1], F && (a || F.type === "*" || F.lineEmpty) && (
|
|
4430
|
+
var P = null, F;
|
|
4431
|
+
return k === void 0 ? (F = v[y - 1], delete v[y - 1], F && (a || F.type === "*" || F.lineEmpty) && (P = F.leading ? F.text : null)) : (E < k && J(), F = v[k], delete v[k], F && !F.lineEmpty && (a || F.type === "/") && (P = F.leading ? null : F.text)), P;
|
|
4432
4432
|
}
|
|
4433
4433
|
return Object.defineProperty({
|
|
4434
|
-
next:
|
|
4434
|
+
next: L,
|
|
4435
4435
|
peek: J,
|
|
4436
4436
|
push: S,
|
|
4437
|
-
skip:
|
|
4437
|
+
skip: M,
|
|
4438
4438
|
cmnt: T
|
|
4439
4439
|
}, "line", {
|
|
4440
4440
|
get: function() {
|
|
@@ -4448,33 +4448,33 @@ var parse_1, hasRequiredParse;
|
|
|
4448
4448
|
function requireParse() {
|
|
4449
4449
|
if (hasRequiredParse) return parse_1;
|
|
4450
4450
|
hasRequiredParse = 1, parse_1 = I, I.filename = null, I.defaults = { keepCase: !1 };
|
|
4451
|
-
var u = requireTokenize(), f = requireRoot(), h = requireType(), c = requireField(), d = requireMapfield(), n = requireOneof(), e = require_enum(), r = requireService(), i = requireMethod(), t = requireObject(), l = requireTypes(), s = requireUtil(), a = /^[1-9][0-9]*$/, o = /^-?[1-9][0-9]*$/, p = /^0[x][0-9a-fA-F]+$/, y = /^-?0[x][0-9a-fA-F]+$/, E = /^0[0-7]+$/, v = /^-?0[0-7]+$/, m = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, _ = /^[a-zA-Z_][a-zA-Z_0-9]*$/,
|
|
4451
|
+
var u = requireTokenize(), f = requireRoot(), h = requireType(), c = requireField(), d = requireMapfield(), n = requireOneof(), e = require_enum(), r = requireService(), i = requireMethod(), t = requireObject(), l = requireTypes(), s = requireUtil(), a = /^[1-9][0-9]*$/, o = /^-?[1-9][0-9]*$/, p = /^0[x][0-9a-fA-F]+$/, y = /^-?0[x][0-9a-fA-F]+$/, E = /^0[0-7]+$/, v = /^-?0[0-7]+$/, m = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, _ = /^[a-zA-Z_][a-zA-Z_0-9]*$/, A = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
4452
4452
|
function I(C, j, K) {
|
|
4453
4453
|
j instanceof f || (K = j, j = new f()), K || (K = I.defaults);
|
|
4454
|
-
var
|
|
4455
|
-
return
|
|
4454
|
+
var B = K.preferTrailingComment || !1, L = u(C, K.alternateCommentMode || !1), S = L.next, J = L.push, M = L.peek, T = L.skip, k = L.cmnt, P = !0, F, W, H, D = "proto2", $ = j, X = [], z = {}, ae = K.keepCase ? function(R) {
|
|
4455
|
+
return R;
|
|
4456
4456
|
} : s.camelCase;
|
|
4457
4457
|
function he() {
|
|
4458
|
-
X.forEach((
|
|
4459
|
-
|
|
4460
|
-
|
|
4458
|
+
X.forEach((R) => {
|
|
4459
|
+
R._edition = D, Object.keys(z).forEach((g) => {
|
|
4460
|
+
R.getOption(g) === void 0 && R.setOption(g, z[g], !0);
|
|
4461
4461
|
});
|
|
4462
4462
|
});
|
|
4463
4463
|
}
|
|
4464
|
-
function N(
|
|
4465
|
-
var
|
|
4466
|
-
return
|
|
4464
|
+
function N(R, g, O) {
|
|
4465
|
+
var b = I.filename;
|
|
4466
|
+
return O || (I.filename = null), Error("illegal " + (g || "token") + " '" + R + "' (" + (b ? b + ", " : "") + "line " + L.line + ")");
|
|
4467
4467
|
}
|
|
4468
4468
|
function ee() {
|
|
4469
|
-
var
|
|
4469
|
+
var R = [], g;
|
|
4470
4470
|
do {
|
|
4471
4471
|
if ((g = S()) !== '"' && g !== "'")
|
|
4472
4472
|
throw N(g);
|
|
4473
|
-
|
|
4473
|
+
R.push(S()), T(g), g = M();
|
|
4474
4474
|
} while (g === '"' || g === "'");
|
|
4475
|
-
return
|
|
4475
|
+
return R.join("");
|
|
4476
4476
|
}
|
|
4477
|
-
function ue(
|
|
4477
|
+
function ue(R) {
|
|
4478
4478
|
var g = S();
|
|
4479
4479
|
switch (g) {
|
|
4480
4480
|
case "'":
|
|
@@ -4494,24 +4494,24 @@ function requireParse() {
|
|
|
4494
4494
|
!0
|
|
4495
4495
|
);
|
|
4496
4496
|
} catch {
|
|
4497
|
-
if (
|
|
4497
|
+
if (A.test(g))
|
|
4498
4498
|
return g;
|
|
4499
4499
|
throw N(g, "value");
|
|
4500
4500
|
}
|
|
4501
4501
|
}
|
|
4502
|
-
function re(
|
|
4503
|
-
var
|
|
4502
|
+
function re(R, g) {
|
|
4503
|
+
var O, b;
|
|
4504
4504
|
do
|
|
4505
|
-
if (g && ((
|
|
4505
|
+
if (g && ((O = M()) === '"' || O === "'")) {
|
|
4506
4506
|
var w = ee();
|
|
4507
|
-
if (
|
|
4507
|
+
if (R.push(w), D >= 2023)
|
|
4508
4508
|
throw N(w, "id");
|
|
4509
4509
|
} else
|
|
4510
4510
|
try {
|
|
4511
|
-
|
|
4511
|
+
R.push([b = te(S()), T("to", !0) ? te(S()) : b]);
|
|
4512
4512
|
} catch (x) {
|
|
4513
|
-
if (g &&
|
|
4514
|
-
|
|
4513
|
+
if (g && A.test(O) && D >= 2023)
|
|
4514
|
+
R.push(O);
|
|
4515
4515
|
else
|
|
4516
4516
|
throw x;
|
|
4517
4517
|
}
|
|
@@ -4532,13 +4532,13 @@ function requireParse() {
|
|
|
4532
4532
|
}
|
|
4533
4533
|
);
|
|
4534
4534
|
}
|
|
4535
|
-
function pe(
|
|
4536
|
-
var
|
|
4537
|
-
switch (
|
|
4535
|
+
function pe(R, g) {
|
|
4536
|
+
var O = 1;
|
|
4537
|
+
switch (R.charAt(0) === "-" && (O = -1, R = R.substring(1)), R) {
|
|
4538
4538
|
case "inf":
|
|
4539
4539
|
case "INF":
|
|
4540
4540
|
case "Inf":
|
|
4541
|
-
return
|
|
4541
|
+
return O * (1 / 0);
|
|
4542
4542
|
case "nan":
|
|
4543
4543
|
case "NAN":
|
|
4544
4544
|
case "Nan":
|
|
@@ -4547,18 +4547,18 @@ function requireParse() {
|
|
|
4547
4547
|
case "0":
|
|
4548
4548
|
return 0;
|
|
4549
4549
|
}
|
|
4550
|
-
if (a.test(
|
|
4551
|
-
return
|
|
4552
|
-
if (p.test(
|
|
4553
|
-
return
|
|
4554
|
-
if (E.test(
|
|
4555
|
-
return
|
|
4556
|
-
if (m.test(
|
|
4557
|
-
return
|
|
4558
|
-
throw N(
|
|
4559
|
-
}
|
|
4560
|
-
function te(
|
|
4561
|
-
switch (
|
|
4550
|
+
if (a.test(R))
|
|
4551
|
+
return O * parseInt(R, 10);
|
|
4552
|
+
if (p.test(R))
|
|
4553
|
+
return O * parseInt(R, 16);
|
|
4554
|
+
if (E.test(R))
|
|
4555
|
+
return O * parseInt(R, 8);
|
|
4556
|
+
if (m.test(R))
|
|
4557
|
+
return O * parseFloat(R);
|
|
4558
|
+
throw N(R, "number", g);
|
|
4559
|
+
}
|
|
4560
|
+
function te(R, g) {
|
|
4561
|
+
switch (R) {
|
|
4562
4562
|
case "max":
|
|
4563
4563
|
case "MAX":
|
|
4564
4564
|
case "Max":
|
|
@@ -4566,28 +4566,28 @@ function requireParse() {
|
|
|
4566
4566
|
case "0":
|
|
4567
4567
|
return 0;
|
|
4568
4568
|
}
|
|
4569
|
-
if (!g &&
|
|
4570
|
-
throw N(
|
|
4571
|
-
if (o.test(
|
|
4572
|
-
return parseInt(
|
|
4573
|
-
if (y.test(
|
|
4574
|
-
return parseInt(
|
|
4575
|
-
if (v.test(
|
|
4576
|
-
return parseInt(
|
|
4577
|
-
throw N(
|
|
4569
|
+
if (!g && R.charAt(0) === "-")
|
|
4570
|
+
throw N(R, "id");
|
|
4571
|
+
if (o.test(R))
|
|
4572
|
+
return parseInt(R, 10);
|
|
4573
|
+
if (y.test(R))
|
|
4574
|
+
return parseInt(R, 16);
|
|
4575
|
+
if (v.test(R))
|
|
4576
|
+
return parseInt(R, 8);
|
|
4577
|
+
throw N(R, "id");
|
|
4578
4578
|
}
|
|
4579
4579
|
function ye() {
|
|
4580
4580
|
if (F !== void 0)
|
|
4581
4581
|
throw N("package");
|
|
4582
|
-
if (F = S(), !
|
|
4582
|
+
if (F = S(), !A.test(F))
|
|
4583
4583
|
throw N(F, "name");
|
|
4584
4584
|
$ = $.define(F), T(";");
|
|
4585
4585
|
}
|
|
4586
4586
|
function me() {
|
|
4587
|
-
var
|
|
4588
|
-
switch (
|
|
4587
|
+
var R = M(), g;
|
|
4588
|
+
switch (R) {
|
|
4589
4589
|
case "option":
|
|
4590
|
-
if (
|
|
4590
|
+
if (D < "2024")
|
|
4591
4591
|
throw N("option");
|
|
4592
4592
|
S(), ee(), T(";");
|
|
4593
4593
|
return;
|
|
@@ -4601,185 +4601,185 @@ function requireParse() {
|
|
|
4601
4601
|
g = W || (W = []);
|
|
4602
4602
|
break;
|
|
4603
4603
|
}
|
|
4604
|
-
|
|
4604
|
+
R = ee(), T(";"), g.push(R);
|
|
4605
4605
|
}
|
|
4606
4606
|
function ve() {
|
|
4607
|
-
if (T("="),
|
|
4608
|
-
throw N(
|
|
4607
|
+
if (T("="), D = ee(), D < 2023)
|
|
4608
|
+
throw N(D, "syntax");
|
|
4609
4609
|
T(";");
|
|
4610
4610
|
}
|
|
4611
4611
|
function ge() {
|
|
4612
|
-
if (T("="),
|
|
4613
|
-
throw N(
|
|
4612
|
+
if (T("="), D = ee(), !["2023", "2024"].includes(D))
|
|
4613
|
+
throw N(D, "edition");
|
|
4614
4614
|
T(";");
|
|
4615
4615
|
}
|
|
4616
|
-
function ie(
|
|
4616
|
+
function ie(R, g) {
|
|
4617
4617
|
switch (g) {
|
|
4618
4618
|
case "option":
|
|
4619
|
-
return Q(
|
|
4619
|
+
return Q(R, g), T(";"), !0;
|
|
4620
4620
|
case "message":
|
|
4621
|
-
return ne(
|
|
4621
|
+
return ne(R, g), !0;
|
|
4622
4622
|
case "enum":
|
|
4623
|
-
return de(
|
|
4623
|
+
return de(R, g), !0;
|
|
4624
4624
|
case "export":
|
|
4625
4625
|
case "local":
|
|
4626
|
-
return
|
|
4626
|
+
return D < "2024" || (g = S(), g === "export" || g === "local") || g !== "message" && g !== "enum" ? !1 : ie(R, g);
|
|
4627
4627
|
case "service":
|
|
4628
|
-
return
|
|
4628
|
+
return be(R, g), !0;
|
|
4629
4629
|
case "extend":
|
|
4630
|
-
return Se(
|
|
4630
|
+
return Se(R, g), !0;
|
|
4631
4631
|
}
|
|
4632
4632
|
return !1;
|
|
4633
4633
|
}
|
|
4634
|
-
function Z(
|
|
4635
|
-
var
|
|
4636
|
-
if (
|
|
4634
|
+
function Z(R, g, O) {
|
|
4635
|
+
var b = L.line;
|
|
4636
|
+
if (R && (typeof R.comment != "string" && (R.comment = k()), R.filename = I.filename), T("{", !0)) {
|
|
4637
4637
|
for (var w; (w = S()) !== "}"; )
|
|
4638
4638
|
g(w);
|
|
4639
4639
|
T(";", !0);
|
|
4640
4640
|
} else
|
|
4641
|
-
|
|
4641
|
+
O && O(), T(";"), R && (typeof R.comment != "string" || B) && (R.comment = k(b) || R.comment);
|
|
4642
4642
|
}
|
|
4643
|
-
function ne(
|
|
4643
|
+
function ne(R, g) {
|
|
4644
4644
|
if (!_.test(g = S()))
|
|
4645
4645
|
throw N(g, "type name");
|
|
4646
|
-
var
|
|
4647
|
-
Z(
|
|
4648
|
-
if (!ie(
|
|
4646
|
+
var O = new h(g);
|
|
4647
|
+
Z(O, function(w) {
|
|
4648
|
+
if (!ie(O, w))
|
|
4649
4649
|
switch (w) {
|
|
4650
4650
|
case "map":
|
|
4651
|
-
Ee(
|
|
4651
|
+
Ee(O);
|
|
4652
4652
|
break;
|
|
4653
4653
|
case "required":
|
|
4654
|
-
if (
|
|
4654
|
+
if (D !== "proto2")
|
|
4655
4655
|
throw N(w);
|
|
4656
4656
|
/* eslint-disable no-fallthrough */
|
|
4657
4657
|
case "repeated":
|
|
4658
|
-
Y(
|
|
4658
|
+
Y(O, w);
|
|
4659
4659
|
break;
|
|
4660
4660
|
case "optional":
|
|
4661
|
-
if (
|
|
4662
|
-
Y(
|
|
4661
|
+
if (D === "proto3")
|
|
4662
|
+
Y(O, "proto3_optional");
|
|
4663
4663
|
else {
|
|
4664
|
-
if (
|
|
4664
|
+
if (D !== "proto2")
|
|
4665
4665
|
throw N(w);
|
|
4666
|
-
Y(
|
|
4666
|
+
Y(O, "optional");
|
|
4667
4667
|
}
|
|
4668
4668
|
break;
|
|
4669
4669
|
case "oneof":
|
|
4670
|
-
|
|
4670
|
+
Re(O, w);
|
|
4671
4671
|
break;
|
|
4672
4672
|
case "extensions":
|
|
4673
|
-
re(
|
|
4673
|
+
re(O.extensions || (O.extensions = []));
|
|
4674
4674
|
break;
|
|
4675
4675
|
case "reserved":
|
|
4676
|
-
re(
|
|
4676
|
+
re(O.reserved || (O.reserved = []), !0);
|
|
4677
4677
|
break;
|
|
4678
4678
|
default:
|
|
4679
|
-
if (
|
|
4679
|
+
if (D === "proto2" || !A.test(w))
|
|
4680
4680
|
throw N(w);
|
|
4681
|
-
J(w), Y(
|
|
4681
|
+
J(w), Y(O, "optional");
|
|
4682
4682
|
break;
|
|
4683
4683
|
}
|
|
4684
|
-
}),
|
|
4684
|
+
}), R.add(O), R === $ && X.push(O);
|
|
4685
4685
|
}
|
|
4686
|
-
function Y(
|
|
4687
|
-
var
|
|
4688
|
-
if (
|
|
4689
|
-
_e(
|
|
4686
|
+
function Y(R, g, O) {
|
|
4687
|
+
var b = S();
|
|
4688
|
+
if (b === "group") {
|
|
4689
|
+
_e(R, g);
|
|
4690
4690
|
return;
|
|
4691
4691
|
}
|
|
4692
|
-
for (;
|
|
4693
|
-
|
|
4694
|
-
if (!
|
|
4695
|
-
throw N(
|
|
4692
|
+
for (; b.endsWith(".") || M().startsWith("."); )
|
|
4693
|
+
b += S();
|
|
4694
|
+
if (!A.test(b))
|
|
4695
|
+
throw N(b, "type");
|
|
4696
4696
|
var w = S();
|
|
4697
4697
|
if (!_.test(w))
|
|
4698
4698
|
throw N(w, "name");
|
|
4699
4699
|
w = ae(w), T("=");
|
|
4700
|
-
var q = new c(w, te(S()),
|
|
4701
|
-
if (Z(q, function(
|
|
4702
|
-
if (
|
|
4703
|
-
Q(q,
|
|
4700
|
+
var q = new c(w, te(S()), b, g, O);
|
|
4701
|
+
if (Z(q, function(U) {
|
|
4702
|
+
if (U === "option")
|
|
4703
|
+
Q(q, U), T(";");
|
|
4704
4704
|
else
|
|
4705
|
-
throw N(
|
|
4705
|
+
throw N(U);
|
|
4706
4706
|
}, function() {
|
|
4707
4707
|
se(q);
|
|
4708
4708
|
}), g === "proto3_optional") {
|
|
4709
4709
|
var x = new n("_" + w);
|
|
4710
|
-
q.setOption("proto3_optional", !0), x.add(q),
|
|
4710
|
+
q.setOption("proto3_optional", !0), x.add(q), R.add(x);
|
|
4711
4711
|
} else
|
|
4712
|
-
|
|
4713
|
-
|
|
4712
|
+
R.add(q);
|
|
4713
|
+
R === $ && X.push(q);
|
|
4714
4714
|
}
|
|
4715
|
-
function _e(
|
|
4716
|
-
if (
|
|
4715
|
+
function _e(R, g) {
|
|
4716
|
+
if (D >= 2023)
|
|
4717
4717
|
throw N("group");
|
|
4718
|
-
var
|
|
4719
|
-
if (!_.test(
|
|
4720
|
-
throw N(
|
|
4721
|
-
var
|
|
4722
|
-
|
|
4723
|
-
var w = te(S()), q = new h(
|
|
4718
|
+
var O = S();
|
|
4719
|
+
if (!_.test(O))
|
|
4720
|
+
throw N(O, "name");
|
|
4721
|
+
var b = s.lcFirst(O);
|
|
4722
|
+
O === b && (O = s.ucFirst(O)), T("=");
|
|
4723
|
+
var w = te(S()), q = new h(O);
|
|
4724
4724
|
q.group = !0;
|
|
4725
|
-
var x = new c(
|
|
4726
|
-
x.filename = I.filename, Z(q, function(
|
|
4727
|
-
switch (
|
|
4725
|
+
var x = new c(b, w, O, g);
|
|
4726
|
+
x.filename = I.filename, Z(q, function(U) {
|
|
4727
|
+
switch (U) {
|
|
4728
4728
|
case "option":
|
|
4729
|
-
Q(q,
|
|
4729
|
+
Q(q, U), T(";");
|
|
4730
4730
|
break;
|
|
4731
4731
|
case "required":
|
|
4732
4732
|
case "repeated":
|
|
4733
|
-
Y(q,
|
|
4733
|
+
Y(q, U);
|
|
4734
4734
|
break;
|
|
4735
4735
|
case "optional":
|
|
4736
|
-
|
|
4736
|
+
D === "proto3" ? Y(q, "proto3_optional") : Y(q, "optional");
|
|
4737
4737
|
break;
|
|
4738
4738
|
case "message":
|
|
4739
|
-
ne(q,
|
|
4739
|
+
ne(q, U);
|
|
4740
4740
|
break;
|
|
4741
4741
|
case "enum":
|
|
4742
|
-
de(q,
|
|
4742
|
+
de(q, U);
|
|
4743
4743
|
break;
|
|
4744
4744
|
case "reserved":
|
|
4745
4745
|
re(q.reserved || (q.reserved = []), !0);
|
|
4746
4746
|
break;
|
|
4747
4747
|
case "export":
|
|
4748
4748
|
case "local":
|
|
4749
|
-
if (
|
|
4750
|
-
throw N(
|
|
4751
|
-
switch (
|
|
4749
|
+
if (D < "2024")
|
|
4750
|
+
throw N(U);
|
|
4751
|
+
switch (U = S(), U) {
|
|
4752
4752
|
case "message":
|
|
4753
|
-
ne(q,
|
|
4753
|
+
ne(q, U);
|
|
4754
4754
|
break;
|
|
4755
4755
|
case "enum":
|
|
4756
|
-
ne(q,
|
|
4756
|
+
ne(q, U);
|
|
4757
4757
|
break;
|
|
4758
4758
|
default:
|
|
4759
|
-
throw N(
|
|
4759
|
+
throw N(U);
|
|
4760
4760
|
}
|
|
4761
4761
|
break;
|
|
4762
4762
|
/* istanbul ignore next */
|
|
4763
4763
|
default:
|
|
4764
|
-
throw N(
|
|
4764
|
+
throw N(U);
|
|
4765
4765
|
}
|
|
4766
|
-
}),
|
|
4766
|
+
}), R.add(q).add(x);
|
|
4767
4767
|
}
|
|
4768
|
-
function Ee(
|
|
4768
|
+
function Ee(R) {
|
|
4769
4769
|
T("<");
|
|
4770
4770
|
var g = S();
|
|
4771
4771
|
if (l.mapKey[g] === void 0)
|
|
4772
4772
|
throw N(g, "type");
|
|
4773
4773
|
T(",");
|
|
4774
|
-
var
|
|
4775
|
-
if (!
|
|
4776
|
-
throw N(
|
|
4774
|
+
var O = S();
|
|
4775
|
+
if (!A.test(O))
|
|
4776
|
+
throw N(O, "type");
|
|
4777
4777
|
T(">");
|
|
4778
|
-
var
|
|
4779
|
-
if (!_.test(
|
|
4780
|
-
throw N(
|
|
4778
|
+
var b = S();
|
|
4779
|
+
if (!_.test(b))
|
|
4780
|
+
throw N(b, "name");
|
|
4781
4781
|
T("=");
|
|
4782
|
-
var w = new d(ae(
|
|
4782
|
+
var w = new d(ae(b), te(S()), g, O);
|
|
4783
4783
|
Z(w, function(x) {
|
|
4784
4784
|
if (x === "option")
|
|
4785
4785
|
Q(w, x), T(";");
|
|
@@ -4787,56 +4787,56 @@ function requireParse() {
|
|
|
4787
4787
|
throw N(x);
|
|
4788
4788
|
}, function() {
|
|
4789
4789
|
se(w);
|
|
4790
|
-
}),
|
|
4790
|
+
}), R.add(w);
|
|
4791
4791
|
}
|
|
4792
|
-
function
|
|
4792
|
+
function Re(R, g) {
|
|
4793
4793
|
if (!_.test(g = S()))
|
|
4794
4794
|
throw N(g, "name");
|
|
4795
|
-
var
|
|
4796
|
-
Z(
|
|
4797
|
-
w === "option" ? (Q(
|
|
4798
|
-
}),
|
|
4795
|
+
var O = new n(ae(g));
|
|
4796
|
+
Z(O, function(w) {
|
|
4797
|
+
w === "option" ? (Q(O, w), T(";")) : (J(w), Y(O, "optional"));
|
|
4798
|
+
}), R.add(O);
|
|
4799
4799
|
}
|
|
4800
|
-
function de(
|
|
4800
|
+
function de(R, g) {
|
|
4801
4801
|
if (!_.test(g = S()))
|
|
4802
4802
|
throw N(g, "name");
|
|
4803
|
-
var
|
|
4804
|
-
Z(
|
|
4803
|
+
var O = new e(g);
|
|
4804
|
+
Z(O, function(w) {
|
|
4805
4805
|
switch (w) {
|
|
4806
4806
|
case "option":
|
|
4807
|
-
Q(
|
|
4807
|
+
Q(O, w), T(";");
|
|
4808
4808
|
break;
|
|
4809
4809
|
case "reserved":
|
|
4810
|
-
re(
|
|
4810
|
+
re(O.reserved || (O.reserved = []), !0), O.reserved === void 0 && (O.reserved = []);
|
|
4811
4811
|
break;
|
|
4812
4812
|
default:
|
|
4813
|
-
|
|
4813
|
+
Oe(O, w);
|
|
4814
4814
|
}
|
|
4815
|
-
}),
|
|
4815
|
+
}), R.add(O), R === $ && X.push(O);
|
|
4816
4816
|
}
|
|
4817
|
-
function
|
|
4817
|
+
function Oe(R, g) {
|
|
4818
4818
|
if (!_.test(g))
|
|
4819
4819
|
throw N(g, "name");
|
|
4820
4820
|
T("=");
|
|
4821
|
-
var
|
|
4821
|
+
var O = te(S(), !0), b = {
|
|
4822
4822
|
options: void 0
|
|
4823
4823
|
};
|
|
4824
|
-
|
|
4824
|
+
b.getOption = function(w) {
|
|
4825
4825
|
return this.options[w];
|
|
4826
|
-
},
|
|
4827
|
-
t.prototype.setOption.call(
|
|
4828
|
-
},
|
|
4829
|
-
}, Z(
|
|
4826
|
+
}, b.setOption = function(w, q) {
|
|
4827
|
+
t.prototype.setOption.call(b, w, q);
|
|
4828
|
+
}, b.setParsedOption = function() {
|
|
4829
|
+
}, Z(b, function(q) {
|
|
4830
4830
|
if (q === "option")
|
|
4831
|
-
Q(
|
|
4831
|
+
Q(b, q), T(";");
|
|
4832
4832
|
else
|
|
4833
4833
|
throw N(q);
|
|
4834
4834
|
}, function() {
|
|
4835
|
-
se(
|
|
4836
|
-
}),
|
|
4835
|
+
se(b);
|
|
4836
|
+
}), R.add(g, O, b.comment, b.parsedOptions || b.options);
|
|
4837
4837
|
}
|
|
4838
|
-
function Q(
|
|
4839
|
-
var
|
|
4838
|
+
function Q(R, g) {
|
|
4839
|
+
var O, b, w = !0;
|
|
4840
4840
|
for (g === "option" && (g = S()); g !== "="; ) {
|
|
4841
4841
|
if (g === "(") {
|
|
4842
4842
|
var q = S();
|
|
@@ -4845,110 +4845,110 @@ function requireParse() {
|
|
|
4845
4845
|
if (w) {
|
|
4846
4846
|
if (w = !1, g.includes(".") && !g.includes("(")) {
|
|
4847
4847
|
var x = g.split(".");
|
|
4848
|
-
|
|
4848
|
+
O = x[0] + ".", g = x[1];
|
|
4849
4849
|
continue;
|
|
4850
4850
|
}
|
|
4851
|
-
|
|
4851
|
+
O = g;
|
|
4852
4852
|
} else
|
|
4853
|
-
|
|
4853
|
+
b = b ? b += g : g;
|
|
4854
4854
|
g = S();
|
|
4855
4855
|
}
|
|
4856
|
-
var G =
|
|
4857
|
-
|
|
4856
|
+
var G = b ? O.concat(b) : O, U = ce(R, G);
|
|
4857
|
+
b = b && b[0] === "." ? b.slice(1) : b, O = O && O[O.length - 1] === "." ? O.slice(0, -1) : O, Ae(R, O, U, b);
|
|
4858
4858
|
}
|
|
4859
|
-
function ce(
|
|
4859
|
+
function ce(R, g) {
|
|
4860
4860
|
if (T("{", !0)) {
|
|
4861
|
-
for (var
|
|
4861
|
+
for (var O = {}; !T("}", !0); ) {
|
|
4862
4862
|
if (!_.test(V = S()))
|
|
4863
4863
|
throw N(V, "name");
|
|
4864
4864
|
if (V === null)
|
|
4865
4865
|
throw N(V, "end of input");
|
|
4866
|
-
var
|
|
4867
|
-
if (T(":", !0),
|
|
4868
|
-
|
|
4869
|
-
else if (
|
|
4870
|
-
|
|
4866
|
+
var b, w = V;
|
|
4867
|
+
if (T(":", !0), M() === "{")
|
|
4868
|
+
b = ce(R, g + "." + V);
|
|
4869
|
+
else if (M() === "[") {
|
|
4870
|
+
b = [];
|
|
4871
4871
|
var q;
|
|
4872
4872
|
if (T("[", !0)) {
|
|
4873
4873
|
do
|
|
4874
|
-
q = ue(),
|
|
4874
|
+
q = ue(), b.push(q);
|
|
4875
4875
|
while (T(",", !0));
|
|
4876
|
-
T("]"), typeof q < "u" && fe(
|
|
4876
|
+
T("]"), typeof q < "u" && fe(R, g + "." + V, q);
|
|
4877
4877
|
}
|
|
4878
4878
|
} else
|
|
4879
|
-
|
|
4880
|
-
var x =
|
|
4881
|
-
x && (
|
|
4879
|
+
b = ue(), fe(R, g + "." + V, b);
|
|
4880
|
+
var x = O[w];
|
|
4881
|
+
x && (b = [].concat(x).concat(b)), O[w] = b, T(",", !0), T(";", !0);
|
|
4882
4882
|
}
|
|
4883
|
-
return
|
|
4883
|
+
return O;
|
|
4884
4884
|
}
|
|
4885
4885
|
var G = ue();
|
|
4886
|
-
return fe(
|
|
4886
|
+
return fe(R, g, G), G;
|
|
4887
4887
|
}
|
|
4888
|
-
function fe(
|
|
4889
|
-
if ($ ===
|
|
4890
|
-
z[g] =
|
|
4888
|
+
function fe(R, g, O) {
|
|
4889
|
+
if ($ === R && /^features\\./.test(g)) {
|
|
4890
|
+
z[g] = O;
|
|
4891
4891
|
return;
|
|
4892
4892
|
}
|
|
4893
|
-
|
|
4893
|
+
R.setOption && R.setOption(g, O);
|
|
4894
4894
|
}
|
|
4895
|
-
function
|
|
4896
|
-
|
|
4895
|
+
function Ae(R, g, O, b) {
|
|
4896
|
+
R.setParsedOption && R.setParsedOption(g, O, b);
|
|
4897
4897
|
}
|
|
4898
|
-
function se(
|
|
4898
|
+
function se(R) {
|
|
4899
4899
|
if (T("[", !0)) {
|
|
4900
4900
|
do
|
|
4901
|
-
Q(
|
|
4901
|
+
Q(R, "option");
|
|
4902
4902
|
while (T(",", !0));
|
|
4903
4903
|
T("]");
|
|
4904
4904
|
}
|
|
4905
|
-
return
|
|
4905
|
+
return R;
|
|
4906
4906
|
}
|
|
4907
|
-
function
|
|
4907
|
+
function be(R, g) {
|
|
4908
4908
|
if (!_.test(g = S()))
|
|
4909
4909
|
throw N(g, "service name");
|
|
4910
|
-
var
|
|
4911
|
-
Z(
|
|
4912
|
-
if (!ie(
|
|
4910
|
+
var O = new r(g);
|
|
4911
|
+
Z(O, function(w) {
|
|
4912
|
+
if (!ie(O, w))
|
|
4913
4913
|
if (w === "rpc")
|
|
4914
|
-
we(
|
|
4914
|
+
we(O, w);
|
|
4915
4915
|
else
|
|
4916
4916
|
throw N(w);
|
|
4917
|
-
}),
|
|
4917
|
+
}), R.add(O), R === $ && X.push(O);
|
|
4918
4918
|
}
|
|
4919
|
-
function we(
|
|
4920
|
-
var
|
|
4919
|
+
function we(R, g) {
|
|
4920
|
+
var O = k(), b = g;
|
|
4921
4921
|
if (!_.test(g = S()))
|
|
4922
4922
|
throw N(g, "name");
|
|
4923
|
-
var w = g, q, x, G,
|
|
4924
|
-
if (T("("), T("stream", !0) && (x = !0), !
|
|
4923
|
+
var w = g, q, x, G, U;
|
|
4924
|
+
if (T("("), T("stream", !0) && (x = !0), !A.test(g = S()) || (q = g, T(")"), T("returns"), T("("), T("stream", !0) && (U = !0), !A.test(g = S())))
|
|
4925
4925
|
throw N(g);
|
|
4926
4926
|
G = g, T(")");
|
|
4927
|
-
var oe = new i(w,
|
|
4928
|
-
oe.comment =
|
|
4927
|
+
var oe = new i(w, b, q, G, x, U);
|
|
4928
|
+
oe.comment = O, Z(oe, function(le) {
|
|
4929
4929
|
if (le === "option")
|
|
4930
4930
|
Q(oe, le), T(";");
|
|
4931
4931
|
else
|
|
4932
4932
|
throw N(le);
|
|
4933
|
-
}),
|
|
4933
|
+
}), R.add(oe);
|
|
4934
4934
|
}
|
|
4935
|
-
function Se(
|
|
4936
|
-
if (!
|
|
4935
|
+
function Se(R, g) {
|
|
4936
|
+
if (!A.test(g = S()))
|
|
4937
4937
|
throw N(g, "reference");
|
|
4938
|
-
var
|
|
4938
|
+
var O = g;
|
|
4939
4939
|
Z(null, function(w) {
|
|
4940
4940
|
switch (w) {
|
|
4941
4941
|
case "required":
|
|
4942
4942
|
case "repeated":
|
|
4943
|
-
Y(
|
|
4943
|
+
Y(R, w, O);
|
|
4944
4944
|
break;
|
|
4945
4945
|
case "optional":
|
|
4946
|
-
|
|
4946
|
+
D === "proto3" ? Y(R, "proto3_optional", O) : Y(R, "optional", O);
|
|
4947
4947
|
break;
|
|
4948
4948
|
default:
|
|
4949
|
-
if (
|
|
4949
|
+
if (D === "proto2" || !A.test(w))
|
|
4950
4950
|
throw N(w);
|
|
4951
|
-
J(w), Y(
|
|
4951
|
+
J(w), Y(R, "optional", O);
|
|
4952
4952
|
break;
|
|
4953
4953
|
}
|
|
4954
4954
|
});
|
|
@@ -4956,22 +4956,22 @@ function requireParse() {
|
|
|
4956
4956
|
for (var V; (V = S()) !== null; )
|
|
4957
4957
|
switch (V) {
|
|
4958
4958
|
case "package":
|
|
4959
|
-
if (!
|
|
4959
|
+
if (!P)
|
|
4960
4960
|
throw N(V);
|
|
4961
4961
|
ye();
|
|
4962
4962
|
break;
|
|
4963
4963
|
case "import":
|
|
4964
|
-
if (!
|
|
4964
|
+
if (!P)
|
|
4965
4965
|
throw N(V);
|
|
4966
4966
|
me();
|
|
4967
4967
|
break;
|
|
4968
4968
|
case "syntax":
|
|
4969
|
-
if (!
|
|
4969
|
+
if (!P)
|
|
4970
4970
|
throw N(V);
|
|
4971
4971
|
ve();
|
|
4972
4972
|
break;
|
|
4973
4973
|
case "edition":
|
|
4974
|
-
if (!
|
|
4974
|
+
if (!P)
|
|
4975
4975
|
throw N(V);
|
|
4976
4976
|
ge();
|
|
4977
4977
|
break;
|
|
@@ -4980,7 +4980,7 @@ function requireParse() {
|
|
|
4980
4980
|
break;
|
|
4981
4981
|
default:
|
|
4982
4982
|
if (ie($, V)) {
|
|
4983
|
-
|
|
4983
|
+
P = !1;
|
|
4984
4984
|
continue;
|
|
4985
4985
|
}
|
|
4986
4986
|
throw N(V);
|
|
@@ -5324,8 +5324,8 @@ var protobufjs, hasRequiredProtobufjs;
|
|
|
5324
5324
|
function requireProtobufjs() {
|
|
5325
5325
|
return hasRequiredProtobufjs || (hasRequiredProtobufjs = 1, protobufjs = requireSrc()), protobufjs;
|
|
5326
5326
|
}
|
|
5327
|
-
var protobufjsExports = requireProtobufjs(), StateStreamErrorCode = /* @__PURE__ */ ((u) => (u.CONNECTION_FAILED = "CONNECTION_FAILED", u.RECONNECT_FAILED = "RECONNECT_FAILED", u.CONNECTION_LOST = "CONNECTION_LOST", u.CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT", u.AUTH_FAILED = "AUTH_FAILED", u.AUTH_REFRESH_FAILED = "AUTH_REFRESH_FAILED", u.DEVICE_ERROR = "DEVICE_ERROR", u.DECODE_ERROR = "DECODE_ERROR", u.FRAME_PROCESS_ERROR = "FRAME_PROCESS_ERROR", u.STREAM_ALREADY_STARTED = "STREAM_ALREADY_STARTED", u.WORKER_INIT_FAILED = "WORKER_INIT_FAILED", u.UNKNOWN_ERROR = "UNKNOWN_ERROR", u))(StateStreamErrorCode || {}), ConnectionStatus = /* @__PURE__ */ ((u) => (u.DISCONNECTED = "DISCONNECTED", u.CONNECTING = "CONNECTING", u.CONNECTED = "CONNECTED", u.RECONNECTING = "RECONNECTING", u))(ConnectionStatus || {}), AuthStatus = /* @__PURE__ */ ((u) => (u.UNAUTHENTICATED = "UNAUTHENTICATED", u.AUTHENTICATING = "AUTHENTICATING", u.AUTHENTICATED = "AUTHENTICATED", u.FAILED = "FAILED", u))(AuthStatus || {});
|
|
5328
|
-
const nested = { BSB_State: { nested: { StateUpdate: { oneofs: { state: { oneof: ["deviceName", "power", "brightness", "audioVolume", "wifi", "updateState", "updateCheck", "timezone", "matter", "frame", "input", "timer", "ble", "autoUpdateState"] } }, fields: { deviceName: { type: "BSB_State.DeviceName", id: 1 }, power: { type: "BSB_State.Power", id: 2 }, brightness: { type: "BSB_State.Brightness", id: 3 }, audioVolume: { type: "BSB_State.AudioVolume", id: 4 }, wifi: { type: "BSB_State.Wifi", id: 5 }, updateState: { type: "BSB_Update.UpdateState", id: 6 }, updateCheck: { type: "BSB_Update.CheckState", id: 7 }, timezone: { type: "BSB_State.Timezone", id: 8 }, matter: { type: "BSB_State.Matter", id: 9 }, frame: { type: "BSB_Frame.Frame", id: 10 }, input: { type: "BSB_Input.InputEvent", id: 11 }, timer: { type: "BSB_Timer.Timer", id: 12 }, ble: { type: "BSB_State.Ble.Ble", id: 13 }, autoUpdateState: { type: "BSB_Update.AutoUpdateState", id: 14 } } }, State: { oneofs: { _error: { oneof: ["error"] } }, fields: { timestamp: { type: "fixed64", id: 1 }, updates: { rule: "repeated", type: "StateUpdate", id: 2 }, error: { type: "BSB_Error.Error", id: 3, options: { proto3_optional: !0 } } } }, DeviceName: { fields: { name: { type: "string", id: 1 } } }, BrightnessAutomatic: { fields: {} }, BrightnessManual: { fields: { brightness: { type: "uint32", id: 1 } } }, Brightness: { oneofs: { setting: { oneof: ["automatic", "manual"] } }, fields: { automatic: { type: "BrightnessAutomatic", id: 1 }, manual: { type: "BrightnessManual", id: 2 }, actualBrightness: { type: "uint32", id: 3 } } }, BatteryStatus: { values: { DISCHARGING: 0, CHARGING: 1, CHARGED: 2 } }, UnknownPowerState: { fields: {} }, PowerState: { fields: { batteryStatus: { type: "BatteryStatus", id: 1 }, batteryChargePercent: { type: "uint32", id: 2 }, batteryVoltageMv: { type: "uint32", id: 3 }, batteryCurrentMa: { type: "sint32", id: 4 }, usbVoltageMv: { type: "uint32", id: 5 } } }, Power: { oneofs: { state: { oneof: ["unknown", "known"] } }, fields: { unknown: { type: "UnknownPowerState", id: 1 }, known: { type: "PowerState", id: 2 } } }, AudioVolume: { fields: { volume: { type: "uint32", id: 1 } } }, WifiConnectionStatus: { values: { CONNECTED: 0, CONNECTING: 1, DISCONNECTING: 2, RECONNECTING: 3 } }, WifiSecurity: { values: { UNKNOWN: 0, OPEN: 1, WPA: 2, WPA2: 3, WEP: 4, WPA_WPA2: 5, WPA3: 6, WPA2_WPA3: 7 } }, IpConfigurationMethod: { values: { DHCP: 0, STATIC: 1 } }, IpProtocol: { values: { IPV4: 0, IPV6: 1 } }, WifiStateUnknown: { fields: {} }, WifiStateDisconnected: { fields: {} }, WifiStateConnected: { fields: { status: { type: "WifiConnectionStatus", id: 1 }, ssid: { type: "string", id: 2 }, bssid: { type: "string", id: 3 }, channel: { type: "uint32", id: 4 }, rssi: { type: "sint32", id: 5 }, security: { type: "WifiSecurity", id: 6 } } }, IpAddress: { fields: { protocol: { type: "IpProtocol", id: 1 }, method: { type: "IpConfigurationMethod", id: 2 }, address: { type: "string", id: 3 }, gateway: { type: "string", id: 4 }, netmask: { type: "string", id: 5 } } }, Wifi: { oneofs: { wifiState: { oneof: ["unknown", "disconnected", "connected"] } }, fields: { unknown: { type: "WifiStateUnknown", id: 1 }, disconnected: { type: "WifiStateDisconnected", id: 2 }, connected: { type: "WifiStateConnected", id: 3 }, ipAddresses: { rule: "repeated", type: "IpAddress", id: 4 } } }, Timezone: { fields: { name: { type: "string", id: 1 }, offset: { type: "sint32", id: 2 }, abbr: { type: "string", id: 3 } } }, MatterCommissioningStatus: { values: { NEVER_STARTED: 0, STARTED: 1, COMPLETED_SUCCESSFULLY: 2, FAILED: 3 } }, MatterCommissioningState: { fields: { status: { type: "MatterCommissioningStatus", id: 1 }, timestamp: { type: "fixed64", id: 2 } } }, Matter: { fields: { fabricCount: { type: "uint32", id: 1 }, state: { type: "MatterCommissioningState", id: 2 } } }, Ble: { nested: { ServiceStatus: { values: { RESET: 0, INITIALIZATION: 1, READY: 2, ADVERTISING: 3, CONNECTABLE: 4, CONNECTED: 5, ERROR: 6 } }, Ble: { oneofs: { _remoteAddress: { oneof: ["remoteAddress"] } }, fields: { status: { type: "ServiceStatus", id: 1 }, remoteAddress: { type: "string", id: 2, options: { proto3_optional: !0 } } } } } } } }, BSB_Update: { nested: { UpdateEvent: { values: { SESSION_START: 0, SESSION_STOP: 1, ACTION_BEGIN: 2, ACTION_DONE: 3, DETAIL_CHANGE: 4, ACTION_PROGRESS: 5, EVENT_NONE: 6 } }, UpdateAction: { values: { DOWNLOAD: 0, SHA_VERIFICATION: 1, UNPACK: 2, INSTALLATION_PREPARE: 3, INSTALLATION_APPLY: 4, ACTION_NONE: 5 } }, UpdateStatus: { values: { OK: 0, BATTERY_LOW: 1, BUSY: 2, DOWNLOAD_FAILURE: 3, DOWNLOAD_ABORT: 4, SHA_MISMATCH: 5, UNPACK_CREATE_STAGING_DIRECTORY_FAILURE: 6, UNPACK_ARCHIVE_OPEN_FAILURE: 7, UNPACK_ARCHIVE_UNPACK_FAILURE: 8, INSTALLATION_PREPARE_MANIFEST_NOT_FOUND: 9, INSTALLATION_PREPARE_MANIFEST_INVALID: 10, INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE: 11, INSTALLATION_PREPARE_POINTER_SETUP_FAILURE: 12, UNKNOWN_FAILURE: 13 } }, CheckError: { values: { NOT_AVAILABLE: 0, FAILURE: 1, IDLE: 2 } }, UpdateAvailable: { fields: { version: { type: "string", id: 1 } } }, UpdateUnavailable: { fields: { reason: { type: "CheckError", id: 1 } } }, UpdateState: { fields: { event: { type: "UpdateEvent", id: 1 }, action: { type: "UpdateAction", id: 2 }, status: { type: "UpdateStatus", id: 3 } } }, CheckState: { oneofs: { status: { oneof: ["available", "unavailable"] } }, fields: { available: { type: "UpdateAvailable", id: 1 }, unavailable: { type: "UpdateUnavailable", id: 2 } } }, AutoUpdateInterval: { fields: { start: { type: "uint32", id: 1 }, end: { type: "uint32", id: 2 } } }, AutoUpdateState: { fields: { enabled: { type: "bool", id: 1 }, interval: { type: "AutoUpdateInterval", id: 2 } } } } }, BSB_Frame: { nested: { Encoding: { values: { PLAIN: 0, RUN_LENGTH: 1, DEFLATE: 2, DEFLATE_RUN_LENGTH: 3 } }, PixelFormat: { values: { RGB888: 0, L8: 1, L4: 2 } }, Screen: { values: { FRONT: 0, BACK: 1 } }, Frame: { fields: { screen: { type: "Screen", id: 1 }, width: { type: "uint32", id: 2 }, height: { type: "uint32", id: 3 }, encoding: { type: "Encoding", id: 4 }, pixelFormat: { type: "PixelFormat", id: 5 }, data: { type: "bytes", id: 6 } } } } }, BSB_Timer: { nested: { Timer: { fields: { json: { type: "BSB_Util.Json", id: 1 } } } } }, BSB_Util: { nested: { Compression: { values: { PLAIN: 0, GZIP: 1 } }, Json: { fields: { compression: { type: "Compression", id: 1 }, data: { type: "bytes", id: 2 } } } } }, BSB_Input: { nested: { Button: { values: { OK: 0, BACK: 1, START: 2 } }, ButtonAction: { values: { PRESS: 0, RELEASE: 1 } }, SwitchPosition: { values: { BUSY: 0, CUSTOM: 1, OFF: 2, APPS: 3, SETTINGS: 4 } }, ButtonEvent: { fields: { button: { type: "Button", id: 1 }, action: { type: "ButtonAction", id: 2 } } }, SwitchEvent: { fields: { position: { type: "SwitchPosition", id: 1 } } }, EncoderEvent: { fields: { delta: { type: "sint32", id: 1 } } }, InputEvent: { oneofs: { event: { oneof: ["buttonEvent", "switchEvent", "encoderEvent"] } }, fields: { buttonEvent: { type: "ButtonEvent", id: 1 }, switchEvent: { type: "SwitchEvent", id: 2 }, encoderEvent: { type: "EncoderEvent", id: 3 } } } } }, BSB_Error: { nested: { Cause: { values: { RESOURCE_LIMIT: 0 } }, Severity: { values: { FATAL: 0, ERROR: 1, WARNING: 2 } }, Error: { fields: { cause: { type: "Cause", id: 1 }, severity: { type: "Severity", id: 2 } } } } } };
|
|
5327
|
+
var protobufjsExports = requireProtobufjs(), StateStreamErrorCode = /* @__PURE__ */ ((u) => (u.CONNECTION_FAILED = "CONNECTION_FAILED", u.RECONNECT_FAILED = "RECONNECT_FAILED", u.CONNECTION_LOST = "CONNECTION_LOST", u.CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT", u.AUTH_FAILED = "AUTH_FAILED", u.AUTH_REFRESH_FAILED = "AUTH_REFRESH_FAILED", u.DEVICE_ERROR = "DEVICE_ERROR", u.DECODE_ERROR = "DECODE_ERROR", u.FRAME_PROCESS_ERROR = "FRAME_PROCESS_ERROR", u.STREAM_ALREADY_STARTED = "STREAM_ALREADY_STARTED", u.WORKER_INIT_FAILED = "WORKER_INIT_FAILED", u.UNKNOWN_ERROR = "UNKNOWN_ERROR", u))(StateStreamErrorCode || {}), ConnectionStatus = /* @__PURE__ */ ((u) => (u.DISCONNECTED = "DISCONNECTED", u.CONNECTING = "CONNECTING", u.CONNECTED = "CONNECTED", u.RECONNECTING = "RECONNECTING", u))(ConnectionStatus || {}), AuthStatus = /* @__PURE__ */ ((u) => (u.UNAUTHENTICATED = "UNAUTHENTICATED", u.AUTHENTICATING = "AUTHENTICATING", u.AUTHENTICATED = "AUTHENTICATED", u.REAUTHENTICATING = "REAUTHENTICATING", u.FAILED = "FAILED", u))(AuthStatus || {});
|
|
5328
|
+
const DEFAULT_MAX_RECONNECT_ATTEMPTS = 5, DEFAULT_MAX_AUTH_ATTEMPTS = 5, nested = { BSB_State: { nested: { StateUpdate: { oneofs: { state: { oneof: ["deviceName", "power", "brightness", "audioVolume", "wifi", "updateState", "updateCheck", "timezone", "matter", "frame", "input", "timer", "ble", "autoUpdateState"] } }, fields: { deviceName: { type: "BSB_State.DeviceName", id: 1 }, power: { type: "BSB_State.Power", id: 2 }, brightness: { type: "BSB_State.Brightness", id: 3 }, audioVolume: { type: "BSB_State.AudioVolume", id: 4 }, wifi: { type: "BSB_State.Wifi", id: 5 }, updateState: { type: "BSB_Update.UpdateState", id: 6 }, updateCheck: { type: "BSB_Update.CheckState", id: 7 }, timezone: { type: "BSB_State.Timezone", id: 8 }, matter: { type: "BSB_State.Matter", id: 9 }, frame: { type: "BSB_Frame.Frame", id: 10 }, input: { type: "BSB_Input.InputEvent", id: 11 }, timer: { type: "BSB_Timer.Timer", id: 12 }, ble: { type: "BSB_State.Ble.Ble", id: 13 }, autoUpdateState: { type: "BSB_Update.AutoUpdateState", id: 14 } } }, State: { oneofs: { _error: { oneof: ["error"] } }, fields: { timestamp: { type: "fixed64", id: 1 }, updates: { rule: "repeated", type: "StateUpdate", id: 2 }, error: { type: "BSB_Error.Error", id: 3, options: { proto3_optional: !0 } } } }, DeviceName: { fields: { name: { type: "string", id: 1 } } }, BrightnessAutomatic: { fields: {} }, BrightnessManual: { fields: { brightness: { type: "uint32", id: 1 } } }, Brightness: { oneofs: { setting: { oneof: ["automatic", "manual"] } }, fields: { automatic: { type: "BrightnessAutomatic", id: 1 }, manual: { type: "BrightnessManual", id: 2 }, actualBrightness: { type: "uint32", id: 3 } } }, BatteryStatus: { values: { DISCHARGING: 0, CHARGING: 1, CHARGED: 2 } }, UnknownPowerState: { fields: {} }, PowerState: { fields: { batteryStatus: { type: "BatteryStatus", id: 1 }, batteryChargePercent: { type: "uint32", id: 2 }, batteryVoltageMv: { type: "uint32", id: 3 }, batteryCurrentMa: { type: "sint32", id: 4 }, usbVoltageMv: { type: "uint32", id: 5 } } }, Power: { oneofs: { state: { oneof: ["unknown", "known"] } }, fields: { unknown: { type: "UnknownPowerState", id: 1 }, known: { type: "PowerState", id: 2 } } }, AudioVolume: { fields: { volume: { type: "uint32", id: 1 } } }, WifiConnectionStatus: { values: { CONNECTED: 0, CONNECTING: 1, DISCONNECTING: 2, RECONNECTING: 3 } }, WifiSecurity: { values: { UNKNOWN: 0, OPEN: 1, WPA: 2, WPA2: 3, WEP: 4, WPA_WPA2: 5, WPA3: 6, WPA2_WPA3: 7 } }, IpConfigurationMethod: { values: { DHCP: 0, STATIC: 1 } }, IpProtocol: { values: { IPV4: 0, IPV6: 1 } }, WifiStateUnknown: { fields: {} }, WifiStateDisconnected: { fields: {} }, WifiStateConnected: { fields: { status: { type: "WifiConnectionStatus", id: 1 }, ssid: { type: "string", id: 2 }, bssid: { type: "string", id: 3 }, channel: { type: "uint32", id: 4 }, rssi: { type: "sint32", id: 5 }, security: { type: "WifiSecurity", id: 6 } } }, IpAddress: { fields: { protocol: { type: "IpProtocol", id: 1 }, method: { type: "IpConfigurationMethod", id: 2 }, address: { type: "string", id: 3 }, gateway: { type: "string", id: 4 }, netmask: { type: "string", id: 5 } } }, Wifi: { oneofs: { wifiState: { oneof: ["unknown", "disconnected", "connected"] } }, fields: { unknown: { type: "WifiStateUnknown", id: 1 }, disconnected: { type: "WifiStateDisconnected", id: 2 }, connected: { type: "WifiStateConnected", id: 3 }, ipAddresses: { rule: "repeated", type: "IpAddress", id: 4 } } }, Timezone: { fields: { name: { type: "string", id: 1 }, offset: { type: "sint32", id: 2 }, abbr: { type: "string", id: 3 } } }, MatterCommissioningStatus: { values: { NEVER_STARTED: 0, STARTED: 1, COMPLETED_SUCCESSFULLY: 2, FAILED: 3 } }, MatterCommissioningState: { fields: { status: { type: "MatterCommissioningStatus", id: 1 }, timestamp: { type: "fixed64", id: 2 } } }, Matter: { fields: { fabricCount: { type: "uint32", id: 1 }, state: { type: "MatterCommissioningState", id: 2 } } }, Ble: { nested: { ServiceStatus: { values: { RESET: 0, INITIALIZATION: 1, READY: 2, ADVERTISING: 3, CONNECTABLE: 4, CONNECTED: 5, ERROR: 6 } }, Ble: { oneofs: { _remoteAddress: { oneof: ["remoteAddress"] } }, fields: { status: { type: "ServiceStatus", id: 1 }, remoteAddress: { type: "string", id: 2, options: { proto3_optional: !0 } } } } } } } }, BSB_Update: { nested: { UpdateEvent: { values: { SESSION_START: 0, SESSION_STOP: 1, ACTION_BEGIN: 2, ACTION_DONE: 3, DETAIL_CHANGE: 4, ACTION_PROGRESS: 5, EVENT_NONE: 6 } }, UpdateAction: { values: { DOWNLOAD: 0, SHA_VERIFICATION: 1, UNPACK: 2, INSTALLATION_PREPARE: 3, INSTALLATION_APPLY: 4, ACTION_NONE: 5 } }, UpdateStatus: { values: { OK: 0, BATTERY_LOW: 1, BUSY: 2, DOWNLOAD_FAILURE: 3, DOWNLOAD_ABORT: 4, SHA_MISMATCH: 5, UNPACK_CREATE_STAGING_DIRECTORY_FAILURE: 6, UNPACK_ARCHIVE_OPEN_FAILURE: 7, UNPACK_ARCHIVE_UNPACK_FAILURE: 8, INSTALLATION_PREPARE_MANIFEST_NOT_FOUND: 9, INSTALLATION_PREPARE_MANIFEST_INVALID: 10, INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE: 11, INSTALLATION_PREPARE_POINTER_SETUP_FAILURE: 12, UNKNOWN_FAILURE: 13 } }, CheckError: { values: { NOT_AVAILABLE: 0, FAILURE: 1, IDLE: 2 } }, UpdateAvailable: { fields: { version: { type: "string", id: 1 } } }, UpdateUnavailable: { fields: { reason: { type: "CheckError", id: 1 } } }, UpdateState: { fields: { event: { type: "UpdateEvent", id: 1 }, action: { type: "UpdateAction", id: 2 }, status: { type: "UpdateStatus", id: 3 } } }, CheckState: { oneofs: { status: { oneof: ["available", "unavailable"] } }, fields: { available: { type: "UpdateAvailable", id: 1 }, unavailable: { type: "UpdateUnavailable", id: 2 } } }, AutoUpdateInterval: { fields: { start: { type: "uint32", id: 1 }, end: { type: "uint32", id: 2 } } }, AutoUpdateState: { fields: { enabled: { type: "bool", id: 1 }, interval: { type: "AutoUpdateInterval", id: 2 } } } } }, BSB_Frame: { nested: { Encoding: { values: { PLAIN: 0, RUN_LENGTH: 1, DEFLATE: 2, DEFLATE_RUN_LENGTH: 3 } }, PixelFormat: { values: { RGB888: 0, L8: 1, L4: 2 } }, Screen: { values: { FRONT: 0, BACK: 1 } }, Frame: { fields: { screen: { type: "Screen", id: 1 }, width: { type: "uint32", id: 2 }, height: { type: "uint32", id: 3 }, encoding: { type: "Encoding", id: 4 }, pixelFormat: { type: "PixelFormat", id: 5 }, data: { type: "bytes", id: 6 } } } } }, BSB_Timer: { nested: { Timer: { fields: { json: { type: "BSB_Util.Json", id: 1 } } } } }, BSB_Util: { nested: { Compression: { values: { PLAIN: 0, GZIP: 1 } }, Json: { fields: { compression: { type: "Compression", id: 1 }, data: { type: "bytes", id: 2 } } } } }, BSB_Input: { nested: { Button: { values: { OK: 0, BACK: 1, START: 2 } }, ButtonAction: { values: { PRESS: 0, RELEASE: 1 } }, SwitchPosition: { values: { BUSY: 0, CUSTOM: 1, OFF: 2, APPS: 3, SETTINGS: 4 } }, ButtonEvent: { fields: { button: { type: "Button", id: 1 }, action: { type: "ButtonAction", id: 2 } } }, SwitchEvent: { fields: { position: { type: "SwitchPosition", id: 1 } } }, EncoderEvent: { fields: { delta: { type: "sint32", id: 1 } } }, InputEvent: { oneofs: { event: { oneof: ["buttonEvent", "switchEvent", "encoderEvent"] } }, fields: { buttonEvent: { type: "ButtonEvent", id: 1 }, switchEvent: { type: "SwitchEvent", id: 2 }, encoderEvent: { type: "EncoderEvent", id: 3 } } } } }, BSB_Error: { nested: { Cause: { values: { RESOURCE_LIMIT: 0 } }, Severity: { values: { FATAL: 0, ERROR: 1, WARNING: 2 } }, Error: { fields: { cause: { type: "Cause", id: 1 }, severity: { type: "Severity", id: 2 } } } } } };
|
|
5329
5329
|
var bundle = {
|
|
5330
5330
|
nested
|
|
5331
5331
|
};
|
|
@@ -5420,8 +5420,8 @@ async function processFrame(u) {
|
|
|
5420
5420
|
return new Uint8ClampedArray(u.width * u.height * 4);
|
|
5421
5421
|
}
|
|
5422
5422
|
}
|
|
5423
|
-
const root = protobufjsExports.Root.fromJSON(bundle), StateType = root.lookupType("BSB_State.State"), AUTH_CODE = 3e3, RECONNECT_CODES = /* @__PURE__ */ new Set([1001, 1006, 1012, 1013, 1014, 3008])
|
|
5424
|
-
let socket = null, isBinaryMode = !0, currentMode = "local", currentToken, currentAddr = "", retryCount = 0, authRetryCount = 0, isAuthReported = !1, stabilityTimeout;
|
|
5423
|
+
const root = protobufjsExports.Root.fromJSON(bundle), StateType = root.lookupType("BSB_State.State"), AUTH_CODE = 3e3, RECONNECT_CODES = /* @__PURE__ */ new Set([1001, 1006, 1012, 1013, 1014, 3008]);
|
|
5424
|
+
let maxAuthAttempts = DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = DEFAULT_MAX_RECONNECT_ATTEMPTS, socket = null, isBinaryMode = !0, currentMode = "local", currentToken, currentAddr = "", retryCount = 0, authRetryCount = 0, isAuthReported = !1, stabilityTimeout;
|
|
5425
5425
|
const activePorts = /* @__PURE__ */ new Set(), subscriptions = /* @__PURE__ */ new Map();
|
|
5426
5426
|
let processingQueue = Promise.resolve();
|
|
5427
5427
|
function broadcast(u) {
|
|
@@ -5526,25 +5526,25 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
5526
5526
|
return;
|
|
5527
5527
|
}
|
|
5528
5528
|
if (n.code === AUTH_CODE && currentMode === "remote") {
|
|
5529
|
-
authRetryCount <
|
|
5529
|
+
authRetryCount < maxAuthAttempts ? (authRetryCount++, console.warn(\`[Worker] Auth failed (3000). Requesting new token... (Attempt \${authRetryCount}/\${maxAuthAttempts})\`), broadcast({ type: "TOKEN_EXPIRED" }), broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.REAUTHENTICATING, authAttempts: authRetryCount })) : (broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.FAILED }), broadcast({
|
|
5530
5530
|
type: "ERROR",
|
|
5531
5531
|
code: StateStreamErrorCode.AUTH_FAILED,
|
|
5532
|
-
message: \`Maximum authentication attempts (\${
|
|
5532
|
+
message: \`Maximum authentication attempts (\${maxAuthAttempts}) reached. Please log in again.\`
|
|
5533
5533
|
}));
|
|
5534
5534
|
return;
|
|
5535
5535
|
}
|
|
5536
|
-
if (
|
|
5537
|
-
if (retryCount <
|
|
5536
|
+
if (RECONNECT_CODES.has(n.code)) {
|
|
5537
|
+
if (retryCount < maxReconnectAttempts) {
|
|
5538
5538
|
retryCount++;
|
|
5539
5539
|
const e = Math.min(1e3 * retryCount, 5e3);
|
|
5540
|
-
console.log(\`[Worker] Reconnecting (network code: \${n.code}) in \${e}ms... (Attempt \${retryCount}/\${
|
|
5540
|
+
console.log(\`[Worker] Reconnecting (network code: \${n.code}) in \${e}ms... (Attempt \${retryCount}/\${maxReconnectAttempts})\`), broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.RECONNECTING, connectionAttempts: retryCount }), setTimeout(() => {
|
|
5541
5541
|
activePorts.size > 0 && socket && connect(currentAddr, currentToken, isBinaryMode, currentMode);
|
|
5542
5542
|
}, e);
|
|
5543
5543
|
} else
|
|
5544
5544
|
broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.DISCONNECTED }), broadcast({
|
|
5545
5545
|
type: "ERROR",
|
|
5546
5546
|
code: StateStreamErrorCode.RECONNECT_FAILED,
|
|
5547
|
-
message: \`Maximum reconnection attempts (\${
|
|
5547
|
+
message: \`Maximum reconnection attempts (\${maxReconnectAttempts}) reached. Connection lost.\`
|
|
5548
5548
|
});
|
|
5549
5549
|
return;
|
|
5550
5550
|
}
|
|
@@ -5558,7 +5558,7 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
5558
5558
|
function handleCommand(u, f) {
|
|
5559
5559
|
switch (u.type) {
|
|
5560
5560
|
case "START":
|
|
5561
|
-
activePorts.add(f), socket && socket.readyState === WebSocket.OPEN && currentAddr === u.addr ? (f.postMessage({ type: "CONNECTED" }), f.postMessage({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED })) : connect(u.addr, u.token, u.isBinary, u.mode);
|
|
5561
|
+
maxAuthAttempts = u.maxAuthAttempts ?? DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = u.maxReconnectAttempts ?? DEFAULT_MAX_RECONNECT_ATTEMPTS, activePorts.add(f), socket && socket.readyState === WebSocket.OPEN && currentAddr === u.addr ? (f.postMessage({ type: "CONNECTED" }), f.postMessage({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED })) : connect(u.addr, u.token, u.isBinary, u.mode);
|
|
5562
5562
|
break;
|
|
5563
5563
|
case "STOP":
|
|
5564
5564
|
activePorts.delete(f);
|
|
@@ -5599,11 +5599,11 @@ if ("SharedWorkerGlobalScope" in self) {
|
|
|
5599
5599
|
handleCommand(f.data, u);
|
|
5600
5600
|
};
|
|
5601
5601
|
}
|
|
5602
|
-
`,
|
|
5603
|
-
function
|
|
5602
|
+
`, S = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", x], { type: "text/javascript;charset=utf-8" });
|
|
5603
|
+
function be(e) {
|
|
5604
5604
|
let n;
|
|
5605
5605
|
try {
|
|
5606
|
-
if (n =
|
|
5606
|
+
if (n = S && (self.URL || self.webkitURL).createObjectURL(S), !n) throw "";
|
|
5607
5607
|
const t = new Worker(n, {
|
|
5608
5608
|
type: "module",
|
|
5609
5609
|
name: e == null ? void 0 : e.name
|
|
@@ -5613,7 +5613,7 @@ function ve(e) {
|
|
|
5613
5613
|
}), t;
|
|
5614
5614
|
} catch {
|
|
5615
5615
|
return new Worker(
|
|
5616
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
5616
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(x),
|
|
5617
5617
|
{
|
|
5618
5618
|
type: "module",
|
|
5619
5619
|
name: e == null ? void 0 : e.name
|
|
@@ -5621,7 +5621,7 @@ function ve(e) {
|
|
|
5621
5621
|
);
|
|
5622
5622
|
}
|
|
5623
5623
|
}
|
|
5624
|
-
const
|
|
5624
|
+
const Ee = `var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, src = { exports: {} }, indexLight = { exports: {} }, indexMinimal = {}, minimal = {}, aspromise, hasRequiredAspromise;
|
|
5625
5625
|
function requireAspromise() {
|
|
5626
5626
|
if (hasRequiredAspromise) return aspromise;
|
|
5627
5627
|
hasRequiredAspromise = 1, aspromise = u;
|
|
@@ -6187,8 +6187,8 @@ function requireWriter() {
|
|
|
6187
6187
|
var y = u.Array.prototype.set ? function(v, m, _) {
|
|
6188
6188
|
m.set(v, _);
|
|
6189
6189
|
} : function(v, m, _) {
|
|
6190
|
-
for (var
|
|
6191
|
-
m[_ +
|
|
6190
|
+
for (var A = 0; A < v.length; ++A)
|
|
6191
|
+
m[_ + A] = v[A];
|
|
6192
6192
|
};
|
|
6193
6193
|
return i.prototype.bytes = function(v) {
|
|
6194
6194
|
var m = v.length >>> 0;
|
|
@@ -7329,10 +7329,10 @@ function requireType() {
|
|
|
7329
7329
|
return this._fieldsById;
|
|
7330
7330
|
this._fieldsById = {};
|
|
7331
7331
|
for (var v = Object.keys(this.fields), m = 0; m < v.length; ++m) {
|
|
7332
|
-
var _ = this.fields[v[m]],
|
|
7333
|
-
if (this._fieldsById[
|
|
7334
|
-
throw Error("duplicate id " +
|
|
7335
|
-
this._fieldsById[
|
|
7332
|
+
var _ = this.fields[v[m]], A = _.id;
|
|
7333
|
+
if (this._fieldsById[A])
|
|
7334
|
+
throw Error("duplicate id " + A + " in " + this);
|
|
7335
|
+
this._fieldsById[A] = _;
|
|
7336
7336
|
}
|
|
7337
7337
|
return this._fieldsById;
|
|
7338
7338
|
}
|
|
@@ -7375,45 +7375,45 @@ function requireType() {
|
|
|
7375
7375
|
for (var _ = 0; _ < /* initializes */
|
|
7376
7376
|
this.fieldsArray.length; ++_)
|
|
7377
7377
|
this._fieldsArray[_].resolve();
|
|
7378
|
-
var
|
|
7378
|
+
var A = {};
|
|
7379
7379
|
for (_ = 0; _ < /* initializes */
|
|
7380
7380
|
this.oneofsArray.length; ++_)
|
|
7381
|
-
|
|
7381
|
+
A[this._oneofsArray[_].resolve().name] = {
|
|
7382
7382
|
get: t.oneOfGetter(this._oneofsArray[_].oneof),
|
|
7383
7383
|
set: t.oneOfSetter(this._oneofsArray[_].oneof)
|
|
7384
7384
|
};
|
|
7385
|
-
_ && Object.defineProperties(v.prototype,
|
|
7385
|
+
_ && Object.defineProperties(v.prototype, A);
|
|
7386
7386
|
}
|
|
7387
7387
|
}
|
|
7388
7388
|
}), y.generateConstructor = function(m) {
|
|
7389
|
-
for (var _ = t.codegen(["p"], m.name),
|
|
7390
|
-
(I = m._fieldsArray[
|
|
7389
|
+
for (var _ = t.codegen(["p"], m.name), A = 0, I; A < m.fieldsArray.length; ++A)
|
|
7390
|
+
(I = m._fieldsArray[A]).map ? _("this%s={}", t.safeProp(I.name)) : I.repeated && _("this%s=[]", t.safeProp(I.name));
|
|
7391
7391
|
return _("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]");
|
|
7392
7392
|
};
|
|
7393
7393
|
function E(v) {
|
|
7394
7394
|
return v._fieldsById = v._fieldsArray = v._oneofsArray = null, delete v.encode, delete v.decode, delete v.verify, v;
|
|
7395
7395
|
}
|
|
7396
7396
|
return y.fromJSON = function(m, _) {
|
|
7397
|
-
var
|
|
7398
|
-
|
|
7397
|
+
var A = new y(m, _.options);
|
|
7398
|
+
A.extensions = _.extensions, A.reserved = _.reserved;
|
|
7399
7399
|
for (var I = Object.keys(_.fields), C = 0; C < I.length; ++C)
|
|
7400
|
-
|
|
7400
|
+
A.add(
|
|
7401
7401
|
(typeof _.fields[I[C]].keyType < "u" ? d.fromJSON : c.fromJSON)(I[C], _.fields[I[C]])
|
|
7402
7402
|
);
|
|
7403
7403
|
if (_.oneofs)
|
|
7404
7404
|
for (I = Object.keys(_.oneofs), C = 0; C < I.length; ++C)
|
|
7405
|
-
|
|
7405
|
+
A.add(h.fromJSON(I[C], _.oneofs[I[C]]));
|
|
7406
7406
|
if (_.nested)
|
|
7407
7407
|
for (I = Object.keys(_.nested), C = 0; C < I.length; ++C) {
|
|
7408
7408
|
var j = _.nested[I[C]];
|
|
7409
|
-
|
|
7409
|
+
A.add(
|
|
7410
7410
|
// most to least likely
|
|
7411
7411
|
(j.id !== void 0 ? c.fromJSON : j.fields !== void 0 ? y.fromJSON : j.values !== void 0 ? f.fromJSON : j.methods !== void 0 ? n.fromJSON : u.fromJSON)(I[C], j)
|
|
7412
7412
|
);
|
|
7413
7413
|
}
|
|
7414
|
-
return _.extensions && _.extensions.length && (
|
|
7414
|
+
return _.extensions && _.extensions.length && (A.extensions = _.extensions), _.reserved && _.reserved.length && (A.reserved = _.reserved), _.group && (A.group = !0), _.comment && (A.comment = _.comment), _.edition && (A._edition = _.edition), A._defaultEdition = "proto3", A;
|
|
7415
7415
|
}, y.prototype.toJSON = function(m) {
|
|
7416
|
-
var _ = u.prototype.toJSON.call(this, m),
|
|
7416
|
+
var _ = u.prototype.toJSON.call(this, m), A = m ? !!m.keepComments : !1;
|
|
7417
7417
|
return t.toObject([
|
|
7418
7418
|
"edition",
|
|
7419
7419
|
this._editionToJSON(),
|
|
@@ -7434,16 +7434,16 @@ function requireType() {
|
|
|
7434
7434
|
"nested",
|
|
7435
7435
|
_ && _.nested || void 0,
|
|
7436
7436
|
"comment",
|
|
7437
|
-
|
|
7437
|
+
A ? this.comment : void 0
|
|
7438
7438
|
]);
|
|
7439
7439
|
}, y.prototype.resolveAll = function() {
|
|
7440
7440
|
if (!this._needsRecursiveResolve) return this;
|
|
7441
7441
|
u.prototype.resolveAll.call(this);
|
|
7442
7442
|
var m = this.oneofsArray;
|
|
7443
|
-
for (
|
|
7444
|
-
m[
|
|
7445
|
-
for (var _ = this.fieldsArray,
|
|
7446
|
-
_[
|
|
7443
|
+
for (A = 0; A < m.length; )
|
|
7444
|
+
m[A++].resolve();
|
|
7445
|
+
for (var _ = this.fieldsArray, A = 0; A < _.length; )
|
|
7446
|
+
_[A++].resolve();
|
|
7447
7447
|
return this;
|
|
7448
7448
|
}, y.prototype._resolveFeaturesRecursive = function(m) {
|
|
7449
7449
|
return this._needsRecursiveFeatureResolution ? (m = this._edition || m, u.prototype._resolveFeaturesRecursive.call(this, m), this.oneofsArray.forEach((_) => {
|
|
@@ -7488,9 +7488,9 @@ function requireType() {
|
|
|
7488
7488
|
}, y.prototype.create = function(m) {
|
|
7489
7489
|
return new this.ctor(m);
|
|
7490
7490
|
}, y.prototype.setup = function() {
|
|
7491
|
-
for (var m = this.fullName, _ = [],
|
|
7492
|
-
this.fieldsArray.length; ++
|
|
7493
|
-
_.push(this._fieldsArray[
|
|
7491
|
+
for (var m = this.fullName, _ = [], A = 0; A < /* initializes */
|
|
7492
|
+
this.fieldsArray.length; ++A)
|
|
7493
|
+
_.push(this._fieldsArray[A].resolve().resolvedType);
|
|
7494
7494
|
this.encode = l(this)({
|
|
7495
7495
|
Writer: i,
|
|
7496
7496
|
types: _,
|
|
@@ -7530,8 +7530,8 @@ function requireType() {
|
|
|
7530
7530
|
}, y.prototype.toObject = function(m, _) {
|
|
7531
7531
|
return this.setup().toObject(m, _);
|
|
7532
7532
|
}, y.d = function(m) {
|
|
7533
|
-
return function(
|
|
7534
|
-
t.decorateType(
|
|
7533
|
+
return function(A) {
|
|
7534
|
+
t.decorateType(A, m);
|
|
7535
7535
|
};
|
|
7536
7536
|
}, type;
|
|
7537
7537
|
}
|
|
@@ -7556,67 +7556,67 @@ function requireRoot() {
|
|
|
7556
7556
|
if (!y)
|
|
7557
7557
|
return d.asPromise(a, E, o, p);
|
|
7558
7558
|
var v = y === t;
|
|
7559
|
-
function m(
|
|
7559
|
+
function m(B, L) {
|
|
7560
7560
|
if (y) {
|
|
7561
7561
|
if (v)
|
|
7562
|
-
throw
|
|
7563
|
-
|
|
7562
|
+
throw B;
|
|
7563
|
+
L && L.resolveAll();
|
|
7564
7564
|
var S = y;
|
|
7565
|
-
y = null, S(
|
|
7565
|
+
y = null, S(B, L);
|
|
7566
7566
|
}
|
|
7567
7567
|
}
|
|
7568
|
-
function _(
|
|
7569
|
-
var
|
|
7570
|
-
if (
|
|
7571
|
-
var S =
|
|
7568
|
+
function _(B) {
|
|
7569
|
+
var L = B.lastIndexOf("google/protobuf/");
|
|
7570
|
+
if (L > -1) {
|
|
7571
|
+
var S = B.substring(L);
|
|
7572
7572
|
if (S in r) return S;
|
|
7573
7573
|
}
|
|
7574
7574
|
return null;
|
|
7575
7575
|
}
|
|
7576
|
-
function
|
|
7576
|
+
function A(B, L) {
|
|
7577
7577
|
try {
|
|
7578
|
-
if (d.isString(
|
|
7579
|
-
E.setOptions(
|
|
7578
|
+
if (d.isString(L) && L.charAt(0) === "{" && (L = JSON.parse(L)), !d.isString(L))
|
|
7579
|
+
E.setOptions(L.options).addJSON(L.nested);
|
|
7580
7580
|
else {
|
|
7581
|
-
e.filename =
|
|
7582
|
-
var S = e(
|
|
7581
|
+
e.filename = B;
|
|
7582
|
+
var S = e(L, E, p), J, M = 0;
|
|
7583
7583
|
if (S.imports)
|
|
7584
|
-
for (;
|
|
7585
|
-
(J = _(S.imports[
|
|
7584
|
+
for (; M < S.imports.length; ++M)
|
|
7585
|
+
(J = _(S.imports[M]) || E.resolvePath(B, S.imports[M])) && I(J);
|
|
7586
7586
|
if (S.weakImports)
|
|
7587
|
-
for (
|
|
7588
|
-
(J = _(S.weakImports[
|
|
7587
|
+
for (M = 0; M < S.weakImports.length; ++M)
|
|
7588
|
+
(J = _(S.weakImports[M]) || E.resolvePath(B, S.weakImports[M])) && I(J, !0);
|
|
7589
7589
|
}
|
|
7590
7590
|
} catch (T) {
|
|
7591
7591
|
m(T);
|
|
7592
7592
|
}
|
|
7593
7593
|
!v && !C && m(null, E);
|
|
7594
7594
|
}
|
|
7595
|
-
function I(
|
|
7596
|
-
if (
|
|
7597
|
-
if (E.files.push(
|
|
7598
|
-
v ?
|
|
7599
|
-
--C,
|
|
7595
|
+
function I(B, L) {
|
|
7596
|
+
if (B = _(B) || B, !(E.files.indexOf(B) > -1)) {
|
|
7597
|
+
if (E.files.push(B), B in r) {
|
|
7598
|
+
v ? A(B, r[B]) : (++C, setTimeout(function() {
|
|
7599
|
+
--C, A(B, r[B]);
|
|
7600
7600
|
}));
|
|
7601
7601
|
return;
|
|
7602
7602
|
}
|
|
7603
7603
|
if (v) {
|
|
7604
7604
|
var S;
|
|
7605
7605
|
try {
|
|
7606
|
-
S = d.fs.readFileSync(
|
|
7606
|
+
S = d.fs.readFileSync(B).toString("utf8");
|
|
7607
7607
|
} catch (J) {
|
|
7608
|
-
|
|
7608
|
+
L || m(J);
|
|
7609
7609
|
return;
|
|
7610
7610
|
}
|
|
7611
|
-
|
|
7611
|
+
A(B, S);
|
|
7612
7612
|
} else
|
|
7613
|
-
++C, E.fetch(
|
|
7613
|
+
++C, E.fetch(B, function(J, M) {
|
|
7614
7614
|
if (--C, !!y) {
|
|
7615
7615
|
if (J) {
|
|
7616
|
-
|
|
7616
|
+
L ? C || m(null, E) : m(J);
|
|
7617
7617
|
return;
|
|
7618
7618
|
}
|
|
7619
|
-
|
|
7619
|
+
A(B, M);
|
|
7620
7620
|
}
|
|
7621
7621
|
});
|
|
7622
7622
|
}
|
|
@@ -8360,93 +8360,93 @@ function requireTokenize() {
|
|
|
8360
8360
|
function l(s, a) {
|
|
8361
8361
|
s = s.toString();
|
|
8362
8362
|
var o = 0, p = s.length, y = 1, E = 0, v = {}, m = [], _ = null;
|
|
8363
|
-
function
|
|
8363
|
+
function A(k) {
|
|
8364
8364
|
return Error("illegal " + k + " (line " + y + ")");
|
|
8365
8365
|
}
|
|
8366
8366
|
function I() {
|
|
8367
8367
|
var k = _ === "'" ? h : f;
|
|
8368
8368
|
k.lastIndex = o - 1;
|
|
8369
|
-
var
|
|
8370
|
-
if (!
|
|
8371
|
-
throw
|
|
8372
|
-
return o = k.lastIndex, S(_), _ = null, t(
|
|
8369
|
+
var P = k.exec(s);
|
|
8370
|
+
if (!P)
|
|
8371
|
+
throw A("string");
|
|
8372
|
+
return o = k.lastIndex, S(_), _ = null, t(P[1]);
|
|
8373
8373
|
}
|
|
8374
8374
|
function C(k) {
|
|
8375
8375
|
return s.charAt(k);
|
|
8376
8376
|
}
|
|
8377
|
-
function j(k,
|
|
8377
|
+
function j(k, P, F) {
|
|
8378
8378
|
var W = {
|
|
8379
8379
|
type: s.charAt(k++),
|
|
8380
8380
|
lineEmpty: !1,
|
|
8381
8381
|
leading: F
|
|
8382
8382
|
}, H;
|
|
8383
8383
|
a ? H = 2 : H = 3;
|
|
8384
|
-
var
|
|
8384
|
+
var D = k - H, $;
|
|
8385
8385
|
do
|
|
8386
|
-
if (--
|
|
8386
|
+
if (--D < 0 || ($ = s.charAt(D)) === \`
|
|
8387
8387
|
\`) {
|
|
8388
8388
|
W.lineEmpty = !0;
|
|
8389
8389
|
break;
|
|
8390
8390
|
}
|
|
8391
8391
|
while ($ === " " || $ === " ");
|
|
8392
|
-
for (var X = s.substring(k,
|
|
8392
|
+
for (var X = s.substring(k, P).split(n), z = 0; z < X.length; ++z)
|
|
8393
8393
|
X[z] = X[z].replace(a ? d : c, "").trim();
|
|
8394
8394
|
W.text = X.join(\`
|
|
8395
8395
|
\`).trim(), v[y] = W, E = y;
|
|
8396
8396
|
}
|
|
8397
8397
|
function K(k) {
|
|
8398
|
-
var
|
|
8398
|
+
var P = B(k), F = s.substring(k, P), W = /^\\s*\\/\\//.test(F);
|
|
8399
8399
|
return W;
|
|
8400
8400
|
}
|
|
8401
|
-
function
|
|
8402
|
-
for (var
|
|
8401
|
+
function B(k) {
|
|
8402
|
+
for (var P = k; P < p && C(P) !== \`
|
|
8403
8403
|
\`; )
|
|
8404
|
-
|
|
8405
|
-
return
|
|
8404
|
+
P++;
|
|
8405
|
+
return P;
|
|
8406
8406
|
}
|
|
8407
|
-
function
|
|
8407
|
+
function L() {
|
|
8408
8408
|
if (m.length > 0)
|
|
8409
8409
|
return m.shift();
|
|
8410
8410
|
if (_)
|
|
8411
8411
|
return I();
|
|
8412
|
-
var k,
|
|
8412
|
+
var k, P, F, W, H, D = o === 0;
|
|
8413
8413
|
do {
|
|
8414
8414
|
if (o === p)
|
|
8415
8415
|
return null;
|
|
8416
8416
|
for (k = !1; e.test(F = C(o)); )
|
|
8417
8417
|
if (F === \`
|
|
8418
|
-
\` && (
|
|
8418
|
+
\` && (D = !0, ++y), ++o === p)
|
|
8419
8419
|
return null;
|
|
8420
8420
|
if (C(o) === "/") {
|
|
8421
8421
|
if (++o === p)
|
|
8422
|
-
throw
|
|
8422
|
+
throw A("comment");
|
|
8423
8423
|
if (C(o) === "/")
|
|
8424
8424
|
if (a) {
|
|
8425
8425
|
if (W = o, H = !1, K(o - 1)) {
|
|
8426
8426
|
H = !0;
|
|
8427
8427
|
do
|
|
8428
|
-
if (o =
|
|
8428
|
+
if (o = B(o), o === p || (o++, !D))
|
|
8429
8429
|
break;
|
|
8430
8430
|
while (K(o));
|
|
8431
8431
|
} else
|
|
8432
|
-
o = Math.min(p,
|
|
8433
|
-
H && (j(W, o,
|
|
8432
|
+
o = Math.min(p, B(o) + 1);
|
|
8433
|
+
H && (j(W, o, D), D = !0), y++, k = !0;
|
|
8434
8434
|
} else {
|
|
8435
8435
|
for (H = C(W = o + 1) === "/"; C(++o) !== \`
|
|
8436
8436
|
\`; )
|
|
8437
8437
|
if (o === p)
|
|
8438
8438
|
return null;
|
|
8439
|
-
++o, H && (j(W, o - 1,
|
|
8439
|
+
++o, H && (j(W, o - 1, D), D = !0), ++y, k = !0;
|
|
8440
8440
|
}
|
|
8441
8441
|
else if ((F = C(o)) === "*") {
|
|
8442
8442
|
W = o + 1, H = a || C(W) === "*";
|
|
8443
8443
|
do {
|
|
8444
8444
|
if (F === \`
|
|
8445
8445
|
\` && ++y, ++o === p)
|
|
8446
|
-
throw
|
|
8447
|
-
|
|
8448
|
-
} while (
|
|
8449
|
-
++o, H && (j(W, o - 2,
|
|
8446
|
+
throw A("comment");
|
|
8447
|
+
P = F, F = C(o);
|
|
8448
|
+
} while (P !== "*" || F !== "/");
|
|
8449
|
+
++o, H && (j(W, o - 2, D), D = !0), k = !0;
|
|
8450
8450
|
} else
|
|
8451
8451
|
return "/";
|
|
8452
8452
|
}
|
|
@@ -8465,30 +8465,30 @@ function requireTokenize() {
|
|
|
8465
8465
|
}
|
|
8466
8466
|
function J() {
|
|
8467
8467
|
if (!m.length) {
|
|
8468
|
-
var k =
|
|
8468
|
+
var k = L();
|
|
8469
8469
|
if (k === null)
|
|
8470
8470
|
return null;
|
|
8471
8471
|
S(k);
|
|
8472
8472
|
}
|
|
8473
8473
|
return m[0];
|
|
8474
8474
|
}
|
|
8475
|
-
function
|
|
8475
|
+
function M(k, P) {
|
|
8476
8476
|
var F = J(), W = F === k;
|
|
8477
8477
|
if (W)
|
|
8478
|
-
return
|
|
8479
|
-
if (!
|
|
8480
|
-
throw
|
|
8478
|
+
return L(), !0;
|
|
8479
|
+
if (!P)
|
|
8480
|
+
throw A("token '" + F + "', '" + k + "' expected");
|
|
8481
8481
|
return !1;
|
|
8482
8482
|
}
|
|
8483
8483
|
function T(k) {
|
|
8484
|
-
var
|
|
8485
|
-
return k === void 0 ? (F = v[y - 1], delete v[y - 1], F && (a || F.type === "*" || F.lineEmpty) && (
|
|
8484
|
+
var P = null, F;
|
|
8485
|
+
return k === void 0 ? (F = v[y - 1], delete v[y - 1], F && (a || F.type === "*" || F.lineEmpty) && (P = F.leading ? F.text : null)) : (E < k && J(), F = v[k], delete v[k], F && !F.lineEmpty && (a || F.type === "/") && (P = F.leading ? null : F.text)), P;
|
|
8486
8486
|
}
|
|
8487
8487
|
return Object.defineProperty({
|
|
8488
|
-
next:
|
|
8488
|
+
next: L,
|
|
8489
8489
|
peek: J,
|
|
8490
8490
|
push: S,
|
|
8491
|
-
skip:
|
|
8491
|
+
skip: M,
|
|
8492
8492
|
cmnt: T
|
|
8493
8493
|
}, "line", {
|
|
8494
8494
|
get: function() {
|
|
@@ -8502,33 +8502,33 @@ var parse_1, hasRequiredParse;
|
|
|
8502
8502
|
function requireParse() {
|
|
8503
8503
|
if (hasRequiredParse) return parse_1;
|
|
8504
8504
|
hasRequiredParse = 1, parse_1 = I, I.filename = null, I.defaults = { keepCase: !1 };
|
|
8505
|
-
var u = requireTokenize(), f = requireRoot(), h = requireType(), c = requireField(), d = requireMapfield(), n = requireOneof(), e = require_enum(), r = requireService(), i = requireMethod(), t = requireObject(), l = requireTypes(), s = requireUtil(), a = /^[1-9][0-9]*$/, o = /^-?[1-9][0-9]*$/, p = /^0[x][0-9a-fA-F]+$/, y = /^-?0[x][0-9a-fA-F]+$/, E = /^0[0-7]+$/, v = /^-?0[0-7]+$/, m = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, _ = /^[a-zA-Z_][a-zA-Z_0-9]*$/,
|
|
8505
|
+
var u = requireTokenize(), f = requireRoot(), h = requireType(), c = requireField(), d = requireMapfield(), n = requireOneof(), e = require_enum(), r = requireService(), i = requireMethod(), t = requireObject(), l = requireTypes(), s = requireUtil(), a = /^[1-9][0-9]*$/, o = /^-?[1-9][0-9]*$/, p = /^0[x][0-9a-fA-F]+$/, y = /^-?0[x][0-9a-fA-F]+$/, E = /^0[0-7]+$/, v = /^-?0[0-7]+$/, m = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, _ = /^[a-zA-Z_][a-zA-Z_0-9]*$/, A = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
8506
8506
|
function I(C, j, K) {
|
|
8507
8507
|
j instanceof f || (K = j, j = new f()), K || (K = I.defaults);
|
|
8508
|
-
var
|
|
8509
|
-
return
|
|
8508
|
+
var B = K.preferTrailingComment || !1, L = u(C, K.alternateCommentMode || !1), S = L.next, J = L.push, M = L.peek, T = L.skip, k = L.cmnt, P = !0, F, W, H, D = "proto2", $ = j, X = [], z = {}, ae = K.keepCase ? function(R) {
|
|
8509
|
+
return R;
|
|
8510
8510
|
} : s.camelCase;
|
|
8511
8511
|
function he() {
|
|
8512
|
-
X.forEach((
|
|
8513
|
-
|
|
8514
|
-
|
|
8512
|
+
X.forEach((R) => {
|
|
8513
|
+
R._edition = D, Object.keys(z).forEach((g) => {
|
|
8514
|
+
R.getOption(g) === void 0 && R.setOption(g, z[g], !0);
|
|
8515
8515
|
});
|
|
8516
8516
|
});
|
|
8517
8517
|
}
|
|
8518
|
-
function N(
|
|
8519
|
-
var
|
|
8520
|
-
return
|
|
8518
|
+
function N(R, g, O) {
|
|
8519
|
+
var b = I.filename;
|
|
8520
|
+
return O || (I.filename = null), Error("illegal " + (g || "token") + " '" + R + "' (" + (b ? b + ", " : "") + "line " + L.line + ")");
|
|
8521
8521
|
}
|
|
8522
8522
|
function ee() {
|
|
8523
|
-
var
|
|
8523
|
+
var R = [], g;
|
|
8524
8524
|
do {
|
|
8525
8525
|
if ((g = S()) !== '"' && g !== "'")
|
|
8526
8526
|
throw N(g);
|
|
8527
|
-
|
|
8527
|
+
R.push(S()), T(g), g = M();
|
|
8528
8528
|
} while (g === '"' || g === "'");
|
|
8529
|
-
return
|
|
8529
|
+
return R.join("");
|
|
8530
8530
|
}
|
|
8531
|
-
function ue(
|
|
8531
|
+
function ue(R) {
|
|
8532
8532
|
var g = S();
|
|
8533
8533
|
switch (g) {
|
|
8534
8534
|
case "'":
|
|
@@ -8548,24 +8548,24 @@ function requireParse() {
|
|
|
8548
8548
|
!0
|
|
8549
8549
|
);
|
|
8550
8550
|
} catch {
|
|
8551
|
-
if (
|
|
8551
|
+
if (A.test(g))
|
|
8552
8552
|
return g;
|
|
8553
8553
|
throw N(g, "value");
|
|
8554
8554
|
}
|
|
8555
8555
|
}
|
|
8556
|
-
function re(
|
|
8557
|
-
var
|
|
8556
|
+
function re(R, g) {
|
|
8557
|
+
var O, b;
|
|
8558
8558
|
do
|
|
8559
|
-
if (g && ((
|
|
8559
|
+
if (g && ((O = M()) === '"' || O === "'")) {
|
|
8560
8560
|
var w = ee();
|
|
8561
|
-
if (
|
|
8561
|
+
if (R.push(w), D >= 2023)
|
|
8562
8562
|
throw N(w, "id");
|
|
8563
8563
|
} else
|
|
8564
8564
|
try {
|
|
8565
|
-
|
|
8565
|
+
R.push([b = te(S()), T("to", !0) ? te(S()) : b]);
|
|
8566
8566
|
} catch (x) {
|
|
8567
|
-
if (g &&
|
|
8568
|
-
|
|
8567
|
+
if (g && A.test(O) && D >= 2023)
|
|
8568
|
+
R.push(O);
|
|
8569
8569
|
else
|
|
8570
8570
|
throw x;
|
|
8571
8571
|
}
|
|
@@ -8586,13 +8586,13 @@ function requireParse() {
|
|
|
8586
8586
|
}
|
|
8587
8587
|
);
|
|
8588
8588
|
}
|
|
8589
|
-
function pe(
|
|
8590
|
-
var
|
|
8591
|
-
switch (
|
|
8589
|
+
function pe(R, g) {
|
|
8590
|
+
var O = 1;
|
|
8591
|
+
switch (R.charAt(0) === "-" && (O = -1, R = R.substring(1)), R) {
|
|
8592
8592
|
case "inf":
|
|
8593
8593
|
case "INF":
|
|
8594
8594
|
case "Inf":
|
|
8595
|
-
return
|
|
8595
|
+
return O * (1 / 0);
|
|
8596
8596
|
case "nan":
|
|
8597
8597
|
case "NAN":
|
|
8598
8598
|
case "Nan":
|
|
@@ -8601,18 +8601,18 @@ function requireParse() {
|
|
|
8601
8601
|
case "0":
|
|
8602
8602
|
return 0;
|
|
8603
8603
|
}
|
|
8604
|
-
if (a.test(
|
|
8605
|
-
return
|
|
8606
|
-
if (p.test(
|
|
8607
|
-
return
|
|
8608
|
-
if (E.test(
|
|
8609
|
-
return
|
|
8610
|
-
if (m.test(
|
|
8611
|
-
return
|
|
8612
|
-
throw N(
|
|
8613
|
-
}
|
|
8614
|
-
function te(
|
|
8615
|
-
switch (
|
|
8604
|
+
if (a.test(R))
|
|
8605
|
+
return O * parseInt(R, 10);
|
|
8606
|
+
if (p.test(R))
|
|
8607
|
+
return O * parseInt(R, 16);
|
|
8608
|
+
if (E.test(R))
|
|
8609
|
+
return O * parseInt(R, 8);
|
|
8610
|
+
if (m.test(R))
|
|
8611
|
+
return O * parseFloat(R);
|
|
8612
|
+
throw N(R, "number", g);
|
|
8613
|
+
}
|
|
8614
|
+
function te(R, g) {
|
|
8615
|
+
switch (R) {
|
|
8616
8616
|
case "max":
|
|
8617
8617
|
case "MAX":
|
|
8618
8618
|
case "Max":
|
|
@@ -8620,28 +8620,28 @@ function requireParse() {
|
|
|
8620
8620
|
case "0":
|
|
8621
8621
|
return 0;
|
|
8622
8622
|
}
|
|
8623
|
-
if (!g &&
|
|
8624
|
-
throw N(
|
|
8625
|
-
if (o.test(
|
|
8626
|
-
return parseInt(
|
|
8627
|
-
if (y.test(
|
|
8628
|
-
return parseInt(
|
|
8629
|
-
if (v.test(
|
|
8630
|
-
return parseInt(
|
|
8631
|
-
throw N(
|
|
8623
|
+
if (!g && R.charAt(0) === "-")
|
|
8624
|
+
throw N(R, "id");
|
|
8625
|
+
if (o.test(R))
|
|
8626
|
+
return parseInt(R, 10);
|
|
8627
|
+
if (y.test(R))
|
|
8628
|
+
return parseInt(R, 16);
|
|
8629
|
+
if (v.test(R))
|
|
8630
|
+
return parseInt(R, 8);
|
|
8631
|
+
throw N(R, "id");
|
|
8632
8632
|
}
|
|
8633
8633
|
function ye() {
|
|
8634
8634
|
if (F !== void 0)
|
|
8635
8635
|
throw N("package");
|
|
8636
|
-
if (F = S(), !
|
|
8636
|
+
if (F = S(), !A.test(F))
|
|
8637
8637
|
throw N(F, "name");
|
|
8638
8638
|
$ = $.define(F), T(";");
|
|
8639
8639
|
}
|
|
8640
8640
|
function me() {
|
|
8641
|
-
var
|
|
8642
|
-
switch (
|
|
8641
|
+
var R = M(), g;
|
|
8642
|
+
switch (R) {
|
|
8643
8643
|
case "option":
|
|
8644
|
-
if (
|
|
8644
|
+
if (D < "2024")
|
|
8645
8645
|
throw N("option");
|
|
8646
8646
|
S(), ee(), T(";");
|
|
8647
8647
|
return;
|
|
@@ -8655,185 +8655,185 @@ function requireParse() {
|
|
|
8655
8655
|
g = W || (W = []);
|
|
8656
8656
|
break;
|
|
8657
8657
|
}
|
|
8658
|
-
|
|
8658
|
+
R = ee(), T(";"), g.push(R);
|
|
8659
8659
|
}
|
|
8660
8660
|
function ve() {
|
|
8661
|
-
if (T("="),
|
|
8662
|
-
throw N(
|
|
8661
|
+
if (T("="), D = ee(), D < 2023)
|
|
8662
|
+
throw N(D, "syntax");
|
|
8663
8663
|
T(";");
|
|
8664
8664
|
}
|
|
8665
8665
|
function ge() {
|
|
8666
|
-
if (T("="),
|
|
8667
|
-
throw N(
|
|
8666
|
+
if (T("="), D = ee(), !["2023", "2024"].includes(D))
|
|
8667
|
+
throw N(D, "edition");
|
|
8668
8668
|
T(";");
|
|
8669
8669
|
}
|
|
8670
|
-
function ie(
|
|
8670
|
+
function ie(R, g) {
|
|
8671
8671
|
switch (g) {
|
|
8672
8672
|
case "option":
|
|
8673
|
-
return Q(
|
|
8673
|
+
return Q(R, g), T(";"), !0;
|
|
8674
8674
|
case "message":
|
|
8675
|
-
return ne(
|
|
8675
|
+
return ne(R, g), !0;
|
|
8676
8676
|
case "enum":
|
|
8677
|
-
return de(
|
|
8677
|
+
return de(R, g), !0;
|
|
8678
8678
|
case "export":
|
|
8679
8679
|
case "local":
|
|
8680
|
-
return
|
|
8680
|
+
return D < "2024" || (g = S(), g === "export" || g === "local") || g !== "message" && g !== "enum" ? !1 : ie(R, g);
|
|
8681
8681
|
case "service":
|
|
8682
|
-
return
|
|
8682
|
+
return be(R, g), !0;
|
|
8683
8683
|
case "extend":
|
|
8684
|
-
return Se(
|
|
8684
|
+
return Se(R, g), !0;
|
|
8685
8685
|
}
|
|
8686
8686
|
return !1;
|
|
8687
8687
|
}
|
|
8688
|
-
function Z(
|
|
8689
|
-
var
|
|
8690
|
-
if (
|
|
8688
|
+
function Z(R, g, O) {
|
|
8689
|
+
var b = L.line;
|
|
8690
|
+
if (R && (typeof R.comment != "string" && (R.comment = k()), R.filename = I.filename), T("{", !0)) {
|
|
8691
8691
|
for (var w; (w = S()) !== "}"; )
|
|
8692
8692
|
g(w);
|
|
8693
8693
|
T(";", !0);
|
|
8694
8694
|
} else
|
|
8695
|
-
|
|
8695
|
+
O && O(), T(";"), R && (typeof R.comment != "string" || B) && (R.comment = k(b) || R.comment);
|
|
8696
8696
|
}
|
|
8697
|
-
function ne(
|
|
8697
|
+
function ne(R, g) {
|
|
8698
8698
|
if (!_.test(g = S()))
|
|
8699
8699
|
throw N(g, "type name");
|
|
8700
|
-
var
|
|
8701
|
-
Z(
|
|
8702
|
-
if (!ie(
|
|
8700
|
+
var O = new h(g);
|
|
8701
|
+
Z(O, function(w) {
|
|
8702
|
+
if (!ie(O, w))
|
|
8703
8703
|
switch (w) {
|
|
8704
8704
|
case "map":
|
|
8705
|
-
Ee(
|
|
8705
|
+
Ee(O);
|
|
8706
8706
|
break;
|
|
8707
8707
|
case "required":
|
|
8708
|
-
if (
|
|
8708
|
+
if (D !== "proto2")
|
|
8709
8709
|
throw N(w);
|
|
8710
8710
|
/* eslint-disable no-fallthrough */
|
|
8711
8711
|
case "repeated":
|
|
8712
|
-
Y(
|
|
8712
|
+
Y(O, w);
|
|
8713
8713
|
break;
|
|
8714
8714
|
case "optional":
|
|
8715
|
-
if (
|
|
8716
|
-
Y(
|
|
8715
|
+
if (D === "proto3")
|
|
8716
|
+
Y(O, "proto3_optional");
|
|
8717
8717
|
else {
|
|
8718
|
-
if (
|
|
8718
|
+
if (D !== "proto2")
|
|
8719
8719
|
throw N(w);
|
|
8720
|
-
Y(
|
|
8720
|
+
Y(O, "optional");
|
|
8721
8721
|
}
|
|
8722
8722
|
break;
|
|
8723
8723
|
case "oneof":
|
|
8724
|
-
|
|
8724
|
+
Re(O, w);
|
|
8725
8725
|
break;
|
|
8726
8726
|
case "extensions":
|
|
8727
|
-
re(
|
|
8727
|
+
re(O.extensions || (O.extensions = []));
|
|
8728
8728
|
break;
|
|
8729
8729
|
case "reserved":
|
|
8730
|
-
re(
|
|
8730
|
+
re(O.reserved || (O.reserved = []), !0);
|
|
8731
8731
|
break;
|
|
8732
8732
|
default:
|
|
8733
|
-
if (
|
|
8733
|
+
if (D === "proto2" || !A.test(w))
|
|
8734
8734
|
throw N(w);
|
|
8735
|
-
J(w), Y(
|
|
8735
|
+
J(w), Y(O, "optional");
|
|
8736
8736
|
break;
|
|
8737
8737
|
}
|
|
8738
|
-
}),
|
|
8738
|
+
}), R.add(O), R === $ && X.push(O);
|
|
8739
8739
|
}
|
|
8740
|
-
function Y(
|
|
8741
|
-
var
|
|
8742
|
-
if (
|
|
8743
|
-
_e(
|
|
8740
|
+
function Y(R, g, O) {
|
|
8741
|
+
var b = S();
|
|
8742
|
+
if (b === "group") {
|
|
8743
|
+
_e(R, g);
|
|
8744
8744
|
return;
|
|
8745
8745
|
}
|
|
8746
|
-
for (;
|
|
8747
|
-
|
|
8748
|
-
if (!
|
|
8749
|
-
throw N(
|
|
8746
|
+
for (; b.endsWith(".") || M().startsWith("."); )
|
|
8747
|
+
b += S();
|
|
8748
|
+
if (!A.test(b))
|
|
8749
|
+
throw N(b, "type");
|
|
8750
8750
|
var w = S();
|
|
8751
8751
|
if (!_.test(w))
|
|
8752
8752
|
throw N(w, "name");
|
|
8753
8753
|
w = ae(w), T("=");
|
|
8754
|
-
var q = new c(w, te(S()),
|
|
8755
|
-
if (Z(q, function(
|
|
8756
|
-
if (
|
|
8757
|
-
Q(q,
|
|
8754
|
+
var q = new c(w, te(S()), b, g, O);
|
|
8755
|
+
if (Z(q, function(U) {
|
|
8756
|
+
if (U === "option")
|
|
8757
|
+
Q(q, U), T(";");
|
|
8758
8758
|
else
|
|
8759
|
-
throw N(
|
|
8759
|
+
throw N(U);
|
|
8760
8760
|
}, function() {
|
|
8761
8761
|
se(q);
|
|
8762
8762
|
}), g === "proto3_optional") {
|
|
8763
8763
|
var x = new n("_" + w);
|
|
8764
|
-
q.setOption("proto3_optional", !0), x.add(q),
|
|
8764
|
+
q.setOption("proto3_optional", !0), x.add(q), R.add(x);
|
|
8765
8765
|
} else
|
|
8766
|
-
|
|
8767
|
-
|
|
8766
|
+
R.add(q);
|
|
8767
|
+
R === $ && X.push(q);
|
|
8768
8768
|
}
|
|
8769
|
-
function _e(
|
|
8770
|
-
if (
|
|
8769
|
+
function _e(R, g) {
|
|
8770
|
+
if (D >= 2023)
|
|
8771
8771
|
throw N("group");
|
|
8772
|
-
var
|
|
8773
|
-
if (!_.test(
|
|
8774
|
-
throw N(
|
|
8775
|
-
var
|
|
8776
|
-
|
|
8777
|
-
var w = te(S()), q = new h(
|
|
8772
|
+
var O = S();
|
|
8773
|
+
if (!_.test(O))
|
|
8774
|
+
throw N(O, "name");
|
|
8775
|
+
var b = s.lcFirst(O);
|
|
8776
|
+
O === b && (O = s.ucFirst(O)), T("=");
|
|
8777
|
+
var w = te(S()), q = new h(O);
|
|
8778
8778
|
q.group = !0;
|
|
8779
|
-
var x = new c(
|
|
8780
|
-
x.filename = I.filename, Z(q, function(
|
|
8781
|
-
switch (
|
|
8779
|
+
var x = new c(b, w, O, g);
|
|
8780
|
+
x.filename = I.filename, Z(q, function(U) {
|
|
8781
|
+
switch (U) {
|
|
8782
8782
|
case "option":
|
|
8783
|
-
Q(q,
|
|
8783
|
+
Q(q, U), T(";");
|
|
8784
8784
|
break;
|
|
8785
8785
|
case "required":
|
|
8786
8786
|
case "repeated":
|
|
8787
|
-
Y(q,
|
|
8787
|
+
Y(q, U);
|
|
8788
8788
|
break;
|
|
8789
8789
|
case "optional":
|
|
8790
|
-
|
|
8790
|
+
D === "proto3" ? Y(q, "proto3_optional") : Y(q, "optional");
|
|
8791
8791
|
break;
|
|
8792
8792
|
case "message":
|
|
8793
|
-
ne(q,
|
|
8793
|
+
ne(q, U);
|
|
8794
8794
|
break;
|
|
8795
8795
|
case "enum":
|
|
8796
|
-
de(q,
|
|
8796
|
+
de(q, U);
|
|
8797
8797
|
break;
|
|
8798
8798
|
case "reserved":
|
|
8799
8799
|
re(q.reserved || (q.reserved = []), !0);
|
|
8800
8800
|
break;
|
|
8801
8801
|
case "export":
|
|
8802
8802
|
case "local":
|
|
8803
|
-
if (
|
|
8804
|
-
throw N(
|
|
8805
|
-
switch (
|
|
8803
|
+
if (D < "2024")
|
|
8804
|
+
throw N(U);
|
|
8805
|
+
switch (U = S(), U) {
|
|
8806
8806
|
case "message":
|
|
8807
|
-
ne(q,
|
|
8807
|
+
ne(q, U);
|
|
8808
8808
|
break;
|
|
8809
8809
|
case "enum":
|
|
8810
|
-
ne(q,
|
|
8810
|
+
ne(q, U);
|
|
8811
8811
|
break;
|
|
8812
8812
|
default:
|
|
8813
|
-
throw N(
|
|
8813
|
+
throw N(U);
|
|
8814
8814
|
}
|
|
8815
8815
|
break;
|
|
8816
8816
|
/* istanbul ignore next */
|
|
8817
8817
|
default:
|
|
8818
|
-
throw N(
|
|
8818
|
+
throw N(U);
|
|
8819
8819
|
}
|
|
8820
|
-
}),
|
|
8820
|
+
}), R.add(q).add(x);
|
|
8821
8821
|
}
|
|
8822
|
-
function Ee(
|
|
8822
|
+
function Ee(R) {
|
|
8823
8823
|
T("<");
|
|
8824
8824
|
var g = S();
|
|
8825
8825
|
if (l.mapKey[g] === void 0)
|
|
8826
8826
|
throw N(g, "type");
|
|
8827
8827
|
T(",");
|
|
8828
|
-
var
|
|
8829
|
-
if (!
|
|
8830
|
-
throw N(
|
|
8828
|
+
var O = S();
|
|
8829
|
+
if (!A.test(O))
|
|
8830
|
+
throw N(O, "type");
|
|
8831
8831
|
T(">");
|
|
8832
|
-
var
|
|
8833
|
-
if (!_.test(
|
|
8834
|
-
throw N(
|
|
8832
|
+
var b = S();
|
|
8833
|
+
if (!_.test(b))
|
|
8834
|
+
throw N(b, "name");
|
|
8835
8835
|
T("=");
|
|
8836
|
-
var w = new d(ae(
|
|
8836
|
+
var w = new d(ae(b), te(S()), g, O);
|
|
8837
8837
|
Z(w, function(x) {
|
|
8838
8838
|
if (x === "option")
|
|
8839
8839
|
Q(w, x), T(";");
|
|
@@ -8841,56 +8841,56 @@ function requireParse() {
|
|
|
8841
8841
|
throw N(x);
|
|
8842
8842
|
}, function() {
|
|
8843
8843
|
se(w);
|
|
8844
|
-
}),
|
|
8844
|
+
}), R.add(w);
|
|
8845
8845
|
}
|
|
8846
|
-
function
|
|
8846
|
+
function Re(R, g) {
|
|
8847
8847
|
if (!_.test(g = S()))
|
|
8848
8848
|
throw N(g, "name");
|
|
8849
|
-
var
|
|
8850
|
-
Z(
|
|
8851
|
-
w === "option" ? (Q(
|
|
8852
|
-
}),
|
|
8849
|
+
var O = new n(ae(g));
|
|
8850
|
+
Z(O, function(w) {
|
|
8851
|
+
w === "option" ? (Q(O, w), T(";")) : (J(w), Y(O, "optional"));
|
|
8852
|
+
}), R.add(O);
|
|
8853
8853
|
}
|
|
8854
|
-
function de(
|
|
8854
|
+
function de(R, g) {
|
|
8855
8855
|
if (!_.test(g = S()))
|
|
8856
8856
|
throw N(g, "name");
|
|
8857
|
-
var
|
|
8858
|
-
Z(
|
|
8857
|
+
var O = new e(g);
|
|
8858
|
+
Z(O, function(w) {
|
|
8859
8859
|
switch (w) {
|
|
8860
8860
|
case "option":
|
|
8861
|
-
Q(
|
|
8861
|
+
Q(O, w), T(";");
|
|
8862
8862
|
break;
|
|
8863
8863
|
case "reserved":
|
|
8864
|
-
re(
|
|
8864
|
+
re(O.reserved || (O.reserved = []), !0), O.reserved === void 0 && (O.reserved = []);
|
|
8865
8865
|
break;
|
|
8866
8866
|
default:
|
|
8867
|
-
|
|
8867
|
+
Oe(O, w);
|
|
8868
8868
|
}
|
|
8869
|
-
}),
|
|
8869
|
+
}), R.add(O), R === $ && X.push(O);
|
|
8870
8870
|
}
|
|
8871
|
-
function
|
|
8871
|
+
function Oe(R, g) {
|
|
8872
8872
|
if (!_.test(g))
|
|
8873
8873
|
throw N(g, "name");
|
|
8874
8874
|
T("=");
|
|
8875
|
-
var
|
|
8875
|
+
var O = te(S(), !0), b = {
|
|
8876
8876
|
options: void 0
|
|
8877
8877
|
};
|
|
8878
|
-
|
|
8878
|
+
b.getOption = function(w) {
|
|
8879
8879
|
return this.options[w];
|
|
8880
|
-
},
|
|
8881
|
-
t.prototype.setOption.call(
|
|
8882
|
-
},
|
|
8883
|
-
}, Z(
|
|
8880
|
+
}, b.setOption = function(w, q) {
|
|
8881
|
+
t.prototype.setOption.call(b, w, q);
|
|
8882
|
+
}, b.setParsedOption = function() {
|
|
8883
|
+
}, Z(b, function(q) {
|
|
8884
8884
|
if (q === "option")
|
|
8885
|
-
Q(
|
|
8885
|
+
Q(b, q), T(";");
|
|
8886
8886
|
else
|
|
8887
8887
|
throw N(q);
|
|
8888
8888
|
}, function() {
|
|
8889
|
-
se(
|
|
8890
|
-
}),
|
|
8889
|
+
se(b);
|
|
8890
|
+
}), R.add(g, O, b.comment, b.parsedOptions || b.options);
|
|
8891
8891
|
}
|
|
8892
|
-
function Q(
|
|
8893
|
-
var
|
|
8892
|
+
function Q(R, g) {
|
|
8893
|
+
var O, b, w = !0;
|
|
8894
8894
|
for (g === "option" && (g = S()); g !== "="; ) {
|
|
8895
8895
|
if (g === "(") {
|
|
8896
8896
|
var q = S();
|
|
@@ -8899,110 +8899,110 @@ function requireParse() {
|
|
|
8899
8899
|
if (w) {
|
|
8900
8900
|
if (w = !1, g.includes(".") && !g.includes("(")) {
|
|
8901
8901
|
var x = g.split(".");
|
|
8902
|
-
|
|
8902
|
+
O = x[0] + ".", g = x[1];
|
|
8903
8903
|
continue;
|
|
8904
8904
|
}
|
|
8905
|
-
|
|
8905
|
+
O = g;
|
|
8906
8906
|
} else
|
|
8907
|
-
|
|
8907
|
+
b = b ? b += g : g;
|
|
8908
8908
|
g = S();
|
|
8909
8909
|
}
|
|
8910
|
-
var G =
|
|
8911
|
-
|
|
8910
|
+
var G = b ? O.concat(b) : O, U = ce(R, G);
|
|
8911
|
+
b = b && b[0] === "." ? b.slice(1) : b, O = O && O[O.length - 1] === "." ? O.slice(0, -1) : O, Ae(R, O, U, b);
|
|
8912
8912
|
}
|
|
8913
|
-
function ce(
|
|
8913
|
+
function ce(R, g) {
|
|
8914
8914
|
if (T("{", !0)) {
|
|
8915
|
-
for (var
|
|
8915
|
+
for (var O = {}; !T("}", !0); ) {
|
|
8916
8916
|
if (!_.test(V = S()))
|
|
8917
8917
|
throw N(V, "name");
|
|
8918
8918
|
if (V === null)
|
|
8919
8919
|
throw N(V, "end of input");
|
|
8920
|
-
var
|
|
8921
|
-
if (T(":", !0),
|
|
8922
|
-
|
|
8923
|
-
else if (
|
|
8924
|
-
|
|
8920
|
+
var b, w = V;
|
|
8921
|
+
if (T(":", !0), M() === "{")
|
|
8922
|
+
b = ce(R, g + "." + V);
|
|
8923
|
+
else if (M() === "[") {
|
|
8924
|
+
b = [];
|
|
8925
8925
|
var q;
|
|
8926
8926
|
if (T("[", !0)) {
|
|
8927
8927
|
do
|
|
8928
|
-
q = ue(),
|
|
8928
|
+
q = ue(), b.push(q);
|
|
8929
8929
|
while (T(",", !0));
|
|
8930
|
-
T("]"), typeof q < "u" && fe(
|
|
8930
|
+
T("]"), typeof q < "u" && fe(R, g + "." + V, q);
|
|
8931
8931
|
}
|
|
8932
8932
|
} else
|
|
8933
|
-
|
|
8934
|
-
var x =
|
|
8935
|
-
x && (
|
|
8933
|
+
b = ue(), fe(R, g + "." + V, b);
|
|
8934
|
+
var x = O[w];
|
|
8935
|
+
x && (b = [].concat(x).concat(b)), O[w] = b, T(",", !0), T(";", !0);
|
|
8936
8936
|
}
|
|
8937
|
-
return
|
|
8937
|
+
return O;
|
|
8938
8938
|
}
|
|
8939
8939
|
var G = ue();
|
|
8940
|
-
return fe(
|
|
8940
|
+
return fe(R, g, G), G;
|
|
8941
8941
|
}
|
|
8942
|
-
function fe(
|
|
8943
|
-
if ($ ===
|
|
8944
|
-
z[g] =
|
|
8942
|
+
function fe(R, g, O) {
|
|
8943
|
+
if ($ === R && /^features\\./.test(g)) {
|
|
8944
|
+
z[g] = O;
|
|
8945
8945
|
return;
|
|
8946
8946
|
}
|
|
8947
|
-
|
|
8947
|
+
R.setOption && R.setOption(g, O);
|
|
8948
8948
|
}
|
|
8949
|
-
function
|
|
8950
|
-
|
|
8949
|
+
function Ae(R, g, O, b) {
|
|
8950
|
+
R.setParsedOption && R.setParsedOption(g, O, b);
|
|
8951
8951
|
}
|
|
8952
|
-
function se(
|
|
8952
|
+
function se(R) {
|
|
8953
8953
|
if (T("[", !0)) {
|
|
8954
8954
|
do
|
|
8955
|
-
Q(
|
|
8955
|
+
Q(R, "option");
|
|
8956
8956
|
while (T(",", !0));
|
|
8957
8957
|
T("]");
|
|
8958
8958
|
}
|
|
8959
|
-
return
|
|
8959
|
+
return R;
|
|
8960
8960
|
}
|
|
8961
|
-
function
|
|
8961
|
+
function be(R, g) {
|
|
8962
8962
|
if (!_.test(g = S()))
|
|
8963
8963
|
throw N(g, "service name");
|
|
8964
|
-
var
|
|
8965
|
-
Z(
|
|
8966
|
-
if (!ie(
|
|
8964
|
+
var O = new r(g);
|
|
8965
|
+
Z(O, function(w) {
|
|
8966
|
+
if (!ie(O, w))
|
|
8967
8967
|
if (w === "rpc")
|
|
8968
|
-
we(
|
|
8968
|
+
we(O, w);
|
|
8969
8969
|
else
|
|
8970
8970
|
throw N(w);
|
|
8971
|
-
}),
|
|
8971
|
+
}), R.add(O), R === $ && X.push(O);
|
|
8972
8972
|
}
|
|
8973
|
-
function we(
|
|
8974
|
-
var
|
|
8973
|
+
function we(R, g) {
|
|
8974
|
+
var O = k(), b = g;
|
|
8975
8975
|
if (!_.test(g = S()))
|
|
8976
8976
|
throw N(g, "name");
|
|
8977
|
-
var w = g, q, x, G,
|
|
8978
|
-
if (T("("), T("stream", !0) && (x = !0), !
|
|
8977
|
+
var w = g, q, x, G, U;
|
|
8978
|
+
if (T("("), T("stream", !0) && (x = !0), !A.test(g = S()) || (q = g, T(")"), T("returns"), T("("), T("stream", !0) && (U = !0), !A.test(g = S())))
|
|
8979
8979
|
throw N(g);
|
|
8980
8980
|
G = g, T(")");
|
|
8981
|
-
var oe = new i(w,
|
|
8982
|
-
oe.comment =
|
|
8981
|
+
var oe = new i(w, b, q, G, x, U);
|
|
8982
|
+
oe.comment = O, Z(oe, function(le) {
|
|
8983
8983
|
if (le === "option")
|
|
8984
8984
|
Q(oe, le), T(";");
|
|
8985
8985
|
else
|
|
8986
8986
|
throw N(le);
|
|
8987
|
-
}),
|
|
8987
|
+
}), R.add(oe);
|
|
8988
8988
|
}
|
|
8989
|
-
function Se(
|
|
8990
|
-
if (!
|
|
8989
|
+
function Se(R, g) {
|
|
8990
|
+
if (!A.test(g = S()))
|
|
8991
8991
|
throw N(g, "reference");
|
|
8992
|
-
var
|
|
8992
|
+
var O = g;
|
|
8993
8993
|
Z(null, function(w) {
|
|
8994
8994
|
switch (w) {
|
|
8995
8995
|
case "required":
|
|
8996
8996
|
case "repeated":
|
|
8997
|
-
Y(
|
|
8997
|
+
Y(R, w, O);
|
|
8998
8998
|
break;
|
|
8999
8999
|
case "optional":
|
|
9000
|
-
|
|
9000
|
+
D === "proto3" ? Y(R, "proto3_optional", O) : Y(R, "optional", O);
|
|
9001
9001
|
break;
|
|
9002
9002
|
default:
|
|
9003
|
-
if (
|
|
9003
|
+
if (D === "proto2" || !A.test(w))
|
|
9004
9004
|
throw N(w);
|
|
9005
|
-
J(w), Y(
|
|
9005
|
+
J(w), Y(R, "optional", O);
|
|
9006
9006
|
break;
|
|
9007
9007
|
}
|
|
9008
9008
|
});
|
|
@@ -9010,22 +9010,22 @@ function requireParse() {
|
|
|
9010
9010
|
for (var V; (V = S()) !== null; )
|
|
9011
9011
|
switch (V) {
|
|
9012
9012
|
case "package":
|
|
9013
|
-
if (!
|
|
9013
|
+
if (!P)
|
|
9014
9014
|
throw N(V);
|
|
9015
9015
|
ye();
|
|
9016
9016
|
break;
|
|
9017
9017
|
case "import":
|
|
9018
|
-
if (!
|
|
9018
|
+
if (!P)
|
|
9019
9019
|
throw N(V);
|
|
9020
9020
|
me();
|
|
9021
9021
|
break;
|
|
9022
9022
|
case "syntax":
|
|
9023
|
-
if (!
|
|
9023
|
+
if (!P)
|
|
9024
9024
|
throw N(V);
|
|
9025
9025
|
ve();
|
|
9026
9026
|
break;
|
|
9027
9027
|
case "edition":
|
|
9028
|
-
if (!
|
|
9028
|
+
if (!P)
|
|
9029
9029
|
throw N(V);
|
|
9030
9030
|
ge();
|
|
9031
9031
|
break;
|
|
@@ -9034,7 +9034,7 @@ function requireParse() {
|
|
|
9034
9034
|
break;
|
|
9035
9035
|
default:
|
|
9036
9036
|
if (ie($, V)) {
|
|
9037
|
-
|
|
9037
|
+
P = !1;
|
|
9038
9038
|
continue;
|
|
9039
9039
|
}
|
|
9040
9040
|
throw N(V);
|
|
@@ -9378,8 +9378,8 @@ var protobufjs, hasRequiredProtobufjs;
|
|
|
9378
9378
|
function requireProtobufjs() {
|
|
9379
9379
|
return hasRequiredProtobufjs || (hasRequiredProtobufjs = 1, protobufjs = requireSrc()), protobufjs;
|
|
9380
9380
|
}
|
|
9381
|
-
var protobufjsExports = requireProtobufjs(), StateStreamErrorCode = /* @__PURE__ */ ((u) => (u.CONNECTION_FAILED = "CONNECTION_FAILED", u.RECONNECT_FAILED = "RECONNECT_FAILED", u.CONNECTION_LOST = "CONNECTION_LOST", u.CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT", u.AUTH_FAILED = "AUTH_FAILED", u.AUTH_REFRESH_FAILED = "AUTH_REFRESH_FAILED", u.DEVICE_ERROR = "DEVICE_ERROR", u.DECODE_ERROR = "DECODE_ERROR", u.FRAME_PROCESS_ERROR = "FRAME_PROCESS_ERROR", u.STREAM_ALREADY_STARTED = "STREAM_ALREADY_STARTED", u.WORKER_INIT_FAILED = "WORKER_INIT_FAILED", u.UNKNOWN_ERROR = "UNKNOWN_ERROR", u))(StateStreamErrorCode || {}), ConnectionStatus = /* @__PURE__ */ ((u) => (u.DISCONNECTED = "DISCONNECTED", u.CONNECTING = "CONNECTING", u.CONNECTED = "CONNECTED", u.RECONNECTING = "RECONNECTING", u))(ConnectionStatus || {}), AuthStatus = /* @__PURE__ */ ((u) => (u.UNAUTHENTICATED = "UNAUTHENTICATED", u.AUTHENTICATING = "AUTHENTICATING", u.AUTHENTICATED = "AUTHENTICATED", u.FAILED = "FAILED", u))(AuthStatus || {});
|
|
9382
|
-
const nested = { BSB_State: { nested: { StateUpdate: { oneofs: { state: { oneof: ["deviceName", "power", "brightness", "audioVolume", "wifi", "updateState", "updateCheck", "timezone", "matter", "frame", "input", "timer", "ble", "autoUpdateState"] } }, fields: { deviceName: { type: "BSB_State.DeviceName", id: 1 }, power: { type: "BSB_State.Power", id: 2 }, brightness: { type: "BSB_State.Brightness", id: 3 }, audioVolume: { type: "BSB_State.AudioVolume", id: 4 }, wifi: { type: "BSB_State.Wifi", id: 5 }, updateState: { type: "BSB_Update.UpdateState", id: 6 }, updateCheck: { type: "BSB_Update.CheckState", id: 7 }, timezone: { type: "BSB_State.Timezone", id: 8 }, matter: { type: "BSB_State.Matter", id: 9 }, frame: { type: "BSB_Frame.Frame", id: 10 }, input: { type: "BSB_Input.InputEvent", id: 11 }, timer: { type: "BSB_Timer.Timer", id: 12 }, ble: { type: "BSB_State.Ble.Ble", id: 13 }, autoUpdateState: { type: "BSB_Update.AutoUpdateState", id: 14 } } }, State: { oneofs: { _error: { oneof: ["error"] } }, fields: { timestamp: { type: "fixed64", id: 1 }, updates: { rule: "repeated", type: "StateUpdate", id: 2 }, error: { type: "BSB_Error.Error", id: 3, options: { proto3_optional: !0 } } } }, DeviceName: { fields: { name: { type: "string", id: 1 } } }, BrightnessAutomatic: { fields: {} }, BrightnessManual: { fields: { brightness: { type: "uint32", id: 1 } } }, Brightness: { oneofs: { setting: { oneof: ["automatic", "manual"] } }, fields: { automatic: { type: "BrightnessAutomatic", id: 1 }, manual: { type: "BrightnessManual", id: 2 }, actualBrightness: { type: "uint32", id: 3 } } }, BatteryStatus: { values: { DISCHARGING: 0, CHARGING: 1, CHARGED: 2 } }, UnknownPowerState: { fields: {} }, PowerState: { fields: { batteryStatus: { type: "BatteryStatus", id: 1 }, batteryChargePercent: { type: "uint32", id: 2 }, batteryVoltageMv: { type: "uint32", id: 3 }, batteryCurrentMa: { type: "sint32", id: 4 }, usbVoltageMv: { type: "uint32", id: 5 } } }, Power: { oneofs: { state: { oneof: ["unknown", "known"] } }, fields: { unknown: { type: "UnknownPowerState", id: 1 }, known: { type: "PowerState", id: 2 } } }, AudioVolume: { fields: { volume: { type: "uint32", id: 1 } } }, WifiConnectionStatus: { values: { CONNECTED: 0, CONNECTING: 1, DISCONNECTING: 2, RECONNECTING: 3 } }, WifiSecurity: { values: { UNKNOWN: 0, OPEN: 1, WPA: 2, WPA2: 3, WEP: 4, WPA_WPA2: 5, WPA3: 6, WPA2_WPA3: 7 } }, IpConfigurationMethod: { values: { DHCP: 0, STATIC: 1 } }, IpProtocol: { values: { IPV4: 0, IPV6: 1 } }, WifiStateUnknown: { fields: {} }, WifiStateDisconnected: { fields: {} }, WifiStateConnected: { fields: { status: { type: "WifiConnectionStatus", id: 1 }, ssid: { type: "string", id: 2 }, bssid: { type: "string", id: 3 }, channel: { type: "uint32", id: 4 }, rssi: { type: "sint32", id: 5 }, security: { type: "WifiSecurity", id: 6 } } }, IpAddress: { fields: { protocol: { type: "IpProtocol", id: 1 }, method: { type: "IpConfigurationMethod", id: 2 }, address: { type: "string", id: 3 }, gateway: { type: "string", id: 4 }, netmask: { type: "string", id: 5 } } }, Wifi: { oneofs: { wifiState: { oneof: ["unknown", "disconnected", "connected"] } }, fields: { unknown: { type: "WifiStateUnknown", id: 1 }, disconnected: { type: "WifiStateDisconnected", id: 2 }, connected: { type: "WifiStateConnected", id: 3 }, ipAddresses: { rule: "repeated", type: "IpAddress", id: 4 } } }, Timezone: { fields: { name: { type: "string", id: 1 }, offset: { type: "sint32", id: 2 }, abbr: { type: "string", id: 3 } } }, MatterCommissioningStatus: { values: { NEVER_STARTED: 0, STARTED: 1, COMPLETED_SUCCESSFULLY: 2, FAILED: 3 } }, MatterCommissioningState: { fields: { status: { type: "MatterCommissioningStatus", id: 1 }, timestamp: { type: "fixed64", id: 2 } } }, Matter: { fields: { fabricCount: { type: "uint32", id: 1 }, state: { type: "MatterCommissioningState", id: 2 } } }, Ble: { nested: { ServiceStatus: { values: { RESET: 0, INITIALIZATION: 1, READY: 2, ADVERTISING: 3, CONNECTABLE: 4, CONNECTED: 5, ERROR: 6 } }, Ble: { oneofs: { _remoteAddress: { oneof: ["remoteAddress"] } }, fields: { status: { type: "ServiceStatus", id: 1 }, remoteAddress: { type: "string", id: 2, options: { proto3_optional: !0 } } } } } } } }, BSB_Update: { nested: { UpdateEvent: { values: { SESSION_START: 0, SESSION_STOP: 1, ACTION_BEGIN: 2, ACTION_DONE: 3, DETAIL_CHANGE: 4, ACTION_PROGRESS: 5, EVENT_NONE: 6 } }, UpdateAction: { values: { DOWNLOAD: 0, SHA_VERIFICATION: 1, UNPACK: 2, INSTALLATION_PREPARE: 3, INSTALLATION_APPLY: 4, ACTION_NONE: 5 } }, UpdateStatus: { values: { OK: 0, BATTERY_LOW: 1, BUSY: 2, DOWNLOAD_FAILURE: 3, DOWNLOAD_ABORT: 4, SHA_MISMATCH: 5, UNPACK_CREATE_STAGING_DIRECTORY_FAILURE: 6, UNPACK_ARCHIVE_OPEN_FAILURE: 7, UNPACK_ARCHIVE_UNPACK_FAILURE: 8, INSTALLATION_PREPARE_MANIFEST_NOT_FOUND: 9, INSTALLATION_PREPARE_MANIFEST_INVALID: 10, INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE: 11, INSTALLATION_PREPARE_POINTER_SETUP_FAILURE: 12, UNKNOWN_FAILURE: 13 } }, CheckError: { values: { NOT_AVAILABLE: 0, FAILURE: 1, IDLE: 2 } }, UpdateAvailable: { fields: { version: { type: "string", id: 1 } } }, UpdateUnavailable: { fields: { reason: { type: "CheckError", id: 1 } } }, UpdateState: { fields: { event: { type: "UpdateEvent", id: 1 }, action: { type: "UpdateAction", id: 2 }, status: { type: "UpdateStatus", id: 3 } } }, CheckState: { oneofs: { status: { oneof: ["available", "unavailable"] } }, fields: { available: { type: "UpdateAvailable", id: 1 }, unavailable: { type: "UpdateUnavailable", id: 2 } } }, AutoUpdateInterval: { fields: { start: { type: "uint32", id: 1 }, end: { type: "uint32", id: 2 } } }, AutoUpdateState: { fields: { enabled: { type: "bool", id: 1 }, interval: { type: "AutoUpdateInterval", id: 2 } } } } }, BSB_Frame: { nested: { Encoding: { values: { PLAIN: 0, RUN_LENGTH: 1, DEFLATE: 2, DEFLATE_RUN_LENGTH: 3 } }, PixelFormat: { values: { RGB888: 0, L8: 1, L4: 2 } }, Screen: { values: { FRONT: 0, BACK: 1 } }, Frame: { fields: { screen: { type: "Screen", id: 1 }, width: { type: "uint32", id: 2 }, height: { type: "uint32", id: 3 }, encoding: { type: "Encoding", id: 4 }, pixelFormat: { type: "PixelFormat", id: 5 }, data: { type: "bytes", id: 6 } } } } }, BSB_Timer: { nested: { Timer: { fields: { json: { type: "BSB_Util.Json", id: 1 } } } } }, BSB_Util: { nested: { Compression: { values: { PLAIN: 0, GZIP: 1 } }, Json: { fields: { compression: { type: "Compression", id: 1 }, data: { type: "bytes", id: 2 } } } } }, BSB_Input: { nested: { Button: { values: { OK: 0, BACK: 1, START: 2 } }, ButtonAction: { values: { PRESS: 0, RELEASE: 1 } }, SwitchPosition: { values: { BUSY: 0, CUSTOM: 1, OFF: 2, APPS: 3, SETTINGS: 4 } }, ButtonEvent: { fields: { button: { type: "Button", id: 1 }, action: { type: "ButtonAction", id: 2 } } }, SwitchEvent: { fields: { position: { type: "SwitchPosition", id: 1 } } }, EncoderEvent: { fields: { delta: { type: "sint32", id: 1 } } }, InputEvent: { oneofs: { event: { oneof: ["buttonEvent", "switchEvent", "encoderEvent"] } }, fields: { buttonEvent: { type: "ButtonEvent", id: 1 }, switchEvent: { type: "SwitchEvent", id: 2 }, encoderEvent: { type: "EncoderEvent", id: 3 } } } } }, BSB_Error: { nested: { Cause: { values: { RESOURCE_LIMIT: 0 } }, Severity: { values: { FATAL: 0, ERROR: 1, WARNING: 2 } }, Error: { fields: { cause: { type: "Cause", id: 1 }, severity: { type: "Severity", id: 2 } } } } } };
|
|
9381
|
+
var protobufjsExports = requireProtobufjs(), StateStreamErrorCode = /* @__PURE__ */ ((u) => (u.CONNECTION_FAILED = "CONNECTION_FAILED", u.RECONNECT_FAILED = "RECONNECT_FAILED", u.CONNECTION_LOST = "CONNECTION_LOST", u.CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT", u.AUTH_FAILED = "AUTH_FAILED", u.AUTH_REFRESH_FAILED = "AUTH_REFRESH_FAILED", u.DEVICE_ERROR = "DEVICE_ERROR", u.DECODE_ERROR = "DECODE_ERROR", u.FRAME_PROCESS_ERROR = "FRAME_PROCESS_ERROR", u.STREAM_ALREADY_STARTED = "STREAM_ALREADY_STARTED", u.WORKER_INIT_FAILED = "WORKER_INIT_FAILED", u.UNKNOWN_ERROR = "UNKNOWN_ERROR", u))(StateStreamErrorCode || {}), ConnectionStatus = /* @__PURE__ */ ((u) => (u.DISCONNECTED = "DISCONNECTED", u.CONNECTING = "CONNECTING", u.CONNECTED = "CONNECTED", u.RECONNECTING = "RECONNECTING", u))(ConnectionStatus || {}), AuthStatus = /* @__PURE__ */ ((u) => (u.UNAUTHENTICATED = "UNAUTHENTICATED", u.AUTHENTICATING = "AUTHENTICATING", u.AUTHENTICATED = "AUTHENTICATED", u.REAUTHENTICATING = "REAUTHENTICATING", u.FAILED = "FAILED", u))(AuthStatus || {});
|
|
9382
|
+
const DEFAULT_MAX_RECONNECT_ATTEMPTS = 5, DEFAULT_MAX_AUTH_ATTEMPTS = 5, nested = { BSB_State: { nested: { StateUpdate: { oneofs: { state: { oneof: ["deviceName", "power", "brightness", "audioVolume", "wifi", "updateState", "updateCheck", "timezone", "matter", "frame", "input", "timer", "ble", "autoUpdateState"] } }, fields: { deviceName: { type: "BSB_State.DeviceName", id: 1 }, power: { type: "BSB_State.Power", id: 2 }, brightness: { type: "BSB_State.Brightness", id: 3 }, audioVolume: { type: "BSB_State.AudioVolume", id: 4 }, wifi: { type: "BSB_State.Wifi", id: 5 }, updateState: { type: "BSB_Update.UpdateState", id: 6 }, updateCheck: { type: "BSB_Update.CheckState", id: 7 }, timezone: { type: "BSB_State.Timezone", id: 8 }, matter: { type: "BSB_State.Matter", id: 9 }, frame: { type: "BSB_Frame.Frame", id: 10 }, input: { type: "BSB_Input.InputEvent", id: 11 }, timer: { type: "BSB_Timer.Timer", id: 12 }, ble: { type: "BSB_State.Ble.Ble", id: 13 }, autoUpdateState: { type: "BSB_Update.AutoUpdateState", id: 14 } } }, State: { oneofs: { _error: { oneof: ["error"] } }, fields: { timestamp: { type: "fixed64", id: 1 }, updates: { rule: "repeated", type: "StateUpdate", id: 2 }, error: { type: "BSB_Error.Error", id: 3, options: { proto3_optional: !0 } } } }, DeviceName: { fields: { name: { type: "string", id: 1 } } }, BrightnessAutomatic: { fields: {} }, BrightnessManual: { fields: { brightness: { type: "uint32", id: 1 } } }, Brightness: { oneofs: { setting: { oneof: ["automatic", "manual"] } }, fields: { automatic: { type: "BrightnessAutomatic", id: 1 }, manual: { type: "BrightnessManual", id: 2 }, actualBrightness: { type: "uint32", id: 3 } } }, BatteryStatus: { values: { DISCHARGING: 0, CHARGING: 1, CHARGED: 2 } }, UnknownPowerState: { fields: {} }, PowerState: { fields: { batteryStatus: { type: "BatteryStatus", id: 1 }, batteryChargePercent: { type: "uint32", id: 2 }, batteryVoltageMv: { type: "uint32", id: 3 }, batteryCurrentMa: { type: "sint32", id: 4 }, usbVoltageMv: { type: "uint32", id: 5 } } }, Power: { oneofs: { state: { oneof: ["unknown", "known"] } }, fields: { unknown: { type: "UnknownPowerState", id: 1 }, known: { type: "PowerState", id: 2 } } }, AudioVolume: { fields: { volume: { type: "uint32", id: 1 } } }, WifiConnectionStatus: { values: { CONNECTED: 0, CONNECTING: 1, DISCONNECTING: 2, RECONNECTING: 3 } }, WifiSecurity: { values: { UNKNOWN: 0, OPEN: 1, WPA: 2, WPA2: 3, WEP: 4, WPA_WPA2: 5, WPA3: 6, WPA2_WPA3: 7 } }, IpConfigurationMethod: { values: { DHCP: 0, STATIC: 1 } }, IpProtocol: { values: { IPV4: 0, IPV6: 1 } }, WifiStateUnknown: { fields: {} }, WifiStateDisconnected: { fields: {} }, WifiStateConnected: { fields: { status: { type: "WifiConnectionStatus", id: 1 }, ssid: { type: "string", id: 2 }, bssid: { type: "string", id: 3 }, channel: { type: "uint32", id: 4 }, rssi: { type: "sint32", id: 5 }, security: { type: "WifiSecurity", id: 6 } } }, IpAddress: { fields: { protocol: { type: "IpProtocol", id: 1 }, method: { type: "IpConfigurationMethod", id: 2 }, address: { type: "string", id: 3 }, gateway: { type: "string", id: 4 }, netmask: { type: "string", id: 5 } } }, Wifi: { oneofs: { wifiState: { oneof: ["unknown", "disconnected", "connected"] } }, fields: { unknown: { type: "WifiStateUnknown", id: 1 }, disconnected: { type: "WifiStateDisconnected", id: 2 }, connected: { type: "WifiStateConnected", id: 3 }, ipAddresses: { rule: "repeated", type: "IpAddress", id: 4 } } }, Timezone: { fields: { name: { type: "string", id: 1 }, offset: { type: "sint32", id: 2 }, abbr: { type: "string", id: 3 } } }, MatterCommissioningStatus: { values: { NEVER_STARTED: 0, STARTED: 1, COMPLETED_SUCCESSFULLY: 2, FAILED: 3 } }, MatterCommissioningState: { fields: { status: { type: "MatterCommissioningStatus", id: 1 }, timestamp: { type: "fixed64", id: 2 } } }, Matter: { fields: { fabricCount: { type: "uint32", id: 1 }, state: { type: "MatterCommissioningState", id: 2 } } }, Ble: { nested: { ServiceStatus: { values: { RESET: 0, INITIALIZATION: 1, READY: 2, ADVERTISING: 3, CONNECTABLE: 4, CONNECTED: 5, ERROR: 6 } }, Ble: { oneofs: { _remoteAddress: { oneof: ["remoteAddress"] } }, fields: { status: { type: "ServiceStatus", id: 1 }, remoteAddress: { type: "string", id: 2, options: { proto3_optional: !0 } } } } } } } }, BSB_Update: { nested: { UpdateEvent: { values: { SESSION_START: 0, SESSION_STOP: 1, ACTION_BEGIN: 2, ACTION_DONE: 3, DETAIL_CHANGE: 4, ACTION_PROGRESS: 5, EVENT_NONE: 6 } }, UpdateAction: { values: { DOWNLOAD: 0, SHA_VERIFICATION: 1, UNPACK: 2, INSTALLATION_PREPARE: 3, INSTALLATION_APPLY: 4, ACTION_NONE: 5 } }, UpdateStatus: { values: { OK: 0, BATTERY_LOW: 1, BUSY: 2, DOWNLOAD_FAILURE: 3, DOWNLOAD_ABORT: 4, SHA_MISMATCH: 5, UNPACK_CREATE_STAGING_DIRECTORY_FAILURE: 6, UNPACK_ARCHIVE_OPEN_FAILURE: 7, UNPACK_ARCHIVE_UNPACK_FAILURE: 8, INSTALLATION_PREPARE_MANIFEST_NOT_FOUND: 9, INSTALLATION_PREPARE_MANIFEST_INVALID: 10, INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE: 11, INSTALLATION_PREPARE_POINTER_SETUP_FAILURE: 12, UNKNOWN_FAILURE: 13 } }, CheckError: { values: { NOT_AVAILABLE: 0, FAILURE: 1, IDLE: 2 } }, UpdateAvailable: { fields: { version: { type: "string", id: 1 } } }, UpdateUnavailable: { fields: { reason: { type: "CheckError", id: 1 } } }, UpdateState: { fields: { event: { type: "UpdateEvent", id: 1 }, action: { type: "UpdateAction", id: 2 }, status: { type: "UpdateStatus", id: 3 } } }, CheckState: { oneofs: { status: { oneof: ["available", "unavailable"] } }, fields: { available: { type: "UpdateAvailable", id: 1 }, unavailable: { type: "UpdateUnavailable", id: 2 } } }, AutoUpdateInterval: { fields: { start: { type: "uint32", id: 1 }, end: { type: "uint32", id: 2 } } }, AutoUpdateState: { fields: { enabled: { type: "bool", id: 1 }, interval: { type: "AutoUpdateInterval", id: 2 } } } } }, BSB_Frame: { nested: { Encoding: { values: { PLAIN: 0, RUN_LENGTH: 1, DEFLATE: 2, DEFLATE_RUN_LENGTH: 3 } }, PixelFormat: { values: { RGB888: 0, L8: 1, L4: 2 } }, Screen: { values: { FRONT: 0, BACK: 1 } }, Frame: { fields: { screen: { type: "Screen", id: 1 }, width: { type: "uint32", id: 2 }, height: { type: "uint32", id: 3 }, encoding: { type: "Encoding", id: 4 }, pixelFormat: { type: "PixelFormat", id: 5 }, data: { type: "bytes", id: 6 } } } } }, BSB_Timer: { nested: { Timer: { fields: { json: { type: "BSB_Util.Json", id: 1 } } } } }, BSB_Util: { nested: { Compression: { values: { PLAIN: 0, GZIP: 1 } }, Json: { fields: { compression: { type: "Compression", id: 1 }, data: { type: "bytes", id: 2 } } } } }, BSB_Input: { nested: { Button: { values: { OK: 0, BACK: 1, START: 2 } }, ButtonAction: { values: { PRESS: 0, RELEASE: 1 } }, SwitchPosition: { values: { BUSY: 0, CUSTOM: 1, OFF: 2, APPS: 3, SETTINGS: 4 } }, ButtonEvent: { fields: { button: { type: "Button", id: 1 }, action: { type: "ButtonAction", id: 2 } } }, SwitchEvent: { fields: { position: { type: "SwitchPosition", id: 1 } } }, EncoderEvent: { fields: { delta: { type: "sint32", id: 1 } } }, InputEvent: { oneofs: { event: { oneof: ["buttonEvent", "switchEvent", "encoderEvent"] } }, fields: { buttonEvent: { type: "ButtonEvent", id: 1 }, switchEvent: { type: "SwitchEvent", id: 2 }, encoderEvent: { type: "EncoderEvent", id: 3 } } } } }, BSB_Error: { nested: { Cause: { values: { RESOURCE_LIMIT: 0 } }, Severity: { values: { FATAL: 0, ERROR: 1, WARNING: 2 } }, Error: { fields: { cause: { type: "Cause", id: 1 }, severity: { type: "Severity", id: 2 } } } } } };
|
|
9383
9383
|
var bundle = {
|
|
9384
9384
|
nested
|
|
9385
9385
|
};
|
|
@@ -9474,8 +9474,8 @@ async function processFrame(u) {
|
|
|
9474
9474
|
return new Uint8ClampedArray(u.width * u.height * 4);
|
|
9475
9475
|
}
|
|
9476
9476
|
}
|
|
9477
|
-
const root = protobufjsExports.Root.fromJSON(bundle), StateType = root.lookupType("BSB_State.State"), AUTH_CODE = 3e3, RECONNECT_CODES = /* @__PURE__ */ new Set([1001, 1006, 1012, 1013, 1014, 3008])
|
|
9478
|
-
let socket = null, isBinaryMode = !0, currentMode = "local", currentToken, currentAddr = "", retryCount = 0, authRetryCount = 0, isAuthReported = !1, stabilityTimeout;
|
|
9477
|
+
const root = protobufjsExports.Root.fromJSON(bundle), StateType = root.lookupType("BSB_State.State"), AUTH_CODE = 3e3, RECONNECT_CODES = /* @__PURE__ */ new Set([1001, 1006, 1012, 1013, 1014, 3008]);
|
|
9478
|
+
let maxAuthAttempts = DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = DEFAULT_MAX_RECONNECT_ATTEMPTS, socket = null, isBinaryMode = !0, currentMode = "local", currentToken, currentAddr = "", retryCount = 0, authRetryCount = 0, isAuthReported = !1, stabilityTimeout;
|
|
9479
9479
|
const activePorts = /* @__PURE__ */ new Set(), subscriptions = /* @__PURE__ */ new Map();
|
|
9480
9480
|
let processingQueue = Promise.resolve();
|
|
9481
9481
|
function broadcast(u) {
|
|
@@ -9580,25 +9580,25 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
9580
9580
|
return;
|
|
9581
9581
|
}
|
|
9582
9582
|
if (n.code === AUTH_CODE && currentMode === "remote") {
|
|
9583
|
-
authRetryCount <
|
|
9583
|
+
authRetryCount < maxAuthAttempts ? (authRetryCount++, console.warn(\`[Worker] Auth failed (3000). Requesting new token... (Attempt \${authRetryCount}/\${maxAuthAttempts})\`), broadcast({ type: "TOKEN_EXPIRED" }), broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.REAUTHENTICATING, authAttempts: authRetryCount })) : (broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.FAILED }), broadcast({
|
|
9584
9584
|
type: "ERROR",
|
|
9585
9585
|
code: StateStreamErrorCode.AUTH_FAILED,
|
|
9586
|
-
message: \`Maximum authentication attempts (\${
|
|
9586
|
+
message: \`Maximum authentication attempts (\${maxAuthAttempts}) reached. Please log in again.\`
|
|
9587
9587
|
}));
|
|
9588
9588
|
return;
|
|
9589
9589
|
}
|
|
9590
|
-
if (
|
|
9591
|
-
if (retryCount <
|
|
9590
|
+
if (RECONNECT_CODES.has(n.code)) {
|
|
9591
|
+
if (retryCount < maxReconnectAttempts) {
|
|
9592
9592
|
retryCount++;
|
|
9593
9593
|
const e = Math.min(1e3 * retryCount, 5e3);
|
|
9594
|
-
console.log(\`[Worker] Reconnecting (network code: \${n.code}) in \${e}ms... (Attempt \${retryCount}/\${
|
|
9594
|
+
console.log(\`[Worker] Reconnecting (network code: \${n.code}) in \${e}ms... (Attempt \${retryCount}/\${maxReconnectAttempts})\`), broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.RECONNECTING, connectionAttempts: retryCount }), setTimeout(() => {
|
|
9595
9595
|
activePorts.size > 0 && socket && connect(currentAddr, currentToken, isBinaryMode, currentMode);
|
|
9596
9596
|
}, e);
|
|
9597
9597
|
} else
|
|
9598
9598
|
broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.DISCONNECTED }), broadcast({
|
|
9599
9599
|
type: "ERROR",
|
|
9600
9600
|
code: StateStreamErrorCode.RECONNECT_FAILED,
|
|
9601
|
-
message: \`Maximum reconnection attempts (\${
|
|
9601
|
+
message: \`Maximum reconnection attempts (\${maxReconnectAttempts}) reached. Connection lost.\`
|
|
9602
9602
|
});
|
|
9603
9603
|
return;
|
|
9604
9604
|
}
|
|
@@ -9612,7 +9612,7 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
9612
9612
|
function handleCommand(u, f) {
|
|
9613
9613
|
switch (u.type) {
|
|
9614
9614
|
case "START":
|
|
9615
|
-
activePorts.add(f), socket && socket.readyState === WebSocket.OPEN && currentAddr === u.addr ? (f.postMessage({ type: "CONNECTED" }), f.postMessage({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED })) : connect(u.addr, u.token, u.isBinary, u.mode);
|
|
9615
|
+
maxAuthAttempts = u.maxAuthAttempts ?? DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = u.maxReconnectAttempts ?? DEFAULT_MAX_RECONNECT_ATTEMPTS, activePorts.add(f), socket && socket.readyState === WebSocket.OPEN && currentAddr === u.addr ? (f.postMessage({ type: "CONNECTED" }), f.postMessage({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED })) : connect(u.addr, u.token, u.isBinary, u.mode);
|
|
9616
9616
|
break;
|
|
9617
9617
|
case "STOP":
|
|
9618
9618
|
activePorts.delete(f);
|
|
@@ -9654,35 +9654,37 @@ if ("SharedWorkerGlobalScope" in self) {
|
|
|
9654
9654
|
};
|
|
9655
9655
|
}
|
|
9656
9656
|
`;
|
|
9657
|
-
function
|
|
9657
|
+
function _e(e) {
|
|
9658
9658
|
return new SharedWorker(
|
|
9659
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
9659
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Ee),
|
|
9660
9660
|
{
|
|
9661
9661
|
type: "module",
|
|
9662
9662
|
name: e == null ? void 0 : e.name
|
|
9663
9663
|
}
|
|
9664
9664
|
);
|
|
9665
9665
|
}
|
|
9666
|
-
const
|
|
9666
|
+
const g = class g {
|
|
9667
9667
|
constructor(n, t) {
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9668
|
+
u(this, "addr");
|
|
9669
|
+
u(this, "token");
|
|
9670
|
+
u(this, "isBinary");
|
|
9671
|
+
u(this, "connectTimeout");
|
|
9672
|
+
u(this, "dataTimeout");
|
|
9673
|
+
u(this, "maxReconnectAttempts");
|
|
9674
|
+
u(this, "maxAuthAttempts");
|
|
9675
|
+
u(this, "worker", null);
|
|
9676
|
+
u(this, "connectionTimer", null);
|
|
9677
|
+
u(this, "dataTimer", null);
|
|
9678
|
+
u(this, "_status");
|
|
9677
9679
|
// Callbacks
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
this.addr = n.addr || "", this.token = n.token, this.isBinary = n.isBinary ?? !0, this.connectTimeout = (t == null ? void 0 : t.timeout) ?? 5e3, this.dataTimeout = (t == null ? void 0 : t.dataTimeout) ?? 15e3, this._status = {
|
|
9680
|
+
u(this, "dataCallback");
|
|
9681
|
+
u(this, "rawDataCallback");
|
|
9682
|
+
u(this, "errorCallback");
|
|
9683
|
+
u(this, "statusCallback");
|
|
9684
|
+
this.addr = n.addr || "", this.token = n.token, this.isBinary = n.isBinary ?? !0, this.connectTimeout = (t == null ? void 0 : t.timeout) ?? 5e3, this.dataTimeout = (t == null ? void 0 : t.dataTimeout) ?? 15e3, this.maxReconnectAttempts = (t == null ? void 0 : t.maxReconnectAttempts) ?? ge, this.maxAuthAttempts = L, this._status = {
|
|
9683
9685
|
main: { status: d.IDLE },
|
|
9684
9686
|
connection: { status: m.DISCONNECTED },
|
|
9685
|
-
auth: { status:
|
|
9687
|
+
auth: { status: v.UNAUTHENTICATED },
|
|
9686
9688
|
data: { status: E.NONE },
|
|
9687
9689
|
worker: { status: _.OFF }
|
|
9688
9690
|
};
|
|
@@ -9732,7 +9734,9 @@ const v = class v {
|
|
|
9732
9734
|
addr: this.normalizeUrl(this.addr),
|
|
9733
9735
|
token: this.token,
|
|
9734
9736
|
isBinary: this.isBinary,
|
|
9735
|
-
mode: this.streamMode
|
|
9737
|
+
mode: this.streamMode,
|
|
9738
|
+
maxReconnectAttempts: this.maxReconnectAttempts,
|
|
9739
|
+
maxAuthAttempts: this.maxAuthAttempts
|
|
9736
9740
|
}), this.clearConnectionTimer(), this.connectionTimer = setTimeout(() => {
|
|
9737
9741
|
const o = new y(c.CONNECTION_TIMEOUT, `Connection timed out after ${this.connectTimeout}ms`);
|
|
9738
9742
|
this.mapErrorToStatus(o), this.errorCallback && this.errorCallback(o), this.stop();
|
|
@@ -9777,7 +9781,7 @@ const v = class v {
|
|
|
9777
9781
|
const n = btoa(this.addr);
|
|
9778
9782
|
try {
|
|
9779
9783
|
if (this.updateStatusComponent("worker", { status: _.INITIALIZING, lastError: void 0 }), window.SharedWorker) {
|
|
9780
|
-
const t = new
|
|
9784
|
+
const t = new _e({
|
|
9781
9785
|
name: n
|
|
9782
9786
|
});
|
|
9783
9787
|
this.worker = {
|
|
@@ -9786,7 +9790,7 @@ const v = class v {
|
|
|
9786
9790
|
this.handleWorkerMessage(r.data);
|
|
9787
9791
|
}, t.port.start();
|
|
9788
9792
|
} else {
|
|
9789
|
-
const t = new
|
|
9793
|
+
const t = new be();
|
|
9790
9794
|
this.worker = {
|
|
9791
9795
|
port: t,
|
|
9792
9796
|
terminate: () => t.terminate()
|
|
@@ -9815,7 +9819,20 @@ const v = class v {
|
|
|
9815
9819
|
this.clearConnectionTimer(), this.updateStatusComponent("connection", { status: m.CONNECTED }), this.streamMode === "local" && this.updateStatusComponent("main", { status: d.RUNNING });
|
|
9816
9820
|
break;
|
|
9817
9821
|
case "STATUS_UPDATE":
|
|
9818
|
-
|
|
9822
|
+
if (n.connection) {
|
|
9823
|
+
const t = {
|
|
9824
|
+
status: n.connection,
|
|
9825
|
+
attempts: n.connection === m.RECONNECTING ? n.connectionAttempts : void 0
|
|
9826
|
+
};
|
|
9827
|
+
this.updateStatusComponent("connection", t);
|
|
9828
|
+
}
|
|
9829
|
+
if (n.auth) {
|
|
9830
|
+
const t = {
|
|
9831
|
+
status: n.auth,
|
|
9832
|
+
attempts: n.auth === v.REAUTHENTICATING ? n.authAttempts : void 0
|
|
9833
|
+
};
|
|
9834
|
+
this.updateStatusComponent("auth", t), n.auth === v.AUTHENTICATED && this.updateStatusComponent("main", { status: d.RUNNING });
|
|
9835
|
+
}
|
|
9819
9836
|
break;
|
|
9820
9837
|
case "ERROR": {
|
|
9821
9838
|
this.clearConnectionTimer();
|
|
@@ -9824,7 +9841,7 @@ const v = class v {
|
|
|
9824
9841
|
break;
|
|
9825
9842
|
}
|
|
9826
9843
|
case "TOKEN_EXPIRED":
|
|
9827
|
-
this.updateStatusComponent("auth", { status:
|
|
9844
|
+
this.updateStatusComponent("auth", { status: v.AUTHENTICATING }), this.handleTokenExpiredInternal();
|
|
9828
9845
|
break;
|
|
9829
9846
|
case "DISCONNECTED":
|
|
9830
9847
|
this.updateStatusComponent("connection", { status: m.DISCONNECTED });
|
|
@@ -9836,14 +9853,16 @@ const v = class v {
|
|
|
9836
9853
|
*/
|
|
9837
9854
|
mapErrorToStatus(n) {
|
|
9838
9855
|
const t = n.code;
|
|
9839
|
-
(t === c.CONNECTION_FAILED || t === c.CONNECTION_LOST || t === c.RECONNECT_FAILED || t === c.CONNECTION_TIMEOUT) && (this.updateStatusComponent("connection", { status: m.DISCONNECTED, lastError: n }), this.updateStatusComponent("main", { status: d.FAILED, lastError: n })), (t === c.AUTH_FAILED || t === c.AUTH_REFRESH_FAILED) && (this.updateStatusComponent("auth", { status:
|
|
9856
|
+
(t === c.CONNECTION_FAILED || t === c.CONNECTION_LOST || t === c.RECONNECT_FAILED || t === c.CONNECTION_TIMEOUT) && (this.updateStatusComponent("connection", { status: m.DISCONNECTED, lastError: n }), this.updateStatusComponent("main", { status: d.FAILED, lastError: n })), (t === c.AUTH_FAILED || t === c.AUTH_REFRESH_FAILED) && (this.updateStatusComponent("auth", { status: v.FAILED, lastError: n }), this.updateStatusComponent("main", { status: d.FAILED, lastError: n })), (t === c.DEVICE_ERROR || t === c.DECODE_ERROR) && this.updateStatusComponent("main", { lastError: n });
|
|
9840
9857
|
}
|
|
9841
9858
|
/**
|
|
9842
9859
|
* Updates a single component of the status and notifies listeners
|
|
9843
9860
|
*/
|
|
9844
9861
|
updateStatusComponent(n, t) {
|
|
9845
|
-
const
|
|
9846
|
-
|
|
9862
|
+
const i = { ...this._status[n], ...t };
|
|
9863
|
+
Object.keys(i).forEach((o) => {
|
|
9864
|
+
i[o] === void 0 && delete i[o];
|
|
9865
|
+
}), this._status[n] = i, this.statusCallback && this.statusCallback({ ...this._status });
|
|
9847
9866
|
}
|
|
9848
9867
|
/**
|
|
9849
9868
|
* Safe timer cleanup
|
|
@@ -9874,7 +9893,7 @@ const v = class v {
|
|
|
9874
9893
|
"bar_id" in n && "state" in n ? (t = n.state, r = n.bar_id) : t = n;
|
|
9875
9894
|
let i = t.updates;
|
|
9876
9895
|
return i && (i = i.map((o) => {
|
|
9877
|
-
const s = Object.keys(o).find((
|
|
9896
|
+
const s = Object.keys(o).find((l) => o[l] != null);
|
|
9878
9897
|
return {
|
|
9879
9898
|
...o,
|
|
9880
9899
|
state: s
|
|
@@ -9890,24 +9909,24 @@ const v = class v {
|
|
|
9890
9909
|
*/
|
|
9891
9910
|
async handleTokenExpiredInternal() {
|
|
9892
9911
|
const n = this.addr;
|
|
9893
|
-
let t =
|
|
9912
|
+
let t = g.tokenRefreshPromises.get(n);
|
|
9894
9913
|
if (!t && this.onTokenExpired && (t = (async () => {
|
|
9895
9914
|
try {
|
|
9896
9915
|
const i = this.onTokenExpired();
|
|
9897
9916
|
return i instanceof Promise ? await i : "";
|
|
9898
9917
|
} finally {
|
|
9899
|
-
|
|
9918
|
+
g.tokenRefreshPromises.delete(n);
|
|
9900
9919
|
}
|
|
9901
|
-
})(),
|
|
9920
|
+
})(), g.tokenRefreshPromises.set(n, t)), t) {
|
|
9902
9921
|
const r = await t;
|
|
9903
9922
|
r && this.sendToken(r);
|
|
9904
9923
|
}
|
|
9905
9924
|
}
|
|
9906
9925
|
};
|
|
9907
9926
|
/** Static map to deduplicate token refresh requests across all instances in this JS context */
|
|
9908
|
-
|
|
9909
|
-
let
|
|
9910
|
-
class
|
|
9927
|
+
u(g, "tokenRefreshPromises", /* @__PURE__ */ new Map());
|
|
9928
|
+
let T = g;
|
|
9929
|
+
class Re extends T {
|
|
9911
9930
|
constructor(t = {}, r) {
|
|
9912
9931
|
let i = t.addr;
|
|
9913
9932
|
i || (typeof window < "u" ? i = window.location.origin : i = "10.0.4.20");
|
|
@@ -9920,7 +9939,7 @@ class Te extends O {
|
|
|
9920
9939
|
},
|
|
9921
9940
|
r
|
|
9922
9941
|
);
|
|
9923
|
-
|
|
9942
|
+
u(this, "streamMode", "local");
|
|
9924
9943
|
}
|
|
9925
9944
|
/**
|
|
9926
9945
|
* Normalizes the address to use ws:// protocol and adds default path if missing.
|
|
@@ -9931,7 +9950,7 @@ class Te extends O {
|
|
|
9931
9950
|
return (i.pathname === "/" || !i.pathname) && (i.pathname = "/api/status/ws"), this.token && i.searchParams.set("x-api-token", this.token), i.toString();
|
|
9932
9951
|
}
|
|
9933
9952
|
}
|
|
9934
|
-
class Oe extends
|
|
9953
|
+
class Oe extends T {
|
|
9935
9954
|
constructor(t, r) {
|
|
9936
9955
|
super(
|
|
9937
9956
|
{
|
|
@@ -9941,9 +9960,10 @@ class Oe extends O {
|
|
|
9941
9960
|
},
|
|
9942
9961
|
r
|
|
9943
9962
|
);
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
this
|
|
9963
|
+
u(this, "streamMode", "remote");
|
|
9964
|
+
u(this, "tokenProvider");
|
|
9965
|
+
u(this, "maxAuthAttempts");
|
|
9966
|
+
this.tokenProvider = t.tokenProvider, this.maxAuthAttempts = (r == null ? void 0 : r.maxAuthAttempts) ?? L;
|
|
9947
9967
|
}
|
|
9948
9968
|
/**
|
|
9949
9969
|
* Subscribes to updates for a specific device GUID.
|
|
@@ -10033,20 +10053,20 @@ var P;
|
|
|
10033
10053
|
n[n.BUSY = 0] = "BUSY", n[n.CUSTOM = 1] = "CUSTOM", n[n.OFF = 2] = "OFF", n[n.APPS = 3] = "APPS", n[n.SETTINGS = 4] = "SETTINGS";
|
|
10034
10054
|
})(e.SwitchPosition || (e.SwitchPosition = {}));
|
|
10035
10055
|
})(P || (P = {}));
|
|
10036
|
-
var
|
|
10056
|
+
var D;
|
|
10037
10057
|
((e) => {
|
|
10038
10058
|
((n) => {
|
|
10039
10059
|
n[n.RESOURCE_LIMIT = 0] = "RESOURCE_LIMIT";
|
|
10040
10060
|
})(e.Cause || (e.Cause = {})), ((n) => {
|
|
10041
10061
|
n[n.FATAL = 0] = "FATAL", n[n.ERROR = 1] = "ERROR", n[n.WARNING = 2] = "WARNING";
|
|
10042
10062
|
})(e.Severity || (e.Severity = {}));
|
|
10043
|
-
})(
|
|
10044
|
-
const
|
|
10063
|
+
})(D || (D = {}));
|
|
10064
|
+
const b = class b {
|
|
10045
10065
|
constructor() {
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10066
|
+
u(this, "gl", null);
|
|
10067
|
+
u(this, "program", null);
|
|
10068
|
+
u(this, "texture", null);
|
|
10069
|
+
u(this, "vs", `#version 300 es
|
|
10050
10070
|
in vec2 position;
|
|
10051
10071
|
out vec2 v_uv;
|
|
10052
10072
|
void main() {
|
|
@@ -10055,7 +10075,7 @@ const g = class g {
|
|
|
10055
10075
|
gl_Position = vec4(position, 0, 1);
|
|
10056
10076
|
}
|
|
10057
10077
|
`);
|
|
10058
|
-
|
|
10078
|
+
u(this, "fs", `#version 300 es
|
|
10059
10079
|
precision highp float;
|
|
10060
10080
|
in vec2 v_uv;
|
|
10061
10081
|
out vec4 outColor;
|
|
@@ -10088,9 +10108,9 @@ const g = class g {
|
|
|
10088
10108
|
outColor = vec4(finalColor, color.a * mask);
|
|
10089
10109
|
}
|
|
10090
10110
|
`);
|
|
10091
|
-
if (
|
|
10092
|
-
return
|
|
10093
|
-
|
|
10111
|
+
if (b.instance)
|
|
10112
|
+
return b.instance;
|
|
10113
|
+
b.instance = this;
|
|
10094
10114
|
}
|
|
10095
10115
|
/**
|
|
10096
10116
|
* Lazily initializes the WebGL context and resources.
|
|
@@ -10116,8 +10136,8 @@ const g = class g {
|
|
|
10116
10136
|
* Internal WebGL rendering pass.
|
|
10117
10137
|
*/
|
|
10118
10138
|
render(n, t, r, i) {
|
|
10119
|
-
const { pixelSize: o = 0.85, radius: s = 0.5, darkThreshold:
|
|
10120
|
-
a.viewport(0, 0, a.canvas.width, a.canvas.height), a.useProgram(this.program), a.bindTexture(a.TEXTURE_2D, this.texture), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA8, t, r, 0, a.RGBA, a.UNSIGNED_BYTE, n), a.uniform2f(a.getUniformLocation(this.program, "u_dataRes"), t, r), a.uniform2f(a.getUniformLocation(this.program, "u_canvasRes"), a.canvas.width, a.canvas.height), a.uniform1f(a.getUniformLocation(this.program, "u_pixelSize"), o), a.uniform1f(a.getUniformLocation(this.program, "u_radius"), s), a.uniform1f(a.getUniformLocation(this.program, "u_darkThreshold"),
|
|
10139
|
+
const { pixelSize: o = 0.85, radius: s = 0.5, darkThreshold: l = 0.04 } = i, a = this.gl;
|
|
10140
|
+
a.viewport(0, 0, a.canvas.width, a.canvas.height), a.useProgram(this.program), a.bindTexture(a.TEXTURE_2D, this.texture), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA8, t, r, 0, a.RGBA, a.UNSIGNED_BYTE, n), a.uniform2f(a.getUniformLocation(this.program, "u_dataRes"), t, r), a.uniform2f(a.getUniformLocation(this.program, "u_canvasRes"), a.canvas.width, a.canvas.height), a.uniform1f(a.getUniformLocation(this.program, "u_pixelSize"), o), a.uniform1f(a.getUniformLocation(this.program, "u_radius"), s), a.uniform1f(a.getUniformLocation(this.program, "u_darkThreshold"), l), a.clearColor(0, 0, 0, 0), a.clear(a.COLOR_BUFFER_BIT), a.enable(a.BLEND), a.blendFunc(a.SRC_ALPHA, a.ONE_MINUS_SRC_ALPHA), a.drawArrays(a.TRIANGLES, 0, 6);
|
|
10121
10141
|
}
|
|
10122
10142
|
/**
|
|
10123
10143
|
* Public API: Renders the LED frame to a target 2D canvas.
|
|
@@ -10130,30 +10150,30 @@ const g = class g {
|
|
|
10130
10150
|
s && (s.clearRect(0, 0, n.width, n.height), s.drawImage(this.gl.canvas, 0, 0));
|
|
10131
10151
|
}
|
|
10132
10152
|
createProgram(n, t) {
|
|
10133
|
-
const r = this.gl, i = (s,
|
|
10153
|
+
const r = this.gl, i = (s, l) => {
|
|
10134
10154
|
const a = r.createShader(s);
|
|
10135
|
-
if (r.shaderSource(a,
|
|
10155
|
+
if (r.shaderSource(a, l), r.compileShader(a), !r.getShaderParameter(a, r.COMPILE_STATUS)) throw new Error(r.getShaderInfoLog(a) || "Shader Error");
|
|
10136
10156
|
return a;
|
|
10137
10157
|
}, o = r.createProgram();
|
|
10138
10158
|
return r.attachShader(o, i(r.VERTEX_SHADER, n)), r.attachShader(o, i(r.FRAGMENT_SHADER, t)), r.linkProgram(o), o;
|
|
10139
10159
|
}
|
|
10140
10160
|
};
|
|
10141
|
-
|
|
10142
|
-
let
|
|
10143
|
-
const
|
|
10161
|
+
u(b, "instance", null);
|
|
10162
|
+
let N = b;
|
|
10163
|
+
const we = new N();
|
|
10144
10164
|
export {
|
|
10145
|
-
|
|
10146
|
-
|
|
10165
|
+
v as AuthStatus,
|
|
10166
|
+
D as BSB_Error,
|
|
10147
10167
|
k as BSB_Frame,
|
|
10148
10168
|
P as BSB_Input,
|
|
10149
10169
|
I as BSB_State,
|
|
10150
10170
|
C as BSB_Update,
|
|
10151
10171
|
q as BSB_Util,
|
|
10152
|
-
|
|
10172
|
+
me as BusyBar,
|
|
10153
10173
|
m as ConnectionStatus,
|
|
10154
10174
|
E as DataStatus,
|
|
10155
|
-
|
|
10156
|
-
|
|
10175
|
+
we as LEDRenderer,
|
|
10176
|
+
Re as LocalStateStream,
|
|
10157
10177
|
Oe as RemoteStateStream,
|
|
10158
10178
|
y as StateStreamError,
|
|
10159
10179
|
c as StateStreamErrorCode,
|