@isaiahiroko/tilmart-ngx-apps-admin 0.2.15 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,494 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, NgModule } from '@angular/core';
3
+ import * as i1$1 from '@angular/router';
4
+ import { RouterModule } from '@angular/router';
5
+ import { BaseDirective, using, notify, SharedModule } from '@thescaffold/ngx-core';
6
+ import * as i2 from '@thescaffold/ngx-ui';
7
+ import { ElementsModule } from '@thescaffold/ngx-ui';
8
+ import { firstValueFrom, takeUntil, forkJoin, catchError, of } from 'rxjs';
9
+ import * as i1 from '@angular/forms';
10
+
11
+ // P6.7, PROMO-06 / TRD §9.2 — the homepage composer. A drag-ordered list
12
+ // of `MerchandisingModule` rows for a page, each with a type-aware config
13
+ // editor, schedule and targeting, plus a resolved preview line (ids →
14
+ // names) and a page-shape preview mode. The storefront renderer is P6.8.
15
+ const TYPES = [
16
+ {
17
+ value: 'hero_carousel',
18
+ label: 'Hero carousel',
19
+ fields: [{ key: 'bannerIds', label: 'Banner IDs', kind: 'ids' }],
20
+ },
21
+ {
22
+ value: 'promo_banner',
23
+ label: 'Promo banner',
24
+ fields: [{ key: 'bannerIds', label: 'Banner IDs', kind: 'ids' }],
25
+ },
26
+ {
27
+ value: 'product_rail',
28
+ label: 'Product rail',
29
+ fields: [
30
+ { key: 'categoryId', label: 'From category ID', kind: 'id' },
31
+ { key: 'productIds', label: 'Hand-picked products (in order)', kind: 'ids' },
32
+ { key: 'limit', label: 'Max items', kind: 'num' },
33
+ ],
34
+ },
35
+ {
36
+ value: 'category_grid',
37
+ label: 'Category grid',
38
+ fields: [{ key: 'categoryIds', label: 'Category IDs', kind: 'ids' }],
39
+ },
40
+ {
41
+ value: 'brand_strip',
42
+ label: 'Brand strip',
43
+ fields: [{ key: 'brandIds', label: 'Brand IDs', kind: 'ids' }],
44
+ },
45
+ {
46
+ value: 'flash_sale_rail',
47
+ label: 'Flash sale rail',
48
+ fields: [{ key: 'flashSaleId', label: 'Flash sale ID (blank = all live)', kind: 'id' }],
49
+ },
50
+ {
51
+ value: 'article_rail',
52
+ label: 'Article rail',
53
+ fields: [
54
+ { key: 'articleIds', label: 'Article IDs', kind: 'ids' },
55
+ { key: 'limit', label: 'Max items', kind: 'num' },
56
+ ],
57
+ },
58
+ {
59
+ value: 'rich_text',
60
+ label: 'Rich text',
61
+ fields: [{ key: 'html', label: 'HTML', kind: 'text' }],
62
+ },
63
+ { value: 'newsletter', label: 'Newsletter signup', fields: [] },
64
+ { value: 'trust_bar', label: 'Trust bar', fields: [] },
65
+ ];
66
+ class HomepageComponent extends BaseDirective {
67
+ constructor() {
68
+ super(...arguments);
69
+ this.source = this.apiService.on('apps/commerce/merchandising-module');
70
+ this.types = TYPES;
71
+ this.page = 'home';
72
+ this.loading = true;
73
+ this.modules = [];
74
+ this.previewMode = false;
75
+ this.newType = TYPES[0].value;
76
+ this.editModel = this.blankEditModel();
77
+ this.dragIndex = null;
78
+ // ── id pickers (products / categories / brands / banners) ─────────
79
+ this.pickerQuery = {};
80
+ // Products are searched server-side (the catalogue can exceed one page of
81
+ // lookups); the other lists are small enough to filter from the preloaded maps.
82
+ this.productHits = [];
83
+ // id → name lookups for the preview line.
84
+ this.productName = new Map();
85
+ this.categoryName = new Map();
86
+ this.brandName = new Map();
87
+ this.bannerName = new Map();
88
+ this.flashSaleName = new Map();
89
+ this.init = () => {
90
+ this.loadLookups();
91
+ this.load();
92
+ };
93
+ }
94
+ lookupFor(key) {
95
+ switch (key) {
96
+ case 'productIds': return this.productName;
97
+ case 'categoryIds': return this.categoryName;
98
+ case 'brandIds': return this.brandName;
99
+ case 'bannerIds': return this.bannerName;
100
+ default: return undefined;
101
+ }
102
+ }
103
+ selectedIds(key) {
104
+ return (this.editModel.config[key] ?? '').split(',').map((s) => s.trim()).filter(Boolean);
105
+ }
106
+ onPickerInput(key, value) {
107
+ this.pickerQuery[key] = value;
108
+ if (key !== 'productIds')
109
+ return;
110
+ clearTimeout(this.pickerTimer);
111
+ const q = value.trim();
112
+ if (!q) {
113
+ this.productHits = [];
114
+ return;
115
+ }
116
+ this.pickerTimer = setTimeout(async () => {
117
+ // SKUs are unique, so an exact SKU resolves to exactly one product and
118
+ // is listed first; the text search covers names, brands and partial SKUs.
119
+ const [bySku, byText] = await Promise.all([
120
+ this.findBySku(q),
121
+ firstValueFrom(this.apiService.on('apps/commerce/search').create({ q, page: 1, perPage: 8 })).catch(() => null),
122
+ ]);
123
+ const hits = [...bySku];
124
+ for (const i of byText?.data?.items ?? []) {
125
+ this.productName.set(i.productId, i.name);
126
+ if (!hits.some((h) => h.id === i.productId))
127
+ hits.push({ id: i.productId, name: i.name });
128
+ }
129
+ this.productHits = hits;
130
+ }, 250);
131
+ }
132
+ async findBySku(sku) {
133
+ try {
134
+ const res = await firstValueFrom(this.apiService
135
+ .on('apps/commerce/product-variant')
136
+ .getMany({ sku, page: 1, perPage: 5 }));
137
+ return (res?.data ?? [])
138
+ // The list filter may be loose; only an exact SKU counts as a SKU match.
139
+ .filter((v) => String(v.sku).toLowerCase() === sku.toLowerCase() && v.productId)
140
+ .map((v) => ({
141
+ id: v.productId,
142
+ name: `${this.productName.get(v.productId) ?? v.name ?? 'Product'} · SKU ${v.sku}`,
143
+ }));
144
+ }
145
+ catch {
146
+ return [];
147
+ }
148
+ }
149
+ /** Enter in the picker adds the top match (an exact SKU is always on top). */
150
+ addFirstMatch(key) {
151
+ const first = this.pickerMatches(key)[0];
152
+ if (first)
153
+ this.addId(key, first.id);
154
+ }
155
+ pickerMatches(key) {
156
+ if (key === 'productIds') {
157
+ const taken = new Set(this.selectedIds(key));
158
+ return (this.pickerQuery[key] ?? '').trim()
159
+ ? this.productHits.filter((h) => !taken.has(h.id))
160
+ : [];
161
+ }
162
+ const q = (this.pickerQuery[key] ?? '').trim().toLowerCase();
163
+ const map = this.lookupFor(key);
164
+ if (!q || !map)
165
+ return [];
166
+ const taken = new Set(this.selectedIds(key));
167
+ return [...map.entries()]
168
+ .filter(([id, name]) => !taken.has(id) && String(name).toLowerCase().includes(q))
169
+ .slice(0, 8)
170
+ .map(([id, name]) => ({ id, name }));
171
+ }
172
+ addId(key, id) {
173
+ this.editModel.config[key] = [...this.selectedIds(key), id].join(', ');
174
+ this.pickerQuery[key] = '';
175
+ }
176
+ removeId(key, id) {
177
+ this.editModel.config[key] = this.selectedIds(key).filter((x) => x !== id).join(', ');
178
+ }
179
+ typeLabel(value) {
180
+ return TYPES.find((t) => t.value === value)?.label ?? value;
181
+ }
182
+ typeDef(value) {
183
+ return TYPES.find((t) => t.value === value);
184
+ }
185
+ get orderedModules() {
186
+ return [...this.modules].sort((a, b) => a.position - b.position);
187
+ }
188
+ get previewModules() {
189
+ const now = Date.now();
190
+ return this.orderedModules.filter((m) => m.enabled &&
191
+ (!m.startsAt || Date.parse(m.startsAt) <= now) &&
192
+ (!m.endsAt || Date.parse(m.endsAt) >= now));
193
+ }
194
+ load() {
195
+ this.loading = true;
196
+ this.source
197
+ .getMany({ page: this.page, perPage: 200 })
198
+ .pipe(takeUntil(this.$))
199
+ .subscribe(using((res) => {
200
+ this.modules = (res?.data ?? [])
201
+ .filter((m) => m.page === this.page)
202
+ .map((m) => ({ ...m, config: m.config ?? {} }))
203
+ .sort((a, b) => a.position - b.position);
204
+ this.loading = false;
205
+ }));
206
+ }
207
+ changePage(page) {
208
+ this.page = page.trim() || 'home';
209
+ this.cancelEdit();
210
+ this.load();
211
+ }
212
+ loadLookups() {
213
+ forkJoin({
214
+ products: this.apiService
215
+ .on('apps/commerce/product')
216
+ .getMany({ perPage: 500 })
217
+ .pipe(catchError(() => of({ data: [] }))),
218
+ categories: this.apiService
219
+ .on('apps/commerce/category')
220
+ .getMany({ perPage: 500 })
221
+ .pipe(catchError(() => of({ data: [] }))),
222
+ brands: this.apiService
223
+ .on('apps/commerce/brand')
224
+ .getMany({ perPage: 500 })
225
+ .pipe(catchError(() => of({ data: [] }))),
226
+ banners: this.apiService
227
+ .on('apps/commerce/banner')
228
+ .getMany({ perPage: 500 })
229
+ .pipe(catchError(() => of({ data: [] }))),
230
+ flashSales: this.apiService
231
+ .on('apps/commerce/flash-sale')
232
+ .getMany({ perPage: 500 })
233
+ .pipe(catchError(() => of({ data: [] }))),
234
+ })
235
+ .pipe(takeUntil(this.$))
236
+ .subscribe(using((res) => {
237
+ for (const p of res?.products?.data ?? [])
238
+ this.productName.set(p.id, p.name);
239
+ for (const c of res?.categories?.data ?? [])
240
+ this.categoryName.set(c.id, c.name);
241
+ for (const b of res?.brands?.data ?? [])
242
+ this.brandName.set(b.id, b.name);
243
+ for (const b of res?.banners?.data ?? [])
244
+ this.bannerName.set(b.id, b.title || b.slot || b.id);
245
+ for (const f of res?.flashSales?.data ?? [])
246
+ this.flashSaleName.set(f.id, f.name);
247
+ }));
248
+ }
249
+ previewLine(m) {
250
+ const c = m.config ?? {};
251
+ const names = (ids, map) => (Array.isArray(ids) ? ids : [])
252
+ .map((id) => map.get(id) ?? id)
253
+ .filter(Boolean);
254
+ switch (m.type) {
255
+ case 'hero_carousel':
256
+ case 'promo_banner': {
257
+ const list = names(c.bannerIds, this.bannerName);
258
+ return list.length ? `${list.length} banner(s): ${list.join(', ')}` : 'No banners set';
259
+ }
260
+ case 'product_rail': {
261
+ if (c.categoryId) {
262
+ const cat = this.categoryName.get(c.categoryId) ?? c.categoryId;
263
+ return `Top ${c.limit || 12} from ${cat}`;
264
+ }
265
+ const list = names(c.productIds, this.productName);
266
+ return list.length ? `${list.length} product(s): ${list.join(', ')}` : 'No products set';
267
+ }
268
+ case 'category_grid': {
269
+ const list = names(c.categoryIds, this.categoryName);
270
+ return list.length ? list.join(', ') : 'No categories set';
271
+ }
272
+ case 'brand_strip': {
273
+ const list = names(c.brandIds, this.brandName);
274
+ return list.length ? list.join(', ') : 'No brands set';
275
+ }
276
+ case 'flash_sale_rail':
277
+ return c.flashSaleId
278
+ ? this.flashSaleName.get(c.flashSaleId) ?? c.flashSaleId
279
+ : 'All live flash sales';
280
+ case 'article_rail': {
281
+ const n = Array.isArray(c.articleIds) ? c.articleIds.length : 0;
282
+ return n ? `${n} article(s)` : `Latest ${c.limit || 6} articles`;
283
+ }
284
+ case 'rich_text':
285
+ return (c.html ? String(c.html).replace(/<[^>]+>/g, ' ').trim().slice(0, 80) : '') || 'Empty';
286
+ default:
287
+ return '—';
288
+ }
289
+ }
290
+ scheduleLine(m) {
291
+ if (!m.startsAt && !m.endsAt)
292
+ return '';
293
+ const fmt = (v) => (v ? new Date(v).toLocaleDateString() : '…');
294
+ return `${fmt(m.startsAt)} → ${fmt(m.endsAt)}`;
295
+ }
296
+ // ── ordering ──────────────────────────────────────────────────────
297
+ onDragStart(index) {
298
+ this.dragIndex = index;
299
+ }
300
+ onDragOver(event) {
301
+ event.preventDefault();
302
+ }
303
+ onDrop(targetIndex) {
304
+ if (this.dragIndex === null || this.dragIndex === targetIndex)
305
+ return;
306
+ const ordered = this.orderedModules;
307
+ const [moved] = ordered.splice(this.dragIndex, 1);
308
+ ordered.splice(targetIndex, 0, moved);
309
+ this.dragIndex = null;
310
+ void this.persistOrder(ordered);
311
+ }
312
+ moveUp(index) {
313
+ if (index <= 0)
314
+ return;
315
+ const ordered = this.orderedModules;
316
+ [ordered[index - 1], ordered[index]] = [ordered[index], ordered[index - 1]];
317
+ void this.persistOrder(ordered);
318
+ }
319
+ moveDown(index) {
320
+ const ordered = this.orderedModules;
321
+ if (index >= ordered.length - 1)
322
+ return;
323
+ [ordered[index + 1], ordered[index]] = [ordered[index], ordered[index + 1]];
324
+ void this.persistOrder(ordered);
325
+ }
326
+ async persistOrder(ordered) {
327
+ const changed = [];
328
+ ordered.forEach((m, i) => {
329
+ if (m.position !== i) {
330
+ m.position = i;
331
+ changed.push(m);
332
+ }
333
+ });
334
+ this.modules = ordered;
335
+ try {
336
+ await Promise.all(changed.map((m) => firstValueFrom(this.source.update(m.id, { position: m.position }))));
337
+ }
338
+ catch {
339
+ notify('Could not save the new order.', undefined, 'error');
340
+ this.load();
341
+ }
342
+ }
343
+ // ── add / toggle / delete ─────────────────────────────────────────
344
+ async addModule() {
345
+ try {
346
+ await firstValueFrom(this.source.create({
347
+ page: this.page,
348
+ type: this.newType,
349
+ position: this.modules.length,
350
+ config: {},
351
+ enabled: false,
352
+ }));
353
+ notify('Module added.', undefined, 'success');
354
+ this.load();
355
+ }
356
+ catch {
357
+ notify('Could not add the module.', undefined, 'error');
358
+ }
359
+ }
360
+ async toggleEnabled(m) {
361
+ const next = !m.enabled;
362
+ try {
363
+ await firstValueFrom(this.source.update(m.id, { enabled: next }));
364
+ m.enabled = next;
365
+ }
366
+ catch {
367
+ notify('Could not update the module.', undefined, 'error');
368
+ }
369
+ }
370
+ async removeModule(m) {
371
+ try {
372
+ await firstValueFrom(this.source.remove(m.id));
373
+ this.modules = this.modules.filter((x) => x.id !== m.id);
374
+ if (this.editing?.id === m.id)
375
+ this.cancelEdit();
376
+ notify('Module removed.', undefined, 'success');
377
+ }
378
+ catch {
379
+ notify('Could not remove the module.', undefined, 'error');
380
+ }
381
+ }
382
+ // ── edit ──────────────────────────────────────────────────────────
383
+ editModule(m) {
384
+ this.editing = m;
385
+ const config = {};
386
+ for (const field of this.typeDef(m.type)?.fields ?? []) {
387
+ const value = (m.config ?? {})[field.key];
388
+ config[field.key] = Array.isArray(value) ? value.join(', ') : value != null ? String(value) : '';
389
+ }
390
+ this.editModel = {
391
+ title: m.title ?? '',
392
+ startsAt: this.toLocalInput(m.startsAt),
393
+ endsAt: this.toLocalInput(m.endsAt),
394
+ channelIds: (m.channelIds ?? []).join(', '),
395
+ segmentIds: (m.segmentIds ?? []).join(', '),
396
+ config,
397
+ };
398
+ }
399
+ cancelEdit() {
400
+ this.editing = undefined;
401
+ this.editModel = this.blankEditModel();
402
+ }
403
+ async saveEdit() {
404
+ if (!this.editing)
405
+ return;
406
+ const def = this.typeDef(this.editing.type);
407
+ const config = { ...(this.editing.config ?? {}) };
408
+ for (const field of def?.fields ?? []) {
409
+ const raw = (this.editModel.config[field.key] ?? '').trim();
410
+ if (field.kind === 'ids') {
411
+ config[field.key] = raw ? raw.split(',').map((s) => s.trim()).filter(Boolean) : [];
412
+ }
413
+ else if (field.kind === 'num') {
414
+ config[field.key] = raw ? Number(raw) : undefined;
415
+ }
416
+ else {
417
+ config[field.key] = raw || undefined;
418
+ }
419
+ }
420
+ const csv = (s) => s.split(',').map((x) => x.trim()).filter(Boolean);
421
+ const body = {
422
+ title: this.editModel.title.trim() || undefined,
423
+ startsAt: this.editModel.startsAt ? new Date(this.editModel.startsAt).toISOString() : null,
424
+ endsAt: this.editModel.endsAt ? new Date(this.editModel.endsAt).toISOString() : null,
425
+ channelIds: csv(this.editModel.channelIds),
426
+ segmentIds: csv(this.editModel.segmentIds),
427
+ config,
428
+ };
429
+ try {
430
+ await firstValueFrom(this.source.update(this.editing.id, body));
431
+ Object.assign(this.editing, {
432
+ title: body.title,
433
+ startsAt: body.startsAt ?? undefined,
434
+ endsAt: body.endsAt ?? undefined,
435
+ channelIds: body.channelIds,
436
+ segmentIds: body.segmentIds,
437
+ config,
438
+ });
439
+ notify('Module saved.', undefined, 'success');
440
+ this.cancelEdit();
441
+ }
442
+ catch {
443
+ notify('Could not save the module.', undefined, 'error');
444
+ }
445
+ }
446
+ blankEditModel() {
447
+ return {
448
+ title: '',
449
+ startsAt: '',
450
+ endsAt: '',
451
+ channelIds: '',
452
+ segmentIds: '',
453
+ config: {},
454
+ };
455
+ }
456
+ toLocalInput(iso) {
457
+ if (!iso)
458
+ return '';
459
+ const d = new Date(iso);
460
+ if (Number.isNaN(d.getTime()))
461
+ return '';
462
+ const pad = (n) => String(n).padStart(2, '0');
463
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
464
+ }
465
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: HomepageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
466
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: HomepageComponent, isStandalone: false, selector: "x-homepage", usesInheritance: true, ngImport: i0, template: "<div class=\"x-hc-head\">\n <div>\n <div class=\"x-hc-title\">Homepage composer</div>\n <div class=\"x-hc-sub\">Drag to reorder the modules that build a storefront page.</div>\n @if (page === 'home') {\n <div class=\"x-hc-sub\">\n \u201CShop by category\u201D always shows above these modules.\n A Category grid module replaces the built-in categories; a Product rail titled \u201CNew in\u201D\n fills the New in row.\n </div>\n }\n </div>\n <div class=\"x-hc-head-controls\">\n <label class=\"x-hc-page-field\">\n Page\n <input\n type=\"text\"\n [ngModel]=\"page\"\n (ngModelChange)=\"changePage($event)\"\n placeholder=\"home\"\n />\n </label>\n <button\n type=\"button\"\n class=\"x-hc-btn\"\n [class.x-hc-btn-active]=\"previewMode\"\n (click)=\"previewMode = !previewMode\"\n >\n {{ previewMode ? 'Exit preview' : 'Preview' }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n @if (!previewMode) {\n <div class=\"x-hc-add\">\n <select [(ngModel)]=\"newType\">\n @for (t of types; track t.value) {\n <option [value]=\"t.value\">{{ t.label }}</option>\n }\n </select>\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"addModule()\">\n Add module\n </button>\n </div>\n }\n\n @if (!orderedModules.length) {\n <div class=\"x-hc-empty\">No modules on this page yet.</div>\n }\n\n @if (previewMode) {\n <div class=\"x-hc-preview\">\n @for (m of previewModules; track m.id) {\n <div class=\"x-hc-preview-block\">\n <span class=\"x-hc-preview-type\">{{ typeLabel(m.type) }}</span>\n <span class=\"x-hc-preview-title\">{{ m.title || previewLine(m) }}</span>\n </div>\n } @empty {\n <div class=\"x-hc-empty\">Nothing live on this page right now.</div>\n }\n </div>\n } @else {\n <div class=\"x-hc-list\">\n @for (m of orderedModules; track m.id; let i = $index) {\n <div\n class=\"x-hc-item\"\n [class.x-hc-item-off]=\"!m.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-hc-item-main\">\n <span class=\"x-hc-grip\" title=\"Drag to reorder\">\u283F</span>\n <div class=\"x-hc-order\">\n <button type=\"button\" (click)=\"moveUp(i)\" [disabled]=\"i === 0\">\u25B2</button>\n <button type=\"button\" (click)=\"moveDown(i)\" [disabled]=\"i === orderedModules.length - 1\">\u25BC</button>\n </div>\n <div class=\"x-hc-item-body\">\n <div class=\"x-hc-item-row\">\n <span class=\"x-hc-type\">{{ typeLabel(m.type) }}</span>\n @if (m.title) {\n <span class=\"x-hc-item-title\">{{ m.title }}</span>\n }\n @if (scheduleLine(m)) {\n <span class=\"x-hc-sched\">{{ scheduleLine(m) }}</span>\n }\n </div>\n <div class=\"x-hc-item-preview\">{{ previewLine(m) }}</div>\n </div>\n <div class=\"x-hc-item-actions\">\n <button type=\"button\" class=\"x-hc-toggle\" (click)=\"toggleEnabled(m)\">\n {{ m.enabled ? 'On' : 'Off' }}\n </button>\n <button type=\"button\" class=\"x-hc-link\" (click)=\"editModule(m)\">Edit</button>\n <button type=\"button\" class=\"x-hc-link x-hc-danger\" (click)=\"removeModule(m)\">Delete</button>\n </div>\n </div>\n\n @if (editing?.id === m.id) {\n <div class=\"x-hc-edit\">\n <label class=\"x-hc-f\">\n Title\n <input type=\"text\" [(ngModel)]=\"editModel.title\" />\n </label>\n @for (field of typeDef(m.type)?.fields ?? []; track field.key) {\n <label class=\"x-hc-f\">\n {{ field.label }}\n @if (field.kind === 'ids' && lookupFor(field.key)) {\n <div class=\"x-hc-picked\">\n @for (id of selectedIds(field.key); track id) {\n <span class=\"x-hc-chip\">\n {{ lookupFor(field.key)!.get(id) || id }}\n <button type=\"button\" (click)=\"removeId(field.key, id)\" aria-label=\"Remove\">\u00D7</button>\n </span>\n }\n </div>\n <input\n type=\"search\"\n [placeholder]=\"field.key === 'productIds' ? 'Type a SKU or a name to add\u2026' : 'Search by name to add\u2026'\"\n [ngModel]=\"pickerQuery[field.key] || ''\"\n (ngModelChange)=\"onPickerInput(field.key, $event)\"\n (keydown.enter)=\"$event.preventDefault(); addFirstMatch(field.key)\"\n />\n @for (opt of pickerMatches(field.key); track opt.id) {\n <button type=\"button\" class=\"x-hc-opt\" (click)=\"addId(field.key, opt.id)\">\n + {{ opt.name }}\n </button>\n }\n } @else if (field.kind === 'text') {\n <textarea rows=\"3\" [(ngModel)]=\"editModel.config[field.key]\"></textarea>\n } @else {\n <input\n [type]=\"field.kind === 'num' ? 'number' : 'text'\"\n [(ngModel)]=\"editModel.config[field.key]\"\n />\n }\n </label>\n }\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Starts\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.startsAt\" />\n </label>\n <label class=\"x-hc-f\">\n Ends\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.endsAt\" />\n </label>\n </div>\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Channel IDs\n <input type=\"text\" [(ngModel)]=\"editModel.channelIds\" placeholder=\"blank = all\" />\n </label>\n <label class=\"x-hc-f\">\n Segment IDs\n <input type=\"text\" [(ngModel)]=\"editModel.segmentIds\" placeholder=\"blank = all\" />\n </label>\n </div>\n <div class=\"x-hc-edit-actions\">\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"saveEdit()\">Save</button>\n <button type=\"button\" class=\"x-hc-btn\" (click)=\"cancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n}\n\n<style>\n .x-hc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }\n /* Theme tokens, not hard-coded light greys: a bare <button> otherwise\n takes the browser's own button text colour, which in dark mode is\n near-white on the composer's light card (text only showed when\n highlighted). */\n .x-hc-chip {\n background: var(--color-bg);\n border: 1px solid var(--color-border);\n border-radius: 12px;\n padding: 2px 8px;\n font-size: 12px;\n color: var(--color-text);\n }\n .x-hc-chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; color: var(--color-text-muted); }\n .x-hc-opt {\n display: block;\n width: 100%;\n text-align: left;\n border: 0;\n border-bottom: 1px solid var(--color-border);\n background: none;\n color: var(--color-text);\n padding: 6px 4px;\n font: inherit;\n font-size: 13px;\n cursor: pointer;\n }\n .x-hc-opt:hover,\n .x-hc-opt:focus-visible { background: var(--color-bg); color: var(--color-brand); }\n .x-hc-head {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n margin-bottom: 20px;\n flex-wrap: wrap;\n }\n .x-hc-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-hc-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-head-controls { display: flex; gap: 10px; align-items: flex-end; }\n .x-hc-page-field {\n display: flex; flex-direction: column; gap: 4px;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.4px;\n }\n .x-hc-page-field input, .x-hc-add select, .x-hc-f input, .x-hc-f textarea {\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n padding: 6px 10px;\n font-size: 13px;\n background: var(--color-surface);\n color: var(--color-text);\n }\n .x-hc-add { display: flex; gap: 10px; margin-bottom: 16px; }\n .x-hc-btn {\n border: 1px solid var(--color-border);\n background: transparent;\n border-radius: var(--radius-md);\n padding: 6px 14px;\n font-size: 12.5px;\n font-weight: 700;\n cursor: pointer;\n color: var(--color-text-muted);\n }\n .x-hc-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-btn-active { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-empty { font-size: 14px; color: var(--color-text-muted); }\n .x-hc-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }\n .x-hc-item {\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n padding: 12px 14px;\n }\n .x-hc-item-off { opacity: 0.55; }\n .x-hc-item-main { display: flex; align-items: center; gap: 12px; }\n .x-hc-grip { cursor: grab; color: var(--color-text-muted); font-size: 16px; }\n .x-hc-order { display: flex; flex-direction: column; }\n .x-hc-order button {\n border: 0; background: transparent; cursor: pointer;\n color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px;\n }\n .x-hc-order button:disabled { opacity: 0.3; cursor: default; }\n .x-hc-item-body { flex: 1; min-width: 0; }\n .x-hc-item-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }\n .x-hc-type {\n font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;\n font-size: 11px; color: var(--color-accent-hover);\n }\n .x-hc-item-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); }\n .x-hc-sched { font-size: 11px; color: var(--color-text-muted); }\n .x-hc-item-preview { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-hc-toggle {\n border: 1px solid var(--color-border); border-radius: var(--radius-sm);\n background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700;\n cursor: pointer; color: var(--color-text-muted);\n }\n .x-hc-link {\n border: 0; background: transparent; cursor: pointer;\n font-size: 12px; font-weight: 700; color: var(--color-accent-hover);\n }\n .x-hc-danger { color: var(--color-danger, #c0362c); }\n .x-hc-edit {\n margin-top: 12px; padding-top: 12px;\n border-top: 1px solid var(--color-border);\n display: flex; flex-direction: column; gap: 10px;\n }\n .x-hc-f {\n display: flex; flex-direction: column; gap: 4px; flex: 1;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n }\n .x-hc-f-row { display: flex; gap: 10px; }\n .x-hc-edit-actions { display: flex; gap: 8px; }\n .x-hc-preview { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }\n .x-hc-preview-block {\n border: 1px dashed var(--color-border-strong);\n border-radius: var(--radius-md);\n padding: 18px 16px;\n display: flex; flex-direction: column; gap: 4px;\n background: var(--color-surface);\n }\n .x-hc-preview-type {\n font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;\n color: var(--color-accent-hover);\n }\n .x-hc-preview-title { font-size: 14px; color: var(--color-text); }\n</style>\n", styles: [".x-hc-picked{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.x-hc-chip{background:var(--color-bg);border:1px solid var(--color-border);border-radius:12px;padding:2px 8px;font-size:12px;color:var(--color-text)}.x-hc-chip button{border:0;background:none;cursor:pointer;margin-left:4px;color:var(--color-text-muted)}.x-hc-opt{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid var(--color-border);background:none;color:var(--color-text);padding:6px 4px;font:inherit;font-size:13px;cursor:pointer}.x-hc-opt:hover,.x-hc-opt:focus-visible{background:var(--color-bg);color:var(--color-brand)}.x-hc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px;flex-wrap:wrap}.x-hc-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-hc-sub{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-hc-head-controls{display:flex;gap:10px;align-items:flex-end}.x-hc-page-field{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700;text-transform:uppercase;letter-spacing:.4px}.x-hc-page-field input,.x-hc-add select,.x-hc-f input,.x-hc-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text)}.x-hc-add{display:flex;gap:10px;margin-bottom:16px}.x-hc-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-hc-btn-primary,.x-hc-btn-active{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-hc-empty{font-size:14px;color:var(--color-text-muted)}.x-hc-list{display:flex;flex-direction:column;gap:10px;max-width:860px}.x-hc-item{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:12px 14px}.x-hc-item-off{opacity:.55}.x-hc-item-main{display:flex;align-items:center;gap:12px}.x-hc-grip{cursor:grab;color:var(--color-text-muted);font-size:16px}.x-hc-order{display:flex;flex-direction:column}.x-hc-order button{border:0;background:transparent;cursor:pointer;color:var(--color-text-muted);font-size:10px;line-height:1.1;padding:1px 3px}.x-hc-order button:disabled{opacity:.3;cursor:default}.x-hc-item-body{flex:1;min-width:0}.x-hc-item-row{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}.x-hc-type{font-weight:800;text-transform:uppercase;letter-spacing:.4px;font-size:11px;color:var(--color-accent-hover)}.x-hc-item-title{font-size:13.5px;font-weight:600;color:var(--color-text)}.x-hc-sched{font-size:11px;color:var(--color-text-muted)}.x-hc-item-preview{font-size:12.5px;color:var(--color-text-muted);margin-top:2px}.x-hc-item-actions{display:flex;gap:8px;align-items:center}.x-hc-toggle{border:1px solid var(--color-border);border-radius:var(--radius-sm);background:transparent;padding:3px 10px;font-size:11.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-hc-link{border:0;background:transparent;cursor:pointer;font-size:12px;font-weight:700;color:var(--color-accent-hover)}.x-hc-danger{color:var(--color-danger, #c0362c)}.x-hc-edit{margin-top:12px;padding-top:12px;border-top:1px solid var(--color-border);display:flex;flex-direction:column;gap:10px}.x-hc-f{display:flex;flex-direction:column;gap:4px;flex:1;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-hc-f-row{display:flex;gap:10px}.x-hc-edit-actions{display:flex;gap:8px}.x-hc-preview{display:flex;flex-direction:column;gap:6px;max-width:860px}.x-hc-preview-block{border:1px dashed var(--color-border-strong);border-radius:var(--radius-md);padding:18px 16px;display:flex;flex-direction:column;gap:4px;background:var(--color-surface)}.x-hc-preview-type{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.5px;color:var(--color-accent-hover)}.x-hc-preview-title{font-size:14px;color:var(--color-text)}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }] }); }
467
+ }
468
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: HomepageComponent, decorators: [{
469
+ type: Component,
470
+ args: [{ standalone: false, selector: 'x-homepage', template: "<div class=\"x-hc-head\">\n <div>\n <div class=\"x-hc-title\">Homepage composer</div>\n <div class=\"x-hc-sub\">Drag to reorder the modules that build a storefront page.</div>\n @if (page === 'home') {\n <div class=\"x-hc-sub\">\n \u201CShop by category\u201D always shows above these modules.\n A Category grid module replaces the built-in categories; a Product rail titled \u201CNew in\u201D\n fills the New in row.\n </div>\n }\n </div>\n <div class=\"x-hc-head-controls\">\n <label class=\"x-hc-page-field\">\n Page\n <input\n type=\"text\"\n [ngModel]=\"page\"\n (ngModelChange)=\"changePage($event)\"\n placeholder=\"home\"\n />\n </label>\n <button\n type=\"button\"\n class=\"x-hc-btn\"\n [class.x-hc-btn-active]=\"previewMode\"\n (click)=\"previewMode = !previewMode\"\n >\n {{ previewMode ? 'Exit preview' : 'Preview' }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n @if (!previewMode) {\n <div class=\"x-hc-add\">\n <select [(ngModel)]=\"newType\">\n @for (t of types; track t.value) {\n <option [value]=\"t.value\">{{ t.label }}</option>\n }\n </select>\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"addModule()\">\n Add module\n </button>\n </div>\n }\n\n @if (!orderedModules.length) {\n <div class=\"x-hc-empty\">No modules on this page yet.</div>\n }\n\n @if (previewMode) {\n <div class=\"x-hc-preview\">\n @for (m of previewModules; track m.id) {\n <div class=\"x-hc-preview-block\">\n <span class=\"x-hc-preview-type\">{{ typeLabel(m.type) }}</span>\n <span class=\"x-hc-preview-title\">{{ m.title || previewLine(m) }}</span>\n </div>\n } @empty {\n <div class=\"x-hc-empty\">Nothing live on this page right now.</div>\n }\n </div>\n } @else {\n <div class=\"x-hc-list\">\n @for (m of orderedModules; track m.id; let i = $index) {\n <div\n class=\"x-hc-item\"\n [class.x-hc-item-off]=\"!m.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-hc-item-main\">\n <span class=\"x-hc-grip\" title=\"Drag to reorder\">\u283F</span>\n <div class=\"x-hc-order\">\n <button type=\"button\" (click)=\"moveUp(i)\" [disabled]=\"i === 0\">\u25B2</button>\n <button type=\"button\" (click)=\"moveDown(i)\" [disabled]=\"i === orderedModules.length - 1\">\u25BC</button>\n </div>\n <div class=\"x-hc-item-body\">\n <div class=\"x-hc-item-row\">\n <span class=\"x-hc-type\">{{ typeLabel(m.type) }}</span>\n @if (m.title) {\n <span class=\"x-hc-item-title\">{{ m.title }}</span>\n }\n @if (scheduleLine(m)) {\n <span class=\"x-hc-sched\">{{ scheduleLine(m) }}</span>\n }\n </div>\n <div class=\"x-hc-item-preview\">{{ previewLine(m) }}</div>\n </div>\n <div class=\"x-hc-item-actions\">\n <button type=\"button\" class=\"x-hc-toggle\" (click)=\"toggleEnabled(m)\">\n {{ m.enabled ? 'On' : 'Off' }}\n </button>\n <button type=\"button\" class=\"x-hc-link\" (click)=\"editModule(m)\">Edit</button>\n <button type=\"button\" class=\"x-hc-link x-hc-danger\" (click)=\"removeModule(m)\">Delete</button>\n </div>\n </div>\n\n @if (editing?.id === m.id) {\n <div class=\"x-hc-edit\">\n <label class=\"x-hc-f\">\n Title\n <input type=\"text\" [(ngModel)]=\"editModel.title\" />\n </label>\n @for (field of typeDef(m.type)?.fields ?? []; track field.key) {\n <label class=\"x-hc-f\">\n {{ field.label }}\n @if (field.kind === 'ids' && lookupFor(field.key)) {\n <div class=\"x-hc-picked\">\n @for (id of selectedIds(field.key); track id) {\n <span class=\"x-hc-chip\">\n {{ lookupFor(field.key)!.get(id) || id }}\n <button type=\"button\" (click)=\"removeId(field.key, id)\" aria-label=\"Remove\">\u00D7</button>\n </span>\n }\n </div>\n <input\n type=\"search\"\n [placeholder]=\"field.key === 'productIds' ? 'Type a SKU or a name to add\u2026' : 'Search by name to add\u2026'\"\n [ngModel]=\"pickerQuery[field.key] || ''\"\n (ngModelChange)=\"onPickerInput(field.key, $event)\"\n (keydown.enter)=\"$event.preventDefault(); addFirstMatch(field.key)\"\n />\n @for (opt of pickerMatches(field.key); track opt.id) {\n <button type=\"button\" class=\"x-hc-opt\" (click)=\"addId(field.key, opt.id)\">\n + {{ opt.name }}\n </button>\n }\n } @else if (field.kind === 'text') {\n <textarea rows=\"3\" [(ngModel)]=\"editModel.config[field.key]\"></textarea>\n } @else {\n <input\n [type]=\"field.kind === 'num' ? 'number' : 'text'\"\n [(ngModel)]=\"editModel.config[field.key]\"\n />\n }\n </label>\n }\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Starts\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.startsAt\" />\n </label>\n <label class=\"x-hc-f\">\n Ends\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.endsAt\" />\n </label>\n </div>\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Channel IDs\n <input type=\"text\" [(ngModel)]=\"editModel.channelIds\" placeholder=\"blank = all\" />\n </label>\n <label class=\"x-hc-f\">\n Segment IDs\n <input type=\"text\" [(ngModel)]=\"editModel.segmentIds\" placeholder=\"blank = all\" />\n </label>\n </div>\n <div class=\"x-hc-edit-actions\">\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"saveEdit()\">Save</button>\n <button type=\"button\" class=\"x-hc-btn\" (click)=\"cancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n}\n\n<style>\n .x-hc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }\n /* Theme tokens, not hard-coded light greys: a bare <button> otherwise\n takes the browser's own button text colour, which in dark mode is\n near-white on the composer's light card (text only showed when\n highlighted). */\n .x-hc-chip {\n background: var(--color-bg);\n border: 1px solid var(--color-border);\n border-radius: 12px;\n padding: 2px 8px;\n font-size: 12px;\n color: var(--color-text);\n }\n .x-hc-chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; color: var(--color-text-muted); }\n .x-hc-opt {\n display: block;\n width: 100%;\n text-align: left;\n border: 0;\n border-bottom: 1px solid var(--color-border);\n background: none;\n color: var(--color-text);\n padding: 6px 4px;\n font: inherit;\n font-size: 13px;\n cursor: pointer;\n }\n .x-hc-opt:hover,\n .x-hc-opt:focus-visible { background: var(--color-bg); color: var(--color-brand); }\n .x-hc-head {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n margin-bottom: 20px;\n flex-wrap: wrap;\n }\n .x-hc-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-hc-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-head-controls { display: flex; gap: 10px; align-items: flex-end; }\n .x-hc-page-field {\n display: flex; flex-direction: column; gap: 4px;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.4px;\n }\n .x-hc-page-field input, .x-hc-add select, .x-hc-f input, .x-hc-f textarea {\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n padding: 6px 10px;\n font-size: 13px;\n background: var(--color-surface);\n color: var(--color-text);\n }\n .x-hc-add { display: flex; gap: 10px; margin-bottom: 16px; }\n .x-hc-btn {\n border: 1px solid var(--color-border);\n background: transparent;\n border-radius: var(--radius-md);\n padding: 6px 14px;\n font-size: 12.5px;\n font-weight: 700;\n cursor: pointer;\n color: var(--color-text-muted);\n }\n .x-hc-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-btn-active { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-empty { font-size: 14px; color: var(--color-text-muted); }\n .x-hc-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }\n .x-hc-item {\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n padding: 12px 14px;\n }\n .x-hc-item-off { opacity: 0.55; }\n .x-hc-item-main { display: flex; align-items: center; gap: 12px; }\n .x-hc-grip { cursor: grab; color: var(--color-text-muted); font-size: 16px; }\n .x-hc-order { display: flex; flex-direction: column; }\n .x-hc-order button {\n border: 0; background: transparent; cursor: pointer;\n color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px;\n }\n .x-hc-order button:disabled { opacity: 0.3; cursor: default; }\n .x-hc-item-body { flex: 1; min-width: 0; }\n .x-hc-item-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }\n .x-hc-type {\n font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;\n font-size: 11px; color: var(--color-accent-hover);\n }\n .x-hc-item-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); }\n .x-hc-sched { font-size: 11px; color: var(--color-text-muted); }\n .x-hc-item-preview { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-hc-toggle {\n border: 1px solid var(--color-border); border-radius: var(--radius-sm);\n background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700;\n cursor: pointer; color: var(--color-text-muted);\n }\n .x-hc-link {\n border: 0; background: transparent; cursor: pointer;\n font-size: 12px; font-weight: 700; color: var(--color-accent-hover);\n }\n .x-hc-danger { color: var(--color-danger, #c0362c); }\n .x-hc-edit {\n margin-top: 12px; padding-top: 12px;\n border-top: 1px solid var(--color-border);\n display: flex; flex-direction: column; gap: 10px;\n }\n .x-hc-f {\n display: flex; flex-direction: column; gap: 4px; flex: 1;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n }\n .x-hc-f-row { display: flex; gap: 10px; }\n .x-hc-edit-actions { display: flex; gap: 8px; }\n .x-hc-preview { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }\n .x-hc-preview-block {\n border: 1px dashed var(--color-border-strong);\n border-radius: var(--radius-md);\n padding: 18px 16px;\n display: flex; flex-direction: column; gap: 4px;\n background: var(--color-surface);\n }\n .x-hc-preview-type {\n font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;\n color: var(--color-accent-hover);\n }\n .x-hc-preview-title { font-size: 14px; color: var(--color-text); }\n</style>\n" }]
471
+ }] });
472
+
473
+ class HomepageModule {
474
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: HomepageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
475
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: HomepageModule, declarations: [HomepageComponent], imports: [SharedModule,
476
+ ElementsModule, i1$1.RouterModule] }); }
477
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: HomepageModule, imports: [SharedModule,
478
+ ElementsModule,
479
+ RouterModule.forChild([{ path: '', component: HomepageComponent }])] }); }
480
+ }
481
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: HomepageModule, decorators: [{
482
+ type: NgModule,
483
+ args: [{
484
+ declarations: [HomepageComponent],
485
+ imports: [
486
+ SharedModule,
487
+ ElementsModule,
488
+ RouterModule.forChild([{ path: '', component: HomepageComponent }]),
489
+ ],
490
+ }]
491
+ }] });
492
+
493
+ export { HomepageModule };
494
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BAEqU-az.mjs.map