@video-editor/protocol 0.0.1-beta.21 → 0.0.1-beta.23
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 +1174 -1161
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -255,7 +255,7 @@ function Ln() {
|
|
|
255
255
|
})(Or)), Or;
|
|
256
256
|
}
|
|
257
257
|
var $n;
|
|
258
|
-
function
|
|
258
|
+
function X() {
|
|
259
259
|
return $n || ($n = 1, (function(l) {
|
|
260
260
|
Object.defineProperty(l, "__esModule", { value: !0 }), l.or = l.and = l.not = l.CodeGen = l.operators = l.varKinds = l.ValueScopeName = l.ValueScope = l.Scope = l.Name = l.regexpCode = l.stringify = l.getProperty = l.nil = l.strConcat = l.str = l._ = void 0;
|
|
261
261
|
const o = Gt(), c = Ln();
|
|
@@ -302,36 +302,36 @@ function Z() {
|
|
|
302
302
|
optimizeNodes() {
|
|
303
303
|
return this;
|
|
304
304
|
}
|
|
305
|
-
optimizeNames(x,
|
|
305
|
+
optimizeNames(x, A) {
|
|
306
306
|
return this;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
class g extends h {
|
|
310
|
-
constructor(x,
|
|
311
|
-
super(), this.varKind = x, this.name =
|
|
310
|
+
constructor(x, A, B) {
|
|
311
|
+
super(), this.varKind = x, this.name = A, this.rhs = B;
|
|
312
312
|
}
|
|
313
|
-
render({ es5: x, _n:
|
|
314
|
-
const
|
|
315
|
-
return `${
|
|
313
|
+
render({ es5: x, _n: A }) {
|
|
314
|
+
const B = x ? c.varKinds.var : this.varKind, O = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
315
|
+
return `${B} ${this.name}${O};` + A;
|
|
316
316
|
}
|
|
317
|
-
optimizeNames(x,
|
|
317
|
+
optimizeNames(x, A) {
|
|
318
318
|
if (x[this.name.str])
|
|
319
|
-
return this.rhs && (this.rhs =
|
|
319
|
+
return this.rhs && (this.rhs = H(this.rhs, x, A)), this;
|
|
320
320
|
}
|
|
321
321
|
get names() {
|
|
322
322
|
return this.rhs instanceof o._CodeOrName ? this.rhs.names : {};
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
class n extends h {
|
|
326
|
-
constructor(x,
|
|
327
|
-
super(), this.lhs = x, this.rhs =
|
|
326
|
+
constructor(x, A, B) {
|
|
327
|
+
super(), this.lhs = x, this.rhs = A, this.sideEffects = B;
|
|
328
328
|
}
|
|
329
329
|
render({ _n: x }) {
|
|
330
330
|
return `${this.lhs} = ${this.rhs};` + x;
|
|
331
331
|
}
|
|
332
|
-
optimizeNames(x,
|
|
332
|
+
optimizeNames(x, A) {
|
|
333
333
|
if (!(this.lhs instanceof o.Name && !x[this.lhs.str] && !this.sideEffects))
|
|
334
|
-
return this.rhs =
|
|
334
|
+
return this.rhs = H(this.rhs, x, A), this;
|
|
335
335
|
}
|
|
336
336
|
get names() {
|
|
337
337
|
const x = this.lhs instanceof o.Name ? {} : { ...this.lhs.names };
|
|
@@ -339,8 +339,8 @@ function Z() {
|
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
class v extends n {
|
|
342
|
-
constructor(x,
|
|
343
|
-
super(x,
|
|
342
|
+
constructor(x, A, B, O) {
|
|
343
|
+
super(x, B, O), this.op = A;
|
|
344
344
|
}
|
|
345
345
|
render({ _n: x }) {
|
|
346
346
|
return `${this.lhs} ${this.op}= ${this.rhs};` + x;
|
|
@@ -383,8 +383,8 @@ function Z() {
|
|
|
383
383
|
optimizeNodes() {
|
|
384
384
|
return `${this.code}` ? this : void 0;
|
|
385
385
|
}
|
|
386
|
-
optimizeNames(x,
|
|
387
|
-
return this.code =
|
|
386
|
+
optimizeNames(x, A) {
|
|
387
|
+
return this.code = H(this.code, x, A), this;
|
|
388
388
|
}
|
|
389
389
|
get names() {
|
|
390
390
|
return this.code instanceof o._CodeOrName ? this.code.names : {};
|
|
@@ -395,28 +395,28 @@ function Z() {
|
|
|
395
395
|
super(), this.nodes = x;
|
|
396
396
|
}
|
|
397
397
|
render(x) {
|
|
398
|
-
return this.nodes.reduce((
|
|
398
|
+
return this.nodes.reduce((A, B) => A + B.render(x), "");
|
|
399
399
|
}
|
|
400
400
|
optimizeNodes() {
|
|
401
401
|
const { nodes: x } = this;
|
|
402
|
-
let
|
|
403
|
-
for (;
|
|
404
|
-
const
|
|
405
|
-
Array.isArray(
|
|
402
|
+
let A = x.length;
|
|
403
|
+
for (; A--; ) {
|
|
404
|
+
const B = x[A].optimizeNodes();
|
|
405
|
+
Array.isArray(B) ? x.splice(A, 1, ...B) : B ? x[A] = B : x.splice(A, 1);
|
|
406
406
|
}
|
|
407
407
|
return x.length > 0 ? this : void 0;
|
|
408
408
|
}
|
|
409
|
-
optimizeNames(x,
|
|
410
|
-
const { nodes:
|
|
411
|
-
let
|
|
412
|
-
for (;
|
|
413
|
-
const
|
|
414
|
-
|
|
409
|
+
optimizeNames(x, A) {
|
|
410
|
+
const { nodes: B } = this;
|
|
411
|
+
let O = B.length;
|
|
412
|
+
for (; O--; ) {
|
|
413
|
+
const N = B[O];
|
|
414
|
+
N.optimizeNames(x, A) || (Z(x, N.names), B.splice(O, 1));
|
|
415
415
|
}
|
|
416
|
-
return
|
|
416
|
+
return B.length > 0 ? this : void 0;
|
|
417
417
|
}
|
|
418
418
|
get names() {
|
|
419
|
-
return this.nodes.reduce((x,
|
|
419
|
+
return this.nodes.reduce((x, A) => M(x, A.names), {});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
class e extends a {
|
|
@@ -430,32 +430,32 @@ function Z() {
|
|
|
430
430
|
}
|
|
431
431
|
s.kind = "else";
|
|
432
432
|
class f extends e {
|
|
433
|
-
constructor(x,
|
|
434
|
-
super(
|
|
433
|
+
constructor(x, A) {
|
|
434
|
+
super(A), this.condition = x;
|
|
435
435
|
}
|
|
436
436
|
render(x) {
|
|
437
|
-
let
|
|
438
|
-
return this.else && (
|
|
437
|
+
let A = `if(${this.condition})` + super.render(x);
|
|
438
|
+
return this.else && (A += "else " + this.else.render(x)), A;
|
|
439
439
|
}
|
|
440
440
|
optimizeNodes() {
|
|
441
441
|
super.optimizeNodes();
|
|
442
442
|
const x = this.condition;
|
|
443
443
|
if (x === !0)
|
|
444
444
|
return this.nodes;
|
|
445
|
-
let
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
|
|
445
|
+
let A = this.else;
|
|
446
|
+
if (A) {
|
|
447
|
+
const B = A.optimizeNodes();
|
|
448
|
+
A = this.else = Array.isArray(B) ? new s(B) : B;
|
|
449
449
|
}
|
|
450
|
-
if (
|
|
451
|
-
return x === !1 ?
|
|
450
|
+
if (A)
|
|
451
|
+
return x === !1 ? A instanceof f ? A : A.nodes : this.nodes.length ? this : new f(Q(x), A instanceof f ? [A] : A.nodes);
|
|
452
452
|
if (!(x === !1 || !this.nodes.length))
|
|
453
453
|
return this;
|
|
454
454
|
}
|
|
455
|
-
optimizeNames(x,
|
|
456
|
-
var
|
|
457
|
-
if (this.else = (
|
|
458
|
-
return this.condition =
|
|
455
|
+
optimizeNames(x, A) {
|
|
456
|
+
var B;
|
|
457
|
+
if (this.else = (B = this.else) === null || B === void 0 ? void 0 : B.optimizeNames(x, A), !!(super.optimizeNames(x, A) || this.else))
|
|
458
|
+
return this.condition = H(this.condition, x, A), this;
|
|
459
459
|
}
|
|
460
460
|
get names() {
|
|
461
461
|
const x = super.names;
|
|
@@ -473,21 +473,21 @@ function Z() {
|
|
|
473
473
|
render(x) {
|
|
474
474
|
return `for(${this.iteration})` + super.render(x);
|
|
475
475
|
}
|
|
476
|
-
optimizeNames(x,
|
|
477
|
-
if (super.optimizeNames(x,
|
|
478
|
-
return this.iteration =
|
|
476
|
+
optimizeNames(x, A) {
|
|
477
|
+
if (super.optimizeNames(x, A))
|
|
478
|
+
return this.iteration = H(this.iteration, x, A), this;
|
|
479
479
|
}
|
|
480
480
|
get names() {
|
|
481
481
|
return M(super.names, this.iteration.names);
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
class m extends d {
|
|
485
|
-
constructor(x,
|
|
486
|
-
super(), this.varKind = x, this.name =
|
|
485
|
+
constructor(x, A, B, O) {
|
|
486
|
+
super(), this.varKind = x, this.name = A, this.from = B, this.to = O;
|
|
487
487
|
}
|
|
488
488
|
render(x) {
|
|
489
|
-
const
|
|
490
|
-
return `for(${
|
|
489
|
+
const A = x.es5 ? c.varKinds.var : this.varKind, { name: B, from: O, to: N } = this;
|
|
490
|
+
return `for(${A} ${B}=${O}; ${B}<${N}; ${B}++)` + super.render(x);
|
|
491
491
|
}
|
|
492
492
|
get names() {
|
|
493
493
|
const x = G(super.names, this.from);
|
|
@@ -495,23 +495,23 @@ function Z() {
|
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
class b extends d {
|
|
498
|
-
constructor(x,
|
|
499
|
-
super(), this.loop = x, this.varKind =
|
|
498
|
+
constructor(x, A, B, O) {
|
|
499
|
+
super(), this.loop = x, this.varKind = A, this.name = B, this.iterable = O;
|
|
500
500
|
}
|
|
501
501
|
render(x) {
|
|
502
502
|
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(x);
|
|
503
503
|
}
|
|
504
|
-
optimizeNames(x,
|
|
505
|
-
if (super.optimizeNames(x,
|
|
506
|
-
return this.iterable =
|
|
504
|
+
optimizeNames(x, A) {
|
|
505
|
+
if (super.optimizeNames(x, A))
|
|
506
|
+
return this.iterable = H(this.iterable, x, A), this;
|
|
507
507
|
}
|
|
508
508
|
get names() {
|
|
509
509
|
return M(super.names, this.iterable.names);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
class w extends e {
|
|
513
|
-
constructor(x,
|
|
514
|
-
super(), this.name = x, this.args =
|
|
513
|
+
constructor(x, A, B) {
|
|
514
|
+
super(), this.name = x, this.args = A, this.async = B;
|
|
515
515
|
}
|
|
516
516
|
render(x) {
|
|
517
517
|
return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(x);
|
|
@@ -526,16 +526,16 @@ function Z() {
|
|
|
526
526
|
U.kind = "return";
|
|
527
527
|
class P extends e {
|
|
528
528
|
render(x) {
|
|
529
|
-
let
|
|
530
|
-
return this.catch && (
|
|
529
|
+
let A = "try" + super.render(x);
|
|
530
|
+
return this.catch && (A += this.catch.render(x)), this.finally && (A += this.finally.render(x)), A;
|
|
531
531
|
}
|
|
532
532
|
optimizeNodes() {
|
|
533
|
-
var x,
|
|
534
|
-
return super.optimizeNodes(), (x = this.catch) === null || x === void 0 || x.optimizeNodes(), (
|
|
533
|
+
var x, A;
|
|
534
|
+
return super.optimizeNodes(), (x = this.catch) === null || x === void 0 || x.optimizeNodes(), (A = this.finally) === null || A === void 0 || A.optimizeNodes(), this;
|
|
535
535
|
}
|
|
536
|
-
optimizeNames(x,
|
|
537
|
-
var
|
|
538
|
-
return super.optimizeNames(x,
|
|
536
|
+
optimizeNames(x, A) {
|
|
537
|
+
var B, O;
|
|
538
|
+
return super.optimizeNames(x, A), (B = this.catch) === null || B === void 0 || B.optimizeNames(x, A), (O = this.finally) === null || O === void 0 || O.optimizeNames(x, A), this;
|
|
539
539
|
}
|
|
540
540
|
get names() {
|
|
541
541
|
const x = super.names;
|
|
@@ -551,15 +551,15 @@ function Z() {
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
C.kind = "catch";
|
|
554
|
-
class
|
|
554
|
+
class L extends e {
|
|
555
555
|
render(x) {
|
|
556
556
|
return "finally" + super.render(x);
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
|
|
560
|
-
class
|
|
561
|
-
constructor(x,
|
|
562
|
-
this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...
|
|
559
|
+
L.kind = "finally";
|
|
560
|
+
class F {
|
|
561
|
+
constructor(x, A = {}) {
|
|
562
|
+
this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...A, _n: A.lines ? `
|
|
563
563
|
` : "" }, this._extScope = x, this._scope = new c.Scope({ parent: x }), this._nodes = [new r()];
|
|
564
564
|
}
|
|
565
565
|
toString() {
|
|
@@ -574,12 +574,12 @@ function Z() {
|
|
|
574
574
|
return this._extScope.name(x);
|
|
575
575
|
}
|
|
576
576
|
// reserves unique name in the external scope and assigns value to it
|
|
577
|
-
scopeValue(x,
|
|
578
|
-
const
|
|
579
|
-
return (this._values[
|
|
577
|
+
scopeValue(x, A) {
|
|
578
|
+
const B = this._extScope.value(x, A);
|
|
579
|
+
return (this._values[B.prefix] || (this._values[B.prefix] = /* @__PURE__ */ new Set())).add(B), B;
|
|
580
580
|
}
|
|
581
|
-
getScopeValue(x,
|
|
582
|
-
return this._extScope.getValue(x,
|
|
581
|
+
getScopeValue(x, A) {
|
|
582
|
+
return this._extScope.getValue(x, A);
|
|
583
583
|
}
|
|
584
584
|
// return code that assigns values in the external scope to the names that are used internally
|
|
585
585
|
// (same names that were returned by gen.scopeName or gen.scopeValue)
|
|
@@ -589,29 +589,29 @@ function Z() {
|
|
|
589
589
|
scopeCode() {
|
|
590
590
|
return this._extScope.scopeCode(this._values);
|
|
591
591
|
}
|
|
592
|
-
_def(x,
|
|
593
|
-
const
|
|
594
|
-
return
|
|
592
|
+
_def(x, A, B, O) {
|
|
593
|
+
const N = this._scope.toName(A);
|
|
594
|
+
return B !== void 0 && O && (this._constants[N.str] = B), this._leafNode(new g(x, N, B)), N;
|
|
595
595
|
}
|
|
596
596
|
// `const` declaration (`var` in es5 mode)
|
|
597
|
-
const(x,
|
|
598
|
-
return this._def(c.varKinds.const, x,
|
|
597
|
+
const(x, A, B) {
|
|
598
|
+
return this._def(c.varKinds.const, x, A, B);
|
|
599
599
|
}
|
|
600
600
|
// `let` declaration with optional assignment (`var` in es5 mode)
|
|
601
|
-
let(x,
|
|
602
|
-
return this._def(c.varKinds.let, x,
|
|
601
|
+
let(x, A, B) {
|
|
602
|
+
return this._def(c.varKinds.let, x, A, B);
|
|
603
603
|
}
|
|
604
604
|
// `var` declaration with optional assignment
|
|
605
|
-
var(x,
|
|
606
|
-
return this._def(c.varKinds.var, x,
|
|
605
|
+
var(x, A, B) {
|
|
606
|
+
return this._def(c.varKinds.var, x, A, B);
|
|
607
607
|
}
|
|
608
608
|
// assignment code
|
|
609
|
-
assign(x,
|
|
610
|
-
return this._leafNode(new n(x,
|
|
609
|
+
assign(x, A, B) {
|
|
610
|
+
return this._leafNode(new n(x, A, B));
|
|
611
611
|
}
|
|
612
612
|
// `+=` code
|
|
613
|
-
add(x,
|
|
614
|
-
return this._leafNode(new v(x, l.operators.ADD,
|
|
613
|
+
add(x, A) {
|
|
614
|
+
return this._leafNode(new v(x, l.operators.ADD, A));
|
|
615
615
|
}
|
|
616
616
|
// appends passed SafeExpr to code or executes Block
|
|
617
617
|
code(x) {
|
|
@@ -619,18 +619,18 @@ function Z() {
|
|
|
619
619
|
}
|
|
620
620
|
// returns code for object literal for the passed argument list of key-value pairs
|
|
621
621
|
object(...x) {
|
|
622
|
-
const
|
|
623
|
-
for (const [
|
|
624
|
-
|
|
625
|
-
return
|
|
622
|
+
const A = ["{"];
|
|
623
|
+
for (const [B, O] of x)
|
|
624
|
+
A.length > 1 && A.push(","), A.push(B), (B !== O || this.opts.es5) && (A.push(":"), (0, o.addCodeArg)(A, O));
|
|
625
|
+
return A.push("}"), new o._Code(A);
|
|
626
626
|
}
|
|
627
627
|
// `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
|
|
628
|
-
if(x,
|
|
629
|
-
if (this._blockNode(new f(x)),
|
|
630
|
-
this.code(
|
|
631
|
-
else if (
|
|
632
|
-
this.code(
|
|
633
|
-
else if (
|
|
628
|
+
if(x, A, B) {
|
|
629
|
+
if (this._blockNode(new f(x)), A && B)
|
|
630
|
+
this.code(A).else().code(B).endIf();
|
|
631
|
+
else if (A)
|
|
632
|
+
this.code(A).endIf();
|
|
633
|
+
else if (B)
|
|
634
634
|
throw new Error('CodeGen: "else" body without "then" body');
|
|
635
635
|
return this;
|
|
636
636
|
}
|
|
@@ -646,36 +646,36 @@ function Z() {
|
|
|
646
646
|
endIf() {
|
|
647
647
|
return this._endBlockNode(f, s);
|
|
648
648
|
}
|
|
649
|
-
_for(x,
|
|
650
|
-
return this._blockNode(x),
|
|
649
|
+
_for(x, A) {
|
|
650
|
+
return this._blockNode(x), A && this.code(A).endFor(), this;
|
|
651
651
|
}
|
|
652
652
|
// a generic `for` clause (or statement if `forBody` is passed)
|
|
653
|
-
for(x,
|
|
654
|
-
return this._for(new p(x),
|
|
653
|
+
for(x, A) {
|
|
654
|
+
return this._for(new p(x), A);
|
|
655
655
|
}
|
|
656
656
|
// `for` statement for a range of values
|
|
657
|
-
forRange(x,
|
|
657
|
+
forRange(x, A, B, O, N = this.opts.es5 ? c.varKinds.var : c.varKinds.let) {
|
|
658
658
|
const q = this._scope.toName(x);
|
|
659
|
-
return this._for(new m(
|
|
659
|
+
return this._for(new m(N, q, A, B), () => O(q));
|
|
660
660
|
}
|
|
661
661
|
// `for-of` statement (in es5 mode replace with a normal for loop)
|
|
662
|
-
forOf(x,
|
|
663
|
-
const
|
|
662
|
+
forOf(x, A, B, O = c.varKinds.const) {
|
|
663
|
+
const N = this._scope.toName(x);
|
|
664
664
|
if (this.opts.es5) {
|
|
665
|
-
const q =
|
|
666
|
-
return this.forRange("_i", 0, (0, o._)`${q}.length`, (
|
|
667
|
-
this.var(
|
|
665
|
+
const q = A instanceof o.Name ? A : this.var("_arr", A);
|
|
666
|
+
return this.forRange("_i", 0, (0, o._)`${q}.length`, (K) => {
|
|
667
|
+
this.var(N, (0, o._)`${q}[${K}]`), B(N);
|
|
668
668
|
});
|
|
669
669
|
}
|
|
670
|
-
return this._for(new b("of",
|
|
670
|
+
return this._for(new b("of", O, N, A), () => B(N));
|
|
671
671
|
}
|
|
672
672
|
// `for-in` statement.
|
|
673
673
|
// With option `ownProperties` replaced with a `for-of` loop for object keys
|
|
674
|
-
forIn(x,
|
|
674
|
+
forIn(x, A, B, O = this.opts.es5 ? c.varKinds.var : c.varKinds.const) {
|
|
675
675
|
if (this.opts.ownProperties)
|
|
676
|
-
return this.forOf(x, (0, o._)`Object.keys(${
|
|
677
|
-
const
|
|
678
|
-
return this._for(new b("in",
|
|
676
|
+
return this.forOf(x, (0, o._)`Object.keys(${A})`, B);
|
|
677
|
+
const N = this._scope.toName(x);
|
|
678
|
+
return this._for(new b("in", O, N, A), () => B(N));
|
|
679
679
|
}
|
|
680
680
|
// end `for` loop
|
|
681
681
|
endFor() {
|
|
@@ -691,43 +691,43 @@ function Z() {
|
|
|
691
691
|
}
|
|
692
692
|
// `return` statement
|
|
693
693
|
return(x) {
|
|
694
|
-
const
|
|
695
|
-
if (this._blockNode(
|
|
694
|
+
const A = new U();
|
|
695
|
+
if (this._blockNode(A), this.code(x), A.nodes.length !== 1)
|
|
696
696
|
throw new Error('CodeGen: "return" should have one node');
|
|
697
697
|
return this._endBlockNode(U);
|
|
698
698
|
}
|
|
699
699
|
// `try` statement
|
|
700
|
-
try(x,
|
|
701
|
-
if (!
|
|
700
|
+
try(x, A, B) {
|
|
701
|
+
if (!A && !B)
|
|
702
702
|
throw new Error('CodeGen: "try" without "catch" and "finally"');
|
|
703
|
-
const
|
|
704
|
-
if (this._blockNode(
|
|
705
|
-
const
|
|
706
|
-
this._currNode =
|
|
703
|
+
const O = new P();
|
|
704
|
+
if (this._blockNode(O), this.code(x), A) {
|
|
705
|
+
const N = this.name("e");
|
|
706
|
+
this._currNode = O.catch = new C(N), A(N);
|
|
707
707
|
}
|
|
708
|
-
return
|
|
708
|
+
return B && (this._currNode = O.finally = new L(), this.code(B)), this._endBlockNode(C, L);
|
|
709
709
|
}
|
|
710
710
|
// `throw` statement
|
|
711
711
|
throw(x) {
|
|
712
712
|
return this._leafNode(new E(x));
|
|
713
713
|
}
|
|
714
714
|
// start self-balancing block
|
|
715
|
-
block(x,
|
|
716
|
-
return this._blockStarts.push(this._nodes.length), x && this.code(x).endBlock(
|
|
715
|
+
block(x, A) {
|
|
716
|
+
return this._blockStarts.push(this._nodes.length), x && this.code(x).endBlock(A), this;
|
|
717
717
|
}
|
|
718
718
|
// end the current self-balancing block
|
|
719
719
|
endBlock(x) {
|
|
720
|
-
const
|
|
721
|
-
if (
|
|
720
|
+
const A = this._blockStarts.pop();
|
|
721
|
+
if (A === void 0)
|
|
722
722
|
throw new Error("CodeGen: not in self-balancing block");
|
|
723
|
-
const
|
|
724
|
-
if (
|
|
725
|
-
throw new Error(`CodeGen: wrong number of nodes: ${
|
|
726
|
-
return this._nodes.length =
|
|
723
|
+
const B = this._nodes.length - A;
|
|
724
|
+
if (B < 0 || x !== void 0 && B !== x)
|
|
725
|
+
throw new Error(`CodeGen: wrong number of nodes: ${B} vs ${x} expected`);
|
|
726
|
+
return this._nodes.length = A, this;
|
|
727
727
|
}
|
|
728
728
|
// `function` heading (or definition if funcBody is passed)
|
|
729
|
-
func(x,
|
|
730
|
-
return this._blockNode(new w(x,
|
|
729
|
+
func(x, A = o.nil, B, O) {
|
|
730
|
+
return this._blockNode(new w(x, A, B)), O && this.code(O).endFunc(), this;
|
|
731
731
|
}
|
|
732
732
|
// end function definition
|
|
733
733
|
endFunc() {
|
|
@@ -743,17 +743,17 @@ function Z() {
|
|
|
743
743
|
_blockNode(x) {
|
|
744
744
|
this._currNode.nodes.push(x), this._nodes.push(x);
|
|
745
745
|
}
|
|
746
|
-
_endBlockNode(x,
|
|
747
|
-
const
|
|
748
|
-
if (
|
|
746
|
+
_endBlockNode(x, A) {
|
|
747
|
+
const B = this._currNode;
|
|
748
|
+
if (B instanceof x || A && B instanceof A)
|
|
749
749
|
return this._nodes.pop(), this;
|
|
750
|
-
throw new Error(`CodeGen: not in block "${
|
|
750
|
+
throw new Error(`CodeGen: not in block "${A ? `${x.kind}/${A.kind}` : x.kind}"`);
|
|
751
751
|
}
|
|
752
752
|
_elseNode(x) {
|
|
753
|
-
const
|
|
754
|
-
if (!(
|
|
753
|
+
const A = this._currNode;
|
|
754
|
+
if (!(A instanceof f))
|
|
755
755
|
throw new Error('CodeGen: "else" without "if"');
|
|
756
|
-
return this._currNode =
|
|
756
|
+
return this._currNode = A.else = x, this;
|
|
757
757
|
}
|
|
758
758
|
get _root() {
|
|
759
759
|
return this._nodes[0];
|
|
@@ -763,84 +763,84 @@ function Z() {
|
|
|
763
763
|
return x[x.length - 1];
|
|
764
764
|
}
|
|
765
765
|
set _currNode(x) {
|
|
766
|
-
const
|
|
767
|
-
|
|
766
|
+
const A = this._nodes;
|
|
767
|
+
A[A.length - 1] = x;
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
|
-
l.CodeGen =
|
|
770
|
+
l.CodeGen = F;
|
|
771
771
|
function M(T, x) {
|
|
772
|
-
for (const
|
|
773
|
-
T[
|
|
772
|
+
for (const A in x)
|
|
773
|
+
T[A] = (T[A] || 0) + (x[A] || 0);
|
|
774
774
|
return T;
|
|
775
775
|
}
|
|
776
776
|
function G(T, x) {
|
|
777
777
|
return x instanceof o._CodeOrName ? M(T, x.names) : T;
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function H(T, x, A) {
|
|
780
780
|
if (T instanceof o.Name)
|
|
781
|
-
return
|
|
782
|
-
if (!
|
|
781
|
+
return B(T);
|
|
782
|
+
if (!O(T))
|
|
783
783
|
return T;
|
|
784
|
-
return new o._Code(T._items.reduce((
|
|
785
|
-
function
|
|
786
|
-
const q =
|
|
787
|
-
return q === void 0 || x[
|
|
784
|
+
return new o._Code(T._items.reduce((N, q) => (q instanceof o.Name && (q = B(q)), q instanceof o._Code ? N.push(...q._items) : N.push(q), N), []));
|
|
785
|
+
function B(N) {
|
|
786
|
+
const q = A[N.str];
|
|
787
|
+
return q === void 0 || x[N.str] !== 1 ? N : (delete x[N.str], q);
|
|
788
788
|
}
|
|
789
|
-
function N
|
|
790
|
-
return
|
|
789
|
+
function O(N) {
|
|
790
|
+
return N instanceof o._Code && N._items.some((q) => q instanceof o.Name && x[q.str] === 1 && A[q.str] !== void 0);
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
for (const
|
|
795
|
-
T[
|
|
793
|
+
function Z(T, x) {
|
|
794
|
+
for (const A in x)
|
|
795
|
+
T[A] = (T[A] || 0) - (x[A] || 0);
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function Q(T) {
|
|
798
798
|
return typeof T == "boolean" || typeof T == "number" || T === null ? !T : (0, o._)`!${k(T)}`;
|
|
799
799
|
}
|
|
800
|
-
l.not =
|
|
801
|
-
const
|
|
802
|
-
function
|
|
803
|
-
return T.reduce(
|
|
800
|
+
l.not = Q;
|
|
801
|
+
const ie = I(l.operators.AND);
|
|
802
|
+
function J(...T) {
|
|
803
|
+
return T.reduce(ie);
|
|
804
804
|
}
|
|
805
|
-
l.and =
|
|
806
|
-
const
|
|
807
|
-
function
|
|
808
|
-
return T.reduce(
|
|
805
|
+
l.and = J;
|
|
806
|
+
const j = I(l.operators.OR);
|
|
807
|
+
function D(...T) {
|
|
808
|
+
return T.reduce(j);
|
|
809
809
|
}
|
|
810
|
-
l.or =
|
|
811
|
-
function
|
|
812
|
-
return (x,
|
|
810
|
+
l.or = D;
|
|
811
|
+
function I(T) {
|
|
812
|
+
return (x, A) => x === o.nil ? A : A === o.nil ? x : (0, o._)`${k(x)} ${T} ${k(A)}`;
|
|
813
813
|
}
|
|
814
814
|
function k(T) {
|
|
815
815
|
return T instanceof o.Name ? T : (0, o._)`(${T})`;
|
|
816
816
|
}
|
|
817
817
|
})(Lr)), Lr;
|
|
818
818
|
}
|
|
819
|
-
var
|
|
820
|
-
function
|
|
821
|
-
if (On) return
|
|
822
|
-
On = 1, Object.defineProperty(
|
|
823
|
-
const l =
|
|
819
|
+
var ee = {}, On;
|
|
820
|
+
function ne() {
|
|
821
|
+
if (On) return ee;
|
|
822
|
+
On = 1, Object.defineProperty(ee, "__esModule", { value: !0 }), ee.checkStrictMode = ee.getErrorPath = ee.Type = ee.useFunc = ee.setEvaluated = ee.evaluatedPropsToName = ee.mergeEvaluated = ee.eachItem = ee.unescapeJsonPointer = ee.escapeJsonPointer = ee.escapeFragment = ee.unescapeFragment = ee.schemaRefOrVal = ee.schemaHasRulesButRef = ee.schemaHasRules = ee.checkUnknownRules = ee.alwaysValidSchema = ee.toHash = void 0;
|
|
823
|
+
const l = X(), o = Gt();
|
|
824
824
|
function c(b) {
|
|
825
825
|
const w = {};
|
|
826
826
|
for (const U of b)
|
|
827
827
|
w[U] = !0;
|
|
828
828
|
return w;
|
|
829
829
|
}
|
|
830
|
-
|
|
830
|
+
ee.toHash = c;
|
|
831
831
|
function u(b, w) {
|
|
832
832
|
return typeof w == "boolean" ? w : Object.keys(w).length === 0 ? !0 : (_(b, w), !h(w, b.self.RULES.all));
|
|
833
833
|
}
|
|
834
|
-
|
|
834
|
+
ee.alwaysValidSchema = u;
|
|
835
835
|
function _(b, w = b.schema) {
|
|
836
836
|
const { opts: U, self: P } = b;
|
|
837
837
|
if (!U.strictSchema || typeof w == "boolean")
|
|
838
838
|
return;
|
|
839
839
|
const C = P.RULES.keywords;
|
|
840
|
-
for (const
|
|
841
|
-
C[
|
|
840
|
+
for (const L in w)
|
|
841
|
+
C[L] || m(b, `unknown keyword: "${L}"`);
|
|
842
842
|
}
|
|
843
|
-
|
|
843
|
+
ee.checkUnknownRules = _;
|
|
844
844
|
function h(b, w) {
|
|
845
845
|
if (typeof b == "boolean")
|
|
846
846
|
return !b;
|
|
@@ -849,7 +849,7 @@ function re() {
|
|
|
849
849
|
return !0;
|
|
850
850
|
return !1;
|
|
851
851
|
}
|
|
852
|
-
|
|
852
|
+
ee.schemaHasRules = h;
|
|
853
853
|
function g(b, w) {
|
|
854
854
|
if (typeof b == "boolean")
|
|
855
855
|
return !b;
|
|
@@ -858,7 +858,7 @@ function re() {
|
|
|
858
858
|
return !0;
|
|
859
859
|
return !1;
|
|
860
860
|
}
|
|
861
|
-
|
|
861
|
+
ee.schemaHasRulesButRef = g;
|
|
862
862
|
function n({ topSchemaRef: b, schemaPath: w }, U, P, C) {
|
|
863
863
|
if (!C) {
|
|
864
864
|
if (typeof U == "number" || typeof U == "boolean")
|
|
@@ -868,23 +868,23 @@ function re() {
|
|
|
868
868
|
}
|
|
869
869
|
return (0, l._)`${b}${w}${(0, l.getProperty)(P)}`;
|
|
870
870
|
}
|
|
871
|
-
|
|
871
|
+
ee.schemaRefOrVal = n;
|
|
872
872
|
function v(b) {
|
|
873
873
|
return E(decodeURIComponent(b));
|
|
874
874
|
}
|
|
875
|
-
|
|
875
|
+
ee.unescapeFragment = v;
|
|
876
876
|
function S(b) {
|
|
877
877
|
return encodeURIComponent(y(b));
|
|
878
878
|
}
|
|
879
|
-
|
|
879
|
+
ee.escapeFragment = S;
|
|
880
880
|
function y(b) {
|
|
881
881
|
return typeof b == "number" ? `${b}` : b.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
882
882
|
}
|
|
883
|
-
|
|
883
|
+
ee.escapeJsonPointer = y;
|
|
884
884
|
function E(b) {
|
|
885
885
|
return b.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
886
886
|
}
|
|
887
|
-
|
|
887
|
+
ee.unescapeJsonPointer = E;
|
|
888
888
|
function t(b, w) {
|
|
889
889
|
if (Array.isArray(b))
|
|
890
890
|
for (const U of b)
|
|
@@ -892,14 +892,14 @@ function re() {
|
|
|
892
892
|
else
|
|
893
893
|
w(b);
|
|
894
894
|
}
|
|
895
|
-
|
|
895
|
+
ee.eachItem = t;
|
|
896
896
|
function a({ mergeNames: b, mergeToName: w, mergeValues: U, resultToName: P }) {
|
|
897
|
-
return (C,
|
|
898
|
-
const G =
|
|
897
|
+
return (C, L, F, M) => {
|
|
898
|
+
const G = F === void 0 ? L : F instanceof l.Name ? (L instanceof l.Name ? b(C, L, F) : w(C, L, F), F) : L instanceof l.Name ? (w(C, F, L), L) : U(L, F);
|
|
899
899
|
return M === l.Name && !(G instanceof l.Name) ? P(C, G) : G;
|
|
900
900
|
};
|
|
901
901
|
}
|
|
902
|
-
|
|
902
|
+
ee.mergeEvaluated = {
|
|
903
903
|
props: a({
|
|
904
904
|
mergeNames: (b, w, U) => b.if((0, l._)`${U} !== true && ${w} !== undefined`, () => {
|
|
905
905
|
b.if((0, l._)`${w} === true`, () => b.assign(U, !0), () => b.assign(U, (0, l._)`${U} || {}`).code((0, l._)`Object.assign(${U}, ${w})`));
|
|
@@ -923,11 +923,11 @@ function re() {
|
|
|
923
923
|
const U = b.var("props", (0, l._)`{}`);
|
|
924
924
|
return w !== void 0 && r(b, U, w), U;
|
|
925
925
|
}
|
|
926
|
-
|
|
926
|
+
ee.evaluatedPropsToName = e;
|
|
927
927
|
function r(b, w, U) {
|
|
928
928
|
Object.keys(U).forEach((P) => b.assign((0, l._)`${w}${(0, l.getProperty)(P)}`, !0));
|
|
929
929
|
}
|
|
930
|
-
|
|
930
|
+
ee.setEvaluated = r;
|
|
931
931
|
const s = {};
|
|
932
932
|
function f(b, w) {
|
|
933
933
|
return b.scopeValue("func", {
|
|
@@ -935,11 +935,11 @@ function re() {
|
|
|
935
935
|
code: s[w.code] || (s[w.code] = new o._Code(w.code))
|
|
936
936
|
});
|
|
937
937
|
}
|
|
938
|
-
|
|
938
|
+
ee.useFunc = f;
|
|
939
939
|
var d;
|
|
940
940
|
(function(b) {
|
|
941
941
|
b[b.Num = 0] = "Num", b[b.Str = 1] = "Str";
|
|
942
|
-
})(d || (
|
|
942
|
+
})(d || (ee.Type = d = {}));
|
|
943
943
|
function p(b, w, U) {
|
|
944
944
|
if (b instanceof l.Name) {
|
|
945
945
|
const P = w === d.Num;
|
|
@@ -947,7 +947,7 @@ function re() {
|
|
|
947
947
|
}
|
|
948
948
|
return U ? (0, l.getProperty)(b).toString() : "/" + y(b);
|
|
949
949
|
}
|
|
950
|
-
|
|
950
|
+
ee.getErrorPath = p;
|
|
951
951
|
function m(b, w, U = b.opts.strictSchema) {
|
|
952
952
|
if (U) {
|
|
953
953
|
if (w = `strict mode: ${w}`, U === !0)
|
|
@@ -955,13 +955,13 @@ function re() {
|
|
|
955
955
|
b.self.logger.warn(w);
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
|
-
return
|
|
958
|
+
return ee.checkStrictMode = m, ee;
|
|
959
959
|
}
|
|
960
960
|
var oi = {}, Nn;
|
|
961
961
|
function De() {
|
|
962
962
|
if (Nn) return oi;
|
|
963
963
|
Nn = 1, Object.defineProperty(oi, "__esModule", { value: !0 });
|
|
964
|
-
const l =
|
|
964
|
+
const l = X(), o = {
|
|
965
965
|
// validation function arguments
|
|
966
966
|
data: new l.Name("data"),
|
|
967
967
|
// data passed to validation function
|
|
@@ -996,7 +996,7 @@ var Mn;
|
|
|
996
996
|
function Xt() {
|
|
997
997
|
return Mn || (Mn = 1, (function(l) {
|
|
998
998
|
Object.defineProperty(l, "__esModule", { value: !0 }), l.extendErrors = l.resetErrorsCount = l.reportExtraError = l.reportError = l.keyword$DataError = l.keywordError = void 0;
|
|
999
|
-
const o =
|
|
999
|
+
const o = X(), c = ne(), u = De();
|
|
1000
1000
|
l.keywordError = {
|
|
1001
1001
|
message: ({ keyword: s }) => (0, o.str)`must pass "${s}" keyword validation`
|
|
1002
1002
|
}, l.keyword$DataError = {
|
|
@@ -1063,8 +1063,8 @@ function Xt() {
|
|
|
1063
1063
|
return d && (m = (0, o.str)`${m}${(0, c.getErrorPath)(d, c.Type.Str)}`), [y.schemaPath, m];
|
|
1064
1064
|
}
|
|
1065
1065
|
function r(s, { params: f, message: d }, p) {
|
|
1066
|
-
const { keyword: m, data: b, schemaValue: w, it: U } = s, { opts: P, propertyName: C, topSchemaRef:
|
|
1067
|
-
p.push([y.keyword, m], [y.params, typeof f == "function" ? f(s) : f || (0, o._)`{}`]), P.messages && p.push([y.message, typeof d == "function" ? d(s) : d]), P.verbose && p.push([y.schema, w], [y.parentSchema, (0, o._)`${
|
|
1066
|
+
const { keyword: m, data: b, schemaValue: w, it: U } = s, { opts: P, propertyName: C, topSchemaRef: L, schemaPath: F } = U;
|
|
1067
|
+
p.push([y.keyword, m], [y.params, typeof f == "function" ? f(s) : f || (0, o._)`{}`]), P.messages && p.push([y.message, typeof d == "function" ? d(s) : d]), P.verbose && p.push([y.schema, w], [y.parentSchema, (0, o._)`${L}${F}`], [u.default.data, b]), C && p.push([y.propertyName, C]);
|
|
1068
1068
|
}
|
|
1069
1069
|
})(Dr)), Dr;
|
|
1070
1070
|
}
|
|
@@ -1072,7 +1072,7 @@ var jn;
|
|
|
1072
1072
|
function bl() {
|
|
1073
1073
|
if (jn) return Ge;
|
|
1074
1074
|
jn = 1, Object.defineProperty(Ge, "__esModule", { value: !0 }), Ge.boolOrEmptySchema = Ge.topBoolOrEmptySchema = void 0;
|
|
1075
|
-
const l = Xt(), o =
|
|
1075
|
+
const l = Xt(), o = X(), c = De(), u = {
|
|
1076
1076
|
message: "boolean schema is false"
|
|
1077
1077
|
};
|
|
1078
1078
|
function _(n) {
|
|
@@ -1149,7 +1149,7 @@ var Vn;
|
|
|
1149
1149
|
function yr() {
|
|
1150
1150
|
if (Vn) return ce;
|
|
1151
1151
|
Vn = 1, Object.defineProperty(ce, "__esModule", { value: !0 }), ce.reportTypeError = ce.checkDataTypes = ce.checkDataType = ce.coerceAndCheckDataType = ce.getJSONTypes = ce.getSchemaTypes = ce.DataType = void 0;
|
|
1152
|
-
const l = Co(), o = ko(), c = Xt(), u =
|
|
1152
|
+
const l = Co(), o = ko(), c = Xt(), u = X(), _ = ne();
|
|
1153
1153
|
var h;
|
|
1154
1154
|
(function(d) {
|
|
1155
1155
|
d[d.Correct = 0] = "Correct", d[d.Wrong = 1] = "Wrong";
|
|
@@ -1192,13 +1192,13 @@ function yr() {
|
|
|
1192
1192
|
function E(d, p, m) {
|
|
1193
1193
|
const { gen: b, data: w, opts: U } = d, P = b.let("dataType", (0, u._)`typeof ${w}`), C = b.let("coerced", (0, u._)`undefined`);
|
|
1194
1194
|
U.coerceTypes === "array" && b.if((0, u._)`${P} == 'object' && Array.isArray(${w}) && ${w}.length == 1`, () => b.assign(w, (0, u._)`${w}[0]`).assign(P, (0, u._)`typeof ${w}`).if(e(p, w, U.strictNumbers), () => b.assign(C, w))), b.if((0, u._)`${C} !== undefined`);
|
|
1195
|
-
for (const
|
|
1196
|
-
(S.has(
|
|
1195
|
+
for (const F of m)
|
|
1196
|
+
(S.has(F) || F === "array" && U.coerceTypes === "array") && L(F);
|
|
1197
1197
|
b.else(), s(d), b.endIf(), b.if((0, u._)`${C} !== undefined`, () => {
|
|
1198
1198
|
b.assign(w, C), t(d, C);
|
|
1199
1199
|
});
|
|
1200
|
-
function
|
|
1201
|
-
switch (
|
|
1200
|
+
function L(F) {
|
|
1201
|
+
switch (F) {
|
|
1202
1202
|
case "string":
|
|
1203
1203
|
b.elseIf((0, u._)`${P} == "number" || ${P} == "boolean"`).assign(C, (0, u._)`"" + ${w}`).elseIf((0, u._)`${w} === null`).assign(C, (0, u._)`""`);
|
|
1204
1204
|
return;
|
|
@@ -1297,7 +1297,7 @@ var ct = {}, Hn;
|
|
|
1297
1297
|
function wl() {
|
|
1298
1298
|
if (Hn) return ct;
|
|
1299
1299
|
Hn = 1, Object.defineProperty(ct, "__esModule", { value: !0 }), ct.assignDefaults = void 0;
|
|
1300
|
-
const l =
|
|
1300
|
+
const l = X(), o = ne();
|
|
1301
1301
|
function c(_, h) {
|
|
1302
1302
|
const { properties: g, items: n } = _.schema;
|
|
1303
1303
|
if (h === "object" && g)
|
|
@@ -1320,26 +1320,26 @@ function wl() {
|
|
|
1320
1320
|
}
|
|
1321
1321
|
return ct;
|
|
1322
1322
|
}
|
|
1323
|
-
var Ue = {},
|
|
1323
|
+
var Ue = {}, ae = {}, Yn;
|
|
1324
1324
|
function Ee() {
|
|
1325
|
-
if (Yn) return
|
|
1326
|
-
Yn = 1, Object.defineProperty(
|
|
1327
|
-
const l =
|
|
1325
|
+
if (Yn) return ae;
|
|
1326
|
+
Yn = 1, Object.defineProperty(ae, "__esModule", { value: !0 }), ae.validateUnion = ae.validateArray = ae.usePattern = ae.callValidateCode = ae.schemaProperties = ae.allSchemaProperties = ae.noPropertyInData = ae.propertyInData = ae.isOwnProperty = ae.hasPropFunc = ae.reportMissingProp = ae.checkMissingProp = ae.checkReportMissingProp = void 0;
|
|
1327
|
+
const l = X(), o = ne(), c = De(), u = ne();
|
|
1328
1328
|
function _(d, p) {
|
|
1329
1329
|
const { gen: m, data: b, it: w } = d;
|
|
1330
1330
|
m.if(y(m, b, p, w.opts.ownProperties), () => {
|
|
1331
1331
|
d.setParams({ missingProperty: (0, l._)`${p}` }, !0), d.error();
|
|
1332
1332
|
});
|
|
1333
1333
|
}
|
|
1334
|
-
|
|
1334
|
+
ae.checkReportMissingProp = _;
|
|
1335
1335
|
function h({ gen: d, data: p, it: { opts: m } }, b, w) {
|
|
1336
1336
|
return (0, l.or)(...b.map((U) => (0, l.and)(y(d, p, U, m.ownProperties), (0, l._)`${w} = ${U}`)));
|
|
1337
1337
|
}
|
|
1338
|
-
|
|
1338
|
+
ae.checkMissingProp = h;
|
|
1339
1339
|
function g(d, p) {
|
|
1340
1340
|
d.setParams({ missingProperty: p }, !0), d.error();
|
|
1341
1341
|
}
|
|
1342
|
-
|
|
1342
|
+
ae.reportMissingProp = g;
|
|
1343
1343
|
function n(d) {
|
|
1344
1344
|
return d.scopeValue("func", {
|
|
1345
1345
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
@@ -1347,41 +1347,41 @@ function Ee() {
|
|
|
1347
1347
|
code: (0, l._)`Object.prototype.hasOwnProperty`
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
|
-
|
|
1350
|
+
ae.hasPropFunc = n;
|
|
1351
1351
|
function v(d, p, m) {
|
|
1352
1352
|
return (0, l._)`${n(d)}.call(${p}, ${m})`;
|
|
1353
1353
|
}
|
|
1354
|
-
|
|
1354
|
+
ae.isOwnProperty = v;
|
|
1355
1355
|
function S(d, p, m, b) {
|
|
1356
1356
|
const w = (0, l._)`${p}${(0, l.getProperty)(m)} !== undefined`;
|
|
1357
1357
|
return b ? (0, l._)`${w} && ${v(d, p, m)}` : w;
|
|
1358
1358
|
}
|
|
1359
|
-
|
|
1359
|
+
ae.propertyInData = S;
|
|
1360
1360
|
function y(d, p, m, b) {
|
|
1361
1361
|
const w = (0, l._)`${p}${(0, l.getProperty)(m)} === undefined`;
|
|
1362
1362
|
return b ? (0, l.or)(w, (0, l.not)(v(d, p, m))) : w;
|
|
1363
1363
|
}
|
|
1364
|
-
|
|
1364
|
+
ae.noPropertyInData = y;
|
|
1365
1365
|
function E(d) {
|
|
1366
1366
|
return d ? Object.keys(d).filter((p) => p !== "__proto__") : [];
|
|
1367
1367
|
}
|
|
1368
|
-
|
|
1368
|
+
ae.allSchemaProperties = E;
|
|
1369
1369
|
function t(d, p) {
|
|
1370
1370
|
return E(p).filter((m) => !(0, o.alwaysValidSchema)(d, p[m]));
|
|
1371
1371
|
}
|
|
1372
|
-
|
|
1373
|
-
function a({ schemaCode: d, data: p, it: { gen: m, topSchemaRef: b, schemaPath: w, errorPath: U }, it: P }, C,
|
|
1374
|
-
const M =
|
|
1372
|
+
ae.schemaProperties = t;
|
|
1373
|
+
function a({ schemaCode: d, data: p, it: { gen: m, topSchemaRef: b, schemaPath: w, errorPath: U }, it: P }, C, L, F) {
|
|
1374
|
+
const M = F ? (0, l._)`${d}, ${p}, ${b}${w}` : p, G = [
|
|
1375
1375
|
[c.default.instancePath, (0, l.strConcat)(c.default.instancePath, U)],
|
|
1376
1376
|
[c.default.parentData, P.parentData],
|
|
1377
1377
|
[c.default.parentDataProperty, P.parentDataProperty],
|
|
1378
1378
|
[c.default.rootData, c.default.rootData]
|
|
1379
1379
|
];
|
|
1380
1380
|
P.opts.dynamicRef && G.push([c.default.dynamicAnchors, c.default.dynamicAnchors]);
|
|
1381
|
-
const
|
|
1382
|
-
return
|
|
1381
|
+
const H = (0, l._)`${M}, ${m.object(...G)}`;
|
|
1382
|
+
return L !== l.nil ? (0, l._)`${C}.call(${L}, ${H})` : (0, l._)`${C}(${H})`;
|
|
1383
1383
|
}
|
|
1384
|
-
|
|
1384
|
+
ae.callValidateCode = a;
|
|
1385
1385
|
const e = (0, l._)`new RegExp`;
|
|
1386
1386
|
function r({ gen: d, it: { opts: p } }, m) {
|
|
1387
1387
|
const b = p.unicodeRegExp ? "u" : "", { regExp: w } = p.code, U = w(m, b);
|
|
@@ -1391,7 +1391,7 @@ function Ee() {
|
|
|
1391
1391
|
code: (0, l._)`${w.code === "new RegExp" ? e : (0, u.useFunc)(d, w)}(${m}, ${b})`
|
|
1392
1392
|
});
|
|
1393
1393
|
}
|
|
1394
|
-
|
|
1394
|
+
ae.usePattern = r;
|
|
1395
1395
|
function s(d) {
|
|
1396
1396
|
const { gen: p, data: m, keyword: b, it: w } = d, U = p.name("valid");
|
|
1397
1397
|
if (w.allErrors) {
|
|
@@ -1400,40 +1400,40 @@ function Ee() {
|
|
|
1400
1400
|
}
|
|
1401
1401
|
return p.var(U, !0), P(() => p.break()), U;
|
|
1402
1402
|
function P(C) {
|
|
1403
|
-
const
|
|
1404
|
-
p.forRange("i", 0,
|
|
1403
|
+
const L = p.const("len", (0, l._)`${m}.length`);
|
|
1404
|
+
p.forRange("i", 0, L, (F) => {
|
|
1405
1405
|
d.subschema({
|
|
1406
1406
|
keyword: b,
|
|
1407
|
-
dataProp:
|
|
1407
|
+
dataProp: F,
|
|
1408
1408
|
dataPropType: o.Type.Num
|
|
1409
1409
|
}, U), p.if((0, l.not)(U), C);
|
|
1410
1410
|
});
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
|
-
|
|
1413
|
+
ae.validateArray = s;
|
|
1414
1414
|
function f(d) {
|
|
1415
1415
|
const { gen: p, schema: m, keyword: b, it: w } = d;
|
|
1416
1416
|
if (!Array.isArray(m))
|
|
1417
1417
|
throw new Error("ajv implementation error");
|
|
1418
|
-
if (m.some((
|
|
1418
|
+
if (m.some((L) => (0, o.alwaysValidSchema)(w, L)) && !w.opts.unevaluated)
|
|
1419
1419
|
return;
|
|
1420
1420
|
const P = p.let("valid", !1), C = p.name("_valid");
|
|
1421
|
-
p.block(() => m.forEach((
|
|
1421
|
+
p.block(() => m.forEach((L, F) => {
|
|
1422
1422
|
const M = d.subschema({
|
|
1423
1423
|
keyword: b,
|
|
1424
|
-
schemaProp:
|
|
1424
|
+
schemaProp: F,
|
|
1425
1425
|
compositeRule: !0
|
|
1426
1426
|
}, C);
|
|
1427
1427
|
p.assign(P, (0, l._)`${P} || ${C}`), d.mergeValidEvaluated(M, C) || p.if((0, l.not)(P));
|
|
1428
1428
|
})), d.result(P, () => d.reset(), () => d.error(!0));
|
|
1429
1429
|
}
|
|
1430
|
-
return
|
|
1430
|
+
return ae.validateUnion = f, ae;
|
|
1431
1431
|
}
|
|
1432
1432
|
var Kn;
|
|
1433
1433
|
function Sl() {
|
|
1434
1434
|
if (Kn) return Ue;
|
|
1435
1435
|
Kn = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.validateKeywordUsage = Ue.validSchemaType = Ue.funcKeywordCode = Ue.macroKeywordCode = void 0;
|
|
1436
|
-
const l =
|
|
1436
|
+
const l = X(), o = De(), c = Ee(), u = Xt();
|
|
1437
1437
|
function _(t, a) {
|
|
1438
1438
|
const { gen: e, keyword: r, schema: s, parentSchema: f, it: d } = t, p = a.macro.call(d.self, s, f, d), m = S(e, r, p);
|
|
1439
1439
|
d.opts.validateSchema !== !1 && d.self.validateSchema(p, !0);
|
|
@@ -1455,27 +1455,27 @@ function Sl() {
|
|
|
1455
1455
|
t.block$data(U, P), t.ok((e = a.valid) !== null && e !== void 0 ? e : U);
|
|
1456
1456
|
function P() {
|
|
1457
1457
|
if (a.errors === !1)
|
|
1458
|
-
|
|
1458
|
+
F(), a.modifying && g(t), M(() => t.error());
|
|
1459
1459
|
else {
|
|
1460
|
-
const G = a.async ? C() :
|
|
1460
|
+
const G = a.async ? C() : L();
|
|
1461
1461
|
a.modifying && g(t), M(() => n(t, G));
|
|
1462
1462
|
}
|
|
1463
1463
|
}
|
|
1464
1464
|
function C() {
|
|
1465
1465
|
const G = r.let("ruleErrs", null);
|
|
1466
|
-
return r.try(() =>
|
|
1466
|
+
return r.try(() => F((0, l._)`await `), (H) => r.assign(U, !1).if((0, l._)`${H} instanceof ${m.ValidationError}`, () => r.assign(G, (0, l._)`${H}.errors`), () => r.throw(H))), G;
|
|
1467
1467
|
}
|
|
1468
|
-
function
|
|
1468
|
+
function L() {
|
|
1469
1469
|
const G = (0, l._)`${w}.errors`;
|
|
1470
|
-
return r.assign(G, null),
|
|
1470
|
+
return r.assign(G, null), F(l.nil), G;
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1473
|
-
const
|
|
1474
|
-
r.assign(U, (0, l._)`${G}${(0, c.callValidateCode)(t, w,
|
|
1472
|
+
function F(G = a.async ? (0, l._)`await ` : l.nil) {
|
|
1473
|
+
const H = m.opts.passContext ? o.default.this : o.default.self, Z = !("compile" in a && !p || a.schema === !1);
|
|
1474
|
+
r.assign(U, (0, l._)`${G}${(0, c.callValidateCode)(t, w, H, Z)}`, a.modifying);
|
|
1475
1475
|
}
|
|
1476
1476
|
function M(G) {
|
|
1477
|
-
var
|
|
1478
|
-
r.if((0, l.not)((
|
|
1477
|
+
var H;
|
|
1478
|
+
r.if((0, l.not)((H = a.valid) !== null && H !== void 0 ? H : U), G);
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
1481
|
Ue.funcKeywordCode = h;
|
|
@@ -1522,7 +1522,7 @@ var Ce = {}, Wn;
|
|
|
1522
1522
|
function xl() {
|
|
1523
1523
|
if (Wn) return Ce;
|
|
1524
1524
|
Wn = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.extendSubschemaMode = Ce.extendSubschemaData = Ce.getSubschema = void 0;
|
|
1525
|
-
const l =
|
|
1525
|
+
const l = X(), o = ne();
|
|
1526
1526
|
function c(h, { keyword: g, schemaProp: n, schema: v, schemaPath: S, errSchemaPath: y, topSchemaRef: E }) {
|
|
1527
1527
|
if (g !== void 0 && v !== void 0)
|
|
1528
1528
|
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
@@ -1681,7 +1681,7 @@ var Jn;
|
|
|
1681
1681
|
function Tr() {
|
|
1682
1682
|
if (Jn) return pe;
|
|
1683
1683
|
Jn = 1, Object.defineProperty(pe, "__esModule", { value: !0 }), pe.getSchemaRefs = pe.resolveUrl = pe.normalizeId = pe._getFullPath = pe.getFullPath = pe.inlineRef = void 0;
|
|
1684
|
-
const l =
|
|
1684
|
+
const l = ne(), o = yn(), c = Ul(), u = /* @__PURE__ */ new Set([
|
|
1685
1685
|
"type",
|
|
1686
1686
|
"format",
|
|
1687
1687
|
"pattern",
|
|
@@ -1754,34 +1754,34 @@ function Tr() {
|
|
|
1754
1754
|
if (typeof r == "boolean")
|
|
1755
1755
|
return {};
|
|
1756
1756
|
const { schemaId: f, uriResolver: d } = this.opts, p = E(r[f] || s), m = { "": p }, b = v(d, p, !1), w = {}, U = /* @__PURE__ */ new Set();
|
|
1757
|
-
return c(r, { allKeys: !0 }, (
|
|
1757
|
+
return c(r, { allKeys: !0 }, (L, F, M, G) => {
|
|
1758
1758
|
if (G === void 0)
|
|
1759
1759
|
return;
|
|
1760
|
-
const
|
|
1761
|
-
let
|
|
1762
|
-
typeof
|
|
1763
|
-
function
|
|
1764
|
-
const
|
|
1765
|
-
if (
|
|
1766
|
-
throw C(
|
|
1767
|
-
U.add(
|
|
1768
|
-
let
|
|
1769
|
-
return typeof
|
|
1770
|
-
}
|
|
1771
|
-
function J
|
|
1772
|
-
if (typeof
|
|
1773
|
-
if (!a.test(
|
|
1774
|
-
throw new Error(`invalid anchor "${
|
|
1775
|
-
|
|
1760
|
+
const H = b + F;
|
|
1761
|
+
let Z = m[G];
|
|
1762
|
+
typeof L[f] == "string" && (Z = Q.call(this, L[f])), ie.call(this, L.$anchor), ie.call(this, L.$dynamicAnchor), m[F] = Z;
|
|
1763
|
+
function Q(J) {
|
|
1764
|
+
const j = this.opts.uriResolver.resolve;
|
|
1765
|
+
if (J = E(Z ? j(Z, J) : J), U.has(J))
|
|
1766
|
+
throw C(J);
|
|
1767
|
+
U.add(J);
|
|
1768
|
+
let D = this.refs[J];
|
|
1769
|
+
return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? P(L, D.schema, J) : J !== E(H) && (J[0] === "#" ? (P(L, w[J], J), w[J] = L) : this.refs[J] = H), J;
|
|
1770
|
+
}
|
|
1771
|
+
function ie(J) {
|
|
1772
|
+
if (typeof J == "string") {
|
|
1773
|
+
if (!a.test(J))
|
|
1774
|
+
throw new Error(`invalid anchor "${J}"`);
|
|
1775
|
+
Q.call(this, `#${J}`);
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
1778
1778
|
}), w;
|
|
1779
|
-
function P(
|
|
1780
|
-
if (
|
|
1779
|
+
function P(L, F, M) {
|
|
1780
|
+
if (F !== void 0 && !o(L, F))
|
|
1781
1781
|
throw C(M);
|
|
1782
1782
|
}
|
|
1783
|
-
function C(
|
|
1784
|
-
return new Error(`reference "${
|
|
1783
|
+
function C(L) {
|
|
1784
|
+
return new Error(`reference "${L}" resolves to more than one schema`);
|
|
1785
1785
|
}
|
|
1786
1786
|
}
|
|
1787
1787
|
return pe.getSchemaRefs = e, pe;
|
|
@@ -1790,187 +1790,187 @@ var Qn;
|
|
|
1790
1790
|
function Jt() {
|
|
1791
1791
|
if (Qn) return Pe;
|
|
1792
1792
|
Qn = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.getData = Pe.KeywordCxt = Pe.validateFunctionCode = void 0;
|
|
1793
|
-
const l = bl(), o = yr(), c = ko(), u = yr(), _ = wl(), h = Sl(), g = xl(), n =
|
|
1794
|
-
function t(
|
|
1795
|
-
if (b(
|
|
1796
|
-
s(
|
|
1793
|
+
const l = bl(), o = yr(), c = ko(), u = yr(), _ = wl(), h = Sl(), g = xl(), n = X(), v = De(), S = Tr(), y = ne(), E = Xt();
|
|
1794
|
+
function t(z) {
|
|
1795
|
+
if (b(z) && (U(z), m(z))) {
|
|
1796
|
+
s(z);
|
|
1797
1797
|
return;
|
|
1798
1798
|
}
|
|
1799
|
-
a(
|
|
1799
|
+
a(z, () => (0, l.topBoolOrEmptySchema)(z));
|
|
1800
1800
|
}
|
|
1801
1801
|
Pe.validateFunctionCode = t;
|
|
1802
|
-
function a({ gen:
|
|
1803
|
-
Y.code.es5 ?
|
|
1804
|
-
|
|
1805
|
-
}) :
|
|
1802
|
+
function a({ gen: z, validateName: R, schema: $, schemaEnv: V, opts: Y }, W) {
|
|
1803
|
+
Y.code.es5 ? z.func(R, (0, n._)`${v.default.data}, ${v.default.valCxt}`, V.$async, () => {
|
|
1804
|
+
z.code((0, n._)`"use strict"; ${d($, Y)}`), r(z, Y), z.code(W);
|
|
1805
|
+
}) : z.func(R, (0, n._)`${v.default.data}, ${e(Y)}`, V.$async, () => z.code(d($, Y)).code(W));
|
|
1806
1806
|
}
|
|
1807
|
-
function e(
|
|
1808
|
-
return (0, n._)`{${v.default.instancePath}="", ${v.default.parentData}, ${v.default.parentDataProperty}, ${v.default.rootData}=${v.default.data}${
|
|
1807
|
+
function e(z) {
|
|
1808
|
+
return (0, n._)`{${v.default.instancePath}="", ${v.default.parentData}, ${v.default.parentDataProperty}, ${v.default.rootData}=${v.default.data}${z.dynamicRef ? (0, n._)`, ${v.default.dynamicAnchors}={}` : n.nil}}={}`;
|
|
1809
1809
|
}
|
|
1810
|
-
function r(
|
|
1811
|
-
|
|
1812
|
-
|
|
1810
|
+
function r(z, R) {
|
|
1811
|
+
z.if(v.default.valCxt, () => {
|
|
1812
|
+
z.var(v.default.instancePath, (0, n._)`${v.default.valCxt}.${v.default.instancePath}`), z.var(v.default.parentData, (0, n._)`${v.default.valCxt}.${v.default.parentData}`), z.var(v.default.parentDataProperty, (0, n._)`${v.default.valCxt}.${v.default.parentDataProperty}`), z.var(v.default.rootData, (0, n._)`${v.default.valCxt}.${v.default.rootData}`), R.dynamicRef && z.var(v.default.dynamicAnchors, (0, n._)`${v.default.valCxt}.${v.default.dynamicAnchors}`);
|
|
1813
1813
|
}, () => {
|
|
1814
|
-
|
|
1814
|
+
z.var(v.default.instancePath, (0, n._)`""`), z.var(v.default.parentData, (0, n._)`undefined`), z.var(v.default.parentDataProperty, (0, n._)`undefined`), z.var(v.default.rootData, v.default.data), R.dynamicRef && z.var(v.default.dynamicAnchors, (0, n._)`{}`);
|
|
1815
1815
|
});
|
|
1816
1816
|
}
|
|
1817
|
-
function s(
|
|
1818
|
-
const { schema: R, opts: $, gen:
|
|
1819
|
-
a(
|
|
1820
|
-
$.$comment && R.$comment && G(
|
|
1817
|
+
function s(z) {
|
|
1818
|
+
const { schema: R, opts: $, gen: V } = z;
|
|
1819
|
+
a(z, () => {
|
|
1820
|
+
$.$comment && R.$comment && G(z), L(z), V.let(v.default.vErrors, null), V.let(v.default.errors, 0), $.unevaluated && f(z), P(z), H(z);
|
|
1821
1821
|
});
|
|
1822
1822
|
}
|
|
1823
|
-
function f(
|
|
1824
|
-
const { gen: R, validateName: $ } =
|
|
1825
|
-
|
|
1823
|
+
function f(z) {
|
|
1824
|
+
const { gen: R, validateName: $ } = z;
|
|
1825
|
+
z.evaluated = R.const("evaluated", (0, n._)`${$}.evaluated`), R.if((0, n._)`${z.evaluated}.dynamicProps`, () => R.assign((0, n._)`${z.evaluated}.props`, (0, n._)`undefined`)), R.if((0, n._)`${z.evaluated}.dynamicItems`, () => R.assign((0, n._)`${z.evaluated}.items`, (0, n._)`undefined`));
|
|
1826
1826
|
}
|
|
1827
|
-
function d(
|
|
1828
|
-
const $ = typeof
|
|
1827
|
+
function d(z, R) {
|
|
1828
|
+
const $ = typeof z == "object" && z[R.schemaId];
|
|
1829
1829
|
return $ && (R.code.source || R.code.process) ? (0, n._)`/*# sourceURL=${$} */` : n.nil;
|
|
1830
1830
|
}
|
|
1831
|
-
function p(
|
|
1832
|
-
if (b(
|
|
1833
|
-
w(
|
|
1831
|
+
function p(z, R) {
|
|
1832
|
+
if (b(z) && (U(z), m(z))) {
|
|
1833
|
+
w(z, R);
|
|
1834
1834
|
return;
|
|
1835
1835
|
}
|
|
1836
|
-
(0, l.boolOrEmptySchema)(
|
|
1836
|
+
(0, l.boolOrEmptySchema)(z, R);
|
|
1837
1837
|
}
|
|
1838
|
-
function m({ schema:
|
|
1839
|
-
if (typeof
|
|
1840
|
-
return !
|
|
1841
|
-
for (const $ in
|
|
1838
|
+
function m({ schema: z, self: R }) {
|
|
1839
|
+
if (typeof z == "boolean")
|
|
1840
|
+
return !z;
|
|
1841
|
+
for (const $ in z)
|
|
1842
1842
|
if (R.RULES.all[$])
|
|
1843
1843
|
return !0;
|
|
1844
1844
|
return !1;
|
|
1845
1845
|
}
|
|
1846
|
-
function b(
|
|
1847
|
-
return typeof
|
|
1846
|
+
function b(z) {
|
|
1847
|
+
return typeof z.schema != "boolean";
|
|
1848
1848
|
}
|
|
1849
|
-
function w(
|
|
1850
|
-
const { schema: $, gen:
|
|
1851
|
-
Y.$comment && $.$comment && G(
|
|
1852
|
-
const W =
|
|
1853
|
-
P(
|
|
1849
|
+
function w(z, R) {
|
|
1850
|
+
const { schema: $, gen: V, opts: Y } = z;
|
|
1851
|
+
Y.$comment && $.$comment && G(z), F(z), M(z);
|
|
1852
|
+
const W = V.const("_errs", v.default.errors);
|
|
1853
|
+
P(z, W), V.var(R, (0, n._)`${W} === ${v.default.errors}`);
|
|
1854
1854
|
}
|
|
1855
|
-
function U(
|
|
1856
|
-
(0, y.checkUnknownRules)(
|
|
1855
|
+
function U(z) {
|
|
1856
|
+
(0, y.checkUnknownRules)(z), C(z);
|
|
1857
1857
|
}
|
|
1858
|
-
function P(
|
|
1859
|
-
if (
|
|
1860
|
-
return
|
|
1861
|
-
const $ = (0, o.getSchemaTypes)(
|
|
1862
|
-
|
|
1858
|
+
function P(z, R) {
|
|
1859
|
+
if (z.opts.jtd)
|
|
1860
|
+
return Q(z, [], !1, R);
|
|
1861
|
+
const $ = (0, o.getSchemaTypes)(z.schema), V = (0, o.coerceAndCheckDataType)(z, $);
|
|
1862
|
+
Q(z, $, !V, R);
|
|
1863
1863
|
}
|
|
1864
|
-
function C(
|
|
1865
|
-
const { schema: R, errSchemaPath: $, opts:
|
|
1866
|
-
R.$ref &&
|
|
1864
|
+
function C(z) {
|
|
1865
|
+
const { schema: R, errSchemaPath: $, opts: V, self: Y } = z;
|
|
1866
|
+
R.$ref && V.ignoreKeywordsWithRef && (0, y.schemaHasRulesButRef)(R, Y.RULES) && Y.logger.warn(`$ref: keywords ignored in schema at path "${$}"`);
|
|
1867
1867
|
}
|
|
1868
|
-
function
|
|
1869
|
-
const { schema: R, opts: $ } =
|
|
1870
|
-
R.default !== void 0 && $.useDefaults && $.strictSchema && (0, y.checkStrictMode)(
|
|
1868
|
+
function L(z) {
|
|
1869
|
+
const { schema: R, opts: $ } = z;
|
|
1870
|
+
R.default !== void 0 && $.useDefaults && $.strictSchema && (0, y.checkStrictMode)(z, "default is ignored in the schema root");
|
|
1871
1871
|
}
|
|
1872
|
-
function z
|
|
1873
|
-
const R =
|
|
1874
|
-
R && (
|
|
1872
|
+
function F(z) {
|
|
1873
|
+
const R = z.schema[z.opts.schemaId];
|
|
1874
|
+
R && (z.baseId = (0, S.resolveUrl)(z.opts.uriResolver, z.baseId, R));
|
|
1875
1875
|
}
|
|
1876
|
-
function M(
|
|
1877
|
-
if (
|
|
1876
|
+
function M(z) {
|
|
1877
|
+
if (z.schema.$async && !z.schemaEnv.$async)
|
|
1878
1878
|
throw new Error("async schema in sync schema");
|
|
1879
1879
|
}
|
|
1880
|
-
function G({ gen:
|
|
1880
|
+
function G({ gen: z, schemaEnv: R, schema: $, errSchemaPath: V, opts: Y }) {
|
|
1881
1881
|
const W = $.$comment;
|
|
1882
1882
|
if (Y.$comment === !0)
|
|
1883
|
-
|
|
1883
|
+
z.code((0, n._)`${v.default.self}.logger.log(${W})`);
|
|
1884
1884
|
else if (typeof Y.$comment == "function") {
|
|
1885
|
-
const
|
|
1886
|
-
|
|
1885
|
+
const se = (0, n.str)`${V}/$comment`, oe = z.scopeValue("root", { ref: R.root });
|
|
1886
|
+
z.code((0, n._)`${v.default.self}.opts.$comment(${W}, ${se}, ${oe}.schema)`);
|
|
1887
1887
|
}
|
|
1888
1888
|
}
|
|
1889
|
-
function
|
|
1890
|
-
const { gen: R, schemaEnv: $, validateName:
|
|
1891
|
-
$.$async ? R.if((0, n._)`${v.default.errors} === 0`, () => R.return(v.default.data), () => R.throw((0, n._)`new ${Y}(${v.default.vErrors})`)) : (R.assign((0, n._)`${
|
|
1889
|
+
function H(z) {
|
|
1890
|
+
const { gen: R, schemaEnv: $, validateName: V, ValidationError: Y, opts: W } = z;
|
|
1891
|
+
$.$async ? R.if((0, n._)`${v.default.errors} === 0`, () => R.return(v.default.data), () => R.throw((0, n._)`new ${Y}(${v.default.vErrors})`)) : (R.assign((0, n._)`${V}.errors`, v.default.vErrors), W.unevaluated && Z(z), R.return((0, n._)`${v.default.errors} === 0`));
|
|
1892
1892
|
}
|
|
1893
|
-
function
|
|
1894
|
-
$ instanceof n.Name &&
|
|
1893
|
+
function Z({ gen: z, evaluated: R, props: $, items: V }) {
|
|
1894
|
+
$ instanceof n.Name && z.assign((0, n._)`${R}.props`, $), V instanceof n.Name && z.assign((0, n._)`${R}.items`, V);
|
|
1895
1895
|
}
|
|
1896
|
-
function
|
|
1897
|
-
const { gen: Y, schema: W, data:
|
|
1898
|
-
if (W.$ref && (
|
|
1899
|
-
Y.block(() =>
|
|
1896
|
+
function Q(z, R, $, V) {
|
|
1897
|
+
const { gen: Y, schema: W, data: se, allErrors: oe, opts: he, self: me } = z, { RULES: ue } = me;
|
|
1898
|
+
if (W.$ref && (he.ignoreKeywordsWithRef || !(0, y.schemaHasRulesButRef)(W, ue))) {
|
|
1899
|
+
Y.block(() => O(z, "$ref", ue.all.$ref.definition));
|
|
1900
1900
|
return;
|
|
1901
1901
|
}
|
|
1902
|
-
|
|
1902
|
+
he.jtd || J(z, R), Y.block(() => {
|
|
1903
1903
|
for (const ve of ue.rules)
|
|
1904
1904
|
Qe(ve);
|
|
1905
1905
|
Qe(ue.post);
|
|
1906
1906
|
});
|
|
1907
1907
|
function Qe(ve) {
|
|
1908
|
-
(0, c.shouldUseGroup)(W, ve) && (ve.type ? (Y.if((0, u.checkDataType)(ve.type,
|
|
1908
|
+
(0, c.shouldUseGroup)(W, ve) && (ve.type ? (Y.if((0, u.checkDataType)(ve.type, se, he.strictNumbers)), ie(z, ve), R.length === 1 && R[0] === ve.type && $ && (Y.else(), (0, u.reportTypeError)(z)), Y.endIf()) : ie(z, ve), oe || Y.if((0, n._)`${v.default.errors} === ${V || 0}`));
|
|
1909
1909
|
}
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1912
|
-
const { gen: $, schema:
|
|
1913
|
-
Y && (0, _.assignDefaults)(
|
|
1911
|
+
function ie(z, R) {
|
|
1912
|
+
const { gen: $, schema: V, opts: { useDefaults: Y } } = z;
|
|
1913
|
+
Y && (0, _.assignDefaults)(z, R.type), $.block(() => {
|
|
1914
1914
|
for (const W of R.rules)
|
|
1915
|
-
(0, c.shouldUseRule)(
|
|
1915
|
+
(0, c.shouldUseRule)(V, W) && O(z, W.keyword, W.definition, R.type);
|
|
1916
1916
|
});
|
|
1917
1917
|
}
|
|
1918
|
-
function
|
|
1919
|
-
|
|
1918
|
+
function J(z, R) {
|
|
1919
|
+
z.schemaEnv.meta || !z.opts.strictTypes || (j(z, R), z.opts.allowUnionTypes || D(z, R), I(z, z.dataTypes));
|
|
1920
1920
|
}
|
|
1921
|
-
function
|
|
1921
|
+
function j(z, R) {
|
|
1922
1922
|
if (R.length) {
|
|
1923
|
-
if (!
|
|
1924
|
-
|
|
1923
|
+
if (!z.dataTypes.length) {
|
|
1924
|
+
z.dataTypes = R;
|
|
1925
1925
|
return;
|
|
1926
1926
|
}
|
|
1927
1927
|
R.forEach(($) => {
|
|
1928
|
-
T(
|
|
1929
|
-
}), x(
|
|
1928
|
+
T(z.dataTypes, $) || A(z, `type "${$}" not allowed by context "${z.dataTypes.join(",")}"`);
|
|
1929
|
+
}), x(z, R);
|
|
1930
1930
|
}
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1933
|
-
R.length > 1 && !(R.length === 2 && R.includes("null")) &&
|
|
1932
|
+
function D(z, R) {
|
|
1933
|
+
R.length > 1 && !(R.length === 2 && R.includes("null")) && A(z, "use allowUnionTypes to allow union type keyword");
|
|
1934
1934
|
}
|
|
1935
|
-
function
|
|
1936
|
-
const $ =
|
|
1937
|
-
for (const
|
|
1938
|
-
const Y = $[
|
|
1939
|
-
if (typeof Y == "object" && (0, c.shouldUseRule)(
|
|
1935
|
+
function I(z, R) {
|
|
1936
|
+
const $ = z.self.RULES.all;
|
|
1937
|
+
for (const V in $) {
|
|
1938
|
+
const Y = $[V];
|
|
1939
|
+
if (typeof Y == "object" && (0, c.shouldUseRule)(z.schema, Y)) {
|
|
1940
1940
|
const { type: W } = Y.definition;
|
|
1941
|
-
W.length && !W.some((
|
|
1941
|
+
W.length && !W.some((se) => k(R, se)) && A(z, `missing type "${W.join(",")}" for keyword "${V}"`);
|
|
1942
1942
|
}
|
|
1943
1943
|
}
|
|
1944
1944
|
}
|
|
1945
|
-
function k(
|
|
1946
|
-
return
|
|
1945
|
+
function k(z, R) {
|
|
1946
|
+
return z.includes(R) || R === "number" && z.includes("integer");
|
|
1947
1947
|
}
|
|
1948
|
-
function T(
|
|
1949
|
-
return
|
|
1948
|
+
function T(z, R) {
|
|
1949
|
+
return z.includes(R) || R === "integer" && z.includes("number");
|
|
1950
1950
|
}
|
|
1951
|
-
function x(
|
|
1951
|
+
function x(z, R) {
|
|
1952
1952
|
const $ = [];
|
|
1953
|
-
for (const
|
|
1954
|
-
T(R,
|
|
1955
|
-
|
|
1956
|
-
}
|
|
1957
|
-
function
|
|
1958
|
-
const $ =
|
|
1959
|
-
R += ` at "${$}" (strictTypes)`, (0, y.checkStrictMode)(
|
|
1960
|
-
}
|
|
1961
|
-
class
|
|
1962
|
-
constructor(R, $,
|
|
1963
|
-
if ((0, h.validateKeywordUsage)(R, $,
|
|
1964
|
-
this.schemaCode = R.gen.const("vSchema",
|
|
1953
|
+
for (const V of z.dataTypes)
|
|
1954
|
+
T(R, V) ? $.push(V) : R.includes("integer") && V === "number" && $.push("integer");
|
|
1955
|
+
z.dataTypes = $;
|
|
1956
|
+
}
|
|
1957
|
+
function A(z, R) {
|
|
1958
|
+
const $ = z.schemaEnv.baseId + z.errSchemaPath;
|
|
1959
|
+
R += ` at "${$}" (strictTypes)`, (0, y.checkStrictMode)(z, R, z.opts.strictTypes);
|
|
1960
|
+
}
|
|
1961
|
+
class B {
|
|
1962
|
+
constructor(R, $, V) {
|
|
1963
|
+
if ((0, h.validateKeywordUsage)(R, $, V), this.gen = R.gen, this.allErrors = R.allErrors, this.keyword = V, this.data = R.data, this.schema = R.schema[V], this.$data = $.$data && R.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, y.schemaRefOrVal)(R, this.schema, V, this.$data), this.schemaType = $.schemaType, this.parentSchema = R.schema, this.params = {}, this.it = R, this.def = $, this.$data)
|
|
1964
|
+
this.schemaCode = R.gen.const("vSchema", K(this.$data, R));
|
|
1965
1965
|
else if (this.schemaCode = this.schemaValue, !(0, h.validSchemaType)(this.schema, $.schemaType, $.allowUndefined))
|
|
1966
|
-
throw new Error(`${
|
|
1966
|
+
throw new Error(`${V} value must be ${JSON.stringify($.schemaType)}`);
|
|
1967
1967
|
("code" in $ ? $.trackErrors : $.errors !== !1) && (this.errsCount = R.gen.const("_errs", v.default.errors));
|
|
1968
1968
|
}
|
|
1969
|
-
result(R, $,
|
|
1970
|
-
this.failResult((0, n.not)(R), $,
|
|
1969
|
+
result(R, $, V) {
|
|
1970
|
+
this.failResult((0, n.not)(R), $, V);
|
|
1971
1971
|
}
|
|
1972
|
-
failResult(R, $,
|
|
1973
|
-
this.gen.if(R),
|
|
1972
|
+
failResult(R, $, V) {
|
|
1973
|
+
this.gen.if(R), V ? V() : this.error(), $ ? (this.gen.else(), $(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
|
|
1974
1974
|
}
|
|
1975
1975
|
pass(R, $) {
|
|
1976
1976
|
this.failResult((0, n.not)(R), void 0, $);
|
|
@@ -1988,12 +1988,12 @@ function Jt() {
|
|
|
1988
1988
|
const { schemaCode: $ } = this;
|
|
1989
1989
|
this.fail((0, n._)`${$} !== undefined && (${(0, n.or)(this.invalid$data(), R)})`);
|
|
1990
1990
|
}
|
|
1991
|
-
error(R, $,
|
|
1991
|
+
error(R, $, V) {
|
|
1992
1992
|
if ($) {
|
|
1993
|
-
this.setParams($), this._error(R,
|
|
1993
|
+
this.setParams($), this._error(R, V), this.setParams({});
|
|
1994
1994
|
return;
|
|
1995
1995
|
}
|
|
1996
|
-
this._error(R,
|
|
1996
|
+
this._error(R, V);
|
|
1997
1997
|
}
|
|
1998
1998
|
_error(R, $) {
|
|
1999
1999
|
(R ? E.reportExtraError : E.reportError)(this, this.def.error, $);
|
|
@@ -2012,92 +2012,92 @@ function Jt() {
|
|
|
2012
2012
|
setParams(R, $) {
|
|
2013
2013
|
$ ? Object.assign(this.params, R) : this.params = R;
|
|
2014
2014
|
}
|
|
2015
|
-
block$data(R, $,
|
|
2015
|
+
block$data(R, $, V = n.nil) {
|
|
2016
2016
|
this.gen.block(() => {
|
|
2017
|
-
this.check$data(R,
|
|
2017
|
+
this.check$data(R, V), $();
|
|
2018
2018
|
});
|
|
2019
2019
|
}
|
|
2020
2020
|
check$data(R = n.nil, $ = n.nil) {
|
|
2021
2021
|
if (!this.$data)
|
|
2022
2022
|
return;
|
|
2023
|
-
const { gen:
|
|
2024
|
-
|
|
2023
|
+
const { gen: V, schemaCode: Y, schemaType: W, def: se } = this;
|
|
2024
|
+
V.if((0, n.or)((0, n._)`${Y} === undefined`, $)), R !== n.nil && V.assign(R, !0), (W.length || se.validateSchema) && (V.elseIf(this.invalid$data()), this.$dataError(), R !== n.nil && V.assign(R, !1)), V.else();
|
|
2025
2025
|
}
|
|
2026
2026
|
invalid$data() {
|
|
2027
|
-
const { gen: R, schemaCode: $, schemaType:
|
|
2028
|
-
return (0, n.or)(
|
|
2029
|
-
function
|
|
2030
|
-
if (
|
|
2027
|
+
const { gen: R, schemaCode: $, schemaType: V, def: Y, it: W } = this;
|
|
2028
|
+
return (0, n.or)(se(), oe());
|
|
2029
|
+
function se() {
|
|
2030
|
+
if (V.length) {
|
|
2031
2031
|
if (!($ instanceof n.Name))
|
|
2032
2032
|
throw new Error("ajv implementation error");
|
|
2033
|
-
const
|
|
2034
|
-
return (0, n._)`${(0, u.checkDataTypes)(
|
|
2033
|
+
const he = Array.isArray(V) ? V : [V];
|
|
2034
|
+
return (0, n._)`${(0, u.checkDataTypes)(he, $, W.opts.strictNumbers, u.DataType.Wrong)}`;
|
|
2035
2035
|
}
|
|
2036
2036
|
return n.nil;
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2038
|
+
function oe() {
|
|
2039
2039
|
if (Y.validateSchema) {
|
|
2040
|
-
const
|
|
2041
|
-
return (0, n._)`!${
|
|
2040
|
+
const he = R.scopeValue("validate$data", { ref: Y.validateSchema });
|
|
2041
|
+
return (0, n._)`!${he}(${$})`;
|
|
2042
2042
|
}
|
|
2043
2043
|
return n.nil;
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
2046
|
subschema(R, $) {
|
|
2047
|
-
const
|
|
2048
|
-
(0, g.extendSubschemaData)(
|
|
2049
|
-
const Y = { ...this.it, ...
|
|
2047
|
+
const V = (0, g.getSubschema)(this.it, R);
|
|
2048
|
+
(0, g.extendSubschemaData)(V, this.it, R), (0, g.extendSubschemaMode)(V, R);
|
|
2049
|
+
const Y = { ...this.it, ...V, items: void 0, props: void 0 };
|
|
2050
2050
|
return p(Y, $), Y;
|
|
2051
2051
|
}
|
|
2052
2052
|
mergeEvaluated(R, $) {
|
|
2053
|
-
const { it:
|
|
2054
|
-
|
|
2053
|
+
const { it: V, gen: Y } = this;
|
|
2054
|
+
V.opts.unevaluated && (V.props !== !0 && R.props !== void 0 && (V.props = y.mergeEvaluated.props(Y, R.props, V.props, $)), V.items !== !0 && R.items !== void 0 && (V.items = y.mergeEvaluated.items(Y, R.items, V.items, $)));
|
|
2055
2055
|
}
|
|
2056
2056
|
mergeValidEvaluated(R, $) {
|
|
2057
|
-
const { it:
|
|
2058
|
-
if (
|
|
2057
|
+
const { it: V, gen: Y } = this;
|
|
2058
|
+
if (V.opts.unevaluated && (V.props !== !0 || V.items !== !0))
|
|
2059
2059
|
return Y.if($, () => this.mergeEvaluated(R, n.Name)), !0;
|
|
2060
2060
|
}
|
|
2061
2061
|
}
|
|
2062
|
-
Pe.KeywordCxt =
|
|
2063
|
-
function
|
|
2064
|
-
const Y = new
|
|
2065
|
-
"code" in $ ? $.code(Y,
|
|
2062
|
+
Pe.KeywordCxt = B;
|
|
2063
|
+
function O(z, R, $, V) {
|
|
2064
|
+
const Y = new B(z, $, R);
|
|
2065
|
+
"code" in $ ? $.code(Y, V) : Y.$data && $.validate ? (0, h.funcKeywordCode)(Y, $) : "macro" in $ ? (0, h.macroKeywordCode)(Y, $) : ($.compile || $.validate) && (0, h.funcKeywordCode)(Y, $);
|
|
2066
2066
|
}
|
|
2067
|
-
const
|
|
2068
|
-
function
|
|
2067
|
+
const N = /^\/(?:[^~]|~0|~1)*$/, q = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
2068
|
+
function K(z, { dataLevel: R, dataNames: $, dataPathArr: V }) {
|
|
2069
2069
|
let Y, W;
|
|
2070
|
-
if (
|
|
2070
|
+
if (z === "")
|
|
2071
2071
|
return v.default.rootData;
|
|
2072
|
-
if (
|
|
2073
|
-
if (!
|
|
2074
|
-
throw new Error(`Invalid JSON-pointer: ${
|
|
2075
|
-
Y =
|
|
2072
|
+
if (z[0] === "/") {
|
|
2073
|
+
if (!N.test(z))
|
|
2074
|
+
throw new Error(`Invalid JSON-pointer: ${z}`);
|
|
2075
|
+
Y = z, W = v.default.rootData;
|
|
2076
2076
|
} else {
|
|
2077
|
-
const me = q.exec(
|
|
2077
|
+
const me = q.exec(z);
|
|
2078
2078
|
if (!me)
|
|
2079
|
-
throw new Error(`Invalid JSON-pointer: ${
|
|
2079
|
+
throw new Error(`Invalid JSON-pointer: ${z}`);
|
|
2080
2080
|
const ue = +me[1];
|
|
2081
2081
|
if (Y = me[2], Y === "#") {
|
|
2082
2082
|
if (ue >= R)
|
|
2083
|
-
throw new Error(
|
|
2084
|
-
return
|
|
2083
|
+
throw new Error(he("property/index", ue));
|
|
2084
|
+
return V[R - ue];
|
|
2085
2085
|
}
|
|
2086
2086
|
if (ue > R)
|
|
2087
|
-
throw new Error(
|
|
2087
|
+
throw new Error(he("data", ue));
|
|
2088
2088
|
if (W = $[R - ue], !Y)
|
|
2089
2089
|
return W;
|
|
2090
2090
|
}
|
|
2091
|
-
let
|
|
2092
|
-
const
|
|
2093
|
-
for (const me of
|
|
2094
|
-
me && (W = (0, n._)`${W}${(0, n.getProperty)((0, y.unescapeJsonPointer)(me))}`,
|
|
2095
|
-
return
|
|
2096
|
-
function
|
|
2091
|
+
let se = W;
|
|
2092
|
+
const oe = Y.split("/");
|
|
2093
|
+
for (const me of oe)
|
|
2094
|
+
me && (W = (0, n._)`${W}${(0, n.getProperty)((0, y.unescapeJsonPointer)(me))}`, se = (0, n._)`${se} && ${W}`);
|
|
2095
|
+
return se;
|
|
2096
|
+
function he(me, ue) {
|
|
2097
2097
|
return `Cannot access ${me} ${ue} levels up, current level is ${R}`;
|
|
2098
2098
|
}
|
|
2099
2099
|
}
|
|
2100
|
-
return Pe.getData =
|
|
2100
|
+
return Pe.getData = K, Pe;
|
|
2101
2101
|
}
|
|
2102
2102
|
var li = {}, es;
|
|
2103
2103
|
function gn() {
|
|
@@ -2126,7 +2126,7 @@ var ye = {}, is;
|
|
|
2126
2126
|
function vn() {
|
|
2127
2127
|
if (is) return ye;
|
|
2128
2128
|
is = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.resolveSchema = ye.getCompilingSchema = ye.resolveRef = ye.compileSchema = ye.SchemaEnv = void 0;
|
|
2129
|
-
const l =
|
|
2129
|
+
const l = X(), o = gn(), c = De(), u = Tr(), _ = ne(), h = Jt();
|
|
2130
2130
|
class g {
|
|
2131
2131
|
constructor(f) {
|
|
2132
2132
|
var d;
|
|
@@ -2173,24 +2173,24 @@ function vn() {
|
|
|
2173
2173
|
opts: this.opts,
|
|
2174
2174
|
self: this
|
|
2175
2175
|
};
|
|
2176
|
-
let
|
|
2176
|
+
let L;
|
|
2177
2177
|
try {
|
|
2178
2178
|
this._compilations.add(s), (0, h.validateFunctionCode)(C), w.optimize(this.opts.code.optimize);
|
|
2179
|
-
const
|
|
2180
|
-
|
|
2181
|
-
const G = new Function(`${c.default.self}`, `${c.default.scope}`,
|
|
2182
|
-
if (this.scope.value(P, { ref: G }), G.errors = null, G.schema = s.schema, G.schemaEnv = s, s.$async && (G.$async = !0), this.opts.code.source === !0 && (G.source = { validateName: P, validateCode:
|
|
2183
|
-
const { props:
|
|
2179
|
+
const F = w.toString();
|
|
2180
|
+
L = `${w.scopeRefs(c.default.scope)}return ${F}`, this.opts.code.process && (L = this.opts.code.process(L, s));
|
|
2181
|
+
const G = new Function(`${c.default.self}`, `${c.default.scope}`, L)(this, this.scope.get());
|
|
2182
|
+
if (this.scope.value(P, { ref: G }), G.errors = null, G.schema = s.schema, G.schemaEnv = s, s.$async && (G.$async = !0), this.opts.code.source === !0 && (G.source = { validateName: P, validateCode: F, scopeValues: w._values }), this.opts.unevaluated) {
|
|
2183
|
+
const { props: H, items: Z } = C;
|
|
2184
2184
|
G.evaluated = {
|
|
2185
|
-
props:
|
|
2186
|
-
items:
|
|
2187
|
-
dynamicProps:
|
|
2188
|
-
dynamicItems:
|
|
2185
|
+
props: H instanceof l.Name ? void 0 : H,
|
|
2186
|
+
items: Z instanceof l.Name ? void 0 : Z,
|
|
2187
|
+
dynamicProps: H instanceof l.Name,
|
|
2188
|
+
dynamicItems: Z instanceof l.Name
|
|
2189
2189
|
}, G.source && (G.source.evaluated = (0, l.stringify)(G.evaluated));
|
|
2190
2190
|
}
|
|
2191
2191
|
return s.validate = G, s;
|
|
2192
|
-
} catch (
|
|
2193
|
-
throw delete s.validate, delete s.validateName,
|
|
2192
|
+
} catch (F) {
|
|
2193
|
+
throw delete s.validate, delete s.validateName, L && this.logger.error("Error compiling schema, function code:", L), F;
|
|
2194
2194
|
} finally {
|
|
2195
2195
|
this._compilations.delete(s);
|
|
2196
2196
|
}
|
|
@@ -2658,7 +2658,7 @@ function Ll() {
|
|
|
2658
2658
|
Object.defineProperty(l, "KeywordCxt", { enumerable: !0, get: function() {
|
|
2659
2659
|
return o.KeywordCxt;
|
|
2660
2660
|
} });
|
|
2661
|
-
var c =
|
|
2661
|
+
var c = X();
|
|
2662
2662
|
Object.defineProperty(l, "_", { enumerable: !0, get: function() {
|
|
2663
2663
|
return c._;
|
|
2664
2664
|
} }), Object.defineProperty(l, "str", { enumerable: !0, get: function() {
|
|
@@ -2672,7 +2672,7 @@ function Ll() {
|
|
|
2672
2672
|
} }), Object.defineProperty(l, "CodeGen", { enumerable: !0, get: function() {
|
|
2673
2673
|
return c.CodeGen;
|
|
2674
2674
|
} });
|
|
2675
|
-
const u = gn(), _ = Ir(), h = Co(), g = vn(), n =
|
|
2675
|
+
const u = gn(), _ = Ir(), h = Co(), g = vn(), n = X(), v = Tr(), S = yr(), y = ne(), E = kl, t = Dl(), a = (D, I) => new RegExp(D, I);
|
|
2676
2676
|
a.code = "new RegExp";
|
|
2677
2677
|
const e = ["removeAdditional", "useDefaults", "coerceTypes"], r = /* @__PURE__ */ new Set([
|
|
2678
2678
|
"validate",
|
|
@@ -2709,155 +2709,155 @@ function Ll() {
|
|
|
2709
2709
|
jsPropertySyntax: "",
|
|
2710
2710
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
2711
2711
|
}, d = 200;
|
|
2712
|
-
function p(
|
|
2713
|
-
var
|
|
2714
|
-
const ut =
|
|
2712
|
+
function p(D) {
|
|
2713
|
+
var I, k, T, x, A, B, O, N, q, K, z, R, $, V, Y, W, se, oe, he, me, ue, Qe, ve, zr, Fr;
|
|
2714
|
+
const ut = D.strict, Rr = (I = D.code) === null || I === void 0 ? void 0 : I.optimize, Fn = Rr === !0 || Rr === void 0 ? 1 : Rr || 0, Rn = (T = (k = D.code) === null || k === void 0 ? void 0 : k.regExp) !== null && T !== void 0 ? T : a, pl = (x = D.uriResolver) !== null && x !== void 0 ? x : t.default;
|
|
2715
2715
|
return {
|
|
2716
|
-
strictSchema: (
|
|
2717
|
-
strictNumbers: (
|
|
2718
|
-
strictTypes: (
|
|
2719
|
-
strictTuples: (R = (
|
|
2720
|
-
strictRequired: (
|
|
2721
|
-
code:
|
|
2722
|
-
loopRequired: (Y =
|
|
2723
|
-
loopEnum: (W =
|
|
2724
|
-
meta: (
|
|
2725
|
-
messages: (
|
|
2726
|
-
inlineRefs: (
|
|
2727
|
-
schemaId: (me =
|
|
2728
|
-
addUsedSchema: (ue =
|
|
2729
|
-
validateSchema: (Qe =
|
|
2730
|
-
validateFormats: (ve =
|
|
2731
|
-
unicodeRegExp: (zr =
|
|
2732
|
-
int32range: (Fr =
|
|
2716
|
+
strictSchema: (B = (A = D.strictSchema) !== null && A !== void 0 ? A : ut) !== null && B !== void 0 ? B : !0,
|
|
2717
|
+
strictNumbers: (N = (O = D.strictNumbers) !== null && O !== void 0 ? O : ut) !== null && N !== void 0 ? N : !0,
|
|
2718
|
+
strictTypes: (K = (q = D.strictTypes) !== null && q !== void 0 ? q : ut) !== null && K !== void 0 ? K : "log",
|
|
2719
|
+
strictTuples: (R = (z = D.strictTuples) !== null && z !== void 0 ? z : ut) !== null && R !== void 0 ? R : "log",
|
|
2720
|
+
strictRequired: (V = ($ = D.strictRequired) !== null && $ !== void 0 ? $ : ut) !== null && V !== void 0 ? V : !1,
|
|
2721
|
+
code: D.code ? { ...D.code, optimize: Fn, regExp: Rn } : { optimize: Fn, regExp: Rn },
|
|
2722
|
+
loopRequired: (Y = D.loopRequired) !== null && Y !== void 0 ? Y : d,
|
|
2723
|
+
loopEnum: (W = D.loopEnum) !== null && W !== void 0 ? W : d,
|
|
2724
|
+
meta: (se = D.meta) !== null && se !== void 0 ? se : !0,
|
|
2725
|
+
messages: (oe = D.messages) !== null && oe !== void 0 ? oe : !0,
|
|
2726
|
+
inlineRefs: (he = D.inlineRefs) !== null && he !== void 0 ? he : !0,
|
|
2727
|
+
schemaId: (me = D.schemaId) !== null && me !== void 0 ? me : "$id",
|
|
2728
|
+
addUsedSchema: (ue = D.addUsedSchema) !== null && ue !== void 0 ? ue : !0,
|
|
2729
|
+
validateSchema: (Qe = D.validateSchema) !== null && Qe !== void 0 ? Qe : !0,
|
|
2730
|
+
validateFormats: (ve = D.validateFormats) !== null && ve !== void 0 ? ve : !0,
|
|
2731
|
+
unicodeRegExp: (zr = D.unicodeRegExp) !== null && zr !== void 0 ? zr : !0,
|
|
2732
|
+
int32range: (Fr = D.int32range) !== null && Fr !== void 0 ? Fr : !0,
|
|
2733
2733
|
uriResolver: pl
|
|
2734
2734
|
};
|
|
2735
2735
|
}
|
|
2736
2736
|
class m {
|
|
2737
|
-
constructor(
|
|
2738
|
-
this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(),
|
|
2737
|
+
constructor(I = {}) {
|
|
2738
|
+
this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), I = this.opts = { ...I, ...p(I) };
|
|
2739
2739
|
const { es5: k, lines: T } = this.opts.code;
|
|
2740
|
-
this.scope = new n.ValueScope({ scope: {}, prefixes: r, es5: k, lines: T }), this.logger = M(
|
|
2741
|
-
const x =
|
|
2742
|
-
|
|
2740
|
+
this.scope = new n.ValueScope({ scope: {}, prefixes: r, es5: k, lines: T }), this.logger = M(I.logger);
|
|
2741
|
+
const x = I.validateFormats;
|
|
2742
|
+
I.validateFormats = !1, this.RULES = (0, h.getRules)(), b.call(this, s, I, "NOT SUPPORTED"), b.call(this, f, I, "DEPRECATED", "warn"), this._metaOpts = L.call(this), I.formats && P.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), I.keywords && C.call(this, I.keywords), typeof I.meta == "object" && this.addMetaSchema(I.meta), U.call(this), I.validateFormats = x;
|
|
2743
2743
|
}
|
|
2744
2744
|
_addVocabularies() {
|
|
2745
2745
|
this.addKeyword("$async");
|
|
2746
2746
|
}
|
|
2747
2747
|
_addDefaultMetaSchema() {
|
|
2748
|
-
const { $data:
|
|
2748
|
+
const { $data: I, meta: k, schemaId: T } = this.opts;
|
|
2749
2749
|
let x = E;
|
|
2750
|
-
T === "id" && (x = { ...E }, x.id = x.$id, delete x.$id), k &&
|
|
2750
|
+
T === "id" && (x = { ...E }, x.id = x.$id, delete x.$id), k && I && this.addMetaSchema(x, x[T], !1);
|
|
2751
2751
|
}
|
|
2752
2752
|
defaultMeta() {
|
|
2753
|
-
const { meta:
|
|
2754
|
-
return this.opts.defaultMeta = typeof
|
|
2753
|
+
const { meta: I, schemaId: k } = this.opts;
|
|
2754
|
+
return this.opts.defaultMeta = typeof I == "object" ? I[k] || I : void 0;
|
|
2755
2755
|
}
|
|
2756
|
-
validate(
|
|
2756
|
+
validate(I, k) {
|
|
2757
2757
|
let T;
|
|
2758
|
-
if (typeof
|
|
2759
|
-
if (T = this.getSchema(
|
|
2760
|
-
throw new Error(`no schema with key or ref "${
|
|
2758
|
+
if (typeof I == "string") {
|
|
2759
|
+
if (T = this.getSchema(I), !T)
|
|
2760
|
+
throw new Error(`no schema with key or ref "${I}"`);
|
|
2761
2761
|
} else
|
|
2762
|
-
T = this.compile(
|
|
2762
|
+
T = this.compile(I);
|
|
2763
2763
|
const x = T(k);
|
|
2764
2764
|
return "$async" in T || (this.errors = T.errors), x;
|
|
2765
2765
|
}
|
|
2766
|
-
compile(
|
|
2767
|
-
const T = this._addSchema(
|
|
2766
|
+
compile(I, k) {
|
|
2767
|
+
const T = this._addSchema(I, k);
|
|
2768
2768
|
return T.validate || this._compileSchemaEnv(T);
|
|
2769
2769
|
}
|
|
2770
|
-
compileAsync(
|
|
2770
|
+
compileAsync(I, k) {
|
|
2771
2771
|
if (typeof this.opts.loadSchema != "function")
|
|
2772
2772
|
throw new Error("options.loadSchema should be a function");
|
|
2773
2773
|
const { loadSchema: T } = this.opts;
|
|
2774
|
-
return x.call(this,
|
|
2775
|
-
async function x(
|
|
2776
|
-
await
|
|
2777
|
-
const R = this._addSchema(
|
|
2778
|
-
return R.validate ||
|
|
2774
|
+
return x.call(this, I, k);
|
|
2775
|
+
async function x(K, z) {
|
|
2776
|
+
await A.call(this, K.$schema);
|
|
2777
|
+
const R = this._addSchema(K, z);
|
|
2778
|
+
return R.validate || B.call(this, R);
|
|
2779
2779
|
}
|
|
2780
|
-
async function
|
|
2781
|
-
|
|
2780
|
+
async function A(K) {
|
|
2781
|
+
K && !this.getSchema(K) && await x.call(this, { $ref: K }, !0);
|
|
2782
2782
|
}
|
|
2783
|
-
async function
|
|
2783
|
+
async function B(K) {
|
|
2784
2784
|
try {
|
|
2785
|
-
return this._compileSchemaEnv(
|
|
2786
|
-
} catch (
|
|
2787
|
-
if (!(
|
|
2788
|
-
throw
|
|
2789
|
-
return
|
|
2785
|
+
return this._compileSchemaEnv(K);
|
|
2786
|
+
} catch (z) {
|
|
2787
|
+
if (!(z instanceof _.default))
|
|
2788
|
+
throw z;
|
|
2789
|
+
return O.call(this, z), await N.call(this, z.missingSchema), B.call(this, K);
|
|
2790
2790
|
}
|
|
2791
2791
|
}
|
|
2792
|
-
function
|
|
2793
|
-
if (this.refs[
|
|
2794
|
-
throw new Error(`AnySchema ${
|
|
2792
|
+
function O({ missingSchema: K, missingRef: z }) {
|
|
2793
|
+
if (this.refs[K])
|
|
2794
|
+
throw new Error(`AnySchema ${K} is loaded but ${z} cannot be resolved`);
|
|
2795
2795
|
}
|
|
2796
|
-
async function
|
|
2797
|
-
const
|
|
2798
|
-
this.refs[
|
|
2796
|
+
async function N(K) {
|
|
2797
|
+
const z = await q.call(this, K);
|
|
2798
|
+
this.refs[K] || await A.call(this, z.$schema), this.refs[K] || this.addSchema(z, K, k);
|
|
2799
2799
|
}
|
|
2800
|
-
async function q(
|
|
2801
|
-
const
|
|
2802
|
-
if (
|
|
2803
|
-
return
|
|
2800
|
+
async function q(K) {
|
|
2801
|
+
const z = this._loading[K];
|
|
2802
|
+
if (z)
|
|
2803
|
+
return z;
|
|
2804
2804
|
try {
|
|
2805
|
-
return await (this._loading[
|
|
2805
|
+
return await (this._loading[K] = T(K));
|
|
2806
2806
|
} finally {
|
|
2807
|
-
delete this._loading[
|
|
2807
|
+
delete this._loading[K];
|
|
2808
2808
|
}
|
|
2809
2809
|
}
|
|
2810
2810
|
}
|
|
2811
2811
|
// Adds schema to the instance
|
|
2812
|
-
addSchema(
|
|
2813
|
-
if (Array.isArray(
|
|
2814
|
-
for (const
|
|
2815
|
-
this.addSchema(
|
|
2812
|
+
addSchema(I, k, T, x = this.opts.validateSchema) {
|
|
2813
|
+
if (Array.isArray(I)) {
|
|
2814
|
+
for (const B of I)
|
|
2815
|
+
this.addSchema(B, void 0, T, x);
|
|
2816
2816
|
return this;
|
|
2817
2817
|
}
|
|
2818
|
-
let
|
|
2819
|
-
if (typeof
|
|
2820
|
-
const { schemaId:
|
|
2821
|
-
if (
|
|
2822
|
-
throw new Error(`schema ${
|
|
2818
|
+
let A;
|
|
2819
|
+
if (typeof I == "object") {
|
|
2820
|
+
const { schemaId: B } = this.opts;
|
|
2821
|
+
if (A = I[B], A !== void 0 && typeof A != "string")
|
|
2822
|
+
throw new Error(`schema ${B} must be string`);
|
|
2823
2823
|
}
|
|
2824
|
-
return k = (0, v.normalizeId)(k ||
|
|
2824
|
+
return k = (0, v.normalizeId)(k || A), this._checkUnique(k), this.schemas[k] = this._addSchema(I, T, k, x, !0), this;
|
|
2825
2825
|
}
|
|
2826
2826
|
// Add schema that will be used to validate other schemas
|
|
2827
2827
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
2828
|
-
addMetaSchema(
|
|
2829
|
-
return this.addSchema(
|
|
2828
|
+
addMetaSchema(I, k, T = this.opts.validateSchema) {
|
|
2829
|
+
return this.addSchema(I, k, !0, T), this;
|
|
2830
2830
|
}
|
|
2831
2831
|
// Validate schema against its meta-schema
|
|
2832
|
-
validateSchema(
|
|
2833
|
-
if (typeof
|
|
2832
|
+
validateSchema(I, k) {
|
|
2833
|
+
if (typeof I == "boolean")
|
|
2834
2834
|
return !0;
|
|
2835
2835
|
let T;
|
|
2836
|
-
if (T =
|
|
2836
|
+
if (T = I.$schema, T !== void 0 && typeof T != "string")
|
|
2837
2837
|
throw new Error("$schema must be a string");
|
|
2838
2838
|
if (T = T || this.opts.defaultMeta || this.defaultMeta(), !T)
|
|
2839
2839
|
return this.logger.warn("meta-schema not available"), this.errors = null, !0;
|
|
2840
|
-
const x = this.validate(T,
|
|
2840
|
+
const x = this.validate(T, I);
|
|
2841
2841
|
if (!x && k) {
|
|
2842
|
-
const
|
|
2842
|
+
const A = "schema is invalid: " + this.errorsText();
|
|
2843
2843
|
if (this.opts.validateSchema === "log")
|
|
2844
|
-
this.logger.error(
|
|
2844
|
+
this.logger.error(A);
|
|
2845
2845
|
else
|
|
2846
|
-
throw new Error(
|
|
2846
|
+
throw new Error(A);
|
|
2847
2847
|
}
|
|
2848
2848
|
return x;
|
|
2849
2849
|
}
|
|
2850
2850
|
// Get compiled schema by `key` or `ref`.
|
|
2851
2851
|
// (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
|
|
2852
|
-
getSchema(
|
|
2852
|
+
getSchema(I) {
|
|
2853
2853
|
let k;
|
|
2854
|
-
for (; typeof (k = w.call(this,
|
|
2855
|
-
|
|
2854
|
+
for (; typeof (k = w.call(this, I)) == "string"; )
|
|
2855
|
+
I = k;
|
|
2856
2856
|
if (k === void 0) {
|
|
2857
2857
|
const { schemaId: T } = this.opts, x = new g.SchemaEnv({ schema: {}, schemaId: T });
|
|
2858
|
-
if (k = g.resolveSchema.call(this, x,
|
|
2858
|
+
if (k = g.resolveSchema.call(this, x, I), !k)
|
|
2859
2859
|
return;
|
|
2860
|
-
this.refs[
|
|
2860
|
+
this.refs[I] = k;
|
|
2861
2861
|
}
|
|
2862
2862
|
return k.validate || this._compileSchemaEnv(k);
|
|
2863
2863
|
}
|
|
@@ -2865,20 +2865,20 @@ function Ll() {
|
|
|
2865
2865
|
// If no parameter is passed all schemas but meta-schemas are removed.
|
|
2866
2866
|
// If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
|
|
2867
2867
|
// Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
|
|
2868
|
-
removeSchema(
|
|
2869
|
-
if (
|
|
2870
|
-
return this._removeAllSchemas(this.schemas,
|
|
2871
|
-
switch (typeof
|
|
2868
|
+
removeSchema(I) {
|
|
2869
|
+
if (I instanceof RegExp)
|
|
2870
|
+
return this._removeAllSchemas(this.schemas, I), this._removeAllSchemas(this.refs, I), this;
|
|
2871
|
+
switch (typeof I) {
|
|
2872
2872
|
case "undefined":
|
|
2873
2873
|
return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
|
|
2874
2874
|
case "string": {
|
|
2875
|
-
const k = w.call(this,
|
|
2876
|
-
return typeof k == "object" && this._cache.delete(k.schema), delete this.schemas[
|
|
2875
|
+
const k = w.call(this, I);
|
|
2876
|
+
return typeof k == "object" && this._cache.delete(k.schema), delete this.schemas[I], delete this.refs[I], this;
|
|
2877
2877
|
}
|
|
2878
2878
|
case "object": {
|
|
2879
|
-
const k =
|
|
2879
|
+
const k = I;
|
|
2880
2880
|
this._cache.delete(k);
|
|
2881
|
-
let T =
|
|
2881
|
+
let T = I[this.opts.schemaId];
|
|
2882
2882
|
return T && (T = (0, v.normalizeId)(T), delete this.schemas[T], delete this.refs[T]), this;
|
|
2883
2883
|
}
|
|
2884
2884
|
default:
|
|
@@ -2886,210 +2886,210 @@ function Ll() {
|
|
|
2886
2886
|
}
|
|
2887
2887
|
}
|
|
2888
2888
|
// add "vocabulary" - a collection of keywords
|
|
2889
|
-
addVocabulary(
|
|
2890
|
-
for (const k of
|
|
2889
|
+
addVocabulary(I) {
|
|
2890
|
+
for (const k of I)
|
|
2891
2891
|
this.addKeyword(k);
|
|
2892
2892
|
return this;
|
|
2893
2893
|
}
|
|
2894
|
-
addKeyword(
|
|
2894
|
+
addKeyword(I, k) {
|
|
2895
2895
|
let T;
|
|
2896
|
-
if (typeof
|
|
2897
|
-
T =
|
|
2898
|
-
else if (typeof
|
|
2899
|
-
if (k =
|
|
2896
|
+
if (typeof I == "string")
|
|
2897
|
+
T = I, typeof k == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), k.keyword = T);
|
|
2898
|
+
else if (typeof I == "object" && k === void 0) {
|
|
2899
|
+
if (k = I, T = k.keyword, Array.isArray(T) && !T.length)
|
|
2900
2900
|
throw new Error("addKeywords: keyword must be string or non-empty array");
|
|
2901
2901
|
} else
|
|
2902
2902
|
throw new Error("invalid addKeywords parameters");
|
|
2903
|
-
if (
|
|
2904
|
-
return (0, y.eachItem)(T, (
|
|
2905
|
-
|
|
2903
|
+
if (H.call(this, T, k), !k)
|
|
2904
|
+
return (0, y.eachItem)(T, (A) => Z.call(this, A)), this;
|
|
2905
|
+
ie.call(this, k);
|
|
2906
2906
|
const x = {
|
|
2907
2907
|
...k,
|
|
2908
2908
|
type: (0, S.getJSONTypes)(k.type),
|
|
2909
2909
|
schemaType: (0, S.getJSONTypes)(k.schemaType)
|
|
2910
2910
|
};
|
|
2911
|
-
return (0, y.eachItem)(T, x.type.length === 0 ? (
|
|
2911
|
+
return (0, y.eachItem)(T, x.type.length === 0 ? (A) => Z.call(this, A, x) : (A) => x.type.forEach((B) => Z.call(this, A, x, B))), this;
|
|
2912
2912
|
}
|
|
2913
|
-
getKeyword(
|
|
2914
|
-
const k = this.RULES.all[
|
|
2913
|
+
getKeyword(I) {
|
|
2914
|
+
const k = this.RULES.all[I];
|
|
2915
2915
|
return typeof k == "object" ? k.definition : !!k;
|
|
2916
2916
|
}
|
|
2917
2917
|
// Remove keyword
|
|
2918
|
-
removeKeyword(
|
|
2918
|
+
removeKeyword(I) {
|
|
2919
2919
|
const { RULES: k } = this;
|
|
2920
|
-
delete k.keywords[
|
|
2920
|
+
delete k.keywords[I], delete k.all[I];
|
|
2921
2921
|
for (const T of k.rules) {
|
|
2922
|
-
const x = T.rules.findIndex((
|
|
2922
|
+
const x = T.rules.findIndex((A) => A.keyword === I);
|
|
2923
2923
|
x >= 0 && T.rules.splice(x, 1);
|
|
2924
2924
|
}
|
|
2925
2925
|
return this;
|
|
2926
2926
|
}
|
|
2927
2927
|
// Add format
|
|
2928
|
-
addFormat(
|
|
2929
|
-
return typeof k == "string" && (k = new RegExp(k)), this.formats[
|
|
2928
|
+
addFormat(I, k) {
|
|
2929
|
+
return typeof k == "string" && (k = new RegExp(k)), this.formats[I] = k, this;
|
|
2930
2930
|
}
|
|
2931
|
-
errorsText(
|
|
2932
|
-
return !
|
|
2931
|
+
errorsText(I = this.errors, { separator: k = ", ", dataVar: T = "data" } = {}) {
|
|
2932
|
+
return !I || I.length === 0 ? "No errors" : I.map((x) => `${T}${x.instancePath} ${x.message}`).reduce((x, A) => x + k + A);
|
|
2933
2933
|
}
|
|
2934
|
-
$dataMetaSchema(
|
|
2934
|
+
$dataMetaSchema(I, k) {
|
|
2935
2935
|
const T = this.RULES.all;
|
|
2936
|
-
|
|
2936
|
+
I = JSON.parse(JSON.stringify(I));
|
|
2937
2937
|
for (const x of k) {
|
|
2938
|
-
const
|
|
2939
|
-
let
|
|
2940
|
-
for (const
|
|
2941
|
-
|
|
2942
|
-
for (const
|
|
2943
|
-
const
|
|
2944
|
-
if (typeof
|
|
2938
|
+
const A = x.split("/").slice(1);
|
|
2939
|
+
let B = I;
|
|
2940
|
+
for (const O of A)
|
|
2941
|
+
B = B[O];
|
|
2942
|
+
for (const O in T) {
|
|
2943
|
+
const N = T[O];
|
|
2944
|
+
if (typeof N != "object")
|
|
2945
2945
|
continue;
|
|
2946
|
-
const { $data: q } =
|
|
2947
|
-
q &&
|
|
2946
|
+
const { $data: q } = N.definition, K = B[O];
|
|
2947
|
+
q && K && (B[O] = j(K));
|
|
2948
2948
|
}
|
|
2949
2949
|
}
|
|
2950
|
-
return
|
|
2950
|
+
return I;
|
|
2951
2951
|
}
|
|
2952
|
-
_removeAllSchemas(
|
|
2953
|
-
for (const T in
|
|
2954
|
-
const x =
|
|
2955
|
-
(!k || k.test(T)) && (typeof x == "string" ? delete
|
|
2952
|
+
_removeAllSchemas(I, k) {
|
|
2953
|
+
for (const T in I) {
|
|
2954
|
+
const x = I[T];
|
|
2955
|
+
(!k || k.test(T)) && (typeof x == "string" ? delete I[T] : x && !x.meta && (this._cache.delete(x.schema), delete I[T]));
|
|
2956
2956
|
}
|
|
2957
2957
|
}
|
|
2958
|
-
_addSchema(
|
|
2959
|
-
let
|
|
2960
|
-
const { schemaId:
|
|
2961
|
-
if (typeof
|
|
2962
|
-
|
|
2958
|
+
_addSchema(I, k, T, x = this.opts.validateSchema, A = this.opts.addUsedSchema) {
|
|
2959
|
+
let B;
|
|
2960
|
+
const { schemaId: O } = this.opts;
|
|
2961
|
+
if (typeof I == "object")
|
|
2962
|
+
B = I[O];
|
|
2963
2963
|
else {
|
|
2964
2964
|
if (this.opts.jtd)
|
|
2965
2965
|
throw new Error("schema must be object");
|
|
2966
|
-
if (typeof
|
|
2966
|
+
if (typeof I != "boolean")
|
|
2967
2967
|
throw new Error("schema must be object or boolean");
|
|
2968
2968
|
}
|
|
2969
|
-
let
|
|
2970
|
-
if (
|
|
2971
|
-
return
|
|
2972
|
-
T = (0, v.normalizeId)(
|
|
2973
|
-
const q = v.getSchemaRefs.call(this,
|
|
2974
|
-
return
|
|
2969
|
+
let N = this._cache.get(I);
|
|
2970
|
+
if (N !== void 0)
|
|
2971
|
+
return N;
|
|
2972
|
+
T = (0, v.normalizeId)(B || T);
|
|
2973
|
+
const q = v.getSchemaRefs.call(this, I, T);
|
|
2974
|
+
return N = new g.SchemaEnv({ schema: I, schemaId: O, meta: k, baseId: T, localRefs: q }), this._cache.set(N.schema, N), A && !T.startsWith("#") && (T && this._checkUnique(T), this.refs[T] = N), x && this.validateSchema(I, !0), N;
|
|
2975
2975
|
}
|
|
2976
|
-
_checkUnique(
|
|
2977
|
-
if (this.schemas[
|
|
2978
|
-
throw new Error(`schema with key or id "${
|
|
2976
|
+
_checkUnique(I) {
|
|
2977
|
+
if (this.schemas[I] || this.refs[I])
|
|
2978
|
+
throw new Error(`schema with key or id "${I}" already exists`);
|
|
2979
2979
|
}
|
|
2980
|
-
_compileSchemaEnv(
|
|
2981
|
-
if (
|
|
2980
|
+
_compileSchemaEnv(I) {
|
|
2981
|
+
if (I.meta ? this._compileMetaSchema(I) : g.compileSchema.call(this, I), !I.validate)
|
|
2982
2982
|
throw new Error("ajv implementation error");
|
|
2983
|
-
return
|
|
2983
|
+
return I.validate;
|
|
2984
2984
|
}
|
|
2985
|
-
_compileMetaSchema(
|
|
2985
|
+
_compileMetaSchema(I) {
|
|
2986
2986
|
const k = this.opts;
|
|
2987
2987
|
this.opts = this._metaOpts;
|
|
2988
2988
|
try {
|
|
2989
|
-
g.compileSchema.call(this,
|
|
2989
|
+
g.compileSchema.call(this, I);
|
|
2990
2990
|
} finally {
|
|
2991
2991
|
this.opts = k;
|
|
2992
2992
|
}
|
|
2993
2993
|
}
|
|
2994
2994
|
}
|
|
2995
2995
|
m.ValidationError = u.default, m.MissingRefError = _.default, l.default = m;
|
|
2996
|
-
function b(
|
|
2997
|
-
for (const x in
|
|
2998
|
-
const
|
|
2999
|
-
|
|
2996
|
+
function b(D, I, k, T = "error") {
|
|
2997
|
+
for (const x in D) {
|
|
2998
|
+
const A = x;
|
|
2999
|
+
A in I && this.logger[T](`${k}: option ${x}. ${D[A]}`);
|
|
3000
3000
|
}
|
|
3001
3001
|
}
|
|
3002
|
-
function w(
|
|
3003
|
-
return
|
|
3002
|
+
function w(D) {
|
|
3003
|
+
return D = (0, v.normalizeId)(D), this.schemas[D] || this.refs[D];
|
|
3004
3004
|
}
|
|
3005
3005
|
function U() {
|
|
3006
|
-
const
|
|
3007
|
-
if (
|
|
3008
|
-
if (Array.isArray(
|
|
3009
|
-
this.addSchema(
|
|
3006
|
+
const D = this.opts.schemas;
|
|
3007
|
+
if (D)
|
|
3008
|
+
if (Array.isArray(D))
|
|
3009
|
+
this.addSchema(D);
|
|
3010
3010
|
else
|
|
3011
|
-
for (const
|
|
3012
|
-
this.addSchema(
|
|
3011
|
+
for (const I in D)
|
|
3012
|
+
this.addSchema(D[I], I);
|
|
3013
3013
|
}
|
|
3014
3014
|
function P() {
|
|
3015
|
-
for (const
|
|
3016
|
-
const
|
|
3017
|
-
|
|
3015
|
+
for (const D in this.opts.formats) {
|
|
3016
|
+
const I = this.opts.formats[D];
|
|
3017
|
+
I && this.addFormat(D, I);
|
|
3018
3018
|
}
|
|
3019
3019
|
}
|
|
3020
|
-
function C(
|
|
3021
|
-
if (Array.isArray(
|
|
3022
|
-
this.addVocabulary(
|
|
3020
|
+
function C(D) {
|
|
3021
|
+
if (Array.isArray(D)) {
|
|
3022
|
+
this.addVocabulary(D);
|
|
3023
3023
|
return;
|
|
3024
3024
|
}
|
|
3025
3025
|
this.logger.warn("keywords option as map is deprecated, pass array");
|
|
3026
|
-
for (const
|
|
3027
|
-
const k =
|
|
3028
|
-
k.keyword || (k.keyword =
|
|
3026
|
+
for (const I in D) {
|
|
3027
|
+
const k = D[I];
|
|
3028
|
+
k.keyword || (k.keyword = I), this.addKeyword(k);
|
|
3029
3029
|
}
|
|
3030
3030
|
}
|
|
3031
|
-
function
|
|
3032
|
-
const
|
|
3033
|
-
for (const
|
|
3034
|
-
delete
|
|
3035
|
-
return
|
|
3031
|
+
function L() {
|
|
3032
|
+
const D = { ...this.opts };
|
|
3033
|
+
for (const I of e)
|
|
3034
|
+
delete D[I];
|
|
3035
|
+
return D;
|
|
3036
3036
|
}
|
|
3037
|
-
const
|
|
3037
|
+
const F = { log() {
|
|
3038
3038
|
}, warn() {
|
|
3039
3039
|
}, error() {
|
|
3040
3040
|
} };
|
|
3041
|
-
function M(
|
|
3042
|
-
if (
|
|
3043
|
-
return
|
|
3044
|
-
if (
|
|
3041
|
+
function M(D) {
|
|
3042
|
+
if (D === !1)
|
|
3043
|
+
return F;
|
|
3044
|
+
if (D === void 0)
|
|
3045
3045
|
return console;
|
|
3046
|
-
if (
|
|
3047
|
-
return
|
|
3046
|
+
if (D.log && D.warn && D.error)
|
|
3047
|
+
return D;
|
|
3048
3048
|
throw new Error("logger must implement log, warn and error methods");
|
|
3049
3049
|
}
|
|
3050
3050
|
const G = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
3051
|
-
function
|
|
3051
|
+
function H(D, I) {
|
|
3052
3052
|
const { RULES: k } = this;
|
|
3053
|
-
if ((0, y.eachItem)(
|
|
3053
|
+
if ((0, y.eachItem)(D, (T) => {
|
|
3054
3054
|
if (k.keywords[T])
|
|
3055
3055
|
throw new Error(`Keyword ${T} is already defined`);
|
|
3056
3056
|
if (!G.test(T))
|
|
3057
3057
|
throw new Error(`Keyword ${T} has invalid name`);
|
|
3058
|
-
}), !!
|
|
3058
|
+
}), !!I && I.$data && !("code" in I || "validate" in I))
|
|
3059
3059
|
throw new Error('$data keyword must have "code" or "validate" function');
|
|
3060
3060
|
}
|
|
3061
|
-
function
|
|
3061
|
+
function Z(D, I, k) {
|
|
3062
3062
|
var T;
|
|
3063
|
-
const x =
|
|
3063
|
+
const x = I?.post;
|
|
3064
3064
|
if (k && x)
|
|
3065
3065
|
throw new Error('keyword with "post" flag cannot have "type"');
|
|
3066
|
-
const { RULES:
|
|
3067
|
-
let
|
|
3068
|
-
if (
|
|
3066
|
+
const { RULES: A } = this;
|
|
3067
|
+
let B = x ? A.post : A.rules.find(({ type: N }) => N === k);
|
|
3068
|
+
if (B || (B = { type: k, rules: [] }, A.rules.push(B)), A.keywords[D] = !0, !I)
|
|
3069
3069
|
return;
|
|
3070
|
-
const
|
|
3071
|
-
keyword:
|
|
3070
|
+
const O = {
|
|
3071
|
+
keyword: D,
|
|
3072
3072
|
definition: {
|
|
3073
|
-
...
|
|
3074
|
-
type: (0, S.getJSONTypes)(
|
|
3075
|
-
schemaType: (0, S.getJSONTypes)(
|
|
3073
|
+
...I,
|
|
3074
|
+
type: (0, S.getJSONTypes)(I.type),
|
|
3075
|
+
schemaType: (0, S.getJSONTypes)(I.schemaType)
|
|
3076
3076
|
}
|
|
3077
3077
|
};
|
|
3078
|
-
|
|
3078
|
+
I.before ? Q.call(this, B, O, I.before) : B.rules.push(O), A.all[D] = O, (T = I.implements) === null || T === void 0 || T.forEach((N) => this.addKeyword(N));
|
|
3079
3079
|
}
|
|
3080
|
-
function
|
|
3081
|
-
const T =
|
|
3082
|
-
T >= 0 ?
|
|
3080
|
+
function Q(D, I, k) {
|
|
3081
|
+
const T = D.rules.findIndex((x) => x.keyword === k);
|
|
3082
|
+
T >= 0 ? D.rules.splice(T, 0, I) : (D.rules.push(I), this.logger.warn(`rule ${k} is not defined`));
|
|
3083
3083
|
}
|
|
3084
|
-
function
|
|
3085
|
-
let { metaSchema:
|
|
3086
|
-
|
|
3084
|
+
function ie(D) {
|
|
3085
|
+
let { metaSchema: I } = D;
|
|
3086
|
+
I !== void 0 && (D.$data && this.opts.$data && (I = j(I)), D.validateSchema = this.compile(I, !0));
|
|
3087
3087
|
}
|
|
3088
|
-
const
|
|
3088
|
+
const J = {
|
|
3089
3089
|
$ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
|
|
3090
3090
|
};
|
|
3091
|
-
function
|
|
3092
|
-
return { anyOf: [
|
|
3091
|
+
function j(D) {
|
|
3092
|
+
return { anyOf: [D, J] };
|
|
3093
3093
|
}
|
|
3094
3094
|
})(Br)), Br;
|
|
3095
3095
|
}
|
|
@@ -3109,7 +3109,7 @@ var Le = {}, fs;
|
|
|
3109
3109
|
function Ol() {
|
|
3110
3110
|
if (fs) return Le;
|
|
3111
3111
|
fs = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.callRef = Le.getValidate = void 0;
|
|
3112
|
-
const l = Ir(), o = Ee(), c =
|
|
3112
|
+
const l = Ir(), o = Ee(), c = X(), u = De(), _ = vn(), h = ne(), g = {
|
|
3113
3113
|
keyword: "$ref",
|
|
3114
3114
|
schemaType: "string",
|
|
3115
3115
|
code(S) {
|
|
@@ -3133,14 +3133,14 @@ function Ol() {
|
|
|
3133
3133
|
v(S, P, U, U.$async);
|
|
3134
3134
|
}
|
|
3135
3135
|
function w(U) {
|
|
3136
|
-
const P = y.scopeValue("schema", s.code.source === !0 ? { ref: U, code: (0, c.stringify)(U) } : { ref: U }), C = y.name("valid"),
|
|
3136
|
+
const P = y.scopeValue("schema", s.code.source === !0 ? { ref: U, code: (0, c.stringify)(U) } : { ref: U }), C = y.name("valid"), L = S.subschema({
|
|
3137
3137
|
schema: U,
|
|
3138
3138
|
dataTypes: [],
|
|
3139
3139
|
schemaPath: c.nil,
|
|
3140
3140
|
topSchemaRef: P,
|
|
3141
3141
|
errSchemaPath: E
|
|
3142
3142
|
}, C);
|
|
3143
|
-
S.mergeEvaluated(
|
|
3143
|
+
S.mergeEvaluated(L), S.ok(C);
|
|
3144
3144
|
}
|
|
3145
3145
|
}
|
|
3146
3146
|
};
|
|
@@ -3178,15 +3178,15 @@ function Ol() {
|
|
|
3178
3178
|
if (C && !C.dynamicProps)
|
|
3179
3179
|
C.props !== void 0 && (e.props = h.mergeEvaluated.props(a, C.props, e.props));
|
|
3180
3180
|
else {
|
|
3181
|
-
const
|
|
3182
|
-
e.props = h.mergeEvaluated.props(a,
|
|
3181
|
+
const L = a.var("props", (0, c._)`${U}.evaluated.props`);
|
|
3182
|
+
e.props = h.mergeEvaluated.props(a, L, e.props, c.Name);
|
|
3183
3183
|
}
|
|
3184
3184
|
if (e.items !== !0)
|
|
3185
3185
|
if (C && !C.dynamicItems)
|
|
3186
3186
|
C.items !== void 0 && (e.items = h.mergeEvaluated.items(a, C.items, e.items));
|
|
3187
3187
|
else {
|
|
3188
|
-
const
|
|
3189
|
-
e.items = h.mergeEvaluated.items(a,
|
|
3188
|
+
const L = a.var("items", (0, c._)`${U}.evaluated.items`);
|
|
3189
|
+
e.items = h.mergeEvaluated.items(a, L, e.items, c.Name);
|
|
3190
3190
|
}
|
|
3191
3191
|
}
|
|
3192
3192
|
}
|
|
@@ -3212,7 +3212,7 @@ var pi = {}, _i = {}, cs;
|
|
|
3212
3212
|
function Ml() {
|
|
3213
3213
|
if (cs) return _i;
|
|
3214
3214
|
cs = 1, Object.defineProperty(_i, "__esModule", { value: !0 });
|
|
3215
|
-
const l =
|
|
3215
|
+
const l = X(), o = l.operators, c = {
|
|
3216
3216
|
maximum: { okStr: "<=", ok: o.LTE, fail: o.GT },
|
|
3217
3217
|
minimum: { okStr: ">=", ok: o.GTE, fail: o.LT },
|
|
3218
3218
|
exclusiveMaximum: { okStr: "<", ok: o.LT, fail: o.GTE },
|
|
@@ -3237,7 +3237,7 @@ var mi = {}, hs;
|
|
|
3237
3237
|
function jl() {
|
|
3238
3238
|
if (hs) return mi;
|
|
3239
3239
|
hs = 1, Object.defineProperty(mi, "__esModule", { value: !0 });
|
|
3240
|
-
const l =
|
|
3240
|
+
const l = X(), c = {
|
|
3241
3241
|
keyword: "multipleOf",
|
|
3242
3242
|
type: "number",
|
|
3243
3243
|
schemaType: "number",
|
|
@@ -3270,7 +3270,7 @@ var _s;
|
|
|
3270
3270
|
function ql() {
|
|
3271
3271
|
if (_s) return yi;
|
|
3272
3272
|
_s = 1, Object.defineProperty(yi, "__esModule", { value: !0 });
|
|
3273
|
-
const l =
|
|
3273
|
+
const l = X(), o = ne(), c = Gl(), _ = {
|
|
3274
3274
|
keyword: ["maxLength", "minLength"],
|
|
3275
3275
|
type: "string",
|
|
3276
3276
|
schemaType: "number",
|
|
@@ -3293,7 +3293,7 @@ var vi = {}, ms;
|
|
|
3293
3293
|
function Vl() {
|
|
3294
3294
|
if (ms) return vi;
|
|
3295
3295
|
ms = 1, Object.defineProperty(vi, "__esModule", { value: !0 });
|
|
3296
|
-
const l = Ee(), o =
|
|
3296
|
+
const l = Ee(), o = X(), u = {
|
|
3297
3297
|
keyword: "pattern",
|
|
3298
3298
|
type: "string",
|
|
3299
3299
|
schemaType: "string",
|
|
@@ -3313,7 +3313,7 @@ var bi = {}, ys;
|
|
|
3313
3313
|
function Hl() {
|
|
3314
3314
|
if (ys) return bi;
|
|
3315
3315
|
ys = 1, Object.defineProperty(bi, "__esModule", { value: !0 });
|
|
3316
|
-
const l =
|
|
3316
|
+
const l = X(), c = {
|
|
3317
3317
|
keyword: ["maxProperties", "minProperties"],
|
|
3318
3318
|
type: "object",
|
|
3319
3319
|
schemaType: "number",
|
|
@@ -3336,7 +3336,7 @@ var wi = {}, gs;
|
|
|
3336
3336
|
function Yl() {
|
|
3337
3337
|
if (gs) return wi;
|
|
3338
3338
|
gs = 1, Object.defineProperty(wi, "__esModule", { value: !0 });
|
|
3339
|
-
const l = Ee(), o =
|
|
3339
|
+
const l = Ee(), o = X(), c = ne(), _ = {
|
|
3340
3340
|
keyword: "required",
|
|
3341
3341
|
type: "object",
|
|
3342
3342
|
schemaType: "array",
|
|
@@ -3393,7 +3393,7 @@ var Si = {}, vs;
|
|
|
3393
3393
|
function Kl() {
|
|
3394
3394
|
if (vs) return Si;
|
|
3395
3395
|
vs = 1, Object.defineProperty(Si, "__esModule", { value: !0 });
|
|
3396
|
-
const l =
|
|
3396
|
+
const l = X(), c = {
|
|
3397
3397
|
keyword: ["maxItems", "minItems"],
|
|
3398
3398
|
type: "array",
|
|
3399
3399
|
schemaType: "number",
|
|
@@ -3423,7 +3423,7 @@ var ws;
|
|
|
3423
3423
|
function Wl() {
|
|
3424
3424
|
if (ws) return xi;
|
|
3425
3425
|
ws = 1, Object.defineProperty(xi, "__esModule", { value: !0 });
|
|
3426
|
-
const l = yr(), o =
|
|
3426
|
+
const l = yr(), o = X(), c = ne(), u = bn(), h = {
|
|
3427
3427
|
keyword: "uniqueItems",
|
|
3428
3428
|
type: "array",
|
|
3429
3429
|
schemaType: "boolean",
|
|
@@ -3467,7 +3467,7 @@ var Ei = {}, Ss;
|
|
|
3467
3467
|
function Zl() {
|
|
3468
3468
|
if (Ss) return Ei;
|
|
3469
3469
|
Ss = 1, Object.defineProperty(Ei, "__esModule", { value: !0 });
|
|
3470
|
-
const l =
|
|
3470
|
+
const l = X(), o = ne(), c = bn(), _ = {
|
|
3471
3471
|
keyword: "const",
|
|
3472
3472
|
$data: !0,
|
|
3473
3473
|
error: {
|
|
@@ -3485,7 +3485,7 @@ var Ti = {}, xs;
|
|
|
3485
3485
|
function Xl() {
|
|
3486
3486
|
if (xs) return Ti;
|
|
3487
3487
|
xs = 1, Object.defineProperty(Ti, "__esModule", { value: !0 });
|
|
3488
|
-
const l =
|
|
3488
|
+
const l = X(), o = ne(), c = bn(), _ = {
|
|
3489
3489
|
keyword: "enum",
|
|
3490
3490
|
schemaType: "array",
|
|
3491
3491
|
$data: !0,
|
|
@@ -3550,7 +3550,7 @@ var Ii = {}, et = {}, Es;
|
|
|
3550
3550
|
function zo() {
|
|
3551
3551
|
if (Es) return et;
|
|
3552
3552
|
Es = 1, Object.defineProperty(et, "__esModule", { value: !0 }), et.validateAdditionalItems = void 0;
|
|
3553
|
-
const l =
|
|
3553
|
+
const l = X(), o = ne(), u = {
|
|
3554
3554
|
keyword: "additionalItems",
|
|
3555
3555
|
type: "array",
|
|
3556
3556
|
schemaType: ["boolean", "object"],
|
|
@@ -3590,7 +3590,7 @@ var Pi = {}, tt = {}, Ts;
|
|
|
3590
3590
|
function Fo() {
|
|
3591
3591
|
if (Ts) return tt;
|
|
3592
3592
|
Ts = 1, Object.defineProperty(tt, "__esModule", { value: !0 }), tt.validateTuple = void 0;
|
|
3593
|
-
const l =
|
|
3593
|
+
const l = X(), o = ne(), c = Ee(), u = {
|
|
3594
3594
|
keyword: "items",
|
|
3595
3595
|
type: "array",
|
|
3596
3596
|
schemaType: ["object", "array", "boolean"],
|
|
@@ -3640,7 +3640,7 @@ var Ai = {}, Ps;
|
|
|
3640
3640
|
function ed() {
|
|
3641
3641
|
if (Ps) return Ai;
|
|
3642
3642
|
Ps = 1, Object.defineProperty(Ai, "__esModule", { value: !0 });
|
|
3643
|
-
const l =
|
|
3643
|
+
const l = X(), o = ne(), c = Ee(), u = zo(), h = {
|
|
3644
3644
|
keyword: "items",
|
|
3645
3645
|
type: "array",
|
|
3646
3646
|
schemaType: ["object", "boolean"],
|
|
@@ -3660,7 +3660,7 @@ var Ci = {}, As;
|
|
|
3660
3660
|
function td() {
|
|
3661
3661
|
if (As) return Ci;
|
|
3662
3662
|
As = 1, Object.defineProperty(Ci, "__esModule", { value: !0 });
|
|
3663
|
-
const l =
|
|
3663
|
+
const l = X(), o = ne(), u = {
|
|
3664
3664
|
keyword: "contains",
|
|
3665
3665
|
type: "array",
|
|
3666
3666
|
schemaType: ["object", "boolean"],
|
|
@@ -3717,7 +3717,7 @@ var Vr = {}, Cs;
|
|
|
3717
3717
|
function id() {
|
|
3718
3718
|
return Cs || (Cs = 1, (function(l) {
|
|
3719
3719
|
Object.defineProperty(l, "__esModule", { value: !0 }), l.validateSchemaDeps = l.validatePropertyDeps = l.error = void 0;
|
|
3720
|
-
const o =
|
|
3720
|
+
const o = X(), c = ne(), u = Ee();
|
|
3721
3721
|
l.error = {
|
|
3722
3722
|
message: ({ params: { property: v, depsCount: S, deps: y } }) => {
|
|
3723
3723
|
const E = S === 1 ? "property" : "properties";
|
|
@@ -3790,7 +3790,7 @@ var ki = {}, ks;
|
|
|
3790
3790
|
function rd() {
|
|
3791
3791
|
if (ks) return ki;
|
|
3792
3792
|
ks = 1, Object.defineProperty(ki, "__esModule", { value: !0 });
|
|
3793
|
-
const l =
|
|
3793
|
+
const l = X(), o = ne(), u = {
|
|
3794
3794
|
keyword: "propertyNames",
|
|
3795
3795
|
type: "object",
|
|
3796
3796
|
schemaType: ["object", "boolean"],
|
|
@@ -3822,7 +3822,7 @@ var zi = {}, zs;
|
|
|
3822
3822
|
function Ro() {
|
|
3823
3823
|
if (zs) return zi;
|
|
3824
3824
|
zs = 1, Object.defineProperty(zi, "__esModule", { value: !0 });
|
|
3825
|
-
const l = Ee(), o =
|
|
3825
|
+
const l = Ee(), o = X(), c = De(), u = ne(), h = {
|
|
3826
3826
|
keyword: "additionalProperties",
|
|
3827
3827
|
type: ["object"],
|
|
3828
3828
|
schemaType: ["boolean", "object"],
|
|
@@ -3893,7 +3893,7 @@ var Fi = {}, Fs;
|
|
|
3893
3893
|
function nd() {
|
|
3894
3894
|
if (Fs) return Fi;
|
|
3895
3895
|
Fs = 1, Object.defineProperty(Fi, "__esModule", { value: !0 });
|
|
3896
|
-
const l = Jt(), o = Ee(), c =
|
|
3896
|
+
const l = Jt(), o = Ee(), c = ne(), u = Ro(), _ = {
|
|
3897
3897
|
keyword: "properties",
|
|
3898
3898
|
type: "object",
|
|
3899
3899
|
schemaType: "object",
|
|
@@ -3928,7 +3928,7 @@ var Ri = {}, Rs;
|
|
|
3928
3928
|
function sd() {
|
|
3929
3929
|
if (Rs) return Ri;
|
|
3930
3930
|
Rs = 1, Object.defineProperty(Ri, "__esModule", { value: !0 });
|
|
3931
|
-
const l = Ee(), o =
|
|
3931
|
+
const l = Ee(), o = X(), c = ne(), u = ne(), _ = {
|
|
3932
3932
|
keyword: "patternProperties",
|
|
3933
3933
|
type: "object",
|
|
3934
3934
|
schemaType: "object",
|
|
@@ -3969,7 +3969,7 @@ var Bi = {}, Bs;
|
|
|
3969
3969
|
function ad() {
|
|
3970
3970
|
if (Bs) return Bi;
|
|
3971
3971
|
Bs = 1, Object.defineProperty(Bi, "__esModule", { value: !0 });
|
|
3972
|
-
const l =
|
|
3972
|
+
const l = ne(), o = {
|
|
3973
3973
|
keyword: "not",
|
|
3974
3974
|
schemaType: ["object", "boolean"],
|
|
3975
3975
|
trackErrors: !0,
|
|
@@ -4008,7 +4008,7 @@ var Li = {}, Ls;
|
|
|
4008
4008
|
function ld() {
|
|
4009
4009
|
if (Ls) return Li;
|
|
4010
4010
|
Ls = 1, Object.defineProperty(Li, "__esModule", { value: !0 });
|
|
4011
|
-
const l =
|
|
4011
|
+
const l = X(), o = ne(), u = {
|
|
4012
4012
|
keyword: "oneOf",
|
|
4013
4013
|
schemaType: "array",
|
|
4014
4014
|
trackErrors: !0,
|
|
@@ -4044,7 +4044,7 @@ var $i = {}, $s;
|
|
|
4044
4044
|
function dd() {
|
|
4045
4045
|
if ($s) return $i;
|
|
4046
4046
|
$s = 1, Object.defineProperty($i, "__esModule", { value: !0 });
|
|
4047
|
-
const l =
|
|
4047
|
+
const l = ne(), o = {
|
|
4048
4048
|
keyword: "allOf",
|
|
4049
4049
|
schemaType: "array",
|
|
4050
4050
|
code(c) {
|
|
@@ -4066,7 +4066,7 @@ var Oi = {}, Os;
|
|
|
4066
4066
|
function fd() {
|
|
4067
4067
|
if (Os) return Oi;
|
|
4068
4068
|
Os = 1, Object.defineProperty(Oi, "__esModule", { value: !0 });
|
|
4069
|
-
const l =
|
|
4069
|
+
const l = X(), o = ne(), u = {
|
|
4070
4070
|
keyword: "if",
|
|
4071
4071
|
schemaType: ["object", "boolean"],
|
|
4072
4072
|
trackErrors: !0,
|
|
@@ -4113,7 +4113,7 @@ var Ni = {}, Ns;
|
|
|
4113
4113
|
function ud() {
|
|
4114
4114
|
if (Ns) return Ni;
|
|
4115
4115
|
Ns = 1, Object.defineProperty(Ni, "__esModule", { value: !0 });
|
|
4116
|
-
const l =
|
|
4116
|
+
const l = ne(), o = {
|
|
4117
4117
|
keyword: ["then", "else"],
|
|
4118
4118
|
schemaType: ["object", "boolean"],
|
|
4119
4119
|
code({ keyword: c, parentSchema: u, it: _ }) {
|
|
@@ -4151,7 +4151,7 @@ var Mi = {}, ji = {}, js;
|
|
|
4151
4151
|
function hd() {
|
|
4152
4152
|
if (js) return ji;
|
|
4153
4153
|
js = 1, Object.defineProperty(ji, "__esModule", { value: !0 });
|
|
4154
|
-
const l =
|
|
4154
|
+
const l = X(), c = {
|
|
4155
4155
|
keyword: "format",
|
|
4156
4156
|
type: ["number", "string"],
|
|
4157
4157
|
schemaType: "string",
|
|
@@ -4200,8 +4200,8 @@ function hd() {
|
|
|
4200
4200
|
}
|
|
4201
4201
|
}
|
|
4202
4202
|
function w(P) {
|
|
4203
|
-
const C = P instanceof RegExp ? (0, l.regexpCode)(P) : E.code.formats ? (0, l._)`${E.code.formats}${(0, l.getProperty)(v)}` : void 0,
|
|
4204
|
-
return typeof P == "object" && !(P instanceof RegExp) ? [P.type || "string", P.validate, (0, l._)`${
|
|
4203
|
+
const C = P instanceof RegExp ? (0, l.regexpCode)(P) : E.code.formats ? (0, l._)`${E.code.formats}${(0, l.getProperty)(v)}` : void 0, L = h.scopeValue("formats", { key: v, ref: P, code: C });
|
|
4204
|
+
return typeof P == "object" && !(P instanceof RegExp) ? [P.type || "string", P.validate, (0, l._)`${L}.validate`] : ["string", P, L];
|
|
4205
4205
|
}
|
|
4206
4206
|
function U() {
|
|
4207
4207
|
if (typeof f == "object" && !(f instanceof RegExp) && f.async) {
|
|
@@ -4266,7 +4266,7 @@ var Ys;
|
|
|
4266
4266
|
function gd() {
|
|
4267
4267
|
if (Ys) return Gi;
|
|
4268
4268
|
Ys = 1, Object.defineProperty(Gi, "__esModule", { value: !0 });
|
|
4269
|
-
const l =
|
|
4269
|
+
const l = X(), o = yd(), c = vn(), u = Ir(), _ = ne(), g = {
|
|
4270
4270
|
keyword: "discriminator",
|
|
4271
4271
|
type: "object",
|
|
4272
4272
|
schemaType: "object",
|
|
@@ -4302,37 +4302,37 @@ function gd() {
|
|
|
4302
4302
|
var m;
|
|
4303
4303
|
const b = {}, w = P(E);
|
|
4304
4304
|
let U = !0;
|
|
4305
|
-
for (let
|
|
4306
|
-
let M = a[
|
|
4305
|
+
for (let F = 0; F < a.length; F++) {
|
|
4306
|
+
let M = a[F];
|
|
4307
4307
|
if (M?.$ref && !(0, _.schemaHasRulesButRef)(M, t.self.RULES)) {
|
|
4308
|
-
const
|
|
4309
|
-
if (M = c.resolveRef.call(t.self, t.schemaEnv.root, t.baseId,
|
|
4310
|
-
throw new u.default(t.opts.uriResolver, t.baseId,
|
|
4308
|
+
const H = M.$ref;
|
|
4309
|
+
if (M = c.resolveRef.call(t.self, t.schemaEnv.root, t.baseId, H), M instanceof c.SchemaEnv && (M = M.schema), M === void 0)
|
|
4310
|
+
throw new u.default(t.opts.uriResolver, t.baseId, H);
|
|
4311
4311
|
}
|
|
4312
4312
|
const G = (m = M?.properties) === null || m === void 0 ? void 0 : m[e];
|
|
4313
4313
|
if (typeof G != "object")
|
|
4314
4314
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${e}"`);
|
|
4315
|
-
U = U && (w || P(M)), C(G,
|
|
4315
|
+
U = U && (w || P(M)), C(G, F);
|
|
4316
4316
|
}
|
|
4317
4317
|
if (!U)
|
|
4318
4318
|
throw new Error(`discriminator: "${e}" must be required`);
|
|
4319
4319
|
return b;
|
|
4320
|
-
function P({ required:
|
|
4321
|
-
return Array.isArray(
|
|
4322
|
-
}
|
|
4323
|
-
function C(
|
|
4324
|
-
if (
|
|
4325
|
-
|
|
4326
|
-
else if (
|
|
4327
|
-
for (const G of
|
|
4328
|
-
|
|
4320
|
+
function P({ required: F }) {
|
|
4321
|
+
return Array.isArray(F) && F.includes(e);
|
|
4322
|
+
}
|
|
4323
|
+
function C(F, M) {
|
|
4324
|
+
if (F.const)
|
|
4325
|
+
L(F.const, M);
|
|
4326
|
+
else if (F.enum)
|
|
4327
|
+
for (const G of F.enum)
|
|
4328
|
+
L(G, M);
|
|
4329
4329
|
else
|
|
4330
4330
|
throw new Error(`discriminator: "properties/${e}" must have "const" or "enum"`);
|
|
4331
4331
|
}
|
|
4332
|
-
function
|
|
4333
|
-
if (typeof
|
|
4332
|
+
function L(F, M) {
|
|
4333
|
+
if (typeof F != "string" || F in b)
|
|
4334
4334
|
throw new Error(`discriminator: "${e}" values must be unique strings`);
|
|
4335
|
-
b[
|
|
4335
|
+
b[F] = M;
|
|
4336
4336
|
}
|
|
4337
4337
|
}
|
|
4338
4338
|
}
|
|
@@ -4372,7 +4372,7 @@ function wn() {
|
|
|
4372
4372
|
Object.defineProperty(o, "KeywordCxt", { enumerable: !0, get: function() {
|
|
4373
4373
|
return S.KeywordCxt;
|
|
4374
4374
|
} });
|
|
4375
|
-
var y =
|
|
4375
|
+
var y = X();
|
|
4376
4376
|
Object.defineProperty(o, "_", { enumerable: !0, get: function() {
|
|
4377
4377
|
return y._;
|
|
4378
4378
|
} }), Object.defineProperty(o, "str", { enumerable: !0, get: function() {
|
|
@@ -4402,7 +4402,7 @@ var qi = { exports: {} }, Ws;
|
|
|
4402
4402
|
function Pd() {
|
|
4403
4403
|
return Ws || (Ws = 1, (function(l, o) {
|
|
4404
4404
|
Object.defineProperty(o, "__esModule", { value: !0 });
|
|
4405
|
-
const c = wn(), u =
|
|
4405
|
+
const c = wn(), u = X(), _ = Gt(), h = Jt(), g = Xt(), n = De(), v = "errorMessage", S = new c.Name("emUsed"), y = {
|
|
4406
4406
|
required: "missingProperty",
|
|
4407
4407
|
dependencies: "property",
|
|
4408
4408
|
dependentRequired: "property"
|
|
@@ -4419,61 +4419,61 @@ function Pd() {
|
|
|
4419
4419
|
const U = m, P = u.strConcat(n.default.instancePath, w.errorPath);
|
|
4420
4420
|
d.if(c._`${n.default.errors} > 0`, () => {
|
|
4421
4421
|
if (typeof U == "object") {
|
|
4422
|
-
const [T, x] =
|
|
4423
|
-
x &&
|
|
4422
|
+
const [T, x] = L(U);
|
|
4423
|
+
x && F(x), T && M(T), G(C(U));
|
|
4424
4424
|
}
|
|
4425
4425
|
const k = typeof U == "string" ? U : U._;
|
|
4426
|
-
k &&
|
|
4426
|
+
k && H(k), s.keepErrors || Z();
|
|
4427
4427
|
});
|
|
4428
4428
|
function C({ properties: k, items: T }) {
|
|
4429
4429
|
const x = {};
|
|
4430
4430
|
if (k) {
|
|
4431
4431
|
x.props = {};
|
|
4432
|
-
for (const
|
|
4433
|
-
x.props[
|
|
4432
|
+
for (const A in k)
|
|
4433
|
+
x.props[A] = [];
|
|
4434
4434
|
}
|
|
4435
4435
|
if (T) {
|
|
4436
4436
|
x.items = {};
|
|
4437
|
-
for (let
|
|
4438
|
-
x.items[
|
|
4437
|
+
for (let A = 0; A < T.length; A++)
|
|
4438
|
+
x.items[A] = [];
|
|
4439
4439
|
}
|
|
4440
4440
|
return x;
|
|
4441
4441
|
}
|
|
4442
|
-
function
|
|
4442
|
+
function L(k) {
|
|
4443
4443
|
let T, x;
|
|
4444
|
-
for (const
|
|
4445
|
-
if (
|
|
4444
|
+
for (const A in k) {
|
|
4445
|
+
if (A === "properties" || A === "items")
|
|
4446
4446
|
continue;
|
|
4447
|
-
const
|
|
4448
|
-
if (typeof
|
|
4447
|
+
const B = k[A];
|
|
4448
|
+
if (typeof B == "object") {
|
|
4449
4449
|
T || (T = {});
|
|
4450
|
-
const
|
|
4451
|
-
for (const
|
|
4452
|
-
N
|
|
4450
|
+
const O = T[A] = {};
|
|
4451
|
+
for (const N in B)
|
|
4452
|
+
O[N] = [];
|
|
4453
4453
|
} else
|
|
4454
|
-
x || (x = {}), x[
|
|
4454
|
+
x || (x = {}), x[A] = [];
|
|
4455
4455
|
}
|
|
4456
4456
|
return [T, x];
|
|
4457
4457
|
}
|
|
4458
|
-
function
|
|
4459
|
-
const T = d.const("emErrors", c.stringify(k)), x = d.const("templates",
|
|
4460
|
-
d.forOf("err", n.default.vErrors, (
|
|
4461
|
-
const { singleError:
|
|
4462
|
-
if (
|
|
4463
|
-
const
|
|
4464
|
-
|
|
4465
|
-
d.if(
|
|
4466
|
-
}), g.reportError(f, { message:
|
|
4458
|
+
function F(k) {
|
|
4459
|
+
const T = d.const("emErrors", c.stringify(k)), x = d.const("templates", j(k, m));
|
|
4460
|
+
d.forOf("err", n.default.vErrors, (N) => d.if(Q(N, T), () => d.code(c._`${T}[${N}.keyword].push(${N})`).assign(c._`${N}.${S}`, !0)));
|
|
4461
|
+
const { singleError: A } = s;
|
|
4462
|
+
if (A) {
|
|
4463
|
+
const N = d.let("message", c._`""`), q = d.let("paramsErrors", c._`[]`);
|
|
4464
|
+
B((K) => {
|
|
4465
|
+
d.if(N, () => d.code(c._`${N} += ${typeof A == "string" ? A : ";"}`)), d.code(c._`${N} += ${O(K)}`), d.assign(q, c._`${q}.concat(${T}[${K}])`);
|
|
4466
|
+
}), g.reportError(f, { message: N, params: c._`{errors: ${q}}` });
|
|
4467
4467
|
} else
|
|
4468
|
-
|
|
4469
|
-
message: N
|
|
4470
|
-
params: c._`{errors: ${T}[${
|
|
4468
|
+
B((N) => g.reportError(f, {
|
|
4469
|
+
message: O(N),
|
|
4470
|
+
params: c._`{errors: ${T}[${N}]}`
|
|
4471
4471
|
}));
|
|
4472
|
-
function
|
|
4473
|
-
d.forIn("key", T, (q) => d.if(c._`${T}[${q}].length`, () =>
|
|
4472
|
+
function B(N) {
|
|
4473
|
+
d.forIn("key", T, (q) => d.if(c._`${T}[${q}].length`, () => N(q)));
|
|
4474
4474
|
}
|
|
4475
|
-
function N
|
|
4476
|
-
return c._`${
|
|
4475
|
+
function O(N) {
|
|
4476
|
+
return c._`${N} in ${x} ? ${x}[${N}]() : ${b}[${N}]`;
|
|
4477
4477
|
}
|
|
4478
4478
|
}
|
|
4479
4479
|
function M(k) {
|
|
@@ -4481,20 +4481,20 @@ function Pd() {
|
|
|
4481
4481
|
for (const q in k)
|
|
4482
4482
|
x.push([
|
|
4483
4483
|
q,
|
|
4484
|
-
|
|
4484
|
+
j(k[q], m[q])
|
|
4485
4485
|
]);
|
|
4486
|
-
const
|
|
4486
|
+
const A = d.const("templates", d.object(...x)), B = d.scopeValue("obj", {
|
|
4487
4487
|
ref: y,
|
|
4488
4488
|
code: c.stringify(y)
|
|
4489
|
-
}),
|
|
4490
|
-
d.forOf("err", n.default.vErrors, (q) => d.if(
|
|
4491
|
-
d.assign(
|
|
4492
|
-
})), d.forIn("key", T, (q) => d.forIn("keyProp", c._`${T}[${q}]`, (
|
|
4493
|
-
d.assign(
|
|
4494
|
-
const
|
|
4489
|
+
}), O = d.let("emPropParams"), N = d.let("emParamsErrors");
|
|
4490
|
+
d.forOf("err", n.default.vErrors, (q) => d.if(Q(q, T), () => {
|
|
4491
|
+
d.assign(O, c._`${B}[${q}.keyword]`), d.assign(N, c._`${T}[${q}.keyword][${q}.params[${O}]]`), d.if(N, () => d.code(c._`${N}.push(${q})`).assign(c._`${q}.${S}`, !0));
|
|
4492
|
+
})), d.forIn("key", T, (q) => d.forIn("keyProp", c._`${T}[${q}]`, (K) => {
|
|
4493
|
+
d.assign(N, c._`${T}[${q}][${K}]`), d.if(c._`${N}.length`, () => {
|
|
4494
|
+
const z = d.const("tmpl", c._`${A}[${q}] && ${A}[${q}][${K}]`);
|
|
4495
4495
|
g.reportError(f, {
|
|
4496
|
-
message: c._`${
|
|
4497
|
-
params: c._`{errors: ${
|
|
4496
|
+
message: c._`${z} ? ${z}() : ${b}[${q}][${K}]`,
|
|
4497
|
+
params: c._`{errors: ${N}}`
|
|
4498
4498
|
});
|
|
4499
4499
|
});
|
|
4500
4500
|
}));
|
|
@@ -4503,35 +4503,35 @@ function Pd() {
|
|
|
4503
4503
|
const { props: T, items: x } = k;
|
|
4504
4504
|
if (!T && !x)
|
|
4505
4505
|
return;
|
|
4506
|
-
const
|
|
4507
|
-
let
|
|
4508
|
-
const
|
|
4509
|
-
T && x ? (
|
|
4510
|
-
|
|
4506
|
+
const A = c._`typeof ${p} == "object"`, B = c._`Array.isArray(${p})`, O = d.let("emErrors");
|
|
4507
|
+
let N, q;
|
|
4508
|
+
const K = d.let("templates");
|
|
4509
|
+
T && x ? (N = d.let("emChildKwd"), d.if(A), d.if(B, () => {
|
|
4510
|
+
z(x, m.items), d.assign(N, c.str`items`);
|
|
4511
4511
|
}, () => {
|
|
4512
|
-
|
|
4513
|
-
}), q = c._`[${
|
|
4512
|
+
z(T, m.properties), d.assign(N, c.str`properties`);
|
|
4513
|
+
}), q = c._`[${N}]`) : x ? (d.if(B), z(x, m.items), q = c._`.items`) : T && (d.if(u.and(A, u.not(B))), z(T, m.properties), q = c._`.properties`), d.forOf("err", n.default.vErrors, (R) => ie(R, O, ($) => d.code(c._`${O}[${$}].push(${R})`).assign(c._`${R}.${S}`, !0))), d.forIn("key", O, (R) => d.if(c._`${O}[${R}].length`, () => {
|
|
4514
4514
|
g.reportError(f, {
|
|
4515
|
-
message: c._`${R} in ${
|
|
4516
|
-
params: c._`{errors: ${
|
|
4515
|
+
message: c._`${R} in ${K} ? ${K}[${R}]() : ${b}${q}[${R}]`,
|
|
4516
|
+
params: c._`{errors: ${O}[${R}]}`
|
|
4517
4517
|
}), d.assign(c._`${n.default.vErrors}[${n.default.errors}-1].instancePath`, c._`${P} + "/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`);
|
|
4518
4518
|
})), d.endIf();
|
|
4519
|
-
function
|
|
4520
|
-
d.assign(
|
|
4519
|
+
function z(R, $) {
|
|
4520
|
+
d.assign(O, c.stringify(R)), d.assign(K, j(R, $));
|
|
4521
4521
|
}
|
|
4522
4522
|
}
|
|
4523
|
-
function
|
|
4523
|
+
function H(k) {
|
|
4524
4524
|
const T = d.const("emErrs", c._`[]`);
|
|
4525
|
-
d.forOf("err", n.default.vErrors, (x) => d.if(
|
|
4526
|
-
message:
|
|
4525
|
+
d.forOf("err", n.default.vErrors, (x) => d.if(J(x), () => d.code(c._`${T}.push(${x})`).assign(c._`${x}.${S}`, !0))), d.if(c._`${T}.length`, () => g.reportError(f, {
|
|
4526
|
+
message: D(k),
|
|
4527
4527
|
params: c._`{errors: ${T}}`
|
|
4528
4528
|
}));
|
|
4529
4529
|
}
|
|
4530
|
-
function
|
|
4530
|
+
function Z() {
|
|
4531
4531
|
const k = d.const("emErrs", c._`[]`);
|
|
4532
4532
|
d.forOf("err", n.default.vErrors, (T) => d.if(c._`!${T}.${S}`, () => d.code(c._`${k}.push(${T})`))), d.assign(n.default.vErrors, k).assign(n.default.errors, c._`${k}.length`);
|
|
4533
4533
|
}
|
|
4534
|
-
function
|
|
4534
|
+
function Q(k, T) {
|
|
4535
4535
|
return u.and(
|
|
4536
4536
|
c._`${k}.keyword !== ${v}`,
|
|
4537
4537
|
c._`!${k}.${S}`,
|
|
@@ -4542,31 +4542,31 @@ function Pd() {
|
|
|
4542
4542
|
c._`/^\\/[^\\/]*$/.test(${k}.schemaPath.slice(${w.errSchemaPath.length}))`
|
|
4543
4543
|
);
|
|
4544
4544
|
}
|
|
4545
|
-
function
|
|
4545
|
+
function ie(k, T, x) {
|
|
4546
4546
|
d.if(u.and(c._`${k}.keyword !== ${v}`, c._`!${k}.${S}`, c._`${k}.instancePath.indexOf(${P}) === 0`), () => {
|
|
4547
|
-
const
|
|
4547
|
+
const A = d.scopeValue("pattern", {
|
|
4548
4548
|
ref: /^\/([^/]*)(?:\/|$)/,
|
|
4549
4549
|
code: c._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`
|
|
4550
|
-
}),
|
|
4551
|
-
d.if(c._`${
|
|
4550
|
+
}), B = d.const("emMatches", c._`${A}.exec(${k}.instancePath.slice(${P}.length))`), O = d.const("emChild", c._`${B} && ${B}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);
|
|
4551
|
+
d.if(c._`${O} !== undefined && ${O} in ${T}`, () => x(O));
|
|
4552
4552
|
});
|
|
4553
4553
|
}
|
|
4554
|
-
function
|
|
4554
|
+
function J(k) {
|
|
4555
4555
|
return u.and(c._`${k}.keyword !== ${v}`, c._`!${k}.${S}`, u.or(c._`${k}.instancePath === ${P}`, u.and(c._`${k}.instancePath.indexOf(${P}) === 0`, c._`${k}.instancePath[${P}.length] === "/"`)), c._`${k}.schemaPath.indexOf(${w.errSchemaPath}) === 0`, c._`${k}.schemaPath[${w.errSchemaPath}.length] === "/"`);
|
|
4556
4556
|
}
|
|
4557
|
-
function
|
|
4557
|
+
function j(k, T) {
|
|
4558
4558
|
const x = [];
|
|
4559
|
-
for (const
|
|
4560
|
-
const
|
|
4561
|
-
E.test(
|
|
4559
|
+
for (const A in k) {
|
|
4560
|
+
const B = T[A];
|
|
4561
|
+
E.test(B) && x.push([A, I(B)]);
|
|
4562
4562
|
}
|
|
4563
4563
|
return d.object(...x);
|
|
4564
4564
|
}
|
|
4565
|
-
function
|
|
4565
|
+
function D(k) {
|
|
4566
4566
|
return E.test(k) ? new _._Code(_.safeStringify(k).replace(t, (T, x) => `" + JSON.stringify(${h.getData(x, w)}) + "`).replace(a, "")) : c.stringify(k);
|
|
4567
4567
|
}
|
|
4568
|
-
function
|
|
4569
|
-
return c._`function(){return ${
|
|
4568
|
+
function I(k) {
|
|
4569
|
+
return c._`function(){return ${D(k)}}`;
|
|
4570
4570
|
}
|
|
4571
4571
|
},
|
|
4572
4572
|
metaSchema: {
|
|
@@ -4612,8 +4612,8 @@ var Vi = { exports: {} }, Hr = {}, Zs;
|
|
|
4612
4612
|
function kd() {
|
|
4613
4613
|
return Zs || (Zs = 1, (function(l) {
|
|
4614
4614
|
Object.defineProperty(l, "__esModule", { value: !0 }), l.formatNames = l.fastFormats = l.fullFormats = void 0;
|
|
4615
|
-
function o(
|
|
4616
|
-
return { validate:
|
|
4615
|
+
function o(F, M) {
|
|
4616
|
+
return { validate: F, compare: M };
|
|
4617
4617
|
}
|
|
4618
4618
|
l.fullFormats = {
|
|
4619
4619
|
// date: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
@@ -4637,7 +4637,7 @@ function kd() {
|
|
|
4637
4637
|
// optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
|
|
4638
4638
|
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
|
|
4639
4639
|
ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
4640
|
-
regex:
|
|
4640
|
+
regex: L,
|
|
4641
4641
|
// uuid: http://tools.ietf.org/html/rfc4122
|
|
4642
4642
|
uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
|
|
4643
4643
|
// JSON-pointer: https://tools.ietf.org/html/rfc6901
|
|
@@ -4676,96 +4676,96 @@ function kd() {
|
|
|
4676
4676
|
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
|
|
4677
4677
|
email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i
|
|
4678
4678
|
}, l.formatNames = Object.keys(l.fullFormats);
|
|
4679
|
-
function c(
|
|
4680
|
-
return
|
|
4679
|
+
function c(F) {
|
|
4680
|
+
return F % 4 === 0 && (F % 100 !== 0 || F % 400 === 0);
|
|
4681
4681
|
}
|
|
4682
4682
|
const u = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, _ = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4683
|
-
function h(
|
|
4684
|
-
const M = u.exec(
|
|
4683
|
+
function h(F) {
|
|
4684
|
+
const M = u.exec(F);
|
|
4685
4685
|
if (!M)
|
|
4686
4686
|
return !1;
|
|
4687
|
-
const G = +M[1],
|
|
4688
|
-
return
|
|
4687
|
+
const G = +M[1], H = +M[2], Z = +M[3];
|
|
4688
|
+
return H >= 1 && H <= 12 && Z >= 1 && Z <= (H === 2 && c(G) ? 29 : _[H]);
|
|
4689
4689
|
}
|
|
4690
|
-
function g(
|
|
4691
|
-
if (
|
|
4692
|
-
return
|
|
4690
|
+
function g(F, M) {
|
|
4691
|
+
if (F && M)
|
|
4692
|
+
return F > M ? 1 : F < M ? -1 : 0;
|
|
4693
4693
|
}
|
|
4694
4694
|
const n = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
4695
|
-
function v(
|
|
4695
|
+
function v(F) {
|
|
4696
4696
|
return function(G) {
|
|
4697
|
-
const
|
|
4698
|
-
if (!
|
|
4697
|
+
const H = n.exec(G);
|
|
4698
|
+
if (!H)
|
|
4699
4699
|
return !1;
|
|
4700
|
-
const
|
|
4701
|
-
if (
|
|
4700
|
+
const Z = +H[1], Q = +H[2], ie = +H[3], J = H[4], j = H[5] === "-" ? -1 : 1, D = +(H[6] || 0), I = +(H[7] || 0);
|
|
4701
|
+
if (D > 23 || I > 59 || F && !J)
|
|
4702
4702
|
return !1;
|
|
4703
|
-
if (
|
|
4703
|
+
if (Z <= 23 && Q <= 59 && ie < 60)
|
|
4704
4704
|
return !0;
|
|
4705
|
-
const k =
|
|
4706
|
-
return (T === 23 || T === -1) && (k === 59 || k === -1) &&
|
|
4705
|
+
const k = Q - I * j, T = Z - D * j - (k < 0 ? 1 : 0);
|
|
4706
|
+
return (T === 23 || T === -1) && (k === 59 || k === -1) && ie < 61;
|
|
4707
4707
|
};
|
|
4708
4708
|
}
|
|
4709
|
-
function S(
|
|
4710
|
-
if (!(
|
|
4709
|
+
function S(F, M) {
|
|
4710
|
+
if (!(F && M))
|
|
4711
4711
|
return;
|
|
4712
|
-
const G = (/* @__PURE__ */ new Date("2020-01-01T" +
|
|
4713
|
-
if (G &&
|
|
4714
|
-
return G -
|
|
4712
|
+
const G = (/* @__PURE__ */ new Date("2020-01-01T" + F)).valueOf(), H = (/* @__PURE__ */ new Date("2020-01-01T" + M)).valueOf();
|
|
4713
|
+
if (G && H)
|
|
4714
|
+
return G - H;
|
|
4715
4715
|
}
|
|
4716
|
-
function y(
|
|
4717
|
-
if (!(
|
|
4716
|
+
function y(F, M) {
|
|
4717
|
+
if (!(F && M))
|
|
4718
4718
|
return;
|
|
4719
|
-
const G = n.exec(
|
|
4720
|
-
if (G &&
|
|
4721
|
-
return
|
|
4719
|
+
const G = n.exec(F), H = n.exec(M);
|
|
4720
|
+
if (G && H)
|
|
4721
|
+
return F = G[1] + G[2] + G[3], M = H[1] + H[2] + H[3], F > M ? 1 : F < M ? -1 : 0;
|
|
4722
4722
|
}
|
|
4723
4723
|
const E = /t|\s/i;
|
|
4724
|
-
function t(
|
|
4725
|
-
const M = v(
|
|
4726
|
-
return function(
|
|
4727
|
-
const
|
|
4728
|
-
return
|
|
4724
|
+
function t(F) {
|
|
4725
|
+
const M = v(F);
|
|
4726
|
+
return function(H) {
|
|
4727
|
+
const Z = H.split(E);
|
|
4728
|
+
return Z.length === 2 && h(Z[0]) && M(Z[1]);
|
|
4729
4729
|
};
|
|
4730
4730
|
}
|
|
4731
|
-
function a(
|
|
4732
|
-
if (!(
|
|
4731
|
+
function a(F, M) {
|
|
4732
|
+
if (!(F && M))
|
|
4733
4733
|
return;
|
|
4734
|
-
const G = new Date(
|
|
4735
|
-
if (G &&
|
|
4736
|
-
return G -
|
|
4734
|
+
const G = new Date(F).valueOf(), H = new Date(M).valueOf();
|
|
4735
|
+
if (G && H)
|
|
4736
|
+
return G - H;
|
|
4737
4737
|
}
|
|
4738
|
-
function e(
|
|
4739
|
-
if (!(
|
|
4738
|
+
function e(F, M) {
|
|
4739
|
+
if (!(F && M))
|
|
4740
4740
|
return;
|
|
4741
|
-
const [G,
|
|
4742
|
-
if (
|
|
4743
|
-
return
|
|
4741
|
+
const [G, H] = F.split(E), [Z, Q] = M.split(E), ie = g(G, Z);
|
|
4742
|
+
if (ie !== void 0)
|
|
4743
|
+
return ie || S(H, Q);
|
|
4744
4744
|
}
|
|
4745
4745
|
const r = /\/|:/, s = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
4746
|
-
function f(
|
|
4747
|
-
return r.test(
|
|
4746
|
+
function f(F) {
|
|
4747
|
+
return r.test(F) && s.test(F);
|
|
4748
4748
|
}
|
|
4749
4749
|
const d = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
4750
|
-
function p(
|
|
4751
|
-
return d.lastIndex = 0, d.test(
|
|
4750
|
+
function p(F) {
|
|
4751
|
+
return d.lastIndex = 0, d.test(F);
|
|
4752
4752
|
}
|
|
4753
4753
|
const m = -2147483648, b = 2 ** 31 - 1;
|
|
4754
|
-
function w(
|
|
4755
|
-
return Number.isInteger(
|
|
4754
|
+
function w(F) {
|
|
4755
|
+
return Number.isInteger(F) && F <= b && F >= m;
|
|
4756
4756
|
}
|
|
4757
|
-
function U(
|
|
4758
|
-
return Number.isInteger(
|
|
4757
|
+
function U(F) {
|
|
4758
|
+
return Number.isInteger(F);
|
|
4759
4759
|
}
|
|
4760
4760
|
function P() {
|
|
4761
4761
|
return !0;
|
|
4762
4762
|
}
|
|
4763
4763
|
const C = /[^\\]\\Z/;
|
|
4764
|
-
function
|
|
4765
|
-
if (C.test(
|
|
4764
|
+
function L(F) {
|
|
4765
|
+
if (C.test(F))
|
|
4766
4766
|
return !1;
|
|
4767
4767
|
try {
|
|
4768
|
-
return new RegExp(
|
|
4768
|
+
return new RegExp(F), !0;
|
|
4769
4769
|
} catch {
|
|
4770
4770
|
return !1;
|
|
4771
4771
|
}
|
|
@@ -4776,7 +4776,7 @@ var Yr = {}, Xs;
|
|
|
4776
4776
|
function zd() {
|
|
4777
4777
|
return Xs || (Xs = 1, (function(l) {
|
|
4778
4778
|
Object.defineProperty(l, "__esModule", { value: !0 }), l.formatLimitDefinition = void 0;
|
|
4779
|
-
const o = wn(), c =
|
|
4779
|
+
const o = wn(), c = X(), u = c.operators, _ = {
|
|
4780
4780
|
formatMaximum: { okStr: "<=", ok: u.LTE, fail: u.GT },
|
|
4781
4781
|
formatMinimum: { okStr: ">=", ok: u.GTE, fail: u.LT },
|
|
4782
4782
|
formatExclusiveMaximum: { okStr: "<", ok: u.LT, fail: u.GTE },
|
|
@@ -4831,7 +4831,7 @@ var Js;
|
|
|
4831
4831
|
function Fd() {
|
|
4832
4832
|
return Js || (Js = 1, (function(l, o) {
|
|
4833
4833
|
Object.defineProperty(o, "__esModule", { value: !0 });
|
|
4834
|
-
const c = kd(), u = zd(), _ =
|
|
4834
|
+
const c = kd(), u = zd(), _ = X(), h = new _.Name("fullFormats"), g = new _.Name("fastFormats"), n = (S, y = { keywords: !0 }) => {
|
|
4835
4835
|
if (Array.isArray(y))
|
|
4836
4836
|
return v(S, y, c.fullFormats, h), S;
|
|
4837
4837
|
const [E, t] = y.mode === "fast" ? [c.fastFormats, g] : [c.fullFormats, h], a = y.formats || c.formatNames;
|
|
@@ -4858,7 +4858,7 @@ var _t = { exports: {} }, mt = { exports: {} }, yt = { exports: {} }, Hi = { exp
|
|
|
4858
4858
|
function Dd() {
|
|
4859
4859
|
return Qs || (Qs = 1, (function(l, o) {
|
|
4860
4860
|
Object.defineProperty(o, "__esModule", { value: !0 });
|
|
4861
|
-
const c =
|
|
4861
|
+
const c = X(), u = ["undefined", "string", "number", "object", "function", "boolean", "symbol"];
|
|
4862
4862
|
function _() {
|
|
4863
4863
|
return {
|
|
4864
4864
|
keyword: "typeof",
|
|
@@ -5023,7 +5023,7 @@ var xt = { exports: {} }, Wi = { exports: {} }, He = {}, pa;
|
|
|
5023
5023
|
function Pr() {
|
|
5024
5024
|
if (pa) return He;
|
|
5025
5025
|
pa = 1, Object.defineProperty(He, "__esModule", { value: !0 }), He.usePattern = He.metaSchemaRef = void 0;
|
|
5026
|
-
const l =
|
|
5026
|
+
const l = X(), o = "http://json-schema.org/schema";
|
|
5027
5027
|
function c({ defaultMeta: _ } = {}) {
|
|
5028
5028
|
return _ === !1 ? {} : { $ref: _ || o };
|
|
5029
5029
|
}
|
|
@@ -5042,7 +5042,7 @@ var _a;
|
|
|
5042
5042
|
function qd() {
|
|
5043
5043
|
return _a || (_a = 1, (function(l, o) {
|
|
5044
5044
|
Object.defineProperty(o, "__esModule", { value: !0 });
|
|
5045
|
-
const c =
|
|
5045
|
+
const c = X(), u = Pr(), _ = {
|
|
5046
5046
|
type: "object",
|
|
5047
5047
|
properties: {
|
|
5048
5048
|
pattern: { type: "string" },
|
|
@@ -5091,7 +5091,7 @@ var Ut = { exports: {} }, Zi = { exports: {} }, ga;
|
|
|
5091
5091
|
function Hd() {
|
|
5092
5092
|
return ga || (ga = 1, (function(l, o) {
|
|
5093
5093
|
Object.defineProperty(o, "__esModule", { value: !0 });
|
|
5094
|
-
const c =
|
|
5094
|
+
const c = X(), u = {
|
|
5095
5095
|
trimStart: (v) => v.trimStart(),
|
|
5096
5096
|
trimEnd: (v) => v.trimEnd(),
|
|
5097
5097
|
trimLeft: (v) => v.trimStart(),
|
|
@@ -5339,7 +5339,7 @@ var kt = { exports: {} }, er = { exports: {} }, Da;
|
|
|
5339
5339
|
function rf() {
|
|
5340
5340
|
return Da || (Da = 1, (function(l, o) {
|
|
5341
5341
|
Object.defineProperty(o, "__esModule", { value: !0 });
|
|
5342
|
-
const c =
|
|
5342
|
+
const c = X(), u = Pr(), _ = {
|
|
5343
5343
|
message: ({ params: { missingPattern: g } }) => (0, c.str)`should have property matching pattern '${g}'`,
|
|
5344
5344
|
params: ({ params: { missingPattern: g } }) => (0, c._)`{missingPattern: ${g}}`
|
|
5345
5345
|
};
|
|
@@ -5480,7 +5480,7 @@ var Rt = { exports: {} }, rr = { exports: {} }, Va;
|
|
|
5480
5480
|
function df() {
|
|
5481
5481
|
return Va || (Va = 1, (function(l, o) {
|
|
5482
5482
|
Object.defineProperty(o, "__esModule", { value: !0 });
|
|
5483
|
-
const c =
|
|
5483
|
+
const c = X();
|
|
5484
5484
|
function u() {
|
|
5485
5485
|
return {
|
|
5486
5486
|
keyword: "deepRequired",
|
|
@@ -5615,7 +5615,7 @@ var Dt = { exports: {} }, sr = { exports: {} }, Xa;
|
|
|
5615
5615
|
function hf() {
|
|
5616
5616
|
return Xa || (Xa = 1, (function(l, o) {
|
|
5617
5617
|
Object.defineProperty(o, "__esModule", { value: !0 });
|
|
5618
|
-
const c =
|
|
5618
|
+
const c = X(), u = Pr(), _ = {
|
|
5619
5619
|
message: ({ params: { schemaProp: g } }) => g ? (0, c.str)`should match case "${g}" schema` : (0, c.str)`should match default case schema`,
|
|
5620
5620
|
params: ({ params: { schemaProp: g } }) => g ? (0, c._)`{failingCase: ${g}}` : (0, c._)`{failingDefault: true}`
|
|
5621
5621
|
};
|
|
@@ -6157,11 +6157,11 @@ function ou() {
|
|
|
6157
6157
|
});
|
|
6158
6158
|
w.tracks = U;
|
|
6159
6159
|
for (const P of U) {
|
|
6160
|
-
const C = P.children.map((
|
|
6161
|
-
const
|
|
6162
|
-
if (m.has(
|
|
6163
|
-
throw new Error(`${su} ${
|
|
6164
|
-
return m.add(
|
|
6160
|
+
const C = P.children.map((L) => {
|
|
6161
|
+
const F = f({ ...L, segmentType: P.trackType });
|
|
6162
|
+
if (m.has(F.id))
|
|
6163
|
+
throw new Error(`${su} ${F.id}`);
|
|
6164
|
+
return m.add(F.id), F;
|
|
6165
6165
|
});
|
|
6166
6166
|
P.children = C;
|
|
6167
6167
|
}
|
|
@@ -6810,19 +6810,19 @@ function xu() {
|
|
|
6810
6810
|
for (let w = 0; w < d.length; w++) {
|
|
6811
6811
|
const U = m[w], P = d[w];
|
|
6812
6812
|
if ((b || p?.get(w.toString())) && U !== P) {
|
|
6813
|
-
const
|
|
6814
|
-
if (
|
|
6813
|
+
const L = U?.[te];
|
|
6814
|
+
if (L && L.modified_)
|
|
6815
6815
|
continue;
|
|
6816
|
-
const
|
|
6816
|
+
const F = r.concat([w]);
|
|
6817
6817
|
s.push({
|
|
6818
6818
|
op: u,
|
|
6819
|
-
path:
|
|
6819
|
+
path: F,
|
|
6820
6820
|
// Need to maybe clone it, as it can in fact be the original value
|
|
6821
6821
|
// due to the base/copy inversion at the start of this function
|
|
6822
6822
|
value: a(U)
|
|
6823
6823
|
}), f.push({
|
|
6824
6824
|
op: u,
|
|
6825
|
-
path:
|
|
6825
|
+
path: F,
|
|
6826
6826
|
value: a(P)
|
|
6827
6827
|
});
|
|
6828
6828
|
}
|
|
@@ -6851,11 +6851,11 @@ function xu() {
|
|
|
6851
6851
|
const U = ze(d, b, m), P = ze(p, b, m), C = w ? jt(d, b) ? u : _ : h;
|
|
6852
6852
|
if (U === P && C === u)
|
|
6853
6853
|
return;
|
|
6854
|
-
const
|
|
6854
|
+
const L = r.concat(b);
|
|
6855
6855
|
s.push(
|
|
6856
|
-
C === h ? { op: C, path:
|
|
6856
|
+
C === h ? { op: C, path: L } : { op: C, path: L, value: a(P) }
|
|
6857
6857
|
), f.push(
|
|
6858
|
-
C === _ ? { op: h, path:
|
|
6858
|
+
C === _ ? { op: h, path: L } : C === h ? { op: _, path: L, value: a(U) } : { op: u, path: L, value: a(U) }
|
|
6859
6859
|
);
|
|
6860
6860
|
});
|
|
6861
6861
|
}
|
|
@@ -7347,240 +7347,253 @@ function Jc(l, o) {
|
|
|
7347
7347
|
} = zu(c.verify(l)), a = Nt(0), e = Nt(), r = Re(() => {
|
|
7348
7348
|
if (e.value)
|
|
7349
7349
|
return _.value[e.value];
|
|
7350
|
-
}), s = (
|
|
7351
|
-
e.value =
|
|
7352
|
-
}, f = (
|
|
7353
|
-
const
|
|
7354
|
-
isMain:
|
|
7355
|
-
trackType:
|
|
7350
|
+
}), s = (j) => {
|
|
7351
|
+
e.value = j;
|
|
7352
|
+
}, f = (j, D) => {
|
|
7353
|
+
const I = {
|
|
7354
|
+
isMain: j.segmentType === "frames" && !D?.length ? !0 : void 0,
|
|
7355
|
+
trackType: j.segmentType,
|
|
7356
7356
|
trackId: o?.idFactory?.track?.() ?? Zr(),
|
|
7357
|
-
children: [
|
|
7357
|
+
children: [j]
|
|
7358
7358
|
};
|
|
7359
|
-
return
|
|
7360
|
-
}, d = (
|
|
7361
|
-
if (
|
|
7362
|
-
const
|
|
7363
|
-
if (
|
|
7364
|
-
|
|
7359
|
+
return D.push(I), j.id;
|
|
7360
|
+
}, d = (j, D, I) => {
|
|
7361
|
+
if (D.isMain) {
|
|
7362
|
+
const k = _o(D.children, I), T = j.endTime - j.startTime;
|
|
7363
|
+
if (k === 0)
|
|
7364
|
+
j.startTime = 0, j.endTime = T;
|
|
7365
7365
|
else {
|
|
7366
|
-
const
|
|
7367
|
-
|
|
7366
|
+
const x = D.children[k - 1];
|
|
7367
|
+
j.startTime = x.endTime, j.endTime = x.endTime + T;
|
|
7368
7368
|
}
|
|
7369
|
-
|
|
7370
|
-
for (let
|
|
7371
|
-
const
|
|
7372
|
-
|
|
7369
|
+
D.children.splice(k, 0, j);
|
|
7370
|
+
for (let x = k; x < D.children.length; x++) {
|
|
7371
|
+
const A = D.children[x], B = D.children[x - 1]?.endTime ?? 0, O = A.endTime - A.startTime;
|
|
7372
|
+
A.startTime = B, A.endTime = B + O;
|
|
7373
7373
|
}
|
|
7374
7374
|
} else
|
|
7375
|
-
|
|
7376
|
-
return
|
|
7377
|
-
}, p = (
|
|
7378
|
-
const
|
|
7379
|
-
|
|
7380
|
-
const
|
|
7381
|
-
for (let
|
|
7382
|
-
const
|
|
7383
|
-
if (!
|
|
7384
|
-
|
|
7375
|
+
D.children.push(j), D.children.sort((k, T) => k.startTime - T.startTime);
|
|
7376
|
+
return j.id;
|
|
7377
|
+
}, p = (j, D = 0) => {
|
|
7378
|
+
const I = j.children;
|
|
7379
|
+
I.sort((T, x) => T.startTime - x.startTime);
|
|
7380
|
+
const k = j.trackType === "frames" && j.isMain;
|
|
7381
|
+
for (let T = D; T < I.length; T++) {
|
|
7382
|
+
const x = I[T], A = x.endTime - x.startTime, B = I[T - 1];
|
|
7383
|
+
if (!B) {
|
|
7384
|
+
k && (x.startTime = 0, x.endTime = A);
|
|
7385
7385
|
continue;
|
|
7386
7386
|
}
|
|
7387
|
-
(
|
|
7388
|
-
}
|
|
7389
|
-
},
|
|
7390
|
-
const
|
|
7391
|
-
(!
|
|
7392
|
-
const
|
|
7393
|
-
return
|
|
7394
|
-
},
|
|
7395
|
-
const
|
|
7396
|
-
if (
|
|
7397
|
-
return
|
|
7398
|
-
if (
|
|
7399
|
-
return
|
|
7400
|
-
},
|
|
7401
|
-
const
|
|
7387
|
+
(k || x.startTime < B.endTime) && (x.startTime = B.endTime, x.endTime = B.endTime + A);
|
|
7388
|
+
}
|
|
7389
|
+
}, m = (j) => {
|
|
7390
|
+
const D = ur(j);
|
|
7391
|
+
(!D.id || _.value[D.id]) && (D.id = o?.idFactory?.segment?.() ?? Zr());
|
|
7392
|
+
const I = a.value - D.startTime;
|
|
7393
|
+
return D.startTime += I, D.endTime += I, D;
|
|
7394
|
+
}, b = (j, D) => {
|
|
7395
|
+
const I = _.value[j];
|
|
7396
|
+
if (I && I.segmentType === D)
|
|
7397
|
+
return I;
|
|
7398
|
+
if (I && !D)
|
|
7399
|
+
return I;
|
|
7400
|
+
}, w = (j, D) => {
|
|
7401
|
+
const I = m(j), k = /* @__PURE__ */ new Set(), T = [], x = [], A = [];
|
|
7402
7402
|
try {
|
|
7403
|
-
c.verifySegment(
|
|
7403
|
+
c.verifySegment(I);
|
|
7404
7404
|
} catch {
|
|
7405
7405
|
throw new Error("invalid segment data");
|
|
7406
7406
|
}
|
|
7407
|
-
const
|
|
7408
|
-
if (
|
|
7409
|
-
const $ =
|
|
7410
|
-
let
|
|
7411
|
-
if (
|
|
7412
|
-
const W =
|
|
7413
|
-
|
|
7407
|
+
const B = g((N) => {
|
|
7408
|
+
if (I.segmentType === "frames") {
|
|
7409
|
+
const R = I.startTime, $ = I.endTime, V = N.tracks.filter((W) => W.trackType === "frames");
|
|
7410
|
+
let Y;
|
|
7411
|
+
if (D) {
|
|
7412
|
+
const W = V.find((se) => se.trackId === D);
|
|
7413
|
+
W && (W.children.some((oe) => oe.startTime < $ && oe.endTime > R) || (Y = W));
|
|
7414
|
+
}
|
|
7415
|
+
if (!Y)
|
|
7416
|
+
for (const W of V) {
|
|
7417
|
+
if (W.trackId === D)
|
|
7418
|
+
continue;
|
|
7419
|
+
if (!W.children.some((oe) => oe.startTime < $ && oe.endTime > R)) {
|
|
7420
|
+
Y = W;
|
|
7421
|
+
break;
|
|
7422
|
+
}
|
|
7423
|
+
}
|
|
7424
|
+
if (Y)
|
|
7425
|
+
return Y.children.push(I), Y.children.sort((W, se) => W.startTime - se.startTime), k.add(Y.trackId), I.id;
|
|
7426
|
+
{
|
|
7427
|
+
const W = f(I, N.tracks), se = N.tracks.find((oe) => oe.children.some((he) => he.id === W));
|
|
7428
|
+
return se && (T.push(Ye(se)), k.add(se.trackId)), W;
|
|
7414
7429
|
}
|
|
7415
|
-
const Y = p(k, j);
|
|
7416
|
-
return T.add(j.trackId), Y;
|
|
7417
7430
|
}
|
|
7418
|
-
const
|
|
7419
|
-
for (let
|
|
7420
|
-
if (
|
|
7431
|
+
const q = N.tracks;
|
|
7432
|
+
for (let R = q.length - 1; R >= 0; R--) {
|
|
7433
|
+
if (q[R].trackType !== I.segmentType)
|
|
7421
7434
|
continue;
|
|
7422
|
-
const
|
|
7423
|
-
if (
|
|
7424
|
-
return
|
|
7425
|
-
}
|
|
7426
|
-
const
|
|
7427
|
-
return
|
|
7428
|
-
}),
|
|
7429
|
-
if (
|
|
7430
|
-
const
|
|
7431
|
-
for (const
|
|
7432
|
-
const
|
|
7433
|
-
|
|
7434
|
-
}
|
|
7435
|
-
}
|
|
7436
|
-
return { id:
|
|
7437
|
-
},
|
|
7438
|
-
let
|
|
7439
|
-
const
|
|
7440
|
-
for (let
|
|
7441
|
-
const
|
|
7442
|
-
if (
|
|
7443
|
-
return
|
|
7435
|
+
const $ = q[R].children, V = Au(I, $, a.value);
|
|
7436
|
+
if (V !== -1)
|
|
7437
|
+
return $.splice(V, 0, I), k.add(q[R].trackId), I.id;
|
|
7438
|
+
}
|
|
7439
|
+
const K = f(I, q), z = N.tracks.find((R) => R.children.some(($) => $.id === K));
|
|
7440
|
+
return z && (T.push(Ye(z)), k.add(z.trackId)), K;
|
|
7441
|
+
}), O = [];
|
|
7442
|
+
if (k.size > 0) {
|
|
7443
|
+
const N = S();
|
|
7444
|
+
for (const q of k) {
|
|
7445
|
+
const K = N.tracks.find((z) => z.trackId === q);
|
|
7446
|
+
K && (O.push(...or(K.children)), x.push(Ye(K)));
|
|
7447
|
+
}
|
|
7448
|
+
}
|
|
7449
|
+
return { id: B, affectedSegments: O, affectedTracks: x, createdTracks: T, removedTrackIds: A };
|
|
7450
|
+
}, U = (j) => {
|
|
7451
|
+
let D = null;
|
|
7452
|
+
const I = [], k = [], T = [], x = g((B) => {
|
|
7453
|
+
for (let O = 0; O < B.tracks.length; O++) {
|
|
7454
|
+
const N = B.tracks[O], q = N.children.findIndex((K) => K.id === j);
|
|
7455
|
+
if (q !== -1)
|
|
7456
|
+
return N.children.splice(q, 1), N.children.length > 0 ? N.trackType === "frames" && N.isMain && (p(N, 0), D = N.trackId) : (B.tracks.splice(O, 1), T.push(N.trackId)), !0;
|
|
7444
7457
|
}
|
|
7445
7458
|
return !1;
|
|
7446
|
-
}),
|
|
7447
|
-
if (
|
|
7448
|
-
const
|
|
7449
|
-
|
|
7450
|
-
}
|
|
7451
|
-
return { success:
|
|
7452
|
-
},
|
|
7453
|
-
const
|
|
7454
|
-
const
|
|
7455
|
-
if (!
|
|
7459
|
+
}), A = [];
|
|
7460
|
+
if (x && D) {
|
|
7461
|
+
const O = S().tracks.find((N) => N.trackId === D);
|
|
7462
|
+
O && (A.push(...or(O.children)), I.push(Ye(O)));
|
|
7463
|
+
}
|
|
7464
|
+
return { success: x, affectedSegments: A, affectedTracks: I, createdTracks: k, removedTrackIds: T };
|
|
7465
|
+
}, P = (j) => {
|
|
7466
|
+
const D = /* @__PURE__ */ new Set(), I = [], k = [], T = [], x = g((B) => {
|
|
7467
|
+
const O = B.tracks.find((z) => z.trackId === j.sourceTrackId);
|
|
7468
|
+
if (!O)
|
|
7456
7469
|
return !1;
|
|
7457
|
-
const
|
|
7458
|
-
if (
|
|
7470
|
+
const N = O.children.findIndex((z) => z.id === j.segmentId);
|
|
7471
|
+
if (N < 0)
|
|
7459
7472
|
return !1;
|
|
7460
|
-
const
|
|
7461
|
-
if (
|
|
7462
|
-
|
|
7473
|
+
const q = O.children[N];
|
|
7474
|
+
if (j.targetTrackId === j.sourceTrackId && j.isNewTrack !== !0)
|
|
7475
|
+
q.startTime = j.startTime, q.endTime = j.endTime, p(O), D.add(O.trackId);
|
|
7463
7476
|
else {
|
|
7464
|
-
if (
|
|
7465
|
-
const
|
|
7466
|
-
|
|
7467
|
-
}
|
|
7468
|
-
if (
|
|
7469
|
-
const
|
|
7470
|
-
trackId:
|
|
7471
|
-
trackType:
|
|
7472
|
-
children: [
|
|
7473
|
-
...
|
|
7477
|
+
if (O.children.splice(N, 1), O.children.length > 0 && (p(O), D.add(O.trackId)), O.children.length === 0) {
|
|
7478
|
+
const z = B.tracks.findIndex((R) => R.trackId === O.trackId);
|
|
7479
|
+
z >= 0 && (B.tracks.splice(z, 1), T.push(O.trackId));
|
|
7480
|
+
}
|
|
7481
|
+
if (q.startTime = j.startTime, q.endTime = j.endTime, j.isNewTrack && j.newTrackInsertIndex !== void 0) {
|
|
7482
|
+
const z = q.segmentType === "frames" && !B.tracks.some(($) => $.trackType === "frames" && $.isMain), R = {
|
|
7483
|
+
trackId: j.newTrackId ?? o?.idFactory?.track?.() ?? Zr(),
|
|
7484
|
+
trackType: q.segmentType,
|
|
7485
|
+
children: [q],
|
|
7486
|
+
...z ? { isMain: !0 } : {}
|
|
7474
7487
|
};
|
|
7475
|
-
if (
|
|
7476
|
-
const
|
|
7477
|
-
|
|
7488
|
+
if (z) {
|
|
7489
|
+
const $ = q.endTime - q.startTime;
|
|
7490
|
+
q.startTime = 0, q.endTime = $;
|
|
7478
7491
|
}
|
|
7479
|
-
|
|
7480
|
-
} else if (
|
|
7481
|
-
const
|
|
7482
|
-
if (!
|
|
7492
|
+
B.tracks.splice(j.newTrackInsertIndex, 0, R), D.add(R.trackId), k.push(Ye(R));
|
|
7493
|
+
} else if (j.targetTrackId) {
|
|
7494
|
+
const z = B.tracks.find((R) => R.trackId === j.targetTrackId);
|
|
7495
|
+
if (!z || z.trackType !== q.segmentType)
|
|
7483
7496
|
return !1;
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
) : (
|
|
7497
|
+
z.trackType === "frames" ? d(
|
|
7498
|
+
q,
|
|
7499
|
+
z,
|
|
7500
|
+
q.startTime
|
|
7501
|
+
) : (z.children.push(q), p(z)), D.add(z.trackId);
|
|
7489
7502
|
}
|
|
7490
7503
|
}
|
|
7491
7504
|
return !0;
|
|
7492
|
-
}),
|
|
7493
|
-
if (
|
|
7494
|
-
const
|
|
7495
|
-
for (const
|
|
7496
|
-
const
|
|
7497
|
-
|
|
7498
|
-
}
|
|
7499
|
-
}
|
|
7500
|
-
return { success:
|
|
7501
|
-
},
|
|
7502
|
-
let
|
|
7503
|
-
const
|
|
7504
|
-
const
|
|
7505
|
-
if (!
|
|
7505
|
+
}), A = [];
|
|
7506
|
+
if (x) {
|
|
7507
|
+
const B = S();
|
|
7508
|
+
for (const O of D) {
|
|
7509
|
+
const N = B.tracks.find((q) => q.trackId === O);
|
|
7510
|
+
N && (A.push(...or(N.children)), I.push(Ye(N)));
|
|
7511
|
+
}
|
|
7512
|
+
}
|
|
7513
|
+
return { success: x, affectedSegments: A, affectedTracks: I, createdTracks: k, removedTrackIds: T };
|
|
7514
|
+
}, C = (j) => {
|
|
7515
|
+
let D = null;
|
|
7516
|
+
const I = [], k = [], T = [], x = g((B) => {
|
|
7517
|
+
const O = B.tracks.find((W) => W.trackId === j.trackId);
|
|
7518
|
+
if (!O)
|
|
7506
7519
|
return !1;
|
|
7507
|
-
const
|
|
7508
|
-
if (
|
|
7520
|
+
const N = O.children.findIndex((W) => W.id === j.segmentId);
|
|
7521
|
+
if (N < 0)
|
|
7509
7522
|
return !1;
|
|
7510
|
-
const
|
|
7511
|
-
let
|
|
7512
|
-
if (!Number.isFinite(
|
|
7523
|
+
const q = O.children[N], K = q.startTime;
|
|
7524
|
+
let z = j.startTime, R = j.endTime, $ = R - z;
|
|
7525
|
+
if (!Number.isFinite($) || $ < 0)
|
|
7513
7526
|
return !1;
|
|
7514
|
-
const
|
|
7515
|
-
let
|
|
7516
|
-
if (
|
|
7517
|
-
const
|
|
7518
|
-
if (
|
|
7527
|
+
const V = ku(q) ? q : null;
|
|
7528
|
+
let Y = V ? V.fromTime ?? 0 : 0;
|
|
7529
|
+
if (V && z !== K) {
|
|
7530
|
+
const W = V.fromTime ?? 0, se = z - K, oe = Math.max(se, -W);
|
|
7531
|
+
if (oe !== se && (z = K + oe, $ = R - z), !Number.isFinite($) || $ < 0)
|
|
7519
7532
|
return !1;
|
|
7520
|
-
|
|
7533
|
+
Y = W + oe, V.fromTime = Y;
|
|
7521
7534
|
}
|
|
7522
|
-
return
|
|
7523
|
-
}),
|
|
7524
|
-
if (
|
|
7525
|
-
const
|
|
7526
|
-
|
|
7535
|
+
return q.startTime = z, q.endTime = R, p(O, N), D = O.trackId, !0;
|
|
7536
|
+
}), A = [];
|
|
7537
|
+
if (x && D) {
|
|
7538
|
+
const O = S().tracks.find((N) => N.trackId === D);
|
|
7539
|
+
O && A.push(...or(O.children));
|
|
7527
7540
|
}
|
|
7528
|
-
return { success:
|
|
7541
|
+
return { success: x, affectedSegments: A, affectedTracks: I, createdTracks: k, removedTrackIds: T };
|
|
7529
7542
|
};
|
|
7530
|
-
function
|
|
7531
|
-
g((
|
|
7532
|
-
const
|
|
7533
|
-
if (
|
|
7543
|
+
function L(j, D, I) {
|
|
7544
|
+
g((k) => {
|
|
7545
|
+
const T = D ?? r.value?.id;
|
|
7546
|
+
if (T === void 0)
|
|
7534
7547
|
return;
|
|
7535
|
-
const
|
|
7536
|
-
|
|
7537
|
-
}, (T, x
|
|
7538
|
-
|
|
7539
|
-
Pu(
|
|
7548
|
+
const x = Ru(T, k);
|
|
7549
|
+
x && (!I || x.segmentType === I) && j(x);
|
|
7550
|
+
}, (k, T, x) => {
|
|
7551
|
+
x((A) => {
|
|
7552
|
+
Pu(k, T, A, c) ? Tu(k, T, A, n) : n();
|
|
7540
7553
|
});
|
|
7541
7554
|
});
|
|
7542
7555
|
}
|
|
7543
|
-
const
|
|
7544
|
-
const
|
|
7545
|
-
if (!
|
|
7556
|
+
const F = (j, D) => g((I) => {
|
|
7557
|
+
const k = I.tracks.find((N) => N.trackType === "frames" && N.isMain);
|
|
7558
|
+
if (!k || k.children.length < 2)
|
|
7546
7559
|
return !1;
|
|
7547
|
-
const
|
|
7548
|
-
let
|
|
7549
|
-
if (
|
|
7560
|
+
const T = Math.max(0, D ?? a.value);
|
|
7561
|
+
let x = _o(k.children, T) - 1;
|
|
7562
|
+
if (x = Math.min(Math.max(0, x), k.children.length - 2), !j || typeof j != "object" || typeof j.id != "string" || typeof j.name != "string" || typeof j.duration != "number" || j.duration < 0)
|
|
7550
7563
|
return !0;
|
|
7551
|
-
const
|
|
7552
|
-
return
|
|
7553
|
-
}),
|
|
7554
|
-
const
|
|
7555
|
-
if (!
|
|
7564
|
+
const A = k.children[x], B = k.children[x + 1], O = ur(j);
|
|
7565
|
+
return A.transitionIn = O, B.transitionOut = O, !0;
|
|
7566
|
+
}), M = (j) => g((D) => {
|
|
7567
|
+
const I = D.tracks.find((O) => O.trackType === "frames" && O.isMain);
|
|
7568
|
+
if (!I)
|
|
7556
7569
|
return !1;
|
|
7557
|
-
const
|
|
7558
|
-
if (
|
|
7570
|
+
const k = I.children.findIndex((O) => O.id === j);
|
|
7571
|
+
if (k === -1)
|
|
7559
7572
|
return !1;
|
|
7560
|
-
const
|
|
7561
|
-
let
|
|
7562
|
-
return
|
|
7563
|
-
}),
|
|
7564
|
-
const
|
|
7565
|
-
if (!
|
|
7573
|
+
const T = I.children[k], x = k > 0 ? I.children[k - 1] : void 0, A = k < I.children.length - 1 ? I.children[k + 1] : void 0;
|
|
7574
|
+
let B = !1;
|
|
7575
|
+
return T.transitionIn && (T.transitionIn = void 0, A && (A.transitionOut = void 0), B = !0), T.transitionOut && (T.transitionOut = void 0, x && (x.transitionIn = void 0), B = !0), B;
|
|
7576
|
+
}), G = (j, D) => {
|
|
7577
|
+
const I = h.value.frames?.find((T) => T.trackType === "frames" && T.isMain);
|
|
7578
|
+
if (!I)
|
|
7566
7579
|
return !1;
|
|
7567
|
-
const
|
|
7568
|
-
return
|
|
7569
|
-
|
|
7570
|
-
},
|
|
7571
|
-
|
|
7572
|
-
},
|
|
7573
|
-
},
|
|
7574
|
-
const
|
|
7575
|
-
return
|
|
7576
|
-
}),
|
|
7580
|
+
const k = I.children.findIndex((T) => T.id === j);
|
|
7581
|
+
return k === -1 ? !1 : (L((T) => {
|
|
7582
|
+
T.transitionIn && D(T.transitionIn);
|
|
7583
|
+
}, I.children[k].id, "frames"), L((T) => {
|
|
7584
|
+
T.transitionOut && D(T.transitionOut);
|
|
7585
|
+
}, I.children[k + 1].id, "frames"), !0);
|
|
7586
|
+
}, H = (j, D) => g((I) => {
|
|
7587
|
+
const k = I.tracks.find((T) => T.trackId === j);
|
|
7588
|
+
return k ? (k.trackId = D, !0) : !1;
|
|
7589
|
+
}), Z = {
|
|
7577
7590
|
success: !1,
|
|
7578
7591
|
affectedSegments: [],
|
|
7579
7592
|
affectedTracks: [],
|
|
7580
7593
|
createdTracks: [],
|
|
7581
7594
|
removedTrackIds: [],
|
|
7582
7595
|
removedSegmentIds: []
|
|
7583
|
-
},
|
|
7596
|
+
}, Q = () => Cu(ur(Er(t.value)));
|
|
7584
7597
|
return {
|
|
7585
7598
|
videoBasicInfo: u,
|
|
7586
7599
|
curTime: a,
|
|
@@ -7589,45 +7602,45 @@ function Jc(l, o) {
|
|
|
7589
7602
|
trackMap: h,
|
|
7590
7603
|
segmentMap: _,
|
|
7591
7604
|
protocol: t,
|
|
7592
|
-
getSegment:
|
|
7593
|
-
addSegment:
|
|
7594
|
-
removeSegment:
|
|
7595
|
-
updateSegment:
|
|
7596
|
-
moveSegment:
|
|
7597
|
-
resizeSegment:
|
|
7605
|
+
getSegment: b,
|
|
7606
|
+
addSegment: w,
|
|
7607
|
+
removeSegment: U,
|
|
7608
|
+
updateSegment: L,
|
|
7609
|
+
moveSegment: P,
|
|
7610
|
+
resizeSegment: C,
|
|
7598
7611
|
exportProtocol: S,
|
|
7599
|
-
addTransition:
|
|
7600
|
-
removeTransition:
|
|
7601
|
-
updateTransition:
|
|
7602
|
-
replaceTrackId:
|
|
7612
|
+
addTransition: F,
|
|
7613
|
+
removeTransition: M,
|
|
7614
|
+
updateTransition: G,
|
|
7615
|
+
replaceTrackId: H,
|
|
7603
7616
|
undo: () => {
|
|
7604
7617
|
if (y.value <= 0)
|
|
7605
|
-
return
|
|
7606
|
-
const
|
|
7618
|
+
return Z;
|
|
7619
|
+
const j = Q();
|
|
7607
7620
|
n();
|
|
7608
|
-
const
|
|
7621
|
+
const D = Q(), I = mo(j, D);
|
|
7609
7622
|
return {
|
|
7610
7623
|
success: !0,
|
|
7611
|
-
affectedSegments:
|
|
7612
|
-
affectedTracks:
|
|
7613
|
-
createdTracks:
|
|
7614
|
-
removedTrackIds:
|
|
7615
|
-
removedSegmentIds:
|
|
7624
|
+
affectedSegments: I.affectedSegments,
|
|
7625
|
+
affectedTracks: I.affectedTracks,
|
|
7626
|
+
createdTracks: I.addedTracks,
|
|
7627
|
+
removedTrackIds: I.removedTrackIds,
|
|
7628
|
+
removedSegmentIds: I.removedSegmentIds
|
|
7616
7629
|
};
|
|
7617
7630
|
},
|
|
7618
7631
|
redo: () => {
|
|
7619
7632
|
if (E.value <= 0)
|
|
7620
|
-
return
|
|
7621
|
-
const
|
|
7633
|
+
return Z;
|
|
7634
|
+
const j = Q();
|
|
7622
7635
|
v();
|
|
7623
|
-
const
|
|
7636
|
+
const D = Q(), I = mo(j, D);
|
|
7624
7637
|
return {
|
|
7625
7638
|
success: !0,
|
|
7626
|
-
affectedSegments:
|
|
7627
|
-
affectedTracks:
|
|
7628
|
-
createdTracks:
|
|
7629
|
-
removedTrackIds:
|
|
7630
|
-
removedSegmentIds:
|
|
7639
|
+
affectedSegments: I.affectedSegments,
|
|
7640
|
+
affectedTracks: I.affectedTracks,
|
|
7641
|
+
createdTracks: I.addedTracks,
|
|
7642
|
+
removedTrackIds: I.removedTrackIds,
|
|
7643
|
+
removedSegmentIds: I.removedSegmentIds
|
|
7631
7644
|
};
|
|
7632
7645
|
},
|
|
7633
7646
|
redoCount: E,
|
|
@@ -7700,7 +7713,7 @@ function Bu(l) {
|
|
|
7700
7713
|
}
|
|
7701
7714
|
var Zo = (l) => {
|
|
7702
7715
|
throw TypeError(l);
|
|
7703
|
-
}, Xo = (l, o, c) => o.has(l) || Zo("Cannot " + c),
|
|
7716
|
+
}, Xo = (l, o, c) => o.has(l) || Zo("Cannot " + c), re = (l, o, c) => (Xo(l, o, "read from private field"), c ? c.call(l) : o.get(l)), we = (l, o, c) => o.has(l) ? Zo("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(l) : o.set(l, c), _e = (l, o, c, u) => (Xo(l, o, "write to private field"), o.set(l, c), c);
|
|
7704
7717
|
const Jo = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIHUobil7aWYobj09PSIvIilyZXR1cm57cGFyZW50Om51bGwsbmFtZToiIn07Y29uc3QgZT1uLnNwbGl0KCIvIikuZmlsdGVyKGk9PmkubGVuZ3RoPjApO2lmKGUubGVuZ3RoPT09MCl0aHJvdyBFcnJvcigiSW52YWxpZCBwYXRoIik7Y29uc3QgYT1lW2UubGVuZ3RoLTFdLHI9Ii8iK2Uuc2xpY2UoMCwtMSkuam9pbigiLyIpO3JldHVybntuYW1lOmEscGFyZW50OnJ9fWFzeW5jIGZ1bmN0aW9uIHcobixlKXtjb25zdHtwYXJlbnQ6YSxuYW1lOnJ9PXUobik7aWYoYT09bnVsbClyZXR1cm4gYXdhaXQgbmF2aWdhdG9yLnN0b3JhZ2UuZ2V0RGlyZWN0b3J5KCk7Y29uc3QgaT1hLnNwbGl0KCIvIikuZmlsdGVyKHQ9PnQubGVuZ3RoPjApO3RyeXtsZXQgdD1hd2FpdCBuYXZpZ2F0b3Iuc3RvcmFnZS5nZXREaXJlY3RvcnkoKTtmb3IoY29uc3QgcyBvZiBpKXQ9YXdhaXQgdC5nZXREaXJlY3RvcnlIYW5kbGUocyx7Y3JlYXRlOmUuY3JlYXRlfSk7aWYoZS5pc0ZpbGUpcmV0dXJuIGF3YWl0IHQuZ2V0RmlsZUhhbmRsZShyLHtjcmVhdGU6ZS5jcmVhdGV9KX1jYXRjaCh0KXtpZih0Lm5hbWU9PT0iTm90Rm91bmRFcnJvciIpcmV0dXJuIG51bGw7dGhyb3cgdH19Y29uc3QgZj17fTtzZWxmLm9ubWVzc2FnZT1hc3luYyBuPT57dmFyIGk7Y29uc3R7ZXZ0VHlwZTplLGFyZ3M6YX09bi5kYXRhO2xldCByPWZbYS5maWxlSWRdO3RyeXtsZXQgdDtjb25zdCBzPVtdO2lmKGU9PT0icmVnaXN0ZXIiKXtjb25zdCBsPWF3YWl0IHcoYS5maWxlUGF0aCx7Y3JlYXRlOiEwLGlzRmlsZTohMH0pO2lmKGw9PW51bGwpdGhyb3cgRXJyb3IoYG5vdCBmb3VuZCBmaWxlOiAke2EuZmlsZUlkfWApO3I9YXdhaXQgbC5jcmVhdGVTeW5jQWNjZXNzSGFuZGxlKHttb2RlOmEubW9kZX0pLGZbYS5maWxlSWRdPXJ9ZWxzZSBpZihlPT09ImNsb3NlIilhd2FpdCByLmNsb3NlKCksZGVsZXRlIGZbYS5maWxlSWRdO2Vsc2UgaWYoZT09PSJ0cnVuY2F0ZSIpYXdhaXQgci50cnVuY2F0ZShhLm5ld1NpemUpO2Vsc2UgaWYoZT09PSJ3cml0ZSIpe2NvbnN0e2RhdGE6bCxvcHRzOm99PW4uZGF0YS5hcmdzO3Q9YXdhaXQgci53cml0ZShsLG8pfWVsc2UgaWYoZT09PSJyZWFkIil7Y29uc3R7b2Zmc2V0Omwsc2l6ZTpvfT1uLmRhdGEuYXJncyxnPW5ldyBVaW50OEFycmF5KG8pLGQ9YXdhaXQgci5yZWFkKGcse2F0Omx9KSxjPWcuYnVmZmVyO3Q9ZD09PW8/YzooKGk9Yy50cmFuc2Zlcik9PW51bGw/dm9pZCAwOmkuY2FsbChjLGQpKT8/Yy5zbGljZSgwLGQpLHMucHVzaCh0KX1lbHNlIGU9PT0iZ2V0U2l6ZSI/dD1hd2FpdCByLmdldFNpemUoKTplPT09ImZsdXNoIiYmYXdhaXQgci5mbHVzaCgpO3NlbGYucG9zdE1lc3NhZ2Uoe2V2dFR5cGU6ImNhbGxiYWNrIixjYklkOm4uZGF0YS5jYklkLHJldHVyblZhbDp0fSxzKX1jYXRjaCh0KXtjb25zdCBzPXQ7c2VsZi5wb3N0TWVzc2FnZSh7ZXZ0VHlwZToidGhyb3dFcnJvciIsY2JJZDpuLmRhdGEuY2JJZCxlcnJNc2c6cy5uYW1lKyI6ICIrcy5tZXNzYWdlK2AKYCtKU09OLnN0cmluZ2lmeShuLmRhdGEpfSl9fX0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPW9wZnMtd29ya2VyLUY0UldscWNfLmpzLm1hcAo=", Du = (l) => Uint8Array.from(atob(l), (o) => o.charCodeAt(0)), yo = typeof self < "u" && self.Blob && new Blob([Du(Jo)], { type: "text/javascript;charset=utf-8" });
|
|
7705
7718
|
function Lu(l) {
|
|
7706
7719
|
let o;
|
|
@@ -7854,30 +7867,30 @@ const Nu = class Qo {
|
|
|
7854
7867
|
return "dir";
|
|
7855
7868
|
}
|
|
7856
7869
|
get name() {
|
|
7857
|
-
return
|
|
7870
|
+
return re(this, cr);
|
|
7858
7871
|
}
|
|
7859
7872
|
get path() {
|
|
7860
|
-
return
|
|
7873
|
+
return re(this, Te);
|
|
7861
7874
|
}
|
|
7862
7875
|
get parent() {
|
|
7863
|
-
return
|
|
7876
|
+
return re(this, Lt) == null ? null : Ne(re(this, Lt));
|
|
7864
7877
|
}
|
|
7865
7878
|
/**
|
|
7866
7879
|
* Creates the directory.
|
|
7867
7880
|
* return A promise that resolves when the directory is created.
|
|
7868
7881
|
*/
|
|
7869
7882
|
async create() {
|
|
7870
|
-
return await Oe(
|
|
7883
|
+
return await Oe(re(this, Te), {
|
|
7871
7884
|
create: !0,
|
|
7872
7885
|
isFile: !1
|
|
7873
|
-
}), Ne(
|
|
7886
|
+
}), Ne(re(this, Te));
|
|
7874
7887
|
}
|
|
7875
7888
|
/**
|
|
7876
7889
|
* Checks if the directory exists.
|
|
7877
7890
|
* return A promise that resolves to true if the directory exists, otherwise false.
|
|
7878
7891
|
*/
|
|
7879
7892
|
async exists() {
|
|
7880
|
-
return await Oe(
|
|
7893
|
+
return await Oe(re(this, Te), {
|
|
7881
7894
|
create: !1,
|
|
7882
7895
|
isFile: !1
|
|
7883
7896
|
}) instanceof FileSystemDirectoryHandle;
|
|
@@ -7894,7 +7907,7 @@ const Nu = class Qo {
|
|
|
7894
7907
|
console.warn(u);
|
|
7895
7908
|
}
|
|
7896
7909
|
try {
|
|
7897
|
-
await ln(
|
|
7910
|
+
await ln(re(this, Te));
|
|
7898
7911
|
} catch (c) {
|
|
7899
7912
|
console.warn(c);
|
|
7900
7913
|
}
|
|
@@ -7904,14 +7917,14 @@ const Nu = class Qo {
|
|
|
7904
7917
|
* return A promise that resolves to an array of objects representing the children.
|
|
7905
7918
|
*/
|
|
7906
7919
|
async children() {
|
|
7907
|
-
const o = await Oe(
|
|
7920
|
+
const o = await Oe(re(this, Te), {
|
|
7908
7921
|
create: !1,
|
|
7909
7922
|
isFile: !1
|
|
7910
7923
|
});
|
|
7911
7924
|
if (o == null) return [];
|
|
7912
7925
|
const c = [];
|
|
7913
7926
|
for await (const u of o.values())
|
|
7914
|
-
c.push((u.kind === "file" ? Se : Ne)(dn(
|
|
7927
|
+
c.push((u.kind === "file" ? Se : Ne)(dn(re(this, Te), u.name)));
|
|
7915
7928
|
return c;
|
|
7916
7929
|
}
|
|
7917
7930
|
async copyTo(o) {
|
|
@@ -7980,19 +7993,19 @@ const Gu = class tl {
|
|
|
7980
7993
|
we(this, be), we(this, $t), we(this, hr), we(this, Ot), we(this, pr), we(this, ke, 0), we(this, _r, async () => {
|
|
7981
7994
|
}), we(this, mr, /* @__PURE__ */ (() => {
|
|
7982
7995
|
let h = null;
|
|
7983
|
-
return () => (_e(this, ke,
|
|
7996
|
+
return () => (_e(this, ke, re(this, ke) + 1), h != null || (h = new Promise(async (g, n) => {
|
|
7984
7997
|
try {
|
|
7985
7998
|
const v = await $u(
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7999
|
+
re(this, pr),
|
|
8000
|
+
re(this, be),
|
|
8001
|
+
re(this, Ot)
|
|
7989
8002
|
);
|
|
7990
8003
|
_e(this, _r, async () => {
|
|
7991
8004
|
h != null && (h = null, _e(this, ke, 0), await v.close().catch(console.error));
|
|
7992
8005
|
}), g([
|
|
7993
8006
|
v,
|
|
7994
8007
|
async () => {
|
|
7995
|
-
_e(this, ke,
|
|
8008
|
+
_e(this, ke, re(this, ke) - 1), !(re(this, ke) > 0) && (h = null, await v.close());
|
|
7996
8009
|
}
|
|
7997
8010
|
]);
|
|
7998
8011
|
} catch (v) {
|
|
@@ -8012,23 +8025,23 @@ const Gu = class tl {
|
|
|
8012
8025
|
return "file";
|
|
8013
8026
|
}
|
|
8014
8027
|
get path() {
|
|
8015
|
-
return
|
|
8028
|
+
return re(this, be);
|
|
8016
8029
|
}
|
|
8017
8030
|
get name() {
|
|
8018
|
-
return
|
|
8031
|
+
return re(this, hr);
|
|
8019
8032
|
}
|
|
8020
8033
|
get parent() {
|
|
8021
|
-
return
|
|
8034
|
+
return re(this, $t) == null ? null : Ne(re(this, $t));
|
|
8022
8035
|
}
|
|
8023
8036
|
/**
|
|
8024
8037
|
* Random write to file
|
|
8025
8038
|
*/
|
|
8026
8039
|
async createWriter() {
|
|
8027
|
-
if (
|
|
8028
|
-
if (
|
|
8040
|
+
if (re(this, Ot) === "read-only") throw Error("file is read-only");
|
|
8041
|
+
if (re(this, it)) throw Error("Other writer have not been closed");
|
|
8029
8042
|
_e(this, it, !0);
|
|
8030
8043
|
try {
|
|
8031
|
-
const o = new TextEncoder(), [c, u] = await
|
|
8044
|
+
const o = new TextEncoder(), [c, u] = await re(this, mr).call(this);
|
|
8032
8045
|
let _ = await c.getSize(), h = !1;
|
|
8033
8046
|
return {
|
|
8034
8047
|
write: async (g, n = {}) => {
|
|
@@ -8057,7 +8070,7 @@ const Gu = class tl {
|
|
|
8057
8070
|
* Random access to file
|
|
8058
8071
|
*/
|
|
8059
8072
|
async createReader() {
|
|
8060
|
-
const [o, c] = await
|
|
8073
|
+
const [o, c] = await re(this, mr).call(this);
|
|
8061
8074
|
let u = !1, _ = 0;
|
|
8062
8075
|
return {
|
|
8063
8076
|
read: async (h, g = {}) => {
|
|
@@ -8078,7 +8091,7 @@ const Gu = class tl {
|
|
|
8078
8091
|
return new TextDecoder().decode(await this.arrayBuffer());
|
|
8079
8092
|
}
|
|
8080
8093
|
async arrayBuffer() {
|
|
8081
|
-
const o = await Oe(
|
|
8094
|
+
const o = await Oe(re(this, be), { create: !1, isFile: !0 });
|
|
8082
8095
|
return o == null ? new ArrayBuffer(0) : (await o.getFile()).arrayBuffer();
|
|
8083
8096
|
}
|
|
8084
8097
|
async stream() {
|
|
@@ -8091,25 +8104,25 @@ const Gu = class tl {
|
|
|
8091
8104
|
}
|
|
8092
8105
|
async getOriginFile() {
|
|
8093
8106
|
var o;
|
|
8094
|
-
return (o = await Oe(
|
|
8107
|
+
return (o = await Oe(re(this, be), { create: !1, isFile: !0 })) == null ? void 0 : o.getFile();
|
|
8095
8108
|
}
|
|
8096
8109
|
async getSize() {
|
|
8097
|
-
const o = await Oe(
|
|
8110
|
+
const o = await Oe(re(this, be), { create: !1, isFile: !0 });
|
|
8098
8111
|
return o == null ? 0 : (await o.getFile()).size;
|
|
8099
8112
|
}
|
|
8100
8113
|
async exists() {
|
|
8101
|
-
return await Oe(
|
|
8114
|
+
return await Oe(re(this, be), {
|
|
8102
8115
|
create: !1,
|
|
8103
8116
|
isFile: !0
|
|
8104
8117
|
}) instanceof FileSystemFileHandle;
|
|
8105
8118
|
}
|
|
8106
8119
|
async remove(o = {}) {
|
|
8107
8120
|
if (o.force === !0) {
|
|
8108
|
-
await
|
|
8121
|
+
await re(this, _r).call(this), await ln(re(this, be)), fn.delete(re(this, be));
|
|
8109
8122
|
return;
|
|
8110
8123
|
}
|
|
8111
|
-
if (
|
|
8112
|
-
await ln(
|
|
8124
|
+
if (re(this, ke) > 0) throw Error("exists unclosed reader/writer");
|
|
8125
|
+
await ln(re(this, be));
|
|
8113
8126
|
}
|
|
8114
8127
|
async copyTo(o) {
|
|
8115
8128
|
if (o instanceof tl)
|
|
@@ -10025,8 +10038,8 @@ function Yu() {
|
|
|
10025
10038
|
this.held_bits = C.readUint16(), this.num_held_bits = 16;
|
|
10026
10039
|
},
|
|
10027
10040
|
extract_bits: function(C) {
|
|
10028
|
-
var
|
|
10029
|
-
return this.num_held_bits -= C,
|
|
10041
|
+
var L = this.held_bits >> this.num_held_bits - C & (1 << C) - 1;
|
|
10042
|
+
return this.num_held_bits -= C, L;
|
|
10030
10043
|
}
|
|
10031
10044
|
};
|
|
10032
10045
|
if (r.stream_read_1_bytes(t), r.extract_bits(5), this.lengthSizeMinusOne = r.extract_bits(2), this.ptl_present_flag = r.extract_bits(1), this.ptl_present_flag) {
|
|
@@ -10792,33 +10805,33 @@ function Yu() {
|
|
|
10792
10805
|
for (t = 0; t < this.moov.traks.length; t++)
|
|
10793
10806
|
a = this.moov.traks[t], this.buildTrakSampleLists(a);
|
|
10794
10807
|
}, y.prototype.buildTrakSampleLists = function(t) {
|
|
10795
|
-
var a, e, r, s, f, d, p, m, b, w, U, P, C,
|
|
10796
|
-
if (t.samples = [], t.samples_duration = 0, t.samples_size = 0, e = t.mdia.minf.stbl.stco || t.mdia.minf.stbl.co64, r = t.mdia.minf.stbl.stsc, s = t.mdia.minf.stbl.stsz || t.mdia.minf.stbl.stz2, f = t.mdia.minf.stbl.stts, d = t.mdia.minf.stbl.ctts, p = t.mdia.minf.stbl.stss, m = t.mdia.minf.stbl.stsd, b = t.mdia.minf.stbl.subs, P = t.mdia.minf.stbl.stdp, w = t.mdia.minf.stbl.sbgps, U = t.mdia.minf.stbl.sgpds,
|
|
10808
|
+
var a, e, r, s, f, d, p, m, b, w, U, P, C, L, F, M, G, H, Z, Q, ie, J, j, D;
|
|
10809
|
+
if (t.samples = [], t.samples_duration = 0, t.samples_size = 0, e = t.mdia.minf.stbl.stco || t.mdia.minf.stbl.co64, r = t.mdia.minf.stbl.stsc, s = t.mdia.minf.stbl.stsz || t.mdia.minf.stbl.stz2, f = t.mdia.minf.stbl.stts, d = t.mdia.minf.stbl.ctts, p = t.mdia.minf.stbl.stss, m = t.mdia.minf.stbl.stsd, b = t.mdia.minf.stbl.subs, P = t.mdia.minf.stbl.stdp, w = t.mdia.minf.stbl.sbgps, U = t.mdia.minf.stbl.sgpds, H = -1, Z = -1, Q = -1, ie = -1, J = 0, j = 0, D = 0, y.initSampleGroups(t, null, w, U), !(typeof s > "u")) {
|
|
10797
10810
|
for (a = 0; a < s.sample_sizes.length; a++) {
|
|
10798
|
-
var
|
|
10799
|
-
|
|
10811
|
+
var I = {};
|
|
10812
|
+
I.number = a, I.track_id = t.tkhd.track_id, I.timescale = t.mdia.mdhd.timescale, I.alreadyRead = 0, t.samples[a] = I, I.size = s.sample_sizes[a], t.samples_size += I.size, a === 0 ? (L = 1, C = 0, I.chunk_index = L, I.chunk_run_index = C, G = r.samples_per_chunk[C], M = 0, C + 1 < r.first_chunk.length ? F = r.first_chunk[C + 1] - 1 : F = 1 / 0) : a < G ? (I.chunk_index = L, I.chunk_run_index = C) : (L++, I.chunk_index = L, M = 0, L <= F || (C++, C + 1 < r.first_chunk.length ? F = r.first_chunk[C + 1] - 1 : F = 1 / 0), I.chunk_run_index = C, G += r.samples_per_chunk[C]), I.description_index = r.sample_description_index[I.chunk_run_index] - 1, I.description = m.entries[I.description_index], I.offset = e.chunk_offsets[I.chunk_index - 1] + M, M += I.size, a > H && (Z++, H < 0 && (H = 0), H += f.sample_counts[Z]), a > 0 ? (t.samples[a - 1].duration = f.sample_deltas[Z], t.samples_duration += t.samples[a - 1].duration, I.dts = t.samples[a - 1].dts + t.samples[a - 1].duration) : I.dts = 0, d ? (a >= Q && (ie++, Q < 0 && (Q = 0), Q += d.sample_counts[ie]), I.cts = t.samples[a].dts + d.sample_offsets[ie]) : I.cts = I.dts, p ? (a == p.sample_numbers[J] - 1 ? (I.is_sync = !0, J++) : (I.is_sync = !1, I.degradation_priority = 0), b && b.entries[j].sample_delta + D == a + 1 && (I.subsamples = b.entries[j].subsamples, D += b.entries[j].sample_delta, j++)) : I.is_sync = !0, y.process_sdtp(t.mdia.minf.stbl.sdtp, I, I.number), P ? I.degradation_priority = P.priority[a] : I.degradation_priority = 0, b && b.entries[j].sample_delta + D == a && (I.subsamples = b.entries[j].subsamples, D += b.entries[j].sample_delta), (w.length > 0 || U.length > 0) && y.setSampleGroupProperties(t, I, a, t.sample_groups_info);
|
|
10800
10813
|
}
|
|
10801
10814
|
a > 0 && (t.samples[a - 1].duration = Math.max(t.mdia.mdhd.duration - t.samples[a - 1].dts, 0), t.samples_duration += t.samples[a - 1].duration);
|
|
10802
10815
|
}
|
|
10803
10816
|
}, y.prototype.updateSampleLists = function() {
|
|
10804
|
-
var t, a, e, r, s, f, d, p, m, b, w, U, P, C,
|
|
10817
|
+
var t, a, e, r, s, f, d, p, m, b, w, U, P, C, L;
|
|
10805
10818
|
if (this.moov !== void 0) {
|
|
10806
10819
|
for (; this.lastMoofIndex < this.moofs.length; )
|
|
10807
10820
|
if (m = this.moofs[this.lastMoofIndex], this.lastMoofIndex++, m.type == "moof")
|
|
10808
10821
|
for (b = m, t = 0; t < b.trafs.length; t++) {
|
|
10809
10822
|
for (w = b.trafs[t], U = this.getTrackById(w.tfhd.track_id), P = this.getTrexById(w.tfhd.track_id), w.tfhd.flags & n.TFHD_FLAG_SAMPLE_DESC ? r = w.tfhd.default_sample_description_index : r = P ? P.default_sample_description_index : 1, w.tfhd.flags & n.TFHD_FLAG_SAMPLE_DUR ? s = w.tfhd.default_sample_duration : s = P ? P.default_sample_duration : 0, w.tfhd.flags & n.TFHD_FLAG_SAMPLE_SIZE ? f = w.tfhd.default_sample_size : f = P ? P.default_sample_size : 0, w.tfhd.flags & n.TFHD_FLAG_SAMPLE_FLAGS ? d = w.tfhd.default_sample_flags : d = P ? P.default_sample_flags : 0, w.sample_number = 0, w.sbgps.length > 0 && y.initSampleGroups(U, w, w.sbgps, U.mdia.minf.stbl.sgpds, w.sgpds), a = 0; a < w.truns.length; a++) {
|
|
10810
|
-
var
|
|
10811
|
-
for (e = 0; e <
|
|
10812
|
-
C = {}, C.moof_number = this.lastMoofIndex, C.number_in_traf = w.sample_number, w.sample_number++, C.number = U.samples.length, w.first_sample_index = U.samples.length, U.samples.push(C), C.track_id = U.tkhd.track_id, C.timescale = U.mdia.mdhd.timescale, C.description_index = r - 1, C.description = U.mdia.minf.stbl.stsd.entries[C.description_index], C.size = f,
|
|
10813
|
-
var M = !!(w.tfhd.flags & n.TFHD_FLAG_BASE_DATA_OFFSET), G = !!(w.tfhd.flags & n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),
|
|
10814
|
-
M ?
|
|
10823
|
+
var F = w.truns[a];
|
|
10824
|
+
for (e = 0; e < F.sample_count; e++) {
|
|
10825
|
+
C = {}, C.moof_number = this.lastMoofIndex, C.number_in_traf = w.sample_number, w.sample_number++, C.number = U.samples.length, w.first_sample_index = U.samples.length, U.samples.push(C), C.track_id = U.tkhd.track_id, C.timescale = U.mdia.mdhd.timescale, C.description_index = r - 1, C.description = U.mdia.minf.stbl.stsd.entries[C.description_index], C.size = f, F.flags & n.TRUN_FLAGS_SIZE && (C.size = F.sample_size[e]), U.samples_size += C.size, C.duration = s, F.flags & n.TRUN_FLAGS_DURATION && (C.duration = F.sample_duration[e]), U.samples_duration += C.duration, U.first_traf_merged || e > 0 ? C.dts = U.samples[U.samples.length - 2].dts + U.samples[U.samples.length - 2].duration : (w.tfdt ? C.dts = w.tfdt.baseMediaDecodeTime : C.dts = 0, U.first_traf_merged = !0), C.cts = C.dts, F.flags & n.TRUN_FLAGS_CTS_OFFSET && (C.cts = C.dts + F.sample_composition_time_offset[e]), L = d, F.flags & n.TRUN_FLAGS_FLAGS ? L = F.sample_flags[e] : e === 0 && F.flags & n.TRUN_FLAGS_FIRST_FLAG && (L = F.first_sample_flags), C.is_sync = !(L >> 16 & 1), C.is_leading = L >> 26 & 3, C.depends_on = L >> 24 & 3, C.is_depended_on = L >> 22 & 3, C.has_redundancy = L >> 20 & 3, C.degradation_priority = L & 65535;
|
|
10826
|
+
var M = !!(w.tfhd.flags & n.TFHD_FLAG_BASE_DATA_OFFSET), G = !!(w.tfhd.flags & n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF), H = !!(F.flags & n.TRUN_FLAGS_DATA_OFFSET), Z = 0;
|
|
10827
|
+
M ? Z = w.tfhd.base_data_offset : G || a === 0 ? Z = b.start : Z = p, a === 0 && e === 0 ? H ? C.offset = Z + F.data_offset : C.offset = Z : C.offset = p, p = C.offset + C.size, (w.sbgps.length > 0 || w.sgpds.length > 0 || U.mdia.minf.stbl.sbgps.length > 0 || U.mdia.minf.stbl.sgpds.length > 0) && y.setSampleGroupProperties(U, C, C.number_in_traf, w.sample_groups_info);
|
|
10815
10828
|
}
|
|
10816
10829
|
}
|
|
10817
10830
|
if (w.subs) {
|
|
10818
10831
|
U.has_fragment_subsamples = !0;
|
|
10819
|
-
var
|
|
10832
|
+
var Q = w.first_sample_index;
|
|
10820
10833
|
for (a = 0; a < w.subs.entries.length; a++)
|
|
10821
|
-
|
|
10834
|
+
Q += w.subs.entries[a].sample_delta, C = U.samples[Q - 1], C.subsamples = w.subs.entries[a].subsamples;
|
|
10822
10835
|
}
|
|
10823
10836
|
}
|
|
10824
10837
|
}
|
|
@@ -11235,9 +11248,9 @@ function ic() {
|
|
|
11235
11248
|
o.getDurationString = function(e, r) {
|
|
11236
11249
|
var s;
|
|
11237
11250
|
function f(U, P) {
|
|
11238
|
-
for (var C = "" + U,
|
|
11239
|
-
|
|
11240
|
-
return
|
|
11251
|
+
for (var C = "" + U, L = C.split("."); L[0].length < P; )
|
|
11252
|
+
L[0] = "0" + L[0];
|
|
11253
|
+
return L.join(".");
|
|
11241
11254
|
}
|
|
11242
11255
|
e < 0 ? (s = !0, e = -e) : s = !1;
|
|
11243
11256
|
var d = r || 1, p = e / d, m = Math.floor(p / 3600);
|
|
@@ -13098,15 +13111,15 @@ function ic() {
|
|
|
13098
13111
|
var r, s, f = {
|
|
13099
13112
|
held_bits: void 0,
|
|
13100
13113
|
num_held_bits: 0,
|
|
13101
|
-
stream_read_1_bytes: function(
|
|
13102
|
-
this.held_bits =
|
|
13114
|
+
stream_read_1_bytes: function(F) {
|
|
13115
|
+
this.held_bits = F.readUint8(), this.num_held_bits = 8;
|
|
13103
13116
|
},
|
|
13104
|
-
stream_read_2_bytes: function(
|
|
13105
|
-
this.held_bits =
|
|
13117
|
+
stream_read_2_bytes: function(F) {
|
|
13118
|
+
this.held_bits = F.readUint16(), this.num_held_bits = 16;
|
|
13106
13119
|
},
|
|
13107
|
-
extract_bits: function(
|
|
13108
|
-
var M = this.held_bits >> this.num_held_bits -
|
|
13109
|
-
return this.num_held_bits -=
|
|
13120
|
+
extract_bits: function(F) {
|
|
13121
|
+
var M = this.held_bits >> this.num_held_bits - F & (1 << F) - 1;
|
|
13122
|
+
return this.num_held_bits -= F, M;
|
|
13110
13123
|
}
|
|
13111
13124
|
};
|
|
13112
13125
|
if (f.stream_read_1_bytes(e), f.extract_bits(5), this.lengthSizeMinusOne = f.extract_bits(2), this.ptl_present_flag = f.extract_bits(1), this.ptl_present_flag) {
|
|
@@ -13146,10 +13159,10 @@ function ic() {
|
|
|
13146
13159
|
this.nalu_arrays.push(P), f.stream_read_1_bytes(e), P.completeness = f.extract_bits(1), f.extract_bits(2), P.nalu_type = f.extract_bits(5);
|
|
13147
13160
|
var C = 1;
|
|
13148
13161
|
for (P.nalu_type != w && P.nalu_type != b && (C = e.readUint16()), s = 0; s < C; s++) {
|
|
13149
|
-
var
|
|
13162
|
+
var L = e.readUint16();
|
|
13150
13163
|
P.push({
|
|
13151
|
-
data: e.readUint8Array(
|
|
13152
|
-
length:
|
|
13164
|
+
data: e.readUint8Array(L),
|
|
13165
|
+
length: L
|
|
13153
13166
|
});
|
|
13154
13167
|
}
|
|
13155
13168
|
}
|
|
@@ -13794,8 +13807,8 @@ function ic() {
|
|
|
13794
13807
|
var C = new n.hvcCBox();
|
|
13795
13808
|
C.parse(new c(r.hevcDecoderConfigRecord)), p.addBox(C);
|
|
13796
13809
|
} else if (r.vpcDecoderConfigRecord) {
|
|
13797
|
-
var
|
|
13798
|
-
|
|
13810
|
+
var L = new n.vpcCBox();
|
|
13811
|
+
L.parse(new c(r.vpcDecoderConfigRecord)), p.addBox(L);
|
|
13799
13812
|
}
|
|
13800
13813
|
break;
|
|
13801
13814
|
case "Audio":
|
|
@@ -13820,8 +13833,8 @@ function ic() {
|
|
|
13820
13833
|
r.description && p.addBox(r.description), r.description_boxes && r.description_boxes.forEach(function(M) {
|
|
13821
13834
|
p.addBox(M);
|
|
13822
13835
|
}), d.add("dinf").add("dref").addEntry(new n["url Box"]().set("flags", 1));
|
|
13823
|
-
var
|
|
13824
|
-
return
|
|
13836
|
+
var F = d.add("stbl");
|
|
13837
|
+
return F.add("stsd").addEntry(p), F.add("stts").set("sample_counts", []).set("sample_deltas", []), F.add("stsc").set("first_chunk", []).set("samples_per_chunk", []).set("sample_description_index", []), F.add("stco").set("chunk_offsets", []), F.add("stsz").set("sample_sizes", []), this.moov.mvex.add("trex").set("track_id", r.id).set("default_sample_description_index", r.default_sample_description_index || 1).set("default_sample_duration", r.default_sample_duration || 0).set("default_sample_size", r.default_sample_size || 0).set("default_sample_flags", r.default_sample_flags || 0), this.buildTrakSampleLists(s), r.id;
|
|
13825
13838
|
}
|
|
13826
13839
|
}, n.Box.prototype.computeSize = function(e) {
|
|
13827
13840
|
var r = e || new u();
|
|
@@ -13849,8 +13862,8 @@ function ic() {
|
|
|
13849
13862
|
}
|
|
13850
13863
|
}, t.initSampleGroups = function(e, r, s, f, d) {
|
|
13851
13864
|
var p, m, b, w;
|
|
13852
|
-
function U(P, C,
|
|
13853
|
-
this.grouping_type = P, this.grouping_type_parameter = C, this.sbgp =
|
|
13865
|
+
function U(P, C, L) {
|
|
13866
|
+
this.grouping_type = P, this.grouping_type_parameter = C, this.sbgp = L, this.last_sample_in_run = -1, this.entry_index = -1;
|
|
13854
13867
|
}
|
|
13855
13868
|
for (r && (r.sample_groups_info = []), e.sample_groups_info || (e.sample_groups_info = []), m = 0; m < s.length; m++) {
|
|
13856
13869
|
for (w = s[m].grouping_type + "/" + s[m].grouping_type_parameter, b = new U(s[m].grouping_type, s[m].grouping_type_parameter, s[m]), r && (r.sample_groups_info[w] = b), e.sample_groups_info[w] || (e.sample_groups_info[w] = b), p = 0; p < f.length; p++)
|
|
@@ -13881,33 +13894,33 @@ function ic() {
|
|
|
13881
13894
|
for (e = 0; e < this.moov.traks.length; e++)
|
|
13882
13895
|
r = this.moov.traks[e], this.buildTrakSampleLists(r);
|
|
13883
13896
|
}, t.prototype.buildTrakSampleLists = function(e) {
|
|
13884
|
-
var r, s, f, d, p, m, b, w, U, P, C,
|
|
13885
|
-
if (e.samples = [], e.samples_duration = 0, e.samples_size = 0, s = e.mdia.minf.stbl.stco || e.mdia.minf.stbl.co64, f = e.mdia.minf.stbl.stsc, d = e.mdia.minf.stbl.stsz || e.mdia.minf.stbl.stz2, p = e.mdia.minf.stbl.stts, m = e.mdia.minf.stbl.ctts, b = e.mdia.minf.stbl.stss, w = e.mdia.minf.stbl.stsd, U = e.mdia.minf.stbl.subs,
|
|
13897
|
+
var r, s, f, d, p, m, b, w, U, P, C, L, F, M, G, H, Z, Q, ie, J, j, D, I, k;
|
|
13898
|
+
if (e.samples = [], e.samples_duration = 0, e.samples_size = 0, s = e.mdia.minf.stbl.stco || e.mdia.minf.stbl.co64, f = e.mdia.minf.stbl.stsc, d = e.mdia.minf.stbl.stsz || e.mdia.minf.stbl.stz2, p = e.mdia.minf.stbl.stts, m = e.mdia.minf.stbl.ctts, b = e.mdia.minf.stbl.stss, w = e.mdia.minf.stbl.stsd, U = e.mdia.minf.stbl.subs, L = e.mdia.minf.stbl.stdp, P = e.mdia.minf.stbl.sbgps, C = e.mdia.minf.stbl.sgpds, Q = -1, ie = -1, J = -1, j = -1, D = 0, I = 0, k = 0, t.initSampleGroups(e, null, P, C), !(typeof d > "u")) {
|
|
13886
13899
|
for (r = 0; r < d.sample_sizes.length; r++) {
|
|
13887
13900
|
var T = {};
|
|
13888
|
-
T.number = r, T.track_id = e.tkhd.track_id, T.timescale = e.mdia.mdhd.timescale, T.alreadyRead = 0, e.samples[r] = T, T.size = d.sample_sizes[r], e.samples_size += T.size, r === 0 ? (M = 1,
|
|
13901
|
+
T.number = r, T.track_id = e.tkhd.track_id, T.timescale = e.mdia.mdhd.timescale, T.alreadyRead = 0, e.samples[r] = T, T.size = d.sample_sizes[r], e.samples_size += T.size, r === 0 ? (M = 1, F = 0, T.chunk_index = M, T.chunk_run_index = F, Z = f.samples_per_chunk[F], H = 0, F + 1 < f.first_chunk.length ? G = f.first_chunk[F + 1] - 1 : G = 1 / 0) : r < Z ? (T.chunk_index = M, T.chunk_run_index = F) : (M++, T.chunk_index = M, H = 0, M <= G || (F++, F + 1 < f.first_chunk.length ? G = f.first_chunk[F + 1] - 1 : G = 1 / 0), T.chunk_run_index = F, Z += f.samples_per_chunk[F]), T.description_index = f.sample_description_index[T.chunk_run_index] - 1, T.description = w.entries[T.description_index], T.offset = s.chunk_offsets[T.chunk_index - 1] + H, H += T.size, r > Q && (ie++, Q < 0 && (Q = 0), Q += p.sample_counts[ie]), r > 0 ? (e.samples[r - 1].duration = p.sample_deltas[ie], e.samples_duration += e.samples[r - 1].duration, T.dts = e.samples[r - 1].dts + e.samples[r - 1].duration) : T.dts = 0, m ? (r >= J && (j++, J < 0 && (J = 0), J += m.sample_counts[j]), T.cts = e.samples[r].dts + m.sample_offsets[j]) : T.cts = T.dts, b ? (r == b.sample_numbers[D] - 1 ? (T.is_sync = !0, D++) : (T.is_sync = !1, T.degradation_priority = 0), U && U.entries[I].sample_delta + k == r + 1 && (T.subsamples = U.entries[I].subsamples, k += U.entries[I].sample_delta, I++)) : T.is_sync = !0, t.process_sdtp(e.mdia.minf.stbl.sdtp, T, T.number), L ? T.degradation_priority = L.priority[r] : T.degradation_priority = 0, U && U.entries[I].sample_delta + k == r && (T.subsamples = U.entries[I].subsamples, k += U.entries[I].sample_delta), (P.length > 0 || C.length > 0) && t.setSampleGroupProperties(e, T, r, e.sample_groups_info);
|
|
13889
13902
|
}
|
|
13890
13903
|
r > 0 && (e.samples[r - 1].duration = Math.max(e.mdia.mdhd.duration - e.samples[r - 1].dts, 0), e.samples_duration += e.samples[r - 1].duration);
|
|
13891
13904
|
}
|
|
13892
13905
|
}, t.prototype.updateSampleLists = function() {
|
|
13893
|
-
var e, r, s, f, d, p, m, b, w, U, P, C,
|
|
13906
|
+
var e, r, s, f, d, p, m, b, w, U, P, C, L, F, M;
|
|
13894
13907
|
if (this.moov !== void 0) {
|
|
13895
13908
|
for (; this.lastMoofIndex < this.moofs.length; )
|
|
13896
13909
|
if (w = this.moofs[this.lastMoofIndex], this.lastMoofIndex++, w.type == "moof")
|
|
13897
13910
|
for (U = w, e = 0; e < U.trafs.length; e++) {
|
|
13898
|
-
for (P = U.trafs[e], C = this.getTrackById(P.tfhd.track_id), C.samples == null && (C.samples = []),
|
|
13911
|
+
for (P = U.trafs[e], C = this.getTrackById(P.tfhd.track_id), C.samples == null && (C.samples = []), L = this.getTrexById(P.tfhd.track_id), P.tfhd.flags & n.TFHD_FLAG_SAMPLE_DESC ? f = P.tfhd.default_sample_description_index : f = L ? L.default_sample_description_index : 1, P.tfhd.flags & n.TFHD_FLAG_SAMPLE_DUR ? d = P.tfhd.default_sample_duration : d = L ? L.default_sample_duration : 0, P.tfhd.flags & n.TFHD_FLAG_SAMPLE_SIZE ? p = P.tfhd.default_sample_size : p = L ? L.default_sample_size : 0, P.tfhd.flags & n.TFHD_FLAG_SAMPLE_FLAGS ? m = P.tfhd.default_sample_flags : m = L ? L.default_sample_flags : 0, P.sample_number = 0, P.sbgps.length > 0 && t.initSampleGroups(C, P, P.sbgps, C.mdia.minf.stbl.sgpds, P.sgpds), r = 0; r < P.truns.length; r++) {
|
|
13899
13912
|
var G = P.truns[r];
|
|
13900
13913
|
for (s = 0; s < G.sample_count; s++) {
|
|
13901
|
-
|
|
13902
|
-
var
|
|
13903
|
-
|
|
13914
|
+
F = {}, F.moof_number = this.lastMoofIndex, F.number_in_traf = P.sample_number, P.sample_number++, F.number = C.samples.length, P.first_sample_index = C.samples.length, C.samples.push(F), F.track_id = C.tkhd.track_id, F.timescale = C.mdia.mdhd.timescale, F.description_index = f - 1, F.description = C.mdia.minf.stbl.stsd.entries[F.description_index], F.size = p, G.flags & n.TRUN_FLAGS_SIZE && (F.size = G.sample_size[s]), C.samples_size += F.size, F.duration = d, G.flags & n.TRUN_FLAGS_DURATION && (F.duration = G.sample_duration[s]), C.samples_duration += F.duration, C.first_traf_merged || s > 0 ? F.dts = C.samples[C.samples.length - 2].dts + C.samples[C.samples.length - 2].duration : (P.tfdt ? F.dts = P.tfdt.baseMediaDecodeTime : F.dts = 0, C.first_traf_merged = !0), F.cts = F.dts, G.flags & n.TRUN_FLAGS_CTS_OFFSET && (F.cts = F.dts + G.sample_composition_time_offset[s]), M = m, G.flags & n.TRUN_FLAGS_FLAGS ? M = G.sample_flags[s] : s === 0 && G.flags & n.TRUN_FLAGS_FIRST_FLAG && (M = G.first_sample_flags), F.is_sync = !(M >> 16 & 1), F.is_leading = M >> 26 & 3, F.depends_on = M >> 24 & 3, F.is_depended_on = M >> 22 & 3, F.has_redundancy = M >> 20 & 3, F.degradation_priority = M & 65535;
|
|
13915
|
+
var H = !!(P.tfhd.flags & n.TFHD_FLAG_BASE_DATA_OFFSET), Z = !!(P.tfhd.flags & n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF), Q = !!(G.flags & n.TRUN_FLAGS_DATA_OFFSET), ie = 0;
|
|
13916
|
+
H ? ie = P.tfhd.base_data_offset : Z || r === 0 ? ie = U.start : ie = b, r === 0 && s === 0 ? Q ? F.offset = ie + G.data_offset : F.offset = ie : F.offset = b, b = F.offset + F.size, (P.sbgps.length > 0 || P.sgpds.length > 0 || C.mdia.minf.stbl.sbgps.length > 0 || C.mdia.minf.stbl.sgpds.length > 0) && t.setSampleGroupProperties(C, F, F.number_in_traf, P.sample_groups_info);
|
|
13904
13917
|
}
|
|
13905
13918
|
}
|
|
13906
13919
|
if (P.subs) {
|
|
13907
13920
|
C.has_fragment_subsamples = !0;
|
|
13908
|
-
var
|
|
13921
|
+
var J = P.first_sample_index;
|
|
13909
13922
|
for (r = 0; r < P.subs.entries.length; r++)
|
|
13910
|
-
|
|
13923
|
+
J += P.subs.entries[r].sample_delta, F = C.samples[J - 1], F.subsamples = P.subs.entries[r].subsamples;
|
|
13911
13924
|
}
|
|
13912
13925
|
}
|
|
13913
13926
|
}
|
|
@@ -14010,8 +14023,8 @@ function ic() {
|
|
|
14010
14023
|
for (d.properties === void 0 && (d.properties = {}, d.properties.boxes = []), f = 0; f < P.props.length; f++) {
|
|
14011
14024
|
var C = P.props[f];
|
|
14012
14025
|
if (C.property_index > 0 && C.property_index - 1 < p.iprp.ipco.boxes.length) {
|
|
14013
|
-
var
|
|
14014
|
-
d.properties[
|
|
14026
|
+
var L = p.iprp.ipco.boxes[C.property_index - 1];
|
|
14027
|
+
d.properties[L.type] = L, d.properties.boxes.push(L);
|
|
14015
14028
|
}
|
|
14016
14029
|
}
|
|
14017
14030
|
}
|
|
@@ -14196,7 +14209,7 @@ const ll = [], So = ["debug", "info", "warn", "error"].reduce(
|
|
|
14196
14209
|
}
|
|
14197
14210
|
}),
|
|
14198
14211
|
{}
|
|
14199
|
-
), si = /* @__PURE__ */ new Map(),
|
|
14212
|
+
), si = /* @__PURE__ */ new Map(), le = {
|
|
14200
14213
|
/**
|
|
14201
14214
|
* 设置记录日志的级别
|
|
14202
14215
|
*
|
|
@@ -14235,20 +14248,20 @@ const ll = [], So = ["debug", "info", "warn", "error"].reduce(
|
|
|
14235
14248
|
);
|
|
14236
14249
|
}
|
|
14237
14250
|
};
|
|
14238
|
-
si.set(
|
|
14239
|
-
si.set(
|
|
14240
|
-
si.set(
|
|
14241
|
-
si.set(
|
|
14251
|
+
si.set(le.debug, 0);
|
|
14252
|
+
si.set(le.info, 1);
|
|
14253
|
+
si.set(le.warn, 2);
|
|
14254
|
+
si.set(le.error, 3);
|
|
14242
14255
|
(async function() {
|
|
14243
|
-
if (await Promise.resolve(), !(globalThis.navigator == null || globalThis.document == null) && (
|
|
14256
|
+
if (await Promise.resolve(), !(globalThis.navigator == null || globalThis.document == null) && (le.info(
|
|
14244
14257
|
`@webav version: 1.2.7, date: ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`
|
|
14245
|
-
),
|
|
14246
|
-
|
|
14258
|
+
), le.info(globalThis.navigator.userAgent), document.addEventListener("visibilitychange", () => {
|
|
14259
|
+
le.info(`visibilitychange: ${document.visibilityState}`);
|
|
14247
14260
|
}), "PressureObserver" in globalThis)) {
|
|
14248
14261
|
let l = "";
|
|
14249
14262
|
new PressureObserver((o) => {
|
|
14250
14263
|
const c = JSON.stringify(o.map((u) => u.state));
|
|
14251
|
-
c !== l && (
|
|
14264
|
+
c !== l && (le.info(`cpu state change: ${c}`), l = c);
|
|
14252
14265
|
}).observe("cpu");
|
|
14253
14266
|
}
|
|
14254
14267
|
})();
|
|
@@ -14733,7 +14746,7 @@ function en(l) {
|
|
|
14733
14746
|
}
|
|
14734
14747
|
class Ie {
|
|
14735
14748
|
#r = zn++;
|
|
14736
|
-
#d =
|
|
14749
|
+
#d = le.create(`MP4Clip id:${this.#r},`);
|
|
14737
14750
|
ready;
|
|
14738
14751
|
#n = !1;
|
|
14739
14752
|
#s = {
|
|
@@ -15105,15 +15118,15 @@ async function Uo(l, o = {}) {
|
|
|
15105
15118
|
t.mp4boxFile,
|
|
15106
15119
|
t.info
|
|
15107
15120
|
);
|
|
15108
|
-
if (u.video = r ?? null, u.audio = s ?? null, r == null && s == null &&
|
|
15121
|
+
if (u.video = r ?? null, u.audio = s ?? null, r == null && s == null && le.error("MP4Clip no video and audio track"), s != null) {
|
|
15109
15122
|
const { supported: f } = await AudioDecoder.isConfigSupported(s);
|
|
15110
|
-
f ||
|
|
15123
|
+
f || le.error(`MP4Clip audio codec is not supported: ${s.codec}`);
|
|
15111
15124
|
}
|
|
15112
15125
|
if (r != null) {
|
|
15113
15126
|
const { supported: f } = await VideoDecoder.isConfigSupported(r);
|
|
15114
|
-
f ||
|
|
15127
|
+
f || le.error(`MP4Clip video codec is not supported: ${r.codec}`);
|
|
15115
15128
|
}
|
|
15116
|
-
|
|
15129
|
+
le.info(
|
|
15117
15130
|
"mp4BoxFile moov ready",
|
|
15118
15131
|
{
|
|
15119
15132
|
...t.info,
|
|
@@ -15141,7 +15154,7 @@ async function Uo(l, o = {}) {
|
|
|
15141
15154
|
throw Error("MP4Clip stream is done, but not emit ready");
|
|
15142
15155
|
if (E == null)
|
|
15143
15156
|
throw Error("MP4Clip stream not contain any sample");
|
|
15144
|
-
return _n(_),
|
|
15157
|
+
return _n(_), le.info("mp4 stream parsed"), {
|
|
15145
15158
|
videoSamples: _,
|
|
15146
15159
|
audioSamples: h,
|
|
15147
15160
|
decoderConf: u,
|
|
@@ -15226,12 +15239,12 @@ class ul {
|
|
|
15226
15239
|
if (u) {
|
|
15227
15240
|
const _ = this.samples.slice(this.#i, c);
|
|
15228
15241
|
if (_[0]?.is_idr !== !0)
|
|
15229
|
-
|
|
15242
|
+
le.warn("First sample not idr frame");
|
|
15230
15243
|
else {
|
|
15231
15244
|
const h = performance.now(), g = await cl(_, this.localFileReader), n = performance.now() - h;
|
|
15232
15245
|
if (n > 1e3) {
|
|
15233
15246
|
const v = _[0], S = _.at(-1), y = S.offset + S.size - v.offset;
|
|
15234
|
-
|
|
15247
|
+
le.warn(
|
|
15235
15248
|
`Read video samples time cost: ${Math.round(n)}ms, file chunk size: ${y}`
|
|
15236
15249
|
);
|
|
15237
15250
|
}
|
|
@@ -15240,7 +15253,7 @@ class ul {
|
|
|
15240
15253
|
onDecodingError: (v) => {
|
|
15241
15254
|
if (this.#t)
|
|
15242
15255
|
throw v;
|
|
15243
|
-
this.#l === 0 && (this.#t = !0,
|
|
15256
|
+
this.#l === 0 && (this.#t = !0, le.warn("Downgrade to software decode"), this.#a());
|
|
15244
15257
|
}
|
|
15245
15258
|
}), this.#f += g.length;
|
|
15246
15259
|
}
|
|
@@ -15278,11 +15291,11 @@ class ul {
|
|
|
15278
15291
|
},
|
|
15279
15292
|
error: (u) => {
|
|
15280
15293
|
if (u.message.includes("Codec reclaimed due to inactivity")) {
|
|
15281
|
-
this.#r = null,
|
|
15294
|
+
this.#r = null, le.warn(u.message);
|
|
15282
15295
|
return;
|
|
15283
15296
|
}
|
|
15284
15297
|
const _ = `VideoFinder VideoDecoder err: ${u.message}, config: ${JSON.stringify(c)}, state: ${JSON.stringify(this.#_())}`;
|
|
15285
|
-
throw
|
|
15298
|
+
throw le.error(_), Error(_);
|
|
15286
15299
|
}
|
|
15287
15300
|
}), this.#r.configure(c);
|
|
15288
15301
|
};
|
|
@@ -15446,7 +15459,7 @@ function Dc(l, o, c) {
|
|
|
15446
15459
|
outputCnt: _
|
|
15447
15460
|
}
|
|
15448
15461
|
)}`;
|
|
15449
|
-
throw
|
|
15462
|
+
throw le.error(t), Error(t);
|
|
15450
15463
|
}
|
|
15451
15464
|
return {
|
|
15452
15465
|
decode(y) {
|
|
@@ -15618,9 +15631,9 @@ async function jc(l, o, c, u, _, h) {
|
|
|
15618
15631
|
let v = 0;
|
|
15619
15632
|
pn(S(), n, {
|
|
15620
15633
|
onDecodingError: (y) => {
|
|
15621
|
-
|
|
15634
|
+
le.warn("thumbnailsByKeyFrame", y), v === 0 ? pn(S(!0), n, {
|
|
15622
15635
|
onDecodingError: (E) => {
|
|
15623
|
-
g.close(),
|
|
15636
|
+
g.close(), le.error("thumbnailsByKeyFrame retry soft deocde", E);
|
|
15624
15637
|
}
|
|
15625
15638
|
}) : (h(null, !0), g.close());
|
|
15626
15639
|
}
|
|
@@ -15644,7 +15657,7 @@ async function jc(l, o, c, u, _, h) {
|
|
|
15644
15657
|
inputCnt: n.length
|
|
15645
15658
|
}
|
|
15646
15659
|
)}`;
|
|
15647
|
-
throw
|
|
15660
|
+
throw le.error(e), Error(e);
|
|
15648
15661
|
}
|
|
15649
15662
|
});
|
|
15650
15663
|
return u.addEventListener("abort", () => {
|