@formspec/build 0.1.0-alpha.11 → 0.1.0-alpha.13

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 (135) hide show
  1. package/README.md +51 -15
  2. package/dist/__tests__/chain-dsl-canonicalizer.test.d.ts +2 -0
  3. package/dist/__tests__/chain-dsl-canonicalizer.test.d.ts.map +1 -0
  4. package/dist/__tests__/constraint-validator.test.d.ts +2 -0
  5. package/dist/__tests__/constraint-validator.test.d.ts.map +1 -0
  6. package/dist/__tests__/extension-api.test.d.ts +2 -0
  7. package/dist/__tests__/extension-api.test.d.ts.map +1 -0
  8. package/dist/__tests__/fixtures/example-a-builtins.d.ts +18 -0
  9. package/dist/__tests__/fixtures/example-a-builtins.d.ts.map +1 -1
  10. package/dist/__tests__/guards.test.d.ts +2 -0
  11. package/dist/__tests__/guards.test.d.ts.map +1 -0
  12. package/dist/__tests__/ir-analyzer.test.d.ts +11 -0
  13. package/dist/__tests__/ir-analyzer.test.d.ts.map +1 -0
  14. package/dist/__tests__/ir-jsdoc-constraints.test.d.ts +12 -0
  15. package/dist/__tests__/ir-jsdoc-constraints.test.d.ts.map +1 -0
  16. package/dist/__tests__/ir-json-schema-generator.test.d.ts +11 -0
  17. package/dist/__tests__/ir-json-schema-generator.test.d.ts.map +1 -0
  18. package/dist/__tests__/ir-ui-schema-generator.test.d.ts +2 -0
  19. package/dist/__tests__/ir-ui-schema-generator.test.d.ts.map +1 -0
  20. package/dist/__tests__/jsdoc-constraints.test.d.ts +4 -4
  21. package/dist/__tests__/parity/fixtures/address/chain-dsl.d.ts +9 -0
  22. package/dist/__tests__/parity/fixtures/address/chain-dsl.d.ts.map +1 -0
  23. package/dist/__tests__/parity/fixtures/address/expected-ir.d.ts +9 -0
  24. package/dist/__tests__/parity/fixtures/address/expected-ir.d.ts.map +1 -0
  25. package/dist/__tests__/parity/fixtures/address/tsdoc.d.ts +19 -0
  26. package/dist/__tests__/parity/fixtures/address/tsdoc.d.ts.map +1 -0
  27. package/dist/__tests__/parity/fixtures/product-config/chain-dsl.d.ts +13 -0
  28. package/dist/__tests__/parity/fixtures/product-config/chain-dsl.d.ts.map +1 -0
  29. package/dist/__tests__/parity/fixtures/product-config/expected-ir.d.ts +9 -0
  30. package/dist/__tests__/parity/fixtures/product-config/expected-ir.d.ts.map +1 -0
  31. package/dist/__tests__/parity/fixtures/product-config/tsdoc.d.ts +28 -0
  32. package/dist/__tests__/parity/fixtures/product-config/tsdoc.d.ts.map +1 -0
  33. package/dist/__tests__/parity/fixtures/user-registration/chain-dsl.d.ts +12 -0
  34. package/dist/__tests__/parity/fixtures/user-registration/chain-dsl.d.ts.map +1 -0
  35. package/dist/__tests__/parity/fixtures/user-registration/expected-ir.d.ts +9 -0
  36. package/dist/__tests__/parity/fixtures/user-registration/expected-ir.d.ts.map +1 -0
  37. package/dist/__tests__/parity/fixtures/user-registration/tsdoc.d.ts +19 -0
  38. package/dist/__tests__/parity/fixtures/user-registration/tsdoc.d.ts.map +1 -0
  39. package/dist/__tests__/parity/parity.test.d.ts +14 -0
  40. package/dist/__tests__/parity/parity.test.d.ts.map +1 -0
  41. package/dist/__tests__/parity/utils.d.ts +139 -0
  42. package/dist/__tests__/parity/utils.d.ts.map +1 -0
  43. package/dist/analyzer/class-analyzer.d.ts +54 -99
  44. package/dist/analyzer/class-analyzer.d.ts.map +1 -1
  45. package/dist/analyzer/jsdoc-constraints.d.ts +78 -30
  46. package/dist/analyzer/jsdoc-constraints.d.ts.map +1 -1
  47. package/dist/analyzer/tsdoc-parser.d.ts +61 -0
  48. package/dist/analyzer/tsdoc-parser.d.ts.map +1 -0
  49. package/dist/browser.cjs +998 -309
  50. package/dist/browser.cjs.map +1 -1
  51. package/dist/browser.d.ts +10 -6
  52. package/dist/browser.d.ts.map +1 -1
  53. package/dist/browser.js +996 -308
  54. package/dist/browser.js.map +1 -1
  55. package/dist/build.d.ts +65 -150
  56. package/dist/canonicalize/chain-dsl-canonicalizer.d.ts +18 -0
  57. package/dist/canonicalize/chain-dsl-canonicalizer.d.ts.map +1 -0
  58. package/dist/canonicalize/index.d.ts +8 -0
  59. package/dist/canonicalize/index.d.ts.map +1 -0
  60. package/dist/canonicalize/tsdoc-canonicalizer.d.ts +34 -0
  61. package/dist/canonicalize/tsdoc-canonicalizer.d.ts.map +1 -0
  62. package/dist/cli.cjs +1455 -1656
  63. package/dist/cli.cjs.map +1 -1
  64. package/dist/cli.js +1459 -1647
  65. package/dist/cli.js.map +1 -1
  66. package/dist/extensions/index.d.ts +8 -0
  67. package/dist/extensions/index.d.ts.map +1 -0
  68. package/dist/extensions/registry.d.ts +55 -0
  69. package/dist/extensions/registry.d.ts.map +1 -0
  70. package/dist/generators/class-schema.d.ts +23 -38
  71. package/dist/generators/class-schema.d.ts.map +1 -1
  72. package/dist/generators/method-schema.d.ts +6 -8
  73. package/dist/generators/method-schema.d.ts.map +1 -1
  74. package/dist/index.cjs +1391 -1614
  75. package/dist/index.cjs.map +1 -1
  76. package/dist/index.d.ts +6 -8
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +1403 -1610
  79. package/dist/index.js.map +1 -1
  80. package/dist/internals.cjs +1642 -824
  81. package/dist/internals.cjs.map +1 -1
  82. package/dist/internals.d.ts +12 -3
  83. package/dist/internals.d.ts.map +1 -1
  84. package/dist/internals.js +1645 -820
  85. package/dist/internals.js.map +1 -1
  86. package/dist/json-schema/generator.d.ts +10 -5
  87. package/dist/json-schema/generator.d.ts.map +1 -1
  88. package/dist/json-schema/ir-generator.d.ts +84 -0
  89. package/dist/json-schema/ir-generator.d.ts.map +1 -0
  90. package/dist/json-schema/schema.d.ts +3 -3
  91. package/dist/json-schema/types.d.ts +5 -6
  92. package/dist/json-schema/types.d.ts.map +1 -1
  93. package/dist/ui-schema/generator.d.ts +5 -15
  94. package/dist/ui-schema/generator.d.ts.map +1 -1
  95. package/dist/ui-schema/ir-generator.d.ts +53 -0
  96. package/dist/ui-schema/ir-generator.d.ts.map +1 -0
  97. package/dist/validate/constraint-validator.d.ts +66 -0
  98. package/dist/validate/constraint-validator.d.ts.map +1 -0
  99. package/dist/validate/index.d.ts +9 -0
  100. package/dist/validate/index.d.ts.map +1 -0
  101. package/package.json +5 -4
  102. package/dist/__tests__/analyzer-edge-cases.test.d.ts +0 -13
  103. package/dist/__tests__/analyzer-edge-cases.test.d.ts.map +0 -1
  104. package/dist/__tests__/analyzer.test.d.ts +0 -5
  105. package/dist/__tests__/analyzer.test.d.ts.map +0 -1
  106. package/dist/__tests__/codegen.test.d.ts +0 -5
  107. package/dist/__tests__/codegen.test.d.ts.map +0 -1
  108. package/dist/__tests__/decorator-pipeline.test.d.ts +0 -11
  109. package/dist/__tests__/decorator-pipeline.test.d.ts.map +0 -1
  110. package/dist/__tests__/fixtures/example-b-decorators.d.ts +0 -5
  111. package/dist/__tests__/fixtures/example-b-decorators.d.ts.map +0 -1
  112. package/dist/__tests__/fixtures/example-b-extended.d.ts +0 -5
  113. package/dist/__tests__/fixtures/example-b-extended.d.ts.map +0 -1
  114. package/dist/__tests__/fixtures/example-c-custom.d.ts +0 -5
  115. package/dist/__tests__/fixtures/example-c-custom.d.ts.map +0 -1
  116. package/dist/__tests__/fixtures/example-c-decorators.d.ts +0 -5
  117. package/dist/__tests__/fixtures/example-c-decorators.d.ts.map +0 -1
  118. package/dist/__tests__/fixtures/example-d-mixed-decorators.d.ts +0 -6
  119. package/dist/__tests__/fixtures/example-d-mixed-decorators.d.ts.map +0 -1
  120. package/dist/__tests__/fixtures/example-e-decorators.d.ts +0 -11
  121. package/dist/__tests__/fixtures/example-e-decorators.d.ts.map +0 -1
  122. package/dist/__tests__/fixtures/example-e-no-namespace.d.ts +0 -5
  123. package/dist/__tests__/fixtures/example-e-no-namespace.d.ts.map +0 -1
  124. package/dist/__tests__/fixtures/example-jsdoc-constraints.d.ts +0 -16
  125. package/dist/__tests__/fixtures/example-jsdoc-constraints.d.ts.map +0 -1
  126. package/dist/__tests__/fixtures/example-nested-class.d.ts +0 -45
  127. package/dist/__tests__/fixtures/example-nested-class.d.ts.map +0 -1
  128. package/dist/__tests__/interface-types.test.d.ts +0 -11
  129. package/dist/__tests__/interface-types.test.d.ts.map +0 -1
  130. package/dist/analyzer/decorator-extractor.d.ts +0 -78
  131. package/dist/analyzer/decorator-extractor.d.ts.map +0 -1
  132. package/dist/analyzer/type-converter.d.ts +0 -75
  133. package/dist/analyzer/type-converter.d.ts.map +0 -1
  134. package/dist/codegen/index.d.ts +0 -75
  135. package/dist/codegen/index.d.ts.map +0 -1
@@ -1,78 +0,0 @@
1
- /**
2
- * Decorator extractor for parsing decorator AST nodes.
3
- *
4
- * Extracts decorator names and arguments from class field decorators,
5
- * supporting the FormSpec decorator DSL (@Field, @Minimum, @Maximum, etc.).
6
- *
7
- * Also supports branded type resolution via the TypeScript type checker
8
- * to detect custom decorators created with `extendDecorator` and
9
- * `customDecorator` from `@formspec/decorators`.
10
- */
11
- import * as ts from "typescript";
12
- import { type FormSpecDecoratorName } from "@formspec/core";
13
- /**
14
- * Extracted decorator information.
15
- */
16
- export interface DecoratorInfo {
17
- /** Decorator name (e.g., "Field", "Minimum") */
18
- name: string;
19
- /** Decorator arguments as literal values */
20
- args: DecoratorArg[];
21
- /** Raw AST node for the decorator (undefined for synthetic JSDoc constraint entries) */
22
- node: ts.Decorator | undefined;
23
- /** Resolved brand information from the type checker (populated by analyzeField) */
24
- resolved?: ResolvedDecorator;
25
- }
26
- /**
27
- * A decorator argument value.
28
- * Can be a primitive, array, or object literal.
29
- */
30
- export type DecoratorArg = string | number | boolean | null | DecoratorArg[] | {
31
- [key: string]: DecoratorArg;
32
- };
33
- /**
34
- * Result of resolving a decorator via the type checker.
35
- */
36
- export interface ResolvedDecorator {
37
- /** Decorator name as it appears in source */
38
- name: string;
39
- /** If this extends a built-in, the built-in name (e.g., "Field") */
40
- extendsBuiltin?: string;
41
- /** If this belongs to a CLI extension namespace, the namespace name */
42
- extensionName?: string;
43
- /** Whether this is a known FormSpec decorator (built-in or factory-created) */
44
- isFormSpec: boolean;
45
- /** Whether this is a marker (zero-arg) decorator */
46
- isMarker: boolean;
47
- }
48
- /**
49
- * Extracts decorators from a class member (property or method).
50
- *
51
- * @param member - The class member to extract decorators from
52
- * @returns Array of extracted decorator info
53
- */
54
- export declare function extractDecorators(member: ts.PropertyDeclaration | ts.MethodDeclaration): DecoratorInfo[];
55
- /**
56
- * Known FormSpec decorators and their expected argument types.
57
- *
58
- * This metadata object provides additional information about each decorator's
59
- * expected argument types. The keys are constrained to match FormSpecDecoratorName.
60
- */
61
- export declare const FORMSPEC_DECORATORS: Record<FormSpecDecoratorName, {
62
- argTypes: readonly string[];
63
- }>;
64
- /**
65
- * Resolves a decorator via the TypeScript type checker to determine
66
- * if it is a FormSpec decorator (built-in, extended, or custom).
67
- *
68
- * This enables detection of:
69
- * 1. Direct imports of built-in decorators from `@formspec/decorators`
70
- * 2. Extended decorators created via `extendDecorator(...).as(...)`
71
- * 3. Custom decorators created via `customDecorator(...).as(...)` or `.marker(...)`
72
- *
73
- * @param decorator - The decorator AST node
74
- * @param checker - TypeScript type checker
75
- * @returns Resolved decorator information, or null if not resolvable
76
- */
77
- export declare function resolveDecorator(decorator: ts.Decorator, checker: ts.TypeChecker): ResolvedDecorator | null;
78
- //# sourceMappingURL=decorator-extractor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decorator-extractor.d.ts","sourceRoot":"","sources":["../../src/analyzer/decorator-extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,wFAAwF;IACxF,IAAI,EAAE,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,mFAAmF;IACnF,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,YAAY,EAAE,GACd;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CAAE,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,UAAU,EAAE,OAAO,CAAC;IACpB,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,EAAE,CAAC,mBAAmB,GAAG,EAAE,CAAC,iBAAiB,GACpD,aAAa,EAAE,CAgBjB;AA0KD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,EAAE;IAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAuBrF,CAAC;AAgBX;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,EAAE,CAAC,SAAS,EACvB,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,iBAAiB,GAAG,IAAI,CAyH1B"}
@@ -1,75 +0,0 @@
1
- /**
2
- * Type converter for transforming TypeScript types to JSON Schema and FormSpec.
3
- *
4
- * Converts TypeScript types (extracted via type checker) to:
5
- * - JSON Schema definitions
6
- * - FormSpec field definitions
7
- */
8
- import * as ts from "typescript";
9
- import type { DecoratorInfo } from "./decorator-extractor.js";
10
- import { type FieldInfo } from "./class-analyzer.js";
11
- import { type ExtendedJSONSchema7 } from "../json-schema/types.js";
12
- /**
13
- * FormSpec field definition (simplified for output).
14
- */
15
- export interface FormSpecField {
16
- _field: string;
17
- id: string;
18
- label?: string;
19
- placeholder?: string;
20
- description?: string;
21
- required?: boolean;
22
- min?: number;
23
- max?: number;
24
- step?: number;
25
- minLength?: number;
26
- maxLength?: number;
27
- minItems?: number;
28
- maxItems?: number;
29
- pattern?: string;
30
- options?: (string | {
31
- id: string;
32
- label: string;
33
- })[];
34
- showWhen?: object;
35
- group?: string;
36
- fields?: FormSpecField[];
37
- }
38
- /**
39
- * Result of converting a TypeScript type.
40
- */
41
- export interface TypeConversionResult {
42
- /** JSON Schema representation */
43
- jsonSchema: ExtendedJSONSchema7;
44
- /** FormSpec field type */
45
- formSpecFieldType: string;
46
- }
47
- /**
48
- * Converts a TypeScript type to JSON Schema and FormSpec field type.
49
- *
50
- * @param type - The TypeScript type to convert
51
- * @param checker - TypeScript type checker
52
- * @returns Conversion result with JSON Schema and FormSpec type
53
- */
54
- export declare function convertType(type: ts.Type, checker: ts.TypeChecker): TypeConversionResult;
55
- /**
56
- * Creates a FormSpec field definition from a field's type and decorators.
57
- *
58
- * @param fieldName - The field name
59
- * @param type - The TypeScript type
60
- * @param decorators - Decorators applied to the field
61
- * @param optional - Whether the field is optional
62
- * @param checker - TypeScript type checker
63
- * @returns FormSpec field definition
64
- */
65
- export declare function createFormSpecField(fieldName: string, type: ts.Type, decorators: DecoratorInfo[], optional: boolean, checker: ts.TypeChecker, visitedTypes?: Set<ts.Type>): FormSpecField;
66
- /**
67
- * Applies decorator constraints to a JSON Schema.
68
- *
69
- * @param schema - The base JSON Schema
70
- * @param decorators - Decorators to apply
71
- * @param fieldInfo - Optional field info for deprecated/default values
72
- * @returns Modified JSON Schema with constraints
73
- */
74
- export declare function applyDecoratorsToSchema(schema: ExtendedJSONSchema7, decorators: DecoratorInfo[], fieldInfo?: FieldInfo): ExtendedJSONSchema7;
75
- //# sourceMappingURL=type-converter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-converter.d.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AAgB,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,oBAAoB,CAExF;AAqND;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,UAAU,EAAE,aAAa,EAAE,EAC3B,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,YAAY,eAAqB,GAChC,aAAa,CAiDf;AAuFD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,UAAU,EAAE,aAAa,EAAE,EAC3B,SAAS,CAAC,EAAE,SAAS,GACpB,mBAAmB,CA6FrB"}
@@ -1,75 +0,0 @@
1
- /**
2
- * Code generation for FormSpec type metadata.
3
- *
4
- * Generates a TypeScript file that patches decorated classes with
5
- * their extracted type metadata, enabling runtime schema generation
6
- * as an alternative to a TypeScript transformer.
7
- *
8
- * Usage:
9
- * formspec codegen ./src/forms.ts -o ./src/__formspec_types__.ts
10
- *
11
- * Then in your code:
12
- * import './__formspec_types__'; // Patches all decorated classes
13
- * import { UserFormSchema, getUserFormFormSpec } from './__formspec_types__';
14
- * const spec = getUserFormFormSpec();
15
- */
16
- /**
17
- * Type metadata format used by `@formspec/decorators`.
18
- *
19
- * Represents the runtime type information for a field that TypeScript
20
- * normally erases at compile time.
21
- */
22
- export interface TypeMetadata {
23
- /** Base type: "string", "number", "boolean", "enum", "array", "object", "unknown" */
24
- type: string;
25
- /** For enum types, the possible literal values */
26
- values?: unknown[];
27
- /** For array types, metadata about the array element type */
28
- itemType?: TypeMetadata;
29
- /** For object types, metadata about each property */
30
- properties?: Record<string, TypeMetadata>;
31
- /** Whether the field accepts null */
32
- nullable?: boolean;
33
- /** Whether the field is optional (T | undefined or ?: modifier) */
34
- optional?: boolean;
35
- }
36
- /**
37
- * Information about a decorated class found during codegen analysis.
38
- *
39
- * Used to track which classes need type metadata patches and where
40
- * they are located in the source tree.
41
- */
42
- export interface DecoratedClassInfo {
43
- /** Class name as it appears in the source file */
44
- name: string;
45
- /** Import path to the source file (relative to output, without extension) */
46
- sourcePath: string;
47
- /** Type metadata for all decorated properties in the class */
48
- typeMetadata: Record<string, TypeMetadata>;
49
- /** Whether the class is exported from its source file */
50
- isExported: boolean;
51
- }
52
- /**
53
- * Options for code generation.
54
- */
55
- export interface CodegenOptions {
56
- /** Source files to analyze (glob patterns supported) */
57
- files: string[];
58
- /** Output file path */
59
- output: string;
60
- /** Base directory for relative imports */
61
- baseDir?: string;
62
- }
63
- /**
64
- * Finds all decorated classes in the given source files.
65
- */
66
- export declare function findDecoratedClasses(files: string[], baseDir: string): DecoratedClassInfo[];
67
- /**
68
- * Generates the codegen output file content.
69
- */
70
- export declare function generateCodegenOutput(classes: DecoratedClassInfo[], outputPath: string, baseDir: string): string;
71
- /**
72
- * Runs the code generation.
73
- */
74
- export declare function runCodegen(options: CodegenOptions): void;
75
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1C,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,IAAI,E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