@deneb-ui/cli 2.0.119 → 2.0.121

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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var Bi=Object.create;var qe=Object.defineProperty;var ji=Object.getOwnPropertyDescriptor;var Vi=Object.getOwnPropertyNames;var Ui=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var F=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Hi=(e,t)=>{for(var n in t)qe(e,n,{get:t[n],enumerable:!0})},bn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Vi(t))!zi.call(e,i)&&i!==n&&qe(e,i,{get:()=>t[i],enumerable:!(r=ji(t,i))||r.enumerable});return e};var kt=(e,t,n)=>(n=e!=null?Bi(Ui(e)):{},bn(t||!e||!e.__esModule?qe(n,"default",{value:e,enumerable:!0}):n,e)),Wi=e=>bn(qe({},"__esModule",{value:!0}),e);var At=F((Ea,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((Sa,Cn)=>{var Gi=require("fs"),j=require("path"),Pn=At(),Zi=Ge(),Ki=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=Gi,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 Zi.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(b){s.fs.write(b,t,0,t.length,0,function(S){s.fs.close(b,function(){if(S)return i(!1);s.fs.chmod(e,r||438,function(){i(!0)})})})};s.fs.open(e,"w",438,function(b,S){b?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 b=g.length;if(!b)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){--b||u();return}if(r.push(j.normalize(m)+(p.isDirectory()?n.sep:"")),!p.isDirectory()){--b||u();return}n.fs.realpath(m,function(h,E){if(h)return u(h);if(l.has(E)){--b||u();return}l.add(E),o(m,l,function(c){if(c)return u(c);--b||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=Ki;$.crcTable=xn});var _n=F((Ta,An)=>{var Yi=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=Yi.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((wa,vn)=>{vn.exports={efs:!0,encode:e=>Buffer.from(e,"utf8"),decode:e=>e.toString("utf8")}});var Ie=F((Pa,Pe)=>{Pe.exports=kn();Pe.exports.Constants=At();Pe.exports.Errors=Ge();Pe.exports.FileAttr=_n();Pe.exports.decoder=Fn()});var Ln=F((Ia,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,b=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,E=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 E(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 b},set inAttr(c){b=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),b=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(b,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:b,attr:S,offset:m,centralHeaderSize:c(I.CENHDR+l+u+f)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Dn=F((xa,Nn)=>{var Y=Ie(),C=Y.Constants;Nn.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 vt=F(_t=>{_t.EntryHeader=Ln();_t.MainHeader=Dn()});var $n=F((ka,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((Aa,Mn)=>{var Ji=+(process?.versions?.node??"").split(".")[0]||0;Mn.exports=function(e,t){var n=require("zlib");let r=Ji>=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((_a,zn)=>{"use strict";var{randomFillSync:jn}=require("crypto"),Xi=Ge(),Qi=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)=>Qi[(e^t)&255]^e>>>8,De=()=>typeof jn=="function"?jn(Buffer.alloc(12)):De.node();De.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:De};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 eo(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 to(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 no(e,t,n){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=eo(n),i=r(e.slice(0,12)),s=(t.flags&8)===8?t.timeHighByte:t.crc>>>24;if(i[11]!==s)throw Xi.WRONG_PASSWORD();return r(e.slice(12))}function ro(e){Buffer.isBuffer(e)&&e.length>=12?Ze.genSalt=function(){return e.slice(0,12)}:e==="node"?Ze.genSalt=De.node:Ze.genSalt=De}function io(e,t,n,r=!1){e==null&&(e=Buffer.alloc(0)),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let i=to(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:no,encrypt:io,_salter:ro}});var Wn=F(Ye=>{Ye.Deflater=$n();Ye.Inflater=Bn();Ye.ZipCrypto=Hn()});var Rt=F((Fa,qn)=>{var N=Ie(),oo=vt(),K=N.Constants,Ft=Wn();qn.exports=function(e,t){var n=new oo.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:N.decoder;u=g.hasOwnProperty("efs")?g.efs:!1;function b(){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 N.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),N.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var T=b();if(T.length===0)return c&&y&&y(T),T;if(n.encrypted){if(typeof w!="string"&&!Buffer.isBuffer(w))throw N.Errors.INVALID_PASS_PARAM();T=Ft.ZipCrypto.decrypt(T,n,w)}var P;switch(n.method){case N.Constants.STORED:if(P=Buffer.alloc(T.length),T.copy(P),S(P))return c&&y&&y(P),P;throw c&&y&&y(P,N.Errors.BAD_CRC()),N.Errors.BAD_CRC();case N.Constants.DEFLATED:var x=new Ft.Inflater(T,n.size);if(c)x.inflateAsync(function(v){y&&(S(v)?y(v):y(v,N.Errors.BAD_CRC()))});else{if(P=x.inflate(),!S(P))throw N.Errors.BAD_CRC(`"${g.decode(r)}"`);return P}break;default:throw c&&y&&y(Buffer.alloc(0),N.Errors.UNKNOWN_METHOD()),N.Errors.UNKNOWN_METHOD()}}function d(c,y){if((!o||!o.length)&&Buffer.isBuffer(t))return c&&y&&y(b()),b();if(o.length&&!s){var w;switch(n.method){case N.Constants.STORED:return n.compressedSize=n.size,w=Buffer.alloc(o.length),o.copy(w),c&&y&&y(w),w;default:case N.Constants.DEFLATED:var T=new Ft.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 N.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&&E(P)}catch{throw N.Errors.EXTRA_FIELD_PARSE_ERROR()}}function E(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=N.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=N.toBuffer(c,g.encode),n.commentLength=i.length,i.length>65535)throw N.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=N.toBuffer(c,N.decoder.encode),!s&&o.length?(n.size=o.length,n.method=N.Constants.DEFLATED,n.crc=N.crc32(c),n.changed=!0):n.method=N.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=N.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((Ra,Zn)=>{var Gn=Rt(),so=vt(),q=Ie();Zn.exports=function(e,t){var n=[],r=Object.create(null),i=Buffer.alloc(0),s=new so.MainHeader,o=!1,a=null;let l=new Set,u=t,{noSort:f,decoder:g}=u;e?m(u.readEntries):o=!0;function b(){let p=new Set;for(let h of Object.keys(r)){let E=h.split("/");if(E.pop(),!!E.length)for(let c=0;c<E.length;c++){let y=E.slice(0,c+1).join("/")+"/";p.add(y)}}for(let h of p)if(!(h in r)){let E=new Gn(u);E.entryName=h,E.attr=16,E.temporary=!0,n.push(E),r[E.entryName]=E,l.add(E)}}function S(){if(o=!0,r=Object.create(null),s.diskEntries>(e.length-s.offset)/q.Constants.CENHDR)throw q.Errors.DISK_ENTRY_TOO_LARGE();n=new Array(s.diskEntries);for(var p=s.offset,h=0;h<n.length;h++){var E=p,c=new Gn(u,e);c.header=e.slice(E,E+=q.Constants.CENHDR),c.entryName=e.slice(E,E+=c.header.fileNameLength),c.header.extraLength&&(c.extra=e.slice(E,E+=c.header.extraLength)),c.header.commentLength&&(c.comment=e.slice(E,E+c.header.commentLength)),p+=c.header.centralHeaderSize,n[h]=c,r[c.entryName]=c}l.clear(),b()}function m(p){var h=e.length-q.Constants.ENDHDR,E=Math.max(0,h-65535),c=E,y=e.length,w=-1,T=0;for(typeof u.trailingSpace=="boolean"&&u.trailingSpace&&(E=0),h;h>=c;h--)if(e[h]===80){if(e.readUInt32LE(h)===q.Constants.ENDSIG){w=h,T=h,y=h+q.Constants.ENDHDR,c=h-q.Constants.END64HDR;continue}if(e.readUInt32LE(h)===q.Constants.END64SIG){c=E;continue}if(e.readUInt32LE(h)===q.Constants.ZIP64SIG){w=h,y=h+q.readBigUInt64LE(e,h+q.Constants.ZIP64SIZE)+q.Constants.ZIP64LEAD;break}}if(w==-1)throw q.Errors.INVALID_FORMAT();s.loadFromBinary(e.slice(w,y)),s.commentLength&&(i=e.slice(T+q.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=q.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 E=r[p];this.getEntryChildren(E,h).map(y=>y.entryName).forEach(this.deleteEntry)},deleteEntry:function(p){o||S();let h=r[p],E=n.indexOf(h);E>=0&&(n.splice(E,1),delete r[p],s.totalEntries=n.length)},getEntryChildren:function(p,h=!0){if(o||S(),typeof p=="object")if(p.isDirectory&&h){let E=[],c=p.entryName;for(let y of n)y.entryName.startsWith(c)&&E.push(y);return E}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=[],E=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,E+=R+L.length,y++}E+=s.mainHeaderSize,s.offset=c,s.totalEntries=y,c=0;let w=Buffer.alloc(E);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,E,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();E&&E(V),L.getCompressedDataAsync(function(W){c&&c(V),L.header.offset=P;let he=L.packLocalHeader(),We=he.length+W.length;P+=We,y.push(he),y.push(W);let Ne=L.packCentralHeader();w.push(Ne),s.size+=Ne.length,T+=We+Ne.length,x++,v(R)})}else{T+=s.mainHeaderSize,s.offset=P,s.totalEntries=x,P=0;let L=Buffer.alloc(T);y.forEach(function(W){W.copy(L,P),P+=W.length}),w.forEach(function(W){W.copy(L,P),P+=W.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 Lt=F((La,Jn)=>{var B=Ie(),M=require("path"),ao=Rt(),co=Kn(),ye=(...e)=>B.findLast(e,t=>typeof t=="boolean"),Yn=(...e)=>B.findLast(e,t=>typeof t=="string"),lo=(...e)=>B.findLast(e,t=>typeof t=="function"),uo={noSort:!1,readEntries:!1,method:B.Constants.NONE,fs:null};Jn.exports=function(e,t){let n=null,r=Object.assign(Object.create(null),uo);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 co(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 b(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(E,c){if(c){d(E,c);return}E&&E.length?d(E.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 E=M.win32.basename(M.win32.normalize(m));d+=p||E;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:E,zipName:c}=m,y=this;i.fs.stat(p,function(w,T){if(w)return d(w,!1);E=E?g(E):"";let P=M.win32.basename(M.win32.normalize(p));if(E+=c||P,T.isFile())i.fs.readFile(p,function(x,v){return x?d(x,!1):(y.addFile(E,v,h,T),setImmediate(d,void 0,!0))});else if(T.isDirectory())return E+=i.sep,y.addFile(E,Buffer.alloc(0),h,T),setImmediate(d,void 0,!0)})},addLocalFolder:function(m,d,p){if(p=b(p),d=d?g(d):"",m=M.normalize(m),i.fs.existsSync(m)){let h=i.findFiles(m),E=this;if(h.length)for(let c of h){let y=M.join(d,S(m,c));p(y)&&E.addLocalFile(c,M.dirname(y))}}else throw B.Errors.FILE_NOT_FOUND(m)},addLocalFolderAsync:function(m,d,p,h){h=b(h),p=p?g(p):"",m=M.normalize(m);var E=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):(E.addFile(p+x,V,"",R),T())}):(E.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:E,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}),E=E?g(E):"",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(E,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,W){if(V||W===!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),(E,c)=>{E&&h(E),c&&p(this)})})},addFile:function(m,d,p,h){m=u(m);let E=f(m),c=E!=null;c||(E=new ao(r),E.entryName=m),E.comment=p||"";let y=typeof h=="object"&&h instanceof i.fs.Stats;y&&(E.header.time=h.mtime);var w=E.isDirectory?16:0;let T=E.isDirectory?16384:32768;return y?T|=4095&h.mode:typeof h=="number"?T|=4095&h:T|=E.isDirectory?493:420,w=(w|T<<16)>>>0,E.attr=w,E.setData(d),c||o.setEntry(E),E},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,E,c){h=ye(!1,h),E=ye(!1,E),p=ye(!0,p),c=Yn(E,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)),W=l(d,V);let he=E?R.header.fileAttr:void 0;i.writeFileTo(W,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=E?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 E=[];o.entries.forEach(function(c){var y=l(m,a(c.entryName));if(c.isDirectory){i.makeDir(y),p&&E.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(E)},extractAllToAsync:function(m,d,p,h){if(h=lo(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 E=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=E(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(W,he){if(he)x(he);else if(!W)x(B.Errors.CANT_EXTRACT_FILE());else{let We=p?v.header.fileAttr:void 0;i.writeFileToAsync(V,W,d,We,function(Ne){if(!Ne)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((E,c)=>{!m&&r.filename&&(m=r.filename),m||c("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(y=>{let w=T=>T?E(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 Gr=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],Ss=[400,700],nn=[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:nn,variable:!0}),A("roboto-mono","Roboto Mono","monospace","roboto-mono","Roboto+Mono",{weights:nn,variable:!0}),A("jetbrains-mono","JetBrains Mono","monospace","jetbrains-mono","JetBrains+Mono",{weights:nn,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:Ss}),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=Ts;me.resolveFontFamily=ws;me.listFontsByCategory=Ps;me.collectFontIdsFromSiteData=Is;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 Ts(e){let t=Me(e);return t?t.fontsourcePackage?t:t.substituteId?yt.DENEB_FONT_BY_ID.get(t.substituteId)??null:null:null}function ws(e){if(!e||!e.trim())return;let t=Me(e);return t?t.cssStack:e.includes(",")?e:`'${e.trim()}', system-ui, sans-serif`}function Ps(){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 Is(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 rn=F(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.formatResponsiveFontSize=Zr;Et.formatFontSize=xs;function Zr(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 xs(e,t){if(!(e==null||e==="")){if(t?.responsive){let n=Zr(e);if(n)return n}return typeof e=="number"?`${e}px`:/^\d+$/.test(e)?`${e}px`:e}}});var Yr=F(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.buildGoogleFontsStylesheetUrl=As;var Kr=ht(),Cs=ke();function ks(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 As(e){let t=[],n=new Set;for(let r of e){let i=Kr.DENEB_FONT_BY_ID.get(r)??(0,Cs.lookupFontDefinition)(r);if(!i||!i.googleFonts||!i.googleQuery)continue;let s=i.substituteId&&!i.fontsourcePackage?i.substituteId:i.id,o=Kr.DENEB_FONT_BY_ID.get(s)??i;if(n.has(o.id))continue;n.add(o.id);let a=ks(o);a&&t.push(a)}return t.length===0?null:`https://fonts.googleapis.com/css2?${t.join("&")}&display=swap`}});var Jr=F(re=>{"use strict";var _s=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)&&_s(t,e,n)};Object.defineProperty(re,"__esModule",{value:!0});Be(Gr(),re);Be(ht(),re);Be(ke(),re);Be(rn(),re);Be(Yr(),re)});var Qr=F(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0})});var ei=F(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.DENEB_STYLE_PATCH_MESSAGE=se.STYLE_PATCH_MESSAGE=void 0;se.isStylePatchPayload=vs;se.STYLE_PATCH_MESSAGE="FIVORA_PREVIEW_STYLE_PATCH";se.DENEB_STYLE_PATCH_MESSAGE="DENEB_PREVIEW_STYLE_PATCH";function vs(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 sn=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=ti;O.buildStyleFallbackSelectors=Fs;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 ti(e){return`[${O.STYLE_TARGET_ATTRIBUTE}="${ae(e)}"]`}function Fs(e,t){let n=[ti(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=Ns;Ae.resolveThemeToken=Ds;var Rs=ke();Object.defineProperty(Ae,"resolveFontFamily",{enumerable:!0,get:function(){return Rs.resolveFontFamily}});var Ls={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 Ns(e){if(e)return Ls[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 cn=F(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.formatUnit=D;ce.textStyleToCssVariables=ni;ce.cardStyleToCssVariables=ri;ce.buttonStyleToCssVariables=ii;ce.gridStyleToCssVariables=oi;ce.sectionStyleToCssVariables=si;ce.styleToCssVariables=Ms;var Os=rn(),$s=ke(),_e=bt();function D(e){if(!(e===void 0||e===""||e===null))return typeof e=="number"?`${e}px`:/^\d+$/.test(e)?`${e}px`:e}function an(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`]=D(r)),i!==void 0&&(n[`${t}-margin-bottom`]=D(i)),s!==void 0&&(n[`${t}-margin-left`]=D(s)),o!==void 0&&(n[`${t}-margin-right`]=D(o)),n}function ni(e){let t={...an(e,"--deneb")};return e.fontFamily&&(t["--deneb-font-family"]=(0,$s.resolveFontFamily)(e.fontFamily)),e.fontSize!==void 0&&(t["--deneb-font-size"]=(0,Os.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 ri(e){let t={...an(e,"--deneb-card")};return e.width!==void 0&&(t["--deneb-card-width"]=D(e.width)),e.minWidth!==void 0&&(t["--deneb-card-min-width"]=D(e.minWidth)),e.maxWidth!==void 0&&(t["--deneb-card-max-width"]=D(e.maxWidth)),e.height!==void 0&&(t["--deneb-card-height"]=D(e.height)),e.aspectRatio&&(t["--deneb-card-aspect-ratio"]=e.aspectRatio),e.paddingTop!==void 0&&(t["--deneb-card-pt"]=D(e.paddingTop)),e.paddingBottom!==void 0&&(t["--deneb-card-pb"]=D(e.paddingBottom)),e.paddingLeft!==void 0&&(t["--deneb-card-pl"]=D(e.paddingLeft)),e.paddingRight!==void 0&&(t["--deneb-card-pr"]=D(e.paddingRight)),e.borderRadius!==void 0&&(t["--deneb-card-radius"]=D(e.borderRadius)),e.borderWidth!==void 0&&(t["--deneb-card-border-w"]=D(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"]=D(e.backdropBlur)),e.gap!==void 0&&(t["--deneb-card-gap"]=D(e.gap)),t}function ii(e){let t={...an(e,"--deneb-btn")};return e.borderRadius!==void 0&&(t["--deneb-btn-radius"]=D(e.borderRadius)),e.paddingX!==void 0&&(t["--deneb-btn-px"]=D(e.paddingX)),e.paddingY!==void 0&&(t["--deneb-btn-py"]=D(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 oi(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"]=D(e.gapX)),e.gapY!==void 0&&(t["--deneb-grid-gap-y"]=D(e.gapY)),e.equalHeight!==void 0&&(t["--deneb-grid-equal-height"]=e.equalHeight?"stretch":"start"),t}function si(e){let t={};return e.paddingTop!==void 0&&(t["--deneb-section-pt"]=D(e.paddingTop)),e.paddingBottom!==void 0&&(t["--deneb-section-pb"]=D(e.paddingBottom)),e.paddingX!==void 0&&(t["--deneb-section-px"]=D(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 Ms(e,t){switch(e){case"text":return ni(t);case"card":return ri(t);case"button":return ii(t);case"grid":return oi(t);case"section":return si(t);default:return{}}}});var dn=F(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.isPlainObject=ln;St.deepMerge=ai;function ln(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ai(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))ln(o)&&ln(i[s])?i[s]=ai(i[s],o,n+1,r):i[s]=o;return i}});var ui=F(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.getLiveStyleCache=Vs;we.applyCssVariablesToElement=li;we.findStyleTargetElement=Us;we.patchElementStyle=di;we.patchStyleByPath=zs;var je=sn(),Bs=dn(),le=cn(),js=ke(),ci=bt(),un=new Map;function Vs(){return un}function li(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}function Us(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 di(e,t,n){let i=(e.getAttribute(je.STYLE_TARGET_ATTRIBUTE)??"")||e.getAttribute("data-preview-field-path")||"",s=i?un.get(i)??{}:{},o=(0,Bs.deepMerge)(s,n);i&&un.set(i,o);let a=(0,le.styleToCssVariables)(t,o);if(li(e,a),t==="text"){if(o.color){let l=(0,ci.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,js.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,ci.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 zs(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=>di(o,t,n)),r=!0)}return r}});var fi=F(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.isValidStyleKind=Ws;Ve.validateStyleTree=qs;Ve.collectStyleTargetsFromHtml=Gs;var Hs=new Set(["text","card","button","grid","section"]);function Ws(e){return typeof e=="string"&&Hs.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 Gs(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 mi=F(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0})});var fn=F(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.isDarkColor=gi;ve.getAutoContrastTextColor=Zs;ve.toHexColor=Ks;ve.normalizeHexColor=Ys;function gi(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 Zs(e,t="#ffffff",n="#0f172a"){return gi(e)?t:n}function Ks(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 Ys(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 hi=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 yi=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 Si=F(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.parseVisualCustomization=Ei;Ue.customizationToTheme=bi;Ue.mergeVisualCustomizationIntoTheme=Js;function de(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ei(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 bi(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 Js(e,t){let n=Ei(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??{},...bi(n)}).filter(([,i])=>i!==void 0)):e??null}});var Ti=F(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.generateThemeVariables=Xs;var pn=fn();function Xs(e){let t={};if(e){for(let[h,E]of Object.entries(e))if(typeof E=="string"||typeof E=="number"){let c=`--${h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;t[c]=String(E)}}let n=(0,pn.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",b=e?.buttonBackgroundColor||u,S=(0,pn.getAutoContrastTextColor)(b),m=e?.buttonTextColor||S,d=n?"rgba(255, 255, 255, 0.08)":f&&!(0,pn.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":b,"--button-text":m,"--button-primary-bg":b,"--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 wi=F(te=>{"use strict";var Qs=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)&&Qs(t,e,n)};Object.defineProperty(te,"__esModule",{value:!0});Re(mi(),te);Re(fn(),te);Re(hi(),te);Re(yi(),te);Re(Si(),te);Re(Ti(),te)});var Pi=F(H=>{"use strict";var ea=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)&&ea(t,e,n)};Object.defineProperty(H,"__esModule",{value:!0});oe(Jr(),H);oe(Qr(),H);oe(ei(),H);oe(sn(),H);oe(cn(),H);oe(ui(),H);oe(bt(),H);oe(dn(),H);oe(fi(),H);oe(wi(),H)});var ha={};Hi(ha,{runTemplatePreflight:()=>Di});module.exports=Wi(ha);var Fi=require("node:child_process"),k=require("node:fs/promises"),Ri=require("node:os"),_=require("node:path"),En=kt(Lt());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 fo={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:po(),seo:null}}function po(){let e={};for(let t of Xn){e[t.key]=[];for(let n of fo[t.key]??[])e[n]||(e[n]=[])}return e}var er=kt(Lt()),xe={maxEntries:2e3,maxEntryUncompressedBytes:25*1024*1024,maxTotalUncompressedBytes:200*1024*1024,maxCompressionRatio:100},mo=new Set([".cache",".git",".next",".npm",".pnpm-store",".turbo","__macosx","node_modules"]),go=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),ho(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 ho(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=>mo.has(S)),s=n[0]===".yarn"&&n[1]==="cache",o=n.some(S=>go.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 yo={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"}},Eo=new Set(["text","textarea","email","tel","url","image","number","boolean","select"]),bo={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=>To(i)).filter(i=>!!i);return r.length===0?null:So({version:typeof t.version=="number"&&Number.isFinite(t.version)?t.version:1,sections:r})}function So(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])=>Po(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 Nt(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 Ot(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(b=>b!==l.path&&nt(b,l.path))),g=Nt(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=>Nt(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?Ot(e,bo):null}function To(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:Bt(t.maxLength),recommendedWidth:pe(t.recommendedWidth),recommendedHeight:pe(t.recommendedHeight),pageKey:z(t.pageKey)||void 0,...$t(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"?Mt(t.options):void 0}}function Nt(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=>wo(t)).filter(t=>!!t):[]}function wo(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:Bt(t.maxLength),recommendedWidth:pe(t.recommendedWidth),recommendedHeight:pe(t.recommendedHeight),...$t(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"?Mt(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:Bt(t.maxLength),recommendedWidth:pe(t.recommendedWidth),recommendedHeight:pe(t.recommendedHeight),...$t(t.sharedFieldKey),options:r==="select"?Mt(t.options):void 0}}function $t(e){return typeof e=="string"&&e.trim()?{sharedFieldKey:e.trim()}:{}}function Mt(e){if(!Array.isArray(e))return;let t=e.map(n=>z(n)).filter(n=>!!n);return t.length>0?t:void 0}function Bt(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"&&Eo.has(e)?e:null}function Po(e,t,n){let r=yo[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)?Io(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)?xo(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 Io(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 xo(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?Co(i,s):i}),...n.values()]}function Co(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=ko(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 ko(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 Ao=["primary","secondary","accent","background","text","surface","surfaceAlt","heading","mutedText","border","headerBackground","footerBackground","cardBackground","buttonBackground","buttonText"],_o=["headingFont","bodyFont","baseSize","headingScale","bodyLineHeight","headingLineHeight","headingWeight","bodyWeight","letterSpacing"],vo=["heroMinHeight","sectionPadding","contentMaxWidth","containerPadding","sectionGap","elementGap","gridGap"],Fo=["textAlign","contentAlign","heroTextAlign","cardTextAlign","gridColumns"],Ro=["cardWidth","cardMinHeight","cardPadding","cardRadius","cardBorderWidth","cardShadow","buttonPadding","buttonRadius","buttonShadow","imageRadius","headerHeight"],Lo=["backgroundColor","textColor","headingColor","minHeight","padding","contentMaxWidth","gap","textAlign","contentAlign","cardBackgroundColor","cardWidth","cardMinHeight","cardRadius","gridColumns"],No=["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 Oo(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 $o(e){return/^[a-zA-Z0-9_-]{1,64}$/.test(e)}function Mo(e){return/^[a-zA-Z0-9_.:\[\]-]{1,180}$/.test(e)}function Bo(){return{version:1}}function jo(e){if(!ie(e))return Bo();let t=be(e.colors,Ao),n=Oo(e.colorReplacements),r=be(e.typography,_o),i=be(e.spacing,vo),s=be(e.layout,Fo),o=be(e.components,Ro),a={};if(ie(e.sections))for(let[u,f]of Object.entries(e.sections)){if(!$o(u)||!ie(f))continue;let b={...be(f,Lo)??{}};typeof f.visible=="boolean"&&(b.visible=f.visible),Object.keys(b).length>0&&(a[u]=b)}let l={};if(ie(e.elementStyles))for(let[u,f]of Object.entries(e.elementStyles).slice(0,256)){if(!Mo(u)||!ie(f))continue;let g=be(f,No);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=jo(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 Vo=e=>new Error(e),Uo=new Set(["npm install","npm ci","pnpm install","pnpm install --frozen-lockfile","yarn install","yarn install --frozen-lockfile"]),zo=new Set(["npm run build","pnpm run build","yarn build","yarn run build"]);function Tr(e,t=Vo){let n=b=>{throw t(b)};(!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=Ho(r.visualEditing,i,t),o=sr(r.editorSchema),a=br(r),l=Array.isArray(r.colorPalette)?r.colorPalette.filter(b=>!!b&&typeof b=="object").flatMap(b=>{let S=typeof b.color=="string"?b.color.trim().toLowerCase():"";if(!/^#[0-9a-f]{6}$/.test(S))return[];let m=typeof b.usageCount=="number"&&Number.isFinite(b.usageCount)?Math.max(1,Math.floor(b.usageCount)):1;return[{color:S,usageCount:m}]}).slice(0,40):[],u=rt(o);if(u.length>0){let b=u.slice(0,5).map(S=>`"${S.path}"`).join(", ");n(`Template editorSchema declares the same editable path in more than one place: ${b}. 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,Uo,"installCommand",n),g=Sr(r.buildCommand,zo,"buildCommand",n);return{framework:"nextjs-static-export",version:i,siteDataFile:r.siteDataFile.trim(),editorSchema:o,pages:Array.isArray(r.pages)?r.pages.filter(b=>!!b&&typeof b=="object").map(b=>{let S=typeof b.id=="string"&&b.id.trim()?b.id.trim():null,m=typeof b.label=="string"&&b.label.trim()?b.label.trim():null;return!S||!m?n("Each template manifest page must include id and label."):{id:S,label:m,route:typeof b.route=="string"&&b.route.trim()?b.route.trim():void 0,required:typeof b.required=="boolean"?b.required:!1,description:typeof b.description=="string"?b.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 Ho(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 Wo={"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+|\*)\])*)*$`),Go=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Zo=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",jt=`${_r}READY`,Ko=ct;function Wt(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))Zt(i,r,n);for(let r of t?.sections??[])Kt(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 Jt(e,t){let n=Lr(e??{});for(let r of t?.sections??[])Xo(n,r.path,r);return n}function vr(e,t){let n=structuredClone(e??{});for(let r of t?.sections??[])Yo(n,r.path,r);return Gt(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:Wo[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=Wt(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."),hs(e.editorSchema,n),ys(e.editorSchema,n),ns(e.editorSchema,n,e.pages),rs(e.editorSchema,e.contentDefaults,n),os(e.artifacts,n),ss(e.artifacts,n),as(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),b=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),E=Nr(e.visualEditing?.controlOnlyPaths??[],i,n);Ut({label:"editable field",expectedPatterns:i.fieldPatterns,concretePaths:i.concreteFields,htmlMarkerPaths:g,sourceMarkerPaths:d,controlOnlyPaths:E,findings:n}),Ut({label:"editable list",expectedPatterns:i.listPatterns,concretePaths:i.concreteLists,htmlMarkerPaths:b,sourceMarkerPaths:p,controlOnlyPaths:[],findings:n}),Ut({label:"editable list item",expectedPatterns:i.itemPatterns,concretePaths:i.concreteItems,htmlMarkerPaths:S,sourceMarkerPaths:h,controlOnlyPaths:[],findings:n}),zt("field",a,i.fieldPatterns,i.concreteFields,n),zt("list",l,i.listPatterns,i.concreteLists,n),zt("item",u,i.itemPatterns,i.concreteItems,n),Dr(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:E,findings:n});let c=cs(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=Wt(e.contentDefaults,e.editorSchema),i=Jt(e.contentDefaults,e.editorSchema),s=Wt(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),b=J(f.markers,"list",t),S=J(f.markers,"item",t),m=Nr(e.visualEditing?.controlOnlyPaths??[],r,t);Vt({markerPaths:g,expectedPaths:s.concreteFields,knownPatterns:r.fieldPatterns,attribute:"field",findings:t}),Vt({markerPaths:b,expectedPaths:s.concreteLists,knownPatterns:r.listPatterns,attribute:"list",findings:t}),Vt({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)b.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 Dr(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 Vt(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 Yo(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 Gt(e,t){return Array.isArray(e)?e.map((n,r)=>Gt(n,`${t}[${r}]`)):Q(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>{let i=X(t,n);return[n,Gt(r,i)]})):typeof e=="string"?e.trim()?e:Jo(t):typeof e=="number"?Number.isFinite(e)&&e!==0?e:1:typeof e=="boolean"?!0:e??lt(t)}function Jo(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 Xo(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);Xt(i,s,n)}function Xt(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},()=>Qo(n));return}if(n.type==="object"){let r=Q(e[t])?e[t]:{};e[t]=r;for(let i of n.fields??[])Xt(r,i.key,i);return}e[t]=n.type==="number"?0:n.type==="boolean"?!1:""}function Qo(e){if(e.itemField)return e.itemField.type==="number"?0:e.itemField.type==="boolean"?!1:"";let t={};for(let n of e.fields??[])Xt(t,n.key,n);return t}function Zt(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)?Zt(i,o,n):(n.fieldPatterns.add(Z(o)),n.concreteFields.add(o))});return}if(Q(e)){for(let[r,i]of Object.entries(e))Zt(i,X(t,r),n);return}n.fieldPatterns.add(Z(t)),n.concreteFields.add(t)}function Kt(e,t,n){if(t.type==="object"){for(let r of t.fields??[])Kt(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??[])Kt(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 Nr(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=>Yt(s,a))){n.push(`controlOnlyPaths contains unknown editable field path "${s}".`);continue}r.push(s)}return G(r)}function Ut(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-${Ht(e.label)}="${t}" for ${e.label}.`);continue}e.sourceMarkerPaths.some(r=>Es(r,t))||e.findings.push(`Source is missing dynamic data-preview-${Ht(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-${Ht(e.label)}="${t}" for concrete ${e.label}.`)}function zt(e,t,n,r,i){for(let s of t)n.some(a=>Yt(s,a))||r.some(a=>Yt(s,a))||i.push(`data-preview-${e}-path references unknown path "${s}".`)}function Dr(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=en(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 b=u.get(g);b?i.push(`Manifest pages "${b}" and "${f.id}" use duplicate route "${g}".`):u.set(g,f.id);let S=s.filter(p=>tn(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(b=>es(o,b.canonicalPath)).sort((b,S)=>S.canonicalPath.length-b.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=en(l.route)??(e.manifestVersion<2?Mr(l.id):null);!u||!e.markers.some(b=>b.kind===i&&b.artifactKind==="html"&&$e(b.value)===o)||e.markers.some(b=>b.kind===i&&b.artifactKind==="html"&&$e(b.value)===o&&tn(b.filePath,u))||e.findings.push(`Page-owned ${kr(i)} "${o}" from editorSchema section "${a.section.path}" must render data-preview-${ts(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 es(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 ts(e){return e==="field"?"field-path":e==="list"?"list-path":"item-path"}function ns(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 rs(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 b=Q(g)?g:{};for(let S of o.fields??[])i(X(`${s}[${f}]`,S.key),S,b[S.key])}};for(let s of e?.sections??[])r(s.path,s),i(s.path,s,is(t??{},s.path))}function Se(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0?e:null}function is(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 os(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 ss(e,t){let n=e.filter(S=>S.kind==="source"),r=n.map(S=>S.content).join(`
2
+ var Bi=Object.create;var qe=Object.defineProperty;var ji=Object.getOwnPropertyDescriptor;var Vi=Object.getOwnPropertyNames;var Ui=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var F=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Hi=(e,t)=>{for(var n in t)qe(e,n,{get:t[n],enumerable:!0})},bn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Vi(t))!zi.call(e,i)&&i!==n&&qe(e,i,{get:()=>t[i],enumerable:!(r=ji(t,i))||r.enumerable});return e};var kt=(e,t,n)=>(n=e!=null?Bi(Ui(e)):{},bn(t||!e||!e.__esModule?qe(n,"default",{value:e,enumerable:!0}):n,e)),Wi=e=>bn(qe({},"__esModule",{value:!0}),e);var At=F((Ea,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((Sa,Cn)=>{var Gi=require("fs"),j=require("path"),Pn=At(),Zi=Ge(),Ki=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=Gi,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 Zi.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(b){s.fs.write(b,t,0,t.length,0,function(S){s.fs.close(b,function(){if(S)return i(!1);s.fs.chmod(e,r||438,function(){i(!0)})})})};s.fs.open(e,"w",438,function(b,S){b?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 b=g.length;if(!b)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){--b||u();return}if(r.push(j.normalize(m)+(p.isDirectory()?n.sep:"")),!p.isDirectory()){--b||u();return}n.fs.realpath(m,function(h,E){if(h)return u(h);if(l.has(E)){--b||u();return}l.add(E),o(m,l,function(c){if(c)return u(c);--b||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=Ki;$.crcTable=xn});var _n=F((Ta,An)=>{var Yi=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=Yi.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((wa,vn)=>{vn.exports={efs:!0,encode:e=>Buffer.from(e,"utf8"),decode:e=>e.toString("utf8")}});var Ie=F((Pa,Pe)=>{Pe.exports=kn();Pe.exports.Constants=At();Pe.exports.Errors=Ge();Pe.exports.FileAttr=_n();Pe.exports.decoder=Fn()});var Ln=F((Ia,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,b=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,E=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 E(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 b},set inAttr(c){b=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),b=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(b,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:b,attr:S,offset:m,centralHeaderSize:c(I.CENHDR+l+u+f)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Dn=F((xa,Nn)=>{var Y=Ie(),C=Y.Constants;Nn.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 vt=F(_t=>{_t.EntryHeader=Ln();_t.MainHeader=Dn()});var $n=F((ka,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((Aa,Mn)=>{var Ji=+(process?.versions?.node??"").split(".")[0]||0;Mn.exports=function(e,t){var n=require("zlib");let r=Ji>=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((_a,zn)=>{"use strict";var{randomFillSync:jn}=require("crypto"),Xi=Ge(),Qi=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)=>Qi[(e^t)&255]^e>>>8,De=()=>typeof jn=="function"?jn(Buffer.alloc(12)):De.node();De.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:De};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 eo(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 to(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 no(e,t,n){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=eo(n),i=r(e.slice(0,12)),s=(t.flags&8)===8?t.timeHighByte:t.crc>>>24;if(i[11]!==s)throw Xi.WRONG_PASSWORD();return r(e.slice(12))}function ro(e){Buffer.isBuffer(e)&&e.length>=12?Ze.genSalt=function(){return e.slice(0,12)}:e==="node"?Ze.genSalt=De.node:Ze.genSalt=De}function io(e,t,n,r=!1){e==null&&(e=Buffer.alloc(0)),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let i=to(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:no,encrypt:io,_salter:ro}});var Wn=F(Ye=>{Ye.Deflater=$n();Ye.Inflater=Bn();Ye.ZipCrypto=Hn()});var Rt=F((Fa,qn)=>{var N=Ie(),oo=vt(),K=N.Constants,Ft=Wn();qn.exports=function(e,t){var n=new oo.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:N.decoder;u=g.hasOwnProperty("efs")?g.efs:!1;function b(){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 N.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),N.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var T=b();if(T.length===0)return c&&y&&y(T),T;if(n.encrypted){if(typeof w!="string"&&!Buffer.isBuffer(w))throw N.Errors.INVALID_PASS_PARAM();T=Ft.ZipCrypto.decrypt(T,n,w)}var P;switch(n.method){case N.Constants.STORED:if(P=Buffer.alloc(T.length),T.copy(P),S(P))return c&&y&&y(P),P;throw c&&y&&y(P,N.Errors.BAD_CRC()),N.Errors.BAD_CRC();case N.Constants.DEFLATED:var x=new Ft.Inflater(T,n.size);if(c)x.inflateAsync(function(v){y&&(S(v)?y(v):y(v,N.Errors.BAD_CRC()))});else{if(P=x.inflate(),!S(P))throw N.Errors.BAD_CRC(`"${g.decode(r)}"`);return P}break;default:throw c&&y&&y(Buffer.alloc(0),N.Errors.UNKNOWN_METHOD()),N.Errors.UNKNOWN_METHOD()}}function d(c,y){if((!o||!o.length)&&Buffer.isBuffer(t))return c&&y&&y(b()),b();if(o.length&&!s){var w;switch(n.method){case N.Constants.STORED:return n.compressedSize=n.size,w=Buffer.alloc(o.length),o.copy(w),c&&y&&y(w),w;default:case N.Constants.DEFLATED:var T=new Ft.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 N.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&&E(P)}catch{throw N.Errors.EXTRA_FIELD_PARSE_ERROR()}}function E(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=N.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=N.toBuffer(c,g.encode),n.commentLength=i.length,i.length>65535)throw N.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=N.toBuffer(c,N.decoder.encode),!s&&o.length?(n.size=o.length,n.method=N.Constants.DEFLATED,n.crc=N.crc32(c),n.changed=!0):n.method=N.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=N.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((Ra,Zn)=>{var Gn=Rt(),so=vt(),q=Ie();Zn.exports=function(e,t){var n=[],r=Object.create(null),i=Buffer.alloc(0),s=new so.MainHeader,o=!1,a=null;let l=new Set,u=t,{noSort:f,decoder:g}=u;e?m(u.readEntries):o=!0;function b(){let p=new Set;for(let h of Object.keys(r)){let E=h.split("/");if(E.pop(),!!E.length)for(let c=0;c<E.length;c++){let y=E.slice(0,c+1).join("/")+"/";p.add(y)}}for(let h of p)if(!(h in r)){let E=new Gn(u);E.entryName=h,E.attr=16,E.temporary=!0,n.push(E),r[E.entryName]=E,l.add(E)}}function S(){if(o=!0,r=Object.create(null),s.diskEntries>(e.length-s.offset)/q.Constants.CENHDR)throw q.Errors.DISK_ENTRY_TOO_LARGE();n=new Array(s.diskEntries);for(var p=s.offset,h=0;h<n.length;h++){var E=p,c=new Gn(u,e);c.header=e.slice(E,E+=q.Constants.CENHDR),c.entryName=e.slice(E,E+=c.header.fileNameLength),c.header.extraLength&&(c.extra=e.slice(E,E+=c.header.extraLength)),c.header.commentLength&&(c.comment=e.slice(E,E+c.header.commentLength)),p+=c.header.centralHeaderSize,n[h]=c,r[c.entryName]=c}l.clear(),b()}function m(p){var h=e.length-q.Constants.ENDHDR,E=Math.max(0,h-65535),c=E,y=e.length,w=-1,T=0;for(typeof u.trailingSpace=="boolean"&&u.trailingSpace&&(E=0),h;h>=c;h--)if(e[h]===80){if(e.readUInt32LE(h)===q.Constants.ENDSIG){w=h,T=h,y=h+q.Constants.ENDHDR,c=h-q.Constants.END64HDR;continue}if(e.readUInt32LE(h)===q.Constants.END64SIG){c=E;continue}if(e.readUInt32LE(h)===q.Constants.ZIP64SIG){w=h,y=h+q.readBigUInt64LE(e,h+q.Constants.ZIP64SIZE)+q.Constants.ZIP64LEAD;break}}if(w==-1)throw q.Errors.INVALID_FORMAT();s.loadFromBinary(e.slice(w,y)),s.commentLength&&(i=e.slice(T+q.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=q.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 E=r[p];this.getEntryChildren(E,h).map(y=>y.entryName).forEach(this.deleteEntry)},deleteEntry:function(p){o||S();let h=r[p],E=n.indexOf(h);E>=0&&(n.splice(E,1),delete r[p],s.totalEntries=n.length)},getEntryChildren:function(p,h=!0){if(o||S(),typeof p=="object")if(p.isDirectory&&h){let E=[],c=p.entryName;for(let y of n)y.entryName.startsWith(c)&&E.push(y);return E}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=[],E=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,E+=R+L.length,y++}E+=s.mainHeaderSize,s.offset=c,s.totalEntries=y,c=0;let w=Buffer.alloc(E);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,E,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();E&&E(V),L.getCompressedDataAsync(function(W){c&&c(V),L.header.offset=P;let he=L.packLocalHeader(),We=he.length+W.length;P+=We,y.push(he),y.push(W);let Ne=L.packCentralHeader();w.push(Ne),s.size+=Ne.length,T+=We+Ne.length,x++,v(R)})}else{T+=s.mainHeaderSize,s.offset=P,s.totalEntries=x,P=0;let L=Buffer.alloc(T);y.forEach(function(W){W.copy(L,P),P+=W.length}),w.forEach(function(W){W.copy(L,P),P+=W.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 Lt=F((La,Jn)=>{var B=Ie(),M=require("path"),ao=Rt(),co=Kn(),ye=(...e)=>B.findLast(e,t=>typeof t=="boolean"),Yn=(...e)=>B.findLast(e,t=>typeof t=="string"),lo=(...e)=>B.findLast(e,t=>typeof t=="function"),uo={noSort:!1,readEntries:!1,method:B.Constants.NONE,fs:null};Jn.exports=function(e,t){let n=null,r=Object.assign(Object.create(null),uo);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 co(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 b(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(E,c){if(c){d(E,c);return}E&&E.length?d(E.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 E=M.win32.basename(M.win32.normalize(m));d+=p||E;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:E,zipName:c}=m,y=this;i.fs.stat(p,function(w,T){if(w)return d(w,!1);E=E?g(E):"";let P=M.win32.basename(M.win32.normalize(p));if(E+=c||P,T.isFile())i.fs.readFile(p,function(x,v){return x?d(x,!1):(y.addFile(E,v,h,T),setImmediate(d,void 0,!0))});else if(T.isDirectory())return E+=i.sep,y.addFile(E,Buffer.alloc(0),h,T),setImmediate(d,void 0,!0)})},addLocalFolder:function(m,d,p){if(p=b(p),d=d?g(d):"",m=M.normalize(m),i.fs.existsSync(m)){let h=i.findFiles(m),E=this;if(h.length)for(let c of h){let y=M.join(d,S(m,c));p(y)&&E.addLocalFile(c,M.dirname(y))}}else throw B.Errors.FILE_NOT_FOUND(m)},addLocalFolderAsync:function(m,d,p,h){h=b(h),p=p?g(p):"",m=M.normalize(m);var E=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):(E.addFile(p+x,V,"",R),T())}):(E.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:E,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}),E=E?g(E):"",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(E,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,W){if(V||W===!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),(E,c)=>{E&&h(E),c&&p(this)})})},addFile:function(m,d,p,h){m=u(m);let E=f(m),c=E!=null;c||(E=new ao(r),E.entryName=m),E.comment=p||"";let y=typeof h=="object"&&h instanceof i.fs.Stats;y&&(E.header.time=h.mtime);var w=E.isDirectory?16:0;let T=E.isDirectory?16384:32768;return y?T|=4095&h.mode:typeof h=="number"?T|=4095&h:T|=E.isDirectory?493:420,w=(w|T<<16)>>>0,E.attr=w,E.setData(d),c||o.setEntry(E),E},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,E,c){h=ye(!1,h),E=ye(!1,E),p=ye(!0,p),c=Yn(E,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)),W=l(d,V);let he=E?R.header.fileAttr:void 0;i.writeFileTo(W,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=E?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 E=[];o.entries.forEach(function(c){var y=l(m,a(c.entryName));if(c.isDirectory){i.makeDir(y),p&&E.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(E)},extractAllToAsync:function(m,d,p,h){if(h=lo(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 E=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=E(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(W,he){if(he)x(he);else if(!W)x(B.Errors.CANT_EXTRACT_FILE());else{let We=p?v.header.fileAttr:void 0;i.writeFileToAsync(V,W,d,We,function(Ne){if(!Ne)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((E,c)=>{!m&&r.filename&&(m=r.filename),m||c("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(y=>{let w=T=>T?E(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 Gr=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],Ss=[400,700],nn=[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:nn,variable:!0}),A("roboto-mono","Roboto Mono","monospace","roboto-mono","Roboto+Mono",{weights:nn,variable:!0}),A("jetbrains-mono","JetBrains Mono","monospace","jetbrains-mono","JetBrains+Mono",{weights:nn,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:Ss}),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=Ts;me.resolveFontFamily=ws;me.listFontsByCategory=Ps;me.collectFontIdsFromSiteData=Is;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 Ts(e){let t=Me(e);return t?t.fontsourcePackage?t:t.substituteId?yt.DENEB_FONT_BY_ID.get(t.substituteId)??null:null:null}function ws(e){if(!e||!e.trim())return;let t=Me(e);return t?t.cssStack:e.includes(",")?e:`'${e.trim()}', system-ui, sans-serif`}function Ps(){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 Is(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 rn=F(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.formatResponsiveFontSize=Zr;Et.formatFontSize=xs;function Zr(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 xs(e,t){if(!(e==null||e==="")){if(t?.responsive){let n=Zr(e);if(n)return n}return typeof e=="number"?`${e}px`:/^\d+$/.test(e)?`${e}px`:e}}});var Yr=F(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.buildGoogleFontsStylesheetUrl=As;var Kr=ht(),Cs=ke();function ks(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 As(e){let t=[],n=new Set;for(let r of e){let i=Kr.DENEB_FONT_BY_ID.get(r)??(0,Cs.lookupFontDefinition)(r);if(!i||!i.googleFonts||!i.googleQuery)continue;let s=i.substituteId&&!i.fontsourcePackage?i.substituteId:i.id,o=Kr.DENEB_FONT_BY_ID.get(s)??i;if(n.has(o.id))continue;n.add(o.id);let a=ks(o);a&&t.push(a)}return t.length===0?null:`https://fonts.googleapis.com/css2?${t.join("&")}&display=swap`}});var Jr=F(re=>{"use strict";var _s=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)&&_s(t,e,n)};Object.defineProperty(re,"__esModule",{value:!0});Be(Gr(),re);Be(ht(),re);Be(ke(),re);Be(rn(),re);Be(Yr(),re)});var Qr=F(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0})});var ei=F(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.DENEB_STYLE_PATCH_MESSAGE=se.STYLE_PATCH_MESSAGE=void 0;se.isStylePatchPayload=vs;se.STYLE_PATCH_MESSAGE="FIVORA_PREVIEW_STYLE_PATCH";se.DENEB_STYLE_PATCH_MESSAGE="DENEB_PREVIEW_STYLE_PATCH";function vs(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 sn=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=ti;O.buildStyleFallbackSelectors=Fs;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 ti(e){return`[${O.STYLE_TARGET_ATTRIBUTE}="${ae(e)}"]`}function Fs(e,t){let n=[ti(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=Ns;Ae.resolveThemeToken=Ds;var Rs=ke();Object.defineProperty(Ae,"resolveFontFamily",{enumerable:!0,get:function(){return Rs.resolveFontFamily}});var Ls={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 Ns(e){if(e)return Ls[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 cn=F(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.formatUnit=D;ce.textStyleToCssVariables=ni;ce.cardStyleToCssVariables=ri;ce.buttonStyleToCssVariables=ii;ce.gridStyleToCssVariables=oi;ce.sectionStyleToCssVariables=si;ce.styleToCssVariables=Ms;var Os=rn(),$s=ke(),_e=bt();function D(e){if(!(e===void 0||e===""||e===null))return typeof e=="number"?`${e}px`:/^\d+$/.test(e)?`${e}px`:e}function an(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`]=D(r)),i!==void 0&&(n[`${t}-margin-bottom`]=D(i)),s!==void 0&&(n[`${t}-margin-left`]=D(s)),o!==void 0&&(n[`${t}-margin-right`]=D(o)),n}function ni(e){let t={...an(e,"--deneb")};return e.fontFamily&&(t["--deneb-font-family"]=(0,$s.resolveFontFamily)(e.fontFamily)),e.fontSize!==void 0&&(t["--deneb-font-size"]=(0,Os.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 ri(e){let t={...an(e,"--deneb-card")};return e.width!==void 0&&(t["--deneb-card-width"]=D(e.width)),e.minWidth!==void 0&&(t["--deneb-card-min-width"]=D(e.minWidth)),e.maxWidth!==void 0&&(t["--deneb-card-max-width"]=D(e.maxWidth)),e.height!==void 0&&(t["--deneb-card-height"]=D(e.height)),e.aspectRatio&&(t["--deneb-card-aspect-ratio"]=e.aspectRatio),e.paddingTop!==void 0&&(t["--deneb-card-pt"]=D(e.paddingTop)),e.paddingBottom!==void 0&&(t["--deneb-card-pb"]=D(e.paddingBottom)),e.paddingLeft!==void 0&&(t["--deneb-card-pl"]=D(e.paddingLeft)),e.paddingRight!==void 0&&(t["--deneb-card-pr"]=D(e.paddingRight)),e.borderRadius!==void 0&&(t["--deneb-card-radius"]=D(e.borderRadius)),e.borderWidth!==void 0&&(t["--deneb-card-border-w"]=D(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"]=D(e.backdropBlur)),e.gap!==void 0&&(t["--deneb-card-gap"]=D(e.gap)),t}function ii(e){let t={...an(e,"--deneb-btn")};return e.borderRadius!==void 0&&(t["--deneb-btn-radius"]=D(e.borderRadius)),e.paddingX!==void 0&&(t["--deneb-btn-px"]=D(e.paddingX)),e.paddingY!==void 0&&(t["--deneb-btn-py"]=D(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 oi(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"]=D(e.gapX)),e.gapY!==void 0&&(t["--deneb-grid-gap-y"]=D(e.gapY)),e.equalHeight!==void 0&&(t["--deneb-grid-equal-height"]=e.equalHeight?"stretch":"start"),t}function si(e){let t={};return e.paddingTop!==void 0&&(t["--deneb-section-pt"]=D(e.paddingTop)),e.paddingBottom!==void 0&&(t["--deneb-section-pb"]=D(e.paddingBottom)),e.paddingX!==void 0&&(t["--deneb-section-px"]=D(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 Ms(e,t){switch(e){case"text":return ni(t);case"card":return ri(t);case"button":return ii(t);case"grid":return oi(t);case"section":return si(t);default:return{}}}});var dn=F(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.isPlainObject=ln;St.deepMerge=ai;function ln(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ai(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))ln(o)&&ln(i[s])?i[s]=ai(i[s],o,n+1,r):i[s]=o;return i}});var ui=F(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.getLiveStyleCache=Vs;we.applyCssVariablesToElement=li;we.findStyleTargetElement=Us;we.patchElementStyle=di;we.patchStyleByPath=zs;var je=sn(),Bs=dn(),le=cn(),js=ke(),ci=bt(),un=new Map;function Vs(){return un}function li(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}function Us(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 di(e,t,n){let i=(e.getAttribute(je.STYLE_TARGET_ATTRIBUTE)??"")||e.getAttribute("data-preview-field-path")||"",s=i?un.get(i)??{}:{},o=(0,Bs.deepMerge)(s,n);i&&un.set(i,o);let a=(0,le.styleToCssVariables)(t,o);if(li(e,a),t==="text"){if(o.color){let l=(0,ci.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,js.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,ci.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 zs(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=>di(o,t,n)),r=!0)}return r}});var fi=F(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.isValidStyleKind=Ws;Ve.validateStyleTree=qs;Ve.collectStyleTargetsFromHtml=Gs;var Hs=new Set(["text","card","button","grid","section"]);function Ws(e){return typeof e=="string"&&Hs.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 Gs(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 mi=F(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0})});var fn=F(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.isDarkColor=gi;ve.getAutoContrastTextColor=Zs;ve.toHexColor=Ks;ve.normalizeHexColor=Ys;function gi(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 Zs(e,t="#ffffff",n="#0f172a"){return gi(e)?t:n}function Ks(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 Ys(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 hi=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 yi=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 Si=F(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.parseVisualCustomization=Ei;Ue.customizationToTheme=bi;Ue.mergeVisualCustomizationIntoTheme=Js;function de(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ei(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 bi(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 Js(e,t){let n=Ei(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??{},...bi(n)}).filter(([,i])=>i!==void 0)):e??null}});var Ti=F(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.generateThemeVariables=Xs;var pn=fn();function Xs(e){let t={};if(e){for(let[h,E]of Object.entries(e))if(typeof E=="string"||typeof E=="number"){let c=`--${h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;t[c]=String(E)}}let n=(0,pn.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",b=e?.buttonBackgroundColor||u,S=(0,pn.getAutoContrastTextColor)(b),m=e?.buttonTextColor||S,d=n?"rgba(255, 255, 255, 0.08)":f&&!(0,pn.isDarkColor)(f)?f:"#f1f5f9",p=n?"#f8fafc":"#0f172a";return{"--brand-color":u,"--brand-primary":u,"--primary-color":u,"--color-primary":u,"--primary":u,"--brand-secondary":f,"--secondary-color":f,"--color-secondary":d,"--secondary":d,"--brand-accent":g,"--accent-color":g,"--color-accent":g,"--accent":g,"--page-background":r,"--page-bg":r,"--background":r,"--page-text":i,"--color-text":i,"--text-color":i,"--text":i,"--foreground":i,"--color-foreground":i,"--heading-color":e?.headingColor||(n?"#ffffff":f),"--color-heading":e?.headingColor||(n?"#ffffff":f),"--muted-text":s,"--text-muted":s,"--color-text-muted":s,"--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","--surface":n?"rgba(255,255,255,0.05)":"#ffffff","--card-bg":a,"--card":a,"--card-background":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)"),"--footer-bg":e?.footerBackgroundColor||(n?"#0b0f19":"#f8fafc"),"--input-bg":n?"#1e293b":"#ffffff","--input-border":n?"rgba(255, 255, 255, 0.15)":"#cbd5e1","--input-color":i,"--button-bg":b,"--button-text":m,"--button-primary-bg":b,"--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 wi=F(te=>{"use strict";var Qs=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)&&Qs(t,e,n)};Object.defineProperty(te,"__esModule",{value:!0});Re(mi(),te);Re(fn(),te);Re(hi(),te);Re(yi(),te);Re(Si(),te);Re(Ti(),te)});var Pi=F(H=>{"use strict";var ea=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)&&ea(t,e,n)};Object.defineProperty(H,"__esModule",{value:!0});oe(Jr(),H);oe(Qr(),H);oe(ei(),H);oe(sn(),H);oe(cn(),H);oe(ui(),H);oe(bt(),H);oe(dn(),H);oe(fi(),H);oe(wi(),H)});var ha={};Hi(ha,{runTemplatePreflight:()=>Di});module.exports=Wi(ha);var Fi=require("node:child_process"),k=require("node:fs/promises"),Ri=require("node:os"),_=require("node:path"),En=kt(Lt());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 fo={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:po(),seo:null}}function po(){let e={};for(let t of Xn){e[t.key]=[];for(let n of fo[t.key]??[])e[n]||(e[n]=[])}return e}var er=kt(Lt()),xe={maxEntries:2e3,maxEntryUncompressedBytes:25*1024*1024,maxTotalUncompressedBytes:200*1024*1024,maxCompressionRatio:100},mo=new Set([".cache",".git",".next",".npm",".pnpm-store",".turbo","__macosx","node_modules"]),go=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),ho(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 ho(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=>mo.has(S)),s=n[0]===".yarn"&&n[1]==="cache",o=n.some(S=>go.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 yo={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"}},Eo=new Set(["text","textarea","email","tel","url","image","number","boolean","select"]),bo={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=>To(i)).filter(i=>!!i);return r.length===0?null:So({version:typeof t.version=="number"&&Number.isFinite(t.version)?t.version:1,sections:r})}function So(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])=>Po(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 Nt(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 Ot(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(b=>b!==l.path&&nt(b,l.path))),g=Nt(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=>Nt(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?Ot(e,bo):null}function To(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:Bt(t.maxLength),recommendedWidth:pe(t.recommendedWidth),recommendedHeight:pe(t.recommendedHeight),pageKey:z(t.pageKey)||void 0,...$t(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"?Mt(t.options):void 0}}function Nt(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=>wo(t)).filter(t=>!!t):[]}function wo(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:Bt(t.maxLength),recommendedWidth:pe(t.recommendedWidth),recommendedHeight:pe(t.recommendedHeight),...$t(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"?Mt(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:Bt(t.maxLength),recommendedWidth:pe(t.recommendedWidth),recommendedHeight:pe(t.recommendedHeight),...$t(t.sharedFieldKey),options:r==="select"?Mt(t.options):void 0}}function $t(e){return typeof e=="string"&&e.trim()?{sharedFieldKey:e.trim()}:{}}function Mt(e){if(!Array.isArray(e))return;let t=e.map(n=>z(n)).filter(n=>!!n);return t.length>0?t:void 0}function Bt(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"&&Eo.has(e)?e:null}function Po(e,t,n){let r=yo[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)?Io(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)?xo(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 Io(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 xo(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?Co(i,s):i}),...n.values()]}function Co(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=ko(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 ko(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 Ao=["primary","secondary","accent","background","text","surface","surfaceAlt","heading","mutedText","border","headerBackground","footerBackground","cardBackground","buttonBackground","buttonText"],_o=["headingFont","bodyFont","baseSize","headingScale","bodyLineHeight","headingLineHeight","headingWeight","bodyWeight","letterSpacing"],vo=["heroMinHeight","sectionPadding","contentMaxWidth","containerPadding","sectionGap","elementGap","gridGap"],Fo=["textAlign","contentAlign","heroTextAlign","cardTextAlign","gridColumns"],Ro=["cardWidth","cardMinHeight","cardPadding","cardRadius","cardBorderWidth","cardShadow","buttonPadding","buttonRadius","buttonShadow","imageRadius","headerHeight"],Lo=["backgroundColor","textColor","headingColor","minHeight","padding","contentMaxWidth","gap","textAlign","contentAlign","cardBackgroundColor","cardWidth","cardMinHeight","cardRadius","gridColumns"],No=["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 Oo(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 $o(e){return/^[a-zA-Z0-9_-]{1,64}$/.test(e)}function Mo(e){return/^[a-zA-Z0-9_.:\[\]-]{1,180}$/.test(e)}function Bo(){return{version:1}}function jo(e){if(!ie(e))return Bo();let t=be(e.colors,Ao),n=Oo(e.colorReplacements),r=be(e.typography,_o),i=be(e.spacing,vo),s=be(e.layout,Fo),o=be(e.components,Ro),a={};if(ie(e.sections))for(let[u,f]of Object.entries(e.sections)){if(!$o(u)||!ie(f))continue;let b={...be(f,Lo)??{}};typeof f.visible=="boolean"&&(b.visible=f.visible),Object.keys(b).length>0&&(a[u]=b)}let l={};if(ie(e.elementStyles))for(let[u,f]of Object.entries(e.elementStyles).slice(0,256)){if(!Mo(u)||!ie(f))continue;let g=be(f,No);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=jo(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 Vo=e=>new Error(e),Uo=new Set(["npm install","npm ci","pnpm install","pnpm install --frozen-lockfile","yarn install","yarn install --frozen-lockfile"]),zo=new Set(["npm run build","pnpm run build","yarn build","yarn run build"]);function Tr(e,t=Vo){let n=b=>{throw t(b)};(!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=Ho(r.visualEditing,i,t),o=sr(r.editorSchema),a=br(r),l=Array.isArray(r.colorPalette)?r.colorPalette.filter(b=>!!b&&typeof b=="object").flatMap(b=>{let S=typeof b.color=="string"?b.color.trim().toLowerCase():"";if(!/^#[0-9a-f]{6}$/.test(S))return[];let m=typeof b.usageCount=="number"&&Number.isFinite(b.usageCount)?Math.max(1,Math.floor(b.usageCount)):1;return[{color:S,usageCount:m}]}).slice(0,40):[],u=rt(o);if(u.length>0){let b=u.slice(0,5).map(S=>`"${S.path}"`).join(", ");n(`Template editorSchema declares the same editable path in more than one place: ${b}. 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,Uo,"installCommand",n),g=Sr(r.buildCommand,zo,"buildCommand",n);return{framework:"nextjs-static-export",version:i,siteDataFile:r.siteDataFile.trim(),editorSchema:o,pages:Array.isArray(r.pages)?r.pages.filter(b=>!!b&&typeof b=="object").map(b=>{let S=typeof b.id=="string"&&b.id.trim()?b.id.trim():null,m=typeof b.label=="string"&&b.label.trim()?b.label.trim():null;return!S||!m?n("Each template manifest page must include id and label."):{id:S,label:m,route:typeof b.route=="string"&&b.route.trim()?b.route.trim():void 0,required:typeof b.required=="boolean"?b.required:!1,description:typeof b.description=="string"?b.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 Ho(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 Wo={"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+|\*)\])*)*$`),Go=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Zo=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",jt=`${_r}READY`,Ko=ct;function Wt(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))Zt(i,r,n);for(let r of t?.sections??[])Kt(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 Jt(e,t){let n=Lr(e??{});for(let r of t?.sections??[])Xo(n,r.path,r);return n}function vr(e,t){let n=structuredClone(e??{});for(let r of t?.sections??[])Yo(n,r.path,r);return Gt(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:Wo[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=Wt(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."),hs(e.editorSchema,n),ys(e.editorSchema,n),ns(e.editorSchema,n,e.pages),rs(e.editorSchema,e.contentDefaults,n),os(e.artifacts,n),ss(e.artifacts,n),as(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),b=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),E=Nr(e.visualEditing?.controlOnlyPaths??[],i,n);Ut({label:"editable field",expectedPatterns:i.fieldPatterns,concretePaths:i.concreteFields,htmlMarkerPaths:g,sourceMarkerPaths:d,controlOnlyPaths:E,findings:n}),Ut({label:"editable list",expectedPatterns:i.listPatterns,concretePaths:i.concreteLists,htmlMarkerPaths:b,sourceMarkerPaths:p,controlOnlyPaths:[],findings:n}),Ut({label:"editable list item",expectedPatterns:i.itemPatterns,concretePaths:i.concreteItems,htmlMarkerPaths:S,sourceMarkerPaths:h,controlOnlyPaths:[],findings:n}),zt("field",a,i.fieldPatterns,i.concreteFields,n),zt("list",l,i.listPatterns,i.concreteLists,n),zt("item",u,i.itemPatterns,i.concreteItems,n),Dr(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:E,findings:n});let c=cs(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=Wt(e.contentDefaults,e.editorSchema),i=Jt(e.contentDefaults,e.editorSchema),s=Wt(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),b=J(f.markers,"list",t),S=J(f.markers,"item",t),m=Nr(e.visualEditing?.controlOnlyPaths??[],r,t);Vt({markerPaths:g,expectedPaths:s.concreteFields,knownPatterns:r.fieldPatterns,attribute:"field",findings:t}),Vt({markerPaths:b,expectedPaths:s.concreteLists,knownPatterns:r.listPatterns,attribute:"list",findings:t}),Vt({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)b.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 Dr(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 Vt(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 Yo(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 Gt(e,t){return Array.isArray(e)?e.map((n,r)=>Gt(n,`${t}[${r}]`)):Q(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>{let i=X(t,n);return[n,Gt(r,i)]})):typeof e=="string"?e.trim()?e:Jo(t):typeof e=="number"?Number.isFinite(e)&&e!==0?e:1:typeof e=="boolean"?!0:e??lt(t)}function Jo(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 Xo(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);Xt(i,s,n)}function Xt(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},()=>Qo(n));return}if(n.type==="object"){let r=Q(e[t])?e[t]:{};e[t]=r;for(let i of n.fields??[])Xt(r,i.key,i);return}e[t]=n.type==="number"?0:n.type==="boolean"?!1:""}function Qo(e){if(e.itemField)return e.itemField.type==="number"?0:e.itemField.type==="boolean"?!1:"";let t={};for(let n of e.fields??[])Xt(t,n.key,n);return t}function Zt(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)?Zt(i,o,n):(n.fieldPatterns.add(Z(o)),n.concreteFields.add(o))});return}if(Q(e)){for(let[r,i]of Object.entries(e))Zt(i,X(t,r),n);return}n.fieldPatterns.add(Z(t)),n.concreteFields.add(t)}function Kt(e,t,n){if(t.type==="object"){for(let r of t.fields??[])Kt(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??[])Kt(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 Nr(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=>Yt(s,a))){n.push(`controlOnlyPaths contains unknown editable field path "${s}".`);continue}r.push(s)}return G(r)}function Ut(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-${Ht(e.label)}="${t}" for ${e.label}.`);continue}e.sourceMarkerPaths.some(r=>Es(r,t))||e.findings.push(`Source is missing dynamic data-preview-${Ht(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-${Ht(e.label)}="${t}" for concrete ${e.label}.`)}function zt(e,t,n,r,i){for(let s of t)n.some(a=>Yt(s,a))||r.some(a=>Yt(s,a))||i.push(`data-preview-${e}-path references unknown path "${s}".`)}function Dr(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=en(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 b=u.get(g);b?i.push(`Manifest pages "${b}" and "${f.id}" use duplicate route "${g}".`):u.set(g,f.id);let S=s.filter(p=>tn(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(b=>es(o,b.canonicalPath)).sort((b,S)=>S.canonicalPath.length-b.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=en(l.route)??(e.manifestVersion<2?Mr(l.id):null);!u||!e.markers.some(b=>b.kind===i&&b.artifactKind==="html"&&$e(b.value)===o)||e.markers.some(b=>b.kind===i&&b.artifactKind==="html"&&$e(b.value)===o&&tn(b.filePath,u))||e.findings.push(`Page-owned ${kr(i)} "${o}" from editorSchema section "${a.section.path}" must render data-preview-${ts(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 es(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 ts(e){return e==="field"?"field-path":e==="list"?"list-path":"item-path"}function ns(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 rs(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 b=Q(g)?g:{};for(let S of o.fields??[])i(X(`${s}[${f}]`,S.key),S,b[S.key])}};for(let s of e?.sections??[])r(s.path,s),i(s.path,s,is(t??{},s.path))}function Se(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0?e:null}function is(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 os(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 ss(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(jt),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),b=n.some(S=>(S.content.includes(ct)||S.content.includes(jt))&&/\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 "${jt}") 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."),b||t.push(`Preview runtime source must call postMessage with "${Ko}" after its live-data listener is ready.`)}function as(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 cs(e,t){let n=[];for(let r of e.filter(i=>i.kind==="html"&&!ls(i.filePath,t)))n.push(...ds(r));return n}function ls(e,t){let n=e.replace(/\\/g,"/").replace(/^\/+/,"");return/^(?:404|500|_error|_not-found)(?:\/index)?\.html$/i.test(n)?!t.some(i=>{let s=en(i.route);return s?tn(n,s):!1}):!1}function ds(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(...us(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),b=/\bdata-preview-list-path\s*=/.test(s),S=/\bdata-preview-item-path\s*=/.test(s),m=g||b||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||gs(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 E=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;E&&y&&/\[\d+\]/.test(E)&&!Ar(E,y)&&t.push(`${e.filePath}:${U(e.content,o)} repeated field "${E}" 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||Zo.has(f),hidden:h,fieldCovered:!!a?.fieldCovered||g,staticCovered:!!a?.staticCovered||p,ownsFieldMarker:g,hasNestedFieldMarker:!1,fieldPath:E,itemPath:y,shopAttributeValues:fs(s,f),visibleTextParts:[],offset:o};if(!w.ignored&&!w.fieldCovered&&!w.staticCovered){let T=ms(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.`)}!Go.has(f)&&!/\/\s*>$/.test(s)&&n.push(w);continue}let l=Qt(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 us(e,t){if(!t.ownsFieldMarker||t.hasNestedFieldMarker||t.shopAttributeValues.length===0)return[];let n=Qt(t.visibleTextParts.join(" "));return!ut(n)||t.shopAttributeValues.some(r=>ps(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 fs(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 ps(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 ms(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(),b=Te(f[2]??f[3]??"").trim();$r(n,g,b)&&i.push(`${e.filePath}:${U(e.content,r)} ${n}[${g}="${pt(b,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(),b=Qt(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(b)||i.push(`${e.filePath}:${U(e.content,r)} ${n}[${g}="${pt(b,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 gs(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 hs(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 ys(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 Qt(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 Ht(e){return e==="editable field"?"field-path":e==="editable list"?"list-path":"item-path"}function Es(e,t){return t.includes("[*]")?e.includes("[*]")&&e===t:e===t}function Yt(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 en(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 tn(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(/&quot;/gi,'"').replace(/&#39;|&#x27;/gi,"'").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&amp;/gi,"&").replace(/&nbsp;/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 bs(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:bs(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(b=>{let S=b.route==="/"?"/":`/${b.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=e.basePath.replace(/^\/+|\/+$/g,"");if(!t)return[];let n=new Set;for(let r of e.html.matchAll(/<[a-z][^>]*\b(?:href|formaction|data-href|data-route|data-url)\s*=\s*(?:"([^"]*)"|'([^']*)')[^>]*>/gi)){let i=(r[1]??r[2]??"").trim(),s=i.split(/[?#]/,1)[0].replace(/^\.\//,"");(s===t||s.startsWith(`${t}/`))&&n.add(i)}return[...n]}function Wr(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 E=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
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)E+=1;else if(x===h&&(E-=1,E===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(" "),E=p(d);return/\b(?:[A-Za-z_$][\w$]*\s*\.\s*)*(?:[A-Za-z_$][\w$]*(?:base_?path|path_?base)[\w$]*|platformProductDetailHref)\b/i.test(`${E} ${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 E of p.matchAll(/\bdefault\s+as\s+([A-Za-z_$][\w$]*)/g))i.add(E[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 b=new RegExp(`\\b(?:${f})\\s*\\(\\s*\\)\\s*\\.\\s*(push|replace|prefetch)\\s*\\(`,"g");for(let d of e.matchAll(b)){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=kt(Pi());function Ii(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",Ct="1.0.0",Pt="fivora-template.json",Li=2500,Ni=12*1024*1024,It="/uploads/generated-sites/template-preview/simulation",ta=`https://fivora.example.invalid${It}/`,na={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"},hn=class{constructor(t,n){this.options=t;this.report={validator:Le,version:Ct,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} (${vi(Date.now()-i)})