@akonwi/kit 0.19.2 → 0.19.3

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