@fiction/sdk 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk.js +1198 -1737
- package/dist/sdk.js.map +1 -1
- package/dist/sdkClient-C9BL_Op4.js +731 -0
- package/dist/sdkClient-C9BL_Op4.js.map +1 -0
- package/dist/self/index.d.ts +1 -1
- package/dist/self/ui/SelfModal.vue.d.ts +4 -4
- package/dist/self/ui/SelfProvider.vue.d.ts +2 -1
- package/dist/self/ui/{FictionWidget.vue.d.ts → SelfWidget.vue.d.ts} +1 -1
- package/dist/self/ui/SelfWrap.vue.d.ts +3 -1
- package/dist/self.js +786 -781
- package/dist/self.js.map +1 -1
- package/package.json +2 -2
- package/dist/base-CEr2lLFg.js +0 -194
- package/dist/base-CEr2lLFg.js.map +0 -1
package/dist/sdk.js
CHANGED
|
@@ -1,70 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { watch as Me, ref as H, computed as Ve } from "vue";
|
|
7
|
-
import { c as Wt, S as Gt } from "./base-CEr2lLFg.js";
|
|
8
|
-
import { hc as Jt } from "hono/client";
|
|
9
|
-
function c(e, t, n) {
|
|
10
|
-
function o(d, p) {
|
|
1
|
+
var yt = Object.defineProperty;
|
|
2
|
+
var a = (e, t) => yt(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
import { F as rc } from "./sdkClient-C9BL_Op4.js";
|
|
4
|
+
function u(e, t, n) {
|
|
5
|
+
function o(p, h) {
|
|
11
6
|
var f;
|
|
12
|
-
Object.defineProperty(
|
|
13
|
-
value:
|
|
7
|
+
Object.defineProperty(p, "_zod", {
|
|
8
|
+
value: p._zod ?? {},
|
|
14
9
|
enumerable: !1
|
|
15
|
-
}), (f =
|
|
16
|
-
for (const
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
}), (f = p._zod).traits ?? (f.traits = /* @__PURE__ */ new Set()), p._zod.traits.add(e), t(p, h);
|
|
11
|
+
for (const w in i.prototype)
|
|
12
|
+
w in p || Object.defineProperty(p, w, { value: i.prototype[w].bind(p) });
|
|
13
|
+
p._zod.constr = i, p._zod.def = h;
|
|
19
14
|
}
|
|
20
|
-
|
|
21
|
-
const r = n?.Parent ?? Object,
|
|
15
|
+
a(o, "init");
|
|
16
|
+
const r = n?.Parent ?? Object, s = class s extends r {
|
|
22
17
|
};
|
|
23
|
-
s
|
|
24
|
-
let
|
|
25
|
-
Object.defineProperty(
|
|
26
|
-
function
|
|
27
|
-
var
|
|
28
|
-
const f = n?.Parent ? new
|
|
29
|
-
o(f,
|
|
30
|
-
for (const
|
|
31
|
-
|
|
18
|
+
a(s, "Definition");
|
|
19
|
+
let c = s;
|
|
20
|
+
Object.defineProperty(c, "name", { value: e });
|
|
21
|
+
function i(p) {
|
|
22
|
+
var h;
|
|
23
|
+
const f = n?.Parent ? new c() : this;
|
|
24
|
+
o(f, p), (h = f._zod).deferred ?? (h.deferred = []);
|
|
25
|
+
for (const w of f._zod.deferred)
|
|
26
|
+
w();
|
|
32
27
|
return f;
|
|
33
28
|
}
|
|
34
|
-
return
|
|
35
|
-
value: /* @__PURE__ */
|
|
36
|
-
}), Object.defineProperty(
|
|
29
|
+
return a(i, "_"), Object.defineProperty(i, "init", { value: o }), Object.defineProperty(i, Symbol.hasInstance, {
|
|
30
|
+
value: /* @__PURE__ */ a((p) => n?.Parent && p instanceof n.Parent ? !0 : p?._zod?.traits?.has(e), "value")
|
|
31
|
+
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
37
32
|
}
|
|
38
|
-
|
|
39
|
-
const
|
|
33
|
+
a(u, "$constructor");
|
|
34
|
+
const ke = class ke extends Error {
|
|
40
35
|
constructor() {
|
|
41
36
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
42
37
|
}
|
|
43
38
|
};
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
const
|
|
39
|
+
a(ke, "$ZodAsyncError");
|
|
40
|
+
let T = ke;
|
|
41
|
+
const Ze = class Ze extends Error {
|
|
47
42
|
constructor(t) {
|
|
48
43
|
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
49
44
|
}
|
|
50
45
|
};
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
const
|
|
54
|
-
function
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function
|
|
46
|
+
a(Ze, "$ZodEncodeError");
|
|
47
|
+
let ee = Ze;
|
|
48
|
+
const Ke = {};
|
|
49
|
+
function D(e) {
|
|
50
|
+
return Ke;
|
|
51
|
+
}
|
|
52
|
+
a(D, "config");
|
|
53
|
+
function It(e) {
|
|
59
54
|
const t = Object.values(e).filter((o) => typeof o == "number");
|
|
60
55
|
return Object.entries(e).filter(([o, r]) => t.indexOf(+o) === -1).map(([o, r]) => r);
|
|
61
56
|
}
|
|
62
|
-
|
|
63
|
-
function
|
|
57
|
+
a(It, "getEnumValues");
|
|
58
|
+
function le(e, t) {
|
|
64
59
|
return typeof t == "bigint" ? t.toString() : t;
|
|
65
60
|
}
|
|
66
|
-
|
|
67
|
-
function
|
|
61
|
+
a(le, "jsonStringifyReplacer");
|
|
62
|
+
function ie(e) {
|
|
68
63
|
return {
|
|
69
64
|
get value() {
|
|
70
65
|
{
|
|
@@ -74,34 +69,34 @@ function he(e) {
|
|
|
74
69
|
}
|
|
75
70
|
};
|
|
76
71
|
}
|
|
77
|
-
|
|
78
|
-
function
|
|
72
|
+
a(ie, "cached");
|
|
73
|
+
function _e(e) {
|
|
79
74
|
return e == null;
|
|
80
75
|
}
|
|
81
|
-
|
|
82
|
-
function
|
|
76
|
+
a(_e, "nullish");
|
|
77
|
+
function ve(e) {
|
|
83
78
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
84
79
|
return e.slice(t, n);
|
|
85
80
|
}
|
|
86
|
-
|
|
87
|
-
function
|
|
81
|
+
a(ve, "cleanRegex");
|
|
82
|
+
function At(e, t) {
|
|
88
83
|
const n = (e.toString().split(".")[1] || "").length, o = t.toString();
|
|
89
84
|
let r = (o.split(".")[1] || "").length;
|
|
90
85
|
if (r === 0 && /\d?e-\d?/.test(o)) {
|
|
91
|
-
const
|
|
92
|
-
|
|
86
|
+
const p = o.match(/\d?e-(\d?)/);
|
|
87
|
+
p?.[1] && (r = Number.parseInt(p[1]));
|
|
93
88
|
}
|
|
94
|
-
const
|
|
95
|
-
return
|
|
89
|
+
const c = n > r ? n : r, i = Number.parseInt(e.toFixed(c).replace(".", "")), s = Number.parseInt(t.toFixed(c).replace(".", ""));
|
|
90
|
+
return i % s / 10 ** c;
|
|
96
91
|
}
|
|
97
|
-
|
|
98
|
-
const
|
|
92
|
+
a(At, "floatSafeRemainder");
|
|
93
|
+
const Ae = Symbol("evaluating");
|
|
99
94
|
function m(e, t, n) {
|
|
100
95
|
let o;
|
|
101
96
|
Object.defineProperty(e, t, {
|
|
102
97
|
get() {
|
|
103
|
-
if (o !==
|
|
104
|
-
return o === void 0 && (o =
|
|
98
|
+
if (o !== Ae)
|
|
99
|
+
return o === void 0 && (o = Ae, o = n()), o;
|
|
105
100
|
},
|
|
106
101
|
set(r) {
|
|
107
102
|
Object.defineProperty(e, t, {
|
|
@@ -112,8 +107,8 @@ function m(e, t, n) {
|
|
|
112
107
|
configurable: !0
|
|
113
108
|
});
|
|
114
109
|
}
|
|
115
|
-
|
|
116
|
-
function
|
|
110
|
+
a(m, "defineLazy");
|
|
111
|
+
function F(e, t, n) {
|
|
117
112
|
Object.defineProperty(e, t, {
|
|
118
113
|
value: n,
|
|
119
114
|
writable: !0,
|
|
@@ -121,8 +116,8 @@ function L(e, t, n) {
|
|
|
121
116
|
configurable: !0
|
|
122
117
|
});
|
|
123
118
|
}
|
|
124
|
-
|
|
125
|
-
function
|
|
119
|
+
a(F, "assignProp");
|
|
120
|
+
function R(...e) {
|
|
126
121
|
const t = {};
|
|
127
122
|
for (const n of e) {
|
|
128
123
|
const o = Object.getOwnPropertyDescriptors(n);
|
|
@@ -130,18 +125,18 @@ function M(...e) {
|
|
|
130
125
|
}
|
|
131
126
|
return Object.defineProperties({}, t);
|
|
132
127
|
}
|
|
133
|
-
|
|
134
|
-
function
|
|
128
|
+
a(R, "mergeDefs");
|
|
129
|
+
function Ee(e) {
|
|
135
130
|
return JSON.stringify(e);
|
|
136
131
|
}
|
|
137
|
-
|
|
138
|
-
const
|
|
132
|
+
a(Ee, "esc");
|
|
133
|
+
const Ye = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
139
134
|
};
|
|
140
|
-
function
|
|
135
|
+
function V(e) {
|
|
141
136
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
142
137
|
}
|
|
143
|
-
|
|
144
|
-
const
|
|
138
|
+
a(V, "isObject");
|
|
139
|
+
const Et = ie(() => {
|
|
145
140
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
146
141
|
return !1;
|
|
147
142
|
try {
|
|
@@ -151,122 +146,122 @@ const Yt = he(() => {
|
|
|
151
146
|
return !1;
|
|
152
147
|
}
|
|
153
148
|
});
|
|
154
|
-
function
|
|
155
|
-
if (
|
|
149
|
+
function B(e) {
|
|
150
|
+
if (V(e) === !1)
|
|
156
151
|
return !1;
|
|
157
152
|
const t = e.constructor;
|
|
158
153
|
if (t === void 0)
|
|
159
154
|
return !0;
|
|
160
155
|
const n = t.prototype;
|
|
161
|
-
return !(
|
|
156
|
+
return !(V(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
162
157
|
}
|
|
163
|
-
|
|
164
|
-
function
|
|
165
|
-
return
|
|
158
|
+
a(B, "isPlainObject");
|
|
159
|
+
function Xe(e) {
|
|
160
|
+
return B(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
166
161
|
}
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
function
|
|
162
|
+
a(Xe, "shallowClone");
|
|
163
|
+
const St = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
164
|
+
function L(e) {
|
|
170
165
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
171
166
|
}
|
|
172
|
-
|
|
173
|
-
function
|
|
167
|
+
a(L, "escapeRegex");
|
|
168
|
+
function j(e, t, n) {
|
|
174
169
|
const o = new e._zod.constr(t ?? e._zod.def);
|
|
175
170
|
return (!t || n?.parent) && (o._zod.parent = e), o;
|
|
176
171
|
}
|
|
177
|
-
|
|
178
|
-
function
|
|
172
|
+
a(j, "clone");
|
|
173
|
+
function d(e) {
|
|
179
174
|
const t = e;
|
|
180
175
|
if (!t)
|
|
181
176
|
return {};
|
|
182
177
|
if (typeof t == "string")
|
|
183
|
-
return { error: /* @__PURE__ */
|
|
178
|
+
return { error: /* @__PURE__ */ a(() => t, "error") };
|
|
184
179
|
if (t?.message !== void 0) {
|
|
185
180
|
if (t?.error !== void 0)
|
|
186
181
|
throw new Error("Cannot specify both `message` and `error` params");
|
|
187
182
|
t.error = t.message;
|
|
188
183
|
}
|
|
189
|
-
return delete t.message, typeof t.error == "string" ? { ...t, error: /* @__PURE__ */
|
|
184
|
+
return delete t.message, typeof t.error == "string" ? { ...t, error: /* @__PURE__ */ a(() => t.error, "error") } : t;
|
|
190
185
|
}
|
|
191
|
-
|
|
192
|
-
function
|
|
186
|
+
a(d, "normalizeParams");
|
|
187
|
+
function Ot(e) {
|
|
193
188
|
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
194
189
|
}
|
|
195
|
-
|
|
196
|
-
const
|
|
190
|
+
a(Ot, "optionalKeys");
|
|
191
|
+
const Pt = {
|
|
197
192
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
198
193
|
int32: [-2147483648, 2147483647],
|
|
199
194
|
uint32: [0, 4294967295],
|
|
200
195
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
201
196
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
202
197
|
};
|
|
203
|
-
function
|
|
204
|
-
const n = e._zod.def, o =
|
|
198
|
+
function Tt(e, t) {
|
|
199
|
+
const n = e._zod.def, o = R(e._zod.def, {
|
|
205
200
|
get shape() {
|
|
206
201
|
const r = {};
|
|
207
|
-
for (const
|
|
208
|
-
if (!(
|
|
209
|
-
throw new Error(`Unrecognized key: "${
|
|
210
|
-
t[
|
|
202
|
+
for (const c in t) {
|
|
203
|
+
if (!(c in n.shape))
|
|
204
|
+
throw new Error(`Unrecognized key: "${c}"`);
|
|
205
|
+
t[c] && (r[c] = n.shape[c]);
|
|
211
206
|
}
|
|
212
|
-
return
|
|
207
|
+
return F(this, "shape", r), r;
|
|
213
208
|
},
|
|
214
209
|
checks: []
|
|
215
210
|
});
|
|
216
|
-
return
|
|
211
|
+
return j(e, o);
|
|
217
212
|
}
|
|
218
|
-
|
|
219
|
-
function
|
|
220
|
-
const n = e._zod.def, o =
|
|
213
|
+
a(Tt, "pick");
|
|
214
|
+
function xt(e, t) {
|
|
215
|
+
const n = e._zod.def, o = R(e._zod.def, {
|
|
221
216
|
get shape() {
|
|
222
217
|
const r = { ...e._zod.def.shape };
|
|
223
|
-
for (const
|
|
224
|
-
if (!(
|
|
225
|
-
throw new Error(`Unrecognized key: "${
|
|
226
|
-
t[
|
|
218
|
+
for (const c in t) {
|
|
219
|
+
if (!(c in n.shape))
|
|
220
|
+
throw new Error(`Unrecognized key: "${c}"`);
|
|
221
|
+
t[c] && delete r[c];
|
|
227
222
|
}
|
|
228
|
-
return
|
|
223
|
+
return F(this, "shape", r), r;
|
|
229
224
|
},
|
|
230
225
|
checks: []
|
|
231
226
|
});
|
|
232
|
-
return
|
|
227
|
+
return j(e, o);
|
|
233
228
|
}
|
|
234
|
-
|
|
235
|
-
function
|
|
236
|
-
if (!
|
|
229
|
+
a(xt, "omit");
|
|
230
|
+
function Nt(e, t) {
|
|
231
|
+
if (!B(t))
|
|
237
232
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
238
233
|
const n = e._zod.def.checks;
|
|
239
234
|
if (n && n.length > 0)
|
|
240
235
|
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
241
|
-
const r =
|
|
236
|
+
const r = R(e._zod.def, {
|
|
242
237
|
get shape() {
|
|
243
|
-
const
|
|
244
|
-
return
|
|
238
|
+
const c = { ...e._zod.def.shape, ...t };
|
|
239
|
+
return F(this, "shape", c), c;
|
|
245
240
|
},
|
|
246
241
|
checks: []
|
|
247
242
|
});
|
|
248
|
-
return
|
|
243
|
+
return j(e, r);
|
|
249
244
|
}
|
|
250
|
-
|
|
251
|
-
function
|
|
252
|
-
if (!
|
|
245
|
+
a(Nt, "extend");
|
|
246
|
+
function jt(e, t) {
|
|
247
|
+
if (!B(t))
|
|
253
248
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
254
249
|
const n = {
|
|
255
250
|
...e._zod.def,
|
|
256
251
|
get shape() {
|
|
257
252
|
const o = { ...e._zod.def.shape, ...t };
|
|
258
|
-
return
|
|
253
|
+
return F(this, "shape", o), o;
|
|
259
254
|
},
|
|
260
255
|
checks: e._zod.def.checks
|
|
261
256
|
};
|
|
262
|
-
return
|
|
257
|
+
return j(e, n);
|
|
263
258
|
}
|
|
264
|
-
|
|
265
|
-
function
|
|
266
|
-
const n =
|
|
259
|
+
a(jt, "safeExtend");
|
|
260
|
+
function Dt(e, t) {
|
|
261
|
+
const n = R(e._zod.def, {
|
|
267
262
|
get shape() {
|
|
268
263
|
const o = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
269
|
-
return
|
|
264
|
+
return F(this, "shape", o), o;
|
|
270
265
|
},
|
|
271
266
|
get catchall() {
|
|
272
267
|
return t._zod.def.catchall;
|
|
@@ -274,62 +269,62 @@ function rn(e, t) {
|
|
|
274
269
|
checks: []
|
|
275
270
|
// delete existing checks
|
|
276
271
|
});
|
|
277
|
-
return
|
|
272
|
+
return j(e, n);
|
|
278
273
|
}
|
|
279
|
-
|
|
280
|
-
function
|
|
281
|
-
const o =
|
|
274
|
+
a(Dt, "merge");
|
|
275
|
+
function Ct(e, t, n) {
|
|
276
|
+
const o = R(t._zod.def, {
|
|
282
277
|
get shape() {
|
|
283
|
-
const r = t._zod.def.shape,
|
|
278
|
+
const r = t._zod.def.shape, c = { ...r };
|
|
284
279
|
if (n)
|
|
285
|
-
for (const
|
|
286
|
-
if (!(
|
|
287
|
-
throw new Error(`Unrecognized key: "${
|
|
288
|
-
n[
|
|
280
|
+
for (const i in n) {
|
|
281
|
+
if (!(i in r))
|
|
282
|
+
throw new Error(`Unrecognized key: "${i}"`);
|
|
283
|
+
n[i] && (c[i] = e ? new e({
|
|
289
284
|
type: "optional",
|
|
290
|
-
innerType: r[
|
|
291
|
-
}) : r[
|
|
285
|
+
innerType: r[i]
|
|
286
|
+
}) : r[i]);
|
|
292
287
|
}
|
|
293
288
|
else
|
|
294
|
-
for (const
|
|
295
|
-
i
|
|
289
|
+
for (const i in r)
|
|
290
|
+
c[i] = e ? new e({
|
|
296
291
|
type: "optional",
|
|
297
|
-
innerType: r[
|
|
298
|
-
}) : r[
|
|
299
|
-
return
|
|
292
|
+
innerType: r[i]
|
|
293
|
+
}) : r[i];
|
|
294
|
+
return F(this, "shape", c), c;
|
|
300
295
|
},
|
|
301
296
|
checks: []
|
|
302
297
|
});
|
|
303
|
-
return
|
|
298
|
+
return j(t, o);
|
|
304
299
|
}
|
|
305
|
-
|
|
306
|
-
function
|
|
307
|
-
const o =
|
|
300
|
+
a(Ct, "partial");
|
|
301
|
+
function Ft(e, t, n) {
|
|
302
|
+
const o = R(t._zod.def, {
|
|
308
303
|
get shape() {
|
|
309
|
-
const r = t._zod.def.shape,
|
|
304
|
+
const r = t._zod.def.shape, c = { ...r };
|
|
310
305
|
if (n)
|
|
311
|
-
for (const
|
|
312
|
-
if (!(
|
|
313
|
-
throw new Error(`Unrecognized key: "${
|
|
314
|
-
n[
|
|
306
|
+
for (const i in n) {
|
|
307
|
+
if (!(i in c))
|
|
308
|
+
throw new Error(`Unrecognized key: "${i}"`);
|
|
309
|
+
n[i] && (c[i] = new e({
|
|
315
310
|
type: "nonoptional",
|
|
316
|
-
innerType: r[
|
|
311
|
+
innerType: r[i]
|
|
317
312
|
}));
|
|
318
313
|
}
|
|
319
314
|
else
|
|
320
|
-
for (const
|
|
321
|
-
i
|
|
315
|
+
for (const i in r)
|
|
316
|
+
c[i] = new e({
|
|
322
317
|
type: "nonoptional",
|
|
323
|
-
innerType: r[
|
|
318
|
+
innerType: r[i]
|
|
324
319
|
});
|
|
325
|
-
return
|
|
320
|
+
return F(this, "shape", c), c;
|
|
326
321
|
},
|
|
327
322
|
checks: []
|
|
328
323
|
});
|
|
329
|
-
return
|
|
324
|
+
return j(t, o);
|
|
330
325
|
}
|
|
331
|
-
|
|
332
|
-
function
|
|
326
|
+
a(Ft, "required");
|
|
327
|
+
function U(e, t = 0) {
|
|
333
328
|
if (e.aborted === !0)
|
|
334
329
|
return !0;
|
|
335
330
|
for (let n = t; n < e.issues.length; n++)
|
|
@@ -337,32 +332,32 @@ function V(e, t = 0) {
|
|
|
337
332
|
return !0;
|
|
338
333
|
return !1;
|
|
339
334
|
}
|
|
340
|
-
|
|
341
|
-
function
|
|
335
|
+
a(U, "aborted");
|
|
336
|
+
function qe(e, t) {
|
|
342
337
|
return t.map((n) => {
|
|
343
338
|
var o;
|
|
344
339
|
return (o = n).path ?? (o.path = []), n.path.unshift(e), n;
|
|
345
340
|
});
|
|
346
341
|
}
|
|
347
|
-
|
|
348
|
-
function
|
|
342
|
+
a(qe, "prefixIssues");
|
|
343
|
+
function K(e) {
|
|
349
344
|
return typeof e == "string" ? e : e?.message;
|
|
350
345
|
}
|
|
351
|
-
|
|
352
|
-
function
|
|
346
|
+
a(K, "unwrapMessage");
|
|
347
|
+
function C(e, t, n) {
|
|
353
348
|
const o = { ...e, path: e.path ?? [] };
|
|
354
349
|
if (!e.message) {
|
|
355
|
-
const r =
|
|
350
|
+
const r = K(e.inst?._zod.def?.error?.(e)) ?? K(t?.error?.(e)) ?? K(n.customError?.(e)) ?? K(n.localeError?.(e)) ?? "Invalid input";
|
|
356
351
|
o.message = r;
|
|
357
352
|
}
|
|
358
353
|
return delete o.inst, delete o.continue, t?.reportInput || delete o.input, o;
|
|
359
354
|
}
|
|
360
|
-
|
|
361
|
-
function
|
|
355
|
+
a(C, "finalizeIssue");
|
|
356
|
+
function ge(e) {
|
|
362
357
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
363
358
|
}
|
|
364
|
-
|
|
365
|
-
function
|
|
359
|
+
a(ge, "getLengthableOrigin");
|
|
360
|
+
function W(...e) {
|
|
366
361
|
const [t, n, o] = e;
|
|
367
362
|
return typeof t == "string" ? {
|
|
368
363
|
message: t,
|
|
@@ -371,132 +366,132 @@ function q(...e) {
|
|
|
371
366
|
inst: o
|
|
372
367
|
} : { ...t };
|
|
373
368
|
}
|
|
374
|
-
|
|
375
|
-
const
|
|
369
|
+
a(W, "issue");
|
|
370
|
+
const He = /* @__PURE__ */ a((e, t) => {
|
|
376
371
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
377
372
|
value: e._zod,
|
|
378
373
|
enumerable: !1
|
|
379
374
|
}), Object.defineProperty(e, "issues", {
|
|
380
375
|
value: t,
|
|
381
376
|
enumerable: !1
|
|
382
|
-
}), e.message = JSON.stringify(t,
|
|
383
|
-
value: /* @__PURE__ */
|
|
377
|
+
}), e.message = JSON.stringify(t, le, 2), Object.defineProperty(e, "toString", {
|
|
378
|
+
value: /* @__PURE__ */ a(() => e.message, "value"),
|
|
384
379
|
enumerable: !1
|
|
385
380
|
});
|
|
386
|
-
}, "initializer$1"),
|
|
387
|
-
function
|
|
381
|
+
}, "initializer$1"), Qe = u("$ZodError", He), et = u("$ZodError", He, { Parent: Error });
|
|
382
|
+
function Rt(e, t = (n) => n.message) {
|
|
388
383
|
const n = {}, o = [];
|
|
389
384
|
for (const r of e.issues)
|
|
390
385
|
r.path.length > 0 ? (n[r.path[0]] = n[r.path[0]] || [], n[r.path[0]].push(t(r))) : o.push(t(r));
|
|
391
386
|
return { formErrors: o, fieldErrors: n };
|
|
392
387
|
}
|
|
393
|
-
|
|
394
|
-
function
|
|
395
|
-
const n = t || function(
|
|
396
|
-
return
|
|
397
|
-
}, o = { _errors: [] }, r = /* @__PURE__ */
|
|
398
|
-
for (const
|
|
399
|
-
if (
|
|
400
|
-
|
|
401
|
-
else if (
|
|
402
|
-
r({ issues:
|
|
403
|
-
else if (
|
|
404
|
-
r({ issues:
|
|
405
|
-
else if (
|
|
406
|
-
o._errors.push(n(
|
|
388
|
+
a(Rt, "flattenError");
|
|
389
|
+
function Ut(e, t) {
|
|
390
|
+
const n = t || function(c) {
|
|
391
|
+
return c.message;
|
|
392
|
+
}, o = { _errors: [] }, r = /* @__PURE__ */ a((c) => {
|
|
393
|
+
for (const i of c.issues)
|
|
394
|
+
if (i.code === "invalid_union" && i.errors.length)
|
|
395
|
+
i.errors.map((s) => r({ issues: s }));
|
|
396
|
+
else if (i.code === "invalid_key")
|
|
397
|
+
r({ issues: i.issues });
|
|
398
|
+
else if (i.code === "invalid_element")
|
|
399
|
+
r({ issues: i.issues });
|
|
400
|
+
else if (i.path.length === 0)
|
|
401
|
+
o._errors.push(n(i));
|
|
407
402
|
else {
|
|
408
|
-
let
|
|
409
|
-
for (;
|
|
410
|
-
const
|
|
411
|
-
|
|
403
|
+
let s = o, p = 0;
|
|
404
|
+
for (; p < i.path.length; ) {
|
|
405
|
+
const h = i.path[p];
|
|
406
|
+
p === i.path.length - 1 ? (s[h] = s[h] || { _errors: [] }, s[h]._errors.push(n(i))) : s[h] = s[h] || { _errors: [] }, s = s[h], p++;
|
|
412
407
|
}
|
|
413
408
|
}
|
|
414
409
|
}, "processError");
|
|
415
410
|
return r(e), o;
|
|
416
411
|
}
|
|
417
|
-
|
|
418
|
-
const
|
|
419
|
-
const
|
|
420
|
-
if (
|
|
421
|
-
throw new
|
|
422
|
-
if (
|
|
423
|
-
const
|
|
424
|
-
throw
|
|
412
|
+
a(Ut, "formatError");
|
|
413
|
+
const be = /* @__PURE__ */ a((e) => (t, n, o, r) => {
|
|
414
|
+
const c = o ? Object.assign(o, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, c);
|
|
415
|
+
if (i instanceof Promise)
|
|
416
|
+
throw new T();
|
|
417
|
+
if (i.issues.length) {
|
|
418
|
+
const s = new (r?.Err ?? e)(i.issues.map((p) => C(p, c, D())));
|
|
419
|
+
throw Ye(s, r?.callee), s;
|
|
425
420
|
}
|
|
426
|
-
return
|
|
427
|
-
}, "_parse"),
|
|
428
|
-
const
|
|
429
|
-
let
|
|
430
|
-
if (
|
|
431
|
-
const
|
|
432
|
-
throw
|
|
421
|
+
return i.value;
|
|
422
|
+
}, "_parse"), ze = /* @__PURE__ */ a((e) => async (t, n, o, r) => {
|
|
423
|
+
const c = o ? Object.assign(o, { async: !0 }) : { async: !0 };
|
|
424
|
+
let i = t._zod.run({ value: n, issues: [] }, c);
|
|
425
|
+
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
426
|
+
const s = new (r?.Err ?? e)(i.issues.map((p) => C(p, c, D())));
|
|
427
|
+
throw Ye(s, r?.callee), s;
|
|
433
428
|
}
|
|
434
|
-
return
|
|
435
|
-
}, "_parseAsync"),
|
|
436
|
-
const r = o ? { ...o, async: !1 } : { async: !1 },
|
|
437
|
-
if (
|
|
438
|
-
throw new
|
|
439
|
-
return
|
|
429
|
+
return i.value;
|
|
430
|
+
}, "_parseAsync"), ce = /* @__PURE__ */ a((e) => (t, n, o) => {
|
|
431
|
+
const r = o ? { ...o, async: !1 } : { async: !1 }, c = t._zod.run({ value: n, issues: [] }, r);
|
|
432
|
+
if (c instanceof Promise)
|
|
433
|
+
throw new T();
|
|
434
|
+
return c.issues.length ? {
|
|
440
435
|
success: !1,
|
|
441
|
-
error: new (e ??
|
|
442
|
-
} : { success: !0, data:
|
|
443
|
-
}, "_safeParse"),
|
|
436
|
+
error: new (e ?? Qe)(c.issues.map((i) => C(i, r, D())))
|
|
437
|
+
} : { success: !0, data: c.value };
|
|
438
|
+
}, "_safeParse"), Lt = /* @__PURE__ */ ce(et), ae = /* @__PURE__ */ a((e) => async (t, n, o) => {
|
|
444
439
|
const r = o ? Object.assign(o, { async: !0 }) : { async: !0 };
|
|
445
|
-
let
|
|
446
|
-
return
|
|
440
|
+
let c = t._zod.run({ value: n, issues: [] }, r);
|
|
441
|
+
return c instanceof Promise && (c = await c), c.issues.length ? {
|
|
447
442
|
success: !1,
|
|
448
|
-
error: new e(
|
|
449
|
-
} : { success: !0, data:
|
|
450
|
-
}, "_safeParseAsync"),
|
|
443
|
+
error: new e(c.issues.map((i) => C(i, r, D())))
|
|
444
|
+
} : { success: !0, data: c.value };
|
|
445
|
+
}, "_safeParseAsync"), Mt = /* @__PURE__ */ ae(et), Vt = /* @__PURE__ */ a((e) => (t, n, o) => {
|
|
451
446
|
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
452
|
-
return
|
|
453
|
-
}, "_encode"),
|
|
447
|
+
return be(e)(t, n, r);
|
|
448
|
+
}, "_encode"), Bt = /* @__PURE__ */ a((e) => (t, n, o) => be(e)(t, n, o), "_decode"), Wt = /* @__PURE__ */ a((e) => async (t, n, o) => {
|
|
454
449
|
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
455
|
-
return
|
|
456
|
-
}, "_encodeAsync"),
|
|
450
|
+
return ze(e)(t, n, r);
|
|
451
|
+
}, "_encodeAsync"), Gt = /* @__PURE__ */ a((e) => async (t, n, o) => ze(e)(t, n, o), "_decodeAsync"), Jt = /* @__PURE__ */ a((e) => (t, n, o) => {
|
|
457
452
|
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
458
|
-
return
|
|
459
|
-
}, "_safeEncode"),
|
|
453
|
+
return ce(e)(t, n, r);
|
|
454
|
+
}, "_safeEncode"), Kt = /* @__PURE__ */ a((e) => (t, n, o) => ce(e)(t, n, o), "_safeDecode"), Yt = /* @__PURE__ */ a((e) => async (t, n, o) => {
|
|
460
455
|
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
461
|
-
return
|
|
462
|
-
}, "_safeEncodeAsync"),
|
|
463
|
-
function
|
|
464
|
-
return new RegExp(
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
const
|
|
468
|
-
function
|
|
456
|
+
return ae(e)(t, n, r);
|
|
457
|
+
}, "_safeEncodeAsync"), Xt = /* @__PURE__ */ a((e) => async (t, n, o) => ae(e)(t, n, o), "_safeDecodeAsync"), qt = /^[cC][^\s-]{8,}$/, Ht = /^[0-9a-z]+$/, Qt = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, en = /^[0-9a-vA-V]{20}$/, tn = /^[A-Za-z0-9]{27}$/, nn = /^[a-zA-Z0-9_-]{21}$/, on = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, rn = /^([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})$/, Se = /* @__PURE__ */ a((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)$/, "uuid"), cn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, an = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
458
|
+
function un() {
|
|
459
|
+
return new RegExp(an, "u");
|
|
460
|
+
}
|
|
461
|
+
a(un, "emoji");
|
|
462
|
+
const sn = /^(?:(?: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])$/, ln = /^(([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}|:))$/, pn = /^((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])$/, dn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, hn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, tt = /^[A-Za-z0-9_-]*$/, fn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, mn = /^\+(?:[0-9]){6,14}[0-9]$/, nt = "(?:(?:\\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])))", _n = /* @__PURE__ */ new RegExp(`^${nt}$`);
|
|
463
|
+
function ot(e) {
|
|
469
464
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
470
465
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
471
466
|
}
|
|
472
|
-
|
|
473
|
-
function
|
|
474
|
-
return new RegExp(`^${
|
|
467
|
+
a(ot, "timeSource");
|
|
468
|
+
function vn(e) {
|
|
469
|
+
return new RegExp(`^${ot(e)}$`);
|
|
475
470
|
}
|
|
476
|
-
|
|
477
|
-
function
|
|
478
|
-
const t =
|
|
471
|
+
a(vn, "time$1");
|
|
472
|
+
function gn(e) {
|
|
473
|
+
const t = ot({ precision: e.precision }), n = ["Z"];
|
|
479
474
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
480
475
|
const o = `${t}(?:${n.join("|")})`;
|
|
481
|
-
return new RegExp(`^${
|
|
476
|
+
return new RegExp(`^${nt}T(?:${o})$`);
|
|
482
477
|
}
|
|
483
|
-
|
|
484
|
-
const
|
|
478
|
+
a(gn, "datetime$1");
|
|
479
|
+
const bn = /* @__PURE__ */ a((e) => {
|
|
485
480
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
486
481
|
return new RegExp(`^${t}$`);
|
|
487
|
-
}, "string$1"),
|
|
482
|
+
}, "string$1"), zn = /^-?\d+$/, wn = /^-?\d+(?:\.\d+)?/, kn = /^(?:true|false)$/i, Zn = /^[^A-Z]*$/, $n = /^[^a-z]*$/, A = /* @__PURE__ */ u("$ZodCheck", (e, t) => {
|
|
488
483
|
var n;
|
|
489
484
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
490
|
-
}),
|
|
485
|
+
}), rt = {
|
|
491
486
|
number: "number",
|
|
492
487
|
bigint: "bigint",
|
|
493
488
|
object: "date"
|
|
494
|
-
},
|
|
489
|
+
}, it = /* @__PURE__ */ u("$ZodCheckLessThan", (e, t) => {
|
|
495
490
|
A.init(e, t);
|
|
496
|
-
const n =
|
|
491
|
+
const n = rt[typeof t.value];
|
|
497
492
|
e._zod.onattach.push((o) => {
|
|
498
|
-
const r = o._zod.bag,
|
|
499
|
-
t.value <
|
|
493
|
+
const r = o._zod.bag, c = (t.inclusive ? r.maximum : r.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
494
|
+
t.value < c && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = t.value);
|
|
500
495
|
}), e._zod.check = (o) => {
|
|
501
496
|
(t.inclusive ? o.value <= t.value : o.value < t.value) || o.issues.push({
|
|
502
497
|
origin: n,
|
|
@@ -508,12 +503,12 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
508
503
|
continue: !t.abort
|
|
509
504
|
});
|
|
510
505
|
};
|
|
511
|
-
}),
|
|
506
|
+
}), ct = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, t) => {
|
|
512
507
|
A.init(e, t);
|
|
513
|
-
const n =
|
|
508
|
+
const n = rt[typeof t.value];
|
|
514
509
|
e._zod.onattach.push((o) => {
|
|
515
|
-
const r = o._zod.bag,
|
|
516
|
-
t.value >
|
|
510
|
+
const r = o._zod.bag, c = (t.inclusive ? r.minimum : r.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
511
|
+
t.value > c && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = t.value);
|
|
517
512
|
}), e._zod.check = (o) => {
|
|
518
513
|
(t.inclusive ? o.value >= t.value : o.value > t.value) || o.issues.push({
|
|
519
514
|
origin: n,
|
|
@@ -525,14 +520,14 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
525
520
|
continue: !t.abort
|
|
526
521
|
});
|
|
527
522
|
};
|
|
528
|
-
}),
|
|
523
|
+
}), yn = /* @__PURE__ */ u("$ZodCheckMultipleOf", (e, t) => {
|
|
529
524
|
A.init(e, t), e._zod.onattach.push((n) => {
|
|
530
525
|
var o;
|
|
531
526
|
(o = n._zod.bag).multipleOf ?? (o.multipleOf = t.value);
|
|
532
527
|
}), e._zod.check = (n) => {
|
|
533
528
|
if (typeof n.value != typeof t.value)
|
|
534
529
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
535
|
-
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) :
|
|
530
|
+
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : At(n.value, t.value) === 0) || n.issues.push({
|
|
536
531
|
origin: typeof n.value,
|
|
537
532
|
code: "not_multiple_of",
|
|
538
533
|
divisor: t.value,
|
|
@@ -541,37 +536,37 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
541
536
|
continue: !t.abort
|
|
542
537
|
});
|
|
543
538
|
};
|
|
544
|
-
}),
|
|
539
|
+
}), In = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, t) => {
|
|
545
540
|
A.init(e, t), t.format = t.format || "float64";
|
|
546
|
-
const n = t.format?.includes("int"), o = n ? "int" : "number", [r,
|
|
547
|
-
e._zod.onattach.push((
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
}), e._zod.check = (
|
|
551
|
-
const
|
|
541
|
+
const n = t.format?.includes("int"), o = n ? "int" : "number", [r, c] = Pt[t.format];
|
|
542
|
+
e._zod.onattach.push((i) => {
|
|
543
|
+
const s = i._zod.bag;
|
|
544
|
+
s.format = t.format, s.minimum = r, s.maximum = c, n && (s.pattern = zn);
|
|
545
|
+
}), e._zod.check = (i) => {
|
|
546
|
+
const s = i.value;
|
|
552
547
|
if (n) {
|
|
553
|
-
if (!Number.isInteger(
|
|
554
|
-
|
|
548
|
+
if (!Number.isInteger(s)) {
|
|
549
|
+
i.issues.push({
|
|
555
550
|
expected: o,
|
|
556
551
|
format: t.format,
|
|
557
552
|
code: "invalid_type",
|
|
558
553
|
continue: !1,
|
|
559
|
-
input:
|
|
554
|
+
input: s,
|
|
560
555
|
inst: e
|
|
561
556
|
});
|
|
562
557
|
return;
|
|
563
558
|
}
|
|
564
|
-
if (!Number.isSafeInteger(
|
|
565
|
-
|
|
566
|
-
input:
|
|
559
|
+
if (!Number.isSafeInteger(s)) {
|
|
560
|
+
s > 0 ? i.issues.push({
|
|
561
|
+
input: s,
|
|
567
562
|
code: "too_big",
|
|
568
563
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
569
564
|
note: "Integers must be within the safe integer range.",
|
|
570
565
|
inst: e,
|
|
571
566
|
origin: o,
|
|
572
567
|
continue: !t.abort
|
|
573
|
-
}) :
|
|
574
|
-
input:
|
|
568
|
+
}) : i.issues.push({
|
|
569
|
+
input: s,
|
|
575
570
|
code: "too_small",
|
|
576
571
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
577
572
|
note: "Integers must be within the safe integer range.",
|
|
@@ -582,27 +577,27 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
582
577
|
return;
|
|
583
578
|
}
|
|
584
579
|
}
|
|
585
|
-
|
|
580
|
+
s < r && i.issues.push({
|
|
586
581
|
origin: "number",
|
|
587
|
-
input:
|
|
582
|
+
input: s,
|
|
588
583
|
code: "too_small",
|
|
589
584
|
minimum: r,
|
|
590
585
|
inclusive: !0,
|
|
591
586
|
inst: e,
|
|
592
587
|
continue: !t.abort
|
|
593
|
-
}),
|
|
588
|
+
}), s > c && i.issues.push({
|
|
594
589
|
origin: "number",
|
|
595
|
-
input:
|
|
590
|
+
input: s,
|
|
596
591
|
code: "too_big",
|
|
597
|
-
maximum:
|
|
592
|
+
maximum: c,
|
|
598
593
|
inst: e
|
|
599
594
|
});
|
|
600
595
|
};
|
|
601
|
-
}),
|
|
596
|
+
}), An = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, t) => {
|
|
602
597
|
var n;
|
|
603
598
|
A.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
604
599
|
const r = o.value;
|
|
605
|
-
return !
|
|
600
|
+
return !_e(r) && r.length !== void 0;
|
|
606
601
|
}), e._zod.onattach.push((o) => {
|
|
607
602
|
const r = o._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
608
603
|
t.maximum < r && (o._zod.bag.maximum = t.maximum);
|
|
@@ -610,9 +605,9 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
610
605
|
const r = o.value;
|
|
611
606
|
if (r.length <= t.maximum)
|
|
612
607
|
return;
|
|
613
|
-
const
|
|
608
|
+
const i = ge(r);
|
|
614
609
|
o.issues.push({
|
|
615
|
-
origin:
|
|
610
|
+
origin: i,
|
|
616
611
|
code: "too_big",
|
|
617
612
|
maximum: t.maximum,
|
|
618
613
|
inclusive: !0,
|
|
@@ -621,11 +616,11 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
621
616
|
continue: !t.abort
|
|
622
617
|
});
|
|
623
618
|
};
|
|
624
|
-
}),
|
|
619
|
+
}), En = /* @__PURE__ */ u("$ZodCheckMinLength", (e, t) => {
|
|
625
620
|
var n;
|
|
626
621
|
A.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
627
622
|
const r = o.value;
|
|
628
|
-
return !
|
|
623
|
+
return !_e(r) && r.length !== void 0;
|
|
629
624
|
}), e._zod.onattach.push((o) => {
|
|
630
625
|
const r = o._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
631
626
|
t.minimum > r && (o._zod.bag.minimum = t.minimum);
|
|
@@ -633,9 +628,9 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
633
628
|
const r = o.value;
|
|
634
629
|
if (r.length >= t.minimum)
|
|
635
630
|
return;
|
|
636
|
-
const
|
|
631
|
+
const i = ge(r);
|
|
637
632
|
o.issues.push({
|
|
638
|
-
origin:
|
|
633
|
+
origin: i,
|
|
639
634
|
code: "too_small",
|
|
640
635
|
minimum: t.minimum,
|
|
641
636
|
inclusive: !0,
|
|
@@ -644,22 +639,22 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
644
639
|
continue: !t.abort
|
|
645
640
|
});
|
|
646
641
|
};
|
|
647
|
-
}),
|
|
642
|
+
}), Sn = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, t) => {
|
|
648
643
|
var n;
|
|
649
644
|
A.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
650
645
|
const r = o.value;
|
|
651
|
-
return !
|
|
646
|
+
return !_e(r) && r.length !== void 0;
|
|
652
647
|
}), e._zod.onattach.push((o) => {
|
|
653
648
|
const r = o._zod.bag;
|
|
654
649
|
r.minimum = t.length, r.maximum = t.length, r.length = t.length;
|
|
655
650
|
}), e._zod.check = (o) => {
|
|
656
|
-
const r = o.value,
|
|
657
|
-
if (
|
|
651
|
+
const r = o.value, c = r.length;
|
|
652
|
+
if (c === t.length)
|
|
658
653
|
return;
|
|
659
|
-
const
|
|
654
|
+
const i = ge(r), s = c > t.length;
|
|
660
655
|
o.issues.push({
|
|
661
|
-
origin:
|
|
662
|
-
...
|
|
656
|
+
origin: i,
|
|
657
|
+
...s ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
663
658
|
inclusive: !0,
|
|
664
659
|
exact: !0,
|
|
665
660
|
input: o.value,
|
|
@@ -667,11 +662,11 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
667
662
|
continue: !t.abort
|
|
668
663
|
});
|
|
669
664
|
};
|
|
670
|
-
}),
|
|
665
|
+
}), ue = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, t) => {
|
|
671
666
|
var n, o;
|
|
672
667
|
A.init(e, t), e._zod.onattach.push((r) => {
|
|
673
|
-
const
|
|
674
|
-
|
|
668
|
+
const c = r._zod.bag;
|
|
669
|
+
c.format = t.format, t.pattern && (c.patterns ?? (c.patterns = /* @__PURE__ */ new Set()), c.patterns.add(t.pattern));
|
|
675
670
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (r) => {
|
|
676
671
|
t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
|
|
677
672
|
origin: "string",
|
|
@@ -684,8 +679,8 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
684
679
|
});
|
|
685
680
|
}) : (o = e._zod).check ?? (o.check = () => {
|
|
686
681
|
});
|
|
687
|
-
}),
|
|
688
|
-
|
|
682
|
+
}), On = /* @__PURE__ */ u("$ZodCheckRegex", (e, t) => {
|
|
683
|
+
ue.init(e, t), e._zod.check = (n) => {
|
|
689
684
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
690
685
|
origin: "string",
|
|
691
686
|
code: "invalid_format",
|
|
@@ -696,16 +691,16 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
696
691
|
continue: !t.abort
|
|
697
692
|
});
|
|
698
693
|
};
|
|
699
|
-
}),
|
|
700
|
-
t.pattern ?? (t.pattern =
|
|
701
|
-
}),
|
|
702
|
-
t.pattern ?? (t.pattern =
|
|
703
|
-
}),
|
|
694
|
+
}), Pn = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
|
|
695
|
+
t.pattern ?? (t.pattern = Zn), ue.init(e, t);
|
|
696
|
+
}), Tn = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
|
|
697
|
+
t.pattern ?? (t.pattern = $n), ue.init(e, t);
|
|
698
|
+
}), xn = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
|
|
704
699
|
A.init(e, t);
|
|
705
|
-
const n =
|
|
700
|
+
const n = L(t.includes), o = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
706
701
|
t.pattern = o, e._zod.onattach.push((r) => {
|
|
707
|
-
const
|
|
708
|
-
|
|
702
|
+
const c = r._zod.bag;
|
|
703
|
+
c.patterns ?? (c.patterns = /* @__PURE__ */ new Set()), c.patterns.add(o);
|
|
709
704
|
}), e._zod.check = (r) => {
|
|
710
705
|
r.value.includes(t.includes, t.position) || r.issues.push({
|
|
711
706
|
origin: "string",
|
|
@@ -717,9 +712,9 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
717
712
|
continue: !t.abort
|
|
718
713
|
});
|
|
719
714
|
};
|
|
720
|
-
}),
|
|
715
|
+
}), Nn = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, t) => {
|
|
721
716
|
A.init(e, t);
|
|
722
|
-
const n = new RegExp(`^${
|
|
717
|
+
const n = new RegExp(`^${L(t.prefix)}.*`);
|
|
723
718
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
|
|
724
719
|
const r = o._zod.bag;
|
|
725
720
|
r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(n);
|
|
@@ -734,9 +729,9 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
734
729
|
continue: !t.abort
|
|
735
730
|
});
|
|
736
731
|
};
|
|
737
|
-
}),
|
|
732
|
+
}), jn = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, t) => {
|
|
738
733
|
A.init(e, t);
|
|
739
|
-
const n = new RegExp(`.*${
|
|
734
|
+
const n = new RegExp(`.*${L(t.suffix)}$`);
|
|
740
735
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
|
|
741
736
|
const r = o._zod.bag;
|
|
742
737
|
r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(n);
|
|
@@ -751,11 +746,11 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
751
746
|
continue: !t.abort
|
|
752
747
|
});
|
|
753
748
|
};
|
|
754
|
-
}),
|
|
749
|
+
}), Dn = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, t) => {
|
|
755
750
|
A.init(e, t), e._zod.check = (n) => {
|
|
756
751
|
n.value = t.tx(n.value);
|
|
757
752
|
};
|
|
758
|
-
}),
|
|
753
|
+
}), $e = class $e {
|
|
759
754
|
constructor(t = []) {
|
|
760
755
|
this.content = [], this.indent = 0, this && (this.args = t);
|
|
761
756
|
}
|
|
@@ -768,98 +763,98 @@ const Ln = /* @__PURE__ */ s((e) => {
|
|
|
768
763
|
return;
|
|
769
764
|
}
|
|
770
765
|
const o = t.split(`
|
|
771
|
-
`).filter((
|
|
772
|
-
for (const
|
|
773
|
-
this.content.push(
|
|
766
|
+
`).filter((i) => i), r = Math.min(...o.map((i) => i.length - i.trimStart().length)), c = o.map((i) => i.slice(r)).map((i) => " ".repeat(this.indent * 2) + i);
|
|
767
|
+
for (const i of c)
|
|
768
|
+
this.content.push(i);
|
|
774
769
|
}
|
|
775
770
|
compile() {
|
|
776
|
-
const t = Function, n = this?.args, r = [...(this?.content ?? [""]).map((
|
|
771
|
+
const t = Function, n = this?.args, r = [...(this?.content ?? [""]).map((c) => ` ${c}`)];
|
|
777
772
|
return new t(...n, r.join(`
|
|
778
773
|
`));
|
|
779
774
|
}
|
|
780
775
|
};
|
|
781
|
-
|
|
782
|
-
let
|
|
783
|
-
const
|
|
776
|
+
a($e, "Doc");
|
|
777
|
+
let pe = $e;
|
|
778
|
+
const Cn = {
|
|
784
779
|
major: 4,
|
|
785
780
|
minor: 1,
|
|
786
781
|
patch: 11
|
|
787
|
-
},
|
|
782
|
+
}, _ = /* @__PURE__ */ u("$ZodType", (e, t) => {
|
|
788
783
|
var n;
|
|
789
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
784
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Cn;
|
|
790
785
|
const o = [...e._zod.def.checks ?? []];
|
|
791
786
|
e._zod.traits.has("$ZodCheck") && o.unshift(e);
|
|
792
787
|
for (const r of o)
|
|
793
|
-
for (const
|
|
794
|
-
|
|
788
|
+
for (const c of r._zod.onattach)
|
|
789
|
+
c(e);
|
|
795
790
|
if (o.length === 0)
|
|
796
791
|
(n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
|
|
797
792
|
e._zod.run = e._zod.parse;
|
|
798
793
|
});
|
|
799
794
|
else {
|
|
800
|
-
const r = /* @__PURE__ */
|
|
801
|
-
let
|
|
802
|
-
for (const
|
|
803
|
-
if (
|
|
804
|
-
if (!
|
|
795
|
+
const r = /* @__PURE__ */ a((i, s, p) => {
|
|
796
|
+
let h = U(i), f;
|
|
797
|
+
for (const w of s) {
|
|
798
|
+
if (w._zod.def.when) {
|
|
799
|
+
if (!w._zod.def.when(i))
|
|
805
800
|
continue;
|
|
806
|
-
} else if (
|
|
801
|
+
} else if (h)
|
|
807
802
|
continue;
|
|
808
|
-
const
|
|
809
|
-
if ($ instanceof Promise &&
|
|
810
|
-
throw new
|
|
803
|
+
const z = i.issues.length, $ = w._zod.check(i);
|
|
804
|
+
if ($ instanceof Promise && p?.async === !1)
|
|
805
|
+
throw new T();
|
|
811
806
|
if (f || $ instanceof Promise)
|
|
812
807
|
f = (f ?? Promise.resolve()).then(async () => {
|
|
813
|
-
await $,
|
|
808
|
+
await $, i.issues.length !== z && (h || (h = U(i, z)));
|
|
814
809
|
});
|
|
815
810
|
else {
|
|
816
|
-
if (
|
|
811
|
+
if (i.issues.length === z)
|
|
817
812
|
continue;
|
|
818
|
-
|
|
813
|
+
h || (h = U(i, z));
|
|
819
814
|
}
|
|
820
815
|
}
|
|
821
|
-
return f ? f.then(() =>
|
|
822
|
-
}, "runChecks"),
|
|
823
|
-
if (
|
|
824
|
-
return
|
|
825
|
-
const
|
|
826
|
-
if (
|
|
827
|
-
if (
|
|
828
|
-
throw new
|
|
829
|
-
return
|
|
816
|
+
return f ? f.then(() => i) : i;
|
|
817
|
+
}, "runChecks"), c = /* @__PURE__ */ a((i, s, p) => {
|
|
818
|
+
if (U(i))
|
|
819
|
+
return i.aborted = !0, i;
|
|
820
|
+
const h = r(s, o, p);
|
|
821
|
+
if (h instanceof Promise) {
|
|
822
|
+
if (p.async === !1)
|
|
823
|
+
throw new T();
|
|
824
|
+
return h.then((f) => e._zod.parse(f, p));
|
|
830
825
|
}
|
|
831
|
-
return e._zod.parse(
|
|
826
|
+
return e._zod.parse(h, p);
|
|
832
827
|
}, "handleCanaryResult");
|
|
833
|
-
e._zod.run = (
|
|
834
|
-
if (
|
|
835
|
-
return e._zod.parse(
|
|
836
|
-
if (
|
|
837
|
-
const
|
|
838
|
-
return
|
|
828
|
+
e._zod.run = (i, s) => {
|
|
829
|
+
if (s.skipChecks)
|
|
830
|
+
return e._zod.parse(i, s);
|
|
831
|
+
if (s.direction === "backward") {
|
|
832
|
+
const h = e._zod.parse({ value: i.value, issues: [] }, { ...s, skipChecks: !0 });
|
|
833
|
+
return h instanceof Promise ? h.then((f) => c(f, i, s)) : c(h, i, s);
|
|
839
834
|
}
|
|
840
|
-
const
|
|
841
|
-
if (
|
|
842
|
-
if (
|
|
843
|
-
throw new
|
|
844
|
-
return
|
|
835
|
+
const p = e._zod.parse(i, s);
|
|
836
|
+
if (p instanceof Promise) {
|
|
837
|
+
if (s.async === !1)
|
|
838
|
+
throw new T();
|
|
839
|
+
return p.then((h) => r(h, o, s));
|
|
845
840
|
}
|
|
846
|
-
return r(
|
|
841
|
+
return r(p, o, s);
|
|
847
842
|
};
|
|
848
843
|
}
|
|
849
844
|
e["~standard"] = {
|
|
850
|
-
validate: /* @__PURE__ */
|
|
845
|
+
validate: /* @__PURE__ */ a((r) => {
|
|
851
846
|
try {
|
|
852
|
-
const
|
|
853
|
-
return
|
|
847
|
+
const c = Lt(e, r);
|
|
848
|
+
return c.success ? { value: c.data } : { issues: c.error?.issues };
|
|
854
849
|
} catch {
|
|
855
|
-
return
|
|
850
|
+
return Mt(e, r).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
856
851
|
}
|
|
857
852
|
}, "validate"),
|
|
858
853
|
vendor: "zod",
|
|
859
854
|
version: 1
|
|
860
855
|
};
|
|
861
|
-
}),
|
|
862
|
-
|
|
856
|
+
}), we = /* @__PURE__ */ u("$ZodString", (e, t) => {
|
|
857
|
+
_.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? bn(e._zod.bag), e._zod.parse = (n, o) => {
|
|
863
858
|
if (t.coerce)
|
|
864
859
|
try {
|
|
865
860
|
n.value = String(n.value);
|
|
@@ -872,11 +867,11 @@ const io = {
|
|
|
872
867
|
inst: e
|
|
873
868
|
}), n;
|
|
874
869
|
};
|
|
875
|
-
}), v = /* @__PURE__ */
|
|
876
|
-
|
|
877
|
-
}),
|
|
878
|
-
t.pattern ?? (t.pattern =
|
|
879
|
-
}),
|
|
870
|
+
}), v = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
|
|
871
|
+
ue.init(e, t), we.init(e, t);
|
|
872
|
+
}), Fn = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
|
|
873
|
+
t.pattern ?? (t.pattern = rn), v.init(e, t);
|
|
874
|
+
}), Rn = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
|
|
880
875
|
if (t.version) {
|
|
881
876
|
const o = {
|
|
882
877
|
v1: 1,
|
|
@@ -890,13 +885,13 @@ const io = {
|
|
|
890
885
|
}[t.version];
|
|
891
886
|
if (o === void 0)
|
|
892
887
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
893
|
-
t.pattern ?? (t.pattern =
|
|
888
|
+
t.pattern ?? (t.pattern = Se(o));
|
|
894
889
|
} else
|
|
895
|
-
t.pattern ?? (t.pattern =
|
|
890
|
+
t.pattern ?? (t.pattern = Se());
|
|
896
891
|
v.init(e, t);
|
|
897
|
-
}),
|
|
898
|
-
t.pattern ?? (t.pattern =
|
|
899
|
-
}),
|
|
892
|
+
}), Un = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
|
|
893
|
+
t.pattern ?? (t.pattern = cn), v.init(e, t);
|
|
894
|
+
}), Ln = /* @__PURE__ */ u("$ZodURL", (e, t) => {
|
|
900
895
|
v.init(e, t), e._zod.check = (n) => {
|
|
901
896
|
try {
|
|
902
897
|
const o = n.value.trim(), r = new URL(o);
|
|
@@ -904,7 +899,7 @@ const io = {
|
|
|
904
899
|
code: "invalid_format",
|
|
905
900
|
format: "url",
|
|
906
901
|
note: "Invalid hostname",
|
|
907
|
-
pattern:
|
|
902
|
+
pattern: fn.source,
|
|
908
903
|
input: n.value,
|
|
909
904
|
inst: e,
|
|
910
905
|
continue: !t.abort
|
|
@@ -928,35 +923,35 @@ const io = {
|
|
|
928
923
|
});
|
|
929
924
|
}
|
|
930
925
|
};
|
|
931
|
-
}),
|
|
932
|
-
t.pattern ?? (t.pattern =
|
|
933
|
-
}),
|
|
934
|
-
t.pattern ?? (t.pattern =
|
|
935
|
-
}),
|
|
936
|
-
t.pattern ?? (t.pattern =
|
|
937
|
-
}),
|
|
938
|
-
t.pattern ?? (t.pattern =
|
|
939
|
-
}),
|
|
940
|
-
t.pattern ?? (t.pattern =
|
|
941
|
-
}),
|
|
942
|
-
t.pattern ?? (t.pattern =
|
|
943
|
-
}),
|
|
944
|
-
t.pattern ?? (t.pattern =
|
|
945
|
-
}),
|
|
946
|
-
t.pattern ?? (t.pattern =
|
|
947
|
-
}),
|
|
948
|
-
t.pattern ?? (t.pattern =
|
|
949
|
-
}),
|
|
950
|
-
t.pattern ?? (t.pattern =
|
|
951
|
-
}),
|
|
952
|
-
t.pattern ?? (t.pattern =
|
|
953
|
-
}),
|
|
954
|
-
t.pattern ?? (t.pattern =
|
|
926
|
+
}), Mn = /* @__PURE__ */ u("$ZodEmoji", (e, t) => {
|
|
927
|
+
t.pattern ?? (t.pattern = un()), v.init(e, t);
|
|
928
|
+
}), Vn = /* @__PURE__ */ u("$ZodNanoID", (e, t) => {
|
|
929
|
+
t.pattern ?? (t.pattern = nn), v.init(e, t);
|
|
930
|
+
}), Bn = /* @__PURE__ */ u("$ZodCUID", (e, t) => {
|
|
931
|
+
t.pattern ?? (t.pattern = qt), v.init(e, t);
|
|
932
|
+
}), Wn = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
|
|
933
|
+
t.pattern ?? (t.pattern = Ht), v.init(e, t);
|
|
934
|
+
}), Gn = /* @__PURE__ */ u("$ZodULID", (e, t) => {
|
|
935
|
+
t.pattern ?? (t.pattern = Qt), v.init(e, t);
|
|
936
|
+
}), Jn = /* @__PURE__ */ u("$ZodXID", (e, t) => {
|
|
937
|
+
t.pattern ?? (t.pattern = en), v.init(e, t);
|
|
938
|
+
}), Kn = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
|
|
939
|
+
t.pattern ?? (t.pattern = tn), v.init(e, t);
|
|
940
|
+
}), Yn = /* @__PURE__ */ u("$ZodISODateTime", (e, t) => {
|
|
941
|
+
t.pattern ?? (t.pattern = gn(t)), v.init(e, t);
|
|
942
|
+
}), Xn = /* @__PURE__ */ u("$ZodISODate", (e, t) => {
|
|
943
|
+
t.pattern ?? (t.pattern = _n), v.init(e, t);
|
|
944
|
+
}), qn = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
|
|
945
|
+
t.pattern ?? (t.pattern = vn(t)), v.init(e, t);
|
|
946
|
+
}), Hn = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
|
|
947
|
+
t.pattern ?? (t.pattern = on), v.init(e, t);
|
|
948
|
+
}), Qn = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
|
|
949
|
+
t.pattern ?? (t.pattern = sn), v.init(e, t), e._zod.onattach.push((n) => {
|
|
955
950
|
const o = n._zod.bag;
|
|
956
951
|
o.format = "ipv4";
|
|
957
952
|
});
|
|
958
|
-
}),
|
|
959
|
-
t.pattern ?? (t.pattern =
|
|
953
|
+
}), eo = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
|
|
954
|
+
t.pattern ?? (t.pattern = ln), v.init(e, t), e._zod.onattach.push((n) => {
|
|
960
955
|
const o = n._zod.bag;
|
|
961
956
|
o.format = "ipv6";
|
|
962
957
|
}), e._zod.check = (n) => {
|
|
@@ -972,21 +967,21 @@ const io = {
|
|
|
972
967
|
});
|
|
973
968
|
}
|
|
974
969
|
};
|
|
975
|
-
}),
|
|
976
|
-
t.pattern ?? (t.pattern =
|
|
977
|
-
}),
|
|
978
|
-
t.pattern ?? (t.pattern =
|
|
970
|
+
}), to = /* @__PURE__ */ u("$ZodCIDRv4", (e, t) => {
|
|
971
|
+
t.pattern ?? (t.pattern = pn), v.init(e, t);
|
|
972
|
+
}), no = /* @__PURE__ */ u("$ZodCIDRv6", (e, t) => {
|
|
973
|
+
t.pattern ?? (t.pattern = dn), v.init(e, t), e._zod.check = (n) => {
|
|
979
974
|
const o = n.value.split("/");
|
|
980
975
|
try {
|
|
981
976
|
if (o.length !== 2)
|
|
982
977
|
throw new Error();
|
|
983
|
-
const [r,
|
|
984
|
-
if (!
|
|
978
|
+
const [r, c] = o;
|
|
979
|
+
if (!c)
|
|
985
980
|
throw new Error();
|
|
986
|
-
const
|
|
987
|
-
if (`${
|
|
981
|
+
const i = Number(c);
|
|
982
|
+
if (`${i}` !== c)
|
|
988
983
|
throw new Error();
|
|
989
|
-
if (
|
|
984
|
+
if (i < 0 || i > 128)
|
|
990
985
|
throw new Error();
|
|
991
986
|
new URL(`http://[${r}]`);
|
|
992
987
|
} catch {
|
|
@@ -1000,7 +995,7 @@ const io = {
|
|
|
1000
995
|
}
|
|
1001
996
|
};
|
|
1002
997
|
});
|
|
1003
|
-
function
|
|
998
|
+
function at(e) {
|
|
1004
999
|
if (e === "")
|
|
1005
1000
|
return !0;
|
|
1006
1001
|
if (e.length % 4 !== 0)
|
|
@@ -1011,12 +1006,12 @@ function Zt(e) {
|
|
|
1011
1006
|
return !1;
|
|
1012
1007
|
}
|
|
1013
1008
|
}
|
|
1014
|
-
|
|
1015
|
-
const
|
|
1016
|
-
t.pattern ?? (t.pattern =
|
|
1009
|
+
a(at, "isValidBase64");
|
|
1010
|
+
const oo = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
1011
|
+
t.pattern ?? (t.pattern = hn), v.init(e, t), e._zod.onattach.push((n) => {
|
|
1017
1012
|
n._zod.bag.contentEncoding = "base64";
|
|
1018
1013
|
}), e._zod.check = (n) => {
|
|
1019
|
-
|
|
1014
|
+
at(n.value) || n.issues.push({
|
|
1020
1015
|
code: "invalid_format",
|
|
1021
1016
|
format: "base64",
|
|
1022
1017
|
input: n.value,
|
|
@@ -1025,18 +1020,18 @@ const Io = /* @__PURE__ */ c("$ZodBase64", (e, t) => {
|
|
|
1025
1020
|
});
|
|
1026
1021
|
};
|
|
1027
1022
|
});
|
|
1028
|
-
function
|
|
1029
|
-
if (!
|
|
1023
|
+
function ro(e) {
|
|
1024
|
+
if (!tt.test(e))
|
|
1030
1025
|
return !1;
|
|
1031
1026
|
const t = e.replace(/[-_]/g, (o) => o === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
1032
|
-
return
|
|
1027
|
+
return at(n);
|
|
1033
1028
|
}
|
|
1034
|
-
|
|
1035
|
-
const
|
|
1036
|
-
t.pattern ?? (t.pattern =
|
|
1029
|
+
a(ro, "isValidBase64URL");
|
|
1030
|
+
const io = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
1031
|
+
t.pattern ?? (t.pattern = tt), v.init(e, t), e._zod.onattach.push((n) => {
|
|
1037
1032
|
n._zod.bag.contentEncoding = "base64url";
|
|
1038
1033
|
}), e._zod.check = (n) => {
|
|
1039
|
-
|
|
1034
|
+
ro(n.value) || n.issues.push({
|
|
1040
1035
|
code: "invalid_format",
|
|
1041
1036
|
format: "base64url",
|
|
1042
1037
|
input: n.value,
|
|
@@ -1044,10 +1039,10 @@ const Ao = /* @__PURE__ */ c("$ZodBase64URL", (e, t) => {
|
|
|
1044
1039
|
continue: !t.abort
|
|
1045
1040
|
});
|
|
1046
1041
|
};
|
|
1047
|
-
}),
|
|
1048
|
-
t.pattern ?? (t.pattern =
|
|
1042
|
+
}), co = /* @__PURE__ */ u("$ZodE164", (e, t) => {
|
|
1043
|
+
t.pattern ?? (t.pattern = mn), v.init(e, t);
|
|
1049
1044
|
});
|
|
1050
|
-
function
|
|
1045
|
+
function ao(e, t = null) {
|
|
1051
1046
|
try {
|
|
1052
1047
|
const n = e.split(".");
|
|
1053
1048
|
if (n.length !== 3)
|
|
@@ -1061,10 +1056,10 @@ function To(e, t = null) {
|
|
|
1061
1056
|
return !1;
|
|
1062
1057
|
}
|
|
1063
1058
|
}
|
|
1064
|
-
|
|
1065
|
-
const
|
|
1059
|
+
a(ao, "isValidJWT");
|
|
1060
|
+
const uo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
1066
1061
|
v.init(e, t), e._zod.check = (n) => {
|
|
1067
|
-
|
|
1062
|
+
ao(n.value, t.alg) || n.issues.push({
|
|
1068
1063
|
code: "invalid_format",
|
|
1069
1064
|
format: "jwt",
|
|
1070
1065
|
input: n.value,
|
|
@@ -1072,8 +1067,8 @@ const jo = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
|
|
|
1072
1067
|
continue: !t.abort
|
|
1073
1068
|
});
|
|
1074
1069
|
};
|
|
1075
|
-
}),
|
|
1076
|
-
|
|
1070
|
+
}), ut = /* @__PURE__ */ u("$ZodNumber", (e, t) => {
|
|
1071
|
+
_.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? wn, e._zod.parse = (n, o) => {
|
|
1077
1072
|
if (t.coerce)
|
|
1078
1073
|
try {
|
|
1079
1074
|
n.value = Number(n.value);
|
|
@@ -1082,19 +1077,19 @@ const jo = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
|
|
|
1082
1077
|
const r = n.value;
|
|
1083
1078
|
if (typeof r == "number" && !Number.isNaN(r) && Number.isFinite(r))
|
|
1084
1079
|
return n;
|
|
1085
|
-
const
|
|
1080
|
+
const c = typeof r == "number" ? Number.isNaN(r) ? "NaN" : Number.isFinite(r) ? void 0 : "Infinity" : void 0;
|
|
1086
1081
|
return n.issues.push({
|
|
1087
1082
|
expected: "number",
|
|
1088
1083
|
code: "invalid_type",
|
|
1089
1084
|
input: r,
|
|
1090
1085
|
inst: e,
|
|
1091
|
-
...
|
|
1086
|
+
...c ? { received: c } : {}
|
|
1092
1087
|
}), n;
|
|
1093
1088
|
};
|
|
1094
|
-
}),
|
|
1095
|
-
|
|
1096
|
-
}),
|
|
1097
|
-
|
|
1089
|
+
}), so = /* @__PURE__ */ u("$ZodNumber", (e, t) => {
|
|
1090
|
+
In.init(e, t), ut.init(e, t);
|
|
1091
|
+
}), lo = /* @__PURE__ */ u("$ZodBoolean", (e, t) => {
|
|
1092
|
+
_.init(e, t), e._zod.pattern = kn, e._zod.parse = (n, o) => {
|
|
1098
1093
|
if (t.coerce)
|
|
1099
1094
|
try {
|
|
1100
1095
|
n.value = !!n.value;
|
|
@@ -1108,40 +1103,40 @@ const jo = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
|
|
|
1108
1103
|
inst: e
|
|
1109
1104
|
}), n;
|
|
1110
1105
|
};
|
|
1111
|
-
}),
|
|
1112
|
-
|
|
1113
|
-
}),
|
|
1114
|
-
|
|
1115
|
-
}),
|
|
1116
|
-
|
|
1106
|
+
}), po = /* @__PURE__ */ u("$ZodAny", (e, t) => {
|
|
1107
|
+
_.init(e, t), e._zod.parse = (n) => n;
|
|
1108
|
+
}), ho = /* @__PURE__ */ u("$ZodUnknown", (e, t) => {
|
|
1109
|
+
_.init(e, t), e._zod.parse = (n) => n;
|
|
1110
|
+
}), fo = /* @__PURE__ */ u("$ZodNever", (e, t) => {
|
|
1111
|
+
_.init(e, t), e._zod.parse = (n, o) => (n.issues.push({
|
|
1117
1112
|
expected: "never",
|
|
1118
1113
|
code: "invalid_type",
|
|
1119
1114
|
input: n.value,
|
|
1120
1115
|
inst: e
|
|
1121
1116
|
}), n);
|
|
1122
|
-
}),
|
|
1123
|
-
|
|
1117
|
+
}), mo = /* @__PURE__ */ u("$ZodDate", (e, t) => {
|
|
1118
|
+
_.init(e, t), e._zod.parse = (n, o) => {
|
|
1124
1119
|
if (t.coerce)
|
|
1125
1120
|
try {
|
|
1126
1121
|
n.value = new Date(n.value);
|
|
1127
1122
|
} catch {
|
|
1128
1123
|
}
|
|
1129
|
-
const r = n.value,
|
|
1130
|
-
return
|
|
1124
|
+
const r = n.value, c = r instanceof Date;
|
|
1125
|
+
return c && !Number.isNaN(r.getTime()) || n.issues.push({
|
|
1131
1126
|
expected: "date",
|
|
1132
1127
|
code: "invalid_type",
|
|
1133
1128
|
input: r,
|
|
1134
|
-
...
|
|
1129
|
+
...c ? { received: "Invalid Date" } : {},
|
|
1135
1130
|
inst: e
|
|
1136
1131
|
}), n;
|
|
1137
1132
|
};
|
|
1138
1133
|
});
|
|
1139
|
-
function
|
|
1140
|
-
e.issues.length && t.issues.push(...
|
|
1134
|
+
function Oe(e, t, n) {
|
|
1135
|
+
e.issues.length && t.issues.push(...qe(n, e.issues)), t.value[n] = e.value;
|
|
1141
1136
|
}
|
|
1142
|
-
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1137
|
+
a(Oe, "handleArrayResult");
|
|
1138
|
+
const _o = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
1139
|
+
_.init(e, t), e._zod.parse = (n, o) => {
|
|
1145
1140
|
const r = n.value;
|
|
1146
1141
|
if (!Array.isArray(r))
|
|
1147
1142
|
return n.issues.push({
|
|
@@ -1151,27 +1146,27 @@ const Do = /* @__PURE__ */ c("$ZodArray", (e, t) => {
|
|
|
1151
1146
|
inst: e
|
|
1152
1147
|
}), n;
|
|
1153
1148
|
n.value = Array(r.length);
|
|
1154
|
-
const
|
|
1155
|
-
for (let
|
|
1156
|
-
const
|
|
1157
|
-
value:
|
|
1149
|
+
const c = [];
|
|
1150
|
+
for (let i = 0; i < r.length; i++) {
|
|
1151
|
+
const s = r[i], p = t.element._zod.run({
|
|
1152
|
+
value: s,
|
|
1158
1153
|
issues: []
|
|
1159
1154
|
}, o);
|
|
1160
|
-
|
|
1155
|
+
p instanceof Promise ? c.push(p.then((h) => Oe(h, n, i))) : Oe(p, n, i);
|
|
1161
1156
|
}
|
|
1162
|
-
return
|
|
1157
|
+
return c.length ? Promise.all(c).then(() => n) : n;
|
|
1163
1158
|
};
|
|
1164
1159
|
});
|
|
1165
|
-
function
|
|
1166
|
-
e.issues.length && t.issues.push(...
|
|
1160
|
+
function te(e, t, n, o) {
|
|
1161
|
+
e.issues.length && t.issues.push(...qe(n, e.issues)), e.value === void 0 ? n in o && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1167
1162
|
}
|
|
1168
|
-
|
|
1169
|
-
function
|
|
1163
|
+
a(te, "handlePropertyResult");
|
|
1164
|
+
function st(e) {
|
|
1170
1165
|
const t = Object.keys(e.shape);
|
|
1171
1166
|
for (const o of t)
|
|
1172
1167
|
if (!e.shape?.[o]?._zod?.traits?.has("$ZodType"))
|
|
1173
1168
|
throw new Error(`Invalid element at key "${o}": expected a Zod schema`);
|
|
1174
|
-
const n =
|
|
1169
|
+
const n = Ot(e.shape);
|
|
1175
1170
|
return {
|
|
1176
1171
|
...e,
|
|
1177
1172
|
keys: t,
|
|
@@ -1180,240 +1175,240 @@ function St(e) {
|
|
|
1180
1175
|
optionalKeys: new Set(n)
|
|
1181
1176
|
};
|
|
1182
1177
|
}
|
|
1183
|
-
|
|
1184
|
-
function
|
|
1185
|
-
const
|
|
1178
|
+
a(st, "normalizeDef");
|
|
1179
|
+
function lt(e, t, n, o, r, c) {
|
|
1180
|
+
const i = [], s = r.keySet, p = r.catchall._zod, h = p.def.type;
|
|
1186
1181
|
for (const f of Object.keys(t)) {
|
|
1187
|
-
if (
|
|
1182
|
+
if (s.has(f))
|
|
1188
1183
|
continue;
|
|
1189
|
-
if (
|
|
1190
|
-
|
|
1184
|
+
if (h === "never") {
|
|
1185
|
+
i.push(f);
|
|
1191
1186
|
continue;
|
|
1192
1187
|
}
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1188
|
+
const w = p.run({ value: t[f], issues: [] }, o);
|
|
1189
|
+
w instanceof Promise ? e.push(w.then((z) => te(z, n, f, t))) : te(w, n, f, t);
|
|
1195
1190
|
}
|
|
1196
|
-
return
|
|
1191
|
+
return i.length && n.issues.push({
|
|
1197
1192
|
code: "unrecognized_keys",
|
|
1198
|
-
keys:
|
|
1193
|
+
keys: i,
|
|
1199
1194
|
input: t,
|
|
1200
|
-
inst:
|
|
1195
|
+
inst: c
|
|
1201
1196
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1202
1197
|
}
|
|
1203
|
-
|
|
1204
|
-
const
|
|
1205
|
-
if (
|
|
1206
|
-
const
|
|
1198
|
+
a(lt, "handleCatchall");
|
|
1199
|
+
const vo = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
1200
|
+
if (_.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1201
|
+
const s = t.shape;
|
|
1207
1202
|
Object.defineProperty(t, "shape", {
|
|
1208
|
-
get: /* @__PURE__ */
|
|
1209
|
-
const
|
|
1203
|
+
get: /* @__PURE__ */ a(() => {
|
|
1204
|
+
const p = { ...s };
|
|
1210
1205
|
return Object.defineProperty(t, "shape", {
|
|
1211
|
-
value:
|
|
1212
|
-
}),
|
|
1206
|
+
value: p
|
|
1207
|
+
}), p;
|
|
1213
1208
|
}, "get")
|
|
1214
1209
|
});
|
|
1215
1210
|
}
|
|
1216
|
-
const o =
|
|
1211
|
+
const o = ie(() => st(t));
|
|
1217
1212
|
m(e._zod, "propValues", () => {
|
|
1218
|
-
const
|
|
1219
|
-
for (const
|
|
1220
|
-
const f =
|
|
1213
|
+
const s = t.shape, p = {};
|
|
1214
|
+
for (const h in s) {
|
|
1215
|
+
const f = s[h]._zod;
|
|
1221
1216
|
if (f.values) {
|
|
1222
|
-
|
|
1223
|
-
for (const
|
|
1224
|
-
|
|
1217
|
+
p[h] ?? (p[h] = /* @__PURE__ */ new Set());
|
|
1218
|
+
for (const w of f.values)
|
|
1219
|
+
p[h].add(w);
|
|
1225
1220
|
}
|
|
1226
1221
|
}
|
|
1227
|
-
return
|
|
1228
|
-
});
|
|
1229
|
-
const r =
|
|
1230
|
-
let
|
|
1231
|
-
e._zod.parse = (
|
|
1232
|
-
|
|
1233
|
-
const
|
|
1234
|
-
if (!r(
|
|
1235
|
-
return
|
|
1222
|
+
return p;
|
|
1223
|
+
});
|
|
1224
|
+
const r = V, c = t.catchall;
|
|
1225
|
+
let i;
|
|
1226
|
+
e._zod.parse = (s, p) => {
|
|
1227
|
+
i ?? (i = o.value);
|
|
1228
|
+
const h = s.value;
|
|
1229
|
+
if (!r(h))
|
|
1230
|
+
return s.issues.push({
|
|
1236
1231
|
expected: "object",
|
|
1237
1232
|
code: "invalid_type",
|
|
1238
|
-
input:
|
|
1233
|
+
input: h,
|
|
1239
1234
|
inst: e
|
|
1240
|
-
}),
|
|
1241
|
-
|
|
1242
|
-
const f = [],
|
|
1243
|
-
for (const
|
|
1244
|
-
const E =
|
|
1245
|
-
E instanceof Promise ? f.push(E.then((
|
|
1235
|
+
}), s;
|
|
1236
|
+
s.value = {};
|
|
1237
|
+
const f = [], w = i.shape;
|
|
1238
|
+
for (const z of i.keys) {
|
|
1239
|
+
const E = w[z]._zod.run({ value: h[z], issues: [] }, p);
|
|
1240
|
+
E instanceof Promise ? f.push(E.then((se) => te(se, s, z, h))) : te(E, s, z, h);
|
|
1246
1241
|
}
|
|
1247
|
-
return
|
|
1242
|
+
return c ? lt(f, h, s, p, o.value, e) : f.length ? Promise.all(f).then(() => s) : s;
|
|
1248
1243
|
};
|
|
1249
|
-
}),
|
|
1250
|
-
|
|
1251
|
-
const n = e._zod.parse, o =
|
|
1252
|
-
const $ = new
|
|
1253
|
-
const
|
|
1254
|
-
return `shape[${
|
|
1244
|
+
}), go = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
|
|
1245
|
+
vo.init(e, t);
|
|
1246
|
+
const n = e._zod.parse, o = ie(() => st(t)), r = /* @__PURE__ */ a((z) => {
|
|
1247
|
+
const $ = new pe(["shape", "payload", "ctx"]), E = o.value, se = /* @__PURE__ */ a((P) => {
|
|
1248
|
+
const O = Ee(P);
|
|
1249
|
+
return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
|
|
1255
1250
|
}, "parseStr");
|
|
1256
1251
|
$.write("const input = payload.value;");
|
|
1257
|
-
const
|
|
1258
|
-
let
|
|
1259
|
-
for (const
|
|
1260
|
-
|
|
1252
|
+
const Ie = /* @__PURE__ */ Object.create(null);
|
|
1253
|
+
let Zt = 0;
|
|
1254
|
+
for (const P of E.keys)
|
|
1255
|
+
Ie[P] = `key_${Zt++}`;
|
|
1261
1256
|
$.write("const newResult = {};");
|
|
1262
|
-
for (const
|
|
1263
|
-
const
|
|
1264
|
-
$.write(`const ${
|
|
1265
|
-
if (${
|
|
1266
|
-
payload.issues = payload.issues.concat(${
|
|
1257
|
+
for (const P of E.keys) {
|
|
1258
|
+
const O = Ie[P], M = Ee(P);
|
|
1259
|
+
$.write(`const ${O} = ${se(P)};`), $.write(`
|
|
1260
|
+
if (${O}.issues.length) {
|
|
1261
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
1267
1262
|
...iss,
|
|
1268
|
-
path: iss.path ? [${
|
|
1263
|
+
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
1269
1264
|
})));
|
|
1270
1265
|
}
|
|
1271
1266
|
|
|
1272
1267
|
|
|
1273
|
-
if (${
|
|
1274
|
-
if (${
|
|
1275
|
-
newResult[${
|
|
1268
|
+
if (${O}.value === undefined) {
|
|
1269
|
+
if (${M} in input) {
|
|
1270
|
+
newResult[${M}] = undefined;
|
|
1276
1271
|
}
|
|
1277
1272
|
} else {
|
|
1278
|
-
newResult[${
|
|
1273
|
+
newResult[${M}] = ${O}.value;
|
|
1279
1274
|
}
|
|
1280
1275
|
|
|
1281
1276
|
`);
|
|
1282
1277
|
}
|
|
1283
1278
|
$.write("payload.value = newResult;"), $.write("return payload;");
|
|
1284
|
-
const
|
|
1285
|
-
return (
|
|
1279
|
+
const $t = $.compile();
|
|
1280
|
+
return (P, O) => $t(z, P, O);
|
|
1286
1281
|
}, "generateFastpass");
|
|
1287
|
-
let
|
|
1288
|
-
const
|
|
1289
|
-
let
|
|
1290
|
-
e._zod.parse = (
|
|
1291
|
-
|
|
1292
|
-
const E =
|
|
1293
|
-
return
|
|
1282
|
+
let c;
|
|
1283
|
+
const i = V, s = !Ke.jitless, h = s && Et.value, f = t.catchall;
|
|
1284
|
+
let w;
|
|
1285
|
+
e._zod.parse = (z, $) => {
|
|
1286
|
+
w ?? (w = o.value);
|
|
1287
|
+
const E = z.value;
|
|
1288
|
+
return i(E) ? s && h && $?.async === !1 && $.jitless !== !0 ? (c || (c = r(t.shape)), z = c(z, $), f ? lt([], E, z, $, w, e) : z) : n(z, $) : (z.issues.push({
|
|
1294
1289
|
expected: "object",
|
|
1295
1290
|
code: "invalid_type",
|
|
1296
1291
|
input: E,
|
|
1297
1292
|
inst: e
|
|
1298
|
-
}),
|
|
1293
|
+
}), z);
|
|
1299
1294
|
};
|
|
1300
1295
|
});
|
|
1301
|
-
function
|
|
1302
|
-
for (const
|
|
1303
|
-
if (
|
|
1304
|
-
return t.value =
|
|
1305
|
-
const r = e.filter((
|
|
1296
|
+
function Pe(e, t, n, o) {
|
|
1297
|
+
for (const c of e)
|
|
1298
|
+
if (c.issues.length === 0)
|
|
1299
|
+
return t.value = c.value, t;
|
|
1300
|
+
const r = e.filter((c) => !U(c));
|
|
1306
1301
|
return r.length === 1 ? (t.value = r[0].value, r[0]) : (t.issues.push({
|
|
1307
1302
|
code: "invalid_union",
|
|
1308
1303
|
input: t.value,
|
|
1309
1304
|
inst: n,
|
|
1310
|
-
errors: e.map((
|
|
1305
|
+
errors: e.map((c) => c.issues.map((i) => C(i, o, D())))
|
|
1311
1306
|
}), t);
|
|
1312
1307
|
}
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1308
|
+
a(Pe, "handleUnionResults");
|
|
1309
|
+
const pt = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
1310
|
+
_.init(e, t), m(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), m(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), m(e._zod, "values", () => {
|
|
1316
1311
|
if (t.options.every((r) => r._zod.values))
|
|
1317
1312
|
return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
|
|
1318
1313
|
}), m(e._zod, "pattern", () => {
|
|
1319
1314
|
if (t.options.every((r) => r._zod.pattern)) {
|
|
1320
|
-
const r = t.options.map((
|
|
1321
|
-
return new RegExp(`^(${r.map((
|
|
1315
|
+
const r = t.options.map((c) => c._zod.pattern);
|
|
1316
|
+
return new RegExp(`^(${r.map((c) => ve(c.source)).join("|")})$`);
|
|
1322
1317
|
}
|
|
1323
1318
|
});
|
|
1324
1319
|
const n = t.options.length === 1, o = t.options[0]._zod.run;
|
|
1325
|
-
e._zod.parse = (r,
|
|
1320
|
+
e._zod.parse = (r, c) => {
|
|
1326
1321
|
if (n)
|
|
1327
|
-
return o(r,
|
|
1328
|
-
let
|
|
1329
|
-
const
|
|
1330
|
-
for (const
|
|
1331
|
-
const
|
|
1322
|
+
return o(r, c);
|
|
1323
|
+
let i = !1;
|
|
1324
|
+
const s = [];
|
|
1325
|
+
for (const p of t.options) {
|
|
1326
|
+
const h = p._zod.run({
|
|
1332
1327
|
value: r.value,
|
|
1333
1328
|
issues: []
|
|
1334
|
-
},
|
|
1335
|
-
if (
|
|
1336
|
-
|
|
1329
|
+
}, c);
|
|
1330
|
+
if (h instanceof Promise)
|
|
1331
|
+
s.push(h), i = !0;
|
|
1337
1332
|
else {
|
|
1338
|
-
if (
|
|
1339
|
-
return
|
|
1340
|
-
|
|
1333
|
+
if (h.issues.length === 0)
|
|
1334
|
+
return h;
|
|
1335
|
+
s.push(h);
|
|
1341
1336
|
}
|
|
1342
1337
|
}
|
|
1343
|
-
return
|
|
1338
|
+
return i ? Promise.all(s).then((p) => Pe(p, r, e, c)) : Pe(s, r, e, c);
|
|
1344
1339
|
};
|
|
1345
|
-
}),
|
|
1346
|
-
|
|
1340
|
+
}), bo = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (e, t) => {
|
|
1341
|
+
pt.init(e, t);
|
|
1347
1342
|
const n = e._zod.parse;
|
|
1348
1343
|
m(e._zod, "propValues", () => {
|
|
1349
1344
|
const r = {};
|
|
1350
|
-
for (const
|
|
1351
|
-
const
|
|
1352
|
-
if (!
|
|
1353
|
-
throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(
|
|
1354
|
-
for (const [
|
|
1355
|
-
r[
|
|
1356
|
-
for (const
|
|
1357
|
-
r[
|
|
1345
|
+
for (const c of t.options) {
|
|
1346
|
+
const i = c._zod.propValues;
|
|
1347
|
+
if (!i || Object.keys(i).length === 0)
|
|
1348
|
+
throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);
|
|
1349
|
+
for (const [s, p] of Object.entries(i)) {
|
|
1350
|
+
r[s] || (r[s] = /* @__PURE__ */ new Set());
|
|
1351
|
+
for (const h of p)
|
|
1352
|
+
r[s].add(h);
|
|
1358
1353
|
}
|
|
1359
1354
|
}
|
|
1360
1355
|
return r;
|
|
1361
1356
|
});
|
|
1362
|
-
const o =
|
|
1363
|
-
const r = t.options,
|
|
1364
|
-
for (const
|
|
1365
|
-
const
|
|
1366
|
-
if (!
|
|
1367
|
-
throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(
|
|
1368
|
-
for (const
|
|
1369
|
-
if (
|
|
1370
|
-
throw new Error(`Duplicate discriminator value "${String(
|
|
1371
|
-
|
|
1357
|
+
const o = ie(() => {
|
|
1358
|
+
const r = t.options, c = /* @__PURE__ */ new Map();
|
|
1359
|
+
for (const i of r) {
|
|
1360
|
+
const s = i._zod.propValues?.[t.discriminator];
|
|
1361
|
+
if (!s || s.size === 0)
|
|
1362
|
+
throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);
|
|
1363
|
+
for (const p of s) {
|
|
1364
|
+
if (c.has(p))
|
|
1365
|
+
throw new Error(`Duplicate discriminator value "${String(p)}"`);
|
|
1366
|
+
c.set(p, i);
|
|
1372
1367
|
}
|
|
1373
1368
|
}
|
|
1374
|
-
return
|
|
1369
|
+
return c;
|
|
1375
1370
|
});
|
|
1376
|
-
e._zod.parse = (r,
|
|
1377
|
-
const
|
|
1378
|
-
if (!
|
|
1371
|
+
e._zod.parse = (r, c) => {
|
|
1372
|
+
const i = r.value;
|
|
1373
|
+
if (!V(i))
|
|
1379
1374
|
return r.issues.push({
|
|
1380
1375
|
code: "invalid_type",
|
|
1381
1376
|
expected: "object",
|
|
1382
|
-
input:
|
|
1377
|
+
input: i,
|
|
1383
1378
|
inst: e
|
|
1384
1379
|
}), r;
|
|
1385
|
-
const
|
|
1386
|
-
return
|
|
1380
|
+
const s = o.value.get(i?.[t.discriminator]);
|
|
1381
|
+
return s ? s._zod.run(r, c) : t.unionFallback ? n(r, c) : (r.issues.push({
|
|
1387
1382
|
code: "invalid_union",
|
|
1388
1383
|
errors: [],
|
|
1389
1384
|
note: "No matching discriminator",
|
|
1390
1385
|
discriminator: t.discriminator,
|
|
1391
|
-
input:
|
|
1386
|
+
input: i,
|
|
1392
1387
|
path: [t.discriminator],
|
|
1393
1388
|
inst: e
|
|
1394
1389
|
}), r);
|
|
1395
1390
|
};
|
|
1396
|
-
}),
|
|
1397
|
-
|
|
1398
|
-
const r = n.value,
|
|
1399
|
-
return
|
|
1391
|
+
}), zo = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
|
|
1392
|
+
_.init(e, t), e._zod.parse = (n, o) => {
|
|
1393
|
+
const r = n.value, c = t.left._zod.run({ value: r, issues: [] }, o), i = t.right._zod.run({ value: r, issues: [] }, o);
|
|
1394
|
+
return c instanceof Promise || i instanceof Promise ? Promise.all([c, i]).then(([p, h]) => Te(n, p, h)) : Te(n, c, i);
|
|
1400
1395
|
};
|
|
1401
1396
|
});
|
|
1402
|
-
function
|
|
1397
|
+
function de(e, t) {
|
|
1403
1398
|
if (e === t)
|
|
1404
1399
|
return { valid: !0, data: e };
|
|
1405
1400
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
1406
1401
|
return { valid: !0, data: e };
|
|
1407
|
-
if (
|
|
1408
|
-
const n = Object.keys(t), o = Object.keys(e).filter((
|
|
1409
|
-
for (const
|
|
1410
|
-
const
|
|
1411
|
-
if (!
|
|
1402
|
+
if (B(e) && B(t)) {
|
|
1403
|
+
const n = Object.keys(t), o = Object.keys(e).filter((c) => n.indexOf(c) !== -1), r = { ...e, ...t };
|
|
1404
|
+
for (const c of o) {
|
|
1405
|
+
const i = de(e[c], t[c]);
|
|
1406
|
+
if (!i.valid)
|
|
1412
1407
|
return {
|
|
1413
1408
|
valid: !1,
|
|
1414
|
-
mergeErrorPath: [
|
|
1409
|
+
mergeErrorPath: [c, ...i.mergeErrorPath]
|
|
1415
1410
|
};
|
|
1416
|
-
r[
|
|
1411
|
+
r[c] = i.data;
|
|
1417
1412
|
}
|
|
1418
1413
|
return { valid: !0, data: r };
|
|
1419
1414
|
}
|
|
@@ -1422,44 +1417,44 @@ function be(e, t) {
|
|
|
1422
1417
|
return { valid: !1, mergeErrorPath: [] };
|
|
1423
1418
|
const n = [];
|
|
1424
1419
|
for (let o = 0; o < e.length; o++) {
|
|
1425
|
-
const r = e[o],
|
|
1426
|
-
if (!
|
|
1420
|
+
const r = e[o], c = t[o], i = de(r, c);
|
|
1421
|
+
if (!i.valid)
|
|
1427
1422
|
return {
|
|
1428
1423
|
valid: !1,
|
|
1429
|
-
mergeErrorPath: [o, ...
|
|
1424
|
+
mergeErrorPath: [o, ...i.mergeErrorPath]
|
|
1430
1425
|
};
|
|
1431
|
-
n.push(
|
|
1426
|
+
n.push(i.data);
|
|
1432
1427
|
}
|
|
1433
1428
|
return { valid: !0, data: n };
|
|
1434
1429
|
}
|
|
1435
1430
|
return { valid: !1, mergeErrorPath: [] };
|
|
1436
1431
|
}
|
|
1437
|
-
|
|
1438
|
-
function
|
|
1439
|
-
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues),
|
|
1432
|
+
a(de, "mergeValues");
|
|
1433
|
+
function Te(e, t, n) {
|
|
1434
|
+
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), U(e))
|
|
1440
1435
|
return e;
|
|
1441
|
-
const o =
|
|
1436
|
+
const o = de(t.value, n.value);
|
|
1442
1437
|
if (!o.valid)
|
|
1443
1438
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
|
|
1444
1439
|
return e.value = o.data, e;
|
|
1445
1440
|
}
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1449
|
-
const n =
|
|
1450
|
-
e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((r) =>
|
|
1451
|
-
const
|
|
1452
|
-
return o.has(
|
|
1441
|
+
a(Te, "handleIntersectionResults");
|
|
1442
|
+
const wo = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
1443
|
+
_.init(e, t);
|
|
1444
|
+
const n = It(t.entries), o = new Set(n);
|
|
1445
|
+
e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((r) => St.has(typeof r)).map((r) => typeof r == "string" ? L(r) : r.toString()).join("|")})$`), e._zod.parse = (r, c) => {
|
|
1446
|
+
const i = r.value;
|
|
1447
|
+
return o.has(i) || r.issues.push({
|
|
1453
1448
|
code: "invalid_value",
|
|
1454
1449
|
values: n,
|
|
1455
|
-
input:
|
|
1450
|
+
input: i,
|
|
1456
1451
|
inst: e
|
|
1457
1452
|
}), r;
|
|
1458
1453
|
};
|
|
1459
|
-
}),
|
|
1460
|
-
if (
|
|
1454
|
+
}), ko = /* @__PURE__ */ u("$ZodLiteral", (e, t) => {
|
|
1455
|
+
if (_.init(e, t), t.values.length === 0)
|
|
1461
1456
|
throw new Error("Cannot create literal schema with no valid values");
|
|
1462
|
-
e._zod.values = new Set(t.values), e._zod.pattern = new RegExp(`^(${t.values.map((n) => typeof n == "string" ?
|
|
1457
|
+
e._zod.values = new Set(t.values), e._zod.pattern = new RegExp(`^(${t.values.map((n) => typeof n == "string" ? L(n) : n ? L(n.toString()) : String(n)).join("|")})$`), e._zod.parse = (n, o) => {
|
|
1463
1458
|
const r = n.value;
|
|
1464
1459
|
return e._zod.values.has(r) || n.issues.push({
|
|
1465
1460
|
code: "invalid_value",
|
|
@@ -1468,64 +1463,64 @@ const Vo = /* @__PURE__ */ c("$ZodEnum", (e, t) => {
|
|
|
1468
1463
|
inst: e
|
|
1469
1464
|
}), n;
|
|
1470
1465
|
};
|
|
1471
|
-
}),
|
|
1472
|
-
|
|
1466
|
+
}), Zo = /* @__PURE__ */ u("$ZodTransform", (e, t) => {
|
|
1467
|
+
_.init(e, t), e._zod.parse = (n, o) => {
|
|
1473
1468
|
if (o.direction === "backward")
|
|
1474
|
-
throw new
|
|
1469
|
+
throw new ee(e.constructor.name);
|
|
1475
1470
|
const r = t.transform(n.value, n);
|
|
1476
1471
|
if (o.async)
|
|
1477
|
-
return (r instanceof Promise ? r : Promise.resolve(r)).then((
|
|
1472
|
+
return (r instanceof Promise ? r : Promise.resolve(r)).then((i) => (n.value = i, n));
|
|
1478
1473
|
if (r instanceof Promise)
|
|
1479
|
-
throw new
|
|
1474
|
+
throw new T();
|
|
1480
1475
|
return n.value = r, n;
|
|
1481
1476
|
};
|
|
1482
1477
|
});
|
|
1483
|
-
function
|
|
1478
|
+
function xe(e, t) {
|
|
1484
1479
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1485
1480
|
}
|
|
1486
|
-
|
|
1487
|
-
const
|
|
1488
|
-
|
|
1481
|
+
a(xe, "handleOptionalResult");
|
|
1482
|
+
const $o = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
1483
|
+
_.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", m(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), m(e._zod, "pattern", () => {
|
|
1489
1484
|
const n = t.innerType._zod.pattern;
|
|
1490
|
-
return n ? new RegExp(`^(${
|
|
1485
|
+
return n ? new RegExp(`^(${ve(n.source)})?$`) : void 0;
|
|
1491
1486
|
}), e._zod.parse = (n, o) => {
|
|
1492
1487
|
if (t.innerType._zod.optin === "optional") {
|
|
1493
1488
|
const r = t.innerType._zod.run(n, o);
|
|
1494
|
-
return r instanceof Promise ? r.then((
|
|
1489
|
+
return r instanceof Promise ? r.then((c) => xe(c, n.value)) : xe(r, n.value);
|
|
1495
1490
|
}
|
|
1496
1491
|
return n.value === void 0 ? n : t.innerType._zod.run(n, o);
|
|
1497
1492
|
};
|
|
1498
|
-
}),
|
|
1499
|
-
|
|
1493
|
+
}), yo = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
|
|
1494
|
+
_.init(e, t), m(e._zod, "optin", () => t.innerType._zod.optin), m(e._zod, "optout", () => t.innerType._zod.optout), m(e._zod, "pattern", () => {
|
|
1500
1495
|
const n = t.innerType._zod.pattern;
|
|
1501
|
-
return n ? new RegExp(`^(${
|
|
1496
|
+
return n ? new RegExp(`^(${ve(n.source)}|null)$`) : void 0;
|
|
1502
1497
|
}), m(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, o) => n.value === null ? n : t.innerType._zod.run(n, o);
|
|
1503
|
-
}),
|
|
1504
|
-
|
|
1498
|
+
}), Io = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
|
|
1499
|
+
_.init(e, t), e._zod.optin = "optional", m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
|
|
1505
1500
|
if (o.direction === "backward")
|
|
1506
1501
|
return t.innerType._zod.run(n, o);
|
|
1507
1502
|
if (n.value === void 0)
|
|
1508
1503
|
return n.value = t.defaultValue, n;
|
|
1509
1504
|
const r = t.innerType._zod.run(n, o);
|
|
1510
|
-
return r instanceof Promise ? r.then((
|
|
1505
|
+
return r instanceof Promise ? r.then((c) => Ne(c, t)) : Ne(r, t);
|
|
1511
1506
|
};
|
|
1512
1507
|
});
|
|
1513
|
-
function
|
|
1508
|
+
function Ne(e, t) {
|
|
1514
1509
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1515
1510
|
}
|
|
1516
|
-
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1519
|
-
}),
|
|
1520
|
-
|
|
1511
|
+
a(Ne, "handleDefaultResult");
|
|
1512
|
+
const Ao = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
|
|
1513
|
+
_.init(e, t), e._zod.optin = "optional", m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => (o.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, o));
|
|
1514
|
+
}), Eo = /* @__PURE__ */ u("$ZodNonOptional", (e, t) => {
|
|
1515
|
+
_.init(e, t), m(e._zod, "values", () => {
|
|
1521
1516
|
const n = t.innerType._zod.values;
|
|
1522
1517
|
return n ? new Set([...n].filter((o) => o !== void 0)) : void 0;
|
|
1523
1518
|
}), e._zod.parse = (n, o) => {
|
|
1524
1519
|
const r = t.innerType._zod.run(n, o);
|
|
1525
|
-
return r instanceof Promise ? r.then((
|
|
1520
|
+
return r instanceof Promise ? r.then((c) => je(c, e)) : je(r, e);
|
|
1526
1521
|
};
|
|
1527
1522
|
});
|
|
1528
|
-
function
|
|
1523
|
+
function je(e, t) {
|
|
1529
1524
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1530
1525
|
code: "invalid_type",
|
|
1531
1526
|
expected: "nonoptional",
|
|
@@ -1533,61 +1528,61 @@ function He(e, t) {
|
|
|
1533
1528
|
inst: t
|
|
1534
1529
|
}), e;
|
|
1535
1530
|
}
|
|
1536
|
-
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1531
|
+
a(je, "handleNonOptionalResult");
|
|
1532
|
+
const So = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
|
|
1533
|
+
_.init(e, t), m(e._zod, "optin", () => t.innerType._zod.optin), m(e._zod, "optout", () => t.innerType._zod.optout), m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
|
|
1539
1534
|
if (o.direction === "backward")
|
|
1540
1535
|
return t.innerType._zod.run(n, o);
|
|
1541
1536
|
const r = t.innerType._zod.run(n, o);
|
|
1542
|
-
return r instanceof Promise ? r.then((
|
|
1537
|
+
return r instanceof Promise ? r.then((c) => (n.value = c.value, c.issues.length && (n.value = t.catchValue({
|
|
1543
1538
|
...n,
|
|
1544
1539
|
error: {
|
|
1545
|
-
issues:
|
|
1540
|
+
issues: c.issues.map((i) => C(i, o, D()))
|
|
1546
1541
|
},
|
|
1547
1542
|
input: n.value
|
|
1548
1543
|
}), n.issues = []), n)) : (n.value = r.value, r.issues.length && (n.value = t.catchValue({
|
|
1549
1544
|
...n,
|
|
1550
1545
|
error: {
|
|
1551
|
-
issues: r.issues.map((
|
|
1546
|
+
issues: r.issues.map((c) => C(c, o, D()))
|
|
1552
1547
|
},
|
|
1553
1548
|
input: n.value
|
|
1554
1549
|
}), n.issues = []), n);
|
|
1555
1550
|
};
|
|
1556
|
-
}),
|
|
1557
|
-
|
|
1551
|
+
}), Oo = /* @__PURE__ */ u("$ZodPipe", (e, t) => {
|
|
1552
|
+
_.init(e, t), m(e._zod, "values", () => t.in._zod.values), m(e._zod, "optin", () => t.in._zod.optin), m(e._zod, "optout", () => t.out._zod.optout), m(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, o) => {
|
|
1558
1553
|
if (o.direction === "backward") {
|
|
1559
|
-
const
|
|
1560
|
-
return
|
|
1554
|
+
const c = t.out._zod.run(n, o);
|
|
1555
|
+
return c instanceof Promise ? c.then((i) => Y(i, t.in, o)) : Y(c, t.in, o);
|
|
1561
1556
|
}
|
|
1562
1557
|
const r = t.in._zod.run(n, o);
|
|
1563
|
-
return r instanceof Promise ? r.then((
|
|
1558
|
+
return r instanceof Promise ? r.then((c) => Y(c, t.out, o)) : Y(r, t.out, o);
|
|
1564
1559
|
};
|
|
1565
1560
|
});
|
|
1566
|
-
function
|
|
1561
|
+
function Y(e, t, n) {
|
|
1567
1562
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
1568
1563
|
}
|
|
1569
|
-
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1564
|
+
a(Y, "handlePipeResult");
|
|
1565
|
+
const Po = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
|
|
1566
|
+
_.init(e, t), m(e._zod, "propValues", () => t.innerType._zod.propValues), m(e._zod, "values", () => t.innerType._zod.values), m(e._zod, "optin", () => t.innerType._zod.optin), m(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (n, o) => {
|
|
1572
1567
|
if (o.direction === "backward")
|
|
1573
1568
|
return t.innerType._zod.run(n, o);
|
|
1574
1569
|
const r = t.innerType._zod.run(n, o);
|
|
1575
|
-
return r instanceof Promise ? r.then(
|
|
1570
|
+
return r instanceof Promise ? r.then(De) : De(r);
|
|
1576
1571
|
};
|
|
1577
1572
|
});
|
|
1578
|
-
function
|
|
1573
|
+
function De(e) {
|
|
1579
1574
|
return e.value = Object.freeze(e.value), e;
|
|
1580
1575
|
}
|
|
1581
|
-
|
|
1582
|
-
const
|
|
1583
|
-
A.init(e, t),
|
|
1576
|
+
a(De, "handleReadonlyResult");
|
|
1577
|
+
const To = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
|
|
1578
|
+
A.init(e, t), _.init(e, t), e._zod.parse = (n, o) => n, e._zod.check = (n) => {
|
|
1584
1579
|
const o = n.value, r = t.fn(o);
|
|
1585
1580
|
if (r instanceof Promise)
|
|
1586
|
-
return r.then((
|
|
1587
|
-
|
|
1581
|
+
return r.then((c) => Ce(c, n, o, e));
|
|
1582
|
+
Ce(r, n, o, e);
|
|
1588
1583
|
};
|
|
1589
1584
|
});
|
|
1590
|
-
function
|
|
1585
|
+
function Ce(e, t, n, o) {
|
|
1591
1586
|
if (!e) {
|
|
1592
1587
|
const r = {
|
|
1593
1588
|
code: "custom",
|
|
@@ -1599,11 +1594,11 @@ function et(e, t, n, o) {
|
|
|
1599
1594
|
continue: !o._zod.def.abort
|
|
1600
1595
|
// params: inst._zod.def.params,
|
|
1601
1596
|
};
|
|
1602
|
-
o._zod.def.params && (r.params = o._zod.def.params), t.issues.push(
|
|
1597
|
+
o._zod.def.params && (r.params = o._zod.def.params), t.issues.push(W(r));
|
|
1603
1598
|
}
|
|
1604
1599
|
}
|
|
1605
|
-
|
|
1606
|
-
const
|
|
1600
|
+
a(Ce, "handleRefineResult");
|
|
1601
|
+
const ye = class ye {
|
|
1607
1602
|
constructor() {
|
|
1608
1603
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1609
1604
|
}
|
|
@@ -1637,244 +1632,244 @@ const Ce = class Ce {
|
|
|
1637
1632
|
return this._map.has(t);
|
|
1638
1633
|
}
|
|
1639
1634
|
};
|
|
1640
|
-
|
|
1641
|
-
let
|
|
1642
|
-
function
|
|
1643
|
-
return new
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
|
-
const
|
|
1647
|
-
function
|
|
1635
|
+
a(ye, "$ZodRegistry");
|
|
1636
|
+
let he = ye;
|
|
1637
|
+
function xo() {
|
|
1638
|
+
return new he();
|
|
1639
|
+
}
|
|
1640
|
+
a(xo, "registry");
|
|
1641
|
+
const X = /* @__PURE__ */ xo();
|
|
1642
|
+
function No(e, t) {
|
|
1648
1643
|
return new e({
|
|
1649
1644
|
type: "string",
|
|
1650
|
-
...
|
|
1645
|
+
...d(t)
|
|
1651
1646
|
});
|
|
1652
1647
|
}
|
|
1653
|
-
|
|
1654
|
-
function
|
|
1648
|
+
a(No, "_string");
|
|
1649
|
+
function jo(e, t) {
|
|
1655
1650
|
return new e({
|
|
1656
1651
|
type: "string",
|
|
1657
1652
|
format: "email",
|
|
1658
1653
|
check: "string_format",
|
|
1659
1654
|
abort: !1,
|
|
1660
|
-
...
|
|
1655
|
+
...d(t)
|
|
1661
1656
|
});
|
|
1662
1657
|
}
|
|
1663
|
-
|
|
1664
|
-
function
|
|
1658
|
+
a(jo, "_email");
|
|
1659
|
+
function Fe(e, t) {
|
|
1665
1660
|
return new e({
|
|
1666
1661
|
type: "string",
|
|
1667
1662
|
format: "guid",
|
|
1668
1663
|
check: "string_format",
|
|
1669
1664
|
abort: !1,
|
|
1670
|
-
...
|
|
1665
|
+
...d(t)
|
|
1671
1666
|
});
|
|
1672
1667
|
}
|
|
1673
|
-
|
|
1674
|
-
function
|
|
1668
|
+
a(Fe, "_guid");
|
|
1669
|
+
function Do(e, t) {
|
|
1675
1670
|
return new e({
|
|
1676
1671
|
type: "string",
|
|
1677
1672
|
format: "uuid",
|
|
1678
1673
|
check: "string_format",
|
|
1679
1674
|
abort: !1,
|
|
1680
|
-
...
|
|
1675
|
+
...d(t)
|
|
1681
1676
|
});
|
|
1682
1677
|
}
|
|
1683
|
-
|
|
1684
|
-
function
|
|
1678
|
+
a(Do, "_uuid");
|
|
1679
|
+
function Co(e, t) {
|
|
1685
1680
|
return new e({
|
|
1686
1681
|
type: "string",
|
|
1687
1682
|
format: "uuid",
|
|
1688
1683
|
check: "string_format",
|
|
1689
1684
|
abort: !1,
|
|
1690
1685
|
version: "v4",
|
|
1691
|
-
...
|
|
1686
|
+
...d(t)
|
|
1692
1687
|
});
|
|
1693
1688
|
}
|
|
1694
|
-
|
|
1695
|
-
function
|
|
1689
|
+
a(Co, "_uuidv4");
|
|
1690
|
+
function Fo(e, t) {
|
|
1696
1691
|
return new e({
|
|
1697
1692
|
type: "string",
|
|
1698
1693
|
format: "uuid",
|
|
1699
1694
|
check: "string_format",
|
|
1700
1695
|
abort: !1,
|
|
1701
1696
|
version: "v6",
|
|
1702
|
-
...
|
|
1697
|
+
...d(t)
|
|
1703
1698
|
});
|
|
1704
1699
|
}
|
|
1705
|
-
|
|
1706
|
-
function
|
|
1700
|
+
a(Fo, "_uuidv6");
|
|
1701
|
+
function Ro(e, t) {
|
|
1707
1702
|
return new e({
|
|
1708
1703
|
type: "string",
|
|
1709
1704
|
format: "uuid",
|
|
1710
1705
|
check: "string_format",
|
|
1711
1706
|
abort: !1,
|
|
1712
1707
|
version: "v7",
|
|
1713
|
-
...
|
|
1708
|
+
...d(t)
|
|
1714
1709
|
});
|
|
1715
1710
|
}
|
|
1716
|
-
|
|
1717
|
-
function
|
|
1711
|
+
a(Ro, "_uuidv7");
|
|
1712
|
+
function Uo(e, t) {
|
|
1718
1713
|
return new e({
|
|
1719
1714
|
type: "string",
|
|
1720
1715
|
format: "url",
|
|
1721
1716
|
check: "string_format",
|
|
1722
1717
|
abort: !1,
|
|
1723
|
-
...
|
|
1718
|
+
...d(t)
|
|
1724
1719
|
});
|
|
1725
1720
|
}
|
|
1726
|
-
|
|
1727
|
-
function
|
|
1721
|
+
a(Uo, "_url");
|
|
1722
|
+
function Lo(e, t) {
|
|
1728
1723
|
return new e({
|
|
1729
1724
|
type: "string",
|
|
1730
1725
|
format: "emoji",
|
|
1731
1726
|
check: "string_format",
|
|
1732
1727
|
abort: !1,
|
|
1733
|
-
...
|
|
1728
|
+
...d(t)
|
|
1734
1729
|
});
|
|
1735
1730
|
}
|
|
1736
|
-
|
|
1737
|
-
function
|
|
1731
|
+
a(Lo, "_emoji");
|
|
1732
|
+
function Mo(e, t) {
|
|
1738
1733
|
return new e({
|
|
1739
1734
|
type: "string",
|
|
1740
1735
|
format: "nanoid",
|
|
1741
1736
|
check: "string_format",
|
|
1742
1737
|
abort: !1,
|
|
1743
|
-
...
|
|
1738
|
+
...d(t)
|
|
1744
1739
|
});
|
|
1745
1740
|
}
|
|
1746
|
-
|
|
1747
|
-
function
|
|
1741
|
+
a(Mo, "_nanoid");
|
|
1742
|
+
function Vo(e, t) {
|
|
1748
1743
|
return new e({
|
|
1749
1744
|
type: "string",
|
|
1750
1745
|
format: "cuid",
|
|
1751
1746
|
check: "string_format",
|
|
1752
1747
|
abort: !1,
|
|
1753
|
-
...
|
|
1748
|
+
...d(t)
|
|
1754
1749
|
});
|
|
1755
1750
|
}
|
|
1756
|
-
|
|
1757
|
-
function
|
|
1751
|
+
a(Vo, "_cuid");
|
|
1752
|
+
function Bo(e, t) {
|
|
1758
1753
|
return new e({
|
|
1759
1754
|
type: "string",
|
|
1760
1755
|
format: "cuid2",
|
|
1761
1756
|
check: "string_format",
|
|
1762
1757
|
abort: !1,
|
|
1763
|
-
...
|
|
1758
|
+
...d(t)
|
|
1764
1759
|
});
|
|
1765
1760
|
}
|
|
1766
|
-
|
|
1767
|
-
function
|
|
1761
|
+
a(Bo, "_cuid2");
|
|
1762
|
+
function Wo(e, t) {
|
|
1768
1763
|
return new e({
|
|
1769
1764
|
type: "string",
|
|
1770
1765
|
format: "ulid",
|
|
1771
1766
|
check: "string_format",
|
|
1772
1767
|
abort: !1,
|
|
1773
|
-
...
|
|
1768
|
+
...d(t)
|
|
1774
1769
|
});
|
|
1775
1770
|
}
|
|
1776
|
-
|
|
1777
|
-
function
|
|
1771
|
+
a(Wo, "_ulid");
|
|
1772
|
+
function Go(e, t) {
|
|
1778
1773
|
return new e({
|
|
1779
1774
|
type: "string",
|
|
1780
1775
|
format: "xid",
|
|
1781
1776
|
check: "string_format",
|
|
1782
1777
|
abort: !1,
|
|
1783
|
-
...
|
|
1778
|
+
...d(t)
|
|
1784
1779
|
});
|
|
1785
1780
|
}
|
|
1786
|
-
|
|
1787
|
-
function
|
|
1781
|
+
a(Go, "_xid");
|
|
1782
|
+
function Jo(e, t) {
|
|
1788
1783
|
return new e({
|
|
1789
1784
|
type: "string",
|
|
1790
1785
|
format: "ksuid",
|
|
1791
1786
|
check: "string_format",
|
|
1792
1787
|
abort: !1,
|
|
1793
|
-
...
|
|
1788
|
+
...d(t)
|
|
1794
1789
|
});
|
|
1795
1790
|
}
|
|
1796
|
-
|
|
1797
|
-
function
|
|
1791
|
+
a(Jo, "_ksuid");
|
|
1792
|
+
function Ko(e, t) {
|
|
1798
1793
|
return new e({
|
|
1799
1794
|
type: "string",
|
|
1800
1795
|
format: "ipv4",
|
|
1801
1796
|
check: "string_format",
|
|
1802
1797
|
abort: !1,
|
|
1803
|
-
...
|
|
1798
|
+
...d(t)
|
|
1804
1799
|
});
|
|
1805
1800
|
}
|
|
1806
|
-
|
|
1807
|
-
function
|
|
1801
|
+
a(Ko, "_ipv4");
|
|
1802
|
+
function Yo(e, t) {
|
|
1808
1803
|
return new e({
|
|
1809
1804
|
type: "string",
|
|
1810
1805
|
format: "ipv6",
|
|
1811
1806
|
check: "string_format",
|
|
1812
1807
|
abort: !1,
|
|
1813
|
-
...
|
|
1808
|
+
...d(t)
|
|
1814
1809
|
});
|
|
1815
1810
|
}
|
|
1816
|
-
|
|
1817
|
-
function
|
|
1811
|
+
a(Yo, "_ipv6");
|
|
1812
|
+
function Xo(e, t) {
|
|
1818
1813
|
return new e({
|
|
1819
1814
|
type: "string",
|
|
1820
1815
|
format: "cidrv4",
|
|
1821
1816
|
check: "string_format",
|
|
1822
1817
|
abort: !1,
|
|
1823
|
-
...
|
|
1818
|
+
...d(t)
|
|
1824
1819
|
});
|
|
1825
1820
|
}
|
|
1826
|
-
|
|
1827
|
-
function
|
|
1821
|
+
a(Xo, "_cidrv4");
|
|
1822
|
+
function qo(e, t) {
|
|
1828
1823
|
return new e({
|
|
1829
1824
|
type: "string",
|
|
1830
1825
|
format: "cidrv6",
|
|
1831
1826
|
check: "string_format",
|
|
1832
1827
|
abort: !1,
|
|
1833
|
-
...
|
|
1828
|
+
...d(t)
|
|
1834
1829
|
});
|
|
1835
1830
|
}
|
|
1836
|
-
|
|
1837
|
-
function
|
|
1831
|
+
a(qo, "_cidrv6");
|
|
1832
|
+
function Ho(e, t) {
|
|
1838
1833
|
return new e({
|
|
1839
1834
|
type: "string",
|
|
1840
1835
|
format: "base64",
|
|
1841
1836
|
check: "string_format",
|
|
1842
1837
|
abort: !1,
|
|
1843
|
-
...
|
|
1838
|
+
...d(t)
|
|
1844
1839
|
});
|
|
1845
1840
|
}
|
|
1846
|
-
|
|
1847
|
-
function
|
|
1841
|
+
a(Ho, "_base64");
|
|
1842
|
+
function Qo(e, t) {
|
|
1848
1843
|
return new e({
|
|
1849
1844
|
type: "string",
|
|
1850
1845
|
format: "base64url",
|
|
1851
1846
|
check: "string_format",
|
|
1852
1847
|
abort: !1,
|
|
1853
|
-
...
|
|
1848
|
+
...d(t)
|
|
1854
1849
|
});
|
|
1855
1850
|
}
|
|
1856
|
-
|
|
1857
|
-
function
|
|
1851
|
+
a(Qo, "_base64url");
|
|
1852
|
+
function er(e, t) {
|
|
1858
1853
|
return new e({
|
|
1859
1854
|
type: "string",
|
|
1860
1855
|
format: "e164",
|
|
1861
1856
|
check: "string_format",
|
|
1862
1857
|
abort: !1,
|
|
1863
|
-
...
|
|
1858
|
+
...d(t)
|
|
1864
1859
|
});
|
|
1865
1860
|
}
|
|
1866
|
-
|
|
1867
|
-
function
|
|
1861
|
+
a(er, "_e164");
|
|
1862
|
+
function tr(e, t) {
|
|
1868
1863
|
return new e({
|
|
1869
1864
|
type: "string",
|
|
1870
1865
|
format: "jwt",
|
|
1871
1866
|
check: "string_format",
|
|
1872
1867
|
abort: !1,
|
|
1873
|
-
...
|
|
1868
|
+
...d(t)
|
|
1874
1869
|
});
|
|
1875
1870
|
}
|
|
1876
|
-
|
|
1877
|
-
function
|
|
1871
|
+
a(tr, "_jwt");
|
|
1872
|
+
function nr(e, t) {
|
|
1878
1873
|
return new e({
|
|
1879
1874
|
type: "string",
|
|
1880
1875
|
format: "datetime",
|
|
@@ -1882,319 +1877,319 @@ function $r(e, t) {
|
|
|
1882
1877
|
offset: !1,
|
|
1883
1878
|
local: !1,
|
|
1884
1879
|
precision: null,
|
|
1885
|
-
...
|
|
1880
|
+
...d(t)
|
|
1886
1881
|
});
|
|
1887
1882
|
}
|
|
1888
|
-
|
|
1889
|
-
function
|
|
1883
|
+
a(nr, "_isoDateTime");
|
|
1884
|
+
function or(e, t) {
|
|
1890
1885
|
return new e({
|
|
1891
1886
|
type: "string",
|
|
1892
1887
|
format: "date",
|
|
1893
1888
|
check: "string_format",
|
|
1894
|
-
...
|
|
1889
|
+
...d(t)
|
|
1895
1890
|
});
|
|
1896
1891
|
}
|
|
1897
|
-
|
|
1898
|
-
function
|
|
1892
|
+
a(or, "_isoDate");
|
|
1893
|
+
function rr(e, t) {
|
|
1899
1894
|
return new e({
|
|
1900
1895
|
type: "string",
|
|
1901
1896
|
format: "time",
|
|
1902
1897
|
check: "string_format",
|
|
1903
1898
|
precision: null,
|
|
1904
|
-
...
|
|
1899
|
+
...d(t)
|
|
1905
1900
|
});
|
|
1906
1901
|
}
|
|
1907
|
-
|
|
1908
|
-
function
|
|
1902
|
+
a(rr, "_isoTime");
|
|
1903
|
+
function ir(e, t) {
|
|
1909
1904
|
return new e({
|
|
1910
1905
|
type: "string",
|
|
1911
1906
|
format: "duration",
|
|
1912
1907
|
check: "string_format",
|
|
1913
|
-
...
|
|
1908
|
+
...d(t)
|
|
1914
1909
|
});
|
|
1915
1910
|
}
|
|
1916
|
-
|
|
1917
|
-
function
|
|
1911
|
+
a(ir, "_isoDuration");
|
|
1912
|
+
function cr(e, t) {
|
|
1918
1913
|
return new e({
|
|
1919
1914
|
type: "number",
|
|
1920
1915
|
checks: [],
|
|
1921
|
-
...
|
|
1916
|
+
...d(t)
|
|
1922
1917
|
});
|
|
1923
1918
|
}
|
|
1924
|
-
|
|
1925
|
-
function
|
|
1919
|
+
a(cr, "_number");
|
|
1920
|
+
function ar(e, t) {
|
|
1926
1921
|
return new e({
|
|
1927
1922
|
type: "number",
|
|
1928
1923
|
check: "number_format",
|
|
1929
1924
|
abort: !1,
|
|
1930
1925
|
format: "safeint",
|
|
1931
|
-
...
|
|
1926
|
+
...d(t)
|
|
1932
1927
|
});
|
|
1933
1928
|
}
|
|
1934
|
-
|
|
1935
|
-
function
|
|
1929
|
+
a(ar, "_int");
|
|
1930
|
+
function ur(e, t) {
|
|
1936
1931
|
return new e({
|
|
1937
1932
|
type: "boolean",
|
|
1938
|
-
...
|
|
1933
|
+
...d(t)
|
|
1939
1934
|
});
|
|
1940
1935
|
}
|
|
1941
|
-
|
|
1942
|
-
function
|
|
1936
|
+
a(ur, "_boolean");
|
|
1937
|
+
function sr(e) {
|
|
1943
1938
|
return new e({
|
|
1944
1939
|
type: "any"
|
|
1945
1940
|
});
|
|
1946
1941
|
}
|
|
1947
|
-
|
|
1948
|
-
function
|
|
1942
|
+
a(sr, "_any");
|
|
1943
|
+
function lr(e) {
|
|
1949
1944
|
return new e({
|
|
1950
1945
|
type: "unknown"
|
|
1951
1946
|
});
|
|
1952
1947
|
}
|
|
1953
|
-
|
|
1954
|
-
function
|
|
1948
|
+
a(lr, "_unknown");
|
|
1949
|
+
function pr(e, t) {
|
|
1955
1950
|
return new e({
|
|
1956
1951
|
type: "never",
|
|
1957
|
-
...
|
|
1952
|
+
...d(t)
|
|
1958
1953
|
});
|
|
1959
1954
|
}
|
|
1960
|
-
|
|
1961
|
-
function
|
|
1955
|
+
a(pr, "_never");
|
|
1956
|
+
function dr(e, t) {
|
|
1962
1957
|
return new e({
|
|
1963
1958
|
type: "date",
|
|
1964
|
-
...
|
|
1959
|
+
...d(t)
|
|
1965
1960
|
});
|
|
1966
1961
|
}
|
|
1967
|
-
|
|
1968
|
-
function
|
|
1969
|
-
return new
|
|
1962
|
+
a(dr, "_date");
|
|
1963
|
+
function Re(e, t) {
|
|
1964
|
+
return new it({
|
|
1970
1965
|
check: "less_than",
|
|
1971
|
-
...
|
|
1966
|
+
...d(t),
|
|
1972
1967
|
value: e,
|
|
1973
1968
|
inclusive: !1
|
|
1974
1969
|
});
|
|
1975
1970
|
}
|
|
1976
|
-
|
|
1977
|
-
function
|
|
1978
|
-
return new
|
|
1971
|
+
a(Re, "_lt");
|
|
1972
|
+
function H(e, t) {
|
|
1973
|
+
return new it({
|
|
1979
1974
|
check: "less_than",
|
|
1980
|
-
...
|
|
1975
|
+
...d(t),
|
|
1981
1976
|
value: e,
|
|
1982
1977
|
inclusive: !0
|
|
1983
1978
|
});
|
|
1984
1979
|
}
|
|
1985
|
-
|
|
1986
|
-
function
|
|
1987
|
-
return new
|
|
1980
|
+
a(H, "_lte");
|
|
1981
|
+
function Ue(e, t) {
|
|
1982
|
+
return new ct({
|
|
1988
1983
|
check: "greater_than",
|
|
1989
|
-
...
|
|
1984
|
+
...d(t),
|
|
1990
1985
|
value: e,
|
|
1991
1986
|
inclusive: !1
|
|
1992
1987
|
});
|
|
1993
1988
|
}
|
|
1994
|
-
|
|
1995
|
-
function
|
|
1996
|
-
return new
|
|
1989
|
+
a(Ue, "_gt");
|
|
1990
|
+
function Q(e, t) {
|
|
1991
|
+
return new ct({
|
|
1997
1992
|
check: "greater_than",
|
|
1998
|
-
...
|
|
1993
|
+
...d(t),
|
|
1999
1994
|
value: e,
|
|
2000
1995
|
inclusive: !0
|
|
2001
1996
|
});
|
|
2002
1997
|
}
|
|
2003
|
-
|
|
2004
|
-
function
|
|
2005
|
-
return new
|
|
1998
|
+
a(Q, "_gte");
|
|
1999
|
+
function Le(e, t) {
|
|
2000
|
+
return new yn({
|
|
2006
2001
|
check: "multiple_of",
|
|
2007
|
-
...
|
|
2002
|
+
...d(t),
|
|
2008
2003
|
value: e
|
|
2009
2004
|
});
|
|
2010
2005
|
}
|
|
2011
|
-
|
|
2012
|
-
function
|
|
2013
|
-
return new
|
|
2006
|
+
a(Le, "_multipleOf");
|
|
2007
|
+
function dt(e, t) {
|
|
2008
|
+
return new An({
|
|
2014
2009
|
check: "max_length",
|
|
2015
|
-
...
|
|
2010
|
+
...d(t),
|
|
2016
2011
|
maximum: e
|
|
2017
2012
|
});
|
|
2018
2013
|
}
|
|
2019
|
-
|
|
2020
|
-
function
|
|
2021
|
-
return new
|
|
2014
|
+
a(dt, "_maxLength");
|
|
2015
|
+
function ne(e, t) {
|
|
2016
|
+
return new En({
|
|
2022
2017
|
check: "min_length",
|
|
2023
|
-
...
|
|
2018
|
+
...d(t),
|
|
2024
2019
|
minimum: e
|
|
2025
2020
|
});
|
|
2026
2021
|
}
|
|
2027
|
-
|
|
2028
|
-
function
|
|
2029
|
-
return new
|
|
2022
|
+
a(ne, "_minLength");
|
|
2023
|
+
function ht(e, t) {
|
|
2024
|
+
return new Sn({
|
|
2030
2025
|
check: "length_equals",
|
|
2031
|
-
...
|
|
2026
|
+
...d(t),
|
|
2032
2027
|
length: e
|
|
2033
2028
|
});
|
|
2034
2029
|
}
|
|
2035
|
-
|
|
2036
|
-
function
|
|
2037
|
-
return new
|
|
2030
|
+
a(ht, "_length");
|
|
2031
|
+
function hr(e, t) {
|
|
2032
|
+
return new On({
|
|
2038
2033
|
check: "string_format",
|
|
2039
2034
|
format: "regex",
|
|
2040
|
-
...
|
|
2035
|
+
...d(t),
|
|
2041
2036
|
pattern: e
|
|
2042
2037
|
});
|
|
2043
2038
|
}
|
|
2044
|
-
|
|
2045
|
-
function
|
|
2046
|
-
return new
|
|
2039
|
+
a(hr, "_regex");
|
|
2040
|
+
function fr(e) {
|
|
2041
|
+
return new Pn({
|
|
2047
2042
|
check: "string_format",
|
|
2048
2043
|
format: "lowercase",
|
|
2049
|
-
...
|
|
2044
|
+
...d(e)
|
|
2050
2045
|
});
|
|
2051
2046
|
}
|
|
2052
|
-
|
|
2053
|
-
function
|
|
2054
|
-
return new
|
|
2047
|
+
a(fr, "_lowercase");
|
|
2048
|
+
function mr(e) {
|
|
2049
|
+
return new Tn({
|
|
2055
2050
|
check: "string_format",
|
|
2056
2051
|
format: "uppercase",
|
|
2057
|
-
...
|
|
2052
|
+
...d(e)
|
|
2058
2053
|
});
|
|
2059
2054
|
}
|
|
2060
|
-
|
|
2061
|
-
function
|
|
2062
|
-
return new
|
|
2055
|
+
a(mr, "_uppercase");
|
|
2056
|
+
function _r(e, t) {
|
|
2057
|
+
return new xn({
|
|
2063
2058
|
check: "string_format",
|
|
2064
2059
|
format: "includes",
|
|
2065
|
-
...
|
|
2060
|
+
...d(t),
|
|
2066
2061
|
includes: e
|
|
2067
2062
|
});
|
|
2068
2063
|
}
|
|
2069
|
-
|
|
2070
|
-
function
|
|
2071
|
-
return new
|
|
2064
|
+
a(_r, "_includes");
|
|
2065
|
+
function vr(e, t) {
|
|
2066
|
+
return new Nn({
|
|
2072
2067
|
check: "string_format",
|
|
2073
2068
|
format: "starts_with",
|
|
2074
|
-
...
|
|
2069
|
+
...d(t),
|
|
2075
2070
|
prefix: e
|
|
2076
2071
|
});
|
|
2077
2072
|
}
|
|
2078
|
-
|
|
2079
|
-
function
|
|
2080
|
-
return new
|
|
2073
|
+
a(vr, "_startsWith");
|
|
2074
|
+
function gr(e, t) {
|
|
2075
|
+
return new jn({
|
|
2081
2076
|
check: "string_format",
|
|
2082
2077
|
format: "ends_with",
|
|
2083
|
-
...
|
|
2078
|
+
...d(t),
|
|
2084
2079
|
suffix: e
|
|
2085
2080
|
});
|
|
2086
2081
|
}
|
|
2087
|
-
|
|
2088
|
-
function
|
|
2089
|
-
return new
|
|
2082
|
+
a(gr, "_endsWith");
|
|
2083
|
+
function J(e) {
|
|
2084
|
+
return new Dn({
|
|
2090
2085
|
check: "overwrite",
|
|
2091
2086
|
tx: e
|
|
2092
2087
|
});
|
|
2093
2088
|
}
|
|
2094
|
-
|
|
2095
|
-
function
|
|
2096
|
-
return
|
|
2089
|
+
a(J, "_overwrite");
|
|
2090
|
+
function br(e) {
|
|
2091
|
+
return J((t) => t.normalize(e));
|
|
2097
2092
|
}
|
|
2098
|
-
|
|
2099
|
-
function
|
|
2100
|
-
return
|
|
2093
|
+
a(br, "_normalize");
|
|
2094
|
+
function zr() {
|
|
2095
|
+
return J((e) => e.trim());
|
|
2101
2096
|
}
|
|
2102
|
-
|
|
2103
|
-
function
|
|
2104
|
-
return
|
|
2097
|
+
a(zr, "_trim");
|
|
2098
|
+
function wr() {
|
|
2099
|
+
return J((e) => e.toLowerCase());
|
|
2105
2100
|
}
|
|
2106
|
-
|
|
2107
|
-
function
|
|
2108
|
-
return
|
|
2101
|
+
a(wr, "_toLowerCase");
|
|
2102
|
+
function kr() {
|
|
2103
|
+
return J((e) => e.toUpperCase());
|
|
2109
2104
|
}
|
|
2110
|
-
|
|
2111
|
-
function
|
|
2105
|
+
a(kr, "_toUpperCase");
|
|
2106
|
+
function Zr(e, t, n) {
|
|
2112
2107
|
return new e({
|
|
2113
2108
|
type: "array",
|
|
2114
2109
|
element: t,
|
|
2115
2110
|
// get element() {
|
|
2116
2111
|
// return element;
|
|
2117
2112
|
// },
|
|
2118
|
-
...
|
|
2113
|
+
...d(n)
|
|
2119
2114
|
});
|
|
2120
2115
|
}
|
|
2121
|
-
|
|
2122
|
-
function
|
|
2116
|
+
a(Zr, "_array");
|
|
2117
|
+
function $r(e, t, n) {
|
|
2123
2118
|
return new e({
|
|
2124
2119
|
type: "custom",
|
|
2125
2120
|
check: "custom",
|
|
2126
2121
|
fn: t,
|
|
2127
|
-
...
|
|
2122
|
+
...d(n)
|
|
2128
2123
|
});
|
|
2129
2124
|
}
|
|
2130
|
-
|
|
2131
|
-
function
|
|
2132
|
-
const t =
|
|
2125
|
+
a($r, "_refine");
|
|
2126
|
+
function yr(e) {
|
|
2127
|
+
const t = Ir((n) => (n.addIssue = (o) => {
|
|
2133
2128
|
if (typeof o == "string")
|
|
2134
|
-
n.issues.push(
|
|
2129
|
+
n.issues.push(W(o, n.value, t._zod.def));
|
|
2135
2130
|
else {
|
|
2136
2131
|
const r = o;
|
|
2137
|
-
r.fatal && (r.continue = !1), r.code ?? (r.code = "custom"), r.input ?? (r.input = n.value), r.inst ?? (r.inst = t), r.continue ?? (r.continue = !t._zod.def.abort), n.issues.push(
|
|
2132
|
+
r.fatal && (r.continue = !1), r.code ?? (r.code = "custom"), r.input ?? (r.input = n.value), r.inst ?? (r.inst = t), r.continue ?? (r.continue = !t._zod.def.abort), n.issues.push(W(r));
|
|
2138
2133
|
}
|
|
2139
2134
|
}, e(n.value, n)));
|
|
2140
2135
|
return t;
|
|
2141
2136
|
}
|
|
2142
|
-
|
|
2143
|
-
function
|
|
2137
|
+
a(yr, "_superRefine");
|
|
2138
|
+
function Ir(e, t) {
|
|
2144
2139
|
const n = new A({
|
|
2145
2140
|
check: "custom",
|
|
2146
|
-
...
|
|
2141
|
+
...d(t)
|
|
2147
2142
|
});
|
|
2148
2143
|
return n._zod.check = e, n;
|
|
2149
2144
|
}
|
|
2150
|
-
|
|
2151
|
-
const
|
|
2152
|
-
|
|
2145
|
+
a(Ir, "_check");
|
|
2146
|
+
const Ar = /* @__PURE__ */ u("ZodISODateTime", (e, t) => {
|
|
2147
|
+
Yn.init(e, t), b.init(e, t);
|
|
2153
2148
|
});
|
|
2154
|
-
function
|
|
2155
|
-
return
|
|
2149
|
+
function Er(e) {
|
|
2150
|
+
return nr(Ar, e);
|
|
2156
2151
|
}
|
|
2157
|
-
|
|
2158
|
-
const
|
|
2159
|
-
|
|
2152
|
+
a(Er, "datetime");
|
|
2153
|
+
const Sr = /* @__PURE__ */ u("ZodISODate", (e, t) => {
|
|
2154
|
+
Xn.init(e, t), b.init(e, t);
|
|
2160
2155
|
});
|
|
2161
|
-
function
|
|
2162
|
-
return
|
|
2156
|
+
function Or(e) {
|
|
2157
|
+
return or(Sr, e);
|
|
2163
2158
|
}
|
|
2164
|
-
|
|
2165
|
-
const
|
|
2166
|
-
|
|
2159
|
+
a(Or, "date$1");
|
|
2160
|
+
const Pr = /* @__PURE__ */ u("ZodISOTime", (e, t) => {
|
|
2161
|
+
qn.init(e, t), b.init(e, t);
|
|
2167
2162
|
});
|
|
2168
|
-
function
|
|
2169
|
-
return
|
|
2163
|
+
function Tr(e) {
|
|
2164
|
+
return rr(Pr, e);
|
|
2170
2165
|
}
|
|
2171
|
-
|
|
2172
|
-
const
|
|
2173
|
-
|
|
2166
|
+
a(Tr, "time");
|
|
2167
|
+
const xr = /* @__PURE__ */ u("ZodISODuration", (e, t) => {
|
|
2168
|
+
Hn.init(e, t), b.init(e, t);
|
|
2174
2169
|
});
|
|
2175
|
-
function
|
|
2176
|
-
return
|
|
2170
|
+
function Nr(e) {
|
|
2171
|
+
return ir(xr, e);
|
|
2177
2172
|
}
|
|
2178
|
-
|
|
2179
|
-
const
|
|
2180
|
-
|
|
2173
|
+
a(Nr, "duration");
|
|
2174
|
+
const jr = /* @__PURE__ */ a((e, t) => {
|
|
2175
|
+
Qe.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2181
2176
|
format: {
|
|
2182
|
-
value: /* @__PURE__ */
|
|
2177
|
+
value: /* @__PURE__ */ a((n) => Ut(e, n), "value")
|
|
2183
2178
|
// enumerable: false,
|
|
2184
2179
|
},
|
|
2185
2180
|
flatten: {
|
|
2186
|
-
value: /* @__PURE__ */
|
|
2181
|
+
value: /* @__PURE__ */ a((n) => Rt(e, n), "value")
|
|
2187
2182
|
// enumerable: false,
|
|
2188
2183
|
},
|
|
2189
2184
|
addIssue: {
|
|
2190
|
-
value: /* @__PURE__ */
|
|
2191
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues,
|
|
2185
|
+
value: /* @__PURE__ */ a((n) => {
|
|
2186
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, le, 2);
|
|
2192
2187
|
}, "value")
|
|
2193
2188
|
// enumerable: false,
|
|
2194
2189
|
},
|
|
2195
2190
|
addIssues: {
|
|
2196
|
-
value: /* @__PURE__ */
|
|
2197
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues,
|
|
2191
|
+
value: /* @__PURE__ */ a((n) => {
|
|
2192
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, le, 2);
|
|
2198
2193
|
}, "value")
|
|
2199
2194
|
// enumerable: false,
|
|
2200
2195
|
},
|
|
@@ -2205,225 +2200,225 @@ const oi = /* @__PURE__ */ s((e, t) => {
|
|
|
2205
2200
|
// enumerable: false,
|
|
2206
2201
|
}
|
|
2207
2202
|
});
|
|
2208
|
-
}, "initializer"),
|
|
2203
|
+
}, "initializer"), S = u("ZodError", jr, {
|
|
2209
2204
|
Parent: Error
|
|
2210
|
-
}),
|
|
2205
|
+
}), Dr = /* @__PURE__ */ be(S), Cr = /* @__PURE__ */ ze(S), Fr = /* @__PURE__ */ ce(S), Rr = /* @__PURE__ */ ae(S), Ur = /* @__PURE__ */ Vt(S), Lr = /* @__PURE__ */ Bt(S), Mr = /* @__PURE__ */ Wt(S), Vr = /* @__PURE__ */ Gt(S), Br = /* @__PURE__ */ Jt(S), Wr = /* @__PURE__ */ Kt(S), Gr = /* @__PURE__ */ Yt(S), Jr = /* @__PURE__ */ Xt(S), g = /* @__PURE__ */ u("ZodType", (e, t) => (_.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(R(t, {
|
|
2211
2206
|
checks: [
|
|
2212
2207
|
...t.checks ?? [],
|
|
2213
2208
|
...n.map((o) => typeof o == "function" ? { _zod: { check: o, def: { check: "custom" }, onattach: [] } } : o)
|
|
2214
2209
|
]
|
|
2215
|
-
})), e.clone = (n, o) =>
|
|
2210
|
+
})), e.clone = (n, o) => j(e, n, o), e.brand = () => e, e.register = ((n, o) => (n.add(e, o), e)), e.parse = (n, o) => Dr(e, n, o, { callee: e.parse }), e.safeParse = (n, o) => Fr(e, n, o), e.parseAsync = async (n, o) => Cr(e, n, o, { callee: e.parseAsync }), e.safeParseAsync = async (n, o) => Rr(e, n, o), e.spa = e.safeParseAsync, e.encode = (n, o) => Ur(e, n, o), e.decode = (n, o) => Lr(e, n, o), e.encodeAsync = async (n, o) => Mr(e, n, o), e.decodeAsync = async (n, o) => Vr(e, n, o), e.safeEncode = (n, o) => Br(e, n, o), e.safeDecode = (n, o) => Wr(e, n, o), e.safeEncodeAsync = async (n, o) => Gr(e, n, o), e.safeDecodeAsync = async (n, o) => Jr(e, n, o), e.refine = (n, o) => e.check(Ri(n, o)), e.superRefine = (n) => e.check(Ui(n)), e.overwrite = (n) => e.check(J(n)), e.optional = () => We(e), e.nullable = () => Ge(e), e.nullish = () => We(Ge(e)), e.nonoptional = (n) => Ti(e, n), e.array = () => N(e), e.or = (n) => re([e, n]), e.and = (n) => Zi(e, n), e.transform = (n) => Je(e, Ii(n)), e.default = (n) => Si(e, n), e.prefault = (n) => Pi(e, n), e.catch = (n) => Ni(e, n), e.pipe = (n) => Je(e, n), e.readonly = () => Ci(e), e.describe = (n) => {
|
|
2216
2211
|
const o = e.clone();
|
|
2217
|
-
return
|
|
2212
|
+
return X.add(o, { description: n }), o;
|
|
2218
2213
|
}, Object.defineProperty(e, "description", {
|
|
2219
2214
|
get() {
|
|
2220
|
-
return
|
|
2215
|
+
return X.get(e)?.description;
|
|
2221
2216
|
},
|
|
2222
2217
|
configurable: !0
|
|
2223
2218
|
}), e.meta = (...n) => {
|
|
2224
2219
|
if (n.length === 0)
|
|
2225
|
-
return
|
|
2220
|
+
return X.get(e);
|
|
2226
2221
|
const o = e.clone();
|
|
2227
|
-
return
|
|
2228
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
2229
|
-
|
|
2222
|
+
return X.add(o, n[0]), o;
|
|
2223
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), ft = /* @__PURE__ */ u("_ZodString", (e, t) => {
|
|
2224
|
+
we.init(e, t), g.init(e, t);
|
|
2230
2225
|
const n = e._zod.bag;
|
|
2231
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...o) => e.check(
|
|
2232
|
-
}),
|
|
2233
|
-
|
|
2226
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...o) => e.check(hr(...o)), e.includes = (...o) => e.check(_r(...o)), e.startsWith = (...o) => e.check(vr(...o)), e.endsWith = (...o) => e.check(gr(...o)), e.min = (...o) => e.check(ne(...o)), e.max = (...o) => e.check(dt(...o)), e.length = (...o) => e.check(ht(...o)), e.nonempty = (...o) => e.check(ne(1, ...o)), e.lowercase = (o) => e.check(fr(o)), e.uppercase = (o) => e.check(mr(o)), e.trim = () => e.check(zr()), e.normalize = (...o) => e.check(br(...o)), e.toLowerCase = () => e.check(wr()), e.toUpperCase = () => e.check(kr());
|
|
2227
|
+
}), Kr = /* @__PURE__ */ u("ZodString", (e, t) => {
|
|
2228
|
+
we.init(e, t), ft.init(e, t), e.email = (n) => e.check(jo(Yr, n)), e.url = (n) => e.check(Uo(Xr, n)), e.jwt = (n) => e.check(tr(pi, n)), e.emoji = (n) => e.check(Lo(qr, n)), e.guid = (n) => e.check(Fe(Me, n)), e.uuid = (n) => e.check(Do(q, n)), e.uuidv4 = (n) => e.check(Co(q, n)), e.uuidv6 = (n) => e.check(Fo(q, n)), e.uuidv7 = (n) => e.check(Ro(q, n)), e.nanoid = (n) => e.check(Mo(Hr, n)), e.guid = (n) => e.check(Fe(Me, n)), e.cuid = (n) => e.check(Vo(Qr, n)), e.cuid2 = (n) => e.check(Bo(ei, n)), e.ulid = (n) => e.check(Wo(ti, n)), e.base64 = (n) => e.check(Ho(ui, n)), e.base64url = (n) => e.check(Qo(si, n)), e.xid = (n) => e.check(Go(ni, n)), e.ksuid = (n) => e.check(Jo(oi, n)), e.ipv4 = (n) => e.check(Ko(ri, n)), e.ipv6 = (n) => e.check(Yo(ii, n)), e.cidrv4 = (n) => e.check(Xo(ci, n)), e.cidrv6 = (n) => e.check(qo(ai, n)), e.e164 = (n) => e.check(er(li, n)), e.datetime = (n) => e.check(Er(n)), e.date = (n) => e.check(Or(n)), e.time = (n) => e.check(Tr(n)), e.duration = (n) => e.check(Nr(n));
|
|
2234
2229
|
});
|
|
2235
2230
|
function l(e) {
|
|
2236
|
-
return
|
|
2237
|
-
}
|
|
2238
|
-
|
|
2239
|
-
const
|
|
2240
|
-
v.init(e, t),
|
|
2241
|
-
}),
|
|
2242
|
-
|
|
2243
|
-
}),
|
|
2244
|
-
|
|
2245
|
-
}),
|
|
2246
|
-
|
|
2247
|
-
}),
|
|
2248
|
-
|
|
2249
|
-
}),
|
|
2250
|
-
|
|
2251
|
-
}),
|
|
2252
|
-
|
|
2253
|
-
}),
|
|
2254
|
-
|
|
2255
|
-
}),
|
|
2256
|
-
|
|
2257
|
-
}),
|
|
2258
|
-
|
|
2259
|
-
}),
|
|
2260
|
-
|
|
2261
|
-
}),
|
|
2262
|
-
|
|
2263
|
-
}),
|
|
2264
|
-
|
|
2265
|
-
}),
|
|
2266
|
-
|
|
2267
|
-
}),
|
|
2268
|
-
|
|
2269
|
-
}),
|
|
2270
|
-
|
|
2271
|
-
}),
|
|
2272
|
-
|
|
2273
|
-
}),
|
|
2274
|
-
|
|
2275
|
-
}),
|
|
2276
|
-
|
|
2277
|
-
}),
|
|
2278
|
-
|
|
2279
|
-
}),
|
|
2280
|
-
|
|
2231
|
+
return No(Kr, e);
|
|
2232
|
+
}
|
|
2233
|
+
a(l, "string");
|
|
2234
|
+
const b = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
2235
|
+
v.init(e, t), ft.init(e, t);
|
|
2236
|
+
}), Yr = /* @__PURE__ */ u("ZodEmail", (e, t) => {
|
|
2237
|
+
Un.init(e, t), b.init(e, t);
|
|
2238
|
+
}), Me = /* @__PURE__ */ u("ZodGUID", (e, t) => {
|
|
2239
|
+
Fn.init(e, t), b.init(e, t);
|
|
2240
|
+
}), q = /* @__PURE__ */ u("ZodUUID", (e, t) => {
|
|
2241
|
+
Rn.init(e, t), b.init(e, t);
|
|
2242
|
+
}), Xr = /* @__PURE__ */ u("ZodURL", (e, t) => {
|
|
2243
|
+
Ln.init(e, t), b.init(e, t);
|
|
2244
|
+
}), qr = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
|
|
2245
|
+
Mn.init(e, t), b.init(e, t);
|
|
2246
|
+
}), Hr = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
|
|
2247
|
+
Vn.init(e, t), b.init(e, t);
|
|
2248
|
+
}), Qr = /* @__PURE__ */ u("ZodCUID", (e, t) => {
|
|
2249
|
+
Bn.init(e, t), b.init(e, t);
|
|
2250
|
+
}), ei = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
|
|
2251
|
+
Wn.init(e, t), b.init(e, t);
|
|
2252
|
+
}), ti = /* @__PURE__ */ u("ZodULID", (e, t) => {
|
|
2253
|
+
Gn.init(e, t), b.init(e, t);
|
|
2254
|
+
}), ni = /* @__PURE__ */ u("ZodXID", (e, t) => {
|
|
2255
|
+
Jn.init(e, t), b.init(e, t);
|
|
2256
|
+
}), oi = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
|
|
2257
|
+
Kn.init(e, t), b.init(e, t);
|
|
2258
|
+
}), ri = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
|
|
2259
|
+
Qn.init(e, t), b.init(e, t);
|
|
2260
|
+
}), ii = /* @__PURE__ */ u("ZodIPv6", (e, t) => {
|
|
2261
|
+
eo.init(e, t), b.init(e, t);
|
|
2262
|
+
}), ci = /* @__PURE__ */ u("ZodCIDRv4", (e, t) => {
|
|
2263
|
+
to.init(e, t), b.init(e, t);
|
|
2264
|
+
}), ai = /* @__PURE__ */ u("ZodCIDRv6", (e, t) => {
|
|
2265
|
+
no.init(e, t), b.init(e, t);
|
|
2266
|
+
}), ui = /* @__PURE__ */ u("ZodBase64", (e, t) => {
|
|
2267
|
+
oo.init(e, t), b.init(e, t);
|
|
2268
|
+
}), si = /* @__PURE__ */ u("ZodBase64URL", (e, t) => {
|
|
2269
|
+
io.init(e, t), b.init(e, t);
|
|
2270
|
+
}), li = /* @__PURE__ */ u("ZodE164", (e, t) => {
|
|
2271
|
+
co.init(e, t), b.init(e, t);
|
|
2272
|
+
}), pi = /* @__PURE__ */ u("ZodJWT", (e, t) => {
|
|
2273
|
+
uo.init(e, t), b.init(e, t);
|
|
2274
|
+
}), mt = /* @__PURE__ */ u("ZodNumber", (e, t) => {
|
|
2275
|
+
ut.init(e, t), g.init(e, t), e.gt = (o, r) => e.check(Ue(o, r)), e.gte = (o, r) => e.check(Q(o, r)), e.min = (o, r) => e.check(Q(o, r)), e.lt = (o, r) => e.check(Re(o, r)), e.lte = (o, r) => e.check(H(o, r)), e.max = (o, r) => e.check(H(o, r)), e.int = (o) => e.check(Ve(o)), e.safe = (o) => e.check(Ve(o)), e.positive = (o) => e.check(Ue(0, o)), e.nonnegative = (o) => e.check(Q(0, o)), e.negative = (o) => e.check(Re(0, o)), e.nonpositive = (o) => e.check(H(0, o)), e.multipleOf = (o, r) => e.check(Le(o, r)), e.step = (o, r) => e.check(Le(o, r)), e.finite = () => e;
|
|
2281
2276
|
const n = e._zod.bag;
|
|
2282
2277
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2283
2278
|
});
|
|
2284
|
-
function
|
|
2285
|
-
return
|
|
2279
|
+
function I(e) {
|
|
2280
|
+
return cr(mt, e);
|
|
2286
2281
|
}
|
|
2287
|
-
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2282
|
+
a(I, "number");
|
|
2283
|
+
const di = /* @__PURE__ */ u("ZodNumberFormat", (e, t) => {
|
|
2284
|
+
so.init(e, t), mt.init(e, t);
|
|
2290
2285
|
});
|
|
2291
|
-
function
|
|
2292
|
-
return
|
|
2286
|
+
function Ve(e) {
|
|
2287
|
+
return ar(di, e);
|
|
2293
2288
|
}
|
|
2294
|
-
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2289
|
+
a(Ve, "int");
|
|
2290
|
+
const hi = /* @__PURE__ */ u("ZodBoolean", (e, t) => {
|
|
2291
|
+
lo.init(e, t), g.init(e, t);
|
|
2297
2292
|
});
|
|
2298
|
-
function
|
|
2299
|
-
return
|
|
2293
|
+
function y(e) {
|
|
2294
|
+
return ur(hi, e);
|
|
2300
2295
|
}
|
|
2301
|
-
|
|
2302
|
-
const
|
|
2303
|
-
|
|
2296
|
+
a(y, "boolean");
|
|
2297
|
+
const fi = /* @__PURE__ */ u("ZodAny", (e, t) => {
|
|
2298
|
+
po.init(e, t), g.init(e, t);
|
|
2304
2299
|
});
|
|
2305
|
-
function
|
|
2306
|
-
return
|
|
2300
|
+
function oe() {
|
|
2301
|
+
return sr(fi);
|
|
2307
2302
|
}
|
|
2308
|
-
|
|
2309
|
-
const
|
|
2310
|
-
|
|
2303
|
+
a(oe, "any");
|
|
2304
|
+
const mi = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
|
|
2305
|
+
ho.init(e, t), g.init(e, t);
|
|
2311
2306
|
});
|
|
2312
|
-
function
|
|
2313
|
-
return
|
|
2307
|
+
function Be() {
|
|
2308
|
+
return lr(mi);
|
|
2314
2309
|
}
|
|
2315
|
-
|
|
2316
|
-
const
|
|
2317
|
-
|
|
2310
|
+
a(Be, "unknown");
|
|
2311
|
+
const _i = /* @__PURE__ */ u("ZodNever", (e, t) => {
|
|
2312
|
+
fo.init(e, t), g.init(e, t);
|
|
2318
2313
|
});
|
|
2319
|
-
function
|
|
2320
|
-
return
|
|
2314
|
+
function vi(e) {
|
|
2315
|
+
return pr(_i, e);
|
|
2321
2316
|
}
|
|
2322
|
-
|
|
2323
|
-
const
|
|
2324
|
-
|
|
2317
|
+
a(vi, "never");
|
|
2318
|
+
const gi = /* @__PURE__ */ u("ZodDate", (e, t) => {
|
|
2319
|
+
mo.init(e, t), g.init(e, t), e.min = (o, r) => e.check(Q(o, r)), e.max = (o, r) => e.check(H(o, r));
|
|
2325
2320
|
const n = e._zod.bag;
|
|
2326
2321
|
e.minDate = n.minimum ? new Date(n.minimum) : null, e.maxDate = n.maximum ? new Date(n.maximum) : null;
|
|
2327
2322
|
});
|
|
2328
|
-
function
|
|
2329
|
-
return
|
|
2323
|
+
function fe(e) {
|
|
2324
|
+
return dr(gi, e);
|
|
2330
2325
|
}
|
|
2331
|
-
|
|
2332
|
-
const
|
|
2333
|
-
|
|
2326
|
+
a(fe, "date");
|
|
2327
|
+
const bi = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
2328
|
+
_o.init(e, t), g.init(e, t), e.element = t.element, e.min = (n, o) => e.check(ne(n, o)), e.nonempty = (n) => e.check(ne(1, n)), e.max = (n, o) => e.check(dt(n, o)), e.length = (n, o) => e.check(ht(n, o)), e.unwrap = () => e.element;
|
|
2334
2329
|
});
|
|
2335
|
-
function
|
|
2336
|
-
return
|
|
2330
|
+
function N(e, t) {
|
|
2331
|
+
return Zr(bi, e, t);
|
|
2337
2332
|
}
|
|
2338
|
-
|
|
2339
|
-
const
|
|
2340
|
-
|
|
2333
|
+
a(N, "array");
|
|
2334
|
+
const zi = /* @__PURE__ */ u("ZodObject", (e, t) => {
|
|
2335
|
+
go.init(e, t), g.init(e, t), m(e, "shape", () => t.shape), e.keyof = () => k(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Be() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Be() }), e.strict = () => e.clone({ ...e._zod.def, catchall: vi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Nt(e, n), e.safeExtend = (n) => jt(e, n), e.merge = (n) => Dt(e, n), e.pick = (n) => Tt(e, n), e.omit = (n) => xt(e, n), e.partial = (...n) => Ct(gt, e, n[0]), e.required = (...n) => Ft(bt, e, n[0]);
|
|
2341
2336
|
});
|
|
2342
|
-
function
|
|
2337
|
+
function Z(e, t) {
|
|
2343
2338
|
const n = {
|
|
2344
2339
|
type: "object",
|
|
2345
2340
|
shape: e ?? {},
|
|
2346
|
-
...
|
|
2341
|
+
...d(t)
|
|
2347
2342
|
};
|
|
2348
|
-
return new
|
|
2343
|
+
return new zi(n);
|
|
2349
2344
|
}
|
|
2350
|
-
|
|
2351
|
-
const
|
|
2352
|
-
|
|
2345
|
+
a(Z, "object");
|
|
2346
|
+
const _t = /* @__PURE__ */ u("ZodUnion", (e, t) => {
|
|
2347
|
+
pt.init(e, t), g.init(e, t), e.options = t.options;
|
|
2353
2348
|
});
|
|
2354
|
-
function
|
|
2355
|
-
return new
|
|
2349
|
+
function re(e, t) {
|
|
2350
|
+
return new _t({
|
|
2356
2351
|
type: "union",
|
|
2357
2352
|
options: e,
|
|
2358
|
-
...
|
|
2353
|
+
...d(t)
|
|
2359
2354
|
});
|
|
2360
2355
|
}
|
|
2361
|
-
|
|
2362
|
-
const
|
|
2363
|
-
|
|
2356
|
+
a(re, "union");
|
|
2357
|
+
const wi = /* @__PURE__ */ u("ZodDiscriminatedUnion", (e, t) => {
|
|
2358
|
+
_t.init(e, t), bo.init(e, t);
|
|
2364
2359
|
});
|
|
2365
|
-
function
|
|
2366
|
-
return new
|
|
2360
|
+
function vt(e, t, n) {
|
|
2361
|
+
return new wi({
|
|
2367
2362
|
type: "union",
|
|
2368
2363
|
options: t,
|
|
2369
2364
|
discriminator: e,
|
|
2370
|
-
...
|
|
2365
|
+
...d(n)
|
|
2371
2366
|
});
|
|
2372
2367
|
}
|
|
2373
|
-
|
|
2374
|
-
const
|
|
2375
|
-
|
|
2368
|
+
a(vt, "discriminatedUnion");
|
|
2369
|
+
const ki = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
|
|
2370
|
+
zo.init(e, t), g.init(e, t);
|
|
2376
2371
|
});
|
|
2377
|
-
function
|
|
2378
|
-
return new
|
|
2372
|
+
function Zi(e, t) {
|
|
2373
|
+
return new ki({
|
|
2379
2374
|
type: "intersection",
|
|
2380
2375
|
left: e,
|
|
2381
2376
|
right: t
|
|
2382
2377
|
});
|
|
2383
2378
|
}
|
|
2384
|
-
|
|
2385
|
-
const
|
|
2386
|
-
|
|
2379
|
+
a(Zi, "intersection");
|
|
2380
|
+
const me = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
2381
|
+
wo.init(e, t), g.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2387
2382
|
const n = new Set(Object.keys(t.entries));
|
|
2388
2383
|
e.extract = (o, r) => {
|
|
2389
|
-
const
|
|
2390
|
-
for (const
|
|
2391
|
-
if (n.has(
|
|
2392
|
-
i
|
|
2384
|
+
const c = {};
|
|
2385
|
+
for (const i of o)
|
|
2386
|
+
if (n.has(i))
|
|
2387
|
+
c[i] = t.entries[i];
|
|
2393
2388
|
else
|
|
2394
|
-
throw new Error(`Key ${
|
|
2395
|
-
return new
|
|
2389
|
+
throw new Error(`Key ${i} not found in enum`);
|
|
2390
|
+
return new me({
|
|
2396
2391
|
...t,
|
|
2397
2392
|
checks: [],
|
|
2398
|
-
...
|
|
2399
|
-
entries:
|
|
2393
|
+
...d(r),
|
|
2394
|
+
entries: c
|
|
2400
2395
|
});
|
|
2401
2396
|
}, e.exclude = (o, r) => {
|
|
2402
|
-
const
|
|
2403
|
-
for (const
|
|
2404
|
-
if (n.has(
|
|
2405
|
-
delete i
|
|
2397
|
+
const c = { ...t.entries };
|
|
2398
|
+
for (const i of o)
|
|
2399
|
+
if (n.has(i))
|
|
2400
|
+
delete c[i];
|
|
2406
2401
|
else
|
|
2407
|
-
throw new Error(`Key ${
|
|
2408
|
-
return new
|
|
2402
|
+
throw new Error(`Key ${i} not found in enum`);
|
|
2403
|
+
return new me({
|
|
2409
2404
|
...t,
|
|
2410
2405
|
checks: [],
|
|
2411
|
-
...
|
|
2412
|
-
entries:
|
|
2406
|
+
...d(r),
|
|
2407
|
+
entries: c
|
|
2413
2408
|
});
|
|
2414
2409
|
};
|
|
2415
2410
|
});
|
|
2416
|
-
function
|
|
2411
|
+
function k(e, t) {
|
|
2417
2412
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((o) => [o, o])) : e;
|
|
2418
|
-
return new
|
|
2413
|
+
return new me({
|
|
2419
2414
|
type: "enum",
|
|
2420
2415
|
entries: n,
|
|
2421
|
-
...
|
|
2416
|
+
...d(t)
|
|
2422
2417
|
});
|
|
2423
2418
|
}
|
|
2424
|
-
|
|
2425
|
-
const
|
|
2426
|
-
|
|
2419
|
+
a(k, "_enum");
|
|
2420
|
+
const $i = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
|
|
2421
|
+
ko.init(e, t), g.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
2427
2422
|
get() {
|
|
2428
2423
|
if (t.values.length > 1)
|
|
2429
2424
|
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
@@ -2431,224 +2426,224 @@ const Gi = /* @__PURE__ */ c("ZodLiteral", (e, t) => {
|
|
|
2431
2426
|
}
|
|
2432
2427
|
});
|
|
2433
2428
|
});
|
|
2434
|
-
function
|
|
2435
|
-
return new
|
|
2429
|
+
function G(e, t) {
|
|
2430
|
+
return new $i({
|
|
2436
2431
|
type: "literal",
|
|
2437
2432
|
values: Array.isArray(e) ? e : [e],
|
|
2438
|
-
...
|
|
2433
|
+
...d(t)
|
|
2439
2434
|
});
|
|
2440
2435
|
}
|
|
2441
|
-
|
|
2442
|
-
const
|
|
2443
|
-
|
|
2436
|
+
a(G, "literal");
|
|
2437
|
+
const yi = /* @__PURE__ */ u("ZodTransform", (e, t) => {
|
|
2438
|
+
Zo.init(e, t), g.init(e, t), e._zod.parse = (n, o) => {
|
|
2444
2439
|
if (o.direction === "backward")
|
|
2445
|
-
throw new
|
|
2446
|
-
n.addIssue = (
|
|
2447
|
-
if (typeof
|
|
2448
|
-
n.issues.push(
|
|
2440
|
+
throw new ee(e.constructor.name);
|
|
2441
|
+
n.addIssue = (c) => {
|
|
2442
|
+
if (typeof c == "string")
|
|
2443
|
+
n.issues.push(W(c, n.value, t));
|
|
2449
2444
|
else {
|
|
2450
|
-
const
|
|
2451
|
-
|
|
2445
|
+
const i = c;
|
|
2446
|
+
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), n.issues.push(W(i));
|
|
2452
2447
|
}
|
|
2453
2448
|
};
|
|
2454
2449
|
const r = t.transform(n.value, n);
|
|
2455
|
-
return r instanceof Promise ? r.then((
|
|
2450
|
+
return r instanceof Promise ? r.then((c) => (n.value = c, n)) : (n.value = r, n);
|
|
2456
2451
|
};
|
|
2457
2452
|
});
|
|
2458
|
-
function
|
|
2459
|
-
return new
|
|
2453
|
+
function Ii(e) {
|
|
2454
|
+
return new yi({
|
|
2460
2455
|
type: "transform",
|
|
2461
2456
|
transform: e
|
|
2462
2457
|
});
|
|
2463
2458
|
}
|
|
2464
|
-
|
|
2465
|
-
const
|
|
2466
|
-
|
|
2459
|
+
a(Ii, "transform");
|
|
2460
|
+
const gt = /* @__PURE__ */ u("ZodOptional", (e, t) => {
|
|
2461
|
+
$o.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2467
2462
|
});
|
|
2468
|
-
function
|
|
2469
|
-
return new
|
|
2463
|
+
function We(e) {
|
|
2464
|
+
return new gt({
|
|
2470
2465
|
type: "optional",
|
|
2471
2466
|
innerType: e
|
|
2472
2467
|
});
|
|
2473
2468
|
}
|
|
2474
|
-
|
|
2475
|
-
const
|
|
2476
|
-
|
|
2469
|
+
a(We, "optional");
|
|
2470
|
+
const Ai = /* @__PURE__ */ u("ZodNullable", (e, t) => {
|
|
2471
|
+
yo.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2477
2472
|
});
|
|
2478
|
-
function
|
|
2479
|
-
return new
|
|
2473
|
+
function Ge(e) {
|
|
2474
|
+
return new Ai({
|
|
2480
2475
|
type: "nullable",
|
|
2481
2476
|
innerType: e
|
|
2482
2477
|
});
|
|
2483
2478
|
}
|
|
2484
|
-
|
|
2485
|
-
const
|
|
2486
|
-
|
|
2479
|
+
a(Ge, "nullable");
|
|
2480
|
+
const Ei = /* @__PURE__ */ u("ZodDefault", (e, t) => {
|
|
2481
|
+
Io.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2487
2482
|
});
|
|
2488
|
-
function
|
|
2489
|
-
return new
|
|
2483
|
+
function Si(e, t) {
|
|
2484
|
+
return new Ei({
|
|
2490
2485
|
type: "default",
|
|
2491
2486
|
innerType: e,
|
|
2492
2487
|
get defaultValue() {
|
|
2493
|
-
return typeof t == "function" ? t() :
|
|
2488
|
+
return typeof t == "function" ? t() : Xe(t);
|
|
2494
2489
|
}
|
|
2495
2490
|
});
|
|
2496
2491
|
}
|
|
2497
|
-
|
|
2498
|
-
const
|
|
2499
|
-
|
|
2492
|
+
a(Si, "_default");
|
|
2493
|
+
const Oi = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
|
|
2494
|
+
Ao.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2500
2495
|
});
|
|
2501
|
-
function
|
|
2502
|
-
return new
|
|
2496
|
+
function Pi(e, t) {
|
|
2497
|
+
return new Oi({
|
|
2503
2498
|
type: "prefault",
|
|
2504
2499
|
innerType: e,
|
|
2505
2500
|
get defaultValue() {
|
|
2506
|
-
return typeof t == "function" ? t() :
|
|
2501
|
+
return typeof t == "function" ? t() : Xe(t);
|
|
2507
2502
|
}
|
|
2508
2503
|
});
|
|
2509
2504
|
}
|
|
2510
|
-
|
|
2511
|
-
const
|
|
2512
|
-
|
|
2505
|
+
a(Pi, "prefault");
|
|
2506
|
+
const bt = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
|
|
2507
|
+
Eo.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2513
2508
|
});
|
|
2514
|
-
function
|
|
2515
|
-
return new
|
|
2509
|
+
function Ti(e, t) {
|
|
2510
|
+
return new bt({
|
|
2516
2511
|
type: "nonoptional",
|
|
2517
2512
|
innerType: e,
|
|
2518
|
-
...
|
|
2513
|
+
...d(t)
|
|
2519
2514
|
});
|
|
2520
2515
|
}
|
|
2521
|
-
|
|
2522
|
-
const
|
|
2523
|
-
|
|
2516
|
+
a(Ti, "nonoptional");
|
|
2517
|
+
const xi = /* @__PURE__ */ u("ZodCatch", (e, t) => {
|
|
2518
|
+
So.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2524
2519
|
});
|
|
2525
|
-
function
|
|
2526
|
-
return new
|
|
2520
|
+
function Ni(e, t) {
|
|
2521
|
+
return new xi({
|
|
2527
2522
|
type: "catch",
|
|
2528
2523
|
innerType: e,
|
|
2529
2524
|
catchValue: typeof t == "function" ? t : () => t
|
|
2530
2525
|
});
|
|
2531
2526
|
}
|
|
2532
|
-
|
|
2533
|
-
const
|
|
2534
|
-
|
|
2527
|
+
a(Ni, "_catch");
|
|
2528
|
+
const ji = /* @__PURE__ */ u("ZodPipe", (e, t) => {
|
|
2529
|
+
Oo.init(e, t), g.init(e, t), e.in = t.in, e.out = t.out;
|
|
2535
2530
|
});
|
|
2536
|
-
function
|
|
2537
|
-
return new
|
|
2531
|
+
function Je(e, t) {
|
|
2532
|
+
return new ji({
|
|
2538
2533
|
type: "pipe",
|
|
2539
2534
|
in: e,
|
|
2540
2535
|
out: t
|
|
2541
2536
|
// ...util.normalizeParams(params),
|
|
2542
2537
|
});
|
|
2543
2538
|
}
|
|
2544
|
-
|
|
2545
|
-
const
|
|
2546
|
-
|
|
2539
|
+
a(Je, "pipe");
|
|
2540
|
+
const Di = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
|
|
2541
|
+
Po.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2547
2542
|
});
|
|
2548
|
-
function
|
|
2549
|
-
return new
|
|
2543
|
+
function Ci(e) {
|
|
2544
|
+
return new Di({
|
|
2550
2545
|
type: "readonly",
|
|
2551
2546
|
innerType: e
|
|
2552
2547
|
});
|
|
2553
2548
|
}
|
|
2554
|
-
|
|
2555
|
-
const
|
|
2556
|
-
|
|
2549
|
+
a(Ci, "readonly");
|
|
2550
|
+
const Fi = /* @__PURE__ */ u("ZodCustom", (e, t) => {
|
|
2551
|
+
To.init(e, t), g.init(e, t);
|
|
2557
2552
|
});
|
|
2558
|
-
function
|
|
2559
|
-
return
|
|
2553
|
+
function Ri(e, t = {}) {
|
|
2554
|
+
return $r(Fi, e, t);
|
|
2560
2555
|
}
|
|
2561
|
-
|
|
2562
|
-
function
|
|
2563
|
-
return
|
|
2556
|
+
a(Ri, "refine");
|
|
2557
|
+
function Ui(e) {
|
|
2558
|
+
return yr(e);
|
|
2564
2559
|
}
|
|
2565
|
-
|
|
2566
|
-
const
|
|
2560
|
+
a(Ui, "superRefine");
|
|
2561
|
+
const Li = k(["image", "video", "audio"]), Mi = k(["avatar", "cover", "voice", "general"]), Vi = k(["processing", "active", "failed", "deleted"]), Bi = k(["jpg", "jpeg", "png", "gif", "webp", "svg"]), Wi = k(["mp4", "webm", "ogg", "mov", "avi"]), Gi = k(["mp3", "wav", "ogg", "aac", "flac"]), Ji = Z({
|
|
2567
2562
|
mediaId: l(),
|
|
2568
2563
|
userId: l(),
|
|
2569
2564
|
orgId: l(),
|
|
2570
2565
|
selfId: l().nullable().optional(),
|
|
2571
2566
|
filename: l(),
|
|
2572
2567
|
mimeType: l(),
|
|
2573
|
-
size:
|
|
2568
|
+
size: I(),
|
|
2574
2569
|
src: l(),
|
|
2575
2570
|
alt: l().optional(),
|
|
2576
|
-
context:
|
|
2577
|
-
status:
|
|
2571
|
+
context: Mi.default("general"),
|
|
2572
|
+
status: Vi.default("processing"),
|
|
2578
2573
|
createdAt: l().optional(),
|
|
2579
2574
|
// ISO string for JSON compatibility
|
|
2580
2575
|
updatedAt: l().optional()
|
|
2581
2576
|
// ISO string for JSON compatibility
|
|
2582
|
-
}),
|
|
2577
|
+
}), x = Ji.extend({
|
|
2583
2578
|
// Additional UI fields not in database
|
|
2584
|
-
format:
|
|
2579
|
+
format: Li.optional(),
|
|
2585
2580
|
// Derived from mimeType
|
|
2586
2581
|
className: l().optional(),
|
|
2587
2582
|
// CSS classes for rendering
|
|
2588
2583
|
// Image/video dimensions
|
|
2589
|
-
width:
|
|
2590
|
-
height:
|
|
2584
|
+
width: I().optional(),
|
|
2585
|
+
height: I().optional(),
|
|
2591
2586
|
// Audio/video duration
|
|
2592
|
-
duration:
|
|
2587
|
+
duration: I().optional(),
|
|
2593
2588
|
// Image blur hash for loading placeholders
|
|
2594
2589
|
blurhash: l().optional()
|
|
2595
|
-
}).partial(),
|
|
2596
|
-
duration:
|
|
2590
|
+
}).partial(), Ki = Z({
|
|
2591
|
+
duration: I().optional(),
|
|
2597
2592
|
// in seconds
|
|
2598
2593
|
thumbnail: l().optional(),
|
|
2599
|
-
autoplay:
|
|
2600
|
-
loop:
|
|
2601
|
-
muted:
|
|
2602
|
-
controls:
|
|
2603
|
-
}),
|
|
2604
|
-
duration:
|
|
2594
|
+
autoplay: y().optional(),
|
|
2595
|
+
loop: y().optional(),
|
|
2596
|
+
muted: y().optional(),
|
|
2597
|
+
controls: y().optional()
|
|
2598
|
+
}), Yi = Z({
|
|
2599
|
+
duration: I().optional(),
|
|
2605
2600
|
// in seconds
|
|
2606
|
-
autoplay:
|
|
2607
|
-
loop:
|
|
2608
|
-
muted:
|
|
2609
|
-
controls:
|
|
2610
|
-
}),
|
|
2611
|
-
format:
|
|
2612
|
-
imageFormat:
|
|
2613
|
-
}),
|
|
2614
|
-
format:
|
|
2615
|
-
videoFormat:
|
|
2616
|
-
video:
|
|
2617
|
-
}),
|
|
2618
|
-
format:
|
|
2619
|
-
audioFormat:
|
|
2620
|
-
audio:
|
|
2601
|
+
autoplay: y().optional(),
|
|
2602
|
+
loop: y().optional(),
|
|
2603
|
+
muted: y().optional(),
|
|
2604
|
+
controls: y().optional()
|
|
2605
|
+
}), Xi = x.extend({
|
|
2606
|
+
format: G("image"),
|
|
2607
|
+
imageFormat: Bi
|
|
2608
|
+
}), qi = x.extend({
|
|
2609
|
+
format: G("video"),
|
|
2610
|
+
videoFormat: Wi,
|
|
2611
|
+
video: Ki.optional()
|
|
2612
|
+
}), Hi = x.extend({
|
|
2613
|
+
format: G("audio"),
|
|
2614
|
+
audioFormat: Gi,
|
|
2615
|
+
audio: Yi.optional()
|
|
2621
2616
|
});
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2617
|
+
vt("format", [
|
|
2618
|
+
Xi,
|
|
2619
|
+
qi,
|
|
2620
|
+
Hi
|
|
2626
2621
|
]);
|
|
2627
|
-
const
|
|
2622
|
+
const zt = k(["xxs", "xs", "sm", "md", "lg", "xl"]), wt = k(["primary", "default", "overlay", "red", "green", "indigo", "orange"]), kt = k(["ghost", "link", "outline", "solid"]), Qi = Z({
|
|
2628
2623
|
key: l().optional(),
|
|
2629
2624
|
label: l().optional(),
|
|
2630
2625
|
href: l().optional(),
|
|
2631
|
-
size:
|
|
2632
|
-
theme:
|
|
2633
|
-
design:
|
|
2634
|
-
icon:
|
|
2635
|
-
iconAfter:
|
|
2636
|
-
rounding:
|
|
2637
|
-
loading:
|
|
2638
|
-
disabled:
|
|
2639
|
-
onClick:
|
|
2626
|
+
size: zt.optional(),
|
|
2627
|
+
theme: wt.optional(),
|
|
2628
|
+
design: kt.optional(),
|
|
2629
|
+
icon: re([l(), x]).optional(),
|
|
2630
|
+
iconAfter: re([l(), x]).optional(),
|
|
2631
|
+
rounding: k(["full", "md", "lg"]).optional(),
|
|
2632
|
+
loading: y().optional(),
|
|
2633
|
+
disabled: y().optional(),
|
|
2634
|
+
onClick: oe().optional(),
|
|
2640
2635
|
// Function type
|
|
2641
2636
|
testId: l().optional(),
|
|
2642
|
-
target:
|
|
2643
|
-
type:
|
|
2637
|
+
target: k(["_blank", "_self"]).optional(),
|
|
2638
|
+
type: k(["button", "submit", "reset"]).optional()
|
|
2644
2639
|
});
|
|
2645
|
-
|
|
2646
|
-
buttons:
|
|
2647
|
-
size:
|
|
2648
|
-
theme:
|
|
2649
|
-
design:
|
|
2640
|
+
Z({
|
|
2641
|
+
buttons: N(Qi).optional(),
|
|
2642
|
+
size: zt.optional(),
|
|
2643
|
+
theme: wt.optional(),
|
|
2644
|
+
design: kt.optional()
|
|
2650
2645
|
});
|
|
2651
|
-
|
|
2646
|
+
Z({
|
|
2652
2647
|
// Database fields (core identity)
|
|
2653
2648
|
userId: l(),
|
|
2654
2649
|
email: l(),
|
|
@@ -2656,74 +2651,74 @@ y({
|
|
|
2656
2651
|
fullName: l().optional(),
|
|
2657
2652
|
avatar: l().optional(),
|
|
2658
2653
|
// Authentication & verification
|
|
2659
|
-
emailVerified:
|
|
2660
|
-
hasPassword:
|
|
2654
|
+
emailVerified: y().optional(),
|
|
2655
|
+
hasPassword: y().optional(),
|
|
2661
2656
|
// Primary relationships
|
|
2662
2657
|
primaryOrgId: l().optional(),
|
|
2663
2658
|
primarySelfId: l().optional(),
|
|
2664
2659
|
// Status & activity
|
|
2665
2660
|
status: l().optional(),
|
|
2666
|
-
lastSeenAt:
|
|
2661
|
+
lastSeenAt: fe().optional(),
|
|
2667
2662
|
// Virtual/computed fields
|
|
2668
|
-
onboarded:
|
|
2669
|
-
selfCount:
|
|
2663
|
+
onboarded: y().optional(),
|
|
2664
|
+
selfCount: I().optional(),
|
|
2670
2665
|
// Nested relationships (for enriched responses)
|
|
2671
|
-
memberships:
|
|
2666
|
+
memberships: N(Z({
|
|
2672
2667
|
membershipId: l(),
|
|
2673
2668
|
orgId: l(),
|
|
2674
2669
|
orgName: l(),
|
|
2675
2670
|
orgHandle: l(),
|
|
2676
|
-
role:
|
|
2677
|
-
joinedAt:
|
|
2671
|
+
role: k(["admin", "member"]),
|
|
2672
|
+
joinedAt: fe()
|
|
2678
2673
|
})).optional(),
|
|
2679
|
-
selves:
|
|
2674
|
+
selves: N(Z({
|
|
2680
2675
|
selfId: l(),
|
|
2681
2676
|
handle: l(),
|
|
2682
2677
|
title: l().optional(),
|
|
2683
|
-
visibility:
|
|
2678
|
+
visibility: k(["public", "private"]).optional(),
|
|
2684
2679
|
orgId: l().optional()
|
|
2685
2680
|
})).optional(),
|
|
2686
2681
|
// Timestamps
|
|
2687
2682
|
createdAt: l().optional(),
|
|
2688
2683
|
updatedAt: l().optional()
|
|
2689
2684
|
}).partial();
|
|
2690
|
-
|
|
2685
|
+
Z({
|
|
2691
2686
|
// Database fields
|
|
2692
2687
|
orgId: l(),
|
|
2693
2688
|
name: l(),
|
|
2694
2689
|
handle: l(),
|
|
2695
2690
|
ownerId: l(),
|
|
2696
2691
|
// Settings & configuration
|
|
2697
|
-
isPersonal:
|
|
2692
|
+
isPersonal: y().optional(),
|
|
2698
2693
|
description: l().optional(),
|
|
2699
2694
|
website: l().optional(),
|
|
2700
2695
|
avatar: l().optional(),
|
|
2701
2696
|
// Billing & subscription
|
|
2702
2697
|
stripeCustomerId: l().optional(),
|
|
2703
|
-
subscriptionStatus:
|
|
2698
|
+
subscriptionStatus: k(["trial", "active", "canceled", "past_due"]).optional(),
|
|
2704
2699
|
trialEndsAt: l().optional(),
|
|
2705
2700
|
// Virtual/computed fields
|
|
2706
|
-
memberCount:
|
|
2707
|
-
selfCount:
|
|
2701
|
+
memberCount: I().optional(),
|
|
2702
|
+
selfCount: I().optional(),
|
|
2708
2703
|
// Nested relationships
|
|
2709
|
-
members:
|
|
2704
|
+
members: N(Z({
|
|
2710
2705
|
userId: l(),
|
|
2711
2706
|
fullName: l().optional(),
|
|
2712
2707
|
email: l(),
|
|
2713
|
-
role:
|
|
2708
|
+
role: k(["admin", "member"]),
|
|
2714
2709
|
joinedAt: l()
|
|
2715
2710
|
})).optional(),
|
|
2716
|
-
selves:
|
|
2711
|
+
selves: N(Z({
|
|
2717
2712
|
selfId: l(),
|
|
2718
2713
|
handle: l(),
|
|
2719
2714
|
title: l().optional(),
|
|
2720
|
-
visibility:
|
|
2715
|
+
visibility: k(["public", "private"]).optional()
|
|
2721
2716
|
})).optional(),
|
|
2722
2717
|
// Timestamps
|
|
2723
2718
|
createdAt: l().optional(),
|
|
2724
2719
|
updatedAt: l().optional()
|
|
2725
2720
|
}).partial();
|
|
2726
|
-
|
|
2721
|
+
Z({
|
|
2727
2722
|
// Database fields
|
|
2728
2723
|
selfId: l(),
|
|
2729
2724
|
handle: l(),
|
|
@@ -2733,26 +2728,26 @@ y({
|
|
|
2733
2728
|
userId: l(),
|
|
2734
2729
|
orgId: l().optional(),
|
|
2735
2730
|
// Configuration
|
|
2736
|
-
visibility:
|
|
2731
|
+
visibility: k(["public", "private"]).optional(),
|
|
2737
2732
|
prompt: l().optional(),
|
|
2738
2733
|
// Media & voice
|
|
2739
2734
|
avatar: l().optional(),
|
|
2740
2735
|
voiceId: l().optional(),
|
|
2741
|
-
voiceSettings:
|
|
2742
|
-
speed:
|
|
2743
|
-
pitch:
|
|
2744
|
-
volume:
|
|
2736
|
+
voiceSettings: Z({
|
|
2737
|
+
speed: I().optional(),
|
|
2738
|
+
pitch: I().optional(),
|
|
2739
|
+
volume: I().optional()
|
|
2745
2740
|
}).optional(),
|
|
2746
2741
|
// Virtual/computed fields
|
|
2747
|
-
interactionCount:
|
|
2748
|
-
lastActiveAt:
|
|
2742
|
+
interactionCount: I().optional(),
|
|
2743
|
+
lastActiveAt: fe().optional(),
|
|
2749
2744
|
// Nested relationships
|
|
2750
|
-
owner:
|
|
2745
|
+
owner: Z({
|
|
2751
2746
|
userId: l(),
|
|
2752
2747
|
fullName: l().optional(),
|
|
2753
2748
|
handle: l().optional()
|
|
2754
2749
|
}).optional(),
|
|
2755
|
-
org:
|
|
2750
|
+
org: Z({
|
|
2756
2751
|
orgId: l(),
|
|
2757
2752
|
name: l(),
|
|
2758
2753
|
handle: l()
|
|
@@ -2761,19 +2756,19 @@ y({
|
|
|
2761
2756
|
createdAt: l().optional(),
|
|
2762
2757
|
updatedAt: l().optional()
|
|
2763
2758
|
}).partial();
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
ok:
|
|
2767
|
-
data:
|
|
2759
|
+
vt("ok", [
|
|
2760
|
+
Z({
|
|
2761
|
+
ok: G(!0),
|
|
2762
|
+
data: oe(),
|
|
2768
2763
|
message: l().optional()
|
|
2769
2764
|
}),
|
|
2770
|
-
|
|
2771
|
-
ok:
|
|
2765
|
+
Z({
|
|
2766
|
+
ok: G(!1),
|
|
2772
2767
|
error: l(),
|
|
2773
2768
|
code: l().optional()
|
|
2774
2769
|
})
|
|
2775
2770
|
]);
|
|
2776
|
-
const
|
|
2771
|
+
const ec = Z({
|
|
2777
2772
|
// Core content
|
|
2778
2773
|
key: l().optional(),
|
|
2779
2774
|
id: l().optional(),
|
|
@@ -2782,574 +2777,40 @@ const za = y({
|
|
|
2782
2777
|
// Screen reader label
|
|
2783
2778
|
subLabel: l().optional(),
|
|
2784
2779
|
// Secondary text
|
|
2785
|
-
value:
|
|
2780
|
+
value: re([l(), I()]).optional(),
|
|
2786
2781
|
description: l().optional(),
|
|
2787
2782
|
info: l().optional(),
|
|
2788
|
-
count:
|
|
2783
|
+
count: I().optional(),
|
|
2789
2784
|
className: l().optional(),
|
|
2790
2785
|
// Visual elements
|
|
2791
|
-
media:
|
|
2792
|
-
icon:
|
|
2793
|
-
iconAfter:
|
|
2786
|
+
media: x.optional(),
|
|
2787
|
+
icon: x.optional(),
|
|
2788
|
+
iconAfter: x.optional(),
|
|
2794
2789
|
// Navigation
|
|
2795
2790
|
href: l().optional(),
|
|
2796
|
-
target:
|
|
2797
|
-
onClick:
|
|
2791
|
+
target: k(["_self", "_blank"]).optional(),
|
|
2792
|
+
onClick: oe().optional(),
|
|
2798
2793
|
// Function type
|
|
2799
2794
|
// Styling
|
|
2800
|
-
theme:
|
|
2795
|
+
theme: k(["primary", "default"]).optional(),
|
|
2801
2796
|
// State
|
|
2802
|
-
isActive:
|
|
2803
|
-
isDisabled:
|
|
2804
|
-
isHidden:
|
|
2797
|
+
isActive: y().optional(),
|
|
2798
|
+
isDisabled: y().optional(),
|
|
2799
|
+
isHidden: y().optional(),
|
|
2805
2800
|
// Organization
|
|
2806
|
-
priority:
|
|
2801
|
+
priority: I().optional(),
|
|
2807
2802
|
testId: l().optional(),
|
|
2808
2803
|
// Simple nested items (one level only)
|
|
2809
|
-
items:
|
|
2804
|
+
items: N(oe()).optional()
|
|
2810
2805
|
// Avoid recursive schema issues
|
|
2811
2806
|
});
|
|
2812
|
-
|
|
2807
|
+
Z({
|
|
2813
2808
|
title: l().optional(),
|
|
2814
2809
|
description: l().optional(),
|
|
2815
|
-
items:
|
|
2810
|
+
items: N(ec).optional()
|
|
2816
2811
|
});
|
|
2817
|
-
const Ne = class Ne {
|
|
2818
|
-
constructor() {
|
|
2819
|
-
// Configuration properties
|
|
2820
|
-
Z(this, "tokenName", "auth-token");
|
|
2821
|
-
Z(this, "tokenMaxAge", 3600 * 24 * 7);
|
|
2822
|
-
// 7 days
|
|
2823
|
-
Z(this, "fallbackStorageKey", "token");
|
|
2824
|
-
// For localStorage migration
|
|
2825
|
-
Z(this, "productionDomain", ".fiction.com");
|
|
2826
|
-
}
|
|
2827
|
-
/**
|
|
2828
|
-
* Get cookie value by name
|
|
2829
|
-
*/
|
|
2830
|
-
getCookie(t) {
|
|
2831
|
-
if (typeof document > "u")
|
|
2832
|
-
return null;
|
|
2833
|
-
const n = document.cookie.split(";");
|
|
2834
|
-
for (const o of n) {
|
|
2835
|
-
const [r, i] = o.trim().split("=");
|
|
2836
|
-
if (r === t)
|
|
2837
|
-
return decodeURIComponent(i || "");
|
|
2838
|
-
}
|
|
2839
|
-
return null;
|
|
2840
|
-
}
|
|
2841
|
-
/**
|
|
2842
|
-
* Set cookie with secure defaults
|
|
2843
|
-
*/
|
|
2844
|
-
setCookie(t, n, o = {}) {
|
|
2845
|
-
if (typeof document > "u")
|
|
2846
|
-
return;
|
|
2847
|
-
const {
|
|
2848
|
-
secure: r = !0,
|
|
2849
|
-
sameSite: i = "lax",
|
|
2850
|
-
maxAge: a = 3600 * 24 * 7,
|
|
2851
|
-
// 7 days default
|
|
2852
|
-
domain: u,
|
|
2853
|
-
path: d = "/"
|
|
2854
|
-
} = o;
|
|
2855
|
-
let p = `${t}=${encodeURIComponent(n)}`;
|
|
2856
|
-
p += `; Path=${d}`, p += `; Max-Age=${a}`, p += `; SameSite=${i}`, r && (p += "; Secure"), u && (p += `; Domain=${u}`), document.cookie = p;
|
|
2857
|
-
}
|
|
2858
|
-
/**
|
|
2859
|
-
* Remove cookie by setting expired date
|
|
2860
|
-
*/
|
|
2861
|
-
removeCookie(t, n = {}) {
|
|
2862
|
-
this.setCookie(t, "", { ...n, maxAge: 0 });
|
|
2863
|
-
}
|
|
2864
|
-
/**
|
|
2865
|
-
* Get auth token with fallback to localStorage for migration
|
|
2866
|
-
*/
|
|
2867
|
-
getAuthToken() {
|
|
2868
|
-
const t = this.getCookie(this.tokenName);
|
|
2869
|
-
if (t)
|
|
2870
|
-
return t;
|
|
2871
|
-
if (typeof localStorage < "u") {
|
|
2872
|
-
const n = localStorage.getItem(this.fallbackStorageKey);
|
|
2873
|
-
if (n)
|
|
2874
|
-
return this.setAuthToken(n), localStorage.removeItem(this.fallbackStorageKey), n;
|
|
2875
|
-
}
|
|
2876
|
-
return null;
|
|
2877
|
-
}
|
|
2878
|
-
/**
|
|
2879
|
-
* Set auth token in cookie with production-ready settings
|
|
2880
|
-
*/
|
|
2881
|
-
setAuthToken(t) {
|
|
2882
|
-
const n = typeof window < "u" && window.location.hostname !== "localhost";
|
|
2883
|
-
this.setCookie(this.tokenName, t, {
|
|
2884
|
-
secure: n,
|
|
2885
|
-
sameSite: "lax",
|
|
2886
|
-
maxAge: this.tokenMaxAge,
|
|
2887
|
-
domain: n ? this.productionDomain : void 0,
|
|
2888
|
-
path: "/"
|
|
2889
|
-
});
|
|
2890
|
-
}
|
|
2891
|
-
/**
|
|
2892
|
-
* Remove auth token
|
|
2893
|
-
*/
|
|
2894
|
-
removeAuthToken() {
|
|
2895
|
-
const t = typeof window < "u" && window.location.hostname !== "localhost";
|
|
2896
|
-
this.removeCookie(this.tokenName, {
|
|
2897
|
-
domain: t ? this.productionDomain : void 0,
|
|
2898
|
-
path: "/"
|
|
2899
|
-
}), typeof localStorage < "u" && localStorage.removeItem(this.fallbackStorageKey);
|
|
2900
|
-
}
|
|
2901
|
-
};
|
|
2902
|
-
s(Ne, "CookieUtil");
|
|
2903
|
-
let $e = Ne;
|
|
2904
|
-
const G = new $e();
|
|
2905
|
-
function ya(e, t) {
|
|
2906
|
-
const n = e.apiBase || (e.isDev ? "http://localhost:5555" : "https://app.fiction.com");
|
|
2907
|
-
return Jt(n, {
|
|
2908
|
-
fetch: /* @__PURE__ */ s(async (r, i) => {
|
|
2909
|
-
const a = await fetch(r, {
|
|
2910
|
-
...i,
|
|
2911
|
-
credentials: "include",
|
|
2912
|
-
headers: {
|
|
2913
|
-
...i?.headers,
|
|
2914
|
-
"Content-Type": "application/json",
|
|
2915
|
-
Authorization: `Bearer ${G.getAuthToken() || ""}`
|
|
2916
|
-
}
|
|
2917
|
-
});
|
|
2918
|
-
if (t) {
|
|
2919
|
-
const u = a.json.bind(a), d = a.clone();
|
|
2920
|
-
return Object.defineProperty(d, "json", {
|
|
2921
|
-
value: /* @__PURE__ */ s(async () => {
|
|
2922
|
-
const p = await u();
|
|
2923
|
-
return typeof p == "object" && p !== null && "ok" in p && ("user" in p || "token" in p) && t(p), p;
|
|
2924
|
-
}, "value")
|
|
2925
|
-
}), d;
|
|
2926
|
-
}
|
|
2927
|
-
return a;
|
|
2928
|
-
}, "fetch")
|
|
2929
|
-
});
|
|
2930
|
-
}
|
|
2931
|
-
s(ya, "createApiClient");
|
|
2932
|
-
let $a = Symbol("clean"), j = [], x = 0;
|
|
2933
|
-
const oe = 4;
|
|
2934
|
-
let Lt = /* @__PURE__ */ s((e) => {
|
|
2935
|
-
let t = [], n = {
|
|
2936
|
-
get() {
|
|
2937
|
-
return n.lc || n.listen(() => {
|
|
2938
|
-
})(), n.value;
|
|
2939
|
-
},
|
|
2940
|
-
lc: 0,
|
|
2941
|
-
listen(o) {
|
|
2942
|
-
return n.lc = t.push(o), () => {
|
|
2943
|
-
for (let i = x + oe; i < j.length; )
|
|
2944
|
-
j[i] === o ? j.splice(i, oe) : i += oe;
|
|
2945
|
-
let r = t.indexOf(o);
|
|
2946
|
-
~r && (t.splice(r, 1), --n.lc || n.off());
|
|
2947
|
-
};
|
|
2948
|
-
},
|
|
2949
|
-
notify(o, r) {
|
|
2950
|
-
let i = !j.length;
|
|
2951
|
-
for (let a of t)
|
|
2952
|
-
j.push(a, n.value, o, r);
|
|
2953
|
-
if (i) {
|
|
2954
|
-
for (x = 0; x < j.length; x += oe)
|
|
2955
|
-
j[x](
|
|
2956
|
-
j[x + 1],
|
|
2957
|
-
j[x + 2],
|
|
2958
|
-
j[x + 3]
|
|
2959
|
-
);
|
|
2960
|
-
j.length = 0;
|
|
2961
|
-
}
|
|
2962
|
-
},
|
|
2963
|
-
/* It will be called on last listener unsubscribing.
|
|
2964
|
-
We will redefine it in onMount and onStop. */
|
|
2965
|
-
off() {
|
|
2966
|
-
},
|
|
2967
|
-
set(o) {
|
|
2968
|
-
let r = n.value;
|
|
2969
|
-
r !== o && (n.value = o, n.notify(r));
|
|
2970
|
-
},
|
|
2971
|
-
subscribe(o) {
|
|
2972
|
-
let r = n.listen(o);
|
|
2973
|
-
return o(n.value), r;
|
|
2974
|
-
},
|
|
2975
|
-
value: e
|
|
2976
|
-
};
|
|
2977
|
-
return process.env.NODE_ENV !== "production" && (n[$a] = () => {
|
|
2978
|
-
t = [], n.lc = 0, n.off();
|
|
2979
|
-
}), n;
|
|
2980
|
-
}, "atom");
|
|
2981
|
-
const re = Lt(void 0), ie = Lt(null), Ue = class Ue {
|
|
2982
|
-
constructor() {
|
|
2983
|
-
Z(this, "logger", Wt("SDKStorage"));
|
|
2984
|
-
}
|
|
2985
|
-
/**
|
|
2986
|
-
* Sync Vue reactive refs with global nanostores for cross-page persistence
|
|
2987
|
-
*/
|
|
2988
|
-
syncWithGlobalStores(t, n) {
|
|
2989
|
-
const o = re.get(), r = ie.get();
|
|
2990
|
-
o && (t.value = o), r && (n.value = r), Me(t, (i) => {
|
|
2991
|
-
re.set(i);
|
|
2992
|
-
}, { immediate: !0 }), Me(n, (i) => {
|
|
2993
|
-
ie.set(i);
|
|
2994
|
-
}, { immediate: !0 }), re.subscribe((i) => {
|
|
2995
|
-
i !== t.value && (t.value = i);
|
|
2996
|
-
}), ie.subscribe((i) => {
|
|
2997
|
-
i !== n.value && (n.value = i);
|
|
2998
|
-
});
|
|
2999
|
-
}
|
|
3000
|
-
/**
|
|
3001
|
-
* Load user and token from browser storage on initialization
|
|
3002
|
-
*/
|
|
3003
|
-
loadFromStorage(t, n) {
|
|
3004
|
-
if (typeof window > "u")
|
|
3005
|
-
return;
|
|
3006
|
-
const o = G.getAuthToken();
|
|
3007
|
-
o && (n.value = o);
|
|
3008
|
-
try {
|
|
3009
|
-
const r = localStorage.getItem("fiction-user");
|
|
3010
|
-
r && (t.value = JSON.parse(r));
|
|
3011
|
-
} catch (r) {
|
|
3012
|
-
this.logger.error("Failed to load user from localStorage", { data: r });
|
|
3013
|
-
}
|
|
3014
|
-
}
|
|
3015
|
-
/**
|
|
3016
|
-
* Save current user and token to browser storage
|
|
3017
|
-
*/
|
|
3018
|
-
saveToStorage(t, n) {
|
|
3019
|
-
if (!(typeof window > "u")) {
|
|
3020
|
-
n.value ? G.setAuthToken(n.value) : G.removeAuthToken();
|
|
3021
|
-
try {
|
|
3022
|
-
t.value ? localStorage.setItem("fiction-user", JSON.stringify(t.value)) : localStorage.removeItem("fiction-user");
|
|
3023
|
-
} catch (o) {
|
|
3024
|
-
this.logger.error("Failed to save user to localStorage", { data: o });
|
|
3025
|
-
}
|
|
3026
|
-
}
|
|
3027
|
-
}
|
|
3028
|
-
/**
|
|
3029
|
-
* Clear all stored user data and tokens
|
|
3030
|
-
*/
|
|
3031
|
-
clearStorage() {
|
|
3032
|
-
if (!(typeof window > "u")) {
|
|
3033
|
-
G.removeAuthToken();
|
|
3034
|
-
try {
|
|
3035
|
-
localStorage.removeItem("fiction-user");
|
|
3036
|
-
} catch (t) {
|
|
3037
|
-
this.logger.error("Failed to clear user from localStorage", { data: t });
|
|
3038
|
-
}
|
|
3039
|
-
re.set(void 0), ie.set(null);
|
|
3040
|
-
}
|
|
3041
|
-
}
|
|
3042
|
-
/**
|
|
3043
|
-
* Generic localStorage getter
|
|
3044
|
-
*/
|
|
3045
|
-
getItem(t) {
|
|
3046
|
-
if (typeof window > "u")
|
|
3047
|
-
return null;
|
|
3048
|
-
try {
|
|
3049
|
-
return localStorage.getItem(t);
|
|
3050
|
-
} catch (n) {
|
|
3051
|
-
return this.logger.error("Failed to get item from localStorage", { key: t, error: n }), null;
|
|
3052
|
-
}
|
|
3053
|
-
}
|
|
3054
|
-
/**
|
|
3055
|
-
* Generic localStorage setter
|
|
3056
|
-
*/
|
|
3057
|
-
setItem(t, n) {
|
|
3058
|
-
if (!(typeof window > "u"))
|
|
3059
|
-
try {
|
|
3060
|
-
localStorage.setItem(t, n);
|
|
3061
|
-
} catch (o) {
|
|
3062
|
-
this.logger.error("Failed to set item in localStorage", { key: t, error: o });
|
|
3063
|
-
}
|
|
3064
|
-
}
|
|
3065
|
-
};
|
|
3066
|
-
s(Ue, "SDKStorage");
|
|
3067
|
-
let Ze = Ue;
|
|
3068
|
-
const De = class De extends Gt {
|
|
3069
|
-
constructor(n = {}) {
|
|
3070
|
-
super("FictionSDK", n);
|
|
3071
|
-
// Vue reactive state
|
|
3072
|
-
Z(this, "activeUser", H());
|
|
3073
|
-
Z(this, "token", H(null));
|
|
3074
|
-
Z(this, "loading", H(!1));
|
|
3075
|
-
Z(this, "error", H(null));
|
|
3076
|
-
Z(this, "apiBase", this.settings.apiBase || void 0);
|
|
3077
|
-
// Storage handler for persistence
|
|
3078
|
-
Z(this, "storage", new Ze());
|
|
3079
|
-
// Auto-managed session ID for usage tracking
|
|
3080
|
-
Z(this, "sessionId", Le({ prefix: "ses" }));
|
|
3081
|
-
// Typed Hono RPC client - uses SDKAppType (auth/self/usage routes only)
|
|
3082
|
-
Z(this, "apiClient");
|
|
3083
|
-
// Computed properties derived from activeUser (matches UserClient pattern)
|
|
3084
|
-
Z(this, "currentSelf", Ve(() => {
|
|
3085
|
-
const n = this.activeUser.value;
|
|
3086
|
-
if (!n?.selves)
|
|
3087
|
-
return;
|
|
3088
|
-
const o = n.primarySelfId || n.selves[0]?.selfId;
|
|
3089
|
-
if (o)
|
|
3090
|
-
return n.selves.find((r) => r.selfId === o);
|
|
3091
|
-
}));
|
|
3092
|
-
Z(this, "currentOrg", Ve(() => {
|
|
3093
|
-
const n = this.currentSelf.value;
|
|
3094
|
-
if (!n?.orgId)
|
|
3095
|
-
return;
|
|
3096
|
-
const o = this.activeUser.value;
|
|
3097
|
-
if (o?.orgs)
|
|
3098
|
-
return o.orgs.find((r) => r.orgId === n.orgId);
|
|
3099
|
-
}));
|
|
3100
|
-
// Initialization state
|
|
3101
|
-
Z(this, "initialized");
|
|
3102
|
-
Z(this, "resolveUser");
|
|
3103
|
-
this.apiClient = ya(
|
|
3104
|
-
{ isDev: this.isDev, apiBase: this.apiBase },
|
|
3105
|
-
this.processApiResponse.bind(this)
|
|
3106
|
-
), this.logger.info("FictionSDK initialized"), this.storage.loadFromStorage(this.activeUser, this.token), this.storage.syncWithGlobalStores(this.activeUser, this.token), this.initialized = new Promise((o) => {
|
|
3107
|
-
this.resolveUser = o;
|
|
3108
|
-
}), this.token.value && !this.activeUser.value ? this.getCurrentUser().then((o) => {
|
|
3109
|
-
this.resolveUser && (this.resolveUser(o), this.resolveUser = void 0);
|
|
3110
|
-
}).catch((o) => {
|
|
3111
|
-
this.logger.error("Auto user fetch failed", { data: o }), this.resolveUser && (this.resolveUser(void 0), this.resolveUser = void 0);
|
|
3112
|
-
}) : this.activeUser.value ? this.resolveUser?.(this.activeUser.value) : this.resolveUser?.(void 0);
|
|
3113
|
-
}
|
|
3114
|
-
get isDev() {
|
|
3115
|
-
return this.settings.isDev ?? (typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1);
|
|
3116
|
-
}
|
|
3117
|
-
// Bypass stub typing for route access (production builds use SDKAppType stub)
|
|
3118
|
-
// Runtime types are validated via Zod at API boundaries
|
|
3119
|
-
get api() {
|
|
3120
|
-
return this.apiClient.api;
|
|
3121
|
-
}
|
|
3122
|
-
// Process ApiResponse for automatic user/token updates - public for dependency injection
|
|
3123
|
-
processApiResponse(n) {
|
|
3124
|
-
n.ok && n.user && (this.activeUser.value = n.user, this.logger.info("User updated from API response", { data: n.user })), n.ok && n.token && (this.token.value = n.token, this.storage.saveToStorage(this.activeUser, this.token), this.logger.info("Token updated from API response")), this.resolveUser && n.ok && (this.resolveUser(n.user), this.resolveUser = void 0);
|
|
3125
|
-
}
|
|
3126
|
-
// Clear all user data and tokens
|
|
3127
|
-
clearSession() {
|
|
3128
|
-
this.logger.info("Clearing session"), this.activeUser.value = void 0, this.token.value = null, this.error.value = null, this.storage.clearStorage();
|
|
3129
|
-
}
|
|
3130
|
-
// Convenience methods for common auth operations
|
|
3131
|
-
async sendCode(n) {
|
|
3132
|
-
this.loading.value = !0, this.error.value = null;
|
|
3133
|
-
try {
|
|
3134
|
-
const r = await (await this.api.auth["check-email"].$post({
|
|
3135
|
-
json: { email: n }
|
|
3136
|
-
})).json();
|
|
3137
|
-
if (!r.ok)
|
|
3138
|
-
throw this.error.value = r.error, new Error(r.error);
|
|
3139
|
-
} catch (o) {
|
|
3140
|
-
this.logger.error("Send code error", { data: o });
|
|
3141
|
-
const r = o instanceof Error ? o.message : "Failed to send verification code";
|
|
3142
|
-
throw this.error.value = r, o;
|
|
3143
|
-
} finally {
|
|
3144
|
-
this.loading.value = !1;
|
|
3145
|
-
}
|
|
3146
|
-
}
|
|
3147
|
-
async verifyCode(n, o) {
|
|
3148
|
-
this.loading.value = !0, this.error.value = null;
|
|
3149
|
-
try {
|
|
3150
|
-
const i = await (await this.api.auth["verify-code"].$post({
|
|
3151
|
-
json: { email: n, code: o }
|
|
3152
|
-
})).json();
|
|
3153
|
-
if (!i.ok)
|
|
3154
|
-
throw this.error.value = i.error, new Error(i.error);
|
|
3155
|
-
} catch (r) {
|
|
3156
|
-
this.logger.error("Verify code error", { data: r });
|
|
3157
|
-
const i = r instanceof Error ? r.message : "Failed to verify code";
|
|
3158
|
-
throw this.error.value = i, r;
|
|
3159
|
-
} finally {
|
|
3160
|
-
this.loading.value = !1;
|
|
3161
|
-
}
|
|
3162
|
-
}
|
|
3163
|
-
async login(n, o) {
|
|
3164
|
-
this.loading.value = !0, this.error.value = null;
|
|
3165
|
-
try {
|
|
3166
|
-
const i = await (await this.api.auth.login.$post({
|
|
3167
|
-
json: { email: n, password: o }
|
|
3168
|
-
})).json();
|
|
3169
|
-
if (!i.ok)
|
|
3170
|
-
throw this.error.value = i.error, new Error(i.error);
|
|
3171
|
-
} catch (r) {
|
|
3172
|
-
this.logger.error("Login error", { data: r });
|
|
3173
|
-
const i = r instanceof Error ? r.message : "Login failed";
|
|
3174
|
-
throw this.error.value = i, r;
|
|
3175
|
-
} finally {
|
|
3176
|
-
this.loading.value = !1;
|
|
3177
|
-
}
|
|
3178
|
-
}
|
|
3179
|
-
async logout() {
|
|
3180
|
-
this.loading.value = !0, this.error.value = null;
|
|
3181
|
-
try {
|
|
3182
|
-
await this.api.auth.logout.$post(), this.activeUser.value = void 0, this.token.value = null, this.storage.clearStorage();
|
|
3183
|
-
} catch (n) {
|
|
3184
|
-
this.logger.error("Logout error (user still logged out locally)", { data: n }), this.activeUser.value = void 0, this.token.value = null, this.storage.clearStorage();
|
|
3185
|
-
} finally {
|
|
3186
|
-
this.loading.value = !1;
|
|
3187
|
-
}
|
|
3188
|
-
}
|
|
3189
|
-
async getCurrentUser() {
|
|
3190
|
-
if (this.token.value) {
|
|
3191
|
-
this.loading.value = !0;
|
|
3192
|
-
try {
|
|
3193
|
-
const o = await (await this.api.auth.me.$get()).json();
|
|
3194
|
-
if (!o.ok) {
|
|
3195
|
-
this.error.value = o.error, o.error.includes("Authentication") && (this.activeUser.value = void 0, this.token.value = null, this.storage.clearStorage());
|
|
3196
|
-
return;
|
|
3197
|
-
}
|
|
3198
|
-
return o.user;
|
|
3199
|
-
} catch (n) {
|
|
3200
|
-
this.logger.error("Get current user error", { data: n }), this.error.value = n instanceof Error ? n.message : "Failed to get user info";
|
|
3201
|
-
return;
|
|
3202
|
-
} finally {
|
|
3203
|
-
this.loading.value = !1;
|
|
3204
|
-
}
|
|
3205
|
-
}
|
|
3206
|
-
}
|
|
3207
|
-
async getPublicSelf(n) {
|
|
3208
|
-
this.loading.value = !0, this.error.value = null;
|
|
3209
|
-
try {
|
|
3210
|
-
const r = await (await this.api.self.public[":handle"].$get({
|
|
3211
|
-
param: { handle: n.handle }
|
|
3212
|
-
})).json();
|
|
3213
|
-
if (!r.ok) {
|
|
3214
|
-
this.error.value = r.error, this.logger.error("Failed to fetch public self", { handle: n.handle, error: r.error });
|
|
3215
|
-
return;
|
|
3216
|
-
}
|
|
3217
|
-
return r.data;
|
|
3218
|
-
} catch (o) {
|
|
3219
|
-
this.logger.error("Get public self error", { handle: n.handle, error: o }), this.error.value = o instanceof Error ? o.message : "Failed to fetch self";
|
|
3220
|
-
return;
|
|
3221
|
-
} finally {
|
|
3222
|
-
this.loading.value = !1;
|
|
3223
|
-
}
|
|
3224
|
-
}
|
|
3225
|
-
async requestAuthCode(n) {
|
|
3226
|
-
this.loading.value = !0, this.error.value = null;
|
|
3227
|
-
try {
|
|
3228
|
-
const r = await (await this.api.auth["check-email"].$post({
|
|
3229
|
-
json: { email: n.email }
|
|
3230
|
-
})).json();
|
|
3231
|
-
return r.ok ? (this.logger.info("Auth code requested successfully", { email: n.email }), !0) : (this.error.value = r.error, this.logger.error("Failed to request auth code", { email: n.email, error: r.error }), !1);
|
|
3232
|
-
} catch (o) {
|
|
3233
|
-
return this.logger.error("Request auth code error", { email: n.email, error: o }), this.error.value = o instanceof Error ? o.message : "Failed to request auth code", !1;
|
|
3234
|
-
} finally {
|
|
3235
|
-
this.loading.value = !1;
|
|
3236
|
-
}
|
|
3237
|
-
}
|
|
3238
|
-
async loginWithCode(n) {
|
|
3239
|
-
this.loading.value = !0, this.error.value = null;
|
|
3240
|
-
try {
|
|
3241
|
-
const r = await (await this.api.auth["verify-code"].$post({
|
|
3242
|
-
json: { email: n.email, code: n.code }
|
|
3243
|
-
})).json();
|
|
3244
|
-
return r.ok ? (this.logger.info("Login successful", { email: n.email }), n.orgId && n.autoCreateContact !== !1 && this.activeUser.value?.userId && await this.autoCreateContact({
|
|
3245
|
-
userId: this.activeUser.value.userId,
|
|
3246
|
-
orgId: n.orgId
|
|
3247
|
-
}), !0) : (this.error.value = r.error, this.logger.error("Login failed", { email: n.email, error: r.error }), !1);
|
|
3248
|
-
} catch (o) {
|
|
3249
|
-
return this.logger.error("Login with code error", { email: n.email, error: o }), this.error.value = o instanceof Error ? o.message : "Login failed", !1;
|
|
3250
|
-
} finally {
|
|
3251
|
-
this.loading.value = !1;
|
|
3252
|
-
}
|
|
3253
|
-
}
|
|
3254
|
-
async trackUsage(n) {
|
|
3255
|
-
try {
|
|
3256
|
-
const o = this.currentSelf.value;
|
|
3257
|
-
if (!o?.orgId)
|
|
3258
|
-
return this.logger.error("Cannot track usage: no current self with orgId", { args: n }), !1;
|
|
3259
|
-
const i = await (await this.api.usage.record.$post({
|
|
3260
|
-
json: {
|
|
3261
|
-
orgId: o.orgId,
|
|
3262
|
-
selfId: n.selfId,
|
|
3263
|
-
sessionId: this.sessionId,
|
|
3264
|
-
// Auto-managed by SDK
|
|
3265
|
-
type: n.type,
|
|
3266
|
-
quantity: n.quantity,
|
|
3267
|
-
// Track the participant if provided, otherwise use current user or anonymous
|
|
3268
|
-
userId: n.participantId || this.activeUser.value?.userId || "anonymous"
|
|
3269
|
-
}
|
|
3270
|
-
})).json();
|
|
3271
|
-
return i.ok ? !0 : (this.logger.error("Failed to track usage", { error: i.error, args: n }), !1);
|
|
3272
|
-
} catch (o) {
|
|
3273
|
-
return this.logger.error("Track usage error", { error: o, args: n }), !1;
|
|
3274
|
-
}
|
|
3275
|
-
}
|
|
3276
|
-
/**
|
|
3277
|
-
* Auto-create contact on authentication
|
|
3278
|
-
* Called internally by loginWithCode - can be disabled with autoCreateContact: false
|
|
3279
|
-
*/
|
|
3280
|
-
async autoCreateContact(n) {
|
|
3281
|
-
try {
|
|
3282
|
-
const r = await (await this.api.contact.resolve.$post({
|
|
3283
|
-
json: { userId: n.userId, orgId: n.orgId }
|
|
3284
|
-
})).json();
|
|
3285
|
-
return r.ok ? (this.logger.info("Contact resolved", { userId: n.userId, orgId: n.orgId }), !0) : (this.logger.error("Failed to auto-create contact", { error: r.error, args: n }), !1);
|
|
3286
|
-
} catch (o) {
|
|
3287
|
-
return this.logger.error("Auto-create contact error", { error: o, args: n }), !1;
|
|
3288
|
-
}
|
|
3289
|
-
}
|
|
3290
|
-
/**
|
|
3291
|
-
* Start conversation session (auto-creates conversation if needed)
|
|
3292
|
-
* Returns conversation data for tracking messages
|
|
3293
|
-
*/
|
|
3294
|
-
async startConversation(n) {
|
|
3295
|
-
try {
|
|
3296
|
-
const o = this.currentSelf.value;
|
|
3297
|
-
if (!o?.orgId) {
|
|
3298
|
-
this.logger.error("Cannot start conversation: no current self with orgId", { args: n });
|
|
3299
|
-
return;
|
|
3300
|
-
}
|
|
3301
|
-
const i = await (await this.api.conversation.start.$post({
|
|
3302
|
-
json: {
|
|
3303
|
-
orgId: o.orgId,
|
|
3304
|
-
selfId: n.selfId,
|
|
3305
|
-
userId: n.userId || this.activeUser.value?.userId,
|
|
3306
|
-
anonId: n.anonId
|
|
3307
|
-
}
|
|
3308
|
-
})).json();
|
|
3309
|
-
if (!i.ok || !i.data) {
|
|
3310
|
-
const a = i.ok ? "No conversation data returned" : "error" in i ? i.error : "Unknown error";
|
|
3311
|
-
this.logger.error("Failed to start conversation", { error: a, args: n });
|
|
3312
|
-
return;
|
|
3313
|
-
}
|
|
3314
|
-
return this.logger.info("Conversation started", { conversationId: i.data.conversationId }), i.data;
|
|
3315
|
-
} catch (o) {
|
|
3316
|
-
this.logger.error("Start conversation error", { error: o, args: n });
|
|
3317
|
-
return;
|
|
3318
|
-
}
|
|
3319
|
-
}
|
|
3320
|
-
/**
|
|
3321
|
-
* Generate anonymous ID for tracking unauthenticated users
|
|
3322
|
-
* Stored in localStorage for persistence across sessions
|
|
3323
|
-
*/
|
|
3324
|
-
generateAnonId() {
|
|
3325
|
-
const n = "fictionAnonId";
|
|
3326
|
-
let o = this.storage.getItem(n);
|
|
3327
|
-
return o || (o = Le({ prefix: "anon" }), this.storage.setItem(n, o)), o;
|
|
3328
|
-
}
|
|
3329
|
-
/**
|
|
3330
|
-
* Save message to conversation
|
|
3331
|
-
* Called by SelfController to persist messages
|
|
3332
|
-
*/
|
|
3333
|
-
async saveMessage(n) {
|
|
3334
|
-
try {
|
|
3335
|
-
const r = await (await this.api.conversation.messages.$post({
|
|
3336
|
-
json: {
|
|
3337
|
-
sessionId: n.conversationId,
|
|
3338
|
-
participantId: n.participantId,
|
|
3339
|
-
content: n.content,
|
|
3340
|
-
role: n.role
|
|
3341
|
-
}
|
|
3342
|
-
})).json();
|
|
3343
|
-
return r.ok ? !0 : (this.logger.error("Failed to save message", { error: "error" in r ? r.error : "Unknown error", args: n }), !1);
|
|
3344
|
-
} catch (o) {
|
|
3345
|
-
return this.logger.error("Save message error", { error: o, args: n }), !1;
|
|
3346
|
-
}
|
|
3347
|
-
}
|
|
3348
|
-
};
|
|
3349
|
-
s(De, "FictionSDK");
|
|
3350
|
-
let dt = De;
|
|
3351
2812
|
export {
|
|
3352
|
-
|
|
3353
|
-
|
|
2813
|
+
rc as FictionSDK,
|
|
2814
|
+
x as MediaSchema
|
|
3354
2815
|
};
|
|
3355
2816
|
//# sourceMappingURL=sdk.js.map
|