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