@poor-knight/cesium-utils 0.3.5 → 0.3.7
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/cesium-utils.cjs +18 -18
- package/dist/cesium-utils.d.ts +6 -1
- package/dist/cesium-utils.js +1211 -1197
- package/dist/cesium-utils.umd.cjs +18 -18
- package/package.json +1 -1
package/dist/cesium-utils.js
CHANGED
|
@@ -5,15 +5,15 @@ import * as Cesium from "cesium";
|
|
|
5
5
|
import { Cartesian2, Cartesian3, VerticalOrigin, HorizontalOrigin, Color, LabelStyle, defined, DeveloperError, Event, Credit, Ellipsoid, GeographicTilingScheme, TerrainProvider, HeightmapTerrainData, Resource, Rectangle as Rectangle$1, WebMapTileServiceImageryProvider, ScreenSpaceEventHandler, ScreenSpaceEventType, ImageryLayer, WebMapServiceImageryProvider, HeightReference, NearFarScalar, SceneMode, BoundingSphere, Occluder, SceneTransforms } from "cesium";
|
|
6
6
|
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, inflate$2 = {};
|
|
7
7
|
const adler32$1 = (s, i, r, u) => {
|
|
8
|
-
let
|
|
8
|
+
let d = s & 65535 | 0, o = s >>> 16 & 65535 | 0, l = 0;
|
|
9
9
|
for (; r !== 0; ) {
|
|
10
10
|
l = r > 2e3 ? 2e3 : r, r -= l;
|
|
11
11
|
do
|
|
12
|
-
|
|
12
|
+
d = d + i[u++] | 0, o = o + d | 0;
|
|
13
13
|
while (--l);
|
|
14
|
-
|
|
14
|
+
d %= 65521, o %= 65521;
|
|
15
15
|
}
|
|
16
|
-
return
|
|
16
|
+
return d | o << 16 | 0;
|
|
17
17
|
};
|
|
18
18
|
var adler32_1 = adler32$1;
|
|
19
19
|
const makeTable = () => {
|
|
@@ -26,77 +26,77 @@ const makeTable = () => {
|
|
|
26
26
|
}
|
|
27
27
|
return i;
|
|
28
28
|
}, crcTable = new Uint32Array(makeTable()), crc32$1 = (s, i, r, u) => {
|
|
29
|
-
const
|
|
29
|
+
const d = crcTable, o = u + r;
|
|
30
30
|
s ^= -1;
|
|
31
31
|
for (let l = u; l < o; l++)
|
|
32
|
-
s = s >>> 8 ^
|
|
32
|
+
s = s >>> 8 ^ d[(s ^ i[l]) & 255];
|
|
33
33
|
return s ^ -1;
|
|
34
34
|
};
|
|
35
35
|
var crc32_1 = crc32$1;
|
|
36
36
|
const BAD$1 = 16209, TYPE$1 = 16191;
|
|
37
37
|
var inffast = function(i, r) {
|
|
38
|
-
let u,
|
|
38
|
+
let u, d, o, l, c, h, a, m, y, g, p, v, b, _, T, w, x, O, E, R, S, P, C, D;
|
|
39
39
|
const I = i.state;
|
|
40
|
-
u = i.next_in, C = i.input,
|
|
40
|
+
u = i.next_in, C = i.input, d = u + (i.avail_in - 5), o = i.next_out, D = i.output, l = o - (r - i.avail_out), c = o + (i.avail_out - 257), h = I.dmax, a = I.wsize, m = I.whave, y = I.wnext, g = I.window, p = I.hold, v = I.bits, b = I.lencode, _ = I.distcode, T = (1 << I.lenbits) - 1, w = (1 << I.distbits) - 1;
|
|
41
41
|
e: do {
|
|
42
|
-
v < 15 && (
|
|
42
|
+
v < 15 && (p += C[u++] << v, v += 8, p += C[u++] << v, v += 8), x = b[p & T];
|
|
43
43
|
t: for (; ; ) {
|
|
44
|
-
if (O = x >>> 24,
|
|
44
|
+
if (O = x >>> 24, p >>>= O, v -= O, O = x >>> 16 & 255, O === 0)
|
|
45
45
|
D[o++] = x & 65535;
|
|
46
46
|
else if (O & 16) {
|
|
47
|
-
|
|
47
|
+
E = x & 65535, O &= 15, O && (v < O && (p += C[u++] << v, v += 8), E += p & (1 << O) - 1, p >>>= O, v -= O), v < 15 && (p += C[u++] << v, v += 8, p += C[u++] << v, v += 8), x = _[p & w];
|
|
48
48
|
r: for (; ; ) {
|
|
49
|
-
if (O = x >>> 24,
|
|
50
|
-
if (
|
|
49
|
+
if (O = x >>> 24, p >>>= O, v -= O, O = x >>> 16 & 255, O & 16) {
|
|
50
|
+
if (R = x & 65535, O &= 15, v < O && (p += C[u++] << v, v += 8, v < O && (p += C[u++] << v, v += 8)), R += p & (1 << O) - 1, R > h) {
|
|
51
51
|
i.msg = "invalid distance too far back", I.mode = BAD$1;
|
|
52
52
|
break e;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
55
|
-
if (O =
|
|
54
|
+
if (p >>>= O, v -= O, O = o - l, R > O) {
|
|
55
|
+
if (O = R - O, O > m && I.sane) {
|
|
56
56
|
i.msg = "invalid distance too far back", I.mode = BAD$1;
|
|
57
57
|
break e;
|
|
58
58
|
}
|
|
59
59
|
if (S = 0, P = g, y === 0) {
|
|
60
|
-
if (S += a - O, O <
|
|
61
|
-
|
|
60
|
+
if (S += a - O, O < E) {
|
|
61
|
+
E -= O;
|
|
62
62
|
do
|
|
63
63
|
D[o++] = g[S++];
|
|
64
64
|
while (--O);
|
|
65
|
-
S = o -
|
|
65
|
+
S = o - R, P = D;
|
|
66
66
|
}
|
|
67
67
|
} else if (y < O) {
|
|
68
|
-
if (S += a + y - O, O -= y, O <
|
|
69
|
-
|
|
68
|
+
if (S += a + y - O, O -= y, O < E) {
|
|
69
|
+
E -= O;
|
|
70
70
|
do
|
|
71
71
|
D[o++] = g[S++];
|
|
72
72
|
while (--O);
|
|
73
|
-
if (S = 0, y <
|
|
74
|
-
O = y,
|
|
73
|
+
if (S = 0, y < E) {
|
|
74
|
+
O = y, E -= O;
|
|
75
75
|
do
|
|
76
76
|
D[o++] = g[S++];
|
|
77
77
|
while (--O);
|
|
78
|
-
S = o -
|
|
78
|
+
S = o - R, P = D;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
} else if (S += y - O, O <
|
|
82
|
-
|
|
81
|
+
} else if (S += y - O, O < E) {
|
|
82
|
+
E -= O;
|
|
83
83
|
do
|
|
84
84
|
D[o++] = g[S++];
|
|
85
85
|
while (--O);
|
|
86
|
-
S = o -
|
|
86
|
+
S = o - R, P = D;
|
|
87
87
|
}
|
|
88
|
-
for (;
|
|
89
|
-
D[o++] = P[S++], D[o++] = P[S++], D[o++] = P[S++],
|
|
90
|
-
|
|
88
|
+
for (; E > 2; )
|
|
89
|
+
D[o++] = P[S++], D[o++] = P[S++], D[o++] = P[S++], E -= 3;
|
|
90
|
+
E && (D[o++] = P[S++], E > 1 && (D[o++] = P[S++]));
|
|
91
91
|
} else {
|
|
92
|
-
S = o -
|
|
92
|
+
S = o - R;
|
|
93
93
|
do
|
|
94
|
-
D[o++] = D[S++], D[o++] = D[S++], D[o++] = D[S++],
|
|
95
|
-
while (
|
|
96
|
-
|
|
94
|
+
D[o++] = D[S++], D[o++] = D[S++], D[o++] = D[S++], E -= 3;
|
|
95
|
+
while (E > 2);
|
|
96
|
+
E && (D[o++] = D[S++], E > 1 && (D[o++] = D[S++]));
|
|
97
97
|
}
|
|
98
98
|
} else if ((O & 64) === 0) {
|
|
99
|
-
x = _[(x & 65535) + (
|
|
99
|
+
x = _[(x & 65535) + (p & (1 << O) - 1)];
|
|
100
100
|
continue r;
|
|
101
101
|
} else {
|
|
102
102
|
i.msg = "invalid distance code", I.mode = BAD$1;
|
|
@@ -105,7 +105,7 @@ var inffast = function(i, r) {
|
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
107
|
} else if ((O & 64) === 0) {
|
|
108
|
-
x = b[(x & 65535) + (
|
|
108
|
+
x = b[(x & 65535) + (p & (1 << O) - 1)];
|
|
109
109
|
continue t;
|
|
110
110
|
} else if (O & 32) {
|
|
111
111
|
I.mode = TYPE$1;
|
|
@@ -116,8 +116,8 @@ var inffast = function(i, r) {
|
|
|
116
116
|
}
|
|
117
117
|
break;
|
|
118
118
|
}
|
|
119
|
-
} while (u <
|
|
120
|
-
|
|
119
|
+
} while (u < d && o < c);
|
|
120
|
+
E = v >> 3, u -= E, v -= E << 3, p &= (1 << v) - 1, i.next_in = u, i.next_out = o, i.avail_in = u < d ? 5 + (d - u) : 5 - (u - d), i.avail_out = o < c ? 257 + (c - o) : 257 - (o - c), I.hold = p, I.bits = v;
|
|
121
121
|
};
|
|
122
122
|
const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS$1 = 1, DISTS$1 = 2, lbase = new Uint16Array([
|
|
123
123
|
/* Length codes 257..285 base */
|
|
@@ -253,53 +253,53 @@ const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS
|
|
|
253
253
|
29,
|
|
254
254
|
64,
|
|
255
255
|
64
|
|
256
|
-
]), inflate_table$1 = (s, i, r, u,
|
|
257
|
-
const
|
|
258
|
-
let a = 0,
|
|
256
|
+
]), inflate_table$1 = (s, i, r, u, d, o, l, c) => {
|
|
257
|
+
const h = c.bits;
|
|
258
|
+
let a = 0, m = 0, y = 0, g = 0, p = 0, v = 0, b = 0, _ = 0, T = 0, w = 0, x, O, E, R, S, P = null, C;
|
|
259
259
|
const D = new Uint16Array(MAXBITS + 1), I = new Uint16Array(MAXBITS + 1);
|
|
260
260
|
let $ = null, q, F, U;
|
|
261
261
|
for (a = 0; a <= MAXBITS; a++)
|
|
262
262
|
D[a] = 0;
|
|
263
|
-
for (
|
|
264
|
-
D[i[r +
|
|
265
|
-
for (
|
|
263
|
+
for (m = 0; m < u; m++)
|
|
264
|
+
D[i[r + m]]++;
|
|
265
|
+
for (p = h, g = MAXBITS; g >= 1 && D[g] === 0; g--)
|
|
266
266
|
;
|
|
267
|
-
if (
|
|
268
|
-
return
|
|
267
|
+
if (p > g && (p = g), g === 0)
|
|
268
|
+
return d[o++] = 1 << 24 | 64 << 16 | 0, d[o++] = 1 << 24 | 64 << 16 | 0, c.bits = 1, 0;
|
|
269
269
|
for (y = 1; y < g && D[y] === 0; y++)
|
|
270
270
|
;
|
|
271
|
-
for (
|
|
271
|
+
for (p < y && (p = y), _ = 1, a = 1; a <= MAXBITS; a++)
|
|
272
272
|
if (_ <<= 1, _ -= D[a], _ < 0)
|
|
273
273
|
return -1;
|
|
274
274
|
if (_ > 0 && (s === CODES$1 || g !== 1))
|
|
275
275
|
return -1;
|
|
276
276
|
for (I[1] = 0, a = 1; a < MAXBITS; a++)
|
|
277
277
|
I[a + 1] = I[a] + D[a];
|
|
278
|
-
for (
|
|
279
|
-
i[r +
|
|
280
|
-
if (s === CODES$1 ? (P = $ = l, C = 20) : s === LENS$1 ? (P = lbase, $ = lext, C = 257) : (P = dbase, $ = dext, C = 0), w = 0,
|
|
278
|
+
for (m = 0; m < u; m++)
|
|
279
|
+
i[r + m] !== 0 && (l[I[i[r + m]]++] = m);
|
|
280
|
+
if (s === CODES$1 ? (P = $ = l, C = 20) : s === LENS$1 ? (P = lbase, $ = lext, C = 257) : (P = dbase, $ = dext, C = 0), w = 0, m = 0, a = y, S = o, v = p, b = 0, E = -1, T = 1 << p, R = T - 1, s === LENS$1 && T > ENOUGH_LENS$1 || s === DISTS$1 && T > ENOUGH_DISTS$1)
|
|
281
281
|
return 1;
|
|
282
282
|
for (; ; ) {
|
|
283
|
-
q = a - b, l[
|
|
283
|
+
q = a - b, l[m] + 1 < C ? (F = 0, U = l[m]) : l[m] >= C ? (F = $[l[m] - C], U = P[l[m] - C]) : (F = 96, U = 0), x = 1 << a - b, O = 1 << v, y = O;
|
|
284
284
|
do
|
|
285
|
-
O -= x,
|
|
285
|
+
O -= x, d[S + (w >> b) + O] = q << 24 | F << 16 | U | 0;
|
|
286
286
|
while (O !== 0);
|
|
287
287
|
for (x = 1 << a - 1; w & x; )
|
|
288
288
|
x >>= 1;
|
|
289
|
-
if (x !== 0 ? (w &= x - 1, w += x) : w = 0,
|
|
289
|
+
if (x !== 0 ? (w &= x - 1, w += x) : w = 0, m++, --D[a] === 0) {
|
|
290
290
|
if (a === g)
|
|
291
291
|
break;
|
|
292
|
-
a = i[r + l[
|
|
292
|
+
a = i[r + l[m]];
|
|
293
293
|
}
|
|
294
|
-
if (a >
|
|
295
|
-
for (b === 0 && (b =
|
|
294
|
+
if (a > p && (w & R) !== E) {
|
|
295
|
+
for (b === 0 && (b = p), S += y, v = a - b, _ = 1 << v; v + b < g && (_ -= D[v + b], !(_ <= 0)); )
|
|
296
296
|
v++, _ <<= 1;
|
|
297
297
|
if (T += 1 << v, s === LENS$1 && T > ENOUGH_LENS$1 || s === DISTS$1 && T > ENOUGH_DISTS$1)
|
|
298
298
|
return 1;
|
|
299
|
-
|
|
299
|
+
E = w & R, d[E] = p << 24 | v << 16 | S - o | 0;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
return w !== 0 && (
|
|
302
|
+
return w !== 0 && (d[S + w] = a - b << 24 | 64 << 16 | 0), c.bits = p, 0;
|
|
303
303
|
};
|
|
304
304
|
var inftrees = inflate_table$1, constants = {
|
|
305
305
|
/* Allowed flush values; see deflate() and inflate() below for details */
|
|
@@ -389,11 +389,11 @@ const fixedtables = (s) => {
|
|
|
389
389
|
}
|
|
390
390
|
s.lencode = lenfix, s.lenbits = 9, s.distcode = distfix, s.distbits = 5;
|
|
391
391
|
}, updatewindow = (s, i, r, u) => {
|
|
392
|
-
let
|
|
392
|
+
let d;
|
|
393
393
|
const o = s.state;
|
|
394
|
-
return o.window === null && (o.wsize = 1 << o.wbits, o.wnext = 0, o.whave = 0, o.window = new Uint8Array(o.wsize)), u >= o.wsize ? (o.window.set(i.subarray(r - o.wsize, r), 0), o.wnext = 0, o.whave = o.wsize) : (
|
|
394
|
+
return o.window === null && (o.wsize = 1 << o.wbits, o.wnext = 0, o.whave = 0, o.window = new Uint8Array(o.wsize)), u >= o.wsize ? (o.window.set(i.subarray(r - o.wsize, r), 0), o.wnext = 0, o.whave = o.wsize) : (d = o.wsize - o.wnext, d > u && (d = u), o.window.set(i.subarray(r - u, r - u + d), o.wnext), u -= d, u ? (o.window.set(i.subarray(r - u, r), 0), o.wnext = u, o.whave = o.wsize) : (o.wnext += d, o.wnext === o.wsize && (o.wnext = 0), o.whave < o.wsize && (o.whave += d))), 0;
|
|
395
395
|
}, inflate$1 = (s, i) => {
|
|
396
|
-
let r, u,
|
|
396
|
+
let r, u, d, o, l, c, h, a, m, y, g, p, v, b, _ = 0, T, w, x, O, E, R, S, P;
|
|
397
397
|
const C = new Uint8Array(4);
|
|
398
398
|
let D, I;
|
|
399
399
|
const $ = (
|
|
@@ -402,7 +402,7 @@ const fixedtables = (s) => {
|
|
|
402
402
|
);
|
|
403
403
|
if (inflateStateCheck(s) || !s.output || !s.input && s.avail_in !== 0)
|
|
404
404
|
return Z_STREAM_ERROR$1;
|
|
405
|
-
r = s.state, r.mode === TYPE && (r.mode = TYPEDO), l = s.next_out,
|
|
405
|
+
r = s.state, r.mode === TYPE && (r.mode = TYPEDO), l = s.next_out, d = s.output, h = s.avail_out, o = s.next_in, u = s.input, c = s.avail_in, a = r.hold, m = r.bits, y = c, g = h, P = Z_OK$1;
|
|
406
406
|
e: for (; ; )
|
|
407
407
|
switch (r.mode) {
|
|
408
408
|
case HEAD:
|
|
@@ -410,13 +410,13 @@ const fixedtables = (s) => {
|
|
|
410
410
|
r.mode = TYPEDO;
|
|
411
411
|
break;
|
|
412
412
|
}
|
|
413
|
-
for (;
|
|
413
|
+
for (; m < 16; ) {
|
|
414
414
|
if (c === 0)
|
|
415
415
|
break e;
|
|
416
|
-
c--, a += u[o++] <<
|
|
416
|
+
c--, a += u[o++] << m, m += 8;
|
|
417
417
|
}
|
|
418
418
|
if (r.wrap & 2 && a === 35615) {
|
|
419
|
-
r.wbits === 0 && (r.wbits = 15), r.check = 0, C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0), a = 0,
|
|
419
|
+
r.wbits === 0 && (r.wbits = 15), r.check = 0, C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0), a = 0, m = 0, r.mode = FLAGS;
|
|
420
420
|
break;
|
|
421
421
|
}
|
|
422
422
|
if (r.head && (r.head.done = !1), !(r.wrap & 1) || (((a & 255) << 8) + (a >> 8)) % 31) {
|
|
@@ -427,17 +427,17 @@ const fixedtables = (s) => {
|
|
|
427
427
|
s.msg = "unknown compression method", r.mode = BAD;
|
|
428
428
|
break;
|
|
429
429
|
}
|
|
430
|
-
if (a >>>= 4,
|
|
430
|
+
if (a >>>= 4, m -= 4, S = (a & 15) + 8, r.wbits === 0 && (r.wbits = S), S > 15 || S > r.wbits) {
|
|
431
431
|
s.msg = "invalid window size", r.mode = BAD;
|
|
432
432
|
break;
|
|
433
433
|
}
|
|
434
|
-
r.dmax = 1 << r.wbits, r.flags = 0, s.adler = r.check = 1, r.mode = a & 512 ? DICTID : TYPE, a = 0,
|
|
434
|
+
r.dmax = 1 << r.wbits, r.flags = 0, s.adler = r.check = 1, r.mode = a & 512 ? DICTID : TYPE, a = 0, m = 0;
|
|
435
435
|
break;
|
|
436
436
|
case FLAGS:
|
|
437
|
-
for (;
|
|
437
|
+
for (; m < 16; ) {
|
|
438
438
|
if (c === 0)
|
|
439
439
|
break e;
|
|
440
|
-
c--, a += u[o++] <<
|
|
440
|
+
c--, a += u[o++] << m, m += 8;
|
|
441
441
|
}
|
|
442
442
|
if (r.flags = a, (r.flags & 255) !== Z_DEFLATED) {
|
|
443
443
|
s.msg = "unknown compression method", r.mode = BAD;
|
|
@@ -447,45 +447,45 @@ const fixedtables = (s) => {
|
|
|
447
447
|
s.msg = "unknown header flags set", r.mode = BAD;
|
|
448
448
|
break;
|
|
449
449
|
}
|
|
450
|
-
r.head && (r.head.text = a >> 8 & 1), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0,
|
|
450
|
+
r.head && (r.head.text = a >> 8 & 1), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0, m = 0, r.mode = TIME;
|
|
451
451
|
/* falls through */
|
|
452
452
|
case TIME:
|
|
453
|
-
for (;
|
|
453
|
+
for (; m < 32; ) {
|
|
454
454
|
if (c === 0)
|
|
455
455
|
break e;
|
|
456
|
-
c--, a += u[o++] <<
|
|
456
|
+
c--, a += u[o++] << m, m += 8;
|
|
457
457
|
}
|
|
458
|
-
r.head && (r.head.time = a), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, C[2] = a >>> 16 & 255, C[3] = a >>> 24 & 255, r.check = crc32(r.check, C, 4, 0)), a = 0,
|
|
458
|
+
r.head && (r.head.time = a), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, C[2] = a >>> 16 & 255, C[3] = a >>> 24 & 255, r.check = crc32(r.check, C, 4, 0)), a = 0, m = 0, r.mode = OS;
|
|
459
459
|
/* falls through */
|
|
460
460
|
case OS:
|
|
461
|
-
for (;
|
|
461
|
+
for (; m < 16; ) {
|
|
462
462
|
if (c === 0)
|
|
463
463
|
break e;
|
|
464
|
-
c--, a += u[o++] <<
|
|
464
|
+
c--, a += u[o++] << m, m += 8;
|
|
465
465
|
}
|
|
466
|
-
r.head && (r.head.xflags = a & 255, r.head.os = a >> 8), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0,
|
|
466
|
+
r.head && (r.head.xflags = a & 255, r.head.os = a >> 8), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0, m = 0, r.mode = EXLEN;
|
|
467
467
|
/* falls through */
|
|
468
468
|
case EXLEN:
|
|
469
469
|
if (r.flags & 1024) {
|
|
470
|
-
for (;
|
|
470
|
+
for (; m < 16; ) {
|
|
471
471
|
if (c === 0)
|
|
472
472
|
break e;
|
|
473
|
-
c--, a += u[o++] <<
|
|
473
|
+
c--, a += u[o++] << m, m += 8;
|
|
474
474
|
}
|
|
475
|
-
r.length = a, r.head && (r.head.extra_len = a), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0,
|
|
475
|
+
r.length = a, r.head && (r.head.extra_len = a), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0, m = 0;
|
|
476
476
|
} else r.head && (r.head.extra = null);
|
|
477
477
|
r.mode = EXTRA;
|
|
478
478
|
/* falls through */
|
|
479
479
|
case EXTRA:
|
|
480
|
-
if (r.flags & 1024 && (
|
|
480
|
+
if (r.flags & 1024 && (p = r.length, p > c && (p = c), p && (r.head && (S = r.head.extra_len - r.length, r.head.extra || (r.head.extra = new Uint8Array(r.head.extra_len)), r.head.extra.set(
|
|
481
481
|
u.subarray(
|
|
482
482
|
o,
|
|
483
483
|
// extra field is limited to 65536 bytes
|
|
484
484
|
// - no need for additional size check
|
|
485
|
-
o +
|
|
485
|
+
o + p
|
|
486
486
|
),
|
|
487
487
|
S
|
|
488
|
-
)), r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u,
|
|
488
|
+
)), r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u, p, o)), c -= p, o += p, r.length -= p), r.length))
|
|
489
489
|
break e;
|
|
490
490
|
r.length = 0, r.mode = NAME;
|
|
491
491
|
/* falls through */
|
|
@@ -493,11 +493,11 @@ const fixedtables = (s) => {
|
|
|
493
493
|
if (r.flags & 2048) {
|
|
494
494
|
if (c === 0)
|
|
495
495
|
break e;
|
|
496
|
-
|
|
496
|
+
p = 0;
|
|
497
497
|
do
|
|
498
|
-
S = u[o +
|
|
499
|
-
while (S &&
|
|
500
|
-
if (r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u,
|
|
498
|
+
S = u[o + p++], r.head && S && r.length < 65536 && (r.head.name += String.fromCharCode(S));
|
|
499
|
+
while (S && p < c);
|
|
500
|
+
if (r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u, p, o)), c -= p, o += p, S)
|
|
501
501
|
break e;
|
|
502
502
|
} else r.head && (r.head.name = null);
|
|
503
503
|
r.length = 0, r.mode = COMMENT;
|
|
@@ -506,41 +506,41 @@ const fixedtables = (s) => {
|
|
|
506
506
|
if (r.flags & 4096) {
|
|
507
507
|
if (c === 0)
|
|
508
508
|
break e;
|
|
509
|
-
|
|
509
|
+
p = 0;
|
|
510
510
|
do
|
|
511
|
-
S = u[o +
|
|
512
|
-
while (S &&
|
|
513
|
-
if (r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u,
|
|
511
|
+
S = u[o + p++], r.head && S && r.length < 65536 && (r.head.comment += String.fromCharCode(S));
|
|
512
|
+
while (S && p < c);
|
|
513
|
+
if (r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u, p, o)), c -= p, o += p, S)
|
|
514
514
|
break e;
|
|
515
515
|
} else r.head && (r.head.comment = null);
|
|
516
516
|
r.mode = HCRC;
|
|
517
517
|
/* falls through */
|
|
518
518
|
case HCRC:
|
|
519
519
|
if (r.flags & 512) {
|
|
520
|
-
for (;
|
|
520
|
+
for (; m < 16; ) {
|
|
521
521
|
if (c === 0)
|
|
522
522
|
break e;
|
|
523
|
-
c--, a += u[o++] <<
|
|
523
|
+
c--, a += u[o++] << m, m += 8;
|
|
524
524
|
}
|
|
525
525
|
if (r.wrap & 4 && a !== (r.check & 65535)) {
|
|
526
526
|
s.msg = "header crc mismatch", r.mode = BAD;
|
|
527
527
|
break;
|
|
528
528
|
}
|
|
529
|
-
a = 0,
|
|
529
|
+
a = 0, m = 0;
|
|
530
530
|
}
|
|
531
531
|
r.head && (r.head.hcrc = r.flags >> 9 & 1, r.head.done = !0), s.adler = r.check = 0, r.mode = TYPE;
|
|
532
532
|
break;
|
|
533
533
|
case DICTID:
|
|
534
|
-
for (;
|
|
534
|
+
for (; m < 32; ) {
|
|
535
535
|
if (c === 0)
|
|
536
536
|
break e;
|
|
537
|
-
c--, a += u[o++] <<
|
|
537
|
+
c--, a += u[o++] << m, m += 8;
|
|
538
538
|
}
|
|
539
|
-
s.adler = r.check = zswap32(a), a = 0,
|
|
539
|
+
s.adler = r.check = zswap32(a), a = 0, m = 0, r.mode = DICT;
|
|
540
540
|
/* falls through */
|
|
541
541
|
case DICT:
|
|
542
542
|
if (r.havedict === 0)
|
|
543
|
-
return s.next_out = l, s.avail_out =
|
|
543
|
+
return s.next_out = l, s.avail_out = h, s.next_in = o, s.avail_in = c, r.hold = a, r.bits = m, Z_NEED_DICT$1;
|
|
544
544
|
s.adler = r.check = 1, r.mode = TYPE;
|
|
545
545
|
/* falls through */
|
|
546
546
|
case TYPE:
|
|
@@ -549,21 +549,21 @@ const fixedtables = (s) => {
|
|
|
549
549
|
/* falls through */
|
|
550
550
|
case TYPEDO:
|
|
551
551
|
if (r.last) {
|
|
552
|
-
a >>>=
|
|
552
|
+
a >>>= m & 7, m -= m & 7, r.mode = CHECK;
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
|
-
for (;
|
|
555
|
+
for (; m < 3; ) {
|
|
556
556
|
if (c === 0)
|
|
557
557
|
break e;
|
|
558
|
-
c--, a += u[o++] <<
|
|
558
|
+
c--, a += u[o++] << m, m += 8;
|
|
559
559
|
}
|
|
560
|
-
switch (r.last = a & 1, a >>>= 1,
|
|
560
|
+
switch (r.last = a & 1, a >>>= 1, m -= 1, a & 3) {
|
|
561
561
|
case 0:
|
|
562
562
|
r.mode = STORED;
|
|
563
563
|
break;
|
|
564
564
|
case 1:
|
|
565
565
|
if (fixedtables(r), r.mode = LEN_, i === Z_TREES) {
|
|
566
|
-
a >>>= 2,
|
|
566
|
+
a >>>= 2, m -= 2;
|
|
567
567
|
break e;
|
|
568
568
|
}
|
|
569
569
|
break;
|
|
@@ -573,40 +573,40 @@ const fixedtables = (s) => {
|
|
|
573
573
|
case 3:
|
|
574
574
|
s.msg = "invalid block type", r.mode = BAD;
|
|
575
575
|
}
|
|
576
|
-
a >>>= 2,
|
|
576
|
+
a >>>= 2, m -= 2;
|
|
577
577
|
break;
|
|
578
578
|
case STORED:
|
|
579
|
-
for (a >>>=
|
|
579
|
+
for (a >>>= m & 7, m -= m & 7; m < 32; ) {
|
|
580
580
|
if (c === 0)
|
|
581
581
|
break e;
|
|
582
|
-
c--, a += u[o++] <<
|
|
582
|
+
c--, a += u[o++] << m, m += 8;
|
|
583
583
|
}
|
|
584
584
|
if ((a & 65535) !== (a >>> 16 ^ 65535)) {
|
|
585
585
|
s.msg = "invalid stored block lengths", r.mode = BAD;
|
|
586
586
|
break;
|
|
587
587
|
}
|
|
588
|
-
if (r.length = a & 65535, a = 0,
|
|
588
|
+
if (r.length = a & 65535, a = 0, m = 0, r.mode = COPY_, i === Z_TREES)
|
|
589
589
|
break e;
|
|
590
590
|
/* falls through */
|
|
591
591
|
case COPY_:
|
|
592
592
|
r.mode = COPY;
|
|
593
593
|
/* falls through */
|
|
594
594
|
case COPY:
|
|
595
|
-
if (
|
|
596
|
-
if (
|
|
595
|
+
if (p = r.length, p) {
|
|
596
|
+
if (p > c && (p = c), p > h && (p = h), p === 0)
|
|
597
597
|
break e;
|
|
598
|
-
|
|
598
|
+
d.set(u.subarray(o, o + p), l), c -= p, o += p, h -= p, l += p, r.length -= p;
|
|
599
599
|
break;
|
|
600
600
|
}
|
|
601
601
|
r.mode = TYPE;
|
|
602
602
|
break;
|
|
603
603
|
case TABLE:
|
|
604
|
-
for (;
|
|
604
|
+
for (; m < 14; ) {
|
|
605
605
|
if (c === 0)
|
|
606
606
|
break e;
|
|
607
|
-
c--, a += u[o++] <<
|
|
607
|
+
c--, a += u[o++] << m, m += 8;
|
|
608
608
|
}
|
|
609
|
-
if (r.nlen = (a & 31) + 257, a >>>= 5,
|
|
609
|
+
if (r.nlen = (a & 31) + 257, a >>>= 5, m -= 5, r.ndist = (a & 31) + 1, a >>>= 5, m -= 5, r.ncode = (a & 15) + 4, a >>>= 4, m -= 4, r.nlen > 286 || r.ndist > 30) {
|
|
610
610
|
s.msg = "too many length or distance symbols", r.mode = BAD;
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
@@ -614,12 +614,12 @@ const fixedtables = (s) => {
|
|
|
614
614
|
/* falls through */
|
|
615
615
|
case LENLENS:
|
|
616
616
|
for (; r.have < r.ncode; ) {
|
|
617
|
-
for (;
|
|
617
|
+
for (; m < 3; ) {
|
|
618
618
|
if (c === 0)
|
|
619
619
|
break e;
|
|
620
|
-
c--, a += u[o++] <<
|
|
620
|
+
c--, a += u[o++] << m, m += 8;
|
|
621
621
|
}
|
|
622
|
-
r.lens[$[r.have++]] = a & 7, a >>>= 3,
|
|
622
|
+
r.lens[$[r.have++]] = a & 7, a >>>= 3, m -= 3;
|
|
623
623
|
}
|
|
624
624
|
for (; r.have < 19; )
|
|
625
625
|
r.lens[$[r.have++]] = 0;
|
|
@@ -633,45 +633,45 @@ const fixedtables = (s) => {
|
|
|
633
633
|
/* falls through */
|
|
634
634
|
case CODELENS:
|
|
635
635
|
for (; r.have < r.nlen + r.ndist; ) {
|
|
636
|
-
for (; _ = r.lencode[a & (1 << r.lenbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <=
|
|
636
|
+
for (; _ = r.lencode[a & (1 << r.lenbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <= m); ) {
|
|
637
637
|
if (c === 0)
|
|
638
638
|
break e;
|
|
639
|
-
c--, a += u[o++] <<
|
|
639
|
+
c--, a += u[o++] << m, m += 8;
|
|
640
640
|
}
|
|
641
641
|
if (x < 16)
|
|
642
|
-
a >>>= T,
|
|
642
|
+
a >>>= T, m -= T, r.lens[r.have++] = x;
|
|
643
643
|
else {
|
|
644
644
|
if (x === 16) {
|
|
645
|
-
for (I = T + 2;
|
|
645
|
+
for (I = T + 2; m < I; ) {
|
|
646
646
|
if (c === 0)
|
|
647
647
|
break e;
|
|
648
|
-
c--, a += u[o++] <<
|
|
648
|
+
c--, a += u[o++] << m, m += 8;
|
|
649
649
|
}
|
|
650
|
-
if (a >>>= T,
|
|
650
|
+
if (a >>>= T, m -= T, r.have === 0) {
|
|
651
651
|
s.msg = "invalid bit length repeat", r.mode = BAD;
|
|
652
652
|
break;
|
|
653
653
|
}
|
|
654
|
-
S = r.lens[r.have - 1],
|
|
654
|
+
S = r.lens[r.have - 1], p = 3 + (a & 3), a >>>= 2, m -= 2;
|
|
655
655
|
} else if (x === 17) {
|
|
656
|
-
for (I = T + 3;
|
|
656
|
+
for (I = T + 3; m < I; ) {
|
|
657
657
|
if (c === 0)
|
|
658
658
|
break e;
|
|
659
|
-
c--, a += u[o++] <<
|
|
659
|
+
c--, a += u[o++] << m, m += 8;
|
|
660
660
|
}
|
|
661
|
-
a >>>= T,
|
|
661
|
+
a >>>= T, m -= T, S = 0, p = 3 + (a & 7), a >>>= 3, m -= 3;
|
|
662
662
|
} else {
|
|
663
|
-
for (I = T + 7;
|
|
663
|
+
for (I = T + 7; m < I; ) {
|
|
664
664
|
if (c === 0)
|
|
665
665
|
break e;
|
|
666
|
-
c--, a += u[o++] <<
|
|
666
|
+
c--, a += u[o++] << m, m += 8;
|
|
667
667
|
}
|
|
668
|
-
a >>>= T,
|
|
668
|
+
a >>>= T, m -= T, S = 0, p = 11 + (a & 127), a >>>= 7, m -= 7;
|
|
669
669
|
}
|
|
670
|
-
if (r.have +
|
|
670
|
+
if (r.have + p > r.nlen + r.ndist) {
|
|
671
671
|
s.msg = "invalid bit length repeat", r.mode = BAD;
|
|
672
672
|
break;
|
|
673
673
|
}
|
|
674
|
-
for (;
|
|
674
|
+
for (; p--; )
|
|
675
675
|
r.lens[r.have++] = S;
|
|
676
676
|
}
|
|
677
677
|
}
|
|
@@ -709,24 +709,24 @@ const fixedtables = (s) => {
|
|
|
709
709
|
r.mode = LEN;
|
|
710
710
|
/* falls through */
|
|
711
711
|
case LEN:
|
|
712
|
-
if (c >= 6 &&
|
|
713
|
-
s.next_out = l, s.avail_out =
|
|
712
|
+
if (c >= 6 && h >= 258) {
|
|
713
|
+
s.next_out = l, s.avail_out = h, s.next_in = o, s.avail_in = c, r.hold = a, r.bits = m, inflate_fast(s, g), l = s.next_out, d = s.output, h = s.avail_out, o = s.next_in, u = s.input, c = s.avail_in, a = r.hold, m = r.bits, r.mode === TYPE && (r.back = -1);
|
|
714
714
|
break;
|
|
715
715
|
}
|
|
716
|
-
for (r.back = 0; _ = r.lencode[a & (1 << r.lenbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <=
|
|
716
|
+
for (r.back = 0; _ = r.lencode[a & (1 << r.lenbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <= m); ) {
|
|
717
717
|
if (c === 0)
|
|
718
718
|
break e;
|
|
719
|
-
c--, a += u[o++] <<
|
|
719
|
+
c--, a += u[o++] << m, m += 8;
|
|
720
720
|
}
|
|
721
721
|
if (w && (w & 240) === 0) {
|
|
722
|
-
for (O = T,
|
|
722
|
+
for (O = T, E = w, R = x; _ = r.lencode[R + ((a & (1 << O + E) - 1) >> O)], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(O + T <= m); ) {
|
|
723
723
|
if (c === 0)
|
|
724
724
|
break e;
|
|
725
|
-
c--, a += u[o++] <<
|
|
725
|
+
c--, a += u[o++] << m, m += 8;
|
|
726
726
|
}
|
|
727
|
-
a >>>= O,
|
|
727
|
+
a >>>= O, m -= O, r.back += O;
|
|
728
728
|
}
|
|
729
|
-
if (a >>>= T,
|
|
729
|
+
if (a >>>= T, m -= T, r.back += T, r.length = x, w === 0) {
|
|
730
730
|
r.mode = LIT;
|
|
731
731
|
break;
|
|
732
732
|
}
|
|
@@ -742,30 +742,30 @@ const fixedtables = (s) => {
|
|
|
742
742
|
/* falls through */
|
|
743
743
|
case LENEXT:
|
|
744
744
|
if (r.extra) {
|
|
745
|
-
for (I = r.extra;
|
|
745
|
+
for (I = r.extra; m < I; ) {
|
|
746
746
|
if (c === 0)
|
|
747
747
|
break e;
|
|
748
|
-
c--, a += u[o++] <<
|
|
748
|
+
c--, a += u[o++] << m, m += 8;
|
|
749
749
|
}
|
|
750
|
-
r.length += a & (1 << r.extra) - 1, a >>>= r.extra,
|
|
750
|
+
r.length += a & (1 << r.extra) - 1, a >>>= r.extra, m -= r.extra, r.back += r.extra;
|
|
751
751
|
}
|
|
752
752
|
r.was = r.length, r.mode = DIST;
|
|
753
753
|
/* falls through */
|
|
754
754
|
case DIST:
|
|
755
|
-
for (; _ = r.distcode[a & (1 << r.distbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <=
|
|
755
|
+
for (; _ = r.distcode[a & (1 << r.distbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <= m); ) {
|
|
756
756
|
if (c === 0)
|
|
757
757
|
break e;
|
|
758
|
-
c--, a += u[o++] <<
|
|
758
|
+
c--, a += u[o++] << m, m += 8;
|
|
759
759
|
}
|
|
760
760
|
if ((w & 240) === 0) {
|
|
761
|
-
for (O = T,
|
|
761
|
+
for (O = T, E = w, R = x; _ = r.distcode[R + ((a & (1 << O + E) - 1) >> O)], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(O + T <= m); ) {
|
|
762
762
|
if (c === 0)
|
|
763
763
|
break e;
|
|
764
|
-
c--, a += u[o++] <<
|
|
764
|
+
c--, a += u[o++] << m, m += 8;
|
|
765
765
|
}
|
|
766
|
-
a >>>= O,
|
|
766
|
+
a >>>= O, m -= O, r.back += O;
|
|
767
767
|
}
|
|
768
|
-
if (a >>>= T,
|
|
768
|
+
if (a >>>= T, m -= T, r.back += T, w & 64) {
|
|
769
769
|
s.msg = "invalid distance code", r.mode = BAD;
|
|
770
770
|
break;
|
|
771
771
|
}
|
|
@@ -773,12 +773,12 @@ const fixedtables = (s) => {
|
|
|
773
773
|
/* falls through */
|
|
774
774
|
case DISTEXT:
|
|
775
775
|
if (r.extra) {
|
|
776
|
-
for (I = r.extra;
|
|
776
|
+
for (I = r.extra; m < I; ) {
|
|
777
777
|
if (c === 0)
|
|
778
778
|
break e;
|
|
779
|
-
c--, a += u[o++] <<
|
|
779
|
+
c--, a += u[o++] << m, m += 8;
|
|
780
780
|
}
|
|
781
|
-
r.offset += a & (1 << r.extra) - 1, a >>>= r.extra,
|
|
781
|
+
r.offset += a & (1 << r.extra) - 1, a >>>= r.extra, m -= r.extra, r.back += r.extra;
|
|
782
782
|
}
|
|
783
783
|
if (r.offset > r.dmax) {
|
|
784
784
|
s.msg = "invalid distance too far back", r.mode = BAD;
|
|
@@ -787,55 +787,55 @@ const fixedtables = (s) => {
|
|
|
787
787
|
r.mode = MATCH;
|
|
788
788
|
/* falls through */
|
|
789
789
|
case MATCH:
|
|
790
|
-
if (
|
|
790
|
+
if (h === 0)
|
|
791
791
|
break e;
|
|
792
|
-
if (
|
|
793
|
-
if (
|
|
792
|
+
if (p = g - h, r.offset > p) {
|
|
793
|
+
if (p = r.offset - p, p > r.whave && r.sane) {
|
|
794
794
|
s.msg = "invalid distance too far back", r.mode = BAD;
|
|
795
795
|
break;
|
|
796
796
|
}
|
|
797
|
-
|
|
797
|
+
p > r.wnext ? (p -= r.wnext, v = r.wsize - p) : v = r.wnext - p, p > r.length && (p = r.length), b = r.window;
|
|
798
798
|
} else
|
|
799
|
-
b =
|
|
800
|
-
|
|
799
|
+
b = d, v = l - r.offset, p = r.length;
|
|
800
|
+
p > h && (p = h), h -= p, r.length -= p;
|
|
801
801
|
do
|
|
802
|
-
|
|
803
|
-
while (--
|
|
802
|
+
d[l++] = b[v++];
|
|
803
|
+
while (--p);
|
|
804
804
|
r.length === 0 && (r.mode = LEN);
|
|
805
805
|
break;
|
|
806
806
|
case LIT:
|
|
807
|
-
if (
|
|
807
|
+
if (h === 0)
|
|
808
808
|
break e;
|
|
809
|
-
|
|
809
|
+
d[l++] = r.length, h--, r.mode = LEN;
|
|
810
810
|
break;
|
|
811
811
|
case CHECK:
|
|
812
812
|
if (r.wrap) {
|
|
813
|
-
for (;
|
|
813
|
+
for (; m < 32; ) {
|
|
814
814
|
if (c === 0)
|
|
815
815
|
break e;
|
|
816
|
-
c--, a |= u[o++] <<
|
|
816
|
+
c--, a |= u[o++] << m, m += 8;
|
|
817
817
|
}
|
|
818
|
-
if (g -=
|
|
819
|
-
r.flags ? crc32(r.check,
|
|
818
|
+
if (g -= h, s.total_out += g, r.total += g, r.wrap & 4 && g && (s.adler = r.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/
|
|
819
|
+
r.flags ? crc32(r.check, d, g, l - g) : adler32(r.check, d, g, l - g)), g = h, r.wrap & 4 && (r.flags ? a : zswap32(a)) !== r.check) {
|
|
820
820
|
s.msg = "incorrect data check", r.mode = BAD;
|
|
821
821
|
break;
|
|
822
822
|
}
|
|
823
|
-
a = 0,
|
|
823
|
+
a = 0, m = 0;
|
|
824
824
|
}
|
|
825
825
|
r.mode = LENGTH;
|
|
826
826
|
/* falls through */
|
|
827
827
|
case LENGTH:
|
|
828
828
|
if (r.wrap && r.flags) {
|
|
829
|
-
for (;
|
|
829
|
+
for (; m < 32; ) {
|
|
830
830
|
if (c === 0)
|
|
831
831
|
break e;
|
|
832
|
-
c--, a += u[o++] <<
|
|
832
|
+
c--, a += u[o++] << m, m += 8;
|
|
833
833
|
}
|
|
834
834
|
if (r.wrap & 4 && a !== (r.total & 4294967295)) {
|
|
835
835
|
s.msg = "incorrect length check", r.mode = BAD;
|
|
836
836
|
break;
|
|
837
837
|
}
|
|
838
|
-
a = 0,
|
|
838
|
+
a = 0, m = 0;
|
|
839
839
|
}
|
|
840
840
|
r.mode = DONE;
|
|
841
841
|
/* falls through */
|
|
@@ -852,8 +852,8 @@ const fixedtables = (s) => {
|
|
|
852
852
|
default:
|
|
853
853
|
return Z_STREAM_ERROR$1;
|
|
854
854
|
}
|
|
855
|
-
return s.next_out = l, s.avail_out =
|
|
856
|
-
r.flags ? crc32(r.check,
|
|
855
|
+
return s.next_out = l, s.avail_out = h, s.next_in = o, s.avail_in = c, r.hold = a, r.bits = m, (r.wsize || g !== s.avail_out && r.mode < BAD && (r.mode < CHECK || i !== Z_FINISH$1)) && updatewindow(s, s.output, s.next_out, g - s.avail_out), y -= s.avail_in, g -= s.avail_out, s.total_in += y, s.total_out += g, r.total += g, r.wrap & 4 && g && (s.adler = r.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
|
|
856
|
+
r.flags ? crc32(r.check, d, g, s.next_out - g) : adler32(r.check, d, g, s.next_out - g)), s.data_type = r.bits + (r.last ? 64 : 0) + (r.mode === TYPE ? 128 : 0) + (r.mode === LEN_ || r.mode === COPY_ ? 256 : 0), (y === 0 && g === 0 || i === Z_FINISH$1) && P === Z_OK$1 && (P = Z_BUF_ERROR), P;
|
|
857
857
|
}, inflateEnd = (s) => {
|
|
858
858
|
if (inflateStateCheck(s))
|
|
859
859
|
return Z_STREAM_ERROR$1;
|
|
@@ -866,8 +866,8 @@ const fixedtables = (s) => {
|
|
|
866
866
|
return (r.wrap & 2) === 0 ? Z_STREAM_ERROR$1 : (r.head = i, i.done = !1, Z_OK$1);
|
|
867
867
|
}, inflateSetDictionary = (s, i) => {
|
|
868
868
|
const r = i.length;
|
|
869
|
-
let u,
|
|
870
|
-
return inflateStateCheck(s) || (u = s.state, u.wrap !== 0 && u.mode !== DICT) ? Z_STREAM_ERROR$1 : u.mode === DICT && (
|
|
869
|
+
let u, d, o;
|
|
870
|
+
return inflateStateCheck(s) || (u = s.state, u.wrap !== 0 && u.mode !== DICT) ? Z_STREAM_ERROR$1 : u.mode === DICT && (d = 1, d = adler32(d, i, r, 0), d !== u.check) ? Z_DATA_ERROR$1 : (o = updatewindow(s, i, r, r), o ? (u.mode = MEM, Z_MEM_ERROR$1) : (u.havedict = 1, Z_OK$1));
|
|
871
871
|
};
|
|
872
872
|
inflate$2.inflateReset = inflateReset;
|
|
873
873
|
inflate$2.inflateReset2 = inflateReset2;
|
|
@@ -896,12 +896,12 @@ common$1.assign = function(s) {
|
|
|
896
896
|
};
|
|
897
897
|
common$1.flattenChunks = (s) => {
|
|
898
898
|
let i = 0;
|
|
899
|
-
for (let u = 0,
|
|
899
|
+
for (let u = 0, d = s.length; u < d; u++)
|
|
900
900
|
i += s[u].length;
|
|
901
901
|
const r = new Uint8Array(i);
|
|
902
|
-
for (let u = 0,
|
|
902
|
+
for (let u = 0, d = 0, o = s.length; u < o; u++) {
|
|
903
903
|
let l = s[u];
|
|
904
|
-
r.set(l,
|
|
904
|
+
r.set(l, d), d += l.length;
|
|
905
905
|
}
|
|
906
906
|
return r;
|
|
907
907
|
};
|
|
@@ -919,11 +919,11 @@ _utf8len[254] = _utf8len[254] = 1;
|
|
|
919
919
|
strings$1.string2buf = (s) => {
|
|
920
920
|
if (typeof TextEncoder == "function" && TextEncoder.prototype.encode)
|
|
921
921
|
return new TextEncoder().encode(s);
|
|
922
|
-
let i, r, u,
|
|
923
|
-
for (
|
|
924
|
-
r = s.charCodeAt(
|
|
925
|
-
for (i = new Uint8Array(c), o = 0,
|
|
926
|
-
r = s.charCodeAt(
|
|
922
|
+
let i, r, u, d, o, l = s.length, c = 0;
|
|
923
|
+
for (d = 0; d < l; d++)
|
|
924
|
+
r = s.charCodeAt(d), (r & 64512) === 55296 && d + 1 < l && (u = s.charCodeAt(d + 1), (u & 64512) === 56320 && (r = 65536 + (r - 55296 << 10) + (u - 56320), d++)), c += r < 128 ? 1 : r < 2048 ? 2 : r < 65536 ? 3 : 4;
|
|
925
|
+
for (i = new Uint8Array(c), o = 0, d = 0; o < c; d++)
|
|
926
|
+
r = s.charCodeAt(d), (r & 64512) === 55296 && d + 1 < l && (u = s.charCodeAt(d + 1), (u & 64512) === 56320 && (r = 65536 + (r - 55296 << 10) + (u - 56320), d++)), r < 128 ? i[o++] = r : r < 2048 ? (i[o++] = 192 | r >>> 6, i[o++] = 128 | r & 63) : r < 65536 ? (i[o++] = 224 | r >>> 12, i[o++] = 128 | r >>> 6 & 63, i[o++] = 128 | r & 63) : (i[o++] = 240 | r >>> 18, i[o++] = 128 | r >>> 12 & 63, i[o++] = 128 | r >>> 6 & 63, i[o++] = 128 | r & 63);
|
|
927
927
|
return i;
|
|
928
928
|
};
|
|
929
929
|
const buf2binstring = (s, i) => {
|
|
@@ -938,28 +938,28 @@ strings$1.buf2string = (s, i) => {
|
|
|
938
938
|
const r = i || s.length;
|
|
939
939
|
if (typeof TextDecoder == "function" && TextDecoder.prototype.decode)
|
|
940
940
|
return new TextDecoder().decode(s.subarray(0, i));
|
|
941
|
-
let u,
|
|
941
|
+
let u, d;
|
|
942
942
|
const o = new Array(r * 2);
|
|
943
|
-
for (
|
|
943
|
+
for (d = 0, u = 0; u < r; ) {
|
|
944
944
|
let l = s[u++];
|
|
945
945
|
if (l < 128) {
|
|
946
|
-
o[
|
|
946
|
+
o[d++] = l;
|
|
947
947
|
continue;
|
|
948
948
|
}
|
|
949
949
|
let c = _utf8len[l];
|
|
950
950
|
if (c > 4) {
|
|
951
|
-
o[
|
|
951
|
+
o[d++] = 65533, u += c - 1;
|
|
952
952
|
continue;
|
|
953
953
|
}
|
|
954
954
|
for (l &= c === 2 ? 31 : c === 3 ? 15 : 7; c > 1 && u < r; )
|
|
955
955
|
l = l << 6 | s[u++] & 63, c--;
|
|
956
956
|
if (c > 1) {
|
|
957
|
-
o[
|
|
957
|
+
o[d++] = 65533;
|
|
958
958
|
continue;
|
|
959
959
|
}
|
|
960
|
-
l < 65536 ? o[
|
|
960
|
+
l < 65536 ? o[d++] = l : (l -= 65536, o[d++] = 55296 | l >> 10 & 1023, o[d++] = 56320 | l & 1023);
|
|
961
961
|
}
|
|
962
|
-
return buf2binstring(o,
|
|
962
|
+
return buf2binstring(o, d);
|
|
963
963
|
};
|
|
964
964
|
strings$1.utf8border = (s, i) => {
|
|
965
965
|
i = i || s.length, i > s.length && (i = s.length);
|
|
@@ -1023,11 +1023,11 @@ function Inflate(s) {
|
|
|
1023
1023
|
throw new Error(msg[r]);
|
|
1024
1024
|
}
|
|
1025
1025
|
Inflate.prototype.push = function(s, i) {
|
|
1026
|
-
const r = this.strm, u = this.options.chunkSize,
|
|
1026
|
+
const r = this.strm, u = this.options.chunkSize, d = this.options.dictionary;
|
|
1027
1027
|
let o, l, c;
|
|
1028
1028
|
if (this.ended) return !1;
|
|
1029
1029
|
for (i === ~~i ? l = i : l = i === !0 ? Z_FINISH : Z_NO_FLUSH, toString.call(s) === "[object ArrayBuffer]" ? r.input = new Uint8Array(s) : r.input = s, r.next_in = 0, r.avail_in = r.input.length; ; ) {
|
|
1030
|
-
for (r.avail_out === 0 && (r.output = new Uint8Array(u), r.next_out = 0, r.avail_out = u), o = zlib_inflate.inflate(r, l), o === Z_NEED_DICT &&
|
|
1030
|
+
for (r.avail_out === 0 && (r.output = new Uint8Array(u), r.next_out = 0, r.avail_out = u), o = zlib_inflate.inflate(r, l), o === Z_NEED_DICT && d && (o = zlib_inflate.inflateSetDictionary(r, d), o === Z_OK ? o = zlib_inflate.inflate(r, l) : o === Z_DATA_ERROR && (o = Z_NEED_DICT)); r.avail_in > 0 && o === Z_STREAM_END && r.state.wrap > 0 && s[r.next_in] !== 0; )
|
|
1031
1031
|
zlib_inflate.inflateReset(r), o = zlib_inflate.inflate(r, l);
|
|
1032
1032
|
switch (o) {
|
|
1033
1033
|
case Z_STREAM_ERROR:
|
|
@@ -1038,8 +1038,8 @@ Inflate.prototype.push = function(s, i) {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
if (c = r.avail_out, r.next_out && (r.avail_out === 0 || o === Z_STREAM_END))
|
|
1040
1040
|
if (this.options.to === "string") {
|
|
1041
|
-
let
|
|
1042
|
-
r.next_out = a, r.avail_out = u - a, a && r.output.set(r.output.subarray(
|
|
1041
|
+
let h = strings.utf8border(r.output, r.next_out), a = r.next_out - h, m = strings.buf2string(r.output, h);
|
|
1042
|
+
r.next_out = a, r.avail_out = u - a, a && r.output.set(r.output.subarray(h, h + a), 0), this.onData(m);
|
|
1043
1043
|
} else
|
|
1044
1044
|
this.onData(
|
|
1045
1045
|
r.output.length === r.next_out ? r.output : r.output.subarray(0, r.next_out)
|
|
@@ -1064,8 +1064,8 @@ function inflate(s, i) {
|
|
|
1064
1064
|
return r.result;
|
|
1065
1065
|
}
|
|
1066
1066
|
var inflate_2 = inflate;
|
|
1067
|
-
function f(s, i, r, u,
|
|
1068
|
-
let l = s.tileXYToRectangle(r, u,
|
|
1067
|
+
function f(s, i, r, u, d, o) {
|
|
1068
|
+
let l = s.tileXYToRectangle(r, u, d);
|
|
1069
1069
|
return defined(Rectangle$1.intersection(l, i, o));
|
|
1070
1070
|
}
|
|
1071
1071
|
class GeoTerrainProvider {
|
|
@@ -1113,7 +1113,7 @@ class GeoTerrainProvider {
|
|
|
1113
1113
|
this._tilingScheme.getNumberOfXTilesAtLevel(0)
|
|
1114
1114
|
), this._ready = !0, this._topLevel = i.topLevel ?? 5, this._bottomLevel = i.bottomLevel ?? 25;
|
|
1115
1115
|
}
|
|
1116
|
-
requestTileGeometry(i, r, u,
|
|
1116
|
+
requestTileGeometry(i, r, u, d) {
|
|
1117
1117
|
if (!this.ready)
|
|
1118
1118
|
throw new DeveloperError("requestTileGeometry must not be called before ready returns true.");
|
|
1119
1119
|
if (u >= this._bottomLevel) return Promise.reject(`${u}该级别不发送请求!`);
|
|
@@ -1131,12 +1131,12 @@ class GeoTerrainProvider {
|
|
|
1131
1131
|
Array.isArray(this._subdomains) && this._subdomains.length && (o = this._subdomains[(i + r) % this._subdomains.length], l = l.replace("{s}", o)), l = l.replace("{token}", this._token).replace("{x}", i).replace("{y}", r).replace("{z}", u + 1);
|
|
1132
1132
|
const c = Resource.fetchArrayBuffer({
|
|
1133
1133
|
url: l,
|
|
1134
|
-
request:
|
|
1134
|
+
request: d
|
|
1135
1135
|
});
|
|
1136
1136
|
if (c)
|
|
1137
|
-
return c.then((
|
|
1137
|
+
return c.then((h) => h.byteLength < 1e3 ? Promise.reject("无效数据") : inflate_2(h)).then((h) => {
|
|
1138
1138
|
const a = new HeightmapTerrainData({
|
|
1139
|
-
buffer: this.transformBuffer(
|
|
1139
|
+
buffer: this.transformBuffer(h),
|
|
1140
1140
|
width: this._heightmapWidth,
|
|
1141
1141
|
height: this._heightmapHeight,
|
|
1142
1142
|
childTileMask: this.getChildTileMask(i, r, u),
|
|
@@ -1158,11 +1158,11 @@ class GeoTerrainProvider {
|
|
|
1158
1158
|
this._dataType === "int" ? r = 2 : this._dataType === "float" && (r = 4);
|
|
1159
1159
|
let u = i;
|
|
1160
1160
|
if (u.length !== 22500 * r) return null;
|
|
1161
|
-
let
|
|
1162
|
-
for (let
|
|
1163
|
-
for (let v = 0; v <
|
|
1164
|
-
l = parseInt(149 *
|
|
1165
|
-
let b = (
|
|
1161
|
+
let d, o, l, c, h = new ArrayBuffer(r), a = new DataView(h), m = this._heightmapWidth, y = this._heightmapHeight, g = new Uint8Array(m * y * 4);
|
|
1162
|
+
for (let p = 0; p < y; p++)
|
|
1163
|
+
for (let v = 0; v < m; v++) {
|
|
1164
|
+
l = parseInt(149 * p / (y - 1)), c = parseInt(149 * v / (m - 1)), o = r * (150 * l + c), r === 4 ? (a.setInt8(0, u[o]), a.setInt8(1, u[o + 1]), a.setInt8(2, u[o + 2]), a.setInt8(3, u[o + 3]), d = a.getFloat32(0, !0)) : d = u[o] + 256 * u[o + 1], (1e4 < d || d < -2e3) && (d = 0);
|
|
1165
|
+
let b = (d + 1e3) / 1e-3, _ = 4 * (p * m + v);
|
|
1166
1166
|
g[_] = b / 65536, g[1 + _] = (b - 256 * g[_] * 256) / 256, g[2 + _] = b - 256 * g[_] * 256 - 256 * g[1 + _], g[3 + _] = 255;
|
|
1167
1167
|
}
|
|
1168
1168
|
return g;
|
|
@@ -1178,15 +1178,15 @@ class GeoTerrainProvider {
|
|
|
1178
1178
|
return i;
|
|
1179
1179
|
}
|
|
1180
1180
|
getChildTileMask(i, r, u) {
|
|
1181
|
-
let
|
|
1182
|
-
for (let a = 0; a < l.length &&
|
|
1183
|
-
let
|
|
1184
|
-
if (!(
|
|
1185
|
-
let y =
|
|
1186
|
-
defined(g) && (f(o, y, 2 * i, 2 * r, u + 1,
|
|
1181
|
+
let d = new Rectangle$1(), o = this._tilingScheme, l = this._rectangles, c = o.tileXYToRectangle(i, r, u), h = 0;
|
|
1182
|
+
for (let a = 0; a < l.length && h !== 15; ++a) {
|
|
1183
|
+
let m = l[a];
|
|
1184
|
+
if (!(m.maxLevel <= u)) {
|
|
1185
|
+
let y = m.rectangle, g = Rectangle$1.intersection(y, c, d);
|
|
1186
|
+
defined(g) && (f(o, y, 2 * i, 2 * r, u + 1, d) && (h |= 4), f(o, y, 2 * i + 1, 2 * r, u + 1, d) && (h |= 8), f(o, y, 2 * i, 2 * r + 1, u + 1, d) && (h |= 1), f(o, y, 2 * i + 1, 2 * r + 1, u + 1, d) && (h |= 2));
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
1189
|
-
return
|
|
1189
|
+
return h;
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
1192
|
var src = { exports: {} }, indexLight = { exports: {} }, indexMinimal = {}, minimal = {}, aspromise, hasRequiredAspromise;
|
|
@@ -1194,20 +1194,20 @@ function requireAspromise() {
|
|
|
1194
1194
|
if (hasRequiredAspromise) return aspromise;
|
|
1195
1195
|
hasRequiredAspromise = 1, aspromise = s;
|
|
1196
1196
|
function s(i, r) {
|
|
1197
|
-
for (var u = new Array(arguments.length - 1),
|
|
1198
|
-
return new Promise(function(
|
|
1199
|
-
u[
|
|
1197
|
+
for (var u = new Array(arguments.length - 1), d = 0, o = 2, l = !0; o < arguments.length; ) u[d++] = arguments[o++];
|
|
1198
|
+
return new Promise(function(h, a) {
|
|
1199
|
+
u[d] = function(y) {
|
|
1200
1200
|
if (l)
|
|
1201
1201
|
if (l = !1, y) a(y);
|
|
1202
1202
|
else {
|
|
1203
|
-
for (var g = new Array(arguments.length - 1),
|
|
1204
|
-
|
|
1203
|
+
for (var g = new Array(arguments.length - 1), p = 0; p < g.length; ) g[p++] = arguments[p];
|
|
1204
|
+
h.apply(null, g);
|
|
1205
1205
|
}
|
|
1206
1206
|
};
|
|
1207
1207
|
try {
|
|
1208
1208
|
i.apply(r || null, u);
|
|
1209
|
-
} catch (
|
|
1210
|
-
l && (l = !1, a(
|
|
1209
|
+
} catch (m) {
|
|
1210
|
+
l && (l = !1, a(m));
|
|
1211
1211
|
}
|
|
1212
1212
|
});
|
|
1213
1213
|
}
|
|
@@ -1218,35 +1218,35 @@ function requireBase64() {
|
|
|
1218
1218
|
return hasRequiredBase64 || (hasRequiredBase64 = 1, function(s) {
|
|
1219
1219
|
var i = s;
|
|
1220
1220
|
i.length = function(c) {
|
|
1221
|
-
var
|
|
1222
|
-
if (!
|
|
1223
|
-
for (var a = 0; --
|
|
1221
|
+
var h = c.length;
|
|
1222
|
+
if (!h) return 0;
|
|
1223
|
+
for (var a = 0; --h % 4 > 1 && c.charAt(h) === "="; ) ++a;
|
|
1224
1224
|
return Math.ceil(c.length * 3) / 4 - a;
|
|
1225
1225
|
};
|
|
1226
|
-
for (var r = new Array(64), u = new Array(123),
|
|
1227
|
-
u[r[
|
|
1228
|
-
i.encode = function(c,
|
|
1229
|
-
for (var
|
|
1230
|
-
var b = c[
|
|
1231
|
-
switch (
|
|
1226
|
+
for (var r = new Array(64), u = new Array(123), d = 0; d < 64; )
|
|
1227
|
+
u[r[d] = d < 26 ? d + 65 : d < 52 ? d + 71 : d < 62 ? d - 4 : d - 59 | 43] = d++;
|
|
1228
|
+
i.encode = function(c, h, a) {
|
|
1229
|
+
for (var m = null, y = [], g = 0, p = 0, v; h < a; ) {
|
|
1230
|
+
var b = c[h++];
|
|
1231
|
+
switch (p) {
|
|
1232
1232
|
case 0:
|
|
1233
|
-
y[g++] = r[b >> 2], v = (b & 3) << 4,
|
|
1233
|
+
y[g++] = r[b >> 2], v = (b & 3) << 4, p = 1;
|
|
1234
1234
|
break;
|
|
1235
1235
|
case 1:
|
|
1236
|
-
y[g++] = r[v | b >> 4], v = (b & 15) << 2,
|
|
1236
|
+
y[g++] = r[v | b >> 4], v = (b & 15) << 2, p = 2;
|
|
1237
1237
|
break;
|
|
1238
1238
|
case 2:
|
|
1239
|
-
y[g++] = r[v | b >> 6], y[g++] = r[b & 63],
|
|
1239
|
+
y[g++] = r[v | b >> 6], y[g++] = r[b & 63], p = 0;
|
|
1240
1240
|
break;
|
|
1241
1241
|
}
|
|
1242
|
-
g > 8191 && ((
|
|
1242
|
+
g > 8191 && ((m || (m = [])).push(String.fromCharCode.apply(String, y)), g = 0);
|
|
1243
1243
|
}
|
|
1244
|
-
return
|
|
1244
|
+
return p && (y[g++] = r[v], y[g++] = 61, p === 1 && (y[g++] = 61)), m ? (g && m.push(String.fromCharCode.apply(String, y.slice(0, g))), m.join("")) : String.fromCharCode.apply(String, y.slice(0, g));
|
|
1245
1245
|
};
|
|
1246
1246
|
var o = "invalid encoding";
|
|
1247
|
-
i.decode = function(c,
|
|
1248
|
-
for (var
|
|
1249
|
-
var v = c.charCodeAt(
|
|
1247
|
+
i.decode = function(c, h, a) {
|
|
1248
|
+
for (var m = a, y = 0, g, p = 0; p < c.length; ) {
|
|
1249
|
+
var v = c.charCodeAt(p++);
|
|
1250
1250
|
if (v === 61 && y > 1) break;
|
|
1251
1251
|
if ((v = u[v]) === void 0) throw Error(o);
|
|
1252
1252
|
switch (y) {
|
|
@@ -1254,18 +1254,18 @@ function requireBase64() {
|
|
|
1254
1254
|
g = v, y = 1;
|
|
1255
1255
|
break;
|
|
1256
1256
|
case 1:
|
|
1257
|
-
|
|
1257
|
+
h[a++] = g << 2 | (v & 48) >> 4, g = v, y = 2;
|
|
1258
1258
|
break;
|
|
1259
1259
|
case 2:
|
|
1260
|
-
|
|
1260
|
+
h[a++] = (g & 15) << 4 | (v & 60) >> 2, g = v, y = 3;
|
|
1261
1261
|
break;
|
|
1262
1262
|
case 3:
|
|
1263
|
-
|
|
1263
|
+
h[a++] = (g & 3) << 6 | v, y = 0;
|
|
1264
1264
|
break;
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
1267
|
if (y === 1) throw Error(o);
|
|
1268
|
-
return a -
|
|
1268
|
+
return a - m;
|
|
1269
1269
|
}, i.test = function(c) {
|
|
1270
1270
|
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c);
|
|
1271
1271
|
};
|
|
@@ -1278,23 +1278,23 @@ function requireEventemitter() {
|
|
|
1278
1278
|
function s() {
|
|
1279
1279
|
this._listeners = {};
|
|
1280
1280
|
}
|
|
1281
|
-
return s.prototype.on = function(r, u,
|
|
1281
|
+
return s.prototype.on = function(r, u, d) {
|
|
1282
1282
|
return (this._listeners[r] || (this._listeners[r] = [])).push({
|
|
1283
1283
|
fn: u,
|
|
1284
|
-
ctx:
|
|
1284
|
+
ctx: d || this
|
|
1285
1285
|
}), this;
|
|
1286
1286
|
}, s.prototype.off = function(r, u) {
|
|
1287
1287
|
if (r === void 0) this._listeners = {};
|
|
1288
1288
|
else if (u === void 0) this._listeners[r] = [];
|
|
1289
1289
|
else
|
|
1290
|
-
for (var
|
|
1291
|
-
|
|
1290
|
+
for (var d = this._listeners[r], o = 0; o < d.length; )
|
|
1291
|
+
d[o].fn === u ? d.splice(o, 1) : ++o;
|
|
1292
1292
|
return this;
|
|
1293
1293
|
}, s.prototype.emit = function(r) {
|
|
1294
1294
|
var u = this._listeners[r];
|
|
1295
1295
|
if (u) {
|
|
1296
|
-
for (var
|
|
1297
|
-
for (o = 0; o < u.length; ) u[o].fn.apply(u[o++].ctx,
|
|
1296
|
+
for (var d = [], o = 1; o < arguments.length; ) d.push(arguments[o++]);
|
|
1297
|
+
for (o = 0; o < u.length; ) u[o].fn.apply(u[o++].ctx, d);
|
|
1298
1298
|
}
|
|
1299
1299
|
return this;
|
|
1300
1300
|
}, eventemitter;
|
|
@@ -1305,99 +1305,99 @@ function requireFloat() {
|
|
|
1305
1305
|
hasRequiredFloat = 1, float = s(s);
|
|
1306
1306
|
function s(o) {
|
|
1307
1307
|
return typeof Float32Array < "u" ? function() {
|
|
1308
|
-
var l = new Float32Array([-0]), c = new Uint8Array(l.buffer),
|
|
1309
|
-
function a(
|
|
1310
|
-
l[0] =
|
|
1308
|
+
var l = new Float32Array([-0]), c = new Uint8Array(l.buffer), h = c[3] === 128;
|
|
1309
|
+
function a(p, v, b) {
|
|
1310
|
+
l[0] = p, v[b] = c[0], v[b + 1] = c[1], v[b + 2] = c[2], v[b + 3] = c[3];
|
|
1311
1311
|
}
|
|
1312
|
-
function p
|
|
1313
|
-
l[0] =
|
|
1312
|
+
function m(p, v, b) {
|
|
1313
|
+
l[0] = p, v[b] = c[3], v[b + 1] = c[2], v[b + 2] = c[1], v[b + 3] = c[0];
|
|
1314
1314
|
}
|
|
1315
|
-
o.writeFloatLE =
|
|
1316
|
-
function y(
|
|
1317
|
-
return c[0] =
|
|
1315
|
+
o.writeFloatLE = h ? a : m, o.writeFloatBE = h ? m : a;
|
|
1316
|
+
function y(p, v) {
|
|
1317
|
+
return c[0] = p[v], c[1] = p[v + 1], c[2] = p[v + 2], c[3] = p[v + 3], l[0];
|
|
1318
1318
|
}
|
|
1319
|
-
function g(
|
|
1320
|
-
return c[3] =
|
|
1319
|
+
function g(p, v) {
|
|
1320
|
+
return c[3] = p[v], c[2] = p[v + 1], c[1] = p[v + 2], c[0] = p[v + 3], l[0];
|
|
1321
1321
|
}
|
|
1322
|
-
o.readFloatLE =
|
|
1322
|
+
o.readFloatLE = h ? y : g, o.readFloatBE = h ? g : y;
|
|
1323
1323
|
}() : function() {
|
|
1324
|
-
function l(
|
|
1324
|
+
function l(h, a, m, y) {
|
|
1325
1325
|
var g = a < 0 ? 1 : 0;
|
|
1326
1326
|
if (g && (a = -a), a === 0)
|
|
1327
|
-
|
|
1327
|
+
h(1 / a > 0 ? (
|
|
1328
1328
|
/* positive */
|
|
1329
1329
|
0
|
|
1330
1330
|
) : (
|
|
1331
1331
|
/* negative 0 */
|
|
1332
1332
|
2147483648
|
|
1333
|
-
),
|
|
1334
|
-
else if (isNaN(a))
|
|
1333
|
+
), m, y);
|
|
1334
|
+
else if (isNaN(a)) h(2143289344, m, y);
|
|
1335
1335
|
else if (a > 34028234663852886e22)
|
|
1336
|
-
|
|
1336
|
+
h((g << 31 | 2139095040) >>> 0, m, y);
|
|
1337
1337
|
else if (a < 11754943508222875e-54)
|
|
1338
|
-
|
|
1338
|
+
h((g << 31 | Math.round(a / 1401298464324817e-60)) >>> 0, m, y);
|
|
1339
1339
|
else {
|
|
1340
|
-
var
|
|
1341
|
-
|
|
1340
|
+
var p = Math.floor(Math.log(a) / Math.LN2), v = Math.round(a * Math.pow(2, -p) * 8388608) & 8388607;
|
|
1341
|
+
h((g << 31 | p + 127 << 23 | v) >>> 0, m, y);
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
o.writeFloatLE = l.bind(null, i), o.writeFloatBE = l.bind(null, r);
|
|
1345
|
-
function c(
|
|
1346
|
-
var y =
|
|
1347
|
-
return
|
|
1345
|
+
function c(h, a, m) {
|
|
1346
|
+
var y = h(a, m), g = (y >> 31) * 2 + 1, p = y >>> 23 & 255, v = y & 8388607;
|
|
1347
|
+
return p === 255 ? v ? NaN : g * (1 / 0) : p === 0 ? g * 1401298464324817e-60 * v : g * Math.pow(2, p - 150) * (v + 8388608);
|
|
1348
1348
|
}
|
|
1349
|
-
o.readFloatLE = c.bind(null, u), o.readFloatBE = c.bind(null,
|
|
1349
|
+
o.readFloatLE = c.bind(null, u), o.readFloatBE = c.bind(null, d);
|
|
1350
1350
|
}(), typeof Float64Array < "u" ? function() {
|
|
1351
|
-
var l = new Float64Array([-0]), c = new Uint8Array(l.buffer),
|
|
1352
|
-
function a(
|
|
1353
|
-
l[0] =
|
|
1351
|
+
var l = new Float64Array([-0]), c = new Uint8Array(l.buffer), h = c[7] === 128;
|
|
1352
|
+
function a(p, v, b) {
|
|
1353
|
+
l[0] = p, v[b] = c[0], v[b + 1] = c[1], v[b + 2] = c[2], v[b + 3] = c[3], v[b + 4] = c[4], v[b + 5] = c[5], v[b + 6] = c[6], v[b + 7] = c[7];
|
|
1354
1354
|
}
|
|
1355
|
-
function p
|
|
1356
|
-
l[0] =
|
|
1355
|
+
function m(p, v, b) {
|
|
1356
|
+
l[0] = p, v[b] = c[7], v[b + 1] = c[6], v[b + 2] = c[5], v[b + 3] = c[4], v[b + 4] = c[3], v[b + 5] = c[2], v[b + 6] = c[1], v[b + 7] = c[0];
|
|
1357
1357
|
}
|
|
1358
|
-
o.writeDoubleLE =
|
|
1359
|
-
function y(
|
|
1360
|
-
return c[0] =
|
|
1358
|
+
o.writeDoubleLE = h ? a : m, o.writeDoubleBE = h ? m : a;
|
|
1359
|
+
function y(p, v) {
|
|
1360
|
+
return c[0] = p[v], c[1] = p[v + 1], c[2] = p[v + 2], c[3] = p[v + 3], c[4] = p[v + 4], c[5] = p[v + 5], c[6] = p[v + 6], c[7] = p[v + 7], l[0];
|
|
1361
1361
|
}
|
|
1362
|
-
function g(
|
|
1363
|
-
return c[7] =
|
|
1362
|
+
function g(p, v) {
|
|
1363
|
+
return c[7] = p[v], c[6] = p[v + 1], c[5] = p[v + 2], c[4] = p[v + 3], c[3] = p[v + 4], c[2] = p[v + 5], c[1] = p[v + 6], c[0] = p[v + 7], l[0];
|
|
1364
1364
|
}
|
|
1365
|
-
o.readDoubleLE =
|
|
1365
|
+
o.readDoubleLE = h ? y : g, o.readDoubleBE = h ? g : y;
|
|
1366
1366
|
}() : function() {
|
|
1367
|
-
function l(
|
|
1367
|
+
function l(h, a, m, y, g, p) {
|
|
1368
1368
|
var v = y < 0 ? 1 : 0;
|
|
1369
1369
|
if (v && (y = -y), y === 0)
|
|
1370
|
-
|
|
1370
|
+
h(0, g, p + a), h(1 / y > 0 ? (
|
|
1371
1371
|
/* positive */
|
|
1372
1372
|
0
|
|
1373
1373
|
) : (
|
|
1374
1374
|
/* negative 0 */
|
|
1375
1375
|
2147483648
|
|
1376
|
-
), g,
|
|
1376
|
+
), g, p + m);
|
|
1377
1377
|
else if (isNaN(y))
|
|
1378
|
-
|
|
1378
|
+
h(0, g, p + a), h(2146959360, g, p + m);
|
|
1379
1379
|
else if (y > 17976931348623157e292)
|
|
1380
|
-
|
|
1380
|
+
h(0, g, p + a), h((v << 31 | 2146435072) >>> 0, g, p + m);
|
|
1381
1381
|
else {
|
|
1382
1382
|
var b;
|
|
1383
1383
|
if (y < 22250738585072014e-324)
|
|
1384
|
-
b = y / 5e-324,
|
|
1384
|
+
b = y / 5e-324, h(b >>> 0, g, p + a), h((v << 31 | b / 4294967296) >>> 0, g, p + m);
|
|
1385
1385
|
else {
|
|
1386
1386
|
var _ = Math.floor(Math.log(y) / Math.LN2);
|
|
1387
|
-
_ === 1024 && (_ = 1023), b = y * Math.pow(2, -_),
|
|
1387
|
+
_ === 1024 && (_ = 1023), b = y * Math.pow(2, -_), h(b * 4503599627370496 >>> 0, g, p + a), h(
|
|
1388
1388
|
(v << 31 | _ + 1023 << 20 | b * 1048576 & 1048575) >>> 0,
|
|
1389
1389
|
g,
|
|
1390
|
-
|
|
1390
|
+
p + m
|
|
1391
1391
|
);
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
1395
|
o.writeDoubleLE = l.bind(null, i, 0, 4), o.writeDoubleBE = l.bind(null, r, 4, 0);
|
|
1396
|
-
function c(
|
|
1397
|
-
var
|
|
1396
|
+
function c(h, a, m, y, g) {
|
|
1397
|
+
var p = h(y, g + a), v = h(y, g + m), b = (v >> 31) * 2 + 1, _ = v >>> 20 & 2047, T = 4294967296 * (v & 1048575) + p;
|
|
1398
1398
|
return _ === 2047 ? T ? NaN : b * (1 / 0) : _ === 0 ? b * 5e-324 * T : b * Math.pow(2, _ - 1075) * (T + 4503599627370496);
|
|
1399
1399
|
}
|
|
1400
|
-
o.readDoubleLE = c.bind(null, u, 0, 4), o.readDoubleBE = c.bind(null,
|
|
1400
|
+
o.readDoubleLE = c.bind(null, u, 0, 4), o.readDoubleBE = c.bind(null, d, 4, 0);
|
|
1401
1401
|
}(), o;
|
|
1402
1402
|
}
|
|
1403
1403
|
function i(o, l, c) {
|
|
@@ -1409,7 +1409,7 @@ function requireFloat() {
|
|
|
1409
1409
|
function u(o, l) {
|
|
1410
1410
|
return (o[l] | o[l + 1] << 8 | o[l + 2] << 16 | o[l + 3] << 24) >>> 0;
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function d(o, l) {
|
|
1413
1413
|
return (o[l] << 24 | o[l + 1] << 16 | o[l + 2] << 8 | o[l + 3]) >>> 0;
|
|
1414
1414
|
}
|
|
1415
1415
|
return float;
|
|
@@ -1433,18 +1433,18 @@ function requireUtf8() {
|
|
|
1433
1433
|
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(s) {
|
|
1434
1434
|
var i = s;
|
|
1435
1435
|
i.length = function(u) {
|
|
1436
|
-
for (var
|
|
1437
|
-
o = u.charCodeAt(l), o < 128 ?
|
|
1438
|
-
return
|
|
1439
|
-
}, i.read = function(u,
|
|
1440
|
-
var l = o -
|
|
1436
|
+
for (var d = 0, o = 0, l = 0; l < u.length; ++l)
|
|
1437
|
+
o = u.charCodeAt(l), o < 128 ? d += 1 : o < 2048 ? d += 2 : (o & 64512) === 55296 && (u.charCodeAt(l + 1) & 64512) === 56320 ? (++l, d += 4) : d += 3;
|
|
1438
|
+
return d;
|
|
1439
|
+
}, i.read = function(u, d, o) {
|
|
1440
|
+
var l = o - d;
|
|
1441
1441
|
if (l < 1) return "";
|
|
1442
|
-
for (var c = null,
|
|
1443
|
-
|
|
1444
|
-
return c ? (a && c.push(String.fromCharCode.apply(String,
|
|
1445
|
-
}, i.write = function(u,
|
|
1446
|
-
for (var l = o, c,
|
|
1447
|
-
c = u.charCodeAt(a), c < 128 ?
|
|
1442
|
+
for (var c = null, h = [], a = 0, m; d < o; )
|
|
1443
|
+
m = u[d++], m < 128 ? h[a++] = m : m > 191 && m < 224 ? h[a++] = (m & 31) << 6 | u[d++] & 63 : m > 239 && m < 365 ? (m = ((m & 7) << 18 | (u[d++] & 63) << 12 | (u[d++] & 63) << 6 | u[d++] & 63) - 65536, h[a++] = 55296 + (m >> 10), h[a++] = 56320 + (m & 1023)) : h[a++] = (m & 15) << 12 | (u[d++] & 63) << 6 | u[d++] & 63, a > 8191 && ((c || (c = [])).push(String.fromCharCode.apply(String, h)), a = 0);
|
|
1444
|
+
return c ? (a && c.push(String.fromCharCode.apply(String, h.slice(0, a))), c.join("")) : String.fromCharCode.apply(String, h.slice(0, a));
|
|
1445
|
+
}, i.write = function(u, d, o) {
|
|
1446
|
+
for (var l = o, c, h, a = 0; a < u.length; ++a)
|
|
1447
|
+
c = u.charCodeAt(a), c < 128 ? d[o++] = c : c < 2048 ? (d[o++] = c >> 6 | 192, d[o++] = c & 63 | 128) : (c & 64512) === 55296 && ((h = u.charCodeAt(a + 1)) & 64512) === 56320 ? (c = 65536 + ((c & 1023) << 10) + (h & 1023), ++a, d[o++] = c >> 18 | 240, d[o++] = c >> 12 & 63 | 128, d[o++] = c >> 6 & 63 | 128, d[o++] = c & 63 | 128) : (d[o++] = c >> 12 | 224, d[o++] = c >> 6 & 63 | 128, d[o++] = c & 63 | 128);
|
|
1448
1448
|
return o - l;
|
|
1449
1449
|
};
|
|
1450
1450
|
}(utf8$2)), utf8$2;
|
|
@@ -1454,12 +1454,12 @@ function requirePool() {
|
|
|
1454
1454
|
if (hasRequiredPool) return pool_1;
|
|
1455
1455
|
hasRequiredPool = 1, pool_1 = s;
|
|
1456
1456
|
function s(i, r, u) {
|
|
1457
|
-
var
|
|
1457
|
+
var d = u || 8192, o = d >>> 1, l = null, c = d;
|
|
1458
1458
|
return function(a) {
|
|
1459
1459
|
if (a < 1 || a > o) return i(a);
|
|
1460
|
-
c + a >
|
|
1461
|
-
var
|
|
1462
|
-
return c & 7 && (c = (c | 7) + 1),
|
|
1460
|
+
c + a > d && (l = i(d), c = 0);
|
|
1461
|
+
var m = r.call(l, c, c += a);
|
|
1462
|
+
return c & 7 && (c = (c | 7) + 1), m;
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
1465
|
return pool_1;
|
|
@@ -1485,8 +1485,8 @@ function requireLongbits() {
|
|
|
1485
1485
|
if (l === 0) return r;
|
|
1486
1486
|
var c = l < 0;
|
|
1487
1487
|
c && (l = -l);
|
|
1488
|
-
var
|
|
1489
|
-
return c && (a = ~a >>> 0,
|
|
1488
|
+
var h = l >>> 0, a = (l - h) / 4294967296 >>> 0;
|
|
1489
|
+
return c && (a = ~a >>> 0, h = ~h >>> 0, ++h > 4294967295 && (h = 0, ++a > 4294967295 && (a = 0))), new i(h, a);
|
|
1490
1490
|
}, i.from = function(l) {
|
|
1491
1491
|
if (typeof l == "number") return i.fromNumber(l);
|
|
1492
1492
|
if (s.isString(l))
|
|
@@ -1495,8 +1495,8 @@ function requireLongbits() {
|
|
|
1495
1495
|
return l.low || l.high ? new i(l.low >>> 0, l.high >>> 0) : r;
|
|
1496
1496
|
}, i.prototype.toNumber = function(l) {
|
|
1497
1497
|
if (!l && this.hi >>> 31) {
|
|
1498
|
-
var c = ~this.lo + 1 >>> 0,
|
|
1499
|
-
return c || (
|
|
1498
|
+
var c = ~this.lo + 1 >>> 0, h = ~this.hi >>> 0;
|
|
1499
|
+
return c || (h = h + 1 >>> 0), -(c + h * 4294967296);
|
|
1500
1500
|
}
|
|
1501
1501
|
return this.lo + this.hi * 4294967296;
|
|
1502
1502
|
}, i.prototype.toLong = function(l) {
|
|
@@ -1509,11 +1509,11 @@ function requireLongbits() {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
);
|
|
1511
1511
|
};
|
|
1512
|
-
var
|
|
1512
|
+
var d = String.prototype.charCodeAt;
|
|
1513
1513
|
return i.fromHash = function(l) {
|
|
1514
1514
|
return l === u ? r : new i(
|
|
1515
|
-
(
|
|
1516
|
-
(
|
|
1515
|
+
(d.call(l, 0) | d.call(l, 1) << 8 | d.call(l, 2) << 16 | d.call(l, 3) << 24) >>> 0,
|
|
1516
|
+
(d.call(l, 4) | d.call(l, 5) << 8 | d.call(l, 6) << 16 | d.call(l, 7) << 24) >>> 0
|
|
1517
1517
|
);
|
|
1518
1518
|
}, i.prototype.toHash = function() {
|
|
1519
1519
|
return String.fromCharCode(
|
|
@@ -1533,8 +1533,8 @@ function requireLongbits() {
|
|
|
1533
1533
|
var l = -(this.lo & 1);
|
|
1534
1534
|
return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ l) >>> 0, this.hi = (this.hi >>> 1 ^ l) >>> 0, this;
|
|
1535
1535
|
}, i.prototype.length = function() {
|
|
1536
|
-
var l = this.lo, c = (this.lo >>> 28 | this.hi << 4) >>> 0,
|
|
1537
|
-
return
|
|
1536
|
+
var l = this.lo, c = (this.lo >>> 28 | this.hi << 4) >>> 0, h = this.hi >>> 24;
|
|
1537
|
+
return h === 0 ? c === 0 ? l < 16384 ? l < 128 ? 1 : 2 : l < 2097152 ? 3 : 4 : c < 16384 ? c < 128 ? 5 : 6 : c < 2097152 ? 7 : 8 : h < 128 ? 9 : 10;
|
|
1538
1538
|
}, longbits;
|
|
1539
1539
|
}
|
|
1540
1540
|
var hasRequiredMinimal;
|
|
@@ -1565,8 +1565,8 @@ function requireMinimal() {
|
|
|
1565
1565
|
return c != null && o.hasOwnProperty(l) ? typeof c != "object" || (Array.isArray(c) ? c.length : Object.keys(c).length) > 0 : !1;
|
|
1566
1566
|
}, i.Buffer = function() {
|
|
1567
1567
|
try {
|
|
1568
|
-
var
|
|
1569
|
-
return
|
|
1568
|
+
var d = i.inquire("buffer").Buffer;
|
|
1569
|
+
return d.prototype.utf8Write ? d : (
|
|
1570
1570
|
/* istanbul ignore next */
|
|
1571
1571
|
null
|
|
1572
1572
|
);
|
|
@@ -1584,15 +1584,15 @@ function requireMinimal() {
|
|
|
1584
1584
|
var c = i.LongBits.fromHash(o);
|
|
1585
1585
|
return i.Long ? i.Long.fromBits(c.lo, c.hi, l) : c.toNumber(!!l);
|
|
1586
1586
|
};
|
|
1587
|
-
function r(
|
|
1588
|
-
for (var c = Object.keys(o),
|
|
1589
|
-
(
|
|
1590
|
-
return
|
|
1587
|
+
function r(d, o, l) {
|
|
1588
|
+
for (var c = Object.keys(o), h = 0; h < c.length; ++h)
|
|
1589
|
+
(d[c[h]] === void 0 || !l) && (d[c[h]] = o[c[h]]);
|
|
1590
|
+
return d;
|
|
1591
1591
|
}
|
|
1592
1592
|
i.merge = r, i.lcFirst = function(o) {
|
|
1593
1593
|
return o.charAt(0).toLowerCase() + o.substring(1);
|
|
1594
1594
|
};
|
|
1595
|
-
function u(
|
|
1595
|
+
function u(d) {
|
|
1596
1596
|
function o(l, c) {
|
|
1597
1597
|
if (!(this instanceof o)) return new o(l, c);
|
|
1598
1598
|
Object.defineProperty(this, "message", {
|
|
@@ -1612,7 +1612,7 @@ function requireMinimal() {
|
|
|
1612
1612
|
},
|
|
1613
1613
|
name: {
|
|
1614
1614
|
get: function() {
|
|
1615
|
-
return
|
|
1615
|
+
return d;
|
|
1616
1616
|
},
|
|
1617
1617
|
set: void 0,
|
|
1618
1618
|
enumerable: !1,
|
|
@@ -1635,9 +1635,9 @@ function requireMinimal() {
|
|
|
1635
1635
|
i.newError = u, i.ProtocolError = u("ProtocolError"), i.oneOfGetter = function(o) {
|
|
1636
1636
|
for (var l = {}, c = 0; c < o.length; ++c) l[o[c]] = 1;
|
|
1637
1637
|
return function() {
|
|
1638
|
-
for (var
|
|
1639
|
-
if (l[
|
|
1640
|
-
return
|
|
1638
|
+
for (var h = Object.keys(this), a = h.length - 1; a > -1; --a)
|
|
1639
|
+
if (l[h[a]] === 1 && this[h[a]] !== void 0 && this[h[a]] !== null)
|
|
1640
|
+
return h[a];
|
|
1641
1641
|
};
|
|
1642
1642
|
}, i.oneOfSetter = function(o) {
|
|
1643
1643
|
return function(l) {
|
|
@@ -1650,15 +1650,15 @@ function requireMinimal() {
|
|
|
1650
1650
|
bytes: String,
|
|
1651
1651
|
json: !0
|
|
1652
1652
|
}, i._configure = function() {
|
|
1653
|
-
var
|
|
1654
|
-
if (!
|
|
1653
|
+
var d = i.Buffer;
|
|
1654
|
+
if (!d) {
|
|
1655
1655
|
i._Buffer_from = i._Buffer_allocUnsafe = null;
|
|
1656
1656
|
return;
|
|
1657
1657
|
}
|
|
1658
|
-
i._Buffer_from =
|
|
1659
|
-
return new
|
|
1660
|
-
}, i._Buffer_allocUnsafe =
|
|
1661
|
-
return new
|
|
1658
|
+
i._Buffer_from = d.from !== Uint8Array.from && d.from || function(l, c) {
|
|
1659
|
+
return new d(l, c);
|
|
1660
|
+
}, i._Buffer_allocUnsafe = d.allocUnsafe || function(l) {
|
|
1661
|
+
return new d(l);
|
|
1662
1662
|
};
|
|
1663
1663
|
};
|
|
1664
1664
|
}(minimal)), minimal;
|
|
@@ -1762,7 +1762,7 @@ var writeBytes = util$7.Array.prototype.set ? function s(i, r, u) {
|
|
|
1762
1762
|
} : (
|
|
1763
1763
|
/* istanbul ignore next */
|
|
1764
1764
|
function s(i, r, u) {
|
|
1765
|
-
for (var
|
|
1765
|
+
for (var d = 0; d < i.length; ++d) r[u + d] = i[d];
|
|
1766
1766
|
}
|
|
1767
1767
|
);
|
|
1768
1768
|
Writer$1.prototype.bytes = function s(i) {
|
|
@@ -1811,8 +1811,8 @@ BufferWriter._configure = function() {
|
|
|
1811
1811
|
if (i.copy)
|
|
1812
1812
|
i.copy(r, u, 0, i.length);
|
|
1813
1813
|
else
|
|
1814
|
-
for (var
|
|
1815
|
-
r[u++] = i[
|
|
1814
|
+
for (var d = 0; d < i.length; )
|
|
1815
|
+
r[u++] = i[d++];
|
|
1816
1816
|
}
|
|
1817
1817
|
);
|
|
1818
1818
|
};
|
|
@@ -1849,10 +1849,10 @@ var create_array = typeof Uint8Array < "u" ? function s(i) {
|
|
|
1849
1849
|
}
|
|
1850
1850
|
), create = function s() {
|
|
1851
1851
|
return util$5.Buffer ? function(r) {
|
|
1852
|
-
return (Reader$1.create = function(
|
|
1853
|
-
return util$5.Buffer.isBuffer(
|
|
1852
|
+
return (Reader$1.create = function(d) {
|
|
1853
|
+
return util$5.Buffer.isBuffer(d) ? new BufferReader$1(d) : (
|
|
1854
1854
|
/* istanbul ignore next */
|
|
1855
|
-
create_array(
|
|
1855
|
+
create_array(d)
|
|
1856
1856
|
);
|
|
1857
1857
|
})(r);
|
|
1858
1858
|
} : (
|
|
@@ -1940,8 +1940,8 @@ Reader$1.prototype.bytes = function s() {
|
|
|
1940
1940
|
if (this.pos += i, Array.isArray(this.buf))
|
|
1941
1941
|
return this.buf.slice(r, u);
|
|
1942
1942
|
if (r === u) {
|
|
1943
|
-
var
|
|
1944
|
-
return
|
|
1943
|
+
var d = util$5.Buffer;
|
|
1944
|
+
return d ? d.alloc(0) : new this.buf.constructor(0);
|
|
1945
1945
|
}
|
|
1946
1946
|
return this._slice.call(this.buf, r, u);
|
|
1947
1947
|
};
|
|
@@ -2027,10 +2027,10 @@ function Service$1(s, i, r) {
|
|
|
2027
2027
|
if (typeof s != "function") throw TypeError("rpcImpl must be a function");
|
|
2028
2028
|
util$3.EventEmitter.call(this), this.rpcImpl = s, this.requestDelimited = !!i, this.responseDelimited = !!r;
|
|
2029
2029
|
}
|
|
2030
|
-
Service$1.prototype.rpcCall = function s(i, r, u,
|
|
2031
|
-
if (!
|
|
2030
|
+
Service$1.prototype.rpcCall = function s(i, r, u, d, o) {
|
|
2031
|
+
if (!d) throw TypeError("request must be specified");
|
|
2032
2032
|
var l = this;
|
|
2033
|
-
if (!o) return util$3.asPromise(s, l, i, r, u,
|
|
2033
|
+
if (!o) return util$3.asPromise(s, l, i, r, u, d);
|
|
2034
2034
|
if (!l.rpcImpl) {
|
|
2035
2035
|
setTimeout(function() {
|
|
2036
2036
|
o(Error("already ended"));
|
|
@@ -2040,10 +2040,10 @@ Service$1.prototype.rpcCall = function s(i, r, u, m, o) {
|
|
|
2040
2040
|
try {
|
|
2041
2041
|
return l.rpcImpl(
|
|
2042
2042
|
i,
|
|
2043
|
-
r[l.requestDelimited ? "encodeDelimited" : "encode"](
|
|
2044
|
-
function(
|
|
2045
|
-
if (
|
|
2046
|
-
return l.emit("error",
|
|
2043
|
+
r[l.requestDelimited ? "encodeDelimited" : "encode"](d).finish(),
|
|
2044
|
+
function(h, a) {
|
|
2045
|
+
if (h)
|
|
2046
|
+
return l.emit("error", h, i), o(h);
|
|
2047
2047
|
if (a === null) {
|
|
2048
2048
|
l.end(
|
|
2049
2049
|
/* endedByRPC */
|
|
@@ -2054,8 +2054,8 @@ Service$1.prototype.rpcCall = function s(i, r, u, m, o) {
|
|
|
2054
2054
|
if (!(a instanceof u))
|
|
2055
2055
|
try {
|
|
2056
2056
|
a = u[l.responseDelimited ? "decodeDelimited" : "decode"](a);
|
|
2057
|
-
} catch (
|
|
2058
|
-
return l.emit("error",
|
|
2057
|
+
} catch (m) {
|
|
2058
|
+
return l.emit("error", m, i), o(m);
|
|
2059
2059
|
}
|
|
2060
2060
|
return l.emit("data", a, i), o(null, a);
|
|
2061
2061
|
}
|
|
@@ -2089,11 +2089,11 @@ function codegen(s, i) {
|
|
|
2089
2089
|
var r = [];
|
|
2090
2090
|
function u(o) {
|
|
2091
2091
|
if (typeof o != "string") {
|
|
2092
|
-
var l =
|
|
2092
|
+
var l = d();
|
|
2093
2093
|
if (codegen.verbose && console.warn("codegen: " + l), l = "return " + l, o) {
|
|
2094
|
-
for (var c = Object.keys(o),
|
|
2095
|
-
|
|
2096
|
-
return
|
|
2094
|
+
for (var c = Object.keys(o), h = new Array(c.length + 1), a = new Array(c.length), m = 0; m < c.length; )
|
|
2095
|
+
h[m] = c[m], a[m] = o[c[m++]];
|
|
2096
|
+
return h[m] = l, Function.apply(null, h).apply(null, a);
|
|
2097
2097
|
}
|
|
2098
2098
|
return Function(l)();
|
|
2099
2099
|
}
|
|
@@ -2116,38 +2116,38 @@ function codegen(s, i) {
|
|
|
2116
2116
|
}), g !== y.length) throw Error("parameter count mismatch");
|
|
2117
2117
|
return r.push(o), u;
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function d(o) {
|
|
2120
2120
|
return "function " + (o || i || "") + "(" + (s && s.join(",") || "") + `){
|
|
2121
2121
|
` + r.join(`
|
|
2122
2122
|
`) + `
|
|
2123
2123
|
}`;
|
|
2124
2124
|
}
|
|
2125
|
-
return u.toString =
|
|
2125
|
+
return u.toString = d, u;
|
|
2126
2126
|
}
|
|
2127
2127
|
codegen.verbose = !1;
|
|
2128
2128
|
var fetch_1 = fetch, asPromise = requireAspromise(), inquire = requireInquire(), fs = inquire("fs");
|
|
2129
2129
|
function fetch(s, i, r) {
|
|
2130
|
-
return typeof i == "function" ? (r = i, i = {}) : i || (i = {}), r ? !i.xhr && fs && fs.readFile ? fs.readFile(s, function(
|
|
2131
|
-
return
|
|
2130
|
+
return typeof i == "function" ? (r = i, i = {}) : i || (i = {}), r ? !i.xhr && fs && fs.readFile ? fs.readFile(s, function(d, o) {
|
|
2131
|
+
return d && typeof XMLHttpRequest < "u" ? fetch.xhr(s, i, r) : d ? r(d) : r(null, i.binary ? o : o.toString("utf8"));
|
|
2132
2132
|
}) : fetch.xhr(s, i, r) : asPromise(fetch, this, s, i);
|
|
2133
2133
|
}
|
|
2134
2134
|
fetch.xhr = function s(i, r, u) {
|
|
2135
|
-
var
|
|
2136
|
-
|
|
2137
|
-
if (
|
|
2138
|
-
if (
|
|
2135
|
+
var d = new XMLHttpRequest();
|
|
2136
|
+
d.onreadystatechange = function() {
|
|
2137
|
+
if (d.readyState === 4) {
|
|
2138
|
+
if (d.status !== 0 && d.status !== 200) return u(Error("status " + d.status));
|
|
2139
2139
|
if (r.binary) {
|
|
2140
|
-
var l =
|
|
2140
|
+
var l = d.response;
|
|
2141
2141
|
if (!l) {
|
|
2142
2142
|
l = [];
|
|
2143
|
-
for (var c = 0; c <
|
|
2144
|
-
l.push(
|
|
2143
|
+
for (var c = 0; c < d.responseText.length; ++c)
|
|
2144
|
+
l.push(d.responseText.charCodeAt(c) & 255);
|
|
2145
2145
|
}
|
|
2146
2146
|
return u(null, typeof Uint8Array < "u" ? new Uint8Array(l) : l);
|
|
2147
2147
|
}
|
|
2148
|
-
return u(null,
|
|
2148
|
+
return u(null, d.responseText);
|
|
2149
2149
|
}
|
|
2150
|
-
}, r.binary && ("overrideMimeType" in
|
|
2150
|
+
}, r.binary && ("overrideMimeType" in d && d.overrideMimeType("text/plain; charset=x-user-defined"), d.responseType = "arraybuffer"), d.open("GET", i), d.send();
|
|
2151
2151
|
};
|
|
2152
2152
|
var path = {};
|
|
2153
2153
|
(function(s) {
|
|
@@ -2168,11 +2168,11 @@ var path = {};
|
|
|
2168
2168
|
*/
|
|
2169
2169
|
i.normalize = function(o) {
|
|
2170
2170
|
o = o.replace(/\\/g, "/").replace(/\/{2,}/g, "/");
|
|
2171
|
-
var l = o.split("/"), c = r(o),
|
|
2172
|
-
c && (
|
|
2171
|
+
var l = o.split("/"), c = r(o), h = "";
|
|
2172
|
+
c && (h = l.shift() + "/");
|
|
2173
2173
|
for (var a = 0; a < l.length; )
|
|
2174
2174
|
l[a] === ".." ? a > 0 && l[a - 1] !== ".." ? l.splice(--a, 2) : c ? l.splice(a, 1) : ++a : l[a] === "." ? l.splice(a, 1) : ++a;
|
|
2175
|
-
return
|
|
2175
|
+
return h + l.join("/");
|
|
2176
2176
|
}
|
|
2177
2177
|
);
|
|
2178
2178
|
i.resolve = function(o, l, c) {
|
|
@@ -2214,12 +2214,12 @@ function requireTypes() {
|
|
|
2214
2214
|
"bytes"
|
|
2215
2215
|
// 14
|
|
2216
2216
|
];
|
|
2217
|
-
function
|
|
2218
|
-
var c = 0,
|
|
2219
|
-
for (l |= 0; c < o.length; )
|
|
2220
|
-
return
|
|
2217
|
+
function d(o, l) {
|
|
2218
|
+
var c = 0, h = {};
|
|
2219
|
+
for (l |= 0; c < o.length; ) h[u[c + l]] = o[c++];
|
|
2220
|
+
return h;
|
|
2221
2221
|
}
|
|
2222
|
-
i.basic =
|
|
2222
|
+
i.basic = d([
|
|
2223
2223
|
/* double */
|
|
2224
2224
|
1,
|
|
2225
2225
|
/* float */
|
|
@@ -2250,7 +2250,7 @@ function requireTypes() {
|
|
|
2250
2250
|
2,
|
|
2251
2251
|
/* bytes */
|
|
2252
2252
|
2
|
|
2253
|
-
]), i.defaults =
|
|
2253
|
+
]), i.defaults = d([
|
|
2254
2254
|
/* double */
|
|
2255
2255
|
0,
|
|
2256
2256
|
/* float */
|
|
@@ -2283,7 +2283,7 @@ function requireTypes() {
|
|
|
2283
2283
|
r.emptyArray,
|
|
2284
2284
|
/* message */
|
|
2285
2285
|
null
|
|
2286
|
-
]), i.long =
|
|
2286
|
+
]), i.long = d(
|
|
2287
2287
|
[
|
|
2288
2288
|
/* int64 */
|
|
2289
2289
|
0,
|
|
@@ -2297,7 +2297,7 @@ function requireTypes() {
|
|
|
2297
2297
|
1
|
|
2298
2298
|
],
|
|
2299
2299
|
7
|
|
2300
|
-
), i.mapKey =
|
|
2300
|
+
), i.mapKey = d(
|
|
2301
2301
|
[
|
|
2302
2302
|
/* int32 */
|
|
2303
2303
|
0,
|
|
@@ -2325,7 +2325,7 @@ function requireTypes() {
|
|
|
2325
2325
|
2
|
|
2326
2326
|
],
|
|
2327
2327
|
2
|
|
2328
|
-
), i.packed =
|
|
2328
|
+
), i.packed = d([
|
|
2329
2329
|
/* double */
|
|
2330
2330
|
1,
|
|
2331
2331
|
/* float */
|
|
@@ -2361,29 +2361,29 @@ function requireField() {
|
|
|
2361
2361
|
hasRequiredField = 1, field = l;
|
|
2362
2362
|
var s = requireObject();
|
|
2363
2363
|
((l.prototype = Object.create(s.prototype)).constructor = l).className = "Field";
|
|
2364
|
-
var i = require_enum(), r = requireTypes(), u = requireUtil(),
|
|
2365
|
-
l.fromJSON = function(
|
|
2366
|
-
return new l(
|
|
2364
|
+
var i = require_enum(), r = requireTypes(), u = requireUtil(), d, o = /^required|optional|repeated$/;
|
|
2365
|
+
l.fromJSON = function(h, a) {
|
|
2366
|
+
return new l(h, a.id, a.type, a.rule, a.extend, a.options, a.comment);
|
|
2367
2367
|
};
|
|
2368
|
-
function l(c,
|
|
2369
|
-
if (u.isObject(
|
|
2368
|
+
function l(c, h, a, m, y, g, p) {
|
|
2369
|
+
if (u.isObject(m) ? (p = y, g = m, m = y = void 0) : u.isObject(y) && (p = g, g = y, y = void 0), s.call(this, c, g), !u.isInteger(h) || h < 0) throw TypeError("id must be a non-negative integer");
|
|
2370
2370
|
if (!u.isString(a)) throw TypeError("type must be a string");
|
|
2371
|
-
if (
|
|
2371
|
+
if (m !== void 0 && !o.test(m = m.toString().toLowerCase()))
|
|
2372
2372
|
throw TypeError("rule must be a string rule");
|
|
2373
2373
|
if (y !== void 0 && !u.isString(y)) throw TypeError("extend must be a string");
|
|
2374
|
-
|
|
2374
|
+
m === "proto3_optional" && (m = "optional"), this.rule = m && m !== "optional" ? m : void 0, this.type = a, this.id = h, this.extend = y || void 0, this.required = m === "required", this.optional = !this.required, this.repeated = m === "repeated", this.map = !1, this.message = null, this.partOf = null, this.typeDefault = null, this.defaultValue = null, this.long = u.Long ? r.long[a] !== void 0 : (
|
|
2375
2375
|
/* istanbul ignore next */
|
|
2376
2376
|
!1
|
|
2377
|
-
), this.bytes = a === "bytes", this.resolvedType = null, this.extensionField = null, this.declaringField = null, this._packed = null, this.comment =
|
|
2377
|
+
), this.bytes = a === "bytes", this.resolvedType = null, this.extensionField = null, this.declaringField = null, this._packed = null, this.comment = p;
|
|
2378
2378
|
}
|
|
2379
2379
|
return Object.defineProperty(l.prototype, "packed", {
|
|
2380
2380
|
get: function() {
|
|
2381
2381
|
return this._packed === null && (this._packed = this.getOption("packed") !== !1), this._packed;
|
|
2382
2382
|
}
|
|
2383
|
-
}), l.prototype.setOption = function(
|
|
2384
|
-
return
|
|
2385
|
-
}, l.prototype.toJSON = function(
|
|
2386
|
-
var a =
|
|
2383
|
+
}), l.prototype.setOption = function(h, a, m) {
|
|
2384
|
+
return h === "packed" && (this._packed = null), s.prototype.setOption.call(this, h, a, m);
|
|
2385
|
+
}, l.prototype.toJSON = function(h) {
|
|
2386
|
+
var a = h ? !!h.keepComments : !1;
|
|
2387
2387
|
return u.toObject([
|
|
2388
2388
|
"rule",
|
|
2389
2389
|
this.rule !== "optional" && this.rule || void 0,
|
|
@@ -2400,31 +2400,31 @@ function requireField() {
|
|
|
2400
2400
|
]);
|
|
2401
2401
|
}, l.prototype.resolve = function() {
|
|
2402
2402
|
if (this.resolved) return this;
|
|
2403
|
-
if ((this.typeDefault = r.defaults[this.type]) === void 0 ? (this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type), this.resolvedType instanceof
|
|
2403
|
+
if ((this.typeDefault = r.defaults[this.type]) === void 0 ? (this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type), this.resolvedType instanceof d ? this.typeDefault = null : this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]) : this.options && this.options.proto3_optional && (this.typeDefault = null), this.options && this.options.default != null && (this.typeDefault = this.options.default, this.resolvedType instanceof i && typeof this.typeDefault == "string" && (this.typeDefault = this.resolvedType.values[this.typeDefault])), this.options && ((this.options.packed === !0 || this.options.packed !== void 0 && this.resolvedType && !(this.resolvedType instanceof i)) && delete this.options.packed, Object.keys(this.options).length || (this.options = void 0)), this.long)
|
|
2404
2404
|
this.typeDefault = u.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"), Object.freeze && Object.freeze(this.typeDefault);
|
|
2405
2405
|
else if (this.bytes && typeof this.typeDefault == "string") {
|
|
2406
|
-
var
|
|
2406
|
+
var h;
|
|
2407
2407
|
u.base64.test(this.typeDefault) ? u.base64.decode(
|
|
2408
2408
|
this.typeDefault,
|
|
2409
|
-
|
|
2409
|
+
h = u.newBuffer(u.base64.length(this.typeDefault)),
|
|
2410
2410
|
0
|
|
2411
2411
|
) : u.utf8.write(
|
|
2412
2412
|
this.typeDefault,
|
|
2413
|
-
|
|
2413
|
+
h = u.newBuffer(u.utf8.length(this.typeDefault)),
|
|
2414
2414
|
0
|
|
2415
|
-
), this.typeDefault =
|
|
2415
|
+
), this.typeDefault = h;
|
|
2416
2416
|
}
|
|
2417
|
-
return this.map ? this.defaultValue = u.emptyObject : this.repeated ? this.defaultValue = u.emptyArray : this.defaultValue = this.typeDefault, this.parent instanceof
|
|
2418
|
-
}, l.d = function(
|
|
2419
|
-
return typeof a == "function" ? a = u.decorateType(a).name : a && typeof a == "object" && (a = u.decorateEnum(a).name), function(
|
|
2420
|
-
u.decorateType(
|
|
2421
|
-
new l(v,
|
|
2417
|
+
return this.map ? this.defaultValue = u.emptyObject : this.repeated ? this.defaultValue = u.emptyArray : this.defaultValue = this.typeDefault, this.parent instanceof d && (this.parent.ctor.prototype[this.name] = this.defaultValue), s.prototype.resolve.call(this);
|
|
2418
|
+
}, l.d = function(h, a, m, y) {
|
|
2419
|
+
return typeof a == "function" ? a = u.decorateType(a).name : a && typeof a == "object" && (a = u.decorateEnum(a).name), function(p, v) {
|
|
2420
|
+
u.decorateType(p.constructor).add(
|
|
2421
|
+
new l(v, h, a, m, {
|
|
2422
2422
|
default: y
|
|
2423
2423
|
})
|
|
2424
2424
|
);
|
|
2425
2425
|
};
|
|
2426
|
-
}, l._configure = function(
|
|
2427
|
-
|
|
2426
|
+
}, l._configure = function(h) {
|
|
2427
|
+
d = h;
|
|
2428
2428
|
}, field;
|
|
2429
2429
|
}
|
|
2430
2430
|
var oneof, hasRequiredOneof;
|
|
@@ -2434,10 +2434,10 @@ function requireOneof() {
|
|
|
2434
2434
|
var s = requireObject();
|
|
2435
2435
|
((u.prototype = Object.create(s.prototype)).constructor = u).className = "OneOf";
|
|
2436
2436
|
var i = requireField(), r = requireUtil();
|
|
2437
|
-
function u(o, l, c,
|
|
2437
|
+
function u(o, l, c, h) {
|
|
2438
2438
|
if (Array.isArray(l) || (c = l, l = void 0), s.call(this, o, c), !(l === void 0 || Array.isArray(l)))
|
|
2439
2439
|
throw TypeError("fieldNames must be an Array");
|
|
2440
|
-
this.oneof = l || [], this.fieldsArray = [], this.comment =
|
|
2440
|
+
this.oneof = l || [], this.fieldsArray = [], this.comment = h;
|
|
2441
2441
|
}
|
|
2442
2442
|
u.fromJSON = function(l, c) {
|
|
2443
2443
|
return new u(l, c.oneof, c.options, c.comment);
|
|
@@ -2452,14 +2452,14 @@ function requireOneof() {
|
|
|
2452
2452
|
c ? this.comment : void 0
|
|
2453
2453
|
]);
|
|
2454
2454
|
};
|
|
2455
|
-
function
|
|
2455
|
+
function d(o) {
|
|
2456
2456
|
if (o.parent)
|
|
2457
2457
|
for (var l = 0; l < o.fieldsArray.length; ++l)
|
|
2458
2458
|
o.fieldsArray[l].parent || o.parent.add(o.fieldsArray[l]);
|
|
2459
2459
|
}
|
|
2460
2460
|
return u.prototype.add = function(l) {
|
|
2461
2461
|
if (!(l instanceof i)) throw TypeError("field must be a Field");
|
|
2462
|
-
return l.parent && l.parent !== this.parent && l.parent.remove(l), this.oneof.push(l.name), this.fieldsArray.push(l), l.partOf = this,
|
|
2462
|
+
return l.parent && l.parent !== this.parent && l.parent.remove(l), this.oneof.push(l.name), this.fieldsArray.push(l), l.partOf = this, d(this), this;
|
|
2463
2463
|
}, u.prototype.remove = function(l) {
|
|
2464
2464
|
if (!(l instanceof i)) throw TypeError("field must be a Field");
|
|
2465
2465
|
var c = this.fieldsArray.indexOf(l);
|
|
@@ -2467,19 +2467,19 @@ function requireOneof() {
|
|
|
2467
2467
|
return this.fieldsArray.splice(c, 1), c = this.oneof.indexOf(l.name), c > -1 && this.oneof.splice(c, 1), l.partOf = null, this;
|
|
2468
2468
|
}, u.prototype.onAdd = function(l) {
|
|
2469
2469
|
s.prototype.onAdd.call(this, l);
|
|
2470
|
-
for (var c = this,
|
|
2471
|
-
var a = l.get(this.oneof[
|
|
2470
|
+
for (var c = this, h = 0; h < this.oneof.length; ++h) {
|
|
2471
|
+
var a = l.get(this.oneof[h]);
|
|
2472
2472
|
a && !a.partOf && (a.partOf = c, c.fieldsArray.push(a));
|
|
2473
2473
|
}
|
|
2474
|
-
|
|
2474
|
+
d(this);
|
|
2475
2475
|
}, u.prototype.onRemove = function(l) {
|
|
2476
|
-
for (var c = 0,
|
|
2477
|
-
(
|
|
2476
|
+
for (var c = 0, h; c < this.fieldsArray.length; ++c)
|
|
2477
|
+
(h = this.fieldsArray[c]).parent && h.parent.remove(h);
|
|
2478
2478
|
s.prototype.onRemove.call(this, l);
|
|
2479
2479
|
}, u.d = function() {
|
|
2480
2480
|
for (var l = new Array(arguments.length), c = 0; c < arguments.length; ) l[c] = arguments[c++];
|
|
2481
|
-
return function(a,
|
|
2482
|
-
r.decorateType(a.constructor).add(new u(
|
|
2481
|
+
return function(a, m) {
|
|
2482
|
+
r.decorateType(a.constructor).add(new u(m, l)), Object.defineProperty(a, m, {
|
|
2483
2483
|
get: r.oneOfGetter(l),
|
|
2484
2484
|
set: r.oneOfSetter(l)
|
|
2485
2485
|
});
|
|
@@ -2489,97 +2489,97 @@ function requireOneof() {
|
|
|
2489
2489
|
var namespace, hasRequiredNamespace;
|
|
2490
2490
|
function requireNamespace() {
|
|
2491
2491
|
if (hasRequiredNamespace) return namespace;
|
|
2492
|
-
hasRequiredNamespace = 1, namespace =
|
|
2492
|
+
hasRequiredNamespace = 1, namespace = h;
|
|
2493
2493
|
var s = requireObject();
|
|
2494
|
-
((
|
|
2495
|
-
var i = requireField(), r = requireUtil(), u = requireOneof(),
|
|
2496
|
-
|
|
2497
|
-
return new
|
|
2494
|
+
((h.prototype = Object.create(s.prototype)).constructor = h).className = "Namespace";
|
|
2495
|
+
var i = requireField(), r = requireUtil(), u = requireOneof(), d, o, l;
|
|
2496
|
+
h.fromJSON = function(y, g) {
|
|
2497
|
+
return new h(y, g.options).addJSON(g.nested);
|
|
2498
2498
|
};
|
|
2499
|
-
function c(
|
|
2500
|
-
if (
|
|
2501
|
-
for (var g = {},
|
|
2499
|
+
function c(m, y) {
|
|
2500
|
+
if (m && m.length) {
|
|
2501
|
+
for (var g = {}, p = 0; p < m.length; ++p) g[m[p].name] = m[p].toJSON(y);
|
|
2502
2502
|
return g;
|
|
2503
2503
|
}
|
|
2504
2504
|
}
|
|
2505
|
-
|
|
2505
|
+
h.arrayToJSON = c, h.isReservedId = function(y, g) {
|
|
2506
2506
|
if (y) {
|
|
2507
|
-
for (var
|
|
2508
|
-
if (typeof y[
|
|
2507
|
+
for (var p = 0; p < y.length; ++p)
|
|
2508
|
+
if (typeof y[p] != "string" && y[p][0] <= g && y[p][1] > g)
|
|
2509
2509
|
return !0;
|
|
2510
2510
|
}
|
|
2511
2511
|
return !1;
|
|
2512
|
-
},
|
|
2512
|
+
}, h.isReservedName = function(y, g) {
|
|
2513
2513
|
if (y) {
|
|
2514
|
-
for (var
|
|
2514
|
+
for (var p = 0; p < y.length; ++p) if (y[p] === g) return !0;
|
|
2515
2515
|
}
|
|
2516
2516
|
return !1;
|
|
2517
2517
|
};
|
|
2518
|
-
function
|
|
2519
|
-
s.call(this,
|
|
2518
|
+
function h(m, y) {
|
|
2519
|
+
s.call(this, m, y), this.nested = void 0, this._nestedArray = null;
|
|
2520
2520
|
}
|
|
2521
|
-
function a(
|
|
2522
|
-
return
|
|
2521
|
+
function a(m) {
|
|
2522
|
+
return m._nestedArray = null, m;
|
|
2523
2523
|
}
|
|
2524
|
-
return Object.defineProperty(
|
|
2524
|
+
return Object.defineProperty(h.prototype, "nestedArray", {
|
|
2525
2525
|
get: function() {
|
|
2526
2526
|
return this._nestedArray || (this._nestedArray = r.toArray(this.nested));
|
|
2527
2527
|
}
|
|
2528
|
-
}),
|
|
2528
|
+
}), h.prototype.toJSON = function(y) {
|
|
2529
2529
|
return r.toObject([
|
|
2530
2530
|
"options",
|
|
2531
2531
|
this.options,
|
|
2532
2532
|
"nested",
|
|
2533
2533
|
c(this.nestedArray, y)
|
|
2534
2534
|
]);
|
|
2535
|
-
},
|
|
2535
|
+
}, h.prototype.addJSON = function(y) {
|
|
2536
2536
|
var g = this;
|
|
2537
2537
|
if (y)
|
|
2538
|
-
for (var
|
|
2539
|
-
b = y[
|
|
2538
|
+
for (var p = Object.keys(y), v = 0, b; v < p.length; ++v)
|
|
2539
|
+
b = y[p[v]], g.add(
|
|
2540
2540
|
// most to least likely
|
|
2541
|
-
(b.fields !== void 0 ?
|
|
2541
|
+
(b.fields !== void 0 ? d.fromJSON : b.values !== void 0 ? l.fromJSON : b.methods !== void 0 ? o.fromJSON : b.id !== void 0 ? i.fromJSON : h.fromJSON)(p[v], b)
|
|
2542
2542
|
);
|
|
2543
2543
|
return this;
|
|
2544
|
-
},
|
|
2544
|
+
}, h.prototype.get = function(y) {
|
|
2545
2545
|
return this.nested && this.nested[y] || null;
|
|
2546
|
-
},
|
|
2546
|
+
}, h.prototype.getEnum = function(y) {
|
|
2547
2547
|
if (this.nested && this.nested[y] instanceof l) return this.nested[y].values;
|
|
2548
2548
|
throw Error("no such enum: " + y);
|
|
2549
|
-
},
|
|
2550
|
-
if (!(y instanceof i && y.extend !== void 0 || y instanceof
|
|
2549
|
+
}, h.prototype.add = function(y) {
|
|
2550
|
+
if (!(y instanceof i && y.extend !== void 0 || y instanceof d || y instanceof u || y instanceof l || y instanceof o || y instanceof h))
|
|
2551
2551
|
throw TypeError("object must be a valid nested object");
|
|
2552
2552
|
if (!this.nested) this.nested = {};
|
|
2553
2553
|
else {
|
|
2554
2554
|
var g = this.get(y.name);
|
|
2555
2555
|
if (g)
|
|
2556
|
-
if (g instanceof
|
|
2557
|
-
for (var
|
|
2556
|
+
if (g instanceof h && y instanceof h && !(g instanceof d || g instanceof o)) {
|
|
2557
|
+
for (var p = g.nestedArray, v = 0; v < p.length; ++v) y.add(p[v]);
|
|
2558
2558
|
this.remove(g), this.nested || (this.nested = {}), y.setOptions(g.options, !0);
|
|
2559
2559
|
} else throw Error("duplicate name '" + y.name + "' in " + this);
|
|
2560
2560
|
}
|
|
2561
2561
|
return this.nested[y.name] = y, y.onAdd(this), a(this);
|
|
2562
|
-
},
|
|
2562
|
+
}, h.prototype.remove = function(y) {
|
|
2563
2563
|
if (!(y instanceof s)) throw TypeError("object must be a ReflectionObject");
|
|
2564
2564
|
if (y.parent !== this) throw Error(y + " is not a member of " + this);
|
|
2565
2565
|
return delete this.nested[y.name], Object.keys(this.nested).length || (this.nested = void 0), y.onRemove(this), a(this);
|
|
2566
|
-
},
|
|
2566
|
+
}, h.prototype.define = function(y, g) {
|
|
2567
2567
|
if (r.isString(y)) y = y.split(".");
|
|
2568
2568
|
else if (!Array.isArray(y)) throw TypeError("illegal path");
|
|
2569
2569
|
if (y && y.length && y[0] === "") throw Error("path must be relative");
|
|
2570
|
-
for (var
|
|
2570
|
+
for (var p = this; y.length > 0; ) {
|
|
2571
2571
|
var v = y.shift();
|
|
2572
|
-
if (
|
|
2573
|
-
if (
|
|
2574
|
-
} else
|
|
2572
|
+
if (p.nested && p.nested[v]) {
|
|
2573
|
+
if (p = p.nested[v], !(p instanceof h)) throw Error("path conflicts with non-namespace objects");
|
|
2574
|
+
} else p.add(p = new h(v));
|
|
2575
2575
|
}
|
|
2576
|
-
return g &&
|
|
2577
|
-
},
|
|
2576
|
+
return g && p.addJSON(g), p;
|
|
2577
|
+
}, h.prototype.resolveAll = function() {
|
|
2578
2578
|
for (var y = this.nestedArray, g = 0; g < y.length; )
|
|
2579
|
-
y[g] instanceof
|
|
2579
|
+
y[g] instanceof h ? y[g++].resolveAll() : y[g++].resolve();
|
|
2580
2580
|
return this.resolve();
|
|
2581
|
-
},
|
|
2582
|
-
if (typeof g == "boolean" ? (
|
|
2581
|
+
}, h.prototype.lookup = function(y, g, p) {
|
|
2582
|
+
if (typeof g == "boolean" ? (p = g, g = void 0) : g && !Array.isArray(g) && (g = [g]), r.isString(y) && y.length) {
|
|
2583
2583
|
if (y === ".") return this.root;
|
|
2584
2584
|
y = y.split(".");
|
|
2585
2585
|
} else if (!y.length) return this;
|
|
@@ -2588,31 +2588,31 @@ function requireNamespace() {
|
|
|
2588
2588
|
if (v) {
|
|
2589
2589
|
if (y.length === 1) {
|
|
2590
2590
|
if (!g || g.indexOf(v.constructor) > -1) return v;
|
|
2591
|
-
} else if (v instanceof
|
|
2591
|
+
} else if (v instanceof h && (v = v.lookup(y.slice(1), g, !0)))
|
|
2592
2592
|
return v;
|
|
2593
2593
|
} else
|
|
2594
2594
|
for (var b = 0; b < this.nestedArray.length; ++b)
|
|
2595
|
-
if (this._nestedArray[b] instanceof
|
|
2595
|
+
if (this._nestedArray[b] instanceof h && (v = this._nestedArray[b].lookup(y, g, !0)))
|
|
2596
2596
|
return v;
|
|
2597
|
-
return this.parent === null ||
|
|
2598
|
-
},
|
|
2599
|
-
var g = this.lookup(y, [
|
|
2597
|
+
return this.parent === null || p ? null : this.parent.lookup(y, g);
|
|
2598
|
+
}, h.prototype.lookupType = function(y) {
|
|
2599
|
+
var g = this.lookup(y, [d]);
|
|
2600
2600
|
if (!g) throw Error("no such type: " + y);
|
|
2601
2601
|
return g;
|
|
2602
|
-
},
|
|
2602
|
+
}, h.prototype.lookupEnum = function(y) {
|
|
2603
2603
|
var g = this.lookup(y, [l]);
|
|
2604
2604
|
if (!g) throw Error("no such Enum '" + y + "' in " + this);
|
|
2605
2605
|
return g;
|
|
2606
|
-
},
|
|
2607
|
-
var g = this.lookup(y, [
|
|
2606
|
+
}, h.prototype.lookupTypeOrEnum = function(y) {
|
|
2607
|
+
var g = this.lookup(y, [d, l]);
|
|
2608
2608
|
if (!g) throw Error("no such Type or Enum '" + y + "' in " + this);
|
|
2609
2609
|
return g;
|
|
2610
|
-
},
|
|
2610
|
+
}, h.prototype.lookupService = function(y) {
|
|
2611
2611
|
var g = this.lookup(y, [o]);
|
|
2612
2612
|
if (!g) throw Error("no such Service '" + y + "' in " + this);
|
|
2613
2613
|
return g;
|
|
2614
|
-
},
|
|
2615
|
-
|
|
2614
|
+
}, h._configure = function(m, y, g) {
|
|
2615
|
+
d = m, o = y, l = g;
|
|
2616
2616
|
}, namespace;
|
|
2617
2617
|
}
|
|
2618
2618
|
var mapfield, hasRequiredMapfield;
|
|
@@ -2622,8 +2622,8 @@ function requireMapfield() {
|
|
|
2622
2622
|
var s = requireField();
|
|
2623
2623
|
((u.prototype = Object.create(s.prototype)).constructor = u).className = "MapField";
|
|
2624
2624
|
var i = requireTypes(), r = requireUtil();
|
|
2625
|
-
function u(
|
|
2626
|
-
if (s.call(this,
|
|
2625
|
+
function u(d, o, l, c, h, a) {
|
|
2626
|
+
if (s.call(this, d, o, c, void 0, void 0, h, a), !r.isString(l)) throw TypeError("keyType must be a string");
|
|
2627
2627
|
this.keyType = l, this.resolvedKeyType = null, this.map = !0;
|
|
2628
2628
|
}
|
|
2629
2629
|
return u.fromJSON = function(o, l) {
|
|
@@ -2649,8 +2649,8 @@ function requireMapfield() {
|
|
|
2649
2649
|
if (i.mapKey[this.keyType] === void 0) throw Error("invalid key type: " + this.keyType);
|
|
2650
2650
|
return s.prototype.resolve.call(this);
|
|
2651
2651
|
}, u.d = function(o, l, c) {
|
|
2652
|
-
return typeof c == "function" ? c = r.decorateType(c).name : c && typeof c == "object" && (c = r.decorateEnum(c).name), function(a,
|
|
2653
|
-
r.decorateType(a.constructor).add(new u(
|
|
2652
|
+
return typeof c == "function" ? c = r.decorateType(c).name : c && typeof c == "object" && (c = r.decorateEnum(c).name), function(a, m) {
|
|
2653
|
+
r.decorateType(a.constructor).add(new u(m, o, l, c));
|
|
2654
2654
|
};
|
|
2655
2655
|
}, mapfield;
|
|
2656
2656
|
}
|
|
@@ -2661,15 +2661,15 @@ function requireMethod() {
|
|
|
2661
2661
|
var s = requireObject();
|
|
2662
2662
|
((r.prototype = Object.create(s.prototype)).constructor = r).className = "Method";
|
|
2663
2663
|
var i = requireUtil();
|
|
2664
|
-
function r(u,
|
|
2665
|
-
if (i.isObject(c) ? (a = c, c =
|
|
2664
|
+
function r(u, d, o, l, c, h, a, m, y) {
|
|
2665
|
+
if (i.isObject(c) ? (a = c, c = h = void 0) : i.isObject(h) && (a = h, h = void 0), !(d === void 0 || i.isString(d))) throw TypeError("type must be a string");
|
|
2666
2666
|
if (!i.isString(o)) throw TypeError("requestType must be a string");
|
|
2667
2667
|
if (!i.isString(l)) throw TypeError("responseType must be a string");
|
|
2668
|
-
s.call(this, u, a), this.type =
|
|
2668
|
+
s.call(this, u, a), this.type = d || "rpc", this.requestType = o, this.requestStream = c ? !0 : void 0, this.responseType = l, this.responseStream = h ? !0 : void 0, this.resolvedRequestType = null, this.resolvedResponseType = null, this.comment = m, this.parsedOptions = y;
|
|
2669
2669
|
}
|
|
2670
|
-
return r.fromJSON = function(
|
|
2670
|
+
return r.fromJSON = function(d, o) {
|
|
2671
2671
|
return new r(
|
|
2672
|
-
|
|
2672
|
+
d,
|
|
2673
2673
|
o.type,
|
|
2674
2674
|
o.requestType,
|
|
2675
2675
|
o.responseType,
|
|
@@ -2679,8 +2679,8 @@ function requireMethod() {
|
|
|
2679
2679
|
o.comment,
|
|
2680
2680
|
o.parsedOptions
|
|
2681
2681
|
);
|
|
2682
|
-
}, r.prototype.toJSON = function(
|
|
2683
|
-
var o =
|
|
2682
|
+
}, r.prototype.toJSON = function(d) {
|
|
2683
|
+
var o = d ? !!d.keepComments : !1;
|
|
2684
2684
|
return i.toObject([
|
|
2685
2685
|
"type",
|
|
2686
2686
|
this.type !== "rpc" && /* istanbul ignore next */
|
|
@@ -2707,33 +2707,33 @@ function requireMethod() {
|
|
|
2707
2707
|
var service, hasRequiredService;
|
|
2708
2708
|
function requireService() {
|
|
2709
2709
|
if (hasRequiredService) return service;
|
|
2710
|
-
hasRequiredService = 1, service =
|
|
2710
|
+
hasRequiredService = 1, service = d;
|
|
2711
2711
|
var s = requireNamespace();
|
|
2712
|
-
((
|
|
2712
|
+
((d.prototype = Object.create(s.prototype)).constructor = d).className = "Service";
|
|
2713
2713
|
var i = requireMethod(), r = requireUtil(), u = rpc;
|
|
2714
|
-
function
|
|
2714
|
+
function d(l, c) {
|
|
2715
2715
|
s.call(this, l, c), this.methods = {}, this._methodsArray = null;
|
|
2716
2716
|
}
|
|
2717
|
-
|
|
2718
|
-
var a = new
|
|
2719
|
-
if (
|
|
2720
|
-
for (var
|
|
2721
|
-
a.add(i.fromJSON(
|
|
2722
|
-
return
|
|
2723
|
-
},
|
|
2724
|
-
var
|
|
2717
|
+
d.fromJSON = function(c, h) {
|
|
2718
|
+
var a = new d(c, h.options);
|
|
2719
|
+
if (h.methods)
|
|
2720
|
+
for (var m = Object.keys(h.methods), y = 0; y < m.length; ++y)
|
|
2721
|
+
a.add(i.fromJSON(m[y], h.methods[m[y]]));
|
|
2722
|
+
return h.nested && a.addJSON(h.nested), a.comment = h.comment, a;
|
|
2723
|
+
}, d.prototype.toJSON = function(c) {
|
|
2724
|
+
var h = s.prototype.toJSON.call(this, c), a = c ? !!c.keepComments : !1;
|
|
2725
2725
|
return r.toObject([
|
|
2726
2726
|
"options",
|
|
2727
|
-
|
|
2727
|
+
h && h.options || void 0,
|
|
2728
2728
|
"methods",
|
|
2729
2729
|
s.arrayToJSON(this.methodsArray, c) || /* istanbul ignore next */
|
|
2730
2730
|
{},
|
|
2731
2731
|
"nested",
|
|
2732
|
-
|
|
2732
|
+
h && h.nested || void 0,
|
|
2733
2733
|
"comment",
|
|
2734
2734
|
a ? this.comment : void 0
|
|
2735
2735
|
]);
|
|
2736
|
-
}, Object.defineProperty(
|
|
2736
|
+
}, Object.defineProperty(d.prototype, "methodsArray", {
|
|
2737
2737
|
get: function() {
|
|
2738
2738
|
return this._methodsArray || (this._methodsArray = r.toArray(this.methods));
|
|
2739
2739
|
}
|
|
@@ -2741,34 +2741,34 @@ function requireService() {
|
|
|
2741
2741
|
function o(l) {
|
|
2742
2742
|
return l._methodsArray = null, l;
|
|
2743
2743
|
}
|
|
2744
|
-
return
|
|
2744
|
+
return d.prototype.get = function(c) {
|
|
2745
2745
|
return this.methods[c] || s.prototype.get.call(this, c);
|
|
2746
|
-
},
|
|
2747
|
-
for (var c = this.methodsArray,
|
|
2746
|
+
}, d.prototype.resolveAll = function() {
|
|
2747
|
+
for (var c = this.methodsArray, h = 0; h < c.length; ++h) c[h].resolve();
|
|
2748
2748
|
return s.prototype.resolve.call(this);
|
|
2749
|
-
},
|
|
2749
|
+
}, d.prototype.add = function(c) {
|
|
2750
2750
|
if (this.get(c.name)) throw Error("duplicate name '" + c.name + "' in " + this);
|
|
2751
2751
|
return c instanceof i ? (this.methods[c.name] = c, c.parent = this, o(this)) : s.prototype.add.call(this, c);
|
|
2752
|
-
},
|
|
2752
|
+
}, d.prototype.remove = function(c) {
|
|
2753
2753
|
if (c instanceof i) {
|
|
2754
2754
|
if (this.methods[c.name] !== c) throw Error(c + " is not a member of " + this);
|
|
2755
2755
|
return delete this.methods[c.name], c.parent = null, o(this);
|
|
2756
2756
|
}
|
|
2757
2757
|
return s.prototype.remove.call(this, c);
|
|
2758
|
-
},
|
|
2759
|
-
for (var
|
|
2758
|
+
}, d.prototype.create = function(c, h, a) {
|
|
2759
|
+
for (var m = new u.Service(c, h, a), y = 0, g; y < /* initializes */
|
|
2760
2760
|
this.methodsArray.length; ++y) {
|
|
2761
|
-
var
|
|
2762
|
-
p
|
|
2761
|
+
var p = r.lcFirst((g = this._methodsArray[y]).resolve().name).replace(/[^$\w_]/g, "");
|
|
2762
|
+
m[p] = r.codegen(
|
|
2763
2763
|
["r", "c"],
|
|
2764
|
-
r.isReserved(
|
|
2764
|
+
r.isReserved(p) ? p + "_" : p
|
|
2765
2765
|
)("return this.rpcCall(m,q,s,r,c)")({
|
|
2766
2766
|
m: g,
|
|
2767
2767
|
q: g.resolvedRequestType.ctor,
|
|
2768
2768
|
s: g.resolvedResponseType.ctor
|
|
2769
2769
|
});
|
|
2770
2770
|
}
|
|
2771
|
-
return
|
|
2771
|
+
return m;
|
|
2772
2772
|
}, service;
|
|
2773
2773
|
}
|
|
2774
2774
|
var message = Message, util$1 = requireMinimal();
|
|
@@ -2807,12 +2807,12 @@ Message.prototype.toJSON = function s() {
|
|
|
2807
2807
|
var decoder_1, hasRequiredDecoder;
|
|
2808
2808
|
function requireDecoder() {
|
|
2809
2809
|
if (hasRequiredDecoder) return decoder_1;
|
|
2810
|
-
hasRequiredDecoder = 1, decoder_1 =
|
|
2810
|
+
hasRequiredDecoder = 1, decoder_1 = d;
|
|
2811
2811
|
var s = require_enum(), i = requireTypes(), r = requireUtil();
|
|
2812
2812
|
function u(o) {
|
|
2813
2813
|
return "missing required '" + o.name + "'";
|
|
2814
2814
|
}
|
|
2815
|
-
function
|
|
2815
|
+
function d(o) {
|
|
2816
2816
|
var l = r.codegen(["r", "l"], o.name + "$decode")("if(!(r instanceof Reader))")(
|
|
2817
2817
|
"r=Reader.create(r)"
|
|
2818
2818
|
)(
|
|
@@ -2823,23 +2823,23 @@ function requireDecoder() {
|
|
|
2823
2823
|
o.group && l("if((t&7)===4)")("break"), l("switch(t>>>3){");
|
|
2824
2824
|
for (var c = 0; c < /* initializes */
|
|
2825
2825
|
o.fieldsArray.length; ++c) {
|
|
2826
|
-
var
|
|
2827
|
-
l("case %i: {",
|
|
2826
|
+
var h = o._fieldsArray[c].resolve(), a = h.resolvedType instanceof s ? "int32" : h.type, m = "m" + r.safeProp(h.name);
|
|
2827
|
+
l("case %i: {", h.id), h.map ? (l("if(%s===util.emptyObject)", m)("%s={}", m)("var c2 = r.uint32()+r.pos"), i.defaults[h.keyType] !== void 0 ? l("k=%j", i.defaults[h.keyType]) : l("k=null"), i.defaults[a] !== void 0 ? l("value=%j", i.defaults[a]) : l("value=null"), l("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")(
|
|
2828
2828
|
"case 1: k=r.%s(); break",
|
|
2829
|
-
|
|
2830
|
-
)("case 2:"), i.basic[a] === void 0 ? l("value=types[%i].decode(r,r.uint32())", c) : l("value=r.%s()", a), l("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"), i.long[
|
|
2829
|
+
h.keyType
|
|
2830
|
+
)("case 2:"), i.basic[a] === void 0 ? l("value=types[%i].decode(r,r.uint32())", c) : l("value=r.%s()", a), l("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"), i.long[h.keyType] !== void 0 ? l('%s[typeof k==="object"?util.longToHash(k):k]=value', m) : l("%s[k]=value", m)) : h.repeated ? (l("if(!(%s&&%s.length))", m, m)("%s=[]", m), i.packed[a] !== void 0 && l("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")(
|
|
2831
2831
|
"%s.push(r.%s())",
|
|
2832
|
-
|
|
2832
|
+
m,
|
|
2833
2833
|
a
|
|
2834
2834
|
)("}else"), i.basic[a] === void 0 ? l(
|
|
2835
|
-
|
|
2836
|
-
|
|
2835
|
+
h.resolvedType.group ? "%s.push(types[%i].decode(r))" : "%s.push(types[%i].decode(r,r.uint32()))",
|
|
2836
|
+
m,
|
|
2837
2837
|
c
|
|
2838
|
-
) : l("%s.push(r.%s())",
|
|
2839
|
-
|
|
2840
|
-
|
|
2838
|
+
) : l("%s.push(r.%s())", m, a)) : i.basic[a] === void 0 ? l(
|
|
2839
|
+
h.resolvedType.group ? "%s=types[%i].decode(r)" : "%s=types[%i].decode(r,r.uint32())",
|
|
2840
|
+
m,
|
|
2841
2841
|
c
|
|
2842
|
-
) : l("%s=r.%s()",
|
|
2842
|
+
) : l("%s=r.%s()", m, a), l("break")("}");
|
|
2843
2843
|
}
|
|
2844
2844
|
for (l("default:")("r.skipType(t&7)")("break")("}")("}"), c = 0; c < o._fieldsArray.length; ++c) {
|
|
2845
2845
|
var y = o._fieldsArray[c];
|
|
@@ -2860,15 +2860,15 @@ function requireVerifier() {
|
|
|
2860
2860
|
function r(l, c) {
|
|
2861
2861
|
return l.name + ": " + c + (l.repeated && c !== "array" ? "[]" : l.map && c !== "object" ? "{k:" + l.keyType + "}" : "") + " expected";
|
|
2862
2862
|
}
|
|
2863
|
-
function u(l, c,
|
|
2863
|
+
function u(l, c, h, a) {
|
|
2864
2864
|
if (c.resolvedType)
|
|
2865
2865
|
if (c.resolvedType instanceof s) {
|
|
2866
2866
|
l("switch(%s){", a)("default:")("return%j", r(c, "enum value"));
|
|
2867
|
-
for (var
|
|
2868
|
-
l("case %i:", c.resolvedType.values[
|
|
2867
|
+
for (var m = Object.keys(c.resolvedType.values), y = 0; y < m.length; ++y)
|
|
2868
|
+
l("case %i:", c.resolvedType.values[m[y]]);
|
|
2869
2869
|
l("break")("}");
|
|
2870
2870
|
} else
|
|
2871
|
-
l("{")("var e=types[%i].verify(%s);",
|
|
2871
|
+
l("{")("var e=types[%i].verify(%s);", h, a)("if(e)")(
|
|
2872
2872
|
"return%j+e",
|
|
2873
2873
|
c.name + "."
|
|
2874
2874
|
)("}");
|
|
@@ -2915,28 +2915,28 @@ function requireVerifier() {
|
|
|
2915
2915
|
}
|
|
2916
2916
|
return l;
|
|
2917
2917
|
}
|
|
2918
|
-
function
|
|
2918
|
+
function d(l, c, h) {
|
|
2919
2919
|
switch (c.keyType) {
|
|
2920
2920
|
case "int32":
|
|
2921
2921
|
case "uint32":
|
|
2922
2922
|
case "sint32":
|
|
2923
2923
|
case "fixed32":
|
|
2924
2924
|
case "sfixed32":
|
|
2925
|
-
l("if(!util.key32Re.test(%s))",
|
|
2925
|
+
l("if(!util.key32Re.test(%s))", h)("return%j", r(c, "integer key"));
|
|
2926
2926
|
break;
|
|
2927
2927
|
case "int64":
|
|
2928
2928
|
case "uint64":
|
|
2929
2929
|
case "sint64":
|
|
2930
2930
|
case "fixed64":
|
|
2931
2931
|
case "sfixed64":
|
|
2932
|
-
l("if(!util.key64Re.test(%s))",
|
|
2932
|
+
l("if(!util.key64Re.test(%s))", h)(
|
|
2933
2933
|
// see comment above: x is ok, d is not
|
|
2934
2934
|
"return%j",
|
|
2935
2935
|
r(c, "integer|Long key")
|
|
2936
2936
|
);
|
|
2937
2937
|
break;
|
|
2938
2938
|
case "bool":
|
|
2939
|
-
l("if(!util.key2Re.test(%s))",
|
|
2939
|
+
l("if(!util.key2Re.test(%s))", h)("return%j", r(c, "boolean key"));
|
|
2940
2940
|
break;
|
|
2941
2941
|
}
|
|
2942
2942
|
return l;
|
|
@@ -2945,27 +2945,27 @@ function requireVerifier() {
|
|
|
2945
2945
|
var c = i.codegen(["m"], l.name + "$verify")('if(typeof m!=="object"||m===null)')(
|
|
2946
2946
|
"return%j",
|
|
2947
2947
|
"object expected"
|
|
2948
|
-
),
|
|
2949
|
-
|
|
2950
|
-
for (var
|
|
2951
|
-
l.fieldsArray.length; ++
|
|
2952
|
-
var y = l._fieldsArray[
|
|
2948
|
+
), h = l.oneofsArray, a = {};
|
|
2949
|
+
h.length && c("var p={}");
|
|
2950
|
+
for (var m = 0; m < /* initializes */
|
|
2951
|
+
l.fieldsArray.length; ++m) {
|
|
2952
|
+
var y = l._fieldsArray[m].resolve(), g = "m" + i.safeProp(y.name);
|
|
2953
2953
|
if (y.optional && c("if(%s!=null&&m.hasOwnProperty(%j)){", g, y.name), y.map)
|
|
2954
2954
|
c("if(!util.isObject(%s))", g)("return%j", r(y, "object"))(
|
|
2955
2955
|
"var k=Object.keys(%s)",
|
|
2956
2956
|
g
|
|
2957
|
-
)("for(var i=0;i<k.length;++i){"),
|
|
2957
|
+
)("for(var i=0;i<k.length;++i){"), d(c, y, "k[i]"), u(c, y, m, g + "[k[i]]")("}");
|
|
2958
2958
|
else if (y.repeated)
|
|
2959
2959
|
c("if(!Array.isArray(%s))", g)("return%j", r(y, "array"))(
|
|
2960
2960
|
"for(var i=0;i<%s.length;++i){",
|
|
2961
2961
|
g
|
|
2962
|
-
), u(c, y,
|
|
2962
|
+
), u(c, y, m, g + "[i]")("}");
|
|
2963
2963
|
else {
|
|
2964
2964
|
if (y.partOf) {
|
|
2965
|
-
var
|
|
2966
|
-
a[y.partOf.name] === 1 && c("if(p%s===1)",
|
|
2965
|
+
var p = i.safeProp(y.partOf.name);
|
|
2966
|
+
a[y.partOf.name] === 1 && c("if(p%s===1)", p)("return%j", y.partOf.name + ": multiple values"), a[y.partOf.name] = 1, c("p%s=1", p);
|
|
2967
2967
|
}
|
|
2968
|
-
u(c, y,
|
|
2968
|
+
u(c, y, m, g);
|
|
2969
2969
|
}
|
|
2970
2970
|
y.optional && c("}");
|
|
2971
2971
|
}
|
|
@@ -2977,17 +2977,17 @@ var converter = {}, hasRequiredConverter;
|
|
|
2977
2977
|
function requireConverter() {
|
|
2978
2978
|
return hasRequiredConverter || (hasRequiredConverter = 1, function(s) {
|
|
2979
2979
|
var i = s, r = require_enum(), u = requireUtil();
|
|
2980
|
-
function
|
|
2981
|
-
var
|
|
2980
|
+
function d(l, c, h, a) {
|
|
2981
|
+
var m = !1;
|
|
2982
2982
|
if (c.resolvedType)
|
|
2983
2983
|
if (c.resolvedType instanceof r) {
|
|
2984
2984
|
l("switch(d%s){", a);
|
|
2985
|
-
for (var y = c.resolvedType.values, g = Object.keys(y),
|
|
2986
|
-
y[g[
|
|
2985
|
+
for (var y = c.resolvedType.values, g = Object.keys(y), p = 0; p < g.length; ++p)
|
|
2986
|
+
y[g[p]] === c.typeDefault && !m && (l("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}', a, a, a), c.repeated || l(
|
|
2987
2987
|
// fallback to default value only for
|
|
2988
2988
|
// arrays, to avoid leaving holes.
|
|
2989
2989
|
"break"
|
|
2990
|
-
),
|
|
2990
|
+
), m = !0), l("case%j:", g[p])("case %i:", y[g[p]])("m%s=%j", a, y[g[p]])(
|
|
2991
2991
|
"break"
|
|
2992
2992
|
);
|
|
2993
2993
|
l("}");
|
|
@@ -2995,7 +2995,7 @@ function requireConverter() {
|
|
|
2995
2995
|
l('if(typeof d%s!=="object")', a)(
|
|
2996
2996
|
"throw TypeError(%j)",
|
|
2997
2997
|
c.fullName + ": object expected"
|
|
2998
|
-
)("m%s=types[%i].fromObject(d%s)", a,
|
|
2998
|
+
)("m%s=types[%i].fromObject(d%s)", a, h, a);
|
|
2999
2999
|
else {
|
|
3000
3000
|
var v = !1;
|
|
3001
3001
|
switch (c.type) {
|
|
@@ -3058,66 +3058,66 @@ function requireConverter() {
|
|
|
3058
3058
|
return l;
|
|
3059
3059
|
}
|
|
3060
3060
|
i.fromObject = function(c) {
|
|
3061
|
-
var
|
|
3061
|
+
var h = c.fieldsArray, a = u.codegen(["d"], c.name + "$fromObject")("if(d instanceof this.ctor)")(
|
|
3062
3062
|
"return d"
|
|
3063
3063
|
);
|
|
3064
|
-
if (!
|
|
3064
|
+
if (!h.length) return a("return new this.ctor");
|
|
3065
3065
|
a("var m=new this.ctor");
|
|
3066
|
-
for (var
|
|
3067
|
-
var y =
|
|
3066
|
+
for (var m = 0; m < h.length; ++m) {
|
|
3067
|
+
var y = h[m].resolve(), g = u.safeProp(y.name);
|
|
3068
3068
|
y.map ? (a("if(d%s){", g)('if(typeof d%s!=="object")', g)(
|
|
3069
3069
|
"throw TypeError(%j)",
|
|
3070
3070
|
y.fullName + ": object expected"
|
|
3071
|
-
)("m%s={}", g)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", g),
|
|
3071
|
+
)("m%s={}", g)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", g), d(
|
|
3072
3072
|
a,
|
|
3073
3073
|
y,
|
|
3074
3074
|
/* not sorted */
|
|
3075
|
-
|
|
3075
|
+
m,
|
|
3076
3076
|
g + "[ks[i]]"
|
|
3077
3077
|
)("}")("}")) : y.repeated ? (a("if(d%s){", g)("if(!Array.isArray(d%s))", g)(
|
|
3078
3078
|
"throw TypeError(%j)",
|
|
3079
3079
|
y.fullName + ": array expected"
|
|
3080
|
-
)("m%s=[]", g)("for(var i=0;i<d%s.length;++i){", g),
|
|
3080
|
+
)("m%s=[]", g)("for(var i=0;i<d%s.length;++i){", g), d(
|
|
3081
3081
|
a,
|
|
3082
3082
|
y,
|
|
3083
3083
|
/* not sorted */
|
|
3084
|
-
|
|
3084
|
+
m,
|
|
3085
3085
|
g + "[i]"
|
|
3086
3086
|
)("}")("}")) : (y.resolvedType instanceof r || a(
|
|
3087
3087
|
// no need to test for null/undefined if an enum (uses switch)
|
|
3088
3088
|
"if(d%s!=null){",
|
|
3089
3089
|
g
|
|
3090
|
-
),
|
|
3090
|
+
), d(
|
|
3091
3091
|
a,
|
|
3092
3092
|
y,
|
|
3093
3093
|
/* not sorted */
|
|
3094
|
-
|
|
3094
|
+
m,
|
|
3095
3095
|
g
|
|
3096
3096
|
), y.resolvedType instanceof r || a("}"));
|
|
3097
3097
|
}
|
|
3098
3098
|
return a("return m");
|
|
3099
3099
|
};
|
|
3100
|
-
function o(l, c,
|
|
3100
|
+
function o(l, c, h, a) {
|
|
3101
3101
|
if (c.resolvedType)
|
|
3102
3102
|
c.resolvedType instanceof r ? l(
|
|
3103
3103
|
"d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",
|
|
3104
3104
|
a,
|
|
3105
|
-
|
|
3105
|
+
h,
|
|
3106
3106
|
a,
|
|
3107
3107
|
a,
|
|
3108
|
-
|
|
3108
|
+
h,
|
|
3109
3109
|
a,
|
|
3110
3110
|
a
|
|
3111
|
-
) : l("d%s=types[%i].toObject(m%s,o)", a,
|
|
3111
|
+
) : l("d%s=types[%i].toObject(m%s,o)", a, h, a);
|
|
3112
3112
|
else {
|
|
3113
|
-
var
|
|
3113
|
+
var m = !1;
|
|
3114
3114
|
switch (c.type) {
|
|
3115
3115
|
case "double":
|
|
3116
3116
|
case "float":
|
|
3117
3117
|
l("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s", a, a, a, a);
|
|
3118
3118
|
break;
|
|
3119
3119
|
case "uint64":
|
|
3120
|
-
|
|
3120
|
+
m = !0;
|
|
3121
3121
|
case "int64":
|
|
3122
3122
|
case "sint64":
|
|
3123
3123
|
case "fixed64":
|
|
@@ -3134,7 +3134,7 @@ function requireConverter() {
|
|
|
3134
3134
|
a,
|
|
3135
3135
|
a,
|
|
3136
3136
|
a,
|
|
3137
|
-
|
|
3137
|
+
m ? "true" : "",
|
|
3138
3138
|
a
|
|
3139
3139
|
);
|
|
3140
3140
|
break;
|
|
@@ -3156,22 +3156,22 @@ function requireConverter() {
|
|
|
3156
3156
|
return l;
|
|
3157
3157
|
}
|
|
3158
3158
|
i.toObject = function(c) {
|
|
3159
|
-
var
|
|
3160
|
-
if (!
|
|
3161
|
-
for (var a = u.codegen(["m", "o"], c.name + "$toObject")("if(!o)")("o={}")("var d={}"),
|
|
3162
|
-
|
|
3163
|
-
if (
|
|
3164
|
-
for (a("if(o.arrays||o.defaults){"),
|
|
3165
|
-
a("d%s=[]", u.safeProp(p
|
|
3159
|
+
var h = c.fieldsArray.slice().sort(u.compareFieldsById);
|
|
3160
|
+
if (!h.length) return u.codegen()("return {}");
|
|
3161
|
+
for (var a = u.codegen(["m", "o"], c.name + "$toObject")("if(!o)")("o={}")("var d={}"), m = [], y = [], g = [], p = 0; p < h.length; ++p)
|
|
3162
|
+
h[p].partOf || (h[p].resolve().repeated ? m : h[p].map ? y : g).push(h[p]);
|
|
3163
|
+
if (m.length) {
|
|
3164
|
+
for (a("if(o.arrays||o.defaults){"), p = 0; p < m.length; ++p)
|
|
3165
|
+
a("d%s=[]", u.safeProp(m[p].name));
|
|
3166
3166
|
a("}");
|
|
3167
3167
|
}
|
|
3168
3168
|
if (y.length) {
|
|
3169
|
-
for (a("if(o.objects||o.defaults){"),
|
|
3169
|
+
for (a("if(o.objects||o.defaults){"), p = 0; p < y.length; ++p) a("d%s={}", u.safeProp(y[p].name));
|
|
3170
3170
|
a("}");
|
|
3171
3171
|
}
|
|
3172
3172
|
if (g.length) {
|
|
3173
|
-
for (a("if(o.defaults){"),
|
|
3174
|
-
var v = g[
|
|
3173
|
+
for (a("if(o.defaults){"), p = 0; p < g.length; ++p) {
|
|
3174
|
+
var v = g[p], b = u.safeProp(v.name);
|
|
3175
3175
|
if (v.resolvedType instanceof r)
|
|
3176
3176
|
a(
|
|
3177
3177
|
"d%s=o.enums===String?%j:%j",
|
|
@@ -3210,8 +3210,8 @@ function requireConverter() {
|
|
|
3210
3210
|
a("}");
|
|
3211
3211
|
}
|
|
3212
3212
|
var T = !1;
|
|
3213
|
-
for (
|
|
3214
|
-
var v =
|
|
3213
|
+
for (p = 0; p < h.length; ++p) {
|
|
3214
|
+
var v = h[p], w = c._fieldsArray.indexOf(v), b = u.safeProp(v.name);
|
|
3215
3215
|
v.map ? (T || (T = !0, a("var ks2")), a("if(m%s&&(ks2=Object.keys(m%s)).length){", b, b)("d%s={}", b)(
|
|
3216
3216
|
"for(var j=0;j<ks2.length;++j){"
|
|
3217
3217
|
), o(
|
|
@@ -3247,7 +3247,7 @@ var wrappers = {};
|
|
|
3247
3247
|
i[".google.protobuf.Any"] = {
|
|
3248
3248
|
fromObject: function(u) {
|
|
3249
3249
|
if (u && u["@type"]) {
|
|
3250
|
-
var
|
|
3250
|
+
var d = u["@type"].substring(u["@type"].lastIndexOf("/") + 1), o = this.lookup(d);
|
|
3251
3251
|
if (o) {
|
|
3252
3252
|
var l = u["@type"].charAt(0) === "." ? u["@type"].slice(1) : u["@type"];
|
|
3253
3253
|
return l.indexOf("/") === -1 && (l = "/" + l), this.create({
|
|
@@ -3258,18 +3258,18 @@ var wrappers = {};
|
|
|
3258
3258
|
}
|
|
3259
3259
|
return this.fromObject(u);
|
|
3260
3260
|
},
|
|
3261
|
-
toObject: function(u,
|
|
3261
|
+
toObject: function(u, d) {
|
|
3262
3262
|
var o = "type.googleapis.com/", l = "", c = "";
|
|
3263
|
-
if (
|
|
3263
|
+
if (d && d.json && u.type_url && u.value) {
|
|
3264
3264
|
c = u.type_url.substring(u.type_url.lastIndexOf("/") + 1), l = u.type_url.substring(0, u.type_url.lastIndexOf("/") + 1);
|
|
3265
|
-
var
|
|
3266
|
-
|
|
3265
|
+
var h = this.lookup(c);
|
|
3266
|
+
h && (u = h.decode(u.value));
|
|
3267
3267
|
}
|
|
3268
3268
|
if (!(u instanceof this.ctor) && u instanceof r) {
|
|
3269
|
-
var a = u.$type.toObject(u,
|
|
3270
|
-
return l === "" && (l = o), c = l +
|
|
3269
|
+
var a = u.$type.toObject(u, d), m = u.$type.fullName[0] === "." ? u.$type.fullName.slice(1) : u.$type.fullName;
|
|
3270
|
+
return l === "" && (l = o), c = l + m, a["@type"] = c, a;
|
|
3271
3271
|
}
|
|
3272
|
-
return this.toObject(u,
|
|
3272
|
+
return this.toObject(u, d);
|
|
3273
3273
|
}
|
|
3274
3274
|
};
|
|
3275
3275
|
})(wrappers);
|
|
@@ -3279,7 +3279,7 @@ function requireType() {
|
|
|
3279
3279
|
hasRequiredType = 1, type = b;
|
|
3280
3280
|
var s = requireNamespace();
|
|
3281
3281
|
((b.prototype = Object.create(s.prototype)).constructor = b).className = "Type";
|
|
3282
|
-
var i = require_enum(), r = requireOneof(), u = requireField(),
|
|
3282
|
+
var i = require_enum(), r = requireOneof(), u = requireField(), d = requireMapfield(), o = requireService(), l = message, c = reader, h = writer, a = requireUtil(), m = requireEncoder(), y = requireDecoder(), g = requireVerifier(), p = requireConverter(), v = wrappers;
|
|
3283
3283
|
function b(T, w) {
|
|
3284
3284
|
s.call(this, T, w), this.fields = {}, this.oneofs = void 0, this.extensions = void 0, this.reserved = void 0, this.group = void 0, this._fieldsById = null, this._fieldsArray = null, this._oneofsArray = null, this._ctor = null;
|
|
3285
3285
|
}
|
|
@@ -3350,8 +3350,8 @@ function requireType() {
|
|
|
3350
3350
|
}
|
|
3351
3351
|
}
|
|
3352
3352
|
}), b.generateConstructor = function(w) {
|
|
3353
|
-
for (var x = a.codegen(["p"], w.name), O = 0,
|
|
3354
|
-
(
|
|
3353
|
+
for (var x = a.codegen(["p"], w.name), O = 0, E; O < w.fieldsArray.length; ++O)
|
|
3354
|
+
(E = w._fieldsArray[O]).map ? x("this%s={}", a.safeProp(E.name)) : E.repeated && x("this%s=[]", a.safeProp(E.name));
|
|
3355
3355
|
return x("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")(
|
|
3356
3356
|
// omit undefined or null
|
|
3357
3357
|
"this[ks[i]]=p[ks[i]]"
|
|
@@ -3363,22 +3363,22 @@ function requireType() {
|
|
|
3363
3363
|
return b.fromJSON = function(w, x) {
|
|
3364
3364
|
var O = new b(w, x.options);
|
|
3365
3365
|
O.extensions = x.extensions, O.reserved = x.reserved;
|
|
3366
|
-
for (var
|
|
3366
|
+
for (var E = Object.keys(x.fields), R = 0; R < E.length; ++R)
|
|
3367
3367
|
O.add(
|
|
3368
|
-
(typeof x.fields[R
|
|
3369
|
-
R
|
|
3370
|
-
x.fields[R
|
|
3368
|
+
(typeof x.fields[E[R]].keyType < "u" ? d.fromJSON : u.fromJSON)(
|
|
3369
|
+
E[R],
|
|
3370
|
+
x.fields[E[R]]
|
|
3371
3371
|
)
|
|
3372
3372
|
);
|
|
3373
3373
|
if (x.oneofs)
|
|
3374
|
-
for (
|
|
3375
|
-
O.add(r.fromJSON(R
|
|
3374
|
+
for (E = Object.keys(x.oneofs), R = 0; R < E.length; ++R)
|
|
3375
|
+
O.add(r.fromJSON(E[R], x.oneofs[E[R]]));
|
|
3376
3376
|
if (x.nested)
|
|
3377
|
-
for (
|
|
3378
|
-
var S = x.nested[R
|
|
3377
|
+
for (E = Object.keys(x.nested), R = 0; R < E.length; ++R) {
|
|
3378
|
+
var S = x.nested[E[R]];
|
|
3379
3379
|
O.add(
|
|
3380
3380
|
// most to least likely
|
|
3381
|
-
(S.id !== void 0 ? u.fromJSON : S.fields !== void 0 ? b.fromJSON : S.values !== void 0 ? i.fromJSON : S.methods !== void 0 ? o.fromJSON : s.fromJSON)(R
|
|
3381
|
+
(S.id !== void 0 ? u.fromJSON : S.fields !== void 0 ? b.fromJSON : S.values !== void 0 ? i.fromJSON : S.methods !== void 0 ? o.fromJSON : s.fromJSON)(E[R], S)
|
|
3382
3382
|
);
|
|
3383
3383
|
}
|
|
3384
3384
|
return x.extensions && x.extensions.length && (O.extensions = x.extensions), x.reserved && x.reserved.length && (O.reserved = x.reserved), x.group && (O.group = !0), x.comment && (O.comment = x.comment), O;
|
|
@@ -3391,8 +3391,8 @@ function requireType() {
|
|
|
3391
3391
|
s.arrayToJSON(this.oneofsArray, w),
|
|
3392
3392
|
"fields",
|
|
3393
3393
|
s.arrayToJSON(
|
|
3394
|
-
this.fieldsArray.filter(function(
|
|
3395
|
-
return !
|
|
3394
|
+
this.fieldsArray.filter(function(E) {
|
|
3395
|
+
return !E.declaringField;
|
|
3396
3396
|
}),
|
|
3397
3397
|
w
|
|
3398
3398
|
) || {},
|
|
@@ -3450,8 +3450,8 @@ function requireType() {
|
|
|
3450
3450
|
for (var w = this.fullName, x = [], O = 0; O < /* initializes */
|
|
3451
3451
|
this.fieldsArray.length; ++O)
|
|
3452
3452
|
x.push(this._fieldsArray[O].resolve().resolvedType);
|
|
3453
|
-
this.encode =
|
|
3454
|
-
Writer:
|
|
3453
|
+
this.encode = m(this)({
|
|
3454
|
+
Writer: h,
|
|
3455
3455
|
types: x,
|
|
3456
3456
|
util: a
|
|
3457
3457
|
}), this.decode = y(this)({
|
|
@@ -3461,17 +3461,17 @@ function requireType() {
|
|
|
3461
3461
|
}), this.verify = g(this)({
|
|
3462
3462
|
types: x,
|
|
3463
3463
|
util: a
|
|
3464
|
-
}), this.fromObject =
|
|
3464
|
+
}), this.fromObject = p.fromObject(this)({
|
|
3465
3465
|
types: x,
|
|
3466
3466
|
util: a
|
|
3467
|
-
}), this.toObject =
|
|
3467
|
+
}), this.toObject = p.toObject(this)({
|
|
3468
3468
|
types: x,
|
|
3469
3469
|
util: a
|
|
3470
3470
|
});
|
|
3471
|
-
var
|
|
3472
|
-
if (
|
|
3473
|
-
var
|
|
3474
|
-
|
|
3471
|
+
var E = v[w];
|
|
3472
|
+
if (E) {
|
|
3473
|
+
var R = Object.create(this);
|
|
3474
|
+
R.fromObject = this.fromObject, this.fromObject = E.fromObject.bind(R), R.toObject = this.toObject, this.toObject = E.toObject.bind(R);
|
|
3475
3475
|
}
|
|
3476
3476
|
return this;
|
|
3477
3477
|
}, b.prototype.encode = function(w, x) {
|
|
@@ -3497,22 +3497,22 @@ function requireType() {
|
|
|
3497
3497
|
var root$1, hasRequiredRoot;
|
|
3498
3498
|
function requireRoot() {
|
|
3499
3499
|
if (hasRequiredRoot) return root$1;
|
|
3500
|
-
hasRequiredRoot = 1, root$1 =
|
|
3500
|
+
hasRequiredRoot = 1, root$1 = h;
|
|
3501
3501
|
var s = requireNamespace();
|
|
3502
|
-
((
|
|
3503
|
-
var i = requireField(), r = require_enum(), u = requireOneof(),
|
|
3504
|
-
function
|
|
3502
|
+
((h.prototype = Object.create(s.prototype)).constructor = h).className = "Root";
|
|
3503
|
+
var i = requireField(), r = require_enum(), u = requireOneof(), d = requireUtil(), o, l, c;
|
|
3504
|
+
function h(g) {
|
|
3505
3505
|
s.call(this, "", g), this.deferred = [], this.files = [];
|
|
3506
3506
|
}
|
|
3507
|
-
|
|
3508
|
-
return v || (v = new
|
|
3509
|
-
},
|
|
3507
|
+
h.fromJSON = function(p, v) {
|
|
3508
|
+
return v || (v = new h()), p.options && v.setOptions(p.options), v.addJSON(p.nested);
|
|
3509
|
+
}, h.prototype.resolvePath = d.path.resolve, h.prototype.fetch = d.fetch;
|
|
3510
3510
|
function a() {
|
|
3511
3511
|
}
|
|
3512
|
-
|
|
3512
|
+
h.prototype.load = function g(p, v, b) {
|
|
3513
3513
|
typeof v == "function" && (b = v, v = void 0);
|
|
3514
3514
|
var _ = this;
|
|
3515
|
-
if (!b) return
|
|
3515
|
+
if (!b) return d.asPromise(g, _, p, v);
|
|
3516
3516
|
var T = b === a;
|
|
3517
3517
|
function w(C, D) {
|
|
3518
3518
|
if (b) {
|
|
@@ -3531,44 +3531,44 @@ function requireRoot() {
|
|
|
3531
3531
|
}
|
|
3532
3532
|
function O(C, D) {
|
|
3533
3533
|
try {
|
|
3534
|
-
if (
|
|
3534
|
+
if (d.isString(D) && D.charAt(0) === "{" && (D = JSON.parse(D)), !d.isString(D)) _.setOptions(D.options).addJSON(D.nested);
|
|
3535
3535
|
else {
|
|
3536
3536
|
l.filename = C;
|
|
3537
3537
|
var I = l(D, _, v), $, q = 0;
|
|
3538
3538
|
if (I.imports)
|
|
3539
3539
|
for (; q < I.imports.length; ++q)
|
|
3540
|
-
($ = x(I.imports[q]) || _.resolvePath(C, I.imports[q])) &&
|
|
3540
|
+
($ = x(I.imports[q]) || _.resolvePath(C, I.imports[q])) && E($);
|
|
3541
3541
|
if (I.weakImports)
|
|
3542
3542
|
for (q = 0; q < I.weakImports.length; ++q)
|
|
3543
|
-
($ = x(I.weakImports[q]) || _.resolvePath(C, I.weakImports[q])) &&
|
|
3543
|
+
($ = x(I.weakImports[q]) || _.resolvePath(C, I.weakImports[q])) && E($, !0);
|
|
3544
3544
|
}
|
|
3545
3545
|
} catch (F) {
|
|
3546
3546
|
w(F);
|
|
3547
3547
|
}
|
|
3548
|
-
!T && !
|
|
3548
|
+
!T && !R && w(null, _);
|
|
3549
3549
|
}
|
|
3550
|
-
function
|
|
3550
|
+
function E(C, D) {
|
|
3551
3551
|
if (C = x(C) || C, !(_.files.indexOf(C) > -1)) {
|
|
3552
3552
|
if (_.files.push(C), C in c) {
|
|
3553
|
-
T ? O(C, c[C]) : (++
|
|
3554
|
-
--
|
|
3553
|
+
T ? O(C, c[C]) : (++R, setTimeout(function() {
|
|
3554
|
+
--R, O(C, c[C]);
|
|
3555
3555
|
}));
|
|
3556
3556
|
return;
|
|
3557
3557
|
}
|
|
3558
3558
|
if (T) {
|
|
3559
3559
|
var I;
|
|
3560
3560
|
try {
|
|
3561
|
-
I =
|
|
3561
|
+
I = d.fs.readFileSync(C).toString("utf8");
|
|
3562
3562
|
} catch ($) {
|
|
3563
3563
|
D || w($);
|
|
3564
3564
|
return;
|
|
3565
3565
|
}
|
|
3566
3566
|
O(C, I);
|
|
3567
3567
|
} else
|
|
3568
|
-
++
|
|
3569
|
-
if (--
|
|
3568
|
+
++R, _.fetch(C, function($, q) {
|
|
3569
|
+
if (--R, !!b) {
|
|
3570
3570
|
if ($) {
|
|
3571
|
-
D ?
|
|
3571
|
+
D ? R || w(null, _) : w($);
|
|
3572
3572
|
return;
|
|
3573
3573
|
}
|
|
3574
3574
|
O(C, q);
|
|
@@ -3576,81 +3576,81 @@ function requireRoot() {
|
|
|
3576
3576
|
});
|
|
3577
3577
|
}
|
|
3578
3578
|
}
|
|
3579
|
-
var
|
|
3580
|
-
|
|
3581
|
-
for (var S = 0, P; S <
|
|
3582
|
-
(P = _.resolvePath("",
|
|
3579
|
+
var R = 0;
|
|
3580
|
+
d.isString(p) && (p = [p]);
|
|
3581
|
+
for (var S = 0, P; S < p.length; ++S)
|
|
3582
|
+
(P = _.resolvePath("", p[S])) && E(P);
|
|
3583
3583
|
if (T) return _;
|
|
3584
|
-
|
|
3585
|
-
},
|
|
3586
|
-
if (!
|
|
3587
|
-
return this.load(
|
|
3588
|
-
},
|
|
3584
|
+
R || w(null, _);
|
|
3585
|
+
}, h.prototype.loadSync = function(p, v) {
|
|
3586
|
+
if (!d.isNode) throw Error("not supported");
|
|
3587
|
+
return this.load(p, v, a);
|
|
3588
|
+
}, h.prototype.resolveAll = function() {
|
|
3589
3589
|
if (this.deferred.length)
|
|
3590
3590
|
throw Error(
|
|
3591
|
-
"unresolvable extensions: " + this.deferred.map(function(
|
|
3592
|
-
return "'extend " +
|
|
3591
|
+
"unresolvable extensions: " + this.deferred.map(function(p) {
|
|
3592
|
+
return "'extend " + p.extend + "' in " + p.parent.fullName;
|
|
3593
3593
|
}).join(", ")
|
|
3594
3594
|
);
|
|
3595
3595
|
return s.prototype.resolveAll.call(this);
|
|
3596
3596
|
};
|
|
3597
|
-
var
|
|
3598
|
-
function y(g,
|
|
3599
|
-
var v =
|
|
3597
|
+
var m = /^[A-Z]/;
|
|
3598
|
+
function y(g, p) {
|
|
3599
|
+
var v = p.parent.lookup(p.extend);
|
|
3600
3600
|
if (v) {
|
|
3601
3601
|
var b = new i(
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3602
|
+
p.fullName,
|
|
3603
|
+
p.id,
|
|
3604
|
+
p.type,
|
|
3605
|
+
p.rule,
|
|
3606
3606
|
void 0,
|
|
3607
|
-
|
|
3607
|
+
p.options
|
|
3608
3608
|
);
|
|
3609
|
-
return v.get(b.name) || (b.declaringField =
|
|
3609
|
+
return v.get(b.name) || (b.declaringField = p, p.extensionField = b, v.add(b)), !0;
|
|
3610
3610
|
}
|
|
3611
3611
|
return !1;
|
|
3612
3612
|
}
|
|
3613
|
-
return
|
|
3614
|
-
if (
|
|
3613
|
+
return h.prototype._handleAdd = function(p) {
|
|
3614
|
+
if (p instanceof i)
|
|
3615
3615
|
/* an extension field (implies not part of a oneof) */
|
|
3616
|
-
|
|
3617
|
-
!
|
|
3618
|
-
else if (
|
|
3619
|
-
|
|
3620
|
-
else if (!(
|
|
3621
|
-
if (
|
|
3616
|
+
p.extend !== void 0 && /* not already handled */
|
|
3617
|
+
!p.extensionField && (y(this, p) || this.deferred.push(p));
|
|
3618
|
+
else if (p instanceof r)
|
|
3619
|
+
m.test(p.name) && (p.parent[p.name] = p.values);
|
|
3620
|
+
else if (!(p instanceof u)) {
|
|
3621
|
+
if (p instanceof o)
|
|
3622
3622
|
for (var v = 0; v < this.deferred.length; )
|
|
3623
3623
|
y(this, this.deferred[v]) ? this.deferred.splice(v, 1) : ++v;
|
|
3624
3624
|
for (var b = 0; b < /* initializes */
|
|
3625
|
-
|
|
3626
|
-
this._handleAdd(
|
|
3627
|
-
|
|
3625
|
+
p.nestedArray.length; ++b)
|
|
3626
|
+
this._handleAdd(p._nestedArray[b]);
|
|
3627
|
+
m.test(p.name) && (p.parent[p.name] = p);
|
|
3628
3628
|
}
|
|
3629
|
-
},
|
|
3630
|
-
if (
|
|
3629
|
+
}, h.prototype._handleRemove = function(p) {
|
|
3630
|
+
if (p instanceof i) {
|
|
3631
3631
|
if (
|
|
3632
3632
|
/* an extension field */
|
|
3633
|
-
|
|
3633
|
+
p.extend !== void 0
|
|
3634
3634
|
)
|
|
3635
3635
|
if (
|
|
3636
3636
|
/* already handled */
|
|
3637
|
-
|
|
3637
|
+
p.extensionField
|
|
3638
3638
|
)
|
|
3639
|
-
|
|
3639
|
+
p.extensionField.parent.remove(p.extensionField), p.extensionField = null;
|
|
3640
3640
|
else {
|
|
3641
|
-
var v = this.deferred.indexOf(
|
|
3641
|
+
var v = this.deferred.indexOf(p);
|
|
3642
3642
|
v > -1 && this.deferred.splice(v, 1);
|
|
3643
3643
|
}
|
|
3644
|
-
} else if (
|
|
3645
|
-
|
|
3646
|
-
else if (
|
|
3644
|
+
} else if (p instanceof r)
|
|
3645
|
+
m.test(p.name) && delete p.parent[p.name];
|
|
3646
|
+
else if (p instanceof s) {
|
|
3647
3647
|
for (var b = 0; b < /* initializes */
|
|
3648
|
-
|
|
3649
|
-
this._handleRemove(
|
|
3650
|
-
|
|
3648
|
+
p.nestedArray.length; ++b)
|
|
3649
|
+
this._handleRemove(p._nestedArray[b]);
|
|
3650
|
+
m.test(p.name) && delete p.parent[p.name];
|
|
3651
3651
|
}
|
|
3652
|
-
},
|
|
3653
|
-
o = g, l =
|
|
3652
|
+
}, h._configure = function(g, p, v) {
|
|
3653
|
+
o = g, l = p, c = v;
|
|
3654
3654
|
}, root$1;
|
|
3655
3655
|
}
|
|
3656
3656
|
var hasRequiredUtil;
|
|
@@ -3660,39 +3660,39 @@ function requireUtil() {
|
|
|
3660
3660
|
var s = util$2.exports = requireMinimal(), i = roots, r, u;
|
|
3661
3661
|
s.codegen = codegen_1, s.fetch = fetch_1, s.path = path, s.fs = s.inquire("fs"), s.toArray = function(a) {
|
|
3662
3662
|
if (a) {
|
|
3663
|
-
for (var
|
|
3663
|
+
for (var m = Object.keys(a), y = new Array(m.length), g = 0; g < m.length; ) y[g] = a[m[g++]];
|
|
3664
3664
|
return y;
|
|
3665
3665
|
}
|
|
3666
3666
|
return [];
|
|
3667
3667
|
}, s.toObject = function(a) {
|
|
3668
|
-
for (var
|
|
3669
|
-
var g = a[y++],
|
|
3670
|
-
|
|
3668
|
+
for (var m = {}, y = 0; y < a.length; ) {
|
|
3669
|
+
var g = a[y++], p = a[y++];
|
|
3670
|
+
p !== void 0 && (m[g] = p);
|
|
3671
3671
|
}
|
|
3672
|
-
return
|
|
3672
|
+
return m;
|
|
3673
3673
|
};
|
|
3674
|
-
var
|
|
3674
|
+
var d = /\\/g, o = /"/g;
|
|
3675
3675
|
s.isReserved = function(a) {
|
|
3676
3676
|
return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(
|
|
3677
3677
|
a
|
|
3678
3678
|
);
|
|
3679
3679
|
}, s.safeProp = function(a) {
|
|
3680
|
-
return !/^[$\w_]+$/.test(a) || s.isReserved(a) ? '["' + a.replace(
|
|
3680
|
+
return !/^[$\w_]+$/.test(a) || s.isReserved(a) ? '["' + a.replace(d, "\\\\").replace(o, '\\"') + '"]' : "." + a;
|
|
3681
3681
|
}, s.ucFirst = function(a) {
|
|
3682
3682
|
return a.charAt(0).toUpperCase() + a.substring(1);
|
|
3683
3683
|
};
|
|
3684
3684
|
var l = /_([a-z])/g;
|
|
3685
3685
|
s.camelCase = function(a) {
|
|
3686
|
-
return a.substring(0, 1) + a.substring(1).replace(l, function(
|
|
3686
|
+
return a.substring(0, 1) + a.substring(1).replace(l, function(m, y) {
|
|
3687
3687
|
return y.toUpperCase();
|
|
3688
3688
|
});
|
|
3689
|
-
}, s.compareFieldsById = function(a,
|
|
3690
|
-
return a.id -
|
|
3691
|
-
}, s.decorateType = function(a,
|
|
3689
|
+
}, s.compareFieldsById = function(a, m) {
|
|
3690
|
+
return a.id - m.id;
|
|
3691
|
+
}, s.decorateType = function(a, m) {
|
|
3692
3692
|
if (a.$type)
|
|
3693
|
-
return
|
|
3693
|
+
return m && a.$type.name !== m && (s.decorateRoot.remove(a.$type), a.$type.name = m, s.decorateRoot.add(a.$type)), a.$type;
|
|
3694
3694
|
r || (r = requireType());
|
|
3695
|
-
var y = new r(
|
|
3695
|
+
var y = new r(m || a.name);
|
|
3696
3696
|
return s.decorateRoot.add(y), y.ctor = a, Object.defineProperty(a, "$type", {
|
|
3697
3697
|
value: y,
|
|
3698
3698
|
enumerable: !1
|
|
@@ -3705,27 +3705,27 @@ function requireUtil() {
|
|
|
3705
3705
|
return s.decorateEnum = function(a) {
|
|
3706
3706
|
if (a.$type) return a.$type;
|
|
3707
3707
|
u || (u = require_enum());
|
|
3708
|
-
var
|
|
3709
|
-
return s.decorateRoot.add(
|
|
3710
|
-
value:
|
|
3708
|
+
var m = new u("Enum" + c++, a);
|
|
3709
|
+
return s.decorateRoot.add(m), Object.defineProperty(a, "$type", {
|
|
3710
|
+
value: m,
|
|
3711
3711
|
enumerable: !1
|
|
3712
|
-
}),
|
|
3713
|
-
}, s.setProperty = function(a,
|
|
3714
|
-
function g(
|
|
3712
|
+
}), m;
|
|
3713
|
+
}, s.setProperty = function(a, m, y) {
|
|
3714
|
+
function g(p, v, b) {
|
|
3715
3715
|
var _ = v.shift();
|
|
3716
3716
|
if (_ === "__proto__" || _ === "prototype")
|
|
3717
|
-
return
|
|
3717
|
+
return p;
|
|
3718
3718
|
if (v.length > 0)
|
|
3719
|
-
|
|
3719
|
+
p[_] = g(p[_] || {}, v, b);
|
|
3720
3720
|
else {
|
|
3721
|
-
var T =
|
|
3722
|
-
T && (b = [].concat(T).concat(b)),
|
|
3721
|
+
var T = p[_];
|
|
3722
|
+
T && (b = [].concat(T).concat(b)), p[_] = b;
|
|
3723
3723
|
}
|
|
3724
|
-
return
|
|
3724
|
+
return p;
|
|
3725
3725
|
}
|
|
3726
3726
|
if (typeof a != "object") throw TypeError("dst must be an object");
|
|
3727
|
-
if (!
|
|
3728
|
-
return
|
|
3727
|
+
if (!m) throw TypeError("path must be specified");
|
|
3728
|
+
return m = m.split("."), g(a, m, y);
|
|
3729
3729
|
}, Object.defineProperty(s, "decorateRoot", {
|
|
3730
3730
|
get: function() {
|
|
3731
3731
|
return i.decorated || (i.decorated = new (requireRoot())());
|
|
@@ -3737,10 +3737,10 @@ function requireObject() {
|
|
|
3737
3737
|
if (hasRequiredObject) return object;
|
|
3738
3738
|
hasRequiredObject = 1, object = r, r.className = "ReflectionObject";
|
|
3739
3739
|
var s = requireUtil(), i;
|
|
3740
|
-
function r(u,
|
|
3740
|
+
function r(u, d) {
|
|
3741
3741
|
if (!s.isString(u)) throw TypeError("name must be a string");
|
|
3742
|
-
if (
|
|
3743
|
-
this.options =
|
|
3742
|
+
if (d && !s.isObject(d)) throw TypeError("options must be an object");
|
|
3743
|
+
this.options = d, this.parsedOptions = null, this.name = u, this.parent = null, this.resolved = !1, this.comment = null, this.filename = null;
|
|
3744
3744
|
}
|
|
3745
3745
|
return Object.defineProperties(r.prototype, {
|
|
3746
3746
|
/**
|
|
@@ -3763,52 +3763,52 @@ function requireObject() {
|
|
|
3763
3763
|
*/
|
|
3764
3764
|
fullName: {
|
|
3765
3765
|
get: function() {
|
|
3766
|
-
for (var u = [this.name],
|
|
3767
|
-
u.unshift(
|
|
3766
|
+
for (var u = [this.name], d = this.parent; d; )
|
|
3767
|
+
u.unshift(d.name), d = d.parent;
|
|
3768
3768
|
return u.join(".");
|
|
3769
3769
|
}
|
|
3770
3770
|
}
|
|
3771
3771
|
}), r.prototype.toJSON = /* istanbul ignore next */
|
|
3772
3772
|
function() {
|
|
3773
3773
|
throw Error();
|
|
3774
|
-
}, r.prototype.onAdd = function(
|
|
3775
|
-
this.parent && this.parent !==
|
|
3776
|
-
var o =
|
|
3774
|
+
}, r.prototype.onAdd = function(d) {
|
|
3775
|
+
this.parent && this.parent !== d && this.parent.remove(this), this.parent = d, this.resolved = !1;
|
|
3776
|
+
var o = d.root;
|
|
3777
3777
|
o instanceof i && o._handleAdd(this);
|
|
3778
|
-
}, r.prototype.onRemove = function(
|
|
3779
|
-
var o =
|
|
3778
|
+
}, r.prototype.onRemove = function(d) {
|
|
3779
|
+
var o = d.root;
|
|
3780
3780
|
o instanceof i && o._handleRemove(this), this.parent = null, this.resolved = !1;
|
|
3781
3781
|
}, r.prototype.resolve = function() {
|
|
3782
3782
|
return this.resolved ? this : (this.root instanceof i && (this.resolved = !0), this);
|
|
3783
|
-
}, r.prototype.getOption = function(
|
|
3784
|
-
if (this.options) return this.options[
|
|
3785
|
-
}, r.prototype.setOption = function(
|
|
3786
|
-
return (!l || !this.options || this.options[
|
|
3787
|
-
}, r.prototype.setParsedOption = function(
|
|
3783
|
+
}, r.prototype.getOption = function(d) {
|
|
3784
|
+
if (this.options) return this.options[d];
|
|
3785
|
+
}, r.prototype.setOption = function(d, o, l) {
|
|
3786
|
+
return (!l || !this.options || this.options[d] === void 0) && ((this.options || (this.options = {}))[d] = o), this;
|
|
3787
|
+
}, r.prototype.setParsedOption = function(d, o, l) {
|
|
3788
3788
|
this.parsedOptions || (this.parsedOptions = []);
|
|
3789
3789
|
var c = this.parsedOptions;
|
|
3790
3790
|
if (l) {
|
|
3791
|
-
var
|
|
3792
|
-
return Object.prototype.hasOwnProperty.call(y,
|
|
3791
|
+
var h = c.find(function(y) {
|
|
3792
|
+
return Object.prototype.hasOwnProperty.call(y, d);
|
|
3793
3793
|
});
|
|
3794
|
-
if (
|
|
3795
|
-
var a = d
|
|
3794
|
+
if (h) {
|
|
3795
|
+
var a = h[d];
|
|
3796
3796
|
s.setProperty(a, l, o);
|
|
3797
3797
|
} else
|
|
3798
|
-
|
|
3798
|
+
h = {}, h[d] = s.setProperty({}, l, o), c.push(h);
|
|
3799
3799
|
} else {
|
|
3800
|
-
var
|
|
3801
|
-
|
|
3800
|
+
var m = {};
|
|
3801
|
+
m[d] = o, c.push(m);
|
|
3802
3802
|
}
|
|
3803
3803
|
return this;
|
|
3804
|
-
}, r.prototype.setOptions = function(
|
|
3805
|
-
if (
|
|
3806
|
-
for (var l = Object.keys(
|
|
3807
|
-
this.setOption(l[c],
|
|
3804
|
+
}, r.prototype.setOptions = function(d, o) {
|
|
3805
|
+
if (d)
|
|
3806
|
+
for (var l = Object.keys(d), c = 0; c < l.length; ++c)
|
|
3807
|
+
this.setOption(l[c], d[l[c]], o);
|
|
3808
3808
|
return this;
|
|
3809
3809
|
}, r.prototype.toString = function() {
|
|
3810
|
-
var
|
|
3811
|
-
return o.length ?
|
|
3810
|
+
var d = this.constructor.className, o = this.fullName;
|
|
3811
|
+
return o.length ? d + " " + o : d;
|
|
3812
3812
|
}, r._configure = function(u) {
|
|
3813
3813
|
i = u;
|
|
3814
3814
|
}, object;
|
|
@@ -3820,11 +3820,11 @@ function require_enum() {
|
|
|
3820
3820
|
var s = requireObject();
|
|
3821
3821
|
((u.prototype = Object.create(s.prototype)).constructor = u).className = "Enum";
|
|
3822
3822
|
var i = requireNamespace(), r = requireUtil();
|
|
3823
|
-
function u(
|
|
3824
|
-
if (s.call(this,
|
|
3825
|
-
if (this.valuesById = {}, this.values = Object.create(this.valuesById), this.comment = c, this.comments =
|
|
3826
|
-
for (var
|
|
3827
|
-
typeof o[
|
|
3823
|
+
function u(d, o, l, c, h, a) {
|
|
3824
|
+
if (s.call(this, d, l), o && typeof o != "object") throw TypeError("values must be an object");
|
|
3825
|
+
if (this.valuesById = {}, this.values = Object.create(this.valuesById), this.comment = c, this.comments = h || {}, this.valuesOptions = a, this.reserved = void 0, o)
|
|
3826
|
+
for (var m = Object.keys(o), y = 0; y < m.length; ++y)
|
|
3827
|
+
typeof o[m[y]] == "number" && (this.valuesById[this.values[m[y]] = o[m[y]]] = m[y]);
|
|
3828
3828
|
}
|
|
3829
3829
|
return u.fromJSON = function(o, l) {
|
|
3830
3830
|
var c = new u(o, l.values, l.options, l.comment, l.comments);
|
|
@@ -3845,7 +3845,7 @@ function require_enum() {
|
|
|
3845
3845
|
"comments",
|
|
3846
3846
|
l ? this.comments : void 0
|
|
3847
3847
|
]);
|
|
3848
|
-
}, u.prototype.add = function(o, l, c,
|
|
3848
|
+
}, u.prototype.add = function(o, l, c, h) {
|
|
3849
3849
|
if (!r.isString(o)) throw TypeError("name must be a string");
|
|
3850
3850
|
if (!r.isInteger(l)) throw TypeError("id must be an integer");
|
|
3851
3851
|
if (this.values[o] !== void 0) throw Error("duplicate name '" + o + "' in " + this);
|
|
@@ -3856,7 +3856,7 @@ function require_enum() {
|
|
|
3856
3856
|
throw Error("duplicate id " + l + " in " + this);
|
|
3857
3857
|
this.values[o] = l;
|
|
3858
3858
|
} else this.valuesById[this.values[o] = l] = o;
|
|
3859
|
-
return
|
|
3859
|
+
return h && (this.valuesOptions === void 0 && (this.valuesOptions = {}), this.valuesOptions[o] = h || null), this.comments[o] = c || null, this;
|
|
3860
3860
|
}, u.prototype.remove = function(o) {
|
|
3861
3861
|
if (!r.isString(o)) throw TypeError("name must be a string");
|
|
3862
3862
|
var l = this.values[o];
|
|
@@ -3871,49 +3871,49 @@ function require_enum() {
|
|
|
3871
3871
|
var encoder_1, hasRequiredEncoder;
|
|
3872
3872
|
function requireEncoder() {
|
|
3873
3873
|
if (hasRequiredEncoder) return encoder_1;
|
|
3874
|
-
hasRequiredEncoder = 1, encoder_1 =
|
|
3874
|
+
hasRequiredEncoder = 1, encoder_1 = d;
|
|
3875
3875
|
var s = require_enum(), i = requireTypes(), r = requireUtil();
|
|
3876
|
-
function u(o, l, c,
|
|
3876
|
+
function u(o, l, c, h) {
|
|
3877
3877
|
return l.resolvedType.group ? o(
|
|
3878
3878
|
"types[%i].encode(%s,w.uint32(%i)).uint32(%i)",
|
|
3879
3879
|
c,
|
|
3880
|
-
|
|
3880
|
+
h,
|
|
3881
3881
|
(l.id << 3 | 3) >>> 0,
|
|
3882
3882
|
(l.id << 3 | 4) >>> 0
|
|
3883
3883
|
) : o(
|
|
3884
3884
|
"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",
|
|
3885
3885
|
c,
|
|
3886
|
-
|
|
3886
|
+
h,
|
|
3887
3887
|
(l.id << 3 | 2) >>> 0
|
|
3888
3888
|
);
|
|
3889
3889
|
}
|
|
3890
|
-
function
|
|
3891
|
-
for (var l = r.codegen(["m", "w"], o.name + "$encode")("if(!w)")("w=Writer.create()"), c,
|
|
3890
|
+
function d(o) {
|
|
3891
|
+
for (var l = r.codegen(["m", "w"], o.name + "$encode")("if(!w)")("w=Writer.create()"), c, h, a = (
|
|
3892
3892
|
/* initializes */
|
|
3893
3893
|
o.fieldsArray.slice().sort(r.compareFieldsById)
|
|
3894
3894
|
), c = 0; c < a.length; ++c) {
|
|
3895
|
-
var
|
|
3896
|
-
|
|
3895
|
+
var m = a[c].resolve(), y = o._fieldsArray.indexOf(m), g = m.resolvedType instanceof s ? "int32" : m.type, p = i.basic[g];
|
|
3896
|
+
h = "m" + r.safeProp(m.name), m.map ? (l(
|
|
3897
3897
|
"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",
|
|
3898
|
-
|
|
3899
|
-
|
|
3898
|
+
h,
|
|
3899
|
+
m.name
|
|
3900
3900
|
)(
|
|
3901
3901
|
// !== undefined && !== null
|
|
3902
3902
|
"for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",
|
|
3903
|
-
|
|
3903
|
+
h
|
|
3904
3904
|
)(
|
|
3905
3905
|
"w.uint32(%i).fork().uint32(%i).%s(ks[i])",
|
|
3906
|
-
(
|
|
3907
|
-
8 | i.mapKey[
|
|
3908
|
-
|
|
3909
|
-
),
|
|
3906
|
+
(m.id << 3 | 2) >>> 0,
|
|
3907
|
+
8 | i.mapKey[m.keyType],
|
|
3908
|
+
m.keyType
|
|
3909
|
+
), p === void 0 ? l("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", y, h) : l(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | p, g, h), l("}")("}")) : m.repeated ? (l("if(%s!=null&&%s.length){", h, h), m.packed && i.packed[g] !== void 0 ? l("w.uint32(%i).fork()", (m.id << 3 | 2) >>> 0)(
|
|
3910
3910
|
"for(var i=0;i<%s.length;++i)",
|
|
3911
|
-
|
|
3911
|
+
h
|
|
3912
3912
|
)(
|
|
3913
3913
|
"w.%s(%s[i])",
|
|
3914
3914
|
g,
|
|
3915
|
-
|
|
3916
|
-
)("w.ldelim()") : (l("for(var i=0;i<%s.length;++i)",
|
|
3915
|
+
h
|
|
3916
|
+
)("w.ldelim()") : (l("for(var i=0;i<%s.length;++i)", h), p === void 0 ? u(l, m, y, h + "[i]") : l("w.uint32(%i).%s(%s[i])", (m.id << 3 | p) >>> 0, g, h)), l("}")) : (m.optional && l("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", h, m.name), p === void 0 ? u(l, m, y, h) : l("w.uint32(%i).%s(%s)", (m.id << 3 | p) >>> 0, g, h));
|
|
3917
3917
|
}
|
|
3918
3918
|
return l("return w");
|
|
3919
3919
|
}
|
|
@@ -3972,25 +3972,25 @@ function unescape(s) {
|
|
|
3972
3972
|
tokenize$1.unescape = unescape;
|
|
3973
3973
|
function tokenize$1(s, i) {
|
|
3974
3974
|
s = s.toString();
|
|
3975
|
-
var r = 0, u = s.length,
|
|
3975
|
+
var r = 0, u = s.length, d = 1, o = 0, l = {}, c = [], h = null;
|
|
3976
3976
|
function a(O) {
|
|
3977
|
-
return Error("illegal " + O + " (line " +
|
|
3977
|
+
return Error("illegal " + O + " (line " + d + ")");
|
|
3978
3978
|
}
|
|
3979
|
-
function
|
|
3980
|
-
var O =
|
|
3979
|
+
function m() {
|
|
3980
|
+
var O = h === "'" ? stringSingleRe : stringDoubleRe;
|
|
3981
3981
|
O.lastIndex = r - 1;
|
|
3982
|
-
var
|
|
3983
|
-
if (!
|
|
3984
|
-
return r = O.lastIndex, _(
|
|
3982
|
+
var E = O.exec(s);
|
|
3983
|
+
if (!E) throw a("string");
|
|
3984
|
+
return r = O.lastIndex, _(h), h = null, unescape(E[1]);
|
|
3985
3985
|
}
|
|
3986
3986
|
function y(O) {
|
|
3987
3987
|
return s.charAt(O);
|
|
3988
3988
|
}
|
|
3989
|
-
function g(O,
|
|
3989
|
+
function g(O, E, R) {
|
|
3990
3990
|
var S = {
|
|
3991
3991
|
type: s.charAt(O++),
|
|
3992
3992
|
lineEmpty: !1,
|
|
3993
|
-
leading:
|
|
3993
|
+
leading: R
|
|
3994
3994
|
}, P;
|
|
3995
3995
|
i ? P = 2 : P = 3;
|
|
3996
3996
|
var C = O - P, D;
|
|
@@ -4001,59 +4001,59 @@ function tokenize$1(s, i) {
|
|
|
4001
4001
|
break;
|
|
4002
4002
|
}
|
|
4003
4003
|
while (D === " " || D === " ");
|
|
4004
|
-
for (var I = s.substring(O,
|
|
4004
|
+
for (var I = s.substring(O, E).split(setCommentSplitRe), $ = 0; $ < I.length; ++$)
|
|
4005
4005
|
I[$] = I[$].replace(i ? setCommentAltRe : setCommentRe, "").trim();
|
|
4006
4006
|
S.text = I.join(`
|
|
4007
|
-
`).trim(), l[
|
|
4007
|
+
`).trim(), l[d] = S, o = d;
|
|
4008
4008
|
}
|
|
4009
|
-
function
|
|
4010
|
-
var
|
|
4009
|
+
function p(O) {
|
|
4010
|
+
var E = v(O), R = s.substring(O, E), S = /^\s*\/\//.test(R);
|
|
4011
4011
|
return S;
|
|
4012
4012
|
}
|
|
4013
4013
|
function v(O) {
|
|
4014
|
-
for (var
|
|
4014
|
+
for (var E = O; E < u && y(E) !== `
|
|
4015
4015
|
`; )
|
|
4016
|
-
|
|
4017
|
-
return
|
|
4016
|
+
E++;
|
|
4017
|
+
return E;
|
|
4018
4018
|
}
|
|
4019
4019
|
function b() {
|
|
4020
4020
|
if (c.length > 0) return c.shift();
|
|
4021
|
-
if (
|
|
4022
|
-
var O,
|
|
4021
|
+
if (h) return m();
|
|
4022
|
+
var O, E, R, S, P, C = r === 0;
|
|
4023
4023
|
do {
|
|
4024
4024
|
if (r === u) return null;
|
|
4025
|
-
for (O = !1; whitespaceRe.test(
|
|
4026
|
-
if (
|
|
4027
|
-
` && (C = !0, ++
|
|
4025
|
+
for (O = !1; whitespaceRe.test(R = y(r)); )
|
|
4026
|
+
if (R === `
|
|
4027
|
+
` && (C = !0, ++d), ++r === u) return null;
|
|
4028
4028
|
if (y(r) === "/") {
|
|
4029
4029
|
if (++r === u)
|
|
4030
4030
|
throw a("comment");
|
|
4031
4031
|
if (y(r) === "/")
|
|
4032
4032
|
if (i) {
|
|
4033
|
-
if (S = r, P = !1,
|
|
4033
|
+
if (S = r, P = !1, p(r - 1)) {
|
|
4034
4034
|
P = !0;
|
|
4035
4035
|
do
|
|
4036
4036
|
if (r = v(r), r === u || (r++, !C))
|
|
4037
4037
|
break;
|
|
4038
|
-
while (
|
|
4038
|
+
while (p(r));
|
|
4039
4039
|
} else
|
|
4040
4040
|
r = Math.min(u, v(r) + 1);
|
|
4041
|
-
P && (g(S, r, C), C = !0),
|
|
4041
|
+
P && (g(S, r, C), C = !0), d++, O = !0;
|
|
4042
4042
|
} else {
|
|
4043
4043
|
for (P = y(S = r + 1) === "/"; y(++r) !== `
|
|
4044
4044
|
`; )
|
|
4045
4045
|
if (r === u)
|
|
4046
4046
|
return null;
|
|
4047
|
-
++r, P && (g(S, r - 1, C), C = !0), ++
|
|
4047
|
+
++r, P && (g(S, r - 1, C), C = !0), ++d, O = !0;
|
|
4048
4048
|
}
|
|
4049
|
-
else if ((
|
|
4049
|
+
else if ((R = y(r)) === "*") {
|
|
4050
4050
|
S = r + 1, P = i || y(S) === "*";
|
|
4051
4051
|
do {
|
|
4052
|
-
if (
|
|
4053
|
-
` && ++
|
|
4052
|
+
if (R === `
|
|
4053
|
+
` && ++d, ++r === u)
|
|
4054
4054
|
throw a("comment");
|
|
4055
|
-
|
|
4056
|
-
} while (
|
|
4055
|
+
E = R, R = y(r);
|
|
4056
|
+
} while (E !== "*" || R !== "/");
|
|
4057
4057
|
++r, P && (g(S, r - 2, C), C = !0), O = !0;
|
|
4058
4058
|
} else
|
|
4059
4059
|
return "/";
|
|
@@ -4064,7 +4064,7 @@ function tokenize$1(s, i) {
|
|
|
4064
4064
|
var I = delimRe.test(y(D++));
|
|
4065
4065
|
if (!I) for (; D < u && !delimRe.test(y(D)); ) ++D;
|
|
4066
4066
|
var $ = s.substring(r, r = D);
|
|
4067
|
-
return ($ === '"' || $ === "'") && (
|
|
4067
|
+
return ($ === '"' || $ === "'") && (h = $), $;
|
|
4068
4068
|
}
|
|
4069
4069
|
function _(O) {
|
|
4070
4070
|
c.push(O);
|
|
@@ -4077,16 +4077,16 @@ function tokenize$1(s, i) {
|
|
|
4077
4077
|
}
|
|
4078
4078
|
return c[0];
|
|
4079
4079
|
}
|
|
4080
|
-
function w(O,
|
|
4081
|
-
var
|
|
4080
|
+
function w(O, E) {
|
|
4081
|
+
var R = T(), S = R === O;
|
|
4082
4082
|
if (S)
|
|
4083
4083
|
return b(), !0;
|
|
4084
|
-
if (!
|
|
4084
|
+
if (!E) throw a("token '" + R + "', '" + O + "' expected");
|
|
4085
4085
|
return !1;
|
|
4086
4086
|
}
|
|
4087
4087
|
function x(O) {
|
|
4088
|
-
var
|
|
4089
|
-
return O === void 0 ? (
|
|
4088
|
+
var E = null, R;
|
|
4089
|
+
return O === void 0 ? (R = l[d - 1], delete l[d - 1], R && (i || R.type === "*" || R.lineEmpty) && (E = R.leading ? R.text : null)) : (o < O && T(), R = l[O], delete l[O], R && !R.lineEmpty && (i || R.type === "/") && (E = R.leading ? null : R.text)), E;
|
|
4090
4090
|
}
|
|
4091
4091
|
return Object.defineProperty(
|
|
4092
4092
|
{
|
|
@@ -4099,7 +4099,7 @@ function tokenize$1(s, i) {
|
|
|
4099
4099
|
"line",
|
|
4100
4100
|
{
|
|
4101
4101
|
get: function() {
|
|
4102
|
-
return
|
|
4102
|
+
return d;
|
|
4103
4103
|
}
|
|
4104
4104
|
}
|
|
4105
4105
|
);
|
|
@@ -4112,20 +4112,20 @@ parse.defaults = {
|
|
|
4112
4112
|
var tokenize = tokenize_1, Root = requireRoot(), Type = requireType(), Field = requireField(), MapField = requireMapfield(), OneOf = requireOneof(), Enum = require_enum(), Service = requireService(), Method = requireMethod(), types = requireTypes(), util = requireUtil(), base10Re = /^[1-9][0-9]*$/, base10NegRe = /^-?[1-9][0-9]*$/, base16Re = /^0[x][0-9a-fA-F]+$/, base16NegRe = /^-?0[x][0-9a-fA-F]+$/, base8Re = /^0[0-7]+$/, base8NegRe = /^-?0[0-7]+$/, numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;
|
|
4113
4113
|
function parse(s, i, r) {
|
|
4114
4114
|
i instanceof Root || (r = i, i = new Root()), r || (r = parse.defaults);
|
|
4115
|
-
var u = r.preferTrailingComment || !1,
|
|
4115
|
+
var u = r.preferTrailingComment || !1, d = tokenize(s, r.alternateCommentMode || !1), o = d.next, l = d.push, c = d.peek, h = d.skip, a = d.cmnt, m = !0, y, g, p, v, b = !1, _ = i, T = r.keepCase ? function(A) {
|
|
4116
4116
|
return A;
|
|
4117
4117
|
} : util.camelCase;
|
|
4118
4118
|
function w(A, k, N) {
|
|
4119
|
-
var
|
|
4119
|
+
var L = parse.filename;
|
|
4120
4120
|
return N || (parse.filename = null), Error(
|
|
4121
|
-
"illegal " + (k || "token") + " '" + A + "' (" + (
|
|
4121
|
+
"illegal " + (k || "token") + " '" + A + "' (" + (L ? L + ", " : "") + "line " + d.line + ")"
|
|
4122
4122
|
);
|
|
4123
4123
|
}
|
|
4124
4124
|
function x() {
|
|
4125
4125
|
var A = [], k;
|
|
4126
4126
|
do {
|
|
4127
4127
|
if ((k = o()) !== '"' && k !== "'") throw w(k);
|
|
4128
|
-
A.push(o()),
|
|
4128
|
+
A.push(o()), h(k), k = c();
|
|
4129
4129
|
} while (k === '"' || k === "'");
|
|
4130
4130
|
return A.join("");
|
|
4131
4131
|
}
|
|
@@ -4143,7 +4143,7 @@ function parse(s, i, r) {
|
|
|
4143
4143
|
return !1;
|
|
4144
4144
|
}
|
|
4145
4145
|
try {
|
|
4146
|
-
return
|
|
4146
|
+
return R(
|
|
4147
4147
|
A,
|
|
4148
4148
|
/* insideTryCatch */
|
|
4149
4149
|
!0
|
|
@@ -4153,29 +4153,29 @@ function parse(s, i, r) {
|
|
|
4153
4153
|
throw w(A, "value");
|
|
4154
4154
|
}
|
|
4155
4155
|
}
|
|
4156
|
-
function
|
|
4157
|
-
var N,
|
|
4156
|
+
function E(A, k) {
|
|
4157
|
+
var N, L;
|
|
4158
4158
|
do
|
|
4159
|
-
k && ((N = c()) === '"' || N === "'") ? A.push(x()) : A.push([
|
|
4160
|
-
while (
|
|
4161
|
-
var
|
|
4159
|
+
k && ((N = c()) === '"' || N === "'") ? A.push(x()) : A.push([L = S(o()), h("to", !0) ? S(o()) : L]);
|
|
4160
|
+
while (h(",", !0));
|
|
4161
|
+
var B = {
|
|
4162
4162
|
options: void 0
|
|
4163
4163
|
};
|
|
4164
|
-
|
|
4164
|
+
B.setOption = function(M, j) {
|
|
4165
4165
|
this.options === void 0 && (this.options = {}), this.options[M] = j;
|
|
4166
4166
|
}, $(
|
|
4167
|
-
|
|
4167
|
+
B,
|
|
4168
4168
|
function(j) {
|
|
4169
4169
|
if (j === "option")
|
|
4170
|
-
Z(
|
|
4170
|
+
Z(B, j), h(";");
|
|
4171
4171
|
else throw w(j);
|
|
4172
4172
|
},
|
|
4173
4173
|
function() {
|
|
4174
|
-
X(
|
|
4174
|
+
X(B);
|
|
4175
4175
|
}
|
|
4176
4176
|
);
|
|
4177
4177
|
}
|
|
4178
|
-
function
|
|
4178
|
+
function R(A, k) {
|
|
4179
4179
|
var N = 1;
|
|
4180
4180
|
switch (A.charAt(0) === "-" && (N = -1, A = A.substring(1)), A) {
|
|
4181
4181
|
case "inf":
|
|
@@ -4214,13 +4214,13 @@ function parse(s, i, r) {
|
|
|
4214
4214
|
function P() {
|
|
4215
4215
|
if (y !== void 0) throw w("package");
|
|
4216
4216
|
if (y = o(), !typeRefRe.test(y)) throw w(y, "name");
|
|
4217
|
-
_ = _.define(y),
|
|
4217
|
+
_ = _.define(y), h(";");
|
|
4218
4218
|
}
|
|
4219
4219
|
function C() {
|
|
4220
4220
|
var A = c(), k;
|
|
4221
4221
|
switch (A) {
|
|
4222
4222
|
case "weak":
|
|
4223
|
-
k =
|
|
4223
|
+
k = p || (p = []), o();
|
|
4224
4224
|
break;
|
|
4225
4225
|
case "public":
|
|
4226
4226
|
o();
|
|
@@ -4228,16 +4228,16 @@ function parse(s, i, r) {
|
|
|
4228
4228
|
k = g || (g = []);
|
|
4229
4229
|
break;
|
|
4230
4230
|
}
|
|
4231
|
-
A = x(),
|
|
4231
|
+
A = x(), h(";"), k.push(A);
|
|
4232
4232
|
}
|
|
4233
4233
|
function D() {
|
|
4234
|
-
if (
|
|
4235
|
-
i.setOption("syntax", v),
|
|
4234
|
+
if (h("="), v = x(), b = v === "proto3", !b && v !== "proto2") throw w(v, "syntax");
|
|
4235
|
+
i.setOption("syntax", v), h(";");
|
|
4236
4236
|
}
|
|
4237
4237
|
function I(A, k) {
|
|
4238
4238
|
switch (k) {
|
|
4239
4239
|
case "option":
|
|
4240
|
-
return Z(A, k),
|
|
4240
|
+
return Z(A, k), h(";"), !0;
|
|
4241
4241
|
case "message":
|
|
4242
4242
|
return q(A, k), !0;
|
|
4243
4243
|
case "enum":
|
|
@@ -4250,74 +4250,74 @@ function parse(s, i, r) {
|
|
|
4250
4250
|
return !1;
|
|
4251
4251
|
}
|
|
4252
4252
|
function $(A, k, N) {
|
|
4253
|
-
var
|
|
4254
|
-
if (A && (typeof A.comment != "string" && (A.comment = a()), A.filename = parse.filename),
|
|
4255
|
-
for (var
|
|
4256
|
-
|
|
4253
|
+
var L = d.line;
|
|
4254
|
+
if (A && (typeof A.comment != "string" && (A.comment = a()), A.filename = parse.filename), h("{", !0)) {
|
|
4255
|
+
for (var B; (B = o()) !== "}"; ) k(B);
|
|
4256
|
+
h(";", !0);
|
|
4257
4257
|
} else
|
|
4258
|
-
N && N(),
|
|
4258
|
+
N && N(), h(";"), A && (typeof A.comment != "string" || u) && (A.comment = a(L) || A.comment);
|
|
4259
4259
|
}
|
|
4260
4260
|
function q(A, k) {
|
|
4261
4261
|
if (!nameRe.test(k = o())) throw w(k, "type name");
|
|
4262
4262
|
var N = new Type(k);
|
|
4263
|
-
$(N, function(
|
|
4264
|
-
if (!I(N,
|
|
4265
|
-
switch (
|
|
4263
|
+
$(N, function(B) {
|
|
4264
|
+
if (!I(N, B))
|
|
4265
|
+
switch (B) {
|
|
4266
4266
|
case "map":
|
|
4267
4267
|
te(N);
|
|
4268
4268
|
break;
|
|
4269
4269
|
case "required":
|
|
4270
4270
|
case "repeated":
|
|
4271
|
-
F(N,
|
|
4271
|
+
F(N, B);
|
|
4272
4272
|
break;
|
|
4273
4273
|
case "optional":
|
|
4274
4274
|
b ? F(N, "proto3_optional") : F(N, "optional");
|
|
4275
4275
|
break;
|
|
4276
4276
|
case "oneof":
|
|
4277
|
-
re(N,
|
|
4277
|
+
re(N, B);
|
|
4278
4278
|
break;
|
|
4279
4279
|
case "extensions":
|
|
4280
|
-
|
|
4280
|
+
E(N.extensions || (N.extensions = []));
|
|
4281
4281
|
break;
|
|
4282
4282
|
case "reserved":
|
|
4283
|
-
|
|
4283
|
+
E(N.reserved || (N.reserved = []), !0);
|
|
4284
4284
|
break;
|
|
4285
4285
|
default:
|
|
4286
|
-
if (!b || !typeRefRe.test(
|
|
4287
|
-
l(
|
|
4286
|
+
if (!b || !typeRefRe.test(B)) throw w(B);
|
|
4287
|
+
l(B), F(N, "optional");
|
|
4288
4288
|
break;
|
|
4289
4289
|
}
|
|
4290
4290
|
}), A.add(N);
|
|
4291
4291
|
}
|
|
4292
4292
|
function F(A, k, N) {
|
|
4293
|
-
var
|
|
4294
|
-
if (
|
|
4293
|
+
var L = o();
|
|
4294
|
+
if (L === "group") {
|
|
4295
4295
|
U(A, k);
|
|
4296
4296
|
return;
|
|
4297
4297
|
}
|
|
4298
|
-
for (;
|
|
4299
|
-
|
|
4300
|
-
if (!typeRefRe.test(
|
|
4301
|
-
var
|
|
4302
|
-
if (!nameRe.test(
|
|
4303
|
-
|
|
4304
|
-
var M = new Field(
|
|
4298
|
+
for (; L.endsWith(".") || c().startsWith("."); )
|
|
4299
|
+
L += o();
|
|
4300
|
+
if (!typeRefRe.test(L)) throw w(L, "type");
|
|
4301
|
+
var B = o();
|
|
4302
|
+
if (!nameRe.test(B)) throw w(B, "name");
|
|
4303
|
+
B = T(B), h("=");
|
|
4304
|
+
var M = new Field(B, S(o()), L, k, N);
|
|
4305
4305
|
if ($(
|
|
4306
4306
|
M,
|
|
4307
4307
|
function(W) {
|
|
4308
4308
|
if (W === "option")
|
|
4309
|
-
Z(M, W),
|
|
4309
|
+
Z(M, W), h(";");
|
|
4310
4310
|
else throw w(W);
|
|
4311
4311
|
},
|
|
4312
4312
|
function() {
|
|
4313
4313
|
X(M);
|
|
4314
4314
|
}
|
|
4315
4315
|
), k === "proto3_optional") {
|
|
4316
|
-
var j = new OneOf("_" +
|
|
4316
|
+
var j = new OneOf("_" + B);
|
|
4317
4317
|
M.setOption("proto3_optional", !0), j.add(M), A.add(j);
|
|
4318
4318
|
} else
|
|
4319
4319
|
A.add(M);
|
|
4320
|
-
!b && M.repeated && (types.packed[
|
|
4320
|
+
!b && M.repeated && (types.packed[L] !== void 0 || types.basic[L] === void 0) && M.setOption(
|
|
4321
4321
|
"packed",
|
|
4322
4322
|
!1,
|
|
4323
4323
|
/* ifNotSet */
|
|
@@ -4327,15 +4327,15 @@ function parse(s, i, r) {
|
|
|
4327
4327
|
function U(A, k) {
|
|
4328
4328
|
var N = o();
|
|
4329
4329
|
if (!nameRe.test(N)) throw w(N, "name");
|
|
4330
|
-
var
|
|
4331
|
-
N ===
|
|
4332
|
-
var
|
|
4330
|
+
var L = util.lcFirst(N);
|
|
4331
|
+
N === L && (N = util.ucFirst(N)), h("=");
|
|
4332
|
+
var B = S(o()), M = new Type(N);
|
|
4333
4333
|
M.group = !0;
|
|
4334
|
-
var j = new Field(
|
|
4334
|
+
var j = new Field(L, B, N, k);
|
|
4335
4335
|
j.filename = parse.filename, $(M, function(W) {
|
|
4336
4336
|
switch (W) {
|
|
4337
4337
|
case "option":
|
|
4338
|
-
Z(M, W),
|
|
4338
|
+
Z(M, W), h(";");
|
|
4339
4339
|
break;
|
|
4340
4340
|
case "required":
|
|
4341
4341
|
case "repeated":
|
|
@@ -4357,102 +4357,102 @@ function parse(s, i, r) {
|
|
|
4357
4357
|
}), A.add(M).add(j);
|
|
4358
4358
|
}
|
|
4359
4359
|
function te(A) {
|
|
4360
|
-
|
|
4360
|
+
h("<");
|
|
4361
4361
|
var k = o();
|
|
4362
4362
|
if (types.mapKey[k] === void 0) throw w(k, "type");
|
|
4363
|
-
|
|
4363
|
+
h(",");
|
|
4364
4364
|
var N = o();
|
|
4365
4365
|
if (!typeRefRe.test(N)) throw w(N, "type");
|
|
4366
|
-
|
|
4367
|
-
var
|
|
4368
|
-
if (!nameRe.test(
|
|
4369
|
-
|
|
4370
|
-
var
|
|
4366
|
+
h(">");
|
|
4367
|
+
var L = o();
|
|
4368
|
+
if (!nameRe.test(L)) throw w(L, "name");
|
|
4369
|
+
h("=");
|
|
4370
|
+
var B = new MapField(T(L), S(o()), k, N);
|
|
4371
4371
|
$(
|
|
4372
|
-
|
|
4372
|
+
B,
|
|
4373
4373
|
function(j) {
|
|
4374
4374
|
if (j === "option")
|
|
4375
|
-
Z(
|
|
4375
|
+
Z(B, j), h(";");
|
|
4376
4376
|
else throw w(j);
|
|
4377
4377
|
},
|
|
4378
4378
|
function() {
|
|
4379
|
-
X(
|
|
4379
|
+
X(B);
|
|
4380
4380
|
}
|
|
4381
|
-
), A.add(
|
|
4381
|
+
), A.add(B);
|
|
4382
4382
|
}
|
|
4383
4383
|
function re(A, k) {
|
|
4384
4384
|
if (!nameRe.test(k = o())) throw w(k, "name");
|
|
4385
4385
|
var N = new OneOf(T(k));
|
|
4386
|
-
$(N, function(
|
|
4387
|
-
|
|
4386
|
+
$(N, function(B) {
|
|
4387
|
+
B === "option" ? (Z(N, B), h(";")) : (l(B), F(N, "optional"));
|
|
4388
4388
|
}), A.add(N);
|
|
4389
4389
|
}
|
|
4390
4390
|
function Q(A, k) {
|
|
4391
4391
|
if (!nameRe.test(k = o())) throw w(k, "name");
|
|
4392
4392
|
var N = new Enum(k);
|
|
4393
|
-
$(N, function(
|
|
4394
|
-
switch (
|
|
4393
|
+
$(N, function(B) {
|
|
4394
|
+
switch (B) {
|
|
4395
4395
|
case "option":
|
|
4396
|
-
Z(N,
|
|
4396
|
+
Z(N, B), h(";");
|
|
4397
4397
|
break;
|
|
4398
4398
|
case "reserved":
|
|
4399
|
-
|
|
4399
|
+
E(N.reserved || (N.reserved = []), !0);
|
|
4400
4400
|
break;
|
|
4401
4401
|
default:
|
|
4402
|
-
ie(N,
|
|
4402
|
+
ie(N, B);
|
|
4403
4403
|
}
|
|
4404
4404
|
}), A.add(N);
|
|
4405
4405
|
}
|
|
4406
4406
|
function ie(A, k) {
|
|
4407
4407
|
if (!nameRe.test(k)) throw w(k, "name");
|
|
4408
|
-
|
|
4409
|
-
var N = S(o(), !0),
|
|
4408
|
+
h("=");
|
|
4409
|
+
var N = S(o(), !0), L = {
|
|
4410
4410
|
options: void 0
|
|
4411
4411
|
};
|
|
4412
|
-
|
|
4413
|
-
this.options === void 0 && (this.options = {}), this.options[
|
|
4412
|
+
L.setOption = function(B, M) {
|
|
4413
|
+
this.options === void 0 && (this.options = {}), this.options[B] = M;
|
|
4414
4414
|
}, $(
|
|
4415
|
-
|
|
4415
|
+
L,
|
|
4416
4416
|
function(M) {
|
|
4417
4417
|
if (M === "option")
|
|
4418
|
-
Z(
|
|
4418
|
+
Z(L, M), h(";");
|
|
4419
4419
|
else throw w(M);
|
|
4420
4420
|
},
|
|
4421
4421
|
function() {
|
|
4422
|
-
X(
|
|
4422
|
+
X(L);
|
|
4423
4423
|
}
|
|
4424
|
-
), A.add(k, N,
|
|
4424
|
+
), A.add(k, N, L.comment, L.options);
|
|
4425
4425
|
}
|
|
4426
4426
|
function Z(A, k) {
|
|
4427
|
-
var N =
|
|
4427
|
+
var N = h("(", !0);
|
|
4428
4428
|
if (!typeRefRe.test(k = o())) throw w(k, "name");
|
|
4429
|
-
var
|
|
4430
|
-
N && (
|
|
4431
|
-
var j = ee(A,
|
|
4432
|
-
ne(A,
|
|
4429
|
+
var L = k, B = L, M;
|
|
4430
|
+
N && (h(")"), L = "(" + L + ")", B = L, k = c(), fqTypeRefRe.test(k) && (M = k.slice(1), L += k, o())), h("=");
|
|
4431
|
+
var j = ee(A, L);
|
|
4432
|
+
ne(A, B, j, M);
|
|
4433
4433
|
}
|
|
4434
4434
|
function ee(A, k) {
|
|
4435
|
-
if (
|
|
4436
|
-
for (var N = {}; !
|
|
4435
|
+
if (h("{", !0)) {
|
|
4436
|
+
for (var N = {}; !h("}", !0); ) {
|
|
4437
4437
|
if (!nameRe.test(H = o()))
|
|
4438
4438
|
throw w(H, "name");
|
|
4439
4439
|
if (H === null)
|
|
4440
4440
|
throw w(H, "end of input");
|
|
4441
|
-
var
|
|
4442
|
-
if (
|
|
4441
|
+
var L, B = H;
|
|
4442
|
+
if (h(":", !0), c() === "{") L = ee(A, k + "." + H);
|
|
4443
4443
|
else if (c() === "[") {
|
|
4444
|
-
|
|
4444
|
+
L = [];
|
|
4445
4445
|
var M;
|
|
4446
|
-
if (
|
|
4446
|
+
if (h("[", !0)) {
|
|
4447
4447
|
do
|
|
4448
|
-
M = O(),
|
|
4449
|
-
while (
|
|
4450
|
-
|
|
4448
|
+
M = O(), L.push(M);
|
|
4449
|
+
while (h(",", !0));
|
|
4450
|
+
h("]"), typeof M < "u" && K(A, k + "." + H, M);
|
|
4451
4451
|
}
|
|
4452
4452
|
} else
|
|
4453
|
-
|
|
4454
|
-
var j = N[
|
|
4455
|
-
j && (
|
|
4453
|
+
L = O(), K(A, k + "." + H, L);
|
|
4454
|
+
var j = N[B];
|
|
4455
|
+
j && (L = [].concat(j).concat(L)), N[B] = L, h(",", !0), h(";", !0);
|
|
4456
4456
|
}
|
|
4457
4457
|
return N;
|
|
4458
4458
|
}
|
|
@@ -4462,55 +4462,55 @@ function parse(s, i, r) {
|
|
|
4462
4462
|
function K(A, k, N) {
|
|
4463
4463
|
A.setOption && A.setOption(k, N);
|
|
4464
4464
|
}
|
|
4465
|
-
function ne(A, k, N,
|
|
4466
|
-
A.setParsedOption && A.setParsedOption(k, N,
|
|
4465
|
+
function ne(A, k, N, L) {
|
|
4466
|
+
A.setParsedOption && A.setParsedOption(k, N, L);
|
|
4467
4467
|
}
|
|
4468
4468
|
function X(A) {
|
|
4469
|
-
if (
|
|
4469
|
+
if (h("[", !0)) {
|
|
4470
4470
|
do
|
|
4471
4471
|
Z(A, "option");
|
|
4472
|
-
while (
|
|
4473
|
-
|
|
4472
|
+
while (h(",", !0));
|
|
4473
|
+
h("]");
|
|
4474
4474
|
}
|
|
4475
4475
|
return A;
|
|
4476
4476
|
}
|
|
4477
4477
|
function se(A, k) {
|
|
4478
4478
|
if (!nameRe.test(k = o())) throw w(k, "service name");
|
|
4479
4479
|
var N = new Service(k);
|
|
4480
|
-
$(N, function(
|
|
4481
|
-
if (!I(N,
|
|
4482
|
-
if (
|
|
4483
|
-
else throw w(
|
|
4480
|
+
$(N, function(B) {
|
|
4481
|
+
if (!I(N, B))
|
|
4482
|
+
if (B === "rpc") ae(N, B);
|
|
4483
|
+
else throw w(B);
|
|
4484
4484
|
}), A.add(N);
|
|
4485
4485
|
}
|
|
4486
4486
|
function ae(A, k) {
|
|
4487
|
-
var N = a(),
|
|
4487
|
+
var N = a(), L = k;
|
|
4488
4488
|
if (!nameRe.test(k = o())) throw w(k, "name");
|
|
4489
|
-
var
|
|
4490
|
-
if (
|
|
4491
|
-
V = k,
|
|
4492
|
-
var J = new Method(
|
|
4489
|
+
var B = k, M, j, V, W;
|
|
4490
|
+
if (h("("), h("stream", !0) && (j = !0), !typeRefRe.test(k = o()) || (M = k, h(")"), h("returns"), h("("), h("stream", !0) && (W = !0), !typeRefRe.test(k = o()))) throw w(k);
|
|
4491
|
+
V = k, h(")");
|
|
4492
|
+
var J = new Method(B, L, M, V, j, W);
|
|
4493
4493
|
J.comment = N, $(J, function(Y) {
|
|
4494
4494
|
if (Y === "option")
|
|
4495
|
-
Z(J, Y),
|
|
4495
|
+
Z(J, Y), h(";");
|
|
4496
4496
|
else throw w(Y);
|
|
4497
4497
|
}), A.add(J);
|
|
4498
4498
|
}
|
|
4499
4499
|
function oe(A, k) {
|
|
4500
4500
|
if (!typeRefRe.test(k = o())) throw w(k, "reference");
|
|
4501
4501
|
var N = k;
|
|
4502
|
-
$(null, function(
|
|
4503
|
-
switch (
|
|
4502
|
+
$(null, function(B) {
|
|
4503
|
+
switch (B) {
|
|
4504
4504
|
case "required":
|
|
4505
4505
|
case "repeated":
|
|
4506
|
-
F(A,
|
|
4506
|
+
F(A, B, N);
|
|
4507
4507
|
break;
|
|
4508
4508
|
case "optional":
|
|
4509
4509
|
b ? F(A, "proto3_optional", N) : F(A, "optional", N);
|
|
4510
4510
|
break;
|
|
4511
4511
|
default:
|
|
4512
|
-
if (!b || !typeRefRe.test(
|
|
4513
|
-
l(
|
|
4512
|
+
if (!b || !typeRefRe.test(B)) throw w(B);
|
|
4513
|
+
l(B), F(A, "optional", N);
|
|
4514
4514
|
break;
|
|
4515
4515
|
}
|
|
4516
4516
|
});
|
|
@@ -4518,23 +4518,23 @@ function parse(s, i, r) {
|
|
|
4518
4518
|
for (var H; (H = o()) !== null; )
|
|
4519
4519
|
switch (H) {
|
|
4520
4520
|
case "package":
|
|
4521
|
-
if (!
|
|
4521
|
+
if (!m) throw w(H);
|
|
4522
4522
|
P();
|
|
4523
4523
|
break;
|
|
4524
4524
|
case "import":
|
|
4525
|
-
if (!
|
|
4525
|
+
if (!m) throw w(H);
|
|
4526
4526
|
C();
|
|
4527
4527
|
break;
|
|
4528
4528
|
case "syntax":
|
|
4529
|
-
if (!
|
|
4529
|
+
if (!m) throw w(H);
|
|
4530
4530
|
D();
|
|
4531
4531
|
break;
|
|
4532
4532
|
case "option":
|
|
4533
|
-
Z(_, H),
|
|
4533
|
+
Z(_, H), h(";");
|
|
4534
4534
|
break;
|
|
4535
4535
|
default:
|
|
4536
4536
|
if (I(_, H)) {
|
|
4537
|
-
|
|
4537
|
+
m = !1;
|
|
4538
4538
|
continue;
|
|
4539
4539
|
}
|
|
4540
4540
|
throw w(H);
|
|
@@ -4542,7 +4542,7 @@ function parse(s, i, r) {
|
|
|
4542
4542
|
return parse.filename = null, {
|
|
4543
4543
|
package: y,
|
|
4544
4544
|
imports: g,
|
|
4545
|
-
weakImports:
|
|
4545
|
+
weakImports: p,
|
|
4546
4546
|
syntax: v,
|
|
4547
4547
|
root: i
|
|
4548
4548
|
};
|
|
@@ -4923,8 +4923,8 @@ function getRawTag(s) {
|
|
|
4923
4923
|
var u = !0;
|
|
4924
4924
|
} catch {
|
|
4925
4925
|
}
|
|
4926
|
-
var
|
|
4927
|
-
return u && (i ? s[symToStringTag$1] = r : delete s[symToStringTag$1]),
|
|
4926
|
+
var d = nativeObjectToString$1.call(s);
|
|
4927
|
+
return u && (i ? s[symToStringTag$1] = r : delete s[symToStringTag$1]), d;
|
|
4928
4928
|
}
|
|
4929
4929
|
var objectProto$7 = Object.prototype, nativeObjectToString = objectProto$7.toString;
|
|
4930
4930
|
function objectToString(s) {
|
|
@@ -5035,8 +5035,8 @@ var HOT_COUNT = 800, HOT_SPAN = 16, nativeNow = Date.now;
|
|
|
5035
5035
|
function shortOut(s) {
|
|
5036
5036
|
var i = 0, r = 0;
|
|
5037
5037
|
return function() {
|
|
5038
|
-
var u = nativeNow(),
|
|
5039
|
-
if (r = u,
|
|
5038
|
+
var u = nativeNow(), d = HOT_SPAN - (u - r);
|
|
5039
|
+
if (r = u, d > 0) {
|
|
5040
5040
|
if (++i >= HOT_COUNT)
|
|
5041
5041
|
return arguments[0];
|
|
5042
5042
|
} else
|
|
@@ -5073,11 +5073,11 @@ function eq(s, i) {
|
|
|
5073
5073
|
var nativeMax$1 = Math.max;
|
|
5074
5074
|
function overRest(s, i, r) {
|
|
5075
5075
|
return i = nativeMax$1(i === void 0 ? s.length - 1 : i, 0), function() {
|
|
5076
|
-
for (var u = arguments,
|
|
5077
|
-
l[
|
|
5078
|
-
|
|
5079
|
-
for (var c = Array(i + 1); ++
|
|
5080
|
-
c[
|
|
5076
|
+
for (var u = arguments, d = -1, o = nativeMax$1(u.length - i, 0), l = Array(o); ++d < o; )
|
|
5077
|
+
l[d] = u[i + d];
|
|
5078
|
+
d = -1;
|
|
5079
|
+
for (var c = Array(i + 1); ++d < i; )
|
|
5080
|
+
c[d] = u[d];
|
|
5081
5081
|
return c[i] = r(l), apply(s, this, c);
|
|
5082
5082
|
};
|
|
5083
5083
|
}
|
|
@@ -5138,13 +5138,13 @@ var freeExports = typeof exports == "object" && exports && !exports.nodeType &&
|
|
|
5138
5138
|
}
|
|
5139
5139
|
}(), nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray, isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
5140
5140
|
function arrayLikeKeys(s, i) {
|
|
5141
|
-
var r = isArray(s), u = !r && isArguments(s),
|
|
5141
|
+
var r = isArray(s), u = !r && isArguments(s), d = !r && !u && isBuffer(s), o = !r && !u && !d && isTypedArray(s), l = r || u || d || o, c = l ? baseTimes(s.length, String) : [], h = c.length;
|
|
5142
5142
|
for (var a in s)
|
|
5143
5143
|
l && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
5144
5144
|
(a == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
5145
|
-
|
|
5145
|
+
d && (a == "offset" || a == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
5146
5146
|
o && (a == "buffer" || a == "byteLength" || a == "byteOffset") || // Skip index properties.
|
|
5147
|
-
isIndex(a,
|
|
5147
|
+
isIndex(a, h)) || c.push(a);
|
|
5148
5148
|
return c;
|
|
5149
5149
|
}
|
|
5150
5150
|
function nativeKeysIn(s) {
|
|
@@ -5292,11 +5292,11 @@ function memoize(s, i) {
|
|
|
5292
5292
|
if (typeof s != "function" || i != null && typeof i != "function")
|
|
5293
5293
|
throw new TypeError(FUNC_ERROR_TEXT$1);
|
|
5294
5294
|
var r = function() {
|
|
5295
|
-
var u = arguments,
|
|
5296
|
-
if (o.has(
|
|
5297
|
-
return o.get(
|
|
5295
|
+
var u = arguments, d = i ? i.apply(this, u) : u[0], o = r.cache;
|
|
5296
|
+
if (o.has(d))
|
|
5297
|
+
return o.get(d);
|
|
5298
5298
|
var l = s.apply(this, u);
|
|
5299
|
-
return r.cache = o.set(
|
|
5299
|
+
return r.cache = o.set(d, l) || o, l;
|
|
5300
5300
|
};
|
|
5301
5301
|
return r.cache = new (memoize.Cache || MapCache)(), r;
|
|
5302
5302
|
}
|
|
@@ -5305,59 +5305,59 @@ var now = function() {
|
|
|
5305
5305
|
return root.Date.now();
|
|
5306
5306
|
}, FUNC_ERROR_TEXT = "Expected a function", nativeMax = Math.max, nativeMin = Math.min;
|
|
5307
5307
|
function debounce(s, i, r) {
|
|
5308
|
-
var u,
|
|
5308
|
+
var u, d, o, l, c, h, a = 0, m = !1, y = !1, g = !0;
|
|
5309
5309
|
if (typeof s != "function")
|
|
5310
5310
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
5311
|
-
i = toNumber(i) || 0, isObject(r) && (
|
|
5312
|
-
function
|
|
5313
|
-
var S = u, P =
|
|
5314
|
-
return u =
|
|
5311
|
+
i = toNumber(i) || 0, isObject(r) && (m = !!r.leading, y = "maxWait" in r, o = y ? nativeMax(toNumber(r.maxWait) || 0, i) : o, g = "trailing" in r ? !!r.trailing : g);
|
|
5312
|
+
function p(R) {
|
|
5313
|
+
var S = u, P = d;
|
|
5314
|
+
return u = d = void 0, a = R, l = s.apply(P, S), l;
|
|
5315
5315
|
}
|
|
5316
|
-
function v(
|
|
5317
|
-
return a =
|
|
5316
|
+
function v(R) {
|
|
5317
|
+
return a = R, c = setTimeout(T, i), m ? p(R) : l;
|
|
5318
5318
|
}
|
|
5319
|
-
function b(
|
|
5320
|
-
var S =
|
|
5319
|
+
function b(R) {
|
|
5320
|
+
var S = R - h, P = R - a, C = i - S;
|
|
5321
5321
|
return y ? nativeMin(C, o - P) : C;
|
|
5322
5322
|
}
|
|
5323
|
-
function _(
|
|
5324
|
-
var S =
|
|
5325
|
-
return
|
|
5323
|
+
function _(R) {
|
|
5324
|
+
var S = R - h, P = R - a;
|
|
5325
|
+
return h === void 0 || S >= i || S < 0 || y && P >= o;
|
|
5326
5326
|
}
|
|
5327
5327
|
function T() {
|
|
5328
|
-
var
|
|
5329
|
-
if (_(
|
|
5330
|
-
return w(
|
|
5331
|
-
c = setTimeout(T, b(
|
|
5328
|
+
var R = now();
|
|
5329
|
+
if (_(R))
|
|
5330
|
+
return w(R);
|
|
5331
|
+
c = setTimeout(T, b(R));
|
|
5332
5332
|
}
|
|
5333
|
-
function w(
|
|
5334
|
-
return c = void 0, g && u ?
|
|
5333
|
+
function w(R) {
|
|
5334
|
+
return c = void 0, g && u ? p(R) : (u = d = void 0, l);
|
|
5335
5335
|
}
|
|
5336
5336
|
function x() {
|
|
5337
|
-
c !== void 0 && clearTimeout(c), a = 0, u =
|
|
5337
|
+
c !== void 0 && clearTimeout(c), a = 0, u = h = d = c = void 0;
|
|
5338
5338
|
}
|
|
5339
5339
|
function O() {
|
|
5340
5340
|
return c === void 0 ? l : w(now());
|
|
5341
5341
|
}
|
|
5342
|
-
function
|
|
5343
|
-
var
|
|
5344
|
-
if (u = arguments,
|
|
5342
|
+
function E() {
|
|
5343
|
+
var R = now(), S = _(R);
|
|
5344
|
+
if (u = arguments, d = this, h = R, S) {
|
|
5345
5345
|
if (c === void 0)
|
|
5346
|
-
return v(
|
|
5346
|
+
return v(h);
|
|
5347
5347
|
if (y)
|
|
5348
|
-
return clearTimeout(c), c = setTimeout(T, i), h
|
|
5348
|
+
return clearTimeout(c), c = setTimeout(T, i), p(h);
|
|
5349
5349
|
}
|
|
5350
5350
|
return c === void 0 && (c = setTimeout(T, i)), l;
|
|
5351
5351
|
}
|
|
5352
|
-
return
|
|
5352
|
+
return E.cancel = x, E.flush = O, E;
|
|
5353
5353
|
}
|
|
5354
5354
|
var objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, defaults = baseRest(function(s, i) {
|
|
5355
5355
|
s = Object(s);
|
|
5356
|
-
var r = -1, u = i.length,
|
|
5357
|
-
for (
|
|
5358
|
-
for (var o = i[r], l = keysIn(o), c = -1,
|
|
5359
|
-
var a = l[c],
|
|
5360
|
-
(
|
|
5356
|
+
var r = -1, u = i.length, d = u > 2 ? i[2] : void 0;
|
|
5357
|
+
for (d && isIterateeCall(i[0], i[1], d) && (u = 1); ++r < u; )
|
|
5358
|
+
for (var o = i[r], l = keysIn(o), c = -1, h = l.length; ++c < h; ) {
|
|
5359
|
+
var a = l[c], m = s[a];
|
|
5360
|
+
(m === void 0 || eq(m, objectProto[a]) && !hasOwnProperty.call(s, a)) && (s[a] = o[a]);
|
|
5361
5361
|
}
|
|
5362
5362
|
return s;
|
|
5363
5363
|
});
|
|
@@ -5371,38 +5371,38 @@ function requireEventemitter3() {
|
|
|
5371
5371
|
function u() {
|
|
5372
5372
|
}
|
|
5373
5373
|
Object.create && (u.prototype = /* @__PURE__ */ Object.create(null), new u().__proto__ || (r = !1));
|
|
5374
|
-
function
|
|
5375
|
-
this.fn =
|
|
5374
|
+
function d(h, a, m) {
|
|
5375
|
+
this.fn = h, this.context = a, this.once = m || !1;
|
|
5376
5376
|
}
|
|
5377
|
-
function o(
|
|
5378
|
-
if (typeof
|
|
5377
|
+
function o(h, a, m, y, g) {
|
|
5378
|
+
if (typeof m != "function")
|
|
5379
5379
|
throw new TypeError("The listener must be a function");
|
|
5380
|
-
var
|
|
5381
|
-
return
|
|
5380
|
+
var p = new d(m, y || h, g), v = r ? r + a : a;
|
|
5381
|
+
return h._events[v] ? h._events[v].fn ? h._events[v] = [h._events[v], p] : h._events[v].push(p) : (h._events[v] = p, h._eventsCount++), h;
|
|
5382
5382
|
}
|
|
5383
|
-
function l(
|
|
5384
|
-
--
|
|
5383
|
+
function l(h, a) {
|
|
5384
|
+
--h._eventsCount === 0 ? h._events = new u() : delete h._events[a];
|
|
5385
5385
|
}
|
|
5386
5386
|
function c() {
|
|
5387
5387
|
this._events = new u(), this._eventsCount = 0;
|
|
5388
5388
|
}
|
|
5389
5389
|
c.prototype.eventNames = function() {
|
|
5390
|
-
var a = [],
|
|
5390
|
+
var a = [], m, y;
|
|
5391
5391
|
if (this._eventsCount === 0) return a;
|
|
5392
|
-
for (y in
|
|
5393
|
-
i.call(
|
|
5394
|
-
return Object.getOwnPropertySymbols ? a.concat(Object.getOwnPropertySymbols(
|
|
5392
|
+
for (y in m = this._events)
|
|
5393
|
+
i.call(m, y) && a.push(r ? y.slice(1) : y);
|
|
5394
|
+
return Object.getOwnPropertySymbols ? a.concat(Object.getOwnPropertySymbols(m)) : a;
|
|
5395
5395
|
}, c.prototype.listeners = function(a) {
|
|
5396
|
-
var
|
|
5396
|
+
var m = r ? r + a : a, y = this._events[m];
|
|
5397
5397
|
if (!y) return [];
|
|
5398
5398
|
if (y.fn) return [y.fn];
|
|
5399
|
-
for (var g = 0,
|
|
5399
|
+
for (var g = 0, p = y.length, v = new Array(p); g < p; g++)
|
|
5400
5400
|
v[g] = y[g].fn;
|
|
5401
5401
|
return v;
|
|
5402
5402
|
}, c.prototype.listenerCount = function(a) {
|
|
5403
|
-
var
|
|
5403
|
+
var m = r ? r + a : a, y = this._events[m];
|
|
5404
5404
|
return y ? y.fn ? 1 : y.length : 0;
|
|
5405
|
-
}, c.prototype.emit = function(a,
|
|
5405
|
+
}, c.prototype.emit = function(a, m, y, g, p, v) {
|
|
5406
5406
|
var b = r ? r + a : a;
|
|
5407
5407
|
if (!this._events[b]) return !1;
|
|
5408
5408
|
var _ = this._events[b], T = arguments.length, w, x;
|
|
@@ -5411,71 +5411,71 @@ function requireEventemitter3() {
|
|
|
5411
5411
|
case 1:
|
|
5412
5412
|
return _.fn.call(_.context), !0;
|
|
5413
5413
|
case 2:
|
|
5414
|
-
return _.fn.call(_.context,
|
|
5414
|
+
return _.fn.call(_.context, m), !0;
|
|
5415
5415
|
case 3:
|
|
5416
|
-
return _.fn.call(_.context,
|
|
5416
|
+
return _.fn.call(_.context, m, y), !0;
|
|
5417
5417
|
case 4:
|
|
5418
|
-
return _.fn.call(_.context,
|
|
5418
|
+
return _.fn.call(_.context, m, y, g), !0;
|
|
5419
5419
|
case 5:
|
|
5420
|
-
return _.fn.call(_.context,
|
|
5420
|
+
return _.fn.call(_.context, m, y, g, p), !0;
|
|
5421
5421
|
case 6:
|
|
5422
|
-
return _.fn.call(_.context,
|
|
5422
|
+
return _.fn.call(_.context, m, y, g, p, v), !0;
|
|
5423
5423
|
}
|
|
5424
5424
|
for (x = 1, w = new Array(T - 1); x < T; x++)
|
|
5425
5425
|
w[x - 1] = arguments[x];
|
|
5426
5426
|
_.fn.apply(_.context, w);
|
|
5427
5427
|
} else {
|
|
5428
|
-
var O = _.length,
|
|
5428
|
+
var O = _.length, E;
|
|
5429
5429
|
for (x = 0; x < O; x++)
|
|
5430
5430
|
switch (_[x].once && this.removeListener(a, _[x].fn, void 0, !0), T) {
|
|
5431
5431
|
case 1:
|
|
5432
5432
|
_[x].fn.call(_[x].context);
|
|
5433
5433
|
break;
|
|
5434
5434
|
case 2:
|
|
5435
|
-
_[x].fn.call(_[x].context,
|
|
5435
|
+
_[x].fn.call(_[x].context, m);
|
|
5436
5436
|
break;
|
|
5437
5437
|
case 3:
|
|
5438
|
-
_[x].fn.call(_[x].context,
|
|
5438
|
+
_[x].fn.call(_[x].context, m, y);
|
|
5439
5439
|
break;
|
|
5440
5440
|
case 4:
|
|
5441
|
-
_[x].fn.call(_[x].context,
|
|
5441
|
+
_[x].fn.call(_[x].context, m, y, g);
|
|
5442
5442
|
break;
|
|
5443
5443
|
default:
|
|
5444
|
-
if (!w) for (
|
|
5445
|
-
w[
|
|
5444
|
+
if (!w) for (E = 1, w = new Array(T - 1); E < T; E++)
|
|
5445
|
+
w[E - 1] = arguments[E];
|
|
5446
5446
|
_[x].fn.apply(_[x].context, w);
|
|
5447
5447
|
}
|
|
5448
5448
|
}
|
|
5449
5449
|
return !0;
|
|
5450
|
-
}, c.prototype.on = function(a,
|
|
5451
|
-
return o(this, a,
|
|
5452
|
-
}, c.prototype.once = function(a,
|
|
5453
|
-
return o(this, a,
|
|
5454
|
-
}, c.prototype.removeListener = function(a,
|
|
5455
|
-
var
|
|
5456
|
-
if (!this._events[
|
|
5457
|
-
if (!
|
|
5458
|
-
return l(this,
|
|
5459
|
-
var v = this._events[
|
|
5450
|
+
}, c.prototype.on = function(a, m, y) {
|
|
5451
|
+
return o(this, a, m, y, !1);
|
|
5452
|
+
}, c.prototype.once = function(a, m, y) {
|
|
5453
|
+
return o(this, a, m, y, !0);
|
|
5454
|
+
}, c.prototype.removeListener = function(a, m, y, g) {
|
|
5455
|
+
var p = r ? r + a : a;
|
|
5456
|
+
if (!this._events[p]) return this;
|
|
5457
|
+
if (!m)
|
|
5458
|
+
return l(this, p), this;
|
|
5459
|
+
var v = this._events[p];
|
|
5460
5460
|
if (v.fn)
|
|
5461
|
-
v.fn ===
|
|
5461
|
+
v.fn === m && (!g || v.once) && (!y || v.context === y) && l(this, p);
|
|
5462
5462
|
else {
|
|
5463
5463
|
for (var b = 0, _ = [], T = v.length; b < T; b++)
|
|
5464
|
-
(v[b].fn !==
|
|
5465
|
-
_.length ? this._events[
|
|
5464
|
+
(v[b].fn !== m || g && !v[b].once || y && v[b].context !== y) && _.push(v[b]);
|
|
5465
|
+
_.length ? this._events[p] = _.length === 1 ? _[0] : _ : l(this, p);
|
|
5466
5466
|
}
|
|
5467
5467
|
return this;
|
|
5468
5468
|
}, c.prototype.removeAllListeners = function(a) {
|
|
5469
|
-
var
|
|
5470
|
-
return a ? (
|
|
5469
|
+
var m;
|
|
5470
|
+
return a ? (m = r ? r + a : a, this._events[m] && l(this, m)) : (this._events = new u(), this._eventsCount = 0), this;
|
|
5471
5471
|
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = r, c.EventEmitter = c, s.exports = c;
|
|
5472
5472
|
}(eventemitter3)), eventemitter3.exports;
|
|
5473
5473
|
}
|
|
5474
5474
|
var eventemitter3Exports = requireEventemitter3();
|
|
5475
5475
|
const EventEmitter = /* @__PURE__ */ getDefaultExportFromCjs(eventemitter3Exports);
|
|
5476
5476
|
class WmsLayer {
|
|
5477
|
-
constructor(i, r, u,
|
|
5478
|
-
this.ctrl = i, this.key = r, this.layer = u, this.zIndex =
|
|
5477
|
+
constructor(i, r, u, d = 1 / 0) {
|
|
5478
|
+
this.ctrl = i, this.key = r, this.layer = u, this.zIndex = d, this.ctrl.registerLayer(this);
|
|
5479
5479
|
}
|
|
5480
5480
|
show(i) {
|
|
5481
5481
|
this.ctrl.showLayer(i, this.key);
|
|
@@ -5524,18 +5524,18 @@ class WmsLayerController extends EventEmitter {
|
|
|
5524
5524
|
showLayer(r, u) {
|
|
5525
5525
|
if (!this.layerMap.has(u))
|
|
5526
5526
|
throw new Error(`Layer with key 【${u}】 is not registered`);
|
|
5527
|
-
this.showLayers.push(u), this.showLayers.sort((
|
|
5528
|
-
const l = this.layerMap.get(
|
|
5527
|
+
this.showLayers.push(u), this.showLayers.sort((d, o) => {
|
|
5528
|
+
const l = this.layerMap.get(d).zIndex, c = this.layerMap.get(o).zIndex;
|
|
5529
5529
|
return l - c;
|
|
5530
5530
|
}), this.update(r);
|
|
5531
5531
|
}
|
|
5532
5532
|
hideLayer(r, u) {
|
|
5533
|
-
const
|
|
5534
|
-
|
|
5533
|
+
const d = this.showLayers.indexOf(u);
|
|
5534
|
+
d !== -1 && (this.showLayers.splice(d, 1), this.update(r));
|
|
5535
5535
|
}
|
|
5536
5536
|
hookClickEvent(r) {
|
|
5537
5537
|
this.handler = new ScreenSpaceEventHandler(r.scene.canvas), this.handler.setInputAction(async (u) => {
|
|
5538
|
-
const
|
|
5538
|
+
const d = r.scene, o = d.camera.getPickRay(u.position), l = await d.imageryLayers.pickImageryLayerFeatures(o, r.scene);
|
|
5539
5539
|
this.emit("click", l);
|
|
5540
5540
|
}, ScreenSpaceEventType.LEFT_CLICK);
|
|
5541
5541
|
}
|
|
@@ -5581,17 +5581,17 @@ const createShipIconUrl = memoize(
|
|
|
5581
5581
|
(s, i) => `${s},${i}`
|
|
5582
5582
|
), createShipIconV2 = memoize(
|
|
5583
5583
|
(s) => {
|
|
5584
|
-
const i = s.designBeam, r = s.designLength, u = s.aisFromBow != null && s.aisFromCenter != null ? { x: s.aisFromCenter, y: s.designLength - s.aisFromBow } : { x: 0, y: r / 2 },
|
|
5585
|
-
C${
|
|
5586
|
-
V${-
|
|
5587
|
-
C${i / 2 + u.x} ${u.y -
|
|
5588
|
-
C${-2 + u.x} ${-r + u.y} ${-i / 2 + u.x} ${u.y -
|
|
5584
|
+
const i = s.designBeam, r = s.designLength, u = s.aisFromBow != null && s.aisFromCenter != null ? { x: s.aisFromCenter, y: s.designLength - s.aisFromBow } : { x: 0, y: r / 2 }, d = `${i / 2 + u.x} ${u.y}`, o = `${-i / 2 + u.x} ${u.y}`, l = `${u.x} ${u.y}`, c = `${u.x} ${-r + u.y}`, h = Math.floor(r * 4 / 5), a = Math.floor((r - h) * 2 / 3), m = `M${l}
|
|
5585
|
+
C${d} ${d} ${i / 2 + u.x} ${u.y - 3}
|
|
5586
|
+
V${-h + u.y}
|
|
5587
|
+
C${i / 2 + u.x} ${u.y - h - a} ${2 + u.x} ${-r + u.y} ${c}
|
|
5588
|
+
C${-2 + u.x} ${-r + u.y} ${-i / 2 + u.x} ${u.y - h - a} ${-i / 2 + u.x} ${-h + u.y}
|
|
5589
5589
|
V${-3 + u.y}
|
|
5590
5590
|
C${o} ${o} ${l}`, y = Math.max(Math.abs(i / 2 + u.x), Math.abs(-i / 2 + u.x)), g = Math.max(
|
|
5591
5591
|
Math.abs(-r + u.y + (s.isMoving ? -5 : 0)),
|
|
5592
5592
|
Math.abs(u.y + (s.isMoving ? 146 / 124 * i : 0))
|
|
5593
|
-
),
|
|
5594
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${
|
|
5593
|
+
), p = [-y * 1.2, -g, 2 * y * 1.2, 2 * g], v = { x: 2 * 1.2 * y / i, y: 2 * g / r }, b = `<?xml version="1.0" encoding="UTF-8"?>
|
|
5594
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${p.join(" ")}">
|
|
5595
5595
|
<defs>
|
|
5596
5596
|
<style>
|
|
5597
5597
|
#svg_1,
|
|
@@ -5617,11 +5617,11 @@ const createShipIconUrl = memoize(
|
|
|
5617
5617
|
</defs>
|
|
5618
5618
|
<g>
|
|
5619
5619
|
<path id="svg_1" data-name="svg 1" class="cls-2" d="M${c}v-5"/>
|
|
5620
|
-
<path id="svg_4" data-name="svg 4" class="cls-1" d="${
|
|
5620
|
+
<path id="svg_4" data-name="svg 4" class="cls-1" d="${m}"/>
|
|
5621
5621
|
</g>
|
|
5622
5622
|
<image id="img_1" width="${i}" height="${146 / 124 * i}" transform="translate(${-i / 2 + u.x} ${u.y})" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAACSCAMAAACwjl5+AAAAq1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Nr6iZAAAAOXRSTlMABRshFgkSZg5qJmFdWlEqOXBFPYVJQYB1VXtNLpc1mzKguZCKtJONxc69yaukwa/SqN/k1trs6fBhRQqRAAAVcElEQVR42rSX3ZKaQBCFgxoIICh/ggjiIMPPMAOy6yZ5/yfLaTBVSa5istu1Vepe+M3p7jkHPz1Vmqav99umYLxsh7bvO6oeb8ZR1XUS7TaftU8fVdqX9cWpGBt5WeJvKbwbOJvyujEPlv5RcLBXZyesc1lyMSk5qWmS0zQxNQrGVF2Fpv9hdOg+2HFzZZwPQjFWFAxV4FUNJd5VcWr4u4+hgx0YcVgVchRtOSmW50wpVoA+lS0vWB6mifkxdE2H7jSOazaVfYtJo91yHKVSUmLq/Yihp2Zi09a9N1rb7Hxi07oN/dAOgnMwB4F9E3jtW1Y1oWea2yhbve/Oa583WWR4SRLnGHAPVkd3bblpA70XvcjDKjVs24ku70rX9NU5OgIeV9ect0L03a3rbve3l5e3+6273Vp0opVVmnrG1jkFl9UX7R3HfY5c2zCTOLxKNHzobzdCv3779voK/ls3tOi+ihPPcI5uFGRrXdPeZ8t16+y7zpbgVcHFWLb9fUZ/RX0D/e2txew5zxPTcNzIP+xBR+vfgb2x9oeTe3Rs04sLXuKmDWg5sb+jFnqH9ZejrL3t1o0Oh+CcrWG1/4v//GW1OwfR6XRybC+5SrBLPnTd/YXYC/3l7XYfJB+VVA3aHgX7/fli/TddA3ud7Q++758cI6kUVwo3rOu7t9/ht46rETe/iA3Az5cs261X+hfQ/4Otb9a7bB/sA9+1zbCYGIOx4FID/voV9AWOje8GxSaY3jW1XYzcsnbWf9E1DfNeW1l2yc6B75hxDjNVk6Q4Rdtp3x4zv3dt23Oy+bquUvsUZNYatdro/9p5DT3XV+vdzoL2w8mAvxQ5myYOV8Nd+3Xbcc/FMMi8YHVThcnWP6PpKEj/RzqxN6sVFFhZcLLTpr5emWLY9bKEdOz7y+sr7jnYHdlsK1id502cpiboFmRvdP0f6doM36yAt86nbRI2VZNDOhKNC4E2d2RwZHFd3w/0SNGWeQh/T5LEcP3LekZ/Ibj2D2zAddIOtu2lYVhBe46m0zMM3LSH+Du5a48dIIsR7djEYZh6nrk9+hnoQKOI/jx7hsNiItwyBFrYNLUSw5xipRiIjuoQK2I+Ec7FwjROPdNAugSXtb6wn4VrgC/0DXTD29BL0l4AywXAC7z7CUemcVGWguepl3j2duu4fgDtRNeonkE/lGPbd/uDC1f3AE/DRopyxLy7dhF+R6Ht6Hvfl0LAfiaKdANsN6KVJ7r2DF2b8UQn9vlwOm4Nw/C8JG0Y59O86X1PaAQKbJ0cBp96gYONYxFTpB+jU3QILkR/Dg70DH9Yq++6jjNrjwspmSxFf7+haNdfUbTvd3y80aOVUqpOwJ7DBelikckR+pmpL2xY6yXwoyiCr9tmWk9TAe0DdRua6ZajwId8/KsT6EtRFNdk60L3/nwm+Op5kyO2DmslX/UPCJWtnTQKXy1H3kPmA/2VCnyoB73lUsLd89A8Rj5kZxdKF1y4ZzeOdK8g/LzfI9NcxGmY44uVlAIr/gb0w9oX+uvcezFNKr9em9RwoTzbWZa1pnQh+rPuBjgOf4H4E1KlZvm1UArCO8DB/hmpRCc4nuQ4Q9erKgQdcEITXMfGPwfXdfJVJCP2PXI8/FBpmpwxJfr+Tzgpn1O1E6ou6iqGzxgu7fqKavOUv2soEo4Cn/bdTMMqrBAbBcdzKsFfCL7Uo+1ksy2vq2sTpgmM5rTPMPCNjlou+xMTJ2PdIFHpott4ao3jqq7rSQyI0+7nri/o5b6BDZdVOCS5u2c6PugbkDHzv/fYh79QAZ4FEaVKnMLZYTJi5PQksaw7isiERra1A5KN5yEOCrZpH/39brUE27PwxdjBPm3JW6EdMx/LceJwmY7w4FMRmVynF/T8yuU1TuPEtJEt7gGp/uj5X8G1GQ42iYe7BtHR9lApsrKZypFN40hhPofKfanbPO4WB5OTlKpKEsC3DmJ1pgP+t/SHsxKc2DB22zChHXTGR8YmGCzEi2E+AaoHeBAlShZMqUnm1HWyWPr1cAH9eTjYtGwzfKbHteSqUIyNUDhyjgBdCmDORym5hAnR6a7JD8bMdrtJKIii/lBZCMQQsHxEQggUXJqsmPd/OfeZIU2rxeSk1ja6upnLvXPm0ABfqxj1iS6ct0fpOIDQ3uC+cMIJKkkSAa/705HWDv4Zgio8nl1wL6eTZupubJlgu3bA0ZWaNsDlbDP9sboRa/5FprJarWzh04GiTecj5tHBv8wyckt0Pp+apuPrZizCpAKeZdkaczH6h4fgXrvYu6cNtszCK6Q1/FDq5kEU5tEiqnfB5lu4Z25L02l2n4qAZd+4s321Lf8Q29CwMZX1EzJHS4u+bUbVrsPG0r6Urk++JK2yzImHQz67RxW2uvtObCK6PEaX689uChxhKnEclJrZR4iXw0FPYcD5TT+6Lnrrogh5YlXGKc8Lmbo5G97mvnofjjyoEFN2+/06+8YEJ1uxof30rCcxR5i+3w/88b2uC7FHgzL0CWspA2ZImQuazQX8vdLd0MzPFJP0NKTOEa29Of903O2g3Q4bH37YJ1lLqscE26ed1hx9fIiuG+4hCfr3vTW4moYJfOpPz4fzQVg1GboM+qVPhCXe8As7n/qcVae5z3TB5VHe6e7nFODQZeWbKgiZmens0Nvz8/kMG5j3N17+SU2OrPgsHRscsKBwJuiKvAoctKc2dN/QoIMXOzJXofIi7y/MaKwtGEO/Fnj4uvvsx77mctMgthFadNj3fdU9xa2cLbfH0WgvKaWzg4YO02BT/RRb6N8vEl3vHrzdtTkXnOItMa3GogPsx+HQ1eBWZipBWgrfXI5dd4MjB+tjLv2n0HooW4fKa9WqqlZbp4NG9+GIdZeTJ8AjZRU04BgaXg/XG/5afte56RddYUfpZJwoxluY4DP56mehpUX0Sz6kyexlKlGs2nHIMqeB9vRXAot2OnQTWORs3tfD4I5e2BdYi+DfkMxFLc7pd3KKtjv50DwliWNb+GKkb41tQ3tFhne+yw4b7x+s74+0pDqIY+D4Grlprdj0EPyTxaS1DI1VS7TwYdE3Yz70Y4950Nqcj37wQkY+2DlracPjwMEsbZzYQJa1Qb9/1JBn00yGZo4WRUE5jH0OPJ86NhSbTjrc5GD907EbcuoGXoTxSpFNDwTdV4Hfvedycj32Yxag+iROopLZcSjUZ0Z8FS/Fy9TdX8Q35uqytImrHApUh8lWeRGH2O08tIn+/7Rwc1MuQDc9LAaVYpN7O/Zj00rdG7USzkdaymu1pLrEWjhoegpriVHWptrvZ1NzU6q3QaIWWD5VjCOeMUym/o3sHYpmbyivQC/pM+7p+68I+J3cdM2mhEMCosNDSysKAuVgMYwA4Xr7NwLLIjFIhKWuFWOLKh00C4xyN4cvsy0e4qWyU1Y9DtRcVXtZ5uPEWtLr0/cFTNR8wFVqWYsezkBnt10T4zLd46HsTNJ93yZ0GO6eF0XrKOs0Igi9VRDNSoMIC8yhp6lKp8tpiF07nI69bOpeuKwcsfRKxrBT8Ah2M9T6gWmUzIrn11UBIQnzZ1PUqXw45KTgLZudx9WP17z6LtvhEnCbI7RyobFr20o1lxJcyf7p9k0V63+XrHs/lGYIQVUB/6aJYrb0pbB8tXLJn0Kps0bmaUSGOfSnpVIYLf8vxRJeZvCpz21vBDENmoXPCE0sOVpwNhU+26k2fEZ/MQI/hDLyhgOs81PUeCUBSh3fdf1a/qerq6m8n4pU73LWVnJVjI3KYQuOFuCiW2uvYMeWF9IQX2HRgdfsPE1ntre1tP7y/c/bhQ65OsGAs6BI1kJgtNo/O1taiofQxd4Cjz2lhVE5NSPdhQPNXiql+l+VqJig85+g55hqECixbdXib8a2AP9kcNnpHBCrxCeZnACk85tPjOSu/G/5u712ZT5IRaitANyU3YwN9hKcNbfWVjEECR5YZJhyFT6QBwaX+qu1VGRfDaa+ha7Dhhtg6RzzrRz9m8VV6P+p3C1NdmrTl+VTevsweW35yDQziwTxSjR9F84yFaIP9GEs3eJilsHPdqSXJU8XXAFRbRUj3/Jh+z1gAwlMQRPGJayD21cS39SPXUN7LVQ4+zBWDbL0eaKQsS2uO3ZqVi5t9LAZdjGbWk3h4+glvwOX7LoovRS9AK4Jdk7K/PHf8y1VDpuB+WnDK3vaasPTqyFD1yZutOg39nt0ZdlmoCH671pEF3wvo8TVvyxMFNZc9Zh5nZk2Gh9lFMU8GwycdYOP/6BFN75fXK8l97wWRBw27rdccjmp+xwhP9lpkbThV2KXYEGXHDf96OkP4+a6szQQRdEfairpFBFDTcUQEo2+/xu61tkTS6Fetn6lBXTN5cy5zCgufh34p27bOkyfK+fohnTYRRdOoORnN5kSnuPDu2ewd+F0PHUas3cwh3QFaW/iX5T3f7oGf8S1u/1bS/2adWa43E1nksSYR7iXILx8Oz5TvkXDt2/uqgLvGVRfXdt7/GDV0t8/SweOzbZjdZ1Og98r1GWviYTnC6x064Wh4gphlZVbS311MvEruefTfqd51io/MGce7i0Ty43NwE02swuvoQHu9r4xzSxKk3XpWKnyF5fx70uupknnGXIDovsDTB/Fg5GFbu8kFLKFSweejUc1Ch/aR3jmwq67L3+V9uE+rSncZD6Ac79a+rgVmX6/34VDF89yc8InR4zGwx7oC4mR+SE56d9k3mFJ7fokj2kDxk5QNa5BF76TTwg3jXHa8XE0Vq+80HTYHCAziobWwQYMJV72dNCrQTfm4lzbYFybZ+GVzqwx/TWTEO6g42DIAJbRcWPQ+w4LFjC2B1XQRf2pz9OItRy0UwZ+qjp5xmUZ1xJUw94NqJ5fnum5g8WkSXSDhdCK1eqqEW2rFxT156qph5EX6M4PDmYxrlGpWq6Sxa5BVXzYqtipEYksFGq612nC0mGP5CR4PFODrtzNmydvptH9CMfMiTpelzrgw3GsYe2159lxxdJPcA0sTvxybBQNOqrGkuFQfEY4/vygCgS+pWZ1aY1RW4AP0JfL5ZjTRU4Hjeid/oez01P9ZSfhDuOg/bbRFdPG6xxil6X3eo9swHmxQLPewPzoOqMoHK95A25k2YVXYe755afbjQYw824/1nnJOHnfzrIDN/ggr6pe0v3raNcZeMWsm8CdrJEJqS9hTfQa1O6nG9+52QXymUqchwoOlBDLHPiKW3u+ws9tmC7O/WAG6T9Qo+eUyXiv/UJZth0HDtrA4gQycybpYxm5Zjyj4GuyHezcBR34PPF95szI4MpcznzugL/Bf+3Dy9RpWgJv4Ow/Rg2f4/XcNUd1t3lUl+OAU7W1iPVpiV7wFIE7cDsOXDk8NfNnklc00OXFblDyYQZbnTdPSTwtGMmZq+u2wmopcJw3l6QTzwVqon0F9TvsY1UN5iKyMbulexYux67c5Fb5zgR8gL60jBYnXCfqVPv8VhnXNvDs8Ecaxt2lBsyqwSboMPRX8peuCXHx2qWHMxz1pi6Dsz/Htb5Jp1Ui+lNEjarnfR8O+Ii1mRfQC913aK3x8ygr9PUTF8nIiLvpfcUiWWyOu31Ga5EeduC2q8MxOGyHIbQHzbKUXjgFklj3pSqLvagW1VdqQ2N0EBoR1YVQeRSAIu/Aiaj8hq2n0XuSQ2Yoa7UfBKU2/6P89OD14E4UYKaIBK68AfRYOnqFI+H0G7hrl8gK/GqIMnonLVKHVZv7UjmlwUcHXrs5n+534XFvgGVv4CoWD5uVhuYkQNNQkMG9b8l/1WA0KfjHFAzXrLQ4rxQsXU/RPLtwZO7GgBv2XoeZmVrhDP4/6H6crhvVTCQqrpzWgsWgFj1vdVfZ4FYpv4Abpa9T7bMVX1/7r55rm1DLMprmNp/jY8D3roe+iWmyM+NGn9g70dk0TBturfr0b3h9rax+qHNsTDeuHXxmPfS9Q0zheliC/2ypOrlWm3xNqfTXGY/JuZuDCk4vgJfnNK5I3+m51vbbuwNH87G7DfiY23/J2Y4TEs6ZIqpSDTzqA/9ywPAWquh4d3S6LCg+02nP9PtrR/UB8r5Ni9k31wv/WgYJx3/tnen+HvVEFo9xNbrKoY+JFgxjuoPGyJt4u/UdRTvbom9G2romVOMNHeVUdSeqgbeBTn1K1asxNIctrQYBTQ/aPijVmqk3fxj4rG9zsg0rMLi+Bhbhyi+kWCWymUVXWgw8KXuPpj4oHxXEh8dJeLLAZMwOaHZfs/e8F1j8gi/Q4bNBUhbfvTy9iDIUzCaKLlu53yrVxcoaT20eOPQ/wUHzacFJZJOemstSrhfLla/ykmRO5b3+cbXG/AEnbfYWcws8brQv9RUOVDKqrhvbNHd3aPA6RuRiPeqm1Obdas+cHahEszgXu2aPxb97hqvesFoT+kP4LlHgs6i7P6voU3R/VL6WhBW8fx7vVlMuXMnewHuIDzzeBrye1mTW7n94kh/428uTgJaZSdezKkcdePQCh42EO+mhO10eeRiMuckRVcnHVXDymg9sr/+pwcn7qmfdepdNWFsbI3w1d3ukv/v6qzoz2lEQBqJoVjQx/P8Hb6/nwoUyK9Xwskd3LYVynNrOxKgoxM3Q6MjZRrM6n5NgvIsjz2oP3u+CMkSuXcffebSnDvQEOtOh0iw5drqT1Yfks9yT4kdgpAmHTkwzw1zLWq/GPyVvWszAO9nMum6hxZSJQ32gXV3hkKkTjTaYzOrI//hJUXKGU+DyoUnVcS+OGe2ZW0PXWO906Y94rXMdY5YABCbu4YZtPqSlPsmx64Xvplz1LO3rrHOjfG/jDq5JGBs0OeCQBtF71SyhNyxf8kwdeOQa4zlDLjC+gcGWK2Ts28jL0JPhCzn2sO/ozmveHLrlOktNQx573Mrw+pMcptd48guaPelIl985n7aOWTGKGmq58jvR42HmeO8fwQBG61bMeuSxJ8NC5I4g8sm4lYamx829vb04/eR33KOc/L6VW0YES0Rn4JY1C/3FstgqeZCcVe3BLmXB5U11GlLXwsxYy5c9Hio3S57gb1DVz/lAd83s2J0ipEaOC3lZW4TlhG8Q5B2khLvZIa/+2GbrLkNdy7Ez89SIL8C9+7yRk0137n7DEXrsPE2a4XD+FjcLXchdE3sv75lug50pZnaf2rPbBfIvwA2jcoh9iZ//PGjxKPu4HHe3yc7cWfPU9+9hlRfZpSZyIH4gkGGezDecu9kGsSt+eGeoScy4R+Ry93v+oWfNozrDEIaiHXRD7DXkDONmzdY7oGbuAxPH/wEwphW49aD/MlAP40uv1I7bCf2a+KP+wF2p1f3pdBHHJfycnf43/AJwK37vPZnSygAAAABJRU5ErkJggg=="/>
|
|
5623
5623
|
</svg>`;
|
|
5624
|
-
return { url: URL.createObjectURL(new Blob([b], { type: "image/svg+xml" })), viewBox:
|
|
5624
|
+
return { url: URL.createObjectURL(new Blob([b], { type: "image/svg+xml" })), viewBox: p, scale: v };
|
|
5625
5625
|
},
|
|
5626
5626
|
(s) => `${s.color},${s.isMoving},${s.designBeam ?? 0},${s.designLength ?? 0},${s.aisFromBow ?? 0},${s.aisFromCenter ?? 0}`
|
|
5627
5627
|
), shipTypeColorMap = /* @__PURE__ */ new Map([
|
|
@@ -5673,144 +5673,147 @@ const createShipIconUrl = memoize(
|
|
|
5673
5673
|
// 油船
|
|
5674
5674
|
]);
|
|
5675
5675
|
function createAlphaSampled(s) {
|
|
5676
|
-
const i = new Cesium.SampledProperty(Cesium.Color), r = (s == null ? void 0 : s.startTime) ?? Cesium.JulianDate.now(), u = Cesium.JulianDate.addMinutes(r, 1, new Cesium.JulianDate()),
|
|
5677
|
-
return i.addSample(r, l.withAlpha(1)), i.addSample(u, l.withAlpha(1)), i.addSample(
|
|
5676
|
+
const i = new Cesium.SampledProperty(Cesium.Color), r = (s == null ? void 0 : s.startTime) ?? Cesium.JulianDate.now(), u = Cesium.JulianDate.addMinutes(r, 1, new Cesium.JulianDate()), d = Cesium.JulianDate.addMinutes(r, 5, new Cesium.JulianDate()), o = Cesium.JulianDate.fromIso8601("2100-01-01T00:00:00Z"), l = (s == null ? void 0 : s.color) ?? Cesium.Color.WHITE;
|
|
5677
|
+
return i.addSample(r, l.withAlpha(1)), i.addSample(u, l.withAlpha(1)), i.addSample(d, l.withAlpha(0.2)), i.addSample(o, l.withAlpha(0.1)), i;
|
|
5678
5678
|
}
|
|
5679
5679
|
function getHideAfterFiveMinutesProperty(s) {
|
|
5680
5680
|
const i = s ?? Cesium.JulianDate.now(), r = Cesium.JulianDate.addMinutes(i, 5, new Cesium.JulianDate());
|
|
5681
5681
|
return new Cesium.CallbackProperty((u) => u ? Cesium.JulianDate.lessThan(u, r) : !0, !1);
|
|
5682
5682
|
}
|
|
5683
|
-
class ShipLayer {
|
|
5684
|
-
constructor(
|
|
5683
|
+
class ShipLayer extends EventEmitter {
|
|
5684
|
+
constructor(r, u) {
|
|
5685
|
+
super();
|
|
5685
5686
|
z(this, "db");
|
|
5686
5687
|
z(this, "isMounted", !1);
|
|
5687
5688
|
z(this, "_viewer", null);
|
|
5688
5689
|
z(this, "entityMap", /* @__PURE__ */ new Map());
|
|
5689
5690
|
z(this, "IS_MOVING_THRESHOLD", 1);
|
|
5690
5691
|
z(this, "shadowEntityMap", /* @__PURE__ */ new WeakMap());
|
|
5691
|
-
|
|
5692
|
+
/**显隐entity,回调返回显示隐藏的状态,不传Fn时默认显示所有 */
|
|
5693
|
+
z(this, "hookFilterEntityFn");
|
|
5694
|
+
this.key = r, this.zIndex = u, this.db = new Cesium.CustomDataSource(r);
|
|
5692
5695
|
}
|
|
5693
|
-
show(
|
|
5694
|
-
this.isMounted || (
|
|
5696
|
+
show(r) {
|
|
5697
|
+
this.isMounted || (r.dataSources.add(this.db), this._viewer = r, this.isMounted = !0), this.db.show = !0;
|
|
5695
5698
|
}
|
|
5696
5699
|
hide() {
|
|
5697
5700
|
this.isMounted && (this.db.show = !1);
|
|
5698
5701
|
}
|
|
5699
5702
|
/**生成entity, geojson的id优先和mmsi保持一致,没有mmsi的情况下,使用nanoid生成 */
|
|
5700
|
-
render(
|
|
5701
|
-
|
|
5702
|
-
this.renderFeature(
|
|
5703
|
+
render(r) {
|
|
5704
|
+
r.features.forEach((u) => {
|
|
5705
|
+
this.renderFeature(u);
|
|
5703
5706
|
});
|
|
5704
5707
|
}
|
|
5705
5708
|
/**渲染feature */
|
|
5706
|
-
renderFeature(
|
|
5707
|
-
var
|
|
5708
|
-
const
|
|
5709
|
-
|
|
5710
|
-
const
|
|
5711
|
-
|
|
5712
|
-
|
|
5709
|
+
renderFeature(r) {
|
|
5710
|
+
var h, a;
|
|
5711
|
+
const u = String(r.id), d = new Cesium.SampledPositionProperty();
|
|
5712
|
+
d.backwardExtrapolationType = Cesium.ExtrapolationType.HOLD, d.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD;
|
|
5713
|
+
const o = Cesium.Cartesian3.fromDegrees(
|
|
5714
|
+
r.geometry.coordinates[0],
|
|
5715
|
+
r.geometry.coordinates[1]
|
|
5713
5716
|
);
|
|
5714
|
-
|
|
5715
|
-
const
|
|
5716
|
-
id:
|
|
5717
|
-
position:
|
|
5717
|
+
d.addSample(((h = this._viewer) == null ? void 0 : h.clock.currentTime) ?? Cesium.JulianDate.now(), o);
|
|
5718
|
+
const l = ((a = r.properties) == null ? void 0 : a.courseOverGroundTrue) ?? 0, c = new Cesium.Entity({
|
|
5719
|
+
id: u,
|
|
5720
|
+
position: d,
|
|
5718
5721
|
orientation: new Cesium.ConstantProperty(
|
|
5719
5722
|
Cesium.Transforms.headingPitchRollQuaternion(
|
|
5720
|
-
|
|
5721
|
-
new Cesium.HeadingPitchRoll(
|
|
5723
|
+
o,
|
|
5724
|
+
new Cesium.HeadingPitchRoll(l, 0, 0)
|
|
5722
5725
|
)
|
|
5723
5726
|
),
|
|
5724
|
-
properties:
|
|
5727
|
+
properties: r.properties ?? {}
|
|
5725
5728
|
});
|
|
5726
|
-
this.entityMap.set(
|
|
5729
|
+
this.entityMap.set(u, c), this.db.entities.add(c), this.renderEntity(c), this.emit("createEntity", c);
|
|
5727
5730
|
}
|
|
5728
5731
|
/**更新or新增feature */
|
|
5729
|
-
update(
|
|
5730
|
-
var
|
|
5731
|
-
const
|
|
5732
|
-
if (
|
|
5733
|
-
const
|
|
5734
|
-
if (
|
|
5735
|
-
Cesium.JulianDate.addSeconds(
|
|
5736
|
-
|
|
5737
|
-
),
|
|
5738
|
-
for (const [R,
|
|
5732
|
+
update(r) {
|
|
5733
|
+
var d, o, l, c, h, a, m, y;
|
|
5734
|
+
const u = this.db.entities.getById(String(r.id));
|
|
5735
|
+
if (u) {
|
|
5736
|
+
const g = this.shadowEntityMap.get(u), p = ((d = r.properties) == null ? void 0 : d.shipTypeId) ?? -1, v = shipTypeColorMap.get(p) ?? shipTypeColorMap.get(-1), [b, _] = r.geometry.coordinates, T = ((o = this._viewer) == null ? void 0 : o.clock.currentTime) ?? Cesium.JulianDate.now(), w = (l = u.position) == null ? void 0 : l.getValue(T), x = Cesium.JulianDate.addSeconds(T, 3, new Cesium.JulianDate()), O = Cesium.Cartesian3.fromDegrees(b, _), E = new Cesium.SampledPositionProperty();
|
|
5737
|
+
if (E.backwardExtrapolationType = Cesium.ExtrapolationType.HOLD, E.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD, E instanceof Cesium.SampledPositionProperty && (E.addSample(
|
|
5738
|
+
Cesium.JulianDate.addSeconds(T, 1, new Cesium.JulianDate()),
|
|
5739
|
+
w ?? O
|
|
5740
|
+
), E.addSample(x, O)), u.position = E, g && (g.position = E), u.properties)
|
|
5741
|
+
for (const [R, S] of Object.entries(r.properties ?? {})) {
|
|
5739
5742
|
if (R == "speedOverGround") {
|
|
5740
|
-
const
|
|
5741
|
-
if (
|
|
5742
|
-
createShipIconUrl(
|
|
5743
|
-
)),
|
|
5744
|
-
const
|
|
5745
|
-
color:
|
|
5746
|
-
isMoving:
|
|
5747
|
-
...
|
|
5748
|
-
designBeam:
|
|
5749
|
-
designLength:
|
|
5750
|
-
}),
|
|
5751
|
-
|
|
5752
|
-
new Cesium.Cartesian2(
|
|
5753
|
-
)),
|
|
5754
|
-
() => new Cesium.Cartesian2(
|
|
5743
|
+
const P = u.properties.getValue().speedOverGround ?? 0, C = Number(P) > this.IS_MOVING_THRESHOLD, D = Number(S) > this.IS_MOVING_THRESHOLD;
|
|
5744
|
+
if (C !== D && (u.billboard && (u.billboard.image = new Cesium.ConstantProperty(
|
|
5745
|
+
createShipIconUrl(v, D)
|
|
5746
|
+
)), g != null && g.plane)) {
|
|
5747
|
+
const I = ((c = r.properties) == null ? void 0 : c.designBeam) ?? 8, $ = ((h = r.properties) == null ? void 0 : h.designLength) ?? 20, q = createShipIconV2({
|
|
5748
|
+
color: v,
|
|
5749
|
+
isMoving: D,
|
|
5750
|
+
...r.properties,
|
|
5751
|
+
designBeam: I,
|
|
5752
|
+
designLength: $
|
|
5753
|
+
}), F = (a = g.plane) == null ? void 0 : a.material;
|
|
5754
|
+
F && (F.image = new Cesium.ConstantProperty(q.url), g.plane.dimensions = new Cesium.ConstantProperty(
|
|
5755
|
+
new Cesium.Cartesian2(I * q.scale.x, $ * q.scale.y)
|
|
5756
|
+
)), g.plane.dimensions = new Cesium.CallbackProperty(
|
|
5757
|
+
() => new Cesium.Cartesian2(I * q.scale.x, $ * q.scale.y),
|
|
5755
5758
|
!0
|
|
5756
5759
|
);
|
|
5757
5760
|
}
|
|
5758
5761
|
}
|
|
5759
5762
|
if (R == "courseOverGroundTrue") {
|
|
5760
|
-
const
|
|
5761
|
-
|
|
5762
|
-
typeof
|
|
5763
|
+
const P = ((m = r.properties) == null ? void 0 : m.courseOverGroundTrue) ?? 0;
|
|
5764
|
+
u.billboard.rotation = new Cesium.ConstantProperty(
|
|
5765
|
+
typeof S == "number" ? -1 * S : 0
|
|
5763
5766
|
);
|
|
5764
|
-
const
|
|
5767
|
+
const C = new Cesium.ConstantProperty(
|
|
5765
5768
|
Cesium.Transforms.headingPitchRollQuaternion(
|
|
5766
|
-
|
|
5767
|
-
new Cesium.HeadingPitchRoll(
|
|
5769
|
+
O,
|
|
5770
|
+
new Cesium.HeadingPitchRoll(P, 0, 0)
|
|
5768
5771
|
)
|
|
5769
5772
|
);
|
|
5770
|
-
|
|
5773
|
+
g && (g.orientation = C);
|
|
5771
5774
|
}
|
|
5772
5775
|
if (R == "updateTime") {
|
|
5773
|
-
const
|
|
5774
|
-
|
|
5775
|
-
startTime:
|
|
5776
|
+
const P = Cesium.JulianDate.fromDate(new Date(S));
|
|
5777
|
+
u.billboard.color = createAlphaSampled({
|
|
5778
|
+
startTime: P
|
|
5776
5779
|
});
|
|
5777
|
-
const
|
|
5778
|
-
|
|
5779
|
-
startTime:
|
|
5780
|
+
const C = (y = g == null ? void 0 : g.plane) == null ? void 0 : y.material;
|
|
5781
|
+
C && (C.color = createAlphaSampled({
|
|
5782
|
+
startTime: P
|
|
5780
5783
|
}));
|
|
5781
|
-
const
|
|
5782
|
-
|
|
5784
|
+
const D = getHideAfterFiveMinutesProperty(P);
|
|
5785
|
+
u.label.show = D, u.point.show = D;
|
|
5783
5786
|
}
|
|
5784
|
-
|
|
5787
|
+
u.properties[R] = S, g != null && g.properties && (g.properties[R] = S);
|
|
5785
5788
|
}
|
|
5786
5789
|
} else
|
|
5787
|
-
this.renderFeature(
|
|
5790
|
+
this.renderFeature(r);
|
|
5788
5791
|
}
|
|
5789
5792
|
// 判定移动的速度阈值(米/秒)
|
|
5790
|
-
renderEntity(
|
|
5791
|
-
var
|
|
5792
|
-
const
|
|
5793
|
-
|
|
5793
|
+
renderEntity(r) {
|
|
5794
|
+
var m, y, g, p, v, b, _;
|
|
5795
|
+
const u = (m = r.properties) == null ? void 0 : m.getValue(), d = (u == null ? void 0 : u.shipTypeId) ?? -1, o = shipTypeColorMap.get(d) ?? shipTypeColorMap.get(-1), l = Number((u == null ? void 0 : u.speedOverGround) ?? 0), c = u != null && u.updateTime ? new Date(u.updateTime) : /* @__PURE__ */ new Date(), h = Cesium.JulianDate.fromDate(c), a = createShipIconUrl(o, l > this.IS_MOVING_THRESHOLD);
|
|
5796
|
+
r.point = new Cesium.PointGraphics({
|
|
5794
5797
|
pixelSize: 4,
|
|
5795
5798
|
color: Cesium.Color.fromCssColorString("#8AF22C"),
|
|
5796
5799
|
disableDepthTestDistance: 3e6,
|
|
5797
5800
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(15e3),
|
|
5798
|
-
show: getHideAfterFiveMinutesProperty(
|
|
5799
|
-
}),
|
|
5800
|
-
image:
|
|
5801
|
+
show: getHideAfterFiveMinutesProperty(h)
|
|
5802
|
+
}), r.billboard = new Cesium.BillboardGraphics({
|
|
5803
|
+
image: a,
|
|
5801
5804
|
width: 14,
|
|
5802
5805
|
height: 70,
|
|
5803
5806
|
disableDepthTestDistance: 3e6,
|
|
5804
5807
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(4e3, 15e3),
|
|
5805
5808
|
pixelOffset: new Cesium.Cartesian2(0, 0),
|
|
5806
5809
|
alignedAxis: Cesium.Cartesian3.UNIT_Z,
|
|
5807
|
-
color: createAlphaSampled({ startTime:
|
|
5810
|
+
color: createAlphaSampled({ startTime: h }),
|
|
5808
5811
|
// 设置透明度
|
|
5809
5812
|
rotation: new Cesium.ConstantProperty(
|
|
5810
|
-
(
|
|
5813
|
+
(g = (y = r.properties) == null ? void 0 : y.getValue()) != null && g.courseOverGroundTrue ? -1 * r.properties.getValue().courseOverGroundTrue : 0
|
|
5811
5814
|
)
|
|
5812
5815
|
// 根据航向设置旋转角度
|
|
5813
|
-
}),
|
|
5816
|
+
}), r.label = new Cesium.LabelGraphics({
|
|
5814
5817
|
font: '12px normal "微软雅黑"',
|
|
5815
5818
|
backgroundColor: Cesium.Color.fromCssColorString("#E9F4FC"),
|
|
5816
5819
|
fillColor: Cesium.Color.BLACK,
|
|
@@ -5822,48 +5825,59 @@ class ShipLayer {
|
|
|
5822
5825
|
pixelOffset: new Cesium.Cartesian2(0, -20),
|
|
5823
5826
|
scale: 1,
|
|
5824
5827
|
scaleByDistance: new Cesium.NearFarScalar(3e3, 1, 1e4, 0.55),
|
|
5825
|
-
text: ((
|
|
5828
|
+
text: ((v = (p = r.properties) == null ? void 0 : p.getValue()) == null ? void 0 : v.name) ?? ((b = r.properties) != null && b.getValue().mmsi ? "mmsi:" + ((_ = r.properties) == null ? void 0 : _.getValue().mmsi) : "未知"),
|
|
5826
5829
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
|
5827
5830
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 15e3),
|
|
5828
5831
|
disableDepthTestDistance: 5e3,
|
|
5829
|
-
show: getHideAfterFiveMinutesProperty(
|
|
5830
|
-
}), this.createShipPlane(
|
|
5831
|
-
}
|
|
5832
|
-
createShipPlane(
|
|
5833
|
-
var
|
|
5834
|
-
const
|
|
5835
|
-
id:
|
|
5836
|
-
position:
|
|
5837
|
-
orientation:
|
|
5838
|
-
properties:
|
|
5832
|
+
show: getHideAfterFiveMinutesProperty(h)
|
|
5833
|
+
}), this.createShipPlane(r);
|
|
5834
|
+
}
|
|
5835
|
+
createShipPlane(r) {
|
|
5836
|
+
var p;
|
|
5837
|
+
const u = new Cesium.Entity({
|
|
5838
|
+
id: r.id + "_shadow",
|
|
5839
|
+
position: r.position,
|
|
5840
|
+
orientation: r.orientation,
|
|
5841
|
+
properties: r.properties
|
|
5839
5842
|
});
|
|
5840
|
-
this.shadowEntityMap.set(
|
|
5841
|
-
const
|
|
5842
|
-
color:
|
|
5843
|
-
isMoving:
|
|
5844
|
-
...
|
|
5845
|
-
designBeam: (
|
|
5846
|
-
designLength: (
|
|
5843
|
+
this.shadowEntityMap.set(r, u), this.db.entities.add(u);
|
|
5844
|
+
const d = (p = r.properties) == null ? void 0 : p.getValue(), o = d != null && d.updateTime ? new Date(d.updateTime) : /* @__PURE__ */ new Date(), l = Cesium.JulianDate.fromDate(o), c = Number((d == null ? void 0 : d.speedOverGround) ?? 0), h = (d == null ? void 0 : d.designLength) ?? 20, a = (d == null ? void 0 : d.designBeam) ?? 8, m = (d == null ? void 0 : d.shipTypeId) ?? -1, y = shipTypeColorMap.get(m) ?? shipTypeColorMap.get(-1), g = createShipIconV2({
|
|
5845
|
+
color: y,
|
|
5846
|
+
isMoving: c > this.IS_MOVING_THRESHOLD,
|
|
5847
|
+
...d,
|
|
5848
|
+
designBeam: (d == null ? void 0 : d.designBeam) ?? 8,
|
|
5849
|
+
designLength: (d == null ? void 0 : d.designLength) ?? 20
|
|
5847
5850
|
});
|
|
5848
|
-
|
|
5851
|
+
u.plane = new Cesium.PlaneGraphics({
|
|
5849
5852
|
plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Z, 0),
|
|
5850
|
-
dimensions: new Cesium.Cartesian2(
|
|
5853
|
+
dimensions: new Cesium.Cartesian2(a * g.scale.x, h * g.scale.y),
|
|
5851
5854
|
show: new Cesium.CallbackProperty(() => {
|
|
5852
|
-
var
|
|
5855
|
+
var T;
|
|
5853
5856
|
if (!this._viewer) return !0;
|
|
5854
|
-
const
|
|
5855
|
-
return
|
|
5857
|
+
const v = this._viewer.clock.currentTime, b = (T = r.position) == null ? void 0 : T.getValue(v);
|
|
5858
|
+
return b ? Cesium.Cartesian3.distance(this._viewer.camera.positionWC, b) <= 4e3 : !1;
|
|
5856
5859
|
}, !1),
|
|
5857
5860
|
// 用回调按距离控制显示
|
|
5858
5861
|
material: new Cesium.ImageMaterialProperty({
|
|
5859
|
-
image:
|
|
5862
|
+
image: g.url,
|
|
5860
5863
|
transparent: !0,
|
|
5861
5864
|
// 关键:让 alpha 生效
|
|
5862
5865
|
repeat: new Cesium.Cartesian2(1, 1),
|
|
5863
|
-
color: createAlphaSampled({ startTime:
|
|
5866
|
+
color: createAlphaSampled({ startTime: l })
|
|
5864
5867
|
})
|
|
5865
5868
|
});
|
|
5866
5869
|
}
|
|
5870
|
+
hideEntityByCondition(r) {
|
|
5871
|
+
this.hookFilterEntityFn && this.off("createEntity", this.hookFilterEntityFn), this.hookFilterEntityFn = (u) => {
|
|
5872
|
+
const d = (r == null ? void 0 : r(u)) ?? !0;
|
|
5873
|
+
u.show = d;
|
|
5874
|
+
const o = this.shadowEntityMap.get(u);
|
|
5875
|
+
o && (o.show = d);
|
|
5876
|
+
}, this.db.entities.values.forEach((u) => {
|
|
5877
|
+
var d;
|
|
5878
|
+
(d = this.hookFilterEntityFn) == null || d.call(this, u);
|
|
5879
|
+
}), r && this.on("createEntity", this.hookFilterEntityFn);
|
|
5880
|
+
}
|
|
5867
5881
|
}
|
|
5868
5882
|
Color.fromCssColorString("#FC4C02");
|
|
5869
5883
|
Color.WHITE;
|
|
@@ -5872,18 +5886,18 @@ new Array(4);
|
|
|
5872
5886
|
var e$2 = [], t$2 = [];
|
|
5873
5887
|
function n$2(s, i) {
|
|
5874
5888
|
if (s && typeof document < "u") {
|
|
5875
|
-
var r, u = i.prepend === !0 ? "prepend" : "append",
|
|
5876
|
-
if (
|
|
5889
|
+
var r, u = i.prepend === !0 ? "prepend" : "append", d = i.singleTag === !0, o = typeof i.container == "string" ? document.querySelector(i.container) : document.getElementsByTagName("head")[0];
|
|
5890
|
+
if (d) {
|
|
5877
5891
|
var l = e$2.indexOf(o);
|
|
5878
5892
|
l === -1 && (l = e$2.push(o) - 1, t$2[l] = {}), r = t$2[l] && t$2[l][u] ? t$2[l][u] : t$2[l][u] = c();
|
|
5879
5893
|
} else r = c();
|
|
5880
5894
|
s.charCodeAt(0) === 65279 && (s = s.substring(1)), r.styleSheet ? r.styleSheet.cssText += s : r.appendChild(document.createTextNode(s));
|
|
5881
5895
|
}
|
|
5882
5896
|
function c() {
|
|
5883
|
-
var
|
|
5884
|
-
if (
|
|
5897
|
+
var h = document.createElement("style");
|
|
5898
|
+
if (h.setAttribute("type", "text/css"), i.attributes) for (var a = Object.keys(i.attributes), m = 0; m < a.length; m++) h.setAttribute(a[m], i.attributes[a[m]]);
|
|
5885
5899
|
var y = u === "prepend" ? "afterbegin" : "beforeend";
|
|
5886
|
-
return o.insertAdjacentElement(y,
|
|
5900
|
+
return o.insertAdjacentElement(y, h), h;
|
|
5887
5901
|
}
|
|
5888
5902
|
}
|
|
5889
5903
|
var css$2 = '.cesium-tool-tip{background:rgba(0,0,0,.6);border-radius:4px;color:#fff;left:0;line-height:30px;min-height:30px;min-width:100px;padding:0 10px;pointer-events:none;position:absolute;top:0;visibility:hidden;z-index:-1}.cesium-tool-tip:before{border-bottom:10px solid transparent;border-right:10px solid rgba(0,0,0,.6);border-top:10px solid transparent;content:"";display:block;left:-10px;pointer-events:none;position:absolute;top:calc(50% - 10px)}';
|
|
@@ -5905,11 +5919,11 @@ class Popup {
|
|
|
5905
5919
|
z(this, "setPosition", () => {
|
|
5906
5920
|
if (this._position && this._viewer && this._position) {
|
|
5907
5921
|
if (this._viewer.scene.mode === SceneMode.SCENE3D) {
|
|
5908
|
-
const u = this._viewer.scene.camera.position,
|
|
5922
|
+
const u = this._viewer.scene.camera.position, d = new BoundingSphere(
|
|
5909
5923
|
new Cartesian3(0, 0, 0),
|
|
5910
5924
|
635e4
|
|
5911
5925
|
);
|
|
5912
|
-
if (!new Occluder(
|
|
5926
|
+
if (!new Occluder(d, u).isPointVisible(this._position)) {
|
|
5913
5927
|
this.switchElementShow(!1);
|
|
5914
5928
|
return;
|
|
5915
5929
|
}
|
|
@@ -5922,16 +5936,16 @@ class Popup {
|
|
|
5922
5936
|
if (this._screenPosition && this._screenPosition.x === i.x && this._screenPosition.y === i.y)
|
|
5923
5937
|
return;
|
|
5924
5938
|
this.switchElementShow(!0);
|
|
5925
|
-
const u = i.x - r.clientWidth / 2 + this._offset[0],
|
|
5926
|
-
r.style.left = `${u}px`, r.style.top = `${
|
|
5939
|
+
const u = i.x - r.clientWidth / 2 + this._offset[0], d = i.y - r.clientHeight + this._offset[1];
|
|
5940
|
+
r.style.left = `${u}px`, r.style.top = `${d}px`, this._screenPosition = i;
|
|
5927
5941
|
}
|
|
5928
5942
|
}
|
|
5929
5943
|
});
|
|
5930
5944
|
this._viewer = i, this._options = r;
|
|
5931
|
-
const { position: u, element:
|
|
5932
|
-
if (!
|
|
5945
|
+
const { position: u, element: d, offset: o } = r;
|
|
5946
|
+
if (!d)
|
|
5933
5947
|
throw Error("no element!");
|
|
5934
|
-
this._position = u ? Cartesian3.fromDegrees(u[0], u[1], u[2]) : null, this._element =
|
|
5948
|
+
this._position = u ? Cartesian3.fromDegrees(u[0], u[1], u[2]) : null, this._element = d, this._offset = [(o == null ? void 0 : o[0]) ?? 0, (o == null ? void 0 : o[1]) ?? 0], this.addMapListener();
|
|
5935
5949
|
}
|
|
5936
5950
|
set position(i) {
|
|
5937
5951
|
if (!i) {
|
|
@@ -5963,18 +5977,18 @@ class Popup {
|
|
|
5963
5977
|
var e$1 = [], t$1 = [];
|
|
5964
5978
|
function n$1(s, i) {
|
|
5965
5979
|
if (s && typeof document < "u") {
|
|
5966
|
-
var r, u = i.prepend === !0 ? "prepend" : "append",
|
|
5967
|
-
if (
|
|
5980
|
+
var r, u = i.prepend === !0 ? "prepend" : "append", d = i.singleTag === !0, o = typeof i.container == "string" ? document.querySelector(i.container) : document.getElementsByTagName("head")[0];
|
|
5981
|
+
if (d) {
|
|
5968
5982
|
var l = e$1.indexOf(o);
|
|
5969
5983
|
l === -1 && (l = e$1.push(o) - 1, t$1[l] = {}), r = t$1[l] && t$1[l][u] ? t$1[l][u] : t$1[l][u] = c();
|
|
5970
5984
|
} else r = c();
|
|
5971
5985
|
s.charCodeAt(0) === 65279 && (s = s.substring(1)), r.styleSheet ? r.styleSheet.cssText += s : r.appendChild(document.createTextNode(s));
|
|
5972
5986
|
}
|
|
5973
5987
|
function c() {
|
|
5974
|
-
var
|
|
5975
|
-
if (
|
|
5988
|
+
var h = document.createElement("style");
|
|
5989
|
+
if (h.setAttribute("type", "text/css"), i.attributes) for (var a = Object.keys(i.attributes), m = 0; m < a.length; m++) h.setAttribute(a[m], i.attributes[a[m]]);
|
|
5976
5990
|
var y = u === "prepend" ? "afterbegin" : "beforeend";
|
|
5977
|
-
return o.insertAdjacentElement(y,
|
|
5991
|
+
return o.insertAdjacentElement(y, h), h;
|
|
5978
5992
|
}
|
|
5979
5993
|
}
|
|
5980
5994
|
var css$1 = ".cesium-compass{cursor:pointer;height:60px;pointer-events:auto;position:absolute;right:15px;top:100px;user-select:none;width:60px}.cesium-compass .out-ring{fill:rgba(23,49,71,.702);background-repeat:no-repeat;background-size:contain;border-radius:50%;height:60px;left:0;position:absolute;top:0;transition:all .3s ease;width:60px}.cesium-compass .out-ring svg{height:60px;width:60px}.cesium-compass:hover .rotation_marker svg{height:70.2px;width:70.2px}.cesium-compass .gyro{align-items:center;background:#fff;border-radius:50%;box-sizing:border-box;display:flex;height:30px;justify-content:center;margin:0 auto;padding:4px;position:relative;text-align:center;top:50%;transform:translateY(-50%);transition:all .3s ease;width:30px}.cesium-compass .gyro svg{height:20px;width:20px}.rotation_marker{background-repeat:no-repeat;background-size:contain;border-radius:50%;position:relative}.rotation_marker svg{height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);transition:all .3s ease;width:60px}.cesium-compass .gyro-active,.cesium-compass .gyro:hover{fill:#68adfe}";
|
|
@@ -5982,18 +5996,18 @@ n$1(css$1, {});
|
|
|
5982
5996
|
var e = [], t = [];
|
|
5983
5997
|
function n(s, i) {
|
|
5984
5998
|
if (s && typeof document < "u") {
|
|
5985
|
-
var r, u = i.prepend === !0 ? "prepend" : "append",
|
|
5986
|
-
if (
|
|
5999
|
+
var r, u = i.prepend === !0 ? "prepend" : "append", d = i.singleTag === !0, o = typeof i.container == "string" ? document.querySelector(i.container) : document.getElementsByTagName("head")[0];
|
|
6000
|
+
if (d) {
|
|
5987
6001
|
var l = e.indexOf(o);
|
|
5988
6002
|
l === -1 && (l = e.push(o) - 1, t[l] = {}), r = t[l] && t[l][u] ? t[l][u] : t[l][u] = c();
|
|
5989
6003
|
} else r = c();
|
|
5990
6004
|
s.charCodeAt(0) === 65279 && (s = s.substring(1)), r.styleSheet ? r.styleSheet.cssText += s : r.appendChild(document.createTextNode(s));
|
|
5991
6005
|
}
|
|
5992
6006
|
function c() {
|
|
5993
|
-
var
|
|
5994
|
-
if (
|
|
6007
|
+
var h = document.createElement("style");
|
|
6008
|
+
if (h.setAttribute("type", "text/css"), i.attributes) for (var a = Object.keys(i.attributes), m = 0; m < a.length; m++) h.setAttribute(a[m], i.attributes[a[m]]);
|
|
5995
6009
|
var y = u === "prepend" ? "afterbegin" : "beforeend";
|
|
5996
|
-
return o.insertAdjacentElement(y,
|
|
6010
|
+
return o.insertAdjacentElement(y, h), h;
|
|
5997
6011
|
}
|
|
5998
6012
|
}
|
|
5999
6013
|
var css = ".cesium-zoom-controller{border-radius:100px;box-sizing:border-box;display:flex;flex-direction:column;line-height:1.2rem;pointer-events:auto;position:absolute;right:30px;text-align:center;top:187px;user-select:none}.cesium-zoom-controller .refresh,.cesium-zoom-controller .zoom-in,.cesium-zoom-controller .zoom-out{border-radius:14%;margin-bottom:5px}.cesium-zoom-controller .cesium-button{background:#2a2e39;border:none;margin-right:0;transition:all .3s cubic-bezier(.645,.045,.355,1);transition-delay:0s;transition-duration:.2s;transition-property:all;transition-timing-function:cubic-bezier(.645,.045,.355,1)}.cesium-zoom-controller .cesium-button:hover{background:#48b;box-shadow:none}.cesium-zoom-controller .cesium-button:active{fill:#edffff;background:#adf;color:#edffff}.cesium-zoom-controller .cesium-toolbar-button{align-items:center;display:flex;height:30px;justify-content:center;width:30px}";
|
|
@@ -6018,15 +6032,15 @@ function requireHeatmap() {
|
|
|
6018
6032
|
}, r = function() {
|
|
6019
6033
|
var a = function(g) {
|
|
6020
6034
|
this._coordinator = {}, this._data = [], this._radi = [], this._min = 10, this._max = 1, this._xField = g.xField || g.defaultXField, this._yField = g.yField || g.defaultYField, this._valueField = g.valueField || g.defaultValueField, g.radius && (this._cfgRadius = g.radius);
|
|
6021
|
-
},
|
|
6035
|
+
}, m = i.defaultRadius;
|
|
6022
6036
|
return a.prototype = {
|
|
6023
6037
|
// when forceRender = false -> called from setData, omits renderall event
|
|
6024
6038
|
_organiseData: function(y, g) {
|
|
6025
|
-
var
|
|
6026
|
-
_[
|
|
6027
|
-
var
|
|
6028
|
-
return
|
|
6029
|
-
x:
|
|
6039
|
+
var p = y[this._xField], v = y[this._yField], b = this._radi, _ = this._data, T = this._max, w = this._min, x = y[this._valueField] || 1, O = y.radius || this._cfgRadius || m;
|
|
6040
|
+
_[p] || (_[p] = [], b[p] = []), _[p][v] ? _[p][v] += x : (_[p][v] = x, b[p][v] = O);
|
|
6041
|
+
var E = _[p][v];
|
|
6042
|
+
return E > T ? (g ? this.setDataMax(E) : this._max = E, !1) : E < w ? (g ? this.setDataMin(E) : this._min = E, !1) : {
|
|
6043
|
+
x: p,
|
|
6030
6044
|
y: v,
|
|
6031
6045
|
value: x,
|
|
6032
6046
|
radius: O,
|
|
@@ -6035,13 +6049,13 @@ function requireHeatmap() {
|
|
|
6035
6049
|
};
|
|
6036
6050
|
},
|
|
6037
6051
|
_unOrganizeData: function() {
|
|
6038
|
-
var y = [], g = this._data,
|
|
6052
|
+
var y = [], g = this._data, p = this._radi;
|
|
6039
6053
|
for (var v in g)
|
|
6040
6054
|
for (var b in g[v])
|
|
6041
6055
|
y.push({
|
|
6042
6056
|
x: v,
|
|
6043
6057
|
y: b,
|
|
6044
|
-
radius:
|
|
6058
|
+
radius: p[v][b],
|
|
6045
6059
|
value: g[v][b]
|
|
6046
6060
|
});
|
|
6047
6061
|
return {
|
|
@@ -6061,19 +6075,19 @@ function requireHeatmap() {
|
|
|
6061
6075
|
for (var y = arguments[0], g = y.length; g--; )
|
|
6062
6076
|
this.addData.call(this, y[g]);
|
|
6063
6077
|
else {
|
|
6064
|
-
var
|
|
6065
|
-
|
|
6078
|
+
var p = this._organiseData(arguments[0], !0);
|
|
6079
|
+
p && (this._data.length === 0 && (this._min = this._max = p.value), this._coordinator.emit("renderpartial", {
|
|
6066
6080
|
min: this._min,
|
|
6067
6081
|
max: this._max,
|
|
6068
|
-
data: [
|
|
6082
|
+
data: [p]
|
|
6069
6083
|
}));
|
|
6070
6084
|
}
|
|
6071
6085
|
return this;
|
|
6072
6086
|
},
|
|
6073
6087
|
setData: function(y) {
|
|
6074
|
-
var g = y.data,
|
|
6088
|
+
var g = y.data, p = g.length;
|
|
6075
6089
|
this._data = [], this._radi = [];
|
|
6076
|
-
for (var v = 0; v <
|
|
6090
|
+
for (var v = 0; v < p; v++)
|
|
6077
6091
|
this._organiseData(g[v], !1);
|
|
6078
6092
|
return this._max = y.max, this._min = y.min || 0, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this;
|
|
6079
6093
|
},
|
|
@@ -6140,28 +6154,28 @@ function requireHeatmap() {
|
|
|
6140
6154
|
}*/
|
|
6141
6155
|
}, a;
|
|
6142
6156
|
}(), u = function() {
|
|
6143
|
-
var a = function(
|
|
6144
|
-
var v =
|
|
6157
|
+
var a = function(p) {
|
|
6158
|
+
var v = p.gradient || p.defaultGradient, b = document.createElement("canvas"), _ = b.getContext("2d", { willReadFrequently: !0 });
|
|
6145
6159
|
b.width = 256, b.height = 1;
|
|
6146
6160
|
var T = _.createLinearGradient(0, 0, 256, 1);
|
|
6147
6161
|
for (var w in v)
|
|
6148
6162
|
T.addColorStop(w, v[w]);
|
|
6149
6163
|
return _.fillStyle = T, _.fillRect(0, 0, 256, 1), _.getImageData(0, 0, 256, 1).data;
|
|
6150
|
-
},
|
|
6151
|
-
var b = document.createElement("canvas"), _ = b.getContext("2d", { willReadFrequently: !0 }), T =
|
|
6152
|
-
if (b.width = b.height =
|
|
6153
|
-
_.beginPath(), _.arc(T, w,
|
|
6164
|
+
}, m = function(p, v) {
|
|
6165
|
+
var b = document.createElement("canvas"), _ = b.getContext("2d", { willReadFrequently: !0 }), T = p, w = p;
|
|
6166
|
+
if (b.width = b.height = p * 2, v == 1)
|
|
6167
|
+
_.beginPath(), _.arc(T, w, p, 0, 2 * Math.PI, !1), _.fillStyle = "rgba(0,0,0,1)", _.fill();
|
|
6154
6168
|
else {
|
|
6155
|
-
var x = _.createRadialGradient(T, w,
|
|
6156
|
-
x.addColorStop(0, "rgba(0,0,0,1)"), x.addColorStop(1, "rgba(0,0,0,0)"), _.fillStyle = x, _.fillRect(0, 0, 2 *
|
|
6169
|
+
var x = _.createRadialGradient(T, w, p * v, T, w, p);
|
|
6170
|
+
x.addColorStop(0, "rgba(0,0,0,1)"), x.addColorStop(1, "rgba(0,0,0,0)"), _.fillStyle = x, _.fillRect(0, 0, 2 * p, 2 * p);
|
|
6157
6171
|
}
|
|
6158
6172
|
return b;
|
|
6159
6173
|
}, y = function(w) {
|
|
6160
6174
|
for (var v = [], b = w.min, _ = w.max, T = w.radi, w = w.data, x = Object.keys(w), O = x.length; O--; )
|
|
6161
|
-
for (var
|
|
6162
|
-
var P =
|
|
6175
|
+
for (var E = x[O], R = Object.keys(w[E]), S = R.length; S--; ) {
|
|
6176
|
+
var P = R[S], C = w[E][P], D = T[E][P];
|
|
6163
6177
|
v.push({
|
|
6164
|
-
x:
|
|
6178
|
+
x: E,
|
|
6165
6179
|
y: P,
|
|
6166
6180
|
value: C,
|
|
6167
6181
|
radius: D
|
|
@@ -6173,80 +6187,80 @@ function requireHeatmap() {
|
|
|
6173
6187
|
data: v
|
|
6174
6188
|
};
|
|
6175
6189
|
};
|
|
6176
|
-
function g(
|
|
6177
|
-
var v =
|
|
6190
|
+
function g(p) {
|
|
6191
|
+
var v = p.container, b = this.shadowCanvas = document.createElement("canvas"), _ = this.canvas = p.canvas || document.createElement("canvas");
|
|
6178
6192
|
this._renderBoundaries = [1e4, 1e4, 0, 0];
|
|
6179
|
-
var T = getComputedStyle(
|
|
6180
|
-
_.className = "heatmap-canvas", this._width = _.width = b.width =
|
|
6193
|
+
var T = getComputedStyle(p.container) || {};
|
|
6194
|
+
_.className = "heatmap-canvas", this._width = _.width = b.width = p.width || +T.width.replace(/px/, ""), this._height = _.height = b.height = p.height || +T.height.replace(/px/, ""), this.shadowCtx = b.getContext("2d", { willReadFrequently: !0 }), this.ctx = _.getContext("2d", { willReadFrequently: !0 }), _.style.cssText = b.style.cssText = "position:absolute;left:0;top:0;", v.style.position = "relative", v.appendChild(_), this._palette = a(p), this._templates = {}, this._setStyles(p);
|
|
6181
6195
|
}
|
|
6182
6196
|
return g.prototype = {
|
|
6183
|
-
renderPartial: function(
|
|
6184
|
-
|
|
6197
|
+
renderPartial: function(p) {
|
|
6198
|
+
p.data.length > 0 && (this._drawAlpha(p), this._colorize());
|
|
6185
6199
|
},
|
|
6186
|
-
renderAll: function(
|
|
6187
|
-
this._clear(),
|
|
6200
|
+
renderAll: function(p) {
|
|
6201
|
+
this._clear(), p.data.length > 0 && (this._drawAlpha(y(p)), this._colorize());
|
|
6188
6202
|
},
|
|
6189
|
-
_updateGradient: function(
|
|
6190
|
-
this._palette = a(
|
|
6203
|
+
_updateGradient: function(p) {
|
|
6204
|
+
this._palette = a(p);
|
|
6191
6205
|
},
|
|
6192
|
-
updateConfig: function(
|
|
6193
|
-
|
|
6206
|
+
updateConfig: function(p) {
|
|
6207
|
+
p.gradient && this._updateGradient(p), this._setStyles(p);
|
|
6194
6208
|
},
|
|
6195
|
-
setDimensions: function(
|
|
6196
|
-
this._width =
|
|
6209
|
+
setDimensions: function(p, v) {
|
|
6210
|
+
this._width = p, this._height = v, this.canvas.width = this.shadowCanvas.width = p, this.canvas.height = this.shadowCanvas.height = v;
|
|
6197
6211
|
},
|
|
6198
6212
|
_clear: function() {
|
|
6199
6213
|
this.shadowCtx.clearRect(0, 0, this._width, this._height), this.ctx.clearRect(0, 0, this._width, this._height);
|
|
6200
6214
|
},
|
|
6201
|
-
_setStyles: function(
|
|
6202
|
-
this._blur =
|
|
6215
|
+
_setStyles: function(p) {
|
|
6216
|
+
this._blur = p.blur == 0 ? 0 : p.blur || p.defaultBlur, p.backgroundColor && (this.canvas.style.backgroundColor = p.backgroundColor), this._width = this.canvas.width = this.shadowCanvas.width = p.width || this._width, this._height = this.canvas.height = this.shadowCanvas.height = p.height || this._height, this._opacity = (p.opacity || 0) * 255, this._maxOpacity = (p.maxOpacity || p.defaultMaxOpacity) * 255, this._minOpacity = (p.minOpacity || p.defaultMinOpacity) * 255, this._useGradientOpacity = !!p.useGradientOpacity;
|
|
6203
6217
|
},
|
|
6204
6218
|
_drawAlpha: function(_) {
|
|
6205
6219
|
for (var v = this._min = _.min, b = this._max = _.max, _ = _.data || [], T = _.length, w = 1 - this._blur; T--; ) {
|
|
6206
|
-
var x = _[T], O = x.x,
|
|
6207
|
-
this._templates[
|
|
6220
|
+
var x = _[T], O = x.x, E = x.y, R = x.radius, S = Math.min(x.value, b), P = O - R, C = E - R, D = this.shadowCtx, I;
|
|
6221
|
+
this._templates[R] ? I = this._templates[R] : this._templates[R] = I = m(R, w);
|
|
6208
6222
|
var $ = (S - v) / (b - v);
|
|
6209
|
-
D.globalAlpha = $ < 0.01 ? 0.01 : $, D.drawImage(I, P, C), P < this._renderBoundaries[0] && (this._renderBoundaries[0] = P), C < this._renderBoundaries[1] && (this._renderBoundaries[1] = C), P + 2 *
|
|
6223
|
+
D.globalAlpha = $ < 0.01 ? 0.01 : $, D.drawImage(I, P, C), P < this._renderBoundaries[0] && (this._renderBoundaries[0] = P), C < this._renderBoundaries[1] && (this._renderBoundaries[1] = C), P + 2 * R > this._renderBoundaries[2] && (this._renderBoundaries[2] = P + 2 * R), C + 2 * R > this._renderBoundaries[3] && (this._renderBoundaries[3] = C + 2 * R);
|
|
6210
6224
|
}
|
|
6211
6225
|
},
|
|
6212
6226
|
_colorize: function() {
|
|
6213
|
-
var
|
|
6214
|
-
|
|
6215
|
-
for (var S = this.shadowCtx.getImageData(
|
|
6227
|
+
var p = this._renderBoundaries[0], v = this._renderBoundaries[1], b = this._renderBoundaries[2] - p, _ = this._renderBoundaries[3] - v, T = this._width, w = this._height, x = this._opacity, O = this._maxOpacity, E = this._minOpacity, R = this._useGradientOpacity;
|
|
6228
|
+
p < 0 && (p = 0), v < 0 && (v = 0), p + b > T && (b = T - p), v + _ > w && (_ = w - v);
|
|
6229
|
+
for (var S = this.shadowCtx.getImageData(p, v, b, _), P = S.data, C = P.length, D = this._palette, I = 3; I < C; I += 4) {
|
|
6216
6230
|
var $ = P[I], q = $ * 4;
|
|
6217
6231
|
if (q) {
|
|
6218
6232
|
var F;
|
|
6219
|
-
x > 0 ? F = x : $ < O ? $ <
|
|
6233
|
+
x > 0 ? F = x : $ < O ? $ < E ? F = E : F = $ : F = O, P[I - 3] = D[q], P[I - 2] = D[q + 1], P[I - 1] = D[q + 2], P[I] = R ? D[q + 3] : F;
|
|
6220
6234
|
}
|
|
6221
6235
|
}
|
|
6222
|
-
this.ctx.putImageData(S,
|
|
6236
|
+
this.ctx.putImageData(S, p, v), this._renderBoundaries = [1e3, 1e3, 0, 0];
|
|
6223
6237
|
},
|
|
6224
|
-
getValueAt: function(
|
|
6225
|
-
var v, b = this.shadowCtx, _ = b.getImageData(
|
|
6238
|
+
getValueAt: function(p) {
|
|
6239
|
+
var v, b = this.shadowCtx, _ = b.getImageData(p.x, p.y, 1, 1), T = _.data[3], w = this._max, x = this._min;
|
|
6226
6240
|
return v = Math.abs(w - x) * (T / 255) >> 0, v;
|
|
6227
6241
|
},
|
|
6228
6242
|
getDataURL: function() {
|
|
6229
6243
|
return this.canvas.toDataURL();
|
|
6230
6244
|
}
|
|
6231
6245
|
}, g;
|
|
6232
|
-
}(),
|
|
6246
|
+
}(), d = function() {
|
|
6233
6247
|
var a = !1;
|
|
6234
6248
|
return i.defaultRenderer === "canvas2d" && (a = u), a;
|
|
6235
6249
|
}(), o = {
|
|
6236
6250
|
merge: function() {
|
|
6237
|
-
for (var
|
|
6238
|
-
var y = arguments[
|
|
6251
|
+
for (var h = {}, a = arguments.length, m = 0; m < a; m++) {
|
|
6252
|
+
var y = arguments[m];
|
|
6239
6253
|
for (var g in y)
|
|
6240
|
-
|
|
6254
|
+
h[g] = y[g];
|
|
6241
6255
|
}
|
|
6242
|
-
return
|
|
6256
|
+
return h;
|
|
6243
6257
|
}
|
|
6244
6258
|
}, l = function() {
|
|
6245
6259
|
var a = function() {
|
|
6246
|
-
function
|
|
6260
|
+
function p() {
|
|
6247
6261
|
this.cStore = {};
|
|
6248
6262
|
}
|
|
6249
|
-
return
|
|
6263
|
+
return p.prototype = {
|
|
6250
6264
|
on: function(v, b, _) {
|
|
6251
6265
|
var T = this.cStore;
|
|
6252
6266
|
T[v] || (T[v] = []), T[v].push(function(w) {
|
|
@@ -6261,10 +6275,10 @@ function requireHeatmap() {
|
|
|
6261
6275
|
x(b);
|
|
6262
6276
|
}
|
|
6263
6277
|
}
|
|
6264
|
-
},
|
|
6265
|
-
}(),
|
|
6266
|
-
var
|
|
6267
|
-
v.on("renderpartial",
|
|
6278
|
+
}, p;
|
|
6279
|
+
}(), m = function(g) {
|
|
6280
|
+
var p = g._renderer, v = g._coordinator, b = g._store;
|
|
6281
|
+
v.on("renderpartial", p.renderPartial, p), v.on("renderall", p.renderAll, p), v.on("extremachange", function(_) {
|
|
6268
6282
|
g._config.onExtremaChange && g._config.onExtremaChange({
|
|
6269
6283
|
min: _.min,
|
|
6270
6284
|
max: _.max,
|
|
@@ -6275,15 +6289,15 @@ function requireHeatmap() {
|
|
|
6275
6289
|
function y() {
|
|
6276
6290
|
var g = this._config = o.merge(i, arguments[0] || {});
|
|
6277
6291
|
if (this._coordinator = new a(), g.plugin) {
|
|
6278
|
-
var
|
|
6279
|
-
if (i.plugins[
|
|
6280
|
-
var v = i.plugins[
|
|
6292
|
+
var p = g.plugin;
|
|
6293
|
+
if (i.plugins[p]) {
|
|
6294
|
+
var v = i.plugins[p];
|
|
6281
6295
|
this._renderer = new v.renderer(g), this._store = new v.store(g);
|
|
6282
6296
|
} else
|
|
6283
|
-
throw new Error("Plugin '" +
|
|
6297
|
+
throw new Error("Plugin '" + p + "' not found. Maybe it was not registered.");
|
|
6284
6298
|
} else
|
|
6285
|
-
this._renderer = new
|
|
6286
|
-
|
|
6299
|
+
this._renderer = new d(g), this._store = new r(g);
|
|
6300
|
+
m(this);
|
|
6287
6301
|
}
|
|
6288
6302
|
return y.prototype = {
|
|
6289
6303
|
addData: function() {
|
|
@@ -6318,11 +6332,11 @@ function requireHeatmap() {
|
|
|
6318
6332
|
}
|
|
6319
6333
|
}, y;
|
|
6320
6334
|
}(), c = {
|
|
6321
|
-
create: function(
|
|
6322
|
-
return new l(
|
|
6335
|
+
create: function(h) {
|
|
6336
|
+
return new l(h);
|
|
6323
6337
|
},
|
|
6324
|
-
register: function(
|
|
6325
|
-
i.plugins[
|
|
6338
|
+
register: function(h, a) {
|
|
6339
|
+
i.plugins[h] = a;
|
|
6326
6340
|
}
|
|
6327
6341
|
};
|
|
6328
6342
|
return c;
|
|
@@ -6342,10 +6356,10 @@ const G = class G extends EventEmitter {
|
|
|
6342
6356
|
var c;
|
|
6343
6357
|
const u = r.element;
|
|
6344
6358
|
u.style.position = "absolute";
|
|
6345
|
-
const
|
|
6346
|
-
l && (l.destroy(),
|
|
6359
|
+
const d = r.viewer.container, o = () => {
|
|
6360
|
+
l && (l.destroy(), d.removeChild(u), this.popupMap.delete(r.id), this.emit("onUnmount", r.id));
|
|
6347
6361
|
};
|
|
6348
|
-
|
|
6362
|
+
d.appendChild(u), this.emit("onMount", r.id), (c = this.popupMap.get(r.id)) == null || c.destroy();
|
|
6349
6363
|
const l = new Popup(r.viewer, {
|
|
6350
6364
|
position: r.position,
|
|
6351
6365
|
offset: r.offset ?? [0, 0],
|