@burdenoff/fe-libs 2026.1027.4 → 2026.1027.6

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.
Files changed (30) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +2 -5
  2. package/dist/chrome/ProfileSwitcher.js +106 -105
  3. package/dist/node_modules/@openuidev/devtools/dist/index.js +34 -35
  4. package/dist/node_modules/@openuidev/lang-core/dist/index.js +826 -828
  5. package/dist/node_modules/@openuidev/react-lang/dist/index.js +6 -7
  6. package/dist/shared/assistant/openui/library.js +73 -73
  7. package/package.json +1 -1
  8. package/dist/node_modules/react-dom/cjs/react-dom-client.development.js +0 -11168
  9. package/dist/node_modules/react-dom/cjs/react-dom-client.production.js +0 -7384
  10. package/dist/node_modules/react-dom/client.js +0 -19
  11. package/dist/node_modules/scheduler/cjs/scheduler.development.js +0 -203
  12. package/dist/node_modules/scheduler/cjs/scheduler.production.js +0 -203
  13. package/dist/node_modules/scheduler/index.js +0 -10
  14. package/dist/node_modules/zod/v4/classic/errors.js +0 -23
  15. package/dist/node_modules/zod/v4/classic/iso.js +0 -31
  16. package/dist/node_modules/zod/v4/classic/parse.js +0 -6
  17. package/dist/node_modules/zod/v4/classic/schemas.js +0 -339
  18. package/dist/node_modules/zod/v4/core/api.js +0 -491
  19. package/dist/node_modules/zod/v4/core/checks.js +0 -283
  20. package/dist/node_modules/zod/v4/core/core.js +0 -44
  21. package/dist/node_modules/zod/v4/core/doc.js +0 -23
  22. package/dist/node_modules/zod/v4/core/errors.js +0 -41
  23. package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -306
  24. package/dist/node_modules/zod/v4/core/parse.js +0 -68
  25. package/dist/node_modules/zod/v4/core/regexes.js +0 -25
  26. package/dist/node_modules/zod/v4/core/registries.js +0 -40
  27. package/dist/node_modules/zod/v4/core/schemas.js +0 -796
  28. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -222
  29. package/dist/node_modules/zod/v4/core/util.js +0 -266
  30. package/dist/node_modules/zod/v4/core/versions.js +0 -8
@@ -1,283 +0,0 @@
1
- import { $constructor as e } from "./core.js";
2
- import { NUMBER_FORMAT_RANGES as t, escapeRegex as n, floatSafeRemainder as r, getLengthableOrigin as i, nullish as a } from "./util.js";
3
- import { integer as o, lowercase as s, uppercase as c } from "./regexes.js";
4
- //#region node_modules/zod/v4/core/checks.js
5
- var l = /*@__PURE__*/ e("$ZodCheck", (e, t) => {
6
- var n;
7
- e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
8
- }), u = {
9
- number: "number",
10
- bigint: "bigint",
11
- object: "date"
12
- }, d = /*@__PURE__*/ e("$ZodCheckLessThan", (e, t) => {
13
- l.init(e, t);
14
- let n = u[typeof t.value];
15
- e._zod.onattach.push((e) => {
16
- let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity;
17
- t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value);
18
- }), e._zod.check = (r) => {
19
- (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
20
- origin: n,
21
- code: "too_big",
22
- maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
23
- input: r.value,
24
- inclusive: t.inclusive,
25
- inst: e,
26
- continue: !t.abort
27
- });
28
- };
29
- }), f = /*@__PURE__*/ e("$ZodCheckGreaterThan", (e, t) => {
30
- l.init(e, t);
31
- let n = u[typeof t.value];
32
- e._zod.onattach.push((e) => {
33
- let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity;
34
- t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value);
35
- }), e._zod.check = (r) => {
36
- (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
37
- origin: n,
38
- code: "too_small",
39
- minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
40
- input: r.value,
41
- inclusive: t.inclusive,
42
- inst: e,
43
- continue: !t.abort
44
- });
45
- };
46
- }), p = /*@__PURE__*/ e("$ZodCheckMultipleOf", (e, t) => {
47
- l.init(e, t), e._zod.onattach.push((e) => {
48
- var n;
49
- (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
50
- }), e._zod.check = (n) => {
51
- if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
52
- (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : r(n.value, t.value) === 0) || n.issues.push({
53
- origin: typeof n.value,
54
- code: "not_multiple_of",
55
- divisor: t.value,
56
- input: n.value,
57
- inst: e,
58
- continue: !t.abort
59
- });
60
- };
61
- }), m = /*@__PURE__*/ e("$ZodCheckNumberFormat", (e, n) => {
62
- l.init(e, n), n.format = n.format || "float64";
63
- let r = n.format?.includes("int"), i = r ? "int" : "number", [a, s] = t[n.format];
64
- e._zod.onattach.push((e) => {
65
- let t = e._zod.bag;
66
- t.format = n.format, t.minimum = a, t.maximum = s, r && (t.pattern = o);
67
- }), e._zod.check = (t) => {
68
- let o = t.value;
69
- if (r) {
70
- if (!Number.isInteger(o)) {
71
- t.issues.push({
72
- expected: i,
73
- format: n.format,
74
- code: "invalid_type",
75
- continue: !1,
76
- input: o,
77
- inst: e
78
- });
79
- return;
80
- }
81
- if (!Number.isSafeInteger(o)) {
82
- o > 0 ? t.issues.push({
83
- input: o,
84
- code: "too_big",
85
- maximum: 2 ** 53 - 1,
86
- note: "Integers must be within the safe integer range.",
87
- inst: e,
88
- origin: i,
89
- inclusive: !0,
90
- continue: !n.abort
91
- }) : t.issues.push({
92
- input: o,
93
- code: "too_small",
94
- minimum: -(2 ** 53 - 1),
95
- note: "Integers must be within the safe integer range.",
96
- inst: e,
97
- origin: i,
98
- inclusive: !0,
99
- continue: !n.abort
100
- });
101
- return;
102
- }
103
- }
104
- o < a && t.issues.push({
105
- origin: "number",
106
- input: o,
107
- code: "too_small",
108
- minimum: a,
109
- inclusive: !0,
110
- inst: e,
111
- continue: !n.abort
112
- }), o > s && t.issues.push({
113
- origin: "number",
114
- input: o,
115
- code: "too_big",
116
- maximum: s,
117
- inclusive: !0,
118
- inst: e,
119
- continue: !n.abort
120
- });
121
- };
122
- }), h = /*@__PURE__*/ e("$ZodCheckMaxLength", (e, t) => {
123
- var n;
124
- l.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
125
- let t = e.value;
126
- return !a(t) && t.length !== void 0;
127
- }), e._zod.onattach.push((e) => {
128
- let n = e._zod.bag.maximum ?? Infinity;
129
- t.maximum < n && (e._zod.bag.maximum = t.maximum);
130
- }), e._zod.check = (n) => {
131
- let r = n.value;
132
- if (r.length <= t.maximum) return;
133
- let a = i(r);
134
- n.issues.push({
135
- origin: a,
136
- code: "too_big",
137
- maximum: t.maximum,
138
- inclusive: !0,
139
- input: r,
140
- inst: e,
141
- continue: !t.abort
142
- });
143
- };
144
- }), g = /*@__PURE__*/ e("$ZodCheckMinLength", (e, t) => {
145
- var n;
146
- l.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
147
- let t = e.value;
148
- return !a(t) && t.length !== void 0;
149
- }), e._zod.onattach.push((e) => {
150
- let n = e._zod.bag.minimum ?? -Infinity;
151
- t.minimum > n && (e._zod.bag.minimum = t.minimum);
152
- }), e._zod.check = (n) => {
153
- let r = n.value;
154
- if (r.length >= t.minimum) return;
155
- let a = i(r);
156
- n.issues.push({
157
- origin: a,
158
- code: "too_small",
159
- minimum: t.minimum,
160
- inclusive: !0,
161
- input: r,
162
- inst: e,
163
- continue: !t.abort
164
- });
165
- };
166
- }), _ = /*@__PURE__*/ e("$ZodCheckLengthEquals", (e, t) => {
167
- var n;
168
- l.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
169
- let t = e.value;
170
- return !a(t) && t.length !== void 0;
171
- }), e._zod.onattach.push((e) => {
172
- let n = e._zod.bag;
173
- n.minimum = t.length, n.maximum = t.length, n.length = t.length;
174
- }), e._zod.check = (n) => {
175
- let r = n.value, a = r.length;
176
- if (a === t.length) return;
177
- let o = i(r), s = a > t.length;
178
- n.issues.push({
179
- origin: o,
180
- ...s ? {
181
- code: "too_big",
182
- maximum: t.length
183
- } : {
184
- code: "too_small",
185
- minimum: t.length
186
- },
187
- inclusive: !0,
188
- exact: !0,
189
- input: n.value,
190
- inst: e,
191
- continue: !t.abort
192
- });
193
- };
194
- }), v = /*@__PURE__*/ e("$ZodCheckStringFormat", (e, t) => {
195
- var n, r;
196
- l.init(e, t), e._zod.onattach.push((e) => {
197
- let n = e._zod.bag;
198
- n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern));
199
- }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => {
200
- t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
201
- origin: "string",
202
- code: "invalid_format",
203
- format: t.format,
204
- input: n.value,
205
- ...t.pattern ? { pattern: t.pattern.toString() } : {},
206
- inst: e,
207
- continue: !t.abort
208
- });
209
- }) : (r = e._zod).check ?? (r.check = () => {});
210
- }), y = /*@__PURE__*/ e("$ZodCheckRegex", (e, t) => {
211
- v.init(e, t), e._zod.check = (n) => {
212
- t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
213
- origin: "string",
214
- code: "invalid_format",
215
- format: "regex",
216
- input: n.value,
217
- pattern: t.pattern.toString(),
218
- inst: e,
219
- continue: !t.abort
220
- });
221
- };
222
- }), b = /*@__PURE__*/ e("$ZodCheckLowerCase", (e, t) => {
223
- t.pattern ??= s, v.init(e, t);
224
- }), x = /*@__PURE__*/ e("$ZodCheckUpperCase", (e, t) => {
225
- t.pattern ??= c, v.init(e, t);
226
- }), S = /*@__PURE__*/ e("$ZodCheckIncludes", (e, t) => {
227
- l.init(e, t);
228
- let r = n(t.includes), i = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${r}` : r);
229
- t.pattern = i, e._zod.onattach.push((e) => {
230
- let t = e._zod.bag;
231
- t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(i);
232
- }), e._zod.check = (n) => {
233
- n.value.includes(t.includes, t.position) || n.issues.push({
234
- origin: "string",
235
- code: "invalid_format",
236
- format: "includes",
237
- includes: t.includes,
238
- input: n.value,
239
- inst: e,
240
- continue: !t.abort
241
- });
242
- };
243
- }), C = /*@__PURE__*/ e("$ZodCheckStartsWith", (e, t) => {
244
- l.init(e, t);
245
- let r = RegExp(`^${n(t.prefix)}.*`);
246
- t.pattern ??= r, e._zod.onattach.push((e) => {
247
- let t = e._zod.bag;
248
- t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
249
- }), e._zod.check = (n) => {
250
- n.value.startsWith(t.prefix) || n.issues.push({
251
- origin: "string",
252
- code: "invalid_format",
253
- format: "starts_with",
254
- prefix: t.prefix,
255
- input: n.value,
256
- inst: e,
257
- continue: !t.abort
258
- });
259
- };
260
- }), w = /*@__PURE__*/ e("$ZodCheckEndsWith", (e, t) => {
261
- l.init(e, t);
262
- let r = RegExp(`.*${n(t.suffix)}$`);
263
- t.pattern ??= r, e._zod.onattach.push((e) => {
264
- let t = e._zod.bag;
265
- t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
266
- }), e._zod.check = (n) => {
267
- n.value.endsWith(t.suffix) || n.issues.push({
268
- origin: "string",
269
- code: "invalid_format",
270
- format: "ends_with",
271
- suffix: t.suffix,
272
- input: n.value,
273
- inst: e,
274
- continue: !t.abort
275
- });
276
- };
277
- }), T = /*@__PURE__*/ e("$ZodCheckOverwrite", (e, t) => {
278
- l.init(e, t), e._zod.check = (e) => {
279
- e.value = t.tx(e.value);
280
- };
281
- });
282
- //#endregion
283
- export { l as $ZodCheck, w as $ZodCheckEndsWith, f as $ZodCheckGreaterThan, S as $ZodCheckIncludes, _ as $ZodCheckLengthEquals, d as $ZodCheckLessThan, b as $ZodCheckLowerCase, h as $ZodCheckMaxLength, g as $ZodCheckMinLength, p as $ZodCheckMultipleOf, m as $ZodCheckNumberFormat, T as $ZodCheckOverwrite, y as $ZodCheckRegex, C as $ZodCheckStartsWith, v as $ZodCheckStringFormat, x as $ZodCheckUpperCase };
@@ -1,44 +0,0 @@
1
- Object.freeze({ status: "aborted" });
2
- function e(e, t, n) {
3
- function r(n, r) {
4
- if (n._zod || Object.defineProperty(n, "_zod", {
5
- value: {
6
- def: r,
7
- constr: o,
8
- traits: /* @__PURE__ */ new Set()
9
- },
10
- enumerable: !1
11
- }), n._zod.traits.has(e)) return;
12
- n._zod.traits.add(e), t(n, r);
13
- let i = o.prototype, a = Object.keys(i);
14
- for (let e = 0; e < a.length; e++) {
15
- let t = a[e];
16
- t in n || (n[t] = i[t].bind(n));
17
- }
18
- }
19
- let i = n?.Parent ?? Object;
20
- class a extends i {}
21
- Object.defineProperty(a, "name", { value: e });
22
- function o(e) {
23
- var t;
24
- let i = n?.Parent ? new a() : this;
25
- r(i, e), (t = i._zod).deferred ?? (t.deferred = []);
26
- for (let e of i._zod.deferred) e();
27
- return i;
28
- }
29
- return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o;
30
- }
31
- var t = class extends Error {
32
- constructor() {
33
- super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
34
- }
35
- }, n = class extends Error {
36
- constructor(e) {
37
- super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
38
- }
39
- }, r = {};
40
- function i(e) {
41
- return e && Object.assign(r, e), r;
42
- }
43
- //#endregion
44
- export { t as $ZodAsyncError, n as $ZodEncodeError, e as $constructor, i as config, r as globalConfig };
@@ -1,23 +0,0 @@
1
- //#region node_modules/zod/v4/core/doc.js
2
- var e = class {
3
- constructor(e = []) {
4
- this.content = [], this.indent = 0, this && (this.args = e);
5
- }
6
- indented(e) {
7
- this.indent += 1, e(this), --this.indent;
8
- }
9
- write(e) {
10
- if (typeof e == "function") {
11
- e(this, { execution: "sync" }), e(this, { execution: "async" });
12
- return;
13
- }
14
- let t = e.split("\n").filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => " ".repeat(this.indent * 2) + e);
15
- for (let e of r) this.content.push(e);
16
- }
17
- compile() {
18
- let e = Function, t = this?.args, n = [...(this?.content ?? [""]).map((e) => ` ${e}`)];
19
- return new e(...t, n.join("\n"));
20
- }
21
- };
22
- //#endregion
23
- export { e as Doc };
@@ -1,41 +0,0 @@
1
- import { $constructor as e } from "./core.js";
2
- import { jsonStringifyReplacer as t } from "./util.js";
3
- //#region node_modules/zod/v4/core/errors.js
4
- var n = (e, n) => {
5
- e.name = "$ZodError", Object.defineProperty(e, "_zod", {
6
- value: e._zod,
7
- enumerable: !1
8
- }), Object.defineProperty(e, "issues", {
9
- value: n,
10
- enumerable: !1
11
- }), e.message = JSON.stringify(n, t, 2), Object.defineProperty(e, "toString", {
12
- value: () => e.message,
13
- enumerable: !1
14
- });
15
- }, r = e("$ZodError", n), i = e("$ZodError", n, { Parent: Error });
16
- function a(e, t = (e) => e.message) {
17
- let n = {}, r = [];
18
- for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i));
19
- return {
20
- formErrors: r,
21
- fieldErrors: n
22
- };
23
- }
24
- function o(e, t = (e) => e.message) {
25
- let n = { _errors: [] }, r = (e) => {
26
- for (let i of e.issues) if (i.code === "invalid_union" && i.errors.length) i.errors.map((e) => r({ issues: e }));
27
- else if (i.code === "invalid_key") r({ issues: i.issues });
28
- else if (i.code === "invalid_element") r({ issues: i.issues });
29
- else if (i.path.length === 0) n._errors.push(t(i));
30
- else {
31
- let e = n, r = 0;
32
- for (; r < i.path.length;) {
33
- let n = i.path[r];
34
- r === i.path.length - 1 ? (e[n] = e[n] || { _errors: [] }, e[n]._errors.push(t(i))) : e[n] = e[n] || { _errors: [] }, e = e[n], r++;
35
- }
36
- }
37
- };
38
- return r(e), n;
39
- }
40
- //#endregion
41
- export { r as $ZodError, i as $ZodRealError, a as flattenError, o as formatError };
@@ -1,306 +0,0 @@
1
- import { getEnumValues as e } from "./util.js";
2
- import { extractDefs as t, finalize as n, initializeContext as r, process as i } from "./to-json-schema.js";
3
- //#region node_modules/zod/v4/core/json-schema-processors.js
4
- var a = {
5
- guid: "uuid",
6
- url: "uri",
7
- datetime: "date-time",
8
- json_string: "json-string",
9
- regex: ""
10
- }, o = (e, t, n, r) => {
11
- let i = n;
12
- i.type = "string";
13
- let { minimum: o, maximum: s, format: c, patterns: l, contentEncoding: u } = e._zod.bag;
14
- if (typeof o == "number" && (i.minLength = o), typeof s == "number" && (i.maxLength = s), c && (i.format = a[c] ?? c, i.format === "" && delete i.format, c === "time" && delete i.format), u && (i.contentEncoding = u), l && l.size > 0) {
15
- let e = [...l];
16
- e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({
17
- ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
18
- pattern: e.source
19
- }))]);
20
- }
21
- }, s = (e, t, n, r) => {
22
- let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
23
- typeof s == "string" && s.includes("int") ? i.type = "integer" : i.type = "number", typeof u == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u), typeof a == "number" && (i.minimum = a, typeof u == "number" && t.target !== "draft-04" && (u >= a ? delete i.minimum : delete i.exclusiveMinimum)), typeof l == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l), typeof o == "number" && (i.maximum = o, typeof l == "number" && t.target !== "draft-04" && (l <= o ? delete i.maximum : delete i.exclusiveMaximum)), typeof c == "number" && (i.multipleOf = c);
24
- }, c = (e, t, n, r) => {
25
- n.type = "boolean";
26
- }, l = (e, t, n, r) => {
27
- if (t.unrepresentable === "throw") throw Error("BigInt cannot be represented in JSON Schema");
28
- }, u = (e, t, n, r) => {
29
- if (t.unrepresentable === "throw") throw Error("Symbols cannot be represented in JSON Schema");
30
- }, d = (e, t, n, r) => {
31
- t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
32
- }, f = (e, t, n, r) => {
33
- if (t.unrepresentable === "throw") throw Error("Undefined cannot be represented in JSON Schema");
34
- }, p = (e, t, n, r) => {
35
- if (t.unrepresentable === "throw") throw Error("Void cannot be represented in JSON Schema");
36
- }, m = (e, t, n, r) => {
37
- n.not = {};
38
- }, h = (e, t, n, r) => {}, g = (e, t, n, r) => {}, _ = (e, t, n, r) => {
39
- if (t.unrepresentable === "throw") throw Error("Date cannot be represented in JSON Schema");
40
- }, v = (t, n, r, i) => {
41
- let a = t._zod.def, o = e(a.entries);
42
- o.every((e) => typeof e == "number") && (r.type = "number"), o.every((e) => typeof e == "string") && (r.type = "string"), r.enum = o;
43
- }, y = (e, t, n, r) => {
44
- let i = e._zod.def, a = [];
45
- for (let e of i.values) if (e === void 0) {
46
- if (t.unrepresentable === "throw") throw Error("Literal `undefined` cannot be represented in JSON Schema");
47
- } else if (typeof e == "bigint") {
48
- if (t.unrepresentable === "throw") throw Error("BigInt literals cannot be represented in JSON Schema");
49
- a.push(Number(e));
50
- } else a.push(e);
51
- if (a.length !== 0) if (a.length === 1) {
52
- let e = a[0];
53
- n.type = e === null ? "null" : typeof e, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [e] : n.const = e;
54
- } else a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), a.every((e) => typeof e == "boolean") && (n.type = "boolean"), a.every((e) => e === null) && (n.type = "null"), n.enum = a;
55
- }, b = (e, t, n, r) => {
56
- if (t.unrepresentable === "throw") throw Error("NaN cannot be represented in JSON Schema");
57
- }, x = (e, t, n, r) => {
58
- let i = n, a = e._zod.pattern;
59
- if (!a) throw Error("Pattern not found in template literal");
60
- i.type = "string", i.pattern = a.source;
61
- }, S = (e, t, n, r) => {
62
- let i = n, a = {
63
- type: "string",
64
- format: "binary",
65
- contentEncoding: "binary"
66
- }, { minimum: o, maximum: s, mime: c } = e._zod.bag;
67
- o !== void 0 && (a.minLength = o), s !== void 0 && (a.maxLength = s), c ? c.length === 1 ? (a.contentMediaType = c[0], Object.assign(i, a)) : (Object.assign(i, a), i.anyOf = c.map((e) => ({ contentMediaType: e }))) : Object.assign(i, a);
68
- }, C = (e, t, n, r) => {
69
- n.type = "boolean";
70
- }, w = (e, t, n, r) => {
71
- if (t.unrepresentable === "throw") throw Error("Custom types cannot be represented in JSON Schema");
72
- }, T = (e, t, n, r) => {
73
- if (t.unrepresentable === "throw") throw Error("Function types cannot be represented in JSON Schema");
74
- }, E = (e, t, n, r) => {
75
- if (t.unrepresentable === "throw") throw Error("Transforms cannot be represented in JSON Schema");
76
- }, D = (e, t, n, r) => {
77
- if (t.unrepresentable === "throw") throw Error("Map cannot be represented in JSON Schema");
78
- }, O = (e, t, n, r) => {
79
- if (t.unrepresentable === "throw") throw Error("Set cannot be represented in JSON Schema");
80
- }, k = (e, t, n, r) => {
81
- let a = n, o = e._zod.def, { minimum: s, maximum: c } = e._zod.bag;
82
- typeof s == "number" && (a.minItems = s), typeof c == "number" && (a.maxItems = c), a.type = "array", a.items = i(o.element, t, {
83
- ...r,
84
- path: [...r.path, "items"]
85
- });
86
- }, A = (e, t, n, r) => {
87
- let a = n, o = e._zod.def;
88
- a.type = "object", a.properties = {};
89
- let s = o.shape;
90
- for (let e in s) a.properties[e] = i(s[e], t, {
91
- ...r,
92
- path: [
93
- ...r.path,
94
- "properties",
95
- e
96
- ]
97
- });
98
- let c = new Set(Object.keys(s)), l = new Set([...c].filter((e) => {
99
- let n = o.shape[e]._zod;
100
- return t.io === "input" ? n.optin === void 0 : n.optout === void 0;
101
- }));
102
- l.size > 0 && (a.required = Array.from(l)), o.catchall?._zod.def.type === "never" ? a.additionalProperties = !1 : o.catchall ? o.catchall && (a.additionalProperties = i(o.catchall, t, {
103
- ...r,
104
- path: [...r.path, "additionalProperties"]
105
- })) : t.io === "output" && (a.additionalProperties = !1);
106
- }, j = (e, t, n, r) => {
107
- let a = e._zod.def, o = a.inclusive === !1, s = a.options.map((e, n) => i(e, t, {
108
- ...r,
109
- path: [
110
- ...r.path,
111
- o ? "oneOf" : "anyOf",
112
- n
113
- ]
114
- }));
115
- o ? n.oneOf = s : n.anyOf = s;
116
- }, M = (e, t, n, r) => {
117
- let a = e._zod.def, o = i(a.left, t, {
118
- ...r,
119
- path: [
120
- ...r.path,
121
- "allOf",
122
- 0
123
- ]
124
- }), s = i(a.right, t, {
125
- ...r,
126
- path: [
127
- ...r.path,
128
- "allOf",
129
- 1
130
- ]
131
- }), c = (e) => "allOf" in e && Object.keys(e).length === 1;
132
- n.allOf = [...c(o) ? o.allOf : [o], ...c(s) ? s.allOf : [s]];
133
- }, N = (e, t, n, r) => {
134
- let a = n, o = e._zod.def;
135
- a.type = "array";
136
- let s = t.target === "draft-2020-12" ? "prefixItems" : "items", c = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", l = o.items.map((e, n) => i(e, t, {
137
- ...r,
138
- path: [
139
- ...r.path,
140
- s,
141
- n
142
- ]
143
- })), u = o.rest ? i(o.rest, t, {
144
- ...r,
145
- path: [
146
- ...r.path,
147
- c,
148
- ...t.target === "openapi-3.0" ? [o.items.length] : []
149
- ]
150
- }) : null;
151
- t.target === "draft-2020-12" ? (a.prefixItems = l, u && (a.items = u)) : t.target === "openapi-3.0" ? (a.items = { anyOf: l }, u && a.items.anyOf.push(u), a.minItems = l.length, u || (a.maxItems = l.length)) : (a.items = l, u && (a.additionalItems = u));
152
- let { minimum: d, maximum: f } = e._zod.bag;
153
- typeof d == "number" && (a.minItems = d), typeof f == "number" && (a.maxItems = f);
154
- }, P = (e, t, n, r) => {
155
- let a = n, o = e._zod.def;
156
- a.type = "object";
157
- let s = o.keyType, c = s._zod.bag?.patterns;
158
- if (o.mode === "loose" && c && c.size > 0) {
159
- let e = i(o.valueType, t, {
160
- ...r,
161
- path: [
162
- ...r.path,
163
- "patternProperties",
164
- "*"
165
- ]
166
- });
167
- a.patternProperties = {};
168
- for (let t of c) a.patternProperties[t.source] = e;
169
- } else (t.target === "draft-07" || t.target === "draft-2020-12") && (a.propertyNames = i(o.keyType, t, {
170
- ...r,
171
- path: [...r.path, "propertyNames"]
172
- })), a.additionalProperties = i(o.valueType, t, {
173
- ...r,
174
- path: [...r.path, "additionalProperties"]
175
- });
176
- let l = s._zod.values;
177
- if (l) {
178
- let e = [...l].filter((e) => typeof e == "string" || typeof e == "number");
179
- e.length > 0 && (a.required = e);
180
- }
181
- }, F = (e, t, n, r) => {
182
- let a = e._zod.def, o = i(a.innerType, t, r), s = t.seen.get(e);
183
- t.target === "openapi-3.0" ? (s.ref = a.innerType, n.nullable = !0) : n.anyOf = [o, { type: "null" }];
184
- }, I = (e, t, n, r) => {
185
- let a = e._zod.def;
186
- i(a.innerType, t, r);
187
- let o = t.seen.get(e);
188
- o.ref = a.innerType;
189
- }, L = (e, t, n, r) => {
190
- let a = e._zod.def;
191
- i(a.innerType, t, r);
192
- let o = t.seen.get(e);
193
- o.ref = a.innerType, n.default = JSON.parse(JSON.stringify(a.defaultValue));
194
- }, R = (e, t, n, r) => {
195
- let a = e._zod.def;
196
- i(a.innerType, t, r);
197
- let o = t.seen.get(e);
198
- o.ref = a.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(a.defaultValue)));
199
- }, z = (e, t, n, r) => {
200
- let a = e._zod.def;
201
- i(a.innerType, t, r);
202
- let o = t.seen.get(e);
203
- o.ref = a.innerType;
204
- let s;
205
- try {
206
- s = a.catchValue(void 0);
207
- } catch {
208
- throw Error("Dynamic catch values are not supported in JSON Schema");
209
- }
210
- n.default = s;
211
- }, B = (e, t, n, r) => {
212
- let a = e._zod.def, o = t.io === "input" ? a.in._zod.def.type === "transform" ? a.out : a.in : a.out;
213
- i(o, t, r);
214
- let s = t.seen.get(e);
215
- s.ref = o;
216
- }, V = (e, t, n, r) => {
217
- let a = e._zod.def;
218
- i(a.innerType, t, r);
219
- let o = t.seen.get(e);
220
- o.ref = a.innerType, n.readOnly = !0;
221
- }, H = (e, t, n, r) => {
222
- let a = e._zod.def;
223
- i(a.innerType, t, r);
224
- let o = t.seen.get(e);
225
- o.ref = a.innerType;
226
- }, U = (e, t, n, r) => {
227
- let a = e._zod.def;
228
- i(a.innerType, t, r);
229
- let o = t.seen.get(e);
230
- o.ref = a.innerType;
231
- }, W = {
232
- string: o,
233
- number: s,
234
- boolean: c,
235
- bigint: l,
236
- symbol: u,
237
- null: d,
238
- undefined: f,
239
- void: p,
240
- never: m,
241
- any: h,
242
- unknown: g,
243
- date: _,
244
- enum: v,
245
- literal: y,
246
- nan: b,
247
- template_literal: x,
248
- file: S,
249
- success: C,
250
- custom: w,
251
- function: T,
252
- transform: E,
253
- map: D,
254
- set: O,
255
- array: k,
256
- object: A,
257
- union: j,
258
- intersection: M,
259
- tuple: N,
260
- record: P,
261
- nullable: F,
262
- nonoptional: I,
263
- default: L,
264
- prefault: R,
265
- catch: z,
266
- pipe: B,
267
- readonly: V,
268
- promise: H,
269
- optional: U,
270
- lazy: (e, t, n, r) => {
271
- let a = e._zod.innerType;
272
- i(a, t, r);
273
- let o = t.seen.get(e);
274
- o.ref = a;
275
- }
276
- };
277
- function G(e, a) {
278
- if ("_idmap" in e) {
279
- let o = e, s = r({
280
- ...a,
281
- processors: W
282
- }), c = {};
283
- for (let e of o._idmap.entries()) {
284
- let [t, n] = e;
285
- i(n, s);
286
- }
287
- let l = {};
288
- s.external = {
289
- registry: o,
290
- uri: a?.uri,
291
- defs: c
292
- };
293
- for (let e of o._idmap.entries()) {
294
- let [r, i] = e;
295
- t(s, i), l[r] = n(s, i);
296
- }
297
- return Object.keys(c).length > 0 && (l.__shared = { [s.target === "draft-2020-12" ? "$defs" : "definitions"]: c }), { schemas: l };
298
- }
299
- let o = r({
300
- ...a,
301
- processors: W
302
- });
303
- return i(e, o), t(o, e), n(o, e);
304
- }
305
- //#endregion
306
- export { h as anyProcessor, k as arrayProcessor, z as catchProcessor, w as customProcessor, L as defaultProcessor, v as enumProcessor, M as intersectionProcessor, y as literalProcessor, m as neverProcessor, I as nonoptionalProcessor, F as nullableProcessor, s as numberProcessor, A as objectProcessor, U as optionalProcessor, B as pipeProcessor, R as prefaultProcessor, V as readonlyProcessor, P as recordProcessor, o as stringProcessor, G as toJSONSchema, E as transformProcessor, j as unionProcessor, g as unknownProcessor };