@gamaro.io/widget 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/widget.es.js +752 -724
- package/dist/widget.umd.js +15 -15
- package/package.json +5 -5
package/dist/widget.es.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
24
|
* SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
var
|
|
26
|
+
var cr = {
|
|
27
27
|
instant: 0,
|
|
28
28
|
fast: 150,
|
|
29
29
|
base: 250,
|
|
@@ -38,7 +38,7 @@ var ar = {
|
|
|
38
38
|
function ze(e, ...t) {
|
|
39
39
|
console.error(Ze, e, ...t);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function yt(e, ...t) {
|
|
42
42
|
console.warn(Ze, e, ...t);
|
|
43
43
|
}
|
|
44
44
|
function Se(e, ...t) {
|
|
@@ -52,32 +52,32 @@ function ln(e) {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
var fn = "gamaro:", dn = ["https://gamaro.io"];
|
|
55
|
-
function
|
|
55
|
+
function ur(e, t) {
|
|
56
56
|
return t.includes(e);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function lr(e) {
|
|
59
59
|
const t = e.data;
|
|
60
60
|
return typeof t == "object" && t !== null && typeof t.type == "string" && t.type.startsWith(fn);
|
|
61
61
|
}
|
|
62
62
|
function V(e, t, r) {
|
|
63
63
|
if (!e.contentWindow) {
|
|
64
|
-
|
|
64
|
+
yt("Cannot send command: iframe not ready");
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
try {
|
|
68
68
|
e.contentWindow.postMessage(t, r);
|
|
69
69
|
} catch {
|
|
70
|
-
|
|
70
|
+
yt("Failed to post message to iframe");
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
function hn(e) {
|
|
74
74
|
const { allowedOrigins: t = dn, onMessage: r, debug: n, sourceWindow: i } = e, o = (s) => {
|
|
75
75
|
if (!(i && s.source && s.source !== i)) {
|
|
76
|
-
if (!
|
|
76
|
+
if (!ur(s.origin, t)) {
|
|
77
77
|
n && we("Ignored message from untrusted origin:", s.origin);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
if (
|
|
80
|
+
if (lr(s)) {
|
|
81
81
|
if (n) try {
|
|
82
82
|
const a = JSON.parse(JSON.stringify(s.data));
|
|
83
83
|
we("Received message:", a);
|
|
@@ -99,8 +99,8 @@ function Ke(e) {
|
|
|
99
99
|
const t = Object.values(e).filter((r) => typeof r == "number");
|
|
100
100
|
return Object.entries(e).filter(([r, n]) => t.indexOf(+r) === -1).map(([r, n]) => n);
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
return e.map((r) =>
|
|
102
|
+
function wt(e, t = "|") {
|
|
103
|
+
return e.map((r) => gr(r)).join(t);
|
|
104
104
|
}
|
|
105
105
|
function He(e, t) {
|
|
106
106
|
return typeof t == "bigint" ? t.toString() : t;
|
|
@@ -114,13 +114,13 @@ var mn = class {
|
|
|
114
114
|
return e !== void 0 && (this._value = e(), this._getter = void 0), this._value;
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
-
function
|
|
117
|
+
function nt(e) {
|
|
118
118
|
return new mn(e);
|
|
119
119
|
}
|
|
120
120
|
function gn(e) {
|
|
121
121
|
return e == null;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function it(e) {
|
|
124
124
|
const t = e.startsWith("^") ? 1 : 0, r = e.endsWith("$") ? e.length - 1 : e.length;
|
|
125
125
|
return e.slice(t, r);
|
|
126
126
|
}
|
|
@@ -136,14 +136,14 @@ function q(e, t, r) {
|
|
|
136
136
|
configurable: !0
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function fr(e) {
|
|
140
140
|
const t = Object.getOwnPropertyDescriptor(e, "shape");
|
|
141
141
|
return t?.get ? t.get.raw : t?.value;
|
|
142
142
|
}
|
|
143
143
|
function L(e) {
|
|
144
|
-
return
|
|
144
|
+
return fr(e._zod.def) ?? e._zod.def.shape;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function dr(e, t, r) {
|
|
147
147
|
Object.defineProperty(e, t, {
|
|
148
148
|
get() {
|
|
149
149
|
const n = r();
|
|
@@ -153,23 +153,23 @@ function fr(e, t, r) {
|
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function hr(e, t, r) {
|
|
157
157
|
t in e ? q(e, t, r) : e[t] = r;
|
|
158
158
|
}
|
|
159
159
|
function G(e, t, r, n) {
|
|
160
160
|
const i = L(t);
|
|
161
161
|
for (const o of r) {
|
|
162
162
|
const s = Object.getOwnPropertyDescriptor(i, o);
|
|
163
|
-
s.enumerable && (s.get ?
|
|
163
|
+
s.enumerable && (s.get ? dr(e, o, () => {
|
|
164
164
|
const a = t._zod.def.shape[o];
|
|
165
165
|
return n ? n(a, o) : a;
|
|
166
|
-
}) :
|
|
166
|
+
}) : hr(e, o, n ? n(s.value, o) : s.value));
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
function bn(e, t) {
|
|
170
170
|
for (const r of Reflect.ownKeys(t)) {
|
|
171
171
|
const n = Object.getOwnPropertyDescriptor(t, r);
|
|
172
|
-
n.enumerable && (n.get ?
|
|
172
|
+
n.enumerable && (n.get ? dr(e, r, () => t[r]) : hr(e, r, n.value));
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
function Z(...e) {
|
|
@@ -186,12 +186,12 @@ function _n(e) {
|
|
|
186
186
|
function yn(e) {
|
|
187
187
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
188
188
|
}
|
|
189
|
-
var
|
|
189
|
+
var pr = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
190
190
|
};
|
|
191
|
-
function
|
|
191
|
+
function $e(e) {
|
|
192
192
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
193
193
|
}
|
|
194
|
-
var wn = /* @__PURE__ */
|
|
194
|
+
var wn = /* @__PURE__ */ nt(() => {
|
|
195
195
|
if (M.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
|
196
196
|
try {
|
|
197
197
|
return new Function(""), !0;
|
|
@@ -200,13 +200,13 @@ var wn = /* @__PURE__ */ rt(() => {
|
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
202
|
function de(e) {
|
|
203
|
-
if (
|
|
203
|
+
if ($e(e) === !1) return !1;
|
|
204
204
|
const t = e.constructor;
|
|
205
205
|
if (t === void 0 || typeof t != "function") return !0;
|
|
206
206
|
const r = t.prototype;
|
|
207
|
-
return !(
|
|
207
|
+
return !($e(r) === !1 || Object.prototype.hasOwnProperty.call(r, "isPrototypeOf") === !1);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function mr(e) {
|
|
210
210
|
return de(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
|
|
211
211
|
}
|
|
212
212
|
var kn = /* @__PURE__ */ new Set([
|
|
@@ -234,13 +234,13 @@ function g(e) {
|
|
|
234
234
|
error: () => t.error
|
|
235
235
|
} : t;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function gr(e) {
|
|
238
238
|
return typeof e == "bigint" ? e.toString() + "n" : typeof e == "string" ? `"${e}"` : `${e}`;
|
|
239
239
|
}
|
|
240
240
|
function On(e) {
|
|
241
241
|
return Object.keys(e).filter((t) => e[t]._zod.optin !== void 0 && e[t]._zod.optout === "optional");
|
|
242
242
|
}
|
|
243
|
-
var
|
|
243
|
+
var vr = {
|
|
244
244
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
245
245
|
int32: [-2147483648, 2147483647],
|
|
246
246
|
uint32: [0, 4294967295],
|
|
@@ -267,7 +267,7 @@ function Re(e, t) {
|
|
|
267
267
|
}
|
|
268
268
|
return n;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function $n(e, t) {
|
|
271
271
|
const r = e._zod.def, n = r.checks;
|
|
272
272
|
if (n && n.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
273
273
|
const i = new Set(Re(e, t)), o = {};
|
|
@@ -276,22 +276,22 @@ function En(e, t) {
|
|
|
276
276
|
checks: []
|
|
277
277
|
}));
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function En(e, t) {
|
|
280
280
|
if (!de(t)) throw new Error("Invalid input to extend: expected a plain object");
|
|
281
281
|
const r = e._zod.def.checks;
|
|
282
282
|
if (r && r.length > 0) {
|
|
283
283
|
const n = L(e);
|
|
284
284
|
for (const i of Reflect.ownKeys(t)) if (Object.getOwnPropertyDescriptor(n, i) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
285
285
|
}
|
|
286
|
-
return J(e, Z(e._zod.def, { shape:
|
|
286
|
+
return J(e, Z(e._zod.def, { shape: br(e, t) }));
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function br(e, t) {
|
|
289
289
|
const r = {};
|
|
290
290
|
return G(r, e, Reflect.ownKeys(L(e))), bn(r, t), r;
|
|
291
291
|
}
|
|
292
292
|
function In(e, t) {
|
|
293
293
|
if (!de(t)) throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
294
|
-
return J(e, Z(e._zod.def, { shape:
|
|
294
|
+
return J(e, Z(e._zod.def, { shape: br(e, t) }));
|
|
295
295
|
}
|
|
296
296
|
function An(e, t) {
|
|
297
297
|
if (!t?._zod?.def) throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
|
|
@@ -305,7 +305,7 @@ function An(e, t) {
|
|
|
305
305
|
checks: t._zod.def.checks ?? []
|
|
306
306
|
}));
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function kt(e, t, r, n = "partial") {
|
|
309
309
|
const i = t._zod.def.checks;
|
|
310
310
|
if (i && i.length > 0) throw new Error(`.${n}() cannot be used on object schemas containing refinements`);
|
|
311
311
|
const o = r ? new Set(Re(t, r)) : void 0, s = {};
|
|
@@ -334,7 +334,7 @@ function Pn(e, t = 0) {
|
|
|
334
334
|
for (let r = t; r < e.issues.length; r++) if (e.issues[r]?.continue === !1) return !0;
|
|
335
335
|
return !1;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function _r(e, t) {
|
|
338
338
|
return t.map((r) => {
|
|
339
339
|
var n;
|
|
340
340
|
return (n = r).path ?? (n.path = []), r.path.unshift(e), r;
|
|
@@ -343,7 +343,17 @@ function br(e, t) {
|
|
|
343
343
|
function se(e) {
|
|
344
344
|
return typeof e == "string" ? e : e?.message;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Ot(e) {
|
|
347
|
+
const t = [];
|
|
348
|
+
for (const r of e ?? []) {
|
|
349
|
+
const n = r._zod.def;
|
|
350
|
+
if (!/_(length|size)$|_equals$/.test(n.check)) break;
|
|
351
|
+
const i = n.maximum ?? n.length ?? n.size;
|
|
352
|
+
i >= 0 && t.push([i, r]);
|
|
353
|
+
}
|
|
354
|
+
return t;
|
|
355
|
+
}
|
|
356
|
+
function Ge(e, t, r) {
|
|
347
357
|
var n;
|
|
348
358
|
for (let i = t; i < e.length; i++) (n = e[i]).schema ?? (n.schema = r);
|
|
349
359
|
}
|
|
@@ -357,14 +367,14 @@ function te(e, t, r) {
|
|
|
357
367
|
return a.path ?? (a.path = []), a.message = s, t?.reportInput && (a.input = e.input), a;
|
|
358
368
|
}
|
|
359
369
|
var Zn = /[\uD800-\uDBFF]/;
|
|
360
|
-
function
|
|
370
|
+
function ot(e) {
|
|
361
371
|
const t = e.length;
|
|
362
372
|
if (!Zn.test(e)) return t;
|
|
363
373
|
let r = t;
|
|
364
374
|
for (let n = 0; n < t - 1; n++) (e.charCodeAt(n) & 64512) === 55296 && (e.charCodeAt(n + 1) & 64512) === 56320 && (r--, n++);
|
|
365
375
|
return r;
|
|
366
376
|
}
|
|
367
|
-
function
|
|
377
|
+
function st(e) {
|
|
368
378
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
369
379
|
}
|
|
370
380
|
function Cn(e) {
|
|
@@ -407,10 +417,11 @@ function B(e, t, r, n = !0) {
|
|
|
407
417
|
value: r
|
|
408
418
|
}), r;
|
|
409
419
|
}
|
|
410
|
-
function
|
|
420
|
+
function yr(e, t, r) {
|
|
411
421
|
return B(e, t, r, !1);
|
|
412
422
|
}
|
|
413
|
-
|
|
423
|
+
// @__NO_SIDE_EFFECTS__
|
|
424
|
+
function wr(e, t) {
|
|
414
425
|
for (const r in e) {
|
|
415
426
|
const n = e[r];
|
|
416
427
|
Object.defineProperty(t, r, {
|
|
@@ -507,19 +518,19 @@ function Ln(e) {
|
|
|
507
518
|
const t = () => e;
|
|
508
519
|
return t[Dn] = !0, t;
|
|
509
520
|
}
|
|
510
|
-
var
|
|
521
|
+
var zt, Le = {
|
|
511
522
|
value: void 0,
|
|
512
523
|
enumerable: !1
|
|
513
|
-
},
|
|
524
|
+
}, St = "captureStackTrace" in Error ? Error : null;
|
|
514
525
|
function Un(e) {
|
|
515
|
-
const t =
|
|
526
|
+
const t = St;
|
|
516
527
|
if (t) {
|
|
517
528
|
const r = t.stackTraceLimit;
|
|
518
529
|
if (typeof r == "number") {
|
|
519
530
|
try {
|
|
520
531
|
t.stackTraceLimit = 0;
|
|
521
532
|
} catch {
|
|
522
|
-
return
|
|
533
|
+
return St = null, new e();
|
|
523
534
|
}
|
|
524
535
|
try {
|
|
525
536
|
return new e();
|
|
@@ -530,6 +541,7 @@ function Un(e) {
|
|
|
530
541
|
}
|
|
531
542
|
return new e();
|
|
532
543
|
}
|
|
544
|
+
// @__NO_SIDE_EFFECTS__
|
|
533
545
|
function l(e, t, r, n) {
|
|
534
546
|
const i = {};
|
|
535
547
|
function o(h) {
|
|
@@ -580,12 +592,12 @@ var H = class extends Error {
|
|
|
580
592
|
constructor() {
|
|
581
593
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
582
594
|
}
|
|
583
|
-
},
|
|
595
|
+
}, kr = class extends Error {
|
|
584
596
|
constructor(e) {
|
|
585
597
|
super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
|
|
586
598
|
}
|
|
587
599
|
};
|
|
588
|
-
(
|
|
600
|
+
(zt = globalThis).__zod_globalConfig ?? (zt.__zod_globalConfig = {});
|
|
589
601
|
var M = globalThis.__zod_globalConfig;
|
|
590
602
|
function W(e) {
|
|
591
603
|
return e && Object.assign(M, e), M;
|
|
@@ -605,10 +617,10 @@ var Jn = {
|
|
|
605
617
|
}, Ue = {
|
|
606
618
|
value: void 0,
|
|
607
619
|
enumerable: !1
|
|
608
|
-
},
|
|
620
|
+
}, $t = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]), Wn = (e, t) => {
|
|
609
621
|
e.name = "$ZodError", Ue.value = t, Object.defineProperty(e, "issues", Ue), Ue.value = void 0, Object.defineProperty(e, "message", Jn);
|
|
610
622
|
const r = Object.getPrototypeOf(e);
|
|
611
|
-
|
|
623
|
+
$t.has(r) || ($t.add(r), Object.defineProperty(r, "toString", {
|
|
612
624
|
configurable: !0,
|
|
613
625
|
enumerable: !1,
|
|
614
626
|
get() {
|
|
@@ -627,8 +639,8 @@ var Jn = {
|
|
|
627
639
|
});
|
|
628
640
|
}
|
|
629
641
|
}));
|
|
630
|
-
},
|
|
631
|
-
function
|
|
642
|
+
}, Vn = /* @__PURE__ */ l("$ZodError", Wn);
|
|
643
|
+
function Kn(e, t, r) {
|
|
632
644
|
return Object.prototype.hasOwnProperty.call(e, t) || (t === "__proto__" ? Object.defineProperty(e, t, {
|
|
633
645
|
value: r(),
|
|
634
646
|
writable: !0,
|
|
@@ -636,15 +648,15 @@ function Vn(e, t, r) {
|
|
|
636
648
|
configurable: !0
|
|
637
649
|
}) : e[t] = r()), e[t];
|
|
638
650
|
}
|
|
639
|
-
function
|
|
651
|
+
function Hn(e, t = (r) => r.message) {
|
|
640
652
|
const r = {}, n = [];
|
|
641
|
-
for (const i of e.issues) i.path.length > 0 ?
|
|
653
|
+
for (const i of e.issues) i.path.length > 0 ? Kn(r, i.path[0], () => []).push(t(i)) : n.push(t(i));
|
|
642
654
|
return {
|
|
643
655
|
formErrors: n,
|
|
644
656
|
fieldErrors: r
|
|
645
657
|
};
|
|
646
658
|
}
|
|
647
|
-
function
|
|
659
|
+
function Gn(e, t = (r) => r.message) {
|
|
648
660
|
const r = { _errors: [] }, n = (i, o = []) => {
|
|
649
661
|
for (const s of i.issues) if (s.code === "invalid_union" && s.errors.length) s.errors.map((a) => n({ issues: a }, [...o, ...s.path]));
|
|
650
662
|
else if (s.code === "invalid_key") n({ issues: s.issues }, [...o, ...s.path]);
|
|
@@ -680,7 +692,7 @@ function Ne(e, t) {
|
|
|
680
692
|
Err: t?.Err
|
|
681
693
|
};
|
|
682
694
|
}
|
|
683
|
-
var
|
|
695
|
+
var at = (e) => {
|
|
684
696
|
const t = (r, n, i, o) => {
|
|
685
697
|
const s = i ? {
|
|
686
698
|
...i,
|
|
@@ -692,12 +704,12 @@ var st = (e) => {
|
|
|
692
704
|
if (a instanceof Promise) throw new H();
|
|
693
705
|
if (a.issues.length) {
|
|
694
706
|
const c = new (o?.Err ?? e)(a.issues.map((u) => te(u, s, W())));
|
|
695
|
-
throw
|
|
707
|
+
throw pr(c, o?.callee ?? t), c;
|
|
696
708
|
}
|
|
697
709
|
return a.value;
|
|
698
710
|
};
|
|
699
711
|
return t;
|
|
700
|
-
},
|
|
712
|
+
}, ct = (e) => {
|
|
701
713
|
const t = async (r, n, i, o) => {
|
|
702
714
|
const s = i ? {
|
|
703
715
|
...i,
|
|
@@ -709,12 +721,12 @@ var st = (e) => {
|
|
|
709
721
|
}, s);
|
|
710
722
|
if (a instanceof Promise && (a = await a), a.issues.length) {
|
|
711
723
|
const c = new (o?.Err ?? e)(a.issues.map((u) => te(u, s, W())));
|
|
712
|
-
throw
|
|
724
|
+
throw pr(c, o?.callee ?? t), c;
|
|
713
725
|
}
|
|
714
726
|
return a.value;
|
|
715
727
|
};
|
|
716
728
|
return t;
|
|
717
|
-
},
|
|
729
|
+
}, ut = (e) => (t, r, n) => {
|
|
718
730
|
const i = n ? {
|
|
719
731
|
...n,
|
|
720
732
|
async: !1
|
|
@@ -740,7 +752,7 @@ function Or(e, t, r) {
|
|
|
740
752
|
}
|
|
741
753
|
};
|
|
742
754
|
}
|
|
743
|
-
var
|
|
755
|
+
var lt = (e) => async (t, r, n) => {
|
|
744
756
|
const i = n ? {
|
|
745
757
|
...n,
|
|
746
758
|
async: !0
|
|
@@ -753,15 +765,15 @@ var ut = (e) => async (t, r, n) => {
|
|
|
753
765
|
success: !0,
|
|
754
766
|
data: o.value
|
|
755
767
|
};
|
|
756
|
-
},
|
|
768
|
+
}, qn = /* @__PURE__ */ Symbol.for("zod.compile.invalid"), Yn = /* @__PURE__ */ Symbol.for("zod.compile.fallback"), Xn = ((e, t, r) => {
|
|
757
769
|
const n = e._zod.bag.validator;
|
|
758
770
|
if (n !== void 0) {
|
|
759
|
-
if (n(t) !==
|
|
771
|
+
if (n(t) !== qn) return !0;
|
|
760
772
|
if (n.definite === !0 && r === void 0) return !1;
|
|
761
773
|
}
|
|
762
|
-
return
|
|
774
|
+
return Qn(e, t, r);
|
|
763
775
|
});
|
|
764
|
-
function
|
|
776
|
+
function Qn(e, t, r) {
|
|
765
777
|
const n = r ? {
|
|
766
778
|
...r,
|
|
767
779
|
async: !1,
|
|
@@ -771,7 +783,7 @@ function Xn(e, t, r) {
|
|
|
771
783
|
abortEarly: !0
|
|
772
784
|
}, i = e._zod.bag.fallbackRun;
|
|
773
785
|
let o;
|
|
774
|
-
if (i ? (n[
|
|
786
|
+
if (i ? (n[Yn] = !0, o = i({
|
|
775
787
|
value: t,
|
|
776
788
|
issues: []
|
|
777
789
|
}, n)) : o = e._zod.run({
|
|
@@ -780,7 +792,7 @@ function Xn(e, t, r) {
|
|
|
780
792
|
}, n), o instanceof Promise) throw new H();
|
|
781
793
|
return o.issues.length === 0;
|
|
782
794
|
}
|
|
783
|
-
var
|
|
795
|
+
var ei = async (e, t, r) => {
|
|
784
796
|
const n = r ? {
|
|
785
797
|
...r,
|
|
786
798
|
async: !0,
|
|
@@ -794,8 +806,8 @@ var Qn = async (e, t, r) => {
|
|
|
794
806
|
issues: []
|
|
795
807
|
}, n);
|
|
796
808
|
return i instanceof Promise && (i = await i), i.issues.length === 0;
|
|
797
|
-
},
|
|
798
|
-
const t =
|
|
809
|
+
}, ti = (e) => {
|
|
810
|
+
const t = at(e), r = (n, i, o, s) => {
|
|
799
811
|
const a = o ? {
|
|
800
812
|
...o,
|
|
801
813
|
direction: "backward"
|
|
@@ -803,11 +815,11 @@ var Qn = async (e, t, r) => {
|
|
|
803
815
|
return t(n, i, a, Ne(r, s));
|
|
804
816
|
};
|
|
805
817
|
return r;
|
|
806
|
-
}, ti = (e) => {
|
|
807
|
-
const t = st(e), r = (n, i, o, s) => t(n, i, o, Ne(r, s));
|
|
808
|
-
return r;
|
|
809
818
|
}, ri = (e) => {
|
|
810
|
-
const t = at(e), r =
|
|
819
|
+
const t = at(e), r = (n, i, o, s) => t(n, i, o, Ne(r, s));
|
|
820
|
+
return r;
|
|
821
|
+
}, ni = (e) => {
|
|
822
|
+
const t = ct(e), r = async (n, i, o, s) => {
|
|
811
823
|
const a = o ? {
|
|
812
824
|
...o,
|
|
813
825
|
direction: "backward"
|
|
@@ -815,66 +827,66 @@ var Qn = async (e, t, r) => {
|
|
|
815
827
|
return await t(n, i, a, Ne(r, s));
|
|
816
828
|
};
|
|
817
829
|
return r;
|
|
818
|
-
},
|
|
819
|
-
const t =
|
|
830
|
+
}, ii = (e) => {
|
|
831
|
+
const t = ct(e), r = async (n, i, o, s) => await t(n, i, o, Ne(r, s));
|
|
820
832
|
return r;
|
|
821
|
-
},
|
|
833
|
+
}, oi = (e) => (t, r, n) => {
|
|
822
834
|
const i = n ? {
|
|
823
835
|
...n,
|
|
824
836
|
direction: "backward"
|
|
825
837
|
} : { direction: "backward" };
|
|
826
|
-
return
|
|
827
|
-
},
|
|
838
|
+
return ut(e)(t, r, i);
|
|
839
|
+
}, si = (e) => (t, r, n) => ut(e)(t, r, n), ai = (e) => async (t, r, n) => {
|
|
828
840
|
const i = n ? {
|
|
829
841
|
...n,
|
|
830
842
|
direction: "backward"
|
|
831
843
|
} : { direction: "backward" };
|
|
832
|
-
return
|
|
833
|
-
},
|
|
834
|
-
function
|
|
844
|
+
return lt(e)(t, r, i);
|
|
845
|
+
}, ci = (e) => async (t, r, n) => lt(e)(t, r, n), ui = /^[cC][0-9a-z]{6,}$/, li = /^[0-9a-z]+$/, fi = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/, di = /^[0-9a-vA-V]{20}$/, hi = /^[A-Za-z0-9]{27}$/, pi = /^[a-zA-Z0-9_-]{21}$/;
|
|
846
|
+
function mi(e) {
|
|
835
847
|
return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`);
|
|
836
848
|
}
|
|
837
|
-
var
|
|
838
|
-
function
|
|
839
|
-
return new RegExp(
|
|
849
|
+
var gi = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, vi = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Et = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, bi = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, _i = "^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";
|
|
850
|
+
function yi() {
|
|
851
|
+
return new RegExp(_i, "u");
|
|
840
852
|
}
|
|
841
|
-
var
|
|
842
|
-
function
|
|
853
|
+
var wi = /^(?:(?: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])$/, ki = /^(([0-9a-fA-F]{1,4}:){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}|:))$/, Oi = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, zi = /^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Si = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, $i = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/, Ei = /^https?$/, Ii = /^\+[1-9]\d{6,14}$/, zr = "(?:(?:\\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])))";
|
|
854
|
+
function Ai(e) {
|
|
843
855
|
return new RegExp(`^${e}$`);
|
|
844
856
|
}
|
|
845
|
-
var
|
|
846
|
-
function
|
|
857
|
+
var Ti = /* @__PURE__ */ Ai(zr);
|
|
858
|
+
function qe(e) {
|
|
847
859
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
848
860
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : e.seconds ? `${t}:[0-5]\\d(?:\\.\\d+)?` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
849
861
|
}
|
|
850
|
-
function Ti(e) {
|
|
851
|
-
return new RegExp(`^${Ge(e)}$`);
|
|
852
|
-
}
|
|
853
862
|
function Pi(e) {
|
|
863
|
+
return new RegExp(`^${qe(e)}$`);
|
|
864
|
+
}
|
|
865
|
+
function Zi(e) {
|
|
854
866
|
const t = ["Z"];
|
|
855
867
|
e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
856
|
-
const r = `${
|
|
868
|
+
const r = `${qe({
|
|
857
869
|
precision: e.precision,
|
|
858
870
|
seconds: !0
|
|
859
|
-
})}(?:${t.join("|")})`, n = e.local ? `${r}|${
|
|
871
|
+
})}(?:${t.join("|")})`, n = e.local ? `${r}|${qe({ precision: e.precision })}` : r;
|
|
860
872
|
return new RegExp(`^${zr}T(?:${n})$`);
|
|
861
873
|
}
|
|
862
|
-
var
|
|
874
|
+
var Ci = /^[\s\S]{0,}$/, Ri = /^-?\d+(?:\.\d+)?$/, Ni = /^(?:true|false)$/i, ji = /^[^A-Z]*$/, xi = /^[^a-z]*$/, T = /* @__PURE__ */ l("$ZodCheck", (e, t) => {
|
|
863
875
|
var r;
|
|
864
876
|
e._zod ?? (e._zod = {}), e._zod.def = t, (r = e._zod).onattach ?? (r.onattach = []);
|
|
865
|
-
}),
|
|
877
|
+
}), ft = (e) => {
|
|
866
878
|
const t = e.value;
|
|
867
879
|
return !gn(t) && t.length !== void 0;
|
|
868
|
-
},
|
|
880
|
+
}, Ee = {
|
|
869
881
|
number: "number",
|
|
870
882
|
bigint: "bigint",
|
|
871
883
|
object: "date"
|
|
872
884
|
}, Sr = /* @__PURE__ */ l("$ZodCheckLessThan", (e, t) => {
|
|
873
885
|
T.init(e, t);
|
|
874
|
-
const r =
|
|
886
|
+
const r = Ee[typeof t.value];
|
|
875
887
|
e._zod.check = (n) => {
|
|
876
888
|
(t.inclusive ? n.value <= t.value : n.value < t.value) || n.issues.push({
|
|
877
|
-
origin:
|
|
889
|
+
origin: Ee[typeof n.value] ?? r,
|
|
878
890
|
code: "too_big",
|
|
879
891
|
maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
880
892
|
input: n.value,
|
|
@@ -883,12 +895,12 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
883
895
|
continue: !t.abort
|
|
884
896
|
});
|
|
885
897
|
};
|
|
886
|
-
}),
|
|
898
|
+
}), $r = /* @__PURE__ */ l("$ZodCheckGreaterThan", (e, t) => {
|
|
887
899
|
T.init(e, t);
|
|
888
|
-
const r =
|
|
900
|
+
const r = Ee[typeof t.value];
|
|
889
901
|
e._zod.check = (n) => {
|
|
890
902
|
(t.inclusive ? n.value >= t.value : n.value > t.value) || n.issues.push({
|
|
891
|
-
origin:
|
|
903
|
+
origin: Ee[typeof n.value] ?? r,
|
|
892
904
|
code: "too_small",
|
|
893
905
|
minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
894
906
|
input: n.value,
|
|
@@ -897,7 +909,7 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
897
909
|
continue: !t.abort
|
|
898
910
|
});
|
|
899
911
|
};
|
|
900
|
-
}),
|
|
912
|
+
}), Mi = /* @__PURE__ */ l("$ZodCheckMultipleOf", (e, t) => {
|
|
901
913
|
T.init(e, t), e._zod.check = (r) => {
|
|
902
914
|
if (typeof r.value != typeof t.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
903
915
|
(typeof r.value == "bigint" ? t.value !== BigInt(0) && r.value % t.value === BigInt(0) : vn(r.value, t.value) === 0) || r.issues.push({
|
|
@@ -909,9 +921,9 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
909
921
|
continue: !t.abort
|
|
910
922
|
});
|
|
911
923
|
};
|
|
912
|
-
}),
|
|
924
|
+
}), Di = /* @__PURE__ */ l("$ZodCheckNumberFormat", (e, t) => {
|
|
913
925
|
T.init(e, t), t.format = t.format || "float64";
|
|
914
|
-
const r = t.format?.includes("int"), n = r ? "int" : "number", [i, o] =
|
|
926
|
+
const r = t.format?.includes("int"), n = r ? "int" : "number", [i, o] = vr[t.format];
|
|
915
927
|
e._zod.check = (s) => {
|
|
916
928
|
const a = s.value;
|
|
917
929
|
if (r) {
|
|
@@ -967,12 +979,12 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
967
979
|
continue: !t.abort
|
|
968
980
|
});
|
|
969
981
|
};
|
|
970
|
-
}),
|
|
982
|
+
}), Li = /* @__PURE__ */ l("$ZodCheckMaxLength", (e, t) => {
|
|
971
983
|
var r;
|
|
972
|
-
T.init(e, t), (r = e._zod.def).when ?? (r.when =
|
|
984
|
+
T.init(e, t), (r = e._zod.def).when ?? (r.when = ft), e._zod.check = (n) => {
|
|
973
985
|
const i = n.value, o = i.length;
|
|
974
|
-
if ((typeof i == "string" && o > t.maximum ?
|
|
975
|
-
const s =
|
|
986
|
+
if ((typeof i == "string" && o > t.maximum ? ot(i) : o) <= t.maximum) return;
|
|
987
|
+
const s = st(i);
|
|
976
988
|
n.issues.push({
|
|
977
989
|
origin: s,
|
|
978
990
|
code: "too_big",
|
|
@@ -983,12 +995,12 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
983
995
|
continue: !t.abort
|
|
984
996
|
});
|
|
985
997
|
};
|
|
986
|
-
}),
|
|
998
|
+
}), Ui = /* @__PURE__ */ l("$ZodCheckMinLength", (e, t) => {
|
|
987
999
|
var r;
|
|
988
|
-
T.init(e, t), (r = e._zod.def).when ?? (r.when =
|
|
1000
|
+
T.init(e, t), (r = e._zod.def).when ?? (r.when = ft), e._zod.check = (n) => {
|
|
989
1001
|
const i = n.value, o = i.length;
|
|
990
|
-
if ((typeof i == "string" && o >= t.minimum && o < t.minimum * 2 ?
|
|
991
|
-
const s =
|
|
1002
|
+
if ((typeof i == "string" && o >= t.minimum && o < t.minimum * 2 ? ot(i) : o) >= t.minimum) return;
|
|
1003
|
+
const s = st(i);
|
|
992
1004
|
n.issues.push({
|
|
993
1005
|
origin: s,
|
|
994
1006
|
code: "too_small",
|
|
@@ -999,12 +1011,12 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
999
1011
|
continue: !t.abort
|
|
1000
1012
|
});
|
|
1001
1013
|
};
|
|
1002
|
-
}),
|
|
1014
|
+
}), Fi = /* @__PURE__ */ l("$ZodCheckLengthEquals", (e, t) => {
|
|
1003
1015
|
var r;
|
|
1004
|
-
T.init(e, t), (r = e._zod.def).when ?? (r.when =
|
|
1005
|
-
const i = n.value, o = i.length, s = typeof i == "string" && o >= t.length && o <= t.length * 2 ?
|
|
1016
|
+
T.init(e, t), (r = e._zod.def).when ?? (r.when = ft), e._zod.check = (n) => {
|
|
1017
|
+
const i = n.value, o = i.length, s = typeof i == "string" && o >= t.length && o <= t.length * 2 ? ot(i) : o;
|
|
1006
1018
|
if (s === t.length) return;
|
|
1007
|
-
const a =
|
|
1019
|
+
const a = st(i), c = s > t.length;
|
|
1008
1020
|
n.issues.push({
|
|
1009
1021
|
origin: a,
|
|
1010
1022
|
...c ? {
|
|
@@ -1035,7 +1047,7 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
1035
1047
|
});
|
|
1036
1048
|
}) : (n = e._zod).check ?? (n.check = () => {
|
|
1037
1049
|
});
|
|
1038
|
-
}),
|
|
1050
|
+
}), Bi = /* @__PURE__ */ l("$ZodCheckRegex", (e, t) => {
|
|
1039
1051
|
je.init(e, t), e._zod.check = (r) => {
|
|
1040
1052
|
t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
|
|
1041
1053
|
origin: "string",
|
|
@@ -1047,11 +1059,11 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
1047
1059
|
continue: !t.abort
|
|
1048
1060
|
});
|
|
1049
1061
|
};
|
|
1050
|
-
}),
|
|
1051
|
-
t.pattern ?? (t.pattern = Ni), je.init(e, t);
|
|
1052
|
-
}), Ji = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
|
|
1062
|
+
}), Ji = /* @__PURE__ */ l("$ZodCheckLowerCase", (e, t) => {
|
|
1053
1063
|
t.pattern ?? (t.pattern = ji), je.init(e, t);
|
|
1054
|
-
}), Wi = /* @__PURE__ */ l("$
|
|
1064
|
+
}), Wi = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
|
|
1065
|
+
t.pattern ?? (t.pattern = xi), je.init(e, t);
|
|
1066
|
+
}), Vi = /* @__PURE__ */ l("$ZodCheckIncludes", (e, t) => {
|
|
1055
1067
|
T.init(e, t);
|
|
1056
1068
|
const r = Ce(t.includes);
|
|
1057
1069
|
t.pattern = new RegExp(typeof t.position == "number" ? `^.{${t.position},}${r}` : r), e._zod.check = (n) => {
|
|
@@ -1065,7 +1077,7 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
1065
1077
|
continue: !t.abort
|
|
1066
1078
|
});
|
|
1067
1079
|
};
|
|
1068
|
-
}),
|
|
1080
|
+
}), Ki = /* @__PURE__ */ l("$ZodCheckStartsWith", (e, t) => {
|
|
1069
1081
|
T.init(e, t);
|
|
1070
1082
|
const r = new RegExp(`^${Ce(t.prefix)}.*`);
|
|
1071
1083
|
t.pattern ?? (t.pattern = r), e._zod.check = (n) => {
|
|
@@ -1079,7 +1091,7 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
1079
1091
|
continue: !t.abort
|
|
1080
1092
|
});
|
|
1081
1093
|
};
|
|
1082
|
-
}),
|
|
1094
|
+
}), Hi = /* @__PURE__ */ l("$ZodCheckEndsWith", (e, t) => {
|
|
1083
1095
|
T.init(e, t);
|
|
1084
1096
|
const r = new RegExp(`.*${Ce(t.suffix)}$`);
|
|
1085
1097
|
t.pattern ?? (t.pattern = r), e._zod.check = (n) => {
|
|
@@ -1093,11 +1105,11 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
1093
1105
|
continue: !t.abort
|
|
1094
1106
|
});
|
|
1095
1107
|
};
|
|
1096
|
-
}),
|
|
1108
|
+
}), Gi = /* @__PURE__ */ l("$ZodCheckOverwrite", (e, t) => {
|
|
1097
1109
|
T.init(e, t), e._zod.check = (r) => {
|
|
1098
1110
|
r.value = t.tx(r.value);
|
|
1099
1111
|
};
|
|
1100
|
-
}),
|
|
1112
|
+
}), qi = class {
|
|
1101
1113
|
constructor(e = [], t = {}) {
|
|
1102
1114
|
this.content = [], this.indent = 0, this.args = e, this.closed = t;
|
|
1103
1115
|
}
|
|
@@ -1125,13 +1137,13 @@ ${t.join(`
|
|
|
1125
1137
|
`)}
|
|
1126
1138
|
};`)(...Object.values(this.closed));
|
|
1127
1139
|
}
|
|
1128
|
-
},
|
|
1140
|
+
}, Yi = {
|
|
1129
1141
|
major: 4,
|
|
1130
1142
|
minor: 6,
|
|
1131
|
-
patch:
|
|
1143
|
+
patch: 6
|
|
1132
1144
|
}, S = /* @__PURE__ */ l("$ZodType", (e, t) => {
|
|
1133
1145
|
var r;
|
|
1134
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
1146
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Yi;
|
|
1135
1147
|
const n = e._zod.def.checks, i = e._zod.traits.has("$ZodCheck") ? [e, ...n ?? []] : n?.length ? [...n] : [];
|
|
1136
1148
|
for (const o of i) for (const s of o._zod.onattach) s(e);
|
|
1137
1149
|
if (i.length === 0)
|
|
@@ -1149,11 +1161,11 @@ ${t.join(`
|
|
|
1149
1161
|
const p = a.issues.length, m = h._zod.check(a);
|
|
1150
1162
|
if (m instanceof Promise && u?.async === !1) throw new H();
|
|
1151
1163
|
if (d || m instanceof Promise) d = (d ?? Promise.resolve()).then(async () => {
|
|
1152
|
-
await m, a.issues.length !== p && (
|
|
1164
|
+
await m, a.issues.length !== p && (Ge(a.issues, p, e), f || (f = D(a, p)));
|
|
1153
1165
|
});
|
|
1154
1166
|
else {
|
|
1155
1167
|
if (a.issues.length === p) continue;
|
|
1156
|
-
|
|
1168
|
+
Ge(a.issues, p, e), f || (f = D(a, p));
|
|
1157
1169
|
}
|
|
1158
1170
|
}
|
|
1159
1171
|
return d ? d.then(() => a) : a;
|
|
@@ -1189,15 +1201,15 @@ ${t.join(`
|
|
|
1189
1201
|
}
|
|
1190
1202
|
}, {
|
|
1191
1203
|
get "~standard"() {
|
|
1192
|
-
return
|
|
1204
|
+
return yr(this, "~standard", Ir(this));
|
|
1193
1205
|
},
|
|
1194
1206
|
set "~standard"(e) {
|
|
1195
1207
|
B(this, "~standard", e);
|
|
1196
1208
|
}
|
|
1197
|
-
}),
|
|
1198
|
-
async function
|
|
1209
|
+
}), Er = (e, t) => e.issues.length ? { issues: e.issues.map((r) => te(r, t, W())) } : { value: e.value };
|
|
1210
|
+
async function Xi(e, t) {
|
|
1199
1211
|
const r = { async: !0 };
|
|
1200
|
-
return
|
|
1212
|
+
return Er(await e._zod.run({
|
|
1201
1213
|
value: t,
|
|
1202
1214
|
issues: []
|
|
1203
1215
|
}, r), r);
|
|
@@ -1211,17 +1223,17 @@ function Ir(e) {
|
|
|
1211
1223
|
value: t,
|
|
1212
1224
|
issues: []
|
|
1213
1225
|
}, r);
|
|
1214
|
-
if (!(n instanceof Promise)) return
|
|
1226
|
+
if (!(n instanceof Promise)) return Er(n, r);
|
|
1215
1227
|
} catch {
|
|
1216
1228
|
}
|
|
1217
|
-
return
|
|
1229
|
+
return Xi(e, t);
|
|
1218
1230
|
},
|
|
1219
1231
|
vendor: "zod",
|
|
1220
1232
|
version: 1
|
|
1221
1233
|
};
|
|
1222
1234
|
}
|
|
1223
|
-
var
|
|
1224
|
-
S.init(e, t), e._zod.pattern = t.pattern ??
|
|
1235
|
+
var dt = /* @__PURE__ */ l("$ZodString", (e, t) => {
|
|
1236
|
+
S.init(e, t), e._zod.pattern = t.pattern ?? Ci, e._zod.parse = (r, n) => {
|
|
1225
1237
|
if (t.coerce) try {
|
|
1226
1238
|
r.value = String(r.value);
|
|
1227
1239
|
} catch {
|
|
@@ -1234,10 +1246,10 @@ var ft = /* @__PURE__ */ l("$ZodString", (e, t) => {
|
|
|
1234
1246
|
}), r;
|
|
1235
1247
|
};
|
|
1236
1248
|
}), O = /* @__PURE__ */ l("$ZodStringFormat", (e, t) => {
|
|
1237
|
-
je.init(e, t),
|
|
1238
|
-
}),
|
|
1239
|
-
t.pattern ?? (t.pattern =
|
|
1240
|
-
}),
|
|
1249
|
+
je.init(e, t), dt.init(e, t);
|
|
1250
|
+
}), Qi = /* @__PURE__ */ l("$ZodGUID", (e, t) => {
|
|
1251
|
+
t.pattern ?? (t.pattern = vi), O.init(e, t);
|
|
1252
|
+
}), eo = /* @__PURE__ */ l("$ZodUUID", (e, t) => {
|
|
1241
1253
|
if (t.version) {
|
|
1242
1254
|
const r = {
|
|
1243
1255
|
v1: 1,
|
|
@@ -1253,8 +1265,8 @@ var ft = /* @__PURE__ */ l("$ZodString", (e, t) => {
|
|
|
1253
1265
|
t.pattern ?? (t.pattern = Et(r));
|
|
1254
1266
|
} else t.pattern ?? (t.pattern = Et());
|
|
1255
1267
|
O.init(e, t);
|
|
1256
|
-
}),
|
|
1257
|
-
t.pattern ?? (t.pattern =
|
|
1268
|
+
}), to = /* @__PURE__ */ l("$ZodEmail", (e, t) => {
|
|
1269
|
+
t.pattern ?? (t.pattern = bi), O.init(e, t);
|
|
1258
1270
|
});
|
|
1259
1271
|
function Ar(e) {
|
|
1260
1272
|
try {
|
|
@@ -1263,10 +1275,10 @@ function Ar(e) {
|
|
|
1263
1275
|
return !1;
|
|
1264
1276
|
}
|
|
1265
1277
|
}
|
|
1266
|
-
function to(e, t) {
|
|
1267
|
-
return !("normalize" in t) && !("hostname" in t) && !("protocol" in t) ? Ar(e) || 2 : ro(e, t);
|
|
1268
|
-
}
|
|
1269
1278
|
function ro(e, t) {
|
|
1279
|
+
return !("normalize" in t) && !("hostname" in t) && !("protocol" in t) ? Ar(e) || 2 : no(e, t);
|
|
1280
|
+
}
|
|
1281
|
+
function no(e, t) {
|
|
1270
1282
|
if (!t.normalize && t.protocol?.source === Ei.source && !/^https?:\/\//i.test(e)) return 1;
|
|
1271
1283
|
try {
|
|
1272
1284
|
if (typeof URL < "u") {
|
|
@@ -1278,20 +1290,20 @@ function ro(e, t) {
|
|
|
1278
1290
|
return 2;
|
|
1279
1291
|
}
|
|
1280
1292
|
}
|
|
1281
|
-
var
|
|
1282
|
-
function
|
|
1283
|
-
return e.replace(
|
|
1293
|
+
var io = /[\t\n\r]/g;
|
|
1294
|
+
function It(e) {
|
|
1295
|
+
return e.replace(io, "");
|
|
1284
1296
|
}
|
|
1285
|
-
function
|
|
1297
|
+
function oo(e, t) {
|
|
1286
1298
|
return t.lastIndex = 0, t.test(e.hostname);
|
|
1287
1299
|
}
|
|
1288
|
-
function
|
|
1300
|
+
function so(e, t) {
|
|
1289
1301
|
return t.lastIndex = 0, t.test(e.protocol.endsWith(":") ? e.protocol.slice(0, -1) : e.protocol);
|
|
1290
1302
|
}
|
|
1291
|
-
var
|
|
1303
|
+
var ao = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
1292
1304
|
O.init(e, t), e._zod.check = (r) => {
|
|
1293
1305
|
try {
|
|
1294
|
-
const n = r.value.trim(), i =
|
|
1306
|
+
const n = r.value.trim(), i = ro(n, t);
|
|
1295
1307
|
if (i === 1) {
|
|
1296
1308
|
r.issues.push({
|
|
1297
1309
|
code: "invalid_format",
|
|
@@ -1314,10 +1326,10 @@ var so = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
|
1314
1326
|
return;
|
|
1315
1327
|
}
|
|
1316
1328
|
if (i === !0) {
|
|
1317
|
-
r.value =
|
|
1329
|
+
r.value = It(n);
|
|
1318
1330
|
return;
|
|
1319
1331
|
}
|
|
1320
|
-
t.hostname && !
|
|
1332
|
+
t.hostname && !oo(i, t.hostname) && r.issues.push({
|
|
1321
1333
|
code: "invalid_format",
|
|
1322
1334
|
format: "url",
|
|
1323
1335
|
note: "Invalid hostname",
|
|
@@ -1325,7 +1337,7 @@ var so = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
|
1325
1337
|
input: r.value,
|
|
1326
1338
|
inst: e,
|
|
1327
1339
|
continue: !t.abort
|
|
1328
|
-
}), t.protocol && !
|
|
1340
|
+
}), t.protocol && !so(i, t.protocol) && r.issues.push({
|
|
1329
1341
|
code: "invalid_format",
|
|
1330
1342
|
format: "url",
|
|
1331
1343
|
note: "Invalid protocol",
|
|
@@ -1333,7 +1345,7 @@ var so = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
|
1333
1345
|
input: r.value,
|
|
1334
1346
|
inst: e,
|
|
1335
1347
|
continue: !t.abort
|
|
1336
|
-
}), r.value = t.normalize ? i.href :
|
|
1348
|
+
}), r.value = t.normalize ? i.href : It(n);
|
|
1337
1349
|
return;
|
|
1338
1350
|
} catch {
|
|
1339
1351
|
r.issues.push({
|
|
@@ -1345,37 +1357,37 @@ var so = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
|
1345
1357
|
});
|
|
1346
1358
|
}
|
|
1347
1359
|
};
|
|
1348
|
-
}),
|
|
1349
|
-
t.pattern ?? (t.pattern =
|
|
1350
|
-
}),
|
|
1360
|
+
}), co = /* @__PURE__ */ l("$ZodEmoji", (e, t) => {
|
|
1361
|
+
t.pattern ?? (t.pattern = yi()), O.init(e, t);
|
|
1362
|
+
}), uo = /* @__PURE__ */ l("$ZodNanoID", (e, t) => {
|
|
1351
1363
|
if (t.length !== void 0 && (!Number.isInteger(t.length) || t.length < 1)) throw new Error(`Invalid nanoid length: ${t.length}`);
|
|
1352
|
-
t.pattern ?? (t.pattern = t.length === void 0 ?
|
|
1353
|
-
}),
|
|
1354
|
-
t.pattern ?? (t.pattern = ci), O.init(e, t);
|
|
1355
|
-
}), lo = /* @__PURE__ */ l("$ZodCUID2", (e, t) => {
|
|
1364
|
+
t.pattern ?? (t.pattern = t.length === void 0 ? pi : mi(t.length)), O.init(e, t);
|
|
1365
|
+
}), lo = /* @__PURE__ */ l("$ZodCUID", (e, t) => {
|
|
1356
1366
|
t.pattern ?? (t.pattern = ui), O.init(e, t);
|
|
1357
|
-
}), fo = /* @__PURE__ */ l("$
|
|
1367
|
+
}), fo = /* @__PURE__ */ l("$ZodCUID2", (e, t) => {
|
|
1358
1368
|
t.pattern ?? (t.pattern = li), O.init(e, t);
|
|
1359
|
-
}), ho = /* @__PURE__ */ l("$
|
|
1369
|
+
}), ho = /* @__PURE__ */ l("$ZodULID", (e, t) => {
|
|
1360
1370
|
t.pattern ?? (t.pattern = fi), O.init(e, t);
|
|
1361
|
-
}), po = /* @__PURE__ */ l("$
|
|
1371
|
+
}), po = /* @__PURE__ */ l("$ZodXID", (e, t) => {
|
|
1362
1372
|
t.pattern ?? (t.pattern = di), O.init(e, t);
|
|
1363
|
-
}), mo = /* @__PURE__ */ l("$
|
|
1373
|
+
}), mo = /* @__PURE__ */ l("$ZodKSUID", (e, t) => {
|
|
1374
|
+
t.pattern ?? (t.pattern = hi), O.init(e, t);
|
|
1375
|
+
}), go = /* @__PURE__ */ l("$ZodISODateTime", (e, t) => {
|
|
1376
|
+
t.pattern ?? (t.pattern = Zi(t)), O.init(e, t);
|
|
1377
|
+
}), vo = /* @__PURE__ */ l("$ZodISODate", (e, t) => {
|
|
1378
|
+
t.pattern ?? (t.pattern = Ti), O.init(e, t);
|
|
1379
|
+
}), bo = /* @__PURE__ */ l("$ZodISOTime", (e, t) => {
|
|
1364
1380
|
t.pattern ?? (t.pattern = Pi(t)), O.init(e, t);
|
|
1365
|
-
}),
|
|
1366
|
-
t.pattern ?? (t.pattern =
|
|
1367
|
-
}),
|
|
1368
|
-
t.pattern ?? (t.pattern =
|
|
1369
|
-
}),
|
|
1370
|
-
t.pattern ?? (t.pattern = mi), O.init(e, t);
|
|
1371
|
-
}), _o = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
|
|
1372
|
-
t.pattern ?? (t.pattern = yi), O.init(e, t);
|
|
1373
|
-
}), yo = /^[0-9a-fA-F:.]+$/;
|
|
1381
|
+
}), _o = /* @__PURE__ */ l("$ZodISODuration", (e, t) => {
|
|
1382
|
+
t.pattern ?? (t.pattern = gi), O.init(e, t);
|
|
1383
|
+
}), yo = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
|
|
1384
|
+
t.pattern ?? (t.pattern = wi), O.init(e, t);
|
|
1385
|
+
}), wo = /^[0-9a-fA-F:.]+$/;
|
|
1374
1386
|
function Tr(e) {
|
|
1375
|
-
return
|
|
1387
|
+
return wo.test(e) ? Ar(`http://[${e}]`) : !1;
|
|
1376
1388
|
}
|
|
1377
|
-
var
|
|
1378
|
-
t.pattern ?? (t.pattern =
|
|
1389
|
+
var ko = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
|
|
1390
|
+
t.pattern ?? (t.pattern = ki), O.init(e, t), e._zod.check = (r) => {
|
|
1379
1391
|
Tr(r.value) || r.issues.push({
|
|
1380
1392
|
code: "invalid_format",
|
|
1381
1393
|
format: "ipv6",
|
|
@@ -1384,10 +1396,10 @@ var wo = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
|
|
|
1384
1396
|
continue: !t.abort
|
|
1385
1397
|
});
|
|
1386
1398
|
};
|
|
1387
|
-
}),
|
|
1388
|
-
t.pattern ?? (t.pattern =
|
|
1399
|
+
}), Oo = /* @__PURE__ */ l("$ZodCIDRv4", (e, t) => {
|
|
1400
|
+
t.pattern ?? (t.pattern = Oi), O.init(e, t);
|
|
1389
1401
|
});
|
|
1390
|
-
function
|
|
1402
|
+
function zo(e) {
|
|
1391
1403
|
const t = e.split("/");
|
|
1392
1404
|
if (t.length !== 2) return !1;
|
|
1393
1405
|
const [r, n] = t;
|
|
@@ -1395,9 +1407,9 @@ function Oo(e) {
|
|
|
1395
1407
|
const i = Number(n);
|
|
1396
1408
|
return `${i}` !== n || i < 0 || i > 128 ? !1 : Tr(r);
|
|
1397
1409
|
}
|
|
1398
|
-
var
|
|
1399
|
-
t.pattern ?? (t.pattern =
|
|
1400
|
-
|
|
1410
|
+
var So = /* @__PURE__ */ l("$ZodCIDRv6", (e, t) => {
|
|
1411
|
+
t.pattern ?? (t.pattern = zi), O.init(e, t), e._zod.check = (r) => {
|
|
1412
|
+
zo(r.value) || r.issues.push({
|
|
1401
1413
|
code: "invalid_format",
|
|
1402
1414
|
format: "cidrv6",
|
|
1403
1415
|
input: r.value,
|
|
@@ -1415,7 +1427,7 @@ function Pr(e) {
|
|
|
1415
1427
|
return !1;
|
|
1416
1428
|
}
|
|
1417
1429
|
}
|
|
1418
|
-
var Zr = /^[0-9a-zA-Z+/]*={0,2}$/,
|
|
1430
|
+
var Zr = /^[0-9a-zA-Z+/]*={0,2}$/, $o = /* @__PURE__ */ l("$ZodBase64", (e, t) => {
|
|
1419
1431
|
t.pattern ?? (t.pattern = Zr), O.init(e, t), e._zod.check = (r) => {
|
|
1420
1432
|
Pr(r.value) || r.issues.push({
|
|
1421
1433
|
code: "invalid_format",
|
|
@@ -1425,14 +1437,14 @@ var Zr = /^[0-9a-zA-Z+/]*={0,2}$/, So = /* @__PURE__ */ l("$ZodBase64", (e, t) =
|
|
|
1425
1437
|
continue: !t.abort
|
|
1426
1438
|
});
|
|
1427
1439
|
};
|
|
1428
|
-
}),
|
|
1440
|
+
}), ht = /^[A-Za-z0-9_-]*$/;
|
|
1429
1441
|
function Eo(e) {
|
|
1430
|
-
if (!
|
|
1442
|
+
if (!ht.test(e)) return !1;
|
|
1431
1443
|
const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/");
|
|
1432
1444
|
return Pr(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
|
|
1433
1445
|
}
|
|
1434
|
-
var
|
|
1435
|
-
t.pattern ?? (t.pattern =
|
|
1446
|
+
var Io = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
|
|
1447
|
+
t.pattern ?? (t.pattern = ht), O.init(e, t), e._zod.check = (r) => {
|
|
1436
1448
|
Eo(r.value) || r.issues.push({
|
|
1437
1449
|
code: "invalid_format",
|
|
1438
1450
|
format: "base64url",
|
|
@@ -1441,10 +1453,10 @@ var $o = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
|
|
|
1441
1453
|
continue: !t.abort
|
|
1442
1454
|
});
|
|
1443
1455
|
};
|
|
1444
|
-
}),
|
|
1445
|
-
t.pattern ?? (t.pattern =
|
|
1456
|
+
}), Ao = /* @__PURE__ */ l("$ZodE164", (e, t) => {
|
|
1457
|
+
t.pattern ?? (t.pattern = Ii), O.init(e, t);
|
|
1446
1458
|
});
|
|
1447
|
-
function
|
|
1459
|
+
function To(e, t = null) {
|
|
1448
1460
|
try {
|
|
1449
1461
|
const r = e.split(".");
|
|
1450
1462
|
if (r.length !== 3) return !1;
|
|
@@ -1456,9 +1468,9 @@ function Ao(e, t = null) {
|
|
|
1456
1468
|
return !1;
|
|
1457
1469
|
}
|
|
1458
1470
|
}
|
|
1459
|
-
var
|
|
1471
|
+
var Po = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
|
|
1460
1472
|
O.init(e, t), e._zod.check = (r) => {
|
|
1461
|
-
|
|
1473
|
+
To(r.value, t.alg) || r.issues.push({
|
|
1462
1474
|
code: "invalid_format",
|
|
1463
1475
|
format: "jwt",
|
|
1464
1476
|
input: r.value,
|
|
@@ -1467,7 +1479,7 @@ var To = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
|
|
|
1467
1479
|
});
|
|
1468
1480
|
};
|
|
1469
1481
|
}), Cr = /* @__PURE__ */ l("$ZodNumber", (e, t) => {
|
|
1470
|
-
S.init(e, t), e._zod.pattern =
|
|
1482
|
+
S.init(e, t), e._zod.pattern = Ri, e._zod.parse = (r, n) => {
|
|
1471
1483
|
if (t.coerce) try {
|
|
1472
1484
|
r.value = Number(r.value);
|
|
1473
1485
|
} catch {
|
|
@@ -1483,10 +1495,10 @@ var To = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
|
|
|
1483
1495
|
...o ? { received: o } : {}
|
|
1484
1496
|
}), r;
|
|
1485
1497
|
};
|
|
1486
|
-
}),
|
|
1487
|
-
|
|
1488
|
-
}),
|
|
1489
|
-
S.init(e, t), e._zod.pattern =
|
|
1498
|
+
}), Zo = /* @__PURE__ */ l("$ZodNumberFormat", (e, t) => {
|
|
1499
|
+
Di.init(e, t), Cr.init(e, t);
|
|
1500
|
+
}), Co = /* @__PURE__ */ l("$ZodBoolean", (e, t) => {
|
|
1501
|
+
S.init(e, t), e._zod.pattern = Ni, e._zod.parse = (r, n) => {
|
|
1490
1502
|
if (t.coerce) try {
|
|
1491
1503
|
r.value = !!r.value;
|
|
1492
1504
|
} catch {
|
|
@@ -1499,9 +1511,9 @@ var To = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
|
|
|
1499
1511
|
inst: e
|
|
1500
1512
|
}), r;
|
|
1501
1513
|
};
|
|
1502
|
-
}),
|
|
1514
|
+
}), Ro = /* @__PURE__ */ l("$ZodUnknown", (e, t) => {
|
|
1503
1515
|
S.init(e, t), e._zod.parse = (r) => r;
|
|
1504
|
-
}),
|
|
1516
|
+
}), No = /* @__PURE__ */ l("$ZodNever", (e, t) => {
|
|
1505
1517
|
S.init(e, t), e._zod.parse = (r, n) => (r.issues.push({
|
|
1506
1518
|
expected: "never",
|
|
1507
1519
|
code: "invalid_type",
|
|
@@ -1509,10 +1521,26 @@ var To = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
|
|
|
1509
1521
|
inst: e
|
|
1510
1522
|
}), r);
|
|
1511
1523
|
});
|
|
1512
|
-
function
|
|
1513
|
-
|
|
1524
|
+
function jo(e, t) {
|
|
1525
|
+
const r = Ot(e._zod.def.checks);
|
|
1526
|
+
if (!r.length) return;
|
|
1527
|
+
const n = Math.min(...r.map((o) => o[0])), i = e._zod.parse;
|
|
1528
|
+
e._zod.parse = (o, s) => {
|
|
1529
|
+
const a = t(o.value);
|
|
1530
|
+
if (a > n && !s?.skipChecks && s?.direction !== "backward") {
|
|
1531
|
+
for (const [c, u] of Ot(e._zod.def.checks)) if (a > c && u._zod.def.when(o)) {
|
|
1532
|
+
const f = o.issues.length;
|
|
1533
|
+
return u._zod.check(o), o.issues[f].continue = !1, Ge(o.issues, f, e), o;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
return i(o, s);
|
|
1537
|
+
};
|
|
1514
1538
|
}
|
|
1515
|
-
var
|
|
1539
|
+
var xo = (e) => Array.isArray(e) ? e.length : -1;
|
|
1540
|
+
function At(e, t, r) {
|
|
1541
|
+
e.issues.length && t.issues.push(..._r(r, e.issues)), t.value[r] = e.value;
|
|
1542
|
+
}
|
|
1543
|
+
var Mo = /* @__PURE__ */ l("$ZodArray", (e, t) => {
|
|
1516
1544
|
S.init(e, t);
|
|
1517
1545
|
const r = M.memoizer;
|
|
1518
1546
|
r?.attach(e), e._zod.parse = (n, i) => {
|
|
@@ -1531,18 +1559,18 @@ var No = /* @__PURE__ */ l("$ZodArray", (e, t) => {
|
|
|
1531
1559
|
value: u,
|
|
1532
1560
|
issues: []
|
|
1533
1561
|
}, i);
|
|
1534
|
-
if (f instanceof Promise) s.push(f.then((d) =>
|
|
1535
|
-
else if (
|
|
1562
|
+
if (f instanceof Promise) s.push(f.then((d) => At(d, n, c)));
|
|
1563
|
+
else if (At(f, n, c), a && f.issues.length !== 0 && D(f)) break;
|
|
1536
1564
|
}
|
|
1537
1565
|
return s.length ? Promise.all(s).then(() => n) : n;
|
|
1538
|
-
};
|
|
1566
|
+
}, jo(e, xo);
|
|
1539
1567
|
});
|
|
1540
1568
|
function Ie(e, t, r, n, i, o) {
|
|
1541
1569
|
const s = r in n, a = o === "optional";
|
|
1542
1570
|
if (!(!s && a && i === "optional")) {
|
|
1543
1571
|
if (e.issues.length) {
|
|
1544
1572
|
if (i !== void 0 && a && !s) return;
|
|
1545
|
-
t.issues.push(...
|
|
1573
|
+
t.issues.push(..._r(r, e.issues));
|
|
1546
1574
|
}
|
|
1547
1575
|
if (!s && i === void 0) {
|
|
1548
1576
|
e.issues.length || t.issues.push({
|
|
@@ -1556,9 +1584,9 @@ function Ie(e, t, r, n, i, o) {
|
|
|
1556
1584
|
e.value === void 0 ? (s || i === "defaulted" && !a) && (t.value[r] = void 0) : t.value[r] = e.value;
|
|
1557
1585
|
}
|
|
1558
1586
|
}
|
|
1559
|
-
var
|
|
1587
|
+
var Do = [];
|
|
1560
1588
|
function Rr(e) {
|
|
1561
|
-
const t = Object.keys(e.shape), r = Object.getOwnPropertySymbols(e.shape), n = r.length ? r :
|
|
1589
|
+
const t = Object.keys(e.shape), r = Object.getOwnPropertySymbols(e.shape), n = r.length ? r : Do, i = n.length ? [...t, ...n] : t;
|
|
1562
1590
|
for (const s of i) if (!e.shape?.[s]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);
|
|
1563
1591
|
const o = On(e.shape);
|
|
1564
1592
|
return {
|
|
@@ -1601,7 +1629,7 @@ function Nr(e, t, r, n, i, o, s) {
|
|
|
1601
1629
|
continue: !0
|
|
1602
1630
|
}), e.length ? Promise.all(e).then(() => r) : r;
|
|
1603
1631
|
}
|
|
1604
|
-
var
|
|
1632
|
+
var Lo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
1605
1633
|
S.init(e, t);
|
|
1606
1634
|
const r = Object.getOwnPropertyDescriptor(t, "shape"), n = r?.get ? r.get.raw : t.shape ?? {};
|
|
1607
1635
|
if (n) {
|
|
@@ -1611,7 +1639,7 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1611
1639
|
};
|
|
1612
1640
|
u.raw = n, Object.defineProperty(t, "shape", { get: u });
|
|
1613
1641
|
}
|
|
1614
|
-
const i =
|
|
1642
|
+
const i = nt(() => Rr(t));
|
|
1615
1643
|
y(e, "propValues", (u) => {
|
|
1616
1644
|
const f = u.def.shape, d = {};
|
|
1617
1645
|
for (const h in f) {
|
|
@@ -1624,7 +1652,7 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1624
1652
|
}
|
|
1625
1653
|
return d;
|
|
1626
1654
|
});
|
|
1627
|
-
const o =
|
|
1655
|
+
const o = $e, s = t.catchall;
|
|
1628
1656
|
let a;
|
|
1629
1657
|
const c = M.memoizer;
|
|
1630
1658
|
c?.attach(e), e._zod.parse = (u, f) => {
|
|
@@ -1650,39 +1678,39 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1650
1678
|
value: d[b],
|
|
1651
1679
|
issues: []
|
|
1652
1680
|
}, f);
|
|
1653
|
-
oe instanceof Promise ? h.push(oe.then((
|
|
1681
|
+
oe instanceof Promise ? h.push(oe.then((E) => Ie(E, u, b, d, N, ie))) : Ie(oe, u, b, d, N, ie);
|
|
1654
1682
|
}
|
|
1655
1683
|
return s ? Nr(h, d, u, f, i.value, e, m === !0) : h.length ? Promise.all(h).then(() => u) : u;
|
|
1656
1684
|
};
|
|
1657
|
-
}),
|
|
1658
|
-
|
|
1659
|
-
const r = e._zod.parse, n =
|
|
1660
|
-
const m = n.value, v = m.symbolKeys, b = new
|
|
1685
|
+
}), Uo = /* @__PURE__ */ l("$ZodObjectJIT", (e, t) => {
|
|
1686
|
+
Lo.init(e, t);
|
|
1687
|
+
const r = e._zod.parse, n = nt(() => Rr(t)), i = M.memoizer, o = (p) => {
|
|
1688
|
+
const m = n.value, v = m.symbolKeys, b = new qi(["payload", "ctx"], {
|
|
1661
1689
|
shape: p,
|
|
1662
1690
|
inst: e,
|
|
1663
1691
|
memo: i,
|
|
1664
1692
|
syms: v
|
|
1665
|
-
}), _ = (
|
|
1666
|
-
let ${
|
|
1667
|
-
for (let i = 0; i < ${
|
|
1668
|
-
const iss = ${
|
|
1693
|
+
}), _ = (E) => `shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`, N = (E, w) => `
|
|
1694
|
+
let ${E}_ab = false;
|
|
1695
|
+
for (let i = 0; i < ${E}.issues.length; i++) {
|
|
1696
|
+
const iss = ${E}.issues[i];
|
|
1669
1697
|
iss.path = iss.path ? [${w}, ...iss.path] : [${w}];
|
|
1670
1698
|
payload.issues.push(iss);
|
|
1671
|
-
if (iss.continue !== true) ${
|
|
1699
|
+
if (iss.continue !== true) ${E}_ab = true;
|
|
1672
1700
|
}
|
|
1673
|
-
if (${
|
|
1701
|
+
if (${E}_ab && ctx && ctx.abortEarly) {
|
|
1674
1702
|
payload.value = newResult;
|
|
1675
1703
|
return payload;
|
|
1676
1704
|
}`;
|
|
1677
1705
|
b.write("const input = payload.value;");
|
|
1678
1706
|
const ie = /* @__PURE__ */ Object.create(null);
|
|
1679
1707
|
let oe = 0;
|
|
1680
|
-
for (const
|
|
1708
|
+
for (const E of m.allKeys) ie[E] = `key_${oe++}`;
|
|
1681
1709
|
b.write(i ? "const newResult = memo.alloc(inst, payload, {}, ctx);" : "const newResult = {};");
|
|
1682
|
-
for (const
|
|
1683
|
-
if (
|
|
1684
|
-
const w = ie[
|
|
1685
|
-
if (b.write(`const ${w} = ${_(j)};`),
|
|
1710
|
+
for (const E of m.allKeys) {
|
|
1711
|
+
if (E === "__proto__") continue;
|
|
1712
|
+
const w = ie[E], j = typeof E == "symbol" ? `syms[${v.indexOf(E)}]` : _n(E), xe = `${j} in input`, bt = p[E], Me = bt?._zod?.optin, _t = Me !== void 0, cn = bt?._zod?.optout === "optional";
|
|
1713
|
+
if (b.write(`const ${w} = ${_(j)};`), _t && cn) {
|
|
1686
1714
|
const un = Me === "optional" ? `${w}_present` : `${w}.value !== undefined || ${w}_present`;
|
|
1687
1715
|
b.write(`
|
|
1688
1716
|
const ${w}_present = ${xe};
|
|
@@ -1696,7 +1724,7 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1696
1724
|
}
|
|
1697
1725
|
|
|
1698
1726
|
`);
|
|
1699
|
-
} else
|
|
1727
|
+
} else _t ? (b.write(`
|
|
1700
1728
|
if (${w}.issues.length) {${N(w, j)}
|
|
1701
1729
|
}
|
|
1702
1730
|
`), Me === "defaulted" ? b.write(`newResult[${j}] = ${w}.value;`) : b.write(`
|
|
@@ -1729,7 +1757,7 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1729
1757
|
return b.write("payload.value = newResult;"), b.write("return payload;"), b.compile();
|
|
1730
1758
|
};
|
|
1731
1759
|
let s;
|
|
1732
|
-
const a =
|
|
1760
|
+
const a = $e, c = !M.jitless, f = c && wn.value, d = t.catchall;
|
|
1733
1761
|
let h;
|
|
1734
1762
|
e._zod.parse = (p, m) => {
|
|
1735
1763
|
h ?? (h = n.value);
|
|
@@ -1742,7 +1770,7 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1742
1770
|
}), p);
|
|
1743
1771
|
};
|
|
1744
1772
|
});
|
|
1745
|
-
function
|
|
1773
|
+
function Tt(e, t, r, n) {
|
|
1746
1774
|
for (const o of e) if (o.issues.length === 0)
|
|
1747
1775
|
return t.value = o.value, t;
|
|
1748
1776
|
const i = e.filter((o) => !D(o));
|
|
@@ -1753,13 +1781,13 @@ function At(e, t, r, n) {
|
|
|
1753
1781
|
errors: e.map((o) => o.issues.map((s) => te(s, n, W())))
|
|
1754
1782
|
}), t);
|
|
1755
1783
|
}
|
|
1756
|
-
var
|
|
1784
|
+
var Fo = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
1757
1785
|
S.init(e, t), y(e, "optin", (n) => n.def.options.some((i) => i._zod.optin === "defaulted") ? "defaulted" : n.def.options.some((i) => i._zod.optin !== void 0) ? "optional" : void 0), y(e, "optout", (n) => n.def.options.some((i) => i._zod.optout === "optional") ? "optional" : void 0), y(e, "values", (n) => {
|
|
1758
1786
|
if (n.def.options.every((i) => i._zod.values)) return new Set(n.def.options.flatMap((i) => Array.from(i._zod.values)));
|
|
1759
1787
|
}), y(e, "pattern", (n) => {
|
|
1760
1788
|
if (n.def.options.every((i) => i._zod.pattern)) {
|
|
1761
1789
|
const i = n.def.options.map((o) => o._zod.pattern);
|
|
1762
|
-
return new RegExp(`^(${i.map((o) =>
|
|
1790
|
+
return new RegExp(`^(${i.map((o) => it(o.source)).join("|")})$`);
|
|
1763
1791
|
}
|
|
1764
1792
|
});
|
|
1765
1793
|
const r = t.options.length === 1 ? t.options[0]._zod.run : null;
|
|
@@ -1779,9 +1807,9 @@ var Do = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
|
1779
1807
|
s.push(c);
|
|
1780
1808
|
}
|
|
1781
1809
|
}
|
|
1782
|
-
return o ? Promise.all(s).then((a) =>
|
|
1810
|
+
return o ? Promise.all(s).then((a) => Tt(a, n, e, i)) : Tt(s, n, e, i);
|
|
1783
1811
|
};
|
|
1784
|
-
}),
|
|
1812
|
+
}), Bo = /* @__PURE__ */ l("$ZodIntersection", (e, t) => {
|
|
1785
1813
|
S.init(e, t), e._zod.parse = (r, n) => {
|
|
1786
1814
|
const i = r.value, o = t.left._zod.run({
|
|
1787
1815
|
value: i,
|
|
@@ -1790,10 +1818,10 @@ var Do = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
|
1790
1818
|
value: i,
|
|
1791
1819
|
issues: []
|
|
1792
1820
|
}, n);
|
|
1793
|
-
return o instanceof Promise || s instanceof Promise ? Promise.all([o, s]).then(([a, c]) =>
|
|
1821
|
+
return o instanceof Promise || s instanceof Promise ? Promise.all([o, s]).then(([a, c]) => Pt(r, a, c)) : Pt(r, o, s);
|
|
1794
1822
|
};
|
|
1795
1823
|
});
|
|
1796
|
-
function
|
|
1824
|
+
function Ye(e, t) {
|
|
1797
1825
|
if (e === t) return {
|
|
1798
1826
|
valid: !0,
|
|
1799
1827
|
data: e
|
|
@@ -1810,7 +1838,7 @@ function qe(e, t) {
|
|
|
1810
1838
|
Object.prototype.hasOwnProperty.call(i, "__proto__") && delete i.__proto__;
|
|
1811
1839
|
for (const o of n) {
|
|
1812
1840
|
if (o === "__proto__") continue;
|
|
1813
|
-
const s =
|
|
1841
|
+
const s = Ye(e[o], t[o]);
|
|
1814
1842
|
if (!s.valid) return {
|
|
1815
1843
|
valid: !1,
|
|
1816
1844
|
mergeErrorPath: [o, ...s.mergeErrorPath]
|
|
@@ -1829,7 +1857,7 @@ function qe(e, t) {
|
|
|
1829
1857
|
};
|
|
1830
1858
|
const r = [];
|
|
1831
1859
|
for (let n = 0; n < e.length; n++) {
|
|
1832
|
-
const i = e[n], o = t[n], s =
|
|
1860
|
+
const i = e[n], o = t[n], s = Ye(i, o);
|
|
1833
1861
|
if (!s.valid) return {
|
|
1834
1862
|
valid: !1,
|
|
1835
1863
|
mergeErrorPath: [n, ...s.mergeErrorPath]
|
|
@@ -1846,7 +1874,7 @@ function qe(e, t) {
|
|
|
1846
1874
|
mergeErrorPath: []
|
|
1847
1875
|
};
|
|
1848
1876
|
}
|
|
1849
|
-
function
|
|
1877
|
+
function Pt(e, t, r) {
|
|
1850
1878
|
const n = /* @__PURE__ */ new Map();
|
|
1851
1879
|
let i;
|
|
1852
1880
|
const o = /* @__PURE__ */ new Map(), s = (u, f) => {
|
|
@@ -1872,14 +1900,14 @@ function Tt(e, t, r) {
|
|
|
1872
1900
|
});
|
|
1873
1901
|
for (const f of a) !u.includes(f) && o.has(f) && e.issues.push(o.get(f));
|
|
1874
1902
|
}
|
|
1875
|
-
const c =
|
|
1903
|
+
const c = Ye(t.value, r.value);
|
|
1876
1904
|
if (!c.valid) {
|
|
1877
1905
|
if (D(e)) return e;
|
|
1878
1906
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);
|
|
1879
1907
|
}
|
|
1880
1908
|
return e.value = c.data, e;
|
|
1881
1909
|
}
|
|
1882
|
-
var
|
|
1910
|
+
var Jo = /* @__PURE__ */ l("$ZodEnum", (e, t) => {
|
|
1883
1911
|
S.init(e, t);
|
|
1884
1912
|
const r = Ke(t.entries), n = new Set(r);
|
|
1885
1913
|
e._zod.values = n, y(e, "pattern", (i) => {
|
|
@@ -1894,16 +1922,16 @@ var Uo = /* @__PURE__ */ l("$ZodEnum", (e, t) => {
|
|
|
1894
1922
|
inst: e
|
|
1895
1923
|
}), i;
|
|
1896
1924
|
};
|
|
1897
|
-
}),
|
|
1925
|
+
}), Wo = /* @__PURE__ */ l("$ZodTransform", (e, t) => {
|
|
1898
1926
|
S.init(e, t), e._zod.optin = "optional", M.memoizer?.guard(e), e._zod.parse = (r, n) => {
|
|
1899
|
-
if (n.direction === "backward") throw new
|
|
1927
|
+
if (n.direction === "backward") throw new kr(e.constructor.name);
|
|
1900
1928
|
const i = t.transform(r.value, r);
|
|
1901
1929
|
if (n.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((o) => (r.value = o, r));
|
|
1902
1930
|
if (i instanceof Promise) throw new H();
|
|
1903
1931
|
return r.value = i, r;
|
|
1904
1932
|
};
|
|
1905
1933
|
});
|
|
1906
|
-
function
|
|
1934
|
+
function Zt(e, t) {
|
|
1907
1935
|
return e.value = t.issues.length ? void 0 : t.value, e;
|
|
1908
1936
|
}
|
|
1909
1937
|
var jr = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
|
|
@@ -1912,7 +1940,7 @@ var jr = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
|
|
|
1912
1940
|
return n ? /* @__PURE__ */ new Set([...n, void 0]) : void 0;
|
|
1913
1941
|
}), y(e, "pattern", (r) => {
|
|
1914
1942
|
const n = r.def.innerType._zod.pattern;
|
|
1915
|
-
return n ? new RegExp(`^(${
|
|
1943
|
+
return n ? new RegExp(`^(${it(n.source)})?$`) : void 0;
|
|
1916
1944
|
}), e._zod.parse = (r, n) => {
|
|
1917
1945
|
if (r.value === void 0) {
|
|
1918
1946
|
if (t.innerType._zod.optin !== "defaulted") return r;
|
|
@@ -1920,41 +1948,41 @@ var jr = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
|
|
|
1920
1948
|
value: r.value,
|
|
1921
1949
|
issues: []
|
|
1922
1950
|
}, n);
|
|
1923
|
-
return i instanceof Promise ? i.then((o) =>
|
|
1951
|
+
return i instanceof Promise ? i.then((o) => Zt(r, o)) : Zt(r, i);
|
|
1924
1952
|
}
|
|
1925
1953
|
return t.innerType._zod.run(r, n);
|
|
1926
1954
|
};
|
|
1927
|
-
}),
|
|
1955
|
+
}), Vo = /* @__PURE__ */ l("$ZodExactOptional", (e, t) => {
|
|
1928
1956
|
jr.init(e, t), y(e, "values", (r) => r.def.innerType._zod.values), y(e, "pattern", (r) => r.def.innerType._zod.pattern), e._zod.parse = (r, n) => t.innerType._zod.run(r, n);
|
|
1929
|
-
}),
|
|
1957
|
+
}), Ko = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
|
|
1930
1958
|
S.init(e, t), y(e, "optin", (r) => r.def.innerType._zod.optin), y(e, "optout", (r) => r.def.innerType._zod.optout), y(e, "pattern", (r) => {
|
|
1931
1959
|
const n = r.def.innerType._zod.pattern;
|
|
1932
|
-
return n ? new RegExp(`^(${
|
|
1960
|
+
return n ? new RegExp(`^(${it(n.source)}|null)$`) : void 0;
|
|
1933
1961
|
}), y(e, "values", (r) => r.def.innerType._zod.values ? /* @__PURE__ */ new Set([...r.def.innerType._zod.values, null]) : void 0), e._zod.parse = (r, n) => r.value === null ? r : t.innerType._zod.run(r, n);
|
|
1934
|
-
}),
|
|
1962
|
+
}), Ho = /* @__PURE__ */ l("$ZodDefault", (e, t) => {
|
|
1935
1963
|
S.init(e, t), e._zod.optin = "defaulted", y(e, "values", (r) => r.def.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
1936
1964
|
if (n.direction === "backward") return t.innerType._zod.run(r, n);
|
|
1937
1965
|
if (r.value === void 0)
|
|
1938
1966
|
return r.value = t.defaultValue, r;
|
|
1939
1967
|
const i = t.innerType._zod.run(r, n);
|
|
1940
|
-
return i instanceof Promise ? i.then((o) =>
|
|
1968
|
+
return i instanceof Promise ? i.then((o) => Ct(o, t)) : Ct(i, t);
|
|
1941
1969
|
};
|
|
1942
1970
|
});
|
|
1943
|
-
function
|
|
1971
|
+
function Ct(e, t) {
|
|
1944
1972
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1945
1973
|
}
|
|
1946
|
-
var
|
|
1974
|
+
var Go = /* @__PURE__ */ l("$ZodPrefault", (e, t) => {
|
|
1947
1975
|
S.init(e, t), e._zod.optin = "defaulted", y(e, "values", (r) => r.def.innerType._zod.values), e._zod.parse = (r, n) => (n.direction === "backward" || r.value === void 0 && (r.value = t.defaultValue), t.innerType._zod.run(r, n));
|
|
1948
|
-
}),
|
|
1976
|
+
}), qo = /* @__PURE__ */ l("$ZodNonOptional", (e, t) => {
|
|
1949
1977
|
S.init(e, t), y(e, "values", (r) => {
|
|
1950
1978
|
const n = r.def.innerType._zod.values;
|
|
1951
1979
|
return n ? new Set([...n].filter((i) => i !== void 0)) : void 0;
|
|
1952
1980
|
}), e._zod.parse = (r, n) => {
|
|
1953
1981
|
const i = t.innerType._zod.run(r, n);
|
|
1954
|
-
return i instanceof Promise ? i.then((o) =>
|
|
1982
|
+
return i instanceof Promise ? i.then((o) => Rt(o, e)) : Rt(i, e);
|
|
1955
1983
|
};
|
|
1956
1984
|
});
|
|
1957
|
-
function
|
|
1985
|
+
function Rt(e, t) {
|
|
1958
1986
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1959
1987
|
code: "invalid_type",
|
|
1960
1988
|
expected: "nonoptional",
|
|
@@ -1962,7 +1990,7 @@ function Ct(e, t) {
|
|
|
1962
1990
|
inst: t
|
|
1963
1991
|
}), e;
|
|
1964
1992
|
}
|
|
1965
|
-
function
|
|
1993
|
+
function Nt(e, t, r, n) {
|
|
1966
1994
|
return t.issues.length ? (e.value = r.catchValue({
|
|
1967
1995
|
...t,
|
|
1968
1996
|
value: e.value,
|
|
@@ -1970,16 +1998,16 @@ function Rt(e, t, r, n) {
|
|
|
1970
1998
|
input: e.value
|
|
1971
1999
|
}), e) : (e.value = t.value, t.memo && (e.memo = !0), e);
|
|
1972
2000
|
}
|
|
1973
|
-
var
|
|
2001
|
+
var Yo = /* @__PURE__ */ l("$ZodCatch", (e, t) => {
|
|
1974
2002
|
S.init(e, t), y(e, "optin", (r) => r.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional"), y(e, "optout", (r) => r.def.innerType._zod.optout), y(e, "values", (r) => r.def.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
1975
2003
|
if (n.direction === "backward") return t.innerType._zod.run(r, n);
|
|
1976
2004
|
const i = t.innerType._zod.run({
|
|
1977
2005
|
value: r.value,
|
|
1978
2006
|
issues: []
|
|
1979
2007
|
}, n);
|
|
1980
|
-
return i instanceof Promise ? i.then((o) =>
|
|
2008
|
+
return i instanceof Promise ? i.then((o) => Nt(r, o, t, n)) : Nt(r, i, t, n);
|
|
1981
2009
|
};
|
|
1982
|
-
}),
|
|
2010
|
+
}), Xo = /* @__PURE__ */ l("$ZodPipe", (e, t) => {
|
|
1983
2011
|
S.init(e, t), y(e, "values", (r) => r.def.in._zod.values), y(e, "optin", (r) => r.def.in._zod.optin), y(e, "optout", (r) => r.def.out._zod.optout), y(e, "propValues", (r) => r.def.in._zod.propValues), e._zod.parse = (r, n) => {
|
|
1984
2012
|
if (n.direction === "backward") {
|
|
1985
2013
|
const o = t.out._zod.run(r, n);
|
|
@@ -1995,24 +2023,24 @@ function pe(e, t, r) {
|
|
|
1995
2023
|
issues: e.issues
|
|
1996
2024
|
}, r);
|
|
1997
2025
|
}
|
|
1998
|
-
var
|
|
2026
|
+
var Qo = /* @__PURE__ */ l("$ZodReadonly", (e, t) => {
|
|
1999
2027
|
S.init(e, t), y(e, "propValues", (r) => r.def.innerType._zod.propValues), y(e, "values", (r) => r.def.innerType._zod.values), y(e, "optin", (r) => r.def.innerType?._zod?.optin), y(e, "optout", (r) => r.def.innerType?._zod?.optout), e._zod.parse = (r, n) => {
|
|
2000
2028
|
if (n.direction === "backward") return t.innerType._zod.run(r, n);
|
|
2001
2029
|
const i = t.innerType._zod.run(r, n);
|
|
2002
|
-
return i instanceof Promise ? i.then(
|
|
2030
|
+
return i instanceof Promise ? i.then(jt) : jt(i);
|
|
2003
2031
|
};
|
|
2004
2032
|
});
|
|
2005
|
-
function
|
|
2033
|
+
function jt(e) {
|
|
2006
2034
|
return e.memo || (e.value = Object.freeze(e.value)), e;
|
|
2007
2035
|
}
|
|
2008
|
-
var
|
|
2036
|
+
var es = /* @__PURE__ */ l("$ZodCustom", (e, t) => {
|
|
2009
2037
|
T.init(e, t), S.init(e, t), e._zod.parse = (r, n) => r, e._zod.check = (r) => {
|
|
2010
2038
|
const n = r.value, i = t.fn(n);
|
|
2011
|
-
if (i instanceof Promise) return i.then((o) =>
|
|
2012
|
-
|
|
2039
|
+
if (i instanceof Promise) return i.then((o) => xt(o, r, n, e));
|
|
2040
|
+
xt(i, r, n, e);
|
|
2013
2041
|
};
|
|
2014
2042
|
});
|
|
2015
|
-
function
|
|
2043
|
+
function xt(e, t, r, n) {
|
|
2016
2044
|
if (!e) {
|
|
2017
2045
|
const i = {
|
|
2018
2046
|
code: "custom",
|
|
@@ -2024,11 +2052,11 @@ function jt(e, t, r, n) {
|
|
|
2024
2052
|
n._zod.def.params && (i.params = n._zod.def.params), t.issues.push(he(i));
|
|
2025
2053
|
}
|
|
2026
2054
|
}
|
|
2027
|
-
var
|
|
2055
|
+
var ts = class extends Error {
|
|
2028
2056
|
constructor() {
|
|
2029
2057
|
super("Cannot parse a reference cycle that closes through a transform"), this.name = "ZodCyclicError";
|
|
2030
2058
|
}
|
|
2031
|
-
},
|
|
2059
|
+
}, Xe = "~memo", Mt = [];
|
|
2032
2060
|
function xr(e) {
|
|
2033
2061
|
return e !== null && typeof e == "object";
|
|
2034
2062
|
}
|
|
@@ -2064,7 +2092,7 @@ function Oe(e, t, r) {
|
|
|
2064
2092
|
}, c = e._zod.def;
|
|
2065
2093
|
switch (c.type) {
|
|
2066
2094
|
case "object": {
|
|
2067
|
-
const u =
|
|
2095
|
+
const u = fr(c);
|
|
2068
2096
|
a(u ? s(u, !0) : ke), o(c.catchall);
|
|
2069
2097
|
break;
|
|
2070
2098
|
}
|
|
@@ -2142,16 +2170,16 @@ function Oe(e, t, r) {
|
|
|
2142
2170
|
}
|
|
2143
2171
|
}
|
|
2144
2172
|
}
|
|
2145
|
-
return t.delete(e),
|
|
2173
|
+
return t.delete(e), rs(e, i);
|
|
2146
2174
|
}
|
|
2147
|
-
function
|
|
2175
|
+
function rs(e, t) {
|
|
2148
2176
|
return t !== ke && Mr.set(e, t === le), t;
|
|
2149
2177
|
}
|
|
2150
|
-
function
|
|
2178
|
+
function ns(e, t) {
|
|
2151
2179
|
let r = e.buckets.get(t);
|
|
2152
2180
|
return r || (r = /* @__PURE__ */ new WeakMap(), e.buckets.set(t, r)), r;
|
|
2153
2181
|
}
|
|
2154
|
-
var me, ge = [],
|
|
2182
|
+
var me, ge = [], is = {
|
|
2155
2183
|
alloc(e, t, r) {
|
|
2156
2184
|
const n = me;
|
|
2157
2185
|
if (!n) return r;
|
|
@@ -2166,7 +2194,7 @@ var me, ge = [], ts = {
|
|
|
2166
2194
|
var t;
|
|
2167
2195
|
(t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred.push(() => {
|
|
2168
2196
|
const r = e._zod.parse, n = (i, o) => {
|
|
2169
|
-
if (o.direction !== "backward" &&
|
|
2197
|
+
if (o.direction !== "backward" && ss(o, i.value)) throw new ts();
|
|
2170
2198
|
return r(i, o);
|
|
2171
2199
|
};
|
|
2172
2200
|
e._zod.parse = n, e._zod.run === r && (e._zod.run = n);
|
|
@@ -2185,13 +2213,13 @@ var me, ge = [], ts = {
|
|
|
2185
2213
|
}
|
|
2186
2214
|
const f = c.value;
|
|
2187
2215
|
if (!xr(f)) return s(c, u);
|
|
2188
|
-
let d = u[
|
|
2216
|
+
let d = u[Xe];
|
|
2189
2217
|
d || (d = {
|
|
2190
2218
|
buckets: /* @__PURE__ */ new WeakMap(),
|
|
2191
2219
|
backEdges: void 0
|
|
2192
|
-
}, u[
|
|
2220
|
+
}, u[Xe] = d);
|
|
2193
2221
|
let h;
|
|
2194
|
-
i === u ? h = o : (h =
|
|
2222
|
+
i === u ? h = o : (h = ns(d, e), i = u, o = h);
|
|
2195
2223
|
const p = h.get(f);
|
|
2196
2224
|
if (p)
|
|
2197
2225
|
return c.value = p.value, p.issues ? p.issues.length && c.issues.push(...Fe(p.issues)) : (c.memo = !0, d.backEdges ?? (d.backEdges = /* @__PURE__ */ new WeakSet()), d.backEdges.add(p.value)), c;
|
|
@@ -2199,20 +2227,20 @@ var me, ge = [], ts = {
|
|
|
2199
2227
|
const m = ge.length, v = s(c, u);
|
|
2200
2228
|
me = void 0;
|
|
2201
2229
|
const b = ge.length > m ? ge.pop() : void 0;
|
|
2202
|
-
return v instanceof Promise ? v.then((_) => (b && (b.issues = _.issues.length ? Fe(_.issues) :
|
|
2230
|
+
return v instanceof Promise ? v.then((_) => (b && (b.issues = _.issues.length ? Fe(_.issues) : Mt), _)) : (b && (b.issues = v.issues.length ? Fe(v.issues) : Mt), v);
|
|
2203
2231
|
};
|
|
2204
2232
|
e._zod.parse = a, e._zod.run === s && (e._zod.run = a);
|
|
2205
2233
|
});
|
|
2206
2234
|
}
|
|
2207
2235
|
};
|
|
2208
|
-
function
|
|
2209
|
-
return
|
|
2236
|
+
function os() {
|
|
2237
|
+
return is;
|
|
2210
2238
|
}
|
|
2211
|
-
function
|
|
2212
|
-
const r = e[
|
|
2239
|
+
function ss(e, t) {
|
|
2240
|
+
const r = e[Xe]?.backEdges;
|
|
2213
2241
|
return r !== void 0 && xr(t) && r.has(t);
|
|
2214
2242
|
}
|
|
2215
|
-
var
|
|
2243
|
+
var as = () => {
|
|
2216
2244
|
const e = {
|
|
2217
2245
|
string: {
|
|
2218
2246
|
unit: "characters",
|
|
@@ -2280,7 +2308,7 @@ var is = () => {
|
|
|
2280
2308
|
case "invalid_type":
|
|
2281
2309
|
return `Invalid input: expected ${i(o.expected)}, received ${i(Cn(o.input), o.input)}`;
|
|
2282
2310
|
case "invalid_value":
|
|
2283
|
-
return o.values.length === 1 ? `Invalid input: expected ${
|
|
2311
|
+
return o.values.length === 1 ? `Invalid input: expected ${gr(o.values[0])}` : `Invalid option: expected one of ${wt(o.values, "|")}`;
|
|
2284
2312
|
case "too_big": {
|
|
2285
2313
|
const s = o.exact ? "exactly " : o.inclusive ? "<=" : "<", a = t(o.origin);
|
|
2286
2314
|
return a ? `Too big: expected ${o.origin ?? "value"} to have ${s}${o.maximum.toString()} ${a.unit ?? "elements"}` : `Too big: expected ${o.origin ?? "value"} to be ${s}${o.maximum.toString()}`;
|
|
@@ -2296,7 +2324,7 @@ var is = () => {
|
|
|
2296
2324
|
case "not_multiple_of":
|
|
2297
2325
|
return `Invalid number: must be a multiple of ${o.divisor}`;
|
|
2298
2326
|
case "unrecognized_keys":
|
|
2299
|
-
return `Unrecognized key${o.keys.length > 1 ? "s" : ""}: ${
|
|
2327
|
+
return `Unrecognized key${o.keys.length > 1 ? "s" : ""}: ${wt(o.keys, ", ")}`;
|
|
2300
2328
|
case "invalid_key":
|
|
2301
2329
|
return `Invalid key in ${o.origin}`;
|
|
2302
2330
|
case "invalid_union":
|
|
@@ -2308,10 +2336,10 @@ var is = () => {
|
|
|
2308
2336
|
}
|
|
2309
2337
|
};
|
|
2310
2338
|
};
|
|
2311
|
-
function
|
|
2312
|
-
return { localeError:
|
|
2339
|
+
function cs() {
|
|
2340
|
+
return { localeError: as() };
|
|
2313
2341
|
}
|
|
2314
|
-
var
|
|
2342
|
+
var Dt, us = class {
|
|
2315
2343
|
constructor() {
|
|
2316
2344
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
2317
2345
|
}
|
|
@@ -2343,23 +2371,23 @@ var Mt, ss = class {
|
|
|
2343
2371
|
return this._map.has(e);
|
|
2344
2372
|
}
|
|
2345
2373
|
};
|
|
2346
|
-
function
|
|
2347
|
-
return new
|
|
2374
|
+
function ls() {
|
|
2375
|
+
return new us();
|
|
2348
2376
|
}
|
|
2349
|
-
(
|
|
2377
|
+
(Dt = globalThis).__zod_globalRegistry ?? (Dt.__zod_globalRegistry = ls());
|
|
2350
2378
|
var ue = globalThis.__zod_globalRegistry;
|
|
2351
2379
|
function Dr(e) {
|
|
2352
2380
|
return e.checks && (e.checks = [...e.checks]), e;
|
|
2353
2381
|
}
|
|
2354
2382
|
// @__NO_SIDE_EFFECTS__
|
|
2355
|
-
function
|
|
2383
|
+
function fs(e, t) {
|
|
2356
2384
|
return new e(Dr({
|
|
2357
2385
|
type: "string",
|
|
2358
2386
|
...g(t)
|
|
2359
2387
|
}));
|
|
2360
2388
|
}
|
|
2361
2389
|
// @__NO_SIDE_EFFECTS__
|
|
2362
|
-
function
|
|
2390
|
+
function ds(e, t) {
|
|
2363
2391
|
return new e({
|
|
2364
2392
|
type: "string",
|
|
2365
2393
|
format: "email",
|
|
@@ -2369,7 +2397,7 @@ function us(e, t) {
|
|
|
2369
2397
|
});
|
|
2370
2398
|
}
|
|
2371
2399
|
// @__NO_SIDE_EFFECTS__
|
|
2372
|
-
function
|
|
2400
|
+
function hs(e, t) {
|
|
2373
2401
|
return new e({
|
|
2374
2402
|
type: "string",
|
|
2375
2403
|
format: "guid",
|
|
@@ -2379,7 +2407,7 @@ function ls(e, t) {
|
|
|
2379
2407
|
});
|
|
2380
2408
|
}
|
|
2381
2409
|
// @__NO_SIDE_EFFECTS__
|
|
2382
|
-
function
|
|
2410
|
+
function ps(e, t) {
|
|
2383
2411
|
return new e({
|
|
2384
2412
|
type: "string",
|
|
2385
2413
|
format: "uuid",
|
|
@@ -2389,7 +2417,7 @@ function fs(e, t) {
|
|
|
2389
2417
|
});
|
|
2390
2418
|
}
|
|
2391
2419
|
// @__NO_SIDE_EFFECTS__
|
|
2392
|
-
function
|
|
2420
|
+
function ms(e, t) {
|
|
2393
2421
|
return new e({
|
|
2394
2422
|
type: "string",
|
|
2395
2423
|
format: "uuid",
|
|
@@ -2400,7 +2428,7 @@ function ds(e, t) {
|
|
|
2400
2428
|
});
|
|
2401
2429
|
}
|
|
2402
2430
|
// @__NO_SIDE_EFFECTS__
|
|
2403
|
-
function
|
|
2431
|
+
function gs(e, t) {
|
|
2404
2432
|
return new e({
|
|
2405
2433
|
type: "string",
|
|
2406
2434
|
format: "uuid",
|
|
@@ -2411,7 +2439,7 @@ function hs(e, t) {
|
|
|
2411
2439
|
});
|
|
2412
2440
|
}
|
|
2413
2441
|
// @__NO_SIDE_EFFECTS__
|
|
2414
|
-
function
|
|
2442
|
+
function vs(e, t) {
|
|
2415
2443
|
return new e({
|
|
2416
2444
|
type: "string",
|
|
2417
2445
|
format: "uuid",
|
|
@@ -2422,7 +2450,7 @@ function ps(e, t) {
|
|
|
2422
2450
|
});
|
|
2423
2451
|
}
|
|
2424
2452
|
// @__NO_SIDE_EFFECTS__
|
|
2425
|
-
function
|
|
2453
|
+
function bs(e, t) {
|
|
2426
2454
|
return new e({
|
|
2427
2455
|
type: "string",
|
|
2428
2456
|
format: "url",
|
|
@@ -2432,7 +2460,7 @@ function ms(e, t) {
|
|
|
2432
2460
|
});
|
|
2433
2461
|
}
|
|
2434
2462
|
// @__NO_SIDE_EFFECTS__
|
|
2435
|
-
function
|
|
2463
|
+
function _s(e, t) {
|
|
2436
2464
|
return new e({
|
|
2437
2465
|
type: "string",
|
|
2438
2466
|
format: "emoji",
|
|
@@ -2442,7 +2470,7 @@ function gs(e, t) {
|
|
|
2442
2470
|
});
|
|
2443
2471
|
}
|
|
2444
2472
|
// @__NO_SIDE_EFFECTS__
|
|
2445
|
-
function
|
|
2473
|
+
function ys(e, t) {
|
|
2446
2474
|
return new e({
|
|
2447
2475
|
type: "string",
|
|
2448
2476
|
format: "nanoid",
|
|
@@ -2452,7 +2480,7 @@ function vs(e, t) {
|
|
|
2452
2480
|
});
|
|
2453
2481
|
}
|
|
2454
2482
|
// @__NO_SIDE_EFFECTS__
|
|
2455
|
-
function
|
|
2483
|
+
function ws(e, t) {
|
|
2456
2484
|
return new e({
|
|
2457
2485
|
type: "string",
|
|
2458
2486
|
format: "cuid",
|
|
@@ -2462,7 +2490,7 @@ function bs(e, t) {
|
|
|
2462
2490
|
});
|
|
2463
2491
|
}
|
|
2464
2492
|
// @__NO_SIDE_EFFECTS__
|
|
2465
|
-
function
|
|
2493
|
+
function ks(e, t) {
|
|
2466
2494
|
return new e({
|
|
2467
2495
|
type: "string",
|
|
2468
2496
|
format: "cuid2",
|
|
@@ -2472,7 +2500,7 @@ function _s(e, t) {
|
|
|
2472
2500
|
});
|
|
2473
2501
|
}
|
|
2474
2502
|
// @__NO_SIDE_EFFECTS__
|
|
2475
|
-
function
|
|
2503
|
+
function Os(e, t) {
|
|
2476
2504
|
return new e({
|
|
2477
2505
|
type: "string",
|
|
2478
2506
|
format: "ulid",
|
|
@@ -2482,7 +2510,7 @@ function ys(e, t) {
|
|
|
2482
2510
|
});
|
|
2483
2511
|
}
|
|
2484
2512
|
// @__NO_SIDE_EFFECTS__
|
|
2485
|
-
function
|
|
2513
|
+
function zs(e, t) {
|
|
2486
2514
|
return new e({
|
|
2487
2515
|
type: "string",
|
|
2488
2516
|
format: "xid",
|
|
@@ -2492,7 +2520,7 @@ function ws(e, t) {
|
|
|
2492
2520
|
});
|
|
2493
2521
|
}
|
|
2494
2522
|
// @__NO_SIDE_EFFECTS__
|
|
2495
|
-
function
|
|
2523
|
+
function Ss(e, t) {
|
|
2496
2524
|
return new e({
|
|
2497
2525
|
type: "string",
|
|
2498
2526
|
format: "ksuid",
|
|
@@ -2502,7 +2530,7 @@ function ks(e, t) {
|
|
|
2502
2530
|
});
|
|
2503
2531
|
}
|
|
2504
2532
|
// @__NO_SIDE_EFFECTS__
|
|
2505
|
-
function
|
|
2533
|
+
function $s(e, t) {
|
|
2506
2534
|
return new e({
|
|
2507
2535
|
type: "string",
|
|
2508
2536
|
format: "ipv4",
|
|
@@ -2512,7 +2540,7 @@ function Os(e, t) {
|
|
|
2512
2540
|
});
|
|
2513
2541
|
}
|
|
2514
2542
|
// @__NO_SIDE_EFFECTS__
|
|
2515
|
-
function
|
|
2543
|
+
function Es(e, t) {
|
|
2516
2544
|
return new e({
|
|
2517
2545
|
type: "string",
|
|
2518
2546
|
format: "ipv6",
|
|
@@ -2522,7 +2550,7 @@ function zs(e, t) {
|
|
|
2522
2550
|
});
|
|
2523
2551
|
}
|
|
2524
2552
|
// @__NO_SIDE_EFFECTS__
|
|
2525
|
-
function
|
|
2553
|
+
function Is(e, t) {
|
|
2526
2554
|
return new e({
|
|
2527
2555
|
type: "string",
|
|
2528
2556
|
format: "cidrv4",
|
|
@@ -2532,7 +2560,7 @@ function Ss(e, t) {
|
|
|
2532
2560
|
});
|
|
2533
2561
|
}
|
|
2534
2562
|
// @__NO_SIDE_EFFECTS__
|
|
2535
|
-
function
|
|
2563
|
+
function As(e, t) {
|
|
2536
2564
|
return new e({
|
|
2537
2565
|
type: "string",
|
|
2538
2566
|
format: "cidrv6",
|
|
@@ -2542,7 +2570,7 @@ function Es(e, t) {
|
|
|
2542
2570
|
});
|
|
2543
2571
|
}
|
|
2544
2572
|
// @__NO_SIDE_EFFECTS__
|
|
2545
|
-
function
|
|
2573
|
+
function Ts(e, t) {
|
|
2546
2574
|
return new e({
|
|
2547
2575
|
type: "string",
|
|
2548
2576
|
format: "base64",
|
|
@@ -2552,7 +2580,7 @@ function $s(e, t) {
|
|
|
2552
2580
|
});
|
|
2553
2581
|
}
|
|
2554
2582
|
// @__NO_SIDE_EFFECTS__
|
|
2555
|
-
function
|
|
2583
|
+
function Ps(e, t) {
|
|
2556
2584
|
return new e({
|
|
2557
2585
|
type: "string",
|
|
2558
2586
|
format: "base64url",
|
|
@@ -2562,7 +2590,7 @@ function Is(e, t) {
|
|
|
2562
2590
|
});
|
|
2563
2591
|
}
|
|
2564
2592
|
// @__NO_SIDE_EFFECTS__
|
|
2565
|
-
function
|
|
2593
|
+
function Zs(e, t) {
|
|
2566
2594
|
return new e({
|
|
2567
2595
|
type: "string",
|
|
2568
2596
|
format: "e164",
|
|
@@ -2572,7 +2600,7 @@ function As(e, t) {
|
|
|
2572
2600
|
});
|
|
2573
2601
|
}
|
|
2574
2602
|
// @__NO_SIDE_EFFECTS__
|
|
2575
|
-
function
|
|
2603
|
+
function Cs(e, t) {
|
|
2576
2604
|
return new e({
|
|
2577
2605
|
type: "string",
|
|
2578
2606
|
format: "jwt",
|
|
@@ -2582,7 +2610,7 @@ function Ts(e, t) {
|
|
|
2582
2610
|
});
|
|
2583
2611
|
}
|
|
2584
2612
|
// @__NO_SIDE_EFFECTS__
|
|
2585
|
-
function
|
|
2613
|
+
function Rs(e, t) {
|
|
2586
2614
|
return new e({
|
|
2587
2615
|
type: "string",
|
|
2588
2616
|
format: "datetime",
|
|
@@ -2594,7 +2622,7 @@ function Ps(e, t) {
|
|
|
2594
2622
|
});
|
|
2595
2623
|
}
|
|
2596
2624
|
// @__NO_SIDE_EFFECTS__
|
|
2597
|
-
function
|
|
2625
|
+
function Ns(e, t) {
|
|
2598
2626
|
return new e({
|
|
2599
2627
|
type: "string",
|
|
2600
2628
|
format: "date",
|
|
@@ -2603,7 +2631,7 @@ function Zs(e, t) {
|
|
|
2603
2631
|
});
|
|
2604
2632
|
}
|
|
2605
2633
|
// @__NO_SIDE_EFFECTS__
|
|
2606
|
-
function
|
|
2634
|
+
function js(e, t) {
|
|
2607
2635
|
return new e({
|
|
2608
2636
|
type: "string",
|
|
2609
2637
|
format: "time",
|
|
@@ -2613,7 +2641,7 @@ function Cs(e, t) {
|
|
|
2613
2641
|
});
|
|
2614
2642
|
}
|
|
2615
2643
|
// @__NO_SIDE_EFFECTS__
|
|
2616
|
-
function
|
|
2644
|
+
function xs(e, t) {
|
|
2617
2645
|
return new e({
|
|
2618
2646
|
type: "string",
|
|
2619
2647
|
format: "duration",
|
|
@@ -2622,7 +2650,7 @@ function Rs(e, t) {
|
|
|
2622
2650
|
});
|
|
2623
2651
|
}
|
|
2624
2652
|
// @__NO_SIDE_EFFECTS__
|
|
2625
|
-
function
|
|
2653
|
+
function Ms(e, t) {
|
|
2626
2654
|
return new e(Dr({
|
|
2627
2655
|
type: "number",
|
|
2628
2656
|
checks: [],
|
|
@@ -2630,7 +2658,7 @@ function Ns(e, t) {
|
|
|
2630
2658
|
}));
|
|
2631
2659
|
}
|
|
2632
2660
|
// @__NO_SIDE_EFFECTS__
|
|
2633
|
-
function
|
|
2661
|
+
function Ds(e, t) {
|
|
2634
2662
|
return new e({
|
|
2635
2663
|
type: "number",
|
|
2636
2664
|
check: "number_format",
|
|
@@ -2640,25 +2668,25 @@ function js(e, t) {
|
|
|
2640
2668
|
});
|
|
2641
2669
|
}
|
|
2642
2670
|
// @__NO_SIDE_EFFECTS__
|
|
2643
|
-
function
|
|
2671
|
+
function Ls(e, t) {
|
|
2644
2672
|
return new e({
|
|
2645
2673
|
type: "boolean",
|
|
2646
2674
|
...g(t)
|
|
2647
2675
|
});
|
|
2648
2676
|
}
|
|
2649
2677
|
// @__NO_SIDE_EFFECTS__
|
|
2650
|
-
function
|
|
2678
|
+
function Us(e) {
|
|
2651
2679
|
return new e({ type: "unknown" });
|
|
2652
2680
|
}
|
|
2653
2681
|
// @__NO_SIDE_EFFECTS__
|
|
2654
|
-
function
|
|
2682
|
+
function Fs(e, t) {
|
|
2655
2683
|
return new e({
|
|
2656
2684
|
type: "never",
|
|
2657
2685
|
...g(t)
|
|
2658
2686
|
});
|
|
2659
2687
|
}
|
|
2660
2688
|
// @__NO_SIDE_EFFECTS__
|
|
2661
|
-
function
|
|
2689
|
+
function Lt(e, t) {
|
|
2662
2690
|
return new Sr({
|
|
2663
2691
|
check: "less_than",
|
|
2664
2692
|
...g(t),
|
|
@@ -2676,8 +2704,8 @@ function Be(e, t) {
|
|
|
2676
2704
|
});
|
|
2677
2705
|
}
|
|
2678
2706
|
// @__NO_SIDE_EFFECTS__
|
|
2679
|
-
function
|
|
2680
|
-
return new
|
|
2707
|
+
function Ut(e, t) {
|
|
2708
|
+
return new $r({
|
|
2681
2709
|
check: "greater_than",
|
|
2682
2710
|
...g(t),
|
|
2683
2711
|
value: e,
|
|
@@ -2686,7 +2714,7 @@ function Lt(e, t) {
|
|
|
2686
2714
|
}
|
|
2687
2715
|
// @__NO_SIDE_EFFECTS__
|
|
2688
2716
|
function Je(e, t) {
|
|
2689
|
-
return new
|
|
2717
|
+
return new $r({
|
|
2690
2718
|
check: "greater_than",
|
|
2691
2719
|
...g(t),
|
|
2692
2720
|
value: e,
|
|
@@ -2694,8 +2722,8 @@ function Je(e, t) {
|
|
|
2694
2722
|
});
|
|
2695
2723
|
}
|
|
2696
2724
|
// @__NO_SIDE_EFFECTS__
|
|
2697
|
-
function
|
|
2698
|
-
return new
|
|
2725
|
+
function Ft(e, t) {
|
|
2726
|
+
return new Mi({
|
|
2699
2727
|
check: "multiple_of",
|
|
2700
2728
|
...g(t),
|
|
2701
2729
|
value: e
|
|
@@ -2703,7 +2731,7 @@ function Ut(e, t) {
|
|
|
2703
2731
|
}
|
|
2704
2732
|
// @__NO_SIDE_EFFECTS__
|
|
2705
2733
|
function Lr(e, t) {
|
|
2706
|
-
return new
|
|
2734
|
+
return new Li({
|
|
2707
2735
|
check: "max_length",
|
|
2708
2736
|
...g(t),
|
|
2709
2737
|
maximum: e
|
|
@@ -2711,7 +2739,7 @@ function Lr(e, t) {
|
|
|
2711
2739
|
}
|
|
2712
2740
|
// @__NO_SIDE_EFFECTS__
|
|
2713
2741
|
function Ae(e, t) {
|
|
2714
|
-
return new
|
|
2742
|
+
return new Ui({
|
|
2715
2743
|
check: "min_length",
|
|
2716
2744
|
...g(t),
|
|
2717
2745
|
minimum: e
|
|
@@ -2719,15 +2747,15 @@ function Ae(e, t) {
|
|
|
2719
2747
|
}
|
|
2720
2748
|
// @__NO_SIDE_EFFECTS__
|
|
2721
2749
|
function Ur(e, t) {
|
|
2722
|
-
return new
|
|
2750
|
+
return new Fi({
|
|
2723
2751
|
check: "length_equals",
|
|
2724
2752
|
...g(t),
|
|
2725
2753
|
length: e
|
|
2726
2754
|
});
|
|
2727
2755
|
}
|
|
2728
2756
|
// @__NO_SIDE_EFFECTS__
|
|
2729
|
-
function
|
|
2730
|
-
return new
|
|
2757
|
+
function Bs(e, t) {
|
|
2758
|
+
return new Bi({
|
|
2731
2759
|
check: "string_format",
|
|
2732
2760
|
format: "regex",
|
|
2733
2761
|
...g(t),
|
|
@@ -2735,24 +2763,24 @@ function Ls(e, t) {
|
|
|
2735
2763
|
});
|
|
2736
2764
|
}
|
|
2737
2765
|
// @__NO_SIDE_EFFECTS__
|
|
2738
|
-
function
|
|
2739
|
-
return new
|
|
2766
|
+
function Js(e) {
|
|
2767
|
+
return new Ji({
|
|
2740
2768
|
check: "string_format",
|
|
2741
2769
|
format: "lowercase",
|
|
2742
2770
|
...g(e)
|
|
2743
2771
|
});
|
|
2744
2772
|
}
|
|
2745
2773
|
// @__NO_SIDE_EFFECTS__
|
|
2746
|
-
function
|
|
2747
|
-
return new
|
|
2774
|
+
function Ws(e) {
|
|
2775
|
+
return new Wi({
|
|
2748
2776
|
check: "string_format",
|
|
2749
2777
|
format: "uppercase",
|
|
2750
2778
|
...g(e)
|
|
2751
2779
|
});
|
|
2752
2780
|
}
|
|
2753
2781
|
// @__NO_SIDE_EFFECTS__
|
|
2754
|
-
function
|
|
2755
|
-
return new
|
|
2782
|
+
function Vs(e, t) {
|
|
2783
|
+
return new Vi({
|
|
2756
2784
|
check: "string_format",
|
|
2757
2785
|
format: "includes",
|
|
2758
2786
|
...g(t),
|
|
@@ -2760,8 +2788,8 @@ function Bs(e, t) {
|
|
|
2760
2788
|
});
|
|
2761
2789
|
}
|
|
2762
2790
|
// @__NO_SIDE_EFFECTS__
|
|
2763
|
-
function
|
|
2764
|
-
return new
|
|
2791
|
+
function Ks(e, t) {
|
|
2792
|
+
return new Ki({
|
|
2765
2793
|
check: "string_format",
|
|
2766
2794
|
format: "starts_with",
|
|
2767
2795
|
...g(t),
|
|
@@ -2769,8 +2797,8 @@ function Js(e, t) {
|
|
|
2769
2797
|
});
|
|
2770
2798
|
}
|
|
2771
2799
|
// @__NO_SIDE_EFFECTS__
|
|
2772
|
-
function
|
|
2773
|
-
return new
|
|
2800
|
+
function Hs(e, t) {
|
|
2801
|
+
return new Hi({
|
|
2774
2802
|
check: "string_format",
|
|
2775
2803
|
format: "ends_with",
|
|
2776
2804
|
...g(t),
|
|
@@ -2779,33 +2807,33 @@ function Ws(e, t) {
|
|
|
2779
2807
|
}
|
|
2780
2808
|
// @__NO_SIDE_EFFECTS__
|
|
2781
2809
|
function re(e) {
|
|
2782
|
-
return new
|
|
2810
|
+
return new Gi({
|
|
2783
2811
|
check: "overwrite",
|
|
2784
2812
|
tx: e
|
|
2785
2813
|
});
|
|
2786
2814
|
}
|
|
2787
2815
|
// @__NO_SIDE_EFFECTS__
|
|
2788
|
-
function
|
|
2816
|
+
function Gs(e) {
|
|
2789
2817
|
return /* @__PURE__ */ re((t) => t.normalize(e));
|
|
2790
2818
|
}
|
|
2791
2819
|
// @__NO_SIDE_EFFECTS__
|
|
2792
|
-
function
|
|
2820
|
+
function qs() {
|
|
2793
2821
|
return /* @__PURE__ */ re((e) => e.trim());
|
|
2794
2822
|
}
|
|
2795
2823
|
// @__NO_SIDE_EFFECTS__
|
|
2796
|
-
function
|
|
2824
|
+
function Ys() {
|
|
2797
2825
|
return /* @__PURE__ */ re((e) => e.toLowerCase());
|
|
2798
2826
|
}
|
|
2799
2827
|
// @__NO_SIDE_EFFECTS__
|
|
2800
|
-
function
|
|
2828
|
+
function Xs() {
|
|
2801
2829
|
return /* @__PURE__ */ re((e) => e.toUpperCase());
|
|
2802
2830
|
}
|
|
2803
2831
|
// @__NO_SIDE_EFFECTS__
|
|
2804
|
-
function
|
|
2832
|
+
function Qs() {
|
|
2805
2833
|
return /* @__PURE__ */ re((e) => yn(e));
|
|
2806
2834
|
}
|
|
2807
2835
|
// @__NO_SIDE_EFFECTS__
|
|
2808
|
-
function
|
|
2836
|
+
function ea(e, t, r) {
|
|
2809
2837
|
return new e({
|
|
2810
2838
|
type: "array",
|
|
2811
2839
|
element: t,
|
|
@@ -2813,7 +2841,7 @@ function Ys(e, t, r) {
|
|
|
2813
2841
|
});
|
|
2814
2842
|
}
|
|
2815
2843
|
// @__NO_SIDE_EFFECTS__
|
|
2816
|
-
function
|
|
2844
|
+
function ta(e, t, r) {
|
|
2817
2845
|
const n = g(r);
|
|
2818
2846
|
return n.abort ?? (n.abort = !0), new e({
|
|
2819
2847
|
type: "custom",
|
|
@@ -2823,7 +2851,7 @@ function Xs(e, t, r) {
|
|
|
2823
2851
|
});
|
|
2824
2852
|
}
|
|
2825
2853
|
// @__NO_SIDE_EFFECTS__
|
|
2826
|
-
function
|
|
2854
|
+
function ra(e, t, r) {
|
|
2827
2855
|
return new e({
|
|
2828
2856
|
type: "custom",
|
|
2829
2857
|
check: "custom",
|
|
@@ -2832,8 +2860,8 @@ function Qs(e, t, r) {
|
|
|
2832
2860
|
});
|
|
2833
2861
|
}
|
|
2834
2862
|
// @__NO_SIDE_EFFECTS__
|
|
2835
|
-
function
|
|
2836
|
-
const r = /* @__PURE__ */
|
|
2863
|
+
function na(e, t) {
|
|
2864
|
+
const r = /* @__PURE__ */ ia((n) => (n.addIssue = (i) => {
|
|
2837
2865
|
if (typeof i == "string") n.issues.push(he(i, n.value, r._zod.def));
|
|
2838
2866
|
else {
|
|
2839
2867
|
const o = i;
|
|
@@ -2843,7 +2871,7 @@ function ea(e, t) {
|
|
|
2843
2871
|
return r;
|
|
2844
2872
|
}
|
|
2845
2873
|
// @__NO_SIDE_EFFECTS__
|
|
2846
|
-
function
|
|
2874
|
+
function ia(e, t) {
|
|
2847
2875
|
const r = new T({
|
|
2848
2876
|
check: "custom",
|
|
2849
2877
|
...g(t)
|
|
@@ -2920,7 +2948,7 @@ function I(e, t, r = {
|
|
|
2920
2948
|
const c = t.metadataRegistry.get(e);
|
|
2921
2949
|
return c && fe(s.schema, c), t.io === "input" && A(e) && (delete s.schema.examples, delete s.schema.default), t.io === "input" && "_prefault" in s.schema && ((n = s.schema).default ?? (n.default = s.schema._prefault)), delete s.schema._prefault, t.seen.get(e).schema;
|
|
2922
2950
|
}
|
|
2923
|
-
function
|
|
2951
|
+
function Bt(e) {
|
|
2924
2952
|
return e.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
2925
2953
|
}
|
|
2926
2954
|
function Br(e, t) {
|
|
@@ -2944,7 +2972,7 @@ function Br(e, t) {
|
|
|
2944
2972
|
const p = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
|
|
2945
2973
|
return s[1].defId = p, {
|
|
2946
2974
|
defId: p,
|
|
2947
|
-
ref: `${h("__shared")}#/${a}/${
|
|
2975
|
+
ref: `${h("__shared")}#/${a}/${Bt(p)}`
|
|
2948
2976
|
};
|
|
2949
2977
|
}
|
|
2950
2978
|
const c = "#", u = `${c}/${a}/`;
|
|
@@ -2952,7 +2980,7 @@ function Br(e, t) {
|
|
|
2952
2980
|
const f = s[1].schema.id ?? `__schema${e.counter++}`;
|
|
2953
2981
|
return {
|
|
2954
2982
|
defId: f,
|
|
2955
|
-
ref: u +
|
|
2983
|
+
ref: u + Bt(f)
|
|
2956
2984
|
};
|
|
2957
2985
|
}, o = (s) => {
|
|
2958
2986
|
if (s[1].schema.$ref) return;
|
|
@@ -3015,12 +3043,12 @@ var Wr = /* @__PURE__ */ new Set([
|
|
|
3015
3043
|
"properties",
|
|
3016
3044
|
"required",
|
|
3017
3045
|
"additionalProperties"
|
|
3018
|
-
]),
|
|
3019
|
-
function
|
|
3046
|
+
]), Jt = ["oneOf", "anyOf"];
|
|
3047
|
+
function Wt(e) {
|
|
3020
3048
|
const t = e.additionalProperties;
|
|
3021
3049
|
return t === void 0 || t === !1 || typeof t != "object" || t === null ? null : Object.keys(t).length ? t : null;
|
|
3022
3050
|
}
|
|
3023
|
-
function
|
|
3051
|
+
function Qe(e) {
|
|
3024
3052
|
const t = [];
|
|
3025
3053
|
for (const o of e) {
|
|
3026
3054
|
if (typeof o != "object" || o.type !== "object") return null;
|
|
@@ -3033,10 +3061,10 @@ function Xe(e) {
|
|
|
3033
3061
|
if (Object.prototype.hasOwnProperty.call(r, s)) continue;
|
|
3034
3062
|
const a = [];
|
|
3035
3063
|
for (const u of t) {
|
|
3036
|
-
const f = u.properties?.[s] ??
|
|
3064
|
+
const f = u.properties?.[s] ?? Wt(u);
|
|
3037
3065
|
f != null && (a.some((d) => JSON.stringify(d) === JSON.stringify(f)) || a.push(f));
|
|
3038
3066
|
}
|
|
3039
|
-
const c = a.length === 1 ? a[0] :
|
|
3067
|
+
const c = a.length === 1 ? a[0] : Qe(a) ?? { allOf: a };
|
|
3040
3068
|
q(r, s, c);
|
|
3041
3069
|
}
|
|
3042
3070
|
for (const s of o.required ?? []) n.add(s);
|
|
@@ -3049,24 +3077,24 @@ function Xe(e) {
|
|
|
3049
3077
|
else {
|
|
3050
3078
|
const o = [];
|
|
3051
3079
|
for (const s of t) {
|
|
3052
|
-
const a =
|
|
3080
|
+
const a = Wt(s);
|
|
3053
3081
|
a && !o.some((c) => JSON.stringify(c) === JSON.stringify(a)) && o.push(a);
|
|
3054
3082
|
}
|
|
3055
3083
|
o.length === 1 ? i.additionalProperties = o[0] : o.length > 1 && (i.additionalProperties = { allOf: o });
|
|
3056
3084
|
}
|
|
3057
3085
|
return i;
|
|
3058
3086
|
}
|
|
3059
|
-
function
|
|
3087
|
+
function oa(e) {
|
|
3060
3088
|
const t = e.allOf;
|
|
3061
3089
|
if (!Array.isArray(t) || t.length < 2) return;
|
|
3062
3090
|
for (const i of Wr) if (i in e) return;
|
|
3063
|
-
const r = t.filter((i) =>
|
|
3091
|
+
const r = t.filter((i) => Jt.some((o) => Array.isArray(i[o])));
|
|
3064
3092
|
let n = null;
|
|
3065
|
-
if (!r.length) n =
|
|
3093
|
+
if (!r.length) n = Qe(t);
|
|
3066
3094
|
else {
|
|
3067
|
-
const i = r[0], o =
|
|
3095
|
+
const i = r[0], o = Jt.find((c) => Array.isArray(i[c]));
|
|
3068
3096
|
if (Object.keys(i).length !== 1) return;
|
|
3069
|
-
const s = t.filter((c) => c !== i), a = i[o].map((c) =>
|
|
3097
|
+
const s = t.filter((c) => c !== i), a = i[o].map((c) => Qe([...s, c]));
|
|
3070
3098
|
if (a.some((c) => !c)) return;
|
|
3071
3099
|
n = { [o]: a };
|
|
3072
3100
|
}
|
|
@@ -3113,7 +3141,7 @@ function Vr(e, t) {
|
|
|
3113
3141
|
const d = a.get(f);
|
|
3114
3142
|
d ? d.push(u) : a.set(f, [u]);
|
|
3115
3143
|
}
|
|
3116
|
-
for (const c of e.intersections) for (const u of a.get(c) ?? [])
|
|
3144
|
+
for (const c of e.intersections) for (const u of a.get(c) ?? []) oa(u);
|
|
3117
3145
|
}
|
|
3118
3146
|
}
|
|
3119
3147
|
const i = {};
|
|
@@ -3176,7 +3204,7 @@ function A(e, t) {
|
|
|
3176
3204
|
}
|
|
3177
3205
|
return !1;
|
|
3178
3206
|
}
|
|
3179
|
-
var
|
|
3207
|
+
var sa = (e, t = {}) => (r) => {
|
|
3180
3208
|
const n = Fr({
|
|
3181
3209
|
...r,
|
|
3182
3210
|
processors: t
|
|
@@ -3194,7 +3222,7 @@ var na = (e, t = {}) => (r) => {
|
|
|
3194
3222
|
(e[t] === void 0 || r > e[t]) && (e[t] = r);
|
|
3195
3223
|
}, ee = (e, t, r) => {
|
|
3196
3224
|
(e[t] === void 0 || r < e[t]) && (e[t] = r);
|
|
3197
|
-
},
|
|
3225
|
+
}, Vt = (e, t) => {
|
|
3198
3226
|
Q(e, "minimum", t), ee(e, "maximum", t);
|
|
3199
3227
|
}, Kr = (e, t) => {
|
|
3200
3228
|
e.multipleOf ?? (e.multipleOf = []), e.multipleOf.includes(t) || e.multipleOf.push(t);
|
|
@@ -3204,22 +3232,22 @@ var na = (e, t = {}) => (r) => {
|
|
|
3204
3232
|
e.mime = e.mime ? e.mime.filter((r) => t.includes(r)) : [...t];
|
|
3205
3233
|
}, qr = (e, t) => {
|
|
3206
3234
|
e.format = t, t.includes("int") && (e.isInt = !0);
|
|
3207
|
-
},
|
|
3235
|
+
}, Kt = (e, t) => Q(e, "minimum", t.minimum), Ht = (e, t) => ee(e, "maximum", t.maximum), Gt = (e) => (t, r) => {
|
|
3208
3236
|
qr(t, r.format);
|
|
3209
3237
|
const [n, i] = e[r.format];
|
|
3210
3238
|
Q(t, "minimum", n), ee(t, "maximum", i);
|
|
3211
|
-
},
|
|
3239
|
+
}, aa = {
|
|
3212
3240
|
greater_than: (e, t) => Q(e, t.inclusive ? "minimum" : "exclusiveMinimum", t.value),
|
|
3213
3241
|
less_than: (e, t) => ee(e, t.inclusive ? "maximum" : "exclusiveMaximum", t.value),
|
|
3214
3242
|
multiple_of: (e, t) => Kr(e, t.value),
|
|
3215
|
-
number_format:
|
|
3216
|
-
bigint_format:
|
|
3217
|
-
min_length:
|
|
3218
|
-
max_length:
|
|
3219
|
-
length_equals: (e, t) =>
|
|
3220
|
-
min_size:
|
|
3221
|
-
max_size:
|
|
3222
|
-
size_equals: (e, t) =>
|
|
3243
|
+
number_format: Gt(vr),
|
|
3244
|
+
bigint_format: Gt(zn),
|
|
3245
|
+
min_length: Kt,
|
|
3246
|
+
max_length: Ht,
|
|
3247
|
+
length_equals: (e, t) => Vt(e, t.length),
|
|
3248
|
+
min_size: Kt,
|
|
3249
|
+
max_size: Ht,
|
|
3250
|
+
size_equals: (e, t) => Vt(e, t.size),
|
|
3223
3251
|
string_format: (e, t) => {
|
|
3224
3252
|
qr(e, t.format), t.pattern && Hr(e, t.pattern), (t.format === "base64" || t.format === "base64url") && (e.contentEncoding = t.format), (t.local || t.precision === -1) && (e.laxFormat = !0);
|
|
3225
3253
|
},
|
|
@@ -3227,30 +3255,30 @@ var na = (e, t = {}) => (r) => {
|
|
|
3227
3255
|
};
|
|
3228
3256
|
function x(e) {
|
|
3229
3257
|
const t = {}, r = e._zod.def, n = e._zod.traits.has("$ZodCheck") ? [e, ...r.checks ?? []] : r.checks ?? [];
|
|
3230
|
-
for (const o of n)
|
|
3258
|
+
for (const o of n) aa[o._zod.def.check]?.(t, o._zod.def);
|
|
3231
3259
|
const i = e._zod.bag;
|
|
3232
3260
|
i.minimum !== void 0 && Q(t, "minimum", i.minimum), i.exclusiveMinimum !== void 0 && Q(t, "exclusiveMinimum", i.exclusiveMinimum), i.maximum !== void 0 && ee(t, "maximum", i.maximum), i.exclusiveMaximum !== void 0 && ee(t, "exclusiveMaximum", i.exclusiveMaximum), i.multipleOf !== void 0 && Kr(t, i.multipleOf), i.format !== void 0 && (t.format ?? (t.format = i.format), i.format.includes("int") && (t.isInt = !0)), i.mime && Gr(t, i.mime);
|
|
3233
3261
|
for (const o of i.patterns ?? []) Hr(t, o);
|
|
3234
3262
|
return t;
|
|
3235
3263
|
}
|
|
3236
|
-
var
|
|
3264
|
+
var ca = {
|
|
3237
3265
|
guid: "uuid",
|
|
3238
3266
|
url: "uri",
|
|
3239
3267
|
datetime: "date-time",
|
|
3240
3268
|
json_string: "json-string",
|
|
3241
3269
|
regex: ""
|
|
3242
|
-
},
|
|
3270
|
+
}, ua = /* @__PURE__ */ new Map([[Zr, Si], [ht, $i]]), la = (e) => ua.get(e) ?? e, fa = (e, t, r, n) => {
|
|
3243
3271
|
const i = r;
|
|
3244
3272
|
i.type = "string";
|
|
3245
3273
|
const { minimum: o, maximum: s, format: a, patterns: c, contentEncoding: u, laxFormat: f } = x(e);
|
|
3246
|
-
if (typeof o == "number" && (i.minLength = o), typeof s == "number" && (i.maxLength = s), a && (i.format =
|
|
3247
|
-
const d = [...c].map(
|
|
3274
|
+
if (typeof o == "number" && (i.minLength = o), typeof s == "number" && (i.maxLength = s), a && (i.format = ca[a] ?? a, i.format === "" && delete i.format, (a === "time" || f) && delete i.format), u && (i.contentEncoding = u), c && c.size > 0) {
|
|
3275
|
+
const d = [...c].map(la);
|
|
3248
3276
|
d.length === 1 ? i.pattern = d[0].source : d.length > 1 && (i.allOf = [...d.map((h) => ({
|
|
3249
3277
|
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
3250
3278
|
pattern: h.source
|
|
3251
3279
|
}))]);
|
|
3252
3280
|
}
|
|
3253
|
-
},
|
|
3281
|
+
}, da = (e, t, r, n) => {
|
|
3254
3282
|
const i = r, { minimum: o, maximum: s, multipleOf: a, exclusiveMaximum: c, exclusiveMinimum: u, isInt: f } = x(e);
|
|
3255
3283
|
i.type = f ? "integer" : "number";
|
|
3256
3284
|
const d = typeof u == "number" && u >= (o ?? Number.NEGATIVE_INFINITY), h = typeof c == "number" && c <= (s ?? Number.POSITIVE_INFINITY), p = t.target === "draft-04" || t.target === "openapi-3.0";
|
|
@@ -3260,34 +3288,34 @@ var oa = {
|
|
|
3260
3288
|
const [v, ...b] = m;
|
|
3261
3289
|
v !== void 0 && (i.multipleOf = v), b.length && (i.allOf = [...i.allOf ?? [], ...b.map((_) => ({ multipleOf: _ }))]);
|
|
3262
3290
|
}
|
|
3263
|
-
},
|
|
3291
|
+
}, ha = (e, t, r, n) => {
|
|
3264
3292
|
r.type = "boolean";
|
|
3265
|
-
},
|
|
3293
|
+
}, pa = (e, t, r, n) => {
|
|
3266
3294
|
r.not = {};
|
|
3267
|
-
},
|
|
3268
|
-
},
|
|
3295
|
+
}, ma = (e, t, r, n) => {
|
|
3296
|
+
}, ga = (e, t, r, n) => {
|
|
3269
3297
|
const i = e._zod.def, o = Ke(i.entries);
|
|
3270
3298
|
if (o.length === 0) {
|
|
3271
3299
|
r.not = {};
|
|
3272
3300
|
return;
|
|
3273
3301
|
}
|
|
3274
3302
|
o.every((s) => typeof s == "number") && (r.type = "number"), o.every((s) => typeof s == "string") && (r.type = "string"), r.enum = o;
|
|
3275
|
-
},
|
|
3303
|
+
}, va = (e, t, r, n) => {
|
|
3276
3304
|
ne(e, t, r, n, "Custom types cannot be represented in JSON Schema");
|
|
3277
|
-
},
|
|
3305
|
+
}, ba = (e, t, r, n) => {
|
|
3278
3306
|
ne(e, t, r, n, "Transforms cannot be represented in JSON Schema");
|
|
3279
|
-
},
|
|
3307
|
+
}, _a = (e, t, r, n) => {
|
|
3280
3308
|
const i = r, o = e._zod.def, { minimum: s, maximum: a } = x(e);
|
|
3281
3309
|
typeof s == "number" && (i.minItems = s), typeof a == "number" && (i.maxItems = a), i.type = "array", i.items = I(o.element, t, {
|
|
3282
3310
|
...n,
|
|
3283
3311
|
path: [...n.path, "items"]
|
|
3284
3312
|
});
|
|
3285
3313
|
};
|
|
3286
|
-
function
|
|
3314
|
+
function et(e) {
|
|
3287
3315
|
const t = e._zod.def;
|
|
3288
|
-
return t.type === "pipe" && t.in._zod.traits.has("$ZodTransform") ?
|
|
3316
|
+
return t.type === "pipe" && t.in._zod.traits.has("$ZodTransform") ? et(t.out) : t.type === "catch" ? et(t.innerType) : e._zod.optin;
|
|
3289
3317
|
}
|
|
3290
|
-
var
|
|
3318
|
+
var ya = (e, t, r, n) => {
|
|
3291
3319
|
const i = r, o = e._zod.def, s = o.shape;
|
|
3292
3320
|
if (Object.getOwnPropertySymbols(s).length && ne(e, t, i, n, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
3293
3321
|
i.type = "object", i.properties = {};
|
|
@@ -3302,13 +3330,13 @@ var va = (e, t, r, n) => {
|
|
|
3302
3330
|
const a = [];
|
|
3303
3331
|
for (const c of Object.keys(s)) {
|
|
3304
3332
|
const u = o.shape[c];
|
|
3305
|
-
(t.io === "input" ?
|
|
3333
|
+
(t.io === "input" ? et(u) === void 0 : u._zod.optout === void 0) && a.push(c);
|
|
3306
3334
|
}
|
|
3307
3335
|
a.length > 0 && (i.required = a), o.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : o.catchall ? o.catchall && (i.additionalProperties = I(o.catchall, t, {
|
|
3308
3336
|
...n,
|
|
3309
3337
|
path: [...n.path, "additionalProperties"]
|
|
3310
3338
|
})) : t.io === "output" && (i.additionalProperties = !1);
|
|
3311
|
-
},
|
|
3339
|
+
}, wa = (e, t, r, n) => {
|
|
3312
3340
|
const i = e._zod.def, o = i.inclusive === !1, s = i.options.map((a, c) => I(a, t, {
|
|
3313
3341
|
...n,
|
|
3314
3342
|
path: [
|
|
@@ -3318,7 +3346,7 @@ var va = (e, t, r, n) => {
|
|
|
3318
3346
|
]
|
|
3319
3347
|
}));
|
|
3320
3348
|
o ? r.oneOf = s : r.anyOf = s;
|
|
3321
|
-
},
|
|
3349
|
+
}, ka = (e, t, r, n) => {
|
|
3322
3350
|
const i = e._zod.def, o = I(i.left, t, {
|
|
3323
3351
|
...n,
|
|
3324
3352
|
path: [
|
|
@@ -3335,35 +3363,35 @@ var va = (e, t, r, n) => {
|
|
|
3335
3363
|
]
|
|
3336
3364
|
}), a = (u) => "allOf" in u && Object.keys(u).length === 1, c = [...a(o) ? o.allOf : [o], ...a(s) ? s.allOf : [s]];
|
|
3337
3365
|
r.allOf = c, t.intersections.push(c);
|
|
3338
|
-
},
|
|
3366
|
+
}, Oa = (e, t, r, n) => {
|
|
3339
3367
|
const i = e._zod.def, o = I(i.innerType, t, n), s = t.seen.get(e);
|
|
3340
3368
|
t.target === "openapi-3.0" ? (s.ref = i.innerType, r.nullable = !0) : r.anyOf = [o, { type: "null" }];
|
|
3341
|
-
},
|
|
3369
|
+
}, za = (e, t, r, n) => {
|
|
3342
3370
|
const i = e._zod.def;
|
|
3343
3371
|
I(i.innerType, t, n);
|
|
3344
3372
|
const o = t.seen.get(e);
|
|
3345
3373
|
o.ref = i.innerType;
|
|
3346
|
-
},
|
|
3374
|
+
}, pt = /* @__PURE__ */ Symbol();
|
|
3347
3375
|
function Yr(e, t, r, n, i) {
|
|
3348
3376
|
let o = !1;
|
|
3349
3377
|
const s = JSON.stringify(e, (a, c) => typeof c != "bigint" ? c : (o = !0, null));
|
|
3350
|
-
return o ? (ne(t, r, n, i, "BigInt defaults cannot be represented in JSON Schema"),
|
|
3378
|
+
return o ? (ne(t, r, n, i, "BigInt defaults cannot be represented in JSON Schema"), pt) : JSON.parse(s);
|
|
3351
3379
|
}
|
|
3352
|
-
var
|
|
3380
|
+
var Sa = (e, t, r, n) => {
|
|
3353
3381
|
const i = e._zod.def;
|
|
3354
3382
|
I(i.innerType, t, n);
|
|
3355
3383
|
const o = t.seen.get(e);
|
|
3356
3384
|
o.ref = i.innerType;
|
|
3357
3385
|
const s = Yr(i.defaultValue, e, t, r, n);
|
|
3358
|
-
s !==
|
|
3359
|
-
},
|
|
3386
|
+
s !== pt && (r.default = s);
|
|
3387
|
+
}, $a = (e, t, r, n) => {
|
|
3360
3388
|
const i = e._zod.def;
|
|
3361
3389
|
I(i.innerType, t, n);
|
|
3362
3390
|
const o = t.seen.get(e);
|
|
3363
3391
|
if (o.ref = i.innerType, t.io !== "input") return;
|
|
3364
3392
|
const s = Yr(i.defaultValue, e, t, r, n);
|
|
3365
|
-
s !==
|
|
3366
|
-
},
|
|
3393
|
+
s !== pt && (r._prefault = s);
|
|
3394
|
+
}, Ea = (e, t, r, n) => {
|
|
3367
3395
|
const i = e._zod.def;
|
|
3368
3396
|
I(i.innerType, t, n);
|
|
3369
3397
|
const o = t.seen.get(e);
|
|
@@ -3376,12 +3404,12 @@ var ka = (e, t, r, n) => {
|
|
|
3376
3404
|
return;
|
|
3377
3405
|
}
|
|
3378
3406
|
r.default = s;
|
|
3379
|
-
},
|
|
3407
|
+
}, Ia = (e, t, r, n) => {
|
|
3380
3408
|
const i = e._zod.def, o = i.in._zod.traits.has("$ZodTransform"), s = t.io === "input" ? o ? i.out : i.in : i.out;
|
|
3381
3409
|
I(s, t, n);
|
|
3382
3410
|
const a = t.seen.get(e);
|
|
3383
3411
|
a.ref = s;
|
|
3384
|
-
},
|
|
3412
|
+
}, Aa = (e, t, r, n) => {
|
|
3385
3413
|
const i = e._zod.def;
|
|
3386
3414
|
I(i.innerType, t, n);
|
|
3387
3415
|
const o = t.seen.get(e);
|
|
@@ -3391,7 +3419,7 @@ var ka = (e, t, r, n) => {
|
|
|
3391
3419
|
I(i.innerType, t, n);
|
|
3392
3420
|
const o = t.seen.get(e);
|
|
3393
3421
|
o.ref = i.innerType;
|
|
3394
|
-
},
|
|
3422
|
+
}, qt = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
3395
3423
|
function ve(e, t, r) {
|
|
3396
3424
|
Object.defineProperty(e, t, {
|
|
3397
3425
|
configurable: !0,
|
|
@@ -3413,10 +3441,10 @@ function ve(e, t, r) {
|
|
|
3413
3441
|
}
|
|
3414
3442
|
});
|
|
3415
3443
|
}
|
|
3416
|
-
var
|
|
3417
|
-
|
|
3444
|
+
var Ta = (e, t) => {
|
|
3445
|
+
Vn.init(e, t), e.name = "ZodError";
|
|
3418
3446
|
const r = Object.getPrototypeOf(e);
|
|
3419
|
-
|
|
3447
|
+
qt.has(r) || (qt.add(r), ve(r, "format", (n) => (i) => Gn(n, i)), ve(r, "flatten", (n) => (i) => Hn(n, i)), ve(r, "addIssue", (n) => (i) => {
|
|
3420
3448
|
n.issues.push(i), n.message = JSON.stringify(n.issues, He, 2);
|
|
3421
3449
|
}), ve(r, "addIssues", (n) => (i) => {
|
|
3422
3450
|
n.issues.push(...i), n.message = JSON.stringify(n.issues, He, 2);
|
|
@@ -3427,14 +3455,14 @@ var $a = (e, t) => {
|
|
|
3427
3455
|
return this.issues.length === 0;
|
|
3428
3456
|
}
|
|
3429
3457
|
}));
|
|
3430
|
-
}, C = /* @__PURE__ */ l("ZodError",
|
|
3431
|
-
function
|
|
3432
|
-
M.localeError || W(
|
|
3458
|
+
}, C = /* @__PURE__ */ l("ZodError", Ta, void 0, { Parent: Error }), Pa = /* @__PURE__ */ at(C), Za = /* @__PURE__ */ ct(C), Ca = /* @__PURE__ */ ut(C), Ra = /* @__PURE__ */ lt(C), Na = /* @__PURE__ */ ti(C), ja = /* @__PURE__ */ ri(C), xa = /* @__PURE__ */ ni(C), Ma = /* @__PURE__ */ ii(C), Da = /* @__PURE__ */ oi(C), La = /* @__PURE__ */ si(C), Ua = /* @__PURE__ */ ai(C), Fa = /* @__PURE__ */ ci(C);
|
|
3459
|
+
function Ba() {
|
|
3460
|
+
M.localeError || W(cs());
|
|
3433
3461
|
}
|
|
3434
|
-
function
|
|
3435
|
-
M.memoizer || W({ memoizer:
|
|
3462
|
+
function mt() {
|
|
3463
|
+
M.memoizer || W({ memoizer: os() });
|
|
3436
3464
|
}
|
|
3437
|
-
var
|
|
3465
|
+
var $ = /* @__PURE__ */ l("ZodType", (e, t) => (Ba(), S.init(e, t), e.def = t, e.type = t.type, e), {
|
|
3438
3466
|
check(...e) {
|
|
3439
3467
|
const t = this.def;
|
|
3440
3468
|
return this.clone(Z(t, { checks: [...t.checks ?? [], ...e.map((r) => typeof r == "function" ? { _zod: {
|
|
@@ -3456,55 +3484,55 @@ var E = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3456
3484
|
return e.add(this, t), this;
|
|
3457
3485
|
},
|
|
3458
3486
|
refine(e, t) {
|
|
3459
|
-
return this.check(
|
|
3487
|
+
return this.check(Mc(e, t));
|
|
3460
3488
|
},
|
|
3461
3489
|
superRefine(e, t) {
|
|
3462
|
-
return this.check(
|
|
3490
|
+
return this.check(Dc(e, t));
|
|
3463
3491
|
},
|
|
3464
3492
|
overwrite(e) {
|
|
3465
3493
|
return this.check(/* @__PURE__ */ re(e));
|
|
3466
3494
|
},
|
|
3467
3495
|
optional() {
|
|
3468
|
-
return
|
|
3496
|
+
return Qt(this);
|
|
3469
3497
|
},
|
|
3470
3498
|
exactOptional() {
|
|
3471
|
-
return
|
|
3499
|
+
return Sc(this);
|
|
3472
3500
|
},
|
|
3473
3501
|
nullable() {
|
|
3474
|
-
return
|
|
3502
|
+
return er(this);
|
|
3475
3503
|
},
|
|
3476
3504
|
nullish() {
|
|
3477
|
-
return
|
|
3505
|
+
return Qt(er(this));
|
|
3478
3506
|
},
|
|
3479
3507
|
nonoptional(e) {
|
|
3480
|
-
return
|
|
3508
|
+
return Pc(this, e);
|
|
3481
3509
|
},
|
|
3482
3510
|
array() {
|
|
3483
|
-
return
|
|
3511
|
+
return gt(this);
|
|
3484
3512
|
},
|
|
3485
3513
|
or(e) {
|
|
3486
3514
|
return tn([this, e]);
|
|
3487
3515
|
},
|
|
3488
3516
|
and(e) {
|
|
3489
|
-
return
|
|
3517
|
+
return kc(this, e);
|
|
3490
3518
|
},
|
|
3491
3519
|
transform(e) {
|
|
3492
|
-
return
|
|
3520
|
+
return tr(this, zc(e));
|
|
3493
3521
|
},
|
|
3494
3522
|
default(e) {
|
|
3495
|
-
return
|
|
3523
|
+
return Ic(this, e);
|
|
3496
3524
|
},
|
|
3497
3525
|
prefault(e) {
|
|
3498
|
-
return
|
|
3526
|
+
return Tc(this, e);
|
|
3499
3527
|
},
|
|
3500
3528
|
catch(e) {
|
|
3501
|
-
return
|
|
3529
|
+
return Cc(this, e);
|
|
3502
3530
|
},
|
|
3503
3531
|
pipe(e) {
|
|
3504
|
-
return
|
|
3532
|
+
return tr(this, e);
|
|
3505
3533
|
},
|
|
3506
3534
|
readonly() {
|
|
3507
|
-
return
|
|
3535
|
+
return jc(this);
|
|
3508
3536
|
},
|
|
3509
3537
|
describe(e) {
|
|
3510
3538
|
const t = this.clone();
|
|
@@ -3525,7 +3553,7 @@ var E = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3525
3553
|
return t.length === 0 ? e(this) : e(this, ...t);
|
|
3526
3554
|
},
|
|
3527
3555
|
get "~standard"() {
|
|
3528
|
-
return
|
|
3556
|
+
return yr(this, "~standard", {
|
|
3529
3557
|
...Ir(this),
|
|
3530
3558
|
jsonSchema: {
|
|
3531
3559
|
input: Te(this, "input"),
|
|
@@ -3537,16 +3565,16 @@ var E = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3537
3565
|
B(this, "~standard", e);
|
|
3538
3566
|
},
|
|
3539
3567
|
parse: function e(t, r) {
|
|
3540
|
-
return
|
|
3568
|
+
return Pa(this, t, r, { callee: e });
|
|
3541
3569
|
},
|
|
3542
3570
|
parseAsync: async function e(t, r) {
|
|
3543
|
-
return await
|
|
3571
|
+
return await Za(this, t, r, { callee: e });
|
|
3544
3572
|
},
|
|
3545
3573
|
safeParse(e, t) {
|
|
3546
|
-
return
|
|
3574
|
+
return Ca(this, e, t);
|
|
3547
3575
|
},
|
|
3548
3576
|
async safeParseAsync(e, t) {
|
|
3549
|
-
return
|
|
3577
|
+
return Ra(this, e, t);
|
|
3550
3578
|
},
|
|
3551
3579
|
get spa() {
|
|
3552
3580
|
return this?.safeParseAsync;
|
|
@@ -3555,37 +3583,37 @@ var E = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3555
3583
|
B(this, "spa", e);
|
|
3556
3584
|
},
|
|
3557
3585
|
validate(e, t) {
|
|
3558
|
-
return
|
|
3586
|
+
return Xn(this, e, t);
|
|
3559
3587
|
},
|
|
3560
3588
|
validateAsync(e, t) {
|
|
3561
|
-
return
|
|
3589
|
+
return ei(this, e, t);
|
|
3562
3590
|
},
|
|
3563
3591
|
encode: function e(t, r) {
|
|
3564
|
-
return
|
|
3592
|
+
return Na(this, t, r, { callee: e });
|
|
3565
3593
|
},
|
|
3566
3594
|
decode: function e(t, r) {
|
|
3567
|
-
return
|
|
3595
|
+
return ja(this, t, r, { callee: e });
|
|
3568
3596
|
},
|
|
3569
3597
|
encodeAsync: async function e(t, r) {
|
|
3570
|
-
return await
|
|
3598
|
+
return await xa(this, t, r, { callee: e });
|
|
3571
3599
|
},
|
|
3572
3600
|
decodeAsync: async function e(t, r) {
|
|
3573
|
-
return await
|
|
3601
|
+
return await Ma(this, t, r, { callee: e });
|
|
3574
3602
|
},
|
|
3575
3603
|
safeEncode(e, t) {
|
|
3576
|
-
return
|
|
3604
|
+
return Da(this, e, t);
|
|
3577
3605
|
},
|
|
3578
3606
|
safeDecode(e, t) {
|
|
3579
|
-
return
|
|
3607
|
+
return La(this, e, t);
|
|
3580
3608
|
},
|
|
3581
3609
|
async safeEncodeAsync(e, t) {
|
|
3582
|
-
return
|
|
3610
|
+
return Ua(this, e, t);
|
|
3583
3611
|
},
|
|
3584
3612
|
async safeDecodeAsync(e, t) {
|
|
3585
|
-
return
|
|
3613
|
+
return Fa(this, e, t);
|
|
3586
3614
|
},
|
|
3587
3615
|
toJSONSchema(e) {
|
|
3588
|
-
return
|
|
3616
|
+
return sa(this, {})(e);
|
|
3589
3617
|
},
|
|
3590
3618
|
get description() {
|
|
3591
3619
|
return ue.get(this)?.description;
|
|
@@ -3594,23 +3622,23 @@ var E = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3594
3622
|
return this._zod.def;
|
|
3595
3623
|
}
|
|
3596
3624
|
}), Qr = /* @__PURE__ */ l("_ZodString", (e, t) => {
|
|
3597
|
-
|
|
3598
|
-
}, /* @__PURE__ */
|
|
3625
|
+
dt.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => fa(e, r, n, i);
|
|
3626
|
+
}, /* @__PURE__ */ wr({
|
|
3599
3627
|
format: (e) => x(e).format ?? null,
|
|
3600
3628
|
minLength: (e) => x(e).minimum ?? null,
|
|
3601
3629
|
maxLength: (e) => x(e).maximum ?? null
|
|
3602
3630
|
}, {
|
|
3603
3631
|
regex(...e) {
|
|
3604
|
-
return this.check(/* @__PURE__ */
|
|
3632
|
+
return this.check(/* @__PURE__ */ Bs(...e));
|
|
3605
3633
|
},
|
|
3606
3634
|
includes(...e) {
|
|
3607
|
-
return this.check(/* @__PURE__ */
|
|
3635
|
+
return this.check(/* @__PURE__ */ Vs(...e));
|
|
3608
3636
|
},
|
|
3609
3637
|
startsWith(...e) {
|
|
3610
|
-
return this.check(/* @__PURE__ */
|
|
3638
|
+
return this.check(/* @__PURE__ */ Ks(...e));
|
|
3611
3639
|
},
|
|
3612
3640
|
endsWith(...e) {
|
|
3613
|
-
return this.check(/* @__PURE__ */
|
|
3641
|
+
return this.check(/* @__PURE__ */ Hs(...e));
|
|
3614
3642
|
},
|
|
3615
3643
|
min(...e) {
|
|
3616
3644
|
return this.check(/* @__PURE__ */ Ae(...e));
|
|
@@ -3625,162 +3653,162 @@ var E = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3625
3653
|
return this.check(/* @__PURE__ */ Ae(1, ...e));
|
|
3626
3654
|
},
|
|
3627
3655
|
lowercase(e) {
|
|
3628
|
-
return this.check(/* @__PURE__ */
|
|
3656
|
+
return this.check(/* @__PURE__ */ Js(e));
|
|
3629
3657
|
},
|
|
3630
3658
|
uppercase(e) {
|
|
3631
|
-
return this.check(/* @__PURE__ */
|
|
3659
|
+
return this.check(/* @__PURE__ */ Ws(e));
|
|
3632
3660
|
},
|
|
3633
3661
|
trim() {
|
|
3634
|
-
return this.check(/* @__PURE__ */
|
|
3662
|
+
return this.check(/* @__PURE__ */ qs());
|
|
3635
3663
|
},
|
|
3636
3664
|
normalize(...e) {
|
|
3637
|
-
return this.check(/* @__PURE__ */
|
|
3665
|
+
return this.check(/* @__PURE__ */ Gs(...e));
|
|
3638
3666
|
},
|
|
3639
3667
|
toLowerCase() {
|
|
3640
|
-
return this.check(/* @__PURE__ */
|
|
3668
|
+
return this.check(/* @__PURE__ */ Ys());
|
|
3641
3669
|
},
|
|
3642
3670
|
toUpperCase() {
|
|
3643
|
-
return this.check(/* @__PURE__ */
|
|
3671
|
+
return this.check(/* @__PURE__ */ Xs());
|
|
3644
3672
|
},
|
|
3645
3673
|
slugify() {
|
|
3646
|
-
return this.check(/* @__PURE__ */
|
|
3674
|
+
return this.check(/* @__PURE__ */ Qs());
|
|
3647
3675
|
}
|
|
3648
|
-
})),
|
|
3649
|
-
|
|
3676
|
+
})), Ja = /* @__PURE__ */ l("ZodString", (e, t) => {
|
|
3677
|
+
dt.init(e, t), Qr.init(e, t);
|
|
3650
3678
|
}, {
|
|
3651
3679
|
email(e) {
|
|
3652
|
-
return this.check(/* @__PURE__ */
|
|
3680
|
+
return this.check(/* @__PURE__ */ ds(Ga, e));
|
|
3653
3681
|
},
|
|
3654
3682
|
url(e) {
|
|
3655
|
-
return this.check(/* @__PURE__ */
|
|
3683
|
+
return this.check(/* @__PURE__ */ bs(Ya, e));
|
|
3656
3684
|
},
|
|
3657
3685
|
jwt(e) {
|
|
3658
|
-
return this.check(/* @__PURE__ */
|
|
3686
|
+
return this.check(/* @__PURE__ */ Cs(dc, e));
|
|
3659
3687
|
},
|
|
3660
3688
|
emoji(e) {
|
|
3661
|
-
return this.check(/* @__PURE__ */
|
|
3689
|
+
return this.check(/* @__PURE__ */ _s(Xa, e));
|
|
3662
3690
|
},
|
|
3663
3691
|
guid(e) {
|
|
3664
|
-
return this.check(/* @__PURE__ */
|
|
3692
|
+
return this.check(/* @__PURE__ */ hs(qa, e));
|
|
3665
3693
|
},
|
|
3666
3694
|
uuid(e) {
|
|
3667
|
-
return this.check(/* @__PURE__ */
|
|
3695
|
+
return this.check(/* @__PURE__ */ ps(be, e));
|
|
3668
3696
|
},
|
|
3669
3697
|
uuidv4(e) {
|
|
3670
|
-
return this.check(/* @__PURE__ */
|
|
3698
|
+
return this.check(/* @__PURE__ */ ms(be, e));
|
|
3671
3699
|
},
|
|
3672
3700
|
uuidv6(e) {
|
|
3673
|
-
return this.check(/* @__PURE__ */
|
|
3701
|
+
return this.check(/* @__PURE__ */ gs(be, e));
|
|
3674
3702
|
},
|
|
3675
3703
|
uuidv7(e) {
|
|
3676
|
-
return this.check(/* @__PURE__ */
|
|
3704
|
+
return this.check(/* @__PURE__ */ vs(be, e));
|
|
3677
3705
|
},
|
|
3678
3706
|
nanoid(e) {
|
|
3679
|
-
return this.check(/* @__PURE__ */
|
|
3707
|
+
return this.check(/* @__PURE__ */ ys(Qa, e));
|
|
3680
3708
|
},
|
|
3681
3709
|
cuid(e) {
|
|
3682
|
-
return this.check(/* @__PURE__ */
|
|
3710
|
+
return this.check(/* @__PURE__ */ ws(ec, e));
|
|
3683
3711
|
},
|
|
3684
3712
|
cuid2(e) {
|
|
3685
|
-
return this.check(/* @__PURE__ */
|
|
3713
|
+
return this.check(/* @__PURE__ */ ks(tc, e));
|
|
3686
3714
|
},
|
|
3687
3715
|
ulid(e) {
|
|
3688
|
-
return this.check(/* @__PURE__ */
|
|
3716
|
+
return this.check(/* @__PURE__ */ Os(rc, e));
|
|
3689
3717
|
},
|
|
3690
3718
|
base64(e) {
|
|
3691
|
-
return this.check(/* @__PURE__ */
|
|
3719
|
+
return this.check(/* @__PURE__ */ Ts(uc, e));
|
|
3692
3720
|
},
|
|
3693
3721
|
base64url(e) {
|
|
3694
|
-
return this.check(/* @__PURE__ */
|
|
3722
|
+
return this.check(/* @__PURE__ */ Ps(lc, e));
|
|
3695
3723
|
},
|
|
3696
3724
|
xid(e) {
|
|
3697
|
-
return this.check(/* @__PURE__ */
|
|
3725
|
+
return this.check(/* @__PURE__ */ zs(nc, e));
|
|
3698
3726
|
},
|
|
3699
3727
|
ksuid(e) {
|
|
3700
|
-
return this.check(/* @__PURE__ */
|
|
3728
|
+
return this.check(/* @__PURE__ */ Ss(ic, e));
|
|
3701
3729
|
},
|
|
3702
3730
|
ipv4(e) {
|
|
3703
|
-
return this.check(/* @__PURE__ */
|
|
3731
|
+
return this.check(/* @__PURE__ */ $s(oc, e));
|
|
3704
3732
|
},
|
|
3705
3733
|
ipv6(e) {
|
|
3706
|
-
return this.check(/* @__PURE__ */
|
|
3734
|
+
return this.check(/* @__PURE__ */ Es(sc, e));
|
|
3707
3735
|
},
|
|
3708
3736
|
cidrv4(e) {
|
|
3709
|
-
return this.check(/* @__PURE__ */
|
|
3737
|
+
return this.check(/* @__PURE__ */ Is(ac, e));
|
|
3710
3738
|
},
|
|
3711
3739
|
cidrv6(e) {
|
|
3712
|
-
return this.check(/* @__PURE__ */
|
|
3740
|
+
return this.check(/* @__PURE__ */ As(cc, e));
|
|
3713
3741
|
},
|
|
3714
3742
|
e164(e) {
|
|
3715
|
-
return this.check(/* @__PURE__ */
|
|
3743
|
+
return this.check(/* @__PURE__ */ Zs(fc, e));
|
|
3716
3744
|
},
|
|
3717
3745
|
datetime(e) {
|
|
3718
|
-
return this.check(/* @__PURE__ */
|
|
3746
|
+
return this.check(/* @__PURE__ */ Rs(Wa, e));
|
|
3719
3747
|
},
|
|
3720
3748
|
date(e) {
|
|
3721
|
-
return this.check(/* @__PURE__ */
|
|
3749
|
+
return this.check(/* @__PURE__ */ Ns(Va, e));
|
|
3722
3750
|
},
|
|
3723
3751
|
time(e) {
|
|
3724
|
-
return this.check(/* @__PURE__ */
|
|
3752
|
+
return this.check(/* @__PURE__ */ js(Ka, e));
|
|
3725
3753
|
},
|
|
3726
3754
|
duration(e) {
|
|
3727
|
-
return this.check(/* @__PURE__ */
|
|
3755
|
+
return this.check(/* @__PURE__ */ xs(Ha, e));
|
|
3728
3756
|
}
|
|
3729
3757
|
});
|
|
3730
3758
|
function k(e) {
|
|
3731
|
-
return /* @__PURE__ */
|
|
3759
|
+
return /* @__PURE__ */ fs(Ja, e);
|
|
3732
3760
|
}
|
|
3733
3761
|
var z = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
|
|
3734
3762
|
O.init(e, t), Qr.init(e, t);
|
|
3735
|
-
}),
|
|
3736
|
-
mo.init(e, t), z.init(e, t);
|
|
3737
|
-
}), Ba = /* @__PURE__ */ l("ZodISODate", (e, t) => {
|
|
3763
|
+
}), Wa = /* @__PURE__ */ l("ZodISODateTime", (e, t) => {
|
|
3738
3764
|
go.init(e, t), z.init(e, t);
|
|
3739
|
-
}),
|
|
3765
|
+
}), Va = /* @__PURE__ */ l("ZodISODate", (e, t) => {
|
|
3740
3766
|
vo.init(e, t), z.init(e, t);
|
|
3741
|
-
}),
|
|
3767
|
+
}), Ka = /* @__PURE__ */ l("ZodISOTime", (e, t) => {
|
|
3742
3768
|
bo.init(e, t), z.init(e, t);
|
|
3743
|
-
}),
|
|
3744
|
-
|
|
3745
|
-
}),
|
|
3746
|
-
|
|
3747
|
-
}),
|
|
3769
|
+
}), Ha = /* @__PURE__ */ l("ZodISODuration", (e, t) => {
|
|
3770
|
+
_o.init(e, t), z.init(e, t);
|
|
3771
|
+
}), Ga = /* @__PURE__ */ l("ZodEmail", (e, t) => {
|
|
3772
|
+
to.init(e, t), z.init(e, t);
|
|
3773
|
+
}), qa = /* @__PURE__ */ l("ZodGUID", (e, t) => {
|
|
3748
3774
|
Qi.init(e, t), z.init(e, t);
|
|
3749
|
-
}),
|
|
3750
|
-
|
|
3751
|
-
}),
|
|
3775
|
+
}), be = /* @__PURE__ */ l("ZodUUID", (e, t) => {
|
|
3776
|
+
eo.init(e, t), z.init(e, t);
|
|
3777
|
+
}), Ya = /* @__PURE__ */ l("ZodURL", (e, t) => {
|
|
3752
3778
|
ao.init(e, t), z.init(e, t);
|
|
3753
|
-
}),
|
|
3779
|
+
}), Xa = /* @__PURE__ */ l("ZodEmoji", (e, t) => {
|
|
3754
3780
|
co.init(e, t), z.init(e, t);
|
|
3755
|
-
}),
|
|
3781
|
+
}), Qa = /* @__PURE__ */ l("ZodNanoID", (e, t) => {
|
|
3756
3782
|
uo.init(e, t), z.init(e, t);
|
|
3757
|
-
}),
|
|
3783
|
+
}), ec = /* @__PURE__ */ l("ZodCUID", (e, t) => {
|
|
3758
3784
|
lo.init(e, t), z.init(e, t);
|
|
3759
|
-
}),
|
|
3785
|
+
}), tc = /* @__PURE__ */ l("ZodCUID2", (e, t) => {
|
|
3760
3786
|
fo.init(e, t), z.init(e, t);
|
|
3761
|
-
}),
|
|
3787
|
+
}), rc = /* @__PURE__ */ l("ZodULID", (e, t) => {
|
|
3762
3788
|
ho.init(e, t), z.init(e, t);
|
|
3763
|
-
}),
|
|
3789
|
+
}), nc = /* @__PURE__ */ l("ZodXID", (e, t) => {
|
|
3764
3790
|
po.init(e, t), z.init(e, t);
|
|
3765
|
-
}),
|
|
3766
|
-
|
|
3767
|
-
}),
|
|
3768
|
-
|
|
3769
|
-
}),
|
|
3791
|
+
}), ic = /* @__PURE__ */ l("ZodKSUID", (e, t) => {
|
|
3792
|
+
mo.init(e, t), z.init(e, t);
|
|
3793
|
+
}), oc = /* @__PURE__ */ l("ZodIPv4", (e, t) => {
|
|
3794
|
+
yo.init(e, t), z.init(e, t);
|
|
3795
|
+
}), sc = /* @__PURE__ */ l("ZodIPv6", (e, t) => {
|
|
3770
3796
|
ko.init(e, t), z.init(e, t);
|
|
3771
|
-
}),
|
|
3772
|
-
|
|
3773
|
-
}),
|
|
3797
|
+
}), ac = /* @__PURE__ */ l("ZodCIDRv4", (e, t) => {
|
|
3798
|
+
Oo.init(e, t), z.init(e, t);
|
|
3799
|
+
}), cc = /* @__PURE__ */ l("ZodCIDRv6", (e, t) => {
|
|
3774
3800
|
So.init(e, t), z.init(e, t);
|
|
3775
|
-
}),
|
|
3801
|
+
}), uc = /* @__PURE__ */ l("ZodBase64", (e, t) => {
|
|
3776
3802
|
$o.init(e, t), z.init(e, t);
|
|
3777
|
-
}),
|
|
3803
|
+
}), lc = /* @__PURE__ */ l("ZodBase64URL", (e, t) => {
|
|
3778
3804
|
Io.init(e, t), z.init(e, t);
|
|
3779
|
-
}),
|
|
3780
|
-
|
|
3805
|
+
}), fc = /* @__PURE__ */ l("ZodE164", (e, t) => {
|
|
3806
|
+
Ao.init(e, t), z.init(e, t);
|
|
3807
|
+
}), dc = /* @__PURE__ */ l("ZodJWT", (e, t) => {
|
|
3808
|
+
Po.init(e, t), z.init(e, t);
|
|
3781
3809
|
}), en = /* @__PURE__ */ l("ZodNumber", (e, t) => {
|
|
3782
|
-
Cr.init(e, t),
|
|
3783
|
-
}, /* @__PURE__ */
|
|
3810
|
+
Cr.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => da(e, r, n, i), e.isFinite = !0;
|
|
3811
|
+
}, /* @__PURE__ */ wr({
|
|
3784
3812
|
minValue: (e) => {
|
|
3785
3813
|
const { minimum: t, exclusiveMinimum: r } = x(e);
|
|
3786
3814
|
return Math.max(t ?? Number.NEGATIVE_INFINITY, r ?? Number.NEGATIVE_INFINITY);
|
|
@@ -3796,7 +3824,7 @@ var z = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
|
|
|
3796
3824
|
format: (e) => x(e).format ?? null
|
|
3797
3825
|
}, {
|
|
3798
3826
|
gt(e, t) {
|
|
3799
|
-
return this.check(/* @__PURE__ */
|
|
3827
|
+
return this.check(/* @__PURE__ */ Ut(e, t));
|
|
3800
3828
|
},
|
|
3801
3829
|
gte(e, t) {
|
|
3802
3830
|
return this.check(/* @__PURE__ */ Je(e, t));
|
|
@@ -3805,7 +3833,7 @@ var z = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
|
|
|
3805
3833
|
return this.check(/* @__PURE__ */ Je(e, t));
|
|
3806
3834
|
},
|
|
3807
3835
|
lt(e, t) {
|
|
3808
|
-
return this.check(/* @__PURE__ */
|
|
3836
|
+
return this.check(/* @__PURE__ */ Lt(e, t));
|
|
3809
3837
|
},
|
|
3810
3838
|
lte(e, t) {
|
|
3811
3839
|
return this.check(/* @__PURE__ */ Be(e, t));
|
|
@@ -3814,62 +3842,62 @@ var z = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
|
|
|
3814
3842
|
return this.check(/* @__PURE__ */ Be(e, t));
|
|
3815
3843
|
},
|
|
3816
3844
|
int(e) {
|
|
3817
|
-
return this.check(
|
|
3845
|
+
return this.check(Yt(e));
|
|
3818
3846
|
},
|
|
3819
3847
|
safe(e) {
|
|
3820
|
-
return this.check(
|
|
3848
|
+
return this.check(Yt(e));
|
|
3821
3849
|
},
|
|
3822
3850
|
positive(e) {
|
|
3823
|
-
return this.check(/* @__PURE__ */
|
|
3851
|
+
return this.check(/* @__PURE__ */ Ut(0, e));
|
|
3824
3852
|
},
|
|
3825
3853
|
nonnegative(e) {
|
|
3826
3854
|
return this.check(/* @__PURE__ */ Je(0, e));
|
|
3827
3855
|
},
|
|
3828
3856
|
negative(e) {
|
|
3829
|
-
return this.check(/* @__PURE__ */
|
|
3857
|
+
return this.check(/* @__PURE__ */ Lt(0, e));
|
|
3830
3858
|
},
|
|
3831
3859
|
nonpositive(e) {
|
|
3832
3860
|
return this.check(/* @__PURE__ */ Be(0, e));
|
|
3833
3861
|
},
|
|
3834
3862
|
multipleOf(e, t) {
|
|
3835
|
-
return this.check(/* @__PURE__ */
|
|
3863
|
+
return this.check(/* @__PURE__ */ Ft(e, t));
|
|
3836
3864
|
},
|
|
3837
3865
|
step(e, t) {
|
|
3838
|
-
return this.check(/* @__PURE__ */
|
|
3866
|
+
return this.check(/* @__PURE__ */ Ft(e, t));
|
|
3839
3867
|
},
|
|
3840
3868
|
finite() {
|
|
3841
3869
|
return this;
|
|
3842
3870
|
}
|
|
3843
3871
|
}));
|
|
3844
3872
|
function Pe(e) {
|
|
3845
|
-
return /* @__PURE__ */
|
|
3873
|
+
return /* @__PURE__ */ Ms(en, e);
|
|
3846
3874
|
}
|
|
3847
|
-
var
|
|
3848
|
-
|
|
3875
|
+
var hc = /* @__PURE__ */ l("ZodNumberFormat", (e, t) => {
|
|
3876
|
+
Zo.init(e, t), en.init(e, t);
|
|
3849
3877
|
});
|
|
3850
|
-
function
|
|
3851
|
-
return /* @__PURE__ */
|
|
3878
|
+
function Yt(e) {
|
|
3879
|
+
return /* @__PURE__ */ Ds(hc, e);
|
|
3852
3880
|
}
|
|
3853
|
-
var
|
|
3854
|
-
|
|
3881
|
+
var pc = /* @__PURE__ */ l("ZodBoolean", (e, t) => {
|
|
3882
|
+
Co.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => ha(e, r, n, i);
|
|
3855
3883
|
});
|
|
3856
3884
|
function F(e) {
|
|
3857
|
-
return /* @__PURE__ */
|
|
3885
|
+
return /* @__PURE__ */ Ls(pc, e);
|
|
3858
3886
|
}
|
|
3859
|
-
var
|
|
3860
|
-
|
|
3887
|
+
var mc = /* @__PURE__ */ l("ZodUnknown", (e, t) => {
|
|
3888
|
+
Ro.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => ma(e, r, n, i);
|
|
3861
3889
|
});
|
|
3862
|
-
function
|
|
3863
|
-
return /* @__PURE__ */
|
|
3890
|
+
function Xt() {
|
|
3891
|
+
return /* @__PURE__ */ Us(mc);
|
|
3864
3892
|
}
|
|
3865
|
-
var
|
|
3866
|
-
|
|
3893
|
+
var gc = /* @__PURE__ */ l("ZodNever", (e, t) => {
|
|
3894
|
+
No.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => pa(e, r, n, i);
|
|
3867
3895
|
});
|
|
3868
|
-
function
|
|
3869
|
-
return /* @__PURE__ */
|
|
3896
|
+
function vc(e) {
|
|
3897
|
+
return /* @__PURE__ */ Fs(gc, e);
|
|
3870
3898
|
}
|
|
3871
|
-
var
|
|
3872
|
-
|
|
3899
|
+
var bc = /* @__PURE__ */ l("ZodArray", (e, t) => {
|
|
3900
|
+
mt(), Mo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => _a(e, r, n, i), e.element = t.element;
|
|
3873
3901
|
}, {
|
|
3874
3902
|
min(e, t) {
|
|
3875
3903
|
return this.check(/* @__PURE__ */ Ae(e, t));
|
|
@@ -3887,11 +3915,11 @@ var mc = /* @__PURE__ */ l("ZodArray", (e, t) => {
|
|
|
3887
3915
|
return this.element;
|
|
3888
3916
|
}
|
|
3889
3917
|
});
|
|
3890
|
-
function
|
|
3891
|
-
return /* @__PURE__ */
|
|
3918
|
+
function gt(e, t) {
|
|
3919
|
+
return /* @__PURE__ */ ea(bc, e, t);
|
|
3892
3920
|
}
|
|
3893
|
-
var
|
|
3894
|
-
|
|
3921
|
+
var _c = /* @__PURE__ */ l("ZodObject", (e, t) => {
|
|
3922
|
+
mt(), Uo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => ya(e, r, n, i), Mn(e, "shape", (r) => r._zod.def.shape, !1);
|
|
3895
3923
|
}, {
|
|
3896
3924
|
keyof() {
|
|
3897
3925
|
return P(Object.keys(this._zod.def.shape));
|
|
@@ -3900,19 +3928,19 @@ var gc = /* @__PURE__ */ l("ZodObject", (e, t) => {
|
|
|
3900
3928
|
return this.clone(Z(this._zod.def, { catchall: e }));
|
|
3901
3929
|
},
|
|
3902
3930
|
passthrough() {
|
|
3903
|
-
return this.clone(Z(this._zod.def, { catchall:
|
|
3931
|
+
return this.clone(Z(this._zod.def, { catchall: Xt() }));
|
|
3904
3932
|
},
|
|
3905
3933
|
loose() {
|
|
3906
|
-
return this.clone(Z(this._zod.def, { catchall:
|
|
3934
|
+
return this.clone(Z(this._zod.def, { catchall: Xt() }));
|
|
3907
3935
|
},
|
|
3908
3936
|
strict() {
|
|
3909
|
-
return this.clone(Z(this._zod.def, { catchall:
|
|
3937
|
+
return this.clone(Z(this._zod.def, { catchall: vc() }));
|
|
3910
3938
|
},
|
|
3911
3939
|
strip() {
|
|
3912
3940
|
return this.clone(Z(this._zod.def, { catchall: void 0 }));
|
|
3913
3941
|
},
|
|
3914
3942
|
extend(e) {
|
|
3915
|
-
return
|
|
3943
|
+
return En(this, e);
|
|
3916
3944
|
},
|
|
3917
3945
|
safeExtend(e) {
|
|
3918
3946
|
return In(this, e);
|
|
@@ -3924,13 +3952,13 @@ var gc = /* @__PURE__ */ l("ZodObject", (e, t) => {
|
|
|
3924
3952
|
return Sn(this, e);
|
|
3925
3953
|
},
|
|
3926
3954
|
omit(e) {
|
|
3927
|
-
return
|
|
3955
|
+
return $n(this, e);
|
|
3928
3956
|
},
|
|
3929
3957
|
partial(...e) {
|
|
3930
|
-
return
|
|
3958
|
+
return kt(rn, this, e[0]);
|
|
3931
3959
|
},
|
|
3932
3960
|
exactPartial(...e) {
|
|
3933
|
-
return
|
|
3961
|
+
return kt(nn, this, e[0], "exactPartial");
|
|
3934
3962
|
},
|
|
3935
3963
|
required(...e) {
|
|
3936
3964
|
return Tn(on, this, e[0]);
|
|
@@ -3942,36 +3970,36 @@ function R(e, t) {
|
|
|
3942
3970
|
shape: e ?? {},
|
|
3943
3971
|
...g(t)
|
|
3944
3972
|
};
|
|
3945
|
-
return new
|
|
3973
|
+
return new _c(r);
|
|
3946
3974
|
}
|
|
3947
|
-
var
|
|
3948
|
-
|
|
3975
|
+
var yc = /* @__PURE__ */ l("ZodUnion", (e, t) => {
|
|
3976
|
+
Fo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => wa(e, r, n, i), e.options = t.options;
|
|
3949
3977
|
});
|
|
3950
3978
|
function tn(e, t) {
|
|
3951
|
-
return new
|
|
3979
|
+
return new yc({
|
|
3952
3980
|
type: "union",
|
|
3953
3981
|
options: e,
|
|
3954
3982
|
...g(t)
|
|
3955
3983
|
});
|
|
3956
3984
|
}
|
|
3957
|
-
var
|
|
3958
|
-
|
|
3985
|
+
var wc = /* @__PURE__ */ l("ZodIntersection", (e, t) => {
|
|
3986
|
+
Bo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => ka(e, r, n, i);
|
|
3959
3987
|
});
|
|
3960
|
-
function
|
|
3961
|
-
return new
|
|
3988
|
+
function kc(e, t) {
|
|
3989
|
+
return new wc({
|
|
3962
3990
|
type: "intersection",
|
|
3963
3991
|
left: e,
|
|
3964
3992
|
right: t
|
|
3965
3993
|
});
|
|
3966
3994
|
}
|
|
3967
|
-
var
|
|
3968
|
-
|
|
3995
|
+
var tt = /* @__PURE__ */ l("ZodEnum", (e, t) => {
|
|
3996
|
+
Jo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, i, o) => ga(e, n, i, o), e.enum = t.entries, e.options = [...e._zod.values];
|
|
3969
3997
|
const r = new Set(Object.keys(t.entries));
|
|
3970
3998
|
e.extract = (n, i) => {
|
|
3971
3999
|
const o = {};
|
|
3972
4000
|
for (const s of n) if (r.has(s)) o[s] = t.entries[s];
|
|
3973
4001
|
else throw new Error(`Key ${s} not found in enum`);
|
|
3974
|
-
return new
|
|
4002
|
+
return new tt({
|
|
3975
4003
|
...t,
|
|
3976
4004
|
checks: [],
|
|
3977
4005
|
...g(i),
|
|
@@ -3981,7 +4009,7 @@ var et = /* @__PURE__ */ l("ZodEnum", (e, t) => {
|
|
|
3981
4009
|
const o = { ...t.entries };
|
|
3982
4010
|
for (const s of n) if (r.has(s)) delete o[s];
|
|
3983
4011
|
else throw new Error(`Key ${s} not found in enum`);
|
|
3984
|
-
return new
|
|
4012
|
+
return new tt({
|
|
3985
4013
|
...t,
|
|
3986
4014
|
checks: [],
|
|
3987
4015
|
...g(i),
|
|
@@ -3991,15 +4019,15 @@ var et = /* @__PURE__ */ l("ZodEnum", (e, t) => {
|
|
|
3991
4019
|
});
|
|
3992
4020
|
function P(e, t) {
|
|
3993
4021
|
const r = Array.isArray(e) ? Object.fromEntries(e.map((n) => [n, n])) : e;
|
|
3994
|
-
return new
|
|
4022
|
+
return new tt({
|
|
3995
4023
|
type: "enum",
|
|
3996
4024
|
entries: r,
|
|
3997
4025
|
...g(t)
|
|
3998
4026
|
});
|
|
3999
4027
|
}
|
|
4000
|
-
var
|
|
4001
|
-
|
|
4002
|
-
if (n.direction === "backward") throw new
|
|
4028
|
+
var Oc = /* @__PURE__ */ l("ZodTransform", (e, t) => {
|
|
4029
|
+
mt(), Wo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => ba(e, r, n, i), e._zod.parse = (r, n) => {
|
|
4030
|
+
if (n.direction === "backward") throw new kr(e.constructor.name);
|
|
4003
4031
|
r.addIssue = (o) => {
|
|
4004
4032
|
if (typeof o == "string") r.issues.push(he(o, r.value, t));
|
|
4005
4033
|
else {
|
|
@@ -4011,115 +4039,115 @@ var yc = /* @__PURE__ */ l("ZodTransform", (e, t) => {
|
|
|
4011
4039
|
return i instanceof Promise ? i.then((o) => (r.value = o, r)) : (r.value = i, r);
|
|
4012
4040
|
};
|
|
4013
4041
|
});
|
|
4014
|
-
function
|
|
4015
|
-
return new
|
|
4042
|
+
function zc(e) {
|
|
4043
|
+
return new Oc({
|
|
4016
4044
|
type: "transform",
|
|
4017
4045
|
transform: e
|
|
4018
4046
|
});
|
|
4019
4047
|
}
|
|
4020
4048
|
var rn = /* @__PURE__ */ l("ZodOptional", (e, t) => {
|
|
4021
|
-
jr.init(e, t),
|
|
4049
|
+
jr.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => Xr(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4022
4050
|
});
|
|
4023
|
-
function
|
|
4051
|
+
function Qt(e) {
|
|
4024
4052
|
return new rn({
|
|
4025
4053
|
type: "optional",
|
|
4026
4054
|
innerType: e
|
|
4027
4055
|
});
|
|
4028
4056
|
}
|
|
4029
4057
|
var nn = /* @__PURE__ */ l("ZodExactOptional", (e, t) => {
|
|
4030
|
-
|
|
4058
|
+
Vo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => Xr(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4031
4059
|
});
|
|
4032
|
-
function
|
|
4060
|
+
function Sc(e) {
|
|
4033
4061
|
return new nn({
|
|
4034
4062
|
type: "optional",
|
|
4035
4063
|
innerType: e
|
|
4036
4064
|
});
|
|
4037
4065
|
}
|
|
4038
|
-
var
|
|
4039
|
-
|
|
4066
|
+
var $c = /* @__PURE__ */ l("ZodNullable", (e, t) => {
|
|
4067
|
+
Ko.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => Oa(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4040
4068
|
});
|
|
4041
|
-
function
|
|
4042
|
-
return new
|
|
4069
|
+
function er(e) {
|
|
4070
|
+
return new $c({
|
|
4043
4071
|
type: "nullable",
|
|
4044
4072
|
innerType: e
|
|
4045
4073
|
});
|
|
4046
4074
|
}
|
|
4047
|
-
var
|
|
4048
|
-
|
|
4075
|
+
var Ec = /* @__PURE__ */ l("ZodDefault", (e, t) => {
|
|
4076
|
+
Ho.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => Sa(e, r, n, i), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
4049
4077
|
});
|
|
4050
|
-
function
|
|
4051
|
-
return new
|
|
4078
|
+
function Ic(e, t) {
|
|
4079
|
+
return new Ec({
|
|
4052
4080
|
type: "default",
|
|
4053
4081
|
innerType: e,
|
|
4054
4082
|
get defaultValue() {
|
|
4055
|
-
return typeof t == "function" ? t() :
|
|
4083
|
+
return typeof t == "function" ? t() : mr(t);
|
|
4056
4084
|
}
|
|
4057
4085
|
});
|
|
4058
4086
|
}
|
|
4059
|
-
var
|
|
4060
|
-
|
|
4087
|
+
var Ac = /* @__PURE__ */ l("ZodPrefault", (e, t) => {
|
|
4088
|
+
Go.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => $a(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4061
4089
|
});
|
|
4062
|
-
function
|
|
4063
|
-
return new
|
|
4090
|
+
function Tc(e, t) {
|
|
4091
|
+
return new Ac({
|
|
4064
4092
|
type: "prefault",
|
|
4065
4093
|
innerType: e,
|
|
4066
4094
|
get defaultValue() {
|
|
4067
|
-
return typeof t == "function" ? t() :
|
|
4095
|
+
return typeof t == "function" ? t() : mr(t);
|
|
4068
4096
|
}
|
|
4069
4097
|
});
|
|
4070
4098
|
}
|
|
4071
4099
|
var on = /* @__PURE__ */ l("ZodNonOptional", (e, t) => {
|
|
4072
|
-
|
|
4100
|
+
qo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => za(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4073
4101
|
});
|
|
4074
|
-
function
|
|
4102
|
+
function Pc(e, t) {
|
|
4075
4103
|
return new on({
|
|
4076
4104
|
type: "nonoptional",
|
|
4077
4105
|
innerType: e,
|
|
4078
4106
|
...g(t)
|
|
4079
4107
|
});
|
|
4080
4108
|
}
|
|
4081
|
-
var
|
|
4082
|
-
|
|
4109
|
+
var Zc = /* @__PURE__ */ l("ZodCatch", (e, t) => {
|
|
4110
|
+
Yo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => Ea(e, r, n, i), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
4083
4111
|
});
|
|
4084
|
-
function
|
|
4085
|
-
return new
|
|
4112
|
+
function Cc(e, t) {
|
|
4113
|
+
return new Zc({
|
|
4086
4114
|
type: "catch",
|
|
4087
4115
|
innerType: e,
|
|
4088
4116
|
catchValue: typeof t == "function" ? t : Ln(t)
|
|
4089
4117
|
});
|
|
4090
4118
|
}
|
|
4091
|
-
var
|
|
4092
|
-
|
|
4119
|
+
var Rc = /* @__PURE__ */ l("ZodPipe", (e, t) => {
|
|
4120
|
+
Xo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => Ia(e, r, n, i), e.in = t.in, e.out = t.out;
|
|
4093
4121
|
});
|
|
4094
|
-
function
|
|
4095
|
-
return new
|
|
4122
|
+
function tr(e, t) {
|
|
4123
|
+
return new Rc({
|
|
4096
4124
|
type: "pipe",
|
|
4097
4125
|
in: e,
|
|
4098
4126
|
out: t
|
|
4099
4127
|
});
|
|
4100
4128
|
}
|
|
4101
|
-
var
|
|
4102
|
-
|
|
4129
|
+
var Nc = /* @__PURE__ */ l("ZodReadonly", (e, t) => {
|
|
4130
|
+
Qo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => Aa(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4103
4131
|
});
|
|
4104
|
-
function
|
|
4105
|
-
return new
|
|
4132
|
+
function jc(e) {
|
|
4133
|
+
return new Nc({
|
|
4106
4134
|
type: "readonly",
|
|
4107
4135
|
innerType: e
|
|
4108
4136
|
});
|
|
4109
4137
|
}
|
|
4110
4138
|
var sn = /* @__PURE__ */ l("ZodCustom", (e, t) => {
|
|
4111
|
-
|
|
4139
|
+
es.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, n, i) => va(e, r, n, i);
|
|
4112
4140
|
});
|
|
4113
|
-
function
|
|
4114
|
-
return /* @__PURE__ */
|
|
4141
|
+
function xc(e, t) {
|
|
4142
|
+
return /* @__PURE__ */ ta(sn, e ?? (() => !0), t);
|
|
4115
4143
|
}
|
|
4116
|
-
function
|
|
4117
|
-
return /* @__PURE__ */
|
|
4144
|
+
function Mc(e, t = {}) {
|
|
4145
|
+
return /* @__PURE__ */ ra(sn, e, t);
|
|
4118
4146
|
}
|
|
4119
|
-
function
|
|
4120
|
-
return /* @__PURE__ */
|
|
4147
|
+
function Dc(e, t) {
|
|
4148
|
+
return /* @__PURE__ */ na(e, t);
|
|
4121
4149
|
}
|
|
4122
|
-
var We = /^#[0-9a-fA-F]{6}$/, Ve = "Color must be a 6-digit hex code (e.g. '#3B82F6'). Short hex, rgb(), and named colors are not supported.",
|
|
4150
|
+
var We = /^#[0-9a-fA-F]{6}$/, Ve = "Color must be a 6-digit hex code (e.g. '#3B82F6'). Short hex, rgb(), and named colors are not supported.", vt = R({
|
|
4123
4151
|
primaryColor: k().max(20).regex(We, Ve).describe("Primary brand color (hex format, e.g., '#3B82F6')").optional(),
|
|
4124
4152
|
backgroundColor: k().max(20).regex(We, Ve).describe("Background color for the widget container").optional(),
|
|
4125
4153
|
textColor: k().max(20).regex(We, Ve).describe("Text color").optional(),
|
|
@@ -4130,7 +4158,7 @@ var We = /^#[0-9a-fA-F]{6}$/, Ve = "Color must be a 6-digit hex code (e.g. '#3B8
|
|
|
4130
4158
|
"dark",
|
|
4131
4159
|
"auto"
|
|
4132
4160
|
]).describe("Widget color scheme: 'light' (default), 'dark', or 'auto' (follows the visitor's prefers-color-scheme).").optional()
|
|
4133
|
-
}),
|
|
4161
|
+
}), _u = P([
|
|
4134
4162
|
"mobile",
|
|
4135
4163
|
"tablet",
|
|
4136
4164
|
"desktop"
|
|
@@ -4138,21 +4166,21 @@ var We = /^#[0-9a-fA-F]{6}$/, Ve = "Color must be a 6-digit hex code (e.g. '#3B8
|
|
|
4138
4166
|
"bottom-right",
|
|
4139
4167
|
"bottom-left",
|
|
4140
4168
|
"inline"
|
|
4141
|
-
]).describe("Widget position on the page"),
|
|
4169
|
+
]).describe("Widget position on the page"), Lc = R({
|
|
4142
4170
|
mobile: Pe().min(0).max(1e3).describe("Max width for mobile viewport (default: 480)").optional(),
|
|
4143
4171
|
tablet: Pe().min(0).max(2e3).describe("Max width for tablet viewport (default: 768)").optional()
|
|
4144
|
-
}),
|
|
4172
|
+
}), Uc = R({
|
|
4145
4173
|
enabled: F().describe("Enable responsive behavior (default: true)").optional(),
|
|
4146
|
-
breakpoints:
|
|
4174
|
+
breakpoints: Lc.describe("Custom breakpoint values").optional()
|
|
4147
4175
|
});
|
|
4148
|
-
var
|
|
4149
|
-
theme:
|
|
4176
|
+
var yu = R({
|
|
4177
|
+
theme: vt.describe("Custom theme configuration").optional(),
|
|
4150
4178
|
position: an.describe("Widget position (default: 'bottom-right')").optional(),
|
|
4151
4179
|
open: F().describe("Initial open state (default: false)").optional(),
|
|
4152
|
-
container: tn([
|
|
4180
|
+
container: tn([xc((e) => e instanceof HTMLElement), k().max(200)]).describe("Container element for inline mode").optional(),
|
|
4153
4181
|
baseUrl: k().url().max(200).describe("Base URL for the widget embed (default: production URL)").optional(),
|
|
4154
4182
|
debug: F().describe("Enable debug logging").optional(),
|
|
4155
|
-
responsive:
|
|
4183
|
+
responsive: Uc.describe("Responsive behavior configuration").optional(),
|
|
4156
4184
|
showProfile: F().describe("Force the profile panel visible in the widget header from the start of the conversation. The panel already shows on its own once the visitor's profile has data, regardless of this flag (default: false).").optional(),
|
|
4157
4185
|
language: k().max(10).describe("Language for UI labels (e.g., 'fr', 'en'). Defaults to browser language.").optional(),
|
|
4158
4186
|
apiKey: k().max(100).describe("Publishable API key (pk_*) for application authentication"),
|
|
@@ -4160,8 +4188,8 @@ var bu = R({
|
|
|
4160
4188
|
userId: k().max(255).describe("Host-side unique user identifier").optional(),
|
|
4161
4189
|
userHash: k().max(128).describe("HMAC-SHA256 of email (or userId), signed with identity secret").optional(),
|
|
4162
4190
|
initialMessage: k().max(300).describe("Auto-sent first visitor message, injected once via postMessage when the widget is ready (e.g. a demo deep-link). Never carried on the iframe URL. The authoritative bound is enforced again at the embed's trust boundary (useEmbedChatHandlers' INIT handler), this schema is not the sole enforcement point.").optional()
|
|
4163
|
-
}),
|
|
4164
|
-
theme:
|
|
4191
|
+
}), Fc = R({
|
|
4192
|
+
theme: vt.describe("Full visual theme palette applied by the widget. Admin-configured, no client-side override.").optional(),
|
|
4165
4193
|
position: an.describe("Default launcher position. `inline` only applies when integrator supplies `data-container`.").optional(),
|
|
4166
4194
|
language: k().max(10).describe("Locale forced for widget UI labels (ISO 639-1). Falls back to browser language when null.").optional(),
|
|
4167
4195
|
showProfile: F().describe("Forces the profile panel visible from the start of the conversation. The panel already shows on its own once the visitor's profile has data, regardless of this flag.").optional(),
|
|
@@ -4170,12 +4198,12 @@ var bu = R({
|
|
|
4170
4198
|
title: k().max(60).describe("Custom widget header title. Falls back to a vertical-specific default (e.g. 'Gamaro Chat' for B2B) when unset.").optional(),
|
|
4171
4199
|
avatarUrl: k().url().max(2048).describe("Public URL of the custom widget avatar (PNG or JPEG). MUST originate from the branding-upload endpoint — arbitrary external URLs are rejected at the API boundary.").optional()
|
|
4172
4200
|
}).strict().describe("White-label branding overrides (issue #1083 Piste 5). Both fields are optional.").optional()
|
|
4173
|
-
}).strict(),
|
|
4201
|
+
}).strict(), Bc = R({
|
|
4174
4202
|
applicationId: k().uuid().describe("Application UUID"),
|
|
4175
4203
|
applicationSlug: k().max(100).describe("Application slug (kebab-case)"),
|
|
4176
4204
|
applicationName: k().max(200).describe("Application display name"),
|
|
4177
|
-
theme:
|
|
4178
|
-
allowedOrigins:
|
|
4205
|
+
theme: vt.nullable().describe("Application theme"),
|
|
4206
|
+
allowedOrigins: gt(k().max(200)).max(50).describe("Allowed origins for this application"),
|
|
4179
4207
|
monitoring: F().describe("Monitoring enabled flag"),
|
|
4180
4208
|
primaryObjective: R({
|
|
4181
4209
|
id: k().uuid(),
|
|
@@ -4184,11 +4212,11 @@ var bu = R({
|
|
|
4184
4212
|
ctaLabel: k().nullable()
|
|
4185
4213
|
}).nullable().describe("Primary conversion objective"),
|
|
4186
4214
|
identityVerificationRequired: F().describe("Whether HMAC identity verification is required"),
|
|
4187
|
-
widget:
|
|
4188
|
-
}),
|
|
4189
|
-
role:
|
|
4215
|
+
widget: Fc.nullable().describe("Admin-configured widget runtime config (theme, position, language, showProfile, open). Null when the application has not yet persisted a widget_config JSONB.")
|
|
4216
|
+
}), Jc = P(["user", "assistant"]).describe("Message sender role"), wu = R({
|
|
4217
|
+
role: Jc.describe("Message sender role"),
|
|
4190
4218
|
content: k().max(1e4).describe("Message content (max 10000 characters)")
|
|
4191
|
-
}),
|
|
4219
|
+
}), Wc = {
|
|
4192
4220
|
INIT: "gamaro:init",
|
|
4193
4221
|
OPEN: "gamaro:open",
|
|
4194
4222
|
CLOSE: "gamaro:close",
|
|
@@ -4208,68 +4236,68 @@ var bu = R({
|
|
|
4208
4236
|
CTA_CLICKED: "gamaro:cta-clicked",
|
|
4209
4237
|
LEAD_CAPTURED: "gamaro:lead-captured",
|
|
4210
4238
|
IDENTITY_VERIFIED: "gamaro:identity-verified"
|
|
4211
|
-
},
|
|
4239
|
+
}, ku = R({
|
|
4212
4240
|
reason: P(["timeout", "error"]).describe("Why the iframe load failed (timeout vs. transport error)"),
|
|
4213
4241
|
attempts: Pe().int().min(1).describe("Total attempts made before giving up (e.g. 3 = 1 + 2 retries)")
|
|
4214
|
-
}).describe("Payload emitted with the widget-unavailable SDK event (#867)"),
|
|
4242
|
+
}).describe("Payload emitted with the widget-unavailable SDK event (#867)"), Vc = P([
|
|
4215
4243
|
"prospect",
|
|
4216
4244
|
"partner",
|
|
4217
4245
|
"unknown"
|
|
4218
|
-
]).describe("Type of user"),
|
|
4246
|
+
]).describe("Type of user"), Kc = P([
|
|
4219
4247
|
"ecommerce",
|
|
4220
4248
|
"real-estate",
|
|
4221
4249
|
"automotive",
|
|
4222
4250
|
"travel",
|
|
4223
4251
|
"recruitment",
|
|
4224
4252
|
"other"
|
|
4225
|
-
]).describe("Business sector"),
|
|
4253
|
+
]).describe("Business sector"), Hc = P([
|
|
4226
4254
|
"startup",
|
|
4227
4255
|
"pme",
|
|
4228
4256
|
"eti",
|
|
4229
4257
|
"grand-groupe"
|
|
4230
|
-
]).describe("Company size category"),
|
|
4258
|
+
]).describe("Company size category"), Gc = P([
|
|
4231
4259
|
"< 10k",
|
|
4232
4260
|
"10k-50k",
|
|
4233
4261
|
"50k-200k",
|
|
4234
4262
|
"> 200k"
|
|
4235
|
-
]).describe("Monthly website traffic"),
|
|
4263
|
+
]).describe("Monthly website traffic"), qc = P([
|
|
4236
4264
|
"lead-qualification",
|
|
4237
4265
|
"personalization",
|
|
4238
4266
|
"cart-abandonment",
|
|
4239
4267
|
"conversion",
|
|
4240
4268
|
"other"
|
|
4241
|
-
]).describe("Business objective"),
|
|
4269
|
+
]).describe("Business objective"), Yc = P([
|
|
4242
4270
|
"shopify",
|
|
4243
4271
|
"woocommerce",
|
|
4244
4272
|
"prestashop",
|
|
4245
4273
|
"custom",
|
|
4246
4274
|
"none"
|
|
4247
|
-
]).describe("E-commerce platform"),
|
|
4275
|
+
]).describe("E-commerce platform"), Xc = P([
|
|
4248
4276
|
"immediate",
|
|
4249
4277
|
"1-month",
|
|
4250
4278
|
"3-months",
|
|
4251
4279
|
"exploring"
|
|
4252
|
-
]).describe("Implementation timeline"),
|
|
4280
|
+
]).describe("Implementation timeline"), Qc = P([
|
|
4253
4281
|
"< 500",
|
|
4254
4282
|
"500-2000",
|
|
4255
4283
|
"2000-5000",
|
|
4256
4284
|
"> 5000"
|
|
4257
|
-
]).describe("Monthly budget range in EUR"),
|
|
4258
|
-
userType:
|
|
4259
|
-
sector:
|
|
4260
|
-
companySize:
|
|
4261
|
-
monthlyTraffic:
|
|
4262
|
-
objectives:
|
|
4263
|
-
platform:
|
|
4264
|
-
timeline:
|
|
4265
|
-
budgetRange:
|
|
4285
|
+
]).describe("Monthly budget range in EUR"), Ou = R({
|
|
4286
|
+
userType: Vc.optional().describe("User type: prospect, partner, or unknown"),
|
|
4287
|
+
sector: Kc.optional().describe("Business sector"),
|
|
4288
|
+
companySize: Hc.optional().describe("Company size range"),
|
|
4289
|
+
monthlyTraffic: Gc.optional().describe("Monthly website traffic"),
|
|
4290
|
+
objectives: gt(qc).max(5).describe("List of business objectives (max 5)").optional(),
|
|
4291
|
+
platform: Yc.optional().describe("E-commerce platform"),
|
|
4292
|
+
timeline: Xc.optional().describe("Project timeline"),
|
|
4293
|
+
budgetRange: Qc.optional().describe("Monthly budget range")
|
|
4266
4294
|
}), Y = class extends Error {
|
|
4267
4295
|
constructor(e, t) {
|
|
4268
4296
|
super(e), this.code = t, this.name = "ConfigFetchError";
|
|
4269
4297
|
}
|
|
4270
|
-
},
|
|
4271
|
-
async function
|
|
4272
|
-
const n = t.endsWith("/") ? t : `${t}/`, i = new URL("api/application/config", n), o = new AbortController(), s = setTimeout(() => o.abort(),
|
|
4298
|
+
}, rr = 1e4;
|
|
4299
|
+
async function eu(e, t, r) {
|
|
4300
|
+
const n = t.endsWith("/") ? t : `${t}/`, i = new URL("api/application/config", n), o = new AbortController(), s = setTimeout(() => o.abort(), rr), a = r ? AbortSignal.any([o.signal, r]) : o.signal;
|
|
4273
4301
|
let c;
|
|
4274
4302
|
try {
|
|
4275
4303
|
c = await fetch(i.toString(), {
|
|
@@ -4277,22 +4305,22 @@ async function Yc(e, t, r) {
|
|
|
4277
4305
|
headers: { "x-gamaro-key": e }
|
|
4278
4306
|
});
|
|
4279
4307
|
} catch (d) {
|
|
4280
|
-
throw clearTimeout(s), r?.aborted ? new Y("Config fetch aborted by caller", "ABORTED") : d instanceof DOMException && d.name === "AbortError" ? new Y(`Config fetch timed out after ${
|
|
4308
|
+
throw clearTimeout(s), r?.aborted ? new Y("Config fetch aborted by caller", "ABORTED") : d instanceof DOMException && d.name === "AbortError" ? new Y(`Config fetch timed out after ${rr}ms`, "TIMEOUT") : new Y(`Network error fetching application config: ${d instanceof Error ? d.message : String(d)}`, "NETWORK_ERROR");
|
|
4281
4309
|
}
|
|
4282
4310
|
if (clearTimeout(s), !c.ok) {
|
|
4283
4311
|
const d = await c.text().catch(() => "");
|
|
4284
4312
|
throw new Y(`HTTP ${c.status} fetching application config: ${d}`, `HTTP_${c.status}`);
|
|
4285
4313
|
}
|
|
4286
|
-
const u = await c.json(), f =
|
|
4314
|
+
const u = await c.json(), f = Bc.safeParse(u);
|
|
4287
4315
|
if (!f.success) throw new Y(`Invalid application config response: ${f.error.message}`, "PARSE_ERROR");
|
|
4288
4316
|
return f.data;
|
|
4289
4317
|
}
|
|
4290
|
-
var
|
|
4318
|
+
var tu = [1e3, 3e3], X = class extends Error {
|
|
4291
4319
|
constructor(e, t) {
|
|
4292
4320
|
super(`Iframe load failed after ${t} attempt(s): ${e}`), this.reason = e, this.attempts = t, this.name = "IframeLoadError";
|
|
4293
4321
|
}
|
|
4294
4322
|
};
|
|
4295
|
-
function
|
|
4323
|
+
function ru(e, t) {
|
|
4296
4324
|
return new Promise((r, n) => {
|
|
4297
4325
|
if (t?.aborted) {
|
|
4298
4326
|
n(new DOMException("Aborted", "AbortError"));
|
|
@@ -4306,7 +4334,7 @@ function Qc(e, t) {
|
|
|
4306
4334
|
t?.addEventListener("abort", i, { once: !0 });
|
|
4307
4335
|
});
|
|
4308
4336
|
}
|
|
4309
|
-
function
|
|
4337
|
+
function nu(e, t) {
|
|
4310
4338
|
return new Promise((r, n) => {
|
|
4311
4339
|
if (e.signal?.aborted) {
|
|
4312
4340
|
n(new DOMException("Aborted", "AbortError"));
|
|
@@ -4326,7 +4354,7 @@ function eu(e, t) {
|
|
|
4326
4354
|
}, d = () => {
|
|
4327
4355
|
v(), n(new X("error", t + 1));
|
|
4328
4356
|
}, h = (_) => {
|
|
4329
|
-
_.source && (_.source && _.source !== i.contentWindow ||
|
|
4357
|
+
_.source && (_.source && _.source !== i.contentWindow || ur(_.origin, e.allowedOrigins) && lr(_) && _.data.type === Wc.READY && (c = !0, b()));
|
|
4330
4358
|
}, p = () => {
|
|
4331
4359
|
v(), n(new DOMException("Aborted", "AbortError"));
|
|
4332
4360
|
}, i.addEventListener("load", f), i.addEventListener("error", d), window.addEventListener("message", h), e.signal?.addEventListener("abort", p, { once: !0 }), u = setTimeout(() => {
|
|
@@ -4338,15 +4366,15 @@ function eu(e, t) {
|
|
|
4338
4366
|
e.container.appendChild(i);
|
|
4339
4367
|
});
|
|
4340
4368
|
}
|
|
4341
|
-
async function
|
|
4342
|
-
const t = e.backoffMs ??
|
|
4369
|
+
async function iu(e) {
|
|
4370
|
+
const t = e.backoffMs ?? tu, r = t.length + 1;
|
|
4343
4371
|
for (let n = 0; n < r; n++) {
|
|
4344
4372
|
e.onStateChange?.({
|
|
4345
4373
|
kind: "loading",
|
|
4346
4374
|
attempt: n
|
|
4347
4375
|
});
|
|
4348
4376
|
try {
|
|
4349
|
-
const i = await
|
|
4377
|
+
const i = await nu(e, n);
|
|
4350
4378
|
return e.onStateChange?.({
|
|
4351
4379
|
kind: "loaded",
|
|
4352
4380
|
iframe: i
|
|
@@ -4365,20 +4393,20 @@ async function tu(e) {
|
|
|
4365
4393
|
kind: "retrying",
|
|
4366
4394
|
attempt: n + 1,
|
|
4367
4395
|
reason: o
|
|
4368
|
-
}), Se(`Iframe load attempt ${n + 1} ${o === "timeout" ? "timed out" : "errored"}, retrying in ${s}ms`), await
|
|
4396
|
+
}), Se(`Iframe load attempt ${n + 1} ${o === "timeout" ? "timed out" : "errored"}, retrying in ${s}ms`), await ru(s, e.signal);
|
|
4369
4397
|
}
|
|
4370
4398
|
}
|
|
4371
4399
|
throw new X("error", r);
|
|
4372
4400
|
}
|
|
4373
|
-
var
|
|
4401
|
+
var ou = "0.1.0", _e = "https://gamaro.io/app", su = [
|
|
4374
4402
|
1e3,
|
|
4375
4403
|
2e3,
|
|
4376
4404
|
3e3,
|
|
4377
4405
|
4e3
|
|
4378
|
-
],
|
|
4406
|
+
], au = 0.3, cu = 0, uu = {
|
|
4379
4407
|
mobile: 480,
|
|
4380
4408
|
tablet: 768
|
|
4381
|
-
},
|
|
4409
|
+
}, nr = {
|
|
4382
4410
|
mobile: {
|
|
4383
4411
|
width: "100vw",
|
|
4384
4412
|
height: "100vh"
|
|
@@ -4391,19 +4419,19 @@ var ru = "0.1.0", _e = "https://gamaro.io/app", nu = [
|
|
|
4391
4419
|
width: "380px",
|
|
4392
4420
|
height: "600px"
|
|
4393
4421
|
}
|
|
4394
|
-
},
|
|
4422
|
+
}, lu = 100, fu = {
|
|
4395
4423
|
position: "fixed",
|
|
4396
4424
|
zIndex: "999999",
|
|
4397
4425
|
border: "none",
|
|
4398
4426
|
overflow: "hidden"
|
|
4399
|
-
}, ae = `${
|
|
4427
|
+
}, ae = `${cr.slow}ms`, ir = `${cr.base}ms`, du = [
|
|
4400
4428
|
`width ${ae} ${K.emphasized}`,
|
|
4401
4429
|
`height ${ae} ${K.emphasized}`,
|
|
4402
4430
|
`border-radius ${ae} ${K.emphasized}`,
|
|
4403
4431
|
`box-shadow ${ae} ${K.emphasized}`,
|
|
4404
4432
|
`transform ${ae} ${K.emphasized}`
|
|
4405
|
-
].join(", "),
|
|
4406
|
-
function
|
|
4433
|
+
].join(", "), hu = [`opacity ${ir} ${K.standard}`, `background ${ir} ${K.standard}`].join(", ");
|
|
4434
|
+
function or() {
|
|
4407
4435
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
4408
4436
|
}
|
|
4409
4437
|
var ye = {
|
|
@@ -4415,23 +4443,23 @@ var ye = {
|
|
|
4415
4443
|
bottom: "20px",
|
|
4416
4444
|
left: "20px"
|
|
4417
4445
|
}
|
|
4418
|
-
},
|
|
4446
|
+
}, pu = {
|
|
4419
4447
|
width: "100%",
|
|
4420
4448
|
height: "100%",
|
|
4421
4449
|
border: "none",
|
|
4422
4450
|
backgroundColor: "transparent"
|
|
4423
|
-
},
|
|
4451
|
+
}, mu = class {
|
|
4424
4452
|
get applicationId() {
|
|
4425
4453
|
return this._applicationId;
|
|
4426
4454
|
}
|
|
4427
4455
|
constructor(e) {
|
|
4428
|
-
this.version =
|
|
4456
|
+
this.version = ou, this.iframe = null, this.container = null, this.skeletonButton = null, this.isOpen = !1, this.isReady = !1, this.isInitialized = !1, this.isDestroyed = !1, this.fetchAbortController = null, this.iframeLoadAbortController = null, this._applicationId = "", this.pendingCommands = [], this.eventHandlers = /* @__PURE__ */ new Map(), this.cleanupListener = null, this.currentViewportMode = "desktop", this.mobileMediaQuery = null, this.tabletMediaQuery = null, this.debounceTimer = null, this.viewportChangeHandler = null, this.originalConfig = { ...e }, this.config = {
|
|
4429
4457
|
position: "bottom-right",
|
|
4430
4458
|
open: !1,
|
|
4431
4459
|
baseUrl: _e,
|
|
4432
4460
|
debug: !1,
|
|
4433
4461
|
...e
|
|
4434
|
-
}, this.instanceId = ++
|
|
4462
|
+
}, this.instanceId = ++cu, this.debugLog = ln(this.config.debug ?? !1), this.renderSkeleton(), this.resolveConfig();
|
|
4435
4463
|
}
|
|
4436
4464
|
renderSkeleton() {
|
|
4437
4465
|
this.config.position !== "inline" && (this.container = this.createContainer(), this.renderSkeletonInto(this.container), document.body.appendChild(this.container));
|
|
@@ -4446,7 +4474,7 @@ var ye = {
|
|
|
4446
4474
|
"background: #9ca3af",
|
|
4447
4475
|
"cursor: default",
|
|
4448
4476
|
"opacity: 0.6",
|
|
4449
|
-
`transition: ${
|
|
4477
|
+
`transition: ${or() ? "none" : hu}`
|
|
4450
4478
|
].join(";"), e.appendChild(t), this.skeletonButton = t, t;
|
|
4451
4479
|
}
|
|
4452
4480
|
setSkeletonStateUnavailable() {
|
|
@@ -4455,12 +4483,12 @@ var ye = {
|
|
|
4455
4483
|
resolveConfig() {
|
|
4456
4484
|
const e = this.config.baseUrl ?? _e;
|
|
4457
4485
|
this.fetchAbortController = new AbortController();
|
|
4458
|
-
const t = (r) =>
|
|
4486
|
+
const t = (r) => eu(this.config.apiKey, e, this.fetchAbortController?.signal).then((n) => this.applyServerConfig(n)).catch((n) => {
|
|
4459
4487
|
const i = n instanceof Y ? n.code : "UNKNOWN_ERROR", o = n instanceof Error ? n.message : "Unknown config fetch error";
|
|
4460
4488
|
if (i === "ABORTED" || this.isDestroyed) return;
|
|
4461
|
-
const s =
|
|
4489
|
+
const s = su[r];
|
|
4462
4490
|
if (s !== void 0 && this.isTransientFetchError(i)) {
|
|
4463
|
-
const a = s * (1 + (Math.random() * 2 - 1) *
|
|
4491
|
+
const a = s * (1 + (Math.random() * 2 - 1) * au);
|
|
4464
4492
|
return Se(`Config fetch failed transiently (${i}), retrying in ${Math.round(a)}ms`), new Promise((c) => setTimeout(() => {
|
|
4465
4493
|
this.isDestroyed || c(t(r + 1));
|
|
4466
4494
|
}, a));
|
|
@@ -4503,7 +4531,7 @@ var ye = {
|
|
|
4503
4531
|
this.config.position !== "inline" && (e = this.renderSkeletonInto(this.container)), this.attachContainerToDom(), this.iframeLoadAbortController = new AbortController();
|
|
4504
4532
|
let t;
|
|
4505
4533
|
try {
|
|
4506
|
-
t = await
|
|
4534
|
+
t = await iu({
|
|
4507
4535
|
buildIframe: () => this.createIframe(),
|
|
4508
4536
|
container: this.container,
|
|
4509
4537
|
allowedOrigins: [this.resolveReadyOrigin()],
|
|
@@ -4560,7 +4588,7 @@ var ye = {
|
|
|
4560
4588
|
boxShadow: "0 4px 20px rgba(0, 0, 0, 0.1)"
|
|
4561
4589
|
});
|
|
4562
4590
|
else {
|
|
4563
|
-
Object.assign(e.style,
|
|
4591
|
+
Object.assign(e.style, fu);
|
|
4564
4592
|
const t = ye[this.config.position ?? "bottom-right"];
|
|
4565
4593
|
Object.assign(e.style, t), e.style.width = "60px", e.style.height = "60px", e.style.borderRadius = "50%";
|
|
4566
4594
|
}
|
|
@@ -4568,7 +4596,7 @@ var ye = {
|
|
|
4568
4596
|
}
|
|
4569
4597
|
createIframe() {
|
|
4570
4598
|
const e = document.createElement("iframe");
|
|
4571
|
-
return e.id = `gamaro-widget-iframe-${this.instanceId}`, e.src = this.buildIframeUrl(), e.setAttribute("title", "Gamaro Chat Widget"), e.setAttribute("allow", "clipboard-write; geolocation"), Object.assign(e.style,
|
|
4599
|
+
return e.id = `gamaro-widget-iframe-${this.instanceId}`, e.src = this.buildIframeUrl(), e.setAttribute("title", "Gamaro Chat Widget"), e.setAttribute("allow", "clipboard-write; geolocation"), Object.assign(e.style, pu), e;
|
|
4572
4600
|
}
|
|
4573
4601
|
buildIframeUrl() {
|
|
4574
4602
|
const e = this.config.baseUrl ?? _e, t = new URL("/app/widget/embed", e);
|
|
@@ -4577,7 +4605,7 @@ var ye = {
|
|
|
4577
4605
|
setupViewportListener() {
|
|
4578
4606
|
if (this.config.position === "inline" || this.config.responsive?.enabled === !1) return;
|
|
4579
4607
|
const e = {
|
|
4580
|
-
...
|
|
4608
|
+
...uu,
|
|
4581
4609
|
...this.config.responsive?.breakpoints
|
|
4582
4610
|
};
|
|
4583
4611
|
this.mobileMediaQuery = window.matchMedia(`(max-width: ${e.mobile}px)`), this.tabletMediaQuery = window.matchMedia(`(max-width: ${e.tablet}px)`), this.viewportChangeHandler = () => this.handleViewportChange(), this.mobileMediaQuery.addEventListener("change", this.viewportChangeHandler), this.tabletMediaQuery.addEventListener("change", this.viewportChangeHandler), this.currentViewportMode = this.getViewportMode(), this.log("Initial viewport mode:", this.currentViewportMode);
|
|
@@ -4589,18 +4617,18 @@ var ye = {
|
|
|
4589
4617
|
type: "gamaro:viewport",
|
|
4590
4618
|
mode: e
|
|
4591
4619
|
}, this.resolveReadyOrigin()));
|
|
4592
|
-
},
|
|
4620
|
+
}, lu);
|
|
4593
4621
|
}
|
|
4594
4622
|
getViewportMode() {
|
|
4595
4623
|
return this.mobileMediaQuery?.matches ? "mobile" : this.tabletMediaQuery?.matches ? "tablet" : "desktop";
|
|
4596
4624
|
}
|
|
4597
4625
|
applyContainerTransition() {
|
|
4598
|
-
this.container && (this.container.style.transition =
|
|
4626
|
+
this.container && (this.container.style.transition = or() ? "none" : du);
|
|
4599
4627
|
}
|
|
4600
4628
|
updateContainerForViewport(e) {
|
|
4601
4629
|
if (!this.container) return;
|
|
4602
4630
|
this.applyContainerTransition();
|
|
4603
|
-
const t =
|
|
4631
|
+
const t = nr[e];
|
|
4604
4632
|
if (e === "mobile") Object.assign(this.container.style, {
|
|
4605
4633
|
width: t.width,
|
|
4606
4634
|
height: t.height,
|
|
@@ -4715,7 +4743,7 @@ var ye = {
|
|
|
4715
4743
|
if (this.applyContainerTransition(), this.isOpen) {
|
|
4716
4744
|
if (this.config.responsive?.enabled !== !1) this.updateContainerForViewport(this.currentViewportMode);
|
|
4717
4745
|
else {
|
|
4718
|
-
const e =
|
|
4746
|
+
const e = nr.desktop;
|
|
4719
4747
|
this.container.style.width = e.width, this.container.style.height = e.height, this.container.style.borderRadius = "16px";
|
|
4720
4748
|
}
|
|
4721
4749
|
this.container.style.boxShadow = "0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05)";
|
|
@@ -4828,11 +4856,11 @@ var ye = {
|
|
|
4828
4856
|
this.debugLog(e, ...r);
|
|
4829
4857
|
}
|
|
4830
4858
|
};
|
|
4831
|
-
function
|
|
4832
|
-
return new
|
|
4859
|
+
function gu(e) {
|
|
4860
|
+
return new mu(e);
|
|
4833
4861
|
}
|
|
4834
|
-
var
|
|
4835
|
-
function
|
|
4862
|
+
var rt = /* @__PURE__ */ new WeakSet();
|
|
4863
|
+
function vu(e) {
|
|
4836
4864
|
const t = e.getAttribute("data-api-key") ?? void 0;
|
|
4837
4865
|
if (!t)
|
|
4838
4866
|
return ze("Missing required data-api-key attribute on script tag"), null;
|
|
@@ -4847,7 +4875,7 @@ function pu(e) {
|
|
|
4847
4875
|
...a && { userHash: a }
|
|
4848
4876
|
};
|
|
4849
4877
|
}
|
|
4850
|
-
function
|
|
4878
|
+
function bu() {
|
|
4851
4879
|
if (document.currentScript instanceof HTMLScriptElement) return document.currentScript;
|
|
4852
4880
|
const e = document.querySelectorAll("script[src]");
|
|
4853
4881
|
for (const t of e) {
|
|
@@ -4856,38 +4884,38 @@ function mu() {
|
|
|
4856
4884
|
}
|
|
4857
4885
|
return null;
|
|
4858
4886
|
}
|
|
4859
|
-
function
|
|
4887
|
+
function sr() {
|
|
4860
4888
|
const e = document.querySelectorAll("script[data-api-key]");
|
|
4861
4889
|
if (e.length === 0) {
|
|
4862
|
-
const t =
|
|
4863
|
-
t && t.hasAttribute("data-api-key") && !
|
|
4890
|
+
const t = bu();
|
|
4891
|
+
t && t.hasAttribute("data-api-key") && !rt.has(t) && ar(t);
|
|
4864
4892
|
return;
|
|
4865
4893
|
}
|
|
4866
|
-
for (const t of e)
|
|
4894
|
+
for (const t of e) ar(t);
|
|
4867
4895
|
}
|
|
4868
|
-
function
|
|
4869
|
-
if (
|
|
4870
|
-
|
|
4871
|
-
const t =
|
|
4896
|
+
function ar(e) {
|
|
4897
|
+
if (rt.has(e)) return;
|
|
4898
|
+
rt.add(e);
|
|
4899
|
+
const t = vu(e);
|
|
4872
4900
|
if (!t) return;
|
|
4873
|
-
const r =
|
|
4901
|
+
const r = gu(t);
|
|
4874
4902
|
window.Gamaro || (window.Gamaro = r), window.GamaroApps || (window.GamaroApps = /* @__PURE__ */ new Map()), r.on("ready", () => {
|
|
4875
4903
|
r.applicationId && window.GamaroApps && window.GamaroApps.set(r.applicationId, r);
|
|
4876
4904
|
}), Se(`Widget v${r.version} initializing...`);
|
|
4877
4905
|
}
|
|
4878
|
-
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
4906
|
+
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", sr) : sr());
|
|
4879
4907
|
export {
|
|
4880
4908
|
Y as ConfigFetchError,
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4909
|
+
mu as GamaroWidget,
|
|
4910
|
+
sr as __autoInit,
|
|
4911
|
+
bu as __getCurrentScript,
|
|
4912
|
+
vu as __parseScriptAttributes,
|
|
4913
|
+
Bc as applicationConfigResponseSchema,
|
|
4914
|
+
Ou as b2bProfileSchema,
|
|
4915
|
+
gu as createWidget,
|
|
4916
|
+
eu as fetchApplicationConfig,
|
|
4917
|
+
vt as themeConfigSchema,
|
|
4918
|
+
yu as widgetConfigSchema,
|
|
4919
|
+
wu as widgetMessageSchema,
|
|
4892
4920
|
an as widgetPositionSchema
|
|
4893
4921
|
};
|