@scbt-ecom/ui 0.0.32 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-D1IPbF1t.js +5213 -0
- package/dist/api-D1IPbF1t.js.map +1 -0
- package/dist/client.d.ts +4 -1
- package/dist/client.js +14127 -686
- package/dist/client.js.map +1 -0
- package/dist/hybrid.d.ts +18 -0
- package/dist/hybrid.js +3562 -0
- package/dist/hybrid.js.map +1 -0
- package/dist/shared/ui/CustomLink.d.ts +1 -1
- package/dist/shared/ui/button/Button.d.ts +1 -1
- package/dist/style.css +1 -0
- package/package.json +5 -7
- package/dist/cn-uh4jkx7b.js +0 -2892
- package/dist/server.d.ts +0 -2
- package/dist/server.js +0 -15
package/dist/hybrid.js
ADDED
|
@@ -0,0 +1,3562 @@
|
|
|
1
|
+
import { p as Le, j as y, c as b, a as E, I as Ie, i as Ye } from "./api-D1IPbF1t.js";
|
|
2
|
+
import { B as Gr, D as Hr, b as Jr, S as Yr } from "./api-D1IPbF1t.js";
|
|
3
|
+
import { forwardRef as $e } from "react";
|
|
4
|
+
const br = (r, e) => JSON.stringify(r) === JSON.stringify(e), xr = typeof window < "u" && window.document !== void 0, Ce = (r) => r.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join("-"), kr = (r, e = "dd.MM.yyyy") => Le(r, e, /* @__PURE__ */ new Date()), wr = ({ children: r, className: e, ...t }) => /* @__PURE__ */ y.jsx("section", { className: b("pb-16 desktop:pb-20", e), ...t, children: r }), Xe = ({ children: r, className: e }) => /* @__PURE__ */ y.jsx("div", { className: b("w-full px-4 m-auto desktop:max-w-[1188px]", e), children: r }), Qe = E("", {
|
|
5
|
+
variants: {
|
|
6
|
+
as: {
|
|
7
|
+
h1: "mob-headline-bold-m desktop:desk-headline-bold-l",
|
|
8
|
+
h2: "mob-headline-bold-s desktop:desk-headline-bold-m",
|
|
9
|
+
h3: "mob-title-bold-l desktop:desk-title-bold-l",
|
|
10
|
+
h4: "mob-title-bold-m desktop:desk-title-bold-s"
|
|
11
|
+
// # add h5 and h6 if need
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
as: "h2"
|
|
16
|
+
}
|
|
17
|
+
}), Ke = ({ as: r = "h2", children: e, className: t, ...n }) => {
|
|
18
|
+
const a = r;
|
|
19
|
+
return /* @__PURE__ */ y.jsx(a, { className: b(Qe({ as: r }), t), ...n, children: e });
|
|
20
|
+
}, et = E("grid", {
|
|
21
|
+
variants: {
|
|
22
|
+
columnCount: {
|
|
23
|
+
twoColumns: "grid-cols-[repeat(2,minmax(172px,_1fr))] desktop:grid-cols-[repeat(2,minmax(172px,_1fr))]",
|
|
24
|
+
threeColumns: "grid-cols-[repeat(3,minmax(172px,_1fr))] desktop:grid-cols-[repeat(3,minmax(312px,_1fr))]"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}), tt = E("grid", {
|
|
28
|
+
variants: {
|
|
29
|
+
columnCount: {
|
|
30
|
+
twoColumns: "",
|
|
31
|
+
threeColumns: ""
|
|
32
|
+
},
|
|
33
|
+
titlesExist: {
|
|
34
|
+
exist: "",
|
|
35
|
+
notExist: ""
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
compoundVariants: [
|
|
39
|
+
{
|
|
40
|
+
titlesExist: "notExist",
|
|
41
|
+
columnCount: "twoColumns",
|
|
42
|
+
class: "grid-rows-[repeat(2,_auto)] border-b border-warm-grey-200 py-4"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
titlesExist: "notExist",
|
|
46
|
+
columnCount: "threeColumns",
|
|
47
|
+
class: "grid-cols-[repeat(3,_auto)]"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
titlesExist: "exist",
|
|
51
|
+
columnCount: "twoColumns",
|
|
52
|
+
class: "grid-cols-[repeat(2,_auto)]"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
titlesExist: "exist",
|
|
56
|
+
columnCount: "threeColumns",
|
|
57
|
+
class: "grid-cols-[repeat(3,_auto)]"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}), rt = E("grid", {
|
|
61
|
+
variants: {
|
|
62
|
+
columnCount: {
|
|
63
|
+
twoColumns: "",
|
|
64
|
+
threeColumns: ""
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
compoundVariants: [
|
|
68
|
+
{
|
|
69
|
+
columnCount: "threeColumns",
|
|
70
|
+
class: "mobile:overflow-x-scroll mobile:max-w-[368px] mb-1"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}), nt = E("border-b border-warm-grey-200 py-4 desktop:desk-body-regular-l mob-body-regular-l", {
|
|
74
|
+
variants: {
|
|
75
|
+
columnCount: {
|
|
76
|
+
twoColumns: "",
|
|
77
|
+
threeColumns: ""
|
|
78
|
+
},
|
|
79
|
+
titlesExist: {
|
|
80
|
+
exist: "",
|
|
81
|
+
notExist: ""
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
compoundVariants: [
|
|
85
|
+
{
|
|
86
|
+
titlesExist: "notExist",
|
|
87
|
+
columnCount: "twoColumns",
|
|
88
|
+
class: "border-transparent border-0 p-0"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}), Tr = ({
|
|
92
|
+
headTitle: r,
|
|
93
|
+
tableRows: e,
|
|
94
|
+
tableHead: t,
|
|
95
|
+
additionalText: n,
|
|
96
|
+
columnCount: a,
|
|
97
|
+
classes: s
|
|
98
|
+
}) => {
|
|
99
|
+
const i = t && t.length > 0 ? "exist" : "notExist";
|
|
100
|
+
return /* @__PURE__ */ y.jsx(Xe, { children: /* @__PURE__ */ y.jsxs("div", { className: b("flex flex-col", s == null ? void 0 : s.tableRootWrapper), children: [
|
|
101
|
+
/* @__PURE__ */ y.jsx(Ke, { as: "h3", className: b("mob-title-bold-m desktop:desk-title-bold-s pb-6", s == null ? void 0 : s.tableHeading), children: r }),
|
|
102
|
+
/* @__PURE__ */ y.jsxs("div", { className: b(rt({ columnCount: a }), s == null ? void 0 : s.tableBody), children: [
|
|
103
|
+
/* @__PURE__ */ y.jsx("ul", { className: b(et({ columnCount: a }), s == null ? void 0 : s.tableTitlesContainer), children: t == null ? void 0 : t.map((o) => /* @__PURE__ */ y.jsx(
|
|
104
|
+
"li",
|
|
105
|
+
{
|
|
106
|
+
className: b(
|
|
107
|
+
"border-b border-warm-grey-200 mob-body-regular-l desktop:desk-body-regular-l py-4",
|
|
108
|
+
s == null ? void 0 : s.tableTitleRow
|
|
109
|
+
),
|
|
110
|
+
children: o
|
|
111
|
+
},
|
|
112
|
+
o
|
|
113
|
+
)) }),
|
|
114
|
+
/* @__PURE__ */ y.jsx("ul", { className: b("mb-4 flex flex-col", s == null ? void 0 : s.tableBodyContainer), children: e.map((o) => /* @__PURE__ */ y.jsx("li", { className: b(tt({ columnCount: a, titlesExist: i }), s == null ? void 0 : s.tableBodyRow), children: o.map((c) => /* @__PURE__ */ y.jsx("p", { className: b(nt({ titlesExist: i, columnCount: a }), s == null ? void 0 : s.tableBodyCeil), children: c.text })) })) })
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ y.jsx("p", { className: b("mob-body-regular-m desktop:desk-body-regular-l", s == null ? void 0 : s.tableAdditionalText), children: n })
|
|
117
|
+
] }) });
|
|
118
|
+
}, Cr = ({ linksList: r }) => /* @__PURE__ */ y.jsx("div", { "aria-label": "Breadcrumb", className: "max-w-[840px] flex items-center gap-2", children: r.map((e) => /* @__PURE__ */ y.jsx(y.Fragment, { children: "path" in e ? /* @__PURE__ */ y.jsxs(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
className: b(
|
|
122
|
+
"flex items-center gap-1 px-1 border-2 border-solid border-transparent rounded-sm focus-within:border-primary-focus",
|
|
123
|
+
{ "!border-transparent pointer-events-none": e == null ? void 0 : e.isDisabled }
|
|
124
|
+
),
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ y.jsx(
|
|
127
|
+
"a",
|
|
128
|
+
{
|
|
129
|
+
href: e.path,
|
|
130
|
+
target: "_blank",
|
|
131
|
+
rel: "noreferrer",
|
|
132
|
+
className: b(
|
|
133
|
+
"desk-body-regular-m text-color-primary-default hover:text-color-primary-hover outline-none focus:text-color-primary-default",
|
|
134
|
+
{ "!text-color-disabled": e == null ? void 0 : e.isDisabled }
|
|
135
|
+
),
|
|
136
|
+
children: e.label
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ y.jsx(
|
|
140
|
+
Ie,
|
|
141
|
+
{
|
|
142
|
+
name: "arrows/arrowRight",
|
|
143
|
+
className: b("text-icon-primary-default size-4", { "!text-icon-disabled": e == null ? void 0 : e.isDisabled })
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
) : /* @__PURE__ */ y.jsx("div", { "aria-current": "page", className: "text-color-blue-grey-600 desk-body-regular-m", children: e.label }) })) }), at = E("", {
|
|
149
|
+
variants: {
|
|
150
|
+
position: {
|
|
151
|
+
absolute: "absolute",
|
|
152
|
+
static: "static",
|
|
153
|
+
fixed: "fixed"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
defaultVariants: {
|
|
157
|
+
position: "static"
|
|
158
|
+
}
|
|
159
|
+
}), st = E("border-2 border-solid block animate-spin rounded-full", {
|
|
160
|
+
variants: {
|
|
161
|
+
intent: {
|
|
162
|
+
primary: "border-white border-b-transparent",
|
|
163
|
+
secondary: "border-primary-default border-b-transparent"
|
|
164
|
+
},
|
|
165
|
+
size: {
|
|
166
|
+
sm: "size-5 border-2",
|
|
167
|
+
md: "size-8 border-2",
|
|
168
|
+
lg: "size-12 border-4"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
defaultVariants: {
|
|
172
|
+
size: "md",
|
|
173
|
+
intent: "primary"
|
|
174
|
+
}
|
|
175
|
+
}), it = ({ size: r = "md", classes: e, intent: t = "secondary", position: n = "static", text: a, ...s }) => /* @__PURE__ */ y.jsxs("div", { className: b(at({ position: n }), { "flex flex-col items-center gap-2": a }, e == null ? void 0 : e.wrapper), children: [
|
|
176
|
+
/* @__PURE__ */ y.jsx("span", { "data-testid": "loader", className: b(st({ size: r, intent: t }), e == null ? void 0 : e.loader), ...s }),
|
|
177
|
+
a && /* @__PURE__ */ y.jsx("p", { className: b("desk-body-regular-l text-color-dark", e == null ? void 0 : e.text), children: a })
|
|
178
|
+
] }), ot = (r) => {
|
|
179
|
+
switch (r) {
|
|
180
|
+
case "ghost":
|
|
181
|
+
case "secondary":
|
|
182
|
+
return "secondary";
|
|
183
|
+
case "primary":
|
|
184
|
+
case "red":
|
|
185
|
+
return "primary";
|
|
186
|
+
default:
|
|
187
|
+
return r;
|
|
188
|
+
}
|
|
189
|
+
}, dt = E(
|
|
190
|
+
"relative flex items-center justify-center gap-4 cursor-pointer rounded-sm w-[216px] outline-offset-4 outline-transparent outline-2 desk-body-regular-l transition duration-12 active:scale-[0.97] disabled:pointer-events-none",
|
|
191
|
+
{
|
|
192
|
+
variants: {
|
|
193
|
+
intent: {
|
|
194
|
+
primary: "bg-color-primary-default text-color-white outline-offset-[3px] hover:bg-color-primary-hover active:bg-color-primary-hover focus:bg-color-primary-default focus:outline-primary-focus disabled:bg-color-primary-disabled",
|
|
195
|
+
secondary: "bg-transparent text-color-primary-default border border-solid border-primary-default hover:bg-color-primary-tr-hover active:bg-color-primary-tr-pressed active:border-primary-hover focus:outline-primary-focus focus:bg-color-primary-tr-focus disabled:bg-color-blue-grey-200 disabled:text-color-primary-disabled disabled:border-transparent",
|
|
196
|
+
ghost: "bg-transparent text-color-primary-default hover:bg-color-primary-tr-hover hover:text-color-primary-hover focus:bg-color-primary-tr-focus focus:outline-primary-focus active:bg-color-primary-tr-pressed active:text-color-primary-hover disabled:text-color-primary-disabled disabled:bg-transparent",
|
|
197
|
+
red: "bg-color-secondary-default text-color-white outline-offset-[3px] hover:bg-color-secondary-hover disabled:bg-color-secondary-disabled active:bg-color-secondary-hover focus:bg-color-secondary-default focus:outline-primary-focus"
|
|
198
|
+
},
|
|
199
|
+
size: {
|
|
200
|
+
sm: "h-10",
|
|
201
|
+
md: "h-12",
|
|
202
|
+
lg: "h-14"
|
|
203
|
+
},
|
|
204
|
+
textFormat: {
|
|
205
|
+
capitalize: "capitalize",
|
|
206
|
+
uppercase: "uppercase",
|
|
207
|
+
lowercase: "lowercase",
|
|
208
|
+
initial: "initial"
|
|
209
|
+
},
|
|
210
|
+
isLoading: {
|
|
211
|
+
true: "",
|
|
212
|
+
false: ""
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
compoundVariants: [
|
|
216
|
+
{
|
|
217
|
+
intent: "primary",
|
|
218
|
+
isLoading: !0,
|
|
219
|
+
class: "!bg-color-primary-default"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
intent: "secondary",
|
|
223
|
+
isLoading: !0,
|
|
224
|
+
class: "!bg-color-transparent !border-primary-hover"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
intent: "ghost",
|
|
228
|
+
isLoading: !0,
|
|
229
|
+
class: "!bg-color-blue-grey-200"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
intent: "red",
|
|
233
|
+
isLoading: !0,
|
|
234
|
+
class: "!bg-color-secondary-default"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
defaultVariants: {
|
|
238
|
+
intent: "primary",
|
|
239
|
+
size: "md",
|
|
240
|
+
textFormat: "initial"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
), Nr = $e(
|
|
244
|
+
({
|
|
245
|
+
intent: r,
|
|
246
|
+
size: e,
|
|
247
|
+
className: t,
|
|
248
|
+
children: n,
|
|
249
|
+
type: a = "button",
|
|
250
|
+
iconLeft: s,
|
|
251
|
+
iconRight: i,
|
|
252
|
+
disabled: o = !1,
|
|
253
|
+
isLoading: c = !1,
|
|
254
|
+
textFormat: l,
|
|
255
|
+
...m
|
|
256
|
+
}, C) => /* @__PURE__ */ y.jsx(
|
|
257
|
+
"button",
|
|
258
|
+
{
|
|
259
|
+
ref: C,
|
|
260
|
+
type: a,
|
|
261
|
+
disabled: o || c,
|
|
262
|
+
className: b(dt({ intent: r, size: e, textFormat: l, isLoading: c }), t),
|
|
263
|
+
...m,
|
|
264
|
+
children: c ? /* @__PURE__ */ y.jsx(it, { size: "sm", intent: ot(r) }) : /* @__PURE__ */ y.jsxs(y.Fragment, { children: [
|
|
265
|
+
s && /* @__PURE__ */ y.jsx("span", { className: "size-5 flex items-center justify-center", children: s }),
|
|
266
|
+
n,
|
|
267
|
+
i && /* @__PURE__ */ y.jsx("span", { className: "size-5 flex items-center justify-center", children: i })
|
|
268
|
+
] })
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
), ct = E(
|
|
272
|
+
"group flex items-center justify-center cursor-pointer rounded-full outline-offset-[3px] outline-transparent outline-2 transition duration-12 active:scale-[0.97] disabled:pointer-events-none",
|
|
273
|
+
{
|
|
274
|
+
variants: {
|
|
275
|
+
intent: {
|
|
276
|
+
primary: "text-icon-white bg-color-primary-default hover:bg-color-primary-hover active:bg-color-primary-hover focus:bg-color-primary-hover focus:outline-primary-focus disabled:bg-color-primary-disabled",
|
|
277
|
+
secondary: "text-icon-primary-default bg-color-transparent border border-solid outline-offset-4 border-primary-default hover:bg-color-primary-tr-hover hover:text-icon-primary-default hover:border-primary-hover active:bg-color-primary-tr-pressed active:border-primary-hover active:text-icon-primary-hover focus:bg-color-primary-tr-focus focus:outline-primary-focus disabled:bg-color-blue-grey-200 disabled:border-transparent disabled:text-icon-primary-disabled",
|
|
278
|
+
ghost: "text-icon-primary-default bg-color-transparent hover:bg-color-primary-tr-hover focus:bg-color-primary-tr-focus focus:outline-primary-focus active:text-icon-primary-hover active:bg-color-primary-tr-pressed disabled:bg-color-transparent disabled:text-icon-primary-disabled"
|
|
279
|
+
},
|
|
280
|
+
size: {
|
|
281
|
+
sm: "size-8",
|
|
282
|
+
md: "size-10",
|
|
283
|
+
lg: "size-12"
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
defaultVariants: {
|
|
287
|
+
intent: "primary",
|
|
288
|
+
size: "lg"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
), Er = $e(
|
|
292
|
+
({ size: r, intent: e, children: t, classes: n, type: a = "button", ...s }, i) => /* @__PURE__ */ y.jsx("button", { ref: i, type: a, className: b(ct({ intent: e, size: r }), n == null ? void 0 : n.button), ...s, children: /* @__PURE__ */ y.jsx("span", { className: b(n == null ? void 0 : n.icon), children: t }) })
|
|
293
|
+
), lt = E(
|
|
294
|
+
"group desk-body-regular-l underline underline-offset-4 outline-none p-[2px] rounded-sm border border-solid border-transparent",
|
|
295
|
+
{
|
|
296
|
+
variants: {
|
|
297
|
+
intent: {
|
|
298
|
+
blue: "text-color-primary-default hover:text-color-primary-hover focus:text-color-primary-default focus:border-primary-focus",
|
|
299
|
+
white: "text-color-white hover:text-color-footer focus:text-color-white focus:border-primary-focus"
|
|
300
|
+
},
|
|
301
|
+
withIcon: {
|
|
302
|
+
true: "flex items-center gap-1",
|
|
303
|
+
false: ""
|
|
304
|
+
},
|
|
305
|
+
disabled: {
|
|
306
|
+
true: "!text-color-primary-disabled pointer-events-none !border-transparent",
|
|
307
|
+
false: ""
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
defaultVariants: {
|
|
311
|
+
intent: "blue",
|
|
312
|
+
withIcon: !0,
|
|
313
|
+
disabled: !1
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
), ut = E("size-6", {
|
|
317
|
+
variants: {
|
|
318
|
+
intent: {
|
|
319
|
+
blue: "text-icon-primary-default group-hover:text-icon-primary-hover group-focus:text-icon-primary-default ",
|
|
320
|
+
white: "text-icon-white group-hover:text-icon-footer group-focus:text-icon-white"
|
|
321
|
+
},
|
|
322
|
+
disabled: {
|
|
323
|
+
true: "!text-icon-primary-disabled pointer-events-none",
|
|
324
|
+
false: ""
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
defaultVariants: {
|
|
328
|
+
intent: "blue",
|
|
329
|
+
disabled: !1
|
|
330
|
+
}
|
|
331
|
+
}), Zr = ({
|
|
332
|
+
Component: r,
|
|
333
|
+
intent: e,
|
|
334
|
+
children: t,
|
|
335
|
+
withIcon: n,
|
|
336
|
+
disabled: a,
|
|
337
|
+
icon: s = "arrows/arrowLink",
|
|
338
|
+
...i
|
|
339
|
+
}) => /* @__PURE__ */ y.jsxs(r, { className: b(lt({ intent: e, withIcon: n, disabled: a })), ...i, children: [
|
|
340
|
+
t,
|
|
341
|
+
n && /* @__PURE__ */ y.jsx(Ie, { name: s, className: b(ut({ intent: e, disabled: a })) })
|
|
342
|
+
] }), ft = E("size-8 transition-colors", {
|
|
343
|
+
variants: {
|
|
344
|
+
intent: {
|
|
345
|
+
outline: "text-icon-secondary-dark-default group-hover:text-icon-secondary-dark-hover",
|
|
346
|
+
filled: "text-icon-primary-default group-hover:text-icon-primary-hover"
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
defaultVariants: {
|
|
350
|
+
intent: "outline"
|
|
351
|
+
}
|
|
352
|
+
}), pt = {
|
|
353
|
+
filled: "files/documentFilled",
|
|
354
|
+
outline: "files/documentOutline"
|
|
355
|
+
}, jr = ({ text: r, size: e, sizeType: t, href: n, intent: a = "outline" }) => /* @__PURE__ */ y.jsxs(
|
|
356
|
+
"a",
|
|
357
|
+
{
|
|
358
|
+
href: n,
|
|
359
|
+
target: "_blank",
|
|
360
|
+
rel: "noreferrer",
|
|
361
|
+
tabIndex: 0,
|
|
362
|
+
className: b(
|
|
363
|
+
"flex items-center gap-2 cursor-pointer group outline outline-2 outline-transparent transition-colors focus-within:outline-primary-focus rounded-sm p-1 max-w-[288px] desktop:max-w-[592px]"
|
|
364
|
+
),
|
|
365
|
+
children: [
|
|
366
|
+
/* @__PURE__ */ y.jsx(Ie, { name: pt[a], className: b(ft({ intent: a })) }),
|
|
367
|
+
/* @__PURE__ */ y.jsxs("div", { className: b("flex flex-col flex-1"), children: [
|
|
368
|
+
/* @__PURE__ */ y.jsx("p", { className: b("desk-body-medium-l text-color-dark "), children: r }),
|
|
369
|
+
/* @__PURE__ */ y.jsxs("div", { className: b("desk-body-regular-m text-color-disabled"), children: [
|
|
370
|
+
e,
|
|
371
|
+
" ",
|
|
372
|
+
t
|
|
373
|
+
] })
|
|
374
|
+
] })
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
), Sr = ({ phone: r, text: e, classes: t }) => /* @__PURE__ */ y.jsxs("div", { className: b("flex flex-col", t == null ? void 0 : t.wrapper), children: [
|
|
378
|
+
/* @__PURE__ */ y.jsx("a", { href: `tel:${r}`, className: b("text-color-dark desk-body-medium-l", t == null ? void 0 : t.link), children: r }),
|
|
379
|
+
/* @__PURE__ */ y.jsx("p", { className: b("text-color-tetriary desk-body-regular-l", t == null ? void 0 : t.text), children: e })
|
|
380
|
+
] }), Ir = ({ topContent: r, bottomContent: e, progress: t, maxPercent: n = 100, classes: a }) => /* @__PURE__ */ y.jsxs("div", { className: b("flex flex-col", a == null ? void 0 : a.wrapper), children: [
|
|
381
|
+
r && /* @__PURE__ */ y.jsx("div", { className: b("flex justify-between gap-5 mb-2", a == null ? void 0 : a.topContent), children: r }),
|
|
382
|
+
/* @__PURE__ */ y.jsxs("div", { className: b("relative w-[328xp] desktop:w-[524px] h-2 rounded-md bg-color-blue-grey-100", a == null ? void 0 : a.progressBar), children: [
|
|
383
|
+
/* @__PURE__ */ y.jsx(
|
|
384
|
+
"div",
|
|
385
|
+
{
|
|
386
|
+
style: { width: `${t}%` },
|
|
387
|
+
className: b("relative transition-all bg-color-positive h-2 rounded-md z-[4]", a == null ? void 0 : a.progress)
|
|
388
|
+
}
|
|
389
|
+
),
|
|
390
|
+
/* @__PURE__ */ y.jsx(
|
|
391
|
+
"span",
|
|
392
|
+
{
|
|
393
|
+
style: { maxWidth: `${n}%` },
|
|
394
|
+
className: b(
|
|
395
|
+
"absolute z-[2] h-full w-full rounded-md top-1/2 -translate-y-1/2 progressBar-apply animate-progress-loader",
|
|
396
|
+
a == null ? void 0 : a.loader
|
|
397
|
+
)
|
|
398
|
+
}
|
|
399
|
+
)
|
|
400
|
+
] }),
|
|
401
|
+
e && /* @__PURE__ */ y.jsx("div", { className: b("flex justify-between gap-5 mt-2", a == null ? void 0 : a.bottomContent), children: e })
|
|
402
|
+
] }), Or = ({ className: r }) => /* @__PURE__ */ y.jsx("div", { className: b("skeleton-apply h-full w-full", r) }), ht = /^[\u0400-\u04FF\u00CB\u00EB -]+$/, Ae = /^(?:[^-]+(?:-[^-]+){0,4}|[^-]+)$/, mt = /^[a-zA-Zа-яА-ЯёЁ]+(?:\s*-\s*[a-zA-Zа-яА-ЯёЁ]+){0,4}(?:\s+[a-zA-Zа-яА-ЯёЁ]+(?:\s*-\s*[a-zA-Zа-яА-ЯёЁ]+){0,4})?$/i, me = {
|
|
403
|
+
REQUIRED: "Поле обязательно к заполнению",
|
|
404
|
+
MIN_LENGTH: "Минимальная длина символов должна быть не менее",
|
|
405
|
+
MAX_LENGTH: "Максимальная длина символов должна быть не более",
|
|
406
|
+
FIX_LENGTH: "Длина символов должна быть равна",
|
|
407
|
+
MAX_LENGTH_ELEMENTS: "Максимальное количество элементов должно быть не более",
|
|
408
|
+
MIN_LENGTH_ELEMENTS: "Минимальное количество элементов должно быть не менее",
|
|
409
|
+
FIX_LENGTH_ELEMENTS: "Количество элементов должно быть равно",
|
|
410
|
+
INVALID_VALUE: "Поле заполнено некорректно",
|
|
411
|
+
INVALID_DATE: "Введите корректную дату",
|
|
412
|
+
FUTURE_DATE_NOT_ALLOWED: "Нельзя выбрать дату позже текущей"
|
|
413
|
+
};
|
|
414
|
+
var x;
|
|
415
|
+
(function(r) {
|
|
416
|
+
r.assertEqual = (a) => a;
|
|
417
|
+
function e(a) {
|
|
418
|
+
}
|
|
419
|
+
r.assertIs = e;
|
|
420
|
+
function t(a) {
|
|
421
|
+
throw new Error();
|
|
422
|
+
}
|
|
423
|
+
r.assertNever = t, r.arrayToEnum = (a) => {
|
|
424
|
+
const s = {};
|
|
425
|
+
for (const i of a)
|
|
426
|
+
s[i] = i;
|
|
427
|
+
return s;
|
|
428
|
+
}, r.getValidEnumValues = (a) => {
|
|
429
|
+
const s = r.objectKeys(a).filter((o) => typeof a[a[o]] != "number"), i = {};
|
|
430
|
+
for (const o of s)
|
|
431
|
+
i[o] = a[o];
|
|
432
|
+
return r.objectValues(i);
|
|
433
|
+
}, r.objectValues = (a) => r.objectKeys(a).map(function(s) {
|
|
434
|
+
return a[s];
|
|
435
|
+
}), r.objectKeys = typeof Object.keys == "function" ? (a) => Object.keys(a) : (a) => {
|
|
436
|
+
const s = [];
|
|
437
|
+
for (const i in a)
|
|
438
|
+
Object.prototype.hasOwnProperty.call(a, i) && s.push(i);
|
|
439
|
+
return s;
|
|
440
|
+
}, r.find = (a, s) => {
|
|
441
|
+
for (const i of a)
|
|
442
|
+
if (s(i))
|
|
443
|
+
return i;
|
|
444
|
+
}, r.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && isFinite(a) && Math.floor(a) === a;
|
|
445
|
+
function n(a, s = " | ") {
|
|
446
|
+
return a.map((i) => typeof i == "string" ? `'${i}'` : i).join(s);
|
|
447
|
+
}
|
|
448
|
+
r.joinValues = n, r.jsonStringifyReplacer = (a, s) => typeof s == "bigint" ? s.toString() : s;
|
|
449
|
+
})(x || (x = {}));
|
|
450
|
+
var Ee;
|
|
451
|
+
(function(r) {
|
|
452
|
+
r.mergeShapes = (e, t) => ({
|
|
453
|
+
...e,
|
|
454
|
+
...t
|
|
455
|
+
// second overwrites first
|
|
456
|
+
});
|
|
457
|
+
})(Ee || (Ee = {}));
|
|
458
|
+
const f = x.arrayToEnum([
|
|
459
|
+
"string",
|
|
460
|
+
"nan",
|
|
461
|
+
"number",
|
|
462
|
+
"integer",
|
|
463
|
+
"float",
|
|
464
|
+
"boolean",
|
|
465
|
+
"date",
|
|
466
|
+
"bigint",
|
|
467
|
+
"symbol",
|
|
468
|
+
"function",
|
|
469
|
+
"undefined",
|
|
470
|
+
"null",
|
|
471
|
+
"array",
|
|
472
|
+
"object",
|
|
473
|
+
"unknown",
|
|
474
|
+
"promise",
|
|
475
|
+
"void",
|
|
476
|
+
"never",
|
|
477
|
+
"map",
|
|
478
|
+
"set"
|
|
479
|
+
]), D = (r) => {
|
|
480
|
+
switch (typeof r) {
|
|
481
|
+
case "undefined":
|
|
482
|
+
return f.undefined;
|
|
483
|
+
case "string":
|
|
484
|
+
return f.string;
|
|
485
|
+
case "number":
|
|
486
|
+
return isNaN(r) ? f.nan : f.number;
|
|
487
|
+
case "boolean":
|
|
488
|
+
return f.boolean;
|
|
489
|
+
case "function":
|
|
490
|
+
return f.function;
|
|
491
|
+
case "bigint":
|
|
492
|
+
return f.bigint;
|
|
493
|
+
case "symbol":
|
|
494
|
+
return f.symbol;
|
|
495
|
+
case "object":
|
|
496
|
+
return Array.isArray(r) ? f.array : r === null ? f.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? f.promise : typeof Map < "u" && r instanceof Map ? f.map : typeof Set < "u" && r instanceof Set ? f.set : typeof Date < "u" && r instanceof Date ? f.date : f.object;
|
|
497
|
+
default:
|
|
498
|
+
return f.unknown;
|
|
499
|
+
}
|
|
500
|
+
}, d = x.arrayToEnum([
|
|
501
|
+
"invalid_type",
|
|
502
|
+
"invalid_literal",
|
|
503
|
+
"custom",
|
|
504
|
+
"invalid_union",
|
|
505
|
+
"invalid_union_discriminator",
|
|
506
|
+
"invalid_enum_value",
|
|
507
|
+
"unrecognized_keys",
|
|
508
|
+
"invalid_arguments",
|
|
509
|
+
"invalid_return_type",
|
|
510
|
+
"invalid_date",
|
|
511
|
+
"invalid_string",
|
|
512
|
+
"too_small",
|
|
513
|
+
"too_big",
|
|
514
|
+
"invalid_intersection_types",
|
|
515
|
+
"not_multiple_of",
|
|
516
|
+
"not_finite"
|
|
517
|
+
]), yt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
518
|
+
class N extends Error {
|
|
519
|
+
constructor(e) {
|
|
520
|
+
super(), this.issues = [], this.addIssue = (n) => {
|
|
521
|
+
this.issues = [...this.issues, n];
|
|
522
|
+
}, this.addIssues = (n = []) => {
|
|
523
|
+
this.issues = [...this.issues, ...n];
|
|
524
|
+
};
|
|
525
|
+
const t = new.target.prototype;
|
|
526
|
+
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
527
|
+
}
|
|
528
|
+
get errors() {
|
|
529
|
+
return this.issues;
|
|
530
|
+
}
|
|
531
|
+
format(e) {
|
|
532
|
+
const t = e || function(s) {
|
|
533
|
+
return s.message;
|
|
534
|
+
}, n = { _errors: [] }, a = (s) => {
|
|
535
|
+
for (const i of s.issues)
|
|
536
|
+
if (i.code === "invalid_union")
|
|
537
|
+
i.unionErrors.map(a);
|
|
538
|
+
else if (i.code === "invalid_return_type")
|
|
539
|
+
a(i.returnTypeError);
|
|
540
|
+
else if (i.code === "invalid_arguments")
|
|
541
|
+
a(i.argumentsError);
|
|
542
|
+
else if (i.path.length === 0)
|
|
543
|
+
n._errors.push(t(i));
|
|
544
|
+
else {
|
|
545
|
+
let o = n, c = 0;
|
|
546
|
+
for (; c < i.path.length; ) {
|
|
547
|
+
const l = i.path[c];
|
|
548
|
+
c === i.path.length - 1 ? (o[l] = o[l] || { _errors: [] }, o[l]._errors.push(t(i))) : o[l] = o[l] || { _errors: [] }, o = o[l], c++;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
return a(this), n;
|
|
553
|
+
}
|
|
554
|
+
static assert(e) {
|
|
555
|
+
if (!(e instanceof N))
|
|
556
|
+
throw new Error(`Not a ZodError: ${e}`);
|
|
557
|
+
}
|
|
558
|
+
toString() {
|
|
559
|
+
return this.message;
|
|
560
|
+
}
|
|
561
|
+
get message() {
|
|
562
|
+
return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
|
|
563
|
+
}
|
|
564
|
+
get isEmpty() {
|
|
565
|
+
return this.issues.length === 0;
|
|
566
|
+
}
|
|
567
|
+
flatten(e = (t) => t.message) {
|
|
568
|
+
const t = {}, n = [];
|
|
569
|
+
for (const a of this.issues)
|
|
570
|
+
a.path.length > 0 ? (t[a.path[0]] = t[a.path[0]] || [], t[a.path[0]].push(e(a))) : n.push(e(a));
|
|
571
|
+
return { formErrors: n, fieldErrors: t };
|
|
572
|
+
}
|
|
573
|
+
get formErrors() {
|
|
574
|
+
return this.flatten();
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
N.create = (r) => new N(r);
|
|
578
|
+
const H = (r, e) => {
|
|
579
|
+
let t;
|
|
580
|
+
switch (r.code) {
|
|
581
|
+
case d.invalid_type:
|
|
582
|
+
r.received === f.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
583
|
+
break;
|
|
584
|
+
case d.invalid_literal:
|
|
585
|
+
t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
|
|
586
|
+
break;
|
|
587
|
+
case d.unrecognized_keys:
|
|
588
|
+
t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
|
|
589
|
+
break;
|
|
590
|
+
case d.invalid_union:
|
|
591
|
+
t = "Invalid input";
|
|
592
|
+
break;
|
|
593
|
+
case d.invalid_union_discriminator:
|
|
594
|
+
t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
|
|
595
|
+
break;
|
|
596
|
+
case d.invalid_enum_value:
|
|
597
|
+
t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
|
|
598
|
+
break;
|
|
599
|
+
case d.invalid_arguments:
|
|
600
|
+
t = "Invalid function arguments";
|
|
601
|
+
break;
|
|
602
|
+
case d.invalid_return_type:
|
|
603
|
+
t = "Invalid function return type";
|
|
604
|
+
break;
|
|
605
|
+
case d.invalid_date:
|
|
606
|
+
t = "Invalid date";
|
|
607
|
+
break;
|
|
608
|
+
case d.invalid_string:
|
|
609
|
+
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
|
|
610
|
+
break;
|
|
611
|
+
case d.too_small:
|
|
612
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
613
|
+
break;
|
|
614
|
+
case d.too_big:
|
|
615
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
|
|
616
|
+
break;
|
|
617
|
+
case d.custom:
|
|
618
|
+
t = "Invalid input";
|
|
619
|
+
break;
|
|
620
|
+
case d.invalid_intersection_types:
|
|
621
|
+
t = "Intersection results could not be merged";
|
|
622
|
+
break;
|
|
623
|
+
case d.not_multiple_of:
|
|
624
|
+
t = `Number must be a multiple of ${r.multipleOf}`;
|
|
625
|
+
break;
|
|
626
|
+
case d.not_finite:
|
|
627
|
+
t = "Number must be finite";
|
|
628
|
+
break;
|
|
629
|
+
default:
|
|
630
|
+
t = e.defaultError, x.assertNever(r);
|
|
631
|
+
}
|
|
632
|
+
return { message: t };
|
|
633
|
+
};
|
|
634
|
+
let ze = H;
|
|
635
|
+
function gt(r) {
|
|
636
|
+
ze = r;
|
|
637
|
+
}
|
|
638
|
+
function ye() {
|
|
639
|
+
return ze;
|
|
640
|
+
}
|
|
641
|
+
const ge = (r) => {
|
|
642
|
+
const { data: e, path: t, errorMaps: n, issueData: a } = r, s = [...t, ...a.path || []], i = {
|
|
643
|
+
...a,
|
|
644
|
+
path: s
|
|
645
|
+
};
|
|
646
|
+
if (a.message !== void 0)
|
|
647
|
+
return {
|
|
648
|
+
...a,
|
|
649
|
+
path: s,
|
|
650
|
+
message: a.message
|
|
651
|
+
};
|
|
652
|
+
let o = "";
|
|
653
|
+
const c = n.filter((l) => !!l).slice().reverse();
|
|
654
|
+
for (const l of c)
|
|
655
|
+
o = l(i, { data: e, defaultError: o }).message;
|
|
656
|
+
return {
|
|
657
|
+
...a,
|
|
658
|
+
path: s,
|
|
659
|
+
message: o
|
|
660
|
+
};
|
|
661
|
+
}, vt = [];
|
|
662
|
+
function u(r, e) {
|
|
663
|
+
const t = ye(), n = ge({
|
|
664
|
+
issueData: e,
|
|
665
|
+
data: r.data,
|
|
666
|
+
path: r.path,
|
|
667
|
+
errorMaps: [
|
|
668
|
+
r.common.contextualErrorMap,
|
|
669
|
+
r.schemaErrorMap,
|
|
670
|
+
t,
|
|
671
|
+
t === H ? void 0 : H
|
|
672
|
+
// then global default map
|
|
673
|
+
].filter((a) => !!a)
|
|
674
|
+
});
|
|
675
|
+
r.common.issues.push(n);
|
|
676
|
+
}
|
|
677
|
+
class w {
|
|
678
|
+
constructor() {
|
|
679
|
+
this.value = "valid";
|
|
680
|
+
}
|
|
681
|
+
dirty() {
|
|
682
|
+
this.value === "valid" && (this.value = "dirty");
|
|
683
|
+
}
|
|
684
|
+
abort() {
|
|
685
|
+
this.value !== "aborted" && (this.value = "aborted");
|
|
686
|
+
}
|
|
687
|
+
static mergeArray(e, t) {
|
|
688
|
+
const n = [];
|
|
689
|
+
for (const a of t) {
|
|
690
|
+
if (a.status === "aborted")
|
|
691
|
+
return g;
|
|
692
|
+
a.status === "dirty" && e.dirty(), n.push(a.value);
|
|
693
|
+
}
|
|
694
|
+
return { status: e.value, value: n };
|
|
695
|
+
}
|
|
696
|
+
static async mergeObjectAsync(e, t) {
|
|
697
|
+
const n = [];
|
|
698
|
+
for (const a of t) {
|
|
699
|
+
const s = await a.key, i = await a.value;
|
|
700
|
+
n.push({
|
|
701
|
+
key: s,
|
|
702
|
+
value: i
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
return w.mergeObjectSync(e, n);
|
|
706
|
+
}
|
|
707
|
+
static mergeObjectSync(e, t) {
|
|
708
|
+
const n = {};
|
|
709
|
+
for (const a of t) {
|
|
710
|
+
const { key: s, value: i } = a;
|
|
711
|
+
if (s.status === "aborted" || i.status === "aborted")
|
|
712
|
+
return g;
|
|
713
|
+
s.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), s.value !== "__proto__" && (typeof i.value < "u" || a.alwaysSet) && (n[s.value] = i.value);
|
|
714
|
+
}
|
|
715
|
+
return { status: e.value, value: n };
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
const g = Object.freeze({
|
|
719
|
+
status: "aborted"
|
|
720
|
+
}), F = (r) => ({ status: "dirty", value: r }), T = (r) => ({ status: "valid", value: r }), Ze = (r) => r.status === "aborted", je = (r) => r.status === "dirty", K = (r) => r.status === "valid", ee = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
721
|
+
function ve(r, e, t, n) {
|
|
722
|
+
if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
723
|
+
return e.get(r);
|
|
724
|
+
}
|
|
725
|
+
function Pe(r, e, t, n, a) {
|
|
726
|
+
if (typeof e == "function" ? r !== e || !a : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
727
|
+
return e.set(r, t), t;
|
|
728
|
+
}
|
|
729
|
+
var p;
|
|
730
|
+
(function(r) {
|
|
731
|
+
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
732
|
+
})(p || (p = {}));
|
|
733
|
+
var X, Q;
|
|
734
|
+
class R {
|
|
735
|
+
constructor(e, t, n, a) {
|
|
736
|
+
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = a;
|
|
737
|
+
}
|
|
738
|
+
get path() {
|
|
739
|
+
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
const Me = (r, e) => {
|
|
743
|
+
if (K(e))
|
|
744
|
+
return { success: !0, data: e.value };
|
|
745
|
+
if (!r.common.issues.length)
|
|
746
|
+
throw new Error("Validation failed but no issues detected.");
|
|
747
|
+
return {
|
|
748
|
+
success: !1,
|
|
749
|
+
get error() {
|
|
750
|
+
if (this._error)
|
|
751
|
+
return this._error;
|
|
752
|
+
const t = new N(r.common.issues);
|
|
753
|
+
return this._error = t, this._error;
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
function v(r) {
|
|
758
|
+
if (!r)
|
|
759
|
+
return {};
|
|
760
|
+
const { errorMap: e, invalid_type_error: t, required_error: n, description: a } = r;
|
|
761
|
+
if (e && (t || n))
|
|
762
|
+
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
763
|
+
return e ? { errorMap: e, description: a } : { errorMap: (i, o) => {
|
|
764
|
+
var c, l;
|
|
765
|
+
const { message: m } = r;
|
|
766
|
+
return i.code === "invalid_enum_value" ? { message: m ?? o.defaultError } : typeof o.data > "u" ? { message: (c = m ?? n) !== null && c !== void 0 ? c : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (l = m ?? t) !== null && l !== void 0 ? l : o.defaultError };
|
|
767
|
+
}, description: a };
|
|
768
|
+
}
|
|
769
|
+
class _ {
|
|
770
|
+
constructor(e) {
|
|
771
|
+
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
|
|
772
|
+
}
|
|
773
|
+
get description() {
|
|
774
|
+
return this._def.description;
|
|
775
|
+
}
|
|
776
|
+
_getType(e) {
|
|
777
|
+
return D(e.data);
|
|
778
|
+
}
|
|
779
|
+
_getOrReturnCtx(e, t) {
|
|
780
|
+
return t || {
|
|
781
|
+
common: e.parent.common,
|
|
782
|
+
data: e.data,
|
|
783
|
+
parsedType: D(e.data),
|
|
784
|
+
schemaErrorMap: this._def.errorMap,
|
|
785
|
+
path: e.path,
|
|
786
|
+
parent: e.parent
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
_processInputParams(e) {
|
|
790
|
+
return {
|
|
791
|
+
status: new w(),
|
|
792
|
+
ctx: {
|
|
793
|
+
common: e.parent.common,
|
|
794
|
+
data: e.data,
|
|
795
|
+
parsedType: D(e.data),
|
|
796
|
+
schemaErrorMap: this._def.errorMap,
|
|
797
|
+
path: e.path,
|
|
798
|
+
parent: e.parent
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
_parseSync(e) {
|
|
803
|
+
const t = this._parse(e);
|
|
804
|
+
if (ee(t))
|
|
805
|
+
throw new Error("Synchronous parse encountered promise.");
|
|
806
|
+
return t;
|
|
807
|
+
}
|
|
808
|
+
_parseAsync(e) {
|
|
809
|
+
const t = this._parse(e);
|
|
810
|
+
return Promise.resolve(t);
|
|
811
|
+
}
|
|
812
|
+
parse(e, t) {
|
|
813
|
+
const n = this.safeParse(e, t);
|
|
814
|
+
if (n.success)
|
|
815
|
+
return n.data;
|
|
816
|
+
throw n.error;
|
|
817
|
+
}
|
|
818
|
+
safeParse(e, t) {
|
|
819
|
+
var n;
|
|
820
|
+
const a = {
|
|
821
|
+
common: {
|
|
822
|
+
issues: [],
|
|
823
|
+
async: (n = t == null ? void 0 : t.async) !== null && n !== void 0 ? n : !1,
|
|
824
|
+
contextualErrorMap: t == null ? void 0 : t.errorMap
|
|
825
|
+
},
|
|
826
|
+
path: (t == null ? void 0 : t.path) || [],
|
|
827
|
+
schemaErrorMap: this._def.errorMap,
|
|
828
|
+
parent: null,
|
|
829
|
+
data: e,
|
|
830
|
+
parsedType: D(e)
|
|
831
|
+
}, s = this._parseSync({ data: e, path: a.path, parent: a });
|
|
832
|
+
return Me(a, s);
|
|
833
|
+
}
|
|
834
|
+
async parseAsync(e, t) {
|
|
835
|
+
const n = await this.safeParseAsync(e, t);
|
|
836
|
+
if (n.success)
|
|
837
|
+
return n.data;
|
|
838
|
+
throw n.error;
|
|
839
|
+
}
|
|
840
|
+
async safeParseAsync(e, t) {
|
|
841
|
+
const n = {
|
|
842
|
+
common: {
|
|
843
|
+
issues: [],
|
|
844
|
+
contextualErrorMap: t == null ? void 0 : t.errorMap,
|
|
845
|
+
async: !0
|
|
846
|
+
},
|
|
847
|
+
path: (t == null ? void 0 : t.path) || [],
|
|
848
|
+
schemaErrorMap: this._def.errorMap,
|
|
849
|
+
parent: null,
|
|
850
|
+
data: e,
|
|
851
|
+
parsedType: D(e)
|
|
852
|
+
}, a = this._parse({ data: e, path: n.path, parent: n }), s = await (ee(a) ? a : Promise.resolve(a));
|
|
853
|
+
return Me(n, s);
|
|
854
|
+
}
|
|
855
|
+
refine(e, t) {
|
|
856
|
+
const n = (a) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(a) : t;
|
|
857
|
+
return this._refinement((a, s) => {
|
|
858
|
+
const i = e(a), o = () => s.addIssue({
|
|
859
|
+
code: d.custom,
|
|
860
|
+
...n(a)
|
|
861
|
+
});
|
|
862
|
+
return typeof Promise < "u" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
refinement(e, t) {
|
|
866
|
+
return this._refinement((n, a) => e(n) ? !0 : (a.addIssue(typeof t == "function" ? t(n, a) : t), !1));
|
|
867
|
+
}
|
|
868
|
+
_refinement(e) {
|
|
869
|
+
return new S({
|
|
870
|
+
schema: this,
|
|
871
|
+
typeName: h.ZodEffects,
|
|
872
|
+
effect: { type: "refinement", refinement: e }
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
superRefine(e) {
|
|
876
|
+
return this._refinement(e);
|
|
877
|
+
}
|
|
878
|
+
optional() {
|
|
879
|
+
return O.create(this, this._def);
|
|
880
|
+
}
|
|
881
|
+
nullable() {
|
|
882
|
+
return P.create(this, this._def);
|
|
883
|
+
}
|
|
884
|
+
nullish() {
|
|
885
|
+
return this.nullable().optional();
|
|
886
|
+
}
|
|
887
|
+
array() {
|
|
888
|
+
return j.create(this, this._def);
|
|
889
|
+
}
|
|
890
|
+
promise() {
|
|
891
|
+
return Y.create(this, this._def);
|
|
892
|
+
}
|
|
893
|
+
or(e) {
|
|
894
|
+
return ae.create([this, e], this._def);
|
|
895
|
+
}
|
|
896
|
+
and(e) {
|
|
897
|
+
return se.create(this, e, this._def);
|
|
898
|
+
}
|
|
899
|
+
transform(e) {
|
|
900
|
+
return new S({
|
|
901
|
+
...v(this._def),
|
|
902
|
+
schema: this,
|
|
903
|
+
typeName: h.ZodEffects,
|
|
904
|
+
effect: { type: "transform", transform: e }
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
default(e) {
|
|
908
|
+
const t = typeof e == "function" ? e : () => e;
|
|
909
|
+
return new le({
|
|
910
|
+
...v(this._def),
|
|
911
|
+
innerType: this,
|
|
912
|
+
defaultValue: t,
|
|
913
|
+
typeName: h.ZodDefault
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
brand() {
|
|
917
|
+
return new Oe({
|
|
918
|
+
typeName: h.ZodBranded,
|
|
919
|
+
type: this,
|
|
920
|
+
...v(this._def)
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
catch(e) {
|
|
924
|
+
const t = typeof e == "function" ? e : () => e;
|
|
925
|
+
return new ue({
|
|
926
|
+
...v(this._def),
|
|
927
|
+
innerType: this,
|
|
928
|
+
catchValue: t,
|
|
929
|
+
typeName: h.ZodCatch
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
describe(e) {
|
|
933
|
+
const t = this.constructor;
|
|
934
|
+
return new t({
|
|
935
|
+
...this._def,
|
|
936
|
+
description: e
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
pipe(e) {
|
|
940
|
+
return pe.create(this, e);
|
|
941
|
+
}
|
|
942
|
+
readonly() {
|
|
943
|
+
return fe.create(this);
|
|
944
|
+
}
|
|
945
|
+
isOptional() {
|
|
946
|
+
return this.safeParse(void 0).success;
|
|
947
|
+
}
|
|
948
|
+
isNullable() {
|
|
949
|
+
return this.safeParse(null).success;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
const _t = /^c[^\s-]{8,}$/i, bt = /^[0-9a-z]+$/, xt = /^[0-9A-HJKMNP-TV-Z]{26}$/, kt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, wt = /^[a-z0-9_-]{21}$/i, Tt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ct = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Nt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
953
|
+
let Ne;
|
|
954
|
+
const Et = /^(?:(?: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])$/, Zt = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, jt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Be = "((\\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])))", St = new RegExp(`^${Be}$`);
|
|
955
|
+
function Ue(r) {
|
|
956
|
+
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
957
|
+
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
958
|
+
}
|
|
959
|
+
function It(r) {
|
|
960
|
+
return new RegExp(`^${Ue(r)}$`);
|
|
961
|
+
}
|
|
962
|
+
function We(r) {
|
|
963
|
+
let e = `${Be}T${Ue(r)}`;
|
|
964
|
+
const t = [];
|
|
965
|
+
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
966
|
+
}
|
|
967
|
+
function Ot(r, e) {
|
|
968
|
+
return !!((e === "v4" || !e) && Et.test(r) || (e === "v6" || !e) && Zt.test(r));
|
|
969
|
+
}
|
|
970
|
+
class Z extends _ {
|
|
971
|
+
_parse(e) {
|
|
972
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
|
|
973
|
+
const s = this._getOrReturnCtx(e);
|
|
974
|
+
return u(s, {
|
|
975
|
+
code: d.invalid_type,
|
|
976
|
+
expected: f.string,
|
|
977
|
+
received: s.parsedType
|
|
978
|
+
}), g;
|
|
979
|
+
}
|
|
980
|
+
const n = new w();
|
|
981
|
+
let a;
|
|
982
|
+
for (const s of this._def.checks)
|
|
983
|
+
if (s.kind === "min")
|
|
984
|
+
e.data.length < s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
985
|
+
code: d.too_small,
|
|
986
|
+
minimum: s.value,
|
|
987
|
+
type: "string",
|
|
988
|
+
inclusive: !0,
|
|
989
|
+
exact: !1,
|
|
990
|
+
message: s.message
|
|
991
|
+
}), n.dirty());
|
|
992
|
+
else if (s.kind === "max")
|
|
993
|
+
e.data.length > s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
994
|
+
code: d.too_big,
|
|
995
|
+
maximum: s.value,
|
|
996
|
+
type: "string",
|
|
997
|
+
inclusive: !0,
|
|
998
|
+
exact: !1,
|
|
999
|
+
message: s.message
|
|
1000
|
+
}), n.dirty());
|
|
1001
|
+
else if (s.kind === "length") {
|
|
1002
|
+
const i = e.data.length > s.value, o = e.data.length < s.value;
|
|
1003
|
+
(i || o) && (a = this._getOrReturnCtx(e, a), i ? u(a, {
|
|
1004
|
+
code: d.too_big,
|
|
1005
|
+
maximum: s.value,
|
|
1006
|
+
type: "string",
|
|
1007
|
+
inclusive: !0,
|
|
1008
|
+
exact: !0,
|
|
1009
|
+
message: s.message
|
|
1010
|
+
}) : o && u(a, {
|
|
1011
|
+
code: d.too_small,
|
|
1012
|
+
minimum: s.value,
|
|
1013
|
+
type: "string",
|
|
1014
|
+
inclusive: !0,
|
|
1015
|
+
exact: !0,
|
|
1016
|
+
message: s.message
|
|
1017
|
+
}), n.dirty());
|
|
1018
|
+
} else if (s.kind === "email")
|
|
1019
|
+
Ct.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1020
|
+
validation: "email",
|
|
1021
|
+
code: d.invalid_string,
|
|
1022
|
+
message: s.message
|
|
1023
|
+
}), n.dirty());
|
|
1024
|
+
else if (s.kind === "emoji")
|
|
1025
|
+
Ne || (Ne = new RegExp(Nt, "u")), Ne.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1026
|
+
validation: "emoji",
|
|
1027
|
+
code: d.invalid_string,
|
|
1028
|
+
message: s.message
|
|
1029
|
+
}), n.dirty());
|
|
1030
|
+
else if (s.kind === "uuid")
|
|
1031
|
+
kt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1032
|
+
validation: "uuid",
|
|
1033
|
+
code: d.invalid_string,
|
|
1034
|
+
message: s.message
|
|
1035
|
+
}), n.dirty());
|
|
1036
|
+
else if (s.kind === "nanoid")
|
|
1037
|
+
wt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1038
|
+
validation: "nanoid",
|
|
1039
|
+
code: d.invalid_string,
|
|
1040
|
+
message: s.message
|
|
1041
|
+
}), n.dirty());
|
|
1042
|
+
else if (s.kind === "cuid")
|
|
1043
|
+
_t.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1044
|
+
validation: "cuid",
|
|
1045
|
+
code: d.invalid_string,
|
|
1046
|
+
message: s.message
|
|
1047
|
+
}), n.dirty());
|
|
1048
|
+
else if (s.kind === "cuid2")
|
|
1049
|
+
bt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1050
|
+
validation: "cuid2",
|
|
1051
|
+
code: d.invalid_string,
|
|
1052
|
+
message: s.message
|
|
1053
|
+
}), n.dirty());
|
|
1054
|
+
else if (s.kind === "ulid")
|
|
1055
|
+
xt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1056
|
+
validation: "ulid",
|
|
1057
|
+
code: d.invalid_string,
|
|
1058
|
+
message: s.message
|
|
1059
|
+
}), n.dirty());
|
|
1060
|
+
else if (s.kind === "url")
|
|
1061
|
+
try {
|
|
1062
|
+
new URL(e.data);
|
|
1063
|
+
} catch {
|
|
1064
|
+
a = this._getOrReturnCtx(e, a), u(a, {
|
|
1065
|
+
validation: "url",
|
|
1066
|
+
code: d.invalid_string,
|
|
1067
|
+
message: s.message
|
|
1068
|
+
}), n.dirty();
|
|
1069
|
+
}
|
|
1070
|
+
else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1071
|
+
validation: "regex",
|
|
1072
|
+
code: d.invalid_string,
|
|
1073
|
+
message: s.message
|
|
1074
|
+
}), n.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1075
|
+
code: d.invalid_string,
|
|
1076
|
+
validation: { includes: s.value, position: s.position },
|
|
1077
|
+
message: s.message
|
|
1078
|
+
}), n.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1079
|
+
code: d.invalid_string,
|
|
1080
|
+
validation: { startsWith: s.value },
|
|
1081
|
+
message: s.message
|
|
1082
|
+
}), n.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1083
|
+
code: d.invalid_string,
|
|
1084
|
+
validation: { endsWith: s.value },
|
|
1085
|
+
message: s.message
|
|
1086
|
+
}), n.dirty()) : s.kind === "datetime" ? We(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1087
|
+
code: d.invalid_string,
|
|
1088
|
+
validation: "datetime",
|
|
1089
|
+
message: s.message
|
|
1090
|
+
}), n.dirty()) : s.kind === "date" ? St.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1091
|
+
code: d.invalid_string,
|
|
1092
|
+
validation: "date",
|
|
1093
|
+
message: s.message
|
|
1094
|
+
}), n.dirty()) : s.kind === "time" ? It(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1095
|
+
code: d.invalid_string,
|
|
1096
|
+
validation: "time",
|
|
1097
|
+
message: s.message
|
|
1098
|
+
}), n.dirty()) : s.kind === "duration" ? Tt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1099
|
+
validation: "duration",
|
|
1100
|
+
code: d.invalid_string,
|
|
1101
|
+
message: s.message
|
|
1102
|
+
}), n.dirty()) : s.kind === "ip" ? Ot(e.data, s.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1103
|
+
validation: "ip",
|
|
1104
|
+
code: d.invalid_string,
|
|
1105
|
+
message: s.message
|
|
1106
|
+
}), n.dirty()) : s.kind === "base64" ? jt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1107
|
+
validation: "base64",
|
|
1108
|
+
code: d.invalid_string,
|
|
1109
|
+
message: s.message
|
|
1110
|
+
}), n.dirty()) : x.assertNever(s);
|
|
1111
|
+
return { status: n.value, value: e.data };
|
|
1112
|
+
}
|
|
1113
|
+
_regex(e, t, n) {
|
|
1114
|
+
return this.refinement((a) => e.test(a), {
|
|
1115
|
+
validation: t,
|
|
1116
|
+
code: d.invalid_string,
|
|
1117
|
+
...p.errToObj(n)
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1120
|
+
_addCheck(e) {
|
|
1121
|
+
return new Z({
|
|
1122
|
+
...this._def,
|
|
1123
|
+
checks: [...this._def.checks, e]
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
email(e) {
|
|
1127
|
+
return this._addCheck({ kind: "email", ...p.errToObj(e) });
|
|
1128
|
+
}
|
|
1129
|
+
url(e) {
|
|
1130
|
+
return this._addCheck({ kind: "url", ...p.errToObj(e) });
|
|
1131
|
+
}
|
|
1132
|
+
emoji(e) {
|
|
1133
|
+
return this._addCheck({ kind: "emoji", ...p.errToObj(e) });
|
|
1134
|
+
}
|
|
1135
|
+
uuid(e) {
|
|
1136
|
+
return this._addCheck({ kind: "uuid", ...p.errToObj(e) });
|
|
1137
|
+
}
|
|
1138
|
+
nanoid(e) {
|
|
1139
|
+
return this._addCheck({ kind: "nanoid", ...p.errToObj(e) });
|
|
1140
|
+
}
|
|
1141
|
+
cuid(e) {
|
|
1142
|
+
return this._addCheck({ kind: "cuid", ...p.errToObj(e) });
|
|
1143
|
+
}
|
|
1144
|
+
cuid2(e) {
|
|
1145
|
+
return this._addCheck({ kind: "cuid2", ...p.errToObj(e) });
|
|
1146
|
+
}
|
|
1147
|
+
ulid(e) {
|
|
1148
|
+
return this._addCheck({ kind: "ulid", ...p.errToObj(e) });
|
|
1149
|
+
}
|
|
1150
|
+
base64(e) {
|
|
1151
|
+
return this._addCheck({ kind: "base64", ...p.errToObj(e) });
|
|
1152
|
+
}
|
|
1153
|
+
ip(e) {
|
|
1154
|
+
return this._addCheck({ kind: "ip", ...p.errToObj(e) });
|
|
1155
|
+
}
|
|
1156
|
+
datetime(e) {
|
|
1157
|
+
var t, n;
|
|
1158
|
+
return typeof e == "string" ? this._addCheck({
|
|
1159
|
+
kind: "datetime",
|
|
1160
|
+
precision: null,
|
|
1161
|
+
offset: !1,
|
|
1162
|
+
local: !1,
|
|
1163
|
+
message: e
|
|
1164
|
+
}) : this._addCheck({
|
|
1165
|
+
kind: "datetime",
|
|
1166
|
+
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
1167
|
+
offset: (t = e == null ? void 0 : e.offset) !== null && t !== void 0 ? t : !1,
|
|
1168
|
+
local: (n = e == null ? void 0 : e.local) !== null && n !== void 0 ? n : !1,
|
|
1169
|
+
...p.errToObj(e == null ? void 0 : e.message)
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
date(e) {
|
|
1173
|
+
return this._addCheck({ kind: "date", message: e });
|
|
1174
|
+
}
|
|
1175
|
+
time(e) {
|
|
1176
|
+
return typeof e == "string" ? this._addCheck({
|
|
1177
|
+
kind: "time",
|
|
1178
|
+
precision: null,
|
|
1179
|
+
message: e
|
|
1180
|
+
}) : this._addCheck({
|
|
1181
|
+
kind: "time",
|
|
1182
|
+
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
1183
|
+
...p.errToObj(e == null ? void 0 : e.message)
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
duration(e) {
|
|
1187
|
+
return this._addCheck({ kind: "duration", ...p.errToObj(e) });
|
|
1188
|
+
}
|
|
1189
|
+
regex(e, t) {
|
|
1190
|
+
return this._addCheck({
|
|
1191
|
+
kind: "regex",
|
|
1192
|
+
regex: e,
|
|
1193
|
+
...p.errToObj(t)
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
includes(e, t) {
|
|
1197
|
+
return this._addCheck({
|
|
1198
|
+
kind: "includes",
|
|
1199
|
+
value: e,
|
|
1200
|
+
position: t == null ? void 0 : t.position,
|
|
1201
|
+
...p.errToObj(t == null ? void 0 : t.message)
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
startsWith(e, t) {
|
|
1205
|
+
return this._addCheck({
|
|
1206
|
+
kind: "startsWith",
|
|
1207
|
+
value: e,
|
|
1208
|
+
...p.errToObj(t)
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
endsWith(e, t) {
|
|
1212
|
+
return this._addCheck({
|
|
1213
|
+
kind: "endsWith",
|
|
1214
|
+
value: e,
|
|
1215
|
+
...p.errToObj(t)
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
min(e, t) {
|
|
1219
|
+
return this._addCheck({
|
|
1220
|
+
kind: "min",
|
|
1221
|
+
value: e,
|
|
1222
|
+
...p.errToObj(t)
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
max(e, t) {
|
|
1226
|
+
return this._addCheck({
|
|
1227
|
+
kind: "max",
|
|
1228
|
+
value: e,
|
|
1229
|
+
...p.errToObj(t)
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
length(e, t) {
|
|
1233
|
+
return this._addCheck({
|
|
1234
|
+
kind: "length",
|
|
1235
|
+
value: e,
|
|
1236
|
+
...p.errToObj(t)
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* @deprecated Use z.string().min(1) instead.
|
|
1241
|
+
* @see {@link ZodString.min}
|
|
1242
|
+
*/
|
|
1243
|
+
nonempty(e) {
|
|
1244
|
+
return this.min(1, p.errToObj(e));
|
|
1245
|
+
}
|
|
1246
|
+
trim() {
|
|
1247
|
+
return new Z({
|
|
1248
|
+
...this._def,
|
|
1249
|
+
checks: [...this._def.checks, { kind: "trim" }]
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
toLowerCase() {
|
|
1253
|
+
return new Z({
|
|
1254
|
+
...this._def,
|
|
1255
|
+
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
toUpperCase() {
|
|
1259
|
+
return new Z({
|
|
1260
|
+
...this._def,
|
|
1261
|
+
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
get isDatetime() {
|
|
1265
|
+
return !!this._def.checks.find((e) => e.kind === "datetime");
|
|
1266
|
+
}
|
|
1267
|
+
get isDate() {
|
|
1268
|
+
return !!this._def.checks.find((e) => e.kind === "date");
|
|
1269
|
+
}
|
|
1270
|
+
get isTime() {
|
|
1271
|
+
return !!this._def.checks.find((e) => e.kind === "time");
|
|
1272
|
+
}
|
|
1273
|
+
get isDuration() {
|
|
1274
|
+
return !!this._def.checks.find((e) => e.kind === "duration");
|
|
1275
|
+
}
|
|
1276
|
+
get isEmail() {
|
|
1277
|
+
return !!this._def.checks.find((e) => e.kind === "email");
|
|
1278
|
+
}
|
|
1279
|
+
get isURL() {
|
|
1280
|
+
return !!this._def.checks.find((e) => e.kind === "url");
|
|
1281
|
+
}
|
|
1282
|
+
get isEmoji() {
|
|
1283
|
+
return !!this._def.checks.find((e) => e.kind === "emoji");
|
|
1284
|
+
}
|
|
1285
|
+
get isUUID() {
|
|
1286
|
+
return !!this._def.checks.find((e) => e.kind === "uuid");
|
|
1287
|
+
}
|
|
1288
|
+
get isNANOID() {
|
|
1289
|
+
return !!this._def.checks.find((e) => e.kind === "nanoid");
|
|
1290
|
+
}
|
|
1291
|
+
get isCUID() {
|
|
1292
|
+
return !!this._def.checks.find((e) => e.kind === "cuid");
|
|
1293
|
+
}
|
|
1294
|
+
get isCUID2() {
|
|
1295
|
+
return !!this._def.checks.find((e) => e.kind === "cuid2");
|
|
1296
|
+
}
|
|
1297
|
+
get isULID() {
|
|
1298
|
+
return !!this._def.checks.find((e) => e.kind === "ulid");
|
|
1299
|
+
}
|
|
1300
|
+
get isIP() {
|
|
1301
|
+
return !!this._def.checks.find((e) => e.kind === "ip");
|
|
1302
|
+
}
|
|
1303
|
+
get isBase64() {
|
|
1304
|
+
return !!this._def.checks.find((e) => e.kind === "base64");
|
|
1305
|
+
}
|
|
1306
|
+
get minLength() {
|
|
1307
|
+
let e = null;
|
|
1308
|
+
for (const t of this._def.checks)
|
|
1309
|
+
t.kind === "min" && (e === null || t.value > e) && (e = t.value);
|
|
1310
|
+
return e;
|
|
1311
|
+
}
|
|
1312
|
+
get maxLength() {
|
|
1313
|
+
let e = null;
|
|
1314
|
+
for (const t of this._def.checks)
|
|
1315
|
+
t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
1316
|
+
return e;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
Z.create = (r) => {
|
|
1320
|
+
var e;
|
|
1321
|
+
return new Z({
|
|
1322
|
+
checks: [],
|
|
1323
|
+
typeName: h.ZodString,
|
|
1324
|
+
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
1325
|
+
...v(r)
|
|
1326
|
+
});
|
|
1327
|
+
};
|
|
1328
|
+
function Rt(r, e) {
|
|
1329
|
+
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, a = t > n ? t : n, s = parseInt(r.toFixed(a).replace(".", "")), i = parseInt(e.toFixed(a).replace(".", ""));
|
|
1330
|
+
return s % i / Math.pow(10, a);
|
|
1331
|
+
}
|
|
1332
|
+
class L extends _ {
|
|
1333
|
+
constructor() {
|
|
1334
|
+
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1335
|
+
}
|
|
1336
|
+
_parse(e) {
|
|
1337
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
|
|
1338
|
+
const s = this._getOrReturnCtx(e);
|
|
1339
|
+
return u(s, {
|
|
1340
|
+
code: d.invalid_type,
|
|
1341
|
+
expected: f.number,
|
|
1342
|
+
received: s.parsedType
|
|
1343
|
+
}), g;
|
|
1344
|
+
}
|
|
1345
|
+
let n;
|
|
1346
|
+
const a = new w();
|
|
1347
|
+
for (const s of this._def.checks)
|
|
1348
|
+
s.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1349
|
+
code: d.invalid_type,
|
|
1350
|
+
expected: "integer",
|
|
1351
|
+
received: "float",
|
|
1352
|
+
message: s.message
|
|
1353
|
+
}), a.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1354
|
+
code: d.too_small,
|
|
1355
|
+
minimum: s.value,
|
|
1356
|
+
type: "number",
|
|
1357
|
+
inclusive: s.inclusive,
|
|
1358
|
+
exact: !1,
|
|
1359
|
+
message: s.message
|
|
1360
|
+
}), a.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1361
|
+
code: d.too_big,
|
|
1362
|
+
maximum: s.value,
|
|
1363
|
+
type: "number",
|
|
1364
|
+
inclusive: s.inclusive,
|
|
1365
|
+
exact: !1,
|
|
1366
|
+
message: s.message
|
|
1367
|
+
}), a.dirty()) : s.kind === "multipleOf" ? Rt(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1368
|
+
code: d.not_multiple_of,
|
|
1369
|
+
multipleOf: s.value,
|
|
1370
|
+
message: s.message
|
|
1371
|
+
}), a.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1372
|
+
code: d.not_finite,
|
|
1373
|
+
message: s.message
|
|
1374
|
+
}), a.dirty()) : x.assertNever(s);
|
|
1375
|
+
return { status: a.value, value: e.data };
|
|
1376
|
+
}
|
|
1377
|
+
gte(e, t) {
|
|
1378
|
+
return this.setLimit("min", e, !0, p.toString(t));
|
|
1379
|
+
}
|
|
1380
|
+
gt(e, t) {
|
|
1381
|
+
return this.setLimit("min", e, !1, p.toString(t));
|
|
1382
|
+
}
|
|
1383
|
+
lte(e, t) {
|
|
1384
|
+
return this.setLimit("max", e, !0, p.toString(t));
|
|
1385
|
+
}
|
|
1386
|
+
lt(e, t) {
|
|
1387
|
+
return this.setLimit("max", e, !1, p.toString(t));
|
|
1388
|
+
}
|
|
1389
|
+
setLimit(e, t, n, a) {
|
|
1390
|
+
return new L({
|
|
1391
|
+
...this._def,
|
|
1392
|
+
checks: [
|
|
1393
|
+
...this._def.checks,
|
|
1394
|
+
{
|
|
1395
|
+
kind: e,
|
|
1396
|
+
value: t,
|
|
1397
|
+
inclusive: n,
|
|
1398
|
+
message: p.toString(a)
|
|
1399
|
+
}
|
|
1400
|
+
]
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
_addCheck(e) {
|
|
1404
|
+
return new L({
|
|
1405
|
+
...this._def,
|
|
1406
|
+
checks: [...this._def.checks, e]
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
int(e) {
|
|
1410
|
+
return this._addCheck({
|
|
1411
|
+
kind: "int",
|
|
1412
|
+
message: p.toString(e)
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1415
|
+
positive(e) {
|
|
1416
|
+
return this._addCheck({
|
|
1417
|
+
kind: "min",
|
|
1418
|
+
value: 0,
|
|
1419
|
+
inclusive: !1,
|
|
1420
|
+
message: p.toString(e)
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
negative(e) {
|
|
1424
|
+
return this._addCheck({
|
|
1425
|
+
kind: "max",
|
|
1426
|
+
value: 0,
|
|
1427
|
+
inclusive: !1,
|
|
1428
|
+
message: p.toString(e)
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
nonpositive(e) {
|
|
1432
|
+
return this._addCheck({
|
|
1433
|
+
kind: "max",
|
|
1434
|
+
value: 0,
|
|
1435
|
+
inclusive: !0,
|
|
1436
|
+
message: p.toString(e)
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
nonnegative(e) {
|
|
1440
|
+
return this._addCheck({
|
|
1441
|
+
kind: "min",
|
|
1442
|
+
value: 0,
|
|
1443
|
+
inclusive: !0,
|
|
1444
|
+
message: p.toString(e)
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
multipleOf(e, t) {
|
|
1448
|
+
return this._addCheck({
|
|
1449
|
+
kind: "multipleOf",
|
|
1450
|
+
value: e,
|
|
1451
|
+
message: p.toString(t)
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
finite(e) {
|
|
1455
|
+
return this._addCheck({
|
|
1456
|
+
kind: "finite",
|
|
1457
|
+
message: p.toString(e)
|
|
1458
|
+
});
|
|
1459
|
+
}
|
|
1460
|
+
safe(e) {
|
|
1461
|
+
return this._addCheck({
|
|
1462
|
+
kind: "min",
|
|
1463
|
+
inclusive: !0,
|
|
1464
|
+
value: Number.MIN_SAFE_INTEGER,
|
|
1465
|
+
message: p.toString(e)
|
|
1466
|
+
})._addCheck({
|
|
1467
|
+
kind: "max",
|
|
1468
|
+
inclusive: !0,
|
|
1469
|
+
value: Number.MAX_SAFE_INTEGER,
|
|
1470
|
+
message: p.toString(e)
|
|
1471
|
+
});
|
|
1472
|
+
}
|
|
1473
|
+
get minValue() {
|
|
1474
|
+
let e = null;
|
|
1475
|
+
for (const t of this._def.checks)
|
|
1476
|
+
t.kind === "min" && (e === null || t.value > e) && (e = t.value);
|
|
1477
|
+
return e;
|
|
1478
|
+
}
|
|
1479
|
+
get maxValue() {
|
|
1480
|
+
let e = null;
|
|
1481
|
+
for (const t of this._def.checks)
|
|
1482
|
+
t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
1483
|
+
return e;
|
|
1484
|
+
}
|
|
1485
|
+
get isInt() {
|
|
1486
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
|
|
1487
|
+
}
|
|
1488
|
+
get isFinite() {
|
|
1489
|
+
let e = null, t = null;
|
|
1490
|
+
for (const n of this._def.checks) {
|
|
1491
|
+
if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf")
|
|
1492
|
+
return !0;
|
|
1493
|
+
n.kind === "min" ? (t === null || n.value > t) && (t = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
|
|
1494
|
+
}
|
|
1495
|
+
return Number.isFinite(t) && Number.isFinite(e);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
L.create = (r) => new L({
|
|
1499
|
+
checks: [],
|
|
1500
|
+
typeName: h.ZodNumber,
|
|
1501
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1502
|
+
...v(r)
|
|
1503
|
+
});
|
|
1504
|
+
class $ extends _ {
|
|
1505
|
+
constructor() {
|
|
1506
|
+
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1507
|
+
}
|
|
1508
|
+
_parse(e) {
|
|
1509
|
+
if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== f.bigint) {
|
|
1510
|
+
const s = this._getOrReturnCtx(e);
|
|
1511
|
+
return u(s, {
|
|
1512
|
+
code: d.invalid_type,
|
|
1513
|
+
expected: f.bigint,
|
|
1514
|
+
received: s.parsedType
|
|
1515
|
+
}), g;
|
|
1516
|
+
}
|
|
1517
|
+
let n;
|
|
1518
|
+
const a = new w();
|
|
1519
|
+
for (const s of this._def.checks)
|
|
1520
|
+
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1521
|
+
code: d.too_small,
|
|
1522
|
+
type: "bigint",
|
|
1523
|
+
minimum: s.value,
|
|
1524
|
+
inclusive: s.inclusive,
|
|
1525
|
+
message: s.message
|
|
1526
|
+
}), a.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1527
|
+
code: d.too_big,
|
|
1528
|
+
type: "bigint",
|
|
1529
|
+
maximum: s.value,
|
|
1530
|
+
inclusive: s.inclusive,
|
|
1531
|
+
message: s.message
|
|
1532
|
+
}), a.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1533
|
+
code: d.not_multiple_of,
|
|
1534
|
+
multipleOf: s.value,
|
|
1535
|
+
message: s.message
|
|
1536
|
+
}), a.dirty()) : x.assertNever(s);
|
|
1537
|
+
return { status: a.value, value: e.data };
|
|
1538
|
+
}
|
|
1539
|
+
gte(e, t) {
|
|
1540
|
+
return this.setLimit("min", e, !0, p.toString(t));
|
|
1541
|
+
}
|
|
1542
|
+
gt(e, t) {
|
|
1543
|
+
return this.setLimit("min", e, !1, p.toString(t));
|
|
1544
|
+
}
|
|
1545
|
+
lte(e, t) {
|
|
1546
|
+
return this.setLimit("max", e, !0, p.toString(t));
|
|
1547
|
+
}
|
|
1548
|
+
lt(e, t) {
|
|
1549
|
+
return this.setLimit("max", e, !1, p.toString(t));
|
|
1550
|
+
}
|
|
1551
|
+
setLimit(e, t, n, a) {
|
|
1552
|
+
return new $({
|
|
1553
|
+
...this._def,
|
|
1554
|
+
checks: [
|
|
1555
|
+
...this._def.checks,
|
|
1556
|
+
{
|
|
1557
|
+
kind: e,
|
|
1558
|
+
value: t,
|
|
1559
|
+
inclusive: n,
|
|
1560
|
+
message: p.toString(a)
|
|
1561
|
+
}
|
|
1562
|
+
]
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
_addCheck(e) {
|
|
1566
|
+
return new $({
|
|
1567
|
+
...this._def,
|
|
1568
|
+
checks: [...this._def.checks, e]
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
positive(e) {
|
|
1572
|
+
return this._addCheck({
|
|
1573
|
+
kind: "min",
|
|
1574
|
+
value: BigInt(0),
|
|
1575
|
+
inclusive: !1,
|
|
1576
|
+
message: p.toString(e)
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
negative(e) {
|
|
1580
|
+
return this._addCheck({
|
|
1581
|
+
kind: "max",
|
|
1582
|
+
value: BigInt(0),
|
|
1583
|
+
inclusive: !1,
|
|
1584
|
+
message: p.toString(e)
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
nonpositive(e) {
|
|
1588
|
+
return this._addCheck({
|
|
1589
|
+
kind: "max",
|
|
1590
|
+
value: BigInt(0),
|
|
1591
|
+
inclusive: !0,
|
|
1592
|
+
message: p.toString(e)
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
nonnegative(e) {
|
|
1596
|
+
return this._addCheck({
|
|
1597
|
+
kind: "min",
|
|
1598
|
+
value: BigInt(0),
|
|
1599
|
+
inclusive: !0,
|
|
1600
|
+
message: p.toString(e)
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
multipleOf(e, t) {
|
|
1604
|
+
return this._addCheck({
|
|
1605
|
+
kind: "multipleOf",
|
|
1606
|
+
value: e,
|
|
1607
|
+
message: p.toString(t)
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
get minValue() {
|
|
1611
|
+
let e = null;
|
|
1612
|
+
for (const t of this._def.checks)
|
|
1613
|
+
t.kind === "min" && (e === null || t.value > e) && (e = t.value);
|
|
1614
|
+
return e;
|
|
1615
|
+
}
|
|
1616
|
+
get maxValue() {
|
|
1617
|
+
let e = null;
|
|
1618
|
+
for (const t of this._def.checks)
|
|
1619
|
+
t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
1620
|
+
return e;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
$.create = (r) => {
|
|
1624
|
+
var e;
|
|
1625
|
+
return new $({
|
|
1626
|
+
checks: [],
|
|
1627
|
+
typeName: h.ZodBigInt,
|
|
1628
|
+
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
1629
|
+
...v(r)
|
|
1630
|
+
});
|
|
1631
|
+
};
|
|
1632
|
+
class te extends _ {
|
|
1633
|
+
_parse(e) {
|
|
1634
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1635
|
+
const n = this._getOrReturnCtx(e);
|
|
1636
|
+
return u(n, {
|
|
1637
|
+
code: d.invalid_type,
|
|
1638
|
+
expected: f.boolean,
|
|
1639
|
+
received: n.parsedType
|
|
1640
|
+
}), g;
|
|
1641
|
+
}
|
|
1642
|
+
return T(e.data);
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
te.create = (r) => new te({
|
|
1646
|
+
typeName: h.ZodBoolean,
|
|
1647
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1648
|
+
...v(r)
|
|
1649
|
+
});
|
|
1650
|
+
class U extends _ {
|
|
1651
|
+
_parse(e) {
|
|
1652
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1653
|
+
const s = this._getOrReturnCtx(e);
|
|
1654
|
+
return u(s, {
|
|
1655
|
+
code: d.invalid_type,
|
|
1656
|
+
expected: f.date,
|
|
1657
|
+
received: s.parsedType
|
|
1658
|
+
}), g;
|
|
1659
|
+
}
|
|
1660
|
+
if (isNaN(e.data.getTime())) {
|
|
1661
|
+
const s = this._getOrReturnCtx(e);
|
|
1662
|
+
return u(s, {
|
|
1663
|
+
code: d.invalid_date
|
|
1664
|
+
}), g;
|
|
1665
|
+
}
|
|
1666
|
+
const n = new w();
|
|
1667
|
+
let a;
|
|
1668
|
+
for (const s of this._def.checks)
|
|
1669
|
+
s.kind === "min" ? e.data.getTime() < s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1670
|
+
code: d.too_small,
|
|
1671
|
+
message: s.message,
|
|
1672
|
+
inclusive: !0,
|
|
1673
|
+
exact: !1,
|
|
1674
|
+
minimum: s.value,
|
|
1675
|
+
type: "date"
|
|
1676
|
+
}), n.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (a = this._getOrReturnCtx(e, a), u(a, {
|
|
1677
|
+
code: d.too_big,
|
|
1678
|
+
message: s.message,
|
|
1679
|
+
inclusive: !0,
|
|
1680
|
+
exact: !1,
|
|
1681
|
+
maximum: s.value,
|
|
1682
|
+
type: "date"
|
|
1683
|
+
}), n.dirty()) : x.assertNever(s);
|
|
1684
|
+
return {
|
|
1685
|
+
status: n.value,
|
|
1686
|
+
value: new Date(e.data.getTime())
|
|
1687
|
+
};
|
|
1688
|
+
}
|
|
1689
|
+
_addCheck(e) {
|
|
1690
|
+
return new U({
|
|
1691
|
+
...this._def,
|
|
1692
|
+
checks: [...this._def.checks, e]
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
min(e, t) {
|
|
1696
|
+
return this._addCheck({
|
|
1697
|
+
kind: "min",
|
|
1698
|
+
value: e.getTime(),
|
|
1699
|
+
message: p.toString(t)
|
|
1700
|
+
});
|
|
1701
|
+
}
|
|
1702
|
+
max(e, t) {
|
|
1703
|
+
return this._addCheck({
|
|
1704
|
+
kind: "max",
|
|
1705
|
+
value: e.getTime(),
|
|
1706
|
+
message: p.toString(t)
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
get minDate() {
|
|
1710
|
+
let e = null;
|
|
1711
|
+
for (const t of this._def.checks)
|
|
1712
|
+
t.kind === "min" && (e === null || t.value > e) && (e = t.value);
|
|
1713
|
+
return e != null ? new Date(e) : null;
|
|
1714
|
+
}
|
|
1715
|
+
get maxDate() {
|
|
1716
|
+
let e = null;
|
|
1717
|
+
for (const t of this._def.checks)
|
|
1718
|
+
t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
1719
|
+
return e != null ? new Date(e) : null;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
U.create = (r) => new U({
|
|
1723
|
+
checks: [],
|
|
1724
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1725
|
+
typeName: h.ZodDate,
|
|
1726
|
+
...v(r)
|
|
1727
|
+
});
|
|
1728
|
+
class _e extends _ {
|
|
1729
|
+
_parse(e) {
|
|
1730
|
+
if (this._getType(e) !== f.symbol) {
|
|
1731
|
+
const n = this._getOrReturnCtx(e);
|
|
1732
|
+
return u(n, {
|
|
1733
|
+
code: d.invalid_type,
|
|
1734
|
+
expected: f.symbol,
|
|
1735
|
+
received: n.parsedType
|
|
1736
|
+
}), g;
|
|
1737
|
+
}
|
|
1738
|
+
return T(e.data);
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
_e.create = (r) => new _e({
|
|
1742
|
+
typeName: h.ZodSymbol,
|
|
1743
|
+
...v(r)
|
|
1744
|
+
});
|
|
1745
|
+
class re extends _ {
|
|
1746
|
+
_parse(e) {
|
|
1747
|
+
if (this._getType(e) !== f.undefined) {
|
|
1748
|
+
const n = this._getOrReturnCtx(e);
|
|
1749
|
+
return u(n, {
|
|
1750
|
+
code: d.invalid_type,
|
|
1751
|
+
expected: f.undefined,
|
|
1752
|
+
received: n.parsedType
|
|
1753
|
+
}), g;
|
|
1754
|
+
}
|
|
1755
|
+
return T(e.data);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
re.create = (r) => new re({
|
|
1759
|
+
typeName: h.ZodUndefined,
|
|
1760
|
+
...v(r)
|
|
1761
|
+
});
|
|
1762
|
+
class ne extends _ {
|
|
1763
|
+
_parse(e) {
|
|
1764
|
+
if (this._getType(e) !== f.null) {
|
|
1765
|
+
const n = this._getOrReturnCtx(e);
|
|
1766
|
+
return u(n, {
|
|
1767
|
+
code: d.invalid_type,
|
|
1768
|
+
expected: f.null,
|
|
1769
|
+
received: n.parsedType
|
|
1770
|
+
}), g;
|
|
1771
|
+
}
|
|
1772
|
+
return T(e.data);
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
ne.create = (r) => new ne({
|
|
1776
|
+
typeName: h.ZodNull,
|
|
1777
|
+
...v(r)
|
|
1778
|
+
});
|
|
1779
|
+
class J extends _ {
|
|
1780
|
+
constructor() {
|
|
1781
|
+
super(...arguments), this._any = !0;
|
|
1782
|
+
}
|
|
1783
|
+
_parse(e) {
|
|
1784
|
+
return T(e.data);
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
J.create = (r) => new J({
|
|
1788
|
+
typeName: h.ZodAny,
|
|
1789
|
+
...v(r)
|
|
1790
|
+
});
|
|
1791
|
+
class B extends _ {
|
|
1792
|
+
constructor() {
|
|
1793
|
+
super(...arguments), this._unknown = !0;
|
|
1794
|
+
}
|
|
1795
|
+
_parse(e) {
|
|
1796
|
+
return T(e.data);
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
B.create = (r) => new B({
|
|
1800
|
+
typeName: h.ZodUnknown,
|
|
1801
|
+
...v(r)
|
|
1802
|
+
});
|
|
1803
|
+
class V extends _ {
|
|
1804
|
+
_parse(e) {
|
|
1805
|
+
const t = this._getOrReturnCtx(e);
|
|
1806
|
+
return u(t, {
|
|
1807
|
+
code: d.invalid_type,
|
|
1808
|
+
expected: f.never,
|
|
1809
|
+
received: t.parsedType
|
|
1810
|
+
}), g;
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
V.create = (r) => new V({
|
|
1814
|
+
typeName: h.ZodNever,
|
|
1815
|
+
...v(r)
|
|
1816
|
+
});
|
|
1817
|
+
class be extends _ {
|
|
1818
|
+
_parse(e) {
|
|
1819
|
+
if (this._getType(e) !== f.undefined) {
|
|
1820
|
+
const n = this._getOrReturnCtx(e);
|
|
1821
|
+
return u(n, {
|
|
1822
|
+
code: d.invalid_type,
|
|
1823
|
+
expected: f.void,
|
|
1824
|
+
received: n.parsedType
|
|
1825
|
+
}), g;
|
|
1826
|
+
}
|
|
1827
|
+
return T(e.data);
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
be.create = (r) => new be({
|
|
1831
|
+
typeName: h.ZodVoid,
|
|
1832
|
+
...v(r)
|
|
1833
|
+
});
|
|
1834
|
+
class j extends _ {
|
|
1835
|
+
_parse(e) {
|
|
1836
|
+
const { ctx: t, status: n } = this._processInputParams(e), a = this._def;
|
|
1837
|
+
if (t.parsedType !== f.array)
|
|
1838
|
+
return u(t, {
|
|
1839
|
+
code: d.invalid_type,
|
|
1840
|
+
expected: f.array,
|
|
1841
|
+
received: t.parsedType
|
|
1842
|
+
}), g;
|
|
1843
|
+
if (a.exactLength !== null) {
|
|
1844
|
+
const i = t.data.length > a.exactLength.value, o = t.data.length < a.exactLength.value;
|
|
1845
|
+
(i || o) && (u(t, {
|
|
1846
|
+
code: i ? d.too_big : d.too_small,
|
|
1847
|
+
minimum: o ? a.exactLength.value : void 0,
|
|
1848
|
+
maximum: i ? a.exactLength.value : void 0,
|
|
1849
|
+
type: "array",
|
|
1850
|
+
inclusive: !0,
|
|
1851
|
+
exact: !0,
|
|
1852
|
+
message: a.exactLength.message
|
|
1853
|
+
}), n.dirty());
|
|
1854
|
+
}
|
|
1855
|
+
if (a.minLength !== null && t.data.length < a.minLength.value && (u(t, {
|
|
1856
|
+
code: d.too_small,
|
|
1857
|
+
minimum: a.minLength.value,
|
|
1858
|
+
type: "array",
|
|
1859
|
+
inclusive: !0,
|
|
1860
|
+
exact: !1,
|
|
1861
|
+
message: a.minLength.message
|
|
1862
|
+
}), n.dirty()), a.maxLength !== null && t.data.length > a.maxLength.value && (u(t, {
|
|
1863
|
+
code: d.too_big,
|
|
1864
|
+
maximum: a.maxLength.value,
|
|
1865
|
+
type: "array",
|
|
1866
|
+
inclusive: !0,
|
|
1867
|
+
exact: !1,
|
|
1868
|
+
message: a.maxLength.message
|
|
1869
|
+
}), n.dirty()), t.common.async)
|
|
1870
|
+
return Promise.all([...t.data].map((i, o) => a.type._parseAsync(new R(t, i, t.path, o)))).then((i) => w.mergeArray(n, i));
|
|
1871
|
+
const s = [...t.data].map((i, o) => a.type._parseSync(new R(t, i, t.path, o)));
|
|
1872
|
+
return w.mergeArray(n, s);
|
|
1873
|
+
}
|
|
1874
|
+
get element() {
|
|
1875
|
+
return this._def.type;
|
|
1876
|
+
}
|
|
1877
|
+
min(e, t) {
|
|
1878
|
+
return new j({
|
|
1879
|
+
...this._def,
|
|
1880
|
+
minLength: { value: e, message: p.toString(t) }
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
max(e, t) {
|
|
1884
|
+
return new j({
|
|
1885
|
+
...this._def,
|
|
1886
|
+
maxLength: { value: e, message: p.toString(t) }
|
|
1887
|
+
});
|
|
1888
|
+
}
|
|
1889
|
+
length(e, t) {
|
|
1890
|
+
return new j({
|
|
1891
|
+
...this._def,
|
|
1892
|
+
exactLength: { value: e, message: p.toString(t) }
|
|
1893
|
+
});
|
|
1894
|
+
}
|
|
1895
|
+
nonempty(e) {
|
|
1896
|
+
return this.min(1, e);
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
j.create = (r, e) => new j({
|
|
1900
|
+
type: r,
|
|
1901
|
+
minLength: null,
|
|
1902
|
+
maxLength: null,
|
|
1903
|
+
exactLength: null,
|
|
1904
|
+
typeName: h.ZodArray,
|
|
1905
|
+
...v(e)
|
|
1906
|
+
});
|
|
1907
|
+
function q(r) {
|
|
1908
|
+
if (r instanceof k) {
|
|
1909
|
+
const e = {};
|
|
1910
|
+
for (const t in r.shape) {
|
|
1911
|
+
const n = r.shape[t];
|
|
1912
|
+
e[t] = O.create(q(n));
|
|
1913
|
+
}
|
|
1914
|
+
return new k({
|
|
1915
|
+
...r._def,
|
|
1916
|
+
shape: () => e
|
|
1917
|
+
});
|
|
1918
|
+
} else return r instanceof j ? new j({
|
|
1919
|
+
...r._def,
|
|
1920
|
+
type: q(r.element)
|
|
1921
|
+
}) : r instanceof O ? O.create(q(r.unwrap())) : r instanceof P ? P.create(q(r.unwrap())) : r instanceof A ? A.create(r.items.map((e) => q(e))) : r;
|
|
1922
|
+
}
|
|
1923
|
+
class k extends _ {
|
|
1924
|
+
constructor() {
|
|
1925
|
+
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1926
|
+
}
|
|
1927
|
+
_getCached() {
|
|
1928
|
+
if (this._cached !== null)
|
|
1929
|
+
return this._cached;
|
|
1930
|
+
const e = this._def.shape(), t = x.objectKeys(e);
|
|
1931
|
+
return this._cached = { shape: e, keys: t };
|
|
1932
|
+
}
|
|
1933
|
+
_parse(e) {
|
|
1934
|
+
if (this._getType(e) !== f.object) {
|
|
1935
|
+
const l = this._getOrReturnCtx(e);
|
|
1936
|
+
return u(l, {
|
|
1937
|
+
code: d.invalid_type,
|
|
1938
|
+
expected: f.object,
|
|
1939
|
+
received: l.parsedType
|
|
1940
|
+
}), g;
|
|
1941
|
+
}
|
|
1942
|
+
const { status: n, ctx: a } = this._processInputParams(e), { shape: s, keys: i } = this._getCached(), o = [];
|
|
1943
|
+
if (!(this._def.catchall instanceof V && this._def.unknownKeys === "strip"))
|
|
1944
|
+
for (const l in a.data)
|
|
1945
|
+
i.includes(l) || o.push(l);
|
|
1946
|
+
const c = [];
|
|
1947
|
+
for (const l of i) {
|
|
1948
|
+
const m = s[l], C = a.data[l];
|
|
1949
|
+
c.push({
|
|
1950
|
+
key: { status: "valid", value: l },
|
|
1951
|
+
value: m._parse(new R(a, C, a.path, l)),
|
|
1952
|
+
alwaysSet: l in a.data
|
|
1953
|
+
});
|
|
1954
|
+
}
|
|
1955
|
+
if (this._def.catchall instanceof V) {
|
|
1956
|
+
const l = this._def.unknownKeys;
|
|
1957
|
+
if (l === "passthrough")
|
|
1958
|
+
for (const m of o)
|
|
1959
|
+
c.push({
|
|
1960
|
+
key: { status: "valid", value: m },
|
|
1961
|
+
value: { status: "valid", value: a.data[m] }
|
|
1962
|
+
});
|
|
1963
|
+
else if (l === "strict")
|
|
1964
|
+
o.length > 0 && (u(a, {
|
|
1965
|
+
code: d.unrecognized_keys,
|
|
1966
|
+
keys: o
|
|
1967
|
+
}), n.dirty());
|
|
1968
|
+
else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1969
|
+
} else {
|
|
1970
|
+
const l = this._def.catchall;
|
|
1971
|
+
for (const m of o) {
|
|
1972
|
+
const C = a.data[m];
|
|
1973
|
+
c.push({
|
|
1974
|
+
key: { status: "valid", value: m },
|
|
1975
|
+
value: l._parse(
|
|
1976
|
+
new R(a, C, a.path, m)
|
|
1977
|
+
//, ctx.child(key), value, getParsedType(value)
|
|
1978
|
+
),
|
|
1979
|
+
alwaysSet: m in a.data
|
|
1980
|
+
});
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
return a.common.async ? Promise.resolve().then(async () => {
|
|
1984
|
+
const l = [];
|
|
1985
|
+
for (const m of c) {
|
|
1986
|
+
const C = await m.key, Re = await m.value;
|
|
1987
|
+
l.push({
|
|
1988
|
+
key: C,
|
|
1989
|
+
value: Re,
|
|
1990
|
+
alwaysSet: m.alwaysSet
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
return l;
|
|
1994
|
+
}).then((l) => w.mergeObjectSync(n, l)) : w.mergeObjectSync(n, c);
|
|
1995
|
+
}
|
|
1996
|
+
get shape() {
|
|
1997
|
+
return this._def.shape();
|
|
1998
|
+
}
|
|
1999
|
+
strict(e) {
|
|
2000
|
+
return p.errToObj, new k({
|
|
2001
|
+
...this._def,
|
|
2002
|
+
unknownKeys: "strict",
|
|
2003
|
+
...e !== void 0 ? {
|
|
2004
|
+
errorMap: (t, n) => {
|
|
2005
|
+
var a, s, i, o;
|
|
2006
|
+
const c = (i = (s = (a = this._def).errorMap) === null || s === void 0 ? void 0 : s.call(a, t, n).message) !== null && i !== void 0 ? i : n.defaultError;
|
|
2007
|
+
return t.code === "unrecognized_keys" ? {
|
|
2008
|
+
message: (o = p.errToObj(e).message) !== null && o !== void 0 ? o : c
|
|
2009
|
+
} : {
|
|
2010
|
+
message: c
|
|
2011
|
+
};
|
|
2012
|
+
}
|
|
2013
|
+
} : {}
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
strip() {
|
|
2017
|
+
return new k({
|
|
2018
|
+
...this._def,
|
|
2019
|
+
unknownKeys: "strip"
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
passthrough() {
|
|
2023
|
+
return new k({
|
|
2024
|
+
...this._def,
|
|
2025
|
+
unknownKeys: "passthrough"
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
// const AugmentFactory =
|
|
2029
|
+
// <Def extends ZodObjectDef>(def: Def) =>
|
|
2030
|
+
// <Augmentation extends ZodRawShape>(
|
|
2031
|
+
// augmentation: Augmentation
|
|
2032
|
+
// ): ZodObject<
|
|
2033
|
+
// extendShape<ReturnType<Def["shape"]>, Augmentation>,
|
|
2034
|
+
// Def["unknownKeys"],
|
|
2035
|
+
// Def["catchall"]
|
|
2036
|
+
// > => {
|
|
2037
|
+
// return new ZodObject({
|
|
2038
|
+
// ...def,
|
|
2039
|
+
// shape: () => ({
|
|
2040
|
+
// ...def.shape(),
|
|
2041
|
+
// ...augmentation,
|
|
2042
|
+
// }),
|
|
2043
|
+
// }) as any;
|
|
2044
|
+
// };
|
|
2045
|
+
extend(e) {
|
|
2046
|
+
return new k({
|
|
2047
|
+
...this._def,
|
|
2048
|
+
shape: () => ({
|
|
2049
|
+
...this._def.shape(),
|
|
2050
|
+
...e
|
|
2051
|
+
})
|
|
2052
|
+
});
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* Prior to zod@1.0.12 there was a bug in the
|
|
2056
|
+
* inferred type of merged objects. Please
|
|
2057
|
+
* upgrade if you are experiencing issues.
|
|
2058
|
+
*/
|
|
2059
|
+
merge(e) {
|
|
2060
|
+
return new k({
|
|
2061
|
+
unknownKeys: e._def.unknownKeys,
|
|
2062
|
+
catchall: e._def.catchall,
|
|
2063
|
+
shape: () => ({
|
|
2064
|
+
...this._def.shape(),
|
|
2065
|
+
...e._def.shape()
|
|
2066
|
+
}),
|
|
2067
|
+
typeName: h.ZodObject
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
// merge<
|
|
2071
|
+
// Incoming extends AnyZodObject,
|
|
2072
|
+
// Augmentation extends Incoming["shape"],
|
|
2073
|
+
// NewOutput extends {
|
|
2074
|
+
// [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
|
|
2075
|
+
// ? Augmentation[k]["_output"]
|
|
2076
|
+
// : k extends keyof Output
|
|
2077
|
+
// ? Output[k]
|
|
2078
|
+
// : never;
|
|
2079
|
+
// },
|
|
2080
|
+
// NewInput extends {
|
|
2081
|
+
// [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
|
|
2082
|
+
// ? Augmentation[k]["_input"]
|
|
2083
|
+
// : k extends keyof Input
|
|
2084
|
+
// ? Input[k]
|
|
2085
|
+
// : never;
|
|
2086
|
+
// }
|
|
2087
|
+
// >(
|
|
2088
|
+
// merging: Incoming
|
|
2089
|
+
// ): ZodObject<
|
|
2090
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
|
2091
|
+
// Incoming["_def"]["unknownKeys"],
|
|
2092
|
+
// Incoming["_def"]["catchall"],
|
|
2093
|
+
// NewOutput,
|
|
2094
|
+
// NewInput
|
|
2095
|
+
// > {
|
|
2096
|
+
// const merged: any = new ZodObject({
|
|
2097
|
+
// unknownKeys: merging._def.unknownKeys,
|
|
2098
|
+
// catchall: merging._def.catchall,
|
|
2099
|
+
// shape: () =>
|
|
2100
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
|
2101
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2102
|
+
// }) as any;
|
|
2103
|
+
// return merged;
|
|
2104
|
+
// }
|
|
2105
|
+
setKey(e, t) {
|
|
2106
|
+
return this.augment({ [e]: t });
|
|
2107
|
+
}
|
|
2108
|
+
// merge<Incoming extends AnyZodObject>(
|
|
2109
|
+
// merging: Incoming
|
|
2110
|
+
// ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
|
|
2111
|
+
// ZodObject<
|
|
2112
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
|
2113
|
+
// Incoming["_def"]["unknownKeys"],
|
|
2114
|
+
// Incoming["_def"]["catchall"]
|
|
2115
|
+
// > {
|
|
2116
|
+
// // const mergedShape = objectUtil.mergeShapes(
|
|
2117
|
+
// // this._def.shape(),
|
|
2118
|
+
// // merging._def.shape()
|
|
2119
|
+
// // );
|
|
2120
|
+
// const merged: any = new ZodObject({
|
|
2121
|
+
// unknownKeys: merging._def.unknownKeys,
|
|
2122
|
+
// catchall: merging._def.catchall,
|
|
2123
|
+
// shape: () =>
|
|
2124
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
|
2125
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2126
|
+
// }) as any;
|
|
2127
|
+
// return merged;
|
|
2128
|
+
// }
|
|
2129
|
+
catchall(e) {
|
|
2130
|
+
return new k({
|
|
2131
|
+
...this._def,
|
|
2132
|
+
catchall: e
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2135
|
+
pick(e) {
|
|
2136
|
+
const t = {};
|
|
2137
|
+
return x.objectKeys(e).forEach((n) => {
|
|
2138
|
+
e[n] && this.shape[n] && (t[n] = this.shape[n]);
|
|
2139
|
+
}), new k({
|
|
2140
|
+
...this._def,
|
|
2141
|
+
shape: () => t
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
omit(e) {
|
|
2145
|
+
const t = {};
|
|
2146
|
+
return x.objectKeys(this.shape).forEach((n) => {
|
|
2147
|
+
e[n] || (t[n] = this.shape[n]);
|
|
2148
|
+
}), new k({
|
|
2149
|
+
...this._def,
|
|
2150
|
+
shape: () => t
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* @deprecated
|
|
2155
|
+
*/
|
|
2156
|
+
deepPartial() {
|
|
2157
|
+
return q(this);
|
|
2158
|
+
}
|
|
2159
|
+
partial(e) {
|
|
2160
|
+
const t = {};
|
|
2161
|
+
return x.objectKeys(this.shape).forEach((n) => {
|
|
2162
|
+
const a = this.shape[n];
|
|
2163
|
+
e && !e[n] ? t[n] = a : t[n] = a.optional();
|
|
2164
|
+
}), new k({
|
|
2165
|
+
...this._def,
|
|
2166
|
+
shape: () => t
|
|
2167
|
+
});
|
|
2168
|
+
}
|
|
2169
|
+
required(e) {
|
|
2170
|
+
const t = {};
|
|
2171
|
+
return x.objectKeys(this.shape).forEach((n) => {
|
|
2172
|
+
if (e && !e[n])
|
|
2173
|
+
t[n] = this.shape[n];
|
|
2174
|
+
else {
|
|
2175
|
+
let s = this.shape[n];
|
|
2176
|
+
for (; s instanceof O; )
|
|
2177
|
+
s = s._def.innerType;
|
|
2178
|
+
t[n] = s;
|
|
2179
|
+
}
|
|
2180
|
+
}), new k({
|
|
2181
|
+
...this._def,
|
|
2182
|
+
shape: () => t
|
|
2183
|
+
});
|
|
2184
|
+
}
|
|
2185
|
+
keyof() {
|
|
2186
|
+
return qe(x.objectKeys(this.shape));
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
k.create = (r, e) => new k({
|
|
2190
|
+
shape: () => r,
|
|
2191
|
+
unknownKeys: "strip",
|
|
2192
|
+
catchall: V.create(),
|
|
2193
|
+
typeName: h.ZodObject,
|
|
2194
|
+
...v(e)
|
|
2195
|
+
});
|
|
2196
|
+
k.strictCreate = (r, e) => new k({
|
|
2197
|
+
shape: () => r,
|
|
2198
|
+
unknownKeys: "strict",
|
|
2199
|
+
catchall: V.create(),
|
|
2200
|
+
typeName: h.ZodObject,
|
|
2201
|
+
...v(e)
|
|
2202
|
+
});
|
|
2203
|
+
k.lazycreate = (r, e) => new k({
|
|
2204
|
+
shape: r,
|
|
2205
|
+
unknownKeys: "strip",
|
|
2206
|
+
catchall: V.create(),
|
|
2207
|
+
typeName: h.ZodObject,
|
|
2208
|
+
...v(e)
|
|
2209
|
+
});
|
|
2210
|
+
class ae extends _ {
|
|
2211
|
+
_parse(e) {
|
|
2212
|
+
const { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
2213
|
+
function a(s) {
|
|
2214
|
+
for (const o of s)
|
|
2215
|
+
if (o.result.status === "valid")
|
|
2216
|
+
return o.result;
|
|
2217
|
+
for (const o of s)
|
|
2218
|
+
if (o.result.status === "dirty")
|
|
2219
|
+
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2220
|
+
const i = s.map((o) => new N(o.ctx.common.issues));
|
|
2221
|
+
return u(t, {
|
|
2222
|
+
code: d.invalid_union,
|
|
2223
|
+
unionErrors: i
|
|
2224
|
+
}), g;
|
|
2225
|
+
}
|
|
2226
|
+
if (t.common.async)
|
|
2227
|
+
return Promise.all(n.map(async (s) => {
|
|
2228
|
+
const i = {
|
|
2229
|
+
...t,
|
|
2230
|
+
common: {
|
|
2231
|
+
...t.common,
|
|
2232
|
+
issues: []
|
|
2233
|
+
},
|
|
2234
|
+
parent: null
|
|
2235
|
+
};
|
|
2236
|
+
return {
|
|
2237
|
+
result: await s._parseAsync({
|
|
2238
|
+
data: t.data,
|
|
2239
|
+
path: t.path,
|
|
2240
|
+
parent: i
|
|
2241
|
+
}),
|
|
2242
|
+
ctx: i
|
|
2243
|
+
};
|
|
2244
|
+
})).then(a);
|
|
2245
|
+
{
|
|
2246
|
+
let s;
|
|
2247
|
+
const i = [];
|
|
2248
|
+
for (const c of n) {
|
|
2249
|
+
const l = {
|
|
2250
|
+
...t,
|
|
2251
|
+
common: {
|
|
2252
|
+
...t.common,
|
|
2253
|
+
issues: []
|
|
2254
|
+
},
|
|
2255
|
+
parent: null
|
|
2256
|
+
}, m = c._parseSync({
|
|
2257
|
+
data: t.data,
|
|
2258
|
+
path: t.path,
|
|
2259
|
+
parent: l
|
|
2260
|
+
});
|
|
2261
|
+
if (m.status === "valid")
|
|
2262
|
+
return m;
|
|
2263
|
+
m.status === "dirty" && !s && (s = { result: m, ctx: l }), l.common.issues.length && i.push(l.common.issues);
|
|
2264
|
+
}
|
|
2265
|
+
if (s)
|
|
2266
|
+
return t.common.issues.push(...s.ctx.common.issues), s.result;
|
|
2267
|
+
const o = i.map((c) => new N(c));
|
|
2268
|
+
return u(t, {
|
|
2269
|
+
code: d.invalid_union,
|
|
2270
|
+
unionErrors: o
|
|
2271
|
+
}), g;
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
get options() {
|
|
2275
|
+
return this._def.options;
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
ae.create = (r, e) => new ae({
|
|
2279
|
+
options: r,
|
|
2280
|
+
typeName: h.ZodUnion,
|
|
2281
|
+
...v(e)
|
|
2282
|
+
});
|
|
2283
|
+
const M = (r) => r instanceof oe ? M(r.schema) : r instanceof S ? M(r.innerType()) : r instanceof de ? [r.value] : r instanceof z ? r.options : r instanceof ce ? x.objectValues(r.enum) : r instanceof le ? M(r._def.innerType) : r instanceof re ? [void 0] : r instanceof ne ? [null] : r instanceof O ? [void 0, ...M(r.unwrap())] : r instanceof P ? [null, ...M(r.unwrap())] : r instanceof Oe || r instanceof fe ? M(r.unwrap()) : r instanceof ue ? M(r._def.innerType) : [];
|
|
2284
|
+
class we extends _ {
|
|
2285
|
+
_parse(e) {
|
|
2286
|
+
const { ctx: t } = this._processInputParams(e);
|
|
2287
|
+
if (t.parsedType !== f.object)
|
|
2288
|
+
return u(t, {
|
|
2289
|
+
code: d.invalid_type,
|
|
2290
|
+
expected: f.object,
|
|
2291
|
+
received: t.parsedType
|
|
2292
|
+
}), g;
|
|
2293
|
+
const n = this.discriminator, a = t.data[n], s = this.optionsMap.get(a);
|
|
2294
|
+
return s ? t.common.async ? s._parseAsync({
|
|
2295
|
+
data: t.data,
|
|
2296
|
+
path: t.path,
|
|
2297
|
+
parent: t
|
|
2298
|
+
}) : s._parseSync({
|
|
2299
|
+
data: t.data,
|
|
2300
|
+
path: t.path,
|
|
2301
|
+
parent: t
|
|
2302
|
+
}) : (u(t, {
|
|
2303
|
+
code: d.invalid_union_discriminator,
|
|
2304
|
+
options: Array.from(this.optionsMap.keys()),
|
|
2305
|
+
path: [n]
|
|
2306
|
+
}), g);
|
|
2307
|
+
}
|
|
2308
|
+
get discriminator() {
|
|
2309
|
+
return this._def.discriminator;
|
|
2310
|
+
}
|
|
2311
|
+
get options() {
|
|
2312
|
+
return this._def.options;
|
|
2313
|
+
}
|
|
2314
|
+
get optionsMap() {
|
|
2315
|
+
return this._def.optionsMap;
|
|
2316
|
+
}
|
|
2317
|
+
/**
|
|
2318
|
+
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
2319
|
+
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
2320
|
+
* have a different value for each object in the union.
|
|
2321
|
+
* @param discriminator the name of the discriminator property
|
|
2322
|
+
* @param types an array of object schemas
|
|
2323
|
+
* @param params
|
|
2324
|
+
*/
|
|
2325
|
+
static create(e, t, n) {
|
|
2326
|
+
const a = /* @__PURE__ */ new Map();
|
|
2327
|
+
for (const s of t) {
|
|
2328
|
+
const i = M(s.shape[e]);
|
|
2329
|
+
if (!i.length)
|
|
2330
|
+
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2331
|
+
for (const o of i) {
|
|
2332
|
+
if (a.has(o))
|
|
2333
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
|
|
2334
|
+
a.set(o, s);
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
return new we({
|
|
2338
|
+
typeName: h.ZodDiscriminatedUnion,
|
|
2339
|
+
discriminator: e,
|
|
2340
|
+
options: t,
|
|
2341
|
+
optionsMap: a,
|
|
2342
|
+
...v(n)
|
|
2343
|
+
});
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
function Se(r, e) {
|
|
2347
|
+
const t = D(r), n = D(e);
|
|
2348
|
+
if (r === e)
|
|
2349
|
+
return { valid: !0, data: r };
|
|
2350
|
+
if (t === f.object && n === f.object) {
|
|
2351
|
+
const a = x.objectKeys(e), s = x.objectKeys(r).filter((o) => a.indexOf(o) !== -1), i = { ...r, ...e };
|
|
2352
|
+
for (const o of s) {
|
|
2353
|
+
const c = Se(r[o], e[o]);
|
|
2354
|
+
if (!c.valid)
|
|
2355
|
+
return { valid: !1 };
|
|
2356
|
+
i[o] = c.data;
|
|
2357
|
+
}
|
|
2358
|
+
return { valid: !0, data: i };
|
|
2359
|
+
} else if (t === f.array && n === f.array) {
|
|
2360
|
+
if (r.length !== e.length)
|
|
2361
|
+
return { valid: !1 };
|
|
2362
|
+
const a = [];
|
|
2363
|
+
for (let s = 0; s < r.length; s++) {
|
|
2364
|
+
const i = r[s], o = e[s], c = Se(i, o);
|
|
2365
|
+
if (!c.valid)
|
|
2366
|
+
return { valid: !1 };
|
|
2367
|
+
a.push(c.data);
|
|
2368
|
+
}
|
|
2369
|
+
return { valid: !0, data: a };
|
|
2370
|
+
} else return t === f.date && n === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
2371
|
+
}
|
|
2372
|
+
class se extends _ {
|
|
2373
|
+
_parse(e) {
|
|
2374
|
+
const { status: t, ctx: n } = this._processInputParams(e), a = (s, i) => {
|
|
2375
|
+
if (Ze(s) || Ze(i))
|
|
2376
|
+
return g;
|
|
2377
|
+
const o = Se(s.value, i.value);
|
|
2378
|
+
return o.valid ? ((je(s) || je(i)) && t.dirty(), { status: t.value, value: o.data }) : (u(n, {
|
|
2379
|
+
code: d.invalid_intersection_types
|
|
2380
|
+
}), g);
|
|
2381
|
+
};
|
|
2382
|
+
return n.common.async ? Promise.all([
|
|
2383
|
+
this._def.left._parseAsync({
|
|
2384
|
+
data: n.data,
|
|
2385
|
+
path: n.path,
|
|
2386
|
+
parent: n
|
|
2387
|
+
}),
|
|
2388
|
+
this._def.right._parseAsync({
|
|
2389
|
+
data: n.data,
|
|
2390
|
+
path: n.path,
|
|
2391
|
+
parent: n
|
|
2392
|
+
})
|
|
2393
|
+
]).then(([s, i]) => a(s, i)) : a(this._def.left._parseSync({
|
|
2394
|
+
data: n.data,
|
|
2395
|
+
path: n.path,
|
|
2396
|
+
parent: n
|
|
2397
|
+
}), this._def.right._parseSync({
|
|
2398
|
+
data: n.data,
|
|
2399
|
+
path: n.path,
|
|
2400
|
+
parent: n
|
|
2401
|
+
}));
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
se.create = (r, e, t) => new se({
|
|
2405
|
+
left: r,
|
|
2406
|
+
right: e,
|
|
2407
|
+
typeName: h.ZodIntersection,
|
|
2408
|
+
...v(t)
|
|
2409
|
+
});
|
|
2410
|
+
class A extends _ {
|
|
2411
|
+
_parse(e) {
|
|
2412
|
+
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2413
|
+
if (n.parsedType !== f.array)
|
|
2414
|
+
return u(n, {
|
|
2415
|
+
code: d.invalid_type,
|
|
2416
|
+
expected: f.array,
|
|
2417
|
+
received: n.parsedType
|
|
2418
|
+
}), g;
|
|
2419
|
+
if (n.data.length < this._def.items.length)
|
|
2420
|
+
return u(n, {
|
|
2421
|
+
code: d.too_small,
|
|
2422
|
+
minimum: this._def.items.length,
|
|
2423
|
+
inclusive: !0,
|
|
2424
|
+
exact: !1,
|
|
2425
|
+
type: "array"
|
|
2426
|
+
}), g;
|
|
2427
|
+
!this._def.rest && n.data.length > this._def.items.length && (u(n, {
|
|
2428
|
+
code: d.too_big,
|
|
2429
|
+
maximum: this._def.items.length,
|
|
2430
|
+
inclusive: !0,
|
|
2431
|
+
exact: !1,
|
|
2432
|
+
type: "array"
|
|
2433
|
+
}), t.dirty());
|
|
2434
|
+
const s = [...n.data].map((i, o) => {
|
|
2435
|
+
const c = this._def.items[o] || this._def.rest;
|
|
2436
|
+
return c ? c._parse(new R(n, i, n.path, o)) : null;
|
|
2437
|
+
}).filter((i) => !!i);
|
|
2438
|
+
return n.common.async ? Promise.all(s).then((i) => w.mergeArray(t, i)) : w.mergeArray(t, s);
|
|
2439
|
+
}
|
|
2440
|
+
get items() {
|
|
2441
|
+
return this._def.items;
|
|
2442
|
+
}
|
|
2443
|
+
rest(e) {
|
|
2444
|
+
return new A({
|
|
2445
|
+
...this._def,
|
|
2446
|
+
rest: e
|
|
2447
|
+
});
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
A.create = (r, e) => {
|
|
2451
|
+
if (!Array.isArray(r))
|
|
2452
|
+
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2453
|
+
return new A({
|
|
2454
|
+
items: r,
|
|
2455
|
+
typeName: h.ZodTuple,
|
|
2456
|
+
rest: null,
|
|
2457
|
+
...v(e)
|
|
2458
|
+
});
|
|
2459
|
+
};
|
|
2460
|
+
class ie extends _ {
|
|
2461
|
+
get keySchema() {
|
|
2462
|
+
return this._def.keyType;
|
|
2463
|
+
}
|
|
2464
|
+
get valueSchema() {
|
|
2465
|
+
return this._def.valueType;
|
|
2466
|
+
}
|
|
2467
|
+
_parse(e) {
|
|
2468
|
+
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2469
|
+
if (n.parsedType !== f.object)
|
|
2470
|
+
return u(n, {
|
|
2471
|
+
code: d.invalid_type,
|
|
2472
|
+
expected: f.object,
|
|
2473
|
+
received: n.parsedType
|
|
2474
|
+
}), g;
|
|
2475
|
+
const a = [], s = this._def.keyType, i = this._def.valueType;
|
|
2476
|
+
for (const o in n.data)
|
|
2477
|
+
a.push({
|
|
2478
|
+
key: s._parse(new R(n, o, n.path, o)),
|
|
2479
|
+
value: i._parse(new R(n, n.data[o], n.path, o)),
|
|
2480
|
+
alwaysSet: o in n.data
|
|
2481
|
+
});
|
|
2482
|
+
return n.common.async ? w.mergeObjectAsync(t, a) : w.mergeObjectSync(t, a);
|
|
2483
|
+
}
|
|
2484
|
+
get element() {
|
|
2485
|
+
return this._def.valueType;
|
|
2486
|
+
}
|
|
2487
|
+
static create(e, t, n) {
|
|
2488
|
+
return t instanceof _ ? new ie({
|
|
2489
|
+
keyType: e,
|
|
2490
|
+
valueType: t,
|
|
2491
|
+
typeName: h.ZodRecord,
|
|
2492
|
+
...v(n)
|
|
2493
|
+
}) : new ie({
|
|
2494
|
+
keyType: Z.create(),
|
|
2495
|
+
valueType: e,
|
|
2496
|
+
typeName: h.ZodRecord,
|
|
2497
|
+
...v(t)
|
|
2498
|
+
});
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
class xe extends _ {
|
|
2502
|
+
get keySchema() {
|
|
2503
|
+
return this._def.keyType;
|
|
2504
|
+
}
|
|
2505
|
+
get valueSchema() {
|
|
2506
|
+
return this._def.valueType;
|
|
2507
|
+
}
|
|
2508
|
+
_parse(e) {
|
|
2509
|
+
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2510
|
+
if (n.parsedType !== f.map)
|
|
2511
|
+
return u(n, {
|
|
2512
|
+
code: d.invalid_type,
|
|
2513
|
+
expected: f.map,
|
|
2514
|
+
received: n.parsedType
|
|
2515
|
+
}), g;
|
|
2516
|
+
const a = this._def.keyType, s = this._def.valueType, i = [...n.data.entries()].map(([o, c], l) => ({
|
|
2517
|
+
key: a._parse(new R(n, o, n.path, [l, "key"])),
|
|
2518
|
+
value: s._parse(new R(n, c, n.path, [l, "value"]))
|
|
2519
|
+
}));
|
|
2520
|
+
if (n.common.async) {
|
|
2521
|
+
const o = /* @__PURE__ */ new Map();
|
|
2522
|
+
return Promise.resolve().then(async () => {
|
|
2523
|
+
for (const c of i) {
|
|
2524
|
+
const l = await c.key, m = await c.value;
|
|
2525
|
+
if (l.status === "aborted" || m.status === "aborted")
|
|
2526
|
+
return g;
|
|
2527
|
+
(l.status === "dirty" || m.status === "dirty") && t.dirty(), o.set(l.value, m.value);
|
|
2528
|
+
}
|
|
2529
|
+
return { status: t.value, value: o };
|
|
2530
|
+
});
|
|
2531
|
+
} else {
|
|
2532
|
+
const o = /* @__PURE__ */ new Map();
|
|
2533
|
+
for (const c of i) {
|
|
2534
|
+
const l = c.key, m = c.value;
|
|
2535
|
+
if (l.status === "aborted" || m.status === "aborted")
|
|
2536
|
+
return g;
|
|
2537
|
+
(l.status === "dirty" || m.status === "dirty") && t.dirty(), o.set(l.value, m.value);
|
|
2538
|
+
}
|
|
2539
|
+
return { status: t.value, value: o };
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
xe.create = (r, e, t) => new xe({
|
|
2544
|
+
valueType: e,
|
|
2545
|
+
keyType: r,
|
|
2546
|
+
typeName: h.ZodMap,
|
|
2547
|
+
...v(t)
|
|
2548
|
+
});
|
|
2549
|
+
class W extends _ {
|
|
2550
|
+
_parse(e) {
|
|
2551
|
+
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2552
|
+
if (n.parsedType !== f.set)
|
|
2553
|
+
return u(n, {
|
|
2554
|
+
code: d.invalid_type,
|
|
2555
|
+
expected: f.set,
|
|
2556
|
+
received: n.parsedType
|
|
2557
|
+
}), g;
|
|
2558
|
+
const a = this._def;
|
|
2559
|
+
a.minSize !== null && n.data.size < a.minSize.value && (u(n, {
|
|
2560
|
+
code: d.too_small,
|
|
2561
|
+
minimum: a.minSize.value,
|
|
2562
|
+
type: "set",
|
|
2563
|
+
inclusive: !0,
|
|
2564
|
+
exact: !1,
|
|
2565
|
+
message: a.minSize.message
|
|
2566
|
+
}), t.dirty()), a.maxSize !== null && n.data.size > a.maxSize.value && (u(n, {
|
|
2567
|
+
code: d.too_big,
|
|
2568
|
+
maximum: a.maxSize.value,
|
|
2569
|
+
type: "set",
|
|
2570
|
+
inclusive: !0,
|
|
2571
|
+
exact: !1,
|
|
2572
|
+
message: a.maxSize.message
|
|
2573
|
+
}), t.dirty());
|
|
2574
|
+
const s = this._def.valueType;
|
|
2575
|
+
function i(c) {
|
|
2576
|
+
const l = /* @__PURE__ */ new Set();
|
|
2577
|
+
for (const m of c) {
|
|
2578
|
+
if (m.status === "aborted")
|
|
2579
|
+
return g;
|
|
2580
|
+
m.status === "dirty" && t.dirty(), l.add(m.value);
|
|
2581
|
+
}
|
|
2582
|
+
return { status: t.value, value: l };
|
|
2583
|
+
}
|
|
2584
|
+
const o = [...n.data.values()].map((c, l) => s._parse(new R(n, c, n.path, l)));
|
|
2585
|
+
return n.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
2586
|
+
}
|
|
2587
|
+
min(e, t) {
|
|
2588
|
+
return new W({
|
|
2589
|
+
...this._def,
|
|
2590
|
+
minSize: { value: e, message: p.toString(t) }
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
max(e, t) {
|
|
2594
|
+
return new W({
|
|
2595
|
+
...this._def,
|
|
2596
|
+
maxSize: { value: e, message: p.toString(t) }
|
|
2597
|
+
});
|
|
2598
|
+
}
|
|
2599
|
+
size(e, t) {
|
|
2600
|
+
return this.min(e, t).max(e, t);
|
|
2601
|
+
}
|
|
2602
|
+
nonempty(e) {
|
|
2603
|
+
return this.min(1, e);
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
W.create = (r, e) => new W({
|
|
2607
|
+
valueType: r,
|
|
2608
|
+
minSize: null,
|
|
2609
|
+
maxSize: null,
|
|
2610
|
+
typeName: h.ZodSet,
|
|
2611
|
+
...v(e)
|
|
2612
|
+
});
|
|
2613
|
+
class G extends _ {
|
|
2614
|
+
constructor() {
|
|
2615
|
+
super(...arguments), this.validate = this.implement;
|
|
2616
|
+
}
|
|
2617
|
+
_parse(e) {
|
|
2618
|
+
const { ctx: t } = this._processInputParams(e);
|
|
2619
|
+
if (t.parsedType !== f.function)
|
|
2620
|
+
return u(t, {
|
|
2621
|
+
code: d.invalid_type,
|
|
2622
|
+
expected: f.function,
|
|
2623
|
+
received: t.parsedType
|
|
2624
|
+
}), g;
|
|
2625
|
+
function n(o, c) {
|
|
2626
|
+
return ge({
|
|
2627
|
+
data: o,
|
|
2628
|
+
path: t.path,
|
|
2629
|
+
errorMaps: [
|
|
2630
|
+
t.common.contextualErrorMap,
|
|
2631
|
+
t.schemaErrorMap,
|
|
2632
|
+
ye(),
|
|
2633
|
+
H
|
|
2634
|
+
].filter((l) => !!l),
|
|
2635
|
+
issueData: {
|
|
2636
|
+
code: d.invalid_arguments,
|
|
2637
|
+
argumentsError: c
|
|
2638
|
+
}
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
function a(o, c) {
|
|
2642
|
+
return ge({
|
|
2643
|
+
data: o,
|
|
2644
|
+
path: t.path,
|
|
2645
|
+
errorMaps: [
|
|
2646
|
+
t.common.contextualErrorMap,
|
|
2647
|
+
t.schemaErrorMap,
|
|
2648
|
+
ye(),
|
|
2649
|
+
H
|
|
2650
|
+
].filter((l) => !!l),
|
|
2651
|
+
issueData: {
|
|
2652
|
+
code: d.invalid_return_type,
|
|
2653
|
+
returnTypeError: c
|
|
2654
|
+
}
|
|
2655
|
+
});
|
|
2656
|
+
}
|
|
2657
|
+
const s = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
2658
|
+
if (this._def.returns instanceof Y) {
|
|
2659
|
+
const o = this;
|
|
2660
|
+
return T(async function(...c) {
|
|
2661
|
+
const l = new N([]), m = await o._def.args.parseAsync(c, s).catch((Te) => {
|
|
2662
|
+
throw l.addIssue(n(c, Te)), l;
|
|
2663
|
+
}), C = await Reflect.apply(i, this, m);
|
|
2664
|
+
return await o._def.returns._def.type.parseAsync(C, s).catch((Te) => {
|
|
2665
|
+
throw l.addIssue(a(C, Te)), l;
|
|
2666
|
+
});
|
|
2667
|
+
});
|
|
2668
|
+
} else {
|
|
2669
|
+
const o = this;
|
|
2670
|
+
return T(function(...c) {
|
|
2671
|
+
const l = o._def.args.safeParse(c, s);
|
|
2672
|
+
if (!l.success)
|
|
2673
|
+
throw new N([n(c, l.error)]);
|
|
2674
|
+
const m = Reflect.apply(i, this, l.data), C = o._def.returns.safeParse(m, s);
|
|
2675
|
+
if (!C.success)
|
|
2676
|
+
throw new N([a(m, C.error)]);
|
|
2677
|
+
return C.data;
|
|
2678
|
+
});
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
parameters() {
|
|
2682
|
+
return this._def.args;
|
|
2683
|
+
}
|
|
2684
|
+
returnType() {
|
|
2685
|
+
return this._def.returns;
|
|
2686
|
+
}
|
|
2687
|
+
args(...e) {
|
|
2688
|
+
return new G({
|
|
2689
|
+
...this._def,
|
|
2690
|
+
args: A.create(e).rest(B.create())
|
|
2691
|
+
});
|
|
2692
|
+
}
|
|
2693
|
+
returns(e) {
|
|
2694
|
+
return new G({
|
|
2695
|
+
...this._def,
|
|
2696
|
+
returns: e
|
|
2697
|
+
});
|
|
2698
|
+
}
|
|
2699
|
+
implement(e) {
|
|
2700
|
+
return this.parse(e);
|
|
2701
|
+
}
|
|
2702
|
+
strictImplement(e) {
|
|
2703
|
+
return this.parse(e);
|
|
2704
|
+
}
|
|
2705
|
+
static create(e, t, n) {
|
|
2706
|
+
return new G({
|
|
2707
|
+
args: e || A.create([]).rest(B.create()),
|
|
2708
|
+
returns: t || B.create(),
|
|
2709
|
+
typeName: h.ZodFunction,
|
|
2710
|
+
...v(n)
|
|
2711
|
+
});
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
class oe extends _ {
|
|
2715
|
+
get schema() {
|
|
2716
|
+
return this._def.getter();
|
|
2717
|
+
}
|
|
2718
|
+
_parse(e) {
|
|
2719
|
+
const { ctx: t } = this._processInputParams(e);
|
|
2720
|
+
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
oe.create = (r, e) => new oe({
|
|
2724
|
+
getter: r,
|
|
2725
|
+
typeName: h.ZodLazy,
|
|
2726
|
+
...v(e)
|
|
2727
|
+
});
|
|
2728
|
+
class de extends _ {
|
|
2729
|
+
_parse(e) {
|
|
2730
|
+
if (e.data !== this._def.value) {
|
|
2731
|
+
const t = this._getOrReturnCtx(e);
|
|
2732
|
+
return u(t, {
|
|
2733
|
+
received: t.data,
|
|
2734
|
+
code: d.invalid_literal,
|
|
2735
|
+
expected: this._def.value
|
|
2736
|
+
}), g;
|
|
2737
|
+
}
|
|
2738
|
+
return { status: "valid", value: e.data };
|
|
2739
|
+
}
|
|
2740
|
+
get value() {
|
|
2741
|
+
return this._def.value;
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
de.create = (r, e) => new de({
|
|
2745
|
+
value: r,
|
|
2746
|
+
typeName: h.ZodLiteral,
|
|
2747
|
+
...v(e)
|
|
2748
|
+
});
|
|
2749
|
+
function qe(r, e) {
|
|
2750
|
+
return new z({
|
|
2751
|
+
values: r,
|
|
2752
|
+
typeName: h.ZodEnum,
|
|
2753
|
+
...v(e)
|
|
2754
|
+
});
|
|
2755
|
+
}
|
|
2756
|
+
class z extends _ {
|
|
2757
|
+
constructor() {
|
|
2758
|
+
super(...arguments), X.set(this, void 0);
|
|
2759
|
+
}
|
|
2760
|
+
_parse(e) {
|
|
2761
|
+
if (typeof e.data != "string") {
|
|
2762
|
+
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2763
|
+
return u(t, {
|
|
2764
|
+
expected: x.joinValues(n),
|
|
2765
|
+
received: t.parsedType,
|
|
2766
|
+
code: d.invalid_type
|
|
2767
|
+
}), g;
|
|
2768
|
+
}
|
|
2769
|
+
if (ve(this, X) || Pe(this, X, new Set(this._def.values)), !ve(this, X).has(e.data)) {
|
|
2770
|
+
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2771
|
+
return u(t, {
|
|
2772
|
+
received: t.data,
|
|
2773
|
+
code: d.invalid_enum_value,
|
|
2774
|
+
options: n
|
|
2775
|
+
}), g;
|
|
2776
|
+
}
|
|
2777
|
+
return T(e.data);
|
|
2778
|
+
}
|
|
2779
|
+
get options() {
|
|
2780
|
+
return this._def.values;
|
|
2781
|
+
}
|
|
2782
|
+
get enum() {
|
|
2783
|
+
const e = {};
|
|
2784
|
+
for (const t of this._def.values)
|
|
2785
|
+
e[t] = t;
|
|
2786
|
+
return e;
|
|
2787
|
+
}
|
|
2788
|
+
get Values() {
|
|
2789
|
+
const e = {};
|
|
2790
|
+
for (const t of this._def.values)
|
|
2791
|
+
e[t] = t;
|
|
2792
|
+
return e;
|
|
2793
|
+
}
|
|
2794
|
+
get Enum() {
|
|
2795
|
+
const e = {};
|
|
2796
|
+
for (const t of this._def.values)
|
|
2797
|
+
e[t] = t;
|
|
2798
|
+
return e;
|
|
2799
|
+
}
|
|
2800
|
+
extract(e, t = this._def) {
|
|
2801
|
+
return z.create(e, {
|
|
2802
|
+
...this._def,
|
|
2803
|
+
...t
|
|
2804
|
+
});
|
|
2805
|
+
}
|
|
2806
|
+
exclude(e, t = this._def) {
|
|
2807
|
+
return z.create(this.options.filter((n) => !e.includes(n)), {
|
|
2808
|
+
...this._def,
|
|
2809
|
+
...t
|
|
2810
|
+
});
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
X = /* @__PURE__ */ new WeakMap();
|
|
2814
|
+
z.create = qe;
|
|
2815
|
+
class ce extends _ {
|
|
2816
|
+
constructor() {
|
|
2817
|
+
super(...arguments), Q.set(this, void 0);
|
|
2818
|
+
}
|
|
2819
|
+
_parse(e) {
|
|
2820
|
+
const t = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2821
|
+
if (n.parsedType !== f.string && n.parsedType !== f.number) {
|
|
2822
|
+
const a = x.objectValues(t);
|
|
2823
|
+
return u(n, {
|
|
2824
|
+
expected: x.joinValues(a),
|
|
2825
|
+
received: n.parsedType,
|
|
2826
|
+
code: d.invalid_type
|
|
2827
|
+
}), g;
|
|
2828
|
+
}
|
|
2829
|
+
if (ve(this, Q) || Pe(this, Q, new Set(x.getValidEnumValues(this._def.values))), !ve(this, Q).has(e.data)) {
|
|
2830
|
+
const a = x.objectValues(t);
|
|
2831
|
+
return u(n, {
|
|
2832
|
+
received: n.data,
|
|
2833
|
+
code: d.invalid_enum_value,
|
|
2834
|
+
options: a
|
|
2835
|
+
}), g;
|
|
2836
|
+
}
|
|
2837
|
+
return T(e.data);
|
|
2838
|
+
}
|
|
2839
|
+
get enum() {
|
|
2840
|
+
return this._def.values;
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
Q = /* @__PURE__ */ new WeakMap();
|
|
2844
|
+
ce.create = (r, e) => new ce({
|
|
2845
|
+
values: r,
|
|
2846
|
+
typeName: h.ZodNativeEnum,
|
|
2847
|
+
...v(e)
|
|
2848
|
+
});
|
|
2849
|
+
class Y extends _ {
|
|
2850
|
+
unwrap() {
|
|
2851
|
+
return this._def.type;
|
|
2852
|
+
}
|
|
2853
|
+
_parse(e) {
|
|
2854
|
+
const { ctx: t } = this._processInputParams(e);
|
|
2855
|
+
if (t.parsedType !== f.promise && t.common.async === !1)
|
|
2856
|
+
return u(t, {
|
|
2857
|
+
code: d.invalid_type,
|
|
2858
|
+
expected: f.promise,
|
|
2859
|
+
received: t.parsedType
|
|
2860
|
+
}), g;
|
|
2861
|
+
const n = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
|
|
2862
|
+
return T(n.then((a) => this._def.type.parseAsync(a, {
|
|
2863
|
+
path: t.path,
|
|
2864
|
+
errorMap: t.common.contextualErrorMap
|
|
2865
|
+
})));
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
Y.create = (r, e) => new Y({
|
|
2869
|
+
type: r,
|
|
2870
|
+
typeName: h.ZodPromise,
|
|
2871
|
+
...v(e)
|
|
2872
|
+
});
|
|
2873
|
+
class S extends _ {
|
|
2874
|
+
innerType() {
|
|
2875
|
+
return this._def.schema;
|
|
2876
|
+
}
|
|
2877
|
+
sourceType() {
|
|
2878
|
+
return this._def.schema._def.typeName === h.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2879
|
+
}
|
|
2880
|
+
_parse(e) {
|
|
2881
|
+
const { status: t, ctx: n } = this._processInputParams(e), a = this._def.effect || null, s = {
|
|
2882
|
+
addIssue: (i) => {
|
|
2883
|
+
u(n, i), i.fatal ? t.abort() : t.dirty();
|
|
2884
|
+
},
|
|
2885
|
+
get path() {
|
|
2886
|
+
return n.path;
|
|
2887
|
+
}
|
|
2888
|
+
};
|
|
2889
|
+
if (s.addIssue = s.addIssue.bind(s), a.type === "preprocess") {
|
|
2890
|
+
const i = a.transform(n.data, s);
|
|
2891
|
+
if (n.common.async)
|
|
2892
|
+
return Promise.resolve(i).then(async (o) => {
|
|
2893
|
+
if (t.value === "aborted")
|
|
2894
|
+
return g;
|
|
2895
|
+
const c = await this._def.schema._parseAsync({
|
|
2896
|
+
data: o,
|
|
2897
|
+
path: n.path,
|
|
2898
|
+
parent: n
|
|
2899
|
+
});
|
|
2900
|
+
return c.status === "aborted" ? g : c.status === "dirty" || t.value === "dirty" ? F(c.value) : c;
|
|
2901
|
+
});
|
|
2902
|
+
{
|
|
2903
|
+
if (t.value === "aborted")
|
|
2904
|
+
return g;
|
|
2905
|
+
const o = this._def.schema._parseSync({
|
|
2906
|
+
data: i,
|
|
2907
|
+
path: n.path,
|
|
2908
|
+
parent: n
|
|
2909
|
+
});
|
|
2910
|
+
return o.status === "aborted" ? g : o.status === "dirty" || t.value === "dirty" ? F(o.value) : o;
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
if (a.type === "refinement") {
|
|
2914
|
+
const i = (o) => {
|
|
2915
|
+
const c = a.refinement(o, s);
|
|
2916
|
+
if (n.common.async)
|
|
2917
|
+
return Promise.resolve(c);
|
|
2918
|
+
if (c instanceof Promise)
|
|
2919
|
+
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2920
|
+
return o;
|
|
2921
|
+
};
|
|
2922
|
+
if (n.common.async === !1) {
|
|
2923
|
+
const o = this._def.schema._parseSync({
|
|
2924
|
+
data: n.data,
|
|
2925
|
+
path: n.path,
|
|
2926
|
+
parent: n
|
|
2927
|
+
});
|
|
2928
|
+
return o.status === "aborted" ? g : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
|
|
2929
|
+
} else
|
|
2930
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? g : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
2931
|
+
}
|
|
2932
|
+
if (a.type === "transform")
|
|
2933
|
+
if (n.common.async === !1) {
|
|
2934
|
+
const i = this._def.schema._parseSync({
|
|
2935
|
+
data: n.data,
|
|
2936
|
+
path: n.path,
|
|
2937
|
+
parent: n
|
|
2938
|
+
});
|
|
2939
|
+
if (!K(i))
|
|
2940
|
+
return i;
|
|
2941
|
+
const o = a.transform(i.value, s);
|
|
2942
|
+
if (o instanceof Promise)
|
|
2943
|
+
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2944
|
+
return { status: t.value, value: o };
|
|
2945
|
+
} else
|
|
2946
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => K(i) ? Promise.resolve(a.transform(i.value, s)).then((o) => ({ status: t.value, value: o })) : i);
|
|
2947
|
+
x.assertNever(a);
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
S.create = (r, e, t) => new S({
|
|
2951
|
+
schema: r,
|
|
2952
|
+
typeName: h.ZodEffects,
|
|
2953
|
+
effect: e,
|
|
2954
|
+
...v(t)
|
|
2955
|
+
});
|
|
2956
|
+
S.createWithPreprocess = (r, e, t) => new S({
|
|
2957
|
+
schema: e,
|
|
2958
|
+
effect: { type: "preprocess", transform: r },
|
|
2959
|
+
typeName: h.ZodEffects,
|
|
2960
|
+
...v(t)
|
|
2961
|
+
});
|
|
2962
|
+
class O extends _ {
|
|
2963
|
+
_parse(e) {
|
|
2964
|
+
return this._getType(e) === f.undefined ? T(void 0) : this._def.innerType._parse(e);
|
|
2965
|
+
}
|
|
2966
|
+
unwrap() {
|
|
2967
|
+
return this._def.innerType;
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
O.create = (r, e) => new O({
|
|
2971
|
+
innerType: r,
|
|
2972
|
+
typeName: h.ZodOptional,
|
|
2973
|
+
...v(e)
|
|
2974
|
+
});
|
|
2975
|
+
class P extends _ {
|
|
2976
|
+
_parse(e) {
|
|
2977
|
+
return this._getType(e) === f.null ? T(null) : this._def.innerType._parse(e);
|
|
2978
|
+
}
|
|
2979
|
+
unwrap() {
|
|
2980
|
+
return this._def.innerType;
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
P.create = (r, e) => new P({
|
|
2984
|
+
innerType: r,
|
|
2985
|
+
typeName: h.ZodNullable,
|
|
2986
|
+
...v(e)
|
|
2987
|
+
});
|
|
2988
|
+
class le extends _ {
|
|
2989
|
+
_parse(e) {
|
|
2990
|
+
const { ctx: t } = this._processInputParams(e);
|
|
2991
|
+
let n = t.data;
|
|
2992
|
+
return t.parsedType === f.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
2993
|
+
data: n,
|
|
2994
|
+
path: t.path,
|
|
2995
|
+
parent: t
|
|
2996
|
+
});
|
|
2997
|
+
}
|
|
2998
|
+
removeDefault() {
|
|
2999
|
+
return this._def.innerType;
|
|
3000
|
+
}
|
|
3001
|
+
}
|
|
3002
|
+
le.create = (r, e) => new le({
|
|
3003
|
+
innerType: r,
|
|
3004
|
+
typeName: h.ZodDefault,
|
|
3005
|
+
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
3006
|
+
...v(e)
|
|
3007
|
+
});
|
|
3008
|
+
class ue extends _ {
|
|
3009
|
+
_parse(e) {
|
|
3010
|
+
const { ctx: t } = this._processInputParams(e), n = {
|
|
3011
|
+
...t,
|
|
3012
|
+
common: {
|
|
3013
|
+
...t.common,
|
|
3014
|
+
issues: []
|
|
3015
|
+
}
|
|
3016
|
+
}, a = this._def.innerType._parse({
|
|
3017
|
+
data: n.data,
|
|
3018
|
+
path: n.path,
|
|
3019
|
+
parent: {
|
|
3020
|
+
...n
|
|
3021
|
+
}
|
|
3022
|
+
});
|
|
3023
|
+
return ee(a) ? a.then((s) => ({
|
|
3024
|
+
status: "valid",
|
|
3025
|
+
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
3026
|
+
get error() {
|
|
3027
|
+
return new N(n.common.issues);
|
|
3028
|
+
},
|
|
3029
|
+
input: n.data
|
|
3030
|
+
})
|
|
3031
|
+
})) : {
|
|
3032
|
+
status: "valid",
|
|
3033
|
+
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
3034
|
+
get error() {
|
|
3035
|
+
return new N(n.common.issues);
|
|
3036
|
+
},
|
|
3037
|
+
input: n.data
|
|
3038
|
+
})
|
|
3039
|
+
};
|
|
3040
|
+
}
|
|
3041
|
+
removeCatch() {
|
|
3042
|
+
return this._def.innerType;
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
ue.create = (r, e) => new ue({
|
|
3046
|
+
innerType: r,
|
|
3047
|
+
typeName: h.ZodCatch,
|
|
3048
|
+
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
3049
|
+
...v(e)
|
|
3050
|
+
});
|
|
3051
|
+
class ke extends _ {
|
|
3052
|
+
_parse(e) {
|
|
3053
|
+
if (this._getType(e) !== f.nan) {
|
|
3054
|
+
const n = this._getOrReturnCtx(e);
|
|
3055
|
+
return u(n, {
|
|
3056
|
+
code: d.invalid_type,
|
|
3057
|
+
expected: f.nan,
|
|
3058
|
+
received: n.parsedType
|
|
3059
|
+
}), g;
|
|
3060
|
+
}
|
|
3061
|
+
return { status: "valid", value: e.data };
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
ke.create = (r) => new ke({
|
|
3065
|
+
typeName: h.ZodNaN,
|
|
3066
|
+
...v(r)
|
|
3067
|
+
});
|
|
3068
|
+
const At = Symbol("zod_brand");
|
|
3069
|
+
class Oe extends _ {
|
|
3070
|
+
_parse(e) {
|
|
3071
|
+
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
3072
|
+
return this._def.type._parse({
|
|
3073
|
+
data: n,
|
|
3074
|
+
path: t.path,
|
|
3075
|
+
parent: t
|
|
3076
|
+
});
|
|
3077
|
+
}
|
|
3078
|
+
unwrap() {
|
|
3079
|
+
return this._def.type;
|
|
3080
|
+
}
|
|
3081
|
+
}
|
|
3082
|
+
class pe extends _ {
|
|
3083
|
+
_parse(e) {
|
|
3084
|
+
const { status: t, ctx: n } = this._processInputParams(e);
|
|
3085
|
+
if (n.common.async)
|
|
3086
|
+
return (async () => {
|
|
3087
|
+
const s = await this._def.in._parseAsync({
|
|
3088
|
+
data: n.data,
|
|
3089
|
+
path: n.path,
|
|
3090
|
+
parent: n
|
|
3091
|
+
});
|
|
3092
|
+
return s.status === "aborted" ? g : s.status === "dirty" ? (t.dirty(), F(s.value)) : this._def.out._parseAsync({
|
|
3093
|
+
data: s.value,
|
|
3094
|
+
path: n.path,
|
|
3095
|
+
parent: n
|
|
3096
|
+
});
|
|
3097
|
+
})();
|
|
3098
|
+
{
|
|
3099
|
+
const a = this._def.in._parseSync({
|
|
3100
|
+
data: n.data,
|
|
3101
|
+
path: n.path,
|
|
3102
|
+
parent: n
|
|
3103
|
+
});
|
|
3104
|
+
return a.status === "aborted" ? g : a.status === "dirty" ? (t.dirty(), {
|
|
3105
|
+
status: "dirty",
|
|
3106
|
+
value: a.value
|
|
3107
|
+
}) : this._def.out._parseSync({
|
|
3108
|
+
data: a.value,
|
|
3109
|
+
path: n.path,
|
|
3110
|
+
parent: n
|
|
3111
|
+
});
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
static create(e, t) {
|
|
3115
|
+
return new pe({
|
|
3116
|
+
in: e,
|
|
3117
|
+
out: t,
|
|
3118
|
+
typeName: h.ZodPipeline
|
|
3119
|
+
});
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
class fe extends _ {
|
|
3123
|
+
_parse(e) {
|
|
3124
|
+
const t = this._def.innerType._parse(e), n = (a) => (K(a) && (a.value = Object.freeze(a.value)), a);
|
|
3125
|
+
return ee(t) ? t.then((a) => n(a)) : n(t);
|
|
3126
|
+
}
|
|
3127
|
+
unwrap() {
|
|
3128
|
+
return this._def.innerType;
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
fe.create = (r, e) => new fe({
|
|
3132
|
+
innerType: r,
|
|
3133
|
+
typeName: h.ZodReadonly,
|
|
3134
|
+
...v(e)
|
|
3135
|
+
});
|
|
3136
|
+
function Fe(r, e = {}, t) {
|
|
3137
|
+
return r ? J.create().superRefine((n, a) => {
|
|
3138
|
+
var s, i;
|
|
3139
|
+
if (!r(n)) {
|
|
3140
|
+
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, c = (i = (s = o.fatal) !== null && s !== void 0 ? s : t) !== null && i !== void 0 ? i : !0, l = typeof o == "string" ? { message: o } : o;
|
|
3141
|
+
a.addIssue({ code: "custom", ...l, fatal: c });
|
|
3142
|
+
}
|
|
3143
|
+
}) : J.create();
|
|
3144
|
+
}
|
|
3145
|
+
const Mt = {
|
|
3146
|
+
object: k.lazycreate
|
|
3147
|
+
};
|
|
3148
|
+
var h;
|
|
3149
|
+
(function(r) {
|
|
3150
|
+
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
3151
|
+
})(h || (h = {}));
|
|
3152
|
+
const Vt = (r, e = {
|
|
3153
|
+
message: `Input not instance of ${r.name}`
|
|
3154
|
+
}) => Fe((t) => t instanceof r, e), Ge = Z.create, He = L.create, Dt = ke.create, Lt = $.create, Je = te.create, $t = U.create, zt = _e.create, Pt = re.create, Bt = ne.create, Ut = J.create, Wt = B.create, qt = V.create, Ft = be.create, Gt = j.create, Ht = k.create, Jt = k.strictCreate, Yt = ae.create, Xt = we.create, Qt = se.create, Kt = A.create, er = ie.create, tr = xe.create, rr = W.create, nr = G.create, ar = oe.create, sr = de.create, ir = z.create, or = ce.create, dr = Y.create, Ve = S.create, cr = O.create, lr = P.create, ur = S.createWithPreprocess, fr = pe.create, pr = () => Ge().optional(), hr = () => He().optional(), mr = () => Je().optional(), yr = {
|
|
3155
|
+
string: (r) => Z.create({ ...r, coerce: !0 }),
|
|
3156
|
+
number: (r) => L.create({ ...r, coerce: !0 }),
|
|
3157
|
+
boolean: (r) => te.create({
|
|
3158
|
+
...r,
|
|
3159
|
+
coerce: !0
|
|
3160
|
+
}),
|
|
3161
|
+
bigint: (r) => $.create({ ...r, coerce: !0 }),
|
|
3162
|
+
date: (r) => U.create({ ...r, coerce: !0 })
|
|
3163
|
+
}, gr = g;
|
|
3164
|
+
var I = /* @__PURE__ */ Object.freeze({
|
|
3165
|
+
__proto__: null,
|
|
3166
|
+
defaultErrorMap: H,
|
|
3167
|
+
setErrorMap: gt,
|
|
3168
|
+
getErrorMap: ye,
|
|
3169
|
+
makeIssue: ge,
|
|
3170
|
+
EMPTY_PATH: vt,
|
|
3171
|
+
addIssueToContext: u,
|
|
3172
|
+
ParseStatus: w,
|
|
3173
|
+
INVALID: g,
|
|
3174
|
+
DIRTY: F,
|
|
3175
|
+
OK: T,
|
|
3176
|
+
isAborted: Ze,
|
|
3177
|
+
isDirty: je,
|
|
3178
|
+
isValid: K,
|
|
3179
|
+
isAsync: ee,
|
|
3180
|
+
get util() {
|
|
3181
|
+
return x;
|
|
3182
|
+
},
|
|
3183
|
+
get objectUtil() {
|
|
3184
|
+
return Ee;
|
|
3185
|
+
},
|
|
3186
|
+
ZodParsedType: f,
|
|
3187
|
+
getParsedType: D,
|
|
3188
|
+
ZodType: _,
|
|
3189
|
+
datetimeRegex: We,
|
|
3190
|
+
ZodString: Z,
|
|
3191
|
+
ZodNumber: L,
|
|
3192
|
+
ZodBigInt: $,
|
|
3193
|
+
ZodBoolean: te,
|
|
3194
|
+
ZodDate: U,
|
|
3195
|
+
ZodSymbol: _e,
|
|
3196
|
+
ZodUndefined: re,
|
|
3197
|
+
ZodNull: ne,
|
|
3198
|
+
ZodAny: J,
|
|
3199
|
+
ZodUnknown: B,
|
|
3200
|
+
ZodNever: V,
|
|
3201
|
+
ZodVoid: be,
|
|
3202
|
+
ZodArray: j,
|
|
3203
|
+
ZodObject: k,
|
|
3204
|
+
ZodUnion: ae,
|
|
3205
|
+
ZodDiscriminatedUnion: we,
|
|
3206
|
+
ZodIntersection: se,
|
|
3207
|
+
ZodTuple: A,
|
|
3208
|
+
ZodRecord: ie,
|
|
3209
|
+
ZodMap: xe,
|
|
3210
|
+
ZodSet: W,
|
|
3211
|
+
ZodFunction: G,
|
|
3212
|
+
ZodLazy: oe,
|
|
3213
|
+
ZodLiteral: de,
|
|
3214
|
+
ZodEnum: z,
|
|
3215
|
+
ZodNativeEnum: ce,
|
|
3216
|
+
ZodPromise: Y,
|
|
3217
|
+
ZodEffects: S,
|
|
3218
|
+
ZodTransformer: S,
|
|
3219
|
+
ZodOptional: O,
|
|
3220
|
+
ZodNullable: P,
|
|
3221
|
+
ZodDefault: le,
|
|
3222
|
+
ZodCatch: ue,
|
|
3223
|
+
ZodNaN: ke,
|
|
3224
|
+
BRAND: At,
|
|
3225
|
+
ZodBranded: Oe,
|
|
3226
|
+
ZodPipeline: pe,
|
|
3227
|
+
ZodReadonly: fe,
|
|
3228
|
+
custom: Fe,
|
|
3229
|
+
Schema: _,
|
|
3230
|
+
ZodSchema: _,
|
|
3231
|
+
late: Mt,
|
|
3232
|
+
get ZodFirstPartyTypeKind() {
|
|
3233
|
+
return h;
|
|
3234
|
+
},
|
|
3235
|
+
coerce: yr,
|
|
3236
|
+
any: Ut,
|
|
3237
|
+
array: Gt,
|
|
3238
|
+
bigint: Lt,
|
|
3239
|
+
boolean: Je,
|
|
3240
|
+
date: $t,
|
|
3241
|
+
discriminatedUnion: Xt,
|
|
3242
|
+
effect: Ve,
|
|
3243
|
+
enum: ir,
|
|
3244
|
+
function: nr,
|
|
3245
|
+
instanceof: Vt,
|
|
3246
|
+
intersection: Qt,
|
|
3247
|
+
lazy: ar,
|
|
3248
|
+
literal: sr,
|
|
3249
|
+
map: tr,
|
|
3250
|
+
nan: Dt,
|
|
3251
|
+
nativeEnum: or,
|
|
3252
|
+
never: qt,
|
|
3253
|
+
null: Bt,
|
|
3254
|
+
nullable: lr,
|
|
3255
|
+
number: He,
|
|
3256
|
+
object: Ht,
|
|
3257
|
+
oboolean: mr,
|
|
3258
|
+
onumber: hr,
|
|
3259
|
+
optional: cr,
|
|
3260
|
+
ostring: pr,
|
|
3261
|
+
pipeline: fr,
|
|
3262
|
+
preprocess: ur,
|
|
3263
|
+
promise: dr,
|
|
3264
|
+
record: er,
|
|
3265
|
+
set: rr,
|
|
3266
|
+
strictObject: Jt,
|
|
3267
|
+
string: Ge,
|
|
3268
|
+
symbol: zt,
|
|
3269
|
+
transformer: Ve,
|
|
3270
|
+
tuple: Kt,
|
|
3271
|
+
undefined: Pt,
|
|
3272
|
+
union: Yt,
|
|
3273
|
+
unknown: Wt,
|
|
3274
|
+
void: Ft,
|
|
3275
|
+
NEVER: gr,
|
|
3276
|
+
ZodIssueCode: d,
|
|
3277
|
+
quotelessJson: yt,
|
|
3278
|
+
ZodError: N
|
|
3279
|
+
});
|
|
3280
|
+
const De = (r) => {
|
|
3281
|
+
const e = r.trim().replace(/\s+/g, " ").split(" "), [t, n, ...a] = e, s = a == null ? void 0 : a.join(" ");
|
|
3282
|
+
return {
|
|
3283
|
+
surname: t,
|
|
3284
|
+
name: n,
|
|
3285
|
+
patronymic: s
|
|
3286
|
+
};
|
|
3287
|
+
}, Rr = I.string({ invalid_type_error: "Обязательно к заполнению", required_error: "Обязательно к заполнению" }).superRefine((r, e) => {
|
|
3288
|
+
ht.test(r) || e.addIssue({
|
|
3289
|
+
code: I.ZodIssueCode.custom,
|
|
3290
|
+
message: "Должна быть только кириллица"
|
|
3291
|
+
});
|
|
3292
|
+
const { surname: t, name: n, patronymic: a } = De(r);
|
|
3293
|
+
(!t || !n) && e.addIssue({
|
|
3294
|
+
code: I.ZodIssueCode.custom,
|
|
3295
|
+
message: "Введите имя и фамилию"
|
|
3296
|
+
}), Ae.test(n) || e.addIssue({
|
|
3297
|
+
code: I.ZodIssueCode.custom,
|
|
3298
|
+
message: "Неверно введено имя"
|
|
3299
|
+
}), Ae.test(t) || e.addIssue({
|
|
3300
|
+
code: I.ZodIssueCode.custom,
|
|
3301
|
+
message: "Неверно введена фамилия"
|
|
3302
|
+
}), a && (mt.test(a) || e.addIssue({
|
|
3303
|
+
code: I.ZodIssueCode.custom,
|
|
3304
|
+
message: "Неверно введено отчество"
|
|
3305
|
+
}));
|
|
3306
|
+
}).transform((r) => {
|
|
3307
|
+
const { surname: e, name: t, patronymic: n } = De(r);
|
|
3308
|
+
return {
|
|
3309
|
+
surname: Ce(e),
|
|
3310
|
+
name: Ce(t),
|
|
3311
|
+
patronymic: n ? Ce(n) : void 0
|
|
3312
|
+
};
|
|
3313
|
+
}), Ar = I.string().length(10, { message: me.INVALID_DATE }).superRefine((r, e) => {
|
|
3314
|
+
const [t, n, a] = (r == null ? void 0 : r.split(".")) ?? "", s = Le(`${t}/${n}/${a}`, "dd/MM/yyyy", /* @__PURE__ */ new Date());
|
|
3315
|
+
+a <= 1950 && e.addIssue({
|
|
3316
|
+
code: I.ZodIssueCode.custom,
|
|
3317
|
+
message: me.INVALID_DATE
|
|
3318
|
+
}), Ye(s) || e.addIssue({
|
|
3319
|
+
code: I.ZodIssueCode.custom,
|
|
3320
|
+
message: me.INVALID_DATE
|
|
3321
|
+
}), (/* @__PURE__ */ new Date()).getTime() < new Date(s).getTime() && e.addIssue({
|
|
3322
|
+
code: I.ZodIssueCode.custom,
|
|
3323
|
+
message: me.FUTURE_DATE_NOT_ALLOWED
|
|
3324
|
+
});
|
|
3325
|
+
}), he = {
|
|
3326
|
+
transparent: "transparent",
|
|
3327
|
+
current: "currentColor",
|
|
3328
|
+
inherit: "inherit",
|
|
3329
|
+
initial: "initial"
|
|
3330
|
+
}, Mr = {
|
|
3331
|
+
"blue-grey-100": "#f3f4f7",
|
|
3332
|
+
"blue-grey-200": "#eaedf1",
|
|
3333
|
+
"blue-grey-300": "#d4dbe2",
|
|
3334
|
+
"blue-grey-500": "#a9b6c5",
|
|
3335
|
+
footer: "#40465a",
|
|
3336
|
+
negative: "#f42500",
|
|
3337
|
+
"negative-light": "#ffd2ca",
|
|
3338
|
+
positive: "#76bc21",
|
|
3339
|
+
"positive-light": "#e4f6ce",
|
|
3340
|
+
"primary-default": "#003790",
|
|
3341
|
+
"primary-focus": "#2477ff",
|
|
3342
|
+
"primary-hover": "#042e73",
|
|
3343
|
+
"primary-light-default": "#f0f4f9",
|
|
3344
|
+
"primary-tr-focus": "#0037901f",
|
|
3345
|
+
"primary-tr-hover": "#00379014",
|
|
3346
|
+
"primary-tr-pressed": "#00379033",
|
|
3347
|
+
"secondary-default": "#fc5055",
|
|
3348
|
+
"secondary-hover": "#f12f34",
|
|
3349
|
+
warning: "#f49f00",
|
|
3350
|
+
"warning-light": "#ffeecc",
|
|
3351
|
+
white: "#ffffff",
|
|
3352
|
+
"primary-disabled": "#809bc7",
|
|
3353
|
+
"secondary-disabled": "#FFB7BF",
|
|
3354
|
+
...he
|
|
3355
|
+
}, Vr = {
|
|
3356
|
+
dark: "#292929",
|
|
3357
|
+
disabled: "#a9b6c5",
|
|
3358
|
+
footer: "#c3c3c3",
|
|
3359
|
+
negative: "#f42500",
|
|
3360
|
+
positive: "#76bc21",
|
|
3361
|
+
"primary-default": "#003790",
|
|
3362
|
+
"primary-hover": "#042e73",
|
|
3363
|
+
secondary: "#40465a",
|
|
3364
|
+
tetriary: "#5a6e85",
|
|
3365
|
+
warning: "#f49f00",
|
|
3366
|
+
white: "#ffffff",
|
|
3367
|
+
"primary-disabled": "#809bc7",
|
|
3368
|
+
"blue-grey-600": "#94a4b7",
|
|
3369
|
+
...he
|
|
3370
|
+
}, Dr = {
|
|
3371
|
+
"barvcray-200": "#ebeef4",
|
|
3372
|
+
"barvcray-300": "#dde1e8",
|
|
3373
|
+
"greymint-200": "#deecee",
|
|
3374
|
+
"lavender-100": "#f7f7ff",
|
|
3375
|
+
"lavender-200": "#ecedfa",
|
|
3376
|
+
"lavender-300": "#d0d3f1",
|
|
3377
|
+
"lightblue-300": "#bed3ec",
|
|
3378
|
+
"mint-200": "#e4f5ed",
|
|
3379
|
+
"salmon-200": "#faecec",
|
|
3380
|
+
"skyblue-100": "#f4f8fe",
|
|
3381
|
+
"skyblue-200": "#e7f3ff",
|
|
3382
|
+
"skyblue-300": "#d9edff",
|
|
3383
|
+
...he
|
|
3384
|
+
}, Lr = {
|
|
3385
|
+
"accent-default": "#2477ff",
|
|
3386
|
+
"accent-hover": "#0053da",
|
|
3387
|
+
"blue-grey-100": "#f3f4f7",
|
|
3388
|
+
"blue-grey-600": "#94a4b7",
|
|
3389
|
+
"blue-grey-700": "#69809a",
|
|
3390
|
+
"blue-grey-800": "#5a6e85",
|
|
3391
|
+
"dark-default": "#292929",
|
|
3392
|
+
"dark-hover": "#535353",
|
|
3393
|
+
disabled: "#a9b6c5",
|
|
3394
|
+
"negative-default": "#f42500",
|
|
3395
|
+
"negative-hover": "#c31e00",
|
|
3396
|
+
"positive-default": "#76bc21",
|
|
3397
|
+
"positive-hover": "#598d19",
|
|
3398
|
+
"primary-default": "#003790",
|
|
3399
|
+
"primary-hover": "#042e73",
|
|
3400
|
+
"secondary-dark-default": "#f12f34",
|
|
3401
|
+
"secondary-dark-hover": "#c40309",
|
|
3402
|
+
"secondary-default": "#fc5055",
|
|
3403
|
+
"secondary-hover": "#f12f34",
|
|
3404
|
+
"warning-default": "#f49f00",
|
|
3405
|
+
"warning-hover": "#d68b00",
|
|
3406
|
+
white: "#ffffff",
|
|
3407
|
+
"primary-disabled": "#809bc7",
|
|
3408
|
+
footer: "#C3C3C3",
|
|
3409
|
+
...he
|
|
3410
|
+
}, $r = {
|
|
3411
|
+
"blue-grey-500": "#a9b6c5",
|
|
3412
|
+
"blue-grey-700": "#69809a",
|
|
3413
|
+
"blue-grey-800": "#5a6e85",
|
|
3414
|
+
dark: "#292929",
|
|
3415
|
+
negative: "#f42500",
|
|
3416
|
+
positive: "#76bc21",
|
|
3417
|
+
"primary-default": "#003790",
|
|
3418
|
+
"primary-focus": "#2477ff",
|
|
3419
|
+
"primary-hover": "#042e73",
|
|
3420
|
+
"primary-light": "#f0f4f9",
|
|
3421
|
+
"secondary-default": "#fc5055",
|
|
3422
|
+
"secondary-hover": "#f12f34",
|
|
3423
|
+
"warm-grey-200": "#e4e4e4",
|
|
3424
|
+
"warm-grey-300": "#c3c3c3",
|
|
3425
|
+
warning: "#f49f00",
|
|
3426
|
+
white: "#ffffff",
|
|
3427
|
+
"primary-disabled": "#809bc7",
|
|
3428
|
+
...he
|
|
3429
|
+
}, zr = {
|
|
3430
|
+
none: "0",
|
|
3431
|
+
sm: "4px",
|
|
3432
|
+
md: "8px",
|
|
3433
|
+
lg: "16px",
|
|
3434
|
+
full: "9999px"
|
|
3435
|
+
}, Pr = {
|
|
3436
|
+
30: "30deg",
|
|
3437
|
+
45: "45deg",
|
|
3438
|
+
80: "80deg",
|
|
3439
|
+
90: "90deg",
|
|
3440
|
+
110: "110deg",
|
|
3441
|
+
180: "180deg"
|
|
3442
|
+
}, Br = {
|
|
3443
|
+
12: "12px",
|
|
3444
|
+
14: "14px",
|
|
3445
|
+
16: "16px",
|
|
3446
|
+
18: "18px",
|
|
3447
|
+
20: "20px",
|
|
3448
|
+
24: "24px",
|
|
3449
|
+
28: "28px",
|
|
3450
|
+
32: "32px",
|
|
3451
|
+
40: "40px"
|
|
3452
|
+
}, Ur = {
|
|
3453
|
+
16: "16px",
|
|
3454
|
+
20: "20px",
|
|
3455
|
+
22: "22px",
|
|
3456
|
+
24: "24px",
|
|
3457
|
+
30: "30px",
|
|
3458
|
+
32: "32px",
|
|
3459
|
+
40: "40px",
|
|
3460
|
+
48: "48px"
|
|
3461
|
+
}, Wr = {
|
|
3462
|
+
/* # Headline */
|
|
3463
|
+
".mob-headline-bold-m": {
|
|
3464
|
+
"@apply font-bold text-28 leading-32": ""
|
|
3465
|
+
},
|
|
3466
|
+
".mob-headline-bold-s": {
|
|
3467
|
+
"@apply font-bold text-24 leading-30": ""
|
|
3468
|
+
},
|
|
3469
|
+
/* # Title */
|
|
3470
|
+
".mob-title-bold-l": {
|
|
3471
|
+
"@apply font-bold text-20 leading-24": ""
|
|
3472
|
+
},
|
|
3473
|
+
".mob-title-bold-m": {
|
|
3474
|
+
"@apply font-bold text-18 leading-22": ""
|
|
3475
|
+
},
|
|
3476
|
+
/* # Body */
|
|
3477
|
+
".mob-body-medium-l": {
|
|
3478
|
+
"@apply font-medium text-16 leading-22": ""
|
|
3479
|
+
},
|
|
3480
|
+
".mob-body-regular-l": {
|
|
3481
|
+
"@apply font-normal text-16 leading-22": ""
|
|
3482
|
+
},
|
|
3483
|
+
".mob-body-medium-m": {
|
|
3484
|
+
"@apply font-medium text-14 leading-20": ""
|
|
3485
|
+
},
|
|
3486
|
+
".mob-body-regular-m": {
|
|
3487
|
+
"@apply font-normal text-14 leading-20": ""
|
|
3488
|
+
},
|
|
3489
|
+
".mob-body-regular-s": {
|
|
3490
|
+
"@apply font-normal text-12 leading-20": ""
|
|
3491
|
+
},
|
|
3492
|
+
/* -------- Desktop Typography -------- */
|
|
3493
|
+
/* # Headline */
|
|
3494
|
+
".desk-headline-bold-l": {
|
|
3495
|
+
"@apply font-bold text-40 leading-48": ""
|
|
3496
|
+
},
|
|
3497
|
+
".desk-headline-bold-m": {
|
|
3498
|
+
"@apply font-bold text-32 leading-40": ""
|
|
3499
|
+
},
|
|
3500
|
+
/* # Title */
|
|
3501
|
+
".desk-title-bold-l": {
|
|
3502
|
+
"@apply font-bold text-24 leading-30": ""
|
|
3503
|
+
},
|
|
3504
|
+
".desk-title-bold-s": {
|
|
3505
|
+
"@apply font-bold text-18 leading-22": ""
|
|
3506
|
+
},
|
|
3507
|
+
/* # Body */
|
|
3508
|
+
".desk-body-medium-l": {
|
|
3509
|
+
"@apply font-medium text-16 leading-22": ""
|
|
3510
|
+
},
|
|
3511
|
+
".desk-body-regular-l": {
|
|
3512
|
+
"@apply font-normal text-16 leading-22": ""
|
|
3513
|
+
},
|
|
3514
|
+
".desk-body-regular-m": {
|
|
3515
|
+
"@apply font-normal text-14 leading-20": ""
|
|
3516
|
+
},
|
|
3517
|
+
".desk-body-regular-s": {
|
|
3518
|
+
"@apply font-normal text-12 leading-16": ""
|
|
3519
|
+
}
|
|
3520
|
+
};
|
|
3521
|
+
export {
|
|
3522
|
+
Gr as Badge,
|
|
3523
|
+
Cr as Breadcrumbs,
|
|
3524
|
+
Nr as Button,
|
|
3525
|
+
Er as ButtonIcon,
|
|
3526
|
+
Zr as CustomLink,
|
|
3527
|
+
Hr as DADATA_BASE_CACHE_URL,
|
|
3528
|
+
Jr as DADATA_BASE_CONSTANTS_URL,
|
|
3529
|
+
jr as Document,
|
|
3530
|
+
Ke as Heading,
|
|
3531
|
+
Ie as Icon,
|
|
3532
|
+
it as Loader,
|
|
3533
|
+
Sr as PhoneView,
|
|
3534
|
+
Ir as ProgressBar,
|
|
3535
|
+
Xe as ResponsiveContainer,
|
|
3536
|
+
Ae as RgxCheckForHyphen,
|
|
3537
|
+
mt as RgxPatronymic,
|
|
3538
|
+
ht as RgxUnicode,
|
|
3539
|
+
Yr as SPRITES_META,
|
|
3540
|
+
wr as Section,
|
|
3541
|
+
Or as Skeleton,
|
|
3542
|
+
Tr as Table,
|
|
3543
|
+
me as VALIDATION_MESSAGES,
|
|
3544
|
+
Mr as allowedBackgroundColors,
|
|
3545
|
+
Pr as allowedBackgroundDeg,
|
|
3546
|
+
Dr as allowedBannersBackgroundColors,
|
|
3547
|
+
zr as allowedBorderRadius,
|
|
3548
|
+
Br as allowedFontSize,
|
|
3549
|
+
Lr as allowedIconsColors,
|
|
3550
|
+
Ur as allowedLineHeight,
|
|
3551
|
+
$r as allowedStrokeColors,
|
|
3552
|
+
Vr as allowedTextColors,
|
|
3553
|
+
Wr as allowedTextStyles,
|
|
3554
|
+
Ce as capitalize,
|
|
3555
|
+
b as cn,
|
|
3556
|
+
br as deepCompare,
|
|
3557
|
+
kr as formatToDate,
|
|
3558
|
+
xr as isClient,
|
|
3559
|
+
Ar as zodCalendarValidate,
|
|
3560
|
+
Rr as zodDadataFioValidate
|
|
3561
|
+
};
|
|
3562
|
+
//# sourceMappingURL=hybrid.js.map
|