@deneb-ui/cli 2.0.107 → 2.0.109
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deneb-ui/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.109",
|
|
4
4
|
"description": "Official DENEB CLI — scaffold, convert, validate, and package Fivora-ready storefront templates.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"deneb": "bin/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"license": "MIT",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/parser": "^7.28.0",
|
|
52
|
-
"@deneb-ui/core": "^2.0.
|
|
52
|
+
"@deneb-ui/core": "^2.0.109",
|
|
53
53
|
"@octokit/rest": "^22.0.1",
|
|
54
54
|
"adm-zip": "^0.6.0",
|
|
55
55
|
"dotenv": "^17.4.2",
|
|
@@ -52,10 +52,10 @@ export function applyLinkedProjectMedia(
|
|
|
52
52
|
for (const item of ordered) {
|
|
53
53
|
if (item.linkedContentPath?.trim()) {
|
|
54
54
|
const linkedPath = item.linkedContentPath.trim();
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
if (
|
|
55
|
+
const existing = readContentPath(originalContent, linkedPath);
|
|
56
|
+
// An explicit empty string (cleared by user) is authoritative.
|
|
57
|
+
// But undefined or null (uninitialized DB/template default) must be backfilled.
|
|
58
|
+
if (existing !== undefined && existing !== null) {
|
|
59
59
|
continue;
|
|
60
60
|
}
|
|
61
61
|
result = setContentPath(result, linkedPath, item.fileUrl);
|
|
@@ -70,27 +70,110 @@ export function applyLinkedProjectMedia(
|
|
|
70
70
|
: null;
|
|
71
71
|
if (!collection || !item.entityId) continue;
|
|
72
72
|
|
|
73
|
-
const entries =
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
const candidateCollections: Array<{ key: string; entries: unknown[] }> = [];
|
|
74
|
+
if (Array.isArray(result[collection])) {
|
|
75
|
+
candidateCollections.push({
|
|
76
|
+
key: collection,
|
|
77
|
+
entries: result[collection] as unknown[],
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const shop = isRecord(result.shop)
|
|
81
|
+
? (result.shop as Record<string, unknown>)
|
|
82
|
+
: null;
|
|
83
|
+
if (collection === 'products' && shop && Array.isArray(shop.products)) {
|
|
84
|
+
candidateCollections.push({
|
|
85
|
+
key: 'shop.products',
|
|
86
|
+
entries: shop.products,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const home = isRecord(result.home)
|
|
90
|
+
? (result.home as Record<string, unknown>)
|
|
91
|
+
: null;
|
|
92
|
+
if (home) {
|
|
93
|
+
if (collection === 'products') {
|
|
94
|
+
if (Array.isArray(home.products)) {
|
|
95
|
+
candidateCollections.push({
|
|
96
|
+
key: 'home.products',
|
|
97
|
+
entries: home.products,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (Array.isArray(home.featuredProducts)) {
|
|
101
|
+
candidateCollections.push({
|
|
102
|
+
key: 'home.featuredProducts',
|
|
103
|
+
entries: home.featuredProducts,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
} else if (collection === 'services') {
|
|
107
|
+
if (Array.isArray(home.services)) {
|
|
108
|
+
candidateCollections.push({
|
|
109
|
+
key: 'home.services',
|
|
110
|
+
entries: home.services,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (Array.isArray(home.featuredServices)) {
|
|
114
|
+
candidateCollections.push({
|
|
115
|
+
key: 'home.featuredServices',
|
|
116
|
+
entries: home.featuredServices,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Discover any collection dynamically anywhere in result containing this entity
|
|
123
|
+
const foundKeys = new Set(candidateCollections.map((c) => c.key));
|
|
124
|
+
const findCollectionsWithEntity = (obj: unknown, prefix: string) => {
|
|
125
|
+
if (!isRecord(obj)) return;
|
|
126
|
+
for (const [k, v] of Object.entries(obj as Record<string, unknown>)) {
|
|
127
|
+
const path = prefix ? `${prefix}.${k}` : k;
|
|
128
|
+
if (Array.isArray(v)) {
|
|
129
|
+
if (!foundKeys.has(path)) {
|
|
130
|
+
const hasMatch = v.some(
|
|
131
|
+
(entry) =>
|
|
132
|
+
isRecord(entry) &&
|
|
133
|
+
(entry.id === item.entityId ||
|
|
134
|
+
entry.productId === item.entityId ||
|
|
135
|
+
entry.serviceId === item.entityId),
|
|
136
|
+
);
|
|
137
|
+
if (hasMatch) {
|
|
138
|
+
candidateCollections.push({ key: path, entries: v });
|
|
139
|
+
foundKeys.add(path);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
} else if (isRecord(v) && prefix.split('.').length < 3) {
|
|
143
|
+
findCollectionsWithEntity(v, path);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
findCollectionsWithEntity(result, '');
|
|
148
|
+
|
|
149
|
+
for (const { key, entries } of candidateCollections) {
|
|
150
|
+
const index = entries.findIndex(
|
|
151
|
+
(entry) =>
|
|
152
|
+
isRecord(entry) &&
|
|
153
|
+
(entry.id === item.entityId ||
|
|
154
|
+
entry.productId === item.entityId ||
|
|
155
|
+
entry.serviceId === item.entityId),
|
|
87
156
|
);
|
|
157
|
+
if (index >= 0) {
|
|
158
|
+
result = setContentPath(
|
|
159
|
+
result,
|
|
160
|
+
`${key}[${index}].imageUrl`,
|
|
161
|
+
item.fileUrl,
|
|
162
|
+
);
|
|
163
|
+
if (isRecord(entries[index]) && 'image' in entries[index]) {
|
|
164
|
+
result = setContentPath(
|
|
165
|
+
result,
|
|
166
|
+
`${key}[${index}].image`,
|
|
167
|
+
item.fileUrl,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
88
171
|
}
|
|
89
172
|
}
|
|
90
173
|
return result;
|
|
91
174
|
}
|
|
92
175
|
|
|
93
|
-
/** Backfills linked content-image media only when an older record lacks the field. */
|
|
176
|
+
/** Backfills linked content-image media only when an older record lacks the field or is null. */
|
|
94
177
|
export function applyLinkedContentImages(
|
|
95
178
|
content: Record<string, unknown> | null,
|
|
96
179
|
items: ProjectMediaItem[],
|
|
@@ -107,7 +190,7 @@ export function applyLinkedContentImages(
|
|
|
107
190
|
for (const item of ordered) {
|
|
108
191
|
const linkedPath = item.linkedContentPath!.trim();
|
|
109
192
|
const existing = readContentPath(originalContent, linkedPath);
|
|
110
|
-
if (existing !== undefined) {
|
|
193
|
+
if (existing !== undefined && existing !== null) {
|
|
111
194
|
continue;
|
|
112
195
|
}
|
|
113
196
|
result = setContentPath(result, linkedPath, item.fileUrl);
|
|
@@ -174,7 +257,6 @@ export function buildTemplateValidationSiteData(
|
|
|
174
257
|
structure: null,
|
|
175
258
|
},
|
|
176
259
|
requirements: {
|
|
177
|
-
websiteType: '',
|
|
178
260
|
mainPurpose: '',
|
|
179
261
|
targetCustomers: '',
|
|
180
262
|
preferredLanguage: '',
|
|
@@ -76,6 +76,11 @@ export type TemplateEditorValidationIssue = {
|
|
|
76
76
|
message: string;
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
+
export type CatalogSchemaListCandidate = {
|
|
80
|
+
path: string;
|
|
81
|
+
score: number;
|
|
82
|
+
};
|
|
83
|
+
|
|
79
84
|
export type DuplicateTemplateEditorPath = {
|
|
80
85
|
path: string;
|
|
81
86
|
firstKind: 'field' | 'list';
|
|
@@ -188,13 +193,65 @@ export function normalizeTemplateEditorSchema(
|
|
|
188
193
|
return null;
|
|
189
194
|
}
|
|
190
195
|
|
|
191
|
-
return {
|
|
196
|
+
return makeDatabaseProductListsUnbounded({
|
|
192
197
|
version:
|
|
193
198
|
typeof candidate.version === 'number' &&
|
|
194
199
|
Number.isFinite(candidate.version)
|
|
195
200
|
? candidate.version
|
|
196
201
|
: 1,
|
|
197
202
|
sections,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Products are persisted in shop_products and are intentionally unbounded.
|
|
208
|
+
* Ignore maxItems from older stored manifests so existing projects do not keep
|
|
209
|
+
* an obsolete UI-only catalog cap after the template package is updated.
|
|
210
|
+
*/
|
|
211
|
+
export function makeDatabaseProductListsUnbounded(
|
|
212
|
+
schema: TemplateEditorSchema,
|
|
213
|
+
): TemplateEditorSchema {
|
|
214
|
+
const isProductCollectionPath = (path: string) =>
|
|
215
|
+
/(^|\.)(products?|items?|catalog|menu|dishes?|goods|featuredproducts?|store|foods?|drinks?)$/i.test(
|
|
216
|
+
path.trim(),
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
const mapField = (
|
|
220
|
+
field: TemplateEditorField,
|
|
221
|
+
parentPath: string,
|
|
222
|
+
): TemplateEditorField => {
|
|
223
|
+
const path = appendPath(parentPath, field.key);
|
|
224
|
+
if (field.type === 'object') {
|
|
225
|
+
return {
|
|
226
|
+
...field,
|
|
227
|
+
fields: field.fields.map((child) => mapField(child, path)),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
if (field.type === 'list') {
|
|
231
|
+
const mappedFields = field.fields?.map((child) =>
|
|
232
|
+
mapField(child, `${path}[*]`),
|
|
233
|
+
);
|
|
234
|
+
if (isProductCollectionPath(path)) {
|
|
235
|
+
const { maxItems: _obsoleteMaximum, ...unbounded } = field;
|
|
236
|
+
return { ...unbounded, fields: mappedFields };
|
|
237
|
+
}
|
|
238
|
+
return { ...field, fields: mappedFields };
|
|
239
|
+
}
|
|
240
|
+
return field;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
return {
|
|
244
|
+
...schema,
|
|
245
|
+
sections: schema.sections.map((section) => {
|
|
246
|
+
const mappedFields = section.fields?.map((field) =>
|
|
247
|
+
mapField(field, section.path),
|
|
248
|
+
);
|
|
249
|
+
if (section.type === 'list' && isProductCollectionPath(section.path)) {
|
|
250
|
+
const { maxItems: _obsoleteMaximum, ...unbounded } = section;
|
|
251
|
+
return { ...unbounded, fields: mappedFields };
|
|
252
|
+
}
|
|
253
|
+
return { ...section, fields: mappedFields };
|
|
254
|
+
}),
|
|
198
255
|
};
|
|
199
256
|
}
|
|
200
257
|
|
|
@@ -1724,7 +1781,7 @@ function mergePrimitiveItemFields(
|
|
|
1724
1781
|
};
|
|
1725
1782
|
}
|
|
1726
1783
|
|
|
1727
|
-
function findSchemaSectionAtPath(
|
|
1784
|
+
export function findSchemaSectionAtPath(
|
|
1728
1785
|
schema: TemplateEditorSchema,
|
|
1729
1786
|
targetPath: string,
|
|
1730
1787
|
): TemplateEditorSection | null {
|
|
@@ -1763,7 +1820,11 @@ function findSchemaSectionAtPath(
|
|
|
1763
1820
|
if (field.type === 'list') {
|
|
1764
1821
|
const itemPath = `${normalizeEditorPathPattern(path)}[*]`;
|
|
1765
1822
|
for (const child of field.fields ?? []) {
|
|
1766
|
-
const found = visitField(
|
|
1823
|
+
const found = visitField(
|
|
1824
|
+
child,
|
|
1825
|
+
appendPath(itemPath, child.key),
|
|
1826
|
+
shopOwner,
|
|
1827
|
+
);
|
|
1767
1828
|
if (found) return found;
|
|
1768
1829
|
}
|
|
1769
1830
|
}
|
|
@@ -1802,6 +1863,130 @@ function findSchemaSectionAtPath(
|
|
|
1802
1863
|
return null;
|
|
1803
1864
|
}
|
|
1804
1865
|
|
|
1866
|
+
function collectSchemaListCandidates(
|
|
1867
|
+
schema: TemplateEditorSchema,
|
|
1868
|
+
): Array<{ path: string; node: TemplateEditorSection }> {
|
|
1869
|
+
const candidates: Array<{ path: string; node: TemplateEditorSection }> = [];
|
|
1870
|
+
|
|
1871
|
+
const asSection = (
|
|
1872
|
+
field: TemplateEditorField,
|
|
1873
|
+
path: string,
|
|
1874
|
+
owner: TemplateEditorSection,
|
|
1875
|
+
): TemplateEditorSection => {
|
|
1876
|
+
const { key, ...node } = field;
|
|
1877
|
+
void key;
|
|
1878
|
+
return {
|
|
1879
|
+
...node,
|
|
1880
|
+
id: owner.id,
|
|
1881
|
+
path,
|
|
1882
|
+
pageKey: owner.pageKey,
|
|
1883
|
+
};
|
|
1884
|
+
};
|
|
1885
|
+
|
|
1886
|
+
const visitObjectFields = (
|
|
1887
|
+
fields: TemplateEditorField[],
|
|
1888
|
+
parentPath: string,
|
|
1889
|
+
owner: TemplateEditorSection,
|
|
1890
|
+
) => {
|
|
1891
|
+
for (const field of fields) {
|
|
1892
|
+
const path = appendPath(parentPath, field.key);
|
|
1893
|
+
if (field.type === 'list') {
|
|
1894
|
+
candidates.push({ path, node: asSection(field, path, owner) });
|
|
1895
|
+
continue;
|
|
1896
|
+
}
|
|
1897
|
+
if (field.type === 'object') {
|
|
1898
|
+
visitObjectFields(field.fields, path, owner);
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
for (const section of schema.sections) {
|
|
1904
|
+
if (section.type === 'list') {
|
|
1905
|
+
candidates.push({ path: section.path, node: section });
|
|
1906
|
+
} else if (section.type === 'object') {
|
|
1907
|
+
visitObjectFields(section.fields ?? [], section.path, section);
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
return candidates;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
function catalogListScore(
|
|
1915
|
+
path: string,
|
|
1916
|
+
node: TemplateEditorSection,
|
|
1917
|
+
kind: 'products' | 'services',
|
|
1918
|
+
) {
|
|
1919
|
+
const segments = path
|
|
1920
|
+
.replace(/\[\*\]/g, '')
|
|
1921
|
+
.split('.')
|
|
1922
|
+
.map((part) => part.toLowerCase())
|
|
1923
|
+
.filter(Boolean);
|
|
1924
|
+
const leaf = segments.at(-1) ?? '';
|
|
1925
|
+
const parent = segments.at(-2) ?? '';
|
|
1926
|
+
const fields = node.fields ?? [];
|
|
1927
|
+
const hasPrice = fields.some((field) =>
|
|
1928
|
+
/^(price|currentprice|amount|cost|rate|saleprice|unitprice|productprice)$/i.test(
|
|
1929
|
+
field.key,
|
|
1930
|
+
),
|
|
1931
|
+
);
|
|
1932
|
+
const serviceLeaf =
|
|
1933
|
+
/^(services?|treatments?|offerings?|packages?|plans?)$/.test(leaf);
|
|
1934
|
+
|
|
1935
|
+
if (kind === 'services') {
|
|
1936
|
+
if (!serviceLeaf) return 0;
|
|
1937
|
+
return /^(shop|catalog|menu|store|services?)$/.test(parent) ? 120 : 100;
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
// A priced service list is still a service list, never the product catalog.
|
|
1941
|
+
if (serviceLeaf) return 0;
|
|
1942
|
+
|
|
1943
|
+
if (/^featuredproducts?$/.test(leaf)) return 90;
|
|
1944
|
+
if (/^products?$/.test(leaf)) {
|
|
1945
|
+
if (!parent) return 115;
|
|
1946
|
+
if (/^(shop|catalog|menu|store)$/.test(parent)) return 120;
|
|
1947
|
+
if (parent === 'home') return 100;
|
|
1948
|
+
return 80;
|
|
1949
|
+
}
|
|
1950
|
+
if (/^(dishes?|goods|foods?|drinks?)$/.test(leaf)) {
|
|
1951
|
+
return /^(shop|catalog|menu|store)$/.test(parent) ? 110 : 70;
|
|
1952
|
+
}
|
|
1953
|
+
if (/^items?$/.test(leaf)) {
|
|
1954
|
+
if (!parent || /^(shop|catalog|menu|store)$/.test(parent)) return 100;
|
|
1955
|
+
// Generic promotional lists such as seasonal.items are only a last-resort
|
|
1956
|
+
// catalog candidate. They must not outrank an explicit shop.products list.
|
|
1957
|
+
return hasPrice ? 10 : 0;
|
|
1958
|
+
}
|
|
1959
|
+
if (/^(catalog|menu|store)$/.test(leaf)) return 75;
|
|
1960
|
+
return hasPrice ? 10 : 0;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
/**
|
|
1964
|
+
* Rank database-backed catalog collections declared by a template schema.
|
|
1965
|
+
* Explicit catalog paths beat generic priced lists such as seasonal.items.
|
|
1966
|
+
*/
|
|
1967
|
+
export function getCatalogSchemaListCandidates(
|
|
1968
|
+
schema: TemplateEditorSchema | null | undefined,
|
|
1969
|
+
kind: 'products' | 'services',
|
|
1970
|
+
): CatalogSchemaListCandidate[] {
|
|
1971
|
+
if (!schema) return [];
|
|
1972
|
+
return collectSchemaListCandidates(schema)
|
|
1973
|
+
.map(({ path, node }, order) => ({
|
|
1974
|
+
path,
|
|
1975
|
+
score: catalogListScore(path, node, kind),
|
|
1976
|
+
order,
|
|
1977
|
+
}))
|
|
1978
|
+
.filter((candidate) => candidate.score > 0)
|
|
1979
|
+
.sort((left, right) => right.score - left.score || left.order - right.order)
|
|
1980
|
+
.map(({ path, score }) => ({ path, score }));
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
export function getPreferredCatalogSchemaListPath(
|
|
1984
|
+
schema: TemplateEditorSchema | null | undefined,
|
|
1985
|
+
kind: 'products' | 'services',
|
|
1986
|
+
) {
|
|
1987
|
+
return getCatalogSchemaListCandidates(schema, kind)[0]?.path ?? null;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1805
1990
|
function isDescendantEditorPath(candidate: string, parent: string) {
|
|
1806
1991
|
const normalizedCandidate = normalizeEditorPathPattern(candidate);
|
|
1807
1992
|
const normalizedParent = normalizeEditorPathPattern(parent);
|
|
@@ -2143,7 +2328,7 @@ function hasRequiredNodes(node: TemplateEditorSection | TemplateEditorField) {
|
|
|
2143
2328
|
return false;
|
|
2144
2329
|
}
|
|
2145
2330
|
|
|
2146
|
-
function getValueByPath(content: Record<string, unknown>, path: string) {
|
|
2331
|
+
export function getValueByPath(content: Record<string, unknown>, path: string) {
|
|
2147
2332
|
const parts = path
|
|
2148
2333
|
.split('.')
|
|
2149
2334
|
.map((part) => part.trim())
|
|
@@ -2302,8 +2487,12 @@ export function coercePrimitiveValue(
|
|
|
2302
2487
|
if (trimmed === '') {
|
|
2303
2488
|
return defaultValue !== undefined ? defaultValue : null;
|
|
2304
2489
|
}
|
|
2305
|
-
const
|
|
2306
|
-
|
|
2490
|
+
const cleaned = trimmed.replace(/[^0-9.-]/g, '');
|
|
2491
|
+
const num =
|
|
2492
|
+
cleaned !== '' && cleaned !== '-' && cleaned !== '.'
|
|
2493
|
+
? Number(cleaned)
|
|
2494
|
+
: Number.NaN;
|
|
2495
|
+
if (!Number.isNaN(num) && Number.isFinite(num)) {
|
|
2307
2496
|
return num;
|
|
2308
2497
|
}
|
|
2309
2498
|
}
|
|
@@ -2413,11 +2602,7 @@ function coerceNodeValue(
|
|
|
2413
2602
|
});
|
|
2414
2603
|
}
|
|
2415
2604
|
|
|
2416
|
-
return coercePrimitiveValue(
|
|
2417
|
-
value,
|
|
2418
|
-
node.type as PrimitiveType,
|
|
2419
|
-
defaultVal,
|
|
2420
|
-
);
|
|
2605
|
+
return coercePrimitiveValue(value, node.type as PrimitiveType, defaultVal);
|
|
2421
2606
|
}
|
|
2422
2607
|
|
|
2423
2608
|
function coerceAtDottedPath(
|
|
@@ -2536,3 +2721,95 @@ export function coerceContentTypes(
|
|
|
2536
2721
|
|
|
2537
2722
|
return result;
|
|
2538
2723
|
}
|
|
2724
|
+
|
|
2725
|
+
export function writeDottedPath(
|
|
2726
|
+
target: Record<string, unknown>,
|
|
2727
|
+
path: string,
|
|
2728
|
+
value: unknown,
|
|
2729
|
+
): void {
|
|
2730
|
+
const parts = path
|
|
2731
|
+
.split('.')
|
|
2732
|
+
.map((p) => p.trim())
|
|
2733
|
+
.filter(Boolean);
|
|
2734
|
+
if (parts.length === 0) return;
|
|
2735
|
+
let cursor: Record<string, unknown> = target;
|
|
2736
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
2737
|
+
const part = parts[i];
|
|
2738
|
+
if (
|
|
2739
|
+
!cursor[part] ||
|
|
2740
|
+
typeof cursor[part] !== 'object' ||
|
|
2741
|
+
Array.isArray(cursor[part])
|
|
2742
|
+
) {
|
|
2743
|
+
cursor[part] = {};
|
|
2744
|
+
}
|
|
2745
|
+
cursor = cursor[part] as Record<string, unknown>;
|
|
2746
|
+
}
|
|
2747
|
+
cursor[parts.at(-1)!] = value;
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
/**
|
|
2751
|
+
* Universal schema-aware hydration: writes items into any section or list field
|
|
2752
|
+
* declared in editorSchema that represents products or services, regardless of
|
|
2753
|
+
* developer-chosen naming conventions (e.g. products, shop.products, home.products,
|
|
2754
|
+
* menu.items, catalog.products, store.products).
|
|
2755
|
+
*/
|
|
2756
|
+
export function hydrateSchemaListField(
|
|
2757
|
+
content: Record<string, unknown>,
|
|
2758
|
+
schema: TemplateEditorSchema | null | undefined,
|
|
2759
|
+
fieldKeys: string[],
|
|
2760
|
+
items: Record<string, unknown>[],
|
|
2761
|
+
): void {
|
|
2762
|
+
if (!schema || !Array.isArray(schema.sections)) return;
|
|
2763
|
+
|
|
2764
|
+
const keySet = new Set(fieldKeys.map((k) => k.toLowerCase()));
|
|
2765
|
+
const isProductHydration = keySet.has('products');
|
|
2766
|
+
const isServiceHydration = keySet.has('services');
|
|
2767
|
+
const allowedPaths = new Set(
|
|
2768
|
+
[
|
|
2769
|
+
...(isProductHydration
|
|
2770
|
+
? [getPreferredCatalogSchemaListPath(schema, 'products')]
|
|
2771
|
+
: []),
|
|
2772
|
+
...(isServiceHydration
|
|
2773
|
+
? [getPreferredCatalogSchemaListPath(schema, 'services')]
|
|
2774
|
+
: []),
|
|
2775
|
+
].filter((path): path is string => Boolean(path)),
|
|
2776
|
+
);
|
|
2777
|
+
|
|
2778
|
+
for (const section of schema.sections) {
|
|
2779
|
+
const sectionPath = section.path?.trim() || '';
|
|
2780
|
+
if (!sectionPath) continue;
|
|
2781
|
+
|
|
2782
|
+
// 1. Top-level list section
|
|
2783
|
+
if (section.type === 'list') {
|
|
2784
|
+
if (allowedPaths.has(sectionPath)) {
|
|
2785
|
+
const existing = getValueByPath(content, sectionPath);
|
|
2786
|
+
if (
|
|
2787
|
+
existing === undefined ||
|
|
2788
|
+
existing === null ||
|
|
2789
|
+
Array.isArray(existing)
|
|
2790
|
+
) {
|
|
2791
|
+
writeDottedPath(content, sectionPath, items);
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
// 2. Object section with nested list fields
|
|
2797
|
+
if (section.type === 'object' && Array.isArray(section.fields)) {
|
|
2798
|
+
for (const field of section.fields) {
|
|
2799
|
+
if (field.type !== 'list') continue;
|
|
2800
|
+
const fieldKey = (field as { key: string }).key;
|
|
2801
|
+
const fullPath = sectionPath ? `${sectionPath}.${fieldKey}` : fieldKey;
|
|
2802
|
+
if (allowedPaths.has(fullPath)) {
|
|
2803
|
+
const existing = getValueByPath(content, fullPath);
|
|
2804
|
+
if (
|
|
2805
|
+
existing === undefined ||
|
|
2806
|
+
existing === null ||
|
|
2807
|
+
Array.isArray(existing)
|
|
2808
|
+
) {
|
|
2809
|
+
writeDottedPath(content, fullPath, items);
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// Generated from visual editor bridge (
|
|
4
|
-
module.exports = "var __name=typeof __name==\"function\"?__name:((it,I)=>typeof Object.defineProperty==\"function\"?Object.defineProperty(it,\"name\",{value:I,configurable:!0}):it);(function(I,O,_,C,H){const s=`${[\"MARKET\",\"PLACE\"].join(\"\")}_PREVIEW_`,l=__name(t=>`${s}${t}`,\"previousPreviewMessage\"),y=__name(t=>`__${s}${t}__`,\"previousPreviewStorageKey\"),k=\"FIVORA_PREVIEW_FOCUS_PAGE\",$=l(\"FOCUS_PAGE\"),R=\"FIVORA_PREVIEW_FOCUS_RESULT\",T=l(\"FOCUS_RESULT\"),N=\"FIVORA_PREVIEW_READY\",X=l(\"READY\"),G=\"data-fivora-preview-active-field\",F=\"data-fivora-resolved-field-path\",v=\"data-fivora-empty-editable\",V=\"data-fivora-empty-collection\",B=\"data-preview-list-path\",D=\"data-preview-item-path\",U=\"data-preview-static\",ot=\"__FIVORA_UNIVERSAL_PREVIEW_FOCUS__\",Y=\"__FIVORA_VISUAL_EDITOR_TARGETS__\",f=\"__FIVORA_PREVIEW_PARENT_ORIGIN__\",E=y(\"PARENT_ORIGIN\"),S=\"__FIVORA_PREVIEW_SITE_DATA_CACHE__\",z=y(\"SITE_DATA_CACHE\"),d=\"__FIVORA_PREVIEW_SITE_DATA__\",m=y(\"SITE_DATA\"),b=\"FIVORA_PREVIEW_SITE_DATA\",M=l(\"SITE_DATA\"),Z=\"FIVORA_PREVIEW_SITE_DATA_APPLIED\",at=l(\"SITE_DATA_APPLIED\"),En=\"FIVORA_PREVIEW_CONTENT_PATCH\",xn=l(\"CONTENT_PATCH\"),Cn=\"FIVORA_PREVIEW_STYLE_PATCH\",Pe=\"fivora-template-color-replacements\",Tn=[200],vn=2500,Pn=1600,In=12e3,_n=\"h1, h2, h3, h4, h5, h6, p, span, a, button, address, li, dt, dd, label, strong, em, small\";let Jt=[];const Ie=new Map;let _e=0,Xt=!1,Tt=null,Zt,Qt=[],st=null,P=null,Re=\"\",$e=\"\",Oe=\"\";function gt(){try{window.sessionStorage.removeItem(ot)}catch{}}__name(gt,\"clearPendingFocus\");function te(){try{return window.sessionStorage.getItem(f)||window.sessionStorage.getItem(E)}catch{return null}}__name(te,\"readRememberedParentOrigin\");function ee(t){if(t)try{window.sessionStorage.setItem(f,t)}catch{}}__name(ee,\"rememberParentOrigin\");function Me(){for(const t of Qt)window.clearTimeout(t);Qt=[]}__name(Me,\"clearSiteDataRelayTimers\");function Le(){const t=new Set;dt&&t.add(dt),t.add(window.location.origin);const e=te();e&&t.add(e);try{if(document.referrer){const n=new URL(document.referrer).origin;n&&n!==\"null\"&&t.add(n)}}catch{}try{const n=window.location.ancestorOrigins?.item(0);n&&t.add(n)}catch{}return Array.from(t)}__name(Le,\"collectSiteDataRelayOrigins\");function vt(t,e){const n=Le(),r=e?.fanOut?n:n.slice(0,1);for(const o of r)for(const i of[b,M])try{window.dispatchEvent(new MessageEvent(\"message\",{data:{type:i,siteData:t,__fivoraBridgeRelay:!0},origin:o,source:window.parent}))}catch{}}__name(vt,\"relaySiteDataToTemplateRuntime\");function Pt(t,e){P=t;try{window[d]=t,window[m]=t}catch{}const n=__name(()=>{st=null;try{const r=JSON.stringify(P);window.sessionStorage.setItem(S,r),window.sessionStorage.setItem(z,r)}catch{}},\"writeSessionCache\");if(e?.immediate){st!==null&&(window.clearTimeout(st),st=null),n();return}st!==null&&window.clearTimeout(st),st=window.setTimeout(n,vn)}__name(Pt,\"persistSiteData\");function ke(t){const e=t&&typeof t==\"object\"&&!Array.isArray(t)?t:null,n=e?.requirements&&typeof e.requirements==\"object\"&&!Array.isArray(e.requirements)?e.requirements:null,r=e?.template&&typeof e.template==\"object\"&&!Array.isArray(e.template)?e.template:null,o=r?.structure&&typeof r.structure==\"object\"&&!Array.isArray(r.structure)?r.structure:null;try{return JSON.stringify({requiredPages:n?.requiredPages??null,pages:o?.pages??null,pageDefinitions:r?.pageDefinitions??o?.pageDefinitions??null})}catch{return String(Date.now())}}__name(ke,\"pagesSignature\");let ct=null,lt=null;function Fe(t){const e=[];for(const n of t.matchAll(/([^.[\\]]+)|\\[(\\d+)\\]/g))n[2]!==void 0?e.push(Number(n[2])):n[1]&&e.push(n[1]);return e}__name(Fe,\"parseFieldPath\");function De(t,e,n){if(e.length===0)return t;const r=__name((o,i)=>{const a=e[i],c=i===e.length-1,u=c?void 0:e[i+1];if(typeof a==\"number\"){const A=(Array.isArray(o)?o:[]).slice();if(c)return A[a]=n,A;const L=A[a];return A[a]=L==null||typeof L!=\"object\"?r(typeof u==\"number\"?[]:{},i+1):r(L,i+1),A}const g={...o&&typeof o==\"object\"&&!Array.isArray(o)?o:{}};if(c)return g[a]=n,g;const w=g[a];return g[a]=w==null||typeof w!=\"object\"?r(typeof u==\"number\"?[]:{},i+1):r(w,i+1),g},\"setAt\");return r(t,0)}__name(De,\"setValueAtPath\");function Ne(){return(P&&typeof P==\"object\"&&!Array.isArray(P)?P:{}).content??{}}__name(Ne,\"readPublishedContent\");function ne(t){const n={...P&&typeof P==\"object\"&&!Array.isArray(P)?P:{},content:t};P=n;try{window[d]=n,window[m]=n}catch{}return n}__name(ne,\"writePublishedContent\");function re(){ct!==null&&window.clearTimeout(ct),ct=window.setTimeout(()=>{ct=null,P!=null&&vt(P,{fanOut:!1})},Pn)}__name(re,\"scheduleContentOnlyRelay\");function It(){lt!==null&&window.clearTimeout(lt),lt=window.setTimeout(()=>{if(lt=null,P==null)return;const t=window;if(typeof t.requestIdleCallback==\"function\"){t.requestIdleCallback(()=>{P!=null&&Pt(P,{immediate:!0})},{timeout:4e3});return}Pt(P,{immediate:!0})},In)}__name(It,\"scheduleContentOnlyPersist\");function ie(t,e){const n=Array.from(document.querySelectorAll(`[data-preview-field-path=\"${CSS.escape(t)}\"], [${F}=\"${CSS.escape(t)}\"]`));for(const r of n){if(J?.target===r)continue;if(r.tagName===\"IMG\"){typeof e==\"string\"&&e.trim()&&r.setAttribute(\"src\",e);continue}if(typeof e!=\"string\"&&typeof e!=\"number\"&&typeof e!=\"boolean\")continue;if(r.hasAttribute(\"data-fivora-rating-container\")||r.querySelector(\"[data-fivora-stars-row]\")||r.querySelector(\"[data-fivora-rating-text]\")||t.endsWith(\".rating\")){const i=Math.min(Math.max(Math.round(Number(e)||0),0),5),a=r.querySelector(\"[data-fivora-rating-text]\");a?a.textContent=String(i):r.hasAttribute(\"data-fivora-rating-text\")&&(r.textContent=String(i));const c=r.hasAttribute(\"data-fivora-rating-container\")?r:r.closest(\"[data-fivora-rating-container]\")||r.parentElement;c&&(Array.from(c.querySelectorAll(\"svg\")).forEach((p,g)=>{const h=g<i?\"#fa7014\":\"#dadce0\";p.style.fill=h,p.style.color=h;const A=p.querySelector(\"path\");A&&(A.style.fill=h)}),c.setAttribute(\"data-rating-value\",String(i)));continue}const o=(r.getAttribute(\"data-fivora-value-prefix\")??\"\")+String(e)+(r.getAttribute(\"data-fivora-value-suffix\")??\"\");if(r.childElementCount===0)r.textContent=o;else{const i=Array.from(r.childNodes).find(a=>a.nodeType===Node.TEXT_NODE&&a.textContent?.trim());i?i.textContent=o:r.textContent=o}j&&(o.trim().length===0?r.setAttribute(v,\"true\"):r.removeAttribute(v))}}__name(ie,\"applyDomFieldValue\");function He(t){if(!Array.isArray(t)||t.length===0)return;let e=Ne();for(const n of t){if(!n||typeof n.path!=\"string\"||!n.path.trim())continue;const r=Fe(n.path);r.length!==0&&(e=De(e,r,n.value),ie(n.path,n.value))}ne(e),re(),It()}__name(He,\"publishContentPatches\");function Ve(t){ne(t),re(),It()}__name(Ve,\"publishContentOnly\");function qe(t,e){if(!/^[a-zA-Z0-9_.:\\[\\]-]{1,180}$/.test(t)||!e||typeof e!=\"object\"||Array.isArray(e))return;const n=P&&typeof P==\"object\"&&!Array.isArray(P)?P:{},r=n.template&&typeof n.template==\"object\"&&!Array.isArray(n.template)?n.template:{},o=r.structure&&typeof r.structure==\"object\"&&!Array.isArray(r.structure)?r.structure:{},i=(o.theme&&typeof o.theme==\"object\"&&!Array.isArray(o.theme)?o.theme:r.theme&&typeof r.theme==\"object\"&&!Array.isArray(r.theme)?r.theme:{})||{},a=i.elementStyles&&typeof i.elementStyles==\"object\"&&!Array.isArray(i.elementStyles)?i.elementStyles:{},c={...i,designCustomizationVersion:1,elementStyles:{...a,[t]:e}},u={...r,theme:c,structure:{...o,theme:c}},p={...n,template:u};P=p,wt(p),Ge(t,e),It()}__name(qe,\"publishElementStylePatch\");function Ge(t,e){if(!t||!e||typeof e!=\"object\"||Array.isArray(e))return;const n=e;let r=[];if(t.includes(\":\")){const[i,a]=t.split(\":\");a===\"card\"?r=Array.from(document.querySelectorAll(`[data-preview-list-path=\"${CSS.escape(i)}\"] [data-preview-item-path], [data-preview-list-path=\"${CSS.escape(i)}\"] .card, [data-preview-list-path=\"${CSS.escape(i)}\"] article`)):a&&(r=Array.from(document.querySelectorAll(`[data-preview-list-path=\"${CSS.escape(i)}\"] [data-preview-field-path$=\".${CSS.escape(a)}\"], [data-preview-list-path=\"${CSS.escape(i)}\"] [data-field-path$=\".${CSS.escape(a)}\"]`)))}else r=Array.from(document.querySelectorAll(`[data-preview-field-path=\"${CSS.escape(t)}\"], [data-preview-item-path=\"${CSS.escape(t)}\"], [data-preview-style-target=\"${CSS.escape(t)}\"], [data-field-path=\"${CSS.escape(t)}\"], [data-content-path=\"${CSS.escape(t)}\"]`));const o=__name(i=>i==null||i===\"\"?\"\":typeof i==\"number\"?`${i}px`:String(i),\"toCssVal\");for(const i of r){if(n.color&&(i.style.setProperty(\"color\",String(n.color),\"important\"),i.style.setProperty(\"--deneb-color\",String(n.color))),n.textAlign&&(i.style.setProperty(\"text-align\",String(n.textAlign),\"important\"),i.style.setProperty(\"--deneb-text-align\",String(n.textAlign))),n.fontSize){const a=o(n.fontSize);i.style.setProperty(\"font-size\",a,\"important\"),i.style.setProperty(\"--deneb-font-size\",a)}if(n.fontFamily&&(i.style.setProperty(\"font-family\",String(n.fontFamily),\"important\"),i.style.setProperty(\"--deneb-font-family\",String(n.fontFamily))),n.lineHeight&&(i.style.setProperty(\"line-height\",String(n.lineHeight),\"important\"),i.style.setProperty(\"--deneb-line-height\",String(n.lineHeight))),n.fontWeight&&(i.style.setProperty(\"font-weight\",String(n.fontWeight),\"important\"),i.style.setProperty(\"--deneb-font-weight\",String(n.fontWeight))),n.backgroundColor&&(i.style.setProperty(\"background-color\",String(n.backgroundColor),\"important\"),i.style.setProperty(\"background\",String(n.backgroundColor),\"important\"),i.style.setProperty(\"--deneb-card-bg\",String(n.backgroundColor))),n.borderRadius){const a=o(n.borderRadius);i.style.setProperty(\"border-radius\",a,\"important\"),i.style.setProperty(\"--deneb-card-radius\",a)}if(n.padding){const a=o(n.padding);i.style.setProperty(\"padding\",a,\"important\"),i.style.setProperty(\"--deneb-card-pt\",a)}if(n.boxShadow&&(i.style.setProperty(\"box-shadow\",String(n.boxShadow),\"important\"),i.style.setProperty(\"--deneb-card-shadow\",String(n.boxShadow))),n.borderColor&&(i.style.setProperty(\"border-color\",String(n.borderColor),\"important\"),i.style.setProperty(\"--deneb-card-border-c\",String(n.borderColor))),n.borderWidth){const a=o(n.borderWidth);i.style.setProperty(\"border-width\",a,\"important\"),i.style.setProperty(\"border-style\",\"solid\",\"important\"),i.style.setProperty(\"--deneb-card-border-w\",a)}n.marginTop&&i.style.setProperty(\"margin-top\",o(n.marginTop),\"important\"),n.marginBottom&&i.style.setProperty(\"margin-bottom\",o(n.marginBottom),\"important\"),n.marginLeft&&i.style.setProperty(\"margin-left\",o(n.marginLeft),\"important\"),n.marginRight&&i.style.setProperty(\"margin-right\",o(n.marginRight),\"important\")}}__name(Ge,\"applyElementStyleDirectly\");function _t(t,e){if(e?.contentOnly){const n=t&&typeof t==\"object\"&&!Array.isArray(t)?t:null;Ve(n?.content??t);return}if(ct!==null&&(window.clearTimeout(ct),ct=null),lt!==null&&(window.clearTimeout(lt),lt=null),Xt){Tt=t,Zt=e;return}Xt=!0;try{if(Pt(t,{immediate:e?.persistImmediate}),oe(t),wt(t,{colorReplacements:e?.colorReplacements===!0}),vt(t,{fanOut:e?.fanOut===!0}),e?.scheduleRelays!==!1){Me();for(const n of Tn)Qt.push(window.setTimeout(()=>{P!=null&&vt(P,{fanOut:!0})},n))}}finally{if(Xt=!1,Tt!=null){const n=Tt,r=Zt;Tt=null,Zt=void 0,window.setTimeout(()=>{_t(n,r)},0)}}}__name(_t,\"publishSiteData\");function Be(t){const e=t?.full!==!1,n=\"ontouchstart\"in window||navigator.maxTouchPoints>0||navigator.hardwareConcurrency!=null&&navigator.hardwareConcurrency<=4;window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{try{W({type:Z,full:e}),W({type:at,full:e})}catch{}const r=P;if(r==null)return;const o=__name(()=>wt(r,{colorReplacements:!0}),\"run\");if(!n){window.setTimeout(o,0);return}const i=window.requestIdleCallback;typeof i==\"function\"?i(o,{timeout:4e3}):window.setTimeout(o,1200)})})}__name(Be,\"acknowledgeSiteDataApplied\");const Rn=(()=>{try{return window.location.ancestorOrigins?.item(0)??null}catch{return null}})(),$n=(()=>{try{return window.parent!==window?window.parent.location.origin:null}catch{return null}})();let dt=I({currentOrigin:window.location.origin,referrer:document.referrer,rememberedOrigin:te(),ancestorOrigin:Rn,accessibleParentOrigin:$n});ee(dt);function We(t){if(t.source!==window.parent)return!1;if(dt)return t.origin===dt;try{const e=new URL(t.origin).origin;return e===\"null\"?!1:(dt=e,ee(e),!0)}catch{return!1}}__name(We,\"isTrustedParentMessage\");function W(t){window.parent.postMessage(t,dt??\"*\")}__name(W,\"postToParent\");function mt(t,e,n=0){t.requestId&&(W({type:R,requestId:t.requestId,result:e,fieldPath:t.fieldPath??null,pageRoute:t.pageRoute??null,occurrences:n}),W({type:T,requestId:t.requestId,result:e,fieldPath:t.fieldPath??null,pageRoute:t.pageRoute??null,occurrences:n}))}__name(mt,\"postFocusResult\");function bt(){try{W({type:N,pathname:window.location.pathname}),W({type:X,pathname:window.location.pathname})}catch{}}__name(bt,\"announceReady\");async function je(t){const e=++_e,r=(t&&typeof t==\"object\"&&!Array.isArray(t)?t:null)?.colorReplacements,o=document.getElementById(Pe);if(!r||typeof r!=\"object\"||Array.isArray(r)||Object.keys(r).length===0){o?.remove();return}const i=Array.from(document.querySelectorAll('link[rel=\"stylesheet\"][href]')),a=await Promise.all(i.map(async p=>{const g=p.href;let w=Ie.get(g);if(w===void 0){const A=await fetch(g,{credentials:\"same-origin\"});if(!A.ok)return\"\";w=await A.text(),Ie.set(g,w)}const h=_(w,r);return h===w?\"\":h}));if(e!==_e)return;const c=a.filter(Boolean).join(`\n`);if(!c){o?.remove();return}const u=o instanceof HTMLStyleElement?o:document.createElement(\"style\");u.id=Pe,u.textContent=c,u.isConnected||document.head.appendChild(u)}__name(je,\"applyTemplateColorReplacements\");function wt(t,e){const n=t&&typeof t==\"object\"&&!Array.isArray(t)?t:null,r=n?.template&&typeof n.template==\"object\"&&!Array.isArray(n.template)?n.template:null,o=r?.structure&&typeof r.structure==\"object\"&&!Array.isArray(r.structure)?r.structure:null,i=o?.theme&&typeof o.theme==\"object\"&&!Array.isArray(o.theme)?o.theme:r?.theme&&typeof r.theme==\"object\"&&!Array.isArray(r.theme)?r.theme:null,a=(()=>{try{return JSON.stringify(i??null)}catch{return String(Date.now())}})();if(a!==Re){Re=a;const u=O(i),p=document.getElementById(C);if(!u)p?.remove();else{const g=p instanceof HTMLStyleElement?p:document.createElement(\"style\");g.id=C,g.textContent=u,g.isConnected||document.head.appendChild(g)}}if(e?.colorReplacements){if(a===$e)return;$e=a,je(i).catch(()=>{})}}__name(wt,\"applyUniversalTheme\");function oe(t){const e=ke(t);e!==Oe&&(Oe=e,H(t,document),window.setTimeout(()=>H(t,document),300))}__name(oe,\"applySelectedPages\");function x(t){return String(t??\"\").trim().replace(/\\s+/g,\" \").toLowerCase()}__name(x,\"normalizeText\");function Rt(t){const e=String(t??\"\").trim();if(!e)return[];const n=e.split(/[,;|\\n\\r]+/).map(r=>x(r)).filter(r=>r.length>=3);return Array.from(new Set([x(e),...n])).filter(r=>r.length>=2)}__name(Rt,\"valueFragments\");function $t(t,e){const n=x(e),r=x(t);return/image|photo|logo|banner|thumbnail|cover/.test(n)||/^(https?:|data:|blob:|\\/)/.test(r)}__name($t,\"isImageValue\");function Ue(t){const e=new Set,n=t.getAttribute(\"src\")||\"\";n&&e.add(n),\"src\"in t&&t.src&&e.add(t.src),\"currentSrc\"in t&&t.currentSrc&&e.add(t.currentSrc);const r=t.getAttribute(\"srcset\");r&&r.split(\",\").forEach(o=>{const i=o.trim().split(/\\s+/)[0];i&&e.add(i)});for(const o of[\"data-src\",\"data-original\",\"data-fallback\",\"data-nimg\",\"data-image\",\"data-url\"]){const i=t.getAttribute(o);i&&i!==\"1\"&&e.add(i)}if(t.style.backgroundImage){const o=t.style.backgroundImage.match(/url\\([\"']?([^\"']+)[\"']?\\)/i);o?.[1]&&e.add(o[1])}for(const o of Array.from(e))try{const a=new URL(o,window.location.href).searchParams.get(\"url\");if(a){e.add(a);try{e.add(decodeURIComponent(a))}catch{}}}catch{}return Array.from(e).filter(Boolean)}__name(Ue,\"extractImageCandidates\");function ae(t,e){const n=String(e??\"\").trim();if(!n)return!1;const r=Ue(t);if(r.length===0)return!1;const i=n.split(\"?\")[0].replace(/\\\\/g,\"/\").split(\"/\").pop()?.toLowerCase();for(const a of r){if(a===n)return!0;try{if(new URL(a,window.location.href).href===new URL(n,window.location.href).href)return!0}catch{}if(a.includes(n)||n.includes(a))return!0;try{const p=decodeURIComponent(a);if(p.includes(n)||n.includes(p))return!0}catch{}const u=a.split(\"?\")[0].replace(/\\\\/g,\"/\").split(\"/\").pop()?.toLowerCase();if(u&&i&&u.length>=3&&u===i)return!0}return!1}__name(ae,\"imageMatchesValue\");function se(t,e){return Array.from(t.querySelectorAll(\"img\")).filter(n=>ae(n,e))}__name(se,\"findImageMatches\");function Ot(t,e){const n=String(e??\"\").trim();return n?[t.getAttribute(\"href\"),t.getAttribute(\"src\"),t.getAttribute(\"poster\"),t.getAttribute(\"srcset\"),t.style.backgroundImage].filter(o=>!!o).some(o=>{if(o===n||o.includes(n))return!0;try{return new URL(o,window.location.href).href===new URL(n,window.location.href).href}catch{return!1}}):!1}__name(Ot,\"attributeMatchesValue\");function Mt(t,e){return Array.from(t.querySelectorAll('a[href], img[src], source[src], video[poster], [style*=\"background-image\"]')).filter(n=>Ot(n,e))}__name(Mt,\"findAttributeMatches\");function ze(t,e){const n=Rt(e);if(n.length===0)return[];const r=Array.from(t.querySelectorAll(_n)),o=r.filter(i=>{const a=x(i.textContent);return n.some(c=>a===c)});return o.length>0?o:r.filter(i=>{const a=x(i.textContent);return n.some(c=>a.includes(c)||c.includes(a))})}__name(ze,\"findTextMatches\");function Lt(t,e,n){if($t(e,n)){const r=se(t,e);if(r.length>0)return r}return ze(t,e)}__name(Lt,\"findValueMatches\");function Ke(t,e,n){if($t(e,n)&&se(t,e).length>0)return!0;const r=x(t.textContent);return Rt(e).some(o=>r.includes(o))}__name(Ke,\"subtreeContainsValue\");function Ye(t,e){const n=t[0];if(!n)return null;let r=n;for(;r;){if(t.every(o=>r?.contains(o)))return r;if(r===e)break;r=r.parentElement}return e??n}__name(Ye,\"lowestCommonAncestor\");function ut(t){const e=String(t??\"\").trim();if(!e)return[];const n=e.replace(/\\[(\\d+)\\]/g,\".$1\"),r=n.replace(/\\.(\\d+)(?=\\.|$)/g,\"[$1]\");return Array.from(new Set([e,n,r]))}__name(ut,\"pathVariants\");function ce(t){return Array.from(new Set([t.fieldPath,...t.fieldPaths??[]].filter(e=>!!(e&&e.trim())).flatMap(e=>ut(e))))}__name(ce,\"focusPathCandidates\");function At(t){if(t.closest(\"[hidden]\"))return!1;let e=t;for(;e&&e!==document.documentElement;){const r=window.getComputedStyle(e);if(r.display===\"none\"||r.visibility===\"hidden\"||Number(r.opacity)===0||r.maxHeight===\"0px\"||r.maxHeight===\"0\")return!1;const o=e.getBoundingClientRect();if((r.overflow===\"hidden\"||r.overflow===\"clip\")&&(o.width<2||o.height<2))return!1;e=e.parentElement}const n=t.getBoundingClientRect();return n.width>=2&&n.height>=2}__name(At,\"isVisuallyHighlightable\");function le(t){let e=0;At(t)&&(e+=100);const n=x(t.textContent);n.length>=2&&(e+=40),t.tagName===\"IMG\"&&(e+=35),t.closest(\"main, footer, header, [data-preview-page-key]\")&&(e+=20),t.closest('.fixed, [class*=\"fixed\"]')&&n.length<2&&t.tagName!==\"IMG\"&&(e-=25);const r=t.getBoundingClientRect();return e+=Math.min(15,Math.floor(r.width*r.height/400)),e}__name(le,\"highlightTargetScore\");function de(t){return[...t].sort((e,n)=>le(n)-le(e))}__name(de,\"rankHighlightTargets\");function Je(t,e){const n=[],r=Array.from(new Set([t,...e??[]].filter(a=>!!a).flatMap(a=>ut(a))));for(const a of r){const c=CSS.escape(a);document.querySelectorAll('[data-preview-field-path=\"'+c+'\"], [data-preview-list-path=\"'+c+'\"], [data-content-path=\"'+c+'\"]').forEach(u=>{n.includes(u)||n.push(u)})}const o=de(n.filter(a=>At(a))),i=o.filter(a=>!o.some(c=>c!==a&&a.contains(c)));return i.length>0?i:o}__name(Je,\"findExplicitTargets\");function ue(t){const e=(t?.itemValues??[]).filter(i=>x(i.value).length>=2&&i.key!==\"id\");if(e.length===0)return null;const n=[];for(const i of e)for(const a of Lt(document,i.value,i.key).slice(0,8))n.includes(a)||n.push(a);let r=null;for(const i of n){let a=i,c=0;for(;a&&a!==document.body&&c<12;){const u=e.reduce((w,h)=>w+(Ke(a,h.value,h.key)?1:0),0),p=a.getBoundingClientRect(),g=Math.max(1,p.width*p.height);(!r||u>r.score||u===r.score&&g<r.area)&&(r={target:a,score:u,area:g}),a=a.parentElement,c+=1}}const o=Math.min(2,e.length);return r&&r.score>=o?r.target:null}__name(ue,\"findItemContainer\");function kt(t,e,n){const r=Lt(t,e,n);if(r.length===0)return null;const o=Rt(e);if(o.length>1&&!$t(e,n)){const i=r.filter(a=>{const c=x(a.textContent);return o.slice(1).some(u=>c===u)});if(i.length>1)return Ye(i,t instanceof HTMLElement?t:null)}return r.sort((i,a)=>x(i.textContent).length-x(a.textContent).length)[0]}__name(kt,\"findFieldTarget\");function Ft(t,e){const n=String(t??e??\"\").trim().toLowerCase().replace(/\\s+/g,\"_\");return!n||n===\"common\"?\"home\":n===\"about\"?\"about_us\":n}__name(Ft,\"normalizePageKey\");function Xe(t){const e=t.replace(/_us$/,\"\"),n=['[data-preview-page-key=\"'+CSS.escape(t)+'\"]','[data-preview-page-key=\"'+CSS.escape(e)+'\"]',\"#\"+CSS.escape(t)+\"_view\",\"#\"+CSS.escape(e)+\"_view\",\"#\"+CSS.escape(t),\"#\"+CSS.escape(e),\"main\",\"body\"];for(const r of n){const o=document.querySelector(r);if(o instanceof HTMLElement)return o}return null}__name(Xe,\"findPageTarget\");function fe(t,e){const n=window.location.pathname.match(/^(\\/uploads\\/generated-sites\\/(?:template-preview|preview|live)\\/[^/]+)/),r=String(e??\"\").trim(),o=r?\"/\"+r.replace(/^\\/+|\\/+$/g,\"\"):null,i=o!==null?o===\"/\"?\"\":o:t===\"home\"?\"\":\"/\"+t.replace(/^\\/+/,\"\");return n?n[1]+i:i||\"/\"}__name(fe,\"resolvePath\");function pe(){for(const t of Jt)t.target.style.outline=t.outline,t.target.style.outlineOffset=t.outlineOffset,t.target.style.boxShadow=t.boxShadow,t.target.style.transition=t.transition,t.target.style.scrollMarginTop=t.scrollMarginTop,t.target.style.borderRadius=t.borderRadius,t.target.removeAttribute(G);Jt=[]}__name(pe,\"clearHighlight\");function Dt(t,e){pe(),Jt=t.map(n=>({target:n,outline:n.style.outline,outlineOffset:n.style.outlineOffset,boxShadow:n.style.boxShadow,transition:n.style.transition,scrollMarginTop:n.style.scrollMarginTop,borderRadius:n.style.borderRadius}));for(const n of t)n.setAttribute(G,\"true\"),n.style.scrollMarginTop=\"72px\",n.style.transition=\"outline-color 0.2s ease, box-shadow 0.2s ease\",n.style.outline=\"2px solid rgba(34, 197, 94, 0.98)\",n.style.outlineOffset=\"4px\",n.style.boxShadow=\"0 0 0 7px rgba(34, 197, 94, 0.2)\",n.style.borderRadius||(n.style.borderRadius=\"4px\");t[0]?.scrollIntoView({behavior:\"smooth\",block:e?\"start\":\"center\",inline:\"nearest\"})}__name(Dt,\"highlightTargets\");function Ze(t,e){Dt([t],e)}__name(Ze,\"highlight\");function Nt(t){return Array.from(new Set([t.fieldValue,...t.fieldMatchValues??[]].filter(e=>typeof e==\"boolean\"||typeof e==\"number\"||typeof e==\"string\"&&e.trim().length>0).map(e=>String(e))))}__name(Nt,\"focusMatchValues\");function Qe(t){const e=ce(t);if(e.length===0)return null;try{const n=JSON.parse(window.sessionStorage.getItem(Y)??\"{}\");for(const r of e){const o=n[`${window.location.pathname}|${r}`];if(!o)continue;const i=document.querySelector(o);if(!i)continue;const a=Nt(t).map(x),c=x(i.textContent);if(!(a.length>0&&c&&!a.some(u=>c===u||c.includes(u)||Ot(i,u))))return i}return null}catch{return null}}__name(Qe,\"findRememberedFocusTarget\");function St(t){if(!t)return null;if(At(t))return t;let e=t.parentElement;for(;e&&e!==document.body;){if(At(e))return e;e=e.parentElement}return null}__name(St,\"pickVisibleHeuristicTarget\");function ge(t){const e=ce(t),n=Je(t.fieldPath,e.filter(a=>a!==t.fieldPath));if(n.length>0)return{targets:n,result:\"exact\"};const r=St(Qe(t));if(r)return{targets:[r],result:\"heuristic\"};const o=ue(t.fieldContext),i=t.fieldContext?.fieldKey;if(o){for(const c of Nt(t)){const u=St(Mt(o,c)[0]??kt(o,c,i));if(u)return{targets:[u],result:\"heuristic\"}}const a=St(o);if(a)return{targets:[a],result:\"heuristic\"}}for(const a of Nt(t)){const c=Mt(document,a),u=kt(document,a,i),p=u?[...c,u]:c,g=de(p.map(w=>St(w)).filter(w=>!!w));if(g.length>0)return{targets:[g[0]],result:\"heuristic\"}}return null}__name(ge,\"resolveFieldTarget\");function me(){document.documentElement.dataset.fivoraPreview=\"true\",document.querySelectorAll(\".reveal-on-scroll:not(.reveal-active)\").forEach(t=>t.classList.add(\"reveal-active\"))}__name(me,\"activateRevealNodes\");function ft(t,e=0){me();const n=!!t.fieldPath;if(t.focusOnly&&n){const a=ge(t);if(a){Dt(a.targets,!1),mt(t,a.result,a.targets.length);return}if(e<12){window.setTimeout(()=>ft(t,e+1),120);return}mt(t,\"missing\");return}const r=Ft(t.pageKey,t.pageLabel),o=Xe(r);if(!o){e<12?window.setTimeout(()=>ft(t,e+1),120):mt(t,\"missing\");return}const i=n?ge(t):null;if(n&&!i&&e<12){window.setTimeout(()=>ft(t,e+1),120);return}i?(Dt(i.targets,!1),mt(t,i.result,i.targets.length)):(Ze(o,!0),mt(t,\"page\",1))}__name(ft,\"applyFocus\");function tn(t){if(t.focusOnly){gt(),window.setTimeout(()=>ft(t),80);return}const e=Ft(t.pageKey,t.pageLabel),n=fe(e,t.pageRoute);if((window.location.pathname.replace(/\\/+$/,\"\")||\"/\")!==n){try{window.sessionStorage.setItem(ot,JSON.stringify({...t,awaitingNavigation:!0}))}catch{}window.location.assign(n);return}gt(),window.setTimeout(()=>ft(t),80)}__name(tn,\"handleFocus\");function he(t){return x(t).replace(/\\.html$/i,\"\").replace(/[^a-z0-9]+/g,\"-\")}__name(he,\"normalizeRouteToken\");function en(){const t=window.location.pathname.split(\"/\").map(i=>decodeURIComponent(i).trim()).filter(Boolean);if(t.length<2||q.length===0)return;const e=q.filter(i=>{const a=i.context;if(!a?.collectionPath||!a.fieldKey)return!1;const c=a.collectionPath.split(\".\").at(-1)??\"\",u=t.lastIndexOf(c);if(u<0||u>=t.length-1)return!1;const p=he(t.at(-1)??\"\");return a.itemValues.some(({key:g,value:w})=>{const h=x(g).replace(/[^a-z0-9]/g,\"\");return h!==\"id\"&&!h.endsWith(\"id\")&&h!==\"slug\"&&h!==\"name\"&&h!==\"title\"?!1:he(w)===p})});if(e.length===0)return;const n=Array.from(document.querySelectorAll(`[${U}]`)),r=[];for(const i of e){const a=i.context,c=a.fieldKey,u=x(c).replace(/[^a-z0-9]/g,\"\");if(u===\"slug\"||u===\"identifier\"||u.endsWith(\"id\"))continue;const p=a.collectionPath.split(\".\").at(-1)??\"\",g=x(p).replace(/s$/,\"\"),w=c.replace(/([a-z0-9])([A-Z])/g,\"$1 $2\").split(/[^a-z0-9]+/i).map(x).filter(A=>A&&![\"url\",\"text\",\"value\"].includes(A)),h=x(i.value);for(const A of n){const L=x(A.getAttribute(U));if(!L||!L.includes(g))continue;let K=0;const Wt=w.filter(et=>L.includes(et));Wt.length>0&&(K+=40+Wt.length*5);const jt=A.tagName===\"IMG\"?x(A.getAttribute(\"src\")??A.getAttribute(\"alt\")):x(A.textContent);h&&jt===h?K+=120:h.length>=3&&jt.includes(h)&&(K+=80),/image|photo|logo|banner|thumbnail|cover/i.test(c)&&A.tagName===\"IMG\"&&L.includes(\"image\")&&(K+=120),K>=40&&r.push({element:A,field:i,score:K})}}r.sort((i,a)=>a.score-i.score);const o=new Set;for(const{element:i,field:a}of r)if(!o.has(i)){if(o.add(i),i.tagName!==\"IMG\"){const c=i.textContent??\"\",u=String(a.value??\"\"),p=c.toLowerCase().indexOf(u.toLowerCase());u&&p>=0&&c!==u&&(i.setAttribute(\"data-fivora-value-prefix\",c.slice(0,p)),i.setAttribute(\"data-fivora-value-suffix\",c.slice(p+u.length)))}i.removeAttribute(U),i.setAttribute(\"data-preview-field-path\",a.path),ie(a.path,a.value)}}__name(en,\"promoteActiveRouteDetailFields\");const On=\"FIVORA_PREVIEW_ELEMENT_CLICKED\",Mn=l(\"ELEMENT_CLICKED\"),Ln=\"FIVORA_PREVIEW_FIELD_CHANGED\",kn=l(\"FIELD_CHANGED\"),Fn=\"FIVORA_PREVIEW_EDIT_MODE\",Dn=l(\"EDIT_MODE\"),Nn=\"FIVORA_PREVIEW_FLUSH_EDIT\",Hn=l(\"FLUSH_EDIT\"),Vn=\"FIVORA_PREVIEW_EDIT_FLUSHED\",qn=l(\"EDIT_FLUSHED\"),Gn=\"h1, h2, h3, h4, h5, h6, p, span, a, button, address, li, dt, dd, label, strong, em, small, img\",Ht=\"ontouchstart\"in window||navigator.maxTouchPoints>0||window.matchMedia&&window.matchMedia(\"(pointer: coarse)\").matches,Xn=(()=>{const t=navigator.userAgent||\"\",e=navigator.vendor||\"\";if(/iP(ad|hone|od)/i.test(t)||/Safari/i.test(t)&&/Apple Computer/i.test(e)&&!/Chrom(e|ium)/i.test(t))return!0;try{return!!window.safari}catch{return!1}})(),Bn=(()=>{try{const t=document.createElement(\"div\");return t.setAttribute(\"contenteditable\",\"plaintext-only\"),t.contentEditable===\"plaintext-only\"}catch{return!1}})(),Wn=Ht||navigator.hardwareConcurrency!=null&&navigator.hardwareConcurrency<=4||typeof navigator.deviceMemory==\"number\"&&(navigator.deviceMemory??8)<=4,jn=!0;let q=[];window.addEventListener(\"message\",t=>{if(!We(t)||t.data&&typeof t.data==\"object\"&&t.data.__fivoraBridgeRelay===!0)return;if(t.data?.type===k||t.data?.type===$){t.stopImmediatePropagation(),tn(t.data);return}if((t.data?.type===b||t.data?.type===M)&&t.data.siteData){const a=t.data.full!==!1;if(t.data.contentOnly===!0){_t(t.data.siteData,{contentOnly:!0});return}_t(t.data.siteData,{fanOut:!1,colorReplacements:!1}),Be({full:a});return}if(t.data?.type===En||t.data?.type===xn){const a=t.data.patches;Array.isArray(a)&&He(a);return}if(t.data?.type===Cn||t.data?.type===\"DENEB_PREVIEW_STYLE_PATCH\"){const a=t.data,c=typeof a.fieldPath==\"string\"?a.fieldPath:typeof a.targetPath==\"string\"?a.targetPath:\"\",u=a.styles??a.properties;c&&u&&qe(c,u);return}if(t.data?.type===Fn||t.data?.type===Dn){q=Array.isArray(t.data.fields)?t.data.fields:[],en(),t.data.editMode?(yn(),window.setTimeout(()=>we(),50)):bn();return}(t.data?.type===Nn||t.data?.type===Hn)&&(pt(!0),W({type:Vn,requestId:t.data.requestId}),W({type:qn,requestId:t.data.requestId}))},!0);try{const t=JSON.parse(window.sessionStorage.getItem(ot)??\"null\");if(t?.awaitingNavigation){const e=Ft(t.pageKey,t.pageLabel),n=fe(e,t.pageRoute),r=window.location.pathname.replace(/\\/+$/,\"\")||\"/\";gt(),r===n&&window.setTimeout(()=>ft(t),220)}else t&>()}catch{gt()}try{const t=JSON.parse(window.sessionStorage.getItem(S)??window.sessionStorage.getItem(z)??\"null\");if(t){P=t;try{window[d]=t,window[m]=t}catch{}Wn||(oe(t),wt(t,{colorReplacements:!1}))}}catch{}let j=!1,Q=null,nt=null,Vt=null,J=null,Et=[],rt=null;function ye(){if(document.querySelector(\"[data-fivora-empty-editable-styles]\"))return;const t=document.createElement(\"style\");t.setAttribute(\"data-fivora-empty-editable-styles\",\"true\"),t.textContent=`\n [${v}=\"true\"] {\n min-width: 7rem !important;\n min-height: 1.25em !important;\n outline: 1px dashed rgba(37, 99, 235, 0.28) !important;\n outline-offset: 3px !important;\n }\n span[${v}=\"true\"],\n a[${v}=\"true\"],\n strong[${v}=\"true\"],\n em[${v}=\"true\"],\n small[${v}=\"true\"],\n label[${v}=\"true\"] {\n display: inline-block !important;\n }\n [${v}=\"true\"]:empty::before {\n content: \"\";\n color: rgba(37, 99, 235, 0.78);\n font: 500 12px/1.4 system-ui, sans-serif;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n }\n [${v}=\"true\"]:empty:hover::before {\n content: \"Click to add text\";\n }\n [${V}=\"true\"] {\n min-width: 10rem !important;\n min-height: 3.5rem !important;\n outline: 1px dashed rgba(37, 99, 235, 0.28) !important;\n outline-offset: 3px !important;\n }\n [${V}=\"true\"]:empty::before {\n content: \"\";\n display: inline-flex;\n align-items: center;\n min-height: 3.5rem;\n color: rgba(37, 99, 235, 0.78);\n font: 500 12px/1.4 system-ui, sans-serif;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n }\n [${V}=\"true\"]:empty:hover::before {\n content: \"Click to add the first item\";\n }\n `,document.head.appendChild(t)}__name(ye,\"ensureEmptyEditableStyles\");function nn(t){if(t.id)return\"#\"+CSS.escape(t.id);const e=[];let n=t;for(;n&&n!==document.body;){const r=n.tagName.toLowerCase(),o=n.parentElement?Array.from(n.parentElement.children).filter(a=>a.tagName===n?.tagName):[],i=o.indexOf(n)+1;e.unshift(o.length>1?`${r}:nth-of-type(${i})`:r),n=n.parentElement}return e.length>0?`body > ${e.join(\" > \")}`:\"\"}__name(nn,\"buildStructuralSelector\");function qt(){try{const t=JSON.parse(window.sessionStorage.getItem(Y)??\"{}\");return t&&typeof t==\"object\"?t:{}}catch{return{}}}__name(qt,\"readResolvedTargetSelectors\");function rn(t,e){const n=nn(t);if(!n)return;const r=qt();r[`${window.location.pathname}|${e}`]=n;try{window.sessionStorage.setItem(Y,JSON.stringify(r))}catch{}}__name(rn,\"rememberResolvedTarget\");function Un(){const t=qt(),e=`${window.location.pathname}|`;let n=!1;for(const r of Object.keys(t))r.startsWith(e)&&(delete t[r],n=!0);if(n)try{window.sessionStorage.setItem(Y,JSON.stringify(t))}catch{}}__name(Un,\"forgetResolvedTargetsForCurrentPage\");function zn(t,e){let n=document.getElementById(\"fivora-dynamic-empty-styles\");n||(n=document.createElement(\"style\"),n.id=\"fivora-dynamic-empty-styles\",document.head.appendChild(n));const r=[];targetRegistry.getDynamicTargets().forEach((c,u)=>{const p=\"fivora-target-\"+u;c.hasAttribute(\"data-fivora-id\")||c.setAttribute(\"data-fivora-id\",p)});const o=__name(c=>{const u=[];for(const p of c){const g=CSS.escape(p);u.push(`[data-preview-field-path=\"${g}\"]`),u.push(`[data-preview-list-path=\"${g}\"]`),targetRegistry.findTargets(p).forEach(w=>{const h=w.getAttribute(\"data-fivora-id\");h&&u.push(`[data-fivora-id=\"${CSS.escape(h)}\"]`)})}return u.length>0?u.join(\", \"):null},\"buildSelectors\"),i=o(t);i&&r.push(`\n ${i} {\n min-width: 7rem !important;\n min-height: 1.25em !important;\n outline: 1px dashed rgba(37, 99, 235, 0.28) !important;\n outline-offset: 3px !important;\n }\n ${i.replace(/,/g,\":empty::before,\")} :empty::before {\n content: \"\";\n color: rgba(37, 99, 235, 0.78);\n font: 500 12px/1.4 system-ui, sans-serif;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n }\n ${i.replace(/,/g,\":empty:hover::before,\")} :empty:hover::before {\n content: \"Click to add text\";\n }\n `);const a=o(e);a&&r.push(`\n ${a} {\n min-width: 10rem !important;\n min-height: 3.5rem !important;\n outline: 1px dashed rgba(37, 99, 235, 0.28) !important;\n outline-offset: 3px !important;\n }\n ${a.replace(/,/g,\":empty::before,\")} :empty::before {\n content: \"\";\n display: inline-flex;\n align-items: center;\n min-height: 3.5rem;\n color: rgba(37, 99, 235, 0.78);\n font: 500 12px/1.4 system-ui, sans-serif;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n }\n ${a.replace(/,/g,\":empty:hover::before,\")} :empty:hover::before {\n content: \"Click to add the first item\";\n }\n `),n.textContent=r.join(`\n`)}__name(zn,\"updateDynamicStyles\");function be(){document.querySelectorAll(`[${F}]`).forEach(t=>{J?.target!==t&&(t.removeAttribute(F),t.removeAttribute(v),t.removeAttribute(V))})}__name(be,\"clearResolvedEditableTargets\");function ht(t,e,n=!0){const r=targetRegistry.getPath(t),o=t.getAttribute(\"data-preview-field-path\")??t.getAttribute(B)??t.getAttribute(\"data-content-path\")??t.getAttribute(\"data-field-path\");if(r&&r!==e.path&&o!==e.path)return!1;t.setAttribute(F,e.path);const i=String(e.value??\"\").trim().length===0&&x(t.textContent).length===0;j&&i&&t.tagName!==\"IMG\"?t.setAttribute(v,\"true\"):t.removeAttribute(v);const a=e.kind===\"collection\"||e.type===\"list\",c=e.collection?.length;return j&&a&&(c===0||t.childElementCount===0)?(t.setAttribute(V,\"true\"),t.removeAttribute(v)):t.removeAttribute(V),n&&!a&&rn(t,e.path),!0}__name(ht,\"annotateEditableTarget\");function tt(t){const e=[t.value,...t.matchValues??[]].filter(n=>typeof n==\"number\"||typeof n==\"string\"&&n.trim().length>0);return Array.from(new Set(e.map(n=>String(n))))}__name(tt,\"editableFieldMatchValues\");function on(t){for(const e of ut(t)){const n=CSS.escape(e),r=document.querySelector(`[data-preview-field-path=\"${n}\"], [${B}=\"${n}\"], [data-content-path=\"${n}\"], [data-field-path=\"${n}\"], [${F}=\"${n}\"]`);if(r)return r}return null}__name(on,\"findExplicitEditableTarget\");function an(t){if(t.kind===\"collection\"||t.type===\"list\")return null;const n=qt()[`${window.location.pathname}|${t.path}`];if(!n)return null;try{const r=document.querySelector(n);if(!r)return null;const o=tt(t).map(x),i=x(r.textContent);return o.length>0&&i&&!o.includes(i)?null:(ht(r,t,!1),r)}catch{return null}}__name(an,\"restoreRememberedTarget\");function sn(t){if(t.kind===\"collection\"||t.type===\"list\")return null;const n=(t.context?ue({collectionPath:t.context.collectionPath,itemIndex:t.context.itemIndex,fieldKey:t.context.fieldKey,itemValues:t.context.itemValues}):null)??document;for(const r of tt(t)){const o=kt(n,r,t.context?.fieldKey),i=[...Mt(n,r),...o?[o]:[],...Lt(n,r,t.context?.fieldKey)];for(const a of i){if(a.closest(`[${U}]`))continue;const c=a.getAttribute(F);if(!c||c===t.path)return a}}return null}__name(sn,\"inferEditableTarget\");function cn(t){if(j){ye(),me();for(const e of q){const n=on(e.path)??an(e)??(t?.explicitOnly?null:sn(e));n&&ht(n,e)}}}__name(cn,\"indexEditableTargets\");let Gt=!1;function we(){for(const e of Et)window.clearTimeout(e);if(Et=[],rt!==null){const e=window.cancelIdleCallback;typeof e==\"function\"?e(rt):window.clearTimeout(rt),rt=null}if(Gt)return;Gt=!0;const t=__name((e,n)=>{n&&(Gt=!1),e&&be(),cn({explicitOnly:e})},\"runPass\");Et=[window.setTimeout(()=>{t(!0,!0)},0)]}__name(we,\"scheduleEditableTargetIndex\");function ln(){const t=document.createElement(\"div\");return t.setAttribute(\"data-fivora-edit-badge\",\"true\"),t.innerHTML=\"\\u270F\\uFE0F\",Object.assign(t.style,{position:\"fixed\",zIndex:\"2147483647\",width:\"28px\",height:\"28px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:\"14px\",borderRadius:\"8px\",background:\"rgba(37, 99, 235, 0.92)\",color:\"#fff\",cursor:\"pointer\",pointerEvents:\"auto\",boxShadow:\"0 2px 8px rgba(0,0,0,0.18)\",opacity:\"0\",transition:\"opacity 0.15s ease\",userSelect:\"none\"}),t.setAttribute(\"title\",\"Edit this content\"),t.setAttribute(\"aria-label\",\"Edit this content\"),document.body.appendChild(t),t}__name(ln,\"createHoverBadge\");function dn(t){if(!Q)return;const e=t.getBoundingClientRect();Q.style.top=`${Math.max(4,e.top-4)}px`,Q.style.left=`${Math.min(window.innerWidth-36,e.right-32)}px`,Q.style.opacity=\"1\"}__name(dn,\"positionBadge\");function xt(){Vt&&(Vt(),Vt=null),Q&&(Q.style.opacity=\"0\"),nt=null}__name(xt,\"clearHoverOverlay\");function un(t){if(t===nt)return;xt(),nt=t;const e=t.style.outline,n=t.style.outlineOffset,r=t.style.cursor;t.style.outline=\"2px dashed rgba(37, 99, 235, 0.6)\",t.style.outlineOffset=\"2px\",t.style.cursor=\"pointer\",Vt=__name(()=>{t.style.outline=e,t.style.outlineOffset=n,t.style.cursor=r},\"hoverOutlineCleanup\"),dn(t)}__name(un,\"applyHoverOverlay\");function Ae(t){let e=t instanceof Element?t:null;for(;e&&!(e instanceof HTMLElement);)e=e.parentElement;let n=e;for(;n&&n!==document.body;){if(n.hasAttribute(U)){n=n.parentElement;continue}if(n.hasAttribute(\"data-preview-field-path\")||n.hasAttribute(B)||n.hasAttribute(D)||n.hasAttribute(\"data-content-path\")||n.hasAttribute(\"data-field-path\")||n.hasAttribute(F)||n.matches(Gn)){const o=Bt(n);if(o)return{element:n,field:o}}n=n.parentElement}return null}__name(Ae,\"findEditableTarget\");function Bt(t){if(t.closest(`[${U}]`))return null;const e=t.getAttribute(\"data-preview-field-path\")??t.getAttribute(\"data-content-path\")??t.getAttribute(\"data-field-path\")??targetRegistry.getPath(t);if(e)return q.find(g=>ut(g.path).includes(e))??{path:e,label:e.split(\".\").pop()??\"Content\",type:t.tagName===\"IMG\"?\"image\":\"text\",value:t.tagName===\"IMG\"?t.src:t.textContent?.trim()??\"\"};const n=t.getAttribute(D);if(n){const p=n.match(/^(.+)\\[(\\d+)\\]$/);if(p){const g=p[1],w=Number(p[2]),h=q.find(A=>(A.kind===\"collection\"||A.type===\"list\")&&ut(A.path).includes(g));if(h)return{...h,collection:{listPath:g,itemIndex:w,length:h.collection?.length??0,minItems:h.collection?.minItems,maxItems:h.collection?.maxItems,itemLabel:h.collection?.itemLabel}}}}const r=t.getAttribute(B);if(r)return q.find(g=>(g.kind===\"collection\"||g.type===\"list\")&&ut(g.path).includes(r))??{kind:\"collection\",path:r,label:r.split(\".\").pop()??\"Collection\",type:\"list\",value:0,collection:{listPath:r,length:t.children.length}};const o=t.tagName===\"IMG\"?t:t.querySelector(\"img\");if(o){const p=q.find(h=>h.type===\"image\"&&tt(h).some(A=>ae(o,A)));if(p)return p;const g=Se(o);if(g.collectionPath&&typeof g.itemIndex==\"number\"){const h=q.find(A=>A.type===\"image\"&&A.context?.collectionPath===g.collectionPath&&A.context?.itemIndex===g.itemIndex);if(h)return h}const w=o.closest('section, article, [data-preview-page-key], main, header, footer, .card, [class*=\"section\"]');if(w){const h=w.getAttribute(\"data-preview-field-path\")||w.getAttribute(\"data-content-path\")||w.getAttribute(\"data-field-path\")||w.getAttribute(F);if(h){const A=h.split(\".\")[0],L=q.find(K=>K.type===\"image\"&&(K.path.startsWith(`${A}.`)||K.path.startsWith(`${h}.`)));if(L)return L}}if(t.tagName===\"IMG\"){const h=q.filter(L=>L.type===\"image\");if(h.length===1)return h[0];const A=o.getAttribute(\"src\")||o.src||\"\";return{path:e||\"image\",label:(e||\"\").split(\".\").pop()||\"Image\",type:\"image\",value:A}}}const i=q.filter(p=>tt(p).some(g=>Ot(t,g)));if(i.length===1)return i[0];const a=x(t.textContent);if(!a)return null;const c=q.filter(p=>typeof p.value!=\"boolean\"&&tt(p).some(g=>x(g)===a));if(c.length===1)return c[0];const u=q.filter(p=>typeof p.value==\"boolean\"?!1:tt(p).some(g=>{const w=x(g);return w.length>=3&&a.includes(w)})).sort((p,g)=>Math.max(...tt(g).map(w=>x(w).length),0)-Math.max(...tt(p).map(w=>x(w).length),0));return u.length===1?u[0]:null}__name(Bt,\"resolveEditableField\");function fn(t,e){return t.tagName!==\"IMG\"&&t.childElementCount===0&&![\"INPUT\",\"TEXTAREA\",\"SELECT\",\"OPTION\",\"VIDEO\",\"AUDIO\",\"IFRAME\"].includes(t.tagName)&&!e.context&&![\"image\",\"color\",\"boolean\",\"select\",\"list\"].includes(e.type??\"text\")}__name(fn,\"canEditInline\");function pn(t){let e=t;for(;e&&e!==document.body;){const n=e.getAttribute(\"data-preview-field-path\")??e.getAttribute(B)??e.getAttribute(\"data-content-path\")??e.getAttribute(\"data-field-path\")??e.getAttribute(F);if(n)return n;e=e.parentElement}return null}__name(pn,\"extractFieldPath\");function Se(t){let e=t;for(;e&&e!==document.body;){const n=e.getAttribute(D);if(n){const i=n.match(/^(.+)\\[(\\d+)\\]$/);if(i)return{collectionPath:i[1],itemIndex:Number(i[2])}}const r=e.getAttribute(\"data-preview-field-path\")??e.getAttribute(\"data-content-path\")??e.getAttribute(\"data-field-path\")??e.getAttribute(F);if(r){const i=r.match(/^(.+)\\[(\\d+)\\]/);if(i)return{collectionPath:i[1],itemIndex:Number(i[2])}}const o=e.getAttribute(B);if(o)return{collectionPath:o,itemIndex:null};e=e.parentElement}return{collectionPath:null,itemIndex:null}}__name(Se,\"extractCollectionContext\");function Ee(t,e){const n=[],r=new Set(e?.path?[e.path]:[]);let o=t,i=0;for(;o&&o!==document.body&&i<3&&!(o.hasAttribute(U)||i>0&&(o.hasAttribute(D)||o.hasAttribute(B)||o.tagName===\"SECTION\"));){if(o.hasAttribute(\"data-preview-field-path\")||o.hasAttribute(\"data-content-path\")||o.hasAttribute(\"data-field-path\")||o.hasAttribute(F)){const a=Bt(o);a?.path&&a.kind!==\"collection\"&&a.type!==\"list\"&&!r.has(a.path)&&(r.add(a.path),n.push({path:a.path,label:a.label??a.path.split(\".\").pop()??\"Content\",type:a.type??\"text\"}))}o=o.parentElement,i+=1}return n}__name(Ee,\"findRelatedAncestorFields\");function gn(t,e,n=Ee(t,e)){const r=t.getBoundingClientRect(),o=window.getComputedStyle(t),i=t.tagName===\"IMG\",a=e?.path??pn(t),c=i?t.src:t.textContent?.trim()??\"\",u=Se(t);let p=e?.collection?.listPath??e?.collection?.path??e?.context?.collectionPath??u.collectionPath,g=e?.collection?.itemIndex??e?.context?.itemIndex??u.itemIndex;p&&a&&e?.kind!==\"collection\"&&!a.startsWith(`${p}[`)&&!a.startsWith(`${p}.`)&&a!==p&&(p=null,g=null);const w=e?.context?.itemPath??(p&&typeof g==\"number\"?`${p}[${g}]`:null),h=__name(Ct=>String(Ct??\"\").trim().replace(/[^a-zA-Z0-9_.-]+/g,\"-\").replace(/^-+|-+$/g,\"\").slice(0,64),\"safeScopePart\"),A=[],L=__name((Ct,zt,Kt)=>{!zt||A.some(Yt=>Yt.key===zt)||A.push({kind:Ct,key:zt,label:Kt})},\"pushStyleScope\");L(\"element\",a,\"This element\");const K=t.closest(`[${D}]`);L(\"card\",K?.getAttribute(D)??w,\"This card\");const Wt=t.closest(`[${B}]`);L(\"grid\",Wt?.getAttribute(B)??p,\"Entire grid\");const jt=t.closest(\"[data-preview-page-key]\"),Ut=h(jt?.getAttribute(\"data-preview-page-key\")),et=t.closest(\"section,[data-design-section],[data-section-id]\");if(et){const Ct=h(et.getAttribute(\"data-design-section\")??et.getAttribute(\"data-section-id\")??et.id),Kt=(et.parentElement?Array.from(et.parentElement.children).filter(Jn=>Jn.tagName===\"SECTION\"):[]).indexOf(et)+1,Yt=Ct||(Kt>0?`nth-${Kt}`:\"\");L(\"section\",Yt?`section:${Ut||\"all\"}:${Yt}`:null,\"This section\")}L(\"page\",Ut?`page:${Ut}`:null,\"Current page\"),L(\"site\",\"site:all\",\"Whole website\");const Sn={type:On,fieldPath:a,descriptorKind:e?.kind??\"field\",fieldValue:c,elementTag:t.tagName.toLowerCase(),isImage:i,boundingRect:{top:r.top,left:r.left,width:r.width,height:r.height},computedStyle:{fontFamily:o.fontFamily,fontSize:o.fontSize,lineHeight:o.lineHeight,fontWeight:o.fontWeight,letterSpacing:o.letterSpacing,color:o.color,backgroundColor:o.backgroundColor,textAlign:o.textAlign,width:o.width,height:o.height,minWidth:o.minWidth,minHeight:o.minHeight,maxWidth:o.maxWidth,maxHeight:o.maxHeight,marginTop:o.marginTop,marginRight:o.marginRight,marginBottom:o.marginBottom,marginLeft:o.marginLeft,paddingTop:o.paddingTop,paddingRight:o.paddingRight,paddingBottom:o.paddingBottom,paddingLeft:o.paddingLeft,borderRadius:o.borderRadius},listPath:p,itemPath:w,collectionPath:p,itemIndex:g,relatedFields:n,styleScopes:A};W(Sn),W({...Sn,type:Mn})}__name(gn,\"emitClickEvent\");function mn(t,e){W({type:Ln,fieldPath:t,value:e}),W({type:kn,fieldPath:t,value:e})}__name(mn,\"emitFieldChange\");function pt(t){const e=J;if(!e)return;J=null,e.target.removeEventListener(\"keydown\",e.keydown),e.target.removeEventListener(\"blur\",e.blur);const n=t?(e.target.innerText??e.target.textContent??\"\").replace(/\\u00a0/g,\" \").trim():\"\";e.contentEditable===null?e.target.removeAttribute(\"contenteditable\"):e.target.setAttribute(\"contenteditable\",e.contentEditable),e.spellcheck===null?e.target.removeAttribute(\"spellcheck\"):e.target.setAttribute(\"spellcheck\",e.spellcheck),e.target.style.outline=e.outline,e.target.style.outlineOffset=e.outlineOffset,e.target.style.cursor=e.cursor,e.target.style.userSelect=e.userSelect,e.target.style.textTransform=e.textTransform,e.target.innerHTML=e.originalHtml,t&&(n!==e.originalText.trim()?(e.field.value=n,ht(e.target,e.field),mn(e.field.path,n)):n||ht(e.target,e.field))}__name(pt,\"finishInlineEdit\");function hn(t,e,n){if(J?.target===t)return;pt(!0),xt(),ht(t,e),t.removeAttribute(v);const r=typeof e.value==\"string\"||typeof e.value==\"number\"?String(e.value):t.textContent??\"\",o=t.innerHTML,i=__name(c=>{if(c.key===\"Escape\"){c.preventDefault(),pt(!1);return}c.key===\"Enter\"&&e.type!==\"textarea\"&&!c.shiftKey&&(c.preventDefault(),pt(!0))},\"keydown\"),a=__name(()=>pt(!0),\"blur\");if(J={target:t,field:e,originalText:r,originalHtml:o,contentEditable:t.getAttribute(\"contenteditable\"),spellcheck:t.getAttribute(\"spellcheck\"),outline:t.style.outline,outlineOffset:t.style.outlineOffset,cursor:t.style.cursor,userSelect:t.style.userSelect,textTransform:t.style.textTransform,keydown:i,blur:a},t.setAttribute(\"contenteditable\",Bn?\"plaintext-only\":\"true\"),t.setAttribute(\"spellcheck\",\"true\"),t.textContent=r,t.style.outline=\"2px solid rgba(37, 99, 235, 0.95)\",t.style.outlineOffset=\"3px\",t.style.cursor=\"text\",t.style.userSelect=\"text\",t.style.textTransform=\"none\",t.addEventListener(\"keydown\",i),t.addEventListener(\"blur\",a),t.focus(),n){const c=document,u=c.caretPositionFromPoint?.(n.x,n.y),p=u?(()=>{const g=document.createRange();return g.setStart(u.offsetNode,u.offset),g.collapse(!0),g})():c.caretRangeFromPoint?.(n.x,n.y);if(p){const g=window.getSelection();g?.removeAllRanges(),g?.addRange(p)}}else{const c=document.createRange();c.selectNodeContents(t);const u=window.getSelection();u?.removeAllRanges(),u?.addRange(c)}}__name(hn,\"beginInlineEdit\");let yt=null;function xe(t){if(!j||J||Ht||yt!==null)return;const e=t.target;yt=requestAnimationFrame(()=>{if(yt=null,!j||J)return;const n=Ae(e);n&&!n.element.hasAttribute(\"data-fivora-edit-badge\")&&un(n.element)})}__name(xe,\"onEditMouseOver\");function Ce(t){if(!j)return;const e=t.relatedTarget instanceof HTMLElement?t.relatedTarget:null;e&&(e===Q||e===nt||nt?.contains(e))||xt()}__name(Ce,\"onEditMouseOut\");function Te(t){if(!j||J&&t.target instanceof Node&&J.target.contains(t.target))return;const e=t.target instanceof HTMLElement&&t.target.hasAttribute(\"data-fivora-edit-badge\")?t.target:null,n=e?nt?{element:nt,field:Bt(nt)}:null:Ae(t.target),r=n?.element,o=n?.field;if(!r||!o)return;t.preventDefault(),t.stopPropagation();const i=Ee(r,o);!jn&&fn(r,o)&&i.length===0?hn(r,o,e?void 0:{x:t.clientX,y:t.clientY}):gn(r,o,i)}__name(Te,\"onEditClick\");function yn(){j||(j=!0,pe(),ye(),!Ht&&!Q&&(Q=ln()),Ht||(document.addEventListener(\"mouseover\",xe,!0),document.addEventListener(\"mouseout\",Ce,!0)),document.addEventListener(\"click\",Te,!0),document.addEventListener(\"submit\",ve,!0),we())}__name(yn,\"enterEditMode\");function ve(t){j&&(t.preventDefault(),t.stopPropagation())}__name(ve,\"preventEditModeSubmit\");function bn(){if(j){j=!1,Gt=!1,pt(!0),xt(),yt!==null&&(cancelAnimationFrame(yt),yt=null);for(const t of Et)window.clearTimeout(t);if(Et=[],rt!==null){const t=window.cancelIdleCallback;typeof t==\"function\"?t(rt):window.clearTimeout(rt),rt=null}be(),document.querySelectorAll(`[${v}], [${V}]`).forEach(t=>{t.removeAttribute(v),t.removeAttribute(V)}),document.removeEventListener(\"mouseover\",xe,!0),document.removeEventListener(\"mouseout\",Ce,!0),document.removeEventListener(\"click\",Te,!0),document.removeEventListener(\"submit\",ve,!0)}}__name(bn,\"exitEditMode\");const Kn=window.history.pushState.bind(window.history),Yn=window.history.replaceState.bind(window.history);window.history.pushState=(...t)=>{Kn(...t),window.setTimeout(bt,0)},window.history.replaceState=(...t)=>{Yn(...t),window.setTimeout(bt,0)},window.addEventListener(\"popstate\",bt);function wn(){return window.location.pathname.match(/^(\\/uploads\\/generated-sites\\/(?:template-preview|[^/]+)\\/[^/]+)/)?.[1]??\"\"}__name(wn,\"resolvePreviewRootPrefix\");function An(t){if(t.target&&t.target!==\"_self\"||t.hasAttribute(\"download\"))return!1;const e=t.getAttribute(\"href\");if(!e||e.startsWith(\"#\")||/^(mailto:|tel:|sms:|whatsapp:|javascript:)/i.test(e))return!1;let n;try{n=new URL(e,window.location.href)}catch{return!1}if(n.origin!==window.location.origin)return!1;const r=wn();if(r&&!n.pathname.startsWith(r))return!1;const o=window.location.pathname.replace(/\\/+$/,\"\")||\"/\",i=n.pathname.replace(/\\/+$/,\"\")||\"/\";return o!==i||n.search!==window.location.search}__name(An,\"isInternalPreviewNavigation\"),document.addEventListener(\"click\",t=>{if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;const e=t.target?.closest?.(\"a[href]\");!e||!An(e)||(t.preventDefault(),t.stopPropagation(),window.location.assign(e.href))},!0),bt()})(function(I){const O=__name((y,k)=>{if(!y||y.trim()===\"null\")return null;try{const $=new URL(y,k??void 0).origin;return $===\"null\"?null:$}catch{return null}},\"normalizeOrigin\"),_=O(I.currentOrigin),C=O(I.ancestorOrigin,_),H=O(I.accessibleParentOrigin,_),s=O(I.referrer,_),l=O(I.rememberedOrigin);return C??H??(s&&s!==_?s:null)??l??s},function(I){const O=__name(f=>!!f&&typeof f==\"object\"&&!Array.isArray(f),\"isRecord\"),_=O(I)&&(I.designCustomizationVersion===1||!!I.elementStyles||!!I.sections);if(!O(I)||!_)return\"\";const C=I,H=__name(f=>{if(typeof f==\"number\")return`${f}px`;if(typeof f!=\"string\")return\"\";const E=f.trim();return!E||E.length>160||/[;{}<>\\r\\n]/.test(E)||/(?:url\\s*\\(|expression\\s*\\(|@import|javascript:)/i.test(E)?\"\":E},\"safeValue\"),s=__name(f=>H(C[f]),\"read\"),l=__name((f,E)=>E?`${f}:${E} !important;`:\"\",\"declaration\"),y=__name((f,E)=>{const S=E.filter(Boolean).join(\"\");return S?`${f}{${S}}`:\"\"},\"rule\"),k=__name(f=>f?[l(\"background\",f),l(\"background-color\",f),\"background-image:none !important;\"]:[],\"backgroundDeclarations\"),$=__name(f=>f===\"start\"?\"flex-start\":f===\"end\"?\"flex-end\":f===\"center\"||f===\"stretch\"?f:\"\",\"alignItems\"),R=__name(f=>{const E=Number(f);return Number.isInteger(E)&&E>=1&&E<=6?`repeat(${E},minmax(0,1fr))`:\"\"},\"gridColumns\"),T=(()=>{const f=Number(s(\"headingScale\"));return Number.isFinite(f)&&f>=.75&&f<=2?String(f):\"\"})(),N=__name(f=>({none:\"none\",subtle:\"0 4px 14px rgba(15,23,42,.08)\",medium:\"0 12px 30px rgba(15,23,42,.14)\",strong:\"0 22px 55px rgba(15,23,42,.22)\"})[f]??\"\",\"shadow\"),X=[[\"--brand-color\",s(\"primaryColor\")],[\"--brand-primary\",s(\"primaryColor\")],[\"--primary-color\",s(\"primaryColor\")],[\"--color-primary\",s(\"primaryColor\")],[\"--brand-secondary\",s(\"secondaryColor\")],[\"--secondary-color\",s(\"secondaryColor\")],[\"--brand-accent\",s(\"accentColor\")],[\"--accent-color\",s(\"accentColor\")],[\"--page-background\",s(\"backgroundColor\")],[\"--page-text\",s(\"textColor\")],[\"--bg-primary\",s(\"canvasColor\")],[\"--bg-secondary\",s(\"surfaceColor\")],[\"--surface\",s(\"surfaceColor\")],[\"--card-bg\",s(\"surfaceColor\")],[\"--background\",s(\"canvasColor\")],[\"--brand-primary\",s(\"brandPrimary\")],[\"--brand-secondary\",s(\"brandSecondary\")],[\"--brand-accent\",s(\"brandAccent\")],[\"--primary\",s(\"brandPrimary\")],[\"--secondary\",s(\"brandSecondary\")],[\"--accent\",s(\"brandAccent\")],[\"--text-primary\",s(\"textPrimary\")],[\"--text-secondary\",s(\"textSecondary\")],[\"--text-muted\",s(\"textMuted\")],[\"--muted\",s(\"textMuted\")],[\"--border-primary\",s(\"borderColor\")],[\"--border-secondary\",s(\"borderColor\")],[\"--border\",s(\"borderColor\")],[\"--card-radius\",s(\"cardRadius\")],[\"--button-radius\",s(\"buttonRadius\")],[\"--image-radius\",s(\"imageRadius\")]],G=new Set([\"sans-serif\",\"serif\",\"monospace\",\"inherit\",\"initial\",\"system-ui\",\"system sans\",\"editorial serif\"]),F=new Set,v=__name(f=>{if(typeof f==\"string\"&&f.trim()){const E=f.split(\",\")[0].replace(/['\"]/g,\"\").trim();E&&!G.has(E.toLowerCase())&&!E.toLowerCase().includes(\"system\")&&F.add(E)}},\"addFont\");v(C.headingFont),v(C.bodyFont);const V=O(C.elementStyles)?C.elementStyles:{};for(const f of Object.values(V))O(f)&&v(f.fontFamily);const D=[...Array.from(F).map(f=>`@import url('https://fonts.googleapis.com/css2?family=${encodeURIComponent(f).replace(/%20/g,\"+\")}:wght@300;400;500;600;700;800&display=swap');`),y(\":root,body\",X.map(([f,E])=>l(f,E))),y(\"html\",[l(\"font-size\",s(\"baseSize\"))]),y(\"body\",[l(\"font-family\",s(\"bodyFont\")?`${s(\"bodyFont\")},sans-serif`:\"\"),l(\"font-weight\",s(\"bodyWeight\")),l(\"line-height\",s(\"bodyLineHeight\")),l(\"letter-spacing\",s(\"letterSpacing\")),...k(s(\"backgroundColor\")),l(\"color\",s(\"textColor\"))]),y(\"body :where(h1,h2,h3,h4,h5,h6)\",[l(\"font-family\",s(\"headingFont\")?`${s(\"headingFont\")},sans-serif`:\"\"),l(\"font-weight\",s(\"headingWeight\")),l(\"line-height\",s(\"headingLineHeight\")),l(\"color\",s(\"headingColor\"))]),y('body :where(p,small,.muted,[class*=\"muted\"])',[l(\"color\",s(\"mutedTextColor\"))]),T?`body h1{font-size:calc(2.5rem * ${T}) !important}body h2{font-size:calc(2rem * ${T}) !important}body h3{font-size:calc(1.5rem * ${T}) !important}body h4{font-size:calc(1.25rem * ${T}) !important}`:\"\",y(\"body header\",[...k(s(\"headerBackgroundColor\")),l(\"min-height\",s(\"headerHeight\"))]),y(\"body footer\",[...k(s(\"footerBackgroundColor\"))]),y(\"body main\",[...k(s(\"backgroundColor\")),l(\"color\",s(\"textColor\"))]),y(\"body main > section,body main [data-preview-page-key] > section\",[l(\"padding-block\",s(\"sectionPadding\")),l(\"text-align\",s(\"textAlign\"))]),y(\"body main :where(section,[data-design-section]) :where(h1,h2,h3,h4,h5,h6,p,[data-design-text])\",[l(\"text-align\",s(\"textAlign\"))]),y(\"body main > section + section,body main [data-preview-page-key] > section + section\",[l(\"margin-top\",s(\"sectionGap\"))]),y('body main :where([class*=\"flex\"],[class*=\"grid\"],[data-design-stack])',[l(\"gap\",s(\"elementGap\"))]),y(\"body main > section:nth-of-type(even),body main [data-preview-page-key] > section:nth-of-type(even)\",k(s(\"surfaceAltColor\"))),y(\"body main > section:nth-of-type(odd),body main [data-preview-page-key] > section:nth-of-type(odd)\",k(s(\"surfaceColor\"))),y(\"body main > section:first-of-type,body main [data-preview-page-key] > section:first-of-type\",[l(\"min-height\",s(\"heroMinHeight\")),l(\"text-align\",s(\"heroTextAlign\"))]),y('body main > section:first-of-type :where(h1,h2,h3,h4,h5,h6,p,[class*=\"container\"],[data-design-text]),body main [data-preview-page-key] > section:first-of-type :where(h1,h2,h3,h4,h5,h6,p,[class*=\"container\"],[data-design-text])',[l(\"text-align\",s(\"heroTextAlign\"))]),y('body main :where([class*=\"container\"],[class~=\"container\"],[data-design-container])',[l(\"max-width\",s(\"contentMaxWidth\")),l(\"padding-inline\",s(\"containerPadding\")),s(\"contentMaxWidth\")?\"margin-inline:auto !important;\":\"\"]),y('body main :where(section,[data-design-section]) > :where([class*=\"flex\"],[data-design-content])',[l(\"align-items\",$(s(\"contentAlign\"))),l(\"justify-items\",s(\"contentAlign\"))]),y(\"body main :where([data-preview-list-path],[data-design-grid])\",[R(s(\"gridColumns\"))?\"display:grid !important;\":\"\",l(\"grid-template-columns\",R(s(\"gridColumns\"))),l(\"gap\",s(\"gridGap\"))]),y('body main :where([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"])',[l(\"width\",s(\"cardWidth\")),s(\"cardWidth\")?\"max-width:100% !important;\":\"\",l(\"min-height\",s(\"cardMinHeight\")),l(\"padding\",s(\"cardPadding\")),l(\"border-radius\",s(\"cardRadius\")),l(\"border-width\",s(\"cardBorderWidth\")),s(\"cardBorderWidth\")?\"border-style:solid !important;\":\"\",l(\"border-color\",s(\"borderColor\")),...k(s(\"cardBackgroundColor\")),l(\"box-shadow\",N(s(\"cardShadow\"))),l(\"text-align\",s(\"cardTextAlign\"))]),y('body main :where([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"]) :where(h1,h2,h3,h4,h5,h6,p,span,[data-design-text])',[l(\"text-align\",s(\"cardTextAlign\"))]),y('body main :where(button,a[class*=\"btn\"],a[class*=\"button\"],[data-design-button])',[l(\"padding\",s(\"buttonPadding\")),l(\"border-radius\",s(\"buttonRadius\")),...k(s(\"buttonBackgroundColor\")),l(\"color\",s(\"buttonTextColor\")),l(\"box-shadow\",N(s(\"buttonShadow\")))]),y(\"body main img\",[l(\"border-radius\",s(\"imageRadius\"))])],U=O(C.sections)?C.sections:{};for(const[f,E]of Object.entries(U)){if(!/^[a-zA-Z0-9_-]{1,64}$/.test(f)||!O(E))continue;const S=__name(M=>H(E[M]),\"sectionRead\"),z=S(\"backgroundColor\"),d=['[class*=\"absolute\"][class*=\"inset-0\"]','[class*=\"fixed\"][class*=\"inset-0\"]','[class*=\"absolute\"][class*=\"inset-x-0\"][class*=\"inset-y-0\"]','[class*=\"absolute\"][class*=\"top-0\"][class*=\"right-0\"][class*=\"bottom-0\"][class*=\"left-0\"]'].join(\",\"),b={all:\"body main section\",hero:\"body main > section:first-of-type,body main [data-preview-page-key] > section:first-of-type\",header:\"body header\",footer:\"body footer\",cards:'body main :where([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"])'}[f]??`body :where([data-preview-page-key=\"${f}\"] > section,[data-design-section=\"${f}\"],[data-section-id=\"${f}\"],section#${f},section.${f})`;D.push(y(b,[E.visible===!1?\"display:none !important;\":\"\",...k(z),l(\"color\",S(\"textColor\")),l(\"min-height\",S(\"minHeight\")),l(\"padding-block\",S(\"padding\")),l(\"max-width\",S(\"contentMaxWidth\")),l(\"gap\",S(\"gap\")),l(\"text-align\",S(\"textAlign\")),l(\"align-items\",$(S(\"contentAlign\")))]),y(`${b} :where(h1,h2,h3,h4,h5,h6)`,[l(\"color\",S(\"headingColor\")),l(\"text-align\",S(\"textAlign\"))]),y(`${b} :where(p,span,[data-design-text])`,[l(\"text-align\",S(\"textAlign\"))]),y(`${b} :where([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"])`,[...k(S(\"cardBackgroundColor\")),l(\"width\",S(\"cardWidth\")),S(\"cardWidth\")?\"max-width:100% !important;\":\"\",l(\"min-height\",S(\"cardMinHeight\")),l(\"border-radius\",S(\"cardRadius\"))]),y(`${b} :where([data-preview-list-path],[data-design-grid])`,[R(S(\"gridColumns\"))?\"display:grid !important;\":\"\",l(\"grid-template-columns\",R(S(\"gridColumns\")))]),y(`${b}::before,${b}::after`,z?[\"background:none !important;\",\"background-image:none !important;\",\"opacity:0 !important;\"]:[]),y(`${b} > :where(${d})`,z?[\"background:none !important;\",\"background-image:none !important;\",\"box-shadow:none !important;\",\"mask-image:none !important;\",\"-webkit-mask-image:none !important;\"]:[]),y(`${b} > :where(${d})::before,${b} > :where(${d})::after`,z?[\"background:none !important;\",\"background-image:none !important;\",\"opacity:0 !important;\"]:[]),y(`${b} > :where(${d}) :where(img,video,canvas,picture)`,z?[\"opacity:0.2 !important;\"]:[]))}const ot=O(C.elementStyles)?C.elementStyles:{},Y=[[\"fontFamily\",\"font-family\"],[\"fontSize\",\"font-size\"],[\"lineHeight\",\"line-height\"],[\"fontWeight\",\"font-weight\"],[\"letterSpacing\",\"letter-spacing\"],[\"color\",\"color\"],[\"backgroundColor\",\"background-color\"],[\"textAlign\",\"text-align\"],[\"width\",\"width\"],[\"height\",\"height\"],[\"minWidth\",\"min-width\"],[\"minHeight\",\"min-height\"],[\"maxWidth\",\"max-width\"],[\"maxHeight\",\"max-height\"],[\"marginTop\",\"margin-top\"],[\"marginRight\",\"margin-right\"],[\"marginBottom\",\"margin-bottom\"],[\"marginLeft\",\"margin-left\"],[\"paddingTop\",\"padding-top\"],[\"paddingRight\",\"padding-right\"],[\"paddingBottom\",\"padding-bottom\"],[\"paddingLeft\",\"padding-left\"],[\"padding\",\"padding\"],[\"borderRadius\",\"border-radius\"],[\"borderWidth\",\"border-width\"],[\"borderColor\",\"border-color\"],[\"borderStyle\",\"border-style\"],[\"boxShadow\",\"box-shadow\"]];for(const[f,E]of Object.entries(ot).slice(0,256)){if(!/^[a-zA-Z0-9_.:\\[\\]-]{1,180}$/.test(f)||!O(E))continue;const S=f.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"'),z=(()=>{if(f===\"site:all\")return\"body\";if(f.startsWith(\"page:\"))return`body :where([data-preview-page-key=\"${S.slice(5)}\"])`;if(f.startsWith(\"section:\")){const[,d=\"all\",m=\"\"]=S.split(\":\"),b=d===\"all\"?\"body main\":`body :where([data-preview-page-key=\"${d}\"])`,M=m.match(/^nth-(\\d+)$/)?.[1];return M?`${b} > section:nth-of-type(${M})`:`${b} :where([data-design-section=\"${m}\"],[data-section-id=\"${m}\"],section#${m})`}if(f.includes(\":\")){const[d,m]=S.split(\":\");if(m===\"card\")return`body [data-preview-list-path=\"${d}\"] :is([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"])`;if(m)return`body [data-preview-list-path=\"${d}\"] :is([data-preview-field-path$=\".${m}\"],[data-field-path$=\".${m}\"],[data-content-path$=\".${m}\"])`}return`body :is([data-preview-field-path=\"${S}\"],[data-content-path=\"${S}\"],[data-field-path=\"${S}\"],[data-fivora-resolved-field-path=\"${S}\"],[data-preview-list-path=\"${S}\"],[data-preview-item-path=\"${S}\"])`})();D.push(y(z,Y.map(([d,m])=>l(m,H(E[d])))))}return D.filter(Boolean).join(`\n`)},function(I,O){if(!O||typeof O!=\"object\"||Array.isArray(O))return I;const _=__name($=>{const R=$.trim().toLowerCase(),T=R.match(/^#([0-9a-f]{3})$/);return T?`#${[...T[1]].map(N=>N.repeat(2)).join(\"\")}`:/^#[0-9a-f]{6}$/.test(R)?R:null},\"normalize\"),C=new Map,H=new Map;for(const[$,R]of Object.entries(O).slice(0,64)){if(typeof R!=\"string\")continue;const T=_($),N=_(R);if(!T||!N||T===N)continue;C.set(T,N);const X=__name(G=>[Number.parseInt(G.slice(1,3),16),Number.parseInt(G.slice(3,5),16),Number.parseInt(G.slice(5,7),16)],\"channels\");H.set(X(T).join(\",\"),X(N)),T[1]===T[2]&&T[3]===T[4]&&T[5]===T[6]&&C.set(`#${T[1]}${T[3]}${T[5]}`,N)}if(C.size===0)return I;const s=[...C.keys()].sort(($,R)=>R.length-$.length).map($=>$.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")),l=new RegExp(`(?<!\\\\\\\\)(?:${s.join(\"|\")})(?![0-9a-f])`,\"gi\"),y=I.replace(l,$=>{const R=_($);return R?C.get(R)??$:$}),k=/(rgba?\\(\\s*)(\\d{1,3})(\\s+|,\\s*)(\\d{1,3})(\\s+|,\\s*)(\\d{1,3})/gi;return y.replace(k,($,R,T,N,X,G,F)=>{const v=H.get(`${T},${X},${F}`);return v?`${R}${v[0]}${N}${v[1]}${G}${v[2]}`:$})},\"fivora-universal-design-overrides\",function(I,O){const _=O??document,C=I&&typeof I==\"object\"&&!Array.isArray(I)?I:null,H=C?.requirements&&typeof C.requirements==\"object\"&&!Array.isArray(C.requirements)?C.requirements:null,s=C?.template&&typeof C.template==\"object\"&&!Array.isArray(C.template)?C.template:null,l=s?.structure&&typeof s.structure==\"object\"&&!Array.isArray(s.structure)?s.structure:null,y=Array.isArray(H?.requiredPages),k=Array.isArray(l?.pages);if(!y&&!k)return;const $=y?H?.requiredPages:l?.pages,R=new Set($.filter(d=>typeof d==\"string\").map(d=>d.trim()).filter(Boolean)),T=Array.isArray(s?.pageDefinitions)?s.pageDefinitions:[],N=Array.isArray(l?.pageDefinitions)?l.pageDefinitions:[],G=(T.length>0?T:N).flatMap(d=>{if(!d||typeof d!=\"object\"||Array.isArray(d))return[];const m=d;if(typeof m.id!=\"string\"||!m.id.trim())return[];const b=m.id.trim(),M=typeof m.label==\"string\"&&m.label.trim()?m.label.trim():b.replace(/_/g,\" \"),Z=typeof m.route==\"string\"?m.route.trim():\"\",at=Z===\"/\"?\"/\":`/${(Z||b).replace(/^\\/+|\\/+$/g,\"\")}`;return[{id:b,label:M,route:at}]}),v=(k?l?.pages:$).filter(d=>typeof d==\"string\").map(d=>d.trim()).filter(Boolean).map((d,m)=>({id:d,label:d.replace(/_/g,\" \"),route:m===0?\"/\":`/${d}`})),V=G.length>0?G:v;if(V.length===0)return;const B=V.filter(d=>!R.has(d.id));if(B.length===0){_.querySelectorAll(\"[data-fivora-page-disabled]\").forEach(d=>d.removeAttribute(\"data-fivora-page-disabled\"));return}let D=_.getElementById(\"fivora-page-selection-style\");(!D||D.tagName!==\"STYLE\")&&(D=_.createElement(\"style\"),D.id=\"fivora-page-selection-style\",D.textContent='[data-fivora-page-disabled=\"true\"]{display:none!important}',_.head.appendChild(D)),_.querySelectorAll(\"[data-fivora-page-disabled]\").forEach(d=>d.removeAttribute(\"data-fivora-page-disabled\"));const U=__name(d=>{let m=d;try{const Z=new URL(d,_.baseURI);if(Z.origin!==_.location?.origin)return\"\";m=Z.pathname}catch{return\"\"}const b=m.match(/^(\\/uploads\\/generated-sites\\/(?:template-preview|preview|live)\\/[^/]+)/)?.[1];b&&m.startsWith(b)&&(m=m.slice(b.length)||\"/\"),m=m.replace(/\\/index\\.html$/i,\"/\").replace(/\\.html$/i,\"\");const M=m.replace(/\\/+$/g,\"\")||\"/\";return M.startsWith(\"/\")?M:`/${M}`},\"normalizePath\"),ot=__name(d=>V.find(m=>{const b=U(m.route);return b?b===\"/\"?d===\"/\":d===b||d.startsWith(`${b}/`):!1}),\"pageForPath\"),Y=__name(d=>{for(const m of[\"href\",\"formaction\",\"data-href\",\"data-route\",\"data-url\"]){const b=d.getAttribute(m);if(!b)continue;const M=ot(U(b));if(M)return M}},\"pageForControl\"),f=__name(d=>{d&&d.setAttribute(\"data-fivora-page-disabled\",\"true\")},\"disable\");for(const d of B)for(const m of[\"data-page-key\",\"data-required-page\",\"data-target-page\"])_.querySelectorAll(`[${m}]`).forEach(b=>{b.getAttribute(m)===d.id&&f(b)});const E=Array.from(_.querySelectorAll(\"a[href]\"));for(const d of E){const m=Y(d);if(!m||R.has(m.id))continue;if(d.classList.contains(\"absolute\")&&(d.classList.contains(\"inset-0\")||d.classList.contains(\"inset-x-0\")&&d.classList.contains(\"inset-y-0\")))f(d.closest(\"[data-preview-item-path],[data-design-card],article,li\"));else{const M=d.closest(\"li\");f(M&&M.querySelectorAll(\"a[href]\").length===1?M:d)}}const S=Array.from(_.querySelectorAll('button,[role=\"button\"],[data-href],[data-route],[data-url]')).filter(d=>d.tagName!==\"A\");for(const d of S){const m=Y(d);if(!m||R.has(m.id))continue;const b=d.closest(\"li\");f(b&&b.querySelectorAll('a[href],button,[role=\"button\"],[data-href],[data-route],[data-url]').length===1?b:d)}const z=_.querySelector(\"main section\");for(const d of _.querySelectorAll(\"main section\")){const m=Array.from(d.querySelectorAll('a[href],button,[role=\"button\"],[data-href],[data-route],[data-url]')),b=m.map(Y).filter(at=>!!at),M=d.hasAttribute(\"data-preview-page-key\"),Z=d===z||d.hasAttribute(\"data-design-hero\")||/(?:^|\\s)(?:hero|banner|masthead)(?:\\s|$)/i.test(d.className)||!!d.querySelector(\"h1\");!M&&!Z&&b.length>0&&b.length===m.length&&b.every(at=>!R.has(at.id))&&f(d)}});";
|
|
3
|
+
// Generated from visual editor bridge (v47).
|
|
4
|
+
module.exports = "var __name=typeof __name==\"function\"?__name:((nt,_)=>typeof Object.defineProperty==\"function\"?Object.defineProperty(nt,\"name\",{value:_,configurable:!0}):nt);(function(_,O,R,I,H,s){const u=`${[\"MARKET\",\"PLACE\"].join(\"\")}_PREVIEW_`,c=__name(t=>`${u}${t}`,\"previousPreviewMessage\"),w=__name(t=>`__${u}${t}__`,\"previousPreviewStorageKey\"),A=\"FIVORA_PREVIEW_FOCUS_PAGE\",x=c(\"FOCUS_PAGE\"),C=\"FIVORA_PREVIEW_FOCUS_RESULT\",F=c(\"FOCUS_RESULT\"),W=\"FIVORA_PREVIEW_READY\",V=c(\"READY\"),rt=\"data-fivora-preview-active-field\",L=\"data-fivora-resolved-field-path\",M=\"data-fivora-empty-editable\",j=\"data-fivora-empty-collection\",N=\"data-preview-list-path\",z=\"data-preview-item-path\",Y=\"data-preview-static\",X=\"__FIVORA_UNIVERSAL_PREVIEW_FOCUS__\",p=\"__FIVORA_VISUAL_EDITOR_TARGETS__\",T=\"__FIVORA_PREVIEW_PARENT_ORIGIN__\",v=w(\"PARENT_ORIGIN\"),U=\"__FIVORA_PREVIEW_SITE_DATA_CACHE__\",d=w(\"SITE_DATA_CACHE\"),h=\"__FIVORA_PREVIEW_SITE_DATA__\",b=w(\"SITE_DATA\"),k=\"FIVORA_PREVIEW_SITE_DATA\",J=c(\"SITE_DATA\"),at=\"FIVORA_PREVIEW_SITE_DATA_APPLIED\",En=c(\"SITE_DATA_APPLIED\"),xn=\"FIVORA_PREVIEW_CONTENT_PATCH\",Cn=c(\"CONTENT_PATCH\"),Tn=\"FIVORA_PREVIEW_STYLE_PATCH\",Pe=\"fivora-template-color-replacements\",vn=[200],Pn=2500,In=1600,_n=12e3,Rn=\"h1, h2, h3, h4, h5, h6, p, span, a, button, address, li, dt, dd, label, strong, em, small\";let Jt=[];const Ie=new Map;let _e=0,Zt=!1,Tt=null,Xt,Qt=[],st=null,$=null,Re=\"\",$e=\"\",Oe=\"\";function gt(){try{window.sessionStorage.removeItem(X)}catch{}}__name(gt,\"clearPendingFocus\");function te(){try{return window.sessionStorage.getItem(T)||window.sessionStorage.getItem(v)}catch{return null}}__name(te,\"readRememberedParentOrigin\");function ee(t){if(t)try{window.sessionStorage.setItem(T,t)}catch{}}__name(ee,\"rememberParentOrigin\");function Me(){for(const t of Qt)window.clearTimeout(t);Qt=[]}__name(Me,\"clearSiteDataRelayTimers\");function Le(){const t=new Set;dt&&t.add(dt),t.add(window.location.origin);const e=te();e&&t.add(e);try{if(document.referrer){const n=new URL(document.referrer).origin;n&&n!==\"null\"&&t.add(n)}}catch{}try{const n=window.location.ancestorOrigins?.item(0);n&&t.add(n)}catch{}return Array.from(t)}__name(Le,\"collectSiteDataRelayOrigins\");function vt(t,e){const n=Le(),r=e?.fanOut?n:n.slice(0,1);for(const o of r)for(const i of[k,J])try{window.dispatchEvent(new MessageEvent(\"message\",{data:{type:i,siteData:t,__fivoraBridgeRelay:!0},origin:o,source:window.parent}))}catch{}}__name(vt,\"relaySiteDataToTemplateRuntime\");function Pt(t,e){$=t;try{window[h]=t,window[b]=t}catch{}const n=__name(()=>{st=null;try{const r=JSON.stringify($);window.sessionStorage.setItem(U,r),window.sessionStorage.setItem(d,r)}catch{}},\"writeSessionCache\");if(e?.immediate){st!==null&&(window.clearTimeout(st),st=null),n();return}st!==null&&window.clearTimeout(st),st=window.setTimeout(n,Pn)}__name(Pt,\"persistSiteData\");function ke(t){const e=t&&typeof t==\"object\"&&!Array.isArray(t)?t:null,n=e?.requirements&&typeof e.requirements==\"object\"&&!Array.isArray(e.requirements)?e.requirements:null,r=e?.template&&typeof e.template==\"object\"&&!Array.isArray(e.template)?e.template:null,o=r?.structure&&typeof r.structure==\"object\"&&!Array.isArray(r.structure)?r.structure:null;try{return JSON.stringify({requiredPages:n?.requiredPages??null,pages:o?.pages??null,pageDefinitions:r?.pageDefinitions??o?.pageDefinitions??null})}catch{return String(Date.now())}}__name(ke,\"pagesSignature\");let ct=null,lt=null;function Fe(t){const e=[];for(const n of t.matchAll(/([^.[\\]]+)|\\[(\\d+)\\]/g))n[2]!==void 0?e.push(Number(n[2])):n[1]&&e.push(n[1]);return e}__name(Fe,\"parseFieldPath\");function De(t,e,n){if(e.length===0)return t;const r=__name((o,i)=>{const a=e[i],l=i===e.length-1,f=l?void 0:e[i+1];if(typeof a==\"number\"){const E=(Array.isArray(o)?o:[]).slice();if(l)return E[a]=n,E;const D=E[a];return E[a]=D==null||typeof D!=\"object\"?r(typeof f==\"number\"?[]:{},i+1):r(D,i+1),E}const m={...o&&typeof o==\"object\"&&!Array.isArray(o)?o:{}};if(l)return m[a]=n,m;const S=m[a];return m[a]=S==null||typeof S!=\"object\"?r(typeof f==\"number\"?[]:{},i+1):r(S,i+1),m},\"setAt\");return r(t,0)}__name(De,\"setValueAtPath\");function Ne(){return($&&typeof $==\"object\"&&!Array.isArray($)?$:{}).content??{}}__name(Ne,\"readPublishedContent\");function ne(t){const n={...$&&typeof $==\"object\"&&!Array.isArray($)?$:{},content:t};$=n;try{window[h]=n,window[b]=n}catch{}return n}__name(ne,\"writePublishedContent\");function re(){ct!==null&&window.clearTimeout(ct),ct=window.setTimeout(()=>{ct=null,$!=null&&vt($,{fanOut:!1})},In)}__name(re,\"scheduleContentOnlyRelay\");function It(){lt!==null&&window.clearTimeout(lt),lt=window.setTimeout(()=>{if(lt=null,$==null)return;const t=window;if(typeof t.requestIdleCallback==\"function\"){t.requestIdleCallback(()=>{$!=null&&Pt($,{immediate:!0})},{timeout:4e3});return}Pt($,{immediate:!0})},_n)}__name(It,\"scheduleContentOnlyPersist\");function ie(t,e){const n=Array.from(document.querySelectorAll(`[data-preview-field-path=\"${CSS.escape(t)}\"], [${L}=\"${CSS.escape(t)}\"]`));for(const r of n){if(Z?.target===r)continue;if(r.tagName===\"IMG\"){typeof e==\"string\"&&e.trim()&&r.setAttribute(\"src\",e);continue}if(typeof e!=\"string\"&&typeof e!=\"number\"&&typeof e!=\"boolean\")continue;if(r.hasAttribute(\"data-fivora-rating-container\")||r.querySelector(\"[data-fivora-stars-row]\")||r.querySelector(\"[data-fivora-rating-text]\")||t.endsWith(\".rating\")){const i=Math.min(Math.max(Math.round(Number(e)||0),0),5),a=r.querySelector(\"[data-fivora-rating-text]\");a?a.textContent=String(i):r.hasAttribute(\"data-fivora-rating-text\")&&(r.textContent=String(i));const l=r.hasAttribute(\"data-fivora-rating-container\")?r:r.closest(\"[data-fivora-rating-container]\")||r.parentElement;l&&(Array.from(l.querySelectorAll(\"svg\")).forEach((g,m)=>{const y=m<i?\"#fa7014\":\"#dadce0\";g.style.fill=y,g.style.color=y;const E=g.querySelector(\"path\");E&&(E.style.fill=y)}),l.setAttribute(\"data-rating-value\",String(i)));continue}const o=(r.getAttribute(\"data-fivora-value-prefix\")??\"\")+String(e)+(r.getAttribute(\"data-fivora-value-suffix\")??\"\");if(r.childElementCount===0)r.textContent=o;else{const i=Array.from(r.childNodes).find(a=>a.nodeType===Node.TEXT_NODE&&a.textContent?.trim());i?i.textContent=o:r.textContent=o}B&&(o.trim().length===0?r.setAttribute(M,\"true\"):r.removeAttribute(M))}}__name(ie,\"applyDomFieldValue\");function He(t){if(!Array.isArray(t)||t.length===0)return;let e=Ne();for(const n of t){if(!n||typeof n.path!=\"string\"||!n.path.trim())continue;const r=Fe(n.path);r.length!==0&&(e=De(e,r,n.value),ie(n.path,n.value))}ne(e),re(),It()}__name(He,\"publishContentPatches\");function Ve(t){ne(t),re(),It()}__name(Ve,\"publishContentOnly\");function qe(t,e){if(!/^[a-zA-Z0-9_.:\\[\\]-]{1,180}$/.test(t)||!e||typeof e!=\"object\"||Array.isArray(e))return;const n=$&&typeof $==\"object\"&&!Array.isArray($)?$:{},r=n.template&&typeof n.template==\"object\"&&!Array.isArray(n.template)?n.template:{},o=r.structure&&typeof r.structure==\"object\"&&!Array.isArray(r.structure)?r.structure:{},i=(o.theme&&typeof o.theme==\"object\"&&!Array.isArray(o.theme)?o.theme:r.theme&&typeof r.theme==\"object\"&&!Array.isArray(r.theme)?r.theme:{})||{},a=i.elementStyles&&typeof i.elementStyles==\"object\"&&!Array.isArray(i.elementStyles)?i.elementStyles:{},l={...i,designCustomizationVersion:1,elementStyles:{...a,[t]:e}},f={...r,theme:l,structure:{...o,theme:l}},g={...n,template:f};$=g,wt(g),Ge(t,e),It()}__name(qe,\"publishElementStylePatch\");function Ge(t,e){if(!t||!e||typeof e!=\"object\"||Array.isArray(e))return;const n=e;let r=[];if(t.includes(\":\")){const[i,a]=t.split(\":\");a===\"card\"?r=Array.from(document.querySelectorAll(`[data-preview-list-path=\"${CSS.escape(i)}\"] [data-preview-item-path], [data-preview-list-path=\"${CSS.escape(i)}\"] .card, [data-preview-list-path=\"${CSS.escape(i)}\"] article`)):a&&(r=Array.from(document.querySelectorAll(`[data-preview-list-path=\"${CSS.escape(i)}\"] [data-preview-field-path$=\".${CSS.escape(a)}\"], [data-preview-list-path=\"${CSS.escape(i)}\"] [data-field-path$=\".${CSS.escape(a)}\"]`)))}else r=Array.from(document.querySelectorAll(`[data-preview-field-path=\"${CSS.escape(t)}\"], [data-preview-item-path=\"${CSS.escape(t)}\"], [data-preview-style-target=\"${CSS.escape(t)}\"], [data-field-path=\"${CSS.escape(t)}\"], [data-content-path=\"${CSS.escape(t)}\"]`));const o=__name(i=>i==null||i===\"\"?\"\":typeof i==\"number\"?`${i}px`:String(i),\"toCssVal\");for(const i of r){if(n.color&&(i.style.setProperty(\"color\",String(n.color),\"important\"),i.style.setProperty(\"--deneb-color\",String(n.color))),n.textAlign&&(i.style.setProperty(\"text-align\",String(n.textAlign),\"important\"),i.style.setProperty(\"--deneb-text-align\",String(n.textAlign))),n.fontSize){const a=o(n.fontSize);i.style.setProperty(\"font-size\",a,\"important\"),i.style.setProperty(\"--deneb-font-size\",a)}if(n.fontFamily&&(i.style.setProperty(\"font-family\",String(n.fontFamily),\"important\"),i.style.setProperty(\"--deneb-font-family\",String(n.fontFamily))),n.lineHeight&&(i.style.setProperty(\"line-height\",String(n.lineHeight),\"important\"),i.style.setProperty(\"--deneb-line-height\",String(n.lineHeight))),n.fontWeight&&(i.style.setProperty(\"font-weight\",String(n.fontWeight),\"important\"),i.style.setProperty(\"--deneb-font-weight\",String(n.fontWeight))),n.backgroundColor&&(i.style.setProperty(\"background-color\",String(n.backgroundColor),\"important\"),i.style.setProperty(\"background\",String(n.backgroundColor),\"important\"),i.style.setProperty(\"--deneb-card-bg\",String(n.backgroundColor))),n.borderRadius){const a=o(n.borderRadius);i.style.setProperty(\"border-radius\",a,\"important\"),i.style.setProperty(\"--deneb-card-radius\",a)}if(n.padding){const a=o(n.padding);i.style.setProperty(\"padding\",a,\"important\"),i.style.setProperty(\"--deneb-card-pt\",a)}if(n.boxShadow&&(i.style.setProperty(\"box-shadow\",String(n.boxShadow),\"important\"),i.style.setProperty(\"--deneb-card-shadow\",String(n.boxShadow))),n.borderColor&&(i.style.setProperty(\"border-color\",String(n.borderColor),\"important\"),i.style.setProperty(\"--deneb-card-border-c\",String(n.borderColor))),n.borderWidth){const a=o(n.borderWidth);i.style.setProperty(\"border-width\",a,\"important\"),i.style.setProperty(\"border-style\",\"solid\",\"important\"),i.style.setProperty(\"--deneb-card-border-w\",a)}n.marginTop&&i.style.setProperty(\"margin-top\",o(n.marginTop),\"important\"),n.marginBottom&&i.style.setProperty(\"margin-bottom\",o(n.marginBottom),\"important\"),n.marginLeft&&i.style.setProperty(\"margin-left\",o(n.marginLeft),\"important\"),n.marginRight&&i.style.setProperty(\"margin-right\",o(n.marginRight),\"important\")}}__name(Ge,\"applyElementStyleDirectly\");function _t(t,e){if(e?.contentOnly){const n=t&&typeof t==\"object\"&&!Array.isArray(t)?t:null;Ve(n?.content??t);return}if(ct!==null&&(window.clearTimeout(ct),ct=null),lt!==null&&(window.clearTimeout(lt),lt=null),Zt){Tt=t,Xt=e;return}Zt=!0;try{if(Pt(t,{immediate:e?.persistImmediate}),oe(t),wt(t,{colorReplacements:e?.colorReplacements===!0}),vt(t,{fanOut:e?.fanOut===!0}),e?.scheduleRelays!==!1){Me();for(const n of vn)Qt.push(window.setTimeout(()=>{$!=null&&vt($,{fanOut:!0})},n))}}finally{if(Zt=!1,Tt!=null){const n=Tt,r=Xt;Tt=null,Xt=void 0,window.setTimeout(()=>{_t(n,r)},0)}}}__name(_t,\"publishSiteData\");function Be(t){const e=t?.full!==!1,n=\"ontouchstart\"in window||navigator.maxTouchPoints>0||navigator.hardwareConcurrency!=null&&navigator.hardwareConcurrency<=4;window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{try{G({type:at,full:e}),G({type:En,full:e})}catch{}const r=$;if(r==null)return;const o=__name(()=>wt(r,{colorReplacements:!0}),\"run\");if(!n){window.setTimeout(o,0);return}const i=window.requestIdleCallback;typeof i==\"function\"?i(o,{timeout:4e3}):window.setTimeout(o,1200)})})}__name(Be,\"acknowledgeSiteDataApplied\");const $n=(()=>{try{return window.location.ancestorOrigins?.item(0)??null}catch{return null}})(),On=(()=>{try{return window.parent!==window?window.parent.location.origin:null}catch{return null}})();let dt=_({currentOrigin:window.location.origin,referrer:document.referrer,rememberedOrigin:te(),ancestorOrigin:$n,accessibleParentOrigin:On});ee(dt);function We(t){if(t.source!==window.parent)return!1;if(dt)return t.origin===dt;try{const e=new URL(t.origin).origin;return e===\"null\"?!1:(dt=e,ee(e),!0)}catch{return!1}}__name(We,\"isTrustedParentMessage\");function G(t){window.parent.postMessage(t,dt??\"*\")}__name(G,\"postToParent\");function mt(t,e,n=0){t.requestId&&(G({type:C,requestId:t.requestId,result:e,fieldPath:t.fieldPath??null,pageRoute:t.pageRoute??null,occurrences:n}),G({type:F,requestId:t.requestId,result:e,fieldPath:t.fieldPath??null,pageRoute:t.pageRoute??null,occurrences:n}))}__name(mt,\"postFocusResult\");function bt(){try{G({type:W,pathname:window.location.pathname}),G({type:V,pathname:window.location.pathname})}catch{}}__name(bt,\"announceReady\");async function je(t){const e=++_e,r=(t&&typeof t==\"object\"&&!Array.isArray(t)?t:null)?.colorReplacements,o=document.getElementById(Pe);if(!r||typeof r!=\"object\"||Array.isArray(r)||Object.keys(r).length===0){o?.remove();return}const i=Array.from(document.querySelectorAll('link[rel=\"stylesheet\"][href]')),a=await Promise.all(i.map(async g=>{const m=g.href;let S=Ie.get(m);if(S===void 0){const E=await fetch(m,{credentials:\"same-origin\"});if(!E.ok)return\"\";S=await E.text(),Ie.set(m,S)}const y=R(S,r);return y===S?\"\":y}));if(e!==_e)return;const l=a.filter(Boolean).join(`\n`);if(!l){o?.remove();return}const f=o instanceof HTMLStyleElement?o:document.createElement(\"style\");f.id=Pe,f.textContent=l,f.isConnected||document.head.appendChild(f)}__name(je,\"applyTemplateColorReplacements\");function wt(t,e){const n=t&&typeof t==\"object\"&&!Array.isArray(t)?t:null,r=n?.template&&typeof n.template==\"object\"&&!Array.isArray(n.template)?n.template:null,o=r?.structure&&typeof r.structure==\"object\"&&!Array.isArray(r.structure)?r.structure:null,i=o?.theme&&typeof o.theme==\"object\"&&!Array.isArray(o.theme)?o.theme:r?.theme&&typeof r.theme==\"object\"&&!Array.isArray(r.theme)?r.theme:null,a=(()=>{try{return JSON.stringify(i??null)}catch{return String(Date.now())}})();if(a!==Re){Re=a;const f=O(i),g=document.getElementById(I);if(!f)g?.remove();else{const m=g instanceof HTMLStyleElement?g:document.createElement(\"style\");m.id=I,m.textContent=f,m.isConnected||document.head.appendChild(m)}}if(e?.colorReplacements){if(a===$e)return;$e=a,je(i).catch(()=>{})}}__name(wt,\"applyUniversalTheme\");function oe(t){const e=ke(t);e!==Oe&&(Oe=e,H(t,document),window.setTimeout(()=>H(t,document),300))}__name(oe,\"applySelectedPages\");function P(t){return String(t??\"\").trim().replace(/\\s+/g,\" \").toLowerCase()}__name(P,\"normalizeText\");function Rt(t){const e=String(t??\"\").trim();if(!e)return[];const n=e.split(/[,;|\\n\\r]+/).map(r=>P(r)).filter(r=>r.length>=3);return Array.from(new Set([P(e),...n])).filter(r=>r.length>=2)}__name(Rt,\"valueFragments\");function $t(t,e){const n=P(e),r=P(t);return/image|photo|logo|banner|thumbnail|cover/.test(n)||/^(https?:|data:|blob:|\\/)/.test(r)}__name($t,\"isImageValue\");function Ue(t){const e=new Set,n=t.getAttribute(\"src\")||\"\";n&&e.add(n),\"src\"in t&&t.src&&e.add(t.src),\"currentSrc\"in t&&t.currentSrc&&e.add(t.currentSrc);const r=t.getAttribute(\"srcset\");r&&r.split(\",\").forEach(o=>{const i=o.trim().split(/\\s+/)[0];i&&e.add(i)});for(const o of[\"data-src\",\"data-original\",\"data-fallback\",\"data-nimg\",\"data-image\",\"data-url\"]){const i=t.getAttribute(o);i&&i!==\"1\"&&e.add(i)}if(t.style.backgroundImage){const o=t.style.backgroundImage.match(/url\\([\"']?([^\"']+)[\"']?\\)/i);o?.[1]&&e.add(o[1])}for(const o of Array.from(e))try{const a=new URL(o,window.location.href).searchParams.get(\"url\");if(a){e.add(a);try{e.add(decodeURIComponent(a))}catch{}}}catch{}return Array.from(e).filter(Boolean)}__name(Ue,\"extractImageCandidates\");function ae(t,e){const n=String(e??\"\").trim();if(!n)return!1;const r=Ue(t);if(r.length===0)return!1;const i=n.split(\"?\")[0].replace(/\\\\/g,\"/\").split(\"/\").pop()?.toLowerCase();for(const a of r){if(a===n)return!0;try{if(new URL(a,window.location.href).href===new URL(n,window.location.href).href)return!0}catch{}if(a.includes(n)||n.includes(a))return!0;try{const g=decodeURIComponent(a);if(g.includes(n)||n.includes(g))return!0}catch{}const f=a.split(\"?\")[0].replace(/\\\\/g,\"/\").split(\"/\").pop()?.toLowerCase();if(f&&i&&f.length>=3&&f===i)return!0}return!1}__name(ae,\"imageMatchesValue\");function se(t,e){return Array.from(t.querySelectorAll(\"img\")).filter(n=>ae(n,e))}__name(se,\"findImageMatches\");function Ot(t,e){const n=String(e??\"\").trim();return n?[t.getAttribute(\"href\"),t.getAttribute(\"src\"),t.getAttribute(\"poster\"),t.getAttribute(\"srcset\"),t.style.backgroundImage].filter(o=>!!o).some(o=>{if(o===n||o.includes(n))return!0;try{return new URL(o,window.location.href).href===new URL(n,window.location.href).href}catch{return!1}}):!1}__name(Ot,\"attributeMatchesValue\");function Mt(t,e){return Array.from(t.querySelectorAll('a[href], img[src], source[src], video[poster], [style*=\"background-image\"]')).filter(n=>Ot(n,e))}__name(Mt,\"findAttributeMatches\");function Ke(t,e){const n=Rt(e);if(n.length===0)return[];const r=Array.from(t.querySelectorAll(Rn)),o=r.filter(i=>{const a=P(i.textContent);return n.some(l=>a===l)});return o.length>0?o:r.filter(i=>{const a=P(i.textContent);return n.some(l=>a.includes(l)||l.includes(a))})}__name(Ke,\"findTextMatches\");function Lt(t,e,n){if($t(e,n)){const r=se(t,e);if(r.length>0)return r}return Ke(t,e)}__name(Lt,\"findValueMatches\");function ze(t,e,n){if($t(e,n)&&se(t,e).length>0)return!0;const r=P(t.textContent);return Rt(e).some(o=>r.includes(o))}__name(ze,\"subtreeContainsValue\");function Ye(t,e){const n=t[0];if(!n)return null;let r=n;for(;r;){if(t.every(o=>r?.contains(o)))return r;if(r===e)break;r=r.parentElement}return e??n}__name(Ye,\"lowestCommonAncestor\");function ut(t){const e=String(t??\"\").trim();if(!e)return[];const n=e.replace(/\\[(\\d+)\\]/g,\".$1\"),r=n.replace(/\\.(\\d+)(?=\\.|$)/g,\"[$1]\");return Array.from(new Set([e,n,r]))}__name(ut,\"pathVariants\");function ce(t){return Array.from(new Set([t.fieldPath,...t.fieldPaths??[]].filter(e=>!!(e&&e.trim())).flatMap(e=>ut(e))))}__name(ce,\"focusPathCandidates\");function At(t){if(t.closest(\"[hidden]\"))return!1;let e=t;for(;e&&e!==document.documentElement;){const r=window.getComputedStyle(e);if(r.display===\"none\"||r.visibility===\"hidden\"||Number(r.opacity)===0||r.maxHeight===\"0px\"||r.maxHeight===\"0\")return!1;const o=e.getBoundingClientRect();if((r.overflow===\"hidden\"||r.overflow===\"clip\")&&(o.width<2||o.height<2))return!1;e=e.parentElement}const n=t.getBoundingClientRect();return n.width>=2&&n.height>=2}__name(At,\"isVisuallyHighlightable\");function le(t){let e=0;At(t)&&(e+=100);const n=P(t.textContent);n.length>=2&&(e+=40),t.tagName===\"IMG\"&&(e+=35),t.closest(\"main, footer, header, [data-preview-page-key]\")&&(e+=20),t.closest('.fixed, [class*=\"fixed\"]')&&n.length<2&&t.tagName!==\"IMG\"&&(e-=25);const r=t.getBoundingClientRect();return e+=Math.min(15,Math.floor(r.width*r.height/400)),e}__name(le,\"highlightTargetScore\");function de(t){return[...t].sort((e,n)=>le(n)-le(e))}__name(de,\"rankHighlightTargets\");function Je(t,e){const n=[],r=Array.from(new Set([t,...e??[]].filter(a=>!!a).flatMap(a=>ut(a))));for(const a of r){const l=CSS.escape(a);document.querySelectorAll('[data-preview-field-path=\"'+l+'\"], [data-preview-list-path=\"'+l+'\"], [data-content-path=\"'+l+'\"]').forEach(f=>{n.includes(f)||n.push(f)})}const o=de(n.filter(a=>At(a))),i=o.filter(a=>!o.some(l=>l!==a&&a.contains(l)));return i.length>0?i:o}__name(Je,\"findExplicitTargets\");function ue(t){const e=(t?.itemValues??[]).filter(i=>P(i.value).length>=2&&i.key!==\"id\");if(e.length===0)return null;const n=[];for(const i of e)for(const a of Lt(document,i.value,i.key).slice(0,8))n.includes(a)||n.push(a);let r=null;for(const i of n){let a=i,l=0;for(;a&&a!==document.body&&l<12;){const f=e.reduce((S,y)=>S+(ze(a,y.value,y.key)?1:0),0),g=a.getBoundingClientRect(),m=Math.max(1,g.width*g.height);(!r||f>r.score||f===r.score&&m<r.area)&&(r={target:a,score:f,area:m}),a=a.parentElement,l+=1}}const o=Math.min(2,e.length);return r&&r.score>=o?r.target:null}__name(ue,\"findItemContainer\");function kt(t,e,n){const r=Lt(t,e,n);if(r.length===0)return null;const o=Rt(e);if(o.length>1&&!$t(e,n)){const i=r.filter(a=>{const l=P(a.textContent);return o.slice(1).some(f=>l===f)});if(i.length>1)return Ye(i,t instanceof HTMLElement?t:null)}return r.sort((i,a)=>P(i.textContent).length-P(a.textContent).length)[0]}__name(kt,\"findFieldTarget\");function Ft(t,e){const n=String(t??e??\"\").trim().toLowerCase().replace(/\\s+/g,\"_\");return!n||n===\"common\"?\"home\":n===\"about\"?\"about_us\":n}__name(Ft,\"normalizePageKey\");function Ze(t){const e=t.replace(/_us$/,\"\"),n=['[data-preview-page-key=\"'+CSS.escape(t)+'\"]','[data-preview-page-key=\"'+CSS.escape(e)+'\"]',\"#\"+CSS.escape(t)+\"_view\",\"#\"+CSS.escape(e)+\"_view\",\"#\"+CSS.escape(t),\"#\"+CSS.escape(e),\"main\",\"body\"];for(const r of n){const o=document.querySelector(r);if(o instanceof HTMLElement)return o}return null}__name(Ze,\"findPageTarget\");function fe(t,e){const n=window.location.pathname.match(/^(\\/uploads\\/generated-sites\\/(?:template-preview|preview|live)\\/[^/]+)/),r=String(e??\"\").trim(),o=r?\"/\"+r.replace(/^\\/+|\\/+$/g,\"\"):null,i=o!==null?o===\"/\"?\"\":o:t===\"home\"?\"\":\"/\"+t.replace(/^\\/+/,\"\");return n?n[1]+i:i||\"/\"}__name(fe,\"resolvePath\");function pe(){for(const t of Jt)t.target.style.outline=t.outline,t.target.style.outlineOffset=t.outlineOffset,t.target.style.boxShadow=t.boxShadow,t.target.style.transition=t.transition,t.target.style.scrollMarginTop=t.scrollMarginTop,t.target.style.borderRadius=t.borderRadius,t.target.removeAttribute(rt);Jt=[]}__name(pe,\"clearHighlight\");function Dt(t,e){pe(),Jt=t.map(n=>({target:n,outline:n.style.outline,outlineOffset:n.style.outlineOffset,boxShadow:n.style.boxShadow,transition:n.style.transition,scrollMarginTop:n.style.scrollMarginTop,borderRadius:n.style.borderRadius}));for(const n of t)n.setAttribute(rt,\"true\"),n.style.scrollMarginTop=\"72px\",n.style.transition=\"outline-color 0.2s ease, box-shadow 0.2s ease\",n.style.outline=\"2px solid rgba(34, 197, 94, 0.98)\",n.style.outlineOffset=\"4px\",n.style.boxShadow=\"0 0 0 7px rgba(34, 197, 94, 0.2)\",n.style.borderRadius||(n.style.borderRadius=\"4px\");t[0]?.scrollIntoView({behavior:\"smooth\",block:e?\"start\":\"center\",inline:\"nearest\"})}__name(Dt,\"highlightTargets\");function Xe(t,e){Dt([t],e)}__name(Xe,\"highlight\");function Nt(t){return Array.from(new Set([t.fieldValue,...t.fieldMatchValues??[]].filter(e=>typeof e==\"boolean\"||typeof e==\"number\"||typeof e==\"string\"&&e.trim().length>0).map(e=>String(e))))}__name(Nt,\"focusMatchValues\");function Qe(t){const e=ce(t);if(e.length===0)return null;try{const n=JSON.parse(window.sessionStorage.getItem(p)??\"{}\");for(const r of e){const o=n[`${window.location.pathname}|${r}`];if(!o)continue;const i=document.querySelector(o);if(!i)continue;const a=Nt(t).map(P),l=P(i.textContent);if(!(a.length>0&&l&&!a.some(f=>l===f||l.includes(f)||Ot(i,f))))return i}return null}catch{return null}}__name(Qe,\"findRememberedFocusTarget\");function St(t){if(!t)return null;if(At(t))return t;let e=t.parentElement;for(;e&&e!==document.body;){if(At(e))return e;e=e.parentElement}return null}__name(St,\"pickVisibleHeuristicTarget\");function ge(t){const e=ce(t),n=Je(t.fieldPath,e.filter(a=>a!==t.fieldPath));if(n.length>0)return{targets:n,result:\"exact\"};const r=St(Qe(t));if(r)return{targets:[r],result:\"heuristic\"};const o=ue(t.fieldContext),i=t.fieldContext?.fieldKey;if(o){for(const l of Nt(t)){const f=St(Mt(o,l)[0]??kt(o,l,i));if(f)return{targets:[f],result:\"heuristic\"}}const a=St(o);if(a)return{targets:[a],result:\"heuristic\"}}for(const a of Nt(t)){const l=Mt(document,a),f=kt(document,a,i),g=f?[...l,f]:l,m=de(g.map(S=>St(S)).filter(S=>!!S));if(m.length>0)return{targets:[m[0]],result:\"heuristic\"}}return null}__name(ge,\"resolveFieldTarget\");function me(){document.documentElement.dataset.fivoraPreview=\"true\",document.querySelectorAll(\".reveal-on-scroll:not(.reveal-active)\").forEach(t=>t.classList.add(\"reveal-active\"))}__name(me,\"activateRevealNodes\");function ft(t,e=0){me();const n=!!t.fieldPath;if(t.focusOnly&&n){const a=ge(t);if(a){Dt(a.targets,!1),mt(t,a.result,a.targets.length);return}if(e<12){window.setTimeout(()=>ft(t,e+1),120);return}mt(t,\"missing\");return}const r=Ft(t.pageKey,t.pageLabel),o=Ze(r);if(!o){e<12?window.setTimeout(()=>ft(t,e+1),120):mt(t,\"missing\");return}const i=n?ge(t):null;if(n&&!i&&e<12){window.setTimeout(()=>ft(t,e+1),120);return}i?(Dt(i.targets,!1),mt(t,i.result,i.targets.length)):(Xe(o,!0),mt(t,\"page\",1))}__name(ft,\"applyFocus\");function tn(t){if(t.focusOnly){gt(),window.setTimeout(()=>ft(t),80);return}const e=Ft(t.pageKey,t.pageLabel),n=fe(e,t.pageRoute);if((window.location.pathname.replace(/\\/+$/,\"\")||\"/\")!==n){try{window.sessionStorage.setItem(X,JSON.stringify({...t,awaitingNavigation:!0}))}catch{}window.location.assign(n);return}gt(),window.setTimeout(()=>ft(t),80)}__name(tn,\"handleFocus\");function he(t){return P(t).replace(/\\.html$/i,\"\").replace(/[^a-z0-9]+/g,\"-\")}__name(he,\"normalizeRouteToken\");function en(){const t=window.location.pathname.split(\"/\").map(i=>decodeURIComponent(i).trim()).filter(Boolean);if(t.length<2||q.length===0)return;const e=q.filter(i=>{const a=i.context;if(!a?.collectionPath||!a.fieldKey)return!1;const l=a.collectionPath.split(\".\").at(-1)??\"\",f=t.lastIndexOf(l);if(f<0||f>=t.length-1)return!1;const g=he(t.at(-1)??\"\");return a.itemValues.some(({key:m,value:S})=>{const y=P(m).replace(/[^a-z0-9]/g,\"\");return y!==\"id\"&&!y.endsWith(\"id\")&&y!==\"slug\"&&y!==\"name\"&&y!==\"title\"?!1:he(S)===g})});if(e.length===0)return;const n=Array.from(document.querySelectorAll(`[${Y}]`)),r=[];for(const i of e){const a=i.context,l=a.fieldKey,f=P(l).replace(/[^a-z0-9]/g,\"\");if(f===\"slug\"||f===\"identifier\"||f.endsWith(\"id\"))continue;const g=a.collectionPath.split(\".\").at(-1)??\"\",m=P(g).replace(/s$/,\"\"),S=l.replace(/([a-z0-9])([A-Z])/g,\"$1 $2\").split(/[^a-z0-9]+/i).map(P).filter(E=>E&&![\"url\",\"text\",\"value\"].includes(E)),y=P(i.value);for(const E of n){const D=P(E.getAttribute(Y));if(!D||!D.includes(m))continue;let K=0;const Wt=S.filter(et=>D.includes(et));Wt.length>0&&(K+=40+Wt.length*5);const jt=E.tagName===\"IMG\"?P(E.getAttribute(\"src\")??E.getAttribute(\"alt\")):P(E.textContent);y&&jt===y?K+=120:y.length>=3&&jt.includes(y)&&(K+=80),/image|photo|logo|banner|thumbnail|cover/i.test(l)&&E.tagName===\"IMG\"&&D.includes(\"image\")&&(K+=120),K>=40&&r.push({element:E,field:i,score:K})}}r.sort((i,a)=>a.score-i.score);const o=new Set;for(const{element:i,field:a}of r)if(!o.has(i)){if(o.add(i),i.tagName!==\"IMG\"){const l=i.textContent??\"\",f=String(a.value??\"\"),g=l.toLowerCase().indexOf(f.toLowerCase());f&&g>=0&&l!==f&&(i.setAttribute(\"data-fivora-value-prefix\",l.slice(0,g)),i.setAttribute(\"data-fivora-value-suffix\",l.slice(g+f.length)))}i.removeAttribute(Y),i.setAttribute(\"data-preview-field-path\",a.path),ie(a.path,a.value)}}__name(en,\"promoteActiveRouteDetailFields\");const Mn=\"FIVORA_PREVIEW_ELEMENT_CLICKED\",Ln=c(\"ELEMENT_CLICKED\"),kn=\"FIVORA_PREVIEW_FIELD_CHANGED\",Fn=c(\"FIELD_CHANGED\"),Dn=\"FIVORA_PREVIEW_EDIT_MODE\",Nn=c(\"EDIT_MODE\"),Hn=\"FIVORA_PREVIEW_FLUSH_EDIT\",Vn=c(\"FLUSH_EDIT\"),qn=\"FIVORA_PREVIEW_EDIT_FLUSHED\",Gn=c(\"EDIT_FLUSHED\"),Bn=\"h1, h2, h3, h4, h5, h6, p, span, a, button, address, li, dt, dd, label, strong, em, small, img\",Ht=\"ontouchstart\"in window||navigator.maxTouchPoints>0||window.matchMedia&&window.matchMedia(\"(pointer: coarse)\").matches,Xn=(()=>{const t=navigator.userAgent||\"\",e=navigator.vendor||\"\";if(/iP(ad|hone|od)/i.test(t)||/Safari/i.test(t)&&/Apple Computer/i.test(e)&&!/Chrom(e|ium)/i.test(t))return!0;try{return!!window.safari}catch{return!1}})(),Wn=(()=>{try{const t=document.createElement(\"div\");return t.setAttribute(\"contenteditable\",\"plaintext-only\"),t.contentEditable===\"plaintext-only\"}catch{return!1}})(),jn=Ht||navigator.hardwareConcurrency!=null&&navigator.hardwareConcurrency<=4||typeof navigator.deviceMemory==\"number\"&&(navigator.deviceMemory??8)<=4,Un=!0;let q=[];window.addEventListener(\"message\",t=>{if(!We(t)||t.data&&typeof t.data==\"object\"&&t.data.__fivoraBridgeRelay===!0)return;if(t.data?.type===A||t.data?.type===x){t.stopImmediatePropagation(),tn(t.data);return}if((t.data?.type===k||t.data?.type===J)&&t.data.siteData){const a=t.data.full!==!1;if(t.data.contentOnly===!0){_t(t.data.siteData,{contentOnly:!0});return}_t(t.data.siteData,{fanOut:!1,colorReplacements:!1}),Be({full:a});return}if(t.data?.type===xn||t.data?.type===Cn){const a=t.data.patches;Array.isArray(a)&&He(a);return}if(t.data?.type===Tn||t.data?.type===\"DENEB_PREVIEW_STYLE_PATCH\"){const a=t.data,l=typeof a.fieldPath==\"string\"?a.fieldPath:typeof a.targetPath==\"string\"?a.targetPath:\"\",f=a.styles??a.properties;l&&f&&qe(l,f);return}if(t.data?.type===Dn||t.data?.type===Nn){q=Array.isArray(t.data.fields)?t.data.fields:[],en(),t.data.editMode?(yn(),window.setTimeout(()=>we(),50)):bn();return}(t.data?.type===Hn||t.data?.type===Vn)&&(pt(!0),G({type:qn,requestId:t.data.requestId}),G({type:Gn,requestId:t.data.requestId}))},!0);try{const t=JSON.parse(window.sessionStorage.getItem(X)??\"null\");if(t?.awaitingNavigation){const e=Ft(t.pageKey,t.pageLabel),n=fe(e,t.pageRoute),r=window.location.pathname.replace(/\\/+$/,\"\")||\"/\";gt(),r===n&&window.setTimeout(()=>ft(t),220)}else t&>()}catch{gt()}try{const t=JSON.parse(window.sessionStorage.getItem(U)??window.sessionStorage.getItem(d)??\"null\");if(t){$=t;try{window[h]=t,window[b]=t}catch{}jn||(oe(t),wt(t,{colorReplacements:!1}))}}catch{}let B=!1,Q=null,it=null,Vt=null,Z=null,Et=[],ot=null;function ye(){if(document.querySelector(\"[data-fivora-empty-editable-styles]\"))return;const t=document.createElement(\"style\");t.setAttribute(\"data-fivora-empty-editable-styles\",\"true\"),t.textContent=`\n [${M}=\"true\"] {\n min-width: 7rem !important;\n min-height: 1.25em !important;\n outline: 1px dashed rgba(37, 99, 235, 0.28) !important;\n outline-offset: 3px !important;\n }\n span[${M}=\"true\"],\n a[${M}=\"true\"],\n strong[${M}=\"true\"],\n em[${M}=\"true\"],\n small[${M}=\"true\"],\n label[${M}=\"true\"] {\n display: inline-block !important;\n }\n [${M}=\"true\"]:empty::before {\n content: \"\";\n color: rgba(37, 99, 235, 0.78);\n font: 500 12px/1.4 system-ui, sans-serif;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n }\n [${M}=\"true\"]:empty:hover::before {\n content: \"Click to add text\";\n }\n [${j}=\"true\"] {\n min-width: 10rem !important;\n min-height: 3.5rem !important;\n outline: 1px dashed rgba(37, 99, 235, 0.28) !important;\n outline-offset: 3px !important;\n }\n [${j}=\"true\"]:empty::before {\n content: \"\";\n display: inline-flex;\n align-items: center;\n min-height: 3.5rem;\n color: rgba(37, 99, 235, 0.78);\n font: 500 12px/1.4 system-ui, sans-serif;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n }\n [${j}=\"true\"]:empty:hover::before {\n content: \"Click to add the first item\";\n }\n `,document.head.appendChild(t)}__name(ye,\"ensureEmptyEditableStyles\");function nn(t){if(t.id)return\"#\"+CSS.escape(t.id);const e=[];let n=t;for(;n&&n!==document.body;){const r=n.tagName.toLowerCase(),o=n.parentElement?Array.from(n.parentElement.children).filter(a=>a.tagName===n?.tagName):[],i=o.indexOf(n)+1;e.unshift(o.length>1?`${r}:nth-of-type(${i})`:r),n=n.parentElement}return e.length>0?`body > ${e.join(\" > \")}`:\"\"}__name(nn,\"buildStructuralSelector\");function qt(){try{const t=JSON.parse(window.sessionStorage.getItem(p)??\"{}\");return t&&typeof t==\"object\"?t:{}}catch{return{}}}__name(qt,\"readResolvedTargetSelectors\");function rn(t,e){const n=nn(t);if(!n)return;const r=qt();r[`${window.location.pathname}|${e}`]=n;try{window.sessionStorage.setItem(p,JSON.stringify(r))}catch{}}__name(rn,\"rememberResolvedTarget\");function Kn(){const t=qt(),e=`${window.location.pathname}|`;let n=!1;for(const r of Object.keys(t))r.startsWith(e)&&(delete t[r],n=!0);if(n)try{window.sessionStorage.setItem(p,JSON.stringify(t))}catch{}}__name(Kn,\"forgetResolvedTargetsForCurrentPage\");function zn(t,e){let n=document.getElementById(\"fivora-dynamic-empty-styles\");n||(n=document.createElement(\"style\"),n.id=\"fivora-dynamic-empty-styles\",document.head.appendChild(n));const r=[];targetRegistry.getDynamicTargets().forEach((l,f)=>{const g=\"fivora-target-\"+f;l.hasAttribute(\"data-fivora-id\")||l.setAttribute(\"data-fivora-id\",g)});const o=__name(l=>{const f=[];for(const g of l){const m=CSS.escape(g);f.push(`[data-preview-field-path=\"${m}\"]`),f.push(`[data-preview-list-path=\"${m}\"]`),targetRegistry.findTargets(g).forEach(S=>{const y=S.getAttribute(\"data-fivora-id\");y&&f.push(`[data-fivora-id=\"${CSS.escape(y)}\"]`)})}return f.length>0?f.join(\", \"):null},\"buildSelectors\"),i=o(t);i&&r.push(`\n ${i} {\n min-width: 7rem !important;\n min-height: 1.25em !important;\n outline: 1px dashed rgba(37, 99, 235, 0.28) !important;\n outline-offset: 3px !important;\n }\n ${i.replace(/,/g,\":empty::before,\")} :empty::before {\n content: \"\";\n color: rgba(37, 99, 235, 0.78);\n font: 500 12px/1.4 system-ui, sans-serif;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n }\n ${i.replace(/,/g,\":empty:hover::before,\")} :empty:hover::before {\n content: \"Click to add text\";\n }\n `);const a=o(e);a&&r.push(`\n ${a} {\n min-width: 10rem !important;\n min-height: 3.5rem !important;\n outline: 1px dashed rgba(37, 99, 235, 0.28) !important;\n outline-offset: 3px !important;\n }\n ${a.replace(/,/g,\":empty::before,\")} :empty::before {\n content: \"\";\n display: inline-flex;\n align-items: center;\n min-height: 3.5rem;\n color: rgba(37, 99, 235, 0.78);\n font: 500 12px/1.4 system-ui, sans-serif;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n }\n ${a.replace(/,/g,\":empty:hover::before,\")} :empty:hover::before {\n content: \"Click to add the first item\";\n }\n `),n.textContent=r.join(`\n`)}__name(zn,\"updateDynamicStyles\");function be(){document.querySelectorAll(`[${L}]`).forEach(t=>{Z?.target!==t&&(t.removeAttribute(L),t.removeAttribute(M),t.removeAttribute(j))})}__name(be,\"clearResolvedEditableTargets\");function ht(t,e,n=!0){const r=targetRegistry.getPath(t),o=t.getAttribute(\"data-preview-field-path\")??t.getAttribute(N)??t.getAttribute(\"data-content-path\")??t.getAttribute(\"data-field-path\");if(r&&r!==e.path&&o!==e.path)return!1;t.setAttribute(L,e.path);const i=String(e.value??\"\").trim().length===0&&P(t.textContent).length===0;B&&i&&t.tagName!==\"IMG\"?t.setAttribute(M,\"true\"):t.removeAttribute(M);const a=e.kind===\"collection\"||e.type===\"list\",l=e.collection?.length;return B&&a&&(l===0||t.childElementCount===0)?(t.setAttribute(j,\"true\"),t.removeAttribute(M)):t.removeAttribute(j),n&&!a&&rn(t,e.path),!0}__name(ht,\"annotateEditableTarget\");function tt(t){const e=[t.value,...t.matchValues??[]].filter(n=>typeof n==\"number\"||typeof n==\"string\"&&n.trim().length>0);return Array.from(new Set(e.map(n=>String(n))))}__name(tt,\"editableFieldMatchValues\");function on(t){for(const e of ut(t)){const n=CSS.escape(e),r=document.querySelector(`[data-preview-field-path=\"${n}\"], [${N}=\"${n}\"], [data-content-path=\"${n}\"], [data-field-path=\"${n}\"], [${L}=\"${n}\"]`);if(r)return r}return null}__name(on,\"findExplicitEditableTarget\");function an(t){if(t.kind===\"collection\"||t.type===\"list\")return null;const n=qt()[`${window.location.pathname}|${t.path}`];if(!n)return null;try{const r=document.querySelector(n);if(!r)return null;const o=tt(t).map(P),i=P(r.textContent);return o.length>0&&i&&!o.includes(i)?null:(ht(r,t,!1),r)}catch{return null}}__name(an,\"restoreRememberedTarget\");function sn(t){if(t.kind===\"collection\"||t.type===\"list\")return null;const n=(t.context?ue({collectionPath:t.context.collectionPath,itemIndex:t.context.itemIndex,fieldKey:t.context.fieldKey,itemValues:t.context.itemValues}):null)??document;for(const r of tt(t)){const o=kt(n,r,t.context?.fieldKey),i=[...Mt(n,r),...o?[o]:[],...Lt(n,r,t.context?.fieldKey)];for(const a of i){if(a.closest(`[${Y}]`))continue;const l=a.getAttribute(L);if(!l||l===t.path)return a}}return null}__name(sn,\"inferEditableTarget\");function cn(t){if(B){ye(),me();for(const e of q){const n=on(e.path)??an(e)??(t?.explicitOnly?null:sn(e));n&&ht(n,e)}}}__name(cn,\"indexEditableTargets\");let Gt=!1;function we(){for(const e of Et)window.clearTimeout(e);if(Et=[],ot!==null){const e=window.cancelIdleCallback;typeof e==\"function\"?e(ot):window.clearTimeout(ot),ot=null}if(Gt)return;Gt=!0;const t=__name((e,n)=>{n&&(Gt=!1),e&&be(),cn({explicitOnly:e})},\"runPass\");Et=[window.setTimeout(()=>{t(!0,!0)},0)]}__name(we,\"scheduleEditableTargetIndex\");function ln(){const t=document.createElement(\"div\");return t.setAttribute(\"data-fivora-edit-badge\",\"true\"),t.innerHTML=\"\\u270F\\uFE0F\",Object.assign(t.style,{position:\"fixed\",zIndex:\"2147483647\",width:\"28px\",height:\"28px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:\"14px\",borderRadius:\"8px\",background:\"rgba(37, 99, 235, 0.92)\",color:\"#fff\",cursor:\"pointer\",pointerEvents:\"auto\",boxShadow:\"0 2px 8px rgba(0,0,0,0.18)\",opacity:\"0\",transition:\"opacity 0.15s ease\",userSelect:\"none\"}),t.setAttribute(\"title\",\"Edit this content\"),t.setAttribute(\"aria-label\",\"Edit this content\"),document.body.appendChild(t),t}__name(ln,\"createHoverBadge\");function dn(t){if(!Q)return;const e=t.getBoundingClientRect();Q.style.top=`${Math.max(4,e.top-4)}px`,Q.style.left=`${Math.min(window.innerWidth-36,e.right-32)}px`,Q.style.opacity=\"1\"}__name(dn,\"positionBadge\");function xt(){Vt&&(Vt(),Vt=null),Q&&(Q.style.opacity=\"0\"),it=null}__name(xt,\"clearHoverOverlay\");function un(t){if(t===it)return;xt(),it=t;const e=t.style.outline,n=t.style.outlineOffset,r=t.style.cursor;t.style.outline=\"2px dashed rgba(37, 99, 235, 0.6)\",t.style.outlineOffset=\"2px\",t.style.cursor=\"pointer\",Vt=__name(()=>{t.style.outline=e,t.style.outlineOffset=n,t.style.cursor=r},\"hoverOutlineCleanup\"),dn(t)}__name(un,\"applyHoverOverlay\");function Ae(t){let e=t instanceof Element?t:null;for(;e&&!(e instanceof HTMLElement);)e=e.parentElement;let n=e;for(;n&&n!==document.body;){if(n.hasAttribute(Y)){n=n.parentElement;continue}if(n.hasAttribute(\"data-preview-field-path\")||n.hasAttribute(N)||n.hasAttribute(z)||n.hasAttribute(\"data-content-path\")||n.hasAttribute(\"data-field-path\")||n.hasAttribute(L)||n.matches(Bn)){const o=Bt(n);if(o)return{element:n,field:o}}n=n.parentElement}return null}__name(Ae,\"findEditableTarget\");function Bt(t){if(t.closest(`[${Y}]`))return null;const e=t.getAttribute(\"data-preview-field-path\")??t.getAttribute(\"data-content-path\")??t.getAttribute(\"data-field-path\")??targetRegistry.getPath(t);if(e)return q.find(m=>ut(m.path).includes(e))??{path:e,label:e.split(\".\").pop()??\"Content\",type:t.tagName===\"IMG\"?\"image\":\"text\",value:t.tagName===\"IMG\"?t.src:t.textContent?.trim()??\"\"};const n=t.getAttribute(z);if(n){const g=n.match(/^(.+)\\[(\\d+)\\]$/);if(g){const m=g[1],S=Number(g[2]),y=q.find(E=>(E.kind===\"collection\"||E.type===\"list\")&&ut(E.path).includes(m));if(y)return{...y,collection:{listPath:m,itemIndex:S,length:y.collection?.length??0,minItems:y.collection?.minItems,maxItems:y.collection?.maxItems,itemLabel:y.collection?.itemLabel}}}}const r=t.getAttribute(N);if(r)return q.find(m=>(m.kind===\"collection\"||m.type===\"list\")&&ut(m.path).includes(r))??{kind:\"collection\",path:r,label:r.split(\".\").pop()??\"Collection\",type:\"list\",value:0,collection:{listPath:r,length:t.children.length}};const o=t.tagName===\"IMG\"?t:t.querySelector(\"img\");if(o){const g=q.find(y=>y.type===\"image\"&&tt(y).some(E=>ae(o,E)));if(g)return g;const m=Se(o);if(m.collectionPath&&typeof m.itemIndex==\"number\"){const y=q.find(E=>E.type===\"image\"&&E.context?.collectionPath===m.collectionPath&&E.context?.itemIndex===m.itemIndex);if(y)return y}const S=o.closest('section, article, [data-preview-page-key], main, header, footer, .card, [class*=\"section\"]');if(S){const y=S.getAttribute(\"data-preview-field-path\")||S.getAttribute(\"data-content-path\")||S.getAttribute(\"data-field-path\")||S.getAttribute(L);if(y){const E=y.split(\".\")[0],D=q.find(K=>K.type===\"image\"&&(K.path.startsWith(`${E}.`)||K.path.startsWith(`${y}.`)));if(D)return D}}if(t.tagName===\"IMG\"){const y=q.filter(D=>D.type===\"image\");if(y.length===1)return y[0];const E=o.getAttribute(\"src\")||o.src||\"\";return{path:e||\"image\",label:(e||\"\").split(\".\").pop()||\"Image\",type:\"image\",value:E}}}const i=q.filter(g=>tt(g).some(m=>Ot(t,m)));if(i.length===1)return i[0];const a=P(t.textContent);if(!a)return null;const l=q.filter(g=>typeof g.value!=\"boolean\"&&tt(g).some(m=>P(m)===a));if(l.length===1)return l[0];const f=q.filter(g=>typeof g.value==\"boolean\"?!1:tt(g).some(m=>{const S=P(m);return S.length>=3&&a.includes(S)})).sort((g,m)=>Math.max(...tt(m).map(S=>P(S).length),0)-Math.max(...tt(g).map(S=>P(S).length),0));return f.length===1?f[0]:null}__name(Bt,\"resolveEditableField\");function fn(t,e){return t.tagName!==\"IMG\"&&t.childElementCount===0&&![\"INPUT\",\"TEXTAREA\",\"SELECT\",\"OPTION\",\"VIDEO\",\"AUDIO\",\"IFRAME\"].includes(t.tagName)&&!e.context&&![\"image\",\"color\",\"boolean\",\"select\",\"list\"].includes(e.type??\"text\")}__name(fn,\"canEditInline\");function pn(t){let e=t;for(;e&&e!==document.body;){const n=e.getAttribute(\"data-preview-field-path\")??e.getAttribute(N)??e.getAttribute(\"data-content-path\")??e.getAttribute(\"data-field-path\")??e.getAttribute(L);if(n)return n;e=e.parentElement}return null}__name(pn,\"extractFieldPath\");function Se(t){let e=t;for(;e&&e!==document.body;){const n=e.getAttribute(z);if(n){const i=n.match(/^(.+)\\[(\\d+)\\]$/);if(i)return{collectionPath:i[1],itemIndex:Number(i[2])}}const r=e.getAttribute(\"data-preview-field-path\")??e.getAttribute(\"data-content-path\")??e.getAttribute(\"data-field-path\")??e.getAttribute(L);if(r){const i=r.match(/^(.+)\\[(\\d+)\\]/);if(i)return{collectionPath:i[1],itemIndex:Number(i[2])}}const o=e.getAttribute(N);if(o)return{collectionPath:o,itemIndex:null};e=e.parentElement}return{collectionPath:null,itemIndex:null}}__name(Se,\"extractCollectionContext\");function Ee(t,e){const n=[],r=new Set(e?.path?[e.path]:[]);let o=t,i=0;for(;o&&o!==document.body&&i<3&&!(o.hasAttribute(Y)||i>0&&(o.hasAttribute(z)||o.hasAttribute(N)||o.tagName===\"SECTION\"));){if(o.hasAttribute(\"data-preview-field-path\")||o.hasAttribute(\"data-content-path\")||o.hasAttribute(\"data-field-path\")||o.hasAttribute(L)){const a=Bt(o);a?.path&&a.kind!==\"collection\"&&a.type!==\"list\"&&!r.has(a.path)&&(r.add(a.path),n.push({path:a.path,label:a.label??a.path.split(\".\").pop()??\"Content\",type:a.type??\"text\"}))}o=o.parentElement,i+=1}return n}__name(Ee,\"findRelatedAncestorFields\");function gn(t,e,n=Ee(t,e)){const r=t.getBoundingClientRect(),o=window.getComputedStyle(t),i=t.tagName===\"IMG\",a=e?.path??pn(t),l=i?t.src:t.textContent?.trim()??\"\",f=Se(t);let g=e?.collection?.listPath??e?.collection?.path??e?.context?.collectionPath??f.collectionPath,m=e?.collection?.itemIndex??e?.context?.itemIndex??f.itemIndex;g&&a&&e?.kind!==\"collection\"&&!a.startsWith(`${g}[`)&&!a.startsWith(`${g}.`)&&a!==g&&(g=null,m=null);const S=e?.context?.itemPath??(g&&typeof m==\"number\"?`${g}[${m}]`:null),y=__name(Ct=>String(Ct??\"\").trim().replace(/[^a-zA-Z0-9_.-]+/g,\"-\").replace(/^-+|-+$/g,\"\").slice(0,64),\"safeScopePart\"),E=[],D=__name((Ct,Kt,zt)=>{!Kt||E.some(Yt=>Yt.key===Kt)||E.push({kind:Ct,key:Kt,label:zt})},\"pushStyleScope\");D(\"element\",a,\"This element\");const K=t.closest(`[${z}]`);D(\"card\",K?.getAttribute(z)??S,\"This card\");const Wt=t.closest(`[${N}]`);D(\"grid\",Wt?.getAttribute(N)??g,\"Entire grid\");const jt=t.closest(\"[data-preview-page-key]\"),Ut=y(jt?.getAttribute(\"data-preview-page-key\")),et=t.closest(\"section,[data-design-section],[data-section-id]\");if(et){const Ct=y(et.getAttribute(\"data-design-section\")??et.getAttribute(\"data-section-id\")??et.id),zt=(et.parentElement?Array.from(et.parentElement.children).filter(Zn=>Zn.tagName===\"SECTION\"):[]).indexOf(et)+1,Yt=Ct||(zt>0?`nth-${zt}`:\"\");D(\"section\",Yt?`section:${Ut||\"all\"}:${Yt}`:null,\"This section\")}D(\"page\",Ut?`page:${Ut}`:null,\"Current page\"),D(\"site\",\"site:all\",\"Whole website\");const Sn={type:Mn,fieldPath:a,descriptorKind:e?.kind??\"field\",fieldValue:l,elementTag:t.tagName.toLowerCase(),isImage:i,boundingRect:{top:r.top,left:r.left,width:r.width,height:r.height},computedStyle:{fontFamily:o.fontFamily,fontSize:o.fontSize,lineHeight:o.lineHeight,fontWeight:o.fontWeight,letterSpacing:o.letterSpacing,color:o.color,backgroundColor:o.backgroundColor,textAlign:o.textAlign,width:o.width,height:o.height,minWidth:o.minWidth,minHeight:o.minHeight,maxWidth:o.maxWidth,maxHeight:o.maxHeight,marginTop:o.marginTop,marginRight:o.marginRight,marginBottom:o.marginBottom,marginLeft:o.marginLeft,paddingTop:o.paddingTop,paddingRight:o.paddingRight,paddingBottom:o.paddingBottom,paddingLeft:o.paddingLeft,borderRadius:o.borderRadius},listPath:g,itemPath:S,collectionPath:g,itemIndex:m,relatedFields:n,styleScopes:E};G(Sn),G({...Sn,type:Ln})}__name(gn,\"emitClickEvent\");function mn(t,e){G({type:kn,fieldPath:t,value:e}),G({type:Fn,fieldPath:t,value:e})}__name(mn,\"emitFieldChange\");function pt(t){const e=Z;if(!e)return;Z=null,e.target.removeEventListener(\"keydown\",e.keydown),e.target.removeEventListener(\"blur\",e.blur);const n=t?(e.target.innerText??e.target.textContent??\"\").replace(/\\u00a0/g,\" \").trim():\"\";e.contentEditable===null?e.target.removeAttribute(\"contenteditable\"):e.target.setAttribute(\"contenteditable\",e.contentEditable),e.spellcheck===null?e.target.removeAttribute(\"spellcheck\"):e.target.setAttribute(\"spellcheck\",e.spellcheck),e.target.style.outline=e.outline,e.target.style.outlineOffset=e.outlineOffset,e.target.style.cursor=e.cursor,e.target.style.userSelect=e.userSelect,e.target.style.textTransform=e.textTransform,e.target.innerHTML=e.originalHtml,t&&(n!==e.originalText.trim()?(e.field.value=n,ht(e.target,e.field),mn(e.field.path,n)):n||ht(e.target,e.field))}__name(pt,\"finishInlineEdit\");function hn(t,e,n){if(Z?.target===t)return;pt(!0),xt(),ht(t,e),t.removeAttribute(M);const r=typeof e.value==\"string\"||typeof e.value==\"number\"?String(e.value):t.textContent??\"\",o=t.innerHTML,i=__name(l=>{if(l.key===\"Escape\"){l.preventDefault(),pt(!1);return}l.key===\"Enter\"&&e.type!==\"textarea\"&&!l.shiftKey&&(l.preventDefault(),pt(!0))},\"keydown\"),a=__name(()=>pt(!0),\"blur\");if(Z={target:t,field:e,originalText:r,originalHtml:o,contentEditable:t.getAttribute(\"contenteditable\"),spellcheck:t.getAttribute(\"spellcheck\"),outline:t.style.outline,outlineOffset:t.style.outlineOffset,cursor:t.style.cursor,userSelect:t.style.userSelect,textTransform:t.style.textTransform,keydown:i,blur:a},t.setAttribute(\"contenteditable\",Wn?\"plaintext-only\":\"true\"),t.setAttribute(\"spellcheck\",\"true\"),t.textContent=r,t.style.outline=\"2px solid rgba(37, 99, 235, 0.95)\",t.style.outlineOffset=\"3px\",t.style.cursor=\"text\",t.style.userSelect=\"text\",t.style.textTransform=\"none\",t.addEventListener(\"keydown\",i),t.addEventListener(\"blur\",a),t.focus(),n){const l=document,f=l.caretPositionFromPoint?.(n.x,n.y),g=f?(()=>{const m=document.createRange();return m.setStart(f.offsetNode,f.offset),m.collapse(!0),m})():l.caretRangeFromPoint?.(n.x,n.y);if(g){const m=window.getSelection();m?.removeAllRanges(),m?.addRange(g)}}else{const l=document.createRange();l.selectNodeContents(t);const f=window.getSelection();f?.removeAllRanges(),f?.addRange(l)}}__name(hn,\"beginInlineEdit\");let yt=null;function xe(t){if(!B||Z||Ht||yt!==null)return;const e=t.target;yt=requestAnimationFrame(()=>{if(yt=null,!B||Z)return;const n=Ae(e);n&&!n.element.hasAttribute(\"data-fivora-edit-badge\")&&un(n.element)})}__name(xe,\"onEditMouseOver\");function Ce(t){if(!B)return;const e=t.relatedTarget instanceof HTMLElement?t.relatedTarget:null;e&&(e===Q||e===it||it?.contains(e))||xt()}__name(Ce,\"onEditMouseOut\");function Te(t){if(!B||Z&&t.target instanceof Node&&Z.target.contains(t.target))return;const e=t.target instanceof HTMLElement&&t.target.hasAttribute(\"data-fivora-edit-badge\")?t.target:null,n=e?it?{element:it,field:Bt(it)}:null:Ae(t.target),r=n?.element,o=n?.field;if(!r||!o)return;t.preventDefault(),t.stopPropagation();const i=Ee(r,o);!Un&&fn(r,o)&&i.length===0?hn(r,o,e?void 0:{x:t.clientX,y:t.clientY}):gn(r,o,i)}__name(Te,\"onEditClick\");function yn(){B||(B=!0,pe(),ye(),!Ht&&!Q&&(Q=ln()),Ht||(document.addEventListener(\"mouseover\",xe,!0),document.addEventListener(\"mouseout\",Ce,!0)),document.addEventListener(\"click\",Te,!0),document.addEventListener(\"submit\",ve,!0),we())}__name(yn,\"enterEditMode\");function ve(t){B&&(t.preventDefault(),t.stopPropagation())}__name(ve,\"preventEditModeSubmit\");function bn(){if(B){B=!1,Gt=!1,pt(!0),xt(),yt!==null&&(cancelAnimationFrame(yt),yt=null);for(const t of Et)window.clearTimeout(t);if(Et=[],ot!==null){const t=window.cancelIdleCallback;typeof t==\"function\"?t(ot):window.clearTimeout(ot),ot=null}be(),document.querySelectorAll(`[${M}], [${j}]`).forEach(t=>{t.removeAttribute(M),t.removeAttribute(j)}),document.removeEventListener(\"mouseover\",xe,!0),document.removeEventListener(\"mouseout\",Ce,!0),document.removeEventListener(\"click\",Te,!0),document.removeEventListener(\"submit\",ve,!0)}}__name(bn,\"exitEditMode\");const Yn=window.history.pushState.bind(window.history),Jn=window.history.replaceState.bind(window.history);window.history.pushState=(...t)=>{Yn(...t),window.setTimeout(bt,0)},window.history.replaceState=(...t)=>{Jn(...t),window.setTimeout(bt,0)},window.addEventListener(\"popstate\",bt),s();function wn(){return window.location.pathname.match(/^(\\/uploads\\/generated-sites\\/(?:template-preview|[^/]+)\\/[^/]+)/)?.[1]??\"\"}__name(wn,\"resolvePreviewRootPrefix\");function An(t){if(t.target&&t.target!==\"_self\"||t.hasAttribute(\"download\"))return!1;const e=t.getAttribute(\"href\");if(!e||e.startsWith(\"#\")||/^(mailto:|tel:|sms:|whatsapp:|javascript:)/i.test(e))return!1;let n;try{n=new URL(e,window.location.href)}catch{return!1}if(n.origin!==window.location.origin)return!1;const r=wn();if(r&&!n.pathname.startsWith(r))return!1;const o=window.location.pathname.replace(/\\/+$/,\"\")||\"/\",i=n.pathname.replace(/\\/+$/,\"\")||\"/\";return o!==i||n.search!==window.location.search}__name(An,\"isInternalPreviewNavigation\"),document.addEventListener(\"click\",t=>{if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;const e=t.target?.closest?.(\"a[href]\");!e||!An(e)||(t.preventDefault(),t.stopPropagation(),window.location.assign(e.href))},!0),bt()})(function(_){const O=__name((c,w)=>{if(!c||c.trim()===\"null\")return null;try{const A=new URL(c,w??void 0).origin;return A===\"null\"?null:A}catch{return null}},\"normalizeOrigin\"),R=O(_.currentOrigin),I=O(_.ancestorOrigin,R),H=O(_.accessibleParentOrigin,R),s=O(_.referrer,R),u=O(_.rememberedOrigin);return I??H??(s&&s!==R?s:null)??u??s},function(_){const O=__name(p=>!!p&&typeof p==\"object\"&&!Array.isArray(p),\"isRecord\"),R=O(_)&&(_.designCustomizationVersion===1||!!_.elementStyles||!!_.sections);if(!O(_)||!R)return\"\";const I=_,H=__name(p=>{if(typeof p==\"number\")return`${p}px`;if(typeof p!=\"string\")return\"\";const T=p.trim();return!T||T.length>160||/[;{}<>\\r\\n]/.test(T)||/(?:url\\s*\\(|expression\\s*\\(|@import|javascript:)/i.test(T)?\"\":T},\"safeValue\"),s=__name(p=>H(I[p]),\"read\"),u=__name((p,T)=>T?`${p}:${T} !important;`:\"\",\"declaration\"),c=__name((p,T)=>{const v=T.filter(Boolean).join(\"\");return v?`${p}{${v}}`:\"\"},\"rule\"),w=__name(p=>p?[u(\"background\",p),u(\"background-color\",p),\"background-image:none !important;\"]:[],\"backgroundDeclarations\"),A=__name(p=>p===\"start\"?\"flex-start\":p===\"end\"?\"flex-end\":p===\"center\"||p===\"stretch\"?p:\"\",\"alignItems\"),x=__name(p=>{const T=Number(p);return Number.isInteger(T)&&T>=1&&T<=6?`repeat(${T},minmax(0,1fr))`:\"\"},\"gridColumns\"),C=(()=>{const p=Number(s(\"headingScale\"));return Number.isFinite(p)&&p>=.75&&p<=2?String(p):\"\"})(),F=__name(p=>({none:\"none\",subtle:\"0 4px 14px rgba(15,23,42,.08)\",medium:\"0 12px 30px rgba(15,23,42,.14)\",strong:\"0 22px 55px rgba(15,23,42,.22)\"})[p]??\"\",\"shadow\"),W=[[\"--brand-color\",s(\"primaryColor\")],[\"--brand-primary\",s(\"primaryColor\")],[\"--primary-color\",s(\"primaryColor\")],[\"--color-primary\",s(\"primaryColor\")],[\"--brand-secondary\",s(\"secondaryColor\")],[\"--secondary-color\",s(\"secondaryColor\")],[\"--brand-accent\",s(\"accentColor\")],[\"--accent-color\",s(\"accentColor\")],[\"--page-background\",s(\"backgroundColor\")],[\"--page-text\",s(\"textColor\")],[\"--bg-primary\",s(\"canvasColor\")],[\"--bg-secondary\",s(\"surfaceColor\")],[\"--surface\",s(\"surfaceColor\")],[\"--card-bg\",s(\"surfaceColor\")],[\"--background\",s(\"canvasColor\")],[\"--brand-primary\",s(\"brandPrimary\")],[\"--brand-secondary\",s(\"brandSecondary\")],[\"--brand-accent\",s(\"brandAccent\")],[\"--primary\",s(\"brandPrimary\")],[\"--secondary\",s(\"brandSecondary\")],[\"--accent\",s(\"brandAccent\")],[\"--text-primary\",s(\"textPrimary\")],[\"--text-secondary\",s(\"textSecondary\")],[\"--text-muted\",s(\"textMuted\")],[\"--muted\",s(\"textMuted\")],[\"--border-primary\",s(\"borderColor\")],[\"--border-secondary\",s(\"borderColor\")],[\"--border\",s(\"borderColor\")],[\"--card-radius\",s(\"cardRadius\")],[\"--button-radius\",s(\"buttonRadius\")],[\"--image-radius\",s(\"imageRadius\")]],V=new Set([\"sans-serif\",\"serif\",\"monospace\",\"inherit\",\"initial\",\"system-ui\",\"system sans\",\"editorial serif\"]),rt=new Set,L=__name(p=>{if(typeof p==\"string\"&&p.trim()){const T=p.split(\",\")[0].replace(/['\"]/g,\"\").trim();T&&!V.has(T.toLowerCase())&&!T.toLowerCase().includes(\"system\")&&rt.add(T)}},\"addFont\");L(I.headingFont),L(I.bodyFont);const M=O(I.elementStyles)?I.elementStyles:{};for(const p of Object.values(M))O(p)&&L(p.fontFamily);const N=[...Array.from(rt).map(p=>`@import url('https://fonts.googleapis.com/css2?family=${encodeURIComponent(p).replace(/%20/g,\"+\")}:wght@300;400;500;600;700;800&display=swap');`),c(\":root,body\",W.map(([p,T])=>u(p,T))),c(\"html\",[u(\"font-size\",s(\"baseSize\"))]),c(\"body\",[u(\"font-family\",s(\"bodyFont\")?`${s(\"bodyFont\")},sans-serif`:\"\"),u(\"font-weight\",s(\"bodyWeight\")),u(\"line-height\",s(\"bodyLineHeight\")),u(\"letter-spacing\",s(\"letterSpacing\")),...w(s(\"backgroundColor\")),u(\"color\",s(\"textColor\"))]),c(\"body :where(h1,h2,h3,h4,h5,h6)\",[u(\"font-family\",s(\"headingFont\")?`${s(\"headingFont\")},sans-serif`:\"\"),u(\"font-weight\",s(\"headingWeight\")),u(\"line-height\",s(\"headingLineHeight\")),u(\"color\",s(\"headingColor\"))]),c('body :where(p,small,.muted,[class*=\"muted\"])',[u(\"color\",s(\"mutedTextColor\"))]),C?`body h1{font-size:calc(2.5rem * ${C}) !important}body h2{font-size:calc(2rem * ${C}) !important}body h3{font-size:calc(1.5rem * ${C}) !important}body h4{font-size:calc(1.25rem * ${C}) !important}`:\"\",c(\"body header\",[...w(s(\"headerBackgroundColor\")),u(\"min-height\",s(\"headerHeight\"))]),c(\"body footer\",[...w(s(\"footerBackgroundColor\"))]),c(\"body main\",[...w(s(\"backgroundColor\")),u(\"color\",s(\"textColor\"))]),c(\"body main > section,body main [data-preview-page-key] > section\",[u(\"padding-block\",s(\"sectionPadding\")),u(\"text-align\",s(\"textAlign\"))]),c(\"body main :where(section,[data-design-section]) :where(h1,h2,h3,h4,h5,h6,p,[data-design-text])\",[u(\"text-align\",s(\"textAlign\"))]),c(\"body main > section + section,body main [data-preview-page-key] > section + section\",[u(\"margin-top\",s(\"sectionGap\"))]),c('body main :where([class*=\"flex\"],[class*=\"grid\"],[data-design-stack])',[u(\"gap\",s(\"elementGap\"))]),c(\"body main > section:nth-of-type(even),body main [data-preview-page-key] > section:nth-of-type(even)\",w(s(\"surfaceAltColor\"))),c(\"body main > section:nth-of-type(odd),body main [data-preview-page-key] > section:nth-of-type(odd)\",w(s(\"surfaceColor\"))),c(\"body main > section:first-of-type,body main [data-preview-page-key] > section:first-of-type\",[u(\"min-height\",s(\"heroMinHeight\")),u(\"text-align\",s(\"heroTextAlign\"))]),c('body main > section:first-of-type :where(h1,h2,h3,h4,h5,h6,p,[class*=\"container\"],[data-design-text]),body main [data-preview-page-key] > section:first-of-type :where(h1,h2,h3,h4,h5,h6,p,[class*=\"container\"],[data-design-text])',[u(\"text-align\",s(\"heroTextAlign\"))]),c('body main :where([class*=\"container\"],[class~=\"container\"],[data-design-container])',[u(\"max-width\",s(\"contentMaxWidth\")),u(\"padding-inline\",s(\"containerPadding\")),s(\"contentMaxWidth\")?\"margin-inline:auto !important;\":\"\"]),c('body main :where(section,[data-design-section]) > :where([class*=\"flex\"],[data-design-content])',[u(\"align-items\",A(s(\"contentAlign\"))),u(\"justify-items\",s(\"contentAlign\"))]),c(\"body main :where([data-preview-list-path],[data-design-grid])\",[x(s(\"gridColumns\"))?\"display:grid !important;\":\"\",u(\"grid-template-columns\",x(s(\"gridColumns\"))),u(\"gap\",s(\"gridGap\"))]),c('body main :where([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"])',[u(\"width\",s(\"cardWidth\")),s(\"cardWidth\")?\"max-width:100% !important;\":\"\",u(\"min-height\",s(\"cardMinHeight\")),u(\"padding\",s(\"cardPadding\")),u(\"border-radius\",s(\"cardRadius\")),u(\"border-width\",s(\"cardBorderWidth\")),s(\"cardBorderWidth\")?\"border-style:solid !important;\":\"\",u(\"border-color\",s(\"borderColor\")),...w(s(\"cardBackgroundColor\")),u(\"box-shadow\",F(s(\"cardShadow\"))),u(\"text-align\",s(\"cardTextAlign\"))]),c('body main :where([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"]) :where(h1,h2,h3,h4,h5,h6,p,span,[data-design-text])',[u(\"text-align\",s(\"cardTextAlign\"))]),c('body main :where(button,a[class*=\"btn\"],a[class*=\"button\"],[data-design-button])',[u(\"padding\",s(\"buttonPadding\")),u(\"border-radius\",s(\"buttonRadius\")),...w(s(\"buttonBackgroundColor\")),u(\"color\",s(\"buttonTextColor\")),u(\"box-shadow\",F(s(\"buttonShadow\")))]),c(\"body main img\",[u(\"border-radius\",s(\"imageRadius\"))])],z=O(I.sections)?I.sections:{};for(const[p,T]of Object.entries(z)){if(!/^[a-zA-Z0-9_-]{1,64}$/.test(p)||!O(T))continue;const v=__name(k=>H(T[k]),\"sectionRead\"),U=v(\"backgroundColor\"),d=['[class*=\"absolute\"][class*=\"inset-0\"]','[class*=\"fixed\"][class*=\"inset-0\"]','[class*=\"absolute\"][class*=\"inset-x-0\"][class*=\"inset-y-0\"]','[class*=\"absolute\"][class*=\"top-0\"][class*=\"right-0\"][class*=\"bottom-0\"][class*=\"left-0\"]'].join(\",\"),b={all:\"body main section\",hero:\"body main > section:first-of-type,body main [data-preview-page-key] > section:first-of-type\",header:\"body header\",footer:\"body footer\",cards:'body main :where([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"])'}[p]??`body :where([data-preview-page-key=\"${p}\"] > section,[data-design-section=\"${p}\"],[data-section-id=\"${p}\"],section#${p},section.${p})`;N.push(c(b,[T.visible===!1?\"display:none !important;\":\"\",...w(U),u(\"color\",v(\"textColor\")),u(\"min-height\",v(\"minHeight\")),u(\"padding-block\",v(\"padding\")),u(\"max-width\",v(\"contentMaxWidth\")),u(\"gap\",v(\"gap\")),u(\"text-align\",v(\"textAlign\")),u(\"align-items\",A(v(\"contentAlign\")))]),c(`${b} :where(h1,h2,h3,h4,h5,h6)`,[u(\"color\",v(\"headingColor\")),u(\"text-align\",v(\"textAlign\"))]),c(`${b} :where(p,span,[data-design-text])`,[u(\"text-align\",v(\"textAlign\"))]),c(`${b} :where([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"])`,[...w(v(\"cardBackgroundColor\")),u(\"width\",v(\"cardWidth\")),v(\"cardWidth\")?\"max-width:100% !important;\":\"\",u(\"min-height\",v(\"cardMinHeight\")),u(\"border-radius\",v(\"cardRadius\"))]),c(`${b} :where([data-preview-list-path],[data-design-grid])`,[x(v(\"gridColumns\"))?\"display:grid !important;\":\"\",u(\"grid-template-columns\",x(v(\"gridColumns\")))]),c(`${b}::before,${b}::after`,U?[\"background:none !important;\",\"background-image:none !important;\",\"opacity:0 !important;\"]:[]),c(`${b} > :where(${d})`,U?[\"background:none !important;\",\"background-image:none !important;\",\"box-shadow:none !important;\",\"mask-image:none !important;\",\"-webkit-mask-image:none !important;\"]:[]),c(`${b} > :where(${d})::before,${b} > :where(${d})::after`,U?[\"background:none !important;\",\"background-image:none !important;\",\"opacity:0 !important;\"]:[]),c(`${b} > :where(${d}) :where(img,video,canvas,picture)`,U?[\"opacity:0.2 !important;\"]:[]))}const Y=O(I.elementStyles)?I.elementStyles:{},X=[[\"fontFamily\",\"font-family\"],[\"fontSize\",\"font-size\"],[\"lineHeight\",\"line-height\"],[\"fontWeight\",\"font-weight\"],[\"letterSpacing\",\"letter-spacing\"],[\"color\",\"color\"],[\"backgroundColor\",\"background-color\"],[\"textAlign\",\"text-align\"],[\"width\",\"width\"],[\"height\",\"height\"],[\"minWidth\",\"min-width\"],[\"minHeight\",\"min-height\"],[\"maxWidth\",\"max-width\"],[\"maxHeight\",\"max-height\"],[\"marginTop\",\"margin-top\"],[\"marginRight\",\"margin-right\"],[\"marginBottom\",\"margin-bottom\"],[\"marginLeft\",\"margin-left\"],[\"paddingTop\",\"padding-top\"],[\"paddingRight\",\"padding-right\"],[\"paddingBottom\",\"padding-bottom\"],[\"paddingLeft\",\"padding-left\"],[\"padding\",\"padding\"],[\"borderRadius\",\"border-radius\"],[\"borderWidth\",\"border-width\"],[\"borderColor\",\"border-color\"],[\"borderStyle\",\"border-style\"],[\"boxShadow\",\"box-shadow\"]];for(const[p,T]of Object.entries(Y).slice(0,256)){if(!/^[a-zA-Z0-9_.:\\[\\]-]{1,180}$/.test(p)||!O(T))continue;const v=p.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"'),U=(()=>{if(p===\"site:all\")return\"body\";if(p.startsWith(\"page:\"))return`body :where([data-preview-page-key=\"${v.slice(5)}\"])`;if(p.startsWith(\"section:\")){const[,d=\"all\",h=\"\"]=v.split(\":\"),b=d===\"all\"?\"body main\":`body :where([data-preview-page-key=\"${d}\"])`,k=h.match(/^nth-(\\d+)$/)?.[1];return k?`${b} > section:nth-of-type(${k})`:`${b} :where([data-design-section=\"${h}\"],[data-section-id=\"${h}\"],section#${h})`}if(p.includes(\":\")){const[d,h]=v.split(\":\");if(h===\"card\")return`body [data-preview-list-path=\"${d}\"] :is([data-preview-item-path],[data-design-card],.card,[class*=\"card-\"])`;if(h)return`body [data-preview-list-path=\"${d}\"] :is([data-preview-field-path$=\".${h}\"],[data-field-path$=\".${h}\"],[data-content-path$=\".${h}\"])`}return`body :is([data-preview-field-path=\"${v}\"],[data-content-path=\"${v}\"],[data-field-path=\"${v}\"],[data-fivora-resolved-field-path=\"${v}\"],[data-preview-list-path=\"${v}\"],[data-preview-item-path=\"${v}\"])`})();N.push(c(U,X.map(([d,h])=>u(h,H(T[d])))))}return N.filter(Boolean).join(`\n`)},function(_,O){if(!O||typeof O!=\"object\"||Array.isArray(O))return _;const R=__name(A=>{const x=A.trim().toLowerCase(),C=x.match(/^#([0-9a-f]{3})$/);return C?`#${[...C[1]].map(F=>F.repeat(2)).join(\"\")}`:/^#[0-9a-f]{6}$/.test(x)?x:null},\"normalize\"),I=new Map,H=new Map;for(const[A,x]of Object.entries(O).slice(0,64)){if(typeof x!=\"string\")continue;const C=R(A),F=R(x);if(!C||!F||C===F)continue;I.set(C,F);const W=__name(V=>[Number.parseInt(V.slice(1,3),16),Number.parseInt(V.slice(3,5),16),Number.parseInt(V.slice(5,7),16)],\"channels\");H.set(W(C).join(\",\"),W(F)),C[1]===C[2]&&C[3]===C[4]&&C[5]===C[6]&&I.set(`#${C[1]}${C[3]}${C[5]}`,F)}if(I.size===0)return _;const s=[...I.keys()].sort((A,x)=>x.length-A.length).map(A=>A.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")),u=new RegExp(`(?<!\\\\\\\\)(?:${s.join(\"|\")})(?![0-9a-f])`,\"gi\"),c=_.replace(u,A=>{const x=R(A);return x?I.get(x)??A:A}),w=/(rgba?\\(\\s*)(\\d{1,3})(\\s+|,\\s*)(\\d{1,3})(\\s+|,\\s*)(\\d{1,3})/gi;return c.replace(w,(A,x,C,F,W,V,rt)=>{const L=H.get(`${C},${W},${rt}`);return L?`${x}${L[0]}${F}${L[1]}${V}${L[2]}`:A})},\"fivora-universal-design-overrides\",function(_,O){const R=O??document,I=_&&typeof _==\"object\"&&!Array.isArray(_)?_:null,H=I?.requirements&&typeof I.requirements==\"object\"&&!Array.isArray(I.requirements)?I.requirements:null,s=I?.template&&typeof I.template==\"object\"&&!Array.isArray(I.template)?I.template:null,u=s?.structure&&typeof s.structure==\"object\"&&!Array.isArray(s.structure)?s.structure:null,c=Array.isArray(H?.requiredPages),w=Array.isArray(u?.pages);if(!c&&!w)return;const A=c?H?.requiredPages:u?.pages,x=new Set(A.filter(d=>typeof d==\"string\").map(d=>d.trim()).filter(Boolean)),C=Array.isArray(s?.pageDefinitions)?s.pageDefinitions:[],F=Array.isArray(u?.pageDefinitions)?u.pageDefinitions:[],V=(C.length>0?C:F).flatMap(d=>{if(!d||typeof d!=\"object\"||Array.isArray(d))return[];const h=d;if(typeof h.id!=\"string\"||!h.id.trim())return[];const b=h.id.trim(),k=typeof h.label==\"string\"&&h.label.trim()?h.label.trim():b.replace(/_/g,\" \"),J=typeof h.route==\"string\"?h.route.trim():\"\",at=J===\"/\"?\"/\":`/${(J||b).replace(/^\\/+|\\/+$/g,\"\")}`;return[{id:b,label:k,route:at}]}),L=(w?u?.pages:A).filter(d=>typeof d==\"string\").map(d=>d.trim()).filter(Boolean).map((d,h)=>({id:d,label:d.replace(/_/g,\" \"),route:h===0?\"/\":`/${d}`})),M=V.length>0?V:L;if(M.length===0)return;const j=M.filter(d=>!x.has(d.id));if(j.length===0){R.querySelectorAll(\"[data-fivora-page-disabled]\").forEach(d=>d.removeAttribute(\"data-fivora-page-disabled\"));return}let N=R.getElementById(\"fivora-page-selection-style\");(!N||N.tagName!==\"STYLE\")&&(N=R.createElement(\"style\"),N.id=\"fivora-page-selection-style\",N.textContent='[data-fivora-page-disabled=\"true\"]{display:none!important}',R.head.appendChild(N)),R.querySelectorAll(\"[data-fivora-page-disabled]\").forEach(d=>d.removeAttribute(\"data-fivora-page-disabled\"));const z=__name(d=>{let h=d;try{const J=new URL(d,R.baseURI);if(J.origin!==R.location?.origin)return\"\";h=J.pathname}catch{return\"\"}const b=h.match(/^(\\/uploads\\/generated-sites\\/(?:template-preview|preview|live)\\/[^/]+)/)?.[1];b&&h.startsWith(b)&&(h=h.slice(b.length)||\"/\"),h=h.replace(/\\/index\\.html$/i,\"/\").replace(/\\.html$/i,\"\");const k=h.replace(/\\/+$/g,\"\")||\"/\";return k.startsWith(\"/\")?k:`/${k}`},\"normalizePath\"),Y=__name(d=>M.find(h=>{const b=z(h.route);return b?b===\"/\"?d===\"/\":d===b||d.startsWith(`${b}/`):!1}),\"pageForPath\"),X=__name(d=>{for(const h of[\"href\",\"formaction\",\"data-href\",\"data-route\",\"data-url\"]){const b=d.getAttribute(h);if(!b)continue;const k=Y(z(b));if(k)return k}},\"pageForControl\"),p=__name(d=>{d&&d.setAttribute(\"data-fivora-page-disabled\",\"true\")},\"disable\");for(const d of j)for(const h of[\"data-page-key\",\"data-required-page\",\"data-target-page\"])R.querySelectorAll(`[${h}]`).forEach(b=>{b.getAttribute(h)===d.id&&p(b)});const T=Array.from(R.querySelectorAll(\"a[href]\"));for(const d of T){const h=X(d);if(!h||x.has(h.id))continue;if(d.classList.contains(\"absolute\")&&(d.classList.contains(\"inset-0\")||d.classList.contains(\"inset-x-0\")&&d.classList.contains(\"inset-y-0\")))p(d.closest(\"[data-preview-item-path],[data-design-card],article,li\"));else{const k=d.closest(\"li\");p(k&&k.querySelectorAll(\"a[href]\").length===1?k:d)}}const v=Array.from(R.querySelectorAll('button,[role=\"button\"],[data-href],[data-route],[data-url]')).filter(d=>d.tagName!==\"A\");for(const d of v){const h=X(d);if(!h||x.has(h.id))continue;const b=d.closest(\"li\");p(b&&b.querySelectorAll('a[href],button,[role=\"button\"],[data-href],[data-route],[data-url]').length===1?b:d)}const U=R.querySelector(\"main section\");for(const d of R.querySelectorAll(\"main section\")){const h=Array.from(d.querySelectorAll('a[href],button,[role=\"button\"],[data-href],[data-route],[data-url]')),b=h.map(X).filter(at=>!!at),k=d.hasAttribute(\"data-preview-page-key\"),J=d===U||d.hasAttribute(\"data-design-hero\")||/(?:^|\\s)(?:hero|banner|masthead)(?:\\s|$)/i.test(d.className)||!!d.querySelector(\"h1\");!k&&!J&&b.length>0&&b.length===h.length&&b.every(at=>!x.has(at.id))&&p(d)}},function(){const _=window;if(_.__fivoraSectionNavigationInstalled)return;_.__fivoraSectionNavigationInstalled=!0;const O=__name(c=>typeof CSS<\"u\"&&typeof CSS.escape==\"function\"?CSS.escape(c):c.replace(/[^a-zA-Z0-9_-]/g,w=>`\\\\${w.codePointAt(0)?.toString(16)??\"\"} `),\"escapeSelector\"),R=__name(()=>window.location.pathname.match(/^(\\/uploads\\/generated-sites\\/(?:template-preview|preview|live|candidate)\\/[^/]+)/)?.[1]??\"\",\"previewRoot\"),I=__name(c=>{const w=R(),x=(w&&c.pathname.startsWith(w)?c.pathname.slice(w.length):c.pathname).replace(/\\/(?:index\\.html?)?$/i,\"\").split(\"/\").filter(Boolean);return(x[x.length-1]??\"home\").replace(/\\.html?$/i,\"\")},\"routeSectionKey\"),H=__name(c=>{const w=c.getAttribute(\"href\")?.trim();if(!w||c.hasAttribute(\"download\")||c.target&&c.target!==\"_self\"||/^(mailto:|tel:|sms:|whatsapp:|javascript:)/i.test(w))return null;let A;try{A=new URL(w,window.location.href)}catch{return null}if(A.origin!==window.location.origin)return null;const x=A.hash?decodeURIComponent(A.hash.slice(1)).trim():\"\",C=x||I(A);if(!C)return null;if(x){const V=document.getElementById(x);if(V)return{target:V,key:C}}const F=O(C),W=document.querySelector(`section#${F},section[data-fivora-section=\"${F}\"],section[data-section-id=\"${F}\"],[data-preview-page-key=\"${F}\"]`);return W?{target:W,key:C}:null},\"findTarget\"),s=__name(()=>{let c=0;for(const w of document.querySelectorAll(\"header,nav,[data-fivora-sticky-header]\")){const A=window.getComputedStyle(w);if(A.position!==\"fixed\"&&A.position!==\"sticky\")continue;const x=w.getBoundingClientRect();x.height>0&&x.top<=4&&x.bottom>0&&(c=Math.max(c,x.bottom))}return c},\"fixedHeaderOffset\"),u=__name((c,w,A)=>{const x=Math.max(0,window.scrollY+c.getBoundingClientRect().top-s()-8),C=window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;window.scrollTo({top:x,behavior:C?\"auto\":\"smooth\"}),A&&window.location.hash!==`#${w}`&&window.history.pushState(null,\"\",`${window.location.pathname}${window.location.search}#${encodeURIComponent(w)}`)},\"scrollToTarget\");document.addEventListener(\"click\",c=>{if(c.defaultPrevented||c.button!==0||c.metaKey||c.ctrlKey||c.shiftKey||c.altKey)return;const w=c.target?.closest?.(\"a[href]\");if(!w)return;const A=H(w);!A||A.target===w||(c.preventDefault(),c.stopImmediatePropagation(),u(A.target,A.key,!0))},!0),window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>{if(!window.location.hash)return;const c=document.createElement(\"a\");c.href=window.location.hash;const w=H(c);w&&u(w.target,w.key,!1)}))});";
|