@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 CHANGED
@@ -1,70 +1,65 @@
1
- var Re = Object.defineProperty;
2
- var Bt = (e, t, n) => t in e ? Re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var s = (e, t) => Re(e, "name", { value: t, configurable: !0 });
4
- var Z = (e, t, n) => Bt(e, typeof t != "symbol" ? t + "" : t, n);
5
- import { objectId as Le } from "@fiction/utils";
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(d, "_zod", {
13
- value: d._zod ?? {},
7
+ Object.defineProperty(p, "_zod", {
8
+ value: p._zod ?? {},
14
9
  enumerable: !1
15
- }), (f = d._zod).traits ?? (f.traits = /* @__PURE__ */ new Set()), d._zod.traits.add(e), t(d, p);
16
- for (const k in a.prototype)
17
- k in d || Object.defineProperty(d, k, { value: a.prototype[k].bind(d) });
18
- d._zod.constr = a, d._zod.def = p;
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
- s(o, "init");
21
- const r = n?.Parent ?? Object, u = class u extends r {
15
+ a(o, "init");
16
+ const r = n?.Parent ?? Object, s = class s extends r {
22
17
  };
23
- s(u, "Definition");
24
- let i = u;
25
- Object.defineProperty(i, "name", { value: e });
26
- function a(d) {
27
- var p;
28
- const f = n?.Parent ? new i() : this;
29
- o(f, d), (p = f._zod).deferred ?? (p.deferred = []);
30
- for (const k of f._zod.deferred)
31
- k();
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 s(a, "_"), Object.defineProperty(a, "init", { value: o }), Object.defineProperty(a, Symbol.hasInstance, {
35
- value: /* @__PURE__ */ s((d) => n?.Parent && d instanceof n.Parent ? !0 : d?._zod?.traits?.has(e), "value")
36
- }), Object.defineProperty(a, "name", { value: e }), a;
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
- s(c, "$constructor");
39
- const Pe = class Pe extends Error {
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
- s(Pe, "$ZodAsyncError");
45
- let C = Pe;
46
- const Oe = class Oe extends Error {
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
- s(Oe, "$ZodEncodeError");
52
- let ce = Oe;
53
- const pt = {};
54
- function F(e) {
55
- return pt;
56
- }
57
- s(F, "config");
58
- function Kt(e) {
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
- s(Kt, "getEnumValues");
63
- function _e(e, t) {
57
+ a(It, "getEnumValues");
58
+ function le(e, t) {
64
59
  return typeof t == "bigint" ? t.toString() : t;
65
60
  }
66
- s(_e, "jsonStringifyReplacer");
67
- function he(e) {
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
- s(he, "cached");
78
- function Ie(e) {
72
+ a(ie, "cached");
73
+ function _e(e) {
79
74
  return e == null;
80
75
  }
81
- s(Ie, "nullish");
82
- function Se(e) {
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
- s(Se, "cleanRegex");
87
- function qt(e, t) {
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 d = o.match(/\d?e-(\d?)/);
92
- d?.[1] && (r = Number.parseInt(d[1]));
86
+ const p = o.match(/\d?e-(\d?)/);
87
+ p?.[1] && (r = Number.parseInt(p[1]));
93
88
  }
94
- const i = n > r ? n : r, a = Number.parseInt(e.toFixed(i).replace(".", "")), u = Number.parseInt(t.toFixed(i).replace(".", ""));
95
- return a % u / 10 ** i;
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
- s(qt, "floatSafeRemainder");
98
- const Be = Symbol("evaluating");
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 !== Be)
104
- return o === void 0 && (o = Be, o = n()), 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
- s(m, "defineLazy");
116
- function L(e, t, n) {
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
- s(L, "assignProp");
125
- function M(...e) {
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
- s(M, "mergeDefs");
134
- function We(e) {
128
+ a(R, "mergeDefs");
129
+ function Ee(e) {
135
130
  return JSON.stringify(e);
136
131
  }
137
- s(We, "esc");
138
- const ht = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
132
+ a(Ee, "esc");
133
+ const Ye = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
139
134
  };
140
- function J(e) {
135
+ function V(e) {
141
136
  return typeof e == "object" && e !== null && !Array.isArray(e);
142
137
  }
143
- s(J, "isObject");
144
- const Yt = he(() => {
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 K(e) {
155
- if (J(e) === !1)
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 !(J(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
156
+ return !(V(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
162
157
  }
163
- s(K, "isPlainObject");
164
- function ft(e) {
165
- return K(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
158
+ a(B, "isPlainObject");
159
+ function Xe(e) {
160
+ return B(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
166
161
  }
167
- s(ft, "shallowClone");
168
- const Xt = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
169
- function B(e) {
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
- s(B, "escapeRegex");
173
- function D(e, t, n) {
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
- s(D, "clone");
178
- function h(e) {
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__ */ s(() => t, "error") };
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__ */ s(() => t.error, "error") } : t;
184
+ return delete t.message, typeof t.error == "string" ? { ...t, error: /* @__PURE__ */ a(() => t.error, "error") } : t;
190
185
  }
191
- s(h, "normalizeParams");
192
- function Ht(e) {
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
- s(Ht, "optionalKeys");
196
- const Qt = {
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 en(e, t) {
204
- const n = e._zod.def, o = M(e._zod.def, {
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 i in t) {
208
- if (!(i in n.shape))
209
- throw new Error(`Unrecognized key: "${i}"`);
210
- t[i] && (r[i] = n.shape[i]);
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 L(this, "shape", r), r;
207
+ return F(this, "shape", r), r;
213
208
  },
214
209
  checks: []
215
210
  });
216
- return D(e, o);
211
+ return j(e, o);
217
212
  }
218
- s(en, "pick");
219
- function tn(e, t) {
220
- const n = e._zod.def, o = M(e._zod.def, {
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 i in t) {
224
- if (!(i in n.shape))
225
- throw new Error(`Unrecognized key: "${i}"`);
226
- t[i] && delete r[i];
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 L(this, "shape", r), r;
223
+ return F(this, "shape", r), r;
229
224
  },
230
225
  checks: []
231
226
  });
232
- return D(e, o);
227
+ return j(e, o);
233
228
  }
234
- s(tn, "omit");
235
- function nn(e, t) {
236
- if (!K(t))
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 = M(e._zod.def, {
236
+ const r = R(e._zod.def, {
242
237
  get shape() {
243
- const i = { ...e._zod.def.shape, ...t };
244
- return L(this, "shape", i), i;
238
+ const c = { ...e._zod.def.shape, ...t };
239
+ return F(this, "shape", c), c;
245
240
  },
246
241
  checks: []
247
242
  });
248
- return D(e, r);
243
+ return j(e, r);
249
244
  }
250
- s(nn, "extend");
251
- function on(e, t) {
252
- if (!K(t))
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 L(this, "shape", o), o;
253
+ return F(this, "shape", o), o;
259
254
  },
260
255
  checks: e._zod.def.checks
261
256
  };
262
- return D(e, n);
257
+ return j(e, n);
263
258
  }
264
- s(on, "safeExtend");
265
- function rn(e, t) {
266
- const n = M(e._zod.def, {
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 L(this, "shape", o), o;
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 D(e, n);
272
+ return j(e, n);
278
273
  }
279
- s(rn, "merge");
280
- function an(e, t, n) {
281
- const o = M(t._zod.def, {
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, i = { ...r };
278
+ const r = t._zod.def.shape, c = { ...r };
284
279
  if (n)
285
- for (const a in n) {
286
- if (!(a in r))
287
- throw new Error(`Unrecognized key: "${a}"`);
288
- n[a] && (i[a] = e ? new e({
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[a]
291
- }) : r[a]);
285
+ innerType: r[i]
286
+ }) : r[i]);
292
287
  }
293
288
  else
294
- for (const a in r)
295
- i[a] = e ? new e({
289
+ for (const i in r)
290
+ c[i] = e ? new e({
296
291
  type: "optional",
297
- innerType: r[a]
298
- }) : r[a];
299
- return L(this, "shape", i), i;
292
+ innerType: r[i]
293
+ }) : r[i];
294
+ return F(this, "shape", c), c;
300
295
  },
301
296
  checks: []
302
297
  });
303
- return D(t, o);
298
+ return j(t, o);
304
299
  }
305
- s(an, "partial");
306
- function sn(e, t, n) {
307
- const o = M(t._zod.def, {
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, i = { ...r };
304
+ const r = t._zod.def.shape, c = { ...r };
310
305
  if (n)
311
- for (const a in n) {
312
- if (!(a in i))
313
- throw new Error(`Unrecognized key: "${a}"`);
314
- n[a] && (i[a] = new e({
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[a]
311
+ innerType: r[i]
317
312
  }));
318
313
  }
319
314
  else
320
- for (const a in r)
321
- i[a] = new e({
315
+ for (const i in r)
316
+ c[i] = new e({
322
317
  type: "nonoptional",
323
- innerType: r[a]
318
+ innerType: r[i]
324
319
  });
325
- return L(this, "shape", i), i;
320
+ return F(this, "shape", c), c;
326
321
  },
327
322
  checks: []
328
323
  });
329
- return D(t, o);
324
+ return j(t, o);
330
325
  }
331
- s(sn, "required");
332
- function V(e, t = 0) {
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
- s(V, "aborted");
341
- function mt(e, t) {
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
- s(mt, "prefixIssues");
348
- function Q(e) {
342
+ a(qe, "prefixIssues");
343
+ function K(e) {
349
344
  return typeof e == "string" ? e : e?.message;
350
345
  }
351
- s(Q, "unwrapMessage");
352
- function R(e, t, n) {
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 = Q(e.inst?._zod.def?.error?.(e)) ?? Q(t?.error?.(e)) ?? Q(n.customError?.(e)) ?? Q(n.localeError?.(e)) ?? "Invalid input";
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
- s(R, "finalizeIssue");
361
- function Ae(e) {
355
+ a(C, "finalizeIssue");
356
+ function ge(e) {
362
357
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
363
358
  }
364
- s(Ae, "getLengthableOrigin");
365
- function q(...e) {
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
- s(q, "issue");
375
- const gt = /* @__PURE__ */ s((e, t) => {
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, _e, 2), Object.defineProperty(e, "toString", {
383
- value: /* @__PURE__ */ s(() => e.message, "value"),
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"), vt = c("$ZodError", gt), _t = c("$ZodError", gt, { Parent: Error });
387
- function cn(e, t = (n) => n.message) {
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
- s(cn, "flattenError");
394
- function un(e, t) {
395
- const n = t || function(i) {
396
- return i.message;
397
- }, o = { _errors: [] }, r = /* @__PURE__ */ s((i) => {
398
- for (const a of i.issues)
399
- if (a.code === "invalid_union" && a.errors.length)
400
- a.errors.map((u) => r({ issues: u }));
401
- else if (a.code === "invalid_key")
402
- r({ issues: a.issues });
403
- else if (a.code === "invalid_element")
404
- r({ issues: a.issues });
405
- else if (a.path.length === 0)
406
- o._errors.push(n(a));
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 u = o, d = 0;
409
- for (; d < a.path.length; ) {
410
- const p = a.path[d];
411
- d === a.path.length - 1 ? (u[p] = u[p] || { _errors: [] }, u[p]._errors.push(n(a))) : u[p] = u[p] || { _errors: [] }, u = u[p], d++;
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
- s(un, "formatError");
418
- const Ee = /* @__PURE__ */ s((e) => (t, n, o, r) => {
419
- const i = o ? Object.assign(o, { async: !1 }) : { async: !1 }, a = t._zod.run({ value: n, issues: [] }, i);
420
- if (a instanceof Promise)
421
- throw new C();
422
- if (a.issues.length) {
423
- const u = new (r?.Err ?? e)(a.issues.map((d) => R(d, i, F())));
424
- throw ht(u, r?.callee), u;
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 a.value;
427
- }, "_parse"), Te = /* @__PURE__ */ s((e) => async (t, n, o, r) => {
428
- const i = o ? Object.assign(o, { async: !0 }) : { async: !0 };
429
- let a = t._zod.run({ value: n, issues: [] }, i);
430
- if (a instanceof Promise && (a = await a), a.issues.length) {
431
- const u = new (r?.Err ?? e)(a.issues.map((d) => R(d, i, F())));
432
- throw ht(u, r?.callee), u;
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 a.value;
435
- }, "_parseAsync"), fe = /* @__PURE__ */ s((e) => (t, n, o) => {
436
- const r = o ? { ...o, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, r);
437
- if (i instanceof Promise)
438
- throw new C();
439
- return i.issues.length ? {
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 ?? vt)(i.issues.map((a) => R(a, r, F())))
442
- } : { success: !0, data: i.value };
443
- }, "_safeParse"), ln = /* @__PURE__ */ fe(_t), me = /* @__PURE__ */ s((e) => async (t, n, o) => {
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 i = t._zod.run({ value: n, issues: [] }, r);
446
- return i instanceof Promise && (i = await i), i.issues.length ? {
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(i.issues.map((a) => R(a, r, F())))
449
- } : { success: !0, data: i.value };
450
- }, "_safeParseAsync"), dn = /* @__PURE__ */ me(_t), pn = /* @__PURE__ */ s((e) => (t, n, o) => {
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 Ee(e)(t, n, r);
453
- }, "_encode"), hn = /* @__PURE__ */ s((e) => (t, n, o) => Ee(e)(t, n, o), "_decode"), fn = /* @__PURE__ */ s((e) => async (t, n, o) => {
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 Te(e)(t, n, r);
456
- }, "_encodeAsync"), mn = /* @__PURE__ */ s((e) => async (t, n, o) => Te(e)(t, n, o), "_decodeAsync"), gn = /* @__PURE__ */ s((e) => (t, n, o) => {
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 fe(e)(t, n, r);
459
- }, "_safeEncode"), vn = /* @__PURE__ */ s((e) => (t, n, o) => fe(e)(t, n, o), "_safeDecode"), _n = /* @__PURE__ */ s((e) => async (t, n, o) => {
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 me(e)(t, n, r);
462
- }, "_safeEncodeAsync"), wn = /* @__PURE__ */ s((e) => async (t, n, o) => me(e)(t, n, o), "_safeDecodeAsync"), bn = /^[cC][^\s-]{8,}$/, kn = /^[0-9a-z]+$/, zn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, yn = /^[0-9a-vA-V]{20}$/, $n = /^[A-Za-z0-9]{27}$/, Zn = /^[a-zA-Z0-9_-]{21}$/, In = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Sn = /^([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})$/, Ge = /* @__PURE__ */ s((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"), An = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, En = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
463
- function Tn() {
464
- return new RegExp(En, "u");
465
- }
466
- s(Tn, "emoji");
467
- const jn = /^(?:(?: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])$/, Pn = /^(([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}|:))$/, On = /^((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])$/, xn = /^(([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])$/, Cn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, wt = /^[A-Za-z0-9_-]*$/, Nn = /^(?=.{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])?)*\.?$/, Un = /^\+(?:[0-9]){6,14}[0-9]$/, bt = "(?:(?:\\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])))", Dn = /* @__PURE__ */ new RegExp(`^${bt}$`);
468
- function kt(e) {
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
- s(kt, "timeSource");
473
- function Fn(e) {
474
- return new RegExp(`^${kt(e)}$`);
467
+ a(ot, "timeSource");
468
+ function vn(e) {
469
+ return new RegExp(`^${ot(e)}$`);
475
470
  }
476
- s(Fn, "time$1");
477
- function Rn(e) {
478
- const t = kt({ precision: e.precision }), n = ["Z"];
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(`^${bt}T(?:${o})$`);
476
+ return new RegExp(`^${nt}T(?:${o})$`);
482
477
  }
483
- s(Rn, "datetime$1");
484
- const Ln = /* @__PURE__ */ s((e) => {
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"), Mn = /^-?\d+$/, Vn = /^-?\d+(?:\.\d+)?/, Bn = /^(?:true|false)$/i, Wn = /^[^A-Z]*$/, Gn = /^[^a-z]*$/, A = /* @__PURE__ */ c("$ZodCheck", (e, t) => {
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
- }), zt = {
485
+ }), rt = {
491
486
  number: "number",
492
487
  bigint: "bigint",
493
488
  object: "date"
494
- }, yt = /* @__PURE__ */ c("$ZodCheckLessThan", (e, t) => {
489
+ }, it = /* @__PURE__ */ u("$ZodCheckLessThan", (e, t) => {
495
490
  A.init(e, t);
496
- const n = zt[typeof t.value];
491
+ const n = rt[typeof t.value];
497
492
  e._zod.onattach.push((o) => {
498
- const r = o._zod.bag, i = (t.inclusive ? r.maximum : r.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
499
- t.value < i && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = 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
- }), $t = /* @__PURE__ */ c("$ZodCheckGreaterThan", (e, t) => {
506
+ }), ct = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, t) => {
512
507
  A.init(e, t);
513
- const n = zt[typeof t.value];
508
+ const n = rt[typeof t.value];
514
509
  e._zod.onattach.push((o) => {
515
- const r = o._zod.bag, i = (t.inclusive ? r.minimum : r.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
516
- t.value > i && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = 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
- }), Jn = /* @__PURE__ */ c("$ZodCheckMultipleOf", (e, t) => {
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) : qt(n.value, t.value) === 0) || n.issues.push({
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
- }), Kn = /* @__PURE__ */ c("$ZodCheckNumberFormat", (e, t) => {
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, i] = Qt[t.format];
547
- e._zod.onattach.push((a) => {
548
- const u = a._zod.bag;
549
- u.format = t.format, u.minimum = r, u.maximum = i, n && (u.pattern = Mn);
550
- }), e._zod.check = (a) => {
551
- const u = a.value;
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(u)) {
554
- a.issues.push({
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: u,
554
+ input: s,
560
555
  inst: e
561
556
  });
562
557
  return;
563
558
  }
564
- if (!Number.isSafeInteger(u)) {
565
- u > 0 ? a.issues.push({
566
- input: u,
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
- }) : a.issues.push({
574
- input: u,
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
- u < r && a.issues.push({
580
+ s < r && i.issues.push({
586
581
  origin: "number",
587
- input: u,
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
- }), u > i && a.issues.push({
588
+ }), s > c && i.issues.push({
594
589
  origin: "number",
595
- input: u,
590
+ input: s,
596
591
  code: "too_big",
597
- maximum: i,
592
+ maximum: c,
598
593
  inst: e
599
594
  });
600
595
  };
601
- }), qn = /* @__PURE__ */ c("$ZodCheckMaxLength", (e, t) => {
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 !Ie(r) && r.length !== void 0;
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 a = Ae(r);
608
+ const i = ge(r);
614
609
  o.issues.push({
615
- origin: a,
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
- }), Yn = /* @__PURE__ */ c("$ZodCheckMinLength", (e, t) => {
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 !Ie(r) && r.length !== void 0;
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 a = Ae(r);
631
+ const i = ge(r);
637
632
  o.issues.push({
638
- origin: a,
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
- }), Xn = /* @__PURE__ */ c("$ZodCheckLengthEquals", (e, t) => {
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 !Ie(r) && r.length !== void 0;
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, i = r.length;
657
- if (i === t.length)
651
+ const r = o.value, c = r.length;
652
+ if (c === t.length)
658
653
  return;
659
- const a = Ae(r), u = i > t.length;
654
+ const i = ge(r), s = c > t.length;
660
655
  o.issues.push({
661
- origin: a,
662
- ...u ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
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
- }), ge = /* @__PURE__ */ c("$ZodCheckStringFormat", (e, t) => {
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 i = r._zod.bag;
674
- i.format = t.format, t.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t.pattern));
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
- }), Hn = /* @__PURE__ */ c("$ZodCheckRegex", (e, t) => {
688
- ge.init(e, t), e._zod.check = (n) => {
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
- }), Qn = /* @__PURE__ */ c("$ZodCheckLowerCase", (e, t) => {
700
- t.pattern ?? (t.pattern = Wn), ge.init(e, t);
701
- }), eo = /* @__PURE__ */ c("$ZodCheckUpperCase", (e, t) => {
702
- t.pattern ?? (t.pattern = Gn), ge.init(e, t);
703
- }), to = /* @__PURE__ */ c("$ZodCheckIncludes", (e, t) => {
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 = B(t.includes), o = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : 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 i = r._zod.bag;
708
- i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(o);
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
- }), no = /* @__PURE__ */ c("$ZodCheckStartsWith", (e, t) => {
715
+ }), Nn = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, t) => {
721
716
  A.init(e, t);
722
- const n = new RegExp(`^${B(t.prefix)}.*`);
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
- }), oo = /* @__PURE__ */ c("$ZodCheckEndsWith", (e, t) => {
732
+ }), jn = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, t) => {
738
733
  A.init(e, t);
739
- const n = new RegExp(`.*${B(t.suffix)}$`);
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
- }), ro = /* @__PURE__ */ c("$ZodCheckOverwrite", (e, t) => {
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
- }), xe = class xe {
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((a) => a), r = Math.min(...o.map((a) => a.length - a.trimStart().length)), i = o.map((a) => a.slice(r)).map((a) => " ".repeat(this.indent * 2) + a);
772
- for (const a of i)
773
- this.content.push(a);
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((i) => ` ${i}`)];
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
- s(xe, "Doc");
782
- let we = xe;
783
- const io = {
776
+ a($e, "Doc");
777
+ let pe = $e;
778
+ const Cn = {
784
779
  major: 4,
785
780
  minor: 1,
786
781
  patch: 11
787
- }, g = /* @__PURE__ */ c("$ZodType", (e, t) => {
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 = io;
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 i of r._zod.onattach)
794
- i(e);
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__ */ s((a, u, d) => {
801
- let p = V(a), f;
802
- for (const k of u) {
803
- if (k._zod.def.when) {
804
- if (!k._zod.def.when(a))
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 (p)
801
+ } else if (h)
807
802
  continue;
808
- const b = a.issues.length, $ = k._zod.check(a);
809
- if ($ instanceof Promise && d?.async === !1)
810
- throw new C();
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 $, a.issues.length !== b && (p || (p = V(a, b)));
808
+ await $, i.issues.length !== z && (h || (h = U(i, z)));
814
809
  });
815
810
  else {
816
- if (a.issues.length === b)
811
+ if (i.issues.length === z)
817
812
  continue;
818
- p || (p = V(a, b));
813
+ h || (h = U(i, z));
819
814
  }
820
815
  }
821
- return f ? f.then(() => a) : a;
822
- }, "runChecks"), i = /* @__PURE__ */ s((a, u, d) => {
823
- if (V(a))
824
- return a.aborted = !0, a;
825
- const p = r(u, o, d);
826
- if (p instanceof Promise) {
827
- if (d.async === !1)
828
- throw new C();
829
- return p.then((f) => e._zod.parse(f, d));
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(p, d);
826
+ return e._zod.parse(h, p);
832
827
  }, "handleCanaryResult");
833
- e._zod.run = (a, u) => {
834
- if (u.skipChecks)
835
- return e._zod.parse(a, u);
836
- if (u.direction === "backward") {
837
- const p = e._zod.parse({ value: a.value, issues: [] }, { ...u, skipChecks: !0 });
838
- return p instanceof Promise ? p.then((f) => i(f, a, u)) : i(p, a, u);
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 d = e._zod.parse(a, u);
841
- if (d instanceof Promise) {
842
- if (u.async === !1)
843
- throw new C();
844
- return d.then((p) => r(p, o, u));
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(d, o, u);
841
+ return r(p, o, s);
847
842
  };
848
843
  }
849
844
  e["~standard"] = {
850
- validate: /* @__PURE__ */ s((r) => {
845
+ validate: /* @__PURE__ */ a((r) => {
851
846
  try {
852
- const i = ln(e, r);
853
- return i.success ? { value: i.data } : { issues: i.error?.issues };
847
+ const c = Lt(e, r);
848
+ return c.success ? { value: c.data } : { issues: c.error?.issues };
854
849
  } catch {
855
- return dn(e, r).then((a) => a.success ? { value: a.data } : { issues: a.error?.issues });
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
- }), je = /* @__PURE__ */ c("$ZodString", (e, t) => {
862
- g.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Ln(e._zod.bag), e._zod.parse = (n, o) => {
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__ */ c("$ZodStringFormat", (e, t) => {
876
- ge.init(e, t), je.init(e, t);
877
- }), ao = /* @__PURE__ */ c("$ZodGUID", (e, t) => {
878
- t.pattern ?? (t.pattern = Sn), v.init(e, t);
879
- }), so = /* @__PURE__ */ c("$ZodUUID", (e, t) => {
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 = Ge(o));
888
+ t.pattern ?? (t.pattern = Se(o));
894
889
  } else
895
- t.pattern ?? (t.pattern = Ge());
890
+ t.pattern ?? (t.pattern = Se());
896
891
  v.init(e, t);
897
- }), co = /* @__PURE__ */ c("$ZodEmail", (e, t) => {
898
- t.pattern ?? (t.pattern = An), v.init(e, t);
899
- }), uo = /* @__PURE__ */ c("$ZodURL", (e, t) => {
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: Nn.source,
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
- }), lo = /* @__PURE__ */ c("$ZodEmoji", (e, t) => {
932
- t.pattern ?? (t.pattern = Tn()), v.init(e, t);
933
- }), po = /* @__PURE__ */ c("$ZodNanoID", (e, t) => {
934
- t.pattern ?? (t.pattern = Zn), v.init(e, t);
935
- }), ho = /* @__PURE__ */ c("$ZodCUID", (e, t) => {
936
- t.pattern ?? (t.pattern = bn), v.init(e, t);
937
- }), fo = /* @__PURE__ */ c("$ZodCUID2", (e, t) => {
938
- t.pattern ?? (t.pattern = kn), v.init(e, t);
939
- }), mo = /* @__PURE__ */ c("$ZodULID", (e, t) => {
940
- t.pattern ?? (t.pattern = zn), v.init(e, t);
941
- }), go = /* @__PURE__ */ c("$ZodXID", (e, t) => {
942
- t.pattern ?? (t.pattern = yn), v.init(e, t);
943
- }), vo = /* @__PURE__ */ c("$ZodKSUID", (e, t) => {
944
- t.pattern ?? (t.pattern = $n), v.init(e, t);
945
- }), _o = /* @__PURE__ */ c("$ZodISODateTime", (e, t) => {
946
- t.pattern ?? (t.pattern = Rn(t)), v.init(e, t);
947
- }), wo = /* @__PURE__ */ c("$ZodISODate", (e, t) => {
948
- t.pattern ?? (t.pattern = Dn), v.init(e, t);
949
- }), bo = /* @__PURE__ */ c("$ZodISOTime", (e, t) => {
950
- t.pattern ?? (t.pattern = Fn(t)), v.init(e, t);
951
- }), ko = /* @__PURE__ */ c("$ZodISODuration", (e, t) => {
952
- t.pattern ?? (t.pattern = In), v.init(e, t);
953
- }), zo = /* @__PURE__ */ c("$ZodIPv4", (e, t) => {
954
- t.pattern ?? (t.pattern = jn), v.init(e, t), e._zod.onattach.push((n) => {
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
- }), yo = /* @__PURE__ */ c("$ZodIPv6", (e, t) => {
959
- t.pattern ?? (t.pattern = Pn), v.init(e, t), e._zod.onattach.push((n) => {
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
- }), $o = /* @__PURE__ */ c("$ZodCIDRv4", (e, t) => {
976
- t.pattern ?? (t.pattern = On), v.init(e, t);
977
- }), Zo = /* @__PURE__ */ c("$ZodCIDRv6", (e, t) => {
978
- t.pattern ?? (t.pattern = xn), v.init(e, t), e._zod.check = (n) => {
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, i] = o;
984
- if (!i)
978
+ const [r, c] = o;
979
+ if (!c)
985
980
  throw new Error();
986
- const a = Number(i);
987
- if (`${a}` !== i)
981
+ const i = Number(c);
982
+ if (`${i}` !== c)
988
983
  throw new Error();
989
- if (a < 0 || a > 128)
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 Zt(e) {
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
- s(Zt, "isValidBase64");
1015
- const Io = /* @__PURE__ */ c("$ZodBase64", (e, t) => {
1016
- t.pattern ?? (t.pattern = Cn), v.init(e, t), e._zod.onattach.push((n) => {
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
- Zt(n.value) || n.issues.push({
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 So(e) {
1029
- if (!wt.test(e))
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 Zt(n);
1027
+ return at(n);
1033
1028
  }
1034
- s(So, "isValidBase64URL");
1035
- const Ao = /* @__PURE__ */ c("$ZodBase64URL", (e, t) => {
1036
- t.pattern ?? (t.pattern = wt), v.init(e, t), e._zod.onattach.push((n) => {
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
- So(n.value) || n.issues.push({
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
- }), Eo = /* @__PURE__ */ c("$ZodE164", (e, t) => {
1048
- t.pattern ?? (t.pattern = Un), v.init(e, t);
1042
+ }), co = /* @__PURE__ */ u("$ZodE164", (e, t) => {
1043
+ t.pattern ?? (t.pattern = mn), v.init(e, t);
1049
1044
  });
1050
- function To(e, t = null) {
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
- s(To, "isValidJWT");
1065
- const jo = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
1059
+ a(ao, "isValidJWT");
1060
+ const uo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
1066
1061
  v.init(e, t), e._zod.check = (n) => {
1067
- To(n.value, t.alg) || n.issues.push({
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
- }), It = /* @__PURE__ */ c("$ZodNumber", (e, t) => {
1076
- g.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Vn, e._zod.parse = (n, o) => {
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 i = typeof r == "number" ? Number.isNaN(r) ? "NaN" : Number.isFinite(r) ? void 0 : "Infinity" : void 0;
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
- ...i ? { received: i } : {}
1086
+ ...c ? { received: c } : {}
1092
1087
  }), n;
1093
1088
  };
1094
- }), Po = /* @__PURE__ */ c("$ZodNumber", (e, t) => {
1095
- Kn.init(e, t), It.init(e, t);
1096
- }), Oo = /* @__PURE__ */ c("$ZodBoolean", (e, t) => {
1097
- g.init(e, t), e._zod.pattern = Bn, e._zod.parse = (n, o) => {
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
- }), xo = /* @__PURE__ */ c("$ZodAny", (e, t) => {
1112
- g.init(e, t), e._zod.parse = (n) => n;
1113
- }), Co = /* @__PURE__ */ c("$ZodUnknown", (e, t) => {
1114
- g.init(e, t), e._zod.parse = (n) => n;
1115
- }), No = /* @__PURE__ */ c("$ZodNever", (e, t) => {
1116
- g.init(e, t), e._zod.parse = (n, o) => (n.issues.push({
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
- }), Uo = /* @__PURE__ */ c("$ZodDate", (e, t) => {
1123
- g.init(e, t), e._zod.parse = (n, o) => {
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, i = r instanceof Date;
1130
- return i && !Number.isNaN(r.getTime()) || n.issues.push({
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
- ...i ? { received: "Invalid Date" } : {},
1129
+ ...c ? { received: "Invalid Date" } : {},
1135
1130
  inst: e
1136
1131
  }), n;
1137
1132
  };
1138
1133
  });
1139
- function Je(e, t, n) {
1140
- e.issues.length && t.issues.push(...mt(n, e.issues)), t.value[n] = e.value;
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
- s(Je, "handleArrayResult");
1143
- const Do = /* @__PURE__ */ c("$ZodArray", (e, t) => {
1144
- g.init(e, t), e._zod.parse = (n, o) => {
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 i = [];
1155
- for (let a = 0; a < r.length; a++) {
1156
- const u = r[a], d = t.element._zod.run({
1157
- value: u,
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
- d instanceof Promise ? i.push(d.then((p) => Je(p, n, a))) : Je(d, n, a);
1155
+ p instanceof Promise ? c.push(p.then((h) => Oe(h, n, i))) : Oe(p, n, i);
1161
1156
  }
1162
- return i.length ? Promise.all(i).then(() => n) : n;
1157
+ return c.length ? Promise.all(c).then(() => n) : n;
1163
1158
  };
1164
1159
  });
1165
- function ue(e, t, n, o) {
1166
- e.issues.length && t.issues.push(...mt(n, e.issues)), e.value === void 0 ? n in o && (t.value[n] = void 0) : t.value[n] = e.value;
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
- s(ue, "handlePropertyResult");
1169
- function St(e) {
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 = Ht(e.shape);
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
- s(St, "normalizeDef");
1184
- function At(e, t, n, o, r, i) {
1185
- const a = [], u = r.keySet, d = r.catchall._zod, p = d.def.type;
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 (u.has(f))
1182
+ if (s.has(f))
1188
1183
  continue;
1189
- if (p === "never") {
1190
- a.push(f);
1184
+ if (h === "never") {
1185
+ i.push(f);
1191
1186
  continue;
1192
1187
  }
1193
- const k = d.run({ value: t[f], issues: [] }, o);
1194
- k instanceof Promise ? e.push(k.then((b) => ue(b, n, f, t))) : ue(k, n, f, t);
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 a.length && n.issues.push({
1191
+ return i.length && n.issues.push({
1197
1192
  code: "unrecognized_keys",
1198
- keys: a,
1193
+ keys: i,
1199
1194
  input: t,
1200
- inst: i
1195
+ inst: c
1201
1196
  }), e.length ? Promise.all(e).then(() => n) : n;
1202
1197
  }
1203
- s(At, "handleCatchall");
1204
- const Fo = /* @__PURE__ */ c("$ZodObject", (e, t) => {
1205
- if (g.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1206
- const u = t.shape;
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__ */ s(() => {
1209
- const d = { ...u };
1203
+ get: /* @__PURE__ */ a(() => {
1204
+ const p = { ...s };
1210
1205
  return Object.defineProperty(t, "shape", {
1211
- value: d
1212
- }), d;
1206
+ value: p
1207
+ }), p;
1213
1208
  }, "get")
1214
1209
  });
1215
1210
  }
1216
- const o = he(() => St(t));
1211
+ const o = ie(() => st(t));
1217
1212
  m(e._zod, "propValues", () => {
1218
- const u = t.shape, d = {};
1219
- for (const p in u) {
1220
- const f = u[p]._zod;
1213
+ const s = t.shape, p = {};
1214
+ for (const h in s) {
1215
+ const f = s[h]._zod;
1221
1216
  if (f.values) {
1222
- d[p] ?? (d[p] = /* @__PURE__ */ new Set());
1223
- for (const k of f.values)
1224
- d[p].add(k);
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 d;
1228
- });
1229
- const r = J, i = t.catchall;
1230
- let a;
1231
- e._zod.parse = (u, d) => {
1232
- a ?? (a = o.value);
1233
- const p = u.value;
1234
- if (!r(p))
1235
- return u.issues.push({
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: p,
1233
+ input: h,
1239
1234
  inst: e
1240
- }), u;
1241
- u.value = {};
1242
- const f = [], k = a.shape;
1243
- for (const b of a.keys) {
1244
- const E = k[b]._zod.run({ value: p[b], issues: [] }, d);
1245
- E instanceof Promise ? f.push(E.then((ve) => ue(ve, u, b, p))) : ue(E, u, b, p);
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 i ? At(f, p, u, d, o.value, e) : f.length ? Promise.all(f).then(() => u) : u;
1242
+ return c ? lt(f, h, s, p, o.value, e) : f.length ? Promise.all(f).then(() => s) : s;
1248
1243
  };
1249
- }), Ro = /* @__PURE__ */ c("$ZodObjectJIT", (e, t) => {
1250
- Fo.init(e, t);
1251
- const n = e._zod.parse, o = he(() => St(t)), r = /* @__PURE__ */ s((b) => {
1252
- const $ = new we(["shape", "payload", "ctx"]), E = o.value, ve = /* @__PURE__ */ s((O) => {
1253
- const P = We(O);
1254
- return `shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`;
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 Fe = /* @__PURE__ */ Object.create(null);
1258
- let Mt = 0;
1259
- for (const O of E.keys)
1260
- Fe[O] = `key_${Mt++}`;
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 O of E.keys) {
1263
- const P = Fe[O], W = We(O);
1264
- $.write(`const ${P} = ${ve(O)};`), $.write(`
1265
- if (${P}.issues.length) {
1266
- payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
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 ? [${W}, ...iss.path] : [${W}]
1263
+ path: iss.path ? [${M}, ...iss.path] : [${M}]
1269
1264
  })));
1270
1265
  }
1271
1266
 
1272
1267
 
1273
- if (${P}.value === undefined) {
1274
- if (${W} in input) {
1275
- newResult[${W}] = undefined;
1268
+ if (${O}.value === undefined) {
1269
+ if (${M} in input) {
1270
+ newResult[${M}] = undefined;
1276
1271
  }
1277
1272
  } else {
1278
- newResult[${W}] = ${P}.value;
1273
+ newResult[${M}] = ${O}.value;
1279
1274
  }
1280
1275
 
1281
1276
  `);
1282
1277
  }
1283
1278
  $.write("payload.value = newResult;"), $.write("return payload;");
1284
- const Vt = $.compile();
1285
- return (O, P) => Vt(b, O, P);
1279
+ const $t = $.compile();
1280
+ return (P, O) => $t(z, P, O);
1286
1281
  }, "generateFastpass");
1287
- let i;
1288
- const a = J, u = !pt.jitless, p = u && Yt.value, f = t.catchall;
1289
- let k;
1290
- e._zod.parse = (b, $) => {
1291
- k ?? (k = o.value);
1292
- const E = b.value;
1293
- return a(E) ? u && p && $?.async === !1 && $.jitless !== !0 ? (i || (i = r(t.shape)), b = i(b, $), f ? At([], E, b, $, k, e) : b) : n(b, $) : (b.issues.push({
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
- }), b);
1293
+ }), z);
1299
1294
  };
1300
1295
  });
1301
- function Ke(e, t, n, o) {
1302
- for (const i of e)
1303
- if (i.issues.length === 0)
1304
- return t.value = i.value, t;
1305
- const r = e.filter((i) => !V(i));
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((i) => i.issues.map((a) => R(a, o, F())))
1305
+ errors: e.map((c) => c.issues.map((i) => C(i, o, D())))
1311
1306
  }), t);
1312
1307
  }
1313
- s(Ke, "handleUnionResults");
1314
- const Et = /* @__PURE__ */ c("$ZodUnion", (e, t) => {
1315
- g.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", () => {
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((i) => i._zod.pattern);
1321
- return new RegExp(`^(${r.map((i) => Se(i.source)).join("|")})$`);
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, i) => {
1320
+ e._zod.parse = (r, c) => {
1326
1321
  if (n)
1327
- return o(r, i);
1328
- let a = !1;
1329
- const u = [];
1330
- for (const d of t.options) {
1331
- const p = d._zod.run({
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
- }, i);
1335
- if (p instanceof Promise)
1336
- u.push(p), a = !0;
1329
+ }, c);
1330
+ if (h instanceof Promise)
1331
+ s.push(h), i = !0;
1337
1332
  else {
1338
- if (p.issues.length === 0)
1339
- return p;
1340
- u.push(p);
1333
+ if (h.issues.length === 0)
1334
+ return h;
1335
+ s.push(h);
1341
1336
  }
1342
1337
  }
1343
- return a ? Promise.all(u).then((d) => Ke(d, r, e, i)) : Ke(u, r, e, i);
1338
+ return i ? Promise.all(s).then((p) => Pe(p, r, e, c)) : Pe(s, r, e, c);
1344
1339
  };
1345
- }), Lo = /* @__PURE__ */ c("$ZodDiscriminatedUnion", (e, t) => {
1346
- Et.init(e, t);
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 i of t.options) {
1351
- const a = i._zod.propValues;
1352
- if (!a || Object.keys(a).length === 0)
1353
- throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);
1354
- for (const [u, d] of Object.entries(a)) {
1355
- r[u] || (r[u] = /* @__PURE__ */ new Set());
1356
- for (const p of d)
1357
- r[u].add(p);
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 = he(() => {
1363
- const r = t.options, i = /* @__PURE__ */ new Map();
1364
- for (const a of r) {
1365
- const u = a._zod.propValues?.[t.discriminator];
1366
- if (!u || u.size === 0)
1367
- throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);
1368
- for (const d of u) {
1369
- if (i.has(d))
1370
- throw new Error(`Duplicate discriminator value "${String(d)}"`);
1371
- i.set(d, a);
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 i;
1369
+ return c;
1375
1370
  });
1376
- e._zod.parse = (r, i) => {
1377
- const a = r.value;
1378
- if (!J(a))
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: a,
1377
+ input: i,
1383
1378
  inst: e
1384
1379
  }), r;
1385
- const u = o.value.get(a?.[t.discriminator]);
1386
- return u ? u._zod.run(r, i) : t.unionFallback ? n(r, i) : (r.issues.push({
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: a,
1386
+ input: i,
1392
1387
  path: [t.discriminator],
1393
1388
  inst: e
1394
1389
  }), r);
1395
1390
  };
1396
- }), Mo = /* @__PURE__ */ c("$ZodIntersection", (e, t) => {
1397
- g.init(e, t), e._zod.parse = (n, o) => {
1398
- const r = n.value, i = t.left._zod.run({ value: r, issues: [] }, o), a = t.right._zod.run({ value: r, issues: [] }, o);
1399
- return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([d, p]) => qe(n, d, p)) : qe(n, i, a);
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 be(e, t) {
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 (K(e) && K(t)) {
1408
- const n = Object.keys(t), o = Object.keys(e).filter((i) => n.indexOf(i) !== -1), r = { ...e, ...t };
1409
- for (const i of o) {
1410
- const a = be(e[i], t[i]);
1411
- if (!a.valid)
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: [i, ...a.mergeErrorPath]
1409
+ mergeErrorPath: [c, ...i.mergeErrorPath]
1415
1410
  };
1416
- r[i] = a.data;
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], i = t[o], a = be(r, i);
1426
- if (!a.valid)
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, ...a.mergeErrorPath]
1424
+ mergeErrorPath: [o, ...i.mergeErrorPath]
1430
1425
  };
1431
- n.push(a.data);
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
- s(be, "mergeValues");
1438
- function qe(e, t, n) {
1439
- if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), V(e))
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 = be(t.value, n.value);
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
- s(qe, "handleIntersectionResults");
1447
- const Vo = /* @__PURE__ */ c("$ZodEnum", (e, t) => {
1448
- g.init(e, t);
1449
- const n = Kt(t.entries), o = new Set(n);
1450
- e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((r) => Xt.has(typeof r)).map((r) => typeof r == "string" ? B(r) : r.toString()).join("|")})$`), e._zod.parse = (r, i) => {
1451
- const a = r.value;
1452
- return o.has(a) || r.issues.push({
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: a,
1450
+ input: i,
1456
1451
  inst: e
1457
1452
  }), r;
1458
1453
  };
1459
- }), Bo = /* @__PURE__ */ c("$ZodLiteral", (e, t) => {
1460
- if (g.init(e, t), t.values.length === 0)
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" ? B(n) : n ? B(n.toString()) : String(n)).join("|")})$`), e._zod.parse = (n, o) => {
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
- }), Wo = /* @__PURE__ */ c("$ZodTransform", (e, t) => {
1472
- g.init(e, t), e._zod.parse = (n, o) => {
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 ce(e.constructor.name);
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((a) => (n.value = a, n));
1472
+ return (r instanceof Promise ? r : Promise.resolve(r)).then((i) => (n.value = i, n));
1478
1473
  if (r instanceof Promise)
1479
- throw new C();
1474
+ throw new T();
1480
1475
  return n.value = r, n;
1481
1476
  };
1482
1477
  });
1483
- function Ye(e, t) {
1478
+ function xe(e, t) {
1484
1479
  return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
1485
1480
  }
1486
- s(Ye, "handleOptionalResult");
1487
- const Go = /* @__PURE__ */ c("$ZodOptional", (e, t) => {
1488
- g.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", () => {
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(`^(${Se(n.source)})?$`) : void 0;
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((i) => Ye(i, n.value)) : Ye(r, n.value);
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
- }), Jo = /* @__PURE__ */ c("$ZodNullable", (e, t) => {
1499
- g.init(e, t), m(e._zod, "optin", () => t.innerType._zod.optin), m(e._zod, "optout", () => t.innerType._zod.optout), m(e._zod, "pattern", () => {
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(`^(${Se(n.source)}|null)$`) : void 0;
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
- }), Ko = /* @__PURE__ */ c("$ZodDefault", (e, t) => {
1504
- g.init(e, t), e._zod.optin = "optional", m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
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((i) => Xe(i, t)) : Xe(r, t);
1505
+ return r instanceof Promise ? r.then((c) => Ne(c, t)) : Ne(r, t);
1511
1506
  };
1512
1507
  });
1513
- function Xe(e, t) {
1508
+ function Ne(e, t) {
1514
1509
  return e.value === void 0 && (e.value = t.defaultValue), e;
1515
1510
  }
1516
- s(Xe, "handleDefaultResult");
1517
- const qo = /* @__PURE__ */ c("$ZodPrefault", (e, t) => {
1518
- g.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));
1519
- }), Yo = /* @__PURE__ */ c("$ZodNonOptional", (e, t) => {
1520
- g.init(e, t), m(e._zod, "values", () => {
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((i) => He(i, e)) : He(r, e);
1520
+ return r instanceof Promise ? r.then((c) => je(c, e)) : je(r, e);
1526
1521
  };
1527
1522
  });
1528
- function He(e, t) {
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
- s(He, "handleNonOptionalResult");
1537
- const Xo = /* @__PURE__ */ c("$ZodCatch", (e, t) => {
1538
- g.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) => {
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((i) => (n.value = i.value, i.issues.length && (n.value = t.catchValue({
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: i.issues.map((a) => R(a, o, F()))
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((i) => R(i, o, F()))
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
- }), Ho = /* @__PURE__ */ c("$ZodPipe", (e, t) => {
1557
- g.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) => {
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 i = t.out._zod.run(n, o);
1560
- return i instanceof Promise ? i.then((a) => ee(a, t.in, o)) : ee(i, t.in, o);
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((i) => ee(i, t.out, o)) : ee(r, t.out, o);
1558
+ return r instanceof Promise ? r.then((c) => Y(c, t.out, o)) : Y(r, t.out, o);
1564
1559
  };
1565
1560
  });
1566
- function ee(e, t, n) {
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
- s(ee, "handlePipeResult");
1570
- const Qo = /* @__PURE__ */ c("$ZodReadonly", (e, t) => {
1571
- g.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) => {
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(Qe) : Qe(r);
1570
+ return r instanceof Promise ? r.then(De) : De(r);
1576
1571
  };
1577
1572
  });
1578
- function Qe(e) {
1573
+ function De(e) {
1579
1574
  return e.value = Object.freeze(e.value), e;
1580
1575
  }
1581
- s(Qe, "handleReadonlyResult");
1582
- const er = /* @__PURE__ */ c("$ZodCustom", (e, t) => {
1583
- A.init(e, t), g.init(e, t), e._zod.parse = (n, o) => n, e._zod.check = (n) => {
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((i) => et(i, n, o, e));
1587
- et(r, n, o, e);
1581
+ return r.then((c) => Ce(c, n, o, e));
1582
+ Ce(r, n, o, e);
1588
1583
  };
1589
1584
  });
1590
- function et(e, t, n, o) {
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(q(r));
1597
+ o._zod.def.params && (r.params = o._zod.def.params), t.issues.push(W(r));
1603
1598
  }
1604
1599
  }
1605
- s(et, "handleRefineResult");
1606
- const Ce = class Ce {
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
- s(Ce, "$ZodRegistry");
1641
- let ke = Ce;
1642
- function tr() {
1643
- return new ke();
1644
- }
1645
- s(tr, "registry");
1646
- const te = /* @__PURE__ */ tr();
1647
- function nr(e, t) {
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
- ...h(t)
1645
+ ...d(t)
1651
1646
  });
1652
1647
  }
1653
- s(nr, "_string");
1654
- function or(e, t) {
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
- ...h(t)
1655
+ ...d(t)
1661
1656
  });
1662
1657
  }
1663
- s(or, "_email");
1664
- function tt(e, t) {
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
- ...h(t)
1665
+ ...d(t)
1671
1666
  });
1672
1667
  }
1673
- s(tt, "_guid");
1674
- function rr(e, t) {
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
- ...h(t)
1675
+ ...d(t)
1681
1676
  });
1682
1677
  }
1683
- s(rr, "_uuid");
1684
- function ir(e, t) {
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
- ...h(t)
1686
+ ...d(t)
1692
1687
  });
1693
1688
  }
1694
- s(ir, "_uuidv4");
1695
- function ar(e, t) {
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
- ...h(t)
1697
+ ...d(t)
1703
1698
  });
1704
1699
  }
1705
- s(ar, "_uuidv6");
1706
- function sr(e, t) {
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
- ...h(t)
1708
+ ...d(t)
1714
1709
  });
1715
1710
  }
1716
- s(sr, "_uuidv7");
1717
- function cr(e, t) {
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
- ...h(t)
1718
+ ...d(t)
1724
1719
  });
1725
1720
  }
1726
- s(cr, "_url");
1727
- function ur(e, t) {
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
- ...h(t)
1728
+ ...d(t)
1734
1729
  });
1735
1730
  }
1736
- s(ur, "_emoji");
1737
- function lr(e, t) {
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
- ...h(t)
1738
+ ...d(t)
1744
1739
  });
1745
1740
  }
1746
- s(lr, "_nanoid");
1747
- function dr(e, t) {
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
- ...h(t)
1748
+ ...d(t)
1754
1749
  });
1755
1750
  }
1756
- s(dr, "_cuid");
1757
- function pr(e, t) {
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
- ...h(t)
1758
+ ...d(t)
1764
1759
  });
1765
1760
  }
1766
- s(pr, "_cuid2");
1767
- function hr(e, t) {
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
- ...h(t)
1768
+ ...d(t)
1774
1769
  });
1775
1770
  }
1776
- s(hr, "_ulid");
1777
- function fr(e, t) {
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
- ...h(t)
1778
+ ...d(t)
1784
1779
  });
1785
1780
  }
1786
- s(fr, "_xid");
1787
- function mr(e, t) {
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
- ...h(t)
1788
+ ...d(t)
1794
1789
  });
1795
1790
  }
1796
- s(mr, "_ksuid");
1797
- function gr(e, t) {
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
- ...h(t)
1798
+ ...d(t)
1804
1799
  });
1805
1800
  }
1806
- s(gr, "_ipv4");
1807
- function vr(e, t) {
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
- ...h(t)
1808
+ ...d(t)
1814
1809
  });
1815
1810
  }
1816
- s(vr, "_ipv6");
1817
- function _r(e, t) {
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
- ...h(t)
1818
+ ...d(t)
1824
1819
  });
1825
1820
  }
1826
- s(_r, "_cidrv4");
1827
- function wr(e, t) {
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
- ...h(t)
1828
+ ...d(t)
1834
1829
  });
1835
1830
  }
1836
- s(wr, "_cidrv6");
1837
- function br(e, t) {
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
- ...h(t)
1838
+ ...d(t)
1844
1839
  });
1845
1840
  }
1846
- s(br, "_base64");
1847
- function kr(e, t) {
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
- ...h(t)
1848
+ ...d(t)
1854
1849
  });
1855
1850
  }
1856
- s(kr, "_base64url");
1857
- function zr(e, t) {
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
- ...h(t)
1858
+ ...d(t)
1864
1859
  });
1865
1860
  }
1866
- s(zr, "_e164");
1867
- function yr(e, t) {
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
- ...h(t)
1868
+ ...d(t)
1874
1869
  });
1875
1870
  }
1876
- s(yr, "_jwt");
1877
- function $r(e, t) {
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
- ...h(t)
1880
+ ...d(t)
1886
1881
  });
1887
1882
  }
1888
- s($r, "_isoDateTime");
1889
- function Zr(e, t) {
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
- ...h(t)
1889
+ ...d(t)
1895
1890
  });
1896
1891
  }
1897
- s(Zr, "_isoDate");
1898
- function Ir(e, t) {
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
- ...h(t)
1899
+ ...d(t)
1905
1900
  });
1906
1901
  }
1907
- s(Ir, "_isoTime");
1908
- function Sr(e, t) {
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
- ...h(t)
1908
+ ...d(t)
1914
1909
  });
1915
1910
  }
1916
- s(Sr, "_isoDuration");
1917
- function Ar(e, t) {
1911
+ a(ir, "_isoDuration");
1912
+ function cr(e, t) {
1918
1913
  return new e({
1919
1914
  type: "number",
1920
1915
  checks: [],
1921
- ...h(t)
1916
+ ...d(t)
1922
1917
  });
1923
1918
  }
1924
- s(Ar, "_number");
1925
- function Er(e, t) {
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
- ...h(t)
1926
+ ...d(t)
1932
1927
  });
1933
1928
  }
1934
- s(Er, "_int");
1935
- function Tr(e, t) {
1929
+ a(ar, "_int");
1930
+ function ur(e, t) {
1936
1931
  return new e({
1937
1932
  type: "boolean",
1938
- ...h(t)
1933
+ ...d(t)
1939
1934
  });
1940
1935
  }
1941
- s(Tr, "_boolean");
1942
- function jr(e) {
1936
+ a(ur, "_boolean");
1937
+ function sr(e) {
1943
1938
  return new e({
1944
1939
  type: "any"
1945
1940
  });
1946
1941
  }
1947
- s(jr, "_any");
1948
- function Pr(e) {
1942
+ a(sr, "_any");
1943
+ function lr(e) {
1949
1944
  return new e({
1950
1945
  type: "unknown"
1951
1946
  });
1952
1947
  }
1953
- s(Pr, "_unknown");
1954
- function Or(e, t) {
1948
+ a(lr, "_unknown");
1949
+ function pr(e, t) {
1955
1950
  return new e({
1956
1951
  type: "never",
1957
- ...h(t)
1952
+ ...d(t)
1958
1953
  });
1959
1954
  }
1960
- s(Or, "_never");
1961
- function xr(e, t) {
1955
+ a(pr, "_never");
1956
+ function dr(e, t) {
1962
1957
  return new e({
1963
1958
  type: "date",
1964
- ...h(t)
1959
+ ...d(t)
1965
1960
  });
1966
1961
  }
1967
- s(xr, "_date");
1968
- function nt(e, t) {
1969
- return new yt({
1962
+ a(dr, "_date");
1963
+ function Re(e, t) {
1964
+ return new it({
1970
1965
  check: "less_than",
1971
- ...h(t),
1966
+ ...d(t),
1972
1967
  value: e,
1973
1968
  inclusive: !1
1974
1969
  });
1975
1970
  }
1976
- s(nt, "_lt");
1977
- function ae(e, t) {
1978
- return new yt({
1971
+ a(Re, "_lt");
1972
+ function H(e, t) {
1973
+ return new it({
1979
1974
  check: "less_than",
1980
- ...h(t),
1975
+ ...d(t),
1981
1976
  value: e,
1982
1977
  inclusive: !0
1983
1978
  });
1984
1979
  }
1985
- s(ae, "_lte");
1986
- function ot(e, t) {
1987
- return new $t({
1980
+ a(H, "_lte");
1981
+ function Ue(e, t) {
1982
+ return new ct({
1988
1983
  check: "greater_than",
1989
- ...h(t),
1984
+ ...d(t),
1990
1985
  value: e,
1991
1986
  inclusive: !1
1992
1987
  });
1993
1988
  }
1994
- s(ot, "_gt");
1995
- function se(e, t) {
1996
- return new $t({
1989
+ a(Ue, "_gt");
1990
+ function Q(e, t) {
1991
+ return new ct({
1997
1992
  check: "greater_than",
1998
- ...h(t),
1993
+ ...d(t),
1999
1994
  value: e,
2000
1995
  inclusive: !0
2001
1996
  });
2002
1997
  }
2003
- s(se, "_gte");
2004
- function rt(e, t) {
2005
- return new Jn({
1998
+ a(Q, "_gte");
1999
+ function Le(e, t) {
2000
+ return new yn({
2006
2001
  check: "multiple_of",
2007
- ...h(t),
2002
+ ...d(t),
2008
2003
  value: e
2009
2004
  });
2010
2005
  }
2011
- s(rt, "_multipleOf");
2012
- function Tt(e, t) {
2013
- return new qn({
2006
+ a(Le, "_multipleOf");
2007
+ function dt(e, t) {
2008
+ return new An({
2014
2009
  check: "max_length",
2015
- ...h(t),
2010
+ ...d(t),
2016
2011
  maximum: e
2017
2012
  });
2018
2013
  }
2019
- s(Tt, "_maxLength");
2020
- function le(e, t) {
2021
- return new Yn({
2014
+ a(dt, "_maxLength");
2015
+ function ne(e, t) {
2016
+ return new En({
2022
2017
  check: "min_length",
2023
- ...h(t),
2018
+ ...d(t),
2024
2019
  minimum: e
2025
2020
  });
2026
2021
  }
2027
- s(le, "_minLength");
2028
- function jt(e, t) {
2029
- return new Xn({
2022
+ a(ne, "_minLength");
2023
+ function ht(e, t) {
2024
+ return new Sn({
2030
2025
  check: "length_equals",
2031
- ...h(t),
2026
+ ...d(t),
2032
2027
  length: e
2033
2028
  });
2034
2029
  }
2035
- s(jt, "_length");
2036
- function Cr(e, t) {
2037
- return new Hn({
2030
+ a(ht, "_length");
2031
+ function hr(e, t) {
2032
+ return new On({
2038
2033
  check: "string_format",
2039
2034
  format: "regex",
2040
- ...h(t),
2035
+ ...d(t),
2041
2036
  pattern: e
2042
2037
  });
2043
2038
  }
2044
- s(Cr, "_regex");
2045
- function Nr(e) {
2046
- return new Qn({
2039
+ a(hr, "_regex");
2040
+ function fr(e) {
2041
+ return new Pn({
2047
2042
  check: "string_format",
2048
2043
  format: "lowercase",
2049
- ...h(e)
2044
+ ...d(e)
2050
2045
  });
2051
2046
  }
2052
- s(Nr, "_lowercase");
2053
- function Ur(e) {
2054
- return new eo({
2047
+ a(fr, "_lowercase");
2048
+ function mr(e) {
2049
+ return new Tn({
2055
2050
  check: "string_format",
2056
2051
  format: "uppercase",
2057
- ...h(e)
2052
+ ...d(e)
2058
2053
  });
2059
2054
  }
2060
- s(Ur, "_uppercase");
2061
- function Dr(e, t) {
2062
- return new to({
2055
+ a(mr, "_uppercase");
2056
+ function _r(e, t) {
2057
+ return new xn({
2063
2058
  check: "string_format",
2064
2059
  format: "includes",
2065
- ...h(t),
2060
+ ...d(t),
2066
2061
  includes: e
2067
2062
  });
2068
2063
  }
2069
- s(Dr, "_includes");
2070
- function Fr(e, t) {
2071
- return new no({
2064
+ a(_r, "_includes");
2065
+ function vr(e, t) {
2066
+ return new Nn({
2072
2067
  check: "string_format",
2073
2068
  format: "starts_with",
2074
- ...h(t),
2069
+ ...d(t),
2075
2070
  prefix: e
2076
2071
  });
2077
2072
  }
2078
- s(Fr, "_startsWith");
2079
- function Rr(e, t) {
2080
- return new oo({
2073
+ a(vr, "_startsWith");
2074
+ function gr(e, t) {
2075
+ return new jn({
2081
2076
  check: "string_format",
2082
2077
  format: "ends_with",
2083
- ...h(t),
2078
+ ...d(t),
2084
2079
  suffix: e
2085
2080
  });
2086
2081
  }
2087
- s(Rr, "_endsWith");
2088
- function X(e) {
2089
- return new ro({
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
- s(X, "_overwrite");
2095
- function Lr(e) {
2096
- return X((t) => t.normalize(e));
2089
+ a(J, "_overwrite");
2090
+ function br(e) {
2091
+ return J((t) => t.normalize(e));
2097
2092
  }
2098
- s(Lr, "_normalize");
2099
- function Mr() {
2100
- return X((e) => e.trim());
2093
+ a(br, "_normalize");
2094
+ function zr() {
2095
+ return J((e) => e.trim());
2101
2096
  }
2102
- s(Mr, "_trim");
2103
- function Vr() {
2104
- return X((e) => e.toLowerCase());
2097
+ a(zr, "_trim");
2098
+ function wr() {
2099
+ return J((e) => e.toLowerCase());
2105
2100
  }
2106
- s(Vr, "_toLowerCase");
2107
- function Br() {
2108
- return X((e) => e.toUpperCase());
2101
+ a(wr, "_toLowerCase");
2102
+ function kr() {
2103
+ return J((e) => e.toUpperCase());
2109
2104
  }
2110
- s(Br, "_toUpperCase");
2111
- function Wr(e, t, n) {
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
- ...h(n)
2113
+ ...d(n)
2119
2114
  });
2120
2115
  }
2121
- s(Wr, "_array");
2122
- function Gr(e, t, n) {
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
- ...h(n)
2122
+ ...d(n)
2128
2123
  });
2129
2124
  }
2130
- s(Gr, "_refine");
2131
- function Jr(e) {
2132
- const t = Kr((n) => (n.addIssue = (o) => {
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(q(o, n.value, t._zod.def));
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(q(r));
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
- s(Jr, "_superRefine");
2143
- function Kr(e, t) {
2137
+ a(yr, "_superRefine");
2138
+ function Ir(e, t) {
2144
2139
  const n = new A({
2145
2140
  check: "custom",
2146
- ...h(t)
2141
+ ...d(t)
2147
2142
  });
2148
2143
  return n._zod.check = e, n;
2149
2144
  }
2150
- s(Kr, "_check");
2151
- const qr = /* @__PURE__ */ c("ZodISODateTime", (e, t) => {
2152
- _o.init(e, t), w.init(e, t);
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 Yr(e) {
2155
- return $r(qr, e);
2149
+ function Er(e) {
2150
+ return nr(Ar, e);
2156
2151
  }
2157
- s(Yr, "datetime");
2158
- const Xr = /* @__PURE__ */ c("ZodISODate", (e, t) => {
2159
- wo.init(e, t), w.init(e, t);
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 Hr(e) {
2162
- return Zr(Xr, e);
2156
+ function Or(e) {
2157
+ return or(Sr, e);
2163
2158
  }
2164
- s(Hr, "date$1");
2165
- const Qr = /* @__PURE__ */ c("ZodISOTime", (e, t) => {
2166
- bo.init(e, t), w.init(e, t);
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 ei(e) {
2169
- return Ir(Qr, e);
2163
+ function Tr(e) {
2164
+ return rr(Pr, e);
2170
2165
  }
2171
- s(ei, "time");
2172
- const ti = /* @__PURE__ */ c("ZodISODuration", (e, t) => {
2173
- ko.init(e, t), w.init(e, t);
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 ni(e) {
2176
- return Sr(ti, e);
2170
+ function Nr(e) {
2171
+ return ir(xr, e);
2177
2172
  }
2178
- s(ni, "duration");
2179
- const oi = /* @__PURE__ */ s((e, t) => {
2180
- vt.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
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__ */ s((n) => un(e, n), "value")
2177
+ value: /* @__PURE__ */ a((n) => Ut(e, n), "value")
2183
2178
  // enumerable: false,
2184
2179
  },
2185
2180
  flatten: {
2186
- value: /* @__PURE__ */ s((n) => cn(e, n), "value")
2181
+ value: /* @__PURE__ */ a((n) => Rt(e, n), "value")
2187
2182
  // enumerable: false,
2188
2183
  },
2189
2184
  addIssue: {
2190
- value: /* @__PURE__ */ s((n) => {
2191
- e.issues.push(n), e.message = JSON.stringify(e.issues, _e, 2);
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__ */ s((n) => {
2197
- e.issues.push(...n), e.message = JSON.stringify(e.issues, _e, 2);
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"), T = c("ZodError", oi, {
2203
+ }, "initializer"), S = u("ZodError", jr, {
2209
2204
  Parent: Error
2210
- }), ri = /* @__PURE__ */ Ee(T), ii = /* @__PURE__ */ Te(T), ai = /* @__PURE__ */ fe(T), si = /* @__PURE__ */ me(T), ci = /* @__PURE__ */ pn(T), ui = /* @__PURE__ */ hn(T), li = /* @__PURE__ */ fn(T), di = /* @__PURE__ */ mn(T), pi = /* @__PURE__ */ gn(T), hi = /* @__PURE__ */ vn(T), fi = /* @__PURE__ */ _n(T), mi = /* @__PURE__ */ wn(T), _ = /* @__PURE__ */ c("ZodType", (e, t) => (g.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(M(t, {
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) => D(e, n, o), e.brand = () => e, e.register = ((n, o) => (n.add(e, o), e)), e.parse = (n, o) => ri(e, n, o, { callee: e.parse }), e.safeParse = (n, o) => ai(e, n, o), e.parseAsync = async (n, o) => ii(e, n, o, { callee: e.parseAsync }), e.safeParseAsync = async (n, o) => si(e, n, o), e.spa = e.safeParseAsync, e.encode = (n, o) => ci(e, n, o), e.decode = (n, o) => ui(e, n, o), e.encodeAsync = async (n, o) => li(e, n, o), e.decodeAsync = async (n, o) => di(e, n, o), e.safeEncode = (n, o) => pi(e, n, o), e.safeDecode = (n, o) => hi(e, n, o), e.safeEncodeAsync = async (n, o) => fi(e, n, o), e.safeDecodeAsync = async (n, o) => mi(e, n, o), e.refine = (n, o) => e.check(sa(n, o)), e.superRefine = (n) => e.check(ca(n)), e.overwrite = (n) => e.check(X(n)), e.optional = () => ct(e), e.nullable = () => ut(e), e.nullish = () => ct(ut(e)), e.nonoptional = (n) => ea(e, n), e.array = () => U(e), e.or = (n) => pe([e, n]), e.and = (n) => Wi(e, n), e.transform = (n) => lt(e, Ki(n)), e.default = (n) => Xi(e, n), e.prefault = (n) => Qi(e, n), e.catch = (n) => na(e, n), e.pipe = (n) => lt(e, n), e.readonly = () => ia(e), e.describe = (n) => {
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 te.add(o, { description: n }), o;
2212
+ return X.add(o, { description: n }), o;
2218
2213
  }, Object.defineProperty(e, "description", {
2219
2214
  get() {
2220
- return te.get(e)?.description;
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 te.get(e);
2220
+ return X.get(e);
2226
2221
  const o = e.clone();
2227
- return te.add(o, n[0]), o;
2228
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Pt = /* @__PURE__ */ c("_ZodString", (e, t) => {
2229
- je.init(e, t), _.init(e, t);
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(Cr(...o)), e.includes = (...o) => e.check(Dr(...o)), e.startsWith = (...o) => e.check(Fr(...o)), e.endsWith = (...o) => e.check(Rr(...o)), e.min = (...o) => e.check(le(...o)), e.max = (...o) => e.check(Tt(...o)), e.length = (...o) => e.check(jt(...o)), e.nonempty = (...o) => e.check(le(1, ...o)), e.lowercase = (o) => e.check(Nr(o)), e.uppercase = (o) => e.check(Ur(o)), e.trim = () => e.check(Mr()), e.normalize = (...o) => e.check(Lr(...o)), e.toLowerCase = () => e.check(Vr()), e.toUpperCase = () => e.check(Br());
2232
- }), gi = /* @__PURE__ */ c("ZodString", (e, t) => {
2233
- je.init(e, t), Pt.init(e, t), e.email = (n) => e.check(or(vi, n)), e.url = (n) => e.check(cr(_i, n)), e.jwt = (n) => e.check(yr(Oi, n)), e.emoji = (n) => e.check(ur(wi, n)), e.guid = (n) => e.check(tt(it, n)), e.uuid = (n) => e.check(rr(ne, n)), e.uuidv4 = (n) => e.check(ir(ne, n)), e.uuidv6 = (n) => e.check(ar(ne, n)), e.uuidv7 = (n) => e.check(sr(ne, n)), e.nanoid = (n) => e.check(lr(bi, n)), e.guid = (n) => e.check(tt(it, n)), e.cuid = (n) => e.check(dr(ki, n)), e.cuid2 = (n) => e.check(pr(zi, n)), e.ulid = (n) => e.check(hr(yi, n)), e.base64 = (n) => e.check(br(Ti, n)), e.base64url = (n) => e.check(kr(ji, n)), e.xid = (n) => e.check(fr($i, n)), e.ksuid = (n) => e.check(mr(Zi, n)), e.ipv4 = (n) => e.check(gr(Ii, n)), e.ipv6 = (n) => e.check(vr(Si, n)), e.cidrv4 = (n) => e.check(_r(Ai, n)), e.cidrv6 = (n) => e.check(wr(Ei, n)), e.e164 = (n) => e.check(zr(Pi, n)), e.datetime = (n) => e.check(Yr(n)), e.date = (n) => e.check(Hr(n)), e.time = (n) => e.check(ei(n)), e.duration = (n) => e.check(ni(n));
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 nr(gi, e);
2237
- }
2238
- s(l, "string");
2239
- const w = /* @__PURE__ */ c("ZodStringFormat", (e, t) => {
2240
- v.init(e, t), Pt.init(e, t);
2241
- }), vi = /* @__PURE__ */ c("ZodEmail", (e, t) => {
2242
- co.init(e, t), w.init(e, t);
2243
- }), it = /* @__PURE__ */ c("ZodGUID", (e, t) => {
2244
- ao.init(e, t), w.init(e, t);
2245
- }), ne = /* @__PURE__ */ c("ZodUUID", (e, t) => {
2246
- so.init(e, t), w.init(e, t);
2247
- }), _i = /* @__PURE__ */ c("ZodURL", (e, t) => {
2248
- uo.init(e, t), w.init(e, t);
2249
- }), wi = /* @__PURE__ */ c("ZodEmoji", (e, t) => {
2250
- lo.init(e, t), w.init(e, t);
2251
- }), bi = /* @__PURE__ */ c("ZodNanoID", (e, t) => {
2252
- po.init(e, t), w.init(e, t);
2253
- }), ki = /* @__PURE__ */ c("ZodCUID", (e, t) => {
2254
- ho.init(e, t), w.init(e, t);
2255
- }), zi = /* @__PURE__ */ c("ZodCUID2", (e, t) => {
2256
- fo.init(e, t), w.init(e, t);
2257
- }), yi = /* @__PURE__ */ c("ZodULID", (e, t) => {
2258
- mo.init(e, t), w.init(e, t);
2259
- }), $i = /* @__PURE__ */ c("ZodXID", (e, t) => {
2260
- go.init(e, t), w.init(e, t);
2261
- }), Zi = /* @__PURE__ */ c("ZodKSUID", (e, t) => {
2262
- vo.init(e, t), w.init(e, t);
2263
- }), Ii = /* @__PURE__ */ c("ZodIPv4", (e, t) => {
2264
- zo.init(e, t), w.init(e, t);
2265
- }), Si = /* @__PURE__ */ c("ZodIPv6", (e, t) => {
2266
- yo.init(e, t), w.init(e, t);
2267
- }), Ai = /* @__PURE__ */ c("ZodCIDRv4", (e, t) => {
2268
- $o.init(e, t), w.init(e, t);
2269
- }), Ei = /* @__PURE__ */ c("ZodCIDRv6", (e, t) => {
2270
- Zo.init(e, t), w.init(e, t);
2271
- }), Ti = /* @__PURE__ */ c("ZodBase64", (e, t) => {
2272
- Io.init(e, t), w.init(e, t);
2273
- }), ji = /* @__PURE__ */ c("ZodBase64URL", (e, t) => {
2274
- Ao.init(e, t), w.init(e, t);
2275
- }), Pi = /* @__PURE__ */ c("ZodE164", (e, t) => {
2276
- Eo.init(e, t), w.init(e, t);
2277
- }), Oi = /* @__PURE__ */ c("ZodJWT", (e, t) => {
2278
- jo.init(e, t), w.init(e, t);
2279
- }), Ot = /* @__PURE__ */ c("ZodNumber", (e, t) => {
2280
- It.init(e, t), _.init(e, t), e.gt = (o, r) => e.check(ot(o, r)), e.gte = (o, r) => e.check(se(o, r)), e.min = (o, r) => e.check(se(o, r)), e.lt = (o, r) => e.check(nt(o, r)), e.lte = (o, r) => e.check(ae(o, r)), e.max = (o, r) => e.check(ae(o, r)), e.int = (o) => e.check(at(o)), e.safe = (o) => e.check(at(o)), e.positive = (o) => e.check(ot(0, o)), e.nonnegative = (o) => e.check(se(0, o)), e.negative = (o) => e.check(nt(0, o)), e.nonpositive = (o) => e.check(ae(0, o)), e.multipleOf = (o, r) => e.check(rt(o, r)), e.step = (o, r) => e.check(rt(o, r)), e.finite = () => e;
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 S(e) {
2285
- return Ar(Ot, e);
2279
+ function I(e) {
2280
+ return cr(mt, e);
2286
2281
  }
2287
- s(S, "number");
2288
- const xi = /* @__PURE__ */ c("ZodNumberFormat", (e, t) => {
2289
- Po.init(e, t), Ot.init(e, t);
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 at(e) {
2292
- return Er(xi, e);
2286
+ function Ve(e) {
2287
+ return ar(di, e);
2293
2288
  }
2294
- s(at, "int");
2295
- const Ci = /* @__PURE__ */ c("ZodBoolean", (e, t) => {
2296
- Oo.init(e, t), _.init(e, t);
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 I(e) {
2299
- return Tr(Ci, e);
2293
+ function y(e) {
2294
+ return ur(hi, e);
2300
2295
  }
2301
- s(I, "boolean");
2302
- const Ni = /* @__PURE__ */ c("ZodAny", (e, t) => {
2303
- xo.init(e, t), _.init(e, t);
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 de() {
2306
- return jr(Ni);
2300
+ function oe() {
2301
+ return sr(fi);
2307
2302
  }
2308
- s(de, "any");
2309
- const Ui = /* @__PURE__ */ c("ZodUnknown", (e, t) => {
2310
- Co.init(e, t), _.init(e, t);
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 st() {
2313
- return Pr(Ui);
2307
+ function Be() {
2308
+ return lr(mi);
2314
2309
  }
2315
- s(st, "unknown");
2316
- const Di = /* @__PURE__ */ c("ZodNever", (e, t) => {
2317
- No.init(e, t), _.init(e, t);
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 Fi(e) {
2320
- return Or(Di, e);
2314
+ function vi(e) {
2315
+ return pr(_i, e);
2321
2316
  }
2322
- s(Fi, "never");
2323
- const Ri = /* @__PURE__ */ c("ZodDate", (e, t) => {
2324
- Uo.init(e, t), _.init(e, t), e.min = (o, r) => e.check(se(o, r)), e.max = (o, r) => e.check(ae(o, r));
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 ze(e) {
2329
- return xr(Ri, e);
2323
+ function fe(e) {
2324
+ return dr(gi, e);
2330
2325
  }
2331
- s(ze, "date");
2332
- const Li = /* @__PURE__ */ c("ZodArray", (e, t) => {
2333
- Do.init(e, t), _.init(e, t), e.element = t.element, e.min = (n, o) => e.check(le(n, o)), e.nonempty = (n) => e.check(le(1, n)), e.max = (n, o) => e.check(Tt(n, o)), e.length = (n, o) => e.check(jt(n, o)), e.unwrap = () => e.element;
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 U(e, t) {
2336
- return Wr(Li, e, t);
2330
+ function N(e, t) {
2331
+ return Zr(bi, e, t);
2337
2332
  }
2338
- s(U, "array");
2339
- const Mi = /* @__PURE__ */ c("ZodObject", (e, t) => {
2340
- Ro.init(e, t), _.init(e, t), m(e, "shape", () => t.shape), e.keyof = () => z(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: st() }), e.loose = () => e.clone({ ...e._zod.def, catchall: st() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Fi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => nn(e, n), e.safeExtend = (n) => on(e, n), e.merge = (n) => rn(e, n), e.pick = (n) => en(e, n), e.omit = (n) => tn(e, n), e.partial = (...n) => an(Nt, e, n[0]), e.required = (...n) => sn(Ut, e, n[0]);
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 y(e, t) {
2337
+ function Z(e, t) {
2343
2338
  const n = {
2344
2339
  type: "object",
2345
2340
  shape: e ?? {},
2346
- ...h(t)
2341
+ ...d(t)
2347
2342
  };
2348
- return new Mi(n);
2343
+ return new zi(n);
2349
2344
  }
2350
- s(y, "object");
2351
- const xt = /* @__PURE__ */ c("ZodUnion", (e, t) => {
2352
- Et.init(e, t), _.init(e, t), e.options = t.options;
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 pe(e, t) {
2355
- return new xt({
2349
+ function re(e, t) {
2350
+ return new _t({
2356
2351
  type: "union",
2357
2352
  options: e,
2358
- ...h(t)
2353
+ ...d(t)
2359
2354
  });
2360
2355
  }
2361
- s(pe, "union");
2362
- const Vi = /* @__PURE__ */ c("ZodDiscriminatedUnion", (e, t) => {
2363
- xt.init(e, t), Lo.init(e, t);
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 Ct(e, t, n) {
2366
- return new Vi({
2360
+ function vt(e, t, n) {
2361
+ return new wi({
2367
2362
  type: "union",
2368
2363
  options: t,
2369
2364
  discriminator: e,
2370
- ...h(n)
2365
+ ...d(n)
2371
2366
  });
2372
2367
  }
2373
- s(Ct, "discriminatedUnion");
2374
- const Bi = /* @__PURE__ */ c("ZodIntersection", (e, t) => {
2375
- Mo.init(e, t), _.init(e, t);
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 Wi(e, t) {
2378
- return new Bi({
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
- s(Wi, "intersection");
2385
- const ye = /* @__PURE__ */ c("ZodEnum", (e, t) => {
2386
- Vo.init(e, t), _.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
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 i = {};
2390
- for (const a of o)
2391
- if (n.has(a))
2392
- i[a] = t.entries[a];
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 ${a} not found in enum`);
2395
- return new ye({
2389
+ throw new Error(`Key ${i} not found in enum`);
2390
+ return new me({
2396
2391
  ...t,
2397
2392
  checks: [],
2398
- ...h(r),
2399
- entries: i
2393
+ ...d(r),
2394
+ entries: c
2400
2395
  });
2401
2396
  }, e.exclude = (o, r) => {
2402
- const i = { ...t.entries };
2403
- for (const a of o)
2404
- if (n.has(a))
2405
- delete i[a];
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 ${a} not found in enum`);
2408
- return new ye({
2402
+ throw new Error(`Key ${i} not found in enum`);
2403
+ return new me({
2409
2404
  ...t,
2410
2405
  checks: [],
2411
- ...h(r),
2412
- entries: i
2406
+ ...d(r),
2407
+ entries: c
2413
2408
  });
2414
2409
  };
2415
2410
  });
2416
- function z(e, t) {
2411
+ function k(e, t) {
2417
2412
  const n = Array.isArray(e) ? Object.fromEntries(e.map((o) => [o, o])) : e;
2418
- return new ye({
2413
+ return new me({
2419
2414
  type: "enum",
2420
2415
  entries: n,
2421
- ...h(t)
2416
+ ...d(t)
2422
2417
  });
2423
2418
  }
2424
- s(z, "_enum");
2425
- const Gi = /* @__PURE__ */ c("ZodLiteral", (e, t) => {
2426
- Bo.init(e, t), _.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
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 Y(e, t) {
2435
- return new Gi({
2429
+ function G(e, t) {
2430
+ return new $i({
2436
2431
  type: "literal",
2437
2432
  values: Array.isArray(e) ? e : [e],
2438
- ...h(t)
2433
+ ...d(t)
2439
2434
  });
2440
2435
  }
2441
- s(Y, "literal");
2442
- const Ji = /* @__PURE__ */ c("ZodTransform", (e, t) => {
2443
- Wo.init(e, t), _.init(e, t), e._zod.parse = (n, o) => {
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 ce(e.constructor.name);
2446
- n.addIssue = (i) => {
2447
- if (typeof i == "string")
2448
- n.issues.push(q(i, n.value, t));
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 a = i;
2451
- a.fatal && (a.continue = !1), a.code ?? (a.code = "custom"), a.input ?? (a.input = n.value), a.inst ?? (a.inst = e), n.issues.push(q(a));
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((i) => (n.value = i, n)) : (n.value = r, n);
2450
+ return r instanceof Promise ? r.then((c) => (n.value = c, n)) : (n.value = r, n);
2456
2451
  };
2457
2452
  });
2458
- function Ki(e) {
2459
- return new Ji({
2453
+ function Ii(e) {
2454
+ return new yi({
2460
2455
  type: "transform",
2461
2456
  transform: e
2462
2457
  });
2463
2458
  }
2464
- s(Ki, "transform");
2465
- const Nt = /* @__PURE__ */ c("ZodOptional", (e, t) => {
2466
- Go.init(e, t), _.init(e, t), e.unwrap = () => e._zod.def.innerType;
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 ct(e) {
2469
- return new Nt({
2463
+ function We(e) {
2464
+ return new gt({
2470
2465
  type: "optional",
2471
2466
  innerType: e
2472
2467
  });
2473
2468
  }
2474
- s(ct, "optional");
2475
- const qi = /* @__PURE__ */ c("ZodNullable", (e, t) => {
2476
- Jo.init(e, t), _.init(e, t), e.unwrap = () => e._zod.def.innerType;
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 ut(e) {
2479
- return new qi({
2473
+ function Ge(e) {
2474
+ return new Ai({
2480
2475
  type: "nullable",
2481
2476
  innerType: e
2482
2477
  });
2483
2478
  }
2484
- s(ut, "nullable");
2485
- const Yi = /* @__PURE__ */ c("ZodDefault", (e, t) => {
2486
- Ko.init(e, t), _.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
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 Xi(e, t) {
2489
- return new Yi({
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() : ft(t);
2488
+ return typeof t == "function" ? t() : Xe(t);
2494
2489
  }
2495
2490
  });
2496
2491
  }
2497
- s(Xi, "_default");
2498
- const Hi = /* @__PURE__ */ c("ZodPrefault", (e, t) => {
2499
- qo.init(e, t), _.init(e, t), e.unwrap = () => e._zod.def.innerType;
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 Qi(e, t) {
2502
- return new Hi({
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() : ft(t);
2501
+ return typeof t == "function" ? t() : Xe(t);
2507
2502
  }
2508
2503
  });
2509
2504
  }
2510
- s(Qi, "prefault");
2511
- const Ut = /* @__PURE__ */ c("ZodNonOptional", (e, t) => {
2512
- Yo.init(e, t), _.init(e, t), e.unwrap = () => e._zod.def.innerType;
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 ea(e, t) {
2515
- return new Ut({
2509
+ function Ti(e, t) {
2510
+ return new bt({
2516
2511
  type: "nonoptional",
2517
2512
  innerType: e,
2518
- ...h(t)
2513
+ ...d(t)
2519
2514
  });
2520
2515
  }
2521
- s(ea, "nonoptional");
2522
- const ta = /* @__PURE__ */ c("ZodCatch", (e, t) => {
2523
- Xo.init(e, t), _.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
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 na(e, t) {
2526
- return new ta({
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
- s(na, "_catch");
2533
- const oa = /* @__PURE__ */ c("ZodPipe", (e, t) => {
2534
- Ho.init(e, t), _.init(e, t), e.in = t.in, e.out = t.out;
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 lt(e, t) {
2537
- return new oa({
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
- s(lt, "pipe");
2545
- const ra = /* @__PURE__ */ c("ZodReadonly", (e, t) => {
2546
- Qo.init(e, t), _.init(e, t), e.unwrap = () => e._zod.def.innerType;
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 ia(e) {
2549
- return new ra({
2543
+ function Ci(e) {
2544
+ return new Di({
2550
2545
  type: "readonly",
2551
2546
  innerType: e
2552
2547
  });
2553
2548
  }
2554
- s(ia, "readonly");
2555
- const aa = /* @__PURE__ */ c("ZodCustom", (e, t) => {
2556
- er.init(e, t), _.init(e, t);
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 sa(e, t = {}) {
2559
- return Gr(aa, e, t);
2553
+ function Ri(e, t = {}) {
2554
+ return $r(Fi, e, t);
2560
2555
  }
2561
- s(sa, "refine");
2562
- function ca(e) {
2563
- return Jr(e);
2556
+ a(Ri, "refine");
2557
+ function Ui(e) {
2558
+ return yr(e);
2564
2559
  }
2565
- s(ca, "superRefine");
2566
- const ua = z(["image", "video", "audio"]), la = z(["avatar", "cover", "voice", "general"]), da = z(["processing", "active", "failed", "deleted"]), pa = z(["jpg", "jpeg", "png", "gif", "webp", "svg"]), ha = z(["mp4", "webm", "ogg", "mov", "avi"]), fa = z(["mp3", "wav", "ogg", "aac", "flac"]), ma = y({
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: S(),
2568
+ size: I(),
2574
2569
  src: l(),
2575
2570
  alt: l().optional(),
2576
- context: la.default("general"),
2577
- status: da.default("processing"),
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
- }), N = ma.extend({
2577
+ }), x = Ji.extend({
2583
2578
  // Additional UI fields not in database
2584
- format: ua.optional(),
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: S().optional(),
2590
- height: S().optional(),
2584
+ width: I().optional(),
2585
+ height: I().optional(),
2591
2586
  // Audio/video duration
2592
- duration: S().optional(),
2587
+ duration: I().optional(),
2593
2588
  // Image blur hash for loading placeholders
2594
2589
  blurhash: l().optional()
2595
- }).partial(), ga = y({
2596
- duration: S().optional(),
2590
+ }).partial(), Ki = Z({
2591
+ duration: I().optional(),
2597
2592
  // in seconds
2598
2593
  thumbnail: l().optional(),
2599
- autoplay: I().optional(),
2600
- loop: I().optional(),
2601
- muted: I().optional(),
2602
- controls: I().optional()
2603
- }), va = y({
2604
- duration: S().optional(),
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: I().optional(),
2607
- loop: I().optional(),
2608
- muted: I().optional(),
2609
- controls: I().optional()
2610
- }), _a = N.extend({
2611
- format: Y("image"),
2612
- imageFormat: pa
2613
- }), wa = N.extend({
2614
- format: Y("video"),
2615
- videoFormat: ha,
2616
- video: ga.optional()
2617
- }), ba = N.extend({
2618
- format: Y("audio"),
2619
- audioFormat: fa,
2620
- audio: va.optional()
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
- Ct("format", [
2623
- _a,
2624
- wa,
2625
- ba
2617
+ vt("format", [
2618
+ Xi,
2619
+ qi,
2620
+ Hi
2626
2621
  ]);
2627
- const Dt = z(["xxs", "xs", "sm", "md", "lg", "xl"]), Ft = z(["primary", "default", "overlay", "red", "green", "indigo", "orange"]), Rt = z(["ghost", "link", "outline", "solid"]), ka = y({
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: Dt.optional(),
2632
- theme: Ft.optional(),
2633
- design: Rt.optional(),
2634
- icon: pe([l(), N]).optional(),
2635
- iconAfter: pe([l(), N]).optional(),
2636
- rounding: z(["full", "md", "lg"]).optional(),
2637
- loading: I().optional(),
2638
- disabled: I().optional(),
2639
- onClick: de().optional(),
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: z(["_blank", "_self"]).optional(),
2643
- type: z(["button", "submit", "reset"]).optional()
2637
+ target: k(["_blank", "_self"]).optional(),
2638
+ type: k(["button", "submit", "reset"]).optional()
2644
2639
  });
2645
- y({
2646
- buttons: U(ka).optional(),
2647
- size: Dt.optional(),
2648
- theme: Ft.optional(),
2649
- design: Rt.optional()
2640
+ Z({
2641
+ buttons: N(Qi).optional(),
2642
+ size: zt.optional(),
2643
+ theme: wt.optional(),
2644
+ design: kt.optional()
2650
2645
  });
2651
- y({
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: I().optional(),
2660
- hasPassword: I().optional(),
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: ze().optional(),
2661
+ lastSeenAt: fe().optional(),
2667
2662
  // Virtual/computed fields
2668
- onboarded: I().optional(),
2669
- selfCount: S().optional(),
2663
+ onboarded: y().optional(),
2664
+ selfCount: I().optional(),
2670
2665
  // Nested relationships (for enriched responses)
2671
- memberships: U(y({
2666
+ memberships: N(Z({
2672
2667
  membershipId: l(),
2673
2668
  orgId: l(),
2674
2669
  orgName: l(),
2675
2670
  orgHandle: l(),
2676
- role: z(["admin", "member"]),
2677
- joinedAt: ze()
2671
+ role: k(["admin", "member"]),
2672
+ joinedAt: fe()
2678
2673
  })).optional(),
2679
- selves: U(y({
2674
+ selves: N(Z({
2680
2675
  selfId: l(),
2681
2676
  handle: l(),
2682
2677
  title: l().optional(),
2683
- visibility: z(["public", "private"]).optional(),
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
- y({
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: I().optional(),
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: z(["trial", "active", "canceled", "past_due"]).optional(),
2698
+ subscriptionStatus: k(["trial", "active", "canceled", "past_due"]).optional(),
2704
2699
  trialEndsAt: l().optional(),
2705
2700
  // Virtual/computed fields
2706
- memberCount: S().optional(),
2707
- selfCount: S().optional(),
2701
+ memberCount: I().optional(),
2702
+ selfCount: I().optional(),
2708
2703
  // Nested relationships
2709
- members: U(y({
2704
+ members: N(Z({
2710
2705
  userId: l(),
2711
2706
  fullName: l().optional(),
2712
2707
  email: l(),
2713
- role: z(["admin", "member"]),
2708
+ role: k(["admin", "member"]),
2714
2709
  joinedAt: l()
2715
2710
  })).optional(),
2716
- selves: U(y({
2711
+ selves: N(Z({
2717
2712
  selfId: l(),
2718
2713
  handle: l(),
2719
2714
  title: l().optional(),
2720
- visibility: z(["public", "private"]).optional()
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
- y({
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: z(["public", "private"]).optional(),
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: y({
2742
- speed: S().optional(),
2743
- pitch: S().optional(),
2744
- volume: S().optional()
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: S().optional(),
2748
- lastActiveAt: ze().optional(),
2742
+ interactionCount: I().optional(),
2743
+ lastActiveAt: fe().optional(),
2749
2744
  // Nested relationships
2750
- owner: y({
2745
+ owner: Z({
2751
2746
  userId: l(),
2752
2747
  fullName: l().optional(),
2753
2748
  handle: l().optional()
2754
2749
  }).optional(),
2755
- org: y({
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
- Ct("ok", [
2765
- y({
2766
- ok: Y(!0),
2767
- data: de(),
2759
+ vt("ok", [
2760
+ Z({
2761
+ ok: G(!0),
2762
+ data: oe(),
2768
2763
  message: l().optional()
2769
2764
  }),
2770
- y({
2771
- ok: Y(!1),
2765
+ Z({
2766
+ ok: G(!1),
2772
2767
  error: l(),
2773
2768
  code: l().optional()
2774
2769
  })
2775
2770
  ]);
2776
- const za = y({
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: pe([l(), S()]).optional(),
2780
+ value: re([l(), I()]).optional(),
2786
2781
  description: l().optional(),
2787
2782
  info: l().optional(),
2788
- count: S().optional(),
2783
+ count: I().optional(),
2789
2784
  className: l().optional(),
2790
2785
  // Visual elements
2791
- media: N.optional(),
2792
- icon: N.optional(),
2793
- iconAfter: N.optional(),
2786
+ media: x.optional(),
2787
+ icon: x.optional(),
2788
+ iconAfter: x.optional(),
2794
2789
  // Navigation
2795
2790
  href: l().optional(),
2796
- target: z(["_self", "_blank"]).optional(),
2797
- onClick: de().optional(),
2791
+ target: k(["_self", "_blank"]).optional(),
2792
+ onClick: oe().optional(),
2798
2793
  // Function type
2799
2794
  // Styling
2800
- theme: z(["primary", "default"]).optional(),
2795
+ theme: k(["primary", "default"]).optional(),
2801
2796
  // State
2802
- isActive: I().optional(),
2803
- isDisabled: I().optional(),
2804
- isHidden: I().optional(),
2797
+ isActive: y().optional(),
2798
+ isDisabled: y().optional(),
2799
+ isHidden: y().optional(),
2805
2800
  // Organization
2806
- priority: S().optional(),
2801
+ priority: I().optional(),
2807
2802
  testId: l().optional(),
2808
2803
  // Simple nested items (one level only)
2809
- items: U(de()).optional()
2804
+ items: N(oe()).optional()
2810
2805
  // Avoid recursive schema issues
2811
2806
  });
2812
- y({
2807
+ Z({
2813
2808
  title: l().optional(),
2814
2809
  description: l().optional(),
2815
- items: U(za).optional()
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
- dt as FictionSDK,
3353
- N as MediaSchema
2813
+ rc as FictionSDK,
2814
+ x as MediaSchema
3354
2815
  };
3355
2816
  //# sourceMappingURL=sdk.js.map