pagegraph 0.13.0 → 0.14.1

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