@object-ui/plugin-map 4.0.3 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,3855 +1,22 @@
1
- import { n as e, r as t, t as n } from "./chunk-D8eiyYIV.js";
2
- import * as r from "react";
3
- import { forwardRef as i, memo as a, useCallback as o, useContext as s, useEffect as c, useImperativeHandle as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
4
- import { ComponentRegistry as m, buildExpandFields as h, extractRecords as ee } from "@object-ui/core";
5
- import { useNavigationOverlay as te, useSchemaContext as g } from "@object-ui/react";
6
- import { NavigationOverlay as ne, cn as re, useIsMobile as ie } from "@object-ui/components";
7
- import { createPortal as _ } from "react-dom";
8
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
9
- var ae;
10
- function v(e, t, n) {
11
- function r(n, r) {
12
- if (n._zod || Object.defineProperty(n, "_zod", {
13
- value: {
14
- def: r,
15
- constr: o,
16
- traits: /* @__PURE__ */ new Set()
17
- },
18
- enumerable: !1
19
- }), n._zod.traits.has(e)) return;
20
- n._zod.traits.add(e), t(n, r);
21
- let i = o.prototype, a = Object.keys(i);
22
- for (let e = 0; e < a.length; e++) {
23
- let t = a[e];
24
- t in n || (n[t] = i[t].bind(n));
25
- }
26
- }
27
- let i = n?.Parent ?? Object;
28
- class a extends i {}
29
- Object.defineProperty(a, "name", { value: e });
30
- function o(e) {
31
- var t;
32
- let i = n?.Parent ? new a() : this;
33
- r(i, e), (t = i._zod).deferred ?? (t.deferred = []);
34
- for (let e of i._zod.deferred) e();
35
- return i;
36
- }
37
- return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o;
38
- }
39
- var y = class extends Error {
40
- constructor() {
41
- super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
42
- }
43
- }, oe = class extends Error {
44
- constructor(e) {
45
- super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
46
- }
47
- };
48
- (ae = globalThis).__zod_globalConfig ?? (ae.__zod_globalConfig = {});
49
- var b = globalThis.__zod_globalConfig;
50
- function x(e) {
51
- return e && Object.assign(b, e), b;
52
- }
53
- //#endregion
54
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
55
- function se(e) {
56
- let t = Object.values(e).filter((e) => typeof e == "number");
57
- return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
58
- }
59
- function S(e, t) {
60
- return typeof t == "bigint" ? t.toString() : t;
61
- }
62
- function C(e) {
63
- return { get value() {
64
- {
65
- let t = e();
66
- return Object.defineProperty(this, "value", { value: t }), t;
67
- }
68
- throw Error("cached value already set");
69
- } };
70
- }
71
- function ce(e) {
72
- return e == null;
73
- }
74
- function w(e) {
75
- let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
76
- return e.slice(t, n);
77
- }
78
- function T(e, t) {
79
- let n = e / t, r = Math.round(n), i = 2 ** -52 * Math.max(Math.abs(n), 1);
80
- return Math.abs(n - r) < i ? 0 : n - r;
81
- }
82
- var E = /* @__PURE__ */ Symbol("evaluating");
83
- function D(e, t, n) {
84
- let r;
85
- Object.defineProperty(e, t, {
86
- get() {
87
- if (r !== E) return r === void 0 && (r = E, r = n()), r;
88
- },
89
- set(n) {
90
- Object.defineProperty(e, t, { value: n });
91
- },
92
- configurable: !0
93
- });
94
- }
95
- function O(e, t, n) {
96
- Object.defineProperty(e, t, {
97
- value: n,
98
- writable: !0,
99
- enumerable: !0,
100
- configurable: !0
101
- });
102
- }
103
- function k(...e) {
104
- let t = {};
105
- for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n));
106
- return Object.defineProperties({}, t);
107
- }
108
- function le(e) {
109
- return JSON.stringify(e);
110
- }
111
- function ue(e) {
112
- return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
113
- }
114
- var de = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
115
- function A(e) {
116
- return typeof e == "object" && !!e && !Array.isArray(e);
117
- }
118
- var j = /* @__PURE__ */ C(() => {
119
- if (b.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
120
- try {
121
- return Function(""), !0;
122
- } catch {
123
- return !1;
124
- }
125
- });
126
- function M(e) {
127
- if (A(e) === !1) return !1;
128
- let t = e.constructor;
129
- if (t === void 0 || typeof t != "function") return !0;
130
- let n = t.prototype;
131
- return !(A(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
132
- }
133
- function N(e) {
134
- return M(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
135
- }
136
- var P = /* @__PURE__ */ new Set([
137
- "string",
138
- "number",
139
- "symbol"
140
- ]);
141
- function F(e) {
142
- return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
143
- }
144
- function I(e, t, n) {
145
- let r = new e._zod.constr(t ?? e._zod.def);
146
- return (!t || n?.parent) && (r._zod.parent = e), r;
147
- }
148
- function L(e) {
149
- let t = e;
150
- if (!t) return {};
151
- if (typeof t == "string") return { error: () => t };
152
- if (t?.message !== void 0) {
153
- if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
154
- t.error = t.message;
155
- }
156
- return delete t.message, typeof t.error == "string" ? {
157
- ...t,
158
- error: () => t.error
159
- } : t;
160
- }
161
- function fe(e) {
162
- return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
163
- }
164
- var pe = {
165
- safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
166
- int32: [-2147483648, 2147483647],
167
- uint32: [0, 4294967295],
168
- float32: [-34028234663852886e22, 34028234663852886e22],
169
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
170
- };
171
- function R(e, t) {
172
- let n = e._zod.def, r = n.checks;
173
- if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
174
- return I(e, k(e._zod.def, {
175
- get shape() {
176
- let e = {};
177
- for (let r in t) {
178
- if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
179
- t[r] && (e[r] = n.shape[r]);
180
- }
181
- return O(this, "shape", e), e;
182
- },
183
- checks: []
184
- }));
185
- }
186
- function me(e, t) {
187
- let n = e._zod.def, r = n.checks;
188
- if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
189
- return I(e, k(e._zod.def, {
190
- get shape() {
191
- let r = { ...e._zod.def.shape };
192
- for (let e in t) {
193
- if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
194
- t[e] && delete r[e];
195
- }
196
- return O(this, "shape", r), r;
197
- },
198
- checks: []
199
- }));
200
- }
201
- function he(e, t) {
202
- if (!M(t)) throw Error("Invalid input to extend: expected a plain object");
203
- let n = e._zod.def.checks;
204
- if (n && n.length > 0) {
205
- let n = e._zod.def.shape;
206
- for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
207
- }
208
- return I(e, k(e._zod.def, { get shape() {
209
- let n = {
210
- ...e._zod.def.shape,
211
- ...t
212
- };
213
- return O(this, "shape", n), n;
214
- } }));
215
- }
216
- function ge(e, t) {
217
- if (!M(t)) throw Error("Invalid input to safeExtend: expected a plain object");
218
- return I(e, k(e._zod.def, { get shape() {
219
- let n = {
220
- ...e._zod.def.shape,
221
- ...t
222
- };
223
- return O(this, "shape", n), n;
224
- } }));
225
- }
226
- function _e(e, t) {
227
- if (e._zod.def.checks?.length) throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
228
- return I(e, k(e._zod.def, {
229
- get shape() {
230
- let n = {
231
- ...e._zod.def.shape,
232
- ...t._zod.def.shape
233
- };
234
- return O(this, "shape", n), n;
235
- },
236
- get catchall() {
237
- return t._zod.def.catchall;
238
- },
239
- checks: t._zod.def.checks ?? []
240
- }));
241
- }
242
- function ve(e, t, n) {
243
- let r = t._zod.def.checks;
244
- if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
245
- return I(t, k(t._zod.def, {
246
- get shape() {
247
- let r = t._zod.def.shape, i = { ...r };
248
- if (n) for (let t in n) {
249
- if (!(t in r)) throw Error(`Unrecognized key: "${t}"`);
250
- n[t] && (i[t] = e ? new e({
251
- type: "optional",
252
- innerType: r[t]
253
- }) : r[t]);
254
- }
255
- else for (let t in r) i[t] = e ? new e({
256
- type: "optional",
257
- innerType: r[t]
258
- }) : r[t];
259
- return O(this, "shape", i), i;
260
- },
261
- checks: []
262
- }));
263
- }
264
- function ye(e, t, n) {
265
- return I(t, k(t._zod.def, { get shape() {
266
- let r = t._zod.def.shape, i = { ...r };
267
- if (n) for (let t in n) {
268
- if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
269
- n[t] && (i[t] = new e({
270
- type: "nonoptional",
271
- innerType: r[t]
272
- }));
273
- }
274
- else for (let t in r) i[t] = new e({
275
- type: "nonoptional",
276
- innerType: r[t]
277
- });
278
- return O(this, "shape", i), i;
279
- } }));
280
- }
281
- function z(e, t = 0) {
282
- if (e.aborted === !0) return !0;
283
- for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
284
- return !1;
285
- }
286
- function be(e, t = 0) {
287
- if (e.aborted === !0) return !0;
288
- for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0;
289
- return !1;
290
- }
291
- function xe(e, t) {
292
- return t.map((t) => {
293
- var n;
294
- return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
295
- });
296
- }
297
- function Se(e) {
298
- return typeof e == "string" ? e : e?.message;
299
- }
300
- function B(e, t, n) {
301
- let r = e.message ? e.message : Se(e.inst?._zod.def?.error?.(e)) ?? Se(t?.error?.(e)) ?? Se(n.customError?.(e)) ?? Se(n.localeError?.(e)) ?? "Invalid input", { inst: i, continue: a, input: o, ...s } = e;
302
- return s.path ??= [], s.message = r, t?.reportInput && (s.input = o), s;
303
- }
304
- function Ce(e) {
305
- return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
306
- }
307
- function we(...e) {
308
- let [t, n, r] = e;
309
- return typeof t == "string" ? {
310
- message: t,
311
- code: "custom",
312
- input: n,
313
- inst: r
314
- } : { ...t };
315
- }
316
- //#endregion
317
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
318
- var Te = (e, t) => {
319
- e.name = "$ZodError", Object.defineProperty(e, "_zod", {
320
- value: e._zod,
321
- enumerable: !1
322
- }), Object.defineProperty(e, "issues", {
323
- value: t,
324
- enumerable: !1
325
- }), e.message = JSON.stringify(t, S, 2), Object.defineProperty(e, "toString", {
326
- value: () => e.message,
327
- enumerable: !1
328
- });
329
- }, Ee = v("$ZodError", Te), De = v("$ZodError", Te, { Parent: Error });
330
- function Oe(e, t = (e) => e.message) {
331
- let n = {}, r = [];
332
- for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i));
333
- return {
334
- formErrors: r,
335
- fieldErrors: n
336
- };
337
- }
338
- function ke(e, t = (e) => e.message) {
339
- let n = { _errors: [] }, r = (e, i = []) => {
340
- for (let a of e.issues) if (a.code === "invalid_union" && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path]));
341
- else if (a.code === "invalid_key") r({ issues: a.issues }, [...i, ...a.path]);
342
- else if (a.code === "invalid_element") r({ issues: a.issues }, [...i, ...a.path]);
343
- else {
344
- let e = [...i, ...a.path];
345
- if (e.length === 0) n._errors.push(t(a));
346
- else {
347
- let r = n, i = 0;
348
- for (; i < e.length;) {
349
- let n = e[i];
350
- i === e.length - 1 ? (r[n] = r[n] || { _errors: [] }, r[n]._errors.push(t(a))) : r[n] = r[n] || { _errors: [] }, r = r[n], i++;
351
- }
352
- }
353
- }
354
- };
355
- return r(e), n;
356
- }
357
- //#endregion
358
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
359
- var Ae = (e) => (t, n, r, i) => {
360
- let a = r ? {
361
- ...r,
362
- async: !1
363
- } : { async: !1 }, o = t._zod.run({
364
- value: n,
365
- issues: []
366
- }, a);
367
- if (o instanceof Promise) throw new y();
368
- if (o.issues.length) {
369
- let t = new (i?.Err ?? e)(o.issues.map((e) => B(e, a, x())));
370
- throw de(t, i?.callee), t;
371
- }
372
- return o.value;
373
- }, je = (e) => async (t, n, r, i) => {
374
- let a = r ? {
375
- ...r,
376
- async: !0
377
- } : { async: !0 }, o = t._zod.run({
378
- value: n,
379
- issues: []
380
- }, a);
381
- if (o instanceof Promise && (o = await o), o.issues.length) {
382
- let t = new (i?.Err ?? e)(o.issues.map((e) => B(e, a, x())));
383
- throw de(t, i?.callee), t;
384
- }
385
- return o.value;
386
- }, Me = (e) => (t, n, r) => {
387
- let i = r ? {
388
- ...r,
389
- async: !1
390
- } : { async: !1 }, a = t._zod.run({
391
- value: n,
392
- issues: []
393
- }, i);
394
- if (a instanceof Promise) throw new y();
395
- return a.issues.length ? {
396
- success: !1,
397
- error: new (e ?? Ee)(a.issues.map((e) => B(e, i, x())))
398
- } : {
399
- success: !0,
400
- data: a.value
401
- };
402
- }, Ne = /* @__PURE__ */ Me(De), Pe = (e) => async (t, n, r) => {
403
- let i = r ? {
404
- ...r,
405
- async: !0
406
- } : { async: !0 }, a = t._zod.run({
407
- value: n,
408
- issues: []
409
- }, i);
410
- return a instanceof Promise && (a = await a), a.issues.length ? {
411
- success: !1,
412
- error: new e(a.issues.map((e) => B(e, i, x())))
413
- } : {
414
- success: !0,
415
- data: a.value
416
- };
417
- }, Fe = /* @__PURE__ */ Pe(De), Ie = (e) => (t, n, r) => {
418
- let i = r ? {
419
- ...r,
420
- direction: "backward"
421
- } : { direction: "backward" };
422
- return Ae(e)(t, n, i);
423
- }, Le = (e) => (t, n, r) => Ae(e)(t, n, r), Re = (e) => async (t, n, r) => {
424
- let i = r ? {
425
- ...r,
426
- direction: "backward"
427
- } : { direction: "backward" };
428
- return je(e)(t, n, i);
429
- }, ze = (e) => async (t, n, r) => je(e)(t, n, r), Be = (e) => (t, n, r) => {
430
- let i = r ? {
431
- ...r,
432
- direction: "backward"
433
- } : { direction: "backward" };
434
- return Me(e)(t, n, i);
435
- }, Ve = (e) => (t, n, r) => Me(e)(t, n, r), He = (e) => async (t, n, r) => {
436
- let i = r ? {
437
- ...r,
438
- direction: "backward"
439
- } : { direction: "backward" };
440
- return Pe(e)(t, n, i);
441
- }, Ue = (e) => async (t, n, r) => Pe(e)(t, n, r), We = /^[cC][0-9a-z]{6,}$/, Ge = /^[0-9a-z]+$/, Ke = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, qe = /^[0-9a-vA-V]{20}$/, Je = /^[A-Za-z0-9]{27}$/, Ye = /^[a-zA-Z0-9_-]{21}$/, Xe = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Ze = /^([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})$/, Qe = (e) => e ? 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)$/, $e = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, et = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
442
- function tt() {
443
- return new RegExp(et, "u");
444
- }
445
- var nt = /^(?:(?: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])$/, rt = /^(([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}|:))$/, it = /^((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])$/, at = /^(([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])$/, ot = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, st = /^[A-Za-z0-9_-]*$/, ct = /^https?$/, lt = /^\+[1-9]\d{6,14}$/, ut = "(?:(?:\\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])))", dt = /* @__PURE__ */ RegExp(`^${ut}$`);
446
- function ft(e) {
447
- let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
448
- 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+)?)?`;
449
- }
450
- function pt(e) {
451
- return RegExp(`^${ft(e)}$`);
452
- }
453
- function mt(e) {
454
- let t = ft({ precision: e.precision }), n = ["Z"];
455
- e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
456
- let r = `${t}(?:${n.join("|")})`;
457
- return RegExp(`^${ut}T(?:${r})$`);
458
- }
459
- var ht = (e) => {
460
- let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
461
- return RegExp(`^${t}$`);
462
- }, gt = /^-?\d+$/, _t = /^-?\d+(?:\.\d+)?$/, vt = /^[^A-Z]*$/, yt = /^[^a-z]*$/, V = /* @__PURE__ */ v("$ZodCheck", (e, t) => {
463
- var n;
464
- e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
465
- }), bt = {
466
- number: "number",
467
- bigint: "bigint",
468
- object: "date"
469
- }, xt = /* @__PURE__ */ v("$ZodCheckLessThan", (e, t) => {
470
- V.init(e, t);
471
- let n = bt[typeof t.value];
472
- e._zod.onattach.push((e) => {
473
- let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity;
474
- t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value);
475
- }), e._zod.check = (r) => {
476
- (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
477
- origin: n,
478
- code: "too_big",
479
- maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
480
- input: r.value,
481
- inclusive: t.inclusive,
482
- inst: e,
483
- continue: !t.abort
484
- });
485
- };
486
- }), St = /* @__PURE__ */ v("$ZodCheckGreaterThan", (e, t) => {
487
- V.init(e, t);
488
- let n = bt[typeof t.value];
489
- e._zod.onattach.push((e) => {
490
- let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity;
491
- t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value);
492
- }), e._zod.check = (r) => {
493
- (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
494
- origin: n,
495
- code: "too_small",
496
- minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
497
- input: r.value,
498
- inclusive: t.inclusive,
499
- inst: e,
500
- continue: !t.abort
501
- });
502
- };
503
- }), Ct = /* @__PURE__ */ v("$ZodCheckMultipleOf", (e, t) => {
504
- V.init(e, t), e._zod.onattach.push((e) => {
505
- var n;
506
- (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
507
- }), e._zod.check = (n) => {
508
- if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
509
- (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : T(n.value, t.value) === 0) || n.issues.push({
510
- origin: typeof n.value,
511
- code: "not_multiple_of",
512
- divisor: t.value,
513
- input: n.value,
514
- inst: e,
515
- continue: !t.abort
516
- });
517
- };
518
- }), wt = /* @__PURE__ */ v("$ZodCheckNumberFormat", (e, t) => {
519
- V.init(e, t), t.format = t.format || "float64";
520
- let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = pe[t.format];
521
- e._zod.onattach.push((e) => {
522
- let r = e._zod.bag;
523
- r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = gt);
524
- }), e._zod.check = (o) => {
525
- let s = o.value;
526
- if (n) {
527
- if (!Number.isInteger(s)) {
528
- o.issues.push({
529
- expected: r,
530
- format: t.format,
531
- code: "invalid_type",
532
- continue: !1,
533
- input: s,
534
- inst: e
535
- });
536
- return;
537
- }
538
- if (!Number.isSafeInteger(s)) {
539
- s > 0 ? o.issues.push({
540
- input: s,
541
- code: "too_big",
542
- maximum: 2 ** 53 - 1,
543
- note: "Integers must be within the safe integer range.",
544
- inst: e,
545
- origin: r,
546
- inclusive: !0,
547
- continue: !t.abort
548
- }) : o.issues.push({
549
- input: s,
550
- code: "too_small",
551
- minimum: -(2 ** 53 - 1),
552
- note: "Integers must be within the safe integer range.",
553
- inst: e,
554
- origin: r,
555
- inclusive: !0,
556
- continue: !t.abort
557
- });
558
- return;
559
- }
560
- }
561
- s < i && o.issues.push({
562
- origin: "number",
563
- input: s,
564
- code: "too_small",
565
- minimum: i,
566
- inclusive: !0,
567
- inst: e,
568
- continue: !t.abort
569
- }), s > a && o.issues.push({
570
- origin: "number",
571
- input: s,
572
- code: "too_big",
573
- maximum: a,
574
- inclusive: !0,
575
- inst: e,
576
- continue: !t.abort
577
- });
578
- };
579
- }), Tt = /* @__PURE__ */ v("$ZodCheckMaxLength", (e, t) => {
580
- var n;
581
- V.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
582
- let t = e.value;
583
- return !ce(t) && t.length !== void 0;
584
- }), e._zod.onattach.push((e) => {
585
- let n = e._zod.bag.maximum ?? Infinity;
586
- t.maximum < n && (e._zod.bag.maximum = t.maximum);
587
- }), e._zod.check = (n) => {
588
- let r = n.value;
589
- if (r.length <= t.maximum) return;
590
- let i = Ce(r);
591
- n.issues.push({
592
- origin: i,
593
- code: "too_big",
594
- maximum: t.maximum,
595
- inclusive: !0,
596
- input: r,
597
- inst: e,
598
- continue: !t.abort
599
- });
600
- };
601
- }), Et = /* @__PURE__ */ v("$ZodCheckMinLength", (e, t) => {
602
- var n;
603
- V.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
604
- let t = e.value;
605
- return !ce(t) && t.length !== void 0;
606
- }), e._zod.onattach.push((e) => {
607
- let n = e._zod.bag.minimum ?? -Infinity;
608
- t.minimum > n && (e._zod.bag.minimum = t.minimum);
609
- }), e._zod.check = (n) => {
610
- let r = n.value;
611
- if (r.length >= t.minimum) return;
612
- let i = Ce(r);
613
- n.issues.push({
614
- origin: i,
615
- code: "too_small",
616
- minimum: t.minimum,
617
- inclusive: !0,
618
- input: r,
619
- inst: e,
620
- continue: !t.abort
621
- });
622
- };
623
- }), Dt = /* @__PURE__ */ v("$ZodCheckLengthEquals", (e, t) => {
624
- var n;
625
- V.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
626
- let t = e.value;
627
- return !ce(t) && t.length !== void 0;
628
- }), e._zod.onattach.push((e) => {
629
- let n = e._zod.bag;
630
- n.minimum = t.length, n.maximum = t.length, n.length = t.length;
631
- }), e._zod.check = (n) => {
632
- let r = n.value, i = r.length;
633
- if (i === t.length) return;
634
- let a = Ce(r), o = i > t.length;
635
- n.issues.push({
636
- origin: a,
637
- ...o ? {
638
- code: "too_big",
639
- maximum: t.length
640
- } : {
641
- code: "too_small",
642
- minimum: t.length
643
- },
644
- inclusive: !0,
645
- exact: !0,
646
- input: n.value,
647
- inst: e,
648
- continue: !t.abort
649
- });
650
- };
651
- }), Ot = /* @__PURE__ */ v("$ZodCheckStringFormat", (e, t) => {
652
- var n, r;
653
- V.init(e, t), e._zod.onattach.push((e) => {
654
- let n = e._zod.bag;
655
- n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern));
656
- }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => {
657
- t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
658
- origin: "string",
659
- code: "invalid_format",
660
- format: t.format,
661
- input: n.value,
662
- ...t.pattern ? { pattern: t.pattern.toString() } : {},
663
- inst: e,
664
- continue: !t.abort
665
- });
666
- }) : (r = e._zod).check ?? (r.check = () => {});
667
- }), kt = /* @__PURE__ */ v("$ZodCheckRegex", (e, t) => {
668
- Ot.init(e, t), e._zod.check = (n) => {
669
- t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
670
- origin: "string",
671
- code: "invalid_format",
672
- format: "regex",
673
- input: n.value,
674
- pattern: t.pattern.toString(),
675
- inst: e,
676
- continue: !t.abort
677
- });
678
- };
679
- }), At = /* @__PURE__ */ v("$ZodCheckLowerCase", (e, t) => {
680
- t.pattern ??= vt, Ot.init(e, t);
681
- }), jt = /* @__PURE__ */ v("$ZodCheckUpperCase", (e, t) => {
682
- t.pattern ??= yt, Ot.init(e, t);
683
- }), Mt = /* @__PURE__ */ v("$ZodCheckIncludes", (e, t) => {
684
- V.init(e, t);
685
- let n = F(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
686
- t.pattern = r, e._zod.onattach.push((e) => {
687
- let t = e._zod.bag;
688
- t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
689
- }), e._zod.check = (n) => {
690
- n.value.includes(t.includes, t.position) || n.issues.push({
691
- origin: "string",
692
- code: "invalid_format",
693
- format: "includes",
694
- includes: t.includes,
695
- input: n.value,
696
- inst: e,
697
- continue: !t.abort
698
- });
699
- };
700
- }), Nt = /* @__PURE__ */ v("$ZodCheckStartsWith", (e, t) => {
701
- V.init(e, t);
702
- let n = RegExp(`^${F(t.prefix)}.*`);
703
- t.pattern ??= n, e._zod.onattach.push((e) => {
704
- let t = e._zod.bag;
705
- t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
706
- }), e._zod.check = (n) => {
707
- n.value.startsWith(t.prefix) || n.issues.push({
708
- origin: "string",
709
- code: "invalid_format",
710
- format: "starts_with",
711
- prefix: t.prefix,
712
- input: n.value,
713
- inst: e,
714
- continue: !t.abort
715
- });
716
- };
717
- }), Pt = /* @__PURE__ */ v("$ZodCheckEndsWith", (e, t) => {
718
- V.init(e, t);
719
- let n = RegExp(`.*${F(t.suffix)}$`);
720
- t.pattern ??= n, e._zod.onattach.push((e) => {
721
- let t = e._zod.bag;
722
- t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
723
- }), e._zod.check = (n) => {
724
- n.value.endsWith(t.suffix) || n.issues.push({
725
- origin: "string",
726
- code: "invalid_format",
727
- format: "ends_with",
728
- suffix: t.suffix,
729
- input: n.value,
730
- inst: e,
731
- continue: !t.abort
732
- });
733
- };
734
- }), Ft = /* @__PURE__ */ v("$ZodCheckOverwrite", (e, t) => {
735
- V.init(e, t), e._zod.check = (e) => {
736
- e.value = t.tx(e.value);
737
- };
738
- }), It = class {
739
- constructor(e = []) {
740
- this.content = [], this.indent = 0, this && (this.args = e);
741
- }
742
- indented(e) {
743
- this.indent += 1, e(this), --this.indent;
744
- }
745
- write(e) {
746
- if (typeof e == "function") {
747
- e(this, { execution: "sync" }), e(this, { execution: "async" });
748
- return;
749
- }
750
- let t = e.split("\n").filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => " ".repeat(this.indent * 2) + e);
751
- for (let e of r) this.content.push(e);
752
- }
753
- compile() {
754
- let e = Function, t = this?.args, n = [...(this?.content ?? [""]).map((e) => ` ${e}`)];
755
- return new e(...t, n.join("\n"));
756
- }
757
- }, Lt = {
758
- major: 4,
759
- minor: 4,
760
- patch: 3
761
- }, H = /* @__PURE__ */ v("$ZodType", (e, t) => {
762
- var n;
763
- e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Lt;
764
- let r = [...e._zod.def.checks ?? []];
765
- e._zod.traits.has("$ZodCheck") && r.unshift(e);
766
- for (let t of r) for (let n of t._zod.onattach) n(e);
767
- if (r.length === 0) (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
768
- e._zod.run = e._zod.parse;
769
- });
770
- else {
771
- let t = (e, t, n) => {
772
- let r = z(e), i;
773
- for (let a of t) {
774
- if (a._zod.def.when) {
775
- if (be(e) || !a._zod.def.when(e)) continue;
776
- } else if (r) continue;
777
- let t = e.issues.length, o = a._zod.check(e);
778
- if (o instanceof Promise && n?.async === !1) throw new y();
779
- if (i || o instanceof Promise) i = (i ?? Promise.resolve()).then(async () => {
780
- await o, e.issues.length !== t && (r ||= z(e, t));
781
- });
782
- else {
783
- if (e.issues.length === t) continue;
784
- r ||= z(e, t);
785
- }
786
- }
787
- return i ? i.then(() => e) : e;
788
- }, n = (n, i, a) => {
789
- if (z(n)) return n.aborted = !0, n;
790
- let o = t(i, r, a);
791
- if (o instanceof Promise) {
792
- if (a.async === !1) throw new y();
793
- return o.then((t) => e._zod.parse(t, a));
794
- }
795
- return e._zod.parse(o, a);
796
- };
797
- e._zod.run = (i, a) => {
798
- if (a.skipChecks) return e._zod.parse(i, a);
799
- if (a.direction === "backward") {
800
- let t = e._zod.parse({
801
- value: i.value,
802
- issues: []
803
- }, {
804
- ...a,
805
- skipChecks: !0
806
- });
807
- return t instanceof Promise ? t.then((e) => n(e, i, a)) : n(t, i, a);
808
- }
809
- let o = e._zod.parse(i, a);
810
- if (o instanceof Promise) {
811
- if (a.async === !1) throw new y();
812
- return o.then((e) => t(e, r, a));
813
- }
814
- return t(o, r, a);
815
- };
816
- }
817
- D(e, "~standard", () => ({
818
- validate: (t) => {
819
- try {
820
- let n = Ne(e, t);
821
- return n.success ? { value: n.data } : { issues: n.error?.issues };
822
- } catch {
823
- return Fe(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues });
824
- }
825
- },
826
- vendor: "zod",
827
- version: 1
828
- }));
829
- }), Rt = /* @__PURE__ */ v("$ZodString", (e, t) => {
830
- H.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? ht(e._zod.bag), e._zod.parse = (n, r) => {
831
- if (t.coerce) try {
832
- n.value = String(n.value);
833
- } catch {}
834
- return typeof n.value == "string" || n.issues.push({
835
- expected: "string",
836
- code: "invalid_type",
837
- input: n.value,
838
- inst: e
839
- }), n;
840
- };
841
- }), U = /* @__PURE__ */ v("$ZodStringFormat", (e, t) => {
842
- Ot.init(e, t), Rt.init(e, t);
843
- }), zt = /* @__PURE__ */ v("$ZodGUID", (e, t) => {
844
- t.pattern ??= Ze, U.init(e, t);
845
- }), Bt = /* @__PURE__ */ v("$ZodUUID", (e, t) => {
846
- if (t.version) {
847
- let e = {
848
- v1: 1,
849
- v2: 2,
850
- v3: 3,
851
- v4: 4,
852
- v5: 5,
853
- v6: 6,
854
- v7: 7,
855
- v8: 8
856
- }[t.version];
857
- if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`);
858
- t.pattern ??= Qe(e);
859
- } else t.pattern ??= Qe();
860
- U.init(e, t);
861
- }), Vt = /* @__PURE__ */ v("$ZodEmail", (e, t) => {
862
- t.pattern ??= $e, U.init(e, t);
863
- }), Ht = /* @__PURE__ */ v("$ZodURL", (e, t) => {
864
- U.init(e, t), e._zod.check = (n) => {
865
- try {
866
- let r = n.value.trim();
867
- if (!t.normalize && t.protocol?.source === ct.source && !/^https?:\/\//i.test(r)) {
868
- n.issues.push({
869
- code: "invalid_format",
870
- format: "url",
871
- note: "Invalid URL format",
872
- input: n.value,
873
- inst: e,
874
- continue: !t.abort
875
- });
876
- return;
877
- }
878
- let i = new URL(r);
879
- t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({
880
- code: "invalid_format",
881
- format: "url",
882
- note: "Invalid hostname",
883
- pattern: t.hostname.source,
884
- input: n.value,
885
- inst: e,
886
- continue: !t.abort
887
- })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({
888
- code: "invalid_format",
889
- format: "url",
890
- note: "Invalid protocol",
891
- pattern: t.protocol.source,
892
- input: n.value,
893
- inst: e,
894
- continue: !t.abort
895
- })), t.normalize ? n.value = i.href : n.value = r;
896
- return;
897
- } catch {
898
- n.issues.push({
899
- code: "invalid_format",
900
- format: "url",
901
- input: n.value,
902
- inst: e,
903
- continue: !t.abort
904
- });
905
- }
906
- };
907
- }), Ut = /* @__PURE__ */ v("$ZodEmoji", (e, t) => {
908
- t.pattern ??= tt(), U.init(e, t);
909
- }), Wt = /* @__PURE__ */ v("$ZodNanoID", (e, t) => {
910
- t.pattern ??= Ye, U.init(e, t);
911
- }), Gt = /* @__PURE__ */ v("$ZodCUID", (e, t) => {
912
- t.pattern ??= We, U.init(e, t);
913
- }), Kt = /* @__PURE__ */ v("$ZodCUID2", (e, t) => {
914
- t.pattern ??= Ge, U.init(e, t);
915
- }), qt = /* @__PURE__ */ v("$ZodULID", (e, t) => {
916
- t.pattern ??= Ke, U.init(e, t);
917
- }), Jt = /* @__PURE__ */ v("$ZodXID", (e, t) => {
918
- t.pattern ??= qe, U.init(e, t);
919
- }), Yt = /* @__PURE__ */ v("$ZodKSUID", (e, t) => {
920
- t.pattern ??= Je, U.init(e, t);
921
- }), Xt = /* @__PURE__ */ v("$ZodISODateTime", (e, t) => {
922
- t.pattern ??= mt(t), U.init(e, t);
923
- }), Zt = /* @__PURE__ */ v("$ZodISODate", (e, t) => {
924
- t.pattern ??= dt, U.init(e, t);
925
- }), Qt = /* @__PURE__ */ v("$ZodISOTime", (e, t) => {
926
- t.pattern ??= pt(t), U.init(e, t);
927
- }), $t = /* @__PURE__ */ v("$ZodISODuration", (e, t) => {
928
- t.pattern ??= Xe, U.init(e, t);
929
- }), en = /* @__PURE__ */ v("$ZodIPv4", (e, t) => {
930
- t.pattern ??= nt, U.init(e, t), e._zod.bag.format = "ipv4";
931
- }), tn = /* @__PURE__ */ v("$ZodIPv6", (e, t) => {
932
- t.pattern ??= rt, U.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
933
- try {
934
- new URL(`http://[${n.value}]`);
935
- } catch {
936
- n.issues.push({
937
- code: "invalid_format",
938
- format: "ipv6",
939
- input: n.value,
940
- inst: e,
941
- continue: !t.abort
942
- });
943
- }
944
- };
945
- }), nn = /* @__PURE__ */ v("$ZodCIDRv4", (e, t) => {
946
- t.pattern ??= it, U.init(e, t);
947
- }), rn = /* @__PURE__ */ v("$ZodCIDRv6", (e, t) => {
948
- t.pattern ??= at, U.init(e, t), e._zod.check = (n) => {
949
- let r = n.value.split("/");
950
- try {
951
- if (r.length !== 2) throw Error();
952
- let [e, t] = r;
953
- if (!t) throw Error();
954
- let n = Number(t);
955
- if (`${n}` !== t || n < 0 || n > 128) throw Error();
956
- new URL(`http://[${e}]`);
957
- } catch {
958
- n.issues.push({
959
- code: "invalid_format",
960
- format: "cidrv6",
961
- input: n.value,
962
- inst: e,
963
- continue: !t.abort
964
- });
965
- }
966
- };
967
- });
968
- function an(e) {
969
- if (e === "") return !0;
970
- if (/\s/.test(e) || e.length % 4 != 0) return !1;
971
- try {
972
- return atob(e), !0;
973
- } catch {
974
- return !1;
975
- }
976
- }
977
- var on = /* @__PURE__ */ v("$ZodBase64", (e, t) => {
978
- t.pattern ??= ot, U.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
979
- an(n.value) || n.issues.push({
980
- code: "invalid_format",
981
- format: "base64",
982
- input: n.value,
983
- inst: e,
984
- continue: !t.abort
985
- });
986
- };
987
- });
988
- function sn(e) {
989
- if (!st.test(e)) return !1;
990
- let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
991
- return an(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
992
- }
993
- var cn = /* @__PURE__ */ v("$ZodBase64URL", (e, t) => {
994
- t.pattern ??= st, U.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
995
- sn(n.value) || n.issues.push({
996
- code: "invalid_format",
997
- format: "base64url",
998
- input: n.value,
999
- inst: e,
1000
- continue: !t.abort
1001
- });
1002
- };
1003
- }), ln = /* @__PURE__ */ v("$ZodE164", (e, t) => {
1004
- t.pattern ??= lt, U.init(e, t);
1005
- });
1006
- function un(e, t = null) {
1007
- try {
1008
- let n = e.split(".");
1009
- if (n.length !== 3) return !1;
1010
- let [r] = n;
1011
- if (!r) return !1;
1012
- let i = JSON.parse(atob(r));
1013
- return !("typ" in i && i?.typ !== "JWT" || !i.alg || t && (!("alg" in i) || i.alg !== t));
1014
- } catch {
1015
- return !1;
1016
- }
1017
- }
1018
- var dn = /* @__PURE__ */ v("$ZodJWT", (e, t) => {
1019
- U.init(e, t), e._zod.check = (n) => {
1020
- un(n.value, t.alg) || n.issues.push({
1021
- code: "invalid_format",
1022
- format: "jwt",
1023
- input: n.value,
1024
- inst: e,
1025
- continue: !t.abort
1026
- });
1027
- };
1028
- }), fn = /* @__PURE__ */ v("$ZodNumber", (e, t) => {
1029
- H.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? _t, e._zod.parse = (n, r) => {
1030
- if (t.coerce) try {
1031
- n.value = Number(n.value);
1032
- } catch {}
1033
- let i = n.value;
1034
- if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i)) return n;
1035
- let a = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
1036
- return n.issues.push({
1037
- expected: "number",
1038
- code: "invalid_type",
1039
- input: i,
1040
- inst: e,
1041
- ...a ? { received: a } : {}
1042
- }), n;
1043
- };
1044
- }), pn = /* @__PURE__ */ v("$ZodNumberFormat", (e, t) => {
1045
- wt.init(e, t), fn.init(e, t);
1046
- }), mn = /* @__PURE__ */ v("$ZodUnknown", (e, t) => {
1047
- H.init(e, t), e._zod.parse = (e) => e;
1048
- }), hn = /* @__PURE__ */ v("$ZodNever", (e, t) => {
1049
- H.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
1050
- expected: "never",
1051
- code: "invalid_type",
1052
- input: t.value,
1053
- inst: e
1054
- }), t);
1055
- });
1056
- function gn(e, t, n) {
1057
- e.issues.length && t.issues.push(...xe(n, e.issues)), t.value[n] = e.value;
1058
- }
1059
- var _n = /* @__PURE__ */ v("$ZodArray", (e, t) => {
1060
- H.init(e, t), e._zod.parse = (n, r) => {
1061
- let i = n.value;
1062
- if (!Array.isArray(i)) return n.issues.push({
1063
- expected: "array",
1064
- code: "invalid_type",
1065
- input: i,
1066
- inst: e
1067
- }), n;
1068
- n.value = Array(i.length);
1069
- let a = [];
1070
- for (let e = 0; e < i.length; e++) {
1071
- let o = i[e], s = t.element._zod.run({
1072
- value: o,
1073
- issues: []
1074
- }, r);
1075
- s instanceof Promise ? a.push(s.then((t) => gn(t, n, e))) : gn(s, n, e);
1076
- }
1077
- return a.length ? Promise.all(a).then(() => n) : n;
1078
- };
1079
- });
1080
- function vn(e, t, n, r, i, a) {
1081
- let o = n in r;
1082
- if (e.issues.length) {
1083
- if (i && a && !o) return;
1084
- t.issues.push(...xe(n, e.issues));
1085
- }
1086
- if (!o && !i) {
1087
- e.issues.length || t.issues.push({
1088
- code: "invalid_type",
1089
- expected: "nonoptional",
1090
- input: void 0,
1091
- path: [n]
1092
- });
1093
- return;
1094
- }
1095
- e.value === void 0 ? o && (t.value[n] = void 0) : t.value[n] = e.value;
1096
- }
1097
- function yn(e) {
1098
- let t = Object.keys(e.shape);
1099
- for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
1100
- let n = fe(e.shape);
1101
- return {
1102
- ...e,
1103
- keys: t,
1104
- keySet: new Set(t),
1105
- numKeys: t.length,
1106
- optionalKeys: new Set(n)
1107
- };
1108
- }
1109
- function bn(e, t, n, r, i, a) {
1110
- let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optin === "optional", d = c.optout === "optional";
1111
- for (let i in t) {
1112
- if (i === "__proto__" || s.has(i)) continue;
1113
- if (l === "never") {
1114
- o.push(i);
1115
- continue;
1116
- }
1117
- let a = c.run({
1118
- value: t[i],
1119
- issues: []
1120
- }, r);
1121
- a instanceof Promise ? e.push(a.then((e) => vn(e, n, i, t, u, d))) : vn(a, n, i, t, u, d);
1122
- }
1123
- return o.length && n.issues.push({
1124
- code: "unrecognized_keys",
1125
- keys: o,
1126
- input: t,
1127
- inst: a
1128
- }), e.length ? Promise.all(e).then(() => n) : n;
1129
- }
1130
- var xn = /* @__PURE__ */ v("$ZodObject", (e, t) => {
1131
- if (H.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1132
- let e = t.shape;
1133
- Object.defineProperty(t, "shape", { get: () => {
1134
- let n = { ...e };
1135
- return Object.defineProperty(t, "shape", { value: n }), n;
1136
- } });
1137
- }
1138
- let n = C(() => yn(t));
1139
- D(e._zod, "propValues", () => {
1140
- let e = t.shape, n = {};
1141
- for (let t in e) {
1142
- let r = e[t]._zod;
1143
- if (r.values) {
1144
- n[t] ?? (n[t] = /* @__PURE__ */ new Set());
1145
- for (let e of r.values) n[t].add(e);
1146
- }
1147
- }
1148
- return n;
1149
- });
1150
- let r = A, i = t.catchall, a;
1151
- e._zod.parse = (t, o) => {
1152
- a ??= n.value;
1153
- let s = t.value;
1154
- if (!r(s)) return t.issues.push({
1155
- expected: "object",
1156
- code: "invalid_type",
1157
- input: s,
1158
- inst: e
1159
- }), t;
1160
- t.value = {};
1161
- let c = [], l = a.shape;
1162
- for (let e of a.keys) {
1163
- let n = l[e], r = n._zod.optin === "optional", i = n._zod.optout === "optional", a = n._zod.run({
1164
- value: s[e],
1165
- issues: []
1166
- }, o);
1167
- a instanceof Promise ? c.push(a.then((n) => vn(n, t, e, s, r, i))) : vn(a, t, e, s, r, i);
1168
- }
1169
- return i ? bn(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t;
1170
- };
1171
- }), Sn = /* @__PURE__ */ v("$ZodObjectJIT", (e, t) => {
1172
- xn.init(e, t);
1173
- let n = e._zod.parse, r = C(() => yn(t)), i = (e) => {
1174
- let t = new It([
1175
- "shape",
1176
- "payload",
1177
- "ctx"
1178
- ]), n = r.value, i = (e) => {
1179
- let t = le(e);
1180
- return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
1181
- };
1182
- t.write("const input = payload.value;");
1183
- let a = Object.create(null), o = 0;
1184
- for (let e of n.keys) a[e] = `key_${o++}`;
1185
- t.write("const newResult = {};");
1186
- for (let r of n.keys) {
1187
- let n = a[r], o = le(r), s = e[r], c = s?._zod?.optin === "optional", l = s?._zod?.optout === "optional";
1188
- t.write(`const ${n} = ${i(r)};`), c && l ? t.write(`
1189
- if (${n}.issues.length) {
1190
- if (${o} in input) {
1191
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
1192
- ...iss,
1193
- path: iss.path ? [${o}, ...iss.path] : [${o}]
1194
- })));
1195
- }
1196
- }
1197
-
1198
- if (${n}.value === undefined) {
1199
- if (${o} in input) {
1200
- newResult[${o}] = undefined;
1201
- }
1202
- } else {
1203
- newResult[${o}] = ${n}.value;
1204
- }
1205
-
1206
- `) : c ? t.write(`
1207
- if (${n}.issues.length) {
1208
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
1209
- ...iss,
1210
- path: iss.path ? [${o}, ...iss.path] : [${o}]
1211
- })));
1212
- }
1213
-
1214
- if (${n}.value === undefined) {
1215
- if (${o} in input) {
1216
- newResult[${o}] = undefined;
1217
- }
1218
- } else {
1219
- newResult[${o}] = ${n}.value;
1220
- }
1221
-
1222
- `) : t.write(`
1223
- const ${n}_present = ${o} in input;
1224
- if (${n}.issues.length) {
1225
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
1226
- ...iss,
1227
- path: iss.path ? [${o}, ...iss.path] : [${o}]
1228
- })));
1229
- }
1230
- if (!${n}_present && !${n}.issues.length) {
1231
- payload.issues.push({
1232
- code: "invalid_type",
1233
- expected: "nonoptional",
1234
- input: undefined,
1235
- path: [${o}]
1236
- });
1237
- }
1238
-
1239
- if (${n}_present) {
1240
- if (${n}.value === undefined) {
1241
- newResult[${o}] = undefined;
1242
- } else {
1243
- newResult[${o}] = ${n}.value;
1244
- }
1245
- }
1246
-
1247
- `);
1248
- }
1249
- t.write("payload.value = newResult;"), t.write("return payload;");
1250
- let s = t.compile();
1251
- return (t, n) => s(e, t, n);
1252
- }, a, o = A, s = !b.jitless, c = s && j.value, l = t.catchall, u;
1253
- e._zod.parse = (d, f) => {
1254
- u ??= r.value;
1255
- let p = d.value;
1256
- return o(p) ? s && c && f?.async === !1 && f.jitless !== !0 ? (a ||= i(t.shape), d = a(d, f), l ? bn([], p, d, f, u, e) : d) : n(d, f) : (d.issues.push({
1257
- expected: "object",
1258
- code: "invalid_type",
1259
- input: p,
1260
- inst: e
1261
- }), d);
1262
- };
1263
- });
1264
- function Cn(e, t, n, r) {
1265
- for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
1266
- let i = e.filter((e) => !z(e));
1267
- return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
1268
- code: "invalid_union",
1269
- input: t.value,
1270
- inst: n,
1271
- errors: e.map((e) => e.issues.map((e) => B(e, r, x())))
1272
- }), t);
1273
- }
1274
- var wn = /* @__PURE__ */ v("$ZodUnion", (e, t) => {
1275
- H.init(e, t), D(e._zod, "optin", () => t.options.some((e) => e._zod.optin === "optional") ? "optional" : void 0), D(e._zod, "optout", () => t.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), D(e._zod, "values", () => {
1276
- if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values)));
1277
- }), D(e._zod, "pattern", () => {
1278
- if (t.options.every((e) => e._zod.pattern)) {
1279
- let e = t.options.map((e) => e._zod.pattern);
1280
- return RegExp(`^(${e.map((e) => w(e.source)).join("|")})$`);
1281
- }
1282
- });
1283
- let n = t.options.length === 1 ? t.options[0]._zod.run : null;
1284
- e._zod.parse = (r, i) => {
1285
- if (n) return n(r, i);
1286
- let a = !1, o = [];
1287
- for (let e of t.options) {
1288
- let t = e._zod.run({
1289
- value: r.value,
1290
- issues: []
1291
- }, i);
1292
- if (t instanceof Promise) o.push(t), a = !0;
1293
- else {
1294
- if (t.issues.length === 0) return t;
1295
- o.push(t);
1296
- }
1297
- }
1298
- return a ? Promise.all(o).then((t) => Cn(t, r, e, i)) : Cn(o, r, e, i);
1299
- };
1300
- }), Tn = /* @__PURE__ */ v("$ZodIntersection", (e, t) => {
1301
- H.init(e, t), e._zod.parse = (e, n) => {
1302
- let r = e.value, i = t.left._zod.run({
1303
- value: r,
1304
- issues: []
1305
- }, n), a = t.right._zod.run({
1306
- value: r,
1307
- issues: []
1308
- }, n);
1309
- return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => Dn(e, t, n)) : Dn(e, i, a);
1310
- };
1311
- });
1312
- function En(e, t) {
1313
- if (e === t || e instanceof Date && t instanceof Date && +e == +t) return {
1314
- valid: !0,
1315
- data: e
1316
- };
1317
- if (M(e) && M(t)) {
1318
- let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
1319
- ...e,
1320
- ...t
1321
- };
1322
- for (let n of r) {
1323
- let r = En(e[n], t[n]);
1324
- if (!r.valid) return {
1325
- valid: !1,
1326
- mergeErrorPath: [n, ...r.mergeErrorPath]
1327
- };
1328
- i[n] = r.data;
1329
- }
1330
- return {
1331
- valid: !0,
1332
- data: i
1333
- };
1334
- }
1335
- if (Array.isArray(e) && Array.isArray(t)) {
1336
- if (e.length !== t.length) return {
1337
- valid: !1,
1338
- mergeErrorPath: []
1339
- };
1340
- let n = [];
1341
- for (let r = 0; r < e.length; r++) {
1342
- let i = e[r], a = t[r], o = En(i, a);
1343
- if (!o.valid) return {
1344
- valid: !1,
1345
- mergeErrorPath: [r, ...o.mergeErrorPath]
1346
- };
1347
- n.push(o.data);
1348
- }
1349
- return {
1350
- valid: !0,
1351
- data: n
1352
- };
1353
- }
1354
- return {
1355
- valid: !1,
1356
- mergeErrorPath: []
1357
- };
1358
- }
1359
- function Dn(e, t, n) {
1360
- let r = /* @__PURE__ */ new Map(), i;
1361
- for (let n of t.issues) if (n.code === "unrecognized_keys") {
1362
- i ??= n;
1363
- for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0;
1364
- } else e.issues.push(n);
1365
- for (let t of n.issues) if (t.code === "unrecognized_keys") for (let e of t.keys) r.has(e) || r.set(e, {}), r.get(e).r = !0;
1366
- else e.issues.push(t);
1367
- let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e);
1368
- if (a.length && i && e.issues.push({
1369
- ...i,
1370
- keys: a
1371
- }), z(e)) return e;
1372
- let o = En(t.value, n.value);
1373
- if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
1374
- return e.value = o.data, e;
1375
- }
1376
- var On = /* @__PURE__ */ v("$ZodTuple", (e, t) => {
1377
- H.init(e, t);
1378
- let n = t.items;
1379
- e._zod.parse = (r, i) => {
1380
- let a = r.value;
1381
- if (!Array.isArray(a)) return r.issues.push({
1382
- input: a,
1383
- inst: e,
1384
- expected: "tuple",
1385
- code: "invalid_type"
1386
- }), r;
1387
- r.value = [];
1388
- let o = [], s = kn(n, "optin"), c = kn(n, "optout");
1389
- if (!t.rest) {
1390
- if (a.length < s) return r.issues.push({
1391
- code: "too_small",
1392
- minimum: s,
1393
- inclusive: !0,
1394
- input: a,
1395
- inst: e,
1396
- origin: "array"
1397
- }), r;
1398
- a.length > n.length && r.issues.push({
1399
- code: "too_big",
1400
- maximum: n.length,
1401
- inclusive: !0,
1402
- input: a,
1403
- inst: e,
1404
- origin: "array"
1405
- });
1406
- }
1407
- let l = Array(n.length);
1408
- for (let e = 0; e < n.length; e++) {
1409
- let t = n[e]._zod.run({
1410
- value: a[e],
1411
- issues: []
1412
- }, i);
1413
- t instanceof Promise ? o.push(t.then((t) => {
1414
- l[e] = t;
1415
- })) : l[e] = t;
1416
- }
1417
- if (t.rest) {
1418
- let e = n.length - 1, s = a.slice(n.length);
1419
- for (let n of s) {
1420
- e++;
1421
- let a = t.rest._zod.run({
1422
- value: n,
1423
- issues: []
1424
- }, i);
1425
- a instanceof Promise ? o.push(a.then((t) => An(t, r, e))) : An(a, r, e);
1426
- }
1427
- }
1428
- return o.length ? Promise.all(o).then(() => jn(l, r, n, a, c)) : jn(l, r, n, a, c);
1429
- };
1430
- });
1431
- function kn(e, t) {
1432
- for (let n = e.length - 1; n >= 0; n--) if (e[n]._zod[t] !== "optional") return n + 1;
1433
- return 0;
1434
- }
1435
- function An(e, t, n) {
1436
- e.issues.length && t.issues.push(...xe(n, e.issues)), t.value[n] = e.value;
1437
- }
1438
- function jn(e, t, n, r, i) {
1439
- for (let a = 0; a < n.length; a++) {
1440
- let n = e[a], o = a < r.length;
1441
- if (n.issues.length) {
1442
- if (!o && a >= i) {
1443
- t.value.length = a;
1444
- break;
1445
- }
1446
- t.issues.push(...xe(a, n.issues));
1447
- }
1448
- t.value[a] = n.value;
1449
- }
1450
- for (let e = t.value.length - 1; e >= r.length && n[e]._zod.optout === "optional" && t.value[e] === void 0; e--) t.value.length = e;
1451
- return t;
1452
- }
1453
- var Mn = /* @__PURE__ */ v("$ZodEnum", (e, t) => {
1454
- H.init(e, t);
1455
- let n = se(t.entries), r = new Set(n);
1456
- e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => P.has(typeof e)).map((e) => typeof e == "string" ? F(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
1457
- let a = t.value;
1458
- return r.has(a) || t.issues.push({
1459
- code: "invalid_value",
1460
- values: n,
1461
- input: a,
1462
- inst: e
1463
- }), t;
1464
- };
1465
- }), Nn = /* @__PURE__ */ v("$ZodTransform", (e, t) => {
1466
- H.init(e, t), e._zod.optin = "optional", e._zod.parse = (n, r) => {
1467
- if (r.direction === "backward") throw new oe(e.constructor.name);
1468
- let i = t.transform(n.value, n);
1469
- if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e) => (n.value = e, n.fallback = !0, n));
1470
- if (i instanceof Promise) throw new y();
1471
- return n.value = i, n.fallback = !0, n;
1472
- };
1473
- });
1474
- function Pn(e, t) {
1475
- return t === void 0 && (e.issues.length || e.fallback) ? {
1476
- issues: [],
1477
- value: void 0
1478
- } : e;
1479
- }
1480
- var Fn = /* @__PURE__ */ v("$ZodOptional", (e, t) => {
1481
- H.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", D(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, void 0]) : void 0), D(e._zod, "pattern", () => {
1482
- let e = t.innerType._zod.pattern;
1483
- return e ? RegExp(`^(${w(e.source)})?$`) : void 0;
1484
- }), e._zod.parse = (e, n) => {
1485
- if (t.innerType._zod.optin === "optional") {
1486
- let r = e.value, i = t.innerType._zod.run(e, n);
1487
- return i instanceof Promise ? i.then((e) => Pn(e, r)) : Pn(i, r);
1488
- }
1489
- return e.value === void 0 ? e : t.innerType._zod.run(e, n);
1490
- };
1491
- }), In = /* @__PURE__ */ v("$ZodExactOptional", (e, t) => {
1492
- Fn.init(e, t), D(e._zod, "values", () => t.innerType._zod.values), D(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n);
1493
- }), Ln = /* @__PURE__ */ v("$ZodNullable", (e, t) => {
1494
- H.init(e, t), D(e._zod, "optin", () => t.innerType._zod.optin), D(e._zod, "optout", () => t.innerType._zod.optout), D(e._zod, "pattern", () => {
1495
- let e = t.innerType._zod.pattern;
1496
- return e ? RegExp(`^(${w(e.source)}|null)$`) : void 0;
1497
- }), D(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
1498
- }), Rn = /* @__PURE__ */ v("$ZodDefault", (e, t) => {
1499
- H.init(e, t), e._zod.optin = "optional", D(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
1500
- if (n.direction === "backward") return t.innerType._zod.run(e, n);
1501
- if (e.value === void 0) return e.value = t.defaultValue, e;
1502
- let r = t.innerType._zod.run(e, n);
1503
- return r instanceof Promise ? r.then((e) => zn(e, t)) : zn(r, t);
1504
- };
1505
- });
1506
- function zn(e, t) {
1507
- return e.value === void 0 && (e.value = t.defaultValue), e;
1508
- }
1509
- var Bn = /* @__PURE__ */ v("$ZodPrefault", (e, t) => {
1510
- H.init(e, t), e._zod.optin = "optional", D(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === "backward" || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
1511
- }), Vn = /* @__PURE__ */ v("$ZodNonOptional", (e, t) => {
1512
- H.init(e, t), D(e._zod, "values", () => {
1513
- let e = t.innerType._zod.values;
1514
- return e ? new Set([...e].filter((e) => e !== void 0)) : void 0;
1515
- }), e._zod.parse = (n, r) => {
1516
- let i = t.innerType._zod.run(n, r);
1517
- return i instanceof Promise ? i.then((t) => Hn(t, e)) : Hn(i, e);
1518
- };
1519
- });
1520
- function Hn(e, t) {
1521
- return !e.issues.length && e.value === void 0 && e.issues.push({
1522
- code: "invalid_type",
1523
- expected: "nonoptional",
1524
- input: e.value,
1525
- inst: t
1526
- }), e;
1527
- }
1528
- var Un = /* @__PURE__ */ v("$ZodCatch", (e, t) => {
1529
- H.init(e, t), e._zod.optin = "optional", D(e._zod, "optout", () => t.innerType._zod.optout), D(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
1530
- if (n.direction === "backward") return t.innerType._zod.run(e, n);
1531
- let r = t.innerType._zod.run(e, n);
1532
- return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({
1533
- ...e,
1534
- error: { issues: r.issues.map((e) => B(e, n, x())) },
1535
- input: e.value
1536
- }), e.issues = [], e.fallback = !0), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({
1537
- ...e,
1538
- error: { issues: r.issues.map((e) => B(e, n, x())) },
1539
- input: e.value
1540
- }), e.issues = [], e.fallback = !0), e);
1541
- };
1542
- }), Wn = /* @__PURE__ */ v("$ZodPipe", (e, t) => {
1543
- H.init(e, t), D(e._zod, "values", () => t.in._zod.values), D(e._zod, "optin", () => t.in._zod.optin), D(e._zod, "optout", () => t.out._zod.optout), D(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, n) => {
1544
- if (n.direction === "backward") {
1545
- let r = t.out._zod.run(e, n);
1546
- return r instanceof Promise ? r.then((e) => Gn(e, t.in, n)) : Gn(r, t.in, n);
1547
- }
1548
- let r = t.in._zod.run(e, n);
1549
- return r instanceof Promise ? r.then((e) => Gn(e, t.out, n)) : Gn(r, t.out, n);
1550
- };
1551
- });
1552
- function Gn(e, t, n) {
1553
- return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
1554
- value: e.value,
1555
- issues: e.issues,
1556
- fallback: e.fallback
1557
- }, n);
1558
- }
1559
- var Kn = /* @__PURE__ */ v("$ZodReadonly", (e, t) => {
1560
- H.init(e, t), D(e._zod, "propValues", () => t.innerType._zod.propValues), D(e._zod, "values", () => t.innerType._zod.values), D(e._zod, "optin", () => t.innerType?._zod?.optin), D(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => {
1561
- if (n.direction === "backward") return t.innerType._zod.run(e, n);
1562
- let r = t.innerType._zod.run(e, n);
1563
- return r instanceof Promise ? r.then(qn) : qn(r);
1564
- };
1565
- });
1566
- function qn(e) {
1567
- return e.value = Object.freeze(e.value), e;
1568
- }
1569
- var Jn = /* @__PURE__ */ v("$ZodCustom", (e, t) => {
1570
- V.init(e, t), H.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
1571
- let r = n.value, i = t.fn(r);
1572
- if (i instanceof Promise) return i.then((t) => Yn(t, n, r, e));
1573
- Yn(i, n, r, e);
1574
- };
1575
- });
1576
- function Yn(e, t, n, r) {
1577
- if (!e) {
1578
- let e = {
1579
- code: "custom",
1580
- input: n,
1581
- inst: r,
1582
- path: [...r._zod.def.path ?? []],
1583
- continue: !r._zod.def.abort
1584
- };
1585
- r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(we(e));
1586
- }
1587
- }
1588
- //#endregion
1589
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
1590
- var Xn, Zn = class {
1591
- constructor() {
1592
- this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1593
- }
1594
- add(e, ...t) {
1595
- let n = t[0];
1596
- return this._map.set(e, n), n && typeof n == "object" && "id" in n && this._idmap.set(n.id, e), this;
1597
- }
1598
- clear() {
1599
- return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1600
- }
1601
- remove(e) {
1602
- let t = this._map.get(e);
1603
- return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(e), this;
1604
- }
1605
- get(e) {
1606
- let t = e._zod.parent;
1607
- if (t) {
1608
- let n = { ...this.get(t) ?? {} };
1609
- delete n.id;
1610
- let r = {
1611
- ...n,
1612
- ...this._map.get(e)
1613
- };
1614
- return Object.keys(r).length ? r : void 0;
1615
- }
1616
- return this._map.get(e);
1617
- }
1618
- has(e) {
1619
- return this._map.has(e);
1620
- }
1621
- };
1622
- function Qn() {
1623
- return new Zn();
1624
- }
1625
- (Xn = globalThis).__zod_globalRegistry ?? (Xn.__zod_globalRegistry = Qn());
1626
- var $n = globalThis.__zod_globalRegistry;
1627
- //#endregion
1628
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
1629
- /* @__NO_SIDE_EFFECTS__ */
1630
- function er(e, t) {
1631
- return new e({
1632
- type: "string",
1633
- ...L(t)
1634
- });
1635
- }
1636
- /* @__NO_SIDE_EFFECTS__ */
1637
- function tr(e, t) {
1638
- return new e({
1639
- type: "string",
1640
- format: "email",
1641
- check: "string_format",
1642
- abort: !1,
1643
- ...L(t)
1644
- });
1645
- }
1646
- /* @__NO_SIDE_EFFECTS__ */
1647
- function nr(e, t) {
1648
- return new e({
1649
- type: "string",
1650
- format: "guid",
1651
- check: "string_format",
1652
- abort: !1,
1653
- ...L(t)
1654
- });
1655
- }
1656
- /* @__NO_SIDE_EFFECTS__ */
1657
- function rr(e, t) {
1658
- return new e({
1659
- type: "string",
1660
- format: "uuid",
1661
- check: "string_format",
1662
- abort: !1,
1663
- ...L(t)
1664
- });
1665
- }
1666
- /* @__NO_SIDE_EFFECTS__ */
1667
- function ir(e, t) {
1668
- return new e({
1669
- type: "string",
1670
- format: "uuid",
1671
- check: "string_format",
1672
- abort: !1,
1673
- version: "v4",
1674
- ...L(t)
1675
- });
1676
- }
1677
- /* @__NO_SIDE_EFFECTS__ */
1678
- function ar(e, t) {
1679
- return new e({
1680
- type: "string",
1681
- format: "uuid",
1682
- check: "string_format",
1683
- abort: !1,
1684
- version: "v6",
1685
- ...L(t)
1686
- });
1687
- }
1688
- /* @__NO_SIDE_EFFECTS__ */
1689
- function or(e, t) {
1690
- return new e({
1691
- type: "string",
1692
- format: "uuid",
1693
- check: "string_format",
1694
- abort: !1,
1695
- version: "v7",
1696
- ...L(t)
1697
- });
1698
- }
1699
- /* @__NO_SIDE_EFFECTS__ */
1700
- function sr(e, t) {
1701
- return new e({
1702
- type: "string",
1703
- format: "url",
1704
- check: "string_format",
1705
- abort: !1,
1706
- ...L(t)
1707
- });
1708
- }
1709
- /* @__NO_SIDE_EFFECTS__ */
1710
- function cr(e, t) {
1711
- return new e({
1712
- type: "string",
1713
- format: "emoji",
1714
- check: "string_format",
1715
- abort: !1,
1716
- ...L(t)
1717
- });
1718
- }
1719
- /* @__NO_SIDE_EFFECTS__ */
1720
- function lr(e, t) {
1721
- return new e({
1722
- type: "string",
1723
- format: "nanoid",
1724
- check: "string_format",
1725
- abort: !1,
1726
- ...L(t)
1727
- });
1728
- }
1729
- /* @__NO_SIDE_EFFECTS__ */
1730
- function ur(e, t) {
1731
- return new e({
1732
- type: "string",
1733
- format: "cuid",
1734
- check: "string_format",
1735
- abort: !1,
1736
- ...L(t)
1737
- });
1738
- }
1739
- /* @__NO_SIDE_EFFECTS__ */
1740
- function dr(e, t) {
1741
- return new e({
1742
- type: "string",
1743
- format: "cuid2",
1744
- check: "string_format",
1745
- abort: !1,
1746
- ...L(t)
1747
- });
1748
- }
1749
- /* @__NO_SIDE_EFFECTS__ */
1750
- function fr(e, t) {
1751
- return new e({
1752
- type: "string",
1753
- format: "ulid",
1754
- check: "string_format",
1755
- abort: !1,
1756
- ...L(t)
1757
- });
1758
- }
1759
- /* @__NO_SIDE_EFFECTS__ */
1760
- function pr(e, t) {
1761
- return new e({
1762
- type: "string",
1763
- format: "xid",
1764
- check: "string_format",
1765
- abort: !1,
1766
- ...L(t)
1767
- });
1768
- }
1769
- /* @__NO_SIDE_EFFECTS__ */
1770
- function mr(e, t) {
1771
- return new e({
1772
- type: "string",
1773
- format: "ksuid",
1774
- check: "string_format",
1775
- abort: !1,
1776
- ...L(t)
1777
- });
1778
- }
1779
- /* @__NO_SIDE_EFFECTS__ */
1780
- function hr(e, t) {
1781
- return new e({
1782
- type: "string",
1783
- format: "ipv4",
1784
- check: "string_format",
1785
- abort: !1,
1786
- ...L(t)
1787
- });
1788
- }
1789
- /* @__NO_SIDE_EFFECTS__ */
1790
- function gr(e, t) {
1791
- return new e({
1792
- type: "string",
1793
- format: "ipv6",
1794
- check: "string_format",
1795
- abort: !1,
1796
- ...L(t)
1797
- });
1798
- }
1799
- /* @__NO_SIDE_EFFECTS__ */
1800
- function _r(e, t) {
1801
- return new e({
1802
- type: "string",
1803
- format: "cidrv4",
1804
- check: "string_format",
1805
- abort: !1,
1806
- ...L(t)
1807
- });
1808
- }
1809
- /* @__NO_SIDE_EFFECTS__ */
1810
- function vr(e, t) {
1811
- return new e({
1812
- type: "string",
1813
- format: "cidrv6",
1814
- check: "string_format",
1815
- abort: !1,
1816
- ...L(t)
1817
- });
1818
- }
1819
- /* @__NO_SIDE_EFFECTS__ */
1820
- function yr(e, t) {
1821
- return new e({
1822
- type: "string",
1823
- format: "base64",
1824
- check: "string_format",
1825
- abort: !1,
1826
- ...L(t)
1827
- });
1828
- }
1829
- /* @__NO_SIDE_EFFECTS__ */
1830
- function br(e, t) {
1831
- return new e({
1832
- type: "string",
1833
- format: "base64url",
1834
- check: "string_format",
1835
- abort: !1,
1836
- ...L(t)
1837
- });
1838
- }
1839
- /* @__NO_SIDE_EFFECTS__ */
1840
- function xr(e, t) {
1841
- return new e({
1842
- type: "string",
1843
- format: "e164",
1844
- check: "string_format",
1845
- abort: !1,
1846
- ...L(t)
1847
- });
1848
- }
1849
- /* @__NO_SIDE_EFFECTS__ */
1850
- function Sr(e, t) {
1851
- return new e({
1852
- type: "string",
1853
- format: "jwt",
1854
- check: "string_format",
1855
- abort: !1,
1856
- ...L(t)
1857
- });
1858
- }
1859
- /* @__NO_SIDE_EFFECTS__ */
1860
- function Cr(e, t) {
1861
- return new e({
1862
- type: "string",
1863
- format: "datetime",
1864
- check: "string_format",
1865
- offset: !1,
1866
- local: !1,
1867
- precision: null,
1868
- ...L(t)
1869
- });
1870
- }
1871
- /* @__NO_SIDE_EFFECTS__ */
1872
- function wr(e, t) {
1873
- return new e({
1874
- type: "string",
1875
- format: "date",
1876
- check: "string_format",
1877
- ...L(t)
1878
- });
1879
- }
1880
- /* @__NO_SIDE_EFFECTS__ */
1881
- function Tr(e, t) {
1882
- return new e({
1883
- type: "string",
1884
- format: "time",
1885
- check: "string_format",
1886
- precision: null,
1887
- ...L(t)
1888
- });
1889
- }
1890
- /* @__NO_SIDE_EFFECTS__ */
1891
- function Er(e, t) {
1892
- return new e({
1893
- type: "string",
1894
- format: "duration",
1895
- check: "string_format",
1896
- ...L(t)
1897
- });
1898
- }
1899
- /* @__NO_SIDE_EFFECTS__ */
1900
- function Dr(e, t) {
1901
- return new e({
1902
- type: "number",
1903
- checks: [],
1904
- ...L(t)
1905
- });
1906
- }
1907
- /* @__NO_SIDE_EFFECTS__ */
1908
- function Or(e, t) {
1909
- return new e({
1910
- type: "number",
1911
- check: "number_format",
1912
- abort: !1,
1913
- format: "safeint",
1914
- ...L(t)
1915
- });
1916
- }
1917
- /* @__NO_SIDE_EFFECTS__ */
1918
- function kr(e) {
1919
- return new e({ type: "unknown" });
1920
- }
1921
- /* @__NO_SIDE_EFFECTS__ */
1922
- function Ar(e, t) {
1923
- return new e({
1924
- type: "never",
1925
- ...L(t)
1926
- });
1927
- }
1928
- /* @__NO_SIDE_EFFECTS__ */
1929
- function jr(e, t) {
1930
- return new xt({
1931
- check: "less_than",
1932
- ...L(t),
1933
- value: e,
1934
- inclusive: !1
1935
- });
1936
- }
1937
- /* @__NO_SIDE_EFFECTS__ */
1938
- function Mr(e, t) {
1939
- return new xt({
1940
- check: "less_than",
1941
- ...L(t),
1942
- value: e,
1943
- inclusive: !0
1944
- });
1945
- }
1946
- /* @__NO_SIDE_EFFECTS__ */
1947
- function Nr(e, t) {
1948
- return new St({
1949
- check: "greater_than",
1950
- ...L(t),
1951
- value: e,
1952
- inclusive: !1
1953
- });
1954
- }
1955
- /* @__NO_SIDE_EFFECTS__ */
1956
- function Pr(e, t) {
1957
- return new St({
1958
- check: "greater_than",
1959
- ...L(t),
1960
- value: e,
1961
- inclusive: !0
1962
- });
1963
- }
1964
- /* @__NO_SIDE_EFFECTS__ */
1965
- function Fr(e, t) {
1966
- return new Ct({
1967
- check: "multiple_of",
1968
- ...L(t),
1969
- value: e
1970
- });
1971
- }
1972
- /* @__NO_SIDE_EFFECTS__ */
1973
- function Ir(e, t) {
1974
- return new Tt({
1975
- check: "max_length",
1976
- ...L(t),
1977
- maximum: e
1978
- });
1979
- }
1980
- /* @__NO_SIDE_EFFECTS__ */
1981
- function Lr(e, t) {
1982
- return new Et({
1983
- check: "min_length",
1984
- ...L(t),
1985
- minimum: e
1986
- });
1987
- }
1988
- /* @__NO_SIDE_EFFECTS__ */
1989
- function Rr(e, t) {
1990
- return new Dt({
1991
- check: "length_equals",
1992
- ...L(t),
1993
- length: e
1994
- });
1995
- }
1996
- /* @__NO_SIDE_EFFECTS__ */
1997
- function zr(e, t) {
1998
- return new kt({
1999
- check: "string_format",
2000
- format: "regex",
2001
- ...L(t),
2002
- pattern: e
2003
- });
2004
- }
2005
- /* @__NO_SIDE_EFFECTS__ */
2006
- function Br(e) {
2007
- return new At({
2008
- check: "string_format",
2009
- format: "lowercase",
2010
- ...L(e)
2011
- });
2012
- }
2013
- /* @__NO_SIDE_EFFECTS__ */
2014
- function Vr(e) {
2015
- return new jt({
2016
- check: "string_format",
2017
- format: "uppercase",
2018
- ...L(e)
2019
- });
2020
- }
2021
- /* @__NO_SIDE_EFFECTS__ */
2022
- function Hr(e, t) {
2023
- return new Mt({
2024
- check: "string_format",
2025
- format: "includes",
2026
- ...L(t),
2027
- includes: e
2028
- });
2029
- }
2030
- /* @__NO_SIDE_EFFECTS__ */
2031
- function Ur(e, t) {
2032
- return new Nt({
2033
- check: "string_format",
2034
- format: "starts_with",
2035
- ...L(t),
2036
- prefix: e
2037
- });
2038
- }
2039
- /* @__NO_SIDE_EFFECTS__ */
2040
- function Wr(e, t) {
2041
- return new Pt({
2042
- check: "string_format",
2043
- format: "ends_with",
2044
- ...L(t),
2045
- suffix: e
2046
- });
2047
- }
2048
- /* @__NO_SIDE_EFFECTS__ */
2049
- function W(e) {
2050
- return new Ft({
2051
- check: "overwrite",
2052
- tx: e
2053
- });
2054
- }
2055
- /* @__NO_SIDE_EFFECTS__ */
2056
- function Gr(e) {
2057
- return /* @__PURE__ */ W((t) => t.normalize(e));
2058
- }
2059
- /* @__NO_SIDE_EFFECTS__ */
2060
- function Kr() {
2061
- return /* @__PURE__ */ W((e) => e.trim());
2062
- }
2063
- /* @__NO_SIDE_EFFECTS__ */
2064
- function qr() {
2065
- return /* @__PURE__ */ W((e) => e.toLowerCase());
2066
- }
2067
- /* @__NO_SIDE_EFFECTS__ */
2068
- function Jr() {
2069
- return /* @__PURE__ */ W((e) => e.toUpperCase());
2070
- }
2071
- /* @__NO_SIDE_EFFECTS__ */
2072
- function Yr() {
2073
- return /* @__PURE__ */ W((e) => ue(e));
2074
- }
2075
- /* @__NO_SIDE_EFFECTS__ */
2076
- function Xr(e, t, n) {
2077
- return new e({
2078
- type: "array",
2079
- element: t,
2080
- ...L(n)
2081
- });
2082
- }
2083
- /* @__NO_SIDE_EFFECTS__ */
2084
- function Zr(e, t, n) {
2085
- return new e({
2086
- type: "custom",
2087
- check: "custom",
2088
- fn: t,
2089
- ...L(n)
2090
- });
2091
- }
2092
- /* @__NO_SIDE_EFFECTS__ */
2093
- function Qr(e, t) {
2094
- let n = /* @__PURE__ */ $r((t) => (t.addIssue = (e) => {
2095
- if (typeof e == "string") t.issues.push(we(e, t.value, n._zod.def));
2096
- else {
2097
- let r = e;
2098
- r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(we(r));
2099
- }
2100
- }, e(t.value, t)), t);
2101
- return n;
2102
- }
2103
- /* @__NO_SIDE_EFFECTS__ */
2104
- function $r(e, t) {
2105
- let n = new V({
2106
- check: "custom",
2107
- ...L(t)
2108
- });
2109
- return n._zod.check = e, n;
2110
- }
2111
- //#endregion
2112
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
2113
- function ei(e) {
2114
- let t = e?.target ?? "draft-2020-12";
2115
- return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
2116
- processors: e.processors ?? {},
2117
- metadataRegistry: e?.metadata ?? $n,
2118
- target: t,
2119
- unrepresentable: e?.unrepresentable ?? "throw",
2120
- override: e?.override ?? (() => {}),
2121
- io: e?.io ?? "output",
2122
- counter: 0,
2123
- seen: /* @__PURE__ */ new Map(),
2124
- cycles: e?.cycles ?? "ref",
2125
- reused: e?.reused ?? "inline",
2126
- external: e?.external ?? void 0
2127
- };
2128
- }
2129
- function G(e, t, n = {
2130
- path: [],
2131
- schemaPath: []
2132
- }) {
2133
- var r;
2134
- let i = e._zod.def, a = t.seen.get(e);
2135
- if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema;
2136
- let o = {
2137
- schema: {},
2138
- count: 1,
2139
- cycle: void 0,
2140
- path: n.path
2141
- };
2142
- t.seen.set(e, o);
2143
- let s = e._zod.toJSONSchema?.();
2144
- if (s) o.schema = s;
2145
- else {
2146
- let r = {
2147
- ...n,
2148
- schemaPath: [...n.schemaPath, e],
2149
- path: n.path
2150
- };
2151
- if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r);
2152
- else {
2153
- let n = o.schema, a = t.processors[i.type];
2154
- if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);
2155
- a(e, t, n, r);
2156
- }
2157
- let a = e._zod.parent;
2158
- a && (o.ref ||= a, G(a, t, r), t.seen.get(a).isParent = !0);
2159
- }
2160
- let c = t.metadataRegistry.get(e);
2161
- return c && Object.assign(o.schema, c), t.io === "input" && K(e) && (delete o.schema.examples, delete o.schema.default), t.io === "input" && "_prefault" in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema;
2162
- }
2163
- function ti(e, t) {
2164
- let n = e.seen.get(t);
2165
- if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
2166
- let r = /* @__PURE__ */ new Map();
2167
- for (let t of e.seen.entries()) {
2168
- let n = e.metadataRegistry.get(t[0])?.id;
2169
- if (n) {
2170
- let e = r.get(n);
2171
- if (e && e !== t[0]) throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2172
- r.set(n, t[0]);
2173
- }
2174
- }
2175
- let i = (t) => {
2176
- let r = e.target === "draft-2020-12" ? "$defs" : "definitions";
2177
- if (e.external) {
2178
- let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e);
2179
- if (n) return { ref: i(n) };
2180
- let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`;
2181
- return t[1].defId = a, {
2182
- defId: a,
2183
- ref: `${i("__shared")}#/${r}/${a}`
2184
- };
2185
- }
2186
- if (t[1] === n) return { ref: "#" };
2187
- let i = `#/${r}/`, a = t[1].schema.id ?? `__schema${e.counter++}`;
2188
- return {
2189
- defId: a,
2190
- ref: i + a
2191
- };
2192
- }, a = (e) => {
2193
- if (e[1].schema.$ref) return;
2194
- let t = e[1], { ref: n, defId: r } = i(e);
2195
- t.def = { ...t.schema }, r && (t.defId = r);
2196
- let a = t.schema;
2197
- for (let e in a) delete a[e];
2198
- a.$ref = n;
2199
- };
2200
- if (e.cycles === "throw") for (let t of e.seen.entries()) {
2201
- let e = t[1];
2202
- if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
2203
-
2204
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2205
- }
2206
- for (let n of e.seen.entries()) {
2207
- let r = n[1];
2208
- if (t === n[0]) {
2209
- a(n);
2210
- continue;
2211
- }
2212
- if (e.external) {
2213
- let r = e.external.registry.get(n[0])?.id;
2214
- if (t !== n[0] && r) {
2215
- a(n);
2216
- continue;
2217
- }
2218
- }
2219
- if (e.metadataRegistry.get(n[0])?.id) {
2220
- a(n);
2221
- continue;
2222
- }
2223
- if (r.cycle) {
2224
- a(n);
2225
- continue;
2226
- }
2227
- if (r.count > 1 && e.reused === "ref") {
2228
- a(n);
2229
- continue;
2230
- }
2231
- }
2232
- }
2233
- function ni(e, t) {
2234
- let n = e.seen.get(t);
2235
- if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
2236
- let r = (t) => {
2237
- let n = e.seen.get(t);
2238
- if (n.ref === null) return;
2239
- let i = n.def ?? n.schema, a = { ...i }, o = n.ref;
2240
- if (n.ref = null, o) {
2241
- r(o);
2242
- let n = e.seen.get(o), s = n.schema;
2243
- if (s.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (i.allOf = i.allOf ?? [], i.allOf.push(s)) : Object.assign(i, s), Object.assign(i, a), t._zod.parent === o) for (let e in i) e === "$ref" || e === "allOf" || e in a || delete i[e];
2244
- if (s.$ref && n.def) for (let e in i) e === "$ref" || e === "allOf" || e in n.def && JSON.stringify(i[e]) === JSON.stringify(n.def[e]) && delete i[e];
2245
- }
2246
- let s = t._zod.parent;
2247
- if (s && s !== o) {
2248
- r(s);
2249
- let t = e.seen.get(s);
2250
- if (t?.schema.$ref && (i.$ref = t.schema.$ref, t.def)) for (let e in i) e === "$ref" || e === "allOf" || e in t.def && JSON.stringify(i[e]) === JSON.stringify(t.def[e]) && delete i[e];
2251
- }
2252
- e.override({
2253
- zodSchema: t,
2254
- jsonSchema: i,
2255
- path: n.path ?? []
2256
- });
2257
- };
2258
- for (let t of [...e.seen.entries()].reverse()) r(t[0]);
2259
- let i = {};
2260
- if (e.target === "draft-2020-12" ? i.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? i.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? i.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
2261
- let n = e.external.registry.get(t)?.id;
2262
- if (!n) throw Error("Schema is missing an `id` property");
2263
- i.$id = e.external.uri(n);
2264
- }
2265
- Object.assign(i, n.def ?? n.schema);
2266
- let a = e.metadataRegistry.get(t)?.id;
2267
- a !== void 0 && i.id === a && delete i.id;
2268
- let o = e.external?.defs ?? {};
2269
- for (let t of e.seen.entries()) {
2270
- let e = t[1];
2271
- e.def && e.defId && (e.def.id === e.defId && delete e.def.id, o[e.defId] = e.def);
2272
- }
2273
- e.external || Object.keys(o).length > 0 && (e.target === "draft-2020-12" ? i.$defs = o : i.definitions = o);
2274
- try {
2275
- let n = JSON.parse(JSON.stringify(i));
2276
- return Object.defineProperty(n, "~standard", {
2277
- value: {
2278
- ...t["~standard"],
2279
- jsonSchema: {
2280
- input: ii(t, "input", e.processors),
2281
- output: ii(t, "output", e.processors)
2282
- }
2283
- },
2284
- enumerable: !1,
2285
- writable: !1
2286
- }), n;
2287
- } catch {
2288
- throw Error("Error converting schema to JSON.");
2289
- }
2290
- }
2291
- function K(e, t) {
2292
- let n = t ?? { seen: /* @__PURE__ */ new Set() };
2293
- if (n.seen.has(e)) return !1;
2294
- n.seen.add(e);
2295
- let r = e._zod.def;
2296
- if (r.type === "transform") return !0;
2297
- if (r.type === "array") return K(r.element, n);
2298
- if (r.type === "set") return K(r.valueType, n);
2299
- if (r.type === "lazy") return K(r.getter(), n);
2300
- if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault") return K(r.innerType, n);
2301
- if (r.type === "intersection") return K(r.left, n) || K(r.right, n);
2302
- if (r.type === "record" || r.type === "map") return K(r.keyType, n) || K(r.valueType, n);
2303
- if (r.type === "pipe") return e._zod.traits.has("$ZodCodec") ? !0 : K(r.in, n) || K(r.out, n);
2304
- if (r.type === "object") {
2305
- for (let e in r.shape) if (K(r.shape[e], n)) return !0;
2306
- return !1;
2307
- }
2308
- if (r.type === "union") {
2309
- for (let e of r.options) if (K(e, n)) return !0;
2310
- return !1;
2311
- }
2312
- if (r.type === "tuple") {
2313
- for (let e of r.items) if (K(e, n)) return !0;
2314
- return !!(r.rest && K(r.rest, n));
2315
- }
2316
- return !1;
2317
- }
2318
- var ri = (e, t = {}) => (n) => {
2319
- let r = ei({
2320
- ...n,
2321
- processors: t
2322
- });
2323
- return G(e, r), ti(r, e), ni(r, e);
2324
- }, ii = (e, t, n = {}) => (r) => {
2325
- let { libraryOptions: i, target: a } = r ?? {}, o = ei({
2326
- ...i ?? {},
2327
- target: a,
2328
- io: t,
2329
- processors: n
2330
- });
2331
- return G(e, o), ti(o, e), ni(o, e);
2332
- }, ai = {
2333
- guid: "uuid",
2334
- url: "uri",
2335
- datetime: "date-time",
2336
- json_string: "json-string",
2337
- regex: ""
2338
- }, oi = (e, t, n, r) => {
2339
- let i = n;
2340
- i.type = "string";
2341
- let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l } = e._zod.bag;
2342
- if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format = ai[s] ?? s, i.format === "" && delete i.format, s === "time" && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) {
2343
- let e = [...c];
2344
- e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({
2345
- ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
2346
- pattern: e.source
2347
- }))]);
2348
- }
2349
- }, si = (e, t, n, r) => {
2350
- let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
2351
- typeof s == "string" && s.includes("int") ? i.type = "integer" : i.type = "number";
2352
- let d = typeof u == "number" && u >= (a ?? -Infinity), f = typeof l == "number" && l <= (o ?? Infinity), p = t.target === "draft-04" || t.target === "openapi-3.0";
2353
- d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == "number" && (i.maximum = o), typeof c == "number" && (i.multipleOf = c);
2354
- }, ci = (e, t, n, r) => {
2355
- n.not = {};
2356
- }, li = (e, t, n, r) => {
2357
- let i = e._zod.def, a = se(i.entries);
2358
- a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), n.enum = a;
2359
- }, ui = (e, t, n, r) => {
2360
- if (t.unrepresentable === "throw") throw Error("Custom types cannot be represented in JSON Schema");
2361
- }, di = (e, t, n, r) => {
2362
- if (t.unrepresentable === "throw") throw Error("Transforms cannot be represented in JSON Schema");
2363
- }, fi = (e, t, n, r) => {
2364
- let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag;
2365
- typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = G(a.element, t, {
2366
- ...r,
2367
- path: [...r.path, "items"]
2368
- });
2369
- }, pi = (e, t, n, r) => {
2370
- let i = n, a = e._zod.def;
2371
- i.type = "object", i.properties = {};
2372
- let o = a.shape;
2373
- for (let e in o) i.properties[e] = G(o[e], t, {
2374
- ...r,
2375
- path: [
2376
- ...r.path,
2377
- "properties",
2378
- e
2379
- ]
2380
- });
2381
- let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => {
2382
- let n = a.shape[e]._zod;
2383
- return t.io === "input" ? n.optin === void 0 : n.optout === void 0;
2384
- }));
2385
- c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = G(a.catchall, t, {
2386
- ...r,
2387
- path: [...r.path, "additionalProperties"]
2388
- })) : t.io === "output" && (i.additionalProperties = !1);
2389
- }, mi = (e, t, n, r) => {
2390
- let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => G(e, t, {
2391
- ...r,
2392
- path: [
2393
- ...r.path,
2394
- a ? "oneOf" : "anyOf",
2395
- n
2396
- ]
2397
- }));
2398
- a ? n.oneOf = o : n.anyOf = o;
2399
- }, hi = (e, t, n, r) => {
2400
- let i = e._zod.def, a = G(i.left, t, {
2401
- ...r,
2402
- path: [
2403
- ...r.path,
2404
- "allOf",
2405
- 0
2406
- ]
2407
- }), o = G(i.right, t, {
2408
- ...r,
2409
- path: [
2410
- ...r.path,
2411
- "allOf",
2412
- 1
2413
- ]
2414
- }), s = (e) => "allOf" in e && Object.keys(e).length === 1;
2415
- n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]];
2416
- }, gi = (e, t, n, r) => {
2417
- let i = n, a = e._zod.def;
2418
- i.type = "array";
2419
- let o = t.target === "draft-2020-12" ? "prefixItems" : "items", s = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = a.items.map((e, n) => G(e, t, {
2420
- ...r,
2421
- path: [
2422
- ...r.path,
2423
- o,
2424
- n
2425
- ]
2426
- })), l = a.rest ? G(a.rest, t, {
2427
- ...r,
2428
- path: [
2429
- ...r.path,
2430
- s,
2431
- ...t.target === "openapi-3.0" ? [a.items.length] : []
2432
- ]
2433
- }) : null;
2434
- t.target === "draft-2020-12" ? (i.prefixItems = c, l && (i.items = l)) : t.target === "openapi-3.0" ? (i.items = { anyOf: c }, l && i.items.anyOf.push(l), i.minItems = c.length, l || (i.maxItems = c.length)) : (i.items = c, l && (i.additionalItems = l));
2435
- let { minimum: u, maximum: d } = e._zod.bag;
2436
- typeof u == "number" && (i.minItems = u), typeof d == "number" && (i.maxItems = d);
2437
- }, _i = (e, t, n, r) => {
2438
- let i = e._zod.def, a = G(i.innerType, t, r), o = t.seen.get(e);
2439
- t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
2440
- }, vi = (e, t, n, r) => {
2441
- let i = e._zod.def;
2442
- G(i.innerType, t, r);
2443
- let a = t.seen.get(e);
2444
- a.ref = i.innerType;
2445
- }, yi = (e, t, n, r) => {
2446
- let i = e._zod.def;
2447
- G(i.innerType, t, r);
2448
- let a = t.seen.get(e);
2449
- a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue));
2450
- }, bi = (e, t, n, r) => {
2451
- let i = e._zod.def;
2452
- G(i.innerType, t, r);
2453
- let a = t.seen.get(e);
2454
- a.ref = i.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
2455
- }, xi = (e, t, n, r) => {
2456
- let i = e._zod.def;
2457
- G(i.innerType, t, r);
2458
- let a = t.seen.get(e);
2459
- a.ref = i.innerType;
2460
- let o;
2461
- try {
2462
- o = i.catchValue(void 0);
2463
- } catch {
2464
- throw Error("Dynamic catch values are not supported in JSON Schema");
2465
- }
2466
- n.default = o;
2467
- }, Si = (e, t, n, r) => {
2468
- let i = e._zod.def, a = i.in._zod.traits.has("$ZodTransform"), o = t.io === "input" ? a ? i.out : i.in : i.out;
2469
- G(o, t, r);
2470
- let s = t.seen.get(e);
2471
- s.ref = o;
2472
- }, Ci = (e, t, n, r) => {
2473
- let i = e._zod.def;
2474
- G(i.innerType, t, r);
2475
- let a = t.seen.get(e);
2476
- a.ref = i.innerType, n.readOnly = !0;
2477
- }, wi = (e, t, n, r) => {
2478
- let i = e._zod.def;
2479
- G(i.innerType, t, r);
2480
- let a = t.seen.get(e);
2481
- a.ref = i.innerType;
2482
- }, Ti = /* @__PURE__ */ v("ZodISODateTime", (e, t) => {
2483
- Xt.init(e, t), Y.init(e, t);
2484
- });
2485
- function Ei(e) {
2486
- return /* @__PURE__ */ Cr(Ti, e);
2487
- }
2488
- var Di = /* @__PURE__ */ v("ZodISODate", (e, t) => {
2489
- Zt.init(e, t), Y.init(e, t);
2490
- });
2491
- function Oi(e) {
2492
- return /* @__PURE__ */ wr(Di, e);
2493
- }
2494
- var ki = /* @__PURE__ */ v("ZodISOTime", (e, t) => {
2495
- Qt.init(e, t), Y.init(e, t);
2496
- });
2497
- function Ai(e) {
2498
- return /* @__PURE__ */ Tr(ki, e);
2499
- }
2500
- var ji = /* @__PURE__ */ v("ZodISODuration", (e, t) => {
2501
- $t.init(e, t), Y.init(e, t);
2502
- });
2503
- function Mi(e) {
2504
- return /* @__PURE__ */ Er(ji, e);
2505
- }
2506
- var q = /* @__PURE__ */ v("ZodError", (e, t) => {
2507
- Ee.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2508
- format: { value: (t) => ke(e, t) },
2509
- flatten: { value: (t) => Oe(e, t) },
2510
- addIssue: { value: (t) => {
2511
- e.issues.push(t), e.message = JSON.stringify(e.issues, S, 2);
2512
- } },
2513
- addIssues: { value: (t) => {
2514
- e.issues.push(...t), e.message = JSON.stringify(e.issues, S, 2);
2515
- } },
2516
- isEmpty: { get() {
2517
- return e.issues.length === 0;
2518
- } }
2519
- });
2520
- }, { Parent: Error }), Ni = /* @__PURE__ */ Ae(q), Pi = /* @__PURE__ */ je(q), Fi = /* @__PURE__ */ Me(q), Ii = /* @__PURE__ */ Pe(q), Li = /* @__PURE__ */ Ie(q), Ri = /* @__PURE__ */ Le(q), zi = /* @__PURE__ */ Re(q), Bi = /* @__PURE__ */ ze(q), Vi = /* @__PURE__ */ Be(q), Hi = /* @__PURE__ */ Ve(q), Ui = /* @__PURE__ */ He(q), Wi = /* @__PURE__ */ Ue(q), Gi = /* @__PURE__ */ new WeakMap();
2521
- function Ki(e, t, n) {
2522
- let r = Object.getPrototypeOf(e), i = Gi.get(r);
2523
- if (i || (i = /* @__PURE__ */ new Set(), Gi.set(r, i)), !i.has(t)) {
2524
- i.add(t);
2525
- for (let e in n) {
2526
- let t = n[e];
2527
- Object.defineProperty(r, e, {
2528
- configurable: !0,
2529
- enumerable: !1,
2530
- get() {
2531
- let n = t.bind(this);
2532
- return Object.defineProperty(this, e, {
2533
- configurable: !0,
2534
- writable: !0,
2535
- enumerable: !0,
2536
- value: n
2537
- }), n;
2538
- },
2539
- set(t) {
2540
- Object.defineProperty(this, e, {
2541
- configurable: !0,
2542
- writable: !0,
2543
- enumerable: !0,
2544
- value: t
2545
- });
2546
- }
2547
- });
2548
- }
2549
- }
2550
- }
2551
- var J = /* @__PURE__ */ v("ZodType", (e, t) => (H.init(e, t), Object.assign(e["~standard"], { jsonSchema: {
2552
- input: ii(e, "input"),
2553
- output: ii(e, "output")
2554
- } }), e.toJSONSchema = ri(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (t, n) => Ni(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => Fi(e, t, n), e.parseAsync = async (t, n) => Pi(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => Ii(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => Li(e, t, n), e.decode = (t, n) => Ri(e, t, n), e.encodeAsync = async (t, n) => zi(e, t, n), e.decodeAsync = async (t, n) => Bi(e, t, n), e.safeEncode = (t, n) => Vi(e, t, n), e.safeDecode = (t, n) => Hi(e, t, n), e.safeEncodeAsync = async (t, n) => Ui(e, t, n), e.safeDecodeAsync = async (t, n) => Wi(e, t, n), Ki(e, "ZodType", {
2555
- check(...e) {
2556
- let t = this.def;
2557
- return this.clone(k(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
2558
- check: e,
2559
- def: { check: "custom" },
2560
- onattach: []
2561
- } } : e)] }), { parent: !0 });
2562
- },
2563
- with(...e) {
2564
- return this.check(...e);
2565
- },
2566
- clone(e, t) {
2567
- return I(this, e, t);
2568
- },
2569
- brand() {
2570
- return this;
2571
- },
2572
- register(e, t) {
2573
- return e.add(this, t), this;
2574
- },
2575
- refine(e, t) {
2576
- return this.check(no(e, t));
2577
- },
2578
- superRefine(e, t) {
2579
- return this.check(ro(e, t));
2580
- },
2581
- overwrite(e) {
2582
- return this.check(/* @__PURE__ */ W(e));
2583
- },
2584
- optional() {
2585
- return Ra(this);
2586
- },
2587
- exactOptional() {
2588
- return Ba(this);
2589
- },
2590
- nullable() {
2591
- return Ha(this);
2592
- },
2593
- nullish() {
2594
- return Ra(Ha(this));
2595
- },
2596
- nonoptional(e) {
2597
- return Ja(this, e);
2598
- },
2599
- array() {
2600
- return wa(this);
2601
- },
2602
- or(e) {
2603
- return Oa([this, e]);
2604
- },
2605
- and(e) {
2606
- return Aa(this, e);
2607
- },
2608
- transform(e) {
2609
- return Qa(this, Ia(e));
2610
- },
2611
- default(e) {
2612
- return Wa(this, e);
2613
- },
2614
- prefault(e) {
2615
- return Ka(this, e);
2616
- },
2617
- catch(e) {
2618
- return Xa(this, e);
2619
- },
2620
- pipe(e) {
2621
- return Qa(this, e);
2622
- },
2623
- readonly() {
2624
- return eo(this);
2625
- },
2626
- describe(e) {
2627
- let t = this.clone();
2628
- return $n.add(t, { description: e }), t;
2629
- },
2630
- meta(...e) {
2631
- if (e.length === 0) return $n.get(this);
2632
- let t = this.clone();
2633
- return $n.add(t, e[0]), t;
2634
- },
2635
- isOptional() {
2636
- return this.safeParse(void 0).success;
2637
- },
2638
- isNullable() {
2639
- return this.safeParse(null).success;
2640
- },
2641
- apply(e) {
2642
- return e(this);
2643
- }
2644
- }), Object.defineProperty(e, "description", {
2645
- get() {
2646
- return $n.get(e)?.description;
2647
- },
2648
- configurable: !0
2649
- }), e)), qi = /* @__PURE__ */ v("_ZodString", (e, t) => {
2650
- Rt.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => oi(e, t, n, r);
2651
- let n = e._zod.bag;
2652
- e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, Ki(e, "_ZodString", {
2653
- regex(...e) {
2654
- return this.check(/* @__PURE__ */ zr(...e));
2655
- },
2656
- includes(...e) {
2657
- return this.check(/* @__PURE__ */ Hr(...e));
2658
- },
2659
- startsWith(...e) {
2660
- return this.check(/* @__PURE__ */ Ur(...e));
2661
- },
2662
- endsWith(...e) {
2663
- return this.check(/* @__PURE__ */ Wr(...e));
2664
- },
2665
- min(...e) {
2666
- return this.check(/* @__PURE__ */ Lr(...e));
2667
- },
2668
- max(...e) {
2669
- return this.check(/* @__PURE__ */ Ir(...e));
2670
- },
2671
- length(...e) {
2672
- return this.check(/* @__PURE__ */ Rr(...e));
2673
- },
2674
- nonempty(...e) {
2675
- return this.check(/* @__PURE__ */ Lr(1, ...e));
2676
- },
2677
- lowercase(e) {
2678
- return this.check(/* @__PURE__ */ Br(e));
2679
- },
2680
- uppercase(e) {
2681
- return this.check(/* @__PURE__ */ Vr(e));
2682
- },
2683
- trim() {
2684
- return this.check(/* @__PURE__ */ Kr());
2685
- },
2686
- normalize(...e) {
2687
- return this.check(/* @__PURE__ */ Gr(...e));
2688
- },
2689
- toLowerCase() {
2690
- return this.check(/* @__PURE__ */ qr());
2691
- },
2692
- toUpperCase() {
2693
- return this.check(/* @__PURE__ */ Jr());
2694
- },
2695
- slugify() {
2696
- return this.check(/* @__PURE__ */ Yr());
2697
- }
2698
- });
2699
- }), Ji = /* @__PURE__ */ v("ZodString", (e, t) => {
2700
- Rt.init(e, t), qi.init(e, t), e.email = (t) => e.check(/* @__PURE__ */ tr(Xi, t)), e.url = (t) => e.check(/* @__PURE__ */ sr($i, t)), e.jwt = (t) => e.check(/* @__PURE__ */ Sr(ma, t)), e.emoji = (t) => e.check(/* @__PURE__ */ cr(ea, t)), e.guid = (t) => e.check(/* @__PURE__ */ nr(Zi, t)), e.uuid = (t) => e.check(/* @__PURE__ */ rr(Qi, t)), e.uuidv4 = (t) => e.check(/* @__PURE__ */ ir(Qi, t)), e.uuidv6 = (t) => e.check(/* @__PURE__ */ ar(Qi, t)), e.uuidv7 = (t) => e.check(/* @__PURE__ */ or(Qi, t)), e.nanoid = (t) => e.check(/* @__PURE__ */ lr(ta, t)), e.guid = (t) => e.check(/* @__PURE__ */ nr(Zi, t)), e.cuid = (t) => e.check(/* @__PURE__ */ ur(na, t)), e.cuid2 = (t) => e.check(/* @__PURE__ */ dr(ra, t)), e.ulid = (t) => e.check(/* @__PURE__ */ fr(ia, t)), e.base64 = (t) => e.check(/* @__PURE__ */ yr(da, t)), e.base64url = (t) => e.check(/* @__PURE__ */ br(fa, t)), e.xid = (t) => e.check(/* @__PURE__ */ pr(aa, t)), e.ksuid = (t) => e.check(/* @__PURE__ */ mr(oa, t)), e.ipv4 = (t) => e.check(/* @__PURE__ */ hr(sa, t)), e.ipv6 = (t) => e.check(/* @__PURE__ */ gr(ca, t)), e.cidrv4 = (t) => e.check(/* @__PURE__ */ _r(la, t)), e.cidrv6 = (t) => e.check(/* @__PURE__ */ vr(ua, t)), e.e164 = (t) => e.check(/* @__PURE__ */ xr(pa, t)), e.datetime = (t) => e.check(Ei(t)), e.date = (t) => e.check(Oi(t)), e.time = (t) => e.check(Ai(t)), e.duration = (t) => e.check(Mi(t));
2701
- });
2702
- function Yi(e) {
2703
- return /* @__PURE__ */ er(Ji, e);
2704
- }
2705
- var Y = /* @__PURE__ */ v("ZodStringFormat", (e, t) => {
2706
- U.init(e, t), qi.init(e, t);
2707
- }), Xi = /* @__PURE__ */ v("ZodEmail", (e, t) => {
2708
- Vt.init(e, t), Y.init(e, t);
2709
- }), Zi = /* @__PURE__ */ v("ZodGUID", (e, t) => {
2710
- zt.init(e, t), Y.init(e, t);
2711
- }), Qi = /* @__PURE__ */ v("ZodUUID", (e, t) => {
2712
- Bt.init(e, t), Y.init(e, t);
2713
- }), $i = /* @__PURE__ */ v("ZodURL", (e, t) => {
2714
- Ht.init(e, t), Y.init(e, t);
2715
- }), ea = /* @__PURE__ */ v("ZodEmoji", (e, t) => {
2716
- Ut.init(e, t), Y.init(e, t);
2717
- }), ta = /* @__PURE__ */ v("ZodNanoID", (e, t) => {
2718
- Wt.init(e, t), Y.init(e, t);
2719
- }), na = /* @__PURE__ */ v("ZodCUID", (e, t) => {
2720
- Gt.init(e, t), Y.init(e, t);
2721
- }), ra = /* @__PURE__ */ v("ZodCUID2", (e, t) => {
2722
- Kt.init(e, t), Y.init(e, t);
2723
- }), ia = /* @__PURE__ */ v("ZodULID", (e, t) => {
2724
- qt.init(e, t), Y.init(e, t);
2725
- }), aa = /* @__PURE__ */ v("ZodXID", (e, t) => {
2726
- Jt.init(e, t), Y.init(e, t);
2727
- }), oa = /* @__PURE__ */ v("ZodKSUID", (e, t) => {
2728
- Yt.init(e, t), Y.init(e, t);
2729
- }), sa = /* @__PURE__ */ v("ZodIPv4", (e, t) => {
2730
- en.init(e, t), Y.init(e, t);
2731
- }), ca = /* @__PURE__ */ v("ZodIPv6", (e, t) => {
2732
- tn.init(e, t), Y.init(e, t);
2733
- }), la = /* @__PURE__ */ v("ZodCIDRv4", (e, t) => {
2734
- nn.init(e, t), Y.init(e, t);
2735
- }), ua = /* @__PURE__ */ v("ZodCIDRv6", (e, t) => {
2736
- rn.init(e, t), Y.init(e, t);
2737
- }), da = /* @__PURE__ */ v("ZodBase64", (e, t) => {
2738
- on.init(e, t), Y.init(e, t);
2739
- }), fa = /* @__PURE__ */ v("ZodBase64URL", (e, t) => {
2740
- cn.init(e, t), Y.init(e, t);
2741
- }), pa = /* @__PURE__ */ v("ZodE164", (e, t) => {
2742
- ln.init(e, t), Y.init(e, t);
2743
- }), ma = /* @__PURE__ */ v("ZodJWT", (e, t) => {
2744
- dn.init(e, t), Y.init(e, t);
2745
- }), ha = /* @__PURE__ */ v("ZodNumber", (e, t) => {
2746
- fn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => si(e, t, n, r), Ki(e, "ZodNumber", {
2747
- gt(e, t) {
2748
- return this.check(/* @__PURE__ */ Nr(e, t));
2749
- },
2750
- gte(e, t) {
2751
- return this.check(/* @__PURE__ */ Pr(e, t));
2752
- },
2753
- min(e, t) {
2754
- return this.check(/* @__PURE__ */ Pr(e, t));
2755
- },
2756
- lt(e, t) {
2757
- return this.check(/* @__PURE__ */ jr(e, t));
2758
- },
2759
- lte(e, t) {
2760
- return this.check(/* @__PURE__ */ Mr(e, t));
2761
- },
2762
- max(e, t) {
2763
- return this.check(/* @__PURE__ */ Mr(e, t));
2764
- },
2765
- int(e) {
2766
- return this.check(va(e));
2767
- },
2768
- safe(e) {
2769
- return this.check(va(e));
2770
- },
2771
- positive(e) {
2772
- return this.check(/* @__PURE__ */ Nr(0, e));
2773
- },
2774
- nonnegative(e) {
2775
- return this.check(/* @__PURE__ */ Pr(0, e));
2776
- },
2777
- negative(e) {
2778
- return this.check(/* @__PURE__ */ jr(0, e));
2779
- },
2780
- nonpositive(e) {
2781
- return this.check(/* @__PURE__ */ Mr(0, e));
2782
- },
2783
- multipleOf(e, t) {
2784
- return this.check(/* @__PURE__ */ Fr(e, t));
2785
- },
2786
- step(e, t) {
2787
- return this.check(/* @__PURE__ */ Fr(e, t));
2788
- },
2789
- finite() {
2790
- return this;
2791
- }
2792
- });
2793
- let n = e._zod.bag;
2794
- e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null;
2795
- });
2796
- function ga(e) {
2797
- return /* @__PURE__ */ Dr(ha, e);
2798
- }
2799
- var _a = /* @__PURE__ */ v("ZodNumberFormat", (e, t) => {
2800
- pn.init(e, t), ha.init(e, t);
2801
- });
2802
- function va(e) {
2803
- return /* @__PURE__ */ Or(_a, e);
2804
- }
2805
- var ya = /* @__PURE__ */ v("ZodUnknown", (e, t) => {
2806
- mn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
2807
- });
2808
- function ba() {
2809
- return /* @__PURE__ */ kr(ya);
2810
- }
2811
- var xa = /* @__PURE__ */ v("ZodNever", (e, t) => {
2812
- hn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => ci(e, t, n, r);
2813
- });
2814
- function Sa(e) {
2815
- return /* @__PURE__ */ Ar(xa, e);
2816
- }
2817
- var Ca = /* @__PURE__ */ v("ZodArray", (e, t) => {
2818
- _n.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => fi(e, t, n, r), e.element = t.element, Ki(e, "ZodArray", {
2819
- min(e, t) {
2820
- return this.check(/* @__PURE__ */ Lr(e, t));
2821
- },
2822
- nonempty(e) {
2823
- return this.check(/* @__PURE__ */ Lr(1, e));
2824
- },
2825
- max(e, t) {
2826
- return this.check(/* @__PURE__ */ Ir(e, t));
2827
- },
2828
- length(e, t) {
2829
- return this.check(/* @__PURE__ */ Rr(e, t));
2830
- },
2831
- unwrap() {
2832
- return this.element;
2833
- }
2834
- });
2835
- });
2836
- function wa(e, t) {
2837
- return /* @__PURE__ */ Xr(Ca, e, t);
2838
- }
2839
- var Ta = /* @__PURE__ */ v("ZodObject", (e, t) => {
2840
- Sn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => pi(e, t, n, r), D(e, "shape", () => t.shape), Ki(e, "ZodObject", {
2841
- keyof() {
2842
- return Pa(Object.keys(this._zod.def.shape));
2843
- },
2844
- catchall(e) {
2845
- return this.clone({
2846
- ...this._zod.def,
2847
- catchall: e
2848
- });
2849
- },
2850
- passthrough() {
2851
- return this.clone({
2852
- ...this._zod.def,
2853
- catchall: ba()
2854
- });
2855
- },
2856
- loose() {
2857
- return this.clone({
2858
- ...this._zod.def,
2859
- catchall: ba()
2860
- });
2861
- },
2862
- strict() {
2863
- return this.clone({
2864
- ...this._zod.def,
2865
- catchall: Sa()
2866
- });
2867
- },
2868
- strip() {
2869
- return this.clone({
2870
- ...this._zod.def,
2871
- catchall: void 0
2872
- });
2873
- },
2874
- extend(e) {
2875
- return he(this, e);
2876
- },
2877
- safeExtend(e) {
2878
- return ge(this, e);
2879
- },
2880
- merge(e) {
2881
- return _e(this, e);
2882
- },
2883
- pick(e) {
2884
- return R(this, e);
2885
- },
2886
- omit(e) {
2887
- return me(this, e);
2888
- },
2889
- partial(...e) {
2890
- return ve(La, this, e[0]);
2891
- },
2892
- required(...e) {
2893
- return ye(qa, this, e[0]);
2894
- }
2895
- });
2896
- });
2897
- function Ea(e, t) {
2898
- return new Ta({
2899
- type: "object",
2900
- shape: e ?? {},
2901
- ...L(t)
2902
- });
2903
- }
2904
- var Da = /* @__PURE__ */ v("ZodUnion", (e, t) => {
2905
- wn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => mi(e, t, n, r), e.options = t.options;
2906
- });
2907
- function Oa(e, t) {
2908
- return new Da({
2909
- type: "union",
2910
- options: e,
2911
- ...L(t)
2912
- });
2913
- }
2914
- var ka = /* @__PURE__ */ v("ZodIntersection", (e, t) => {
2915
- Tn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => hi(e, t, n, r);
2916
- });
2917
- function Aa(e, t) {
2918
- return new ka({
2919
- type: "intersection",
2920
- left: e,
2921
- right: t
2922
- });
2923
- }
2924
- var ja = /* @__PURE__ */ v("ZodTuple", (e, t) => {
2925
- On.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => gi(e, t, n, r), e.rest = (t) => e.clone({
2926
- ...e._zod.def,
2927
- rest: t
2928
- });
2929
- });
2930
- function Ma(e, t, n) {
2931
- let r = t instanceof H;
2932
- return new ja({
2933
- type: "tuple",
2934
- items: e,
2935
- rest: r ? t : null,
2936
- ...L(r ? n : t)
2937
- });
2938
- }
2939
- var Na = /* @__PURE__ */ v("ZodEnum", (e, t) => {
2940
- Mn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => li(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
2941
- let n = new Set(Object.keys(t.entries));
2942
- e.extract = (e, r) => {
2943
- let i = {};
2944
- for (let r of e) if (n.has(r)) i[r] = t.entries[r];
2945
- else throw Error(`Key ${r} not found in enum`);
2946
- return new Na({
2947
- ...t,
2948
- checks: [],
2949
- ...L(r),
2950
- entries: i
2951
- });
2952
- }, e.exclude = (e, r) => {
2953
- let i = { ...t.entries };
2954
- for (let t of e) if (n.has(t)) delete i[t];
2955
- else throw Error(`Key ${t} not found in enum`);
2956
- return new Na({
2957
- ...t,
2958
- checks: [],
2959
- ...L(r),
2960
- entries: i
2961
- });
2962
- };
2963
- });
2964
- function Pa(e, t) {
2965
- return new Na({
2966
- type: "enum",
2967
- entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
2968
- ...L(t)
2969
- });
2970
- }
2971
- var Fa = /* @__PURE__ */ v("ZodTransform", (e, t) => {
2972
- Nn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => di(e, t, n, r), e._zod.parse = (n, r) => {
2973
- if (r.direction === "backward") throw new oe(e.constructor.name);
2974
- n.addIssue = (r) => {
2975
- if (typeof r == "string") n.issues.push(we(r, n.value, t));
2976
- else {
2977
- let t = r;
2978
- t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= n.value, t.inst ??= e, n.issues.push(we(t));
2979
- }
2980
- };
2981
- let i = t.transform(n.value, n);
2982
- return i instanceof Promise ? i.then((e) => (n.value = e, n.fallback = !0, n)) : (n.value = i, n.fallback = !0, n);
2983
- };
2984
- });
2985
- function Ia(e) {
2986
- return new Fa({
2987
- type: "transform",
2988
- transform: e
2989
- });
2990
- }
2991
- var La = /* @__PURE__ */ v("ZodOptional", (e, t) => {
2992
- Fn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => wi(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2993
- });
2994
- function Ra(e) {
2995
- return new La({
2996
- type: "optional",
2997
- innerType: e
2998
- });
2999
- }
3000
- var za = /* @__PURE__ */ v("ZodExactOptional", (e, t) => {
3001
- In.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => wi(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
3002
- });
3003
- function Ba(e) {
3004
- return new za({
3005
- type: "optional",
3006
- innerType: e
3007
- });
3008
- }
3009
- var Va = /* @__PURE__ */ v("ZodNullable", (e, t) => {
3010
- Ln.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => _i(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
3011
- });
3012
- function Ha(e) {
3013
- return new Va({
3014
- type: "nullable",
3015
- innerType: e
3016
- });
3017
- }
3018
- var Ua = /* @__PURE__ */ v("ZodDefault", (e, t) => {
3019
- Rn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => yi(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
3020
- });
3021
- function Wa(e, t) {
3022
- return new Ua({
3023
- type: "default",
3024
- innerType: e,
3025
- get defaultValue() {
3026
- return typeof t == "function" ? t() : N(t);
3027
- }
3028
- });
3029
- }
3030
- var Ga = /* @__PURE__ */ v("ZodPrefault", (e, t) => {
3031
- Bn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => bi(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
3032
- });
3033
- function Ka(e, t) {
3034
- return new Ga({
3035
- type: "prefault",
3036
- innerType: e,
3037
- get defaultValue() {
3038
- return typeof t == "function" ? t() : N(t);
3039
- }
3040
- });
3041
- }
3042
- var qa = /* @__PURE__ */ v("ZodNonOptional", (e, t) => {
3043
- Vn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => vi(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
3044
- });
3045
- function Ja(e, t) {
3046
- return new qa({
3047
- type: "nonoptional",
3048
- innerType: e,
3049
- ...L(t)
3050
- });
3051
- }
3052
- var Ya = /* @__PURE__ */ v("ZodCatch", (e, t) => {
3053
- Un.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => xi(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
3054
- });
3055
- function Xa(e, t) {
3056
- return new Ya({
3057
- type: "catch",
3058
- innerType: e,
3059
- catchValue: typeof t == "function" ? t : () => t
3060
- });
3061
- }
3062
- var Za = /* @__PURE__ */ v("ZodPipe", (e, t) => {
3063
- Wn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => Si(e, t, n, r), e.in = t.in, e.out = t.out;
3064
- });
3065
- function Qa(e, t) {
3066
- return new Za({
3067
- type: "pipe",
3068
- in: e,
3069
- out: t
3070
- });
3071
- }
3072
- var $a = /* @__PURE__ */ v("ZodReadonly", (e, t) => {
3073
- Kn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ci(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
3074
- });
3075
- function eo(e) {
3076
- return new $a({
3077
- type: "readonly",
3078
- innerType: e
3079
- });
3080
- }
3081
- var to = /* @__PURE__ */ v("ZodCustom", (e, t) => {
3082
- Jn.init(e, t), J.init(e, t), e._zod.processJSONSchema = (t, n, r) => ui(e, t, n, r);
3083
- });
3084
- function no(e, t = {}) {
3085
- return /* @__PURE__ */ Zr(to, e, t);
3086
- }
3087
- function ro(e, t) {
3088
- return /* @__PURE__ */ Qr(e, t);
3089
- }
3090
- //#endregion
3091
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/use-map.js
3092
- var io = r.createContext(null);
3093
- //#endregion
3094
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/utils/deep-equal.js
3095
- function ao(e, t) {
3096
- let n = Array.isArray(e) ? e[0] : e ? e.x : 0, r = Array.isArray(e) ? e[1] : e ? e.y : 0, i = Array.isArray(t) ? t[0] : t ? t.x : 0, a = Array.isArray(t) ? t[1] : t ? t.y : 0;
3097
- return n === i && r === a;
3098
- }
3099
- function X(e, t) {
3100
- if (e === t) return !0;
3101
- if (!e || !t) return !1;
3102
- if (Array.isArray(e)) {
3103
- if (!Array.isArray(t) || e.length !== t.length) return !1;
3104
- for (let n = 0; n < e.length; n++) if (!X(e[n], t[n])) return !1;
3105
- return !0;
3106
- } else if (Array.isArray(t)) return !1;
3107
- if (typeof e == "object" && typeof t == "object") {
3108
- let n = Object.keys(e), r = Object.keys(t);
3109
- if (n.length !== r.length) return !1;
3110
- for (let r of n) if (!t.hasOwnProperty(r) || !X(e[r], t[r])) return !1;
3111
- return !0;
3112
- }
3113
- return !1;
3114
- }
3115
- //#endregion
3116
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/utils/transform.js
3117
- function oo(e) {
3118
- return {
3119
- longitude: e.center.lng,
3120
- latitude: e.center.lat,
3121
- zoom: e.zoom,
3122
- pitch: e.pitch,
3123
- bearing: e.bearing,
3124
- padding: e.padding
3125
- };
3126
- }
3127
- function so(e, t) {
3128
- let n = t.viewState || t, r = {};
3129
- if ("longitude" in n && "latitude" in n && (n.longitude !== e.center.lng || n.latitude !== e.center.lat)) {
3130
- let t = e.center.constructor;
3131
- r.center = new t(n.longitude, n.latitude);
3132
- }
3133
- return "zoom" in n && n.zoom !== e.zoom && (r.zoom = n.zoom), "bearing" in n && n.bearing !== e.bearing && (r.bearing = n.bearing), "pitch" in n && n.pitch !== e.pitch && (r.pitch = n.pitch), n.padding && e.padding && !X(n.padding, e.padding) && (r.padding = n.padding), r;
3134
- }
3135
- //#endregion
3136
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js
3137
- var co = [
3138
- "type",
3139
- "source",
3140
- "source-layer",
3141
- "minzoom",
3142
- "maxzoom",
3143
- "filter",
3144
- "layout"
3145
- ];
3146
- function lo(e) {
3147
- if (!e) return null;
3148
- if (typeof e == "string" || ("toJS" in e && (e = e.toJS()), !e.layers)) return e;
3149
- let t = {};
3150
- for (let n of e.layers) t[n.id] = n;
3151
- let n = e.layers.map((e) => {
3152
- let n = null;
3153
- "interactive" in e && (n = Object.assign({}, e), delete n.interactive);
3154
- let r = t[e.ref];
3155
- if (r) {
3156
- n ||= Object.assign({}, e), delete n.ref;
3157
- for (let e of co) e in r && (n[e] = r[e]);
3158
- }
3159
- return n || e;
3160
- });
3161
- return {
3162
- ...e,
3163
- layers: n
3164
- };
3165
- }
3166
- //#endregion
3167
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js
3168
- var uo = {
3169
- version: 8,
3170
- sources: {},
3171
- layers: []
3172
- }, fo = {
3173
- minZoom: 0,
3174
- maxZoom: 22,
3175
- minPitch: 0,
3176
- maxPitch: 85,
3177
- maxBounds: [
3178
- -180,
3179
- -85.051129,
3180
- 180,
3181
- 85.051129
3182
- ],
3183
- projection: "mercator",
3184
- renderWorldCopies: !0
3185
- }, po = {
3186
- mousedown: "onMouseDown",
3187
- mouseup: "onMouseUp",
3188
- mouseover: "onMouseOver",
3189
- mousemove: "onMouseMove",
3190
- click: "onClick",
3191
- dblclick: "onDblClick",
3192
- mouseenter: "onMouseEnter",
3193
- mouseleave: "onMouseLeave",
3194
- mouseout: "onMouseOut",
3195
- contextmenu: "onContextMenu",
3196
- touchstart: "onTouchStart",
3197
- touchend: "onTouchEnd",
3198
- touchmove: "onTouchMove",
3199
- touchcancel: "onTouchCancel"
3200
- }, mo = {
3201
- movestart: "onMoveStart",
3202
- move: "onMove",
3203
- moveend: "onMoveEnd",
3204
- dragstart: "onDragStart",
3205
- drag: "onDrag",
3206
- dragend: "onDragEnd",
3207
- zoomstart: "onZoomStart",
3208
- zoom: "onZoom",
3209
- zoomend: "onZoomEnd",
3210
- rotatestart: "onRotateStart",
3211
- rotate: "onRotate",
3212
- rotateend: "onRotateEnd",
3213
- pitchstart: "onPitchStart",
3214
- pitch: "onPitch",
3215
- pitchend: "onPitchEnd"
3216
- }, ho = {
3217
- wheel: "onWheel",
3218
- boxzoomstart: "onBoxZoomStart",
3219
- boxzoomend: "onBoxZoomEnd",
3220
- boxzoomcancel: "onBoxZoomCancel",
3221
- resize: "onResize",
3222
- load: "onLoad",
3223
- render: "onRender",
3224
- idle: "onIdle",
3225
- remove: "onRemove",
3226
- data: "onData",
3227
- styledata: "onStyleData",
3228
- sourcedata: "onSourceData",
3229
- error: "onError"
3230
- }, go = [
3231
- "minZoom",
3232
- "maxZoom",
3233
- "minPitch",
3234
- "maxPitch",
3235
- "maxBounds",
3236
- "projection",
3237
- "renderWorldCopies"
3238
- ], _o = [
3239
- "scrollZoom",
3240
- "boxZoom",
3241
- "dragRotate",
3242
- "dragPan",
3243
- "keyboard",
3244
- "doubleClickZoom",
3245
- "touchZoomRotate",
3246
- "touchPitch"
3247
- ], vo = class e {
3248
- constructor(e, t, n) {
3249
- this._map = null, this._internalUpdate = !1, this._hoveredFeatures = null, this._propsedCameraUpdate = null, this._styleComponents = {}, this._onEvent = (e) => {
3250
- let t = this.props[ho[e.type]];
3251
- t ? t(e) : e.type === "error" && console.error(e.error);
3252
- }, this._onCameraEvent = (e) => {
3253
- if (this._internalUpdate) return;
3254
- e.viewState = this._propsedCameraUpdate || oo(this._map.transform);
3255
- let t = this.props[mo[e.type]];
3256
- t && t(e);
3257
- }, this._onCameraUpdate = (e) => this._internalUpdate ? e : (this._propsedCameraUpdate = oo(e), so(e, this.props)), this._onPointerEvent = (e) => {
3258
- (e.type === "mousemove" || e.type === "mouseout") && this._updateHover(e);
3259
- let t = this.props[po[e.type]];
3260
- t && (this.props.interactiveLayerIds && e.type !== "mouseover" && e.type !== "mouseout" && (e.features = this._hoveredFeatures || this._queryRenderedFeatures(e.point)), t(e), delete e.features);
3261
- }, this._MapClass = e, this.props = t, this._initialize(n);
3262
- }
3263
- get map() {
3264
- return this._map;
3265
- }
3266
- setProps(e) {
3267
- let t = this.props;
3268
- this.props = e;
3269
- let n = this._updateSettings(e, t), r = this._updateSize(e), i = this._updateViewState(e);
3270
- this._updateStyle(e, t), this._updateStyleComponents(e), this._updateHandlers(e, t), (n || r || i && !this._map.isMoving()) && this.redraw();
3271
- }
3272
- static reuse(t, n) {
3273
- let r = e.savedMaps.pop();
3274
- if (!r) return null;
3275
- let i = r.map, a = i.getContainer();
3276
- for (n.className = a.className; a.childNodes.length > 0;) n.appendChild(a.childNodes[0]);
3277
- i._container = n;
3278
- let o = i._resizeObserver;
3279
- o && (o.disconnect(), o.observe(n)), r.setProps({
3280
- ...t,
3281
- styleDiffing: !1
3282
- }), i.resize();
3283
- let { initialViewState: s } = t;
3284
- return s && (s.bounds ? i.fitBounds(s.bounds, {
3285
- ...s.fitBoundsOptions,
3286
- duration: 0
3287
- }) : r._updateViewState(s)), i.isStyleLoaded() ? i.fire("load") : i.once("style.load", () => i.fire("load")), i._update(), r;
3288
- }
3289
- _initialize(e) {
3290
- let { props: t } = this, { mapStyle: n = uo } = t, r = {
3291
- ...t,
3292
- ...t.initialViewState,
3293
- container: e,
3294
- style: lo(n)
3295
- }, i = r.initialViewState || r.viewState || r;
3296
- if (Object.assign(r, {
3297
- center: [i.longitude || 0, i.latitude || 0],
3298
- zoom: i.zoom || 0,
3299
- pitch: i.pitch || 0,
3300
- bearing: i.bearing || 0
3301
- }), t.gl) {
3302
- let e = HTMLCanvasElement.prototype.getContext;
3303
- HTMLCanvasElement.prototype.getContext = () => (HTMLCanvasElement.prototype.getContext = e, t.gl);
3304
- }
3305
- let a = new this._MapClass(r);
3306
- i.padding && a.setPadding(i.padding), t.cursor && (a.getCanvas().style.cursor = t.cursor), a.transformCameraUpdate = this._onCameraUpdate, a.on("style.load", () => {
3307
- this._styleComponents = {
3308
- light: a.getLight(),
3309
- sky: a.getSky(),
3310
- projection: a.getProjection?.(),
3311
- terrain: a.getTerrain()
3312
- }, this._updateStyleComponents(this.props);
3313
- }), a.on("sourcedata", () => {
3314
- this._updateStyleComponents(this.props);
3315
- });
3316
- for (let e in po) a.on(e, this._onPointerEvent);
3317
- for (let e in mo) a.on(e, this._onCameraEvent);
3318
- for (let e in ho) a.on(e, this._onEvent);
3319
- this._map = a;
3320
- }
3321
- recycle() {
3322
- this.map.getContainer().querySelector("[mapboxgl-children]")?.remove(), e.savedMaps.push(this);
3323
- }
3324
- destroy() {
3325
- this._map.remove();
3326
- }
3327
- redraw() {
3328
- let e = this._map;
3329
- e.style && (e._frame &&= (e._frame.cancel(), null), e._render());
3330
- }
3331
- _updateSize(e) {
3332
- let { viewState: t } = e;
3333
- if (t) {
3334
- let e = this._map;
3335
- if (t.width !== e.transform.width || t.height !== e.transform.height) return e.resize(), !0;
3336
- }
3337
- return !1;
3338
- }
3339
- _updateViewState(e) {
3340
- let t = this._map, n = t.transform;
3341
- if (!t.isMoving()) {
3342
- let r = so(n, e);
3343
- if (Object.keys(r).length > 0) return this._internalUpdate = !0, t.jumpTo(r), this._internalUpdate = !1, !0;
3344
- }
3345
- return !1;
3346
- }
3347
- _updateSettings(e, t) {
3348
- let n = this._map, r = !1;
3349
- for (let i of go) if ((i in e || i in t) && !X(e[i], t[i])) {
3350
- r = !0;
3351
- let t = i in e ? e[i] : fo[i];
3352
- n[`set${i[0].toUpperCase()}${i.slice(1)}`]?.call(n, t);
3353
- }
3354
- return r;
3355
- }
3356
- _updateStyle(e, t) {
3357
- if (e.cursor !== t.cursor && (this._map.getCanvas().style.cursor = e.cursor || ""), e.mapStyle !== t.mapStyle) {
3358
- let { mapStyle: t = uo, styleDiffing: n = !0 } = e, r = { diff: n };
3359
- "localIdeographFontFamily" in e && (r.localIdeographFontFamily = e.localIdeographFontFamily), this._map.setStyle(lo(t), r);
3360
- }
3361
- }
3362
- _updateStyleComponents({ light: e, projection: t, sky: n, terrain: r }) {
3363
- let i = this._map, a = this._styleComponents;
3364
- i.style?._loaded && (e && !X(e, a.light) && (a.light = e, i.setLight(e)), t && !X(t, a.projection) && t !== a.projection?.type && (a.projection = typeof t == "string" ? { type: t } : t, i.setProjection?.(a.projection)), n && !X(n, a.sky) && (a.sky = n, i.setSky(n)), r !== void 0 && !X(r, a.terrain) && (!r || i.getSource(r.source)) && (a.terrain = r, i.setTerrain(r)));
3365
- }
3366
- _updateHandlers(e, t) {
3367
- let n = this._map;
3368
- for (let r of _o) {
3369
- let i = e[r] ?? !0;
3370
- X(i, t[r] ?? !0) || (i ? n[r].enable(i) : n[r].disable());
3371
- }
3372
- }
3373
- _queryRenderedFeatures(e) {
3374
- let t = this._map, { interactiveLayerIds: n = [] } = this.props;
3375
- try {
3376
- return t.queryRenderedFeatures(e, { layers: n.filter(t.getLayer.bind(t)) });
3377
- } catch {
3378
- return [];
3379
- }
3380
- }
3381
- _updateHover(e) {
3382
- let { props: t } = this;
3383
- if (t.interactiveLayerIds && (t.onMouseMove || t.onMouseEnter || t.onMouseLeave)) {
3384
- let t = e.type, n = this._hoveredFeatures?.length > 0, r = this._queryRenderedFeatures(e.point), i = r.length > 0;
3385
- !i && n && (e.type = "mouseleave", this._onPointerEvent(e)), this._hoveredFeatures = r, i && !n && (e.type = "mouseenter", this._onPointerEvent(e)), e.type = t;
3386
- } else this._hoveredFeatures = null;
3387
- }
3388
- };
3389
- vo.savedMaps = [];
3390
- //#endregion
3391
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/maplibre/create-ref.js
3392
- var yo = [
3393
- "setMaxBounds",
3394
- "setMinZoom",
3395
- "setMaxZoom",
3396
- "setMinPitch",
3397
- "setMaxPitch",
3398
- "setRenderWorldCopies",
3399
- "setProjection",
3400
- "setStyle",
3401
- "addSource",
3402
- "removeSource",
3403
- "addLayer",
3404
- "removeLayer",
3405
- "setLayerZoomRange",
3406
- "setFilter",
3407
- "setPaintProperty",
3408
- "setLayoutProperty",
3409
- "setLight",
3410
- "setTerrain",
3411
- "setFog",
3412
- "remove"
3413
- ];
3414
- function bo(e) {
3415
- if (!e) return null;
3416
- let t = e.map, n = { getMap: () => t };
3417
- for (let e of xo(t)) !(e in n) && !yo.includes(e) && (n[e] = t[e].bind(t));
3418
- return n;
3419
- }
3420
- function xo(e) {
3421
- let t = /* @__PURE__ */ new Set(), n = e;
3422
- for (; n;) {
3423
- for (let r of Object.getOwnPropertyNames(n)) r[0] !== "_" && typeof e[r] == "function" && r !== "fire" && r !== "setEventedParent" && t.add(r);
3424
- n = Object.getPrototypeOf(n);
3425
- }
3426
- return Array.from(t);
3427
- }
3428
- //#endregion
3429
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/utils/use-isomorphic-layout-effect.js
3430
- var So = typeof document < "u" ? u : c;
3431
- //#endregion
3432
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js
3433
- function Co(e, t) {
3434
- let { RTLTextPlugin: n, maxParallelImageRequests: r, workerCount: i, workerUrl: a } = t;
3435
- if (n && e.getRTLTextPluginStatus && e.getRTLTextPluginStatus() === "unavailable") {
3436
- let { pluginUrl: t, lazy: r = !0 } = typeof n == "string" ? { pluginUrl: n } : n;
3437
- e.setRTLTextPlugin(t, (e) => {
3438
- e && console.error(e);
3439
- }, r);
3440
- }
3441
- r !== void 0 && e.setMaxParallelImageRequests(r), i !== void 0 && e.setWorkerCount(i), a !== void 0 && e.setWorkerUrl(a);
3442
- }
3443
- //#endregion
3444
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/map.js
3445
- var wo = r.createContext(null);
3446
- function To(e, n) {
3447
- let i = s(io), [a, o] = p(null), u = f(), { current: m } = f({
3448
- mapLib: null,
3449
- map: null
3450
- });
3451
- c(() => {
3452
- let n = e.mapLib, r = !0, a;
3453
- return Promise.resolve(n || import("./maplibre-gl-D8guyJSV.js").then((e) => /* @__PURE__ */ t(e.default, 1))).then((t) => {
3454
- if (!r) return;
3455
- if (!t) throw Error("Invalid mapLib");
3456
- let n = "Map" in t ? t : t.default;
3457
- if (!n.Map) throw Error("Invalid mapLib");
3458
- Co(n, e), e.reuseMaps && (a = vo.reuse(e, u.current)), a ||= new vo(n.Map, e, u.current), m.map = bo(a), m.mapLib = n, o(a), i?.onMapMount(m.map, e.id);
3459
- }).catch((t) => {
3460
- let { onError: n } = e;
3461
- n ? n({
3462
- type: "error",
3463
- target: null,
3464
- originalEvent: null,
3465
- error: t
3466
- }) : console.error(t);
3467
- }), () => {
3468
- r = !1, a && (i?.onMapUnmount(e.id), e.reuseMaps ? a.recycle() : a.destroy());
3469
- };
3470
- }, []), So(() => {
3471
- a && a.setProps(e);
3472
- }), l(n, () => m.map, [a]);
3473
- let h = d(() => ({
3474
- position: "relative",
3475
- width: "100%",
3476
- height: "100%",
3477
- ...e.style
3478
- }), [e.style]);
3479
- return r.createElement("div", {
3480
- id: e.id,
3481
- ref: u,
3482
- style: h
3483
- }, a && r.createElement(wo.Provider, { value: m }, r.createElement("div", {
3484
- "mapboxgl-children": "",
3485
- style: { height: "100%" }
3486
- }, e.children)));
3487
- }
3488
- var Eo = r.forwardRef(To), Do = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
3489
- function Z(e, t) {
3490
- if (!e || !t) return;
3491
- let n = e.style;
3492
- for (let e in t) {
3493
- let r = t[e];
3494
- Number.isFinite(r) && !Do.test(e) ? n[e] = `${r}px` : n[e] = r;
3495
- }
3496
- }
3497
- //#endregion
3498
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js
3499
- function Oo(e, t) {
3500
- if (e === t) return null;
3501
- let n = ko(e), r = ko(t), i = [];
3502
- for (let e of r) n.has(e) || i.push(e);
3503
- for (let e of n) r.has(e) || i.push(e);
3504
- return i.length === 0 ? null : i;
3505
- }
3506
- function ko(e) {
3507
- return new Set(e ? e.trim().split(/\s+/) : []);
3508
- }
3509
- //#endregion
3510
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/marker.js
3511
- var Ao = a(i((e, t) => {
3512
- let { map: n, mapLib: i } = s(wo), a = f({ props: e }), o = d(() => {
3513
- let t = !1;
3514
- r.Children.forEach(e.children, (e) => {
3515
- e && (t = !0);
3516
- });
3517
- let n = {
3518
- ...e,
3519
- element: t ? document.createElement("div") : void 0
3520
- }, s = new i.Marker(n);
3521
- return s.setLngLat([e.longitude, e.latitude]), s.getElement().addEventListener("click", (e) => {
3522
- a.current.props.onClick?.({
3523
- type: "click",
3524
- target: s,
3525
- originalEvent: e
3526
- });
3527
- }), s.on("dragstart", (e) => {
3528
- let t = e;
3529
- t.lngLat = o.getLngLat(), a.current.props.onDragStart?.(t);
3530
- }), s.on("drag", (e) => {
3531
- let t = e;
3532
- t.lngLat = o.getLngLat(), a.current.props.onDrag?.(t);
3533
- }), s.on("dragend", (e) => {
3534
- let t = e;
3535
- t.lngLat = o.getLngLat(), a.current.props.onDragEnd?.(t);
3536
- }), s;
3537
- }, []);
3538
- c(() => (o.addTo(n.getMap()), () => {
3539
- o.remove();
3540
- }), []);
3541
- let { longitude: u, latitude: p, offset: m, style: h, draggable: ee = !1, popup: te = null, rotation: g = 0, rotationAlignment: ne = "auto", pitchAlignment: re = "auto" } = e;
3542
- c(() => {
3543
- Z(o.getElement(), h);
3544
- }, [h]), l(t, () => o, []);
3545
- let ie = a.current.props;
3546
- (o.getLngLat().lng !== u || o.getLngLat().lat !== p) && o.setLngLat([u, p]), m && !ao(o.getOffset(), m) && o.setOffset(m), o.isDraggable() !== ee && o.setDraggable(ee), o.getRotation() !== g && o.setRotation(g), o.getRotationAlignment() !== ne && o.setRotationAlignment(ne), o.getPitchAlignment() !== re && o.setPitchAlignment(re), o.getPopup() !== te && o.setPopup(te);
3547
- let ae = Oo(ie.className, e.className);
3548
- if (ae) for (let e of ae) o.toggleClassName(e);
3549
- return a.current.props = e, _(e.children, o.getElement());
3550
- })), jo = a(i((e, t) => {
3551
- let { map: n, mapLib: r } = s(wo), i = d(() => document.createElement("div"), []), a = f({ props: e }), o = d(() => {
3552
- let t = { ...e }, n = new r.Popup(t);
3553
- return n.setLngLat([e.longitude, e.latitude]), n.once("open", (e) => {
3554
- a.current.props.onOpen?.(e);
3555
- }), n;
3556
- }, []);
3557
- if (c(() => {
3558
- let e = (e) => {
3559
- a.current.props.onClose?.(e);
3560
- };
3561
- return o.on("close", e), o.setDOMContent(i).addTo(n.getMap()), () => {
3562
- o.off("close", e), o.isOpen() && o.remove();
3563
- };
3564
- }, []), c(() => {
3565
- Z(o.getElement(), e.style);
3566
- }, [e.style]), l(t, () => o, []), o.isOpen()) {
3567
- let t = a.current.props;
3568
- (o.getLngLat().lng !== e.longitude || o.getLngLat().lat !== e.latitude) && o.setLngLat([e.longitude, e.latitude]), e.offset && !X(t.offset, e.offset) && o.setOffset(e.offset), (t.anchor !== e.anchor || t.maxWidth !== e.maxWidth) && (o.options.anchor = e.anchor, o.setMaxWidth(e.maxWidth));
3569
- let n = Oo(t.className, e.className);
3570
- if (n) for (let e of n) o.toggleClassName(e);
3571
- a.current.props = e;
3572
- }
3573
- return _(e.children, i);
3574
- }));
3575
- //#endregion
3576
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/use-control.js
3577
- function Q(e, t, n, r) {
3578
- let i = s(wo), a = d(() => e(i), []);
3579
- return c(() => {
3580
- let e = r || n || t, o = typeof t == "function" && typeof n == "function" ? t : null, s = typeof n == "function" ? n : typeof t == "function" ? t : null, { map: c } = i;
3581
- return c.hasControl(a) || (c.addControl(a, e?.position), o && o(i)), () => {
3582
- s && s(i), c.hasControl(a) && c.removeControl(a);
3583
- };
3584
- }, []), a;
3585
- }
3586
- //#endregion
3587
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/attribution-control.js
3588
- function Mo(e) {
3589
- let t = Q(({ mapLib: t }) => new t.AttributionControl(e), { position: e.position });
3590
- return c(() => {
3591
- Z(t._container, e.style);
3592
- }, [e.style]), null;
3593
- }
3594
- a(Mo);
3595
- //#endregion
3596
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/fullscreen-control.js
3597
- function No(e) {
3598
- let t = Q(({ mapLib: t }) => new t.FullscreenControl({ container: e.containerId && document.getElementById(e.containerId) }), { position: e.position });
3599
- return c(() => {
3600
- Z(t._controlContainer, e.style);
3601
- }, [e.style]), null;
3602
- }
3603
- a(No);
3604
- //#endregion
3605
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/geolocate-control.js
3606
- function Po(e, t) {
3607
- let n = f({ props: e }), r = Q(({ mapLib: t }) => {
3608
- let r = new t.GeolocateControl(e), i = r._setupUI;
3609
- return r._setupUI = () => {
3610
- r._container.hasChildNodes() || i();
3611
- }, r.on("geolocate", (e) => {
3612
- n.current.props.onGeolocate?.(e);
3613
- }), r.on("error", (e) => {
3614
- n.current.props.onError?.(e);
3615
- }), r.on("outofmaxbounds", (e) => {
3616
- n.current.props.onOutOfMaxBounds?.(e);
3617
- }), r.on("trackuserlocationstart", (e) => {
3618
- n.current.props.onTrackUserLocationStart?.(e);
3619
- }), r.on("trackuserlocationend", (e) => {
3620
- n.current.props.onTrackUserLocationEnd?.(e);
3621
- }), r;
3622
- }, { position: e.position });
3623
- return n.current.props = e, l(t, () => r, []), c(() => {
3624
- Z(r._container, e.style);
3625
- }, [e.style]), null;
3626
- }
3627
- a(i(Po));
3628
- //#endregion
3629
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/navigation-control.js
3630
- function Fo(e) {
3631
- let t = Q(({ mapLib: t }) => new t.NavigationControl(e), { position: e.position });
3632
- return c(() => {
3633
- Z(t._container, e.style);
3634
- }, [e.style]), null;
3635
- }
3636
- var Io = a(Fo);
3637
- //#endregion
3638
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/scale-control.js
3639
- function Lo(e) {
3640
- let t = Q(({ mapLib: t }) => new t.ScaleControl(e), { position: e.position }), n = f(e), r = n.current;
3641
- n.current = e;
3642
- let { style: i } = e;
3643
- return e.maxWidth !== void 0 && e.maxWidth !== r.maxWidth && (t.options.maxWidth = e.maxWidth), e.unit !== void 0 && e.unit !== r.unit && t.setUnit(e.unit), c(() => {
3644
- Z(t._container, i);
3645
- }, [i]), null;
3646
- }
3647
- a(Lo);
3648
- //#endregion
3649
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/terrain-control.js
3650
- function Ro(e) {
3651
- let t = Q(({ mapLib: t }) => new t.TerrainControl(e), { position: e.position });
3652
- return c(() => {
3653
- Z(t._container, e.style);
3654
- }, [e.style]), null;
3655
- }
3656
- a(Ro);
3657
- //#endregion
3658
- //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.1_maplibre-gl@5.24.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@vis.gl/react-maplibre/dist/components/logo-control.js
3659
- function zo(e) {
3660
- let t = Q(({ mapLib: t }) => new t.LogoControl(e), { position: e.position });
3661
- return c(() => {
3662
- Z(t._container, e.style);
3663
- }, [e.style]), null;
3664
- }
3665
- a(zo);
3666
- //#endregion
3667
- //#region ../../node_modules/.pnpm/react@19.2.5/node_modules/react/cjs/react-jsx-runtime.production.js
3668
- var Bo = /* @__PURE__ */ n(((e) => {
3669
- var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
3670
- function r(e, n, r) {
3671
- var i = null;
3672
- if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
3673
- else r = n;
3674
- return n = r.ref, {
3675
- $$typeof: t,
3676
- type: e,
3677
- key: i,
3678
- ref: n === void 0 ? null : n,
3679
- props: r
3680
- };
3681
- }
3682
- e.Fragment = n, e.jsx = r, e.jsxs = r;
3683
- })), Vo = /* @__PURE__ */ n(((t) => {
3684
- process.env.NODE_ENV !== "production" && (function() {
3685
- function n(e) {
3686
- if (e == null) return null;
3687
- if (typeof e == "function") return e.$$typeof === se ? null : e.displayName || e.name || null;
3688
- if (typeof e == "string") return e;
3689
- switch (e) {
3690
- case g: return "Fragment";
3691
- case re: return "Profiler";
3692
- case ne: return "StrictMode";
3693
- case v: return "Suspense";
3694
- case y: return "SuspenseList";
3695
- case x: return "Activity";
3696
- }
3697
- if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
3698
- case te: return "Portal";
3699
- case _: return e.displayName || "Context";
3700
- case ie: return (e._context.displayName || "Context") + ".Consumer";
3701
- case ae:
3702
- var t = e.render;
3703
- return e = e.displayName, e ||= (e = t.displayName || t.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
3704
- case oe: return t = e.displayName || null, t === null ? n(e.type) || "Memo" : t;
3705
- case b:
3706
- t = e._payload, e = e._init;
3707
- try {
3708
- return n(e(t));
3709
- } catch {}
3710
- }
3711
- return null;
3712
- }
3713
- function r(e) {
3714
- return "" + e;
3715
- }
3716
- function i(e) {
3717
- try {
3718
- r(e);
3719
- var t = !1;
3720
- } catch {
3721
- t = !0;
3722
- }
3723
- if (t) {
3724
- t = console;
3725
- var n = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
3726
- return n.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), r(e);
3727
- }
3728
- }
3729
- function a(e) {
3730
- if (e === g) return "<>";
3731
- if (typeof e == "object" && e && e.$$typeof === b) return "<...>";
3732
- try {
3733
- var t = n(e);
3734
- return t ? "<" + t + ">" : "<...>";
3735
- } catch {
3736
- return "<...>";
3737
- }
3738
- }
3739
- function o() {
3740
- var e = S.A;
3741
- return e === null ? null : e.getOwner();
3742
- }
3743
- function s() {
3744
- return Error("react-stack-top-frame");
3745
- }
3746
- function c(e) {
3747
- if (C.call(e, "key")) {
3748
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
3749
- if (t && t.isReactWarning) return !1;
3750
- }
3751
- return e.key !== void 0;
3752
- }
3753
- function l(e, t) {
3754
- function n() {
3755
- T || (T = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
3756
- }
3757
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
3758
- get: n,
3759
- configurable: !0
3760
- });
3761
- }
3762
- function u() {
3763
- var e = n(this.type);
3764
- return E[e] || (E[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
3765
- }
3766
- function d(e, t, n, r, i, a) {
3767
- var o = n.ref;
3768
- return e = {
3769
- $$typeof: ee,
3770
- type: e,
3771
- key: t,
3772
- props: n,
3773
- _owner: r
3774
- }, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
3775
- enumerable: !1,
3776
- value: null
3777
- }) : Object.defineProperty(e, "ref", {
3778
- enumerable: !1,
3779
- get: u
3780
- }), e._store = {}, Object.defineProperty(e._store, "validated", {
3781
- configurable: !1,
3782
- enumerable: !1,
3783
- writable: !0,
3784
- value: 0
3785
- }), Object.defineProperty(e, "_debugInfo", {
3786
- configurable: !1,
3787
- enumerable: !1,
3788
- writable: !0,
3789
- value: null
3790
- }), Object.defineProperty(e, "_debugStack", {
3791
- configurable: !1,
3792
- enumerable: !1,
3793
- writable: !0,
3794
- value: i
3795
- }), Object.defineProperty(e, "_debugTask", {
3796
- configurable: !1,
3797
- enumerable: !1,
3798
- writable: !0,
3799
- value: a
3800
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
3801
- }
3802
- function f(e, t, r, a, s, u) {
3803
- var f = t.children;
3804
- if (f !== void 0) if (a) if (ce(f)) {
3805
- for (a = 0; a < f.length; a++) p(f[a]);
3806
- Object.freeze && Object.freeze(f);
3807
- } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
3808
- else p(f);
3809
- if (C.call(t, "key")) {
3810
- f = n(e);
3811
- var m = Object.keys(t).filter(function(e) {
3812
- return e !== "key";
3813
- });
3814
- a = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", k[f + a] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", a, f, m, f), k[f + a] = !0);
3815
- }
3816
- if (f = null, r !== void 0 && (i(r), f = "" + r), c(t) && (i(t.key), f = "" + t.key), "key" in t) for (var h in r = {}, t) h !== "key" && (r[h] = t[h]);
3817
- else r = t;
3818
- return f && l(r, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, r, o(), s, u);
3819
- }
3820
- function p(e) {
3821
- m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === b && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
3822
- }
3823
- function m(e) {
3824
- return typeof e == "object" && !!e && e.$$typeof === ee;
3825
- }
3826
- var h = e("react"), ee = Symbol.for("react.transitional.element"), te = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), ne = Symbol.for("react.strict_mode"), re = Symbol.for("react.profiler"), ie = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), ae = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), oe = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), x = Symbol.for("react.activity"), se = Symbol.for("react.client.reference"), S = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, C = Object.prototype.hasOwnProperty, ce = Array.isArray, w = console.createTask ? console.createTask : function() {
3827
- return null;
3828
- };
3829
- h = { react_stack_bottom_frame: function(e) {
3830
- return e();
3831
- } };
3832
- var T, E = {}, D = h.react_stack_bottom_frame.bind(h, s)(), O = w(a(s)), k = {};
3833
- t.Fragment = g, t.jsx = function(e, t, n) {
3834
- var r = 1e4 > S.recentlyCreatedOwnerStacks++;
3835
- return f(e, t, n, !1, r ? Error("react-stack-top-frame") : D, r ? w(a(e)) : O);
3836
- }, t.jsxs = function(e, t, n) {
3837
- var r = 1e4 > S.recentlyCreatedOwnerStacks++;
3838
- return f(e, t, n, !0, r ? Error("react-stack-top-frame") : D, r ? w(a(e)) : O);
3839
- };
3840
- })();
3841
- })), $ = (/* @__PURE__ */ n(((e, t) => {
3842
- process.env.NODE_ENV === "production" ? t.exports = Bo() : t.exports = Vo();
3843
- })))(), Ho = Ea({
3844
- latitudeField: Yi().optional(),
3845
- longitudeField: Yi().optional(),
3846
- locationField: Yi().optional(),
3847
- titleField: Yi().optional(),
3848
- descriptionField: Yi().optional(),
3849
- zoom: ga().optional(),
3850
- center: Ma([ga(), ga()]).optional()
3851
- });
3852
- function Uo(e) {
1
+ import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
+ import { ComponentRegistry as a, buildExpandFields as o, extractRecords as s } from "@object-ui/core";
3
+ import { useNavigationOverlay as ee, useSchemaContext as c } from "@object-ui/react";
4
+ import { NavigationOverlay as te, cn as l, useIsMobile as u } from "@object-ui/components";
5
+ import { z as d } from "zod";
6
+ import ne, { Marker as f, NavigationControl as re, Popup as p } from "react-map-gl/maplibre";
7
+ import "maplibre-gl/dist/maplibre-gl.css";
8
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
+ //#region src/ObjectMap.tsx
10
+ var g = d.object({
11
+ latitudeField: d.string().optional(),
12
+ longitudeField: d.string().optional(),
13
+ locationField: d.string().optional(),
14
+ titleField: d.string().optional(),
15
+ descriptionField: d.string().optional(),
16
+ zoom: d.number().optional(),
17
+ center: d.tuple([d.number(), d.number()]).optional()
18
+ });
19
+ function ie(e) {
3853
20
  return e.data ? e.data : e.staticData ? {
3854
21
  provider: "value",
3855
22
  items: e.staticData
@@ -3858,7 +25,7 @@ function Uo(e) {
3858
25
  object: e.objectName
3859
26
  } : null;
3860
27
  }
3861
- function Wo(e) {
28
+ function _(e) {
3862
29
  if (e) {
3863
30
  if (typeof e == "string") {
3864
31
  let t = e.split(" "), n = t[0], r = t[1]?.toLowerCase() === "desc" ? "desc" : "asc";
@@ -3867,7 +34,7 @@ function Wo(e) {
3867
34
  if (Array.isArray(e)) return e.reduce((e, t) => (t.field && t.order && (e[t.field] = t.order), e), {});
3868
35
  }
3869
36
  }
3870
- function Go(e) {
37
+ function v(e) {
3871
38
  if (e.locationField || e.latitudeField) return {
3872
39
  locationField: e.locationField,
3873
40
  latitudeField: e.latitudeField,
@@ -3879,7 +46,7 @@ function Go(e) {
3879
46
  };
3880
47
  let t = null;
3881
48
  if (e.filter && typeof e.filter == "object" && "map" in e.filter ? t = e.filter.map : e.map && (t = e.map), t) {
3882
- let e = Ho.safeParse(t);
49
+ let e = g.safeParse(t);
3883
50
  return e.success || console.warn("[ObjectMap] Invalid map configuration:", e.error.format()), t;
3884
51
  }
3885
52
  return {
@@ -3892,7 +59,7 @@ function Go(e) {
3892
59
  center: [0, 0]
3893
60
  };
3894
61
  }
3895
- function Ko(e, t) {
62
+ function y(e, t) {
3896
63
  if (t.latitudeField && t.longitudeField) {
3897
64
  let n = e[t.latitudeField], r = e[t.longitudeField];
3898
65
  if (typeof n == "number" && typeof r == "number") return [n, r];
@@ -3914,7 +81,7 @@ function Ko(e, t) {
3914
81
  }
3915
82
  return null;
3916
83
  }
3917
- function qo(e, t, n = 50) {
84
+ function ae(e, t, n = 50) {
3918
85
  if (e.length <= 1 || t >= 15) return e.map((e) => ({
3919
86
  id: e.id,
3920
87
  coordinates: e.coordinates,
@@ -3945,99 +112,99 @@ function qo(e, t, n = 50) {
3945
112
  }
3946
113
  }), a;
3947
114
  }
3948
- var Jo = ({ schema: e, dataSource: t, className: n, onMarkerClick: r, onRowClick: i, onEdit: a, onDelete: s, enableClustering: l, clusterRadius: u = 50, ...m }) => {
3949
- let [g, _] = p([]), [ae, v] = p(!0), [y, oe] = p(null), [b, x] = p(null), [se, S] = p(null), [C, ce] = p(""), w = ie(), T = f(null), [E, D] = p(null), [O, k] = p(null), [le, ue] = p(!1), de = o(() => {
115
+ var b = ({ schema: a, dataSource: c, className: d, onMarkerClick: g, onRowClick: b, onEdit: x, onDelete: S, enableClustering: C, clusterRadius: w = 50, ...T }) => {
116
+ let [E, D] = i([]), [oe, O] = i(!0), [k, A] = i(null), [j, M] = i(null), [N, P] = i(null), [F, se] = i(""), I = u(), L = r(null), [R, ce] = i(null), [z, B] = i(null), [V, H] = i(!1), U = e(() => {
3950
117
  if (typeof navigator > "u" || !navigator.geolocation) {
3951
- k("Geolocation is not available in this browser.");
118
+ B("Geolocation is not available in this browser.");
3952
119
  return;
3953
120
  }
3954
- ue(!0), k(null), navigator.geolocation.getCurrentPosition((e) => {
121
+ H(!0), B(null), navigator.geolocation.getCurrentPosition((e) => {
3955
122
  let { longitude: t, latitude: n } = e.coords;
3956
- D({
123
+ ce({
3957
124
  lng: t,
3958
125
  lat: n
3959
- }), ue(!1);
126
+ }), H(!1);
3960
127
  try {
3961
- T.current?.flyTo({
128
+ L.current?.flyTo({
3962
129
  center: [t, n],
3963
130
  zoom: 12,
3964
131
  duration: 800
3965
132
  });
3966
133
  } catch {}
3967
134
  }, (e) => {
3968
- ue(!1), k(e.message || "Unable to retrieve location.");
135
+ H(!1), B(e.message || "Unable to retrieve location.");
3969
136
  }, {
3970
137
  enableHighAccuracy: !1,
3971
138
  timeout: 8e3,
3972
139
  maximumAge: 6e4
3973
140
  });
3974
- }, []), A = Uo(e), j = d(() => A, [JSON.stringify(A)]), M = Go(e), N = j?.provider === "value";
3975
- c(() => {
141
+ }, []), W = ie(a), G = n(() => W, [JSON.stringify(W)]), K = v(a), q = G?.provider === "value";
142
+ t(() => {
3976
143
  (async () => {
3977
144
  try {
3978
- if (v(!0), m.data) {
3979
- let e = m.data;
145
+ if (O(!0), T.data) {
146
+ let e = T.data;
3980
147
  if (Array.isArray(e)) {
3981
- _(e), v(!1);
148
+ D(e), O(!1);
3982
149
  return;
3983
150
  }
3984
151
  }
3985
- if (e.data) {
3986
- let t = e.data;
3987
- if (Array.isArray(t)) {
3988
- _(t), v(!1);
152
+ if (a.data) {
153
+ let e = a.data;
154
+ if (Array.isArray(e)) {
155
+ D(e), O(!1);
3989
156
  return;
3990
157
  }
3991
158
  }
3992
- if (N && j?.provider === "value") {
3993
- _(j.items), v(!1);
159
+ if (q && G?.provider === "value") {
160
+ D(G.items), O(!1);
3994
161
  return;
3995
162
  }
3996
- if (!t || typeof t.find != "function") throw Error("DataSource required for object/api providers");
3997
- if (j?.provider === "object") {
3998
- let n = j.object, r = h(b?.fields);
3999
- _(ee(await t.find(n, {
4000
- $filter: e.filter,
4001
- $orderby: Wo(e.sort),
4002
- ...r.length > 0 ? { $expand: r } : {}
163
+ if (!c || typeof c.find != "function") throw Error("DataSource required for object/api providers");
164
+ if (G?.provider === "object") {
165
+ let e = G.object, t = o(j?.fields);
166
+ D(s(await c.find(e, {
167
+ $filter: a.filter,
168
+ $orderby: _(a.sort),
169
+ ...t.length > 0 ? { $expand: t } : {}
4003
170
  })));
4004
- } else j?.provider === "api" && (console.warn("API provider not yet implemented for ObjectMap"), _([]));
4005
- v(!1);
171
+ } else G?.provider === "api" && (console.warn("API provider not yet implemented for ObjectMap"), D([]));
172
+ O(!1);
4006
173
  } catch (e) {
4007
- oe(e), v(!1);
174
+ A(e), O(!1);
4008
175
  }
4009
176
  })();
4010
177
  }, [
4011
- j,
4012
- t,
4013
- N,
4014
- e.filter,
4015
- e.sort,
4016
- b
4017
- ]), c(() => {
4018
- !N && t && (async () => {
178
+ G,
179
+ c,
180
+ q,
181
+ a.filter,
182
+ a.sort,
183
+ j
184
+ ]), t(() => {
185
+ !q && c && (async () => {
4019
186
  try {
4020
- if (!t) return;
4021
- let n = j?.provider === "object" ? j.object : e.objectName;
4022
- if (!n) return;
4023
- x(await t.getObjectSchema(n));
187
+ if (!c) return;
188
+ let e = G?.provider === "object" ? G.object : a.objectName;
189
+ if (!e) return;
190
+ M(await c.getObjectSchema(e));
4024
191
  } catch (e) {
4025
192
  console.error("Failed to fetch object schema:", e);
4026
193
  }
4027
194
  })();
4028
195
  }, [
4029
- e.objectName,
4030
- t,
4031
- N,
4032
- j
196
+ a.objectName,
197
+ c,
198
+ q,
199
+ G
4033
200
  ]);
4034
- let { markers: P, invalidCount: F } = d(() => {
201
+ let { markers: J, invalidCount: Y } = n(() => {
4035
202
  let e = 0;
4036
203
  return {
4037
- markers: g.map((t, n) => {
4038
- let r = Ko(t, M);
204
+ markers: E.map((t, n) => {
205
+ let r = y(t, K);
4039
206
  if (!r) return e++, null;
4040
- let i = M.titleField ? t[M.titleField] : "Marker", a = M.descriptionField ? t[M.descriptionField] : void 0, [o, s] = r;
207
+ let i = K.titleField ? t[K.titleField] : "Marker", a = K.descriptionField ? t[K.descriptionField] : void 0, [o, s] = r;
4041
208
  return !isFinite(o) || !isFinite(s) || o < -90 || o > 90 || s < -180 || s > 180 ? (e++, null) : {
4042
209
  id: t.id || t._id || `marker-${n}`,
4043
210
  title: i,
@@ -4048,81 +215,81 @@ var Jo = ({ schema: e, dataSource: t, className: n, onMarkerClick: r, onRowClick
4048
215
  }).filter((e) => e !== null),
4049
216
  invalidCount: e
4050
217
  };
4051
- }, [g, M]), I = d(() => P.find((e) => e.id === se), [P, se]), [L, fe] = p(M.zoom || 3), pe = te({
4052
- navigation: e.navigation,
4053
- objectName: e.objectName,
4054
- onRowClick: i
4055
- }), R = d(() => {
4056
- if (!C.trim()) return P;
4057
- let e = C.toLowerCase();
4058
- return P.filter((t) => t.title?.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
4059
- }, [P, C]), me = d(() => l ?? (e.enableClustering || R.length > 100) ? qo(R, L, u) : R.map((e) => ({
218
+ }, [E, K]), X = n(() => J.find((e) => e.id === N), [J, N]), [Z, le] = i(K.zoom || 3), Q = ee({
219
+ navigation: a.navigation,
220
+ objectName: a.objectName,
221
+ onRowClick: b
222
+ }), $ = n(() => {
223
+ if (!F.trim()) return J;
224
+ let e = F.toLowerCase();
225
+ return J.filter((t) => t.title?.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
226
+ }, [J, F]), ue = n(() => C ?? (a.enableClustering || $.length > 100) ? ae($, Z, w) : $.map((e) => ({
4060
227
  id: e.id,
4061
228
  coordinates: e.coordinates,
4062
229
  markers: [e],
4063
230
  isCluster: !1
4064
231
  })), [
4065
- R,
4066
- L,
4067
- l,
4068
- u,
4069
- e
4070
- ]), he = d(() => {
4071
- if (!R.length) return {
4072
- longitude: M.center?.[1] || 0,
4073
- latitude: M.center?.[0] || 0,
4074
- zoom: M.zoom || 2
232
+ $,
233
+ Z,
234
+ C,
235
+ w,
236
+ a
237
+ ]), de = n(() => {
238
+ if (!$.length) return {
239
+ longitude: K.center?.[1] || 0,
240
+ latitude: K.center?.[0] || 0,
241
+ zoom: K.zoom || 2
4075
242
  };
4076
- let e = R.map((e) => e.coordinates[0]), t = R.map((e) => e.coordinates[1]), n = Math.min(...e), r = Math.max(...e), i = Math.min(...t), a = Math.max(...t);
243
+ let e = $.map((e) => e.coordinates[0]), t = $.map((e) => e.coordinates[1]), n = Math.min(...e), r = Math.max(...e), i = Math.min(...t), a = Math.max(...t);
4077
244
  return {
4078
245
  longitude: (n + r) / 2,
4079
246
  latitude: (i + a) / 2,
4080
- zoom: M.zoom || 3
247
+ zoom: K.zoom || 3
4081
248
  };
4082
- }, [R, M]);
4083
- return ae ? /* @__PURE__ */ (0, $.jsx)("div", {
4084
- className: re("min-w-0 overflow-hidden", n),
4085
- children: /* @__PURE__ */ (0, $.jsx)("div", {
249
+ }, [$, K]);
250
+ return oe ? /* @__PURE__ */ m("div", {
251
+ className: l("min-w-0 overflow-hidden", d),
252
+ children: /* @__PURE__ */ m("div", {
4086
253
  className: "flex items-center justify-center h-96 bg-muted rounded-lg border",
4087
- children: /* @__PURE__ */ (0, $.jsx)("div", {
254
+ children: /* @__PURE__ */ m("div", {
4088
255
  className: "text-muted-foreground",
4089
256
  children: "Loading map..."
4090
257
  })
4091
258
  })
4092
- }) : y ? /* @__PURE__ */ (0, $.jsx)("div", {
4093
- className: re("min-w-0 overflow-hidden", n),
4094
- children: /* @__PURE__ */ (0, $.jsx)("div", {
259
+ }) : k ? /* @__PURE__ */ m("div", {
260
+ className: l("min-w-0 overflow-hidden", d),
261
+ children: /* @__PURE__ */ m("div", {
4095
262
  className: "flex items-center justify-center h-96 bg-muted rounded-lg border",
4096
- children: /* @__PURE__ */ (0, $.jsxs)("div", {
263
+ children: /* @__PURE__ */ h("div", {
4097
264
  className: "text-destructive",
4098
- children: ["Error: ", y.message]
265
+ children: ["Error: ", k.message]
4099
266
  })
4100
267
  })
4101
- }) : /* @__PURE__ */ (0, $.jsxs)("div", {
4102
- className: re("min-w-0 overflow-hidden", n),
268
+ }) : /* @__PURE__ */ h("div", {
269
+ className: l("min-w-0 overflow-hidden", d),
4103
270
  children: [
4104
- F > 0 && /* @__PURE__ */ (0, $.jsx)("div", {
271
+ Y > 0 && /* @__PURE__ */ m("div", {
4105
272
  className: "mb-2 p-2 text-sm text-yellow-800 bg-yellow-50 border border-yellow-200 rounded",
4106
- children: `${F} record${F === 1 ? "" : "s"} with missing or invalid coordinates excluded from the map.`
273
+ children: `${Y} record${Y === 1 ? "" : "s"} with missing or invalid coordinates excluded from the map.`
4107
274
  }),
4108
- P.length > 0 && /* @__PURE__ */ (0, $.jsx)("div", {
275
+ J.length > 0 && /* @__PURE__ */ m("div", {
4109
276
  className: "mb-2",
4110
- children: /* @__PURE__ */ (0, $.jsx)("input", {
277
+ children: /* @__PURE__ */ m("input", {
4111
278
  type: "text",
4112
- value: C,
4113
- onChange: (e) => ce(e.target.value),
279
+ value: F,
280
+ onChange: (e) => se(e.target.value),
4114
281
  placeholder: "Search locations…",
4115
282
  className: "w-full px-3 py-2 text-sm border rounded-md bg-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
4116
283
  })
4117
284
  }),
4118
- /* @__PURE__ */ (0, $.jsxs)("div", {
285
+ /* @__PURE__ */ h("div", {
4119
286
  className: "relative border rounded-lg overflow-hidden bg-muted h-[300px] sm:h-[400px] md:h-[500px] lg:h-[600px] w-full",
4120
287
  children: [
4121
- /* @__PURE__ */ (0, $.jsxs)(Eo, {
288
+ /* @__PURE__ */ h(ne, {
4122
289
  ref: (e) => {
4123
- T.current = e;
290
+ L.current = e;
4124
291
  },
4125
- initialViewState: he,
292
+ initialViewState: de,
4126
293
  style: {
4127
294
  width: "100%",
4128
295
  height: "100%"
@@ -4131,51 +298,51 @@ var Jo = ({ schema: e, dataSource: t, className: n, onMarkerClick: r, onRowClick
4131
298
  touchZoomRotate: !0,
4132
299
  dragRotate: !0,
4133
300
  touchPitch: !0,
4134
- onZoom: (e) => fe(Math.round(e.viewState.zoom)),
301
+ onZoom: (e) => le(Math.round(e.viewState.zoom)),
4135
302
  children: [
4136
- /* @__PURE__ */ (0, $.jsx)(Io, {
303
+ /* @__PURE__ */ m(re, {
4137
304
  position: "top-right",
4138
305
  showCompass: !0,
4139
306
  showZoom: !0
4140
307
  }),
4141
- /* @__PURE__ */ (0, $.jsx)("button", {
308
+ /* @__PURE__ */ m("button", {
4142
309
  type: "button",
4143
- onClick: de,
4144
- disabled: le,
310
+ onClick: U,
311
+ disabled: V,
4145
312
  className: "absolute top-2 left-2 z-10 inline-flex items-center justify-center size-9 rounded-md bg-background/95 border shadow-sm hover:bg-background disabled:opacity-50",
4146
313
  "aria-label": "Show my location",
4147
314
  "data-testid": "map-geolocate",
4148
- children: /* @__PURE__ */ (0, $.jsx)("span", {
315
+ children: /* @__PURE__ */ m("span", {
4149
316
  "aria-hidden": "true",
4150
- children: le ? "⏳" : "🧭"
317
+ children: V ? "⏳" : "🧭"
4151
318
  })
4152
319
  }),
4153
- E && /* @__PURE__ */ (0, $.jsx)(Ao, {
4154
- longitude: E.lng,
4155
- latitude: E.lat,
320
+ R && /* @__PURE__ */ m(f, {
321
+ longitude: R.lng,
322
+ latitude: R.lat,
4156
323
  anchor: "center",
4157
- children: /* @__PURE__ */ (0, $.jsx)("div", {
324
+ children: /* @__PURE__ */ m("div", {
4158
325
  className: "size-3 rounded-full bg-blue-500 ring-4 ring-blue-500/30 shadow",
4159
326
  "aria-label": "Your location",
4160
327
  "data-testid": "map-user-location"
4161
328
  })
4162
329
  }),
4163
- me.map((e) => e.isCluster ? /* @__PURE__ */ (0, $.jsx)(Ao, {
330
+ ue.map((e) => e.isCluster ? /* @__PURE__ */ m(f, {
4164
331
  longitude: e.coordinates[0],
4165
332
  latitude: e.coordinates[1],
4166
333
  anchor: "center",
4167
334
  onClick: (t) => {
4168
335
  t.originalEvent.stopPropagation();
4169
336
  try {
4170
- let t = Math.min(20, Math.max(L + 2, 8));
4171
- T.current?.flyTo({
337
+ let t = Math.min(20, Math.max(Z + 2, 8));
338
+ L.current?.flyTo({
4172
339
  center: [e.coordinates[0], e.coordinates[1]],
4173
340
  zoom: t,
4174
341
  duration: 600
4175
342
  });
4176
343
  } catch {}
4177
344
  },
4178
- children: /* @__PURE__ */ (0, $.jsx)("div", {
345
+ children: /* @__PURE__ */ m("div", {
4179
346
  className: "flex items-center justify-center rounded-full bg-primary text-primary-foreground font-bold text-xs cursor-pointer hover:scale-110 transition-transform shadow-md",
4180
347
  style: {
4181
348
  width: Math.min(48, 24 + e.markers.length * 2),
@@ -4185,46 +352,46 @@ var Jo = ({ schema: e, dataSource: t, className: n, onMarkerClick: r, onRowClick
4185
352
  "data-testid": "map-cluster",
4186
353
  children: e.markers.length
4187
354
  })
4188
- }, e.id) : /* @__PURE__ */ (0, $.jsx)(Ao, {
355
+ }, e.id) : /* @__PURE__ */ m(f, {
4189
356
  longitude: e.coordinates[0],
4190
357
  latitude: e.coordinates[1],
4191
358
  anchor: "bottom",
4192
359
  onClick: (t) => {
4193
360
  t.originalEvent.stopPropagation();
4194
361
  let n = e.markers[0];
4195
- S(n.id), pe.handleClick(n.data), r?.(n.data);
362
+ P(n.id), Q.handleClick(n.data), g?.(n.data);
4196
363
  },
4197
- children: /* @__PURE__ */ (0, $.jsx)("div", {
364
+ children: /* @__PURE__ */ m("div", {
4198
365
  className: "text-2xl cursor-pointer hover:scale-110 transition-transform",
4199
366
  children: "📍"
4200
367
  })
4201
368
  }, e.id)),
4202
- I && !w && /* @__PURE__ */ (0, $.jsx)(jo, {
4203
- longitude: I.coordinates[0],
4204
- latitude: I.coordinates[1],
369
+ X && !I && /* @__PURE__ */ m(p, {
370
+ longitude: X.coordinates[0],
371
+ latitude: X.coordinates[1],
4205
372
  anchor: "top",
4206
- onClose: () => S(null),
373
+ onClose: () => P(null),
4207
374
  closeOnClick: !1,
4208
- children: /* @__PURE__ */ (0, $.jsxs)("div", {
375
+ children: /* @__PURE__ */ h("div", {
4209
376
  className: "p-2 min-w-[150px] sm:min-w-[200px]",
4210
377
  children: [
4211
- /* @__PURE__ */ (0, $.jsx)("h3", {
378
+ /* @__PURE__ */ m("h3", {
4212
379
  className: "font-bold text-sm mb-1",
4213
- children: I.title
380
+ children: X.title
4214
381
  }),
4215
- I.description && /* @__PURE__ */ (0, $.jsx)("p", {
382
+ X.description && /* @__PURE__ */ m("p", {
4216
383
  className: "text-xs text-muted-foreground",
4217
- children: I.description
384
+ children: X.description
4218
385
  }),
4219
- /* @__PURE__ */ (0, $.jsxs)("div", {
386
+ /* @__PURE__ */ h("div", {
4220
387
  className: "mt-2 text-xs flex gap-2",
4221
- children: [a && /* @__PURE__ */ (0, $.jsx)("button", {
388
+ children: [x && /* @__PURE__ */ m("button", {
4222
389
  className: "text-blue-500 hover:underline",
4223
- onClick: () => a(I.data),
390
+ onClick: () => x(X.data),
4224
391
  children: "Edit"
4225
- }), s && /* @__PURE__ */ (0, $.jsx)("button", {
392
+ }), S && /* @__PURE__ */ m("button", {
4226
393
  className: "text-red-500 hover:underline",
4227
- onClick: () => s(I.data),
394
+ onClick: () => S(X.data),
4228
395
  children: "Delete"
4229
396
  })]
4230
397
  })
@@ -4233,67 +400,67 @@ var Jo = ({ schema: e, dataSource: t, className: n, onMarkerClick: r, onRowClick
4233
400
  })
4234
401
  ]
4235
402
  }),
4236
- I && w && /* @__PURE__ */ (0, $.jsxs)("div", {
403
+ X && I && /* @__PURE__ */ h("div", {
4237
404
  className: "absolute inset-x-0 bottom-0 z-30 bg-background border-t shadow-lg rounded-t-2xl p-4 pb-[max(env(safe-area-inset-bottom),1rem)]",
4238
405
  role: "dialog",
4239
406
  "aria-label": "Location details",
4240
407
  "data-testid": "map-mobile-record-sheet",
4241
408
  children: [
4242
- /* @__PURE__ */ (0, $.jsx)("div", {
409
+ /* @__PURE__ */ m("div", {
4243
410
  className: "mx-auto mb-2 h-1 w-10 rounded-full bg-muted",
4244
411
  "aria-hidden": "true"
4245
412
  }),
4246
- /* @__PURE__ */ (0, $.jsxs)("div", {
413
+ /* @__PURE__ */ h("div", {
4247
414
  className: "flex items-start justify-between gap-3",
4248
- children: [/* @__PURE__ */ (0, $.jsxs)("div", {
415
+ children: [/* @__PURE__ */ h("div", {
4249
416
  className: "min-w-0 flex-1",
4250
- children: [/* @__PURE__ */ (0, $.jsx)("h3", {
417
+ children: [/* @__PURE__ */ m("h3", {
4251
418
  className: "text-sm font-semibold truncate",
4252
- children: I.title
4253
- }), I.description && /* @__PURE__ */ (0, $.jsx)("p", {
419
+ children: X.title
420
+ }), X.description && /* @__PURE__ */ m("p", {
4254
421
  className: "mt-1 text-xs text-muted-foreground line-clamp-3",
4255
- children: I.description
422
+ children: X.description
4256
423
  })]
4257
- }), /* @__PURE__ */ (0, $.jsx)("button", {
424
+ }), /* @__PURE__ */ m("button", {
4258
425
  type: "button",
4259
- onClick: () => S(null),
426
+ onClick: () => P(null),
4260
427
  className: "text-muted-foreground hover:text-foreground text-lg leading-none px-2",
4261
428
  "aria-label": "Close details",
4262
429
  "data-testid": "map-mobile-record-close",
4263
430
  children: "×"
4264
431
  })]
4265
432
  }),
4266
- /* @__PURE__ */ (0, $.jsxs)("div", {
433
+ /* @__PURE__ */ h("div", {
4267
434
  className: "mt-3 flex flex-wrap gap-2 text-xs",
4268
- children: [a && /* @__PURE__ */ (0, $.jsx)("button", {
435
+ children: [x && /* @__PURE__ */ m("button", {
4269
436
  className: "px-3 py-1.5 rounded-md border bg-card hover:bg-accent",
4270
- onClick: () => a(I.data),
437
+ onClick: () => x(X.data),
4271
438
  children: "Edit"
4272
- }), s && /* @__PURE__ */ (0, $.jsx)("button", {
439
+ }), S && /* @__PURE__ */ m("button", {
4273
440
  className: "px-3 py-1.5 rounded-md border border-destructive/30 text-destructive hover:bg-destructive/10",
4274
- onClick: () => s(I.data),
441
+ onClick: () => S(X.data),
4275
442
  children: "Delete"
4276
443
  })]
4277
444
  })
4278
445
  ]
4279
446
  }),
4280
- O && /* @__PURE__ */ (0, $.jsx)("div", {
447
+ z && /* @__PURE__ */ m("div", {
4281
448
  className: "absolute top-2 left-14 right-2 z-10 text-xs px-3 py-1.5 rounded-md bg-destructive/10 text-destructive border border-destructive/30",
4282
- children: O
449
+ children: z
4283
450
  })
4284
451
  ]
4285
452
  }),
4286
- pe.isOverlay && /* @__PURE__ */ (0, $.jsx)(ne, {
4287
- ...pe,
453
+ Q.isOverlay && /* @__PURE__ */ m(te, {
454
+ ...Q,
4288
455
  title: "Location Details",
4289
- children: (e) => /* @__PURE__ */ (0, $.jsx)("div", {
456
+ children: (e) => /* @__PURE__ */ m("div", {
4290
457
  className: "space-y-3",
4291
- children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ (0, $.jsxs)("div", {
458
+ children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ h("div", {
4292
459
  className: "flex flex-col",
4293
- children: [/* @__PURE__ */ (0, $.jsx)("span", {
460
+ children: [/* @__PURE__ */ m("span", {
4294
461
  className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
4295
462
  children: e.replace(/_/g, " ")
4296
- }), /* @__PURE__ */ (0, $.jsx)("span", {
463
+ }), /* @__PURE__ */ m("span", {
4297
464
  className: "text-sm",
4298
465
  children: String(t ?? "—")
4299
466
  })]
@@ -4302,15 +469,15 @@ var Jo = ({ schema: e, dataSource: t, className: n, onMarkerClick: r, onRowClick
4302
469
  })
4303
470
  ]
4304
471
  });
4305
- }, Yo = ({ schema: e, ...t }) => {
4306
- let { dataSource: n } = g() || {};
4307
- return /* @__PURE__ */ (0, $.jsx)(Jo, {
472
+ }, x = ({ schema: e, ...t }) => {
473
+ let { dataSource: n } = c() || {};
474
+ return /* @__PURE__ */ m(b, {
4308
475
  schema: e,
4309
476
  dataSource: n,
4310
477
  ...t
4311
478
  });
4312
479
  };
4313
- console.log("Registering object-map..."), m.register("object-map", Yo, {
480
+ console.log("Registering object-map..."), a.register("object-map", x, {
4314
481
  namespace: "plugin-map",
4315
482
  label: "Object Map",
4316
483
  category: "view",
@@ -4325,7 +492,7 @@ console.log("Registering object-map..."), m.register("object-map", Yo, {
4325
492
  label: "Map Config",
4326
493
  description: "latitudeField, longitudeField, titleField"
4327
494
  }]
4328
- }), m.register("map", Yo, {
495
+ }), a.register("map", x, {
4329
496
  namespace: "view",
4330
497
  label: "Map View",
4331
498
  category: "view",
@@ -4342,4 +509,4 @@ console.log("Registering object-map..."), m.register("object-map", Yo, {
4342
509
  }]
4343
510
  });
4344
511
  //#endregion
4345
- export { Jo as ObjectMap, Yo as ObjectMapRenderer };
512
+ export { b as ObjectMap, x as ObjectMapRenderer };