Built motion from commit c36c9c6.|1.0.17
[motion.git] / server / api / custom_report / custom_report.controller.js
index f02a95b..e4f9cbf 100644 (file)
@@ -1 +1 @@
-var _0x9804=["\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"];_0x9804[0];var _=require(_0x9804[1]);var util=require(_0x9804[2]);var sequelize=require(_0x9804[4])[_0x9804[3]];var CustomReport=require(_0x9804[4])[_0x9804[5]];var ReportField=require(_0x9804[4])[_0x9804[6]];var Metric=require(_0x9804[4])[_0x9804[7]];var ExtractedReport=require(_0x9804[4])[_0x9804[8]];var extractUtils=require(_0x9804[9]);var reportBuildUtils=require(_0x9804[10]);var Util=require(_0x9804[11]);var sr=require(_0x9804[12]);var moment=require(_0x9804[13]);var cp=require(_0x9804[14]);var ReportTree=require(_0x9804[4])[_0x9804[15]];exports[_0x9804[16]]= function(_0x9955xf,_0x9955x10,_0x9955x11){return CustomReport[_0x9804[23]](Util[_0x9804[22]](_0x9955xf[_0x9804[21]],{deletedAt:null}))[_0x9804[20]](function(_0x9955x13){_0x9955x10[_0x9804[19]](200)[_0x9804[18]](_0x9955x13)})[_0x9804[17]](function(_0x9955x12){return handleError(_0x9955x10,_0x9955x12)})};exports[_0x9804[24]]= function(_0x9955xf,_0x9955x10){return Promise[_0x9804[29]]([])[_0x9804[20]](getQuery(_0x9955xf,_0x9955x10))[_0x9804[20]](function(_0x9955x14){if(_0x9955x14){switch(_0x9955x14){case _0x9804[28]:_0x9955x14= _0x9804[27];break;default:}};_0x9955x10[_0x9804[19]](200)[_0x9804[18]]({query:_0x9955x14})})[_0x9804[17]](function(_0x9955x12){console[_0x9804[26]](_0x9804[25],_0x9955x12)})};function getQuery(_0x9955xf,_0x9955x10){var _0x9955x16;return function(){return CustomReport[_0x9804[51]](_0x9804[50])[_0x9804[49]](_0x9955xf[_0x9804[48]][_0x9804[47]])[_0x9804[20]](function(_0x9955x18){console[_0x9804[26]](_0x9804[34]);if(!_0x9955x18){return _0x9955x10[_0x9804[35]](404)};if(_0x9955xf[_0x9804[21]][_0x9804[36]]&& _0x9955xf[_0x9804[21]][_0x9804[36]]=== _0x9804[37]){_0x9955xf[_0x9804[21]][_0x9804[38]]= moment()[_0x9804[40]](_0x9804[39]);_0x9955xf[_0x9804[21]][_0x9804[41]]= moment()[_0x9804[40]](_0x9804[39]);_0x9955x18[_0x9804[43]][_0x9804[42]]= _0x9955x18[_0x9804[43]][_0x9804[42]][_0x9804[46]](_0x9804[44],_0x9804[45])};delete _0x9955xf[_0x9804[21]][_0x9804[36]];_0x9955x16= _0x9955x18[_0x9804[43]];return _0x9955x16[_0x9804[42]]})[_0x9804[20]](reportBuildUtils[_0x9804[33]](_0x9955xf[_0x9804[32]]))[_0x9804[20]](function(_0x9955x17){return [_0x9955x17,_0x9955x16]})[_0x9804[31]](reportBuildUtils[_0x9804[30]](_0x9955xf[_0x9804[21]]))}}exports[_0x9804[52]]= function(_0x9955xf,_0x9955x10){var _0x9955x19;return Promise[_0x9804[29]]([])[_0x9804[20]](getQuery(_0x9955xf,_0x9955x10))[_0x9804[20]](reportBuildUtils[_0x9804[64]]())[_0x9804[20]](function(_0x9955x1a){if(_0x9955x1a&& _[_0x9804[53]](_0x9955x1a)){_0x9955x19= _0x9955x1a[_0x9804[54]];if(_0x9955xf[_0x9804[21]][_0x9804[55]]){_0x9955x1a= _(_0x9955x1a)[_0x9804[59]](_0x9955xf[_0x9804[21]][_0x9804[58]]|| 0)[_0x9804[57]](_0x9955xf[_0x9804[21]][_0x9804[55]])[_0x9804[56]]()};_[_0x9804[62]](_0x9955x1a,function(_0x9955x1b){_[_0x9804[61]](_0x9955x1b,function(_0x9955x1c,_0x9955x1d){if(_0x9955x1c instanceof  Date){_0x9955x1b[_0x9955x1d]= moment(_0x9955x1c)[_0x9804[40]](_0x9804[60]).toString()}})});_0x9955x10[_0x9804[19]](200)[_0x9804[18]]({rows:_0x9955x1a,count:_0x9955x19})}else {return handleError(_0x9955x10,{message:_0x9955x1a|| _0x9804[63]})}})[_0x9804[17]](function(_0x9955x12){console[_0x9804[26]](_0x9955x12);return handleError(_0x9955x10,_0x9955x12)})};exports[_0x9804[65]]= function(_0x9955xf,_0x9955x10){docExtract(_0x9955xf,_0x9955x10,_0x9804[66])};exports[_0x9804[67]]= function(_0x9955xf,_0x9955x10){docExtract(_0x9955xf,_0x9955x10,_0x9804[68])};exports[_0x9804[69]]= function(_0x9955xf,_0x9955x10){return ReportTree[_0x9804[49]](2)[_0x9804[20]](function(_0x9955x1e){_0x9955x1e= JSON[_0x9804[71]](_0x9955x1e[_0x9804[70]]);var _0x9955x1f=_[_0x9804[72]](_0x9955x1e,{id:_0x9955xf[_0x9804[48]][_0x9804[47]]});if(!_0x9955x1f){throw  new Error(_0x9804[73])};var _0x9955x20=[];findSubNodes(_0x9955x1f,_0x9955x1e,_0x9955x20);console[_0x9804[26]](_0x9955x20);return CustomReport[_0x9804[74]]({where:{parent:_0x9955x20},individualHooks:true})})[_0x9804[20]](function(){return _0x9955x10[_0x9804[35]](200)})[_0x9804[17]](function(_0x9955x12){console[_0x9804[26]](_0x9955x12);return handleError(_0x9955x10,_0x9955x12)})};function findSubNodes(_0x9955x1f,_0x9955x1e,_0x9955x22){_0x9955x22[_0x9804[75]](_0x9955x1f[_0x9804[47]]);var _0x9955x23=_[_0x9804[76]](_0x9955x1e,{parent:_0x9955x1f[_0x9804[47]]});if(!_0x9955x23|| !_0x9955x23[_0x9804[54]]){return};_[_0x9804[62]](_0x9955x23,function(_0x9955x24){findSubNodes(_0x9955x24,_0x9955x1e,_0x9955x22)})}function docExtract(_0x9955xf,_0x9955x10,_0x9955x26){var _0x9955x18;CustomReport[_0x9804[51]](_0x9804[50])[_0x9804[49]](_0x9955xf[_0x9804[48]][_0x9804[47]])[_0x9804[20]](function(_0x9955x16){if(!_0x9955x16){return _0x9955x10[_0x9804[35]](404)};_0x9955x18= _0x9955x16;return ReportTree[_0x9804[49]](2)})[_0x9804[20]](function(_0x9955x1e){_0x9955x1e= JSON[_0x9804[71]](_0x9955x1e[_0x9804[70]]);var _0x9955x2a=_[_0x9804[72]](_0x9955x1e,{id:_0x9955x18[_0x9804[87]]});var _0x9955x2b=getReportPath(_0x9955x2a,_0x9955x1e,_0x9955x18[_0x9804[88]]);if(_0x9955xf[_0x9804[21]][_0x9804[36]]&& _0x9955xf[_0x9804[21]][_0x9804[36]]=== _0x9804[37]){_0x9955xf[_0x9804[21]][_0x9804[38]]= moment()[_0x9804[40]](_0x9804[39]);_0x9955xf[_0x9804[21]][_0x9804[41]]= moment()[_0x9804[40]](_0x9804[39]);_0x9955x18[_0x9804[43]][_0x9804[42]]= _0x9955x18[_0x9804[43]][_0x9804[42]][_0x9804[46]](_0x9804[44],_0x9804[45])};delete _0x9955xf[_0x9804[21]][_0x9804[36]];return [_0x9955x18,ExtractedReport[_0x9804[94]]({name:_0x9955x2b,startDate:_0x9955xf[_0x9804[21]][_0x9804[38]]?_0x9955xf[_0x9804[21]][_0x9804[38]]+ (_0x9955xf[_0x9804[21]][_0x9804[89]]?_0x9804[90]+ _0x9955xf[_0x9804[21]][_0x9804[89]]:_0x9804[91]):null,endDate:_0x9955xf[_0x9804[21]][_0x9804[41]]?_0x9955xf[_0x9804[21]][_0x9804[41]]+ (_0x9955xf[_0x9804[21]][_0x9804[92]]?_0x9804[90]+ _0x9955xf[_0x9804[21]][_0x9804[92]]:_0x9804[93]):null,output:_0x9955x26,UserId:_0x9955xf[_0x9804[32]][_0x9804[47]]})]})[_0x9804[31]](function(_0x9955x18,_0x9955x27){var _0x9955x28=cp[_0x9804[78]](__dirname+ _0x9804[77]);_0x9955x28[_0x9804[81]](_0x9804[84],function(_0x9955x29){console[_0x9804[26]](_0x9804[85],_0x9955x29);_0x9955x28[_0x9804[86]]()})[_0x9804[81]](_0x9804[82],function(){console[_0x9804[26]](_0x9804[83])})[_0x9804[81]](_0x9804[79],function(_0x9955x12){console[_0x9804[26]](_0x9804[80],_0x9955x12)});_0x9955x28[_0x9804[18]]({report:_0x9955x18,query:_0x9955xf[_0x9804[21]],extractedId:_0x9955x27[_0x9804[47]],user:_0x9955xf[_0x9804[32]],type:_0x9955x26})})[_0x9804[17]](function(_0x9955x12){console[_0x9804[26]](_0x9955x12);return handleError(_0x9955x10,_0x9955x12)});return _0x9955x10[_0x9804[35]](200)}function getReportPath(_0x9955x2a,_0x9955x1e,_0x9955x2b){_0x9955x2b= _0x9955x2a[_0x9804[95]]+ _0x9804[96]+ _0x9955x2b;if(_0x9955x2a[_0x9804[87]]=== _0x9804[97]){return _0x9955x2b}else {return getReportPath(_[_0x9804[72]](_0x9955x1e,{id:_0x9955x2a[_0x9804[87]]}),_0x9955x1e,_0x9955x2b)}}exports[_0x9804[98]]= function(_0x9955xf,_0x9955x10){return CustomReport[_0x9804[51]](_0x9804[50])[_0x9804[49]](_0x9955xf[_0x9804[48]][_0x9804[47]])[_0x9804[20]](function(_0x9955x18){if(!_0x9955x18){return _0x9955x10[_0x9804[35]](404)};return _0x9955x10[_0x9804[18]](_0x9955x18)})[_0x9804[17]](function(_0x9955x12){return handleError(_0x9955x10,_0x9955x12)})};exports[_0x9804[99]]= function(_0x9955xf,_0x9955x10){return CustomReport[_0x9804[51]]({method:[_0x9804[102],{CustomReportId:_0x9955xf[_0x9804[48]][_0x9804[47]]}]})[_0x9804[49]](_0x9955xf[_0x9804[48]][_0x9804[47]],{attributes:[_0x9804[100],_0x9804[101],_0x9804[88],_0x9804[87],_0x9804[42]]})[_0x9804[20]](function(_0x9955x18){if(!_0x9955x18){return _0x9955x10[_0x9804[35]](404)};return _0x9955x10[_0x9804[18]](_0x9955x18)})[_0x9804[17]](function(_0x9955x12){return handleError(_0x9955x10,_0x9955x12)})};exports[_0x9804[103]]= function(_0x9955xf,_0x9955x10){var _0x9955x2d;return sequelize[_0x9804[108]](function(_0x9955x2e){return CustomReport[_0x9804[51]](_0x9804[50])[_0x9804[49]](_0x9955xf[_0x9804[48]][_0x9804[47]])[_0x9804[20]](function(_0x9955x18){if(!_0x9955x18){return _0x9955x10[_0x9804[35]](404)};var _0x9955x2f=_0x9955x18[_0x9804[43]];delete _0x9955x2f[_0x9804[47]];delete _0x9955x2f[_0x9804[104]];delete _0x9955x2f[_0x9804[105]];_0x9955x2f[_0x9804[87]]= _0x9955xf[_0x9804[106]][_0x9804[87]];_0x9955x2d= _[_0x9804[107]](_0x9955x2f.Fields,_0x9804[43]);return CustomReport[_0x9804[94]](_0x9955x2f,{transaction:_0x9955x2e})})[_0x9804[20]](function(_0x9955x18){return [_0x9955x18,_0x9955x2d]})[_0x9804[31]](createFields(_0x9955x2e))})[_0x9804[20]](function(){return _0x9955x10[_0x9804[35]](201)})[_0x9804[17]](function(_0x9955x12){console[_0x9804[26]](_0x9955x12);return handleError(_0x9955x10,_0x9955x12)})};exports[_0x9804[94]]= function(_0x9955xf,_0x9955x10){var _0x9955x16;return sequelize[_0x9804[108]](function(_0x9955x2e){return CustomReport[_0x9804[94]](_0x9955xf[_0x9804[106]],{transaction:_0x9955x2e})[_0x9804[20]](function(_0x9955x18){_0x9955x16= _0x9955x18;return [_0x9955x16,_0x9955xf[_0x9804[106]][_0x9804[109]]]})[_0x9804[31]](createFields(_0x9955x2e))})[_0x9804[20]](function(){return _0x9955x10[_0x9804[19]](201)[_0x9804[18]](_0x9955x16)})[_0x9804[17]](function(_0x9955x12){console[_0x9804[26]](_0x9955x12);return handleError(_0x9955x10,_0x9955x12)})};exports[_0x9804[110]]= function(_0x9955xf,_0x9955x10){var _0x9955x16;return sequelize[_0x9804[108]](function(_0x9955x2e){return CustomReport[_0x9804[94]](_0x9955xf[_0x9804[106]],{transaction:_0x9955x2e})[_0x9804[20]](function(_0x9955x18){_0x9955x16= _0x9955x18;return [_0x9955x16,_0x9955xf[_0x9804[106]][_0x9804[109]]]})[_0x9804[31]](createImportFields(_0x9955x2e))})[_0x9804[20]](function(){return _0x9955x10[_0x9804[19]](201)[_0x9804[18]](_0x9955x16)})[_0x9804[17]](function(_0x9955x12){console[_0x9804[26]](_0x9955x12);return handleError(_0x9955x10,_0x9955x12)})};exports[_0x9804[111]]= function(_0x9955xf,_0x9955x10,_0x9955x11){if(_0x9955xf[_0x9804[106]][_0x9804[47]]){delete _0x9955xf[_0x9804[106]][_0x9804[47]]};var _0x9955x16;return sequelize[_0x9804[108]](function(_0x9955x2e){return CustomReport[_0x9804[49]](_0x9955xf[_0x9804[48]][_0x9804[47]])[_0x9804[20]](function(_0x9955x18){if(!_0x9955x18){return _0x9955x10[_0x9804[35]](404)};var _0x9955x30=_[_0x9804[112]](_0x9955x18,_0x9955xf[_0x9804[106]]);return _0x9955x18[_0x9804[113]]({transaction:_0x9955x2e})})[_0x9804[20]](function(_0x9955x18){_0x9955x16= _0x9955x18;if(_0x9955xf[_0x9804[106]][_0x9804[109]]){return ReportField[_0x9804[74]]({where:{CustomReportId:_0x9955xf[_0x9804[48]][_0x9804[47]]},transaction:_0x9955x2e})}})[_0x9804[20]](function(){return [_0x9955x16,_0x9955xf[_0x9804[106]][_0x9804[109]]]})[_0x9804[31]](createFields(_0x9955x2e))})[_0x9804[20]](function(){return _0x9955x10[_0x9804[35]](200)})[_0x9804[17]](function(_0x9955x12){console[_0x9804[26]](_0x9955x12);return handleError(_0x9955x10,_0x9955x12)})};function createFields(_0x9955x2e){return function(_0x9955x18,_0x9955x32){if(_0x9955x32&& Array[_0x9804[53]](_0x9955x32)&& _0x9955x32[_0x9804[54]]){var _0x9955x33=reportBuildUtils[_0x9804[114]](_0x9955x18[_0x9804[42]]);if(_0x9955x33){var _0x9955x34;return _0x9955x33[_0x9804[127]]()[_0x9804[20]](function(_0x9955x39){_0x9955x34= _[_0x9804[125]](_0x9955x39);return Metric[_0x9804[126]]()})[_0x9804[20]](function(_0x9955x35){var _0x9955x36=[];_0x9955x35= _[_0x9804[107]](_0x9955x35,_0x9804[43]);_0x9955x32[_0x9804[62]](function(_0x9955x37){_0x9955x37[_0x9804[115]]= _0x9955x18[_0x9804[47]];if(_0x9955x37[_0x9804[116]]){var _0x9955x38=_[_0x9804[72]](_0x9955x35,{id:_0x9955x37[_0x9804[116]]});if(_0x9955x38){_0x9955x37[_0x9804[117]]= _0x9955x38[_0x9804[118]];_0x9955x36[_0x9804[75]](ReportField[_0x9804[94]](_0x9955x37,{transaction:_0x9955x2e}))}else {throw  new sequelize.Error(_0x9804[119]+ _0x9955x37[_0x9804[116]]+ _0x9804[120])}}else {if(_[_0x9804[121]](_0x9955x34,_0x9955x37[_0x9804[117]])|| _0x9955x37[_0x9804[122]]){_0x9955x36[_0x9804[75]](ReportField[_0x9804[94]](_0x9955x37,{transaction:_0x9955x2e}))}else {throw  new sequelize.Error(_0x9804[123]+ _0x9955x37[_0x9804[117]]+ _0x9804[124])}}});return _0x9955x36})[_0x9804[29]]()}else {throw  new sequelize.Error(_0x9804[128])}}}}function createImportFields(_0x9955x2e){return function(_0x9955x18,_0x9955x32){if(_0x9955x32&& Array[_0x9804[53]](_0x9955x32)&& _0x9955x32[_0x9804[54]]){var _0x9955x33=reportBuildUtils[_0x9804[114]](_0x9955x18[_0x9804[42]]);if(_0x9955x33){var _0x9955x34;return _0x9955x33[_0x9804[127]]()[_0x9804[20]](function(_0x9955x39){_0x9955x34= _[_0x9804[125]](_0x9955x39);var _0x9955x36=[];var _0x9955x3b;if(_[_0x9804[131]](_0x9955x32,function(_0x9955x37){return _[_0x9804[130]](_0x9955x37,_0x9804[129])})){_0x9955x3b= _0x9804[132]}else {if(_[_0x9804[131]](_0x9955x32,function(_0x9955x37){return _[_0x9804[130]](_0x9955x37,_0x9804[116])})){_0x9955x3b= _0x9804[7]}else {throw  new sequelize.Error(_0x9804[133])}};var _0x9955x3c=_[_0x9804[135]](_0x9955x32,_0x9955x3b+ _0x9804[134]);_[_0x9804[61]](_0x9955x3c,function(_0x9955x3d,_0x9955x1d){if(_0x9955x1d!== _0x9804[136]&& _0x9955x1d!== _0x9804[137]){_0x9955x3d[0][_0x9955x3b][_0x9804[138]][_0x9804[62]](function(_0x9955x37){_0x9955x37[_0x9804[115]]= _0x9955x18[_0x9804[47]]});_0x9955x3d[0][_0x9955x3b][_0x9804[88]]+= _0x9804[139]+ sr({length:5});_0x9955x36[_0x9804[75]](Metric[_0x9804[94]](_0x9955x3d[0][_0x9955x3b],{include:[{model:ReportField,as:_0x9804[138]}],transaction:_0x9955x2e}))}else {_0x9955x3d[_0x9804[62]](function(_0x9955x37){if(_[_0x9804[121]](_0x9955x34,_0x9955x37[_0x9804[117]])|| _0x9955x37[_0x9804[122]]){_0x9955x37[_0x9804[115]]= _0x9955x18[_0x9804[47]];_0x9955x36[_0x9804[75]](ReportField[_0x9804[94]](_0x9955x37,{transaction:_0x9955x2e}))}else {throw  new sequelize.Error(_0x9804[123]+ _0x9955x37[_0x9804[117]]+ _0x9804[124])}})}});return _0x9955x36})[_0x9804[29]]()}else {throw  new sequelize.Error(_0x9804[128])}}}}exports[_0x9804[74]]= function(_0x9955xf,_0x9955x10){return CustomReport[_0x9804[49]](_0x9955xf[_0x9804[48]][_0x9804[47]])[_0x9804[20]](function(_0x9955x18){if(!_0x9955x18){return _0x9955x10[_0x9804[35]](404)};return _0x9955x18[_0x9804[74]]()})[_0x9804[20]](function(){return _0x9955x10[_0x9804[35]](204)})[_0x9804[17]](function(_0x9955x12){return handleError(_0x9955x10,_0x9955x12)})};exports[_0x9804[140]]= function(_0x9955xf,_0x9955x10){return CustomReport[_0x9804[74]]({where:{id:_0x9955xf[_0x9804[21]][_0x9804[141]]},individualHooks:true})[_0x9804[20]](function(){return _0x9955x10[_0x9804[35]](204)})[_0x9804[17]](function(_0x9955x12){return handleError(_0x9955x10,_0x9955x12)})};function handleError(_0x9955x10,_0x9955x12){return _0x9955x10[_0x9804[19]](500)[_0x9804[18]](_0x9955x12)}
\ No newline at end of file
+var _0x44b0=["\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"];_0x44b0[0];var _=require(_0x44b0[1]);var util=require(_0x44b0[2]);var sequelize=require(_0x44b0[4])[_0x44b0[3]];var CustomReport=require(_0x44b0[4])[_0x44b0[5]];var ReportField=require(_0x44b0[4])[_0x44b0[6]];var Metric=require(_0x44b0[4])[_0x44b0[7]];var ExtractedReport=require(_0x44b0[4])[_0x44b0[8]];var extractUtils=require(_0x44b0[9]);var reportBuildUtils=require(_0x44b0[10]);var Util=require(_0x44b0[11]);var sr=require(_0x44b0[12]);var moment=require(_0x44b0[13]);var cp=require(_0x44b0[14]);var ReportTree=require(_0x44b0[4])[_0x44b0[15]];exports[_0x44b0[16]]= function(_0x3d0cxf,_0x3d0cx10,_0x3d0cx11){return CustomReport[_0x44b0[23]](Util[_0x44b0[22]](_0x3d0cxf[_0x44b0[21]],{deletedAt:null}))[_0x44b0[20]](function(_0x3d0cx13){_0x3d0cx10[_0x44b0[19]](200)[_0x44b0[18]](_0x3d0cx13)})[_0x44b0[17]](function(_0x3d0cx12){return handleError(_0x3d0cx10,_0x3d0cx12)})};exports[_0x44b0[24]]= function(_0x3d0cxf,_0x3d0cx10){return Promise[_0x44b0[29]]([])[_0x44b0[20]](getQuery(_0x3d0cxf,_0x3d0cx10))[_0x44b0[20]](function(_0x3d0cx14){if(_0x3d0cx14){switch(_0x3d0cx14){case _0x44b0[28]:_0x3d0cx14= _0x44b0[27];break;default:}};_0x3d0cx10[_0x44b0[19]](200)[_0x44b0[18]]({query:_0x3d0cx14})})[_0x44b0[17]](function(_0x3d0cx12){console[_0x44b0[26]](_0x44b0[25],_0x3d0cx12)})};function getQuery(_0x3d0cxf,_0x3d0cx10){var _0x3d0cx16;return function(){return CustomReport[_0x44b0[51]](_0x44b0[50])[_0x44b0[49]](_0x3d0cxf[_0x44b0[48]][_0x44b0[47]])[_0x44b0[20]](function(_0x3d0cx18){console[_0x44b0[26]](_0x44b0[34]);if(!_0x3d0cx18){return _0x3d0cx10[_0x44b0[35]](404)};if(_0x3d0cxf[_0x44b0[21]][_0x44b0[36]]&& _0x3d0cxf[_0x44b0[21]][_0x44b0[36]]=== _0x44b0[37]){_0x3d0cxf[_0x44b0[21]][_0x44b0[38]]= moment()[_0x44b0[40]](_0x44b0[39]);_0x3d0cxf[_0x44b0[21]][_0x44b0[41]]= moment()[_0x44b0[40]](_0x44b0[39]);_0x3d0cx18[_0x44b0[43]][_0x44b0[42]]= _0x3d0cx18[_0x44b0[43]][_0x44b0[42]][_0x44b0[46]](_0x44b0[44],_0x44b0[45])};delete _0x3d0cxf[_0x44b0[21]][_0x44b0[36]];_0x3d0cx16= _0x3d0cx18[_0x44b0[43]];return _0x3d0cx16[_0x44b0[42]]})[_0x44b0[20]](reportBuildUtils[_0x44b0[33]](_0x3d0cxf[_0x44b0[32]]))[_0x44b0[20]](function(_0x3d0cx17){return [_0x3d0cx17,_0x3d0cx16]})[_0x44b0[31]](reportBuildUtils[_0x44b0[30]](_0x3d0cxf[_0x44b0[21]]))}}exports[_0x44b0[52]]= function(_0x3d0cxf,_0x3d0cx10){var _0x3d0cx19;return Promise[_0x44b0[29]]([])[_0x44b0[20]](getQuery(_0x3d0cxf,_0x3d0cx10))[_0x44b0[20]](reportBuildUtils[_0x44b0[64]]())[_0x44b0[20]](function(_0x3d0cx1a){if(_0x3d0cx1a&& _[_0x44b0[53]](_0x3d0cx1a)){_0x3d0cx19= _0x3d0cx1a[_0x44b0[54]];if(_0x3d0cxf[_0x44b0[21]][_0x44b0[55]]){_0x3d0cx1a= _(_0x3d0cx1a)[_0x44b0[59]](_0x3d0cxf[_0x44b0[21]][_0x44b0[58]]|| 0)[_0x44b0[57]](_0x3d0cxf[_0x44b0[21]][_0x44b0[55]])[_0x44b0[56]]()};_[_0x44b0[62]](_0x3d0cx1a,function(_0x3d0cx1b){_[_0x44b0[61]](_0x3d0cx1b,function(_0x3d0cx1c,_0x3d0cx1d){if(_0x3d0cx1c instanceof  Date){_0x3d0cx1b[_0x3d0cx1d]= moment(_0x3d0cx1c)[_0x44b0[40]](_0x44b0[60]).toString()}})});_0x3d0cx10[_0x44b0[19]](200)[_0x44b0[18]]({rows:_0x3d0cx1a,count:_0x3d0cx19})}else {return handleError(_0x3d0cx10,{message:_0x3d0cx1a|| _0x44b0[63]})}})[_0x44b0[17]](function(_0x3d0cx12){console[_0x44b0[26]](_0x3d0cx12);return handleError(_0x3d0cx10,_0x3d0cx12)})};exports[_0x44b0[65]]= function(_0x3d0cxf,_0x3d0cx10){docExtract(_0x3d0cxf,_0x3d0cx10,_0x44b0[66])};exports[_0x44b0[67]]= function(_0x3d0cxf,_0x3d0cx10){docExtract(_0x3d0cxf,_0x3d0cx10,_0x44b0[68])};exports[_0x44b0[69]]= function(_0x3d0cxf,_0x3d0cx10){return ReportTree[_0x44b0[49]](2)[_0x44b0[20]](function(_0x3d0cx1e){_0x3d0cx1e= JSON[_0x44b0[71]](_0x3d0cx1e[_0x44b0[70]]);var _0x3d0cx1f=_[_0x44b0[72]](_0x3d0cx1e,{id:_0x3d0cxf[_0x44b0[48]][_0x44b0[47]]});if(!_0x3d0cx1f){throw  new Error(_0x44b0[73])};var _0x3d0cx20=[];findSubNodes(_0x3d0cx1f,_0x3d0cx1e,_0x3d0cx20);return CustomReport[_0x44b0[74]]({where:{parent:_0x3d0cx20},individualHooks:true})})[_0x44b0[20]](function(){return _0x3d0cx10[_0x44b0[35]](200)})[_0x44b0[17]](function(_0x3d0cx12){console[_0x44b0[26]](_0x3d0cx12);return handleError(_0x3d0cx10,_0x3d0cx12)})};function findSubNodes(_0x3d0cx1f,_0x3d0cx1e,_0x3d0cx22){_0x3d0cx22[_0x44b0[75]](_0x3d0cx1f[_0x44b0[47]]);var _0x3d0cx23=_[_0x44b0[76]](_0x3d0cx1e,{parent:_0x3d0cx1f[_0x44b0[47]]});if(!_0x3d0cx23||  !_0x3d0cx23[_0x44b0[54]]){return};_[_0x44b0[62]](_0x3d0cx23,function(_0x3d0cx24){findSubNodes(_0x3d0cx24,_0x3d0cx1e,_0x3d0cx22)})}function docExtract(_0x3d0cxf,_0x3d0cx10,_0x3d0cx26){var _0x3d0cx18;CustomReport[_0x44b0[51]](_0x44b0[50])[_0x44b0[49]](_0x3d0cxf[_0x44b0[48]][_0x44b0[47]])[_0x44b0[20]](function(_0x3d0cx16){if(!_0x3d0cx16){return _0x3d0cx10[_0x44b0[35]](404)};_0x3d0cx18= _0x3d0cx16;return ReportTree[_0x44b0[49]](2)})[_0x44b0[20]](function(_0x3d0cx1e){_0x3d0cx1e= JSON[_0x44b0[71]](_0x3d0cx1e[_0x44b0[70]]);var _0x3d0cx2a=_[_0x44b0[72]](_0x3d0cx1e,{id:_0x3d0cx18[_0x44b0[87]]});var _0x3d0cx2b=getReportPath(_0x3d0cx2a,_0x3d0cx1e,_0x3d0cx18[_0x44b0[88]]);if(_0x3d0cxf[_0x44b0[21]][_0x44b0[36]]&& _0x3d0cxf[_0x44b0[21]][_0x44b0[36]]=== _0x44b0[37]){_0x3d0cxf[_0x44b0[21]][_0x44b0[38]]= moment()[_0x44b0[40]](_0x44b0[39]);_0x3d0cxf[_0x44b0[21]][_0x44b0[41]]= moment()[_0x44b0[40]](_0x44b0[39]);_0x3d0cx18[_0x44b0[43]][_0x44b0[42]]= _0x3d0cx18[_0x44b0[43]][_0x44b0[42]][_0x44b0[46]](_0x44b0[44],_0x44b0[45])};delete _0x3d0cxf[_0x44b0[21]][_0x44b0[36]];return [_0x3d0cx18,ExtractedReport[_0x44b0[94]]({name:_0x3d0cx2b,startDate:_0x3d0cxf[_0x44b0[21]][_0x44b0[38]]?_0x3d0cxf[_0x44b0[21]][_0x44b0[38]]+ (_0x3d0cxf[_0x44b0[21]][_0x44b0[89]]?_0x44b0[90]+ _0x3d0cxf[_0x44b0[21]][_0x44b0[89]]:_0x44b0[91]):null,endDate:_0x3d0cxf[_0x44b0[21]][_0x44b0[41]]?_0x3d0cxf[_0x44b0[21]][_0x44b0[41]]+ (_0x3d0cxf[_0x44b0[21]][_0x44b0[92]]?_0x44b0[90]+ _0x3d0cxf[_0x44b0[21]][_0x44b0[92]]:_0x44b0[93]):null,output:_0x3d0cx26,UserId:_0x3d0cxf[_0x44b0[32]][_0x44b0[47]]})]})[_0x44b0[31]](function(_0x3d0cx18,_0x3d0cx27){var _0x3d0cx28=cp[_0x44b0[78]](__dirname+ _0x44b0[77]);_0x3d0cx28[_0x44b0[81]](_0x44b0[84],function(_0x3d0cx29){console[_0x44b0[26]](_0x44b0[85],_0x3d0cx29);_0x3d0cx28[_0x44b0[86]]()})[_0x44b0[81]](_0x44b0[82],function(){console[_0x44b0[26]](_0x44b0[83])})[_0x44b0[81]](_0x44b0[79],function(_0x3d0cx12){console[_0x44b0[26]](_0x44b0[80],_0x3d0cx12)});_0x3d0cx28[_0x44b0[18]]({report:_0x3d0cx18,query:_0x3d0cxf[_0x44b0[21]],extractedId:_0x3d0cx27[_0x44b0[47]],user:_0x3d0cxf[_0x44b0[32]],type:_0x3d0cx26})})[_0x44b0[17]](function(_0x3d0cx12){console[_0x44b0[26]](_0x3d0cx12);return handleError(_0x3d0cx10,_0x3d0cx12)});return _0x3d0cx10[_0x44b0[35]](200)}function getReportPath(_0x3d0cx2a,_0x3d0cx1e,_0x3d0cx2b){_0x3d0cx2b= _0x3d0cx2a[_0x44b0[95]]+ _0x44b0[96]+ _0x3d0cx2b;if(_0x3d0cx2a[_0x44b0[87]]=== _0x44b0[97]){return _0x3d0cx2b}else {return getReportPath(_[_0x44b0[72]](_0x3d0cx1e,{id:_0x3d0cx2a[_0x44b0[87]]}),_0x3d0cx1e,_0x3d0cx2b)}}exports[_0x44b0[98]]= function(_0x3d0cxf,_0x3d0cx10){return CustomReport[_0x44b0[51]](_0x44b0[50])[_0x44b0[49]](_0x3d0cxf[_0x44b0[48]][_0x44b0[47]])[_0x44b0[20]](function(_0x3d0cx18){if(!_0x3d0cx18){return _0x3d0cx10[_0x44b0[35]](404)};return _0x3d0cx10[_0x44b0[18]](_0x3d0cx18)})[_0x44b0[17]](function(_0x3d0cx12){return handleError(_0x3d0cx10,_0x3d0cx12)})};exports[_0x44b0[99]]= function(_0x3d0cxf,_0x3d0cx10){return CustomReport[_0x44b0[51]]({method:[_0x44b0[102],{CustomReportId:_0x3d0cxf[_0x44b0[48]][_0x44b0[47]]}]})[_0x44b0[49]](_0x3d0cxf[_0x44b0[48]][_0x44b0[47]],{attributes:[_0x44b0[100],_0x44b0[101],_0x44b0[88],_0x44b0[87],_0x44b0[42]]})[_0x44b0[20]](function(_0x3d0cx18){if(!_0x3d0cx18){return _0x3d0cx10[_0x44b0[35]](404)};return _0x3d0cx10[_0x44b0[18]](_0x3d0cx18)})[_0x44b0[17]](function(_0x3d0cx12){return handleError(_0x3d0cx10,_0x3d0cx12)})};exports[_0x44b0[103]]= function(_0x3d0cxf,_0x3d0cx10){var _0x3d0cx2d;return sequelize[_0x44b0[108]](function(_0x3d0cx2e){return CustomReport[_0x44b0[51]](_0x44b0[50])[_0x44b0[49]](_0x3d0cxf[_0x44b0[48]][_0x44b0[47]])[_0x44b0[20]](function(_0x3d0cx18){if(!_0x3d0cx18){return _0x3d0cx10[_0x44b0[35]](404)};var _0x3d0cx2f=_0x3d0cx18[_0x44b0[43]];delete _0x3d0cx2f[_0x44b0[47]];delete _0x3d0cx2f[_0x44b0[104]];delete _0x3d0cx2f[_0x44b0[105]];_0x3d0cx2f[_0x44b0[87]]= _0x3d0cxf[_0x44b0[106]][_0x44b0[87]];_0x3d0cx2d= _[_0x44b0[107]](_0x3d0cx2f.Fields,_0x44b0[43]);return CustomReport[_0x44b0[94]](_0x3d0cx2f,{transaction:_0x3d0cx2e})})[_0x44b0[20]](function(_0x3d0cx18){return [_0x3d0cx18,_0x3d0cx2d]})[_0x44b0[31]](createFields(_0x3d0cx2e))})[_0x44b0[20]](function(){return _0x3d0cx10[_0x44b0[35]](201)})[_0x44b0[17]](function(_0x3d0cx12){console[_0x44b0[26]](_0x3d0cx12);return handleError(_0x3d0cx10,_0x3d0cx12)})};exports[_0x44b0[94]]= function(_0x3d0cxf,_0x3d0cx10){var _0x3d0cx16;return sequelize[_0x44b0[108]](function(_0x3d0cx2e){return CustomReport[_0x44b0[94]](_0x3d0cxf[_0x44b0[106]],{transaction:_0x3d0cx2e})[_0x44b0[20]](function(_0x3d0cx18){_0x3d0cx16= _0x3d0cx18;return [_0x3d0cx16,_0x3d0cxf[_0x44b0[106]][_0x44b0[109]]]})[_0x44b0[31]](createFields(_0x3d0cx2e))})[_0x44b0[20]](function(){return _0x3d0cx10[_0x44b0[19]](201)[_0x44b0[18]](_0x3d0cx16)})[_0x44b0[17]](function(_0x3d0cx12){console[_0x44b0[26]](_0x3d0cx12);return handleError(_0x3d0cx10,_0x3d0cx12)})};exports[_0x44b0[110]]= function(_0x3d0cxf,_0x3d0cx10){var _0x3d0cx16;return sequelize[_0x44b0[108]](function(_0x3d0cx2e){return CustomReport[_0x44b0[94]](_0x3d0cxf[_0x44b0[106]],{transaction:_0x3d0cx2e})[_0x44b0[20]](function(_0x3d0cx18){_0x3d0cx16= _0x3d0cx18;return [_0x3d0cx16,_0x3d0cxf[_0x44b0[106]][_0x44b0[109]]]})[_0x44b0[31]](createImportFields(_0x3d0cx2e))})[_0x44b0[20]](function(){return _0x3d0cx10[_0x44b0[19]](201)[_0x44b0[18]](_0x3d0cx16)})[_0x44b0[17]](function(_0x3d0cx12){console[_0x44b0[26]](_0x3d0cx12);return handleError(_0x3d0cx10,_0x3d0cx12)})};exports[_0x44b0[111]]= function(_0x3d0cxf,_0x3d0cx10,_0x3d0cx11){if(_0x3d0cxf[_0x44b0[106]][_0x44b0[47]]){delete _0x3d0cxf[_0x44b0[106]][_0x44b0[47]]};var _0x3d0cx16;return sequelize[_0x44b0[108]](function(_0x3d0cx2e){return CustomReport[_0x44b0[49]](_0x3d0cxf[_0x44b0[48]][_0x44b0[47]])[_0x44b0[20]](function(_0x3d0cx18){if(!_0x3d0cx18){return _0x3d0cx10[_0x44b0[35]](404)};var _0x3d0cx30=_[_0x44b0[112]](_0x3d0cx18,_0x3d0cxf[_0x44b0[106]]);return _0x3d0cx18[_0x44b0[113]]({transaction:_0x3d0cx2e})})[_0x44b0[20]](function(_0x3d0cx18){_0x3d0cx16= _0x3d0cx18;if(_0x3d0cxf[_0x44b0[106]][_0x44b0[109]]){return ReportField[_0x44b0[74]]({where:{CustomReportId:_0x3d0cxf[_0x44b0[48]][_0x44b0[47]]},transaction:_0x3d0cx2e})}})[_0x44b0[20]](function(){return [_0x3d0cx16,_0x3d0cxf[_0x44b0[106]][_0x44b0[109]]]})[_0x44b0[31]](createFields(_0x3d0cx2e))})[_0x44b0[20]](function(){return _0x3d0cx10[_0x44b0[35]](200)})[_0x44b0[17]](function(_0x3d0cx12){console[_0x44b0[26]](_0x3d0cx12);return handleError(_0x3d0cx10,_0x3d0cx12)})};function createFields(_0x3d0cx2e){return function(_0x3d0cx18,_0x3d0cx32){if(_0x3d0cx32&& Array[_0x44b0[53]](_0x3d0cx32)&& _0x3d0cx32[_0x44b0[54]]){var _0x3d0cx33=reportBuildUtils[_0x44b0[114]](_0x3d0cx18[_0x44b0[42]]);if(_0x3d0cx33){var _0x3d0cx34;return _0x3d0cx33[_0x44b0[127]]()[_0x44b0[20]](function(_0x3d0cx39){_0x3d0cx34= _[_0x44b0[125]](_0x3d0cx39);return Metric[_0x44b0[126]]()})[_0x44b0[20]](function(_0x3d0cx35){var _0x3d0cx36=[];_0x3d0cx35= _[_0x44b0[107]](_0x3d0cx35,_0x44b0[43]);_0x3d0cx32[_0x44b0[62]](function(_0x3d0cx37){_0x3d0cx37[_0x44b0[115]]= _0x3d0cx18[_0x44b0[47]];if(_0x3d0cx37[_0x44b0[116]]){var _0x3d0cx38=_[_0x44b0[72]](_0x3d0cx35,{id:_0x3d0cx37[_0x44b0[116]]});if(_0x3d0cx38){_0x3d0cx37[_0x44b0[117]]= _0x3d0cx38[_0x44b0[118]];_0x3d0cx36[_0x44b0[75]](ReportField[_0x44b0[94]](_0x3d0cx37,{transaction:_0x3d0cx2e}))}else {throw  new sequelize.Error(_0x44b0[119]+ _0x3d0cx37[_0x44b0[116]]+ _0x44b0[120])}}else {if(_[_0x44b0[121]](_0x3d0cx34,_0x3d0cx37[_0x44b0[117]])|| _0x3d0cx37[_0x44b0[122]]){_0x3d0cx36[_0x44b0[75]](ReportField[_0x44b0[94]](_0x3d0cx37,{transaction:_0x3d0cx2e}))}else {throw  new sequelize.Error(_0x44b0[123]+ _0x3d0cx37[_0x44b0[117]]+ _0x44b0[124])}}});return _0x3d0cx36})[_0x44b0[29]]()}else {throw  new sequelize.Error(_0x44b0[128])}}}}function createImportFields(_0x3d0cx2e){return function(_0x3d0cx18,_0x3d0cx32){if(_0x3d0cx32&& Array[_0x44b0[53]](_0x3d0cx32)&& _0x3d0cx32[_0x44b0[54]]){var _0x3d0cx33=reportBuildUtils[_0x44b0[114]](_0x3d0cx18[_0x44b0[42]]);if(_0x3d0cx33){var _0x3d0cx34;return _0x3d0cx33[_0x44b0[127]]()[_0x44b0[20]](function(_0x3d0cx39){_0x3d0cx34= _[_0x44b0[125]](_0x3d0cx39);var _0x3d0cx36=[];var _0x3d0cx3b;if(_[_0x44b0[131]](_0x3d0cx32,function(_0x3d0cx37){return _[_0x44b0[130]](_0x3d0cx37,_0x44b0[129])})){_0x3d0cx3b= _0x44b0[132]}else {if(_[_0x44b0[131]](_0x3d0cx32,function(_0x3d0cx37){return _[_0x44b0[130]](_0x3d0cx37,_0x44b0[116])})){_0x3d0cx3b= _0x44b0[7]}else {throw  new sequelize.Error(_0x44b0[133])}};var _0x3d0cx3c=_[_0x44b0[135]](_0x3d0cx32,_0x3d0cx3b+ _0x44b0[134]);_[_0x44b0[61]](_0x3d0cx3c,function(_0x3d0cx3d,_0x3d0cx1d){if(_0x3d0cx1d!== _0x44b0[136]&& _0x3d0cx1d!== _0x44b0[137]){_0x3d0cx3d[0][_0x3d0cx3b][_0x44b0[138]][_0x44b0[62]](function(_0x3d0cx37){_0x3d0cx37[_0x44b0[115]]= _0x3d0cx18[_0x44b0[47]]});_0x3d0cx3d[0][_0x3d0cx3b][_0x44b0[88]]+= _0x44b0[139]+ sr({length:5});_0x3d0cx36[_0x44b0[75]](Metric[_0x44b0[94]](_0x3d0cx3d[0][_0x3d0cx3b],{include:[{model:ReportField,as:_0x44b0[138]}],transaction:_0x3d0cx2e}))}else {_0x3d0cx3d[_0x44b0[62]](function(_0x3d0cx37){if(_[_0x44b0[121]](_0x3d0cx34,_0x3d0cx37[_0x44b0[117]])|| _0x3d0cx37[_0x44b0[122]]){_0x3d0cx37[_0x44b0[115]]= _0x3d0cx18[_0x44b0[47]];_0x3d0cx36[_0x44b0[75]](ReportField[_0x44b0[94]](_0x3d0cx37,{transaction:_0x3d0cx2e}))}else {throw  new sequelize.Error(_0x44b0[123]+ _0x3d0cx37[_0x44b0[117]]+ _0x44b0[124])}})}});return _0x3d0cx36})[_0x44b0[29]]()}else {throw  new sequelize.Error(_0x44b0[128])}}}}exports[_0x44b0[74]]= function(_0x3d0cxf,_0x3d0cx10){return CustomReport[_0x44b0[49]](_0x3d0cxf[_0x44b0[48]][_0x44b0[47]])[_0x44b0[20]](function(_0x3d0cx18){if(!_0x3d0cx18){return _0x3d0cx10[_0x44b0[35]](404)};return _0x3d0cx18[_0x44b0[74]]()})[_0x44b0[20]](function(){return _0x3d0cx10[_0x44b0[35]](204)})[_0x44b0[17]](function(_0x3d0cx12){return handleError(_0x3d0cx10,_0x3d0cx12)})};exports[_0x44b0[140]]= function(_0x3d0cxf,_0x3d0cx10){return CustomReport[_0x44b0[74]]({where:{id:_0x3d0cxf[_0x44b0[21]][_0x44b0[141]]},individualHooks:true})[_0x44b0[20]](function(){return _0x3d0cx10[_0x44b0[35]](204)})[_0x44b0[17]](function(_0x3d0cx12){return handleError(_0x3d0cx10,_0x3d0cx12)})};function handleError(_0x3d0cx10,_0x3d0cx12){return _0x3d0cx10[_0x44b0[19]](500)[_0x44b0[18]](_0x3d0cx12)}
\ No newline at end of file