Built motion from commit 0ad9c269e.|1.0.31
[motion.git] / server / api / custom_report / custom_report.controller.js
index b3c9c6a..266d0af 100644 (file)
@@ -1 +1 @@
-var _0xb01b=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x4D\x65\x74\x72\x69\x63","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x62\x75\x69\x6C\x64","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x6D\x6F\x6D\x65\x6E\x74","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x67\x65\x74\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x72\x79","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x71\x75\x65\x72\x79\x20\x66\x72\x6F\x6D\x20\x61\x70\x69\x3A","\x6C\x6F\x67","\x6E\x6F\x20\x73\x75\x66\x66\x69\x63\x69\x65\x6E\x74\x20\x71\x75\x65\x75\x65\x20\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x75\x73\x65\x72","\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E","\x61\x6C\x6C","\x62\x75\x69\x6C\x64\x51\x75\x65\x72\x79","\x73\x70\x72\x65\x61\x64","\x75\x73\x65\x72","\x62\x75\x69\x6C\x64\x46\x69\x6C\x74\x65\x72","\x66\x6F\x75\x6E\x64\x20\x72\x65\x70\x6F\x72\x74","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x64\x61\x69\x6C\x79","\x74\x72\x75\x65","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x65\x6E\x64\x44\x61\x74\x65","\x74\x61\x62\x6C\x65","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x5F\x68\x69\x73\x74\x6F\x72\x79","","\x72\x65\x70\x6C\x61\x63\x65","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x70\x72\x65\x76\x69\x65\x77","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x6F\x66\x66\x73\x65\x74","\x73\x6C\x69\x63\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x4F\x77\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x68\x65\x63\x6B\x51\x75\x65\x72\x79","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66","\x50\x44\x46","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76","\x43\x53\x56","\x64\x65\x73\x74\x72\x6F\x79\x4E\x6F\x64\x65\x52\x65\x70\x6F\x72\x74\x73","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x66\x69\x6E\x64","\x4E\x6F\x64\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x70\x75\x73\x68","\x66\x69\x6C\x74\x65\x72","\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x2E\x6A\x73","\x66\x6F\x72\x6B","\x65\x72\x72\x6F\x72","\x63\x68\x69\x6C\x64\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x63\x68\x69\x6C\x64\x20\x63\x6C\x6F\x73\x65","\x6D\x65\x73\x73\x61\x67\x65","\x63\x68\x69\x6C\x64\x20\x6D\x65\x73\x73\x61\x67\x65","\x6B\x69\x6C\x6C","\x70\x61\x72\x65\x6E\x74","\x6E\x61\x6D\x65","\x73\x74\x61\x72\x74\x54\x69\x6D\x65","\x20","\x30\x30\x3A\x30\x30","\x65\x6E\x64\x54\x69\x6D\x65","\x32\x33\x3A\x35\x39","\x63\x72\x65\x61\x74\x65","\x74\x65\x78\x74","\x2F\x20","\x23","\x73\x68\x6F\x77","\x65\x78\x70\x6F\x72\x74","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x63\x6F\x70\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x62\x6F\x64\x79","\x6D\x61\x70","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x46\x69\x65\x6C\x64\x73","\x69\x6D\x70\x6F\x72\x74","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x67\x65\x74\x54\x61\x62\x6C\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x4D\x65\x74\x72\x69\x63\x49\x64","\x66\x69\x65\x6C\x64","\x6D\x65\x74\x72\x69\x63","\x54\x68\x65\x20\x6D\x65\x74\x72\x69\x63\x20\x77\x69\x74\x68\x20\x69\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x63\x75\x73\x74\x6F\x6D","\x54\x68\x65\x20\x66\x69\x65\x6C\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65","\x6B\x65\x79\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x59\x6F\x75\x20\x68\x61\x76\x65\x20\x6E\x6F\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x6F\x72\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63\x49\x64","\x68\x61\x73","\x65\x76\x65\x72\x79","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63","\x55\x6E\x73\x75\x70\x70\x6F\x72\x74\x65\x64\x20\x49\x6D\x70\x6F\x72\x74\x20\x66\x6F\x72\x6D\x61\x74\x20\x28\x4D\x65\x74\x72\x69\x63\x20\x74\x79\x70\x65\x20\x69\x6E\x20\x72\x65\x70\x6F\x72\x74\x20\x66\x69\x65\x6C\x64\x73\x20\x69\x73\x20\x6D\x69\x73\x73\x69\x6E\x67\x29","\x49\x64","\x67\x72\x6F\x75\x70\x42\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6E\x75\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x5F","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xb01b[0];var _=require(_0xb01b[1]);var util=require(_0xb01b[2]);var sequelize=require(_0xb01b[4])[_0xb01b[3]];var CustomReport=require(_0xb01b[4])[_0xb01b[5]];var ReportField=require(_0xb01b[4])[_0xb01b[6]];var Metric=require(_0xb01b[4])[_0xb01b[7]];var ExtractedReport=require(_0xb01b[4])[_0xb01b[8]];var extractUtils=require(_0xb01b[9]);var reportBuildUtils=require(_0xb01b[10]);var Util=require(_0xb01b[11]);var sr=require(_0xb01b[12]);var moment=require(_0xb01b[13]);var cp=require(_0xb01b[14]);var ReportTree=require(_0xb01b[4])[_0xb01b[15]];exports[_0xb01b[16]]= function(_0xab0fxf,_0xab0fx10,_0xab0fx11){return CustomReport[_0xb01b[23]](Util[_0xb01b[22]](_0xab0fxf[_0xb01b[21]],{deletedAt:null}))[_0xb01b[20]](function(_0xab0fx13){_0xab0fx10[_0xb01b[19]](200)[_0xb01b[18]](_0xab0fx13)})[_0xb01b[17]](function(_0xab0fx12){return handleError(_0xab0fx10,_0xab0fx12)})};exports[_0xb01b[24]]= function(_0xab0fxf,_0xab0fx10){return Promise[_0xb01b[29]]([])[_0xb01b[20]](getQuery(_0xab0fxf,_0xab0fx10))[_0xb01b[20]](function(_0xab0fx14){if(_0xab0fx14){switch(_0xab0fx14){case _0xb01b[28]:_0xab0fx14= _0xb01b[27];break;default:}};_0xab0fx10[_0xb01b[19]](200)[_0xb01b[18]]({query:_0xab0fx14})})[_0xb01b[17]](function(_0xab0fx12){console[_0xb01b[26]](_0xb01b[25],_0xab0fx12)})};function getQuery(_0xab0fxf,_0xab0fx10){var _0xab0fx16;return function(){return CustomReport[_0xb01b[51]](_0xb01b[50])[_0xb01b[49]](_0xab0fxf[_0xb01b[48]][_0xb01b[47]])[_0xb01b[20]](function(_0xab0fx18){console[_0xb01b[26]](_0xb01b[34]);if(!_0xab0fx18){return _0xab0fx10[_0xb01b[35]](404)};if(_0xab0fxf[_0xb01b[21]][_0xb01b[36]]&& _0xab0fxf[_0xb01b[21]][_0xb01b[36]]=== _0xb01b[37]){_0xab0fxf[_0xb01b[21]][_0xb01b[38]]= moment()[_0xb01b[40]](_0xb01b[39]);_0xab0fxf[_0xb01b[21]][_0xb01b[41]]= moment()[_0xb01b[40]](_0xb01b[39]);_0xab0fx18[_0xb01b[43]][_0xb01b[42]]= _0xab0fx18[_0xb01b[43]][_0xb01b[42]][_0xb01b[46]](_0xb01b[44],_0xb01b[45])};delete _0xab0fxf[_0xb01b[21]][_0xb01b[36]];_0xab0fx16= _0xab0fx18[_0xb01b[43]];return _0xab0fx16[_0xb01b[42]]})[_0xb01b[20]](reportBuildUtils[_0xb01b[33]](_0xab0fxf[_0xb01b[32]]))[_0xb01b[20]](function(_0xab0fx17){return [_0xab0fx17,_0xab0fx16]})[_0xb01b[31]](reportBuildUtils[_0xb01b[30]](_0xab0fxf[_0xb01b[21]]))}}exports[_0xb01b[52]]= function(_0xab0fxf,_0xab0fx10){var _0xab0fx19;return Promise[_0xb01b[29]]([])[_0xb01b[20]](getQuery(_0xab0fxf,_0xab0fx10))[_0xb01b[20]](reportBuildUtils[_0xb01b[64]]())[_0xb01b[20]](function(_0xab0fx1a){if(_0xab0fx1a&& _[_0xb01b[53]](_0xab0fx1a)){_0xab0fx19= _0xab0fx1a[_0xb01b[54]];if(_0xab0fxf[_0xb01b[21]][_0xb01b[55]]){_0xab0fx1a= _(_0xab0fx1a)[_0xb01b[59]](_0xab0fxf[_0xb01b[21]][_0xb01b[58]]|| 0)[_0xb01b[57]](_0xab0fxf[_0xb01b[21]][_0xb01b[55]])[_0xb01b[56]]()};_[_0xb01b[62]](_0xab0fx1a,function(_0xab0fx1b){_[_0xb01b[61]](_0xab0fx1b,function(_0xab0fx1c,_0xab0fx1d){if(_0xab0fx1c instanceof  Date){_0xab0fx1b[_0xab0fx1d]= moment(_0xab0fx1c)[_0xb01b[40]](_0xb01b[60]).toString()}})});_0xab0fx10[_0xb01b[19]](200)[_0xb01b[18]]({rows:_0xab0fx1a,count:_0xab0fx19})}else {return handleError(_0xab0fx10,{message:_0xab0fx1a|| _0xb01b[63]})}})[_0xb01b[17]](function(_0xab0fx12){console[_0xb01b[26]](_0xab0fx12);return handleError(_0xab0fx10,_0xab0fx12)})};exports[_0xb01b[65]]= function(_0xab0fxf,_0xab0fx10){docExtract(_0xab0fxf,_0xab0fx10,_0xb01b[66])};exports[_0xb01b[67]]= function(_0xab0fxf,_0xab0fx10){docExtract(_0xab0fxf,_0xab0fx10,_0xb01b[68])};exports[_0xb01b[69]]= function(_0xab0fxf,_0xab0fx10){return ReportTree[_0xb01b[49]](2)[_0xb01b[20]](function(_0xab0fx1e){_0xab0fx1e= JSON[_0xb01b[71]](_0xab0fx1e[_0xb01b[70]]);var _0xab0fx1f=_[_0xb01b[72]](_0xab0fx1e,{id:_0xab0fxf[_0xb01b[48]][_0xb01b[47]]});if(!_0xab0fx1f){throw  new Error(_0xb01b[73])};var _0xab0fx20=[];findSubNodes(_0xab0fx1f,_0xab0fx1e,_0xab0fx20);return CustomReport[_0xb01b[74]]({where:{parent:_0xab0fx20},individualHooks:true})})[_0xb01b[20]](function(){return _0xab0fx10[_0xb01b[35]](200)})[_0xb01b[17]](function(_0xab0fx12){console[_0xb01b[26]](_0xab0fx12);return handleError(_0xab0fx10,_0xab0fx12)})};function findSubNodes(_0xab0fx1f,_0xab0fx1e,_0xab0fx22){_0xab0fx22[_0xb01b[75]](_0xab0fx1f[_0xb01b[47]]);var _0xab0fx23=_[_0xb01b[76]](_0xab0fx1e,{parent:_0xab0fx1f[_0xb01b[47]]});if(!_0xab0fx23|| !_0xab0fx23[_0xb01b[54]]){return};_[_0xb01b[62]](_0xab0fx23,function(_0xab0fx24){findSubNodes(_0xab0fx24,_0xab0fx1e,_0xab0fx22)})}function docExtract(_0xab0fxf,_0xab0fx10,_0xab0fx26){var _0xab0fx18;CustomReport[_0xb01b[51]](_0xb01b[50])[_0xb01b[49]](_0xab0fxf[_0xb01b[48]][_0xb01b[47]])[_0xb01b[20]](function(_0xab0fx16){if(!_0xab0fx16){return _0xab0fx10[_0xb01b[35]](404)};_0xab0fx18= _0xab0fx16;return ReportTree[_0xb01b[49]](2)})[_0xb01b[20]](function(_0xab0fx1e){_0xab0fx1e= JSON[_0xb01b[71]](_0xab0fx1e[_0xb01b[70]]);var _0xab0fx2a=_[_0xb01b[72]](_0xab0fx1e,{id:_0xab0fx18[_0xb01b[87]]});var _0xab0fx2b=getReportPath(_0xab0fx2a,_0xab0fx1e,_0xab0fx18[_0xb01b[88]]);if(_0xab0fxf[_0xb01b[21]][_0xb01b[36]]&& _0xab0fxf[_0xb01b[21]][_0xb01b[36]]=== _0xb01b[37]){_0xab0fxf[_0xb01b[21]][_0xb01b[38]]= moment()[_0xb01b[40]](_0xb01b[39]);_0xab0fxf[_0xb01b[21]][_0xb01b[41]]= moment()[_0xb01b[40]](_0xb01b[39]);_0xab0fx18[_0xb01b[43]][_0xb01b[42]]= _0xab0fx18[_0xb01b[43]][_0xb01b[42]][_0xb01b[46]](_0xb01b[44],_0xb01b[45])};delete _0xab0fxf[_0xb01b[21]][_0xb01b[36]];return [_0xab0fx18,ExtractedReport[_0xb01b[94]]({name:_0xab0fx2b,startDate:_0xab0fxf[_0xb01b[21]][_0xb01b[38]]?_0xab0fxf[_0xb01b[21]][_0xb01b[38]]+ (_0xab0fxf[_0xb01b[21]][_0xb01b[89]]?_0xb01b[90]+ _0xab0fxf[_0xb01b[21]][_0xb01b[89]]:_0xb01b[91]):null,endDate:_0xab0fxf[_0xb01b[21]][_0xb01b[41]]?_0xab0fxf[_0xb01b[21]][_0xb01b[41]]+ (_0xab0fxf[_0xb01b[21]][_0xb01b[92]]?_0xb01b[90]+ _0xab0fxf[_0xb01b[21]][_0xb01b[92]]:_0xb01b[93]):null,output:_0xab0fx26,UserId:_0xab0fxf[_0xb01b[32]][_0xb01b[47]]})]})[_0xb01b[31]](function(_0xab0fx18,_0xab0fx27){var _0xab0fx28=cp[_0xb01b[78]](__dirname+ _0xb01b[77]);_0xab0fx28[_0xb01b[81]](_0xb01b[84],function(_0xab0fx29){console[_0xb01b[26]](_0xb01b[85],_0xab0fx29);_0xab0fx28[_0xb01b[86]]()})[_0xb01b[81]](_0xb01b[82],function(){console[_0xb01b[26]](_0xb01b[83])})[_0xb01b[81]](_0xb01b[79],function(_0xab0fx12){console[_0xb01b[26]](_0xb01b[80],_0xab0fx12)});_0xab0fx28[_0xb01b[18]]({report:_0xab0fx18,query:_0xab0fxf[_0xb01b[21]],extractedId:_0xab0fx27[_0xb01b[47]],user:_0xab0fxf[_0xb01b[32]],type:_0xab0fx26})})[_0xb01b[17]](function(_0xab0fx12){console[_0xb01b[26]](_0xab0fx12);return handleError(_0xab0fx10,_0xab0fx12)});return _0xab0fx10[_0xb01b[35]](200)}function getReportPath(_0xab0fx2a,_0xab0fx1e,_0xab0fx2b){_0xab0fx2b= _0xab0fx2a[_0xb01b[95]]+ _0xb01b[96]+ _0xab0fx2b;if(_0xab0fx2a[_0xb01b[87]]=== _0xb01b[97]){return _0xab0fx2b}else {return getReportPath(_[_0xb01b[72]](_0xab0fx1e,{id:_0xab0fx2a[_0xb01b[87]]}),_0xab0fx1e,_0xab0fx2b)}}exports[_0xb01b[98]]= function(_0xab0fxf,_0xab0fx10){return CustomReport[_0xb01b[51]](_0xb01b[50])[_0xb01b[49]](_0xab0fxf[_0xb01b[48]][_0xb01b[47]])[_0xb01b[20]](function(_0xab0fx18){if(!_0xab0fx18){return _0xab0fx10[_0xb01b[35]](404)};return _0xab0fx10[_0xb01b[18]](_0xab0fx18)})[_0xb01b[17]](function(_0xab0fx12){return handleError(_0xab0fx10,_0xab0fx12)})};exports[_0xb01b[99]]= function(_0xab0fxf,_0xab0fx10){return CustomReport[_0xb01b[51]]({method:[_0xb01b[102],{CustomReportId:_0xab0fxf[_0xb01b[48]][_0xb01b[47]]}]})[_0xb01b[49]](_0xab0fxf[_0xb01b[48]][_0xb01b[47]],{attributes:[_0xb01b[100],_0xb01b[101],_0xb01b[88],_0xb01b[87],_0xb01b[42]]})[_0xb01b[20]](function(_0xab0fx18){if(!_0xab0fx18){return _0xab0fx10[_0xb01b[35]](404)};return _0xab0fx10[_0xb01b[18]](_0xab0fx18)})[_0xb01b[17]](function(_0xab0fx12){return handleError(_0xab0fx10,_0xab0fx12)})};exports[_0xb01b[103]]= function(_0xab0fxf,_0xab0fx10){var _0xab0fx2d;return sequelize[_0xb01b[108]](function(_0xab0fx2e){return CustomReport[_0xb01b[51]](_0xb01b[50])[_0xb01b[49]](_0xab0fxf[_0xb01b[48]][_0xb01b[47]])[_0xb01b[20]](function(_0xab0fx18){if(!_0xab0fx18){return _0xab0fx10[_0xb01b[35]](404)};var _0xab0fx2f=_0xab0fx18[_0xb01b[43]];delete _0xab0fx2f[_0xb01b[47]];delete _0xab0fx2f[_0xb01b[104]];delete _0xab0fx2f[_0xb01b[105]];_0xab0fx2f[_0xb01b[87]]= _0xab0fxf[_0xb01b[106]][_0xb01b[87]];_0xab0fx2d= _[_0xb01b[107]](_0xab0fx2f.Fields,_0xb01b[43]);return CustomReport[_0xb01b[94]](_0xab0fx2f,{transaction:_0xab0fx2e})})[_0xb01b[20]](function(_0xab0fx18){return [_0xab0fx18,_0xab0fx2d]})[_0xb01b[31]](createFields(_0xab0fx2e))})[_0xb01b[20]](function(){return _0xab0fx10[_0xb01b[35]](201)})[_0xb01b[17]](function(_0xab0fx12){console[_0xb01b[26]](_0xab0fx12);return handleError(_0xab0fx10,_0xab0fx12)})};exports[_0xb01b[94]]= function(_0xab0fxf,_0xab0fx10){var _0xab0fx16;return sequelize[_0xb01b[108]](function(_0xab0fx2e){return CustomReport[_0xb01b[94]](_0xab0fxf[_0xb01b[106]],{transaction:_0xab0fx2e})[_0xb01b[20]](function(_0xab0fx18){_0xab0fx16= _0xab0fx18;return [_0xab0fx16,_0xab0fxf[_0xb01b[106]][_0xb01b[109]]]})[_0xb01b[31]](createFields(_0xab0fx2e))})[_0xb01b[20]](function(){return _0xab0fx10[_0xb01b[19]](201)[_0xb01b[18]](_0xab0fx16)})[_0xb01b[17]](function(_0xab0fx12){console[_0xb01b[26]](_0xab0fx12);return handleError(_0xab0fx10,_0xab0fx12)})};exports[_0xb01b[110]]= function(_0xab0fxf,_0xab0fx10){var _0xab0fx16;return sequelize[_0xb01b[108]](function(_0xab0fx2e){return CustomReport[_0xb01b[94]](_0xab0fxf[_0xb01b[106]],{transaction:_0xab0fx2e})[_0xb01b[20]](function(_0xab0fx18){_0xab0fx16= _0xab0fx18;return [_0xab0fx16,_0xab0fxf[_0xb01b[106]][_0xb01b[109]]]})[_0xb01b[31]](createImportFields(_0xab0fx2e))})[_0xb01b[20]](function(){return _0xab0fx10[_0xb01b[19]](201)[_0xb01b[18]](_0xab0fx16)})[_0xb01b[17]](function(_0xab0fx12){console[_0xb01b[26]](_0xab0fx12);return handleError(_0xab0fx10,_0xab0fx12)})};exports[_0xb01b[111]]= function(_0xab0fxf,_0xab0fx10,_0xab0fx11){if(_0xab0fxf[_0xb01b[106]][_0xb01b[47]]){delete _0xab0fxf[_0xb01b[106]][_0xb01b[47]]};var _0xab0fx16;return sequelize[_0xb01b[108]](function(_0xab0fx2e){return CustomReport[_0xb01b[49]](_0xab0fxf[_0xb01b[48]][_0xb01b[47]])[_0xb01b[20]](function(_0xab0fx18){if(!_0xab0fx18){return _0xab0fx10[_0xb01b[35]](404)};var _0xab0fx30=_[_0xb01b[112]](_0xab0fx18,_0xab0fxf[_0xb01b[106]]);return _0xab0fx18[_0xb01b[113]]({transaction:_0xab0fx2e})})[_0xb01b[20]](function(_0xab0fx18){_0xab0fx16= _0xab0fx18;if(_0xab0fxf[_0xb01b[106]][_0xb01b[109]]){return ReportField[_0xb01b[74]]({where:{CustomReportId:_0xab0fxf[_0xb01b[48]][_0xb01b[47]]},transaction:_0xab0fx2e})}})[_0xb01b[20]](function(){return [_0xab0fx16,_0xab0fxf[_0xb01b[106]][_0xb01b[109]]]})[_0xb01b[31]](createFields(_0xab0fx2e))})[_0xb01b[20]](function(){return _0xab0fx10[_0xb01b[35]](200)})[_0xb01b[17]](function(_0xab0fx12){console[_0xb01b[26]](_0xab0fx12);return handleError(_0xab0fx10,_0xab0fx12)})};function createFields(_0xab0fx2e){return function(_0xab0fx18,_0xab0fx32){if(_0xab0fx32&& Array[_0xb01b[53]](_0xab0fx32)&& _0xab0fx32[_0xb01b[54]]){var _0xab0fx33=reportBuildUtils[_0xb01b[114]](_0xab0fx18[_0xb01b[42]]);if(_0xab0fx33){var _0xab0fx34;return _0xab0fx33[_0xb01b[127]]()[_0xb01b[20]](function(_0xab0fx39){_0xab0fx34= _[_0xb01b[125]](_0xab0fx39);return Metric[_0xb01b[126]]()})[_0xb01b[20]](function(_0xab0fx35){var _0xab0fx36=[];_0xab0fx35= _[_0xb01b[107]](_0xab0fx35,_0xb01b[43]);_0xab0fx32[_0xb01b[62]](function(_0xab0fx37){_0xab0fx37[_0xb01b[115]]= _0xab0fx18[_0xb01b[47]];if(_0xab0fx37[_0xb01b[116]]){var _0xab0fx38=_[_0xb01b[72]](_0xab0fx35,{id:_0xab0fx37[_0xb01b[116]]});if(_0xab0fx38){_0xab0fx37[_0xb01b[117]]= _0xab0fx38[_0xb01b[118]];_0xab0fx36[_0xb01b[75]](ReportField[_0xb01b[94]](_0xab0fx37,{transaction:_0xab0fx2e}))}else {throw  new sequelize.Error(_0xb01b[119]+ _0xab0fx37[_0xb01b[116]]+ _0xb01b[120])}}else {if(_[_0xb01b[121]](_0xab0fx34,_0xab0fx37[_0xb01b[117]])|| _0xab0fx37[_0xb01b[122]]){_0xab0fx36[_0xb01b[75]](ReportField[_0xb01b[94]](_0xab0fx37,{transaction:_0xab0fx2e}))}else {throw  new sequelize.Error(_0xb01b[123]+ _0xab0fx37[_0xb01b[117]]+ _0xb01b[124])}}});return _0xab0fx36})[_0xb01b[29]]()}else {throw  new sequelize.Error(_0xb01b[128])}}}}function createImportFields(_0xab0fx2e){return function(_0xab0fx18,_0xab0fx32){if(_0xab0fx32&& Array[_0xb01b[53]](_0xab0fx32)&& _0xab0fx32[_0xb01b[54]]){var _0xab0fx33=reportBuildUtils[_0xb01b[114]](_0xab0fx18[_0xb01b[42]]);if(_0xab0fx33){var _0xab0fx34;return _0xab0fx33[_0xb01b[127]]()[_0xb01b[20]](function(_0xab0fx39){_0xab0fx34= _[_0xb01b[125]](_0xab0fx39);var _0xab0fx36=[];var _0xab0fx3b;if(_[_0xb01b[131]](_0xab0fx32,function(_0xab0fx37){return _[_0xb01b[130]](_0xab0fx37,_0xb01b[129])})){_0xab0fx3b= _0xb01b[132]}else {if(_[_0xb01b[131]](_0xab0fx32,function(_0xab0fx37){return _[_0xb01b[130]](_0xab0fx37,_0xb01b[116])})){_0xab0fx3b= _0xb01b[7]}else {throw  new sequelize.Error(_0xb01b[133])}};var _0xab0fx3c=_[_0xb01b[135]](_0xab0fx32,_0xab0fx3b+ _0xb01b[134]);_[_0xb01b[61]](_0xab0fx3c,function(_0xab0fx3d,_0xab0fx1d){if(_0xab0fx1d!== _0xb01b[136]&& _0xab0fx1d!== _0xb01b[137]){_0xab0fx3d[0][_0xab0fx3b][_0xb01b[138]][_0xb01b[62]](function(_0xab0fx37){_0xab0fx37[_0xb01b[115]]= _0xab0fx18[_0xb01b[47]]});_0xab0fx3d[0][_0xab0fx3b][_0xb01b[88]]+= _0xb01b[139]+ sr({length:5});_0xab0fx36[_0xb01b[75]](Metric[_0xb01b[94]](_0xab0fx3d[0][_0xab0fx3b],{include:[{model:ReportField,as:_0xb01b[138]}],transaction:_0xab0fx2e}))}else {_0xab0fx3d[_0xb01b[62]](function(_0xab0fx37){if(_[_0xb01b[121]](_0xab0fx34,_0xab0fx37[_0xb01b[117]])|| _0xab0fx37[_0xb01b[122]]){_0xab0fx37[_0xb01b[115]]= _0xab0fx18[_0xb01b[47]];_0xab0fx36[_0xb01b[75]](ReportField[_0xb01b[94]](_0xab0fx37,{transaction:_0xab0fx2e}))}else {throw  new sequelize.Error(_0xb01b[123]+ _0xab0fx37[_0xb01b[117]]+ _0xb01b[124])}})}});return _0xab0fx36})[_0xb01b[29]]()}else {throw  new sequelize.Error(_0xb01b[128])}}}}exports[_0xb01b[74]]= function(_0xab0fxf,_0xab0fx10){return CustomReport[_0xb01b[49]](_0xab0fxf[_0xb01b[48]][_0xb01b[47]])[_0xb01b[20]](function(_0xab0fx18){if(!_0xab0fx18){return _0xab0fx10[_0xb01b[35]](404)};return _0xab0fx18[_0xb01b[74]]()})[_0xb01b[20]](function(){return _0xab0fx10[_0xb01b[35]](204)})[_0xb01b[17]](function(_0xab0fx12){return handleError(_0xab0fx10,_0xab0fx12)})};exports[_0xb01b[140]]= function(_0xab0fxf,_0xab0fx10){return CustomReport[_0xb01b[74]]({where:{id:_0xab0fxf[_0xb01b[21]][_0xb01b[141]]},individualHooks:true})[_0xb01b[20]](function(){return _0xab0fx10[_0xb01b[35]](204)})[_0xb01b[17]](function(_0xab0fx12){return handleError(_0xab0fx10,_0xab0fx12)})};function handleError(_0xab0fx10,_0xab0fx12){return _0xab0fx10[_0xb01b[19]](500)[_0xb01b[18]](_0xab0fx12)}
\ No newline at end of file
+var _0x3f5a=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x4D\x65\x74\x72\x69\x63","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x62\x75\x69\x6C\x64","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x6D\x6F\x6D\x65\x6E\x74","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x67\x65\x74\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x72\x79","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x71\x75\x65\x72\x79\x20\x66\x72\x6F\x6D\x20\x61\x70\x69\x3A","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x6E\x6F\x20\x73\x75\x66\x66\x69\x63\x69\x65\x6E\x74\x20\x71\x75\x65\x75\x65\x20\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x75\x73\x65\x72","\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E","\x61\x6C\x6C","\x62\x75\x69\x6C\x64\x51\x75\x65\x72\x79","\x73\x70\x72\x65\x61\x64","\x75\x73\x65\x72","\x62\x75\x69\x6C\x64\x46\x69\x6C\x74\x65\x72","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x64\x61\x69\x6C\x79","\x74\x72\x75\x65","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x65\x6E\x64\x44\x61\x74\x65","\x74\x61\x62\x6C\x65","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x5F\x68\x69\x73\x74\x6F\x72\x79","","\x72\x65\x70\x6C\x61\x63\x65","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x70\x72\x65\x76\x69\x65\x77","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x6F\x66\x66\x73\x65\x74","\x73\x6C\x69\x63\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x4F\x77\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x68\x65\x63\x6B\x51\x75\x65\x72\x79","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x64\x65\x62\x75\x67","\x50\x44\x46","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x53\x56","\x64\x65\x73\x74\x72\x6F\x79\x4E\x6F\x64\x65\x52\x65\x70\x6F\x72\x74\x73","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x66\x69\x6E\x64","\x4E\x6F\x64\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x70\x75\x73\x68","\x66\x69\x6C\x74\x65\x72","\x63\x6F\x6D\x6D\x6F\x6E\x20\x64\x6F\x63\x45\x78\x74\x72\x61\x63\x74\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x72\x65\x61\x74\x65\x64\x20\x6E\x65\x77\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x20\x64\x62\x20\x65\x6E\x74\x72\x79\x2C\x20\x63\x61\x6C\x6C\x69\x6E\x67\x20\x65\x78\x74\x65\x72\x6E\x61\x6C\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x3A\x20","\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x2E\x6A\x73","\x66\x6F\x72\x6B","\x52\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x52\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x63\x6C\x6F\x73\x65","\x6D\x65\x73\x73\x61\x67\x65","\x52\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x6D\x65\x73\x73\x61\x67\x65","\x6B\x69\x6C\x6C","\x70\x61\x72\x65\x6E\x74","\x6E\x61\x6D\x65","\x46\x6F\x75\x6E\x64\x20\x74\x68\x65\x20\x72\x65\x70\x6F\x72\x74\x2C\x20\x63\x72\x65\x61\x74\x69\x6E\x67\x20\x74\x68\x65\x20\x6E\x65\x77\x20\x44\x42\x20\x72\x6F\x77\x20\x66\x6F\x72\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x2E\x2E","\x73\x74\x61\x72\x74\x54\x69\x6D\x65","\x20","\x30\x30\x3A\x30\x30","\x65\x6E\x64\x54\x69\x6D\x65","\x32\x33\x3A\x35\x39","\x63\x72\x65\x61\x74\x65","\x74\x65\x78\x74","\x2F\x20","\x23","\x73\x68\x6F\x77","\x65\x78\x70\x6F\x72\x74","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x63\x6F\x70\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x62\x6F\x64\x79","\x6D\x61\x70","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x46\x69\x65\x6C\x64\x73","\x69\x6D\x70\x6F\x72\x74","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x67\x65\x74\x54\x61\x62\x6C\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x4D\x65\x74\x72\x69\x63\x49\x64","\x66\x69\x65\x6C\x64","\x6D\x65\x74\x72\x69\x63","\x54\x68\x65\x20\x6D\x65\x74\x72\x69\x63\x20\x77\x69\x74\x68\x20\x69\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x63\x75\x73\x74\x6F\x6D","\x54\x68\x65\x20\x66\x69\x65\x6C\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65","\x6B\x65\x79\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x59\x6F\x75\x20\x68\x61\x76\x65\x20\x6E\x6F\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x6F\x72\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63\x49\x64","\x68\x61\x73","\x65\x76\x65\x72\x79","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63","\x55\x6E\x73\x75\x70\x70\x6F\x72\x74\x65\x64\x20\x49\x6D\x70\x6F\x72\x74\x20\x66\x6F\x72\x6D\x61\x74\x20\x28\x4D\x65\x74\x72\x69\x63\x20\x74\x79\x70\x65\x20\x69\x6E\x20\x72\x65\x70\x6F\x72\x74\x20\x66\x69\x65\x6C\x64\x73\x20\x69\x73\x20\x6D\x69\x73\x73\x69\x6E\x67\x29","\x49\x64","\x67\x72\x6F\x75\x70\x42\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6E\x75\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x5F","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0x3f5a[0];var _=require(_0x3f5a[1]);var util=require(_0x3f5a[2]);var sequelize=require(_0x3f5a[4])[_0x3f5a[3]];var CustomReport=require(_0x3f5a[4])[_0x3f5a[5]];var ReportField=require(_0x3f5a[4])[_0x3f5a[6]];var Metric=require(_0x3f5a[4])[_0x3f5a[7]];var ExtractedReport=require(_0x3f5a[4])[_0x3f5a[8]];var extractUtils=require(_0x3f5a[9]);var reportBuildUtils=require(_0x3f5a[10]);var Util=require(_0x3f5a[11]);var sr=require(_0x3f5a[12]);var moment=require(_0x3f5a[13]);var cp=require(_0x3f5a[14]);var ReportTree=require(_0x3f5a[4])[_0x3f5a[15]];var logger=require(_0x3f5a[17])(_0x3f5a[16]);exports[_0x3f5a[18]]= function(_0xc5dbx10,_0xc5dbx11,_0xc5dbx12){return CustomReport[_0x3f5a[25]](Util[_0x3f5a[24]](_0xc5dbx10[_0x3f5a[23]],{deletedAt:null}))[_0x3f5a[22]](function(_0xc5dbx14){_0xc5dbx11[_0x3f5a[21]](200)[_0x3f5a[20]](_0xc5dbx14)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};exports[_0x3f5a[26]]= function(_0xc5dbx10,_0xc5dbx11){return Promise[_0x3f5a[32]]([])[_0x3f5a[22]](getQuery(_0xc5dbx10,_0xc5dbx11))[_0x3f5a[22]](function(_0xc5dbx15){if(_0xc5dbx15){switch(_0xc5dbx15){case _0x3f5a[31]:_0xc5dbx15= _0x3f5a[30];break;default:}};_0xc5dbx11[_0x3f5a[21]](200)[_0x3f5a[20]]({query:_0xc5dbx15})})[_0x3f5a[19]](function(_0xc5dbx13){logger[_0x3f5a[29]](_0x3f5a[27],_0xc5dbx13[_0x3f5a[28]])})};function getQuery(_0xc5dbx10,_0xc5dbx11){var _0xc5dbx17;return function(){return CustomReport[_0x3f5a[53]](_0x3f5a[52])[_0x3f5a[51]](_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]])[_0x3f5a[22]](function(_0xc5dbx19){if(!_0xc5dbx19){return _0xc5dbx11[_0x3f5a[37]](404)};if(_0xc5dbx10[_0x3f5a[23]][_0x3f5a[38]]&& _0xc5dbx10[_0x3f5a[23]][_0x3f5a[38]]=== _0x3f5a[39]){_0xc5dbx10[_0x3f5a[23]][_0x3f5a[40]]= moment()[_0x3f5a[42]](_0x3f5a[41]);_0xc5dbx10[_0x3f5a[23]][_0x3f5a[43]]= moment()[_0x3f5a[42]](_0x3f5a[41]);_0xc5dbx19[_0x3f5a[45]][_0x3f5a[44]]= _0xc5dbx19[_0x3f5a[45]][_0x3f5a[44]][_0x3f5a[48]](_0x3f5a[46],_0x3f5a[47])};delete _0xc5dbx10[_0x3f5a[23]][_0x3f5a[38]];_0xc5dbx17= _0xc5dbx19[_0x3f5a[45]];return _0xc5dbx17[_0x3f5a[44]]})[_0x3f5a[22]](reportBuildUtils[_0x3f5a[36]](_0xc5dbx10[_0x3f5a[35]]))[_0x3f5a[22]](function(_0xc5dbx18){return [_0xc5dbx18,_0xc5dbx17]})[_0x3f5a[34]](reportBuildUtils[_0x3f5a[33]](_0xc5dbx10[_0x3f5a[23]]))}}exports[_0x3f5a[54]]= function(_0xc5dbx10,_0xc5dbx11){var _0xc5dbx1a;return Promise[_0x3f5a[32]]([])[_0x3f5a[22]](getQuery(_0xc5dbx10,_0xc5dbx11))[_0x3f5a[22]](reportBuildUtils[_0x3f5a[66]]())[_0x3f5a[22]](function(_0xc5dbx1b){if(_0xc5dbx1b&& _[_0x3f5a[55]](_0xc5dbx1b)){_0xc5dbx1a= _0xc5dbx1b[_0x3f5a[56]];if(_0xc5dbx10[_0x3f5a[23]][_0x3f5a[57]]){_0xc5dbx1b= _(_0xc5dbx1b)[_0x3f5a[61]](_0xc5dbx10[_0x3f5a[23]][_0x3f5a[60]]|| 0)[_0x3f5a[59]](_0xc5dbx10[_0x3f5a[23]][_0x3f5a[57]])[_0x3f5a[58]]()};_[_0x3f5a[64]](_0xc5dbx1b,function(_0xc5dbx1c){_[_0x3f5a[63]](_0xc5dbx1c,function(_0xc5dbx1d,_0xc5dbx1e){if(_0xc5dbx1d instanceof  Date){_0xc5dbx1c[_0xc5dbx1e]= moment(_0xc5dbx1d)[_0x3f5a[42]](_0x3f5a[62]).toString()}})});_0xc5dbx11[_0x3f5a[21]](200)[_0x3f5a[20]]({rows:_0xc5dbx1b,count:_0xc5dbx1a})}else {return handleError(_0xc5dbx11,{message:_0xc5dbx1b|| _0x3f5a[65]})}})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};exports[_0x3f5a[67]]= function(_0xc5dbx10,_0xc5dbx11){logger[_0x3f5a[69]](_0x3f5a[68]);docExtract(_0xc5dbx10,_0xc5dbx11,_0x3f5a[70])};exports[_0x3f5a[71]]= function(_0xc5dbx10,_0xc5dbx11){logger[_0x3f5a[69]](_0x3f5a[72]);docExtract(_0xc5dbx10,_0xc5dbx11,_0x3f5a[73])};exports[_0x3f5a[74]]= function(_0xc5dbx10,_0xc5dbx11){return ReportTree[_0x3f5a[51]](2)[_0x3f5a[22]](function(_0xc5dbx1f){_0xc5dbx1f= JSON[_0x3f5a[76]](_0xc5dbx1f[_0x3f5a[75]]);var _0xc5dbx20=_[_0x3f5a[77]](_0xc5dbx1f,{id:_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]]});if(!_0xc5dbx20){throw  new Error(_0x3f5a[78])};var _0xc5dbx21=[];findSubNodes(_0xc5dbx20,_0xc5dbx1f,_0xc5dbx21);return CustomReport[_0x3f5a[79]]({where:{parent:_0xc5dbx21},individualHooks:true})})[_0x3f5a[22]](function(){return _0xc5dbx11[_0x3f5a[37]](200)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};function findSubNodes(_0xc5dbx20,_0xc5dbx1f,_0xc5dbx23){_0xc5dbx23[_0x3f5a[80]](_0xc5dbx20[_0x3f5a[49]]);var _0xc5dbx24=_[_0x3f5a[81]](_0xc5dbx1f,{parent:_0xc5dbx20[_0x3f5a[49]]});if(!_0xc5dbx24||  !_0xc5dbx24[_0x3f5a[56]]){return};_[_0x3f5a[64]](_0xc5dbx24,function(_0xc5dbx25){findSubNodes(_0xc5dbx25,_0xc5dbx1f,_0xc5dbx23)})}function docExtract(_0xc5dbx10,_0xc5dbx11,_0xc5dbx27){var _0xc5dbx19;logger[_0x3f5a[69]](_0x3f5a[82]);CustomReport[_0x3f5a[53]](_0x3f5a[52])[_0x3f5a[51]](_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]])[_0x3f5a[22]](function(_0xc5dbx17){if(!_0xc5dbx17){return _0xc5dbx11[_0x3f5a[37]](404)};_0xc5dbx19= _0xc5dbx17;return ReportTree[_0x3f5a[51]](2)})[_0x3f5a[22]](function(_0xc5dbx1f){_0xc5dbx1f= JSON[_0x3f5a[76]](_0xc5dbx1f[_0x3f5a[75]]);var _0xc5dbx2b=_[_0x3f5a[77]](_0xc5dbx1f,{id:_0xc5dbx19[_0x3f5a[93]]});var _0xc5dbx2c=getReportPath(_0xc5dbx2b,_0xc5dbx1f,_0xc5dbx19[_0x3f5a[94]]);logger[_0x3f5a[69]](_0x3f5a[95]);if(_0xc5dbx10[_0x3f5a[23]][_0x3f5a[38]]&& _0xc5dbx10[_0x3f5a[23]][_0x3f5a[38]]=== _0x3f5a[39]){_0xc5dbx10[_0x3f5a[23]][_0x3f5a[40]]= moment()[_0x3f5a[42]](_0x3f5a[41]);_0xc5dbx10[_0x3f5a[23]][_0x3f5a[43]]= moment()[_0x3f5a[42]](_0x3f5a[41]);_0xc5dbx19[_0x3f5a[45]][_0x3f5a[44]]= _0xc5dbx19[_0x3f5a[45]][_0x3f5a[44]][_0x3f5a[48]](_0x3f5a[46],_0x3f5a[47])};delete _0xc5dbx10[_0x3f5a[23]][_0x3f5a[38]];return [_0xc5dbx19,ExtractedReport[_0x3f5a[101]]({name:_0xc5dbx2c,startDate:_0xc5dbx10[_0x3f5a[23]][_0x3f5a[40]]?_0xc5dbx10[_0x3f5a[23]][_0x3f5a[40]]+ (_0xc5dbx10[_0x3f5a[23]][_0x3f5a[96]]?_0x3f5a[97]+ _0xc5dbx10[_0x3f5a[23]][_0x3f5a[96]]:_0x3f5a[98]):null,endDate:_0xc5dbx10[_0x3f5a[23]][_0x3f5a[43]]?_0xc5dbx10[_0x3f5a[23]][_0x3f5a[43]]+ (_0xc5dbx10[_0x3f5a[23]][_0x3f5a[99]]?_0x3f5a[97]+ _0xc5dbx10[_0x3f5a[23]][_0x3f5a[99]]:_0x3f5a[100]):null,output:_0xc5dbx27,UserId:_0xc5dbx10[_0x3f5a[35]][_0x3f5a[49]]})]})[_0x3f5a[34]](function(_0xc5dbx19,_0xc5dbx28){logger[_0x3f5a[69]](_0x3f5a[83]+ _0xc5dbx27);var _0xc5dbx29=cp[_0x3f5a[85]](__dirname+ _0x3f5a[84]);_0xc5dbx29[_0x3f5a[87]](_0x3f5a[90],function(_0xc5dbx2a){logger[_0x3f5a[69]](_0x3f5a[91],_0xc5dbx2a);_0xc5dbx29[_0x3f5a[92]]()})[_0x3f5a[87]](_0x3f5a[88],function(){logger[_0x3f5a[69]](_0x3f5a[89])})[_0x3f5a[87]](_0x3f5a[29],function(_0xc5dbx13){logger[_0x3f5a[69]](_0x3f5a[86],_0xc5dbx13)});_0xc5dbx29[_0x3f5a[20]]({report:_0xc5dbx19,query:_0xc5dbx10[_0x3f5a[23]],extractedId:_0xc5dbx28[_0x3f5a[49]],user:_0xc5dbx10[_0x3f5a[35]],type:_0xc5dbx27})})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)});return _0xc5dbx11[_0x3f5a[37]](200)}function getReportPath(_0xc5dbx2b,_0xc5dbx1f,_0xc5dbx2c){_0xc5dbx2c= _0xc5dbx2b[_0x3f5a[102]]+ _0x3f5a[103]+ _0xc5dbx2c;if(_0xc5dbx2b[_0x3f5a[93]]=== _0x3f5a[104]){return _0xc5dbx2c}else {return getReportPath(_[_0x3f5a[77]](_0xc5dbx1f,{id:_0xc5dbx2b[_0x3f5a[93]]}),_0xc5dbx1f,_0xc5dbx2c)}}exports[_0x3f5a[105]]= function(_0xc5dbx10,_0xc5dbx11){return CustomReport[_0x3f5a[53]](_0x3f5a[52])[_0x3f5a[51]](_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]])[_0x3f5a[22]](function(_0xc5dbx19){if(!_0xc5dbx19){return _0xc5dbx11[_0x3f5a[37]](404)};return _0xc5dbx11[_0x3f5a[20]](_0xc5dbx19)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};exports[_0x3f5a[106]]= function(_0xc5dbx10,_0xc5dbx11){return CustomReport[_0x3f5a[53]]({method:[_0x3f5a[109],{CustomReportId:_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]]}]})[_0x3f5a[51]](_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]],{attributes:[_0x3f5a[107],_0x3f5a[108],_0x3f5a[94],_0x3f5a[93],_0x3f5a[44]]})[_0x3f5a[22]](function(_0xc5dbx19){if(!_0xc5dbx19){return _0xc5dbx11[_0x3f5a[37]](404)};return _0xc5dbx11[_0x3f5a[20]](_0xc5dbx19)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};exports[_0x3f5a[110]]= function(_0xc5dbx10,_0xc5dbx11){var _0xc5dbx2e;return sequelize[_0x3f5a[115]](function(_0xc5dbx2f){return CustomReport[_0x3f5a[53]](_0x3f5a[52])[_0x3f5a[51]](_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]])[_0x3f5a[22]](function(_0xc5dbx19){if(!_0xc5dbx19){return _0xc5dbx11[_0x3f5a[37]](404)};var _0xc5dbx30=_0xc5dbx19[_0x3f5a[45]];delete _0xc5dbx30[_0x3f5a[49]];delete _0xc5dbx30[_0x3f5a[111]];delete _0xc5dbx30[_0x3f5a[112]];_0xc5dbx30[_0x3f5a[93]]= _0xc5dbx10[_0x3f5a[113]][_0x3f5a[93]];_0xc5dbx2e= _[_0x3f5a[114]](_0xc5dbx30.Fields,_0x3f5a[45]);return CustomReport[_0x3f5a[101]](_0xc5dbx30,{transaction:_0xc5dbx2f})})[_0x3f5a[22]](function(_0xc5dbx19){return [_0xc5dbx19,_0xc5dbx2e]})[_0x3f5a[34]](createFields(_0xc5dbx2f))})[_0x3f5a[22]](function(){return _0xc5dbx11[_0x3f5a[37]](201)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};exports[_0x3f5a[101]]= function(_0xc5dbx10,_0xc5dbx11){var _0xc5dbx17;return sequelize[_0x3f5a[115]](function(_0xc5dbx2f){return CustomReport[_0x3f5a[101]](_0xc5dbx10[_0x3f5a[113]],{transaction:_0xc5dbx2f})[_0x3f5a[22]](function(_0xc5dbx19){_0xc5dbx17= _0xc5dbx19;return [_0xc5dbx17,_0xc5dbx10[_0x3f5a[113]][_0x3f5a[116]]]})[_0x3f5a[34]](createFields(_0xc5dbx2f))})[_0x3f5a[22]](function(){return _0xc5dbx11[_0x3f5a[21]](201)[_0x3f5a[20]](_0xc5dbx17)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};exports[_0x3f5a[117]]= function(_0xc5dbx10,_0xc5dbx11){var _0xc5dbx17;return sequelize[_0x3f5a[115]](function(_0xc5dbx2f){return CustomReport[_0x3f5a[101]](_0xc5dbx10[_0x3f5a[113]],{transaction:_0xc5dbx2f})[_0x3f5a[22]](function(_0xc5dbx19){_0xc5dbx17= _0xc5dbx19;return [_0xc5dbx17,_0xc5dbx10[_0x3f5a[113]][_0x3f5a[116]]]})[_0x3f5a[34]](createImportFields(_0xc5dbx2f))})[_0x3f5a[22]](function(){return _0xc5dbx11[_0x3f5a[21]](201)[_0x3f5a[20]](_0xc5dbx17)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};exports[_0x3f5a[118]]= function(_0xc5dbx10,_0xc5dbx11,_0xc5dbx12){if(_0xc5dbx10[_0x3f5a[113]][_0x3f5a[49]]){delete _0xc5dbx10[_0x3f5a[113]][_0x3f5a[49]]};var _0xc5dbx17;return sequelize[_0x3f5a[115]](function(_0xc5dbx2f){return CustomReport[_0x3f5a[51]](_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]])[_0x3f5a[22]](function(_0xc5dbx19){if(!_0xc5dbx19){return _0xc5dbx11[_0x3f5a[37]](404)};var _0xc5dbx31=_[_0x3f5a[119]](_0xc5dbx19,_0xc5dbx10[_0x3f5a[113]]);return _0xc5dbx19[_0x3f5a[120]]({transaction:_0xc5dbx2f})})[_0x3f5a[22]](function(_0xc5dbx19){_0xc5dbx17= _0xc5dbx19;if(_0xc5dbx10[_0x3f5a[113]][_0x3f5a[116]]){return ReportField[_0x3f5a[79]]({where:{CustomReportId:_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]]},transaction:_0xc5dbx2f})}})[_0x3f5a[22]](function(){return [_0xc5dbx17,_0xc5dbx10[_0x3f5a[113]][_0x3f5a[116]]]})[_0x3f5a[34]](createFields(_0xc5dbx2f))})[_0x3f5a[22]](function(){return _0xc5dbx11[_0x3f5a[37]](200)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};function createFields(_0xc5dbx2f){return function(_0xc5dbx19,_0xc5dbx33){if(_0xc5dbx33&& Array[_0x3f5a[55]](_0xc5dbx33)&& _0xc5dbx33[_0x3f5a[56]]){var _0xc5dbx34=reportBuildUtils[_0x3f5a[121]](_0xc5dbx19[_0x3f5a[44]]);if(_0xc5dbx34){var _0xc5dbx35;return _0xc5dbx34[_0x3f5a[134]]()[_0x3f5a[22]](function(_0xc5dbx3a){_0xc5dbx35= _[_0x3f5a[132]](_0xc5dbx3a);return Metric[_0x3f5a[133]]()})[_0x3f5a[22]](function(_0xc5dbx36){var _0xc5dbx37=[];_0xc5dbx36= _[_0x3f5a[114]](_0xc5dbx36,_0x3f5a[45]);_0xc5dbx33[_0x3f5a[64]](function(_0xc5dbx38){_0xc5dbx38[_0x3f5a[122]]= _0xc5dbx19[_0x3f5a[49]];if(_0xc5dbx38[_0x3f5a[123]]){var _0xc5dbx39=_[_0x3f5a[77]](_0xc5dbx36,{id:_0xc5dbx38[_0x3f5a[123]]});if(_0xc5dbx39){_0xc5dbx38[_0x3f5a[124]]= _0xc5dbx39[_0x3f5a[125]];_0xc5dbx37[_0x3f5a[80]](ReportField[_0x3f5a[101]](_0xc5dbx38,{transaction:_0xc5dbx2f}))}else {throw  new sequelize.Error(_0x3f5a[126]+ _0xc5dbx38[_0x3f5a[123]]+ _0x3f5a[127])}}else {if(_[_0x3f5a[128]](_0xc5dbx35,_0xc5dbx38[_0x3f5a[124]])|| _0xc5dbx38[_0x3f5a[129]]){_0xc5dbx37[_0x3f5a[80]](ReportField[_0x3f5a[101]](_0xc5dbx38,{transaction:_0xc5dbx2f}))}else {throw  new sequelize.Error(_0x3f5a[130]+ _0xc5dbx38[_0x3f5a[124]]+ _0x3f5a[131])}}});return _0xc5dbx37})[_0x3f5a[32]]()}else {throw  new sequelize.Error(_0x3f5a[135])}}}}function createImportFields(_0xc5dbx2f){return function(_0xc5dbx19,_0xc5dbx33){if(_0xc5dbx33&& Array[_0x3f5a[55]](_0xc5dbx33)&& _0xc5dbx33[_0x3f5a[56]]){var _0xc5dbx34=reportBuildUtils[_0x3f5a[121]](_0xc5dbx19[_0x3f5a[44]]);if(_0xc5dbx34){var _0xc5dbx35;return _0xc5dbx34[_0x3f5a[134]]()[_0x3f5a[22]](function(_0xc5dbx3a){_0xc5dbx35= _[_0x3f5a[132]](_0xc5dbx3a);var _0xc5dbx37=[];var _0xc5dbx3c;if(_[_0x3f5a[138]](_0xc5dbx33,function(_0xc5dbx38){return _[_0x3f5a[137]](_0xc5dbx38,_0x3f5a[136])})){_0xc5dbx3c= _0x3f5a[139]}else {if(_[_0x3f5a[138]](_0xc5dbx33,function(_0xc5dbx38){return _[_0x3f5a[137]](_0xc5dbx38,_0x3f5a[123])})){_0xc5dbx3c= _0x3f5a[7]}else {throw  new sequelize.Error(_0x3f5a[140])}};var _0xc5dbx3d=_[_0x3f5a[142]](_0xc5dbx33,_0xc5dbx3c+ _0x3f5a[141]);_[_0x3f5a[63]](_0xc5dbx3d,function(_0xc5dbx3e,_0xc5dbx1e){if(_0xc5dbx1e!== _0x3f5a[143]&& _0xc5dbx1e!== _0x3f5a[144]){_0xc5dbx3e[0][_0xc5dbx3c][_0x3f5a[145]][_0x3f5a[64]](function(_0xc5dbx38){_0xc5dbx38[_0x3f5a[122]]= _0xc5dbx19[_0x3f5a[49]]});_0xc5dbx3e[0][_0xc5dbx3c][_0x3f5a[94]]+= _0x3f5a[146]+ sr({length:5});_0xc5dbx37[_0x3f5a[80]](Metric[_0x3f5a[101]](_0xc5dbx3e[0][_0xc5dbx3c],{include:[{model:ReportField,as:_0x3f5a[145]}],transaction:_0xc5dbx2f}))}else {_0xc5dbx3e[_0x3f5a[64]](function(_0xc5dbx38){if(_[_0x3f5a[128]](_0xc5dbx35,_0xc5dbx38[_0x3f5a[124]])|| _0xc5dbx38[_0x3f5a[129]]){_0xc5dbx38[_0x3f5a[122]]= _0xc5dbx19[_0x3f5a[49]];_0xc5dbx37[_0x3f5a[80]](ReportField[_0x3f5a[101]](_0xc5dbx38,{transaction:_0xc5dbx2f}))}else {throw  new sequelize.Error(_0x3f5a[130]+ _0xc5dbx38[_0x3f5a[124]]+ _0x3f5a[131])}})}});return _0xc5dbx37})[_0x3f5a[32]]()}else {throw  new sequelize.Error(_0x3f5a[135])}}}}exports[_0x3f5a[79]]= function(_0xc5dbx10,_0xc5dbx11){return CustomReport[_0x3f5a[51]](_0xc5dbx10[_0x3f5a[50]][_0x3f5a[49]])[_0x3f5a[22]](function(_0xc5dbx19){if(!_0xc5dbx19){return _0xc5dbx11[_0x3f5a[37]](404)};return _0xc5dbx19[_0x3f5a[79]]()})[_0x3f5a[22]](function(){return _0xc5dbx11[_0x3f5a[37]](204)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};exports[_0x3f5a[147]]= function(_0xc5dbx10,_0xc5dbx11){return CustomReport[_0x3f5a[79]]({where:{id:_0xc5dbx10[_0x3f5a[23]][_0x3f5a[148]]},individualHooks:true})[_0x3f5a[22]](function(){return _0xc5dbx11[_0x3f5a[37]](204)})[_0x3f5a[19]](function(_0xc5dbx13){return handleError(_0xc5dbx11,_0xc5dbx13)})};function handleError(_0xc5dbx11,_0xc5dbx13){logger[_0x3f5a[29]](_0xc5dbx13[_0x3f5a[28]]);return _0xc5dbx11[_0x3f5a[21]](500)[_0x3f5a[20]](_0xc5dbx13)}
\ No newline at end of file