Built motion from commit 16cc8f1.|1.0.14
[motion.git] / server / api / custom_report / custom_report.controller.js
index 9b75b0f..437241d 100644 (file)
@@ -1 +1 @@
-var _0x2c4f=["\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"];_0x2c4f[0];var _=require(_0x2c4f[1]);var util=require(_0x2c4f[2]);var sequelize=require(_0x2c4f[4])[_0x2c4f[3]];var CustomReport=require(_0x2c4f[4])[_0x2c4f[5]];var ReportField=require(_0x2c4f[4])[_0x2c4f[6]];var Metric=require(_0x2c4f[4])[_0x2c4f[7]];var ExtractedReport=require(_0x2c4f[4])[_0x2c4f[8]];var extractUtils=require(_0x2c4f[9]);var reportBuildUtils=require(_0x2c4f[10]);var Util=require(_0x2c4f[11]);var sr=require(_0x2c4f[12]);var moment=require(_0x2c4f[13]);var cp=require(_0x2c4f[14]);var ReportTree=require(_0x2c4f[4])[_0x2c4f[15]];exports[_0x2c4f[16]]= function(_0xfaa1xf,_0xfaa1x10,_0xfaa1x11){return CustomReport[_0x2c4f[23]](Util[_0x2c4f[22]](_0xfaa1xf[_0x2c4f[21]],{deletedAt:null}))[_0x2c4f[20]](function(_0xfaa1x13){_0xfaa1x10[_0x2c4f[19]](200)[_0x2c4f[18]](_0xfaa1x13)})[_0x2c4f[17]](function(_0xfaa1x12){return handleError(_0xfaa1x10,_0xfaa1x12)})};exports[_0x2c4f[24]]= function(_0xfaa1xf,_0xfaa1x10){return Promise[_0x2c4f[29]]([])[_0x2c4f[20]](getQuery(_0xfaa1xf,_0xfaa1x10))[_0x2c4f[20]](function(_0xfaa1x14){if(_0xfaa1x14){switch(_0xfaa1x14){case _0x2c4f[28]:_0xfaa1x14= _0x2c4f[27];break;default:}};_0xfaa1x10[_0x2c4f[19]](200)[_0x2c4f[18]]({query:_0xfaa1x14})})[_0x2c4f[17]](function(_0xfaa1x12){console[_0x2c4f[26]](_0x2c4f[25],_0xfaa1x12)})};function getQuery(_0xfaa1xf,_0xfaa1x10){var _0xfaa1x16;return function(){return CustomReport[_0x2c4f[51]](_0x2c4f[50])[_0x2c4f[49]](_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]])[_0x2c4f[20]](function(_0xfaa1x18){console[_0x2c4f[26]](_0x2c4f[34]);if(!_0xfaa1x18){return _0xfaa1x10[_0x2c4f[35]](404)};if(_0xfaa1xf[_0x2c4f[21]][_0x2c4f[36]]&& _0xfaa1xf[_0x2c4f[21]][_0x2c4f[36]]=== _0x2c4f[37]){_0xfaa1xf[_0x2c4f[21]][_0x2c4f[38]]= moment()[_0x2c4f[40]](_0x2c4f[39]);_0xfaa1xf[_0x2c4f[21]][_0x2c4f[41]]= moment()[_0x2c4f[40]](_0x2c4f[39]);_0xfaa1x18[_0x2c4f[43]][_0x2c4f[42]]= _0xfaa1x18[_0x2c4f[43]][_0x2c4f[42]][_0x2c4f[46]](_0x2c4f[44],_0x2c4f[45])};delete _0xfaa1xf[_0x2c4f[21]][_0x2c4f[36]];_0xfaa1x16= _0xfaa1x18[_0x2c4f[43]];return _0xfaa1x16[_0x2c4f[42]]})[_0x2c4f[20]](reportBuildUtils[_0x2c4f[33]](_0xfaa1xf[_0x2c4f[32]]))[_0x2c4f[20]](function(_0xfaa1x17){return [_0xfaa1x17,_0xfaa1x16]})[_0x2c4f[31]](reportBuildUtils[_0x2c4f[30]](_0xfaa1xf[_0x2c4f[21]]))}}exports[_0x2c4f[52]]= function(_0xfaa1xf,_0xfaa1x10){var _0xfaa1x19;return Promise[_0x2c4f[29]]([])[_0x2c4f[20]](getQuery(_0xfaa1xf,_0xfaa1x10))[_0x2c4f[20]](reportBuildUtils[_0x2c4f[64]]())[_0x2c4f[20]](function(_0xfaa1x1a){if(_0xfaa1x1a&& _[_0x2c4f[53]](_0xfaa1x1a)){_0xfaa1x19= _0xfaa1x1a[_0x2c4f[54]];if(_0xfaa1xf[_0x2c4f[21]][_0x2c4f[55]]){_0xfaa1x1a= _(_0xfaa1x1a)[_0x2c4f[59]](_0xfaa1xf[_0x2c4f[21]][_0x2c4f[58]]|| 0)[_0x2c4f[57]](_0xfaa1xf[_0x2c4f[21]][_0x2c4f[55]])[_0x2c4f[56]]()};_[_0x2c4f[62]](_0xfaa1x1a,function(_0xfaa1x1b){_[_0x2c4f[61]](_0xfaa1x1b,function(_0xfaa1x1c,_0xfaa1x1d){if(_0xfaa1x1c instanceof  Date){_0xfaa1x1b[_0xfaa1x1d]= moment(_0xfaa1x1c)[_0x2c4f[40]](_0x2c4f[60]).toString()}})});_0xfaa1x10[_0x2c4f[19]](200)[_0x2c4f[18]]({rows:_0xfaa1x1a,count:_0xfaa1x19})}else {return handleError(_0xfaa1x10,{message:_0xfaa1x1a|| _0x2c4f[63]})}})[_0x2c4f[17]](function(_0xfaa1x12){console[_0x2c4f[26]](_0xfaa1x12);return handleError(_0xfaa1x10,_0xfaa1x12)})};exports[_0x2c4f[65]]= function(_0xfaa1xf,_0xfaa1x10){docExtract(_0xfaa1xf,_0xfaa1x10,_0x2c4f[66])};exports[_0x2c4f[67]]= function(_0xfaa1xf,_0xfaa1x10){docExtract(_0xfaa1xf,_0xfaa1x10,_0x2c4f[68])};exports[_0x2c4f[69]]= function(_0xfaa1xf,_0xfaa1x10){return ReportTree[_0x2c4f[49]](2)[_0x2c4f[20]](function(_0xfaa1x1e){_0xfaa1x1e= JSON[_0x2c4f[71]](_0xfaa1x1e[_0x2c4f[70]]);var _0xfaa1x1f=_[_0x2c4f[72]](_0xfaa1x1e,{id:_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]]});if(!_0xfaa1x1f){throw  new Error(_0x2c4f[73])};var _0xfaa1x20=[];findSubNodes(_0xfaa1x1f,_0xfaa1x1e,_0xfaa1x20);return CustomReport[_0x2c4f[74]]({where:{parent:_0xfaa1x20},individualHooks:true})})[_0x2c4f[20]](function(){return _0xfaa1x10[_0x2c4f[35]](200)})[_0x2c4f[17]](function(_0xfaa1x12){console[_0x2c4f[26]](_0xfaa1x12);return handleError(_0xfaa1x10,_0xfaa1x12)})};function findSubNodes(_0xfaa1x1f,_0xfaa1x1e,_0xfaa1x22){_0xfaa1x22[_0x2c4f[75]](_0xfaa1x1f[_0x2c4f[47]]);var _0xfaa1x23=_[_0x2c4f[76]](_0xfaa1x1e,{parent:_0xfaa1x1f[_0x2c4f[47]]});if(!_0xfaa1x23||  !_0xfaa1x23[_0x2c4f[54]]){return};_[_0x2c4f[62]](_0xfaa1x23,function(_0xfaa1x24){findSubNodes(_0xfaa1x24,_0xfaa1x1e,_0xfaa1x22)})}function docExtract(_0xfaa1xf,_0xfaa1x10,_0xfaa1x26){var _0xfaa1x18;CustomReport[_0x2c4f[51]](_0x2c4f[50])[_0x2c4f[49]](_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]])[_0x2c4f[20]](function(_0xfaa1x16){if(!_0xfaa1x16){return _0xfaa1x10[_0x2c4f[35]](404)};_0xfaa1x18= _0xfaa1x16;return ReportTree[_0x2c4f[49]](2)})[_0x2c4f[20]](function(_0xfaa1x1e){_0xfaa1x1e= JSON[_0x2c4f[71]](_0xfaa1x1e[_0x2c4f[70]]);var _0xfaa1x2a=_[_0x2c4f[72]](_0xfaa1x1e,{id:_0xfaa1x18[_0x2c4f[87]]});var _0xfaa1x2b=getReportPath(_0xfaa1x2a,_0xfaa1x1e,_0xfaa1x18[_0x2c4f[88]]);if(_0xfaa1xf[_0x2c4f[21]][_0x2c4f[36]]&& _0xfaa1xf[_0x2c4f[21]][_0x2c4f[36]]=== _0x2c4f[37]){_0xfaa1xf[_0x2c4f[21]][_0x2c4f[38]]= moment()[_0x2c4f[40]](_0x2c4f[39]);_0xfaa1xf[_0x2c4f[21]][_0x2c4f[41]]= moment()[_0x2c4f[40]](_0x2c4f[39]);_0xfaa1x18[_0x2c4f[43]][_0x2c4f[42]]= _0xfaa1x18[_0x2c4f[43]][_0x2c4f[42]][_0x2c4f[46]](_0x2c4f[44],_0x2c4f[45])};delete _0xfaa1xf[_0x2c4f[21]][_0x2c4f[36]];return [_0xfaa1x18,ExtractedReport[_0x2c4f[94]]({name:_0xfaa1x2b,startDate:_0xfaa1xf[_0x2c4f[21]][_0x2c4f[38]]?_0xfaa1xf[_0x2c4f[21]][_0x2c4f[38]]+ (_0xfaa1xf[_0x2c4f[21]][_0x2c4f[89]]?_0x2c4f[90]+ _0xfaa1xf[_0x2c4f[21]][_0x2c4f[89]]:_0x2c4f[91]):null,endDate:_0xfaa1xf[_0x2c4f[21]][_0x2c4f[41]]?_0xfaa1xf[_0x2c4f[21]][_0x2c4f[41]]+ (_0xfaa1xf[_0x2c4f[21]][_0x2c4f[92]]?_0x2c4f[90]+ _0xfaa1xf[_0x2c4f[21]][_0x2c4f[92]]:_0x2c4f[93]):null,output:_0xfaa1x26,UserId:_0xfaa1xf[_0x2c4f[32]][_0x2c4f[47]]})]})[_0x2c4f[31]](function(_0xfaa1x18,_0xfaa1x27){var _0xfaa1x28=cp[_0x2c4f[78]](__dirname+ _0x2c4f[77]);_0xfaa1x28[_0x2c4f[81]](_0x2c4f[84],function(_0xfaa1x29){console[_0x2c4f[26]](_0x2c4f[85],_0xfaa1x29);_0xfaa1x28[_0x2c4f[86]]()})[_0x2c4f[81]](_0x2c4f[82],function(){console[_0x2c4f[26]](_0x2c4f[83])})[_0x2c4f[81]](_0x2c4f[79],function(_0xfaa1x12){console[_0x2c4f[26]](_0x2c4f[80],_0xfaa1x12)});_0xfaa1x28[_0x2c4f[18]]({report:_0xfaa1x18,query:_0xfaa1xf[_0x2c4f[21]],extractedId:_0xfaa1x27[_0x2c4f[47]],user:_0xfaa1xf[_0x2c4f[32]],type:_0xfaa1x26})})[_0x2c4f[17]](function(_0xfaa1x12){console[_0x2c4f[26]](_0xfaa1x12);return handleError(_0xfaa1x10,_0xfaa1x12)});return _0xfaa1x10[_0x2c4f[35]](200)}function getReportPath(_0xfaa1x2a,_0xfaa1x1e,_0xfaa1x2b){_0xfaa1x2b= _0xfaa1x2a[_0x2c4f[95]]+ _0x2c4f[96]+ _0xfaa1x2b;if(_0xfaa1x2a[_0x2c4f[87]]=== _0x2c4f[97]){return _0xfaa1x2b}else {return getReportPath(_[_0x2c4f[72]](_0xfaa1x1e,{id:_0xfaa1x2a[_0x2c4f[87]]}),_0xfaa1x1e,_0xfaa1x2b)}}exports[_0x2c4f[98]]= function(_0xfaa1xf,_0xfaa1x10){return CustomReport[_0x2c4f[51]](_0x2c4f[50])[_0x2c4f[49]](_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]])[_0x2c4f[20]](function(_0xfaa1x18){if(!_0xfaa1x18){return _0xfaa1x10[_0x2c4f[35]](404)};return _0xfaa1x10[_0x2c4f[18]](_0xfaa1x18)})[_0x2c4f[17]](function(_0xfaa1x12){return handleError(_0xfaa1x10,_0xfaa1x12)})};exports[_0x2c4f[99]]= function(_0xfaa1xf,_0xfaa1x10){return CustomReport[_0x2c4f[51]]({method:[_0x2c4f[102],{CustomReportId:_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]]}]})[_0x2c4f[49]](_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]],{attributes:[_0x2c4f[100],_0x2c4f[101],_0x2c4f[88],_0x2c4f[87],_0x2c4f[42]]})[_0x2c4f[20]](function(_0xfaa1x18){if(!_0xfaa1x18){return _0xfaa1x10[_0x2c4f[35]](404)};return _0xfaa1x10[_0x2c4f[18]](_0xfaa1x18)})[_0x2c4f[17]](function(_0xfaa1x12){return handleError(_0xfaa1x10,_0xfaa1x12)})};exports[_0x2c4f[103]]= function(_0xfaa1xf,_0xfaa1x10){var _0xfaa1x2d;return sequelize[_0x2c4f[108]](function(_0xfaa1x2e){return CustomReport[_0x2c4f[51]](_0x2c4f[50])[_0x2c4f[49]](_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]])[_0x2c4f[20]](function(_0xfaa1x18){if(!_0xfaa1x18){return _0xfaa1x10[_0x2c4f[35]](404)};var _0xfaa1x2f=_0xfaa1x18[_0x2c4f[43]];delete _0xfaa1x2f[_0x2c4f[47]];delete _0xfaa1x2f[_0x2c4f[104]];delete _0xfaa1x2f[_0x2c4f[105]];_0xfaa1x2f[_0x2c4f[87]]= _0xfaa1xf[_0x2c4f[106]][_0x2c4f[87]];_0xfaa1x2d= _[_0x2c4f[107]](_0xfaa1x2f.Fields,_0x2c4f[43]);return CustomReport[_0x2c4f[94]](_0xfaa1x2f,{transaction:_0xfaa1x2e})})[_0x2c4f[20]](function(_0xfaa1x18){return [_0xfaa1x18,_0xfaa1x2d]})[_0x2c4f[31]](createFields(_0xfaa1x2e))})[_0x2c4f[20]](function(){return _0xfaa1x10[_0x2c4f[35]](201)})[_0x2c4f[17]](function(_0xfaa1x12){console[_0x2c4f[26]](_0xfaa1x12);return handleError(_0xfaa1x10,_0xfaa1x12)})};exports[_0x2c4f[94]]= function(_0xfaa1xf,_0xfaa1x10){var _0xfaa1x16;return sequelize[_0x2c4f[108]](function(_0xfaa1x2e){return CustomReport[_0x2c4f[94]](_0xfaa1xf[_0x2c4f[106]],{transaction:_0xfaa1x2e})[_0x2c4f[20]](function(_0xfaa1x18){_0xfaa1x16= _0xfaa1x18;return [_0xfaa1x16,_0xfaa1xf[_0x2c4f[106]][_0x2c4f[109]]]})[_0x2c4f[31]](createFields(_0xfaa1x2e))})[_0x2c4f[20]](function(){return _0xfaa1x10[_0x2c4f[19]](201)[_0x2c4f[18]](_0xfaa1x16)})[_0x2c4f[17]](function(_0xfaa1x12){console[_0x2c4f[26]](_0xfaa1x12);return handleError(_0xfaa1x10,_0xfaa1x12)})};exports[_0x2c4f[110]]= function(_0xfaa1xf,_0xfaa1x10){var _0xfaa1x16;return sequelize[_0x2c4f[108]](function(_0xfaa1x2e){return CustomReport[_0x2c4f[94]](_0xfaa1xf[_0x2c4f[106]],{transaction:_0xfaa1x2e})[_0x2c4f[20]](function(_0xfaa1x18){_0xfaa1x16= _0xfaa1x18;return [_0xfaa1x16,_0xfaa1xf[_0x2c4f[106]][_0x2c4f[109]]]})[_0x2c4f[31]](createImportFields(_0xfaa1x2e))})[_0x2c4f[20]](function(){return _0xfaa1x10[_0x2c4f[19]](201)[_0x2c4f[18]](_0xfaa1x16)})[_0x2c4f[17]](function(_0xfaa1x12){console[_0x2c4f[26]](_0xfaa1x12);return handleError(_0xfaa1x10,_0xfaa1x12)})};exports[_0x2c4f[111]]= function(_0xfaa1xf,_0xfaa1x10,_0xfaa1x11){if(_0xfaa1xf[_0x2c4f[106]][_0x2c4f[47]]){delete _0xfaa1xf[_0x2c4f[106]][_0x2c4f[47]]};var _0xfaa1x16;return sequelize[_0x2c4f[108]](function(_0xfaa1x2e){return CustomReport[_0x2c4f[49]](_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]])[_0x2c4f[20]](function(_0xfaa1x18){if(!_0xfaa1x18){return _0xfaa1x10[_0x2c4f[35]](404)};var _0xfaa1x30=_[_0x2c4f[112]](_0xfaa1x18,_0xfaa1xf[_0x2c4f[106]]);return _0xfaa1x18[_0x2c4f[113]]({transaction:_0xfaa1x2e})})[_0x2c4f[20]](function(_0xfaa1x18){_0xfaa1x16= _0xfaa1x18;if(_0xfaa1xf[_0x2c4f[106]][_0x2c4f[109]]){return ReportField[_0x2c4f[74]]({where:{CustomReportId:_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]]},transaction:_0xfaa1x2e})}})[_0x2c4f[20]](function(){return [_0xfaa1x16,_0xfaa1xf[_0x2c4f[106]][_0x2c4f[109]]]})[_0x2c4f[31]](createFields(_0xfaa1x2e))})[_0x2c4f[20]](function(){return _0xfaa1x10[_0x2c4f[35]](200)})[_0x2c4f[17]](function(_0xfaa1x12){console[_0x2c4f[26]](_0xfaa1x12);return handleError(_0xfaa1x10,_0xfaa1x12)})};function createFields(_0xfaa1x2e){return function(_0xfaa1x18,_0xfaa1x32){if(_0xfaa1x32&& Array[_0x2c4f[53]](_0xfaa1x32)&& _0xfaa1x32[_0x2c4f[54]]){var _0xfaa1x33=reportBuildUtils[_0x2c4f[114]](_0xfaa1x18[_0x2c4f[42]]);if(_0xfaa1x33){var _0xfaa1x34;return _0xfaa1x33[_0x2c4f[127]]()[_0x2c4f[20]](function(_0xfaa1x39){_0xfaa1x34= _[_0x2c4f[125]](_0xfaa1x39);return Metric[_0x2c4f[126]]()})[_0x2c4f[20]](function(_0xfaa1x35){var _0xfaa1x36=[];_0xfaa1x35= _[_0x2c4f[107]](_0xfaa1x35,_0x2c4f[43]);_0xfaa1x32[_0x2c4f[62]](function(_0xfaa1x37){_0xfaa1x37[_0x2c4f[115]]= _0xfaa1x18[_0x2c4f[47]];if(_0xfaa1x37[_0x2c4f[116]]){var _0xfaa1x38=_[_0x2c4f[72]](_0xfaa1x35,{id:_0xfaa1x37[_0x2c4f[116]]});if(_0xfaa1x38){_0xfaa1x37[_0x2c4f[117]]= _0xfaa1x38[_0x2c4f[118]];_0xfaa1x36[_0x2c4f[75]](ReportField[_0x2c4f[94]](_0xfaa1x37,{transaction:_0xfaa1x2e}))}else {throw  new sequelize.Error(_0x2c4f[119]+ _0xfaa1x37[_0x2c4f[116]]+ _0x2c4f[120])}}else {if(_[_0x2c4f[121]](_0xfaa1x34,_0xfaa1x37[_0x2c4f[117]])|| _0xfaa1x37[_0x2c4f[122]]){_0xfaa1x36[_0x2c4f[75]](ReportField[_0x2c4f[94]](_0xfaa1x37,{transaction:_0xfaa1x2e}))}else {throw  new sequelize.Error(_0x2c4f[123]+ _0xfaa1x37[_0x2c4f[117]]+ _0x2c4f[124])}}});return _0xfaa1x36})[_0x2c4f[29]]()}else {throw  new sequelize.Error(_0x2c4f[128])}}}}function createImportFields(_0xfaa1x2e){return function(_0xfaa1x18,_0xfaa1x32){if(_0xfaa1x32&& Array[_0x2c4f[53]](_0xfaa1x32)&& _0xfaa1x32[_0x2c4f[54]]){var _0xfaa1x33=reportBuildUtils[_0x2c4f[114]](_0xfaa1x18[_0x2c4f[42]]);if(_0xfaa1x33){var _0xfaa1x34;return _0xfaa1x33[_0x2c4f[127]]()[_0x2c4f[20]](function(_0xfaa1x39){_0xfaa1x34= _[_0x2c4f[125]](_0xfaa1x39);var _0xfaa1x36=[];var _0xfaa1x3b;if(_[_0x2c4f[131]](_0xfaa1x32,function(_0xfaa1x37){return _[_0x2c4f[130]](_0xfaa1x37,_0x2c4f[129])})){_0xfaa1x3b= _0x2c4f[132]}else {if(_[_0x2c4f[131]](_0xfaa1x32,function(_0xfaa1x37){return _[_0x2c4f[130]](_0xfaa1x37,_0x2c4f[116])})){_0xfaa1x3b= _0x2c4f[7]}else {throw  new sequelize.Error(_0x2c4f[133])}};var _0xfaa1x3c=_[_0x2c4f[135]](_0xfaa1x32,_0xfaa1x3b+ _0x2c4f[134]);_[_0x2c4f[61]](_0xfaa1x3c,function(_0xfaa1x3d,_0xfaa1x1d){if(_0xfaa1x1d!== _0x2c4f[136]&& _0xfaa1x1d!== _0x2c4f[137]){_0xfaa1x3d[0][_0xfaa1x3b][_0x2c4f[138]][_0x2c4f[62]](function(_0xfaa1x37){_0xfaa1x37[_0x2c4f[115]]= _0xfaa1x18[_0x2c4f[47]]});_0xfaa1x3d[0][_0xfaa1x3b][_0x2c4f[88]]+= _0x2c4f[139]+ sr({length:5});_0xfaa1x36[_0x2c4f[75]](Metric[_0x2c4f[94]](_0xfaa1x3d[0][_0xfaa1x3b],{include:[{model:ReportField,as:_0x2c4f[138]}],transaction:_0xfaa1x2e}))}else {_0xfaa1x3d[_0x2c4f[62]](function(_0xfaa1x37){if(_[_0x2c4f[121]](_0xfaa1x34,_0xfaa1x37[_0x2c4f[117]])|| _0xfaa1x37[_0x2c4f[122]]){_0xfaa1x37[_0x2c4f[115]]= _0xfaa1x18[_0x2c4f[47]];_0xfaa1x36[_0x2c4f[75]](ReportField[_0x2c4f[94]](_0xfaa1x37,{transaction:_0xfaa1x2e}))}else {throw  new sequelize.Error(_0x2c4f[123]+ _0xfaa1x37[_0x2c4f[117]]+ _0x2c4f[124])}})}});return _0xfaa1x36})[_0x2c4f[29]]()}else {throw  new sequelize.Error(_0x2c4f[128])}}}}exports[_0x2c4f[74]]= function(_0xfaa1xf,_0xfaa1x10){return CustomReport[_0x2c4f[49]](_0xfaa1xf[_0x2c4f[48]][_0x2c4f[47]])[_0x2c4f[20]](function(_0xfaa1x18){if(!_0xfaa1x18){return _0xfaa1x10[_0x2c4f[35]](404)};return _0xfaa1x18[_0x2c4f[74]]()})[_0x2c4f[20]](function(){return _0xfaa1x10[_0x2c4f[35]](204)})[_0x2c4f[17]](function(_0xfaa1x12){return handleError(_0xfaa1x10,_0xfaa1x12)})};exports[_0x2c4f[140]]= function(_0xfaa1xf,_0xfaa1x10){return CustomReport[_0x2c4f[74]]({where:{id:_0xfaa1xf[_0x2c4f[21]][_0x2c4f[141]]},individualHooks:true})[_0x2c4f[20]](function(){return _0xfaa1x10[_0x2c4f[35]](204)})[_0x2c4f[17]](function(_0xfaa1x12){return handleError(_0xfaa1x10,_0xfaa1x12)})};function handleError(_0xfaa1x10,_0xfaa1x12){return _0xfaa1x10[_0x2c4f[19]](500)[_0x2c4f[18]](_0xfaa1x12)}
\ No newline at end of file
+var _0x81f8=["\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"];_0x81f8[0];var _=require(_0x81f8[1]);var util=require(_0x81f8[2]);var sequelize=require(_0x81f8[4])[_0x81f8[3]];var CustomReport=require(_0x81f8[4])[_0x81f8[5]];var ReportField=require(_0x81f8[4])[_0x81f8[6]];var Metric=require(_0x81f8[4])[_0x81f8[7]];var ExtractedReport=require(_0x81f8[4])[_0x81f8[8]];var extractUtils=require(_0x81f8[9]);var reportBuildUtils=require(_0x81f8[10]);var Util=require(_0x81f8[11]);var sr=require(_0x81f8[12]);var moment=require(_0x81f8[13]);var cp=require(_0x81f8[14]);var ReportTree=require(_0x81f8[4])[_0x81f8[15]];exports[_0x81f8[16]]= function(_0xf738xf,_0xf738x10,_0xf738x11){return CustomReport[_0x81f8[23]](Util[_0x81f8[22]](_0xf738xf[_0x81f8[21]],{deletedAt:null}))[_0x81f8[20]](function(_0xf738x13){_0xf738x10[_0x81f8[19]](200)[_0x81f8[18]](_0xf738x13)})[_0x81f8[17]](function(_0xf738x12){return handleError(_0xf738x10,_0xf738x12)})};exports[_0x81f8[24]]= function(_0xf738xf,_0xf738x10){return Promise[_0x81f8[29]]([])[_0x81f8[20]](getQuery(_0xf738xf,_0xf738x10))[_0x81f8[20]](function(_0xf738x14){if(_0xf738x14){switch(_0xf738x14){case _0x81f8[28]:_0xf738x14= _0x81f8[27];break;default:}};_0xf738x10[_0x81f8[19]](200)[_0x81f8[18]]({query:_0xf738x14})})[_0x81f8[17]](function(_0xf738x12){console[_0x81f8[26]](_0x81f8[25],_0xf738x12)})};function getQuery(_0xf738xf,_0xf738x10){var _0xf738x16;return function(){return CustomReport[_0x81f8[51]](_0x81f8[50])[_0x81f8[49]](_0xf738xf[_0x81f8[48]][_0x81f8[47]])[_0x81f8[20]](function(_0xf738x18){console[_0x81f8[26]](_0x81f8[34]);if(!_0xf738x18){return _0xf738x10[_0x81f8[35]](404)};if(_0xf738xf[_0x81f8[21]][_0x81f8[36]]&& _0xf738xf[_0x81f8[21]][_0x81f8[36]]=== _0x81f8[37]){_0xf738xf[_0x81f8[21]][_0x81f8[38]]= moment()[_0x81f8[40]](_0x81f8[39]);_0xf738xf[_0x81f8[21]][_0x81f8[41]]= moment()[_0x81f8[40]](_0x81f8[39]);_0xf738x18[_0x81f8[43]][_0x81f8[42]]= _0xf738x18[_0x81f8[43]][_0x81f8[42]][_0x81f8[46]](_0x81f8[44],_0x81f8[45])};delete _0xf738xf[_0x81f8[21]][_0x81f8[36]];_0xf738x16= _0xf738x18[_0x81f8[43]];return _0xf738x16[_0x81f8[42]]})[_0x81f8[20]](reportBuildUtils[_0x81f8[33]](_0xf738xf[_0x81f8[32]]))[_0x81f8[20]](function(_0xf738x17){return [_0xf738x17,_0xf738x16]})[_0x81f8[31]](reportBuildUtils[_0x81f8[30]](_0xf738xf[_0x81f8[21]]))}}exports[_0x81f8[52]]= function(_0xf738xf,_0xf738x10){var _0xf738x19;return Promise[_0x81f8[29]]([])[_0x81f8[20]](getQuery(_0xf738xf,_0xf738x10))[_0x81f8[20]](reportBuildUtils[_0x81f8[64]]())[_0x81f8[20]](function(_0xf738x1a){if(_0xf738x1a&& _[_0x81f8[53]](_0xf738x1a)){_0xf738x19= _0xf738x1a[_0x81f8[54]];if(_0xf738xf[_0x81f8[21]][_0x81f8[55]]){_0xf738x1a= _(_0xf738x1a)[_0x81f8[59]](_0xf738xf[_0x81f8[21]][_0x81f8[58]]|| 0)[_0x81f8[57]](_0xf738xf[_0x81f8[21]][_0x81f8[55]])[_0x81f8[56]]()};_[_0x81f8[62]](_0xf738x1a,function(_0xf738x1b){_[_0x81f8[61]](_0xf738x1b,function(_0xf738x1c,_0xf738x1d){if(_0xf738x1c instanceof  Date){_0xf738x1b[_0xf738x1d]= moment(_0xf738x1c)[_0x81f8[40]](_0x81f8[60]).toString()}})});_0xf738x10[_0x81f8[19]](200)[_0x81f8[18]]({rows:_0xf738x1a,count:_0xf738x19})}else {return handleError(_0xf738x10,{message:_0xf738x1a|| _0x81f8[63]})}})[_0x81f8[17]](function(_0xf738x12){console[_0x81f8[26]](_0xf738x12);return handleError(_0xf738x10,_0xf738x12)})};exports[_0x81f8[65]]= function(_0xf738xf,_0xf738x10){docExtract(_0xf738xf,_0xf738x10,_0x81f8[66])};exports[_0x81f8[67]]= function(_0xf738xf,_0xf738x10){docExtract(_0xf738xf,_0xf738x10,_0x81f8[68])};exports[_0x81f8[69]]= function(_0xf738xf,_0xf738x10){return ReportTree[_0x81f8[49]](2)[_0x81f8[20]](function(_0xf738x1e){_0xf738x1e= JSON[_0x81f8[71]](_0xf738x1e[_0x81f8[70]]);var _0xf738x1f=_[_0x81f8[72]](_0xf738x1e,{id:_0xf738xf[_0x81f8[48]][_0x81f8[47]]});if(!_0xf738x1f){throw  new Error(_0x81f8[73])};var _0xf738x20=[];findSubNodes(_0xf738x1f,_0xf738x1e,_0xf738x20);return CustomReport[_0x81f8[74]]({where:{parent:_0xf738x20},individualHooks:true})})[_0x81f8[20]](function(){return _0xf738x10[_0x81f8[35]](200)})[_0x81f8[17]](function(_0xf738x12){console[_0x81f8[26]](_0xf738x12);return handleError(_0xf738x10,_0xf738x12)})};function findSubNodes(_0xf738x1f,_0xf738x1e,_0xf738x22){_0xf738x22[_0x81f8[75]](_0xf738x1f[_0x81f8[47]]);var _0xf738x23=_[_0x81f8[76]](_0xf738x1e,{parent:_0xf738x1f[_0x81f8[47]]});if(!_0xf738x23||  !_0xf738x23[_0x81f8[54]]){return};_[_0x81f8[62]](_0xf738x23,function(_0xf738x24){findSubNodes(_0xf738x24,_0xf738x1e,_0xf738x22)})}function docExtract(_0xf738xf,_0xf738x10,_0xf738x26){var _0xf738x18;CustomReport[_0x81f8[51]](_0x81f8[50])[_0x81f8[49]](_0xf738xf[_0x81f8[48]][_0x81f8[47]])[_0x81f8[20]](function(_0xf738x16){if(!_0xf738x16){return _0xf738x10[_0x81f8[35]](404)};_0xf738x18= _0xf738x16;return ReportTree[_0x81f8[49]](2)})[_0x81f8[20]](function(_0xf738x1e){_0xf738x1e= JSON[_0x81f8[71]](_0xf738x1e[_0x81f8[70]]);var _0xf738x2a=_[_0x81f8[72]](_0xf738x1e,{id:_0xf738x18[_0x81f8[87]]});var _0xf738x2b=getReportPath(_0xf738x2a,_0xf738x1e,_0xf738x18[_0x81f8[88]]);if(_0xf738xf[_0x81f8[21]][_0x81f8[36]]&& _0xf738xf[_0x81f8[21]][_0x81f8[36]]=== _0x81f8[37]){_0xf738xf[_0x81f8[21]][_0x81f8[38]]= moment()[_0x81f8[40]](_0x81f8[39]);_0xf738xf[_0x81f8[21]][_0x81f8[41]]= moment()[_0x81f8[40]](_0x81f8[39]);_0xf738x18[_0x81f8[43]][_0x81f8[42]]= _0xf738x18[_0x81f8[43]][_0x81f8[42]][_0x81f8[46]](_0x81f8[44],_0x81f8[45])};delete _0xf738xf[_0x81f8[21]][_0x81f8[36]];return [_0xf738x18,ExtractedReport[_0x81f8[94]]({name:_0xf738x2b,startDate:_0xf738xf[_0x81f8[21]][_0x81f8[38]]?_0xf738xf[_0x81f8[21]][_0x81f8[38]]+ (_0xf738xf[_0x81f8[21]][_0x81f8[89]]?_0x81f8[90]+ _0xf738xf[_0x81f8[21]][_0x81f8[89]]:_0x81f8[91]):null,endDate:_0xf738xf[_0x81f8[21]][_0x81f8[41]]?_0xf738xf[_0x81f8[21]][_0x81f8[41]]+ (_0xf738xf[_0x81f8[21]][_0x81f8[92]]?_0x81f8[90]+ _0xf738xf[_0x81f8[21]][_0x81f8[92]]:_0x81f8[93]):null,output:_0xf738x26,UserId:_0xf738xf[_0x81f8[32]][_0x81f8[47]]})]})[_0x81f8[31]](function(_0xf738x18,_0xf738x27){var _0xf738x28=cp[_0x81f8[78]](__dirname+ _0x81f8[77]);_0xf738x28[_0x81f8[81]](_0x81f8[84],function(_0xf738x29){console[_0x81f8[26]](_0x81f8[85],_0xf738x29);_0xf738x28[_0x81f8[86]]()})[_0x81f8[81]](_0x81f8[82],function(){console[_0x81f8[26]](_0x81f8[83])})[_0x81f8[81]](_0x81f8[79],function(_0xf738x12){console[_0x81f8[26]](_0x81f8[80],_0xf738x12)});_0xf738x28[_0x81f8[18]]({report:_0xf738x18,query:_0xf738xf[_0x81f8[21]],extractedId:_0xf738x27[_0x81f8[47]],user:_0xf738xf[_0x81f8[32]],type:_0xf738x26})})[_0x81f8[17]](function(_0xf738x12){console[_0x81f8[26]](_0xf738x12);return handleError(_0xf738x10,_0xf738x12)});return _0xf738x10[_0x81f8[35]](200)}function getReportPath(_0xf738x2a,_0xf738x1e,_0xf738x2b){_0xf738x2b= _0xf738x2a[_0x81f8[95]]+ _0x81f8[96]+ _0xf738x2b;if(_0xf738x2a[_0x81f8[87]]=== _0x81f8[97]){return _0xf738x2b}else {return getReportPath(_[_0x81f8[72]](_0xf738x1e,{id:_0xf738x2a[_0x81f8[87]]}),_0xf738x1e,_0xf738x2b)}}exports[_0x81f8[98]]= function(_0xf738xf,_0xf738x10){return CustomReport[_0x81f8[51]](_0x81f8[50])[_0x81f8[49]](_0xf738xf[_0x81f8[48]][_0x81f8[47]])[_0x81f8[20]](function(_0xf738x18){if(!_0xf738x18){return _0xf738x10[_0x81f8[35]](404)};return _0xf738x10[_0x81f8[18]](_0xf738x18)})[_0x81f8[17]](function(_0xf738x12){return handleError(_0xf738x10,_0xf738x12)})};exports[_0x81f8[99]]= function(_0xf738xf,_0xf738x10){return CustomReport[_0x81f8[51]]({method:[_0x81f8[102],{CustomReportId:_0xf738xf[_0x81f8[48]][_0x81f8[47]]}]})[_0x81f8[49]](_0xf738xf[_0x81f8[48]][_0x81f8[47]],{attributes:[_0x81f8[100],_0x81f8[101],_0x81f8[88],_0x81f8[87],_0x81f8[42]]})[_0x81f8[20]](function(_0xf738x18){if(!_0xf738x18){return _0xf738x10[_0x81f8[35]](404)};return _0xf738x10[_0x81f8[18]](_0xf738x18)})[_0x81f8[17]](function(_0xf738x12){return handleError(_0xf738x10,_0xf738x12)})};exports[_0x81f8[103]]= function(_0xf738xf,_0xf738x10){var _0xf738x2d;return sequelize[_0x81f8[108]](function(_0xf738x2e){return CustomReport[_0x81f8[51]](_0x81f8[50])[_0x81f8[49]](_0xf738xf[_0x81f8[48]][_0x81f8[47]])[_0x81f8[20]](function(_0xf738x18){if(!_0xf738x18){return _0xf738x10[_0x81f8[35]](404)};var _0xf738x2f=_0xf738x18[_0x81f8[43]];delete _0xf738x2f[_0x81f8[47]];delete _0xf738x2f[_0x81f8[104]];delete _0xf738x2f[_0x81f8[105]];_0xf738x2f[_0x81f8[87]]= _0xf738xf[_0x81f8[106]][_0x81f8[87]];_0xf738x2d= _[_0x81f8[107]](_0xf738x2f.Fields,_0x81f8[43]);return CustomReport[_0x81f8[94]](_0xf738x2f,{transaction:_0xf738x2e})})[_0x81f8[20]](function(_0xf738x18){return [_0xf738x18,_0xf738x2d]})[_0x81f8[31]](createFields(_0xf738x2e))})[_0x81f8[20]](function(){return _0xf738x10[_0x81f8[35]](201)})[_0x81f8[17]](function(_0xf738x12){console[_0x81f8[26]](_0xf738x12);return handleError(_0xf738x10,_0xf738x12)})};exports[_0x81f8[94]]= function(_0xf738xf,_0xf738x10){var _0xf738x16;return sequelize[_0x81f8[108]](function(_0xf738x2e){return CustomReport[_0x81f8[94]](_0xf738xf[_0x81f8[106]],{transaction:_0xf738x2e})[_0x81f8[20]](function(_0xf738x18){_0xf738x16= _0xf738x18;return [_0xf738x16,_0xf738xf[_0x81f8[106]][_0x81f8[109]]]})[_0x81f8[31]](createFields(_0xf738x2e))})[_0x81f8[20]](function(){return _0xf738x10[_0x81f8[19]](201)[_0x81f8[18]](_0xf738x16)})[_0x81f8[17]](function(_0xf738x12){console[_0x81f8[26]](_0xf738x12);return handleError(_0xf738x10,_0xf738x12)})};exports[_0x81f8[110]]= function(_0xf738xf,_0xf738x10){var _0xf738x16;return sequelize[_0x81f8[108]](function(_0xf738x2e){return CustomReport[_0x81f8[94]](_0xf738xf[_0x81f8[106]],{transaction:_0xf738x2e})[_0x81f8[20]](function(_0xf738x18){_0xf738x16= _0xf738x18;return [_0xf738x16,_0xf738xf[_0x81f8[106]][_0x81f8[109]]]})[_0x81f8[31]](createImportFields(_0xf738x2e))})[_0x81f8[20]](function(){return _0xf738x10[_0x81f8[19]](201)[_0x81f8[18]](_0xf738x16)})[_0x81f8[17]](function(_0xf738x12){console[_0x81f8[26]](_0xf738x12);return handleError(_0xf738x10,_0xf738x12)})};exports[_0x81f8[111]]= function(_0xf738xf,_0xf738x10,_0xf738x11){if(_0xf738xf[_0x81f8[106]][_0x81f8[47]]){delete _0xf738xf[_0x81f8[106]][_0x81f8[47]]};var _0xf738x16;return sequelize[_0x81f8[108]](function(_0xf738x2e){return CustomReport[_0x81f8[49]](_0xf738xf[_0x81f8[48]][_0x81f8[47]])[_0x81f8[20]](function(_0xf738x18){if(!_0xf738x18){return _0xf738x10[_0x81f8[35]](404)};var _0xf738x30=_[_0x81f8[112]](_0xf738x18,_0xf738xf[_0x81f8[106]]);return _0xf738x18[_0x81f8[113]]({transaction:_0xf738x2e})})[_0x81f8[20]](function(_0xf738x18){_0xf738x16= _0xf738x18;if(_0xf738xf[_0x81f8[106]][_0x81f8[109]]){return ReportField[_0x81f8[74]]({where:{CustomReportId:_0xf738xf[_0x81f8[48]][_0x81f8[47]]},transaction:_0xf738x2e})}})[_0x81f8[20]](function(){return [_0xf738x16,_0xf738xf[_0x81f8[106]][_0x81f8[109]]]})[_0x81f8[31]](createFields(_0xf738x2e))})[_0x81f8[20]](function(){return _0xf738x10[_0x81f8[35]](200)})[_0x81f8[17]](function(_0xf738x12){console[_0x81f8[26]](_0xf738x12);return handleError(_0xf738x10,_0xf738x12)})};function createFields(_0xf738x2e){return function(_0xf738x18,_0xf738x32){if(_0xf738x32&& Array[_0x81f8[53]](_0xf738x32)&& _0xf738x32[_0x81f8[54]]){var _0xf738x33=reportBuildUtils[_0x81f8[114]](_0xf738x18[_0x81f8[42]]);if(_0xf738x33){var _0xf738x34;return _0xf738x33[_0x81f8[127]]()[_0x81f8[20]](function(_0xf738x39){_0xf738x34= _[_0x81f8[125]](_0xf738x39);return Metric[_0x81f8[126]]()})[_0x81f8[20]](function(_0xf738x35){var _0xf738x36=[];_0xf738x35= _[_0x81f8[107]](_0xf738x35,_0x81f8[43]);_0xf738x32[_0x81f8[62]](function(_0xf738x37){_0xf738x37[_0x81f8[115]]= _0xf738x18[_0x81f8[47]];if(_0xf738x37[_0x81f8[116]]){var _0xf738x38=_[_0x81f8[72]](_0xf738x35,{id:_0xf738x37[_0x81f8[116]]});if(_0xf738x38){_0xf738x37[_0x81f8[117]]= _0xf738x38[_0x81f8[118]];_0xf738x36[_0x81f8[75]](ReportField[_0x81f8[94]](_0xf738x37,{transaction:_0xf738x2e}))}else {throw  new sequelize.Error(_0x81f8[119]+ _0xf738x37[_0x81f8[116]]+ _0x81f8[120])}}else {if(_[_0x81f8[121]](_0xf738x34,_0xf738x37[_0x81f8[117]])|| _0xf738x37[_0x81f8[122]]){_0xf738x36[_0x81f8[75]](ReportField[_0x81f8[94]](_0xf738x37,{transaction:_0xf738x2e}))}else {throw  new sequelize.Error(_0x81f8[123]+ _0xf738x37[_0x81f8[117]]+ _0x81f8[124])}}});return _0xf738x36})[_0x81f8[29]]()}else {throw  new sequelize.Error(_0x81f8[128])}}}}function createImportFields(_0xf738x2e){return function(_0xf738x18,_0xf738x32){if(_0xf738x32&& Array[_0x81f8[53]](_0xf738x32)&& _0xf738x32[_0x81f8[54]]){var _0xf738x33=reportBuildUtils[_0x81f8[114]](_0xf738x18[_0x81f8[42]]);if(_0xf738x33){var _0xf738x34;return _0xf738x33[_0x81f8[127]]()[_0x81f8[20]](function(_0xf738x39){_0xf738x34= _[_0x81f8[125]](_0xf738x39);var _0xf738x36=[];var _0xf738x3b;if(_[_0x81f8[131]](_0xf738x32,function(_0xf738x37){return _[_0x81f8[130]](_0xf738x37,_0x81f8[129])})){_0xf738x3b= _0x81f8[132]}else {if(_[_0x81f8[131]](_0xf738x32,function(_0xf738x37){return _[_0x81f8[130]](_0xf738x37,_0x81f8[116])})){_0xf738x3b= _0x81f8[7]}else {throw  new sequelize.Error(_0x81f8[133])}};var _0xf738x3c=_[_0x81f8[135]](_0xf738x32,_0xf738x3b+ _0x81f8[134]);_[_0x81f8[61]](_0xf738x3c,function(_0xf738x3d,_0xf738x1d){if(_0xf738x1d!== _0x81f8[136]&& _0xf738x1d!== _0x81f8[137]){_0xf738x3d[0][_0xf738x3b][_0x81f8[138]][_0x81f8[62]](function(_0xf738x37){_0xf738x37[_0x81f8[115]]= _0xf738x18[_0x81f8[47]]});_0xf738x3d[0][_0xf738x3b][_0x81f8[88]]+= _0x81f8[139]+ sr({length:5});_0xf738x36[_0x81f8[75]](Metric[_0x81f8[94]](_0xf738x3d[0][_0xf738x3b],{include:[{model:ReportField,as:_0x81f8[138]}],transaction:_0xf738x2e}))}else {_0xf738x3d[_0x81f8[62]](function(_0xf738x37){if(_[_0x81f8[121]](_0xf738x34,_0xf738x37[_0x81f8[117]])|| _0xf738x37[_0x81f8[122]]){_0xf738x37[_0x81f8[115]]= _0xf738x18[_0x81f8[47]];_0xf738x36[_0x81f8[75]](ReportField[_0x81f8[94]](_0xf738x37,{transaction:_0xf738x2e}))}else {throw  new sequelize.Error(_0x81f8[123]+ _0xf738x37[_0x81f8[117]]+ _0x81f8[124])}})}});return _0xf738x36})[_0x81f8[29]]()}else {throw  new sequelize.Error(_0x81f8[128])}}}}exports[_0x81f8[74]]= function(_0xf738xf,_0xf738x10){return CustomReport[_0x81f8[49]](_0xf738xf[_0x81f8[48]][_0x81f8[47]])[_0x81f8[20]](function(_0xf738x18){if(!_0xf738x18){return _0xf738x10[_0x81f8[35]](404)};return _0xf738x18[_0x81f8[74]]()})[_0x81f8[20]](function(){return _0xf738x10[_0x81f8[35]](204)})[_0x81f8[17]](function(_0xf738x12){return handleError(_0xf738x10,_0xf738x12)})};exports[_0x81f8[140]]= function(_0xf738xf,_0xf738x10){return CustomReport[_0x81f8[74]]({where:{id:_0xf738xf[_0x81f8[21]][_0x81f8[141]]},individualHooks:true})[_0x81f8[20]](function(){return _0xf738x10[_0x81f8[35]](204)})[_0x81f8[17]](function(_0xf738x12){return handleError(_0xf738x10,_0xf738x12)})};function handleError(_0xf738x10,_0xf738x12){return _0xf738x10[_0x81f8[19]](500)[_0x81f8[18]](_0xf738x12)}
\ No newline at end of file