personal-bot 0.2.6 → 0.2.9

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