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