@sap/generator-fiori
Version:
Create an SAPUI5 application using SAP Fiori elements or a freestyle approach
2 lines • 66 kB
JavaScript
const __esmImportMetaUrl = require('node:url').pathToFileURL(__filename).href;
var Lr=Object.create;var ae=Object.defineProperty;var vr=Object.getOwnPropertyDescriptor;var Tr=Object.getOwnPropertyNames;var _r=Object.getPrototypeOf,Fr=Object.prototype.hasOwnProperty;var s=(e,t)=>ae(e,"name",{value:t,configurable:!0});var k=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Ve=(e,t)=>{for(var r in t)ae(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Tr(t))!Fr.call(e,a)&&a!==r&&ae(e,a,{get:()=>t[a],enumerable:!(i=vr(t,a))||i.enumerable});return e};var Te=(e,t,r)=>(r=e!=null?Lr(_r(e)):{},Ge(t||!e||!e.__esModule?ae(r,"default",{value:e,enumerable:!0}):r,e)),xr=e=>Ge(ae({},"__esModule",{value:!0}),e);var xe=k((So,$e)=>{$e.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 he=k(tt=>{var et={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 Pr(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(r,i)=>t[i]||"")),new Error("ADM-ZIP: "+e)}}s(Pr,"E");for(let e of Object.keys(et))tt[e]=Pr(et[e])});var st=k((wo,it)=>{var Ur=require("fs"),H=require("path"),rt=xe(),Mr=he(),br=typeof process=="object"&&process.platform==="win32",ot=s(e=>typeof e=="object"&&e!==null,"is_Obj"),nt=new Uint32Array(256).map((e,t)=>{for(let r=0;r<8;r++)(t&1)!==0?t=3988292384^t>>>1:t>>>=1;return t>>>0});function P(e){this.sep=H.sep,this.fs=Ur,ot(e)&&ot(e.fs)&&typeof e.fs.statSync=="function"&&(this.fs=e.fs)}s(P,"Utils");it.exports=P;P.prototype.makeDir=function(e){let t=this;function r(i){let a=i.split(t.sep)[0];i.split(t.sep).forEach(function(n){if(!(!n||n.substr(-1,1)===":")){a+=t.sep+n;var u;try{u=t.fs.statSync(a)}catch{t.fs.mkdirSync(a)}if(u&&u.isFile())throw Mr.FILE_IN_THE_WAY(`"${a}"`)}})}s(r,"mkdirSync"),r(e)};P.prototype.writeFileTo=function(e,t,r,i){let a=this;if(a.fs.existsSync(e)){if(!r)return!1;var n=a.fs.statSync(e);if(n.isDirectory())return!1}var u=H.dirname(e);a.fs.existsSync(u)||a.makeDir(u);var N;try{N=a.fs.openSync(e,"w",438)}catch{a.fs.chmodSync(e,438),N=a.fs.openSync(e,"w",438)}if(N)try{a.fs.writeSync(N,t,0,t.length,0)}finally{a.fs.closeSync(N)}return a.fs.chmodSync(e,i||438),!0};P.prototype.writeFileToAsync=function(e,t,r,i,a){typeof i=="function"&&(a=i,i=void 0);let n=this;n.fs.exists(e,function(u){if(u&&!r)return a(!1);n.fs.stat(e,function(N,D){if(u&&D.isDirectory())return a(!1);var I=H.dirname(e);n.fs.exists(I,function(w){w||n.makeDir(I),n.fs.open(e,"w",438,function(v,B){v?n.fs.chmod(e,438,function(){n.fs.open(e,"w",438,function(c,l){n.fs.write(l,t,0,t.length,0,function(){n.fs.close(l,function(){n.fs.chmod(e,i||438,function(){a(!0)})})})})}):B?n.fs.write(B,t,0,t.length,0,function(){n.fs.close(B,function(){n.fs.chmod(e,i||438,function(){a(!0)})})}):n.fs.chmod(e,i||438,function(){a(!0)})})})})})};P.prototype.findFiles=function(e){let t=this;function r(i,a,n){typeof a=="boolean"&&(n=a,a=void 0);let u=[];return t.fs.readdirSync(i).forEach(function(N){let D=H.join(i,N),I=t.fs.statSync(D);(!a||a.test(D))&&u.push(H.normalize(D)+(I.isDirectory()?t.sep:"")),I.isDirectory()&&n&&(u=u.concat(r(D,a,n)))}),u}return s(r,"findSync"),r(e,void 0,!0)};P.prototype.findFilesAsync=function(e,t){let r=this,i=[];r.fs.readdir(e,function(a,n){if(a)return t(a);let u=n.length;if(!u)return t(null,i);n.forEach(function(N){N=H.join(e,N),r.fs.stat(N,function(D,I){if(D)return t(D);I&&(i.push(H.normalize(N)+(I.isDirectory()?r.sep:"")),I.isDirectory()?r.findFilesAsync(N,function(w,v){if(w)return t(w);i=i.concat(v),--u||t(null,i)}):--u||t(null,i))})})})};P.prototype.getAttributes=function(){};P.prototype.setAttributes=function(){};P.crc32update=function(e,t){return nt[(e^t)&255]^e>>>8};P.crc32=function(e){typeof e=="string"&&(e=Buffer.from(e,"utf8"));let t=e.length,r=-1;for(let i=0;i<t;)r=P.crc32update(r,e[i++]);return~r>>>0};P.methodToString=function(e){switch(e){case rt.STORED:return"STORED ("+e+")";case rt.DEFLATED:return"DEFLATED ("+e+")";default:return"UNSUPPORTED ("+e+")"}};P.canonical=function(e){if(!e)return"";let t=H.posix.normalize("/"+e.split("\\").join("/"));return H.join(".",t)};P.zipnamefix=function(e){if(!e)return"";let t=H.posix.normalize("/"+e.split("\\").join("/"));return H.posix.join(".",t)};P.findLast=function(e,t){if(!Array.isArray(e))throw new TypeError("arr is not array");let r=e.length>>>0;for(let i=r-1;i>=0;i--)if(t(e[i],i,e))return e[i]};P.sanitize=function(e,t){e=H.resolve(H.normalize(e));for(var r=t.split("/"),i=0,a=r.length;i<a;i++){var n=H.normalize(H.join(e,r.slice(i,a).join(H.sep)));if(n.indexOf(e)===0)return n}return H.normalize(H.join(e,H.basename(t)))};P.toBuffer=s(function(t,r){return Buffer.isBuffer(t)?t:t instanceof Uint8Array?Buffer.from(t):typeof t=="string"?r(t):Buffer.alloc(0)},"toBuffer");P.readBigUInt64LE=function(e,t){var r=Buffer.from(e.slice(t,t+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};P.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)};P.fromDate2DOS=function(e){let t=0,r=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),r=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|r};P.isWin=br;P.crcTable=nt});var ct=k((vo,at)=>{var Br=require("path");at.exports=function(e,{fs:t}){var r=e||"",i=n(),a=null;function n(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return s(n,"newAttr"),r&&t.existsSync(r)?(a=t.statSync(r),i.directory=a.isDirectory(),i.mtime=a.mtime,i.atime=a.atime,i.executable=(73&a.mode)!==0,i.readonly=(128&a.mode)===0,i.hidden=Br.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return i.directory},get readOnly(){return i.readonly},get hidden(){return i.hidden},get mtime(){return i.mtime},get atime(){return i.atime},get executable(){return i.executable},decodeAttributes:s(function(){},"decodeAttributes"),encodeAttributes:s(function(){},"encodeAttributes"),toJSON:s(function(){return{path:r,isDirectory:i.directory,isReadOnly:i.readonly,isHidden:i.hidden,isExecutable:i.executable,mTime:i.mtime,aTime:i.atime}},"toJSON"),toString:s(function(){return JSON.stringify(this.toJSON(),null," ")},"toString")}}});var pt=k((_o,ft)=>{ft.exports={efs:!0,encode:s(e=>Buffer.from(e,"utf8"),"encode"),decode:s(e=>e.toString("utf8"),"decode")}});var te=k((xo,ee)=>{ee.exports=st();ee.exports.Constants=xe();ee.exports.Errors=he();ee.exports.FileAttr=ct();ee.exports.decoder=pt()});var dt=k((Oo,lt)=>{var J=te(),E=J.Constants;lt.exports=function(){var e=20,t=10,r=0,i=0,a=0,n=0,u=0,N=0,D=0,I=0,w=0,v=0,B=0,c=0,l=0;e|=J.isWin?2560:768,r|=E.FLG_EFS;let g={extraLen:0},p=s(o=>Math.max(0,o)>>>0,"uint32"),m=s(o=>Math.max(0,o)&65535,"uint16"),h=s(o=>Math.max(0,o)&255,"uint8");return a=J.fromDate2DOS(new Date),{get made(){return e},set made(o){e=o},get version(){return t},set version(o){t=o},get flags(){return r},set flags(o){r=o},get flags_efs(){return(r&E.FLG_EFS)>0},set flags_efs(o){o?r|=E.FLG_EFS:r&=~E.FLG_EFS},get flags_desc(){return(r&E.FLG_DESC)>0},set flags_desc(o){o?r|=E.FLG_DESC:r&=~E.FLG_DESC},get method(){return i},set method(o){switch(o){case E.STORED:this.version=10;case E.DEFLATED:default:this.version=20}i=o},get time(){return J.fromDOS2Date(this.timeval)},set time(o){this.timeval=J.fromDate2DOS(o)},get timeval(){return a},set timeval(o){a=p(o)},get timeHighByte(){return h(a>>>8)},get crc(){return n},set crc(o){n=p(o)},get compressedSize(){return u},set compressedSize(o){u=p(o)},get size(){return N},set size(o){N=p(o)},get fileNameLength(){return D},set fileNameLength(o){D=o},get extraLength(){return I},set extraLength(o){I=o},get extraLocalLength(){return g.extraLen},set extraLocalLength(o){g.extraLen=o},get commentLength(){return w},set commentLength(o){w=o},get diskNumStart(){return v},set diskNumStart(o){v=p(o)},get inAttr(){return B},set inAttr(o){B=p(o)},get attr(){return c},set attr(o){c=p(o)},get fileAttr(){return(c||0)>>16&4095},get offset(){return l},set offset(o){l=p(o)},get encrypted(){return(r&E.FLG_ENC)===E.FLG_ENC},get centralHeaderSize(){return E.CENHDR+D+I+w},get realDataOffset(){return l+E.LOCHDR+g.fnameLen+g.extraLen},get localHeader(){return g},loadLocalHeaderFromBinary:s(function(o){var f=o.slice(l,l+E.LOCHDR);if(f.readUInt32LE(0)!==E.LOCSIG)throw J.Errors.INVALID_LOC();g.version=f.readUInt16LE(E.LOCVER),g.flags=f.readUInt16LE(E.LOCFLG),g.method=f.readUInt16LE(E.LOCHOW),g.time=f.readUInt32LE(E.LOCTIM),g.crc=f.readUInt32LE(E.LOCCRC),g.compressedSize=f.readUInt32LE(E.LOCSIZ),g.size=f.readUInt32LE(E.LOCLEN),g.fnameLen=f.readUInt16LE(E.LOCNAM),g.extraLen=f.readUInt16LE(E.LOCEXT);let d=l+E.LOCHDR+g.fnameLen,S=d+g.extraLen;return o.slice(d,S)},"loadLocalHeaderFromBinary"),loadFromBinary:s(function(o){if(o.length!==E.CENHDR||o.readUInt32LE(0)!==E.CENSIG)throw J.Errors.INVALID_CEN();e=o.readUInt16LE(E.CENVEM),t=o.readUInt16LE(E.CENVER),r=o.readUInt16LE(E.CENFLG),i=o.readUInt16LE(E.CENHOW),a=o.readUInt32LE(E.CENTIM),n=o.readUInt32LE(E.CENCRC),u=o.readUInt32LE(E.CENSIZ),N=o.readUInt32LE(E.CENLEN),D=o.readUInt16LE(E.CENNAM),I=o.readUInt16LE(E.CENEXT),w=o.readUInt16LE(E.CENCOM),v=o.readUInt16LE(E.CENDSK),B=o.readUInt16LE(E.CENATT),c=o.readUInt32LE(E.CENATX),l=o.readUInt32LE(E.CENOFF)},"loadFromBinary"),localHeaderToBinary:s(function(){var o=Buffer.alloc(E.LOCHDR);return o.writeUInt32LE(E.LOCSIG,0),o.writeUInt16LE(t,E.LOCVER),o.writeUInt16LE(r,E.LOCFLG),o.writeUInt16LE(i,E.LOCHOW),o.writeUInt32LE(a,E.LOCTIM),o.writeUInt32LE(n,E.LOCCRC),o.writeUInt32LE(u,E.LOCSIZ),o.writeUInt32LE(N,E.LOCLEN),o.writeUInt16LE(D,E.LOCNAM),o.writeUInt16LE(g.extraLen,E.LOCEXT),o},"localHeaderToBinary"),centralHeaderToBinary:s(function(){var o=Buffer.alloc(E.CENHDR+D+I+w);return o.writeUInt32LE(E.CENSIG,0),o.writeUInt16LE(e,E.CENVEM),o.writeUInt16LE(t,E.CENVER),o.writeUInt16LE(r,E.CENFLG),o.writeUInt16LE(i,E.CENHOW),o.writeUInt32LE(a,E.CENTIM),o.writeUInt32LE(n,E.CENCRC),o.writeUInt32LE(u,E.CENSIZ),o.writeUInt32LE(N,E.CENLEN),o.writeUInt16LE(D,E.CENNAM),o.writeUInt16LE(I,E.CENEXT),o.writeUInt16LE(w,E.CENCOM),o.writeUInt16LE(v,E.CENDSK),o.writeUInt16LE(B,E.CENATT),o.writeUInt32LE(c,E.CENATX),o.writeUInt32LE(l,E.CENOFF),o},"centralHeaderToBinary"),toJSON:s(function(){let o=s(function(f){return f+" bytes"},"bytes");return{made:e,version:t,flags:r,method:J.methodToString(i),time:this.time,crc:"0x"+n.toString(16).toUpperCase(),compressedSize:o(u),size:o(N),fileNameLength:o(D),extraLength:o(I),commentLength:o(w),diskNumStart:v,inAttr:B,attr:c,offset:l,centralHeaderSize:o(E.CENHDR+D+I+w)}},"toJSON"),toString:s(function(){return JSON.stringify(this.toJSON(),null," ")},"toString")}}});var mt=k((Po,ut)=>{var re=te(),O=re.Constants;ut.exports=function(){var e=0,t=0,r=0,i=0,a=0;return{get diskEntries(){return e},set diskEntries(n){e=t=n},get totalEntries(){return t},set totalEntries(n){t=e=n},get size(){return r},set size(n){r=n},get offset(){return i},set offset(n){i=n},get commentLength(){return a},set commentLength(n){a=n},get mainHeaderSize(){return O.ENDHDR+a},loadFromBinary:s(function(n){if((n.length!==O.ENDHDR||n.readUInt32LE(0)!==O.ENDSIG)&&(n.length<O.ZIP64HDR||n.readUInt32LE(0)!==O.ZIP64SIG))throw re.Errors.INVALID_END();n.readUInt32LE(0)===O.ENDSIG?(e=n.readUInt16LE(O.ENDSUB),t=n.readUInt16LE(O.ENDTOT),r=n.readUInt32LE(O.ENDSIZ),i=n.readUInt32LE(O.ENDOFF),a=n.readUInt16LE(O.ENDCOM)):(e=re.readBigUInt64LE(n,O.ZIP64SUB),t=re.readBigUInt64LE(n,O.ZIP64TOT),r=re.readBigUInt64LE(n,O.ZIP64SIZE),i=re.readBigUInt64LE(n,O.ZIP64OFF),a=0)},"loadFromBinary"),toBinary:s(function(){var n=Buffer.alloc(O.ENDHDR+a);return n.writeUInt32LE(O.ENDSIG,0),n.writeUInt32LE(0,4),n.writeUInt16LE(e,O.ENDSUB),n.writeUInt16LE(t,O.ENDTOT),n.writeUInt32LE(r,O.ENDSIZ),n.writeUInt32LE(i,O.ENDOFF),n.writeUInt16LE(a,O.ENDCOM),n.fill(" ",O.ENDHDR),n},"toBinary"),toJSON:s(function(){let n=s(function(u,N){let D=u.toString(16).toUpperCase();for(;D.length<N;)D="0"+D;return"0x"+D},"offset");return{diskEntries:e,totalEntries:t,size:r+" bytes",offset:n(i,4),commentLength:a}},"toJSON"),toString:s(function(){return JSON.stringify(this.toJSON(),null," ")},"toString")}}});var Re=k(Oe=>{Oe.EntryHeader=dt();Oe.MainHeader=mt()});var ht=k((bo,gt)=>{gt.exports=function(e){var t=require("zlib"),r={chunkSize:(parseInt(e.length/1024)+1)*1024};return{deflate:s(function(){return t.deflateRawSync(e,r)},"deflate"),deflateAsync:s(function(i){var a=t.createDeflateRaw(r),n=[],u=0;a.on("data",function(N){n.push(N),u+=N.length}),a.on("end",function(){var N=Buffer.alloc(u),D=0;N.fill(0);for(var I=0;I<n.length;I++){var w=n[I];w.copy(N,D),D+=w.length}i&&i(N)}),a.end(e)},"deflateAsync")}}});var yt=k((Ho,Et)=>{var Hr=+(process.versions?process.versions.node:"").split(".")[0]||0;Et.exports=function(e,t){var r=require("zlib");let i=Hr>=15&&t>0?{maxOutputLength:t}:{};return{inflate:s(function(){return r.inflateRawSync(e,i)},"inflate"),inflateAsync:s(function(a){var n=r.createInflateRaw(i),u=[],N=0;n.on("data",function(D){u.push(D),N+=D.length}),n.on("end",function(){var D=Buffer.alloc(N),I=0;D.fill(0);for(var w=0;w<u.length;w++){var v=u[w];v.copy(D,I),I+=v.length}a&&a(D)}),n.end(e)},"inflateAsync")}}});var Ct=k((jo,St)=>{"use strict";var{randomFillSync:It}=require("crypto"),Zr=he(),jr=new Uint32Array(256).map((e,t)=>{for(let r=0;r<8;r++)(t&1)!==0?t=t>>>1^3988292384:t>>>=1;return t>>>0}),Dt=s((e,t)=>Math.imul(e,t)>>>0,"uMul"),Nt=s((e,t)=>jr[(e^t)&255]^e>>>8,"crc32update"),pe=s(()=>typeof It=="function"?It(Buffer.alloc(12)):pe.node(),"genSalt");pe.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let r=0;r<t;r++)e[r]=Math.random()*256&255;return e};var Ee={genSalt:pe};function ye(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<t.length;r++)this.updateKeys(t[r])}s(ye,"Initkeys");ye.prototype.updateKeys=function(e){let t=this.keys;return t[0]=Nt(t[0],e),t[1]+=t[0]&255,t[1]=Dt(t[1],134775813)+1,t[2]=Nt(t[2],t[1]>>>24),e};ye.prototype.next=function(){let e=(this.keys[2]|2)>>>0;return Dt(e,e^1)>>8&255};function kr(e){let t=new ye(e);return function(r){let i=Buffer.alloc(r.length),a=0;for(let n of r)i[a++]=t.updateKeys(n^t.next());return i}}s(kr,"make_decrypter");function Vr(e){let t=new ye(e);return function(r,i,a=0){i||(i=Buffer.alloc(r.length));for(let n of r){let u=t.next();i[a++]=n^u,t.updateKeys(n)}return i}}s(Vr,"make_encrypter");function Gr(e,t,r){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let i=kr(r),a=i(e.slice(0,12)),n=(t.flags&8)===8?t.timeHighByte:t.crc>>>24;if(a[11]!==n)throw Zr.WRONG_PASSWORD();return i(e.slice(12))}s(Gr,"decrypt");function zr(e){Buffer.isBuffer(e)&&e.length>=12?Ee.genSalt=function(){return e.slice(0,12)}:e==="node"?Ee.genSalt=pe.node:Ee.genSalt=pe}s(zr,"_salter");function qr(e,t,r,i=!1){e==null&&(e=Buffer.alloc(0)),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let a=Vr(r),n=Ee.genSalt();n[11]=t.crc>>>24&255,i&&(n[10]=t.crc>>>16&255);let u=Buffer.alloc(e.length+12);return a(n,u),a(e,u,12)}s(qr,"encrypt");St.exports={decrypt:Gr,encrypt:qr,_salter:zr}});var At=k(Ie=>{Ie.Deflater=ht();Ie.Inflater=yt();Ie.ZipCrypto=Ct()});var Ue=k((Go,wt)=>{var _=te(),Jr=Re(),U=_.Constants,Pe=At();wt.exports=function(e,t){var r=new Jr.EntryHeader,i=Buffer.alloc(0),a=Buffer.alloc(0),n=!1,u=null,N=Buffer.alloc(0),D=Buffer.alloc(0),I=!0;let w=e,v=typeof w.decoder=="object"?w.decoder:_.decoder;I=v.hasOwnProperty("efs")?v.efs:!1;function B(){return!t||!(t instanceof Uint8Array)?Buffer.alloc(0):(D=r.loadLocalHeaderFromBinary(t),t.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}s(B,"getCompressedDataFromZip");function c(o){if(r.flags_desc){let f={},d=r.realDataOffset+r.compressedSize;if(t.readUInt32LE(d)==U.LOCSIG||t.readUInt32LE(d)==U.CENSIG)throw _.Errors.DESCRIPTOR_NOT_EXIST();if(t.readUInt32LE(d)==U.EXTSIG)f.crc=t.readUInt32LE(d+U.EXTCRC),f.compressedSize=t.readUInt32LE(d+U.EXTSIZ),f.size=t.readUInt32LE(d+U.EXTLEN);else if(t.readUInt16LE(d+12)===19280)f.crc=t.readUInt32LE(d+U.EXTCRC-4),f.compressedSize=t.readUInt32LE(d+U.EXTSIZ-4),f.size=t.readUInt32LE(d+U.EXTLEN-4);else throw _.Errors.DESCRIPTOR_UNKNOWN();if(f.compressedSize!==r.compressedSize||f.size!==r.size||f.crc!==r.crc)throw _.Errors.DESCRIPTOR_FAULTY();if(_.crc32(o)!==f.crc)return!1}else if(_.crc32(o)!==r.localHeader.crc)return!1;return!0}s(c,"crc32OK");function l(o,f,d){if(typeof f>"u"&&typeof o=="string"&&(d=o,o=void 0),n)return o&&f&&f(Buffer.alloc(0),_.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var S=B();if(S.length===0)return o&&f&&f(S),S;if(r.encrypted){if(typeof d!="string"&&!Buffer.isBuffer(d))throw _.Errors.INVALID_PASS_PARAM();S=Pe.ZipCrypto.decrypt(S,r,d)}var y=Buffer.alloc(r.size);switch(r.method){case _.Constants.STORED:if(S.copy(y),c(y))return o&&f&&f(y),y;throw o&&f&&f(y,_.Errors.BAD_CRC()),_.Errors.BAD_CRC();case _.Constants.DEFLATED:var F=new Pe.Inflater(S,r.size);if(o)F.inflateAsync(function(T){T.copy(T,0),f&&(c(T)?f(T):f(T,_.Errors.BAD_CRC()))});else{if(F.inflate(y).copy(y,0),!c(y))throw _.Errors.BAD_CRC(`"${v.decode(i)}"`);return y}break;default:throw o&&f&&f(Buffer.alloc(0),_.Errors.UNKNOWN_METHOD()),_.Errors.UNKNOWN_METHOD()}}s(l,"decompress");function g(o,f){if((!u||!u.length)&&Buffer.isBuffer(t))return o&&f&&f(B()),B();if(u.length&&!n){var d;switch(r.method){case _.Constants.STORED:return r.compressedSize=r.size,d=Buffer.alloc(u.length),u.copy(d),o&&f&&f(d),d;default:case _.Constants.DEFLATED:var S=new Pe.Deflater(u);if(o)S.deflateAsync(function(F){d=Buffer.alloc(F.length),r.compressedSize=F.length,F.copy(d),f&&f(d)});else{var y=S.deflate();return r.compressedSize=y.length,y}S=null;break}}else if(o&&f)f(Buffer.alloc(0));else return Buffer.alloc(0)}s(g,"compress");function p(o,f){return(o.readUInt32LE(f+4)<<4)+o.readUInt32LE(f)}s(p,"readUInt64LE");function m(o){try{for(var f=0,d,S,y;f+4<o.length;)d=o.readUInt16LE(f),f+=2,S=o.readUInt16LE(f),f+=2,y=o.slice(f,f+S),f+=S,U.ID_ZIP64===d&&h(y)}catch{throw _.Errors.EXTRA_FIELD_PARSE_ERROR()}}s(m,"parseExtra");function h(o){var f,d,S,y;o.length>=U.EF_ZIP64_SCOMP&&(f=p(o,U.EF_ZIP64_SUNCOMP),r.size===U.EF_ZIP64_OR_32&&(r.size=f)),o.length>=U.EF_ZIP64_RHO&&(d=p(o,U.EF_ZIP64_SCOMP),r.compressedSize===U.EF_ZIP64_OR_32&&(r.compressedSize=d)),o.length>=U.EF_ZIP64_DSN&&(S=p(o,U.EF_ZIP64_RHO),r.offset===U.EF_ZIP64_OR_32&&(r.offset=S)),o.length>=U.EF_ZIP64_DSN+4&&(y=o.readUInt32LE(U.EF_ZIP64_DSN),r.diskNumStart===U.EF_ZIP64_OR_16&&(r.diskNumStart=y))}return s(h,"parseZip64ExtendedInformation"),{get entryName(){return v.decode(i)},get rawEntryName(){return i},set entryName(o){i=_.toBuffer(o,v.encode);var f=i[i.length-1];n=f===47||f===92,r.fileNameLength=i.length},get efs(){return typeof I=="function"?I(this.entryName):I},get extra(){return N},set extra(o){N=o,r.extraLength=o.length,m(o)},get comment(){return v.decode(a)},set comment(o){if(a=_.toBuffer(o,v.encode),r.commentLength=a.length,a.length>65535)throw _.Errors.COMMENT_TOO_LONG()},get name(){var o=v.decode(i);return n?o.substr(o.length-1).split("/").pop():o.split("/").pop()},get isDirectory(){return n},getCompressedData:s(function(){return g(!1,null)},"getCompressedData"),getCompressedDataAsync:s(function(o){g(!0,o)},"getCompressedDataAsync"),setData:s(function(o){u=_.toBuffer(o,_.decoder.encode),!n&&u.length?(r.size=u.length,r.method=_.Constants.DEFLATED,r.crc=_.crc32(o),r.changed=!0):r.method=_.Constants.STORED},"setData"),getData:s(function(o){return r.changed?u:l(!1,null,o)},"getData"),getDataAsync:s(function(o,f){r.changed?o(u):l(!0,o,f)},"getDataAsync"),set attr(o){r.attr=o},get attr(){return r.attr},set header(o){r.loadFromBinary(o)},get header(){return r},packCentralHeader:s(function(){r.flags_efs=this.efs,r.extraLength=N.length;var o=r.centralHeaderToBinary(),f=_.Constants.CENHDR;return i.copy(o,f),f+=i.length,N.copy(o,f),f+=r.extraLength,a.copy(o,f),o},"packCentralHeader"),packLocalHeader:s(function(){let o=0;r.flags_efs=this.efs,r.extraLocalLength=D.length;let f=r.localHeaderToBinary(),d=Buffer.alloc(f.length+i.length+r.extraLocalLength);return f.copy(d,o),o+=f.length,i.copy(d,o),o+=i.length,D.copy(d,o),o+=D.length,d},"packLocalHeader"),toJSON:s(function(){let o=s(function(f){return"<"+(f&&f.length+" bytes buffer"||"null")+">"},"bytes");return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:o(t),data:o(u)}},"toJSON"),toString:s(function(){return JSON.stringify(this.toJSON(),null," ")},"toString")}}});var Tt=k((qo,vt)=>{var Lt=Ue(),Wr=Re(),j=te();vt.exports=function(e,t){var r=[],i={},a=Buffer.alloc(0),n=new Wr.MainHeader,u=!1,N=null;let D=new Set,I=t,{noSort:w,decoder:v}=I;e?l(I.readEntries):u=!0;function B(){let p=new Set;for(let m of Object.keys(i)){let h=m.split("/");if(h.pop(),!!h.length)for(let o=0;o<h.length;o++){let f=h.slice(0,o+1).join("/")+"/";p.add(f)}}for(let m of p)if(!(m in i)){let h=new Lt(I);h.entryName=m,h.attr=16,h.temporary=!0,r.push(h),i[h.entryName]=h,D.add(h)}}s(B,"makeTemporaryFolders");function c(){if(u=!0,i={},n.diskEntries>(e.length-n.offset)/j.Constants.CENHDR)throw j.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(n.diskEntries);for(var p=n.offset,m=0;m<r.length;m++){var h=p,o=new Lt(I,e);o.header=e.slice(h,h+=j.Constants.CENHDR),o.entryName=e.slice(h,h+=o.header.fileNameLength),o.header.extraLength&&(o.extra=e.slice(h,h+=o.header.extraLength)),o.header.commentLength&&(o.comment=e.slice(h,h+o.header.commentLength)),p+=o.header.centralHeaderSize,r[m]=o,i[o.entryName]=o}D.clear(),B()}s(c,"readEntries");function l(p){var m=e.length-j.Constants.ENDHDR,h=Math.max(0,m-65535),o=h,f=e.length,d=-1,S=0;for(typeof I.trailingSpace=="boolean"&&I.trailingSpace&&(h=0),m;m>=o;m--)if(e[m]===80){if(e.readUInt32LE(m)===j.Constants.ENDSIG){d=m,S=m,f=m+j.Constants.ENDHDR,o=m-j.Constants.END64HDR;continue}if(e.readUInt32LE(m)===j.Constants.END64SIG){o=h;continue}if(e.readUInt32LE(m)===j.Constants.ZIP64SIG){d=m,f=m+j.readBigUInt64LE(e,m+j.Constants.ZIP64SIZE)+j.Constants.ZIP64LEAD;break}}if(d==-1)throw j.Errors.INVALID_FORMAT();n.loadFromBinary(e.slice(d,f)),n.commentLength&&(a=e.slice(S+j.Constants.ENDHDR)),p&&c()}s(l,"readMainHeader");function g(){r.length>1&&!w&&r.sort((p,m)=>p.entryName.toLowerCase().localeCompare(m.entryName.toLowerCase()))}return s(g,"sortEntries"),{get entries(){return u||c(),r.filter(p=>!D.has(p))},get comment(){return v.decode(a)},set comment(p){a=j.toBuffer(p,v.encode),n.commentLength=a.length},getEntryCount:s(function(){return u?r.length:n.diskEntries},"getEntryCount"),forEach:s(function(p){this.entries.forEach(p)},"forEach"),getEntry:s(function(p){return u||c(),i[p]||null},"getEntry"),setEntry:s(function(p){u||c(),r.push(p),i[p.entryName]=p,n.totalEntries=r.length},"setEntry"),deleteFile:s(function(p,m=!0){u||c();let h=i[p];this.getEntryChildren(h,m).map(f=>f.entryName).forEach(this.deleteEntry)},"deleteFile"),deleteEntry:s(function(p){u||c();let m=i[p],h=r.indexOf(m);h>=0&&(r.splice(h,1),delete i[p],n.totalEntries=r.length)},"deleteEntry"),getEntryChildren:s(function(p,m=!0){if(u||c(),typeof p=="object")if(p.isDirectory&&m){let h=[],o=p.entryName;for(let f of r)f.entryName.startsWith(o)&&h.push(f);return h}else return[p];return[]},"getEntryChildren"),getChildCount:s(function(p){if(p&&p.isDirectory){let m=this.getEntryChildren(p);return m.includes(p)?m.length-1:m.length}return 0},"getChildCount"),compressToBuffer:s(function(){u||c(),g();let p=[],m=[],h=0,o=0;n.size=0,n.offset=0;let f=0;for(let y of this.entries){let F=y.getCompressedData();y.header.offset=o;let T=y.packLocalHeader(),Z=T.length+F.length;o+=Z,p.push(T),p.push(F);let x=y.packCentralHeader();m.push(x),n.size+=x.length,h+=Z+x.length,f++}h+=n.mainHeaderSize,n.offset=o,n.totalEntries=f,o=0;let d=Buffer.alloc(h);for(let y of p)y.copy(d,o),o+=y.length;for(let y of m)y.copy(d,o),o+=y.length;let S=n.toBinary();return a&&a.copy(S,j.Constants.ENDHDR),S.copy(d,o),e=d,u=!1,d},"compressToBuffer"),toAsyncBuffer:s(function(p,m,h,o){try{u||c(),g();let f=[],d=[],S=0,y=0,F=0;n.size=0,n.offset=0;let T=s(function(Z){if(Z.length>0){let x=Z.shift(),q=x.entryName+x.extra.toString();h&&h(q),x.getCompressedDataAsync(function(z){o&&o(q),x.header.offset=y;let ue=x.packLocalHeader(),ke=ue.length+z.length;y+=ke,f.push(ue),f.push(z);let ve=x.packCentralHeader();d.push(ve),n.size+=ve.length,S+=ke+ve.length,F++,T(Z)})}else{S+=n.mainHeaderSize,n.offset=y,n.totalEntries=F,y=0;let x=Buffer.alloc(S);f.forEach(function(z){z.copy(x,y),y+=z.length}),d.forEach(function(z){z.copy(x,y),y+=z.length});let q=n.toBinary();a&&a.copy(q,j.Constants.ENDHDR),q.copy(x,y),e=x,u=!1,p(x)}},"compress2Buffer");T(Array.from(this.entries))}catch(f){m(f)}},"toAsyncBuffer")}}});var xt=k((Wo,Ft)=>{var R=te(),M=require("path"),Xr=Ue(),Qr=Tt(),Q=s((...e)=>R.findLast(e,t=>typeof t=="boolean"),"get_Bool"),_t=s((...e)=>R.findLast(e,t=>typeof t=="string"),"get_Str"),Kr=s((...e)=>R.findLast(e,t=>typeof t=="function"),"get_Fun"),Yr={noSort:!1,readEntries:!1,method:R.Constants.NONE,fs:null};Ft.exports=function(e,t){let r=null,i=Object.assign(Object.create(null),Yr);e&&typeof e=="object"&&(e instanceof Uint8Array||(Object.assign(i,e),e=i.input?i.input:void 0,i.input&&delete i.input),Buffer.isBuffer(e)&&(r=e,i.method=R.Constants.BUFFER,e=void 0)),Object.assign(i,t);let a=new R(i);if((typeof i.decoder!="object"||typeof i.decoder.encode!="function"||typeof i.decoder.decode!="function")&&(i.decoder=R.decoder),e&&typeof e=="string")if(a.fs.existsSync(e))i.method=R.Constants.FILE,i.filename=e,r=a.fs.readFileSync(e);else throw R.Errors.INVALID_FILENAME();let n=new Qr(r,i),{canonical:u,sanitize:N,zipnamefix:D}=R;function I(c){if(c&&n){var l;if(typeof c=="string"&&(l=n.getEntry(M.posix.normalize(c))),typeof c=="object"&&typeof c.entryName<"u"&&typeof c.header<"u"&&(l=n.getEntry(c.entryName)),l)return l}return null}s(I,"getEntry");function w(c){let{join:l,normalize:g,sep:p}=M.posix;return l(".",g(p+c.split("\\").join(p)+p))}s(w,"fixPath");function v(c){return c instanceof RegExp?(function(l){return function(g){return l.test(g)}})(c):typeof c!="function"?()=>!0:c}s(v,"filenameFilter");let B=s((c,l)=>{let g=l.slice(-1);return g=g===a.sep?a.sep:"",M.relative(c,l)+g},"relativePath");return{readFile:s(function(c,l){var g=I(c);return g&&g.getData(l)||null},"readFile"),childCount:s(function(c){let l=I(c);if(l)return n.getChildCount(l)},"childCount"),readFileAsync:s(function(c,l){var g=I(c);g?g.getDataAsync(l):l(null,"getEntry failed for:"+c)},"readFileAsync"),readAsText:s(function(c,l){var g=I(c);if(g){var p=g.getData();if(p&&p.length)return p.toString(l||"utf8")}return""},"readAsText"),readAsTextAsync:s(function(c,l,g){var p=I(c);p?p.getDataAsync(function(m,h){if(h){l(m,h);return}m&&m.length?l(m.toString(g||"utf8")):l("")}):l("")},"readAsTextAsync"),deleteFile:s(function(c,l=!0){var g=I(c);g&&n.deleteFile(g.entryName,l)},"deleteFile"),deleteEntry:s(function(c){var l=I(c);l&&n.deleteEntry(l.entryName)},"deleteEntry"),addZipComment:s(function(c){n.comment=c},"addZipComment"),getZipComment:s(function(){return n.comment||""},"getZipComment"),addZipEntryComment:s(function(c,l){var g=I(c);g&&(g.comment=l)},"addZipEntryComment"),getZipEntryComment:s(function(c){var l=I(c);return l&&l.comment||""},"getZipEntryComment"),updateFile:s(function(c,l){var g=I(c);g&&g.setData(l)},"updateFile"),addLocalFile:s(function(c,l,g,p){if(a.fs.existsSync(c)){l=l?w(l):"";let m=M.win32.basename(M.win32.normalize(c));l+=g||m;let h=a.fs.statSync(c),o=h.isFile()?a.fs.readFileSync(c):Buffer.alloc(0);h.isDirectory()&&(l+=a.sep),this.addFile(l,o,p,h)}else throw R.Errors.FILE_NOT_FOUND(c)},"addLocalFile"),addLocalFileAsync:s(function(c,l){c=typeof c=="object"?c:{localPath:c};let g=M.resolve(c.localPath),{comment:p}=c,{zipPath:m,zipName:h}=c,o=this;a.fs.stat(g,function(f,d){if(f)return l(f,!1);m=m?w(m):"";let S=M.win32.basename(M.win32.normalize(g));if(m+=h||S,d.isFile())a.fs.readFile(g,function(y,F){return y?l(y,!1):(o.addFile(m,F,p,d),setImmediate(l,void 0,!0))});else if(d.isDirectory())return m+=a.sep,o.addFile(m,Buffer.alloc(0),p,d),setImmediate(l,void 0,!0)})},"addLocalFileAsync"),addLocalFolder:s(function(c,l,g){if(g=v(g),l=l?w(l):"",c=M.normalize(c),a.fs.existsSync(c)){let p=a.findFiles(c),m=this;if(p.length)for(let h of p){let o=M.join(l,B(c,h));g(o)&&m.addLocalFile(h,M.dirname(o))}}else throw R.Errors.FILE_NOT_FOUND(c)},"addLocalFolder"),addLocalFolderAsync:s(function(c,l,g,p){p=v(p),g=g?w(g):"",c=M.normalize(c);var m=this;a.fs.open(c,"r",function(h){if(h&&h.code==="ENOENT")l(void 0,R.Errors.FILE_NOT_FOUND(c));else if(h)l(void 0,h);else{var o=a.findFiles(c),f=-1,d=s(function(){if(f+=1,f<o.length){var S=o[f],y=B(c,S).split("\\").join("/");y=y.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),p(y)?a.fs.stat(S,function(F,T){F&&l(void 0,F),T.isFile()?a.fs.readFile(S,function(Z,x){Z?l(void 0,Z):(m.addFile(g+y,x,"",T),d())}):(m.addFile(g+y+"/",Buffer.alloc(0),"",T),d())}):process.nextTick(()=>{d()})}else l(!0,void 0)},"next");d()}})},"addLocalFolderAsync"),addLocalFolderAsync2:s(function(c,l){let g=this;c=typeof c=="object"?c:{localPath:c},localPath=M.resolve(w(c.localPath));let{zipPath:p,filter:m,namefix:h}=c;m instanceof RegExp?m=(function(d){return function(S){return d.test(S)}})(m):typeof m!="function"&&(m=s(function(){return!0},"filter")),p=p?w(p):"",h=="latin1"&&(h=s(d=>d.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),"namefix")),typeof h!="function"&&(h=s(d=>d,"namefix"));let o=s(d=>M.join(p,h(B(localPath,d))),"relPathFix"),f=s(d=>M.win32.basename(M.win32.normalize(h(d))),"fileNameFix");a.fs.open(localPath,"r",function(d){d&&d.code==="ENOENT"?l(void 0,R.Errors.FILE_NOT_FOUND(localPath)):d?l(void 0,d):a.findFilesAsync(localPath,function(S,y){if(S)return l(S);y=y.filter(F=>m(o(F))),y.length||l(void 0,!1),setImmediate(y.reverse().reduce(function(F,T){return function(Z,x){if(Z||x===!1)return setImmediate(F,Z,!1);g.addLocalFileAsync({localPath:T,zipPath:M.dirname(o(T)),zipName:f(T)},F)}},l))})})},"addLocalFolderAsync2"),addLocalFolderPromise:s(function(c,l){return new Promise((g,p)=>{this.addLocalFolderAsync2(Object.assign({localPath:c},l),(m,h)=>{m&&p(m),h&&g(this)})})},"addLocalFolderPromise"),addFile:s(function(c,l,g,p){c=D(c);let m=I(c),h=m!=null;h||(m=new Xr(i),m.entryName=c),m.comment=g||"";let o=typeof p=="object"&&p instanceof a.fs.Stats;o&&(m.header.time=p.mtime);var f=m.isDirectory?16:0;let d=m.isDirectory?16384:32768;return o?d|=4095&p.mode:typeof p=="number"?d|=4095&p:d|=m.isDirectory?493:420,f=(f|d<<16)>>>0,m.attr=f,m.setData(l),h||n.setEntry(m),m},"addFile"),getEntries:s(function(c){return n.password=c,n?n.entries:[]},"getEntries"),getEntry:s(function(c){return I(c)},"getEntry"),getEntryCount:s(function(){return n.getEntryCount()},"getEntryCount"),forEach:s(function(c){return n.forEach(c)},"forEach"),extractEntryTo:s(function(c,l,g,p,m,h){p=Q(!1,p),m=Q(!1,m),g=Q(!0,g),h=_t(m,h);var o=I(c);if(!o)throw R.Errors.NO_ENTRY();var f=u(o.entryName),d=N(l,h&&!o.isDirectory?h:g?f:M.basename(f));if(o.isDirectory){var S=n.getEntryChildren(o);return S.forEach(function(T){if(T.isDirectory)return;var Z=T.getData();if(!Z)throw R.Errors.CANT_EXTRACT_FILE();var x=u(T.entryName),q=N(l,g?x:M.basename(x));let z=m?T.header.fileAttr:void 0;a.writeFileTo(q,Z,p,z)}),!0}var y=o.getData(n.password);if(!y)throw R.Errors.CANT_EXTRACT_FILE();if(a.fs.existsSync(d)&&!p)throw R.Errors.CANT_OVERRIDE();let F=m?c.header.fileAttr:void 0;return a.writeFileTo(d,y,p,F),!0},"extractEntryTo"),test:s(function(c){if(!n)return!1;for(var l in n.entries)try{if(l.isDirectory)continue;var g=n.entries[l].getData(c);if(!g)return!1}catch{return!1}return!0},"test"),extractAllTo:s(function(c,l,g,p){if(g=Q(!1,g),p=_t(g,p),l=Q(!1,l),!n)throw R.Errors.NO_ZIP();n.entries.forEach(function(m){var h=N(c,u(m.entryName));if(m.isDirectory){a.makeDir(h);return}var o=m.getData(p);if(!o)throw R.Errors.CANT_EXTRACT_FILE();let f=g?m.header.fileAttr:void 0;a.writeFileTo(h,o,l,f);try{a.fs.utimesSync(h,m.header.time,m.header.time)}catch{throw R.Errors.CANT_EXTRACT_FILE()}})},"extractAllTo"),extractAllToAsync:s(function(c,l,g,p){if(p=Kr(l,g,p),g=Q(!1,g),l=Q(!1,l),!p)return new Promise((d,S)=>{this.extractAllToAsync(c,l,g,function(y){y?S(y):d(this)})});if(!n){p(R.Errors.NO_ZIP());return}c=M.resolve(c);let m=s(d=>N(c,M.normalize(u(d.entryName))),"getPath"),h=s((d,S)=>new Error(d+': "'+S+'"'),"getError"),o=[],f=[];n.entries.forEach(d=>{d.isDirectory?o.push(d):f.push(d)});for(let d of o){let S=m(d),y=g?d.header.fileAttr:void 0;try{a.makeDir(S),y&&a.fs.chmodSync(S,y),a.fs.utimesSync(S,d.header.time,d.header.time)}catch{p(h("Unable to create folder",S))}}f.reverse().reduce(function(d,S){return function(y){if(y)d(y);else{let F=M.normalize(u(S.entryName)),T=N(c,F);S.getDataAsync(function(Z,x){if(x)d(x);else if(!Z)d(R.Errors.CANT_EXTRACT_FILE());else{let q=g?S.header.fileAttr:void 0;a.writeFileToAsync(T,Z,l,q,function(z){z||d(h("Unable to write file",T)),a.fs.utimes(T,S.header.time,S.header.time,function(ue){ue?d(h("Unable to set times",T)):d()})})}})}}},p)()},"extractAllToAsync"),writeZip:s(function(c,l){if(arguments.length===1&&typeof c=="function"&&(l=c,c=""),!c&&i.filename&&(c=i.filename),!!c){var g=n.compressToBuffer();if(g){var p=a.writeFileTo(c,g,!0);typeof l=="function"&&l(p?null:new Error("failed"),"")}}},"writeZip"),writeZipPromise:s(function(c,l){let{overwrite:g,perm:p}=Object.assign({overwrite:!0},l);return new Promise((m,h)=>{!c&&i.filename&&(c=i.filename),c||h("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(o=>{let f=s(d=>d?m(d):h("ADM-ZIP: Wasn't able to write zip file"),"ret");a.writeFileToAsync(c,o,g,p,f)},h)})},"writeZipPromise"),toBufferPromise:s(function(){return new Promise((c,l)=>{n.toAsyncBuffer(c,l)})},"toBufferPromise"),toBuffer:s(function(c,l,g,p){return typeof c=="function"?(n.toAsyncBuffer(c,l,g,p),null):n.compressToBuffer()},"toBuffer")}}});var co={};Ve(co,{PromptNames:()=>V,__entries:()=>ao,__entry_generators_app:()=>wr});module.exports=xr(co);var Le={};Ve(Le,{PromptNames:()=>V,default:()=>ie});var Er=Te(require("../commonlibs/yeoman-generator/index.js"),1);var me=require("../fiori-generator-shared/dist/index.js");var C=class e{static{s(this,"RepoAppDownloadLogger")}static _logger=me.DefaultLogger;static get logger(){return e._logger}static set logger(t){e._logger=t}static configureLogging(t,r,i,a,n,u){let N=i??new me.LogWrapper(t,r,a,n,u);e.logger=N}};var se=require("../commonlibs/yeoman-ui-types/index.js"),yr=require("../open-ux-shared/feature-toggle/index.js");var We=require("../open-ux-shared/odata-service-inquirer/index.js");var b={ADTQuickDeploy:"adtQuickDeploy",AbapRepository:"abapRepository"},V;(function(e){e.selectedApp="selectedApp",e.systemSelection="systemSelection",e.targetFolder="targetFolder"})(V||(V={}));var qe=Te(require("../commonlibs/i18next/index.js"),1);var ze={error:{telemetry:"Failed to send telemetry data after downloading the application from the SAPUI5 ABAP Repository. {{- error}}",qfaJsonNotFound:"The {{- jsonFileName }} file was not found in the downloaded application. Ensure the downloaded application is properly deployed to the ABAP repository.",replaceWebappFilesError:"An error occurred when replacing files in the downloaded application: {{- error}}. For more information, view the logs.",applicationListFetchError:"An error occurred when fetching the application list: {{- error}}. Check if your application is available in the system.",metadataFetchError:"An error occurred when fetching metadata: {{- error}}. For more information, view the logs.",appConfigGenError:"An error occurred when generating the application configuration: {{- error}}. For more information, view the logs.",endPhase:"An error occurred in the end phase: {{- error}}. For more information, view the logs.",errorProcessingJsonFile:"An error occurred when processing the JSON file: {{- error}}. Check the file is valid.",noAppsDeployed:"No applications deployed to this system can be downloaded.",validationErrors:{invalidMetadataPackage:"Invalid or missing package in the metadata. Check the metadata.",invalidServiceName:"Invalid or missing `serviceName` in `serviceBindingDetails`. Check the `serviceName`.",invalidServiceVersion:"Invalid or missing `serviceVersion` in `serviceBindingDetails`. Check the `serviceVersion`.",invalidMainEntityName:"Invalid or missing `mainEntityName` in `serviceBindingDetails`. Check the `mainEntityName`.",invalidModuleName:"Invalid or missing `moduleName` in serviceBindingDetails. Check the `moduleName`.",invalidRepositoryName:"Invalid or missing `repositoryName` in `serviceBindingDetails`. Check the `repositoryName`."},installationErrors:{npmInstall:"An error occurred in the install phase: {{- error}}. For more information, view the logs.",skippedInstallation:"`--skipInstall` option was specified. Installation of dependencies will be skipped."},appDownloadErrors:{downloadedFileNotBufferError:"Error: The downloaded file is not a buffer. Check the file.",appDownloadFailure:"An error occurred when downloading the application: {{- error}}. For more information, view the logs.",zipExtractionError:"An error occurred when extracting the zip file: {{- error}}. For more information, view the logs.",validationError:"An error occurred when validating the application selection: {{- error}}. For more information, view the logs."},dataSourcesNotFound:"No data sources found in the `manifest.json` file. Check the `manifest.json` file is valid.",qfaJsonValidationFailed:"The {{- jsonFileName}} file contains invalid or missing fields. For more information, view the logs.",eventHookErrors:{vscodeInstanceMissing:"Error: Missing VS Code instance in event hook.",postGenCommandMissing:"Error: Missing `postGenCommand` in event hook.",commandExecutionFailed:"Error executing `postGenCommand` in event hook: {{- error}}"},readManifestErrors:{manifestFileNotFound:"Error: the `manifest.json` file was not found in the downloaded application. Check the file exists.",readManifestFailed:"Error: Failed to read the `manifest.json` file. Check the file is valid.",sapAppNotDefined:"Error: `sap.app` not defined in the `manifest.json` file. Check `sap.app` is defined.",sourceTemplateNotSupported:"Error: Source template not supported. Use a supported template.",invalidManifestStructureError:"Invalid `manifest.json file` structure: `sap.ui5` or `sap.app` are missing. Check they exist."},adtQuickDeployErrors:{noAppsFound:"No application with the ID {{ appId }} was found in the system. Please check if the application is deployed correctly or select another app."},transportCheckFailed:"Transport request resolution failed with error: {{- error}}."},warn:{extractedFileNotFound:"Extracted file not found: {{- extractedFilePath}}. For more information, view the logs.",requiredFieldsMissing:"Required fields are missing for the {{- appId }} application. Check if the application is deployed correctly.",repoInfoFetchFailed:"Could not fetch repository info for '{{- repoName}}': {{- error}}. Deploy configuration may be incomplete."},prompts:{appSelection:{message:"Application",hint:"Select the application to download.",breadcrumb:"Application"},targetPath:{message:"Project Folder Path",breadcrumb:"Project Path"}},readMe:{adtQuickDeploy:{appDescription:"This application was converted from an SAP Fiori application that was deployed from ADT using the ADT Quick Fiori Application generator."},abapRepository:{appDescription:"This application was downloaded from an SAP ABAP repository."},launchText:"To launch the generated application, run the following command from the generated app root folder:\n\n```\n npm start\n```"},info:{adtQuickDeploy:{repoAppDownloadCompleteMsg:"The selected application has been downloaded and updated to support SAP Fiori tools."},abapRepository:{repoAppDownloadCompleteMsg:"After the application is downloaded, the SAP Fiori migration tool launches so that the project can be migrated to support SAP Fiori tools."}}};var Je="repo-app-import-sub-generator",_e=qe.default.createInstance();async function Rr(){await _e.init({lng:"en",fallbackLng:"en",showSupportNotice:!1}),_e.addResourceBundle("en",Je,ze)}s(Rr,"initI18n");function A(e,t){return t?.ns||(t=Object.assign(t??{},{ns:Je})),_e.t(e,t)}s(A,"t");Rr().catch(()=>{});var ce="@sap.adt.sevicebinding.deploy:lrop",Xe={[b.ADTQuickDeploy]:{title:"Download ADT deployed app from SAPUI5 ABAP repository",description:"Download an application that was generated with the ADT Quick SAP Fiori Application generator"},[b.AbapRepository]:{title:"Download app from UI5 ABAP repository",description:"Download app from SAPUI5 ABAP repository"}},fe={[b.ADTQuickDeploy]:{get generatorSuccessMsg(){return A("info.adtQuickDeploy.repoAppDownloadCompleteMsg")},get readMeAppDescription(){return A("readMe.adtQuickDeploy.appDescription")},searchParams:{"sap.app/sourceTemplate/id":ce}},[b.AbapRepository]:{get generatorSuccessMsg(){return A("info.abapRepository.repoAppDownloadCompleteMsg")},get readMeAppDescription(){return A("readMe.abapRepository.appDescription")},searchParams:{"sap.app/type":"application"}}},Fe="@sap-ux/repo-app-import-sub-generator",ge="@sap/generator-fiori:lrop",$="qfa.json",Qe={[V.systemSelection]:{datasourceType:We.DatasourceType.sapSystem},[V.selectedApp]:{appId:"",title:"",description:"",repoName:"",url:""},[V.targetFolder]:""},Ke="extractedFiles",Ye=["sap.app/id","sap.app/title","sap.app/description","sap.app/sourceTemplate/id","repoName","fileType","url"];var Me=require("node:path");var Ot=Te(xt(),1),Rt=require("../open-ux-shared/odata-service-inquirer/index.js");var L=class e{static{s(this,"PromptState")}static _systemSelection={datasourceType:Rt.DatasourceType.sapSystem};static _admZipInstance;static get systemSelection(){return this._systemSelection}static set systemSelection(t){this._systemSelection=t}static set admZip(t){this._admZipInstance=new Ot.default(t)}static get admZip(){return this._admZipInstance}static get baseURL(){return this._systemSelection.connectedSystem?.backendSystem?.url??this._systemSelection.connectedSystem?.destination?.Host}static get sapClient(){return this._systemSelection.connectedSystem?.backendSystem?.client??this._systemSelection.connectedSystem?.destination?.["sap-client"]}static get destinationName(){return this._systemSelection.connectedSystem?.destination?.Name}static get authenticationType(){return this._systemSelection.connectedSystem?.backendSystem?.authenticationType}static reset(){e.systemSelection={},e._admZipInstance=void 0}};var be=require("../open-ux-shared/axios-extension/index.js"),Pt=require("../fiori-generator-shared/dist/index.js");async function Ne(e,t){try{let r=await e.service(t).metadata();return C.logger?.debug("Metadata fetched successfully"),r}catch(r){C.logger?.error(A("error.metadataFetchError",{error:r.message}))}}s(Ne,"fetchServiceMetadata");function Ut(){return L.admZip?.getEntries().filter(t=>t.entryName===$)?.length===1}s(Ut,"hasQfaJson");async function Be(e,t){try{L.admZip?.getEntries().forEach(function(r){if(!r.isDirectory){let i=r.getData().toString("utf8"),a=(0,Me.join)(e,r.entryName);C.logger?.debug(`extractZip: Extracting file: "${a}" with contents: "${i}" .`),t.write((0,Me.join)(e,r.entryName),i)}})}catch(r){C.logger?.error(A("error.appDownloadErrors.zipExtractionError",{error:r.message}))}}s(Be,"extractZip");async function Mt(e){let r=await(L.systemSelection?.connectedSystem?.serviceProvider).getUi5AbapRepository();r.log=C.logger,C.logger?.debug(`App download started: ${e}`);let i=await r.downloadFiles(e);C.logger?.debug(`App download completed: ${e}`),L.admZip=i}s(Mt,"downloadApp");async function De(e,t,r){if(t==="$TMP")return"";(0,Pt.restoreServiceProviderLoggers)(C.logger,e);try{let a=await(await e?.getAdtService(be.TransportChecksService))?.getTransportRequests(t,r);return a?.length===1?a[0].transportNumber:"REPLACE_WITH_TRANSPORT"}catch(i){if(i.message===be.TransportChecksService.LocalPackageError)return"";let a=A("error.transportCheckFailed",{error:i?.message});throw C.logger?.error(a),new Error(a)}}s(De,"resolveTransportRequest");var Se;(function(e){e.GENERATION_SUCCESS="GENERATION_SUCCESS"})(Se||(Se={}));var G=require("../fiori-generator-shared/dist/index.js");var zt=require("../open-ux-shared/odata-service-inquirer/index.js");var qt=require("../open-ux-shared/project-input-validator/index.js");function bt(e){let{title:t,description:r}=Xe[e];return[{name:t,description:r}]}s(bt,"getYUIDetails");var $r=s(e=>{let t=e["sap.app/id"],r=e["sap.app/title"],i=e["sap.app/description"]??"",a=e.repoName,n=e.url;return{name:t,value:{appId:t,title:r,description:i,repoName:a,url:n}}},"extractAppData"),Bt=s(e=>e.filter(t=>{C.logger?.debug(`formatAppChoices: ${JSON.stringify(t)}`);let r=t["sap.app/id"]&&t.repoName&&t.url&&Object.prototype.hasOwnProperty.call(t,"sap.app/title");return r||C.logger?.warn(A("warn.requiredFieldsMissing",{app:t["sap.app/id"]})),r}).map(t=>$r(t)),"formatAppChoices");async function eo(e,t,r=b.ADTQuickDeploy){try{let i=fe[r].searchParams,a=t?{...i,"sap.app/id":t}:i,n=await e.getAppIndex().search(a,Ye);return r===b.AbapRepository?n.filter(u=>u["sap.app/sourceTemplate/id"]!==ce):n}catch(i){return C.logger?.error(A("error.applicationListFetchError",{error:i.message})),[]}}s(eo,"getAppList");async function Ht(e,t,r=b.ADTQuickDeploy){return e?.serviceProvider?(L.systemSelection={connectedSystem:e},await eo(e.serviceProvider,t,r)):[]}s(Ht,"fetchAppListForSelectedSystem");var jt=require("../open-ux-shared/guided-answers-helper/index.js"),Ce=require("../open-ux-shared/inquirer-common/index.js");var kt=require("../commonlibs/yeoman-ui-types/index.js");var to=s(e=>!e.package||typeof e.package!="string"?(C.logger?.error(A("error.validationErrors.invalidMetadataPackage")),!1):!0,"validateMetadata"),ro=s(e=>!e.serviceName||typeof e.serviceName!="string"?(C.logger?.error(A("error.validationErrors.invalidServiceName")),!1):!e.serviceVersion||typeof e.serviceVersion!="string"?(C.logger?.error(A("error.validationErrors.invalidServiceVersion")),!1):!e.mainEntityName||typeof e.mainEntityName!="string"?(C.logger?.error(A("error.validationErrors.invalidMainEntityName")),!1):!0,"validateServiceBindingDetails"),oo=s(e=>!e.moduleName||typeof e.moduleName!="string"?(C.logger?.error(A("error.validationErrors.invalidModuleName")),!1):!0,"validateProjectAttribute"),no=s(e=>e.repositoryName?!0:(C.logger?.error(A("error.validationErrors.invalidRepositoryName")),!1),"validateDeploymentDetails"),Vt=s(e=>to(e.metadata)&&ro(e.serviceBindingDetails)&&oo(e.projectAttribute)&&no(e.deploymentDetails),"validateQfaJsonFile"),Gt=s((e,t)=>!!(L.systemSelection.connectedSystem?.serviceProvider&&t&&e),"isValidPromptState");async function Zt(){return Ce.ErrorHandler.getHelpLink(jt.HELP_NODES.ADT_APP_NOT_FOUND_ERROR,Ce.ERROR_TYP