@dd-code/uni-tools 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var e=require("@dd-code/shared"),o=require("path");require("fs"),require("crypto");var r=require("child_process");"function"==typeof SuppressedError&&SuppressedError;o.join(process.cwd(),"node_modules/@dd-code/uni-files"),o.join(process.cwd(),"node_modules/@dd-code/current-files");var n,i=function(e){var o=function(e){return(0,require("vite").loadEnv)(e,process.cwd(),"MFE_")}(e||"dev"),r=o.MFE_UNI_IS_ROOT;return{isRoot:r,appCode:r?"main":o.MFE_APP_CODE,code:o.MFE_UNI_CODE,mode:e}};!function(e){e.INIT="init_files",e.CHANGE="change_files"}(n||(n={}));var c=function(e){return e.option("-p <platform>","平台","h5").option("--mode <mode>","模式","development")},
|
|
2
|
+
"use strict";var e=require("@dd-code/shared"),o=require("path");require("fs"),require("crypto");var r=require("child_process");"function"==typeof SuppressedError&&SuppressedError;o.join(process.cwd(),"node_modules/@dd-code/uni-files"),o.join(process.cwd(),"node_modules/@dd-code/current-files");var n,i=function(e){var o=function(e){return(0,require("vite").loadEnv)(e,process.cwd(),"MFE_")}(e||"dev"),r=o.MFE_UNI_IS_ROOT;return{isRoot:r,appCode:r?"main":o.MFE_APP_CODE,code:o.MFE_UNI_CODE,mode:e,cdn:o.MFE_CDN_HOST}};!function(e){e.INIT="init_files",e.CHANGE="change_files"}(n||(n={}));var c=function(e){return e.option("-p <platform>","平台","h5").option("--mode <mode>","模式","development")},d=e.program.name("uni-tools").command("serve").description("uni 工具方法"),t=e.program.command("build").description("构建 uni 项目");c(d).action(function(e){var o=e.mode,n=e.p,c=i(o),d=c.isRoot,t=c.appCode;switch(n){case"h5":break;case"mp-weixin":!function(e,o){var n=o.isRoot,i=o.appCode,c="uni ".concat(e," ").concat(n?"":"--subpackage=".concat(i));r.execSync(c,{stdio:"inherit"})}("uni -p ".concat(n," --mode ").concat(o),{isRoot:d,appCode:t})}}),c(t).action(function(e){}),e.program.parseAsync(process.argv);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var path=require("path"),fs$1=require("fs"),crypto=require("crypto"),require$$0=require("readline"),require$$4=require("events"),require$$0$1=require("constants"),require$$0$2=require("stream"),require$$4$1=require("util"),require$$5=require("assert"),node_events=require("node:events"),node_fs=require("node:fs"),promises=require("node:fs/promises"),sp=require("node:path"),node_stream=require("node:stream"),node_os=require("node:os"),WebSocket=require("ws"),express=require("express"),http=require("http");function _interopNamespaceDefault(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var sp__namespace=_interopNamespaceDefault(sp),__assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},__assign.apply(this,arguments)};function __awaiter(e,t,r,i){return new(r||(r=Promise))(function(n,s){function u(e){try{o(i.next(e))}catch(e){s(e)}}function a(e){try{o(i.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(u,a)}o((i=i.apply(e,t||[])).next())})}function __generator(e,t){var r,i,n,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(o){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(s=0)),s;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}}function __spreadArray(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var MFE_NAME="mfe.json";function fetchFileByPath(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,7,,8]),[4,fetch(e)];case 1:if(t=r.sent(),!e.split("?")[0].endsWith(".json"))return[3,5];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,t.json()];case 3:return[2,r.sent()];case 4:return r.sent(),[3,5];case 5:return[4,t.text()];case 6:return[2,r.sent()];case 7:return r.sent(),[3,8];case 8:return[2]}})})}function uniReadFile(e){try{return e.endsWith(".json")?require(e):fs$1.readFileSync(e,"utf-8")}catch(e){}return""}function writeFiles(e,t){"object"==typeof t&&t&&(t=JSON.stringify(t,null,2));var r=path.dirname(e);return fs$1.existsSync(r)||fs$1.mkdirSync(r,{recursive:!0}),fs$1.writeFileSync(e,t,"utf-8")}var checkAndgenreDir=function(e){fs$1.existsSync(e)||fs$1.mkdirSync(e,{recursive:!0})},loadViteConfig=function(e){return(0,require("vite").loadEnv)(e,process.cwd(),"MFE_")},walkDir=function(e,t){var r=path.isAbsolute(e)?e:path.resolve(process.cwd(),e),i=[],n=function(e){(fs$1.existsSync(e)?fs$1.readdirSync(e):[]).forEach(function(t){var s=path.join(e,t);fs$1.statSync(s).isDirectory()?n(s):i.push(path.relative(r,s))})};return n(r),Array.from(new Set(Array.from(t).concat(i))).sort()};function generateHash(e,t,r){if(void 0===e&&(e=""),void 0===r&&(r="hex"),"string"!=typeof e)throw new Error("Content must be a string");var i=crypto.createHash(t);return i.update(e,"utf8"),i.digest(r)}function generateSHA256(e){return generateHash(e,"sha256")}var UniCdnManager=function(){function e(){this.HOST=""}return e.prototype.getCdnUrl=function(e){var t=e.code,r=e.mode,i=e.appCode;return this.HOST=this.HOST||loadViteConfig(r||"dev").MFE_CDN_HOST,["".concat(this.HOST),getManifestCdnDirUrl({mode:r,code:t,appCode:i})]},e.prototype.getManifestUrl=function(e){var t=e.code,r=e.appCode,i=e.mode;return __spreadArray(__spreadArray([],this.getCdnUrl({code:t,mode:i,appCode:r}),!0),["".concat(MANIFEST_NAME)],!1).join("/")},e}(),cdn=new UniCdnManager,SAVE_CDN_FILE_PATH=path.join(process.cwd(),"node_modules/@dd-code/uni-files");path.join(process.cwd(),"node_modules/@dd-code/current-files");var MANIFEST_NAME="mfe-uni-manifest.json",ROOT_APP_CODE="main",MANIFEST_CND_DIR_URL="{mode}/static-repository/mfe-uni/{code}/{appCode}",getManifestCdnDirUrl=function(e){var t=e.mode,r=e.code,i=e.appCode;return MANIFEST_CND_DIR_URL.replace("{mode}",t).replace("{code}",r).replace("{appCode}",i)},getMfeJson=function(){var e=uniReadFile(path.resolve(process.cwd(),MFE_NAME))||{};return e.platform=process.env.UNI_PLATFORM||"h5",e},getMainAppJson=function(e){return __awaiter(void 0,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return t=formatCliCommandConfig(e),[4,fetchFileByPath(cdn.getManifestUrl({code:t.code,appCode:ROOT_APP_CODE,mode:e}))];case 1:return[2,r.sent()]}})})},getMainAppPages=function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,getMainAppJson(e)];case 1:return[2,t.sent().apps||[{appCode:"modules/bwzb"},{appCode:"modules/manage"},{appCode:"login"}]]}})})},getPlatform=function(){return process.env.UNI_PLATFORM||"h5"},formatCliCommandConfig=function(e){var t=loadViteConfig(e||"dev"),r=t.MFE_UNI_IS_ROOT;return{isRoot:r,appCode:r?ROOT_APP_CODE:t.MFE_APP_CODE,code:t.MFE_UNI_CODE,mode:e}},checkIsRootManifest=function(e){return e.isRoot||e.appCode===ROOT_APP_CODE},WS_PORT=3560,WS_PATH="/__mfe__ws__",E_WS_TYPE;!function(e){e.INIT="init_files",e.CHANGE="change_files"}(E_WS_TYPE||(E_WS_TYPE={}));var getMainAppJSon=function(e,t){return path.join(SAVE_CDN_FILE_PATH,e||"dev",t,"app.json")},getMainAppJsonPath=function(){return path.join(process.env.UNI_OUTPUT_DIR,"app.json")},EPlaform;!function(e){e.H5="h5",e.MP_WEIXIN="mp-weixin"}(EPlaform||(EPlaform={}));var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},eta,hasRequiredEta,terminal,hasRequiredTerminal;function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function requireEta(){if(hasRequiredEta)return eta;hasRequiredEta=1;return eta=class{constructor(e,t,r){this.etaBufferLength=e||100,this.valueBuffer=[r],this.timeBuffer=[t],this.eta="0"}update(e,t,r){this.valueBuffer.push(t),this.timeBuffer.push(e),this.calculate(r-t)}getTime(){return this.eta}calculate(e){const t=this.valueBuffer.length,r=Math.min(this.etaBufferLength,t),i=(this.valueBuffer[t-1]-this.valueBuffer[t-r])/(this.timeBuffer[t-1]-this.timeBuffer[t-r]);this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);const n=Math.ceil(e/i/1e3);isNaN(n)?this.eta="NULL":isFinite(n)?this.eta=n>1e7?"INF":n<0?0:n:this.eta="INF"}}}function requireTerminal(){if(hasRequiredTerminal)return terminal;hasRequiredTerminal=1;const e=require$$0;return terminal=class{constructor(e){this.stream=e,this.linewrap=!0,this.dy=0}cursorSave(){this.stream.isTTY&&this.stream.write("7")}cursorRestore(){this.stream.isTTY&&this.stream.write("8")}cursor(e){this.stream.isTTY&&(e?this.stream.write("[?25h"):this.stream.write("[?25l"))}cursorTo(t=null,r=null){this.stream.isTTY&&e.cursorTo(this.stream,t,r)}cursorRelative(t=null,r=null){this.stream.isTTY&&(this.dy=this.dy+r,e.moveCursor(this.stream,t,r))}cursorRelativeReset(){this.stream.isTTY&&(e.moveCursor(this.stream,0,-this.dy),e.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&e.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&e.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&e.clearScreenDown(this.stream)}newline(){this.stream.write("\n"),this.dy++}write(e,t=!1){!0===this.linewrap&&!1===t?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("[?7h"):this.stream.write("[?7l"))}isTTY(){return!0===this.stream.isTTY}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}}}var stringWidth={exports:{}},ansiRegex,hasRequiredAnsiRegex,stripAnsi,hasRequiredStripAnsi;function requireAnsiRegex(){return hasRequiredAnsiRegex?ansiRegex:(hasRequiredAnsiRegex=1,ansiRegex=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")})}function requireStripAnsi(){if(hasRequiredStripAnsi)return stripAnsi;hasRequiredStripAnsi=1;const e=requireAnsiRegex();return stripAnsi=t=>"string"==typeof t?t.replace(e(),""):t}var isFullwidthCodePoint={exports:{}},hasRequiredIsFullwidthCodePoint,emojiRegex,hasRequiredEmojiRegex,hasRequiredStringWidth,formatValue,hasRequiredFormatValue,formatBar,hasRequiredFormatBar,formatTime,hasRequiredFormatTime,formatter,hasRequiredFormatter,options,hasRequiredOptions,genericBar,hasRequiredGenericBar,singleBar,hasRequiredSingleBar,multiBar,hasRequiredMultiBar,legacy,hasRequiredLegacy,shadesClassic,hasRequiredShadesClassic,shadesGrey,hasRequiredShadesGrey,rect,hasRequiredRect,presets,hasRequiredPresets,cliProgress,hasRequiredCliProgress;function requireIsFullwidthCodePoint(){if(hasRequiredIsFullwidthCodePoint)return isFullwidthCodePoint.exports;hasRequiredIsFullwidthCodePoint=1;const e=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141));return isFullwidthCodePoint.exports=e,isFullwidthCodePoint.exports.default=e,isFullwidthCodePoint.exports}function requireEmojiRegex(){return hasRequiredEmojiRegex?emojiRegex:(hasRequiredEmojiRegex=1,emojiRegex=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g})}function requireStringWidth(){if(hasRequiredStringWidth)return stringWidth.exports;hasRequiredStringWidth=1;const e=requireStripAnsi(),t=requireIsFullwidthCodePoint(),r=requireEmojiRegex(),i=i=>{if("string"!=typeof i||0===i.length)return 0;if(0===(i=e(i)).length)return 0;i=i.replace(r()," ");let n=0;for(let e=0;e<i.length;e++){const r=i.codePointAt(e);r<=31||r>=127&&r<=159||(r>=768&&r<=879||(r>65535&&e++,n+=t(r)?2:1))}return n};return stringWidth.exports=i,stringWidth.exports.default=i,stringWidth.exports}function requireFormatValue(){return hasRequiredFormatValue||(hasRequiredFormatValue=1,formatValue=function(e,t,r){if(!0!==t.autopadding)return e;return"percentage"===r?(i=e,(t.autopaddingChar+i).slice(-3)):e;var i}),formatValue}function requireFormatBar(){return hasRequiredFormatBar||(hasRequiredFormatBar=1,formatBar=function(e,t){const r=Math.round(e*t.barsize),i=t.barsize-r;return t.barCompleteString.substr(0,r)+t.barGlue+t.barIncompleteString.substr(0,i)}),formatBar}function requireFormatTime(){return hasRequiredFormatTime||(hasRequiredFormatTime=1,formatTime=function(e,t,r){function i(e){return r?r*Math.round(e/r):e}function n(e){return(t.autopaddingChar+e).slice(-2)}return e>3600?n(Math.floor(e/3600))+"h"+n(i(e%3600/60))+"m":e>60?n(Math.floor(e/60))+"m"+n(i(e%60))+"s":e>10?n(i(e))+"s":n(e)+"s"}),formatTime}function requireFormatter(){if(hasRequiredFormatter)return formatter;hasRequiredFormatter=1;const e=requireStringWidth(),t=requireFormatValue(),r=requireFormatBar(),i=requireFormatTime();return formatter=function(n,s,u){let a=n.format;const o=n.formatTime||i,c=n.formatValue||t,l=n.formatBar||r,D=Math.floor(100*s.progress)+"",h=s.stopTime||Date.now(),p=Math.round((h-s.startTime)/1e3),d=Object.assign({},u,{bar:l(s.progress,n),percentage:c(D,n,"percentage"),total:c(s.total,n,"total"),value:c(s.value,n,"value"),eta:c(s.eta,n,"eta"),eta_formatted:o(s.eta,n,5),duration:c(p,n,"duration"),duration_formatted:o(p,n,1)});a=a.replace(/\{(\w+)\}/g,function(e,t){return void 0!==d[t]?d[t]:e});const f=Math.max(0,s.maxWidth-e(a)-2),m=Math.floor(f/2);switch(n.align){case"right":a=f>0?" ".repeat(f)+a:a;break;case"center":a=m>0?" ".repeat(m)+a:a}return a},formatter}function requireOptions(){if(hasRequiredOptions)return options;function e(e,t){return null==e?t:e}return hasRequiredOptions=1,options={parse:function(t,r){const i={},n=Object.assign({},r,t);return i.throttleTime=1e3/e(n.fps,10),i.stream=e(n.stream,process.stderr),i.terminal=e(n.terminal,null),i.clearOnComplete=e(n.clearOnComplete,!1),i.stopOnComplete=e(n.stopOnComplete,!1),i.barsize=e(n.barsize,40),i.align=e(n.align,"left"),i.hideCursor=e(n.hideCursor,!1),i.linewrap=e(n.linewrap,!1),i.barGlue=e(n.barGlue,""),i.barCompleteChar=e(n.barCompleteChar,"="),i.barIncompleteChar=e(n.barIncompleteChar,"-"),i.format=e(n.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),i.formatTime=e(n.formatTime,null),i.formatValue=e(n.formatValue,null),i.formatBar=e(n.formatBar,null),i.etaBufferLength=e(n.etaBuffer,10),i.etaAsynchronousUpdate=e(n.etaAsynchronousUpdate,!1),i.progressCalculationRelative=e(n.progressCalculationRelative,!1),i.synchronousUpdate=e(n.synchronousUpdate,!0),i.noTTYOutput=e(n.noTTYOutput,!1),i.notTTYSchedule=e(n.notTTYSchedule,2e3),i.emptyOnZero=e(n.emptyOnZero,!1),i.forceRedraw=e(n.forceRedraw,!1),i.autopadding=e(n.autopadding,!1),i.gracefulExit=e(n.gracefulExit,!1),i},assignDerivedOptions:function(t){return t.barCompleteString=t.barCompleteChar.repeat(t.barsize+1),t.barIncompleteString=t.barIncompleteChar.repeat(t.barsize+1),t.autopaddingChar=t.autopadding?e(t.autopaddingChar," "):"",t}}}function requireGenericBar(){if(hasRequiredGenericBar)return genericBar;hasRequiredGenericBar=1;const e=requireEta(),t=requireTerminal(),r=requireFormatter(),i=requireOptions(),n=require$$4;return genericBar=class extends n{constructor(n){super(),this.options=i.assignDerivedOptions(n),this.terminal=this.options.terminal?this.options.terminal:new t(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new e(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter="function"==typeof this.options.format?this.options.format:r}render(e=!1){const t={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();const r=this.formatter(this.options,t,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=r)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(r),this.terminal.clearRight(),this.lastDrawnString=r,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(t,r,i){this.value=r||0,this.total=void 0!==t&&t>=0?t:100,this.startValue=r||0,this.payload=i||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new e(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",t,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,t={}){"number"==typeof e&&(this.value=e,this.eta.update(Date.now(),e,this.total));const r=("object"==typeof e?e:t)||{};this.emit("update",this.total,this.value);for(const e in r)this.payload[e]=r[e];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,t={}){"object"==typeof e?this.update(this.value+1,e):this.update(this.value+e,t)}getTotal(){return this.total}setTotal(e){void 0!==e&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}},genericBar}function requireSingleBar(){if(hasRequiredSingleBar)return singleBar;hasRequiredSingleBar=1;const e=requireGenericBar(),t=requireOptions();return singleBar=class extends e{constructor(e,r){super(t.parse(e,r)),this.timer=null,this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,t){this.timer&&(super.update(e,t),this.options.synchronousUpdate&&this.lastRedraw+2*this.options.throttleTime<Date.now()&&this.render())}start(e,t,r){!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),super.start(e,t,r),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}},singleBar}function requireMultiBar(){if(hasRequiredMultiBar)return multiBar;hasRequiredMultiBar=1;const e=requireTerminal(),t=requireGenericBar(),r=requireOptions(),i=require$$4;return multiBar=class extends i{constructor(t,i){super(),this.bars=[],this.options=r.parse(t,i),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new e(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,r,i,n={}){const s=new t(Object.assign({},this.options,{terminal:this.terminal},n));return this.bars.push(s),!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,s.start(e,r,i),this.emit("start")),s}remove(e){const t=this.bars.indexOf(e);return!(t<0)&&(this.bars.splice(t,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}},multiBar}function requireLegacy(){return hasRequiredLegacy?legacy:(hasRequiredLegacy=1,legacy={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"})}function requireShadesClassic(){return hasRequiredShadesClassic?shadesClassic:(hasRequiredShadesClassic=1,shadesClassic={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"})}function requireShadesGrey(){return hasRequiredShadesGrey?shadesGrey:(hasRequiredShadesGrey=1,shadesGrey={format:" [90m{bar}[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"})}function requireRect(){return hasRequiredRect?rect:(hasRequiredRect=1,rect={format:" {bar}■ {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"■",barIncompleteChar:" "})}function requirePresets(){if(hasRequiredPresets)return presets;hasRequiredPresets=1;const e=requireLegacy(),t=requireShadesClassic(),r=requireShadesGrey(),i=requireRect();return presets={legacy:e,shades_classic:t,shades_grey:r,rect:i}}function requireCliProgress(){if(hasRequiredCliProgress)return cliProgress;hasRequiredCliProgress=1;const e=requireSingleBar(),t=requireMultiBar(),r=requirePresets(),i=requireFormatter(),n=requireFormatValue(),s=requireFormatBar(),u=requireFormatTime();return cliProgress={Bar:e,SingleBar:e,MultiBar:t,Presets:r,Format:{Formatter:i,BarFormat:s,ValueFormat:n,TimeFormat:u}}}var cliProgressExports=requireCliProgress();const ANSI_BACKGROUND_OFFSET=10,wrapAnsi16=(e=0)=>t=>`[${t+e}m`,wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`,wrapAnsi16m=(e=0)=>(t,r,i)=>`[${38+e};2;${t};${r};${i}m`,styles$1={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles$1.modifier);const foregroundColorNames=Object.keys(styles$1.color),backgroundColorNames=Object.keys(styles$1.bgColor);function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(styles$1)){for(const[t,i]of Object.entries(r))styles$1[t]={open:`[${i[0]}m`,close:`[${i[1]}m`},r[t]=styles$1[t],e.set(i[0],i[1]);Object.defineProperty(styles$1,t,{value:r,enumerable:!1})}return Object.defineProperty(styles$1,"codes",{value:e,enumerable:!1}),styles$1.color.close="[39m",styles$1.bgColor.close="[49m",styles$1.color.ansi=wrapAnsi16(),styles$1.color.ansi256=wrapAnsi256(),styles$1.color.ansi16m=wrapAnsi16m(),styles$1.bgColor.ansi=wrapAnsi16(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi256=wrapAnsi256(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi16m=wrapAnsi16m(ANSI_BACKGROUND_OFFSET),Object.defineProperties(styles$1,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,255&i]},enumerable:!1},hexToAnsi256:{value:e=>styles$1.rgbToAnsi256(...styles$1.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,i;if(e>=232)t=(10*(e-232)+8)/255,r=t,i=t;else{const n=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(n/6)/5,i=n%6/5}const n=2*Math.max(t,r,i);if(0===n)return 30;let s=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return 2===n&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(e)),enumerable:!1}}),styles$1}const ansiStyles=assembleStyles(),level=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),colorSupport=0!==level&&{level:level},supportsColor={stdout:colorSupport,stderr:colorSupport};function stringReplaceAll(e,t,r){let i=e.indexOf(t);if(-1===i)return e;const n=t.length;let s=0,u="";do{u+=e.slice(s,i)+t+r,s=i+n,i=e.indexOf(t,s)}while(-1!==i);return u+=e.slice(s),u}function stringEncaseCRLFWithFirstIndex(e,t,r,i){let n=0,s="";do{const u="\r"===e[i-1];s+=e.slice(n,u?i-1:i)+t+(u?"\r\n":"\n")+r,n=i+1,i=e.indexOf("\n",n)}while(-1!==i);return s+=e.slice(n),s}const{stdout:stdoutColor,stderr:stderrColor}=supportsColor,GENERATOR=Symbol("GENERATOR"),STYLER=Symbol("STYLER"),IS_EMPTY=Symbol("IS_EMPTY"),levelMapping=["ansi","ansi","ansi256","ansi16m"],styles=Object.create(null),applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=stdoutColor?stdoutColor.level:0;e.level=void 0===t.level?r:t.level},chalkFactory=e=>{const t=(...e)=>e.join(" ");return applyOptions(t,e),Object.setPrototypeOf(t,createChalk.prototype),t};function createChalk(e){return chalkFactory(e)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[e,t]of Object.entries(ansiStyles))styles[e]={get(){const r=createBuilder(this,createStyler(t.open,t.close,this[STYLER]),this[IS_EMPTY]);return Object.defineProperty(this,e,{value:r}),r}};styles.visible={get(){const e=createBuilder(this,this[STYLER],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const getModelAnsi=(e,t,r,...i)=>"rgb"===e?"ansi16m"===t?ansiStyles[r].ansi16m(...i):"ansi256"===t?ansiStyles[r].ansi256(ansiStyles.rgbToAnsi256(...i)):ansiStyles[r].ansi(ansiStyles.rgbToAnsi(...i)):"hex"===e?getModelAnsi("rgb",t,r,...ansiStyles.hexToRgb(...i)):ansiStyles[r][e](...i),usedModels=["rgb","hex","ansi256"];for(const e of usedModels){styles[e]={get(){const{level:t}=this;return function(...r){const i=createStyler(getModelAnsi(e,levelMapping[t],"color",...r),ansiStyles.color.close,this[STYLER]);return createBuilder(this,i,this[IS_EMPTY])}}};const t="bg"+e[0].toUpperCase()+e.slice(1);styles[t]={get(){const{level:t}=this;return function(...r){const i=createStyler(getModelAnsi(e,levelMapping[t],"bgColor",...r),ansiStyles.bgColor.close,this[STYLER]);return createBuilder(this,i,this[IS_EMPTY])}}}}const proto=Object.defineProperties(()=>{},{...styles,level:{enumerable:!0,get(){return this[GENERATOR].level},set(e){this[GENERATOR].level=e}}}),createStyler=(e,t,r)=>{let i,n;return void 0===r?(i=e,n=t):(i=r.openAll+e,n=t+r.closeAll),{open:e,close:t,openAll:i,closeAll:n,parent:r}},createBuilder=(e,t,r)=>{const i=(...e)=>applyStyle(i,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(i,proto),i[GENERATOR]=e,i[STYLER]=t,i[IS_EMPTY]=r,i},applyStyle=(e,t)=>{if(e.level<=0||!t)return e[IS_EMPTY]?"":t;let r=e[STYLER];if(void 0===r)return t;const{openAll:i,closeAll:n}=r;if(t.includes(""))for(;void 0!==r;)t=stringReplaceAll(t,r.close,r.open),r=r.parent;const s=t.indexOf("\n");return-1!==s&&(t=stringEncaseCRLFWithFirstIndex(t,n,i,s)),i+t+n};Object.defineProperties(createChalk.prototype,styles);const chalk=createChalk();createChalk({level:stderrColor?stderrColor.level:0});var CliProgressManager=function(){function e(){this.barMap=new Map}return e.prototype.initMultiBar=function(e){this.multiBar=new cliProgressExports.MultiBar({clearOnComplete:!1,hideCursor:!0,format:e||"".concat(chalk.yellow("{name}"),": ").concat(chalk.blue("{bar}")," | ").concat(chalk.green("{percentage}%")," | {value}/{total}"),barCompleteChar:"█",barIncompleteChar:"░",barGlue:"",stopOnComplete:!0},cliProgressExports.Presets.shades_grey)},e.prototype.createProgressBar=function(e){var t=this;e.forEach(function(e){var r=t.multiBar.create(e.total,0,{name:e.name});t.barMap.set(e.name,r)})},e.prototype.updateProgressBar=function(e,t){var r=this.barMap.get(e);if(r){var i=r.getTotal();r.update(t),t>=i&&r.stop()}},e.prototype.stopAll=function(){this.multiBar.stop()},e}(),CliProgressManager$1=new CliProgressManager,getDownloadedFilePath=function(e){return path.resolve(SAVE_CDN_FILE_PATH,e.env,e.appCode)},getNodeModulesEnvAppCodeFilePath=function(e,t){return path.resolve(getDownloadedFilePath(e),t)},getManifestJsonUrl=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i,n,s,u,a,o;return __generator(this,function(c){switch(c.label){case 0:t=formatCliCommandConfig(e),r=t.isRoot,i=void 0!==r&&r,n=t.code,s=void 0===n?"mfe-uni":n,u=[],a=getMfeJson(),c.label=1;case 1:return c.trys.push([1,5,,6]),o=[],i?(o=a.apps||[],[3,4]):[3,2];case 2:return[4,getMainAppPages(e)];case 3:o=__spreadArray(__spreadArray([],o=c.sent(),!0),[{appCode:ROOT_APP_CODE}],!1),c.label=4;case 4:return u=Array.from(new Set(__spreadArray([],(o||[]).map(function(e){return e.appCode}),!0))),[3,6];case 5:return c.sent(),u=[],[3,6];case 6:return[2,u.map(function(t){return{url:cdn.getManifestUrl({code:s,appCode:t,mode:e}),appCode:t,code:s}})]}})})},downloadManifestJson=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r;return __generator(this,function(i){switch(i.label){case 0:return t=e.map(function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,fetchFileByPath(e).catch(function(e){})];case 1:return[2,t.sent()]}})})}),[4,Promise.all(t)];case 1:return r=i.sent(),[2,r.filter(function(e){return e})]}})})};function downloadFilesByManifestJson(e,t,r){return __awaiter(this,void 0,void 0,function(){var i,n,s,u,a,o,c,l,D,h,p,d,f;return __generator(this,function(m){switch(m.label){case 0:for(c in i=e.cdn,n=e.appCode,s=e.publicPath,u=e.files,o=[],a=u)o.push(c);l=0,m.label=1;case 1:return l<o.length?(c=o[l])in a?(h=u[D=c],p=h.fileUrl,d=h.fileName,[4,fetchFileByPath("".concat(i,"/").concat(s,"/").concat(p))]):[3,3]:[3,4];case 2:f=m.sent(),writeFiles(path.join(t,n||"",d),f),r&&r(Number(D),h.length),m.label=3;case 3:return l++,[3,1];case 4:return[2]}})})}var downloadProjectFiles=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i;return __generator(this,function(n){switch(n.label){case 0:for(i in t=[],CliProgressManager$1.initMultiBar(),CliProgressManager$1.createProgressBar(e.map(function(e){return{name:e.appCode,total:e.files.length}})),r=function(r){var i=e[r],n=downloadFilesByManifestJson(i,path.resolve(SAVE_CDN_FILE_PATH,i.mode||"dev"),function(e,t){CliProgressManager$1.updateProgressBar(i.appCode,e+1)});t.push(n)},e)r(i);return[4,Promise.all(t)];case 1:return n.sent(),CliProgressManager$1.stopAll(),[2]}})})},checkDownloadFilesIsExpired=function(e){return e.filter(function(e){var t=uniReadFile(getNodeModulesEnvAppCodeFilePath(e,MANIFEST_NAME));return!t||(null==t?void 0:t.hash)!==e.hash})},createManifestManager=function(){var e=process.env,t={code:"",mode:"",cdn:cdn.HOST,hash:"",publicPath:"",appCode:"",platform:e.UNI_PLATFORM||"h5",pagesJson:{},files:[]};return{get value(){return t},setFiles:function(e,r){var i=r.map(function(t){var r=path.resolve(e,t),i=generateSHA256(fs$1.readFileSync(r,"utf-8"));return{fileName:t,fileUrl:"".concat(i.slice(0,8),"_").concat(path.basename(t))}});t.files=i},setPagesJson:function(e){t.pagesJson=e},saveFile:function(e){var r=t.files.filter(function(e){return e.fileName!==MANIFEST_NAME});t.hash=generateSHA256(JSON.stringify(__assign(__assign({},t),{files:r}))),writeFiles(path.resolve(e,MANIFEST_NAME),JSON.stringify(t,null,2))},setEnv:function(e){var r=formatCliCommandConfig(e),i=getMfeJson();t.mode=e,t.code=r.code,t.appCode=r.appCode,r.isRoot&&(t.isRoot=!0,t.apps=i.apps),t.publicPath=getManifestCdnDirUrl(t)},dependencies:[],setDependencies:function(e){this.dependencies=e}}},resetOutDir=function(e,t){var r,i=new RegExp("/(".concat(e.value.appCode,")/?"));process.env.MFE_SOURCE_OUTPUT_DIR=t.build.outDir,process.env.MFE_ROOT_OUTPUT_DIR=null===(r=process.env.MFE_SOURCE_OUTPUT_DIR)||void 0===r?void 0:r.replace(i,"/").replace(/\/$/,""),process.env.UNI_OUTPUT_DIR=process.env.MFE_ROOT_OUTPUT_DIR},fs={},universalify={},hasRequiredUniversalify,polyfills,hasRequiredPolyfills,legacyStreams,hasRequiredLegacyStreams,clone_1,hasRequiredClone,gracefulFs,hasRequiredGracefulFs,hasRequiredFs;function requireUniversalify(){return hasRequiredUniversalify||(hasRequiredUniversalify=1,universalify.fromCallback=function(e){return Object.defineProperty(function(...t){if("function"!=typeof t[t.length-1])return new Promise((r,i)=>{t.push((e,t)=>null!=e?i(e):r(t)),e.apply(this,t)});e.apply(this,t)},"name",{value:e.name})},universalify.fromPromise=function(e){return Object.defineProperty(function(...t){const r=t[t.length-1];if("function"!=typeof r)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>r(null,e),r)},"name",{value:e.name})}),universalify}function requirePolyfills(){if(hasRequiredPolyfills)return polyfills;hasRequiredPolyfills=1;var e=require$$0$1,t=process.cwd,r=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return r||(r=t.call(process)),r};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var n=process.chdir;process.chdir=function(e){r=null,n.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,n)}return polyfills=function(t){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(r,i,n){t.open(r,e.O_WRONLY|e.O_SYMLINK,i,function(e,r){e?n&&n(e):t.fchmod(r,i,function(e){t.close(r,function(t){n&&n(e||t)})})})},t.lchmodSync=function(r,i){var n,s=t.openSync(r,e.O_WRONLY|e.O_SYMLINK,i),u=!0;try{n=t.fchmodSync(s,i),u=!1}finally{if(u)try{t.closeSync(s)}catch(e){}else t.closeSync(s)}return n}}(t);t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(r,i,n,s){t.open(r,e.O_SYMLINK,function(e,r){e?s&&s(e):t.futimes(r,i,n,function(e){t.close(r,function(t){s&&s(e||t)})})})},t.lutimesSync=function(r,i,n){var s,u=t.openSync(r,e.O_SYMLINK),a=!0;try{s=t.futimesSync(u,i,n),a=!1}finally{if(a)try{t.closeSync(u)}catch(e){}else t.closeSync(u)}return s}):t.futimes&&(t.lutimes=function(e,t,r,i){i&&process.nextTick(i)},t.lutimesSync=function(){})}(t);t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=u(t.chownSync),t.fchownSync=u(t.fchownSync),t.lchownSync=u(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=o(t.statSync),t.fstatSync=o(t.fstatSync),t.lstatSync=o(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(e,t,r){r&&process.nextTick(r)},t.lchmodSync=function(){});t.chown&&!t.lchown&&(t.lchown=function(e,t,r,i){i&&process.nextTick(i)},t.lchownSync=function(){});"win32"===i&&(t.rename="function"!=typeof t.rename?t.rename:function(e){function r(r,i,n){var s=Date.now(),u=0;e(r,i,function a(o){if(o&&("EACCES"===o.code||"EPERM"===o.code||"EBUSY"===o.code)&&Date.now()-s<6e4)return setTimeout(function(){t.stat(i,function(t,s){t&&"ENOENT"===t.code?e(r,i,a):n(o)})},u),void(u<100&&(u+=10));n&&n(o)})}return Object.setPrototypeOf&&Object.setPrototypeOf(r,e),r}(t.rename));function r(e){return e?function(r,i,n){return e.call(t,r,i,function(e){c(e)&&(e=null),n&&n.apply(this,arguments)})}:e}function n(e){return e?function(r,i){try{return e.call(t,r,i)}catch(e){if(!c(e))throw e}}:e}function s(e){return e?function(r,i,n,s){return e.call(t,r,i,n,function(e){c(e)&&(e=null),s&&s.apply(this,arguments)})}:e}function u(e){return e?function(r,i,n){try{return e.call(t,r,i,n)}catch(e){if(!c(e))throw e}}:e}function a(e){return e?function(r,i,n){function s(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof i&&(n=i,i=null),i?e.call(t,r,i,s):e.call(t,r,s)}:e}function o(e){return e?function(r,i){var n=i?e.call(t,r,i):e.call(t,r);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function c(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}t.read="function"!=typeof t.read?t.read:function(e){function r(r,i,n,s,u,a){var o;if(a&&"function"==typeof a){var c=0;o=function(l,D,h){if(l&&"EAGAIN"===l.code&&c<10)return c++,e.call(t,r,i,n,s,u,o);a.apply(this,arguments)}}return e.call(t,r,i,n,s,u,o)}return Object.setPrototypeOf&&Object.setPrototypeOf(r,e),r}(t.read),t.readSync="function"!=typeof t.readSync?t.readSync:(l=t.readSync,function(e,r,i,n,s){for(var u=0;;)try{return l.call(t,e,r,i,n,s)}catch(e){if("EAGAIN"===e.code&&u<10){u++;continue}throw e}});var l},polyfills}function requireLegacyStreams(){if(hasRequiredLegacyStreams)return legacyStreams;hasRequiredLegacyStreams=1;var e=require$$0$2.Stream;return legacyStreams=function(t){return{ReadStream:function r(i,n){if(!(this instanceof r))return new r(i,n);e.call(this);var s=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,n=n||{};for(var u=Object.keys(n),a=0,o=u.length;a<o;a++){var c=u[a];this[c]=n[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick(function(){s._read()});t.open(this.path,this.flags,this.mode,function(e,t){if(e)return s.emit("error",e),void(s.readable=!1);s.fd=t,s.emit("open",t),s._read()})},WriteStream:function r(i,n){if(!(this instanceof r))return new r(i,n);e.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),u=0,a=s.length;u<a;u++){var o=s[u];this[o]=n[o]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},legacyStreams}function requireClone(){if(hasRequiredClone)return clone_1;hasRequiredClone=1,clone_1=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var r={__proto__:e(t)};else r=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}),r};var e=Object.getPrototypeOf||function(e){return e.__proto__};return clone_1}function requireGracefulFs(){if(hasRequiredGracefulFs)return gracefulFs;hasRequiredGracefulFs=1;var e,t,r=fs$1,i=requirePolyfills(),n=requireLegacyStreams(),s=requireClone(),u=require$$4$1;function a(t,r){Object.defineProperty(t,e,{get:function(){return r}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),t=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var o,c=function(){};if(u.debuglog?c=u.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(c=function(){var e=u.format.apply(u,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ")}),!r[e]){var l=commonjsGlobal[e]||[];a(r,l),r.close=function(e){function i(t,i){return e.call(r,t,function(e){e||p(),"function"==typeof i&&i.apply(this,arguments)})}return Object.defineProperty(i,t,{value:e}),i}(r.close),r.closeSync=function(e){function i(t){e.apply(r,arguments),p()}return Object.defineProperty(i,t,{value:e}),i}(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){c(r[e]),require$$5.equal(r[e].length,0)})}function D(e){i(e),e.gracefulify=D,e.createReadStream=function(t,r){return new e.ReadStream(t,r)},e.createWriteStream=function(t,r){return new e.WriteStream(t,r)};var t=e.readFile;e.readFile=function(e,r,i){"function"==typeof r&&(i=r,r=null);return function e(r,i,n,s){return t(r,i,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof n&&n.apply(this,arguments):h([e,[r,i,n],t,s||Date.now(),Date.now()])})}(e,r,i)};var r=e.writeFile;e.writeFile=function(e,t,i,n){"function"==typeof i&&(n=i,i=null);return function e(t,i,n,s,u){return r(t,i,n,function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof s&&s.apply(this,arguments):h([e,[t,i,n,s],r,u||Date.now(),Date.now()])})}(e,t,i,n)};var s=e.appendFile;s&&(e.appendFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,n,u){return s(t,r,i,function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],s,u||Date.now(),Date.now()])})}(e,t,r,i)});var u=e.copyFile;u&&(e.copyFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=0);return function e(t,r,i,n,s){return u(t,r,i,function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],u,s||Date.now(),Date.now()])})}(e,t,r,i)});var a=e.readdir;e.readdir=function(e,t,r){"function"==typeof t&&(r=t,t=null);var i=o.test(process.version)?function(e,t,r,i){return a(e,n(e,t,r,i))}:function(e,t,r,i){return a(e,t,n(e,t,r,i))};return i(e,t,r);function n(e,t,r,n){return function(s,u){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?(u&&u.sort&&u.sort(),"function"==typeof r&&r.call(this,s,u)):h([i,[e,t,r],s,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var c=n(e);m=c.ReadStream,y=c.WriteStream}var l=e.ReadStream;l&&(m.prototype=Object.create(l.prototype),m.prototype.open=function(){var e=this;F(e.path,e.flags,e.mode,function(t,r){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r),e.read())})});var p=e.WriteStream;p&&(y.prototype=Object.create(p.prototype),y.prototype.open=function(){var e=this;F(e.path,e.flags,e.mode,function(t,r){t?(e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r))})}),Object.defineProperty(e,"ReadStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var d=m;Object.defineProperty(e,"FileReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var f=y;function m(e,t){return this instanceof m?(l.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function y(e,t){return this instanceof y?(p.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var E=e.open;function F(e,t,r,i){return"function"==typeof r&&(i=r,r=null),function e(t,r,i,n,s){return E(t,r,i,function(u,a){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],u,s||Date.now(),Date.now()])})}(e,t,r,i)}return e.open=F,e}function h(t){c("ENQUEUE",t[0].name,t[1]),r[e].push(t),d()}function p(){for(var t=Date.now(),i=0;i<r[e].length;++i)r[e][i].length>2&&(r[e][i][3]=t,r[e][i][4]=t);d()}function d(){if(clearTimeout(o),o=void 0,0!==r[e].length){var t=r[e].shift(),i=t[0],n=t[1],s=t[2],u=t[3],a=t[4];if(void 0===u)c("RETRY",i.name,n),i.apply(null,n);else if(Date.now()-u>=6e4){c("TIMEOUT",i.name,n);var l=n.pop();"function"==typeof l&&l.call(null,s)}else{var D=Date.now()-a,h=Math.max(a-u,1);D>=Math.min(1.2*h,100)?(c("RETRY",i.name,n),i.apply(null,n.concat([u]))):r[e].push(t)}void 0===o&&(o=setTimeout(d,0))}}return commonjsGlobal[e]||a(commonjsGlobal,r[e]),gracefulFs=D(s(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(gracefulFs=D(r),r.__patched=!0),gracefulFs}function requireFs(){return hasRequiredFs||(hasRequiredFs=1,function(e){const t=requireUniversalify().fromCallback,r=requireGracefulFs(),i=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(e=>"function"==typeof r[e]);Object.assign(e,r),i.forEach(i=>{e[i]=t(r[i])}),e.exists=function(e,t){return"function"==typeof t?r.exists(e,t):new Promise(t=>r.exists(e,t))},e.read=function(e,t,i,n,s,u){return"function"==typeof u?r.read(e,t,i,n,s,u):new Promise((u,a)=>{r.read(e,t,i,n,s,(e,t,r)=>{if(e)return a(e);u({bytesRead:t,buffer:r})})})},e.write=function(e,t,...i){return"function"==typeof i[i.length-1]?r.write(e,t,...i):new Promise((n,s)=>{r.write(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffer:r})})})},e.readv=function(e,t,...i){return"function"==typeof i[i.length-1]?r.readv(e,t,...i):new Promise((n,s)=>{r.readv(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesRead:t,buffers:r})})})},e.writev=function(e,t,...i){return"function"==typeof i[i.length-1]?r.writev(e,t,...i):new Promise((n,s)=>{r.writev(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffers:r})})})},"function"==typeof r.realpath.native?e.realpath.native=t(r.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(fs)),fs}var makeDir={},utils$1={},hasRequiredUtils$1,hasRequiredMakeDir,mkdirs,hasRequiredMkdirs,pathExists_1,hasRequiredPathExists,utimes,hasRequiredUtimes,stat,hasRequiredStat,async,hasRequiredAsync,copy_1,hasRequiredCopy$1,copySync_1,hasRequiredCopySync,copy,hasRequiredCopy,remove_1,hasRequiredRemove,empty,hasRequiredEmpty,file,hasRequiredFile,link,hasRequiredLink,symlinkPaths_1,hasRequiredSymlinkPaths,symlinkType_1,hasRequiredSymlinkType,symlink,hasRequiredSymlink,ensure,hasRequiredEnsure,utils,hasRequiredUtils,jsonfile$1,hasRequiredJsonfile$1,jsonfile,hasRequiredJsonfile,outputFile_1,hasRequiredOutputFile,outputJson_1,hasRequiredOutputJson,outputJsonSync_1,hasRequiredOutputJsonSync,json,hasRequiredJson,move_1,hasRequiredMove$1,moveSync_1,hasRequiredMoveSync,move,hasRequiredMove,lib$1,hasRequiredLib$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;const e=path;return utils$1.checkPath=function(t){if("win32"===process.platform){if(/[<>:"|?*]/.test(t.replace(e.parse(t).root,""))){const e=new Error(`Path contains invalid characters: ${t}`);throw e.code="EINVAL",e}}},utils$1}function requireMakeDir(){if(hasRequiredMakeDir)return makeDir;hasRequiredMakeDir=1;const e=requireFs(),{checkPath:t}=requireUtils$1(),r=e=>"number"==typeof e?e:{mode:511,...e}.mode;return makeDir.makeDir=async(i,n)=>(t(i),e.mkdir(i,{mode:r(n),recursive:!0})),makeDir.makeDirSync=(i,n)=>(t(i),e.mkdirSync(i,{mode:r(n),recursive:!0})),makeDir}function requireMkdirs(){if(hasRequiredMkdirs)return mkdirs;hasRequiredMkdirs=1;const e=requireUniversalify().fromPromise,{makeDir:t,makeDirSync:r}=requireMakeDir(),i=e(t);return mkdirs={mkdirs:i,mkdirsSync:r,mkdirp:i,mkdirpSync:r,ensureDir:i,ensureDirSync:r}}function requirePathExists(){if(hasRequiredPathExists)return pathExists_1;hasRequiredPathExists=1;const e=requireUniversalify().fromPromise,t=requireFs();return pathExists_1={pathExists:e(function(e){return t.access(e).then(()=>!0).catch(()=>!1)}),pathExistsSync:t.existsSync},pathExists_1}function requireUtimes(){if(hasRequiredUtimes)return utimes;hasRequiredUtimes=1;const e=requireFs(),t=requireUniversalify().fromPromise;return utimes={utimesMillis:t(async function(t,r,i){const n=await e.open(t,"r+");let s=null;try{await e.futimes(n,r,i)}finally{try{await e.close(n)}catch(e){s=e}}if(s)throw s}),utimesMillisSync:function(t,r,i){const n=e.openSync(t,"r+");return e.futimesSync(n,r,i),e.closeSync(n)}},utimes}function requireStat(){if(hasRequiredStat)return stat;hasRequiredStat=1;const e=requireFs(),t=path,r=requireUniversalify().fromPromise;function i(e,t){return void 0!==t.ino&&void 0!==t.dev&&t.ino===e.ino&&t.dev===e.dev}function n(e,r){const i=t.resolve(e).split(t.sep).filter(e=>e),n=t.resolve(r).split(t.sep).filter(e=>e);return i.every((e,t)=>n[t]===e)}function s(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}return stat={checkPaths:r(async function(r,u,a,o){const{srcStat:c,destStat:l}=await function(t,r,i){const n=i.dereference?t=>e.stat(t,{bigint:!0}):t=>e.lstat(t,{bigint:!0});return Promise.all([n(t),n(r).catch(e=>{if("ENOENT"===e.code)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}(r,u,o);if(l){if(i(c,l)){const e=t.basename(r),i=t.basename(u);if("move"===a&&e!==i&&e.toLowerCase()===i.toLowerCase())return{srcStat:c,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${r}'.`);if(!c.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${r}'.`)}if(c.isDirectory()&&n(r,u))throw new Error(s(r,u,a));return{srcStat:c,destStat:l}}),checkPathsSync:function(r,u,a,o){const{srcStat:c,destStat:l}=function(t,r,i){let n;const s=i.dereference?t=>e.statSync(t,{bigint:!0}):t=>e.lstatSync(t,{bigint:!0}),u=s(t);try{n=s(r)}catch(e){if("ENOENT"===e.code)return{srcStat:u,destStat:null};throw e}return{srcStat:u,destStat:n}}(r,u,o);if(l){if(i(c,l)){const e=t.basename(r),i=t.basename(u);if("move"===a&&e!==i&&e.toLowerCase()===i.toLowerCase())return{srcStat:c,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${r}'.`);if(!c.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${r}'.`)}if(c.isDirectory()&&n(r,u))throw new Error(s(r,u,a));return{srcStat:c,destStat:l}},checkParentPaths:r(async function r(n,u,a,o){const c=t.resolve(t.dirname(n)),l=t.resolve(t.dirname(a));if(l===c||l===t.parse(l).root)return;let D;try{D=await e.stat(l,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(i(u,D))throw new Error(s(n,a,o));return r(n,u,l,o)}),checkParentPathsSync:function r(n,u,a,o){const c=t.resolve(t.dirname(n)),l=t.resolve(t.dirname(a));if(l===c||l===t.parse(l).root)return;let D;try{D=e.statSync(l,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(i(u,D))throw new Error(s(n,a,o));return r(n,u,l,o)},isSrcSubdir:n,areIdentical:i},stat}function requireAsync(){if(hasRequiredAsync)return async;return hasRequiredAsync=1,async={asyncIteratorConcurrentProcess:async function(e,t){const r=[];for await(const i of e)r.push(t(i).then(()=>null,e=>e??new Error("unknown error")));await Promise.all(r.map(e=>e.then(e=>{if(null!==e)throw e})))}},async}function requireCopy$1(){if(hasRequiredCopy$1)return copy_1;hasRequiredCopy$1=1;const e=requireFs(),t=path,{mkdirs:r}=requireMkdirs(),{pathExists:i}=requirePathExists(),{utimesMillis:n}=requireUtimes(),s=requireStat(),{asyncIteratorConcurrentProcess:u}=requireAsync();async function a(e,t,r){return!r.filter||r.filter(e,t)}async function o(r,i,n,l){const D=l.dereference?e.stat:e.lstat,h=await D(i);if(h.isDirectory())return async function(r,i,n,c,l){i||await e.mkdir(c);await u(await e.opendir(n),async e=>{const r=t.join(n,e.name),i=t.join(c,e.name);if(await a(r,i,l)){const{destStat:e}=await s.checkPaths(r,i,"copy",l);await o(e,r,i,l)}}),i||await e.chmod(c,r.mode)}(h,r,i,n,l);if(h.isFile()||h.isCharacterDevice()||h.isBlockDevice())return async function(t,r,i,n,s){if(!r)return c(t,i,n,s);if(s.overwrite)return await e.unlink(n),c(t,i,n,s);if(s.errorOnExist)throw new Error(`'${n}' already exists`)}(h,r,i,n,l);if(h.isSymbolicLink())return async function(r,i,n,u){let a=await e.readlink(i);u.dereference&&(a=t.resolve(process.cwd(),a));if(!r)return e.symlink(a,n);let o=null;try{o=await e.readlink(n)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return e.symlink(a,n);throw t}u.dereference&&(o=t.resolve(process.cwd(),o));if(s.isSrcSubdir(a,o))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${o}'.`);if(s.isSrcSubdir(o,a))throw new Error(`Cannot overwrite '${o}' with '${a}'.`);return await e.unlink(n),e.symlink(a,n)}(r,i,n,l);if(h.isSocket())throw new Error(`Cannot copy a socket file: ${i}`);if(h.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${i}`);throw new Error(`Unknown file: ${i}`)}async function c(t,r,i,s){if(await e.copyFile(r,i),s.preserveTimestamps){128&t.mode||await function(t,r){return e.chmod(t,128|r)}(i,t.mode);const s=await e.stat(r);await n(i,s.atime,s.mtime)}return e.chmod(i,t.mode)}return copy_1=async function(e,n,u={}){"function"==typeof u&&(u={filter:u}),u.clobber=!("clobber"in u)||!!u.clobber,u.overwrite="overwrite"in u?!!u.overwrite:u.clobber,u.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001");const{srcStat:c,destStat:l}=await s.checkPaths(e,n,"copy",u);if(await s.checkParentPaths(e,c,n,"copy"),!await a(e,n,u))return;const D=t.dirname(n);await i(D)||await r(D),await o(l,e,n,u)}}function requireCopySync(){if(hasRequiredCopySync)return copySync_1;hasRequiredCopySync=1;const e=requireGracefulFs(),t=path,r=requireMkdirs().mkdirsSync,i=requireUtimes().utimesMillisSync,n=requireStat();function s(r,i,s,c){const l=(c.dereference?e.statSync:e.lstatSync)(i);if(l.isDirectory())return function(t,r,i,n,s){return r?o(i,n,s):function(t,r,i,n){return e.mkdirSync(i),o(r,i,n),a(i,t)}(t.mode,i,n,s)}(l,r,i,s,c);if(l.isFile()||l.isCharacterDevice()||l.isBlockDevice())return function(t,r,i,n,s){return r?function(t,r,i,n){if(n.overwrite)return e.unlinkSync(i),u(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}(t,i,n,s):u(t,i,n,s)}(l,r,i,s,c);if(l.isSymbolicLink())return function(r,i,s,u){let a=e.readlinkSync(i);u.dereference&&(a=t.resolve(process.cwd(),a));if(r){let r;try{r=e.readlinkSync(s)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return e.symlinkSync(a,s);throw t}if(u.dereference&&(r=t.resolve(process.cwd(),r)),n.isSrcSubdir(a,r))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${r}'.`);if(n.isSrcSubdir(r,a))throw new Error(`Cannot overwrite '${r}' with '${a}'.`);return function(t,r){return e.unlinkSync(r),e.symlinkSync(t,r)}(a,s)}return e.symlinkSync(a,s)}(r,i,s,c);if(l.isSocket())throw new Error(`Cannot copy a socket file: ${i}`);if(l.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${i}`);throw new Error(`Unknown file: ${i}`)}function u(t,r,n,s){return e.copyFileSync(r,n),s.preserveTimestamps&&function(t,r,n){(function(e){return!(128&e)})(t)&&function(e,t){a(e,128|t)}(n,t);(function(t,r){const n=e.statSync(t);i(r,n.atime,n.mtime)})(r,n)}(t.mode,r,n),a(n,t.mode)}function a(t,r){return e.chmodSync(t,r)}function o(t,r,i){const n=e.opendirSync(t);try{let e;for(;null!==(e=n.readSync());)c(e.name,t,r,i)}finally{n.closeSync()}}function c(e,r,i,u){const a=t.join(r,e),o=t.join(i,e);if(u.filter&&!u.filter(a,o))return;const{destStat:c}=n.checkPathsSync(a,o,"copy",u);return s(c,a,o,u)}return copySync_1=function(i,u,a){"function"==typeof a&&(a={filter:a}),(a=a||{}).clobber=!("clobber"in a)||!!a.clobber,a.overwrite="overwrite"in a?!!a.overwrite:a.clobber,a.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:o,destStat:c}=n.checkPathsSync(i,u,"copy",a);if(n.checkParentPathsSync(i,o,u,"copy"),a.filter&&!a.filter(i,u))return;const l=t.dirname(u);return e.existsSync(l)||r(l),s(c,i,u,a)}}function requireCopy(){if(hasRequiredCopy)return copy;hasRequiredCopy=1;const e=requireUniversalify().fromPromise;return copy={copy:e(requireCopy$1()),copySync:requireCopySync()}}function requireRemove(){if(hasRequiredRemove)return remove_1;hasRequiredRemove=1;const e=requireGracefulFs(),t=requireUniversalify().fromCallback;return remove_1={remove:t(function(t,r){e.rm(t,{recursive:!0,force:!0},r)}),removeSync:function(t){e.rmSync(t,{recursive:!0,force:!0})}},remove_1}function requireEmpty(){if(hasRequiredEmpty)return empty;hasRequiredEmpty=1;const e=requireUniversalify().fromPromise,t=requireFs(),r=path,i=requireMkdirs(),n=requireRemove(),s=e(async function(e){let s;try{s=await t.readdir(e)}catch{return i.mkdirs(e)}return Promise.all(s.map(t=>n.remove(r.join(e,t))))});function u(e){let s;try{s=t.readdirSync(e)}catch{return i.mkdirsSync(e)}s.forEach(t=>{t=r.join(e,t),n.removeSync(t)})}return empty={emptyDirSync:u,emptydirSync:u,emptyDir:s,emptydir:s}}function requireFile(){if(hasRequiredFile)return file;hasRequiredFile=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),i=requireMkdirs();return file={createFile:e(async function(e){let n;try{n=await r.stat(e)}catch{}if(n&&n.isFile())return;const s=t.dirname(e);let u=null;try{u=await r.stat(s)}catch(t){if("ENOENT"===t.code)return await i.mkdirs(s),void await r.writeFile(e,"");throw t}u.isDirectory()?await r.writeFile(e,""):await r.readdir(s)}),createFileSync:function(e){let n;try{n=r.statSync(e)}catch{}if(n&&n.isFile())return;const s=t.dirname(e);try{r.statSync(s).isDirectory()||r.readdirSync(s)}catch(e){if(!e||"ENOENT"!==e.code)throw e;i.mkdirsSync(s)}r.writeFileSync(e,"")}}}function requireLink(){if(hasRequiredLink)return link;hasRequiredLink=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),i=requireMkdirs(),{pathExists:n}=requirePathExists(),{areIdentical:s}=requireStat();return link={createLink:e(async function(e,u){let a,o;try{a=await r.lstat(u)}catch{}try{o=await r.lstat(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}if(a&&s(o,a))return;const c=t.dirname(u);await n(c)||await i.mkdirs(c),await r.link(e,u)}),createLinkSync:function(e,n){let u;try{u=r.lstatSync(n)}catch{}try{const t=r.lstatSync(e);if(u&&s(t,u))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const a=t.dirname(n);return r.existsSync(a)||i.mkdirsSync(a),r.linkSync(e,n)}}}function requireSymlinkPaths(){if(hasRequiredSymlinkPaths)return symlinkPaths_1;hasRequiredSymlinkPaths=1;const e=path,t=requireFs(),{pathExists:r}=requirePathExists(),i=requireUniversalify().fromPromise;return symlinkPaths_1={symlinkPaths:i(async function(i,n){if(e.isAbsolute(i)){try{await t.lstat(i)}catch(e){throw e.message=e.message.replace("lstat","ensureSymlink"),e}return{toCwd:i,toDst:i}}const s=e.dirname(n),u=e.join(s,i);if(await r(u))return{toCwd:u,toDst:i};try{await t.lstat(i)}catch(e){throw e.message=e.message.replace("lstat","ensureSymlink"),e}return{toCwd:i,toDst:e.relative(s,i)}}),symlinkPathsSync:function(r,i){if(e.isAbsolute(r)){if(!t.existsSync(r))throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}const n=e.dirname(i),s=e.join(n,r);if(t.existsSync(s))return{toCwd:s,toDst:r};if(!t.existsSync(r))throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:e.relative(n,r)}}}}function requireSymlinkType(){if(hasRequiredSymlinkType)return symlinkType_1;hasRequiredSymlinkType=1;const e=requireFs(),t=requireUniversalify().fromPromise;return symlinkType_1={symlinkType:t(async function(t,r){if(r)return r;let i;try{i=await e.lstat(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}),symlinkTypeSync:function(t,r){if(r)return r;let i;try{i=e.lstatSync(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}}}function requireSymlink(){if(hasRequiredSymlink)return symlink;hasRequiredSymlink=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),{mkdirs:i,mkdirsSync:n}=requireMkdirs(),{symlinkPaths:s,symlinkPathsSync:u}=requireSymlinkPaths(),{symlinkType:a,symlinkTypeSync:o}=requireSymlinkType(),{pathExists:c}=requirePathExists(),{areIdentical:l}=requireStat();return symlink={createSymlink:e(async function(e,n,u){let o;try{o=await r.lstat(n)}catch{}if(o&&o.isSymbolicLink()){const[t,i]=await Promise.all([r.stat(e),r.stat(n)]);if(l(t,i))return}const D=await s(e,n);e=D.toDst;const h=await a(D.toCwd,u),p=t.dirname(n);return await c(p)||await i(p),r.symlink(e,n,h)}),createSymlinkSync:function(e,i,s){let a;try{a=r.lstatSync(i)}catch{}if(a&&a.isSymbolicLink()){const t=r.statSync(e),n=r.statSync(i);if(l(t,n))return}const c=u(e,i);e=c.toDst,s=o(c.toCwd,s);const D=t.dirname(i);return r.existsSync(D)||n(D),r.symlinkSync(e,i,s)}}}function requireEnsure(){if(hasRequiredEnsure)return ensure;hasRequiredEnsure=1;const{createFile:e,createFileSync:t}=requireFile(),{createLink:r,createLinkSync:i}=requireLink(),{createSymlink:n,createSymlinkSync:s}=requireSymlink();return ensure={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:r,createLinkSync:i,ensureLink:r,ensureLinkSync:i,createSymlink:n,createSymlinkSync:s,ensureSymlink:n,ensureSymlinkSync:s}}function requireUtils(){if(hasRequiredUtils)return utils;return hasRequiredUtils=1,utils={stringify:function(e,{EOL:t="\n",finalEOL:r=!0,replacer:i=null,spaces:n}={}){const s=r?t:"";return JSON.stringify(e,i,n).replace(/\n/g,t)+s},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}}}function requireJsonfile$1(){if(hasRequiredJsonfile$1)return jsonfile$1;let e;hasRequiredJsonfile$1=1;try{e=requireGracefulFs()}catch(t){e=fs$1}const t=requireUniversalify(),{stringify:r,stripBom:i}=requireUtils();const n=t.fromPromise(async function(r,n={}){"string"==typeof n&&(n={encoding:n});const s=n.fs||e,u=!("throws"in n)||n.throws;let a,o=await t.fromCallback(s.readFile)(r,n);o=i(o);try{a=JSON.parse(o,n?n.reviver:null)}catch(e){if(u)throw e.message=`${r}: ${e.message}`,e;return null}return a});const s=t.fromPromise(async function(i,n,s={}){const u=s.fs||e,a=r(n,s);await t.fromCallback(u.writeFile)(i,a,s)});return jsonfile$1={readFile:n,readFileSync:function(t,r={}){"string"==typeof r&&(r={encoding:r});const n=r.fs||e,s=!("throws"in r)||r.throws;try{let e=n.readFileSync(t,r);return e=i(e),JSON.parse(e,r.reviver)}catch(e){if(s)throw e.message=`${t}: ${e.message}`,e;return null}},writeFile:s,writeFileSync:function(t,i,n={}){const s=n.fs||e,u=r(i,n);return s.writeFileSync(t,u,n)}},jsonfile$1}function requireJsonfile(){if(hasRequiredJsonfile)return jsonfile;hasRequiredJsonfile=1;const e=requireJsonfile$1();return jsonfile={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync}}function requireOutputFile(){if(hasRequiredOutputFile)return outputFile_1;hasRequiredOutputFile=1;const e=requireUniversalify().fromPromise,t=requireFs(),r=path,i=requireMkdirs(),n=requirePathExists().pathExists;return outputFile_1={outputFile:e(async function(e,s,u="utf-8"){const a=r.dirname(e);return await n(a)||await i.mkdirs(a),t.writeFile(e,s,u)}),outputFileSync:function(e,...n){const s=r.dirname(e);t.existsSync(s)||i.mkdirsSync(s),t.writeFileSync(e,...n)}},outputFile_1}function requireOutputJson(){if(hasRequiredOutputJson)return outputJson_1;hasRequiredOutputJson=1;const{stringify:e}=requireUtils(),{outputFile:t}=requireOutputFile();return outputJson_1=async function(r,i,n={}){const s=e(i,n);await t(r,s,n)},outputJson_1}function requireOutputJsonSync(){if(hasRequiredOutputJsonSync)return outputJsonSync_1;hasRequiredOutputJsonSync=1;const{stringify:e}=requireUtils(),{outputFileSync:t}=requireOutputFile();return outputJsonSync_1=function(r,i,n){const s=e(i,n);t(r,s,n)},outputJsonSync_1}function requireJson(){if(hasRequiredJson)return json;hasRequiredJson=1;const e=requireUniversalify().fromPromise,t=requireJsonfile();return t.outputJson=e(requireOutputJson()),t.outputJsonSync=requireOutputJsonSync(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,json=t}function requireMove$1(){if(hasRequiredMove$1)return move_1;hasRequiredMove$1=1;const e=requireFs(),t=path,{copy:r}=requireCopy(),{remove:i}=requireRemove(),{mkdirp:n}=requireMkdirs(),{pathExists:s}=requirePathExists(),u=requireStat();return move_1=async function(a,o,c={}){const l=c.overwrite||c.clobber||!1,{srcStat:D,isChangingCase:h=!1}=await u.checkPaths(a,o,"move",c);await u.checkParentPaths(a,D,o,"move");const p=t.dirname(o);return t.parse(p).root!==p&&await n(p),async function(t,n,u,a){if(!a)if(u)await i(n);else if(await s(n))throw new Error("dest already exists.");try{await e.rename(t,n)}catch(e){if("EXDEV"!==e.code)throw e;await async function(e,t,n){const s={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return await r(e,t,s),i(e)}(t,n,u)}}(a,o,l,h)}}function requireMoveSync(){if(hasRequiredMoveSync)return moveSync_1;hasRequiredMoveSync=1;const e=requireGracefulFs(),t=path,r=requireCopy().copySync,i=requireRemove().removeSync,n=requireMkdirs().mkdirpSync,s=requireStat();function u(t,n,s){try{e.renameSync(t,n)}catch(e){if("EXDEV"!==e.code)throw e;return function(e,t,n){const s={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return r(e,t,s),i(e)}(t,n,s)}}return moveSync_1=function(r,a,o){const c=(o=o||{}).overwrite||o.clobber||!1,{srcStat:l,isChangingCase:D=!1}=s.checkPathsSync(r,a,"move",o);return s.checkParentPathsSync(r,l,a,"move"),function(e){const r=t.dirname(e);return t.parse(r).root===r}(a)||n(t.dirname(a)),function(t,r,n,s){if(s)return u(t,r,n);if(n)return i(r),u(t,r,n);if(e.existsSync(r))throw new Error("dest already exists.");return u(t,r,n)}(r,a,c,D)}}function requireMove(){if(hasRequiredMove)return move;hasRequiredMove=1;const e=requireUniversalify().fromPromise;return move={move:e(requireMove$1()),moveSync:requireMoveSync()}}function requireLib$1(){return hasRequiredLib$1?lib$1:(hasRequiredLib$1=1,lib$1={...requireFs(),...requireCopy(),...requireEmpty(),...requireEnsure(),...requireJson(),...requireMkdirs(),...requireMove(),...requireOutputFile(),...requirePathExists(),...requireRemove()})}var libExports$1=requireLib$1(),fsExtra=getDefaultExportFromCjs(libExports$1),copyFilesByTargetPath=function(e,t){if(fs$1.existsSync(e)){try{var r=path.dirname(t);fsExtra.ensureDirSync(r)}catch(e){}fsExtra.copySync(e,t,{overwrite:!0})}},downloadFullApps=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i,n;return __generator(this,function(s){switch(s.label){case 0:return[4,getManifestJsonUrl(e.mode)];case 1:return t=s.sent(),r=t.filter(function(t){return t.appCode!==e.appCode}),[4,downloadManifestJson(r.map(function(e){return e.url}))];case 2:return i=s.sent(),(n=checkDownloadFilesIsExpired(i)).length?[4,downloadProjectFiles(n)]:[3,4];case 3:s.sent(),s.label=4;case 4:return[2,i]}})})},moveOtherApps=function(e){var t=e.base,r=e.manifestList,i=process.env.MFE_ROOT_OUTPUT_DIR;r.forEach(function(e){var r=e.appCode,n=checkIsRootManifest(e)?i:path.resolve(i,r),s=path.resolve(t,r);try{copyFilesByTargetPath(s,n)}catch(e){}})},createAppsAssetsPlugin=function(e){var t=[],r=!1;return{name:"@dd-code:apps-assets",enforce:"pre",options:function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(r){switch(r.label){case 0:return[4,downloadFullApps(e.value)];case 1:return t=r.sent(),e.setDependencies(t),[2]}})})},buildStart:function(){if(!r){var i=path.resolve(SAVE_CDN_FILE_PATH,e.value.mode||"dev");moveOtherApps({base:i,manifestList:t}),r=!0}}}},initPreContext=require("@dcloudio/uni-cli-shared/dist/preprocess").initPreContext,preprocess=require("@dcloudio/uni-cli-shared/lib/preprocess").preprocess,getPreVueContext=require("@dcloudio/uni-cli-shared/dist/preprocess/context").getPreVueContext,initPrePagesJson=function(){var e=path.resolve(process.cwd(),"src/pages.json");return fs$1.readFileSync(e,"utf-8")},getPagesJson=function(jsonFile,isFormat){void 0===isFormat&&(isFormat=!1);var platform=process.env.UNI_PLATFORM;initPreContext(platform);var context=getPreVueContext(),processedJsonStr=preprocess(jsonFile,context,{type:"js"}),pagesConfig=eval("(".concat(processedJsonStr,")"));return isFormat&&"mp-weixin"===platform?transformToWeixinFormat(pagesConfig):pagesConfig},transformToWeixinFormat=function(e){var t,r=__assign({pages:[],window:{},tabBar:null,subPackages:[],usingComponents:{}},e);if(e.globalStyle){var i=e.globalStyle;r.window={navigationBarBackgroundColor:i.navigationBarBackgroundColor||"#000000",navigationBarTextStyle:i.navigationBarTextStyle||"white",navigationBarTitleText:i.navigationBarTitleText||"",backgroundColor:i.backgroundColor||"#ffffff",backgroundTextStyle:i.backgroundTextStyle||"dark",enablePullDownRefresh:i.enablePullDownRefresh||!1,onReachBottomDistance:i.onReachBottomDistance||50},i.pageOrientation&&(r.window.pageOrientation=i.pageOrientation),i.renderingMode&&(r.window.renderingMode=i.renderingMode),i.usingComponents&&(r.usingComponents=i.usingComponents),i["mp-weixin"]&&Object.assign(r.window,i["mp-weixin"])}return e.pages&&(r.pages=e.pages.map(function(e){return e.path})),e.tabBar&&(r.tabBar=__assign(__assign({},e.tabBar),{list:null===(t=e.tabBar.list)||void 0===t?void 0:t.map(function(e){return{pagePath:e.pagePath,text:e.text,iconPath:e.iconPath,selectedIconPath:e.selectedIconPath}})})),e.subPackages&&(r.subPackages=e.subPackages.map(function(e){var t;return{root:e.root,pages:(null===(t=e.pages)||void 0===t?void 0:t.map(function(e){return e.path||e}))||[]}})),e.preloadRule&&(r.preloadRule=e.preloadRule),delete r.globalStyle,delete r.easycom,delete r.condition,delete r.leftWindow,delete r.topWindow,delete r.rightWindow,delete r.uniIdRouter,delete r.entryPagePath,r},createManifestPlugin=function(e){var t=new Set;return{name:"@dd-code:genre-mainfest-file-list",enforce:"post",renderStart:function(){var t=initPrePagesJson(),r=getPagesJson(t);e.setPagesJson(r)},writeBundle:function(e,r){Object.values(r).forEach(function(e){e&&e.fileName&&t.add(e.fileName)})},closeBundle:function(){var r=process.env.MFE_SOURCE_OUTPUT_DIR||"dist",i=walkDir(r,t);e.setFiles(r,i);var n=e.value.isRoot?process.env.MFE_ROOT_OUTPUT_DIR:path.resolve(process.env.MFE_ROOT_OUTPUT_DIR,e.value.appCode);e.saveFile(n)}}};const EntryTypes={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},defaultOptions={root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:EntryTypes.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(defaultOptions);const RECURSIVE_ERROR_CODE="READDIRP_RECURSIVE_ERROR",NORMAL_FLOW_ERRORS=new Set(["ENOENT","EPERM","EACCES","ELOOP",RECURSIVE_ERROR_CODE]),ALL_TYPES=[EntryTypes.DIR_TYPE,EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE,EntryTypes.FILE_TYPE],DIR_TYPES=new Set([EntryTypes.DIR_TYPE,EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE]),FILE_TYPES=new Set([EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE,EntryTypes.FILE_TYPE]),isNormalFlowError=e=>NORMAL_FLOW_ERRORS.has(e.code),wantBigintFsStats="win32"===process.platform,emptyFn=e=>!0,normalizeFilter=e=>{if(void 0===e)return emptyFn;if("function"==typeof e)return e;if("string"==typeof e){const t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){const t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return emptyFn};class ReaddirpStream extends node_stream.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});const t={...defaultOptions,...e},{root:r,type:i}=t;this._fileFilter=normalizeFilter(t.fileFilter),this._directoryFilter=normalizeFilter(t.directoryFilter);const n=t.lstat?promises.lstat:promises.stat;this._stat=wantBigintFsStats?e=>n(e,{bigint:!0}):n,this._maxDepth=null!=t.depth&&Number.isSafeInteger(t.depth)?t.depth:defaultOptions.depth,this._wantsDir=!!i&&DIR_TYPES.has(i),this._wantsFile=!!i&&FILE_TYPES.has(i),this._wantsEverything=i===EntryTypes.EVERYTHING_TYPE,this._root=sp.resolve(r),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const t=this.parent,r=t&&t.files;if(r&&r.length>0){const{path:i,depth:n}=t,s=r.splice(0,e).map(e=>this._formatEntry(e,i)),u=await Promise.all(s);for(const t of u){if(!t)continue;if(this.destroyed)return;const r=await this._getEntryType(t);"directory"===r&&this._directoryFilter(t)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,n+1)),this._wantsDir&&(this.push(t),e--)):("file"===r||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{const e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let r;try{r=await promises.readdir(e,this._rdOptions)}catch(e){this._onError(e)}return{files:r,depth:t,path:e}}async _formatEntry(e,t){let r;const i=this._isDirent?e.name:e;try{const n=sp.resolve(sp.join(t,i));r={path:sp.relative(this._root,n),fullPath:n,basename:i},r[this._statsProp]=this._isDirent?e:await this._stat(n)}catch(e){return void this._onError(e)}return r}_onError(e){isNormalFlowError(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";const t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){const t=e.fullPath;try{const e=await promises.realpath(t),r=await promises.lstat(e);if(r.isFile())return"file";if(r.isDirectory()){const r=e.length;if(t.startsWith(e)&&t.substr(r,1)===sp.sep){const r=new Error(`Circular symlink detected: "${t}" points to "${e}"`);return r.code=RECURSIVE_ERROR_CODE,this._onError(r)}return"directory"}}catch(e){return this._onError(e),""}}}_includeAsFile(e){const t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}function readdirp(e,t={}){let r=t.entryType||t.type;if("both"===r&&(r=EntryTypes.FILE_DIR_TYPE),r&&(t.type=r),!e)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");if("string"!=typeof e)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!ALL_TYPES.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);return t.root=e,new ReaddirpStream(t)}const STR_DATA="data",STR_END="end",STR_CLOSE="close",EMPTY_FN=()=>{},pl=process.platform,isWindows="win32"===pl,isMacos="darwin"===pl,isLinux="linux"===pl,isFreeBSD="freebsd"===pl,isIBMi="OS400"===node_os.type(),EVENTS={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},EV=EVENTS,THROTTLE_MODE_WATCH="watch",statMethods={lstat:promises.lstat,stat:promises.stat},KEY_LISTENERS="listeners",KEY_ERR="errHandlers",KEY_RAW="rawEmitters",HANDLER_KEYS=[KEY_LISTENERS,KEY_ERR,KEY_RAW],binaryExtensions=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),isBinaryPath=e=>binaryExtensions.has(sp__namespace.extname(e).slice(1).toLowerCase()),foreach=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},addAndConvert=(e,t,r)=>{let i=e[t];i instanceof Set||(e[t]=i=new Set([i])),i.add(r)},clearItem=e=>t=>{const r=e[t];r instanceof Set?r.clear():delete e[t]},delFromSet=(e,t,r)=>{const i=e[t];i instanceof Set?i.delete(r):i===r&&delete e[t]},isEmptySet=e=>e instanceof Set?0===e.size:!e,FsWatchInstances=new Map;function createFsWatchInstance(e,t,r,i,n){const s=(t,i)=>{r(e),n(t,i,{watchedPath:e}),i&&e!==i&&fsWatchBroadcast(sp__namespace.resolve(e,i),KEY_LISTENERS,sp__namespace.join(e,i))};try{return node_fs.watch(e,{persistent:t.persistent},s)}catch(e){return void i(e)}}const fsWatchBroadcast=(e,t,r,i,n)=>{const s=FsWatchInstances.get(e);s&&foreach(s[t],e=>{e(r,i,n)})},setFsWatchListener=(e,t,r,i)=>{const{listener:n,errHandler:s,rawEmitter:u}=i;let a,o=FsWatchInstances.get(t);if(!r.persistent){if(a=createFsWatchInstance(e,r,n,s,u),!a)return;return a.close.bind(a)}if(o)addAndConvert(o,KEY_LISTENERS,n),addAndConvert(o,KEY_ERR,s),addAndConvert(o,KEY_RAW,u);else{if(a=createFsWatchInstance(e,r,fsWatchBroadcast.bind(null,t,KEY_LISTENERS),s,fsWatchBroadcast.bind(null,t,KEY_RAW)),!a)return;a.on(EV.ERROR,async r=>{const i=fsWatchBroadcast.bind(null,t,KEY_ERR);if(o&&(o.watcherUnusable=!0),isWindows&&"EPERM"===r.code)try{const t=await promises.open(e,"r");await t.close(),i(r)}catch(e){}else i(r)}),o={listeners:n,errHandlers:s,rawEmitters:u,watcher:a},FsWatchInstances.set(t,o)}return()=>{delFromSet(o,KEY_LISTENERS,n),delFromSet(o,KEY_ERR,s),delFromSet(o,KEY_RAW,u),isEmptySet(o.listeners)&&(o.watcher.close(),FsWatchInstances.delete(t),HANDLER_KEYS.forEach(clearItem(o)),o.watcher=void 0,Object.freeze(o))}},FsWatchFileInstances=new Map,setFsWatchFileListener=(e,t,r,i)=>{const{listener:n,rawEmitter:s}=i;let u=FsWatchFileInstances.get(t);const a=u&&u.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&(node_fs.unwatchFile(t),u=void 0),u?(addAndConvert(u,KEY_LISTENERS,n),addAndConvert(u,KEY_RAW,s)):(u={listeners:n,rawEmitters:s,options:r,watcher:node_fs.watchFile(t,r,(r,i)=>{foreach(u.rawEmitters,e=>{e(EV.CHANGE,t,{curr:r,prev:i})});const n=r.mtimeMs;(r.size!==i.size||n>i.mtimeMs||0===n)&&foreach(u.listeners,t=>t(e,r))})},FsWatchFileInstances.set(t,u)),()=>{delFromSet(u,KEY_LISTENERS,n),delFromSet(u,KEY_RAW,s),isEmptySet(u.listeners)&&(FsWatchFileInstances.delete(t),node_fs.unwatchFile(t),u.options=u.watcher=void 0,Object.freeze(u))}};class NodeFsHandler{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const r=this.fsw.options,i=sp__namespace.dirname(e),n=sp__namespace.basename(e);this.fsw._getWatchedDir(i).add(n);const s=sp__namespace.resolve(e),u={persistent:r.persistent};let a;if(t||(t=EMPTY_FN),r.usePolling){const i=r.interval!==r.binaryInterval;u.interval=i&&isBinaryPath(n)?r.binaryInterval:r.interval,a=setFsWatchFileListener(e,s,u,{listener:t,rawEmitter:this.fsw._emitRaw})}else a=setFsWatchListener(e,s,u,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return a}_handleFile(e,t,r){if(this.fsw.closed)return;const i=sp__namespace.dirname(e),n=sp__namespace.basename(e),s=this.fsw._getWatchedDir(i);let u=t;if(s.has(n))return;const a=async(t,r)=>{if(this.fsw._throttle(THROTTLE_MODE_WATCH,e,5))if(r&&0!==r.mtimeMs){if(s.has(n)){const t=r.atimeMs,i=r.mtimeMs;(!t||t<=i||i!==u.mtimeMs)&&this.fsw._emit(EV.CHANGE,e,r),u=r}}else try{const r=await promises.stat(e);if(this.fsw.closed)return;const i=r.atimeMs,n=r.mtimeMs;if((!i||i<=n||n!==u.mtimeMs)&&this.fsw._emit(EV.CHANGE,e,r),(isMacos||isLinux||isFreeBSD)&&u.ino!==r.ino){this.fsw._closeFile(t),u=r;const i=this._watchWithNodeFs(e,a);i&&this.fsw._addPathCloser(t,i)}else u=r}catch(e){this.fsw._remove(i,n)}},o=this._watchWithNodeFs(e,a);if((!r||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(EV.ADD,e,0))return;this.fsw._emit(EV.ADD,e,t)}return o}async _handleSymlink(e,t,r,i){if(this.fsw.closed)return;const n=e.fullPath,s=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){let t;this.fsw._incrReadyCount();try{t=await promises.realpath(r)}catch(e){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return s.has(i)?this.fsw._symlinkPaths.get(n)!==t&&(this.fsw._symlinkPaths.set(n,t),this.fsw._emit(EV.CHANGE,r,e.stats)):(s.add(i),this.fsw._symlinkPaths.set(n,t),this.fsw._emit(EV.ADD,r,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(n))return!0;this.fsw._symlinkPaths.set(n,!0)}_handleRead(e,t,r,i,n,s,u){e=sp__namespace.join(e,"");const a=i?`${e}:${i}`:e;if(!(u=this.fsw._throttle("readdir",a,1e3)))return;const o=this.fsw._getWatchedDir(r.path),c=new Set;let l=this.fsw._readdirp(e,{fileFilter:e=>r.filterPath(e),directoryFilter:e=>r.filterDir(e)});return l?(l.on(STR_DATA,async u=>{if(this.fsw.closed)return void(l=void 0);const a=u.path;let D=sp__namespace.join(e,a);c.add(a),u.stats.isSymbolicLink()&&await this._handleSymlink(u,e,D,a)||(this.fsw.closed?l=void 0:a!==i&&(i||o.has(a))||(this.fsw._incrReadyCount(),D=sp__namespace.join(n,sp__namespace.relative(n,D)),this._addToNodeFs(D,t,r,s+1)))}).on(EV.ERROR,this._boundHandleError),new Promise((t,a)=>{if(!l)return a();l.once(STR_END,()=>{if(this.fsw.closed)return void(l=void 0);const a=!!u&&u.clear();t(void 0),o.getChildren().filter(t=>t!==e&&!c.has(t)).forEach(t=>{this.fsw._remove(e,t)}),l=void 0,a&&this._handleRead(e,!1,r,i,n,s,u)})})):void 0}async _handleDir(e,t,r,i,n,s,u){const a=this.fsw._getWatchedDir(sp__namespace.dirname(e)),o=a.has(sp__namespace.basename(e));let c,l;r&&this.fsw.options.ignoreInitial||n||o||this.fsw._emit(EV.ADD_DIR,e,t),a.add(sp__namespace.basename(e)),this.fsw._getWatchedDir(e);const D=this.fsw.options.depth;if((null==D||i<=D)&&!this.fsw._symlinkPaths.has(u)){if(!n&&(await this._handleRead(e,r,s,n,e,i,c),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,r)=>{r&&0===r.mtimeMs||this._handleRead(t,!1,s,n,e,i,c)})}return l}async _addToNodeFs(e,t,r,i,n){const s=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return s(),!1;const u=this.fsw._getWatchHelpers(e);r&&(u.filterPath=e=>r.filterPath(e),u.filterDir=e=>r.filterDir(e));try{const r=await statMethods[u.statMethod](u.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(u.watchPath,r))return s(),!1;const a=this.fsw.options.followSymlinks;let o;if(r.isDirectory()){const s=sp__namespace.resolve(e),c=a?await promises.realpath(e):e;if(this.fsw.closed)return;if(o=await this._handleDir(u.watchPath,r,t,i,n,u,c),this.fsw.closed)return;s!==c&&void 0!==c&&this.fsw._symlinkPaths.set(s,c)}else if(r.isSymbolicLink()){const n=a?await promises.realpath(e):e;if(this.fsw.closed)return;const s=sp__namespace.dirname(u.watchPath);if(this.fsw._getWatchedDir(s).add(u.watchPath),this.fsw._emit(EV.ADD,u.watchPath,r),o=await this._handleDir(s,r,t,i,e,u,n),this.fsw.closed)return;void 0!==n&&this.fsw._symlinkPaths.set(sp__namespace.resolve(e),n)}else o=this._handleFile(u.watchPath,r,t);return s(),o&&this.fsw._addPathCloser(e,o),!1}catch(t){if(this.fsw._handleError(t))return s(),e}}}
|
|
1
|
+
"use strict";var path=require("path"),fs$1=require("fs"),crypto=require("crypto"),require$$0=require("readline"),require$$4=require("events"),require$$0$1=require("constants"),require$$0$2=require("stream"),require$$4$1=require("util"),require$$5=require("assert"),node_events=require("node:events"),node_fs=require("node:fs"),promises=require("node:fs/promises"),sp=require("node:path"),node_stream=require("node:stream"),node_os=require("node:os"),WebSocket=require("ws"),express=require("express"),http=require("http");function _interopNamespaceDefault(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var sp__namespace=_interopNamespaceDefault(sp),__assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},__assign.apply(this,arguments)};function __awaiter(e,t,r,i){return new(r||(r=Promise))(function(n,s){function u(e){try{o(i.next(e))}catch(e){s(e)}}function a(e){try{o(i.throw(e))}catch(e){s(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(u,a)}o((i=i.apply(e,t||[])).next())})}function __generator(e,t){var r,i,n,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(o){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(s=0)),s;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}}function __spreadArray(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var MFE_NAME="mfe.json";function fetchFileByPath(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,7,,8]),[4,fetch(e)];case 1:if(t=r.sent(),!e.split("?")[0].endsWith(".json"))return[3,5];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,t.json()];case 3:return[2,r.sent()];case 4:return r.sent(),[3,5];case 5:return[4,t.text()];case 6:return[2,r.sent()];case 7:return r.sent(),[3,8];case 8:return[2]}})})}function uniReadFile(e){try{return e.endsWith(".json")?require(e):fs$1.readFileSync(e,"utf-8")}catch(e){}return""}function writeFiles(e,t){"object"==typeof t&&t&&(t=JSON.stringify(t,null,2));var r=path.dirname(e);return fs$1.existsSync(r)||fs$1.mkdirSync(r,{recursive:!0}),fs$1.writeFileSync(e,t,"utf-8")}var checkAndgenreDir=function(e){fs$1.existsSync(e)||fs$1.mkdirSync(e,{recursive:!0})},loadViteConfig=function(e){return(0,require("vite").loadEnv)(e,process.cwd(),"MFE_")},walkDir=function(e,t){var r=path.isAbsolute(e)?e:path.resolve(process.cwd(),e),i=[],n=function(e){(fs$1.existsSync(e)?fs$1.readdirSync(e):[]).forEach(function(t){var s=path.join(e,t);fs$1.statSync(s).isDirectory()?n(s):i.push(path.relative(r,s))})};return n(r),Array.from(new Set(Array.from(t).concat(i))).sort()};function generateHash(e,t,r){if(void 0===e&&(e=""),void 0===r&&(r="hex"),"string"!=typeof e)throw new Error("Content must be a string");var i=crypto.createHash(t);return i.update(e,"utf8"),i.digest(r)}function generateSHA256(e){return generateHash(e,"sha256")}var UniCdnManager=function(){function e(){this.HOST=""}return e.prototype.setCdnHost=function(e){this.HOST=e},e.prototype.getCdnUrl=function(e){var t=e.code,r=e.mode,i=e.appCode;return["".concat(this.HOST),getManifestCdnDirUrl({mode:r,code:t,appCode:i})]},e.prototype.getManifestUrl=function(e){var t=e.code,r=e.appCode,i=e.mode;return __spreadArray(__spreadArray([],this.getCdnUrl({code:t,mode:i,appCode:r}),!0),["".concat(MANIFEST_NAME)],!1).join("/")},e}(),cdn=new UniCdnManager,SAVE_CDN_FILE_PATH=path.join(process.cwd(),"node_modules/@dd-code/uni-files");path.join(process.cwd(),"node_modules/@dd-code/current-files");var MANIFEST_NAME="mfe-uni-manifest.json",ROOT_APP_CODE="main",MANIFEST_CND_DIR_URL="{mode}/static-repository/mfe-uni/{code}/{appCode}",getManifestCdnDirUrl=function(e){var t=e.mode,r=e.code,i=e.appCode;return MANIFEST_CND_DIR_URL.replace("{mode}",t).replace("{code}",r).replace("{appCode}",i)},getMfeJson=function(){var e=uniReadFile(path.resolve(process.cwd(),MFE_NAME))||{};return e.platform=process.env.UNI_PLATFORM||"h5",e},getMainAppJson=function(e){return __awaiter(void 0,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return t=formatCliCommandConfig(e),[4,fetchFileByPath(cdn.getManifestUrl({code:t.code,appCode:ROOT_APP_CODE,mode:e}))];case 1:return[2,r.sent()]}})})},getMainAppPages=function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,getMainAppJson(e)];case 1:return[2,t.sent().apps||[{appCode:"modules/bwzb"},{appCode:"modules/manage"},{appCode:"login"}]]}})})},getPlatform=function(){return process.env.UNI_PLATFORM||"h5"},formatCliCommandConfig=function(e){var t=loadViteConfig(e||"dev"),r=t.MFE_UNI_IS_ROOT;return{isRoot:r,appCode:r?ROOT_APP_CODE:t.MFE_APP_CODE,code:t.MFE_UNI_CODE,mode:e,cdn:t.MFE_CDN_HOST}},checkIsRootManifest=function(e){return e.isRoot||e.appCode===ROOT_APP_CODE},WS_PORT=3560,WS_PATH="/__mfe__ws__",E_WS_TYPE;!function(e){e.INIT="init_files",e.CHANGE="change_files"}(E_WS_TYPE||(E_WS_TYPE={}));var getMainAppJSon=function(e,t){return path.join(SAVE_CDN_FILE_PATH,e||"dev",t,"app.json")},getMainAppJsonPath=function(){return path.join(process.env.UNI_OUTPUT_DIR,"app.json")},EPlaform;!function(e){e.H5="h5",e.MP_WEIXIN="mp-weixin"}(EPlaform||(EPlaform={}));var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},eta,hasRequiredEta,terminal,hasRequiredTerminal;function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function requireEta(){if(hasRequiredEta)return eta;hasRequiredEta=1;return eta=class{constructor(e,t,r){this.etaBufferLength=e||100,this.valueBuffer=[r],this.timeBuffer=[t],this.eta="0"}update(e,t,r){this.valueBuffer.push(t),this.timeBuffer.push(e),this.calculate(r-t)}getTime(){return this.eta}calculate(e){const t=this.valueBuffer.length,r=Math.min(this.etaBufferLength,t),i=(this.valueBuffer[t-1]-this.valueBuffer[t-r])/(this.timeBuffer[t-1]-this.timeBuffer[t-r]);this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);const n=Math.ceil(e/i/1e3);isNaN(n)?this.eta="NULL":isFinite(n)?this.eta=n>1e7?"INF":n<0?0:n:this.eta="INF"}}}function requireTerminal(){if(hasRequiredTerminal)return terminal;hasRequiredTerminal=1;const e=require$$0;return terminal=class{constructor(e){this.stream=e,this.linewrap=!0,this.dy=0}cursorSave(){this.stream.isTTY&&this.stream.write("7")}cursorRestore(){this.stream.isTTY&&this.stream.write("8")}cursor(e){this.stream.isTTY&&(e?this.stream.write("[?25h"):this.stream.write("[?25l"))}cursorTo(t=null,r=null){this.stream.isTTY&&e.cursorTo(this.stream,t,r)}cursorRelative(t=null,r=null){this.stream.isTTY&&(this.dy=this.dy+r,e.moveCursor(this.stream,t,r))}cursorRelativeReset(){this.stream.isTTY&&(e.moveCursor(this.stream,0,-this.dy),e.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&e.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&e.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&e.clearScreenDown(this.stream)}newline(){this.stream.write("\n"),this.dy++}write(e,t=!1){!0===this.linewrap&&!1===t?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("[?7h"):this.stream.write("[?7l"))}isTTY(){return!0===this.stream.isTTY}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}}}var stringWidth={exports:{}},ansiRegex,hasRequiredAnsiRegex,stripAnsi,hasRequiredStripAnsi;function requireAnsiRegex(){return hasRequiredAnsiRegex?ansiRegex:(hasRequiredAnsiRegex=1,ansiRegex=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")})}function requireStripAnsi(){if(hasRequiredStripAnsi)return stripAnsi;hasRequiredStripAnsi=1;const e=requireAnsiRegex();return stripAnsi=t=>"string"==typeof t?t.replace(e(),""):t}var isFullwidthCodePoint={exports:{}},hasRequiredIsFullwidthCodePoint,emojiRegex,hasRequiredEmojiRegex,hasRequiredStringWidth,formatValue,hasRequiredFormatValue,formatBar,hasRequiredFormatBar,formatTime,hasRequiredFormatTime,formatter,hasRequiredFormatter,options,hasRequiredOptions,genericBar,hasRequiredGenericBar,singleBar,hasRequiredSingleBar,multiBar,hasRequiredMultiBar,legacy,hasRequiredLegacy,shadesClassic,hasRequiredShadesClassic,shadesGrey,hasRequiredShadesGrey,rect,hasRequiredRect,presets,hasRequiredPresets,cliProgress,hasRequiredCliProgress;function requireIsFullwidthCodePoint(){if(hasRequiredIsFullwidthCodePoint)return isFullwidthCodePoint.exports;hasRequiredIsFullwidthCodePoint=1;const e=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141));return isFullwidthCodePoint.exports=e,isFullwidthCodePoint.exports.default=e,isFullwidthCodePoint.exports}function requireEmojiRegex(){return hasRequiredEmojiRegex?emojiRegex:(hasRequiredEmojiRegex=1,emojiRegex=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g})}function requireStringWidth(){if(hasRequiredStringWidth)return stringWidth.exports;hasRequiredStringWidth=1;const e=requireStripAnsi(),t=requireIsFullwidthCodePoint(),r=requireEmojiRegex(),i=i=>{if("string"!=typeof i||0===i.length)return 0;if(0===(i=e(i)).length)return 0;i=i.replace(r()," ");let n=0;for(let e=0;e<i.length;e++){const r=i.codePointAt(e);r<=31||r>=127&&r<=159||(r>=768&&r<=879||(r>65535&&e++,n+=t(r)?2:1))}return n};return stringWidth.exports=i,stringWidth.exports.default=i,stringWidth.exports}function requireFormatValue(){return hasRequiredFormatValue||(hasRequiredFormatValue=1,formatValue=function(e,t,r){if(!0!==t.autopadding)return e;return"percentage"===r?(i=e,(t.autopaddingChar+i).slice(-3)):e;var i}),formatValue}function requireFormatBar(){return hasRequiredFormatBar||(hasRequiredFormatBar=1,formatBar=function(e,t){const r=Math.round(e*t.barsize),i=t.barsize-r;return t.barCompleteString.substr(0,r)+t.barGlue+t.barIncompleteString.substr(0,i)}),formatBar}function requireFormatTime(){return hasRequiredFormatTime||(hasRequiredFormatTime=1,formatTime=function(e,t,r){function i(e){return r?r*Math.round(e/r):e}function n(e){return(t.autopaddingChar+e).slice(-2)}return e>3600?n(Math.floor(e/3600))+"h"+n(i(e%3600/60))+"m":e>60?n(Math.floor(e/60))+"m"+n(i(e%60))+"s":e>10?n(i(e))+"s":n(e)+"s"}),formatTime}function requireFormatter(){if(hasRequiredFormatter)return formatter;hasRequiredFormatter=1;const e=requireStringWidth(),t=requireFormatValue(),r=requireFormatBar(),i=requireFormatTime();return formatter=function(n,s,u){let a=n.format;const o=n.formatTime||i,c=n.formatValue||t,l=n.formatBar||r,D=Math.floor(100*s.progress)+"",h=s.stopTime||Date.now(),d=Math.round((h-s.startTime)/1e3),p=Object.assign({},u,{bar:l(s.progress,n),percentage:c(D,n,"percentage"),total:c(s.total,n,"total"),value:c(s.value,n,"value"),eta:c(s.eta,n,"eta"),eta_formatted:o(s.eta,n,5),duration:c(d,n,"duration"),duration_formatted:o(d,n,1)});a=a.replace(/\{(\w+)\}/g,function(e,t){return void 0!==p[t]?p[t]:e});const f=Math.max(0,s.maxWidth-e(a)-2),m=Math.floor(f/2);switch(n.align){case"right":a=f>0?" ".repeat(f)+a:a;break;case"center":a=m>0?" ".repeat(m)+a:a}return a},formatter}function requireOptions(){if(hasRequiredOptions)return options;function e(e,t){return null==e?t:e}return hasRequiredOptions=1,options={parse:function(t,r){const i={},n=Object.assign({},r,t);return i.throttleTime=1e3/e(n.fps,10),i.stream=e(n.stream,process.stderr),i.terminal=e(n.terminal,null),i.clearOnComplete=e(n.clearOnComplete,!1),i.stopOnComplete=e(n.stopOnComplete,!1),i.barsize=e(n.barsize,40),i.align=e(n.align,"left"),i.hideCursor=e(n.hideCursor,!1),i.linewrap=e(n.linewrap,!1),i.barGlue=e(n.barGlue,""),i.barCompleteChar=e(n.barCompleteChar,"="),i.barIncompleteChar=e(n.barIncompleteChar,"-"),i.format=e(n.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),i.formatTime=e(n.formatTime,null),i.formatValue=e(n.formatValue,null),i.formatBar=e(n.formatBar,null),i.etaBufferLength=e(n.etaBuffer,10),i.etaAsynchronousUpdate=e(n.etaAsynchronousUpdate,!1),i.progressCalculationRelative=e(n.progressCalculationRelative,!1),i.synchronousUpdate=e(n.synchronousUpdate,!0),i.noTTYOutput=e(n.noTTYOutput,!1),i.notTTYSchedule=e(n.notTTYSchedule,2e3),i.emptyOnZero=e(n.emptyOnZero,!1),i.forceRedraw=e(n.forceRedraw,!1),i.autopadding=e(n.autopadding,!1),i.gracefulExit=e(n.gracefulExit,!1),i},assignDerivedOptions:function(t){return t.barCompleteString=t.barCompleteChar.repeat(t.barsize+1),t.barIncompleteString=t.barIncompleteChar.repeat(t.barsize+1),t.autopaddingChar=t.autopadding?e(t.autopaddingChar," "):"",t}}}function requireGenericBar(){if(hasRequiredGenericBar)return genericBar;hasRequiredGenericBar=1;const e=requireEta(),t=requireTerminal(),r=requireFormatter(),i=requireOptions(),n=require$$4;return genericBar=class extends n{constructor(n){super(),this.options=i.assignDerivedOptions(n),this.terminal=this.options.terminal?this.options.terminal:new t(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new e(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter="function"==typeof this.options.format?this.options.format:r}render(e=!1){const t={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();const r=this.formatter(this.options,t,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=r)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(r),this.terminal.clearRight(),this.lastDrawnString=r,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(t,r,i){this.value=r||0,this.total=void 0!==t&&t>=0?t:100,this.startValue=r||0,this.payload=i||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new e(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",t,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,t={}){"number"==typeof e&&(this.value=e,this.eta.update(Date.now(),e,this.total));const r=("object"==typeof e?e:t)||{};this.emit("update",this.total,this.value);for(const e in r)this.payload[e]=r[e];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,t={}){"object"==typeof e?this.update(this.value+1,e):this.update(this.value+e,t)}getTotal(){return this.total}setTotal(e){void 0!==e&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}},genericBar}function requireSingleBar(){if(hasRequiredSingleBar)return singleBar;hasRequiredSingleBar=1;const e=requireGenericBar(),t=requireOptions();return singleBar=class extends e{constructor(e,r){super(t.parse(e,r)),this.timer=null,this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,t){this.timer&&(super.update(e,t),this.options.synchronousUpdate&&this.lastRedraw+2*this.options.throttleTime<Date.now()&&this.render())}start(e,t,r){!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),super.start(e,t,r),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}},singleBar}function requireMultiBar(){if(hasRequiredMultiBar)return multiBar;hasRequiredMultiBar=1;const e=requireTerminal(),t=requireGenericBar(),r=requireOptions(),i=require$$4;return multiBar=class extends i{constructor(t,i){super(),this.bars=[],this.options=r.parse(t,i),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new e(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,r,i,n={}){const s=new t(Object.assign({},this.options,{terminal:this.terminal},n));return this.bars.push(s),!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,s.start(e,r,i),this.emit("start")),s}remove(e){const t=this.bars.indexOf(e);return!(t<0)&&(this.bars.splice(t,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}},multiBar}function requireLegacy(){return hasRequiredLegacy?legacy:(hasRequiredLegacy=1,legacy={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"})}function requireShadesClassic(){return hasRequiredShadesClassic?shadesClassic:(hasRequiredShadesClassic=1,shadesClassic={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"})}function requireShadesGrey(){return hasRequiredShadesGrey?shadesGrey:(hasRequiredShadesGrey=1,shadesGrey={format:" [90m{bar}[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"})}function requireRect(){return hasRequiredRect?rect:(hasRequiredRect=1,rect={format:" {bar}■ {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"■",barIncompleteChar:" "})}function requirePresets(){if(hasRequiredPresets)return presets;hasRequiredPresets=1;const e=requireLegacy(),t=requireShadesClassic(),r=requireShadesGrey(),i=requireRect();return presets={legacy:e,shades_classic:t,shades_grey:r,rect:i}}function requireCliProgress(){if(hasRequiredCliProgress)return cliProgress;hasRequiredCliProgress=1;const e=requireSingleBar(),t=requireMultiBar(),r=requirePresets(),i=requireFormatter(),n=requireFormatValue(),s=requireFormatBar(),u=requireFormatTime();return cliProgress={Bar:e,SingleBar:e,MultiBar:t,Presets:r,Format:{Formatter:i,BarFormat:s,ValueFormat:n,TimeFormat:u}}}var cliProgressExports=requireCliProgress();const ANSI_BACKGROUND_OFFSET=10,wrapAnsi16=(e=0)=>t=>`[${t+e}m`,wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`,wrapAnsi16m=(e=0)=>(t,r,i)=>`[${38+e};2;${t};${r};${i}m`,styles$1={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles$1.modifier);const foregroundColorNames=Object.keys(styles$1.color),backgroundColorNames=Object.keys(styles$1.bgColor);function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(styles$1)){for(const[t,i]of Object.entries(r))styles$1[t]={open:`[${i[0]}m`,close:`[${i[1]}m`},r[t]=styles$1[t],e.set(i[0],i[1]);Object.defineProperty(styles$1,t,{value:r,enumerable:!1})}return Object.defineProperty(styles$1,"codes",{value:e,enumerable:!1}),styles$1.color.close="[39m",styles$1.bgColor.close="[49m",styles$1.color.ansi=wrapAnsi16(),styles$1.color.ansi256=wrapAnsi256(),styles$1.color.ansi16m=wrapAnsi16m(),styles$1.bgColor.ansi=wrapAnsi16(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi256=wrapAnsi256(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi16m=wrapAnsi16m(ANSI_BACKGROUND_OFFSET),Object.defineProperties(styles$1,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,255&i]},enumerable:!1},hexToAnsi256:{value:e=>styles$1.rgbToAnsi256(...styles$1.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,i;if(e>=232)t=(10*(e-232)+8)/255,r=t,i=t;else{const n=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(n/6)/5,i=n%6/5}const n=2*Math.max(t,r,i);if(0===n)return 30;let s=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return 2===n&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(e)),enumerable:!1}}),styles$1}const ansiStyles=assembleStyles(),level=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),colorSupport=0!==level&&{level:level},supportsColor={stdout:colorSupport,stderr:colorSupport};function stringReplaceAll(e,t,r){let i=e.indexOf(t);if(-1===i)return e;const n=t.length;let s=0,u="";do{u+=e.slice(s,i)+t+r,s=i+n,i=e.indexOf(t,s)}while(-1!==i);return u+=e.slice(s),u}function stringEncaseCRLFWithFirstIndex(e,t,r,i){let n=0,s="";do{const u="\r"===e[i-1];s+=e.slice(n,u?i-1:i)+t+(u?"\r\n":"\n")+r,n=i+1,i=e.indexOf("\n",n)}while(-1!==i);return s+=e.slice(n),s}const{stdout:stdoutColor,stderr:stderrColor}=supportsColor,GENERATOR=Symbol("GENERATOR"),STYLER=Symbol("STYLER"),IS_EMPTY=Symbol("IS_EMPTY"),levelMapping=["ansi","ansi","ansi256","ansi16m"],styles=Object.create(null),applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=stdoutColor?stdoutColor.level:0;e.level=void 0===t.level?r:t.level},chalkFactory=e=>{const t=(...e)=>e.join(" ");return applyOptions(t,e),Object.setPrototypeOf(t,createChalk.prototype),t};function createChalk(e){return chalkFactory(e)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[e,t]of Object.entries(ansiStyles))styles[e]={get(){const r=createBuilder(this,createStyler(t.open,t.close,this[STYLER]),this[IS_EMPTY]);return Object.defineProperty(this,e,{value:r}),r}};styles.visible={get(){const e=createBuilder(this,this[STYLER],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const getModelAnsi=(e,t,r,...i)=>"rgb"===e?"ansi16m"===t?ansiStyles[r].ansi16m(...i):"ansi256"===t?ansiStyles[r].ansi256(ansiStyles.rgbToAnsi256(...i)):ansiStyles[r].ansi(ansiStyles.rgbToAnsi(...i)):"hex"===e?getModelAnsi("rgb",t,r,...ansiStyles.hexToRgb(...i)):ansiStyles[r][e](...i),usedModels=["rgb","hex","ansi256"];for(const e of usedModels){styles[e]={get(){const{level:t}=this;return function(...r){const i=createStyler(getModelAnsi(e,levelMapping[t],"color",...r),ansiStyles.color.close,this[STYLER]);return createBuilder(this,i,this[IS_EMPTY])}}};const t="bg"+e[0].toUpperCase()+e.slice(1);styles[t]={get(){const{level:t}=this;return function(...r){const i=createStyler(getModelAnsi(e,levelMapping[t],"bgColor",...r),ansiStyles.bgColor.close,this[STYLER]);return createBuilder(this,i,this[IS_EMPTY])}}}}const proto=Object.defineProperties(()=>{},{...styles,level:{enumerable:!0,get(){return this[GENERATOR].level},set(e){this[GENERATOR].level=e}}}),createStyler=(e,t,r)=>{let i,n;return void 0===r?(i=e,n=t):(i=r.openAll+e,n=t+r.closeAll),{open:e,close:t,openAll:i,closeAll:n,parent:r}},createBuilder=(e,t,r)=>{const i=(...e)=>applyStyle(i,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(i,proto),i[GENERATOR]=e,i[STYLER]=t,i[IS_EMPTY]=r,i},applyStyle=(e,t)=>{if(e.level<=0||!t)return e[IS_EMPTY]?"":t;let r=e[STYLER];if(void 0===r)return t;const{openAll:i,closeAll:n}=r;if(t.includes(""))for(;void 0!==r;)t=stringReplaceAll(t,r.close,r.open),r=r.parent;const s=t.indexOf("\n");return-1!==s&&(t=stringEncaseCRLFWithFirstIndex(t,n,i,s)),i+t+n};Object.defineProperties(createChalk.prototype,styles);const chalk=createChalk();createChalk({level:stderrColor?stderrColor.level:0});var CliProgressManager=function(){function e(){this.barMap=new Map}return e.prototype.initMultiBar=function(e){this.multiBar=new cliProgressExports.MultiBar({clearOnComplete:!1,hideCursor:!0,format:e||"".concat(chalk.yellow("{name}"),": ").concat(chalk.blue("{bar}")," | ").concat(chalk.green("{percentage}%")," | {value}/{total}"),barCompleteChar:"█",barIncompleteChar:"░",barGlue:"",stopOnComplete:!0},cliProgressExports.Presets.shades_grey)},e.prototype.createProgressBar=function(e){var t=this;e.forEach(function(e){var r=t.multiBar.create(e.total,0,{name:e.name});t.barMap.set(e.name,r)})},e.prototype.updateProgressBar=function(e,t){var r=this.barMap.get(e);if(r){var i=r.getTotal();r.update(t),t>=i&&r.stop()}},e.prototype.stopAll=function(){this.multiBar.stop()},e}(),CliProgressManager$1=new CliProgressManager,getDownloadedFilePath=function(e){return path.resolve(SAVE_CDN_FILE_PATH,e.env,e.appCode)},getNodeModulesEnvAppCodeFilePath=function(e,t){return path.resolve(getDownloadedFilePath(e),t)},getManifestJsonUrl=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i,n,s,u,a,o;return __generator(this,function(c){switch(c.label){case 0:t=formatCliCommandConfig(e),r=t.isRoot,i=void 0!==r&&r,n=t.code,s=void 0===n?"mfe-uni":n,u=[],a=getMfeJson(),c.label=1;case 1:return c.trys.push([1,5,,6]),o=[],i?(o=a.apps||[],[3,4]):[3,2];case 2:return[4,getMainAppPages(e)];case 3:o=__spreadArray(__spreadArray([],o=c.sent(),!0),[{appCode:ROOT_APP_CODE}],!1),c.label=4;case 4:return u=Array.from(new Set(__spreadArray([],(o||[]).map(function(e){return e.appCode}),!0))),[3,6];case 5:return c.sent(),u=[],[3,6];case 6:return[2,u.map(function(t){return{url:cdn.getManifestUrl({code:s,appCode:t,mode:e}),appCode:t,code:s}})]}})})},downloadManifestJson=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r;return __generator(this,function(i){switch(i.label){case 0:return t=e.map(function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,fetchFileByPath(e).catch(function(e){})];case 1:return[2,t.sent()]}})})}),[4,Promise.all(t)];case 1:return r=i.sent(),[2,r.filter(function(e){return e})]}})})};function downloadFilesByManifestJson(e,t,r){return __awaiter(this,void 0,void 0,function(){var i,n,s,u,a,o,c,l,D,h,d,p,f;return __generator(this,function(m){switch(m.label){case 0:for(c in i=e.cdn,n=e.appCode,s=e.publicPath,u=e.files,o=[],a=u)o.push(c);l=0,m.label=1;case 1:return l<o.length?(c=o[l])in a?(h=u[D=c],d=h.fileUrl,p=h.fileName,[4,fetchFileByPath("".concat(i,"/").concat(s,"/").concat(d))]):[3,3]:[3,4];case 2:f=m.sent(),writeFiles(path.join(t,n||"",p),f),r&&r(Number(D),h.length),m.label=3;case 3:return l++,[3,1];case 4:return[2]}})})}var downloadProjectFiles=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i;return __generator(this,function(n){switch(n.label){case 0:for(i in t=[],CliProgressManager$1.initMultiBar(),CliProgressManager$1.createProgressBar(e.map(function(e){return{name:e.appCode,total:e.files.length}})),r=function(r){var i=e[r],n=downloadFilesByManifestJson(i,path.resolve(SAVE_CDN_FILE_PATH,i.mode||"dev"),function(e,t){CliProgressManager$1.updateProgressBar(i.appCode,e+1)});t.push(n)},e)r(i);return[4,Promise.all(t)];case 1:return n.sent(),CliProgressManager$1.stopAll(),[2]}})})},checkDownloadFilesIsExpired=function(e){return e.filter(function(e){var t=uniReadFile(getNodeModulesEnvAppCodeFilePath(e,MANIFEST_NAME));return!t||(null==t?void 0:t.hash)!==e.hash})},createManifestManager=function(){var e={code:"",mode:"",cdn:"",hash:"",publicPath:"",appCode:"",platform:process.env.UNI_PLATFORM||"h5",pagesJson:{},files:[]};return{get value(){return e},setFiles:function(t,r){var i=r.map(function(e){var r=path.resolve(t,e),i=generateSHA256(fs$1.readFileSync(r,"utf-8"));return{fileName:e,fileUrl:"".concat(i.slice(0,8),"_").concat(path.basename(e))}});e.files=i},setPagesJson:function(t){e.pagesJson=t},saveFile:function(t){var r=e.files.filter(function(e){return e.fileName!==MANIFEST_NAME});e.hash=generateSHA256(JSON.stringify(__assign(__assign({},e),{files:r}))),writeFiles(path.resolve(t,MANIFEST_NAME),JSON.stringify(e,null,2))},setEnv:function(t){var r=formatCliCommandConfig(t),i=getMfeJson();e.cdn=r.cdn,e.mode=t,e.code=r.code,e.appCode=r.appCode,cdn.setCdnHost(r.cdn),r.isRoot&&(e.isRoot=!0,e.apps=i.apps),e.publicPath=getManifestCdnDirUrl(e)},dependencies:[],setDependencies:function(e){this.dependencies=e}}},resetOutDir=function(e,t){var r,i=new RegExp("/(".concat(e.value.appCode,")/?"));process.env.MFE_SOURCE_OUTPUT_DIR=t.build.outDir,process.env.MFE_ROOT_OUTPUT_DIR=null===(r=process.env.MFE_SOURCE_OUTPUT_DIR)||void 0===r?void 0:r.replace(i,"/").replace(/\/$/,""),process.env.UNI_OUTPUT_DIR=process.env.MFE_ROOT_OUTPUT_DIR},fs={},universalify={},hasRequiredUniversalify,polyfills,hasRequiredPolyfills,legacyStreams,hasRequiredLegacyStreams,clone_1,hasRequiredClone,gracefulFs,hasRequiredGracefulFs,hasRequiredFs;function requireUniversalify(){return hasRequiredUniversalify||(hasRequiredUniversalify=1,universalify.fromCallback=function(e){return Object.defineProperty(function(...t){if("function"!=typeof t[t.length-1])return new Promise((r,i)=>{t.push((e,t)=>null!=e?i(e):r(t)),e.apply(this,t)});e.apply(this,t)},"name",{value:e.name})},universalify.fromPromise=function(e){return Object.defineProperty(function(...t){const r=t[t.length-1];if("function"!=typeof r)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>r(null,e),r)},"name",{value:e.name})}),universalify}function requirePolyfills(){if(hasRequiredPolyfills)return polyfills;hasRequiredPolyfills=1;var e=require$$0$1,t=process.cwd,r=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return r||(r=t.call(process)),r};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var n=process.chdir;process.chdir=function(e){r=null,n.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,n)}return polyfills=function(t){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(r,i,n){t.open(r,e.O_WRONLY|e.O_SYMLINK,i,function(e,r){e?n&&n(e):t.fchmod(r,i,function(e){t.close(r,function(t){n&&n(e||t)})})})},t.lchmodSync=function(r,i){var n,s=t.openSync(r,e.O_WRONLY|e.O_SYMLINK,i),u=!0;try{n=t.fchmodSync(s,i),u=!1}finally{if(u)try{t.closeSync(s)}catch(e){}else t.closeSync(s)}return n}}(t);t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(r,i,n,s){t.open(r,e.O_SYMLINK,function(e,r){e?s&&s(e):t.futimes(r,i,n,function(e){t.close(r,function(t){s&&s(e||t)})})})},t.lutimesSync=function(r,i,n){var s,u=t.openSync(r,e.O_SYMLINK),a=!0;try{s=t.futimesSync(u,i,n),a=!1}finally{if(a)try{t.closeSync(u)}catch(e){}else t.closeSync(u)}return s}):t.futimes&&(t.lutimes=function(e,t,r,i){i&&process.nextTick(i)},t.lutimesSync=function(){})}(t);t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=u(t.chownSync),t.fchownSync=u(t.fchownSync),t.lchownSync=u(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=o(t.statSync),t.fstatSync=o(t.fstatSync),t.lstatSync=o(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(e,t,r){r&&process.nextTick(r)},t.lchmodSync=function(){});t.chown&&!t.lchown&&(t.lchown=function(e,t,r,i){i&&process.nextTick(i)},t.lchownSync=function(){});"win32"===i&&(t.rename="function"!=typeof t.rename?t.rename:function(e){function r(r,i,n){var s=Date.now(),u=0;e(r,i,function a(o){if(o&&("EACCES"===o.code||"EPERM"===o.code||"EBUSY"===o.code)&&Date.now()-s<6e4)return setTimeout(function(){t.stat(i,function(t,s){t&&"ENOENT"===t.code?e(r,i,a):n(o)})},u),void(u<100&&(u+=10));n&&n(o)})}return Object.setPrototypeOf&&Object.setPrototypeOf(r,e),r}(t.rename));function r(e){return e?function(r,i,n){return e.call(t,r,i,function(e){c(e)&&(e=null),n&&n.apply(this,arguments)})}:e}function n(e){return e?function(r,i){try{return e.call(t,r,i)}catch(e){if(!c(e))throw e}}:e}function s(e){return e?function(r,i,n,s){return e.call(t,r,i,n,function(e){c(e)&&(e=null),s&&s.apply(this,arguments)})}:e}function u(e){return e?function(r,i,n){try{return e.call(t,r,i,n)}catch(e){if(!c(e))throw e}}:e}function a(e){return e?function(r,i,n){function s(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof i&&(n=i,i=null),i?e.call(t,r,i,s):e.call(t,r,s)}:e}function o(e){return e?function(r,i){var n=i?e.call(t,r,i):e.call(t,r);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function c(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}t.read="function"!=typeof t.read?t.read:function(e){function r(r,i,n,s,u,a){var o;if(a&&"function"==typeof a){var c=0;o=function(l,D,h){if(l&&"EAGAIN"===l.code&&c<10)return c++,e.call(t,r,i,n,s,u,o);a.apply(this,arguments)}}return e.call(t,r,i,n,s,u,o)}return Object.setPrototypeOf&&Object.setPrototypeOf(r,e),r}(t.read),t.readSync="function"!=typeof t.readSync?t.readSync:(l=t.readSync,function(e,r,i,n,s){for(var u=0;;)try{return l.call(t,e,r,i,n,s)}catch(e){if("EAGAIN"===e.code&&u<10){u++;continue}throw e}});var l},polyfills}function requireLegacyStreams(){if(hasRequiredLegacyStreams)return legacyStreams;hasRequiredLegacyStreams=1;var e=require$$0$2.Stream;return legacyStreams=function(t){return{ReadStream:function r(i,n){if(!(this instanceof r))return new r(i,n);e.call(this);var s=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,n=n||{};for(var u=Object.keys(n),a=0,o=u.length;a<o;a++){var c=u[a];this[c]=n[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick(function(){s._read()});t.open(this.path,this.flags,this.mode,function(e,t){if(e)return s.emit("error",e),void(s.readable=!1);s.fd=t,s.emit("open",t),s._read()})},WriteStream:function r(i,n){if(!(this instanceof r))return new r(i,n);e.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),u=0,a=s.length;u<a;u++){var o=s[u];this[o]=n[o]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},legacyStreams}function requireClone(){if(hasRequiredClone)return clone_1;hasRequiredClone=1,clone_1=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var r={__proto__:e(t)};else r=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}),r};var e=Object.getPrototypeOf||function(e){return e.__proto__};return clone_1}function requireGracefulFs(){if(hasRequiredGracefulFs)return gracefulFs;hasRequiredGracefulFs=1;var e,t,r=fs$1,i=requirePolyfills(),n=requireLegacyStreams(),s=requireClone(),u=require$$4$1;function a(t,r){Object.defineProperty(t,e,{get:function(){return r}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),t=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var o,c=function(){};if(u.debuglog?c=u.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(c=function(){var e=u.format.apply(u,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ")}),!r[e]){var l=commonjsGlobal[e]||[];a(r,l),r.close=function(e){function i(t,i){return e.call(r,t,function(e){e||d(),"function"==typeof i&&i.apply(this,arguments)})}return Object.defineProperty(i,t,{value:e}),i}(r.close),r.closeSync=function(e){function i(t){e.apply(r,arguments),d()}return Object.defineProperty(i,t,{value:e}),i}(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){c(r[e]),require$$5.equal(r[e].length,0)})}function D(e){i(e),e.gracefulify=D,e.createReadStream=function(t,r){return new e.ReadStream(t,r)},e.createWriteStream=function(t,r){return new e.WriteStream(t,r)};var t=e.readFile;e.readFile=function(e,r,i){"function"==typeof r&&(i=r,r=null);return function e(r,i,n,s){return t(r,i,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof n&&n.apply(this,arguments):h([e,[r,i,n],t,s||Date.now(),Date.now()])})}(e,r,i)};var r=e.writeFile;e.writeFile=function(e,t,i,n){"function"==typeof i&&(n=i,i=null);return function e(t,i,n,s,u){return r(t,i,n,function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof s&&s.apply(this,arguments):h([e,[t,i,n,s],r,u||Date.now(),Date.now()])})}(e,t,i,n)};var s=e.appendFile;s&&(e.appendFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,n,u){return s(t,r,i,function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],s,u||Date.now(),Date.now()])})}(e,t,r,i)});var u=e.copyFile;u&&(e.copyFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=0);return function e(t,r,i,n,s){return u(t,r,i,function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],u,s||Date.now(),Date.now()])})}(e,t,r,i)});var a=e.readdir;e.readdir=function(e,t,r){"function"==typeof t&&(r=t,t=null);var i=o.test(process.version)?function(e,t,r,i){return a(e,n(e,t,r,i))}:function(e,t,r,i){return a(e,t,n(e,t,r,i))};return i(e,t,r);function n(e,t,r,n){return function(s,u){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?(u&&u.sort&&u.sort(),"function"==typeof r&&r.call(this,s,u)):h([i,[e,t,r],s,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var c=n(e);m=c.ReadStream,y=c.WriteStream}var l=e.ReadStream;l&&(m.prototype=Object.create(l.prototype),m.prototype.open=function(){var e=this;F(e.path,e.flags,e.mode,function(t,r){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r),e.read())})});var d=e.WriteStream;d&&(y.prototype=Object.create(d.prototype),y.prototype.open=function(){var e=this;F(e.path,e.flags,e.mode,function(t,r){t?(e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r))})}),Object.defineProperty(e,"ReadStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var p=m;Object.defineProperty(e,"FileReadStream",{get:function(){return p},set:function(e){p=e},enumerable:!0,configurable:!0});var f=y;function m(e,t){return this instanceof m?(l.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function y(e,t){return this instanceof y?(d.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var E=e.open;function F(e,t,r,i){return"function"==typeof r&&(i=r,r=null),function e(t,r,i,n,s){return E(t,r,i,function(u,a){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],u,s||Date.now(),Date.now()])})}(e,t,r,i)}return e.open=F,e}function h(t){c("ENQUEUE",t[0].name,t[1]),r[e].push(t),p()}function d(){for(var t=Date.now(),i=0;i<r[e].length;++i)r[e][i].length>2&&(r[e][i][3]=t,r[e][i][4]=t);p()}function p(){if(clearTimeout(o),o=void 0,0!==r[e].length){var t=r[e].shift(),i=t[0],n=t[1],s=t[2],u=t[3],a=t[4];if(void 0===u)c("RETRY",i.name,n),i.apply(null,n);else if(Date.now()-u>=6e4){c("TIMEOUT",i.name,n);var l=n.pop();"function"==typeof l&&l.call(null,s)}else{var D=Date.now()-a,h=Math.max(a-u,1);D>=Math.min(1.2*h,100)?(c("RETRY",i.name,n),i.apply(null,n.concat([u]))):r[e].push(t)}void 0===o&&(o=setTimeout(p,0))}}return commonjsGlobal[e]||a(commonjsGlobal,r[e]),gracefulFs=D(s(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(gracefulFs=D(r),r.__patched=!0),gracefulFs}function requireFs(){return hasRequiredFs||(hasRequiredFs=1,function(e){const t=requireUniversalify().fromCallback,r=requireGracefulFs(),i=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(e=>"function"==typeof r[e]);Object.assign(e,r),i.forEach(i=>{e[i]=t(r[i])}),e.exists=function(e,t){return"function"==typeof t?r.exists(e,t):new Promise(t=>r.exists(e,t))},e.read=function(e,t,i,n,s,u){return"function"==typeof u?r.read(e,t,i,n,s,u):new Promise((u,a)=>{r.read(e,t,i,n,s,(e,t,r)=>{if(e)return a(e);u({bytesRead:t,buffer:r})})})},e.write=function(e,t,...i){return"function"==typeof i[i.length-1]?r.write(e,t,...i):new Promise((n,s)=>{r.write(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffer:r})})})},e.readv=function(e,t,...i){return"function"==typeof i[i.length-1]?r.readv(e,t,...i):new Promise((n,s)=>{r.readv(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesRead:t,buffers:r})})})},e.writev=function(e,t,...i){return"function"==typeof i[i.length-1]?r.writev(e,t,...i):new Promise((n,s)=>{r.writev(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffers:r})})})},"function"==typeof r.realpath.native?e.realpath.native=t(r.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(fs)),fs}var makeDir={},utils$1={},hasRequiredUtils$1,hasRequiredMakeDir,mkdirs,hasRequiredMkdirs,pathExists_1,hasRequiredPathExists,utimes,hasRequiredUtimes,stat,hasRequiredStat,async,hasRequiredAsync,copy_1,hasRequiredCopy$1,copySync_1,hasRequiredCopySync,copy,hasRequiredCopy,remove_1,hasRequiredRemove,empty,hasRequiredEmpty,file,hasRequiredFile,link,hasRequiredLink,symlinkPaths_1,hasRequiredSymlinkPaths,symlinkType_1,hasRequiredSymlinkType,symlink,hasRequiredSymlink,ensure,hasRequiredEnsure,utils,hasRequiredUtils,jsonfile$1,hasRequiredJsonfile$1,jsonfile,hasRequiredJsonfile,outputFile_1,hasRequiredOutputFile,outputJson_1,hasRequiredOutputJson,outputJsonSync_1,hasRequiredOutputJsonSync,json,hasRequiredJson,move_1,hasRequiredMove$1,moveSync_1,hasRequiredMoveSync,move,hasRequiredMove,lib$1,hasRequiredLib$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;const e=path;return utils$1.checkPath=function(t){if("win32"===process.platform){if(/[<>:"|?*]/.test(t.replace(e.parse(t).root,""))){const e=new Error(`Path contains invalid characters: ${t}`);throw e.code="EINVAL",e}}},utils$1}function requireMakeDir(){if(hasRequiredMakeDir)return makeDir;hasRequiredMakeDir=1;const e=requireFs(),{checkPath:t}=requireUtils$1(),r=e=>"number"==typeof e?e:{mode:511,...e}.mode;return makeDir.makeDir=async(i,n)=>(t(i),e.mkdir(i,{mode:r(n),recursive:!0})),makeDir.makeDirSync=(i,n)=>(t(i),e.mkdirSync(i,{mode:r(n),recursive:!0})),makeDir}function requireMkdirs(){if(hasRequiredMkdirs)return mkdirs;hasRequiredMkdirs=1;const e=requireUniversalify().fromPromise,{makeDir:t,makeDirSync:r}=requireMakeDir(),i=e(t);return mkdirs={mkdirs:i,mkdirsSync:r,mkdirp:i,mkdirpSync:r,ensureDir:i,ensureDirSync:r}}function requirePathExists(){if(hasRequiredPathExists)return pathExists_1;hasRequiredPathExists=1;const e=requireUniversalify().fromPromise,t=requireFs();return pathExists_1={pathExists:e(function(e){return t.access(e).then(()=>!0).catch(()=>!1)}),pathExistsSync:t.existsSync},pathExists_1}function requireUtimes(){if(hasRequiredUtimes)return utimes;hasRequiredUtimes=1;const e=requireFs(),t=requireUniversalify().fromPromise;return utimes={utimesMillis:t(async function(t,r,i){const n=await e.open(t,"r+");let s=null;try{await e.futimes(n,r,i)}finally{try{await e.close(n)}catch(e){s=e}}if(s)throw s}),utimesMillisSync:function(t,r,i){const n=e.openSync(t,"r+");return e.futimesSync(n,r,i),e.closeSync(n)}},utimes}function requireStat(){if(hasRequiredStat)return stat;hasRequiredStat=1;const e=requireFs(),t=path,r=requireUniversalify().fromPromise;function i(e,t){return void 0!==t.ino&&void 0!==t.dev&&t.ino===e.ino&&t.dev===e.dev}function n(e,r){const i=t.resolve(e).split(t.sep).filter(e=>e),n=t.resolve(r).split(t.sep).filter(e=>e);return i.every((e,t)=>n[t]===e)}function s(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}return stat={checkPaths:r(async function(r,u,a,o){const{srcStat:c,destStat:l}=await function(t,r,i){const n=i.dereference?t=>e.stat(t,{bigint:!0}):t=>e.lstat(t,{bigint:!0});return Promise.all([n(t),n(r).catch(e=>{if("ENOENT"===e.code)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}(r,u,o);if(l){if(i(c,l)){const e=t.basename(r),i=t.basename(u);if("move"===a&&e!==i&&e.toLowerCase()===i.toLowerCase())return{srcStat:c,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${r}'.`);if(!c.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${r}'.`)}if(c.isDirectory()&&n(r,u))throw new Error(s(r,u,a));return{srcStat:c,destStat:l}}),checkPathsSync:function(r,u,a,o){const{srcStat:c,destStat:l}=function(t,r,i){let n;const s=i.dereference?t=>e.statSync(t,{bigint:!0}):t=>e.lstatSync(t,{bigint:!0}),u=s(t);try{n=s(r)}catch(e){if("ENOENT"===e.code)return{srcStat:u,destStat:null};throw e}return{srcStat:u,destStat:n}}(r,u,o);if(l){if(i(c,l)){const e=t.basename(r),i=t.basename(u);if("move"===a&&e!==i&&e.toLowerCase()===i.toLowerCase())return{srcStat:c,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${r}'.`);if(!c.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${r}'.`)}if(c.isDirectory()&&n(r,u))throw new Error(s(r,u,a));return{srcStat:c,destStat:l}},checkParentPaths:r(async function r(n,u,a,o){const c=t.resolve(t.dirname(n)),l=t.resolve(t.dirname(a));if(l===c||l===t.parse(l).root)return;let D;try{D=await e.stat(l,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(i(u,D))throw new Error(s(n,a,o));return r(n,u,l,o)}),checkParentPathsSync:function r(n,u,a,o){const c=t.resolve(t.dirname(n)),l=t.resolve(t.dirname(a));if(l===c||l===t.parse(l).root)return;let D;try{D=e.statSync(l,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(i(u,D))throw new Error(s(n,a,o));return r(n,u,l,o)},isSrcSubdir:n,areIdentical:i},stat}function requireAsync(){if(hasRequiredAsync)return async;return hasRequiredAsync=1,async={asyncIteratorConcurrentProcess:async function(e,t){const r=[];for await(const i of e)r.push(t(i).then(()=>null,e=>e??new Error("unknown error")));await Promise.all(r.map(e=>e.then(e=>{if(null!==e)throw e})))}},async}function requireCopy$1(){if(hasRequiredCopy$1)return copy_1;hasRequiredCopy$1=1;const e=requireFs(),t=path,{mkdirs:r}=requireMkdirs(),{pathExists:i}=requirePathExists(),{utimesMillis:n}=requireUtimes(),s=requireStat(),{asyncIteratorConcurrentProcess:u}=requireAsync();async function a(e,t,r){return!r.filter||r.filter(e,t)}async function o(r,i,n,l){const D=l.dereference?e.stat:e.lstat,h=await D(i);if(h.isDirectory())return async function(r,i,n,c,l){i||await e.mkdir(c);await u(await e.opendir(n),async e=>{const r=t.join(n,e.name),i=t.join(c,e.name);if(await a(r,i,l)){const{destStat:e}=await s.checkPaths(r,i,"copy",l);await o(e,r,i,l)}}),i||await e.chmod(c,r.mode)}(h,r,i,n,l);if(h.isFile()||h.isCharacterDevice()||h.isBlockDevice())return async function(t,r,i,n,s){if(!r)return c(t,i,n,s);if(s.overwrite)return await e.unlink(n),c(t,i,n,s);if(s.errorOnExist)throw new Error(`'${n}' already exists`)}(h,r,i,n,l);if(h.isSymbolicLink())return async function(r,i,n,u){let a=await e.readlink(i);u.dereference&&(a=t.resolve(process.cwd(),a));if(!r)return e.symlink(a,n);let o=null;try{o=await e.readlink(n)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return e.symlink(a,n);throw t}u.dereference&&(o=t.resolve(process.cwd(),o));if(s.isSrcSubdir(a,o))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${o}'.`);if(s.isSrcSubdir(o,a))throw new Error(`Cannot overwrite '${o}' with '${a}'.`);return await e.unlink(n),e.symlink(a,n)}(r,i,n,l);if(h.isSocket())throw new Error(`Cannot copy a socket file: ${i}`);if(h.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${i}`);throw new Error(`Unknown file: ${i}`)}async function c(t,r,i,s){if(await e.copyFile(r,i),s.preserveTimestamps){128&t.mode||await function(t,r){return e.chmod(t,128|r)}(i,t.mode);const s=await e.stat(r);await n(i,s.atime,s.mtime)}return e.chmod(i,t.mode)}return copy_1=async function(e,n,u={}){"function"==typeof u&&(u={filter:u}),u.clobber=!("clobber"in u)||!!u.clobber,u.overwrite="overwrite"in u?!!u.overwrite:u.clobber,u.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001");const{srcStat:c,destStat:l}=await s.checkPaths(e,n,"copy",u);if(await s.checkParentPaths(e,c,n,"copy"),!await a(e,n,u))return;const D=t.dirname(n);await i(D)||await r(D),await o(l,e,n,u)}}function requireCopySync(){if(hasRequiredCopySync)return copySync_1;hasRequiredCopySync=1;const e=requireGracefulFs(),t=path,r=requireMkdirs().mkdirsSync,i=requireUtimes().utimesMillisSync,n=requireStat();function s(r,i,s,c){const l=(c.dereference?e.statSync:e.lstatSync)(i);if(l.isDirectory())return function(t,r,i,n,s){return r?o(i,n,s):function(t,r,i,n){return e.mkdirSync(i),o(r,i,n),a(i,t)}(t.mode,i,n,s)}(l,r,i,s,c);if(l.isFile()||l.isCharacterDevice()||l.isBlockDevice())return function(t,r,i,n,s){return r?function(t,r,i,n){if(n.overwrite)return e.unlinkSync(i),u(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}(t,i,n,s):u(t,i,n,s)}(l,r,i,s,c);if(l.isSymbolicLink())return function(r,i,s,u){let a=e.readlinkSync(i);u.dereference&&(a=t.resolve(process.cwd(),a));if(r){let r;try{r=e.readlinkSync(s)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return e.symlinkSync(a,s);throw t}if(u.dereference&&(r=t.resolve(process.cwd(),r)),n.isSrcSubdir(a,r))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${r}'.`);if(n.isSrcSubdir(r,a))throw new Error(`Cannot overwrite '${r}' with '${a}'.`);return function(t,r){return e.unlinkSync(r),e.symlinkSync(t,r)}(a,s)}return e.symlinkSync(a,s)}(r,i,s,c);if(l.isSocket())throw new Error(`Cannot copy a socket file: ${i}`);if(l.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${i}`);throw new Error(`Unknown file: ${i}`)}function u(t,r,n,s){return e.copyFileSync(r,n),s.preserveTimestamps&&function(t,r,n){(function(e){return!(128&e)})(t)&&function(e,t){a(e,128|t)}(n,t);(function(t,r){const n=e.statSync(t);i(r,n.atime,n.mtime)})(r,n)}(t.mode,r,n),a(n,t.mode)}function a(t,r){return e.chmodSync(t,r)}function o(t,r,i){const n=e.opendirSync(t);try{let e;for(;null!==(e=n.readSync());)c(e.name,t,r,i)}finally{n.closeSync()}}function c(e,r,i,u){const a=t.join(r,e),o=t.join(i,e);if(u.filter&&!u.filter(a,o))return;const{destStat:c}=n.checkPathsSync(a,o,"copy",u);return s(c,a,o,u)}return copySync_1=function(i,u,a){"function"==typeof a&&(a={filter:a}),(a=a||{}).clobber=!("clobber"in a)||!!a.clobber,a.overwrite="overwrite"in a?!!a.overwrite:a.clobber,a.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:o,destStat:c}=n.checkPathsSync(i,u,"copy",a);if(n.checkParentPathsSync(i,o,u,"copy"),a.filter&&!a.filter(i,u))return;const l=t.dirname(u);return e.existsSync(l)||r(l),s(c,i,u,a)}}function requireCopy(){if(hasRequiredCopy)return copy;hasRequiredCopy=1;const e=requireUniversalify().fromPromise;return copy={copy:e(requireCopy$1()),copySync:requireCopySync()}}function requireRemove(){if(hasRequiredRemove)return remove_1;hasRequiredRemove=1;const e=requireGracefulFs(),t=requireUniversalify().fromCallback;return remove_1={remove:t(function(t,r){e.rm(t,{recursive:!0,force:!0},r)}),removeSync:function(t){e.rmSync(t,{recursive:!0,force:!0})}},remove_1}function requireEmpty(){if(hasRequiredEmpty)return empty;hasRequiredEmpty=1;const e=requireUniversalify().fromPromise,t=requireFs(),r=path,i=requireMkdirs(),n=requireRemove(),s=e(async function(e){let s;try{s=await t.readdir(e)}catch{return i.mkdirs(e)}return Promise.all(s.map(t=>n.remove(r.join(e,t))))});function u(e){let s;try{s=t.readdirSync(e)}catch{return i.mkdirsSync(e)}s.forEach(t=>{t=r.join(e,t),n.removeSync(t)})}return empty={emptyDirSync:u,emptydirSync:u,emptyDir:s,emptydir:s}}function requireFile(){if(hasRequiredFile)return file;hasRequiredFile=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),i=requireMkdirs();return file={createFile:e(async function(e){let n;try{n=await r.stat(e)}catch{}if(n&&n.isFile())return;const s=t.dirname(e);let u=null;try{u=await r.stat(s)}catch(t){if("ENOENT"===t.code)return await i.mkdirs(s),void await r.writeFile(e,"");throw t}u.isDirectory()?await r.writeFile(e,""):await r.readdir(s)}),createFileSync:function(e){let n;try{n=r.statSync(e)}catch{}if(n&&n.isFile())return;const s=t.dirname(e);try{r.statSync(s).isDirectory()||r.readdirSync(s)}catch(e){if(!e||"ENOENT"!==e.code)throw e;i.mkdirsSync(s)}r.writeFileSync(e,"")}}}function requireLink(){if(hasRequiredLink)return link;hasRequiredLink=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),i=requireMkdirs(),{pathExists:n}=requirePathExists(),{areIdentical:s}=requireStat();return link={createLink:e(async function(e,u){let a,o;try{a=await r.lstat(u)}catch{}try{o=await r.lstat(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}if(a&&s(o,a))return;const c=t.dirname(u);await n(c)||await i.mkdirs(c),await r.link(e,u)}),createLinkSync:function(e,n){let u;try{u=r.lstatSync(n)}catch{}try{const t=r.lstatSync(e);if(u&&s(t,u))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const a=t.dirname(n);return r.existsSync(a)||i.mkdirsSync(a),r.linkSync(e,n)}}}function requireSymlinkPaths(){if(hasRequiredSymlinkPaths)return symlinkPaths_1;hasRequiredSymlinkPaths=1;const e=path,t=requireFs(),{pathExists:r}=requirePathExists(),i=requireUniversalify().fromPromise;return symlinkPaths_1={symlinkPaths:i(async function(i,n){if(e.isAbsolute(i)){try{await t.lstat(i)}catch(e){throw e.message=e.message.replace("lstat","ensureSymlink"),e}return{toCwd:i,toDst:i}}const s=e.dirname(n),u=e.join(s,i);if(await r(u))return{toCwd:u,toDst:i};try{await t.lstat(i)}catch(e){throw e.message=e.message.replace("lstat","ensureSymlink"),e}return{toCwd:i,toDst:e.relative(s,i)}}),symlinkPathsSync:function(r,i){if(e.isAbsolute(r)){if(!t.existsSync(r))throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}const n=e.dirname(i),s=e.join(n,r);if(t.existsSync(s))return{toCwd:s,toDst:r};if(!t.existsSync(r))throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:e.relative(n,r)}}}}function requireSymlinkType(){if(hasRequiredSymlinkType)return symlinkType_1;hasRequiredSymlinkType=1;const e=requireFs(),t=requireUniversalify().fromPromise;return symlinkType_1={symlinkType:t(async function(t,r){if(r)return r;let i;try{i=await e.lstat(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}),symlinkTypeSync:function(t,r){if(r)return r;let i;try{i=e.lstatSync(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}}}function requireSymlink(){if(hasRequiredSymlink)return symlink;hasRequiredSymlink=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),{mkdirs:i,mkdirsSync:n}=requireMkdirs(),{symlinkPaths:s,symlinkPathsSync:u}=requireSymlinkPaths(),{symlinkType:a,symlinkTypeSync:o}=requireSymlinkType(),{pathExists:c}=requirePathExists(),{areIdentical:l}=requireStat();return symlink={createSymlink:e(async function(e,n,u){let o;try{o=await r.lstat(n)}catch{}if(o&&o.isSymbolicLink()){const[t,i]=await Promise.all([r.stat(e),r.stat(n)]);if(l(t,i))return}const D=await s(e,n);e=D.toDst;const h=await a(D.toCwd,u),d=t.dirname(n);return await c(d)||await i(d),r.symlink(e,n,h)}),createSymlinkSync:function(e,i,s){let a;try{a=r.lstatSync(i)}catch{}if(a&&a.isSymbolicLink()){const t=r.statSync(e),n=r.statSync(i);if(l(t,n))return}const c=u(e,i);e=c.toDst,s=o(c.toCwd,s);const D=t.dirname(i);return r.existsSync(D)||n(D),r.symlinkSync(e,i,s)}}}function requireEnsure(){if(hasRequiredEnsure)return ensure;hasRequiredEnsure=1;const{createFile:e,createFileSync:t}=requireFile(),{createLink:r,createLinkSync:i}=requireLink(),{createSymlink:n,createSymlinkSync:s}=requireSymlink();return ensure={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:r,createLinkSync:i,ensureLink:r,ensureLinkSync:i,createSymlink:n,createSymlinkSync:s,ensureSymlink:n,ensureSymlinkSync:s}}function requireUtils(){if(hasRequiredUtils)return utils;return hasRequiredUtils=1,utils={stringify:function(e,{EOL:t="\n",finalEOL:r=!0,replacer:i=null,spaces:n}={}){const s=r?t:"";return JSON.stringify(e,i,n).replace(/\n/g,t)+s},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}}}function requireJsonfile$1(){if(hasRequiredJsonfile$1)return jsonfile$1;let e;hasRequiredJsonfile$1=1;try{e=requireGracefulFs()}catch(t){e=fs$1}const t=requireUniversalify(),{stringify:r,stripBom:i}=requireUtils();const n=t.fromPromise(async function(r,n={}){"string"==typeof n&&(n={encoding:n});const s=n.fs||e,u=!("throws"in n)||n.throws;let a,o=await t.fromCallback(s.readFile)(r,n);o=i(o);try{a=JSON.parse(o,n?n.reviver:null)}catch(e){if(u)throw e.message=`${r}: ${e.message}`,e;return null}return a});const s=t.fromPromise(async function(i,n,s={}){const u=s.fs||e,a=r(n,s);await t.fromCallback(u.writeFile)(i,a,s)});return jsonfile$1={readFile:n,readFileSync:function(t,r={}){"string"==typeof r&&(r={encoding:r});const n=r.fs||e,s=!("throws"in r)||r.throws;try{let e=n.readFileSync(t,r);return e=i(e),JSON.parse(e,r.reviver)}catch(e){if(s)throw e.message=`${t}: ${e.message}`,e;return null}},writeFile:s,writeFileSync:function(t,i,n={}){const s=n.fs||e,u=r(i,n);return s.writeFileSync(t,u,n)}},jsonfile$1}function requireJsonfile(){if(hasRequiredJsonfile)return jsonfile;hasRequiredJsonfile=1;const e=requireJsonfile$1();return jsonfile={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync}}function requireOutputFile(){if(hasRequiredOutputFile)return outputFile_1;hasRequiredOutputFile=1;const e=requireUniversalify().fromPromise,t=requireFs(),r=path,i=requireMkdirs(),n=requirePathExists().pathExists;return outputFile_1={outputFile:e(async function(e,s,u="utf-8"){const a=r.dirname(e);return await n(a)||await i.mkdirs(a),t.writeFile(e,s,u)}),outputFileSync:function(e,...n){const s=r.dirname(e);t.existsSync(s)||i.mkdirsSync(s),t.writeFileSync(e,...n)}},outputFile_1}function requireOutputJson(){if(hasRequiredOutputJson)return outputJson_1;hasRequiredOutputJson=1;const{stringify:e}=requireUtils(),{outputFile:t}=requireOutputFile();return outputJson_1=async function(r,i,n={}){const s=e(i,n);await t(r,s,n)},outputJson_1}function requireOutputJsonSync(){if(hasRequiredOutputJsonSync)return outputJsonSync_1;hasRequiredOutputJsonSync=1;const{stringify:e}=requireUtils(),{outputFileSync:t}=requireOutputFile();return outputJsonSync_1=function(r,i,n){const s=e(i,n);t(r,s,n)},outputJsonSync_1}function requireJson(){if(hasRequiredJson)return json;hasRequiredJson=1;const e=requireUniversalify().fromPromise,t=requireJsonfile();return t.outputJson=e(requireOutputJson()),t.outputJsonSync=requireOutputJsonSync(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,json=t}function requireMove$1(){if(hasRequiredMove$1)return move_1;hasRequiredMove$1=1;const e=requireFs(),t=path,{copy:r}=requireCopy(),{remove:i}=requireRemove(),{mkdirp:n}=requireMkdirs(),{pathExists:s}=requirePathExists(),u=requireStat();return move_1=async function(a,o,c={}){const l=c.overwrite||c.clobber||!1,{srcStat:D,isChangingCase:h=!1}=await u.checkPaths(a,o,"move",c);await u.checkParentPaths(a,D,o,"move");const d=t.dirname(o);return t.parse(d).root!==d&&await n(d),async function(t,n,u,a){if(!a)if(u)await i(n);else if(await s(n))throw new Error("dest already exists.");try{await e.rename(t,n)}catch(e){if("EXDEV"!==e.code)throw e;await async function(e,t,n){const s={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return await r(e,t,s),i(e)}(t,n,u)}}(a,o,l,h)}}function requireMoveSync(){if(hasRequiredMoveSync)return moveSync_1;hasRequiredMoveSync=1;const e=requireGracefulFs(),t=path,r=requireCopy().copySync,i=requireRemove().removeSync,n=requireMkdirs().mkdirpSync,s=requireStat();function u(t,n,s){try{e.renameSync(t,n)}catch(e){if("EXDEV"!==e.code)throw e;return function(e,t,n){const s={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return r(e,t,s),i(e)}(t,n,s)}}return moveSync_1=function(r,a,o){const c=(o=o||{}).overwrite||o.clobber||!1,{srcStat:l,isChangingCase:D=!1}=s.checkPathsSync(r,a,"move",o);return s.checkParentPathsSync(r,l,a,"move"),function(e){const r=t.dirname(e);return t.parse(r).root===r}(a)||n(t.dirname(a)),function(t,r,n,s){if(s)return u(t,r,n);if(n)return i(r),u(t,r,n);if(e.existsSync(r))throw new Error("dest already exists.");return u(t,r,n)}(r,a,c,D)}}function requireMove(){if(hasRequiredMove)return move;hasRequiredMove=1;const e=requireUniversalify().fromPromise;return move={move:e(requireMove$1()),moveSync:requireMoveSync()}}function requireLib$1(){return hasRequiredLib$1?lib$1:(hasRequiredLib$1=1,lib$1={...requireFs(),...requireCopy(),...requireEmpty(),...requireEnsure(),...requireJson(),...requireMkdirs(),...requireMove(),...requireOutputFile(),...requirePathExists(),...requireRemove()})}var libExports$1=requireLib$1(),fsExtra=getDefaultExportFromCjs(libExports$1),copyFilesByTargetPath=function(e,t){if(fs$1.existsSync(e)){try{var r=path.dirname(t);fsExtra.ensureDirSync(r)}catch(e){}fsExtra.copySync(e,t,{overwrite:!0})}},downloadFullApps=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i,n;return __generator(this,function(s){switch(s.label){case 0:return[4,getManifestJsonUrl(e.mode)];case 1:return t=s.sent(),r=t.filter(function(t){return t.appCode!==e.appCode}),[4,downloadManifestJson(r.map(function(e){return e.url}))];case 2:return i=s.sent(),(n=checkDownloadFilesIsExpired(i)).length?[4,downloadProjectFiles(n)]:[3,4];case 3:s.sent(),s.label=4;case 4:return[2,i]}})})},moveOtherApps=function(e){var t=e.base,r=e.manifestList,i=process.env.MFE_ROOT_OUTPUT_DIR;r.forEach(function(e){var r=e.appCode,n=checkIsRootManifest(e)?i:path.resolve(i,r),s=path.resolve(t,r);try{copyFilesByTargetPath(s,n)}catch(e){}})},createAppsAssetsPlugin=function(e){var t=[],r=!1;return{name:"@dd-code:apps-assets",enforce:"pre",options:function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(r){switch(r.label){case 0:return[4,downloadFullApps(e.value)];case 1:return t=r.sent(),e.setDependencies(t),[2]}})})},buildStart:function(){if(!r){var i=path.resolve(SAVE_CDN_FILE_PATH,e.value.mode||"dev");moveOtherApps({base:i,manifestList:t}),r=!0}}}},initPreContext=require("@dcloudio/uni-cli-shared/dist/preprocess").initPreContext,preprocess=require("@dcloudio/uni-cli-shared/lib/preprocess").preprocess,getPreVueContext=require("@dcloudio/uni-cli-shared/dist/preprocess/context").getPreVueContext,initPrePagesJson=function(){var e=path.resolve(process.cwd(),"src/pages.json");return fs$1.readFileSync(e,"utf-8")},getPagesJson=function(jsonFile,isFormat){void 0===isFormat&&(isFormat=!1);var platform=process.env.UNI_PLATFORM;initPreContext(platform);var context=getPreVueContext(),processedJsonStr=preprocess(jsonFile,context,{type:"js"}),pagesConfig=eval("(".concat(processedJsonStr,")"));return isFormat&&"mp-weixin"===platform?transformToWeixinFormat(pagesConfig):pagesConfig},transformToWeixinFormat=function(e){var t,r=__assign({pages:[],window:{},tabBar:null,subPackages:[],usingComponents:{}},e);if(e.globalStyle){var i=e.globalStyle;r.window={navigationBarBackgroundColor:i.navigationBarBackgroundColor||"#000000",navigationBarTextStyle:i.navigationBarTextStyle||"white",navigationBarTitleText:i.navigationBarTitleText||"",backgroundColor:i.backgroundColor||"#ffffff",backgroundTextStyle:i.backgroundTextStyle||"dark",enablePullDownRefresh:i.enablePullDownRefresh||!1,onReachBottomDistance:i.onReachBottomDistance||50},i.pageOrientation&&(r.window.pageOrientation=i.pageOrientation),i.renderingMode&&(r.window.renderingMode=i.renderingMode),i.usingComponents&&(r.usingComponents=i.usingComponents),i["mp-weixin"]&&Object.assign(r.window,i["mp-weixin"])}return e.pages&&(r.pages=e.pages.map(function(e){return e.path})),e.tabBar&&(r.tabBar=__assign(__assign({},e.tabBar),{list:null===(t=e.tabBar.list)||void 0===t?void 0:t.map(function(e){return{pagePath:e.pagePath,text:e.text,iconPath:e.iconPath,selectedIconPath:e.selectedIconPath}})})),e.subPackages&&(r.subPackages=e.subPackages.map(function(e){var t;return{root:e.root,pages:(null===(t=e.pages)||void 0===t?void 0:t.map(function(e){return e.path||e}))||[]}})),e.preloadRule&&(r.preloadRule=e.preloadRule),delete r.globalStyle,delete r.easycom,delete r.condition,delete r.leftWindow,delete r.topWindow,delete r.rightWindow,delete r.uniIdRouter,delete r.entryPagePath,r},createManifestPlugin=function(e){var t=new Set;return{name:"@dd-code:genre-mainfest-file-list",enforce:"post",renderStart:function(){var t=initPrePagesJson(),r=getPagesJson(t);e.setPagesJson(r)},writeBundle:function(e,r){Object.values(r).forEach(function(e){e&&e.fileName&&t.add(e.fileName)})},closeBundle:function(){var r=process.env.MFE_SOURCE_OUTPUT_DIR||"dist",i=walkDir(r,t);e.setFiles(r,i);var n=e.value.isRoot?process.env.MFE_ROOT_OUTPUT_DIR:path.resolve(process.env.MFE_ROOT_OUTPUT_DIR,e.value.appCode);e.saveFile(n)}}};const EntryTypes={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},defaultOptions={root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:EntryTypes.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(defaultOptions);const RECURSIVE_ERROR_CODE="READDIRP_RECURSIVE_ERROR",NORMAL_FLOW_ERRORS=new Set(["ENOENT","EPERM","EACCES","ELOOP",RECURSIVE_ERROR_CODE]),ALL_TYPES=[EntryTypes.DIR_TYPE,EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE,EntryTypes.FILE_TYPE],DIR_TYPES=new Set([EntryTypes.DIR_TYPE,EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE]),FILE_TYPES=new Set([EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE,EntryTypes.FILE_TYPE]),isNormalFlowError=e=>NORMAL_FLOW_ERRORS.has(e.code),wantBigintFsStats="win32"===process.platform,emptyFn=e=>!0,normalizeFilter=e=>{if(void 0===e)return emptyFn;if("function"==typeof e)return e;if("string"==typeof e){const t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){const t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return emptyFn};class ReaddirpStream extends node_stream.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});const t={...defaultOptions,...e},{root:r,type:i}=t;this._fileFilter=normalizeFilter(t.fileFilter),this._directoryFilter=normalizeFilter(t.directoryFilter);const n=t.lstat?promises.lstat:promises.stat;this._stat=wantBigintFsStats?e=>n(e,{bigint:!0}):n,this._maxDepth=null!=t.depth&&Number.isSafeInteger(t.depth)?t.depth:defaultOptions.depth,this._wantsDir=!!i&&DIR_TYPES.has(i),this._wantsFile=!!i&&FILE_TYPES.has(i),this._wantsEverything=i===EntryTypes.EVERYTHING_TYPE,this._root=sp.resolve(r),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const t=this.parent,r=t&&t.files;if(r&&r.length>0){const{path:i,depth:n}=t,s=r.splice(0,e).map(e=>this._formatEntry(e,i)),u=await Promise.all(s);for(const t of u){if(!t)continue;if(this.destroyed)return;const r=await this._getEntryType(t);"directory"===r&&this._directoryFilter(t)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,n+1)),this._wantsDir&&(this.push(t),e--)):("file"===r||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{const e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let r;try{r=await promises.readdir(e,this._rdOptions)}catch(e){this._onError(e)}return{files:r,depth:t,path:e}}async _formatEntry(e,t){let r;const i=this._isDirent?e.name:e;try{const n=sp.resolve(sp.join(t,i));r={path:sp.relative(this._root,n),fullPath:n,basename:i},r[this._statsProp]=this._isDirent?e:await this._stat(n)}catch(e){return void this._onError(e)}return r}_onError(e){isNormalFlowError(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";const t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){const t=e.fullPath;try{const e=await promises.realpath(t),r=await promises.lstat(e);if(r.isFile())return"file";if(r.isDirectory()){const r=e.length;if(t.startsWith(e)&&t.substr(r,1)===sp.sep){const r=new Error(`Circular symlink detected: "${t}" points to "${e}"`);return r.code=RECURSIVE_ERROR_CODE,this._onError(r)}return"directory"}}catch(e){return this._onError(e),""}}}_includeAsFile(e){const t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}function readdirp(e,t={}){let r=t.entryType||t.type;if("both"===r&&(r=EntryTypes.FILE_DIR_TYPE),r&&(t.type=r),!e)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");if("string"!=typeof e)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!ALL_TYPES.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);return t.root=e,new ReaddirpStream(t)}const STR_DATA="data",STR_END="end",STR_CLOSE="close",EMPTY_FN=()=>{},pl=process.platform,isWindows="win32"===pl,isMacos="darwin"===pl,isLinux="linux"===pl,isFreeBSD="freebsd"===pl,isIBMi="OS400"===node_os.type(),EVENTS={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},EV=EVENTS,THROTTLE_MODE_WATCH="watch",statMethods={lstat:promises.lstat,stat:promises.stat},KEY_LISTENERS="listeners",KEY_ERR="errHandlers",KEY_RAW="rawEmitters",HANDLER_KEYS=[KEY_LISTENERS,KEY_ERR,KEY_RAW],binaryExtensions=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),isBinaryPath=e=>binaryExtensions.has(sp__namespace.extname(e).slice(1).toLowerCase()),foreach=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},addAndConvert=(e,t,r)=>{let i=e[t];i instanceof Set||(e[t]=i=new Set([i])),i.add(r)},clearItem=e=>t=>{const r=e[t];r instanceof Set?r.clear():delete e[t]},delFromSet=(e,t,r)=>{const i=e[t];i instanceof Set?i.delete(r):i===r&&delete e[t]},isEmptySet=e=>e instanceof Set?0===e.size:!e,FsWatchInstances=new Map;function createFsWatchInstance(e,t,r,i,n){const s=(t,i)=>{r(e),n(t,i,{watchedPath:e}),i&&e!==i&&fsWatchBroadcast(sp__namespace.resolve(e,i),KEY_LISTENERS,sp__namespace.join(e,i))};try{return node_fs.watch(e,{persistent:t.persistent},s)}catch(e){return void i(e)}}const fsWatchBroadcast=(e,t,r,i,n)=>{const s=FsWatchInstances.get(e);s&&foreach(s[t],e=>{e(r,i,n)})},setFsWatchListener=(e,t,r,i)=>{const{listener:n,errHandler:s,rawEmitter:u}=i;let a,o=FsWatchInstances.get(t);if(!r.persistent){if(a=createFsWatchInstance(e,r,n,s,u),!a)return;return a.close.bind(a)}if(o)addAndConvert(o,KEY_LISTENERS,n),addAndConvert(o,KEY_ERR,s),addAndConvert(o,KEY_RAW,u);else{if(a=createFsWatchInstance(e,r,fsWatchBroadcast.bind(null,t,KEY_LISTENERS),s,fsWatchBroadcast.bind(null,t,KEY_RAW)),!a)return;a.on(EV.ERROR,async r=>{const i=fsWatchBroadcast.bind(null,t,KEY_ERR);if(o&&(o.watcherUnusable=!0),isWindows&&"EPERM"===r.code)try{const t=await promises.open(e,"r");await t.close(),i(r)}catch(e){}else i(r)}),o={listeners:n,errHandlers:s,rawEmitters:u,watcher:a},FsWatchInstances.set(t,o)}return()=>{delFromSet(o,KEY_LISTENERS,n),delFromSet(o,KEY_ERR,s),delFromSet(o,KEY_RAW,u),isEmptySet(o.listeners)&&(o.watcher.close(),FsWatchInstances.delete(t),HANDLER_KEYS.forEach(clearItem(o)),o.watcher=void 0,Object.freeze(o))}},FsWatchFileInstances=new Map,setFsWatchFileListener=(e,t,r,i)=>{const{listener:n,rawEmitter:s}=i;let u=FsWatchFileInstances.get(t);const a=u&&u.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&(node_fs.unwatchFile(t),u=void 0),u?(addAndConvert(u,KEY_LISTENERS,n),addAndConvert(u,KEY_RAW,s)):(u={listeners:n,rawEmitters:s,options:r,watcher:node_fs.watchFile(t,r,(r,i)=>{foreach(u.rawEmitters,e=>{e(EV.CHANGE,t,{curr:r,prev:i})});const n=r.mtimeMs;(r.size!==i.size||n>i.mtimeMs||0===n)&&foreach(u.listeners,t=>t(e,r))})},FsWatchFileInstances.set(t,u)),()=>{delFromSet(u,KEY_LISTENERS,n),delFromSet(u,KEY_RAW,s),isEmptySet(u.listeners)&&(FsWatchFileInstances.delete(t),node_fs.unwatchFile(t),u.options=u.watcher=void 0,Object.freeze(u))}};class NodeFsHandler{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const r=this.fsw.options,i=sp__namespace.dirname(e),n=sp__namespace.basename(e);this.fsw._getWatchedDir(i).add(n);const s=sp__namespace.resolve(e),u={persistent:r.persistent};let a;if(t||(t=EMPTY_FN),r.usePolling){const i=r.interval!==r.binaryInterval;u.interval=i&&isBinaryPath(n)?r.binaryInterval:r.interval,a=setFsWatchFileListener(e,s,u,{listener:t,rawEmitter:this.fsw._emitRaw})}else a=setFsWatchListener(e,s,u,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return a}_handleFile(e,t,r){if(this.fsw.closed)return;const i=sp__namespace.dirname(e),n=sp__namespace.basename(e),s=this.fsw._getWatchedDir(i);let u=t;if(s.has(n))return;const a=async(t,r)=>{if(this.fsw._throttle(THROTTLE_MODE_WATCH,e,5))if(r&&0!==r.mtimeMs){if(s.has(n)){const t=r.atimeMs,i=r.mtimeMs;(!t||t<=i||i!==u.mtimeMs)&&this.fsw._emit(EV.CHANGE,e,r),u=r}}else try{const r=await promises.stat(e);if(this.fsw.closed)return;const i=r.atimeMs,n=r.mtimeMs;if((!i||i<=n||n!==u.mtimeMs)&&this.fsw._emit(EV.CHANGE,e,r),(isMacos||isLinux||isFreeBSD)&&u.ino!==r.ino){this.fsw._closeFile(t),u=r;const i=this._watchWithNodeFs(e,a);i&&this.fsw._addPathCloser(t,i)}else u=r}catch(e){this.fsw._remove(i,n)}},o=this._watchWithNodeFs(e,a);if((!r||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(EV.ADD,e,0))return;this.fsw._emit(EV.ADD,e,t)}return o}async _handleSymlink(e,t,r,i){if(this.fsw.closed)return;const n=e.fullPath,s=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){let t;this.fsw._incrReadyCount();try{t=await promises.realpath(r)}catch(e){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return s.has(i)?this.fsw._symlinkPaths.get(n)!==t&&(this.fsw._symlinkPaths.set(n,t),this.fsw._emit(EV.CHANGE,r,e.stats)):(s.add(i),this.fsw._symlinkPaths.set(n,t),this.fsw._emit(EV.ADD,r,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(n))return!0;this.fsw._symlinkPaths.set(n,!0)}_handleRead(e,t,r,i,n,s,u){e=sp__namespace.join(e,"");const a=i?`${e}:${i}`:e;if(!(u=this.fsw._throttle("readdir",a,1e3)))return;const o=this.fsw._getWatchedDir(r.path),c=new Set;let l=this.fsw._readdirp(e,{fileFilter:e=>r.filterPath(e),directoryFilter:e=>r.filterDir(e)});return l?(l.on(STR_DATA,async u=>{if(this.fsw.closed)return void(l=void 0);const a=u.path;let D=sp__namespace.join(e,a);c.add(a),u.stats.isSymbolicLink()&&await this._handleSymlink(u,e,D,a)||(this.fsw.closed?l=void 0:a!==i&&(i||o.has(a))||(this.fsw._incrReadyCount(),D=sp__namespace.join(n,sp__namespace.relative(n,D)),this._addToNodeFs(D,t,r,s+1)))}).on(EV.ERROR,this._boundHandleError),new Promise((t,a)=>{if(!l)return a();l.once(STR_END,()=>{if(this.fsw.closed)return void(l=void 0);const a=!!u&&u.clear();t(void 0),o.getChildren().filter(t=>t!==e&&!c.has(t)).forEach(t=>{this.fsw._remove(e,t)}),l=void 0,a&&this._handleRead(e,!1,r,i,n,s,u)})})):void 0}async _handleDir(e,t,r,i,n,s,u){const a=this.fsw._getWatchedDir(sp__namespace.dirname(e)),o=a.has(sp__namespace.basename(e));let c,l;r&&this.fsw.options.ignoreInitial||n||o||this.fsw._emit(EV.ADD_DIR,e,t),a.add(sp__namespace.basename(e)),this.fsw._getWatchedDir(e);const D=this.fsw.options.depth;if((null==D||i<=D)&&!this.fsw._symlinkPaths.has(u)){if(!n&&(await this._handleRead(e,r,s,n,e,i,c),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,r)=>{r&&0===r.mtimeMs||this._handleRead(t,!1,s,n,e,i,c)})}return l}async _addToNodeFs(e,t,r,i,n){const s=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return s(),!1;const u=this.fsw._getWatchHelpers(e);r&&(u.filterPath=e=>r.filterPath(e),u.filterDir=e=>r.filterDir(e));try{const r=await statMethods[u.statMethod](u.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(u.watchPath,r))return s(),!1;const a=this.fsw.options.followSymlinks;let o;if(r.isDirectory()){const s=sp__namespace.resolve(e),c=a?await promises.realpath(e):e;if(this.fsw.closed)return;if(o=await this._handleDir(u.watchPath,r,t,i,n,u,c),this.fsw.closed)return;s!==c&&void 0!==c&&this.fsw._symlinkPaths.set(s,c)}else if(r.isSymbolicLink()){const n=a?await promises.realpath(e):e;if(this.fsw.closed)return;const s=sp__namespace.dirname(u.watchPath);if(this.fsw._getWatchedDir(s).add(u.watchPath),this.fsw._emit(EV.ADD,u.watchPath,r),o=await this._handleDir(s,r,t,i,e,u,n),this.fsw.closed)return;void 0!==n&&this.fsw._symlinkPaths.set(sp__namespace.resolve(e),n)}else o=this._handleFile(u.watchPath,r,t);return s(),o&&this.fsw._addPathCloser(e,o),!1}catch(t){if(this.fsw._handleError(t))return s(),e}}}
|
|
2
2
|
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */const SLASH="/",SLASH_SLASH="//",ONE_DOT=".",TWO_DOTS="..",STRING_TYPE="string",BACK_SLASH_RE=/\\/g,DOUBLE_SLASH_RE=/\/\//g,DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,REPLACER_RE=/^\.[/\\]/;function arrify(e){return Array.isArray(e)?e:[e]}const isMatcherObject=e=>"object"==typeof e&&null!==e&&!(e instanceof RegExp);function createPattern(e){return"function"==typeof e?e:"string"==typeof e?t=>e===t:e instanceof RegExp?t=>e.test(t):"object"==typeof e&&null!==e?t=>{if(e.path===t)return!0;if(e.recursive){const r=sp__namespace.relative(e.path,t);return!!r&&(!r.startsWith("..")&&!sp__namespace.isAbsolute(r))}return!1}:()=>!1}function normalizePath(e){if("string"!=typeof e)throw new Error("string expected");let t=!1;return(e=(e=sp__namespace.normalize(e)).replace(/\\/g,"/")).startsWith("//")&&(t=!0),e=e.replace(DOUBLE_SLASH_RE,"/"),t&&(e="/"+e),e}function matchPatterns(e,t,r){const i=normalizePath(t);for(let t=0;t<e.length;t++){if((0,e[t])(i,r))return!0}return!1}function anymatch(e,t){if(null==e)throw new TypeError("anymatch: specify first argument");const r=arrify(e).map(e=>createPattern(e));return(e,t)=>matchPatterns(r,e,t)}const unifyPaths=e=>{const t=arrify(e).flat();if(!t.every(e=>typeof e===STRING_TYPE))throw new TypeError(`Non-string provided as watch path: ${t}`);return t.map(normalizePathToUnix)},toUnix=e=>{let t=e.replace(BACK_SLASH_RE,SLASH),r=!1;return t.startsWith(SLASH_SLASH)&&(r=!0),t=t.replace(DOUBLE_SLASH_RE,SLASH),r&&(t=SLASH+t),t},normalizePathToUnix=e=>toUnix(sp__namespace.normalize(toUnix(e))),normalizeIgnored=(e="")=>t=>"string"==typeof t?normalizePathToUnix(sp__namespace.isAbsolute(t)?t:sp__namespace.join(e,t)):t,getAbsolutePath=(e,t)=>sp__namespace.isAbsolute(e)?e:sp__namespace.join(t,e),EMPTY_SET=Object.freeze(new Set);class DirEntry{path;_removeWatcher;items;constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){const{items:t}=this;t&&e!==ONE_DOT&&e!==TWO_DOTS&&t.add(e)}async remove(e){const{items:t}=this;if(!t)return;if(t.delete(e),t.size>0)return;const r=this.path;try{await promises.readdir(r)}catch(e){this._removeWatcher&&this._removeWatcher(sp__namespace.dirname(r),sp__namespace.basename(r))}}has(e){const{items:t}=this;if(t)return t.has(e)}getChildren(){const{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=EMPTY_FN,this.items=EMPTY_SET,Object.freeze(this)}}const STAT_METHOD_F="stat",STAT_METHOD_L="lstat";class WatchHelper{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,t,r){this.fsw=r;const i=e;this.path=e=e.replace(REPLACER_RE,""),this.watchPath=i,this.fullWatchPath=sp__namespace.resolve(i),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?STAT_METHOD_F:STAT_METHOD_L}entryPath(e){return sp__namespace.join(this.watchPath,sp__namespace.relative(this.watchPath,e.fullPath))}filterPath(e){const{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);const r=this.entryPath(e);return this.fsw._isntIgnored(r,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class FSWatcher extends node_events.EventEmitter{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;const t=e.awaitWriteFinish,r={stabilityThreshold:2e3,pollInterval:100},i={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?arrify(e.ignored):arrify([]),awaitWriteFinish:!0===t?r:"object"==typeof t&&{...r,...t}};isIBMi&&(i.usePolling=!0),void 0===i.atomic&&(i.atomic=!i.usePolling);const n=process.env.CHOKIDAR_USEPOLLING;if(void 0!==n){const e=n.toLowerCase();i.usePolling="false"!==e&&"0"!==e&&("true"===e||"1"===e||!!e)}const s=process.env.CHOKIDAR_INTERVAL;s&&(i.interval=Number.parseInt(s,10));let u=0;this._emitReady=()=>{u++,u>=this._readyCount&&(this._emitReady=EMPTY_FN,this._readyEmitted=!0,process.nextTick(()=>this.emit(EVENTS.READY)))},this._emitRaw=(...e)=>this.emit(EVENTS.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=i,this._nodeFsHandler=new NodeFsHandler(this),Object.freeze(i)}_addIgnoredPath(e){if(isMatcherObject(e))for(const t of this._ignoredPaths)if(isMatcherObject(t)&&t.path===e.path&&t.recursive===e.recursive)return;this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),"string"==typeof e)for(const t of this._ignoredPaths)isMatcherObject(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,r){const{cwd:i}=this.options;this.closed=!1,this._closePromise=void 0;let n=unifyPaths(e);return i&&(n=n.map(e=>getAbsolutePath(e,i))),n.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=n.length,Promise.all(n.map(async e=>{const i=await this._nodeFsHandler._addToNodeFs(e,!r,void 0,0,t);return i&&this._emitReady(),i})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(sp__namespace.dirname(e),sp__namespace.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;const t=unifyPaths(e),{cwd:r}=this.options;return t.forEach(e=>{sp__namespace.isAbsolute(e)||this._closers.has(e)||(r&&(e=sp__namespace.join(r,e)),e=sp__namespace.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach(t=>t.forEach(t=>{const r=t();r instanceof Promise&&e.push(r)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach((t,r)=>{const i=this.options.cwd?sp__namespace.relative(this.options.cwd,r):r;e[i||ONE_DOT]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==EVENTS.ERROR&&this.emit(EVENTS.ALL,e,...t)}async _emit(e,t,r){if(this.closed)return;const i=this.options;isWindows&&(t=sp__namespace.normalize(t)),i.cwd&&(t=sp__namespace.relative(i.cwd,t));const n=[t];null!=r&&n.push(r);const s=i.awaitWriteFinish;let u;if(s&&(u=this._pendingWrites.get(t)))return u.lastChange=new Date,this;if(i.atomic){if(e===EVENTS.UNLINK)return this._pendingUnlinks.set(t,[e,...n]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(EVENTS.ALL,...e),this._pendingUnlinks.delete(t)})},"number"==typeof i.atomic?i.atomic:100),this;e===EVENTS.ADD&&this._pendingUnlinks.has(t)&&(e=EVENTS.CHANGE,this._pendingUnlinks.delete(t))}if(s&&(e===EVENTS.ADD||e===EVENTS.CHANGE)&&this._readyEmitted){const r=(t,r)=>{t?(e=EVENTS.ERROR,n[0]=t,this.emitWithAll(e,n)):r&&(n.length>1?n[1]=r:n.push(r),this.emitWithAll(e,n))};return this._awaitWriteFinish(t,s.stabilityThreshold,e,r),this}if(e===EVENTS.CHANGE){if(!this._throttle(EVENTS.CHANGE,t,50))return this}if(i.alwaysStat&&void 0===r&&(e===EVENTS.ADD||e===EVENTS.ADD_DIR||e===EVENTS.CHANGE)){const e=i.cwd?sp__namespace.join(i.cwd,t):t;let r;try{r=await promises.stat(e)}catch(e){}if(!r||this.closed)return;n.push(r)}return this.emitWithAll(e,n),this}_handleError(e){const t=e&&e.code;return e&&"ENOENT"!==t&&"ENOTDIR"!==t&&(!this.options.ignorePermissionErrors||"EPERM"!==t&&"EACCES"!==t)&&this.emit(EVENTS.ERROR,e),e||this.closed}_throttle(e,t,r){this._throttled.has(e)||this._throttled.set(e,new Map);const i=this._throttled.get(e);if(!i)throw new Error("invalid throttle");const n=i.get(t);if(n)return n.count++,!1;let s;const u=()=>{const e=i.get(t),r=e?e.count:0;return i.delete(t),clearTimeout(s),e&&clearTimeout(e.timeoutObject),r};s=setTimeout(u,r);const a={timeoutObject:s,clear:u,count:0};return i.set(t,a),a}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,r,i){const n=this.options.awaitWriteFinish;if("object"!=typeof n)return;const s=n.pollInterval;let u,a=e;this.options.cwd&&!sp__namespace.isAbsolute(e)&&(a=sp__namespace.join(this.options.cwd,e));const o=new Date,c=this._pendingWrites;c.has(e)||(c.set(e,{lastChange:o,cancelWait:()=>(c.delete(e),clearTimeout(u),r)}),u=setTimeout(function r(n){node_fs.stat(a,(a,o)=>{if(a||!c.has(e))return void(a&&"ENOENT"!==a.code&&i(a));const l=Number(new Date);n&&o.size!==n.size&&(c.get(e).lastChange=l),l-c.get(e).lastChange>=t?(c.delete(e),i(void 0,o)):u=setTimeout(r,s,o)})},s))}_isIgnored(e,t){if(this.options.atomic&&DOT_RE.test(e))return!0;if(!this._userIgnored){const{cwd:e}=this.options,t=(this.options.ignored||[]).map(normalizeIgnored(e)),r=[...[...this._ignoredPaths].map(normalizeIgnored(e)),...t];this._userIgnored=anymatch(r)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new WatchHelper(e,this.options.followSymlinks,this)}_getWatchedDir(e){const t=sp__namespace.resolve(e);return this._watched.has(t)||this._watched.set(t,new DirEntry(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return!!this.options.ignorePermissionErrors||Boolean(256&Number(e.mode))}_remove(e,t,r){const i=sp__namespace.join(e,t),n=sp__namespace.resolve(i);if(r=null!=r?r:this._watched.has(i)||this._watched.has(n),!this._throttle("remove",i,100))return;r||1!==this._watched.size||this.add(e,t,!0);this._getWatchedDir(i).getChildren().forEach(e=>this._remove(i,e));const s=this._getWatchedDir(e),u=s.has(t);s.remove(t),this._symlinkPaths.has(n)&&this._symlinkPaths.delete(n);let a=i;if(this.options.cwd&&(a=sp__namespace.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(a)){if(this._pendingWrites.get(a).cancelWait()===EVENTS.ADD)return}this._watched.delete(i),this._watched.delete(n);const o=r?EVENTS.UNLINK_DIR:EVENTS.UNLINK;u&&!this._isIgnored(i)&&this._emit(o,i),this._closePath(i)}_closePath(e){this._closeFile(e);const t=sp__namespace.dirname(e);this._getWatchedDir(t).remove(sp__namespace.basename(e))}_closeFile(e){const t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(t)}_readdirp(e,t){if(this.closed)return;let r=readdirp(e,{type:EVENTS.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(r),r.once(STR_CLOSE,()=>{r=void 0}),r.once(STR_END,()=>{r&&(this._streams.delete(r),r=void 0)}),r}}function watch(e,t={}){const r=new FSWatcher(t);return r.add(e),r}var chokidar={watch:watch,FSWatcher:FSWatcher},lib={exports:{}},objectAssign,hasRequiredObjectAssign;function requireObjectAssign(){if(hasRequiredObjectAssign)return objectAssign;hasRequiredObjectAssign=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return objectAssign=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(i,n){for(var s,u,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(i),o=1;o<arguments.length;o++){for(var c in s=Object(arguments[o]))t.call(s,c)&&(a[c]=s[c]);if(e){u=e(s);for(var l=0;l<u.length;l++)r.call(s,u[l])&&(a[u[l]]=s[u[l]])}}return a},objectAssign}var vary={exports:{}},hasRequiredVary,hasRequiredLib;
|
|
3
3
|
/*!
|
|
4
4
|
* vary
|
package/dist/index.mjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import path from"path";import fs$1 from"fs";import crypto from"crypto";import require$$0 from"readline";import require$$4 from"events";import require$$0$1 from"constants";import require$$0$2 from"stream";import require$$4$1 from"util";import require$$5 from"assert";import{EventEmitter}from"node:events";import{unwatchFile,watchFile,watch as watch$1,stat as stat$2}from"node:fs";import{lstat,stat as stat$1,readdir,realpath,open}from"node:fs/promises";import*as sp from"node:path";import{resolve,join,relative,sep}from"node:path";import{Readable}from"node:stream";import{type}from"node:os";import WebSocket,{WebSocketServer}from"ws";import express from"express";import http from"http";var __assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},__assign.apply(this,arguments)};function __awaiter(e,t,r,i){return new(r||(r=Promise))(function(n,s){function u(e){try{a(i.next(e))}catch(e){s(e)}}function o(e){try{a(i.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(u,o)}a((i=i.apply(e,t||[])).next())})}function __generator(e,t){var r,i,n,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=o(0),u.throw=o(1),u.return=o(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function o(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,o[0]&&(s=0)),s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function __spreadArray(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var MFE_NAME="mfe.json";function fetchFileByPath(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,7,,8]),[4,fetch(e)];case 1:if(t=r.sent(),!e.split("?")[0].endsWith(".json"))return[3,5];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,t.json()];case 3:return[2,r.sent()];case 4:return r.sent(),[3,5];case 5:return[4,t.text()];case 6:return[2,r.sent()];case 7:return r.sent(),[3,8];case 8:return[2]}})})}function uniReadFile(e){try{return e.endsWith(".json")?require(e):fs$1.readFileSync(e,"utf-8")}catch(e){}return""}function writeFiles(e,t){"object"==typeof t&&t&&(t=JSON.stringify(t,null,2));var r=path.dirname(e);return fs$1.existsSync(r)||fs$1.mkdirSync(r,{recursive:!0}),fs$1.writeFileSync(e,t,"utf-8")}var checkAndgenreDir=function(e){fs$1.existsSync(e)||fs$1.mkdirSync(e,{recursive:!0})},loadViteConfig=function(e){return(0,require("vite").loadEnv)(e,process.cwd(),"MFE_")},walkDir=function(e,t){var r=path.isAbsolute(e)?e:path.resolve(process.cwd(),e),i=[],n=function(e){(fs$1.existsSync(e)?fs$1.readdirSync(e):[]).forEach(function(t){var s=path.join(e,t);fs$1.statSync(s).isDirectory()?n(s):i.push(path.relative(r,s))})};return n(r),Array.from(new Set(Array.from(t).concat(i))).sort()};function generateHash(e,t,r){if(void 0===e&&(e=""),void 0===r&&(r="hex"),"string"!=typeof e)throw new Error("Content must be a string");var i=crypto.createHash(t);return i.update(e,"utf8"),i.digest(r)}function generateSHA256(e){return generateHash(e,"sha256")}var UniCdnManager=function(){function e(){this.HOST=""}return e.prototype.getCdnUrl=function(e){var t=e.code,r=e.mode,i=e.appCode;return this.HOST=this.HOST||loadViteConfig(r||"dev").MFE_CDN_HOST,["".concat(this.HOST),getManifestCdnDirUrl({mode:r,code:t,appCode:i})]},e.prototype.getManifestUrl=function(e){var t=e.code,r=e.appCode,i=e.mode;return __spreadArray(__spreadArray([],this.getCdnUrl({code:t,mode:i,appCode:r}),!0),["".concat(MANIFEST_NAME)],!1).join("/")},e}(),cdn=new UniCdnManager,SAVE_CDN_FILE_PATH=path.join(process.cwd(),"node_modules/@dd-code/uni-files");path.join(process.cwd(),"node_modules/@dd-code/current-files");var MANIFEST_NAME="mfe-uni-manifest.json",ROOT_APP_CODE="main",MANIFEST_CND_DIR_URL="{mode}/static-repository/mfe-uni/{code}/{appCode}",getManifestCdnDirUrl=function(e){var t=e.mode,r=e.code,i=e.appCode;return MANIFEST_CND_DIR_URL.replace("{mode}",t).replace("{code}",r).replace("{appCode}",i)},getMfeJson=function(){var e=uniReadFile(path.resolve(process.cwd(),MFE_NAME))||{};return e.platform=process.env.UNI_PLATFORM||"h5",e},getMainAppJson=function(e){return __awaiter(void 0,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return t=formatCliCommandConfig(e),[4,fetchFileByPath(cdn.getManifestUrl({code:t.code,appCode:ROOT_APP_CODE,mode:e}))];case 1:return[2,r.sent()]}})})},getMainAppPages=function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,getMainAppJson(e)];case 1:return[2,t.sent().apps||[{appCode:"modules/bwzb"},{appCode:"modules/manage"},{appCode:"login"}]]}})})},getPlatform=function(){return process.env.UNI_PLATFORM||"h5"},formatCliCommandConfig=function(e){var t=loadViteConfig(e||"dev"),r=t.MFE_UNI_IS_ROOT;return{isRoot:r,appCode:r?ROOT_APP_CODE:t.MFE_APP_CODE,code:t.MFE_UNI_CODE,mode:e}},checkIsRootManifest=function(e){return e.isRoot||e.appCode===ROOT_APP_CODE},WS_PORT=3560,WS_PATH="/__mfe__ws__",E_WS_TYPE;!function(e){e.INIT="init_files",e.CHANGE="change_files"}(E_WS_TYPE||(E_WS_TYPE={}));var getMainAppJSon=function(e,t){return path.join(SAVE_CDN_FILE_PATH,e||"dev",t,"app.json")},getMainAppJsonPath=function(){return path.join(process.env.UNI_OUTPUT_DIR,"app.json")},EPlaform;!function(e){e.H5="h5",e.MP_WEIXIN="mp-weixin"}(EPlaform||(EPlaform={}));var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},eta,hasRequiredEta,terminal,hasRequiredTerminal;function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function requireEta(){if(hasRequiredEta)return eta;hasRequiredEta=1;return eta=class{constructor(e,t,r){this.etaBufferLength=e||100,this.valueBuffer=[r],this.timeBuffer=[t],this.eta="0"}update(e,t,r){this.valueBuffer.push(t),this.timeBuffer.push(e),this.calculate(r-t)}getTime(){return this.eta}calculate(e){const t=this.valueBuffer.length,r=Math.min(this.etaBufferLength,t),i=(this.valueBuffer[t-1]-this.valueBuffer[t-r])/(this.timeBuffer[t-1]-this.timeBuffer[t-r]);this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);const n=Math.ceil(e/i/1e3);isNaN(n)?this.eta="NULL":isFinite(n)?this.eta=n>1e7?"INF":n<0?0:n:this.eta="INF"}}}function requireTerminal(){if(hasRequiredTerminal)return terminal;hasRequiredTerminal=1;const e=require$$0;return terminal=class{constructor(e){this.stream=e,this.linewrap=!0,this.dy=0}cursorSave(){this.stream.isTTY&&this.stream.write("7")}cursorRestore(){this.stream.isTTY&&this.stream.write("8")}cursor(e){this.stream.isTTY&&(e?this.stream.write("[?25h"):this.stream.write("[?25l"))}cursorTo(t=null,r=null){this.stream.isTTY&&e.cursorTo(this.stream,t,r)}cursorRelative(t=null,r=null){this.stream.isTTY&&(this.dy=this.dy+r,e.moveCursor(this.stream,t,r))}cursorRelativeReset(){this.stream.isTTY&&(e.moveCursor(this.stream,0,-this.dy),e.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&e.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&e.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&e.clearScreenDown(this.stream)}newline(){this.stream.write("\n"),this.dy++}write(e,t=!1){!0===this.linewrap&&!1===t?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("[?7h"):this.stream.write("[?7l"))}isTTY(){return!0===this.stream.isTTY}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}}}var stringWidth={exports:{}},ansiRegex,hasRequiredAnsiRegex,stripAnsi,hasRequiredStripAnsi;function requireAnsiRegex(){return hasRequiredAnsiRegex?ansiRegex:(hasRequiredAnsiRegex=1,ansiRegex=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")})}function requireStripAnsi(){if(hasRequiredStripAnsi)return stripAnsi;hasRequiredStripAnsi=1;const e=requireAnsiRegex();return stripAnsi=t=>"string"==typeof t?t.replace(e(),""):t}var isFullwidthCodePoint={exports:{}},hasRequiredIsFullwidthCodePoint,emojiRegex,hasRequiredEmojiRegex,hasRequiredStringWidth,formatValue,hasRequiredFormatValue,formatBar,hasRequiredFormatBar,formatTime,hasRequiredFormatTime,formatter,hasRequiredFormatter,options,hasRequiredOptions,genericBar,hasRequiredGenericBar,singleBar,hasRequiredSingleBar,multiBar,hasRequiredMultiBar,legacy,hasRequiredLegacy,shadesClassic,hasRequiredShadesClassic,shadesGrey,hasRequiredShadesGrey,rect,hasRequiredRect,presets,hasRequiredPresets,cliProgress,hasRequiredCliProgress;function requireIsFullwidthCodePoint(){if(hasRequiredIsFullwidthCodePoint)return isFullwidthCodePoint.exports;hasRequiredIsFullwidthCodePoint=1;const e=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141));return isFullwidthCodePoint.exports=e,isFullwidthCodePoint.exports.default=e,isFullwidthCodePoint.exports}function requireEmojiRegex(){return hasRequiredEmojiRegex?emojiRegex:(hasRequiredEmojiRegex=1,emojiRegex=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g})}function requireStringWidth(){if(hasRequiredStringWidth)return stringWidth.exports;hasRequiredStringWidth=1;const e=requireStripAnsi(),t=requireIsFullwidthCodePoint(),r=requireEmojiRegex(),i=i=>{if("string"!=typeof i||0===i.length)return 0;if(0===(i=e(i)).length)return 0;i=i.replace(r()," ");let n=0;for(let e=0;e<i.length;e++){const r=i.codePointAt(e);r<=31||r>=127&&r<=159||(r>=768&&r<=879||(r>65535&&e++,n+=t(r)?2:1))}return n};return stringWidth.exports=i,stringWidth.exports.default=i,stringWidth.exports}function requireFormatValue(){return hasRequiredFormatValue||(hasRequiredFormatValue=1,formatValue=function(e,t,r){if(!0!==t.autopadding)return e;return"percentage"===r?(i=e,(t.autopaddingChar+i).slice(-3)):e;var i}),formatValue}function requireFormatBar(){return hasRequiredFormatBar||(hasRequiredFormatBar=1,formatBar=function(e,t){const r=Math.round(e*t.barsize),i=t.barsize-r;return t.barCompleteString.substr(0,r)+t.barGlue+t.barIncompleteString.substr(0,i)}),formatBar}function requireFormatTime(){return hasRequiredFormatTime||(hasRequiredFormatTime=1,formatTime=function(e,t,r){function i(e){return r?r*Math.round(e/r):e}function n(e){return(t.autopaddingChar+e).slice(-2)}return e>3600?n(Math.floor(e/3600))+"h"+n(i(e%3600/60))+"m":e>60?n(Math.floor(e/60))+"m"+n(i(e%60))+"s":e>10?n(i(e))+"s":n(e)+"s"}),formatTime}function requireFormatter(){if(hasRequiredFormatter)return formatter;hasRequiredFormatter=1;const e=requireStringWidth(),t=requireFormatValue(),r=requireFormatBar(),i=requireFormatTime();return formatter=function(n,s,u){let o=n.format;const a=n.formatTime||i,c=n.formatValue||t,l=n.formatBar||r,D=Math.floor(100*s.progress)+"",h=s.stopTime||Date.now(),f=Math.round((h-s.startTime)/1e3),d=Object.assign({},u,{bar:l(s.progress,n),percentage:c(D,n,"percentage"),total:c(s.total,n,"total"),value:c(s.value,n,"value"),eta:c(s.eta,n,"eta"),eta_formatted:a(s.eta,n,5),duration:c(f,n,"duration"),duration_formatted:a(f,n,1)});o=o.replace(/\{(\w+)\}/g,function(e,t){return void 0!==d[t]?d[t]:e});const p=Math.max(0,s.maxWidth-e(o)-2),m=Math.floor(p/2);switch(n.align){case"right":o=p>0?" ".repeat(p)+o:o;break;case"center":o=m>0?" ".repeat(m)+o:o}return o},formatter}function requireOptions(){if(hasRequiredOptions)return options;function e(e,t){return null==e?t:e}return hasRequiredOptions=1,options={parse:function(t,r){const i={},n=Object.assign({},r,t);return i.throttleTime=1e3/e(n.fps,10),i.stream=e(n.stream,process.stderr),i.terminal=e(n.terminal,null),i.clearOnComplete=e(n.clearOnComplete,!1),i.stopOnComplete=e(n.stopOnComplete,!1),i.barsize=e(n.barsize,40),i.align=e(n.align,"left"),i.hideCursor=e(n.hideCursor,!1),i.linewrap=e(n.linewrap,!1),i.barGlue=e(n.barGlue,""),i.barCompleteChar=e(n.barCompleteChar,"="),i.barIncompleteChar=e(n.barIncompleteChar,"-"),i.format=e(n.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),i.formatTime=e(n.formatTime,null),i.formatValue=e(n.formatValue,null),i.formatBar=e(n.formatBar,null),i.etaBufferLength=e(n.etaBuffer,10),i.etaAsynchronousUpdate=e(n.etaAsynchronousUpdate,!1),i.progressCalculationRelative=e(n.progressCalculationRelative,!1),i.synchronousUpdate=e(n.synchronousUpdate,!0),i.noTTYOutput=e(n.noTTYOutput,!1),i.notTTYSchedule=e(n.notTTYSchedule,2e3),i.emptyOnZero=e(n.emptyOnZero,!1),i.forceRedraw=e(n.forceRedraw,!1),i.autopadding=e(n.autopadding,!1),i.gracefulExit=e(n.gracefulExit,!1),i},assignDerivedOptions:function(t){return t.barCompleteString=t.barCompleteChar.repeat(t.barsize+1),t.barIncompleteString=t.barIncompleteChar.repeat(t.barsize+1),t.autopaddingChar=t.autopadding?e(t.autopaddingChar," "):"",t}}}function requireGenericBar(){if(hasRequiredGenericBar)return genericBar;hasRequiredGenericBar=1;const e=requireEta(),t=requireTerminal(),r=requireFormatter(),i=requireOptions(),n=require$$4;return genericBar=class extends n{constructor(n){super(),this.options=i.assignDerivedOptions(n),this.terminal=this.options.terminal?this.options.terminal:new t(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new e(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter="function"==typeof this.options.format?this.options.format:r}render(e=!1){const t={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();const r=this.formatter(this.options,t,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=r)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(r),this.terminal.clearRight(),this.lastDrawnString=r,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(t,r,i){this.value=r||0,this.total=void 0!==t&&t>=0?t:100,this.startValue=r||0,this.payload=i||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new e(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",t,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,t={}){"number"==typeof e&&(this.value=e,this.eta.update(Date.now(),e,this.total));const r=("object"==typeof e?e:t)||{};this.emit("update",this.total,this.value);for(const e in r)this.payload[e]=r[e];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,t={}){"object"==typeof e?this.update(this.value+1,e):this.update(this.value+e,t)}getTotal(){return this.total}setTotal(e){void 0!==e&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}},genericBar}function requireSingleBar(){if(hasRequiredSingleBar)return singleBar;hasRequiredSingleBar=1;const e=requireGenericBar(),t=requireOptions();return singleBar=class extends e{constructor(e,r){super(t.parse(e,r)),this.timer=null,this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,t){this.timer&&(super.update(e,t),this.options.synchronousUpdate&&this.lastRedraw+2*this.options.throttleTime<Date.now()&&this.render())}start(e,t,r){!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),super.start(e,t,r),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}},singleBar}function requireMultiBar(){if(hasRequiredMultiBar)return multiBar;hasRequiredMultiBar=1;const e=requireTerminal(),t=requireGenericBar(),r=requireOptions(),i=require$$4;return multiBar=class extends i{constructor(t,i){super(),this.bars=[],this.options=r.parse(t,i),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new e(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,r,i,n={}){const s=new t(Object.assign({},this.options,{terminal:this.terminal},n));return this.bars.push(s),!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,s.start(e,r,i),this.emit("start")),s}remove(e){const t=this.bars.indexOf(e);return!(t<0)&&(this.bars.splice(t,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}},multiBar}function requireLegacy(){return hasRequiredLegacy?legacy:(hasRequiredLegacy=1,legacy={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"})}function requireShadesClassic(){return hasRequiredShadesClassic?shadesClassic:(hasRequiredShadesClassic=1,shadesClassic={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"})}function requireShadesGrey(){return hasRequiredShadesGrey?shadesGrey:(hasRequiredShadesGrey=1,shadesGrey={format:" [90m{bar}[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"})}function requireRect(){return hasRequiredRect?rect:(hasRequiredRect=1,rect={format:" {bar}■ {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"■",barIncompleteChar:" "})}function requirePresets(){if(hasRequiredPresets)return presets;hasRequiredPresets=1;const e=requireLegacy(),t=requireShadesClassic(),r=requireShadesGrey(),i=requireRect();return presets={legacy:e,shades_classic:t,shades_grey:r,rect:i}}function requireCliProgress(){if(hasRequiredCliProgress)return cliProgress;hasRequiredCliProgress=1;const e=requireSingleBar(),t=requireMultiBar(),r=requirePresets(),i=requireFormatter(),n=requireFormatValue(),s=requireFormatBar(),u=requireFormatTime();return cliProgress={Bar:e,SingleBar:e,MultiBar:t,Presets:r,Format:{Formatter:i,BarFormat:s,ValueFormat:n,TimeFormat:u}}}var cliProgressExports=requireCliProgress();const ANSI_BACKGROUND_OFFSET=10,wrapAnsi16=(e=0)=>t=>`[${t+e}m`,wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`,wrapAnsi16m=(e=0)=>(t,r,i)=>`[${38+e};2;${t};${r};${i}m`,styles$1={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles$1.modifier);const foregroundColorNames=Object.keys(styles$1.color),backgroundColorNames=Object.keys(styles$1.bgColor);function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(styles$1)){for(const[t,i]of Object.entries(r))styles$1[t]={open:`[${i[0]}m`,close:`[${i[1]}m`},r[t]=styles$1[t],e.set(i[0],i[1]);Object.defineProperty(styles$1,t,{value:r,enumerable:!1})}return Object.defineProperty(styles$1,"codes",{value:e,enumerable:!1}),styles$1.color.close="[39m",styles$1.bgColor.close="[49m",styles$1.color.ansi=wrapAnsi16(),styles$1.color.ansi256=wrapAnsi256(),styles$1.color.ansi16m=wrapAnsi16m(),styles$1.bgColor.ansi=wrapAnsi16(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi256=wrapAnsi256(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi16m=wrapAnsi16m(ANSI_BACKGROUND_OFFSET),Object.defineProperties(styles$1,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,255&i]},enumerable:!1},hexToAnsi256:{value:e=>styles$1.rgbToAnsi256(...styles$1.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,i;if(e>=232)t=(10*(e-232)+8)/255,r=t,i=t;else{const n=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(n/6)/5,i=n%6/5}const n=2*Math.max(t,r,i);if(0===n)return 30;let s=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return 2===n&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(e)),enumerable:!1}}),styles$1}const ansiStyles=assembleStyles(),level=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),colorSupport=0!==level&&{level:level},supportsColor={stdout:colorSupport,stderr:colorSupport};function stringReplaceAll(e,t,r){let i=e.indexOf(t);if(-1===i)return e;const n=t.length;let s=0,u="";do{u+=e.slice(s,i)+t+r,s=i+n,i=e.indexOf(t,s)}while(-1!==i);return u+=e.slice(s),u}function stringEncaseCRLFWithFirstIndex(e,t,r,i){let n=0,s="";do{const u="\r"===e[i-1];s+=e.slice(n,u?i-1:i)+t+(u?"\r\n":"\n")+r,n=i+1,i=e.indexOf("\n",n)}while(-1!==i);return s+=e.slice(n),s}const{stdout:stdoutColor,stderr:stderrColor}=supportsColor,GENERATOR=Symbol("GENERATOR"),STYLER=Symbol("STYLER"),IS_EMPTY=Symbol("IS_EMPTY"),levelMapping=["ansi","ansi","ansi256","ansi16m"],styles=Object.create(null),applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=stdoutColor?stdoutColor.level:0;e.level=void 0===t.level?r:t.level},chalkFactory=e=>{const t=(...e)=>e.join(" ");return applyOptions(t,e),Object.setPrototypeOf(t,createChalk.prototype),t};function createChalk(e){return chalkFactory(e)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[e,t]of Object.entries(ansiStyles))styles[e]={get(){const r=createBuilder(this,createStyler(t.open,t.close,this[STYLER]),this[IS_EMPTY]);return Object.defineProperty(this,e,{value:r}),r}};styles.visible={get(){const e=createBuilder(this,this[STYLER],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const getModelAnsi=(e,t,r,...i)=>"rgb"===e?"ansi16m"===t?ansiStyles[r].ansi16m(...i):"ansi256"===t?ansiStyles[r].ansi256(ansiStyles.rgbToAnsi256(...i)):ansiStyles[r].ansi(ansiStyles.rgbToAnsi(...i)):"hex"===e?getModelAnsi("rgb",t,r,...ansiStyles.hexToRgb(...i)):ansiStyles[r][e](...i),usedModels=["rgb","hex","ansi256"];for(const e of usedModels){styles[e]={get(){const{level:t}=this;return function(...r){const i=createStyler(getModelAnsi(e,levelMapping[t],"color",...r),ansiStyles.color.close,this[STYLER]);return createBuilder(this,i,this[IS_EMPTY])}}};const t="bg"+e[0].toUpperCase()+e.slice(1);styles[t]={get(){const{level:t}=this;return function(...r){const i=createStyler(getModelAnsi(e,levelMapping[t],"bgColor",...r),ansiStyles.bgColor.close,this[STYLER]);return createBuilder(this,i,this[IS_EMPTY])}}}}const proto=Object.defineProperties(()=>{},{...styles,level:{enumerable:!0,get(){return this[GENERATOR].level},set(e){this[GENERATOR].level=e}}}),createStyler=(e,t,r)=>{let i,n;return void 0===r?(i=e,n=t):(i=r.openAll+e,n=t+r.closeAll),{open:e,close:t,openAll:i,closeAll:n,parent:r}},createBuilder=(e,t,r)=>{const i=(...e)=>applyStyle(i,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(i,proto),i[GENERATOR]=e,i[STYLER]=t,i[IS_EMPTY]=r,i},applyStyle=(e,t)=>{if(e.level<=0||!t)return e[IS_EMPTY]?"":t;let r=e[STYLER];if(void 0===r)return t;const{openAll:i,closeAll:n}=r;if(t.includes(""))for(;void 0!==r;)t=stringReplaceAll(t,r.close,r.open),r=r.parent;const s=t.indexOf("\n");return-1!==s&&(t=stringEncaseCRLFWithFirstIndex(t,n,i,s)),i+t+n};Object.defineProperties(createChalk.prototype,styles);const chalk=createChalk();createChalk({level:stderrColor?stderrColor.level:0});var CliProgressManager=function(){function e(){this.barMap=new Map}return e.prototype.initMultiBar=function(e){this.multiBar=new cliProgressExports.MultiBar({clearOnComplete:!1,hideCursor:!0,format:e||"".concat(chalk.yellow("{name}"),": ").concat(chalk.blue("{bar}")," | ").concat(chalk.green("{percentage}%")," | {value}/{total}"),barCompleteChar:"█",barIncompleteChar:"░",barGlue:"",stopOnComplete:!0},cliProgressExports.Presets.shades_grey)},e.prototype.createProgressBar=function(e){var t=this;e.forEach(function(e){var r=t.multiBar.create(e.total,0,{name:e.name});t.barMap.set(e.name,r)})},e.prototype.updateProgressBar=function(e,t){var r=this.barMap.get(e);if(r){var i=r.getTotal();r.update(t),t>=i&&r.stop()}},e.prototype.stopAll=function(){this.multiBar.stop()},e}(),CliProgressManager$1=new CliProgressManager,getDownloadedFilePath=function(e){return path.resolve(SAVE_CDN_FILE_PATH,e.env,e.appCode)},getNodeModulesEnvAppCodeFilePath=function(e,t){return path.resolve(getDownloadedFilePath(e),t)},getManifestJsonUrl=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i,n,s,u,o,a;return __generator(this,function(c){switch(c.label){case 0:t=formatCliCommandConfig(e),r=t.isRoot,i=void 0!==r&&r,n=t.code,s=void 0===n?"mfe-uni":n,u=[],o=getMfeJson(),c.label=1;case 1:return c.trys.push([1,5,,6]),a=[],i?(a=o.apps||[],[3,4]):[3,2];case 2:return[4,getMainAppPages(e)];case 3:a=__spreadArray(__spreadArray([],a=c.sent(),!0),[{appCode:ROOT_APP_CODE}],!1),c.label=4;case 4:return u=Array.from(new Set(__spreadArray([],(a||[]).map(function(e){return e.appCode}),!0))),[3,6];case 5:return c.sent(),u=[],[3,6];case 6:return[2,u.map(function(t){return{url:cdn.getManifestUrl({code:s,appCode:t,mode:e}),appCode:t,code:s}})]}})})},downloadManifestJson=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r;return __generator(this,function(i){switch(i.label){case 0:return t=e.map(function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,fetchFileByPath(e).catch(function(e){})];case 1:return[2,t.sent()]}})})}),[4,Promise.all(t)];case 1:return r=i.sent(),[2,r.filter(function(e){return e})]}})})};function downloadFilesByManifestJson(e,t,r){return __awaiter(this,void 0,void 0,function(){var i,n,s,u,o,a,c,l,D,h,f,d,p;return __generator(this,function(m){switch(m.label){case 0:for(c in i=e.cdn,n=e.appCode,s=e.publicPath,u=e.files,a=[],o=u)a.push(c);l=0,m.label=1;case 1:return l<a.length?(c=a[l])in o?(h=u[D=c],f=h.fileUrl,d=h.fileName,[4,fetchFileByPath("".concat(i,"/").concat(s,"/").concat(f))]):[3,3]:[3,4];case 2:p=m.sent(),writeFiles(path.join(t,n||"",d),p),r&&r(Number(D),h.length),m.label=3;case 3:return l++,[3,1];case 4:return[2]}})})}var downloadProjectFiles=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i;return __generator(this,function(n){switch(n.label){case 0:for(i in t=[],CliProgressManager$1.initMultiBar(),CliProgressManager$1.createProgressBar(e.map(function(e){return{name:e.appCode,total:e.files.length}})),r=function(r){var i=e[r],n=downloadFilesByManifestJson(i,path.resolve(SAVE_CDN_FILE_PATH,i.mode||"dev"),function(e,t){CliProgressManager$1.updateProgressBar(i.appCode,e+1)});t.push(n)},e)r(i);return[4,Promise.all(t)];case 1:return n.sent(),CliProgressManager$1.stopAll(),[2]}})})},checkDownloadFilesIsExpired=function(e){return e.filter(function(e){var t=uniReadFile(getNodeModulesEnvAppCodeFilePath(e,MANIFEST_NAME));return!t||(null==t?void 0:t.hash)!==e.hash})},createManifestManager=function(){var e=process.env,t={code:"",mode:"",cdn:cdn.HOST,hash:"",publicPath:"",appCode:"",platform:e.UNI_PLATFORM||"h5",pagesJson:{},files:[]};return{get value(){return t},setFiles:function(e,r){var i=r.map(function(t){var r=path.resolve(e,t),i=generateSHA256(fs$1.readFileSync(r,"utf-8"));return{fileName:t,fileUrl:"".concat(i.slice(0,8),"_").concat(path.basename(t))}});t.files=i},setPagesJson:function(e){t.pagesJson=e},saveFile:function(e){var r=t.files.filter(function(e){return e.fileName!==MANIFEST_NAME});t.hash=generateSHA256(JSON.stringify(__assign(__assign({},t),{files:r}))),writeFiles(path.resolve(e,MANIFEST_NAME),JSON.stringify(t,null,2))},setEnv:function(e){var r=formatCliCommandConfig(e),i=getMfeJson();t.mode=e,t.code=r.code,t.appCode=r.appCode,r.isRoot&&(t.isRoot=!0,t.apps=i.apps),t.publicPath=getManifestCdnDirUrl(t)},dependencies:[],setDependencies:function(e){this.dependencies=e}}},resetOutDir=function(e,t){var r,i=new RegExp("/(".concat(e.value.appCode,")/?"));process.env.MFE_SOURCE_OUTPUT_DIR=t.build.outDir,process.env.MFE_ROOT_OUTPUT_DIR=null===(r=process.env.MFE_SOURCE_OUTPUT_DIR)||void 0===r?void 0:r.replace(i,"/").replace(/\/$/,""),process.env.UNI_OUTPUT_DIR=process.env.MFE_ROOT_OUTPUT_DIR},fs={},universalify={},hasRequiredUniversalify,polyfills,hasRequiredPolyfills,legacyStreams,hasRequiredLegacyStreams,clone_1,hasRequiredClone,gracefulFs,hasRequiredGracefulFs,hasRequiredFs;function requireUniversalify(){return hasRequiredUniversalify||(hasRequiredUniversalify=1,universalify.fromCallback=function(e){return Object.defineProperty(function(...t){if("function"!=typeof t[t.length-1])return new Promise((r,i)=>{t.push((e,t)=>null!=e?i(e):r(t)),e.apply(this,t)});e.apply(this,t)},"name",{value:e.name})},universalify.fromPromise=function(e){return Object.defineProperty(function(...t){const r=t[t.length-1];if("function"!=typeof r)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>r(null,e),r)},"name",{value:e.name})}),universalify}function requirePolyfills(){if(hasRequiredPolyfills)return polyfills;hasRequiredPolyfills=1;var e=require$$0$1,t=process.cwd,r=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return r||(r=t.call(process)),r};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var n=process.chdir;process.chdir=function(e){r=null,n.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,n)}return polyfills=function(t){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(r,i,n){t.open(r,e.O_WRONLY|e.O_SYMLINK,i,function(e,r){e?n&&n(e):t.fchmod(r,i,function(e){t.close(r,function(t){n&&n(e||t)})})})},t.lchmodSync=function(r,i){var n,s=t.openSync(r,e.O_WRONLY|e.O_SYMLINK,i),u=!0;try{n=t.fchmodSync(s,i),u=!1}finally{if(u)try{t.closeSync(s)}catch(e){}else t.closeSync(s)}return n}}(t);t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(r,i,n,s){t.open(r,e.O_SYMLINK,function(e,r){e?s&&s(e):t.futimes(r,i,n,function(e){t.close(r,function(t){s&&s(e||t)})})})},t.lutimesSync=function(r,i,n){var s,u=t.openSync(r,e.O_SYMLINK),o=!0;try{s=t.futimesSync(u,i,n),o=!1}finally{if(o)try{t.closeSync(u)}catch(e){}else t.closeSync(u)}return s}):t.futimes&&(t.lutimes=function(e,t,r,i){i&&process.nextTick(i)},t.lutimesSync=function(){})}(t);t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=u(t.chownSync),t.fchownSync=u(t.fchownSync),t.lchownSync=u(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=o(t.stat),t.fstat=o(t.fstat),t.lstat=o(t.lstat),t.statSync=a(t.statSync),t.fstatSync=a(t.fstatSync),t.lstatSync=a(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(e,t,r){r&&process.nextTick(r)},t.lchmodSync=function(){});t.chown&&!t.lchown&&(t.lchown=function(e,t,r,i){i&&process.nextTick(i)},t.lchownSync=function(){});"win32"===i&&(t.rename="function"!=typeof t.rename?t.rename:function(e){function r(r,i,n){var s=Date.now(),u=0;e(r,i,function o(a){if(a&&("EACCES"===a.code||"EPERM"===a.code||"EBUSY"===a.code)&&Date.now()-s<6e4)return setTimeout(function(){t.stat(i,function(t,s){t&&"ENOENT"===t.code?e(r,i,o):n(a)})},u),void(u<100&&(u+=10));n&&n(a)})}return Object.setPrototypeOf&&Object.setPrototypeOf(r,e),r}(t.rename));function r(e){return e?function(r,i,n){return e.call(t,r,i,function(e){c(e)&&(e=null),n&&n.apply(this,arguments)})}:e}function n(e){return e?function(r,i){try{return e.call(t,r,i)}catch(e){if(!c(e))throw e}}:e}function s(e){return e?function(r,i,n,s){return e.call(t,r,i,n,function(e){c(e)&&(e=null),s&&s.apply(this,arguments)})}:e}function u(e){return e?function(r,i,n){try{return e.call(t,r,i,n)}catch(e){if(!c(e))throw e}}:e}function o(e){return e?function(r,i,n){function s(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof i&&(n=i,i=null),i?e.call(t,r,i,s):e.call(t,r,s)}:e}function a(e){return e?function(r,i){var n=i?e.call(t,r,i):e.call(t,r);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function c(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}t.read="function"!=typeof t.read?t.read:function(e){function r(r,i,n,s,u,o){var a;if(o&&"function"==typeof o){var c=0;a=function(l,D,h){if(l&&"EAGAIN"===l.code&&c<10)return c++,e.call(t,r,i,n,s,u,a);o.apply(this,arguments)}}return e.call(t,r,i,n,s,u,a)}return Object.setPrototypeOf&&Object.setPrototypeOf(r,e),r}(t.read),t.readSync="function"!=typeof t.readSync?t.readSync:(l=t.readSync,function(e,r,i,n,s){for(var u=0;;)try{return l.call(t,e,r,i,n,s)}catch(e){if("EAGAIN"===e.code&&u<10){u++;continue}throw e}});var l},polyfills}function requireLegacyStreams(){if(hasRequiredLegacyStreams)return legacyStreams;hasRequiredLegacyStreams=1;var e=require$$0$2.Stream;return legacyStreams=function(t){return{ReadStream:function r(i,n){if(!(this instanceof r))return new r(i,n);e.call(this);var s=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,n=n||{};for(var u=Object.keys(n),o=0,a=u.length;o<a;o++){var c=u[o];this[c]=n[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick(function(){s._read()});t.open(this.path,this.flags,this.mode,function(e,t){if(e)return s.emit("error",e),void(s.readable=!1);s.fd=t,s.emit("open",t),s._read()})},WriteStream:function r(i,n){if(!(this instanceof r))return new r(i,n);e.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),u=0,o=s.length;u<o;u++){var a=s[u];this[a]=n[a]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},legacyStreams}function requireClone(){if(hasRequiredClone)return clone_1;hasRequiredClone=1,clone_1=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var r={__proto__:e(t)};else r=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}),r};var e=Object.getPrototypeOf||function(e){return e.__proto__};return clone_1}function requireGracefulFs(){if(hasRequiredGracefulFs)return gracefulFs;hasRequiredGracefulFs=1;var e,t,r=fs$1,i=requirePolyfills(),n=requireLegacyStreams(),s=requireClone(),u=require$$4$1;function o(t,r){Object.defineProperty(t,e,{get:function(){return r}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),t=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var a,c=function(){};if(u.debuglog?c=u.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(c=function(){var e=u.format.apply(u,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ")}),!r[e]){var l=commonjsGlobal[e]||[];o(r,l),r.close=function(e){function i(t,i){return e.call(r,t,function(e){e||f(),"function"==typeof i&&i.apply(this,arguments)})}return Object.defineProperty(i,t,{value:e}),i}(r.close),r.closeSync=function(e){function i(t){e.apply(r,arguments),f()}return Object.defineProperty(i,t,{value:e}),i}(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){c(r[e]),require$$5.equal(r[e].length,0)})}function D(e){i(e),e.gracefulify=D,e.createReadStream=function(t,r){return new e.ReadStream(t,r)},e.createWriteStream=function(t,r){return new e.WriteStream(t,r)};var t=e.readFile;e.readFile=function(e,r,i){"function"==typeof r&&(i=r,r=null);return function e(r,i,n,s){return t(r,i,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof n&&n.apply(this,arguments):h([e,[r,i,n],t,s||Date.now(),Date.now()])})}(e,r,i)};var r=e.writeFile;e.writeFile=function(e,t,i,n){"function"==typeof i&&(n=i,i=null);return function e(t,i,n,s,u){return r(t,i,n,function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof s&&s.apply(this,arguments):h([e,[t,i,n,s],r,u||Date.now(),Date.now()])})}(e,t,i,n)};var s=e.appendFile;s&&(e.appendFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,n,u){return s(t,r,i,function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],s,u||Date.now(),Date.now()])})}(e,t,r,i)});var u=e.copyFile;u&&(e.copyFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=0);return function e(t,r,i,n,s){return u(t,r,i,function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],u,s||Date.now(),Date.now()])})}(e,t,r,i)});var o=e.readdir;e.readdir=function(e,t,r){"function"==typeof t&&(r=t,t=null);var i=a.test(process.version)?function(e,t,r,i){return o(e,n(e,t,r,i))}:function(e,t,r,i){return o(e,t,n(e,t,r,i))};return i(e,t,r);function n(e,t,r,n){return function(s,u){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?(u&&u.sort&&u.sort(),"function"==typeof r&&r.call(this,s,u)):h([i,[e,t,r],s,n||Date.now(),Date.now()])}}};var a=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var c=n(e);m=c.ReadStream,y=c.WriteStream}var l=e.ReadStream;l&&(m.prototype=Object.create(l.prototype),m.prototype.open=function(){var e=this;F(e.path,e.flags,e.mode,function(t,r){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r),e.read())})});var f=e.WriteStream;f&&(y.prototype=Object.create(f.prototype),y.prototype.open=function(){var e=this;F(e.path,e.flags,e.mode,function(t,r){t?(e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r))})}),Object.defineProperty(e,"ReadStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var d=m;Object.defineProperty(e,"FileReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var p=y;function m(e,t){return this instanceof m?(l.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function y(e,t){return this instanceof y?(f.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return p},set:function(e){p=e},enumerable:!0,configurable:!0});var E=e.open;function F(e,t,r,i){return"function"==typeof r&&(i=r,r=null),function e(t,r,i,n,s){return E(t,r,i,function(u,o){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],u,s||Date.now(),Date.now()])})}(e,t,r,i)}return e.open=F,e}function h(t){c("ENQUEUE",t[0].name,t[1]),r[e].push(t),d()}function f(){for(var t=Date.now(),i=0;i<r[e].length;++i)r[e][i].length>2&&(r[e][i][3]=t,r[e][i][4]=t);d()}function d(){if(clearTimeout(a),a=void 0,0!==r[e].length){var t=r[e].shift(),i=t[0],n=t[1],s=t[2],u=t[3],o=t[4];if(void 0===u)c("RETRY",i.name,n),i.apply(null,n);else if(Date.now()-u>=6e4){c("TIMEOUT",i.name,n);var l=n.pop();"function"==typeof l&&l.call(null,s)}else{var D=Date.now()-o,h=Math.max(o-u,1);D>=Math.min(1.2*h,100)?(c("RETRY",i.name,n),i.apply(null,n.concat([u]))):r[e].push(t)}void 0===a&&(a=setTimeout(d,0))}}return commonjsGlobal[e]||o(commonjsGlobal,r[e]),gracefulFs=D(s(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(gracefulFs=D(r),r.__patched=!0),gracefulFs}function requireFs(){return hasRequiredFs||(hasRequiredFs=1,function(e){const t=requireUniversalify().fromCallback,r=requireGracefulFs(),i=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(e=>"function"==typeof r[e]);Object.assign(e,r),i.forEach(i=>{e[i]=t(r[i])}),e.exists=function(e,t){return"function"==typeof t?r.exists(e,t):new Promise(t=>r.exists(e,t))},e.read=function(e,t,i,n,s,u){return"function"==typeof u?r.read(e,t,i,n,s,u):new Promise((u,o)=>{r.read(e,t,i,n,s,(e,t,r)=>{if(e)return o(e);u({bytesRead:t,buffer:r})})})},e.write=function(e,t,...i){return"function"==typeof i[i.length-1]?r.write(e,t,...i):new Promise((n,s)=>{r.write(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffer:r})})})},e.readv=function(e,t,...i){return"function"==typeof i[i.length-1]?r.readv(e,t,...i):new Promise((n,s)=>{r.readv(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesRead:t,buffers:r})})})},e.writev=function(e,t,...i){return"function"==typeof i[i.length-1]?r.writev(e,t,...i):new Promise((n,s)=>{r.writev(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffers:r})})})},"function"==typeof r.realpath.native?e.realpath.native=t(r.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(fs)),fs}var makeDir={},utils$1={},hasRequiredUtils$1,hasRequiredMakeDir,mkdirs,hasRequiredMkdirs,pathExists_1,hasRequiredPathExists,utimes,hasRequiredUtimes,stat,hasRequiredStat,async,hasRequiredAsync,copy_1,hasRequiredCopy$1,copySync_1,hasRequiredCopySync,copy,hasRequiredCopy,remove_1,hasRequiredRemove,empty,hasRequiredEmpty,file,hasRequiredFile,link,hasRequiredLink,symlinkPaths_1,hasRequiredSymlinkPaths,symlinkType_1,hasRequiredSymlinkType,symlink,hasRequiredSymlink,ensure,hasRequiredEnsure,utils,hasRequiredUtils,jsonfile$1,hasRequiredJsonfile$1,jsonfile,hasRequiredJsonfile,outputFile_1,hasRequiredOutputFile,outputJson_1,hasRequiredOutputJson,outputJsonSync_1,hasRequiredOutputJsonSync,json,hasRequiredJson,move_1,hasRequiredMove$1,moveSync_1,hasRequiredMoveSync,move,hasRequiredMove,lib$1,hasRequiredLib$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;const e=path;return utils$1.checkPath=function(t){if("win32"===process.platform){if(/[<>:"|?*]/.test(t.replace(e.parse(t).root,""))){const e=new Error(`Path contains invalid characters: ${t}`);throw e.code="EINVAL",e}}},utils$1}function requireMakeDir(){if(hasRequiredMakeDir)return makeDir;hasRequiredMakeDir=1;const e=requireFs(),{checkPath:t}=requireUtils$1(),r=e=>"number"==typeof e?e:{mode:511,...e}.mode;return makeDir.makeDir=async(i,n)=>(t(i),e.mkdir(i,{mode:r(n),recursive:!0})),makeDir.makeDirSync=(i,n)=>(t(i),e.mkdirSync(i,{mode:r(n),recursive:!0})),makeDir}function requireMkdirs(){if(hasRequiredMkdirs)return mkdirs;hasRequiredMkdirs=1;const e=requireUniversalify().fromPromise,{makeDir:t,makeDirSync:r}=requireMakeDir(),i=e(t);return mkdirs={mkdirs:i,mkdirsSync:r,mkdirp:i,mkdirpSync:r,ensureDir:i,ensureDirSync:r}}function requirePathExists(){if(hasRequiredPathExists)return pathExists_1;hasRequiredPathExists=1;const e=requireUniversalify().fromPromise,t=requireFs();return pathExists_1={pathExists:e(function(e){return t.access(e).then(()=>!0).catch(()=>!1)}),pathExistsSync:t.existsSync},pathExists_1}function requireUtimes(){if(hasRequiredUtimes)return utimes;hasRequiredUtimes=1;const e=requireFs(),t=requireUniversalify().fromPromise;return utimes={utimesMillis:t(async function(t,r,i){const n=await e.open(t,"r+");let s=null;try{await e.futimes(n,r,i)}finally{try{await e.close(n)}catch(e){s=e}}if(s)throw s}),utimesMillisSync:function(t,r,i){const n=e.openSync(t,"r+");return e.futimesSync(n,r,i),e.closeSync(n)}},utimes}function requireStat(){if(hasRequiredStat)return stat;hasRequiredStat=1;const e=requireFs(),t=path,r=requireUniversalify().fromPromise;function i(e,t){return void 0!==t.ino&&void 0!==t.dev&&t.ino===e.ino&&t.dev===e.dev}function n(e,r){const i=t.resolve(e).split(t.sep).filter(e=>e),n=t.resolve(r).split(t.sep).filter(e=>e);return i.every((e,t)=>n[t]===e)}function s(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}return stat={checkPaths:r(async function(r,u,o,a){const{srcStat:c,destStat:l}=await function(t,r,i){const n=i.dereference?t=>e.stat(t,{bigint:!0}):t=>e.lstat(t,{bigint:!0});return Promise.all([n(t),n(r).catch(e=>{if("ENOENT"===e.code)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}(r,u,a);if(l){if(i(c,l)){const e=t.basename(r),i=t.basename(u);if("move"===o&&e!==i&&e.toLowerCase()===i.toLowerCase())return{srcStat:c,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${r}'.`);if(!c.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${r}'.`)}if(c.isDirectory()&&n(r,u))throw new Error(s(r,u,o));return{srcStat:c,destStat:l}}),checkPathsSync:function(r,u,o,a){const{srcStat:c,destStat:l}=function(t,r,i){let n;const s=i.dereference?t=>e.statSync(t,{bigint:!0}):t=>e.lstatSync(t,{bigint:!0}),u=s(t);try{n=s(r)}catch(e){if("ENOENT"===e.code)return{srcStat:u,destStat:null};throw e}return{srcStat:u,destStat:n}}(r,u,a);if(l){if(i(c,l)){const e=t.basename(r),i=t.basename(u);if("move"===o&&e!==i&&e.toLowerCase()===i.toLowerCase())return{srcStat:c,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${r}'.`);if(!c.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${r}'.`)}if(c.isDirectory()&&n(r,u))throw new Error(s(r,u,o));return{srcStat:c,destStat:l}},checkParentPaths:r(async function r(n,u,o,a){const c=t.resolve(t.dirname(n)),l=t.resolve(t.dirname(o));if(l===c||l===t.parse(l).root)return;let D;try{D=await e.stat(l,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(i(u,D))throw new Error(s(n,o,a));return r(n,u,l,a)}),checkParentPathsSync:function r(n,u,o,a){const c=t.resolve(t.dirname(n)),l=t.resolve(t.dirname(o));if(l===c||l===t.parse(l).root)return;let D;try{D=e.statSync(l,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(i(u,D))throw new Error(s(n,o,a));return r(n,u,l,a)},isSrcSubdir:n,areIdentical:i},stat}function requireAsync(){if(hasRequiredAsync)return async;return hasRequiredAsync=1,async={asyncIteratorConcurrentProcess:async function(e,t){const r=[];for await(const i of e)r.push(t(i).then(()=>null,e=>e??new Error("unknown error")));await Promise.all(r.map(e=>e.then(e=>{if(null!==e)throw e})))}}}function requireCopy$1(){if(hasRequiredCopy$1)return copy_1;hasRequiredCopy$1=1;const e=requireFs(),t=path,{mkdirs:r}=requireMkdirs(),{pathExists:i}=requirePathExists(),{utimesMillis:n}=requireUtimes(),s=requireStat(),{asyncIteratorConcurrentProcess:u}=requireAsync();async function o(e,t,r){return!r.filter||r.filter(e,t)}async function a(r,i,n,l){const D=l.dereference?e.stat:e.lstat,h=await D(i);if(h.isDirectory())return async function(r,i,n,c,l){i||await e.mkdir(c);await u(await e.opendir(n),async e=>{const r=t.join(n,e.name),i=t.join(c,e.name);if(await o(r,i,l)){const{destStat:e}=await s.checkPaths(r,i,"copy",l);await a(e,r,i,l)}}),i||await e.chmod(c,r.mode)}(h,r,i,n,l);if(h.isFile()||h.isCharacterDevice()||h.isBlockDevice())return async function(t,r,i,n,s){if(!r)return c(t,i,n,s);if(s.overwrite)return await e.unlink(n),c(t,i,n,s);if(s.errorOnExist)throw new Error(`'${n}' already exists`)}(h,r,i,n,l);if(h.isSymbolicLink())return async function(r,i,n,u){let o=await e.readlink(i);u.dereference&&(o=t.resolve(process.cwd(),o));if(!r)return e.symlink(o,n);let a=null;try{a=await e.readlink(n)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return e.symlink(o,n);throw t}u.dereference&&(a=t.resolve(process.cwd(),a));if(s.isSrcSubdir(o,a))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${a}'.`);if(s.isSrcSubdir(a,o))throw new Error(`Cannot overwrite '${a}' with '${o}'.`);return await e.unlink(n),e.symlink(o,n)}(r,i,n,l);if(h.isSocket())throw new Error(`Cannot copy a socket file: ${i}`);if(h.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${i}`);throw new Error(`Unknown file: ${i}`)}async function c(t,r,i,s){if(await e.copyFile(r,i),s.preserveTimestamps){128&t.mode||await function(t,r){return e.chmod(t,128|r)}(i,t.mode);const s=await e.stat(r);await n(i,s.atime,s.mtime)}return e.chmod(i,t.mode)}return copy_1=async function(e,n,u={}){"function"==typeof u&&(u={filter:u}),u.clobber=!("clobber"in u)||!!u.clobber,u.overwrite="overwrite"in u?!!u.overwrite:u.clobber,u.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001");const{srcStat:c,destStat:l}=await s.checkPaths(e,n,"copy",u);if(await s.checkParentPaths(e,c,n,"copy"),!await o(e,n,u))return;const D=t.dirname(n);await i(D)||await r(D),await a(l,e,n,u)}}function requireCopySync(){if(hasRequiredCopySync)return copySync_1;hasRequiredCopySync=1;const e=requireGracefulFs(),t=path,r=requireMkdirs().mkdirsSync,i=requireUtimes().utimesMillisSync,n=requireStat();function s(r,i,s,c){const l=(c.dereference?e.statSync:e.lstatSync)(i);if(l.isDirectory())return function(t,r,i,n,s){return r?a(i,n,s):function(t,r,i,n){return e.mkdirSync(i),a(r,i,n),o(i,t)}(t.mode,i,n,s)}(l,r,i,s,c);if(l.isFile()||l.isCharacterDevice()||l.isBlockDevice())return function(t,r,i,n,s){return r?function(t,r,i,n){if(n.overwrite)return e.unlinkSync(i),u(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}(t,i,n,s):u(t,i,n,s)}(l,r,i,s,c);if(l.isSymbolicLink())return function(r,i,s,u){let o=e.readlinkSync(i);u.dereference&&(o=t.resolve(process.cwd(),o));if(r){let r;try{r=e.readlinkSync(s)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return e.symlinkSync(o,s);throw t}if(u.dereference&&(r=t.resolve(process.cwd(),r)),n.isSrcSubdir(o,r))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${r}'.`);if(n.isSrcSubdir(r,o))throw new Error(`Cannot overwrite '${r}' with '${o}'.`);return function(t,r){return e.unlinkSync(r),e.symlinkSync(t,r)}(o,s)}return e.symlinkSync(o,s)}(r,i,s,c);if(l.isSocket())throw new Error(`Cannot copy a socket file: ${i}`);if(l.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${i}`);throw new Error(`Unknown file: ${i}`)}function u(t,r,n,s){return e.copyFileSync(r,n),s.preserveTimestamps&&function(t,r,n){(function(e){return!(128&e)})(t)&&function(e,t){o(e,128|t)}(n,t);(function(t,r){const n=e.statSync(t);i(r,n.atime,n.mtime)})(r,n)}(t.mode,r,n),o(n,t.mode)}function o(t,r){return e.chmodSync(t,r)}function a(t,r,i){const n=e.opendirSync(t);try{let e;for(;null!==(e=n.readSync());)c(e.name,t,r,i)}finally{n.closeSync()}}function c(e,r,i,u){const o=t.join(r,e),a=t.join(i,e);if(u.filter&&!u.filter(o,a))return;const{destStat:c}=n.checkPathsSync(o,a,"copy",u);return s(c,o,a,u)}return copySync_1=function(i,u,o){"function"==typeof o&&(o={filter:o}),(o=o||{}).clobber=!("clobber"in o)||!!o.clobber,o.overwrite="overwrite"in o?!!o.overwrite:o.clobber,o.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:a,destStat:c}=n.checkPathsSync(i,u,"copy",o);if(n.checkParentPathsSync(i,a,u,"copy"),o.filter&&!o.filter(i,u))return;const l=t.dirname(u);return e.existsSync(l)||r(l),s(c,i,u,o)}}function requireCopy(){if(hasRequiredCopy)return copy;hasRequiredCopy=1;const e=requireUniversalify().fromPromise;return copy={copy:e(requireCopy$1()),copySync:requireCopySync()}}function requireRemove(){if(hasRequiredRemove)return remove_1;hasRequiredRemove=1;const e=requireGracefulFs(),t=requireUniversalify().fromCallback;return remove_1={remove:t(function(t,r){e.rm(t,{recursive:!0,force:!0},r)}),removeSync:function(t){e.rmSync(t,{recursive:!0,force:!0})}},remove_1}function requireEmpty(){if(hasRequiredEmpty)return empty;hasRequiredEmpty=1;const e=requireUniversalify().fromPromise,t=requireFs(),r=path,i=requireMkdirs(),n=requireRemove(),s=e(async function(e){let s;try{s=await t.readdir(e)}catch{return i.mkdirs(e)}return Promise.all(s.map(t=>n.remove(r.join(e,t))))});function u(e){let s;try{s=t.readdirSync(e)}catch{return i.mkdirsSync(e)}s.forEach(t=>{t=r.join(e,t),n.removeSync(t)})}return empty={emptyDirSync:u,emptydirSync:u,emptyDir:s,emptydir:s}}function requireFile(){if(hasRequiredFile)return file;hasRequiredFile=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),i=requireMkdirs();return file={createFile:e(async function(e){let n;try{n=await r.stat(e)}catch{}if(n&&n.isFile())return;const s=t.dirname(e);let u=null;try{u=await r.stat(s)}catch(t){if("ENOENT"===t.code)return await i.mkdirs(s),void await r.writeFile(e,"");throw t}u.isDirectory()?await r.writeFile(e,""):await r.readdir(s)}),createFileSync:function(e){let n;try{n=r.statSync(e)}catch{}if(n&&n.isFile())return;const s=t.dirname(e);try{r.statSync(s).isDirectory()||r.readdirSync(s)}catch(e){if(!e||"ENOENT"!==e.code)throw e;i.mkdirsSync(s)}r.writeFileSync(e,"")}}}function requireLink(){if(hasRequiredLink)return link;hasRequiredLink=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),i=requireMkdirs(),{pathExists:n}=requirePathExists(),{areIdentical:s}=requireStat();return link={createLink:e(async function(e,u){let o,a;try{o=await r.lstat(u)}catch{}try{a=await r.lstat(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}if(o&&s(a,o))return;const c=t.dirname(u);await n(c)||await i.mkdirs(c),await r.link(e,u)}),createLinkSync:function(e,n){let u;try{u=r.lstatSync(n)}catch{}try{const t=r.lstatSync(e);if(u&&s(t,u))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const o=t.dirname(n);return r.existsSync(o)||i.mkdirsSync(o),r.linkSync(e,n)}}}function requireSymlinkPaths(){if(hasRequiredSymlinkPaths)return symlinkPaths_1;hasRequiredSymlinkPaths=1;const e=path,t=requireFs(),{pathExists:r}=requirePathExists(),i=requireUniversalify().fromPromise;return symlinkPaths_1={symlinkPaths:i(async function(i,n){if(e.isAbsolute(i)){try{await t.lstat(i)}catch(e){throw e.message=e.message.replace("lstat","ensureSymlink"),e}return{toCwd:i,toDst:i}}const s=e.dirname(n),u=e.join(s,i);if(await r(u))return{toCwd:u,toDst:i};try{await t.lstat(i)}catch(e){throw e.message=e.message.replace("lstat","ensureSymlink"),e}return{toCwd:i,toDst:e.relative(s,i)}}),symlinkPathsSync:function(r,i){if(e.isAbsolute(r)){if(!t.existsSync(r))throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}const n=e.dirname(i),s=e.join(n,r);if(t.existsSync(s))return{toCwd:s,toDst:r};if(!t.existsSync(r))throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:e.relative(n,r)}}}}function requireSymlinkType(){if(hasRequiredSymlinkType)return symlinkType_1;hasRequiredSymlinkType=1;const e=requireFs(),t=requireUniversalify().fromPromise;return symlinkType_1={symlinkType:t(async function(t,r){if(r)return r;let i;try{i=await e.lstat(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}),symlinkTypeSync:function(t,r){if(r)return r;let i;try{i=e.lstatSync(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}},symlinkType_1}function requireSymlink(){if(hasRequiredSymlink)return symlink;hasRequiredSymlink=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),{mkdirs:i,mkdirsSync:n}=requireMkdirs(),{symlinkPaths:s,symlinkPathsSync:u}=requireSymlinkPaths(),{symlinkType:o,symlinkTypeSync:a}=requireSymlinkType(),{pathExists:c}=requirePathExists(),{areIdentical:l}=requireStat();return symlink={createSymlink:e(async function(e,n,u){let a;try{a=await r.lstat(n)}catch{}if(a&&a.isSymbolicLink()){const[t,i]=await Promise.all([r.stat(e),r.stat(n)]);if(l(t,i))return}const D=await s(e,n);e=D.toDst;const h=await o(D.toCwd,u),f=t.dirname(n);return await c(f)||await i(f),r.symlink(e,n,h)}),createSymlinkSync:function(e,i,s){let o;try{o=r.lstatSync(i)}catch{}if(o&&o.isSymbolicLink()){const t=r.statSync(e),n=r.statSync(i);if(l(t,n))return}const c=u(e,i);e=c.toDst,s=a(c.toCwd,s);const D=t.dirname(i);return r.existsSync(D)||n(D),r.symlinkSync(e,i,s)}},symlink}function requireEnsure(){if(hasRequiredEnsure)return ensure;hasRequiredEnsure=1;const{createFile:e,createFileSync:t}=requireFile(),{createLink:r,createLinkSync:i}=requireLink(),{createSymlink:n,createSymlinkSync:s}=requireSymlink();return ensure={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:r,createLinkSync:i,ensureLink:r,ensureLinkSync:i,createSymlink:n,createSymlinkSync:s,ensureSymlink:n,ensureSymlinkSync:s}}function requireUtils(){if(hasRequiredUtils)return utils;return hasRequiredUtils=1,utils={stringify:function(e,{EOL:t="\n",finalEOL:r=!0,replacer:i=null,spaces:n}={}){const s=r?t:"";return JSON.stringify(e,i,n).replace(/\n/g,t)+s},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}}}function requireJsonfile$1(){if(hasRequiredJsonfile$1)return jsonfile$1;let e;hasRequiredJsonfile$1=1;try{e=requireGracefulFs()}catch(t){e=fs$1}const t=requireUniversalify(),{stringify:r,stripBom:i}=requireUtils();const n=t.fromPromise(async function(r,n={}){"string"==typeof n&&(n={encoding:n});const s=n.fs||e,u=!("throws"in n)||n.throws;let o,a=await t.fromCallback(s.readFile)(r,n);a=i(a);try{o=JSON.parse(a,n?n.reviver:null)}catch(e){if(u)throw e.message=`${r}: ${e.message}`,e;return null}return o});const s=t.fromPromise(async function(i,n,s={}){const u=s.fs||e,o=r(n,s);await t.fromCallback(u.writeFile)(i,o,s)});return jsonfile$1={readFile:n,readFileSync:function(t,r={}){"string"==typeof r&&(r={encoding:r});const n=r.fs||e,s=!("throws"in r)||r.throws;try{let e=n.readFileSync(t,r);return e=i(e),JSON.parse(e,r.reviver)}catch(e){if(s)throw e.message=`${t}: ${e.message}`,e;return null}},writeFile:s,writeFileSync:function(t,i,n={}){const s=n.fs||e,u=r(i,n);return s.writeFileSync(t,u,n)}},jsonfile$1}function requireJsonfile(){if(hasRequiredJsonfile)return jsonfile;hasRequiredJsonfile=1;const e=requireJsonfile$1();return jsonfile={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync}}function requireOutputFile(){if(hasRequiredOutputFile)return outputFile_1;hasRequiredOutputFile=1;const e=requireUniversalify().fromPromise,t=requireFs(),r=path,i=requireMkdirs(),n=requirePathExists().pathExists;return outputFile_1={outputFile:e(async function(e,s,u="utf-8"){const o=r.dirname(e);return await n(o)||await i.mkdirs(o),t.writeFile(e,s,u)}),outputFileSync:function(e,...n){const s=r.dirname(e);t.existsSync(s)||i.mkdirsSync(s),t.writeFileSync(e,...n)}},outputFile_1}function requireOutputJson(){if(hasRequiredOutputJson)return outputJson_1;hasRequiredOutputJson=1;const{stringify:e}=requireUtils(),{outputFile:t}=requireOutputFile();return outputJson_1=async function(r,i,n={}){const s=e(i,n);await t(r,s,n)},outputJson_1}function requireOutputJsonSync(){if(hasRequiredOutputJsonSync)return outputJsonSync_1;hasRequiredOutputJsonSync=1;const{stringify:e}=requireUtils(),{outputFileSync:t}=requireOutputFile();return outputJsonSync_1=function(r,i,n){const s=e(i,n);t(r,s,n)},outputJsonSync_1}function requireJson(){if(hasRequiredJson)return json;hasRequiredJson=1;const e=requireUniversalify().fromPromise,t=requireJsonfile();return t.outputJson=e(requireOutputJson()),t.outputJsonSync=requireOutputJsonSync(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,json=t}function requireMove$1(){if(hasRequiredMove$1)return move_1;hasRequiredMove$1=1;const e=requireFs(),t=path,{copy:r}=requireCopy(),{remove:i}=requireRemove(),{mkdirp:n}=requireMkdirs(),{pathExists:s}=requirePathExists(),u=requireStat();return move_1=async function(o,a,c={}){const l=c.overwrite||c.clobber||!1,{srcStat:D,isChangingCase:h=!1}=await u.checkPaths(o,a,"move",c);await u.checkParentPaths(o,D,a,"move");const f=t.dirname(a);return t.parse(f).root!==f&&await n(f),async function(t,n,u,o){if(!o)if(u)await i(n);else if(await s(n))throw new Error("dest already exists.");try{await e.rename(t,n)}catch(e){if("EXDEV"!==e.code)throw e;await async function(e,t,n){const s={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return await r(e,t,s),i(e)}(t,n,u)}}(o,a,l,h)}}function requireMoveSync(){if(hasRequiredMoveSync)return moveSync_1;hasRequiredMoveSync=1;const e=requireGracefulFs(),t=path,r=requireCopy().copySync,i=requireRemove().removeSync,n=requireMkdirs().mkdirpSync,s=requireStat();function u(t,n,s){try{e.renameSync(t,n)}catch(e){if("EXDEV"!==e.code)throw e;return function(e,t,n){const s={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return r(e,t,s),i(e)}(t,n,s)}}return moveSync_1=function(r,o,a){const c=(a=a||{}).overwrite||a.clobber||!1,{srcStat:l,isChangingCase:D=!1}=s.checkPathsSync(r,o,"move",a);return s.checkParentPathsSync(r,l,o,"move"),function(e){const r=t.dirname(e);return t.parse(r).root===r}(o)||n(t.dirname(o)),function(t,r,n,s){if(s)return u(t,r,n);if(n)return i(r),u(t,r,n);if(e.existsSync(r))throw new Error("dest already exists.");return u(t,r,n)}(r,o,c,D)}}function requireMove(){if(hasRequiredMove)return move;hasRequiredMove=1;const e=requireUniversalify().fromPromise;return move={move:e(requireMove$1()),moveSync:requireMoveSync()}}function requireLib$1(){return hasRequiredLib$1?lib$1:(hasRequiredLib$1=1,lib$1={...requireFs(),...requireCopy(),...requireEmpty(),...requireEnsure(),...requireJson(),...requireMkdirs(),...requireMove(),...requireOutputFile(),...requirePathExists(),...requireRemove()})}var libExports$1=requireLib$1(),fsExtra=getDefaultExportFromCjs(libExports$1),copyFilesByTargetPath=function(e,t){if(fs$1.existsSync(e)){try{var r=path.dirname(t);fsExtra.ensureDirSync(r)}catch(e){}fsExtra.copySync(e,t,{overwrite:!0})}},downloadFullApps=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i,n;return __generator(this,function(s){switch(s.label){case 0:return[4,getManifestJsonUrl(e.mode)];case 1:return t=s.sent(),r=t.filter(function(t){return t.appCode!==e.appCode}),[4,downloadManifestJson(r.map(function(e){return e.url}))];case 2:return i=s.sent(),(n=checkDownloadFilesIsExpired(i)).length?[4,downloadProjectFiles(n)]:[3,4];case 3:s.sent(),s.label=4;case 4:return[2,i]}})})},moveOtherApps=function(e){var t=e.base,r=e.manifestList,i=process.env.MFE_ROOT_OUTPUT_DIR;r.forEach(function(e){var r=e.appCode,n=checkIsRootManifest(e)?i:path.resolve(i,r),s=path.resolve(t,r);try{copyFilesByTargetPath(s,n)}catch(e){}})},createAppsAssetsPlugin=function(e){var t=[],r=!1;return{name:"@dd-code:apps-assets",enforce:"pre",options:function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(r){switch(r.label){case 0:return[4,downloadFullApps(e.value)];case 1:return t=r.sent(),e.setDependencies(t),[2]}})})},buildStart:function(){if(!r){var i=path.resolve(SAVE_CDN_FILE_PATH,e.value.mode||"dev");moveOtherApps({base:i,manifestList:t}),r=!0}}}},initPreContext=require("@dcloudio/uni-cli-shared/dist/preprocess").initPreContext,preprocess=require("@dcloudio/uni-cli-shared/lib/preprocess").preprocess,getPreVueContext=require("@dcloudio/uni-cli-shared/dist/preprocess/context").getPreVueContext,initPrePagesJson=function(){var e=path.resolve(process.cwd(),"src/pages.json");return fs$1.readFileSync(e,"utf-8")},getPagesJson=function(jsonFile,isFormat){void 0===isFormat&&(isFormat=!1);var platform=process.env.UNI_PLATFORM;initPreContext(platform);var context=getPreVueContext(),processedJsonStr=preprocess(jsonFile,context,{type:"js"}),pagesConfig=eval("(".concat(processedJsonStr,")"));return isFormat&&"mp-weixin"===platform?transformToWeixinFormat(pagesConfig):pagesConfig},transformToWeixinFormat=function(e){var t,r=__assign({pages:[],window:{},tabBar:null,subPackages:[],usingComponents:{}},e);if(e.globalStyle){var i=e.globalStyle;r.window={navigationBarBackgroundColor:i.navigationBarBackgroundColor||"#000000",navigationBarTextStyle:i.navigationBarTextStyle||"white",navigationBarTitleText:i.navigationBarTitleText||"",backgroundColor:i.backgroundColor||"#ffffff",backgroundTextStyle:i.backgroundTextStyle||"dark",enablePullDownRefresh:i.enablePullDownRefresh||!1,onReachBottomDistance:i.onReachBottomDistance||50},i.pageOrientation&&(r.window.pageOrientation=i.pageOrientation),i.renderingMode&&(r.window.renderingMode=i.renderingMode),i.usingComponents&&(r.usingComponents=i.usingComponents),i["mp-weixin"]&&Object.assign(r.window,i["mp-weixin"])}return e.pages&&(r.pages=e.pages.map(function(e){return e.path})),e.tabBar&&(r.tabBar=__assign(__assign({},e.tabBar),{list:null===(t=e.tabBar.list)||void 0===t?void 0:t.map(function(e){return{pagePath:e.pagePath,text:e.text,iconPath:e.iconPath,selectedIconPath:e.selectedIconPath}})})),e.subPackages&&(r.subPackages=e.subPackages.map(function(e){var t;return{root:e.root,pages:(null===(t=e.pages)||void 0===t?void 0:t.map(function(e){return e.path||e}))||[]}})),e.preloadRule&&(r.preloadRule=e.preloadRule),delete r.globalStyle,delete r.easycom,delete r.condition,delete r.leftWindow,delete r.topWindow,delete r.rightWindow,delete r.uniIdRouter,delete r.entryPagePath,r},createManifestPlugin=function(e){var t=new Set;return{name:"@dd-code:genre-mainfest-file-list",enforce:"post",renderStart:function(){var t=initPrePagesJson(),r=getPagesJson(t);e.setPagesJson(r)},writeBundle:function(e,r){Object.values(r).forEach(function(e){e&&e.fileName&&t.add(e.fileName)})},closeBundle:function(){var r=process.env.MFE_SOURCE_OUTPUT_DIR||"dist",i=walkDir(r,t);e.setFiles(r,i);var n=e.value.isRoot?process.env.MFE_ROOT_OUTPUT_DIR:path.resolve(process.env.MFE_ROOT_OUTPUT_DIR,e.value.appCode);e.saveFile(n)}}};const EntryTypes={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},defaultOptions={root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:EntryTypes.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(defaultOptions);const RECURSIVE_ERROR_CODE="READDIRP_RECURSIVE_ERROR",NORMAL_FLOW_ERRORS=new Set(["ENOENT","EPERM","EACCES","ELOOP",RECURSIVE_ERROR_CODE]),ALL_TYPES=[EntryTypes.DIR_TYPE,EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE,EntryTypes.FILE_TYPE],DIR_TYPES=new Set([EntryTypes.DIR_TYPE,EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE]),FILE_TYPES=new Set([EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE,EntryTypes.FILE_TYPE]),isNormalFlowError=e=>NORMAL_FLOW_ERRORS.has(e.code),wantBigintFsStats="win32"===process.platform,emptyFn=e=>!0,normalizeFilter=e=>{if(void 0===e)return emptyFn;if("function"==typeof e)return e;if("string"==typeof e){const t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){const t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return emptyFn};class ReaddirpStream extends Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});const t={...defaultOptions,...e},{root:r,type:i}=t;this._fileFilter=normalizeFilter(t.fileFilter),this._directoryFilter=normalizeFilter(t.directoryFilter);const n=t.lstat?lstat:stat$1;this._stat=wantBigintFsStats?e=>n(e,{bigint:!0}):n,this._maxDepth=null!=t.depth&&Number.isSafeInteger(t.depth)?t.depth:defaultOptions.depth,this._wantsDir=!!i&&DIR_TYPES.has(i),this._wantsFile=!!i&&FILE_TYPES.has(i),this._wantsEverything=i===EntryTypes.EVERYTHING_TYPE,this._root=resolve(r),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const t=this.parent,r=t&&t.files;if(r&&r.length>0){const{path:i,depth:n}=t,s=r.splice(0,e).map(e=>this._formatEntry(e,i)),u=await Promise.all(s);for(const t of u){if(!t)continue;if(this.destroyed)return;const r=await this._getEntryType(t);"directory"===r&&this._directoryFilter(t)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,n+1)),this._wantsDir&&(this.push(t),e--)):("file"===r||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{const e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let r;try{r=await readdir(e,this._rdOptions)}catch(e){this._onError(e)}return{files:r,depth:t,path:e}}async _formatEntry(e,t){let r;const i=this._isDirent?e.name:e;try{const n=resolve(join(t,i));r={path:relative(this._root,n),fullPath:n,basename:i},r[this._statsProp]=this._isDirent?e:await this._stat(n)}catch(e){return void this._onError(e)}return r}_onError(e){isNormalFlowError(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";const t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){const t=e.fullPath;try{const e=await realpath(t),r=await lstat(e);if(r.isFile())return"file";if(r.isDirectory()){const r=e.length;if(t.startsWith(e)&&t.substr(r,1)===sep){const r=new Error(`Circular symlink detected: "${t}" points to "${e}"`);return r.code=RECURSIVE_ERROR_CODE,this._onError(r)}return"directory"}}catch(e){return this._onError(e),""}}}_includeAsFile(e){const t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}function readdirp(e,t={}){let r=t.entryType||t.type;if("both"===r&&(r=EntryTypes.FILE_DIR_TYPE),r&&(t.type=r),!e)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");if("string"!=typeof e)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!ALL_TYPES.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);return t.root=e,new ReaddirpStream(t)}const STR_DATA="data",STR_END="end",STR_CLOSE="close",EMPTY_FN=()=>{},pl=process.platform,isWindows="win32"===pl,isMacos="darwin"===pl,isLinux="linux"===pl,isFreeBSD="freebsd"===pl,isIBMi="OS400"===type(),EVENTS={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},EV=EVENTS,THROTTLE_MODE_WATCH="watch",statMethods={lstat:lstat,stat:stat$1},KEY_LISTENERS="listeners",KEY_ERR="errHandlers",KEY_RAW="rawEmitters",HANDLER_KEYS=[KEY_LISTENERS,KEY_ERR,KEY_RAW],binaryExtensions=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),isBinaryPath=e=>binaryExtensions.has(sp.extname(e).slice(1).toLowerCase()),foreach=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},addAndConvert=(e,t,r)=>{let i=e[t];i instanceof Set||(e[t]=i=new Set([i])),i.add(r)},clearItem=e=>t=>{const r=e[t];r instanceof Set?r.clear():delete e[t]},delFromSet=(e,t,r)=>{const i=e[t];i instanceof Set?i.delete(r):i===r&&delete e[t]},isEmptySet=e=>e instanceof Set?0===e.size:!e,FsWatchInstances=new Map;function createFsWatchInstance(e,t,r,i,n){const s=(t,i)=>{r(e),n(t,i,{watchedPath:e}),i&&e!==i&&fsWatchBroadcast(sp.resolve(e,i),KEY_LISTENERS,sp.join(e,i))};try{return watch$1(e,{persistent:t.persistent},s)}catch(e){return void i(e)}}const fsWatchBroadcast=(e,t,r,i,n)=>{const s=FsWatchInstances.get(e);s&&foreach(s[t],e=>{e(r,i,n)})},setFsWatchListener=(e,t,r,i)=>{const{listener:n,errHandler:s,rawEmitter:u}=i;let o,a=FsWatchInstances.get(t);if(!r.persistent){if(o=createFsWatchInstance(e,r,n,s,u),!o)return;return o.close.bind(o)}if(a)addAndConvert(a,KEY_LISTENERS,n),addAndConvert(a,KEY_ERR,s),addAndConvert(a,KEY_RAW,u);else{if(o=createFsWatchInstance(e,r,fsWatchBroadcast.bind(null,t,KEY_LISTENERS),s,fsWatchBroadcast.bind(null,t,KEY_RAW)),!o)return;o.on(EV.ERROR,async r=>{const i=fsWatchBroadcast.bind(null,t,KEY_ERR);if(a&&(a.watcherUnusable=!0),isWindows&&"EPERM"===r.code)try{const t=await open(e,"r");await t.close(),i(r)}catch(e){}else i(r)}),a={listeners:n,errHandlers:s,rawEmitters:u,watcher:o},FsWatchInstances.set(t,a)}return()=>{delFromSet(a,KEY_LISTENERS,n),delFromSet(a,KEY_ERR,s),delFromSet(a,KEY_RAW,u),isEmptySet(a.listeners)&&(a.watcher.close(),FsWatchInstances.delete(t),HANDLER_KEYS.forEach(clearItem(a)),a.watcher=void 0,Object.freeze(a))}},FsWatchFileInstances=new Map,setFsWatchFileListener=(e,t,r,i)=>{const{listener:n,rawEmitter:s}=i;let u=FsWatchFileInstances.get(t);const o=u&&u.options;return o&&(o.persistent<r.persistent||o.interval>r.interval)&&(unwatchFile(t),u=void 0),u?(addAndConvert(u,KEY_LISTENERS,n),addAndConvert(u,KEY_RAW,s)):(u={listeners:n,rawEmitters:s,options:r,watcher:watchFile(t,r,(r,i)=>{foreach(u.rawEmitters,e=>{e(EV.CHANGE,t,{curr:r,prev:i})});const n=r.mtimeMs;(r.size!==i.size||n>i.mtimeMs||0===n)&&foreach(u.listeners,t=>t(e,r))})},FsWatchFileInstances.set(t,u)),()=>{delFromSet(u,KEY_LISTENERS,n),delFromSet(u,KEY_RAW,s),isEmptySet(u.listeners)&&(FsWatchFileInstances.delete(t),unwatchFile(t),u.options=u.watcher=void 0,Object.freeze(u))}};class NodeFsHandler{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const r=this.fsw.options,i=sp.dirname(e),n=sp.basename(e);this.fsw._getWatchedDir(i).add(n);const s=sp.resolve(e),u={persistent:r.persistent};let o;if(t||(t=EMPTY_FN),r.usePolling){const i=r.interval!==r.binaryInterval;u.interval=i&&isBinaryPath(n)?r.binaryInterval:r.interval,o=setFsWatchFileListener(e,s,u,{listener:t,rawEmitter:this.fsw._emitRaw})}else o=setFsWatchListener(e,s,u,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return o}_handleFile(e,t,r){if(this.fsw.closed)return;const i=sp.dirname(e),n=sp.basename(e),s=this.fsw._getWatchedDir(i);let u=t;if(s.has(n))return;const o=async(t,r)=>{if(this.fsw._throttle(THROTTLE_MODE_WATCH,e,5))if(r&&0!==r.mtimeMs){if(s.has(n)){const t=r.atimeMs,i=r.mtimeMs;(!t||t<=i||i!==u.mtimeMs)&&this.fsw._emit(EV.CHANGE,e,r),u=r}}else try{const r=await stat$1(e);if(this.fsw.closed)return;const i=r.atimeMs,n=r.mtimeMs;if((!i||i<=n||n!==u.mtimeMs)&&this.fsw._emit(EV.CHANGE,e,r),(isMacos||isLinux||isFreeBSD)&&u.ino!==r.ino){this.fsw._closeFile(t),u=r;const i=this._watchWithNodeFs(e,o);i&&this.fsw._addPathCloser(t,i)}else u=r}catch(e){this.fsw._remove(i,n)}},a=this._watchWithNodeFs(e,o);if((!r||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(EV.ADD,e,0))return;this.fsw._emit(EV.ADD,e,t)}return a}async _handleSymlink(e,t,r,i){if(this.fsw.closed)return;const n=e.fullPath,s=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){let t;this.fsw._incrReadyCount();try{t=await realpath(r)}catch(e){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return s.has(i)?this.fsw._symlinkPaths.get(n)!==t&&(this.fsw._symlinkPaths.set(n,t),this.fsw._emit(EV.CHANGE,r,e.stats)):(s.add(i),this.fsw._symlinkPaths.set(n,t),this.fsw._emit(EV.ADD,r,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(n))return!0;this.fsw._symlinkPaths.set(n,!0)}_handleRead(e,t,r,i,n,s,u){e=sp.join(e,"");const o=i?`${e}:${i}`:e;if(!(u=this.fsw._throttle("readdir",o,1e3)))return;const a=this.fsw._getWatchedDir(r.path),c=new Set;let l=this.fsw._readdirp(e,{fileFilter:e=>r.filterPath(e),directoryFilter:e=>r.filterDir(e)});return l?(l.on(STR_DATA,async u=>{if(this.fsw.closed)return void(l=void 0);const o=u.path;let D=sp.join(e,o);c.add(o),u.stats.isSymbolicLink()&&await this._handleSymlink(u,e,D,o)||(this.fsw.closed?l=void 0:o!==i&&(i||a.has(o))||(this.fsw._incrReadyCount(),D=sp.join(n,sp.relative(n,D)),this._addToNodeFs(D,t,r,s+1)))}).on(EV.ERROR,this._boundHandleError),new Promise((t,o)=>{if(!l)return o();l.once(STR_END,()=>{if(this.fsw.closed)return void(l=void 0);const o=!!u&&u.clear();t(void 0),a.getChildren().filter(t=>t!==e&&!c.has(t)).forEach(t=>{this.fsw._remove(e,t)}),l=void 0,o&&this._handleRead(e,!1,r,i,n,s,u)})})):void 0}async _handleDir(e,t,r,i,n,s,u){const o=this.fsw._getWatchedDir(sp.dirname(e)),a=o.has(sp.basename(e));let c,l;r&&this.fsw.options.ignoreInitial||n||a||this.fsw._emit(EV.ADD_DIR,e,t),o.add(sp.basename(e)),this.fsw._getWatchedDir(e);const D=this.fsw.options.depth;if((null==D||i<=D)&&!this.fsw._symlinkPaths.has(u)){if(!n&&(await this._handleRead(e,r,s,n,e,i,c),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,r)=>{r&&0===r.mtimeMs||this._handleRead(t,!1,s,n,e,i,c)})}return l}async _addToNodeFs(e,t,r,i,n){const s=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return s(),!1;const u=this.fsw._getWatchHelpers(e);r&&(u.filterPath=e=>r.filterPath(e),u.filterDir=e=>r.filterDir(e));try{const r=await statMethods[u.statMethod](u.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(u.watchPath,r))return s(),!1;const o=this.fsw.options.followSymlinks;let a;if(r.isDirectory()){const s=sp.resolve(e),c=o?await realpath(e):e;if(this.fsw.closed)return;if(a=await this._handleDir(u.watchPath,r,t,i,n,u,c),this.fsw.closed)return;s!==c&&void 0!==c&&this.fsw._symlinkPaths.set(s,c)}else if(r.isSymbolicLink()){const n=o?await realpath(e):e;if(this.fsw.closed)return;const s=sp.dirname(u.watchPath);if(this.fsw._getWatchedDir(s).add(u.watchPath),this.fsw._emit(EV.ADD,u.watchPath,r),a=await this._handleDir(s,r,t,i,e,u,n),this.fsw.closed)return;void 0!==n&&this.fsw._symlinkPaths.set(sp.resolve(e),n)}else a=this._handleFile(u.watchPath,r,t);return s(),a&&this.fsw._addPathCloser(e,a),!1}catch(t){if(this.fsw._handleError(t))return s(),e}}}
|
|
1
|
+
import path from"path";import fs$1 from"fs";import crypto from"crypto";import require$$0 from"readline";import require$$4 from"events";import require$$0$1 from"constants";import require$$0$2 from"stream";import require$$4$1 from"util";import require$$5 from"assert";import{EventEmitter}from"node:events";import{unwatchFile,watchFile,watch as watch$1,stat as stat$2}from"node:fs";import{lstat,stat as stat$1,readdir,realpath,open}from"node:fs/promises";import*as sp from"node:path";import{resolve,join,relative,sep}from"node:path";import{Readable}from"node:stream";import{type}from"node:os";import WebSocket,{WebSocketServer}from"ws";import express from"express";import http from"http";var __assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},__assign.apply(this,arguments)};function __awaiter(e,t,r,i){return new(r||(r=Promise))(function(n,s){function u(e){try{a(i.next(e))}catch(e){s(e)}}function o(e){try{a(i.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(u,o)}a((i=i.apply(e,t||[])).next())})}function __generator(e,t){var r,i,n,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=o(0),u.throw=o(1),u.return=o(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function o(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,o[0]&&(s=0)),s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function __spreadArray(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var MFE_NAME="mfe.json";function fetchFileByPath(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,7,,8]),[4,fetch(e)];case 1:if(t=r.sent(),!e.split("?")[0].endsWith(".json"))return[3,5];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,t.json()];case 3:return[2,r.sent()];case 4:return r.sent(),[3,5];case 5:return[4,t.text()];case 6:return[2,r.sent()];case 7:return r.sent(),[3,8];case 8:return[2]}})})}function uniReadFile(e){try{return e.endsWith(".json")?require(e):fs$1.readFileSync(e,"utf-8")}catch(e){}return""}function writeFiles(e,t){"object"==typeof t&&t&&(t=JSON.stringify(t,null,2));var r=path.dirname(e);return fs$1.existsSync(r)||fs$1.mkdirSync(r,{recursive:!0}),fs$1.writeFileSync(e,t,"utf-8")}var checkAndgenreDir=function(e){fs$1.existsSync(e)||fs$1.mkdirSync(e,{recursive:!0})},loadViteConfig=function(e){return(0,require("vite").loadEnv)(e,process.cwd(),"MFE_")},walkDir=function(e,t){var r=path.isAbsolute(e)?e:path.resolve(process.cwd(),e),i=[],n=function(e){(fs$1.existsSync(e)?fs$1.readdirSync(e):[]).forEach(function(t){var s=path.join(e,t);fs$1.statSync(s).isDirectory()?n(s):i.push(path.relative(r,s))})};return n(r),Array.from(new Set(Array.from(t).concat(i))).sort()};function generateHash(e,t,r){if(void 0===e&&(e=""),void 0===r&&(r="hex"),"string"!=typeof e)throw new Error("Content must be a string");var i=crypto.createHash(t);return i.update(e,"utf8"),i.digest(r)}function generateSHA256(e){return generateHash(e,"sha256")}var UniCdnManager=function(){function e(){this.HOST=""}return e.prototype.setCdnHost=function(e){this.HOST=e},e.prototype.getCdnUrl=function(e){var t=e.code,r=e.mode,i=e.appCode;return["".concat(this.HOST),getManifestCdnDirUrl({mode:r,code:t,appCode:i})]},e.prototype.getManifestUrl=function(e){var t=e.code,r=e.appCode,i=e.mode;return __spreadArray(__spreadArray([],this.getCdnUrl({code:t,mode:i,appCode:r}),!0),["".concat(MANIFEST_NAME)],!1).join("/")},e}(),cdn=new UniCdnManager,SAVE_CDN_FILE_PATH=path.join(process.cwd(),"node_modules/@dd-code/uni-files");path.join(process.cwd(),"node_modules/@dd-code/current-files");var MANIFEST_NAME="mfe-uni-manifest.json",ROOT_APP_CODE="main",MANIFEST_CND_DIR_URL="{mode}/static-repository/mfe-uni/{code}/{appCode}",getManifestCdnDirUrl=function(e){var t=e.mode,r=e.code,i=e.appCode;return MANIFEST_CND_DIR_URL.replace("{mode}",t).replace("{code}",r).replace("{appCode}",i)},getMfeJson=function(){var e=uniReadFile(path.resolve(process.cwd(),MFE_NAME))||{};return e.platform=process.env.UNI_PLATFORM||"h5",e},getMainAppJson=function(e){return __awaiter(void 0,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return t=formatCliCommandConfig(e),[4,fetchFileByPath(cdn.getManifestUrl({code:t.code,appCode:ROOT_APP_CODE,mode:e}))];case 1:return[2,r.sent()]}})})},getMainAppPages=function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,getMainAppJson(e)];case 1:return[2,t.sent().apps||[{appCode:"modules/bwzb"},{appCode:"modules/manage"},{appCode:"login"}]]}})})},getPlatform=function(){return process.env.UNI_PLATFORM||"h5"},formatCliCommandConfig=function(e){var t=loadViteConfig(e||"dev"),r=t.MFE_UNI_IS_ROOT;return{isRoot:r,appCode:r?ROOT_APP_CODE:t.MFE_APP_CODE,code:t.MFE_UNI_CODE,mode:e,cdn:t.MFE_CDN_HOST}},checkIsRootManifest=function(e){return e.isRoot||e.appCode===ROOT_APP_CODE},WS_PORT=3560,WS_PATH="/__mfe__ws__",E_WS_TYPE;!function(e){e.INIT="init_files",e.CHANGE="change_files"}(E_WS_TYPE||(E_WS_TYPE={}));var getMainAppJSon=function(e,t){return path.join(SAVE_CDN_FILE_PATH,e||"dev",t,"app.json")},getMainAppJsonPath=function(){return path.join(process.env.UNI_OUTPUT_DIR,"app.json")},EPlaform;!function(e){e.H5="h5",e.MP_WEIXIN="mp-weixin"}(EPlaform||(EPlaform={}));var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},eta,hasRequiredEta,terminal,hasRequiredTerminal;function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function requireEta(){if(hasRequiredEta)return eta;hasRequiredEta=1;return eta=class{constructor(e,t,r){this.etaBufferLength=e||100,this.valueBuffer=[r],this.timeBuffer=[t],this.eta="0"}update(e,t,r){this.valueBuffer.push(t),this.timeBuffer.push(e),this.calculate(r-t)}getTime(){return this.eta}calculate(e){const t=this.valueBuffer.length,r=Math.min(this.etaBufferLength,t),i=(this.valueBuffer[t-1]-this.valueBuffer[t-r])/(this.timeBuffer[t-1]-this.timeBuffer[t-r]);this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);const n=Math.ceil(e/i/1e3);isNaN(n)?this.eta="NULL":isFinite(n)?this.eta=n>1e7?"INF":n<0?0:n:this.eta="INF"}}}function requireTerminal(){if(hasRequiredTerminal)return terminal;hasRequiredTerminal=1;const e=require$$0;return terminal=class{constructor(e){this.stream=e,this.linewrap=!0,this.dy=0}cursorSave(){this.stream.isTTY&&this.stream.write("7")}cursorRestore(){this.stream.isTTY&&this.stream.write("8")}cursor(e){this.stream.isTTY&&(e?this.stream.write("[?25h"):this.stream.write("[?25l"))}cursorTo(t=null,r=null){this.stream.isTTY&&e.cursorTo(this.stream,t,r)}cursorRelative(t=null,r=null){this.stream.isTTY&&(this.dy=this.dy+r,e.moveCursor(this.stream,t,r))}cursorRelativeReset(){this.stream.isTTY&&(e.moveCursor(this.stream,0,-this.dy),e.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&e.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&e.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&e.clearScreenDown(this.stream)}newline(){this.stream.write("\n"),this.dy++}write(e,t=!1){!0===this.linewrap&&!1===t?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("[?7h"):this.stream.write("[?7l"))}isTTY(){return!0===this.stream.isTTY}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}}}var stringWidth={exports:{}},ansiRegex,hasRequiredAnsiRegex,stripAnsi,hasRequiredStripAnsi;function requireAnsiRegex(){return hasRequiredAnsiRegex?ansiRegex:(hasRequiredAnsiRegex=1,ansiRegex=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")})}function requireStripAnsi(){if(hasRequiredStripAnsi)return stripAnsi;hasRequiredStripAnsi=1;const e=requireAnsiRegex();return stripAnsi=t=>"string"==typeof t?t.replace(e(),""):t}var isFullwidthCodePoint={exports:{}},hasRequiredIsFullwidthCodePoint,emojiRegex,hasRequiredEmojiRegex,hasRequiredStringWidth,formatValue,hasRequiredFormatValue,formatBar,hasRequiredFormatBar,formatTime,hasRequiredFormatTime,formatter,hasRequiredFormatter,options,hasRequiredOptions,genericBar,hasRequiredGenericBar,singleBar,hasRequiredSingleBar,multiBar,hasRequiredMultiBar,legacy,hasRequiredLegacy,shadesClassic,hasRequiredShadesClassic,shadesGrey,hasRequiredShadesGrey,rect,hasRequiredRect,presets,hasRequiredPresets,cliProgress,hasRequiredCliProgress;function requireIsFullwidthCodePoint(){if(hasRequiredIsFullwidthCodePoint)return isFullwidthCodePoint.exports;hasRequiredIsFullwidthCodePoint=1;const e=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141));return isFullwidthCodePoint.exports=e,isFullwidthCodePoint.exports.default=e,isFullwidthCodePoint.exports}function requireEmojiRegex(){return hasRequiredEmojiRegex?emojiRegex:(hasRequiredEmojiRegex=1,emojiRegex=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g})}function requireStringWidth(){if(hasRequiredStringWidth)return stringWidth.exports;hasRequiredStringWidth=1;const e=requireStripAnsi(),t=requireIsFullwidthCodePoint(),r=requireEmojiRegex(),i=i=>{if("string"!=typeof i||0===i.length)return 0;if(0===(i=e(i)).length)return 0;i=i.replace(r()," ");let n=0;for(let e=0;e<i.length;e++){const r=i.codePointAt(e);r<=31||r>=127&&r<=159||(r>=768&&r<=879||(r>65535&&e++,n+=t(r)?2:1))}return n};return stringWidth.exports=i,stringWidth.exports.default=i,stringWidth.exports}function requireFormatValue(){return hasRequiredFormatValue||(hasRequiredFormatValue=1,formatValue=function(e,t,r){if(!0!==t.autopadding)return e;return"percentage"===r?(i=e,(t.autopaddingChar+i).slice(-3)):e;var i}),formatValue}function requireFormatBar(){return hasRequiredFormatBar||(hasRequiredFormatBar=1,formatBar=function(e,t){const r=Math.round(e*t.barsize),i=t.barsize-r;return t.barCompleteString.substr(0,r)+t.barGlue+t.barIncompleteString.substr(0,i)}),formatBar}function requireFormatTime(){return hasRequiredFormatTime||(hasRequiredFormatTime=1,formatTime=function(e,t,r){function i(e){return r?r*Math.round(e/r):e}function n(e){return(t.autopaddingChar+e).slice(-2)}return e>3600?n(Math.floor(e/3600))+"h"+n(i(e%3600/60))+"m":e>60?n(Math.floor(e/60))+"m"+n(i(e%60))+"s":e>10?n(i(e))+"s":n(e)+"s"}),formatTime}function requireFormatter(){if(hasRequiredFormatter)return formatter;hasRequiredFormatter=1;const e=requireStringWidth(),t=requireFormatValue(),r=requireFormatBar(),i=requireFormatTime();return formatter=function(n,s,u){let o=n.format;const a=n.formatTime||i,c=n.formatValue||t,l=n.formatBar||r,D=Math.floor(100*s.progress)+"",h=s.stopTime||Date.now(),f=Math.round((h-s.startTime)/1e3),d=Object.assign({},u,{bar:l(s.progress,n),percentage:c(D,n,"percentage"),total:c(s.total,n,"total"),value:c(s.value,n,"value"),eta:c(s.eta,n,"eta"),eta_formatted:a(s.eta,n,5),duration:c(f,n,"duration"),duration_formatted:a(f,n,1)});o=o.replace(/\{(\w+)\}/g,function(e,t){return void 0!==d[t]?d[t]:e});const p=Math.max(0,s.maxWidth-e(o)-2),m=Math.floor(p/2);switch(n.align){case"right":o=p>0?" ".repeat(p)+o:o;break;case"center":o=m>0?" ".repeat(m)+o:o}return o},formatter}function requireOptions(){if(hasRequiredOptions)return options;function e(e,t){return null==e?t:e}return hasRequiredOptions=1,options={parse:function(t,r){const i={},n=Object.assign({},r,t);return i.throttleTime=1e3/e(n.fps,10),i.stream=e(n.stream,process.stderr),i.terminal=e(n.terminal,null),i.clearOnComplete=e(n.clearOnComplete,!1),i.stopOnComplete=e(n.stopOnComplete,!1),i.barsize=e(n.barsize,40),i.align=e(n.align,"left"),i.hideCursor=e(n.hideCursor,!1),i.linewrap=e(n.linewrap,!1),i.barGlue=e(n.barGlue,""),i.barCompleteChar=e(n.barCompleteChar,"="),i.barIncompleteChar=e(n.barIncompleteChar,"-"),i.format=e(n.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),i.formatTime=e(n.formatTime,null),i.formatValue=e(n.formatValue,null),i.formatBar=e(n.formatBar,null),i.etaBufferLength=e(n.etaBuffer,10),i.etaAsynchronousUpdate=e(n.etaAsynchronousUpdate,!1),i.progressCalculationRelative=e(n.progressCalculationRelative,!1),i.synchronousUpdate=e(n.synchronousUpdate,!0),i.noTTYOutput=e(n.noTTYOutput,!1),i.notTTYSchedule=e(n.notTTYSchedule,2e3),i.emptyOnZero=e(n.emptyOnZero,!1),i.forceRedraw=e(n.forceRedraw,!1),i.autopadding=e(n.autopadding,!1),i.gracefulExit=e(n.gracefulExit,!1),i},assignDerivedOptions:function(t){return t.barCompleteString=t.barCompleteChar.repeat(t.barsize+1),t.barIncompleteString=t.barIncompleteChar.repeat(t.barsize+1),t.autopaddingChar=t.autopadding?e(t.autopaddingChar," "):"",t}}}function requireGenericBar(){if(hasRequiredGenericBar)return genericBar;hasRequiredGenericBar=1;const e=requireEta(),t=requireTerminal(),r=requireFormatter(),i=requireOptions(),n=require$$4;return genericBar=class extends n{constructor(n){super(),this.options=i.assignDerivedOptions(n),this.terminal=this.options.terminal?this.options.terminal:new t(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new e(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter="function"==typeof this.options.format?this.options.format:r}render(e=!1){const t={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();const r=this.formatter(this.options,t,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=r)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(r),this.terminal.clearRight(),this.lastDrawnString=r,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(t,r,i){this.value=r||0,this.total=void 0!==t&&t>=0?t:100,this.startValue=r||0,this.payload=i||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new e(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",t,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,t={}){"number"==typeof e&&(this.value=e,this.eta.update(Date.now(),e,this.total));const r=("object"==typeof e?e:t)||{};this.emit("update",this.total,this.value);for(const e in r)this.payload[e]=r[e];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,t={}){"object"==typeof e?this.update(this.value+1,e):this.update(this.value+e,t)}getTotal(){return this.total}setTotal(e){void 0!==e&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}},genericBar}function requireSingleBar(){if(hasRequiredSingleBar)return singleBar;hasRequiredSingleBar=1;const e=requireGenericBar(),t=requireOptions();return singleBar=class extends e{constructor(e,r){super(t.parse(e,r)),this.timer=null,this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,t){this.timer&&(super.update(e,t),this.options.synchronousUpdate&&this.lastRedraw+2*this.options.throttleTime<Date.now()&&this.render())}start(e,t,r){!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),super.start(e,t,r),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}},singleBar}function requireMultiBar(){if(hasRequiredMultiBar)return multiBar;hasRequiredMultiBar=1;const e=requireTerminal(),t=requireGenericBar(),r=requireOptions(),i=require$$4;return multiBar=class extends i{constructor(t,i){super(),this.bars=[],this.options=r.parse(t,i),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new e(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,r,i,n={}){const s=new t(Object.assign({},this.options,{terminal:this.terminal},n));return this.bars.push(s),!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,s.start(e,r,i),this.emit("start")),s}remove(e){const t=this.bars.indexOf(e);return!(t<0)&&(this.bars.splice(t,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}},multiBar}function requireLegacy(){return hasRequiredLegacy?legacy:(hasRequiredLegacy=1,legacy={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"})}function requireShadesClassic(){return hasRequiredShadesClassic?shadesClassic:(hasRequiredShadesClassic=1,shadesClassic={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"})}function requireShadesGrey(){return hasRequiredShadesGrey?shadesGrey:(hasRequiredShadesGrey=1,shadesGrey={format:" [90m{bar}[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"})}function requireRect(){return hasRequiredRect?rect:(hasRequiredRect=1,rect={format:" {bar}■ {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"■",barIncompleteChar:" "})}function requirePresets(){if(hasRequiredPresets)return presets;hasRequiredPresets=1;const e=requireLegacy(),t=requireShadesClassic(),r=requireShadesGrey(),i=requireRect();return presets={legacy:e,shades_classic:t,shades_grey:r,rect:i}}function requireCliProgress(){if(hasRequiredCliProgress)return cliProgress;hasRequiredCliProgress=1;const e=requireSingleBar(),t=requireMultiBar(),r=requirePresets(),i=requireFormatter(),n=requireFormatValue(),s=requireFormatBar(),u=requireFormatTime();return cliProgress={Bar:e,SingleBar:e,MultiBar:t,Presets:r,Format:{Formatter:i,BarFormat:s,ValueFormat:n,TimeFormat:u}}}var cliProgressExports=requireCliProgress();const ANSI_BACKGROUND_OFFSET=10,wrapAnsi16=(e=0)=>t=>`[${t+e}m`,wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`,wrapAnsi16m=(e=0)=>(t,r,i)=>`[${38+e};2;${t};${r};${i}m`,styles$1={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles$1.modifier);const foregroundColorNames=Object.keys(styles$1.color),backgroundColorNames=Object.keys(styles$1.bgColor);function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(styles$1)){for(const[t,i]of Object.entries(r))styles$1[t]={open:`[${i[0]}m`,close:`[${i[1]}m`},r[t]=styles$1[t],e.set(i[0],i[1]);Object.defineProperty(styles$1,t,{value:r,enumerable:!1})}return Object.defineProperty(styles$1,"codes",{value:e,enumerable:!1}),styles$1.color.close="[39m",styles$1.bgColor.close="[49m",styles$1.color.ansi=wrapAnsi16(),styles$1.color.ansi256=wrapAnsi256(),styles$1.color.ansi16m=wrapAnsi16m(),styles$1.bgColor.ansi=wrapAnsi16(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi256=wrapAnsi256(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi16m=wrapAnsi16m(ANSI_BACKGROUND_OFFSET),Object.defineProperties(styles$1,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,255&i]},enumerable:!1},hexToAnsi256:{value:e=>styles$1.rgbToAnsi256(...styles$1.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,i;if(e>=232)t=(10*(e-232)+8)/255,r=t,i=t;else{const n=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(n/6)/5,i=n%6/5}const n=2*Math.max(t,r,i);if(0===n)return 30;let s=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return 2===n&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(e)),enumerable:!1}}),styles$1}const ansiStyles=assembleStyles(),level=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),colorSupport=0!==level&&{level:level},supportsColor={stdout:colorSupport,stderr:colorSupport};function stringReplaceAll(e,t,r){let i=e.indexOf(t);if(-1===i)return e;const n=t.length;let s=0,u="";do{u+=e.slice(s,i)+t+r,s=i+n,i=e.indexOf(t,s)}while(-1!==i);return u+=e.slice(s),u}function stringEncaseCRLFWithFirstIndex(e,t,r,i){let n=0,s="";do{const u="\r"===e[i-1];s+=e.slice(n,u?i-1:i)+t+(u?"\r\n":"\n")+r,n=i+1,i=e.indexOf("\n",n)}while(-1!==i);return s+=e.slice(n),s}const{stdout:stdoutColor,stderr:stderrColor}=supportsColor,GENERATOR=Symbol("GENERATOR"),STYLER=Symbol("STYLER"),IS_EMPTY=Symbol("IS_EMPTY"),levelMapping=["ansi","ansi","ansi256","ansi16m"],styles=Object.create(null),applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=stdoutColor?stdoutColor.level:0;e.level=void 0===t.level?r:t.level},chalkFactory=e=>{const t=(...e)=>e.join(" ");return applyOptions(t,e),Object.setPrototypeOf(t,createChalk.prototype),t};function createChalk(e){return chalkFactory(e)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[e,t]of Object.entries(ansiStyles))styles[e]={get(){const r=createBuilder(this,createStyler(t.open,t.close,this[STYLER]),this[IS_EMPTY]);return Object.defineProperty(this,e,{value:r}),r}};styles.visible={get(){const e=createBuilder(this,this[STYLER],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const getModelAnsi=(e,t,r,...i)=>"rgb"===e?"ansi16m"===t?ansiStyles[r].ansi16m(...i):"ansi256"===t?ansiStyles[r].ansi256(ansiStyles.rgbToAnsi256(...i)):ansiStyles[r].ansi(ansiStyles.rgbToAnsi(...i)):"hex"===e?getModelAnsi("rgb",t,r,...ansiStyles.hexToRgb(...i)):ansiStyles[r][e](...i),usedModels=["rgb","hex","ansi256"];for(const e of usedModels){styles[e]={get(){const{level:t}=this;return function(...r){const i=createStyler(getModelAnsi(e,levelMapping[t],"color",...r),ansiStyles.color.close,this[STYLER]);return createBuilder(this,i,this[IS_EMPTY])}}};const t="bg"+e[0].toUpperCase()+e.slice(1);styles[t]={get(){const{level:t}=this;return function(...r){const i=createStyler(getModelAnsi(e,levelMapping[t],"bgColor",...r),ansiStyles.bgColor.close,this[STYLER]);return createBuilder(this,i,this[IS_EMPTY])}}}}const proto=Object.defineProperties(()=>{},{...styles,level:{enumerable:!0,get(){return this[GENERATOR].level},set(e){this[GENERATOR].level=e}}}),createStyler=(e,t,r)=>{let i,n;return void 0===r?(i=e,n=t):(i=r.openAll+e,n=t+r.closeAll),{open:e,close:t,openAll:i,closeAll:n,parent:r}},createBuilder=(e,t,r)=>{const i=(...e)=>applyStyle(i,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(i,proto),i[GENERATOR]=e,i[STYLER]=t,i[IS_EMPTY]=r,i},applyStyle=(e,t)=>{if(e.level<=0||!t)return e[IS_EMPTY]?"":t;let r=e[STYLER];if(void 0===r)return t;const{openAll:i,closeAll:n}=r;if(t.includes(""))for(;void 0!==r;)t=stringReplaceAll(t,r.close,r.open),r=r.parent;const s=t.indexOf("\n");return-1!==s&&(t=stringEncaseCRLFWithFirstIndex(t,n,i,s)),i+t+n};Object.defineProperties(createChalk.prototype,styles);const chalk=createChalk();createChalk({level:stderrColor?stderrColor.level:0});var CliProgressManager=function(){function e(){this.barMap=new Map}return e.prototype.initMultiBar=function(e){this.multiBar=new cliProgressExports.MultiBar({clearOnComplete:!1,hideCursor:!0,format:e||"".concat(chalk.yellow("{name}"),": ").concat(chalk.blue("{bar}")," | ").concat(chalk.green("{percentage}%")," | {value}/{total}"),barCompleteChar:"█",barIncompleteChar:"░",barGlue:"",stopOnComplete:!0},cliProgressExports.Presets.shades_grey)},e.prototype.createProgressBar=function(e){var t=this;e.forEach(function(e){var r=t.multiBar.create(e.total,0,{name:e.name});t.barMap.set(e.name,r)})},e.prototype.updateProgressBar=function(e,t){var r=this.barMap.get(e);if(r){var i=r.getTotal();r.update(t),t>=i&&r.stop()}},e.prototype.stopAll=function(){this.multiBar.stop()},e}(),CliProgressManager$1=new CliProgressManager,getDownloadedFilePath=function(e){return path.resolve(SAVE_CDN_FILE_PATH,e.env,e.appCode)},getNodeModulesEnvAppCodeFilePath=function(e,t){return path.resolve(getDownloadedFilePath(e),t)},getManifestJsonUrl=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i,n,s,u,o,a;return __generator(this,function(c){switch(c.label){case 0:t=formatCliCommandConfig(e),r=t.isRoot,i=void 0!==r&&r,n=t.code,s=void 0===n?"mfe-uni":n,u=[],o=getMfeJson(),c.label=1;case 1:return c.trys.push([1,5,,6]),a=[],i?(a=o.apps||[],[3,4]):[3,2];case 2:return[4,getMainAppPages(e)];case 3:a=__spreadArray(__spreadArray([],a=c.sent(),!0),[{appCode:ROOT_APP_CODE}],!1),c.label=4;case 4:return u=Array.from(new Set(__spreadArray([],(a||[]).map(function(e){return e.appCode}),!0))),[3,6];case 5:return c.sent(),u=[],[3,6];case 6:return[2,u.map(function(t){return{url:cdn.getManifestUrl({code:s,appCode:t,mode:e}),appCode:t,code:s}})]}})})},downloadManifestJson=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r;return __generator(this,function(i){switch(i.label){case 0:return t=e.map(function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return[4,fetchFileByPath(e).catch(function(e){})];case 1:return[2,t.sent()]}})})}),[4,Promise.all(t)];case 1:return r=i.sent(),[2,r.filter(function(e){return e})]}})})};function downloadFilesByManifestJson(e,t,r){return __awaiter(this,void 0,void 0,function(){var i,n,s,u,o,a,c,l,D,h,f,d,p;return __generator(this,function(m){switch(m.label){case 0:for(c in i=e.cdn,n=e.appCode,s=e.publicPath,u=e.files,a=[],o=u)a.push(c);l=0,m.label=1;case 1:return l<a.length?(c=a[l])in o?(h=u[D=c],f=h.fileUrl,d=h.fileName,[4,fetchFileByPath("".concat(i,"/").concat(s,"/").concat(f))]):[3,3]:[3,4];case 2:p=m.sent(),writeFiles(path.join(t,n||"",d),p),r&&r(Number(D),h.length),m.label=3;case 3:return l++,[3,1];case 4:return[2]}})})}var downloadProjectFiles=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i;return __generator(this,function(n){switch(n.label){case 0:for(i in t=[],CliProgressManager$1.initMultiBar(),CliProgressManager$1.createProgressBar(e.map(function(e){return{name:e.appCode,total:e.files.length}})),r=function(r){var i=e[r],n=downloadFilesByManifestJson(i,path.resolve(SAVE_CDN_FILE_PATH,i.mode||"dev"),function(e,t){CliProgressManager$1.updateProgressBar(i.appCode,e+1)});t.push(n)},e)r(i);return[4,Promise.all(t)];case 1:return n.sent(),CliProgressManager$1.stopAll(),[2]}})})},checkDownloadFilesIsExpired=function(e){return e.filter(function(e){var t=uniReadFile(getNodeModulesEnvAppCodeFilePath(e,MANIFEST_NAME));return!t||(null==t?void 0:t.hash)!==e.hash})},createManifestManager=function(){var e={code:"",mode:"",cdn:"",hash:"",publicPath:"",appCode:"",platform:process.env.UNI_PLATFORM||"h5",pagesJson:{},files:[]};return{get value(){return e},setFiles:function(t,r){var i=r.map(function(e){var r=path.resolve(t,e),i=generateSHA256(fs$1.readFileSync(r,"utf-8"));return{fileName:e,fileUrl:"".concat(i.slice(0,8),"_").concat(path.basename(e))}});e.files=i},setPagesJson:function(t){e.pagesJson=t},saveFile:function(t){var r=e.files.filter(function(e){return e.fileName!==MANIFEST_NAME});e.hash=generateSHA256(JSON.stringify(__assign(__assign({},e),{files:r}))),writeFiles(path.resolve(t,MANIFEST_NAME),JSON.stringify(e,null,2))},setEnv:function(t){var r=formatCliCommandConfig(t),i=getMfeJson();e.cdn=r.cdn,e.mode=t,e.code=r.code,e.appCode=r.appCode,cdn.setCdnHost(r.cdn),r.isRoot&&(e.isRoot=!0,e.apps=i.apps),e.publicPath=getManifestCdnDirUrl(e)},dependencies:[],setDependencies:function(e){this.dependencies=e}}},resetOutDir=function(e,t){var r,i=new RegExp("/(".concat(e.value.appCode,")/?"));process.env.MFE_SOURCE_OUTPUT_DIR=t.build.outDir,process.env.MFE_ROOT_OUTPUT_DIR=null===(r=process.env.MFE_SOURCE_OUTPUT_DIR)||void 0===r?void 0:r.replace(i,"/").replace(/\/$/,""),process.env.UNI_OUTPUT_DIR=process.env.MFE_ROOT_OUTPUT_DIR},fs={},universalify={},hasRequiredUniversalify,polyfills,hasRequiredPolyfills,legacyStreams,hasRequiredLegacyStreams,clone_1,hasRequiredClone,gracefulFs,hasRequiredGracefulFs,hasRequiredFs;function requireUniversalify(){return hasRequiredUniversalify||(hasRequiredUniversalify=1,universalify.fromCallback=function(e){return Object.defineProperty(function(...t){if("function"!=typeof t[t.length-1])return new Promise((r,i)=>{t.push((e,t)=>null!=e?i(e):r(t)),e.apply(this,t)});e.apply(this,t)},"name",{value:e.name})},universalify.fromPromise=function(e){return Object.defineProperty(function(...t){const r=t[t.length-1];if("function"!=typeof r)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>r(null,e),r)},"name",{value:e.name})}),universalify}function requirePolyfills(){if(hasRequiredPolyfills)return polyfills;hasRequiredPolyfills=1;var e=require$$0$1,t=process.cwd,r=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return r||(r=t.call(process)),r};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var n=process.chdir;process.chdir=function(e){r=null,n.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,n)}return polyfills=function(t){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(r,i,n){t.open(r,e.O_WRONLY|e.O_SYMLINK,i,function(e,r){e?n&&n(e):t.fchmod(r,i,function(e){t.close(r,function(t){n&&n(e||t)})})})},t.lchmodSync=function(r,i){var n,s=t.openSync(r,e.O_WRONLY|e.O_SYMLINK,i),u=!0;try{n=t.fchmodSync(s,i),u=!1}finally{if(u)try{t.closeSync(s)}catch(e){}else t.closeSync(s)}return n}}(t);t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(r,i,n,s){t.open(r,e.O_SYMLINK,function(e,r){e?s&&s(e):t.futimes(r,i,n,function(e){t.close(r,function(t){s&&s(e||t)})})})},t.lutimesSync=function(r,i,n){var s,u=t.openSync(r,e.O_SYMLINK),o=!0;try{s=t.futimesSync(u,i,n),o=!1}finally{if(o)try{t.closeSync(u)}catch(e){}else t.closeSync(u)}return s}):t.futimes&&(t.lutimes=function(e,t,r,i){i&&process.nextTick(i)},t.lutimesSync=function(){})}(t);t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=u(t.chownSync),t.fchownSync=u(t.fchownSync),t.lchownSync=u(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=o(t.stat),t.fstat=o(t.fstat),t.lstat=o(t.lstat),t.statSync=a(t.statSync),t.fstatSync=a(t.fstatSync),t.lstatSync=a(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(e,t,r){r&&process.nextTick(r)},t.lchmodSync=function(){});t.chown&&!t.lchown&&(t.lchown=function(e,t,r,i){i&&process.nextTick(i)},t.lchownSync=function(){});"win32"===i&&(t.rename="function"!=typeof t.rename?t.rename:function(e){function r(r,i,n){var s=Date.now(),u=0;e(r,i,function o(a){if(a&&("EACCES"===a.code||"EPERM"===a.code||"EBUSY"===a.code)&&Date.now()-s<6e4)return setTimeout(function(){t.stat(i,function(t,s){t&&"ENOENT"===t.code?e(r,i,o):n(a)})},u),void(u<100&&(u+=10));n&&n(a)})}return Object.setPrototypeOf&&Object.setPrototypeOf(r,e),r}(t.rename));function r(e){return e?function(r,i,n){return e.call(t,r,i,function(e){c(e)&&(e=null),n&&n.apply(this,arguments)})}:e}function n(e){return e?function(r,i){try{return e.call(t,r,i)}catch(e){if(!c(e))throw e}}:e}function s(e){return e?function(r,i,n,s){return e.call(t,r,i,n,function(e){c(e)&&(e=null),s&&s.apply(this,arguments)})}:e}function u(e){return e?function(r,i,n){try{return e.call(t,r,i,n)}catch(e){if(!c(e))throw e}}:e}function o(e){return e?function(r,i,n){function s(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof i&&(n=i,i=null),i?e.call(t,r,i,s):e.call(t,r,s)}:e}function a(e){return e?function(r,i){var n=i?e.call(t,r,i):e.call(t,r);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function c(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}t.read="function"!=typeof t.read?t.read:function(e){function r(r,i,n,s,u,o){var a;if(o&&"function"==typeof o){var c=0;a=function(l,D,h){if(l&&"EAGAIN"===l.code&&c<10)return c++,e.call(t,r,i,n,s,u,a);o.apply(this,arguments)}}return e.call(t,r,i,n,s,u,a)}return Object.setPrototypeOf&&Object.setPrototypeOf(r,e),r}(t.read),t.readSync="function"!=typeof t.readSync?t.readSync:(l=t.readSync,function(e,r,i,n,s){for(var u=0;;)try{return l.call(t,e,r,i,n,s)}catch(e){if("EAGAIN"===e.code&&u<10){u++;continue}throw e}});var l},polyfills}function requireLegacyStreams(){if(hasRequiredLegacyStreams)return legacyStreams;hasRequiredLegacyStreams=1;var e=require$$0$2.Stream;return legacyStreams=function(t){return{ReadStream:function r(i,n){if(!(this instanceof r))return new r(i,n);e.call(this);var s=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,n=n||{};for(var u=Object.keys(n),o=0,a=u.length;o<a;o++){var c=u[o];this[c]=n[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick(function(){s._read()});t.open(this.path,this.flags,this.mode,function(e,t){if(e)return s.emit("error",e),void(s.readable=!1);s.fd=t,s.emit("open",t),s._read()})},WriteStream:function r(i,n){if(!(this instanceof r))return new r(i,n);e.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),u=0,o=s.length;u<o;u++){var a=s[u];this[a]=n[a]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},legacyStreams}function requireClone(){if(hasRequiredClone)return clone_1;hasRequiredClone=1,clone_1=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var r={__proto__:e(t)};else r=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}),r};var e=Object.getPrototypeOf||function(e){return e.__proto__};return clone_1}function requireGracefulFs(){if(hasRequiredGracefulFs)return gracefulFs;hasRequiredGracefulFs=1;var e,t,r=fs$1,i=requirePolyfills(),n=requireLegacyStreams(),s=requireClone(),u=require$$4$1;function o(t,r){Object.defineProperty(t,e,{get:function(){return r}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),t=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var a,c=function(){};if(u.debuglog?c=u.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(c=function(){var e=u.format.apply(u,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ")}),!r[e]){var l=commonjsGlobal[e]||[];o(r,l),r.close=function(e){function i(t,i){return e.call(r,t,function(e){e||f(),"function"==typeof i&&i.apply(this,arguments)})}return Object.defineProperty(i,t,{value:e}),i}(r.close),r.closeSync=function(e){function i(t){e.apply(r,arguments),f()}return Object.defineProperty(i,t,{value:e}),i}(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){c(r[e]),require$$5.equal(r[e].length,0)})}function D(e){i(e),e.gracefulify=D,e.createReadStream=function(t,r){return new e.ReadStream(t,r)},e.createWriteStream=function(t,r){return new e.WriteStream(t,r)};var t=e.readFile;e.readFile=function(e,r,i){"function"==typeof r&&(i=r,r=null);return function e(r,i,n,s){return t(r,i,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof n&&n.apply(this,arguments):h([e,[r,i,n],t,s||Date.now(),Date.now()])})}(e,r,i)};var r=e.writeFile;e.writeFile=function(e,t,i,n){"function"==typeof i&&(n=i,i=null);return function e(t,i,n,s,u){return r(t,i,n,function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof s&&s.apply(this,arguments):h([e,[t,i,n,s],r,u||Date.now(),Date.now()])})}(e,t,i,n)};var s=e.appendFile;s&&(e.appendFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,n,u){return s(t,r,i,function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],s,u||Date.now(),Date.now()])})}(e,t,r,i)});var u=e.copyFile;u&&(e.copyFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=0);return function e(t,r,i,n,s){return u(t,r,i,function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],u,s||Date.now(),Date.now()])})}(e,t,r,i)});var o=e.readdir;e.readdir=function(e,t,r){"function"==typeof t&&(r=t,t=null);var i=a.test(process.version)?function(e,t,r,i){return o(e,n(e,t,r,i))}:function(e,t,r,i){return o(e,t,n(e,t,r,i))};return i(e,t,r);function n(e,t,r,n){return function(s,u){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?(u&&u.sort&&u.sort(),"function"==typeof r&&r.call(this,s,u)):h([i,[e,t,r],s,n||Date.now(),Date.now()])}}};var a=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var c=n(e);m=c.ReadStream,y=c.WriteStream}var l=e.ReadStream;l&&(m.prototype=Object.create(l.prototype),m.prototype.open=function(){var e=this;F(e.path,e.flags,e.mode,function(t,r){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r),e.read())})});var f=e.WriteStream;f&&(y.prototype=Object.create(f.prototype),y.prototype.open=function(){var e=this;F(e.path,e.flags,e.mode,function(t,r){t?(e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r))})}),Object.defineProperty(e,"ReadStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var d=m;Object.defineProperty(e,"FileReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var p=y;function m(e,t){return this instanceof m?(l.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function y(e,t){return this instanceof y?(f.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return p},set:function(e){p=e},enumerable:!0,configurable:!0});var E=e.open;function F(e,t,r,i){return"function"==typeof r&&(i=r,r=null),function e(t,r,i,n,s){return E(t,r,i,function(u,o){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof n&&n.apply(this,arguments):h([e,[t,r,i,n],u,s||Date.now(),Date.now()])})}(e,t,r,i)}return e.open=F,e}function h(t){c("ENQUEUE",t[0].name,t[1]),r[e].push(t),d()}function f(){for(var t=Date.now(),i=0;i<r[e].length;++i)r[e][i].length>2&&(r[e][i][3]=t,r[e][i][4]=t);d()}function d(){if(clearTimeout(a),a=void 0,0!==r[e].length){var t=r[e].shift(),i=t[0],n=t[1],s=t[2],u=t[3],o=t[4];if(void 0===u)c("RETRY",i.name,n),i.apply(null,n);else if(Date.now()-u>=6e4){c("TIMEOUT",i.name,n);var l=n.pop();"function"==typeof l&&l.call(null,s)}else{var D=Date.now()-o,h=Math.max(o-u,1);D>=Math.min(1.2*h,100)?(c("RETRY",i.name,n),i.apply(null,n.concat([u]))):r[e].push(t)}void 0===a&&(a=setTimeout(d,0))}}return commonjsGlobal[e]||o(commonjsGlobal,r[e]),gracefulFs=D(s(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(gracefulFs=D(r),r.__patched=!0),gracefulFs}function requireFs(){return hasRequiredFs||(hasRequiredFs=1,function(e){const t=requireUniversalify().fromCallback,r=requireGracefulFs(),i=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(e=>"function"==typeof r[e]);Object.assign(e,r),i.forEach(i=>{e[i]=t(r[i])}),e.exists=function(e,t){return"function"==typeof t?r.exists(e,t):new Promise(t=>r.exists(e,t))},e.read=function(e,t,i,n,s,u){return"function"==typeof u?r.read(e,t,i,n,s,u):new Promise((u,o)=>{r.read(e,t,i,n,s,(e,t,r)=>{if(e)return o(e);u({bytesRead:t,buffer:r})})})},e.write=function(e,t,...i){return"function"==typeof i[i.length-1]?r.write(e,t,...i):new Promise((n,s)=>{r.write(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffer:r})})})},e.readv=function(e,t,...i){return"function"==typeof i[i.length-1]?r.readv(e,t,...i):new Promise((n,s)=>{r.readv(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesRead:t,buffers:r})})})},e.writev=function(e,t,...i){return"function"==typeof i[i.length-1]?r.writev(e,t,...i):new Promise((n,s)=>{r.writev(e,t,...i,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffers:r})})})},"function"==typeof r.realpath.native?e.realpath.native=t(r.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(fs)),fs}var makeDir={},utils$1={},hasRequiredUtils$1,hasRequiredMakeDir,mkdirs,hasRequiredMkdirs,pathExists_1,hasRequiredPathExists,utimes,hasRequiredUtimes,stat,hasRequiredStat,async,hasRequiredAsync,copy_1,hasRequiredCopy$1,copySync_1,hasRequiredCopySync,copy,hasRequiredCopy,remove_1,hasRequiredRemove,empty,hasRequiredEmpty,file,hasRequiredFile,link,hasRequiredLink,symlinkPaths_1,hasRequiredSymlinkPaths,symlinkType_1,hasRequiredSymlinkType,symlink,hasRequiredSymlink,ensure,hasRequiredEnsure,utils,hasRequiredUtils,jsonfile$1,hasRequiredJsonfile$1,jsonfile,hasRequiredJsonfile,outputFile_1,hasRequiredOutputFile,outputJson_1,hasRequiredOutputJson,outputJsonSync_1,hasRequiredOutputJsonSync,json,hasRequiredJson,move_1,hasRequiredMove$1,moveSync_1,hasRequiredMoveSync,move,hasRequiredMove,lib$1,hasRequiredLib$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;const e=path;return utils$1.checkPath=function(t){if("win32"===process.platform){if(/[<>:"|?*]/.test(t.replace(e.parse(t).root,""))){const e=new Error(`Path contains invalid characters: ${t}`);throw e.code="EINVAL",e}}},utils$1}function requireMakeDir(){if(hasRequiredMakeDir)return makeDir;hasRequiredMakeDir=1;const e=requireFs(),{checkPath:t}=requireUtils$1(),r=e=>"number"==typeof e?e:{mode:511,...e}.mode;return makeDir.makeDir=async(i,n)=>(t(i),e.mkdir(i,{mode:r(n),recursive:!0})),makeDir.makeDirSync=(i,n)=>(t(i),e.mkdirSync(i,{mode:r(n),recursive:!0})),makeDir}function requireMkdirs(){if(hasRequiredMkdirs)return mkdirs;hasRequiredMkdirs=1;const e=requireUniversalify().fromPromise,{makeDir:t,makeDirSync:r}=requireMakeDir(),i=e(t);return mkdirs={mkdirs:i,mkdirsSync:r,mkdirp:i,mkdirpSync:r,ensureDir:i,ensureDirSync:r}}function requirePathExists(){if(hasRequiredPathExists)return pathExists_1;hasRequiredPathExists=1;const e=requireUniversalify().fromPromise,t=requireFs();return pathExists_1={pathExists:e(function(e){return t.access(e).then(()=>!0).catch(()=>!1)}),pathExistsSync:t.existsSync},pathExists_1}function requireUtimes(){if(hasRequiredUtimes)return utimes;hasRequiredUtimes=1;const e=requireFs(),t=requireUniversalify().fromPromise;return utimes={utimesMillis:t(async function(t,r,i){const n=await e.open(t,"r+");let s=null;try{await e.futimes(n,r,i)}finally{try{await e.close(n)}catch(e){s=e}}if(s)throw s}),utimesMillisSync:function(t,r,i){const n=e.openSync(t,"r+");return e.futimesSync(n,r,i),e.closeSync(n)}},utimes}function requireStat(){if(hasRequiredStat)return stat;hasRequiredStat=1;const e=requireFs(),t=path,r=requireUniversalify().fromPromise;function i(e,t){return void 0!==t.ino&&void 0!==t.dev&&t.ino===e.ino&&t.dev===e.dev}function n(e,r){const i=t.resolve(e).split(t.sep).filter(e=>e),n=t.resolve(r).split(t.sep).filter(e=>e);return i.every((e,t)=>n[t]===e)}function s(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}return stat={checkPaths:r(async function(r,u,o,a){const{srcStat:c,destStat:l}=await function(t,r,i){const n=i.dereference?t=>e.stat(t,{bigint:!0}):t=>e.lstat(t,{bigint:!0});return Promise.all([n(t),n(r).catch(e=>{if("ENOENT"===e.code)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}(r,u,a);if(l){if(i(c,l)){const e=t.basename(r),i=t.basename(u);if("move"===o&&e!==i&&e.toLowerCase()===i.toLowerCase())return{srcStat:c,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${r}'.`);if(!c.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${r}'.`)}if(c.isDirectory()&&n(r,u))throw new Error(s(r,u,o));return{srcStat:c,destStat:l}}),checkPathsSync:function(r,u,o,a){const{srcStat:c,destStat:l}=function(t,r,i){let n;const s=i.dereference?t=>e.statSync(t,{bigint:!0}):t=>e.lstatSync(t,{bigint:!0}),u=s(t);try{n=s(r)}catch(e){if("ENOENT"===e.code)return{srcStat:u,destStat:null};throw e}return{srcStat:u,destStat:n}}(r,u,a);if(l){if(i(c,l)){const e=t.basename(r),i=t.basename(u);if("move"===o&&e!==i&&e.toLowerCase()===i.toLowerCase())return{srcStat:c,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${r}'.`);if(!c.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${r}'.`)}if(c.isDirectory()&&n(r,u))throw new Error(s(r,u,o));return{srcStat:c,destStat:l}},checkParentPaths:r(async function r(n,u,o,a){const c=t.resolve(t.dirname(n)),l=t.resolve(t.dirname(o));if(l===c||l===t.parse(l).root)return;let D;try{D=await e.stat(l,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(i(u,D))throw new Error(s(n,o,a));return r(n,u,l,a)}),checkParentPathsSync:function r(n,u,o,a){const c=t.resolve(t.dirname(n)),l=t.resolve(t.dirname(o));if(l===c||l===t.parse(l).root)return;let D;try{D=e.statSync(l,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(i(u,D))throw new Error(s(n,o,a));return r(n,u,l,a)},isSrcSubdir:n,areIdentical:i},stat}function requireAsync(){if(hasRequiredAsync)return async;return hasRequiredAsync=1,async={asyncIteratorConcurrentProcess:async function(e,t){const r=[];for await(const i of e)r.push(t(i).then(()=>null,e=>e??new Error("unknown error")));await Promise.all(r.map(e=>e.then(e=>{if(null!==e)throw e})))}}}function requireCopy$1(){if(hasRequiredCopy$1)return copy_1;hasRequiredCopy$1=1;const e=requireFs(),t=path,{mkdirs:r}=requireMkdirs(),{pathExists:i}=requirePathExists(),{utimesMillis:n}=requireUtimes(),s=requireStat(),{asyncIteratorConcurrentProcess:u}=requireAsync();async function o(e,t,r){return!r.filter||r.filter(e,t)}async function a(r,i,n,l){const D=l.dereference?e.stat:e.lstat,h=await D(i);if(h.isDirectory())return async function(r,i,n,c,l){i||await e.mkdir(c);await u(await e.opendir(n),async e=>{const r=t.join(n,e.name),i=t.join(c,e.name);if(await o(r,i,l)){const{destStat:e}=await s.checkPaths(r,i,"copy",l);await a(e,r,i,l)}}),i||await e.chmod(c,r.mode)}(h,r,i,n,l);if(h.isFile()||h.isCharacterDevice()||h.isBlockDevice())return async function(t,r,i,n,s){if(!r)return c(t,i,n,s);if(s.overwrite)return await e.unlink(n),c(t,i,n,s);if(s.errorOnExist)throw new Error(`'${n}' already exists`)}(h,r,i,n,l);if(h.isSymbolicLink())return async function(r,i,n,u){let o=await e.readlink(i);u.dereference&&(o=t.resolve(process.cwd(),o));if(!r)return e.symlink(o,n);let a=null;try{a=await e.readlink(n)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return e.symlink(o,n);throw t}u.dereference&&(a=t.resolve(process.cwd(),a));if(s.isSrcSubdir(o,a))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${a}'.`);if(s.isSrcSubdir(a,o))throw new Error(`Cannot overwrite '${a}' with '${o}'.`);return await e.unlink(n),e.symlink(o,n)}(r,i,n,l);if(h.isSocket())throw new Error(`Cannot copy a socket file: ${i}`);if(h.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${i}`);throw new Error(`Unknown file: ${i}`)}async function c(t,r,i,s){if(await e.copyFile(r,i),s.preserveTimestamps){128&t.mode||await function(t,r){return e.chmod(t,128|r)}(i,t.mode);const s=await e.stat(r);await n(i,s.atime,s.mtime)}return e.chmod(i,t.mode)}return copy_1=async function(e,n,u={}){"function"==typeof u&&(u={filter:u}),u.clobber=!("clobber"in u)||!!u.clobber,u.overwrite="overwrite"in u?!!u.overwrite:u.clobber,u.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001");const{srcStat:c,destStat:l}=await s.checkPaths(e,n,"copy",u);if(await s.checkParentPaths(e,c,n,"copy"),!await o(e,n,u))return;const D=t.dirname(n);await i(D)||await r(D),await a(l,e,n,u)}}function requireCopySync(){if(hasRequiredCopySync)return copySync_1;hasRequiredCopySync=1;const e=requireGracefulFs(),t=path,r=requireMkdirs().mkdirsSync,i=requireUtimes().utimesMillisSync,n=requireStat();function s(r,i,s,c){const l=(c.dereference?e.statSync:e.lstatSync)(i);if(l.isDirectory())return function(t,r,i,n,s){return r?a(i,n,s):function(t,r,i,n){return e.mkdirSync(i),a(r,i,n),o(i,t)}(t.mode,i,n,s)}(l,r,i,s,c);if(l.isFile()||l.isCharacterDevice()||l.isBlockDevice())return function(t,r,i,n,s){return r?function(t,r,i,n){if(n.overwrite)return e.unlinkSync(i),u(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}(t,i,n,s):u(t,i,n,s)}(l,r,i,s,c);if(l.isSymbolicLink())return function(r,i,s,u){let o=e.readlinkSync(i);u.dereference&&(o=t.resolve(process.cwd(),o));if(r){let r;try{r=e.readlinkSync(s)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return e.symlinkSync(o,s);throw t}if(u.dereference&&(r=t.resolve(process.cwd(),r)),n.isSrcSubdir(o,r))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${r}'.`);if(n.isSrcSubdir(r,o))throw new Error(`Cannot overwrite '${r}' with '${o}'.`);return function(t,r){return e.unlinkSync(r),e.symlinkSync(t,r)}(o,s)}return e.symlinkSync(o,s)}(r,i,s,c);if(l.isSocket())throw new Error(`Cannot copy a socket file: ${i}`);if(l.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${i}`);throw new Error(`Unknown file: ${i}`)}function u(t,r,n,s){return e.copyFileSync(r,n),s.preserveTimestamps&&function(t,r,n){(function(e){return!(128&e)})(t)&&function(e,t){o(e,128|t)}(n,t);(function(t,r){const n=e.statSync(t);i(r,n.atime,n.mtime)})(r,n)}(t.mode,r,n),o(n,t.mode)}function o(t,r){return e.chmodSync(t,r)}function a(t,r,i){const n=e.opendirSync(t);try{let e;for(;null!==(e=n.readSync());)c(e.name,t,r,i)}finally{n.closeSync()}}function c(e,r,i,u){const o=t.join(r,e),a=t.join(i,e);if(u.filter&&!u.filter(o,a))return;const{destStat:c}=n.checkPathsSync(o,a,"copy",u);return s(c,o,a,u)}return copySync_1=function(i,u,o){"function"==typeof o&&(o={filter:o}),(o=o||{}).clobber=!("clobber"in o)||!!o.clobber,o.overwrite="overwrite"in o?!!o.overwrite:o.clobber,o.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:a,destStat:c}=n.checkPathsSync(i,u,"copy",o);if(n.checkParentPathsSync(i,a,u,"copy"),o.filter&&!o.filter(i,u))return;const l=t.dirname(u);return e.existsSync(l)||r(l),s(c,i,u,o)}}function requireCopy(){if(hasRequiredCopy)return copy;hasRequiredCopy=1;const e=requireUniversalify().fromPromise;return copy={copy:e(requireCopy$1()),copySync:requireCopySync()}}function requireRemove(){if(hasRequiredRemove)return remove_1;hasRequiredRemove=1;const e=requireGracefulFs(),t=requireUniversalify().fromCallback;return remove_1={remove:t(function(t,r){e.rm(t,{recursive:!0,force:!0},r)}),removeSync:function(t){e.rmSync(t,{recursive:!0,force:!0})}},remove_1}function requireEmpty(){if(hasRequiredEmpty)return empty;hasRequiredEmpty=1;const e=requireUniversalify().fromPromise,t=requireFs(),r=path,i=requireMkdirs(),n=requireRemove(),s=e(async function(e){let s;try{s=await t.readdir(e)}catch{return i.mkdirs(e)}return Promise.all(s.map(t=>n.remove(r.join(e,t))))});function u(e){let s;try{s=t.readdirSync(e)}catch{return i.mkdirsSync(e)}s.forEach(t=>{t=r.join(e,t),n.removeSync(t)})}return empty={emptyDirSync:u,emptydirSync:u,emptyDir:s,emptydir:s}}function requireFile(){if(hasRequiredFile)return file;hasRequiredFile=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),i=requireMkdirs();return file={createFile:e(async function(e){let n;try{n=await r.stat(e)}catch{}if(n&&n.isFile())return;const s=t.dirname(e);let u=null;try{u=await r.stat(s)}catch(t){if("ENOENT"===t.code)return await i.mkdirs(s),void await r.writeFile(e,"");throw t}u.isDirectory()?await r.writeFile(e,""):await r.readdir(s)}),createFileSync:function(e){let n;try{n=r.statSync(e)}catch{}if(n&&n.isFile())return;const s=t.dirname(e);try{r.statSync(s).isDirectory()||r.readdirSync(s)}catch(e){if(!e||"ENOENT"!==e.code)throw e;i.mkdirsSync(s)}r.writeFileSync(e,"")}}}function requireLink(){if(hasRequiredLink)return link;hasRequiredLink=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),i=requireMkdirs(),{pathExists:n}=requirePathExists(),{areIdentical:s}=requireStat();return link={createLink:e(async function(e,u){let o,a;try{o=await r.lstat(u)}catch{}try{a=await r.lstat(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}if(o&&s(a,o))return;const c=t.dirname(u);await n(c)||await i.mkdirs(c),await r.link(e,u)}),createLinkSync:function(e,n){let u;try{u=r.lstatSync(n)}catch{}try{const t=r.lstatSync(e);if(u&&s(t,u))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const o=t.dirname(n);return r.existsSync(o)||i.mkdirsSync(o),r.linkSync(e,n)}}}function requireSymlinkPaths(){if(hasRequiredSymlinkPaths)return symlinkPaths_1;hasRequiredSymlinkPaths=1;const e=path,t=requireFs(),{pathExists:r}=requirePathExists(),i=requireUniversalify().fromPromise;return symlinkPaths_1={symlinkPaths:i(async function(i,n){if(e.isAbsolute(i)){try{await t.lstat(i)}catch(e){throw e.message=e.message.replace("lstat","ensureSymlink"),e}return{toCwd:i,toDst:i}}const s=e.dirname(n),u=e.join(s,i);if(await r(u))return{toCwd:u,toDst:i};try{await t.lstat(i)}catch(e){throw e.message=e.message.replace("lstat","ensureSymlink"),e}return{toCwd:i,toDst:e.relative(s,i)}}),symlinkPathsSync:function(r,i){if(e.isAbsolute(r)){if(!t.existsSync(r))throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}const n=e.dirname(i),s=e.join(n,r);if(t.existsSync(s))return{toCwd:s,toDst:r};if(!t.existsSync(r))throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:e.relative(n,r)}}}}function requireSymlinkType(){if(hasRequiredSymlinkType)return symlinkType_1;hasRequiredSymlinkType=1;const e=requireFs(),t=requireUniversalify().fromPromise;return symlinkType_1={symlinkType:t(async function(t,r){if(r)return r;let i;try{i=await e.lstat(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}),symlinkTypeSync:function(t,r){if(r)return r;let i;try{i=e.lstatSync(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}},symlinkType_1}function requireSymlink(){if(hasRequiredSymlink)return symlink;hasRequiredSymlink=1;const e=requireUniversalify().fromPromise,t=path,r=requireFs(),{mkdirs:i,mkdirsSync:n}=requireMkdirs(),{symlinkPaths:s,symlinkPathsSync:u}=requireSymlinkPaths(),{symlinkType:o,symlinkTypeSync:a}=requireSymlinkType(),{pathExists:c}=requirePathExists(),{areIdentical:l}=requireStat();return symlink={createSymlink:e(async function(e,n,u){let a;try{a=await r.lstat(n)}catch{}if(a&&a.isSymbolicLink()){const[t,i]=await Promise.all([r.stat(e),r.stat(n)]);if(l(t,i))return}const D=await s(e,n);e=D.toDst;const h=await o(D.toCwd,u),f=t.dirname(n);return await c(f)||await i(f),r.symlink(e,n,h)}),createSymlinkSync:function(e,i,s){let o;try{o=r.lstatSync(i)}catch{}if(o&&o.isSymbolicLink()){const t=r.statSync(e),n=r.statSync(i);if(l(t,n))return}const c=u(e,i);e=c.toDst,s=a(c.toCwd,s);const D=t.dirname(i);return r.existsSync(D)||n(D),r.symlinkSync(e,i,s)}},symlink}function requireEnsure(){if(hasRequiredEnsure)return ensure;hasRequiredEnsure=1;const{createFile:e,createFileSync:t}=requireFile(),{createLink:r,createLinkSync:i}=requireLink(),{createSymlink:n,createSymlinkSync:s}=requireSymlink();return ensure={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:r,createLinkSync:i,ensureLink:r,ensureLinkSync:i,createSymlink:n,createSymlinkSync:s,ensureSymlink:n,ensureSymlinkSync:s}}function requireUtils(){if(hasRequiredUtils)return utils;return hasRequiredUtils=1,utils={stringify:function(e,{EOL:t="\n",finalEOL:r=!0,replacer:i=null,spaces:n}={}){const s=r?t:"";return JSON.stringify(e,i,n).replace(/\n/g,t)+s},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}}}function requireJsonfile$1(){if(hasRequiredJsonfile$1)return jsonfile$1;let e;hasRequiredJsonfile$1=1;try{e=requireGracefulFs()}catch(t){e=fs$1}const t=requireUniversalify(),{stringify:r,stripBom:i}=requireUtils();const n=t.fromPromise(async function(r,n={}){"string"==typeof n&&(n={encoding:n});const s=n.fs||e,u=!("throws"in n)||n.throws;let o,a=await t.fromCallback(s.readFile)(r,n);a=i(a);try{o=JSON.parse(a,n?n.reviver:null)}catch(e){if(u)throw e.message=`${r}: ${e.message}`,e;return null}return o});const s=t.fromPromise(async function(i,n,s={}){const u=s.fs||e,o=r(n,s);await t.fromCallback(u.writeFile)(i,o,s)});return jsonfile$1={readFile:n,readFileSync:function(t,r={}){"string"==typeof r&&(r={encoding:r});const n=r.fs||e,s=!("throws"in r)||r.throws;try{let e=n.readFileSync(t,r);return e=i(e),JSON.parse(e,r.reviver)}catch(e){if(s)throw e.message=`${t}: ${e.message}`,e;return null}},writeFile:s,writeFileSync:function(t,i,n={}){const s=n.fs||e,u=r(i,n);return s.writeFileSync(t,u,n)}},jsonfile$1}function requireJsonfile(){if(hasRequiredJsonfile)return jsonfile;hasRequiredJsonfile=1;const e=requireJsonfile$1();return jsonfile={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync}}function requireOutputFile(){if(hasRequiredOutputFile)return outputFile_1;hasRequiredOutputFile=1;const e=requireUniversalify().fromPromise,t=requireFs(),r=path,i=requireMkdirs(),n=requirePathExists().pathExists;return outputFile_1={outputFile:e(async function(e,s,u="utf-8"){const o=r.dirname(e);return await n(o)||await i.mkdirs(o),t.writeFile(e,s,u)}),outputFileSync:function(e,...n){const s=r.dirname(e);t.existsSync(s)||i.mkdirsSync(s),t.writeFileSync(e,...n)}},outputFile_1}function requireOutputJson(){if(hasRequiredOutputJson)return outputJson_1;hasRequiredOutputJson=1;const{stringify:e}=requireUtils(),{outputFile:t}=requireOutputFile();return outputJson_1=async function(r,i,n={}){const s=e(i,n);await t(r,s,n)},outputJson_1}function requireOutputJsonSync(){if(hasRequiredOutputJsonSync)return outputJsonSync_1;hasRequiredOutputJsonSync=1;const{stringify:e}=requireUtils(),{outputFileSync:t}=requireOutputFile();return outputJsonSync_1=function(r,i,n){const s=e(i,n);t(r,s,n)},outputJsonSync_1}function requireJson(){if(hasRequiredJson)return json;hasRequiredJson=1;const e=requireUniversalify().fromPromise,t=requireJsonfile();return t.outputJson=e(requireOutputJson()),t.outputJsonSync=requireOutputJsonSync(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,json=t}function requireMove$1(){if(hasRequiredMove$1)return move_1;hasRequiredMove$1=1;const e=requireFs(),t=path,{copy:r}=requireCopy(),{remove:i}=requireRemove(),{mkdirp:n}=requireMkdirs(),{pathExists:s}=requirePathExists(),u=requireStat();return move_1=async function(o,a,c={}){const l=c.overwrite||c.clobber||!1,{srcStat:D,isChangingCase:h=!1}=await u.checkPaths(o,a,"move",c);await u.checkParentPaths(o,D,a,"move");const f=t.dirname(a);return t.parse(f).root!==f&&await n(f),async function(t,n,u,o){if(!o)if(u)await i(n);else if(await s(n))throw new Error("dest already exists.");try{await e.rename(t,n)}catch(e){if("EXDEV"!==e.code)throw e;await async function(e,t,n){const s={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return await r(e,t,s),i(e)}(t,n,u)}}(o,a,l,h)}}function requireMoveSync(){if(hasRequiredMoveSync)return moveSync_1;hasRequiredMoveSync=1;const e=requireGracefulFs(),t=path,r=requireCopy().copySync,i=requireRemove().removeSync,n=requireMkdirs().mkdirpSync,s=requireStat();function u(t,n,s){try{e.renameSync(t,n)}catch(e){if("EXDEV"!==e.code)throw e;return function(e,t,n){const s={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return r(e,t,s),i(e)}(t,n,s)}}return moveSync_1=function(r,o,a){const c=(a=a||{}).overwrite||a.clobber||!1,{srcStat:l,isChangingCase:D=!1}=s.checkPathsSync(r,o,"move",a);return s.checkParentPathsSync(r,l,o,"move"),function(e){const r=t.dirname(e);return t.parse(r).root===r}(o)||n(t.dirname(o)),function(t,r,n,s){if(s)return u(t,r,n);if(n)return i(r),u(t,r,n);if(e.existsSync(r))throw new Error("dest already exists.");return u(t,r,n)}(r,o,c,D)}}function requireMove(){if(hasRequiredMove)return move;hasRequiredMove=1;const e=requireUniversalify().fromPromise;return move={move:e(requireMove$1()),moveSync:requireMoveSync()}}function requireLib$1(){return hasRequiredLib$1?lib$1:(hasRequiredLib$1=1,lib$1={...requireFs(),...requireCopy(),...requireEmpty(),...requireEnsure(),...requireJson(),...requireMkdirs(),...requireMove(),...requireOutputFile(),...requirePathExists(),...requireRemove()})}var libExports$1=requireLib$1(),fsExtra=getDefaultExportFromCjs(libExports$1),copyFilesByTargetPath=function(e,t){if(fs$1.existsSync(e)){try{var r=path.dirname(t);fsExtra.ensureDirSync(r)}catch(e){}fsExtra.copySync(e,t,{overwrite:!0})}},downloadFullApps=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,r,i,n;return __generator(this,function(s){switch(s.label){case 0:return[4,getManifestJsonUrl(e.mode)];case 1:return t=s.sent(),r=t.filter(function(t){return t.appCode!==e.appCode}),[4,downloadManifestJson(r.map(function(e){return e.url}))];case 2:return i=s.sent(),(n=checkDownloadFilesIsExpired(i)).length?[4,downloadProjectFiles(n)]:[3,4];case 3:s.sent(),s.label=4;case 4:return[2,i]}})})},moveOtherApps=function(e){var t=e.base,r=e.manifestList,i=process.env.MFE_ROOT_OUTPUT_DIR;r.forEach(function(e){var r=e.appCode,n=checkIsRootManifest(e)?i:path.resolve(i,r),s=path.resolve(t,r);try{copyFilesByTargetPath(s,n)}catch(e){}})},createAppsAssetsPlugin=function(e){var t=[],r=!1;return{name:"@dd-code:apps-assets",enforce:"pre",options:function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(r){switch(r.label){case 0:return[4,downloadFullApps(e.value)];case 1:return t=r.sent(),e.setDependencies(t),[2]}})})},buildStart:function(){if(!r){var i=path.resolve(SAVE_CDN_FILE_PATH,e.value.mode||"dev");moveOtherApps({base:i,manifestList:t}),r=!0}}}},initPreContext=require("@dcloudio/uni-cli-shared/dist/preprocess").initPreContext,preprocess=require("@dcloudio/uni-cli-shared/lib/preprocess").preprocess,getPreVueContext=require("@dcloudio/uni-cli-shared/dist/preprocess/context").getPreVueContext,initPrePagesJson=function(){var e=path.resolve(process.cwd(),"src/pages.json");return fs$1.readFileSync(e,"utf-8")},getPagesJson=function(jsonFile,isFormat){void 0===isFormat&&(isFormat=!1);var platform=process.env.UNI_PLATFORM;initPreContext(platform);var context=getPreVueContext(),processedJsonStr=preprocess(jsonFile,context,{type:"js"}),pagesConfig=eval("(".concat(processedJsonStr,")"));return isFormat&&"mp-weixin"===platform?transformToWeixinFormat(pagesConfig):pagesConfig},transformToWeixinFormat=function(e){var t,r=__assign({pages:[],window:{},tabBar:null,subPackages:[],usingComponents:{}},e);if(e.globalStyle){var i=e.globalStyle;r.window={navigationBarBackgroundColor:i.navigationBarBackgroundColor||"#000000",navigationBarTextStyle:i.navigationBarTextStyle||"white",navigationBarTitleText:i.navigationBarTitleText||"",backgroundColor:i.backgroundColor||"#ffffff",backgroundTextStyle:i.backgroundTextStyle||"dark",enablePullDownRefresh:i.enablePullDownRefresh||!1,onReachBottomDistance:i.onReachBottomDistance||50},i.pageOrientation&&(r.window.pageOrientation=i.pageOrientation),i.renderingMode&&(r.window.renderingMode=i.renderingMode),i.usingComponents&&(r.usingComponents=i.usingComponents),i["mp-weixin"]&&Object.assign(r.window,i["mp-weixin"])}return e.pages&&(r.pages=e.pages.map(function(e){return e.path})),e.tabBar&&(r.tabBar=__assign(__assign({},e.tabBar),{list:null===(t=e.tabBar.list)||void 0===t?void 0:t.map(function(e){return{pagePath:e.pagePath,text:e.text,iconPath:e.iconPath,selectedIconPath:e.selectedIconPath}})})),e.subPackages&&(r.subPackages=e.subPackages.map(function(e){var t;return{root:e.root,pages:(null===(t=e.pages)||void 0===t?void 0:t.map(function(e){return e.path||e}))||[]}})),e.preloadRule&&(r.preloadRule=e.preloadRule),delete r.globalStyle,delete r.easycom,delete r.condition,delete r.leftWindow,delete r.topWindow,delete r.rightWindow,delete r.uniIdRouter,delete r.entryPagePath,r},createManifestPlugin=function(e){var t=new Set;return{name:"@dd-code:genre-mainfest-file-list",enforce:"post",renderStart:function(){var t=initPrePagesJson(),r=getPagesJson(t);e.setPagesJson(r)},writeBundle:function(e,r){Object.values(r).forEach(function(e){e&&e.fileName&&t.add(e.fileName)})},closeBundle:function(){var r=process.env.MFE_SOURCE_OUTPUT_DIR||"dist",i=walkDir(r,t);e.setFiles(r,i);var n=e.value.isRoot?process.env.MFE_ROOT_OUTPUT_DIR:path.resolve(process.env.MFE_ROOT_OUTPUT_DIR,e.value.appCode);e.saveFile(n)}}};const EntryTypes={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},defaultOptions={root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:EntryTypes.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(defaultOptions);const RECURSIVE_ERROR_CODE="READDIRP_RECURSIVE_ERROR",NORMAL_FLOW_ERRORS=new Set(["ENOENT","EPERM","EACCES","ELOOP",RECURSIVE_ERROR_CODE]),ALL_TYPES=[EntryTypes.DIR_TYPE,EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE,EntryTypes.FILE_TYPE],DIR_TYPES=new Set([EntryTypes.DIR_TYPE,EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE]),FILE_TYPES=new Set([EntryTypes.EVERYTHING_TYPE,EntryTypes.FILE_DIR_TYPE,EntryTypes.FILE_TYPE]),isNormalFlowError=e=>NORMAL_FLOW_ERRORS.has(e.code),wantBigintFsStats="win32"===process.platform,emptyFn=e=>!0,normalizeFilter=e=>{if(void 0===e)return emptyFn;if("function"==typeof e)return e;if("string"==typeof e){const t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){const t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return emptyFn};class ReaddirpStream extends Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});const t={...defaultOptions,...e},{root:r,type:i}=t;this._fileFilter=normalizeFilter(t.fileFilter),this._directoryFilter=normalizeFilter(t.directoryFilter);const n=t.lstat?lstat:stat$1;this._stat=wantBigintFsStats?e=>n(e,{bigint:!0}):n,this._maxDepth=null!=t.depth&&Number.isSafeInteger(t.depth)?t.depth:defaultOptions.depth,this._wantsDir=!!i&&DIR_TYPES.has(i),this._wantsFile=!!i&&FILE_TYPES.has(i),this._wantsEverything=i===EntryTypes.EVERYTHING_TYPE,this._root=resolve(r),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const t=this.parent,r=t&&t.files;if(r&&r.length>0){const{path:i,depth:n}=t,s=r.splice(0,e).map(e=>this._formatEntry(e,i)),u=await Promise.all(s);for(const t of u){if(!t)continue;if(this.destroyed)return;const r=await this._getEntryType(t);"directory"===r&&this._directoryFilter(t)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,n+1)),this._wantsDir&&(this.push(t),e--)):("file"===r||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{const e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let r;try{r=await readdir(e,this._rdOptions)}catch(e){this._onError(e)}return{files:r,depth:t,path:e}}async _formatEntry(e,t){let r;const i=this._isDirent?e.name:e;try{const n=resolve(join(t,i));r={path:relative(this._root,n),fullPath:n,basename:i},r[this._statsProp]=this._isDirent?e:await this._stat(n)}catch(e){return void this._onError(e)}return r}_onError(e){isNormalFlowError(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";const t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){const t=e.fullPath;try{const e=await realpath(t),r=await lstat(e);if(r.isFile())return"file";if(r.isDirectory()){const r=e.length;if(t.startsWith(e)&&t.substr(r,1)===sep){const r=new Error(`Circular symlink detected: "${t}" points to "${e}"`);return r.code=RECURSIVE_ERROR_CODE,this._onError(r)}return"directory"}}catch(e){return this._onError(e),""}}}_includeAsFile(e){const t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}function readdirp(e,t={}){let r=t.entryType||t.type;if("both"===r&&(r=EntryTypes.FILE_DIR_TYPE),r&&(t.type=r),!e)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");if("string"!=typeof e)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!ALL_TYPES.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);return t.root=e,new ReaddirpStream(t)}const STR_DATA="data",STR_END="end",STR_CLOSE="close",EMPTY_FN=()=>{},pl=process.platform,isWindows="win32"===pl,isMacos="darwin"===pl,isLinux="linux"===pl,isFreeBSD="freebsd"===pl,isIBMi="OS400"===type(),EVENTS={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},EV=EVENTS,THROTTLE_MODE_WATCH="watch",statMethods={lstat:lstat,stat:stat$1},KEY_LISTENERS="listeners",KEY_ERR="errHandlers",KEY_RAW="rawEmitters",HANDLER_KEYS=[KEY_LISTENERS,KEY_ERR,KEY_RAW],binaryExtensions=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),isBinaryPath=e=>binaryExtensions.has(sp.extname(e).slice(1).toLowerCase()),foreach=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},addAndConvert=(e,t,r)=>{let i=e[t];i instanceof Set||(e[t]=i=new Set([i])),i.add(r)},clearItem=e=>t=>{const r=e[t];r instanceof Set?r.clear():delete e[t]},delFromSet=(e,t,r)=>{const i=e[t];i instanceof Set?i.delete(r):i===r&&delete e[t]},isEmptySet=e=>e instanceof Set?0===e.size:!e,FsWatchInstances=new Map;function createFsWatchInstance(e,t,r,i,n){const s=(t,i)=>{r(e),n(t,i,{watchedPath:e}),i&&e!==i&&fsWatchBroadcast(sp.resolve(e,i),KEY_LISTENERS,sp.join(e,i))};try{return watch$1(e,{persistent:t.persistent},s)}catch(e){return void i(e)}}const fsWatchBroadcast=(e,t,r,i,n)=>{const s=FsWatchInstances.get(e);s&&foreach(s[t],e=>{e(r,i,n)})},setFsWatchListener=(e,t,r,i)=>{const{listener:n,errHandler:s,rawEmitter:u}=i;let o,a=FsWatchInstances.get(t);if(!r.persistent){if(o=createFsWatchInstance(e,r,n,s,u),!o)return;return o.close.bind(o)}if(a)addAndConvert(a,KEY_LISTENERS,n),addAndConvert(a,KEY_ERR,s),addAndConvert(a,KEY_RAW,u);else{if(o=createFsWatchInstance(e,r,fsWatchBroadcast.bind(null,t,KEY_LISTENERS),s,fsWatchBroadcast.bind(null,t,KEY_RAW)),!o)return;o.on(EV.ERROR,async r=>{const i=fsWatchBroadcast.bind(null,t,KEY_ERR);if(a&&(a.watcherUnusable=!0),isWindows&&"EPERM"===r.code)try{const t=await open(e,"r");await t.close(),i(r)}catch(e){}else i(r)}),a={listeners:n,errHandlers:s,rawEmitters:u,watcher:o},FsWatchInstances.set(t,a)}return()=>{delFromSet(a,KEY_LISTENERS,n),delFromSet(a,KEY_ERR,s),delFromSet(a,KEY_RAW,u),isEmptySet(a.listeners)&&(a.watcher.close(),FsWatchInstances.delete(t),HANDLER_KEYS.forEach(clearItem(a)),a.watcher=void 0,Object.freeze(a))}},FsWatchFileInstances=new Map,setFsWatchFileListener=(e,t,r,i)=>{const{listener:n,rawEmitter:s}=i;let u=FsWatchFileInstances.get(t);const o=u&&u.options;return o&&(o.persistent<r.persistent||o.interval>r.interval)&&(unwatchFile(t),u=void 0),u?(addAndConvert(u,KEY_LISTENERS,n),addAndConvert(u,KEY_RAW,s)):(u={listeners:n,rawEmitters:s,options:r,watcher:watchFile(t,r,(r,i)=>{foreach(u.rawEmitters,e=>{e(EV.CHANGE,t,{curr:r,prev:i})});const n=r.mtimeMs;(r.size!==i.size||n>i.mtimeMs||0===n)&&foreach(u.listeners,t=>t(e,r))})},FsWatchFileInstances.set(t,u)),()=>{delFromSet(u,KEY_LISTENERS,n),delFromSet(u,KEY_RAW,s),isEmptySet(u.listeners)&&(FsWatchFileInstances.delete(t),unwatchFile(t),u.options=u.watcher=void 0,Object.freeze(u))}};class NodeFsHandler{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const r=this.fsw.options,i=sp.dirname(e),n=sp.basename(e);this.fsw._getWatchedDir(i).add(n);const s=sp.resolve(e),u={persistent:r.persistent};let o;if(t||(t=EMPTY_FN),r.usePolling){const i=r.interval!==r.binaryInterval;u.interval=i&&isBinaryPath(n)?r.binaryInterval:r.interval,o=setFsWatchFileListener(e,s,u,{listener:t,rawEmitter:this.fsw._emitRaw})}else o=setFsWatchListener(e,s,u,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return o}_handleFile(e,t,r){if(this.fsw.closed)return;const i=sp.dirname(e),n=sp.basename(e),s=this.fsw._getWatchedDir(i);let u=t;if(s.has(n))return;const o=async(t,r)=>{if(this.fsw._throttle(THROTTLE_MODE_WATCH,e,5))if(r&&0!==r.mtimeMs){if(s.has(n)){const t=r.atimeMs,i=r.mtimeMs;(!t||t<=i||i!==u.mtimeMs)&&this.fsw._emit(EV.CHANGE,e,r),u=r}}else try{const r=await stat$1(e);if(this.fsw.closed)return;const i=r.atimeMs,n=r.mtimeMs;if((!i||i<=n||n!==u.mtimeMs)&&this.fsw._emit(EV.CHANGE,e,r),(isMacos||isLinux||isFreeBSD)&&u.ino!==r.ino){this.fsw._closeFile(t),u=r;const i=this._watchWithNodeFs(e,o);i&&this.fsw._addPathCloser(t,i)}else u=r}catch(e){this.fsw._remove(i,n)}},a=this._watchWithNodeFs(e,o);if((!r||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(EV.ADD,e,0))return;this.fsw._emit(EV.ADD,e,t)}return a}async _handleSymlink(e,t,r,i){if(this.fsw.closed)return;const n=e.fullPath,s=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){let t;this.fsw._incrReadyCount();try{t=await realpath(r)}catch(e){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return s.has(i)?this.fsw._symlinkPaths.get(n)!==t&&(this.fsw._symlinkPaths.set(n,t),this.fsw._emit(EV.CHANGE,r,e.stats)):(s.add(i),this.fsw._symlinkPaths.set(n,t),this.fsw._emit(EV.ADD,r,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(n))return!0;this.fsw._symlinkPaths.set(n,!0)}_handleRead(e,t,r,i,n,s,u){e=sp.join(e,"");const o=i?`${e}:${i}`:e;if(!(u=this.fsw._throttle("readdir",o,1e3)))return;const a=this.fsw._getWatchedDir(r.path),c=new Set;let l=this.fsw._readdirp(e,{fileFilter:e=>r.filterPath(e),directoryFilter:e=>r.filterDir(e)});return l?(l.on(STR_DATA,async u=>{if(this.fsw.closed)return void(l=void 0);const o=u.path;let D=sp.join(e,o);c.add(o),u.stats.isSymbolicLink()&&await this._handleSymlink(u,e,D,o)||(this.fsw.closed?l=void 0:o!==i&&(i||a.has(o))||(this.fsw._incrReadyCount(),D=sp.join(n,sp.relative(n,D)),this._addToNodeFs(D,t,r,s+1)))}).on(EV.ERROR,this._boundHandleError),new Promise((t,o)=>{if(!l)return o();l.once(STR_END,()=>{if(this.fsw.closed)return void(l=void 0);const o=!!u&&u.clear();t(void 0),a.getChildren().filter(t=>t!==e&&!c.has(t)).forEach(t=>{this.fsw._remove(e,t)}),l=void 0,o&&this._handleRead(e,!1,r,i,n,s,u)})})):void 0}async _handleDir(e,t,r,i,n,s,u){const o=this.fsw._getWatchedDir(sp.dirname(e)),a=o.has(sp.basename(e));let c,l;r&&this.fsw.options.ignoreInitial||n||a||this.fsw._emit(EV.ADD_DIR,e,t),o.add(sp.basename(e)),this.fsw._getWatchedDir(e);const D=this.fsw.options.depth;if((null==D||i<=D)&&!this.fsw._symlinkPaths.has(u)){if(!n&&(await this._handleRead(e,r,s,n,e,i,c),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,r)=>{r&&0===r.mtimeMs||this._handleRead(t,!1,s,n,e,i,c)})}return l}async _addToNodeFs(e,t,r,i,n){const s=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return s(),!1;const u=this.fsw._getWatchHelpers(e);r&&(u.filterPath=e=>r.filterPath(e),u.filterDir=e=>r.filterDir(e));try{const r=await statMethods[u.statMethod](u.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(u.watchPath,r))return s(),!1;const o=this.fsw.options.followSymlinks;let a;if(r.isDirectory()){const s=sp.resolve(e),c=o?await realpath(e):e;if(this.fsw.closed)return;if(a=await this._handleDir(u.watchPath,r,t,i,n,u,c),this.fsw.closed)return;s!==c&&void 0!==c&&this.fsw._symlinkPaths.set(s,c)}else if(r.isSymbolicLink()){const n=o?await realpath(e):e;if(this.fsw.closed)return;const s=sp.dirname(u.watchPath);if(this.fsw._getWatchedDir(s).add(u.watchPath),this.fsw._emit(EV.ADD,u.watchPath,r),a=await this._handleDir(s,r,t,i,e,u,n),this.fsw.closed)return;void 0!==n&&this.fsw._symlinkPaths.set(sp.resolve(e),n)}else a=this._handleFile(u.watchPath,r,t);return s(),a&&this.fsw._addPathCloser(e,a),!1}catch(t){if(this.fsw._handleError(t))return s(),e}}}
|
|
2
2
|
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */const SLASH="/",SLASH_SLASH="//",ONE_DOT=".",TWO_DOTS="..",STRING_TYPE="string",BACK_SLASH_RE=/\\/g,DOUBLE_SLASH_RE=/\/\//g,DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,REPLACER_RE=/^\.[/\\]/;function arrify(e){return Array.isArray(e)?e:[e]}const isMatcherObject=e=>"object"==typeof e&&null!==e&&!(e instanceof RegExp);function createPattern(e){return"function"==typeof e?e:"string"==typeof e?t=>e===t:e instanceof RegExp?t=>e.test(t):"object"==typeof e&&null!==e?t=>{if(e.path===t)return!0;if(e.recursive){const r=sp.relative(e.path,t);return!!r&&(!r.startsWith("..")&&!sp.isAbsolute(r))}return!1}:()=>!1}function normalizePath(e){if("string"!=typeof e)throw new Error("string expected");let t=!1;return(e=(e=sp.normalize(e)).replace(/\\/g,"/")).startsWith("//")&&(t=!0),e=e.replace(DOUBLE_SLASH_RE,"/"),t&&(e="/"+e),e}function matchPatterns(e,t,r){const i=normalizePath(t);for(let t=0;t<e.length;t++){if((0,e[t])(i,r))return!0}return!1}function anymatch(e,t){if(null==e)throw new TypeError("anymatch: specify first argument");const r=arrify(e).map(e=>createPattern(e));return(e,t)=>matchPatterns(r,e,t)}const unifyPaths=e=>{const t=arrify(e).flat();if(!t.every(e=>typeof e===STRING_TYPE))throw new TypeError(`Non-string provided as watch path: ${t}`);return t.map(normalizePathToUnix)},toUnix=e=>{let t=e.replace(BACK_SLASH_RE,SLASH),r=!1;return t.startsWith(SLASH_SLASH)&&(r=!0),t=t.replace(DOUBLE_SLASH_RE,SLASH),r&&(t=SLASH+t),t},normalizePathToUnix=e=>toUnix(sp.normalize(toUnix(e))),normalizeIgnored=(e="")=>t=>"string"==typeof t?normalizePathToUnix(sp.isAbsolute(t)?t:sp.join(e,t)):t,getAbsolutePath=(e,t)=>sp.isAbsolute(e)?e:sp.join(t,e),EMPTY_SET=Object.freeze(new Set);class DirEntry{path;_removeWatcher;items;constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){const{items:t}=this;t&&e!==ONE_DOT&&e!==TWO_DOTS&&t.add(e)}async remove(e){const{items:t}=this;if(!t)return;if(t.delete(e),t.size>0)return;const r=this.path;try{await readdir(r)}catch(e){this._removeWatcher&&this._removeWatcher(sp.dirname(r),sp.basename(r))}}has(e){const{items:t}=this;if(t)return t.has(e)}getChildren(){const{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=EMPTY_FN,this.items=EMPTY_SET,Object.freeze(this)}}const STAT_METHOD_F="stat",STAT_METHOD_L="lstat";class WatchHelper{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,t,r){this.fsw=r;const i=e;this.path=e=e.replace(REPLACER_RE,""),this.watchPath=i,this.fullWatchPath=sp.resolve(i),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?STAT_METHOD_F:STAT_METHOD_L}entryPath(e){return sp.join(this.watchPath,sp.relative(this.watchPath,e.fullPath))}filterPath(e){const{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);const r=this.entryPath(e);return this.fsw._isntIgnored(r,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class FSWatcher extends EventEmitter{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;const t=e.awaitWriteFinish,r={stabilityThreshold:2e3,pollInterval:100},i={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?arrify(e.ignored):arrify([]),awaitWriteFinish:!0===t?r:"object"==typeof t&&{...r,...t}};isIBMi&&(i.usePolling=!0),void 0===i.atomic&&(i.atomic=!i.usePolling);const n=process.env.CHOKIDAR_USEPOLLING;if(void 0!==n){const e=n.toLowerCase();i.usePolling="false"!==e&&"0"!==e&&("true"===e||"1"===e||!!e)}const s=process.env.CHOKIDAR_INTERVAL;s&&(i.interval=Number.parseInt(s,10));let u=0;this._emitReady=()=>{u++,u>=this._readyCount&&(this._emitReady=EMPTY_FN,this._readyEmitted=!0,process.nextTick(()=>this.emit(EVENTS.READY)))},this._emitRaw=(...e)=>this.emit(EVENTS.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=i,this._nodeFsHandler=new NodeFsHandler(this),Object.freeze(i)}_addIgnoredPath(e){if(isMatcherObject(e))for(const t of this._ignoredPaths)if(isMatcherObject(t)&&t.path===e.path&&t.recursive===e.recursive)return;this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),"string"==typeof e)for(const t of this._ignoredPaths)isMatcherObject(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,r){const{cwd:i}=this.options;this.closed=!1,this._closePromise=void 0;let n=unifyPaths(e);return i&&(n=n.map(e=>getAbsolutePath(e,i))),n.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=n.length,Promise.all(n.map(async e=>{const i=await this._nodeFsHandler._addToNodeFs(e,!r,void 0,0,t);return i&&this._emitReady(),i})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(sp.dirname(e),sp.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;const t=unifyPaths(e),{cwd:r}=this.options;return t.forEach(e=>{sp.isAbsolute(e)||this._closers.has(e)||(r&&(e=sp.join(r,e)),e=sp.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach(t=>t.forEach(t=>{const r=t();r instanceof Promise&&e.push(r)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach((t,r)=>{const i=this.options.cwd?sp.relative(this.options.cwd,r):r;e[i||ONE_DOT]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==EVENTS.ERROR&&this.emit(EVENTS.ALL,e,...t)}async _emit(e,t,r){if(this.closed)return;const i=this.options;isWindows&&(t=sp.normalize(t)),i.cwd&&(t=sp.relative(i.cwd,t));const n=[t];null!=r&&n.push(r);const s=i.awaitWriteFinish;let u;if(s&&(u=this._pendingWrites.get(t)))return u.lastChange=new Date,this;if(i.atomic){if(e===EVENTS.UNLINK)return this._pendingUnlinks.set(t,[e,...n]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(EVENTS.ALL,...e),this._pendingUnlinks.delete(t)})},"number"==typeof i.atomic?i.atomic:100),this;e===EVENTS.ADD&&this._pendingUnlinks.has(t)&&(e=EVENTS.CHANGE,this._pendingUnlinks.delete(t))}if(s&&(e===EVENTS.ADD||e===EVENTS.CHANGE)&&this._readyEmitted){const r=(t,r)=>{t?(e=EVENTS.ERROR,n[0]=t,this.emitWithAll(e,n)):r&&(n.length>1?n[1]=r:n.push(r),this.emitWithAll(e,n))};return this._awaitWriteFinish(t,s.stabilityThreshold,e,r),this}if(e===EVENTS.CHANGE){if(!this._throttle(EVENTS.CHANGE,t,50))return this}if(i.alwaysStat&&void 0===r&&(e===EVENTS.ADD||e===EVENTS.ADD_DIR||e===EVENTS.CHANGE)){const e=i.cwd?sp.join(i.cwd,t):t;let r;try{r=await stat$1(e)}catch(e){}if(!r||this.closed)return;n.push(r)}return this.emitWithAll(e,n),this}_handleError(e){const t=e&&e.code;return e&&"ENOENT"!==t&&"ENOTDIR"!==t&&(!this.options.ignorePermissionErrors||"EPERM"!==t&&"EACCES"!==t)&&this.emit(EVENTS.ERROR,e),e||this.closed}_throttle(e,t,r){this._throttled.has(e)||this._throttled.set(e,new Map);const i=this._throttled.get(e);if(!i)throw new Error("invalid throttle");const n=i.get(t);if(n)return n.count++,!1;let s;const u=()=>{const e=i.get(t),r=e?e.count:0;return i.delete(t),clearTimeout(s),e&&clearTimeout(e.timeoutObject),r};s=setTimeout(u,r);const o={timeoutObject:s,clear:u,count:0};return i.set(t,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,r,i){const n=this.options.awaitWriteFinish;if("object"!=typeof n)return;const s=n.pollInterval;let u,o=e;this.options.cwd&&!sp.isAbsolute(e)&&(o=sp.join(this.options.cwd,e));const a=new Date,c=this._pendingWrites;c.has(e)||(c.set(e,{lastChange:a,cancelWait:()=>(c.delete(e),clearTimeout(u),r)}),u=setTimeout(function r(n){stat$2(o,(o,a)=>{if(o||!c.has(e))return void(o&&"ENOENT"!==o.code&&i(o));const l=Number(new Date);n&&a.size!==n.size&&(c.get(e).lastChange=l),l-c.get(e).lastChange>=t?(c.delete(e),i(void 0,a)):u=setTimeout(r,s,a)})},s))}_isIgnored(e,t){if(this.options.atomic&&DOT_RE.test(e))return!0;if(!this._userIgnored){const{cwd:e}=this.options,t=(this.options.ignored||[]).map(normalizeIgnored(e)),r=[...[...this._ignoredPaths].map(normalizeIgnored(e)),...t];this._userIgnored=anymatch(r)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new WatchHelper(e,this.options.followSymlinks,this)}_getWatchedDir(e){const t=sp.resolve(e);return this._watched.has(t)||this._watched.set(t,new DirEntry(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return!!this.options.ignorePermissionErrors||Boolean(256&Number(e.mode))}_remove(e,t,r){const i=sp.join(e,t),n=sp.resolve(i);if(r=null!=r?r:this._watched.has(i)||this._watched.has(n),!this._throttle("remove",i,100))return;r||1!==this._watched.size||this.add(e,t,!0);this._getWatchedDir(i).getChildren().forEach(e=>this._remove(i,e));const s=this._getWatchedDir(e),u=s.has(t);s.remove(t),this._symlinkPaths.has(n)&&this._symlinkPaths.delete(n);let o=i;if(this.options.cwd&&(o=sp.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(o)){if(this._pendingWrites.get(o).cancelWait()===EVENTS.ADD)return}this._watched.delete(i),this._watched.delete(n);const a=r?EVENTS.UNLINK_DIR:EVENTS.UNLINK;u&&!this._isIgnored(i)&&this._emit(a,i),this._closePath(i)}_closePath(e){this._closeFile(e);const t=sp.dirname(e);this._getWatchedDir(t).remove(sp.basename(e))}_closeFile(e){const t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(t)}_readdirp(e,t){if(this.closed)return;let r=readdirp(e,{type:EVENTS.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(r),r.once(STR_CLOSE,()=>{r=void 0}),r.once(STR_END,()=>{r&&(this._streams.delete(r),r=void 0)}),r}}function watch(e,t={}){const r=new FSWatcher(t);return r.add(e),r}var chokidar={watch:watch,FSWatcher:FSWatcher},lib={exports:{}},objectAssign,hasRequiredObjectAssign;function requireObjectAssign(){if(hasRequiredObjectAssign)return objectAssign;hasRequiredObjectAssign=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return objectAssign=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(i,n){for(var s,u,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(i),a=1;a<arguments.length;a++){for(var c in s=Object(arguments[a]))t.call(s,c)&&(o[c]=s[c]);if(e){u=e(s);for(var l=0;l<u.length;l++)r.call(s,u[l])&&(o[u[l]]=s[u[l]])}}return o},objectAssign}var vary={exports:{}},hasRequiredVary,hasRequiredLib;
|
|
3
3
|
/*!
|
|
4
4
|
* vary
|