@golemui/gui-lit 1.0.3 → 1.1.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/{button.element-3a7rRHbA.js → button.element-CJay43iR.js} +16 -13
- package/calendar-D31xNsxx.js +267 -0
- package/{range-calendar.element-_1bHW_c1.js → calendar.element-BhFrCsns.js} +16 -16
- package/{checkbox.element-CVskoXEc.js → checkbox.element-DAAVB651.js} +49 -49
- package/{currency.element-5GSakkxF.js → currency.element-D8A2ObpM.js} +15 -11
- package/{date-CDUlLuYy.js → date-DBuYpvcO.js} +88 -29
- package/date-input-DLiMreSS.js +204 -0
- package/date-picker.element-DeUQtbLg.js +357 -0
- package/date-time-calendar-DzU-FtVl.js +374 -0
- package/date-time-calendar.element-BLBcVsFu.js +95 -0
- package/date-time-input-DZaz2heD.js +246 -0
- package/date-time-picker.element-BUbLdV6i.js +440 -0
- package/date-time.element-B5onfSBG.js +93 -0
- package/{date.element-BZO0UQez.js → date.element-BsKhLrEc.js} +27 -19
- package/day-status-CsWStVQV.js +554 -0
- package/{dropdown.element-CyJbVAA5.js → dropdown.element-CXpMwJsU.js} +53 -37
- package/{errors-QjKhr6mA.js → errors-Byb2dIhK.js} +3 -2
- package/focus-leave.controller-2gV0pQd5.js +73 -0
- package/index.js +1635 -948
- package/index.umd.cjs +2046 -601
- package/lib/components/date-picker.element.d.ts +0 -11
- package/lib/components/date-time-calendar.element.d.ts +18 -0
- package/lib/components/date-time-picker.element.d.ts +18 -0
- package/lib/components/date-time.element.d.ts +18 -0
- package/lib/components/dropdown.element.d.ts +2 -0
- package/lib/components/range-calendar.element.d.ts +2 -1
- package/lib/components/range-date-picker.element.d.ts +0 -15
- package/lib/components/range-date-time-calendar.element.d.ts +18 -0
- package/lib/components/range-date-time-input.element.d.ts +18 -0
- package/lib/components/range-date-time-picker.element.d.ts +18 -0
- package/lib/components/range-time-input.element.d.ts +18 -0
- package/lib/components/range-time-picker.element.d.ts +18 -0
- package/lib/components/time-picker.element.d.ts +18 -0
- package/lib/components/time.element.d.ts +18 -0
- package/list-D730tmGN.js +297 -0
- package/{list.element-Co3V3Cn5.js → list.element-eo3DIOrp.js} +23 -23
- package/{markdown.element-p-kC47D7.js → markdown.element-FbtwdnAv.js} +310 -218
- package/{number.element-CBr47IiY.js → number.element-BEpOCzXy.js} +76 -61
- package/package.json +6 -6
- package/part-templates-VORbpgs2.js +691 -0
- package/{password.element-n-R9RbkB.js → password.element-CBaB8h5b.js} +19 -17
- package/pill-ranges-DpvWwP-3.js +48 -0
- package/{pills-B66qz_KX.js → pills-BDMO2NiR.js} +84 -59
- package/popup.controller-B33OvX_y.js +86 -0
- package/{radiogroup.element-CeQn623u.js → radiogroup.element-KWzBx8mx.js} +55 -51
- package/range-calendar-DO_woqcF.js +466 -0
- package/{calendar.element-DcnTyvfg.js → range-calendar.element-DHLZhpnj.js} +37 -29
- package/range-commit-8-MmYUyo.js +14 -0
- package/range-date-input-Br7XqQPK.js +311 -0
- package/{range-date-input.element-BqzAF0O3.js → range-date-input.element-BdD4SlB4.js} +12 -8
- package/range-date-picker.element-DWRHiAoC.js +434 -0
- package/range-date-time-calendar-B3EMgN1E.js +734 -0
- package/range-date-time-calendar.element-Coea6RF4.js +97 -0
- package/range-date-time-input-Cu-T_nuC.js +353 -0
- package/range-date-time-input.element-Cti44iuW.js +87 -0
- package/range-date-time-picker.element-CDN2RL1y.js +472 -0
- package/range-selection-CU3hxLJE.js +25 -0
- package/range-time-input-BP9ZL9O8.js +348 -0
- package/range-time-input.element-B7wtHJoQ.js +84 -0
- package/range-time-picker.element-CPIAiQPC.js +470 -0
- package/{repeater.element-CtNgB4F5.js → repeater.element-BM1Keckd.js} +1 -1
- package/{select.element-jcDF1h-g.js → select.element-eepcXTpL.js} +117 -107
- package/{tabs.element-BvAyI71N.js → tabs.element-CvcIA8P3.js} +1 -0
- package/{tags.element-CX3vQL8L.js → tags.element-CPHgotb0.js} +21 -14
- package/templates-Dmr34nwp.js +88 -0
- package/{textarea.element-HThYqdR_.js → textarea.element-CiNEy9uq.js} +8 -7
- package/{textinput.element-CkXNzMUg.js → textinput.element-AL2Nr768.js} +10 -9
- package/time-input-5dkSm8UW.js +201 -0
- package/time-list-DLcq8BAp.js +217 -0
- package/time-picker-g337F8d0.js +299 -0
- package/time-picker.element-DLihegjg.js +89 -0
- package/time.element-BneqgMlQ.js +85 -0
- package/{toggle.element-C1kCw5H8.js → toggle.element-Cz91CRdp.js} +44 -43
- package/abstract-calendar-D0-077XJ.js +0 -545
- package/calendar-BclCC9VJ.js +0 -96
- package/date-input-DCdGWRio.js +0 -268
- package/date-picker.element-k7AJFQ5W.js +0 -168
- package/list-D1oKnH89.js +0 -283
- package/range-calendar-CBINu84w.js +0 -255
- package/range-date-input-BYXzqnr1.js +0 -395
- package/range-date-picker.element-BCBefgvY.js +0 -182
- package/templates-Dk1jxLwS.js +0 -75
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { filterTap as
|
|
1
|
+
import { filterTap as Zt, standardValidate as He, isStandardValidateSuccess as Qe } from "@golemui/core";
|
|
2
2
|
import "@golemui/gui-shared";
|
|
3
3
|
import "@golemui/lit";
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { property as
|
|
6
|
-
const
|
|
4
|
+
import { LitElement as Dt, html as Lt } from "lit";
|
|
5
|
+
import { property as be, query as Mt, customElement as Rt } from "lit/decorators.js";
|
|
6
|
+
const et = {
|
|
7
7
|
LAYOUTS: "LAYOUTS",
|
|
8
8
|
DISPLAYS: "DISPLAYS"
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function Wt(e) {
|
|
11
11
|
return function(t, n = () => !0) {
|
|
12
12
|
return {
|
|
13
13
|
kind: "leaf",
|
|
@@ -17,41 +17,41 @@ function Pt(e) {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function v(e, t) {
|
|
21
21
|
return typeof e == "function" ? e : { type: t, ...e ?? {} };
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const jt = (e, t) => ({
|
|
24
24
|
type: "ITEMS",
|
|
25
|
-
itemType:
|
|
25
|
+
itemType: et.DISPLAYS,
|
|
26
26
|
items: [{ render: e }],
|
|
27
27
|
tags: t ?? []
|
|
28
|
-
}),
|
|
29
|
-
function
|
|
30
|
-
if (
|
|
28
|
+
}), X = /* @__PURE__ */ new Map(), Ft = /* @__PURE__ */ new Map();
|
|
29
|
+
function tt(e, t, n) {
|
|
30
|
+
if (X.has(e))
|
|
31
31
|
throw new Error(`Item type "${e}" is already registered.`);
|
|
32
|
-
|
|
32
|
+
X.set(e, t), n && Ft.set(e, n);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const t =
|
|
34
|
+
function Q(e) {
|
|
35
|
+
const t = X.get(e);
|
|
36
36
|
if (!t)
|
|
37
37
|
throw new Error(
|
|
38
38
|
`No handler registered for item type "${e}". Did you forget to import the registration module?`
|
|
39
39
|
);
|
|
40
40
|
return t;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
42
|
+
function nt(e) {
|
|
43
|
+
return X.has(e);
|
|
44
44
|
}
|
|
45
45
|
function h(e) {
|
|
46
46
|
const t = (a) => {
|
|
47
47
|
if (!e.sensibleDefaults)
|
|
48
48
|
return {};
|
|
49
49
|
let u = { ...e.sensibleDefaults.base };
|
|
50
|
-
for (const
|
|
51
|
-
const p =
|
|
50
|
+
for (const l of a) {
|
|
51
|
+
const p = l.config;
|
|
52
52
|
for (const d of e.sensibleDefaults.fields) {
|
|
53
|
-
const
|
|
54
|
-
p[
|
|
53
|
+
const m = d;
|
|
54
|
+
p[m] != null && (u = { ...u, [m]: p[m] });
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
return u;
|
|
@@ -77,11 +77,11 @@ function h(e) {
|
|
|
77
77
|
...e.buildCustomWidget ? { buildCustomWidget: e.buildCustomWidget } : {},
|
|
78
78
|
...e.getChildren ? { getChildren: e.getChildren } : {}
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
const s =
|
|
82
|
-
return { gsl: s, gslByUid: (a, u) => s(u, ((
|
|
80
|
+
tt(e.itemType, o, e.kind);
|
|
81
|
+
const s = Wt(e.itemType);
|
|
82
|
+
return { gsl: s, gslByUid: (a, u) => s(u, ((l) => l.uid === a)) };
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function b(e) {
|
|
85
85
|
const {
|
|
86
86
|
uid: t,
|
|
87
87
|
path: n,
|
|
@@ -91,42 +91,42 @@ function y(e) {
|
|
|
91
91
|
defaultValue: i,
|
|
92
92
|
tags: a,
|
|
93
93
|
type: u,
|
|
94
|
-
size:
|
|
94
|
+
size: l,
|
|
95
95
|
onLoad: p,
|
|
96
96
|
onChange: d,
|
|
97
|
-
onFilter:
|
|
98
|
-
on:
|
|
97
|
+
onFilter: m,
|
|
98
|
+
on: y,
|
|
99
99
|
states: P,
|
|
100
|
-
include:
|
|
101
|
-
exclude:
|
|
102
|
-
validator:
|
|
103
|
-
...
|
|
100
|
+
include: S,
|
|
101
|
+
exclude: Ae,
|
|
102
|
+
validator: Ee,
|
|
103
|
+
...D
|
|
104
104
|
} = e;
|
|
105
|
-
return
|
|
105
|
+
return D;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Ut(e) {
|
|
108
108
|
return e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (t) => t.toUpperCase()) : "";
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label:
|
|
110
|
+
function g(e, t) {
|
|
111
|
+
return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label: Ut(e.path) };
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function I(e, t) {
|
|
114
114
|
return e.placeholder != null || t.suppressAutomaticPlaceholders || !e.path ? e : { ...e, placeholder: e.path };
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function xt(e) {
|
|
117
117
|
switch (e.type) {
|
|
118
118
|
case "text":
|
|
119
|
-
return
|
|
119
|
+
return Jt(e);
|
|
120
120
|
case "number":
|
|
121
|
-
return
|
|
121
|
+
return Bt(e);
|
|
122
122
|
case "boolean":
|
|
123
|
-
return
|
|
123
|
+
return Vt(e);
|
|
124
124
|
default:
|
|
125
125
|
throw new Error(`Unsupported field type "${e.type}"`);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const t =
|
|
128
|
+
function Vt(e) {
|
|
129
|
+
const t = b(e);
|
|
130
130
|
return {
|
|
131
131
|
uid: e.uid ?? "",
|
|
132
132
|
kind: "input",
|
|
@@ -135,12 +135,12 @@ function Dt(e) {
|
|
|
135
135
|
...e.label != null ? { label: e.label } : {},
|
|
136
136
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
137
137
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
138
|
-
...e.validator != null ? { validator:
|
|
138
|
+
...e.validator != null ? { validator: v(e.validator, "boolean") } : {},
|
|
139
139
|
props: t
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
const t =
|
|
142
|
+
function Jt(e) {
|
|
143
|
+
const t = b(e);
|
|
144
144
|
return {
|
|
145
145
|
uid: e.uid ?? "",
|
|
146
146
|
kind: "input",
|
|
@@ -153,11 +153,11 @@ function Mt(e) {
|
|
|
153
153
|
placeholder: t.placeholder ?? "",
|
|
154
154
|
...t
|
|
155
155
|
},
|
|
156
|
-
validator:
|
|
156
|
+
validator: v(e.validator, "string")
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const t =
|
|
159
|
+
function Bt(e) {
|
|
160
|
+
const t = b(e);
|
|
161
161
|
return {
|
|
162
162
|
uid: e.uid ?? "",
|
|
163
163
|
kind: "input",
|
|
@@ -170,11 +170,12 @@ function Nt(e) {
|
|
|
170
170
|
placeholder: t.placeholder ?? "",
|
|
171
171
|
...t
|
|
172
172
|
},
|
|
173
|
-
validator:
|
|
173
|
+
validator: v(e.validator, "number")
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
h({
|
|
177
177
|
itemType: "INPUTS",
|
|
178
|
+
kind: "input",
|
|
178
179
|
entryShape: "keyed",
|
|
179
180
|
sensibleDefaults: {
|
|
180
181
|
base: {
|
|
@@ -183,19 +184,20 @@ h({
|
|
|
183
184
|
},
|
|
184
185
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
185
186
|
apply: (e, t) => {
|
|
186
|
-
let n =
|
|
187
|
-
return n =
|
|
187
|
+
let n = g(e, t);
|
|
188
|
+
return n = I(n, t), n;
|
|
188
189
|
}
|
|
189
190
|
},
|
|
190
|
-
mapToWidget:
|
|
191
|
+
mapToWidget: xt
|
|
191
192
|
});
|
|
192
193
|
h({
|
|
193
194
|
itemType: "SELECT",
|
|
195
|
+
kind: "input",
|
|
194
196
|
entryShape: "keyed",
|
|
195
197
|
sensibleDefaults: {
|
|
196
198
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
197
199
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
198
|
-
apply: (e, t) =>
|
|
200
|
+
apply: (e, t) => I(g(e, t), t)
|
|
199
201
|
},
|
|
200
202
|
mapToWidget: (e) => ({
|
|
201
203
|
uid: e.uid ?? "",
|
|
@@ -206,11 +208,12 @@ h({
|
|
|
206
208
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
207
209
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
208
210
|
...e.validator != null ? { validator: e.validator } : {},
|
|
209
|
-
props:
|
|
211
|
+
props: b(e)
|
|
210
212
|
})
|
|
211
213
|
});
|
|
212
214
|
h({
|
|
213
215
|
itemType: "DROPDOWN",
|
|
216
|
+
kind: "input",
|
|
214
217
|
entryShape: "keyed",
|
|
215
218
|
sensibleDefaults: {
|
|
216
219
|
base: {
|
|
@@ -218,7 +221,7 @@ h({
|
|
|
218
221
|
suppressAutomaticPlaceholders: !1
|
|
219
222
|
},
|
|
220
223
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
221
|
-
apply: (e, t) =>
|
|
224
|
+
apply: (e, t) => I(g(e, t), t)
|
|
222
225
|
},
|
|
223
226
|
mapToWidget: (e) => ({
|
|
224
227
|
uid: e.uid ?? "",
|
|
@@ -229,16 +232,17 @@ h({
|
|
|
229
232
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
230
233
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
231
234
|
...e.validator != null ? { validator: e.validator } : {},
|
|
232
|
-
props:
|
|
235
|
+
props: b(e)
|
|
233
236
|
})
|
|
234
237
|
});
|
|
235
238
|
h({
|
|
236
239
|
itemType: "RADIOGROUP",
|
|
240
|
+
kind: "input",
|
|
237
241
|
entryShape: "keyed",
|
|
238
242
|
sensibleDefaults: {
|
|
239
243
|
base: { suppressAutomaticLabels: !1 },
|
|
240
244
|
fields: ["suppressAutomaticLabels"],
|
|
241
|
-
apply: (e, t) =>
|
|
245
|
+
apply: (e, t) => g(e, t)
|
|
242
246
|
},
|
|
243
247
|
mapToWidget: (e) => ({
|
|
244
248
|
uid: e.uid ?? "",
|
|
@@ -249,16 +253,17 @@ h({
|
|
|
249
253
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
250
254
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
251
255
|
...e.validator != null ? { validator: e.validator } : {},
|
|
252
|
-
props:
|
|
256
|
+
props: b(e)
|
|
253
257
|
})
|
|
254
258
|
});
|
|
255
259
|
h({
|
|
256
260
|
itemType: "CHECKBOX",
|
|
261
|
+
kind: "input",
|
|
257
262
|
entryShape: "keyed",
|
|
258
263
|
sensibleDefaults: {
|
|
259
264
|
base: { suppressAutomaticLabels: !1 },
|
|
260
265
|
fields: ["suppressAutomaticLabels"],
|
|
261
|
-
apply: (e, t) =>
|
|
266
|
+
apply: (e, t) => g(e, t)
|
|
262
267
|
},
|
|
263
268
|
mapToWidget: (e) => ({
|
|
264
269
|
uid: e.uid ?? "",
|
|
@@ -268,17 +273,18 @@ h({
|
|
|
268
273
|
...e.label != null ? { label: e.label } : {},
|
|
269
274
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
270
275
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
271
|
-
...e.validator != null ? { validator:
|
|
272
|
-
props:
|
|
276
|
+
...e.validator != null ? { validator: v(e.validator, "boolean") } : {},
|
|
277
|
+
props: b(e)
|
|
273
278
|
})
|
|
274
279
|
});
|
|
275
280
|
h({
|
|
276
281
|
itemType: "TEXTAREA",
|
|
282
|
+
kind: "input",
|
|
277
283
|
entryShape: "keyed",
|
|
278
284
|
sensibleDefaults: {
|
|
279
285
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
280
286
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
281
|
-
apply: (e, t) =>
|
|
287
|
+
apply: (e, t) => I(g(e, t), t)
|
|
282
288
|
},
|
|
283
289
|
mapToWidget: (e) => ({
|
|
284
290
|
uid: e.uid ?? "",
|
|
@@ -288,17 +294,18 @@ h({
|
|
|
288
294
|
...e.label != null ? { label: e.label } : {},
|
|
289
295
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
290
296
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
291
|
-
...e.validator != null ? { validator:
|
|
292
|
-
props:
|
|
297
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
298
|
+
props: b(e)
|
|
293
299
|
})
|
|
294
300
|
});
|
|
295
301
|
h({
|
|
296
302
|
itemType: "PASSWORD",
|
|
303
|
+
kind: "input",
|
|
297
304
|
entryShape: "keyed",
|
|
298
305
|
sensibleDefaults: {
|
|
299
306
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
300
307
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
301
|
-
apply: (e, t) =>
|
|
308
|
+
apply: (e, t) => I(g(e, t), t)
|
|
302
309
|
},
|
|
303
310
|
mapToWidget: (e) => ({
|
|
304
311
|
uid: e.uid ?? "",
|
|
@@ -308,17 +315,18 @@ h({
|
|
|
308
315
|
...e.label != null ? { label: e.label } : {},
|
|
309
316
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
310
317
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
311
|
-
...e.validator != null ? { validator:
|
|
312
|
-
props:
|
|
318
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
319
|
+
props: b(e)
|
|
313
320
|
})
|
|
314
321
|
});
|
|
315
322
|
h({
|
|
316
323
|
itemType: "CURRENCY",
|
|
324
|
+
kind: "input",
|
|
317
325
|
entryShape: "keyed",
|
|
318
326
|
sensibleDefaults: {
|
|
319
327
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
320
328
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
321
|
-
apply: (e, t) =>
|
|
329
|
+
apply: (e, t) => I(g(e, t), t)
|
|
322
330
|
},
|
|
323
331
|
mapToWidget: (e) => ({
|
|
324
332
|
uid: e.uid ?? "",
|
|
@@ -328,17 +336,18 @@ h({
|
|
|
328
336
|
...e.label != null ? { label: e.label } : {},
|
|
329
337
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
330
338
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
331
|
-
...e.validator != null ? { validator:
|
|
332
|
-
props:
|
|
339
|
+
...e.validator != null ? { validator: v(e.validator, "number") } : {},
|
|
340
|
+
props: b(e)
|
|
333
341
|
})
|
|
334
342
|
});
|
|
335
343
|
h({
|
|
336
344
|
itemType: "MARKDOWN",
|
|
345
|
+
kind: "input",
|
|
337
346
|
entryShape: "keyed",
|
|
338
347
|
sensibleDefaults: {
|
|
339
348
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
340
349
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
341
|
-
apply: (e, t) =>
|
|
350
|
+
apply: (e, t) => I(g(e, t), t)
|
|
342
351
|
},
|
|
343
352
|
mapToWidget: (e) => ({
|
|
344
353
|
uid: e.uid ?? "",
|
|
@@ -348,17 +357,18 @@ h({
|
|
|
348
357
|
...e.label != null ? { label: e.label } : {},
|
|
349
358
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
350
359
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
351
|
-
...e.validator != null ? { validator:
|
|
352
|
-
props:
|
|
360
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
361
|
+
props: b(e)
|
|
353
362
|
})
|
|
354
363
|
});
|
|
355
364
|
h({
|
|
356
365
|
itemType: "LIST",
|
|
366
|
+
kind: "input",
|
|
357
367
|
entryShape: "keyed",
|
|
358
368
|
sensibleDefaults: {
|
|
359
369
|
base: { suppressAutomaticLabels: !1 },
|
|
360
370
|
fields: ["suppressAutomaticLabels"],
|
|
361
|
-
apply: (e, t) =>
|
|
371
|
+
apply: (e, t) => g(e, t)
|
|
362
372
|
},
|
|
363
373
|
mapToWidget: (e) => ({
|
|
364
374
|
uid: e.uid ?? "",
|
|
@@ -369,16 +379,17 @@ h({
|
|
|
369
379
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
370
380
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
371
381
|
...e.validator != null ? { validator: e.validator } : {},
|
|
372
|
-
props:
|
|
382
|
+
props: b(e)
|
|
373
383
|
})
|
|
374
384
|
});
|
|
375
385
|
h({
|
|
376
386
|
itemType: "CALENDAR",
|
|
387
|
+
kind: "input",
|
|
377
388
|
entryShape: "bare",
|
|
378
389
|
sensibleDefaults: {
|
|
379
390
|
base: { suppressAutomaticLabels: !1 },
|
|
380
391
|
fields: ["suppressAutomaticLabels"],
|
|
381
|
-
apply: (e, t) =>
|
|
392
|
+
apply: (e, t) => g(e, t)
|
|
382
393
|
},
|
|
383
394
|
mapToWidget: (e) => ({
|
|
384
395
|
uid: e.uid ?? "",
|
|
@@ -388,17 +399,39 @@ h({
|
|
|
388
399
|
...e.label != null ? { label: e.label } : {},
|
|
389
400
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
390
401
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
391
|
-
...e.validator != null ? { validator:
|
|
392
|
-
props:
|
|
402
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
403
|
+
props: b(e)
|
|
404
|
+
})
|
|
405
|
+
});
|
|
406
|
+
h({
|
|
407
|
+
itemType: "DATE_TIME_CALENDAR",
|
|
408
|
+
kind: "input",
|
|
409
|
+
entryShape: "bare",
|
|
410
|
+
sensibleDefaults: {
|
|
411
|
+
base: { suppressAutomaticLabels: !1 },
|
|
412
|
+
fields: ["suppressAutomaticLabels"],
|
|
413
|
+
apply: (e, t) => g(e, t)
|
|
414
|
+
},
|
|
415
|
+
mapToWidget: (e) => ({
|
|
416
|
+
uid: e.uid ?? "",
|
|
417
|
+
kind: "input",
|
|
418
|
+
type: "dateTimeCalendar",
|
|
419
|
+
path: e.path ?? "",
|
|
420
|
+
...e.label != null ? { label: e.label } : {},
|
|
421
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
422
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
423
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
424
|
+
props: b(e)
|
|
393
425
|
})
|
|
394
426
|
});
|
|
395
427
|
h({
|
|
396
428
|
itemType: "DATE_INPUT",
|
|
429
|
+
kind: "input",
|
|
397
430
|
entryShape: "keyed",
|
|
398
431
|
sensibleDefaults: {
|
|
399
432
|
base: { suppressAutomaticLabels: !1 },
|
|
400
433
|
fields: ["suppressAutomaticLabels"],
|
|
401
|
-
apply: (e, t) =>
|
|
434
|
+
apply: (e, t) => g(e, t)
|
|
402
435
|
},
|
|
403
436
|
mapToWidget: (e) => ({
|
|
404
437
|
uid: e.uid ?? "",
|
|
@@ -408,12 +441,13 @@ h({
|
|
|
408
441
|
...e.label != null ? { label: e.label } : {},
|
|
409
442
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
410
443
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
411
|
-
...e.validator != null ? { validator:
|
|
412
|
-
props:
|
|
444
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
445
|
+
props: b(e)
|
|
413
446
|
})
|
|
414
447
|
});
|
|
415
448
|
h({
|
|
416
449
|
itemType: "DATE_PICKER",
|
|
450
|
+
kind: "input",
|
|
417
451
|
entryShape: "keyed",
|
|
418
452
|
sensibleDefaults: {
|
|
419
453
|
base: {
|
|
@@ -421,7 +455,7 @@ h({
|
|
|
421
455
|
suppressAutomaticPlaceholders: !1
|
|
422
456
|
},
|
|
423
457
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
424
|
-
apply: (e, t) =>
|
|
458
|
+
apply: (e, t) => I(g(e, t), t)
|
|
425
459
|
},
|
|
426
460
|
mapToWidget: (e) => ({
|
|
427
461
|
uid: e.uid ?? "",
|
|
@@ -431,17 +465,42 @@ h({
|
|
|
431
465
|
...e.label != null ? { label: e.label } : {},
|
|
432
466
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
433
467
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
434
|
-
...e.validator != null ? { validator:
|
|
435
|
-
props:
|
|
468
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
469
|
+
props: b(e)
|
|
470
|
+
})
|
|
471
|
+
});
|
|
472
|
+
h({
|
|
473
|
+
itemType: "DATE_TIME_PICKER",
|
|
474
|
+
kind: "input",
|
|
475
|
+
entryShape: "keyed",
|
|
476
|
+
sensibleDefaults: {
|
|
477
|
+
base: {
|
|
478
|
+
suppressAutomaticLabels: !1,
|
|
479
|
+
suppressAutomaticPlaceholders: !1
|
|
480
|
+
},
|
|
481
|
+
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
482
|
+
apply: (e, t) => I(g(e, t), t)
|
|
483
|
+
},
|
|
484
|
+
mapToWidget: (e) => ({
|
|
485
|
+
uid: e.uid ?? "",
|
|
486
|
+
kind: "input",
|
|
487
|
+
type: "dateTimePicker",
|
|
488
|
+
path: e.path ?? "",
|
|
489
|
+
...e.label != null ? { label: e.label } : {},
|
|
490
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
491
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
492
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
493
|
+
props: b(e)
|
|
436
494
|
})
|
|
437
495
|
});
|
|
438
496
|
h({
|
|
439
497
|
itemType: "RANGE_CALENDAR",
|
|
498
|
+
kind: "input",
|
|
440
499
|
entryShape: "keyed",
|
|
441
500
|
sensibleDefaults: {
|
|
442
501
|
base: { suppressAutomaticLabels: !1 },
|
|
443
502
|
fields: ["suppressAutomaticLabels"],
|
|
444
|
-
apply: (e, t) =>
|
|
503
|
+
apply: (e, t) => g(e, t)
|
|
445
504
|
},
|
|
446
505
|
mapToWidget: (e) => ({
|
|
447
506
|
uid: e.uid ?? "",
|
|
@@ -451,17 +510,18 @@ h({
|
|
|
451
510
|
...e.label != null ? { label: e.label } : {},
|
|
452
511
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
453
512
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
454
|
-
...e.validator != null ? { validator:
|
|
455
|
-
props:
|
|
513
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
514
|
+
props: b(e)
|
|
456
515
|
})
|
|
457
516
|
});
|
|
458
517
|
h({
|
|
459
518
|
itemType: "RANGE_DATE_INPUT",
|
|
519
|
+
kind: "input",
|
|
460
520
|
entryShape: "keyed",
|
|
461
521
|
sensibleDefaults: {
|
|
462
522
|
base: { suppressAutomaticLabels: !1 },
|
|
463
523
|
fields: ["suppressAutomaticLabels"],
|
|
464
|
-
apply: (e, t) =>
|
|
524
|
+
apply: (e, t) => g(e, t)
|
|
465
525
|
},
|
|
466
526
|
mapToWidget: (e) => ({
|
|
467
527
|
uid: e.uid ?? "",
|
|
@@ -471,12 +531,163 @@ h({
|
|
|
471
531
|
...e.label != null ? { label: e.label } : {},
|
|
472
532
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
473
533
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
474
|
-
...e.validator != null ? { validator:
|
|
475
|
-
props:
|
|
534
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
535
|
+
props: b(e)
|
|
536
|
+
})
|
|
537
|
+
});
|
|
538
|
+
h({
|
|
539
|
+
itemType: "RANGE_DATE_TIME_INPUT",
|
|
540
|
+
kind: "input",
|
|
541
|
+
entryShape: "keyed",
|
|
542
|
+
sensibleDefaults: {
|
|
543
|
+
base: { suppressAutomaticLabels: !1 },
|
|
544
|
+
fields: ["suppressAutomaticLabels"],
|
|
545
|
+
apply: (e, t) => g(e, t)
|
|
546
|
+
},
|
|
547
|
+
mapToWidget: (e) => ({
|
|
548
|
+
uid: e.uid ?? "",
|
|
549
|
+
kind: "input",
|
|
550
|
+
type: "rangeDateTimeInput",
|
|
551
|
+
path: e.path ?? "",
|
|
552
|
+
...e.label != null ? { label: e.label } : {},
|
|
553
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
554
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
555
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
556
|
+
props: b(e)
|
|
557
|
+
})
|
|
558
|
+
});
|
|
559
|
+
h({
|
|
560
|
+
itemType: "RANGE_DATE_TIME_CALENDAR",
|
|
561
|
+
kind: "input",
|
|
562
|
+
entryShape: "keyed",
|
|
563
|
+
sensibleDefaults: {
|
|
564
|
+
base: { suppressAutomaticLabels: !1 },
|
|
565
|
+
fields: ["suppressAutomaticLabels"],
|
|
566
|
+
apply: (e, t) => g(e, t)
|
|
567
|
+
},
|
|
568
|
+
mapToWidget: (e) => ({
|
|
569
|
+
uid: e.uid ?? "",
|
|
570
|
+
kind: "input",
|
|
571
|
+
type: "rangeDateTimeCalendar",
|
|
572
|
+
path: e.path ?? "",
|
|
573
|
+
...e.label != null ? { label: e.label } : {},
|
|
574
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
575
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
576
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
577
|
+
props: b(e)
|
|
578
|
+
})
|
|
579
|
+
});
|
|
580
|
+
h({
|
|
581
|
+
itemType: "RANGE_DATE_TIME_PICKER",
|
|
582
|
+
kind: "input",
|
|
583
|
+
entryShape: "keyed",
|
|
584
|
+
sensibleDefaults: {
|
|
585
|
+
base: { suppressAutomaticLabels: !1 },
|
|
586
|
+
fields: ["suppressAutomaticLabels"],
|
|
587
|
+
apply: (e, t) => g(e, t)
|
|
588
|
+
},
|
|
589
|
+
mapToWidget: (e) => ({
|
|
590
|
+
uid: e.uid ?? "",
|
|
591
|
+
kind: "input",
|
|
592
|
+
type: "rangeDateTimePicker",
|
|
593
|
+
path: e.path ?? "",
|
|
594
|
+
...e.label != null ? { label: e.label } : {},
|
|
595
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
596
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
597
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
598
|
+
props: b(e)
|
|
599
|
+
})
|
|
600
|
+
});
|
|
601
|
+
h({
|
|
602
|
+
itemType: "RANGE_TIME_INPUT",
|
|
603
|
+
kind: "input",
|
|
604
|
+
entryShape: "keyed",
|
|
605
|
+
sensibleDefaults: {
|
|
606
|
+
base: { suppressAutomaticLabels: !1 },
|
|
607
|
+
fields: ["suppressAutomaticLabels"],
|
|
608
|
+
apply: (e, t) => g(e, t)
|
|
609
|
+
},
|
|
610
|
+
mapToWidget: (e) => ({
|
|
611
|
+
uid: e.uid ?? "",
|
|
612
|
+
kind: "input",
|
|
613
|
+
type: "rangeTimeInput",
|
|
614
|
+
path: e.path ?? "",
|
|
615
|
+
...e.label != null ? { label: e.label } : {},
|
|
616
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
617
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
618
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
619
|
+
props: b(e)
|
|
620
|
+
})
|
|
621
|
+
});
|
|
622
|
+
h({
|
|
623
|
+
itemType: "TIME_INPUT",
|
|
624
|
+
kind: "input",
|
|
625
|
+
entryShape: "keyed",
|
|
626
|
+
sensibleDefaults: {
|
|
627
|
+
base: { suppressAutomaticLabels: !1 },
|
|
628
|
+
fields: ["suppressAutomaticLabels"],
|
|
629
|
+
apply: (e, t) => g(e, t)
|
|
630
|
+
},
|
|
631
|
+
mapToWidget: (e) => ({
|
|
632
|
+
uid: e.uid ?? "",
|
|
633
|
+
kind: "input",
|
|
634
|
+
type: "timeInput",
|
|
635
|
+
path: e.path ?? "",
|
|
636
|
+
...e.label != null ? { label: e.label } : {},
|
|
637
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
638
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
639
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
640
|
+
props: b(e)
|
|
641
|
+
})
|
|
642
|
+
});
|
|
643
|
+
h({
|
|
644
|
+
itemType: "TIME_PICKER",
|
|
645
|
+
kind: "input",
|
|
646
|
+
entryShape: "keyed",
|
|
647
|
+
sensibleDefaults: {
|
|
648
|
+
base: {
|
|
649
|
+
suppressAutomaticLabels: !1,
|
|
650
|
+
suppressAutomaticPlaceholders: !1
|
|
651
|
+
},
|
|
652
|
+
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
653
|
+
apply: (e, t) => I(g(e, t), t)
|
|
654
|
+
},
|
|
655
|
+
mapToWidget: (e) => ({
|
|
656
|
+
uid: e.uid ?? "",
|
|
657
|
+
kind: "input",
|
|
658
|
+
type: "timePicker",
|
|
659
|
+
path: e.path ?? "",
|
|
660
|
+
...e.label != null ? { label: e.label } : {},
|
|
661
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
662
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
663
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
664
|
+
props: b(e)
|
|
665
|
+
})
|
|
666
|
+
});
|
|
667
|
+
h({
|
|
668
|
+
itemType: "DATE_TIME_INPUT",
|
|
669
|
+
kind: "input",
|
|
670
|
+
entryShape: "keyed",
|
|
671
|
+
sensibleDefaults: {
|
|
672
|
+
base: { suppressAutomaticLabels: !1 },
|
|
673
|
+
fields: ["suppressAutomaticLabels"],
|
|
674
|
+
apply: (e, t) => g(e, t)
|
|
675
|
+
},
|
|
676
|
+
mapToWidget: (e) => ({
|
|
677
|
+
uid: e.uid ?? "",
|
|
678
|
+
kind: "input",
|
|
679
|
+
type: "dateTimeInput",
|
|
680
|
+
path: e.path ?? "",
|
|
681
|
+
...e.label != null ? { label: e.label } : {},
|
|
682
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
683
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
684
|
+
...e.validator != null ? { validator: v(e.validator, "string") } : {},
|
|
685
|
+
props: b(e)
|
|
476
686
|
})
|
|
477
687
|
});
|
|
478
688
|
h({
|
|
479
689
|
itemType: "RANGE_DATE_PICKER",
|
|
690
|
+
kind: "input",
|
|
480
691
|
entryShape: "keyed",
|
|
481
692
|
sensibleDefaults: {
|
|
482
693
|
base: {
|
|
@@ -484,7 +695,7 @@ h({
|
|
|
484
695
|
suppressAutomaticPlaceholders: !1
|
|
485
696
|
},
|
|
486
697
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
487
|
-
apply: (e, t) =>
|
|
698
|
+
apply: (e, t) => I(g(e, t), t)
|
|
488
699
|
},
|
|
489
700
|
mapToWidget: (e) => ({
|
|
490
701
|
uid: e.uid ?? "",
|
|
@@ -494,15 +705,36 @@ h({
|
|
|
494
705
|
...e.label != null ? { label: e.label } : {},
|
|
495
706
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
496
707
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
497
|
-
...e.validator != null ? { validator:
|
|
498
|
-
props:
|
|
708
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
709
|
+
props: b(e)
|
|
499
710
|
})
|
|
500
711
|
});
|
|
501
|
-
|
|
712
|
+
h({
|
|
713
|
+
itemType: "RANGE_TIME_PICKER",
|
|
714
|
+
kind: "input",
|
|
715
|
+
entryShape: "keyed",
|
|
716
|
+
sensibleDefaults: {
|
|
717
|
+
base: { suppressAutomaticLabels: !1 },
|
|
718
|
+
fields: ["suppressAutomaticLabels"],
|
|
719
|
+
apply: (e, t) => g(e, t)
|
|
720
|
+
},
|
|
721
|
+
mapToWidget: (e) => ({
|
|
722
|
+
uid: e.uid ?? "",
|
|
723
|
+
kind: "input",
|
|
724
|
+
type: "rangeTimePicker",
|
|
725
|
+
path: e.path ?? "",
|
|
726
|
+
...e.label != null ? { label: e.label } : {},
|
|
727
|
+
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
728
|
+
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
729
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
730
|
+
props: b(e)
|
|
731
|
+
})
|
|
732
|
+
});
|
|
733
|
+
function Gt(e) {
|
|
502
734
|
const t = {};
|
|
503
735
|
return e.addLabel != null && (t.addLabel = e.addLabel), e.removeLabel != null && (t.removeLabel = e.removeLabel), e.limit != null && (t.limit = e.limit), e.title != null && (t.title = e.title), e.addButtonIcon != null && (t.addButtonIcon = e.addButtonIcon), e.removeButtonIcon != null && (t.removeButtonIcon = e.removeButtonIcon), t;
|
|
504
736
|
}
|
|
505
|
-
function
|
|
737
|
+
function Yt(e) {
|
|
506
738
|
return {
|
|
507
739
|
uid: e.uid ?? "",
|
|
508
740
|
kind: "input",
|
|
@@ -511,25 +743,25 @@ function Rt(e) {
|
|
|
511
743
|
...e.label != null ? { label: e.label } : {},
|
|
512
744
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
513
745
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
514
|
-
...e.validator != null ? { validator:
|
|
746
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
515
747
|
props: {
|
|
516
|
-
...
|
|
748
|
+
...Gt(e),
|
|
517
749
|
template: { kind: "layout", type: "flex", children: [], props: { direction: "column" } }
|
|
518
750
|
}
|
|
519
751
|
};
|
|
520
752
|
}
|
|
521
|
-
function
|
|
753
|
+
function ce(e, t) {
|
|
522
754
|
for (const n of e) {
|
|
523
755
|
if (typeof n == "function") continue;
|
|
524
756
|
const r = n;
|
|
525
|
-
typeof r.path == "string" && r.path && !r.path.startsWith(t) && (r.path = t + r.path), "children" in r && Array.isArray(r.children) &&
|
|
757
|
+
typeof r.path == "string" && r.path && !r.path.startsWith(t) && (r.path = t + r.path), "children" in r && Array.isArray(r.children) && ce(r.children, t);
|
|
526
758
|
const o = r.props;
|
|
527
|
-
o?.template?.children && Array.isArray(o.template.children) &&
|
|
759
|
+
o?.template?.children && Array.isArray(o.template.children) && ce(o.template.children, t);
|
|
528
760
|
}
|
|
529
761
|
}
|
|
530
|
-
function
|
|
762
|
+
function Kt(e, t) {
|
|
531
763
|
const n = t.walkChildren(t.children ?? []), r = e.kind === "static" ? e.def.path ?? "" : e.fn({})?.path ?? "";
|
|
532
|
-
r &&
|
|
764
|
+
r && ce(n, r + ".items.");
|
|
533
765
|
const o = {
|
|
534
766
|
kind: "layout",
|
|
535
767
|
type: "flex",
|
|
@@ -553,32 +785,32 @@ function Ft(e, t) {
|
|
|
553
785
|
};
|
|
554
786
|
});
|
|
555
787
|
}
|
|
556
|
-
function
|
|
788
|
+
function qt(e) {
|
|
557
789
|
return {
|
|
558
790
|
baseDef: e.def,
|
|
559
791
|
path: e.key,
|
|
560
792
|
children: e.children
|
|
561
793
|
};
|
|
562
794
|
}
|
|
563
|
-
function
|
|
795
|
+
function Xt(e) {
|
|
564
796
|
return e.children;
|
|
565
797
|
}
|
|
566
|
-
const
|
|
567
|
-
parseEntry:
|
|
798
|
+
const Ht = {
|
|
799
|
+
parseEntry: qt,
|
|
568
800
|
rollUpSensibleDefaults: () => ({}),
|
|
569
801
|
applySensibleDefaults: (e) => e,
|
|
570
|
-
mapToWidget:
|
|
571
|
-
buildCustomWidget:
|
|
572
|
-
getChildren:
|
|
802
|
+
mapToWidget: Yt,
|
|
803
|
+
buildCustomWidget: Kt,
|
|
804
|
+
getChildren: Xt
|
|
573
805
|
};
|
|
574
|
-
|
|
575
|
-
const
|
|
806
|
+
tt("REPEATER", Ht, "input");
|
|
807
|
+
const rt = {
|
|
576
808
|
onLoad: "load",
|
|
577
809
|
onChange: "change",
|
|
578
810
|
onFilter: "filter",
|
|
579
811
|
onBlur: "blur"
|
|
580
|
-
},
|
|
581
|
-
function
|
|
812
|
+
}, Qt = Object.keys(rt);
|
|
813
|
+
function ot(e) {
|
|
582
814
|
if (e.length > 0)
|
|
583
815
|
return null;
|
|
584
816
|
try {
|
|
@@ -588,14 +820,14 @@ function Qe(e) {
|
|
|
588
820
|
return null;
|
|
589
821
|
}
|
|
590
822
|
}
|
|
591
|
-
class
|
|
823
|
+
class en {
|
|
592
824
|
// ── Action-specific: onClick ───────────────────────────────────
|
|
593
825
|
extractOnClickFromMergeResult(t, n, r) {
|
|
594
826
|
if (t.kind === "dynamic") {
|
|
595
827
|
const i = t.fn;
|
|
596
828
|
return { kind: "dynamic", fn: (u) => {
|
|
597
|
-
const
|
|
598
|
-
return this.wireOnClick(
|
|
829
|
+
const l = i(u);
|
|
830
|
+
return this.wireOnClick(l, n, r);
|
|
599
831
|
} };
|
|
600
832
|
}
|
|
601
833
|
const o = t.def;
|
|
@@ -605,7 +837,7 @@ class Bt {
|
|
|
605
837
|
const o = r.next(), s = t.onClick;
|
|
606
838
|
if (typeof s == "function") {
|
|
607
839
|
const { onClick: i, ...a } = t, u = s(void 0);
|
|
608
|
-
return typeof u == "string" ? { ...a, uid: o, on: { click: u } } : (n.set(o, (
|
|
840
|
+
return typeof u == "string" ? { ...a, uid: o, on: { click: u } } : (n.set(o, (l) => s(l.data)), { ...a, uid: o, on: { click: o } });
|
|
609
841
|
}
|
|
610
842
|
return { ...t, uid: o };
|
|
611
843
|
}
|
|
@@ -624,27 +856,27 @@ class Bt {
|
|
|
624
856
|
const o = { ...t.on || {} };
|
|
625
857
|
let s = !1;
|
|
626
858
|
const i = { ...t };
|
|
627
|
-
for (const a of
|
|
859
|
+
for (const a of Qt) {
|
|
628
860
|
const u = t[a];
|
|
629
861
|
if (u == null) continue;
|
|
630
|
-
const
|
|
862
|
+
const l = rt[a];
|
|
631
863
|
if (typeof u == "function") {
|
|
632
|
-
const p =
|
|
864
|
+
const p = ot(u);
|
|
633
865
|
if (p != null)
|
|
634
|
-
o[
|
|
866
|
+
o[l] = p;
|
|
635
867
|
else {
|
|
636
868
|
const d = r.next();
|
|
637
|
-
n.set(d, u), o[
|
|
869
|
+
n.set(d, u), o[l] = d;
|
|
638
870
|
}
|
|
639
871
|
s = !0;
|
|
640
|
-
} else typeof u == "string" && (o[
|
|
872
|
+
} else typeof u == "string" && (o[l] = u, s = !0);
|
|
641
873
|
delete i[a];
|
|
642
874
|
}
|
|
643
875
|
return s && (i.on = o), i;
|
|
644
876
|
}
|
|
645
877
|
}
|
|
646
|
-
const
|
|
647
|
-
function
|
|
878
|
+
const ge = new en();
|
|
879
|
+
function tn(e) {
|
|
648
880
|
const {
|
|
649
881
|
uid: t,
|
|
650
882
|
label: n,
|
|
@@ -654,11 +886,11 @@ function Yt(e) {
|
|
|
654
886
|
onClick: i,
|
|
655
887
|
data: a,
|
|
656
888
|
type: u,
|
|
657
|
-
tags:
|
|
889
|
+
tags: l,
|
|
658
890
|
size: p,
|
|
659
891
|
include: d,
|
|
660
|
-
exclude:
|
|
661
|
-
states:
|
|
892
|
+
exclude: m,
|
|
893
|
+
states: y,
|
|
662
894
|
...P
|
|
663
895
|
} = e;
|
|
664
896
|
return {
|
|
@@ -674,15 +906,16 @@ function Yt(e) {
|
|
|
674
906
|
}
|
|
675
907
|
h({
|
|
676
908
|
itemType: "ACTIONS",
|
|
909
|
+
kind: "action",
|
|
677
910
|
entryShape: "bare",
|
|
678
|
-
mapToWidget:
|
|
679
|
-
afterMerge: (e, t) =>
|
|
911
|
+
mapToWidget: tn,
|
|
912
|
+
afterMerge: (e, t) => ge.extractOnClickFromMergeResult(
|
|
680
913
|
e,
|
|
681
914
|
t.eventRegistry,
|
|
682
915
|
t.eventIdGenerator
|
|
683
916
|
)
|
|
684
917
|
});
|
|
685
|
-
function
|
|
918
|
+
function nn(e) {
|
|
686
919
|
const {
|
|
687
920
|
uid: t,
|
|
688
921
|
widgetName: n,
|
|
@@ -692,7 +925,7 @@ function Gt(e) {
|
|
|
692
925
|
include: i,
|
|
693
926
|
exclude: a,
|
|
694
927
|
...u
|
|
695
|
-
} = e, { on:
|
|
928
|
+
} = e, { on: l, ...p } = u;
|
|
696
929
|
return {
|
|
697
930
|
uid: t ?? "",
|
|
698
931
|
kind: "layout",
|
|
@@ -704,7 +937,7 @@ function Gt(e) {
|
|
|
704
937
|
children: []
|
|
705
938
|
};
|
|
706
939
|
}
|
|
707
|
-
function
|
|
940
|
+
function rn(e, t) {
|
|
708
941
|
const n = t.walkChildren(t.children ?? []);
|
|
709
942
|
if (e.kind === "static")
|
|
710
943
|
return { ...t.mapStaticDef(e.def, "LAYOUTS"), children: n };
|
|
@@ -714,17 +947,18 @@ function Kt(e, t) {
|
|
|
714
947
|
return { ...t.mapStaticDef(s, "LAYOUTS"), children: n };
|
|
715
948
|
});
|
|
716
949
|
}
|
|
717
|
-
function
|
|
950
|
+
function on(e) {
|
|
718
951
|
return e.children;
|
|
719
952
|
}
|
|
720
953
|
h({
|
|
721
954
|
itemType: "LAYOUTS",
|
|
955
|
+
kind: "layout",
|
|
722
956
|
entryShape: "compound",
|
|
723
|
-
mapToWidget:
|
|
724
|
-
buildCustomWidget:
|
|
725
|
-
getChildren:
|
|
957
|
+
mapToWidget: nn,
|
|
958
|
+
buildCustomWidget: rn,
|
|
959
|
+
getChildren: on
|
|
726
960
|
});
|
|
727
|
-
function
|
|
961
|
+
function pe(e) {
|
|
728
962
|
return {
|
|
729
963
|
errors: void 0,
|
|
730
964
|
touched: void 0,
|
|
@@ -733,7 +967,7 @@ function ue(e) {
|
|
|
733
967
|
$form: e?.$form ?? {}
|
|
734
968
|
};
|
|
735
969
|
}
|
|
736
|
-
function
|
|
970
|
+
function sn(e) {
|
|
737
971
|
return {
|
|
738
972
|
uid: "",
|
|
739
973
|
kind: "display",
|
|
@@ -741,7 +975,7 @@ function Xt(e) {
|
|
|
741
975
|
props: { render: e.render }
|
|
742
976
|
};
|
|
743
977
|
}
|
|
744
|
-
function
|
|
978
|
+
function an(e, t) {
|
|
745
979
|
if (e.kind === "static") {
|
|
746
980
|
const r = e.def;
|
|
747
981
|
return ((o) => ({
|
|
@@ -750,7 +984,7 @@ function Ht(e, t) {
|
|
|
750
984
|
type: "renderer",
|
|
751
985
|
...r.include != null ? { include: r.include } : {},
|
|
752
986
|
...r.exclude != null ? { exclude: r.exclude } : {},
|
|
753
|
-
props: { render: r.render(
|
|
987
|
+
props: { render: r.render(pe(o)) }
|
|
754
988
|
}));
|
|
755
989
|
}
|
|
756
990
|
const n = e.fn;
|
|
@@ -762,18 +996,20 @@ function Ht(e, t) {
|
|
|
762
996
|
type: "renderer",
|
|
763
997
|
...o.include != null ? { include: o.include } : {},
|
|
764
998
|
...o.exclude != null ? { exclude: o.exclude } : {},
|
|
765
|
-
props: { render: o.render(
|
|
999
|
+
props: { render: o.render(pe(r)) }
|
|
766
1000
|
};
|
|
767
1001
|
});
|
|
768
1002
|
}
|
|
769
1003
|
h({
|
|
770
1004
|
itemType: "DISPLAYS",
|
|
1005
|
+
kind: "display",
|
|
771
1006
|
entryShape: "bare",
|
|
772
|
-
mapToWidget:
|
|
773
|
-
buildCustomWidget:
|
|
1007
|
+
mapToWidget: sn,
|
|
1008
|
+
buildCustomWidget: an
|
|
774
1009
|
});
|
|
775
1010
|
h({
|
|
776
1011
|
itemType: "ALERTS",
|
|
1012
|
+
kind: "display",
|
|
777
1013
|
entryShape: "bare",
|
|
778
1014
|
mapToWidget: (e) => ({
|
|
779
1015
|
uid: e.uid ?? "",
|
|
@@ -787,6 +1023,7 @@ h({
|
|
|
787
1023
|
});
|
|
788
1024
|
h({
|
|
789
1025
|
itemType: "MARKDOWN_TEXTS",
|
|
1026
|
+
kind: "display",
|
|
790
1027
|
entryShape: "bare",
|
|
791
1028
|
mapToWidget: (e) => ({
|
|
792
1029
|
uid: e.uid ?? "",
|
|
@@ -797,7 +1034,7 @@ h({
|
|
|
797
1034
|
}
|
|
798
1035
|
})
|
|
799
1036
|
});
|
|
800
|
-
function
|
|
1037
|
+
function un(e) {
|
|
801
1038
|
return {
|
|
802
1039
|
uid: e.uid ?? "",
|
|
803
1040
|
kind: "layout",
|
|
@@ -810,7 +1047,7 @@ function Jt(e) {
|
|
|
810
1047
|
children: []
|
|
811
1048
|
};
|
|
812
1049
|
}
|
|
813
|
-
function
|
|
1050
|
+
function ln(e, t) {
|
|
814
1051
|
const n = t.walkChildren(t.children ?? []);
|
|
815
1052
|
if (e.kind === "static")
|
|
816
1053
|
return { ...t.mapStaticDef(e.def, "TABS"), children: n };
|
|
@@ -820,17 +1057,18 @@ function Qt(e, t) {
|
|
|
820
1057
|
return { ...t.mapStaticDef(s, "TABS"), children: n };
|
|
821
1058
|
});
|
|
822
1059
|
}
|
|
823
|
-
function
|
|
1060
|
+
function cn(e) {
|
|
824
1061
|
return e.children;
|
|
825
1062
|
}
|
|
826
1063
|
h({
|
|
827
1064
|
itemType: "TABS",
|
|
1065
|
+
kind: "layout",
|
|
828
1066
|
entryShape: "compound",
|
|
829
|
-
mapToWidget:
|
|
830
|
-
buildCustomWidget:
|
|
831
|
-
getChildren:
|
|
1067
|
+
mapToWidget: un,
|
|
1068
|
+
buildCustomWidget: ln,
|
|
1069
|
+
getChildren: cn
|
|
832
1070
|
});
|
|
833
|
-
function
|
|
1071
|
+
function pn(e) {
|
|
834
1072
|
return {
|
|
835
1073
|
uid: e.uid ?? "",
|
|
836
1074
|
kind: "layout",
|
|
@@ -844,7 +1082,7 @@ function tn(e) {
|
|
|
844
1082
|
children: []
|
|
845
1083
|
};
|
|
846
1084
|
}
|
|
847
|
-
function
|
|
1085
|
+
function dn(e, t) {
|
|
848
1086
|
const n = t.walkChildren(t.children ?? []);
|
|
849
1087
|
if (e.kind === "static")
|
|
850
1088
|
return { ...t.mapStaticDef(e.def, "ACCORDION"), children: n };
|
|
@@ -854,25 +1092,27 @@ function nn(e, t) {
|
|
|
854
1092
|
return { ...t.mapStaticDef(s, "ACCORDION"), children: n };
|
|
855
1093
|
});
|
|
856
1094
|
}
|
|
857
|
-
function
|
|
1095
|
+
function mn(e) {
|
|
858
1096
|
return e.children;
|
|
859
1097
|
}
|
|
860
1098
|
h({
|
|
861
1099
|
itemType: "ACCORDION",
|
|
1100
|
+
kind: "layout",
|
|
862
1101
|
entryShape: "compound",
|
|
863
|
-
mapToWidget:
|
|
864
|
-
buildCustomWidget:
|
|
865
|
-
getChildren:
|
|
1102
|
+
mapToWidget: pn,
|
|
1103
|
+
buildCustomWidget: dn,
|
|
1104
|
+
getChildren: mn
|
|
866
1105
|
});
|
|
867
1106
|
h({
|
|
868
1107
|
itemType: "CUSTOM_INPUT",
|
|
1108
|
+
kind: "input",
|
|
869
1109
|
entryShape: "keyed",
|
|
870
1110
|
sensibleDefaults: {
|
|
871
1111
|
base: {
|
|
872
1112
|
suppressAutomaticLabels: !1
|
|
873
1113
|
},
|
|
874
1114
|
fields: ["suppressAutomaticLabels"],
|
|
875
|
-
apply: (e, t) =>
|
|
1115
|
+
apply: (e, t) => g(e, t)
|
|
876
1116
|
},
|
|
877
1117
|
mapToWidget: (e) => ({
|
|
878
1118
|
uid: e.uid ?? "",
|
|
@@ -889,6 +1129,7 @@ h({
|
|
|
889
1129
|
});
|
|
890
1130
|
h({
|
|
891
1131
|
itemType: "CUSTOM_ACTION",
|
|
1132
|
+
kind: "action",
|
|
892
1133
|
entryShape: "bare",
|
|
893
1134
|
mapToWidget: (e) => {
|
|
894
1135
|
const {
|
|
@@ -900,11 +1141,11 @@ h({
|
|
|
900
1141
|
data: i,
|
|
901
1142
|
customType: a,
|
|
902
1143
|
tags: u,
|
|
903
|
-
size:
|
|
1144
|
+
size: l,
|
|
904
1145
|
include: p,
|
|
905
1146
|
exclude: d,
|
|
906
|
-
states:
|
|
907
|
-
props:
|
|
1147
|
+
states: m,
|
|
1148
|
+
props: y,
|
|
908
1149
|
...P
|
|
909
1150
|
} = e;
|
|
910
1151
|
return {
|
|
@@ -914,10 +1155,10 @@ h({
|
|
|
914
1155
|
label: n,
|
|
915
1156
|
disabled: r,
|
|
916
1157
|
...o != null ? { on: o } : {},
|
|
917
|
-
props: { ...
|
|
1158
|
+
props: { ...y, ...P }
|
|
918
1159
|
};
|
|
919
1160
|
},
|
|
920
|
-
afterMerge: (e, t) =>
|
|
1161
|
+
afterMerge: (e, t) => ge.extractOnClickFromMergeResult(
|
|
921
1162
|
e,
|
|
922
1163
|
t.eventRegistry,
|
|
923
1164
|
t.eventIdGenerator
|
|
@@ -925,6 +1166,7 @@ h({
|
|
|
925
1166
|
});
|
|
926
1167
|
h({
|
|
927
1168
|
itemType: "CUSTOM_DISPLAY",
|
|
1169
|
+
kind: "display",
|
|
928
1170
|
entryShape: "bare",
|
|
929
1171
|
mapToWidget: (e) => ({
|
|
930
1172
|
uid: e.uid ?? "",
|
|
@@ -933,7 +1175,7 @@ h({
|
|
|
933
1175
|
props: e.props ?? {}
|
|
934
1176
|
})
|
|
935
1177
|
});
|
|
936
|
-
function
|
|
1178
|
+
function hn(e) {
|
|
937
1179
|
return {
|
|
938
1180
|
uid: e.uid ?? "",
|
|
939
1181
|
kind: "layout",
|
|
@@ -942,7 +1184,7 @@ function on(e) {
|
|
|
942
1184
|
children: []
|
|
943
1185
|
};
|
|
944
1186
|
}
|
|
945
|
-
function
|
|
1187
|
+
function fn(e, t) {
|
|
946
1188
|
const n = t.walkChildren(t.children ?? []);
|
|
947
1189
|
if (e.kind === "static")
|
|
948
1190
|
return { ...t.mapStaticDef(e.def, "CUSTOM_LAYOUT"), children: n };
|
|
@@ -952,23 +1194,25 @@ function sn(e, t) {
|
|
|
952
1194
|
return { ...t.mapStaticDef(s, "CUSTOM_LAYOUT"), children: n };
|
|
953
1195
|
});
|
|
954
1196
|
}
|
|
955
|
-
function
|
|
1197
|
+
function yn(e) {
|
|
956
1198
|
return e.children;
|
|
957
1199
|
}
|
|
958
1200
|
h({
|
|
959
1201
|
itemType: "CUSTOM_LAYOUT",
|
|
1202
|
+
kind: "layout",
|
|
960
1203
|
entryShape: "compound",
|
|
961
|
-
mapToWidget:
|
|
962
|
-
buildCustomWidget:
|
|
963
|
-
getChildren:
|
|
1204
|
+
mapToWidget: hn,
|
|
1205
|
+
buildCustomWidget: fn,
|
|
1206
|
+
getChildren: yn
|
|
964
1207
|
});
|
|
965
1208
|
h({
|
|
966
1209
|
itemType: "TAGS",
|
|
1210
|
+
kind: "input",
|
|
967
1211
|
entryShape: "keyed",
|
|
968
1212
|
sensibleDefaults: {
|
|
969
1213
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
970
1214
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
971
|
-
apply: (e, t) =>
|
|
1215
|
+
apply: (e, t) => I(g(e, t), t)
|
|
972
1216
|
},
|
|
973
1217
|
mapToWidget: (e) => ({
|
|
974
1218
|
uid: e.uid ?? "",
|
|
@@ -978,11 +1222,11 @@ h({
|
|
|
978
1222
|
...e.label != null ? { label: e.label } : {},
|
|
979
1223
|
...e.disabled != null ? { disabled: e.disabled } : {},
|
|
980
1224
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
981
|
-
...e.validator != null ? { validator:
|
|
982
|
-
props:
|
|
1225
|
+
...e.validator != null ? { validator: v(e.validator, "array") } : {},
|
|
1226
|
+
props: b(e)
|
|
983
1227
|
})
|
|
984
1228
|
});
|
|
985
|
-
const
|
|
1229
|
+
const st = {
|
|
986
1230
|
INPUTS: /* @__PURE__ */ new Set([
|
|
987
1231
|
"INPUTS",
|
|
988
1232
|
"TEXTAREA",
|
|
@@ -992,11 +1236,21 @@ const et = {
|
|
|
992
1236
|
"RADIOGROUP",
|
|
993
1237
|
"CHECKBOX",
|
|
994
1238
|
"CALENDAR",
|
|
1239
|
+
"DATE_TIME_CALENDAR",
|
|
1240
|
+
"DATE_TIME_PICKER",
|
|
995
1241
|
"DATE_INPUT",
|
|
996
1242
|
"DATE_PICKER",
|
|
997
1243
|
"RANGE_CALENDAR",
|
|
998
1244
|
"RANGE_DATE_INPUT",
|
|
1245
|
+
"RANGE_DATE_TIME_INPUT",
|
|
1246
|
+
"RANGE_DATE_TIME_CALENDAR",
|
|
1247
|
+
"RANGE_DATE_TIME_PICKER",
|
|
1248
|
+
"RANGE_TIME_INPUT",
|
|
999
1249
|
"RANGE_DATE_PICKER",
|
|
1250
|
+
"RANGE_TIME_PICKER",
|
|
1251
|
+
"TIME_INPUT",
|
|
1252
|
+
"TIME_PICKER",
|
|
1253
|
+
"DATE_TIME_INPUT",
|
|
1000
1254
|
"CURRENCY",
|
|
1001
1255
|
"MARKDOWN",
|
|
1002
1256
|
"LIST",
|
|
@@ -1008,11 +1262,11 @@ const et = {
|
|
|
1008
1262
|
DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "MARKDOWN_TEXTS", "CUSTOM_DISPLAY"]),
|
|
1009
1263
|
LAYOUTS: /* @__PURE__ */ new Set(["LAYOUTS", "TABS", "ACCORDION", "CUSTOM_LAYOUT"])
|
|
1010
1264
|
};
|
|
1011
|
-
function
|
|
1012
|
-
const n =
|
|
1265
|
+
function bn(e, t) {
|
|
1266
|
+
const n = st[e];
|
|
1013
1267
|
return n ? n.has(t) : e === t;
|
|
1014
1268
|
}
|
|
1015
|
-
class
|
|
1269
|
+
class gn {
|
|
1016
1270
|
resolve(t, n) {
|
|
1017
1271
|
const r = [];
|
|
1018
1272
|
for (const s of n)
|
|
@@ -1029,7 +1283,7 @@ class cn {
|
|
|
1029
1283
|
this.collectFromLeaf(o, n, r);
|
|
1030
1284
|
}
|
|
1031
1285
|
collectFromLeaf(t, n, r) {
|
|
1032
|
-
|
|
1286
|
+
bn(t.selectorType, n.itemType ?? "") && t.matcher(n) && r.push(t);
|
|
1033
1287
|
}
|
|
1034
1288
|
rollUpSensibleDefaults(t) {
|
|
1035
1289
|
const n = /* @__PURE__ */ new Map(), r = (s, i) => {
|
|
@@ -1037,7 +1291,7 @@ class cn {
|
|
|
1037
1291
|
a.push(i), n.set(s, a);
|
|
1038
1292
|
};
|
|
1039
1293
|
for (const s of t) {
|
|
1040
|
-
const i =
|
|
1294
|
+
const i = st[s.selectorType];
|
|
1041
1295
|
if (i)
|
|
1042
1296
|
for (const a of i) r(a, s);
|
|
1043
1297
|
else
|
|
@@ -1045,12 +1299,12 @@ class cn {
|
|
|
1045
1299
|
}
|
|
1046
1300
|
const o = {};
|
|
1047
1301
|
for (const [s, i] of n)
|
|
1048
|
-
|
|
1302
|
+
nt(s) && (o[s] = Q(s).rollUpSensibleDefaults(i));
|
|
1049
1303
|
return o;
|
|
1050
1304
|
}
|
|
1051
1305
|
}
|
|
1052
|
-
const
|
|
1053
|
-
class
|
|
1306
|
+
const _n = new gn();
|
|
1307
|
+
class vn {
|
|
1054
1308
|
/**
|
|
1055
1309
|
* Deep merges two objects, with right taking precedence over left when properties conflict.
|
|
1056
1310
|
* Arrays are replaced, not merged.
|
|
@@ -1069,8 +1323,8 @@ class pn {
|
|
|
1069
1323
|
return r;
|
|
1070
1324
|
}
|
|
1071
1325
|
}
|
|
1072
|
-
const
|
|
1073
|
-
class
|
|
1326
|
+
const Tn = new vn();
|
|
1327
|
+
class kn {
|
|
1074
1328
|
constructor(t) {
|
|
1075
1329
|
this.objectUtils = t;
|
|
1076
1330
|
}
|
|
@@ -1078,13 +1332,13 @@ class mn {
|
|
|
1078
1332
|
let o = {}, s = null;
|
|
1079
1333
|
typeof t == "function" && (s = t);
|
|
1080
1334
|
const i = this.collectDecorators(r);
|
|
1081
|
-
for (const
|
|
1335
|
+
for (const l of i) {
|
|
1082
1336
|
if (s != null) {
|
|
1083
|
-
s = this.composeRuntimeFunctions(s,
|
|
1337
|
+
s = this.composeRuntimeFunctions(s, l);
|
|
1084
1338
|
continue;
|
|
1085
1339
|
}
|
|
1086
|
-
if (typeof
|
|
1087
|
-
const p =
|
|
1340
|
+
if (typeof l == "function") {
|
|
1341
|
+
const p = l({
|
|
1088
1342
|
...o,
|
|
1089
1343
|
...typeof t == "function" ? {} : t
|
|
1090
1344
|
});
|
|
@@ -1100,7 +1354,7 @@ class mn {
|
|
|
1100
1354
|
}
|
|
1101
1355
|
o = this.objectUtils.deepMerge(o, p);
|
|
1102
1356
|
} else
|
|
1103
|
-
o = this.objectUtils.deepMerge(o,
|
|
1357
|
+
o = this.objectUtils.deepMerge(o, l);
|
|
1104
1358
|
}
|
|
1105
1359
|
if (s != null)
|
|
1106
1360
|
return {
|
|
@@ -1121,9 +1375,9 @@ class mn {
|
|
|
1121
1375
|
}
|
|
1122
1376
|
// ── Apply sensible defaults via registry ──
|
|
1123
1377
|
applySensibleDefaults(t, n, r) {
|
|
1124
|
-
if (!
|
|
1378
|
+
if (!nt(n)) return t;
|
|
1125
1379
|
const o = r.sensibleDefaults[n] ?? {};
|
|
1126
|
-
return
|
|
1380
|
+
return Q(n).applySensibleDefaults(t, o);
|
|
1127
1381
|
}
|
|
1128
1382
|
// ── Create promoted FunctionWidget ──
|
|
1129
1383
|
createPromotedFunction(t, n, r, o, s) {
|
|
@@ -1151,8 +1405,8 @@ class mn {
|
|
|
1151
1405
|
};
|
|
1152
1406
|
}
|
|
1153
1407
|
}
|
|
1154
|
-
const
|
|
1155
|
-
class
|
|
1408
|
+
const wn = new kn(Tn);
|
|
1409
|
+
class Sn {
|
|
1156
1410
|
mapToWidget(t, n) {
|
|
1157
1411
|
if (t.kind === "dynamic") {
|
|
1158
1412
|
const r = t.fn;
|
|
@@ -1164,7 +1418,7 @@ class fn {
|
|
|
1164
1418
|
return this.mapStaticDef(t.def, n);
|
|
1165
1419
|
}
|
|
1166
1420
|
mapStaticDef(t, n) {
|
|
1167
|
-
const r =
|
|
1421
|
+
const r = Q(n).mapToWidget(t);
|
|
1168
1422
|
return this.applyBaseWidgetFields(r, t);
|
|
1169
1423
|
}
|
|
1170
1424
|
/**
|
|
@@ -1175,8 +1429,8 @@ class fn {
|
|
|
1175
1429
|
return n.size != null && (t.size = n.size), n.defaultValue != null && t.kind === "input" && (t.defaultValue = n.defaultValue), n.on != null && (t.on = n.on), n.include != null && (t.include = n.include), n.exclude != null && (t.exclude = n.exclude), t;
|
|
1176
1430
|
}
|
|
1177
1431
|
}
|
|
1178
|
-
const
|
|
1179
|
-
class
|
|
1432
|
+
const An = new Sn();
|
|
1433
|
+
class En {
|
|
1180
1434
|
/**
|
|
1181
1435
|
* Ensures the output is always a uniform GslSelector[] of aggregated selectors.
|
|
1182
1436
|
*
|
|
@@ -1201,18 +1455,18 @@ class bn {
|
|
|
1201
1455
|
};
|
|
1202
1456
|
}
|
|
1203
1457
|
}
|
|
1204
|
-
const
|
|
1458
|
+
const zn = new En(), On = {
|
|
1205
1459
|
input: /* @__PURE__ */ new Set(["disabled", "readonly", "label", "validator", "size"]),
|
|
1206
1460
|
action: /* @__PURE__ */ new Set(["disabled", "label", "size"]),
|
|
1207
1461
|
layout: /* @__PURE__ */ new Set(["size"]),
|
|
1208
1462
|
display: /* @__PURE__ */ new Set([])
|
|
1209
|
-
},
|
|
1463
|
+
}, Oe = {
|
|
1210
1464
|
onChange: "change",
|
|
1211
1465
|
onLoad: "load",
|
|
1212
1466
|
onFilter: "filter",
|
|
1213
1467
|
onClick: "click"
|
|
1214
1468
|
};
|
|
1215
|
-
class
|
|
1469
|
+
class $n {
|
|
1216
1470
|
/**
|
|
1217
1471
|
* Extracts `states` from a merge result, combining with state-targeted
|
|
1218
1472
|
* GSL leaf selectors from `_gslStates`.
|
|
@@ -1222,7 +1476,7 @@ class vn {
|
|
|
1222
1476
|
extractFromMergeResult(t, n) {
|
|
1223
1477
|
const r = {};
|
|
1224
1478
|
for (const a of n) {
|
|
1225
|
-
const u = a.targetState,
|
|
1479
|
+
const u = a.targetState, l = a.config, p = l.override && typeof l.override != "function" ? l.override : l;
|
|
1226
1480
|
r[u] = {
|
|
1227
1481
|
...r[u] || {},
|
|
1228
1482
|
...p
|
|
@@ -1231,9 +1485,9 @@ class vn {
|
|
|
1231
1485
|
if (t.kind === "dynamic") {
|
|
1232
1486
|
const a = t.fn;
|
|
1233
1487
|
return {
|
|
1234
|
-
cleanedResult: { kind: "dynamic", fn: (
|
|
1235
|
-
const p = a(
|
|
1236
|
-
return
|
|
1488
|
+
cleanedResult: { kind: "dynamic", fn: (l) => {
|
|
1489
|
+
const p = a(l), { states: d, ...m } = p;
|
|
1490
|
+
return m;
|
|
1237
1491
|
} },
|
|
1238
1492
|
stateData: { stateOverrides: r }
|
|
1239
1493
|
};
|
|
@@ -1262,11 +1516,11 @@ class vn {
|
|
|
1262
1516
|
const { stateOverrides: s } = n;
|
|
1263
1517
|
if (Object.keys(s).length === 0)
|
|
1264
1518
|
return t;
|
|
1265
|
-
const i = { ...t }, a = t.kind, u =
|
|
1519
|
+
const i = { ...t }, a = t.kind, u = On[a] || /* @__PURE__ */ new Set();
|
|
1266
1520
|
t.props && (i.props = { ...t.props }), t.on && (i.on = { ...t.on });
|
|
1267
|
-
for (const [
|
|
1268
|
-
for (const [d,
|
|
1269
|
-
d === "visible" ? this.applyVisibility(i,
|
|
1521
|
+
for (const [l, p] of Object.entries(s))
|
|
1522
|
+
for (const [d, m] of Object.entries(p))
|
|
1523
|
+
d === "visible" ? this.applyVisibility(i, l, m) : Oe[d] ? this.applyStateEvent(i, l, d, m, r, o) : u.has(d) ? i[`${d}.${l}`] = m : (i.props || (i.props = {}), i.props[`${d}.${l}`] = m);
|
|
1270
1524
|
return i;
|
|
1271
1525
|
}
|
|
1272
1526
|
hasStateData(t) {
|
|
@@ -1284,29 +1538,29 @@ class vn {
|
|
|
1284
1538
|
}
|
|
1285
1539
|
// ── State-suffixed event helpers ──
|
|
1286
1540
|
applyStateEvent(t, n, r, o, s, i) {
|
|
1287
|
-
const a =
|
|
1541
|
+
const a = Oe[r];
|
|
1288
1542
|
if (t.on || (t.on = {}), typeof o == "function") {
|
|
1289
|
-
const u =
|
|
1543
|
+
const u = ot(o);
|
|
1290
1544
|
if (u != null)
|
|
1291
1545
|
t.on[`${a}.${n}`] = u;
|
|
1292
1546
|
else {
|
|
1293
|
-
const
|
|
1294
|
-
s.set(
|
|
1547
|
+
const l = i.next();
|
|
1548
|
+
s.set(l, o), t.on[`${a}.${n}`] = l;
|
|
1295
1549
|
}
|
|
1296
1550
|
} else typeof o == "string" && (t.on[`${a}.${n}`] = o);
|
|
1297
1551
|
}
|
|
1298
1552
|
}
|
|
1299
|
-
const
|
|
1300
|
-
function
|
|
1553
|
+
const Pn = new $n();
|
|
1554
|
+
function In() {
|
|
1301
1555
|
let e = 0;
|
|
1302
1556
|
return { next: () => `event_${e++}` };
|
|
1303
1557
|
}
|
|
1304
|
-
class
|
|
1558
|
+
class Cn {
|
|
1305
1559
|
constructor(t, n, r, o, s) {
|
|
1306
1560
|
this.resolver = t, this.merger = n, this.mapper = r, this.eventWiring = o, this.stateExpansion = s;
|
|
1307
1561
|
}
|
|
1308
1562
|
walkAndMap(t, n, r) {
|
|
1309
|
-
const o = /* @__PURE__ */ new Map(), s =
|
|
1563
|
+
const o = /* @__PURE__ */ new Map(), s = In(), i = { value: 0 }, a = /* @__PURE__ */ new Set();
|
|
1310
1564
|
return { widgets: this.walkItems(
|
|
1311
1565
|
t,
|
|
1312
1566
|
n,
|
|
@@ -1321,8 +1575,8 @@ class Tn {
|
|
|
1321
1575
|
return t.flatMap((u) => {
|
|
1322
1576
|
if (u.type !== "ITEMS")
|
|
1323
1577
|
throw new Error("Unexpected gui shortcut type");
|
|
1324
|
-
return u.items.map((
|
|
1325
|
-
|
|
1578
|
+
return u.items.map((l) => this.processItem(
|
|
1579
|
+
l,
|
|
1326
1580
|
u.itemType,
|
|
1327
1581
|
u.tags,
|
|
1328
1582
|
n,
|
|
@@ -1334,68 +1588,68 @@ class Tn {
|
|
|
1334
1588
|
));
|
|
1335
1589
|
});
|
|
1336
1590
|
}
|
|
1337
|
-
processItem(t, n, r, o, s, i, a, u,
|
|
1338
|
-
const p = n, d =
|
|
1339
|
-
leafSelectors:
|
|
1340
|
-
sensibleDefaults:
|
|
1591
|
+
processItem(t, n, r, o, s, i, a, u, l) {
|
|
1592
|
+
const p = n, d = Q(n), m = d.parseEntry(t), y = this.buildBaseDef(m), P = this.buildDecoratorForMatching(y, p, r), S = this.resolver.resolve(P, o), Ae = S.leafSelectors.filter((A) => A.targetState != null), Ee = {
|
|
1593
|
+
leafSelectors: S.leafSelectors.filter((A) => A.targetState == null),
|
|
1594
|
+
sensibleDefaults: S.sensibleDefaults
|
|
1341
1595
|
};
|
|
1342
|
-
let
|
|
1343
|
-
d.afterMerge && (
|
|
1596
|
+
let D = this.merger.merge(y, p, Ee);
|
|
1597
|
+
d.afterMerge && (D = d.afterMerge(D, {
|
|
1344
1598
|
eventRegistry: s,
|
|
1345
1599
|
formConfig: i,
|
|
1346
1600
|
eventIdGenerator: a
|
|
1347
|
-
})),
|
|
1348
|
-
|
|
1601
|
+
})), D = this.eventWiring.wireInputLayoutEvents(
|
|
1602
|
+
D,
|
|
1349
1603
|
s,
|
|
1350
1604
|
a
|
|
1351
1605
|
);
|
|
1352
|
-
const { cleanedResult:
|
|
1353
|
-
|
|
1354
|
-
|
|
1606
|
+
const { cleanedResult: ze, stateData: ue } = this.stateExpansion.extractFromMergeResult(
|
|
1607
|
+
D,
|
|
1608
|
+
Ae
|
|
1355
1609
|
);
|
|
1356
|
-
let
|
|
1610
|
+
let Z;
|
|
1357
1611
|
if (d.buildCustomWidget) {
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1612
|
+
const A = this.buildCustomWidgetContext(
|
|
1613
|
+
m.children,
|
|
1360
1614
|
o,
|
|
1361
1615
|
s,
|
|
1362
1616
|
i,
|
|
1363
1617
|
a,
|
|
1364
1618
|
u,
|
|
1365
|
-
|
|
1619
|
+
l
|
|
1366
1620
|
);
|
|
1367
|
-
|
|
1621
|
+
Z = this.buildCustomWidget(d, ze, A);
|
|
1368
1622
|
} else
|
|
1369
|
-
|
|
1370
|
-
if (typeof
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
}
|
|
1374
|
-
if (this.stateExpansion.hasStateData(
|
|
1375
|
-
if (typeof
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1623
|
+
Z = this.mapper.mapToWidget(ze, p);
|
|
1624
|
+
if (typeof Z != "function") {
|
|
1625
|
+
const A = Z;
|
|
1626
|
+
A.uid || (A.path && !l.has(A.path) ? (A.uid = A.path, l.add(A.path)) : A.uid = `dx_${u.value++}`);
|
|
1627
|
+
}
|
|
1628
|
+
if (this.stateExpansion.hasStateData(ue))
|
|
1629
|
+
if (typeof Z == "function") {
|
|
1630
|
+
const A = Z;
|
|
1631
|
+
Z = ((Ct) => {
|
|
1632
|
+
const Nt = A(Ct);
|
|
1379
1633
|
return this.stateExpansion.applyToWidget(
|
|
1380
|
-
|
|
1381
|
-
|
|
1634
|
+
Nt,
|
|
1635
|
+
ue,
|
|
1382
1636
|
s,
|
|
1383
1637
|
a
|
|
1384
1638
|
);
|
|
1385
1639
|
});
|
|
1386
1640
|
} else
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1641
|
+
Z = this.stateExpansion.applyToWidget(
|
|
1642
|
+
Z,
|
|
1643
|
+
ue,
|
|
1390
1644
|
s,
|
|
1391
1645
|
a
|
|
1392
1646
|
);
|
|
1393
|
-
return
|
|
1647
|
+
return Z;
|
|
1394
1648
|
}
|
|
1395
1649
|
buildCustomWidgetContext(t, n, r, o, s, i, a) {
|
|
1396
1650
|
return {
|
|
1397
1651
|
children: t,
|
|
1398
|
-
mapStaticDef: (u,
|
|
1652
|
+
mapStaticDef: (u, l) => this.mapper.mapStaticDef(u, l),
|
|
1399
1653
|
walkChildren: (u) => this.walkItems(
|
|
1400
1654
|
u,
|
|
1401
1655
|
n,
|
|
@@ -1417,7 +1671,7 @@ class Tn {
|
|
|
1417
1671
|
buildBaseDef(t) {
|
|
1418
1672
|
const n = t.baseDef;
|
|
1419
1673
|
return typeof n == "function" ? (r) => {
|
|
1420
|
-
const o =
|
|
1674
|
+
const o = pe(r), s = n(o);
|
|
1421
1675
|
return t.path != null ? { ...s, path: t.path } : s;
|
|
1422
1676
|
} : t.path != null ? { ...n, path: t.path } : n;
|
|
1423
1677
|
}
|
|
@@ -1428,7 +1682,7 @@ class Tn {
|
|
|
1428
1682
|
return { itemType: n, tags: o, uid: s, type: i };
|
|
1429
1683
|
}
|
|
1430
1684
|
}
|
|
1431
|
-
class
|
|
1685
|
+
class Nn {
|
|
1432
1686
|
constructor(t, n) {
|
|
1433
1687
|
this.selectorNormalizer = t, this.walker = n;
|
|
1434
1688
|
}
|
|
@@ -1441,8 +1695,8 @@ class An {
|
|
|
1441
1695
|
o,
|
|
1442
1696
|
s,
|
|
1443
1697
|
i
|
|
1444
|
-
),
|
|
1445
|
-
return this.buildResult({ form:
|
|
1698
|
+
), l = a[0];
|
|
1699
|
+
return this.buildResult({ form: l }, u, i);
|
|
1446
1700
|
}
|
|
1447
1701
|
/**
|
|
1448
1702
|
* Normalizes raw form definitions and applies form-level defaults.
|
|
@@ -1456,7 +1710,7 @@ class An {
|
|
|
1456
1710
|
*/
|
|
1457
1711
|
prepareForm(t, n, r) {
|
|
1458
1712
|
const s = (Array.isArray(t) ? [...t] : [t]).map(
|
|
1459
|
-
(u) => typeof u == "function" ?
|
|
1713
|
+
(u) => typeof u == "function" ? jt(u) : u
|
|
1460
1714
|
), i = this.selectorNormalizer.normalizeSelectors(n), a = {
|
|
1461
1715
|
...this.selectorNormalizer.extractFormConfig(),
|
|
1462
1716
|
...r
|
|
@@ -1467,7 +1721,7 @@ class An {
|
|
|
1467
1721
|
children: s
|
|
1468
1722
|
};
|
|
1469
1723
|
return {
|
|
1470
|
-
defs: [{ type: "ITEMS", itemType:
|
|
1724
|
+
defs: [{ type: "ITEMS", itemType: et.LAYOUTS, items: [u], tags: [] }],
|
|
1471
1725
|
gslSelectors: i,
|
|
1472
1726
|
formConfig: a
|
|
1473
1727
|
};
|
|
@@ -1493,16 +1747,16 @@ class An {
|
|
|
1493
1747
|
return n.size > 0 && (o.events = (s) => {
|
|
1494
1748
|
const i = n.get(s.name);
|
|
1495
1749
|
if (i) {
|
|
1496
|
-
const a = (
|
|
1497
|
-
if (
|
|
1498
|
-
const { path: p, ...d } =
|
|
1499
|
-
for (const [
|
|
1750
|
+
const a = (l) => {
|
|
1751
|
+
if (l && typeof l == "object" && "path" in l && !("type" in l)) {
|
|
1752
|
+
const { path: p, ...d } = l;
|
|
1753
|
+
for (const [m, y] of Object.entries(d))
|
|
1500
1754
|
s.callback({
|
|
1501
1755
|
type: "OVERRIDE_WIDGET_PROP",
|
|
1502
|
-
payload: { path: p, prop:
|
|
1756
|
+
payload: { path: p, prop: m, value: y }
|
|
1503
1757
|
});
|
|
1504
1758
|
} else
|
|
1505
|
-
s.callback(
|
|
1759
|
+
s.callback(l);
|
|
1506
1760
|
}, u = {
|
|
1507
1761
|
...s,
|
|
1508
1762
|
callback: a,
|
|
@@ -1510,63 +1764,64 @@ class An {
|
|
|
1510
1764
|
};
|
|
1511
1765
|
i(u);
|
|
1512
1766
|
}
|
|
1513
|
-
}), r.dependencies && (o.dependencies = r.dependencies), r.widgetLoaders && (o.widgetLoaders = r.widgetLoaders), r.validateOn && (o.validateOn = r.validateOn), r.itemRenderers && (o.itemRenderers = r.itemRenderers), o;
|
|
1767
|
+
}), r.dependencies && (o.dependencies = r.dependencies), r.functions && (o.functions = r.functions), r.widgetLoaders && (o.widgetLoaders = r.widgetLoaders), r.validateOn && (o.validateOn = r.validateOn), r.itemRenderers && (o.itemRenderers = r.itemRenderers), o;
|
|
1514
1768
|
}
|
|
1515
1769
|
}
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
),
|
|
1523
|
-
function
|
|
1524
|
-
return typeof e == "function" ? !0 : Array.isArray(e) ? e.length === 0 || e.every(
|
|
1525
|
-
}
|
|
1526
|
-
function
|
|
1770
|
+
const Zn = new Cn(
|
|
1771
|
+
_n,
|
|
1772
|
+
wn,
|
|
1773
|
+
An,
|
|
1774
|
+
ge,
|
|
1775
|
+
Pn
|
|
1776
|
+
), Dn = new Nn(zn, Zn);
|
|
1777
|
+
function it(e) {
|
|
1778
|
+
return typeof e == "function" ? !0 : Array.isArray(e) ? e.length === 0 || e.every($e) : $e(e);
|
|
1779
|
+
}
|
|
1780
|
+
function $e(e) {
|
|
1527
1781
|
if (typeof e == "function") return !0;
|
|
1528
1782
|
if (e === null || typeof e != "object") return !1;
|
|
1529
1783
|
const t = e;
|
|
1530
1784
|
return t.type === "ITEMS" && typeof t.itemType == "string";
|
|
1531
1785
|
}
|
|
1532
|
-
function
|
|
1786
|
+
function Ln(e) {
|
|
1533
1787
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1534
1788
|
return;
|
|
1535
1789
|
const t = e.form;
|
|
1536
|
-
if (
|
|
1790
|
+
if (it(t))
|
|
1537
1791
|
throw new Error(
|
|
1538
1792
|
"[GolemUI] The gui.* form definition was wrapped in an extra `{ form: ... }` object, so its fields were never resolved. Pass the gui.* array DIRECTLY as formDef (`config={{ formDef: form }}`) and put any named `states` in `formConfig`: `config={{ formDef: form, formConfig: { states } }}`. Do NOT wrap them as a `{ form: [...] }` object."
|
|
1539
1793
|
);
|
|
1540
1794
|
}
|
|
1541
|
-
const
|
|
1542
|
-
function
|
|
1795
|
+
const Pe = Object.freeze({}), Mn = Object.freeze({}), Ie = /* @__PURE__ */ new WeakMap();
|
|
1796
|
+
function le(e, t) {
|
|
1543
1797
|
return e == null ? t : typeof e == "object" ? e : {};
|
|
1544
1798
|
}
|
|
1545
|
-
function
|
|
1546
|
-
if (!
|
|
1547
|
-
return
|
|
1548
|
-
const r =
|
|
1549
|
-
let i =
|
|
1550
|
-
i || (i = /* @__PURE__ */ new WeakMap(),
|
|
1799
|
+
function Rn(e, t, n) {
|
|
1800
|
+
if (!it(e))
|
|
1801
|
+
return Ln(e), { formDef: e };
|
|
1802
|
+
const r = le(e, Pe), o = le(t, Pe), s = le(n, Mn);
|
|
1803
|
+
let i = Ie.get(r);
|
|
1804
|
+
i || (i = /* @__PURE__ */ new WeakMap(), Ie.set(r, i));
|
|
1551
1805
|
let a = i.get(o);
|
|
1552
1806
|
a || (a = /* @__PURE__ */ new WeakMap(), i.set(o, a));
|
|
1553
1807
|
const u = a.get(s);
|
|
1554
1808
|
if (u) return u;
|
|
1555
|
-
const
|
|
1809
|
+
const l = Dn.processDxFacade(
|
|
1556
1810
|
e,
|
|
1557
1811
|
t,
|
|
1558
1812
|
n
|
|
1559
1813
|
), p = {
|
|
1560
|
-
formDef:
|
|
1561
|
-
formEvent:
|
|
1562
|
-
dependencies:
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1814
|
+
formDef: l.form,
|
|
1815
|
+
formEvent: l.events,
|
|
1816
|
+
dependencies: l.dependencies,
|
|
1817
|
+
functions: l.functions,
|
|
1818
|
+
widgetLoaders: l.widgetLoaders,
|
|
1819
|
+
validateOn: l.validateOn,
|
|
1820
|
+
itemRenderers: l.itemRenderers
|
|
1566
1821
|
};
|
|
1567
1822
|
return a.set(s, p), p;
|
|
1568
1823
|
}
|
|
1569
|
-
function
|
|
1824
|
+
function c(e, t, n) {
|
|
1570
1825
|
function r(a, u) {
|
|
1571
1826
|
if (a._zod || Object.defineProperty(a, "_zod", {
|
|
1572
1827
|
value: {
|
|
@@ -1578,10 +1833,10 @@ function l(e, t, n) {
|
|
|
1578
1833
|
}), a._zod.traits.has(e))
|
|
1579
1834
|
return;
|
|
1580
1835
|
a._zod.traits.add(e), t(a, u);
|
|
1581
|
-
const
|
|
1836
|
+
const l = i.prototype, p = Object.keys(l);
|
|
1582
1837
|
for (let d = 0; d < p.length; d++) {
|
|
1583
|
-
const
|
|
1584
|
-
|
|
1838
|
+
const m = p[d];
|
|
1839
|
+
m in a || (a[m] = l[m].bind(a));
|
|
1585
1840
|
}
|
|
1586
1841
|
}
|
|
1587
1842
|
const o = n?.Parent ?? Object;
|
|
@@ -1590,47 +1845,47 @@ function l(e, t, n) {
|
|
|
1590
1845
|
Object.defineProperty(s, "name", { value: e });
|
|
1591
1846
|
function i(a) {
|
|
1592
1847
|
var u;
|
|
1593
|
-
const
|
|
1594
|
-
r(
|
|
1595
|
-
for (const p of
|
|
1848
|
+
const l = n?.Parent ? new s() : this;
|
|
1849
|
+
r(l, a), (u = l._zod).deferred ?? (u.deferred = []);
|
|
1850
|
+
for (const p of l._zod.deferred)
|
|
1596
1851
|
p();
|
|
1597
|
-
return
|
|
1852
|
+
return l;
|
|
1598
1853
|
}
|
|
1599
1854
|
return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
|
|
1600
1855
|
value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(e)
|
|
1601
1856
|
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
1602
1857
|
}
|
|
1603
|
-
class
|
|
1858
|
+
class j extends Error {
|
|
1604
1859
|
constructor() {
|
|
1605
1860
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
1606
1861
|
}
|
|
1607
1862
|
}
|
|
1608
|
-
class
|
|
1863
|
+
class at extends Error {
|
|
1609
1864
|
constructor(t) {
|
|
1610
1865
|
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
1611
1866
|
}
|
|
1612
1867
|
}
|
|
1613
|
-
const
|
|
1614
|
-
function
|
|
1615
|
-
return
|
|
1868
|
+
const Wn = {};
|
|
1869
|
+
function L(e) {
|
|
1870
|
+
return Wn;
|
|
1616
1871
|
}
|
|
1617
|
-
function
|
|
1872
|
+
function de(e, t) {
|
|
1618
1873
|
return typeof t == "bigint" ? t.toString() : t;
|
|
1619
1874
|
}
|
|
1620
|
-
function
|
|
1875
|
+
function _e(e) {
|
|
1621
1876
|
return e == null;
|
|
1622
1877
|
}
|
|
1623
|
-
function
|
|
1878
|
+
function ve(e) {
|
|
1624
1879
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
1625
1880
|
return e.slice(t, n);
|
|
1626
1881
|
}
|
|
1627
|
-
const
|
|
1628
|
-
function
|
|
1882
|
+
const Ce = /* @__PURE__ */ Symbol("evaluating");
|
|
1883
|
+
function _(e, t, n) {
|
|
1629
1884
|
let r;
|
|
1630
1885
|
Object.defineProperty(e, t, {
|
|
1631
1886
|
get() {
|
|
1632
|
-
if (r !==
|
|
1633
|
-
return r === void 0 && (r =
|
|
1887
|
+
if (r !== Ce)
|
|
1888
|
+
return r === void 0 && (r = Ce, r = n()), r;
|
|
1634
1889
|
},
|
|
1635
1890
|
set(o) {
|
|
1636
1891
|
Object.defineProperty(e, t, {
|
|
@@ -1641,7 +1896,7 @@ function g(e, t, n) {
|
|
|
1641
1896
|
configurable: !0
|
|
1642
1897
|
});
|
|
1643
1898
|
}
|
|
1644
|
-
function
|
|
1899
|
+
function jn(...e) {
|
|
1645
1900
|
const t = {};
|
|
1646
1901
|
for (const n of e) {
|
|
1647
1902
|
const r = Object.getOwnPropertyDescriptors(n);
|
|
@@ -1649,34 +1904,34 @@ function Pn(...e) {
|
|
|
1649
1904
|
}
|
|
1650
1905
|
return Object.defineProperties({}, t);
|
|
1651
1906
|
}
|
|
1652
|
-
function
|
|
1907
|
+
function Fn(e) {
|
|
1653
1908
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1654
1909
|
}
|
|
1655
|
-
const
|
|
1910
|
+
const ut = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
1656
1911
|
};
|
|
1657
|
-
function
|
|
1912
|
+
function Ne(e) {
|
|
1658
1913
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1659
1914
|
}
|
|
1660
|
-
function
|
|
1661
|
-
if (
|
|
1915
|
+
function me(e) {
|
|
1916
|
+
if (Ne(e) === !1)
|
|
1662
1917
|
return !1;
|
|
1663
1918
|
const t = e.constructor;
|
|
1664
1919
|
if (t === void 0 || typeof t != "function")
|
|
1665
1920
|
return !0;
|
|
1666
1921
|
const n = t.prototype;
|
|
1667
|
-
return !(
|
|
1922
|
+
return !(Ne(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
1668
1923
|
}
|
|
1669
|
-
function
|
|
1670
|
-
return
|
|
1924
|
+
function lt(e) {
|
|
1925
|
+
return me(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
1671
1926
|
}
|
|
1672
|
-
function
|
|
1927
|
+
function Te(e) {
|
|
1673
1928
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1674
1929
|
}
|
|
1675
|
-
function
|
|
1930
|
+
function ct(e, t, n) {
|
|
1676
1931
|
const r = new e._zod.constr(t ?? e._zod.def);
|
|
1677
1932
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
1678
1933
|
}
|
|
1679
|
-
function
|
|
1934
|
+
function f(e) {
|
|
1680
1935
|
const t = e;
|
|
1681
1936
|
if (!t)
|
|
1682
1937
|
return {};
|
|
@@ -1689,14 +1944,14 @@ function m(e) {
|
|
|
1689
1944
|
}
|
|
1690
1945
|
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
1691
1946
|
}
|
|
1692
|
-
const
|
|
1947
|
+
const Un = {
|
|
1693
1948
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
1694
1949
|
int32: [-2147483648, 2147483647],
|
|
1695
1950
|
uint32: [0, 4294967295],
|
|
1696
1951
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
1697
1952
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
1698
1953
|
};
|
|
1699
|
-
function
|
|
1954
|
+
function W(e, t = 0) {
|
|
1700
1955
|
if (e.aborted === !0)
|
|
1701
1956
|
return !0;
|
|
1702
1957
|
for (let n = t; n < e.issues.length; n++)
|
|
@@ -1704,27 +1959,27 @@ function M(e, t = 0) {
|
|
|
1704
1959
|
return !0;
|
|
1705
1960
|
return !1;
|
|
1706
1961
|
}
|
|
1707
|
-
function
|
|
1962
|
+
function xn(e, t) {
|
|
1708
1963
|
return t.map((n) => {
|
|
1709
1964
|
var r;
|
|
1710
1965
|
return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
|
|
1711
1966
|
});
|
|
1712
1967
|
}
|
|
1713
|
-
function
|
|
1968
|
+
function K(e) {
|
|
1714
1969
|
return typeof e == "string" ? e : e?.message;
|
|
1715
1970
|
}
|
|
1716
|
-
function
|
|
1971
|
+
function M(e, t, n) {
|
|
1717
1972
|
const r = { ...e, path: e.path ?? [] };
|
|
1718
1973
|
if (!e.message) {
|
|
1719
|
-
const o =
|
|
1974
|
+
const o = K(e.inst?._zod.def?.error?.(e)) ?? K(t?.error?.(e)) ?? K(n.customError?.(e)) ?? K(n.localeError?.(e)) ?? "Invalid input";
|
|
1720
1975
|
r.message = o;
|
|
1721
1976
|
}
|
|
1722
1977
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
1723
1978
|
}
|
|
1724
|
-
function
|
|
1979
|
+
function ke(e) {
|
|
1725
1980
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
1726
1981
|
}
|
|
1727
|
-
function
|
|
1982
|
+
function B(...e) {
|
|
1728
1983
|
const [t, n, r] = e;
|
|
1729
1984
|
return typeof t == "string" ? {
|
|
1730
1985
|
message: t,
|
|
@@ -1733,25 +1988,25 @@ function U(...e) {
|
|
|
1733
1988
|
inst: r
|
|
1734
1989
|
} : { ...t };
|
|
1735
1990
|
}
|
|
1736
|
-
const
|
|
1991
|
+
const pt = (e, t) => {
|
|
1737
1992
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
1738
1993
|
value: e._zod,
|
|
1739
1994
|
enumerable: !1
|
|
1740
1995
|
}), Object.defineProperty(e, "issues", {
|
|
1741
1996
|
value: t,
|
|
1742
1997
|
enumerable: !1
|
|
1743
|
-
}), e.message = JSON.stringify(t,
|
|
1998
|
+
}), e.message = JSON.stringify(t, de, 2), Object.defineProperty(e, "toString", {
|
|
1744
1999
|
value: () => e.message,
|
|
1745
2000
|
enumerable: !1
|
|
1746
2001
|
});
|
|
1747
|
-
},
|
|
1748
|
-
function
|
|
2002
|
+
}, dt = c("$ZodError", pt), ee = c("$ZodError", pt, { Parent: Error });
|
|
2003
|
+
function Vn(e, t = (n) => n.message) {
|
|
1749
2004
|
const n = {}, r = [];
|
|
1750
2005
|
for (const o of e.issues)
|
|
1751
2006
|
o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
|
|
1752
2007
|
return { formErrors: r, fieldErrors: n };
|
|
1753
2008
|
}
|
|
1754
|
-
function
|
|
2009
|
+
function Jn(e, t = (n) => n.message) {
|
|
1755
2010
|
const n = { _errors: [] }, r = (o) => {
|
|
1756
2011
|
for (const s of o.issues)
|
|
1757
2012
|
if (s.code === "invalid_union" && s.errors.length)
|
|
@@ -1772,77 +2027,77 @@ function Mn(e, t = (n) => n.message) {
|
|
|
1772
2027
|
};
|
|
1773
2028
|
return r(e), n;
|
|
1774
2029
|
}
|
|
1775
|
-
const
|
|
2030
|
+
const te = (e) => (t, n, r, o) => {
|
|
1776
2031
|
const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, s);
|
|
1777
2032
|
if (i instanceof Promise)
|
|
1778
|
-
throw new
|
|
2033
|
+
throw new j();
|
|
1779
2034
|
if (i.issues.length) {
|
|
1780
|
-
const a = new (o?.Err ?? e)(i.issues.map((u) =>
|
|
1781
|
-
throw
|
|
2035
|
+
const a = new (o?.Err ?? e)(i.issues.map((u) => M(u, s, L())));
|
|
2036
|
+
throw ut(a, o?.callee), a;
|
|
1782
2037
|
}
|
|
1783
2038
|
return i.value;
|
|
1784
|
-
},
|
|
2039
|
+
}, Bn = /* @__PURE__ */ te(ee), ne = (e) => async (t, n, r, o) => {
|
|
1785
2040
|
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
1786
2041
|
let i = t._zod.run({ value: n, issues: [] }, s);
|
|
1787
2042
|
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
1788
|
-
const a = new (o?.Err ?? e)(i.issues.map((u) =>
|
|
1789
|
-
throw
|
|
2043
|
+
const a = new (o?.Err ?? e)(i.issues.map((u) => M(u, s, L())));
|
|
2044
|
+
throw ut(a, o?.callee), a;
|
|
1790
2045
|
}
|
|
1791
2046
|
return i.value;
|
|
1792
|
-
},
|
|
2047
|
+
}, Gn = /* @__PURE__ */ ne(ee), re = (e) => (t, n, r) => {
|
|
1793
2048
|
const o = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, o);
|
|
1794
2049
|
if (s instanceof Promise)
|
|
1795
|
-
throw new
|
|
2050
|
+
throw new j();
|
|
1796
2051
|
return s.issues.length ? {
|
|
1797
2052
|
success: !1,
|
|
1798
|
-
error: new (e ??
|
|
2053
|
+
error: new (e ?? dt)(s.issues.map((i) => M(i, o, L())))
|
|
1799
2054
|
} : { success: !0, data: s.value };
|
|
1800
|
-
},
|
|
2055
|
+
}, mt = /* @__PURE__ */ re(ee), oe = (e) => async (t, n, r) => {
|
|
1801
2056
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
1802
2057
|
let s = t._zod.run({ value: n, issues: [] }, o);
|
|
1803
2058
|
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
1804
2059
|
success: !1,
|
|
1805
|
-
error: new e(s.issues.map((i) =>
|
|
2060
|
+
error: new e(s.issues.map((i) => M(i, o, L())))
|
|
1806
2061
|
} : { success: !0, data: s.value };
|
|
1807
|
-
},
|
|
2062
|
+
}, ht = /* @__PURE__ */ oe(ee), Yn = (e) => (t, n, r) => {
|
|
1808
2063
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1809
|
-
return
|
|
1810
|
-
},
|
|
2064
|
+
return te(e)(t, n, o);
|
|
2065
|
+
}, Kn = (e) => (t, n, r) => te(e)(t, n, r), qn = (e) => async (t, n, r) => {
|
|
1811
2066
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1812
|
-
return
|
|
1813
|
-
},
|
|
2067
|
+
return ne(e)(t, n, o);
|
|
2068
|
+
}, Xn = (e) => async (t, n, r) => ne(e)(t, n, r), Hn = (e) => (t, n, r) => {
|
|
1814
2069
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1815
|
-
return
|
|
1816
|
-
},
|
|
2070
|
+
return re(e)(t, n, o);
|
|
2071
|
+
}, Qn = (e) => (t, n, r) => re(e)(t, n, r), er = (e) => async (t, n, r) => {
|
|
1817
2072
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1818
|
-
return
|
|
1819
|
-
},
|
|
1820
|
-
function
|
|
2073
|
+
return oe(e)(t, n, o);
|
|
2074
|
+
}, tr = (e) => async (t, n, r) => oe(e)(t, n, r), nr = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Ze = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, rr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, or = /^(?:(?: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])$/, sr = /^(([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}|:))$/, ir = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, ft = "(?:(?:\\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])))", ar = /* @__PURE__ */ new RegExp(`^${ft}$`);
|
|
2075
|
+
function yt(e) {
|
|
1821
2076
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
1822
2077
|
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+)?)?`;
|
|
1823
2078
|
}
|
|
1824
|
-
function
|
|
1825
|
-
return new RegExp(`^${
|
|
2079
|
+
function ur(e) {
|
|
2080
|
+
return new RegExp(`^${yt(e)}$`);
|
|
1826
2081
|
}
|
|
1827
|
-
function
|
|
1828
|
-
const t =
|
|
2082
|
+
function lr(e) {
|
|
2083
|
+
const t = yt({ precision: e.precision }), n = ["Z"];
|
|
1829
2084
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
1830
2085
|
const r = `${t}(?:${n.join("|")})`;
|
|
1831
|
-
return new RegExp(`^${
|
|
2086
|
+
return new RegExp(`^${ft}T(?:${r})$`);
|
|
1832
2087
|
}
|
|
1833
|
-
const
|
|
2088
|
+
const cr = (e) => {
|
|
1834
2089
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
1835
2090
|
return new RegExp(`^${t}$`);
|
|
1836
|
-
},
|
|
2091
|
+
}, pr = /^-?\d+$/, dr = /^-?\d+(?:\.\d+)?$/, mr = /^(?:true|false)$/i, hr = /^[^A-Z]*$/, fr = /^[^a-z]*$/, $ = /* @__PURE__ */ c("$ZodCheck", (e, t) => {
|
|
1837
2092
|
var n;
|
|
1838
2093
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
1839
|
-
}),
|
|
2094
|
+
}), bt = {
|
|
1840
2095
|
number: "number",
|
|
1841
2096
|
bigint: "bigint",
|
|
1842
2097
|
object: "date"
|
|
1843
|
-
},
|
|
1844
|
-
|
|
1845
|
-
const n =
|
|
2098
|
+
}, yr = /* @__PURE__ */ c("$ZodCheckLessThan", (e, t) => {
|
|
2099
|
+
$.init(e, t);
|
|
2100
|
+
const n = bt[typeof t.value];
|
|
1846
2101
|
e._zod.onattach.push((r) => {
|
|
1847
2102
|
const o = r._zod.bag, s = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
1848
2103
|
t.value < s && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
|
|
@@ -1850,16 +2105,16 @@ const tr = (e) => {
|
|
|
1850
2105
|
(t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
|
|
1851
2106
|
origin: n,
|
|
1852
2107
|
code: "too_big",
|
|
1853
|
-
maximum: t.value,
|
|
2108
|
+
maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
1854
2109
|
input: r.value,
|
|
1855
2110
|
inclusive: t.inclusive,
|
|
1856
2111
|
inst: e,
|
|
1857
2112
|
continue: !t.abort
|
|
1858
2113
|
});
|
|
1859
2114
|
};
|
|
1860
|
-
}),
|
|
1861
|
-
|
|
1862
|
-
const n =
|
|
2115
|
+
}), br = /* @__PURE__ */ c("$ZodCheckGreaterThan", (e, t) => {
|
|
2116
|
+
$.init(e, t);
|
|
2117
|
+
const n = bt[typeof t.value];
|
|
1863
2118
|
e._zod.onattach.push((r) => {
|
|
1864
2119
|
const o = r._zod.bag, s = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
1865
2120
|
t.value > s && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
|
|
@@ -1867,19 +2122,19 @@ const tr = (e) => {
|
|
|
1867
2122
|
(t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
|
|
1868
2123
|
origin: n,
|
|
1869
2124
|
code: "too_small",
|
|
1870
|
-
minimum: t.value,
|
|
2125
|
+
minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
1871
2126
|
input: r.value,
|
|
1872
2127
|
inclusive: t.inclusive,
|
|
1873
2128
|
inst: e,
|
|
1874
2129
|
continue: !t.abort
|
|
1875
2130
|
});
|
|
1876
2131
|
};
|
|
1877
|
-
}),
|
|
1878
|
-
|
|
1879
|
-
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] =
|
|
2132
|
+
}), gr = /* @__PURE__ */ c("$ZodCheckNumberFormat", (e, t) => {
|
|
2133
|
+
$.init(e, t), t.format = t.format || "float64";
|
|
2134
|
+
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] = Un[t.format];
|
|
1880
2135
|
e._zod.onattach.push((i) => {
|
|
1881
2136
|
const a = i._zod.bag;
|
|
1882
|
-
a.format = t.format, a.minimum = o, a.maximum = s, n && (a.pattern =
|
|
2137
|
+
a.format = t.format, a.minimum = o, a.maximum = s, n && (a.pattern = pr);
|
|
1883
2138
|
}), e._zod.check = (i) => {
|
|
1884
2139
|
const a = i.value;
|
|
1885
2140
|
if (n) {
|
|
@@ -1902,6 +2157,7 @@ const tr = (e) => {
|
|
|
1902
2157
|
note: "Integers must be within the safe integer range.",
|
|
1903
2158
|
inst: e,
|
|
1904
2159
|
origin: r,
|
|
2160
|
+
inclusive: !0,
|
|
1905
2161
|
continue: !t.abort
|
|
1906
2162
|
}) : i.issues.push({
|
|
1907
2163
|
input: a,
|
|
@@ -1910,6 +2166,7 @@ const tr = (e) => {
|
|
|
1910
2166
|
note: "Integers must be within the safe integer range.",
|
|
1911
2167
|
inst: e,
|
|
1912
2168
|
origin: r,
|
|
2169
|
+
inclusive: !0,
|
|
1913
2170
|
continue: !t.abort
|
|
1914
2171
|
});
|
|
1915
2172
|
return;
|
|
@@ -1928,14 +2185,16 @@ const tr = (e) => {
|
|
|
1928
2185
|
input: a,
|
|
1929
2186
|
code: "too_big",
|
|
1930
2187
|
maximum: s,
|
|
1931
|
-
|
|
2188
|
+
inclusive: !0,
|
|
2189
|
+
inst: e,
|
|
2190
|
+
continue: !t.abort
|
|
1932
2191
|
});
|
|
1933
2192
|
};
|
|
1934
|
-
}),
|
|
2193
|
+
}), _r = /* @__PURE__ */ c("$ZodCheckMaxLength", (e, t) => {
|
|
1935
2194
|
var n;
|
|
1936
|
-
|
|
2195
|
+
$.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1937
2196
|
const o = r.value;
|
|
1938
|
-
return !
|
|
2197
|
+
return !_e(o) && o.length !== void 0;
|
|
1939
2198
|
}), e._zod.onattach.push((r) => {
|
|
1940
2199
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1941
2200
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
@@ -1943,7 +2202,7 @@ const tr = (e) => {
|
|
|
1943
2202
|
const o = r.value;
|
|
1944
2203
|
if (o.length <= t.maximum)
|
|
1945
2204
|
return;
|
|
1946
|
-
const i =
|
|
2205
|
+
const i = ke(o);
|
|
1947
2206
|
r.issues.push({
|
|
1948
2207
|
origin: i,
|
|
1949
2208
|
code: "too_big",
|
|
@@ -1954,11 +2213,11 @@ const tr = (e) => {
|
|
|
1954
2213
|
continue: !t.abort
|
|
1955
2214
|
});
|
|
1956
2215
|
};
|
|
1957
|
-
}),
|
|
2216
|
+
}), vr = /* @__PURE__ */ c("$ZodCheckMinLength", (e, t) => {
|
|
1958
2217
|
var n;
|
|
1959
|
-
|
|
2218
|
+
$.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1960
2219
|
const o = r.value;
|
|
1961
|
-
return !
|
|
2220
|
+
return !_e(o) && o.length !== void 0;
|
|
1962
2221
|
}), e._zod.onattach.push((r) => {
|
|
1963
2222
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1964
2223
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
@@ -1966,7 +2225,7 @@ const tr = (e) => {
|
|
|
1966
2225
|
const o = r.value;
|
|
1967
2226
|
if (o.length >= t.minimum)
|
|
1968
2227
|
return;
|
|
1969
|
-
const i =
|
|
2228
|
+
const i = ke(o);
|
|
1970
2229
|
r.issues.push({
|
|
1971
2230
|
origin: i,
|
|
1972
2231
|
code: "too_small",
|
|
@@ -1977,11 +2236,11 @@ const tr = (e) => {
|
|
|
1977
2236
|
continue: !t.abort
|
|
1978
2237
|
});
|
|
1979
2238
|
};
|
|
1980
|
-
}),
|
|
2239
|
+
}), Tr = /* @__PURE__ */ c("$ZodCheckLengthEquals", (e, t) => {
|
|
1981
2240
|
var n;
|
|
1982
|
-
|
|
2241
|
+
$.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1983
2242
|
const o = r.value;
|
|
1984
|
-
return !
|
|
2243
|
+
return !_e(o) && o.length !== void 0;
|
|
1985
2244
|
}), e._zod.onattach.push((r) => {
|
|
1986
2245
|
const o = r._zod.bag;
|
|
1987
2246
|
o.minimum = t.length, o.maximum = t.length, o.length = t.length;
|
|
@@ -1989,7 +2248,7 @@ const tr = (e) => {
|
|
|
1989
2248
|
const o = r.value, s = o.length;
|
|
1990
2249
|
if (s === t.length)
|
|
1991
2250
|
return;
|
|
1992
|
-
const i =
|
|
2251
|
+
const i = ke(o), a = s > t.length;
|
|
1993
2252
|
r.issues.push({
|
|
1994
2253
|
origin: i,
|
|
1995
2254
|
...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
@@ -2000,9 +2259,9 @@ const tr = (e) => {
|
|
|
2000
2259
|
continue: !t.abort
|
|
2001
2260
|
});
|
|
2002
2261
|
};
|
|
2003
|
-
}),
|
|
2262
|
+
}), se = /* @__PURE__ */ c("$ZodCheckStringFormat", (e, t) => {
|
|
2004
2263
|
var n, r;
|
|
2005
|
-
|
|
2264
|
+
$.init(e, t), e._zod.onattach.push((o) => {
|
|
2006
2265
|
const s = o._zod.bag;
|
|
2007
2266
|
s.format = t.format, t.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(t.pattern));
|
|
2008
2267
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
|
|
@@ -2017,8 +2276,8 @@ const tr = (e) => {
|
|
|
2017
2276
|
});
|
|
2018
2277
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
2019
2278
|
});
|
|
2020
|
-
}),
|
|
2021
|
-
|
|
2279
|
+
}), kr = /* @__PURE__ */ c("$ZodCheckRegex", (e, t) => {
|
|
2280
|
+
se.init(e, t), e._zod.check = (n) => {
|
|
2022
2281
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
2023
2282
|
origin: "string",
|
|
2024
2283
|
code: "invalid_format",
|
|
@@ -2029,13 +2288,13 @@ const tr = (e) => {
|
|
|
2029
2288
|
continue: !t.abort
|
|
2030
2289
|
});
|
|
2031
2290
|
};
|
|
2032
|
-
}),
|
|
2033
|
-
t.pattern ?? (t.pattern =
|
|
2034
|
-
}),
|
|
2035
|
-
t.pattern ?? (t.pattern =
|
|
2036
|
-
}),
|
|
2037
|
-
|
|
2038
|
-
const n =
|
|
2291
|
+
}), wr = /* @__PURE__ */ c("$ZodCheckLowerCase", (e, t) => {
|
|
2292
|
+
t.pattern ?? (t.pattern = hr), se.init(e, t);
|
|
2293
|
+
}), Sr = /* @__PURE__ */ c("$ZodCheckUpperCase", (e, t) => {
|
|
2294
|
+
t.pattern ?? (t.pattern = fr), se.init(e, t);
|
|
2295
|
+
}), Ar = /* @__PURE__ */ c("$ZodCheckIncludes", (e, t) => {
|
|
2296
|
+
$.init(e, t);
|
|
2297
|
+
const n = Te(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
2039
2298
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
2040
2299
|
const s = o._zod.bag;
|
|
2041
2300
|
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
|
|
@@ -2050,9 +2309,9 @@ const tr = (e) => {
|
|
|
2050
2309
|
continue: !t.abort
|
|
2051
2310
|
});
|
|
2052
2311
|
};
|
|
2053
|
-
}),
|
|
2054
|
-
|
|
2055
|
-
const n = new RegExp(`^${
|
|
2312
|
+
}), Er = /* @__PURE__ */ c("$ZodCheckStartsWith", (e, t) => {
|
|
2313
|
+
$.init(e, t);
|
|
2314
|
+
const n = new RegExp(`^${Te(t.prefix)}.*`);
|
|
2056
2315
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2057
2316
|
const o = r._zod.bag;
|
|
2058
2317
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -2067,9 +2326,9 @@ const tr = (e) => {
|
|
|
2067
2326
|
continue: !t.abort
|
|
2068
2327
|
});
|
|
2069
2328
|
};
|
|
2070
|
-
}),
|
|
2071
|
-
|
|
2072
|
-
const n = new RegExp(`.*${
|
|
2329
|
+
}), zr = /* @__PURE__ */ c("$ZodCheckEndsWith", (e, t) => {
|
|
2330
|
+
$.init(e, t);
|
|
2331
|
+
const n = new RegExp(`.*${Te(t.suffix)}$`);
|
|
2073
2332
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2074
2333
|
const o = r._zod.bag;
|
|
2075
2334
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -2084,17 +2343,17 @@ const tr = (e) => {
|
|
|
2084
2343
|
continue: !t.abort
|
|
2085
2344
|
});
|
|
2086
2345
|
};
|
|
2087
|
-
}),
|
|
2088
|
-
|
|
2346
|
+
}), Or = /* @__PURE__ */ c("$ZodCheckOverwrite", (e, t) => {
|
|
2347
|
+
$.init(e, t), e._zod.check = (n) => {
|
|
2089
2348
|
n.value = t.tx(n.value);
|
|
2090
2349
|
};
|
|
2091
|
-
}),
|
|
2350
|
+
}), $r = {
|
|
2092
2351
|
major: 4,
|
|
2093
|
-
minor:
|
|
2094
|
-
patch:
|
|
2095
|
-
},
|
|
2352
|
+
minor: 3,
|
|
2353
|
+
patch: 6
|
|
2354
|
+
}, k = /* @__PURE__ */ c("$ZodType", (e, t) => {
|
|
2096
2355
|
var n;
|
|
2097
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
2356
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = $r;
|
|
2098
2357
|
const r = [...e._zod.def.checks ?? []];
|
|
2099
2358
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
2100
2359
|
for (const o of r)
|
|
@@ -2106,68 +2365,68 @@ const tr = (e) => {
|
|
|
2106
2365
|
});
|
|
2107
2366
|
else {
|
|
2108
2367
|
const o = (i, a, u) => {
|
|
2109
|
-
let
|
|
2368
|
+
let l = W(i), p;
|
|
2110
2369
|
for (const d of a) {
|
|
2111
2370
|
if (d._zod.def.when) {
|
|
2112
2371
|
if (!d._zod.def.when(i))
|
|
2113
2372
|
continue;
|
|
2114
|
-
} else if (
|
|
2373
|
+
} else if (l)
|
|
2115
2374
|
continue;
|
|
2116
|
-
const
|
|
2117
|
-
if (
|
|
2118
|
-
throw new
|
|
2119
|
-
if (p ||
|
|
2375
|
+
const m = i.issues.length, y = d._zod.check(i);
|
|
2376
|
+
if (y instanceof Promise && u?.async === !1)
|
|
2377
|
+
throw new j();
|
|
2378
|
+
if (p || y instanceof Promise)
|
|
2120
2379
|
p = (p ?? Promise.resolve()).then(async () => {
|
|
2121
|
-
await
|
|
2380
|
+
await y, i.issues.length !== m && (l || (l = W(i, m)));
|
|
2122
2381
|
});
|
|
2123
2382
|
else {
|
|
2124
|
-
if (i.issues.length ===
|
|
2383
|
+
if (i.issues.length === m)
|
|
2125
2384
|
continue;
|
|
2126
|
-
|
|
2385
|
+
l || (l = W(i, m));
|
|
2127
2386
|
}
|
|
2128
2387
|
}
|
|
2129
2388
|
return p ? p.then(() => i) : i;
|
|
2130
2389
|
}, s = (i, a, u) => {
|
|
2131
|
-
if (
|
|
2390
|
+
if (W(i))
|
|
2132
2391
|
return i.aborted = !0, i;
|
|
2133
|
-
const
|
|
2134
|
-
if (
|
|
2392
|
+
const l = o(a, r, u);
|
|
2393
|
+
if (l instanceof Promise) {
|
|
2135
2394
|
if (u.async === !1)
|
|
2136
|
-
throw new
|
|
2137
|
-
return
|
|
2395
|
+
throw new j();
|
|
2396
|
+
return l.then((p) => e._zod.parse(p, u));
|
|
2138
2397
|
}
|
|
2139
|
-
return e._zod.parse(
|
|
2398
|
+
return e._zod.parse(l, u);
|
|
2140
2399
|
};
|
|
2141
2400
|
e._zod.run = (i, a) => {
|
|
2142
2401
|
if (a.skipChecks)
|
|
2143
2402
|
return e._zod.parse(i, a);
|
|
2144
2403
|
if (a.direction === "backward") {
|
|
2145
|
-
const
|
|
2146
|
-
return
|
|
2404
|
+
const l = e._zod.parse({ value: i.value, issues: [] }, { ...a, skipChecks: !0 });
|
|
2405
|
+
return l instanceof Promise ? l.then((p) => s(p, i, a)) : s(l, i, a);
|
|
2147
2406
|
}
|
|
2148
2407
|
const u = e._zod.parse(i, a);
|
|
2149
2408
|
if (u instanceof Promise) {
|
|
2150
2409
|
if (a.async === !1)
|
|
2151
|
-
throw new
|
|
2152
|
-
return u.then((
|
|
2410
|
+
throw new j();
|
|
2411
|
+
return u.then((l) => o(l, r, a));
|
|
2153
2412
|
}
|
|
2154
2413
|
return o(u, r, a);
|
|
2155
2414
|
};
|
|
2156
2415
|
}
|
|
2157
|
-
e
|
|
2416
|
+
_(e, "~standard", () => ({
|
|
2158
2417
|
validate: (o) => {
|
|
2159
2418
|
try {
|
|
2160
|
-
const s =
|
|
2419
|
+
const s = mt(e, o);
|
|
2161
2420
|
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
2162
2421
|
} catch {
|
|
2163
|
-
return
|
|
2422
|
+
return ht(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
2164
2423
|
}
|
|
2165
2424
|
},
|
|
2166
2425
|
vendor: "zod",
|
|
2167
2426
|
version: 1
|
|
2168
|
-
};
|
|
2169
|
-
}),
|
|
2170
|
-
|
|
2427
|
+
}));
|
|
2428
|
+
}), we = /* @__PURE__ */ c("$ZodString", (e, t) => {
|
|
2429
|
+
k.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? cr(e._zod.bag), e._zod.parse = (n, r) => {
|
|
2171
2430
|
if (t.coerce)
|
|
2172
2431
|
try {
|
|
2173
2432
|
n.value = String(n.value);
|
|
@@ -2180,9 +2439,9 @@ const tr = (e) => {
|
|
|
2180
2439
|
inst: e
|
|
2181
2440
|
}), n;
|
|
2182
2441
|
};
|
|
2183
|
-
}),
|
|
2184
|
-
|
|
2185
|
-
}),
|
|
2442
|
+
}), C = /* @__PURE__ */ c("$ZodStringFormat", (e, t) => {
|
|
2443
|
+
se.init(e, t), we.init(e, t);
|
|
2444
|
+
}), Pr = /* @__PURE__ */ c("$ZodUUID", (e, t) => {
|
|
2186
2445
|
if (t.version) {
|
|
2187
2446
|
const r = {
|
|
2188
2447
|
v1: 1,
|
|
@@ -2199,11 +2458,11 @@ const tr = (e) => {
|
|
|
2199
2458
|
t.pattern ?? (t.pattern = Ze(r));
|
|
2200
2459
|
} else
|
|
2201
2460
|
t.pattern ?? (t.pattern = Ze());
|
|
2202
|
-
|
|
2203
|
-
}),
|
|
2204
|
-
t.pattern ?? (t.pattern =
|
|
2205
|
-
}),
|
|
2206
|
-
|
|
2461
|
+
C.init(e, t);
|
|
2462
|
+
}), Ir = /* @__PURE__ */ c("$ZodEmail", (e, t) => {
|
|
2463
|
+
t.pattern ?? (t.pattern = rr), C.init(e, t);
|
|
2464
|
+
}), Cr = /* @__PURE__ */ c("$ZodURL", (e, t) => {
|
|
2465
|
+
C.init(e, t), e._zod.check = (n) => {
|
|
2207
2466
|
try {
|
|
2208
2467
|
const r = n.value.trim(), o = new URL(r);
|
|
2209
2468
|
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
|
|
@@ -2234,18 +2493,18 @@ const tr = (e) => {
|
|
|
2234
2493
|
});
|
|
2235
2494
|
}
|
|
2236
2495
|
};
|
|
2237
|
-
}),
|
|
2238
|
-
t.pattern ?? (t.pattern =
|
|
2239
|
-
}),
|
|
2240
|
-
t.pattern ?? (t.pattern =
|
|
2241
|
-
}),
|
|
2242
|
-
t.pattern ?? (t.pattern =
|
|
2243
|
-
}),
|
|
2244
|
-
t.pattern ?? (t.pattern =
|
|
2245
|
-
}),
|
|
2246
|
-
t.pattern ?? (t.pattern =
|
|
2247
|
-
}),
|
|
2248
|
-
t.pattern ?? (t.pattern =
|
|
2496
|
+
}), Nr = /* @__PURE__ */ c("$ZodISODateTime", (e, t) => {
|
|
2497
|
+
t.pattern ?? (t.pattern = lr(t)), C.init(e, t);
|
|
2498
|
+
}), Zr = /* @__PURE__ */ c("$ZodISODate", (e, t) => {
|
|
2499
|
+
t.pattern ?? (t.pattern = ar), C.init(e, t);
|
|
2500
|
+
}), Dr = /* @__PURE__ */ c("$ZodISOTime", (e, t) => {
|
|
2501
|
+
t.pattern ?? (t.pattern = ur(t)), C.init(e, t);
|
|
2502
|
+
}), Lr = /* @__PURE__ */ c("$ZodISODuration", (e, t) => {
|
|
2503
|
+
t.pattern ?? (t.pattern = nr), C.init(e, t);
|
|
2504
|
+
}), Mr = /* @__PURE__ */ c("$ZodIPv4", (e, t) => {
|
|
2505
|
+
t.pattern ?? (t.pattern = or), C.init(e, t), e._zod.bag.format = "ipv4";
|
|
2506
|
+
}), Rr = /* @__PURE__ */ c("$ZodIPv6", (e, t) => {
|
|
2507
|
+
t.pattern ?? (t.pattern = sr), C.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
2249
2508
|
try {
|
|
2250
2509
|
new URL(`http://[${n.value}]`);
|
|
2251
2510
|
} catch {
|
|
@@ -2258,8 +2517,8 @@ const tr = (e) => {
|
|
|
2258
2517
|
});
|
|
2259
2518
|
}
|
|
2260
2519
|
};
|
|
2261
|
-
}),
|
|
2262
|
-
|
|
2520
|
+
}), Wr = /* @__PURE__ */ c("$ZodCustomStringFormat", (e, t) => {
|
|
2521
|
+
C.init(e, t), e._zod.check = (n) => {
|
|
2263
2522
|
t.fn(n.value) || n.issues.push({
|
|
2264
2523
|
code: "invalid_format",
|
|
2265
2524
|
format: t.format,
|
|
@@ -2268,8 +2527,8 @@ const tr = (e) => {
|
|
|
2268
2527
|
continue: !t.abort
|
|
2269
2528
|
});
|
|
2270
2529
|
};
|
|
2271
|
-
}),
|
|
2272
|
-
|
|
2530
|
+
}), gt = /* @__PURE__ */ c("$ZodNumber", (e, t) => {
|
|
2531
|
+
k.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? dr, e._zod.parse = (n, r) => {
|
|
2273
2532
|
if (t.coerce)
|
|
2274
2533
|
try {
|
|
2275
2534
|
n.value = Number(n.value);
|
|
@@ -2287,10 +2546,10 @@ const tr = (e) => {
|
|
|
2287
2546
|
...s ? { received: s } : {}
|
|
2288
2547
|
}), n;
|
|
2289
2548
|
};
|
|
2290
|
-
}),
|
|
2291
|
-
|
|
2292
|
-
}),
|
|
2293
|
-
|
|
2549
|
+
}), jr = /* @__PURE__ */ c("$ZodNumberFormat", (e, t) => {
|
|
2550
|
+
gr.init(e, t), gt.init(e, t);
|
|
2551
|
+
}), Fr = /* @__PURE__ */ c("$ZodBoolean", (e, t) => {
|
|
2552
|
+
k.init(e, t), e._zod.pattern = mr, e._zod.parse = (n, r) => {
|
|
2294
2553
|
if (t.coerce)
|
|
2295
2554
|
try {
|
|
2296
2555
|
n.value = !!n.value;
|
|
@@ -2304,14 +2563,14 @@ const tr = (e) => {
|
|
|
2304
2563
|
inst: e
|
|
2305
2564
|
}), n;
|
|
2306
2565
|
};
|
|
2307
|
-
}),
|
|
2308
|
-
|
|
2566
|
+
}), Ur = /* @__PURE__ */ c("$ZodAny", (e, t) => {
|
|
2567
|
+
k.init(e, t), e._zod.parse = (n) => n;
|
|
2309
2568
|
});
|
|
2310
|
-
function
|
|
2311
|
-
e.issues.length && t.issues.push(...
|
|
2569
|
+
function De(e, t, n) {
|
|
2570
|
+
e.issues.length && t.issues.push(...xn(n, e.issues)), t.value[n] = e.value;
|
|
2312
2571
|
}
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2572
|
+
const _t = /* @__PURE__ */ c("$ZodArray", (e, t) => {
|
|
2573
|
+
k.init(e, t), e._zod.parse = (n, r) => {
|
|
2315
2574
|
const o = n.value;
|
|
2316
2575
|
if (!Array.isArray(o))
|
|
2317
2576
|
return n.issues.push({
|
|
@@ -2327,31 +2586,31 @@ const ht = /* @__PURE__ */ l("$ZodArray", (e, t) => {
|
|
|
2327
2586
|
value: a,
|
|
2328
2587
|
issues: []
|
|
2329
2588
|
}, r);
|
|
2330
|
-
u instanceof Promise ? s.push(u.then((
|
|
2589
|
+
u instanceof Promise ? s.push(u.then((l) => De(l, n, i))) : De(u, n, i);
|
|
2331
2590
|
}
|
|
2332
2591
|
return s.length ? Promise.all(s).then(() => n) : n;
|
|
2333
2592
|
};
|
|
2334
2593
|
});
|
|
2335
|
-
function
|
|
2594
|
+
function Le(e, t, n, r) {
|
|
2336
2595
|
for (const s of e)
|
|
2337
2596
|
if (s.issues.length === 0)
|
|
2338
2597
|
return t.value = s.value, t;
|
|
2339
|
-
const o = e.filter((s) => !
|
|
2598
|
+
const o = e.filter((s) => !W(s));
|
|
2340
2599
|
return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
|
|
2341
2600
|
code: "invalid_union",
|
|
2342
2601
|
input: t.value,
|
|
2343
2602
|
inst: n,
|
|
2344
|
-
errors: e.map((s) => s.issues.map((i) =>
|
|
2603
|
+
errors: e.map((s) => s.issues.map((i) => M(i, r, L())))
|
|
2345
2604
|
}), t);
|
|
2346
2605
|
}
|
|
2347
|
-
const
|
|
2348
|
-
|
|
2606
|
+
const xr = /* @__PURE__ */ c("$ZodUnion", (e, t) => {
|
|
2607
|
+
k.init(e, t), _(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), _(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), _(e._zod, "values", () => {
|
|
2349
2608
|
if (t.options.every((o) => o._zod.values))
|
|
2350
2609
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
2351
|
-
}),
|
|
2610
|
+
}), _(e._zod, "pattern", () => {
|
|
2352
2611
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
2353
2612
|
const o = t.options.map((s) => s._zod.pattern);
|
|
2354
|
-
return new RegExp(`^(${o.map((s) =>
|
|
2613
|
+
return new RegExp(`^(${o.map((s) => ve(s.source)).join("|")})$`);
|
|
2355
2614
|
}
|
|
2356
2615
|
});
|
|
2357
2616
|
const n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
@@ -2361,35 +2620,35 @@ const Lr = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
|
2361
2620
|
let i = !1;
|
|
2362
2621
|
const a = [];
|
|
2363
2622
|
for (const u of t.options) {
|
|
2364
|
-
const
|
|
2623
|
+
const l = u._zod.run({
|
|
2365
2624
|
value: o.value,
|
|
2366
2625
|
issues: []
|
|
2367
2626
|
}, s);
|
|
2368
|
-
if (
|
|
2369
|
-
a.push(
|
|
2627
|
+
if (l instanceof Promise)
|
|
2628
|
+
a.push(l), i = !0;
|
|
2370
2629
|
else {
|
|
2371
|
-
if (
|
|
2372
|
-
return
|
|
2373
|
-
a.push(
|
|
2630
|
+
if (l.issues.length === 0)
|
|
2631
|
+
return l;
|
|
2632
|
+
a.push(l);
|
|
2374
2633
|
}
|
|
2375
2634
|
}
|
|
2376
|
-
return i ? Promise.all(a).then((u) =>
|
|
2635
|
+
return i ? Promise.all(a).then((u) => Le(u, o, e, s)) : Le(a, o, e, s);
|
|
2377
2636
|
};
|
|
2378
|
-
}),
|
|
2379
|
-
|
|
2637
|
+
}), Vr = /* @__PURE__ */ c("$ZodIntersection", (e, t) => {
|
|
2638
|
+
k.init(e, t), e._zod.parse = (n, r) => {
|
|
2380
2639
|
const o = n.value, s = t.left._zod.run({ value: o, issues: [] }, r), i = t.right._zod.run({ value: o, issues: [] }, r);
|
|
2381
|
-
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u,
|
|
2640
|
+
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, l]) => Me(n, u, l)) : Me(n, s, i);
|
|
2382
2641
|
};
|
|
2383
2642
|
});
|
|
2384
|
-
function
|
|
2643
|
+
function he(e, t) {
|
|
2385
2644
|
if (e === t)
|
|
2386
2645
|
return { valid: !0, data: e };
|
|
2387
2646
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
2388
2647
|
return { valid: !0, data: e };
|
|
2389
|
-
if (
|
|
2648
|
+
if (me(e) && me(t)) {
|
|
2390
2649
|
const n = Object.keys(t), r = Object.keys(e).filter((s) => n.indexOf(s) !== -1), o = { ...e, ...t };
|
|
2391
2650
|
for (const s of r) {
|
|
2392
|
-
const i =
|
|
2651
|
+
const i = he(e[s], t[s]);
|
|
2393
2652
|
if (!i.valid)
|
|
2394
2653
|
return {
|
|
2395
2654
|
valid: !1,
|
|
@@ -2404,7 +2663,7 @@ function pe(e, t) {
|
|
|
2404
2663
|
return { valid: !1, mergeErrorPath: [] };
|
|
2405
2664
|
const n = [];
|
|
2406
2665
|
for (let r = 0; r < e.length; r++) {
|
|
2407
|
-
const o = e[r], s = t[r], i =
|
|
2666
|
+
const o = e[r], s = t[r], i = he(o, s);
|
|
2408
2667
|
if (!i.valid)
|
|
2409
2668
|
return {
|
|
2410
2669
|
valid: !1,
|
|
@@ -2416,70 +2675,88 @@ function pe(e, t) {
|
|
|
2416
2675
|
}
|
|
2417
2676
|
return { valid: !1, mergeErrorPath: [] };
|
|
2418
2677
|
}
|
|
2419
|
-
function
|
|
2420
|
-
|
|
2678
|
+
function Me(e, t, n) {
|
|
2679
|
+
const r = /* @__PURE__ */ new Map();
|
|
2680
|
+
let o;
|
|
2681
|
+
for (const a of t.issues)
|
|
2682
|
+
if (a.code === "unrecognized_keys") {
|
|
2683
|
+
o ?? (o = a);
|
|
2684
|
+
for (const u of a.keys)
|
|
2685
|
+
r.has(u) || r.set(u, {}), r.get(u).l = !0;
|
|
2686
|
+
} else
|
|
2687
|
+
e.issues.push(a);
|
|
2688
|
+
for (const a of n.issues)
|
|
2689
|
+
if (a.code === "unrecognized_keys")
|
|
2690
|
+
for (const u of a.keys)
|
|
2691
|
+
r.has(u) || r.set(u, {}), r.get(u).r = !0;
|
|
2692
|
+
else
|
|
2693
|
+
e.issues.push(a);
|
|
2694
|
+
const s = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
|
|
2695
|
+
if (s.length && o && e.issues.push({ ...o, keys: s }), W(e))
|
|
2421
2696
|
return e;
|
|
2422
|
-
const
|
|
2423
|
-
if (!
|
|
2424
|
-
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(
|
|
2425
|
-
return e.value =
|
|
2697
|
+
const i = he(t.value, n.value);
|
|
2698
|
+
if (!i.valid)
|
|
2699
|
+
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
2700
|
+
return e.value = i.data, e;
|
|
2426
2701
|
}
|
|
2427
|
-
const
|
|
2428
|
-
|
|
2702
|
+
const Jr = /* @__PURE__ */ c("$ZodTransform", (e, t) => {
|
|
2703
|
+
k.init(e, t), e._zod.parse = (n, r) => {
|
|
2429
2704
|
if (r.direction === "backward")
|
|
2430
|
-
throw new
|
|
2705
|
+
throw new at(e.constructor.name);
|
|
2431
2706
|
const o = t.transform(n.value, n);
|
|
2432
2707
|
if (r.async)
|
|
2433
2708
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (n.value = i, n));
|
|
2434
2709
|
if (o instanceof Promise)
|
|
2435
|
-
throw new
|
|
2710
|
+
throw new j();
|
|
2436
2711
|
return n.value = o, n;
|
|
2437
2712
|
};
|
|
2438
2713
|
});
|
|
2439
|
-
function
|
|
2714
|
+
function Re(e, t) {
|
|
2440
2715
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
2441
2716
|
}
|
|
2442
|
-
const
|
|
2443
|
-
|
|
2717
|
+
const Se = /* @__PURE__ */ c("$ZodOptional", (e, t) => {
|
|
2718
|
+
k.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", _(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), _(e._zod, "pattern", () => {
|
|
2444
2719
|
const n = t.innerType._zod.pattern;
|
|
2445
|
-
return n ? new RegExp(`^(${
|
|
2720
|
+
return n ? new RegExp(`^(${ve(n.source)})?$`) : void 0;
|
|
2446
2721
|
}), e._zod.parse = (n, r) => {
|
|
2447
2722
|
if (t.innerType._zod.optin === "optional") {
|
|
2448
2723
|
const o = t.innerType._zod.run(n, r);
|
|
2449
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2724
|
+
return o instanceof Promise ? o.then((s) => Re(s, n.value)) : Re(o, n.value);
|
|
2450
2725
|
}
|
|
2451
2726
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
2452
2727
|
};
|
|
2453
|
-
}),
|
|
2454
|
-
|
|
2728
|
+
}), Br = /* @__PURE__ */ c("$ZodExactOptional", (e, t) => {
|
|
2729
|
+
Se.init(e, t), _(e._zod, "values", () => t.innerType._zod.values), _(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
|
|
2730
|
+
}), Gr = /* @__PURE__ */ c("$ZodNullable", (e, t) => {
|
|
2731
|
+
k.init(e, t), _(e._zod, "optin", () => t.innerType._zod.optin), _(e._zod, "optout", () => t.innerType._zod.optout), _(e._zod, "pattern", () => {
|
|
2455
2732
|
const n = t.innerType._zod.pattern;
|
|
2456
|
-
return n ? new RegExp(`^(${
|
|
2457
|
-
}),
|
|
2458
|
-
}),
|
|
2459
|
-
|
|
2733
|
+
return n ? new RegExp(`^(${ve(n.source)}|null)$`) : void 0;
|
|
2734
|
+
}), _(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
2735
|
+
}), Yr = /* @__PURE__ */ c("$ZodDefault", (e, t) => {
|
|
2736
|
+
k.init(e, t), e._zod.optin = "optional", _(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
2460
2737
|
if (r.direction === "backward")
|
|
2461
2738
|
return t.innerType._zod.run(n, r);
|
|
2462
2739
|
if (n.value === void 0)
|
|
2463
2740
|
return n.value = t.defaultValue, n;
|
|
2464
2741
|
const o = t.innerType._zod.run(n, r);
|
|
2465
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2742
|
+
return o instanceof Promise ? o.then((s) => We(s, t)) : We(o, t);
|
|
2466
2743
|
};
|
|
2467
2744
|
});
|
|
2468
|
-
function
|
|
2745
|
+
function We(e, t) {
|
|
2469
2746
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
2470
2747
|
}
|
|
2471
|
-
const
|
|
2472
|
-
|
|
2473
|
-
}),
|
|
2474
|
-
|
|
2748
|
+
const Kr = /* @__PURE__ */ c("$ZodPrefault", (e, t) => {
|
|
2749
|
+
k.init(e, t), e._zod.optin = "optional", _(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
|
|
2750
|
+
}), qr = /* @__PURE__ */ c("$ZodNonOptional", (e, t) => {
|
|
2751
|
+
k.init(e, t), _(e._zod, "values", () => {
|
|
2475
2752
|
const n = t.innerType._zod.values;
|
|
2476
2753
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
2477
2754
|
}), e._zod.parse = (n, r) => {
|
|
2478
2755
|
const o = t.innerType._zod.run(n, r);
|
|
2479
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2756
|
+
return o instanceof Promise ? o.then((s) => je(s, e)) : je(o, e);
|
|
2480
2757
|
};
|
|
2481
2758
|
});
|
|
2482
|
-
function
|
|
2759
|
+
function je(e, t) {
|
|
2483
2760
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
2484
2761
|
code: "invalid_type",
|
|
2485
2762
|
expected: "nonoptional",
|
|
@@ -2487,58 +2764,58 @@ function Me(e, t) {
|
|
|
2487
2764
|
inst: t
|
|
2488
2765
|
}), e;
|
|
2489
2766
|
}
|
|
2490
|
-
const
|
|
2491
|
-
|
|
2767
|
+
const Xr = /* @__PURE__ */ c("$ZodCatch", (e, t) => {
|
|
2768
|
+
k.init(e, t), _(e._zod, "optin", () => t.innerType._zod.optin), _(e._zod, "optout", () => t.innerType._zod.optout), _(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
2492
2769
|
if (r.direction === "backward")
|
|
2493
2770
|
return t.innerType._zod.run(n, r);
|
|
2494
2771
|
const o = t.innerType._zod.run(n, r);
|
|
2495
2772
|
return o instanceof Promise ? o.then((s) => (n.value = s.value, s.issues.length && (n.value = t.catchValue({
|
|
2496
2773
|
...n,
|
|
2497
2774
|
error: {
|
|
2498
|
-
issues: s.issues.map((i) =>
|
|
2775
|
+
issues: s.issues.map((i) => M(i, r, L()))
|
|
2499
2776
|
},
|
|
2500
2777
|
input: n.value
|
|
2501
2778
|
}), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
|
|
2502
2779
|
...n,
|
|
2503
2780
|
error: {
|
|
2504
|
-
issues: o.issues.map((s) =>
|
|
2781
|
+
issues: o.issues.map((s) => M(s, r, L()))
|
|
2505
2782
|
},
|
|
2506
2783
|
input: n.value
|
|
2507
2784
|
}), n.issues = []), n);
|
|
2508
2785
|
};
|
|
2509
|
-
}),
|
|
2510
|
-
|
|
2786
|
+
}), Hr = /* @__PURE__ */ c("$ZodPipe", (e, t) => {
|
|
2787
|
+
k.init(e, t), _(e._zod, "values", () => t.in._zod.values), _(e._zod, "optin", () => t.in._zod.optin), _(e._zod, "optout", () => t.out._zod.optout), _(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
2511
2788
|
if (r.direction === "backward") {
|
|
2512
2789
|
const s = t.out._zod.run(n, r);
|
|
2513
|
-
return s instanceof Promise ? s.then((i) =>
|
|
2790
|
+
return s instanceof Promise ? s.then((i) => q(i, t.in, r)) : q(s, t.in, r);
|
|
2514
2791
|
}
|
|
2515
2792
|
const o = t.in._zod.run(n, r);
|
|
2516
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2793
|
+
return o instanceof Promise ? o.then((s) => q(s, t.out, r)) : q(o, t.out, r);
|
|
2517
2794
|
};
|
|
2518
2795
|
});
|
|
2519
|
-
function
|
|
2796
|
+
function q(e, t, n) {
|
|
2520
2797
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
2521
2798
|
}
|
|
2522
|
-
const
|
|
2523
|
-
|
|
2799
|
+
const Qr = /* @__PURE__ */ c("$ZodReadonly", (e, t) => {
|
|
2800
|
+
k.init(e, t), _(e._zod, "propValues", () => t.innerType._zod.propValues), _(e._zod, "values", () => t.innerType._zod.values), _(e._zod, "optin", () => t.innerType?._zod?.optin), _(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
|
|
2524
2801
|
if (r.direction === "backward")
|
|
2525
2802
|
return t.innerType._zod.run(n, r);
|
|
2526
2803
|
const o = t.innerType._zod.run(n, r);
|
|
2527
|
-
return o instanceof Promise ? o.then(
|
|
2804
|
+
return o instanceof Promise ? o.then(Fe) : Fe(o);
|
|
2528
2805
|
};
|
|
2529
2806
|
});
|
|
2530
|
-
function
|
|
2807
|
+
function Fe(e) {
|
|
2531
2808
|
return e.value = Object.freeze(e.value), e;
|
|
2532
2809
|
}
|
|
2533
|
-
const
|
|
2534
|
-
|
|
2810
|
+
const vt = /* @__PURE__ */ c("$ZodCustom", (e, t) => {
|
|
2811
|
+
$.init(e, t), k.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
2535
2812
|
const r = n.value, o = t.fn(r);
|
|
2536
2813
|
if (o instanceof Promise)
|
|
2537
|
-
return o.then((s) =>
|
|
2538
|
-
|
|
2814
|
+
return o.then((s) => Ue(s, n, r, e));
|
|
2815
|
+
Ue(o, n, r, e);
|
|
2539
2816
|
};
|
|
2540
2817
|
});
|
|
2541
|
-
function
|
|
2818
|
+
function Ue(e, t, n, r) {
|
|
2542
2819
|
if (!e) {
|
|
2543
2820
|
const o = {
|
|
2544
2821
|
code: "custom",
|
|
@@ -2550,22 +2827,17 @@ function xe(e, t, n, r) {
|
|
|
2550
2827
|
continue: !r._zod.def.abort
|
|
2551
2828
|
// params: inst._zod.def.params,
|
|
2552
2829
|
};
|
|
2553
|
-
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(
|
|
2830
|
+
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(B(o));
|
|
2554
2831
|
}
|
|
2555
2832
|
}
|
|
2556
|
-
var
|
|
2557
|
-
class
|
|
2833
|
+
var xe;
|
|
2834
|
+
class eo {
|
|
2558
2835
|
constructor() {
|
|
2559
2836
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
2560
2837
|
}
|
|
2561
2838
|
add(t, ...n) {
|
|
2562
2839
|
const r = n[0];
|
|
2563
|
-
|
|
2564
|
-
if (this._idmap.has(r.id))
|
|
2565
|
-
throw new Error(`ID ${r.id} already exists in the registry`);
|
|
2566
|
-
this._idmap.set(r.id, t);
|
|
2567
|
-
}
|
|
2568
|
-
return this;
|
|
2840
|
+
return this._map.set(t, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, t), this;
|
|
2569
2841
|
}
|
|
2570
2842
|
clear() {
|
|
2571
2843
|
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
@@ -2588,63 +2860,70 @@ class Vr {
|
|
|
2588
2860
|
return this._map.has(t);
|
|
2589
2861
|
}
|
|
2590
2862
|
}
|
|
2591
|
-
function
|
|
2592
|
-
return new
|
|
2863
|
+
function to() {
|
|
2864
|
+
return new eo();
|
|
2593
2865
|
}
|
|
2594
|
-
(
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2866
|
+
(xe = globalThis).__zod_globalRegistry ?? (xe.__zod_globalRegistry = to());
|
|
2867
|
+
const J = globalThis.__zod_globalRegistry;
|
|
2868
|
+
// @__NO_SIDE_EFFECTS__
|
|
2869
|
+
function no(e, t) {
|
|
2597
2870
|
return new e({
|
|
2598
2871
|
type: "string",
|
|
2599
|
-
...
|
|
2872
|
+
...f(t)
|
|
2600
2873
|
});
|
|
2601
2874
|
}
|
|
2602
|
-
|
|
2875
|
+
// @__NO_SIDE_EFFECTS__
|
|
2876
|
+
function ro(e, t) {
|
|
2603
2877
|
return new e({
|
|
2604
2878
|
type: "string",
|
|
2605
2879
|
format: "email",
|
|
2606
2880
|
check: "string_format",
|
|
2607
2881
|
abort: !1,
|
|
2608
|
-
...
|
|
2882
|
+
...f(t)
|
|
2609
2883
|
});
|
|
2610
2884
|
}
|
|
2611
|
-
|
|
2885
|
+
// @__NO_SIDE_EFFECTS__
|
|
2886
|
+
function oo(e, t) {
|
|
2612
2887
|
return new e({
|
|
2613
2888
|
type: "string",
|
|
2614
2889
|
format: "uuid",
|
|
2615
2890
|
check: "string_format",
|
|
2616
2891
|
abort: !1,
|
|
2617
|
-
...
|
|
2892
|
+
...f(t)
|
|
2618
2893
|
});
|
|
2619
2894
|
}
|
|
2620
|
-
|
|
2895
|
+
// @__NO_SIDE_EFFECTS__
|
|
2896
|
+
function so(e, t) {
|
|
2621
2897
|
return new e({
|
|
2622
2898
|
type: "string",
|
|
2623
2899
|
format: "url",
|
|
2624
2900
|
check: "string_format",
|
|
2625
2901
|
abort: !1,
|
|
2626
|
-
...
|
|
2902
|
+
...f(t)
|
|
2627
2903
|
});
|
|
2628
2904
|
}
|
|
2629
|
-
|
|
2905
|
+
// @__NO_SIDE_EFFECTS__
|
|
2906
|
+
function io(e, t) {
|
|
2630
2907
|
return new e({
|
|
2631
2908
|
type: "string",
|
|
2632
2909
|
format: "ipv4",
|
|
2633
2910
|
check: "string_format",
|
|
2634
2911
|
abort: !1,
|
|
2635
|
-
...
|
|
2912
|
+
...f(t)
|
|
2636
2913
|
});
|
|
2637
2914
|
}
|
|
2638
|
-
|
|
2915
|
+
// @__NO_SIDE_EFFECTS__
|
|
2916
|
+
function ao(e, t) {
|
|
2639
2917
|
return new e({
|
|
2640
2918
|
type: "string",
|
|
2641
2919
|
format: "ipv6",
|
|
2642
2920
|
check: "string_format",
|
|
2643
2921
|
abort: !1,
|
|
2644
|
-
...
|
|
2922
|
+
...f(t)
|
|
2645
2923
|
});
|
|
2646
2924
|
}
|
|
2647
|
-
|
|
2925
|
+
// @__NO_SIDE_EFFECTS__
|
|
2926
|
+
function uo(e, t) {
|
|
2648
2927
|
return new e({
|
|
2649
2928
|
type: "string",
|
|
2650
2929
|
format: "datetime",
|
|
@@ -2652,204 +2931,233 @@ function Jr(e, t) {
|
|
|
2652
2931
|
offset: !1,
|
|
2653
2932
|
local: !1,
|
|
2654
2933
|
precision: null,
|
|
2655
|
-
...
|
|
2934
|
+
...f(t)
|
|
2656
2935
|
});
|
|
2657
2936
|
}
|
|
2658
|
-
|
|
2937
|
+
// @__NO_SIDE_EFFECTS__
|
|
2938
|
+
function lo(e, t) {
|
|
2659
2939
|
return new e({
|
|
2660
2940
|
type: "string",
|
|
2661
2941
|
format: "date",
|
|
2662
2942
|
check: "string_format",
|
|
2663
|
-
...
|
|
2943
|
+
...f(t)
|
|
2664
2944
|
});
|
|
2665
2945
|
}
|
|
2666
|
-
|
|
2946
|
+
// @__NO_SIDE_EFFECTS__
|
|
2947
|
+
function co(e, t) {
|
|
2667
2948
|
return new e({
|
|
2668
2949
|
type: "string",
|
|
2669
2950
|
format: "time",
|
|
2670
2951
|
check: "string_format",
|
|
2671
2952
|
precision: null,
|
|
2672
|
-
...
|
|
2953
|
+
...f(t)
|
|
2673
2954
|
});
|
|
2674
2955
|
}
|
|
2675
|
-
|
|
2956
|
+
// @__NO_SIDE_EFFECTS__
|
|
2957
|
+
function po(e, t) {
|
|
2676
2958
|
return new e({
|
|
2677
2959
|
type: "string",
|
|
2678
2960
|
format: "duration",
|
|
2679
2961
|
check: "string_format",
|
|
2680
|
-
...
|
|
2962
|
+
...f(t)
|
|
2681
2963
|
});
|
|
2682
2964
|
}
|
|
2683
|
-
|
|
2965
|
+
// @__NO_SIDE_EFFECTS__
|
|
2966
|
+
function mo(e, t) {
|
|
2684
2967
|
return new e({
|
|
2685
2968
|
type: "number",
|
|
2686
2969
|
checks: [],
|
|
2687
|
-
...
|
|
2970
|
+
...f(t)
|
|
2688
2971
|
});
|
|
2689
2972
|
}
|
|
2690
|
-
|
|
2973
|
+
// @__NO_SIDE_EFFECTS__
|
|
2974
|
+
function ho(e, t) {
|
|
2691
2975
|
return new e({
|
|
2692
2976
|
type: "number",
|
|
2693
2977
|
check: "number_format",
|
|
2694
2978
|
abort: !1,
|
|
2695
2979
|
format: "safeint",
|
|
2696
|
-
...
|
|
2980
|
+
...f(t)
|
|
2697
2981
|
});
|
|
2698
2982
|
}
|
|
2699
|
-
|
|
2983
|
+
// @__NO_SIDE_EFFECTS__
|
|
2984
|
+
function fo(e, t) {
|
|
2700
2985
|
return new e({
|
|
2701
2986
|
type: "boolean",
|
|
2702
|
-
...
|
|
2987
|
+
...f(t)
|
|
2703
2988
|
});
|
|
2704
2989
|
}
|
|
2705
|
-
|
|
2990
|
+
// @__NO_SIDE_EFFECTS__
|
|
2991
|
+
function yo(e) {
|
|
2706
2992
|
return new e({
|
|
2707
2993
|
type: "any"
|
|
2708
2994
|
});
|
|
2709
2995
|
}
|
|
2710
|
-
|
|
2711
|
-
|
|
2996
|
+
// @__NO_SIDE_EFFECTS__
|
|
2997
|
+
function bo(e, t) {
|
|
2998
|
+
return new yr({
|
|
2712
2999
|
check: "less_than",
|
|
2713
|
-
...
|
|
3000
|
+
...f(t),
|
|
2714
3001
|
value: e,
|
|
2715
3002
|
inclusive: !0
|
|
2716
3003
|
});
|
|
2717
3004
|
}
|
|
2718
|
-
|
|
2719
|
-
|
|
3005
|
+
// @__NO_SIDE_EFFECTS__
|
|
3006
|
+
function go(e, t) {
|
|
3007
|
+
return new br({
|
|
2720
3008
|
check: "greater_than",
|
|
2721
|
-
...
|
|
3009
|
+
...f(t),
|
|
2722
3010
|
value: e,
|
|
2723
3011
|
inclusive: !0
|
|
2724
3012
|
});
|
|
2725
3013
|
}
|
|
2726
|
-
|
|
2727
|
-
|
|
3014
|
+
// @__NO_SIDE_EFFECTS__
|
|
3015
|
+
function ie(e, t) {
|
|
3016
|
+
return new _r({
|
|
2728
3017
|
check: "max_length",
|
|
2729
|
-
...
|
|
3018
|
+
...f(t),
|
|
2730
3019
|
maximum: e
|
|
2731
3020
|
});
|
|
2732
3021
|
}
|
|
2733
|
-
|
|
2734
|
-
|
|
3022
|
+
// @__NO_SIDE_EFFECTS__
|
|
3023
|
+
function F(e, t) {
|
|
3024
|
+
return new vr({
|
|
2735
3025
|
check: "min_length",
|
|
2736
|
-
...
|
|
3026
|
+
...f(t),
|
|
2737
3027
|
minimum: e
|
|
2738
3028
|
});
|
|
2739
3029
|
}
|
|
2740
|
-
|
|
2741
|
-
|
|
3030
|
+
// @__NO_SIDE_EFFECTS__
|
|
3031
|
+
function Tt(e, t) {
|
|
3032
|
+
return new Tr({
|
|
2742
3033
|
check: "length_equals",
|
|
2743
|
-
...
|
|
3034
|
+
...f(t),
|
|
2744
3035
|
length: e
|
|
2745
3036
|
});
|
|
2746
3037
|
}
|
|
2747
|
-
|
|
2748
|
-
|
|
3038
|
+
// @__NO_SIDE_EFFECTS__
|
|
3039
|
+
function kt(e, t) {
|
|
3040
|
+
return new kr({
|
|
2749
3041
|
check: "string_format",
|
|
2750
3042
|
format: "regex",
|
|
2751
|
-
...
|
|
3043
|
+
...f(t),
|
|
2752
3044
|
pattern: e
|
|
2753
3045
|
});
|
|
2754
3046
|
}
|
|
2755
|
-
|
|
2756
|
-
|
|
3047
|
+
// @__NO_SIDE_EFFECTS__
|
|
3048
|
+
function _o(e) {
|
|
3049
|
+
return new wr({
|
|
2757
3050
|
check: "string_format",
|
|
2758
3051
|
format: "lowercase",
|
|
2759
|
-
...
|
|
3052
|
+
...f(e)
|
|
2760
3053
|
});
|
|
2761
3054
|
}
|
|
2762
|
-
|
|
2763
|
-
|
|
3055
|
+
// @__NO_SIDE_EFFECTS__
|
|
3056
|
+
function vo(e) {
|
|
3057
|
+
return new Sr({
|
|
2764
3058
|
check: "string_format",
|
|
2765
3059
|
format: "uppercase",
|
|
2766
|
-
...
|
|
3060
|
+
...f(e)
|
|
2767
3061
|
});
|
|
2768
3062
|
}
|
|
2769
|
-
|
|
2770
|
-
|
|
3063
|
+
// @__NO_SIDE_EFFECTS__
|
|
3064
|
+
function To(e, t) {
|
|
3065
|
+
return new Ar({
|
|
2771
3066
|
check: "string_format",
|
|
2772
3067
|
format: "includes",
|
|
2773
|
-
...
|
|
3068
|
+
...f(t),
|
|
2774
3069
|
includes: e
|
|
2775
3070
|
});
|
|
2776
3071
|
}
|
|
2777
|
-
|
|
2778
|
-
|
|
3072
|
+
// @__NO_SIDE_EFFECTS__
|
|
3073
|
+
function ko(e, t) {
|
|
3074
|
+
return new Er({
|
|
2779
3075
|
check: "string_format",
|
|
2780
3076
|
format: "starts_with",
|
|
2781
|
-
...
|
|
3077
|
+
...f(t),
|
|
2782
3078
|
prefix: e
|
|
2783
3079
|
});
|
|
2784
3080
|
}
|
|
2785
|
-
|
|
2786
|
-
|
|
3081
|
+
// @__NO_SIDE_EFFECTS__
|
|
3082
|
+
function wo(e, t) {
|
|
3083
|
+
return new zr({
|
|
2787
3084
|
check: "string_format",
|
|
2788
3085
|
format: "ends_with",
|
|
2789
|
-
...
|
|
3086
|
+
...f(t),
|
|
2790
3087
|
suffix: e
|
|
2791
3088
|
});
|
|
2792
3089
|
}
|
|
2793
|
-
|
|
2794
|
-
|
|
3090
|
+
// @__NO_SIDE_EFFECTS__
|
|
3091
|
+
function x(e) {
|
|
3092
|
+
return new Or({
|
|
2795
3093
|
check: "overwrite",
|
|
2796
3094
|
tx: e
|
|
2797
3095
|
});
|
|
2798
3096
|
}
|
|
2799
|
-
|
|
2800
|
-
|
|
3097
|
+
// @__NO_SIDE_EFFECTS__
|
|
3098
|
+
function So(e) {
|
|
3099
|
+
return /* @__PURE__ */ x((t) => t.normalize(e));
|
|
2801
3100
|
}
|
|
2802
|
-
|
|
2803
|
-
|
|
3101
|
+
// @__NO_SIDE_EFFECTS__
|
|
3102
|
+
function Ao() {
|
|
3103
|
+
return /* @__PURE__ */ x((e) => e.trim());
|
|
2804
3104
|
}
|
|
2805
|
-
|
|
2806
|
-
|
|
3105
|
+
// @__NO_SIDE_EFFECTS__
|
|
3106
|
+
function Eo() {
|
|
3107
|
+
return /* @__PURE__ */ x((e) => e.toLowerCase());
|
|
2807
3108
|
}
|
|
2808
|
-
|
|
2809
|
-
|
|
3109
|
+
// @__NO_SIDE_EFFECTS__
|
|
3110
|
+
function zo() {
|
|
3111
|
+
return /* @__PURE__ */ x((e) => e.toUpperCase());
|
|
2810
3112
|
}
|
|
2811
|
-
|
|
2812
|
-
|
|
3113
|
+
// @__NO_SIDE_EFFECTS__
|
|
3114
|
+
function Oo() {
|
|
3115
|
+
return /* @__PURE__ */ x((e) => Fn(e));
|
|
2813
3116
|
}
|
|
2814
|
-
|
|
3117
|
+
// @__NO_SIDE_EFFECTS__
|
|
3118
|
+
function $o(e, t, n) {
|
|
2815
3119
|
return new e({
|
|
2816
3120
|
type: "array",
|
|
2817
3121
|
element: t,
|
|
2818
3122
|
// get element() {
|
|
2819
3123
|
// return element;
|
|
2820
3124
|
// },
|
|
2821
|
-
...
|
|
3125
|
+
...f(n)
|
|
2822
3126
|
});
|
|
2823
3127
|
}
|
|
2824
|
-
|
|
3128
|
+
// @__NO_SIDE_EFFECTS__
|
|
3129
|
+
function wt(e, t, n) {
|
|
2825
3130
|
return new e({
|
|
2826
3131
|
type: "custom",
|
|
2827
3132
|
check: "custom",
|
|
2828
3133
|
fn: t,
|
|
2829
|
-
...
|
|
3134
|
+
...f(n)
|
|
2830
3135
|
});
|
|
2831
3136
|
}
|
|
2832
|
-
|
|
2833
|
-
|
|
3137
|
+
// @__NO_SIDE_EFFECTS__
|
|
3138
|
+
function St(e) {
|
|
3139
|
+
const t = /* @__PURE__ */ Po((n) => (n.addIssue = (r) => {
|
|
2834
3140
|
if (typeof r == "string")
|
|
2835
|
-
n.issues.push(
|
|
3141
|
+
n.issues.push(B(r, n.value, t._zod.def));
|
|
2836
3142
|
else {
|
|
2837
3143
|
const o = r;
|
|
2838
|
-
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(
|
|
3144
|
+
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(B(o));
|
|
2839
3145
|
}
|
|
2840
3146
|
}, e(n.value, n)));
|
|
2841
3147
|
return t;
|
|
2842
3148
|
}
|
|
2843
|
-
|
|
2844
|
-
|
|
3149
|
+
// @__NO_SIDE_EFFECTS__
|
|
3150
|
+
function Po(e, t) {
|
|
3151
|
+
const n = new $({
|
|
2845
3152
|
check: "custom",
|
|
2846
|
-
...
|
|
3153
|
+
...f(t)
|
|
2847
3154
|
});
|
|
2848
3155
|
return n._zod.check = e, n;
|
|
2849
3156
|
}
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
3157
|
+
// @__NO_SIDE_EFFECTS__
|
|
3158
|
+
function Io(e, t, n, r = {}) {
|
|
3159
|
+
const o = f(r), s = {
|
|
3160
|
+
...f(r),
|
|
2853
3161
|
check: "string_format",
|
|
2854
3162
|
type: "string",
|
|
2855
3163
|
format: t,
|
|
@@ -2858,49 +3166,374 @@ function ko(e, t, n, r = {}) {
|
|
|
2858
3166
|
};
|
|
2859
3167
|
return n instanceof RegExp && (s.pattern = n), new e(s);
|
|
2860
3168
|
}
|
|
2861
|
-
|
|
2862
|
-
|
|
3169
|
+
function At(e) {
|
|
3170
|
+
let t = e?.target ?? "draft-2020-12";
|
|
3171
|
+
return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
|
|
3172
|
+
processors: e.processors ?? {},
|
|
3173
|
+
metadataRegistry: e?.metadata ?? J,
|
|
3174
|
+
target: t,
|
|
3175
|
+
unrepresentable: e?.unrepresentable ?? "throw",
|
|
3176
|
+
override: e?.override ?? (() => {
|
|
3177
|
+
}),
|
|
3178
|
+
io: e?.io ?? "output",
|
|
3179
|
+
counter: 0,
|
|
3180
|
+
seen: /* @__PURE__ */ new Map(),
|
|
3181
|
+
cycles: e?.cycles ?? "ref",
|
|
3182
|
+
reused: e?.reused ?? "inline",
|
|
3183
|
+
external: e?.external ?? void 0
|
|
3184
|
+
};
|
|
3185
|
+
}
|
|
3186
|
+
function z(e, t, n = { path: [], schemaPath: [] }) {
|
|
3187
|
+
var r;
|
|
3188
|
+
const o = e._zod.def, s = t.seen.get(e);
|
|
3189
|
+
if (s)
|
|
3190
|
+
return s.count++, n.schemaPath.includes(e) && (s.cycle = n.path), s.schema;
|
|
3191
|
+
const i = { schema: {}, count: 1, cycle: void 0, path: n.path };
|
|
3192
|
+
t.seen.set(e, i);
|
|
3193
|
+
const a = e._zod.toJSONSchema?.();
|
|
3194
|
+
if (a)
|
|
3195
|
+
i.schema = a;
|
|
3196
|
+
else {
|
|
3197
|
+
const p = {
|
|
3198
|
+
...n,
|
|
3199
|
+
schemaPath: [...n.schemaPath, e],
|
|
3200
|
+
path: n.path
|
|
3201
|
+
};
|
|
3202
|
+
if (e._zod.processJSONSchema)
|
|
3203
|
+
e._zod.processJSONSchema(t, i.schema, p);
|
|
3204
|
+
else {
|
|
3205
|
+
const m = i.schema, y = t.processors[o.type];
|
|
3206
|
+
if (!y)
|
|
3207
|
+
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
3208
|
+
y(e, t, m, p);
|
|
3209
|
+
}
|
|
3210
|
+
const d = e._zod.parent;
|
|
3211
|
+
d && (i.ref || (i.ref = d), z(d, t, p), t.seen.get(d).isParent = !0);
|
|
3212
|
+
}
|
|
3213
|
+
const u = t.metadataRegistry.get(e);
|
|
3214
|
+
return u && Object.assign(i.schema, u), t.io === "input" && E(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
|
|
3215
|
+
}
|
|
3216
|
+
function Et(e, t) {
|
|
3217
|
+
const n = e.seen.get(t);
|
|
3218
|
+
if (!n)
|
|
3219
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
3220
|
+
const r = /* @__PURE__ */ new Map();
|
|
3221
|
+
for (const i of e.seen.entries()) {
|
|
3222
|
+
const a = e.metadataRegistry.get(i[0])?.id;
|
|
3223
|
+
if (a) {
|
|
3224
|
+
const u = r.get(a);
|
|
3225
|
+
if (u && u !== i[0])
|
|
3226
|
+
throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
3227
|
+
r.set(a, i[0]);
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
const o = (i) => {
|
|
3231
|
+
const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
3232
|
+
if (e.external) {
|
|
3233
|
+
const d = e.external.registry.get(i[0])?.id, m = e.external.uri ?? ((P) => P);
|
|
3234
|
+
if (d)
|
|
3235
|
+
return { ref: m(d) };
|
|
3236
|
+
const y = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
|
|
3237
|
+
return i[1].defId = y, { defId: y, ref: `${m("__shared")}#/${a}/${y}` };
|
|
3238
|
+
}
|
|
3239
|
+
if (i[1] === n)
|
|
3240
|
+
return { ref: "#" };
|
|
3241
|
+
const l = `#/${a}/`, p = i[1].schema.id ?? `__schema${e.counter++}`;
|
|
3242
|
+
return { defId: p, ref: l + p };
|
|
3243
|
+
}, s = (i) => {
|
|
3244
|
+
if (i[1].schema.$ref)
|
|
3245
|
+
return;
|
|
3246
|
+
const a = i[1], { ref: u, defId: l } = o(i);
|
|
3247
|
+
a.def = { ...a.schema }, l && (a.defId = l);
|
|
3248
|
+
const p = a.schema;
|
|
3249
|
+
for (const d in p)
|
|
3250
|
+
delete p[d];
|
|
3251
|
+
p.$ref = u;
|
|
3252
|
+
};
|
|
3253
|
+
if (e.cycles === "throw")
|
|
3254
|
+
for (const i of e.seen.entries()) {
|
|
3255
|
+
const a = i[1];
|
|
3256
|
+
if (a.cycle)
|
|
3257
|
+
throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
3258
|
+
|
|
3259
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
3260
|
+
}
|
|
3261
|
+
for (const i of e.seen.entries()) {
|
|
3262
|
+
const a = i[1];
|
|
3263
|
+
if (t === i[0]) {
|
|
3264
|
+
s(i);
|
|
3265
|
+
continue;
|
|
3266
|
+
}
|
|
3267
|
+
if (e.external) {
|
|
3268
|
+
const l = e.external.registry.get(i[0])?.id;
|
|
3269
|
+
if (t !== i[0] && l) {
|
|
3270
|
+
s(i);
|
|
3271
|
+
continue;
|
|
3272
|
+
}
|
|
3273
|
+
}
|
|
3274
|
+
if (e.metadataRegistry.get(i[0])?.id) {
|
|
3275
|
+
s(i);
|
|
3276
|
+
continue;
|
|
3277
|
+
}
|
|
3278
|
+
if (a.cycle) {
|
|
3279
|
+
s(i);
|
|
3280
|
+
continue;
|
|
3281
|
+
}
|
|
3282
|
+
if (a.count > 1 && e.reused === "ref") {
|
|
3283
|
+
s(i);
|
|
3284
|
+
continue;
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
function zt(e, t) {
|
|
3289
|
+
const n = e.seen.get(t);
|
|
3290
|
+
if (!n)
|
|
3291
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
3292
|
+
const r = (i) => {
|
|
3293
|
+
const a = e.seen.get(i);
|
|
3294
|
+
if (a.ref === null)
|
|
3295
|
+
return;
|
|
3296
|
+
const u = a.def ?? a.schema, l = { ...u }, p = a.ref;
|
|
3297
|
+
if (a.ref = null, p) {
|
|
3298
|
+
r(p);
|
|
3299
|
+
const m = e.seen.get(p), y = m.schema;
|
|
3300
|
+
if (y.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (u.allOf = u.allOf ?? [], u.allOf.push(y)) : Object.assign(u, y), Object.assign(u, l), i._zod.parent === p)
|
|
3301
|
+
for (const S in u)
|
|
3302
|
+
S === "$ref" || S === "allOf" || S in l || delete u[S];
|
|
3303
|
+
if (y.$ref && m.def)
|
|
3304
|
+
for (const S in u)
|
|
3305
|
+
S === "$ref" || S === "allOf" || S in m.def && JSON.stringify(u[S]) === JSON.stringify(m.def[S]) && delete u[S];
|
|
3306
|
+
}
|
|
3307
|
+
const d = i._zod.parent;
|
|
3308
|
+
if (d && d !== p) {
|
|
3309
|
+
r(d);
|
|
3310
|
+
const m = e.seen.get(d);
|
|
3311
|
+
if (m?.schema.$ref && (u.$ref = m.schema.$ref, m.def))
|
|
3312
|
+
for (const y in u)
|
|
3313
|
+
y === "$ref" || y === "allOf" || y in m.def && JSON.stringify(u[y]) === JSON.stringify(m.def[y]) && delete u[y];
|
|
3314
|
+
}
|
|
3315
|
+
e.override({
|
|
3316
|
+
zodSchema: i,
|
|
3317
|
+
jsonSchema: u,
|
|
3318
|
+
path: a.path ?? []
|
|
3319
|
+
});
|
|
3320
|
+
};
|
|
3321
|
+
for (const i of [...e.seen.entries()].reverse())
|
|
3322
|
+
r(i[0]);
|
|
3323
|
+
const o = {};
|
|
3324
|
+
if (e.target === "draft-2020-12" ? o.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? o.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? o.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
|
|
3325
|
+
const i = e.external.registry.get(t)?.id;
|
|
3326
|
+
if (!i)
|
|
3327
|
+
throw new Error("Schema is missing an `id` property");
|
|
3328
|
+
o.$id = e.external.uri(i);
|
|
3329
|
+
}
|
|
3330
|
+
Object.assign(o, n.def ?? n.schema);
|
|
3331
|
+
const s = e.external?.defs ?? {};
|
|
3332
|
+
for (const i of e.seen.entries()) {
|
|
3333
|
+
const a = i[1];
|
|
3334
|
+
a.def && a.defId && (s[a.defId] = a.def);
|
|
3335
|
+
}
|
|
3336
|
+
e.external || Object.keys(s).length > 0 && (e.target === "draft-2020-12" ? o.$defs = s : o.definitions = s);
|
|
3337
|
+
try {
|
|
3338
|
+
const i = JSON.parse(JSON.stringify(o));
|
|
3339
|
+
return Object.defineProperty(i, "~standard", {
|
|
3340
|
+
value: {
|
|
3341
|
+
...t["~standard"],
|
|
3342
|
+
jsonSchema: {
|
|
3343
|
+
input: H(t, "input", e.processors),
|
|
3344
|
+
output: H(t, "output", e.processors)
|
|
3345
|
+
}
|
|
3346
|
+
},
|
|
3347
|
+
enumerable: !1,
|
|
3348
|
+
writable: !1
|
|
3349
|
+
}), i;
|
|
3350
|
+
} catch {
|
|
3351
|
+
throw new Error("Error converting schema to JSON.");
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
function E(e, t) {
|
|
3355
|
+
const n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
3356
|
+
if (n.seen.has(e))
|
|
3357
|
+
return !1;
|
|
3358
|
+
n.seen.add(e);
|
|
3359
|
+
const r = e._zod.def;
|
|
3360
|
+
if (r.type === "transform")
|
|
3361
|
+
return !0;
|
|
3362
|
+
if (r.type === "array")
|
|
3363
|
+
return E(r.element, n);
|
|
3364
|
+
if (r.type === "set")
|
|
3365
|
+
return E(r.valueType, n);
|
|
3366
|
+
if (r.type === "lazy")
|
|
3367
|
+
return E(r.getter(), n);
|
|
3368
|
+
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
|
|
3369
|
+
return E(r.innerType, n);
|
|
3370
|
+
if (r.type === "intersection")
|
|
3371
|
+
return E(r.left, n) || E(r.right, n);
|
|
3372
|
+
if (r.type === "record" || r.type === "map")
|
|
3373
|
+
return E(r.keyType, n) || E(r.valueType, n);
|
|
3374
|
+
if (r.type === "pipe")
|
|
3375
|
+
return E(r.in, n) || E(r.out, n);
|
|
3376
|
+
if (r.type === "object") {
|
|
3377
|
+
for (const o in r.shape)
|
|
3378
|
+
if (E(r.shape[o], n))
|
|
3379
|
+
return !0;
|
|
3380
|
+
return !1;
|
|
3381
|
+
}
|
|
3382
|
+
if (r.type === "union") {
|
|
3383
|
+
for (const o of r.options)
|
|
3384
|
+
if (E(o, n))
|
|
3385
|
+
return !0;
|
|
3386
|
+
return !1;
|
|
3387
|
+
}
|
|
3388
|
+
if (r.type === "tuple") {
|
|
3389
|
+
for (const o of r.items)
|
|
3390
|
+
if (E(o, n))
|
|
3391
|
+
return !0;
|
|
3392
|
+
return !!(r.rest && E(r.rest, n));
|
|
3393
|
+
}
|
|
3394
|
+
return !1;
|
|
3395
|
+
}
|
|
3396
|
+
const Co = (e, t = {}) => (n) => {
|
|
3397
|
+
const r = At({ ...n, processors: t });
|
|
3398
|
+
return z(e, r), Et(r, e), zt(r, e);
|
|
3399
|
+
}, H = (e, t, n = {}) => (r) => {
|
|
3400
|
+
const { libraryOptions: o, target: s } = r ?? {}, i = At({ ...o ?? {}, target: s, io: t, processors: n });
|
|
3401
|
+
return z(e, i), Et(i, e), zt(i, e);
|
|
3402
|
+
}, No = {
|
|
3403
|
+
guid: "uuid",
|
|
3404
|
+
url: "uri",
|
|
3405
|
+
datetime: "date-time",
|
|
3406
|
+
json_string: "json-string",
|
|
3407
|
+
regex: ""
|
|
3408
|
+
// do not set
|
|
3409
|
+
}, Zo = (e, t, n, r) => {
|
|
3410
|
+
const o = n;
|
|
3411
|
+
o.type = "string";
|
|
3412
|
+
const { minimum: s, maximum: i, format: a, patterns: u, contentEncoding: l } = e._zod.bag;
|
|
3413
|
+
if (typeof s == "number" && (o.minLength = s), typeof i == "number" && (o.maxLength = i), a && (o.format = No[a] ?? a, o.format === "" && delete o.format, a === "time" && delete o.format), l && (o.contentEncoding = l), u && u.size > 0) {
|
|
3414
|
+
const p = [...u];
|
|
3415
|
+
p.length === 1 ? o.pattern = p[0].source : p.length > 1 && (o.allOf = [
|
|
3416
|
+
...p.map((d) => ({
|
|
3417
|
+
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
3418
|
+
pattern: d.source
|
|
3419
|
+
}))
|
|
3420
|
+
]);
|
|
3421
|
+
}
|
|
3422
|
+
}, Do = (e, t, n, r) => {
|
|
3423
|
+
if (t.unrepresentable === "throw")
|
|
3424
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
3425
|
+
}, Lo = (e, t, n, r) => {
|
|
3426
|
+
if (t.unrepresentable === "throw")
|
|
3427
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
3428
|
+
}, Mo = (e, t, n, r) => {
|
|
3429
|
+
const o = n, s = e._zod.def, { minimum: i, maximum: a } = e._zod.bag;
|
|
3430
|
+
typeof i == "number" && (o.minItems = i), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = z(s.element, t, { ...r, path: [...r.path, "items"] });
|
|
3431
|
+
}, Ro = (e, t, n, r) => {
|
|
3432
|
+
const o = e._zod.def, s = o.inclusive === !1, i = o.options.map((a, u) => z(a, t, {
|
|
3433
|
+
...r,
|
|
3434
|
+
path: [...r.path, s ? "oneOf" : "anyOf", u]
|
|
3435
|
+
}));
|
|
3436
|
+
s ? n.oneOf = i : n.anyOf = i;
|
|
3437
|
+
}, Wo = (e, t, n, r) => {
|
|
3438
|
+
const o = e._zod.def, s = z(o.left, t, {
|
|
3439
|
+
...r,
|
|
3440
|
+
path: [...r.path, "allOf", 0]
|
|
3441
|
+
}), i = z(o.right, t, {
|
|
3442
|
+
...r,
|
|
3443
|
+
path: [...r.path, "allOf", 1]
|
|
3444
|
+
}), a = (l) => "allOf" in l && Object.keys(l).length === 1, u = [
|
|
3445
|
+
...a(s) ? s.allOf : [s],
|
|
3446
|
+
...a(i) ? i.allOf : [i]
|
|
3447
|
+
];
|
|
3448
|
+
n.allOf = u;
|
|
3449
|
+
}, jo = (e, t, n, r) => {
|
|
3450
|
+
const o = e._zod.def, s = z(o.innerType, t, r), i = t.seen.get(e);
|
|
3451
|
+
t.target === "openapi-3.0" ? (i.ref = o.innerType, n.nullable = !0) : n.anyOf = [s, { type: "null" }];
|
|
3452
|
+
}, Fo = (e, t, n, r) => {
|
|
3453
|
+
const o = e._zod.def;
|
|
3454
|
+
z(o.innerType, t, r);
|
|
3455
|
+
const s = t.seen.get(e);
|
|
3456
|
+
s.ref = o.innerType;
|
|
3457
|
+
}, Uo = (e, t, n, r) => {
|
|
3458
|
+
const o = e._zod.def;
|
|
3459
|
+
z(o.innerType, t, r);
|
|
3460
|
+
const s = t.seen.get(e);
|
|
3461
|
+
s.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
3462
|
+
}, xo = (e, t, n, r) => {
|
|
3463
|
+
const o = e._zod.def;
|
|
3464
|
+
z(o.innerType, t, r);
|
|
3465
|
+
const s = t.seen.get(e);
|
|
3466
|
+
s.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
3467
|
+
}, Vo = (e, t, n, r) => {
|
|
3468
|
+
const o = e._zod.def;
|
|
3469
|
+
z(o.innerType, t, r);
|
|
3470
|
+
const s = t.seen.get(e);
|
|
3471
|
+
s.ref = o.innerType;
|
|
3472
|
+
let i;
|
|
3473
|
+
try {
|
|
3474
|
+
i = o.catchValue(void 0);
|
|
3475
|
+
} catch {
|
|
3476
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
3477
|
+
}
|
|
3478
|
+
n.default = i;
|
|
3479
|
+
}, Jo = (e, t, n, r) => {
|
|
3480
|
+
const o = e._zod.def, s = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
3481
|
+
z(s, t, r);
|
|
3482
|
+
const i = t.seen.get(e);
|
|
3483
|
+
i.ref = s;
|
|
3484
|
+
}, Bo = (e, t, n, r) => {
|
|
3485
|
+
const o = e._zod.def;
|
|
3486
|
+
z(o.innerType, t, r);
|
|
3487
|
+
const s = t.seen.get(e);
|
|
3488
|
+
s.ref = o.innerType, n.readOnly = !0;
|
|
3489
|
+
}, Ot = (e, t, n, r) => {
|
|
3490
|
+
const o = e._zod.def;
|
|
3491
|
+
z(o.innerType, t, r);
|
|
3492
|
+
const s = t.seen.get(e);
|
|
3493
|
+
s.ref = o.innerType;
|
|
3494
|
+
}, Go = /* @__PURE__ */ c("ZodISODateTime", (e, t) => {
|
|
3495
|
+
Nr.init(e, t), ae.init(e, t);
|
|
2863
3496
|
});
|
|
2864
|
-
function
|
|
2865
|
-
return
|
|
3497
|
+
function Yo(e) {
|
|
3498
|
+
return /* @__PURE__ */ uo(Go, e);
|
|
2866
3499
|
}
|
|
2867
|
-
const
|
|
2868
|
-
|
|
3500
|
+
const Ko = /* @__PURE__ */ c("ZodISODate", (e, t) => {
|
|
3501
|
+
Zr.init(e, t), ae.init(e, t);
|
|
2869
3502
|
});
|
|
2870
|
-
function
|
|
2871
|
-
return
|
|
3503
|
+
function qo(e) {
|
|
3504
|
+
return /* @__PURE__ */ lo(Ko, e);
|
|
2872
3505
|
}
|
|
2873
|
-
const
|
|
2874
|
-
|
|
3506
|
+
const Xo = /* @__PURE__ */ c("ZodISOTime", (e, t) => {
|
|
3507
|
+
Dr.init(e, t), ae.init(e, t);
|
|
2875
3508
|
});
|
|
2876
|
-
function
|
|
2877
|
-
return
|
|
3509
|
+
function Ho(e) {
|
|
3510
|
+
return /* @__PURE__ */ co(Xo, e);
|
|
2878
3511
|
}
|
|
2879
|
-
const
|
|
2880
|
-
|
|
3512
|
+
const Qo = /* @__PURE__ */ c("ZodISODuration", (e, t) => {
|
|
3513
|
+
Lr.init(e, t), ae.init(e, t);
|
|
2881
3514
|
});
|
|
2882
|
-
function
|
|
2883
|
-
return
|
|
3515
|
+
function es(e) {
|
|
3516
|
+
return /* @__PURE__ */ po(Qo, e);
|
|
2884
3517
|
}
|
|
2885
|
-
const
|
|
2886
|
-
|
|
3518
|
+
const ts = (e, t) => {
|
|
3519
|
+
dt.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2887
3520
|
format: {
|
|
2888
|
-
value: (n) =>
|
|
3521
|
+
value: (n) => Jn(e, n)
|
|
2889
3522
|
// enumerable: false,
|
|
2890
3523
|
},
|
|
2891
3524
|
flatten: {
|
|
2892
|
-
value: (n) =>
|
|
3525
|
+
value: (n) => Vn(e, n)
|
|
2893
3526
|
// enumerable: false,
|
|
2894
3527
|
},
|
|
2895
3528
|
addIssue: {
|
|
2896
3529
|
value: (n) => {
|
|
2897
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues,
|
|
3530
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, de, 2);
|
|
2898
3531
|
}
|
|
2899
3532
|
// enumerable: false,
|
|
2900
3533
|
},
|
|
2901
3534
|
addIssues: {
|
|
2902
3535
|
value: (n) => {
|
|
2903
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues,
|
|
3536
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, de, 2);
|
|
2904
3537
|
}
|
|
2905
3538
|
// enumerable: false,
|
|
2906
3539
|
},
|
|
@@ -2911,461 +3544,504 @@ const Zo = (e, t) => {
|
|
|
2911
3544
|
// enumerable: false,
|
|
2912
3545
|
}
|
|
2913
3546
|
});
|
|
2914
|
-
},
|
|
3547
|
+
}, N = c("ZodError", ts, {
|
|
2915
3548
|
Parent: Error
|
|
2916
|
-
}),
|
|
3549
|
+
}), ns = /* @__PURE__ */ te(N), rs = /* @__PURE__ */ ne(N), os = /* @__PURE__ */ re(N), ss = /* @__PURE__ */ oe(N), is = /* @__PURE__ */ Yn(N), as = /* @__PURE__ */ Kn(N), us = /* @__PURE__ */ qn(N), ls = /* @__PURE__ */ Xn(N), cs = /* @__PURE__ */ Hn(N), ps = /* @__PURE__ */ Qn(N), ds = /* @__PURE__ */ er(N), ms = /* @__PURE__ */ tr(N), O = /* @__PURE__ */ c("ZodType", (e, t) => (k.init(e, t), Object.assign(e["~standard"], {
|
|
3550
|
+
jsonSchema: {
|
|
3551
|
+
input: H(e, "input"),
|
|
3552
|
+
output: H(e, "output")
|
|
3553
|
+
}
|
|
3554
|
+
}), e.toJSONSchema = Co(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(jn(t, {
|
|
2917
3555
|
checks: [
|
|
2918
3556
|
...t.checks ?? [],
|
|
2919
3557
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
2920
3558
|
]
|
|
2921
|
-
})
|
|
3559
|
+
}), {
|
|
3560
|
+
parent: !0
|
|
3561
|
+
}), e.with = e.check, e.clone = (n, r) => ct(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => ns(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => os(e, n, r), e.parseAsync = async (n, r) => rs(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ss(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => is(e, n, r), e.decode = (n, r) => as(e, n, r), e.encodeAsync = async (n, r) => us(e, n, r), e.decodeAsync = async (n, r) => ls(e, n, r), e.safeEncode = (n, r) => cs(e, n, r), e.safeDecode = (n, r) => ps(e, n, r), e.safeEncodeAsync = async (n, r) => ds(e, n, r), e.safeDecodeAsync = async (n, r) => ms(e, n, r), e.refine = (n, r) => e.check(Ws(n, r)), e.superRefine = (n) => e.check(js(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ x(n)), e.optional = () => Ve(e), e.exactOptional = () => As(e), e.nullable = () => Je(e), e.nullish = () => Ve(Je(e)), e.nonoptional = (n) => Cs(e, n), e.array = () => ys(e), e.or = (n) => gs([e, n]), e.and = (n) => vs(e, n), e.transform = (n) => Be(e, ks(n)), e.default = (n) => Os(e, n), e.prefault = (n) => Ps(e, n), e.catch = (n) => Zs(e, n), e.pipe = (n) => Be(e, n), e.readonly = () => Ms(e), e.describe = (n) => {
|
|
2922
3562
|
const r = e.clone();
|
|
2923
|
-
return
|
|
3563
|
+
return J.add(r, { description: n }), r;
|
|
2924
3564
|
}, Object.defineProperty(e, "description", {
|
|
2925
3565
|
get() {
|
|
2926
|
-
return
|
|
3566
|
+
return J.get(e)?.description;
|
|
2927
3567
|
},
|
|
2928
3568
|
configurable: !0
|
|
2929
3569
|
}), e.meta = (...n) => {
|
|
2930
3570
|
if (n.length === 0)
|
|
2931
|
-
return
|
|
3571
|
+
return J.get(e);
|
|
2932
3572
|
const r = e.clone();
|
|
2933
|
-
return
|
|
2934
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
2935
|
-
|
|
3573
|
+
return J.add(r, n[0]), r;
|
|
3574
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), hs = /* @__PURE__ */ c("_ZodString", (e, t) => {
|
|
3575
|
+
we.init(e, t), O.init(e, t), e._zod.processJSONSchema = (r, o, s) => Zo(e, r, o);
|
|
2936
3576
|
const n = e._zod.bag;
|
|
2937
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(
|
|
2938
|
-
}),
|
|
2939
|
-
|
|
2940
|
-
}),
|
|
2941
|
-
|
|
3577
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ kt(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ To(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ ko(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ wo(...r)), e.min = (...r) => e.check(/* @__PURE__ */ F(...r)), e.max = (...r) => e.check(/* @__PURE__ */ ie(...r)), e.length = (...r) => e.check(/* @__PURE__ */ Tt(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ F(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ _o(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ vo(r)), e.trim = () => e.check(/* @__PURE__ */ Ao()), e.normalize = (...r) => e.check(/* @__PURE__ */ So(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Eo()), e.toUpperCase = () => e.check(/* @__PURE__ */ zo()), e.slugify = () => e.check(/* @__PURE__ */ Oo());
|
|
3578
|
+
}), ae = /* @__PURE__ */ c("ZodStringFormat", (e, t) => {
|
|
3579
|
+
C.init(e, t), hs.init(e, t);
|
|
3580
|
+
}), fs = /* @__PURE__ */ c("ZodArray", (e, t) => {
|
|
3581
|
+
_t.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Mo(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ F(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ F(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ ie(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ Tt(n, r)), e.unwrap = () => e.element;
|
|
2942
3582
|
});
|
|
2943
|
-
function
|
|
2944
|
-
return
|
|
3583
|
+
function ys(e, t) {
|
|
3584
|
+
return /* @__PURE__ */ $o(fs, e, t);
|
|
2945
3585
|
}
|
|
2946
|
-
const
|
|
2947
|
-
|
|
3586
|
+
const bs = /* @__PURE__ */ c("ZodUnion", (e, t) => {
|
|
3587
|
+
xr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ro(e, n, r, o), e.options = t.options;
|
|
2948
3588
|
});
|
|
2949
|
-
function
|
|
2950
|
-
return new
|
|
3589
|
+
function gs(e, t) {
|
|
3590
|
+
return new bs({
|
|
2951
3591
|
type: "union",
|
|
2952
3592
|
options: e,
|
|
2953
|
-
...
|
|
3593
|
+
...f(t)
|
|
2954
3594
|
});
|
|
2955
3595
|
}
|
|
2956
|
-
const
|
|
2957
|
-
|
|
3596
|
+
const _s = /* @__PURE__ */ c("ZodIntersection", (e, t) => {
|
|
3597
|
+
Vr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Wo(e, n, r, o);
|
|
2958
3598
|
});
|
|
2959
|
-
function
|
|
2960
|
-
return new
|
|
3599
|
+
function vs(e, t) {
|
|
3600
|
+
return new _s({
|
|
2961
3601
|
type: "intersection",
|
|
2962
3602
|
left: e,
|
|
2963
3603
|
right: t
|
|
2964
3604
|
});
|
|
2965
3605
|
}
|
|
2966
|
-
const
|
|
2967
|
-
|
|
3606
|
+
const Ts = /* @__PURE__ */ c("ZodTransform", (e, t) => {
|
|
3607
|
+
Jr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Lo(e, n), e._zod.parse = (n, r) => {
|
|
2968
3608
|
if (r.direction === "backward")
|
|
2969
|
-
throw new
|
|
3609
|
+
throw new at(e.constructor.name);
|
|
2970
3610
|
n.addIssue = (s) => {
|
|
2971
3611
|
if (typeof s == "string")
|
|
2972
|
-
n.issues.push(
|
|
3612
|
+
n.issues.push(B(s, n.value, t));
|
|
2973
3613
|
else {
|
|
2974
3614
|
const i = s;
|
|
2975
|
-
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), n.issues.push(
|
|
3615
|
+
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), n.issues.push(B(i));
|
|
2976
3616
|
}
|
|
2977
3617
|
};
|
|
2978
3618
|
const o = t.transform(n.value, n);
|
|
2979
3619
|
return o instanceof Promise ? o.then((s) => (n.value = s, n)) : (n.value = o, n);
|
|
2980
3620
|
};
|
|
2981
3621
|
});
|
|
2982
|
-
function
|
|
2983
|
-
return new
|
|
3622
|
+
function ks(e) {
|
|
3623
|
+
return new Ts({
|
|
2984
3624
|
type: "transform",
|
|
2985
3625
|
transform: e
|
|
2986
3626
|
});
|
|
2987
3627
|
}
|
|
2988
|
-
const
|
|
2989
|
-
|
|
3628
|
+
const ws = /* @__PURE__ */ c("ZodOptional", (e, t) => {
|
|
3629
|
+
Se.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ot(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2990
3630
|
});
|
|
2991
|
-
function
|
|
2992
|
-
return new
|
|
3631
|
+
function Ve(e) {
|
|
3632
|
+
return new ws({
|
|
2993
3633
|
type: "optional",
|
|
2994
3634
|
innerType: e
|
|
2995
3635
|
});
|
|
2996
3636
|
}
|
|
2997
|
-
const
|
|
2998
|
-
|
|
3637
|
+
const Ss = /* @__PURE__ */ c("ZodExactOptional", (e, t) => {
|
|
3638
|
+
Br.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ot(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2999
3639
|
});
|
|
3000
|
-
function
|
|
3001
|
-
return new
|
|
3640
|
+
function As(e) {
|
|
3641
|
+
return new Ss({
|
|
3642
|
+
type: "optional",
|
|
3643
|
+
innerType: e
|
|
3644
|
+
});
|
|
3645
|
+
}
|
|
3646
|
+
const Es = /* @__PURE__ */ c("ZodNullable", (e, t) => {
|
|
3647
|
+
Gr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => jo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3648
|
+
});
|
|
3649
|
+
function Je(e) {
|
|
3650
|
+
return new Es({
|
|
3002
3651
|
type: "nullable",
|
|
3003
3652
|
innerType: e
|
|
3004
3653
|
});
|
|
3005
3654
|
}
|
|
3006
|
-
const
|
|
3007
|
-
|
|
3655
|
+
const zs = /* @__PURE__ */ c("ZodDefault", (e, t) => {
|
|
3656
|
+
Yr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Uo(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
3008
3657
|
});
|
|
3009
|
-
function
|
|
3010
|
-
return new
|
|
3658
|
+
function Os(e, t) {
|
|
3659
|
+
return new zs({
|
|
3011
3660
|
type: "default",
|
|
3012
3661
|
innerType: e,
|
|
3013
3662
|
get defaultValue() {
|
|
3014
|
-
return typeof t == "function" ? t() :
|
|
3663
|
+
return typeof t == "function" ? t() : lt(t);
|
|
3015
3664
|
}
|
|
3016
3665
|
});
|
|
3017
3666
|
}
|
|
3018
|
-
const
|
|
3019
|
-
|
|
3667
|
+
const $s = /* @__PURE__ */ c("ZodPrefault", (e, t) => {
|
|
3668
|
+
Kr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => xo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3020
3669
|
});
|
|
3021
|
-
function
|
|
3022
|
-
return new
|
|
3670
|
+
function Ps(e, t) {
|
|
3671
|
+
return new $s({
|
|
3023
3672
|
type: "prefault",
|
|
3024
3673
|
innerType: e,
|
|
3025
3674
|
get defaultValue() {
|
|
3026
|
-
return typeof t == "function" ? t() :
|
|
3675
|
+
return typeof t == "function" ? t() : lt(t);
|
|
3027
3676
|
}
|
|
3028
3677
|
});
|
|
3029
3678
|
}
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3679
|
+
const Is = /* @__PURE__ */ c("ZodNonOptional", (e, t) => {
|
|
3680
|
+
qr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Fo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3032
3681
|
});
|
|
3033
|
-
function
|
|
3034
|
-
return new
|
|
3682
|
+
function Cs(e, t) {
|
|
3683
|
+
return new Is({
|
|
3035
3684
|
type: "nonoptional",
|
|
3036
3685
|
innerType: e,
|
|
3037
|
-
...
|
|
3686
|
+
...f(t)
|
|
3038
3687
|
});
|
|
3039
3688
|
}
|
|
3040
|
-
const
|
|
3041
|
-
|
|
3689
|
+
const Ns = /* @__PURE__ */ c("ZodCatch", (e, t) => {
|
|
3690
|
+
Xr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Vo(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3042
3691
|
});
|
|
3043
|
-
function
|
|
3044
|
-
return new
|
|
3692
|
+
function Zs(e, t) {
|
|
3693
|
+
return new Ns({
|
|
3045
3694
|
type: "catch",
|
|
3046
3695
|
innerType: e,
|
|
3047
3696
|
catchValue: typeof t == "function" ? t : () => t
|
|
3048
3697
|
});
|
|
3049
3698
|
}
|
|
3050
|
-
const
|
|
3051
|
-
|
|
3699
|
+
const Ds = /* @__PURE__ */ c("ZodPipe", (e, t) => {
|
|
3700
|
+
Hr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Jo(e, n, r, o), e.in = t.in, e.out = t.out;
|
|
3052
3701
|
});
|
|
3053
|
-
function
|
|
3054
|
-
return new
|
|
3702
|
+
function Be(e, t) {
|
|
3703
|
+
return new Ds({
|
|
3055
3704
|
type: "pipe",
|
|
3056
3705
|
in: e,
|
|
3057
3706
|
out: t
|
|
3058
3707
|
// ...util.normalizeParams(params),
|
|
3059
3708
|
});
|
|
3060
3709
|
}
|
|
3061
|
-
const
|
|
3062
|
-
|
|
3710
|
+
const Ls = /* @__PURE__ */ c("ZodReadonly", (e, t) => {
|
|
3711
|
+
Qr.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Bo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
3063
3712
|
});
|
|
3064
|
-
function
|
|
3065
|
-
return new
|
|
3713
|
+
function Ms(e) {
|
|
3714
|
+
return new Ls({
|
|
3066
3715
|
type: "readonly",
|
|
3067
3716
|
innerType: e
|
|
3068
3717
|
});
|
|
3069
3718
|
}
|
|
3070
|
-
const
|
|
3071
|
-
|
|
3719
|
+
const Rs = /* @__PURE__ */ c("ZodCustom", (e, t) => {
|
|
3720
|
+
vt.init(e, t), O.init(e, t), e._zod.processJSONSchema = (n, r, o) => Do(e, n);
|
|
3072
3721
|
});
|
|
3073
|
-
function
|
|
3074
|
-
return
|
|
3722
|
+
function Ws(e, t = {}) {
|
|
3723
|
+
return /* @__PURE__ */ wt(Rs, e, t);
|
|
3075
3724
|
}
|
|
3076
|
-
function
|
|
3077
|
-
return
|
|
3725
|
+
function js(e) {
|
|
3726
|
+
return /* @__PURE__ */ St(e);
|
|
3078
3727
|
}
|
|
3079
|
-
const
|
|
3728
|
+
const R = /* @__PURE__ */ c("ZodMiniType", (e, t) => {
|
|
3080
3729
|
if (!e._zod)
|
|
3081
3730
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
checks
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
), e.clone = (n, r) => st(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e));
|
|
3092
|
-
}), kt = /* @__PURE__ */ l("ZodMiniString", (e, t) => {
|
|
3093
|
-
ve.init(e, t), D.init(e, t);
|
|
3731
|
+
k.init(e, t), e.def = t, e.type = t.type, e.parse = (n, r) => Bn(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => mt(e, n, r), e.parseAsync = async (n, r) => Gn(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ht(e, n, r), e.check = (...n) => e.clone({
|
|
3732
|
+
...t,
|
|
3733
|
+
checks: [
|
|
3734
|
+
...t.checks ?? [],
|
|
3735
|
+
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
3736
|
+
]
|
|
3737
|
+
}, { parent: !0 }), e.with = e.check, e.clone = (n, r) => ct(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.apply = (n) => n(e);
|
|
3738
|
+
}), $t = /* @__PURE__ */ c("ZodMiniString", (e, t) => {
|
|
3739
|
+
we.init(e, t), R.init(e, t);
|
|
3094
3740
|
});
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3741
|
+
// @__NO_SIDE_EFFECTS__
|
|
3742
|
+
function Ge(e) {
|
|
3743
|
+
return /* @__PURE__ */ no($t, e);
|
|
3744
|
+
}
|
|
3745
|
+
const V = /* @__PURE__ */ c("ZodMiniStringFormat", (e, t) => {
|
|
3746
|
+
C.init(e, t), $t.init(e, t);
|
|
3747
|
+
}), Fs = /* @__PURE__ */ c("ZodMiniEmail", (e, t) => {
|
|
3748
|
+
Ir.init(e, t), V.init(e, t);
|
|
3102
3749
|
});
|
|
3103
|
-
|
|
3104
|
-
|
|
3750
|
+
// @__NO_SIDE_EFFECTS__
|
|
3751
|
+
function Us(e) {
|
|
3752
|
+
return /* @__PURE__ */ ro(Fs, e);
|
|
3105
3753
|
}
|
|
3106
|
-
const
|
|
3107
|
-
|
|
3754
|
+
const xs = /* @__PURE__ */ c("ZodMiniUUID", (e, t) => {
|
|
3755
|
+
Pr.init(e, t), V.init(e, t);
|
|
3108
3756
|
});
|
|
3109
|
-
|
|
3110
|
-
|
|
3757
|
+
// @__NO_SIDE_EFFECTS__
|
|
3758
|
+
function Vs(e) {
|
|
3759
|
+
return /* @__PURE__ */ oo(xs, e);
|
|
3111
3760
|
}
|
|
3112
|
-
const
|
|
3113
|
-
|
|
3761
|
+
const Js = /* @__PURE__ */ c("ZodMiniURL", (e, t) => {
|
|
3762
|
+
Cr.init(e, t), V.init(e, t);
|
|
3114
3763
|
});
|
|
3115
|
-
|
|
3116
|
-
|
|
3764
|
+
// @__NO_SIDE_EFFECTS__
|
|
3765
|
+
function Bs(e) {
|
|
3766
|
+
return /* @__PURE__ */ so(Js, e);
|
|
3117
3767
|
}
|
|
3118
|
-
const
|
|
3119
|
-
|
|
3768
|
+
const Gs = /* @__PURE__ */ c("ZodMiniIPv4", (e, t) => {
|
|
3769
|
+
Mr.init(e, t), V.init(e, t);
|
|
3120
3770
|
});
|
|
3121
|
-
|
|
3122
|
-
|
|
3771
|
+
// @__NO_SIDE_EFFECTS__
|
|
3772
|
+
function Ys(e) {
|
|
3773
|
+
return /* @__PURE__ */ io(Gs, e);
|
|
3123
3774
|
}
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3775
|
+
const Ks = /* @__PURE__ */ c("ZodMiniIPv6", (e, t) => {
|
|
3776
|
+
Rr.init(e, t), V.init(e, t);
|
|
3126
3777
|
});
|
|
3127
|
-
|
|
3128
|
-
|
|
3778
|
+
// @__NO_SIDE_EFFECTS__
|
|
3779
|
+
function qs(e) {
|
|
3780
|
+
return /* @__PURE__ */ ao(Ks, e);
|
|
3129
3781
|
}
|
|
3130
|
-
const
|
|
3131
|
-
|
|
3782
|
+
const Xs = /* @__PURE__ */ c("ZodMiniCustomStringFormat", (e, t) => {
|
|
3783
|
+
Wr.init(e, t), V.init(e, t);
|
|
3132
3784
|
});
|
|
3133
|
-
|
|
3134
|
-
|
|
3785
|
+
// @__NO_SIDE_EFFECTS__
|
|
3786
|
+
function Hs(e) {
|
|
3787
|
+
return /* @__PURE__ */ Io(Xs, "hostname", ir, e);
|
|
3135
3788
|
}
|
|
3136
|
-
const
|
|
3137
|
-
|
|
3789
|
+
const Pt = /* @__PURE__ */ c("ZodMiniNumber", (e, t) => {
|
|
3790
|
+
gt.init(e, t), R.init(e, t);
|
|
3138
3791
|
});
|
|
3139
|
-
|
|
3140
|
-
|
|
3792
|
+
// @__NO_SIDE_EFFECTS__
|
|
3793
|
+
function Ye(e) {
|
|
3794
|
+
return /* @__PURE__ */ mo(Pt, e);
|
|
3141
3795
|
}
|
|
3142
|
-
const
|
|
3143
|
-
|
|
3796
|
+
const Qs = /* @__PURE__ */ c("ZodMiniNumberFormat", (e, t) => {
|
|
3797
|
+
jr.init(e, t), Pt.init(e, t);
|
|
3144
3798
|
});
|
|
3145
|
-
|
|
3146
|
-
|
|
3799
|
+
// @__NO_SIDE_EFFECTS__
|
|
3800
|
+
function ei(e) {
|
|
3801
|
+
return /* @__PURE__ */ ho(Qs, e);
|
|
3147
3802
|
}
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3803
|
+
const ti = /* @__PURE__ */ c("ZodMiniBoolean", (e, t) => {
|
|
3804
|
+
Fr.init(e, t), R.init(e, t);
|
|
3150
3805
|
});
|
|
3151
|
-
|
|
3152
|
-
|
|
3806
|
+
// @__NO_SIDE_EFFECTS__
|
|
3807
|
+
function Ke(e) {
|
|
3808
|
+
return /* @__PURE__ */ fo(ti, e);
|
|
3153
3809
|
}
|
|
3154
|
-
const
|
|
3155
|
-
|
|
3810
|
+
const ni = /* @__PURE__ */ c("ZodMiniAny", (e, t) => {
|
|
3811
|
+
Ur.init(e, t), R.init(e, t);
|
|
3156
3812
|
});
|
|
3157
|
-
|
|
3158
|
-
|
|
3813
|
+
// @__NO_SIDE_EFFECTS__
|
|
3814
|
+
function fe() {
|
|
3815
|
+
return /* @__PURE__ */ yo(ni);
|
|
3159
3816
|
}
|
|
3160
|
-
const
|
|
3161
|
-
|
|
3817
|
+
const ri = /* @__PURE__ */ c("ZodMiniArray", (e, t) => {
|
|
3818
|
+
_t.init(e, t), R.init(e, t);
|
|
3162
3819
|
});
|
|
3163
|
-
|
|
3164
|
-
|
|
3820
|
+
// @__NO_SIDE_EFFECTS__
|
|
3821
|
+
function qe(e, t) {
|
|
3822
|
+
return new ri({
|
|
3165
3823
|
type: "array",
|
|
3166
3824
|
element: e,
|
|
3167
|
-
...
|
|
3825
|
+
...f(t)
|
|
3168
3826
|
});
|
|
3169
3827
|
}
|
|
3170
|
-
const
|
|
3171
|
-
|
|
3828
|
+
const oi = /* @__PURE__ */ c("ZodMiniOptional", (e, t) => {
|
|
3829
|
+
Se.init(e, t), R.init(e, t);
|
|
3172
3830
|
});
|
|
3173
|
-
|
|
3174
|
-
|
|
3831
|
+
// @__NO_SIDE_EFFECTS__
|
|
3832
|
+
function si(e) {
|
|
3833
|
+
return new oi({
|
|
3175
3834
|
type: "optional",
|
|
3176
3835
|
innerType: e
|
|
3177
3836
|
});
|
|
3178
3837
|
}
|
|
3179
|
-
const
|
|
3180
|
-
|
|
3181
|
-
});
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3838
|
+
const ii = /* @__PURE__ */ c("ZodMiniCustom", (e, t) => {
|
|
3839
|
+
vt.init(e, t), R.init(e, t);
|
|
3840
|
+
});
|
|
3841
|
+
// @__NO_SIDE_EFFECTS__
|
|
3842
|
+
function w(e, t = {}) {
|
|
3843
|
+
return /* @__PURE__ */ wt(ii, e, t);
|
|
3844
|
+
}
|
|
3845
|
+
// @__NO_SIDE_EFFECTS__
|
|
3846
|
+
function It(e) {
|
|
3847
|
+
return /* @__PURE__ */ St(e);
|
|
3848
|
+
}
|
|
3849
|
+
const ye = {
|
|
3850
|
+
email: { schema: /* @__PURE__ */ Us() },
|
|
3851
|
+
hostname: { schema: /* @__PURE__ */ Hs() },
|
|
3852
|
+
ipv4: { schema: /* @__PURE__ */ Ys() },
|
|
3853
|
+
ipv6: { schema: /* @__PURE__ */ qs() },
|
|
3854
|
+
url: { schema: /* @__PURE__ */ Bs() },
|
|
3855
|
+
uuid: { schema: /* @__PURE__ */ Vs() },
|
|
3856
|
+
date: { schema: qo() },
|
|
3857
|
+
time: { schema: Ho() },
|
|
3858
|
+
"date-time": { schema: Yo({ local: !0, offset: !0 }) },
|
|
3859
|
+
duration: { schema: es() }
|
|
3860
|
+
}, Xe = Object.keys(ye), ai = (e) => (t, n) => {
|
|
3200
3861
|
switch (t.type) {
|
|
3201
3862
|
case "string":
|
|
3202
|
-
return
|
|
3863
|
+
return ui(t, n);
|
|
3203
3864
|
case "integer":
|
|
3204
3865
|
case "number":
|
|
3205
|
-
return
|
|
3866
|
+
return ci(t, n);
|
|
3206
3867
|
case "boolean":
|
|
3207
|
-
return
|
|
3868
|
+
return pi(t, n);
|
|
3208
3869
|
case "array":
|
|
3209
|
-
return
|
|
3870
|
+
return di(t, n);
|
|
3210
3871
|
case "custom": {
|
|
3211
3872
|
if (!e)
|
|
3212
3873
|
throw new Error(
|
|
3213
3874
|
'Validator type "custom" requires a customValidators object, but it was not supplied.'
|
|
3214
3875
|
);
|
|
3215
|
-
return
|
|
3876
|
+
return mi(t, e);
|
|
3877
|
+
}
|
|
3878
|
+
default: {
|
|
3879
|
+
const r = t;
|
|
3880
|
+
throw new Error(
|
|
3881
|
+
`Unknown validator config: ${JSON.stringify(r)}. The "type" property must be one of: "string", "number", "integer", "boolean", "array", "custom".`
|
|
3882
|
+
);
|
|
3216
3883
|
}
|
|
3217
3884
|
}
|
|
3218
3885
|
};
|
|
3219
|
-
function
|
|
3886
|
+
function T(e, t) {
|
|
3220
3887
|
if (e !== void 0)
|
|
3221
3888
|
return typeof e == "string" ? e : t?.translate(e.key, e.params, e.default) ?? e.default;
|
|
3222
3889
|
}
|
|
3223
|
-
function
|
|
3224
|
-
return
|
|
3225
|
-
const r =
|
|
3226
|
-
let o = r ?
|
|
3890
|
+
function ui(e, t) {
|
|
3891
|
+
return G(e, (n) => {
|
|
3892
|
+
const r = T(n.messages?.invalid, t);
|
|
3893
|
+
let o = r ? /* @__PURE__ */ Ge(r) : /* @__PURE__ */ Ge();
|
|
3227
3894
|
if (n.required === !0) {
|
|
3228
|
-
const s =
|
|
3229
|
-
o = o.check(
|
|
3895
|
+
const s = T(n.messages?.required, t) ?? "This field is required";
|
|
3896
|
+
o = o.check(/* @__PURE__ */ w((i) => i.length > 0, { error: s }));
|
|
3230
3897
|
}
|
|
3231
3898
|
if (typeof n.minLength == "number") {
|
|
3232
|
-
const s =
|
|
3899
|
+
const s = T(n.messages?.minLength, t), i = n.minLength;
|
|
3233
3900
|
o = o.check(
|
|
3234
|
-
s ?
|
|
3901
|
+
s ? /* @__PURE__ */ w((a) => a.length >= i, { error: s }) : /* @__PURE__ */ F(i)
|
|
3235
3902
|
);
|
|
3236
3903
|
}
|
|
3237
3904
|
if (typeof n.maxLength == "number") {
|
|
3238
|
-
const s =
|
|
3905
|
+
const s = T(n.messages?.maxLength, t), i = n.maxLength;
|
|
3239
3906
|
o = o.check(
|
|
3240
|
-
s ?
|
|
3907
|
+
s ? /* @__PURE__ */ w((a) => a.length <= i, { error: s }) : /* @__PURE__ */ ie(i)
|
|
3241
3908
|
);
|
|
3242
3909
|
}
|
|
3243
3910
|
if (typeof n.pattern == "string") {
|
|
3244
|
-
const s =
|
|
3911
|
+
const s = T(n.messages?.pattern, t), i = new RegExp(n.pattern);
|
|
3245
3912
|
o = o.check(
|
|
3246
|
-
s ?
|
|
3913
|
+
s ? /* @__PURE__ */ w((a) => i.test(a), { error: s }) : /* @__PURE__ */ kt(i)
|
|
3247
3914
|
);
|
|
3248
3915
|
}
|
|
3249
3916
|
if (n.enum) {
|
|
3250
|
-
const s = n.enum, i =
|
|
3251
|
-
o = o.check(
|
|
3917
|
+
const s = n.enum, i = T(n.messages?.enum, t);
|
|
3918
|
+
o = o.check(/* @__PURE__ */ w((a) => s.includes(a), i ? { error: i } : void 0));
|
|
3252
3919
|
}
|
|
3253
3920
|
if (n.const !== void 0) {
|
|
3254
|
-
const s =
|
|
3255
|
-
o = o.check(
|
|
3921
|
+
const s = T(n.messages?.const, t);
|
|
3922
|
+
o = o.check(/* @__PURE__ */ w((i) => i === n.const, s ? { error: s } : void 0));
|
|
3256
3923
|
}
|
|
3257
3924
|
if (n.format !== void 0)
|
|
3258
|
-
if (
|
|
3259
|
-
const s =
|
|
3925
|
+
if (Xe.includes(n.format)) {
|
|
3926
|
+
const s = T(n.messages?.format, t);
|
|
3260
3927
|
o = o.check(
|
|
3261
|
-
s ?
|
|
3262
|
-
const u =
|
|
3263
|
-
|
|
3928
|
+
s ? /* @__PURE__ */ It((i, a) => {
|
|
3929
|
+
const u = He(
|
|
3930
|
+
ye[n.format].schema,
|
|
3264
3931
|
i
|
|
3265
3932
|
);
|
|
3266
|
-
|
|
3267
|
-
}) :
|
|
3933
|
+
Qe(u) || a.addIssue({ code: "custom", path: [], message: s });
|
|
3934
|
+
}) : ye[n.format].schema
|
|
3268
3935
|
);
|
|
3269
3936
|
} else
|
|
3270
|
-
|
|
3937
|
+
throw new Error(
|
|
3938
|
+
`Unknown string validation format: ${JSON.stringify(n.format)}. The "format" property must be one of: ${Xe.map((s) => `"${s}"`).join(", ")}.`
|
|
3939
|
+
);
|
|
3271
3940
|
return o;
|
|
3272
3941
|
});
|
|
3273
3942
|
}
|
|
3274
|
-
const
|
|
3943
|
+
const li = (e, t) => {
|
|
3275
3944
|
if (t === 0)
|
|
3276
3945
|
return !1;
|
|
3277
3946
|
const n = e / t;
|
|
3278
3947
|
return Math.abs(n - Math.round(n)) < 1e-10;
|
|
3279
3948
|
};
|
|
3280
|
-
function
|
|
3281
|
-
return
|
|
3282
|
-
const r =
|
|
3283
|
-
let o = r ?
|
|
3284
|
-
if (n.type === "integer" && (o = o.check(
|
|
3285
|
-
const s =
|
|
3286
|
-
o = o.check(s ?
|
|
3949
|
+
function ci(e, t) {
|
|
3950
|
+
return G(e, (n) => {
|
|
3951
|
+
const r = T(n.messages?.invalid, t);
|
|
3952
|
+
let o = r ? /* @__PURE__ */ Ye(r) : /* @__PURE__ */ Ye();
|
|
3953
|
+
if (n.type === "integer" && (o = o.check(/* @__PURE__ */ ei())), n.minimum !== void 0) {
|
|
3954
|
+
const s = T(n.messages?.minimum, t), i = n.minimum;
|
|
3955
|
+
o = o.check(s ? /* @__PURE__ */ w((a) => a >= i, { error: s }) : /* @__PURE__ */ go(i));
|
|
3287
3956
|
}
|
|
3288
3957
|
if (n.maximum !== void 0) {
|
|
3289
|
-
const s =
|
|
3290
|
-
o = o.check(s ?
|
|
3958
|
+
const s = T(n.messages?.maximum, t), i = n.maximum;
|
|
3959
|
+
o = o.check(s ? /* @__PURE__ */ w((a) => a <= i, { error: s }) : /* @__PURE__ */ bo(i));
|
|
3291
3960
|
}
|
|
3292
3961
|
if (n.exclusiveMinimum !== void 0) {
|
|
3293
|
-
const s =
|
|
3294
|
-
o = o.check(
|
|
3962
|
+
const s = T(n.messages?.exclusiveMinimum, t), i = n.exclusiveMinimum;
|
|
3963
|
+
o = o.check(/* @__PURE__ */ w((a) => a > i, s ? { error: s } : void 0));
|
|
3295
3964
|
}
|
|
3296
3965
|
if (n.exclusiveMaximum !== void 0) {
|
|
3297
|
-
const s =
|
|
3298
|
-
o = o.check(
|
|
3966
|
+
const s = T(n.messages?.exclusiveMaximum, t), i = n.exclusiveMaximum;
|
|
3967
|
+
o = o.check(/* @__PURE__ */ w((a) => a < i, s ? { error: s } : void 0));
|
|
3299
3968
|
}
|
|
3300
3969
|
if (n.multipleOf !== void 0) {
|
|
3301
|
-
const s =
|
|
3970
|
+
const s = T(n.messages?.multipleOf, t), i = n.multipleOf;
|
|
3302
3971
|
o = o.check(
|
|
3303
|
-
|
|
3972
|
+
/* @__PURE__ */ w((a) => li(a, i), s ? { error: s } : void 0)
|
|
3304
3973
|
);
|
|
3305
3974
|
}
|
|
3306
3975
|
if (n.enum) {
|
|
3307
|
-
const s = n.enum, i =
|
|
3308
|
-
o = o.check(
|
|
3976
|
+
const s = n.enum, i = T(n.messages?.enum, t);
|
|
3977
|
+
o = o.check(/* @__PURE__ */ w((a) => s.includes(a), i ? { error: i } : void 0));
|
|
3309
3978
|
}
|
|
3310
3979
|
if (n.const !== void 0) {
|
|
3311
|
-
const s =
|
|
3312
|
-
o = o.check(
|
|
3980
|
+
const s = T(n.messages?.const, t);
|
|
3981
|
+
o = o.check(/* @__PURE__ */ w((i) => i === n.const, s ? { error: s } : void 0));
|
|
3313
3982
|
}
|
|
3314
3983
|
return o;
|
|
3315
3984
|
});
|
|
3316
3985
|
}
|
|
3317
|
-
function
|
|
3318
|
-
return
|
|
3319
|
-
const r =
|
|
3320
|
-
let o = r ?
|
|
3986
|
+
function pi(e, t) {
|
|
3987
|
+
return G(e, (n) => {
|
|
3988
|
+
const r = T(n.messages?.invalid, t);
|
|
3989
|
+
let o = r ? /* @__PURE__ */ Ke(r) : /* @__PURE__ */ Ke();
|
|
3321
3990
|
if (n.const !== void 0) {
|
|
3322
|
-
const s =
|
|
3323
|
-
o = o.check(
|
|
3991
|
+
const s = T(n.messages?.const, t);
|
|
3992
|
+
o = o.check(/* @__PURE__ */ w((i) => i === n.const, s ? { error: s } : void 0));
|
|
3324
3993
|
}
|
|
3325
3994
|
return o;
|
|
3326
3995
|
});
|
|
3327
3996
|
}
|
|
3328
|
-
function
|
|
3329
|
-
return
|
|
3330
|
-
const r =
|
|
3331
|
-
let o = r ?
|
|
3997
|
+
function di(e, t) {
|
|
3998
|
+
return G(e, (n) => {
|
|
3999
|
+
const r = T(n.messages?.invalid, t);
|
|
4000
|
+
let o = r ? /* @__PURE__ */ qe(/* @__PURE__ */ fe(), r) : /* @__PURE__ */ qe(/* @__PURE__ */ fe());
|
|
3332
4001
|
if (n.required === !0) {
|
|
3333
|
-
const s =
|
|
3334
|
-
o = o.check(
|
|
4002
|
+
const s = T(n.messages?.required, t) ?? "This field is required";
|
|
4003
|
+
o = o.check(/* @__PURE__ */ w((i) => i.length > 0, { error: s }));
|
|
3335
4004
|
}
|
|
3336
4005
|
if (typeof n.minItems == "number") {
|
|
3337
|
-
const s =
|
|
4006
|
+
const s = T(n.messages?.minItems, t), i = n.minItems;
|
|
3338
4007
|
o = o.check(
|
|
3339
|
-
s ?
|
|
4008
|
+
s ? /* @__PURE__ */ w((a) => a.length >= i, { error: s }) : /* @__PURE__ */ F(i)
|
|
3340
4009
|
);
|
|
3341
4010
|
}
|
|
3342
4011
|
if (typeof n.maxItems == "number") {
|
|
3343
|
-
const s =
|
|
4012
|
+
const s = T(n.messages?.maxItems, t), i = n.maxItems;
|
|
3344
4013
|
o = o.check(
|
|
3345
|
-
s ?
|
|
4014
|
+
s ? /* @__PURE__ */ w((a) => a.length <= i, { error: s }) : /* @__PURE__ */ ie(i)
|
|
3346
4015
|
);
|
|
3347
4016
|
}
|
|
3348
4017
|
return o;
|
|
3349
4018
|
});
|
|
3350
4019
|
}
|
|
3351
|
-
function
|
|
3352
|
-
return
|
|
3353
|
-
let r =
|
|
3354
|
-
return
|
|
4020
|
+
function mi(e, t) {
|
|
4021
|
+
return G(e, (n) => {
|
|
4022
|
+
let r = /* @__PURE__ */ fe();
|
|
4023
|
+
return Zt(
|
|
3355
4024
|
Object.keys(n),
|
|
3356
4025
|
// filter non-custom validator keys
|
|
3357
4026
|
(o) => o !== "type" && o !== "required",
|
|
3358
4027
|
(o) => {
|
|
3359
|
-
const s = n[o], i = t[o]
|
|
4028
|
+
const s = n[o], i = t[o];
|
|
4029
|
+
if (!i) {
|
|
4030
|
+
const u = Object.keys(t).map((l) => `"${l}"`).join(", ");
|
|
4031
|
+
throw new Error(
|
|
4032
|
+
`Unknown custom validator rule "${o}". Registered rules: ${u || "(none)"}.`
|
|
4033
|
+
);
|
|
4034
|
+
}
|
|
4035
|
+
const a = i(s);
|
|
3360
4036
|
r = r.check(
|
|
3361
|
-
|
|
3362
|
-
const p =
|
|
4037
|
+
/* @__PURE__ */ It((u, l) => {
|
|
4038
|
+
const p = He(
|
|
3363
4039
|
a,
|
|
3364
4040
|
u
|
|
3365
4041
|
);
|
|
3366
|
-
if (!
|
|
4042
|
+
if (!Qe(p)) {
|
|
3367
4043
|
const d = p.issues[0];
|
|
3368
|
-
|
|
4044
|
+
l.addIssue({
|
|
3369
4045
|
code: "custom",
|
|
3370
4046
|
path: [],
|
|
3371
4047
|
message: d?.message || `Validation failed for ${o}`
|
|
@@ -3377,51 +4053,61 @@ function Ws(e, t) {
|
|
|
3377
4053
|
), r;
|
|
3378
4054
|
});
|
|
3379
4055
|
}
|
|
3380
|
-
function
|
|
4056
|
+
function G(e, t) {
|
|
3381
4057
|
const n = t(e);
|
|
3382
|
-
return e.required ? n :
|
|
4058
|
+
return e.required ? n : /* @__PURE__ */ si(n);
|
|
3383
4059
|
}
|
|
3384
|
-
const
|
|
4060
|
+
const hi = {
|
|
3385
4061
|
// ACTION
|
|
3386
|
-
button: async () => (await import("./button.element-
|
|
4062
|
+
button: async () => (await import("./button.element-CJay43iR.js")).ButtonElement,
|
|
3387
4063
|
// INPUTS
|
|
3388
|
-
calendar: async () => (await import("./calendar.element-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
4064
|
+
calendar: async () => (await import("./calendar.element-BhFrCsns.js")).CalendarElement,
|
|
4065
|
+
dateTimeCalendar: async () => (await import("./date-time-calendar.element-BLBcVsFu.js")).DateTimeCalendarElement,
|
|
4066
|
+
rangeCalendar: async () => (await import("./range-calendar.element-DHLZhpnj.js")).RangeCalendarElement,
|
|
4067
|
+
rangeDateInput: async () => (await import("./range-date-input.element-BdD4SlB4.js")).RangeDateInputElement,
|
|
4068
|
+
rangeTimeInput: async () => (await import("./range-time-input.element-B7wtHJoQ.js")).RangeTimeInputElement,
|
|
4069
|
+
rangeDateTimeInput: async () => (await import("./range-date-time-input.element-Cti44iuW.js")).RangeDateTimeInputElement,
|
|
4070
|
+
rangeDateTimeCalendar: async () => (await import("./range-date-time-calendar.element-Coea6RF4.js")).RangeDateTimeCalendarElement,
|
|
4071
|
+
rangeDateTimePicker: async () => (await import("./range-date-time-picker.element-CDN2RL1y.js")).RangeDateTimePickerElement,
|
|
4072
|
+
rangeDatePicker: async () => (await import("./range-date-picker.element-DWRHiAoC.js")).RangeDatePickerElement,
|
|
4073
|
+
rangeTimePicker: async () => (await import("./range-time-picker.element-CPIAiQPC.js")).RangeTimePickerElement,
|
|
4074
|
+
currency: async () => (await import("./currency.element-D8A2ObpM.js")).CurrencyElement,
|
|
4075
|
+
dateInput: async () => (await import("./date.element-BsKhLrEc.js")).DateElement,
|
|
4076
|
+
datePicker: async () => (await import("./date-picker.element-DeUQtbLg.js")).DatePickerElement,
|
|
4077
|
+
dateTimePicker: async () => (await import("./date-time-picker.element-BUbLdV6i.js")).DateTimePickerElement,
|
|
4078
|
+
dropdown: async () => (await import("./dropdown.element-CXpMwJsU.js")).DropdownElement,
|
|
4079
|
+
list: async () => (await import("./list.element-eo3DIOrp.js")).ListElement,
|
|
4080
|
+
markdown: async () => (await import("./markdown.element-FbtwdnAv.js")).MarkdownElement,
|
|
4081
|
+
password: async () => (await import("./password.element-CBaB8h5b.js")).PasswordElement,
|
|
4082
|
+
textinput: async () => (await import("./textinput.element-AL2Nr768.js")).TextinputElement,
|
|
4083
|
+
timeInput: async () => (await import("./time.element-BneqgMlQ.js")).TimeElement,
|
|
4084
|
+
timePicker: async () => (await import("./time-picker.element-DLihegjg.js")).TimePickerElement,
|
|
4085
|
+
dateTimeInput: async () => (await import("./date-time.element-B5onfSBG.js")).DateTimeElement,
|
|
4086
|
+
textarea: async () => (await import("./textarea.element-CiNEy9uq.js")).TextareaElement,
|
|
4087
|
+
toggle: async () => (await import("./toggle.element-Cz91CRdp.js")).ToggleElement,
|
|
4088
|
+
checkbox: async () => (await import("./checkbox.element-DAAVB651.js")).CheckboxElement,
|
|
4089
|
+
number: async () => (await import("./number.element-BEpOCzXy.js")).NumberElement,
|
|
4090
|
+
radiogroup: async () => (await import("./radiogroup.element-KWzBx8mx.js")).RadiogroupElement,
|
|
4091
|
+
select: async () => (await import("./select.element-eepcXTpL.js")).SelectElement,
|
|
4092
|
+
tags: async () => (await import("./tags.element-CPHgotb0.js")).TagsElement,
|
|
3407
4093
|
// REPEATER
|
|
3408
|
-
repeater: async () => (await import("./repeater.element-
|
|
4094
|
+
repeater: async () => (await import("./repeater.element-BM1Keckd.js")).RepeaterElement,
|
|
3409
4095
|
// LAYOUTS
|
|
3410
4096
|
flex: async () => (await import("./flex.element-DG4Uaj_X.js")).FlexElement,
|
|
3411
4097
|
grid: async () => (await import("./grid.element-DCZsh-3J.js")).GridElement,
|
|
3412
|
-
tabs: async () => (await import("./tabs.element-
|
|
4098
|
+
tabs: async () => (await import("./tabs.element-CvcIA8P3.js")).TabsElement,
|
|
3413
4099
|
accordion: async () => (await import("./accordion.element-BIgxl5e9.js")).AccordionElement,
|
|
3414
4100
|
// DISPLAY
|
|
3415
4101
|
alert: async () => (await import("./alert.element-DPWq9-0F.js")).AlertElement,
|
|
3416
4102
|
markdownText: async () => (await import("./markdown-text.element-B8TfVLIO.js")).MarkdownTextElement,
|
|
3417
4103
|
renderer: async () => (await import("./renderer.element-CNyMn2Lu.js")).RendererElement
|
|
3418
4104
|
};
|
|
3419
|
-
var
|
|
3420
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
4105
|
+
var fi = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, Y = (e, t, n, r) => {
|
|
4106
|
+
for (var o = r > 1 ? void 0 : r ? yi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
3421
4107
|
(i = e[s]) && (o = (r ? i(t, n, o) : i(o)) || o);
|
|
3422
|
-
return r && o &&
|
|
4108
|
+
return r && o && fi(t, n, o), o;
|
|
3423
4109
|
};
|
|
3424
|
-
let
|
|
4110
|
+
let U = class extends Dt {
|
|
3425
4111
|
constructor() {
|
|
3426
4112
|
super(...arguments), this.autocomplete = void 0;
|
|
3427
4113
|
}
|
|
@@ -3435,14 +4121,15 @@ let R = class extends Et {
|
|
|
3435
4121
|
return this;
|
|
3436
4122
|
}
|
|
3437
4123
|
render() {
|
|
3438
|
-
const e = this.config, t =
|
|
4124
|
+
const e = this.config, t = Rn(e.formDef, e.formSelectors, e.formConfig), n = {
|
|
3439
4125
|
formDef: t.formDef,
|
|
3440
4126
|
widgetLoaders: {
|
|
3441
|
-
...
|
|
4127
|
+
...hi,
|
|
3442
4128
|
...t.widgetLoaders,
|
|
3443
4129
|
...e.customWidgetLoaders ?? {}
|
|
3444
4130
|
},
|
|
3445
4131
|
dependencies: { ...t.dependencies ?? {}, ...e.dependencies ?? {} },
|
|
4132
|
+
functions: { ...t.functions ?? {}, ...e.functions ?? {} },
|
|
3446
4133
|
validateOn: e.validateOn ?? t.validateOn ?? "eager",
|
|
3447
4134
|
itemRenderers: {
|
|
3448
4135
|
...t.itemRenderers ?? {},
|
|
@@ -3453,10 +4140,10 @@ let R = class extends Et {
|
|
|
3453
4140
|
data: e.data,
|
|
3454
4141
|
meta: e.meta,
|
|
3455
4142
|
formName: e.formName
|
|
3456
|
-
}, r =
|
|
4143
|
+
}, r = ai({
|
|
3457
4144
|
...e.customValidators ?? {}
|
|
3458
4145
|
}), o = t.formEvent, s = o ? (i) => o(i.detail) : void 0;
|
|
3459
|
-
return
|
|
4146
|
+
return Lt`
|
|
3460
4147
|
<gui-core-form
|
|
3461
4148
|
.config=${n}
|
|
3462
4149
|
.validators=${r}
|
|
@@ -3467,22 +4154,22 @@ let R = class extends Et {
|
|
|
3467
4154
|
`;
|
|
3468
4155
|
}
|
|
3469
4156
|
};
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
],
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
],
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
],
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
],
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
],
|
|
4157
|
+
Y([
|
|
4158
|
+
be({ attribute: !1 })
|
|
4159
|
+
], U.prototype, "config", 2);
|
|
4160
|
+
Y([
|
|
4161
|
+
be({ type: String })
|
|
4162
|
+
], U.prototype, "autocomplete", 2);
|
|
4163
|
+
Y([
|
|
4164
|
+
be({ attribute: !1 })
|
|
4165
|
+
], U.prototype, "formHealthBoundary", 2);
|
|
4166
|
+
Y([
|
|
4167
|
+
Mt("gui-core-form")
|
|
4168
|
+
], U.prototype, "coreForm", 2);
|
|
4169
|
+
U = Y([
|
|
4170
|
+
Rt("gui-form")
|
|
4171
|
+
], U);
|
|
3485
4172
|
export {
|
|
3486
|
-
|
|
3487
|
-
|
|
4173
|
+
U as FormElement,
|
|
4174
|
+
hi as widgetLoaders
|
|
3488
4175
|
};
|