@flatjs/evolve 1.4.1 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/index.js +2 -2
- package/index.d.ts +20 -0
- package/package.json +6 -6
package/cjs/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
/*! @flatjs/forge MIT https://github.com/flatjs */
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("@flatjs/common");var t=require("lodash");var r=require("@
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("@flatjs/common");var t=require("lodash");var r=require("@flatjs/mock");var n=require("babel-merge");var o=require("path");var s=require("@flatjs/forge-plugin-postcss-pixel");var a=require("cssnano");var i=require("webpack");var l=require("terser-webpack-plugin");var c=require("mini-css-extract-plugin");var u=require("@pmmmwh/react-refresh-webpack-plugin");var p=require("case-sensitive-paths-webpack-plugin");var d=require("webpack-bundle-analyzer");var f=require("webpack-sources");var v=require("webpack/lib/util/extractUrlAndGlobal");var h=require("html-webpack-plugin");var m=require("os");var g=require("webpack-dev-server");var b=require("express");var y=require("https");var w=require("fs");var j=require("better-opn");function k(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var C=k(n);var x=k(a);var O=k(i);var M=k(l);var P=k(c);var S=k(u);var A=k(p);var E=k(v);var R=k(h);var B=k(m);var $=k(g);var q=k(b);var T=k(y);var F=k(j);function _(e){let t;const r=process.env.NODE_ENV==="FLATJS_CORE";switch(e){case"@flatjs/evolve-preset-babel":t=require.resolve(r?"../../../evolve-preset-babel/src/index":e);break}return t}const D=(e,t=false)=>{if(!t){return require(e)}else{return r.loadModule(e)}};const I=(t={usePreset:"react"},r=[])=>{const{usePreset:n,...o}=t;const s=r.map((e=>[require.resolve("babel-plugin-import"),{transformToDefaultImport:false,libraryDirectory:"cjs",style:()=>false,...e},e.libraryName]));const{reactBabelPreset:a,infernoBabelPreset:i,vueBabelPreset:l}=D(_("@flatjs/evolve-preset-babel"));const c=n==="react"?a():n==="vue"?l():i();let u={};try{u=C["default"](c,o);if(u.plugins){u.plugins.unshift(...s)}else{u.plugins=s}}catch(t){e.printError(t)}return Object.assign({babelrc:false},u)};const N=[`https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group`];const W={reactDev:[`https://unpkg.com/react@17.0.2/umd/react.development.js`,`https://unpkg.com/history@5.3.0/umd/history.development.js`,`https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js`,`https://unpkg.com/react-router@6.2.1/umd/react-router.development.js`,`https://unpkg.com/react-router-dom@6.2.1/umd/react-router-dom.development.js`],reactProd:[`https://unpkg.com/react@17.0.2/umd/react.production.min.js`,`https://unpkg.com/history@5.3.0/umd/history.production.min.js`,`https://unpkg.com/react-dom@17.0.2/umd/react-dom.production.min.js`,`https://unpkg.com/react-router@6.2.1/umd/react-router.production.min.js`,`https://unpkg.com/react-router-dom@6.2.1/umd/react-router-dom.production.min.js`]};const L={reactDev:[`https://cdn.jsdelivr.net/npm/react@17.0.2/umd/react.development.js`,`https://cdn.jsdelivr.net/npm/history@5.3.0/umd/history.development.js`,`https://cdn.jsdelivr.net/npm/react-dom@17.0.2/umd/react-dom.development.js`,`https://cdn.jsdelivr.net/npm/react-router@6.2.1/umd/react-router.development.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.2.1/umd/react-router-dom.development.js`],reactProd:[`https://cdn.jsdelivr.net/npm/react@17.0.2/umd/react.production.min.js`,`https://cdn.jsdelivr.net/npm/history@5.3.0/umd/history.production.min.js`,`https://cdn.jsdelivr.net/npm/react-dom@17.0.2/umd/react-dom.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router@6.2.1/umd/react-router.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.2.1/umd/react-router-dom.production.min.js`]};const z={reactDev:[`https://cdn.bootcdn.net/ajax/libs/react/17.0.2/umd/react.development.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.3.0/history.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.2/umd/react-dom.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.2.1/react-router.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.2.1/react-router-dom.development.js`],reactProd:[`https://cdn.bootcdn.net/ajax/libs/react/17.0.2/umd/react.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.3.0/history.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.2/umd/react-dom.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.2.1/react-router.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.2.1/react-router-dom.production.min.js`]};const U={flatjsEvolve:{projectCwd:process.cwd(),projectVirtualPath:"flatjs/evolve",forBuild:{rejectWarnings:false},forServe:{pageMiddlewares:[],defaultServeGlobalData:()=>({})},target:["web","es5"],liveReload:false,minimizeTerserOptions:{},multiHtmlCdn:{},watchOptions:{poll:1e3,ignored:/node_modules/,aggregateTimeout:500},extraPlugins:()=>[],pluginLoaderOptions:{babelOptions:()=>({usePreset:"react"}),lessOptions:{},pixelOptions:{enabled:true,rootValue:{px:100,rpx:1},outputUnit:"rem"},enableBundleHashName:true,modularImports:[]}}};const G=(e,r={},n)=>{var o,s,a;const i=n[1];const l={vue:"Vue",react:"React","react-dom":"ReactDOM","react-router":"ReactRouter","react-router-dom":"ReactRouterDOM"};const c=t.isFunction(r)?r(e):r;const u=t.isFunction((o=i.options)==null?void 0:o.externals)?(s=i.options)==null?void 0:s.externals(e):(a=i.options)==null?void 0:a.externals;return Object.assign({},l,c,u||{})};const H=`(function(d){var j;var b=1;var i=1;var h=750;var c=100;function e(s,o){var q=d.document;var l=q.documentElement;var k=navigator.userAgent;var m=k.toLowerCase().indexOf("android")>-1;i=d.devicePixelRatio||1;if(i>3){i=3}if(m){i=1}console.log("current devicePixelRatio:",i);l.setAttribute("data-dpr",i.toString());var p=q.querySelector('meta[name="viewport"]');if(!p){b=1/i;p=q.createElement("meta");p.setAttribute("name","viewport");q.head.appendChild(p);p.setAttribute(["content","width=device-width,user-scalable=no,initial-scale=",b,",maximum-scale=",b,",minimum-scale=",b].join(""))}function n(){var t=document.documentElement.clientWidth;j=t/o*(s/i)*i;q.documentElement.style.fontSize=String(j)+"px"}var r;d.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(n,300)},false);d.addEventListener("onload",n,false);n()}e(c,h);window.fabricViewport={currRem:j,currDpr:i,currScale:b,dpiPX2px:function f(k){return parseFloat(k.toString())/j*100+"px"},px2DPIpx:function a(k){return parseFloat(k.toString())/100*j+"px"},px2rem:function g(k){return parseFloat(k.toString())/100+"rem"}}})(window);`;const V={title:"",favicon:"",inlineScripts:()=>[],headBeforeStyles:()=>[],headBeforeScripts:e=>[...N,...e==="development"?z.reactDev:z.reactProd],bodyAfterScripts:()=>[],viewport:H,excludeCdnEnvs:["me","dev","ntv"],minify:true,template:o.join(e.getPackageDirSync(__dirname,""),"templates/html-plugin/index-{0}.html")};const J=(e,r,n)=>{let o;if(n){o=typeof n==="function"?n(r):n}if(t.isUndefined(o)){const t=V[e];return typeof t==="function"?t(r):t}return o};const Y=(e,t)=>Object.assign({sourceMap:e,javascriptEnabled:true},t);const K=(e,t={})=>{const r=[x["default"]({preset:["default",{discardComments:{removeAll:!e},reduceInitial:false,normalizeWhitespace:!e}]})];if(t.enabled!==false){r.push(s.forgePluginPostcssPixel(t))}return{plugins:r}};const X=(e,t={})=>{const r={hints:e?false:"warning"};return Object.assign(r,t)};const Q=(e={})=>({parallel:true,
|
3
3
|
// Disable Extract all or some (use /^\**!|@preserve|@license|@cc_on/i RegExp) comments.
|
4
|
-
extractComments:false,terserOptions:t.merge({ecma:undefined,parse:{},compress:{},mangle:true,module:false,output:null,toplevel:false,nameCache:null,ie8:false,keep_classnames:undefined,keep_fnames:false,safari10:false},e)});const Z=(r=process.cwd(),n)=>{const o=e.loadFlatjsConfig(r,"flatjsEvolve","flatjs.evolve.js");return t.merge({},U.flatjsEvolve,o.flatjsEvolve,n,{projectCwd:r})};const ee=e=>{try{F["default"](e)}catch(e){console.warn(`Unable to open browser. If you are running in a headless environment\n`)}};function te(e="",t=""){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}function re(e){const t=new RegExp("[?&]env(=([^&#]*)|&|#|$)");const r=t.exec(window.location.href);const n=r&&r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"prod";const o=e[n]||e["prod"]||[];const s=o[Math.floor(Math.random()*o.length)];return s.replace(/\/$/,"")+"/"}function ne(e={},t="prod"){const r=e[t]||e["prod"]||[];return r[Math.floor(Math.random()*r.length)]}function oe(e){return`window.evolveFetchMicroWidgets = function () {\n var cdnConfig = ${JSON.stringify(e)};\n var cdnFinder = ${re.toString()};\n return (cdnFinder(cdnConfig) || '').replace(/\\/$/, '');\n }`}function se(e,r){const n=[];for(const[t,r]of Object.entries(e)){n.push({[t]:r.entry})}return n.map((e=>t.merge({},r,{name:Object.keys(e)[0],entry:e})))}const ae=(e,r)=>{var n,o;const s=t.merge({},r.pluginLoaderOptions);if((n=e.options)!=null&&n.allowPx2rem){t.set(s,"pixelOptions.enabled",e.options.allowPx2rem)}if((o=e.options)!=null&&o.enableBundleHashName){t.set(s,"enableBundleHashName",e.options.enableBundleHashName)}const a={...r,pluginLoaderOptions:s};return a};const ie=(e,t)=>{var r,n,o;const s=(r=e.pluginLoaderOptions)==null?void 0:(n=r.pixelOptions)==null?void 0:n.enabled;const a=(o=t==null?void 0:t.allowPx2rem)!=null?o:s;return!!a};const le=e=>{if(Object.keys(e).length>1){throw new Error(`Only single one entry map support now while "serve", "build" process!`)}let t=undefined;for(const[r,n]of Object.entries(e)){t=[r,n];break}if(!t){throw new Error(`No entry map found while "serve", "build" process!`)}return t};const ce=()=>Date.now().toString();const ue=(e,t,r=true)=>{const n=e==="js"?".js":".css";if(t){return`bundle${n}`}if(r){return`bundle[contenthash]${n}`}return`bundle${n}?${ce()}`};const pe=/icons\//;const de=/\.(jpe?g|png|gif|svg)$/;const fe=/\.(ttf|eot|woff|woff2)(\?.+)?$/;const ve=({projectCwd:e,projectVirtualPath:t},r,[n,o])=>{let a=s.dirname(s.join(t,r.replace(/^src/,"")));const i=o.entry.map((t=>s.dirname(s.join(e,t))));const l=s.resolve(e,r);const c=i.find((e=>l.startsWith(e)));if(c){a=s.dirname(s.join(n,s.relative(c,l)))}return`${a}/[name]-[contenthash:8][ext]`};const he=(e,t)=>{const r={test(e){return fe.test(e)||de.test(e)&&!pe.test(e)},type:"asset",generator:{filename({filename:r}){return ve(e,r,t)}},parser:{dataUrlCondition:{maxSize:4*1024}}};return r};const me=()=>{const e={test(e){return pe.test(e)&&e.endsWith(".svg")},use:[{loader:require.resolve("./loader-icon"),options:{svgo:{plugins:[{name:"removeTitle"},{name:"removeDimensions"}]}}}]};return e};const ge=(e,r={},n=[])=>{const o=t.isFunction(r)?r(e):r;const s=t.isFunction(n)?n(e):n;const a=I(o,s);const i={test:/\.(tsx|ts|js|jsx)$/,use:[{loader:"babel-loader",options:a}]};return i};const be=(e,t={})=>{const r={test:/\.css$/i,use:[{loader:S["default"].loader,options:{esModule:true}},{loader:"css-loader",options:{sourceMap:e}}]};if(Array.isArray(r.use)){r.use.push({loader:"postcss-loader",options:{postcssOptions:K(e,t),sourceMap:e}})}return r};const ye=(e,t={},r={})=>{const n=be(e,r);n.test=/\.less$/i;if(Array.isArray(n.use)){n.use.push({loader:"less-loader",options:{sourceMap:e,lessOptions:Y(e,t)}})}return n};const we=(e,t,r,n={})=>{const o=[me(),he(t,r),be(e,n.pixelOptions),ye(e,n.lessOptions,n.pixelOptions),ge(e,n.babelOptions,n.modularImports)];return o};class je{constructor(e={}){this.verbose=void 0;this.cleanStaleWebpackAssets=void 0;this.protectWebpackAssets=void 0;this.cleanAfterEveryBuildPatterns=void 0;this.cleanOnceBeforeBuildPatterns=void 0;this.currentAssets=void 0;this.initialClean=void 0;this.outputPath=void 0;this.verbose=e.verbose===true||false;this.cleanStaleWebpackAssets=e.cleanStaleWebpackAssets===true||e.cleanStaleWebpackAssets===false?e.cleanStaleWebpackAssets:true;this.protectWebpackAssets=e.protectWebpackAssets===true||e.protectWebpackAssets===false?e.protectWebpackAssets:true;this.cleanAfterEveryBuildPatterns=Array.isArray(e.cleanAfterEveryBuildPatterns)?e.cleanAfterEveryBuildPatterns:[];this.cleanOnceBeforeBuildPatterns=Array.isArray(e.cleanOnceBeforeBuildPatterns)?e.cleanOnceBeforeBuildPatterns:["**/*"];this.currentAssets=[];this.initialClean=false;this.outputPath="";this.apply=this.apply.bind(this);this.handleInitial=this.handleInitial.bind(this);this.handleDone=this.handleDone.bind(this);this.removeFiles=this.removeFiles.bind(this)}apply(e){if(!e.options.output||!e.options.output.path){console.warn("clean-webpack-plugin: options.output.path not defined. Plugin disabled...");return}this.outputPath=e.options.output.path;const t=e.hooks;if(this.cleanOnceBeforeBuildPatterns.length!==0){t.emit.tap("clean-webpack-plugin",(e=>{this.handleInitial(e)}))}t.done.tap("clean-webpack-plugin",(e=>{this.handleDone(e)}))}handleInitial(e){if(this.initialClean){return}const t=e.getStats();if(t.hasErrors()){return}this.initialClean=true;this.removeFiles(this.cleanOnceBeforeBuildPatterns)}handleDone(e){if(e.hasErrors()){if(this.verbose){console.warn("clean-webpack-plugin: pausing due to webpack errors")}return}const t=e.toJson({assets:true}).assets||[];const r=t.map((e=>e.name));const n=this.currentAssets.filter((e=>{const t=r.includes(e)===false;return t}));this.currentAssets=r.sort();const o=[];if(this.cleanStaleWebpackAssets===true&&n.length!==0){o.push(...n)}if(this.cleanAfterEveryBuildPatterns.length!==0){o.push(...this.cleanAfterEveryBuildPatterns)}if(o.length!==0){this.removeFiles(o)}}removeFiles(t){try{const r=e.delFilesSync(t,{cwd:this.outputPath,dot:true,ignore:this.protectWebpackAssets?this.currentAssets:[]});if(this.verbose){r.forEach((e=>{const t=s.relative(process.cwd(),e);const r="removed";console.warn(`clean-webpack-plugin: ${r} ${t}`)}))}}catch(e){const t=/Cannot delete files\/folders outside the current working directory\./.test(e.message);if(t){const e="clean-webpack-plugin: Cannot delete files/folders outside the current working directory. Can be overridden with the `dangerouslyAllowCleanPatternsOutsideProject` option.";throw new Error(e)}throw e}}}const ke=t=>new je({verbose:true,cleanOnceBeforeBuildPatterns:[`${s.join(e.ensureSlash(t[0],true),"**/*")}`]});const Ce=(e,t)=>new S["default"]({filename:`[name]/${ue("css",e,t==null?void 0:t.enableBundleHashName)}`,chunkFilename:"[id].[contenthash].css"});const xe="ExternalTemplateRemotesPlugin";const Oe=e=>e.constructor.name==="ExternalModule";class Me{apply(e){e.hooks.make.tap(xe,(e=>{const t=[];e.hooks.buildModule.tap(xe,(e=>{if(Oe(e)&&e.externalType==="script"){t.push(e)}}));e.hooks.afterCodeGeneration.tap(xe,(()=>{t.map((t=>{const r=E["default"](t.request)[0];const n=Pe(r);const o=e.codeGenerationResults.get(t,undefined).sources;const s=o.get("javascript");if(s){const e=new f.RawSource(s.source().toString().replace(`"${r}"`,n));o.set("javascript",e)}}))}))}))}}function Pe(e){const t=[];const r=[];let n=false;let o=false;for(const s of e){if(s==="["){if(n){o=true;break}n=true;if(r.length){t.push(`"${r.join("")}"`);r.length=0}}else if(s==="]"){if(!n){o=true;break}n=false;if(r.length){t.push(`${r.join("")}`);r.length=0}r.length=0}else{r.push(s)}}if(n||o){throw new Error(`Invalid template URL "${e}"`)}if(r.length){t.push(`"${r.join("")}"`)}return t.join(" + ")}const Se=`HtmlInjectScriptPlugin`;class Ae{constructor(e){this.scripts=void 0;this.scripts=e||[]}processScripts(){return this.scripts.filter(Boolean).map((e=>({tagName:"script",innerHTML:e,voidTag:false,attributes:{},meta:{plugin:"html-inject-script-webpack-plugin"}})))}apply(e){e.hooks.compilation.tap(`${Se}_compilation`,(e=>{const t=R["default"].getHooks(e);t.alterAssetTags.tap(`${Se}_alterAssetTags`,(e=>{e.assetTags.scripts.unshift(...this.processScripts());return e}))}))}}const Ee=(e="")=>e.replace(/[\/-]/gi,"_").toLowerCase();const Re=e=>s.join(e,`micro-remote-module.js`);const Be=(t,[r,n],o)=>{var s;const a=(s=n.options)==null?void 0:s.moduleFederation;const i=[];if(a){const{remotes:n,...s}=a;const c=Re(r);const u=Ee(r);const p=(n||[]).map((({name:t,endpoint:r})=>{const n=Ee(t);const o=Re(t);const s=r?e.ensureSlash(r(t),false):`[window.evolveFetchMicroWidgets()]`;return{[n]:`${n}@${s}/${o}`}}));i.push(new l.container.ModuleFederationPlugin({name:u,filename:c,remotes:p,...s}),new Me);if(!t){i.unshift(new Ae([oe(o)]))}}return i};const $e={minifyJS:true,removeComments:true,collapseWhitespace:true,collapseBooleanAttributes:false};const qe=(e,t,[r,n],o)=>{const s=[];const{options:a}=n;const i=e?"development":"production";for(const e of o){s.push(new R["default"]({inject:"body",title:J("title",i,a==null?void 0:a.title),chunks:[r],minify:(a==null?void 0:a.minify)===false?false:["me","dev"].includes(e)?false:$e,filename:`${r}/index${e==="prod"?"":`-${e}`}.html`,template:J("template",i,a==null?void 0:a.template).replace(`{0}`,e),templateParameters:{title:J("title",i,a==null?void 0:a.title),favicon:J("favicon",i,a==null?void 0:a.favicon),inlineScripts:J("inlineScripts",i,a==null?void 0:a.inlineScripts),headBeforeStyles:J("headBeforeStyles",i,a==null?void 0:a.headBeforeStyles),headBeforeScripts:J("headBeforeScripts",i,a==null?void 0:a.headBeforeScripts),bodyAfterScripts:J("bodyAfterScripts",i,a==null?void 0:a.bodyAfterScripts),viewport:ie(t,a)?J("viewport",i,a==null?void 0:a.viewport):""},multiCdn:{env:e,disabled:((a==null?void 0:a.excludeCdnEnvs)||["me","dev","ntv"]).includes(e)}}))}return s};class Te{constructor(e){var t;this.config=e;this.pluginName="FlatEvolveMultiCdnPlugin";this.requireFn=l.RuntimeGlobals.publicPath;if(!((t=this.config)!=null&&t.prod)){throw new Error("We must setup `prod` for each CDN config node!")}}apply(e){e.hooks.thisCompilation.tap(this.pluginName,(e=>{e.mainTemplate.hooks.requireExtensions.tap(this.pluginName,((t,r)=>{var n;const o=[];o.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const s=(n=e.chunkGraph)==null?void 0:n.getTreeRuntimeRequirements(r);if(s&&s.has(l.RuntimeGlobals.requireScope)){o.push("(function () {");o.push(l.Template.indent(`var flatjsMultiCdn = {`));o.push(l.Template.indent(l.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`])));o.push(l.Template.indent(l.Template.indent([`cdnFinder: ${re.toString()}`])));o.push(l.Template.indent(`};`));o.push(l.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig) || ${this.requireFn};`));o.push("})();")}return l.Template.asString(o)}))}));e.hooks.compilation.tap(this.pluginName,(e=>{R["default"].getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t}=e;const{userOptions:r}=e.plugin;const n=r.multiCdn;const o=t.publicPath;const a=t.js.map((e=>{if(n.disabled){return s.basename(e)}const t=ne(this.config,n.env);return te(t,e.replace(o,""))}));const i=t.css.map((e=>{if(n.disabled){return s.basename(e)}const t=ne(this.config,n.env);return te(t,e.replace(o,""))}));e.assets.js=a;e.assets.css=i;return e}))}))}}const Fe=(e,t,r)=>{const n=[new A["default"]];if(r.analyzer){n.push(new d.BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...r.analyzer}))}n.push(Ce(e,r.pluginLoaderOptions));n.push(...Be(e,t,r.multiHtmlCdn));if(!e){n.push(ke(t));const o=Object.keys(r.multiHtmlCdn);n.push(...qe(e,r,t,o));n.push(new Te(r.multiHtmlCdn))}return n};const _e=(r,n,o,a)=>{process.env.NODE_ENV=r;n=e.ensureSlash(n,true);const i=r==="development";const l=a.projectCwd;const c=a.pluginLoaderOptions;const u=a.watchOptions;const p=le(o);const d=t.isFunction(a.extraLoaders)?a.extraLoaders(i):a.extraLoaders;const f=[...we(i,a,p,c),...d||[]];const v=t.isFunction(a.extraPlugins)?a.extraPlugins(i):a.extraPlugins;const h=[...Fe(i,p,a),...v||[]];const m={mode:r,target:a.target,stats:{preset:"minimal"},infrastructureLogging:{level:"warn"},devtool:i?"eval-source-map":false,plugins:h,watchOptions:u,context:l,cache:{type:"memory"},resolve:{mainFields:["browser","module","main"],extensions:[".ts",".tsx",".js",".json",".vue"],alias:a.resolveAlias||{}},module:{rules:f},externals:G(i,a.externals,p),performance:X(i,a.performance),output:{devtoolModuleFilenameTemplate:({namespace:e,resourcePath:t})=>`webpack:///${s.join(e,t)}`,environment:{},pathinfo:false,path:s.join(l,"public"),publicPath:n,filename:`[name]/${ue("js",i,c==null?void 0:c.enableBundleHashName)}`,chunkFilename:`[id].[contenthash].js`},optimization:{nodeEnv:i?"development":"production",chunkIds:i?"named":"named",moduleIds:i?"named":"named",minimize:a.minimize===false?false:i?false:true,minimizer:[new P["default"](Q(a.minimizeTerserOptions))],splitChunks:{name:false,chunks:"all",minSize:25e5,cacheGroups:{default:false,defaultVendors:false}}}};return m};const De=(e,t,r)=>{const n=_e("production",t,e,r);const o=se(e,n);if(o.length>1){throw new Error("startSingleEntryBuild() only support `compiler` at a time")}const s=o[0];return new Promise(((e,t)=>{M["default"](s,((n,o)=>{var a,i;if(n){return t(n)}const l=o==null?void 0:o.toJson();if(l!=null&&(a=l.errors)!=null&&a.length){return t(l.errors)}if(r.forBuild.rejectWarnings&&l!=null&&(i=l.warnings)!=null&&i.length){return t(l.warnings)}e({name:s.name,warningStats:l==null?void 0:l.warnings})}))}))};const Ie=async(t,r)=>{var n;await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:r.needVerifyPackages||{}});const o=((n=r.multiHtmlCdn)==null?void 0:n.prod)||[];const s=[];const a=e.ensureSlash(o[Math.floor(Math.random()*o.length)],true);for(const[e,n]of Object.entries(t)){const t=ae(n,r);const o={[e]:n};s.push(De(o,a,t))}return Promise.all(s)};var Ne={exports:{}};var We=/[|\\{}()[\]^$+*?.]/g;var ze=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(We,"\\$&")};var Le={exports:{}};var Ue={exports:{}};var Ge={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var He=Ge;var Ve={};for(var Je in He){if(He.hasOwnProperty(Je)){Ve[He[Je]]=Je}}var Ye=Ue.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Ke in Ye){if(Ye.hasOwnProperty(Ke)){if(!("channels"in Ye[Ke])){throw new Error("missing channels property: "+Ke)}if(!("labels"in Ye[Ke])){throw new Error("missing channel labels property: "+Ke)}if(Ye[Ke].labels.length!==Ye[Ke].channels){throw new Error("channel and label counts mismatch: "+Ke)}var Xe=Ye[Ke].channels;var Qe=Ye[Ke].labels;delete Ye[Ke].channels;delete Ye[Ke].labels;Object.defineProperty(Ye[Ke],"channels",{value:Xe});Object.defineProperty(Ye[Ke],"labels",{value:Qe})}}Ye.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.min(t,r,n);var s=Math.max(t,r,n);var a=s-o;var i;var l;var c;if(s===o){i=0}else if(t===s){i=(r-n)/a}else if(r===s){i=2+(n-t)/a}else if(n===s){i=4+(t-r)/a}i=Math.min(i*60,360);if(i<0){i+=360}c=(o+s)/2;if(s===o){l=0}else if(c<=.5){l=a/(s+o)}else{l=a/(2-s-o)}return[i,l*100,c*100]};Ye.rgb.hsv=function(e){var t;var r;var n;var o;var s;var a=e[0]/255;var i=e[1]/255;var l=e[2]/255;var c=Math.max(a,i,l);var u=c-Math.min(a,i,l);var p=function(e){return(c-e)/6/u+1/2};if(u===0){o=s=0}else{s=u/c;t=p(a);r=p(i);n=p(l);if(a===c){o=n-r}else if(i===c){o=1/3+t-n}else if(l===c){o=2/3+r-t}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,s*100,c*100]};Ye.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var o=Ye.rgb.hsl(e)[0];var s=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[o,s*100,n*100]};Ye.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o;var s;var a;var i;i=Math.min(1-t,1-r,1-n);o=(1-t-i)/(1-i)||0;s=(1-r-i)/(1-i)||0;a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function Ze(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}Ye.rgb.keyword=function(e){var t=Ve[e];if(t){return t}var r=Infinity;var n;for(var o in He){if(He.hasOwnProperty(o)){var s=He[o];var a=Ze(e,s);if(a<r){r=a;n=o}}}return n};Ye.keyword.rgb=function(e){return He[e]};Ye.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var o=t*.4124+r*.3576+n*.1805;var s=t*.2126+r*.7152+n*.0722;var a=t*.0193+r*.1192+n*.9505;return[o*100,s*100,a*100]};Ye.rgb.lab=function(e){var t=Ye.rgb.xyz(e);var r=t[0];var n=t[1];var o=t[2];var s;var a;var i;r/=95.047;n/=100;o/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=o>.008856?Math.pow(o,1/3):7.787*o+16/116;s=116*n-16;a=500*(r-n);i=200*(n-o);return[s,a,i]};Ye.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;var i;var l;if(r===0){l=n*255;return[l,l,l]}if(n<.5){s=n*(1+r)}else{s=n+r-n*r}o=2*n-s;i=[0,0,0];for(var c=0;c<3;c++){a=t+1/3*-(c-1);if(a<0){a++}if(a>1){a--}if(6*a<1){l=o+(s-o)*6*a}else if(2*a<1){l=s}else if(3*a<2){l=o+(s-o)*(2/3-a)*6}else{l=o}i[c]=l*255}return i};Ye.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=r;var s=Math.max(n,.01);var a;var i;n*=2;r*=n<=1?n:2-n;o*=s<=1?s:2-s;i=(n+r)/2;a=n===0?2*o/(s+o):2*r/(n+r);return[t,a*100,i*100]};Ye.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var o=Math.floor(t)%6;var s=t-Math.floor(t);var a=255*n*(1-r);var i=255*n*(1-r*s);var l=255*n*(1-r*(1-s));n*=255;switch(o){case 0:return[n,l,a];case 1:return[i,n,a];case 2:return[a,n,l];case 3:return[a,i,n];case 4:return[l,a,n];case 5:return[n,a,i]}};Ye.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=Math.max(n,.01);var s;var a;var i;i=(2-r)*n;s=(2-r)*o;a=r*o;a/=s<=1?s:2-s;a=a||0;i/=2;return[t,a*100,i*100]};Ye.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o=r+n;var s;var a;var i;var l;if(o>1){r/=o;n/=o}s=Math.floor(6*t);a=1-n;i=6*t-s;if((s&1)!==0){i=1-i}l=r+i*(a-r);var c;var u;var p;switch(s){default:case 6:case 0:c=a;u=l;p=r;break;case 1:c=l;u=a;p=r;break;case 2:c=r;u=a;p=l;break;case 3:c=r;u=l;p=a;break;case 4:c=l;u=r;p=a;break;case 5:c=a;u=r;p=l;break}return[c*255,u*255,p*255]};Ye.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o=e[3]/100;var s;var a;var i;s=1-Math.min(1,t*(1-o)+o);a=1-Math.min(1,r*(1-o)+o);i=1-Math.min(1,n*(1-o)+o);return[s*255,a*255,i*255]};Ye.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;o=t*3.2406+r*-1.5372+n*-.4986;s=t*-.9689+r*1.8758+n*.0415;a=t*.0557+r*-.204+n*1.057;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92;o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);a=Math.min(Math.max(0,a),1);return[o*255,s*255,a*255]};Ye.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=116*r-16;s=500*(t-r);a=200*(r-n);return[o,s,a]};Ye.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;s=(t+16)/116;o=r/500+s;a=s-n/200;var i=Math.pow(s,3);var l=Math.pow(o,3);var c=Math.pow(a,3);s=i>.008856?i:(s-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;a=c>.008856?c:(a-16/116)/7.787;o*=95.047;s*=100;a*=108.883;return[o,s,a]};Ye.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;o=Math.atan2(n,r);s=o*360/2/Math.PI;if(s<0){s+=360}a=Math.sqrt(r*r+n*n);return[t,a,s]};Ye.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;a=n/360*2*Math.PI;o=r*Math.cos(a);s=r*Math.sin(a);return[t,o,s]};Ye.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var o=1 in arguments?arguments[1]:Ye.rgb.hsv(e)[2];o=Math.round(o/50);if(o===0){return 30}var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(o===2){s+=60}return s};Ye.hsv.ansi16=function(e){return Ye.rgb.ansi16(Ye.hsv.rgb(e),e[2])};Ye.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var o=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return o};Ye.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var o=(t>>1&1)*r*255;var s=(t>>2&1)*r*255;return[n,o,s]};Ye.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var o=Math.floor((r=e%36)/6)/5*255;var s=r%6/5*255;return[n,o,s]};Ye.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};Ye.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var o=n>>16&255;var s=n>>8&255;var a=n&255;return[o,s,a]};Ye.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.max(Math.max(t,r),n);var s=Math.min(Math.min(t,r),n);var a=o-s;var i;var l;if(a<1){i=s/(1-a)}else{i=0}if(a<=0){l=0}else if(o===t){l=(r-n)/a%6}else if(o===r){l=2+(n-t)/a}else{l=4+(t-r)/a+4}l/=6;l%=1;return[l*360,a*100,i*100]};Ye.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var o=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){o=(r-.5*n)/(1-n)}return[e[0],n*100,o*100]};Ye.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var o=0;if(n<1){o=(r-n)/(1-n)}return[e[0],n*100,o*100]};Ye.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var o=[0,0,0];var s=t%1*6;var a=s%1;var i=1-a;var l=0;switch(Math.floor(s)){case 0:o[0]=1;o[1]=a;o[2]=0;break;case 1:o[0]=i;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=a;break;case 3:o[0]=0;o[1]=i;o[2]=1;break;case 4:o[0]=a;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=i}l=(1-r)*n;return[(r*o[0]+l)*255,(r*o[1]+l)*255,(r*o[2]+l)*255]};Ye.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var o=0;if(n>0){o=t/n}return[e[0],o*100,n*100]};Ye.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var o=0;if(n>0&&n<.5){o=t/(2*n)}else if(n>=.5&&n<1){o=t/(2*(1-n))}return[e[0],o*100,n*100]};Ye.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};Ye.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var o=n-t;var s=0;if(o<1){s=(n-o)/(1-o)}return[e[0],o*100,s*100]};Ye.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Ye.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Ye.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Ye.gray.hsl=Ye.gray.hsv=function(e){return[0,0,e[0]]};Ye.gray.hwb=function(e){return[0,100,e[0]]};Ye.gray.cmyk=function(e){return[0,0,0,e[0]]};Ye.gray.lab=function(e){return[e[0],0,0]};Ye.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};Ye.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]};var et=Ue.exports;function tt(){var e={};var t=Object.keys(et);for(var r=t.length,n=0;n<r;n++){e[t[n]]={distance:-1,parent:null}}return e}function rt(e){var t=tt();var r=[e];t[e].distance=0;while(r.length){var n=r.pop();var o=Object.keys(et[n]);for(var s=o.length,a=0;a<s;a++){var i=o[a];var l=t[i];if(l.distance===-1){l.distance=t[n].distance+1;l.parent=n;r.unshift(i)}}}return t}function nt(e,t){return function(r){return t(e(r))}}function ot(e,t){var r=[t[e].parent,e];var n=et[t[e].parent][e];var o=t[e].parent;while(t[o].parent){r.unshift(t[o].parent);n=nt(et[t[o].parent][o],n);o=t[o].parent}n.conversion=r;return n}var st=function(e){var t=rt(e);var r={};var n=Object.keys(t);for(var o=n.length,s=0;s<o;s++){var a=n[s];var i=t[a];if(i.parent===null){continue}r[a]=ot(a,t)}return r};var at=Ue.exports;var it=st;var lt={};var ct=Object.keys(at);function ut(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){t.conversion=e.conversion}return t}function pt(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,o=0;o<n;o++){r[o]=Math.round(r[o])}}return r};if("conversion"in e){t.conversion=e.conversion}return t}ct.forEach((function(e){lt[e]={};Object.defineProperty(lt[e],"channels",{value:at[e].channels});Object.defineProperty(lt[e],"labels",{value:at[e].labels});var t=it(e);var r=Object.keys(t);r.forEach((function(r){var n=t[r];lt[e][r]=pt(n);lt[e][r].raw=ut(n)}))}));var dt=lt;(function(e){const t=dt;const r=(e,r)=>function(){const n=e.apply(t,arguments);return`[${n+r}m`};const n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`};const o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};function s(){const e=new Map;const s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],gray:[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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.grey=s.color.gray;for(const t of Object.keys(s)){const r=s[t];for(const t of Object.keys(r)){const n=r[t];s[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=s[t];e.set(n[0],n[1])}Object.defineProperty(s,t,{value:r,enumerable:false});Object.defineProperty(s,"codes",{value:e,enumerable:false})}const a=e=>e;const i=(e,t,r)=>[e,t,r];s.color.close="[39m";s.bgColor.close="[49m";s.color.ansi={ansi:r(a,0)};s.color.ansi256={ansi256:n(a,0)};s.color.ansi16m={rgb:o(i,0)};s.bgColor.ansi={ansi:r(a,10)};s.bgColor.ansi256={ansi256:n(a,10)};s.bgColor.ansi16m={rgb:o(i,10)};for(let e of Object.keys(t)){if(typeof t[e]!=="object"){continue}const a=t[e];if(e==="ansi16"){e="ansi"}if("ansi16"in a){s.color.ansi[e]=r(a.ansi16,0);s.bgColor.ansi[e]=r(a.ansi16,10)}if("ansi256"in a){s.color.ansi256[e]=n(a.ansi256,0);s.bgColor.ansi256[e]=n(a.ansi256,10)}if("rgb"in a){s.color.ansi16m[e]=o(a.rgb,0);s.bgColor.ansi16m[e]=o(a.rgb,10)}}return s}Object.defineProperty(e,"exports",{enumerable:true,get:s})})(Le);var ft=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const o=t.indexOf("--");return n!==-1&&(o===-1?true:n<o)};const vt=B["default"];const ht=ft;const mt=process.env;let gt;if(ht("no-color")||ht("no-colors")||ht("color=false")){gt=false}else if(ht("color")||ht("colors")||ht("color=true")||ht("color=always")){gt=true}if("FORCE_COLOR"in mt){gt=mt.FORCE_COLOR.length===0||parseInt(mt.FORCE_COLOR,10)!==0}function bt(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function yt(e){if(gt===false){return 0}if(ht("color=16m")||ht("color=full")||ht("color=truecolor")){return 3}if(ht("color=256")){return 2}if(e&&!e.isTTY&>!==true){return 0}const t=gt?1:0;if(process.platform==="win32"){const e=vt.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in mt){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in mt))||mt.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in mt){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(mt.TEAMCITY_VERSION)?1:0}if(mt.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in mt){const e=parseInt((mt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(mt.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(mt.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(mt.TERM)){return 1}if("COLORTERM"in mt){return 1}if(mt.TERM==="dumb"){return t}return t}function wt(e){const t=yt(e);return bt(t)}var jt={supportsColor:wt,stdout:wt(process.stdout),stderr:wt(process.stderr)};const kt=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const Ct=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const xt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const Ot=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const Mt=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function Pt(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return Mt.get(e)||e}function St(e,t){const r=[];const n=t.trim().split(/\s*,\s*/g);let o;for(const t of n){if(!isNaN(t)){r.push(Number(t))}else if(o=t.match(xt)){r.push(o[2].replace(Ot,((e,t,r)=>t?Pt(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function At(e){Ct.lastIndex=0;const t=[];let r;while((r=Ct.exec(e))!==null){const e=r[1];if(r[2]){const n=St(e,r[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function Et(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}var Rt=(e,t)=>{const r=[];const n=[];let o=[];t.replace(kt,((t,s,a,i,l,c)=>{if(s){o.push(Pt(s))}else if(i){const t=o.join("");o=[];n.push(r.length===0?t:Et(e,r)(t));r.push({inverse:a,styles:At(i)})}else if(l){if(r.length===0){throw new Error("Found extraneous } in Chalk template literal")}n.push(Et(e,r)(o.join("")));o=[];r.pop()}else{o.push(c)}}));n.push(o.join(""));if(r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};(function(e){const t=ze;const r=Le.exports;const n=jt.stdout;const o=Rt;const s=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const a=["ansi","ansi","ansi256","ansi16m"];const i=new Set(["gray"]);const l=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};c(t,e);t.template=function(){const e=[].slice.call(arguments);return v.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,u.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=u;return t.template}c(this,e)}if(s){r.blue.open="[94m"}for(const e of Object.keys(r)){r[e].closeRe=new RegExp(t(r[e].close),"g");l[e]={get(){const t=r[e];return d.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}l.visible={get(){return d.call(this,this._styles||[],true,"visible")}};r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi)){if(i.has(e)){continue}l[e]={get(){const t=this.level;return function(){const n=r.color[a[t]][e].apply(null,arguments);const o={open:n,close:r.color.close,closeRe:r.color.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(i.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);l[t]={get(){const t=this.level;return function(){const n=r.bgColor[a[t]][e].apply(null,arguments);const o={open:n,close:r.bgColor.close,closeRe:r.bgColor.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}const p=Object.defineProperties((()=>{}),l);function d(e,t,r){const n=function(){return f.apply(n,arguments)};n._styles=e;n._empty=t;const o=this;Object.defineProperty(n,"level",{enumerable:true,get(){return o.level},set(e){o.level=e}});Object.defineProperty(n,"enabled",{enumerable:true,get(){return o.enabled},set(e){o.enabled=e}});n.hasGrey=this.hasGrey||r==="gray"||r==="grey";n.__proto__=p;return n}function f(){const e=arguments;const t=e.length;let n=String(arguments[0]);if(t===0){return""}if(t>1){for(let r=1;r<t;r++){n+=" "+e[r]}}if(!this.enabled||this.level<=0||!n){return this._empty?"":n}const o=r.dim.open;if(s&&this.hasGrey){r.dim.open=""}for(const e of this._styles.slice().reverse()){n=e.open+n.replace(e.closeRe,e.open)+e.close;n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`)}r.dim.open=o;return n}function v(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const n=[t.raw[0]];for(let e=1;e<t.length;e++){n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));n.push(String(t.raw[e]))}return o(e,n.join(""))}Object.defineProperties(u.prototype,l);e.exports=u();e.exports.supportsColor=n;e.exports.default=e.exports})(Ne);var Bt=Ne.exports;const $t=async(r,n,o)=>{const a=await e.getPackageDir(__dirname,process.cwd());const i=w.readFileSync(s.join(a,"./templates/main.html"),"utf-8");const l=[];for(const[t]of Object.entries(o.entryMap)){const s=Object.keys(r).includes(t);l.push({name:t.replace(o.projectVirtualPath,"").replace(/^\//,""),link:e.urlJoin(n,["pages",t],{env:"me"}),flagText:s?"serve":"static",isServed:s?1:0})}const c={title:"@flatjs/evolve",modules:l.sort(((e,t)=>t.isServed-e.isServed))};return t.template(i)(c)};const qt=async(r,n,o,a,i,l)=>{const c=l.entryMap;const u=Object.keys(c).sort(((e,t)=>t.length-e.length));const p=await e.getPackageDir(__dirname,process.cwd());const d=u.find((t=>e.ensureSlash(o.path.replace(/^\//,""),true).startsWith(e.ensureSlash(t,true))));if(!d){const e=w.readFileSync(s.join(p,`./templates/module-404.html`),"utf-8");return t.template(e)({title:"404 Not Found",errorMeta:[{name:`@flatjs/evolve workspace`,value:p},{name:`served entry names`,value:JSON.stringify(u)},{name:`module path`,value:`${o.path}`}]})}const f=c[d];const v=f.options;const h=r[d];const m=(h==null?void 0:h.devServerHostUri)||a;const g=(v==null?void 0:v.serveModuleTemplate)||"./templates/module.html";const b=s.join(l.projectCwd,"./templates/module.html");const y=w.readFileSync(s.isAbsolute(g)?g:e.existsSync(b)?b:s.join(p,"./templates/module.html"),"utf-8");const j=l.forServe;const k=j.defaultServeGlobalData?j.defaultServeGlobalData(f,a):{};const C={title:J("title",n,v==null?void 0:v.title),favicon:J("favicon",n,v==null?void 0:v.favicon),viewport:ie(l,v)?J("viewport",n,v==null?void 0:v.viewport):"",inlineScripts:J("inlineScripts",n,v==null?void 0:v.inlineScripts),headBeforeStyles:J("headBeforeStyles",n,v==null?void 0:v.headBeforeStyles),headBeforeScripts:J("headBeforeScripts",n,v==null?void 0:v.headBeforeScripts),bodyAfterScripts:J("bodyAfterScripts",n,v==null?void 0:v.bodyAfterScripts),moduleFederationScripts:oe({me:[e.urlJoin(a,["public"])]}),global:{hostUrl:a,apiBase:e.urlJoin(a,[i]),routeBaseName:s.join(`/pages`,d),...k,...(v==null?void 0:v.serveGlobalData)||{}},styles:[e.urlJoin(m,[s.join("public",d,"bundle.css")])],scripts:[e.urlJoin(m,[s.join("public",d,"bundle.js")])]};return t.template(y)(C)};const Tt=(e,t,r,n,o)=>{const s=async(s,a)=>{let i;if(s.path==="/"){i=await $t(n,t,o)}else{i=await qt(n,e,s,t,r,o)}a.send(i)};return(o.forServe.pageMiddlewares||[]).concat(s)};const Ft=t=>async(r,n)=>{const o=r.baseUrl;if(!o.startsWith("/public")){n.redirect("/pages")}else{const r=await e.fileWalk(s.join("public/","**/*.{js,css}"),{cwd:t});const a=s.extname(o);const i=r.find((e=>s.extname(e)===a&&e.indexOf(o.replace(/\.(js|css)$/,""))!==-1));if(i){n.sendFile(i)}else{n.sendFile(s.join(t,o))}}};const _t=(e,t="development",r,o,s,a,i)=>{const l=q["default"]();n.attachMockMiddlewares(l,i);l.set("hostUri",o);l.use("/pages",...Tt(t,o,i.apiContext||"api",s,a));l.use("*",Ft(e));return new Promise((e=>{const t=a.https?T["default"].createServer(a.https,l):l;t.listen(r,(()=>{e(true)}))}))};const Dt=(e,t,r)=>{const{projectCwd:n,https:o,liveReload:a}=r;const i=new $["default"]({server:{type:o?"https":"http",options:{...o}},open:false,compress:true,port:t,hot:!a,liveReload:a,allowedHosts:"all",static:{directory:`${s.join(n,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:true,overlay:{errors:true,warnings:false}}},e);return new Promise(((e,t)=>{i.startCallback((r=>{if(r){return t(r)}e(true)}))}))};const It=async(r,o,a,i)=>{await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:a.needVerifyPackages||{}});if(a.https){i.https=a.https}const{mockPort:c,hostUri:u}=await n.prepareMockDomain(i);const p=e.urlJoin(u,["/pages"]);let d=c;const f=[];const v={};for(const[e]of Object.entries(o)){d=d+1;const{mockPort:r,hostUri:o}=await n.prepareMockDomain(t.merge({},i,{port:d}));v[e]={devServerPort:r,devServerHostUri:o}}for(const[t,n]of Object.entries(o)){var h,m;const o=((h=n.options)==null?void 0:(m=h.moduleFederation)==null?void 0:m.remotes)||[];o.forEach((t=>{t.endpoint=t=>{var r;return e.urlJoin(((r=v[t])==null?void 0:r.devServerHostUri)||u,["/public"])}}));const{devServerPort:i,devServerHostUri:c}=v[t];const d=e.urlJoin(c,["public"]);const g={[t]:n};const b=ae(n,a);const y=_e("development",d,g,b);const w=l.webpack(se(g,y)[0]);f.push(Dt(w,i,a));const j=Bt.bgBlack(`[${Bt.magenta("@flatjs")}:${Bt.bold(w.name||"")}]`);w.hooks.invalid.tap("fileChange",(e=>{console.log(j,`${"file change".padEnd(12," ")} ➩ ${Bt.cyan(s.relative(r,e||""))}`)}));w.hooks.done.tap("compileDone",(()=>{console.log(j,`${"serve page".padEnd(12," ")} ➩ ${Bt.cyan(p)}`)}))}await _t(r,"development",c,u,v,a,i);ee(p);return Promise.all(f).then((()=>true)).catch((e=>{console.log("evolve serve err: ",e);return false}))};const Nt=async(t,r,o)=>{if(r.https){o.https=r.https}const{mockPort:s,hostUri:a}=await n.prepareMockDomain(o);const i=e.urlJoin(a,["/pages"]);return _t(t,"development",s,a,{},r,o).then((e=>{const t=Bt.bgBlack(`[${Bt.magenta("@flatjs")}:`);console.log(t,`${"serve page".padEnd(12," ")} ➩ ${Bt.cyan(i)}`);return e}))};const Wt=(e={},r={})=>{const n={};for(const[o,s]of Object.entries(r)){const r={options:{}};if(e[o]){n[o]=t.merge({},r,s,e[o])}t.merge(s,r)}return n};const zt=(e,t,r={})=>{const n=Z(e,r);const o=Wt(t,n.entryMap);return Ie(o,n)};const Lt=(e,t,r={},o={})=>{const s=Z(e,r);const a=n.loadMockConfiguration(e,o);const i=Wt(t,s.entryMap);return It(e,i,s,a)};const Ut=(e,t={},r={})=>{const o=Z(e,t);const s=n.loadMockConfiguration(e,r);return Nt(e,o,s)};exports.cdnBoot=L;exports.cdnJsDelivr=z;exports.cdnUnpkg=W;exports.createPageMiddleware=Tt;exports.createPublicAssetsMiddleware=Ft;exports.defaultFlatjsConfig=U;exports.evolveBuild=zt;exports.evolveServe=Lt;exports.evolveStatic=Ut;exports.flatBabelOptions=I;exports.flatExternalOptions=G;exports.flatLessLoaderOptions=Y;exports.flatPerformanceOptions=X;exports.flatPostcssLoaderOptions=K;exports.getHtmlPluginConfig=J;exports.loadEvolveConfiguration=Z;exports.loadModule=D;exports.normalizeEntries=Wt;exports.polyfill=N;exports.terserOptions=Q;exports.viewportScripts=H;
|
4
|
+
extractComments:false,terserOptions:t.merge({ecma:undefined,parse:{},compress:{},mangle:true,module:false,output:null,toplevel:false,nameCache:null,ie8:false,keep_classnames:undefined,keep_fnames:false,safari10:false},e)});const Z=(r=process.cwd(),n)=>{const o=e.loadFlatjsConfig(r,"flatjsEvolve","flatjs.evolve.js");return t.merge({},U.flatjsEvolve,o.flatjsEvolve,n,{projectCwd:r})};const ee=e=>{try{F["default"](e)}catch(e){console.warn(`Unable to open browser. If you are running in a headless environment\n`)}};function te(e="",t=""){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}function re(e){const t=new RegExp("[?&]env(=([^&#]*)|&|#|$)");const r=t.exec(window.location.href);const n=r&&r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"prod";const o=e[n]||e["prod"]||[];const s=o[Math.floor(Math.random()*o.length)];return s.replace(/\/$/,"")+"/"}function ne(e={},t="prod"){const r=e[t]||e["prod"]||[];return r[Math.floor(Math.random()*r.length)]}function oe(e){return`window.evolveFetchMicroWidgets = function () {\n var cdnConfig = ${JSON.stringify(e)};\n var cdnFinder = ${re.toString()};\n return (cdnFinder(cdnConfig) || '').replace(/\\/$/, '');\n }`}function se(e,r){const n=[];for(const[t,r]of Object.entries(e)){n.push({[t]:r.entry})}return n.map((e=>t.merge({},r,{name:Object.keys(e)[0],entry:e})))}const ae=(e,r)=>{var n,o;const s=t.merge({},r.pluginLoaderOptions);if((n=e.options)!=null&&n.allowPx2rem){t.set(s,"pixelOptions.enabled",e.options.allowPx2rem)}if((o=e.options)!=null&&o.enableBundleHashName){t.set(s,"enableBundleHashName",e.options.enableBundleHashName)}const a={...r,pluginLoaderOptions:s};return a};const ie=(e,t)=>{var r,n,o;const s=(r=e.pluginLoaderOptions)==null?void 0:(n=r.pixelOptions)==null?void 0:n.enabled;const a=(o=t==null?void 0:t.allowPx2rem)!=null?o:s;return!!a};const le=e=>{if(Object.keys(e).length>1){throw new Error(`Only single one entry map support now while "serve", "build" process!`)}let t=undefined;for(const[r,n]of Object.entries(e)){t=[r,n];break}if(!t){throw new Error(`No entry map found while "serve", "build" process!`)}return t};const ce=()=>Date.now().toString();const ue=(e,t,r=true)=>{const n=e==="js"?".js":".css";if(t){return`bundle${n}`}if(r){return`bundle[contenthash]${n}`}return`bundle${n}?${ce()}`};const pe=/icons\//;const de=/\.(jpe?g|png|gif|svg)$/;const fe=/\.(ttf|eot|woff|woff2)(\?.+)?$/;const ve=({projectCwd:e,projectVirtualPath:t},r,[n,s])=>{let a=o.dirname(o.join(t,r.replace(/^src/,"")));const i=s.entry.map((t=>o.dirname(o.join(e,t))));const l=o.resolve(e,r);const c=i.find((e=>l.startsWith(e)));if(c){a=o.dirname(o.join(n,o.relative(c,l)))}return`${a}/[name]-[contenthash:8][ext]`};const he=(e,t)=>{const r={test(e){return fe.test(e)||de.test(e)&&!pe.test(e)},type:"asset",generator:{filename({filename:r}){return ve(e,r,t)}},parser:{dataUrlCondition:{maxSize:4*1024}}};return r};const me=()=>{const e={test(e){return pe.test(e)&&e.endsWith(".svg")},use:[{loader:require.resolve("./loader-icon"),options:{svgo:{plugins:[{name:"removeTitle"},{name:"removeDimensions"}]}}}]};return e};function ge(e,r){const n=t.isFunction(e)?e(r):e;if(n.usePreset==="react"&&r){if(n.plugins){n.plugins.push(require.resolve("react-refresh/babel"))}else{n.plugins=[require.resolve("react-refresh/babel")]}}return n}const be=(e,r={},n=[])=>{const o=ge(r,e);const s=t.isFunction(n)?n(e):n;const a=I(o,s);const i={test:/\.(tsx|ts|js|jsx)$/,use:[{loader:"babel-loader",options:a}]};return i};const ye=(e,t={})=>{const r={test:/\.css$/i,use:[{loader:P["default"].loader,options:{esModule:true}},{loader:"css-loader",options:{sourceMap:e}}]};if(Array.isArray(r.use)){r.use.push({loader:"postcss-loader",options:{postcssOptions:K(e,t),sourceMap:e}})}return r};const we=(e,t={},r={})=>{const n=ye(e,r);n.test=/\.less$/i;if(Array.isArray(n.use)){n.use.push({loader:"less-loader",options:{sourceMap:e,lessOptions:Y(e,t)}})}return n};const je=(e,t,r,n={})=>{const o=[me(),he(t,r),ye(e,n.pixelOptions),we(e,n.lessOptions,n.pixelOptions),be(e,n.babelOptions,n.modularImports)];return o};class ke{constructor(e={}){this.verbose=void 0;this.cleanStaleWebpackAssets=void 0;this.protectWebpackAssets=void 0;this.cleanAfterEveryBuildPatterns=void 0;this.cleanOnceBeforeBuildPatterns=void 0;this.currentAssets=void 0;this.initialClean=void 0;this.outputPath=void 0;this.verbose=e.verbose===true||false;this.cleanStaleWebpackAssets=e.cleanStaleWebpackAssets===true||e.cleanStaleWebpackAssets===false?e.cleanStaleWebpackAssets:true;this.protectWebpackAssets=e.protectWebpackAssets===true||e.protectWebpackAssets===false?e.protectWebpackAssets:true;this.cleanAfterEveryBuildPatterns=Array.isArray(e.cleanAfterEveryBuildPatterns)?e.cleanAfterEveryBuildPatterns:[];this.cleanOnceBeforeBuildPatterns=Array.isArray(e.cleanOnceBeforeBuildPatterns)?e.cleanOnceBeforeBuildPatterns:["**/*"];this.currentAssets=[];this.initialClean=false;this.outputPath="";this.apply=this.apply.bind(this);this.handleInitial=this.handleInitial.bind(this);this.handleDone=this.handleDone.bind(this);this.removeFiles=this.removeFiles.bind(this)}apply(e){if(!e.options.output||!e.options.output.path){console.warn("clean-webpack-plugin: options.output.path not defined. Plugin disabled...");return}this.outputPath=e.options.output.path;const t=e.hooks;if(this.cleanOnceBeforeBuildPatterns.length!==0){t.emit.tap("clean-webpack-plugin",(e=>{this.handleInitial(e)}))}t.done.tap("clean-webpack-plugin",(e=>{this.handleDone(e)}))}handleInitial(e){if(this.initialClean){return}const t=e.getStats();if(t.hasErrors()){return}this.initialClean=true;this.removeFiles(this.cleanOnceBeforeBuildPatterns)}handleDone(e){if(e.hasErrors()){if(this.verbose){console.warn("clean-webpack-plugin: pausing due to webpack errors")}return}const t=e.toJson({assets:true}).assets||[];const r=t.map((e=>e.name));const n=this.currentAssets.filter((e=>{const t=r.includes(e)===false;return t}));this.currentAssets=r.sort();const o=[];if(this.cleanStaleWebpackAssets===true&&n.length!==0){o.push(...n)}if(this.cleanAfterEveryBuildPatterns.length!==0){o.push(...this.cleanAfterEveryBuildPatterns)}if(o.length!==0){this.removeFiles(o)}}removeFiles(t){try{const r=e.delFilesSync(t,{cwd:this.outputPath,dot:true,ignore:this.protectWebpackAssets?this.currentAssets:[]});if(this.verbose){r.forEach((e=>{const t=o.relative(process.cwd(),e);const r="removed";console.warn(`clean-webpack-plugin: ${r} ${t}`)}))}}catch(e){const t=/Cannot delete files\/folders outside the current working directory\./.test(e.message);if(t){const e="clean-webpack-plugin: Cannot delete files/folders outside the current working directory. Can be overridden with the `dangerouslyAllowCleanPatternsOutsideProject` option.";throw new Error(e)}throw e}}}const Ce=t=>new ke({verbose:true,cleanOnceBeforeBuildPatterns:[`${o.join(e.ensureSlash(t[0],true),"**/*")}`]});const xe=(e,t)=>new P["default"]({filename:`[name]/${ue("css",e,t==null?void 0:t.enableBundleHashName)}`,chunkFilename:"[id].[contenthash].css"});const Oe="ExternalTemplateRemotesPlugin";const Me=e=>e.constructor.name==="ExternalModule";class Pe{apply(e){e.hooks.make.tap(Oe,(e=>{const t=[];e.hooks.buildModule.tap(Oe,(e=>{if(Me(e)&&e.externalType==="script"){t.push(e)}}));e.hooks.afterCodeGeneration.tap(Oe,(()=>{t.map((t=>{const r=E["default"](t.request)[0];const n=Se(r);const o=e.codeGenerationResults.get(t,undefined).sources;const s=o.get("javascript");if(s){const e=new f.RawSource(s.source().toString().replace(`"${r}"`,n));o.set("javascript",e)}}))}))}))}}function Se(e){const t=[];const r=[];let n=false;let o=false;for(const s of e){if(s==="["){if(n){o=true;break}n=true;if(r.length){t.push(`"${r.join("")}"`);r.length=0}}else if(s==="]"){if(!n){o=true;break}n=false;if(r.length){t.push(`${r.join("")}`);r.length=0}r.length=0}else{r.push(s)}}if(n||o){throw new Error(`Invalid template URL "${e}"`)}if(r.length){t.push(`"${r.join("")}"`)}return t.join(" + ")}const Ae=`HtmlInjectScriptPlugin`;class Ee{constructor(e){this.scripts=void 0;this.scripts=e||[]}processScripts(){return this.scripts.filter(Boolean).map((e=>({tagName:"script",innerHTML:e,voidTag:false,attributes:{},meta:{plugin:"html-inject-script-webpack-plugin"}})))}apply(e){e.hooks.compilation.tap(`${Ae}_compilation`,(e=>{const t=R["default"].getHooks(e);t.alterAssetTags.tap(`${Ae}_alterAssetTags`,(e=>{e.assetTags.scripts.unshift(...this.processScripts());return e}))}))}}const Re=(e="")=>e.replace(/[\/-]/gi,"_").toLowerCase();const Be=e=>o.join(e,`micro-remote-module.js`);const $e=(t,[r,n],o)=>{var s;const a=(s=n.options)==null?void 0:s.moduleFederation;const l=[];if(a){const{remotes:n,...s}=a;const c=Be(r);const u=Re(r);const p=(n||[]).map((({name:t,endpoint:r})=>{const n=Re(t);const o=Be(t);const s=r?e.ensureSlash(r(t),false):`[window.evolveFetchMicroWidgets()]`;return{[n]:`${n}@${s}/${o}`}}));l.push(new i.container.ModuleFederationPlugin({name:u,filename:c,remotes:p,...s}),new Pe);if(!t){l.unshift(new Ee([oe(o)]))}}return l};const qe={minifyJS:true,removeComments:true,collapseWhitespace:true,collapseBooleanAttributes:false};const Te=(e,t,[r,n],o)=>{const s=[];const{options:a}=n;const i=e?"development":"production";for(const e of o){s.push(new R["default"]({inject:"body",title:J("title",i,a==null?void 0:a.title),chunks:[r],minify:(a==null?void 0:a.minify)===false?false:["me","dev"].includes(e)?false:qe,filename:`${r}/index${e==="prod"?"":`-${e}`}.html`,template:J("template",i,a==null?void 0:a.template).replace(`{0}`,e),templateParameters:{title:J("title",i,a==null?void 0:a.title),favicon:J("favicon",i,a==null?void 0:a.favicon),inlineScripts:J("inlineScripts",i,a==null?void 0:a.inlineScripts),headBeforeStyles:J("headBeforeStyles",i,a==null?void 0:a.headBeforeStyles),headBeforeScripts:J("headBeforeScripts",i,a==null?void 0:a.headBeforeScripts),bodyAfterScripts:J("bodyAfterScripts",i,a==null?void 0:a.bodyAfterScripts),viewport:ie(t,a)?J("viewport",i,a==null?void 0:a.viewport):""},multiCdn:{env:e,disabled:((a==null?void 0:a.excludeCdnEnvs)||["me","dev","ntv"]).includes(e)}}))}return s};class Fe{constructor(e){var t;this.config=e;this.pluginName="FlatEvolveMultiCdnPlugin";this.requireFn=i.RuntimeGlobals.publicPath;if(!((t=this.config)!=null&&t.prod)){throw new Error("We must setup `prod` for each CDN config node!")}}apply(e){e.hooks.thisCompilation.tap(this.pluginName,(e=>{e.mainTemplate.hooks.requireExtensions.tap(this.pluginName,((t,r)=>{var n;const o=[];o.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const s=(n=e.chunkGraph)==null?void 0:n.getTreeRuntimeRequirements(r);if(s&&s.has(i.RuntimeGlobals.requireScope)){o.push("(function () {");o.push(i.Template.indent(`var flatjsMultiCdn = {`));o.push(i.Template.indent(i.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`])));o.push(i.Template.indent(i.Template.indent([`cdnFinder: ${re.toString()}`])));o.push(i.Template.indent(`};`));o.push(i.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig) || ${this.requireFn};`));o.push("})();")}return i.Template.asString(o)}))}));e.hooks.compilation.tap(this.pluginName,(e=>{R["default"].getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t}=e;const{userOptions:r}=e.plugin;const n=r.multiCdn;const s=t.publicPath;const a=t.js.map((e=>{if(n.disabled){return o.basename(e)}const t=ne(this.config,n.env);return te(t,e.replace(s,""))}));const i=t.css.map((e=>{if(n.disabled){return o.basename(e)}const t=ne(this.config,n.env);return te(t,e.replace(s,""))}));e.assets.js=a;e.assets.css=i;return e}))}))}}const _e=(e,t,r)=>{var n;const o=[new A["default"]];if(r.analyzer){o.push(new d.BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...r.analyzer}))}o.push(xe(e,r.pluginLoaderOptions));o.push(...$e(e,t,r.multiHtmlCdn));if(!e){o.push(Ce(t));const n=Object.keys(r.multiHtmlCdn);o.push(...Te(e,r,t,n));o.push(new Fe(r.multiHtmlCdn))}const s=ge(((n=r.pluginLoaderOptions)==null?void 0:n.babelOptions)||{},e);if(s.usePreset==="react"&&e){o.push(new S["default"]({overlay:false}))}return o};const De=(r,n,s,a)=>{process.env.NODE_ENV=r;n=e.ensureSlash(n,true);const i=r==="development";const l=a.projectCwd;const c=a.pluginLoaderOptions;const u=a.watchOptions;const p=le(s);const d=t.isFunction(a.extraLoaders)?a.extraLoaders(i):a.extraLoaders;const f=[...je(i,a,p,c),...d||[]];const v=t.isFunction(a.extraPlugins)?a.extraPlugins(i):a.extraPlugins;const h=[..._e(i,p,a),...v||[]];const m={mode:r,target:a.target,stats:{preset:"minimal"},infrastructureLogging:{level:"warn"},devtool:i?"eval-source-map":false,plugins:h,watchOptions:u,context:l,cache:{type:"memory"},resolve:{mainFields:["browser","module","main"],extensions:[".ts",".tsx",".js",".json",".vue"],alias:a.resolveAlias||{}},module:{rules:f},externals:G(i,a.externals,p),performance:X(i,a.performance),output:{devtoolModuleFilenameTemplate:({namespace:e,resourcePath:t})=>`webpack:///${o.join(e,t)}`,environment:{},pathinfo:false,path:o.join(l,"public"),publicPath:n,filename:`[name]/${ue("js",i,c==null?void 0:c.enableBundleHashName)}`,chunkFilename:`[id].[contenthash].js`},optimization:{nodeEnv:i?"development":"production",chunkIds:i?"named":"named",moduleIds:i?"named":"named",minimize:a.minimize===false?false:i?false:true,minimizer:[new M["default"](Q(a.minimizeTerserOptions))],splitChunks:{name:false,chunks:"all",minSize:25e5,cacheGroups:{default:false,defaultVendors:false}}}};return m};const Ie=(e,t,r)=>{const n=De("production",t,e,r);const o=se(e,n);if(o.length>1){throw new Error("startSingleEntryBuild() only support `compiler` at a time")}const s=o[0];return new Promise(((e,t)=>{O["default"](s,((n,o)=>{var a,i;if(n){return t(n)}const l=o==null?void 0:o.toJson();if(l!=null&&(a=l.errors)!=null&&a.length){return t(l.errors)}if(r.forBuild.rejectWarnings&&l!=null&&(i=l.warnings)!=null&&i.length){return t(l.warnings)}e({name:s.name,warningStats:l==null?void 0:l.warnings})}))}))};const Ne=async(t,r)=>{var n;await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:r.needVerifyPackages||{}});const o=((n=r.multiHtmlCdn)==null?void 0:n.prod)||[];const s=[];const a=e.ensureSlash(o[Math.floor(Math.random()*o.length)],true);for(const[e,n]of Object.entries(t)){const t=ae(n,r);const o={[e]:n};s.push(Ie(o,a,t))}return Promise.all(s)};var We={exports:{}};var Le=/[|\\{}()[\]^$+*?.]/g;var ze=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(Le,"\\$&")};var Ue={exports:{}};var Ge={exports:{}};var He={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Ve=He;var Je={};for(var Ye in Ve){if(Ve.hasOwnProperty(Ye)){Je[Ve[Ye]]=Ye}}var Ke=Ge.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Xe in Ke){if(Ke.hasOwnProperty(Xe)){if(!("channels"in Ke[Xe])){throw new Error("missing channels property: "+Xe)}if(!("labels"in Ke[Xe])){throw new Error("missing channel labels property: "+Xe)}if(Ke[Xe].labels.length!==Ke[Xe].channels){throw new Error("channel and label counts mismatch: "+Xe)}var Qe=Ke[Xe].channels;var Ze=Ke[Xe].labels;delete Ke[Xe].channels;delete Ke[Xe].labels;Object.defineProperty(Ke[Xe],"channels",{value:Qe});Object.defineProperty(Ke[Xe],"labels",{value:Ze})}}Ke.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.min(t,r,n);var s=Math.max(t,r,n);var a=s-o;var i;var l;var c;if(s===o){i=0}else if(t===s){i=(r-n)/a}else if(r===s){i=2+(n-t)/a}else if(n===s){i=4+(t-r)/a}i=Math.min(i*60,360);if(i<0){i+=360}c=(o+s)/2;if(s===o){l=0}else if(c<=.5){l=a/(s+o)}else{l=a/(2-s-o)}return[i,l*100,c*100]};Ke.rgb.hsv=function(e){var t;var r;var n;var o;var s;var a=e[0]/255;var i=e[1]/255;var l=e[2]/255;var c=Math.max(a,i,l);var u=c-Math.min(a,i,l);var p=function(e){return(c-e)/6/u+1/2};if(u===0){o=s=0}else{s=u/c;t=p(a);r=p(i);n=p(l);if(a===c){o=n-r}else if(i===c){o=1/3+t-n}else if(l===c){o=2/3+r-t}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,s*100,c*100]};Ke.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var o=Ke.rgb.hsl(e)[0];var s=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[o,s*100,n*100]};Ke.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o;var s;var a;var i;i=Math.min(1-t,1-r,1-n);o=(1-t-i)/(1-i)||0;s=(1-r-i)/(1-i)||0;a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function et(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}Ke.rgb.keyword=function(e){var t=Je[e];if(t){return t}var r=Infinity;var n;for(var o in Ve){if(Ve.hasOwnProperty(o)){var s=Ve[o];var a=et(e,s);if(a<r){r=a;n=o}}}return n};Ke.keyword.rgb=function(e){return Ve[e]};Ke.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var o=t*.4124+r*.3576+n*.1805;var s=t*.2126+r*.7152+n*.0722;var a=t*.0193+r*.1192+n*.9505;return[o*100,s*100,a*100]};Ke.rgb.lab=function(e){var t=Ke.rgb.xyz(e);var r=t[0];var n=t[1];var o=t[2];var s;var a;var i;r/=95.047;n/=100;o/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=o>.008856?Math.pow(o,1/3):7.787*o+16/116;s=116*n-16;a=500*(r-n);i=200*(n-o);return[s,a,i]};Ke.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;var i;var l;if(r===0){l=n*255;return[l,l,l]}if(n<.5){s=n*(1+r)}else{s=n+r-n*r}o=2*n-s;i=[0,0,0];for(var c=0;c<3;c++){a=t+1/3*-(c-1);if(a<0){a++}if(a>1){a--}if(6*a<1){l=o+(s-o)*6*a}else if(2*a<1){l=s}else if(3*a<2){l=o+(s-o)*(2/3-a)*6}else{l=o}i[c]=l*255}return i};Ke.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=r;var s=Math.max(n,.01);var a;var i;n*=2;r*=n<=1?n:2-n;o*=s<=1?s:2-s;i=(n+r)/2;a=n===0?2*o/(s+o):2*r/(n+r);return[t,a*100,i*100]};Ke.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var o=Math.floor(t)%6;var s=t-Math.floor(t);var a=255*n*(1-r);var i=255*n*(1-r*s);var l=255*n*(1-r*(1-s));n*=255;switch(o){case 0:return[n,l,a];case 1:return[i,n,a];case 2:return[a,n,l];case 3:return[a,i,n];case 4:return[l,a,n];case 5:return[n,a,i]}};Ke.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=Math.max(n,.01);var s;var a;var i;i=(2-r)*n;s=(2-r)*o;a=r*o;a/=s<=1?s:2-s;a=a||0;i/=2;return[t,a*100,i*100]};Ke.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o=r+n;var s;var a;var i;var l;if(o>1){r/=o;n/=o}s=Math.floor(6*t);a=1-n;i=6*t-s;if((s&1)!==0){i=1-i}l=r+i*(a-r);var c;var u;var p;switch(s){default:case 6:case 0:c=a;u=l;p=r;break;case 1:c=l;u=a;p=r;break;case 2:c=r;u=a;p=l;break;case 3:c=r;u=l;p=a;break;case 4:c=l;u=r;p=a;break;case 5:c=a;u=r;p=l;break}return[c*255,u*255,p*255]};Ke.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o=e[3]/100;var s;var a;var i;s=1-Math.min(1,t*(1-o)+o);a=1-Math.min(1,r*(1-o)+o);i=1-Math.min(1,n*(1-o)+o);return[s*255,a*255,i*255]};Ke.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;o=t*3.2406+r*-1.5372+n*-.4986;s=t*-.9689+r*1.8758+n*.0415;a=t*.0557+r*-.204+n*1.057;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92;o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);a=Math.min(Math.max(0,a),1);return[o*255,s*255,a*255]};Ke.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=116*r-16;s=500*(t-r);a=200*(r-n);return[o,s,a]};Ke.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;s=(t+16)/116;o=r/500+s;a=s-n/200;var i=Math.pow(s,3);var l=Math.pow(o,3);var c=Math.pow(a,3);s=i>.008856?i:(s-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;a=c>.008856?c:(a-16/116)/7.787;o*=95.047;s*=100;a*=108.883;return[o,s,a]};Ke.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;o=Math.atan2(n,r);s=o*360/2/Math.PI;if(s<0){s+=360}a=Math.sqrt(r*r+n*n);return[t,a,s]};Ke.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;a=n/360*2*Math.PI;o=r*Math.cos(a);s=r*Math.sin(a);return[t,o,s]};Ke.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var o=1 in arguments?arguments[1]:Ke.rgb.hsv(e)[2];o=Math.round(o/50);if(o===0){return 30}var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(o===2){s+=60}return s};Ke.hsv.ansi16=function(e){return Ke.rgb.ansi16(Ke.hsv.rgb(e),e[2])};Ke.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var o=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return o};Ke.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var o=(t>>1&1)*r*255;var s=(t>>2&1)*r*255;return[n,o,s]};Ke.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var o=Math.floor((r=e%36)/6)/5*255;var s=r%6/5*255;return[n,o,s]};Ke.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};Ke.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var o=n>>16&255;var s=n>>8&255;var a=n&255;return[o,s,a]};Ke.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.max(Math.max(t,r),n);var s=Math.min(Math.min(t,r),n);var a=o-s;var i;var l;if(a<1){i=s/(1-a)}else{i=0}if(a<=0){l=0}else if(o===t){l=(r-n)/a%6}else if(o===r){l=2+(n-t)/a}else{l=4+(t-r)/a+4}l/=6;l%=1;return[l*360,a*100,i*100]};Ke.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var o=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){o=(r-.5*n)/(1-n)}return[e[0],n*100,o*100]};Ke.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var o=0;if(n<1){o=(r-n)/(1-n)}return[e[0],n*100,o*100]};Ke.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var o=[0,0,0];var s=t%1*6;var a=s%1;var i=1-a;var l=0;switch(Math.floor(s)){case 0:o[0]=1;o[1]=a;o[2]=0;break;case 1:o[0]=i;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=a;break;case 3:o[0]=0;o[1]=i;o[2]=1;break;case 4:o[0]=a;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=i}l=(1-r)*n;return[(r*o[0]+l)*255,(r*o[1]+l)*255,(r*o[2]+l)*255]};Ke.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var o=0;if(n>0){o=t/n}return[e[0],o*100,n*100]};Ke.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var o=0;if(n>0&&n<.5){o=t/(2*n)}else if(n>=.5&&n<1){o=t/(2*(1-n))}return[e[0],o*100,n*100]};Ke.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};Ke.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var o=n-t;var s=0;if(o<1){s=(n-o)/(1-o)}return[e[0],o*100,s*100]};Ke.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Ke.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Ke.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Ke.gray.hsl=Ke.gray.hsv=function(e){return[0,0,e[0]]};Ke.gray.hwb=function(e){return[0,100,e[0]]};Ke.gray.cmyk=function(e){return[0,0,0,e[0]]};Ke.gray.lab=function(e){return[e[0],0,0]};Ke.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};Ke.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]};var tt=Ge.exports;function rt(){var e={};var t=Object.keys(tt);for(var r=t.length,n=0;n<r;n++){e[t[n]]={distance:-1,parent:null}}return e}function nt(e){var t=rt();var r=[e];t[e].distance=0;while(r.length){var n=r.pop();var o=Object.keys(tt[n]);for(var s=o.length,a=0;a<s;a++){var i=o[a];var l=t[i];if(l.distance===-1){l.distance=t[n].distance+1;l.parent=n;r.unshift(i)}}}return t}function ot(e,t){return function(r){return t(e(r))}}function st(e,t){var r=[t[e].parent,e];var n=tt[t[e].parent][e];var o=t[e].parent;while(t[o].parent){r.unshift(t[o].parent);n=ot(tt[t[o].parent][o],n);o=t[o].parent}n.conversion=r;return n}var at=function(e){var t=nt(e);var r={};var n=Object.keys(t);for(var o=n.length,s=0;s<o;s++){var a=n[s];var i=t[a];if(i.parent===null){continue}r[a]=st(a,t)}return r};var it=Ge.exports;var lt=at;var ct={};var ut=Object.keys(it);function pt(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){t.conversion=e.conversion}return t}function dt(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,o=0;o<n;o++){r[o]=Math.round(r[o])}}return r};if("conversion"in e){t.conversion=e.conversion}return t}ut.forEach((function(e){ct[e]={};Object.defineProperty(ct[e],"channels",{value:it[e].channels});Object.defineProperty(ct[e],"labels",{value:it[e].labels});var t=lt(e);var r=Object.keys(t);r.forEach((function(r){var n=t[r];ct[e][r]=dt(n);ct[e][r].raw=pt(n)}))}));var ft=ct;(function(e){const t=ft;const r=(e,r)=>function(){const n=e.apply(t,arguments);return`[${n+r}m`};const n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`};const o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};function s(){const e=new Map;const s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],gray:[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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.grey=s.color.gray;for(const t of Object.keys(s)){const r=s[t];for(const t of Object.keys(r)){const n=r[t];s[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=s[t];e.set(n[0],n[1])}Object.defineProperty(s,t,{value:r,enumerable:false});Object.defineProperty(s,"codes",{value:e,enumerable:false})}const a=e=>e;const i=(e,t,r)=>[e,t,r];s.color.close="[39m";s.bgColor.close="[49m";s.color.ansi={ansi:r(a,0)};s.color.ansi256={ansi256:n(a,0)};s.color.ansi16m={rgb:o(i,0)};s.bgColor.ansi={ansi:r(a,10)};s.bgColor.ansi256={ansi256:n(a,10)};s.bgColor.ansi16m={rgb:o(i,10)};for(let e of Object.keys(t)){if(typeof t[e]!=="object"){continue}const a=t[e];if(e==="ansi16"){e="ansi"}if("ansi16"in a){s.color.ansi[e]=r(a.ansi16,0);s.bgColor.ansi[e]=r(a.ansi16,10)}if("ansi256"in a){s.color.ansi256[e]=n(a.ansi256,0);s.bgColor.ansi256[e]=n(a.ansi256,10)}if("rgb"in a){s.color.ansi16m[e]=o(a.rgb,0);s.bgColor.ansi16m[e]=o(a.rgb,10)}}return s}Object.defineProperty(e,"exports",{enumerable:true,get:s})})(Ue);var vt=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const o=t.indexOf("--");return n!==-1&&(o===-1?true:n<o)};const ht=B["default"];const mt=vt;const gt=process.env;let bt;if(mt("no-color")||mt("no-colors")||mt("color=false")){bt=false}else if(mt("color")||mt("colors")||mt("color=true")||mt("color=always")){bt=true}if("FORCE_COLOR"in gt){bt=gt.FORCE_COLOR.length===0||parseInt(gt.FORCE_COLOR,10)!==0}function yt(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function wt(e){if(bt===false){return 0}if(mt("color=16m")||mt("color=full")||mt("color=truecolor")){return 3}if(mt("color=256")){return 2}if(e&&!e.isTTY&&bt!==true){return 0}const t=bt?1:0;if(process.platform==="win32"){const e=ht.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in gt){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in gt))||gt.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in gt){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(gt.TEAMCITY_VERSION)?1:0}if(gt.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in gt){const e=parseInt((gt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(gt.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(gt.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(gt.TERM)){return 1}if("COLORTERM"in gt){return 1}if(gt.TERM==="dumb"){return t}return t}function jt(e){const t=wt(e);return yt(t)}var kt={supportsColor:jt,stdout:jt(process.stdout),stderr:jt(process.stderr)};const Ct=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const xt=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const Ot=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const Mt=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const Pt=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function St(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return Pt.get(e)||e}function At(e,t){const r=[];const n=t.trim().split(/\s*,\s*/g);let o;for(const t of n){if(!isNaN(t)){r.push(Number(t))}else if(o=t.match(Ot)){r.push(o[2].replace(Mt,((e,t,r)=>t?St(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function Et(e){xt.lastIndex=0;const t=[];let r;while((r=xt.exec(e))!==null){const e=r[1];if(r[2]){const n=At(e,r[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function Rt(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}var Bt=(e,t)=>{const r=[];const n=[];let o=[];t.replace(Ct,((t,s,a,i,l,c)=>{if(s){o.push(St(s))}else if(i){const t=o.join("");o=[];n.push(r.length===0?t:Rt(e,r)(t));r.push({inverse:a,styles:Et(i)})}else if(l){if(r.length===0){throw new Error("Found extraneous } in Chalk template literal")}n.push(Rt(e,r)(o.join("")));o=[];r.pop()}else{o.push(c)}}));n.push(o.join(""));if(r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};(function(e){const t=ze;const r=Ue.exports;const n=kt.stdout;const o=Bt;const s=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const a=["ansi","ansi","ansi256","ansi16m"];const i=new Set(["gray"]);const l=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};c(t,e);t.template=function(){const e=[].slice.call(arguments);return v.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,u.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=u;return t.template}c(this,e)}if(s){r.blue.open="[94m"}for(const e of Object.keys(r)){r[e].closeRe=new RegExp(t(r[e].close),"g");l[e]={get(){const t=r[e];return d.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}l.visible={get(){return d.call(this,this._styles||[],true,"visible")}};r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi)){if(i.has(e)){continue}l[e]={get(){const t=this.level;return function(){const n=r.color[a[t]][e].apply(null,arguments);const o={open:n,close:r.color.close,closeRe:r.color.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(i.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);l[t]={get(){const t=this.level;return function(){const n=r.bgColor[a[t]][e].apply(null,arguments);const o={open:n,close:r.bgColor.close,closeRe:r.bgColor.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}const p=Object.defineProperties((()=>{}),l);function d(e,t,r){const n=function(){return f.apply(n,arguments)};n._styles=e;n._empty=t;const o=this;Object.defineProperty(n,"level",{enumerable:true,get(){return o.level},set(e){o.level=e}});Object.defineProperty(n,"enabled",{enumerable:true,get(){return o.enabled},set(e){o.enabled=e}});n.hasGrey=this.hasGrey||r==="gray"||r==="grey";n.__proto__=p;return n}function f(){const e=arguments;const t=e.length;let n=String(arguments[0]);if(t===0){return""}if(t>1){for(let r=1;r<t;r++){n+=" "+e[r]}}if(!this.enabled||this.level<=0||!n){return this._empty?"":n}const o=r.dim.open;if(s&&this.hasGrey){r.dim.open=""}for(const e of this._styles.slice().reverse()){n=e.open+n.replace(e.closeRe,e.open)+e.close;n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`)}r.dim.open=o;return n}function v(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const n=[t.raw[0]];for(let e=1;e<t.length;e++){n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));n.push(String(t.raw[e]))}return o(e,n.join(""))}Object.defineProperties(u.prototype,l);e.exports=u();e.exports.supportsColor=n;e.exports.default=e.exports})(We);var $t=We.exports;const qt=async(r,n,s)=>{const a=await e.getPackageDir(__dirname,process.cwd());const i=w.readFileSync(o.join(a,"./templates/main.html"),"utf-8");const l=[];for(const[t]of Object.entries(s.entryMap)){const o=Object.keys(r).includes(t);l.push({name:t.replace(s.projectVirtualPath,"").replace(/^\//,""),link:e.urlJoin(n,["pages",t],{env:"me"}),flagText:o?"serve":"static",isServed:o?1:0})}const c={title:"@flatjs/evolve",modules:l.sort(((e,t)=>t.isServed-e.isServed))};return t.template(i)(c)};const Tt=async(r,n,s,a,i,l)=>{const c=l.entryMap;const u=Object.keys(c).sort(((e,t)=>t.length-e.length));const p=await e.getPackageDir(__dirname,process.cwd());const d=u.find((t=>e.ensureSlash(s.path.replace(/^\//,""),true).startsWith(e.ensureSlash(t,true))));if(!d){const e=w.readFileSync(o.join(p,`./templates/module-404.html`),"utf-8");return t.template(e)({title:"404 Not Found",errorMeta:[{name:`@flatjs/evolve workspace`,value:p},{name:`served entry names`,value:JSON.stringify(u)},{name:`module path`,value:`${s.path}`}]})}const f=c[d];const v=f.options;const h=r[d];const m=(h==null?void 0:h.devServerHostUri)||a;const g=(v==null?void 0:v.serveModuleTemplate)||"./templates/module.html";const b=o.join(l.projectCwd,"./templates/module.html");const y=w.readFileSync(o.isAbsolute(g)?g:e.existsSync(b)?b:o.join(p,"./templates/module.html"),"utf-8");const j=l.forServe;const k=j.defaultServeGlobalData?j.defaultServeGlobalData(f,a):{};const C={title:J("title",n,v==null?void 0:v.title),favicon:J("favicon",n,v==null?void 0:v.favicon),viewport:ie(l,v)?J("viewport",n,v==null?void 0:v.viewport):"",inlineScripts:J("inlineScripts",n,v==null?void 0:v.inlineScripts),headBeforeStyles:J("headBeforeStyles",n,v==null?void 0:v.headBeforeStyles),headBeforeScripts:J("headBeforeScripts",n,v==null?void 0:v.headBeforeScripts),bodyAfterScripts:J("bodyAfterScripts",n,v==null?void 0:v.bodyAfterScripts),moduleFederationScripts:oe({me:[e.urlJoin(a,["public"])]}),global:{hostUrl:a,apiBase:e.urlJoin(a,[i]),routeBaseName:o.join(`/pages`,d),...k,...(v==null?void 0:v.serveGlobalData)||{}},styles:[e.urlJoin(m,[o.join("public",d,"bundle.css")])],scripts:[e.urlJoin(m,[o.join("public",d,"bundle.js")])]};return t.template(y)(C)};const Ft=(e,t,r,n,o)=>{const s=async(s,a)=>{let i;if(s.path==="/"){i=await qt(n,t,o)}else{i=await Tt(n,e,s,t,r,o)}a.send(i)};return(o.forServe.pageMiddlewares||[]).concat(s)};const _t=t=>async(r,n)=>{const s=r.baseUrl;if(!s.startsWith("/public")){n.redirect("/pages")}else{const r=await e.fileWalk(o.join("public/","**/*.{js,css}"),{cwd:t});const a=o.extname(s);const i=r.find((e=>o.extname(e)===a&&e.indexOf(s.replace(/\.(js|css)$/,""))!==-1));if(i){n.sendFile(i)}else{n.sendFile(o.join(t,s))}}};const Dt=(e,t="development",n,o,s,a,i)=>{const l=q["default"]();r.attachMockMiddlewares(l,i);l.set("hostUri",o);l.use("/pages",...Ft(t,o,i.apiContext||"api",s,a));l.use("*",_t(e));return new Promise((e=>{const t=a.https?T["default"].createServer(a.https,l):l;t.listen(n,(()=>{e(true)}))}))};const It=(e,t,r)=>{const{projectCwd:n,https:s,liveReload:a}=r;const i=new $["default"]({server:{type:s?"https":"http",options:{...s}},open:false,compress:true,port:t,hot:!a,liveReload:a,allowedHosts:"all",static:{directory:`${o.join(n,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:true,overlay:{errors:true,warnings:false}}},e);return new Promise(((e,t)=>{i.startCallback((r=>{if(r){return t(r)}e(true)}))}))};const Nt=async(n,s,a,l)=>{await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:a.needVerifyPackages||{}});if(a.https){l.https=a.https}const{mockPort:c,hostUri:u}=await r.prepareMockDomain(l);const p=e.urlJoin(u,["/pages"]);let d=c;const f=[];const v={};for(const[e]of Object.entries(s)){d=d+1;const{mockPort:n,hostUri:o}=await r.prepareMockDomain(t.merge({},l,{port:d}));v[e]={devServerPort:n,devServerHostUri:o}}for(const[t,r]of Object.entries(s)){var h,m;const s=((h=r.options)==null?void 0:(m=h.moduleFederation)==null?void 0:m.remotes)||[];s.forEach((t=>{t.endpoint=t=>{var r;return e.urlJoin(((r=v[t])==null?void 0:r.devServerHostUri)||u,["/public"])}}));const{devServerPort:l,devServerHostUri:c}=v[t];const d=e.urlJoin(c,["public"]);const g={[t]:r};const b=ae(r,a);const y=De("development",d,g,b);const w=i.webpack(se(g,y)[0]);f.push(It(w,l,a));const j=$t.bgBlack(`[${$t.magenta("@flatjs")}:${$t.bold(w.name||"")}]`);w.hooks.invalid.tap("fileChange",(e=>{console.log(j,`${"file change".padEnd(12," ")} ➩ ${$t.cyan(o.relative(n,e||""))}`)}));w.hooks.done.tap("compileDone",(()=>{console.log(j,`${"serve page".padEnd(12," ")} ➩ ${$t.cyan(p)}`)}))}await Dt(n,"development",c,u,v,a,l);ee(p);return Promise.all(f).then((()=>true)).catch((e=>{console.log("evolve serve err: ",e);return false}))};const Wt=async(t,n,o)=>{if(n.https){o.https=n.https}const{mockPort:s,hostUri:a}=await r.prepareMockDomain(o);const i=e.urlJoin(a,["/pages"]);return Dt(t,"development",s,a,{},n,o).then((e=>{const t=$t.bgBlack(`[${$t.magenta("@flatjs")}:`);console.log(t,`${"serve page".padEnd(12," ")} ➩ ${$t.cyan(i)}`);return e}))};const Lt=(e={},r={})=>{const n={};for(const[o,s]of Object.entries(r)){const r={options:{}};if(e[o]){n[o]=t.merge({},r,s,e[o])}t.merge(s,r)}return n};const zt=(e,t,r={})=>{const n=Z(e,r);const o=Lt(t,n.entryMap);return Ne(o,n)};const Ut=(e,t,n={},o={})=>{const s=Z(e,n);const a=r.loadMockConfiguration(e,o);const i=Lt(t,s.entryMap);return Nt(e,i,s,a)};const Gt=(e,t={},n={})=>{const o=Z(e,t);const s=r.loadMockConfiguration(e,n);return Wt(e,o,s)};exports.cdnBoot=z;exports.cdnJsDelivr=L;exports.cdnUnpkg=W;exports.createPageMiddleware=Ft;exports.createPublicAssetsMiddleware=_t;exports.defaultFlatjsConfig=U;exports.evolveBuild=zt;exports.evolveServe=Ut;exports.evolveStatic=Gt;exports.flatBabelOptions=I;exports.flatExternalOptions=G;exports.flatLessLoaderOptions=Y;exports.flatPerformanceOptions=X;exports.flatPostcssLoaderOptions=K;exports.getHtmlPluginConfig=J;exports.loadEvolveConfiguration=Z;exports.loadModule=D;exports.normalizeEntries=Lt;exports.polyfill=N;exports.terserOptions=Q;exports.viewportScripts=H;
|
package/index.d.ts
CHANGED
@@ -400,6 +400,26 @@ export interface FlatEvolveOptions extends Partial<Pick<Configuration, "performa
|
|
400
400
|
minimizeTerserOptions?: RecordAny;
|
401
401
|
/**
|
402
402
|
* Redirect module requests. resolve `alias`
|
403
|
+
* @example
|
404
|
+
* ```ts
|
405
|
+
* "compilerOptions": {
|
406
|
+
* "baseUrl": "./",
|
407
|
+
* "paths": {
|
408
|
+
* "@/*": ["src/*"]
|
409
|
+
* },
|
410
|
+
* }
|
411
|
+
* }
|
412
|
+
* ```
|
413
|
+
* Configd resolve alias as below.
|
414
|
+
* ---
|
415
|
+
* ```ts
|
416
|
+
* {
|
417
|
+
* resolveAlias: {
|
418
|
+
* '@': require('path').join(__dirname, './src'),
|
419
|
+
* }
|
420
|
+
* }
|
421
|
+
*
|
422
|
+
* ```
|
403
423
|
*/
|
404
424
|
resolveAlias?: {
|
405
425
|
[index: string]: string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flatjs/evolve",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.4",
|
4
4
|
"description": "the webpack based tools `evolve` of @flatjs",
|
5
5
|
"keywords": [
|
6
6
|
"shared",
|
@@ -23,10 +23,10 @@
|
|
23
23
|
],
|
24
24
|
"dependencies": {
|
25
25
|
"@babel/core": "^7.17.5",
|
26
|
-
"@flatjs/common": "^1.4.
|
26
|
+
"@flatjs/common": "^1.4.3",
|
27
27
|
"@flatjs/evolve-preset-babel": "^1.3.5",
|
28
28
|
"@flatjs/forge-plugin-postcss-pixel": "^1.3.5",
|
29
|
-
"@flatjs/mock": "^1.4.
|
29
|
+
"@flatjs/mock": "^1.4.4",
|
30
30
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
|
31
31
|
"babel-loader": "^8.2.3",
|
32
32
|
"babel-merge": "^3.0.0",
|
@@ -34,8 +34,8 @@
|
|
34
34
|
"better-opn": "^3.0.2",
|
35
35
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
36
36
|
"css-loader": "^6.7.1",
|
37
|
-
"cssnano": "^5.1.
|
38
|
-
"cssnano-preset-default": "^5.2.
|
37
|
+
"cssnano": "^5.1.4",
|
38
|
+
"cssnano-preset-default": "^5.2.4",
|
39
39
|
"html-webpack-plugin": "^5.5.0",
|
40
40
|
"less": "^4.1.2",
|
41
41
|
"less-loader": "^10.2.0",
|
@@ -63,5 +63,5 @@
|
|
63
63
|
"publishConfig": {
|
64
64
|
"access": "public"
|
65
65
|
},
|
66
|
-
"gitHead": "
|
66
|
+
"gitHead": "fd8f592fa175f6d757937663c3e44a32c596f4e1"
|
67
67
|
}
|