@deneb-ui/cli 2.0.111 → 2.0.113
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/bin/index.js +46 -1
- package/package.json +2 -2
- package/src/arc/__tests__/arc.test.cjs +112 -5
- package/src/arc/adapters.cjs +33 -0
- package/src/arc/auto-editability-fixer.cjs +907 -0
- package/src/arc/component-registry.cjs +12 -0
- package/src/arc/field-paths.cjs +4 -1
- package/src/arc/fivora-schema-authority.cjs +9 -1
- package/src/arc/index.cjs +24 -0
- package/src/arc/planner.cjs +13 -0
- package/src/arc/residual.cjs +4 -2
- package/src/arc/semantic.cjs +200 -1
- package/src/arc/transforms/element-transform.cjs +35 -0
- package/src/arc/transforms/index.cjs +1 -0
- package/src/arc/universal-icon-patcher.cjs +220 -0
- package/src/tools/deneb-template-validator.cjs +1 -1
- package/src/tools/template-converter.cjs +76 -24
- package/src/tools/template-preview-focus-bridge.cjs +1 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const rootDir = 'd:/projects/office/deneb/fivora-car-sale';
|
|
7
|
+
const siteDataPath = path.join(rootDir, 'data', 'site-data.json');
|
|
8
|
+
|
|
9
|
+
const siteData = JSON.parse(fs.readFileSync(siteDataPath, 'utf8'));
|
|
10
|
+
if (!siteData.content) siteData.content = {};
|
|
11
|
+
if (!siteData.content.common) siteData.content.common = {};
|
|
12
|
+
|
|
13
|
+
// Helper to ensure nested object path exists
|
|
14
|
+
function setDeep(obj, pathArr, value) {
|
|
15
|
+
let cur = obj;
|
|
16
|
+
for (let i = 0; i < pathArr.length - 1; i++) {
|
|
17
|
+
const k = pathArr[i];
|
|
18
|
+
if (!cur[k] || typeof cur[k] !== 'object') cur[k] = {};
|
|
19
|
+
cur = cur[k];
|
|
20
|
+
}
|
|
21
|
+
if (cur[pathArr[pathArr.length - 1]] === undefined) {
|
|
22
|
+
cur[pathArr[pathArr.length - 1]] = value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 1. Register icons in site-data.json
|
|
27
|
+
setDeep(siteData.content, ['common', 'showroom', 'pinIcon'], 'map-pin');
|
|
28
|
+
setDeep(siteData.content, ['common', 'showroom', 'clockIcon'], 'clock');
|
|
29
|
+
setDeep(siteData.content, ['common', 'showroom', 'navIcon'], 'arrow-up-right');
|
|
30
|
+
setDeep(siteData.content, ['common', 'whatsapp', 'copyIcon'], 'copy');
|
|
31
|
+
setDeep(siteData.content, ['common', 'whatsapp', 'icon'], 'message-circle');
|
|
32
|
+
setDeep(siteData.content, ['common', 'search', 'searchIcon'], 'search');
|
|
33
|
+
setDeep(siteData.content, ['common', 'testDrive', 'calendarIcon'], 'calendar');
|
|
34
|
+
setDeep(siteData.content, ['common', 'testDrive', 'infoIcon'], 'info');
|
|
35
|
+
setDeep(siteData.content, ['common', 'vehicleActions', 'historyIcon'], 'file-text');
|
|
36
|
+
setDeep(siteData.content, ['common', 'vehicleActions', 'testDriveIcon'], 'calendar-check');
|
|
37
|
+
setDeep(siteData.content, ['common', 'vehicleActions', 'financeIcon'], 'landmark');
|
|
38
|
+
setDeep(siteData.content, ['common', 'vehicleActions', 'alertIcon'], 'bell');
|
|
39
|
+
setDeep(siteData.content, ['common', 'vehicleActions', 'calculatorIcon'], 'calculator');
|
|
40
|
+
|
|
41
|
+
if (!siteData.content['trade-in']) siteData.content['trade-in'] = {};
|
|
42
|
+
setDeep(siteData.content, ['trade-in', 'cameraIcon'], 'camera');
|
|
43
|
+
setDeep(siteData.content, ['trade-in', 'upgradeEstimatorIcon'], 'refresh-cw');
|
|
44
|
+
setDeep(siteData.content, ['trade-in', 'step1Icon'], 'car-front');
|
|
45
|
+
setDeep(siteData.content, ['trade-in', 'step2Icon'], 'camera');
|
|
46
|
+
setDeep(siteData.content, ['trade-in', 'step3Icon'], 'handshake');
|
|
47
|
+
setDeep(siteData.content, ['trade-in', 'step4Icon'], 'refresh-cw');
|
|
48
|
+
|
|
49
|
+
if (!siteData.content.about) siteData.content.about = {};
|
|
50
|
+
setDeep(siteData.content, ['about', 'principle1Icon'], 'eye');
|
|
51
|
+
setDeep(siteData.content, ['about', 'principle2Icon'], 'scale');
|
|
52
|
+
setDeep(siteData.content, ['about', 'principle3Icon'], 'message-circle');
|
|
53
|
+
setDeep(siteData.content, ['about', 'principle4Icon'], 'file-search');
|
|
54
|
+
|
|
55
|
+
if (!siteData.content['source-a-car']) siteData.content['source-a-car'] = {};
|
|
56
|
+
setDeep(siteData.content, ['source-a-car', 'step1Icon'], 'clipboard-list');
|
|
57
|
+
setDeep(siteData.content, ['source-a-car', 'step2Icon'], 'message-circle');
|
|
58
|
+
setDeep(siteData.content, ['source-a-car', 'step3Icon'], 'search');
|
|
59
|
+
|
|
60
|
+
if (!siteData.content.compare) siteData.content.compare = {};
|
|
61
|
+
setDeep(siteData.content, ['compare', 'trophyIcon'], 'trophy');
|
|
62
|
+
|
|
63
|
+
fs.writeFileSync(siteDataPath, JSON.stringify(siteData, null, 2), 'utf8');
|
|
64
|
+
console.log('Updated site-data.json with all icon definitions');
|
|
65
|
+
|
|
66
|
+
// 2. Patch components/vehicles/vehicle-actions.tsx
|
|
67
|
+
{
|
|
68
|
+
const filePath = path.join(rootDir, 'components', 'vehicles', 'vehicle-actions.tsx');
|
|
69
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
70
|
+
if (!code.includes('EditableIcon')) {
|
|
71
|
+
code = code.replace(
|
|
72
|
+
/from "@deneb-ui\/ui";?/,
|
|
73
|
+
', EditableIcon } from "@deneb-ui/ui";'
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
// Replace FileTextIcon
|
|
77
|
+
code = code.replace(
|
|
78
|
+
/<FileTextIcon[^>]*data-preview-static="decorative-icon"[^>]*\/>/g,
|
|
79
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mr-1.5" data-preview-field-path="common.vehicleActions.historyIcon" title="Click to edit history icon"><EditableIcon name={(siteData?.content?.common as any)?.vehicleActions?.historyIcon ?? "file-text"} className="size-4" /></span>'
|
|
80
|
+
);
|
|
81
|
+
// Replace CalendarCheckIcon
|
|
82
|
+
code = code.replace(
|
|
83
|
+
/<CalendarCheckIcon[^>]*data-preview-static="decorative-icon"[^>]*\/>/g,
|
|
84
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mr-1.5" data-preview-field-path="common.vehicleActions.testDriveIcon" title="Click to edit test drive icon"><EditableIcon name={(siteData?.content?.common as any)?.vehicleActions?.testDriveIcon ?? "calendar-check"} className="size-4" /></span>'
|
|
85
|
+
);
|
|
86
|
+
// Replace LandmarkIcon
|
|
87
|
+
code = code.replace(
|
|
88
|
+
/<LandmarkIcon[^>]*data-preview-static="decorative-icon"[^>]*\/>/g,
|
|
89
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mr-1.5" data-preview-field-path="common.vehicleActions.financeIcon" title="Click to edit finance icon"><EditableIcon name={(siteData?.content?.common as any)?.vehicleActions?.financeIcon ?? "landmark"} className="size-4" /></span>'
|
|
90
|
+
);
|
|
91
|
+
// Replace BellIcon
|
|
92
|
+
code = code.replace(
|
|
93
|
+
/<BellIcon[^>]*data-preview-static="decorative-icon"[^>]*\/>/g,
|
|
94
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mr-1.5" data-preview-field-path="common.vehicleActions.alertIcon" title="Click to edit alert icon"><EditableIcon name={(siteData?.content?.common as any)?.vehicleActions?.alertIcon ?? "bell"} className="size-4" /></span>'
|
|
95
|
+
);
|
|
96
|
+
// Replace CalculatorIcon
|
|
97
|
+
code = code.replace(
|
|
98
|
+
/<CalculatorIcon[^>]*data-preview-static="decorative-icon"[^>]*\/>/g,
|
|
99
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mr-1.5" data-preview-field-path="common.vehicleActions.calculatorIcon" title="Click to edit calculator icon"><EditableIcon name={(siteData?.content?.common as any)?.vehicleActions?.calculatorIcon ?? "calculator"} className="size-4" /></span>'
|
|
100
|
+
);
|
|
101
|
+
fs.writeFileSync(filePath, code, 'utf8');
|
|
102
|
+
console.log('Patched components/vehicles/vehicle-actions.tsx');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 3. Patch app/(public)/trade-in/page.tsx
|
|
106
|
+
{
|
|
107
|
+
const filePath = path.join(rootDir, 'app', '(public)', 'trade-in', 'page.tsx');
|
|
108
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
109
|
+
if (!code.includes('EditableIcon')) {
|
|
110
|
+
code = 'import { EditableIcon } from "@/src/components/ui/EditableIcon";\n' + code;
|
|
111
|
+
}
|
|
112
|
+
code = code.replace(
|
|
113
|
+
/<RefreshCwIcon[^>]*data-preview-static="decorative-icon"[^>]*\/>/g,
|
|
114
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mr-1.5" data-preview-field-path="trade-in.upgradeEstimatorIcon" title="Click to edit estimator icon"><EditableIcon name={(siteData?.content?.["trade-in"] as any)?.upgradeEstimatorIcon ?? "refresh-cw"} className="size-4" /></span>'
|
|
115
|
+
);
|
|
116
|
+
code = code.replace(
|
|
117
|
+
/<Icon className="size-6 text-primary" aria-hidden data-preview-static="decorative-icon" \/>/g,
|
|
118
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 text-primary" data-preview-field-path={`trade-in.step${i + 1}Icon`} title="Click to edit step icon"><EditableIcon name={(siteData?.content?.["trade-in"] as any)?.[`step${i + 1}Icon`] ?? ["car-front", "camera", "handshake", "refresh-cw"][i]} className="size-6" /></span>'
|
|
119
|
+
);
|
|
120
|
+
fs.writeFileSync(filePath, code, 'utf8');
|
|
121
|
+
console.log('Patched app/(public)/trade-in/page.tsx');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// 4. Patch app/(public)/about/page.tsx
|
|
125
|
+
{
|
|
126
|
+
const filePath = path.join(rootDir, 'app', '(public)', 'about', 'page.tsx');
|
|
127
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
128
|
+
if (!code.includes('EditableIcon')) {
|
|
129
|
+
code = 'import { EditableIcon } from "@/src/components/ui/EditableIcon";\n' + code;
|
|
130
|
+
}
|
|
131
|
+
code = code.replace(
|
|
132
|
+
/<Icon className="mb-4 size-6 text-primary" aria-hidden data-preview-static="decorative-icon" \/>/g,
|
|
133
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 text-primary mb-4" data-preview-field-path={`about.principle${PRINCIPLES.findIndex(p => p.title === title) + 1}Icon`} title="Click to edit principle icon"><EditableIcon name={(siteData?.content?.about as any)?.[`principle${PRINCIPLES.findIndex(p => p.title === title) + 1}Icon`] ?? ["eye", "scale", "message-circle", "file-search"][PRINCIPLES.findIndex(p => p.title === title)]} className="size-6" /></span>'
|
|
134
|
+
);
|
|
135
|
+
fs.writeFileSync(filePath, code, 'utf8');
|
|
136
|
+
console.log('Patched app/(public)/about/page.tsx');
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// 5. Patch app/(public)/source-a-car/page.tsx
|
|
140
|
+
{
|
|
141
|
+
const filePath = path.join(rootDir, 'app', '(public)', 'source-a-car', 'page.tsx');
|
|
142
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
143
|
+
if (!code.includes('EditableIcon')) {
|
|
144
|
+
code = 'import { EditableIcon } from "@/src/components/ui/EditableIcon";\n' + code;
|
|
145
|
+
}
|
|
146
|
+
code = code.replace(
|
|
147
|
+
/<Icon className="size-5" aria-hidden data-preview-static="decorative-icon" \/>/g,
|
|
148
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 text-primary" data-preview-field-path={`source-a-car.step${i + 1}Icon`} title="Click to edit step icon"><EditableIcon name={(siteData?.content?.["source-a-car"] as any)?.[`step${i + 1}Icon`] ?? ["clipboard-list", "message-circle", "search"][i]} className="size-5" /></span>'
|
|
149
|
+
);
|
|
150
|
+
fs.writeFileSync(filePath, code, 'utf8');
|
|
151
|
+
console.log('Patched app/(public)/source-a-car/page.tsx');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// 6. Patch components/vehicles/compare-view.tsx
|
|
155
|
+
{
|
|
156
|
+
const filePath = path.join(rootDir, 'components', 'vehicles', 'compare-view.tsx');
|
|
157
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
158
|
+
if (!code.includes('EditableIcon')) {
|
|
159
|
+
code = 'import { EditableIcon } from "@/src/components/ui/EditableIcon";\n' + code;
|
|
160
|
+
}
|
|
161
|
+
code = code.replace(
|
|
162
|
+
/<TrophyIcon className="mt-0.5 size-5 shrink-0 text-primary" aria-hidden data-preview-static="decorative-icon" \/>/g,
|
|
163
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mt-0.5 shrink-0 text-primary" data-preview-field-path="compare.trophyIcon" title="Click to edit trophy icon"><EditableIcon name={(siteData?.content?.compare as any)?.trophyIcon ?? "trophy"} className="size-5" /></span>'
|
|
164
|
+
);
|
|
165
|
+
fs.writeFileSync(filePath, code, 'utf8');
|
|
166
|
+
console.log('Patched components/vehicles/compare-view.tsx');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// 7. Patch components/whatsapp/trade-in-form.tsx
|
|
170
|
+
{
|
|
171
|
+
const filePath = path.join(rootDir, 'components', 'whatsapp', 'trade-in-form.tsx');
|
|
172
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
173
|
+
if (!code.includes('EditableIcon')) {
|
|
174
|
+
code = 'import { EditableIcon } from "@/src/components/ui/EditableIcon";\n' + code;
|
|
175
|
+
}
|
|
176
|
+
code = code.replace(
|
|
177
|
+
/<CameraIcon className="mt-0.5 size-4 shrink-0 text-primary" aria-hidden data-preview-static="decorative-icon" \/>/g,
|
|
178
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mt-0.5 shrink-0 text-primary" data-preview-field-path="trade-in.cameraIcon" title="Click to edit camera icon"><EditableIcon name={(siteData?.content?.["trade-in"] as any)?.cameraIcon ?? "camera"} className="size-4" /></span>'
|
|
179
|
+
);
|
|
180
|
+
fs.writeFileSync(filePath, code, 'utf8');
|
|
181
|
+
console.log('Patched components/whatsapp/trade-in-form.tsx');
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// 8. Patch components/whatsapp/whatsapp-provider.tsx
|
|
185
|
+
{
|
|
186
|
+
const filePath = path.join(rootDir, 'components', 'whatsapp', 'whatsapp-provider.tsx');
|
|
187
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
188
|
+
if (!code.includes('EditableIcon')) {
|
|
189
|
+
code = 'import { EditableIcon } from "@/src/components/ui/EditableIcon";\n' + code;
|
|
190
|
+
}
|
|
191
|
+
code = code.replace(
|
|
192
|
+
/<CopyIcon data-icon="inline-start" data-preview-static="decorative-icon" \/>/g,
|
|
193
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mr-1.5" data-preview-field-path="common.whatsapp.copyIcon" title="Click to edit copy icon"><EditableIcon name={(siteData?.content?.common as any)?.whatsapp?.copyIcon ?? "copy"} className="size-4" /></span>'
|
|
194
|
+
);
|
|
195
|
+
fs.writeFileSync(filePath, code, 'utf8');
|
|
196
|
+
console.log('Patched components/whatsapp/whatsapp-provider.tsx');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// 9. Patch components/vehicles/quick-search.tsx
|
|
200
|
+
{
|
|
201
|
+
const filePath = path.join(rootDir, 'components', 'vehicles', 'quick-search.tsx');
|
|
202
|
+
let code = fs.readFileSync(filePath, 'utf8');
|
|
203
|
+
if (!code.includes('EditableIcon')) {
|
|
204
|
+
code = 'import { EditableIcon } from "@/src/components/ui/EditableIcon";\nimport { useSiteData } from "@deneb-ui/ui";\n' + code;
|
|
205
|
+
}
|
|
206
|
+
if (!code.includes('const siteData = useSiteData();')) {
|
|
207
|
+
code = code.replace(
|
|
208
|
+
/(export function QuickSearch\([^)]*\)\s*\{)/,
|
|
209
|
+
'$1\n const siteData = useSiteData();'
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
code = code.replace(
|
|
213
|
+
/<SearchIcon data-icon="inline-start" data-preview-static="decorative-icon" \/>/g,
|
|
214
|
+
'<span className="inline-flex cursor-pointer transition-transform hover:scale-110 mr-1.5" data-preview-field-path="common.search.searchIcon" title="Click to edit search icon"><EditableIcon name={(siteData?.content?.common as any)?.search?.searchIcon ?? "search"} className="size-4" /></span>'
|
|
215
|
+
);
|
|
216
|
+
fs.writeFileSync(filePath, code, 'utf8');
|
|
217
|
+
console.log('Patched components/vehicles/quick-search.tsx');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
console.log('All files successfully updated with EditableIcon!');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
var Mi=Object.create;var We=Object.defineProperty;var Bi=Object.getOwnPropertyDescriptor;var ji=Object.getOwnPropertyNames;var Vi=Object.getPrototypeOf,Ui=Object.prototype.hasOwnProperty;var F=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},zi=(e,t)=>{for(var n in t)We(e,n,{get:t[n],enumerable:!0})},bn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ji(t))!Ui.call(e,i)&&i!==n&&We(e,i,{get:()=>t[i],enumerable:!(r=Bi(t,i))||r.enumerable});return e};var Ct=(e,t,n)=>(n=e!=null?Mi(Vi(e)):{},bn(t||!e||!e.__esModule?We(n,"default",{value:e,enumerable:!0}):n,e)),Hi=e=>bn(We({},"__esModule",{value:!0}),e);var kt=F((ya,Sn)=>{Sn.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Ge=F(wn=>{var Tn={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function qi(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(n,r)=>t[r]||"")),new Error("ADM-ZIP: "+e)}}for(let e of Object.keys(Tn))wn[e]=qi(Tn[e])});var kn=F((ba,Cn)=>{var Wi=require("fs"),j=require("path"),Pn=kt(),Gi=Ge(),Zi=typeof process=="object"&&process.platform==="win32",In=e=>typeof e=="object"&&e!==null,xn=new Uint32Array(256).map((e,t)=>{for(let n=0;n<8;n++)(t&1)!==0?t=3988292384^t>>>1:t>>>=1;return t>>>0});function $(e){this.sep=j.sep,this.fs=Wi,In(e)&&In(e.fs)&&typeof e.fs.statSync=="function"&&(this.fs=e.fs)}Cn.exports=$;$.prototype.makeDir=function(e){let t=this;function n(r){let i=r.split(t.sep)[0];r.split(t.sep).forEach(function(s){if(!(!s||s.substr(-1,1)===":")){i+=t.sep+s;var o;try{o=t.fs.statSync(i)}catch(a){if(a.message&&a.message.startsWith("ENOENT"))t.fs.mkdirSync(i);else throw a}if(o&&o.isFile())throw Gi.FILE_IN_THE_WAY(`"${i}"`)}})}n(e)};$.prototype.writeFileTo=function(e,t,n,r){let i=this;if(i.fs.existsSync(e)){if(!n)return!1;var s=i.fs.statSync(e);if(s.isDirectory())return!1}var o=j.dirname(e);i.fs.existsSync(o)||i.makeDir(o);var a;try{a=i.fs.openSync(e,"w",438)}catch{i.fs.chmodSync(e,438),a=i.fs.openSync(e,"w",438)}if(a)try{i.fs.writeSync(a,t,0,t.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(e,r||438),!0};$.prototype.writeFileToAsync=function(e,t,n,r,i){typeof r=="function"&&(i=r,r=void 0);let s=this;s.fs.exists(e,function(o){if(o&&!n)return i(!1);s.fs.stat(e,function(a,l){if(o&&l&&l.isDirectory())return i(!1);var u=j.dirname(e);s.fs.exists(u,function(f){if(!f)try{s.makeDir(u)}catch{return i(!1)}let g=function(E){s.fs.write(E,t,0,t.length,0,function(S){s.fs.close(E,function(){if(S)return i(!1);s.fs.chmod(e,r||438,function(){i(!0)})})})};s.fs.open(e,"w",438,function(E,S){E?s.fs.chmod(e,438,function(){s.fs.open(e,"w",438,function(m,d){if(m||!d)return i(!1);g(d)})}):S?g(S):i(!1)})})})})};$.prototype.findFiles=function(e){let t=this;function n(r,i,s,o){typeof i=="boolean"&&(s=i,i=void 0);let a=[];return t.fs.readdirSync(r).forEach(function(l){let u=j.join(r,l),f=t.fs.statSync(u);if((!i||i.test(u))&&a.push(j.normalize(u)+(f.isDirectory()?t.sep:"")),f.isDirectory()&&s){let g=t.fs.realpathSync(u);o.has(g)||(o.add(g),a=a.concat(n(u,i,s,o)))}}),a}return n(e,void 0,!0,new Set([t.fs.realpathSync(e)]))};$.prototype.findFilesAsync=function(e,t){let n=this,r=[],i=!1,s=function(a){i||(i=!0,t(a,a?void 0:r))},o=function(a,l,u){n.fs.readdir(a,function(f,g){if(f)return u(f);let E=g.length;if(!E)return u();g.forEach(function(S){let m=j.join(a,S);n.fs.stat(m,function(d,p){if(d)return u(d);if(!p){--E||u();return}if(r.push(j.normalize(m)+(p.isDirectory()?n.sep:"")),!p.isDirectory()){--E||u();return}n.fs.realpath(m,function(h,b){if(h)return u(h);if(l.has(b)){--E||u();return}l.add(b),o(m,l,function(c){if(c)return u(c);--E||u()})})})})})};n.fs.realpath(e,function(a,l){if(a)return s(a);o(e,new Set([l]),s)})};$.prototype.getAttributes=function(){};$.prototype.setAttributes=function(){};$.crc32update=function(e,t){return xn[(e^t)&255]^e>>>8};$.crc32=function(e){typeof e=="string"&&(e=Buffer.from(e,"utf8"));let t=e.length,n=-1;for(let r=0;r<t;)n=$.crc32update(n,e[r++]);return~n>>>0};$.methodToString=function(e){switch(e){case Pn.STORED:return"STORED ("+e+")";case Pn.DEFLATED:return"DEFLATED ("+e+")";default:return"UNSUPPORTED ("+e+")"}};$.canonical=function(e){if(!e)return"";let t=j.posix.normalize("/"+e.split("\\").join("/"));return j.join(".",t)};$.zipnamefix=function(e){if(!e)return"";let t=j.posix.normalize("/"+e.split("\\").join("/"));return j.posix.join(".",t)};$.findLast=function(e,t){if(!Array.isArray(e))throw new TypeError("arr is not array");let n=e.length>>>0;for(let r=n-1;r>=0;r--)if(t(e[r],r,e))return e[r]};$.sanitize=function(e,t){e=j.resolve(j.normalize(e));for(var n=t.split("/"),r=0,i=n.length;r<i;r++){var s=j.normalize(j.join(e,n.slice(r,i).join(j.sep)));if(s===e||s.startsWith(e+j.sep))return s}return j.normalize(j.join(e,j.basename(t)))};$.toBuffer=function(t,n){return Buffer.isBuffer(t)?t:t instanceof Uint8Array?Buffer.from(t):typeof t=="string"?n(t):Buffer.alloc(0)};$.readBigUInt64LE=function(e,t){let n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n};$.writeBigUInt64LE=function(e,t,n){let r=t>>>0,i=Math.floor(t/4294967296)>>>0;e.writeUInt32LE(r,n),e.writeUInt32LE(i,n+4)};$.fromDOS2Date=function(e){return new Date((e>>25&127)+1980,Math.max((e>>21&15)-1,0),Math.max(e>>16&31,1),e>>11&31,e>>5&63,(e&31)<<1)};$.fromDate2DOS=function(e){let t=0,n=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),n=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|n};$.isWin=Zi;$.crcTable=xn});var _n=F((Sa,An)=>{var Ki=require("path");An.exports=function(e,{fs:t}){var n=e||"",r=s(),i=null;function s(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return n&&t.existsSync(n)?(i=t.statSync(n),r.directory=i.isDirectory(),r.mtime=i.mtime,r.atime=i.atime,r.executable=(73&i.mode)!==0,r.readonly=(128&i.mode)===0,r.hidden=Ki.basename(n)[0]==="."):console.warn("Invalid path: "+n),{get directory(){return r.directory},get readOnly(){return r.readonly},get hidden(){return r.hidden},get mtime(){return r.mtime},get atime(){return r.atime},get executable(){return r.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:n,isDirectory:r.directory,isReadOnly:r.readonly,isHidden:r.hidden,isExecutable:r.executable,mTime:r.mtime,aTime:r.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Fn=F((Ta,vn)=>{vn.exports={efs:!0,encode:e=>Buffer.from(e,"utf8"),decode:e=>e.toString("utf8")}});var Ie=F((wa,Pe)=>{Pe.exports=kn();Pe.exports.Constants=kt();Pe.exports.Errors=Ge();Pe.exports.FileAttr=_n();Pe.exports.decoder=Fn()});var Ln=F((Pa,Rn)=>{var ue=Ie(),I=ue.Constants;Rn.exports=function(){var e=20,t=10,n=0,r=0,i=0,s=0,o=0,a=0,l=0,u=0,f=0,g=0,E=0,S=0,m=0;e|=ue.isWin?2560:768,n|=I.FLG_EFS;let d={extraLen:0},p=c=>Math.max(0,c)>>>0,h=c=>Math.max(0,c)&65535,b=c=>Math.max(0,c)&255;return i=ue.fromDate2DOS(new Date),{get made(){return e},set made(c){e=c},get version(){return t},set version(c){t=c},get flags(){return n},set flags(c){n=c},get flags_efs(){return(n&I.FLG_EFS)>0},set flags_efs(c){c?n|=I.FLG_EFS:n&=~I.FLG_EFS},get flags_desc(){return(n&I.FLG_DESC)>0},set flags_desc(c){c?n|=I.FLG_DESC:n&=~I.FLG_DESC},get method(){return r},set method(c){switch(c){case I.STORED:this.version=10;break;case I.DEFLATED:default:this.version=20}r=c},get time(){return ue.fromDOS2Date(this.timeval)},set time(c){c=new Date(c),this.timeval=ue.fromDate2DOS(c)},get timeval(){return i},set timeval(c){i=p(c)},get timeHighByte(){return b(i>>>8)},get crc(){return s},set crc(c){s=p(c)},get compressedSize(){return o},set compressedSize(c){o=p(c)},get size(){return a},set size(c){a=p(c)},get fileNameLength(){return l},set fileNameLength(c){l=c},get extraLength(){return u},set extraLength(c){u=c},get extraLocalLength(){return d.extraLen},set extraLocalLength(c){d.extraLen=c},get commentLength(){return f},set commentLength(c){f=c},get diskNumStart(){return g},set diskNumStart(c){g=p(c)},get inAttr(){return E},set inAttr(c){E=p(c)},get attr(){return S},set attr(c){S=p(c)},get fileAttr(){return(S||0)>>16&4095},get offset(){return m},set offset(c){m=p(c)},get encrypted(){return(n&I.FLG_ENC)===I.FLG_ENC},get centralHeaderSize(){return I.CENHDR+l+u+f},get realDataOffset(){return m+I.LOCHDR+d.fnameLen+d.extraLen},get localHeader(){return d},loadLocalHeaderFromBinary:function(c){var y=c.slice(m,m+I.LOCHDR);if(y.readUInt32LE(0)!==I.LOCSIG)throw ue.Errors.INVALID_LOC();d.version=y.readUInt16LE(I.LOCVER),d.flags=y.readUInt16LE(I.LOCFLG),d.flags_desc=(d.flags&I.FLG_DESC)>0,d.method=y.readUInt16LE(I.LOCHOW),d.time=y.readUInt32LE(I.LOCTIM),d.crc=y.readUInt32LE(I.LOCCRC),d.compressedSize=y.readUInt32LE(I.LOCSIZ),d.size=y.readUInt32LE(I.LOCLEN),d.fnameLen=y.readUInt16LE(I.LOCNAM),d.extraLen=y.readUInt16LE(I.LOCEXT);let w=m+I.LOCHDR+d.fnameLen,T=w+d.extraLen;return c.slice(w,T)},loadFromBinary:function(c){if(c.length!==I.CENHDR||c.readUInt32LE(0)!==I.CENSIG)throw ue.Errors.INVALID_CEN();e=c.readUInt16LE(I.CENVEM),t=c.readUInt16LE(I.CENVER),n=c.readUInt16LE(I.CENFLG),r=c.readUInt16LE(I.CENHOW),i=c.readUInt32LE(I.CENTIM),s=c.readUInt32LE(I.CENCRC),o=c.readUInt32LE(I.CENSIZ),a=c.readUInt32LE(I.CENLEN),l=c.readUInt16LE(I.CENNAM),u=c.readUInt16LE(I.CENEXT),f=c.readUInt16LE(I.CENCOM),g=c.readUInt16LE(I.CENDSK),E=c.readUInt16LE(I.CENATT),S=c.readUInt32LE(I.CENATX),m=c.readUInt32LE(I.CENOFF)},localHeaderToBinary:function(){var c=Buffer.alloc(I.LOCHDR);return c.writeUInt32LE(I.LOCSIG,0),c.writeUInt16LE(t,I.LOCVER),c.writeUInt16LE(n&~I.FLG_DESC,I.LOCFLG),c.writeUInt16LE(r,I.LOCHOW),c.writeUInt32LE(i,I.LOCTIM),c.writeUInt32LE(s,I.LOCCRC),c.writeUInt32LE(o,I.LOCSIZ),c.writeUInt32LE(a,I.LOCLEN),c.writeUInt16LE(l,I.LOCNAM),c.writeUInt16LE(d.extraLen,I.LOCEXT),c},centralHeaderToBinary:function(){var c=Buffer.alloc(I.CENHDR+l+u+f);return c.writeUInt32LE(I.CENSIG,0),c.writeUInt16LE(e,I.CENVEM),c.writeUInt16LE(t,I.CENVER),c.writeUInt16LE(n&~I.FLG_DESC,I.CENFLG),c.writeUInt16LE(r,I.CENHOW),c.writeUInt32LE(i,I.CENTIM),c.writeUInt32LE(s,I.CENCRC),c.writeUInt32LE(o,I.CENSIZ),c.writeUInt32LE(a,I.CENLEN),c.writeUInt16LE(l,I.CENNAM),c.writeUInt16LE(u,I.CENEXT),c.writeUInt16LE(f,I.CENCOM),c.writeUInt16LE(g,I.CENDSK),c.writeUInt16LE(E,I.CENATT),c.writeUInt32LE(S,I.CENATX),c.writeUInt32LE(m,I.CENOFF),c},toJSON:function(){let c=function(y){return y+" bytes"};return{made:e,version:t,flags:n,method:ue.methodToString(r),time:this.time,crc:"0x"+s.toString(16).toUpperCase(),compressedSize:c(o),size:c(a),fileNameLength:c(l),extraLength:c(u),commentLength:c(f),diskNumStart:g,inAttr:E,attr:S,offset:m,centralHeaderSize:c(I.CENHDR+l+u+f)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Nn=F((Ia,Dn)=>{var Y=Ie(),C=Y.Constants;Dn.exports=function(){var e=0,t=0,n=0,r=0,i=0;let s=()=>e>C.EF_ZIP64_OR_16||t>C.EF_ZIP64_OR_16||n>C.EF_ZIP64_OR_32||r>C.EF_ZIP64_OR_32;return{get diskEntries(){return e},set diskEntries(o){e=t=o},get totalEntries(){return t},set totalEntries(o){t=e=o},get size(){return n},set size(o){n=o},get offset(){return r},set offset(o){r=o},get commentLength(){return i},set commentLength(o){i=o},get mainHeaderSize(){return(s()?C.ZIP64HDR+C.END64HDR:0)+C.ENDHDR+i},loadFromBinary:function(o){if((o.length!==C.ENDHDR||o.readUInt32LE(0)!==C.ENDSIG)&&(o.length<C.ZIP64HDR||o.readUInt32LE(0)!==C.ZIP64SIG))throw Y.Errors.INVALID_END();o.readUInt32LE(0)===C.ENDSIG?(e=o.readUInt16LE(C.ENDSUB),t=o.readUInt16LE(C.ENDTOT),n=o.readUInt32LE(C.ENDSIZ),r=o.readUInt32LE(C.ENDOFF),i=o.readUInt16LE(C.ENDCOM)):(e=Y.readBigUInt64LE(o,C.ZIP64SUB),t=Y.readBigUInt64LE(o,C.ZIP64TOT),n=Y.readBigUInt64LE(o,C.ZIP64SIZB),r=Y.readBigUInt64LE(o,C.ZIP64OFF),i=0)},toBinary:function(){if(!s()){var o=Buffer.alloc(C.ENDHDR+i);return o.writeUInt32LE(C.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(e,C.ENDSUB),o.writeUInt16LE(t,C.ENDTOT),o.writeUInt32LE(n,C.ENDSIZ),o.writeUInt32LE(r,C.ENDOFF),o.writeUInt16LE(i,C.ENDCOM),o.fill(" ",C.ENDHDR),o}var o=Buffer.alloc(this.mainHeaderSize);let a=0;o.writeUInt32LE(C.ZIP64SIG,a),Y.writeBigUInt64LE(o,C.ZIP64HDR-C.ZIP64LEAD,a+C.ZIP64SIZE),o.writeUInt16LE(45,a+C.ZIP64VEM),o.writeUInt16LE(45,a+C.ZIP64VER),o.writeUInt32LE(0,a+C.ZIP64DSK),o.writeUInt32LE(0,a+C.ZIP64DSKDIR),Y.writeBigUInt64LE(o,e,a+C.ZIP64SUB),Y.writeBigUInt64LE(o,t,a+C.ZIP64TOT),Y.writeBigUInt64LE(o,n,a+C.ZIP64SIZB),Y.writeBigUInt64LE(o,r,a+C.ZIP64OFF);let l=r+n;return a+=C.ZIP64HDR,o.writeUInt32LE(C.END64SIG,a),o.writeUInt32LE(0,a+C.END64START),Y.writeBigUInt64LE(o,l,a+C.END64OFF),o.writeUInt32LE(1,a+C.END64NUMDISKS),a+=C.END64HDR,o.writeUInt32LE(C.ENDSIG,a),o.writeUInt32LE(0,a+4),o.writeUInt16LE(Math.min(e,C.EF_ZIP64_OR_16),a+C.ENDSUB),o.writeUInt16LE(Math.min(t,C.EF_ZIP64_OR_16),a+C.ENDTOT),o.writeUInt32LE(Math.min(n,C.EF_ZIP64_OR_32),a+C.ENDSIZ),o.writeUInt32LE(Math.min(r,C.EF_ZIP64_OR_32),a+C.ENDOFF),o.writeUInt16LE(i,a+C.ENDCOM),o.fill(" ",a+C.ENDHDR),o},toJSON:function(){let o=function(a,l){let u=a.toString(16).toUpperCase();for(;u.length<l;)u="0"+u;return"0x"+u};return{diskEntries:e,totalEntries:t,size:n+" bytes",offset:o(r,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var _t=F(At=>{At.EntryHeader=Ln();At.MainHeader=Nn()});var $n=F((Ca,On)=>{On.exports=function(e){var t=require("zlib"),n={chunkSize:(parseInt(e.length/1024)+1)*1024};return{deflate:function(){return t.deflateRawSync(e,n)},deflateAsync:function(r){var i=t.createDeflateRaw(n),s=[],o=0;i.on("data",function(a){s.push(a),o+=a.length}),i.on("end",function(){var a=Buffer.alloc(o),l=0;a.fill(0);for(var u=0;u<s.length;u++){var f=s[u];f.copy(a,l),l+=f.length}r&&r(a)}),i.end(e)}}}});var Bn=F((ka,Mn)=>{var Yi=+(process?.versions?.node??"").split(".")[0]||0;Mn.exports=function(e,t){var n=require("zlib");let r=Yi>=15&&t>0?{maxOutputLength:t}:{};return{inflate:function(){return n.inflateRawSync(e,r)},inflateAsync:function(i){var s=n.createInflateRaw(r),o=[],a=0;s.on("data",function(l){o.push(l),a+=l.length}),s.on("end",function(){var l=Buffer.alloc(a),u=0;l.fill(0);for(var f=0;f<o.length;f++){var g=o[f];g.copy(l,u),u+=g.length}i&&i(l)}),s.end(e)}}}});var Hn=F((Aa,zn)=>{"use strict";var{randomFillSync:jn}=require("crypto"),Ji=Ge(),Xi=new Uint32Array(256).map((e,t)=>{for(let n=0;n<8;n++)(t&1)!==0?t=t>>>1^3988292384:t>>>=1;return t>>>0}),Un=(e,t)=>Math.imul(e,t)>>>0,Vn=(e,t)=>Xi[(e^t)&255]^e>>>8,Ne=()=>typeof jn=="function"?jn(Buffer.alloc(12)):Ne.node();Ne.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let n=0;n<t;n++)e[n]=Math.random()*256&255;return e};var Ze={genSalt:Ne};function Ke(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let n=0;n<t.length;n++)this.updateKeys(t[n])}Ke.prototype.updateKeys=function(e){let t=this.keys;return t[0]=Vn(t[0],e),t[1]+=t[0]&255,t[1]=Un(t[1],134775813)+1,t[2]=Vn(t[2],t[1]>>>24),e};Ke.prototype.next=function(){let e=(this.keys[2]|2)>>>0;return Un(e,e^1)>>8&255};function Qi(e){let t=new Ke(e);return function(n){let r=Buffer.alloc(n.length),i=0;for(let s of n)r[i++]=t.updateKeys(s^t.next());return r}}function eo(e){let t=new Ke(e);return function(n,r,i=0){r||(r=Buffer.alloc(n.length));for(let s of n){let o=t.next();r[i++]=s^o,t.updateKeys(s)}return r}}function to(e,t,n){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=Qi(n),i=r(e.slice(0,12)),s=(t.flags&8)===8?t.timeHighByte:t.crc>>>24;if(i[11]!==s)throw Ji.WRONG_PASSWORD();return r(e.slice(12))}function no(e){Buffer.isBuffer(e)&&e.length>=12?Ze.genSalt=function(){return e.slice(0,12)}:e==="node"?Ze.genSalt=Ne.node:Ze.genSalt=Ne}function ro(e,t,n,r=!1){e==null&&(e=Buffer.alloc(0)),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let i=eo(n),s=Ze.genSalt();s[11]=t.crc>>>24&255,r&&(s[10]=t.crc>>>16&255);let o=Buffer.alloc(e.length+12);return i(s,o),i(e,o,12)}zn.exports={decrypt:to,encrypt:ro,_salter:no}});var qn=F(Ye=>{Ye.Deflater=$n();Ye.Inflater=Bn();Ye.ZipCrypto=Hn()});var Ft=F((va,Wn)=>{var D=Ie(),io=_t(),K=D.Constants,vt=qn();Wn.exports=function(e,t){var n=new io.EntryHeader,r=Buffer.alloc(0),i=Buffer.alloc(0),s=!1,o=null,a=Buffer.alloc(0),l=Buffer.alloc(0),u=!0;let f=e,g=typeof f.decoder=="object"?f.decoder:D.decoder;u=g.hasOwnProperty("efs")?g.efs:!1;function E(){return!t||!(t instanceof Uint8Array)?Buffer.alloc(0):(l=n.loadLocalHeaderFromBinary(t),t.slice(n.realDataOffset,n.realDataOffset+n.compressedSize))}function S(c){let y=n.flags_desc||n.localHeader.flags_desc?n.crc:n.localHeader.crc;return D.crc32(c)===y}function m(c,y,w){if(typeof y>"u"&&typeof c=="string"&&(w=c,c=void 0),s)return c&&y&&y(Buffer.alloc(0),D.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var T=E();if(T.length===0)return c&&y&&y(T),T;if(n.encrypted){if(typeof w!="string"&&!Buffer.isBuffer(w))throw D.Errors.INVALID_PASS_PARAM();T=vt.ZipCrypto.decrypt(T,n,w)}var P;switch(n.method){case D.Constants.STORED:if(P=Buffer.alloc(T.length),T.copy(P),S(P))return c&&y&&y(P),P;throw c&&y&&y(P,D.Errors.BAD_CRC()),D.Errors.BAD_CRC();case D.Constants.DEFLATED:var x=new vt.Inflater(T,n.size);if(c)x.inflateAsync(function(v){y&&(S(v)?y(v):y(v,D.Errors.BAD_CRC()))});else{if(P=x.inflate(),!S(P))throw D.Errors.BAD_CRC(`"${g.decode(r)}"`);return P}break;default:throw c&&y&&y(Buffer.alloc(0),D.Errors.UNKNOWN_METHOD()),D.Errors.UNKNOWN_METHOD()}}function d(c,y){if((!o||!o.length)&&Buffer.isBuffer(t))return c&&y&&y(E()),E();if(o.length&&!s){var w;switch(n.method){case D.Constants.STORED:return n.compressedSize=n.size,w=Buffer.alloc(o.length),o.copy(w),c&&y&&y(w),w;default:case D.Constants.DEFLATED:var T=new vt.Deflater(o);if(c)T.deflateAsync(function(x){w=Buffer.alloc(x.length),n.compressedSize=x.length,x.copy(w),y&&y(w)});else{var P=T.deflate();return n.compressedSize=P.length,P}T=null;break}}else if(c&&y)y(Buffer.alloc(0));else return Buffer.alloc(0)}function p(c,y){return D.readBigUInt64LE(c,y)}function h(c){try{for(var y=0,w,T,P;y+4<c.length;)w=c.readUInt16LE(y),y+=2,T=c.readUInt16LE(y),y+=2,P=c.slice(y,y+T),y+=T,K.ID_ZIP64===w&&b(P)}catch{throw D.Errors.EXTRA_FIELD_PARSE_ERROR()}}function b(c){var y,w,T,P;c.length>=K.EF_ZIP64_SCOMP&&(y=p(c,K.EF_ZIP64_SUNCOMP),n.size===K.EF_ZIP64_OR_32&&(n.size=y)),c.length>=K.EF_ZIP64_RHO&&(w=p(c,K.EF_ZIP64_SCOMP),n.compressedSize===K.EF_ZIP64_OR_32&&(n.compressedSize=w)),c.length>=K.EF_ZIP64_DSN&&(T=p(c,K.EF_ZIP64_RHO),n.offset===K.EF_ZIP64_OR_32&&(n.offset=T)),c.length>=K.EF_ZIP64_DSN+4&&(P=c.readUInt32LE(K.EF_ZIP64_DSN),n.diskNumStart===K.EF_ZIP64_OR_16&&(n.diskNumStart=P))}return{get entryName(){return g.decode(r)},get rawEntryName(){return r},set entryName(c){r=D.toBuffer(c,g.encode);var y=r[r.length-1];s=y===47||y===92,n.fileNameLength=r.length},get efs(){return typeof u=="function"?u(this.entryName):u},get extra(){return a},set extra(c){a=c,n.extraLength=c.length,h(c)},get comment(){return g.decode(i)},set comment(c){if(i=D.toBuffer(c,g.encode),n.commentLength=i.length,i.length>65535)throw D.Errors.COMMENT_TOO_LONG()},get name(){let c=g.decode(r);return s?c.replace(/[/\\]$/,"").split("/").pop():c.split("/").pop()},get isDirectory(){return s},getCompressedData:function(){return d(!1,null)},getCompressedDataAsync:function(c){d(!0,c)},setData:function(c){o=D.toBuffer(c,D.decoder.encode),!s&&o.length?(n.size=o.length,n.method=D.Constants.DEFLATED,n.crc=D.crc32(c),n.changed=!0):n.method=D.Constants.STORED},getData:function(c){return n.changed?o:m(!1,null,c)},getDataAsync:function(c,y){n.changed?c(o):m(!0,c,y)},set attr(c){n.attr=c},get attr(){return n.attr},set header(c){n.loadFromBinary(c)},get header(){return n},packCentralHeader:function(){n.flags_efs=this.efs,n.extraLength=a.length;var c=n.centralHeaderToBinary(),y=D.Constants.CENHDR;return r.copy(c,y),y+=r.length,a.copy(c,y),y+=n.extraLength,i.copy(c,y),c},packLocalHeader:function(){let c=0;n.flags_efs=this.efs,n.extraLocalLength=l.length;let y=n.localHeaderToBinary(),w=Buffer.alloc(y.length+r.length+n.extraLocalLength);return y.copy(w,c),c+=y.length,r.copy(w,c),c+=r.length,l.copy(w,c),c+=l.length,w},toJSON:function(){let c=function(y){return"<"+(y&&y.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:n.toJSON(),compressedData:c(t),data:c(o)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Kn=F((Fa,Zn)=>{var Gn=Ft(),oo=_t(),W=Ie();Zn.exports=function(e,t){var n=[],r=Object.create(null),i=Buffer.alloc(0),s=new oo.MainHeader,o=!1,a=null;let l=new Set,u=t,{noSort:f,decoder:g}=u;e?m(u.readEntries):o=!0;function E(){let p=new Set;for(let h of Object.keys(r)){let b=h.split("/");if(b.pop(),!!b.length)for(let c=0;c<b.length;c++){let y=b.slice(0,c+1).join("/")+"/";p.add(y)}}for(let h of p)if(!(h in r)){let b=new Gn(u);b.entryName=h,b.attr=16,b.temporary=!0,n.push(b),r[b.entryName]=b,l.add(b)}}function S(){if(o=!0,r=Object.create(null),s.diskEntries>(e.length-s.offset)/W.Constants.CENHDR)throw W.Errors.DISK_ENTRY_TOO_LARGE();n=new Array(s.diskEntries);for(var p=s.offset,h=0;h<n.length;h++){var b=p,c=new Gn(u,e);c.header=e.slice(b,b+=W.Constants.CENHDR),c.entryName=e.slice(b,b+=c.header.fileNameLength),c.header.extraLength&&(c.extra=e.slice(b,b+=c.header.extraLength)),c.header.commentLength&&(c.comment=e.slice(b,b+c.header.commentLength)),p+=c.header.centralHeaderSize,n[h]=c,r[c.entryName]=c}l.clear(),E()}function m(p){var h=e.length-W.Constants.ENDHDR,b=Math.max(0,h-65535),c=b,y=e.length,w=-1,T=0;for(typeof u.trailingSpace=="boolean"&&u.trailingSpace&&(b=0),h;h>=c;h--)if(e[h]===80){if(e.readUInt32LE(h)===W.Constants.ENDSIG){w=h,T=h,y=h+W.Constants.ENDHDR,c=h-W.Constants.END64HDR;continue}if(e.readUInt32LE(h)===W.Constants.END64SIG){c=b;continue}if(e.readUInt32LE(h)===W.Constants.ZIP64SIG){w=h,y=h+W.readBigUInt64LE(e,h+W.Constants.ZIP64SIZE)+W.Constants.ZIP64LEAD;break}}if(w==-1)throw W.Errors.INVALID_FORMAT();s.loadFromBinary(e.slice(w,y)),s.commentLength&&(i=e.slice(T+W.Constants.ENDHDR)),p&&S()}function d(){n.length>1&&!f&&(n=n.map(p=>({entry:p,key:p.entryName.toLowerCase()})).sort((p,h)=>p.key.localeCompare(h.key)).map(p=>p.entry))}return{get entries(){return o||S(),n.filter(p=>!l.has(p))},get comment(){return g.decode(i)},set comment(p){i=W.toBuffer(p,g.encode),s.commentLength=i.length},getEntryCount:function(){return o?n.length:s.diskEntries},forEach:function(p){this.entries.forEach(p)},getEntry:function(p){return o||S(),r[p]||null},setEntry:function(p){o||S(),n.push(p),r[p.entryName]=p,s.totalEntries=n.length},deleteFile:function(p,h=!0){o||S();let b=r[p];this.getEntryChildren(b,h).map(y=>y.entryName).forEach(this.deleteEntry)},deleteEntry:function(p){o||S();let h=r[p],b=n.indexOf(h);b>=0&&(n.splice(b,1),delete r[p],s.totalEntries=n.length)},getEntryChildren:function(p,h=!0){if(o||S(),typeof p=="object")if(p.isDirectory&&h){let b=[],c=p.entryName;for(let y of n)y.entryName.startsWith(c)&&b.push(y);return b}else return[p];return[]},getChildCount:function(p){if(p&&p.isDirectory){let h=this.getEntryChildren(p);return h.includes(p)?h.length-1:h.length}return 0},compressToBuffer:function(){o||S(),d();let p=[],h=[],b=0,c=0;s.size=0,s.offset=0;let y=0;for(let P of this.entries){let x=P.getCompressedData();P.header.offset=c;let v=P.packLocalHeader(),R=v.length+x.length;c+=R,p.push(v),p.push(x);let L=P.packCentralHeader();h.push(L),s.size+=L.length,b+=R+L.length,y++}b+=s.mainHeaderSize,s.offset=c,s.totalEntries=y,c=0;let w=Buffer.alloc(b);for(let P of p)P.copy(w,c),c+=P.length;for(let P of h)P.copy(w,c),c+=P.length;let T=s.toBinary();return i&&i.copy(T,T.length-i.length),T.copy(w,c),e=w,o=!1,w},toAsyncBuffer:function(p,h,b,c){try{o||S(),d();let y=[],w=[],T=0,P=0,x=0;s.size=0,s.offset=0;let v=function(R){if(R.length>0){let L=R.shift(),V=L.entryName+L.extra.toString();b&&b(V),L.getCompressedDataAsync(function(q){c&&c(V),L.header.offset=P;let he=L.packLocalHeader(),qe=he.length+q.length;P+=qe,y.push(he),y.push(q);let De=L.packCentralHeader();w.push(De),s.size+=De.length,T+=qe+De.length,x++,v(R)})}else{T+=s.mainHeaderSize,s.offset=P,s.totalEntries=x,P=0;let L=Buffer.alloc(T);y.forEach(function(q){q.copy(L,P),P+=q.length}),w.forEach(function(q){q.copy(L,P),P+=q.length});let V=s.toBinary();i&&i.copy(V,V.length-i.length),V.copy(L,P),e=L,o=!1,p(L)}};v(Array.from(this.entries))}catch(y){h(y)}}}}});var Rt=F((Ra,Jn)=>{var B=Ie(),M=require("path"),so=Ft(),ao=Kn(),ye=(...e)=>B.findLast(e,t=>typeof t=="boolean"),Yn=(...e)=>B.findLast(e,t=>typeof t=="string"),co=(...e)=>B.findLast(e,t=>typeof t=="function"),lo={noSort:!1,readEntries:!1,method:B.Constants.NONE,fs:null};Jn.exports=function(e,t){let n=null,r=Object.assign(Object.create(null),lo);e&&typeof e=="object"&&(e instanceof Uint8Array||(Object.assign(r,e),e=r.input?r.input:void 0,r.input&&delete r.input),Buffer.isBuffer(e)&&(n=e,r.method=B.Constants.BUFFER,e=void 0)),Object.assign(r,t);let i=new B(r),s=m=>{m.filter(d=>d.attr).sort((d,p)=>p.path.length-d.path.length).forEach(d=>i.fs.chmodSync(d.path,d.attr))};if((typeof r.decoder!="object"||typeof r.decoder.encode!="function"||typeof r.decoder.decode!="function")&&(r.decoder=B.decoder),e&&typeof e=="string")if(i.fs.existsSync(e))r.method=B.Constants.FILE,r.filename=e,n=i.fs.readFileSync(e);else throw B.Errors.INVALID_FILENAME();let o=new ao(n,r),{canonical:a,sanitize:l,zipnamefix:u}=B;function f(m){if(m&&o){var d;if(typeof m=="string"&&(d=o.getEntry(M.posix.normalize(m))),typeof m=="object"&&typeof m.entryName<"u"&&typeof m.header<"u"&&(d=o.getEntry(m.entryName)),d)return d}return null}function g(m){let{join:d,normalize:p,sep:h}=M.posix;return d(M.isAbsolute(m)?"/":".",p(h+m.split("\\").join(h)+h))}function E(m){return m instanceof RegExp?(function(d){return function(p){return d.test(p)}})(m):typeof m!="function"?()=>!0:m}let S=(m,d)=>{let p=d.slice(-1);return p=p===i.sep?i.sep:"",M.relative(m,d)+p};return{readFile:function(m,d){var p=f(m);return p&&p.getData(d)||null},childCount:function(m){let d=f(m);if(d)return o.getChildCount(d)},readFileAsync:function(m,d){var p=f(m);p?p.getDataAsync(d):d(null,"getEntry failed for:"+m)},readAsText:function(m,d){var p=f(m);if(p){var h=p.getData();if(h&&h.length)return h.toString(d||"utf8")}return""},readAsTextAsync:function(m,d,p){var h=f(m);h?h.getDataAsync(function(b,c){if(c){d(b,c);return}b&&b.length?d(b.toString(p||"utf8")):d("")}):d("")},deleteFile:function(m,d=!0){var p=f(m);p&&o.deleteFile(p.entryName,d)},deleteEntry:function(m){var d=f(m);d&&o.deleteEntry(d.entryName)},addZipComment:function(m){o.comment=m},getZipComment:function(){return o.comment||""},addZipEntryComment:function(m,d){var p=f(m);p&&(p.comment=d)},getZipEntryComment:function(m){var d=f(m);return d&&d.comment||""},updateFile:function(m,d){var p=f(m);p&&p.setData(d)},addLocalFile:function(m,d,p,h){if(i.fs.existsSync(m)){d=d?g(d):"";let b=M.win32.basename(M.win32.normalize(m));d+=p||b;let c=i.fs.statSync(m),y=c.isFile()?i.fs.readFileSync(m):Buffer.alloc(0);c.isDirectory()&&(d+=i.sep),this.addFile(d,y,h,c)}else throw B.Errors.FILE_NOT_FOUND(m)},addLocalFileAsync:function(m,d){m=typeof m=="object"?m:{localPath:m};let p=M.resolve(m.localPath),{comment:h}=m,{zipPath:b,zipName:c}=m,y=this;i.fs.stat(p,function(w,T){if(w)return d(w,!1);b=b?g(b):"";let P=M.win32.basename(M.win32.normalize(p));if(b+=c||P,T.isFile())i.fs.readFile(p,function(x,v){return x?d(x,!1):(y.addFile(b,v,h,T),setImmediate(d,void 0,!0))});else if(T.isDirectory())return b+=i.sep,y.addFile(b,Buffer.alloc(0),h,T),setImmediate(d,void 0,!0)})},addLocalFolder:function(m,d,p){if(p=E(p),d=d?g(d):"",m=M.normalize(m),i.fs.existsSync(m)){let h=i.findFiles(m),b=this;if(h.length)for(let c of h){let y=M.join(d,S(m,c));p(y)&&b.addLocalFile(c,M.dirname(y))}}else throw B.Errors.FILE_NOT_FOUND(m)},addLocalFolderAsync:function(m,d,p,h){h=E(h),p=p?g(p):"",m=M.normalize(m);var b=this;i.fs.open(m,"r",function(c){if(c&&c.code==="ENOENT")d(void 0,B.Errors.FILE_NOT_FOUND(m));else if(c)d(void 0,c);else{var y=i.findFiles(m),w=-1,T=function(){if(w+=1,w<y.length){var P=y[w],x=S(m,P).split("\\").join("/");x=x.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),h(x)?i.fs.stat(P,function(v,R){v&&d(void 0,v),R.isFile()?i.fs.readFile(P,function(L,V){L?d(void 0,L):(b.addFile(p+x,V,"",R),T())}):(b.addFile(p+x+"/",Buffer.alloc(0),"",R),T())}):process.nextTick(()=>{T()})}else d(!0,void 0)};T()}})},addLocalFolderAsync2:function(m,d){let p=this;m=typeof m=="object"?m:{localPath:m};let h=M.resolve(g(m.localPath)),{zipPath:b,filter:c,namefix:y}=m;c instanceof RegExp?c=(function(P){return function(x){return P.test(x)}})(c):typeof c!="function"&&(c=function(){return!0}),b=b?g(b):"",y==="latin1"&&(y=P=>P.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof y!="function"&&(y=P=>P);let w=P=>M.join(b,y(S(h,P))),T=P=>M.win32.basename(M.win32.normalize(y(P)));i.fs.open(h,"r",function(P){P&&P.code==="ENOENT"?d(void 0,B.Errors.FILE_NOT_FOUND(h)):P?d(void 0,P):i.findFilesAsync(h,function(x,v){if(x)return d(x);v=v.filter(R=>c(w(R))),v.length||d(void 0,!1),setImmediate(v.reverse().reduce(function(R,L){return function(V,q){if(V||q===!1)return setImmediate(R,V,!1);p.addLocalFileAsync({localPath:L,zipPath:M.dirname(w(L)),zipName:T(L)},R)}},d))})})},addLocalFolderPromise:function(m,d){return new Promise((p,h)=>{this.addLocalFolderAsync2(Object.assign({localPath:m},d),(b,c)=>{b&&h(b),c&&p(this)})})},addFile:function(m,d,p,h){m=u(m);let b=f(m),c=b!=null;c||(b=new so(r),b.entryName=m),b.comment=p||"";let y=typeof h=="object"&&h instanceof i.fs.Stats;y&&(b.header.time=h.mtime);var w=b.isDirectory?16:0;let T=b.isDirectory?16384:32768;return y?T|=4095&h.mode:typeof h=="number"?T|=4095&h:T|=b.isDirectory?493:420,w=(w|T<<16)>>>0,b.attr=w,b.setData(d),c||o.setEntry(b),b},getEntries:function(m){return o.password=m,o?o.entries:[]},getEntry:function(m){return f(m)},getEntryCount:function(){return o.getEntryCount()},forEach:function(m){return o.forEach(m)},extractEntryTo:function(m,d,p,h,b,c){h=ye(!1,h),b=ye(!1,b),p=ye(!0,p),c=Yn(b,c);var y=f(m);if(!y)throw B.Errors.NO_ENTRY();var w=a(y.entryName),T=l(d,c&&!y.isDirectory?a(c):p?w:M.basename(w));if(y.isDirectory){var P=o.getEntryChildren(y);return P.forEach(function(R){if(R.isDirectory)return;var L=R.getData();if(!L)throw B.Errors.CANT_EXTRACT_FILE();var V=a(p?R.entryName:R.entryName.substring(y.entryName.length)),q=l(d,V);let he=b?R.header.fileAttr:void 0;i.writeFileTo(q,L,h,he)}),!0}var x=y.getData(o.password);if(!x)throw B.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(T)&&!h)throw B.Errors.CANT_OVERRIDE();let v=b?m.header.fileAttr:void 0;return i.writeFileTo(T,x,h,v),!0},test:function(m){if(!o)return!1;for(var d of o.entries)try{if(d.isDirectory)continue;var p=d.getData(m);if(!p)return!1}catch{return!1}return!0},extractAllTo:function(m,d,p,h){if(p=ye(!1,p),h=Yn(p,h),d=ye(!1,d),!o)throw B.Errors.NO_ZIP();let b=[];o.entries.forEach(function(c){var y=l(m,a(c.entryName));if(c.isDirectory){i.makeDir(y),p&&b.push({path:y,attr:c.header.fileAttr});return}var w=c.getData(h);if(!w)throw B.Errors.CANT_EXTRACT_FILE();let T=p?c.header.fileAttr:void 0;i.writeFileTo(y,w,d,T);try{i.fs.utimesSync(y,c.header.time,c.header.time)}catch{}}),s(b)},extractAllToAsync:function(m,d,p,h){if(h=co(d,p,h),p=ye(!1,p),d=ye(!1,d),!h)return new Promise((x,v)=>{this.extractAllToAsync(m,d,p,function(R){R?v(R):x(this)})});if(!o){h(B.Errors.NO_ZIP());return}m=M.resolve(m);let b=x=>l(m,M.normalize(a(x.entryName))),c=(x,v)=>new Error(x+': "'+v+'"'),y=[],w=[];o.entries.forEach(x=>{x.isDirectory?y.push(x):w.push(x)});let T=[];for(let x of y){let v=b(x),R=p?x.header.fileAttr:void 0;try{i.makeDir(v)}catch{h(c("Unable to create folder",v));continue}R&&T.push({path:v,attr:R});try{i.fs.utimesSync(v,x.header.time,x.header.time)}catch{}}let P=x=>{if(!x)try{s(T)}catch(v){return h(c("Unable to set folder permissions",v.path||""))}h(x)};w.reverse().reduce(function(x,v){return function(R){if(R)x(R);else{let L=M.normalize(a(v.entryName)),V=l(m,L);v.getDataAsync(function(q,he){if(he)x(he);else if(!q)x(B.Errors.CANT_EXTRACT_FILE());else{let qe=p?v.header.fileAttr:void 0;i.writeFileToAsync(V,q,d,qe,function(De){if(!De)return x(c("Unable to write file",V));i.fs.utimes(V,v.header.time,v.header.time,function(){x()})})}})}}},P)()},writeZip:function(m,d){if(arguments.length===1&&typeof m=="function"&&(d=m,m=""),!m&&r.filename&&(m=r.filename),!!m){var p=o.compressToBuffer();if(p){var h=i.writeFileTo(m,p,!0);typeof d=="function"&&d(h?null:new Error("failed"),"")}}},writeZipPromise:function(m,d){let{overwrite:p,perm:h}=Object.assign({overwrite:!0},d);return new Promise((b,c)=>{!m&&r.filename&&(m=r.filename),m||c("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(y=>{let w=T=>T?b(T):c("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(m,y,p,h,w)},c)})},toBufferPromise:function(){return new Promise((m,d)=>{o.toAsyncBuffer(m,d)})},toBuffer:function(m,d,p,h){return typeof m=="function"?(o.toAsyncBuffer(m,d,p,h),null):o.compressToBuffer()}}}});var Wr=F(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0})});var ht=F(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.DEFAULT_PROJECT_FONT_IDS=ee.DENEB_GOOGLE_FONT_COUNT=ee.DENEB_FONT_BY_ID=ee.DENEB_FONT_REGISTRY=void 0;var gt=[400,500,600,700],bs=[400,700],tn=[400,500,600,700];function A(e,t,n,r,i,s){let o=t;return{id:e,label:t,category:n,family:o,cssStack:s?.cssStack??`'${o}', ${n==="serif"||n==="slab-serif"?"Georgia, serif":n==="monospace"?"ui-monospace, monospace":"system-ui, sans-serif"}`,fontsourcePackage:r,googleQuery:i,googleFonts:!0,weights:s?.weights??gt,italic:s?.italic,variable:s?.variable}}ee.DENEB_FONT_REGISTRY=[A("inter","Inter","sans-serif","inter","Inter",{variable:!0}),A("roboto","Roboto","sans-serif","roboto","Roboto"),A("open-sans","Open Sans","sans-serif","open-sans","Open+Sans",{variable:!0}),A("lato","Lato","sans-serif","lato","Lato",{italic:!0}),A("montserrat","Montserrat","sans-serif","montserrat","Montserrat",{variable:!0}),A("poppins","Poppins","sans-serif","poppins","Poppins"),A("nunito","Nunito","sans-serif","nunito","Nunito",{variable:!0}),A("raleway","Raleway","sans-serif","raleway","Raleway",{variable:!0}),A("dm-sans","DM Sans","sans-serif","dm-sans","DM+Sans",{variable:!0}),A("work-sans","Work Sans","sans-serif","work-sans","Work+Sans",{variable:!0}),A("fira-sans","Fira Sans","sans-serif","fira-sans","Fira+Sans"),A("manrope","Manrope","sans-serif","manrope","Manrope",{variable:!0}),A("oswald","Oswald","sans-serif","oswald","Oswald",{weights:[400,500,600,700]}),A("source-sans-3","Source Sans 3","sans-serif","source-sans-3","Source+Sans+3",{variable:!0}),A("quicksand","Quicksand","sans-serif","quicksand","Quicksand",{variable:!0}),A("plus-jakarta-sans","Plus Jakarta Sans","sans-serif","plus-jakarta-sans","Plus+Jakarta+Sans",{variable:!0}),{id:"satoshi",label:"Satoshi",category:"sans-serif",family:"Space Grotesk",cssStack:"'Space Grotesk', system-ui, sans-serif",fontsourcePackage:null,googleQuery:null,googleFonts:!1,weights:gt,substituteId:"space-grotesk"},A("space-grotesk","Space Grotesk","sans-serif","space-grotesk","Space+Grotesk",{variable:!0}),A("figtree","Figtree","sans-serif","figtree","Figtree",{variable:!0}),A("urbanist","Urbanist","sans-serif","urbanist","Urbanist",{variable:!0}),A("outfit","Outfit","sans-serif","outfit","Outfit",{variable:!0}),{id:"general-sans",label:"General Sans",category:"sans-serif",family:"Figtree",cssStack:"'Figtree', system-ui, sans-serif",fontsourcePackage:null,googleQuery:null,googleFonts:!1,weights:gt,substituteId:"figtree"},A("mulish","Mulish","sans-serif","mulish","Mulish",{variable:!0}),A("barlow","Barlow","sans-serif","barlow","Barlow"),A("rubik","Rubik","sans-serif","rubik","Rubik",{variable:!0}),A("geist","Geist","sans-serif","geist-sans","Geist",{variable:!0}),A("merriweather","Merriweather","serif","merriweather","Merriweather"),A("playfair-display","Playfair Display","serif","playfair-display","Playfair+Display"),A("lora","Lora","serif","lora","Lora",{variable:!0}),A("pt-serif","PT Serif","serif","pt-serif","PT+Serif"),A("eb-garamond","EB Garamond","serif","eb-garamond","EB+Garamond",{variable:!0}),A("libre-baskerville","Libre Baskerville","serif","libre-baskerville","Libre+Baskerville"),A("crimson-text","Crimson Text","serif","crimson-text","Crimson+Text"),A("cormorant-garamond","Cormorant Garamond","serif","cormorant-garamond","Cormorant+Garamond"),A("frank-ruhl-libre","Frank Ruhl Libre","serif","frank-ruhl-libre","Frank+Ruhl+Libre"),A("taviraj","Taviraj","serif","taviraj","Taviraj"),A("arapey","Arapey","serif","arapey","Arapey",{weights:[400],italic:!0}),A("caladea","Caladea","serif","caladea","Caladea"),A("roboto-slab","Roboto Slab","slab-serif","roboto-slab","Roboto+Slab",{variable:!0}),A("zilla-slab","Zilla Slab","slab-serif","zilla-slab","Zilla+Slab"),A("aleo","Aleo","slab-serif","aleo","Aleo",{variable:!0}),A("arvo","Arvo","slab-serif","arvo","Arvo"),A("bitter","Bitter","slab-serif","bitter","Bitter",{variable:!0}),A("enriqueta","Enriqueta","slab-serif","enriqueta","Enriqueta"),A("fira-code","Fira Code","monospace","fira-code","Fira+Code",{weights:tn,variable:!0}),A("roboto-mono","Roboto Mono","monospace","roboto-mono","Roboto+Mono",{weights:tn,variable:!0}),A("jetbrains-mono","JetBrains Mono","monospace","jetbrains-mono","JetBrains+Mono",{weights:tn,variable:!0}),A("space-mono","Space Mono","monospace","space-mono","Space+Mono",{weights:[400,700],italic:!0}),A("bebas-neue","Bebas Neue","display","bebas-neue","Bebas+Neue",{weights:[400]}),A("fraunces","Fraunces","display","fraunces","Fraunces",{variable:!0}),A("cinzel","Cinzel","display","cinzel","Cinzel",{weights:bs}),A("paytone-one","Paytone One","display","paytone-one","Paytone+One",{weights:[400]}),A("righteous","Righteous","display","righteous","Righteous",{weights:[400]}),A("abril-fatface","Abril Fatface","display","abril-fatface","Abril+Fatface",{weights:[400]}),{id:"system-sans",label:"System Sans",category:"system",family:"system-ui",cssStack:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',fontsourcePackage:null,googleQuery:null,googleFonts:!1,weights:[]},{id:"editorial-serif",label:"Editorial Serif",category:"serif",family:"Playfair Display",cssStack:"'Playfair Display', Georgia, serif",fontsourcePackage:"playfair-display",googleQuery:"Playfair+Display",googleFonts:!0,weights:gt,substituteId:"playfair-display"}];ee.DENEB_FONT_BY_ID=new Map(ee.DENEB_FONT_REGISTRY.map(e=>[e.id,e]));ee.DENEB_GOOGLE_FONT_COUNT=ee.DENEB_FONT_REGISTRY.filter(e=>e.googleFonts&&e.fontsourcePackage).length;ee.DEFAULT_PROJECT_FONT_IDS=["inter","plus-jakarta-sans","playfair-display"]});var ke=F(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.normalizeFontId=Ce;me.lookupFontDefinition=Me;me.resolveInstallableFont=Ss;me.resolveFontFamily=Ts;me.listFontsByCategory=ws;me.collectFontIdsFromSiteData=Ps;var yt=ht();function Ce(e){return e.trim().toLowerCase().replace(/['"]/g,"").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}function Me(e){if(!e||!e.trim())return null;let t=Ce(e),n=yt.DENEB_FONT_BY_ID.get(t);if(n)return n;for(let i of yt.DENEB_FONT_REGISTRY)if(Ce(i.label)===t||Ce(i.family)===t)return i;let r=e.split(",")[0]?.trim().replace(/^['"]|['"]$/g,"");if(r){let i=Ce(r);if(i&&i!==t)return Me(r)}return null}function Ss(e){let t=Me(e);return t?t.fontsourcePackage?t:t.substituteId?yt.DENEB_FONT_BY_ID.get(t.substituteId)??null:null:null}function Ts(e){if(!e||!e.trim())return;let t=Me(e);return t?t.cssStack:e.includes(",")?e:`'${e.trim()}', system-ui, sans-serif`}function ws(){var e;let t={};for(let n of yt.DENEB_FONT_REGISTRY)t[e=n.category]??(t[e]=[]),t[n.category].push(n);return t}function Ps(e){let t=new Set,n=l=>{if(typeof l!="string"||!l.trim())return;let u=Me(l);if(u){t.add(u.id),u.substituteId&&t.add(u.substituteId);return}let f=Ce(l);f&&t.add(f)};if(!e||typeof e!="object")return[];let r=e,i=r.theme??r.template?.structure?.theme;n(i?.headingFont),n(i?.bodyFont);let s=r.styles;if(s&&typeof s=="object"&&!Array.isArray(s))for(let l of Object.values(s))l&&typeof l=="object"&&!Array.isArray(l)&&n(l.fontFamily);let o=new WeakSet,a=l=>{if(!(!l||typeof l!="object")&&!o.has(l)){if(o.add(l),Array.isArray(l)){l.forEach(a);return}for(let[u,f]of Object.entries(l))u.endsWith("Style")&&f&&typeof f=="object"&&n(f.fontFamily),a(f)}};return a(r.content),t.delete("system-sans"),Array.from(t)}});var nn=F(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.formatResponsiveFontSize=Gr;Et.formatFontSize=Is;function Gr(e){if(e==null||e==="")return;let t;if(typeof e=="number")t=e;else if(/^\d+(\.\d+)?px$/i.test(e.trim()))t=parseFloat(e);else if(/^\d+(\.\d+)?rem$/i.test(e.trim()))t=parseFloat(e)*16;else if(/^\d+$/.test(e.trim()))t=parseFloat(e);else return e;if(!Number.isFinite(t)||t<=0)return;let n=t/16,r=Math.max(n*.72,.75),i=n*1.15,s=Math.min(Math.max(n*.08,.5),3.5);return`clamp(${r.toFixed(3)}rem, ${(n*.55).toFixed(3)}rem + ${s.toFixed(2)}vw, ${i.toFixed(3)}rem)`}function Is(e,t){if(!(e==null||e==="")){if(t?.responsive){let n=Gr(e);if(n)return n}return typeof e=="number"?`${e}px`:/^\d+$/.test(e)?`${e}px`:e}}});var Kr=F(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.buildGoogleFontsStylesheetUrl=ks;var Zr=ht(),xs=ke();function Cs(e){if(!e.googleQuery)return null;let t=e.weights.length>0?e.weights:[400],n=Array.from(new Set(t)).sort((r,i)=>r-i);if(e.italic){let r=n.flatMap(i=>[`0,${i}`,`1,${i}`]);return`family=${e.googleQuery}:ital,wght@${r.join(";")}`}if(e.variable||n.length>4){let r=n[0],i=n[n.length-1];return`family=${e.googleQuery}:wght@${r}..${i}`}return`family=${e.googleQuery}:wght@${n.join(";")}`}function ks(e){let t=[],n=new Set;for(let r of e){let i=Zr.DENEB_FONT_BY_ID.get(r)??(0,xs.lookupFontDefinition)(r);if(!i||!i.googleFonts||!i.googleQuery)continue;let s=i.substituteId&&!i.fontsourcePackage?i.substituteId:i.id,o=Zr.DENEB_FONT_BY_ID.get(s)??i;if(n.has(o.id))continue;n.add(o.id);let a=Cs(o);a&&t.push(a)}return t.length===0?null:`https://fonts.googleapis.com/css2?${t.join("&")}&display=swap`}});var Yr=F(re=>{"use strict";var As=re&&re.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Be=re&&re.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&As(t,e,n)};Object.defineProperty(re,"__esModule",{value:!0});Be(Wr(),re);Be(ht(),re);Be(ke(),re);Be(nn(),re);Be(Kr(),re)});var Xr=F(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0})});var Qr=F(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.DENEB_STYLE_PATCH_MESSAGE=se.STYLE_PATCH_MESSAGE=void 0;se.isStylePatchPayload=_s;se.STYLE_PATCH_MESSAGE="FIVORA_PREVIEW_STYLE_PATCH";se.DENEB_STYLE_PATCH_MESSAGE="DENEB_PREVIEW_STYLE_PATCH";function _s(e){if(!e||typeof e!="object")return!1;let t=e,n=t.type;return n!==se.STYLE_PATCH_MESSAGE&&n!==se.DENEB_STYLE_PATCH_MESSAGE?!1:typeof t.targetPath=="string"&&typeof t.styleType=="string"&&typeof t.properties=="object"&&t.properties!==null}});var on=F(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.PREVIEW_LIST_ATTRIBUTE=O.PREVIEW_ITEM_ATTRIBUTE=O.PREVIEW_FIELD_ATTRIBUTE=O.STYLE_TYPE_ATTRIBUTE=O.STYLE_TARGET_ATTRIBUTE=void 0;O.buildStyleTargetSelector=ei;O.buildStyleFallbackSelectors=vs;O.STYLE_TARGET_ATTRIBUTE="data-preview-style-target";O.STYLE_TYPE_ATTRIBUTE="data-preview-style-type";O.PREVIEW_FIELD_ATTRIBUTE="data-preview-field-path";O.PREVIEW_ITEM_ATTRIBUTE="data-preview-item-path";O.PREVIEW_LIST_ATTRIBUTE="data-preview-list-path";function ae(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function ei(e){return`[${O.STYLE_TARGET_ATTRIBUTE}="${ae(e)}"]`}function vs(e,t){let n=[ei(e),`[${O.PREVIEW_FIELD_ATTRIBUTE}="${ae(e)}"]`,`[${O.PREVIEW_ITEM_ATTRIBUTE}="${ae(e)}"]`];if(t==="card"&&e.endsWith(".card")){let r=e.slice(0,-5);n.push(`[${O.PREVIEW_ITEM_ATTRIBUTE}="${ae(r)}"]`)}if(e.includes(":")){let[r,i]=e.split(":");i==="card"?n.push(`[${O.PREVIEW_LIST_ATTRIBUTE}="${ae(r)}"] [${O.PREVIEW_ITEM_ATTRIBUTE}]`,`[${O.PREVIEW_LIST_ATTRIBUTE}="${ae(r)}"] .card`,`[${O.PREVIEW_LIST_ATTRIBUTE}="${ae(r)}"] article`):i&&n.push(`[${O.PREVIEW_LIST_ATTRIBUTE}="${ae(r)}"] [${O.PREVIEW_FIELD_ATTRIBUTE}$=".${ae(i)}"]`)}return n}});var bt=F(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.resolveFontFamily=void 0;Ae.resolveShadowPreset=Ls;Ae.resolveThemeToken=Ds;var Fs=ke();Object.defineProperty(Ae,"resolveFontFamily",{enumerable:!0,get:function(){return Fs.resolveFontFamily}});var Rs={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)"};function Ls(e){if(e)return Rs[e]??e}function Ds(e){return e?e.startsWith("var(")?e:{primary:"var(--brand-color, #2563eb)",secondary:"var(--brand-secondary, #0f172a)",surface:"var(--surface-color, #ffffff)",background:"var(--page-bg, #f8fafc)",heading:"var(--heading-color, #0f172a)",muted:"var(--muted-color, #64748b)"}[e]??e:void 0}});var an=F(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.formatUnit=N;ce.textStyleToCssVariables=ti;ce.cardStyleToCssVariables=ni;ce.buttonStyleToCssVariables=ri;ce.gridStyleToCssVariables=ii;ce.sectionStyleToCssVariables=oi;ce.styleToCssVariables=$s;var Ns=nn(),Os=ke(),_e=bt();function N(e){if(!(e===void 0||e===""||e===null))return typeof e=="number"?`${e}px`:/^\d+$/.test(e)?`${e}px`:e}function sn(e,t){let n={},r=e.marginTop??e.spacingTop,i=e.marginBottom??e.spacingBottom,s=e.marginLeft??e.spacingLeft,o=e.marginRight??e.spacingRight;return r!==void 0&&(n[`${t}-margin-top`]=N(r)),i!==void 0&&(n[`${t}-margin-bottom`]=N(i)),s!==void 0&&(n[`${t}-margin-left`]=N(s)),o!==void 0&&(n[`${t}-margin-right`]=N(o)),n}function ti(e){let t={...sn(e,"--deneb")};return e.fontFamily&&(t["--deneb-font-family"]=(0,Os.resolveFontFamily)(e.fontFamily)),e.fontSize!==void 0&&(t["--deneb-font-size"]=(0,Ns.formatFontSize)(e.fontSize,{responsive:e.responsiveFontSize===!0})),e.fontWeight!==void 0&&(t["--deneb-font-weight"]=String(e.fontWeight)),e.lineHeight!==void 0&&(t["--deneb-line-height"]=(typeof e.lineHeight=="number",String(e.lineHeight))),e.letterSpacing&&(t["--deneb-letter-spacing"]=e.letterSpacing),e.color&&(t["--deneb-color"]=(0,_e.resolveThemeToken)(e.color)),e.textAlign&&(t["--deneb-text-align"]=e.textAlign),e.textTransform&&(t["--deneb-text-transform"]=e.textTransform),t}function ni(e){let t={...sn(e,"--deneb-card")};return e.width!==void 0&&(t["--deneb-card-width"]=N(e.width)),e.minWidth!==void 0&&(t["--deneb-card-min-width"]=N(e.minWidth)),e.maxWidth!==void 0&&(t["--deneb-card-max-width"]=N(e.maxWidth)),e.height!==void 0&&(t["--deneb-card-height"]=N(e.height)),e.aspectRatio&&(t["--deneb-card-aspect-ratio"]=e.aspectRatio),e.paddingTop!==void 0&&(t["--deneb-card-pt"]=N(e.paddingTop)),e.paddingBottom!==void 0&&(t["--deneb-card-pb"]=N(e.paddingBottom)),e.paddingLeft!==void 0&&(t["--deneb-card-pl"]=N(e.paddingLeft)),e.paddingRight!==void 0&&(t["--deneb-card-pr"]=N(e.paddingRight)),e.borderRadius!==void 0&&(t["--deneb-card-radius"]=N(e.borderRadius)),e.borderWidth!==void 0&&(t["--deneb-card-border-w"]=N(e.borderWidth)),e.borderStyle&&(t["--deneb-card-border-s"]=e.borderStyle),e.borderColor&&(t["--deneb-card-border-c"]=e.borderColor),e.backgroundColor&&(t["--deneb-card-bg"]=(0,_e.resolveThemeToken)(e.backgroundColor)),e.backgroundGradient&&(t["--deneb-card-bg-gradient"]=e.backgroundGradient),e.boxShadow&&(t["--deneb-card-shadow"]=(0,_e.resolveShadowPreset)(e.boxShadow)),e.backdropBlur!==void 0&&(t["--deneb-card-blur"]=N(e.backdropBlur)),e.gap!==void 0&&(t["--deneb-card-gap"]=N(e.gap)),t}function ri(e){let t={...sn(e,"--deneb-btn")};return e.borderRadius!==void 0&&(t["--deneb-btn-radius"]=N(e.borderRadius)),e.paddingX!==void 0&&(t["--deneb-btn-px"]=N(e.paddingX)),e.paddingY!==void 0&&(t["--deneb-btn-py"]=N(e.paddingY)),e.backgroundColor&&(t["--deneb-btn-bg"]=(0,_e.resolveThemeToken)(e.backgroundColor)),e.textColor&&(t["--deneb-btn-color"]=(0,_e.resolveThemeToken)(e.textColor)),e.borderColor&&(t["--deneb-btn-border-c"]=e.borderColor),e.hoverBackgroundColor&&(t["--deneb-btn-hover-bg"]=e.hoverBackgroundColor),e.hoverTextColor&&(t["--deneb-btn-hover-color"]=e.hoverTextColor),t}function ii(e){let t={};return e.columns!==void 0&&(t["--deneb-grid-cols"]=String(e.columns)),e.minCardWidth&&(t["--deneb-grid-min-card"]=e.minCardWidth),e.gapX!==void 0&&(t["--deneb-grid-gap-x"]=N(e.gapX)),e.gapY!==void 0&&(t["--deneb-grid-gap-y"]=N(e.gapY)),e.equalHeight!==void 0&&(t["--deneb-grid-equal-height"]=e.equalHeight?"stretch":"start"),t}function oi(e){let t={};return e.paddingTop!==void 0&&(t["--deneb-section-pt"]=N(e.paddingTop)),e.paddingBottom!==void 0&&(t["--deneb-section-pb"]=N(e.paddingBottom)),e.paddingX!==void 0&&(t["--deneb-section-px"]=N(e.paddingX)),e.maxWidth&&(t["--deneb-section-max-w"]=e.maxWidth),e.backgroundColor&&(t["--deneb-section-bg"]=(0,_e.resolveThemeToken)(e.backgroundColor)),e.backgroundImage&&(t["--deneb-section-bg-image"]=e.backgroundImage),e.backgroundOverlayColor&&(t["--deneb-section-overlay"]=e.backgroundOverlayColor),e.backgroundOverlayOpacity!==void 0&&(t["--deneb-section-overlay-opacity"]=String(e.backgroundOverlayOpacity)),e.textAlign&&(t["--deneb-section-align"]=e.textAlign),e.display&&(t["--deneb-section-display"]=e.display),e.order!==void 0&&e.order!==""&&(t["--deneb-section-order"]=String(e.order)),t}function $s(e,t){switch(e){case"text":return ti(t);case"card":return ni(t);case"button":return ri(t);case"grid":return ii(t);case"section":return oi(t);default:return{}}}});var ln=F(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.isPlainObject=cn;St.deepMerge=si;function cn(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function si(e,t,n=0,r=new WeakSet){if(n>50)return{...e,...t};if(r.has(t))return t;r.add(t);let i={...e};for(let[s,o]of Object.entries(t))cn(o)&&cn(i[s])?i[s]=si(i[s],o,n+1,r):i[s]=o;return i}});var di=F(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.getLiveStyleCache=js;we.applyCssVariablesToElement=ci;we.findStyleTargetElement=Vs;we.patchElementStyle=li;we.patchStyleByPath=Us;var je=on(),Ms=ln(),le=an(),Bs=ke(),ai=bt(),dn=new Map;function js(){return dn}function ci(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}function Vs(e,t){if(typeof document>"u"||!e)return null;for(let n of(0,je.buildStyleFallbackSelectors)(e,t)){let r=document.querySelector(n);if(r)return r}return null}function li(e,t,n){let i=(e.getAttribute(je.STYLE_TARGET_ATTRIBUTE)??"")||e.getAttribute("data-preview-field-path")||"",s=i?dn.get(i)??{}:{},o=(0,Ms.deepMerge)(s,n);i&&dn.set(i,o);let a=(0,le.styleToCssVariables)(t,o);if(ci(e,a),t==="text"){if(o.color){let l=(0,ai.resolveThemeToken)(String(o.color))||String(o.color);e.style.setProperty("color",l,"important")}if(o.textAlign&&e.style.setProperty("text-align",String(o.textAlign),"important"),o.fontSize!==void 0){let l=(0,le.formatUnit)(o.fontSize)||String(o.fontSize);e.style.setProperty("font-size",l,"important")}if(o.lineHeight!==void 0&&e.style.setProperty("line-height",String(o.lineHeight),"important"),o.fontFamily){let l=(0,Bs.resolveFontFamily)(String(o.fontFamily))||String(o.fontFamily);e.style.setProperty("font-family",l,"important")}if(o.fontWeight!==void 0&&e.style.setProperty("font-weight",String(o.fontWeight),"important"),o.marginTop!==void 0||o.spacingTop!==void 0){let l=(0,le.formatUnit)(o.marginTop??o.spacingTop);l&&e.style.setProperty("margin-top",l,"important")}if(o.marginBottom!==void 0||o.spacingBottom!==void 0){let l=(0,le.formatUnit)(o.marginBottom??o.spacingBottom);l&&e.style.setProperty("margin-bottom",l,"important")}if(o.marginLeft!==void 0||o.spacingLeft!==void 0){let l=(0,le.formatUnit)(o.marginLeft??o.spacingLeft);l&&e.style.setProperty("margin-left",l,"important")}if(o.marginRight!==void 0||o.spacingRight!==void 0){let l=(0,le.formatUnit)(o.marginRight??o.spacingRight);l&&e.style.setProperty("margin-right",l,"important")}}else if(t==="card"){if(o.backgroundColor){let l=(0,ai.resolveThemeToken)(String(o.backgroundColor))||String(o.backgroundColor);e.style.setProperty("background-color",l,"important"),e.style.setProperty("background",l,"important")}if(o.borderRadius!==void 0){let l=(0,le.formatUnit)(o.borderRadius)||String(o.borderRadius);e.style.setProperty("border-radius",l,"important")}if(o.padding!==void 0||o.paddingTop!==void 0){let l=(0,le.formatUnit)(o.padding??o.paddingTop);l&&e.style.setProperty("padding",l,"important")}if(o.boxShadow&&e.style.setProperty("box-shadow",String(o.boxShadow),"important"),o.borderColor&&e.style.setProperty("border-color",String(o.borderColor),"important"),o.borderWidth!==void 0){let l=(0,le.formatUnit)(o.borderWidth)||String(o.borderWidth);e.style.setProperty("border-width",l,"important"),e.style.setProperty("border-style","solid","important")}}e.getAttribute(je.STYLE_TYPE_ATTRIBUTE)||e.setAttribute(je.STYLE_TYPE_ATTRIBUTE,t)}function Us(e,t,n){if(typeof document>"u"||!e)return!1;let r=!1;for(let i of(0,je.buildStyleFallbackSelectors)(e,t)){let s=document.querySelectorAll(i);s.length>0&&(s.forEach(o=>li(o,t,n)),r=!0)}return r}});var ui=F(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.isValidStyleKind=Hs;Ve.validateStyleTree=qs;Ve.collectStyleTargetsFromHtml=Ws;var zs=new Set(["text","card","button","grid","section"]);function Hs(e){return typeof e=="string"&&zs.has(e)}function qs(e,t){let n=[];if(e==null)return n;if(typeof e!="object"||Array.isArray(e))return n.push({path:"styles",message:"styles must be an object"}),n;for(let[r,i]of Object.entries(e)){if(!r.trim()){n.push({path:"styles",message:"style path cannot be empty"});continue}if(typeof i!="object"||i===null||Array.isArray(i)){n.push({path:`styles.${r}`,message:"style entry must be an object"});continue}t&&!t.has(r)&&n.push({path:`styles.${r}`,message:"no matching data-preview-style-target marker in template"})}return n}function Ws(e){let t=new Set,n=/data-preview-style-target=["']([^"']+)["']/g,r;for(;(r=n.exec(e))!==null;)t.add(r[1]);return t}});var pi=F(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0})});var un=F(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.isDarkColor=mi;ve.getAutoContrastTextColor=Gs;ve.toHexColor=Zs;ve.normalizeHexColor=Ks;function mi(e){if(typeof e!="string"||!e)return!1;let t=e.trim().toLowerCase();if(!/^#[0-9a-f]{3,6}$/i.test(t))return!1;let n=t.length===4?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t,r=Number.parseInt(n.slice(1,3),16),i=Number.parseInt(n.slice(3,5),16),s=Number.parseInt(n.slice(5,7),16);return(r*299+i*587+s*114)/1e3<130}function Gs(e,t="#ffffff",n="#0f172a"){return mi(e)?t:n}function Zs(e,t){if(!e)return t;let n=e.trim();return/^#[0-9a-f]{6}$/i.test(n)?n.toLowerCase():/^#[0-9a-f]{3}$/i.test(n)?`#${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}`.toLowerCase():t}function Ks(e){if(!e)return null;let t=e.trim();return/^#[0-9a-f]{6}$/i.test(t)?t.toLowerCase():/^#[0-9a-f]{3}$/i.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`.toLowerCase():null}});var gi=F(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.THEME_PALETTES=void 0;Tt.THEME_PALETTES=[{id:"classic-luxe",name:"Classic Luxe",badge:"Light \u2022 Warm Luxe",mode:"light",primary:"#1e293b",secondary:"#d97706",accent:"#f59e0b",background:"#fdfbf7",card:"#ffffff",text:"#1e293b",muted:"#64748b",buttonBg:"#1e293b",buttonText:"#ffffff"},{id:"ocean-modern",name:"Ocean Modern",badge:"Light \u2022 Crisp Ocean",mode:"light",primary:"#0284c7",secondary:"#0369a1",accent:"#38bdf8",background:"#f8fafc",card:"#ffffff",text:"#0f172a",muted:"#64748b",buttonBg:"#0284c7",buttonText:"#ffffff"},{id:"forest-emerald",name:"Forest Emerald",badge:"Light \u2022 Organic Green",mode:"light",primary:"#065f46",secondary:"#047857",accent:"#10b981",background:"#f0fdf4",card:"#ffffff",text:"#064e3b",muted:"#475569",buttonBg:"#065f46",buttonText:"#ffffff"},{id:"warm-terracotta",name:"Warm Terracotta",badge:"Light \u2022 Artisanal",mode:"light",primary:"#c2410c",secondary:"#ea580c",accent:"#f97316",background:"#fffaf5",card:"#ffffff",text:"#431407",muted:"#78350f",buttonBg:"#c2410c",buttonText:"#ffffff"},{id:"velvet-berry",name:"Velvet Berry",badge:"Light \u2022 Vibrant Chic",mode:"light",primary:"#9f1239",secondary:"#be123c",accent:"#f43f5e",background:"#fff5f7",card:"#ffffff",text:"#4c0519",muted:"#881337",buttonBg:"#9f1239",buttonText:"#ffffff"},{id:"sleek-obsidian",name:"Sleek Obsidian",badge:"Dark \u2022 Obsidian",mode:"dark",primary:"#60a5fa",secondary:"#38bdf8",accent:"#93c5fd",background:"#090d16",card:"#131b2e",text:"#f8fafc",muted:"#94a3b8",buttonBg:"#60a5fa",buttonText:"#090d16"},{id:"midnight-cyber",name:"Midnight Cyber",badge:"Dark \u2022 Neon Cyber",mode:"dark",primary:"#818cf8",secondary:"#6366f1",accent:"#22d3ee",background:"#09090b",card:"#18181b",text:"#f4f4f5",muted:"#a1a1aa",buttonBg:"#818cf8",buttonText:"#09090b"},{id:"royal-gold-dark",name:"Royal Gold & Dark",badge:"Dark \u2022 Imperial Gold",mode:"dark",primary:"#f59e0b",secondary:"#d97706",accent:"#fbbf24",background:"#0c0a09",card:"#1c1917",text:"#f5f5f4",muted:"#a8a29e",buttonBg:"#f59e0b",buttonText:"#0c0a09"},{id:"emerald-nocturne",name:"Emerald Nocturne",badge:"Dark \u2022 Deep Emerald",mode:"dark",primary:"#34d399",secondary:"#10b981",accent:"#6ee7b7",background:"#022c22",card:"#064e3b",text:"#ecfdf5",muted:"#a7f3d0",buttonBg:"#34d399",buttonText:"#022c22"}]});var hi=F(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.FONT_PAIRINGS=Fe.GLOBAL_FONT_OPTIONS=void 0;Fe.GLOBAL_FONT_OPTIONS=["Inter","Playfair Display","DM Sans","Poppins","Montserrat","Plus Jakarta Sans","Georgia","Editorial Serif"];Fe.FONT_PAIRINGS=[{id:"modern-clean",name:"Modern & Clean",headingFont:"Plus Jakarta Sans",bodyFont:"Inter",description:"Crisp, contemporary tech and SaaS feel with high readability"},{id:"editorial-luxury",name:"Editorial Luxury",headingFont:"Playfair Display",bodyFont:"Inter",description:"Elegant serif headline paired with neutral modern body text"},{id:"tech-forward",name:"Tech Forward",headingFont:"Inter",bodyFont:"Inter",description:"Minimalist, uniform sans-serif design system"},{id:"vibrant-lifestyle",name:"Vibrant Lifestyle",headingFont:"Poppins",bodyFont:"DM Sans",description:"Warm, geometric sans pairing suited for retail and wellness"},{id:"classic-prestige",name:"Classic Prestige",headingFont:"Montserrat",bodyFont:"Inter",description:"Authoritative, balanced typography for premium brands"}]});var bi=F(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.parseVisualCustomization=yi;Ue.customizationToTheme=Ei;Ue.mergeVisualCustomizationIntoTheme=Ys;function de(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function yi(e){return de(e)?{version:1,colors:de(e.colors)?e.colors:void 0,colorReplacements:de(e.colorReplacements)?e.colorReplacements:void 0,typography:de(e.typography)?e.typography:void 0,spacing:de(e.spacing)?e.spacing:void 0,layout:de(e.layout)?e.layout:void 0,components:de(e.components)?e.components:void 0,sections:de(e.sections)?e.sections:void 0,elementStyles:de(e.elementStyles)?e.elementStyles:void 0}:{version:1}}function Ei(e){let t=e.colors??{};return{designCustomizationVersion:1,colorReplacements:e.colorReplacements,primaryColor:t.primary,secondaryColor:t.secondary,accentColor:t.accent,backgroundColor:t.background,textColor:t.text,surfaceColor:t.surface??t.cardBackground,surfaceAltColor:t.surfaceAlt,headingColor:t.heading??t.text,mutedTextColor:t.mutedText,borderColor:t.border,headerBackgroundColor:t.headerBackground,footerBackgroundColor:t.footerBackground,cardBackgroundColor:t.cardBackground??t.surface,buttonBackgroundColor:t.buttonBackground,buttonTextColor:t.buttonText,...e.typography,...e.spacing,...e.layout,...e.components,sections:e.sections,elementStyles:e.elementStyles}}function Ys(e,t){let n=yi(t);return[n.colors,n.colorReplacements,n.typography,n.spacing,n.layout,n.components,n.sections,n.elementStyles].some(i=>!!(i&&Object.values(i).some(s=>s!==void 0&&s!=="")))?Object.fromEntries(Object.entries({...e??{},...Ei(n)}).filter(([,i])=>i!==void 0)):e??null}});var Si=F(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.generateThemeVariables=Js;var fn=un();function Js(e){let t={};if(e){for(let[h,b]of Object.entries(e))if(typeof b=="string"||typeof b=="number"){let c=`--${h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;t[c]=String(b)}}let n=(0,fn.isDarkColor)(e?.backgroundColor),r=e?.backgroundColor||(n?"#0f172a":"#ffffff"),i=e?.textColor||(n?"#f8fafc":"#0f172a"),s=e?.mutedTextColor||(n?"rgba(248, 250, 252, 0.7)":"#64748b"),o=e?.borderColor||(n?"rgba(255, 255, 255, 0.1)":"#e2e8f0"),a=e?.cardBackgroundColor||e?.surfaceColor||(n?"#111a2e":"#ffffff"),l=n?"rgba(255, 255, 255, 0.09)":o,u=e?.primaryColor||"#2563eb",f=e?.secondaryColor||(n?"#1e293b":"#0f172a"),g=e?.accentColor||"#14b8a6",E=e?.buttonBackgroundColor||u,S=(0,fn.getAutoContrastTextColor)(E),m=e?.buttonTextColor||S,d=n?"rgba(255, 255, 255, 0.08)":f&&!(0,fn.isDarkColor)(f)?f:"#f1f5f9",p=n?"#f8fafc":"#0f172a";return{"--brand-color":u,"--brand-primary":u,"--primary-color":u,"--color-primary":u,"--brand-secondary":f,"--secondary-color":f,"--brand-accent":g,"--accent-color":g,"--page-background":r,"--page-bg":r,"--background":r,"--page-text":i,"--heading-color":e?.headingColor||(n?"#ffffff":f),"--color-heading":e?.headingColor||(n?"#ffffff":f),"--muted-text":s,"--text-muted":s,"--color-text":i,"--color-text-muted":s,"--link-color":e?.linkColor||u,"--border-primary":o,"--border":o,"--color-border":o,"--color-surface":n?"rgba(255,255,255,0.05)":"#ffffff","--card-bg":a,"--card-border":l,"--product-card-bg":a,"--product-card-border":l,"--tag-bg":n?"rgba(255, 255, 255, 0.08)":"rgba(241, 245, 249, 0.9)","--tag-color":s,"--card-shadow":n?"0 10px 25px -5px rgba(0, 0, 0, 0.4)":"0 10px 25px -5px rgba(0, 0, 0, 0.05)","--header-bg":e?.headerBackgroundColor||(n?"rgba(15, 23, 42, 0.85)":"rgba(255, 255, 255, 0.82)"),"--input-bg":n?"#1e293b":"#ffffff","--input-border":n?"rgba(255, 255, 255, 0.15)":"#cbd5e1","--input-color":i,"--button-bg":E,"--button-text":m,"--button-primary-bg":E,"--button-primary-text":m,"--button-secondary-bg":d,"--button-secondary-text":p,"--button-outline-border":n?"rgba(255, 255, 255, 0.22)":"currentColor","--button-outline-text":n?"#f8fafc":i,"--button-ghost-text":n?"#f8fafc":i,"--hero-min-height":e?.heroMinHeight||"72vh","--section-padding":e?.sectionPadding||"5rem","--base-size":e?.baseSize||"16px","--heading-font":e?.headingFont||"Inter, sans-serif","--body-font":e?.bodyFont||"Inter, sans-serif","--border-radius":e?.borderRadius||"8px","--content-align":e?.align||"left",...t}}});var Ti=F(te=>{"use strict";var Xs=te&&te.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Re=te&&te.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Xs(t,e,n)};Object.defineProperty(te,"__esModule",{value:!0});Re(pi(),te);Re(un(),te);Re(gi(),te);Re(hi(),te);Re(bi(),te);Re(Si(),te)});var wi=F(H=>{"use strict";var Qs=H&&H.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),oe=H&&H.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Qs(t,e,n)};Object.defineProperty(H,"__esModule",{value:!0});oe(Yr(),H);oe(Xr(),H);oe(Qr(),H);oe(on(),H);oe(an(),H);oe(di(),H);oe(bt(),H);oe(ln(),H);oe(ui(),H);oe(Ti(),H)});var ga={};zi(ga,{runTemplatePreflight:()=>Di});module.exports=Hi(ga);var vi=require("node:child_process"),k=require("node:fs/promises"),Fi=require("node:os"),_=require("node:path"),yn=Ct(Rt());var Xn=[{key:"content_image",label:"Content images",accept:["image/jpeg","image/png","image/webp"],maxSizeBytes:5242880,maxFiles:200},{key:"business_logo",label:"Business logo",accept:["image/jpeg","image/png","image/webp"],maxSizeBytes:5242880,maxFiles:1},{key:"website_banner",label:"Website banner images",accept:["image/jpeg","image/png","image/webp"],maxSizeBytes:5242880,maxFiles:10},{key:"gallery",label:"Gallery images",accept:["image/jpeg","image/png","image/webp"],maxSizeBytes:5242880,maxFiles:30},{key:"product",label:"Product images",accept:["image/jpeg","image/png","image/webp"],maxSizeBytes:5242880,maxFiles:50},{key:"service",label:"Service images",accept:["image/jpeg","image/png","image/webp"],maxSizeBytes:5242880,maxFiles:50},{key:"shop_front",label:"Shop front images",accept:["image/jpeg","image/png","image/webp"],maxSizeBytes:5242880,maxFiles:10},{key:"company_document",label:"Company documents",accept:["application/pdf","image/jpeg","image/png","image/webp"],maxSizeBytes:10485760,maxFiles:10},{key:"brochure_pdf",label:"Brochure PDF",accept:["application/pdf"],maxSizeBytes:10485760,maxFiles:5},{key:"restaurant_menu_pdf",label:"Restaurant menu PDF",accept:["application/pdf"],maxSizeBytes:10485760,maxFiles:5}];var uo={business_logo:["logo"],website_banner:["hero","banners"],gallery:["gallery"],product:["products"],service:["services"],shop_front:["shopFront"],content_image:["contentImages"],company_document:["documents"],brochure_pdf:["brochures"],restaurant_menu_pdf:["menus"]};function Qn(e,t=[]){return{project:{id:"template-validation",slug:"template-validation",title:"Template Validation",status:"APPROVED"},siteInstance:{id:"template-validation-instance",slug:"template-validation",domain:"template-validation.fivora.site",subdomain:"template-validation",customDomain:null,liveUrl:"https://template-validation.fivora.site"},api:{baseUrl:"https://api.fivora.site",catalogUrl:"https://api.fivora.site/site-catalog/template-validation/live-data",contactUrl:"https://api.fivora.site/site-contact",analyticsUrl:"https://api.fivora.site/site-analytics/page-view"},shop:{businessName:"Template Validation Shop",description:"Validation build payload that mirrors fivora-generated site data.",contact:{phone:"",email:"",whatsapp:""},address:{line1:"",city:"",district:"",province:"",postalCode:""},social:{facebook:"",instagram:"",tiktok:"",youtube:"",linkedin:"",website:""},logoUrl:""},template:{id:"template-validation",name:"Template Validation",engine:"NEXT_STATIC_EXPORT",structure:null},requirements:{mainPurpose:"",targetCustomers:"",preferredLanguage:"",preferredColorTheme:"",preferredStyle:"",requiredPages:t,requiredFeatures:[],customerSpecialRequirements:""},content:e??{},media:fo(),seo:null}}function fo(){let e={};for(let t of Xn){e[t.key]=[];for(let n of uo[t.key]??[])e[n]||(e[n]=[])}return e}var er=Ct(Rt()),xe={maxEntries:2e3,maxEntryUncompressedBytes:25*1024*1024,maxTotalUncompressedBytes:200*1024*1024,maxCompressionRatio:100},po=new Set([".cache",".git",".next",".npm",".pnpm-store",".turbo","__macosx","node_modules"]),mo=new Set(["build","coverage","dist","out"]);function tr(e){let t;try{t=new er.default(e).getEntries()}catch{throw new Error("Template package is not a valid ZIP archive.")}let n=new Set,r=[],i=0;if(t.length>xe.maxEntries)throw new Error(`Template ZIP contains too many entries (${t.length}; maximum ${xe.maxEntries}).`);for(let s of t){let o=rr(s.entryName);if(r.push(o),go(o))throw new Error(`Template ZIP contains an unsafe entry: ${s.entryName||"(empty path)"}.`);if(!s.isDirectory){let a=Number(s.header.size??0),l=Number(s.header.compressedSize??0);if(!Number.isSafeInteger(a)||a<0||a>xe.maxEntryUncompressedBytes)throw new Error(`Template ZIP entry is too large after extraction: ${o}.`);if(i+=a,i>xe.maxTotalUncompressedBytes)throw new Error(`Template ZIP expands beyond the ${xe.maxTotalUncompressedBytes/(1024*1024)} MB limit.`);if(a>1024*1024&&a/Math.max(1,l)>xe.maxCompressionRatio)throw new Error(`Template ZIP entry has an unsafe compression ratio: ${o}.`)}(!s.isDirectory&&Je(o)||s.isDirectory&&Je(o))&&n.add(o)}return{entries:r,forbiddenEntries:[...n]}}function nr(e){let t=e.slice(0,8),n=e.length-t.length;return["Template ZIP contains generated, cached, secret, log, or nested archive files that must be removed.",`Remove: ${t.join(", ")}${n>0?`, and ${n} more`:""}.`,"Create a clean source-only ZIP and upload it again."].join(" ")}function rr(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function go(e){let t=ir(e);return!e||e.includes("\0")||e.startsWith("/")||/^[a-z]:\//i.test(e)||t.includes("..")}function Je(e){let t=rr(e),n=ir(t),r=n.at(-1)??"",i=n.some(S=>po.has(S)),s=n[0]===".yarn"&&n[1]==="cache",o=n.some(S=>mo.has(S)),a=n.some(S=>S===".deneb"||S.startsWith(".deneb-backup")),l=r===".env"||r.startsWith(".env."),u=r.endsWith(".zip"),f=r.endsWith(".log"),g=r.endsWith(".tsbuildinfo");return i||s||o||a||l||u||f||g||(r===".ds_store"||r==="thumbs.db")}function ir(e){return e.split("/").map(t=>t.trim().toLowerCase()).filter(Boolean)}var ho={common:{label:"Common Content"},home:{label:"Home Page",pageKey:"home"},about:{label:"About Page",pageKey:"about_us"},services:{label:"Services",pageKey:"services"},products:{label:"Products",pageKey:"products"},gallery:{label:"Gallery",pageKey:"gallery"},contact:{label:"Contact Page",pageKey:"contact"},additionalPages:{label:"Additional Pages"}},yo=new Set(["text","textarea","email","tel","url","image","number","boolean","select"]),Eo={version:1,sections:[{id:"common",path:"common",label:"Common Content",type:"object",fields:[{key:"logoUrl",type:"image",label:"Website logo",description:"Used by templates that read content.common.logoUrl or merchant.logoUrl."}]}]};function sr(e){if(!e||typeof e!="object")return null;let t=e,r=(Array.isArray(t.sections)?t.sections:[]).map(i=>So(i)).filter(i=>!!i);return r.length===0?null:bo({version:typeof t.version=="number"&&Number.isFinite(t.version)?t.version:1,sections:r})}function bo(e){let t=r=>/(^|\.)(products?|items?|catalog|menu|dishes?|goods|featuredproducts?|store|foods?|drinks?)$/i.test(r.trim()),n=(r,i)=>{let s=fe(i,r.key);if(r.type==="object")return{...r,fields:r.fields.map(o=>n(o,s))};if(r.type==="list"){let o=r.fields?.map(a=>n(a,`${s}[*]`));if(t(s)){let{maxItems:a,...l}=r;return{...l,fields:o}}return{...r,fields:o}}return r};return{...e,sections:e.sections.map(r=>{let i=r.fields?.map(s=>n(s,r.path));if(r.type==="list"&&t(r.path)){let{maxItems:s,...o}=r;return{...o,fields:i}}return{...r,fields:i}})}}function ar(e,t=[]){let n=new Map(t.map(i=>[i.id,i.label]));return{version:1,sections:Object.entries(e).map(([i,s])=>wo(i,s,n)).filter(i=>!!i)}}function Oe(e){if(!e)return null;let t=new Map;for(let s of e.sections){let o=t.get(s.path);t.set(s.path,o?Dt(o,s):s)}let n=[...t.values()],r=n.map(s=>s.path),i=n.map(s=>{let a=n.filter(u=>nt(s.path,u.path)).sort((u,f)=>or(f.path)-or(u.path)).map(u=>pr({...e,sections:[u]},s.path)).filter(u=>!!u).reduce((u,f)=>Dt(u,f),s),l=new Set(r.filter(u=>u!==s.path&&nt(u,s.path)));return Lt(a,l)}).filter(s=>!!s);return{...e,sections:i}}function rt(e){if(!e)return[];let t=new Map,n=[],r=new Set,i=(o,a,l)=>{let u=ne(o),f=t.get(u);if(!f){t.set(u,{kind:a,sectionId:l});return}r.has(u)||(r.add(u),n.push({path:u,firstKind:f.kind,duplicateKind:a,firstSectionId:f.sectionId,duplicateSectionId:l}))},s=(o,a,l)=>{if(a.type==="object"){for(let u of a.fields??[])s(fe(o,u.key),u,l);return}if(a.type==="list"){let u=ne(o);i(u,"list",l);let f=`${u}[*]`;a.itemField&&i(f,"field",l);for(let g of a.fields??[])s(fe(f,g.key),g,l);return}i(o,"field",l)};for(let o of e.sections)s(o.path,o,o.id);return n}function Nt(e,t){if(!e)return Oe(t);if(!t)return Oe(e);let n=Oe(e)??e,r=Oe(t)??t,i=n.sections.map(l=>l.path),s=n.sections.map(l=>{let u=pr(r,l.path);if(!u)return l;let f=new Set(i.filter(E=>E!==l.path&&nt(E,l.path))),g=Lt(u,f);return g?Dt(l,g):l}),o=new Set(n.sections.map(({path:l})=>l)),a=r.sections.filter(l=>!o.has(l.path)).map(l=>Lt(l,new Set(i.filter(u=>nt(u,l.path))))).filter(l=>!!l);return Oe({...t,...e,sections:[...s,...a]})}function cr(e){return e?Nt(e,Eo):null}function So(e){if(!e||typeof e!="object")return null;let t=e,n=z(t.id),r=z(t.path),i=z(t.label),s=dr(t.type);if(!n||!r||!i||!s)return null;let o={id:n,path:r,label:i,description:z(t.description)||void 0,required:typeof t.required=="boolean"?t.required:void 0,placeholder:z(t.placeholder)||void 0,maxLength:Mt(t.maxLength),recommendedWidth:pe(t.recommendedWidth),recommendedHeight:pe(t.recommendedHeight),pageKey:z(t.pageKey)||void 0,...Ot(t.sharedFieldKey)};if(s==="object"){let a=Qe(t.fields);return{...o,type:s,fields:a}}if(s==="list"){let a=Qe(t.fields),l=lr(t.itemField);return a.length===0&&!l?null:{...o,type:s,fields:a.length>0?a:void 0,itemField:l??void 0,itemLabel:z(t.itemLabel)||void 0,minItems:et(t.minItems),maxItems:et(t.maxItems)}}return{...o,type:s,options:s==="select"?$t(t.options):void 0}}function Lt(e,t){if(t.has(e.path))return null;if(e.type==="object"){let n=(e.fields??[]).map(r=>Xe(r,e.path,t)).filter(r=>!!r);return n.length===0?null:{...e,fields:n}}if(e.type==="list"){let n=(e.fields??[]).map(r=>Xe(r,e.path,t)).filter(r=>!!r);return(e.fields?.length??0)>0&&n.length===0&&!e.itemField?null:{...e,fields:n.length>0?n:void 0}}return e}function Xe(e,t,n){let r=fe(t,e.key);if(n.has(r))return null;if(e.type==="object"){let i=e.fields.map(s=>Xe(s,r,n)).filter(s=>!!s);return i.length===0?null:{...e,fields:i}}if(e.type==="list"){let i=(e.fields??[]).map(s=>Xe(s,r,n)).filter(s=>!!s);return(e.fields?.length??0)>0&&i.length===0&&!e.itemField?null:{...e,fields:i.length>0?i:void 0}}return e}function Qe(e){return Array.isArray(e)?e.map(t=>To(t)).filter(t=>!!t):[]}function To(e){if(!e||typeof e!="object")return null;let t=e,n=z(t.key),r=z(t.label),i=dr(t.type);if(!n||!r||!i)return null;let s={key:n,label:r,description:z(t.description)||void 0,required:typeof t.required=="boolean"?t.required:void 0,placeholder:z(t.placeholder)||void 0,maxLength:Mt(t.maxLength),recommendedWidth:pe(t.recommendedWidth),recommendedHeight:pe(t.recommendedHeight),...Ot(t.sharedFieldKey)};if(i==="object")return{...s,type:i,fields:Qe(t.fields)};if(i==="list"){let o=Qe(t.fields),a=lr(t.itemField);return o.length===0&&!a?null:{...s,type:i,fields:o.length>0?o:void 0,itemField:a??void 0,itemLabel:z(t.itemLabel)||void 0,minItems:et(t.minItems),maxItems:et(t.maxItems)}}return{...s,type:i,options:i==="select"?$t(t.options):void 0}}function lr(e){if(!e||typeof e!="object")return null;let t=e,n=z(t.label),r=ur(t.type);return!n||!r?null:{label:n,type:r,description:z(t.description)||void 0,required:typeof t.required=="boolean"?t.required:void 0,placeholder:z(t.placeholder)||void 0,maxLength:Mt(t.maxLength),recommendedWidth:pe(t.recommendedWidth),recommendedHeight:pe(t.recommendedHeight),...Ot(t.sharedFieldKey),options:r==="select"?$t(t.options):void 0}}function Ot(e){return typeof e=="string"&&e.trim()?{sharedFieldKey:e.trim()}:{}}function $t(e){if(!Array.isArray(e))return;let t=e.map(n=>z(n)).filter(n=>!!n);return t.length>0?t:void 0}function Mt(e){return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<=1e4?e:void 0}function pe(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:void 0}function et(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0?e:void 0}function dr(e){return e==="object"?e:e==="list"||e==="array"?"list":ur(e)}function ur(e){return typeof e=="string"&&yo.has(e)?e:null}function wo(e,t,n){let r=ho[e],i=n.has(e)?e:void 0,s=!i&&e==="about"&&n.has("about_us")?"about_us":void 0,o=i||s||r?.pageKey,a=(o?n.get(o):void 0)||r?.label||hr(e);return Array.isArray(t)?Po(e,a,o,t):Ee(t)?{id:e,path:e,label:a,pageKey:o,type:"object",fields:Object.entries(t).map(([l,u])=>it(l,u))}:{id:e,path:e,label:a,pageKey:o,...ot(e,t)}}function it(e,t){let n=hr(e);return Array.isArray(t)?Io(e,n,t):Ee(t)?{key:e,label:n,type:"object",fields:Object.entries(t).map(([r,i])=>it(r,i))}:{key:e,label:n,...ot(e,t)}}function Po(e,t,n,r){let i=mr(r),s=yr(t);return Ee(i)?{id:e,path:e,label:t,pageKey:n,type:"list",itemLabel:s,fields:Object.entries(i).map(([o,a])=>it(o,a))}:{id:e,path:e,label:t,pageKey:n,type:"list",itemLabel:s,itemField:{label:s,...ot(e,i)}}}function Io(e,t,n){let r=mr(n),i=yr(t);return Ee(r)?{key:e,label:t,type:"list",itemLabel:i,fields:Object.entries(r).map(([s,o])=>it(s,o))}:{key:e,label:t,type:"list",itemLabel:i,itemField:{label:i,...ot(e,r)}}}function Dt(e,t){let n={...t,...e,pageKey:e.pageKey??t.pageKey,description:e.description??t.description,placeholder:e.placeholder??t.placeholder};if(e.type==="object"&&t.type==="object")return{...n,type:"object",fields:tt(e.fields??[],t.fields??[])};if(e.type==="list"&&t.type==="list"){let r=tt(e.fields??[],t.fields??[]);return{...n,type:"list",fields:r.length>0?r:void 0,itemField:fr(e.itemField,t.itemField),itemLabel:e.itemLabel??t.itemLabel,minItems:e.minItems??t.minItems,maxItems:e.maxItems??t.maxItems}}return{...e,recommendedWidth:e.recommendedWidth??t.recommendedWidth,recommendedHeight:e.recommendedHeight??t.recommendedHeight}}function tt(e,t){let n=new Map(t.map(i=>[i.key,i]));return[...e.map(i=>{let s=n.get(i.key);return n.delete(i.key),s?xo(i,s):i}),...n.values()]}function xo(e,t){let n={...t,...e,description:e.description??t.description,placeholder:e.placeholder??t.placeholder};if(e.type==="object"&&t.type==="object")return{...n,type:"object",fields:tt(e.fields,t.fields)};if(e.type==="list"&&t.type==="list"){let r=tt(e.fields??[],t.fields??[]);return{...n,type:"list",fields:r.length>0?r:void 0,itemField:fr(e.itemField,t.itemField),itemLabel:e.itemLabel??t.itemLabel,minItems:e.minItems??t.minItems,maxItems:e.maxItems??t.maxItems}}return{...e,recommendedWidth:e.recommendedWidth??t.recommendedWidth,recommendedHeight:e.recommendedHeight??t.recommendedHeight}}function fr(e,t){return e?!t||e.type!==t.type?e:{...t,...e,recommendedWidth:e.recommendedWidth??t.recommendedWidth,recommendedHeight:e.recommendedHeight??t.recommendedHeight}:t}function pr(e,t){let n=(i,s,o)=>{let{key:a,...l}=i;return{...l,id:o.id,path:s,pageKey:o.pageKey}},r=(i,s,o)=>{if(ne(s)===ne(t))return n(i,s,o);if(i.type==="object")for(let a of i.fields){let l=r(a,fe(s,a.key),o);if(l)return l}if(i.type==="list"){let a=`${ne(s)}[*]`;for(let l of i.fields??[]){let u=r(l,fe(a,l.key),o);if(u)return u}}return null};for(let i of e.sections){if(ne(i.path)===ne(t))return i;if(i.type==="object")for(let s of i.fields??[]){let o=r(s,fe(i.path,s.key),i);if(o)return o}if(i.type==="list"){let s=`${ne(i.path)}[*]`;for(let o of i.fields??[]){let a=r(o,fe(s,o.key),i);if(a)return a}}}return null}function nt(e,t){let n=ne(e),r=ne(t);return n.startsWith(`${r}.`)||n.startsWith(`${r}[`)}function ne(e){return e.replace(/\[\d+\]/g,"[*]").trim()}function or(e){return ne(e).split(/\.|\[/).filter(Boolean).length}function mr(e){let t=e.filter(Ee);return t.length===0?e.find(n=>n!=null):t.reduce((n,r)=>gr(n,r),{})}function gr(e,t){let n={...e};for(let[r,i]of Object.entries(t)){let s=n[r];if(Ee(s)&&Ee(i)){n[r]=gr(s,i);continue}if(Array.isArray(s)&&Array.isArray(i)){n[r]=[...s,...i];continue}(s==null||Array.isArray(s)&&s.length===0)&&(n[r]=i)}return n}function ot(e,t){let n=Co(e,t);if(n!=="image"||typeof t!="string"||!t.trim())return{type:n};try{let r=new URL(t,"https://fivora-template.invalid"),i=pe(Number(r.searchParams.get("w")??r.searchParams.get("width"))),s=pe(Number(r.searchParams.get("h")??r.searchParams.get("height")));return{type:n,...i?{recommendedWidth:i}:{},...s?{recommendedHeight:s}:{}}}catch{return{type:n}}}function Co(e,t){if(typeof t=="boolean")return"boolean";if(typeof t=="number")return"number";let n=e.toLowerCase();return n.includes("email")?"email":n.includes("phone")||n.includes("mobile")||n.includes("whatsapp")||n.includes("contactnumber")?"tel":n.includes("image")||n.includes("logo")||n.includes("banner")||n.includes("thumbnail")||n.includes("photo")?"image":n.includes("url")||n.includes("link")||typeof t=="string"&&/^https?:\/\//i.test(t.trim())?"url":n.includes("description")||n.includes("about")||n.includes("mission")||n.includes("vision")||n.includes("history")||n.includes("hours")||n.includes("address")||n.includes("body")||typeof t=="string"&&t.length>120?"textarea":"text"}function fe(e,t){return e?`${e}.${t}`:t}function z(e){return typeof e=="string"?e.trim():""}function Ee(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function hr(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function yr(e){return/ies$/i.test(e)?e.replace(/ies$/i,"y"):/s$/i.test(e)&&!/ss$/i.test(e)?e.replace(/s$/i,""):e}var ko=["primary","secondary","accent","background","text","surface","surfaceAlt","heading","mutedText","border","headerBackground","footerBackground","cardBackground","buttonBackground","buttonText"],Ao=["headingFont","bodyFont","baseSize","headingScale","bodyLineHeight","headingLineHeight","headingWeight","bodyWeight","letterSpacing"],_o=["heroMinHeight","sectionPadding","contentMaxWidth","containerPadding","sectionGap","elementGap","gridGap"],vo=["textAlign","contentAlign","heroTextAlign","cardTextAlign","gridColumns"],Fo=["cardWidth","cardMinHeight","cardPadding","cardRadius","cardBorderWidth","cardShadow","buttonPadding","buttonRadius","buttonShadow","imageRadius","headerHeight"],Ro=["backgroundColor","textColor","headingColor","minHeight","padding","contentMaxWidth","gap","textAlign","contentAlign","cardBackgroundColor","cardWidth","cardMinHeight","cardRadius","gridColumns"],Lo=["fontFamily","fontSize","lineHeight","fontWeight","letterSpacing","color","backgroundColor","textAlign","width","height","minWidth","minHeight","maxWidth","maxHeight","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius"];function ie(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Do(e){let t=e.trim();if(!t)return"";if(!(t.length>160)&&!/[;{}<>\r\n]/.test(t)&&!/(?:url\s*\(|expression\s*\(|@import|javascript:)/i.test(t))return t}function Er(e){let t=e.trim().toLowerCase(),n=t.match(/^#([0-9a-f]{3})$/);return n?`#${[...n[1]].map(r=>r.repeat(2)).join("")}`:/^#[0-9a-f]{6}$/.test(t)?t:null}function No(e){if(!ie(e))return;let t={};for(let[n,r]of Object.entries(e).slice(0,64)){if(typeof r!="string")continue;let i=Er(n),s=Er(r);!i||!s||(t[i]=s)}return Object.keys(t).length>0?t:void 0}function be(e,t){if(!ie(e))return;let n={};for(let r of t){if(typeof e[r]!="string")continue;let i=Do(e[r]);i!==void 0&&(n[r]=i)}return Object.keys(n).length>0?n:void 0}function Oo(e){return/^[a-zA-Z0-9_-]{1,64}$/.test(e)}function $o(e){return/^[a-zA-Z0-9_.:\[\]-]{1,180}$/.test(e)}function Mo(){return{version:1}}function Bo(e){if(!ie(e))return Mo();let t=be(e.colors,ko),n=No(e.colorReplacements),r=be(e.typography,Ao),i=be(e.spacing,_o),s=be(e.layout,vo),o=be(e.components,Fo),a={};if(ie(e.sections))for(let[u,f]of Object.entries(e.sections)){if(!Oo(u)||!ie(f))continue;let E={...be(f,Ro)??{}};typeof f.visible=="boolean"&&(E.visible=f.visible),Object.keys(E).length>0&&(a[u]=E)}let l={};if(ie(e.elementStyles))for(let[u,f]of Object.entries(e.elementStyles).slice(0,256)){if(!$o(u)||!ie(f))continue;let g=be(f,Lo);g&&Object.keys(g).length>0&&(l[u]=g)}return{version:1,...t?{colors:t}:{},...n?{colorReplacements:n}:{},...r?{typography:r}:{},...i?{spacing:i}:{},...s?{layout:s}:{},...o?{components:o}:{},...Object.keys(a).length>0?{sections:a}:{},...Object.keys(l).length>0?{elementStyles:l}:{}}}function br(e){if(!ie(e))return null;let t=e.themeSchema;if(!ie(t))return null;let n=Bo(ie(t.defaults)?{version:1,...t.defaults}:null),r={...n.colors?{colors:n.colors}:{},...n.typography?{typography:n.typography}:{},...n.spacing?{spacing:n.spacing}:{},...n.layout?{layout:n.layout}:{},...n.components?{components:n.components}:{},...n.sections?{sections:n.sections}:{}};return{version:typeof t.version=="number"?t.version:1,tokens:Array.isArray(t.tokens)?t.tokens.filter(i=>typeof i=="string"):void 0,...Object.keys(r).length>0?{defaults:r}:{}}}var jo=e=>new Error(e),Vo=new Set(["npm install","npm ci","pnpm install","pnpm install --frozen-lockfile","yarn install","yarn install --frozen-lockfile"]),Uo=new Set(["npm run build","pnpm run build","yarn build","yarn run build"]);function Tr(e,t=jo){let n=E=>{throw t(E)};(!e||typeof e!="object")&&n("Template manifest is missing or invalid.");let r=e;r.framework!=="nextjs-static-export"&&n('Template manifest framework must be "nextjs-static-export".'),(typeof r.siteDataFile!="string"||!r.siteDataFile.trim())&&n("Template manifest siteDataFile is required.");let i=typeof r.version=="number"&&Number.isFinite(r.version)?r.version:1,s=zo(r.visualEditing,i,t),o=sr(r.editorSchema),a=br(r),l=Array.isArray(r.colorPalette)?r.colorPalette.filter(E=>!!E&&typeof E=="object").flatMap(E=>{let S=typeof E.color=="string"?E.color.trim().toLowerCase():"";if(!/^#[0-9a-f]{6}$/.test(S))return[];let m=typeof E.usageCount=="number"&&Number.isFinite(E.usageCount)?Math.max(1,Math.floor(E.usageCount)):1;return[{color:S,usageCount:m}]}).slice(0,40):[],u=rt(o);if(u.length>0){let E=u.slice(0,5).map(S=>`"${S.path}"`).join(", ");n(`Template editorSchema declares the same editable path in more than one place: ${E}. Keep each primitive field and list in exactly one section; a dedicated nested section must not also be repeated inside its ancestor section.`)}let f=Sr(r.installCommand,Vo,"installCommand",n),g=Sr(r.buildCommand,Uo,"buildCommand",n);return{framework:"nextjs-static-export",version:i,siteDataFile:r.siteDataFile.trim(),editorSchema:o,pages:Array.isArray(r.pages)?r.pages.filter(E=>!!E&&typeof E=="object").map(E=>{let S=typeof E.id=="string"&&E.id.trim()?E.id.trim():null,m=typeof E.label=="string"&&E.label.trim()?E.label.trim():null;return!S||!m?n("Each template manifest page must include id and label."):{id:S,label:m,route:typeof E.route=="string"&&E.route.trim()?E.route.trim():void 0,required:typeof E.required=="boolean"?E.required:!1,description:typeof E.description=="string"?E.description.trim():void 0}}):void 0,visualEditing:s,...a?{themeSchema:a}:{},...l.length>0?{colorPalette:l}:{},outputDirectory:typeof r.outputDirectory=="string"?r.outputDirectory.trim():void 0,installCommand:f,buildCommand:g,basePathEnvVar:typeof r.basePathEnvVar=="string"?r.basePathEnvVar.trim():"NEXT_PUBLIC_SITE_BASE_PATH",publicSiteUrlEnvVar:typeof r.publicSiteUrlEnvVar=="string"?r.publicSiteUrlEnvVar.trim():void 0}}function Sr(e,t,n,r){if(e==null||e==="")return;if(typeof e!="string")return r(`Template manifest ${n} must be a string.`);let i=e.trim().replace(/\s+/g," ");return t.has(i)?i:r(`Template manifest ${n} is not allowed. Use a standard npm, pnpm, or yarn install/build command.`)}function zo(e,t,n){let r=a=>{throw n(a)};if(!e||typeof e!="object"||Array.isArray(e))return t>=2&&r('Template manifest version 2 requires visualEditing.contractVersion 1 and visualEditing.mode "strict".'),{contractVersion:1,mode:"legacy"};let i=e;i.contractVersion!==1&&r("Template visualEditing.contractVersion must be 1.");let s=i.mode==="strict"||i.mode==="legacy"?i.mode:null;if(!s)return r('Template visualEditing.mode must be "strict" or "legacy".');t>=2&&s!=="strict"&&r('Template manifest version 2 requires visualEditing.mode "strict".');let o=Array.isArray(i.controlOnlyPaths)?i.controlOnlyPaths.filter(a=>typeof a=="string").map(a=>a.trim()).filter(Boolean):[];return{contractVersion:1,mode:s,controlOnlyPaths:o.length>0?o:void 0}}var Ho={"data-preview-field-path":"field","data-preview-list-path":"list","data-preview-item-path":"item","data-preview-page-key":"page"},wr=/\b(data-preview-(?:field-path|list-path|item-path|page-key))\s*=\s*(?:"([^"]*)"|'([^']*)'|\{\s*`([\s\S]*?)`\s*\}|\{\s*"([^"]*)"\s*\}|\{\s*'([^']*)'\s*\})/g,Pr=/\b(data-preview-(?:field-path|list-path|item-path|page-key))\s*=/g,Ir=String.raw`[^.[\]\s]+`,qo=new RegExp(String.raw`^${Ir}(?:\[(?:\d+|\*)\])*(?:\.${Ir}(?:\[(?:\d+|\*)\])*)*$`),Wo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Go=new Set(["head","script","style","noscript","svg","template"]),xr=new Set(["html","body","main","header","footer","nav","section","article","aside","form","div","ul","ol","table","thead","tbody","tfoot","tr"]),st="FIVORA_PREVIEW_SITE_DATA",_r=`${["MARKET","PLACE"].join("")}_PREVIEW_`,at=`${_r}SITE_DATA`;var ct="FIVORA_PREVIEW_READY",Bt=`${_r}READY`,Zo=ct;function Ht(e,t){let n={fieldPatterns:new Set,concreteFields:new Set,listPatterns:new Set,concreteLists:new Set,itemPatterns:new Set,concreteItems:new Set};if(e)for(let[r,i]of Object.entries(e))Gt(i,r,n);for(let r of t?.sections??[])Zt(r.path,r,n);return{fieldPatterns:[...n.fieldPatterns].sort(),concreteFields:[...n.concreteFields].sort(),listPatterns:[...n.listPatterns].sort(),concreteLists:[...n.concreteLists].sort(),itemPatterns:[...n.itemPatterns].sort(),concreteItems:[...n.concreteItems].sort()}}function Yt(e,t){let n=Lr(e??{});for(let r of t?.sections??[])Jo(n,r.path,r);return n}function vr(e,t){let n=structuredClone(e??{});for(let r of t?.sections??[])Ko(n,r.path,r);return Wt(n,"")}function mt(e){let t=[],n=[];for(let r of e){let i=new Set;wr.lastIndex=0;for(let s of r.content.matchAll(wr)){let o=s[1],a=s[2]??s[3]??s[4]??s[5]??s[6]??"",l=s.index??0;i.add(l),t.push({kind:Ho[o],value:Te(a).trim(),filePath:r.filePath,artifactKind:r.kind,offset:l,line:U(r.content,l)})}Pr.lastIndex=0;for(let s of r.content.matchAll(Pr)){let o=s.index??0;i.has(o)||n.push(`${r.filePath}:${U(r.content,o)} ${s[1]} must use a literal string or a JSX template literal.`)}}return{markers:t,unparseableAttributes:n}}function Fr(e){let t=e.manifestVersion>=2||e.visualEditing?.mode==="strict"?"strict":"legacy",n=[],r=[],i=Ht(e.contentDefaults,e.editorSchema),s=mt(e.artifacts),o=s.markers;e.contentDefaults||n.push('site-data.json must contain a JSON object at "content".'),e.editorSchema||n.push("An editor schema could not be derived from site-data.json content."),gs(e.editorSchema,n),hs(e.editorSchema,n),ts(e.editorSchema,n,e.pages),ns(e.editorSchema,e.contentDefaults,n),is(e.artifacts,n),os(e.artifacts,n),ss(e.artifacts,e.contentDefaults,e.editorSchema,n),r.push(...s.unparseableAttributes.map(T=>`${T} Exported exact markers may still satisfy strict coverage.`));let a=J(o,"field",n),l=J(o,"list",n),u=J(o,"item",n),f=o.filter(T=>T.artifactKind==="html"),g=J(f,"field",n),E=J(f,"list",n),S=J(f,"item",n),m=o.filter(T=>T.artifactKind==="source"),d=J(m,"field",n),p=J(m,"list",n),h=J(m,"item",n),b=Dr(e.visualEditing?.controlOnlyPaths??[],i,n);Vt({label:"editable field",expectedPatterns:i.fieldPatterns,concretePaths:i.concreteFields,htmlMarkerPaths:g,sourceMarkerPaths:d,controlOnlyPaths:b,findings:n}),Vt({label:"editable list",expectedPatterns:i.listPatterns,concretePaths:i.concreteLists,htmlMarkerPaths:E,sourceMarkerPaths:p,controlOnlyPaths:[],findings:n}),Vt({label:"editable list item",expectedPatterns:i.itemPatterns,concretePaths:i.concreteItems,htmlMarkerPaths:S,sourceMarkerPaths:h,controlOnlyPaths:[],findings:n}),Ut("field",a,i.fieldPatterns,i.concreteFields,n),Ut("list",l,i.listPatterns,i.concreteLists,n),Ut("item",u,i.itemPatterns,i.concreteItems,n),Nr(e.manifestVersion,e.pages??[],o,e.artifacts,n),Or({manifestVersion:e.manifestVersion,pages:e.pages??[],schema:e.editorSchema,markers:o,fieldPaths:G([...i.fieldPatterns.filter(T=>!T.includes("[*]")),...i.concreteFields]),listPaths:G([...i.listPatterns.filter(T=>!T.includes("[*]")),...i.concreteLists]),itemPaths:i.concreteItems,controlOnlyPaths:b,findings:n});let c=as(e.artifacts,e.pages??[]);t==="strict"?n.push(...c):r.push(...c);let y=G(n),w=G(r);return t==="legacy"?{mode:t,errors:[],warnings:G([...y.map(T=>`[legacy] ${T}`),...w]),inventory:i,markers:o}:{mode:t,errors:y,warnings:w,inventory:i,markers:o}}function Rr(e){let t=[],n=[],r=Ht(e.contentDefaults,e.editorSchema),i=Yt(e.contentDefaults,e.editorSchema),s=Ht(i,e.editorSchema),o=G([...r.fieldPatterns.filter(d=>!d.includes("[*]")),...s.concreteFields]),a=G([...r.listPatterns.filter(d=>!d.includes("[*]")),...s.concreteLists]),l=s.concreteItems,u=e.artifacts.filter(d=>d.kind==="html"),f=mt(u),g=J(f.markers,"field",t),E=J(f.markers,"list",t),S=J(f.markers,"item",t),m=Dr(e.visualEditing?.controlOnlyPaths??[],r,t);jt({markerPaths:g,expectedPaths:s.concreteFields,knownPatterns:r.fieldPatterns,attribute:"field",findings:t}),jt({markerPaths:E,expectedPaths:s.concreteLists,knownPatterns:r.listPatterns,attribute:"list",findings:t}),jt({markerPaths:S,expectedPaths:s.concreteItems,knownPatterns:r.itemPatterns,attribute:"item",findings:t});for(let d of o)ft(d,m)||g.includes(d)||t.push(`Empty-state export removed data-preview-field-path="${d}". Keep the editable target mounted when its value is empty, false, or zero.`);for(let d of a)E.includes(d)||t.push(`Empty-state export removed data-preview-list-path="${d}". Keep the list container mounted when the list has no items.`);for(let d of l)S.includes(d)||t.push(`Empty-state export removed data-preview-item-path="${d}" required by minItems/required list validation.`);return Nr(e.manifestVersion,e.pages??[],f.markers,u,t),Or({manifestVersion:e.manifestVersion,pages:e.pages??[],schema:e.editorSchema,markers:f.markers,fieldPaths:o,listPaths:a,itemPaths:l,controlOnlyPaths:m,findings:t}),n.push(...f.unparseableAttributes),{errors:G(t),warnings:G(n),requiredFieldPaths:o,requiredListPaths:a,requiredItemPaths:l}}function jt(e){let t=new Set(e.expectedPaths),n=new Set(e.knownPatterns);for(let r of e.markerPaths)r.includes("[*]")||t.has(r)||!n.has(Z(r))||e.findings.push(`Empty-state export rendered out-of-range data-preview-${e.attribute}-path="${r}" for a list item that does not exist. Render list items from the actual site-data array instead of fixed indexes or placeholder cards.`)}function Ko(e,t,n){let r=t.split(".").map(o=>o.trim()).filter(Boolean);if(r.length===0||r.some(o=>o.includes("[")))return;let i=e;for(let o of r.slice(0,-1)){let a=i[o];Q(a)||(i[o]={}),i=i[o]}let s=r.at(-1);qt(i,s,n,t)}function qt(e,t,n,r){if(n.type==="list"){let i=Array.isArray(e[t])?[...e[t]]:[],s=Se(n.maxItems),o=Math.min(s??Number.MAX_SAFE_INTEGER,s===0?0:Math.max(1,Se(n.minItems)??(n.required?1:0)));for(;i.length<o;)i.push(void 0);e[t]=i.map((a,l)=>{let u=`${r}[${l}]`;if(n.itemField)return Cr(a,n.itemField.type,u,n.itemField.options);let f=Q(a)?a:{};for(let g of n.fields??[])qt(f,g.key,g,X(u,g.key));return f});return}if(n.type==="object"){let i=Q(e[t])?e[t]:{};e[t]=i;for(let s of n.fields??[])qt(i,s.key,s,X(r,s.key));return}e[t]=Cr(e[t],n.type,r,n.options)}function Cr(e,t,n,r){return t==="number"?typeof e=="number"&&Number.isFinite(e)&&e!==0?e:1:t==="boolean"?e===!0?e:!0:typeof e=="string"&&e.trim()&&(t!=="select"||!r?.length||r.includes(e))?e:t==="select"?r?.[0]??lt(n):t==="url"?`https://template-validation.example.invalid/${dt(n)}`:t==="image"?`/template-validation-${dt(n)}.svg`:t==="email"?"validation@example.invalid":t==="tel"?"+12025550142":lt(n)}function Wt(e,t){return Array.isArray(e)?e.map((n,r)=>Wt(n,`${t}[${r}]`)):Q(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>{let i=X(t,n);return[n,Wt(r,i)]})):typeof e=="string"?e.trim()?e:Yo(t):typeof e=="number"?Number.isFinite(e)&&e!==0?e:1:typeof e=="boolean"?!0:e??lt(t)}function Yo(e){let t=e.toLowerCase();return t.includes("email")?"validation@example.invalid":t.includes("phone")||t.includes("mobile")||t.includes("whatsapp")||t.includes("contactnumber")?"+12025550142":t.includes("image")||t.includes("logo")||t.includes("banner")||t.includes("thumbnail")||t.includes("photo")?`/template-validation-${dt(e)}.svg`:t.includes("url")||t.includes("link")?`https://template-validation.example.invalid/${dt(e)}`:lt(e)}function lt(e){return`Validation ${e||"content"}`}function dt(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"content"}function Lr(e){return Array.isArray(e)?[]:Q(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Lr(n)])):typeof e=="string"?"":typeof e=="number"?0:typeof e=="boolean"?!1:e}function Jo(e,t,n){let r=t.split(".").map(o=>o.trim()).filter(Boolean);if(r.length===0||r.some(o=>o.includes("[")))return;let i=e;for(let o of r.slice(0,-1)){let a=i[o];Q(a)||(i[o]={}),i=i[o]}let s=r.at(-1);Jt(i,s,n)}function Jt(e,t,n){if(n.type==="list"){let r=Math.min(Se(n.maxItems)??Number.MAX_SAFE_INTEGER,Se(n.minItems)??(n.required?1:0));e[t]=Array.from({length:r},()=>Xo(n));return}if(n.type==="object"){let r=Q(e[t])?e[t]:{};e[t]=r;for(let i of n.fields??[])Jt(r,i.key,i);return}e[t]=n.type==="number"?0:n.type==="boolean"?!1:""}function Xo(e){if(e.itemField)return e.itemField.type==="number"?0:e.itemField.type==="boolean"?!1:"";let t={};for(let n of e.fields??[])Jt(t,n.key,n);return t}function Gt(e,t,n){if(Array.isArray(e)){let r=Z(t);n.listPatterns.add(r),n.concreteLists.add(t),n.itemPatterns.add(`${r}[*]`),e.forEach((i,s)=>{let o=`${t}[${s}]`;n.concreteItems.add(o),Array.isArray(i)||Q(i)?Gt(i,o,n):(n.fieldPatterns.add(Z(o)),n.concreteFields.add(o))});return}if(Q(e)){for(let[r,i]of Object.entries(e))Gt(i,X(t,r),n);return}n.fieldPatterns.add(Z(t)),n.concreteFields.add(t)}function Zt(e,t,n){if(t.type==="object"){for(let r of t.fields??[])Zt(X(e,r.key),r,n);return}if(t.type==="list"){let r=Z(e),i=`${r}[*]`;n.listPatterns.add(r),n.itemPatterns.add(i),t.itemField&&n.fieldPatterns.add(i);for(let s of t.fields??[])Zt(X(i,s.key),s,n);return}n.fieldPatterns.add(Z(e))}function J(e,t,n){let r=[];for(let i of e.filter(s=>s.kind===t)){let s=$e(i.value);if(!s){n.push(`${i.filePath}:${Br(i)} has invalid data-preview-${t}-path "${i.value}".`);continue}r.push(s)}return G(r)}function Dr(e,t,n){let r=[];for(let i of e){let s=$e(i);if(!s){n.push(`controlOnlyPaths contains invalid path "${i}".`);continue}if(![...t.fieldPatterns,...t.concreteFields].some(a=>Kt(s,a))){n.push(`controlOnlyPaths contains unknown editable field path "${s}".`);continue}r.push(s)}return G(r)}function Vt(e){for(let t of e.expectedPatterns){if(ft(t,e.controlOnlyPaths))continue;let n=e.concretePaths.filter(r=>Z(r)===t);if(!t.includes("[*]")){e.htmlMarkerPaths.includes(t)||e.findings.push(`Exported HTML is missing exact data-preview-${zt(e.label)}="${t}" for ${e.label}.`);continue}e.sourceMarkerPaths.some(r=>ys(r,t))||e.findings.push(`Source is missing dynamic data-preview-${zt(e.label)} mapping for ${e.label} "${t}". Use an exact JSX template path such as [\${index}] so newly added and reordered items remain editable.`),n.length>0}for(let t of e.concretePaths)e.expectedPatterns.includes(t)||ft(t,e.controlOnlyPaths)||e.htmlMarkerPaths.includes(t)||e.findings.push(`Exported HTML is missing exact data-preview-${zt(e.label)}="${t}" for concrete ${e.label}.`)}function Ut(e,t,n,r,i){for(let s of t)n.some(a=>Kt(s,a))||r.some(a=>Kt(s,a))||i.push(`data-preview-${e}-path references unknown path "${s}".`)}function Nr(e,t,n,r,i){let s=r.filter(f=>f.kind==="html"),o=n.filter(f=>f.kind==="page"&&f.artifactKind==="html"),a=new Set(t.map(f=>f.id)),l=new Set,u=new Map;t.length===0&&i.push("Strict visual editing requires at least one manifest pages[] entry.");for(let f of t){l.has(f.id)&&i.push(`Manifest pages[] contains duplicate id "${f.id}".`),l.add(f.id);let g=Qt(f.route)??(e<2?Mr(f.id):null);if(!g){i.push(`Manifest page "${f.id}" must declare a canonical route for strict visual editing.`);continue}let E=u.get(g);E?i.push(`Manifest pages "${E}" and "${f.id}" use duplicate route "${g}".`):u.set(g,f.id);let S=s.filter(p=>en(p.filePath,g));if(S.length===0){i.push(`Manifest page "${f.id}" route "${g}" has no exported HTML file.`);continue}let m=new Set(S.map(p=>p.filePath));o.some(p=>p.value===f.id&&m.has(p.filePath))||i.push(`Exported route "${g}" is missing data-preview-page-key="${f.id}".`)}for(let f of n.filter(g=>g.kind==="page"))a.has(f.value)||i.push(`${f.filePath}:${Br(f)} data-preview-page-key references unknown manifest page "${f.value}".`)}function Or(e){let t=(e.schema?.sections??[]).map(i=>({section:i,canonicalPath:$e(i.path)})).filter(i=>!!i.canonicalPath),n=new Map(e.pages.map(i=>[i.id,i])),r=(i,s)=>{for(let o of s){if(i==="field"&&ft(o,e.controlOnlyPaths))continue;let a=t.filter(E=>Qo(o,E.canonicalPath)).sort((E,S)=>S.canonicalPath.length-E.canonicalPath.length)[0];if(!a?.section.pageKey)continue;let l=n.get(a.section.pageKey);if(!l){e.findings.push(`editorSchema section "${a.section.path}" assigns ${kr(i)} "${o}" to unknown manifest page "${a.section.pageKey}".`);continue}let u=Qt(l.route)??(e.manifestVersion<2?Mr(l.id):null);!u||!e.markers.some(E=>E.kind===i&&E.artifactKind==="html"&&$e(E.value)===o)||e.markers.some(E=>E.kind===i&&E.artifactKind==="html"&&$e(E.value)===o&&en(E.filePath,u))||e.findings.push(`Page-owned ${kr(i)} "${o}" from editorSchema section "${a.section.path}" must render data-preview-${es(i)}="${o}" on manifest page "${l.id}" route "${u}". Shared sections without pageKey may render globally.`)}};r("field",G(e.fieldPaths)),r("list",G(e.listPaths)),r("item",G(e.itemPaths))}function Qo(e,t){let n=Z(e),r=Z(t);return n===r||n.startsWith(`${r}.`)||n.startsWith(`${r}[`)}function kr(e){return e==="field"?"editable field":e==="list"?"editable list":"editable list item"}function es(e){return e==="field"?"field-path":e==="list"?"list-path":"item-path"}function ts(e,t,n=[]){let r=new Set(n.map(o=>o.id?.trim()).filter(o=>!!o)),i=(o,a)=>{if(!a?.some(l=>typeof l=="string"&&l.trim().length>0)){t.push(`editorSchema select field "${o}" must declare at least one non-empty option for strict visual editing. Add options: ["First option", ...] or change the field type.`);return}if(r.size>0&&/(?:destination|action|targetpage|buttonaction|pagekey)/i.test(o))for(let u of a){let f=typeof u=="string"?u.trim():"";f&&f!=="none"&&f!=="external"&&!r.has(f)&&t.push(`editorSchema select field "${o}" declares destination option "${f}" which is not in fivora-template.json pages[]. Declared pages: ${[...r].join(", ")}.`)}},s=(o,a)=>{if(a.type==="select"){i(o,a.options);return}if(a.type==="object"){for(let u of a.fields??[])s(X(o,u.key),u);return}if(a.type!=="list")return;let l=`${Z(o)}[*]`;a.itemField?.type==="select"&&i(l,a.itemField.options);for(let u of a.fields??[])s(X(l,u.key),u)};for(let o of e?.sections??[])s(o.path,o)}function ns(e,t,n){let r=(s,o)=>{if(o.type==="object"){for(let g of o.fields??[])r(X(s,g.key),g);return}if(o.type!=="list")return;let a=Se(o.minItems),l=Se(o.maxItems);o.minItems!==void 0&&a===null&&n.push(`editorSchema list "${s}" minItems must be a non-negative safe integer.`),o.maxItems!==void 0&&l===null&&n.push(`editorSchema list "${s}" maxItems must be a non-negative safe integer.`);let u=a??(o.required?1:0);l!==null&&u>l&&n.push(`editorSchema list "${s}" requires at least ${u} item${u===1?"":"s"} but maxItems is ${l}. Increase maxItems or lower minItems/required.`);let f=`${Z(s)}[*]`;for(let g of o.fields??[])r(X(f,g.key),g)},i=(s,o,a)=>{if(o.type==="object"){let f=Q(a)?a:{};for(let g of o.fields??[])i(X(s,g.key),g,f[g.key]);return}if(o.type!=="list")return;let l=Array.isArray(a)?a:[],u=Se(o.maxItems);u!==null&&l.length>u&&n.push(`site-data.json content list "${s}" contains ${l.length} items, exceeding editorSchema maxItems ${u}.`);for(let[f,g]of l.entries()){let E=Q(g)?g:{};for(let S of o.fields??[])i(X(`${s}[${f}]`,S.key),S,E[S.key])}};for(let s of e?.sections??[])r(s.path,s),i(s.path,s,rs(t??{},s.path))}function Se(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0?e:null}function rs(e,t){let n=e;for(let r of t.split(".").map(i=>i.trim())){if(!r||!Q(n))return;n=n[r]}return n}function is(e,t){let n=[/\b(?:setAttribute|setAttributeNS|toggleAttribute)\s*\(\s*['"`]data-preview-static['"`]/m,/\.(?:attr|prop)\s*\(\s*['"`]data-preview-static['"`]/m,/\bdataset\s*(?:\.\s*previewStatic|\[\s*['"`]previewStatic['"`]\s*\])\s*=/m,/\b(?:innerHTML|outerHTML)\s*\+?=[^;]{0,500}data-preview-static/m,/\.(?:replace|replaceAll)\s*\([\s\S]{0,500}?data-preview-static/m];for(let r of e.filter(i=>i.kind==="source")){let i=n.map(f=>f.exec(r.content)).find(f=>!!f),s=r.content.search(/data-preview-static/),o=/\b(?:writeFile|writeFileSync|appendFile|appendFileSync)\s*\(/m.exec(r.content),a=/\.[cm]?[jt]s$/i.test(r.filePath),l=s>=0&&a&&o;if(!i&&!l)continue;let u=i?.index??s;t.push(`${r.filePath}:${U(r.content,u)} programmatically injects data-preview-static. Author each intentional static annotation directly on the smallest source element; blanket or post-build annotation bypasses strict editable-content validation.`)}}function os(e,t){let n=e.filter(S=>S.kind==="source"),r=n.map(S=>S.content).join(`
|
|
3
3
|
`);if(/(?:import|export)\s+[\s\S]*?\b(?:SiteDataProvider|BaseSiteDataProvider|useSiteData|DenebProvider|DenebSiteDataProvider|DenebUiProvider)\b[\s\S]*?\bfrom\s+['"][^'"]*['"]/m.test(r)||/(?:import|export)\s+[\s\S]*?\bfrom\s+['"](?:@fivora\/|deneb-ui|@deneb-ui\/)/m.test(r)||/<(?:SiteDataProvider|BaseSiteDataProvider|DenebProvider|DenebSiteDataProvider|DenebUiProvider|[A-Za-z_$][\w$]*\.(?:SiteDataProvider|DenebProvider))\b/m.test(r))return;let s=r.includes(st)||r.includes(at),o=r.includes(ct)||r.includes(Bt),a=/(?:window|globalThis|self)\s*\.\s*addEventListener\s*\(\s*['"]message['"]/m.test(r)||/(?:window|globalThis|self)\s*\.\s*onmessage\s*=/m.test(r),l=/\bset[A-Z_$][\w$]*\s*\(/m.test(r)||/\bdispatch\s*\(/m.test(r)||/\b(?:store|siteDataStore)\s*\.\s*(?:setState|set|update)\s*\(/m.test(r),u=n.some(S=>{let m=S.content,d=/(?:window|globalThis|self)\s*\.\s*addEventListener\s*\(\s*['"]message['"]/m.test(m)||/(?:window|globalThis|self)\s*\.\s*onmessage\s*=/m.test(m),p=/\bset[A-Z_$][\w$]*\s*\(/m.test(m)||/\bdispatch\s*\(/m.test(m)||/\b(?:store|siteDataStore)\s*\.\s*(?:setState|set|update)\s*\(/m.test(m);return(m.includes(st)||m.includes(at))&&d&&p}),g=/\bcreateContext\s*[<(]/m.test(r)&&/(?:\.Provider\b|<[A-Za-z_$][\w$]*Provider\b)/m.test(r)&&/\buseContext\s*[<(]/m.test(r)||/\buseSyncExternalStore\s*[<(]/m.test(r)||/\bcreate(?:Store|Signal)\s*[<(]/m.test(r)&&/\buse[A-Z_$][\w$]*(?:Store|Data)\s*[<(]/m.test(r),E=n.some(S=>(S.content.includes(ct)||S.content.includes(Bt))&&/\bpostMessage\s*\(/m.test(S.content));s||t.push(`Preview runtime source must implement the "${st}" (or legacy "${at}") protocol so editor changes replace the rendered site data instead of remaining in a static JSON import.`),o||t.push(`Preview runtime source must implement the "${ct}" (or legacy "${Bt}") protocol so the editor can wait for a live preview before sending data.`),(!a||!l||!u)&&t.push(`Preview runtime source must handle "${st}" (or legacy "${at}") and apply its payload through a reactive state setter, reducer, or store update in the same live-data module.`),g||t.push("Preview runtime source must expose live site data through a recognizable reactive provider/hook (for example createContext + Provider + useContext, useSyncExternalStore, or a reactive store hook). Static site-data.json imports alone cannot be certified."),E||t.push(`Preview runtime source must call postMessage with "${Zo}" after its live-data listener is ready.`)}function ss(e,t,n,r){let i=e.filter(S=>S.kind==="source"),s=[/\/products\/\$\{/m,/['"`]\/products\/['"`]\s*\+\s*(?:encodeURIComponent\s*\()?/m];for(let S of i){let m=s.map(d=>d.exec(S.content)).find(d=>!!d);m&&r.push(`${S.filePath}:${U(S.content,m.index)} uses a build-time dynamic /products/:id URL. Live catalog items can be added after a static export, so product links must use the stable exported route /products/detail/?id=... and resolve the ID from the live catalog on the client.`)}let o=Array.isArray(t?.products)||!!n?.sections.some(S=>S.path==="products"||S.path.startsWith("products["))||i.some(S=>/data-preview-(?:list|item|field)-path\s*=\s*(?:["']products|\{\s*`products)/m.test(S.content)),a=i.some(S=>/\bplatformProductDetailHref\s*\(/m.test(S.content)||/\/products\/detail\/?\?[^'"`\s}]*\bid=/m.test(S.content)),l=i.some(S=>/(?:^|\/)src\/(?:app\/products\/detail\/page|pages\/products\/detail)\.[cm]?[jt]sx?$/i.test(S.filePath.replace(/\\/g,"/"))||/\b(?:PlatformProductDetail|usePlatformProductDetail)\b/m.test(S.content)),u=i.some(S=>/(?:^|\/)src\/(?:app\/products\/\[[^/]+\]\/page|pages\/products\/\[[^/]+\])\.[cm]?[jt]sx?$/i.test(S.filePath.replace(/\\/g,"/"))),f=i.some(S=>/\brenderProduct\s*=/m.test(S.content)||/\busePlatformProductDetail\s*\(/m.test(S.content)),g=a||l||o&&u;if(g&&!a&&r.push("Templates with product-detail navigation must link every product through platformProductDetailHref(product.id) or /products/detail/?id=... so products added after the static build use the native detail page."),g&&!l&&r.push("Templates with product-detail navigation must provide a stable client product page at src/app/products/detail/page.* using PlatformProductDetail or usePlatformProductDetail."),g&&u&&l&&!f&&r.push("The template has a native dynamic product-detail page, but its stable live-catalog page does not reuse that design. Pass the native renderer through PlatformProductDetail renderProduct or render it from usePlatformProductDetail so old and newly-added products have the same layout."),!g)return;e.some(S=>S.kind==="html"&&/(?:^|\/)products\/detail\/(?:index\.)?html$/i.test(S.filePath.replace(/\\/g,"/")))||r.push("The template product catalog requires products/detail/index.html, but the static export does not contain it. Add a stable client detail page that reads the query ID and hydrates the matching item from the live catalog.")}function as(e,t){let n=[];for(let r of e.filter(i=>i.kind==="html"&&!cs(i.filePath,t)))n.push(...ls(r));return n}function cs(e,t){let n=e.replace(/\\/g,"/").replace(/^\/+/,"");return/^(?:404|500|_error|_not-found)(?:\/index)?\.html$/i.test(n)?!t.some(i=>{let s=Qt(i.route);return s?en(n,s):!1}):!1}function ls(e){let t=[],n=[],r=e.content.matchAll(/<!--[\s\S]*?-->|<![^>]*>|<\/?[^>]+>|[^<]+/g);for(let i of r){let s=i[0],o=i.index??0,a=n.at(-1);if(s.startsWith("<!--")||s.startsWith("<!"))continue;if(s.startsWith("</")){let u=s.slice(2,-1).trim().split(/\s+/)[0]?.toLowerCase(),f=n.map(g=>g.tag).lastIndexOf(u);f>=0&&(t.push(...ds(e,n[f])),n.splice(f));continue}if(s.startsWith("<")){let u=s.match(/^<\s*([a-zA-Z0-9:-]+)/);if(!u)continue;let f=u[1].toLowerCase(),g=/\bdata-preview-field-path\s*=/.test(s),E=/\bdata-preview-list-path\s*=/.test(s),S=/\bdata-preview-item-path\s*=/.test(s),m=g||E||S;if(g)for(let T of n)T.ownsFieldMarker&&(T.hasNestedFieldMarker=!0);let d=s.match(/\bdata-preview-static\s*=\s*(?:"([^"]*)"|'([^']*)')/),p=!!d;p&&!(d?.[1]??d?.[2]??"").trim()&&t.push(`${e.filePath}:${U(e.content,o)} data-preview-static requires a reason.`),m&&(p||a?.staticCovered)&&t.push(`${e.filePath}:${U(e.content,o)} data-preview field/list/item markers cannot be on or inside data-preview-static. The visual editor intentionally ignores targets beneath a static ancestor.`),g&&xr.has(f)&&t.push(`${e.filePath}:${U(e.content,o)} data-preview-field-path cannot be placed on broad <${f}> content containers. Put the marker on the exact visible text, media, link, or control that the field edits.`),p&&xr.has(f)&&t.push(`${e.filePath}:${U(e.content,o)} data-preview-static cannot cover a broad <${f}> content container. Mark only the smallest genuinely non-editable element.`);let h=!!a?.hidden||ms(s,f);m&&h&&t.push(`${e.filePath}:${U(e.content,o)} data-preview field/list/item marker is hidden. Strict visual-edit targets must remain visible and clickable in the exported page.`);let b=s.match(/\bdata-preview-field-path\s*=\s*(?:"([^"]*)"|'([^']*)')/)?.slice(1).find(Boolean)??null,c=s.match(/\bdata-preview-item-path\s*=\s*(?:"([^"]*)"|'([^']*)')/)?.slice(1).find(Boolean)??null;c&&a?.itemPath&&!Ar(c,a.itemPath)&&t.push(`${e.filePath}:${U(e.content,o)} repeated item "${c}" is nested inside unrelated item "${a.itemPath}". One visual card must be one object-list item; do not couple parallel arrays by index.`);let y=c??a?.itemPath??null;b&&y&&/\[\d+\]/.test(b)&&!Ar(b,y)&&t.push(`${e.filePath}:${U(e.content,o)} repeated field "${b}" is rendered inside item "${y}" but belongs to a different list. Model one visual card as one object-list item instead of coupling parallel arrays by index.`);let w={tag:f,ignored:!!a?.ignored||Go.has(f),hidden:h,fieldCovered:!!a?.fieldCovered||g,staticCovered:!!a?.staticCovered||p,ownsFieldMarker:g,hasNestedFieldMarker:!1,fieldPath:b,itemPath:y,shopAttributeValues:us(s,f),visibleTextParts:[],offset:o};if(!w.ignored&&!w.fieldCovered&&!w.staticCovered){let T=ps(e,s,f,o);t.push(...T),f==="img"&&!w.hidden&&T.length===0&&t.push(`${e.filePath}:${U(e.content,o)} rendered <img> is not covered by data-preview-field-path or data-preview-static. Bind business media to an exact image field, or mark an intentional fixed/decorative image static with a reason.`)}!Wo.has(f)&&!/\/\s*>$/.test(s)&&n.push(w);continue}let l=Xt(s);if(ut(l))for(let u of n)u.ownsFieldMarker&&u.visibleTextParts.push(l);a?.ignored||a?.fieldCovered||a?.staticCovered||ut(l)&&t.push(`${e.filePath}:${U(e.content,o)} visible text "${pt(l,72)}" is not covered by data-preview-field-path or data-preview-static.`)}return t}function Ar(e,t){let n=Te(e).trim(),r=Te(t).trim();return n===r||n.startsWith(`${r}.`)||n.startsWith(`${r}[`)}function ds(e,t){if(!t.ownsFieldMarker||t.hasNestedFieldMarker||t.shopAttributeValues.length===0)return[];let n=Xt(t.visibleTextParts.join(" "));return!ut(n)||t.shopAttributeValues.some(r=>fs(r,n))?[]:[`${e.filePath}:${U(e.content,t.offset)} data-preview-field-path="${t.fieldPath??""}" cannot cover both <${t.tag}> action/media attributes and different visible text "${pt(n,72)}". Put the action/media marker on the element and the label marker on an exact nested text element.`]}function us(e,t){return[...e.matchAll(/\b(href|src|poster)\s*=\s*(?:"([^"]*)"|'([^']*)')/gi)].map(n=>({name:n[1].toLowerCase(),value:Te(n[2]??n[3]??"").trim()})).filter(({name:n,value:r})=>$r(t,n,r)).map(({value:n})=>n)}function fs(e,t){let n=r=>Te(r).replace(/^(?:mailto:|tel:|sms:|https?:\/\/)/i,"").replace(/^www\./i,"").replace(/\/+$/g,"").replace(/\s+/g,"").toLowerCase();return n(e)===n(t)}function ps(e,t,n,r){let i=[],s=[...t.matchAll(/\b(href|src|poster)\s*=\s*(?:"([^"]*)"|'([^']*)')/gi)];for(let f of s){let g=f[1].toLowerCase(),E=Te(f[2]??f[3]??"").trim();$r(n,g,E)&&i.push(`${e.filePath}:${U(e.content,r)} ${n}[${g}="${pt(E,72)}"] is not covered by data-preview-field-path or data-preview-static.`)}let o=[...t.matchAll(/\b(placeholder|alt|title|aria-label|value)\s*=\s*(?:"([^"]*)"|'([^']*)')/gi)],a=t.match(/\btype\s*=\s*(?:"([^"]*)"|'([^']*)')/i),l=(a?.[1]??a?.[2]??"").toLowerCase();for(let f of o){let g=f[1].toLowerCase(),E=Xt(f[2]??f[3]??"");!(g==="aria-label"||g==="title"||g==="alt"&&n==="img"||g==="placeholder"&&["input","textarea"].includes(n)||g==="value"&&["input","button"].includes(n)&&!["hidden","checkbox","radio"].includes(l))||!ut(E)||i.push(`${e.filePath}:${U(e.content,r)} ${n}[${g}="${pt(E,72)}"] is not covered by data-preview-field-path or data-preview-static.`)}let u=t.match(/\bstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/i);return u&&/(?:background|background-image)\s*:[^;]*url\(/i.test(u[1]??u[2]??"")&&i.push(`${e.filePath}:${U(e.content,r)} background image is not covered by data-preview-field-path or data-preview-static.`),i}function ms(e,t){let n=e.replace(/="[^"]*"|='[^']*'/g,'=""');if(/(?<![\w-])hidden(?:[\s=]|\/?>)/i.test(n)||/\baria-hidden\s*=\s*(?:"true"|'true')/i.test(e))return!0;if(t==="input"){let s=e.match(/\btype\s*=\s*(?:"([^"]*)"|'([^']*)')/i);if((s?.[1]??s?.[2]??"").trim().toLowerCase()==="hidden")return!0}let r=e.match(/\bstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/i),i=r?.[1]??r?.[2]??"";return/\bdisplay\s*:\s*none\b/i.test(i)||/\bvisibility\s*:\s*hidden\b/i.test(i)}function gs(e,t){let n=new Set,r=new Set;for(let i of e?.sections??[])n.has(i.id)&&t.push(`editorSchema.sections contains duplicate id "${i.id}".`),r.has(i.path)&&t.push(`editorSchema.sections contains duplicate path "${i.path}".`),n.add(i.id),r.add(i.path)}function hs(e,t){for(let n of rt(e)){let r=n.firstKind===n.duplicateKind?n.firstKind:"field/list";t.push(`editorSchema declares duplicate editable ${r} path "${n.path}" in sections "${n.firstSectionId}" and "${n.duplicateSectionId}". Each editable path must be owned by exactly one section.`)}}function $r(e,t,n){return!n||n.startsWith("data:")||n.startsWith("blob:")||n.includes("/_next/")||n.includes("${")?!1:t==="href"?e==="a"&&!/^(?:javascript:|data:|blob:)/i.test(n):t==="src"&&["img","video","source"].includes(e)||t==="poster"&&e==="video"}function Xt(e){return Te(e).replace(/\s+/g," ").trim()}function ut(e){return e.length<=2||!new RegExp("\\p{L}","u").test(e)?!1:!/^(?:true|false|null|undefined)$/i.test(e)}function zt(e){return e==="editable field"?"field-path":e==="editable list"?"list-path":"item-path"}function ys(e,t){return t.includes("[*]")?e.includes("[*]")&&e===t:e===t}function Kt(e,t){return Z(e)===Z(t)}function ft(e,t){return t.some(n=>n.includes("[*]")?Z(e)===n:e===n)}function $e(e){let t=e.trim().replace(/\[\s*\$\{[^}]+\}\s*\]/g,"[*]").replace(/\[\s+/g,"[").replace(/\s+\]/g,"]");return qo.test(t)?t:null}function Z(e){return e.replace(/\[\d+\]/g,"[*]")}function X(e,t){return e?`${e}.${t}`:t}function Qt(e){if(!e)return null;let t=e.trim();return!t.startsWith("/")||t.includes("?")||t.includes("#")||t.includes("\\")||t.includes("..")?null:t==="/"?t:t.replace(/\/+$/,"")}function Mr(e){return e==="home"?"/":`/${e}`}function en(e,t){let n=e.replace(/\\/g,"/").replace(/^\/+/,"");if(t==="/")return n==="index.html";let r=t.replace(/^\/+/,"");return n===`${r}.html`||n===`${r}/index.html`}function Q(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Te(e){return e.replace(/"/gi,'"').replace(/'|'/gi,"'").replace(/</gi,"<").replace(/>/gi,">").replace(/&/gi,"&").replace(/ /gi," ")}function Br(e){return e.line}function U(e,t){let n=1;for(let r=0;r<t;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function G(e){return[...new Set(e)].sort()}function pt(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}\u2026`}function Vr(e){let t=e.filter((n,r)=>n.required===!0||r===0).map(n=>n.id);return t.length>0?t:e.slice(0,1).map(n=>n.id)}function jr(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Es(e,t,n){let r=e.trim().split(/[?#]/,1)[0];return r==="/"||r===""?n?"/":`/${t}`:/^[a-z][a-z0-9+.-]*:/i.test(r)||r.startsWith("//")?n?"/":`/${t}`:`/${r.replace(/^\/+|\/+$/g,"")}`}function Ur(e,t=[]){let r=(jr(e)&&Array.isArray(e.pages)?e.pages:[]).flatMap((s,o)=>{if(!jr(s)||typeof s.id!="string"||!s.id.trim())return[];let a=s.id.trim(),l=typeof s.label=="string"&&s.label.trim()?s.label.trim():a.replace(/_/g," ");return[{id:a,label:l,route:Es(typeof s.route=="string"?s.route:"",a,o===0)}]});return r.length>0?r:t.map(s=>s.trim()).filter(Boolean).map((s,o)=>({id:s,label:s.replace(/_/g," "),route:o===0?"/":`/${s}`}))}function zr(e){let t=new Set(e.selectedPages),n=e.pageDefinitions.filter(i=>!t.has(i.id)),r=[];for(let i of e.html.matchAll(/<[a-z][^>]*\b(?:href|formaction|data-href|data-route|data-url)\s*=\s*(?:"([^"]*)"|'([^']*)')[^>]*>/gi)){let s=i[1]??i[2]??"";if(!s.trim()||s.trim().startsWith("#")||/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(s.trim()))continue;let o=s.split(/[?#]/,1)[0],a=e.basePath?.replace(/\/+$/g,"")||"",u=`/${(a&&(o===a||o.startsWith(`${a}/`))?o.slice(a.length)||"/":o).replace(/\/index\.html$/i,"/").replace(/\.html$/i,"").replace(/^\.\//,"").replace(/^\/+|\/+$/g,"")}`,f=u==="/"?"/":u,g=n.find(E=>{let S=E.route==="/"?"/":`/${E.route.replace(/^\/+|\/+$/g,"")}`;return S==="/"?f==="/":f===S||f.startsWith(`${S}/`)});g&&r.push({pageId:g.id,route:g.route,href:o})}return r}function Hr(e){let t=[],n=new Set(["router","navigation"]),r=new Set(["useRouter"]),i=new Set(["Link"]),s=d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=d=>{let p=d.replace(/\s+/g," ").trim();return p.length>180?`${p.slice(0,177)}...`:p},a=(d,p,h)=>{let b=1,c=null,y=!1,w=!1,T=!1;for(let P=d;P<e.length;P+=1){let x=e[P],v=e[P+1];if(w){x===`
|
|
4
|
-
`&&(w=!1);continue}if(T){x==="*"&&v==="/"&&(T=!1,P+=1);continue}if(c){y?y=!1:x==="\\"?y=!0:x===c&&(c=null);continue}if(x==="/"&&v==="/"){w=!0,P+=1;continue}if(x==="/"&&v==="*"){T=!0,P+=1;continue}if(x==="'"||x==='"'||x==="`"){c=x;continue}if(x===p)b+=1;else if(x===h&&(b-=1,b===0))return e.slice(d,P)}return e.slice(d,Math.min(e.length,d+4e3))},l=d=>{let p=c=>c.replace(/'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/g," ").replace(/`(?:\\.|[^`\\])*`/g," ").replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/[^\r\n]*/g," "),h=[...d.matchAll(/\$\{([\s\S]*?)\}/g)].map(c=>p(c[1])).join(" "),b=p(d);return/\b(?:[A-Za-z_$][\w$]*\s*\.\s*)*
|
|
4
|
+
`&&(w=!1);continue}if(T){x==="*"&&v==="/"&&(T=!1,P+=1);continue}if(c){y?y=!1:x==="\\"?y=!0:x===c&&(c=null);continue}if(x==="/"&&v==="/"){w=!0,P+=1;continue}if(x==="/"&&v==="*"){T=!0,P+=1;continue}if(x==="'"||x==='"'||x==="`"){c=x;continue}if(x===p)b+=1;else if(x===h&&(b-=1,b===0))return e.slice(d,P)}return e.slice(d,Math.min(e.length,d+4e3))},l=d=>{let p=c=>c.replace(/'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/g," ").replace(/`(?:\\.|[^`\\])*`/g," ").replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/[^\r\n]*/g," "),h=[...d.matchAll(/\$\{([\s\S]*?)\}/g)].map(c=>p(c[1])).join(" "),b=p(d);return/\b(?:[A-Za-z_$][\w$]*\s*\.\s*)*[A-Za-z_$][\w$]*(?:base_?path|path_?base)[\w$]*\b/i.test(`${b} ${h}`)},u=(d,p)=>{t.push({line:e.slice(0,d).split(/\r?\n/).length,expression:o(p),offset:d})};for(let d of e.matchAll(/\bimport\s*\{([^}]*)\}\s*from\s*['"]next\/(?:navigation|router)['"]/g))for(let p of d[1].split(",")){let h=p.trim().match(/^useRouter(?:\s+as\s+([A-Za-z_$][\w$]*))?$/)?.[1];h&&r.add(h)}let f=[...r].map(s).join("|"),g=new RegExp(`\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*(?::[^=;]+)?=\\s*(?:${f})\\s*\\(`,"g");for(let d of e.matchAll(g))n.add(d[1]);for(let d of e.matchAll(/\bimport\s+([^;]{0,300}?)\s+from\s*['"]next\/link['"]/g)){let p=d[1].trim(),h=p.match(/^([A-Za-z_$][\w$]*)/i)?.[1];h&&h!=="type"&&i.add(h);for(let b of p.matchAll(/\bdefault\s+as\s+([A-Za-z_$][\w$]*)/g))i.add(b[1])}for(let d of e.matchAll(/\b([A-Za-z_$][\w$]*)\s*\.\s*(push|replace|prefetch)\s*\(/g)){let p=d[1];if(!n.has(p)&&!/(?:router|navigation)/i.test(p))continue;let h=a((d.index??0)+d[0].length,"(",")");l(h)&&u(d.index??0,`${p}.${d[2]}(${h})`)}let E=new RegExp(`\\b(?:${f})\\s*\\(\\s*\\)\\s*\\.\\s*(push|replace|prefetch)\\s*\\(`,"g");for(let d of e.matchAll(E)){let p=a((d.index??0)+d[0].length,"(",")");l(p)&&u(d.index??0,`${d[0]}${p})`)}let S=[...i].map(s).join("|"),m=new RegExp(`<(${S})\\b[^>]{0,2000}?\\bhref\\s*=\\s*\\{`,"g");for(let d of e.matchAll(m)){let p=a((d.index??0)+d[0].length,"{","}");l(p)&&u(d.index??0,`<${d[1]} href={${p}}>`)}return t.sort((d,p)=>d.offset-p.offset).filter((d,p,h)=>p===0||d.offset!==h[p-1].offset).map(({line:d,expression:p})=>({line:d,expression:p}))}var wt=Ct(wi());function Pi(e){let t=[],n=new Set;for(let s of e.artifacts)if(s.kind==="html")for(let o of(0,wt.collectStyleTargetsFromHtml)(s.content))n.add(o);let i=(e.siteData&&typeof e.siteData=="object"&&!Array.isArray(e.siteData)?e.siteData:null)?.styles;return t.push(...(0,wt.validateStyleTree)(i,n.size>0?n:void 0)),t}var Le="deneb-template-validator",xt="1.0.0",Pt="fivora-template.json",Ri=2500,Li=12*1024*1024,En="/uploads/generated-sites/template-preview/simulation",ea=`https://fivora.example.invalid${En}/`,ta={NODE_ENV:"development",NPM_CONFIG_PRODUCTION:"false",npm_config_production:"false",NPM_CONFIG_INCLUDE:"dev",npm_config_include:"dev",NPM_CONFIG_OMIT:"",NPM_CONFIG_omit:"",NPM_CONFIG_IGNORE_SCRIPTS:"true",npm_config_ignore_scripts:"true",NPM_CONFIG_PREFER_OFFLINE:"true",npm_config_prefer_offline:"true",NPM_CONFIG_AUDIT:"false",npm_config_audit:"false",NPM_CONFIG_FUND:"false",npm_config_fund:"false",NPM_CONFIG_UPDATE_NOTIFIER:"false",npm_config_update_notifier:"false",NPM_CONFIG_PROGRESS:"false",npm_config_progress:"false",PNPM_CONFIG_IGNORE_SCRIPTS:"true",YARN_IGNORE_SCRIPTS:"true",YARN_PRODUCTION:"false"},gn=class{constructor(t,n){this.options=t;this.report={validator:Le,version:xt,command:t.command,input:(0,_.resolve)(t.inputPath),status:"passed",startedAt:n.toISOString(),durationMs:0,steps:[],warnings:[]}}options;report;async step(t,n,r){let i=Date.now();this.options.json||process.stdout.write(`\u2192 ${t}
|
|
5
5
|
`);try{let s=await n();return this.report.steps.push({name:t,status:"passed",durationMs:Date.now()-i,...r?{detail:r}:{}}),this.options.json||process.stdout.write(` \u2713 ${t} (${_i(Date.now()-i)})
|
|
6
6
|
`),s}catch(s){throw this.report.steps.push({name:t,status:"failed",durationMs:Date.now()-i,detail:He(s)}),s}}skip(t,n){this.report.steps.push({name:t,status:"skipped",durationMs:0,detail:n}),this.warn(n)}warn(t){this.report.warnings.includes(t)||this.report.warnings.push(t),this.options.json||process.stdout.write(` ! ${t}
|
|
7
7
|
`)}finish(t,n){this.report.durationMs=Date.now()-t.getTime(),n&&(this.report.status="failed",this.report.error=He(n))}print(){if(this.options.json){process.stdout.write(`${JSON.stringify(this.report,null,2)}
|