"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OriginalCompileManager=exports.setFSAgent=exports.setLocale=exports.compile=exports.compileJS=exports.packNpmManually=exports.packNpm=exports.mergeThemeJSONToPageJSON=exports.mergeThemeJSONToAppJSON=exports.schemaValidate=exports.getSiteMapJSON=exports.checkThemeJSON=exports.getPluginPageJSON=exports.getPluginJSON=exports.getPageJSON=exports.partialAnalyse=void 0,exports.getAppJSON=getAppJSON,exports.getExtJSON=getExtJSON,exports.getGameJSON=getGameJSON,exports.clearCache=clearCache;const tslib_1=require("tslib"),cache_1=require("../../../utils/cache"),fs_1=require("../../../utils/fs");Object.defineProperty(exports,"setFSAgent",{enumerable:!0,get:function(){return fs_1.setFSAgent}});const locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),index_1=require("./compile/index");Object.defineProperty(exports,"compile",{enumerable:!0,get:function(){return index_1.compile}});const app_1=require("./json/app"),getPageJSON_1=require("./json/page/getPageJSON");Object.defineProperty(exports,"getPageJSON",{enumerable:!0,get:function(){return getPageJSON_1.getPageJSON}});const js_1=require("./compile/handler/js");Object.defineProperty(exports,"compileJS",{enumerable:!0,get:function(){return js_1.compileJS}});const plugin_1=require("./json/plugin/plugin");Object.defineProperty(exports,"getPluginJSON",{enumerable:!0,get:function(){return plugin_1.getDevPluginJSON}});const pluginPage_1=require("./json/plugin/pluginPage");Object.defineProperty(exports,"getPluginPageJSON",{enumerable:!0,get:function(){return pluginPage_1.getPluginPageJSON}});const sitemap_1=require("./json/sitemap");Object.defineProperty(exports,"getSiteMapJSON",{enumerable:!0,get:function(){return sitemap_1.getSiteMapJSON}});const theme_1=require("./json/theme");Object.defineProperty(exports,"checkThemeJSON",{enumerable:!0,get:function(){return theme_1.checkThemeJSON}}),Object.defineProperty(exports,"mergeThemeJSONToAppJSON",{enumerable:!0,get:function(){return theme_1.mergeThemeJSONToAppJSON}}),Object.defineProperty(exports,"mergeThemeJSONToPageJSON",{enumerable:!0,get:function(){return theme_1.mergeThemeJSONToPageJSON}});const schemaValidate_1=require("./validate/schemaValidate");Object.defineProperty(exports,"schemaValidate",{enumerable:!0,get:function(){return schemaValidate_1.schemaValidate}});const reactiveCache_1=require("./json/reactiveCache"),game_1=tslib_1.__importDefault(require("./json/game")),packnpm_1=require("./npm/packnpm");Object.defineProperty(exports,"packNpm",{enumerable:!0,get:function(){return packnpm_1.packNpm}}),Object.defineProperty(exports,"packNpmManually",{enumerable:!0,get:function(){return packnpm_1.packNpmManually}}),exports.partialAnalyse=tslib_1.__importStar(require("./analyse/partial"));const{setLocale:setLocale}=locales_1.default;async function getAppJSON(e){try{const t=(0,reactiveCache_1.tryToGetReactiveProject)(e);return await t.updateProject(),(0,app_1.getAppJSON)(e)}catch(e){throw console.error("getAppJSON error",e),e}}async function getExtJSON(e){try{const t=(0,reactiveCache_1.tryToGetReactiveProject)(e);return await t.updateProject(),(0,app_1.getExtJSON)(e)}catch(e){throw console.error("getAppJSON error",e),e}}async function getGameJSON(e){try{const t=(0,reactiveCache_1.tryToGetReactiveProject)(e);return await t.updateProject(),(0,game_1.default)(e)}catch(e){throw console.error("getGameJSON error",e),e}}function clearCache(){cache_1.cacheManager.clean()}exports.setLocale=setLocale;class OriginalCompileManager{constructor(e){this.getPluginPageJSON=pluginPage_1.getPluginPageJSON,this.schemaValidate=schemaValidate_1.schemaValidate,this.mergeThemeJSONToAppJSON=theme_1.mergeThemeJSONToAppJSON,this.mergeThemeJSONToPageJSON=theme_1.mergeThemeJSONToPageJSON,this.packNpmManually=packnpm_1.packNpmManually,this.clearCache=clearCache,this.setLocale=setLocale,this.setFSAgent=fs_1.setFSAgent,this.project=e}getAppJSON(){return getAppJSON(this.project)}getExtJSON(){return getExtJSON(this.project)}getPageJSON(e){return(0,getPageJSON_1.getPageJSON)(this.project,e)}getGameJSON(){return getGameJSON(this.project)}getPluginJSON(...e){return(0,plugin_1.getDevPluginJSON)(this.project,...e)}checkThemeJSON(e){return(0,theme_1.checkThemeJSON)(this.project,e)}getSiteMapJSON(){return(0,sitemap_1.getSiteMapJSON)(this.project)}async packNpm(...e){return await(0,packnpm_1.packNpm)(this.project,...e)}async compileJS(e,t){return await(0,js_1.compileJS)(this.project,e,t)}async compile(e){return await(0,index_1.compile)(this.project,e)}}exports.OriginalCompileManager=OriginalCompileManager;