create-cogenta 0.0.3 → 0.1.1
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 +373 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +17 -0
- package/dist/bin.js.map +1 -0
- package/dist/blueprints/association.d.ts +73 -0
- package/dist/blueprints/association.d.ts.map +1 -0
- package/dist/blueprints/association.js +176 -0
- package/dist/blueprints/association.js.map +1 -0
- package/dist/blueprints/blog.d.ts +211 -0
- package/dist/blueprints/blog.d.ts.map +1 -0
- package/dist/blueprints/blog.js +303 -0
- package/dist/blueprints/blog.js.map +1 -0
- package/dist/blueprints/content-pack.d.ts +54 -0
- package/dist/blueprints/content-pack.d.ts.map +1 -0
- package/dist/blueprints/content-pack.js +40 -0
- package/dist/blueprints/content-pack.js.map +1 -0
- package/dist/blueprints/content-packs.d.ts +10 -0
- package/dist/blueprints/content-packs.d.ts.map +1 -0
- package/dist/blueprints/content-packs.js +26 -0
- package/dist/blueprints/content-packs.js.map +1 -0
- package/dist/blueprints/documentation.d.ts +71 -0
- package/dist/blueprints/documentation.d.ts.map +1 -0
- package/dist/blueprints/documentation.js +153 -0
- package/dist/blueprints/documentation.js.map +1 -0
- package/dist/blueprints/magazine.d.ts +79 -0
- package/dist/blueprints/magazine.d.ts.map +1 -0
- package/dist/blueprints/magazine.js +163 -0
- package/dist/blueprints/magazine.js.map +1 -0
- package/dist/blueprints/portfolio.d.ts +73 -0
- package/dist/blueprints/portfolio.d.ts.map +1 -0
- package/dist/blueprints/portfolio.js +171 -0
- package/dist/blueprints/portfolio.js.map +1 -0
- package/dist/blueprints/registry.d.ts +23 -0
- package/dist/blueprints/registry.d.ts.map +1 -0
- package/dist/blueprints/registry.js +42 -0
- package/dist/blueprints/registry.js.map +1 -0
- package/dist/blueprints/restaurant.d.ts +79 -0
- package/dist/blueprints/restaurant.d.ts.map +1 -0
- package/dist/blueprints/restaurant.js +175 -0
- package/dist/blueprints/restaurant.js.map +1 -0
- package/dist/blueprints/saas.d.ts +66 -0
- package/dist/blueprints/saas.d.ts.map +1 -0
- package/dist/blueprints/saas.js +165 -0
- package/dist/blueprints/saas.js.map +1 -0
- package/dist/blueprints/vitrine.d.ts +100 -0
- package/dist/blueprints/vitrine.d.ts.map +1 -0
- package/dist/blueprints/vitrine.js +214 -0
- package/dist/blueprints/vitrine.js.map +1 -0
- package/dist/config-file.d.ts +13 -0
- package/dist/config-file.d.ts.map +1 -0
- package/dist/config-file.js +93 -0
- package/dist/config-file.js.map +1 -0
- package/dist/environment.d.ts +27 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +91 -0
- package/dist/environment.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/dist/llm-setup.d.ts +39 -0
- package/dist/llm-setup.d.ts.map +1 -0
- package/dist/llm-setup.js +47 -0
- package/dist/llm-setup.js.map +1 -0
- package/dist/playground-reset.d.ts +27 -0
- package/dist/playground-reset.d.ts.map +1 -0
- package/dist/playground-reset.js +40 -0
- package/dist/playground-reset.js.map +1 -0
- package/dist/prompts.d.ts +30 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +63 -0
- package/dist/prompts.js.map +1 -0
- package/dist/recap.d.ts +19 -0
- package/dist/recap.d.ts.map +1 -0
- package/dist/recap.js +74 -0
- package/dist/recap.js.map +1 -0
- package/dist/scaffold.d.ts +49 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +170 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/skin-flow.d.ts +35 -0
- package/dist/skin-flow.d.ts.map +1 -0
- package/dist/skin-flow.js +56 -0
- package/dist/skin-flow.js.map +1 -0
- package/dist/skin-preview.d.ts +8 -0
- package/dist/skin-preview.d.ts.map +1 -0
- package/dist/skin-preview.js +130 -0
- package/dist/skin-preview.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/dist/wizard.d.ts +17 -0
- package/dist/wizard.d.ts.map +1 -0
- package/dist/wizard.js +157 -0
- package/dist/wizard.js.map +1 -0
- package/package.json +44 -5
- package/README.md +0 -39
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { createContentStore, defineCollection, f, validateCollectionSet, } from '@cogenta/schema';
|
|
2
|
+
import { definePageCollection, toBlockZoneEntry, } from './content-pack.js';
|
|
3
|
+
/**
|
|
4
|
+
* The `portfolio` blueprint's content model (L9 task 8, batch A): a
|
|
5
|
+
* freelance/creative portfolio — a `project` collection with its own
|
|
6
|
+
* routed page, and two demo pages.
|
|
7
|
+
*/
|
|
8
|
+
export const project = defineCollection({
|
|
9
|
+
name: 'project',
|
|
10
|
+
labels: { singular: 'Project', plural: 'Projects' },
|
|
11
|
+
routing: { pattern: '/work/:slug' },
|
|
12
|
+
fields: {
|
|
13
|
+
title: f.text({ required: true, max: 200 }),
|
|
14
|
+
slug: f.slug({ from: 'title', unique: true }),
|
|
15
|
+
summary: f.text({ max: 300, multiline: true }),
|
|
16
|
+
role: f.text({ max: 120 }),
|
|
17
|
+
year: f.text({ max: 4 }),
|
|
18
|
+
},
|
|
19
|
+
indexes: [['slug']],
|
|
20
|
+
permissions: {
|
|
21
|
+
read: ['public'],
|
|
22
|
+
create: ['editor', 'admin'],
|
|
23
|
+
update: ['editor', 'admin'],
|
|
24
|
+
delete: ['admin'],
|
|
25
|
+
publish: ['admin'],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export const page = definePageCollection('/:slug');
|
|
29
|
+
export const PORTFOLIO_COLLECTIONS = [project, page];
|
|
30
|
+
validateCollectionSet(PORTFOLIO_COLLECTIONS);
|
|
31
|
+
export const PORTFOLIO_DEMO_PROJECTS = [
|
|
32
|
+
{
|
|
33
|
+
title: 'Northwind rebrand',
|
|
34
|
+
slug: 'northwind-rebrand',
|
|
35
|
+
summary: 'A full visual identity refresh for a regional grocery chain, from logotype to packaging.',
|
|
36
|
+
role: 'Art direction',
|
|
37
|
+
year: '2025',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: 'Contoso mobile app',
|
|
41
|
+
slug: 'contoso-mobile-app',
|
|
42
|
+
summary: 'Interaction design and a component library for a fintech app used by two million people.',
|
|
43
|
+
role: 'Product design',
|
|
44
|
+
year: '2024',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
title: 'Fabrikam annual report',
|
|
48
|
+
slug: 'fabrikam-annual-report',
|
|
49
|
+
summary: 'Editorial design for a 60-page annual report, printed and interactive.',
|
|
50
|
+
role: 'Editorial design',
|
|
51
|
+
year: '2023',
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
const BLOCK_VERSION = '1.0.0';
|
|
55
|
+
/**
|
|
56
|
+
* `home` (hero + a live grid of projects) and `about` (a short prose bio
|
|
57
|
+
* plus a static `stats` summary — years of experience and projects
|
|
58
|
+
* delivered are page-authored numbers, not something to model as a
|
|
59
|
+
* separate queryable collection).
|
|
60
|
+
*/
|
|
61
|
+
export const PORTFOLIO_DEMO_PAGES = [
|
|
62
|
+
{
|
|
63
|
+
title: 'Home',
|
|
64
|
+
slug: 'home',
|
|
65
|
+
blocks: [
|
|
66
|
+
{
|
|
67
|
+
_key: 'demo-home-hero',
|
|
68
|
+
_type: 'hero',
|
|
69
|
+
_version: BLOCK_VERSION,
|
|
70
|
+
eyebrow: 'Portfolio',
|
|
71
|
+
title: 'Selected work',
|
|
72
|
+
subtitle: 'Scaffolded by create-cogenta from the "portfolio" blueprint, with real demo projects already in place.',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
_key: 'demo-home-projects',
|
|
76
|
+
_type: 'collectionList',
|
|
77
|
+
_version: BLOCK_VERSION,
|
|
78
|
+
title: 'Projects',
|
|
79
|
+
collection: 'project',
|
|
80
|
+
sort: { field: 'createdAt', direction: 'desc' },
|
|
81
|
+
limit: 10,
|
|
82
|
+
layout: 'grid',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: 'About',
|
|
88
|
+
slug: 'about',
|
|
89
|
+
blocks: [
|
|
90
|
+
{
|
|
91
|
+
_key: 'demo-about-prose',
|
|
92
|
+
_type: 'prose',
|
|
93
|
+
_version: BLOCK_VERSION,
|
|
94
|
+
body: [
|
|
95
|
+
{
|
|
96
|
+
_key: 'demo-about-p1',
|
|
97
|
+
_type: 'block',
|
|
98
|
+
style: 'normal',
|
|
99
|
+
children: [
|
|
100
|
+
{
|
|
101
|
+
_key: 'demo-about-p1-span',
|
|
102
|
+
_type: 'span',
|
|
103
|
+
text: 'This is a demo portfolio, scaffolded by create-cogenta from the "portfolio" blueprint. Its projects and this page were seeded by the installer so there is real content to look at from the first run.',
|
|
104
|
+
marks: [],
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
markDefs: [],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
_key: 'demo-about-stats',
|
|
113
|
+
_type: 'stats',
|
|
114
|
+
_version: BLOCK_VERSION,
|
|
115
|
+
title: 'At a glance',
|
|
116
|
+
items: [
|
|
117
|
+
{ _key: 'demo-stat-1', value: '8', unit: 'years', label: 'in practice' },
|
|
118
|
+
{ _key: 'demo-stat-2', value: '40+', label: 'projects delivered' },
|
|
119
|
+
{ _key: 'demo-stat-3', value: '12', label: 'ongoing clients' },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
];
|
|
125
|
+
export const PORTFOLIO_RECOMMENDED_AGENTS = [
|
|
126
|
+
{
|
|
127
|
+
name: 'performanceAgent',
|
|
128
|
+
package: '@cogenta/agents-builtin',
|
|
129
|
+
reason: 'Catches oversized project cover images before they slow the work grid down.',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'seoAgent',
|
|
133
|
+
package: '@cogenta/agents-builtin',
|
|
134
|
+
reason: 'Audits project pages so each one is findable on its own, not only from the grid.',
|
|
135
|
+
},
|
|
136
|
+
];
|
|
137
|
+
/**
|
|
138
|
+
* Inserts the `portfolio` blueprint's demo content through the real
|
|
139
|
+
* `ContentStore` — never mocked (house rule).
|
|
140
|
+
*/
|
|
141
|
+
async function seedPortfolioDemoContent(db, defaultLocale, adminId) {
|
|
142
|
+
const projectStore = createContentStore({ db, collection: project, defaultLocale });
|
|
143
|
+
const pageStore = createContentStore({ db, collection: page, defaultLocale });
|
|
144
|
+
for (const demo of PORTFOLIO_DEMO_PROJECTS) {
|
|
145
|
+
await projectStore.create({
|
|
146
|
+
status: 'published',
|
|
147
|
+
createdBy: adminId,
|
|
148
|
+
values: {
|
|
149
|
+
title: demo.title,
|
|
150
|
+
slug: demo.slug,
|
|
151
|
+
summary: demo.summary,
|
|
152
|
+
role: demo.role,
|
|
153
|
+
year: demo.year,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
for (const demo of PORTFOLIO_DEMO_PAGES) {
|
|
158
|
+
await pageStore.create({
|
|
159
|
+
status: 'published',
|
|
160
|
+
createdBy: adminId,
|
|
161
|
+
values: { title: demo.title, slug: demo.slug },
|
|
162
|
+
blocks: { blocks: demo.blocks.map(toBlockZoneEntry) },
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
export const portfolioContentPack = {
|
|
167
|
+
collections: PORTFOLIO_COLLECTIONS,
|
|
168
|
+
recommendedAgents: PORTFOLIO_RECOMMENDED_AGENTS,
|
|
169
|
+
seedDemoContent: seedPortfolioDemoContent,
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=portfolio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portfolio.js","sourceRoot":"","sources":["../../src/blueprints/portfolio.ts"],"names":[],"mappings":"AAEA,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AE,CAAC,CAAA;IACnF,MAAM,SAAS,GAAG,kBAAkB,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAA;IAE7E,KAAK,MAAM,IAAI,IAAI,uBAAuB,EAAE,CAAC;QAC3C,MAAM,YAAY,CAAC,MAAM,CAAC;YACxB,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE;gBACN,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,oBAAoB,EAAE,CAAC;QACxC,MAAM,SAAS,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;YAC9C,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;SACtD,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAyB;IACxD,WAAW,EAAE,qBAAqB;IAClC,iBAAiB,EAAE,4BAA4B;IAC/C,eAAe,EAAE,wBAAwB;CAC1C,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface Blueprint {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly label: string;
|
|
4
|
+
/** `false` for every entry this session did not build (L9 task 8) — visible in the menu, not hidden, but selecting one falls back to `blank` with a note. */
|
|
5
|
+
readonly available: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* "Type de site → sélection d'un blueprint." Every blueprint the lot
|
|
9
|
+
* commits to (`docs/lots/L9-ecosysteme.md`, "## Blueprints") is real as of
|
|
10
|
+
* L9 task 8, batch B: `blank` (empty schema, no demo content), `blog` (L9
|
|
11
|
+
* task 3), `vitrine`/`portfolio`/`documentation` (batch A) and
|
|
12
|
+
* `magazine`/`association`/`restaurant`/`saas` (batch B). Each beyond
|
|
13
|
+
* `blank` has a real `BlueprintContentPack` (`./content-packs.js`).
|
|
14
|
+
*/
|
|
15
|
+
export declare const BLUEPRINTS: readonly Blueprint[];
|
|
16
|
+
export declare const DEFAULT_BLUEPRINT_ID = "blank";
|
|
17
|
+
export interface ResolvedBlueprint {
|
|
18
|
+
readonly blueprint: Blueprint;
|
|
19
|
+
/** `true` when the requested id was unknown or not yet available, and `blank` was substituted — the caller must say so, never substitute silently. */
|
|
20
|
+
readonly fellBackToBlank: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function resolveBlueprint(id: string): ResolvedBlueprint;
|
|
23
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/blueprints/registry.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,6JAA6J;IAC7J,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC5B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,SAAS,EAc1C,CAAA;AAED,eAAO,MAAM,oBAAoB,UAAU,CAAA;AAE3C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,sJAAsJ;IACtJ,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;CAClC;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,CAe9D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CogentaError } from '@cogenta/core';
|
|
2
|
+
/**
|
|
3
|
+
* "Type de site → sélection d'un blueprint." Every blueprint the lot
|
|
4
|
+
* commits to (`docs/lots/L9-ecosysteme.md`, "## Blueprints") is real as of
|
|
5
|
+
* L9 task 8, batch B: `blank` (empty schema, no demo content), `blog` (L9
|
|
6
|
+
* task 3), `vitrine`/`portfolio`/`documentation` (batch A) and
|
|
7
|
+
* `magazine`/`association`/`restaurant`/`saas` (batch B). Each beyond
|
|
8
|
+
* `blank` has a real `BlueprintContentPack` (`./content-packs.js`).
|
|
9
|
+
*/
|
|
10
|
+
export const BLUEPRINTS = [
|
|
11
|
+
{ id: 'blank', label: 'Blank — empty schema, nothing pre-configured', available: true },
|
|
12
|
+
{ id: 'vitrine', label: 'Showcase site — services, testimonials, demo content', available: true },
|
|
13
|
+
{ id: 'blog', label: 'Blog — posts, categories, demo content', available: true },
|
|
14
|
+
{ id: 'magazine', label: 'Magazine — articles by section, demo content', available: true },
|
|
15
|
+
{ id: 'portfolio', label: 'Portfolio — projects, demo content', available: true },
|
|
16
|
+
{
|
|
17
|
+
id: 'documentation',
|
|
18
|
+
label: 'Documentation site — ordered doc pages, demo content',
|
|
19
|
+
available: true,
|
|
20
|
+
},
|
|
21
|
+
{ id: 'association', label: 'Nonprofit / association — events, demo content', available: true },
|
|
22
|
+
{ id: 'restaurant', label: 'Restaurant — menu, demo content', available: true },
|
|
23
|
+
{ id: 'saas', label: 'SaaS — features, demo content', available: true },
|
|
24
|
+
];
|
|
25
|
+
export const DEFAULT_BLUEPRINT_ID = 'blank';
|
|
26
|
+
export function resolveBlueprint(id) {
|
|
27
|
+
const requested = BLUEPRINTS.find((entry) => entry.id === id);
|
|
28
|
+
if (requested?.available) {
|
|
29
|
+
return { blueprint: requested, fellBackToBlank: false };
|
|
30
|
+
}
|
|
31
|
+
const blank = BLUEPRINTS.find((entry) => entry.id === DEFAULT_BLUEPRINT_ID);
|
|
32
|
+
if (blank === undefined) {
|
|
33
|
+
throw new CogentaError({
|
|
34
|
+
code: 'BLUEPRINT_REGISTRY_CORRUPT',
|
|
35
|
+
message: 'The "blank" blueprint is missing from the registry.',
|
|
36
|
+
hint: 'BLUEPRINTS must always include an entry whose id is DEFAULT_BLUEPRINT_ID — this is a bug in the registry, not a user-facing condition.',
|
|
37
|
+
details: { defaultBlueprintId: DEFAULT_BLUEPRINT_ID },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return { blueprint: blank, fellBackToBlank: true };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/blueprints/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAS5C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,8CAA8C,EAAE,SAAS,EAAE,IAAI,EAAE;IACvF,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,sDAAsD,EAAE,SAAS,EAAE,IAAI,EAAE;IACjG,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,wCAAwC,EAAE,SAAS,EAAE,IAAI,EAAE;IAChF,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,8CAA8C,EAAE,SAAS,EAAE,IAAI,EAAE;IAC1F,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,oCAAoC,EAAE,SAAS,EAAE,IAAI,EAAE;IACjF;QACE,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,sDAAsD;QAC7D,SAAS,EAAE,IAAI;KAChB;IACD,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,gDAAgD,EAAE,SAAS,EAAE,IAAI,EAAE;IAC/F,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,iCAAiC,EAAE,SAAS,EAAE,IAAI,EAAE;IAC/E,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,+BAA+B,EAAE,SAAS,EAAE,IAAI,EAAE;CACxE,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAQ3C,MAAM,UAAU,gBAAgB,CAAC,EAAU;IACzC,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IAC7D,IAAI,SAAS,EAAE,SAAS,EAAE,CAAC;QACzB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,CAAA;IACzD,CAAC;IACD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,oBAAoB,CAAC,CAAA;IAC3E,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,YAAY,CAAC;YACrB,IAAI,EAAE,4BAA4B;YAClC,OAAO,EAAE,qDAAqD;YAC9D,IAAI,EAAE,wIAAwI;YAC9I,OAAO,EAAE,EAAE,kBAAkB,EAAE,oBAAoB,EAAE;SACtD,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,CAAA;AACpD,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { VocabularyBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type CollectionDefinition } from '@cogenta/schema';
|
|
3
|
+
import { type BlueprintContentPack, type RecommendedAgentHint } from './content-pack.js';
|
|
4
|
+
/**
|
|
5
|
+
* The `restaurant` blueprint's content model (L9 task 8, batch B): a
|
|
6
|
+
* `menuItem` collection, grouped by `category` rather than a separate
|
|
7
|
+
* category collection (the same restraint `magazine`'s `section` field
|
|
8
|
+
* uses — one grouping mechanism, not two). Routed even though nothing
|
|
9
|
+
* deep-links to an individual item today, so the home page's live menu
|
|
10
|
+
* list (`collectionList`) can build a real link for each entry, exactly
|
|
11
|
+
* like every other blueprint's routed, listed collection.
|
|
12
|
+
*/
|
|
13
|
+
export declare const menuItem: {
|
|
14
|
+
readonly name: "menu_item";
|
|
15
|
+
readonly labels: {
|
|
16
|
+
readonly singular: "Menu item";
|
|
17
|
+
readonly plural: "Menu items";
|
|
18
|
+
};
|
|
19
|
+
readonly routing: {
|
|
20
|
+
readonly pattern: "/menu/:slug";
|
|
21
|
+
};
|
|
22
|
+
readonly fields: {
|
|
23
|
+
name: import("@cogenta/schema").FieldDefinition & {
|
|
24
|
+
readonly kind: "text";
|
|
25
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
26
|
+
};
|
|
27
|
+
slug: import("@cogenta/schema").FieldDefinition & {
|
|
28
|
+
readonly kind: "slug";
|
|
29
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
30
|
+
};
|
|
31
|
+
description: import("@cogenta/schema").FieldDefinition & {
|
|
32
|
+
readonly kind: "text";
|
|
33
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
34
|
+
};
|
|
35
|
+
price: import("@cogenta/schema").FieldDefinition & {
|
|
36
|
+
readonly kind: "number";
|
|
37
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
38
|
+
};
|
|
39
|
+
category: import("@cogenta/schema").FieldDefinition & {
|
|
40
|
+
readonly kind: "select";
|
|
41
|
+
readonly options: {
|
|
42
|
+
options: readonly import("@cogenta/schema").SelectChoice[];
|
|
43
|
+
many: boolean;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
readonly indexes: readonly [readonly ["slug"], readonly ["category"]];
|
|
48
|
+
readonly permissions: {
|
|
49
|
+
readonly read: readonly ["public"];
|
|
50
|
+
readonly create: readonly ["editor", "admin"];
|
|
51
|
+
readonly update: readonly ["editor", "admin"];
|
|
52
|
+
readonly delete: readonly ["admin"];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export declare const page: CollectionDefinition;
|
|
56
|
+
export declare const RESTAURANT_COLLECTIONS: readonly CollectionDefinition[];
|
|
57
|
+
export interface RestaurantDemoMenuItem {
|
|
58
|
+
readonly name: string;
|
|
59
|
+
readonly slug: string;
|
|
60
|
+
readonly description: string;
|
|
61
|
+
readonly price: number;
|
|
62
|
+
readonly category: 'Starters' | 'Mains' | 'Desserts';
|
|
63
|
+
}
|
|
64
|
+
export declare const RESTAURANT_DEMO_MENU_ITEMS: readonly RestaurantDemoMenuItem[];
|
|
65
|
+
export interface RestaurantDemoPage {
|
|
66
|
+
readonly title: string;
|
|
67
|
+
readonly slug: string;
|
|
68
|
+
readonly blocks: readonly VocabularyBlock[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* `home` (hero + a live list of menu highlights + a cta to reserve) and
|
|
72
|
+
* `contact` (prose with hours and location — plain text fields, contract A
|
|
73
|
+
* has no dedicated "opening hours" field kind and none is warranted for
|
|
74
|
+
* two lines of text).
|
|
75
|
+
*/
|
|
76
|
+
export declare const RESTAURANT_DEMO_PAGES: readonly RestaurantDemoPage[];
|
|
77
|
+
export declare const RESTAURANT_RECOMMENDED_AGENTS: readonly RecommendedAgentHint[];
|
|
78
|
+
export declare const restaurantContentPack: BlueprintContentPack;
|
|
79
|
+
//# sourceMappingURL=restaurant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restaurant.d.ts","sourceRoot":"","sources":["../../src/blueprints/restaurant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,OAAO,EACL,KAAK,oBAAoB,EAK1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;;GAQG;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;QAKjB,IAAI;;;;QACJ,IAAI;;;;QACJ,WAAW;;;;QACX,KAAK;;;;QACL,QAAQ;;;;;;;;;;;;;;;CASV,CAAA;AAEF,eAAO,MAAM,IAAI,sBAAiC,CAAA;AAElD,eAAO,MAAM,sBAAsB,EAAE,SAAS,oBAAoB,EAAqB,CAAA;AAIvF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAA;CACrD;AAED,eAAO,MAAM,0BAA0B,EAAE,SAAS,sBAAsB,EAoCvE,CAAA;AAqBD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAC5C;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAyC9D,CAAA;AAED,eAAO,MAAM,6BAA6B,EAAE,SAAS,oBAAoB,EAWxE,CAAA;AAsCD,eAAO,MAAM,qBAAqB,EAAE,oBAInC,CAAA"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { createContentStore, defineCollection, f, validateCollectionSet, } from '@cogenta/schema';
|
|
2
|
+
import { definePageCollection, toBlockZoneEntry, } from './content-pack.js';
|
|
3
|
+
/**
|
|
4
|
+
* The `restaurant` blueprint's content model (L9 task 8, batch B): a
|
|
5
|
+
* `menuItem` collection, grouped by `category` rather than a separate
|
|
6
|
+
* category collection (the same restraint `magazine`'s `section` field
|
|
7
|
+
* uses — one grouping mechanism, not two). Routed even though nothing
|
|
8
|
+
* deep-links to an individual item today, so the home page's live menu
|
|
9
|
+
* list (`collectionList`) can build a real link for each entry, exactly
|
|
10
|
+
* like every other blueprint's routed, listed collection.
|
|
11
|
+
*/
|
|
12
|
+
export const menuItem = defineCollection({
|
|
13
|
+
name: 'menu_item',
|
|
14
|
+
labels: { singular: 'Menu item', plural: 'Menu items' },
|
|
15
|
+
routing: { pattern: '/menu/:slug' },
|
|
16
|
+
fields: {
|
|
17
|
+
name: f.text({ required: true, max: 120 }),
|
|
18
|
+
slug: f.slug({ from: 'name', unique: true }),
|
|
19
|
+
description: f.text({ max: 300, multiline: true }),
|
|
20
|
+
price: f.number({ required: true, min: 0 }),
|
|
21
|
+
category: f.select({ options: ['Starters', 'Mains', 'Desserts'], required: true }),
|
|
22
|
+
},
|
|
23
|
+
indexes: [['slug'], ['category']],
|
|
24
|
+
permissions: {
|
|
25
|
+
read: ['public'],
|
|
26
|
+
create: ['editor', 'admin'],
|
|
27
|
+
update: ['editor', 'admin'],
|
|
28
|
+
delete: ['admin'],
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
export const page = definePageCollection('/:slug');
|
|
32
|
+
export const RESTAURANT_COLLECTIONS = [menuItem, page];
|
|
33
|
+
validateCollectionSet(RESTAURANT_COLLECTIONS);
|
|
34
|
+
export const RESTAURANT_DEMO_MENU_ITEMS = [
|
|
35
|
+
{
|
|
36
|
+
name: 'Roasted beet salad',
|
|
37
|
+
slug: 'roasted-beet-salad',
|
|
38
|
+
description: 'Beets, goat cheese, walnuts, a light citrus dressing.',
|
|
39
|
+
price: 9.5,
|
|
40
|
+
category: 'Starters',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Soup of the day',
|
|
44
|
+
slug: 'soup-of-the-day',
|
|
45
|
+
description: 'Changes with the season, always made from scratch.',
|
|
46
|
+
price: 7,
|
|
47
|
+
category: 'Starters',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Pan-seared trout',
|
|
51
|
+
slug: 'pan-seared-trout',
|
|
52
|
+
description: 'Local trout, brown butter, seasonal vegetables.',
|
|
53
|
+
price: 22,
|
|
54
|
+
category: 'Mains',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Wild mushroom risotto',
|
|
58
|
+
slug: 'wild-mushroom-risotto',
|
|
59
|
+
description: 'Arborio rice, a mix of wild mushrooms, parmesan.',
|
|
60
|
+
price: 18,
|
|
61
|
+
category: 'Mains',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'Chocolate tart',
|
|
65
|
+
slug: 'chocolate-tart',
|
|
66
|
+
description: 'Dark chocolate, sea salt, a short pastry crust.',
|
|
67
|
+
price: 8,
|
|
68
|
+
category: 'Desserts',
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
const BLOCK_VERSION = '1.0.0';
|
|
72
|
+
function proseParagraph(key, text) {
|
|
73
|
+
return {
|
|
74
|
+
_key: key,
|
|
75
|
+
_type: 'prose',
|
|
76
|
+
_version: BLOCK_VERSION,
|
|
77
|
+
body: [
|
|
78
|
+
{
|
|
79
|
+
_key: `${key}-block`,
|
|
80
|
+
_type: 'block',
|
|
81
|
+
style: 'normal',
|
|
82
|
+
children: [{ _key: `${key}-span`, _type: 'span', text, marks: [] }],
|
|
83
|
+
markDefs: [],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* `home` (hero + a live list of menu highlights + a cta to reserve) and
|
|
90
|
+
* `contact` (prose with hours and location — plain text fields, contract A
|
|
91
|
+
* has no dedicated "opening hours" field kind and none is warranted for
|
|
92
|
+
* two lines of text).
|
|
93
|
+
*/
|
|
94
|
+
export const RESTAURANT_DEMO_PAGES = [
|
|
95
|
+
{
|
|
96
|
+
title: 'Home',
|
|
97
|
+
slug: 'home',
|
|
98
|
+
blocks: [
|
|
99
|
+
{
|
|
100
|
+
_key: 'demo-home-hero',
|
|
101
|
+
_type: 'hero',
|
|
102
|
+
_version: BLOCK_VERSION,
|
|
103
|
+
eyebrow: 'Restaurant',
|
|
104
|
+
title: 'Seasonal, simple, close to home',
|
|
105
|
+
subtitle: 'Scaffolded by create-cogenta from the "restaurant" blueprint, with a real demo menu already in place.',
|
|
106
|
+
actions: [{ label: 'Reserve a table', target: { href: '/contact' }, emphasis: 'primary' }],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
_key: 'demo-home-menu',
|
|
110
|
+
_type: 'collectionList',
|
|
111
|
+
_version: BLOCK_VERSION,
|
|
112
|
+
title: 'From the menu',
|
|
113
|
+
collection: 'menu_item',
|
|
114
|
+
sort: { field: 'createdAt', direction: 'asc' },
|
|
115
|
+
limit: 10,
|
|
116
|
+
layout: 'grid',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
title: 'Contact',
|
|
122
|
+
slug: 'contact',
|
|
123
|
+
blocks: [
|
|
124
|
+
proseParagraph('demo-contact-prose', 'This is a demo restaurant site, scaffolded by create-cogenta from the "restaurant" blueprint. Its menu and this page were seeded by the installer so there is real content to look at from the first run.'),
|
|
125
|
+
proseParagraph('demo-contact-hours', 'Open Tuesday to Sunday, 18:00 to 23:00. 12 Market Street. Reservations recommended on weekends.'),
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
export const RESTAURANT_RECOMMENDED_AGENTS = [
|
|
130
|
+
{
|
|
131
|
+
name: 'seoAgent',
|
|
132
|
+
package: '@cogenta/agents-builtin',
|
|
133
|
+
reason: 'Audits the menu and contact pages so the restaurant is findable by name and cuisine.',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'performanceAgent',
|
|
137
|
+
package: '@cogenta/agents-builtin',
|
|
138
|
+
reason: 'Catches oversized food photography before it slows the menu page down.',
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
/**
|
|
142
|
+
* Inserts the `restaurant` blueprint's demo content through the real
|
|
143
|
+
* `ContentStore` — never mocked (house rule).
|
|
144
|
+
*/
|
|
145
|
+
async function seedRestaurantDemoContent(db, defaultLocale, adminId) {
|
|
146
|
+
const menuItemStore = createContentStore({ db, collection: menuItem, defaultLocale });
|
|
147
|
+
const pageStore = createContentStore({ db, collection: page, defaultLocale });
|
|
148
|
+
for (const demo of RESTAURANT_DEMO_MENU_ITEMS) {
|
|
149
|
+
await menuItemStore.create({
|
|
150
|
+
status: 'published',
|
|
151
|
+
createdBy: adminId,
|
|
152
|
+
values: {
|
|
153
|
+
name: demo.name,
|
|
154
|
+
slug: demo.slug,
|
|
155
|
+
description: demo.description,
|
|
156
|
+
price: demo.price,
|
|
157
|
+
category: demo.category,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
for (const demo of RESTAURANT_DEMO_PAGES) {
|
|
162
|
+
await pageStore.create({
|
|
163
|
+
status: 'published',
|
|
164
|
+
createdBy: adminId,
|
|
165
|
+
values: { title: demo.title, slug: demo.slug },
|
|
166
|
+
blocks: { blocks: demo.blocks.map(toBlockZoneEntry) },
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
export const restaurantContentPack = {
|
|
171
|
+
collections: RESTAURANT_COLLECTIONS,
|
|
172
|
+
recommendedAgents: RESTAURANT_RECOMMENDED_AGENTS,
|
|
173
|
+
seedDemoContent: seedRestaurantDemoContent,
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=restaurant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restaurant.js","sourceRoot":"","sources":["../../src/blueprints/restaurant.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,kBAAkB,EAClB,gBAAgB,EAChB,CAAC,EACD,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAEL,oBAAoB,EAE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+
import { type BlueprintContentPack, type RecommendedAgentHint } from './content-pack.js';
|
|
4
|
+
/**
|
|
5
|
+
* The `saas` blueprint's content model (L9 task 8, batch B): a marketing
|
|
6
|
+
* site for a software product — a `feature` collection routed so it can be
|
|
7
|
+
* listed live on the home page, exactly like `vitrine`'s `service`.
|
|
8
|
+
* Deliberately no `pricingPlan` collection or billing model: pricing tiers
|
|
9
|
+
* on a real SaaS site are usually a handful of numbers with no independent
|
|
10
|
+
* lifecycle (no author, no publish date, no individual page), so they are
|
|
11
|
+
* page-authored content on the `pricing` page below rather than a second
|
|
12
|
+
* collection invented to hold three rows.
|
|
13
|
+
*/
|
|
14
|
+
export declare const feature: {
|
|
15
|
+
readonly name: "feature";
|
|
16
|
+
readonly labels: {
|
|
17
|
+
readonly singular: "Feature";
|
|
18
|
+
readonly plural: "Features";
|
|
19
|
+
};
|
|
20
|
+
readonly routing: {
|
|
21
|
+
readonly pattern: "/features/:slug";
|
|
22
|
+
};
|
|
23
|
+
readonly fields: {
|
|
24
|
+
name: import("@cogenta/schema").FieldDefinition & {
|
|
25
|
+
readonly kind: "text";
|
|
26
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
27
|
+
};
|
|
28
|
+
slug: import("@cogenta/schema").FieldDefinition & {
|
|
29
|
+
readonly kind: "slug";
|
|
30
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
31
|
+
};
|
|
32
|
+
description: import("@cogenta/schema").FieldDefinition & {
|
|
33
|
+
readonly kind: "text";
|
|
34
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
readonly indexes: readonly [readonly ["slug"]];
|
|
38
|
+
readonly permissions: {
|
|
39
|
+
readonly read: readonly ["public"];
|
|
40
|
+
readonly create: readonly ["editor", "admin"];
|
|
41
|
+
readonly update: readonly ["editor", "admin"];
|
|
42
|
+
readonly delete: readonly ["admin"];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare const page: CollectionDefinition;
|
|
46
|
+
export declare const SAAS_COLLECTIONS: readonly CollectionDefinition[];
|
|
47
|
+
export interface SaasDemoFeature {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly slug: string;
|
|
50
|
+
readonly description: string;
|
|
51
|
+
}
|
|
52
|
+
export declare const SAAS_DEMO_FEATURES: readonly SaasDemoFeature[];
|
|
53
|
+
export interface SaasDemoPage {
|
|
54
|
+
readonly title: string;
|
|
55
|
+
readonly slug: string;
|
|
56
|
+
readonly blocks: readonly VocabularyBlock[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `home` (hero + a live list of features + a cta to sign up) and `pricing`
|
|
60
|
+
* (a short prose intro plus a static `stats` row — the page-authored
|
|
61
|
+
* numbers a pricing page usually leads with, not a full billing model).
|
|
62
|
+
*/
|
|
63
|
+
export declare const SAAS_DEMO_PAGES: readonly SaasDemoPage[];
|
|
64
|
+
export declare const SAAS_RECOMMENDED_AGENTS: readonly RecommendedAgentHint[];
|
|
65
|
+
export declare const saasContentPack: BlueprintContentPack;
|
|
66
|
+
//# sourceMappingURL=saas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saas.d.ts","sourceRoot":"","sources":["../../src/blueprints/saas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,OAAO,EACL,KAAK,oBAAoB,EAK1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;;;GASG;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;QAKhB,IAAI;;;;QACJ,IAAI;;;;QACJ,WAAW;;;;;;;;;;;;CASb,CAAA;AAEF,eAAO,MAAM,IAAI,sBAAiC,CAAA;AAElD,eAAO,MAAM,gBAAgB,EAAE,SAAS,oBAAoB,EAAoB,CAAA;AAIhF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAgBxD,CAAA;AAqBD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAC5C;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAwDlD,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,SAAS,oBAAoB,EAWlE,CAAA;AAgCD,eAAO,MAAM,eAAe,EAAE,oBAI7B,CAAA"}
|