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