@resconet/qp-bridge 1.4.0 → 1.4.1-alpha.10
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/index.js +1 -1
- package/index.mjs +477 -480
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
var t =
|
|
1
|
+
var he = { exports: {} }, Ie;
|
|
2
|
+
function Je() {
|
|
3
|
+
if (Ie) return he.exports;
|
|
4
|
+
Ie = 1;
|
|
5
|
+
var t = he.exports = {}, e, s;
|
|
6
6
|
function n() {
|
|
7
7
|
throw new Error("setTimeout has not been defined");
|
|
8
8
|
}
|
|
@@ -72,12 +72,12 @@ function Xe() {
|
|
|
72
72
|
if (arguments.length > 1)
|
|
73
73
|
for (var z = 1; z < arguments.length; z++)
|
|
74
74
|
E[z - 1] = arguments[z];
|
|
75
|
-
o.push(new
|
|
75
|
+
o.push(new Ce(k, E)), o.length === 1 && !d && r(M);
|
|
76
76
|
};
|
|
77
|
-
function
|
|
77
|
+
function Ce(k, E) {
|
|
78
78
|
this.fun = k, this.array = E;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
Ce.prototype.run = function() {
|
|
81
81
|
this.fun.apply(null, this.array);
|
|
82
82
|
}, t.title = "browser", t.browser = !0, t.env = {}, t.argv = [], t.version = "", t.versions = {};
|
|
83
83
|
function Z() {
|
|
@@ -92,31 +92,28 @@ function Xe() {
|
|
|
92
92
|
throw new Error("process.chdir is not supported");
|
|
93
93
|
}, t.umask = function() {
|
|
94
94
|
return 0;
|
|
95
|
-
},
|
|
96
|
-
}
|
|
97
|
-
var Ke = Xe();
|
|
98
|
-
let ie;
|
|
99
|
-
const et = new Uint8Array(16);
|
|
100
|
-
function tt() {
|
|
101
|
-
if (!ie && (ie = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ie))
|
|
102
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
103
|
-
return ie(et);
|
|
95
|
+
}, he.exports;
|
|
104
96
|
}
|
|
97
|
+
var Ye = Je();
|
|
105
98
|
const R = [];
|
|
106
99
|
for (let t = 0; t < 256; ++t)
|
|
107
100
|
R.push((t + 256).toString(16).slice(1));
|
|
108
|
-
function
|
|
109
|
-
return R[t[e + 0]] + R[t[e + 1]] + R[t[e + 2]] + R[t[e + 3]] + "-" + R[t[e + 4]] + R[t[e + 5]] + "-" + R[t[e + 6]] + R[t[e + 7]] + "-" + R[t[e + 8]] + R[t[e + 9]] + "-" + R[t[e + 10]] + R[t[e + 11]] + R[t[e + 12]] + R[t[e + 13]] + R[t[e + 14]] + R[t[e + 15]];
|
|
101
|
+
function Xe(t, e = 0) {
|
|
102
|
+
return (R[t[e + 0]] + R[t[e + 1]] + R[t[e + 2]] + R[t[e + 3]] + "-" + R[t[e + 4]] + R[t[e + 5]] + "-" + R[t[e + 6]] + R[t[e + 7]] + "-" + R[t[e + 8]] + R[t[e + 9]] + "-" + R[t[e + 10]] + R[t[e + 11]] + R[t[e + 12]] + R[t[e + 13]] + R[t[e + 14]] + R[t[e + 15]]).toLowerCase();
|
|
110
103
|
}
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
104
|
+
const Ke = new Uint8Array(16);
|
|
105
|
+
function et() {
|
|
106
|
+
return crypto.getRandomValues(Ke);
|
|
107
|
+
}
|
|
108
|
+
function Be(t, e, s) {
|
|
109
|
+
return crypto.randomUUID ? crypto.randomUUID() : tt(t);
|
|
110
|
+
}
|
|
111
|
+
function tt(t, e, s) {
|
|
117
112
|
t = t || {};
|
|
118
|
-
const n = t.random
|
|
119
|
-
|
|
113
|
+
const n = t.random ?? t.rng?.() ?? et();
|
|
114
|
+
if (n.length < 16)
|
|
115
|
+
throw new Error("Random bytes length must be >= 16");
|
|
116
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Xe(n);
|
|
120
117
|
}
|
|
121
118
|
var v;
|
|
122
119
|
(function(t) {
|
|
@@ -155,14 +152,14 @@ var v;
|
|
|
155
152
|
}
|
|
156
153
|
t.joinValues = n, t.jsonStringifyReplacer = (a, r) => typeof r == "bigint" ? r.toString() : r;
|
|
157
154
|
})(v || (v = {}));
|
|
158
|
-
var
|
|
155
|
+
var Ee;
|
|
159
156
|
(function(t) {
|
|
160
157
|
t.mergeShapes = (e, s) => ({
|
|
161
158
|
...e,
|
|
162
159
|
...s
|
|
163
160
|
// second overwrites first
|
|
164
161
|
});
|
|
165
|
-
})(
|
|
162
|
+
})(Ee || (Ee = {}));
|
|
166
163
|
const f = v.arrayToEnum([
|
|
167
164
|
"string",
|
|
168
165
|
"nan",
|
|
@@ -287,7 +284,7 @@ class j extends Error {
|
|
|
287
284
|
}
|
|
288
285
|
}
|
|
289
286
|
j.create = (t) => new j(t);
|
|
290
|
-
const
|
|
287
|
+
const pe = (t, e) => {
|
|
291
288
|
let s;
|
|
292
289
|
switch (t.code) {
|
|
293
290
|
case c.invalid_type:
|
|
@@ -343,11 +340,11 @@ const ge = (t, e) => {
|
|
|
343
340
|
}
|
|
344
341
|
return { message: s };
|
|
345
342
|
};
|
|
346
|
-
let
|
|
347
|
-
function
|
|
348
|
-
return
|
|
343
|
+
let st = pe;
|
|
344
|
+
function nt() {
|
|
345
|
+
return st;
|
|
349
346
|
}
|
|
350
|
-
const
|
|
347
|
+
const at = (t) => {
|
|
351
348
|
const { data: e, path: s, errorMaps: n, issueData: a } = t, r = [...s, ...a.path || []], i = {
|
|
352
349
|
...a,
|
|
353
350
|
path: r
|
|
@@ -369,7 +366,7 @@ const it = (t) => {
|
|
|
369
366
|
};
|
|
370
367
|
};
|
|
371
368
|
function u(t, e) {
|
|
372
|
-
const s =
|
|
369
|
+
const s = nt(), n = at({
|
|
373
370
|
issueData: e,
|
|
374
371
|
data: t.data,
|
|
375
372
|
path: t.path,
|
|
@@ -380,7 +377,7 @@ function u(t, e) {
|
|
|
380
377
|
// then schema-bound map if available
|
|
381
378
|
s,
|
|
382
379
|
// then global override map
|
|
383
|
-
s ===
|
|
380
|
+
s === pe ? void 0 : pe
|
|
384
381
|
// then global default map
|
|
385
382
|
].filter((a) => !!a)
|
|
386
383
|
});
|
|
@@ -400,7 +397,7 @@ class T {
|
|
|
400
397
|
const n = [];
|
|
401
398
|
for (const a of s) {
|
|
402
399
|
if (a.status === "aborted")
|
|
403
|
-
return
|
|
400
|
+
return p;
|
|
404
401
|
a.status === "dirty" && e.dirty(), n.push(a.value);
|
|
405
402
|
}
|
|
406
403
|
return { status: e.value, value: n };
|
|
@@ -421,15 +418,15 @@ class T {
|
|
|
421
418
|
for (const a of s) {
|
|
422
419
|
const { key: r, value: i } = a;
|
|
423
420
|
if (r.status === "aborted" || i.status === "aborted")
|
|
424
|
-
return
|
|
421
|
+
return p;
|
|
425
422
|
r.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), r.value !== "__proto__" && (typeof i.value < "u" || a.alwaysSet) && (n[r.value] = i.value);
|
|
426
423
|
}
|
|
427
424
|
return { status: e.value, value: n };
|
|
428
425
|
}
|
|
429
426
|
}
|
|
430
|
-
const
|
|
427
|
+
const p = Object.freeze({
|
|
431
428
|
status: "aborted"
|
|
432
|
-
}), K = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }),
|
|
429
|
+
}), K = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), Ne = (t) => t.status === "aborted", Ae = (t) => t.status === "dirty", Q = (t) => t.status === "valid", ie = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
433
430
|
var h;
|
|
434
431
|
(function(t) {
|
|
435
432
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
@@ -442,7 +439,7 @@ class A {
|
|
|
442
439
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
443
440
|
}
|
|
444
441
|
}
|
|
445
|
-
const
|
|
442
|
+
const Oe = (t, e) => {
|
|
446
443
|
if (Q(e))
|
|
447
444
|
return { success: !0, data: e.value };
|
|
448
445
|
if (!t.common.issues.length)
|
|
@@ -500,7 +497,7 @@ class _ {
|
|
|
500
497
|
}
|
|
501
498
|
_parseSync(e) {
|
|
502
499
|
const s = this._parse(e);
|
|
503
|
-
if (
|
|
500
|
+
if (ie(s))
|
|
504
501
|
throw new Error("Synchronous parse encountered promise.");
|
|
505
502
|
return s;
|
|
506
503
|
}
|
|
@@ -527,7 +524,7 @@ class _ {
|
|
|
527
524
|
data: e,
|
|
528
525
|
parsedType: P(e)
|
|
529
526
|
}, a = this._parseSync({ data: e, path: n.path, parent: n });
|
|
530
|
-
return
|
|
527
|
+
return Oe(n, a);
|
|
531
528
|
}
|
|
532
529
|
"~validate"(e) {
|
|
533
530
|
const s = {
|
|
@@ -579,8 +576,8 @@ class _ {
|
|
|
579
576
|
parent: null,
|
|
580
577
|
data: e,
|
|
581
578
|
parsedType: P(e)
|
|
582
|
-
}, a = this._parse({ data: e, path: n.path, parent: n }), r = await (
|
|
583
|
-
return
|
|
579
|
+
}, a = this._parse({ data: e, path: n.path, parent: n }), r = await (ie(a) ? a : Promise.resolve(a));
|
|
580
|
+
return Oe(n, r);
|
|
584
581
|
}
|
|
585
582
|
refine(e, s) {
|
|
586
583
|
const n = (a) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(a) : s;
|
|
@@ -598,7 +595,7 @@ class _ {
|
|
|
598
595
|
_refinement(e) {
|
|
599
596
|
return new H({
|
|
600
597
|
schema: this,
|
|
601
|
-
typeName:
|
|
598
|
+
typeName: m.ZodEffects,
|
|
602
599
|
effect: { type: "refinement", refinement: e }
|
|
603
600
|
});
|
|
604
601
|
}
|
|
@@ -625,45 +622,45 @@ class _ {
|
|
|
625
622
|
return N.create(this);
|
|
626
623
|
}
|
|
627
624
|
promise() {
|
|
628
|
-
return
|
|
625
|
+
return le.create(this, this._def);
|
|
629
626
|
}
|
|
630
627
|
or(e) {
|
|
631
|
-
return
|
|
628
|
+
return ce.create([this, e], this._def);
|
|
632
629
|
}
|
|
633
630
|
and(e) {
|
|
634
|
-
return
|
|
631
|
+
return ue.create(this, e, this._def);
|
|
635
632
|
}
|
|
636
633
|
transform(e) {
|
|
637
634
|
return new H({
|
|
638
635
|
...g(this._def),
|
|
639
636
|
schema: this,
|
|
640
|
-
typeName:
|
|
637
|
+
typeName: m.ZodEffects,
|
|
641
638
|
effect: { type: "transform", transform: e }
|
|
642
639
|
});
|
|
643
640
|
}
|
|
644
641
|
default(e) {
|
|
645
642
|
const s = typeof e == "function" ? e : () => e;
|
|
646
|
-
return new
|
|
643
|
+
return new xe({
|
|
647
644
|
...g(this._def),
|
|
648
645
|
innerType: this,
|
|
649
646
|
defaultValue: s,
|
|
650
|
-
typeName:
|
|
647
|
+
typeName: m.ZodDefault
|
|
651
648
|
});
|
|
652
649
|
}
|
|
653
650
|
brand() {
|
|
654
|
-
return new
|
|
655
|
-
typeName:
|
|
651
|
+
return new Ct({
|
|
652
|
+
typeName: m.ZodBranded,
|
|
656
653
|
type: this,
|
|
657
654
|
...g(this._def)
|
|
658
655
|
});
|
|
659
656
|
}
|
|
660
657
|
catch(e) {
|
|
661
658
|
const s = typeof e == "function" ? e : () => e;
|
|
662
|
-
return new
|
|
659
|
+
return new be({
|
|
663
660
|
...g(this._def),
|
|
664
661
|
innerType: this,
|
|
665
662
|
catchValue: s,
|
|
666
|
-
typeName:
|
|
663
|
+
typeName: m.ZodCatch
|
|
667
664
|
});
|
|
668
665
|
}
|
|
669
666
|
describe(e) {
|
|
@@ -674,10 +671,10 @@ class _ {
|
|
|
674
671
|
});
|
|
675
672
|
}
|
|
676
673
|
pipe(e) {
|
|
677
|
-
return
|
|
674
|
+
return Se.create(this, e);
|
|
678
675
|
}
|
|
679
676
|
readonly() {
|
|
680
|
-
return
|
|
677
|
+
return ke.create(this);
|
|
681
678
|
}
|
|
682
679
|
isOptional() {
|
|
683
680
|
return this.safeParse(void 0).success;
|
|
@@ -686,28 +683,28 @@ class _ {
|
|
|
686
683
|
return this.safeParse(null).success;
|
|
687
684
|
}
|
|
688
685
|
}
|
|
689
|
-
const
|
|
686
|
+
const rt = /^c[^\s-]{8,}$/i, it = /^[0-9a-z]+$/, ot = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ct = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ut = /^[a-z0-9_-]{21}$/i, dt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, lt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ft = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ht = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
690
687
|
let me;
|
|
691
|
-
const
|
|
692
|
-
function
|
|
688
|
+
const mt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, pt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, gt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, yt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, _t = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, vt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ge = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", xt = new RegExp(`^${Ge}$`);
|
|
689
|
+
function ze(t) {
|
|
693
690
|
let e = "[0-5]\\d";
|
|
694
691
|
t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
695
692
|
const s = t.precision ? "+" : "?";
|
|
696
693
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`;
|
|
697
694
|
}
|
|
698
|
-
function
|
|
699
|
-
return new RegExp(`^${
|
|
695
|
+
function bt(t) {
|
|
696
|
+
return new RegExp(`^${ze(t)}$`);
|
|
700
697
|
}
|
|
701
|
-
function
|
|
702
|
-
let e = `${
|
|
698
|
+
function kt(t) {
|
|
699
|
+
let e = `${Ge}T${ze(t)}`;
|
|
703
700
|
const s = [];
|
|
704
701
|
return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
|
|
705
702
|
}
|
|
706
|
-
function
|
|
707
|
-
return !!((e === "v4" || !e) &&
|
|
703
|
+
function wt(t, e) {
|
|
704
|
+
return !!((e === "v4" || !e) && mt.test(t) || (e === "v6" || !e) && gt.test(t));
|
|
708
705
|
}
|
|
709
|
-
function
|
|
710
|
-
if (!
|
|
706
|
+
function St(t, e) {
|
|
707
|
+
if (!dt.test(t))
|
|
711
708
|
return !1;
|
|
712
709
|
try {
|
|
713
710
|
const [s] = t.split(".");
|
|
@@ -719,8 +716,8 @@ function Tt(t, e) {
|
|
|
719
716
|
return !1;
|
|
720
717
|
}
|
|
721
718
|
}
|
|
722
|
-
function
|
|
723
|
-
return !!((e === "v4" || !e) &&
|
|
719
|
+
function Rt(t, e) {
|
|
720
|
+
return !!((e === "v4" || !e) && pt.test(t) || (e === "v6" || !e) && yt.test(t));
|
|
724
721
|
}
|
|
725
722
|
class q extends _ {
|
|
726
723
|
_parse(e) {
|
|
@@ -730,7 +727,7 @@ class q extends _ {
|
|
|
730
727
|
code: c.invalid_type,
|
|
731
728
|
expected: f.string,
|
|
732
729
|
received: r.parsedType
|
|
733
|
-
}),
|
|
730
|
+
}), p;
|
|
734
731
|
}
|
|
735
732
|
const n = new T();
|
|
736
733
|
let a;
|
|
@@ -771,43 +768,43 @@ class q extends _ {
|
|
|
771
768
|
message: r.message
|
|
772
769
|
}), n.dirty());
|
|
773
770
|
} else if (r.kind === "email")
|
|
774
|
-
|
|
771
|
+
ft.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
775
772
|
validation: "email",
|
|
776
773
|
code: c.invalid_string,
|
|
777
774
|
message: r.message
|
|
778
775
|
}), n.dirty());
|
|
779
776
|
else if (r.kind === "emoji")
|
|
780
|
-
me || (me = new RegExp(
|
|
777
|
+
me || (me = new RegExp(ht, "u")), me.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
781
778
|
validation: "emoji",
|
|
782
779
|
code: c.invalid_string,
|
|
783
780
|
message: r.message
|
|
784
781
|
}), n.dirty());
|
|
785
782
|
else if (r.kind === "uuid")
|
|
786
|
-
|
|
783
|
+
ct.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
787
784
|
validation: "uuid",
|
|
788
785
|
code: c.invalid_string,
|
|
789
786
|
message: r.message
|
|
790
787
|
}), n.dirty());
|
|
791
788
|
else if (r.kind === "nanoid")
|
|
792
|
-
|
|
789
|
+
ut.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
793
790
|
validation: "nanoid",
|
|
794
791
|
code: c.invalid_string,
|
|
795
792
|
message: r.message
|
|
796
793
|
}), n.dirty());
|
|
797
794
|
else if (r.kind === "cuid")
|
|
798
|
-
|
|
795
|
+
rt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
799
796
|
validation: "cuid",
|
|
800
797
|
code: c.invalid_string,
|
|
801
798
|
message: r.message
|
|
802
799
|
}), n.dirty());
|
|
803
800
|
else if (r.kind === "cuid2")
|
|
804
|
-
|
|
801
|
+
it.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
805
802
|
validation: "cuid2",
|
|
806
803
|
code: c.invalid_string,
|
|
807
804
|
message: r.message
|
|
808
805
|
}), n.dirty());
|
|
809
806
|
else if (r.kind === "ulid")
|
|
810
|
-
|
|
807
|
+
ot.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
811
808
|
validation: "ulid",
|
|
812
809
|
code: c.invalid_string,
|
|
813
810
|
message: r.message
|
|
@@ -838,39 +835,39 @@ class q extends _ {
|
|
|
838
835
|
code: c.invalid_string,
|
|
839
836
|
validation: { endsWith: r.value },
|
|
840
837
|
message: r.message
|
|
841
|
-
}), n.dirty()) : r.kind === "datetime" ?
|
|
838
|
+
}), n.dirty()) : r.kind === "datetime" ? kt(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
842
839
|
code: c.invalid_string,
|
|
843
840
|
validation: "datetime",
|
|
844
841
|
message: r.message
|
|
845
|
-
}), n.dirty()) : r.kind === "date" ?
|
|
842
|
+
}), n.dirty()) : r.kind === "date" ? xt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
846
843
|
code: c.invalid_string,
|
|
847
844
|
validation: "date",
|
|
848
845
|
message: r.message
|
|
849
|
-
}), n.dirty()) : r.kind === "time" ?
|
|
846
|
+
}), n.dirty()) : r.kind === "time" ? bt(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
850
847
|
code: c.invalid_string,
|
|
851
848
|
validation: "time",
|
|
852
849
|
message: r.message
|
|
853
|
-
}), n.dirty()) : r.kind === "duration" ?
|
|
850
|
+
}), n.dirty()) : r.kind === "duration" ? lt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
854
851
|
validation: "duration",
|
|
855
852
|
code: c.invalid_string,
|
|
856
853
|
message: r.message
|
|
857
|
-
}), n.dirty()) : r.kind === "ip" ?
|
|
854
|
+
}), n.dirty()) : r.kind === "ip" ? wt(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
858
855
|
validation: "ip",
|
|
859
856
|
code: c.invalid_string,
|
|
860
857
|
message: r.message
|
|
861
|
-
}), n.dirty()) : r.kind === "jwt" ?
|
|
858
|
+
}), n.dirty()) : r.kind === "jwt" ? St(e.data, r.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
862
859
|
validation: "jwt",
|
|
863
860
|
code: c.invalid_string,
|
|
864
861
|
message: r.message
|
|
865
|
-
}), n.dirty()) : r.kind === "cidr" ?
|
|
862
|
+
}), n.dirty()) : r.kind === "cidr" ? Rt(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
866
863
|
validation: "cidr",
|
|
867
864
|
code: c.invalid_string,
|
|
868
865
|
message: r.message
|
|
869
|
-
}), n.dirty()) : r.kind === "base64" ?
|
|
866
|
+
}), n.dirty()) : r.kind === "base64" ? _t.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
870
867
|
validation: "base64",
|
|
871
868
|
code: c.invalid_string,
|
|
872
869
|
message: r.message
|
|
873
|
-
}), n.dirty()) : r.kind === "base64url" ?
|
|
870
|
+
}), n.dirty()) : r.kind === "base64url" ? vt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
874
871
|
validation: "base64url",
|
|
875
872
|
code: c.invalid_string,
|
|
876
873
|
message: r.message
|
|
@@ -1101,11 +1098,11 @@ class q extends _ {
|
|
|
1101
1098
|
}
|
|
1102
1099
|
q.create = (t) => new q({
|
|
1103
1100
|
checks: [],
|
|
1104
|
-
typeName:
|
|
1101
|
+
typeName: m.ZodString,
|
|
1105
1102
|
coerce: t?.coerce ?? !1,
|
|
1106
1103
|
...g(t)
|
|
1107
1104
|
});
|
|
1108
|
-
function
|
|
1105
|
+
function Tt(t, e) {
|
|
1109
1106
|
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, a = s > n ? s : n, r = Number.parseInt(t.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
|
|
1110
1107
|
return r % i / 10 ** a;
|
|
1111
1108
|
}
|
|
@@ -1120,7 +1117,7 @@ class F extends _ {
|
|
|
1120
1117
|
code: c.invalid_type,
|
|
1121
1118
|
expected: f.number,
|
|
1122
1119
|
received: r.parsedType
|
|
1123
|
-
}),
|
|
1120
|
+
}), p;
|
|
1124
1121
|
}
|
|
1125
1122
|
let n;
|
|
1126
1123
|
const a = new T();
|
|
@@ -1144,7 +1141,7 @@ class F extends _ {
|
|
|
1144
1141
|
inclusive: r.inclusive,
|
|
1145
1142
|
exact: !1,
|
|
1146
1143
|
message: r.message
|
|
1147
|
-
}), a.dirty()) : r.kind === "multipleOf" ?
|
|
1144
|
+
}), a.dirty()) : r.kind === "multipleOf" ? Tt(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1148
1145
|
code: c.not_multiple_of,
|
|
1149
1146
|
multipleOf: r.value,
|
|
1150
1147
|
message: r.message
|
|
@@ -1277,7 +1274,7 @@ class F extends _ {
|
|
|
1277
1274
|
}
|
|
1278
1275
|
F.create = (t) => new F({
|
|
1279
1276
|
checks: [],
|
|
1280
|
-
typeName:
|
|
1277
|
+
typeName: m.ZodNumber,
|
|
1281
1278
|
coerce: t?.coerce || !1,
|
|
1282
1279
|
...g(t)
|
|
1283
1280
|
});
|
|
@@ -1322,7 +1319,7 @@ class ne extends _ {
|
|
|
1322
1319
|
code: c.invalid_type,
|
|
1323
1320
|
expected: f.bigint,
|
|
1324
1321
|
received: s.parsedType
|
|
1325
|
-
}),
|
|
1322
|
+
}), p;
|
|
1326
1323
|
}
|
|
1327
1324
|
gte(e, s) {
|
|
1328
1325
|
return this.setLimit("min", e, !0, h.toString(s));
|
|
@@ -1410,11 +1407,11 @@ class ne extends _ {
|
|
|
1410
1407
|
}
|
|
1411
1408
|
ne.create = (t) => new ne({
|
|
1412
1409
|
checks: [],
|
|
1413
|
-
typeName:
|
|
1410
|
+
typeName: m.ZodBigInt,
|
|
1414
1411
|
coerce: t?.coerce ?? !1,
|
|
1415
1412
|
...g(t)
|
|
1416
1413
|
});
|
|
1417
|
-
class
|
|
1414
|
+
class ge extends _ {
|
|
1418
1415
|
_parse(e) {
|
|
1419
1416
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1420
1417
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1422,17 +1419,17 @@ class ye extends _ {
|
|
|
1422
1419
|
code: c.invalid_type,
|
|
1423
1420
|
expected: f.boolean,
|
|
1424
1421
|
received: n.parsedType
|
|
1425
|
-
}),
|
|
1422
|
+
}), p;
|
|
1426
1423
|
}
|
|
1427
1424
|
return I(e.data);
|
|
1428
1425
|
}
|
|
1429
1426
|
}
|
|
1430
|
-
|
|
1431
|
-
typeName:
|
|
1427
|
+
ge.create = (t) => new ge({
|
|
1428
|
+
typeName: m.ZodBoolean,
|
|
1432
1429
|
coerce: t?.coerce || !1,
|
|
1433
1430
|
...g(t)
|
|
1434
1431
|
});
|
|
1435
|
-
class
|
|
1432
|
+
class oe extends _ {
|
|
1436
1433
|
_parse(e) {
|
|
1437
1434
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1438
1435
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1440,13 +1437,13 @@ class ce extends _ {
|
|
|
1440
1437
|
code: c.invalid_type,
|
|
1441
1438
|
expected: f.date,
|
|
1442
1439
|
received: r.parsedType
|
|
1443
|
-
}),
|
|
1440
|
+
}), p;
|
|
1444
1441
|
}
|
|
1445
1442
|
if (Number.isNaN(e.data.getTime())) {
|
|
1446
1443
|
const r = this._getOrReturnCtx(e);
|
|
1447
1444
|
return u(r, {
|
|
1448
1445
|
code: c.invalid_date
|
|
1449
|
-
}),
|
|
1446
|
+
}), p;
|
|
1450
1447
|
}
|
|
1451
1448
|
const n = new T();
|
|
1452
1449
|
let a;
|
|
@@ -1472,7 +1469,7 @@ class ce extends _ {
|
|
|
1472
1469
|
};
|
|
1473
1470
|
}
|
|
1474
1471
|
_addCheck(e) {
|
|
1475
|
-
return new
|
|
1472
|
+
return new oe({
|
|
1476
1473
|
...this._def,
|
|
1477
1474
|
checks: [...this._def.checks, e]
|
|
1478
1475
|
});
|
|
@@ -1504,13 +1501,13 @@ class ce extends _ {
|
|
|
1504
1501
|
return e != null ? new Date(e) : null;
|
|
1505
1502
|
}
|
|
1506
1503
|
}
|
|
1507
|
-
|
|
1504
|
+
oe.create = (t) => new oe({
|
|
1508
1505
|
checks: [],
|
|
1509
1506
|
coerce: t?.coerce || !1,
|
|
1510
|
-
typeName:
|
|
1507
|
+
typeName: m.ZodDate,
|
|
1511
1508
|
...g(t)
|
|
1512
1509
|
});
|
|
1513
|
-
class
|
|
1510
|
+
class Me extends _ {
|
|
1514
1511
|
_parse(e) {
|
|
1515
1512
|
if (this._getType(e) !== f.symbol) {
|
|
1516
1513
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1518,16 +1515,16 @@ class qe extends _ {
|
|
|
1518
1515
|
code: c.invalid_type,
|
|
1519
1516
|
expected: f.symbol,
|
|
1520
1517
|
received: n.parsedType
|
|
1521
|
-
}),
|
|
1518
|
+
}), p;
|
|
1522
1519
|
}
|
|
1523
1520
|
return I(e.data);
|
|
1524
1521
|
}
|
|
1525
1522
|
}
|
|
1526
|
-
|
|
1527
|
-
typeName:
|
|
1523
|
+
Me.create = (t) => new Me({
|
|
1524
|
+
typeName: m.ZodSymbol,
|
|
1528
1525
|
...g(t)
|
|
1529
1526
|
});
|
|
1530
|
-
class
|
|
1527
|
+
class Ze extends _ {
|
|
1531
1528
|
_parse(e) {
|
|
1532
1529
|
if (this._getType(e) !== f.undefined) {
|
|
1533
1530
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1535,16 +1532,16 @@ class je extends _ {
|
|
|
1535
1532
|
code: c.invalid_type,
|
|
1536
1533
|
expected: f.undefined,
|
|
1537
1534
|
received: n.parsedType
|
|
1538
|
-
}),
|
|
1535
|
+
}), p;
|
|
1539
1536
|
}
|
|
1540
1537
|
return I(e.data);
|
|
1541
1538
|
}
|
|
1542
1539
|
}
|
|
1543
|
-
|
|
1544
|
-
typeName:
|
|
1540
|
+
Ze.create = (t) => new Ze({
|
|
1541
|
+
typeName: m.ZodUndefined,
|
|
1545
1542
|
...g(t)
|
|
1546
1543
|
});
|
|
1547
|
-
class
|
|
1544
|
+
class qe extends _ {
|
|
1548
1545
|
_parse(e) {
|
|
1549
1546
|
if (this._getType(e) !== f.null) {
|
|
1550
1547
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1552,16 +1549,16 @@ class Pe extends _ {
|
|
|
1552
1549
|
code: c.invalid_type,
|
|
1553
1550
|
expected: f.null,
|
|
1554
1551
|
received: n.parsedType
|
|
1555
|
-
}),
|
|
1552
|
+
}), p;
|
|
1556
1553
|
}
|
|
1557
1554
|
return I(e.data);
|
|
1558
1555
|
}
|
|
1559
1556
|
}
|
|
1560
|
-
|
|
1561
|
-
typeName:
|
|
1557
|
+
qe.create = (t) => new qe({
|
|
1558
|
+
typeName: m.ZodNull,
|
|
1562
1559
|
...g(t)
|
|
1563
1560
|
});
|
|
1564
|
-
class
|
|
1561
|
+
class je extends _ {
|
|
1565
1562
|
constructor() {
|
|
1566
1563
|
super(...arguments), this._any = !0;
|
|
1567
1564
|
}
|
|
@@ -1569,11 +1566,11 @@ class Le extends _ {
|
|
|
1569
1566
|
return I(e.data);
|
|
1570
1567
|
}
|
|
1571
1568
|
}
|
|
1572
|
-
|
|
1573
|
-
typeName:
|
|
1569
|
+
je.create = (t) => new je({
|
|
1570
|
+
typeName: m.ZodAny,
|
|
1574
1571
|
...g(t)
|
|
1575
1572
|
});
|
|
1576
|
-
class
|
|
1573
|
+
class ye extends _ {
|
|
1577
1574
|
constructor() {
|
|
1578
1575
|
super(...arguments), this._unknown = !0;
|
|
1579
1576
|
}
|
|
@@ -1581,8 +1578,8 @@ class _e extends _ {
|
|
|
1581
1578
|
return I(e.data);
|
|
1582
1579
|
}
|
|
1583
1580
|
}
|
|
1584
|
-
|
|
1585
|
-
typeName:
|
|
1581
|
+
ye.create = (t) => new ye({
|
|
1582
|
+
typeName: m.ZodUnknown,
|
|
1586
1583
|
...g(t)
|
|
1587
1584
|
});
|
|
1588
1585
|
class $ extends _ {
|
|
@@ -1592,14 +1589,14 @@ class $ extends _ {
|
|
|
1592
1589
|
code: c.invalid_type,
|
|
1593
1590
|
expected: f.never,
|
|
1594
1591
|
received: s.parsedType
|
|
1595
|
-
}),
|
|
1592
|
+
}), p;
|
|
1596
1593
|
}
|
|
1597
1594
|
}
|
|
1598
1595
|
$.create = (t) => new $({
|
|
1599
|
-
typeName:
|
|
1596
|
+
typeName: m.ZodNever,
|
|
1600
1597
|
...g(t)
|
|
1601
1598
|
});
|
|
1602
|
-
class
|
|
1599
|
+
class Pe extends _ {
|
|
1603
1600
|
_parse(e) {
|
|
1604
1601
|
if (this._getType(e) !== f.undefined) {
|
|
1605
1602
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1607,13 +1604,13 @@ class $e extends _ {
|
|
|
1607
1604
|
code: c.invalid_type,
|
|
1608
1605
|
expected: f.void,
|
|
1609
1606
|
received: n.parsedType
|
|
1610
|
-
}),
|
|
1607
|
+
}), p;
|
|
1611
1608
|
}
|
|
1612
1609
|
return I(e.data);
|
|
1613
1610
|
}
|
|
1614
1611
|
}
|
|
1615
|
-
|
|
1616
|
-
typeName:
|
|
1612
|
+
Pe.create = (t) => new Pe({
|
|
1613
|
+
typeName: m.ZodVoid,
|
|
1617
1614
|
...g(t)
|
|
1618
1615
|
});
|
|
1619
1616
|
class N extends _ {
|
|
@@ -1624,7 +1621,7 @@ class N extends _ {
|
|
|
1624
1621
|
code: c.invalid_type,
|
|
1625
1622
|
expected: f.array,
|
|
1626
1623
|
received: s.parsedType
|
|
1627
|
-
}),
|
|
1624
|
+
}), p;
|
|
1628
1625
|
if (a.exactLength !== null) {
|
|
1629
1626
|
const i = s.data.length > a.exactLength.value, o = s.data.length < a.exactLength.value;
|
|
1630
1627
|
(i || o) && (u(s, {
|
|
@@ -1686,7 +1683,7 @@ N.create = (t, e) => new N({
|
|
|
1686
1683
|
minLength: null,
|
|
1687
1684
|
maxLength: null,
|
|
1688
1685
|
exactLength: null,
|
|
1689
|
-
typeName:
|
|
1686
|
+
typeName: m.ZodArray,
|
|
1690
1687
|
...g(e)
|
|
1691
1688
|
});
|
|
1692
1689
|
function D(t) {
|
|
@@ -1722,7 +1719,7 @@ class w extends _ {
|
|
|
1722
1719
|
code: c.invalid_type,
|
|
1723
1720
|
expected: f.object,
|
|
1724
1721
|
received: l.parsedType
|
|
1725
|
-
}),
|
|
1722
|
+
}), p;
|
|
1726
1723
|
}
|
|
1727
1724
|
const { status: n, ctx: a } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), o = [];
|
|
1728
1725
|
if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
|
|
@@ -1848,7 +1845,7 @@ class w extends _ {
|
|
|
1848
1845
|
...this._def.shape(),
|
|
1849
1846
|
...e._def.shape()
|
|
1850
1847
|
}),
|
|
1851
|
-
typeName:
|
|
1848
|
+
typeName: m.ZodObject
|
|
1852
1849
|
});
|
|
1853
1850
|
}
|
|
1854
1851
|
// merge<
|
|
@@ -1968,31 +1965,31 @@ class w extends _ {
|
|
|
1968
1965
|
});
|
|
1969
1966
|
}
|
|
1970
1967
|
keyof() {
|
|
1971
|
-
return
|
|
1968
|
+
return De(v.objectKeys(this.shape));
|
|
1972
1969
|
}
|
|
1973
1970
|
}
|
|
1974
1971
|
w.create = (t, e) => new w({
|
|
1975
1972
|
shape: () => t,
|
|
1976
1973
|
unknownKeys: "strip",
|
|
1977
1974
|
catchall: $.create(),
|
|
1978
|
-
typeName:
|
|
1975
|
+
typeName: m.ZodObject,
|
|
1979
1976
|
...g(e)
|
|
1980
1977
|
});
|
|
1981
1978
|
w.strictCreate = (t, e) => new w({
|
|
1982
1979
|
shape: () => t,
|
|
1983
1980
|
unknownKeys: "strict",
|
|
1984
1981
|
catchall: $.create(),
|
|
1985
|
-
typeName:
|
|
1982
|
+
typeName: m.ZodObject,
|
|
1986
1983
|
...g(e)
|
|
1987
1984
|
});
|
|
1988
1985
|
w.lazycreate = (t, e) => new w({
|
|
1989
1986
|
shape: t,
|
|
1990
1987
|
unknownKeys: "strip",
|
|
1991
1988
|
catchall: $.create(),
|
|
1992
|
-
typeName:
|
|
1989
|
+
typeName: m.ZodObject,
|
|
1993
1990
|
...g(e)
|
|
1994
1991
|
});
|
|
1995
|
-
class
|
|
1992
|
+
class ce extends _ {
|
|
1996
1993
|
_parse(e) {
|
|
1997
1994
|
const { ctx: s } = this._processInputParams(e), n = this._def.options;
|
|
1998
1995
|
function a(r) {
|
|
@@ -2006,7 +2003,7 @@ class ue extends _ {
|
|
|
2006
2003
|
return u(s, {
|
|
2007
2004
|
code: c.invalid_union,
|
|
2008
2005
|
unionErrors: i
|
|
2009
|
-
}),
|
|
2006
|
+
}), p;
|
|
2010
2007
|
}
|
|
2011
2008
|
if (s.common.async)
|
|
2012
2009
|
return Promise.all(n.map(async (r) => {
|
|
@@ -2053,26 +2050,26 @@ class ue extends _ {
|
|
|
2053
2050
|
return u(s, {
|
|
2054
2051
|
code: c.invalid_union,
|
|
2055
2052
|
unionErrors: o
|
|
2056
|
-
}),
|
|
2053
|
+
}), p;
|
|
2057
2054
|
}
|
|
2058
2055
|
}
|
|
2059
2056
|
get options() {
|
|
2060
2057
|
return this._def.options;
|
|
2061
2058
|
}
|
|
2062
2059
|
}
|
|
2063
|
-
|
|
2060
|
+
ce.create = (t, e) => new ce({
|
|
2064
2061
|
options: t,
|
|
2065
|
-
typeName:
|
|
2062
|
+
typeName: m.ZodUnion,
|
|
2066
2063
|
...g(e)
|
|
2067
2064
|
});
|
|
2068
|
-
function
|
|
2065
|
+
function _e(t, e) {
|
|
2069
2066
|
const s = P(t), n = P(e);
|
|
2070
2067
|
if (t === e)
|
|
2071
2068
|
return { valid: !0, data: t };
|
|
2072
2069
|
if (s === f.object && n === f.object) {
|
|
2073
2070
|
const a = v.objectKeys(e), r = v.objectKeys(t).filter((o) => a.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2074
2071
|
for (const o of r) {
|
|
2075
|
-
const d =
|
|
2072
|
+
const d = _e(t[o], e[o]);
|
|
2076
2073
|
if (!d.valid)
|
|
2077
2074
|
return { valid: !1 };
|
|
2078
2075
|
i[o] = d.data;
|
|
@@ -2083,7 +2080,7 @@ function ve(t, e) {
|
|
|
2083
2080
|
return { valid: !1 };
|
|
2084
2081
|
const a = [];
|
|
2085
2082
|
for (let r = 0; r < t.length; r++) {
|
|
2086
|
-
const i = t[r], o = e[r], d =
|
|
2083
|
+
const i = t[r], o = e[r], d = _e(i, o);
|
|
2087
2084
|
if (!d.valid)
|
|
2088
2085
|
return { valid: !1 };
|
|
2089
2086
|
a.push(d.data);
|
|
@@ -2091,15 +2088,15 @@ function ve(t, e) {
|
|
|
2091
2088
|
return { valid: !0, data: a };
|
|
2092
2089
|
} else return s === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2093
2090
|
}
|
|
2094
|
-
class
|
|
2091
|
+
class ue extends _ {
|
|
2095
2092
|
_parse(e) {
|
|
2096
2093
|
const { status: s, ctx: n } = this._processInputParams(e), a = (r, i) => {
|
|
2097
|
-
if (
|
|
2098
|
-
return
|
|
2099
|
-
const o =
|
|
2100
|
-
return o.valid ? ((
|
|
2094
|
+
if (Ne(r) || Ne(i))
|
|
2095
|
+
return p;
|
|
2096
|
+
const o = _e(r.value, i.value);
|
|
2097
|
+
return o.valid ? ((Ae(r) || Ae(i)) && s.dirty(), { status: s.value, value: o.data }) : (u(n, {
|
|
2101
2098
|
code: c.invalid_intersection_types
|
|
2102
|
-
}),
|
|
2099
|
+
}), p);
|
|
2103
2100
|
};
|
|
2104
2101
|
return n.common.async ? Promise.all([
|
|
2105
2102
|
this._def.left._parseAsync({
|
|
@@ -2123,10 +2120,10 @@ class de extends _ {
|
|
|
2123
2120
|
}));
|
|
2124
2121
|
}
|
|
2125
2122
|
}
|
|
2126
|
-
|
|
2123
|
+
ue.create = (t, e, s) => new ue({
|
|
2127
2124
|
left: t,
|
|
2128
2125
|
right: e,
|
|
2129
|
-
typeName:
|
|
2126
|
+
typeName: m.ZodIntersection,
|
|
2130
2127
|
...g(s)
|
|
2131
2128
|
});
|
|
2132
2129
|
class U extends _ {
|
|
@@ -2137,7 +2134,7 @@ class U extends _ {
|
|
|
2137
2134
|
code: c.invalid_type,
|
|
2138
2135
|
expected: f.array,
|
|
2139
2136
|
received: n.parsedType
|
|
2140
|
-
}),
|
|
2137
|
+
}), p;
|
|
2141
2138
|
if (n.data.length < this._def.items.length)
|
|
2142
2139
|
return u(n, {
|
|
2143
2140
|
code: c.too_small,
|
|
@@ -2145,7 +2142,7 @@ class U extends _ {
|
|
|
2145
2142
|
inclusive: !0,
|
|
2146
2143
|
exact: !1,
|
|
2147
2144
|
type: "array"
|
|
2148
|
-
}),
|
|
2145
|
+
}), p;
|
|
2149
2146
|
!this._def.rest && n.data.length > this._def.items.length && (u(n, {
|
|
2150
2147
|
code: c.too_big,
|
|
2151
2148
|
maximum: this._def.items.length,
|
|
@@ -2174,12 +2171,12 @@ U.create = (t, e) => {
|
|
|
2174
2171
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2175
2172
|
return new U({
|
|
2176
2173
|
items: t,
|
|
2177
|
-
typeName:
|
|
2174
|
+
typeName: m.ZodTuple,
|
|
2178
2175
|
rest: null,
|
|
2179
2176
|
...g(e)
|
|
2180
2177
|
});
|
|
2181
2178
|
};
|
|
2182
|
-
class
|
|
2179
|
+
class de extends _ {
|
|
2183
2180
|
get keySchema() {
|
|
2184
2181
|
return this._def.keyType;
|
|
2185
2182
|
}
|
|
@@ -2193,7 +2190,7 @@ class le extends _ {
|
|
|
2193
2190
|
code: c.invalid_type,
|
|
2194
2191
|
expected: f.object,
|
|
2195
2192
|
received: n.parsedType
|
|
2196
|
-
}),
|
|
2193
|
+
}), p;
|
|
2197
2194
|
const a = [], r = this._def.keyType, i = this._def.valueType;
|
|
2198
2195
|
for (const o in n.data)
|
|
2199
2196
|
a.push({
|
|
@@ -2207,20 +2204,20 @@ class le extends _ {
|
|
|
2207
2204
|
return this._def.valueType;
|
|
2208
2205
|
}
|
|
2209
2206
|
static create(e, s, n) {
|
|
2210
|
-
return s instanceof _ ? new
|
|
2207
|
+
return s instanceof _ ? new de({
|
|
2211
2208
|
keyType: e,
|
|
2212
2209
|
valueType: s,
|
|
2213
|
-
typeName:
|
|
2210
|
+
typeName: m.ZodRecord,
|
|
2214
2211
|
...g(n)
|
|
2215
|
-
}) : new
|
|
2212
|
+
}) : new de({
|
|
2216
2213
|
keyType: q.create(),
|
|
2217
2214
|
valueType: e,
|
|
2218
|
-
typeName:
|
|
2215
|
+
typeName: m.ZodRecord,
|
|
2219
2216
|
...g(s)
|
|
2220
2217
|
});
|
|
2221
2218
|
}
|
|
2222
2219
|
}
|
|
2223
|
-
class
|
|
2220
|
+
class Le extends _ {
|
|
2224
2221
|
get keySchema() {
|
|
2225
2222
|
return this._def.keyType;
|
|
2226
2223
|
}
|
|
@@ -2234,7 +2231,7 @@ class Ve extends _ {
|
|
|
2234
2231
|
code: c.invalid_type,
|
|
2235
2232
|
expected: f.map,
|
|
2236
2233
|
received: n.parsedType
|
|
2237
|
-
}),
|
|
2234
|
+
}), p;
|
|
2238
2235
|
const a = this._def.keyType, r = this._def.valueType, i = [...n.data.entries()].map(([o, d], l) => ({
|
|
2239
2236
|
key: a._parse(new A(n, o, n.path, [l, "key"])),
|
|
2240
2237
|
value: r._parse(new A(n, d, n.path, [l, "value"]))
|
|
@@ -2245,7 +2242,7 @@ class Ve extends _ {
|
|
|
2245
2242
|
for (const d of i) {
|
|
2246
2243
|
const l = await d.key, y = await d.value;
|
|
2247
2244
|
if (l.status === "aborted" || y.status === "aborted")
|
|
2248
|
-
return
|
|
2245
|
+
return p;
|
|
2249
2246
|
(l.status === "dirty" || y.status === "dirty") && s.dirty(), o.set(l.value, y.value);
|
|
2250
2247
|
}
|
|
2251
2248
|
return { status: s.value, value: o };
|
|
@@ -2255,17 +2252,17 @@ class Ve extends _ {
|
|
|
2255
2252
|
for (const d of i) {
|
|
2256
2253
|
const l = d.key, y = d.value;
|
|
2257
2254
|
if (l.status === "aborted" || y.status === "aborted")
|
|
2258
|
-
return
|
|
2255
|
+
return p;
|
|
2259
2256
|
(l.status === "dirty" || y.status === "dirty") && s.dirty(), o.set(l.value, y.value);
|
|
2260
2257
|
}
|
|
2261
2258
|
return { status: s.value, value: o };
|
|
2262
2259
|
}
|
|
2263
2260
|
}
|
|
2264
2261
|
}
|
|
2265
|
-
|
|
2262
|
+
Le.create = (t, e, s) => new Le({
|
|
2266
2263
|
valueType: e,
|
|
2267
2264
|
keyType: t,
|
|
2268
|
-
typeName:
|
|
2265
|
+
typeName: m.ZodMap,
|
|
2269
2266
|
...g(s)
|
|
2270
2267
|
});
|
|
2271
2268
|
class ae extends _ {
|
|
@@ -2276,7 +2273,7 @@ class ae extends _ {
|
|
|
2276
2273
|
code: c.invalid_type,
|
|
2277
2274
|
expected: f.set,
|
|
2278
2275
|
received: n.parsedType
|
|
2279
|
-
}),
|
|
2276
|
+
}), p;
|
|
2280
2277
|
const a = this._def;
|
|
2281
2278
|
a.minSize !== null && n.data.size < a.minSize.value && (u(n, {
|
|
2282
2279
|
code: c.too_small,
|
|
@@ -2298,7 +2295,7 @@ class ae extends _ {
|
|
|
2298
2295
|
const l = /* @__PURE__ */ new Set();
|
|
2299
2296
|
for (const y of d) {
|
|
2300
2297
|
if (y.status === "aborted")
|
|
2301
|
-
return
|
|
2298
|
+
return p;
|
|
2302
2299
|
y.status === "dirty" && s.dirty(), l.add(y.value);
|
|
2303
2300
|
}
|
|
2304
2301
|
return { status: s.value, value: l };
|
|
@@ -2329,10 +2326,10 @@ ae.create = (t, e) => new ae({
|
|
|
2329
2326
|
valueType: t,
|
|
2330
2327
|
minSize: null,
|
|
2331
2328
|
maxSize: null,
|
|
2332
|
-
typeName:
|
|
2329
|
+
typeName: m.ZodSet,
|
|
2333
2330
|
...g(e)
|
|
2334
2331
|
});
|
|
2335
|
-
class
|
|
2332
|
+
class $e extends _ {
|
|
2336
2333
|
get schema() {
|
|
2337
2334
|
return this._def.getter();
|
|
2338
2335
|
}
|
|
@@ -2341,12 +2338,12 @@ class Ue extends _ {
|
|
|
2341
2338
|
return this._def.getter()._parse({ data: s.data, path: s.path, parent: s });
|
|
2342
2339
|
}
|
|
2343
2340
|
}
|
|
2344
|
-
|
|
2341
|
+
$e.create = (t, e) => new $e({
|
|
2345
2342
|
getter: t,
|
|
2346
|
-
typeName:
|
|
2343
|
+
typeName: m.ZodLazy,
|
|
2347
2344
|
...g(e)
|
|
2348
2345
|
});
|
|
2349
|
-
class
|
|
2346
|
+
class ve extends _ {
|
|
2350
2347
|
_parse(e) {
|
|
2351
2348
|
if (e.data !== this._def.value) {
|
|
2352
2349
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2354,7 +2351,7 @@ class xe extends _ {
|
|
|
2354
2351
|
received: s.data,
|
|
2355
2352
|
code: c.invalid_literal,
|
|
2356
2353
|
expected: this._def.value
|
|
2357
|
-
}),
|
|
2354
|
+
}), p;
|
|
2358
2355
|
}
|
|
2359
2356
|
return { status: "valid", value: e.data };
|
|
2360
2357
|
}
|
|
@@ -2362,15 +2359,15 @@ class xe extends _ {
|
|
|
2362
2359
|
return this._def.value;
|
|
2363
2360
|
}
|
|
2364
2361
|
}
|
|
2365
|
-
|
|
2362
|
+
ve.create = (t, e) => new ve({
|
|
2366
2363
|
value: t,
|
|
2367
|
-
typeName:
|
|
2364
|
+
typeName: m.ZodLiteral,
|
|
2368
2365
|
...g(e)
|
|
2369
2366
|
});
|
|
2370
|
-
function
|
|
2367
|
+
function De(t, e) {
|
|
2371
2368
|
return new W({
|
|
2372
2369
|
values: t,
|
|
2373
|
-
typeName:
|
|
2370
|
+
typeName: m.ZodEnum,
|
|
2374
2371
|
...g(e)
|
|
2375
2372
|
});
|
|
2376
2373
|
}
|
|
@@ -2382,7 +2379,7 @@ class W extends _ {
|
|
|
2382
2379
|
expected: v.joinValues(n),
|
|
2383
2380
|
received: s.parsedType,
|
|
2384
2381
|
code: c.invalid_type
|
|
2385
|
-
}),
|
|
2382
|
+
}), p;
|
|
2386
2383
|
}
|
|
2387
2384
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
2388
2385
|
const s = this._getOrReturnCtx(e), n = this._def.values;
|
|
@@ -2390,7 +2387,7 @@ class W extends _ {
|
|
|
2390
2387
|
received: s.data,
|
|
2391
2388
|
code: c.invalid_enum_value,
|
|
2392
2389
|
options: n
|
|
2393
|
-
}),
|
|
2390
|
+
}), p;
|
|
2394
2391
|
}
|
|
2395
2392
|
return I(e.data);
|
|
2396
2393
|
}
|
|
@@ -2428,8 +2425,8 @@ class W extends _ {
|
|
|
2428
2425
|
});
|
|
2429
2426
|
}
|
|
2430
2427
|
}
|
|
2431
|
-
W.create =
|
|
2432
|
-
class
|
|
2428
|
+
W.create = De;
|
|
2429
|
+
class Ve extends _ {
|
|
2433
2430
|
_parse(e) {
|
|
2434
2431
|
const s = v.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2435
2432
|
if (n.parsedType !== f.string && n.parsedType !== f.number) {
|
|
@@ -2438,7 +2435,7 @@ class Be extends _ {
|
|
|
2438
2435
|
expected: v.joinValues(a),
|
|
2439
2436
|
received: n.parsedType,
|
|
2440
2437
|
code: c.invalid_type
|
|
2441
|
-
}),
|
|
2438
|
+
}), p;
|
|
2442
2439
|
}
|
|
2443
2440
|
if (this._cache || (this._cache = new Set(v.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2444
2441
|
const a = v.objectValues(s);
|
|
@@ -2446,7 +2443,7 @@ class Be extends _ {
|
|
|
2446
2443
|
received: n.data,
|
|
2447
2444
|
code: c.invalid_enum_value,
|
|
2448
2445
|
options: a
|
|
2449
|
-
}),
|
|
2446
|
+
}), p;
|
|
2450
2447
|
}
|
|
2451
2448
|
return I(e.data);
|
|
2452
2449
|
}
|
|
@@ -2454,12 +2451,12 @@ class Be extends _ {
|
|
|
2454
2451
|
return this._def.values;
|
|
2455
2452
|
}
|
|
2456
2453
|
}
|
|
2457
|
-
|
|
2454
|
+
Ve.create = (t, e) => new Ve({
|
|
2458
2455
|
values: t,
|
|
2459
|
-
typeName:
|
|
2456
|
+
typeName: m.ZodNativeEnum,
|
|
2460
2457
|
...g(e)
|
|
2461
2458
|
});
|
|
2462
|
-
class
|
|
2459
|
+
class le extends _ {
|
|
2463
2460
|
unwrap() {
|
|
2464
2461
|
return this._def.type;
|
|
2465
2462
|
}
|
|
@@ -2470,7 +2467,7 @@ class fe extends _ {
|
|
|
2470
2467
|
code: c.invalid_type,
|
|
2471
2468
|
expected: f.promise,
|
|
2472
2469
|
received: s.parsedType
|
|
2473
|
-
}),
|
|
2470
|
+
}), p;
|
|
2474
2471
|
const n = s.parsedType === f.promise ? s.data : Promise.resolve(s.data);
|
|
2475
2472
|
return I(n.then((a) => this._def.type.parseAsync(a, {
|
|
2476
2473
|
path: s.path,
|
|
@@ -2478,9 +2475,9 @@ class fe extends _ {
|
|
|
2478
2475
|
})));
|
|
2479
2476
|
}
|
|
2480
2477
|
}
|
|
2481
|
-
|
|
2478
|
+
le.create = (t, e) => new le({
|
|
2482
2479
|
type: t,
|
|
2483
|
-
typeName:
|
|
2480
|
+
typeName: m.ZodPromise,
|
|
2484
2481
|
...g(e)
|
|
2485
2482
|
});
|
|
2486
2483
|
class H extends _ {
|
|
@@ -2488,7 +2485,7 @@ class H extends _ {
|
|
|
2488
2485
|
return this._def.schema;
|
|
2489
2486
|
}
|
|
2490
2487
|
sourceType() {
|
|
2491
|
-
return this._def.schema._def.typeName ===
|
|
2488
|
+
return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2492
2489
|
}
|
|
2493
2490
|
_parse(e) {
|
|
2494
2491
|
const { status: s, ctx: n } = this._processInputParams(e), a = this._def.effect || null, r = {
|
|
@@ -2504,23 +2501,23 @@ class H extends _ {
|
|
|
2504
2501
|
if (n.common.async)
|
|
2505
2502
|
return Promise.resolve(i).then(async (o) => {
|
|
2506
2503
|
if (s.value === "aborted")
|
|
2507
|
-
return
|
|
2504
|
+
return p;
|
|
2508
2505
|
const d = await this._def.schema._parseAsync({
|
|
2509
2506
|
data: o,
|
|
2510
2507
|
path: n.path,
|
|
2511
2508
|
parent: n
|
|
2512
2509
|
});
|
|
2513
|
-
return d.status === "aborted" ?
|
|
2510
|
+
return d.status === "aborted" ? p : d.status === "dirty" || s.value === "dirty" ? K(d.value) : d;
|
|
2514
2511
|
});
|
|
2515
2512
|
{
|
|
2516
2513
|
if (s.value === "aborted")
|
|
2517
|
-
return
|
|
2514
|
+
return p;
|
|
2518
2515
|
const o = this._def.schema._parseSync({
|
|
2519
2516
|
data: i,
|
|
2520
2517
|
path: n.path,
|
|
2521
2518
|
parent: n
|
|
2522
2519
|
});
|
|
2523
|
-
return o.status === "aborted" ?
|
|
2520
|
+
return o.status === "aborted" ? p : o.status === "dirty" || s.value === "dirty" ? K(o.value) : o;
|
|
2524
2521
|
}
|
|
2525
2522
|
}
|
|
2526
2523
|
if (a.type === "refinement") {
|
|
@@ -2538,9 +2535,9 @@ class H extends _ {
|
|
|
2538
2535
|
path: n.path,
|
|
2539
2536
|
parent: n
|
|
2540
2537
|
});
|
|
2541
|
-
return o.status === "aborted" ?
|
|
2538
|
+
return o.status === "aborted" ? p : (o.status === "dirty" && s.dirty(), i(o.value), { status: s.value, value: o.value });
|
|
2542
2539
|
} else
|
|
2543
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ?
|
|
2540
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? p : (o.status === "dirty" && s.dirty(), i(o.value).then(() => ({ status: s.value, value: o.value }))));
|
|
2544
2541
|
}
|
|
2545
2542
|
if (a.type === "transform")
|
|
2546
2543
|
if (n.common.async === !1) {
|
|
@@ -2550,7 +2547,7 @@ class H extends _ {
|
|
|
2550
2547
|
parent: n
|
|
2551
2548
|
});
|
|
2552
2549
|
if (!Q(i))
|
|
2553
|
-
return
|
|
2550
|
+
return p;
|
|
2554
2551
|
const o = a.transform(i.value, r);
|
|
2555
2552
|
if (o instanceof Promise)
|
|
2556
2553
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
@@ -2559,20 +2556,20 @@ class H extends _ {
|
|
|
2559
2556
|
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => Q(i) ? Promise.resolve(a.transform(i.value, r)).then((o) => ({
|
|
2560
2557
|
status: s.value,
|
|
2561
2558
|
value: o
|
|
2562
|
-
})) :
|
|
2559
|
+
})) : p);
|
|
2563
2560
|
v.assertNever(a);
|
|
2564
2561
|
}
|
|
2565
2562
|
}
|
|
2566
2563
|
H.create = (t, e, s) => new H({
|
|
2567
2564
|
schema: t,
|
|
2568
|
-
typeName:
|
|
2565
|
+
typeName: m.ZodEffects,
|
|
2569
2566
|
effect: e,
|
|
2570
2567
|
...g(s)
|
|
2571
2568
|
});
|
|
2572
2569
|
H.createWithPreprocess = (t, e, s) => new H({
|
|
2573
2570
|
schema: e,
|
|
2574
2571
|
effect: { type: "preprocess", transform: t },
|
|
2575
|
-
typeName:
|
|
2572
|
+
typeName: m.ZodEffects,
|
|
2576
2573
|
...g(s)
|
|
2577
2574
|
});
|
|
2578
2575
|
class L extends _ {
|
|
@@ -2585,7 +2582,7 @@ class L extends _ {
|
|
|
2585
2582
|
}
|
|
2586
2583
|
L.create = (t, e) => new L({
|
|
2587
2584
|
innerType: t,
|
|
2588
|
-
typeName:
|
|
2585
|
+
typeName: m.ZodOptional,
|
|
2589
2586
|
...g(e)
|
|
2590
2587
|
});
|
|
2591
2588
|
class J extends _ {
|
|
@@ -2598,10 +2595,10 @@ class J extends _ {
|
|
|
2598
2595
|
}
|
|
2599
2596
|
J.create = (t, e) => new J({
|
|
2600
2597
|
innerType: t,
|
|
2601
|
-
typeName:
|
|
2598
|
+
typeName: m.ZodNullable,
|
|
2602
2599
|
...g(e)
|
|
2603
2600
|
});
|
|
2604
|
-
class
|
|
2601
|
+
class xe extends _ {
|
|
2605
2602
|
_parse(e) {
|
|
2606
2603
|
const { ctx: s } = this._processInputParams(e);
|
|
2607
2604
|
let n = s.data;
|
|
@@ -2615,13 +2612,13 @@ class be extends _ {
|
|
|
2615
2612
|
return this._def.innerType;
|
|
2616
2613
|
}
|
|
2617
2614
|
}
|
|
2618
|
-
|
|
2615
|
+
xe.create = (t, e) => new xe({
|
|
2619
2616
|
innerType: t,
|
|
2620
|
-
typeName:
|
|
2617
|
+
typeName: m.ZodDefault,
|
|
2621
2618
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2622
2619
|
...g(e)
|
|
2623
2620
|
});
|
|
2624
|
-
class
|
|
2621
|
+
class be extends _ {
|
|
2625
2622
|
_parse(e) {
|
|
2626
2623
|
const { ctx: s } = this._processInputParams(e), n = {
|
|
2627
2624
|
...s,
|
|
@@ -2636,7 +2633,7 @@ class ke extends _ {
|
|
|
2636
2633
|
...n
|
|
2637
2634
|
}
|
|
2638
2635
|
});
|
|
2639
|
-
return
|
|
2636
|
+
return ie(a) ? a.then((r) => ({
|
|
2640
2637
|
status: "valid",
|
|
2641
2638
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2642
2639
|
get error() {
|
|
@@ -2658,13 +2655,13 @@ class ke extends _ {
|
|
|
2658
2655
|
return this._def.innerType;
|
|
2659
2656
|
}
|
|
2660
2657
|
}
|
|
2661
|
-
|
|
2658
|
+
be.create = (t, e) => new be({
|
|
2662
2659
|
innerType: t,
|
|
2663
|
-
typeName:
|
|
2660
|
+
typeName: m.ZodCatch,
|
|
2664
2661
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2665
2662
|
...g(e)
|
|
2666
2663
|
});
|
|
2667
|
-
class
|
|
2664
|
+
class Ue extends _ {
|
|
2668
2665
|
_parse(e) {
|
|
2669
2666
|
if (this._getType(e) !== f.nan) {
|
|
2670
2667
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2672,16 +2669,16 @@ class Ge extends _ {
|
|
|
2672
2669
|
code: c.invalid_type,
|
|
2673
2670
|
expected: f.nan,
|
|
2674
2671
|
received: n.parsedType
|
|
2675
|
-
}),
|
|
2672
|
+
}), p;
|
|
2676
2673
|
}
|
|
2677
2674
|
return { status: "valid", value: e.data };
|
|
2678
2675
|
}
|
|
2679
2676
|
}
|
|
2680
|
-
|
|
2681
|
-
typeName:
|
|
2677
|
+
Ue.create = (t) => new Ue({
|
|
2678
|
+
typeName: m.ZodNaN,
|
|
2682
2679
|
...g(t)
|
|
2683
2680
|
});
|
|
2684
|
-
class
|
|
2681
|
+
class Ct extends _ {
|
|
2685
2682
|
_parse(e) {
|
|
2686
2683
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
2687
2684
|
return this._def.type._parse({
|
|
@@ -2694,7 +2691,7 @@ class Et extends _ {
|
|
|
2694
2691
|
return this._def.type;
|
|
2695
2692
|
}
|
|
2696
2693
|
}
|
|
2697
|
-
class
|
|
2694
|
+
class Se extends _ {
|
|
2698
2695
|
_parse(e) {
|
|
2699
2696
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2700
2697
|
if (n.common.async)
|
|
@@ -2704,7 +2701,7 @@ class Re extends _ {
|
|
|
2704
2701
|
path: n.path,
|
|
2705
2702
|
parent: n
|
|
2706
2703
|
});
|
|
2707
|
-
return r.status === "aborted" ?
|
|
2704
|
+
return r.status === "aborted" ? p : r.status === "dirty" ? (s.dirty(), K(r.value)) : this._def.out._parseAsync({
|
|
2708
2705
|
data: r.value,
|
|
2709
2706
|
path: n.path,
|
|
2710
2707
|
parent: n
|
|
@@ -2716,7 +2713,7 @@ class Re extends _ {
|
|
|
2716
2713
|
path: n.path,
|
|
2717
2714
|
parent: n
|
|
2718
2715
|
});
|
|
2719
|
-
return a.status === "aborted" ?
|
|
2716
|
+
return a.status === "aborted" ? p : a.status === "dirty" ? (s.dirty(), {
|
|
2720
2717
|
status: "dirty",
|
|
2721
2718
|
value: a.value
|
|
2722
2719
|
}) : this._def.out._parseSync({
|
|
@@ -2727,63 +2724,63 @@ class Re extends _ {
|
|
|
2727
2724
|
}
|
|
2728
2725
|
}
|
|
2729
2726
|
static create(e, s) {
|
|
2730
|
-
return new
|
|
2727
|
+
return new Se({
|
|
2731
2728
|
in: e,
|
|
2732
2729
|
out: s,
|
|
2733
|
-
typeName:
|
|
2730
|
+
typeName: m.ZodPipeline
|
|
2734
2731
|
});
|
|
2735
2732
|
}
|
|
2736
2733
|
}
|
|
2737
|
-
class
|
|
2734
|
+
class ke extends _ {
|
|
2738
2735
|
_parse(e) {
|
|
2739
2736
|
const s = this._def.innerType._parse(e), n = (a) => (Q(a) && (a.value = Object.freeze(a.value)), a);
|
|
2740
|
-
return
|
|
2737
|
+
return ie(s) ? s.then((a) => n(a)) : n(s);
|
|
2741
2738
|
}
|
|
2742
2739
|
unwrap() {
|
|
2743
2740
|
return this._def.innerType;
|
|
2744
2741
|
}
|
|
2745
2742
|
}
|
|
2746
|
-
|
|
2743
|
+
ke.create = (t, e) => new ke({
|
|
2747
2744
|
innerType: t,
|
|
2748
|
-
typeName:
|
|
2745
|
+
typeName: m.ZodReadonly,
|
|
2749
2746
|
...g(e)
|
|
2750
2747
|
});
|
|
2751
|
-
var
|
|
2748
|
+
var m;
|
|
2752
2749
|
(function(t) {
|
|
2753
2750
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
2754
|
-
})(
|
|
2755
|
-
const x = q.create,
|
|
2751
|
+
})(m || (m = {}));
|
|
2752
|
+
const x = q.create, Re = F.create, V = ge.create, fe = ye.create;
|
|
2756
2753
|
$.create;
|
|
2757
|
-
const
|
|
2754
|
+
const It = N.create, Y = w.create;
|
|
2755
|
+
ce.create;
|
|
2758
2756
|
ue.create;
|
|
2759
|
-
de.create;
|
|
2760
2757
|
U.create;
|
|
2761
|
-
const
|
|
2758
|
+
const Et = de.create, b = ve.create;
|
|
2762
2759
|
W.create;
|
|
2763
|
-
|
|
2760
|
+
le.create;
|
|
2764
2761
|
L.create;
|
|
2765
2762
|
J.create;
|
|
2766
|
-
const
|
|
2763
|
+
const Nt = 1, B = Y({
|
|
2767
2764
|
type: b("qp-bridge"),
|
|
2768
2765
|
id: x().optional(),
|
|
2769
2766
|
instanceId: x().optional()
|
|
2770
2767
|
}), S = B.extend({
|
|
2771
|
-
featureVersion:
|
|
2772
|
-
}),
|
|
2768
|
+
featureVersion: Re().optional()
|
|
2769
|
+
}), At = B.extend({
|
|
2773
2770
|
status: b("answerChanged"),
|
|
2774
2771
|
question: x(),
|
|
2775
|
-
answer:
|
|
2776
|
-
}),
|
|
2772
|
+
answer: fe()
|
|
2773
|
+
}), Ot = B.extend({
|
|
2777
2774
|
action: b("commandExecuted"),
|
|
2778
2775
|
commandName: x()
|
|
2779
|
-
}),
|
|
2776
|
+
}), Mt = B.extend({
|
|
2780
2777
|
action: b("questionnaireLoaded")
|
|
2781
2778
|
}), G = B.extend({
|
|
2782
2779
|
status: b("success")
|
|
2783
|
-
}),
|
|
2780
|
+
}), Zt = B.extend({
|
|
2784
2781
|
status: b("error"),
|
|
2785
2782
|
message: x()
|
|
2786
|
-
}),
|
|
2783
|
+
}), Qe = Y({
|
|
2787
2784
|
semanticColor: x().optional(),
|
|
2788
2785
|
label: x(),
|
|
2789
2786
|
description: x(),
|
|
@@ -2791,181 +2788,187 @@ const Ot = 1, B = Y({
|
|
|
2791
2788
|
required: V(),
|
|
2792
2789
|
hidden: V(),
|
|
2793
2790
|
errorMessage: x().optional(),
|
|
2794
|
-
answer:
|
|
2795
|
-
}),
|
|
2791
|
+
answer: fe().optional()
|
|
2792
|
+
}), qt = Qe.partial(), jt = Y({
|
|
2796
2793
|
id: x().uuid(),
|
|
2797
2794
|
name: x(),
|
|
2798
2795
|
mimeType: x(),
|
|
2799
2796
|
blobUrl: x()
|
|
2800
|
-
}),
|
|
2797
|
+
}), Te = Et(fe()), Fe = Y({
|
|
2801
2798
|
label: x(),
|
|
2802
2799
|
hidden: V(),
|
|
2803
2800
|
collapsed: V()
|
|
2804
|
-
}),
|
|
2801
|
+
}), Pt = Fe.partial(), Lt = Y({
|
|
2805
2802
|
entityName: x(),
|
|
2806
2803
|
id: x(),
|
|
2807
2804
|
name: x()
|
|
2808
|
-
}),
|
|
2805
|
+
}), $t = Y({
|
|
2809
2806
|
isNew: V(),
|
|
2810
2807
|
id: x().uuid(),
|
|
2811
2808
|
label: x(),
|
|
2812
2809
|
description: x().optional(),
|
|
2813
|
-
regarding:
|
|
2814
|
-
}),
|
|
2810
|
+
regarding: Lt.optional()
|
|
2811
|
+
}), Vt = S.extend({
|
|
2815
2812
|
action: b("getQuestion"),
|
|
2816
2813
|
question: x()
|
|
2817
|
-
}),
|
|
2818
|
-
question:
|
|
2819
|
-
}),
|
|
2814
|
+
}), Ut = G.extend({
|
|
2815
|
+
question: Qe
|
|
2816
|
+
}), Bt = S.extend({
|
|
2820
2817
|
action: b("setQuestion"),
|
|
2821
2818
|
question: x(),
|
|
2822
|
-
questionData:
|
|
2823
|
-
}),
|
|
2819
|
+
questionData: qt
|
|
2820
|
+
}), Gt = S.extend({
|
|
2824
2821
|
action: b("getGroup"),
|
|
2825
2822
|
group: x()
|
|
2826
|
-
}),
|
|
2827
|
-
group:
|
|
2828
|
-
}),
|
|
2823
|
+
}), zt = G.extend({
|
|
2824
|
+
group: Fe
|
|
2825
|
+
}), Dt = S.extend({
|
|
2829
2826
|
action: b("getQuestionnaire")
|
|
2830
|
-
}),
|
|
2831
|
-
questionnaire:
|
|
2832
|
-
}),
|
|
2827
|
+
}), Qt = G.extend({
|
|
2828
|
+
questionnaire: $t
|
|
2829
|
+
}), Ft = G.extend({
|
|
2833
2830
|
canSave: V()
|
|
2834
|
-
}),
|
|
2831
|
+
}), Wt = S.extend({
|
|
2835
2832
|
action: b("canSave")
|
|
2836
|
-
}),
|
|
2833
|
+
}), Ht = S.extend({
|
|
2837
2834
|
action: b("setGroup"),
|
|
2838
2835
|
group: x(),
|
|
2839
|
-
groupData:
|
|
2840
|
-
}),
|
|
2836
|
+
groupData: Pt
|
|
2837
|
+
}), Jt = S.extend({
|
|
2841
2838
|
action: b("setAnswer"),
|
|
2842
2839
|
question: x(),
|
|
2843
|
-
answer:
|
|
2844
|
-
}),
|
|
2840
|
+
answer: fe()
|
|
2841
|
+
}), Yt = S.extend({
|
|
2845
2842
|
action: b("busyIndicatorStart")
|
|
2846
|
-
}),
|
|
2843
|
+
}), Xt = S.extend({
|
|
2847
2844
|
action: b("busyIndicatorEnd")
|
|
2848
|
-
}),
|
|
2845
|
+
}), Kt = S.extend({
|
|
2849
2846
|
action: b("saveQuestionnaire")
|
|
2850
|
-
}),
|
|
2847
|
+
}), es = S.extend({
|
|
2851
2848
|
action: b("completeAndCloseQuestionnaire")
|
|
2852
|
-
}),
|
|
2849
|
+
}), ts = S.extend({
|
|
2853
2850
|
action: b("executeCustomCommand"),
|
|
2854
2851
|
commandName: x()
|
|
2855
|
-
}),
|
|
2852
|
+
}), ss = S.extend({
|
|
2856
2853
|
action: b("fetchEntities"),
|
|
2857
2854
|
fetchXml: x()
|
|
2858
|
-
}),
|
|
2859
|
-
entities:
|
|
2860
|
-
}),
|
|
2855
|
+
}), ns = G.extend({
|
|
2856
|
+
entities: It(Te)
|
|
2857
|
+
}), as = S.extend({
|
|
2861
2858
|
action: b("getEntityById"),
|
|
2862
2859
|
entityName: x(),
|
|
2863
2860
|
entityId: x()
|
|
2864
|
-
}),
|
|
2865
|
-
entity:
|
|
2866
|
-
}),
|
|
2861
|
+
}), rs = G.extend({
|
|
2862
|
+
entity: Te
|
|
2863
|
+
}), is = S.extend({
|
|
2867
2864
|
action: b("saveEntity"),
|
|
2868
|
-
entity:
|
|
2869
|
-
}),
|
|
2865
|
+
entity: Te
|
|
2866
|
+
}), os = S.extend({
|
|
2870
2867
|
action: b("repeatGroup"),
|
|
2871
2868
|
parentGroupName: x(),
|
|
2872
|
-
groupIndex:
|
|
2873
|
-
}),
|
|
2869
|
+
groupIndex: Re()
|
|
2870
|
+
}), cs = S.extend({
|
|
2874
2871
|
action: b("addNewGroup"),
|
|
2875
2872
|
groupName: x()
|
|
2876
|
-
}),
|
|
2873
|
+
}), us = S.extend({
|
|
2877
2874
|
action: b("deleteGroup"),
|
|
2878
2875
|
parentGroupName: x(),
|
|
2879
|
-
groupIndex:
|
|
2876
|
+
groupIndex: Re()
|
|
2880
2877
|
});
|
|
2881
|
-
function
|
|
2882
|
-
return
|
|
2878
|
+
function Ns(t) {
|
|
2879
|
+
return jt.safeParse(t).success;
|
|
2883
2880
|
}
|
|
2884
|
-
function
|
|
2885
|
-
return
|
|
2881
|
+
function ds(t) {
|
|
2882
|
+
return At.safeParse(t).success;
|
|
2886
2883
|
}
|
|
2887
|
-
function
|
|
2888
|
-
return
|
|
2884
|
+
function ls(t) {
|
|
2885
|
+
return Ot.safeParse(t).success;
|
|
2889
2886
|
}
|
|
2890
|
-
function
|
|
2891
|
-
return
|
|
2887
|
+
function fs(t) {
|
|
2888
|
+
return Mt.safeParse(t).success;
|
|
2892
2889
|
}
|
|
2893
|
-
function
|
|
2890
|
+
function we(t) {
|
|
2894
2891
|
return B.safeParse(t).success;
|
|
2895
2892
|
}
|
|
2896
|
-
function
|
|
2893
|
+
function As(t) {
|
|
2897
2894
|
return S.safeParse(t).success;
|
|
2898
2895
|
}
|
|
2899
|
-
function
|
|
2896
|
+
function hs(t) {
|
|
2900
2897
|
return G.safeParse(t).success;
|
|
2901
2898
|
}
|
|
2902
|
-
function
|
|
2903
|
-
return
|
|
2899
|
+
function ms(t) {
|
|
2900
|
+
return Zt.safeParse(t).success;
|
|
2901
|
+
}
|
|
2902
|
+
function Os(t) {
|
|
2903
|
+
return Vt.safeParse(t).success;
|
|
2904
|
+
}
|
|
2905
|
+
function ps(t) {
|
|
2906
|
+
return Ut.safeParse(t).success;
|
|
2907
|
+
}
|
|
2908
|
+
function Ms(t) {
|
|
2909
|
+
return Jt.safeParse(t).success;
|
|
2904
2910
|
}
|
|
2905
2911
|
function Zs(t) {
|
|
2906
2912
|
return Bt.safeParse(t).success;
|
|
2907
2913
|
}
|
|
2908
|
-
function ys(t) {
|
|
2909
|
-
return Gt.safeParse(t).success;
|
|
2910
|
-
}
|
|
2911
2914
|
function qs(t) {
|
|
2912
|
-
return
|
|
2915
|
+
return Ht.safeParse(t).success;
|
|
2913
2916
|
}
|
|
2914
2917
|
function js(t) {
|
|
2915
|
-
return
|
|
2918
|
+
return Gt.safeParse(t).success;
|
|
2916
2919
|
}
|
|
2917
2920
|
function Ps(t) {
|
|
2918
|
-
return Yt.safeParse(t).success;
|
|
2919
|
-
}
|
|
2920
|
-
function Ls(t) {
|
|
2921
2921
|
return Dt.safeParse(t).success;
|
|
2922
2922
|
}
|
|
2923
|
-
function
|
|
2924
|
-
return
|
|
2923
|
+
function gs(t) {
|
|
2924
|
+
return zt.safeParse(t).success;
|
|
2925
2925
|
}
|
|
2926
|
-
function
|
|
2926
|
+
function ys(t) {
|
|
2927
2927
|
return Qt.safeParse(t).success;
|
|
2928
2928
|
}
|
|
2929
|
-
function
|
|
2929
|
+
function Ls(t) {
|
|
2930
|
+
return Ft.safeParse(t).success;
|
|
2931
|
+
}
|
|
2932
|
+
function _s(t) {
|
|
2930
2933
|
return Wt.safeParse(t).success;
|
|
2931
2934
|
}
|
|
2932
|
-
function
|
|
2933
|
-
return
|
|
2935
|
+
function vs(t) {
|
|
2936
|
+
return Yt.safeParse(t).success;
|
|
2934
2937
|
}
|
|
2935
2938
|
function xs(t) {
|
|
2936
|
-
return
|
|
2939
|
+
return Xt.safeParse(t).success;
|
|
2937
2940
|
}
|
|
2938
|
-
function
|
|
2941
|
+
function $s(t) {
|
|
2939
2942
|
return Kt.safeParse(t).success;
|
|
2940
2943
|
}
|
|
2941
|
-
function
|
|
2944
|
+
function Vs(t) {
|
|
2942
2945
|
return es.safeParse(t).success;
|
|
2943
2946
|
}
|
|
2944
2947
|
function Us(t) {
|
|
2945
2948
|
return ts.safeParse(t).success;
|
|
2946
2949
|
}
|
|
2947
2950
|
function Bs(t) {
|
|
2948
|
-
return
|
|
2951
|
+
return vs(t) || xs(t);
|
|
2952
|
+
}
|
|
2953
|
+
function bs(t, e, s) {
|
|
2954
|
+
return !we(t) || t.id !== e || s !== void 0 && t.instanceId !== s || !("status" in t);
|
|
2949
2955
|
}
|
|
2950
2956
|
function Gs(t) {
|
|
2957
|
+
return ss.safeParse(t).success;
|
|
2958
|
+
}
|
|
2959
|
+
function ks(t) {
|
|
2951
2960
|
return ns.safeParse(t).success;
|
|
2952
2961
|
}
|
|
2953
2962
|
function zs(t) {
|
|
2954
|
-
return bs(t) || ks(t);
|
|
2955
|
-
}
|
|
2956
|
-
function ws(t, e, s) {
|
|
2957
|
-
return !Se(t) || t.id !== e || s !== void 0 && t.instanceId !== s || !("status" in t);
|
|
2958
|
-
}
|
|
2959
|
-
function Ds(t) {
|
|
2960
2963
|
return as.safeParse(t).success;
|
|
2961
2964
|
}
|
|
2962
|
-
function
|
|
2965
|
+
function ws(t) {
|
|
2963
2966
|
return rs.safeParse(t).success;
|
|
2964
2967
|
}
|
|
2965
|
-
function
|
|
2968
|
+
function Ds(t) {
|
|
2966
2969
|
return is.safeParse(t).success;
|
|
2967
2970
|
}
|
|
2968
|
-
function
|
|
2971
|
+
function Qs(t) {
|
|
2969
2972
|
return os.safeParse(t).success;
|
|
2970
2973
|
}
|
|
2971
2974
|
function Fs(t) {
|
|
@@ -2974,19 +2977,13 @@ function Fs(t) {
|
|
|
2974
2977
|
function Ws(t) {
|
|
2975
2978
|
return us.safeParse(t).success;
|
|
2976
2979
|
}
|
|
2977
|
-
function Hs(t) {
|
|
2978
|
-
return ds.safeParse(t).success;
|
|
2979
|
-
}
|
|
2980
|
-
function Js(t) {
|
|
2981
|
-
return ls.safeParse(t).success;
|
|
2982
|
-
}
|
|
2983
2980
|
function re(t) {
|
|
2984
2981
|
if (t?.instanceId != null)
|
|
2985
2982
|
return t.instanceId;
|
|
2986
2983
|
const e = globalThis.__RESCO_QP_BRIDGE_INSTANCE_ID;
|
|
2987
2984
|
return typeof e == "string" ? e : void 0;
|
|
2988
2985
|
}
|
|
2989
|
-
function
|
|
2986
|
+
function We(t) {
|
|
2990
2987
|
if (t instanceof File || t instanceof Blob)
|
|
2991
2988
|
return URL.createObjectURL(t);
|
|
2992
2989
|
if (typeof t == "string") {
|
|
@@ -3013,31 +3010,31 @@ function Je(t) {
|
|
|
3013
3010
|
}
|
|
3014
3011
|
throw new Error("Unsupported content type for blobUrl");
|
|
3015
3012
|
}
|
|
3016
|
-
function
|
|
3013
|
+
function Hs(t, e, s, n) {
|
|
3017
3014
|
return {
|
|
3018
|
-
id: n ??
|
|
3015
|
+
id: n ?? Be(),
|
|
3019
3016
|
name: t,
|
|
3020
3017
|
mimeType: e,
|
|
3021
|
-
blobUrl:
|
|
3018
|
+
blobUrl: We(s)
|
|
3022
3019
|
};
|
|
3023
3020
|
}
|
|
3024
|
-
function
|
|
3021
|
+
function Js(t, e) {
|
|
3025
3022
|
let s = t.blobUrl;
|
|
3026
|
-
return e.content !== void 0 && (s =
|
|
3023
|
+
return e.content !== void 0 && (s = We(e.content)), {
|
|
3027
3024
|
...t,
|
|
3028
3025
|
...e,
|
|
3029
3026
|
blobUrl: s
|
|
3030
3027
|
};
|
|
3031
3028
|
}
|
|
3032
|
-
|
|
3033
|
-
function
|
|
3034
|
-
window.addEventListener("message",
|
|
3029
|
+
Ye.env?.NODE_ENV !== "test" && Ss();
|
|
3030
|
+
function Ss() {
|
|
3031
|
+
window.addEventListener("message", He);
|
|
3035
3032
|
}
|
|
3036
|
-
function
|
|
3037
|
-
window.removeEventListener("message",
|
|
3033
|
+
function Ys() {
|
|
3034
|
+
window.removeEventListener("message", He);
|
|
3038
3035
|
}
|
|
3039
|
-
async function
|
|
3040
|
-
return await
|
|
3036
|
+
async function Xs(t) {
|
|
3037
|
+
return await Cs(
|
|
3041
3038
|
{
|
|
3042
3039
|
type: "qp-bridge",
|
|
3043
3040
|
action: "getQuestionnaire"
|
|
@@ -3045,7 +3042,7 @@ async function en(t) {
|
|
|
3045
3042
|
t
|
|
3046
3043
|
);
|
|
3047
3044
|
}
|
|
3048
|
-
async function
|
|
3045
|
+
async function Ks(t, e, s) {
|
|
3049
3046
|
await C(
|
|
3050
3047
|
{
|
|
3051
3048
|
type: "qp-bridge",
|
|
@@ -3056,8 +3053,8 @@ async function tn(t, e, s) {
|
|
|
3056
3053
|
s
|
|
3057
3054
|
);
|
|
3058
3055
|
}
|
|
3059
|
-
async function
|
|
3060
|
-
return await
|
|
3056
|
+
async function en(t, e) {
|
|
3057
|
+
return await Rs(
|
|
3061
3058
|
{
|
|
3062
3059
|
type: "qp-bridge",
|
|
3063
3060
|
action: "getQuestion",
|
|
@@ -3066,7 +3063,7 @@ async function sn(t, e) {
|
|
|
3066
3063
|
e
|
|
3067
3064
|
);
|
|
3068
3065
|
}
|
|
3069
|
-
async function
|
|
3066
|
+
async function tn(t, e, s) {
|
|
3070
3067
|
await C(
|
|
3071
3068
|
{
|
|
3072
3069
|
type: "qp-bridge",
|
|
@@ -3077,8 +3074,8 @@ async function nn(t, e, s) {
|
|
|
3077
3074
|
s
|
|
3078
3075
|
);
|
|
3079
3076
|
}
|
|
3080
|
-
async function
|
|
3081
|
-
return await
|
|
3077
|
+
async function sn(t, e) {
|
|
3078
|
+
return await Ts(
|
|
3082
3079
|
{
|
|
3083
3080
|
type: "qp-bridge",
|
|
3084
3081
|
action: "getGroup",
|
|
@@ -3087,7 +3084,7 @@ async function an(t, e) {
|
|
|
3087
3084
|
e
|
|
3088
3085
|
);
|
|
3089
3086
|
}
|
|
3090
|
-
async function
|
|
3087
|
+
async function nn(t, e, s) {
|
|
3091
3088
|
await C(
|
|
3092
3089
|
{
|
|
3093
3090
|
type: "qp-bridge",
|
|
@@ -3098,9 +3095,9 @@ async function rn(t, e, s) {
|
|
|
3098
3095
|
s
|
|
3099
3096
|
);
|
|
3100
3097
|
}
|
|
3101
|
-
function
|
|
3098
|
+
function an(t, e) {
|
|
3102
3099
|
const s = re(e), n = (a) => {
|
|
3103
|
-
|
|
3100
|
+
ds(a.data) && a.data.instanceId === s && t(a.data.question, a.data.answer);
|
|
3104
3101
|
};
|
|
3105
3102
|
return window.addEventListener("message", n), {
|
|
3106
3103
|
cancelSubscription: () => {
|
|
@@ -3108,7 +3105,7 @@ function on(t, e) {
|
|
|
3108
3105
|
}
|
|
3109
3106
|
};
|
|
3110
3107
|
}
|
|
3111
|
-
async function
|
|
3108
|
+
async function rn(t, e) {
|
|
3112
3109
|
await C(
|
|
3113
3110
|
{
|
|
3114
3111
|
type: "qp-bridge",
|
|
@@ -3128,7 +3125,7 @@ async function cn(t, e) {
|
|
|
3128
3125
|
);
|
|
3129
3126
|
}
|
|
3130
3127
|
}
|
|
3131
|
-
async function
|
|
3128
|
+
async function on(t) {
|
|
3132
3129
|
await C(
|
|
3133
3130
|
{
|
|
3134
3131
|
type: "qp-bridge",
|
|
@@ -3137,7 +3134,7 @@ async function un(t) {
|
|
|
3137
3134
|
t
|
|
3138
3135
|
);
|
|
3139
3136
|
}
|
|
3140
|
-
async function
|
|
3137
|
+
async function cn(t) {
|
|
3141
3138
|
await C(
|
|
3142
3139
|
{
|
|
3143
3140
|
type: "qp-bridge",
|
|
@@ -3146,7 +3143,7 @@ async function dn(t) {
|
|
|
3146
3143
|
t
|
|
3147
3144
|
);
|
|
3148
3145
|
}
|
|
3149
|
-
async function
|
|
3146
|
+
async function un(t, e) {
|
|
3150
3147
|
await C(
|
|
3151
3148
|
{
|
|
3152
3149
|
type: "qp-bridge",
|
|
@@ -3157,7 +3154,7 @@ async function ln(t, e) {
|
|
|
3157
3154
|
);
|
|
3158
3155
|
}
|
|
3159
3156
|
const ee = [], te = [], se = [];
|
|
3160
|
-
function
|
|
3157
|
+
function dn(t, e) {
|
|
3161
3158
|
const s = re(e);
|
|
3162
3159
|
return se.some((n) => n.handler === t && n.instanceId === s) || se.push({ handler: t, instanceId: s }), {
|
|
3163
3160
|
cancelSubscription: () => {
|
|
@@ -3166,7 +3163,7 @@ function fn(t, e) {
|
|
|
3166
3163
|
}
|
|
3167
3164
|
};
|
|
3168
3165
|
}
|
|
3169
|
-
function
|
|
3166
|
+
function ln(t, e) {
|
|
3170
3167
|
const s = re(e);
|
|
3171
3168
|
return te.some((n) => n.handler === t && n.instanceId === s) || te.push({ handler: t, instanceId: s }), {
|
|
3172
3169
|
cancelSubscription: () => {
|
|
@@ -3175,7 +3172,7 @@ function hn(t, e) {
|
|
|
3175
3172
|
}
|
|
3176
3173
|
};
|
|
3177
3174
|
}
|
|
3178
|
-
function
|
|
3175
|
+
function fn(t, e) {
|
|
3179
3176
|
const s = re(e);
|
|
3180
3177
|
return ee.some((n) => n.validator === t && n.instanceId === s) || ee.push({ validator: t, instanceId: s }), {
|
|
3181
3178
|
cancelSubscription: () => {
|
|
@@ -3184,9 +3181,9 @@ function pn(t, e) {
|
|
|
3184
3181
|
}
|
|
3185
3182
|
};
|
|
3186
3183
|
}
|
|
3187
|
-
async function
|
|
3184
|
+
async function He(t) {
|
|
3188
3185
|
try {
|
|
3189
|
-
if (
|
|
3186
|
+
if (ls(t.data) && te.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler(t.data.commandName)), fs(t.data) && se.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler()), _s(t.data)) {
|
|
3190
3187
|
const e = ee.filter((a) => a.instanceId === t.data.instanceId), s = await Promise.all(e.map((a) => a.validator())), n = {
|
|
3191
3188
|
type: "qp-bridge",
|
|
3192
3189
|
status: "success",
|
|
@@ -3200,15 +3197,15 @@ async function Ye(t) {
|
|
|
3200
3197
|
const s = {
|
|
3201
3198
|
type: "qp-bridge",
|
|
3202
3199
|
status: "error",
|
|
3203
|
-
id:
|
|
3204
|
-
instanceId:
|
|
3200
|
+
id: we(t.data) ? t.data.id : void 0,
|
|
3201
|
+
instanceId: we(t.data) ? t.data.instanceId : void 0,
|
|
3205
3202
|
message: e instanceof Error ? e.message : "Unknown error"
|
|
3206
3203
|
};
|
|
3207
3204
|
window.parent.postMessage(s, "*");
|
|
3208
3205
|
}
|
|
3209
3206
|
}
|
|
3210
|
-
async function
|
|
3211
|
-
return await
|
|
3207
|
+
async function hn(t, e) {
|
|
3208
|
+
return await Is(
|
|
3212
3209
|
{
|
|
3213
3210
|
type: "qp-bridge",
|
|
3214
3211
|
action: "fetchEntities",
|
|
@@ -3217,8 +3214,8 @@ async function mn(t, e) {
|
|
|
3217
3214
|
e
|
|
3218
3215
|
);
|
|
3219
3216
|
}
|
|
3220
|
-
async function
|
|
3221
|
-
return await
|
|
3217
|
+
async function mn(t, e, s) {
|
|
3218
|
+
return await Es(
|
|
3222
3219
|
{
|
|
3223
3220
|
type: "qp-bridge",
|
|
3224
3221
|
action: "getEntityById",
|
|
@@ -3228,10 +3225,10 @@ async function gn(t, e, s) {
|
|
|
3228
3225
|
s
|
|
3229
3226
|
);
|
|
3230
3227
|
}
|
|
3231
|
-
function
|
|
3228
|
+
function pn() {
|
|
3232
3229
|
return { isNew: !0 };
|
|
3233
3230
|
}
|
|
3234
|
-
async function
|
|
3231
|
+
async function gn(t, e) {
|
|
3235
3232
|
await C(
|
|
3236
3233
|
{
|
|
3237
3234
|
type: "qp-bridge",
|
|
@@ -3241,7 +3238,7 @@ async function _n(t, e) {
|
|
|
3241
3238
|
e
|
|
3242
3239
|
);
|
|
3243
3240
|
}
|
|
3244
|
-
async function
|
|
3241
|
+
async function yn(t, e, s) {
|
|
3245
3242
|
await C(
|
|
3246
3243
|
{
|
|
3247
3244
|
type: "qp-bridge",
|
|
@@ -3252,7 +3249,7 @@ async function vn(t, e, s) {
|
|
|
3252
3249
|
s
|
|
3253
3250
|
);
|
|
3254
3251
|
}
|
|
3255
|
-
async function
|
|
3252
|
+
async function _n(t, e) {
|
|
3256
3253
|
await C(
|
|
3257
3254
|
{
|
|
3258
3255
|
type: "qp-bridge",
|
|
@@ -3262,7 +3259,7 @@ async function xn(t, e) {
|
|
|
3262
3259
|
e
|
|
3263
3260
|
);
|
|
3264
3261
|
}
|
|
3265
|
-
async function
|
|
3262
|
+
async function vn(t, e, s) {
|
|
3266
3263
|
await C(
|
|
3267
3264
|
{
|
|
3268
3265
|
type: "qp-bridge",
|
|
@@ -3275,154 +3272,154 @@ async function bn(t, e, s) {
|
|
|
3275
3272
|
}
|
|
3276
3273
|
async function X(t, e, s) {
|
|
3277
3274
|
return new Promise((n, a) => {
|
|
3278
|
-
const r =
|
|
3279
|
-
if (
|
|
3275
|
+
const r = Be(), i = re(s), o = (d) => {
|
|
3276
|
+
if (bs(d.data, r, i))
|
|
3280
3277
|
return;
|
|
3281
3278
|
const l = e(d.data);
|
|
3282
|
-
l.success ? n(l.data) :
|
|
3279
|
+
l.success ? n(l.data) : ms(d.data) ? a(new Error(d.data.message)) : a(new Error("Unknown message received")), window.removeEventListener("message", o);
|
|
3283
3280
|
};
|
|
3284
|
-
window.addEventListener("message", o), window.parent.postMessage({ ...t, id: r, instanceId: i, featureVersion:
|
|
3281
|
+
window.addEventListener("message", o), window.parent.postMessage({ ...t, id: r, instanceId: i, featureVersion: Nt }, "*");
|
|
3285
3282
|
});
|
|
3286
3283
|
}
|
|
3287
|
-
async function
|
|
3284
|
+
async function Rs(t, e) {
|
|
3288
3285
|
return X(
|
|
3289
3286
|
t,
|
|
3290
|
-
(s) =>
|
|
3287
|
+
(s) => ps(s) ? { success: !0, data: s.question } : { success: !1 },
|
|
3291
3288
|
e
|
|
3292
3289
|
);
|
|
3293
3290
|
}
|
|
3294
|
-
async function
|
|
3291
|
+
async function Ts(t, e) {
|
|
3295
3292
|
return X(
|
|
3296
3293
|
t,
|
|
3297
|
-
(s) =>
|
|
3294
|
+
(s) => gs(s) ? { success: !0, data: s.group } : { success: !1 },
|
|
3298
3295
|
e
|
|
3299
3296
|
);
|
|
3300
3297
|
}
|
|
3301
|
-
async function
|
|
3298
|
+
async function Cs(t, e) {
|
|
3302
3299
|
return X(
|
|
3303
3300
|
t,
|
|
3304
|
-
(s) =>
|
|
3301
|
+
(s) => ys(s) ? { success: !0, data: s.questionnaire } : { success: !1 },
|
|
3305
3302
|
e
|
|
3306
3303
|
);
|
|
3307
3304
|
}
|
|
3308
3305
|
function C(t, e) {
|
|
3309
3306
|
return X(
|
|
3310
3307
|
t,
|
|
3311
|
-
(s) =>
|
|
3308
|
+
(s) => hs(s) ? { success: !0, data: void 0 } : { success: !1 },
|
|
3312
3309
|
e
|
|
3313
3310
|
);
|
|
3314
3311
|
}
|
|
3315
|
-
async function
|
|
3312
|
+
async function Is(t, e) {
|
|
3316
3313
|
return X(
|
|
3317
3314
|
t,
|
|
3318
|
-
(s) =>
|
|
3315
|
+
(s) => ks(s) ? { success: !0, data: s.entities } : { success: !1 },
|
|
3319
3316
|
e
|
|
3320
3317
|
);
|
|
3321
3318
|
}
|
|
3322
|
-
async function
|
|
3319
|
+
async function Es(t, e) {
|
|
3323
3320
|
return X(
|
|
3324
3321
|
t,
|
|
3325
|
-
(s) =>
|
|
3322
|
+
(s) => ws(s) ? { success: !0, data: s.entity } : { success: !1 },
|
|
3326
3323
|
e
|
|
3327
3324
|
);
|
|
3328
3325
|
}
|
|
3329
3326
|
export {
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3327
|
+
Nt as QP_BRIDGE_FEATURE_VERSION,
|
|
3328
|
+
_n as addNewGroup,
|
|
3329
|
+
cs as addNewGroupRequestMessageSchema,
|
|
3330
|
+
Xt as busyIndicatorEndRequestMessageSchema,
|
|
3331
|
+
Yt as busyIndicatorStartRequestMessageSchema,
|
|
3332
|
+
Wt as canSaveRequestMessageSchema,
|
|
3333
|
+
Ft as canSaveSuccessResponseMessageSchema,
|
|
3334
|
+
Ot as commandExecutedMessageSchema,
|
|
3335
|
+
cn as completeAndCloseQuestionnaire,
|
|
3336
|
+
es as completeAndCloseQuestionnaireRequestMessageSchema,
|
|
3337
|
+
Hs as createMediaItem,
|
|
3338
|
+
pn as createNewEntity,
|
|
3339
|
+
vn as deleteGroup,
|
|
3340
|
+
us as deleteGroupRequestMessageSchema,
|
|
3341
|
+
Te as entitySchema,
|
|
3342
|
+
un as executeCustomCommand,
|
|
3343
|
+
ts as executeCustomCommandRequestMessageSchema,
|
|
3344
|
+
hn as fetchEntities,
|
|
3345
|
+
ss as fetchEntitiesRequestMessageSchema,
|
|
3346
|
+
ns as fetchEntitiesSuccessResponseMessageSchema,
|
|
3347
|
+
mn as getEntityById,
|
|
3348
|
+
as as getEntityByIdRequestMessageSchema,
|
|
3349
|
+
rs as getEntityByIdSuccessResponseMessageSchema,
|
|
3350
|
+
sn as getGroup,
|
|
3351
|
+
Gt as getGroupRequestMessageSchema,
|
|
3352
|
+
zt as getGroupSuccessResponseMessageSchema,
|
|
3353
|
+
en as getQuestion,
|
|
3354
|
+
Vt as getQuestionRequestMessageSchema,
|
|
3355
|
+
Ut as getQuestionSuccessResponseMessageSchema,
|
|
3356
|
+
Xs as getQuestionnaire,
|
|
3357
|
+
Dt as getQuestionnaireRequestMessageSchema,
|
|
3358
|
+
Qt as getQuestionnaireSuccessResponseMessageSchema,
|
|
3359
|
+
Pt as groupOptionalScheme,
|
|
3360
|
+
Fe as groupSchema,
|
|
3361
|
+
Ss as initOnSaveMessageHandler,
|
|
3362
|
+
Fs as isAddNewGroupRequestMessage,
|
|
3363
|
+
xs as isBusyIndicatorEndRequestMessage,
|
|
3364
|
+
vs as isBusyIndicatorStartRequestMessage,
|
|
3365
|
+
_s as isCanSaveRequestMessage,
|
|
3366
|
+
Ls as isCanSaveSuccessResponseMessage,
|
|
3367
|
+
ls as isCommandExecutedMessage,
|
|
3368
|
+
Vs as isCompleteAndCloseQuestionnaireRequestMessage,
|
|
3369
|
+
Ws as isDeleteGroupRequestMessage,
|
|
3370
|
+
ms as isErrorMessage,
|
|
3371
|
+
Us as isExecuteCustomCommandRequestMessage,
|
|
3372
|
+
Gs as isFetchEntitiesRequestMessage,
|
|
3373
|
+
ks as isFetchEntitiesSuccessResponseMessage,
|
|
3374
|
+
zs as isGetEntityByIdRequestMessage,
|
|
3375
|
+
ws as isGetEntityByIdSuccessResponseMessage,
|
|
3376
|
+
js as isGetGroupRequestMessage,
|
|
3377
|
+
gs as isGetGroupSuccessResponseMessage,
|
|
3378
|
+
Os as isGetQuestionRequestMessage,
|
|
3379
|
+
ps as isGetQuestionSuccessResponseMessage,
|
|
3380
|
+
Ps as isGetQuestionnaireRequestMessage,
|
|
3381
|
+
ys as isGetQuestionnaireSuccessResponseMessage,
|
|
3382
|
+
Ns as isMediaItem,
|
|
3383
|
+
bs as isNotRelevantMessage,
|
|
3384
|
+
ds as isOnAnswerChangeMessage,
|
|
3385
|
+
we as isQpBridgeMessage,
|
|
3386
|
+
As as isQpBridgeRequestMessage,
|
|
3387
|
+
fs as isQuestionnaireLoadedMessage,
|
|
3388
|
+
Qs as isRepeatGroupRequestMessage,
|
|
3389
|
+
Ds as isSaveEntityRequestMessage,
|
|
3390
|
+
$s as isSaveQuestionnaireRequestMessage,
|
|
3391
|
+
Ms as isSetAnswerRequestMessage,
|
|
3392
|
+
qs as isSetGroupRequestMessage,
|
|
3393
|
+
Zs as isSetQuestionRequestMessage,
|
|
3394
|
+
hs as isSuccessMessage,
|
|
3395
|
+
Bs as isWithBusyIndicatorRequestMessage,
|
|
3396
|
+
jt as mediaItemSchema,
|
|
3397
|
+
an as onAnswerChange,
|
|
3398
|
+
At as onAnswerChangeMessageSchema,
|
|
3399
|
+
ln as onCommandExecuted,
|
|
3400
|
+
dn as onQuestionnaireLoaded,
|
|
3401
|
+
fn as onSave,
|
|
3405
3402
|
B as qpBridgeBaseMessageSchema,
|
|
3406
3403
|
S as qpBridgeRequestMessageSchema,
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3404
|
+
qt as questionOptionalScheme,
|
|
3405
|
+
Qe as questionSchema,
|
|
3406
|
+
Mt as questionnaireLoadedMessageSchema,
|
|
3407
|
+
$t as questionnaireSchema,
|
|
3408
|
+
Ys as removeOnSaveMessageHandler,
|
|
3409
|
+
yn as repeatGroup,
|
|
3410
|
+
os as repeatGroupRequestMessageSchema,
|
|
3411
|
+
Zt as responseErrorMessageSchema,
|
|
3415
3412
|
G as responseSuccessMessageSchema,
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3413
|
+
gn as saveEntity,
|
|
3414
|
+
is as saveEntityRequestMessageSchema,
|
|
3415
|
+
on as saveQuestionnaire,
|
|
3416
|
+
Kt as saveQuestionnaireRequestMessageSchema,
|
|
3417
|
+
Ks as setAnswer,
|
|
3418
|
+
Jt as setAnswerRequestMessageSchema,
|
|
3419
|
+
nn as setGroup,
|
|
3420
|
+
Ht as setGroupRequestMessageSchema,
|
|
3421
|
+
tn as setQuestion,
|
|
3422
|
+
Bt as setQuestionRequestMessageSchema,
|
|
3423
|
+
Js as updateMediaItem,
|
|
3424
|
+
rn as withBusyIndicator
|
|
3428
3425
|
};
|