"use strict";var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(a,o){function u(e){try{i(r.next(e))}catch(e){o(e)}}function s(e){try{i(r.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,s)}i((r=r.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,r,a,o,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(a=2&o[0]?r.return:o[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;switch(r=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(a=u.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){u.label=o[1];break}if(6===o[0]&&u.label<a[1]){u.label=a[1],a=o;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(o);break}a[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};exports.__esModule=!0;var customAlphabet=require("nanoid").customAlphabet,globby=require("globby"),nPath=require("path"),alphabet="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",getCanvasCompaths_1=__importDefault(require("../../utils/getCanvasCompaths")),CanvasResponse=function(e){var t=e.resultCode,n=e.resultMessage,r=e.data;this.resultCode=t||0,this.resultMessage=n||"",this.data=r||null};module.exports.ResponseFactory=function(){function e(){}return e.build=function(e){return new CanvasResponse(e)},e.success=function(t,n){return e.build({resultMessage:t,resultCode:0,data:n})},e.error=function(t){return e.build({resultMessage:t,resultCode:1})},e}(),module.exports.getModuleInfo=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,t,n,r,a,o;return __generator(this,(function(u){switch(u.label){case 0:return e=process.cwd(),t={staticPaths:[],jsonPaths:[]},[4,(0,getCanvasCompaths_1.default)(e)];case 1:for(n=u.sent(),r=0;r<n.length;r++)a=n[r],require(a).canvas&&(o=nPath.parse(a).dir,t.jsonPaths.push(a),t.staticPaths.push(o));return[2,t]}}))}))},module.exports.generateId=function(e){return void 0===e&&(e=6),customAlphabet(alphabet,e)()};