pi2dsh 0.2.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/LICENSE +21 -0
- package/README.md +122 -0
- package/README.zh.md +122 -0
- package/dist/cli.d.mts +2 -0
- package/dist/cli.mjs +128 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/compat/pi-ai.d.mts +2597 -0
- package/dist/compat/pi-ai.d.mts.map +1 -0
- package/dist/compat/pi-ai.mjs +4669 -0
- package/dist/compat/pi-ai.mjs.map +1 -0
- package/dist/compat/pi-coding-agent.d.mts +745 -0
- package/dist/compat/pi-coding-agent.d.mts.map +1 -0
- package/dist/compat/pi-coding-agent.mjs +4 -0
- package/dist/compat/pi-tui.d.mts +3 -0
- package/dist/compat/pi-tui.mjs +3622 -0
- package/dist/compat/pi-tui.mjs.map +1 -0
- package/dist/host.d.mts +35 -0
- package/dist/host.d.mts.map +1 -0
- package/dist/host.mjs +197 -0
- package/dist/host.mjs.map +1 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/mcp-config-jL9w70It.mjs +1535 -0
- package/dist/mcp-config-jL9w70It.mjs.map +1 -0
- package/dist/pi-coding-agent-Dsg6_0ua.mjs +2060 -0
- package/dist/pi-coding-agent-Dsg6_0ua.mjs.map +1 -0
- package/dist/pi-config-shim-CZ1wFzqM.mjs +27 -0
- package/dist/pi-config-shim-CZ1wFzqM.mjs.map +1 -0
- package/dist/pi-tui-iHoF2tFc.d.mts +1043 -0
- package/dist/pi-tui-iHoF2tFc.d.mts.map +1 -0
- package/dist/pi-tui-utils-CcaVtm-3.mjs +895 -0
- package/dist/pi-tui-utils-CcaVtm-3.mjs.map +1 -0
- package/dist/pi-types-KazmR2O5.d.mts +62 -0
- package/dist/pi-types-KazmR2O5.d.mts.map +1 -0
- package/dist/pi-uuid-Db8ShZsK.mjs +47 -0
- package/dist/pi-uuid-Db8ShZsK.mjs.map +1 -0
- package/dist/rolldown-runtime-C2Q2p085.mjs +15 -0
- package/dist/runtime-D84Hv_3m.mjs +1499 -0
- package/dist/runtime-D84Hv_3m.mjs.map +1 -0
- package/dist/runtime.d.mts +31 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +3 -0
- package/dist/source-D7Ir-rPT.mjs +154 -0
- package/dist/source-D7Ir-rPT.mjs.map +1 -0
- package/dist/types-7IWJPPvS.d.mts +59 -0
- package/dist/types-7IWJPPvS.d.mts.map +1 -0
- package/package.json +135 -0
|
@@ -0,0 +1,4669 @@
|
|
|
1
|
+
|
|
2
|
+
import { t as __exportAll } from "../rolldown-runtime-C2Q2p085.mjs";
|
|
3
|
+
import { t as uuidv7 } from "../pi-uuid-Db8ShZsK.mjs";
|
|
4
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/metrics.mjs
|
|
5
|
+
/** TypeBox instantiation metrics */
|
|
6
|
+
const Metrics = {
|
|
7
|
+
assign: 0,
|
|
8
|
+
create: 0,
|
|
9
|
+
clone: 0,
|
|
10
|
+
discard: 0,
|
|
11
|
+
update: 0
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/assign.mjs
|
|
15
|
+
/**
|
|
16
|
+
* Performs an Object assign using the Left and Right object types. We track this operation as it
|
|
17
|
+
* creates a new GC handle per assignment.
|
|
18
|
+
*/
|
|
19
|
+
function Assign(left, right) {
|
|
20
|
+
Metrics.assign += 1;
|
|
21
|
+
return {
|
|
22
|
+
...left,
|
|
23
|
+
...right
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/guard/guard.mjs
|
|
28
|
+
/** Returns true if this value is an array */
|
|
29
|
+
function IsArray$1(value) {
|
|
30
|
+
return Array.isArray(value);
|
|
31
|
+
}
|
|
32
|
+
/** Returns true if this value is bigint */
|
|
33
|
+
function IsBigInt$1(value) {
|
|
34
|
+
return IsEqual(typeof value, "bigint");
|
|
35
|
+
}
|
|
36
|
+
/** Returns true if this value is a boolean */
|
|
37
|
+
function IsBoolean$1(value) {
|
|
38
|
+
return IsEqual(typeof value, "boolean");
|
|
39
|
+
}
|
|
40
|
+
/** Returns true if this value is a function */
|
|
41
|
+
function IsFunction$1(value) {
|
|
42
|
+
return IsEqual(typeof value, "function");
|
|
43
|
+
}
|
|
44
|
+
/** Returns true if this value is null */
|
|
45
|
+
function IsNull$1(value) {
|
|
46
|
+
return IsEqual(value, null);
|
|
47
|
+
}
|
|
48
|
+
/** Returns true if this value is number */
|
|
49
|
+
function IsNumber$1(value) {
|
|
50
|
+
return Number.isFinite(value);
|
|
51
|
+
}
|
|
52
|
+
/** Returns true if this value is an object but not an array */
|
|
53
|
+
function IsObjectNotArray(value) {
|
|
54
|
+
return IsObject$1(value) && !IsArray$1(value);
|
|
55
|
+
}
|
|
56
|
+
/** Returns true if this value is an object */
|
|
57
|
+
function IsObject$1(value) {
|
|
58
|
+
return IsEqual(typeof value, "object") && !IsNull$1(value);
|
|
59
|
+
}
|
|
60
|
+
/** Returns true if this value is string */
|
|
61
|
+
function IsString$1(value) {
|
|
62
|
+
return IsEqual(typeof value, "string");
|
|
63
|
+
}
|
|
64
|
+
function IsEqual(left, right) {
|
|
65
|
+
return left === right;
|
|
66
|
+
}
|
|
67
|
+
function IsGreaterThan(left, right) {
|
|
68
|
+
return left > right;
|
|
69
|
+
}
|
|
70
|
+
function IsLessThan(left, right) {
|
|
71
|
+
return left < right;
|
|
72
|
+
}
|
|
73
|
+
/** Returns true if the value appears to be an instance of a class. */
|
|
74
|
+
function IsClassInstance(value) {
|
|
75
|
+
if (!IsObject$1(value)) return false;
|
|
76
|
+
const proto = globalThis.Object.getPrototypeOf(value);
|
|
77
|
+
if (IsNull$1(proto)) return false;
|
|
78
|
+
return IsEqual(typeof proto.constructor, "function") && !(IsEqual(proto.constructor, globalThis.Object) || IsEqual(proto.constructor.name, "Object"));
|
|
79
|
+
}
|
|
80
|
+
/** Returns true if every element from offset satisfies the callback, short-circuiting on the first failure */
|
|
81
|
+
function Every(value, offset, callback) {
|
|
82
|
+
for (let index = offset; index < value.length; index++) if (!callback(value[index], index)) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
/** Shifts the left-most element from an array and dispatches to the true arm, or the false arm if empty */
|
|
86
|
+
function ShiftLeft(array, true_, false_) {
|
|
87
|
+
return IsEqual(array.length, 0) ? false_() : true_(array[0], array.slice(1));
|
|
88
|
+
}
|
|
89
|
+
/** Returns true if the PropertyKey is Unsafe (ref: prototype-pollution). */
|
|
90
|
+
function IsUnsafePropertyKey(key) {
|
|
91
|
+
return IsEqual(key, "__proto__") || IsEqual(key, "constructor") || IsEqual(key, "prototype");
|
|
92
|
+
}
|
|
93
|
+
/** Returns true if this value has this property key */
|
|
94
|
+
function HasPropertyKey(value, key) {
|
|
95
|
+
return IsUnsafePropertyKey(key) ? Object.prototype.hasOwnProperty.call(value, key) : key in value;
|
|
96
|
+
}
|
|
97
|
+
/** Returns property keys for this object via `Object.getOwnPropertyNames({ ... })` */
|
|
98
|
+
function Keys(value) {
|
|
99
|
+
return Object.getOwnPropertyNames(value);
|
|
100
|
+
}
|
|
101
|
+
/** Returns the property keys for this object via `Object.getOwnPropertySymbols({ ... })` */
|
|
102
|
+
function Symbols(value) {
|
|
103
|
+
return Object.getOwnPropertySymbols(value);
|
|
104
|
+
}
|
|
105
|
+
/** Returns the property values for the given object via `Object.values()` */
|
|
106
|
+
function Values(value) {
|
|
107
|
+
return Object.values(value);
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/guard/globals.mjs
|
|
111
|
+
function IsTypeArray(value) {
|
|
112
|
+
return globalThis.ArrayBuffer.isView(value);
|
|
113
|
+
}
|
|
114
|
+
/** Returns true if the value is a RegExp */
|
|
115
|
+
function IsRegExp(value) {
|
|
116
|
+
return value instanceof globalThis.RegExp;
|
|
117
|
+
}
|
|
118
|
+
/** Returns true if the value is a Set */
|
|
119
|
+
function IsSet(value) {
|
|
120
|
+
return value instanceof globalThis.Set;
|
|
121
|
+
}
|
|
122
|
+
/** Returns true if the value is a Map */
|
|
123
|
+
function IsMap(value) {
|
|
124
|
+
return value instanceof globalThis.Map;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/clone.mjs
|
|
128
|
+
function FromClassInstance(value) {
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
131
|
+
function IsSchemaObject(value) {
|
|
132
|
+
return HasPropertyKey(value, "~kind") || HasPropertyKey(value, "~unsafe");
|
|
133
|
+
}
|
|
134
|
+
function FromSchemaObject(value) {
|
|
135
|
+
const result = {};
|
|
136
|
+
for (const key of Keys(value)) {
|
|
137
|
+
if (IsUnsafePropertyKey(key)) continue;
|
|
138
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
139
|
+
descriptor.value = FromValue(descriptor.value);
|
|
140
|
+
if (IsEqual(descriptor.enumerable, true)) result[key] = descriptor.value;
|
|
141
|
+
else Object.defineProperty(result, key, descriptor);
|
|
142
|
+
}
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
function FromPlainObject(value) {
|
|
146
|
+
const result = {};
|
|
147
|
+
for (const key of Keys(value)) {
|
|
148
|
+
if (IsUnsafePropertyKey(key)) continue;
|
|
149
|
+
result[key] = FromValue(value[key]);
|
|
150
|
+
}
|
|
151
|
+
for (const key of Symbols(value)) result[key] = FromValue(value[key]);
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
function FromObject$7(value) {
|
|
155
|
+
return IsClassInstance(value) ? FromClassInstance(value) : IsSchemaObject(value) ? FromSchemaObject(value) : FromPlainObject(value);
|
|
156
|
+
}
|
|
157
|
+
function FromArray$3(value) {
|
|
158
|
+
return value.map((element) => FromValue(element));
|
|
159
|
+
}
|
|
160
|
+
function FromTypedArray(value) {
|
|
161
|
+
return value.slice();
|
|
162
|
+
}
|
|
163
|
+
function FromRegExp(value) {
|
|
164
|
+
return new RegExp(value.source, value.flags);
|
|
165
|
+
}
|
|
166
|
+
function FromMap(value) {
|
|
167
|
+
return new Map(FromValue([...value.entries()]));
|
|
168
|
+
}
|
|
169
|
+
function FromSet(value) {
|
|
170
|
+
return new Set(FromValue([...value.values()]));
|
|
171
|
+
}
|
|
172
|
+
function FromValue(value) {
|
|
173
|
+
return IsTypeArray(value) ? FromTypedArray(value) : IsRegExp(value) ? FromRegExp(value) : IsMap(value) ? FromMap(value) : IsSet(value) ? FromSet(value) : IsArray$1(value) ? FromArray$3(value) : IsObject$1(value) ? FromObject$7(value) : value;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Returns a Clone of the given value. This function is similar to structuredClone()
|
|
177
|
+
* but also supports deep cloning instances of Map, Set and TypeArray.
|
|
178
|
+
*/
|
|
179
|
+
function Clone(value) {
|
|
180
|
+
Metrics.clone += 1;
|
|
181
|
+
return FromValue(value);
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/settings/settings.mjs
|
|
185
|
+
const settings = {
|
|
186
|
+
immutableTypes: false,
|
|
187
|
+
maxErrors: 8,
|
|
188
|
+
maxInstantiationCount: 128,
|
|
189
|
+
useAcceleration: true,
|
|
190
|
+
exactOptionalPropertyTypes: false,
|
|
191
|
+
enumerableKind: false,
|
|
192
|
+
correctiveParse: false,
|
|
193
|
+
unionPrioritySort: true
|
|
194
|
+
};
|
|
195
|
+
/** Gets current system settings */
|
|
196
|
+
function Get() {
|
|
197
|
+
return settings;
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/create.mjs
|
|
201
|
+
function MergeHidden(left, right) {
|
|
202
|
+
for (const key of Object.keys(right)) Object.defineProperty(left, key, {
|
|
203
|
+
configurable: true,
|
|
204
|
+
writable: true,
|
|
205
|
+
enumerable: false,
|
|
206
|
+
value: right[key]
|
|
207
|
+
});
|
|
208
|
+
return left;
|
|
209
|
+
}
|
|
210
|
+
function Merge(left, right) {
|
|
211
|
+
return {
|
|
212
|
+
...left,
|
|
213
|
+
...right
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Creates an object with hidden, enumerable, and optional property sets. This function
|
|
218
|
+
* ensures types are instantiated according to configuration rules for enumerable and
|
|
219
|
+
* non-enumerable properties.
|
|
220
|
+
*/
|
|
221
|
+
function Create(hidden, enumerable, options = {}) {
|
|
222
|
+
Metrics.create += 1;
|
|
223
|
+
const settings = Get();
|
|
224
|
+
const withOptions = Merge(enumerable, options);
|
|
225
|
+
const withHidden = settings.enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden);
|
|
226
|
+
return settings.immutableTypes ? Object.freeze(withHidden) : withHidden;
|
|
227
|
+
}
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/discard.mjs
|
|
230
|
+
/** Discards multiple property keys from the given object value */
|
|
231
|
+
function Discard(value, propertyKeys) {
|
|
232
|
+
Metrics.discard += 1;
|
|
233
|
+
const result = {};
|
|
234
|
+
for (const key of Keys(value)) {
|
|
235
|
+
if (propertyKeys.includes(key)) continue;
|
|
236
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
237
|
+
descriptor.value = Clone(descriptor.value);
|
|
238
|
+
Object.defineProperty(result, key, descriptor);
|
|
239
|
+
}
|
|
240
|
+
return result;
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/memory/update.mjs
|
|
244
|
+
/**
|
|
245
|
+
* Updates a value with new properties while preserving property enumerability. Use this function to modify
|
|
246
|
+
* existing types without altering their configuration.
|
|
247
|
+
*/
|
|
248
|
+
function Update(current, hidden, enumerable) {
|
|
249
|
+
Metrics.update += 1;
|
|
250
|
+
const settings = Get();
|
|
251
|
+
const result = Clone(current);
|
|
252
|
+
for (const key of Object.keys(hidden)) Object.defineProperty(result, key, {
|
|
253
|
+
configurable: true,
|
|
254
|
+
writable: true,
|
|
255
|
+
enumerable: settings.enumerableKind,
|
|
256
|
+
value: hidden[key]
|
|
257
|
+
});
|
|
258
|
+
for (const key of Object.keys(enumerable)) Object.defineProperty(result, key, {
|
|
259
|
+
configurable: true,
|
|
260
|
+
enumerable: true,
|
|
261
|
+
writable: true,
|
|
262
|
+
value: enumerable[key]
|
|
263
|
+
});
|
|
264
|
+
return result;
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/schema.mjs
|
|
268
|
+
function IsKind(value, kind) {
|
|
269
|
+
return IsObject$1(value) && HasPropertyKey(value, "~kind") && IsEqual(value["~kind"], kind);
|
|
270
|
+
}
|
|
271
|
+
function IsSchema(value) {
|
|
272
|
+
return IsObject$1(value);
|
|
273
|
+
}
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/deferred.mjs
|
|
276
|
+
/** Creates a Deferred action. */
|
|
277
|
+
function Deferred(action, parameters, options) {
|
|
278
|
+
return Create({ "~kind": "Deferred" }, {
|
|
279
|
+
type: "deferred",
|
|
280
|
+
action,
|
|
281
|
+
parameters,
|
|
282
|
+
options
|
|
283
|
+
}, {});
|
|
284
|
+
}
|
|
285
|
+
/** Returns true if the given value is a TDeferred. */
|
|
286
|
+
function IsDeferred(value) {
|
|
287
|
+
return IsKind(value, "Deferred");
|
|
288
|
+
}
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs
|
|
291
|
+
function AddReadonlyOperation(type) {
|
|
292
|
+
return Update(type, { "~readonly": true }, {});
|
|
293
|
+
}
|
|
294
|
+
function AddReadonlyAction(type, options) {
|
|
295
|
+
return Update(AddReadonlyOperation(type), {}, options);
|
|
296
|
+
}
|
|
297
|
+
function AddReadonlyInstantiate(context, state, type, options) {
|
|
298
|
+
return AddReadonlyAction(InstantiateType(context, state, type), options);
|
|
299
|
+
}
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs
|
|
302
|
+
function AddOptionalOperation(type) {
|
|
303
|
+
return Update(type, { "~optional": true }, {});
|
|
304
|
+
}
|
|
305
|
+
function AddOptionalAction(type, options) {
|
|
306
|
+
return Update(AddOptionalOperation(type), {}, options);
|
|
307
|
+
}
|
|
308
|
+
function AddOptionalInstantiate(context, state, type, options) {
|
|
309
|
+
return AddOptionalAction(InstantiateType(context, state, type), options);
|
|
310
|
+
}
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/array.mjs
|
|
313
|
+
/** Creates an Array type. */
|
|
314
|
+
function _Array_(items, options) {
|
|
315
|
+
return Create({ "~kind": "Array" }, {
|
|
316
|
+
type: "array",
|
|
317
|
+
items
|
|
318
|
+
}, options);
|
|
319
|
+
}
|
|
320
|
+
/** Returns true if the given value is a TArray. */
|
|
321
|
+
function IsArray(value) {
|
|
322
|
+
return IsKind(value, "Array");
|
|
323
|
+
}
|
|
324
|
+
/** Extracts options from a TArray. */
|
|
325
|
+
function ArrayOptions(type) {
|
|
326
|
+
return Discard(type, [
|
|
327
|
+
"~kind",
|
|
328
|
+
"type",
|
|
329
|
+
"items"
|
|
330
|
+
]);
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/constructor.mjs
|
|
334
|
+
/** Creates a Constructor type. */
|
|
335
|
+
function Constructor(parameters, instanceType, options = {}) {
|
|
336
|
+
return Create({ "~kind": "Constructor" }, {
|
|
337
|
+
type: "constructor",
|
|
338
|
+
parameters,
|
|
339
|
+
instanceType
|
|
340
|
+
}, options);
|
|
341
|
+
}
|
|
342
|
+
/** Returns true if the given value is a TConstructor. */
|
|
343
|
+
function IsConstructor(value) {
|
|
344
|
+
return IsKind(value, "Constructor");
|
|
345
|
+
}
|
|
346
|
+
/** Extracts options from a TConstructor. */
|
|
347
|
+
function ConstructorOptions(type) {
|
|
348
|
+
return Discard(type, [
|
|
349
|
+
"~kind",
|
|
350
|
+
"type",
|
|
351
|
+
"parameters",
|
|
352
|
+
"instanceType"
|
|
353
|
+
]);
|
|
354
|
+
}
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/function.mjs
|
|
357
|
+
/** Creates a Function type. */
|
|
358
|
+
function _Function_$1(parameters, returnType, options = {}) {
|
|
359
|
+
return Create({ ["~kind"]: "Function" }, {
|
|
360
|
+
type: "function",
|
|
361
|
+
parameters,
|
|
362
|
+
returnType
|
|
363
|
+
}, options);
|
|
364
|
+
}
|
|
365
|
+
/** Returns true if the given value is TFunction. */
|
|
366
|
+
function IsFunction(value) {
|
|
367
|
+
return IsKind(value, "Function");
|
|
368
|
+
}
|
|
369
|
+
/** Extracts options from a TFunction. */
|
|
370
|
+
function FunctionOptions(type) {
|
|
371
|
+
return Discard(type, [
|
|
372
|
+
"~kind",
|
|
373
|
+
"type",
|
|
374
|
+
"parameters",
|
|
375
|
+
"returnType"
|
|
376
|
+
]);
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/ref.mjs
|
|
380
|
+
/** Creates a Ref type. */
|
|
381
|
+
function Ref(ref, options) {
|
|
382
|
+
return Create({ ["~kind"]: "Ref" }, { $ref: ref }, options);
|
|
383
|
+
}
|
|
384
|
+
/** Returns true if the given value is TRef. */
|
|
385
|
+
function IsRef(value) {
|
|
386
|
+
return IsKind(value, "Ref");
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/generic.mjs
|
|
390
|
+
/** Creates a Generic type. */
|
|
391
|
+
function Generic(parameters, expression) {
|
|
392
|
+
return Create({ "~kind": "Generic" }, {
|
|
393
|
+
type: "generic",
|
|
394
|
+
parameters,
|
|
395
|
+
expression
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
/** Returns true if the given value is a TGeneric. */
|
|
399
|
+
function IsGeneric(value) {
|
|
400
|
+
return IsKind(value, "Generic");
|
|
401
|
+
}
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/any.mjs
|
|
404
|
+
/** Creates a Any type. */
|
|
405
|
+
function Any(options) {
|
|
406
|
+
return Create({ ["~kind"]: "Any" }, {}, options);
|
|
407
|
+
}
|
|
408
|
+
/** Returns true if the given value is a TAny. */
|
|
409
|
+
function IsAny(value) {
|
|
410
|
+
return IsKind(value, "Any");
|
|
411
|
+
}
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/never.mjs
|
|
414
|
+
const NeverPattern = "(?!)";
|
|
415
|
+
/** Creates a Never type. */
|
|
416
|
+
function Never(options) {
|
|
417
|
+
return Create({ "~kind": "Never" }, { not: {} }, options);
|
|
418
|
+
}
|
|
419
|
+
/** Returns true if the given value is TNever. */
|
|
420
|
+
function IsNever(value) {
|
|
421
|
+
return IsKind(value, "Never");
|
|
422
|
+
}
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_add_optional.mjs
|
|
425
|
+
/** Creates a deferred AddOptional action. */
|
|
426
|
+
function AddOptionalDeferred(type, options = {}) {
|
|
427
|
+
return Deferred("AddOptional", [type], options);
|
|
428
|
+
}
|
|
429
|
+
/** Applies an AddOptional action to a type. */
|
|
430
|
+
function AddOptional(type, options = {}) {
|
|
431
|
+
return AddOptionalAction(type, options);
|
|
432
|
+
}
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_optional.mjs
|
|
435
|
+
/** Applies an Optional modifier to the given type. */
|
|
436
|
+
function Optional$2(type) {
|
|
437
|
+
return AddOptional(type);
|
|
438
|
+
}
|
|
439
|
+
/** Returns true if the given value is TOptional */
|
|
440
|
+
function IsOptional(value) {
|
|
441
|
+
return IsSchema(value) && HasPropertyKey(value, "~optional");
|
|
442
|
+
}
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/properties.mjs
|
|
445
|
+
/** Creates a RequiredArray derived from the given TProperties value. */
|
|
446
|
+
function RequiredArray(properties) {
|
|
447
|
+
return Keys(properties).filter((key) => !IsOptional(properties[key]));
|
|
448
|
+
}
|
|
449
|
+
/** Extracts a tuple of keys from a TProperties value. */
|
|
450
|
+
function PropertyKeys(properties) {
|
|
451
|
+
return Keys(properties);
|
|
452
|
+
}
|
|
453
|
+
/** Extracts a tuple of property values from a TProperties value. */
|
|
454
|
+
function PropertyValues(properties) {
|
|
455
|
+
return Values(properties);
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/object.mjs
|
|
459
|
+
/** Creates an Object type. */
|
|
460
|
+
function _Object_$1(properties, options = {}) {
|
|
461
|
+
const requiredKeys = RequiredArray(properties);
|
|
462
|
+
return Create({ "~kind": "Object" }, {
|
|
463
|
+
type: "object",
|
|
464
|
+
...requiredKeys.length > 0 ? { required: requiredKeys } : {},
|
|
465
|
+
properties
|
|
466
|
+
}, options);
|
|
467
|
+
}
|
|
468
|
+
/** Returns true if the given value is TObject. */
|
|
469
|
+
function IsObject(value) {
|
|
470
|
+
return IsKind(value, "Object");
|
|
471
|
+
}
|
|
472
|
+
/** Extracts options from a TObject. */
|
|
473
|
+
function ObjectOptions(type) {
|
|
474
|
+
return Discard(type, [
|
|
475
|
+
"~kind",
|
|
476
|
+
"type",
|
|
477
|
+
"properties",
|
|
478
|
+
"required"
|
|
479
|
+
]);
|
|
480
|
+
}
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/unknown.mjs
|
|
483
|
+
/** Creates an Unknown type. */
|
|
484
|
+
function Unknown(options) {
|
|
485
|
+
return Create({ ["~kind"]: "Unknown" }, {}, options);
|
|
486
|
+
}
|
|
487
|
+
/** Returns true if the given value is TUnknown. */
|
|
488
|
+
function IsUnknown(value) {
|
|
489
|
+
return IsKind(value, "Unknown");
|
|
490
|
+
}
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/cyclic.mjs
|
|
493
|
+
/** Creates a Cyclic type. */
|
|
494
|
+
function Cyclic($defs, $ref, options) {
|
|
495
|
+
const defs = Keys($defs).reduce((result, key) => {
|
|
496
|
+
return {
|
|
497
|
+
...result,
|
|
498
|
+
[key]: Update($defs[key], {}, { $id: key })
|
|
499
|
+
};
|
|
500
|
+
}, {});
|
|
501
|
+
return Create({ ["~kind"]: "Cyclic" }, {
|
|
502
|
+
$defs: defs,
|
|
503
|
+
$ref
|
|
504
|
+
}, options);
|
|
505
|
+
}
|
|
506
|
+
/** Returns true if the given value is a TCyclic. */
|
|
507
|
+
function IsCyclic(value) {
|
|
508
|
+
return IsKind(value, "Cyclic");
|
|
509
|
+
}
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/unsafe.mjs
|
|
512
|
+
/** Creates a Unsafe type. */
|
|
513
|
+
function Unsafe(schema) {
|
|
514
|
+
return Update(schema, { ["~unsafe"]: null }, {});
|
|
515
|
+
}
|
|
516
|
+
/** Returns true if the given value is TUnsafe. */
|
|
517
|
+
function IsUnsafe(value) {
|
|
518
|
+
return IsObjectNotArray(value) && HasPropertyKey(value, "~unsafe") && IsNull$1(value["~unsafe"]);
|
|
519
|
+
}
|
|
520
|
+
//#endregion
|
|
521
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/arguments/arguments.mjs
|
|
522
|
+
/**
|
|
523
|
+
* Match arguments for overloaded functions that use the `...args: unknown[]` pattern. Arguments
|
|
524
|
+
* are parsed using argument length only.
|
|
525
|
+
*/
|
|
526
|
+
function Match$2(args, match) {
|
|
527
|
+
return match[args.length]?.(...args) ?? (() => {
|
|
528
|
+
throw Error("Invalid Arguments");
|
|
529
|
+
})();
|
|
530
|
+
}
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/infer.mjs
|
|
533
|
+
/** Creates an Infer instruction. */
|
|
534
|
+
function Infer(...args) {
|
|
535
|
+
const [name, extends_] = Match$2(args, {
|
|
536
|
+
2: (name, extends_) => [
|
|
537
|
+
name,
|
|
538
|
+
extends_,
|
|
539
|
+
extends_
|
|
540
|
+
],
|
|
541
|
+
1: (name) => [
|
|
542
|
+
name,
|
|
543
|
+
Unknown(),
|
|
544
|
+
Unknown()
|
|
545
|
+
]
|
|
546
|
+
});
|
|
547
|
+
return Create({ ["~kind"]: "Infer" }, {
|
|
548
|
+
type: "infer",
|
|
549
|
+
name,
|
|
550
|
+
extends: extends_
|
|
551
|
+
}, {});
|
|
552
|
+
}
|
|
553
|
+
/** Returns true if the given value is TInfer. */
|
|
554
|
+
function IsInfer(value) {
|
|
555
|
+
return IsKind(value, "Infer");
|
|
556
|
+
}
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/dependent.mjs
|
|
559
|
+
/** Creates a Dependent type */
|
|
560
|
+
function Dependent$1(if_, then_, else_, options = {}) {
|
|
561
|
+
return Create({ "~kind": "Dependent" }, {
|
|
562
|
+
if: if_,
|
|
563
|
+
then: then_,
|
|
564
|
+
else: else_
|
|
565
|
+
}, options);
|
|
566
|
+
}
|
|
567
|
+
/** Returns true if the given value is TDependent. */
|
|
568
|
+
function IsDependent(value) {
|
|
569
|
+
return IsKind(value, "Dependent");
|
|
570
|
+
}
|
|
571
|
+
/** Extracts options from a IsDependent. */
|
|
572
|
+
function DependentOptions(type) {
|
|
573
|
+
return Discard(type, [
|
|
574
|
+
"~kind",
|
|
575
|
+
"if",
|
|
576
|
+
"then",
|
|
577
|
+
"else"
|
|
578
|
+
]);
|
|
579
|
+
}
|
|
580
|
+
//#endregion
|
|
581
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs
|
|
582
|
+
function IsTypeScriptEnumLike(value) {
|
|
583
|
+
return IsObjectNotArray(value);
|
|
584
|
+
}
|
|
585
|
+
function TypeScriptEnumToEnumValues(type) {
|
|
586
|
+
return Keys(type).filter((key) => isNaN(key)).reduce((result, key) => [...result, type[key]], []);
|
|
587
|
+
}
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/enum.mjs
|
|
590
|
+
/** Returns true if the given value is a EnumValue */
|
|
591
|
+
function IsEnumValue(value) {
|
|
592
|
+
return IsString$1(value) || IsNumber$1(value);
|
|
593
|
+
}
|
|
594
|
+
/** Creates an Enum type. */
|
|
595
|
+
function Enum(value, options) {
|
|
596
|
+
return Create({ "~kind": "Enum" }, { enum: IsTypeScriptEnumLike(value) ? TypeScriptEnumToEnumValues(value) : value }, options);
|
|
597
|
+
}
|
|
598
|
+
/** Returns true if the given value is a TEnum. */
|
|
599
|
+
function IsEnum(value) {
|
|
600
|
+
return IsKind(value, "Enum");
|
|
601
|
+
}
|
|
602
|
+
//#endregion
|
|
603
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/intersect.mjs
|
|
604
|
+
/** Creates a Intersect type. */
|
|
605
|
+
function Intersect(types, options = {}) {
|
|
606
|
+
return Create({ "~kind": "Intersect" }, { allOf: types }, options);
|
|
607
|
+
}
|
|
608
|
+
/** Returns true if the given value is TIntersect. */
|
|
609
|
+
function IsIntersect(value) {
|
|
610
|
+
return IsKind(value, "Intersect");
|
|
611
|
+
}
|
|
612
|
+
/** Extracts options from a TIntersect. */
|
|
613
|
+
function IntersectOptions(type) {
|
|
614
|
+
return Discard(type, ["~kind", "allOf"]);
|
|
615
|
+
}
|
|
616
|
+
//#endregion
|
|
617
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/unreachable/unreachable.mjs
|
|
618
|
+
/** Used for unreachable logic */
|
|
619
|
+
function Unreachable$1() {
|
|
620
|
+
throw new Error("Unreachable");
|
|
621
|
+
}
|
|
622
|
+
//#endregion
|
|
623
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/system/hashing/hash.mjs
|
|
624
|
+
var ByteMarker;
|
|
625
|
+
(function(ByteMarker) {
|
|
626
|
+
ByteMarker[ByteMarker["Array"] = 0] = "Array";
|
|
627
|
+
ByteMarker[ByteMarker["BigInt"] = 1] = "BigInt";
|
|
628
|
+
ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
|
|
629
|
+
ByteMarker[ByteMarker["Date"] = 3] = "Date";
|
|
630
|
+
ByteMarker[ByteMarker["Constructor"] = 4] = "Constructor";
|
|
631
|
+
ByteMarker[ByteMarker["Function"] = 5] = "Function";
|
|
632
|
+
ByteMarker[ByteMarker["Null"] = 6] = "Null";
|
|
633
|
+
ByteMarker[ByteMarker["Number"] = 7] = "Number";
|
|
634
|
+
ByteMarker[ByteMarker["Object"] = 8] = "Object";
|
|
635
|
+
ByteMarker[ByteMarker["RegExp"] = 9] = "RegExp";
|
|
636
|
+
ByteMarker[ByteMarker["String"] = 10] = "String";
|
|
637
|
+
ByteMarker[ByteMarker["Symbol"] = 11] = "Symbol";
|
|
638
|
+
ByteMarker[ByteMarker["TypeArray"] = 12] = "TypeArray";
|
|
639
|
+
ByteMarker[ByteMarker["Undefined"] = 13] = "Undefined";
|
|
640
|
+
})(ByteMarker || (ByteMarker = {}));
|
|
641
|
+
Array.from({ length: 256 }).map((_, i) => BigInt(i));
|
|
642
|
+
const F64 = /* @__PURE__ */ new Float64Array(1);
|
|
643
|
+
new DataView(F64.buffer);
|
|
644
|
+
new Uint8Array(F64.buffer);
|
|
645
|
+
new TextEncoder();
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_codec.mjs
|
|
648
|
+
var EncodeBuilder = class {
|
|
649
|
+
constructor(type, decode) {
|
|
650
|
+
this.type = type;
|
|
651
|
+
this.decode = decode;
|
|
652
|
+
}
|
|
653
|
+
Encode(callback) {
|
|
654
|
+
const type = this.type;
|
|
655
|
+
const codec = {
|
|
656
|
+
decode: IsCodec(type) ? (value) => this.decode(type["~codec"].decode(value)) : this.decode,
|
|
657
|
+
encode: IsCodec(type) ? (value) => type["~codec"].encode(callback(value)) : callback
|
|
658
|
+
};
|
|
659
|
+
return Update(this.type, { "~codec": codec }, {});
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
var DecodeBuilder = class {
|
|
663
|
+
constructor(type) {
|
|
664
|
+
this.type = type;
|
|
665
|
+
}
|
|
666
|
+
Decode(callback) {
|
|
667
|
+
return new EncodeBuilder(this.type, callback);
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
/** Creates a bi-directional Codec. Codec functions are called on Value.Decode and Value.Encode. */
|
|
671
|
+
function Codec(type) {
|
|
672
|
+
return new DecodeBuilder(type);
|
|
673
|
+
}
|
|
674
|
+
/** Createsa uni-directional Codec with Decode only. The Decode function is called on Value.Decode */
|
|
675
|
+
function Decode(type, callback) {
|
|
676
|
+
return Codec(type).Decode(callback).Encode(() => {
|
|
677
|
+
throw Error("Encode not implemented");
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
/** Creates a uni-directional Codec with Encode only. The Encode function is called on Value.Encode */
|
|
681
|
+
function Encode(type, callback) {
|
|
682
|
+
return Codec(type).Decode(() => {
|
|
683
|
+
throw Error("Decode not implemented");
|
|
684
|
+
}).Encode(callback);
|
|
685
|
+
}
|
|
686
|
+
function IsCodec(value) {
|
|
687
|
+
return IsSchema(value) && HasPropertyKey(value, "~codec") && IsObject$1(value["~codec"]) && HasPropertyKey(value["~codec"], "encode") && HasPropertyKey(value["~codec"], "decode");
|
|
688
|
+
}
|
|
689
|
+
//#endregion
|
|
690
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_immutable.mjs
|
|
691
|
+
/** Applies an Immutable modifier to the given type. */
|
|
692
|
+
function Immutable(type) {
|
|
693
|
+
return AddImmutable(type);
|
|
694
|
+
}
|
|
695
|
+
/** Returns true if the given value is a TImmutable */
|
|
696
|
+
function IsImmutable(value) {
|
|
697
|
+
return IsSchema(value) && HasPropertyKey(value, "~immutable");
|
|
698
|
+
}
|
|
699
|
+
//#endregion
|
|
700
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_add_readonly.mjs
|
|
701
|
+
/** Creates a deferred AddReadonly action. */
|
|
702
|
+
function AddReadonlyDeferred(type, options = {}) {
|
|
703
|
+
return Deferred("AddReadonly", [type], options);
|
|
704
|
+
}
|
|
705
|
+
/** Applies an AddReadonly action to a type. */
|
|
706
|
+
function AddReadonly(type, options = {}) {
|
|
707
|
+
return AddReadonlyAction(type, options);
|
|
708
|
+
}
|
|
709
|
+
//#endregion
|
|
710
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_readonly.mjs
|
|
711
|
+
/** Applies an Readonly property modifier to the given type. */
|
|
712
|
+
function Readonly$1(type) {
|
|
713
|
+
return AddReadonly(type);
|
|
714
|
+
}
|
|
715
|
+
/** Returns true if the given value is a TReadonly */
|
|
716
|
+
function IsReadonly(value) {
|
|
717
|
+
return IsSchema(value) && HasPropertyKey(value, "~readonly");
|
|
718
|
+
}
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/_refine.mjs
|
|
721
|
+
/** Applies a Refine check to the given type. */
|
|
722
|
+
function RefineAdd(type, refinement) {
|
|
723
|
+
return Update(type, { "~refine": IsRefine(type) ? [...type["~refine"], refinement] : [refinement] }, {});
|
|
724
|
+
}
|
|
725
|
+
/** Refines a type with an explicit check */
|
|
726
|
+
function Refine(...args) {
|
|
727
|
+
const [type, check, error] = Match$2(args, {
|
|
728
|
+
3: (type, check, error) => [
|
|
729
|
+
type,
|
|
730
|
+
check,
|
|
731
|
+
error
|
|
732
|
+
],
|
|
733
|
+
2: (type, check) => [
|
|
734
|
+
type,
|
|
735
|
+
check,
|
|
736
|
+
() => "Refine Error"
|
|
737
|
+
]
|
|
738
|
+
});
|
|
739
|
+
return RefineAdd(type, {
|
|
740
|
+
check,
|
|
741
|
+
error
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
/** Returns true if the given value is a TRefinement. */
|
|
745
|
+
function IsRefinement(value) {
|
|
746
|
+
return IsObjectNotArray(value) && HasPropertyKey(value, "check") && HasPropertyKey(value, "error") && IsFunction$1(value.check) && IsFunction$1(value.error);
|
|
747
|
+
}
|
|
748
|
+
/** Returns true if the given value is a TRefine. */
|
|
749
|
+
function IsRefine(value) {
|
|
750
|
+
return IsSchema(value) && HasPropertyKey(value, "~refine") && IsArray$1(value["~refine"]) && Every(value["~refine"], 0, (value) => IsRefinement(value));
|
|
751
|
+
}
|
|
752
|
+
//#endregion
|
|
753
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/bigint.mjs
|
|
754
|
+
const BigIntPattern = "-?(?:0|[1-9][0-9]*)n";
|
|
755
|
+
/** Creates a BigInt type. */
|
|
756
|
+
function BigInt$2(options) {
|
|
757
|
+
return Create({ "~kind": "BigInt" }, { type: "bigint" }, options);
|
|
758
|
+
}
|
|
759
|
+
/** Returns true if the given value is a TBigInt. */
|
|
760
|
+
function IsBigInt(value) {
|
|
761
|
+
return IsKind(value, "BigInt");
|
|
762
|
+
}
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/boolean.mjs
|
|
765
|
+
/** Creates a Boolean type. */
|
|
766
|
+
function Boolean$1(options) {
|
|
767
|
+
return Create({ "~kind": "Boolean" }, { type: "boolean" }, options);
|
|
768
|
+
}
|
|
769
|
+
/** Returns true if the given value is a TBoolean. */
|
|
770
|
+
function IsBoolean(value) {
|
|
771
|
+
return IsKind(value, "Boolean");
|
|
772
|
+
}
|
|
773
|
+
//#endregion
|
|
774
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/identifier.mjs
|
|
775
|
+
/** Creates an Identifier. */
|
|
776
|
+
function Identifier(name) {
|
|
777
|
+
return Create({ "~kind": "Identifier" }, { name });
|
|
778
|
+
}
|
|
779
|
+
/** Returns true if the given value is a TIdentifier. */
|
|
780
|
+
function IsIdentifier(value) {
|
|
781
|
+
return IsKind(value, "Identifier");
|
|
782
|
+
}
|
|
783
|
+
//#endregion
|
|
784
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/integer.mjs
|
|
785
|
+
const IntegerPattern = "-?(?:0|[1-9][0-9]*)";
|
|
786
|
+
/** Creates a Integer type. */
|
|
787
|
+
function Integer$1(options) {
|
|
788
|
+
return Create({ "~kind": "Integer" }, { type: "integer" }, options);
|
|
789
|
+
}
|
|
790
|
+
/** Returns true if the given value is TInteger. */
|
|
791
|
+
function IsInteger(value) {
|
|
792
|
+
return IsKind(value, "Integer");
|
|
793
|
+
}
|
|
794
|
+
//#endregion
|
|
795
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/literal.mjs
|
|
796
|
+
var InvalidLiteralValue = class extends Error {
|
|
797
|
+
constructor(value) {
|
|
798
|
+
super(`Invalid Literal value`);
|
|
799
|
+
Object.defineProperty(this, "cause", {
|
|
800
|
+
value: { value },
|
|
801
|
+
writable: false,
|
|
802
|
+
configurable: false,
|
|
803
|
+
enumerable: false
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
function LiteralTypeName(value) {
|
|
808
|
+
return IsBigInt$1(value) ? "bigint" : IsBoolean$1(value) ? "boolean" : IsNumber$1(value) ? "number" : IsString$1(value) ? "string" : (() => {
|
|
809
|
+
throw new InvalidLiteralValue(value);
|
|
810
|
+
})();
|
|
811
|
+
}
|
|
812
|
+
/** Creates a Literal type. */
|
|
813
|
+
function Literal(value, options) {
|
|
814
|
+
return Create({ "~kind": "Literal" }, {
|
|
815
|
+
type: LiteralTypeName(value),
|
|
816
|
+
const: value
|
|
817
|
+
}, options);
|
|
818
|
+
}
|
|
819
|
+
/** Returns true if the given value is a TLiteralValue. */
|
|
820
|
+
function IsLiteralValue(value) {
|
|
821
|
+
return IsBigInt$1(value) || IsBoolean$1(value) || IsNumber$1(value) || IsString$1(value);
|
|
822
|
+
}
|
|
823
|
+
/** Returns true if the given value is TLiteral<number>. */
|
|
824
|
+
function IsLiteralNumber(value) {
|
|
825
|
+
return IsLiteral(value) && IsNumber$1(value.const);
|
|
826
|
+
}
|
|
827
|
+
/** Returns true if the given value is TLiteral<string>. */
|
|
828
|
+
function IsLiteralString(value) {
|
|
829
|
+
return IsLiteral(value) && IsString$1(value.const);
|
|
830
|
+
}
|
|
831
|
+
/** Returns true if the given value is TLiteral. */
|
|
832
|
+
function IsLiteral(value) {
|
|
833
|
+
return IsKind(value, "Literal");
|
|
834
|
+
}
|
|
835
|
+
//#endregion
|
|
836
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/null.mjs
|
|
837
|
+
/** Creates a Null type. */
|
|
838
|
+
function Null(options) {
|
|
839
|
+
return Create({ "~kind": "Null" }, { type: "null" }, options);
|
|
840
|
+
}
|
|
841
|
+
/** Returns true if the given value is TNull. */
|
|
842
|
+
function IsNull(value) {
|
|
843
|
+
return IsKind(value, "Null");
|
|
844
|
+
}
|
|
845
|
+
//#endregion
|
|
846
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/number.mjs
|
|
847
|
+
const NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";
|
|
848
|
+
/** Creates a Number type. */
|
|
849
|
+
function Number$2(options) {
|
|
850
|
+
return Create({ "~kind": "Number" }, { type: "number" }, options);
|
|
851
|
+
}
|
|
852
|
+
/** Returns true if the given value is a TNumber. */
|
|
853
|
+
function IsNumber(value) {
|
|
854
|
+
return IsKind(value, "Number");
|
|
855
|
+
}
|
|
856
|
+
//#endregion
|
|
857
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/symbol.mjs
|
|
858
|
+
/** Creates a Symbol type. */
|
|
859
|
+
function Symbol(options) {
|
|
860
|
+
return Create({ "~kind": "Symbol" }, { type: "symbol" }, options);
|
|
861
|
+
}
|
|
862
|
+
/** Returns true if the given value is TSymbol. */
|
|
863
|
+
function IsSymbol(value) {
|
|
864
|
+
return IsKind(value, "Symbol");
|
|
865
|
+
}
|
|
866
|
+
//#endregion
|
|
867
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/parameter.mjs
|
|
868
|
+
/** Creates a Parameter type. */
|
|
869
|
+
function Parameter$1(...args) {
|
|
870
|
+
const [name, extends_, equals] = Match$2(args, {
|
|
871
|
+
3: (name, extends_, equals) => [
|
|
872
|
+
name,
|
|
873
|
+
extends_,
|
|
874
|
+
equals
|
|
875
|
+
],
|
|
876
|
+
2: (name, extends_) => [
|
|
877
|
+
name,
|
|
878
|
+
extends_,
|
|
879
|
+
extends_
|
|
880
|
+
],
|
|
881
|
+
1: (name) => [
|
|
882
|
+
name,
|
|
883
|
+
Unknown(),
|
|
884
|
+
Unknown()
|
|
885
|
+
]
|
|
886
|
+
});
|
|
887
|
+
return Create({ "~kind": "Parameter" }, {
|
|
888
|
+
name,
|
|
889
|
+
extends: extends_,
|
|
890
|
+
equals
|
|
891
|
+
}, {});
|
|
892
|
+
}
|
|
893
|
+
/** Returns true if the given value is TParameter. */
|
|
894
|
+
function IsParameter(value) {
|
|
895
|
+
return IsKind(value, "Parameter");
|
|
896
|
+
}
|
|
897
|
+
//#endregion
|
|
898
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/string.mjs
|
|
899
|
+
/** Creates a String type. */
|
|
900
|
+
function String$2(options) {
|
|
901
|
+
return Create({ "~kind": "String" }, { type: "string" }, options);
|
|
902
|
+
}
|
|
903
|
+
/** Returns true if the given value is TString. */
|
|
904
|
+
function IsString(value) {
|
|
905
|
+
return IsKind(value, "String");
|
|
906
|
+
}
|
|
907
|
+
//#endregion
|
|
908
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/union.mjs
|
|
909
|
+
/** Creates a Union type. */
|
|
910
|
+
function Union(anyOf, options = {}) {
|
|
911
|
+
return Create({ "~kind": "Union" }, { anyOf }, options);
|
|
912
|
+
}
|
|
913
|
+
/** Returns true if the given value is TUnion. */
|
|
914
|
+
function IsUnion(value) {
|
|
915
|
+
return IsKind(value, "Union");
|
|
916
|
+
}
|
|
917
|
+
/** Extracts options from a TUnion. */
|
|
918
|
+
function UnionOptions(type) {
|
|
919
|
+
return Discard(type, ["~kind", "anyOf"]);
|
|
920
|
+
}
|
|
921
|
+
//#endregion
|
|
922
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/patterns/pattern.mjs
|
|
923
|
+
/** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */
|
|
924
|
+
function ParsePatternIntoTypes(pattern) {
|
|
925
|
+
const parsed = Pattern(pattern);
|
|
926
|
+
return IsEqual(parsed.length, 2) ? parsed[0] : [];
|
|
927
|
+
}
|
|
928
|
+
//#endregion
|
|
929
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs
|
|
930
|
+
function FromLiteral$4(_value) {
|
|
931
|
+
return true;
|
|
932
|
+
}
|
|
933
|
+
function FromTypesReduce(types) {
|
|
934
|
+
return ShiftLeft(types, (left, right) => FromType$17(left) ? FromTypesReduce(right) : false, () => true);
|
|
935
|
+
}
|
|
936
|
+
function FromTypes$4(types) {
|
|
937
|
+
return IsEqual(types.length, 0) ? false : FromTypesReduce(types);
|
|
938
|
+
}
|
|
939
|
+
function FromType$17(type) {
|
|
940
|
+
return IsUnion(type) ? FromTypes$4(type.anyOf) : IsLiteral(type) ? FromLiteral$4(type.const) : false;
|
|
941
|
+
}
|
|
942
|
+
/** Returns true if the given TemplateLiteral types yields a finite variant set */
|
|
943
|
+
function IsTemplateLiteralFinite(types) {
|
|
944
|
+
return FromTypes$4(types);
|
|
945
|
+
}
|
|
946
|
+
//#endregion
|
|
947
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/create.mjs
|
|
948
|
+
function TemplateLiteralCreate(pattern) {
|
|
949
|
+
return Create({ ["~kind"]: "TemplateLiteral" }, {
|
|
950
|
+
type: "string",
|
|
951
|
+
pattern
|
|
952
|
+
}, {});
|
|
953
|
+
}
|
|
954
|
+
//#endregion
|
|
955
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/decode.mjs
|
|
956
|
+
function FromLiteralPush(variants, value, result = []) {
|
|
957
|
+
return ShiftLeft(variants, (left, right) => FromLiteralPush(right, value, [...result, `${left}${value}`]), () => result);
|
|
958
|
+
}
|
|
959
|
+
function FromLiteral$3(variants, value) {
|
|
960
|
+
return IsEqual(variants.length, 0) ? [`${value}`] : FromLiteralPush(variants, value);
|
|
961
|
+
}
|
|
962
|
+
function FromUnion$7(variants, types, result = []) {
|
|
963
|
+
return ShiftLeft(types, (left, right) => FromUnion$7(variants, right, [...result, ...FromType$16(variants, left)]), () => result);
|
|
964
|
+
}
|
|
965
|
+
function FromType$16(variants, type) {
|
|
966
|
+
return IsUnion(type) ? FromUnion$7(variants, type.anyOf) : IsLiteral(type) ? FromLiteral$3(variants, type.const) : Unreachable$1();
|
|
967
|
+
}
|
|
968
|
+
function DecodeFromSpan(variants, types) {
|
|
969
|
+
return ShiftLeft(types, (left, right) => DecodeFromSpan(FromType$16(variants, left), right), () => variants);
|
|
970
|
+
}
|
|
971
|
+
function VariantsToLiterals(variants) {
|
|
972
|
+
return variants.map((variant) => Literal(variant));
|
|
973
|
+
}
|
|
974
|
+
function DecodeTypesAsUnion(types) {
|
|
975
|
+
return Union(VariantsToLiterals(DecodeFromSpan([], types)));
|
|
976
|
+
}
|
|
977
|
+
function DecodeTypes(types) {
|
|
978
|
+
return IsEqual(types.length, 0) ? Unreachable$1() : IsEqual(types.length, 1) && IsLiteral(types[0]) ? types[0] : DecodeTypesAsUnion(types);
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* (Internal) Decodes a TemplateLiteral pattern into a Type. This function is unsafe. Decoding a non-finite
|
|
982
|
+
* TemplateLiteral pattern may produce another TemplateLiteral pattern. During enumeration, this
|
|
983
|
+
* TemplateLiteral -> TemplateLiteral behavior can cause a StackOverflow. A better in-flight template-literal
|
|
984
|
+
* decoding algorithm is needed. (for review)
|
|
985
|
+
*/
|
|
986
|
+
function TemplateLiteralDecodeUnsafe(pattern) {
|
|
987
|
+
const types = ParsePatternIntoTypes(pattern);
|
|
988
|
+
return IsEqual(types.length, 0) ? String$2() : IsTemplateLiteralFinite(types) ? DecodeTypes(types) : TemplateLiteralCreate(pattern);
|
|
989
|
+
}
|
|
990
|
+
/** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */
|
|
991
|
+
function TemplateLiteralDecode(pattern) {
|
|
992
|
+
const decoded = TemplateLiteralDecodeUnsafe(pattern);
|
|
993
|
+
return IsTemplateLiteral(decoded) ? String$2() : decoded;
|
|
994
|
+
}
|
|
995
|
+
//#endregion
|
|
996
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/record_create.mjs
|
|
997
|
+
function CreateRecord(key, value) {
|
|
998
|
+
const type = "object";
|
|
999
|
+
const patternProperties = { [key]: value };
|
|
1000
|
+
return Create({ ["~kind"]: "Record" }, {
|
|
1001
|
+
type,
|
|
1002
|
+
patternProperties
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
//#endregion
|
|
1006
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_any.mjs
|
|
1007
|
+
function FromAnyKey(value) {
|
|
1008
|
+
return CreateRecord(StringKey, value);
|
|
1009
|
+
}
|
|
1010
|
+
//#endregion
|
|
1011
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs
|
|
1012
|
+
function FromBooleanKey(value) {
|
|
1013
|
+
return _Object_$1({
|
|
1014
|
+
true: value,
|
|
1015
|
+
false: value
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
//#endregion
|
|
1019
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/tuple.mjs
|
|
1020
|
+
/** Creates a Tuple type. */
|
|
1021
|
+
function Tuple(types, options = {}) {
|
|
1022
|
+
const [items, minItems, additionalItems] = [
|
|
1023
|
+
types,
|
|
1024
|
+
types.length,
|
|
1025
|
+
false
|
|
1026
|
+
];
|
|
1027
|
+
return Create({ ["~kind"]: "Tuple" }, {
|
|
1028
|
+
type: "array",
|
|
1029
|
+
additionalItems,
|
|
1030
|
+
items,
|
|
1031
|
+
minItems
|
|
1032
|
+
}, options);
|
|
1033
|
+
}
|
|
1034
|
+
/** Returns true if the given value is TTuple. */
|
|
1035
|
+
function IsTuple(value) {
|
|
1036
|
+
return IsKind(value, "Tuple");
|
|
1037
|
+
}
|
|
1038
|
+
/** Extracts options from a TTuple. */
|
|
1039
|
+
function TupleOptions(type) {
|
|
1040
|
+
return Discard(type, [
|
|
1041
|
+
"~kind",
|
|
1042
|
+
"type",
|
|
1043
|
+
"items",
|
|
1044
|
+
"minItems",
|
|
1045
|
+
"additionalItems"
|
|
1046
|
+
]);
|
|
1047
|
+
}
|
|
1048
|
+
//#endregion
|
|
1049
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs
|
|
1050
|
+
function RemoveReadonlyOperation(type) {
|
|
1051
|
+
return Discard(type, ["~readonly"]);
|
|
1052
|
+
}
|
|
1053
|
+
function RemoveReadonlyAction(type, options) {
|
|
1054
|
+
return Update(RemoveReadonlyOperation(type), {}, options);
|
|
1055
|
+
}
|
|
1056
|
+
function RemoveReadonlyInstantiate(context, state, type, options) {
|
|
1057
|
+
return RemoveReadonlyAction(InstantiateType(context, state, type), options);
|
|
1058
|
+
}
|
|
1059
|
+
//#endregion
|
|
1060
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_remove_readonly.mjs
|
|
1061
|
+
/** Creates a deferred RemoveReadonly action. */
|
|
1062
|
+
function RemoveReadonlyDeferred(type, options = {}) {
|
|
1063
|
+
return Deferred("RemoveReadonly", [type], options);
|
|
1064
|
+
}
|
|
1065
|
+
/** Applies an RemoveReadonly action to a type. */
|
|
1066
|
+
function RemoveReadonly(type, options = {}) {
|
|
1067
|
+
return RemoveReadonlyAction(type, options);
|
|
1068
|
+
}
|
|
1069
|
+
//#endregion
|
|
1070
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs
|
|
1071
|
+
function RemoveOptionalOperation(type) {
|
|
1072
|
+
return Discard(type, ["~optional"]);
|
|
1073
|
+
}
|
|
1074
|
+
function RemoveOptionalAction(type, options) {
|
|
1075
|
+
return Update(RemoveOptionalOperation(type), {}, options);
|
|
1076
|
+
}
|
|
1077
|
+
function RemoveOptionalInstantiate(context, state, type, options) {
|
|
1078
|
+
return RemoveOptionalAction(InstantiateType(context, state, type), options);
|
|
1079
|
+
}
|
|
1080
|
+
//#endregion
|
|
1081
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_remove_optional.mjs
|
|
1082
|
+
/** Creates a deferred RemoveOptional action. */
|
|
1083
|
+
function RemoveOptionalDeferred(type, options = {}) {
|
|
1084
|
+
return Deferred("RemoveOptional", [type], options);
|
|
1085
|
+
}
|
|
1086
|
+
/** Applies an RemoveOptional action to a type. */
|
|
1087
|
+
function RemoveOptional(type, options = {}) {
|
|
1088
|
+
return RemoveOptionalAction(type, options);
|
|
1089
|
+
}
|
|
1090
|
+
//#endregion
|
|
1091
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/tuple/to_object.mjs
|
|
1092
|
+
function TupleElementsToProperties(types) {
|
|
1093
|
+
return types.reduceRight((result, right, index) => {
|
|
1094
|
+
return {
|
|
1095
|
+
[index]: right,
|
|
1096
|
+
...result
|
|
1097
|
+
};
|
|
1098
|
+
}, {});
|
|
1099
|
+
}
|
|
1100
|
+
function TupleToObject(type) {
|
|
1101
|
+
return _Object_$1(TupleElementsToProperties(type.items));
|
|
1102
|
+
}
|
|
1103
|
+
//#endregion
|
|
1104
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/composite.mjs
|
|
1105
|
+
/** Returns true if the type is a valid operand to Composite. */
|
|
1106
|
+
function CanComposite(type) {
|
|
1107
|
+
return IsObject(type) || IsTuple(type);
|
|
1108
|
+
}
|
|
1109
|
+
function IsReadonlyProperty(left, right) {
|
|
1110
|
+
return IsReadonly(left) ? IsReadonly(right) ? true : false : false;
|
|
1111
|
+
}
|
|
1112
|
+
function IsOptionalProperty(left, right) {
|
|
1113
|
+
return IsOptional(left) ? IsOptional(right) ? true : false : false;
|
|
1114
|
+
}
|
|
1115
|
+
function CompositeProperty(left, right) {
|
|
1116
|
+
const isReadonly = IsReadonlyProperty(left, right);
|
|
1117
|
+
const isOptional = IsOptionalProperty(left, right);
|
|
1118
|
+
const property = RemoveReadonly(RemoveOptional(EvaluateIntersect([left, right])));
|
|
1119
|
+
return isReadonly && isOptional ? AddReadonly(AddOptional(property)) : isReadonly && !isOptional ? AddReadonly(property) : !isReadonly && isOptional ? AddOptional(property) : property;
|
|
1120
|
+
}
|
|
1121
|
+
function CompositePropertyKey(left, right, key) {
|
|
1122
|
+
return key in left ? key in right ? CompositeProperty(left[key], right[key]) : left[key] : key in right ? right[key] : Never();
|
|
1123
|
+
}
|
|
1124
|
+
function CompositeProperties(left, right) {
|
|
1125
|
+
return [.../* @__PURE__ */ new Set([...Keys(left), ...Keys(right)])].reduce((result, key) => {
|
|
1126
|
+
return {
|
|
1127
|
+
...result,
|
|
1128
|
+
[key]: CompositePropertyKey(left, right, key)
|
|
1129
|
+
};
|
|
1130
|
+
}, {});
|
|
1131
|
+
}
|
|
1132
|
+
function GetProperties(type) {
|
|
1133
|
+
return IsObject(type) ? type.properties : IsTuple(type) ? TupleElementsToProperties(type.items) : {};
|
|
1134
|
+
}
|
|
1135
|
+
function Composite(left, right) {
|
|
1136
|
+
return _Object_$1(CompositeProperties(GetProperties(left), GetProperties(right)));
|
|
1137
|
+
}
|
|
1138
|
+
//#endregion
|
|
1139
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/narrow.mjs
|
|
1140
|
+
function NarrowCompareRule(left, right) {
|
|
1141
|
+
const result = Compare(left, right);
|
|
1142
|
+
return IsEqual(result, 2) ? left : IsEqual(result, 3) ? right : IsEqual(result, 0) ? right : Never();
|
|
1143
|
+
}
|
|
1144
|
+
function NarrowCompositeRule(left, right) {
|
|
1145
|
+
const canCompositeLeft = CanComposite(left);
|
|
1146
|
+
const canCompositeRight = CanComposite(right);
|
|
1147
|
+
return canCompositeLeft && canCompositeRight ? Composite(left, right) : canCompositeLeft && !canCompositeRight ? left : !canCompositeLeft && canCompositeRight ? right : NarrowCompareRule(left, right);
|
|
1148
|
+
}
|
|
1149
|
+
function Narrow(left, right) {
|
|
1150
|
+
return IsNever(left) ? left : IsAny(left) ? left : IsUnknown(left) ? right : IsNever(right) ? right : IsAny(right) ? right : IsUnknown(right) ? left : NarrowCompositeRule(left, right);
|
|
1151
|
+
}
|
|
1152
|
+
//#endregion
|
|
1153
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/distribute.mjs
|
|
1154
|
+
function ShouldEvaluate(left, right) {
|
|
1155
|
+
return IsUnion(left) || IsUnion(right);
|
|
1156
|
+
}
|
|
1157
|
+
function DistributeOperation(left, right) {
|
|
1158
|
+
const evaluatedLeft = EvaluateType(left);
|
|
1159
|
+
const evaluatedRight = EvaluateType(right);
|
|
1160
|
+
return ShouldEvaluate(evaluatedLeft, evaluatedRight) ? EvaluateIntersect([evaluatedLeft, evaluatedRight]) : Narrow(evaluatedLeft, evaluatedRight);
|
|
1161
|
+
}
|
|
1162
|
+
function DistributeType(type, types, result = []) {
|
|
1163
|
+
return ShiftLeft(types, (left, right) => DistributeType(type, right, [...result, DistributeOperation(left, type)]), () => IsEqual(result.length, 0) ? [type] : result);
|
|
1164
|
+
}
|
|
1165
|
+
function DistributeUnion(types, distribution, result = []) {
|
|
1166
|
+
return ShiftLeft(types, (left, right) => DistributeUnion(right, distribution, [...result, ...Distribute$1([left], distribution)]), () => result);
|
|
1167
|
+
}
|
|
1168
|
+
function Distribute$1(types, result = []) {
|
|
1169
|
+
return ShiftLeft(types, (left, right) => IsUnion(left) ? Distribute$1(right, DistributeUnion(left.anyOf, result)) : Distribute$1(right, DistributeType(left, result)), () => result);
|
|
1170
|
+
}
|
|
1171
|
+
//#endregion
|
|
1172
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/exclude/operation.mjs
|
|
1173
|
+
function ExcludeType(left, right) {
|
|
1174
|
+
return IsExtendsTrueLike(Extends({}, left, right)) ? [] : [left];
|
|
1175
|
+
}
|
|
1176
|
+
function ExcludeUnion(left, right, result = []) {
|
|
1177
|
+
return ShiftLeft(left, (head, tail) => ExcludeUnion(tail, right, [...result, ...ExcludeType(head, right)]), () => result);
|
|
1178
|
+
}
|
|
1179
|
+
function ExcludeOperation(left, right) {
|
|
1180
|
+
const evaluated = EvaluateType(left);
|
|
1181
|
+
return EvaluateUnion(ExcludeUnion(IsUnion(evaluated) ? evaluated.anyOf : [evaluated], right));
|
|
1182
|
+
}
|
|
1183
|
+
//#endregion
|
|
1184
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs
|
|
1185
|
+
function EvaluateDependent(if_, then_, else_) {
|
|
1186
|
+
return EvaluateUnion([EvaluateIntersect([if_, then_]), ExcludeOperation(else_, if_)]);
|
|
1187
|
+
}
|
|
1188
|
+
function EvaluateEnum(values, result = []) {
|
|
1189
|
+
return ShiftLeft(values, (left, right) => EvaluateEnum(right, [...result, Literal(left)]), () => EvaluateUnion(result));
|
|
1190
|
+
}
|
|
1191
|
+
function EvaluateIntersect(types) {
|
|
1192
|
+
return EvaluateUnion(Broaden(Distribute$1(types)));
|
|
1193
|
+
}
|
|
1194
|
+
function EvaluateTemplateLiteral(pattern) {
|
|
1195
|
+
return EvaluateType(TemplateLiteralDecode(pattern));
|
|
1196
|
+
}
|
|
1197
|
+
function EvaluateUnion(types) {
|
|
1198
|
+
return EvaluateUnionFast(Broaden(types));
|
|
1199
|
+
}
|
|
1200
|
+
function EvaluateType(type) {
|
|
1201
|
+
return IsDependent(type) ? EvaluateDependent(type.if, type.then, type.else) : IsEnum(type) ? EvaluateEnum(type.enum) : IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
|
|
1202
|
+
}
|
|
1203
|
+
function EvaluateUnionFast(types) {
|
|
1204
|
+
return IsEqual(types.length, 1) ? types[0] : IsEqual(types.length, 0) ? Never() : Union(types);
|
|
1205
|
+
}
|
|
1206
|
+
//#endregion
|
|
1207
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_enum.mjs
|
|
1208
|
+
function FromEnumKey(values, value) {
|
|
1209
|
+
return FromKey(EvaluateEnum(values), value);
|
|
1210
|
+
}
|
|
1211
|
+
//#endregion
|
|
1212
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_integer.mjs
|
|
1213
|
+
function FromIntegerKey(_key, value) {
|
|
1214
|
+
return CreateRecord(IntegerKey, value);
|
|
1215
|
+
}
|
|
1216
|
+
//#endregion
|
|
1217
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs
|
|
1218
|
+
function FromIntersectKey(types, value) {
|
|
1219
|
+
return FromKey(EvaluateIntersect(types), value);
|
|
1220
|
+
}
|
|
1221
|
+
//#endregion
|
|
1222
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_literal.mjs
|
|
1223
|
+
function FromLiteralKey(key, value) {
|
|
1224
|
+
return IsString$1(key) || IsNumber$1(key) ? _Object_$1({ [key]: value }) : IsEqual(key, false) ? _Object_$1({ false: value }) : IsEqual(key, true) ? _Object_$1({ true: value }) : _Object_$1({});
|
|
1225
|
+
}
|
|
1226
|
+
//#endregion
|
|
1227
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_number.mjs
|
|
1228
|
+
function FromNumberKey(_key, value) {
|
|
1229
|
+
return CreateRecord(NumberKey, value);
|
|
1230
|
+
}
|
|
1231
|
+
//#endregion
|
|
1232
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_string.mjs
|
|
1233
|
+
function FromStringKey(key, value) {
|
|
1234
|
+
return HasPropertyKey(key, "pattern") && (IsString$1(key.pattern) || key.pattern instanceof RegExp) ? CreateRecord(key.pattern.toString(), value) : CreateRecord(StringKey, value);
|
|
1235
|
+
}
|
|
1236
|
+
//#endregion
|
|
1237
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs
|
|
1238
|
+
function FromTemplateKey(pattern, value) {
|
|
1239
|
+
return IsTemplateLiteralFinite(ParsePatternIntoTypes(pattern)) ? FromKey(EvaluateTemplateLiteral(pattern), value) : CreateRecord(pattern, value);
|
|
1240
|
+
}
|
|
1241
|
+
//#endregion
|
|
1242
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/flatten.mjs
|
|
1243
|
+
function FlattenType(type) {
|
|
1244
|
+
return IsUnion(type) ? Flatten(type.anyOf) : [type];
|
|
1245
|
+
}
|
|
1246
|
+
function Flatten(types, result = []) {
|
|
1247
|
+
return ShiftLeft(types, (left, right) => Flatten(right, [...result, ...FlattenType(left)]), () => result);
|
|
1248
|
+
}
|
|
1249
|
+
//#endregion
|
|
1250
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key_union.mjs
|
|
1251
|
+
function StringOrNumberCheck(types) {
|
|
1252
|
+
return types.some((type) => IsString(type) || IsNumber(type) || IsInteger(type));
|
|
1253
|
+
}
|
|
1254
|
+
function TryBuildRecord(types, value) {
|
|
1255
|
+
return IsEqual(StringOrNumberCheck(types), true) ? CreateRecord(StringKey, value) : void 0;
|
|
1256
|
+
}
|
|
1257
|
+
function CreateProperties(types, value) {
|
|
1258
|
+
return types.reduce((result, left) => {
|
|
1259
|
+
return IsLiteral(left) && (IsString$1(left.const) || IsNumber$1(left.const)) ? {
|
|
1260
|
+
...result,
|
|
1261
|
+
[left.const]: value
|
|
1262
|
+
} : result;
|
|
1263
|
+
}, {});
|
|
1264
|
+
}
|
|
1265
|
+
function CreateObject(types, value) {
|
|
1266
|
+
return _Object_$1(CreateProperties(types, value));
|
|
1267
|
+
}
|
|
1268
|
+
function FromUnionKey(types, value) {
|
|
1269
|
+
const flattened = Flatten(types);
|
|
1270
|
+
const record = TryBuildRecord(flattened, value);
|
|
1271
|
+
return IsSchema(record) ? record : CreateObject(flattened, value);
|
|
1272
|
+
}
|
|
1273
|
+
//#endregion
|
|
1274
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/from_key.mjs
|
|
1275
|
+
function FromKey(key, value) {
|
|
1276
|
+
return IsAny(key) ? FromAnyKey(value) : IsBoolean(key) ? FromBooleanKey(value) : IsEnum(key) ? FromEnumKey(key.enum, value) : IsInteger(key) ? FromIntegerKey(key, value) : IsIntersect(key) ? FromIntersectKey(key.allOf, value) : IsLiteral(key) ? FromLiteralKey(key.const, value) : IsNumber(key) ? FromNumberKey(key, value) : IsUnion(key) ? FromUnionKey(key.anyOf, value) : IsString(key) ? FromStringKey(key, value) : IsTemplateLiteral(key) ? FromTemplateKey(key.pattern, value) : _Object_$1({});
|
|
1277
|
+
}
|
|
1278
|
+
//#endregion
|
|
1279
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/record/instantiate.mjs
|
|
1280
|
+
function RecordAction(key, value, options) {
|
|
1281
|
+
return CanInstantiate([key]) ? Update(FromKey(key, value), {}, options) : RecordDeferred(key, value, options);
|
|
1282
|
+
}
|
|
1283
|
+
function RecordInstantiate(context, state, key, value, options) {
|
|
1284
|
+
return RecordAction(InstantiateType(context, state, key), InstantiateType(context, state, value), options);
|
|
1285
|
+
}
|
|
1286
|
+
//#endregion
|
|
1287
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/record.mjs
|
|
1288
|
+
const IntegerKey = `^${IntegerPattern}$`;
|
|
1289
|
+
const NumberKey = `^${NumberPattern}$`;
|
|
1290
|
+
const StringKey = `^.*$`;
|
|
1291
|
+
/** Represents a deferred Record action. */
|
|
1292
|
+
function RecordDeferred(key, value, options = {}) {
|
|
1293
|
+
return Deferred("Record", [key, value], options);
|
|
1294
|
+
}
|
|
1295
|
+
/** Creates a Record type. */
|
|
1296
|
+
function Record(key, value, options = {}) {
|
|
1297
|
+
return RecordAction(key, value, options);
|
|
1298
|
+
}
|
|
1299
|
+
/** Creates a Record type from regular expression pattern. */
|
|
1300
|
+
function RecordFromPattern(pattern, value) {
|
|
1301
|
+
return CreateRecord(pattern, value);
|
|
1302
|
+
}
|
|
1303
|
+
/** Transforms a Record Pattern to a Type */
|
|
1304
|
+
function RecordPatternToType(pattern) {
|
|
1305
|
+
return IsEqual(pattern, StringKey) ? String$2() : IsEqual(pattern, IntegerKey) ? Integer$1() : IsEqual(pattern, NumberKey) ? Number$2() : TemplateLiteralDecodeUnsafe(pattern);
|
|
1306
|
+
}
|
|
1307
|
+
/** Extracts the Pattern from a Record type */
|
|
1308
|
+
function RecordPattern(type) {
|
|
1309
|
+
return Keys(type.patternProperties)[0];
|
|
1310
|
+
}
|
|
1311
|
+
/** Extracts the Key from a Record type */
|
|
1312
|
+
function RecordKey(type) {
|
|
1313
|
+
return RecordPatternToType(RecordPattern(type));
|
|
1314
|
+
}
|
|
1315
|
+
/** Extracts the Value from a Record type */
|
|
1316
|
+
function RecordValue(type) {
|
|
1317
|
+
return type.patternProperties[RecordPattern(type)];
|
|
1318
|
+
}
|
|
1319
|
+
function IsRecord(value) {
|
|
1320
|
+
return IsKind(value, "Record");
|
|
1321
|
+
}
|
|
1322
|
+
//#endregion
|
|
1323
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/rest.mjs
|
|
1324
|
+
/** Creates a Rest instruction type. */
|
|
1325
|
+
function Rest(type) {
|
|
1326
|
+
return Create({ "~kind": "Rest" }, {
|
|
1327
|
+
type: "rest",
|
|
1328
|
+
items: type
|
|
1329
|
+
}, {});
|
|
1330
|
+
}
|
|
1331
|
+
/** Returns true if the given value is TRest. */
|
|
1332
|
+
function IsRest(value) {
|
|
1333
|
+
return IsKind(value, "Rest");
|
|
1334
|
+
}
|
|
1335
|
+
//#endregion
|
|
1336
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/this.mjs
|
|
1337
|
+
/** Creates a This type. */
|
|
1338
|
+
function This(options) {
|
|
1339
|
+
return Create({ ["~kind"]: "This" }, { $ref: "#" }, options);
|
|
1340
|
+
}
|
|
1341
|
+
/** Returns true if the given value is TThis. */
|
|
1342
|
+
function IsThis(value) {
|
|
1343
|
+
return IsKind(value, "This");
|
|
1344
|
+
}
|
|
1345
|
+
//#endregion
|
|
1346
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/undefined.mjs
|
|
1347
|
+
/** Creates a Undefined type. */
|
|
1348
|
+
function Undefined(options) {
|
|
1349
|
+
return Create({ "~kind": "Undefined" }, { type: "undefined" }, options);
|
|
1350
|
+
}
|
|
1351
|
+
/** Returns true if the given value is TUndefined. */
|
|
1352
|
+
function IsUndefined(value) {
|
|
1353
|
+
return IsKind(value, "Undefined");
|
|
1354
|
+
}
|
|
1355
|
+
//#endregion
|
|
1356
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/void.mjs
|
|
1357
|
+
/** Creates a Void type. */
|
|
1358
|
+
function Void(options) {
|
|
1359
|
+
return Create({ "~kind": "Void" }, { type: "void" }, options);
|
|
1360
|
+
}
|
|
1361
|
+
/** Returns true if the given value is TVoid. */
|
|
1362
|
+
function IsVoid(value) {
|
|
1363
|
+
return IsKind(value, "Void");
|
|
1364
|
+
}
|
|
1365
|
+
//#endregion
|
|
1366
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/mapping.mjs
|
|
1367
|
+
function IntrinsicOrCall(ref, parameters) {
|
|
1368
|
+
return IsEqual(ref, "Array") ? _Array_(parameters[0]) : IsEqual(ref, "Capitalize") ? CapitalizeDeferred(parameters[0]) : IsEqual(ref, "ConstructorParameters") ? ConstructorParametersDeferred(parameters[0]) : IsEqual(ref, "Evaluate") ? EvaluateDeferred(parameters[0]) : IsEqual(ref, "Exclude") ? ExcludeDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Extract") ? ExtractDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Index") ? IndexDeferred(parameters[0], parameters[1]) : IsEqual(ref, "InstanceType") ? InstanceTypeDeferred(parameters[0]) : IsEqual(ref, "Lowercase") ? LowercaseDeferred(parameters[0]) : IsEqual(ref, "NonNullable") ? NonNullableDeferred(parameters[0]) : IsEqual(ref, "Omit") ? OmitDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Parameters") ? ParametersDeferred(parameters[0]) : IsEqual(ref, "Partial") ? PartialDeferred(parameters[0]) : IsEqual(ref, "Pick") ? PickDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Readonly") ? ReadonlyObjectDeferred(parameters[0]) : IsEqual(ref, "KeyOf") ? KeyOfDeferred(parameters[0]) : IsEqual(ref, "Record") ? RecordDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Required") ? RequiredDeferred(parameters[0]) : IsEqual(ref, "ReturnType") ? ReturnTypeDeferred(parameters[0]) : IsEqual(ref, "Uncapitalize") ? UncapitalizeDeferred(parameters[0]) : IsEqual(ref, "Uppercase") ? UppercaseDeferred(parameters[0]) : CallConstruct(Ref(ref), parameters);
|
|
1369
|
+
}
|
|
1370
|
+
function Unreachable() {
|
|
1371
|
+
throw Error("Unreachable");
|
|
1372
|
+
}
|
|
1373
|
+
function DelimitedDecode(input, result = []) {
|
|
1374
|
+
return ShiftLeft(input, (left, right) => DelimitedDecode(right, [...result, left[1]]), () => result);
|
|
1375
|
+
}
|
|
1376
|
+
function Delimited(input) {
|
|
1377
|
+
return IsEqual(input.length, 3) ? [input[0], ...DelimitedDecode(input[1])] : [];
|
|
1378
|
+
}
|
|
1379
|
+
function GenericParameterExtendsEqualsMapping(input) {
|
|
1380
|
+
return Parameter$1(input[0], input[2], input[4]);
|
|
1381
|
+
}
|
|
1382
|
+
function GenericParameterExtendsMapping(input) {
|
|
1383
|
+
return Parameter$1(input[0], input[2], input[2]);
|
|
1384
|
+
}
|
|
1385
|
+
function GenericParameterEqualsMapping(input) {
|
|
1386
|
+
return Parameter$1(input[0], Unknown(), input[2]);
|
|
1387
|
+
}
|
|
1388
|
+
function GenericParameterIdentifierMapping(input) {
|
|
1389
|
+
return Parameter$1(input, Unknown(), Unknown());
|
|
1390
|
+
}
|
|
1391
|
+
function GenericParameterMapping(input) {
|
|
1392
|
+
return input;
|
|
1393
|
+
}
|
|
1394
|
+
function GenericParameterListMapping(input) {
|
|
1395
|
+
return Delimited(input);
|
|
1396
|
+
}
|
|
1397
|
+
function GenericParametersMapping(input) {
|
|
1398
|
+
return input[1];
|
|
1399
|
+
}
|
|
1400
|
+
function GenericCallArgumentListMapping(input) {
|
|
1401
|
+
return Delimited(input);
|
|
1402
|
+
}
|
|
1403
|
+
function GenericCallArgumentsMapping(input) {
|
|
1404
|
+
return input[1];
|
|
1405
|
+
}
|
|
1406
|
+
function GenericCallMapping(input) {
|
|
1407
|
+
return IntrinsicOrCall(input[0], input[1]);
|
|
1408
|
+
}
|
|
1409
|
+
function OptionalSemiColonMapping(input) {
|
|
1410
|
+
return null;
|
|
1411
|
+
}
|
|
1412
|
+
function KeywordStringMapping(input) {
|
|
1413
|
+
return String$2();
|
|
1414
|
+
}
|
|
1415
|
+
function KeywordNumberMapping(input) {
|
|
1416
|
+
return Number$2();
|
|
1417
|
+
}
|
|
1418
|
+
function KeywordBooleanMapping(input) {
|
|
1419
|
+
return Boolean$1();
|
|
1420
|
+
}
|
|
1421
|
+
function KeywordUndefinedMapping(input) {
|
|
1422
|
+
return Undefined();
|
|
1423
|
+
}
|
|
1424
|
+
function KeywordNullMapping(input) {
|
|
1425
|
+
return Null();
|
|
1426
|
+
}
|
|
1427
|
+
function KeywordIntegerMapping(input) {
|
|
1428
|
+
return Integer$1();
|
|
1429
|
+
}
|
|
1430
|
+
function KeywordBigIntMapping(input) {
|
|
1431
|
+
return BigInt$2();
|
|
1432
|
+
}
|
|
1433
|
+
function KeywordUnknownMapping(input) {
|
|
1434
|
+
return Unknown();
|
|
1435
|
+
}
|
|
1436
|
+
function KeywordAnyMapping(input) {
|
|
1437
|
+
return Any();
|
|
1438
|
+
}
|
|
1439
|
+
function KeywordObjectMapping(input) {
|
|
1440
|
+
return _Object_$1({});
|
|
1441
|
+
}
|
|
1442
|
+
function KeywordNeverMapping(input) {
|
|
1443
|
+
return Never();
|
|
1444
|
+
}
|
|
1445
|
+
function KeywordSymbolMapping(input) {
|
|
1446
|
+
return Symbol();
|
|
1447
|
+
}
|
|
1448
|
+
function KeywordVoidMapping(input) {
|
|
1449
|
+
return Void();
|
|
1450
|
+
}
|
|
1451
|
+
function KeywordThisMapping(input) {
|
|
1452
|
+
return This();
|
|
1453
|
+
}
|
|
1454
|
+
function LiteralBigIntMapping(input) {
|
|
1455
|
+
return Literal(BigInt(input));
|
|
1456
|
+
}
|
|
1457
|
+
function LiteralBooleanMapping(input) {
|
|
1458
|
+
return Literal(IsEqual(input, "true"));
|
|
1459
|
+
}
|
|
1460
|
+
function LiteralNumberMapping(input) {
|
|
1461
|
+
return Literal(parseFloat(input));
|
|
1462
|
+
}
|
|
1463
|
+
function LiteralStringMapping(input) {
|
|
1464
|
+
return Literal(input);
|
|
1465
|
+
}
|
|
1466
|
+
function TemplateInterpolateMapping(input) {
|
|
1467
|
+
return input[1];
|
|
1468
|
+
}
|
|
1469
|
+
function TemplateSpanMapping(input) {
|
|
1470
|
+
return Literal(input);
|
|
1471
|
+
}
|
|
1472
|
+
function TemplateBodyMapping(input) {
|
|
1473
|
+
return IsEqual(input.length, 3) ? [
|
|
1474
|
+
input[0],
|
|
1475
|
+
input[1],
|
|
1476
|
+
...input[2]
|
|
1477
|
+
] : [input[0]];
|
|
1478
|
+
}
|
|
1479
|
+
function TemplateLiteralTypesMapping(input) {
|
|
1480
|
+
return input[1];
|
|
1481
|
+
}
|
|
1482
|
+
function TemplateLiteralMapping(input) {
|
|
1483
|
+
return TemplateLiteralDeferred(input);
|
|
1484
|
+
}
|
|
1485
|
+
function DependentMapping(input) {
|
|
1486
|
+
return IsEqual(input.length, 6) ? Dependent$1(input[1], input[3], input[5]) : Dependent$1(input[1], input[3], Unknown());
|
|
1487
|
+
}
|
|
1488
|
+
function KeyOfMapping(input) {
|
|
1489
|
+
return input.length > 0;
|
|
1490
|
+
}
|
|
1491
|
+
function IndexArrayMapping(input) {
|
|
1492
|
+
return input.reduce((result, current) => {
|
|
1493
|
+
return IsEqual(current.length, 3) ? [...result, [current[1]]] : [...result, []];
|
|
1494
|
+
}, []);
|
|
1495
|
+
}
|
|
1496
|
+
function ExtendsMapping(input) {
|
|
1497
|
+
return IsEqual(input.length, 6) ? [
|
|
1498
|
+
input[1],
|
|
1499
|
+
input[3],
|
|
1500
|
+
input[5]
|
|
1501
|
+
] : [];
|
|
1502
|
+
}
|
|
1503
|
+
function BaseMapping(input) {
|
|
1504
|
+
return IsArray$1(input) && IsEqual(input.length, 3) ? input[1] : input;
|
|
1505
|
+
}
|
|
1506
|
+
function WithMapping(input) {
|
|
1507
|
+
return IsEqual(input.length, 2) ? input[1] : [];
|
|
1508
|
+
}
|
|
1509
|
+
function FactorIndexArray(Type, indexArray) {
|
|
1510
|
+
return indexArray.reduce((result, left) => {
|
|
1511
|
+
const _left = left;
|
|
1512
|
+
return IsEqual(_left.length, 1) ? IndexDeferred(result, _left[0]) : IsEqual(_left.length, 0) ? _Array_(result) : Unreachable();
|
|
1513
|
+
}, Type);
|
|
1514
|
+
}
|
|
1515
|
+
function FactorExtends(type, extend) {
|
|
1516
|
+
return IsEqual(extend.length, 3) ? ConditionalDeferred(type, extend[0], extend[1], extend[2]) : type;
|
|
1517
|
+
}
|
|
1518
|
+
function FactorWith(type, withClause) {
|
|
1519
|
+
return IsArray$1(withClause) && IsEqual(withClause.length, 0) ? type : WithDeferred(type, withClause);
|
|
1520
|
+
}
|
|
1521
|
+
function FactorMapping(input) {
|
|
1522
|
+
const [keyOf, type, indexArray, extend, withClause] = input;
|
|
1523
|
+
return FactorWith(keyOf ? FactorExtends(KeyOfDeferred(FactorIndexArray(type, indexArray)), extend) : FactorExtends(FactorIndexArray(type, indexArray), extend), withClause);
|
|
1524
|
+
}
|
|
1525
|
+
function ExprBinaryMapping(left, rest) {
|
|
1526
|
+
return IsEqual(rest.length, 3) ? (() => {
|
|
1527
|
+
const [operator, right, next] = rest;
|
|
1528
|
+
const Schema = ExprBinaryMapping(right, next);
|
|
1529
|
+
if (IsEqual(operator, "&")) return IsIntersect(Schema) ? Intersect([left, ...Schema.allOf]) : Intersect([left, Schema]);
|
|
1530
|
+
if (IsEqual(operator, "|")) return IsUnion(Schema) ? Union([left, ...Schema.anyOf]) : Union([left, Schema]);
|
|
1531
|
+
Unreachable();
|
|
1532
|
+
})() : left;
|
|
1533
|
+
}
|
|
1534
|
+
function ExprTermTailMapping(input) {
|
|
1535
|
+
return input;
|
|
1536
|
+
}
|
|
1537
|
+
function ExprTermMapping(input) {
|
|
1538
|
+
const [left, rest] = input;
|
|
1539
|
+
return ExprBinaryMapping(left, rest);
|
|
1540
|
+
}
|
|
1541
|
+
function ExprTailMapping(input) {
|
|
1542
|
+
return input;
|
|
1543
|
+
}
|
|
1544
|
+
function ExprMapping(input) {
|
|
1545
|
+
const [left, rest] = input;
|
|
1546
|
+
return ExprBinaryMapping(left, rest);
|
|
1547
|
+
}
|
|
1548
|
+
function ExprReadonlyMapping(input) {
|
|
1549
|
+
return AddImmutableDeferred(input[1]);
|
|
1550
|
+
}
|
|
1551
|
+
function ExprPipeMapping(input) {
|
|
1552
|
+
return input[1];
|
|
1553
|
+
}
|
|
1554
|
+
function GenericTypeMapping(input) {
|
|
1555
|
+
return Generic(input[0], input[2]);
|
|
1556
|
+
}
|
|
1557
|
+
function InferTypeMapping(input) {
|
|
1558
|
+
return IsEqual(input.length, 4) ? Infer(input[1], input[3]) : IsEqual(input.length, 2) ? Infer(input[1], Unknown()) : Unreachable();
|
|
1559
|
+
}
|
|
1560
|
+
function TypeMapping(input) {
|
|
1561
|
+
return input;
|
|
1562
|
+
}
|
|
1563
|
+
function PropertyKeyNumberMapping(input) {
|
|
1564
|
+
return `${input}`;
|
|
1565
|
+
}
|
|
1566
|
+
function PropertyKeyIdentMapping(input) {
|
|
1567
|
+
return input;
|
|
1568
|
+
}
|
|
1569
|
+
function PropertyKeyQuotedMapping(input) {
|
|
1570
|
+
return input;
|
|
1571
|
+
}
|
|
1572
|
+
function PropertyKeyIndexMapping(input) {
|
|
1573
|
+
return IsInteger(input[3]) ? IntegerKey : IsNumber(input[3]) ? NumberKey : IsSymbol(input[3]) ? StringKey : IsString(input[3]) ? StringKey : Unreachable();
|
|
1574
|
+
}
|
|
1575
|
+
function PropertyKeyMapping(input) {
|
|
1576
|
+
return input;
|
|
1577
|
+
}
|
|
1578
|
+
function ReadonlyMapping(input) {
|
|
1579
|
+
return input.length > 0;
|
|
1580
|
+
}
|
|
1581
|
+
function OptionalMapping(input) {
|
|
1582
|
+
return input.length > 0;
|
|
1583
|
+
}
|
|
1584
|
+
function PropertyMapping(input) {
|
|
1585
|
+
const [isReadonly, key, isOptional, _colon, type] = input;
|
|
1586
|
+
return { [key]: isReadonly && isOptional ? AddReadonlyDeferred(AddOptionalDeferred(type)) : isReadonly && !isOptional ? AddReadonlyDeferred(type) : !isReadonly && isOptional ? AddOptionalDeferred(type) : type };
|
|
1587
|
+
}
|
|
1588
|
+
function PropertyDelimiterMapping(input) {
|
|
1589
|
+
return input;
|
|
1590
|
+
}
|
|
1591
|
+
function PropertyListMapping(input) {
|
|
1592
|
+
return Delimited(input);
|
|
1593
|
+
}
|
|
1594
|
+
function PropertiesReduce(propertyList) {
|
|
1595
|
+
return propertyList.reduce((result, left) => {
|
|
1596
|
+
return HasPropertyKey(left, IntegerKey) || HasPropertyKey(left, NumberKey) || HasPropertyKey(left, StringKey) ? [result[0], Assign(result[1], left)] : [Assign(result[0], left), result[1]];
|
|
1597
|
+
}, [{}, {}]);
|
|
1598
|
+
}
|
|
1599
|
+
function PropertiesMapping(input) {
|
|
1600
|
+
return PropertiesReduce(input[1]);
|
|
1601
|
+
}
|
|
1602
|
+
function _Object_Mapping(input) {
|
|
1603
|
+
const [properties, patternProperties] = input;
|
|
1604
|
+
return _Object_$1(properties, IsEqual(Keys(patternProperties).length, 0) ? {} : { patternProperties });
|
|
1605
|
+
}
|
|
1606
|
+
function ElementNamedMapping(input) {
|
|
1607
|
+
return IsEqual(input.length, 5) ? AddReadonlyDeferred(AddOptionalDeferred(input[4])) : IsEqual(input.length, 3) ? input[2] : IsEqual(input.length, 4) ? IsEqual(input[2], "readonly") ? AddReadonlyDeferred(input[3]) : AddOptionalDeferred(input[3]) : Unreachable();
|
|
1608
|
+
}
|
|
1609
|
+
function ElementBaseMapping(input) {
|
|
1610
|
+
if (!IsArray$1(input) || !IsEqual(input.length, 3)) return input;
|
|
1611
|
+
const [isReadonly, type, isOptional] = input;
|
|
1612
|
+
return isReadonly && isOptional ? AddReadonlyDeferred(AddOptionalDeferred(type)) : isReadonly && !isOptional ? AddReadonlyDeferred(type) : !isReadonly && isOptional ? AddOptionalDeferred(type) : type;
|
|
1613
|
+
}
|
|
1614
|
+
function ElementMapping(input) {
|
|
1615
|
+
return IsEqual(input.length, 2) ? Rest(input[1]) : IsEqual(input.length, 1) ? input[0] : Unreachable();
|
|
1616
|
+
}
|
|
1617
|
+
function ElementListMapping(input) {
|
|
1618
|
+
return Delimited(input);
|
|
1619
|
+
}
|
|
1620
|
+
function _Tuple_Mapping(input) {
|
|
1621
|
+
return Tuple(input[1]);
|
|
1622
|
+
}
|
|
1623
|
+
function ParameterReadonlyOptionalMapping(input) {
|
|
1624
|
+
return AddReadonlyDeferred(AddOptionalDeferred(input[4]));
|
|
1625
|
+
}
|
|
1626
|
+
function ParameterReadonlyMapping(input) {
|
|
1627
|
+
return AddReadonlyDeferred(input[3]);
|
|
1628
|
+
}
|
|
1629
|
+
function ParameterOptionalMapping(input) {
|
|
1630
|
+
return AddOptionalDeferred(input[3]);
|
|
1631
|
+
}
|
|
1632
|
+
function ParameterTypeMapping(input) {
|
|
1633
|
+
return input[2];
|
|
1634
|
+
}
|
|
1635
|
+
function ParameterBaseMapping(input) {
|
|
1636
|
+
return input;
|
|
1637
|
+
}
|
|
1638
|
+
function ParameterMapping(input) {
|
|
1639
|
+
return IsEqual(input.length, 2) ? Rest(input[1]) : IsEqual(input.length, 1) ? input[0] : Unreachable();
|
|
1640
|
+
}
|
|
1641
|
+
function ParameterListMapping(input) {
|
|
1642
|
+
return Delimited(input);
|
|
1643
|
+
}
|
|
1644
|
+
function _Function_Mapping(input) {
|
|
1645
|
+
return _Function_$1(input[1], input[4]);
|
|
1646
|
+
}
|
|
1647
|
+
function _Constructor_Mapping(input) {
|
|
1648
|
+
return Constructor(input[2], input[5]);
|
|
1649
|
+
}
|
|
1650
|
+
function ApplyReadonly(state, type) {
|
|
1651
|
+
return IsEqual(state, "remove") ? RemoveReadonlyDeferred(type) : IsEqual(state, "add") ? AddReadonlyDeferred(type) : type;
|
|
1652
|
+
}
|
|
1653
|
+
function MappedReadonlyMapping(input) {
|
|
1654
|
+
return IsEqual(input.length, 2) && IsEqual(input[0], "-") ? "remove" : IsEqual(input.length, 2) && IsEqual(input[0], "+") ? "add" : IsEqual(input.length, 1) ? "add" : "none";
|
|
1655
|
+
}
|
|
1656
|
+
function ApplyOptional(state, type) {
|
|
1657
|
+
return IsEqual(state, "remove") ? RemoveOptionalDeferred(type) : IsEqual(state, "add") ? AddOptionalDeferred(type) : type;
|
|
1658
|
+
}
|
|
1659
|
+
function MappedOptionalMapping(input) {
|
|
1660
|
+
return IsEqual(input.length, 2) && IsEqual(input[0], "-") ? "remove" : IsEqual(input.length, 2) && IsEqual(input[0], "+") ? "add" : IsEqual(input.length, 1) ? "add" : "none";
|
|
1661
|
+
}
|
|
1662
|
+
function MappedAsMapping(input) {
|
|
1663
|
+
return IsEqual(input.length, 2) ? [input[1]] : [];
|
|
1664
|
+
}
|
|
1665
|
+
function _Mapped_Mapping(input) {
|
|
1666
|
+
return IsArray$1(input[6]) && IsEqual(input[6].length, 1) ? MappedDeferred(Identifier(input[3]), input[5], input[6][0], ApplyReadonly(input[1], ApplyOptional(input[8], input[10]))) : MappedDeferred(Identifier(input[3]), input[5], Ref(input[3]), ApplyReadonly(input[1], ApplyOptional(input[8], input[10])));
|
|
1667
|
+
}
|
|
1668
|
+
function ReferenceMapping(input) {
|
|
1669
|
+
return Ref(input);
|
|
1670
|
+
}
|
|
1671
|
+
function WithBigIntMapping(input) {
|
|
1672
|
+
return BigInt(input);
|
|
1673
|
+
}
|
|
1674
|
+
function WithNumberMapping(input) {
|
|
1675
|
+
return parseFloat(input);
|
|
1676
|
+
}
|
|
1677
|
+
function WithBooleanMapping(input) {
|
|
1678
|
+
return IsEqual(input, "true");
|
|
1679
|
+
}
|
|
1680
|
+
function WithStringMapping(input) {
|
|
1681
|
+
return input;
|
|
1682
|
+
}
|
|
1683
|
+
function WithNullMapping(input) {
|
|
1684
|
+
return null;
|
|
1685
|
+
}
|
|
1686
|
+
function WithPropertyMapping(input) {
|
|
1687
|
+
return { [input[0]]: input[2] };
|
|
1688
|
+
}
|
|
1689
|
+
function WithPropertyListMapping(input) {
|
|
1690
|
+
return Delimited(input);
|
|
1691
|
+
}
|
|
1692
|
+
function WithObjectMappingReduce(propertyList) {
|
|
1693
|
+
return propertyList.reduce((result, left) => {
|
|
1694
|
+
return Assign(result, left);
|
|
1695
|
+
}, {});
|
|
1696
|
+
}
|
|
1697
|
+
function WithObjectMapping(input) {
|
|
1698
|
+
return WithObjectMappingReduce(input[1]);
|
|
1699
|
+
}
|
|
1700
|
+
function WithElementListMapping(input) {
|
|
1701
|
+
return Delimited(input);
|
|
1702
|
+
}
|
|
1703
|
+
function WithArrayMapping(input) {
|
|
1704
|
+
return input[1];
|
|
1705
|
+
}
|
|
1706
|
+
function WithValueMapping(input) {
|
|
1707
|
+
return input;
|
|
1708
|
+
}
|
|
1709
|
+
function PatternBigIntMapping(input) {
|
|
1710
|
+
return BigInt$2();
|
|
1711
|
+
}
|
|
1712
|
+
function PatternStringMapping(input) {
|
|
1713
|
+
return String$2();
|
|
1714
|
+
}
|
|
1715
|
+
function PatternNumberMapping(input) {
|
|
1716
|
+
return Number$2();
|
|
1717
|
+
}
|
|
1718
|
+
function PatternIntegerMapping(input) {
|
|
1719
|
+
return Integer$1();
|
|
1720
|
+
}
|
|
1721
|
+
function PatternNeverMapping(input) {
|
|
1722
|
+
return Never();
|
|
1723
|
+
}
|
|
1724
|
+
function PatternTextMapping(input) {
|
|
1725
|
+
return Literal(input);
|
|
1726
|
+
}
|
|
1727
|
+
function PatternBaseMapping(input) {
|
|
1728
|
+
return input;
|
|
1729
|
+
}
|
|
1730
|
+
function PatternGroupMapping(input) {
|
|
1731
|
+
return Union(input[1]);
|
|
1732
|
+
}
|
|
1733
|
+
function PatternUnionMapping(input) {
|
|
1734
|
+
return input.length === 3 ? [...input[0], ...input[2]] : input.length === 1 ? [...input[0]] : [];
|
|
1735
|
+
}
|
|
1736
|
+
function PatternTermMapping(input) {
|
|
1737
|
+
return [input[0], ...input[1]];
|
|
1738
|
+
}
|
|
1739
|
+
function PatternBodyMapping(input) {
|
|
1740
|
+
return input;
|
|
1741
|
+
}
|
|
1742
|
+
function PatternMapping(input) {
|
|
1743
|
+
return input[1];
|
|
1744
|
+
}
|
|
1745
|
+
function InterfaceDeclarationHeritageListMapping(input) {
|
|
1746
|
+
return Delimited(input);
|
|
1747
|
+
}
|
|
1748
|
+
function InterfaceDeclarationHeritageMapping(input) {
|
|
1749
|
+
return IsEqual(input.length, 2) ? input[1] : [];
|
|
1750
|
+
}
|
|
1751
|
+
function InterfaceDeclarationGenericMapping(input) {
|
|
1752
|
+
const parameters = input[2];
|
|
1753
|
+
const heritage = input[3];
|
|
1754
|
+
const [properties, patternProperties] = input[4];
|
|
1755
|
+
const options = IsEqual(Keys(patternProperties).length, 0) ? {} : { patternProperties };
|
|
1756
|
+
return { [input[1]]: Generic(parameters, InterfaceDeferred(heritage, properties, options)) };
|
|
1757
|
+
}
|
|
1758
|
+
function InterfaceDeclarationMapping(input) {
|
|
1759
|
+
const heritage = input[2];
|
|
1760
|
+
const [properties, patternProperties] = input[3];
|
|
1761
|
+
const options = IsEqual(Keys(patternProperties).length, 0) ? {} : { patternProperties };
|
|
1762
|
+
return { [input[1]]: InterfaceDeferred(heritage, properties, options) };
|
|
1763
|
+
}
|
|
1764
|
+
function TypeAliasDeclarationGenericMapping(input) {
|
|
1765
|
+
return { [input[1]]: Generic(input[2], input[4]) };
|
|
1766
|
+
}
|
|
1767
|
+
function TypeAliasDeclarationMapping(input) {
|
|
1768
|
+
return { [input[1]]: input[3] };
|
|
1769
|
+
}
|
|
1770
|
+
function ExportKeywordMapping(input) {
|
|
1771
|
+
return null;
|
|
1772
|
+
}
|
|
1773
|
+
function ModuleDeclarationDelimiterMapping(input) {
|
|
1774
|
+
return input;
|
|
1775
|
+
}
|
|
1776
|
+
function ModuleDeclarationListMapping(input) {
|
|
1777
|
+
return Delimited(input);
|
|
1778
|
+
}
|
|
1779
|
+
function ModuleDeclarationMapping(input) {
|
|
1780
|
+
return input[1];
|
|
1781
|
+
}
|
|
1782
|
+
function ModuleMapping(input) {
|
|
1783
|
+
const [moduleDeclaration, moduleDeclarationList] = [input[0], input[1]];
|
|
1784
|
+
return ModuleDeferred(Assign(moduleDeclaration, PropertiesReduce(moduleDeclarationList)[0]));
|
|
1785
|
+
}
|
|
1786
|
+
function ScriptMapping(input) {
|
|
1787
|
+
return input;
|
|
1788
|
+
}
|
|
1789
|
+
//#endregion
|
|
1790
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/match.mjs
|
|
1791
|
+
/** Checks the value is a Tuple-2 [string, string] result */
|
|
1792
|
+
function IsMatch(value) {
|
|
1793
|
+
return IsEqual(value.length, 2);
|
|
1794
|
+
}
|
|
1795
|
+
/** Matches on a result and dispatches either left or right arm */
|
|
1796
|
+
function Match$1(input, ok, fail) {
|
|
1797
|
+
return IsMatch(input) ? ok(input[0], input[1]) : fail();
|
|
1798
|
+
}
|
|
1799
|
+
//#endregion
|
|
1800
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/take.mjs
|
|
1801
|
+
function TakeVariant(variant, input) {
|
|
1802
|
+
return IsEqual(input.indexOf(variant), 0) ? [variant, input.slice(variant.length)] : [];
|
|
1803
|
+
}
|
|
1804
|
+
/** Takes one of the given variants or fail */
|
|
1805
|
+
function Take(variants, input) {
|
|
1806
|
+
for (let i = 0; i < variants.length; i++) {
|
|
1807
|
+
const result = TakeVariant(variants[i], input);
|
|
1808
|
+
if (IsMatch(result)) return result;
|
|
1809
|
+
}
|
|
1810
|
+
return [];
|
|
1811
|
+
}
|
|
1812
|
+
//#endregion
|
|
1813
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/char.mjs
|
|
1814
|
+
function Range(start, end) {
|
|
1815
|
+
return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));
|
|
1816
|
+
}
|
|
1817
|
+
const Alpha = [...Range(97, 122), ...Range(65, 90)];
|
|
1818
|
+
const NonZero = Range(49, 57);
|
|
1819
|
+
const Digit = ["0", ...NonZero];
|
|
1820
|
+
//#endregion
|
|
1821
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/trim.mjs
|
|
1822
|
+
const LineComment = "//";
|
|
1823
|
+
const OpenComment = "/*";
|
|
1824
|
+
const CloseComment = "*/";
|
|
1825
|
+
function DiscardMultilineComment(input) {
|
|
1826
|
+
const index = input.indexOf(CloseComment);
|
|
1827
|
+
return IsEqual(index, -1) ? "" : input.slice(index + 2);
|
|
1828
|
+
}
|
|
1829
|
+
function DiscardLineComment(input) {
|
|
1830
|
+
const index = input.indexOf("\n");
|
|
1831
|
+
return IsEqual(index, -1) ? "" : input.slice(index);
|
|
1832
|
+
}
|
|
1833
|
+
function TrimStartUntilNewline(input) {
|
|
1834
|
+
return input.replace(/^[ \t\r\f\v]+/, "");
|
|
1835
|
+
}
|
|
1836
|
+
function TrimWhitespace(input) {
|
|
1837
|
+
const trimmed = TrimStartUntilNewline(input);
|
|
1838
|
+
return trimmed.startsWith(OpenComment) ? TrimWhitespace(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? TrimWhitespace(DiscardLineComment(trimmed.slice(2))) : trimmed;
|
|
1839
|
+
}
|
|
1840
|
+
function Trim(input) {
|
|
1841
|
+
const trimmed = input.trimStart();
|
|
1842
|
+
return trimmed.startsWith(OpenComment) ? Trim(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? Trim(DiscardLineComment(trimmed.slice(2))) : trimmed;
|
|
1843
|
+
}
|
|
1844
|
+
//#endregion
|
|
1845
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/optional.mjs
|
|
1846
|
+
/** Matches the given Value or empty string if no match. This function never fails */
|
|
1847
|
+
function Optional$1(value, input) {
|
|
1848
|
+
return Match$1(Take([value], input), (Optional, Rest) => [Optional, Rest], () => ["", input]);
|
|
1849
|
+
}
|
|
1850
|
+
//#endregion
|
|
1851
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/internal/many.mjs
|
|
1852
|
+
function IsDiscard(discard, input) {
|
|
1853
|
+
return discard.includes(input);
|
|
1854
|
+
}
|
|
1855
|
+
/** Takes characters from the Input until no-match. The Discard set is used to omit characters from the match */
|
|
1856
|
+
function Many(allowed, discard, input, result = "") {
|
|
1857
|
+
return Match$1(Take(allowed, input), (Char, Rest) => IsDiscard(discard, Char) ? Many(allowed, discard, Rest, result) : Many(allowed, discard, Rest, `${result}${Char}`), () => [result, input]);
|
|
1858
|
+
}
|
|
1859
|
+
//#endregion
|
|
1860
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/unsigned_integer.mjs
|
|
1861
|
+
function TakeNonZero(input) {
|
|
1862
|
+
return Take(NonZero, input);
|
|
1863
|
+
}
|
|
1864
|
+
const AllowedDigits$1 = [...Digit, "_"];
|
|
1865
|
+
function TakeDigits(input) {
|
|
1866
|
+
return Many(AllowedDigits$1, ["_"], input);
|
|
1867
|
+
}
|
|
1868
|
+
function TakeUnsignedInteger(input) {
|
|
1869
|
+
return Match$1(Take(["0"], input), (Zero, ZeroRest) => [Zero, ZeroRest], () => Match$1(TakeNonZero(input), (NonZero, NonZeroRest) => Match$1(TakeDigits(NonZeroRest), (Digits, DigitsRest) => [`${NonZero}${Digits}`, DigitsRest], () => []), () => []));
|
|
1870
|
+
}
|
|
1871
|
+
/** Matches if next is a UnsignedInteger */
|
|
1872
|
+
function UnsignedInteger(input) {
|
|
1873
|
+
return TakeUnsignedInteger(Trim(input));
|
|
1874
|
+
}
|
|
1875
|
+
//#endregion
|
|
1876
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/integer.mjs
|
|
1877
|
+
function TakeSign$1(input) {
|
|
1878
|
+
return Optional$1("-", input);
|
|
1879
|
+
}
|
|
1880
|
+
function TakeSignedInteger(input) {
|
|
1881
|
+
return Match$1(TakeSign$1(input), (Sign, SignRest) => Match$1(UnsignedInteger(SignRest), (UnsignedInteger, UnsignedIntegerRest) => [`${Sign}${UnsignedInteger}`, UnsignedIntegerRest], () => []), () => []);
|
|
1882
|
+
}
|
|
1883
|
+
/** Matches if next is a signed or unsigned Integer */
|
|
1884
|
+
function Integer(input) {
|
|
1885
|
+
return TakeSignedInteger(Trim(input));
|
|
1886
|
+
}
|
|
1887
|
+
//#endregion
|
|
1888
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/bigint.mjs
|
|
1889
|
+
function TakeBigInt(input) {
|
|
1890
|
+
return Match$1(Integer(input), (Integer, IntegerRest) => Match$1(Take(["n"], IntegerRest), (_N, NRest) => [`${Integer}`, NRest], () => []), () => []);
|
|
1891
|
+
}
|
|
1892
|
+
/** Matches if next is a Integer literal with trailing 'n'. Trailing 'n' is omitted in result. */
|
|
1893
|
+
function BigInt$1(input) {
|
|
1894
|
+
return TakeBigInt(input);
|
|
1895
|
+
}
|
|
1896
|
+
//#endregion
|
|
1897
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/const.mjs
|
|
1898
|
+
function TakeConst(const_, input) {
|
|
1899
|
+
return Take([const_], input);
|
|
1900
|
+
}
|
|
1901
|
+
/** Matches if next is the given Const value */
|
|
1902
|
+
function Const(const_, input) {
|
|
1903
|
+
return IsEqual(const_, "") ? ["", input] : const_.startsWith("\n") ? TakeConst(const_, TrimWhitespace(input)) : const_.startsWith(" ") ? TakeConst(const_, input) : TakeConst(const_, Trim(input));
|
|
1904
|
+
}
|
|
1905
|
+
//#endregion
|
|
1906
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/ident.mjs
|
|
1907
|
+
const Initial = [
|
|
1908
|
+
...Alpha,
|
|
1909
|
+
"_",
|
|
1910
|
+
"$"
|
|
1911
|
+
];
|
|
1912
|
+
function TakeInitial$1(input) {
|
|
1913
|
+
return Take(Initial, input);
|
|
1914
|
+
}
|
|
1915
|
+
const Remaining = [...Initial, ...Digit];
|
|
1916
|
+
function TakeRemaining(input, result = "") {
|
|
1917
|
+
return Match$1(Take(Remaining, input), (Remaining, RemainingRest) => TakeRemaining(RemainingRest, `${result}${Remaining}`), () => [result, input]);
|
|
1918
|
+
}
|
|
1919
|
+
function TakeIdent(input) {
|
|
1920
|
+
return Match$1(TakeInitial$1(input), (Initial, InitialRest) => Match$1(TakeRemaining(InitialRest), (Remaining, RemainingRest) => [`${Initial}${Remaining}`, RemainingRest], () => []), () => []);
|
|
1921
|
+
}
|
|
1922
|
+
/** Matches if next is an Ident */
|
|
1923
|
+
function Ident(input) {
|
|
1924
|
+
return TakeIdent(Trim(input));
|
|
1925
|
+
}
|
|
1926
|
+
//#endregion
|
|
1927
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/unsigned_number.mjs
|
|
1928
|
+
const AllowedDigits = [...Digit, "_"];
|
|
1929
|
+
function IsLeadingDot(input) {
|
|
1930
|
+
return IsMatch(Take(["."], input));
|
|
1931
|
+
}
|
|
1932
|
+
function TakeFractional(input) {
|
|
1933
|
+
return Match$1(Many(AllowedDigits, ["_"], input), (Digits, DigitsRest) => IsEqual(Digits, "") ? [] : [Digits, DigitsRest], () => []);
|
|
1934
|
+
}
|
|
1935
|
+
function LeadingDot(input) {
|
|
1936
|
+
return Match$1(Take(["."], input), (Dot, DotRest) => Match$1(TakeFractional(DotRest), (Fractional, FractionalRest) => [`0${Dot}${Fractional}`, FractionalRest], () => []), () => []);
|
|
1937
|
+
}
|
|
1938
|
+
function LeadingInteger(input) {
|
|
1939
|
+
return Match$1(UnsignedInteger(input), (Integer, IntegerRest) => Match$1(Take(["."], IntegerRest), (Dot, DotRest) => Match$1(TakeFractional(DotRest), (Fractional, FractionalRest) => [`${Integer}${Dot}${Fractional}`, FractionalRest], () => [`${Integer}`, DotRest]), () => [`${Integer}`, IntegerRest]), () => []);
|
|
1940
|
+
}
|
|
1941
|
+
function TakeUnsignedNumber(input) {
|
|
1942
|
+
return IsLeadingDot(input) ? LeadingDot(input) : LeadingInteger(input);
|
|
1943
|
+
}
|
|
1944
|
+
/** Matches if next is a UnsignedNumber */
|
|
1945
|
+
function UnsignedNumber(input) {
|
|
1946
|
+
return TakeUnsignedNumber(Trim(input));
|
|
1947
|
+
}
|
|
1948
|
+
//#endregion
|
|
1949
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/number.mjs
|
|
1950
|
+
function TakeSign(input) {
|
|
1951
|
+
return Optional$1("-", input);
|
|
1952
|
+
}
|
|
1953
|
+
function TakeSignedNumber(input) {
|
|
1954
|
+
return Match$1(TakeSign(input), (Sign, SignRest) => Match$1(UnsignedNumber(SignRest), (UnsignedInteger, UnsignedIntegerRest) => [`${Sign}${UnsignedInteger}`, UnsignedIntegerRest], () => []), () => []);
|
|
1955
|
+
}
|
|
1956
|
+
/** Matches if next is a signed or unsigned Number */
|
|
1957
|
+
function Number$1(input) {
|
|
1958
|
+
return TakeSignedNumber(Trim(input));
|
|
1959
|
+
}
|
|
1960
|
+
//#endregion
|
|
1961
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/until.mjs
|
|
1962
|
+
function TakeOne(input) {
|
|
1963
|
+
return IsEqual(input, "") ? [] : [input.slice(0, 1), input.slice(1)];
|
|
1964
|
+
}
|
|
1965
|
+
function IsInputMatchSentinal(end, input) {
|
|
1966
|
+
return ShiftLeft(end, (left, right) => input.startsWith(left) ? true : IsInputMatchSentinal(right, input), () => false);
|
|
1967
|
+
}
|
|
1968
|
+
/** Match Input until but not including End. No match if End not found. */
|
|
1969
|
+
function Until(end, input, result = "") {
|
|
1970
|
+
return Match$1(TakeOne(input), (One, Rest) => IsInputMatchSentinal(end, input) ? [result, input] : Until(end, Rest, `${result}${One}`), () => []);
|
|
1971
|
+
}
|
|
1972
|
+
//#endregion
|
|
1973
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/span.mjs
|
|
1974
|
+
function MultiLine(start, end, input) {
|
|
1975
|
+
return Match$1(Take([start], input), (_, Rest) => Match$1(Until([end], Rest), (Until, UntilRest) => Match$1(Take([end], UntilRest), (_, Rest) => [`${Until}`, Rest], () => []), () => []), () => []);
|
|
1976
|
+
}
|
|
1977
|
+
function SingleLine(start, end, input) {
|
|
1978
|
+
return Match$1(Take([start], input), (_, Rest) => Match$1(Until(["\n", end], Rest), (Until, UntilRest) => Match$1(Take([end], UntilRest), (_, EndRest) => [`${Until}`, EndRest], () => []), () => []), () => []);
|
|
1979
|
+
}
|
|
1980
|
+
/** Matches from Start and End capturing everything in-between. Start and End are consumed. */
|
|
1981
|
+
function Span(start, end, multiLine, input) {
|
|
1982
|
+
return multiLine ? MultiLine(start, end, Trim(input)) : SingleLine(start, end, Trim(input));
|
|
1983
|
+
}
|
|
1984
|
+
//#endregion
|
|
1985
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/string.mjs
|
|
1986
|
+
function TakeInitial(quotes, input) {
|
|
1987
|
+
return Take(quotes, input);
|
|
1988
|
+
}
|
|
1989
|
+
function TakeSpan(quote, input) {
|
|
1990
|
+
return Span(quote, quote, false, input);
|
|
1991
|
+
}
|
|
1992
|
+
function TakeString(quotes, input) {
|
|
1993
|
+
return Match$1(TakeInitial(quotes, input), (Initial, InitialRest) => TakeSpan(Initial, `${Initial}${InitialRest}`), () => []);
|
|
1994
|
+
}
|
|
1995
|
+
/** Matches a literal String with the given quotes */
|
|
1996
|
+
function String$1(quotes, input) {
|
|
1997
|
+
return TakeString(quotes, Trim(input));
|
|
1998
|
+
}
|
|
1999
|
+
//#endregion
|
|
2000
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/token/until_1.mjs
|
|
2001
|
+
/** Match Input until but not including End. No match if End not found or match is zero-length. */
|
|
2002
|
+
function Until_1(end, input) {
|
|
2003
|
+
return Match$1(Until(end, input), (Until, UntilRest) => IsEqual(Until, "") ? [] : [Until, UntilRest], () => []);
|
|
2004
|
+
}
|
|
2005
|
+
//#endregion
|
|
2006
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/parser.mjs
|
|
2007
|
+
const If = (result, left, right = () => []) => result.length === 2 ? left(result) : right();
|
|
2008
|
+
const GenericParameterExtendsEquals = (input) => If(If(Ident(input), ([_0, input]) => If(Const("extends", input), ([_1, input]) => If(Type(input), ([_2, input]) => If(Const("=", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
|
|
2009
|
+
_0,
|
|
2010
|
+
_1,
|
|
2011
|
+
_2,
|
|
2012
|
+
_3,
|
|
2013
|
+
_4
|
|
2014
|
+
], input]))))), ([_0, input]) => [GenericParameterExtendsEqualsMapping(_0), input]);
|
|
2015
|
+
const GenericParameterExtends = (input) => If(If(Ident(input), ([_0, input]) => If(Const("extends", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
|
|
2016
|
+
_0,
|
|
2017
|
+
_1,
|
|
2018
|
+
_2
|
|
2019
|
+
], input]))), ([_0, input]) => [GenericParameterExtendsMapping(_0), input]);
|
|
2020
|
+
const GenericParameterEquals = (input) => If(If(Ident(input), ([_0, input]) => If(Const("=", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
|
|
2021
|
+
_0,
|
|
2022
|
+
_1,
|
|
2023
|
+
_2
|
|
2024
|
+
], input]))), ([_0, input]) => [GenericParameterEqualsMapping(_0), input]);
|
|
2025
|
+
const GenericParameterIdentifier = (input) => If(Ident(input), ([_0, input]) => [GenericParameterIdentifierMapping(_0), input]);
|
|
2026
|
+
const GenericParameter = (input) => If(If(GenericParameterExtendsEquals(input), ([_0, input]) => [_0, input], () => If(GenericParameterExtends(input), ([_0, input]) => [_0, input], () => If(GenericParameterEquals(input), ([_0, input]) => [_0, input], () => If(GenericParameterIdentifier(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [GenericParameterMapping(_0), input]);
|
|
2027
|
+
const GenericParameterList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(GenericParameter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericParameterList_0(input, [...result, _0]), () => [result, input]);
|
|
2028
|
+
const GenericParameterList = (input) => If(If(If(GenericParameter(input), ([_0, input]) => If(GenericParameterList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
|
|
2029
|
+
_0,
|
|
2030
|
+
_1,
|
|
2031
|
+
_2
|
|
2032
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [GenericParameterListMapping(_0), input]);
|
|
2033
|
+
const GenericParameters = (input) => If(If(Const("<", input), ([_0, input]) => If(GenericParameterList(input), ([_1, input]) => If(Const(">", input), ([_2, input]) => [[
|
|
2034
|
+
_0,
|
|
2035
|
+
_1,
|
|
2036
|
+
_2
|
|
2037
|
+
], input]))), ([_0, input]) => [GenericParametersMapping(_0), input]);
|
|
2038
|
+
const GenericCallArgumentList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericCallArgumentList_0(input, [...result, _0]), () => [result, input]);
|
|
2039
|
+
const GenericCallArgumentList = (input) => If(If(If(Type(input), ([_0, input]) => If(GenericCallArgumentList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
|
|
2040
|
+
_0,
|
|
2041
|
+
_1,
|
|
2042
|
+
_2
|
|
2043
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [GenericCallArgumentListMapping(_0), input]);
|
|
2044
|
+
const GenericCallArguments = (input) => If(If(Const("<", input), ([_0, input]) => If(GenericCallArgumentList(input), ([_1, input]) => If(Const(">", input), ([_2, input]) => [[
|
|
2045
|
+
_0,
|
|
2046
|
+
_1,
|
|
2047
|
+
_2
|
|
2048
|
+
], input]))), ([_0, input]) => [GenericCallArgumentsMapping(_0), input]);
|
|
2049
|
+
const GenericCall = (input) => If(If(Ident(input), ([_0, input]) => If(GenericCallArguments(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [GenericCallMapping(_0), input]);
|
|
2050
|
+
const OptionalSemiColon = (input) => If(If(If(Const(";", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [OptionalSemiColonMapping(_0), input]);
|
|
2051
|
+
const KeywordString = (input) => If(Const("string", input), ([_0, input]) => [KeywordStringMapping(_0), input]);
|
|
2052
|
+
const KeywordNumber = (input) => If(Const("number", input), ([_0, input]) => [KeywordNumberMapping(_0), input]);
|
|
2053
|
+
const KeywordBoolean = (input) => If(Const("boolean", input), ([_0, input]) => [KeywordBooleanMapping(_0), input]);
|
|
2054
|
+
const KeywordUndefined = (input) => If(Const("undefined", input), ([_0, input]) => [KeywordUndefinedMapping(_0), input]);
|
|
2055
|
+
const KeywordNull = (input) => If(Const("null", input), ([_0, input]) => [KeywordNullMapping(_0), input]);
|
|
2056
|
+
const KeywordInteger = (input) => If(Const("integer", input), ([_0, input]) => [KeywordIntegerMapping(_0), input]);
|
|
2057
|
+
const KeywordBigInt = (input) => If(Const("bigint", input), ([_0, input]) => [KeywordBigIntMapping(_0), input]);
|
|
2058
|
+
const KeywordUnknown = (input) => If(Const("unknown", input), ([_0, input]) => [KeywordUnknownMapping(_0), input]);
|
|
2059
|
+
const KeywordAny = (input) => If(Const("any", input), ([_0, input]) => [KeywordAnyMapping(_0), input]);
|
|
2060
|
+
const KeywordObject = (input) => If(Const("object", input), ([_0, input]) => [KeywordObjectMapping(_0), input]);
|
|
2061
|
+
const KeywordNever = (input) => If(Const("never", input), ([_0, input]) => [KeywordNeverMapping(_0), input]);
|
|
2062
|
+
const KeywordSymbol = (input) => If(Const("symbol", input), ([_0, input]) => [KeywordSymbolMapping(_0), input]);
|
|
2063
|
+
const KeywordVoid = (input) => If(Const("void", input), ([_0, input]) => [KeywordVoidMapping(_0), input]);
|
|
2064
|
+
const KeywordThis = (input) => If(Const("this", input), ([_0, input]) => [KeywordThisMapping(_0), input]);
|
|
2065
|
+
const TemplateInterpolate = (input) => If(If(Const("${", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("}", input), ([_2, input]) => [[
|
|
2066
|
+
_0,
|
|
2067
|
+
_1,
|
|
2068
|
+
_2
|
|
2069
|
+
], input]))), ([_0, input]) => [TemplateInterpolateMapping(_0), input]);
|
|
2070
|
+
const TemplateSpan = (input) => If(Until(["${", "`"], input), ([_0, input]) => [TemplateSpanMapping(_0), input]);
|
|
2071
|
+
const TemplateBody = (input) => If(If(If(TemplateSpan(input), ([_0, input]) => If(TemplateInterpolate(input), ([_1, input]) => If(TemplateBody(input), ([_2, input]) => [[
|
|
2072
|
+
_0,
|
|
2073
|
+
_1,
|
|
2074
|
+
_2
|
|
2075
|
+
], input]))), ([_0, input]) => [_0, input], () => If(If(TemplateSpan(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(TemplateSpan(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [TemplateBodyMapping(_0), input]);
|
|
2076
|
+
const TemplateLiteralTypes = (input) => If(If(Const("`", input), ([_0, input]) => If(TemplateBody(input), ([_1, input]) => If(Const("`", input), ([_2, input]) => [[
|
|
2077
|
+
_0,
|
|
2078
|
+
_1,
|
|
2079
|
+
_2
|
|
2080
|
+
], input]))), ([_0, input]) => [TemplateLiteralTypesMapping(_0), input]);
|
|
2081
|
+
const TemplateLiteral$1 = (input) => If(TemplateLiteralTypes(input), ([_0, input]) => [TemplateLiteralMapping(_0), input]);
|
|
2082
|
+
const Dependent = (input) => If(If(If(Const("if", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("then", input), ([_2, input]) => If(Type(input), ([_3, input]) => If(Const("else", input), ([_4, input]) => If(Type(input), ([_5, input]) => [[
|
|
2083
|
+
_0,
|
|
2084
|
+
_1,
|
|
2085
|
+
_2,
|
|
2086
|
+
_3,
|
|
2087
|
+
_4,
|
|
2088
|
+
_5
|
|
2089
|
+
], input])))))), ([_0, input]) => [_0, input], () => If(If(Const("if", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("then", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
|
|
2090
|
+
_0,
|
|
2091
|
+
_1,
|
|
2092
|
+
_2,
|
|
2093
|
+
_3
|
|
2094
|
+
], input])))), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [DependentMapping(_0), input]);
|
|
2095
|
+
const LiteralBigInt = (input) => If(BigInt$1(input), ([_0, input]) => [LiteralBigIntMapping(_0), input]);
|
|
2096
|
+
const LiteralBoolean = (input) => If(If(Const("true", input), ([_0, input]) => [_0, input], () => If(Const("false", input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [LiteralBooleanMapping(_0), input]);
|
|
2097
|
+
const LiteralNumber = (input) => If(Number$1(input), ([_0, input]) => [LiteralNumberMapping(_0), input]);
|
|
2098
|
+
const LiteralString = (input) => If(String$1(["'", "\""], input), ([_0, input]) => [LiteralStringMapping(_0), input]);
|
|
2099
|
+
const KeyOf$1 = (input) => If(If(If(Const("keyof", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [KeyOfMapping(_0), input]);
|
|
2100
|
+
const IndexArray_0 = (input, result = []) => If(If(If(Const("[", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
|
|
2101
|
+
_0,
|
|
2102
|
+
_1,
|
|
2103
|
+
_2
|
|
2104
|
+
], input]))), ([_0, input]) => [_0, input], () => If(If(Const("[", input), ([_0, input]) => If(Const("]", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => IndexArray_0(input, [...result, _0]), () => [result, input]);
|
|
2105
|
+
const IndexArray = (input) => If(IndexArray_0(input), ([_0, input]) => [IndexArrayMapping(_0), input]);
|
|
2106
|
+
const Extends$1 = (input) => If(If(If(Const("extends", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("?", input), ([_2, input]) => If(Type(input), ([_3, input]) => If(Const(":", input), ([_4, input]) => If(Type(input), ([_5, input]) => [[
|
|
2107
|
+
_0,
|
|
2108
|
+
_1,
|
|
2109
|
+
_2,
|
|
2110
|
+
_3,
|
|
2111
|
+
_4,
|
|
2112
|
+
_5
|
|
2113
|
+
], input])))))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ExtendsMapping(_0), input]);
|
|
2114
|
+
const Base = (input) => If(If(If(Const("(", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const(")", input), ([_2, input]) => [[
|
|
2115
|
+
_0,
|
|
2116
|
+
_1,
|
|
2117
|
+
_2
|
|
2118
|
+
], input]))), ([_0, input]) => [_0, input], () => If(KeywordString(input), ([_0, input]) => [_0, input], () => If(KeywordNumber(input), ([_0, input]) => [_0, input], () => If(KeywordBoolean(input), ([_0, input]) => [_0, input], () => If(KeywordUndefined(input), ([_0, input]) => [_0, input], () => If(KeywordNull(input), ([_0, input]) => [_0, input], () => If(KeywordInteger(input), ([_0, input]) => [_0, input], () => If(KeywordBigInt(input), ([_0, input]) => [_0, input], () => If(KeywordUnknown(input), ([_0, input]) => [_0, input], () => If(KeywordAny(input), ([_0, input]) => [_0, input], () => If(KeywordObject(input), ([_0, input]) => [_0, input], () => If(KeywordNever(input), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input), ([_0, input]) => [_0, input], () => If(KeywordVoid(input), ([_0, input]) => [_0, input], () => If(KeywordThis(input), ([_0, input]) => [_0, input], () => If(LiteralBigInt(input), ([_0, input]) => [_0, input], () => If(LiteralBoolean(input), ([_0, input]) => [_0, input], () => If(LiteralNumber(input), ([_0, input]) => [_0, input], () => If(LiteralString(input), ([_0, input]) => [_0, input], () => If(TemplateLiteral$1(input), ([_0, input]) => [_0, input], () => If(Dependent(input), ([_0, input]) => [_0, input], () => If(_Object_(input), ([_0, input]) => [_0, input], () => If(_Tuple_(input), ([_0, input]) => [_0, input], () => If(_Constructor_(input), ([_0, input]) => [_0, input], () => If(_Function_(input), ([_0, input]) => [_0, input], () => If(_Mapped_(input), ([_0, input]) => [_0, input], () => If(GenericCall(input), ([_0, input]) => [_0, input], () => If(Reference(input), ([_0, input]) => [_0, input], () => [])))))))))))))))))))))))))))), ([_0, input]) => [BaseMapping(_0), input]);
|
|
2119
|
+
const With$1 = (input) => If(If(If(Const("with", input), ([_0, input]) => If(WithObject(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithMapping(_0), input]);
|
|
2120
|
+
const Factor = (input) => If(If(KeyOf$1(input), ([_0, input]) => If(Base(input), ([_1, input]) => If(IndexArray(input), ([_2, input]) => If(Extends$1(input), ([_3, input]) => If(With$1(input), ([_4, input]) => [[
|
|
2121
|
+
_0,
|
|
2122
|
+
_1,
|
|
2123
|
+
_2,
|
|
2124
|
+
_3,
|
|
2125
|
+
_4
|
|
2126
|
+
], input]))))), ([_0, input]) => [FactorMapping(_0), input]);
|
|
2127
|
+
const ExprTermTail = (input) => If(If(If(Const("&", input), ([_0, input]) => If(Factor(input), ([_1, input]) => If(ExprTermTail(input), ([_2, input]) => [[
|
|
2128
|
+
_0,
|
|
2129
|
+
_1,
|
|
2130
|
+
_2
|
|
2131
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ExprTermTailMapping(_0), input]);
|
|
2132
|
+
const ExprTerm = (input) => If(If(Factor(input), ([_0, input]) => If(ExprTermTail(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ExprTermMapping(_0), input]);
|
|
2133
|
+
const ExprTail = (input) => If(If(If(Const("|", input), ([_0, input]) => If(ExprTerm(input), ([_1, input]) => If(ExprTail(input), ([_2, input]) => [[
|
|
2134
|
+
_0,
|
|
2135
|
+
_1,
|
|
2136
|
+
_2
|
|
2137
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ExprTailMapping(_0), input]);
|
|
2138
|
+
const Expr = (input) => If(If(ExprTerm(input), ([_0, input]) => If(ExprTail(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ExprMapping(_0), input]);
|
|
2139
|
+
const ExprReadonly = (input) => If(If(Const("readonly", input), ([_0, input]) => If(Expr(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ExprReadonlyMapping(_0), input]);
|
|
2140
|
+
const ExprPipe = (input) => If(If(Const("|", input), ([_0, input]) => If(Expr(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ExprPipeMapping(_0), input]);
|
|
2141
|
+
const GenericType = (input) => If(If(GenericParameters(input), ([_0, input]) => If(Const("=", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
|
|
2142
|
+
_0,
|
|
2143
|
+
_1,
|
|
2144
|
+
_2
|
|
2145
|
+
], input]))), ([_0, input]) => [GenericTypeMapping(_0), input]);
|
|
2146
|
+
const InferType = (input) => If(If(If(Const("infer", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(Const("extends", input), ([_2, input]) => If(Expr(input), ([_3, input]) => [[
|
|
2147
|
+
_0,
|
|
2148
|
+
_1,
|
|
2149
|
+
_2,
|
|
2150
|
+
_3
|
|
2151
|
+
], input])))), ([_0, input]) => [_0, input], () => If(If(Const("infer", input), ([_0, input]) => If(Ident(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [InferTypeMapping(_0), input]);
|
|
2152
|
+
const Type = (input) => If(If(InferType(input), ([_0, input]) => [_0, input], () => If(ExprPipe(input), ([_0, input]) => [_0, input], () => If(ExprReadonly(input), ([_0, input]) => [_0, input], () => If(Expr(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [TypeMapping(_0), input]);
|
|
2153
|
+
const PropertyKeyNumber = (input) => If(Number$1(input), ([_0, input]) => [PropertyKeyNumberMapping(_0), input]);
|
|
2154
|
+
const PropertyKeyIdent = (input) => If(Ident(input), ([_0, input]) => [PropertyKeyIdentMapping(_0), input]);
|
|
2155
|
+
const PropertyKeyQuoted = (input) => If(String$1(["'", "\""], input), ([_0, input]) => [PropertyKeyQuotedMapping(_0), input]);
|
|
2156
|
+
const PropertyKeyIndex = (input) => If(If(Const("[", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(If(KeywordInteger(input), ([_0, input]) => [_0, input], () => If(KeywordNumber(input), ([_0, input]) => [_0, input], () => If(KeywordString(input), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input), ([_0, input]) => [_0, input], () => [])))), ([_3, input]) => If(Const("]", input), ([_4, input]) => [[
|
|
2157
|
+
_0,
|
|
2158
|
+
_1,
|
|
2159
|
+
_2,
|
|
2160
|
+
_3,
|
|
2161
|
+
_4
|
|
2162
|
+
], input]))))), ([_0, input]) => [PropertyKeyIndexMapping(_0), input]);
|
|
2163
|
+
const PropertyKey = (input) => If(If(PropertyKeyNumber(input), ([_0, input]) => [_0, input], () => If(PropertyKeyIdent(input), ([_0, input]) => [_0, input], () => If(PropertyKeyQuoted(input), ([_0, input]) => [_0, input], () => If(PropertyKeyIndex(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [PropertyKeyMapping(_0), input]);
|
|
2164
|
+
const Readonly = (input) => If(If(If(Const("readonly", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ReadonlyMapping(_0), input]);
|
|
2165
|
+
const Optional = (input) => If(If(If(Const("?", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [OptionalMapping(_0), input]);
|
|
2166
|
+
const Property = (input) => If(If(Readonly(input), ([_0, input]) => If(PropertyKey(input), ([_1, input]) => If(Optional(input), ([_2, input]) => If(Const(":", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
|
|
2167
|
+
_0,
|
|
2168
|
+
_1,
|
|
2169
|
+
_2,
|
|
2170
|
+
_3,
|
|
2171
|
+
_4
|
|
2172
|
+
], input]))))), ([_0, input]) => [PropertyMapping(_0), input]);
|
|
2173
|
+
const PropertyDelimiter = (input) => If(If(If(Const(",", input), ([_0, input]) => If(Const("\n", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const(";", input), ([_0, input]) => If(Const("\n", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const(",", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Const(";", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Const("\n", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))))), ([_0, input]) => [PropertyDelimiterMapping(_0), input]);
|
|
2174
|
+
const PropertyList_0 = (input, result = []) => If(If(PropertyDelimiter(input), ([_0, input]) => If(Property(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => PropertyList_0(input, [...result, _0]), () => [result, input]);
|
|
2175
|
+
const PropertyList = (input) => If(If(If(Property(input), ([_0, input]) => If(PropertyList_0(input), ([_1, input]) => If(If(PropertyDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
|
|
2176
|
+
_0,
|
|
2177
|
+
_1,
|
|
2178
|
+
_2
|
|
2179
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [PropertyListMapping(_0), input]);
|
|
2180
|
+
const Properties = (input) => If(If(Const("{", input), ([_0, input]) => If(PropertyList(input), ([_1, input]) => If(Const("}", input), ([_2, input]) => [[
|
|
2181
|
+
_0,
|
|
2182
|
+
_1,
|
|
2183
|
+
_2
|
|
2184
|
+
], input]))), ([_0, input]) => [PropertiesMapping(_0), input]);
|
|
2185
|
+
const _Object_ = (input) => If(Properties(input), ([_0, input]) => [_Object_Mapping(_0), input]);
|
|
2186
|
+
const ElementNamed = (input) => If(If(If(Ident(input), ([_0, input]) => If(Const("?", input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(Const("readonly", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
|
|
2187
|
+
_0,
|
|
2188
|
+
_1,
|
|
2189
|
+
_2,
|
|
2190
|
+
_3,
|
|
2191
|
+
_4
|
|
2192
|
+
], input]))))), ([_0, input]) => [_0, input], () => If(If(Ident(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(Const("readonly", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
|
|
2193
|
+
_0,
|
|
2194
|
+
_1,
|
|
2195
|
+
_2,
|
|
2196
|
+
_3
|
|
2197
|
+
], input])))), ([_0, input]) => [_0, input], () => If(If(Ident(input), ([_0, input]) => If(Const("?", input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
|
|
2198
|
+
_0,
|
|
2199
|
+
_1,
|
|
2200
|
+
_2,
|
|
2201
|
+
_3
|
|
2202
|
+
], input])))), ([_0, input]) => [_0, input], () => If(If(Ident(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
|
|
2203
|
+
_0,
|
|
2204
|
+
_1,
|
|
2205
|
+
_2
|
|
2206
|
+
], input]))), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [ElementNamedMapping(_0), input]);
|
|
2207
|
+
const ElementBase = (input) => If(If(ElementNamed(input), ([_0, input]) => [_0, input], () => If(If(Readonly(input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Optional(input), ([_2, input]) => [[
|
|
2208
|
+
_0,
|
|
2209
|
+
_1,
|
|
2210
|
+
_2
|
|
2211
|
+
], input]))), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ElementBaseMapping(_0), input]);
|
|
2212
|
+
const Element = (input) => If(If(If(Const("...", input), ([_0, input]) => If(ElementBase(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(ElementBase(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ElementMapping(_0), input]);
|
|
2213
|
+
const ElementList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(Element(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ElementList_0(input, [...result, _0]), () => [result, input]);
|
|
2214
|
+
const ElementList = (input) => If(If(If(Element(input), ([_0, input]) => If(ElementList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
|
|
2215
|
+
_0,
|
|
2216
|
+
_1,
|
|
2217
|
+
_2
|
|
2218
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ElementListMapping(_0), input]);
|
|
2219
|
+
const _Tuple_ = (input) => If(If(Const("[", input), ([_0, input]) => If(ElementList(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
|
|
2220
|
+
_0,
|
|
2221
|
+
_1,
|
|
2222
|
+
_2
|
|
2223
|
+
], input]))), ([_0, input]) => [_Tuple_Mapping(_0), input]);
|
|
2224
|
+
const ParameterReadonlyOptional = (input) => If(If(Ident(input), ([_0, input]) => If(Const("?", input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(Const("readonly", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
|
|
2225
|
+
_0,
|
|
2226
|
+
_1,
|
|
2227
|
+
_2,
|
|
2228
|
+
_3,
|
|
2229
|
+
_4
|
|
2230
|
+
], input]))))), ([_0, input]) => [ParameterReadonlyOptionalMapping(_0), input]);
|
|
2231
|
+
const ParameterReadonly = (input) => If(If(Ident(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(Const("readonly", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
|
|
2232
|
+
_0,
|
|
2233
|
+
_1,
|
|
2234
|
+
_2,
|
|
2235
|
+
_3
|
|
2236
|
+
], input])))), ([_0, input]) => [ParameterReadonlyMapping(_0), input]);
|
|
2237
|
+
const ParameterOptional = (input) => If(If(Ident(input), ([_0, input]) => If(Const("?", input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
|
|
2238
|
+
_0,
|
|
2239
|
+
_1,
|
|
2240
|
+
_2,
|
|
2241
|
+
_3
|
|
2242
|
+
], input])))), ([_0, input]) => [ParameterOptionalMapping(_0), input]);
|
|
2243
|
+
const ParameterType = (input) => If(If(Ident(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(Type(input), ([_2, input]) => [[
|
|
2244
|
+
_0,
|
|
2245
|
+
_1,
|
|
2246
|
+
_2
|
|
2247
|
+
], input]))), ([_0, input]) => [ParameterTypeMapping(_0), input]);
|
|
2248
|
+
const ParameterBase = (input) => If(If(ParameterReadonlyOptional(input), ([_0, input]) => [_0, input], () => If(ParameterReadonly(input), ([_0, input]) => [_0, input], () => If(ParameterOptional(input), ([_0, input]) => [_0, input], () => If(ParameterType(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [ParameterBaseMapping(_0), input]);
|
|
2249
|
+
const Parameter = (input) => If(If(If(Const("...", input), ([_0, input]) => If(ParameterBase(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(ParameterBase(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ParameterMapping(_0), input]);
|
|
2250
|
+
const ParameterList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(Parameter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ParameterList_0(input, [...result, _0]), () => [result, input]);
|
|
2251
|
+
const ParameterList = (input) => If(If(If(Parameter(input), ([_0, input]) => If(ParameterList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
|
|
2252
|
+
_0,
|
|
2253
|
+
_1,
|
|
2254
|
+
_2
|
|
2255
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ParameterListMapping(_0), input]);
|
|
2256
|
+
const _Function_ = (input) => If(If(Const("(", input), ([_0, input]) => If(ParameterList(input), ([_1, input]) => If(Const(")", input), ([_2, input]) => If(Const("=>", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
|
|
2257
|
+
_0,
|
|
2258
|
+
_1,
|
|
2259
|
+
_2,
|
|
2260
|
+
_3,
|
|
2261
|
+
_4
|
|
2262
|
+
], input]))))), ([_0, input]) => [_Function_Mapping(_0), input]);
|
|
2263
|
+
const _Constructor_ = (input) => If(If(Const("new", input), ([_0, input]) => If(Const("(", input), ([_1, input]) => If(ParameterList(input), ([_2, input]) => If(Const(")", input), ([_3, input]) => If(Const("=>", input), ([_4, input]) => If(Type(input), ([_5, input]) => [[
|
|
2264
|
+
_0,
|
|
2265
|
+
_1,
|
|
2266
|
+
_2,
|
|
2267
|
+
_3,
|
|
2268
|
+
_4,
|
|
2269
|
+
_5
|
|
2270
|
+
], input])))))), ([_0, input]) => [_Constructor_Mapping(_0), input]);
|
|
2271
|
+
const MappedReadonly = (input) => If(If(If(Const("+", input), ([_0, input]) => If(Const("readonly", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("-", input), ([_0, input]) => If(Const("readonly", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("readonly", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [MappedReadonlyMapping(_0), input]);
|
|
2272
|
+
const MappedOptional = (input) => If(If(If(Const("+", input), ([_0, input]) => If(Const("?", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("-", input), ([_0, input]) => If(Const("?", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("?", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [MappedOptionalMapping(_0), input]);
|
|
2273
|
+
const MappedAs = (input) => If(If(If(Const("as", input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [MappedAsMapping(_0), input]);
|
|
2274
|
+
const _Mapped_ = (input) => If(If(Const("{", input), ([_0, input]) => If(MappedReadonly(input), ([_1, input]) => If(Const("[", input), ([_2, input]) => If(Ident(input), ([_3, input]) => If(Const("in", input), ([_4, input]) => If(Type(input), ([_5, input]) => If(MappedAs(input), ([_6, input]) => If(Const("]", input), ([_7, input]) => If(MappedOptional(input), ([_8, input]) => If(Const(":", input), ([_9, input]) => If(Type(input), ([_10, input]) => If(OptionalSemiColon(input), ([_11, input]) => If(Const("}", input), ([_12, input]) => [[
|
|
2275
|
+
_0,
|
|
2276
|
+
_1,
|
|
2277
|
+
_2,
|
|
2278
|
+
_3,
|
|
2279
|
+
_4,
|
|
2280
|
+
_5,
|
|
2281
|
+
_6,
|
|
2282
|
+
_7,
|
|
2283
|
+
_8,
|
|
2284
|
+
_9,
|
|
2285
|
+
_10,
|
|
2286
|
+
_11,
|
|
2287
|
+
_12
|
|
2288
|
+
], input]))))))))))))), ([_0, input]) => [_Mapped_Mapping(_0), input]);
|
|
2289
|
+
const Reference = (input) => If(Ident(input), ([_0, input]) => [ReferenceMapping(_0), input]);
|
|
2290
|
+
const WithBigInt = (input) => If(BigInt$1(input), ([_0, input]) => [WithBigIntMapping(_0), input]);
|
|
2291
|
+
const WithNumber = (input) => If(Number$1(input), ([_0, input]) => [WithNumberMapping(_0), input]);
|
|
2292
|
+
const WithBoolean = (input) => If(If(Const("true", input), ([_0, input]) => [_0, input], () => If(Const("false", input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithBooleanMapping(_0), input]);
|
|
2293
|
+
const WithString = (input) => If(String$1(["\"", "'"], input), ([_0, input]) => [WithStringMapping(_0), input]);
|
|
2294
|
+
const WithNull = (input) => If(Const("null", input), ([_0, input]) => [WithNullMapping(_0), input]);
|
|
2295
|
+
const WithUndefined = (input) => If(Const("undefined", input), ([_0, input]) => [void 0, input]);
|
|
2296
|
+
const WithProperty = (input) => If(If(PropertyKey(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(WithValue(input), ([_2, input]) => [[
|
|
2297
|
+
_0,
|
|
2298
|
+
_1,
|
|
2299
|
+
_2
|
|
2300
|
+
], input]))), ([_0, input]) => [WithPropertyMapping(_0), input]);
|
|
2301
|
+
const WithPropertyList_0 = (input, result = []) => If(If(PropertyDelimiter(input), ([_0, input]) => If(WithProperty(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithPropertyList_0(input, [...result, _0]), () => [result, input]);
|
|
2302
|
+
const WithPropertyList = (input) => If(If(If(WithProperty(input), ([_0, input]) => If(WithPropertyList_0(input), ([_1, input]) => If(If(PropertyDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
|
|
2303
|
+
_0,
|
|
2304
|
+
_1,
|
|
2305
|
+
_2
|
|
2306
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithPropertyListMapping(_0), input]);
|
|
2307
|
+
const WithObject = (input) => If(If(Const("{", input), ([_0, input]) => If(WithPropertyList(input), ([_1, input]) => If(Const("}", input), ([_2, input]) => [[
|
|
2308
|
+
_0,
|
|
2309
|
+
_1,
|
|
2310
|
+
_2
|
|
2311
|
+
], input]))), ([_0, input]) => [WithObjectMapping(_0), input]);
|
|
2312
|
+
const WithElementList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(WithValue(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithElementList_0(input, [...result, _0]), () => [result, input]);
|
|
2313
|
+
const WithElementList = (input) => If(If(If(WithValue(input), ([_0, input]) => If(WithElementList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
|
|
2314
|
+
_0,
|
|
2315
|
+
_1,
|
|
2316
|
+
_2
|
|
2317
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithElementListMapping(_0), input]);
|
|
2318
|
+
const WithArray = (input) => If(If(Const("[", input), ([_0, input]) => If(WithElementList(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
|
|
2319
|
+
_0,
|
|
2320
|
+
_1,
|
|
2321
|
+
_2
|
|
2322
|
+
], input]))), ([_0, input]) => [WithArrayMapping(_0), input]);
|
|
2323
|
+
const WithValue = (input) => If(If(WithBigInt(input), ([_0, input]) => [_0, input], () => If(WithNumber(input), ([_0, input]) => [_0, input], () => If(WithBoolean(input), ([_0, input]) => [_0, input], () => If(WithString(input), ([_0, input]) => [_0, input], () => If(WithNull(input), ([_0, input]) => [_0, input], () => If(WithUndefined(input), ([_0, input]) => [_0, input], () => If(WithObject(input), ([_0, input]) => [_0, input], () => If(WithArray(input), ([_0, input]) => [_0, input], () => [])))))))), ([_0, input]) => [WithValueMapping(_0), input]);
|
|
2324
|
+
const PatternBigInt = (input) => If(Const("-?(?:0|[1-9][0-9]*)n", input), ([_0, input]) => [PatternBigIntMapping(_0), input]);
|
|
2325
|
+
const PatternString = (input) => If(Const(".*", input), ([_0, input]) => [PatternStringMapping(_0), input]);
|
|
2326
|
+
const PatternNumber = (input) => If(Const("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?", input), ([_0, input]) => [PatternNumberMapping(_0), input]);
|
|
2327
|
+
const PatternInteger = (input) => If(Const("-?(?:0|[1-9][0-9]*)", input), ([_0, input]) => [PatternIntegerMapping(_0), input]);
|
|
2328
|
+
const PatternNever = (input) => If(Const("(?!)", input), ([_0, input]) => [PatternNeverMapping(_0), input]);
|
|
2329
|
+
const PatternText = (input) => If(Until_1([
|
|
2330
|
+
"-?(?:0|[1-9][0-9]*)n",
|
|
2331
|
+
".*",
|
|
2332
|
+
"-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",
|
|
2333
|
+
"-?(?:0|[1-9][0-9]*)",
|
|
2334
|
+
"(?!)",
|
|
2335
|
+
"(",
|
|
2336
|
+
")",
|
|
2337
|
+
"$",
|
|
2338
|
+
"|"
|
|
2339
|
+
], input), ([_0, input]) => [PatternTextMapping(_0), input]);
|
|
2340
|
+
const PatternBase = (input) => If(If(PatternBigInt(input), ([_0, input]) => [_0, input], () => If(PatternString(input), ([_0, input]) => [_0, input], () => If(PatternNumber(input), ([_0, input]) => [_0, input], () => If(PatternInteger(input), ([_0, input]) => [_0, input], () => If(PatternNever(input), ([_0, input]) => [_0, input], () => If(PatternGroup(input), ([_0, input]) => [_0, input], () => If(PatternText(input), ([_0, input]) => [_0, input], () => []))))))), ([_0, input]) => [PatternBaseMapping(_0), input]);
|
|
2341
|
+
const PatternGroup = (input) => If(If(Const("(", input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Const(")", input), ([_2, input]) => [[
|
|
2342
|
+
_0,
|
|
2343
|
+
_1,
|
|
2344
|
+
_2
|
|
2345
|
+
], input]))), ([_0, input]) => [PatternGroupMapping(_0), input]);
|
|
2346
|
+
const PatternUnion = (input) => If(If(If(PatternTerm(input), ([_0, input]) => If(Const("|", input), ([_1, input]) => If(PatternUnion(input), ([_2, input]) => [[
|
|
2347
|
+
_0,
|
|
2348
|
+
_1,
|
|
2349
|
+
_2
|
|
2350
|
+
], input]))), ([_0, input]) => [_0, input], () => If(If(PatternTerm(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [PatternUnionMapping(_0), input]);
|
|
2351
|
+
const PatternTerm = (input) => If(If(PatternBase(input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [PatternTermMapping(_0), input]);
|
|
2352
|
+
const PatternBody = (input) => If(If(PatternUnion(input), ([_0, input]) => [_0, input], () => If(PatternTerm(input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [PatternBodyMapping(_0), input]);
|
|
2353
|
+
const Pattern = (input) => If(If(Const("^", input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Const("$", input), ([_2, input]) => [[
|
|
2354
|
+
_0,
|
|
2355
|
+
_1,
|
|
2356
|
+
_2
|
|
2357
|
+
], input]))), ([_0, input]) => [PatternMapping(_0), input]);
|
|
2358
|
+
const InterfaceDeclarationHeritageList_0 = (input, result = []) => If(If(Const(",", input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => InterfaceDeclarationHeritageList_0(input, [...result, _0]), () => [result, input]);
|
|
2359
|
+
const InterfaceDeclarationHeritageList = (input) => If(If(If(Type(input), ([_0, input]) => If(InterfaceDeclarationHeritageList_0(input), ([_1, input]) => If(If(Const(",", input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
|
|
2360
|
+
_0,
|
|
2361
|
+
_1,
|
|
2362
|
+
_2
|
|
2363
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [InterfaceDeclarationHeritageListMapping(_0), input]);
|
|
2364
|
+
const InterfaceDeclarationHeritage = (input) => If(If(If(Const("extends", input), ([_0, input]) => If(InterfaceDeclarationHeritageList(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [InterfaceDeclarationHeritageMapping(_0), input]);
|
|
2365
|
+
const InterfaceDeclarationGeneric = (input) => If(If(Const("interface", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(GenericParameters(input), ([_2, input]) => If(InterfaceDeclarationHeritage(input), ([_3, input]) => If(Properties(input), ([_4, input]) => [[
|
|
2366
|
+
_0,
|
|
2367
|
+
_1,
|
|
2368
|
+
_2,
|
|
2369
|
+
_3,
|
|
2370
|
+
_4
|
|
2371
|
+
], input]))))), ([_0, input]) => [InterfaceDeclarationGenericMapping(_0), input]);
|
|
2372
|
+
const InterfaceDeclaration = (input) => If(If(Const("interface", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(InterfaceDeclarationHeritage(input), ([_2, input]) => If(Properties(input), ([_3, input]) => [[
|
|
2373
|
+
_0,
|
|
2374
|
+
_1,
|
|
2375
|
+
_2,
|
|
2376
|
+
_3
|
|
2377
|
+
], input])))), ([_0, input]) => [InterfaceDeclarationMapping(_0), input]);
|
|
2378
|
+
const TypeAliasDeclarationGeneric = (input) => If(If(Const("type", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(GenericParameters(input), ([_2, input]) => If(Const("=", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
|
|
2379
|
+
_0,
|
|
2380
|
+
_1,
|
|
2381
|
+
_2,
|
|
2382
|
+
_3,
|
|
2383
|
+
_4
|
|
2384
|
+
], input]))))), ([_0, input]) => [TypeAliasDeclarationGenericMapping(_0), input]);
|
|
2385
|
+
const TypeAliasDeclaration = (input) => If(If(Const("type", input), ([_0, input]) => If(Ident(input), ([_1, input]) => If(Const("=", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
|
|
2386
|
+
_0,
|
|
2387
|
+
_1,
|
|
2388
|
+
_2,
|
|
2389
|
+
_3
|
|
2390
|
+
], input])))), ([_0, input]) => [TypeAliasDeclarationMapping(_0), input]);
|
|
2391
|
+
const ExportKeyword = (input) => If(If(If(Const("export", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ExportKeywordMapping(_0), input]);
|
|
2392
|
+
const ModuleDeclarationDelimiter = (input) => If(If(If(Const(";", input), ([_0, input]) => If(Const("\n", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const(";", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Const("\n", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [ModuleDeclarationDelimiterMapping(_0), input]);
|
|
2393
|
+
const ModuleDeclarationList_0 = (input, result = []) => If(If(ModuleDeclarationDelimiter(input), ([_0, input]) => If(ModuleDeclaration(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ModuleDeclarationList_0(input, [...result, _0]), () => [result, input]);
|
|
2394
|
+
const ModuleDeclarationList = (input) => If(If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationList_0(input), ([_1, input]) => If(If(ModuleDeclarationDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[
|
|
2395
|
+
_0,
|
|
2396
|
+
_1,
|
|
2397
|
+
_2
|
|
2398
|
+
], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ModuleDeclarationListMapping(_0), input]);
|
|
2399
|
+
const ModuleDeclaration = (input) => If(If(ExportKeyword(input), ([_0, input]) => If(If(InterfaceDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(InterfaceDeclaration(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclaration(input), ([_0, input]) => [_0, input], () => [])))), ([_1, input]) => If(OptionalSemiColon(input), ([_2, input]) => [[
|
|
2400
|
+
_0,
|
|
2401
|
+
_1,
|
|
2402
|
+
_2
|
|
2403
|
+
], input]))), ([_0, input]) => [ModuleDeclarationMapping(_0), input]);
|
|
2404
|
+
const Module$1 = (input) => If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationList(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ModuleMapping(_0), input]);
|
|
2405
|
+
const Script$1 = (input) => If(If(Module$1(input), ([_0, input]) => [_0, input], () => If(GenericType(input), ([_0, input]) => [_0, input], () => If(Type(input), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [ScriptMapping(_0), input]);
|
|
2406
|
+
//#endregion
|
|
2407
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/patterns/template.mjs
|
|
2408
|
+
/** Parses a Template into a TemplateLiteral types */
|
|
2409
|
+
function ParseTemplateIntoTypes(template) {
|
|
2410
|
+
const parsed = TemplateLiteralTypes(`\`${template}\``);
|
|
2411
|
+
return IsEqual(parsed.length, 2) ? parsed[0] : Unreachable$1();
|
|
2412
|
+
}
|
|
2413
|
+
//#endregion
|
|
2414
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/encode.mjs
|
|
2415
|
+
function JoinString(input) {
|
|
2416
|
+
return input.join("|");
|
|
2417
|
+
}
|
|
2418
|
+
function UnwrapTemplateLiteralPattern(pattern) {
|
|
2419
|
+
return pattern.slice(1, pattern.length - 1);
|
|
2420
|
+
}
|
|
2421
|
+
function EncodeLiteral(value, right, pattern) {
|
|
2422
|
+
return EncodeTypes(right, `${pattern}${value}`);
|
|
2423
|
+
}
|
|
2424
|
+
function EncodeBigInt(right, pattern) {
|
|
2425
|
+
return EncodeTypes(right, `${pattern}${BigIntPattern}`);
|
|
2426
|
+
}
|
|
2427
|
+
function EncodeInteger(right, pattern) {
|
|
2428
|
+
return EncodeTypes(right, `${pattern}${IntegerPattern}`);
|
|
2429
|
+
}
|
|
2430
|
+
function EncodeNumber(right, pattern) {
|
|
2431
|
+
return EncodeTypes(right, `${pattern}${NumberPattern}`);
|
|
2432
|
+
}
|
|
2433
|
+
function EncodeBoolean(right, pattern) {
|
|
2434
|
+
return EncodeType(Union([Literal("false"), Literal("true")]), right, pattern);
|
|
2435
|
+
}
|
|
2436
|
+
function EncodeString(right, pattern) {
|
|
2437
|
+
return EncodeTypes(right, `${pattern}.*`);
|
|
2438
|
+
}
|
|
2439
|
+
function EncodeTemplateLiteral(templatePattern, right, pattern) {
|
|
2440
|
+
return EncodeTypes(right, `${pattern}${UnwrapTemplateLiteralPattern(templatePattern)}`);
|
|
2441
|
+
}
|
|
2442
|
+
function EncodeTemplateLiteralDeferred(types, right, pattern) {
|
|
2443
|
+
return EncodeType(TemplateLiteralAction(types, {}), right, pattern);
|
|
2444
|
+
}
|
|
2445
|
+
function EncodeEnum(values, right, pattern) {
|
|
2446
|
+
return EncodeType(EvaluateEnum(values), right, pattern);
|
|
2447
|
+
}
|
|
2448
|
+
function EncodeUnion(types, right, pattern, result = []) {
|
|
2449
|
+
return ShiftLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...result, EncodeType(head, [], "")]), () => EncodeTypes(right, `${pattern}(${JoinString(result)})`));
|
|
2450
|
+
}
|
|
2451
|
+
function EncodeType(type, right, pattern) {
|
|
2452
|
+
return IsEnum(type) ? EncodeEnum(type.enum, right, pattern) : IsInteger(type) ? EncodeInteger(right, pattern) : IsLiteral(type) ? EncodeLiteral(type.const, right, pattern) : IsBigInt(type) ? EncodeBigInt(right, pattern) : IsBoolean(type) ? EncodeBoolean(right, pattern) : IsNumber(type) ? EncodeNumber(right, pattern) : IsString(type) ? EncodeString(right, pattern) : IsTemplateLiteral(type) ? EncodeTemplateLiteral(type.pattern, right, pattern) : IsTemplateLiteralDeferred(type) ? EncodeTemplateLiteralDeferred(type.parameters[0], right, pattern) : IsUnion(type) ? EncodeUnion(type.anyOf, right, pattern) : NeverPattern;
|
|
2453
|
+
}
|
|
2454
|
+
function EncodeTypes(types, pattern) {
|
|
2455
|
+
return ShiftLeft(types, (left, right) => EncodeType(left, right, pattern), () => pattern);
|
|
2456
|
+
}
|
|
2457
|
+
function EncodePattern(types) {
|
|
2458
|
+
return `^${EncodeTypes(types, "")}$`;
|
|
2459
|
+
}
|
|
2460
|
+
/** Encodes a TemplateLiteral type sequence into a TemplateLiteral */
|
|
2461
|
+
function TemplateLiteralEncode(types) {
|
|
2462
|
+
return TemplateLiteralCreate(EncodePattern(types));
|
|
2463
|
+
}
|
|
2464
|
+
//#endregion
|
|
2465
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs
|
|
2466
|
+
function TemplateLiteralAction(types, options) {
|
|
2467
|
+
return CanInstantiate(types) ? Update(TemplateLiteralEncode(types), {}, options) : TemplateLiteralDeferred(types, options);
|
|
2468
|
+
}
|
|
2469
|
+
function TemplateLiteralInstantiate(context, state, types, options) {
|
|
2470
|
+
return TemplateLiteralAction(InstantiateTypes(context, state, types), options);
|
|
2471
|
+
}
|
|
2472
|
+
//#endregion
|
|
2473
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/template_literal.mjs
|
|
2474
|
+
/** Creates a deferred TemplateLiteral action. */
|
|
2475
|
+
function TemplateLiteralDeferred(types, options = {}) {
|
|
2476
|
+
return Deferred("TemplateLiteral", [types], options);
|
|
2477
|
+
}
|
|
2478
|
+
/** Returns true if this value is a deferred Interface action. */
|
|
2479
|
+
function IsTemplateLiteralDeferred(value) {
|
|
2480
|
+
return IsSchema(value) && HasPropertyKey(value, "action") && IsEqual(value.action, "TemplateLiteral");
|
|
2481
|
+
}
|
|
2482
|
+
function TemplateLiteralFromTypes(types) {
|
|
2483
|
+
return TemplateLiteralAction(types, {});
|
|
2484
|
+
}
|
|
2485
|
+
function TemplateLiteralFromString(template) {
|
|
2486
|
+
return TemplateLiteralFromTypes(ParseTemplateIntoTypes(template));
|
|
2487
|
+
}
|
|
2488
|
+
/** Creates a TemplateLiteral type. */
|
|
2489
|
+
function TemplateLiteral(input, options = {}) {
|
|
2490
|
+
return Update(IsString$1(input) ? TemplateLiteralFromString(input) : TemplateLiteralFromTypes(input), {}, options);
|
|
2491
|
+
}
|
|
2492
|
+
/** Returns true if the given value is TTemplateLiteral. */
|
|
2493
|
+
function IsTemplateLiteral(value) {
|
|
2494
|
+
return IsKind(value, "TemplateLiteral");
|
|
2495
|
+
}
|
|
2496
|
+
//#endregion
|
|
2497
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/result.mjs
|
|
2498
|
+
var result_exports = /* @__PURE__ */ __exportAll({
|
|
2499
|
+
ExtendsFalse: () => ExtendsFalse,
|
|
2500
|
+
ExtendsTrue: () => ExtendsTrue,
|
|
2501
|
+
ExtendsUnion: () => ExtendsUnion$1,
|
|
2502
|
+
IsExtendsFalse: () => IsExtendsFalse,
|
|
2503
|
+
IsExtendsTrue: () => IsExtendsTrue,
|
|
2504
|
+
IsExtendsTrueLike: () => IsExtendsTrueLike,
|
|
2505
|
+
IsExtendsUnion: () => IsExtendsUnion,
|
|
2506
|
+
Match: () => Match
|
|
2507
|
+
});
|
|
2508
|
+
function ExtendsUnion$1(inferred) {
|
|
2509
|
+
return Create({ ["~kind"]: "ExtendsUnion" }, { inferred });
|
|
2510
|
+
}
|
|
2511
|
+
function IsExtendsUnion(value) {
|
|
2512
|
+
return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "inferred") && IsEqual(value["~kind"], "ExtendsUnion") && IsObject$1(value.inferred);
|
|
2513
|
+
}
|
|
2514
|
+
function ExtendsTrue(inferred) {
|
|
2515
|
+
return Create({ ["~kind"]: "ExtendsTrue" }, { inferred });
|
|
2516
|
+
}
|
|
2517
|
+
function IsExtendsTrue(value) {
|
|
2518
|
+
return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "inferred") && IsEqual(value["~kind"], "ExtendsTrue") && IsObject$1(value.inferred);
|
|
2519
|
+
}
|
|
2520
|
+
function ExtendsFalse() {
|
|
2521
|
+
return Create({ ["~kind"]: "ExtendsFalse" }, {});
|
|
2522
|
+
}
|
|
2523
|
+
function IsExtendsFalse(value) {
|
|
2524
|
+
return IsObject$1(value) && HasPropertyKey(value, "~kind") && IsEqual(value["~kind"], "ExtendsFalse");
|
|
2525
|
+
}
|
|
2526
|
+
function IsExtendsTrueLike(value) {
|
|
2527
|
+
return IsExtendsUnion(value) || IsExtendsTrue(value);
|
|
2528
|
+
}
|
|
2529
|
+
function Match(result, true_, false_) {
|
|
2530
|
+
return IsExtendsTrueLike(result) ? true_(result.inferred) : false_();
|
|
2531
|
+
}
|
|
2532
|
+
//#endregion
|
|
2533
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/extends_right.mjs
|
|
2534
|
+
function ExtendsRightInfer(inferred, name, left, right) {
|
|
2535
|
+
return Match(ExtendsLeft(inferred, left, right), (checkInferred) => ExtendsTrue(Assign(Assign(inferred, checkInferred), { [name]: left })), () => ExtendsFalse());
|
|
2536
|
+
}
|
|
2537
|
+
function ExtendsRightAny(inferred, _left) {
|
|
2538
|
+
return ExtendsTrue(inferred);
|
|
2539
|
+
}
|
|
2540
|
+
function ExtendsRightDependent(inferred, left, if_, then_, else_) {
|
|
2541
|
+
return Match(ExtendsLeft(inferred, left, if_), (inferred) => Match(ExtendsLeft(inferred, left, then_), (inferred) => ExtendsTrue(inferred), () => ExtendsFalse()), () => Match(ExtendsLeft(inferred, left, else_), (inferred) => ExtendsTrue(inferred), () => ExtendsFalse()));
|
|
2542
|
+
}
|
|
2543
|
+
function ExtendsRightEnum(inferred, left, right) {
|
|
2544
|
+
return ExtendsLeft(inferred, left, EvaluateEnum(right));
|
|
2545
|
+
}
|
|
2546
|
+
function ExtendsRightIntersect(inferred, left, right) {
|
|
2547
|
+
return ShiftLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsRightIntersect(inferred, left, tail), () => ExtendsFalse()), () => ExtendsTrue(inferred));
|
|
2548
|
+
}
|
|
2549
|
+
function ExtendsRightTemplateLiteral(inferred, left, right) {
|
|
2550
|
+
return ExtendsLeft(inferred, left, EvaluateTemplateLiteral(right));
|
|
2551
|
+
}
|
|
2552
|
+
function ExtendsRightUnion(inferred, left, right) {
|
|
2553
|
+
return ShiftLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsTrue(inferred), () => ExtendsRightUnion(inferred, left, tail)), () => ExtendsFalse());
|
|
2554
|
+
}
|
|
2555
|
+
function ExtendsRight(inferred, left, right) {
|
|
2556
|
+
return IsAny(right) ? ExtendsRightAny(inferred, left) : IsDependent(right) ? ExtendsRightDependent(inferred, left, right.if, right.then, right.else) : IsEnum(right) ? ExtendsRightEnum(inferred, left, right.enum) : IsInfer(right) ? ExtendsRightInfer(inferred, right.name, left, right.extends) : IsIntersect(right) ? ExtendsRightIntersect(inferred, left, right.allOf) : IsTemplateLiteral(right) ? ExtendsRightTemplateLiteral(inferred, left, right.pattern) : IsUnion(right) ? ExtendsRightUnion(inferred, left, right.anyOf) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
|
|
2557
|
+
}
|
|
2558
|
+
//#endregion
|
|
2559
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/any.mjs
|
|
2560
|
+
function ExtendsAny(inferred, left, right) {
|
|
2561
|
+
return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsUnion$1(inferred);
|
|
2562
|
+
}
|
|
2563
|
+
//#endregion
|
|
2564
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/array.mjs
|
|
2565
|
+
function ExtendsImmutable(left, right) {
|
|
2566
|
+
const isImmutableLeft = IsImmutable(left);
|
|
2567
|
+
const isImmutableRight = IsImmutable(right);
|
|
2568
|
+
return isImmutableLeft && isImmutableRight ? true : !isImmutableLeft && isImmutableRight ? true : isImmutableLeft && !isImmutableRight ? false : true;
|
|
2569
|
+
}
|
|
2570
|
+
function ExtendsArray(inferred, arrayLeft, left, right) {
|
|
2571
|
+
return IsArray(right) ? ExtendsImmutable(arrayLeft, right) ? ExtendsLeft(inferred, left, right.items) : ExtendsFalse() : ExtendsRight(inferred, arrayLeft, right);
|
|
2572
|
+
}
|
|
2573
|
+
//#endregion
|
|
2574
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/bigint.mjs
|
|
2575
|
+
function ExtendsBigInt(inferred, left, right) {
|
|
2576
|
+
return IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
|
|
2577
|
+
}
|
|
2578
|
+
//#endregion
|
|
2579
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/boolean.mjs
|
|
2580
|
+
function ExtendsBoolean(inferred, left, right) {
|
|
2581
|
+
return IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
|
|
2582
|
+
}
|
|
2583
|
+
//#endregion
|
|
2584
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/parameters.mjs
|
|
2585
|
+
function ParameterCompare(inferred, left, leftRest, right, rightRest) {
|
|
2586
|
+
const checkLeft = IsInfer(right) ? left : right;
|
|
2587
|
+
const checkRight = IsInfer(right) ? right : left;
|
|
2588
|
+
const isLeftOptional = IsOptional(left);
|
|
2589
|
+
const isRightOptional = IsOptional(right);
|
|
2590
|
+
return !isLeftOptional && isRightOptional ? ExtendsFalse() : Match(ExtendsLeft(inferred, checkLeft, checkRight), (inferred) => ExtendsParameters(inferred, leftRest, rightRest), () => ExtendsFalse());
|
|
2591
|
+
}
|
|
2592
|
+
function ParameterRight(inferred, left, leftRest, rightRest) {
|
|
2593
|
+
return ShiftLeft(rightRest, (head, tail) => ParameterCompare(inferred, left, leftRest, head, tail), () => IsOptional(left) ? ExtendsTrue(inferred) : ExtendsFalse());
|
|
2594
|
+
}
|
|
2595
|
+
function ParametersLeft(inferred, left, rightRest) {
|
|
2596
|
+
return ShiftLeft(left, (head, tail) => ParameterRight(inferred, head, tail, rightRest), () => ExtendsTrue(inferred));
|
|
2597
|
+
}
|
|
2598
|
+
function ExtendsParameters(inferred, left, right) {
|
|
2599
|
+
return ParametersLeft(inferred, left, right);
|
|
2600
|
+
}
|
|
2601
|
+
//#endregion
|
|
2602
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/return_type.mjs
|
|
2603
|
+
function ExtendsReturnType(inferred, left, right) {
|
|
2604
|
+
return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsLeft(inferred, left, right);
|
|
2605
|
+
}
|
|
2606
|
+
//#endregion
|
|
2607
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/constructor.mjs
|
|
2608
|
+
function ExtendsConstructor(inferred, parameters, returnType, right) {
|
|
2609
|
+
return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsConstructor(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["instanceType"]), () => ExtendsFalse()) : ExtendsFalse();
|
|
2610
|
+
}
|
|
2611
|
+
//#endregion
|
|
2612
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/dependent.mjs
|
|
2613
|
+
function ExtendsDependent(inferred, if_, then_, else_, right) {
|
|
2614
|
+
return Match(ExtendsLeft(inferred, if_, right), () => ExtendsLeft(inferred, then_, right), () => ExtendsLeft(inferred, else_, right));
|
|
2615
|
+
}
|
|
2616
|
+
//#endregion
|
|
2617
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/enum.mjs
|
|
2618
|
+
function ExtendsEnum(inferred, left, right) {
|
|
2619
|
+
return ExtendsLeft(inferred, EvaluateEnum(left), right);
|
|
2620
|
+
}
|
|
2621
|
+
//#endregion
|
|
2622
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/function.mjs
|
|
2623
|
+
function ExtendsFunction(inferred, parameters, returnType, right) {
|
|
2624
|
+
return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsFunction(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["returnType"]), () => ExtendsFalse()) : ExtendsFalse();
|
|
2625
|
+
}
|
|
2626
|
+
//#endregion
|
|
2627
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/integer.mjs
|
|
2628
|
+
function ExtendsInteger(inferred, left, right) {
|
|
2629
|
+
return IsInteger(right) ? ExtendsTrue(inferred) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
|
|
2630
|
+
}
|
|
2631
|
+
//#endregion
|
|
2632
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/intersect.mjs
|
|
2633
|
+
function ExtendsIntersect(inferred, left, right) {
|
|
2634
|
+
return ExtendsLeft(inferred, EvaluateIntersect(left), right);
|
|
2635
|
+
}
|
|
2636
|
+
//#endregion
|
|
2637
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/literal.mjs
|
|
2638
|
+
function ExtendsLiteralValue(inferred, left, right) {
|
|
2639
|
+
return left === right ? ExtendsTrue(inferred) : ExtendsFalse();
|
|
2640
|
+
}
|
|
2641
|
+
function ExtendsLiteralBigInt(inferred, left, right) {
|
|
2642
|
+
return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
|
|
2643
|
+
}
|
|
2644
|
+
function ExtendsLiteralBoolean(inferred, left, right) {
|
|
2645
|
+
return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
|
|
2646
|
+
}
|
|
2647
|
+
function ExtendsLiteralNumber(inferred, left, right) {
|
|
2648
|
+
return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
|
|
2649
|
+
}
|
|
2650
|
+
function ExtendsLiteralString(inferred, left, right) {
|
|
2651
|
+
return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
|
|
2652
|
+
}
|
|
2653
|
+
function ExtendsLiteral(inferred, left, right) {
|
|
2654
|
+
return IsBigInt$1(left.const) ? ExtendsLiteralBigInt(inferred, left.const, right) : IsBoolean$1(left.const) ? ExtendsLiteralBoolean(inferred, left.const, right) : IsNumber$1(left.const) ? ExtendsLiteralNumber(inferred, left.const, right) : IsString$1(left.const) ? ExtendsLiteralString(inferred, left.const, right) : Unreachable$1();
|
|
2655
|
+
}
|
|
2656
|
+
//#endregion
|
|
2657
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/never.mjs
|
|
2658
|
+
function ExtendsNever(inferred, left, right) {
|
|
2659
|
+
return IsInfer(right) ? ExtendsRight(inferred, left, right) : ExtendsTrue(inferred);
|
|
2660
|
+
}
|
|
2661
|
+
//#endregion
|
|
2662
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/null.mjs
|
|
2663
|
+
function ExtendsNull(inferred, left, right) {
|
|
2664
|
+
return IsNull(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
|
|
2665
|
+
}
|
|
2666
|
+
//#endregion
|
|
2667
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/number.mjs
|
|
2668
|
+
function ExtendsNumber(inferred, left, right) {
|
|
2669
|
+
return IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
|
|
2670
|
+
}
|
|
2671
|
+
//#endregion
|
|
2672
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/object.mjs
|
|
2673
|
+
function ExtendsPropertyOptional(inferred, left, right) {
|
|
2674
|
+
return IsOptional(left) ? IsOptional(right) ? ExtendsTrue(inferred) : ExtendsFalse() : ExtendsTrue(inferred);
|
|
2675
|
+
}
|
|
2676
|
+
function ExtendsProperty(inferred, left, right) {
|
|
2677
|
+
return IsInfer(right) && IsNever(right.extends) ? ExtendsFalse() : Match(ExtendsLeft(inferred, left, right), (inferred) => ExtendsPropertyOptional(inferred, left, right), () => ExtendsFalse());
|
|
2678
|
+
}
|
|
2679
|
+
function ExtractInferredProperties(keys, properties) {
|
|
2680
|
+
return keys.reduce((result, key) => {
|
|
2681
|
+
return key in properties ? IsExtendsTrueLike(properties[key]) ? {
|
|
2682
|
+
...result,
|
|
2683
|
+
...properties[key].inferred
|
|
2684
|
+
} : Unreachable$1() : Unreachable$1();
|
|
2685
|
+
}, {});
|
|
2686
|
+
}
|
|
2687
|
+
function ExtendsPropertiesComparer(inferred, left, right) {
|
|
2688
|
+
const properties = {};
|
|
2689
|
+
for (const rightKey of Keys(right)) properties[rightKey] = rightKey in left ? ExtendsProperty({}, left[rightKey], right[rightKey]) : IsOptional(right[rightKey]) ? IsInfer(right[rightKey]) ? ExtendsTrue(Assign(inferred, { [right[rightKey].name]: right[rightKey].extends })) : ExtendsTrue(inferred) : ExtendsFalse();
|
|
2690
|
+
const checked = Values(properties).every((result) => IsExtendsTrueLike(result));
|
|
2691
|
+
const extracted = checked ? ExtractInferredProperties(Keys(properties), properties) : {};
|
|
2692
|
+
return checked ? ExtendsTrue(extracted) : ExtendsFalse();
|
|
2693
|
+
}
|
|
2694
|
+
function ExtendsProperties(inferred, left, right) {
|
|
2695
|
+
const compared = ExtendsPropertiesComparer(inferred, left, right);
|
|
2696
|
+
return IsExtendsTrueLike(compared) ? ExtendsTrue(Assign(inferred, compared.inferred)) : ExtendsFalse();
|
|
2697
|
+
}
|
|
2698
|
+
function ExtendsObjectToObject(inferred, left, right) {
|
|
2699
|
+
return ExtendsProperties(inferred, left, right);
|
|
2700
|
+
}
|
|
2701
|
+
function RecordMergeInferred(left, right) {
|
|
2702
|
+
return Keys(right).reduce((result, key) => {
|
|
2703
|
+
return {
|
|
2704
|
+
...result,
|
|
2705
|
+
[key]: HasPropertyKey(left, key) ? IsUnion(result[key]) ? Union([...result[key].anyOf, right[key]]) : Union([left[key], right[key]]) : right[key]
|
|
2706
|
+
};
|
|
2707
|
+
}, left);
|
|
2708
|
+
}
|
|
2709
|
+
function ExtendsRecordComparer(properties, keys, type, result) {
|
|
2710
|
+
return ShiftLeft(keys, (left, right) => Match(ExtendsLeft({}, properties[left], type), (inferred) => ExtendsRecordComparer(properties, right, type, RecordMergeInferred(result, inferred)), () => ExtendsFalse()), () => ExtendsTrue(result));
|
|
2711
|
+
}
|
|
2712
|
+
function ExtendsObjectToRecord(inferred, properties, _pattern, value) {
|
|
2713
|
+
return ExtendsRecordComparer(properties, Keys(properties), value, inferred);
|
|
2714
|
+
}
|
|
2715
|
+
function ExtendsObject(inferred, left, right) {
|
|
2716
|
+
return IsRecord(right) ? ExtendsObjectToRecord(inferred, left, RecordPattern(right), RecordValue(right)) : IsObject(right) ? ExtendsObjectToObject(inferred, left, right.properties) : ExtendsRight(inferred, _Object_$1(left), right);
|
|
2717
|
+
}
|
|
2718
|
+
//#endregion
|
|
2719
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/record.mjs
|
|
2720
|
+
function FromObject$6(inferred, properties) {
|
|
2721
|
+
return IsEqual(Keys(properties).length, 0) ? ExtendsTrue(inferred) : ExtendsFalse();
|
|
2722
|
+
}
|
|
2723
|
+
function FromRecord$1(inferred, _leftKey, leftValue, _rightKey, rightValue) {
|
|
2724
|
+
return ExtendsLeft(inferred, leftValue, rightValue);
|
|
2725
|
+
}
|
|
2726
|
+
function ExtendsRecord(inferred, leftPattern, leftValue, right) {
|
|
2727
|
+
return IsRecord(right) ? FromRecord$1(inferred, RecordPatternToType(leftPattern), leftValue, RecordPatternToType(RecordPattern(right)), RecordValue(right)) : IsObject(right) ? FromObject$6(inferred, right.properties) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
|
|
2728
|
+
}
|
|
2729
|
+
//#endregion
|
|
2730
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/string.mjs
|
|
2731
|
+
function ExtendsString(inferred, left, right) {
|
|
2732
|
+
return IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
|
|
2733
|
+
}
|
|
2734
|
+
//#endregion
|
|
2735
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/symbol.mjs
|
|
2736
|
+
function ExtendsSymbol(inferred, left, right) {
|
|
2737
|
+
return IsSymbol(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
|
|
2738
|
+
}
|
|
2739
|
+
//#endregion
|
|
2740
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/template_literal.mjs
|
|
2741
|
+
function ExtendsTemplateLiteral(inferred, left, right) {
|
|
2742
|
+
return ExtendsLeft(inferred, EvaluateTemplateLiteral(left), right);
|
|
2743
|
+
}
|
|
2744
|
+
//#endregion
|
|
2745
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/inference.mjs
|
|
2746
|
+
function Inferrable(name, type) {
|
|
2747
|
+
return Create({ "~kind": "Inferrable" }, {
|
|
2748
|
+
name,
|
|
2749
|
+
type
|
|
2750
|
+
}, {});
|
|
2751
|
+
}
|
|
2752
|
+
function IsInferable(value) {
|
|
2753
|
+
return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "name") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "Inferrable") && IsString$1(value.name) && IsObject$1(value.type);
|
|
2754
|
+
}
|
|
2755
|
+
function TryRestInferable(type) {
|
|
2756
|
+
return IsRest(type) ? IsInfer(type.items) ? IsArray(type.items.extends) ? Inferrable(type.items.name, type.items.extends.items) : IsUnknown(type.items.extends) ? Inferrable(type.items.name, type.items.extends) : void 0 : Unreachable$1() : void 0;
|
|
2757
|
+
}
|
|
2758
|
+
function TryInferable(type) {
|
|
2759
|
+
return IsInfer(type) ? Inferrable(type.name, type.extends) : void 0;
|
|
2760
|
+
}
|
|
2761
|
+
function TryInferResults(rest, right, result = []) {
|
|
2762
|
+
return ShiftLeft(rest, (head, tail) => Match(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...result, head]), () => void 0), () => result);
|
|
2763
|
+
}
|
|
2764
|
+
function InferTupleResult(inferred, name, left, right) {
|
|
2765
|
+
const results = TryInferResults(left, right);
|
|
2766
|
+
return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Tuple(results) })) : ExtendsFalse();
|
|
2767
|
+
}
|
|
2768
|
+
function InferUnionResult(inferred, name, left, right) {
|
|
2769
|
+
const results = TryInferResults(left, right);
|
|
2770
|
+
return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Union(results) })) : ExtendsFalse();
|
|
2771
|
+
}
|
|
2772
|
+
//#endregion
|
|
2773
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/tuple.mjs
|
|
2774
|
+
function Reverse(types) {
|
|
2775
|
+
return [...types].reverse();
|
|
2776
|
+
}
|
|
2777
|
+
function ApplyReverse(types, reversed) {
|
|
2778
|
+
return reversed ? Reverse(types) : types;
|
|
2779
|
+
}
|
|
2780
|
+
function Reversed(types) {
|
|
2781
|
+
const first = types.length > 0 ? types[0] : void 0;
|
|
2782
|
+
return IsSchema(IsSchema(first) ? TryRestInferable(first) : void 0);
|
|
2783
|
+
}
|
|
2784
|
+
function ElementsCompare(inferred, reversed, left, leftRest, right, rightRest) {
|
|
2785
|
+
return Match(ExtendsLeft(inferred, left, right), (checkInferred) => Elements(checkInferred, reversed, leftRest, rightRest), () => ExtendsFalse());
|
|
2786
|
+
}
|
|
2787
|
+
function ElementsLeft(inferred, reversed, leftRest, right, rightRest) {
|
|
2788
|
+
const inferable = TryRestInferable(right);
|
|
2789
|
+
return IsInferable(inferable) ? InferTupleResult(inferred, inferable["name"], ApplyReverse(leftRest, reversed), inferable["type"]) : ShiftLeft(leftRest, (head, tail) => ElementsCompare(inferred, reversed, head, tail, right, rightRest), () => ExtendsFalse());
|
|
2790
|
+
}
|
|
2791
|
+
function ElementsRight(inferred, reversed, leftRest, rightRest) {
|
|
2792
|
+
return ShiftLeft(rightRest, (head, tail) => ElementsLeft(inferred, reversed, leftRest, head, tail), () => IsEqual(leftRest.length, 0) ? ExtendsTrue(inferred) : ExtendsFalse());
|
|
2793
|
+
}
|
|
2794
|
+
function Elements(inferred, reversed, leftRest, rightRest) {
|
|
2795
|
+
return ElementsRight(inferred, reversed, leftRest, rightRest);
|
|
2796
|
+
}
|
|
2797
|
+
function ExtendsTupleToTuple(inferred, left, right) {
|
|
2798
|
+
const instantiatedRight = InstantiateElements(inferred, State([], []), right);
|
|
2799
|
+
const reversed = Reversed(instantiatedRight);
|
|
2800
|
+
return Elements(inferred, reversed, ApplyReverse(left, reversed), ApplyReverse(instantiatedRight, reversed));
|
|
2801
|
+
}
|
|
2802
|
+
function ExtendsTupleToArray(inferred, left, right) {
|
|
2803
|
+
const inferrable = TryInferable(right);
|
|
2804
|
+
return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable["name"], left, inferrable["type"]) : ShiftLeft(left, (head, tail) => Match(ExtendsLeft(inferred, head, right), (inferred) => ExtendsTupleToArray(inferred, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
|
|
2805
|
+
}
|
|
2806
|
+
function ExtendsTuple(inferred, left, right) {
|
|
2807
|
+
const instantiatedLeft = InstantiateElements(inferred, State([], []), left);
|
|
2808
|
+
return IsTuple(right) ? ExtendsTupleToTuple(inferred, instantiatedLeft, right.items) : IsArray(right) ? ExtendsTupleToArray(inferred, instantiatedLeft, right.items) : ExtendsRight(inferred, Tuple(instantiatedLeft), right);
|
|
2809
|
+
}
|
|
2810
|
+
//#endregion
|
|
2811
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/undefined.mjs
|
|
2812
|
+
function ExtendsUndefined(inferred, left, right) {
|
|
2813
|
+
return IsVoid(right) ? ExtendsTrue(inferred) : IsUndefined(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
|
|
2814
|
+
}
|
|
2815
|
+
//#endregion
|
|
2816
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/union.mjs
|
|
2817
|
+
function ExtendsUnionSome(inferred, type, unionTypes) {
|
|
2818
|
+
return ShiftLeft(unionTypes, (head, tail) => Match(ExtendsLeft(inferred, type, head), (inferred) => ExtendsTrue(inferred), () => ExtendsUnionSome(inferred, type, tail)), () => ExtendsFalse());
|
|
2819
|
+
}
|
|
2820
|
+
function ExtendsUnionLeft(inferred, left, right) {
|
|
2821
|
+
return ShiftLeft(left, (head, tail) => Match(ExtendsUnionSome(inferred, head, right), (inferred) => ExtendsUnionLeft(inferred, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
|
|
2822
|
+
}
|
|
2823
|
+
function ExtendsUnion(inferred, left, right) {
|
|
2824
|
+
const inferrable = TryInferable(right);
|
|
2825
|
+
return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable.name, left, inferrable.type) : IsUnion(right) ? ExtendsUnionLeft(inferred, left, right.anyOf) : ExtendsUnionLeft(inferred, left, [right]);
|
|
2826
|
+
}
|
|
2827
|
+
//#endregion
|
|
2828
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/unknown.mjs
|
|
2829
|
+
function ExtendsUnknown(inferred, left, right) {
|
|
2830
|
+
return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
|
|
2831
|
+
}
|
|
2832
|
+
//#endregion
|
|
2833
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/void.mjs
|
|
2834
|
+
function ExtendsVoid(inferred, left, right) {
|
|
2835
|
+
return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
|
|
2836
|
+
}
|
|
2837
|
+
//#endregion
|
|
2838
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/extends_left.mjs
|
|
2839
|
+
function ExtendsLeft(inferred, left, right) {
|
|
2840
|
+
return IsAny(left) ? ExtendsAny(inferred, left, right) : IsArray(left) ? ExtendsArray(inferred, left, left.items, right) : IsBigInt(left) ? ExtendsBigInt(inferred, left, right) : IsBoolean(left) ? ExtendsBoolean(inferred, left, right) : IsConstructor(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) : IsDependent(left) ? ExtendsDependent(inferred, left.if, left.then, left.else, right) : IsEnum(left) ? ExtendsEnum(inferred, left.enum, right) : IsFunction(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) : IsInteger(left) ? ExtendsInteger(inferred, left, right) : IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) : IsLiteral(left) ? ExtendsLiteral(inferred, left, right) : IsNever(left) ? ExtendsNever(inferred, left, right) : IsNull(left) ? ExtendsNull(inferred, left, right) : IsNumber(left) ? ExtendsNumber(inferred, left, right) : IsObject(left) ? ExtendsObject(inferred, left.properties, right) : IsRecord(left) ? ExtendsRecord(inferred, RecordPattern(left), RecordValue(left), right) : IsString(left) ? ExtendsString(inferred, left, right) : IsSymbol(left) ? ExtendsSymbol(inferred, left, right) : IsTemplateLiteral(left) ? ExtendsTemplateLiteral(inferred, left.pattern, right) : IsTuple(left) ? ExtendsTuple(inferred, left.items, right) : IsUndefined(left) ? ExtendsUndefined(inferred, left, right) : IsUnion(left) ? ExtendsUnion(inferred, left.anyOf, right) : IsUnknown(left) ? ExtendsUnknown(inferred, left, right) : IsVoid(left) ? ExtendsVoid(inferred, left, right) : ExtendsFalse();
|
|
2841
|
+
}
|
|
2842
|
+
//#endregion
|
|
2843
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/interface/instantiate.mjs
|
|
2844
|
+
function InterfaceOperation(heritage, properties) {
|
|
2845
|
+
return EvaluateIntersect([...heritage, _Object_$1(properties)]);
|
|
2846
|
+
}
|
|
2847
|
+
function InterfaceAction(heritage, properties, options) {
|
|
2848
|
+
return CanInstantiate(heritage) ? Update(InterfaceOperation(heritage, properties), {}, options) : InterfaceDeferred(heritage, properties, options);
|
|
2849
|
+
}
|
|
2850
|
+
function InterfaceInstantiate(context, state, heritage, properties, options) {
|
|
2851
|
+
return InterfaceAction(InstantiateTypes(context, state, heritage), InstantiateProperties(context, state, properties), options);
|
|
2852
|
+
}
|
|
2853
|
+
//#endregion
|
|
2854
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/interface.mjs
|
|
2855
|
+
/** Creates a deferred Interface action. */
|
|
2856
|
+
function InterfaceDeferred(heritage, properties, options = {}) {
|
|
2857
|
+
return Deferred("Interface", [heritage, properties], options);
|
|
2858
|
+
}
|
|
2859
|
+
/** Returns true if this value is a deferred Interface action. */
|
|
2860
|
+
function IsInterfaceDeferred(value) {
|
|
2861
|
+
return IsSchema(value) && HasPropertyKey(value, "action") && IsEqual(value.action, "Interface");
|
|
2862
|
+
}
|
|
2863
|
+
/** Creates an Interface using the given heritage and properties. */
|
|
2864
|
+
function Interface(heritage, properties, options = {}) {
|
|
2865
|
+
return InterfaceAction(heritage, properties, options);
|
|
2866
|
+
}
|
|
2867
|
+
//#endregion
|
|
2868
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/check.mjs
|
|
2869
|
+
function FromRef$3(stack, context, ref) {
|
|
2870
|
+
return stack.includes(ref) ? true : FromType$15([...stack, ref], context, context[ref]);
|
|
2871
|
+
}
|
|
2872
|
+
function FromProperties$2(stack, context, properties) {
|
|
2873
|
+
return FromTypes$3(stack, context, PropertyValues(properties));
|
|
2874
|
+
}
|
|
2875
|
+
function FromTypes$3(stack, context, types) {
|
|
2876
|
+
return ShiftLeft(types, (left, right) => FromType$15(stack, context, left) ? true : FromTypes$3(stack, context, right), () => false);
|
|
2877
|
+
}
|
|
2878
|
+
function FromType$15(stack, context, type) {
|
|
2879
|
+
return IsRef(type) ? FromRef$3(stack, context, type.$ref) : IsArray(type) ? FromType$15(stack, context, type.items) : IsConstructor(type) ? FromTypes$3(stack, context, [...type.parameters, type.instanceType]) : IsFunction(type) ? FromTypes$3(stack, context, [...type.parameters, type.returnType]) : IsInterfaceDeferred(type) ? FromProperties$2(stack, context, type.parameters[1]) : IsIntersect(type) ? FromTypes$3(stack, context, type.allOf) : IsObject(type) ? FromProperties$2(stack, context, type.properties) : IsUnion(type) ? FromTypes$3(stack, context, type.anyOf) : IsTuple(type) ? FromTypes$3(stack, context, type.items) : IsRecord(type) ? FromType$15(stack, context, RecordValue(type)) : false;
|
|
2880
|
+
}
|
|
2881
|
+
/** Performs a cyclic check on the given type. Initial key stack can be empty, but faster if specified */
|
|
2882
|
+
function CyclicCheck(stack, context, type) {
|
|
2883
|
+
return FromType$15(stack, context, type);
|
|
2884
|
+
}
|
|
2885
|
+
//#endregion
|
|
2886
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/candidates.mjs
|
|
2887
|
+
function ResolveCandidateKeys(context, keys) {
|
|
2888
|
+
return keys.reduce((result, left) => {
|
|
2889
|
+
return CyclicCheck([left], context, context[left]) ? [...result, left] : result;
|
|
2890
|
+
}, []);
|
|
2891
|
+
}
|
|
2892
|
+
/** Returns keys for context types that need to be transformed to TCyclic. */
|
|
2893
|
+
function CyclicCandidates(context) {
|
|
2894
|
+
return ResolveCandidateKeys(context, PropertyKeys(context));
|
|
2895
|
+
}
|
|
2896
|
+
//#endregion
|
|
2897
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs
|
|
2898
|
+
function FromRef$2(context, ref, result) {
|
|
2899
|
+
return result.includes(ref) ? result : ref in context ? FromType$14(context, context[ref], [...result, ref]) : Unreachable$1();
|
|
2900
|
+
}
|
|
2901
|
+
function FromProperties$1(context, properties, result) {
|
|
2902
|
+
return FromTypes$2(context, PropertyValues(properties), result);
|
|
2903
|
+
}
|
|
2904
|
+
function FromTypes$2(context, types, result) {
|
|
2905
|
+
return types.reduce((result, left) => {
|
|
2906
|
+
return FromType$14(context, left, result);
|
|
2907
|
+
}, result);
|
|
2908
|
+
}
|
|
2909
|
+
function FromType$14(context, type, result) {
|
|
2910
|
+
return IsRef(type) ? FromRef$2(context, type.$ref, result) : IsArray(type) ? FromType$14(context, type.items, result) : IsConstructor(type) ? FromTypes$2(context, [...type.parameters, type.instanceType], result) : IsFunction(type) ? FromTypes$2(context, [...type.parameters, type.returnType], result) : IsInterfaceDeferred(type) ? FromProperties$1(context, type.parameters[1], result) : IsIntersect(type) ? FromTypes$2(context, type.allOf, result) : IsObject(type) ? FromProperties$1(context, type.properties, result) : IsUnion(type) ? FromTypes$2(context, type.anyOf, result) : IsTuple(type) ? FromTypes$2(context, type.items, result) : IsRecord(type) ? FromType$14(context, RecordValue(type), result) : result;
|
|
2911
|
+
}
|
|
2912
|
+
/** Returns dependent cyclic keys for the given type. This function is used to dead-type-eliminate (DTE) for initializing TCyclic types. */
|
|
2913
|
+
function CyclicDependencies(context, key, type) {
|
|
2914
|
+
return FromType$14(context, type, [key]);
|
|
2915
|
+
}
|
|
2916
|
+
//#endregion
|
|
2917
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/extends.mjs
|
|
2918
|
+
function FromRef$1(_ref) {
|
|
2919
|
+
return Any();
|
|
2920
|
+
}
|
|
2921
|
+
function FromProperties(properties) {
|
|
2922
|
+
return Keys(properties).reduce((result, key) => {
|
|
2923
|
+
return {
|
|
2924
|
+
...result,
|
|
2925
|
+
[key]: FromType$13(properties[key])
|
|
2926
|
+
};
|
|
2927
|
+
}, {});
|
|
2928
|
+
}
|
|
2929
|
+
function FromTypes$1(types) {
|
|
2930
|
+
return types.reduce((result, left) => {
|
|
2931
|
+
return [...result, FromType$13(left)];
|
|
2932
|
+
}, []);
|
|
2933
|
+
}
|
|
2934
|
+
function FromType$13(type) {
|
|
2935
|
+
return IsRef(type) ? FromRef$1(type.$ref) : IsArray(type) ? _Array_(FromType$13(type.items), ArrayOptions(type)) : IsConstructor(type) ? Constructor(FromTypes$1(type.parameters), FromType$13(type.instanceType)) : IsFunction(type) ? _Function_$1(FromTypes$1(type.parameters), FromType$13(type.returnType)) : IsIntersect(type) ? Intersect(FromTypes$1(type.allOf)) : IsObject(type) ? _Object_$1(FromProperties(type.properties)) : IsRecord(type) ? Record(RecordKey(type), FromType$13(RecordValue(type))) : IsUnion(type) ? Union(FromTypes$1(type.anyOf)) : IsTuple(type) ? Tuple(FromTypes$1(type.items)) : type;
|
|
2936
|
+
}
|
|
2937
|
+
function CyclicAnyFromParameters(defs, ref) {
|
|
2938
|
+
return ref in defs ? FromType$13(defs[ref]) : Unknown();
|
|
2939
|
+
}
|
|
2940
|
+
/** Transforms TCyclic TRef's into TAny's. This function is used prior to TExtends checks to enable cyclics to be structurally checked and terminated (with TAny) at first point of recursion, what would otherwise be a recursive TRef.*/
|
|
2941
|
+
function CyclicExtends(type) {
|
|
2942
|
+
return CyclicAnyFromParameters(type.$defs, type.$ref);
|
|
2943
|
+
}
|
|
2944
|
+
//#endregion
|
|
2945
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs
|
|
2946
|
+
function CyclicInterface(context, heritage, properties) {
|
|
2947
|
+
const instantiatedHeritage = InstantiateTypes(context, State([], []), heritage);
|
|
2948
|
+
const instantiatedProperties = InstantiateProperties({}, State([], []), properties);
|
|
2949
|
+
return EvaluateIntersect([...instantiatedHeritage, _Object_$1(instantiatedProperties)]);
|
|
2950
|
+
}
|
|
2951
|
+
function CyclicDefinitions(context, dependencies) {
|
|
2952
|
+
return Keys(context).filter((key) => dependencies.includes(key)).reduce((result, key) => {
|
|
2953
|
+
const type = context[key];
|
|
2954
|
+
const instantiatedType = IsInterfaceDeferred(type) ? CyclicInterface(context, type.parameters[0], type.parameters[1]) : type;
|
|
2955
|
+
return {
|
|
2956
|
+
...result,
|
|
2957
|
+
[key]: instantiatedType
|
|
2958
|
+
};
|
|
2959
|
+
}, {});
|
|
2960
|
+
}
|
|
2961
|
+
function InstantiateCyclic(context, ref, type) {
|
|
2962
|
+
return Cyclic(CyclicDefinitions(context, CyclicDependencies(context, ref, type)), ref);
|
|
2963
|
+
}
|
|
2964
|
+
//#endregion
|
|
2965
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/cyclic/target.mjs
|
|
2966
|
+
function Resolve(defs, ref) {
|
|
2967
|
+
return ref in defs ? IsRef(defs[ref]) ? Resolve(defs, defs[ref].$ref) : defs[ref] : Never();
|
|
2968
|
+
}
|
|
2969
|
+
/** Returns the target Type from the Defs or Never if target is non-resolvable */
|
|
2970
|
+
function CyclicTarget(defs, ref) {
|
|
2971
|
+
return Resolve(defs, ref);
|
|
2972
|
+
}
|
|
2973
|
+
//#endregion
|
|
2974
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/extends/extends.mjs
|
|
2975
|
+
function Canonical(type) {
|
|
2976
|
+
return IsCyclic(type) ? CyclicExtends(type) : IsUnsafe(type) ? Unknown() : type;
|
|
2977
|
+
}
|
|
2978
|
+
/** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
|
|
2979
|
+
function Extends(inferred, left, right) {
|
|
2980
|
+
return ExtendsLeft(inferred, Canonical(left), Canonical(right));
|
|
2981
|
+
}
|
|
2982
|
+
/** Compares left and right types and determines their set relationship. */
|
|
2983
|
+
function Compare(left, right) {
|
|
2984
|
+
const extendsCheck = [Extends({}, left, right), Extends({}, right, left)];
|
|
2985
|
+
return IsExtendsTrueLike(extendsCheck[0]) && IsExtendsTrueLike(extendsCheck[1]) ? 0 : IsExtendsTrueLike(extendsCheck[0]) && IsExtendsFalse(extendsCheck[1]) ? 2 : IsExtendsFalse(extendsCheck[0]) && IsExtendsTrueLike(extendsCheck[1]) ? 3 : 1;
|
|
2986
|
+
}
|
|
2987
|
+
//#endregion
|
|
2988
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/broaden.mjs
|
|
2989
|
+
function BroadenFilter(type, types, result = [], all = types) {
|
|
2990
|
+
return ShiftLeft(types, (left, right) => {
|
|
2991
|
+
const compare = Compare(type, left);
|
|
2992
|
+
return IsEqual(compare, 2) || IsEqual(compare, 0) ? all : IsEqual(compare, 1) ? BroadenFilter(type, right, [...result, left], all) : BroadenFilter(type, right, result, all);
|
|
2993
|
+
}, () => [...result, type]);
|
|
2994
|
+
}
|
|
2995
|
+
function BroadenType(type, types, result) {
|
|
2996
|
+
const evaluated = EvaluateType(type);
|
|
2997
|
+
return IsAny(evaluated) ? [evaluated] : IsUnknown(evaluated) ? [evaluated] : IsNever(evaluated) ? BroadenTypes(types, result) : IsObject(evaluated) ? BroadenTypes(types, [...result, evaluated]) : BroadenTypes(types, BroadenFilter(evaluated, result));
|
|
2998
|
+
}
|
|
2999
|
+
function BroadenTypes(types, result = []) {
|
|
3000
|
+
return ShiftLeft(types, (left, right) => BroadenType(left, right, result), () => result);
|
|
3001
|
+
}
|
|
3002
|
+
/** Broadens a set of types and returns either the most broad type, or union or disjoint types. */
|
|
3003
|
+
function Broaden(types) {
|
|
3004
|
+
return Flatten(BroadenTypes(types));
|
|
3005
|
+
}
|
|
3006
|
+
//#endregion
|
|
3007
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs
|
|
3008
|
+
function EvaluateAction(type, options) {
|
|
3009
|
+
return Update(EvaluateType(type), {}, options);
|
|
3010
|
+
}
|
|
3011
|
+
function EvaluateInstantiate(context, state, type, options) {
|
|
3012
|
+
return EvaluateAction(InstantiateType(context, state, type), options);
|
|
3013
|
+
}
|
|
3014
|
+
//#endregion
|
|
3015
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs
|
|
3016
|
+
function CollectDistributionNames(expression, result = []) {
|
|
3017
|
+
return IsDeferred(expression) && IsEqual(expression.action, "Conditional") ? IsRef(expression.parameters[0]) ? CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], [...result, expression.parameters[0]["$ref"]])) : CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], result)) : IsDeferred(expression) && IsEqual(expression.action, "Mapped") ? IsDeferred(expression.parameters[1]) && IsEqual(expression.parameters[1].action, "KeyOf") && IsRef(expression.parameters[1].parameters[0]) ? [...result, expression.parameters[1].parameters[0]["$ref"]] : result : result;
|
|
3018
|
+
}
|
|
3019
|
+
function BuildDistributionArray(parameters, names) {
|
|
3020
|
+
return parameters.reduce((result, left) => [...result, names.includes(left.name)], []);
|
|
3021
|
+
}
|
|
3022
|
+
function ZipDistributionArray(arguments_, distributionArray, result = []) {
|
|
3023
|
+
return ShiftLeft(arguments_, (argumentLeft, argumentRight) => ShiftLeft(distributionArray, (booleanLeft, booleanRight) => ZipDistributionArray(argumentRight, booleanRight, [...result, [booleanLeft, argumentLeft]]), () => result), () => result);
|
|
3024
|
+
}
|
|
3025
|
+
function CanonicalArgument(type) {
|
|
3026
|
+
return IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) : IsEnum(type) ? EvaluateEnum(type.enum) : type;
|
|
3027
|
+
}
|
|
3028
|
+
function Expand(type) {
|
|
3029
|
+
const canonicalArgument = CanonicalArgument(type);
|
|
3030
|
+
return IsUnion(canonicalArgument) ? [...canonicalArgument.anyOf] : [canonicalArgument];
|
|
3031
|
+
}
|
|
3032
|
+
function Append(current, type) {
|
|
3033
|
+
return current.reduce((result, left) => [...result, [...left, type]], []);
|
|
3034
|
+
}
|
|
3035
|
+
function Cross(current, variants) {
|
|
3036
|
+
return variants.reduce((result, left) => {
|
|
3037
|
+
return [...result, ...Append(current, left)];
|
|
3038
|
+
}, []);
|
|
3039
|
+
}
|
|
3040
|
+
function Distribute(zipped) {
|
|
3041
|
+
return zipped.reduce((result, left) => {
|
|
3042
|
+
return IsEqual(left[0], true) ? Cross(result, Expand(left[1])) : Cross(result, [left[1]]);
|
|
3043
|
+
}, [[]]);
|
|
3044
|
+
}
|
|
3045
|
+
function DistributeArguments(parameters, arguments_, expression) {
|
|
3046
|
+
const zippedArguments = ZipDistributionArray(arguments_, BuildDistributionArray(parameters, CollectDistributionNames(expression)));
|
|
3047
|
+
return IsDeferred(expression) && IsEqual(expression.action, "Conditional") ? Distribute(zippedArguments) : IsDeferred(expression) && IsEqual(expression.action, "Mapped") ? Distribute(zippedArguments) : [arguments_];
|
|
3048
|
+
}
|
|
3049
|
+
//#endregion
|
|
3050
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/call/resolve_target.mjs
|
|
3051
|
+
function FromNotResolvable() {
|
|
3052
|
+
return ["(not-resolvable)", Never()];
|
|
3053
|
+
}
|
|
3054
|
+
function FromNotGeneric() {
|
|
3055
|
+
return ["(not-generic)", Never()];
|
|
3056
|
+
}
|
|
3057
|
+
function FromGeneric(name, parameters, expression) {
|
|
3058
|
+
return [name, Generic(parameters, expression)];
|
|
3059
|
+
}
|
|
3060
|
+
function FromRef(context, ref, arguments_) {
|
|
3061
|
+
return ref in context ? FromType$12(context, ref, context[ref], arguments_) : FromNotResolvable();
|
|
3062
|
+
}
|
|
3063
|
+
function FromType$12(context, name, target, arguments_) {
|
|
3064
|
+
return IsGeneric(target) ? FromGeneric(name, target.parameters, target.expression) : IsRef(target) ? FromRef(context, target.$ref, arguments_) : FromNotGeneric();
|
|
3065
|
+
}
|
|
3066
|
+
/** Resolves a named generic target from the context, or returns TNever if it cannot be resolved or is not generic. */
|
|
3067
|
+
function ResolveTarget(context, target, arguments_) {
|
|
3068
|
+
return FromType$12(context, "(anonymous)", target, arguments_);
|
|
3069
|
+
}
|
|
3070
|
+
//#endregion
|
|
3071
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs
|
|
3072
|
+
function AssertArgumentExtends(name, type, extends_) {
|
|
3073
|
+
if (IsInfer(type) || IsCall(type) || IsExtendsTrueLike(Extends({}, type, extends_))) return;
|
|
3074
|
+
const cause = {
|
|
3075
|
+
parameter: name,
|
|
3076
|
+
expect: extends_,
|
|
3077
|
+
actual: type
|
|
3078
|
+
};
|
|
3079
|
+
throw new Error(`Argument for parameter ${name} does not satisfy constraint`, { cause });
|
|
3080
|
+
}
|
|
3081
|
+
function BindArgument(context, state, name, extends_, type) {
|
|
3082
|
+
const instantiatedArgument = InstantiateType(context, state, type);
|
|
3083
|
+
AssertArgumentExtends(name, instantiatedArgument, extends_);
|
|
3084
|
+
return Assign(context, { [name]: instantiatedArgument });
|
|
3085
|
+
}
|
|
3086
|
+
function BindArguments(context, state, parameterLeft, parameterRight, arguments_) {
|
|
3087
|
+
const instantiatedExtends = InstantiateType(context, state, parameterLeft.extends);
|
|
3088
|
+
const instantiatedEquals = InstantiateType(context, state, parameterLeft.equals);
|
|
3089
|
+
return ShiftLeft(arguments_, (left, right) => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, left), state, parameterRight, right), () => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, instantiatedEquals), state, parameterRight, []));
|
|
3090
|
+
}
|
|
3091
|
+
function BindParameters(context, state, parameters, arguments_) {
|
|
3092
|
+
return ShiftLeft(parameters, (left, right) => BindArguments(context, state, left, right, arguments_), () => context);
|
|
3093
|
+
}
|
|
3094
|
+
function ResolveArgumentsContext(context, state, parameters, arguments_) {
|
|
3095
|
+
return BindParameters(context, state, parameters, arguments_);
|
|
3096
|
+
}
|
|
3097
|
+
//#endregion
|
|
3098
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/call/instantiate.mjs
|
|
3099
|
+
let instantiationDepth = 0;
|
|
3100
|
+
let instantiationCount = 0;
|
|
3101
|
+
function InstantiationAssert() {
|
|
3102
|
+
if (IsLessThan(instantiationCount, Get().maxInstantiationCount)) return;
|
|
3103
|
+
throw Error("Type instantiation is excessively deep and possibly infinite");
|
|
3104
|
+
}
|
|
3105
|
+
function InstantiationIncrement() {
|
|
3106
|
+
InstantiationAssert();
|
|
3107
|
+
instantiationCount++;
|
|
3108
|
+
instantiationDepth++;
|
|
3109
|
+
}
|
|
3110
|
+
function InstantiationDecrement() {
|
|
3111
|
+
instantiationDepth--;
|
|
3112
|
+
if (IsEqual(instantiationDepth, 0)) instantiationCount = 0;
|
|
3113
|
+
}
|
|
3114
|
+
function Peek(state) {
|
|
3115
|
+
return IsGreaterThan(state.callstack.length, 0) ? state.callstack[state.callstack.length - 1] : "";
|
|
3116
|
+
}
|
|
3117
|
+
function IsTailCall(state, name) {
|
|
3118
|
+
return IsEqual(Peek(state), name);
|
|
3119
|
+
}
|
|
3120
|
+
function CallDispatch(context, state, target, parameters, expression, arguments_) {
|
|
3121
|
+
InstantiationIncrement();
|
|
3122
|
+
try {
|
|
3123
|
+
const argumentsContext = ResolveArgumentsContext(context, state, parameters, arguments_);
|
|
3124
|
+
const returnType = InstantiateType(argumentsContext, State([...state["callstack"], target["$ref"]], state["visited"]), expression);
|
|
3125
|
+
return InstantiateType(argumentsContext, State([], []), returnType);
|
|
3126
|
+
} finally {
|
|
3127
|
+
InstantiationDecrement();
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
function CallDistributed(context, state, target, parameters, expression, distributedArguments) {
|
|
3131
|
+
return distributedArguments.reduce((result, arguments_) => {
|
|
3132
|
+
const returnType = CallDispatch(context, state, target, parameters, expression, arguments_);
|
|
3133
|
+
return [...result, returnType];
|
|
3134
|
+
}, []);
|
|
3135
|
+
}
|
|
3136
|
+
function CallImmediate(context, state, target, parameters, expression, arguments_) {
|
|
3137
|
+
const returnTypes = CallDistributed(context, state, target, parameters, expression, DistributeArguments(parameters, arguments_, expression));
|
|
3138
|
+
return IsEqual(returnTypes.length, 1) ? returnTypes[0] : EvaluateUnion(returnTypes);
|
|
3139
|
+
}
|
|
3140
|
+
function CallInstantiate(context, state, target, arguments_) {
|
|
3141
|
+
const instantiatedArguments = InstantiateTypes(context, state, arguments_);
|
|
3142
|
+
const resolved = ResolveTarget(context, target, arguments_);
|
|
3143
|
+
const name = resolved[0];
|
|
3144
|
+
const type = resolved[1];
|
|
3145
|
+
return IsGeneric(type) ? IsTailCall(state, name) ? CallConstruct(Ref(name), instantiatedArguments) : CallImmediate(context, state, Ref(name), type.parameters, type.expression, instantiatedArguments) : CallConstruct(target, instantiatedArguments);
|
|
3146
|
+
}
|
|
3147
|
+
//#endregion
|
|
3148
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/types/call.mjs
|
|
3149
|
+
function CallConstruct(target, arguments_) {
|
|
3150
|
+
return Create({ ["~kind"]: "Call" }, {
|
|
3151
|
+
type: "call",
|
|
3152
|
+
target,
|
|
3153
|
+
arguments: arguments_
|
|
3154
|
+
}, {});
|
|
3155
|
+
}
|
|
3156
|
+
/** Creates a Call type. */
|
|
3157
|
+
function Call(target, arguments_) {
|
|
3158
|
+
return CallInstantiate({}, State([], []), target, arguments_);
|
|
3159
|
+
}
|
|
3160
|
+
/** Returns true if the given type is a TCall. */
|
|
3161
|
+
function IsCall(value) {
|
|
3162
|
+
return IsKind(value, "Call");
|
|
3163
|
+
}
|
|
3164
|
+
//#endregion
|
|
3165
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs
|
|
3166
|
+
function RemoveImmutableOperation(type) {
|
|
3167
|
+
return Discard(type, ["~immutable"]);
|
|
3168
|
+
}
|
|
3169
|
+
function RemoveImmutableAction(type, options) {
|
|
3170
|
+
return Update(RemoveImmutableOperation(type), {}, options);
|
|
3171
|
+
}
|
|
3172
|
+
function RemoveImmutableInstantiate(context, state, type, options) {
|
|
3173
|
+
return RemoveImmutableAction(InstantiateType(context, state, type), options);
|
|
3174
|
+
}
|
|
3175
|
+
//#endregion
|
|
3176
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs
|
|
3177
|
+
function ApplyMapping(mapping, value) {
|
|
3178
|
+
return mapping(value);
|
|
3179
|
+
}
|
|
3180
|
+
//#endregion
|
|
3181
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs
|
|
3182
|
+
function FromLiteral$2(mapping, value) {
|
|
3183
|
+
return IsString$1(value) ? Literal(ApplyMapping(mapping, value)) : Literal(value);
|
|
3184
|
+
}
|
|
3185
|
+
//#endregion
|
|
3186
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs
|
|
3187
|
+
function FromTemplateLiteral$2(mapping, pattern) {
|
|
3188
|
+
return FromType$11(mapping, EvaluateTemplateLiteral(pattern));
|
|
3189
|
+
}
|
|
3190
|
+
//#endregion
|
|
3191
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs
|
|
3192
|
+
function FromUnion$6(mapping, types) {
|
|
3193
|
+
return Union(types.map((type) => FromType$11(mapping, type)));
|
|
3194
|
+
}
|
|
3195
|
+
//#endregion
|
|
3196
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs
|
|
3197
|
+
function FromType$11(mapping, type) {
|
|
3198
|
+
return IsLiteral(type) ? FromLiteral$2(mapping, type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$2(mapping, type.pattern) : IsUnion(type) ? FromUnion$6(mapping, type.anyOf) : type;
|
|
3199
|
+
}
|
|
3200
|
+
//#endregion
|
|
3201
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/capitalize.mjs
|
|
3202
|
+
/** Creates a deferred Capitalize action. */
|
|
3203
|
+
function CapitalizeDeferred(type, options = {}) {
|
|
3204
|
+
return Deferred("Capitalize", [type], options);
|
|
3205
|
+
}
|
|
3206
|
+
/** Applies a Capitalize action to the given type. */
|
|
3207
|
+
function Capitalize(type, options = {}) {
|
|
3208
|
+
return CapitalizeAction(type, options);
|
|
3209
|
+
}
|
|
3210
|
+
//#endregion
|
|
3211
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/lowercase.mjs
|
|
3212
|
+
/** Creates a deferred Lowercase action. */
|
|
3213
|
+
function LowercaseDeferred(type, options = {}) {
|
|
3214
|
+
return Deferred("Lowercase", [type], options);
|
|
3215
|
+
}
|
|
3216
|
+
/** Applies a Lowercase action to the given type. */
|
|
3217
|
+
function Lowercase(type, options = {}) {
|
|
3218
|
+
return LowercaseAction(type, options);
|
|
3219
|
+
}
|
|
3220
|
+
//#endregion
|
|
3221
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/uncapitalize.mjs
|
|
3222
|
+
/** Creates a deferred Uncapitalize action. */
|
|
3223
|
+
function UncapitalizeDeferred(type, options = {}) {
|
|
3224
|
+
return Deferred("Uncapitalize", [type], options);
|
|
3225
|
+
}
|
|
3226
|
+
/** Applies a Uncapitalize action to the given type. */
|
|
3227
|
+
function Uncapitalize(type, options = {}) {
|
|
3228
|
+
return UncapitalizeAction(type, options);
|
|
3229
|
+
}
|
|
3230
|
+
//#endregion
|
|
3231
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/uppercase.mjs
|
|
3232
|
+
/** Creates a deferred Uppercase action. */
|
|
3233
|
+
function UppercaseDeferred(type, options = {}) {
|
|
3234
|
+
return Deferred("Uppercase", [type], options);
|
|
3235
|
+
}
|
|
3236
|
+
/** Applies a Uppercase action to the given type. */
|
|
3237
|
+
function Uppercase(type, options = {}) {
|
|
3238
|
+
return UppercaseAction(type, options);
|
|
3239
|
+
}
|
|
3240
|
+
//#endregion
|
|
3241
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs
|
|
3242
|
+
const CapitalizeMapping = (input) => input[0].toUpperCase() + input.slice(1);
|
|
3243
|
+
const LowercaseMapping = (input) => input.toLowerCase();
|
|
3244
|
+
const UncapitalizeMapping = (input) => input[0].toLowerCase() + input.slice(1);
|
|
3245
|
+
const UppercaseMapping = (input) => input.toUpperCase();
|
|
3246
|
+
function CapitalizeAction(type, options) {
|
|
3247
|
+
return CanInstantiate([type]) ? Update(FromType$11(CapitalizeMapping, type), {}, options) : CapitalizeDeferred(type, options);
|
|
3248
|
+
}
|
|
3249
|
+
function LowercaseAction(type, options) {
|
|
3250
|
+
return CanInstantiate([type]) ? Update(FromType$11(LowercaseMapping, type), {}, options) : LowercaseDeferred(type, options);
|
|
3251
|
+
}
|
|
3252
|
+
function UncapitalizeAction(type, options) {
|
|
3253
|
+
return CanInstantiate([type]) ? Update(FromType$11(UncapitalizeMapping, type), {}, options) : UncapitalizeDeferred(type, options);
|
|
3254
|
+
}
|
|
3255
|
+
function UppercaseAction(type, options) {
|
|
3256
|
+
return CanInstantiate([type]) ? Update(FromType$11(UppercaseMapping, type), {}, options) : UppercaseDeferred(type, options);
|
|
3257
|
+
}
|
|
3258
|
+
function CapitalizeInstantiate(context, state, type, options) {
|
|
3259
|
+
return CapitalizeAction(InstantiateType(context, state, type), options);
|
|
3260
|
+
}
|
|
3261
|
+
function LowercaseInstantiate(context, state, type, options) {
|
|
3262
|
+
return LowercaseAction(InstantiateType(context, state, type), options);
|
|
3263
|
+
}
|
|
3264
|
+
function UncapitalizeInstantiate(context, state, type, options) {
|
|
3265
|
+
return UncapitalizeAction(InstantiateType(context, state, type), options);
|
|
3266
|
+
}
|
|
3267
|
+
function UppercaseInstantiate(context, state, type, options) {
|
|
3268
|
+
return UppercaseAction(InstantiateType(context, state, type), options);
|
|
3269
|
+
}
|
|
3270
|
+
//#endregion
|
|
3271
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/conditional.mjs
|
|
3272
|
+
/** Creates a deferred Conditional action. */
|
|
3273
|
+
function ConditionalDeferred(left, right, true_, false_, options = {}) {
|
|
3274
|
+
return Deferred("Conditional", [
|
|
3275
|
+
left,
|
|
3276
|
+
right,
|
|
3277
|
+
true_,
|
|
3278
|
+
false_
|
|
3279
|
+
], options);
|
|
3280
|
+
}
|
|
3281
|
+
/** Applies a Conditional action to the given types. */
|
|
3282
|
+
function Conditional(left, right, true_, false_, options = {}) {
|
|
3283
|
+
return ConditionalAction({}, State([], []), left, right, true_, false_, options);
|
|
3284
|
+
}
|
|
3285
|
+
//#endregion
|
|
3286
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/conditional/instantiate.mjs
|
|
3287
|
+
function ConditionalOperation(context, state, left, right, true_, false_) {
|
|
3288
|
+
const extendsResult = Extends(context, left, right);
|
|
3289
|
+
return IsExtendsUnion(extendsResult) ? Union([InstantiateType(extendsResult.inferred, state, true_), InstantiateType(context, state, false_)]) : IsExtendsTrue(extendsResult) ? InstantiateType(extendsResult.inferred, state, true_) : InstantiateType(context, state, false_);
|
|
3290
|
+
}
|
|
3291
|
+
function ConditionalAction(context, state, left, right, true_, false_, options) {
|
|
3292
|
+
return CanInstantiate([left, right]) ? Update(ConditionalOperation(context, state, left, right, true_, false_), {}, options) : ConditionalDeferred(left, right, true_, false_, options);
|
|
3293
|
+
}
|
|
3294
|
+
function ConditionalInstantiate(context, state, left, right, true_, false_, options) {
|
|
3295
|
+
return ConditionalAction(context, state, InstantiateType(context, state, left), InstantiateType(context, state, right), true_, false_, options);
|
|
3296
|
+
}
|
|
3297
|
+
//#endregion
|
|
3298
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/constructor_parameters.mjs
|
|
3299
|
+
/** Creates a deferred ConstructorParameters action. */
|
|
3300
|
+
function ConstructorParametersDeferred(type, options = {}) {
|
|
3301
|
+
return Deferred("ConstructorParameters", [type], options);
|
|
3302
|
+
}
|
|
3303
|
+
/** Applies a ConstructorParameters action to a type. */
|
|
3304
|
+
function ConstructorParameters(type, options = {}) {
|
|
3305
|
+
return ConstructorParametersAction(type, options);
|
|
3306
|
+
}
|
|
3307
|
+
//#endregion
|
|
3308
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs
|
|
3309
|
+
function ConstructorParametersOperation(type) {
|
|
3310
|
+
const parameters = IsConstructor(type) ? type["parameters"] : [];
|
|
3311
|
+
return Tuple(InstantiateElements({}, State([], []), parameters));
|
|
3312
|
+
}
|
|
3313
|
+
function ConstructorParametersAction(type, options) {
|
|
3314
|
+
return CanInstantiate([type]) ? Update(ConstructorParametersOperation(type), {}, options) : ConstructorParametersDeferred(type, options);
|
|
3315
|
+
}
|
|
3316
|
+
function ConstructorParametersInstantiate(context, state, type, options) {
|
|
3317
|
+
return ConstructorParametersAction(InstantiateType(context, state, type), options);
|
|
3318
|
+
}
|
|
3319
|
+
//#endregion
|
|
3320
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/exclude.mjs
|
|
3321
|
+
/** Creates a deferred Exclude action. */
|
|
3322
|
+
function ExcludeDeferred(left, right, options = {}) {
|
|
3323
|
+
return Deferred("Exclude", [left, right], options);
|
|
3324
|
+
}
|
|
3325
|
+
/** Applies a Exclude action using the given types */
|
|
3326
|
+
function Exclude(left, right, options = {}) {
|
|
3327
|
+
return ExcludeAction(left, right, options);
|
|
3328
|
+
}
|
|
3329
|
+
//#endregion
|
|
3330
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/exclude/instantiate.mjs
|
|
3331
|
+
function ExcludeAction(left, right, options) {
|
|
3332
|
+
return CanInstantiate([left, right]) ? Update(ExcludeOperation(left, right), {}, options) : ExcludeDeferred(left, right, options);
|
|
3333
|
+
}
|
|
3334
|
+
function ExcludeInstantiate(context, state, left, right, options) {
|
|
3335
|
+
return ExcludeAction(InstantiateType(context, state, left), InstantiateType(context, state, right), options);
|
|
3336
|
+
}
|
|
3337
|
+
//#endregion
|
|
3338
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/extract.mjs
|
|
3339
|
+
/** Creates a deferred Extract action. */
|
|
3340
|
+
function ExtractDeferred(left, right, options = {}) {
|
|
3341
|
+
return Deferred("Extract", [left, right], options);
|
|
3342
|
+
}
|
|
3343
|
+
/** Applies an Extract action using the given types. */
|
|
3344
|
+
function Extract(left, right, options = {}) {
|
|
3345
|
+
return ExtractAction(left, right, options);
|
|
3346
|
+
}
|
|
3347
|
+
//#endregion
|
|
3348
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/extract/operation.mjs
|
|
3349
|
+
function ExtractType(left, right) {
|
|
3350
|
+
return IsExtendsTrueLike(Extends({}, left, right)) ? [left] : [];
|
|
3351
|
+
}
|
|
3352
|
+
function ExtractUnion(left, right, result = []) {
|
|
3353
|
+
return ShiftLeft(left, (head, tail) => ExtractUnion(tail, right, [...result, ...ExtractType(head, right)]), () => result);
|
|
3354
|
+
}
|
|
3355
|
+
function ExtractOperation(left, right) {
|
|
3356
|
+
const evaluated = EvaluateType(left);
|
|
3357
|
+
return EvaluateUnion(ExtractUnion(IsUnion(evaluated) ? evaluated.anyOf : [evaluated], right));
|
|
3358
|
+
}
|
|
3359
|
+
//#endregion
|
|
3360
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/extract/instantiate.mjs
|
|
3361
|
+
function ExtractAction(left, right, options) {
|
|
3362
|
+
return CanInstantiate([left, right]) ? Update(ExtractOperation(left, right), {}, options) : ExtractDeferred(left, right, options);
|
|
3363
|
+
}
|
|
3364
|
+
function ExtractInstantiate(context, state, left, right, options) {
|
|
3365
|
+
return ExtractAction(InstantiateType(context, state, left), InstantiateType(context, state, right), options);
|
|
3366
|
+
}
|
|
3367
|
+
//#endregion
|
|
3368
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs
|
|
3369
|
+
function KeysToLiterals(keys) {
|
|
3370
|
+
return keys.reduce((result, left) => {
|
|
3371
|
+
return IsLiteralValue(left) ? [...result, Literal(left)] : result;
|
|
3372
|
+
}, []);
|
|
3373
|
+
}
|
|
3374
|
+
function KeysToIndexer(keys) {
|
|
3375
|
+
return Union(KeysToLiterals(keys));
|
|
3376
|
+
}
|
|
3377
|
+
//#endregion
|
|
3378
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/indexed.mjs
|
|
3379
|
+
/** Creates a deferred Index action. */
|
|
3380
|
+
function IndexDeferred(type, indexer, options = {}) {
|
|
3381
|
+
return Deferred("Index", [type, indexer], options);
|
|
3382
|
+
}
|
|
3383
|
+
/** Applies a Index action using the given types. */
|
|
3384
|
+
function Index(type, indexer_or_keys, options = {}) {
|
|
3385
|
+
return IndexAction(type, IsArray$1(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys, options);
|
|
3386
|
+
}
|
|
3387
|
+
//#endregion
|
|
3388
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_cyclic.mjs
|
|
3389
|
+
function FromCyclic$4(defs, ref) {
|
|
3390
|
+
return FromType$10(CyclicTarget(defs, ref));
|
|
3391
|
+
}
|
|
3392
|
+
//#endregion
|
|
3393
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_dependent.mjs
|
|
3394
|
+
function FromDependent$4(if_, then_, else_) {
|
|
3395
|
+
return FromType$10(EvaluateDependent(if_, then_, else_));
|
|
3396
|
+
}
|
|
3397
|
+
//#endregion
|
|
3398
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_intersect.mjs
|
|
3399
|
+
function CollapseIntersectProperties(left, right) {
|
|
3400
|
+
const leftKeys = Keys(left).filter((key) => !HasPropertyKey(right, key));
|
|
3401
|
+
const rightKeys = Keys(right).filter((key) => !HasPropertyKey(left, key));
|
|
3402
|
+
const sharedKeys = Keys(left).filter((key) => HasPropertyKey(right, key));
|
|
3403
|
+
const leftProperties = leftKeys.reduce((result, key) => ({
|
|
3404
|
+
...result,
|
|
3405
|
+
[key]: left[key]
|
|
3406
|
+
}), {});
|
|
3407
|
+
const rightProperties = rightKeys.reduce((result, key) => ({
|
|
3408
|
+
...result,
|
|
3409
|
+
[key]: right[key]
|
|
3410
|
+
}), {});
|
|
3411
|
+
const sharedProperties = sharedKeys.reduce((result, key) => ({
|
|
3412
|
+
...result,
|
|
3413
|
+
[key]: EvaluateIntersect([left[key], right[key]])
|
|
3414
|
+
}), {});
|
|
3415
|
+
return Assign(Assign(leftProperties, rightProperties), sharedProperties);
|
|
3416
|
+
}
|
|
3417
|
+
function FromIntersect$4(types) {
|
|
3418
|
+
return types.reduce((result, left) => {
|
|
3419
|
+
return CollapseIntersectProperties(result, FromType$10(left));
|
|
3420
|
+
}, {});
|
|
3421
|
+
}
|
|
3422
|
+
//#endregion
|
|
3423
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_object.mjs
|
|
3424
|
+
function FromObject$5(properties) {
|
|
3425
|
+
return properties;
|
|
3426
|
+
}
|
|
3427
|
+
//#endregion
|
|
3428
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_tuple.mjs
|
|
3429
|
+
function FromTuple$3(types) {
|
|
3430
|
+
return FromType$10(TupleToObject(Tuple(types)));
|
|
3431
|
+
}
|
|
3432
|
+
//#endregion
|
|
3433
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_union.mjs
|
|
3434
|
+
function CollapseUnionProperties(left, right) {
|
|
3435
|
+
return Keys(left).filter((key) => key in right).reduce((result, key) => {
|
|
3436
|
+
return {
|
|
3437
|
+
...result,
|
|
3438
|
+
[key]: EvaluateUnion([left[key], right[key]])
|
|
3439
|
+
};
|
|
3440
|
+
}, {});
|
|
3441
|
+
}
|
|
3442
|
+
function ReduceVariants(types, result) {
|
|
3443
|
+
return ShiftLeft(types, (left, right) => ReduceVariants(right, CollapseUnionProperties(result, FromType$10(left))), () => result);
|
|
3444
|
+
}
|
|
3445
|
+
function FromUnion$5(types) {
|
|
3446
|
+
return ShiftLeft(types, (left, right) => ReduceVariants(right, FromType$10(left)), () => Unreachable$1());
|
|
3447
|
+
}
|
|
3448
|
+
//#endregion
|
|
3449
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/from_type.mjs
|
|
3450
|
+
function FromType$10(type) {
|
|
3451
|
+
return IsCyclic(type) ? FromCyclic$4(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$4(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$4(type.allOf) : IsUnion(type) ? FromUnion$5(type.anyOf) : IsTuple(type) ? FromTuple$3(type.items) : IsObject(type) ? FromObject$5(type.properties) : {};
|
|
3452
|
+
}
|
|
3453
|
+
//#endregion
|
|
3454
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/object/collapse.mjs
|
|
3455
|
+
/**
|
|
3456
|
+
* Collapses a type into a TObject schema. This is a lossy fast path used to
|
|
3457
|
+
* normalize arbitrary TSchema types into a TObject structure. This function is
|
|
3458
|
+
* primarily used in indexing operations where a normalized object structure
|
|
3459
|
+
* is required. If the type cannot be collapsed, an empty object schema is returned.
|
|
3460
|
+
*/
|
|
3461
|
+
function CollapseToObject(type) {
|
|
3462
|
+
return _Object_$1(FromType$10(type));
|
|
3463
|
+
}
|
|
3464
|
+
//#endregion
|
|
3465
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/helpers/keys.mjs
|
|
3466
|
+
const integerKeyPattern = /* @__PURE__ */ new RegExp("^(?:0|[1-9][0-9]*)$");
|
|
3467
|
+
function ConvertToIntegerKey(value) {
|
|
3468
|
+
const normal = `${value}`;
|
|
3469
|
+
return integerKeyPattern.test(normal) ? parseInt(normal) : value;
|
|
3470
|
+
}
|
|
3471
|
+
//#endregion
|
|
3472
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/from_array.mjs
|
|
3473
|
+
function NormalizeLiteral(value) {
|
|
3474
|
+
return Literal(ConvertToIntegerKey(value));
|
|
3475
|
+
}
|
|
3476
|
+
function NormalizeIndexerTypes(types) {
|
|
3477
|
+
return types.map((type) => NormalizeIndexer(type));
|
|
3478
|
+
}
|
|
3479
|
+
function NormalizeIndexer(type) {
|
|
3480
|
+
return IsIntersect(type) ? Intersect(NormalizeIndexerTypes(type.allOf)) : IsUnion(type) ? Union(NormalizeIndexerTypes(type.anyOf)) : IsLiteral(type) ? NormalizeLiteral(type.const) : type;
|
|
3481
|
+
}
|
|
3482
|
+
function FromArray$2(type, indexer) {
|
|
3483
|
+
return IsExtendsTrueLike(Extends({}, NormalizeIndexer(indexer), Number$2())) ? type : IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Number$2() : Never();
|
|
3484
|
+
}
|
|
3485
|
+
//#endregion
|
|
3486
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs
|
|
3487
|
+
function FromCyclic$3(defs, ref) {
|
|
3488
|
+
return FromType$9(CyclicTarget(defs, ref));
|
|
3489
|
+
}
|
|
3490
|
+
//#endregion
|
|
3491
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs
|
|
3492
|
+
function FromDependent$3(if_, then_, else_) {
|
|
3493
|
+
return FromType$9(EvaluateDependent(if_, then_, else_));
|
|
3494
|
+
}
|
|
3495
|
+
//#endregion
|
|
3496
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_enum.mjs
|
|
3497
|
+
function FromEnum$1(values) {
|
|
3498
|
+
return FromType$9(EvaluateEnum(values));
|
|
3499
|
+
}
|
|
3500
|
+
//#endregion
|
|
3501
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs
|
|
3502
|
+
function FromIntersect$3(types) {
|
|
3503
|
+
return FromType$9(EvaluateIntersect(types));
|
|
3504
|
+
}
|
|
3505
|
+
//#endregion
|
|
3506
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_literal.mjs
|
|
3507
|
+
function FromLiteral$1(value) {
|
|
3508
|
+
return [`${value}`];
|
|
3509
|
+
}
|
|
3510
|
+
//#endregion
|
|
3511
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs
|
|
3512
|
+
function FromTemplateLiteral$1(pattern) {
|
|
3513
|
+
return FromType$9(EvaluateTemplateLiteral(pattern));
|
|
3514
|
+
}
|
|
3515
|
+
//#endregion
|
|
3516
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_union.mjs
|
|
3517
|
+
function FromUnion$4(types) {
|
|
3518
|
+
return types.reduce((result, left) => {
|
|
3519
|
+
return [...result, ...FromType$9(left)];
|
|
3520
|
+
}, []);
|
|
3521
|
+
}
|
|
3522
|
+
//#endregion
|
|
3523
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/from_type.mjs
|
|
3524
|
+
function FromType$9(type) {
|
|
3525
|
+
return IsCyclic(type) ? FromCyclic$3(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$3(type.if, type.then, type.else) : IsEnum(type) ? FromEnum$1(type.enum) : IsIntersect(type) ? FromIntersect$3(type.allOf) : IsLiteral(type) ? FromLiteral$1(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$1(type.pattern) : IsUnion(type) ? FromUnion$4(type.anyOf) : [];
|
|
3526
|
+
}
|
|
3527
|
+
//#endregion
|
|
3528
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs
|
|
3529
|
+
/**
|
|
3530
|
+
* Transforms a type meant as an Indexer into string[] array which is used by Indexable types
|
|
3531
|
+
* like Index, Pick and Omit to select from property keys. This function should only be used
|
|
3532
|
+
* for Object key selection, and not for Array / Tuple key selection as Array-Like structures
|
|
3533
|
+
* require TNumber indexing support.
|
|
3534
|
+
*/
|
|
3535
|
+
function ToIndexableKeys(type) {
|
|
3536
|
+
return FromType$9(type);
|
|
3537
|
+
}
|
|
3538
|
+
//#endregion
|
|
3539
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/this/expand_this.mjs
|
|
3540
|
+
function FromTypes(properties, types) {
|
|
3541
|
+
return types.map((type) => FromType$8(properties, type));
|
|
3542
|
+
}
|
|
3543
|
+
function FromType$8(properties, type) {
|
|
3544
|
+
return IsArray(type) ? _Array_(FromType$8(properties, type.items)) : IsConstructor(type) ? Constructor(FromTypes(properties, type.parameters), FromType$8(properties, type.instanceType)) : IsFunction(type) ? _Function_$1(FromTypes(properties, type.parameters), FromType$8(properties, type.returnType)) : IsTuple(type) ? Tuple(FromTypes(properties, type.items)) : IsUnion(type) ? Union(FromTypes(properties, type.anyOf)) : IsIntersect(type) ? Intersect(FromTypes(properties, type.allOf)) : IsThis(type) ? _Object_$1(properties) : type;
|
|
3545
|
+
}
|
|
3546
|
+
function ExpandThis(properties, type) {
|
|
3547
|
+
return FromType$8(properties, type);
|
|
3548
|
+
}
|
|
3549
|
+
//#endregion
|
|
3550
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/from_object.mjs
|
|
3551
|
+
function IndexProperty(properties, key) {
|
|
3552
|
+
return ExpandThis(properties, key in properties ? properties[key] : Never());
|
|
3553
|
+
}
|
|
3554
|
+
function IndexProperties(properties, keys) {
|
|
3555
|
+
return keys.reduce((result, left) => {
|
|
3556
|
+
return [...result, IndexProperty(properties, left)];
|
|
3557
|
+
}, []);
|
|
3558
|
+
}
|
|
3559
|
+
function FromIndexer(properties, indexer) {
|
|
3560
|
+
return EvaluateUnion(IndexProperties(properties, ToIndexableKeys(indexer)));
|
|
3561
|
+
}
|
|
3562
|
+
const NumericKeyPattern = new RegExp(IntegerKey);
|
|
3563
|
+
function NumericKeys(keys) {
|
|
3564
|
+
return keys.filter((key) => NumericKeyPattern.test(key));
|
|
3565
|
+
}
|
|
3566
|
+
function FromIndexerNumber(properties) {
|
|
3567
|
+
return EvaluateUnion(IndexProperties(properties, NumericKeys(PropertyKeys(properties))));
|
|
3568
|
+
}
|
|
3569
|
+
function FromObject$4(properties, indexer) {
|
|
3570
|
+
return IsNumber(indexer) ? FromIndexerNumber(properties) : FromIndexer(properties, indexer);
|
|
3571
|
+
}
|
|
3572
|
+
//#endregion
|
|
3573
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs
|
|
3574
|
+
function ConvertLiteral(value) {
|
|
3575
|
+
return Literal(ConvertToIntegerKey(value));
|
|
3576
|
+
}
|
|
3577
|
+
function ArrayIndexerTypes(types) {
|
|
3578
|
+
return types.map((type) => FormatArrayIndexer(type));
|
|
3579
|
+
}
|
|
3580
|
+
/** Formats embedded integer-like strings on an Indexer to be number values inline with TS indexing | coercion behaviors. */
|
|
3581
|
+
function FormatArrayIndexer(type) {
|
|
3582
|
+
return IsIntersect(type) ? Intersect(ArrayIndexerTypes(type.allOf)) : IsUnion(type) ? Union(ArrayIndexerTypes(type.anyOf)) : IsLiteral(type) ? ConvertLiteral(type.const) : type;
|
|
3583
|
+
}
|
|
3584
|
+
//#endregion
|
|
3585
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs
|
|
3586
|
+
function IndexElementsWithIndexer(types, indexer) {
|
|
3587
|
+
return types.reduceRight((result, right, index) => {
|
|
3588
|
+
return IsExtendsTrueLike(Extends({}, Literal(index), indexer)) ? [right, ...result] : result;
|
|
3589
|
+
}, []);
|
|
3590
|
+
}
|
|
3591
|
+
function FromTupleWithIndexer(types, indexer) {
|
|
3592
|
+
return EvaluateUnionFast(IndexElementsWithIndexer(types, FormatArrayIndexer(indexer)));
|
|
3593
|
+
}
|
|
3594
|
+
function FromTupleWithoutIndexer(types) {
|
|
3595
|
+
return EvaluateUnionFast(types);
|
|
3596
|
+
}
|
|
3597
|
+
function FromTuple$2(types, indexer) {
|
|
3598
|
+
return IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Literal(types.length) : IsNumber(indexer) || IsInteger(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
|
|
3599
|
+
}
|
|
3600
|
+
//#endregion
|
|
3601
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/from_type.mjs
|
|
3602
|
+
function FromType$7(type, indexer) {
|
|
3603
|
+
return IsArray(type) ? FromArray$2(type.items, indexer) : IsObject(type) ? FromObject$4(type.properties, indexer) : IsTuple(type) ? FromTuple$2(type.items, indexer) : Never();
|
|
3604
|
+
}
|
|
3605
|
+
//#endregion
|
|
3606
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexed/instantiate.mjs
|
|
3607
|
+
function NormalizeType$1(type) {
|
|
3608
|
+
return IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
|
|
3609
|
+
}
|
|
3610
|
+
function IndexAction(type, indexer, options) {
|
|
3611
|
+
return CanInstantiate([type, indexer]) ? Update(FromType$7(NormalizeType$1(type), indexer), {}, options) : IndexDeferred(type, indexer, options);
|
|
3612
|
+
}
|
|
3613
|
+
function IndexInstantiate(context, state, type, indexer, options) {
|
|
3614
|
+
return IndexAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
|
|
3615
|
+
}
|
|
3616
|
+
//#endregion
|
|
3617
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/instance_type.mjs
|
|
3618
|
+
/** Creates a deferred InstanceType action. */
|
|
3619
|
+
function InstanceTypeDeferred(type, options = {}) {
|
|
3620
|
+
return Deferred("InstanceType", [type], options);
|
|
3621
|
+
}
|
|
3622
|
+
/** Applies a InstanceType action to the given type. */
|
|
3623
|
+
function InstanceType(type, options = {}) {
|
|
3624
|
+
return InstanceTypeAction(type, options);
|
|
3625
|
+
}
|
|
3626
|
+
//#endregion
|
|
3627
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs
|
|
3628
|
+
function InstanceTypeOperation(type) {
|
|
3629
|
+
return IsConstructor(type) ? type["instanceType"] : Never();
|
|
3630
|
+
}
|
|
3631
|
+
function InstanceTypeAction(type, options) {
|
|
3632
|
+
return CanInstantiate([type]) ? Update(InstanceTypeOperation(type), {}, options) : InstanceTypeDeferred(type, options);
|
|
3633
|
+
}
|
|
3634
|
+
function InstanceTypeInstantiate(context, state, type, options = {}) {
|
|
3635
|
+
return InstanceTypeAction(InstantiateType(context, state, type), options);
|
|
3636
|
+
}
|
|
3637
|
+
//#endregion
|
|
3638
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/keyof.mjs
|
|
3639
|
+
/** Creates a deferred KeyOf action. */
|
|
3640
|
+
function KeyOfDeferred(type, options = {}) {
|
|
3641
|
+
return Deferred("KeyOf", [type], options);
|
|
3642
|
+
}
|
|
3643
|
+
/** Applies a KeyOf action to the given type. */
|
|
3644
|
+
function KeyOf(type, options = {}) {
|
|
3645
|
+
return KeyOfAction(type, options);
|
|
3646
|
+
}
|
|
3647
|
+
//#endregion
|
|
3648
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_any.mjs
|
|
3649
|
+
function FromAny() {
|
|
3650
|
+
return Union([
|
|
3651
|
+
Number$2(),
|
|
3652
|
+
String$2(),
|
|
3653
|
+
Symbol()
|
|
3654
|
+
]);
|
|
3655
|
+
}
|
|
3656
|
+
//#endregion
|
|
3657
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_array.mjs
|
|
3658
|
+
function FromArray$1(_type) {
|
|
3659
|
+
return Number$2();
|
|
3660
|
+
}
|
|
3661
|
+
//#endregion
|
|
3662
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_object.mjs
|
|
3663
|
+
function FromPropertyKeys(keys) {
|
|
3664
|
+
return keys.reduce((result, left) => {
|
|
3665
|
+
return IsLiteralValue(left) ? [...result, Literal(ConvertToIntegerKey(left))] : Unreachable$1();
|
|
3666
|
+
}, []);
|
|
3667
|
+
}
|
|
3668
|
+
function FromObject$3(properties) {
|
|
3669
|
+
return EvaluateUnionFast(FromPropertyKeys(Keys(properties)));
|
|
3670
|
+
}
|
|
3671
|
+
//#endregion
|
|
3672
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_record.mjs
|
|
3673
|
+
function FromRecord(type) {
|
|
3674
|
+
return RecordKey(type);
|
|
3675
|
+
}
|
|
3676
|
+
//#endregion
|
|
3677
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs
|
|
3678
|
+
function FromTuple$1(types) {
|
|
3679
|
+
return EvaluateUnionFast(types.map((_, index) => Literal(index)));
|
|
3680
|
+
}
|
|
3681
|
+
//#endregion
|
|
3682
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/from_type.mjs
|
|
3683
|
+
function FromType$6(type) {
|
|
3684
|
+
return IsAny(type) ? FromAny() : IsArray(type) ? FromArray$1(type.items) : IsObject(type) ? FromObject$3(type.properties) : IsRecord(type) ? FromRecord(type) : IsTuple(type) ? FromTuple$1(type.items) : Never();
|
|
3685
|
+
}
|
|
3686
|
+
//#endregion
|
|
3687
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/keyof/instantiate.mjs
|
|
3688
|
+
function NormalizeType(type) {
|
|
3689
|
+
return IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
|
|
3690
|
+
}
|
|
3691
|
+
function KeyOfAction(type, options) {
|
|
3692
|
+
return CanInstantiate([type]) ? Update(FromType$6(NormalizeType(type)), {}, options) : KeyOfDeferred(type, options);
|
|
3693
|
+
}
|
|
3694
|
+
function KeyOfInstantiate(context, state, type, options) {
|
|
3695
|
+
return KeyOfAction(InstantiateType(context, state, type), options);
|
|
3696
|
+
}
|
|
3697
|
+
//#endregion
|
|
3698
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/mapped.mjs
|
|
3699
|
+
/** Creates a deferred Mapped action. */
|
|
3700
|
+
function MappedDeferred(identifier, type, as, property, options = {}) {
|
|
3701
|
+
return Deferred("Mapped", [
|
|
3702
|
+
identifier,
|
|
3703
|
+
type,
|
|
3704
|
+
as,
|
|
3705
|
+
property
|
|
3706
|
+
], options);
|
|
3707
|
+
}
|
|
3708
|
+
/** Applies a Mapped action using the given types. */
|
|
3709
|
+
function Mapped(identifier, type, as, property, options = {}) {
|
|
3710
|
+
return MappedAction({}, State([], []), identifier, type, as, property, options);
|
|
3711
|
+
}
|
|
3712
|
+
//#endregion
|
|
3713
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs
|
|
3714
|
+
function FromTemplateLiteral(pattern) {
|
|
3715
|
+
return FromType$5(EvaluateTemplateLiteral(pattern));
|
|
3716
|
+
}
|
|
3717
|
+
function FromUnion$3(types) {
|
|
3718
|
+
return types.reduce((result, left) => {
|
|
3719
|
+
return [...result, ...FromType$5(left)];
|
|
3720
|
+
}, []);
|
|
3721
|
+
}
|
|
3722
|
+
function FromEnum(values) {
|
|
3723
|
+
return FromType$5(EvaluateEnum(values));
|
|
3724
|
+
}
|
|
3725
|
+
function FromLiteral(value) {
|
|
3726
|
+
return IsNumber$1(value) ? [Literal(`${value}`)] : [Literal(value)];
|
|
3727
|
+
}
|
|
3728
|
+
function FromType$5(type) {
|
|
3729
|
+
return IsEnum(type) ? FromEnum(type.enum) : IsLiteral(type) ? FromLiteral(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral(type.pattern) : IsUnion(type) ? FromUnion$3(type.anyOf) : [type];
|
|
3730
|
+
}
|
|
3731
|
+
function MappedVariants(type) {
|
|
3732
|
+
return FromType$5(type);
|
|
3733
|
+
}
|
|
3734
|
+
//#endregion
|
|
3735
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs
|
|
3736
|
+
function CanonicalAs(instantiatedAs) {
|
|
3737
|
+
return IsTemplateLiteral(instantiatedAs) ? EvaluateTemplateLiteral(instantiatedAs.pattern) : instantiatedAs;
|
|
3738
|
+
}
|
|
3739
|
+
function MappedVariant(context, state, identifier, variant, as, property) {
|
|
3740
|
+
const variantContext = Assign(context, { [identifier["name"]]: variant });
|
|
3741
|
+
const canonicalAs = CanonicalAs(InstantiateType(variantContext, state, as));
|
|
3742
|
+
const instantiatedProperty = InstantiateType(variantContext, state, property);
|
|
3743
|
+
return IsLiteralNumber(canonicalAs) || IsLiteralString(canonicalAs) ? { [canonicalAs.const]: instantiatedProperty } : {};
|
|
3744
|
+
}
|
|
3745
|
+
function MappedProperties(context, state, identifier, variants, as, property) {
|
|
3746
|
+
return variants.reduce((result, left) => {
|
|
3747
|
+
return [...result, MappedVariant(context, state, identifier, left, as, property)];
|
|
3748
|
+
}, []);
|
|
3749
|
+
}
|
|
3750
|
+
function MappedObjects(properties) {
|
|
3751
|
+
return properties.reduce((result, left) => {
|
|
3752
|
+
return [...result, _Object_$1(left)];
|
|
3753
|
+
}, []);
|
|
3754
|
+
}
|
|
3755
|
+
function MappedOperation(context, state, identifier, type, as, property) {
|
|
3756
|
+
return EvaluateIntersect(MappedObjects(MappedProperties(context, state, identifier, MappedVariants(type), as, property)));
|
|
3757
|
+
}
|
|
3758
|
+
//#endregion
|
|
3759
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/mapped/instantiate.mjs
|
|
3760
|
+
function MappedAction(context, state, identifier, type, as, property, options) {
|
|
3761
|
+
return CanInstantiate([type]) ? Update(MappedOperation(context, state, identifier, type, as, property), {}, options) : MappedDeferred(identifier, type, as, property, options);
|
|
3762
|
+
}
|
|
3763
|
+
function MappedInstantiate(context, state, identifier, type, as, property, options) {
|
|
3764
|
+
return MappedAction(context, state, identifier, InstantiateType(context, state, type), as, property, options);
|
|
3765
|
+
}
|
|
3766
|
+
//#endregion
|
|
3767
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/module/instantiate.mjs
|
|
3768
|
+
function InstantiateCyclics(context, declarations, cyclicKeys) {
|
|
3769
|
+
const declarationContext = Assign(context, declarations);
|
|
3770
|
+
return Keys(declarations).filter((key) => cyclicKeys.includes(key)).reduce((result, key) => {
|
|
3771
|
+
return {
|
|
3772
|
+
...result,
|
|
3773
|
+
[key]: InstantiateCyclic(declarationContext, key, declarations[key])
|
|
3774
|
+
};
|
|
3775
|
+
}, {});
|
|
3776
|
+
}
|
|
3777
|
+
function InstantiateNonCyclics(context, declarations, cyclicKeys) {
|
|
3778
|
+
const declarationContext = Assign(context, declarations);
|
|
3779
|
+
return Keys(declarations).filter((key) => !cyclicKeys.includes(key)).reduce((result, key) => {
|
|
3780
|
+
return {
|
|
3781
|
+
...result,
|
|
3782
|
+
[key]: InstantiateType(declarationContext, State([], []), declarations[key])
|
|
3783
|
+
};
|
|
3784
|
+
}, {});
|
|
3785
|
+
}
|
|
3786
|
+
function InstantiateModule(context, declarations, options) {
|
|
3787
|
+
const cyclicCandidates = CyclicCandidates(declarations);
|
|
3788
|
+
const instantiatedCyclics = InstantiateCyclics(context, declarations, cyclicCandidates);
|
|
3789
|
+
const instantiatedNonCyclics = InstantiateNonCyclics(context, declarations, cyclicCandidates);
|
|
3790
|
+
return Update({
|
|
3791
|
+
...instantiatedCyclics,
|
|
3792
|
+
...instantiatedNonCyclics
|
|
3793
|
+
}, {}, options);
|
|
3794
|
+
}
|
|
3795
|
+
function ModuleInstantiate(context, _state, declarations, options) {
|
|
3796
|
+
return InstantiateModule(context, declarations, options);
|
|
3797
|
+
}
|
|
3798
|
+
//#endregion
|
|
3799
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/non_nullable.mjs
|
|
3800
|
+
/** Creates a deferred NonNullable action. */
|
|
3801
|
+
function NonNullableDeferred(type, options = {}) {
|
|
3802
|
+
return Deferred("NonNullable", [type], options);
|
|
3803
|
+
}
|
|
3804
|
+
/** Applies a NonNullable action to the given type. */
|
|
3805
|
+
function NonNullable(type, options = {}) {
|
|
3806
|
+
return NonNullableAction(type, options);
|
|
3807
|
+
}
|
|
3808
|
+
//#endregion
|
|
3809
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs
|
|
3810
|
+
function NonNullableOperation(type) {
|
|
3811
|
+
return ExcludeAction(type, Union([Null(), Undefined()]), {});
|
|
3812
|
+
}
|
|
3813
|
+
function NonNullableAction(type, options) {
|
|
3814
|
+
return CanInstantiate([type]) ? Update(NonNullableOperation(type), {}, options) : NonNullableDeferred(type, options);
|
|
3815
|
+
}
|
|
3816
|
+
function NonNullableInstantiate(context, state, type, options) {
|
|
3817
|
+
return NonNullableAction(InstantiateType(context, state, type), options);
|
|
3818
|
+
}
|
|
3819
|
+
//#endregion
|
|
3820
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/omit.mjs
|
|
3821
|
+
/** Creates a deferred Omit action. */
|
|
3822
|
+
function OmitDeferred(type, indexer, options = {}) {
|
|
3823
|
+
return Deferred("Omit", [type, indexer], options);
|
|
3824
|
+
}
|
|
3825
|
+
/** Applies a Omit action using the given types. */
|
|
3826
|
+
function Omit(type, indexer_or_keys, options = {}) {
|
|
3827
|
+
return OmitAction(type, IsArray$1(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys, options);
|
|
3828
|
+
}
|
|
3829
|
+
//#endregion
|
|
3830
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs
|
|
3831
|
+
/** Transforms a type into a TProperties used for indexing operations */
|
|
3832
|
+
function ToIndexable(type) {
|
|
3833
|
+
const collapsed = CollapseToObject(type);
|
|
3834
|
+
return IsObject(collapsed) ? collapsed.properties : Unreachable$1();
|
|
3835
|
+
}
|
|
3836
|
+
//#endregion
|
|
3837
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/omit/from_type.mjs
|
|
3838
|
+
function FromKeys$1(properties, keys) {
|
|
3839
|
+
return Keys(properties).reduce((result, key) => {
|
|
3840
|
+
return keys.includes(key) ? result : {
|
|
3841
|
+
...result,
|
|
3842
|
+
[key]: properties[key]
|
|
3843
|
+
};
|
|
3844
|
+
}, {});
|
|
3845
|
+
}
|
|
3846
|
+
function FromType$4(type, indexer) {
|
|
3847
|
+
return _Object_$1(FromKeys$1(ToIndexable(type), ToIndexableKeys(indexer)));
|
|
3848
|
+
}
|
|
3849
|
+
//#endregion
|
|
3850
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/omit/instantiate.mjs
|
|
3851
|
+
function OmitAction(type, indexer, options) {
|
|
3852
|
+
return CanInstantiate([type, indexer]) ? Update(FromType$4(type, indexer), {}, options) : OmitDeferred(type, indexer, options);
|
|
3853
|
+
}
|
|
3854
|
+
function OmitInstantiate(context, state, type, indexer, options) {
|
|
3855
|
+
return OmitAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
|
|
3856
|
+
}
|
|
3857
|
+
//#endregion
|
|
3858
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/parameters.mjs
|
|
3859
|
+
/** Creates a deferred Parameters action. */
|
|
3860
|
+
function ParametersDeferred(type, options = {}) {
|
|
3861
|
+
return Deferred("Parameters", [type], options);
|
|
3862
|
+
}
|
|
3863
|
+
/** Applies a Parameters action to the given type. */
|
|
3864
|
+
function Parameters(type, options = {}) {
|
|
3865
|
+
return ParametersAction(type, options);
|
|
3866
|
+
}
|
|
3867
|
+
//#endregion
|
|
3868
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/parameters/instantiate.mjs
|
|
3869
|
+
function ParametersOperation(type) {
|
|
3870
|
+
const parameters = IsFunction(type) ? type["parameters"] : [];
|
|
3871
|
+
return Tuple(InstantiateElements({}, State([], []), parameters));
|
|
3872
|
+
}
|
|
3873
|
+
function ParametersAction(type, options) {
|
|
3874
|
+
return CanInstantiate([type]) ? Update(ParametersOperation(type), {}, options) : ParametersDeferred(type, options);
|
|
3875
|
+
}
|
|
3876
|
+
function ParametersInstantiate(context, state, type, options) {
|
|
3877
|
+
return ParametersAction(InstantiateType(context, state, type), options);
|
|
3878
|
+
}
|
|
3879
|
+
//#endregion
|
|
3880
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/partial.mjs
|
|
3881
|
+
/** Creates a deferred Partial action. */
|
|
3882
|
+
function PartialDeferred(type, options = {}) {
|
|
3883
|
+
return Deferred("Partial", [type], options);
|
|
3884
|
+
}
|
|
3885
|
+
/** Applies a Partial action to the given type. */
|
|
3886
|
+
function Partial(type, options = {}) {
|
|
3887
|
+
return PartialAction(type, options);
|
|
3888
|
+
}
|
|
3889
|
+
//#endregion
|
|
3890
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs
|
|
3891
|
+
function FromCyclic$2(defs, ref) {
|
|
3892
|
+
const partial = FromType$3(CyclicTarget(defs, ref));
|
|
3893
|
+
return Cyclic(Assign(defs, { [ref]: partial }), ref);
|
|
3894
|
+
}
|
|
3895
|
+
//#endregion
|
|
3896
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_dependent.mjs
|
|
3897
|
+
function FromDependent$2(if_, then_, else_) {
|
|
3898
|
+
return FromType$3(EvaluateDependent(if_, then_, else_));
|
|
3899
|
+
}
|
|
3900
|
+
//#endregion
|
|
3901
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_intersect.mjs
|
|
3902
|
+
function FromIntersect$2(types) {
|
|
3903
|
+
return FromType$3(EvaluateIntersect(types));
|
|
3904
|
+
}
|
|
3905
|
+
//#endregion
|
|
3906
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_union.mjs
|
|
3907
|
+
function FromUnion$2(types) {
|
|
3908
|
+
return Union(types.map((type) => FromType$3(type)));
|
|
3909
|
+
}
|
|
3910
|
+
//#endregion
|
|
3911
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_object.mjs
|
|
3912
|
+
function FromObject$2(properties) {
|
|
3913
|
+
return _Object_$1(Keys(properties).reduce((result, left) => {
|
|
3914
|
+
return {
|
|
3915
|
+
...result,
|
|
3916
|
+
[left]: AddOptional(properties[left])
|
|
3917
|
+
};
|
|
3918
|
+
}, {}));
|
|
3919
|
+
}
|
|
3920
|
+
//#endregion
|
|
3921
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/from_type.mjs
|
|
3922
|
+
function FromType$3(type) {
|
|
3923
|
+
return IsCyclic(type) ? FromCyclic$2(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$2(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$2(type.allOf) : IsUnion(type) ? FromUnion$2(type.anyOf) : IsObject(type) ? FromObject$2(type.properties) : _Object_$1({});
|
|
3924
|
+
}
|
|
3925
|
+
//#endregion
|
|
3926
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/partial/instantiate.mjs
|
|
3927
|
+
function PartialAction(type, options) {
|
|
3928
|
+
return CanInstantiate([type]) ? Update(FromType$3(type), {}, options) : PartialDeferred(type, options);
|
|
3929
|
+
}
|
|
3930
|
+
function PartialInstantiate(context, state, type, options) {
|
|
3931
|
+
return PartialAction(InstantiateType(context, state, type), options);
|
|
3932
|
+
}
|
|
3933
|
+
//#endregion
|
|
3934
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/pick.mjs
|
|
3935
|
+
/** Creates a deferred Pick action. */
|
|
3936
|
+
function PickDeferred(type, indexer, options = {}) {
|
|
3937
|
+
return Deferred("Pick", [type, indexer], options);
|
|
3938
|
+
}
|
|
3939
|
+
/** Applies a Pick action using the given types. */
|
|
3940
|
+
function Pick(type, indexer_or_keys, options = {}) {
|
|
3941
|
+
return PickAction(type, IsArray$1(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys, options);
|
|
3942
|
+
}
|
|
3943
|
+
//#endregion
|
|
3944
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/pick/from_type.mjs
|
|
3945
|
+
function FromKeys(properties, keys) {
|
|
3946
|
+
return Keys(properties).reduce((result, key) => {
|
|
3947
|
+
return keys.includes(key) ? Assign(result, { [key]: properties[key] }) : result;
|
|
3948
|
+
}, {});
|
|
3949
|
+
}
|
|
3950
|
+
function FromType$2(type, indexer) {
|
|
3951
|
+
return _Object_$1(FromKeys(ToIndexable(type), ToIndexableKeys(indexer)));
|
|
3952
|
+
}
|
|
3953
|
+
//#endregion
|
|
3954
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/pick/instantiate.mjs
|
|
3955
|
+
function PickAction(type, indexer, options) {
|
|
3956
|
+
return CanInstantiate([type, indexer]) ? Update(FromType$2(type, indexer), {}, options) : PickDeferred(type, indexer, options);
|
|
3957
|
+
}
|
|
3958
|
+
function PickInstantiate(context, state, type, indexer, options) {
|
|
3959
|
+
return PickAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
|
|
3960
|
+
}
|
|
3961
|
+
//#endregion
|
|
3962
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/readonly_object.mjs
|
|
3963
|
+
/** Creates a deferred ReadonlyType action. */
|
|
3964
|
+
function ReadonlyObjectDeferred(type, options = {}) {
|
|
3965
|
+
return Deferred("ReadonlyObject", [type], options);
|
|
3966
|
+
}
|
|
3967
|
+
/** This type is an alias for TypeScript's `Readonly<T>` utility type. It will make all properties of a TObject readonly or marks an TArray or TTuple as immutable `readonly T[]`. */
|
|
3968
|
+
function ReadonlyObject(type, options = {}) {
|
|
3969
|
+
return ReadonlyObjectAction(type, options);
|
|
3970
|
+
}
|
|
3971
|
+
/**
|
|
3972
|
+
* This type has been renamed to ReadonlyObject.
|
|
3973
|
+
* @deprecated
|
|
3974
|
+
*/
|
|
3975
|
+
const ReadonlyType = ReadonlyObject;
|
|
3976
|
+
//#endregion
|
|
3977
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs
|
|
3978
|
+
function FromArray(type) {
|
|
3979
|
+
return AddImmutable(_Array_(type));
|
|
3980
|
+
}
|
|
3981
|
+
//#endregion
|
|
3982
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs
|
|
3983
|
+
function FromCyclic$1(defs, ref) {
|
|
3984
|
+
const partial = FromType$1(CyclicTarget(defs, ref));
|
|
3985
|
+
return Cyclic(Assign(defs, { [ref]: partial }), ref);
|
|
3986
|
+
}
|
|
3987
|
+
//#endregion
|
|
3988
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs
|
|
3989
|
+
function FromDependent$1(if_, then_, else_) {
|
|
3990
|
+
return FromType$1(EvaluateDependent(if_, then_, else_));
|
|
3991
|
+
}
|
|
3992
|
+
//#endregion
|
|
3993
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs
|
|
3994
|
+
function FromIntersect$1(types) {
|
|
3995
|
+
return FromType$1(EvaluateIntersect(types));
|
|
3996
|
+
}
|
|
3997
|
+
//#endregion
|
|
3998
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs
|
|
3999
|
+
function FromObject$1(properties) {
|
|
4000
|
+
return _Object_$1(Keys(properties).reduce((result, left) => {
|
|
4001
|
+
return {
|
|
4002
|
+
...result,
|
|
4003
|
+
[left]: AddReadonly(properties[left])
|
|
4004
|
+
};
|
|
4005
|
+
}, {}));
|
|
4006
|
+
}
|
|
4007
|
+
//#endregion
|
|
4008
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs
|
|
4009
|
+
function FromTuple(types) {
|
|
4010
|
+
return AddImmutable(Tuple(types));
|
|
4011
|
+
}
|
|
4012
|
+
//#endregion
|
|
4013
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs
|
|
4014
|
+
function FromUnion$1(types) {
|
|
4015
|
+
return Union(types.map((type) => FromType$1(type)));
|
|
4016
|
+
}
|
|
4017
|
+
//#endregion
|
|
4018
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs
|
|
4019
|
+
function FromType$1(type) {
|
|
4020
|
+
return IsArray(type) ? FromArray(type.items) : IsCyclic(type) ? FromCyclic$1(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$1(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$1(type.allOf) : IsObject(type) ? FromObject$1(type.properties) : IsTuple(type) ? FromTuple(type.items) : IsUnion(type) ? FromUnion$1(type.anyOf) : type;
|
|
4021
|
+
}
|
|
4022
|
+
//#endregion
|
|
4023
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs
|
|
4024
|
+
function ReadonlyObjectAction(type, options) {
|
|
4025
|
+
return CanInstantiate([type]) ? Update(FromType$1(type), {}, options) : ReadonlyObjectDeferred(type);
|
|
4026
|
+
}
|
|
4027
|
+
function ReadonlyObjectInstantiate(context, state, type, options) {
|
|
4028
|
+
return ReadonlyObjectAction(InstantiateType(context, state, type), options);
|
|
4029
|
+
}
|
|
4030
|
+
//#endregion
|
|
4031
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/ref/instantiate.mjs
|
|
4032
|
+
function RefInstantiate(context, state, type, ref) {
|
|
4033
|
+
return state.visited.includes(ref) ? type : ref in context ? InstantiateType(context, State(state["callstack"], [...state["visited"], ref]), context[ref]) : type;
|
|
4034
|
+
}
|
|
4035
|
+
//#endregion
|
|
4036
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_cyclic.mjs
|
|
4037
|
+
function FromCyclic(defs, ref) {
|
|
4038
|
+
const partial = FromType(CyclicTarget(defs, ref));
|
|
4039
|
+
return Cyclic(Assign(defs, { [ref]: partial }), ref);
|
|
4040
|
+
}
|
|
4041
|
+
//#endregion
|
|
4042
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_dependent.mjs
|
|
4043
|
+
function FromDependent(if_, then_, else_) {
|
|
4044
|
+
return FromType(EvaluateDependent(if_, then_, else_));
|
|
4045
|
+
}
|
|
4046
|
+
//#endregion
|
|
4047
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_intersect.mjs
|
|
4048
|
+
function FromIntersect(types) {
|
|
4049
|
+
return FromType(EvaluateIntersect(types));
|
|
4050
|
+
}
|
|
4051
|
+
//#endregion
|
|
4052
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_union.mjs
|
|
4053
|
+
function FromUnion(types) {
|
|
4054
|
+
return Union(types.map((type) => FromType(type)));
|
|
4055
|
+
}
|
|
4056
|
+
//#endregion
|
|
4057
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_object.mjs
|
|
4058
|
+
function FromObject(properties) {
|
|
4059
|
+
return _Object_$1(Keys(properties).reduce((result, left) => {
|
|
4060
|
+
return {
|
|
4061
|
+
...result,
|
|
4062
|
+
[left]: RemoveOptional(properties[left])
|
|
4063
|
+
};
|
|
4064
|
+
}, {}));
|
|
4065
|
+
}
|
|
4066
|
+
//#endregion
|
|
4067
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/from_type.mjs
|
|
4068
|
+
function FromType(type) {
|
|
4069
|
+
return IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) : IsDependent(type) ? FromDependent(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion(type.anyOf) : IsObject(type) ? FromObject(type.properties) : _Object_$1({});
|
|
4070
|
+
}
|
|
4071
|
+
//#endregion
|
|
4072
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/required.mjs
|
|
4073
|
+
/** Creates a deferred Required action. */
|
|
4074
|
+
function RequiredDeferred(type, options = {}) {
|
|
4075
|
+
return Deferred("Required", [type], options);
|
|
4076
|
+
}
|
|
4077
|
+
/** Applies a Required action to the given type. */
|
|
4078
|
+
function Required(type, options = {}) {
|
|
4079
|
+
return RequiredAction(type, options);
|
|
4080
|
+
}
|
|
4081
|
+
//#endregion
|
|
4082
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/required/instantiate.mjs
|
|
4083
|
+
function RequiredAction(type, options) {
|
|
4084
|
+
return CanInstantiate([type]) ? Update(FromType(type), {}, options) : RequiredDeferred(type, options);
|
|
4085
|
+
}
|
|
4086
|
+
function RequiredInstantiate(context, state, type, options) {
|
|
4087
|
+
return RequiredAction(InstantiateType(context, state, type), options);
|
|
4088
|
+
}
|
|
4089
|
+
//#endregion
|
|
4090
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/return_type.mjs
|
|
4091
|
+
/** Creates a deferred ReturnType action. */
|
|
4092
|
+
function ReturnTypeDeferred(type, options = {}) {
|
|
4093
|
+
return Deferred("ReturnType", [type], options);
|
|
4094
|
+
}
|
|
4095
|
+
/** Applies a ReturnType action to the given type. */
|
|
4096
|
+
function ReturnType(type, options = {}) {
|
|
4097
|
+
return ReturnTypeAction(type, options);
|
|
4098
|
+
}
|
|
4099
|
+
//#endregion
|
|
4100
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/return_type/instantiate.mjs
|
|
4101
|
+
function ReturnTypeOperation(type) {
|
|
4102
|
+
return IsFunction(type) ? type["returnType"] : Never();
|
|
4103
|
+
}
|
|
4104
|
+
function ReturnTypeAction(type, options) {
|
|
4105
|
+
return CanInstantiate([type]) ? Update(ReturnTypeOperation(type), {}, options) : ReturnTypeDeferred(type, options);
|
|
4106
|
+
}
|
|
4107
|
+
function ReturnTypeInstantiate(context, state, type, options = {}) {
|
|
4108
|
+
return ReturnTypeAction(InstantiateType(context, state, type), options);
|
|
4109
|
+
}
|
|
4110
|
+
//#endregion
|
|
4111
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/with.mjs
|
|
4112
|
+
/** Creates a deferred With action. */
|
|
4113
|
+
function WithDeferred(type, options) {
|
|
4114
|
+
return Deferred("With", [type, options], {});
|
|
4115
|
+
}
|
|
4116
|
+
/** Applies annotation options to the given type. */
|
|
4117
|
+
function With(type, options) {
|
|
4118
|
+
return WithAction(type, options);
|
|
4119
|
+
}
|
|
4120
|
+
//#endregion
|
|
4121
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/with/instantiate.mjs
|
|
4122
|
+
function WithAction(type, options) {
|
|
4123
|
+
return CanInstantiate([type]) ? Update(type, {}, options) : WithDeferred(type, options);
|
|
4124
|
+
}
|
|
4125
|
+
function WithInstantiate(context, state, type, options) {
|
|
4126
|
+
return WithAction(InstantiateType(context, state, type), options);
|
|
4127
|
+
}
|
|
4128
|
+
//#endregion
|
|
4129
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/rest/spread.mjs
|
|
4130
|
+
function SpreadElement(type) {
|
|
4131
|
+
return IsRest(type) ? IsTuple(type.items) ? RestSpread(type.items.items) : IsInfer(type.items) ? [type] : IsRef(type.items) ? [type] : [Never()] : [type];
|
|
4132
|
+
}
|
|
4133
|
+
function RestSpread(types) {
|
|
4134
|
+
return types.reduce((result, left) => {
|
|
4135
|
+
return [...result, ...SpreadElement(left)];
|
|
4136
|
+
}, []);
|
|
4137
|
+
}
|
|
4138
|
+
//#endregion
|
|
4139
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/instantiate.mjs
|
|
4140
|
+
function State(callstack, visited) {
|
|
4141
|
+
return {
|
|
4142
|
+
callstack,
|
|
4143
|
+
visited
|
|
4144
|
+
};
|
|
4145
|
+
}
|
|
4146
|
+
function CanInstantiate(types) {
|
|
4147
|
+
return ShiftLeft(types, (left, right) => IsRef(left) ? false : CanInstantiate(right), () => true);
|
|
4148
|
+
}
|
|
4149
|
+
function InstantiateProperties(context, state, properties) {
|
|
4150
|
+
return Keys(properties).reduce((result, key) => {
|
|
4151
|
+
return {
|
|
4152
|
+
...result,
|
|
4153
|
+
[key]: InstantiateType(context, state, properties[key])
|
|
4154
|
+
};
|
|
4155
|
+
}, {});
|
|
4156
|
+
}
|
|
4157
|
+
function InstantiateElements(context, state, types) {
|
|
4158
|
+
return RestSpread(InstantiateTypes(context, state, types));
|
|
4159
|
+
}
|
|
4160
|
+
function InstantiateTypes(context, state, types) {
|
|
4161
|
+
return types.map((type) => InstantiateType(context, state, type));
|
|
4162
|
+
}
|
|
4163
|
+
function WithModifiers(type, instantiatedType) {
|
|
4164
|
+
const withOptional = IsOptional(type) ? AddOptionalAction(instantiatedType, {}) : instantiatedType;
|
|
4165
|
+
const withReadonly = IsReadonly(type) ? AddReadonlyAction(withOptional, {}) : withOptional;
|
|
4166
|
+
return IsImmutable(type) ? AddImmutableAction(withReadonly, {}) : withReadonly;
|
|
4167
|
+
}
|
|
4168
|
+
function InstantiateDeferred(context, state, action, parameters, options) {
|
|
4169
|
+
return IsEqual(action, "AddImmutable") ? AddImmutableInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveImmutable") ? RemoveImmutableInstantiate(context, state, parameters[0], options) : IsEqual(action, "AddReadonly") ? AddReadonlyInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveReadonly") ? RemoveReadonlyInstantiate(context, state, parameters[0], options) : IsEqual(action, "AddOptional") ? AddOptionalInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveOptional") ? RemoveOptionalInstantiate(context, state, parameters[0], options) : IsEqual(action, "Capitalize") ? CapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Conditional") ? ConditionalInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "ConstructorParameters") ? ConstructorParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Evaluate") ? EvaluateInstantiate(context, state, parameters[0], options) : IsEqual(action, "Exclude") ? ExcludeInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Extract") ? ExtractInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Index") ? IndexInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "InstanceType") ? InstanceTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Interface") ? InterfaceInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "KeyOf") ? KeyOfInstantiate(context, state, parameters[0], options) : IsEqual(action, "Lowercase") ? LowercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "Mapped") ? MappedInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "Module") ? ModuleInstantiate(context, state, parameters[0], options) : IsEqual(action, "NonNullable") ? NonNullableInstantiate(context, state, parameters[0], options) : IsEqual(action, "Pick") ? PickInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Parameters") ? ParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Partial") ? PartialInstantiate(context, state, parameters[0], options) : IsEqual(action, "Omit") ? OmitInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "ReadonlyObject") ? ReadonlyObjectInstantiate(context, state, parameters[0], options) : IsEqual(action, "Record") ? RecordInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Required") ? RequiredInstantiate(context, state, parameters[0], options) : IsEqual(action, "ReturnType") ? ReturnTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "TemplateLiteral") ? TemplateLiteralInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uncapitalize") ? UncapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uppercase") ? UppercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "With") ? WithInstantiate(context, state, parameters[0], parameters[1]) : Deferred(action, parameters, options);
|
|
4170
|
+
}
|
|
4171
|
+
function InstantiateImmediate(context, state, type) {
|
|
4172
|
+
return WithModifiers(type, IsRef(type) ? RefInstantiate(context, state, type, type.$ref) : IsArray(type) ? _Array_(InstantiateType(context, state, type.items), ArrayOptions(type)) : IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) : IsConstructor(type) ? Constructor(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) : IsFunction(type) ? _Function_$1(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) : IsDependent(type) ? Dependent$1(InstantiateType(context, state, type.if), InstantiateType(context, state, type.then), InstantiateType(context, state, type.else), DependentOptions(type)) : IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) : IsObject(type) ? _Object_$1(InstantiateProperties(context, state, type.properties), ObjectOptions(type)) : IsRecord(type) ? RecordFromPattern(RecordPattern(type), InstantiateType(context, state, RecordValue(type))) : IsRest(type) ? Rest(InstantiateType(context, state, type.items)) : IsTuple(type) ? Tuple(InstantiateElements(context, state, type.items), TupleOptions(type)) : IsUnion(type) ? Union(InstantiateTypes(context, state, type.anyOf), UnionOptions(type)) : type);
|
|
4173
|
+
}
|
|
4174
|
+
function InstantiateType(context, state, type) {
|
|
4175
|
+
return IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : InstantiateImmediate(context, state, type);
|
|
4176
|
+
}
|
|
4177
|
+
/** Instantiates computed schematics using the given context and type. */
|
|
4178
|
+
function Instantiate(context, type) {
|
|
4179
|
+
return InstantiateType(context, State([], []), type);
|
|
4180
|
+
}
|
|
4181
|
+
//#endregion
|
|
4182
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs
|
|
4183
|
+
function AddImmutableOperation(type) {
|
|
4184
|
+
return Update(type, { "~immutable": true }, {});
|
|
4185
|
+
}
|
|
4186
|
+
function AddImmutableAction(type, options) {
|
|
4187
|
+
return Update(AddImmutableOperation(type), {}, options);
|
|
4188
|
+
}
|
|
4189
|
+
function AddImmutableInstantiate(context, state, type, options) {
|
|
4190
|
+
return AddImmutableAction(InstantiateType(context, state, type), options);
|
|
4191
|
+
}
|
|
4192
|
+
//#endregion
|
|
4193
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/_add_immutable.mjs
|
|
4194
|
+
/** Creates a deferred AddImmutable action. */
|
|
4195
|
+
function AddImmutableDeferred(type, options = {}) {
|
|
4196
|
+
return Deferred("AddImmutable", [type], options);
|
|
4197
|
+
}
|
|
4198
|
+
/** Applies an AddImmutable action to a type. */
|
|
4199
|
+
function AddImmutable(type, options = {}) {
|
|
4200
|
+
return AddImmutableAction(type, options);
|
|
4201
|
+
}
|
|
4202
|
+
//#endregion
|
|
4203
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/evaluate.mjs
|
|
4204
|
+
/** Creates a deferred Evaluate action. */
|
|
4205
|
+
function EvaluateDeferred(type, options = {}) {
|
|
4206
|
+
return Deferred("Evaluate", [type], options);
|
|
4207
|
+
}
|
|
4208
|
+
/** Applies an Evaluate action to a type. */
|
|
4209
|
+
function Evaluate(type, options = {}) {
|
|
4210
|
+
return EvaluateAction(type, options);
|
|
4211
|
+
}
|
|
4212
|
+
//#endregion
|
|
4213
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/action/module.mjs
|
|
4214
|
+
/** Creates a deferred Module action. */
|
|
4215
|
+
function ModuleDeferred(declarations, options = {}) {
|
|
4216
|
+
return Deferred("Module", [declarations], options);
|
|
4217
|
+
}
|
|
4218
|
+
/** Creates a Module with the given declarations */
|
|
4219
|
+
function Module(declarations, options = {}) {
|
|
4220
|
+
return ModuleInstantiate({}, State([], []), declarations, options);
|
|
4221
|
+
}
|
|
4222
|
+
//#endregion
|
|
4223
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/type/script/script.mjs
|
|
4224
|
+
/** Parses a type from a TypeScript type expression */
|
|
4225
|
+
function Script(...args) {
|
|
4226
|
+
const [context, input, options] = Match$2(args, {
|
|
4227
|
+
2: (script, options) => IsString$1(script) ? [
|
|
4228
|
+
{},
|
|
4229
|
+
script,
|
|
4230
|
+
options
|
|
4231
|
+
] : [
|
|
4232
|
+
script,
|
|
4233
|
+
options,
|
|
4234
|
+
{}
|
|
4235
|
+
],
|
|
4236
|
+
3: (context, script, options) => [
|
|
4237
|
+
context,
|
|
4238
|
+
script,
|
|
4239
|
+
options
|
|
4240
|
+
],
|
|
4241
|
+
1: (script) => [
|
|
4242
|
+
{},
|
|
4243
|
+
script,
|
|
4244
|
+
{}
|
|
4245
|
+
]
|
|
4246
|
+
});
|
|
4247
|
+
const result = Script$1(input);
|
|
4248
|
+
return Update(IsArray$1(result) && IsEqual(result.length, 2) ? InstantiateType(context, State([], []), result[0]) : Never(), {}, options);
|
|
4249
|
+
}
|
|
4250
|
+
//#endregion
|
|
4251
|
+
//#region node_modules/.pnpm/typebox@1.3.13/node_modules/typebox/build/typebox.mjs
|
|
4252
|
+
var typebox_exports = /* @__PURE__ */ __exportAll({
|
|
4253
|
+
Any: () => Any,
|
|
4254
|
+
Array: () => _Array_,
|
|
4255
|
+
BigInt: () => BigInt$2,
|
|
4256
|
+
Boolean: () => Boolean$1,
|
|
4257
|
+
Call: () => Call,
|
|
4258
|
+
Capitalize: () => Capitalize,
|
|
4259
|
+
Codec: () => Codec,
|
|
4260
|
+
Conditional: () => Conditional,
|
|
4261
|
+
Constructor: () => Constructor,
|
|
4262
|
+
ConstructorParameters: () => ConstructorParameters,
|
|
4263
|
+
Cyclic: () => Cyclic,
|
|
4264
|
+
Decode: () => Decode,
|
|
4265
|
+
DecodeBuilder: () => DecodeBuilder,
|
|
4266
|
+
Dependent: () => Dependent$1,
|
|
4267
|
+
Encode: () => Encode,
|
|
4268
|
+
EncodeBuilder: () => EncodeBuilder,
|
|
4269
|
+
Enum: () => Enum,
|
|
4270
|
+
Evaluate: () => Evaluate,
|
|
4271
|
+
Exclude: () => Exclude,
|
|
4272
|
+
Extends: () => Extends,
|
|
4273
|
+
ExtendsResult: () => result_exports,
|
|
4274
|
+
Extract: () => Extract,
|
|
4275
|
+
Function: () => _Function_$1,
|
|
4276
|
+
Generic: () => Generic,
|
|
4277
|
+
Identifier: () => Identifier,
|
|
4278
|
+
Immutable: () => Immutable,
|
|
4279
|
+
Index: () => Index,
|
|
4280
|
+
Infer: () => Infer,
|
|
4281
|
+
InstanceType: () => InstanceType,
|
|
4282
|
+
Instantiate: () => Instantiate,
|
|
4283
|
+
Integer: () => Integer$1,
|
|
4284
|
+
Interface: () => Interface,
|
|
4285
|
+
Intersect: () => Intersect,
|
|
4286
|
+
IsAny: () => IsAny,
|
|
4287
|
+
IsArray: () => IsArray,
|
|
4288
|
+
IsBigInt: () => IsBigInt,
|
|
4289
|
+
IsBoolean: () => IsBoolean,
|
|
4290
|
+
IsCall: () => IsCall,
|
|
4291
|
+
IsCodec: () => IsCodec,
|
|
4292
|
+
IsConstructor: () => IsConstructor,
|
|
4293
|
+
IsCyclic: () => IsCyclic,
|
|
4294
|
+
IsDependent: () => IsDependent,
|
|
4295
|
+
IsEnum: () => IsEnum,
|
|
4296
|
+
IsEnumValue: () => IsEnumValue,
|
|
4297
|
+
IsFunction: () => IsFunction,
|
|
4298
|
+
IsGeneric: () => IsGeneric,
|
|
4299
|
+
IsIdentifier: () => IsIdentifier,
|
|
4300
|
+
IsImmutable: () => IsImmutable,
|
|
4301
|
+
IsInfer: () => IsInfer,
|
|
4302
|
+
IsInteger: () => IsInteger,
|
|
4303
|
+
IsIntersect: () => IsIntersect,
|
|
4304
|
+
IsKind: () => IsKind,
|
|
4305
|
+
IsLiteral: () => IsLiteral,
|
|
4306
|
+
IsNever: () => IsNever,
|
|
4307
|
+
IsNull: () => IsNull,
|
|
4308
|
+
IsNumber: () => IsNumber,
|
|
4309
|
+
IsObject: () => IsObject,
|
|
4310
|
+
IsOptional: () => IsOptional,
|
|
4311
|
+
IsParameter: () => IsParameter,
|
|
4312
|
+
IsReadonly: () => IsReadonly,
|
|
4313
|
+
IsRecord: () => IsRecord,
|
|
4314
|
+
IsRef: () => IsRef,
|
|
4315
|
+
IsRefine: () => IsRefine,
|
|
4316
|
+
IsRest: () => IsRest,
|
|
4317
|
+
IsSchema: () => IsSchema,
|
|
4318
|
+
IsString: () => IsString,
|
|
4319
|
+
IsSymbol: () => IsSymbol,
|
|
4320
|
+
IsTemplateLiteral: () => IsTemplateLiteral,
|
|
4321
|
+
IsThis: () => IsThis,
|
|
4322
|
+
IsTuple: () => IsTuple,
|
|
4323
|
+
IsUndefined: () => IsUndefined,
|
|
4324
|
+
IsUnion: () => IsUnion,
|
|
4325
|
+
IsUnknown: () => IsUnknown,
|
|
4326
|
+
IsUnsafe: () => IsUnsafe,
|
|
4327
|
+
IsVoid: () => IsVoid,
|
|
4328
|
+
KeyOf: () => KeyOf,
|
|
4329
|
+
Literal: () => Literal,
|
|
4330
|
+
Lowercase: () => Lowercase,
|
|
4331
|
+
Mapped: () => Mapped,
|
|
4332
|
+
Module: () => Module,
|
|
4333
|
+
Never: () => Never,
|
|
4334
|
+
NonNullable: () => NonNullable,
|
|
4335
|
+
Null: () => Null,
|
|
4336
|
+
Number: () => Number$2,
|
|
4337
|
+
Object: () => _Object_$1,
|
|
4338
|
+
Omit: () => Omit,
|
|
4339
|
+
Optional: () => Optional$2,
|
|
4340
|
+
Parameter: () => Parameter$1,
|
|
4341
|
+
Parameters: () => Parameters,
|
|
4342
|
+
Partial: () => Partial,
|
|
4343
|
+
Pick: () => Pick,
|
|
4344
|
+
Readonly: () => Readonly$1,
|
|
4345
|
+
ReadonlyObject: () => ReadonlyObject,
|
|
4346
|
+
ReadonlyType: () => ReadonlyType,
|
|
4347
|
+
Record: () => Record,
|
|
4348
|
+
RecordKey: () => RecordKey,
|
|
4349
|
+
RecordPattern: () => RecordPattern,
|
|
4350
|
+
RecordValue: () => RecordValue,
|
|
4351
|
+
Ref: () => Ref,
|
|
4352
|
+
Refine: () => Refine,
|
|
4353
|
+
Required: () => Required,
|
|
4354
|
+
Rest: () => Rest,
|
|
4355
|
+
ReturnType: () => ReturnType,
|
|
4356
|
+
Script: () => Script,
|
|
4357
|
+
String: () => String$2,
|
|
4358
|
+
Symbol: () => Symbol,
|
|
4359
|
+
TemplateLiteral: () => TemplateLiteral,
|
|
4360
|
+
This: () => This,
|
|
4361
|
+
Tuple: () => Tuple,
|
|
4362
|
+
Uncapitalize: () => Uncapitalize,
|
|
4363
|
+
Undefined: () => Undefined,
|
|
4364
|
+
Union: () => Union,
|
|
4365
|
+
Unknown: () => Unknown,
|
|
4366
|
+
Unsafe: () => Unsafe,
|
|
4367
|
+
Uppercase: () => Uppercase,
|
|
4368
|
+
Void: () => Void,
|
|
4369
|
+
With: () => With
|
|
4370
|
+
});
|
|
4371
|
+
//#endregion
|
|
4372
|
+
//#region src/compat/vendor/pi-ai-overflow.ts
|
|
4373
|
+
/**
|
|
4374
|
+
* Regex patterns to detect context overflow errors from different providers.
|
|
4375
|
+
*
|
|
4376
|
+
* These patterns match error messages returned when the input exceeds
|
|
4377
|
+
* the model's context window.
|
|
4378
|
+
*
|
|
4379
|
+
* Provider-specific patterns (with example error messages):
|
|
4380
|
+
*
|
|
4381
|
+
* - Anthropic: "prompt is too long: 213462 tokens > 200000 maximum"
|
|
4382
|
+
* - Anthropic: "413 {\"error\":{\"type\":\"request_too_large\",\"message\":\"Request exceeds the maximum size\"}}"
|
|
4383
|
+
* - OpenAI: "Your input exceeds the context window of this model"
|
|
4384
|
+
* - OpenAI/LiteLLM: "Requested token count exceeds the model's maximum context length of 131072 tokens"
|
|
4385
|
+
* - OpenAI-compatible: "Input length (265330) exceeds model's maximum context length (262144)."
|
|
4386
|
+
* - Google: "The input token count (1196265) exceeds the maximum number of tokens allowed (1048575)"
|
|
4387
|
+
* - xAI: "This model's maximum prompt length is 131072 but the request contains 537812 tokens"
|
|
4388
|
+
* - Groq: "Please reduce the length of the messages or completion"
|
|
4389
|
+
* - OpenRouter: "This endpoint's maximum context length is X tokens. However, you requested about Y tokens"
|
|
4390
|
+
* - OpenRouter/Poolside: "Input length X exceeds the maximum allowed input length of Y tokens."
|
|
4391
|
+
* - Together AI: "The input (X tokens) is longer than the model's context length (Y tokens)."
|
|
4392
|
+
* - llama.cpp: "the request exceeds the available context size, try increasing it"
|
|
4393
|
+
* - LM Studio: "tokens to keep from the initial prompt is greater than the context length"
|
|
4394
|
+
* - GitHub Copilot: "prompt token count of X exceeds the limit of Y"
|
|
4395
|
+
* - MiniMax: "invalid params, context window exceeds limit"
|
|
4396
|
+
* - Kimi For Coding: "Your request exceeded model token limit: X (requested: Y)"
|
|
4397
|
+
* - DS4: "Prompt has X tokens, but the configured context size is Y tokens"
|
|
4398
|
+
* - Cerebras: "400/413 status code (no body)"
|
|
4399
|
+
* - Mistral: "Prompt contains X tokens ... too large for model with Y maximum context length"
|
|
4400
|
+
* - z.ai: Does NOT error, accepts overflow silently - handled via usage.input > contextWindow
|
|
4401
|
+
* - Xiaomi MiMo: Truncates input to fill contextWindow exactly, then returns finish_reason "length"
|
|
4402
|
+
* with output=0 (no room left to generate). Detected via stopReason "length" + zero output +
|
|
4403
|
+
* input filling the context window.
|
|
4404
|
+
* - DashScope/Qwen: "Range of input length should be [1, X]" (HTTP 400 invalid_parameter_error)
|
|
4405
|
+
* - Ollama: Some deployments truncate silently, others return errors like "prompt too long; exceeded max context length by X tokens"
|
|
4406
|
+
*/
|
|
4407
|
+
const OVERFLOW_PATTERNS = [
|
|
4408
|
+
/prompt is too long/i,
|
|
4409
|
+
/request_too_large/i,
|
|
4410
|
+
/input is too long for requested model/i,
|
|
4411
|
+
/exceeds the context window/i,
|
|
4412
|
+
/exceeds (?:the )?(?:model'?s )?maximum context length(?: of [\d,]+ tokens?|\s*\([\d,]+\))/i,
|
|
4413
|
+
/input token count.*exceeds the maximum/i,
|
|
4414
|
+
/maximum prompt length is \d+/i,
|
|
4415
|
+
/reduce the length of the messages/i,
|
|
4416
|
+
/maximum context length is \d+ tokens/i,
|
|
4417
|
+
/exceeds (?:the )?maximum allowed input length of [\d,]+ tokens?/i,
|
|
4418
|
+
/input \(\d+ tokens\) is longer than the model'?s context length \(\d+ tokens\)/i,
|
|
4419
|
+
/exceeds the limit of \d+/i,
|
|
4420
|
+
/exceeds the available context size/i,
|
|
4421
|
+
/greater than the context length/i,
|
|
4422
|
+
/context window exceeds limit/i,
|
|
4423
|
+
/exceeded model token limit/i,
|
|
4424
|
+
/too large for model with \d+ maximum context length/i,
|
|
4425
|
+
/prompt has [\d,]+ tokens?, but the configured context size is [\d,]+ tokens?/i,
|
|
4426
|
+
/model_context_window_exceeded/i,
|
|
4427
|
+
/prompt too long; exceeded (?:max )?context length/i,
|
|
4428
|
+
/range of input length should be/i,
|
|
4429
|
+
/context[_ ]length[_ ]exceeded/i,
|
|
4430
|
+
/too many tokens/i,
|
|
4431
|
+
/token limit exceeded/i,
|
|
4432
|
+
/^4(?:00|13)\s*(?:status code)?\s*\(no body\)/i
|
|
4433
|
+
];
|
|
4434
|
+
/**
|
|
4435
|
+
* Patterns that indicate non-overflow errors (e.g. rate limiting, server errors).
|
|
4436
|
+
* Error messages matching any of these are excluded from overflow detection
|
|
4437
|
+
* even if they also match an OVERFLOW_PATTERN.
|
|
4438
|
+
*
|
|
4439
|
+
* Example: Bedrock formats throttling errors as "ThrottlingException: Too many tokens,
|
|
4440
|
+
* please wait before trying again." which would match the /too many tokens/i overflow
|
|
4441
|
+
* pattern without this exclusion.
|
|
4442
|
+
*/
|
|
4443
|
+
const NON_OVERFLOW_PATTERNS = [
|
|
4444
|
+
/^(Throttling error|Service unavailable):/i,
|
|
4445
|
+
/rate limit/i,
|
|
4446
|
+
/too many requests/i
|
|
4447
|
+
];
|
|
4448
|
+
/**
|
|
4449
|
+
* Check if an assistant message represents a context overflow error.
|
|
4450
|
+
*
|
|
4451
|
+
* This handles three cases:
|
|
4452
|
+
* 1. Error-based overflow: Most providers return stopReason "error" with a
|
|
4453
|
+
* specific error message pattern.
|
|
4454
|
+
* 2. Silent overflow: Some providers accept overflow requests and return
|
|
4455
|
+
* successfully. For these, we check if usage.input exceeds the context window.
|
|
4456
|
+
* 3. Length-stop overflow: Xiaomi MiMo can return "length" with zero output when
|
|
4457
|
+
* the input fills the context window.
|
|
4458
|
+
*
|
|
4459
|
+
* ## Reliability by Provider
|
|
4460
|
+
*
|
|
4461
|
+
* **Reliable detection (returns error with detectable message):**
|
|
4462
|
+
* - Anthropic: "prompt is too long: X tokens > Y maximum" or "request_too_large"
|
|
4463
|
+
* - OpenAI (Completions & Responses): "exceeds the context window", "exceeds the model's maximum context length of X tokens", or "exceeds model's maximum context length (X)"
|
|
4464
|
+
* - Google Gemini: "input token count exceeds the maximum"
|
|
4465
|
+
* - xAI (Grok): "maximum prompt length is X but request contains Y"
|
|
4466
|
+
* - Groq: "reduce the length of the messages"
|
|
4467
|
+
* - Cerebras: 400/413 status code (no body)
|
|
4468
|
+
* - Mistral: "Prompt contains X tokens ... too large for model with Y maximum context length"
|
|
4469
|
+
* - OpenRouter (most backends): "maximum context length is X tokens"
|
|
4470
|
+
* - OpenRouter/Poolside: "Input length X exceeds the maximum allowed input length of Y tokens."
|
|
4471
|
+
* - Together AI: "The input (X tokens) is longer than the model's context length (Y tokens)."
|
|
4472
|
+
* - llama.cpp: "exceeds the available context size"
|
|
4473
|
+
* - LM Studio: "greater than the context length"
|
|
4474
|
+
* - Kimi For Coding: "exceeded model token limit: X (requested: Y)"
|
|
4475
|
+
* - DS4: "Prompt has X tokens, but the configured context size is Y tokens"
|
|
4476
|
+
* - DashScope/Qwen: "Range of input length should be [1, X]"
|
|
4477
|
+
*
|
|
4478
|
+
* **Unreliable detection:**
|
|
4479
|
+
* - z.ai: Sometimes accepts overflow silently (detectable via usage.input > contextWindow),
|
|
4480
|
+
* sometimes returns rate limit errors. Pass contextWindow param to detect silent overflow.
|
|
4481
|
+
* - Xiaomi MiMo: Truncates input to fit contextWindow then returns stopReason "length" with
|
|
4482
|
+
* output=0. Pass contextWindow param to detect via the "filled context + zero output" signal.
|
|
4483
|
+
* - Ollama: May truncate input silently for some setups, but may also return explicit
|
|
4484
|
+
* overflow errors that match the patterns above. Silent truncation still cannot be
|
|
4485
|
+
* detected here because we do not know the expected token count.
|
|
4486
|
+
*
|
|
4487
|
+
* ## Custom Providers
|
|
4488
|
+
*
|
|
4489
|
+
* If you've added custom models via settings.json, this function may not detect
|
|
4490
|
+
* overflow errors from those providers. To add support:
|
|
4491
|
+
*
|
|
4492
|
+
* 1. Send a request that exceeds the model's context window
|
|
4493
|
+
* 2. Check the errorMessage in the response
|
|
4494
|
+
* 3. Create a regex pattern that matches the error
|
|
4495
|
+
* 4. The pattern should be added to OVERFLOW_PATTERNS in this file, or
|
|
4496
|
+
* check the errorMessage yourself before calling this function
|
|
4497
|
+
*
|
|
4498
|
+
* @param message - The assistant message to check
|
|
4499
|
+
* @param contextWindow - Optional context window size for detecting silent overflow (z.ai)
|
|
4500
|
+
* @returns true if the message indicates a context overflow
|
|
4501
|
+
*/
|
|
4502
|
+
function isContextOverflow(message, contextWindow) {
|
|
4503
|
+
if (message.stopReason === "error" && message.errorMessage) {
|
|
4504
|
+
if (!NON_OVERFLOW_PATTERNS.some((p) => p.test(message.errorMessage)) && OVERFLOW_PATTERNS.some((p) => p.test(message.errorMessage))) return true;
|
|
4505
|
+
}
|
|
4506
|
+
if (contextWindow && message.stopReason === "stop") {
|
|
4507
|
+
if (message.usage.input + message.usage.cacheRead > contextWindow) return true;
|
|
4508
|
+
}
|
|
4509
|
+
if (contextWindow && message.stopReason === "length" && message.usage.output === 0) {
|
|
4510
|
+
if (message.usage.input + message.usage.cacheRead >= contextWindow * .99) return true;
|
|
4511
|
+
}
|
|
4512
|
+
return false;
|
|
4513
|
+
}
|
|
4514
|
+
/**
|
|
4515
|
+
* Check whether a length stop ended below the caller or model's intended output limit.
|
|
4516
|
+
* Such responses may be caused by context pressure or provider-side truncation, so callers
|
|
4517
|
+
* can make one bounded compact-and-retry attempt. `desiredMaxOutput` must be the original
|
|
4518
|
+
* limit before any context-based clamping.
|
|
4519
|
+
*/
|
|
4520
|
+
function isRecoverableLength(message, desiredMaxOutput) {
|
|
4521
|
+
return message.stopReason === "length" && desiredMaxOutput > 0 && message.usage.output < desiredMaxOutput;
|
|
4522
|
+
}
|
|
4523
|
+
//#endregion
|
|
4524
|
+
//#region src/compat/vendor/pi-ai-retry.ts
|
|
4525
|
+
function buildProviderErrorPattern(patterns) {
|
|
4526
|
+
return new RegExp(patterns.join("|"), "i");
|
|
4527
|
+
}
|
|
4528
|
+
const NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN = buildProviderErrorPattern([
|
|
4529
|
+
"GoUsageLimitError",
|
|
4530
|
+
"FreeUsageLimitError",
|
|
4531
|
+
"Monthly usage limit reached",
|
|
4532
|
+
"available balance",
|
|
4533
|
+
"insufficient_quota",
|
|
4534
|
+
"out of budget",
|
|
4535
|
+
"quota exceeded",
|
|
4536
|
+
"billing"
|
|
4537
|
+
]);
|
|
4538
|
+
const RETRYABLE_PROVIDER_ERROR_PATTERN = buildProviderErrorPattern([
|
|
4539
|
+
"overloaded",
|
|
4540
|
+
"rate.?limit",
|
|
4541
|
+
"too many requests",
|
|
4542
|
+
"429",
|
|
4543
|
+
"500",
|
|
4544
|
+
"502",
|
|
4545
|
+
"503",
|
|
4546
|
+
"504",
|
|
4547
|
+
"524",
|
|
4548
|
+
"service.?unavailable",
|
|
4549
|
+
"server.?error",
|
|
4550
|
+
"internal.?error",
|
|
4551
|
+
"provider.?returned.?error",
|
|
4552
|
+
"exceeded request buffer limit while retrying upstream",
|
|
4553
|
+
"network.?error",
|
|
4554
|
+
"connection.?error",
|
|
4555
|
+
"connection.?refused",
|
|
4556
|
+
"connection.?lost",
|
|
4557
|
+
"other side closed",
|
|
4558
|
+
"fetch failed",
|
|
4559
|
+
"getaddrinfo",
|
|
4560
|
+
"ENOTFOUND",
|
|
4561
|
+
"EAI_AGAIN",
|
|
4562
|
+
"upstream.?connect",
|
|
4563
|
+
"reset before headers",
|
|
4564
|
+
"socket hang up",
|
|
4565
|
+
"socket connection was closed",
|
|
4566
|
+
"timed? out",
|
|
4567
|
+
"timeout",
|
|
4568
|
+
"terminated",
|
|
4569
|
+
"websocket.?closed",
|
|
4570
|
+
"websocket.?error",
|
|
4571
|
+
"ended without",
|
|
4572
|
+
"stream ended before message_stop",
|
|
4573
|
+
"stream ended before a terminal response event",
|
|
4574
|
+
"http2 request did not get a response",
|
|
4575
|
+
"retry delay",
|
|
4576
|
+
"you can retry your request",
|
|
4577
|
+
"try your request again",
|
|
4578
|
+
"please retry your request",
|
|
4579
|
+
"ResourceExhausted"
|
|
4580
|
+
]);
|
|
4581
|
+
/**
|
|
4582
|
+
* Classifies whether a failed assistant message looks like a transient provider
|
|
4583
|
+
* or transport error, so callers can decide if the last assistant turn should be
|
|
4584
|
+
* restarted.
|
|
4585
|
+
*
|
|
4586
|
+
* This does not implement retry policy. Callers should first handle context
|
|
4587
|
+
* overflow separately, then apply their own retry budget, backoff, and reporting
|
|
4588
|
+
* before restarting the assistant turn.
|
|
4589
|
+
*/
|
|
4590
|
+
function isRetryableAssistantError(message) {
|
|
4591
|
+
if (message.stopReason !== "error" || !message.errorMessage) return false;
|
|
4592
|
+
const errorMessage = message.errorMessage;
|
|
4593
|
+
if (NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN.test(errorMessage)) return false;
|
|
4594
|
+
return RETRYABLE_PROVIDER_ERROR_PATTERN.test(errorMessage);
|
|
4595
|
+
}
|
|
4596
|
+
//#endregion
|
|
4597
|
+
//#region src/compat/pi-ai.ts
|
|
4598
|
+
const EXTENDED_THINKING_LEVELS = [
|
|
4599
|
+
"off",
|
|
4600
|
+
"minimal",
|
|
4601
|
+
"low",
|
|
4602
|
+
"medium",
|
|
4603
|
+
"high",
|
|
4604
|
+
"xhigh",
|
|
4605
|
+
"max"
|
|
4606
|
+
];
|
|
4607
|
+
function getSupportedThinkingLevels(model) {
|
|
4608
|
+
return EXTENDED_THINKING_LEVELS.filter((level) => {
|
|
4609
|
+
const mapped = model.thinkingLevelMap?.[level];
|
|
4610
|
+
if (mapped === null) return false;
|
|
4611
|
+
if (level === "xhigh" || level === "max") return mapped !== void 0;
|
|
4612
|
+
return true;
|
|
4613
|
+
});
|
|
4614
|
+
}
|
|
4615
|
+
function clampThinkingLevel(model, level) {
|
|
4616
|
+
const availableLevels = getSupportedThinkingLevels(model);
|
|
4617
|
+
if (availableLevels.includes(level)) return level;
|
|
4618
|
+
const requestedIndex = EXTENDED_THINKING_LEVELS.indexOf(level);
|
|
4619
|
+
if (requestedIndex === -1) return availableLevels[0] ?? "off";
|
|
4620
|
+
for (let i = requestedIndex; i < EXTENDED_THINKING_LEVELS.length; i += 1) {
|
|
4621
|
+
const candidate = EXTENDED_THINKING_LEVELS[i];
|
|
4622
|
+
if (availableLevels.includes(candidate)) return candidate;
|
|
4623
|
+
}
|
|
4624
|
+
for (let i = requestedIndex - 1; i >= 0; i -= 1) {
|
|
4625
|
+
const candidate = EXTENDED_THINKING_LEVELS[i];
|
|
4626
|
+
if (availableLevels.includes(candidate)) return candidate;
|
|
4627
|
+
}
|
|
4628
|
+
return availableLevels[0] ?? "off";
|
|
4629
|
+
}
|
|
4630
|
+
function modelsAreEqual(a, b) {
|
|
4631
|
+
if (a === null || a === void 0 || b === null || b === void 0) return false;
|
|
4632
|
+
return a.id === b.id && a.provider === b.provider;
|
|
4633
|
+
}
|
|
4634
|
+
function contentText(content, separator = "\n") {
|
|
4635
|
+
if (typeof content === "string") return content;
|
|
4636
|
+
return content.filter((block) => block.type === "text").map((block) => String(block.text ?? "")).join(separator);
|
|
4637
|
+
}
|
|
4638
|
+
const compatProviders = /* @__PURE__ */ new Map();
|
|
4639
|
+
function registerProvider(name, provider) {
|
|
4640
|
+
compatProviders.set(name, provider);
|
|
4641
|
+
}
|
|
4642
|
+
function getProviders() {
|
|
4643
|
+
return [...compatProviders.keys()];
|
|
4644
|
+
}
|
|
4645
|
+
function getProvider(name) {
|
|
4646
|
+
return compatProviders.get(name);
|
|
4647
|
+
}
|
|
4648
|
+
function getModel(_provider, _id) {}
|
|
4649
|
+
function getModels(_provider) {
|
|
4650
|
+
return [];
|
|
4651
|
+
}
|
|
4652
|
+
function complete(..._args) {
|
|
4653
|
+
throw new Error("pi2dsh: pi-ai complete() routes model calls through Pi provider SDKs; use DSH llm adapters instead");
|
|
4654
|
+
}
|
|
4655
|
+
function stream(..._args) {
|
|
4656
|
+
throw new Error("pi2dsh: pi-ai stream() routes model calls through Pi provider SDKs; use DSH llm adapters instead");
|
|
4657
|
+
}
|
|
4658
|
+
function StringEnum(values, options = {}) {
|
|
4659
|
+
return {
|
|
4660
|
+
type: "string",
|
|
4661
|
+
enum: values,
|
|
4662
|
+
...options.description !== void 0 ? { description: options.description } : {},
|
|
4663
|
+
...options.default !== void 0 ? { default: options.default } : {}
|
|
4664
|
+
};
|
|
4665
|
+
}
|
|
4666
|
+
//#endregion
|
|
4667
|
+
export { StringEnum, typebox_exports as Type, clampThinkingLevel, complete, contentText, getModel, getModels, getProvider, getProviders, getSupportedThinkingLevels, isContextOverflow, isRecoverableLength, isRetryableAssistantError, modelsAreEqual, registerProvider, stream, uuidv7 };
|
|
4668
|
+
|
|
4669
|
+
//# sourceMappingURL=pi-ai.mjs.map
|