@automerge/automerge-repo-react-hooks 2.0.0-alpha.6 → 2.0.0-alpha.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/index.js +603 -600
- package/dist/useDocuments.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/useDocuments.ts +10 -1
- package/test/useDocuments.test.tsx +12 -0
package/dist/index.js
CHANGED
|
@@ -8,19 +8,19 @@ function bt() {
|
|
|
8
8
|
function jn(e) {
|
|
9
9
|
const t = bt(), r = e ? t.find(e) : null, n = Nt(r);
|
|
10
10
|
r !== n.current && (n.current = r);
|
|
11
|
-
const [,
|
|
11
|
+
const [, i] = $t(0), o = () => i((f) => f + 1);
|
|
12
12
|
_e(() => !e || !r ? void 0 : (n.current = r, r.doc().then(() => {
|
|
13
13
|
o();
|
|
14
|
-
}).catch((
|
|
14
|
+
}).catch((a) => console.error(a)), r.on("change", o), r.on("delete", o), () => {
|
|
15
15
|
r.removeListener("change", o), r.removeListener("delete", o);
|
|
16
16
|
}), [e, r]);
|
|
17
|
-
const
|
|
18
|
-
(
|
|
19
|
-
r && r.change(
|
|
17
|
+
const s = pr(
|
|
18
|
+
(f, a) => {
|
|
19
|
+
r && r.change(f, a);
|
|
20
20
|
},
|
|
21
21
|
[r]
|
|
22
22
|
);
|
|
23
|
-
return [r?.docSync(),
|
|
23
|
+
return [r?.docSync(), s];
|
|
24
24
|
}
|
|
25
25
|
const pe = Symbol.for("_am_meta"), Oe = Symbol.for("_am_trace"), Ie = Symbol.for("_am_objectId"), gt = Symbol.for("_am_isProxy"), zt = Symbol.for("_am_clearCache"), xr = Symbol.for("_am_uint"), wr = Symbol.for("_am_int"), mr = Symbol.for("_am_f64"), Ht = Symbol.for("_am_counter"), Sr = Symbol.for("_am_text");
|
|
26
26
|
class be {
|
|
@@ -215,8 +215,8 @@ class vr {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
class Ar extends vr {
|
|
218
|
-
constructor(t, r, n,
|
|
219
|
-
super(t), this.context = r, this.path = n, this.objectId =
|
|
218
|
+
constructor(t, r, n, i, o) {
|
|
219
|
+
super(t), this.context = r, this.path = n, this.objectId = i, this.key = o;
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
222
|
* Increases the value of the counter by `delta`. If `delta` is not given,
|
|
@@ -233,8 +233,8 @@ class Ar extends vr {
|
|
|
233
233
|
return this.increment(typeof t == "number" ? -t : -1);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
function Cr(e, t, r, n,
|
|
237
|
-
return new Ar(e, t, r, n,
|
|
236
|
+
function Cr(e, t, r, n, i) {
|
|
237
|
+
return new Ar(e, t, r, n, i);
|
|
238
238
|
}
|
|
239
239
|
class Er {
|
|
240
240
|
constructor(t) {
|
|
@@ -258,47 +258,47 @@ function ae(e) {
|
|
|
258
258
|
return e;
|
|
259
259
|
}
|
|
260
260
|
function re(e, t) {
|
|
261
|
-
const { context: r, objectId: n, path:
|
|
262
|
-
if (
|
|
261
|
+
const { context: r, objectId: n, path: i, textV2: o } = e, s = r.getWithType(n, t);
|
|
262
|
+
if (s === null)
|
|
263
263
|
return;
|
|
264
|
-
const
|
|
265
|
-
switch (
|
|
264
|
+
const f = s[0], a = s[1];
|
|
265
|
+
switch (f) {
|
|
266
266
|
case void 0:
|
|
267
267
|
return;
|
|
268
268
|
case "map":
|
|
269
|
-
return He(r,
|
|
269
|
+
return He(r, a, o, [...i, t]);
|
|
270
270
|
case "list":
|
|
271
|
-
return Ke(r,
|
|
271
|
+
return Ke(r, a, o, [...i, t]);
|
|
272
272
|
case "text":
|
|
273
|
-
return o ? r.text(
|
|
274
|
-
...
|
|
273
|
+
return o ? r.text(a) : Ue(r, a, [
|
|
274
|
+
...i,
|
|
275
275
|
t
|
|
276
276
|
]);
|
|
277
277
|
case "str":
|
|
278
|
-
return
|
|
278
|
+
return a;
|
|
279
279
|
case "uint":
|
|
280
|
-
return
|
|
280
|
+
return a;
|
|
281
281
|
case "int":
|
|
282
|
-
return
|
|
282
|
+
return a;
|
|
283
283
|
case "f64":
|
|
284
|
-
return
|
|
284
|
+
return a;
|
|
285
285
|
case "boolean":
|
|
286
|
-
return
|
|
286
|
+
return a;
|
|
287
287
|
case "null":
|
|
288
288
|
return null;
|
|
289
289
|
case "bytes":
|
|
290
|
-
return
|
|
290
|
+
return a;
|
|
291
291
|
case "timestamp":
|
|
292
|
-
return
|
|
292
|
+
return a;
|
|
293
293
|
case "counter":
|
|
294
|
-
return Cr(
|
|
294
|
+
return Cr(a, r, i, n, t);
|
|
295
295
|
default:
|
|
296
|
-
throw RangeError(`datatype ${
|
|
296
|
+
throw RangeError(`datatype ${f} unimplemented`);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
function Pe(e, t, r, n) {
|
|
300
|
-
const
|
|
301
|
-
switch (
|
|
300
|
+
const i = typeof e;
|
|
301
|
+
switch (i) {
|
|
302
302
|
case "object":
|
|
303
303
|
if (e == null)
|
|
304
304
|
return [null, "null"];
|
|
@@ -338,9 +338,9 @@ function Pe(e, t, r, n) {
|
|
|
338
338
|
].join(""));
|
|
339
339
|
default:
|
|
340
340
|
throw new RangeError([
|
|
341
|
-
`Cannot assign ${
|
|
341
|
+
`Cannot assign ${i} value at ${Ot(r)}. `,
|
|
342
342
|
"All JSON primitive datatypes (object, array, string, number, boolean, null) ",
|
|
343
|
-
`are supported in an Automerge document; ${
|
|
343
|
+
`are supported in an Automerge document; ${i} values are not. `
|
|
344
344
|
].join(""));
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -350,43 +350,43 @@ function ze(e, t) {
|
|
|
350
350
|
}
|
|
351
351
|
const _r = {
|
|
352
352
|
get(e, t) {
|
|
353
|
-
const { context: r, objectId: n, cache:
|
|
354
|
-
return t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r, textV2: e.textV2 } : (
|
|
353
|
+
const { context: r, objectId: n, cache: i } = e;
|
|
354
|
+
return t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r, textV2: e.textV2 } : (i[t] || (i[t] = re(e, t)), i[t]);
|
|
355
355
|
},
|
|
356
356
|
set(e, t, r) {
|
|
357
|
-
const { context: n, objectId:
|
|
357
|
+
const { context: n, objectId: i, path: o, textV2: s } = e;
|
|
358
358
|
if (e.cache = {}, ze(r, n))
|
|
359
359
|
throw new RangeError("Cannot create a reference to an existing document object");
|
|
360
360
|
if (t === Oe)
|
|
361
361
|
return e.trace = r, !0;
|
|
362
362
|
if (t === zt)
|
|
363
363
|
return !0;
|
|
364
|
-
const [
|
|
365
|
-
switch (
|
|
364
|
+
const [f, a] = Pe(r, s, [...o, t], n);
|
|
365
|
+
switch (a) {
|
|
366
366
|
case "list": {
|
|
367
|
-
const p = n.putObject(
|
|
368
|
-
for (let h = 0; h <
|
|
369
|
-
d[h] =
|
|
367
|
+
const p = n.putObject(i, t, []), d = Ke(n, p, s, [...o, t]);
|
|
368
|
+
for (let h = 0; h < f.length; h++)
|
|
369
|
+
d[h] = f[h];
|
|
370
370
|
break;
|
|
371
371
|
}
|
|
372
372
|
case "text": {
|
|
373
|
-
if (
|
|
374
|
-
Le(
|
|
373
|
+
if (s)
|
|
374
|
+
Le(f), n.putObject(i, t, f);
|
|
375
375
|
else {
|
|
376
|
-
wt(
|
|
377
|
-
const p = n.putObject(
|
|
378
|
-
Ue(n, p, [...o, t]).splice(0, 0, ...
|
|
376
|
+
wt(f);
|
|
377
|
+
const p = n.putObject(i, t, "");
|
|
378
|
+
Ue(n, p, [...o, t]).splice(0, 0, ...f);
|
|
379
379
|
}
|
|
380
380
|
break;
|
|
381
381
|
}
|
|
382
382
|
case "map": {
|
|
383
|
-
const p = n.putObject(
|
|
384
|
-
for (const h in
|
|
385
|
-
d[h] =
|
|
383
|
+
const p = n.putObject(i, t, {}), d = He(n, p, s, [...o, t]);
|
|
384
|
+
for (const h in f)
|
|
385
|
+
d[h] = f[h];
|
|
386
386
|
break;
|
|
387
387
|
}
|
|
388
388
|
default:
|
|
389
|
-
n.put(
|
|
389
|
+
n.put(i, t, f, a);
|
|
390
390
|
}
|
|
391
391
|
return !0;
|
|
392
392
|
},
|
|
@@ -413,10 +413,10 @@ const _r = {
|
|
|
413
413
|
}, Kt = {
|
|
414
414
|
get(e, t) {
|
|
415
415
|
const { context: r, objectId: n } = e;
|
|
416
|
-
return t = ae(t), t === Symbol.hasInstance ? (
|
|
416
|
+
return t = ae(t), t === Symbol.hasInstance ? (i) => Array.isArray(i) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? re(e, t) : xt(e)[t];
|
|
417
417
|
},
|
|
418
418
|
set(e, t, r) {
|
|
419
|
-
const { context: n, objectId:
|
|
419
|
+
const { context: n, objectId: i, path: o, textV2: s } = e;
|
|
420
420
|
if (t = ae(t), ze(r, n))
|
|
421
421
|
throw new RangeError("Cannot create a reference to an existing document object");
|
|
422
422
|
if (t === zt)
|
|
@@ -425,40 +425,40 @@ const _r = {
|
|
|
425
425
|
return e.trace = r, !0;
|
|
426
426
|
if (typeof t == "string")
|
|
427
427
|
throw new RangeError("list index must be a number");
|
|
428
|
-
const [
|
|
429
|
-
switch (
|
|
428
|
+
const [f, a] = Pe(r, s, [...o, t], n);
|
|
429
|
+
switch (a) {
|
|
430
430
|
case "list": {
|
|
431
431
|
let p;
|
|
432
|
-
t >= n.length(
|
|
432
|
+
t >= n.length(i) ? p = n.insertObject(i, t, []) : p = n.putObject(i, t, []), Ke(n, p, s, [...o, t]).splice(0, 0, ...f);
|
|
433
433
|
break;
|
|
434
434
|
}
|
|
435
435
|
case "text": {
|
|
436
|
-
if (
|
|
437
|
-
Le(
|
|
436
|
+
if (s)
|
|
437
|
+
Le(f), t >= n.length(i) ? n.insertObject(i, t, f) : n.putObject(i, t, f);
|
|
438
438
|
else {
|
|
439
439
|
let p;
|
|
440
|
-
wt(
|
|
440
|
+
wt(f), t >= n.length(i) ? p = n.insertObject(i, t, "") : p = n.putObject(i, t, ""), Ue(n, p, [...o, t]).splice(0, 0, ...f);
|
|
441
441
|
}
|
|
442
442
|
break;
|
|
443
443
|
}
|
|
444
444
|
case "map": {
|
|
445
445
|
let p;
|
|
446
|
-
t >= n.length(
|
|
447
|
-
const d = He(n, p,
|
|
448
|
-
for (const h in
|
|
449
|
-
d[h] =
|
|
446
|
+
t >= n.length(i) ? p = n.insertObject(i, t, {}) : p = n.putObject(i, t, {});
|
|
447
|
+
const d = He(n, p, s, [...o, t]);
|
|
448
|
+
for (const h in f)
|
|
449
|
+
d[h] = f[h];
|
|
450
450
|
break;
|
|
451
451
|
}
|
|
452
452
|
default:
|
|
453
|
-
t >= n.length(
|
|
453
|
+
t >= n.length(i) ? n.insert(i, t, f, a) : n.put(i, t, f, a);
|
|
454
454
|
}
|
|
455
455
|
return !0;
|
|
456
456
|
},
|
|
457
457
|
deleteProperty(e, t) {
|
|
458
458
|
const { context: r, objectId: n } = e;
|
|
459
459
|
t = ae(t);
|
|
460
|
-
const
|
|
461
|
-
if (
|
|
460
|
+
const i = r.get(n, t);
|
|
461
|
+
if (i != null && i[0] == "counter")
|
|
462
462
|
throw new TypeError("Unsupported operation: deleting a counter from a list");
|
|
463
463
|
return r.delete(n, t), !0;
|
|
464
464
|
},
|
|
@@ -480,31 +480,31 @@ const _r = {
|
|
|
480
480
|
}, Or = Object.assign({}, Kt, {
|
|
481
481
|
get(e, t) {
|
|
482
482
|
const { context: r, objectId: n } = e;
|
|
483
|
-
return t = ae(t), t === Symbol.hasInstance ? (
|
|
483
|
+
return t = ae(t), t === Symbol.hasInstance ? (i) => Array.isArray(i) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? re(e, t) : Ir(e)[t] || xt(e)[t];
|
|
484
484
|
},
|
|
485
485
|
getPrototypeOf() {
|
|
486
486
|
return Object.getPrototypeOf(new be());
|
|
487
487
|
}
|
|
488
488
|
});
|
|
489
489
|
function He(e, t, r, n) {
|
|
490
|
-
const
|
|
490
|
+
const i = {
|
|
491
491
|
context: e,
|
|
492
492
|
objectId: t,
|
|
493
493
|
path: n || [],
|
|
494
494
|
cache: {},
|
|
495
495
|
textV2: r
|
|
496
496
|
}, o = {};
|
|
497
|
-
return Object.assign(o,
|
|
497
|
+
return Object.assign(o, i), new Proxy(o, _r);
|
|
498
498
|
}
|
|
499
499
|
function Ke(e, t, r, n) {
|
|
500
|
-
const
|
|
500
|
+
const i = {
|
|
501
501
|
context: e,
|
|
502
502
|
objectId: t,
|
|
503
503
|
path: n || [],
|
|
504
504
|
cache: {},
|
|
505
505
|
textV2: r
|
|
506
506
|
}, o = [];
|
|
507
|
-
return Object.assign(o,
|
|
507
|
+
return Object.assign(o, i), new Proxy(o, Kt);
|
|
508
508
|
}
|
|
509
509
|
function Ue(e, t, r) {
|
|
510
510
|
const n = {
|
|
@@ -513,23 +513,23 @@ function Ue(e, t, r) {
|
|
|
513
513
|
path: r || [],
|
|
514
514
|
cache: {},
|
|
515
515
|
textV2: !1
|
|
516
|
-
},
|
|
517
|
-
return Object.assign(
|
|
516
|
+
}, i = {};
|
|
517
|
+
return Object.assign(i, n), new Proxy(i, Or);
|
|
518
518
|
}
|
|
519
519
|
function xt(e) {
|
|
520
|
-
const { context: t, objectId: r, path: n, textV2:
|
|
520
|
+
const { context: t, objectId: r, path: n, textV2: i } = e;
|
|
521
521
|
return {
|
|
522
|
-
deleteAt(
|
|
523
|
-
return typeof
|
|
522
|
+
deleteAt(s, f) {
|
|
523
|
+
return typeof f == "number" ? t.splice(r, s, f) : t.delete(r, s), this;
|
|
524
524
|
},
|
|
525
|
-
fill(
|
|
526
|
-
const [p, d] = Pe(
|
|
527
|
-
|
|
528
|
-
for (let g =
|
|
525
|
+
fill(s, f, a) {
|
|
526
|
+
const [p, d] = Pe(s, i, [...n, f], t), h = t.length(r);
|
|
527
|
+
f = ae(f || 0), a = ae(a || h);
|
|
528
|
+
for (let g = f; g < Math.min(a, h); g++)
|
|
529
529
|
if (d === "list" || d === "map")
|
|
530
530
|
t.putObject(r, g, p);
|
|
531
531
|
else if (d === "text")
|
|
532
|
-
if (
|
|
532
|
+
if (i)
|
|
533
533
|
Le(p), t.putObject(r, g, p);
|
|
534
534
|
else {
|
|
535
535
|
wt(p);
|
|
@@ -541,48 +541,48 @@ function xt(e) {
|
|
|
541
541
|
t.put(r, g, p, d);
|
|
542
542
|
return this;
|
|
543
543
|
},
|
|
544
|
-
indexOf(
|
|
545
|
-
const
|
|
546
|
-
for (let p =
|
|
544
|
+
indexOf(s, f = 0) {
|
|
545
|
+
const a = t.length(r);
|
|
546
|
+
for (let p = f; p < a; p++) {
|
|
547
547
|
const d = t.getWithType(r, p);
|
|
548
|
-
if (d && (d[1] ===
|
|
548
|
+
if (d && (d[1] === s[Ie] || d[1] === s))
|
|
549
549
|
return p;
|
|
550
550
|
}
|
|
551
551
|
return -1;
|
|
552
552
|
},
|
|
553
|
-
insertAt(
|
|
554
|
-
return this.splice(
|
|
553
|
+
insertAt(s, ...f) {
|
|
554
|
+
return this.splice(s, 0, ...f), this;
|
|
555
555
|
},
|
|
556
556
|
pop() {
|
|
557
|
-
const
|
|
558
|
-
if (
|
|
557
|
+
const s = t.length(r);
|
|
558
|
+
if (s == 0)
|
|
559
559
|
return;
|
|
560
|
-
const
|
|
561
|
-
return t.delete(r,
|
|
560
|
+
const f = re(e, s - 1);
|
|
561
|
+
return t.delete(r, s - 1), f;
|
|
562
562
|
},
|
|
563
|
-
push(...
|
|
564
|
-
const
|
|
565
|
-
return this.splice(
|
|
563
|
+
push(...s) {
|
|
564
|
+
const f = t.length(r);
|
|
565
|
+
return this.splice(f, 0, ...s), t.length(r);
|
|
566
566
|
},
|
|
567
567
|
shift() {
|
|
568
568
|
if (t.length(r) == 0)
|
|
569
569
|
return;
|
|
570
|
-
const
|
|
571
|
-
return t.delete(r, 0),
|
|
570
|
+
const s = re(e, 0);
|
|
571
|
+
return t.delete(r, 0), s;
|
|
572
572
|
},
|
|
573
|
-
splice(
|
|
574
|
-
|
|
575
|
-
for (const h of
|
|
573
|
+
splice(s, f, ...a) {
|
|
574
|
+
s = ae(s), typeof f != "number" && (f = t.length(r) - s), f = ae(f);
|
|
575
|
+
for (const h of a)
|
|
576
576
|
if (ze(h, t))
|
|
577
577
|
throw new RangeError("Cannot create a reference to an existing document object");
|
|
578
578
|
const p = [];
|
|
579
|
-
for (let h = 0; h <
|
|
580
|
-
const g = re(e,
|
|
581
|
-
g !== void 0 && p.push(g), t.delete(r,
|
|
579
|
+
for (let h = 0; h < f; h++) {
|
|
580
|
+
const g = re(e, s);
|
|
581
|
+
g !== void 0 && p.push(g), t.delete(r, s);
|
|
582
582
|
}
|
|
583
|
-
const d =
|
|
583
|
+
const d = a.map((h, g) => {
|
|
584
584
|
try {
|
|
585
|
-
return Pe(h,
|
|
585
|
+
return Pe(h, i, [...n], t);
|
|
586
586
|
} catch (u) {
|
|
587
587
|
throw u instanceof RangeError ? new RangeError(`${u.message} (at index ${g} in the input)`) : u;
|
|
588
588
|
}
|
|
@@ -590,41 +590,41 @@ function xt(e) {
|
|
|
590
590
|
for (const [h, g] of d) {
|
|
591
591
|
switch (g) {
|
|
592
592
|
case "list": {
|
|
593
|
-
const u = t.insertObject(r,
|
|
594
|
-
Ke(t, u,
|
|
593
|
+
const u = t.insertObject(r, s, []);
|
|
594
|
+
Ke(t, u, i, [...n, s]).splice(0, 0, ...h);
|
|
595
595
|
break;
|
|
596
596
|
}
|
|
597
597
|
case "text": {
|
|
598
|
-
if (
|
|
599
|
-
Le(h), t.insertObject(r,
|
|
598
|
+
if (i)
|
|
599
|
+
Le(h), t.insertObject(r, s, h);
|
|
600
600
|
else {
|
|
601
|
-
const u = t.insertObject(r,
|
|
602
|
-
Ue(t, u, [...n,
|
|
601
|
+
const u = t.insertObject(r, s, "");
|
|
602
|
+
Ue(t, u, [...n, s]).splice(0, 0, ...h);
|
|
603
603
|
}
|
|
604
604
|
break;
|
|
605
605
|
}
|
|
606
606
|
case "map": {
|
|
607
|
-
const u = t.insertObject(r,
|
|
607
|
+
const u = t.insertObject(r, s, {}), b = He(t, u, i, [...n, s]);
|
|
608
608
|
for (const x in h)
|
|
609
609
|
b[x] = h[x];
|
|
610
610
|
break;
|
|
611
611
|
}
|
|
612
612
|
default:
|
|
613
|
-
t.insert(r,
|
|
613
|
+
t.insert(r, s, h, g);
|
|
614
614
|
}
|
|
615
|
-
|
|
615
|
+
s += 1;
|
|
616
616
|
}
|
|
617
617
|
return p;
|
|
618
618
|
},
|
|
619
|
-
unshift(...
|
|
620
|
-
return this.splice(0, 0, ...
|
|
619
|
+
unshift(...s) {
|
|
620
|
+
return this.splice(0, 0, ...s), t.length(r);
|
|
621
621
|
},
|
|
622
622
|
entries() {
|
|
623
|
-
let
|
|
623
|
+
let s = 0;
|
|
624
624
|
return {
|
|
625
625
|
next: () => {
|
|
626
|
-
const
|
|
627
|
-
return
|
|
626
|
+
const a = re(e, s);
|
|
627
|
+
return a === void 0 ? { value: void 0, done: !0 } : { value: [s++, a], done: !1 };
|
|
628
628
|
},
|
|
629
629
|
[Symbol.iterator]() {
|
|
630
630
|
return this;
|
|
@@ -632,21 +632,21 @@ function xt(e) {
|
|
|
632
632
|
};
|
|
633
633
|
},
|
|
634
634
|
keys() {
|
|
635
|
-
let
|
|
636
|
-
const
|
|
635
|
+
let s = 0;
|
|
636
|
+
const f = t.length(r);
|
|
637
637
|
return {
|
|
638
|
-
next: () =>
|
|
638
|
+
next: () => s < f ? { value: s++, done: !1 } : { value: void 0, done: !0 },
|
|
639
639
|
[Symbol.iterator]() {
|
|
640
640
|
return this;
|
|
641
641
|
}
|
|
642
642
|
};
|
|
643
643
|
},
|
|
644
644
|
values() {
|
|
645
|
-
let
|
|
645
|
+
let s = 0;
|
|
646
646
|
return {
|
|
647
647
|
next: () => {
|
|
648
|
-
const
|
|
649
|
-
return
|
|
648
|
+
const a = re(e, s++);
|
|
649
|
+
return a === void 0 ? { value: void 0, done: !0 } : { value: a, done: !1 };
|
|
650
650
|
},
|
|
651
651
|
[Symbol.iterator]() {
|
|
652
652
|
return this;
|
|
@@ -654,15 +654,15 @@ function xt(e) {
|
|
|
654
654
|
};
|
|
655
655
|
},
|
|
656
656
|
toArray() {
|
|
657
|
-
const
|
|
658
|
-
let
|
|
657
|
+
const s = [];
|
|
658
|
+
let f;
|
|
659
659
|
do
|
|
660
|
-
|
|
661
|
-
while (
|
|
662
|
-
return
|
|
660
|
+
f = re(e, s.length), f !== void 0 && s.push(f);
|
|
661
|
+
while (f !== void 0);
|
|
662
|
+
return s;
|
|
663
663
|
},
|
|
664
|
-
map(
|
|
665
|
-
return this.toArray().map(
|
|
664
|
+
map(s) {
|
|
665
|
+
return this.toArray().map(s);
|
|
666
666
|
},
|
|
667
667
|
toString() {
|
|
668
668
|
return this.toArray().toString();
|
|
@@ -670,100 +670,100 @@ function xt(e) {
|
|
|
670
670
|
toLocaleString() {
|
|
671
671
|
return this.toArray().toLocaleString();
|
|
672
672
|
},
|
|
673
|
-
forEach(
|
|
674
|
-
return this.toArray().forEach(
|
|
673
|
+
forEach(s) {
|
|
674
|
+
return this.toArray().forEach(s);
|
|
675
675
|
},
|
|
676
676
|
// todo: real concat function is different
|
|
677
|
-
concat(
|
|
678
|
-
return this.toArray().concat(
|
|
677
|
+
concat(s) {
|
|
678
|
+
return this.toArray().concat(s);
|
|
679
679
|
},
|
|
680
|
-
every(
|
|
681
|
-
return this.toArray().every(
|
|
680
|
+
every(s) {
|
|
681
|
+
return this.toArray().every(s);
|
|
682
682
|
},
|
|
683
|
-
filter(
|
|
684
|
-
return this.toArray().filter(
|
|
683
|
+
filter(s) {
|
|
684
|
+
return this.toArray().filter(s);
|
|
685
685
|
},
|
|
686
|
-
find(
|
|
687
|
-
let
|
|
688
|
-
for (const
|
|
689
|
-
if (
|
|
690
|
-
return
|
|
691
|
-
|
|
686
|
+
find(s) {
|
|
687
|
+
let f = 0;
|
|
688
|
+
for (const a of this) {
|
|
689
|
+
if (s(a, f))
|
|
690
|
+
return a;
|
|
691
|
+
f += 1;
|
|
692
692
|
}
|
|
693
693
|
},
|
|
694
|
-
findIndex(
|
|
695
|
-
let
|
|
696
|
-
for (const
|
|
697
|
-
if (
|
|
698
|
-
return
|
|
699
|
-
|
|
694
|
+
findIndex(s) {
|
|
695
|
+
let f = 0;
|
|
696
|
+
for (const a of this) {
|
|
697
|
+
if (s(a, f))
|
|
698
|
+
return f;
|
|
699
|
+
f += 1;
|
|
700
700
|
}
|
|
701
701
|
return -1;
|
|
702
702
|
},
|
|
703
|
-
includes(
|
|
704
|
-
return this.find((
|
|
703
|
+
includes(s) {
|
|
704
|
+
return this.find((f) => f === s) !== void 0;
|
|
705
705
|
},
|
|
706
|
-
join(
|
|
707
|
-
return this.toArray().join(
|
|
706
|
+
join(s) {
|
|
707
|
+
return this.toArray().join(s);
|
|
708
708
|
},
|
|
709
|
-
reduce(
|
|
710
|
-
return this.toArray().reduce(
|
|
709
|
+
reduce(s, f) {
|
|
710
|
+
return this.toArray().reduce(s, f);
|
|
711
711
|
},
|
|
712
|
-
reduceRight(
|
|
713
|
-
return this.toArray().reduceRight(
|
|
712
|
+
reduceRight(s, f) {
|
|
713
|
+
return this.toArray().reduceRight(s, f);
|
|
714
714
|
},
|
|
715
|
-
lastIndexOf(
|
|
716
|
-
return this.toArray().lastIndexOf(
|
|
715
|
+
lastIndexOf(s, f = 1 / 0) {
|
|
716
|
+
return this.toArray().lastIndexOf(s, f);
|
|
717
717
|
},
|
|
718
|
-
slice(
|
|
719
|
-
return this.toArray().slice(
|
|
718
|
+
slice(s, f) {
|
|
719
|
+
return this.toArray().slice(s, f);
|
|
720
720
|
},
|
|
721
|
-
some(
|
|
722
|
-
let
|
|
723
|
-
for (const
|
|
724
|
-
if (
|
|
721
|
+
some(s) {
|
|
722
|
+
let f = 0;
|
|
723
|
+
for (const a of this) {
|
|
724
|
+
if (s(a, f))
|
|
725
725
|
return !0;
|
|
726
|
-
|
|
726
|
+
f += 1;
|
|
727
727
|
}
|
|
728
728
|
return !1;
|
|
729
729
|
},
|
|
730
730
|
[Symbol.iterator]: function* () {
|
|
731
|
-
let
|
|
732
|
-
for (;
|
|
733
|
-
yield
|
|
731
|
+
let s = 0, f = re(e, s);
|
|
732
|
+
for (; f !== void 0; )
|
|
733
|
+
yield f, s += 1, f = re(e, s);
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
736
|
}
|
|
737
737
|
function Ir(e) {
|
|
738
738
|
const { context: t, objectId: r } = e;
|
|
739
739
|
return {
|
|
740
|
-
set(
|
|
741
|
-
return this[
|
|
740
|
+
set(i, o) {
|
|
741
|
+
return this[i] = o;
|
|
742
742
|
},
|
|
743
|
-
get(
|
|
744
|
-
return this[
|
|
743
|
+
get(i) {
|
|
744
|
+
return this[i];
|
|
745
745
|
},
|
|
746
746
|
toString() {
|
|
747
747
|
return t.text(r).replace(//g, "");
|
|
748
748
|
},
|
|
749
749
|
toSpans() {
|
|
750
|
-
const
|
|
750
|
+
const i = [];
|
|
751
751
|
let o = "";
|
|
752
|
-
const
|
|
753
|
-
for (let
|
|
754
|
-
const
|
|
755
|
-
typeof
|
|
752
|
+
const s = t.length(r);
|
|
753
|
+
for (let f = 0; f < s; f++) {
|
|
754
|
+
const a = this[f];
|
|
755
|
+
typeof a == "string" ? o += a : (o.length > 0 && (i.push(o), o = ""), i.push(a));
|
|
756
756
|
}
|
|
757
|
-
return o.length > 0 &&
|
|
757
|
+
return o.length > 0 && i.push(o), i;
|
|
758
758
|
},
|
|
759
759
|
toJSON() {
|
|
760
760
|
return this.toString();
|
|
761
761
|
},
|
|
762
|
-
indexOf(
|
|
763
|
-
return t.text(r).indexOf(
|
|
762
|
+
indexOf(i, o = 0) {
|
|
763
|
+
return t.text(r).indexOf(i, o);
|
|
764
764
|
},
|
|
765
|
-
insertAt(
|
|
766
|
-
o.every((
|
|
765
|
+
insertAt(i, ...o) {
|
|
766
|
+
o.every((s) => typeof s == "string") ? t.splice(r, i, 0, o.join("")) : xt(e).insertAt(i, ...o);
|
|
767
767
|
}
|
|
768
768
|
};
|
|
769
769
|
}
|
|
@@ -822,19 +822,19 @@ var it = { exports: {} }, qe, It;
|
|
|
822
822
|
function Rr() {
|
|
823
823
|
if (It) return qe;
|
|
824
824
|
It = 1;
|
|
825
|
-
var e = 1e3, t = e * 60, r = t * 60, n = r * 24,
|
|
825
|
+
var e = 1e3, t = e * 60, r = t * 60, n = r * 24, i = n * 7, o = n * 365.25;
|
|
826
826
|
qe = function(d, h) {
|
|
827
827
|
h = h || {};
|
|
828
828
|
var g = typeof d;
|
|
829
829
|
if (g === "string" && d.length > 0)
|
|
830
|
-
return
|
|
830
|
+
return s(d);
|
|
831
831
|
if (g === "number" && isFinite(d))
|
|
832
|
-
return h.long ?
|
|
832
|
+
return h.long ? a(d) : f(d);
|
|
833
833
|
throw new Error(
|
|
834
834
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(d)
|
|
835
835
|
);
|
|
836
836
|
};
|
|
837
|
-
function
|
|
837
|
+
function s(d) {
|
|
838
838
|
if (d = String(d), !(d.length > 100)) {
|
|
839
839
|
var h = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
840
840
|
d
|
|
@@ -851,7 +851,7 @@ function Rr() {
|
|
|
851
851
|
case "weeks":
|
|
852
852
|
case "week":
|
|
853
853
|
case "w":
|
|
854
|
-
return g *
|
|
854
|
+
return g * i;
|
|
855
855
|
case "days":
|
|
856
856
|
case "day":
|
|
857
857
|
case "d":
|
|
@@ -886,11 +886,11 @@ function Rr() {
|
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function f(d) {
|
|
890
890
|
var h = Math.abs(d);
|
|
891
891
|
return h >= n ? Math.round(d / n) + "d" : h >= r ? Math.round(d / r) + "h" : h >= t ? Math.round(d / t) + "m" : h >= e ? Math.round(d / e) + "s" : d + "ms";
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function a(d) {
|
|
894
894
|
var h = Math.abs(d);
|
|
895
895
|
return h >= n ? p(d, h, n, "day") : h >= r ? p(d, h, r, "hour") : h >= t ? p(d, h, t, "minute") : h >= e ? p(d, h, e, "second") : d + " ms";
|
|
896
896
|
}
|
|
@@ -901,7 +901,7 @@ function Rr() {
|
|
|
901
901
|
return qe;
|
|
902
902
|
}
|
|
903
903
|
function Br(e) {
|
|
904
|
-
r.debug = r, r.default = r, r.coerce =
|
|
904
|
+
r.debug = r, r.default = r, r.coerce = a, r.disable = o, r.enable = i, r.enabled = s, r.humanize = Rr(), r.destroy = p, Object.keys(e).forEach((d) => {
|
|
905
905
|
r[d] = e[d];
|
|
906
906
|
}), r.names = [], r.skips = [], r.formatters = {};
|
|
907
907
|
function t(d) {
|
|
@@ -944,7 +944,7 @@ function Br(e) {
|
|
|
944
944
|
const g = r(this.namespace + (typeof h > "u" ? ":" : h) + d);
|
|
945
945
|
return g.log = this.log, g;
|
|
946
946
|
}
|
|
947
|
-
function
|
|
947
|
+
function i(d) {
|
|
948
948
|
r.save(d), r.namespaces = d, r.names = [], r.skips = [];
|
|
949
949
|
let h;
|
|
950
950
|
const g = (typeof d == "string" ? d : "").split(/[\s,]+/), u = g.length;
|
|
@@ -953,12 +953,12 @@ function Br(e) {
|
|
|
953
953
|
}
|
|
954
954
|
function o() {
|
|
955
955
|
const d = [
|
|
956
|
-
...r.names.map(
|
|
957
|
-
...r.skips.map(
|
|
956
|
+
...r.names.map(f),
|
|
957
|
+
...r.skips.map(f).map((h) => "-" + h)
|
|
958
958
|
].join(",");
|
|
959
959
|
return r.enable(""), d;
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function s(d) {
|
|
962
962
|
if (d[d.length - 1] === "*")
|
|
963
963
|
return !0;
|
|
964
964
|
let h, g;
|
|
@@ -970,10 +970,10 @@ function Br(e) {
|
|
|
970
970
|
return !0;
|
|
971
971
|
return !1;
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function f(d) {
|
|
974
974
|
return d.toString().substring(2, d.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function a(d) {
|
|
977
977
|
return d instanceof Error ? d.stack || d.message : d;
|
|
978
978
|
}
|
|
979
979
|
function p() {
|
|
@@ -983,10 +983,10 @@ function Br(e) {
|
|
|
983
983
|
}
|
|
984
984
|
var Tr = Br;
|
|
985
985
|
(function(e, t) {
|
|
986
|
-
t.formatArgs = n, t.save =
|
|
987
|
-
let
|
|
986
|
+
t.formatArgs = n, t.save = i, t.load = o, t.useColors = r, t.storage = s(), t.destroy = /* @__PURE__ */ (() => {
|
|
987
|
+
let a = !1;
|
|
988
988
|
return () => {
|
|
989
|
-
|
|
989
|
+
a || (a = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
|
|
990
990
|
};
|
|
991
991
|
})(), t.colors = [
|
|
992
992
|
"#0000CC",
|
|
@@ -1071,50 +1071,50 @@ var Tr = Br;
|
|
|
1071
1071
|
return !0;
|
|
1072
1072
|
if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
|
|
1073
1073
|
return !1;
|
|
1074
|
-
let
|
|
1074
|
+
let a;
|
|
1075
1075
|
return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
1076
1076
|
typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
1077
1077
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
1078
|
-
typeof navigator < "u" && navigator.userAgent && (
|
|
1078
|
+
typeof navigator < "u" && navigator.userAgent && (a = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(a[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
1079
1079
|
typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
1080
1080
|
}
|
|
1081
|
-
function n(
|
|
1082
|
-
if (
|
|
1081
|
+
function n(a) {
|
|
1082
|
+
if (a[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + a[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff), !this.useColors)
|
|
1083
1083
|
return;
|
|
1084
1084
|
const p = "color: " + this.color;
|
|
1085
|
-
|
|
1085
|
+
a.splice(1, 0, p, "color: inherit");
|
|
1086
1086
|
let d = 0, h = 0;
|
|
1087
|
-
|
|
1087
|
+
a[0].replace(/%[a-zA-Z%]/g, (g) => {
|
|
1088
1088
|
g !== "%%" && (d++, g === "%c" && (h = d));
|
|
1089
|
-
}),
|
|
1089
|
+
}), a.splice(h, 0, p);
|
|
1090
1090
|
}
|
|
1091
1091
|
t.log = console.debug || console.log || (() => {
|
|
1092
1092
|
});
|
|
1093
|
-
function
|
|
1093
|
+
function i(a) {
|
|
1094
1094
|
try {
|
|
1095
|
-
|
|
1095
|
+
a ? t.storage.setItem("debug", a) : t.storage.removeItem("debug");
|
|
1096
1096
|
} catch {
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
1099
|
function o() {
|
|
1100
|
-
let
|
|
1100
|
+
let a;
|
|
1101
1101
|
try {
|
|
1102
|
-
|
|
1102
|
+
a = t.storage.getItem("debug");
|
|
1103
1103
|
} catch {
|
|
1104
1104
|
}
|
|
1105
|
-
return !
|
|
1105
|
+
return !a && typeof process < "u" && "env" in process && (a = process.env.DEBUG), a;
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function s() {
|
|
1108
1108
|
try {
|
|
1109
1109
|
return localStorage;
|
|
1110
1110
|
} catch {
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
1113
|
e.exports = Tr(t);
|
|
1114
|
-
const { formatters:
|
|
1115
|
-
|
|
1114
|
+
const { formatters: f } = e.exports;
|
|
1115
|
+
f.j = function(a) {
|
|
1116
1116
|
try {
|
|
1117
|
-
return JSON.stringify(
|
|
1117
|
+
return JSON.stringify(a);
|
|
1118
1118
|
} catch (p) {
|
|
1119
1119
|
return "[UnexpectedJSONParseError]: " + p.message;
|
|
1120
1120
|
}
|
|
@@ -1128,38 +1128,38 @@ var Xt = { exports: {} };
|
|
|
1128
1128
|
function n() {
|
|
1129
1129
|
}
|
|
1130
1130
|
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (r = !1));
|
|
1131
|
-
function
|
|
1132
|
-
this.fn =
|
|
1131
|
+
function i(a, p, d) {
|
|
1132
|
+
this.fn = a, this.context = p, this.once = d || !1;
|
|
1133
1133
|
}
|
|
1134
|
-
function o(
|
|
1134
|
+
function o(a, p, d, h, g) {
|
|
1135
1135
|
if (typeof d != "function")
|
|
1136
1136
|
throw new TypeError("The listener must be a function");
|
|
1137
|
-
var u = new
|
|
1138
|
-
return
|
|
1137
|
+
var u = new i(d, h || a, g), b = r ? r + p : p;
|
|
1138
|
+
return a._events[b] ? a._events[b].fn ? a._events[b] = [a._events[b], u] : a._events[b].push(u) : (a._events[b] = u, a._eventsCount++), a;
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1141
|
-
--
|
|
1140
|
+
function s(a, p) {
|
|
1141
|
+
--a._eventsCount === 0 ? a._events = new n() : delete a._events[p];
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function f() {
|
|
1144
1144
|
this._events = new n(), this._eventsCount = 0;
|
|
1145
1145
|
}
|
|
1146
|
-
|
|
1146
|
+
f.prototype.eventNames = function() {
|
|
1147
1147
|
var p = [], d, h;
|
|
1148
1148
|
if (this._eventsCount === 0) return p;
|
|
1149
1149
|
for (h in d = this._events)
|
|
1150
1150
|
t.call(d, h) && p.push(r ? h.slice(1) : h);
|
|
1151
1151
|
return Object.getOwnPropertySymbols ? p.concat(Object.getOwnPropertySymbols(d)) : p;
|
|
1152
|
-
},
|
|
1152
|
+
}, f.prototype.listeners = function(p) {
|
|
1153
1153
|
var d = r ? r + p : p, h = this._events[d];
|
|
1154
1154
|
if (!h) return [];
|
|
1155
1155
|
if (h.fn) return [h.fn];
|
|
1156
1156
|
for (var g = 0, u = h.length, b = new Array(u); g < u; g++)
|
|
1157
1157
|
b[g] = h[g].fn;
|
|
1158
1158
|
return b;
|
|
1159
|
-
},
|
|
1159
|
+
}, f.prototype.listenerCount = function(p) {
|
|
1160
1160
|
var d = r ? r + p : p, h = this._events[d];
|
|
1161
1161
|
return h ? h.fn ? 1 : h.length : 0;
|
|
1162
|
-
},
|
|
1162
|
+
}, f.prototype.emit = function(p, d, h, g, u, b) {
|
|
1163
1163
|
var x = r ? r + p : p;
|
|
1164
1164
|
if (!this._events[x]) return !1;
|
|
1165
1165
|
var C = this._events[x], I = arguments.length, U, v;
|
|
@@ -1204,28 +1204,28 @@ var Xt = { exports: {} };
|
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
1206
|
return !0;
|
|
1207
|
-
},
|
|
1207
|
+
}, f.prototype.on = function(p, d, h) {
|
|
1208
1208
|
return o(this, p, d, h, !1);
|
|
1209
|
-
},
|
|
1209
|
+
}, f.prototype.once = function(p, d, h) {
|
|
1210
1210
|
return o(this, p, d, h, !0);
|
|
1211
|
-
},
|
|
1211
|
+
}, f.prototype.removeListener = function(p, d, h, g) {
|
|
1212
1212
|
var u = r ? r + p : p;
|
|
1213
1213
|
if (!this._events[u]) return this;
|
|
1214
1214
|
if (!d)
|
|
1215
|
-
return
|
|
1215
|
+
return s(this, u), this;
|
|
1216
1216
|
var b = this._events[u];
|
|
1217
1217
|
if (b.fn)
|
|
1218
|
-
b.fn === d && (!g || b.once) && (!h || b.context === h) &&
|
|
1218
|
+
b.fn === d && (!g || b.once) && (!h || b.context === h) && s(this, u);
|
|
1219
1219
|
else {
|
|
1220
1220
|
for (var x = 0, C = [], I = b.length; x < I; x++)
|
|
1221
1221
|
(b[x].fn !== d || g && !b[x].once || h && b[x].context !== h) && C.push(b[x]);
|
|
1222
|
-
C.length ? this._events[u] = C.length === 1 ? C[0] : C :
|
|
1222
|
+
C.length ? this._events[u] = C.length === 1 ? C[0] : C : s(this, u);
|
|
1223
1223
|
}
|
|
1224
1224
|
return this;
|
|
1225
|
-
},
|
|
1225
|
+
}, f.prototype.removeAllListeners = function(p) {
|
|
1226
1226
|
var d;
|
|
1227
|
-
return p ? (d = r ? r + p : p, this._events[d] &&
|
|
1228
|
-
},
|
|
1227
|
+
return p ? (d = r ? r + p : p, this._events[d] && s(this, d)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
1228
|
+
}, f.prototype.off = f.prototype.removeListener, f.prototype.addListener = f.prototype.on, f.prefixed = r, f.EventEmitter = f, e.exports = f;
|
|
1229
1229
|
})(Xt);
|
|
1230
1230
|
var Lr = Xt.exports;
|
|
1231
1231
|
const Vr = /* @__PURE__ */ We(Lr);
|
|
@@ -1287,16 +1287,16 @@ Je.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
1287
1287
|
return E instanceof Uint8Array || E != null && typeof E == "object" && E.constructor.name === "Uint8Array";
|
|
1288
1288
|
}
|
|
1289
1289
|
e.isBytes = n;
|
|
1290
|
-
const
|
|
1291
|
-
e.u8 =
|
|
1290
|
+
const i = (E) => new Uint8Array(E.buffer, E.byteOffset, E.byteLength);
|
|
1291
|
+
e.u8 = i;
|
|
1292
1292
|
const o = (E) => new Uint32Array(E.buffer, E.byteOffset, Math.floor(E.byteLength / 4));
|
|
1293
1293
|
e.u32 = o;
|
|
1294
|
-
const
|
|
1295
|
-
e.createView =
|
|
1296
|
-
const
|
|
1297
|
-
e.rotr =
|
|
1298
|
-
const
|
|
1299
|
-
e.rotl =
|
|
1294
|
+
const s = (E) => new DataView(E.buffer, E.byteOffset, E.byteLength);
|
|
1295
|
+
e.createView = s;
|
|
1296
|
+
const f = (E, l) => E << 32 - l | E >>> l;
|
|
1297
|
+
e.rotr = f;
|
|
1298
|
+
const a = (E, l) => E << l | E >>> 32 - l >>> 0;
|
|
1299
|
+
e.rotl = a, e.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
1300
1300
|
const p = (E) => E << 24 & 4278190080 | E << 8 & 16711680 | E >>> 8 & 65280 | E >>> 24 & 255;
|
|
1301
1301
|
e.byteSwap = p, e.byteSwapIfBE = e.isLE ? (E) => E : (E) => (0, e.byteSwap)(E);
|
|
1302
1302
|
function d(E) {
|
|
@@ -1418,50 +1418,50 @@ const Ze = q, Ae = St;
|
|
|
1418
1418
|
function $r(e, t, r, n) {
|
|
1419
1419
|
if (typeof e.setBigUint64 == "function")
|
|
1420
1420
|
return e.setBigUint64(t, r, n);
|
|
1421
|
-
const
|
|
1422
|
-
e.setUint32(t +
|
|
1421
|
+
const i = BigInt(32), o = BigInt(4294967295), s = Number(r >> i & o), f = Number(r & o), a = n ? 4 : 0, p = n ? 0 : 4;
|
|
1422
|
+
e.setUint32(t + a, s, n), e.setUint32(t + p, f, n);
|
|
1423
1423
|
}
|
|
1424
1424
|
const zr = (e, t, r) => e & t ^ ~e & r;
|
|
1425
1425
|
de.Chi = zr;
|
|
1426
1426
|
const Hr = (e, t, r) => e & t ^ e & r ^ t & r;
|
|
1427
1427
|
de.Maj = Hr;
|
|
1428
1428
|
class Kr extends Ae.Hash {
|
|
1429
|
-
constructor(t, r, n,
|
|
1430
|
-
super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE =
|
|
1429
|
+
constructor(t, r, n, i) {
|
|
1430
|
+
super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = i, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = (0, Ae.createView)(this.buffer);
|
|
1431
1431
|
}
|
|
1432
1432
|
update(t) {
|
|
1433
1433
|
(0, Ze.exists)(this);
|
|
1434
|
-
const { view: r, buffer: n, blockLen:
|
|
1434
|
+
const { view: r, buffer: n, blockLen: i } = this;
|
|
1435
1435
|
t = (0, Ae.toBytes)(t);
|
|
1436
1436
|
const o = t.length;
|
|
1437
|
-
for (let
|
|
1438
|
-
const
|
|
1439
|
-
if (
|
|
1440
|
-
const
|
|
1441
|
-
for (;
|
|
1442
|
-
this.process(
|
|
1437
|
+
for (let s = 0; s < o; ) {
|
|
1438
|
+
const f = Math.min(i - this.pos, o - s);
|
|
1439
|
+
if (f === i) {
|
|
1440
|
+
const a = (0, Ae.createView)(t);
|
|
1441
|
+
for (; i <= o - s; s += i)
|
|
1442
|
+
this.process(a, s);
|
|
1443
1443
|
continue;
|
|
1444
1444
|
}
|
|
1445
|
-
n.set(t.subarray(
|
|
1445
|
+
n.set(t.subarray(s, s + f), this.pos), this.pos += f, s += f, this.pos === i && (this.process(r, 0), this.pos = 0);
|
|
1446
1446
|
}
|
|
1447
1447
|
return this.length += t.length, this.roundClean(), this;
|
|
1448
1448
|
}
|
|
1449
1449
|
digestInto(t) {
|
|
1450
1450
|
(0, Ze.exists)(this), (0, Ze.output)(t, this), this.finished = !0;
|
|
1451
|
-
const { buffer: r, view: n, blockLen:
|
|
1452
|
-
let { pos:
|
|
1453
|
-
r[
|
|
1454
|
-
for (let h =
|
|
1451
|
+
const { buffer: r, view: n, blockLen: i, isLE: o } = this;
|
|
1452
|
+
let { pos: s } = this;
|
|
1453
|
+
r[s++] = 128, this.buffer.subarray(s).fill(0), this.padOffset > i - s && (this.process(n, 0), s = 0);
|
|
1454
|
+
for (let h = s; h < i; h++)
|
|
1455
1455
|
r[h] = 0;
|
|
1456
|
-
$r(n,
|
|
1457
|
-
const
|
|
1458
|
-
if (
|
|
1456
|
+
$r(n, i - 8, BigInt(this.length * 8), o), this.process(n, 0);
|
|
1457
|
+
const f = (0, Ae.createView)(t), a = this.outputLen;
|
|
1458
|
+
if (a % 4)
|
|
1459
1459
|
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
1460
|
-
const p =
|
|
1460
|
+
const p = a / 4, d = this.get();
|
|
1461
1461
|
if (p > d.length)
|
|
1462
1462
|
throw new Error("_sha2: outputLen bigger than state");
|
|
1463
1463
|
for (let h = 0; h < p; h++)
|
|
1464
|
-
|
|
1464
|
+
f.setUint32(4 * h, d[h], o);
|
|
1465
1465
|
}
|
|
1466
1466
|
digest() {
|
|
1467
1467
|
const { buffer: t, outputLen: r } = this;
|
|
@@ -1471,8 +1471,8 @@ class Kr extends Ae.Hash {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
_cloneInto(t) {
|
|
1473
1473
|
t || (t = new this.constructor()), t.set(...this.get());
|
|
1474
|
-
const { blockLen: r, buffer: n, length:
|
|
1475
|
-
return t.length =
|
|
1474
|
+
const { blockLen: r, buffer: n, length: i, finished: o, destroyed: s, pos: f } = this;
|
|
1475
|
+
return t.length = i, t.pos = f, t.finished = o, t.destroyed = s, i % r && t.buffer.set(n), t;
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
1478
|
de.HashMD = Kr;
|
|
@@ -1558,12 +1558,12 @@ class tr extends Ye.HashMD {
|
|
|
1558
1558
|
super(64, 32, 8, !1), this.A = le[0] | 0, this.B = le[1] | 0, this.C = le[2] | 0, this.D = le[3] | 0, this.E = le[4] | 0, this.F = le[5] | 0, this.G = le[6] | 0, this.H = le[7] | 0;
|
|
1559
1559
|
}
|
|
1560
1560
|
get() {
|
|
1561
|
-
const { A: t, B: r, C: n, D:
|
|
1562
|
-
return [t, r, n,
|
|
1561
|
+
const { A: t, B: r, C: n, D: i, E: o, F: s, G: f, H: a } = this;
|
|
1562
|
+
return [t, r, n, i, o, s, f, a];
|
|
1563
1563
|
}
|
|
1564
1564
|
// prettier-ignore
|
|
1565
|
-
set(t, r, n,
|
|
1566
|
-
this.A = t | 0, this.B = r | 0, this.C = n | 0, this.D =
|
|
1565
|
+
set(t, r, n, i, o, s, f, a) {
|
|
1566
|
+
this.A = t | 0, this.B = r | 0, this.C = n | 0, this.D = i | 0, this.E = o | 0, this.F = s | 0, this.G = f | 0, this.H = a | 0;
|
|
1567
1567
|
}
|
|
1568
1568
|
process(t, r) {
|
|
1569
1569
|
for (let h = 0; h < 16; h++, r += 4)
|
|
@@ -1572,12 +1572,12 @@ class tr extends Ye.HashMD {
|
|
|
1572
1572
|
const g = ue[h - 15], u = ue[h - 2], b = (0, te.rotr)(g, 7) ^ (0, te.rotr)(g, 18) ^ g >>> 3, x = (0, te.rotr)(u, 17) ^ (0, te.rotr)(u, 19) ^ u >>> 10;
|
|
1573
1573
|
ue[h] = x + ue[h - 7] + b + ue[h - 16] | 0;
|
|
1574
1574
|
}
|
|
1575
|
-
let { A: n, B:
|
|
1575
|
+
let { A: n, B: i, C: o, D: s, E: f, F: a, G: p, H: d } = this;
|
|
1576
1576
|
for (let h = 0; h < 64; h++) {
|
|
1577
|
-
const g = (0, te.rotr)(
|
|
1578
|
-
d = p, p =
|
|
1577
|
+
const g = (0, te.rotr)(f, 6) ^ (0, te.rotr)(f, 11) ^ (0, te.rotr)(f, 25), u = d + g + (0, Ye.Chi)(f, a, p) + Wr[h] + ue[h] | 0, x = ((0, te.rotr)(n, 2) ^ (0, te.rotr)(n, 13) ^ (0, te.rotr)(n, 22)) + (0, Ye.Maj)(n, i, o) | 0;
|
|
1578
|
+
d = p, p = a, a = f, f = s + u | 0, s = o, o = i, i = n, n = u + x | 0;
|
|
1579
1579
|
}
|
|
1580
|
-
n = n + this.A | 0,
|
|
1580
|
+
n = n + this.A | 0, i = i + this.B | 0, o = o + this.C | 0, s = s + this.D | 0, f = f + this.E | 0, a = a + this.F | 0, p = p + this.G | 0, d = d + this.H | 0, this.set(n, i, o, s, f, a, p, d);
|
|
1581
1581
|
}
|
|
1582
1582
|
roundClean() {
|
|
1583
1583
|
ue.fill(0);
|
|
@@ -1599,12 +1599,12 @@ function Gr(e) {
|
|
|
1599
1599
|
for (var t = new Uint8Array(256), r = 0; r < t.length; r++)
|
|
1600
1600
|
t[r] = 255;
|
|
1601
1601
|
for (var n = 0; n < e.length; n++) {
|
|
1602
|
-
var
|
|
1602
|
+
var i = e.charAt(n), o = i.charCodeAt(0);
|
|
1603
1603
|
if (t[o] !== 255)
|
|
1604
|
-
throw new TypeError(
|
|
1604
|
+
throw new TypeError(i + " is ambiguous");
|
|
1605
1605
|
t[o] = n;
|
|
1606
1606
|
}
|
|
1607
|
-
var
|
|
1607
|
+
var s = e.length, f = e.charAt(0), a = Math.log(s) / Math.log(256), p = Math.log(256) / Math.log(s);
|
|
1608
1608
|
function d(u) {
|
|
1609
1609
|
if (u instanceof Uint8Array || (ArrayBuffer.isView(u) ? u = new Uint8Array(u.buffer, u.byteOffset, u.byteLength) : Array.isArray(u) && (u = Uint8Array.from(u))), !(u instanceof Uint8Array))
|
|
1610
1610
|
throw new TypeError("Expected Uint8Array");
|
|
@@ -1614,14 +1614,14 @@ function Gr(e) {
|
|
|
1614
1614
|
C++, b++;
|
|
1615
1615
|
for (var U = (I - C) * p + 1 >>> 0, v = new Uint8Array(U); C !== I; ) {
|
|
1616
1616
|
for (var B = u[C], M = 0, F = U - 1; (B !== 0 || M < x) && F !== -1; F--, M++)
|
|
1617
|
-
B += 256 * v[F] >>> 0, v[F] = B %
|
|
1617
|
+
B += 256 * v[F] >>> 0, v[F] = B % s >>> 0, B = B / s >>> 0;
|
|
1618
1618
|
if (B !== 0)
|
|
1619
1619
|
throw new Error("Non-zero carry");
|
|
1620
1620
|
x = M, C++;
|
|
1621
1621
|
}
|
|
1622
1622
|
for (var N = U - x; N !== U && v[N] === 0; )
|
|
1623
1623
|
N++;
|
|
1624
|
-
for (var P =
|
|
1624
|
+
for (var P = f.repeat(b); N < U; ++N)
|
|
1625
1625
|
P += e.charAt(v[N]);
|
|
1626
1626
|
return P;
|
|
1627
1627
|
}
|
|
@@ -1630,14 +1630,14 @@ function Gr(e) {
|
|
|
1630
1630
|
throw new TypeError("Expected String");
|
|
1631
1631
|
if (u.length === 0)
|
|
1632
1632
|
return new Uint8Array();
|
|
1633
|
-
for (var b = 0, x = 0, C = 0; u[b] ===
|
|
1633
|
+
for (var b = 0, x = 0, C = 0; u[b] === f; )
|
|
1634
1634
|
x++, b++;
|
|
1635
|
-
for (var I = (u.length - b) *
|
|
1635
|
+
for (var I = (u.length - b) * a + 1 >>> 0, U = new Uint8Array(I); u[b]; ) {
|
|
1636
1636
|
var v = t[u.charCodeAt(b)];
|
|
1637
1637
|
if (v === 255)
|
|
1638
1638
|
return;
|
|
1639
1639
|
for (var B = 0, M = I - 1; (v !== 0 || B < C) && M !== -1; M--, B++)
|
|
1640
|
-
v +=
|
|
1640
|
+
v += s * U[M] >>> 0, U[M] = v % 256 >>> 0, v = v / 256 >>> 0;
|
|
1641
1641
|
if (v !== 0)
|
|
1642
1642
|
throw new Error("Non-zero carry");
|
|
1643
1643
|
C = B, b++;
|
|
@@ -1652,7 +1652,7 @@ function Gr(e) {
|
|
|
1652
1652
|
var b = h(u);
|
|
1653
1653
|
if (b)
|
|
1654
1654
|
return b;
|
|
1655
|
-
throw new Error("Non-base" +
|
|
1655
|
+
throw new Error("Non-base" + s + " character");
|
|
1656
1656
|
}
|
|
1657
1657
|
return {
|
|
1658
1658
|
encode: d,
|
|
@@ -1664,27 +1664,27 @@ var Xr = Gr;
|
|
|
1664
1664
|
const qr = Xr, Zr = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
1665
1665
|
var Yr = qr(Zr), Qe = Yr, Qr = function(e) {
|
|
1666
1666
|
function t(o) {
|
|
1667
|
-
var
|
|
1668
|
-
return p.set(
|
|
1667
|
+
var s = Uint8Array.from(o), f = e(s), a = s.length + 4, p = new Uint8Array(a);
|
|
1668
|
+
return p.set(s, 0), p.set(f.subarray(0, 4), s.length), Qe.encode(p, a);
|
|
1669
1669
|
}
|
|
1670
1670
|
function r(o) {
|
|
1671
|
-
var
|
|
1672
|
-
if (!(
|
|
1673
|
-
return
|
|
1671
|
+
var s = o.slice(0, -4), f = o.slice(-4), a = e(s);
|
|
1672
|
+
if (!(f[0] ^ a[0] | f[1] ^ a[1] | f[2] ^ a[2] | f[3] ^ a[3]))
|
|
1673
|
+
return s;
|
|
1674
1674
|
}
|
|
1675
1675
|
function n(o) {
|
|
1676
|
-
var
|
|
1677
|
-
if (
|
|
1678
|
-
return r(
|
|
1676
|
+
var s = Qe.decodeUnsafe(o);
|
|
1677
|
+
if (s)
|
|
1678
|
+
return r(s);
|
|
1679
1679
|
}
|
|
1680
|
-
function
|
|
1681
|
-
var
|
|
1682
|
-
if (!
|
|
1683
|
-
return
|
|
1680
|
+
function i(o) {
|
|
1681
|
+
var s = Qe.decode(o), f = r(s);
|
|
1682
|
+
if (!f) throw new Error("Invalid checksum");
|
|
1683
|
+
return f;
|
|
1684
1684
|
}
|
|
1685
1685
|
return {
|
|
1686
1686
|
encode: t,
|
|
1687
|
-
decode:
|
|
1687
|
+
decode: i,
|
|
1688
1688
|
decodeUnsafe: n
|
|
1689
1689
|
};
|
|
1690
1690
|
}, { sha256: Ut } = ve, en = Qr;
|
|
@@ -1693,12 +1693,12 @@ function tn(e) {
|
|
|
1693
1693
|
}
|
|
1694
1694
|
var rn = en(tn);
|
|
1695
1695
|
const nn = /* @__PURE__ */ We(rn), rr = "automerge:", nr = (e) => {
|
|
1696
|
-
const t = new RegExp(`^${rr}(\\w+)$`), [, r] = e.match(t) || [], n = r,
|
|
1697
|
-
if (!
|
|
1696
|
+
const t = new RegExp(`^${rr}(\\w+)$`), [, r] = e.match(t) || [], n = r, i = sr(n);
|
|
1697
|
+
if (!i)
|
|
1698
1698
|
throw new Error("Invalid document URL: " + e);
|
|
1699
1699
|
return {
|
|
1700
1700
|
/** unencoded DocumentId */
|
|
1701
|
-
binaryDocumentId:
|
|
1701
|
+
binaryDocumentId: i,
|
|
1702
1702
|
/** encoded DocumentId */
|
|
1703
1703
|
documentId: n
|
|
1704
1704
|
};
|
|
@@ -1761,24 +1761,24 @@ class je {
|
|
|
1761
1761
|
encodeKeys(t) {
|
|
1762
1762
|
if (!this._keyMap) return t;
|
|
1763
1763
|
let r = /* @__PURE__ */ new Map();
|
|
1764
|
-
for (let [n,
|
|
1764
|
+
for (let [n, i] of Object.entries(t)) r.set(this._keyMap.hasOwnProperty(n) ? this._keyMap[n] : n, i);
|
|
1765
1765
|
return r;
|
|
1766
1766
|
}
|
|
1767
1767
|
decodeKeys(t) {
|
|
1768
1768
|
if (!this._keyMap || t.constructor.name != "Map") return t;
|
|
1769
1769
|
if (!this._mapKey) {
|
|
1770
1770
|
this._mapKey = /* @__PURE__ */ new Map();
|
|
1771
|
-
for (let [n,
|
|
1771
|
+
for (let [n, i] of Object.entries(this._keyMap)) this._mapKey.set(i, n);
|
|
1772
1772
|
}
|
|
1773
1773
|
let r = {};
|
|
1774
|
-
return t.forEach((n,
|
|
1774
|
+
return t.forEach((n, i) => r[se(this._mapKey.has(i) ? this._mapKey.get(i) : i)] = n), r;
|
|
1775
1775
|
}
|
|
1776
1776
|
mapDecode(t, r) {
|
|
1777
1777
|
let n = this.decode(t);
|
|
1778
1778
|
if (this._keyMap)
|
|
1779
1779
|
switch (n.constructor.name) {
|
|
1780
1780
|
case "Array":
|
|
1781
|
-
return n.map((
|
|
1781
|
+
return n.map((i) => this.decodeKeys(i));
|
|
1782
1782
|
}
|
|
1783
1783
|
return n;
|
|
1784
1784
|
}
|
|
@@ -1800,24 +1800,24 @@ class je {
|
|
|
1800
1800
|
return Re();
|
|
1801
1801
|
}
|
|
1802
1802
|
decodeMultiple(t, r) {
|
|
1803
|
-
let n,
|
|
1803
|
+
let n, i = 0;
|
|
1804
1804
|
try {
|
|
1805
1805
|
let o = t.length;
|
|
1806
1806
|
ke = !0;
|
|
1807
|
-
let
|
|
1807
|
+
let s = this ? this.decode(t, o) : Ct.decode(t, o);
|
|
1808
1808
|
if (r) {
|
|
1809
|
-
if (r(
|
|
1809
|
+
if (r(s) === !1)
|
|
1810
1810
|
return;
|
|
1811
1811
|
for (; w < o; )
|
|
1812
|
-
if (
|
|
1812
|
+
if (i = w, r(Re()) === !1)
|
|
1813
1813
|
return;
|
|
1814
1814
|
} else {
|
|
1815
|
-
for (n = [
|
|
1816
|
-
|
|
1815
|
+
for (n = [s]; w < o; )
|
|
1816
|
+
i = w, n.push(Re());
|
|
1817
1817
|
return n;
|
|
1818
1818
|
}
|
|
1819
1819
|
} catch (o) {
|
|
1820
|
-
throw o.lastPosition =
|
|
1820
|
+
throw o.lastPosition = i, o.values = n, o;
|
|
1821
1821
|
} finally {
|
|
1822
1822
|
ke = !1, ut();
|
|
1823
1823
|
}
|
|
@@ -1886,46 +1886,46 @@ function L() {
|
|
|
1886
1886
|
case 3:
|
|
1887
1887
|
throw new Error("Indefinite length not supported for byte or text strings");
|
|
1888
1888
|
case 4:
|
|
1889
|
-
let r = [], n,
|
|
1889
|
+
let r = [], n, i = 0;
|
|
1890
1890
|
for (; (n = L()) != we; ) {
|
|
1891
|
-
if (
|
|
1892
|
-
r[
|
|
1891
|
+
if (i >= Ce) throw new Error(`Array length exceeds ${Ce}`);
|
|
1892
|
+
r[i++] = n;
|
|
1893
1893
|
}
|
|
1894
1894
|
return t == 4 ? r : t == 3 ? r.join("") : Buffer.concat(r);
|
|
1895
1895
|
case 5:
|
|
1896
1896
|
let o;
|
|
1897
1897
|
if (D.mapsAsObjects) {
|
|
1898
|
-
let
|
|
1898
|
+
let s = {}, f = 0;
|
|
1899
1899
|
if (D.keyMap)
|
|
1900
1900
|
for (; (o = L()) != we; ) {
|
|
1901
|
-
if (
|
|
1902
|
-
|
|
1901
|
+
if (f++ >= ce) throw new Error(`Property count exceeds ${ce}`);
|
|
1902
|
+
s[se(D.decodeKey(o))] = L();
|
|
1903
1903
|
}
|
|
1904
1904
|
else
|
|
1905
1905
|
for (; (o = L()) != we; ) {
|
|
1906
|
-
if (
|
|
1907
|
-
|
|
1906
|
+
if (f++ >= ce) throw new Error(`Property count exceeds ${ce}`);
|
|
1907
|
+
s[se(o)] = L();
|
|
1908
1908
|
}
|
|
1909
|
-
return
|
|
1909
|
+
return s;
|
|
1910
1910
|
} else {
|
|
1911
1911
|
Ee && (D.mapsAsObjects = !0, Ee = !1);
|
|
1912
|
-
let
|
|
1912
|
+
let s = /* @__PURE__ */ new Map();
|
|
1913
1913
|
if (D.keyMap) {
|
|
1914
|
-
let
|
|
1914
|
+
let f = 0;
|
|
1915
1915
|
for (; (o = L()) != we; ) {
|
|
1916
|
-
if (
|
|
1916
|
+
if (f++ >= ce)
|
|
1917
1917
|
throw new Error(`Map size exceeds ${ce}`);
|
|
1918
|
-
|
|
1918
|
+
s.set(D.decodeKey(o), L());
|
|
1919
1919
|
}
|
|
1920
1920
|
} else {
|
|
1921
|
-
let
|
|
1921
|
+
let f = 0;
|
|
1922
1922
|
for (; (o = L()) != we; ) {
|
|
1923
|
-
if (
|
|
1923
|
+
if (f++ >= ce)
|
|
1924
1924
|
throw new Error(`Map size exceeds ${ce}`);
|
|
1925
|
-
|
|
1925
|
+
s.set(o, L());
|
|
1926
1926
|
}
|
|
1927
1927
|
}
|
|
1928
|
-
return
|
|
1928
|
+
return s;
|
|
1929
1929
|
}
|
|
1930
1930
|
case 7:
|
|
1931
1931
|
return we;
|
|
@@ -1946,71 +1946,71 @@ function L() {
|
|
|
1946
1946
|
if (Fe >= w)
|
|
1947
1947
|
return Ne.slice(w - $e, (w += e) - $e);
|
|
1948
1948
|
if (Fe == 0 && ge < 140 && e < 32) {
|
|
1949
|
-
let
|
|
1950
|
-
if (
|
|
1951
|
-
return
|
|
1949
|
+
let i = e < 16 ? or(e) : un(e);
|
|
1950
|
+
if (i != null)
|
|
1951
|
+
return i;
|
|
1952
1952
|
}
|
|
1953
1953
|
return ln(e);
|
|
1954
1954
|
case 4:
|
|
1955
1955
|
if (e >= Ce) throw new Error(`Array length exceeds ${Ce}`);
|
|
1956
1956
|
let r = new Array(e);
|
|
1957
|
-
for (let
|
|
1957
|
+
for (let i = 0; i < e; i++) r[i] = L();
|
|
1958
1958
|
return r;
|
|
1959
1959
|
case 5:
|
|
1960
1960
|
if (e >= ce) throw new Error(`Map size exceeds ${Ce}`);
|
|
1961
1961
|
if (D.mapsAsObjects) {
|
|
1962
|
-
let
|
|
1963
|
-
if (D.keyMap) for (let o = 0; o < e; o++)
|
|
1964
|
-
else for (let o = 0; o < e; o++)
|
|
1965
|
-
return
|
|
1962
|
+
let i = {};
|
|
1963
|
+
if (D.keyMap) for (let o = 0; o < e; o++) i[se(D.decodeKey(L()))] = L();
|
|
1964
|
+
else for (let o = 0; o < e; o++) i[se(L())] = L();
|
|
1965
|
+
return i;
|
|
1966
1966
|
} else {
|
|
1967
1967
|
Ee && (D.mapsAsObjects = !0, Ee = !1);
|
|
1968
|
-
let
|
|
1969
|
-
if (D.keyMap) for (let o = 0; o < e; o++)
|
|
1970
|
-
else for (let o = 0; o < e; o++)
|
|
1971
|
-
return
|
|
1968
|
+
let i = /* @__PURE__ */ new Map();
|
|
1969
|
+
if (D.keyMap) for (let o = 0; o < e; o++) i.set(D.decodeKey(L()), L());
|
|
1970
|
+
else for (let o = 0; o < e; o++) i.set(L(), L());
|
|
1971
|
+
return i;
|
|
1972
1972
|
}
|
|
1973
1973
|
case 6:
|
|
1974
1974
|
if (e >= Ft) {
|
|
1975
|
-
let
|
|
1976
|
-
if (
|
|
1977
|
-
return
|
|
1975
|
+
let i = K[e & 8191];
|
|
1976
|
+
if (i)
|
|
1977
|
+
return i.read || (i.read = at(i)), i.read();
|
|
1978
1978
|
if (e < 65536) {
|
|
1979
1979
|
if (e == cn) {
|
|
1980
|
-
let o = Se(),
|
|
1981
|
-
lt(
|
|
1982
|
-
let
|
|
1980
|
+
let o = Se(), s = L(), f = L();
|
|
1981
|
+
lt(s, f);
|
|
1982
|
+
let a = {};
|
|
1983
1983
|
if (D.keyMap) for (let p = 2; p < o; p++) {
|
|
1984
|
-
let d = D.decodeKey(
|
|
1985
|
-
|
|
1984
|
+
let d = D.decodeKey(f[p - 2]);
|
|
1985
|
+
a[se(d)] = L();
|
|
1986
1986
|
}
|
|
1987
1987
|
else for (let p = 2; p < o; p++) {
|
|
1988
|
-
let d =
|
|
1989
|
-
|
|
1988
|
+
let d = f[p - 2];
|
|
1989
|
+
a[se(d)] = L();
|
|
1990
1990
|
}
|
|
1991
|
-
return
|
|
1991
|
+
return a;
|
|
1992
1992
|
} else if (e == an) {
|
|
1993
|
-
let o = Se(),
|
|
1994
|
-
for (let
|
|
1995
|
-
lt(
|
|
1993
|
+
let o = Se(), s = L();
|
|
1994
|
+
for (let f = 2; f < o; f++)
|
|
1995
|
+
lt(s++, L());
|
|
1996
1996
|
return L();
|
|
1997
1997
|
} else if (e == Ft)
|
|
1998
1998
|
return wn();
|
|
1999
|
-
if (D.getShared && (vt(),
|
|
2000
|
-
return
|
|
1999
|
+
if (D.getShared && (vt(), i = K[e & 8191], i))
|
|
2000
|
+
return i.read || (i.read = at(i)), i.read();
|
|
2001
2001
|
}
|
|
2002
2002
|
}
|
|
2003
2003
|
let n = W[e];
|
|
2004
2004
|
if (n)
|
|
2005
2005
|
return n.handlesRead ? n(L) : n(L());
|
|
2006
2006
|
{
|
|
2007
|
-
let
|
|
2007
|
+
let i = L();
|
|
2008
2008
|
for (let o = 0; o < ft.length; o++) {
|
|
2009
|
-
let
|
|
2010
|
-
if (
|
|
2011
|
-
return
|
|
2009
|
+
let s = ft[o](e, i);
|
|
2010
|
+
if (s !== void 0)
|
|
2011
|
+
return s;
|
|
2012
2012
|
}
|
|
2013
|
-
return new xe(
|
|
2013
|
+
return new xe(i, e);
|
|
2014
2014
|
}
|
|
2015
2015
|
case 7:
|
|
2016
2016
|
switch (e) {
|
|
@@ -2024,15 +2024,15 @@ function L() {
|
|
|
2024
2024
|
return;
|
|
2025
2025
|
case 31:
|
|
2026
2026
|
default:
|
|
2027
|
-
let
|
|
2028
|
-
if (
|
|
2029
|
-
return
|
|
2027
|
+
let i = (Q || ye())[e];
|
|
2028
|
+
if (i !== void 0)
|
|
2029
|
+
return i;
|
|
2030
2030
|
throw new Error("Unknown token " + e);
|
|
2031
2031
|
}
|
|
2032
2032
|
default:
|
|
2033
2033
|
if (isNaN(e)) {
|
|
2034
|
-
let
|
|
2035
|
-
throw
|
|
2034
|
+
let i = new Error("Unexpected end of CBOR data");
|
|
2035
|
+
throw i.incomplete = !0, i;
|
|
2036
2036
|
}
|
|
2037
2037
|
throw new Error("Unknown CBOR token " + e);
|
|
2038
2038
|
}
|
|
@@ -2064,13 +2064,13 @@ function at(e) {
|
|
|
2064
2064
|
}
|
|
2065
2065
|
if (this.slowReads++ >= ir) {
|
|
2066
2066
|
let o = this.length == r ? this : this.slice(0, r);
|
|
2067
|
-
return n = D.keyMap ? new Function("r", "return {" + o.map((
|
|
2067
|
+
return n = D.keyMap ? new Function("r", "return {" + o.map((s) => D.decodeKey(s)).map((s) => Mt.test(s) ? se(s) + ":r()" : "[" + JSON.stringify(s) + "]:r()").join(",") + "}") : new Function("r", "return {" + o.map((s) => Mt.test(s) ? se(s) + ":r()" : "[" + JSON.stringify(s) + "]:r()").join(",") + "}"), this.compiledReader && (n.next = this.compiledReader), n.propertyCount = r, this.compiledReader = n, n(L);
|
|
2068
2068
|
}
|
|
2069
|
-
let
|
|
2070
|
-
if (D.keyMap) for (let o = 0; o < r; o++)
|
|
2069
|
+
let i = {};
|
|
2070
|
+
if (D.keyMap) for (let o = 0; o < r; o++) i[se(D.decodeKey(this[o]))] = L();
|
|
2071
2071
|
else for (let o = 0; o < r; o++)
|
|
2072
|
-
|
|
2073
|
-
return
|
|
2072
|
+
i[se(this[o])] = L();
|
|
2073
|
+
return i;
|
|
2074
2074
|
}
|
|
2075
2075
|
return e.slowReads = 0, t;
|
|
2076
2076
|
}
|
|
@@ -2089,21 +2089,21 @@ function ct(e) {
|
|
|
2089
2089
|
return ot.decode(O.subarray(w, w += e));
|
|
2090
2090
|
const r = w + e, n = [];
|
|
2091
2091
|
for (t = ""; w < r; ) {
|
|
2092
|
-
const
|
|
2093
|
-
if (!(
|
|
2094
|
-
n.push(
|
|
2095
|
-
else if ((
|
|
2092
|
+
const i = O[w++];
|
|
2093
|
+
if (!(i & 128))
|
|
2094
|
+
n.push(i);
|
|
2095
|
+
else if ((i & 224) === 192) {
|
|
2096
2096
|
const o = O[w++] & 63;
|
|
2097
|
-
n.push((
|
|
2098
|
-
} else if ((
|
|
2099
|
-
const o = O[w++] & 63,
|
|
2100
|
-
n.push((
|
|
2101
|
-
} else if ((
|
|
2102
|
-
const o = O[w++] & 63,
|
|
2103
|
-
let
|
|
2104
|
-
|
|
2097
|
+
n.push((i & 31) << 6 | o);
|
|
2098
|
+
} else if ((i & 240) === 224) {
|
|
2099
|
+
const o = O[w++] & 63, s = O[w++] & 63;
|
|
2100
|
+
n.push((i & 31) << 12 | o << 6 | s);
|
|
2101
|
+
} else if ((i & 248) === 240) {
|
|
2102
|
+
const o = O[w++] & 63, s = O[w++] & 63, f = O[w++] & 63;
|
|
2103
|
+
let a = (i & 7) << 18 | o << 12 | s << 6 | f;
|
|
2104
|
+
a > 65535 && (a -= 65536, n.push(a >>> 10 & 1023 | 55296), a = 56320 | a & 1023), n.push(a);
|
|
2105
2105
|
} else
|
|
2106
|
-
n.push(
|
|
2106
|
+
n.push(i);
|
|
2107
2107
|
n.length >= 4096 && (t += X.apply(String, n), n.length = 0);
|
|
2108
2108
|
}
|
|
2109
2109
|
return n.length > 0 && (t += X.apply(String, n)), t;
|
|
@@ -2112,12 +2112,12 @@ let X = String.fromCharCode;
|
|
|
2112
2112
|
function un(e) {
|
|
2113
2113
|
let t = w, r = new Array(e);
|
|
2114
2114
|
for (let n = 0; n < e; n++) {
|
|
2115
|
-
const
|
|
2116
|
-
if ((
|
|
2115
|
+
const i = O[w++];
|
|
2116
|
+
if ((i & 128) > 0) {
|
|
2117
2117
|
w = t;
|
|
2118
2118
|
return;
|
|
2119
2119
|
}
|
|
2120
|
-
r[n] =
|
|
2120
|
+
r[n] = i;
|
|
2121
2121
|
}
|
|
2122
2122
|
return X.apply(String, r);
|
|
2123
2123
|
}
|
|
@@ -2150,52 +2150,52 @@ function or(e) {
|
|
|
2150
2150
|
return X(t, r, n);
|
|
2151
2151
|
}
|
|
2152
2152
|
else {
|
|
2153
|
-
let t = O[w++], r = O[w++], n = O[w++],
|
|
2154
|
-
if ((t & 128) > 0 || (r & 128) > 0 || (n & 128) > 0 || (
|
|
2153
|
+
let t = O[w++], r = O[w++], n = O[w++], i = O[w++];
|
|
2154
|
+
if ((t & 128) > 0 || (r & 128) > 0 || (n & 128) > 0 || (i & 128) > 0) {
|
|
2155
2155
|
w -= 4;
|
|
2156
2156
|
return;
|
|
2157
2157
|
}
|
|
2158
2158
|
if (e < 6) {
|
|
2159
2159
|
if (e === 4)
|
|
2160
|
-
return X(t, r, n,
|
|
2160
|
+
return X(t, r, n, i);
|
|
2161
2161
|
{
|
|
2162
2162
|
let o = O[w++];
|
|
2163
2163
|
if ((o & 128) > 0) {
|
|
2164
2164
|
w -= 5;
|
|
2165
2165
|
return;
|
|
2166
2166
|
}
|
|
2167
|
-
return X(t, r, n,
|
|
2167
|
+
return X(t, r, n, i, o);
|
|
2168
2168
|
}
|
|
2169
2169
|
} else if (e < 8) {
|
|
2170
|
-
let o = O[w++],
|
|
2171
|
-
if ((o & 128) > 0 || (
|
|
2170
|
+
let o = O[w++], s = O[w++];
|
|
2171
|
+
if ((o & 128) > 0 || (s & 128) > 0) {
|
|
2172
2172
|
w -= 6;
|
|
2173
2173
|
return;
|
|
2174
2174
|
}
|
|
2175
2175
|
if (e < 7)
|
|
2176
|
-
return X(t, r, n,
|
|
2177
|
-
let
|
|
2178
|
-
if ((
|
|
2176
|
+
return X(t, r, n, i, o, s);
|
|
2177
|
+
let f = O[w++];
|
|
2178
|
+
if ((f & 128) > 0) {
|
|
2179
2179
|
w -= 7;
|
|
2180
2180
|
return;
|
|
2181
2181
|
}
|
|
2182
|
-
return X(t, r, n,
|
|
2182
|
+
return X(t, r, n, i, o, s, f);
|
|
2183
2183
|
} else {
|
|
2184
|
-
let o = O[w++],
|
|
2185
|
-
if ((o & 128) > 0 || (
|
|
2184
|
+
let o = O[w++], s = O[w++], f = O[w++], a = O[w++];
|
|
2185
|
+
if ((o & 128) > 0 || (s & 128) > 0 || (f & 128) > 0 || (a & 128) > 0) {
|
|
2186
2186
|
w -= 8;
|
|
2187
2187
|
return;
|
|
2188
2188
|
}
|
|
2189
2189
|
if (e < 10) {
|
|
2190
2190
|
if (e === 8)
|
|
2191
|
-
return X(t, r, n,
|
|
2191
|
+
return X(t, r, n, i, o, s, f, a);
|
|
2192
2192
|
{
|
|
2193
2193
|
let p = O[w++];
|
|
2194
2194
|
if ((p & 128) > 0) {
|
|
2195
2195
|
w -= 9;
|
|
2196
2196
|
return;
|
|
2197
2197
|
}
|
|
2198
|
-
return X(t, r, n,
|
|
2198
|
+
return X(t, r, n, i, o, s, f, a, p);
|
|
2199
2199
|
}
|
|
2200
2200
|
} else if (e < 12) {
|
|
2201
2201
|
let p = O[w++], d = O[w++];
|
|
@@ -2204,13 +2204,13 @@ function or(e) {
|
|
|
2204
2204
|
return;
|
|
2205
2205
|
}
|
|
2206
2206
|
if (e < 11)
|
|
2207
|
-
return X(t, r, n,
|
|
2207
|
+
return X(t, r, n, i, o, s, f, a, p, d);
|
|
2208
2208
|
let h = O[w++];
|
|
2209
2209
|
if ((h & 128) > 0) {
|
|
2210
2210
|
w -= 11;
|
|
2211
2211
|
return;
|
|
2212
2212
|
}
|
|
2213
|
-
return X(t, r, n,
|
|
2213
|
+
return X(t, r, n, i, o, s, f, a, p, d, h);
|
|
2214
2214
|
} else {
|
|
2215
2215
|
let p = O[w++], d = O[w++], h = O[w++], g = O[w++];
|
|
2216
2216
|
if ((p & 128) > 0 || (d & 128) > 0 || (h & 128) > 0 || (g & 128) > 0) {
|
|
@@ -2219,14 +2219,14 @@ function or(e) {
|
|
|
2219
2219
|
}
|
|
2220
2220
|
if (e < 14) {
|
|
2221
2221
|
if (e === 12)
|
|
2222
|
-
return X(t, r, n,
|
|
2222
|
+
return X(t, r, n, i, o, s, f, a, p, d, h, g);
|
|
2223
2223
|
{
|
|
2224
2224
|
let u = O[w++];
|
|
2225
2225
|
if ((u & 128) > 0) {
|
|
2226
2226
|
w -= 13;
|
|
2227
2227
|
return;
|
|
2228
2228
|
}
|
|
2229
|
-
return X(t, r, n,
|
|
2229
|
+
return X(t, r, n, i, o, s, f, a, p, d, h, g, u);
|
|
2230
2230
|
}
|
|
2231
2231
|
} else {
|
|
2232
2232
|
let u = O[w++], b = O[w++];
|
|
@@ -2235,13 +2235,13 @@ function or(e) {
|
|
|
2235
2235
|
return;
|
|
2236
2236
|
}
|
|
2237
2237
|
if (e < 15)
|
|
2238
|
-
return X(t, r, n,
|
|
2238
|
+
return X(t, r, n, i, o, s, f, a, p, d, h, g, u, b);
|
|
2239
2239
|
let x = O[w++];
|
|
2240
2240
|
if ((x & 128) > 0) {
|
|
2241
2241
|
w -= 15;
|
|
2242
2242
|
return;
|
|
2243
2243
|
}
|
|
2244
|
-
return X(t, r, n,
|
|
2244
|
+
return X(t, r, n, i, o, s, f, a, p, d, h, g, u, b, x);
|
|
2245
2245
|
}
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
@@ -2292,9 +2292,9 @@ W[fn] = (e) => {
|
|
|
2292
2292
|
let t = e.length, r = e[1];
|
|
2293
2293
|
lt(e[0], r);
|
|
2294
2294
|
let n = {};
|
|
2295
|
-
for (let
|
|
2296
|
-
let o = r[
|
|
2297
|
-
n[se(o)] = e[
|
|
2295
|
+
for (let i = 2; i < t; i++) {
|
|
2296
|
+
let o = r[i - 2];
|
|
2297
|
+
n[se(o)] = e[i];
|
|
2298
2298
|
}
|
|
2299
2299
|
return n;
|
|
2300
2300
|
};
|
|
@@ -2329,12 +2329,12 @@ W[kt] = (e) => {
|
|
|
2329
2329
|
};
|
|
2330
2330
|
W[28] = (e) => {
|
|
2331
2331
|
ne || (ne = /* @__PURE__ */ new Map(), ne.id = 0);
|
|
2332
|
-
let t = ne.id++, r = w, n = O[w],
|
|
2333
|
-
n >> 5 == 4 ?
|
|
2334
|
-
let o = { target:
|
|
2332
|
+
let t = ne.id++, r = w, n = O[w], i;
|
|
2333
|
+
n >> 5 == 4 ? i = [] : i = {};
|
|
2334
|
+
let o = { target: i };
|
|
2335
2335
|
ne.set(t, o);
|
|
2336
|
-
let
|
|
2337
|
-
return o.used ? (Object.getPrototypeOf(
|
|
2336
|
+
let s = e();
|
|
2337
|
+
return o.used ? (Object.getPrototypeOf(i) !== Object.getPrototypeOf(s) && (w = r, i = s, ne.set(t, { target: i }), s = e()), Object.assign(i, s)) : (o.target = s, s);
|
|
2338
2338
|
};
|
|
2339
2339
|
W[28].handlesRead = !0;
|
|
2340
2340
|
W[29] = (e) => {
|
|
@@ -2395,20 +2395,20 @@ for (let e = 0; e < Rt.length; e++)
|
|
|
2395
2395
|
function xn(e, t) {
|
|
2396
2396
|
let r = "get" + e.name.slice(0, -5), n;
|
|
2397
2397
|
typeof e == "function" ? n = e.BYTES_PER_ELEMENT : e = null;
|
|
2398
|
-
for (let
|
|
2399
|
-
if (!
|
|
2398
|
+
for (let i = 0; i < 2; i++) {
|
|
2399
|
+
if (!i && n == 1)
|
|
2400
2400
|
continue;
|
|
2401
2401
|
let o = n == 2 ? 1 : n == 4 ? 2 : n == 8 ? 3 : 0;
|
|
2402
|
-
W[
|
|
2402
|
+
W[i ? t : t - 4] = n == 1 || i == bn ? (s) => {
|
|
2403
2403
|
if (!e)
|
|
2404
2404
|
throw new Error("Could not find typed array for code " + t);
|
|
2405
|
-
return !D.copyBuffers && (n === 1 || n === 2 && !(
|
|
2406
|
-
} : (
|
|
2405
|
+
return !D.copyBuffers && (n === 1 || n === 2 && !(s.byteOffset & 1) || n === 4 && !(s.byteOffset & 3) || n === 8 && !(s.byteOffset & 7)) ? new e(s.buffer, s.byteOffset, s.byteLength >> o) : new e(Uint8Array.prototype.slice.call(s, 0).buffer);
|
|
2406
|
+
} : (s) => {
|
|
2407
2407
|
if (!e)
|
|
2408
2408
|
throw new Error("Could not find typed array for code " + t);
|
|
2409
|
-
let
|
|
2410
|
-
for (let h = 0; h <
|
|
2411
|
-
p[h] = d.call(
|
|
2409
|
+
let f = new DataView(s.buffer, s.byteOffset, s.byteLength), a = s.length >> o, p = new e(a), d = f[r];
|
|
2410
|
+
for (let h = 0; h < a; h++)
|
|
2411
|
+
p[h] = d.call(f, h << o, i);
|
|
2412
2412
|
return p;
|
|
2413
2413
|
};
|
|
2414
2414
|
}
|
|
@@ -2416,8 +2416,8 @@ function xn(e, t) {
|
|
|
2416
2416
|
function wn() {
|
|
2417
2417
|
let e = Se(), t = w + L();
|
|
2418
2418
|
for (let n = 2; n < e; n++) {
|
|
2419
|
-
let
|
|
2420
|
-
w +=
|
|
2419
|
+
let i = Se();
|
|
2420
|
+
w += i;
|
|
2421
2421
|
}
|
|
2422
2422
|
let r = w;
|
|
2423
2423
|
return w = t, G = [ct(Se()), ct(Se())], G.position0 = 0, G.position1 = 0, G.postBundlePosition = w, w = r, L();
|
|
@@ -2445,8 +2445,8 @@ function vt() {
|
|
|
2445
2445
|
}
|
|
2446
2446
|
}
|
|
2447
2447
|
function cr(e) {
|
|
2448
|
-
let t = ge, r = w, n = $e,
|
|
2449
|
-
return ge = t, w = r, $e = n, Fe =
|
|
2448
|
+
let t = ge, r = w, n = $e, i = Fe, o = Ne, s = ne, f = G, a = new Uint8Array(O.slice(0, ge)), p = K, d = D, h = ke, g = e();
|
|
2449
|
+
return ge = t, w = r, $e = n, Fe = i, Ne = o, ne = s, G = f, O = a, ke = h, K = p, D = d, Y = new DataView(O.buffer, O.byteOffset, O.byteLength), g;
|
|
2450
2450
|
}
|
|
2451
2451
|
function ut() {
|
|
2452
2452
|
O = null, ne = null, K = null;
|
|
@@ -2464,18 +2464,18 @@ try {
|
|
|
2464
2464
|
}
|
|
2465
2465
|
let ht, lr;
|
|
2466
2466
|
const Ge = typeof globalThis == "object" && globalThis.Buffer, Me = typeof Ge < "u", et = Me ? Ge.allocUnsafeSlow : Uint8Array, Bt = Me ? Ge : Uint8Array, Tt = 256, Dt = Me ? 4294967296 : 2144337920;
|
|
2467
|
-
let tt, y, H,
|
|
2467
|
+
let tt, y, H, c = 0, he, J = null;
|
|
2468
2468
|
const mn = 61440, Sn = /[\u0080-\uFFFF]/, ee = Symbol("record-id");
|
|
2469
2469
|
class vn extends je {
|
|
2470
2470
|
constructor(t) {
|
|
2471
2471
|
super(t), this.offset = 0;
|
|
2472
|
-
let r, n,
|
|
2472
|
+
let r, n, i, o, s;
|
|
2473
2473
|
t = t || {};
|
|
2474
|
-
let
|
|
2474
|
+
let f = Bt.prototype.utf8Write ? function(l, _, m) {
|
|
2475
2475
|
return y.utf8Write(l, _, m);
|
|
2476
2476
|
} : Te && Te.encodeInto ? function(l, _) {
|
|
2477
2477
|
return Te.encodeInto(l, y.subarray(_)).written;
|
|
2478
|
-
} : !1,
|
|
2478
|
+
} : !1, a = this, p = t.structures || t.saveStructures, d = t.maxSharedStructures;
|
|
2479
2479
|
if (d == null && (d = p ? 128 : 0), d > 8190)
|
|
2480
2480
|
throw new Error("Maximum maxSharedStructure is 8190");
|
|
2481
2481
|
let h = t.sequential;
|
|
@@ -2496,11 +2496,11 @@ class vn extends je {
|
|
|
2496
2496
|
}
|
|
2497
2497
|
return this.encode(l, _);
|
|
2498
2498
|
}, this.encode = function(l, _) {
|
|
2499
|
-
if (y || (y = new et(8192), H = new DataView(y.buffer, 0, 8192),
|
|
2499
|
+
if (y || (y = new et(8192), H = new DataView(y.buffer, 0, 8192), c = 0), he = y.length - 10, he - c < 2048 ? (y = new et(y.length), H = new DataView(y.buffer, 0, y.length), he = y.length - 10, c = 0) : _ === Vt && (c = c + 7 & 2147483640), r = c, a.useSelfDescribedHeader && (H.setUint32(c, 3654940416), c += 3), s = a.structuredClone ? /* @__PURE__ */ new Map() : null, a.bundleStrings && typeof l != "string" ? (J = [], J.size = 1 / 0) : J = null, n = a.structures, n) {
|
|
2500
2500
|
if (n.uninitialized) {
|
|
2501
|
-
let A =
|
|
2502
|
-
|
|
2503
|
-
let S =
|
|
2501
|
+
let A = a.getShared() || {};
|
|
2502
|
+
a.structures = n = A.structures || [], a.sharedVersion = A.version;
|
|
2503
|
+
let S = a.sharedValues = A.packedValues;
|
|
2504
2504
|
if (S) {
|
|
2505
2505
|
x = {};
|
|
2506
2506
|
for (let k = 0, j = S.length; k < j; k++)
|
|
@@ -2525,10 +2525,10 @@ class vn extends je {
|
|
|
2525
2525
|
}
|
|
2526
2526
|
h || (n.nextId = m);
|
|
2527
2527
|
}
|
|
2528
|
-
if (
|
|
2528
|
+
if (i && (i = !1), o = n || [], u = x, t.pack) {
|
|
2529
2529
|
let m = /* @__PURE__ */ new Map();
|
|
2530
|
-
if (m.values = [], m.encoder =
|
|
2531
|
-
y[
|
|
2530
|
+
if (m.values = [], m.encoder = a, m.maxValues = t.maxPrivatePackedValues || (x ? 16 : 1 / 0), m.objectMap = x || !1, m.samplingPackedValues = g, De(l, m), m.values.length > 0) {
|
|
2531
|
+
y[c++] = 216, y[c++] = 51, fe(4);
|
|
2532
2532
|
let A = m.values;
|
|
2533
2533
|
v(A), fe(0), fe(0), u = Object.create(x || null);
|
|
2534
2534
|
for (let S = 0, k = A.length; S < k; S++)
|
|
@@ -2539,12 +2539,12 @@ class vn extends je {
|
|
|
2539
2539
|
try {
|
|
2540
2540
|
if (tt)
|
|
2541
2541
|
return;
|
|
2542
|
-
if (v(l), J && Lt(r, v),
|
|
2543
|
-
|
|
2544
|
-
let m = En(y.subarray(r,
|
|
2545
|
-
return
|
|
2542
|
+
if (v(l), J && Lt(r, v), a.offset = c, s && s.idsToInsert) {
|
|
2543
|
+
c += s.idsToInsert.length * 2, c > he && M(c), a.offset = c;
|
|
2544
|
+
let m = En(y.subarray(r, c), s.idsToInsert);
|
|
2545
|
+
return s = null, m;
|
|
2546
2546
|
}
|
|
2547
|
-
return _ & Vt ? (y.start = r, y.end =
|
|
2547
|
+
return _ & Vt ? (y.start = r, y.end = c, y) : y.subarray(r, c);
|
|
2548
2548
|
} finally {
|
|
2549
2549
|
if (n) {
|
|
2550
2550
|
if (U < 10 && U++, n.length > d && (n.length = d), I > 1e4)
|
|
@@ -2555,30 +2555,30 @@ class vn extends je {
|
|
|
2555
2555
|
C = [];
|
|
2556
2556
|
}
|
|
2557
2557
|
}
|
|
2558
|
-
if (
|
|
2559
|
-
|
|
2560
|
-
let m = y.subarray(r,
|
|
2561
|
-
return
|
|
2558
|
+
if (i && a.saveShared) {
|
|
2559
|
+
a.structures.length > d && (a.structures = a.structures.slice(0, d));
|
|
2560
|
+
let m = y.subarray(r, c);
|
|
2561
|
+
return a.updateSharedData() === !1 ? a.encode(l) : m;
|
|
2562
2562
|
}
|
|
2563
|
-
_ & _n && (
|
|
2563
|
+
_ & _n && (c = r);
|
|
2564
2564
|
}
|
|
2565
2565
|
}, this.findCommonStringsToPack = () => (g = /* @__PURE__ */ new Map(), x || (x = /* @__PURE__ */ Object.create(null)), (l) => {
|
|
2566
2566
|
let _ = l && l.threshold || 4, m = this.pack ? l.maxPrivatePackedValues || 16 : 0;
|
|
2567
2567
|
b || (b = this.sharedValues = []);
|
|
2568
2568
|
for (let [A, S] of g)
|
|
2569
|
-
S.count > _ && (x[A] = m++, b.push(A),
|
|
2569
|
+
S.count > _ && (x[A] = m++, b.push(A), i = !0);
|
|
2570
2570
|
for (; this.saveShared && this.updateSharedData() === !1; )
|
|
2571
2571
|
;
|
|
2572
2572
|
g = null;
|
|
2573
2573
|
});
|
|
2574
2574
|
const v = (l) => {
|
|
2575
|
-
|
|
2575
|
+
c > he && (y = M(c));
|
|
2576
2576
|
var _ = typeof l, m;
|
|
2577
2577
|
if (_ === "string") {
|
|
2578
2578
|
if (u) {
|
|
2579
2579
|
let j = u[l];
|
|
2580
2580
|
if (j >= 0) {
|
|
2581
|
-
j < 16 ? y[
|
|
2581
|
+
j < 16 ? y[c++] = j + 224 : (y[c++] = 198, j & 1 ? v(15 - j >> 1) : v(j - 16 >> 1));
|
|
2582
2582
|
return;
|
|
2583
2583
|
} else if (g && !t.pack) {
|
|
2584
2584
|
let R = g.get(l);
|
|
@@ -2591,69 +2591,69 @@ class vn extends je {
|
|
|
2591
2591
|
if (J && A >= 4 && A < 1024) {
|
|
2592
2592
|
if ((J.size += A) > mn) {
|
|
2593
2593
|
let R, T = (J[0] ? J[0].length * 3 + J[1].length : 0) + 10;
|
|
2594
|
-
|
|
2594
|
+
c + T > he && (y = M(c + T)), y[c++] = 217, y[c++] = 223, y[c++] = 249, y[c++] = J.position ? 132 : 130, y[c++] = 26, R = c - r, c += 4, J.position && Lt(r, v), J = ["", ""], J.size = 0, J.position = R;
|
|
2595
2595
|
}
|
|
2596
2596
|
let j = Sn.test(l);
|
|
2597
|
-
J[j ? 0 : 1] += l, y[
|
|
2597
|
+
J[j ? 0 : 1] += l, y[c++] = j ? 206 : 207, v(A);
|
|
2598
2598
|
return;
|
|
2599
2599
|
}
|
|
2600
2600
|
let S;
|
|
2601
2601
|
A < 32 ? S = 1 : A < 256 ? S = 2 : A < 65536 ? S = 3 : S = 5;
|
|
2602
2602
|
let k = A * 3;
|
|
2603
|
-
if (
|
|
2604
|
-
let j, R, T, V =
|
|
2603
|
+
if (c + k > he && (y = M(c + k)), A < 64 || !f) {
|
|
2604
|
+
let j, R, T, V = c + S;
|
|
2605
2605
|
for (j = 0; j < A; j++)
|
|
2606
2606
|
R = l.charCodeAt(j), R < 128 ? y[V++] = R : R < 2048 ? (y[V++] = R >> 6 | 192, y[V++] = R & 63 | 128) : (R & 64512) === 55296 && ((T = l.charCodeAt(j + 1)) & 64512) === 56320 ? (R = 65536 + ((R & 1023) << 10) + (T & 1023), j++, y[V++] = R >> 18 | 240, y[V++] = R >> 12 & 63 | 128, y[V++] = R >> 6 & 63 | 128, y[V++] = R & 63 | 128) : (y[V++] = R >> 12 | 224, y[V++] = R >> 6 & 63 | 128, y[V++] = R & 63 | 128);
|
|
2607
|
-
m = V -
|
|
2607
|
+
m = V - c - S;
|
|
2608
2608
|
} else
|
|
2609
|
-
m =
|
|
2610
|
-
m < 24 ? y[
|
|
2609
|
+
m = f(l, c + S, k);
|
|
2610
|
+
m < 24 ? y[c++] = 96 | m : m < 256 ? (S < 2 && y.copyWithin(c + 2, c + 1, c + 1 + m), y[c++] = 120, y[c++] = m) : m < 65536 ? (S < 3 && y.copyWithin(c + 3, c + 2, c + 2 + m), y[c++] = 121, y[c++] = m >> 8, y[c++] = m & 255) : (S < 5 && y.copyWithin(c + 5, c + 3, c + 3 + m), y[c++] = 122, H.setUint32(c, m), c += 4), c += m;
|
|
2611
2611
|
} else if (_ === "number")
|
|
2612
2612
|
if (!this.alwaysUseFloat && l >>> 0 === l)
|
|
2613
|
-
l < 24 ? y[
|
|
2613
|
+
l < 24 ? y[c++] = l : l < 256 ? (y[c++] = 24, y[c++] = l) : l < 65536 ? (y[c++] = 25, y[c++] = l >> 8, y[c++] = l & 255) : (y[c++] = 26, H.setUint32(c, l), c += 4);
|
|
2614
2614
|
else if (!this.alwaysUseFloat && l >> 0 === l)
|
|
2615
|
-
l >= -24 ? y[
|
|
2615
|
+
l >= -24 ? y[c++] = 31 - l : l >= -256 ? (y[c++] = 56, y[c++] = ~l) : l >= -65536 ? (y[c++] = 57, H.setUint16(c, ~l), c += 2) : (y[c++] = 58, H.setUint32(c, ~l), c += 4);
|
|
2616
2616
|
else {
|
|
2617
2617
|
let A;
|
|
2618
2618
|
if ((A = this.useFloat32) > 0 && l < 4294967296 && l >= -2147483648) {
|
|
2619
|
-
y[
|
|
2619
|
+
y[c++] = 250, H.setFloat32(c, l);
|
|
2620
2620
|
let S;
|
|
2621
2621
|
if (A < 4 || // this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
|
|
2622
|
-
(S = l * At[(y[
|
|
2623
|
-
|
|
2622
|
+
(S = l * At[(y[c] & 127) << 1 | y[c + 1] >> 7]) >> 0 === S) {
|
|
2623
|
+
c += 4;
|
|
2624
2624
|
return;
|
|
2625
2625
|
} else
|
|
2626
|
-
|
|
2626
|
+
c--;
|
|
2627
2627
|
}
|
|
2628
|
-
y[
|
|
2628
|
+
y[c++] = 251, H.setFloat64(c, l), c += 8;
|
|
2629
2629
|
}
|
|
2630
2630
|
else if (_ === "object")
|
|
2631
2631
|
if (!l)
|
|
2632
|
-
y[
|
|
2632
|
+
y[c++] = 246;
|
|
2633
2633
|
else {
|
|
2634
|
-
if (
|
|
2635
|
-
let S =
|
|
2634
|
+
if (s) {
|
|
2635
|
+
let S = s.get(l);
|
|
2636
2636
|
if (S) {
|
|
2637
|
-
if (y[
|
|
2638
|
-
let k =
|
|
2637
|
+
if (y[c++] = 216, y[c++] = 29, y[c++] = 25, !S.references) {
|
|
2638
|
+
let k = s.idsToInsert || (s.idsToInsert = []);
|
|
2639
2639
|
S.references = [], k.push(S);
|
|
2640
2640
|
}
|
|
2641
|
-
S.references.push(
|
|
2641
|
+
S.references.push(c - r), c += 2;
|
|
2642
2642
|
return;
|
|
2643
2643
|
} else
|
|
2644
|
-
|
|
2644
|
+
s.set(l, { offset: c - r });
|
|
2645
2645
|
}
|
|
2646
2646
|
let A = l.constructor;
|
|
2647
2647
|
if (A === Object)
|
|
2648
2648
|
B(l);
|
|
2649
2649
|
else if (A === Array) {
|
|
2650
|
-
m = l.length, m < 24 ? y[
|
|
2650
|
+
m = l.length, m < 24 ? y[c++] = 128 | m : fe(m);
|
|
2651
2651
|
for (let S = 0; S < m; S++)
|
|
2652
2652
|
v(l[S]);
|
|
2653
2653
|
} else if (A === Map)
|
|
2654
|
-
if ((this.mapsAsObjects ? this.useTag259ForMaps !== !1 : this.useTag259ForMaps) && (y[
|
|
2654
|
+
if ((this.mapsAsObjects ? this.useTag259ForMaps !== !1 : this.useTag259ForMaps) && (y[c++] = 217, y[c++] = 1, y[c++] = 3), m = l.size, m < 24 ? y[c++] = 160 | m : m < 256 ? (y[c++] = 184, y[c++] = m) : m < 65536 ? (y[c++] = 185, y[c++] = m >> 8, y[c++] = m & 255) : (y[c++] = 186, H.setUint32(c, m), c += 4), a.keyMap)
|
|
2655
2655
|
for (let [S, k] of l)
|
|
2656
|
-
v(
|
|
2656
|
+
v(a.encodeKey(S)), v(k);
|
|
2657
2657
|
else
|
|
2658
2658
|
for (let [S, k] of l)
|
|
2659
2659
|
v(S), v(k);
|
|
@@ -2662,7 +2662,7 @@ class vn extends je {
|
|
|
2662
2662
|
let j = lr[S];
|
|
2663
2663
|
if (l instanceof j) {
|
|
2664
2664
|
let R = ht[S], T = R.tag;
|
|
2665
|
-
T == null && (T = R.getTag && R.getTag.call(this, l)), T < 24 ? y[
|
|
2665
|
+
T == null && (T = R.getTag && R.getTag.call(this, l)), T < 24 ? y[c++] = 192 | T : T < 256 ? (y[c++] = 216, y[c++] = T) : T < 65536 ? (y[c++] = 217, y[c++] = T >> 8, y[c++] = T & 255) : T > -1 && (y[c++] = 218, H.setUint32(c, T), c += 4), R.encode.call(this, l, v, M);
|
|
2666
2666
|
return;
|
|
2667
2667
|
}
|
|
2668
2668
|
}
|
|
@@ -2671,10 +2671,10 @@ class vn extends je {
|
|
|
2671
2671
|
let S = new Error("Iterable should be serialized as iterator");
|
|
2672
2672
|
throw S.iteratorNotHandled = !0, S;
|
|
2673
2673
|
}
|
|
2674
|
-
y[
|
|
2674
|
+
y[c++] = 159;
|
|
2675
2675
|
for (let S of l)
|
|
2676
2676
|
v(S);
|
|
2677
|
-
y[
|
|
2677
|
+
y[c++] = 255;
|
|
2678
2678
|
return;
|
|
2679
2679
|
}
|
|
2680
2680
|
if (l[Symbol.asyncIterator] || rt(l)) {
|
|
@@ -2690,42 +2690,42 @@ class vn extends je {
|
|
|
2690
2690
|
}
|
|
2691
2691
|
}
|
|
2692
2692
|
else if (_ === "boolean")
|
|
2693
|
-
y[
|
|
2693
|
+
y[c++] = l ? 245 : 244;
|
|
2694
2694
|
else if (_ === "bigint") {
|
|
2695
2695
|
if (l < BigInt(1) << BigInt(64) && l >= 0)
|
|
2696
|
-
y[
|
|
2696
|
+
y[c++] = 27, H.setBigUint64(c, l);
|
|
2697
2697
|
else if (l > -(BigInt(1) << BigInt(64)) && l < 0)
|
|
2698
|
-
y[
|
|
2698
|
+
y[c++] = 59, H.setBigUint64(c, -l - BigInt(1));
|
|
2699
2699
|
else if (this.largeBigIntToFloat)
|
|
2700
|
-
y[
|
|
2700
|
+
y[c++] = 251, H.setFloat64(c, Number(l));
|
|
2701
2701
|
else {
|
|
2702
|
-
l >= BigInt(0) ? y[
|
|
2702
|
+
l >= BigInt(0) ? y[c++] = 194 : (y[c++] = 195, l = BigInt(-1) - l);
|
|
2703
2703
|
let A = [];
|
|
2704
2704
|
for (; l; )
|
|
2705
2705
|
A.push(Number(l & BigInt(255))), l >>= BigInt(8);
|
|
2706
2706
|
dt(new Uint8Array(A.reverse()), M);
|
|
2707
2707
|
return;
|
|
2708
2708
|
}
|
|
2709
|
-
|
|
2709
|
+
c += 8;
|
|
2710
2710
|
} else if (_ === "undefined")
|
|
2711
|
-
y[
|
|
2711
|
+
y[c++] = 247;
|
|
2712
2712
|
else
|
|
2713
2713
|
throw new Error("Unknown type: " + _);
|
|
2714
2714
|
}, B = this.useRecords === !1 ? this.variableMapSize ? (l) => {
|
|
2715
2715
|
let _ = Object.keys(l), m = Object.values(l), A = _.length;
|
|
2716
|
-
if (A < 24 ? y[
|
|
2716
|
+
if (A < 24 ? y[c++] = 160 | A : A < 256 ? (y[c++] = 184, y[c++] = A) : A < 65536 ? (y[c++] = 185, y[c++] = A >> 8, y[c++] = A & 255) : (y[c++] = 186, H.setUint32(c, A), c += 4), a.keyMap)
|
|
2717
2717
|
for (let S = 0; S < A; S++)
|
|
2718
|
-
v(
|
|
2718
|
+
v(a.encodeKey(_[S])), v(m[S]);
|
|
2719
2719
|
else
|
|
2720
2720
|
for (let S = 0; S < A; S++)
|
|
2721
2721
|
v(_[S]), v(m[S]);
|
|
2722
2722
|
} : (l) => {
|
|
2723
|
-
y[
|
|
2724
|
-
let _ =
|
|
2725
|
-
|
|
2723
|
+
y[c++] = 185;
|
|
2724
|
+
let _ = c - r;
|
|
2725
|
+
c += 2;
|
|
2726
2726
|
let m = 0;
|
|
2727
|
-
if (
|
|
2728
|
-
for (let A in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(A)) && (v(
|
|
2727
|
+
if (a.keyMap)
|
|
2728
|
+
for (let A in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(A)) && (v(a.encodeKey(A)), v(l[A]), m++);
|
|
2729
2729
|
else
|
|
2730
2730
|
for (let A in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(A)) && (v(A), v(l[A]), m++);
|
|
2731
2731
|
y[_++ + r] = m >> 8, y[_ + r] = m & 255;
|
|
@@ -2741,19 +2741,19 @@ class vn extends je {
|
|
|
2741
2741
|
for (let V in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && (m = A[V], m || (A[ee] & 1048576 && (j = A[ee] & 65535), m = A[V] = /* @__PURE__ */ Object.create(null), S++), A = m, k++);
|
|
2742
2742
|
let T = A[ee];
|
|
2743
2743
|
if (T !== void 0)
|
|
2744
|
-
T &= 65535, y[
|
|
2744
|
+
T &= 65535, y[c++] = 217, y[c++] = T >> 8 | 224, y[c++] = T & 255;
|
|
2745
2745
|
else if (R || (R = A.__keys__ || (A.__keys__ = Object.keys(l))), j === void 0 ? (T = o.nextId++, T || (T = 0, o.nextId = 1), T >= Tt && (o.nextId = (T = d) + 1)) : T = j, o[T] = R, T < d) {
|
|
2746
|
-
y[
|
|
2746
|
+
y[c++] = 217, y[c++] = T >> 8 | 224, y[c++] = T & 255, A = o.transitions;
|
|
2747
2747
|
for (let V = 0; V < k; V++)
|
|
2748
2748
|
(A[ee] === void 0 || A[ee] & 1048576) && (A[ee] = T), A = A[R[V]];
|
|
2749
|
-
A[ee] = T | 1048576,
|
|
2749
|
+
A[ee] = T | 1048576, i = !0;
|
|
2750
2750
|
} else {
|
|
2751
|
-
if (A[ee] = T, H.setUint32(
|
|
2751
|
+
if (A[ee] = T, H.setUint32(c, 3655335680), c += 3, S && (I += U * S), C.length >= Tt - d && (C.shift()[ee] = void 0), C.push(A), fe(k + 2), v(57344 + T), v(R), _) return;
|
|
2752
2752
|
for (let V in l)
|
|
2753
2753
|
(typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && v(l[V]);
|
|
2754
2754
|
return;
|
|
2755
2755
|
}
|
|
2756
|
-
if (k < 24 ? y[
|
|
2756
|
+
if (k < 24 ? y[c++] = 128 | k : fe(k), !_)
|
|
2757
2757
|
for (let V in l)
|
|
2758
2758
|
(typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && v(l[V]);
|
|
2759
2759
|
}, M = (l) => {
|
|
@@ -2768,7 +2768,7 @@ class vn extends je {
|
|
|
2768
2768
|
} else
|
|
2769
2769
|
_ = (Math.max(l - r << 2, y.length - 1) >> 12) + 1 << 12;
|
|
2770
2770
|
let m = new et(_);
|
|
2771
|
-
return H = new DataView(m.buffer, 0, _), y.copy ? y.copy(m, 0, r, l) : m.set(y.slice(r, l)),
|
|
2771
|
+
return H = new DataView(m.buffer, 0, _), y.copy ? y.copy(m, 0, r, l) : m.set(y.slice(r, l)), c -= r, r = 0, he = m.length - 10, y = m;
|
|
2772
2772
|
};
|
|
2773
2773
|
let F = 100, N = 1e3;
|
|
2774
2774
|
this.encodeAsIterable = function(l, _) {
|
|
@@ -2779,7 +2779,7 @@ class vn extends je {
|
|
|
2779
2779
|
function* P(l, _, m) {
|
|
2780
2780
|
let A = l.constructor;
|
|
2781
2781
|
if (A === Object) {
|
|
2782
|
-
let S =
|
|
2782
|
+
let S = a.useRecords !== !1;
|
|
2783
2783
|
S ? B(l, !0) : Pt(Object.keys(l).length, 160);
|
|
2784
2784
|
for (let k in l) {
|
|
2785
2785
|
let j = l[k];
|
|
@@ -2790,31 +2790,31 @@ class vn extends je {
|
|
|
2790
2790
|
fe(S);
|
|
2791
2791
|
for (let k = 0; k < S; k++) {
|
|
2792
2792
|
let j = l[k];
|
|
2793
|
-
j && (typeof j == "object" ||
|
|
2793
|
+
j && (typeof j == "object" || c - r > F) ? _.element ? yield* P(j, _.element) : yield* z(j, _, "element") : v(j);
|
|
2794
2794
|
}
|
|
2795
2795
|
} else if (l[Symbol.iterator] && !l.buffer) {
|
|
2796
|
-
y[
|
|
2796
|
+
y[c++] = 159;
|
|
2797
2797
|
for (let S of l)
|
|
2798
|
-
S && (typeof S == "object" ||
|
|
2799
|
-
y[
|
|
2800
|
-
} else rt(l) ? (Pt(l.size, 64), yield y.subarray(r,
|
|
2801
|
-
m &&
|
|
2798
|
+
S && (typeof S == "object" || c - r > F) ? _.element ? yield* P(S, _.element) : yield* z(S, _, "element") : v(S);
|
|
2799
|
+
y[c++] = 255;
|
|
2800
|
+
} else rt(l) ? (Pt(l.size, 64), yield y.subarray(r, c), yield l, $()) : l[Symbol.asyncIterator] ? (y[c++] = 159, yield y.subarray(r, c), yield l, $(), y[c++] = 255) : v(l);
|
|
2801
|
+
m && c > r ? yield y.subarray(r, c) : c - r > F && (yield y.subarray(r, c), $());
|
|
2802
2802
|
}
|
|
2803
2803
|
function* z(l, _, m) {
|
|
2804
|
-
let A =
|
|
2804
|
+
let A = c - r;
|
|
2805
2805
|
try {
|
|
2806
|
-
v(l),
|
|
2806
|
+
v(l), c - r > F && (yield y.subarray(r, c), $());
|
|
2807
2807
|
} catch (S) {
|
|
2808
2808
|
if (S.iteratorNotHandled)
|
|
2809
|
-
_[m] = {},
|
|
2809
|
+
_[m] = {}, c = r + A, yield* P.call(this, l, _[m]);
|
|
2810
2810
|
else throw S;
|
|
2811
2811
|
}
|
|
2812
2812
|
}
|
|
2813
2813
|
function $() {
|
|
2814
|
-
F = N,
|
|
2814
|
+
F = N, a.encode(null, nt);
|
|
2815
2815
|
}
|
|
2816
2816
|
function ie(l, _, m) {
|
|
2817
|
-
return _ && _.chunkThreshold ? F = N = _.chunkThreshold : F = 100, l && typeof l == "object" ? (
|
|
2817
|
+
return _ && _.chunkThreshold ? F = N = _.chunkThreshold : F = 100, l && typeof l == "object" ? (a.encode(null, nt), m(l, a.iterateProperties || (a.iterateProperties = {}), !0)) : [a.encode(l)];
|
|
2818
2818
|
}
|
|
2819
2819
|
async function* E(l, _) {
|
|
2820
2820
|
for (let m of P(l, _, !0)) {
|
|
@@ -2827,14 +2827,14 @@ class vn extends je {
|
|
|
2827
2827
|
yield k.value;
|
|
2828
2828
|
} else if (m[Symbol.asyncIterator])
|
|
2829
2829
|
for await (let S of m)
|
|
2830
|
-
$(), S ? yield* E(S, _.async || (_.async = {})) : yield
|
|
2830
|
+
$(), S ? yield* E(S, _.async || (_.async = {})) : yield a.encode(S);
|
|
2831
2831
|
else
|
|
2832
2832
|
yield m;
|
|
2833
2833
|
}
|
|
2834
2834
|
}
|
|
2835
2835
|
}
|
|
2836
2836
|
useBuffer(t) {
|
|
2837
|
-
y = t, H = new DataView(y.buffer, y.byteOffset, y.byteLength),
|
|
2837
|
+
y = t, H = new DataView(y.buffer, y.byteOffset, y.byteLength), c = 0;
|
|
2838
2838
|
}
|
|
2839
2839
|
clearSharedData() {
|
|
2840
2840
|
this.structures && (this.structures = []), this.sharedValues && (this.sharedValues = void 0);
|
|
@@ -2842,15 +2842,15 @@ class vn extends je {
|
|
|
2842
2842
|
updateSharedData() {
|
|
2843
2843
|
let t = this.sharedVersion || 0;
|
|
2844
2844
|
this.sharedVersion = t + 1;
|
|
2845
|
-
let r = this.structures.slice(0), n = new ur(r, this.sharedValues, this.sharedVersion),
|
|
2845
|
+
let r = this.structures.slice(0), n = new ur(r, this.sharedValues, this.sharedVersion), i = this.saveShared(
|
|
2846
2846
|
n,
|
|
2847
2847
|
(o) => (o && o.version || 0) == t
|
|
2848
2848
|
);
|
|
2849
|
-
return
|
|
2849
|
+
return i === !1 ? (n = this.getShared() || {}, this.structures = n.structures || [], this.sharedValues = n.packedValues, this.sharedVersion = n.version, this.structures.nextId = this.structures.length) : r.forEach((o, s) => this.structures[s] = o), i;
|
|
2850
2850
|
}
|
|
2851
2851
|
}
|
|
2852
2852
|
function Pt(e, t) {
|
|
2853
|
-
e < 24 ? y[
|
|
2853
|
+
e < 24 ? y[c++] = t | e : e < 256 ? (y[c++] = t | 24, y[c++] = e) : e < 65536 ? (y[c++] = t | 25, y[c++] = e >> 8, y[c++] = e & 255) : (y[c++] = t | 26, H.setUint32(c, e), c += 4);
|
|
2854
2854
|
}
|
|
2855
2855
|
class ur {
|
|
2856
2856
|
constructor(t, r, n) {
|
|
@@ -2858,7 +2858,7 @@ class ur {
|
|
|
2858
2858
|
}
|
|
2859
2859
|
}
|
|
2860
2860
|
function fe(e) {
|
|
2861
|
-
e < 24 ? y[
|
|
2861
|
+
e < 24 ? y[c++] = 128 | e : e < 256 ? (y[c++] = 152, y[c++] = e) : e < 65536 ? (y[c++] = 153, y[c++] = e >> 8, y[c++] = e & 255) : (y[c++] = 154, H.setUint32(c, e), c += 4);
|
|
2862
2862
|
}
|
|
2863
2863
|
const An = typeof Blob > "u" ? function() {
|
|
2864
2864
|
} : Blob;
|
|
@@ -2880,8 +2880,8 @@ function De(e, t) {
|
|
|
2880
2880
|
else if (t.set(e, {
|
|
2881
2881
|
count: 1
|
|
2882
2882
|
}), t.samplingPackedValues) {
|
|
2883
|
-
let
|
|
2884
|
-
|
|
2883
|
+
let i = t.samplingPackedValues.get(e);
|
|
2884
|
+
i ? i.count++ : t.samplingPackedValues.set(e, {
|
|
2885
2885
|
count: 1
|
|
2886
2886
|
});
|
|
2887
2887
|
}
|
|
@@ -2890,7 +2890,7 @@ function De(e, t) {
|
|
|
2890
2890
|
case "object":
|
|
2891
2891
|
if (e)
|
|
2892
2892
|
if (e instanceof Array)
|
|
2893
|
-
for (let n = 0,
|
|
2893
|
+
for (let n = 0, i = e.length; n < i; n++)
|
|
2894
2894
|
De(e[n], t);
|
|
2895
2895
|
else {
|
|
2896
2896
|
let n = !t.encoder.useRecords;
|
|
@@ -2931,7 +2931,7 @@ ht = [
|
|
|
2931
2931
|
tag: 1,
|
|
2932
2932
|
encode(e, t) {
|
|
2933
2933
|
let r = e.getTime() / 1e3;
|
|
2934
|
-
(this.useTimestamp32 || e.getMilliseconds() === 0) && r >= 0 && r < 4294967296 ? (y[
|
|
2934
|
+
(this.useTimestamp32 || e.getMilliseconds() === 0) && r >= 0 && r < 4294967296 ? (y[c++] = 26, H.setUint32(c, r), c += 4) : (y[c++] = 251, H.setFloat64(c, r), c += 8);
|
|
2935
2935
|
}
|
|
2936
2936
|
},
|
|
2937
2937
|
{
|
|
@@ -2998,16 +2998,16 @@ ht = [
|
|
|
2998
2998
|
encode(e, t) {
|
|
2999
2999
|
let r = e.packedValues || [], n = e.structures || [];
|
|
3000
3000
|
if (r.values.length > 0) {
|
|
3001
|
-
y[
|
|
3002
|
-
let
|
|
3003
|
-
t(
|
|
3004
|
-
for (let o = 0,
|
|
3005
|
-
packedObjectMap[
|
|
3001
|
+
y[c++] = 216, y[c++] = 51, fe(4);
|
|
3002
|
+
let i = r.values;
|
|
3003
|
+
t(i), fe(0), fe(0), packedObjectMap = Object.create(sharedPackedObjectMap || null);
|
|
3004
|
+
for (let o = 0, s = i.length; o < s; o++)
|
|
3005
|
+
packedObjectMap[i[o]] = o;
|
|
3006
3006
|
}
|
|
3007
3007
|
if (n) {
|
|
3008
|
-
H.setUint32(
|
|
3009
|
-
let
|
|
3010
|
-
|
|
3008
|
+
H.setUint32(c, 3655335424), c += 3;
|
|
3009
|
+
let i = n.slice(0);
|
|
3010
|
+
i.unshift(57344), i.push(new xe(e.version, 1399353956)), t(i);
|
|
3011
3011
|
} else
|
|
3012
3012
|
t(new xe(e.version, 1399353956));
|
|
3013
3013
|
}
|
|
@@ -3016,35 +3016,35 @@ ht = [
|
|
|
3016
3016
|
function oe(e, t) {
|
|
3017
3017
|
return !Cn && t > 1 && (e -= 4), {
|
|
3018
3018
|
tag: e,
|
|
3019
|
-
encode: function(n,
|
|
3020
|
-
let o = n.byteLength,
|
|
3021
|
-
|
|
3019
|
+
encode: function(n, i) {
|
|
3020
|
+
let o = n.byteLength, s = n.byteOffset || 0, f = n.buffer || n;
|
|
3021
|
+
i(Me ? Ge.from(f, s, o) : new Uint8Array(f, s, o));
|
|
3022
3022
|
}
|
|
3023
3023
|
};
|
|
3024
3024
|
}
|
|
3025
3025
|
function dt(e, t) {
|
|
3026
3026
|
let r = e.byteLength;
|
|
3027
|
-
r < 24 ? y[
|
|
3027
|
+
r < 24 ? y[c++] = 64 + r : r < 256 ? (y[c++] = 88, y[c++] = r) : r < 65536 ? (y[c++] = 89, y[c++] = r >> 8, y[c++] = r & 255) : (y[c++] = 90, H.setUint32(c, r), c += 4), c + r >= y.length && t(c + r), y.set(e.buffer ? e : new Uint8Array(e), c), c += r;
|
|
3028
3028
|
}
|
|
3029
3029
|
function En(e, t) {
|
|
3030
|
-
let r, n = t.length * 2,
|
|
3031
|
-
t.sort((o,
|
|
3030
|
+
let r, n = t.length * 2, i = e.length - n;
|
|
3031
|
+
t.sort((o, s) => o.offset > s.offset ? 1 : -1);
|
|
3032
3032
|
for (let o = 0; o < t.length; o++) {
|
|
3033
|
-
let
|
|
3034
|
-
|
|
3035
|
-
for (let
|
|
3036
|
-
e[
|
|
3033
|
+
let s = t[o];
|
|
3034
|
+
s.id = o;
|
|
3035
|
+
for (let f of s.references)
|
|
3036
|
+
e[f++] = o >> 8, e[f] = o & 255;
|
|
3037
3037
|
}
|
|
3038
3038
|
for (; r = t.pop(); ) {
|
|
3039
3039
|
let o = r.offset;
|
|
3040
|
-
e.copyWithin(o + n, o,
|
|
3041
|
-
let
|
|
3042
|
-
e[
|
|
3040
|
+
e.copyWithin(o + n, o, i), n -= 2;
|
|
3041
|
+
let s = o + n;
|
|
3042
|
+
e[s++] = 216, e[s++] = 28, i = o;
|
|
3043
3043
|
}
|
|
3044
3044
|
return e;
|
|
3045
3045
|
}
|
|
3046
3046
|
function Lt(e, t) {
|
|
3047
|
-
H.setUint32(J.position + e,
|
|
3047
|
+
H.setUint32(J.position + e, c - J.position - e + 1);
|
|
3048
3048
|
let r = J;
|
|
3049
3049
|
J = null, t(r[0]), t(r[1]);
|
|
3050
3050
|
}
|
|
@@ -3058,10 +3058,10 @@ var On = { exports: {} };
|
|
|
3058
3058
|
(function(t, r) {
|
|
3059
3059
|
var n = {};
|
|
3060
3060
|
r(n);
|
|
3061
|
-
var
|
|
3061
|
+
var i = n.default;
|
|
3062
3062
|
for (var o in n)
|
|
3063
|
-
|
|
3064
|
-
e.exports =
|
|
3063
|
+
i[o] = n[o];
|
|
3064
|
+
e.exports = i;
|
|
3065
3065
|
})(Mr, function(t) {
|
|
3066
3066
|
t.__esModule = !0, t.digestLength = 32, t.blockSize = 64;
|
|
3067
3067
|
var r = new Uint32Array([
|
|
@@ -3142,7 +3142,7 @@ var On = { exports: {} };
|
|
|
3142
3142
|
}
|
|
3143
3143
|
return x;
|
|
3144
3144
|
}
|
|
3145
|
-
var
|
|
3145
|
+
var i = (
|
|
3146
3146
|
/** @class */
|
|
3147
3147
|
function() {
|
|
3148
3148
|
function g() {
|
|
@@ -3192,15 +3192,15 @@ var On = { exports: {} };
|
|
|
3192
3192
|
}, g;
|
|
3193
3193
|
}()
|
|
3194
3194
|
);
|
|
3195
|
-
t.Hash =
|
|
3195
|
+
t.Hash = i;
|
|
3196
3196
|
var o = (
|
|
3197
3197
|
/** @class */
|
|
3198
3198
|
function() {
|
|
3199
3199
|
function g(u) {
|
|
3200
|
-
this.inner = new
|
|
3200
|
+
this.inner = new i(), this.outer = new i(), this.blockSize = this.inner.blockSize, this.digestLength = this.inner.digestLength;
|
|
3201
3201
|
var b = new Uint8Array(this.blockSize);
|
|
3202
3202
|
if (u.length > this.blockSize)
|
|
3203
|
-
new
|
|
3203
|
+
new i().update(u).finish(b).clean();
|
|
3204
3204
|
else
|
|
3205
3205
|
for (var x = 0; x < u.length; x++)
|
|
3206
3206
|
b[x] = u[x];
|
|
@@ -3230,17 +3230,17 @@ var On = { exports: {} };
|
|
|
3230
3230
|
}()
|
|
3231
3231
|
);
|
|
3232
3232
|
t.HMAC = o;
|
|
3233
|
-
function
|
|
3234
|
-
var u = new
|
|
3233
|
+
function s(g) {
|
|
3234
|
+
var u = new i().update(g), b = u.digest();
|
|
3235
3235
|
return u.clean(), b;
|
|
3236
3236
|
}
|
|
3237
|
-
t.hash =
|
|
3238
|
-
function
|
|
3237
|
+
t.hash = s, t.default = s;
|
|
3238
|
+
function f(g, u) {
|
|
3239
3239
|
var b = new o(g).update(u), x = b.digest();
|
|
3240
3240
|
return b.clean(), x;
|
|
3241
3241
|
}
|
|
3242
|
-
t.hmac =
|
|
3243
|
-
function
|
|
3242
|
+
t.hmac = f;
|
|
3243
|
+
function a(g, u, b, x) {
|
|
3244
3244
|
var C = x[0];
|
|
3245
3245
|
if (C === 0)
|
|
3246
3246
|
throw new Error("hkdf: cannot expand more");
|
|
@@ -3249,8 +3249,8 @@ var On = { exports: {} };
|
|
|
3249
3249
|
var p = new Uint8Array(t.digestLength);
|
|
3250
3250
|
function d(g, u, b, x) {
|
|
3251
3251
|
u === void 0 && (u = p), x === void 0 && (x = 32);
|
|
3252
|
-
for (var C = new Uint8Array([1]), I =
|
|
3253
|
-
B === v.length && (
|
|
3252
|
+
for (var C = new Uint8Array([1]), I = f(u, g), U = new o(I), v = new Uint8Array(U.digestLength), B = v.length, M = new Uint8Array(x), F = 0; F < x; F++)
|
|
3253
|
+
B === v.length && (a(v, U, b, C), B = 0), M[F] = v[B++];
|
|
3254
3254
|
return U.clean(), v.fill(0), C.fill(0), M;
|
|
3255
3255
|
}
|
|
3256
3256
|
t.hkdf = d;
|
|
@@ -3279,51 +3279,54 @@ var On = { exports: {} };
|
|
|
3279
3279
|
})(On);
|
|
3280
3280
|
Pr("automerge-repo:collectionsync");
|
|
3281
3281
|
const Mn = (e) => {
|
|
3282
|
-
const
|
|
3283
|
-
() => e?.map((
|
|
3284
|
-
if (sn(
|
|
3285
|
-
const { documentId:
|
|
3286
|
-
return
|
|
3282
|
+
const t = bt(), r = br(
|
|
3283
|
+
() => e?.map((s) => {
|
|
3284
|
+
if (sn(s)) {
|
|
3285
|
+
const { documentId: f } = nr(s);
|
|
3286
|
+
return f;
|
|
3287
3287
|
} else
|
|
3288
|
-
return
|
|
3288
|
+
return s;
|
|
3289
3289
|
}) ?? [],
|
|
3290
3290
|
[e]
|
|
3291
|
-
),
|
|
3291
|
+
), n = Nt([]), [i, o] = $t(() => r.reduce((s, f) => {
|
|
3292
|
+
const p = t.find(f).docSync();
|
|
3293
|
+
return p && (s[f] = p), s;
|
|
3294
|
+
}, {}));
|
|
3292
3295
|
return _e(() => {
|
|
3293
|
-
const
|
|
3294
|
-
b &&
|
|
3295
|
-
},
|
|
3296
|
+
const s = {}, f = (u, b) => {
|
|
3297
|
+
b && o((x) => ({ ...x, [u]: b }));
|
|
3298
|
+
}, a = (u) => {
|
|
3296
3299
|
const b = u.documentId, x = {
|
|
3297
|
-
change: ({ doc: C }) =>
|
|
3300
|
+
change: ({ doc: C }) => f(b, C),
|
|
3298
3301
|
delete: () => p(b)
|
|
3299
3302
|
};
|
|
3300
|
-
u.on("change", x.change), u.on("delete", x.delete),
|
|
3303
|
+
u.on("change", x.change), u.on("delete", x.delete), s[b] = x;
|
|
3301
3304
|
}, p = (u) => {
|
|
3302
|
-
|
|
3305
|
+
o((b) => {
|
|
3303
3306
|
const { [u]: x, ...C } = b;
|
|
3304
3307
|
return C;
|
|
3305
3308
|
});
|
|
3306
3309
|
}, d = (u) => {
|
|
3307
|
-
const b =
|
|
3308
|
-
b.docSync() ? (
|
|
3309
|
-
|
|
3310
|
+
const b = t.find(u);
|
|
3311
|
+
b.docSync() ? (f(u, b.docSync()), a(b)) : b.doc().then((x) => {
|
|
3312
|
+
f(u, x), a(b);
|
|
3310
3313
|
}).catch((x) => {
|
|
3311
3314
|
console.error(`Error loading document ${u} in useDocuments: `, x);
|
|
3312
3315
|
});
|
|
3313
3316
|
}, h = () => {
|
|
3314
|
-
Object.entries(
|
|
3315
|
-
const x =
|
|
3317
|
+
Object.entries(s).forEach(([u, b]) => {
|
|
3318
|
+
const x = t.find(u);
|
|
3316
3319
|
x.off("change", b.change), x.off("delete", b.delete);
|
|
3317
3320
|
});
|
|
3318
3321
|
};
|
|
3319
|
-
if (!
|
|
3322
|
+
if (!r)
|
|
3320
3323
|
return h;
|
|
3321
|
-
for (const u of
|
|
3322
|
-
const b =
|
|
3323
|
-
|
|
3324
|
+
for (const u of r) {
|
|
3325
|
+
const b = t.find(u);
|
|
3326
|
+
n.current.includes(u) ? a(b) : d(u);
|
|
3324
3327
|
}
|
|
3325
|
-
return
|
|
3326
|
-
}, [
|
|
3328
|
+
return n.current.filter((u) => !r.includes(u)).forEach(p), n.current = r, h;
|
|
3329
|
+
}, [r, t]), i;
|
|
3327
3330
|
};
|
|
3328
3331
|
function Rn(e) {
|
|
3329
3332
|
const t = bt();
|
|
@@ -3332,10 +3335,10 @@ function Rn(e) {
|
|
|
3332
3335
|
var st = hr, In = function(e) {
|
|
3333
3336
|
return typeof e == "function";
|
|
3334
3337
|
}, Un = function(e) {
|
|
3335
|
-
var t = st.useState(e), r = t[0], n = t[1],
|
|
3336
|
-
|
|
3338
|
+
var t = st.useState(e), r = t[0], n = t[1], i = st.useRef(r), o = st.useCallback(function(s) {
|
|
3339
|
+
i.current = In(s) ? s(i.current) : s, n(i.current);
|
|
3337
3340
|
}, []);
|
|
3338
|
-
return [r, o,
|
|
3341
|
+
return [r, o, i];
|
|
3339
3342
|
}, Fn = Un;
|
|
3340
3343
|
const yt = /* @__PURE__ */ We(Fn), pt = new Vr(), Bn = ({
|
|
3341
3344
|
handle: e,
|
|
@@ -3343,22 +3346,22 @@ const yt = /* @__PURE__ */ We(Fn), pt = new Vr(), Bn = ({
|
|
|
3343
3346
|
offlineTimeout: r = 3e4,
|
|
3344
3347
|
getTime: n = () => (/* @__PURE__ */ new Date()).getTime()
|
|
3345
3348
|
}) => {
|
|
3346
|
-
const [
|
|
3349
|
+
const [i, o, s] = yt({}), [f, a, p] = yt({});
|
|
3347
3350
|
return _e(() => {
|
|
3348
3351
|
const d = (u) => {
|
|
3349
3352
|
const [b, x] = u.message;
|
|
3350
3353
|
b !== t && (p.current[b] || pt.emit("new_peer", u), o({
|
|
3351
|
-
...
|
|
3354
|
+
...s.current,
|
|
3352
3355
|
[b]: x
|
|
3353
|
-
}),
|
|
3356
|
+
}), a({
|
|
3354
3357
|
...p.current,
|
|
3355
3358
|
[b]: n()
|
|
3356
3359
|
}));
|
|
3357
3360
|
}, h = () => {
|
|
3358
|
-
const u =
|
|
3361
|
+
const u = s.current, b = p.current, x = n();
|
|
3359
3362
|
for (const C in b)
|
|
3360
3363
|
x - b[C] > r && (delete u[C], delete b[C]);
|
|
3361
|
-
o(u),
|
|
3364
|
+
o(u), a(b);
|
|
3362
3365
|
};
|
|
3363
3366
|
e.on("ephemeral-message", d);
|
|
3364
3367
|
const g = setInterval(
|
|
@@ -3368,37 +3371,37 @@ const yt = /* @__PURE__ */ We(Fn), pt = new Vr(), Bn = ({
|
|
|
3368
3371
|
return () => {
|
|
3369
3372
|
e.removeListener("ephemeral-message", d), clearInterval(g);
|
|
3370
3373
|
};
|
|
3371
|
-
}, [e, t, r, n]), [
|
|
3374
|
+
}, [e, t, r, n]), [i, f];
|
|
3372
3375
|
}, Tn = ({
|
|
3373
3376
|
handle: e,
|
|
3374
3377
|
userId: t,
|
|
3375
3378
|
initialState: r,
|
|
3376
3379
|
heartbeatTime: n = 15e3
|
|
3377
3380
|
}) => {
|
|
3378
|
-
const [
|
|
3379
|
-
const p = typeof
|
|
3381
|
+
const [i, o, s] = yt(r), f = (a) => {
|
|
3382
|
+
const p = typeof a == "function" ? a(s.current) : a;
|
|
3380
3383
|
o(p), e.broadcast([t, p]);
|
|
3381
3384
|
};
|
|
3382
3385
|
return _e(() => {
|
|
3383
3386
|
if (!t)
|
|
3384
3387
|
return;
|
|
3385
|
-
const
|
|
3386
|
-
|
|
3387
|
-
const p = setInterval(
|
|
3388
|
+
const a = () => void e.broadcast([t, s.current]);
|
|
3389
|
+
a();
|
|
3390
|
+
const p = setInterval(a, n);
|
|
3388
3391
|
return () => void clearInterval(p);
|
|
3389
3392
|
}, [e, t, n]), _e(() => {
|
|
3390
|
-
let
|
|
3393
|
+
let a;
|
|
3391
3394
|
const p = pt.on("new_peer", () => {
|
|
3392
|
-
|
|
3393
|
-
() => e.broadcast([t,
|
|
3395
|
+
a = setTimeout(
|
|
3396
|
+
() => e.broadcast([t, s.current]),
|
|
3394
3397
|
500
|
|
3395
3398
|
// Wait for the peer to be ready
|
|
3396
3399
|
);
|
|
3397
3400
|
});
|
|
3398
3401
|
return () => {
|
|
3399
|
-
p.off("new_peer"),
|
|
3402
|
+
p.off("new_peer"), a && clearTimeout(a);
|
|
3400
3403
|
};
|
|
3401
|
-
}, [e, t, pt]), [
|
|
3404
|
+
}, [e, t, pt]), [i, f];
|
|
3402
3405
|
};
|
|
3403
3406
|
export {
|
|
3404
3407
|
gr as RepoContext,
|