@graph-ir/core 0.2.0
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.
- package/LICENSE +21 -0
- package/README.md +26 -0
- package/dist/generation/id-generator.d.ts +81 -0
- package/dist/generation/id-generator.d.ts.map +1 -0
- package/dist/generation/id-generator.js +193 -0
- package/dist/generation/id-generator.js.map +1 -0
- package/dist/generation/index.d.ts +7 -0
- package/dist/generation/index.d.ts.map +1 -0
- package/dist/generation/index.js +7 -0
- package/dist/generation/index.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/output/ci.d.ts +36 -0
- package/dist/output/ci.d.ts.map +1 -0
- package/dist/output/ci.js +145 -0
- package/dist/output/ci.js.map +1 -0
- package/dist/output/index.d.ts +20 -0
- package/dist/output/index.d.ts.map +1 -0
- package/dist/output/index.js +40 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/json.d.ts +24 -0
- package/dist/output/json.d.ts.map +1 -0
- package/dist/output/json.js +49 -0
- package/dist/output/json.js.map +1 -0
- package/dist/output/pretty.d.ts +44 -0
- package/dist/output/pretty.d.ts.map +1 -0
- package/dist/output/pretty.js +227 -0
- package/dist/output/pretty.js.map +1 -0
- package/dist/output/types.d.ts +63 -0
- package/dist/output/types.d.ts.map +1 -0
- package/dist/output/types.js +5 -0
- package/dist/output/types.js.map +1 -0
- package/dist/schemas/graph-ir.schema.json +360 -0
- package/dist/skills/diff.d.ts +73 -0
- package/dist/skills/diff.d.ts.map +1 -0
- package/dist/skills/diff.js +315 -0
- package/dist/skills/diff.js.map +1 -0
- package/dist/skills/migrate.d.ts +40 -0
- package/dist/skills/migrate.d.ts.map +1 -0
- package/dist/skills/migrate.js +288 -0
- package/dist/skills/migrate.js.map +1 -0
- package/dist/skills/visualize.d.ts +30 -0
- package/dist/skills/visualize.d.ts.map +1 -0
- package/dist/skills/visualize.js +254 -0
- package/dist/skills/visualize.js.map +1 -0
- package/dist/symbols/index.d.ts +12 -0
- package/dist/symbols/index.d.ts.map +1 -0
- package/dist/symbols/index.js +12 -0
- package/dist/symbols/index.js.map +1 -0
- package/dist/symbols/notation-registry.d.ts +61 -0
- package/dist/symbols/notation-registry.d.ts.map +1 -0
- package/dist/symbols/notation-registry.js +114 -0
- package/dist/symbols/notation-registry.js.map +1 -0
- package/dist/symbols/symbol-registry.d.ts +58 -0
- package/dist/symbols/symbol-registry.d.ts.map +1 -0
- package/dist/symbols/symbol-registry.js +88 -0
- package/dist/symbols/symbol-registry.js.map +1 -0
- package/dist/symbols/types.d.ts +166 -0
- package/dist/symbols/types.d.ts.map +1 -0
- package/dist/symbols/types.js +13 -0
- package/dist/symbols/types.js.map +1 -0
- package/dist/testing/diff.d.ts +46 -0
- package/dist/testing/diff.d.ts.map +1 -0
- package/dist/testing/diff.js +400 -0
- package/dist/testing/diff.js.map +1 -0
- package/dist/testing/index.d.ts +10 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +10 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/snapshot.d.ts +95 -0
- package/dist/testing/snapshot.d.ts.map +1 -0
- package/dist/testing/snapshot.js +172 -0
- package/dist/testing/snapshot.js.map +1 -0
- package/dist/types.d.ts +240 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/validation/index.d.ts +9 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +8 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/ir-validator.d.ts +51 -0
- package/dist/validation/ir-validator.d.ts.map +1 -0
- package/dist/validation/ir-validator.js +349 -0
- package/dist/validation/ir-validator.js.map +1 -0
- package/dist/validation/validator.d.ts +13 -0
- package/dist/validation/validator.d.ts.map +1 -0
- package/dist/validation/validator.js +19 -0
- package/dist/validation/validator.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SymbolRegistry - Registry for symbol definitions
|
|
3
|
+
*
|
|
4
|
+
* Provides methods to register, query, and search symbols.
|
|
5
|
+
* Symbols are loaded from Coral (diagrams) and Armada (code).
|
|
6
|
+
*/
|
|
7
|
+
export class SymbolRegistry {
|
|
8
|
+
symbols = new Map();
|
|
9
|
+
/**
|
|
10
|
+
* Register a symbol definition.
|
|
11
|
+
* Overwrites any existing symbol with the same ID.
|
|
12
|
+
*/
|
|
13
|
+
register(symbol) {
|
|
14
|
+
this.symbols.set(symbol.id, symbol);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Register multiple symbols at once.
|
|
18
|
+
*/
|
|
19
|
+
registerAll(symbols) {
|
|
20
|
+
for (const symbol of symbols) {
|
|
21
|
+
this.register(symbol);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get a symbol by ID.
|
|
26
|
+
*/
|
|
27
|
+
get(id) {
|
|
28
|
+
return this.symbols.get(id);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if a symbol exists.
|
|
32
|
+
*/
|
|
33
|
+
has(id) {
|
|
34
|
+
return this.symbols.has(id);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get all registered symbols.
|
|
38
|
+
*/
|
|
39
|
+
all() {
|
|
40
|
+
return Array.from(this.symbols.values());
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get the count of registered symbols.
|
|
44
|
+
*/
|
|
45
|
+
count() {
|
|
46
|
+
return this.symbols.size;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Find symbols that belong to a specific notation.
|
|
50
|
+
*/
|
|
51
|
+
byNotation(notationId) {
|
|
52
|
+
return this.all().filter((symbol) => symbol.notations.includes(notationId));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Find symbols with a specific tag.
|
|
56
|
+
*/
|
|
57
|
+
byTag(tag) {
|
|
58
|
+
return this.all().filter((symbol) => symbol.tags?.includes(tag));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Search symbols by name or description.
|
|
62
|
+
* Case-insensitive partial match.
|
|
63
|
+
*/
|
|
64
|
+
search(query) {
|
|
65
|
+
const lowerQuery = query.toLowerCase();
|
|
66
|
+
return this.all().filter((symbol) => {
|
|
67
|
+
const nameMatch = symbol.name.toLowerCase().includes(lowerQuery);
|
|
68
|
+
const descMatch = symbol.description?.toLowerCase().includes(lowerQuery);
|
|
69
|
+
return nameMatch || descMatch;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Merge another registry into this one.
|
|
74
|
+
* Symbols from the other registry overwrite existing symbols with the same ID.
|
|
75
|
+
*/
|
|
76
|
+
merge(other) {
|
|
77
|
+
for (const symbol of other.all()) {
|
|
78
|
+
this.register(symbol);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Clear all symbols from the registry.
|
|
83
|
+
*/
|
|
84
|
+
clear() {
|
|
85
|
+
this.symbols.clear();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=symbol-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-registry.js","sourceRoot":"","sources":["../../src/symbols/symbol-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,OAAO,cAAc;IACjB,OAAO,GAAkC,IAAI,GAAG,EAAE,CAAC;IAE3D;;;OAGG;IACH,QAAQ,CAAC,MAAwB;QAC/B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,OAA2B;QACrC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,MAAM,C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,IAAI,SAAS,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAqB;QACzB,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol/Notation Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* These types define the infrastructure for the three-layer architecture:
|
|
5
|
+
* - Shape Layer: Pure geometry (owned by Coral)
|
|
6
|
+
* - Symbol Layer: Shapes with meaning (owned by Coral/Armada)
|
|
7
|
+
* - Notation Layer: Grammar rules (owned by Coral/Armada)
|
|
8
|
+
*
|
|
9
|
+
* This package provides the types and registries. Actual symbol/notation
|
|
10
|
+
* content is provided by Coral (diagrams) and Armada (code).
|
|
11
|
+
*/
|
|
12
|
+
import type { PortSide } from '../types.js';
|
|
13
|
+
/**
|
|
14
|
+
* A shape is a pure geometric primitive with no semantic meaning.
|
|
15
|
+
* Shapes are defined and rendered by Coral.
|
|
16
|
+
*/
|
|
17
|
+
export interface ShapeDefinition {
|
|
18
|
+
/** Unique identifier (e.g., 'rectangle', 'diamond', 'cylinder') */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Human-readable name */
|
|
21
|
+
name: string;
|
|
22
|
+
/** Shape geometry type */
|
|
23
|
+
type: 'rect' | 'ellipse' | 'polygon' | 'path' | 'compound';
|
|
24
|
+
/** SVG path data (for polygon/path types) */
|
|
25
|
+
path?: string;
|
|
26
|
+
/** Default dimensions */
|
|
27
|
+
defaultSize?: {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
/** Parametric properties that can be adjusted */
|
|
32
|
+
parameters?: {
|
|
33
|
+
[key: string]: ShapeParameter;
|
|
34
|
+
};
|
|
35
|
+
/** Where ports can attach by default */
|
|
36
|
+
portAnchors?: PortAnchor[];
|
|
37
|
+
}
|
|
38
|
+
export interface ShapeParameter {
|
|
39
|
+
type: 'number' | 'boolean';
|
|
40
|
+
default: number | boolean;
|
|
41
|
+
min?: number;
|
|
42
|
+
max?: number;
|
|
43
|
+
description?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface PortAnchor {
|
|
46
|
+
side: PortSide;
|
|
47
|
+
/** Position along the side (0.0 to 1.0) */
|
|
48
|
+
position: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A symbol is a shape with assigned semantic meaning.
|
|
52
|
+
* Symbols can belong to multiple notations.
|
|
53
|
+
*/
|
|
54
|
+
export interface SymbolDefinition {
|
|
55
|
+
/** Unique identifier (e.g., 'flowchart-decision', 'erd-entity') */
|
|
56
|
+
id: string;
|
|
57
|
+
/** Human-readable name */
|
|
58
|
+
name: string;
|
|
59
|
+
/** Description of what this symbol represents */
|
|
60
|
+
description?: string;
|
|
61
|
+
/** Reference to shape definition ID */
|
|
62
|
+
shape: string;
|
|
63
|
+
/** Notations this symbol belongs to */
|
|
64
|
+
notations: string[];
|
|
65
|
+
/** Searchable tags for discovery */
|
|
66
|
+
tags?: string[];
|
|
67
|
+
/** Available variants (e.g., start/end for terminals) */
|
|
68
|
+
variants?: {
|
|
69
|
+
[variantId: string]: SymbolVariant;
|
|
70
|
+
};
|
|
71
|
+
/** Default port configuration */
|
|
72
|
+
ports?: SymbolPort[];
|
|
73
|
+
/** Default styling */
|
|
74
|
+
defaults?: SymbolDefaults;
|
|
75
|
+
/** Source of this definition (for provenance) */
|
|
76
|
+
source?: 'builtin' | 'coral' | 'armada' | 'custom';
|
|
77
|
+
}
|
|
78
|
+
export interface SymbolVariant {
|
|
79
|
+
name: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
/** Override shape for this variant */
|
|
82
|
+
shape?: string;
|
|
83
|
+
/** Override defaults for this variant */
|
|
84
|
+
defaults?: SymbolDefaults;
|
|
85
|
+
}
|
|
86
|
+
export interface SymbolPort {
|
|
87
|
+
id: string;
|
|
88
|
+
side: PortSide;
|
|
89
|
+
direction?: 'in' | 'out' | 'both';
|
|
90
|
+
label?: string;
|
|
91
|
+
/** Position along the side (0.0 to 1.0) */
|
|
92
|
+
position?: number;
|
|
93
|
+
}
|
|
94
|
+
export interface SymbolDefaults {
|
|
95
|
+
fill?: string;
|
|
96
|
+
stroke?: string;
|
|
97
|
+
strokeWidth?: number;
|
|
98
|
+
fontSize?: number;
|
|
99
|
+
[key: string]: unknown;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A notation is a grammar defining valid symbols and connections.
|
|
103
|
+
*/
|
|
104
|
+
export interface NotationDefinition {
|
|
105
|
+
/** Unique identifier (e.g., 'flowchart', 'erd', 'call-graph') */
|
|
106
|
+
id: string;
|
|
107
|
+
/** Human-readable name */
|
|
108
|
+
name: string;
|
|
109
|
+
/** Description of this notation */
|
|
110
|
+
description?: string;
|
|
111
|
+
/** List of valid symbol IDs for this notation */
|
|
112
|
+
symbols: string[];
|
|
113
|
+
/** Default edge styling */
|
|
114
|
+
defaultEdgeStyle?: NotationEdgeStyle;
|
|
115
|
+
/** Connection rules between symbols */
|
|
116
|
+
connectionRules?: ConnectionRule[];
|
|
117
|
+
/** Diagram-level validation rules */
|
|
118
|
+
validation?: NotationValidation;
|
|
119
|
+
/** Source of this definition */
|
|
120
|
+
source?: 'builtin' | 'coral' | 'armada' | 'custom';
|
|
121
|
+
}
|
|
122
|
+
export interface NotationEdgeStyle {
|
|
123
|
+
lineStyle?: 'solid' | 'dashed' | 'dotted';
|
|
124
|
+
targetArrow?: 'arrow' | 'diamond' | 'circle' | 'none';
|
|
125
|
+
sourceArrow?: 'arrow' | 'diamond' | 'circle' | 'none';
|
|
126
|
+
}
|
|
127
|
+
export interface ConnectionRule {
|
|
128
|
+
/** Source symbol ID (or '*' for any) */
|
|
129
|
+
from: string;
|
|
130
|
+
/** Allowed target symbol IDs */
|
|
131
|
+
to: string[];
|
|
132
|
+
/** Constraints on this connection type */
|
|
133
|
+
constraints?: ConnectionConstraints;
|
|
134
|
+
}
|
|
135
|
+
export interface ConnectionConstraints {
|
|
136
|
+
maxOutgoing?: number;
|
|
137
|
+
maxIncoming?: number;
|
|
138
|
+
requiresLabel?: boolean;
|
|
139
|
+
allowedLabels?: string[];
|
|
140
|
+
}
|
|
141
|
+
export interface NotationValidation {
|
|
142
|
+
/** Require at least one node with this symbol */
|
|
143
|
+
requiredSymbols?: string[];
|
|
144
|
+
/** Nodes with these symbols must have no incoming edges */
|
|
145
|
+
entryPoints?: string[];
|
|
146
|
+
/** Nodes with these symbols must have no outgoing edges */
|
|
147
|
+
exitPoints?: string[];
|
|
148
|
+
/** All nodes must be reachable from entry points */
|
|
149
|
+
mustBeConnected?: boolean;
|
|
150
|
+
/** No cycles allowed */
|
|
151
|
+
mustBeAcyclic?: boolean;
|
|
152
|
+
}
|
|
153
|
+
export interface NotationValidationResult {
|
|
154
|
+
valid: boolean;
|
|
155
|
+
errors: NotationError[];
|
|
156
|
+
warnings: NotationError[];
|
|
157
|
+
}
|
|
158
|
+
export interface NotationError {
|
|
159
|
+
code: NotationErrorCode;
|
|
160
|
+
message: string;
|
|
161
|
+
path: string;
|
|
162
|
+
nodeId?: string;
|
|
163
|
+
edgeId?: string;
|
|
164
|
+
}
|
|
165
|
+
export type NotationErrorCode = 'UNKNOWN_NOTATION' | 'UNKNOWN_SYMBOL' | 'INVALID_VARIANT' | 'INVALID_CONNECTION' | 'MISSING_REQUIRED_SYMBOL' | 'MISSING_ENTRY_POINT' | 'MISSING_EXIT_POINT' | 'DISCONNECTED_NODE' | 'CYCLE_DETECTED';
|
|
166
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../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M,WAAW,wBAAwB;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,iBAAiB,GACzB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,oBAAoB,GACpB,yBAAyB,GACzB,qBAAqB,GACrB,oBAAoB,GACpB,mBAAmB,GACnB,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol/Notation Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* These types define the infrastructure for the three-layer architecture:
|
|
5
|
+
* - Shape Layer: Pure geometry (owned by Coral)
|
|
6
|
+
* - Symbol Layer: Shapes with meaning (owned by Coral/Armada)
|
|
7
|
+
* - Notation Layer: Grammar rules (owned by Coral/Armada)
|
|
8
|
+
*
|
|
9
|
+
* This package provides the types and registries. Actual symbol/notation
|
|
10
|
+
* content is provided by Coral (diagrams) and Armada (code).
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/symbols/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diff Utilities for Graph-IR
|
|
3
|
+
*
|
|
4
|
+
* Provides semantic diffing for Graph-IR structures that ignores
|
|
5
|
+
* ordering differences where appropriate.
|
|
6
|
+
*/
|
|
7
|
+
import type { GraphIR } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Single change in a diff
|
|
10
|
+
*/
|
|
11
|
+
export interface Change {
|
|
12
|
+
/** Type of change */
|
|
13
|
+
type: 'added' | 'removed' | 'modified';
|
|
14
|
+
/** Path to the changed property */
|
|
15
|
+
path: string;
|
|
16
|
+
/** Previous value (for removed/modified) */
|
|
17
|
+
oldValue?: unknown;
|
|
18
|
+
/** New value (for added/modified) */
|
|
19
|
+
newValue?: unknown;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Result of a diff operation
|
|
23
|
+
*/
|
|
24
|
+
export interface DiffResult {
|
|
25
|
+
/** List of changes detected */
|
|
26
|
+
changes: Change[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Compute diff between two objects
|
|
30
|
+
*/
|
|
31
|
+
export declare function diff(a: unknown, b: unknown, path?: string): DiffResult;
|
|
32
|
+
/**
|
|
33
|
+
* Compute semantic diff between two Graph-IR structures
|
|
34
|
+
*
|
|
35
|
+
* This diff ignores:
|
|
36
|
+
* - Node ordering (compares by ID)
|
|
37
|
+
* - Edge ordering (compares by ID)
|
|
38
|
+
*/
|
|
39
|
+
export declare function diffGraphIR(a: GraphIR, b: GraphIR): DiffResult;
|
|
40
|
+
/**
|
|
41
|
+
* Format a diff result for human-readable output
|
|
42
|
+
*/
|
|
43
|
+
export declare function formatDiff(result: DiffResult, options?: {
|
|
44
|
+
colors?: boolean;
|
|
45
|
+
}): string;
|
|
46
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/testing/diff.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAwB,MAAM,aAAa,CAAC;AAMjE;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,qBAAqB;IACrB,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;IAEvC,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IAEb,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAMD;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,GAAE,MAAW,GAAG,UAAU,CAM1E;AA+ED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,UAAU,CA0G9D;AAqLD;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,CAgCzF"}
|