"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NWCompilewxmlService=void 0;const compileUtils_1=require("../node/compileUtils");async function compileUseWCCNode(e){const{files:i,configSplit:o,cwd:l,configContent:n,isCut:c,genfuncName:t,hasWxs:s=!0,isPlugin:a,lazyloadConfig:m,replaceContent:p={}}=e,r=Date.now(),C=require("wcc").wcc,u=await C({files:i,debugWXS:s,debug:!0,genfuncname:t,isPlugin:a,isCut:c,wxmlCompileConfig:n,wxmlCompileConfigSplit:o,replaceContent:p,cwd:l,lazyloadConfig:m});if(console.warn("[wcc-node] compile cost:",Date.now()-r),!m)return{code:u,name:t};const{generateFunctionContent:g,generateFunctionName:w}=u;return{pages:g,names:w}}class NWCompilewxmlService{compileWxml(e){return e.isMiniAppProject||Object.keys(e.replaceContent).length>0?compileUseWCCNode(e):(0,compileUtils_1.compileUseWCC)(e)}async compileWxmlToGlassEasel(e){return await(0,compileUtils_1.compileWxmlToGlassEasel)(e)}}exports.NWCompilewxmlService=NWCompilewxmlService;