@prisma/orm-framework 8.0.0-rc.17-dev.36 → 8.0.0-rc.17-dev.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{authoring-C0JXF22s.d.mts → authoring-D--mDfh-.d.mts} +77 -16
  2. package/dist/authoring-D--mDfh-.d.mts.map +1 -0
  3. package/dist/{authoring-Bv-ExMUC.mjs → authoring-axlemDvs.mjs} +138 -9
  4. package/dist/authoring-axlemDvs.mjs.map +1 -0
  5. package/dist/{binder-C54tCWu0-wFS-Dsru.d.mts → binder-C54tCWu0-VCDLfJaz.d.mts} +4 -4
  6. package/dist/{binder-C54tCWu0-wFS-Dsru.d.mts.map → binder-C54tCWu0-VCDLfJaz.d.mts.map} +1 -1
  7. package/dist/{codec-B-7ArtWI.mjs → codec-B6f31GrC.mjs} +2 -39
  8. package/dist/codec-B6f31GrC.mjs.map +1 -0
  9. package/dist/codec-descriptor-DUZmWwry-BVbguh8h.mjs +42 -0
  10. package/dist/codec-descriptor-DUZmWwry-BVbguh8h.mjs.map +1 -0
  11. package/dist/components.d.mts +2 -2
  12. package/dist/components.mjs +4 -3
  13. package/dist/components__authoring.d.mts +2 -2
  14. package/dist/components__authoring.mjs +2 -2
  15. package/dist/components__codec.mjs +2 -1
  16. package/dist/{config-types-BWNY2ea_.d.mts → config-types-z-EG3487.d.mts} +2 -2
  17. package/dist/{config-types-BWNY2ea_.d.mts.map → config-types-z-EG3487.d.mts.map} +1 -1
  18. package/dist/config.d.mts +1 -1
  19. package/dist/config__config-types.d.mts +1 -1
  20. package/dist/contract-authoring.d.mts +9 -6
  21. package/dist/contract-authoring.d.mts.map +1 -1
  22. package/dist/contract-authoring.mjs +47 -9
  23. package/dist/contract-authoring.mjs.map +1 -1
  24. package/dist/{parse-CJtBvEYy-BsdZXMKU.d.mts → parse-CJtBvEYy-CDKziSed.d.mts} +3 -3
  25. package/dist/{parse-CJtBvEYy-BsdZXMKU.d.mts.map → parse-CJtBvEYy-CDKziSed.d.mts.map} +1 -1
  26. package/dist/psl-parser.d.mts +3 -3
  27. package/dist/psl-parser.mjs +1 -1
  28. package/dist/psl-parser__format.d.mts +1 -1
  29. package/dist/psl-parser__interpret.d.mts +4 -4
  30. package/dist/psl-parser__syntax.d.mts +1 -1
  31. package/dist/psl-printer.d.mts +1 -1
  32. package/package.json +15 -15
  33. package/dist/authoring-Bv-ExMUC.mjs.map +0 -1
  34. package/dist/authoring-C0JXF22s.d.mts.map +0 -1
  35. package/dist/codec-B-7ArtWI.mjs.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import { B as JsonValue } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
2
- import { i as Codec } from "./codec-types-CQNZE70G-DrntJY0s.mjs";
3
- import { F as ParsedPslExtensionBlock, a as AuthoringContributions, et as instantiateAuthoringTypeConstructor, k as AuthoringTypeNamespace, p as AuthoringFieldPresetDescriptor, s as AuthoringEntityContext } from "./framework-authoring-BaBmrcxi-DV-OErsx.mjs";
2
+ import { i as Codec, p as CodecLookupWithDescriptors } from "./codec-types-CQNZE70G-DrntJY0s.mjs";
3
+ import { F as ParsedPslExtensionBlock, U as PslSpan, a as AuthoringContributions, et as instantiateAuthoringTypeConstructor, k as AuthoringTypeNamespace, p as AuthoringFieldPresetDescriptor, s as AuthoringEntityContext } from "./framework-authoring-BaBmrcxi-DV-OErsx.mjs";
4
+ import { r as Result } from "./result-BYCOANWy.mjs";
4
5
  import "./written-value--KnOpj99-BA9i2Wto.mjs";
5
6
  //#region ../../../1-framework/1-core/framework-components/dist/authoring.d.mts
6
7
  //#region src/shared/authoring-type-constructor-call.d.ts
@@ -19,18 +20,6 @@ interface AuthoringTypeConstructorCall {
19
20
  */
20
21
  declare function findAuthoringTypeConstructorCall(namespace: AuthoringTypeNamespace, output: AuthoringTypeConstructorOutput): AuthoringTypeConstructorCall | undefined;
21
22
  //#endregion
22
- //#region src/shared/enum-block-members.d.ts
23
- interface EnumBlockMember {
24
- readonly name: string;
25
- readonly value: unknown;
26
- }
27
- /**
28
- * Reads the members of an `enum` block through its codec. A member written as a number literal is read from its source text as a column default is read, when the family gives a reader for it (`ctx.readWrittenNumber`), so no digit is lost; when that reader refuses the number, the codec's `decodeJson` reads it, and only if the codec refuses it too is the reader's reason reported. Every other member goes to the codec's `decodeJson`, and a bare member is read from its own name.
29
- * Pushes a diagnostic and returns `undefined` when the codec refuses a member, when two members
30
- * store the same value, or when the block has no members. Shared by every family's enum factory.
31
- */
32
- declare function readEnumBlockMembers(block: ParsedPslExtensionBlock<Readonly<Record<string, JsonValue | undefined>>>, codecId: string, codec: Codec, ctx: AuthoringEntityContext): readonly EnumBlockMember[] | undefined;
33
- //#endregion
34
23
  //#region src/shared/enum-stored-members.d.ts
35
24
  interface StoredEnumMember {
36
25
  readonly name: string;
@@ -46,6 +35,78 @@ interface DuplicateStoredValue {
46
35
  */
47
36
  declare function duplicateStoredMembers(members: readonly StoredEnumMember[]): readonly DuplicateStoredValue[];
48
37
  //#endregion
38
+ //#region src/shared/enum-members.d.ts
39
+ /** An enum whose members hold the values the application sees, before its codec stores them. */
40
+ interface DecodedEnum {
41
+ readonly codecId: string;
42
+ readonly enumMembers: readonly {
43
+ readonly name: string;
44
+ readonly value: unknown;
45
+ }[];
46
+ }
47
+ /** An enum member as the contract holds it: in the form its codec stores. */
48
+ interface EncodedEnumMember {
49
+ readonly name: string;
50
+ readonly value: JsonValue;
51
+ }
52
+ interface CodecRefusedMember {
53
+ readonly kind: 'codec-refused-member';
54
+ readonly member: string;
55
+ readonly reason: string;
56
+ readonly cause: unknown;
57
+ }
58
+ interface MemberNotStoredAsWritten {
59
+ readonly kind: 'member-not-stored-as-written';
60
+ readonly member: string;
61
+ readonly written: string;
62
+ readonly stored: JsonValue;
63
+ readonly writeAs: string;
64
+ }
65
+ type EnumMemberProblem = {
66
+ readonly kind: 'codec-not-for-enums';
67
+ readonly refusal: string;
68
+ } | {
69
+ readonly kind: 'codec-missing';
70
+ } | CodecRefusedMember | MemberNotStoredAsWritten | ({
71
+ readonly kind: 'duplicate-member-value';
72
+ } & DuplicateStoredValue);
73
+ /**
74
+ * Each member of an enum in the form its codec stores it. Refuses a codec an enum cannot use, a codec the lookup does not have, a member the codec refuses, a member the codec reads back as another value, and two members stored as the same value. Every family's contract build calls this, and reports the problems in its own terms.
75
+ */
76
+ declare function encodeEnumMembers(decodedEnum: DecodedEnum, codecLookup: CodecLookupWithDescriptors): Result<readonly EncodedEnumMember[], readonly EnumMemberProblem[]>;
77
+ //#endregion
78
+ //#region src/shared/enum-block-members.d.ts
79
+ interface EnumBlockMember {
80
+ readonly name: string;
81
+ readonly value: unknown;
82
+ }
83
+ interface EnumBlockDiagnostic {
84
+ readonly code: string;
85
+ readonly message: string;
86
+ readonly sourceId: string;
87
+ readonly span: PslSpan;
88
+ }
89
+ /**
90
+ * Where an `enum` block is written: the source, the block's span, and each member's span.
91
+ */
92
+ interface EnumBlockSite {
93
+ readonly enumName: string;
94
+ readonly codecId: string;
95
+ readonly sourceId: string;
96
+ readonly span: PslSpan;
97
+ readonly memberSpans: Readonly<Record<string, PslSpan>>;
98
+ }
99
+ /**
100
+ * A problem with an enum's members as a diagnostic at the member, or at the block when the problem is the enum's codec.
101
+ */
102
+ declare function enumMemberProblemDiagnostic(problem: EnumMemberProblem, site: EnumBlockSite): EnumBlockDiagnostic;
103
+ /**
104
+ * Reads the members of an `enum` block through its codec. A member written as a number literal is read from its source text as a column default is read, when the family gives a reader for it (`ctx.readWrittenNumber`), so no digit is lost; when that reader refuses the number, the codec's `decodeJson` reads it, and only if the codec refuses it too is the reader's reason reported. Every other member goes to the codec's `decodeJson`, and a bare member is read from its own name.
105
+ * Pushes a diagnostic and returns `undefined` when the codec refuses a member, when two members
106
+ * store the same value, or when the block has no members. Shared by every family's enum factory.
107
+ */
108
+ declare function readEnumBlockMembers(block: ParsedPslExtensionBlock<Readonly<Record<string, JsonValue | undefined>>>, codecId: string, codec: Codec, ctx: AuthoringEntityContext): readonly EnumBlockMember[] | undefined;
109
+ //#endregion
49
110
  //#region src/shared/field-preset-resolution.d.ts
50
111
  /**
51
112
  * How each field preset registered under `namespace`, at any depth, is written, with the names of its arguments: `temporal.timestamp(onCreate, onUpdate)`.
@@ -56,5 +117,5 @@ declare function fieldPresetSpellings(contributions: AuthoringContributions | un
56
117
  */
57
118
  declare function getAuthoringFieldPreset(contributions: AuthoringContributions | undefined, path: readonly string[]): AuthoringFieldPresetDescriptor | undefined;
58
119
  //#endregion
59
- export { StoredEnumMember as a, findAuthoringTypeConstructorCall as c, EnumBlockMember as i, getAuthoringFieldPreset as l, AuthoringTypeConstructorOutput as n, duplicateStoredMembers as o, DuplicateStoredValue as r, fieldPresetSpellings as s, AuthoringTypeConstructorCall as t, readEnumBlockMembers as u };
60
- //# sourceMappingURL=authoring-C0JXF22s.d.mts.map
120
+ export { readEnumBlockMembers as _, EncodedEnumMember as a, EnumBlockSite as c, duplicateStoredMembers as d, encodeEnumMembers as f, getAuthoringFieldPreset as g, findAuthoringTypeConstructorCall as h, DuplicateStoredValue as i, EnumMemberProblem as l, fieldPresetSpellings as m, AuthoringTypeConstructorOutput as n, EnumBlockDiagnostic as o, enumMemberProblemDiagnostic as p, DecodedEnum as r, EnumBlockMember as s, AuthoringTypeConstructorCall as t, StoredEnumMember as u };
121
+ //# sourceMappingURL=authoring-D--mDfh-.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-D--mDfh-.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/authoring.d.mts"],"mappings":";;;;;;;;KAOK,iCAAiC,kBAAkB;;UAE9C;WACC;WACA;;;;;;;;iBAQM,iCAAiC,WAAW,wBAAwB,QAAQ,iCAAiC;;;UAGpH;WACC;WACA,QAAQ;;UAET;WACC;WACA;WACA,QAAQ;;;;;iBAKF,uBAAuB,kBAAkB,8BAA8B;;;;UAI9E;WACC;WACA;aACE;aACA;;;;UAIH;WACC;WACA,OAAO;;UAER;WACC;WACA;WACA;WACA;;UAED;WACC;WACA;WACA;WACA,QAAQ;WACR;;KAEN;WACM;WACA;;WAEA;IACP,qBAAqB;WACd;IACP;;;;iBAIa,kBAAkB,aAAa,aAAa,aAAa,6BAA6B,gBAAgB,8BAA8B;;;UAG3I;WACC;WACA;;UAED;WACC;WACA;WACA;WACA,MAAM;;;;;UAKP;WACC;WACA;WACA;WACA,MAAM;WACN,aAAa,SAAS,eAAe;;;;;iBAK/B,4BAA4B,SAAS,mBAAmB,MAAM,gBAAgB;;;;;;iBAM9E,qBAAqB,OAAO,wBAAwB,SAAS,eAAe,0BAA0B,iBAAiB,OAAO,OAAO,KAAK,kCAAkC;;;;;;iBAM5K,qBAAqB,eAAe,oCAAoC;;;;iBAIxE,wBAAwB,eAAe,oCAAoC,0BAA0B"}
@@ -3,6 +3,7 @@ import { r as isInternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
3
3
  import { n as notOk, r as ok } from "./result-8OXF26MN.mjs";
4
4
  import { a as dataTypeId } from "./data-type-4xQlxYB5-DD158cOq.mjs";
5
5
  import { C as isAuthoringTypeConstructorDescriptor, D as printTaggedLiteral, O as printedTaggedLiteralReadsBack, _ as instantiateAuthoringTypeConstructor, b as isAuthoringFieldPresetDescriptor, s as authoringEntryType, v as isAuthoringArgRef } from "./temporal-presets-DEyPX8qQ-Bz4DdZ8v.mjs";
6
+ import { i as enumRefusalOf } from "./codec-descriptor-DUZmWwry-BVbguh8h.mjs";
6
7
  import { t as canonicalizeJson } from "./canonicalize-json-ZPawceQR-Dua1VNEB.mjs";
7
8
  //#region ../../../1-framework/1-core/framework-components/dist/authoring.mjs
8
9
  function* typeConstructors(namespace, path = []) {
@@ -76,6 +77,45 @@ function duplicateStoredMembers(members) {
76
77
  return duplicates;
77
78
  }
78
79
  /**
80
+ * A problem with an enum's members as a diagnostic at the member, or at the block when the problem is the enum's codec.
81
+ */
82
+ function enumMemberProblemDiagnostic(problem, site) {
83
+ const { enumName, codecId, sourceId } = site;
84
+ const at = (member) => ({
85
+ sourceId,
86
+ span: site.memberSpans[member] ?? site.span
87
+ });
88
+ switch (problem.kind) {
89
+ case "codec-not-for-enums": return {
90
+ code: "PSL_EXTENSION_INVALID_VALUE",
91
+ message: `enum "${enumName}" cannot use the codec "${codecId}". ${problem.refusal}`,
92
+ sourceId,
93
+ span: site.span
94
+ };
95
+ case "codec-missing": return {
96
+ code: "PSL_EXTENSION_INVALID_VALUE",
97
+ message: `enum "${enumName}" uses codec "${codecId}", which no pack in the contract provides`,
98
+ sourceId,
99
+ span: site.span
100
+ };
101
+ case "codec-refused-member": return {
102
+ code: "PSL_EXTENSION_INVALID_VALUE",
103
+ message: `enum "${enumName}" member "${problem.member}" was rejected by codec "${codecId}": ${problem.reason}`,
104
+ ...at(problem.member)
105
+ };
106
+ case "member-not-stored-as-written": return {
107
+ code: "PSL_EXTENSION_INVALID_VALUE",
108
+ message: `enum "${enumName}" member "${problem.member}" is written ${problem.written}, but its codec stores ${JSON.stringify(problem.stored)}. Write the member as ${problem.writeAs}.`,
109
+ ...at(problem.member)
110
+ };
111
+ case "duplicate-member-value": return {
112
+ code: "PSL_ENUM_DUPLICATE_MEMBER_VALUE",
113
+ message: `enum "${enumName}": members "${problem.earlier}" and "${problem.later}" both store ${JSON.stringify(problem.stored)}`,
114
+ ...at(problem.later)
115
+ };
116
+ }
117
+ }
118
+ /**
79
119
  * Reads the members of an `enum` block through its codec. A member written as a number literal is read from its source text as a column default is read, when the family gives a reader for it (`ctx.readWrittenNumber`), so no digit is lost; when that reader refuses the number, the codec's `decodeJson` reads it, and only if the codec refuses it too is the reader's reason reported. Every other member goes to the codec's `decodeJson`, and a bare member is read from its own name.
80
120
  * Pushes a diagnostic and returns `undefined` when the codec refuses a member, when two members
81
121
  * store the same value, or when the block has no members. Shared by every family's enum factory.
@@ -83,6 +123,13 @@ function duplicateStoredMembers(members) {
83
123
  function readEnumBlockMembers(block, codecId, codec, ctx) {
84
124
  const sourceId = ctx.sourceId ?? "unknown";
85
125
  const diagnostics = ctx.diagnostics;
126
+ const site = {
127
+ enumName: block.name,
128
+ codecId,
129
+ sourceId,
130
+ span: block.span,
131
+ memberSpans: block.parameterSpans
132
+ };
86
133
  const members = [];
87
134
  const storedMembers = [];
88
135
  let memberError = false;
@@ -127,13 +174,11 @@ function readEnumBlockMembers(block, codecId, codec, ctx) {
127
174
  stored: codec.encodeJson(read)
128
175
  });
129
176
  }
130
- for (const { earlier, later, stored } of duplicateStoredMembers(storedMembers)) {
131
- diagnostics?.push({
132
- code: "PSL_ENUM_DUPLICATE_MEMBER_VALUE",
133
- message: `enum "${block.name}": members "${earlier}" and "${later}" both store ${JSON.stringify(stored)}`,
134
- sourceId,
135
- span: block.parameterSpans[later] ?? block.span
136
- });
177
+ for (const duplicate of duplicateStoredMembers(storedMembers)) {
178
+ diagnostics?.push(enumMemberProblemDiagnostic({
179
+ kind: "duplicate-member-value",
180
+ ...duplicate
181
+ }, site));
137
182
  memberError = true;
138
183
  }
139
184
  if (memberError) return void 0;
@@ -148,6 +193,90 @@ function readEnumBlockMembers(block, codecId, codec, ctx) {
148
193
  }
149
194
  return members;
150
195
  }
196
+ /** Whether TypeScript gives the value a literal type: a primitive, or an array or plain object of them. */
197
+ function hasLiteralType(value) {
198
+ if ([
199
+ "string",
200
+ "number",
201
+ "boolean",
202
+ "bigint"
203
+ ].includes(typeof value)) return true;
204
+ if (Array.isArray(value)) return value.every(hasLiteralType);
205
+ if (typeof value !== "object" || value === null) return false;
206
+ const prototype = Object.getPrototypeOf(value);
207
+ return (prototype === Object.prototype || prototype === null) && Object.values(value).every(hasLiteralType);
208
+ }
209
+ /**
210
+ * A member's value in the form its codec stores it, and that form read back by the codec. A codec that throws on either is a refusal naming the member; an internal error is not the member's fault and propagates.
211
+ */
212
+ function encodeEnumMember(member, codec) {
213
+ try {
214
+ const stored = codec.encodeJson(member.value);
215
+ return ok({
216
+ stored,
217
+ readBack: codec.decodeJson(stored)
218
+ });
219
+ } catch (cause) {
220
+ if (isInternalError(cause)) throw cause;
221
+ return notOk({
222
+ kind: "codec-refused-member",
223
+ member: member.name,
224
+ reason: cause instanceof Error ? cause.message : String(cause),
225
+ cause
226
+ });
227
+ }
228
+ }
229
+ /**
230
+ * Refuses a member its codec reads back as a different value from the one written. A member with no literal type has nothing to compare.
231
+ */
232
+ function notStoredAsWritten(member, stored, readBack) {
233
+ if (!hasLiteralType(member.value)) return void 0;
234
+ if (hasLiteralType(readBack) && canonicalStringify(readBack) === canonicalStringify(member.value)) return void 0;
235
+ return {
236
+ kind: "member-not-stored-as-written",
237
+ member: member.name,
238
+ written: canonicalStringify(member.value),
239
+ stored,
240
+ writeAs: hasLiteralType(readBack) ? canonicalStringify(readBack) : JSON.stringify(stored)
241
+ };
242
+ }
243
+ /**
244
+ * Each member of an enum in the form its codec stores it. Refuses a codec an enum cannot use, a codec the lookup does not have, a member the codec refuses, a member the codec reads back as another value, and two members stored as the same value. Every family's contract build calls this, and reports the problems in its own terms.
245
+ */
246
+ function encodeEnumMembers(decodedEnum, codecLookup) {
247
+ const descriptor = codecLookup.descriptorFor(decodedEnum.codecId);
248
+ const refusal = descriptor === void 0 ? void 0 : enumRefusalOf(descriptor);
249
+ if (refusal !== void 0) return notOk([{
250
+ kind: "codec-not-for-enums",
251
+ refusal
252
+ }]);
253
+ const codec = codecLookup.get(decodedEnum.codecId);
254
+ if (codec === void 0) return notOk([{ kind: "codec-missing" }]);
255
+ const problems = [];
256
+ const members = [];
257
+ for (const member of decodedEnum.enumMembers) {
258
+ const encoded = encodeEnumMember(member, codec);
259
+ if (!encoded.ok) {
260
+ problems.push(encoded.failure);
261
+ continue;
262
+ }
263
+ const { stored, readBack } = encoded.value;
264
+ const mismatch = notStoredAsWritten(member, stored, readBack);
265
+ if (mismatch !== void 0) problems.push(mismatch);
266
+ members.push({
267
+ name: member.name,
268
+ value: stored
269
+ });
270
+ }
271
+ for (const duplicate of duplicateStoredMembers(members.map(({ name, value }) => ({
272
+ name,
273
+ stored: value
274
+ })))) problems.push({
275
+ kind: "duplicate-member-value",
276
+ ...duplicate
277
+ });
278
+ return problems.length > 0 ? notOk(problems) : ok(members);
279
+ }
151
280
  function presetSpellingsUnder(members, prefix) {
152
281
  return Object.entries(members).flatMap(([name, member]) => isAuthoringFieldPresetDescriptor(member) ? [`${prefix}.${name}(${(member.args ?? []).map((arg, index) => arg.name ?? `argument${index + 1}`).join(", ")})`] : presetSpellingsUnder(member, `${prefix}.${name}`));
153
282
  }
@@ -364,6 +493,6 @@ function describeAdmittedForms(support, dataType) {
364
493
  return joinForms(admittedForms(support, [dataType]));
365
494
  }
366
495
  //#endregion
367
- export { readWrittenValue as _, describeExpected as a, duplicateStoredMembers as c, exactRewrite as d, fieldPresetSpellings as f, readEnumBlockMembers as g, knownTags as h, describeAdmittedForms as i, entryForPlain as l, getAuthoringFieldPreset as m, admittedTags as n, describeRefusal as o, findAuthoringTypeConstructorCall as p, castTypedValue as r, describeRefusedValueType as s, admittedForms as t, entryForTag as u, tagForm as v };
496
+ export { knownTags as _, describeExpected as a, tagForm as b, duplicateStoredMembers as c, entryForTag as d, enumMemberProblemDiagnostic as f, getAuthoringFieldPreset as g, findAuthoringTypeConstructorCall as h, describeAdmittedForms as i, encodeEnumMembers as l, fieldPresetSpellings as m, admittedTags as n, describeRefusal as o, exactRewrite as p, castTypedValue as r, describeRefusedValueType as s, admittedForms as t, entryForPlain as u, readEnumBlockMembers as v, readWrittenValue as y };
368
497
 
369
- //# sourceMappingURL=authoring-Bv-ExMUC.mjs.map
498
+ //# sourceMappingURL=authoring-axlemDvs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-axlemDvs.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/authoring.mjs"],"sourcesContent":["import { i as enumRefusalOf } from \"./codec-descriptor-DUZmWwry.mjs\";\nimport { a as dataTypeId } from \"./data-type-4xQlxYB5.mjs\";\nimport { t as canonicalizeJson } from \"./canonicalize-json-ZPawceQR.mjs\";\nimport { A as isAuthoringModelAttributeDescriptor, B as validateAuthoringTypeParams, C as getAuthoringTypeConstructor, D as isAuthoringArgRef, E as instantiateAuthoringTypeConstructor, F as mergeAuthoringNamespaces, I as resolveAuthoringTemplateValue, L as resolveEnumCodecId, M as isAuthoringTypeConstructorDescriptor, N as isTagEntryKey, O as isAuthoringEntityTypeDescriptor, R as tagEntryKey, S as flushAuthoringWarnings, T as instantiateAuthoringFieldPreset, _ as assertResolvableTypeConstructorTemplates, a as temporalCodecPreset, d as printTaggedLiteral, f as printedTaggedLiteralReadsBack, g as assertNoCrossRegistryCollisions, h as tsTaggedTemplateSource, i as temporalAuthoringPresets, j as isAuthoringPslBlockDescriptor, k as isAuthoringFieldPresetDescriptor, l as canonicalizeTaggedLiteralBody, m as resolveTemplateTagEscapes, n as TEMPORAL_ON_UPDATE_ARG, o as temporalPhaseTemplate, r as TIMESTAMP_NOW_GENERATOR_ID, t as TEMPORAL_ON_CREATE_ARG, u as describeTaggedLiteralFailure, v as authoringEntryType, w as instantiateAuthoringEntityType, x as collectScalarTypeConstructors, y as classifyEnumMemberType, z as validateAuthoringHelperArguments } from \"./temporal-presets-DEyPX8qQ.mjs\";\nimport { isInternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/shared/authoring-type-constructor-call.ts\nfunction* typeConstructors(namespace, path = []) {\n\tfor (const [name, value] of Object.entries(namespace)) if (isAuthoringTypeConstructorDescriptor(value)) yield {\n\t\tpath: [...path, name],\n\t\tdescriptor: value\n\t};\n\telse yield* typeConstructors(value, [...path, name]);\n}\nfunction produces(produced, wanted) {\n\tconst wantedFields = {\n\t\t...wanted,\n\t\ttypeParams: wanted.typeParams ?? {}\n\t};\n\treturn Object.entries({\n\t\t...produced,\n\t\ttypeParams: produced.typeParams ?? {}\n\t}).every(([key, value]) => canonicalizeJson(value) === canonicalizeJson(wantedFields[key]));\n}\n/**\n* The arguments that make `descriptor` produce exactly `output`, when each of its type parameters\n* comes straight from one argument; `undefined` when it cannot produce `output`, including when\n* `output` has no value for an argument the constructor requires.\n*/\nfunction argumentsFor(descriptor, output) {\n\tif (descriptor.entityRefArg !== void 0 || descriptor.output.codecId !== output.codecId) return;\n\tconst args = [];\n\tfor (const [key, template] of Object.entries(descriptor.output.typeParams ?? {})) {\n\t\tconst value = output.typeParams?.[key];\n\t\tif (value !== void 0 && isAuthoringArgRef(template) && template.path === void 0) args[template.index] = value;\n\t}\n\tconst requiredArgs = (descriptor.args ?? []).filter((arg) => arg.optional !== true).length;\n\tif (args.length < requiredArgs || Array.from(args).includes(void 0)) return void 0;\n\ttry {\n\t\treturn produces(instantiateAuthoringTypeConstructor(descriptor, args), output) ? args : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* The first call, in namespace order, to a type constructor in `namespace` that produces exactly\n* `output`. The inverse of {@link instantiateAuthoringTypeConstructor} for constructors whose type\n* parameters each come straight from one argument. A constructor whose argument names another\n* entity is never chosen. `undefined` when no call produces `output`.\n*/\nfunction findAuthoringTypeConstructorCall(namespace, output) {\n\tfor (const { path, descriptor } of typeConstructors(namespace)) {\n\t\tconst args = argumentsFor(descriptor, output);\n\t\tif (args !== void 0) return {\n\t\t\tpath,\n\t\t\targs\n\t\t};\n\t}\n}\n//#endregion\n//#region src/shared/enum-stored-members.ts\n/**\n* Each enum member whose stored form equals an earlier member's, paired with the first such member. Stored forms are compared as `contract.json` holds them, so negative zero is zero, and by `canonicalStringify`, so two objects with the same entries in a different order are equal. Every enum authoring surface refuses the members this returns.\n*/\nfunction duplicateStoredMembers(members) {\n\tconst memberByStoredForm = /* @__PURE__ */ new Map();\n\tconst duplicates = [];\n\tfor (const { name, stored } of members) {\n\t\tconst key = canonicalStringify(JSON.parse(JSON.stringify(stored)));\n\t\tconst earlier = memberByStoredForm.get(key);\n\t\tif (earlier === void 0) memberByStoredForm.set(key, name);\n\t\telse duplicates.push({\n\t\t\tearlier,\n\t\t\tlater: name,\n\t\t\tstored\n\t\t});\n\t}\n\treturn duplicates;\n}\n//#endregion\n//#region src/shared/enum-block-members.ts\n/**\n* A problem with an enum's members as a diagnostic at the member, or at the block when the problem is the enum's codec.\n*/\nfunction enumMemberProblemDiagnostic(problem, site) {\n\tconst { enumName, codecId, sourceId } = site;\n\tconst at = (member) => ({\n\t\tsourceId,\n\t\tspan: site.memberSpans[member] ?? site.span\n\t});\n\tswitch (problem.kind) {\n\t\tcase \"codec-not-for-enums\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" cannot use the codec \"${codecId}\". ${problem.refusal}`,\n\t\t\tsourceId,\n\t\t\tspan: site.span\n\t\t};\n\t\tcase \"codec-missing\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" uses codec \"${codecId}\", which no pack in the contract provides`,\n\t\t\tsourceId,\n\t\t\tspan: site.span\n\t\t};\n\t\tcase \"codec-refused-member\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" member \"${problem.member}\" was rejected by codec \"${codecId}\": ${problem.reason}`,\n\t\t\t...at(problem.member)\n\t\t};\n\t\tcase \"member-not-stored-as-written\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" member \"${problem.member}\" is written ${problem.written}, but its codec stores ${JSON.stringify(problem.stored)}. Write the member as ${problem.writeAs}.`,\n\t\t\t...at(problem.member)\n\t\t};\n\t\tcase \"duplicate-member-value\": return {\n\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\": members \"${problem.earlier}\" and \"${problem.later}\" both store ${JSON.stringify(problem.stored)}`,\n\t\t\t...at(problem.later)\n\t\t};\n\t}\n}\n/**\n* Reads the members of an `enum` block through its codec. A member written as a number literal is read from its source text as a column default is read, when the family gives a reader for it (`ctx.readWrittenNumber`), so no digit is lost; when that reader refuses the number, the codec's `decodeJson` reads it, and only if the codec refuses it too is the reader's reason reported. Every other member goes to the codec's `decodeJson`, and a bare member is read from its own name.\n* Pushes a diagnostic and returns `undefined` when the codec refuses a member, when two members\n* store the same value, or when the block has no members. Shared by every family's enum factory.\n*/\nfunction readEnumBlockMembers(block, codecId, codec, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst site = {\n\t\tenumName: block.name,\n\t\tcodecId,\n\t\tsourceId,\n\t\tspan: block.span,\n\t\tmemberSpans: block.parameterSpans\n\t};\n\tconst members = [];\n\tconst storedMembers = [];\n\tlet memberError = false;\n\tfor (const [memberName, memberValue] of Object.entries(block.values)) {\n\t\tconst span = block.parameterSpans[memberName] ?? block.span;\n\t\tconst reading = typeof memberValue === \"number\" ? ctx.readWrittenNumber?.({\n\t\t\ttext: block.numberTexts?.[memberName] ?? String(memberValue),\n\t\t\tcodecId,\n\t\t\tsubject: `enum \"${block.name}\" member \"${memberName}\"`\n\t\t}) : void 0;\n\t\tconst written = reading?.ok ? reading.value : memberValue === void 0 ? memberName : memberValue;\n\t\tlet read;\n\t\ttry {\n\t\t\tread = codec.decodeJson(written);\n\t\t} catch (err) {\n\t\t\tif (isInternalError(err)) throw err;\n\t\t\tdiagnostics?.push(reading !== void 0 && !reading.ok ? {\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: reading.message,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t} : memberValue === void 0 ? {\n\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t} : {\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${err instanceof Error ? err.message : String(err)}`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tmembers.push({\n\t\t\tname: memberName,\n\t\t\tvalue: read\n\t\t});\n\t\tstoredMembers.push({\n\t\t\tname: memberName,\n\t\t\tstored: codec.encodeJson(read)\n\t\t});\n\t}\n\tfor (const duplicate of duplicateStoredMembers(storedMembers)) {\n\t\tdiagnostics?.push(enumMemberProblemDiagnostic({\n\t\t\tkind: \"duplicate-member-value\",\n\t\t\t...duplicate\n\t\t}, site));\n\t\tmemberError = true;\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn members;\n}\n//#endregion\n//#region src/shared/enum-members.ts\n/** Whether TypeScript gives the value a literal type: a primitive, or an array or plain object of them. */\nfunction hasLiteralType(value) {\n\tif ([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"boolean\",\n\t\t\"bigint\"\n\t].includes(typeof value)) return true;\n\tif (Array.isArray(value)) return value.every(hasLiteralType);\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === Object.prototype || prototype === null) && Object.values(value).every(hasLiteralType);\n}\n/**\n* A member's value in the form its codec stores it, and that form read back by the codec. A codec that throws on either is a refusal naming the member; an internal error is not the member's fault and propagates.\n*/\nfunction encodeEnumMember(member, codec) {\n\ttry {\n\t\tconst stored = codec.encodeJson(member.value);\n\t\treturn ok({\n\t\t\tstored,\n\t\t\treadBack: codec.decodeJson(stored)\n\t\t});\n\t} catch (cause) {\n\t\tif (isInternalError(cause)) throw cause;\n\t\treturn notOk({\n\t\t\tkind: \"codec-refused-member\",\n\t\t\tmember: member.name,\n\t\t\treason: cause instanceof Error ? cause.message : String(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/**\n* Refuses a member its codec reads back as a different value from the one written. A member with no literal type has nothing to compare.\n*/\nfunction notStoredAsWritten(member, stored, readBack) {\n\tif (!hasLiteralType(member.value)) return void 0;\n\tif (hasLiteralType(readBack) && canonicalStringify(readBack) === canonicalStringify(member.value)) return void 0;\n\treturn {\n\t\tkind: \"member-not-stored-as-written\",\n\t\tmember: member.name,\n\t\twritten: canonicalStringify(member.value),\n\t\tstored,\n\t\twriteAs: hasLiteralType(readBack) ? canonicalStringify(readBack) : JSON.stringify(stored)\n\t};\n}\n/**\n* Each member of an enum in the form its codec stores it. Refuses a codec an enum cannot use, a codec the lookup does not have, a member the codec refuses, a member the codec reads back as another value, and two members stored as the same value. Every family's contract build calls this, and reports the problems in its own terms.\n*/\nfunction encodeEnumMembers(decodedEnum, codecLookup) {\n\tconst descriptor = codecLookup.descriptorFor(decodedEnum.codecId);\n\tconst refusal = descriptor === void 0 ? void 0 : enumRefusalOf(descriptor);\n\tif (refusal !== void 0) return notOk([{\n\t\tkind: \"codec-not-for-enums\",\n\t\trefusal\n\t}]);\n\tconst codec = codecLookup.get(decodedEnum.codecId);\n\tif (codec === void 0) return notOk([{ kind: \"codec-missing\" }]);\n\tconst problems = [];\n\tconst members = [];\n\tfor (const member of decodedEnum.enumMembers) {\n\t\tconst encoded = encodeEnumMember(member, codec);\n\t\tif (!encoded.ok) {\n\t\t\tproblems.push(encoded.failure);\n\t\t\tcontinue;\n\t\t}\n\t\tconst { stored, readBack } = encoded.value;\n\t\tconst mismatch = notStoredAsWritten(member, stored, readBack);\n\t\tif (mismatch !== void 0) problems.push(mismatch);\n\t\tmembers.push({\n\t\t\tname: member.name,\n\t\t\tvalue: stored\n\t\t});\n\t}\n\tfor (const duplicate of duplicateStoredMembers(members.map(({ name, value }) => ({\n\t\tname,\n\t\tstored: value\n\t})))) problems.push({\n\t\tkind: \"duplicate-member-value\",\n\t\t...duplicate\n\t});\n\treturn problems.length > 0 ? notOk(problems) : ok(members);\n}\n//#endregion\n//#region src/shared/field-preset-resolution.ts\nfunction presetSpellingsUnder(members, prefix) {\n\treturn Object.entries(members).flatMap(([name, member]) => isAuthoringFieldPresetDescriptor(member) ? [`${prefix}.${name}(${(member.args ?? []).map((arg, index) => arg.name ?? `argument${index + 1}`).join(\", \")})`] : presetSpellingsUnder(member, `${prefix}.${name}`));\n}\n/**\n* How each field preset registered under `namespace`, at any depth, is written, with the names of its arguments: `temporal.timestamp(onCreate, onUpdate)`.\n*/\nfunction fieldPresetSpellings(contributions, namespace) {\n\tconst members = contributions?.field?.[namespace];\n\tif (members === void 0 || isAuthoringFieldPresetDescriptor(members)) return [];\n\treturn presetSpellingsUnder(members, namespace);\n}\n/**\n* Walks `authoringContributions.field` segment by segment and returns the field-preset descriptor at the path, or `undefined` when none is registered there.\n*/\nfunction getAuthoringFieldPreset(contributions, path) {\n\tlet current = contributions?.field;\n\tfor (const segment of path) {\n\t\tif (typeof current !== \"object\" || current === null || \"kind\" in current) return;\n\t\tcurrent = current[segment];\n\t}\n\treturn current !== void 0 && isAuthoringFieldPresetDescriptor(current) ? current : void 0;\n}\n//#endregion\n//#region src/shared/written-value.ts\n/**\n* Words a refusal of the cast rule. The message leads with what to write; the types are named only when the value has a form the position admits and its type is still refused, such as a number too large for the receiving type.\n*/\nfunction describeRefusal(refusal, support, guidance) {\n\tswitch (refusal.kind) {\n\t\tcase \"unknown-tag\": return {\n\t\t\tcode: \"PSL_UNKNOWN_LITERAL_TAG\",\n\t\t\tmessage: `Unknown literal tag \"${refusal.tag}\". Known tags: ${refusal.known.join(\", \")}.`\n\t\t};\n\t\tcase \"unwritable\": return {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: `${describeExpected(guidance.forms)}; this target has no data type for a ${refusal.syntax} value`\n\t\t};\n\t\tcase \"unreadable\": return {\n\t\t\tcode: \"PSL_INVALID_LITERAL\",\n\t\t\tmessage: refusal.message\n\t\t};\n\t\tcase \"no-cast\": return {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: describeRefusedValueType(refusal, support, guidance)\n\t\t};\n\t}\n}\n/** `Expected <forms>`, the forms joined with `or`: the start of every refusal that says what to write. */\nfunction describeExpected(forms) {\n\treturn `Expected ${joinForms(forms)}`;\n}\n/**\n* Words a value of type `valueType` that `receivingType` refuses, where `guidance.forms` may be written. The types are named only when the value has one of those forms.\n*/\nfunction describeRefusedValueType(refused, support, guidance) {\n\tconst expected = describeExpected(guidance.forms);\n\tconst valueForm = writtenForm(support, refused.valueType);\n\tif (valueForm !== void 0 && guidance.forms.some((form) => isSameForm(form, valueForm))) return `${expected} that ${refused.receivingType} can hold; got ${refused.valueType}`;\n\treturn guidance.rewrite === void 0 ? expected : `${expected}; write ${guidance.rewrite}`;\n}\nfunction isSameForm(a, b) {\n\treturn a.kind === \"tag\" && b.kind === \"tag\" ? a.tag === b.tag : a.kind === b.kind;\n}\n/**\n* The literal to write in place of a quoted string that `receivingType` refuses: the string as a literal of the first tag the type admits. `undefined` when the value is not a quoted string, the type admits no tag, the literal would not read back as the same text, or the type would refuse the literal too.\n*/\nfunction exactRewrite(support, receivingType, written) {\n\tconst [tag] = admittedTags(support, receivingType);\n\tif (written.kind !== \"string\" || tag === void 0) return void 0;\n\tif (!printedTaggedLiteralReadsBack(written.text)) return void 0;\n\tconst read = readWrittenValue(support, {\n\t\tkind: \"tag\",\n\t\ttag,\n\t\ttext: written.text\n\t});\n\tif (!read.ok || !castTypedValue(support, receivingType, read.value).ok) return void 0;\n\treturn printTaggedLiteral(tag, written.text);\n}\nfunction findEntry(support, matches) {\n\tfor (const [key, entry] of Object.entries(support.entries)) if (matches(entry)) return {\n\t\tkey,\n\t\tentry\n\t};\n}\n/** The entry a tag names, or `undefined` when no pack registered that tag. */\nfunction entryForTag(support, tag) {\n\treturn findEntry(support, ({ written }) => written.kind === \"tag\" && written.tag === tag);\n}\n/** The entry that reads a plain string, boolean or number, or `undefined` when none does. */\nfunction entryForPlain(support, syntax) {\n\treturn findEntry(support, ({ written }) => written.kind === \"plain\" && written.syntax === syntax);\n}\n/** Every tag a stack registers, in the order the entries were merged. */\nfunction knownTags(support) {\n\treturn Object.values(support.entries).flatMap((entry) => entry.written.kind === \"tag\" ? [entry.written.tag] : []);\n}\nfunction textOf(written) {\n\treturn written.kind === \"boolean\" ? String(written.value) : written.text;\n}\nfunction messageOf(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/** Read one written value through the authoring entry for its syntax. */\nfunction readWrittenValue(support, written) {\n\tconst found = written.kind === \"tag\" ? entryForTag(support, written.tag) : entryForPlain(support, written.kind);\n\tif (found === void 0) return written.kind === \"tag\" ? notOk({\n\t\tkind: \"unknown-tag\",\n\t\ttag: written.tag,\n\t\tknown: knownTags(support)\n\t}) : notOk({\n\t\tkind: \"unwritable\",\n\t\tsyntax: written.kind\n\t});\n\tconst text = textOf(written);\n\tconst form = found.entry.written;\n\tif (form.kind === \"plain\" && form.syntax === \"number\") {\n\t\tconst classified = form.classify(text);\n\t\treturn classified === void 0 ? notOk({\n\t\t\tkind: \"unreadable\",\n\t\t\tmessage: `no data type of this target holds the number ${text}`\n\t\t}) : ok(classified);\n\t}\n\ttry {\n\t\treturn ok({\n\t\t\ttype: dataTypeId(authoringEntryType(found.key, found.entry)),\n\t\t\tvalue: form.parse(text)\n\t\t});\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn notOk({\n\t\t\tkind: \"unreadable\",\n\t\t\tmessage: messageOf(error)\n\t\t});\n\t}\n}\n/** Take a typed value into the receiving type, directly or through the cast that type declares. */\nfunction castTypedValue(support, receivingType, typed) {\n\tif (typed.type === receivingType) return ok({\n\t\ttype: receivingType,\n\t\tvalue: typed.value\n\t});\n\tconst declaration = support.lookup.get(receivingType);\n\tconst cast = declaration?.casts[typed.type];\n\tif (cast === void 0) return notOk({\n\t\tkind: \"no-cast\",\n\t\treceivingType,\n\t\tvalueType: typed.type,\n\t\tcasts: Object.keys(declaration?.casts ?? {})\n\t});\n\ttry {\n\t\treturn ok({\n\t\t\ttype: receivingType,\n\t\t\tvalue: cast(typed.value)\n\t\t});\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn notOk({\n\t\t\tkind: \"unreadable\",\n\t\t\tmessage: messageOf(error)\n\t\t});\n\t}\n}\n/** The type itself, then each type it casts from, in key order. */\nfunction admittedTypes(support, dataType) {\n\treturn [dataType, ...Object.keys(support.lookup.get(dataType)?.casts ?? {})];\n}\n/** The tags a position of `dataType` admits: its own tag, then the tags of the types it casts from. */\nfunction admittedTags(support, dataType) {\n\tconst tags = admittedTypes(support, dataType).flatMap((type) => {\n\t\tconst written = support.entries[type]?.written;\n\t\treturn written?.kind === \"tag\" ? [written.tag] : [];\n\t});\n\treturn [...new Set(tags)];\n}\n/** The form a value of a tagged literal's type is written in. */\nfunction tagForm(tag) {\n\treturn {\n\t\tkind: \"tag\",\n\t\ttag,\n\t\tphrase: `${tag}\\`...\\``\n\t};\n}\nconst PLAIN_PHRASES = {\n\tstring: \"a quoted string\",\n\tboolean: \"true or false\",\n\tnumber: \"a number\"\n};\nfunction writtenForm(support, type) {\n\tconst written = support.entries[type]?.written;\n\tif (written?.kind === \"tag\") return tagForm(written.tag);\n\tif (written?.kind === \"plain\" && written.syntax !== \"number\") return {\n\t\tkind: written.syntax,\n\t\tphrase: PLAIN_PHRASES[written.syntax]\n\t};\n\treturn Object.entries(support.entries).some(([key, entry]) => entry.written.kind === \"plain\" && entry.written.syntax === \"number\" && (key === type || entry.written.types.some((listed) => listed === type))) ? {\n\t\tkind: \"number\",\n\t\tphrase: PLAIN_PHRASES.number\n\t} : void 0;\n}\n/** What {@link describeAdmittedForms} returns for a type that nothing writes. */\nconst NO_WRITTEN_FORM = \"no written form\";\n/** Each form a position receiving every one of `receivingTypes` admits, once, in order: ``sql`...` ``, `true or false`. */\nfunction admittedForms(support, receivingTypes) {\n\tconst forms = [];\n\tfor (const type of receivingTypes.flatMap((receiving) => admittedTypes(support, receiving))) {\n\t\tconst form = writtenForm(support, type);\n\t\tif (form !== void 0 && !forms.some((listed) => isSameForm(listed, form))) forms.push(form);\n\t}\n\treturn forms;\n}\nfunction joinForms(forms) {\n\treturn forms.length === 0 ? NO_WRITTEN_FORM : forms.map((form) => form.phrase).join(\" or \");\n}\n/** How a position of `dataType` can be written, for a diagnostic: ``sql`...` ``, `true or false`. */\nfunction describeAdmittedForms(support, dataType) {\n\treturn joinForms(admittedForms(support, [dataType]));\n}\n//#endregion\nexport { TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, admittedForms, admittedTags, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, authoringEntryType, canonicalizeTaggedLiteralBody, castTypedValue, classifyEnumMemberType, collectScalarTypeConstructors, describeAdmittedForms, describeExpected, describeRefusal, describeRefusedValueType, describeTaggedLiteralFailure, duplicateStoredMembers, encodeEnumMembers, entryForPlain, entryForTag, enumMemberProblemDiagnostic, exactRewrite, fieldPresetSpellings, findAuthoringTypeConstructorCall, flushAuthoringWarnings, getAuthoringFieldPreset, getAuthoringTypeConstructor, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, isTagEntryKey, knownTags, mergeAuthoringNamespaces, printTaggedLiteral, printedTaggedLiteralReadsBack, readEnumBlockMembers, readWrittenValue, resolveAuthoringTemplateValue, resolveEnumCodecId, resolveTemplateTagEscapes, tagEntryKey, tagForm, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseT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ACnC,MAAM,UAAU,QAAQ,QAAQ,KAAK,EAAE;CACvC,IAAI,SAAS,SAAS,OAAO,OAAO,QAAQ,QAAQ,GAAG;CACvD,IAAI,SAAS,SAAS,WAAW,QAAQ,WAAW,UAAU,OAAO;EACpE,MAAM,QAAQ;EACd,QAAQ,cAAc,QAAQ;CAC/B;CACA,OAAO,OAAO,QAAQ,QAAQ,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,WAAW,MAAM,QAAQ,SAAS,WAAW,MAAM,QAAQ,WAAW,aAAa,QAAQ,QAAQ,MAAM,QAAQ,MAAM,MAAM,WAAW,WAAW,IAAI,EAAE,IAAI;EAC/M,MAAM;EACN,QAAQ,cAAc;CACvB,IAAI,KAAK;AACV;;AAEA,MAAM,kBAAkB;;AAExB,SAAS,cAAc,SAAS,gBAAgB;CAC/C,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,QAAQ,eAAe,SAAS,cAAc,cAAc,SAAS,SAAS,CAAC,GAAG;EAC5F,MAAM,OAAO,YAAY,SAAS,IAAI;EACtC,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM,MAAM,WAAW,WAAW,QAAQ,IAAI,CAAC,GAAG,MAAM,KAAK,IAAI;CAC1F;CACA,OAAO;AACR;AACA,SAAS,UAAU,OAAO;CACzB,OAAO,MAAM,WAAW,IAAI,kBAAkB,MAAM,KAAK,SAAS,KAAK,MAAM,CAAC,CAAC,KAAK,MAAM;AAC3F;;AAEA,SAAS,sBAAsB,SAAS,UAAU;CACjD,OAAO,UAAU,cAAc,SAAS,CAAC,QAAQ,CAAC,CAAC;AACpD"}
@@ -4,12 +4,12 @@ import { D as AuthoringTypeConstructorDescriptor, U as PslSpan, p as AuthoringFi
4
4
  import { r as ControlMutationDefaults } from "./mutation-default-types-DCgdIlXt-DSAdarYA.mjs";
5
5
  import { r as Result } from "./result-BYCOANWy.mjs";
6
6
  import { d as TaggedLiteralCanonicalization, f as TypedValue } from "./written-value--KnOpj99-BA9i2Wto.mjs";
7
- import "./authoring-C0JXF22s.mjs";
7
+ import "./authoring-D--mDfh-.mjs";
8
8
  import "./codec-DXDkDjYm.mjs";
9
9
  import "./control-DYUdUrD2.mjs";
10
10
  import "./psl-ast-Dho77tVl.mjs";
11
- import { n as ContractSourceContext } from "./config-types-BWNY2ea_.mjs";
12
- import { $ as TypeAnnotationAst, A as NamespaceDeclarationAst, D as ModelAttributeAst, F as ParseDiagnostic, O as ModelDeclarationAst, T as MixinDeclarationAst, V as PslSources, Y as SyntaxNode, _ as GenericBlockDeclarationAst, f as DocumentAst, h as FieldDeclarationAst, k as NamedTypeDeclarationAst, l as CompositeTypeDeclarationAst, m as FieldAttributeAst, n as AstNode, p as ExpressionAst, w as KeyValuePairAst, z as PslDiagnostic } from "./parse-CJtBvEYy-BsdZXMKU.mjs";
11
+ import { n as ContractSourceContext } from "./config-types-z-EG3487.mjs";
12
+ import { $ as TypeAnnotationAst, A as NamespaceDeclarationAst, D as ModelAttributeAst, F as ParseDiagnostic, O as ModelDeclarationAst, T as MixinDeclarationAst, V as PslSources, Y as SyntaxNode, _ as GenericBlockDeclarationAst, f as DocumentAst, h as FieldDeclarationAst, k as NamedTypeDeclarationAst, l as CompositeTypeDeclarationAst, m as FieldAttributeAst, n as AstNode, p as ExpressionAst, w as KeyValuePairAst, z as PslDiagnostic } from "./parse-CJtBvEYy-CDKziSed.mjs";
13
13
  import { n as UnionToIntersection, t as Simplify } from "./types-DGxlljKG.mjs";
14
14
  //#region ../../../1-framework/2-authoring/psl-parser/dist/binder-C54tCWu0.d.mts
15
15
  //#region src/resolve.d.ts
@@ -512,4 +512,4 @@ declare function contributedTypeOf(resolution: Resolution | undefined, binder: B
512
512
  declare function createBinder(input: CreateBinderInput): BinderResult;
513
513
  //#endregion
514
514
  export { ModelSymbol as $, DescribeUnresolvedType as A, SymbolTableResult as At, FixedStrArgType as B, contributedTypeOf as Bt, ContributedTypeNamespace as C, ResolvedAttributeArg as Ct, CtxOf as D, Scope as Dt, CreateBinderInput as E, ResolvedTypeConstructorCall as Et, FieldAttributeCtx as F, UnrestrictedIdentifierArgType as Ft, InferAttr as G, matchesSelector as Gt, FuncCallSig as H, entityReference as Ht, FieldRefArgType as I, UnrestrictedNumArgType as It, JsonArgType as J, readResolvedAttribute as Jt, InspectableArgType as K, memberEntries as Kt, FieldSymbol as L, UnrestrictedStrArgType as Lt, EntityDeclaration as M, TopLevelScope as Mt, EntityRefArgType as N, TypedFuncCall as Nt, DataTypeValueArgType as O, ScopeResolution as Ot, EntitySelector as P, UnresolvedTypeReference as Pt, ModelAttributeCtx as Q, FixedIdentifierArgType as R, UnsupportedAttribute as Rt, ContributedTypeDescriptor as S, ResolvedAttribute as St, ContributedTypeSymbol as T, ResolvedNamedTypeBinding as Tt, FunctionSymbol as U, isNamespaceLike as Ut, FuncCallArgType as V, createBinder as Vt, IdentifierArgType as W, keywordPslSpan as Wt, ListArgType as X, readResolvedConstructorCall as Xt, JsonValueArgType as Y, readResolvedAttributes as Yt, MixinSymbol as Z, typeReferenceNode as Zt, CompositeTypeSymbol as _, RecordArgType as _t, AttributeLevel as a, NumLiteralArgType as at, ContributedMember as b, RequiredContextFor as bt, AttributeSymbol as c, OutOf as ct, BinderResult as d, ParameterSymbol as dt, NamedOut as et, BlockAttributeCtx as f, ParsedTaggedLiteral as ft, BuildSymbolTableOptions as g, PslSymbol as gt, BoundSpec as h, PositionalParam as ht, AttributeCtx as i, NumLiteral as it, DescribeUnsupportedAttribute as j, TaggedLiteralArgType as jt, DeclarationFor as k, SymbolTable as kt, Binder as l, PSL_UNRESOLVED_REFERENCE as lt, BoolArgType as m, PosOut as mt, ArgType as n, NamespaceSymbol as nt, AttributeOut as o, OneOfArgType as ot, BlockSymbol as p, ParsedTypedValue as pt, IntArgType as q, nodePslSpan as qt, ArgTypeKind as r, NullArgType as rt, AttributeSpec as s, OptionalArgType as st, AnyArgType as t, NamedTypeSymbol as tt, BinderContext as u, Param as ut, ConstantSymbol as v, ReferencedFieldRefArgType as vt, ContributedTypeScope as w, ResolvedEntityReference as wt, ContributedNamespaceSymbol as x, Resolution as xt, ContextForRequirement as y, RejectingArgType as yt, FixedNumArgType as z, buildSymbolTable as zt };
515
- //# sourceMappingURL=binder-C54tCWu0-wFS-Dsru.d.mts.map
515
+ //# sourceMappingURL=binder-C54tCWu0-VCDLfJaz.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"binder-C54tCWu0-wFS-Dsru.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/binder-C54tCWu0.d.mts"],"mappings":";;;;;;;;;;;;;;;UAUU;WACC;WACA;WACA;WACA,aAAa;WACb,MAAM;;UAEP,kBAAkB,cAAc,oBAAoB,oBAAoB,oBAAoB;WAC3F;WACA,eAAe;WACf,MAAM;WACN,MAAM;;UAEP;WACC;WACA,eAAe;WACf,MAAM;;iBAEA,sBAAsB,cAAc,oBAAoB,mBAAmB,WAAW,OAAO,SAAS,aAAa,kBAAkB;iBACrI,uBAAuB,cAAc,oBAAoB,mBAAmB,YAAY,SAAS,QAAQ,SAAS,sBAAsB,kBAAkB;iBAC1J,4BAA4B,YAAY,+BAA+B,SAAS,aAAa;iBAC7F,YAAY,MAAM,YAAY,SAAS,aAAa;;iBAEpD,eAAe,MAAM,YAAY,iBAAiB,SAAS,aAAa;;;UAG/E;WACC,UAAU;;UAEX;WACC,YAAY,eAAe;WAC3B,YAAY,eAAe;WAC3B,QAAQ,eAAe;WACvB,QAAQ,eAAe;WACvB,gBAAgB,eAAe;WAC/B,QAAQ,eAAe;;UAExB;WACC,MAAM;WACN,MAAM;;UAEP;WACC;WACA;WACA,eAAe,yBAAyB;WACxC,QAAQ,eAAe;WACvB,gBAAgB,eAAe;WAC/B,QAAQ,eAAe;WACvB,QAAQ,eAAe;;UAExB;WACC;WACA;WACA,MAAM;WACN,MAAM;EACf,QAAQ,eAAe;EACvB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA,MAAM;WACN,MAAM;EACf,QAAQ,eAAe;EACvB,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;WACA,QAAQ;;WAER;WACA,QAAQ;;uBAEI;qBACF,QAAQ;EAC3B,YAAY,QAAQ;WACX,OAAO,eAAe;qBACZ,YAAY;EAC/B,WAAW,2BAA2B;;iBAEvB,gBAAgB,YAAY,kBAAkB,cAAc,QAAQ;EACnF;;iBAEe,cAAc,WAAW,QAAQ;EAChD;KACG,2BAA2B;;;cAGlB;KACT,YAAY,qBAAqB,qBAAqB,qBAAqB,qBAAqB,qBAAqB;UAChH;WACC;WACA;WACA;WACA,MAAM;;UAEP;WACC;WACA;WACA,OAAO;;UAER;WACC;WACA;WACA,WAAW;;UAEZ;WACC;WACA;WACA;;KAEN,YAAY,cAAc,sBAAsB,kBAAkB,cAAc,kBAAkB,cAAc;KAChH,aAAa,cAAc,sBAAsB;KACjD,aAAa;WACP;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;;WAEA;WACA;;UAED;EACR,eAAe,MAAM,aAAa;EAClC,cAAc,MAAM,aAAa;EACjC,QAAQ,MAAM,aAAa;;UAEnB;WACC,WAAW;WACX;WACA,OAAO;WACP,OAAO;;KAEb,gCAAgC,aAAa,yBAAyB;UACjE;WACC,OAAO;WACP,OAAO;WACP;;KAEN,0BAA0B,YAAY;UACjC,sBAAsB,KAAK;WAC1B,yBAAyB,KAAK;;UAE/B;WACC,SAAS;WACT,aAAa;WACb,SAAS;;UAEV;WACC,QAAQ;WACR,sBAAsB;;iBAEhB,kBAAkB,QAAQ,cAAc,kBAAkB;iBAC1D,kBAAkB,YAAY,wBAAwB,QAAQ,SAAS;iBACvE,aAAa,OAAO,oBAAoB"}
1
+ {"version":3,"file":"binder-C54tCWu0-VCDLfJaz.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/binder-C54tCWu0.d.mts"],"mappings":";;;;;;;;;;;;;;;UAUU;WACC;WACA;WACA;WACA,aAAa;WACb,MAAM;;UAEP,kBAAkB,cAAc,oB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,kBAAkB,cAAc,kBAAkB,cAAc;KAChH,aAAa,cAAc,sBAAsB;KACjD,aAAa;WACP;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;;WAEA;WACA;;UAED;EACR,eAAe,MAAM,aAAa;EAClC,cAAc,MAAM,aAAa;EACjC,QAAQ,MAAM,aAAa;;UAEnB;WACC,WAAW;WACX;WACA,OAAO;WACP,OAAO;;KAEb,gCAAgC,aAAa,yBAAyB;UACjE;WACC,OAAO;WACP,OAAO;WACP;;KAEN,0BAA0B,YAAY;UACjC,sBAAsB,KAAK;WAC1B,yBAAyB,KAAK;;UAE/B;WACC,SAAS;WACT,aAAa;WACb,SAAS;;UAEV;WACC,QAAQ;WACR,sBAAsB;;iBAEhB,kBAAkB,QAAQ,cAAc,kBAAkB;iBAC1D,kBAAkB,YAAY,wBAAwB,QAAQ,SAAS;iBACvE,aAAa,OAAO,oBAAoB"}
@@ -19,43 +19,6 @@ var CodecImpl = class {
19
19
  }
20
20
  };
21
21
  /**
22
- * The canonical form of the values of a column whose codec is `codec` (ADR 254): the codec's own when it declares one, else its data type's. Whatever reads, compares or writes a stored value of a column takes its canonical form from here.
23
- */
24
- function canonicalFormOf(codec, dataTypes) {
25
- return codec.toCanonicalForm ?? dataTypes.get(codec.dataType)?.toCanonicalForm;
26
- }
27
- /**
28
- * Why an enum cannot use the codec `descriptor` describes, or `undefined` when one can: the codec's own {@link CodecDescriptorTemplate.enumRefusal}, else the missing `equality` trait. Every enum authoring surface refuses a codec through this.
29
- */
30
- function enumRefusalOf(descriptor) {
31
- if (descriptor.enumRefusal !== void 0) return descriptor.enumRefusal;
32
- if (descriptor.traits.includes("equality")) return void 0;
33
- return "The codec does not declare the equality trait, so no value can be compared with a member. Use a codec that declares it.";
34
- }
35
- /**
36
- * Abstract base class for concrete codec descriptors.
37
- *
38
- * Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `paramsSchema`, the curried `factory(params)`, and (optionally) `renderOutputType`.
39
- *
40
- * Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.
41
- */
42
- var CodecDescriptorTemplateImpl = class {
43
- get isParameterized() {
44
- return this.paramsSchema !== void 0;
45
- }
46
- /** Optional canonical form of the codec's values. See {@link CodecDescriptorTemplate.toCanonicalForm}. */
47
- toCanonicalForm;
48
- };
49
- /**
50
- * Abstract base for a concrete codec descriptor: a {@link CodecDescriptorTemplateImpl} that also
51
- * names the data type its codec represents.
52
- *
53
- * A codec whose data type depends on the target that adopts it extends
54
- * {@link CodecDescriptorTemplateImpl} instead, and the target names the type when it adapts the
55
- * template.
56
- */
57
- var CodecDescriptorImpl = class extends CodecDescriptorTemplateImpl {};
58
- /**
59
22
  * Trivial column packager. Per-codec helpers call this directly with the result of `descriptor.factory(params)` — direct method invocation binds the descriptor's method-level generic at the call site and the literal flows through `R`.
60
23
  */
61
24
  function column(codecFactory, codecId, typeParams) {
@@ -167,6 +130,6 @@ function renderTsLiteral(value) {
167
130
  if (typeof value === "number" || typeof value === "boolean") return String(value);
168
131
  }
169
132
  //#endregion
170
- export { enumRefusalOf as _, INT64_RANGE as a, refuseJsonValue as b, canonicalFormOf as c, decodeJsonFloat as d, decodeJsonInteger as f, encodeJsonFloat as g, decodeJsonString as h, INT32_RANGE as i, column as l, decodeJsonMatching as m, CodecDescriptorTemplateImpl as n, SAFE_INTEGER_BIGINT_RANGE as o, decodeJsonIntegerText as p, CodecImpl as r, SAFE_INTEGER_RANGE as s, CodecDescriptorImpl as t, decodeJsonBoolean as u, isIntegerIn as v, renderTsLiteral as x, isNonFiniteText as y };
133
+ export { renderTsLiteral as _, SAFE_INTEGER_RANGE as a, decodeJsonFloat as c, decodeJsonMatching as d, decodeJsonString as f, refuseJsonValue as g, isNonFiniteText as h, SAFE_INTEGER_BIGINT_RANGE as i, decodeJsonInteger as l, isIntegerIn as m, INT32_RANGE as n, column as o, encodeJsonFloat as p, INT64_RANGE as r, decodeJsonBoolean as s, CodecImpl as t, decodeJsonIntegerText as u };
171
134
 
172
- //# sourceMappingURL=codec-B-7ArtWI.mjs.map
135
+ //# sourceMappingURL=codec-B6f31GrC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-B6f31GrC.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.mjs"],"sourcesContent":["import { i as enumRefusalOf, n as CodecDescriptorTemplateImpl, r as canonicalFormOf, t as CodecDescriptorImpl } from \"./codec-descriptor-DUZmWwry.mjs\";\nimport { t as emptyCodecLookup } from \"./codec-types-BXLUbk-Y.mjs\";\nimport { a as dataTypeId, c as requiredSchemaKeys, i as dataType, n as assembleDataTypes, o as objectSchemaKeys, r as createDataTypeLookup, s as requiredParamKeys, t as DATA_TYPE_ID_PATTERN } from \"./data-type-4xQlxYB5.mjs\";\nimport { a as resolveCodecDescriptorOrThrow, i as materializeCodec, o as validateCodecTypeParams, r as codecForRef, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from \"./resolve-codec-qqMjZrmn.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { tsStringLiteral } from \"@internal/ts-render\";\n//#region src/shared/codec.ts\n/**\n* Abstract base class for concrete codec implementations.\n*\n* Codec authors extend this class with their typed `Id`, `TTraits`, `TWire`, `TInput` and override all four abstract conversion methods: `encode`, `decode`, `encodeJson`, and `decodeJson`. The runtime instance carries only its `id` (proxied through the descriptor so alias subclasses inherit the descriptor's id automatically) and the conversion methods — static metadata lives on the {@link CodecDescriptor}.\n*/\nvar CodecImpl = class {\n\tdescriptor;\n\t/**\n\t* Variance-erased descriptor reference. Concrete codec subclasses receive the typed descriptor in their own constructors and forward it via `super(descriptor)`; the variance erasure lives at this base because the abstract surface can't carry the concrete `TParams`.\n\t*/\n\tconstructor(descriptor) {\n\t\tthis.descriptor = descriptor;\n\t}\n\tget id() {\n\t\treturn this.descriptor.codecId;\n\t}\n};\n//#endregion\n//#region src/shared/column-spec.ts\n/**\n* Trivial column packager. Per-codec helpers call this directly with the result of `descriptor.factory(params)` — direct method invocation binds the descriptor's method-level generic at the call site and the literal flows through `R`.\n*/\nfunction column(codecFactory, codecId, typeParams) {\n\treturn {\n\t\tcodecFactory,\n\t\tcodecId,\n\t\ttypeParams\n\t};\n}\n//#endregion\n//#region src/shared/decode-json.ts\n/**\n* Readers for the JSON forms codecs share, each built as {@link Codec.decodeJson} requires: it returns the application value for a stored form of the codec's type and refuses anything else with {@link refuseJsonValue}.\n*/\nconst RECEIVED_PREVIEW_LIMIT = 100;\n/** The value a refusal names: its JSON text, or its digits for a number JSON cannot write, cut to 100 characters. */\nfunction receivedPreview(json) {\n\treturn (typeof json === \"number\" ? String(json) : JSON.stringify(json)).slice(0, RECEIVED_PREVIEW_LIMIT);\n}\n/**\n* The refusal every `decodeJson` raises: `RUNTIME.DECODE_FAILED`, `<codecId> JSON value must be <expected>`, with `meta.codecId` and `meta.received`, the value it was given as JSON text, cut to 100 characters.\n*/\nfunction refuseJsonValue(codecId, expected, json) {\n\tthrow structuredError(\"RUNTIME.DECODE_FAILED\", `${codecId} JSON value must be ${expected}`, { meta: {\n\t\tcodecId,\n\t\treceived: receivedPreview(json)\n\t} });\n}\nfunction decodeJsonString(codecId, json) {\n\tif (typeof json !== \"string\") return refuseJsonValue(codecId, \"a string\", json);\n\treturn json;\n}\n/** Reads a JSON string that matches `pattern`; `form` names what the pattern accepts, for the refusal. */\nfunction decodeJsonMatching(codecId, json, pattern, form) {\n\tif (typeof json !== \"string\" || !pattern.test(json)) return refuseJsonValue(codecId, form, json);\n\treturn json;\n}\nfunction decodeJsonBoolean(codecId, json) {\n\tif (typeof json !== \"boolean\") return refuseJsonValue(codecId, \"a boolean\", json);\n\treturn json;\n}\n/** Whether `value` is an integer within `range`, its ends included. */\nfunction isIntegerIn(value, range) {\n\treturn typeof value === \"number\" && Number.isInteger(value) && value >= range.min && value <= range.max;\n}\n/** The integers a JavaScript `number` holds exactly. */\nconst SAFE_INTEGER_RANGE = {\n\tmin: Number.MIN_SAFE_INTEGER,\n\tmax: Number.MAX_SAFE_INTEGER\n};\n/** The integers a signed 32-bit integer holds. */\nconst INT32_RANGE = {\n\tmin: -(2 ** 31),\n\tmax: 2 ** 31 - 1\n};\nfunction decodeJsonInteger(codecId, json, range) {\n\tif (!isIntegerIn(json, range)) return refuseJsonValue(codecId, `an integer from ${range.min} to ${range.max}`, json);\n\treturn json;\n}\n/** The integers a signed 64-bit integer holds. */\nconst INT64_RANGE = {\n\tmin: -(2n ** 63n),\n\tmax: 2n ** 63n - 1n\n};\n/** The integers a JavaScript `number` holds exactly, as a `bigint` range. */\nconst SAFE_INTEGER_BIGINT_RANGE = {\n\tmin: BigInt(Number.MIN_SAFE_INTEGER),\n\tmax: BigInt(Number.MAX_SAFE_INTEGER)\n};\nconst DECIMAL_INTEGER_TEXT = /^-?\\d+$/;\n/**\n* Reads an integer a codec writes as decimal text, because a JSON number cannot hold every value of its type. The text must be the integer's decimal text, with no leading zeros and no minus sign on zero; another spelling is refused with the text to write, as `\"7\"` for `\"007\"`.\n*/\nfunction decodeJsonIntegerText(codecId, json, range) {\n\tconst expected = range === void 0 ? \"a decimal integer string\" : `a decimal integer string from ${range.min} to ${range.max}`;\n\tconst value = BigInt(decodeJsonMatching(codecId, json, DECIMAL_INTEGER_TEXT, expected));\n\tif (range !== void 0 && (value < range.min || value > range.max)) return refuseJsonValue(codecId, expected, json);\n\tconst written = value.toString();\n\tif (json !== written) return refuseJsonValue(codecId, `\"${written}\", the integer's decimal text without leading zeros or a minus sign on zero`, json);\n\treturn value;\n}\nconst NON_FINITE_TEXT = /* @__PURE__ */ new Set([\n\t\"NaN\",\n\t\"Infinity\",\n\t\"-Infinity\"\n]);\n/** Whether `text` is `NaN`, `Infinity` or `-Infinity`, the text a float's JSON form writes for a value JSON has no number for. */\nfunction isNonFiniteText(text) {\n\treturn NON_FINITE_TEXT.has(text);\n}\n/** JSON has no number for NaN or an infinity, so a float's JSON form writes them as the text `NaN`, `Infinity` and `-Infinity`. */\nfunction encodeJsonFloat(value) {\n\treturn Number.isFinite(value) ? value : String(value);\n}\nfunction decodeJsonFloat(codecId, json) {\n\tif (typeof json === \"number\" && Number.isFinite(json)) return json;\n\tif (typeof json === \"string\" && isNonFiniteText(json)) return Number(json);\n\treturn refuseJsonValue(codecId, \"a finite number or the text NaN, Infinity or -Infinity\", json);\n}\n//#endregion\n//#region src/shared/render-ts-literal.ts\n/**\n* Renders a codec-encoded value as a TypeScript literal (e.g. `\"low\"`, `1`, `true`), or `undefined`\n* when the value isn't literal-expressible (objects, arrays, null).\n*\n* Valid **only for identity codecs** whose `encodeJson` output equals their decoded output type\n* (text, int, float, bool). A non-identity codec (e.g. one that encodes to an int but decodes to a\n* string literal) must NOT use this: it has to `decodeJson` first, then render, in its own\n* `renderValueLiteral`.\n*/\nfunction renderTsLiteral(value) {\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n}\n//#endregion\nexport { CONTRACT_CODEC_DESCRIPTOR_MISSING, CodecDescriptorImpl, CodecDescriptorTemplateImpl, CodecImpl, DATA_TYPE_ID_PATTERN, INT32_RANGE, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, assembleDataTypes, canonicalFormOf, codecForRef, column, createDataTypeLookup, dataType, dataTypeId, decodeJsonBoolean, decodeJsonFloat, decodeJsonInteger, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, emptyCodecLookup, encodeJsonFloat, enumRefusalOf, isIntegerIn, isNonFiniteText, materializeCodec, objectSchemaKeys, refuseJsonValue, renderTsLiteral, requiredParamKeys, requiredSchemaKeys, resolveCodecDescriptorOrThrow, validateCodecTypeParams };\n\n//# sourceMappingURL=codec.mjs.map"],"mappings":";;;;;;;;AAYA,IAAI,YAAY,MAAM;CACrB;;;;CAIA,YAAY,YAAY;EACvB,KAAK,aAAa;CACnB;CACA,IA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-framework/1-core/framework-components/dist/codec-descriptor-DUZmWwry.mjs
2
+ /**
3
+ * The canonical form of the values of a column whose codec is `codec` (ADR 254): the codec's own when it declares one, else its data type's. Whatever reads, compares or writes a stored value of a column takes its canonical form from here.
4
+ */
5
+ function canonicalFormOf(codec, dataTypes) {
6
+ return codec.toCanonicalForm ?? dataTypes.get(codec.dataType)?.toCanonicalForm;
7
+ }
8
+ /**
9
+ * Why an enum cannot use the codec `descriptor` describes, or `undefined` when one can: the codec's own {@link CodecDescriptorTemplate.enumRefusal}, else the missing `equality` trait. Every enum authoring surface refuses a codec through this.
10
+ */
11
+ function enumRefusalOf(descriptor) {
12
+ if (descriptor.enumRefusal !== void 0) return descriptor.enumRefusal;
13
+ if (descriptor.traits.includes("equality")) return void 0;
14
+ return "The codec does not declare the equality trait, so no value can be compared with a member. Use a codec that declares it.";
15
+ }
16
+ /**
17
+ * Abstract base class for concrete codec descriptors.
18
+ *
19
+ * Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `paramsSchema`, the curried `factory(params)`, and (optionally) `renderOutputType`.
20
+ *
21
+ * Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.
22
+ */
23
+ var CodecDescriptorTemplateImpl = class {
24
+ get isParameterized() {
25
+ return this.paramsSchema !== void 0;
26
+ }
27
+ /** Optional canonical form of the codec's values. See {@link CodecDescriptorTemplate.toCanonicalForm}. */
28
+ toCanonicalForm;
29
+ };
30
+ /**
31
+ * Abstract base for a concrete codec descriptor: a {@link CodecDescriptorTemplateImpl} that also
32
+ * names the data type its codec represents.
33
+ *
34
+ * A codec whose data type depends on the target that adopts it extends
35
+ * {@link CodecDescriptorTemplateImpl} instead, and the target names the type when it adapts the
36
+ * template.
37
+ */
38
+ var CodecDescriptorImpl = class extends CodecDescriptorTemplateImpl {};
39
+ //#endregion
40
+ export { enumRefusalOf as i, CodecDescriptorTemplateImpl as n, canonicalFormOf as r, CodecDescriptorImpl as t };
41
+
42
+ //# sourceMappingURL=codec-descriptor-DUZmWwry-BVbguh8h.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-descriptor-DUZmWwry-BVbguh8h.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec-descriptor-DUZmWwry.mjs"],"sourcesContent":["//#region src/shared/codec-descriptor.ts\n/**\n* The canonical form of the values of a column whose codec is `codec` (ADR 254): the codec's own when it declares one, else its data type's. Whatever reads, compares or writes a stored value of a column takes its canonical form from here.\n*/\nfunction canonicalFormOf(codec, dataTypes) {\n\treturn codec.toCanonicalForm ?? dataTypes.get(codec.dataType)?.toCanonicalForm;\n}\n/**\n* Why an enum cannot use the codec `descriptor` describes, or `undefined` when one can: the codec's own {@link CodecDescriptorTemplate.enumRefusal}, else the missing `equality` trait. Every enum authoring surface refuses a codec through this.\n*/\nfunction enumRefusalOf(descriptor) {\n\tif (descriptor.enumRefusal !== void 0) return descriptor.enumRefusal;\n\tif (descriptor.traits.includes(\"equality\")) return void 0;\n\treturn \"The codec does not declare the equality trait, so no value can be compared with a member. Use a codec that declares it.\";\n}\n/**\n* Abstract base class for concrete codec descriptors.\n*\n* Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `paramsSchema`, the curried `factory(params)`, and (optionally) `renderOutputType`.\n*\n* Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.\n*/\nvar CodecDescriptorTemplateImpl = class {\n\tget isParameterized() {\n\t\treturn this.paramsSchema !== void 0;\n\t}\n\t/** Optional canonical form of the codec's values. See {@link CodecDescriptorTemplate.toCanonicalForm}. */\n\ttoCanonicalForm;\n};\n/**\n* Abstract base for a concrete codec descriptor: a {@link CodecDescriptorTemplateImpl} that also\n* names the data type its codec represents.\n*\n* A codec whose data type depends on the target that adopts it extends\n* {@link CodecDescriptorTemplateImpl} instead, and the target names the type when it adapts the\n* template.\n*/\nvar CodecDescriptorImpl = class extends CodecDescriptorTemplateImpl {};\n//#endregion\nexport { enumRefusalOf as i, CodecDescriptorTemplateImpl as n, canonicalFormOf as r, CodecDescriptorImpl as t };\n\n//# sourceMappingURL=codec-descriptor-DUZmWwry.mjs.map"],"mappings":";;;;AAIA,SAAS,gBAAgB,OAAO,WAAW;CAC1C,OAAO,MAAM,mBAAmB,UAAU,IAAI,MAAM,QAAQ,CAAC,EAAE;AAChE;;;;AAIA,SAAS,cAAc,YAAY;CAClC,IAAI,WAAW,gBAAgB,KAAK,GAAG,OAAO,WAAW;CACzD,IAAI,WAAW,OAAO,SAAS,UAAU,GAAG,OAAO,KAAK;CACxD,OAAO;AACR;;;;;;;;AAQA,IAAI,8BAA8B,MAAM;CACvC,IAAI,kBAAkB;EACrB,OAAO,KAAK,iBAAiB,KAAK;CACnC;;CAEA;AACD;;;;;;;;;AASA,IAAI,sBAAsB,cAAc,4BAA4B,CAAC"}