Built motion from commit 12b39f1.|0.0.105
[motion.git] / server / api / custom_report / custom_report.controller.js
index 12cee23..94a09e5 100644 (file)
@@ -1 +1 @@
-var _0x7efe=["\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","\x69\x6E\x64\x65\x78","\x6E\x61\x6D\x65","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x70\x61\x72\x65\x6E\x74","\x70\x65\x72\x5F\x70\x61\x67\x65","\x71\x75\x65\x72\x79","\x70\x61\x67\x65","\x6F\x72\x64\x65\x72","\x25\x73\x20\x25\x73","\x73\x6F\x72\x74\x5F\x62\x79","\x73\x6F\x72\x74\x5F\x6F\x72\x64\x65\x72","\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x24\x6F\x72","\x77\x68\x65\x72\x65","\x25","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x24","\x72\x6F\x6C\x65","\x73\x70\x6C\x69\x74","\x70\x61\x72\x73\x65","\x66\x6F\x72\x4F\x77\x6E","\x63\x6C\x69\x65\x6E\x74\x51\x75\x65\x72\x79","\x24\x6C\x69\x6B\x65","\x66\x6F\x72\x49\x6E","\x53\x6F\x6D\x65\x74\x68\x69\x6E\x67\x20\x62\x6C\x65\x77\x20\x75\x70\x21","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x63\x61\x74\x63\x68","\x63\x6F\x75\x6E\x74","\x63\x65\x69\x6C","\x6F\x66\x66\x73\x65\x74","\x25\x73\x3A\x2F\x2F\x25\x73\x25\x73\x3F\x70\x61\x67\x65\x3D\x25\x64","\x70\x72\x6F\x74\x6F\x63\x6F\x6C","\x68\x6F\x73\x74","\x68\x65\x61\x64\x65\x72\x73","\x62\x61\x73\x65\x55\x72\x6C","\x72\x6F\x77\x73","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x70\x72\x65\x76\x69\x65\x77","\x6C\x6F\x67","\x6C\x65\x6E\x67\x74\x68","\x73\x70\x72\x65\x61\x64","\x61\x6C\x6C","\x66\x6F\x75\x6E\x64\x20\x72\x65\x70\x6F\x72\x74","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x75\x69\x50\x61\x67\x69\x6E\x61\x74\x69\x6F\x6E","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\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","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x62\x6F\x64\x79","\x65\x6E\x64\x44\x61\x74\x65","\x4D\x45\x53\x53\x41\x47\x45\x5F\x53\x54\x41\x52\x54\x5F\x4F\x52\x5F\x45\x4E\x44\x5F\x44\x41\x54\x45\x5F\x4D\x49\x53\x53\x49\x4E\x47","\x65\x78\x74\x72\x61\x63\x74","\x63\x72\x65\x61\x74\x65","\x73\x68\x6F\x77","\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","\x6D\x61\x70","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x69\x6D\x70\x6F\x72\x74","","\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x4F\x55\x4E\x54\x28\x44\x49\x53\x54\x49\x4E\x43\x54\x20\x25\x73\x29","\x66\x69\x65\x6C\x64","\x43\x4F\x55\x4E\x54\x20\x44\x49\x53\x54\x49\x4E\x43\x54","\x47\x52\x4F\x55\x50\x5F\x43\x4F\x4E\x43\x41\x54\x28\x25\x73\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20\x25\x73\x20\x41\x53\x43\x29","\x47\x52\x4F\x55\x50\x5F\x43\x4F\x4E\x43\x41\x54\x20\x41\x53\x43","\x47\x52\x4F\x55\x50\x5F\x43\x4F\x4E\x43\x41\x54\x28\x25\x73\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20\x25\x73\x20\x44\x45\x53\x43\x29","\x47\x52\x4F\x55\x50\x5F\x43\x4F\x4E\x43\x41\x54\x20\x44\x45\x53\x43","\x25\x73\x28\x25\x73\x29","\x25\x73\x20\x41\x53\x20\x27\x25\x73\x27","\x61\x6C\x69\x61\x73","\x67\x72\x6F\x75\x70\x42\x79","\x6F\x72\x64\x65\x72\x42\x79","\x67\x72\x6F\x75\x70","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x20","\x2C","\x6A\x6F\x69\x6E","\x2C\x43\x4F\x55\x4E\x54\x28\x2A\x29","\x20\x46\x52\x4F\x4D\x20","\x74\x61\x62\x6C\x65","\x28\x29","\x20\x57\x48\x45\x52\x45\x20","\x70\x65\x72\x50\x61\x67\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74\x20\x3E\x3D\x20\x27","\x27","\x63\x72\x65\x61\x74\x65\x64\x41\x74\x20\x3C\x3D\x20\x27","\x66\x69\x6E\x64","\x20\x4C\x49\x4B\x45\x20\x27\x25","\x25\x27","\x20\x41\x4E\x44\x20","\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20","\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20","\x20\x4C\x49\x4D\x49\x54\x20","\x20\x4F\x46\x46\x53\x45\x54\x20","\x28","\x72\x75\x6C\x65\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E","\x20\x27","\x4C\x49\x4B\x45","\x76\x61\x6C\x75\x65","\x29","\x75\x70\x64\x61\x74\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79"];_0x7efe[0];var _=require(_0x7efe[1]);var util=require(_0x7efe[2]);var sequelize=require(_0x7efe[4])[_0x7efe[3]];var CustomReport=require(_0x7efe[4])[_0x7efe[5]];var ReportField=require(_0x7efe[4])[_0x7efe[6]];var Metric=require(_0x7efe[4])[_0x7efe[7]];var ExtractedReport=require(_0x7efe[4])[_0x7efe[8]];var extractUtils=require(_0x7efe[9]);exports[_0x7efe[10]]=function(_0x7cc9x9,_0x7cc9xa,_0x7cc9xb){var _0x7cc9xc=[_0x7efe[11],_0x7efe[12],_0x7efe[13]];var _0x7cc9xd=_0x7cc9x9[_0x7efe[15]][_0x7efe[14]]?parseInt(_0x7cc9x9[_0x7efe[15]][_0x7efe[14]],10):100;var _0x7cc9xe=_0x7cc9x9[_0x7efe[15]][_0x7efe[16]]?parseInt(_0x7cc9x9[_0x7efe[15]][_0x7efe[16]],10):0;var _0x7cc9xf={where:{},limit:_0x7cc9xd,offset:_0x7cc9xe*_0x7cc9xd};_[_0x7efe[35]](_0x7cc9x9[_0x7efe[15]],function(_0x7cc9x10,_0x7cc9x11){switch(_0x7cc9x11){case _0x7efe[14]:;case _0x7efe[16]:break ;;case _0x7efe[19]:_0x7cc9xf[_0x7efe[17]]=util[_0x7efe[22]](_0x7efe[18],_0x7cc9x9[_0x7efe[15]][_0x7efe[19]],_0x7cc9x9[_0x7efe[15]][_0x7efe[20]]||_0x7efe[21])||null;break ;;case _0x7efe[20]:break ;;case _0x7efe[28]:_0x7cc9xf[_0x7efe[24]][_0x7efe[23]]=[];_0x7cc9xc[_0x7efe[27]](function(_0x7cc9x12){var _0x7cc9x13={};_0x7cc9x13[_0x7cc9x12]={$like:_0x7efe[25]+_0x7cc9x10+_0x7efe[25]};_0x7cc9xf[_0x7efe[24]][_0x7efe[23]][_0x7efe[26]](_0x7cc9x13);});break ;;case _0x7efe[29]:_0x7cc9xf[_0x7efe[24]][_0x7efe[29]]={$or:_0x7cc9x10[_0x7efe[30]](/[\s,]+/)};break ;;case _0x7efe[33]:var _0x7cc9x14=JSON[_0x7efe[31]](_0x7cc9x10);_[_0x7efe[32]](_0x7cc9x14,function(_0x7cc9x15,_0x7cc9x16){_0x7cc9xf[_0x7efe[24]][_0x7cc9x16]=_0x7cc9x15});break ;;default:_0x7cc9xf[_0x7efe[24]][_0x7cc9x11]={$like:{}};_0x7cc9xf[_0x7efe[24]][_0x7cc9x11][_0x7efe[34]]=_0x7efe[25]+_0x7cc9x10+_0x7efe[25];;}});CustomReport[_0x7efe[50]](_0x7cc9xf)[_0x7efe[49]](function(_0x7cc9x18){var _0x7cc9x19=Math[_0x7efe[41]](_0x7cc9x18[_0x7efe[40]]/_0x7cc9xd);var _0x7cc9x1a=_0x7cc9x19>(_0x7cc9xf[_0x7efe[42]]+1)?util[_0x7efe[22]](_0x7efe[43],_0x7cc9x9[_0x7efe[44]],_0x7cc9x9[_0x7efe[46]][_0x7efe[45]],_0x7cc9x9[_0x7efe[47]],_0x7cc9xe+1):null;var _0x7cc9x1b=_0x7cc9xe>0?util[_0x7efe[22]](_0x7efe[43],_0x7cc9x9[_0x7efe[44]],_0x7cc9x9[_0x7efe[46]][_0x7efe[45]],_0x7cc9x9[_0x7efe[47]],_0x7cc9xe-1):null;_0x7cc9xa[_0x7efe[38]](200)[_0x7efe[37]]({count:_0x7cc9x18[_0x7efe[40]],rows:_0x7cc9x18[_0x7efe[48]],next_page:_0x7cc9x1a,previous_page:_0x7cc9x1b,total_pages:_0x7cc9x19});})[_0x7efe[39]](function(_0x7cc9x17){_0x7cc9xa[_0x7efe[38]](500)[_0x7efe[37]]({error:_0x7efe[36]})});};exports[_0x7efe[51]]=function(_0x7cc9x9,_0x7cc9xa){CustomReport[_0x7efe[64]](_0x7cc9x9[_0x7efe[63]][_0x7efe[62]],{include:[{all:true}]})[_0x7efe[49]](function(_0x7cc9x1e){console[_0x7efe[52]](_0x7efe[56]);if(!_0x7cc9x1e){return _0x7cc9xa[_0x7efe[57]](404)};var _0x7cc9xf=buildReport(_0x7cc9x1e[_0x7efe[58]],_0x7cc9x9[_0x7efe[15]]);var _0x7cc9x1f=[sequelize[_0x7efe[15]](_0x7cc9xf,{type:sequelize[_0x7efe[60]][_0x7efe[59]]})];if(_0x7cc9x9[_0x7efe[15]][_0x7efe[61]]){var _0x7cc9x20=buildReport(_0x7cc9x1e[_0x7efe[58]],_0x7cc9x9[_0x7efe[15]],true);_0x7cc9x1f[_0x7efe[26]](sequelize[_0x7efe[15]](_0x7cc9x20,{type:sequelize[_0x7efe[60]][_0x7efe[59]]}));};return _0x7cc9x1f;})[_0x7efe[55]]()[_0x7efe[54]](function(_0x7cc9x1c,_0x7cc9x1d){console[_0x7efe[52]](_0x7cc9x1c[_0x7efe[53]]);console[_0x7efe[52]](_0x7cc9x1d);_0x7cc9xa[_0x7efe[38]](200)[_0x7efe[37]]({rows:_0x7cc9x1c,count:_0x7cc9x1d?_0x7cc9x1d[0]:null});})[_0x7efe[39]](function(_0x7cc9x17){console[_0x7efe[52]](_0x7cc9x17);return handleError(_0x7cc9xa,_0x7cc9x17);})};exports[_0x7efe[65]]=function(_0x7cc9x9,_0x7cc9xa){docExtract(_0x7cc9x9,_0x7cc9xa,_0x7efe[66])};exports[_0x7efe[67]]=function(_0x7cc9x9,_0x7cc9xa){docExtract(_0x7cc9x9,_0x7cc9xa,_0x7efe[68])};function docExtract(_0x7cc9x9,_0x7cc9xa,_0x7cc9x22){if(!_0x7cc9x9[_0x7efe[70]][_0x7efe[69]]||!_0x7cc9x9[_0x7efe[70]][_0x7efe[71]]){return _0x7cc9xa[_0x7efe[38]](500)[_0x7efe[37]]({message:_0x7efe[72]})};CustomReport[_0x7efe[64]](_0x7cc9x9[_0x7efe[63]][_0x7efe[62]],{include:[{all:true}]})[_0x7efe[49]](function(_0x7cc9x1e){if(!_0x7cc9x1e){return _0x7cc9xa[_0x7efe[57]](404)};return [_0x7cc9x1e,ExtractedReport[_0x7efe[74]]({name:_0x7cc9x1e[_0x7efe[11]],startDate:_0x7cc9x9[_0x7efe[70]][_0x7efe[69]],endDate:_0x7cc9x9[_0x7efe[70]][_0x7efe[71]],output:_0x7cc9x22})];})[_0x7efe[54]](function(_0x7cc9x1e,_0x7cc9x23){extractUtils[_0x7efe[73]+_0x7cc9x22](_0x7cc9x1e,_0x7cc9x9[_0x7efe[70]][_0x7efe[69]],_0x7cc9x9[_0x7efe[70]][_0x7efe[71]],_0x7cc9x23[_0x7efe[62]])})[_0x7efe[39]](function(_0x7cc9x17){console[_0x7efe[52]](_0x7cc9x17);return handleError(_0x7cc9xa,_0x7cc9x17);});return _0x7cc9xa[_0x7efe[57]](200);}exports[_0x7efe[75]]=function(_0x7cc9x9,_0x7cc9xa){CustomReport[_0x7efe[64]](_0x7cc9x9[_0x7efe[63]][_0x7efe[62]],{include:[{model:ReportField,as:_0x7efe[76],include:[Metric]}]})[_0x7efe[49]](function(_0x7cc9x1e){if(!_0x7cc9x1e){return _0x7cc9xa[_0x7efe[57]](404)};return _0x7cc9xa[_0x7efe[37]](_0x7cc9x1e);})[_0x7efe[39]](function(_0x7cc9x17){return handleError(_0x7cc9xa,_0x7cc9x17)})};exports[_0x7efe[77]]=function(_0x7cc9x9,_0x7cc9xa){CustomReport[_0x7efe[64]](_0x7cc9x9[_0x7efe[63]][_0x7efe[62]],{include:[{all:true}]})[_0x7efe[49]](function(_0x7cc9x1e){if(!_0x7cc9x1e){return _0x7cc9xa[_0x7efe[57]](404)};var _0x7cc9x24=_0x7cc9x1e[_0x7efe[58]];delete _0x7cc9x24[_0x7efe[62]];delete _0x7cc9x24[_0x7efe[78]];delete _0x7cc9x24[_0x7efe[79]];_0x7cc9x24[_0x7efe[13]]=_0x7cc9x9[_0x7efe[70]][_0x7efe[13]];_0x7cc9x24[_0x7efe[76]]=_[_0x7efe[80]](_0x7cc9x24.Fields,_0x7efe[58]);_[_0x7efe[27]](_0x7cc9x24.Fields,function(_0x7cc9x25){delete _0x7cc9x25[_0x7efe[62]];delete _0x7cc9x25[_0x7efe[81]];delete _0x7cc9x25[_0x7efe[78]];delete _0x7cc9x25[_0x7efe[79]];});return CustomReport[_0x7efe[74]](_0x7cc9x24,{include:[{all:true}]});})[_0x7efe[49]](function(){return _0x7cc9xa[_0x7efe[57]](201)})[_0x7efe[39]](function(_0x7cc9x17){console[_0x7efe[52]](_0x7cc9x17);return handleError(_0x7cc9xa,_0x7cc9x17);})};exports[_0x7efe[82]]=function(_0x7cc9x9,_0x7cc9xa){CustomReport[_0x7efe[74]](_0x7cc9x9[_0x7efe[70]],{include:[{model:ReportField,as:_0x7efe[76],include:[Metric]}]})[_0x7efe[49]](function(_0x7cc9x1e){return _0x7cc9xa[_0x7efe[38]](201)[_0x7efe[37]](_0x7cc9x1e)})[_0x7efe[39]](function(_0x7cc9x17){return handleError(_0x7cc9xa,_0x7cc9x17)})};function buildReport(_0x7cc9x1e,_0x7cc9xf,_0x7cc9x27){var _0x7cc9x28=[],_0x7cc9x29=[],_0x7cc9x2a=[];_[_0x7efe[27]](_0x7cc9x1e.Fields,function(_0x7cc9x25){var _0x7cc9x2b=_0x7efe[83];if(_0x7cc9x25[_0x7efe[84]]){switch(_0x7cc9x25[_0x7efe[84]]){case _0x7efe[87]:_0x7cc9x2b=util[_0x7efe[22]](_0x7efe[85],_0x7cc9x25[_0x7efe[86]]);break ;;case _0x7efe[89]:_0x7cc9x2b=util[_0x7efe[22]](_0x7efe[88],_0x7cc9x25[_0x7efe[86]],_0x7cc9x25[_0x7efe[86]]);break ;;case _0x7efe[91]:_0x7cc9x2b=util[_0x7efe[22]](_0x7efe[90],_0x7cc9x25[_0x7efe[86]],_0x7cc9x25[_0x7efe[86]]);break ;;default:_0x7cc9x2b=util[_0x7efe[22]](_0x7efe[92],_0x7cc9x25[_0x7efe[84]],_0x7cc9x25[_0x7efe[86]]);;}}else {_0x7cc9x2b=_0x7cc9x25[_0x7efe[86]]};_0x7cc9x28[_0x7efe[26]](util[_0x7efe[22]](_0x7efe[93],_0x7cc9x2b,_0x7cc9x25[_0x7efe[94]]));if(_0x7cc9x25[_0x7efe[95]]){_0x7cc9x29[_0x7efe[26]](_0x7cc9x25[_0x7efe[86]])};if(_0x7cc9x25[_0x7efe[96]]){_0x7cc9x2a[_0x7efe[26]](util[_0x7efe[22]](_0x7efe[18],_0x7cc9x25[_0x7efe[86]],_0x7cc9x25[_0x7efe[96]]))};});var _0x7cc9x2c=getConditions(JSON[_0x7efe[31]](_0x7cc9x1e[_0x7efe[98]])[_0x7efe[97]]);var _0x7cc9x2d=_0x7efe[59];_0x7cc9x2d+=_0x7efe[99]+_0x7cc9x28[_0x7efe[101]](_0x7efe[100]);if(_0x7cc9x27){_0x7cc9x2d+=_0x7efe[102]};_0x7cc9x2d+=_0x7efe[103]+_0x7cc9x1e[_0x7efe[104]];_0x7cc9x2d+=_0x7cc9x2c!==_0x7efe[105]?_0x7efe[106]+_0x7cc9x2c:_0x7efe[83];var _0x7cc9x2e=false;var _0x7cc9x2f=false;var _0x7cc9x30,_0x7cc9x31;var _0x7cc9x32=[];if(_0x7cc9xf){_[_0x7efe[32]](_0x7cc9xf,function(_0x7cc9x10,_0x7cc9x11){switch(_0x7cc9x11){case _0x7efe[16]:if(_0x7cc9xf[_0x7efe[107]]){_0x7cc9x2e=parseInt(_0x7cc9xf[_0x7efe[107]],10);_0x7cc9x2f=parseInt(_0x7cc9x10,10)*_0x7cc9x2e;};break ;;case _0x7efe[107]:_0x7cc9x2e=parseInt(_0x7cc9x10,10);break ;;case _0x7efe[69]:_0x7cc9x32[_0x7efe[26]](_0x7efe[108]+_0x7cc9x10+_0x7efe[109]);break ;;case _0x7efe[71]:_0x7cc9x32[_0x7efe[26]](_0x7efe[110]+_0x7cc9x10+_0x7efe[109]);break ;;case _0x7efe[61]:break ;;default:var _0x7cc9x33=_[_0x7efe[111]](_0x7cc9x1e.Fields,{alias:_0x7cc9x11})[_0x7efe[86]];if(_0x7cc9x33){_0x7cc9x32[_0x7efe[26]](_0x7cc9x33+_0x7efe[112]+_0x7cc9x10+_0x7efe[113])}else {_0x7cc9x32[_0x7efe[26]](_0x7cc9x11+_0x7efe[112]+_0x7cc9x10+_0x7efe[113])};;}})};if(_0x7cc9x32[_0x7efe[53]]){_0x7cc9x2d+=((_0x7cc9x2c!==_0x7efe[105])?_0x7efe[114]:_0x7efe[106])+_0x7cc9x32[_0x7efe[101]](_0x7efe[114])};_0x7cc9x2d+=_0x7cc9x29[_0x7efe[53]]?_0x7efe[115]+_0x7cc9x29[_0x7efe[101]](_0x7efe[100]):_0x7efe[83];_0x7cc9x2d+=_0x7cc9x2a[_0x7efe[53]]?_0x7efe[116]+_0x7cc9x2a[_0x7efe[101]](_0x7efe[100]):_0x7efe[83];_0x7cc9x2d+=_0x7cc9x2e&&!_0x7cc9x27?_0x7efe[117]+_0x7cc9x2e:_0x7efe[83];_0x7cc9x2d+=_0x7cc9x2f&&!_0x7cc9x27?_0x7efe[118]+_0x7cc9x2f:_0x7efe[83];console[_0x7efe[52]](_0x7cc9x2d);return _0x7cc9x2d;}function getConditions(_0x7cc9x35){if(!_0x7cc9x35){return _0x7efe[83]};for(var _0x7cc9x36=_0x7efe[119],_0x7cc9x37=0;_0x7cc9x37<_0x7cc9x35[_0x7efe[120]][_0x7efe[53]];_0x7cc9x37++){_0x7cc9x37>0&&(_0x7cc9x36+=_0x7efe[99]+_0x7cc9x35[_0x7efe[121]]+_0x7efe[99]);_0x7cc9x36+=_0x7cc9x35[_0x7efe[120]][_0x7cc9x37][_0x7efe[97]]?getConditions(_0x7cc9x35[_0x7efe[120]][_0x7cc9x37][_0x7efe[97]]):_0x7cc9x35[_0x7efe[120]][_0x7cc9x37][_0x7efe[86]]+_0x7efe[99]+_0x7cc9x35[_0x7efe[120]][_0x7cc9x37][_0x7efe[122]]+_0x7efe[123]+(_0x7cc9x35[_0x7efe[120]][_0x7cc9x37][_0x7efe[122]]===_0x7efe[124]?_0x7efe[25]+_0x7cc9x35[_0x7efe[120]][_0x7cc9x37][_0x7efe[125]]+_0x7efe[25]:_0x7cc9x35[_0x7efe[120]][_0x7cc9x37][_0x7efe[125]])+_0x7efe[109];};return _0x7cc9x36+_0x7efe[126];}exports[_0x7efe[74]]=function(_0x7cc9x9,_0x7cc9xa){CustomReport[_0x7efe[74]](_0x7cc9x9[_0x7efe[70]])[_0x7efe[49]](function(_0x7cc9x1e){return _0x7cc9xa[_0x7efe[38]](201)[_0x7efe[37]](_0x7cc9x1e)})[_0x7efe[39]](function(_0x7cc9x17){return handleError(_0x7cc9xa,_0x7cc9x17)})};exports[_0x7efe[127]]=function(_0x7cc9x9,_0x7cc9xa){if(_0x7cc9x9[_0x7efe[70]][_0x7efe[62]]){delete _0x7cc9x9[_0x7efe[70]][_0x7efe[62]]};ReportField[_0x7efe[129]]({where:{CustomReportId:_0x7cc9x9[_0x7efe[63]][_0x7efe[62]]}})[_0x7efe[49]](function(){return ReportField[_0x7efe[128]](_0x7cc9x9[_0x7efe[70]].Fields)})[_0x7efe[49]](function(){delete _0x7cc9x9[_0x7efe[70]][_0x7efe[76]];return CustomReport[_0x7efe[127]](_0x7cc9x9[_0x7efe[70]],{where:{id:_0x7cc9x9[_0x7efe[63]][_0x7efe[62]]}});})[_0x7efe[49]](function(){return _0x7cc9xa[_0x7efe[57]](200)})[_0x7efe[39]](function(_0x7cc9x17){console[_0x7efe[52]](_0x7cc9x17);return handleError(_0x7cc9xa,_0x7cc9x17);});};exports[_0x7efe[129]]=function(_0x7cc9x9,_0x7cc9xa){CustomReport[_0x7efe[64]](_0x7cc9x9[_0x7efe[63]][_0x7efe[62]])[_0x7efe[49]](function(_0x7cc9x1e){if(!_0x7cc9x1e){return _0x7cc9xa[_0x7efe[57]](404)};_0x7cc9x1e[_0x7efe[129]]()[_0x7efe[49]](function(){return _0x7cc9xa[_0x7efe[57]](204)})[_0x7efe[39]](function(_0x7cc9x17){return handleError(_0x7cc9xa,_0x7cc9x17)});})[_0x7efe[39]](function(_0x7cc9x17){return handleError(_0x7cc9xa,_0x7cc9x17)})};exports[_0x7efe[130]]=function(_0x7cc9x9,_0x7cc9xa){CustomReport[_0x7efe[129]]({where:{id:_0x7cc9x9[_0x7efe[15]][_0x7efe[62]]},individualHooks:true})[_0x7efe[49]](function(){return _0x7cc9xa[_0x7efe[57]](204)})[_0x7efe[39]](function(_0x7cc9x17){return handleError(_0x7cc9xa,_0x7cc9x17)})};function handleError(_0x7cc9xa,_0x7cc9x17){return _0x7cc9xa[_0x7efe[38]](500)[_0x7efe[37]](_0x7cc9x17)}
\ No newline at end of file
+var _0xeccd=["\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","\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","\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","\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","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\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","\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","\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65","\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","\x70\x61\x72\x65\x6E\x74","\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","\x64\x65\x73\x74\x72\x6F\x79","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x69\x73\x41\x72\x72\x61\x79","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x4D\x65\x74\x72\x69\x63\x49\x64","\x66\x69\x6E\x64","\x66\x69\x65\x6C\x64","\x6D\x65\x74\x72\x69\x63","\x70\x75\x73\x68","\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","\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","\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","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x5F\x73\x65\x73\x73\x69\x6F\x6E\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x73\x65\x73\x73\x69\x6F\x6E\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x65\x6D\x62\x65\x72\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x65\x6D\x62\x65\x72\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\x5F\x73\x65\x73\x73\x69\x6F\x6E\x5F\x68\x69\x73\x74\x6F\x72\x79","\x43\x6F\x6E\x74\x61\x63\x74","\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73","\x56\x6F\x69\x63\x65\x52\x65\x63\x6F\x72\x64\x69\x6E\x67","\x76\x6F\x69\x63\x65\x5F\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x73","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xeccd[0];var _=require(_0xeccd[1]);var util=require(_0xeccd[2]);var sequelize=require(_0xeccd[4])[_0xeccd[3]];var CustomReport=require(_0xeccd[4])[_0xeccd[5]];var ReportField=require(_0xeccd[4])[_0xeccd[6]];var Metric=require(_0xeccd[4])[_0xeccd[7]];var ExtractedReport=require(_0xeccd[4])[_0xeccd[8]];var extractUtils=require(_0xeccd[9]);var reportBuildUtils=require(_0xeccd[10]);var Util=require(_0xeccd[11]);var sr=require(_0xeccd[12]);var moment=require(_0xeccd[13]);var cp=require(_0xeccd[14]);exports[_0xeccd[15]]=function(_0xa398xe,_0xa398xf,_0xa398x10){return CustomReport[_0xeccd[22]](Util[_0xeccd[21]](_0xa398xe[_0xeccd[20]]))[_0xeccd[19]](function(_0xa398x12){_0xa398xf[_0xeccd[18]](200)[_0xeccd[17]](_0xa398x12)})[_0xeccd[16]](function(_0xa398x11){return handleError(_0xa398xf,_0xa398x11)})};exports[_0xeccd[23]]=function(_0xa398xe,_0xa398xf){return Promise[_0xeccd[26]]([])[_0xeccd[19]](getQuery(_0xa398xe,_0xa398xf))[_0xeccd[19]](function(_0xa398x13){_0xa398xf[_0xeccd[18]](200)[_0xeccd[17]]({query:_0xa398x13})})[_0xeccd[16]](function(_0xa398x11){console[_0xeccd[25]](_0xeccd[24],_0xa398x11)})};function getQuery(_0xa398xe,_0xa398xf){var _0xa398x15;return function(){return CustomReport[_0xeccd[48]](_0xeccd[47])[_0xeccd[46]](_0xa398xe[_0xeccd[45]][_0xeccd[44]])[_0xeccd[19]](function(_0xa398x17){console[_0xeccd[25]](_0xeccd[31]);if(!_0xa398x17){return _0xa398xf[_0xeccd[32]](404)};if(_0xa398xe[_0xeccd[20]][_0xeccd[33]]&&_0xa398xe[_0xeccd[20]][_0xeccd[33]]===_0xeccd[34]){_0xa398xe[_0xeccd[20]][_0xeccd[35]]=moment()[_0xeccd[37]](_0xeccd[36]);_0xa398xe[_0xeccd[20]][_0xeccd[38]]=moment()[_0xeccd[37]](_0xeccd[36]);_0xa398x17[_0xeccd[40]][_0xeccd[39]]=_0xa398x17[_0xeccd[40]][_0xeccd[39]][_0xeccd[43]](_0xeccd[41],_0xeccd[42])};delete _0xa398xe[_0xeccd[20]][_0xeccd[33]];_0xa398x15=_0xa398x17[_0xeccd[40]];return _0xa398x15[_0xeccd[39]]})[_0xeccd[19]](reportBuildUtils[_0xeccd[30]](_0xa398xe[_0xeccd[29]]))[_0xeccd[19]](function(_0xa398x16){return [_0xa398x16,_0xa398x15]})[_0xeccd[28]](reportBuildUtils[_0xeccd[27]](_0xa398xe[_0xeccd[20]]))}}exports[_0xeccd[49]]=function(_0xa398xe,_0xa398xf){var _0xa398x18;return Promise[_0xeccd[26]]([])[_0xeccd[19]](getQuery(_0xa398xe,_0xa398xf))[_0xeccd[19]](function(_0xa398x13){return _0xa398x13?sequelize[_0xeccd[20]](_0xa398x13,{type:sequelize[_0xeccd[60]][_0xeccd[59]]}):[]})[_0xeccd[19]](function(_0xa398x19){_0xa398x18=_0xa398x19[_0xeccd[50]];if(_0xa398xe[_0xeccd[20]][_0xeccd[51]]){_0xa398x19=_(_0xa398x19)[_0xeccd[55]](_0xa398xe[_0xeccd[20]][_0xeccd[54]]||0)[_0xeccd[53]](_0xa398xe[_0xeccd[20]][_0xeccd[51]])[_0xeccd[52]]()};_[_0xeccd[58]](_0xa398x19,function(_0xa398x1a){_[_0xeccd[57]](_0xa398x1a,function(_0xa398x1b,_0xa398x1c){if(_0xa398x1b instanceof Date){_0xa398x1a[_0xa398x1c]=moment(_0xa398x1b)[_0xeccd[37]](_0xeccd[56]).toString()}})});_0xa398xf[_0xeccd[18]](200)[_0xeccd[17]]({rows:_0xa398x19,count:_0xa398x18})})[_0xeccd[16]](function(_0xa398x11){console[_0xeccd[25]](_0xa398x11);return handleError(_0xa398xf,_0xa398x11)})};exports[_0xeccd[61]]=function(_0xa398xe,_0xa398xf){docExtract(_0xa398xe,_0xa398xf,_0xeccd[62])};exports[_0xeccd[63]]=function(_0xa398xe,_0xa398xf){docExtract(_0xa398xe,_0xa398xf,_0xeccd[64])};function docExtract(_0xa398xe,_0xa398xf,_0xa398x1e){CustomReport[_0xeccd[48]](_0xeccd[47])[_0xeccd[46]](_0xa398xe[_0xeccd[45]][_0xeccd[44]])[_0xeccd[19]](function(_0xa398x17){if(!_0xa398x17){return _0xa398xf[_0xeccd[32]](404)};if(_0xa398xe[_0xeccd[20]][_0xeccd[33]]&&_0xa398xe[_0xeccd[20]][_0xeccd[33]]===_0xeccd[34]){_0xa398xe[_0xeccd[20]][_0xeccd[35]]=moment()[_0xeccd[37]](_0xeccd[36]);_0xa398xe[_0xeccd[20]][_0xeccd[38]]=moment()[_0xeccd[37]](_0xeccd[36]);_0xa398x17[_0xeccd[40]][_0xeccd[39]]=_0xa398x17[_0xeccd[40]][_0xeccd[39]][_0xeccd[43]](_0xeccd[41],_0xeccd[42])};delete _0xa398xe[_0xeccd[20]][_0xeccd[33]];return [_0xa398x17,ExtractedReport[_0xeccd[76]]({name:_0xa398x17[_0xeccd[75]],startDate:_0xa398xe[_0xeccd[20]][_0xeccd[35]]||null,endDate:_0xa398xe[_0xeccd[20]][_0xeccd[38]]||null,output:_0xa398x1e,UserId:_0xa398xe[_0xeccd[29]][_0xeccd[44]]})]})[_0xeccd[28]](function(_0xa398x17,_0xa398x1f){var _0xa398x20=cp[_0xeccd[66]](__dirname+_0xeccd[65]);_0xa398x20[_0xeccd[69]](_0xeccd[72],function(_0xa398x21){console[_0xeccd[25]](_0xeccd[73],_0xa398x21);_0xa398x20[_0xeccd[74]]()})[_0xeccd[69]](_0xeccd[70],function(){console[_0xeccd[25]](_0xeccd[71])})[_0xeccd[69]](_0xeccd[67],function(_0xa398x11){console[_0xeccd[25]](_0xeccd[68],_0xa398x11)});_0xa398x20[_0xeccd[17]]({report:_0xa398x17,query:_0xa398xe[_0xeccd[20]],extractedId:_0xa398x1f[_0xeccd[44]],user:_0xa398xe[_0xeccd[29]],type:_0xa398x1e})})[_0xeccd[16]](function(_0xa398x11){console[_0xeccd[25]](_0xa398x11);return handleError(_0xa398xf,_0xa398x11)});return _0xa398xf[_0xeccd[32]](200)}exports[_0xeccd[77]]=function(_0xa398xe,_0xa398xf){return CustomReport[_0xeccd[48]](_0xeccd[47])[_0xeccd[46]](_0xa398xe[_0xeccd[45]][_0xeccd[44]])[_0xeccd[19]](function(_0xa398x17){if(!_0xa398x17){return _0xa398xf[_0xeccd[32]](404)};return _0xa398xf[_0xeccd[17]](_0xa398x17)})[_0xeccd[16]](function(_0xa398x11){return handleError(_0xa398xf,_0xa398x11)})};exports[_0xeccd[78]]=function(_0xa398xe,_0xa398xf){return CustomReport[_0xeccd[48]]({method:[_0xeccd[82],{CustomReportId:_0xa398xe[_0xeccd[45]][_0xeccd[44]]}]})[_0xeccd[46]](_0xa398xe[_0xeccd[45]][_0xeccd[44]],{attributes:[_0xeccd[79],_0xeccd[80],_0xeccd[75],_0xeccd[81],_0xeccd[39]]})[_0xeccd[19]](function(_0xa398x17){if(!_0xa398x17){return _0xa398xf[_0xeccd[32]](404)};return _0xa398xf[_0xeccd[17]](_0xa398x17)})[_0xeccd[16]](function(_0xa398x11){return handleError(_0xa398xf,_0xa398x11)})};exports[_0xeccd[83]]=function(_0xa398xe,_0xa398xf){var _0xa398x22;return sequelize[_0xeccd[88]](function(_0xa398x23){return CustomReport[_0xeccd[48]](_0xeccd[47])[_0xeccd[46]](_0xa398xe[_0xeccd[45]][_0xeccd[44]])[_0xeccd[19]](function(_0xa398x17){if(!_0xa398x17){return _0xa398xf[_0xeccd[32]](404)};var _0xa398x24=_0xa398x17[_0xeccd[40]];delete _0xa398x24[_0xeccd[44]];delete _0xa398x24[_0xeccd[84]];delete _0xa398x24[_0xeccd[85]];_0xa398x24[_0xeccd[81]]=_0xa398xe[_0xeccd[86]][_0xeccd[81]];_0xa398x22=_[_0xeccd[87]](_0xa398x24.Fields,_0xeccd[40]);return CustomReport[_0xeccd[76]](_0xa398x24,{transaction:_0xa398x23})})[_0xeccd[19]](function(_0xa398x17){return [_0xa398x17,_0xa398x22]})[_0xeccd[28]](createFields(_0xa398x23))})[_0xeccd[19]](function(){return _0xa398xf[_0xeccd[32]](201)})[_0xeccd[16]](function(_0xa398x11){console[_0xeccd[25]](_0xa398x11);return handleError(_0xa398xf,_0xa398x11)})};exports[_0xeccd[76]]=function(_0xa398xe,_0xa398xf){var _0xa398x15;return sequelize[_0xeccd[88]](function(_0xa398x23){return CustomReport[_0xeccd[76]](_0xa398xe[_0xeccd[86]],{transaction:_0xa398x23})[_0xeccd[19]](function(_0xa398x17){_0xa398x15=_0xa398x17;return [_0xa398x15,_0xa398xe[_0xeccd[86]][_0xeccd[89]]]})[_0xeccd[28]](createFields(_0xa398x23))})[_0xeccd[19]](function(){return _0xa398xf[_0xeccd[18]](201)[_0xeccd[17]](_0xa398x15)})[_0xeccd[16]](function(_0xa398x11){console[_0xeccd[25]](_0xa398x11);return handleError(_0xa398xf,_0xa398x11)})};exports[_0xeccd[90]]=function(_0xa398xe,_0xa398xf){var _0xa398x15;return sequelize[_0xeccd[88]](function(_0xa398x23){return CustomReport[_0xeccd[76]](_0xa398xe[_0xeccd[86]],{transaction:_0xa398x23})[_0xeccd[19]](function(_0xa398x17){_0xa398x15=_0xa398x17;return [_0xa398x15,_0xa398xe[_0xeccd[86]][_0xeccd[89]]]})[_0xeccd[28]](createImportFields(_0xa398x23))})[_0xeccd[19]](function(){return _0xa398xf[_0xeccd[18]](201)[_0xeccd[17]](_0xa398x15)})[_0xeccd[16]](function(_0xa398x11){console[_0xeccd[25]](_0xa398x11);return handleError(_0xa398xf,_0xa398x11)})};exports[_0xeccd[91]]=function(_0xa398xe,_0xa398xf,_0xa398x10){if(_0xa398xe[_0xeccd[86]][_0xeccd[44]]){delete _0xa398xe[_0xeccd[86]][_0xeccd[44]]};var _0xa398x15;return sequelize[_0xeccd[88]](function(_0xa398x23){return CustomReport[_0xeccd[46]](_0xa398xe[_0xeccd[45]][_0xeccd[44]])[_0xeccd[19]](function(_0xa398x17){if(!_0xa398x17){return _0xa398xf[_0xeccd[32]](404)};var _0xa398x25=_[_0xeccd[93]](_0xa398x17,_0xa398xe[_0xeccd[86]]);return _0xa398x17[_0xeccd[94]]({transaction:_0xa398x23})})[_0xeccd[19]](function(_0xa398x17){_0xa398x15=_0xa398x17;if(_0xa398xe[_0xeccd[86]][_0xeccd[89]]){return ReportField[_0xeccd[92]]({where:{CustomReportId:_0xa398xe[_0xeccd[45]][_0xeccd[44]]},transaction:_0xa398x23})}})[_0xeccd[19]](function(){return [_0xa398x15,_0xa398xe[_0xeccd[86]][_0xeccd[89]]]})[_0xeccd[28]](createFields(_0xa398x23))})[_0xeccd[19]](function(){return _0xa398xf[_0xeccd[32]](200)})[_0xeccd[16]](function(_0xa398x11){console[_0xeccd[25]](_0xa398x11);return handleError(_0xa398xf,_0xa398x11)})};function createFields(_0xa398x23){return function(_0xa398x17,_0xa398x27){if(_0xa398x27&&Array[_0xeccd[95]](_0xa398x27)&&_0xa398x27[_0xeccd[50]]){var _0xa398x28=getTable(_0xa398x17[_0xeccd[39]]);if(_0xa398x28){var _0xa398x29;return _0xa398x28[_0xeccd[109]]()[_0xeccd[19]](function(_0xa398x2e){_0xa398x29=_[_0xeccd[107]](_0xa398x2e);return Metric[_0xeccd[108]]()})[_0xeccd[19]](function(_0xa398x2a){var _0xa398x2b=[];_0xa398x2a=_[_0xeccd[87]](_0xa398x2a,_0xeccd[40]);_0xa398x27[_0xeccd[58]](function(_0xa398x2c){_0xa398x2c[_0xeccd[96]]=_0xa398x17[_0xeccd[44]];if(_0xa398x2c[_0xeccd[97]]){var _0xa398x2d=_[_0xeccd[98]](_0xa398x2a,{id:_0xa398x2c[_0xeccd[97]]});if(_0xa398x2d){_0xa398x2c[_0xeccd[99]]=_0xa398x2d[_0xeccd[100]];_0xa398x2b[_0xeccd[101]](ReportField[_0xeccd[76]](_0xa398x2c,{transaction:_0xa398x23}))}else {throw  new sequelize.Error(_0xeccd[102]+_0xa398x2c[_0xeccd[97]]+_0xeccd[103])}}else {if(_[_0xeccd[104]](_0xa398x29,_0xa398x2c[_0xeccd[99]])){_0xa398x2b[_0xeccd[101]](ReportField[_0xeccd[76]](_0xa398x2c,{transaction:_0xa398x23}))}else {throw  new sequelize.Error(_0xeccd[105]+_0xa398x2c[_0xeccd[99]]+_0xeccd[106])}}});return _0xa398x2b})[_0xeccd[26]]()}else {throw  new sequelize.Error(_0xeccd[110])}}}}function createImportFields(_0xa398x23){return function(_0xa398x17,_0xa398x27){if(_0xa398x27&&Array[_0xeccd[95]](_0xa398x27)&&_0xa398x27[_0xeccd[50]]){var _0xa398x28=getTable(_0xa398x17[_0xeccd[39]]);if(_0xa398x28){var _0xa398x29;return _0xa398x28[_0xeccd[109]]()[_0xeccd[19]](function(_0xa398x2e){_0xa398x29=_[_0xeccd[107]](_0xa398x2e);return Metric[_0xeccd[108]]()})[_0xeccd[19]](function(_0xa398x2a){var _0xa398x2b=[];var _0xa398x30=_[_0xeccd[111]](_0xa398x27,_0xeccd[97]);_[_0xeccd[57]](_0xa398x30,function(_0xa398x31,_0xa398x1c){if(_0xa398x1c!==_0xeccd[112]&&_0xa398x1c!==_0xeccd[113]){_0xa398x31[0][_0xeccd[7]][_0xeccd[114]][_0xeccd[58]](function(_0xa398x2c){_0xa398x2c[_0xeccd[96]]=_0xa398x17[_0xeccd[44]]});_0xa398x31[0][_0xeccd[7]][_0xeccd[75]]+=_0xeccd[115]+sr({length:5});console[_0xeccd[25]](_0xeccd[100],_0xa398x31[0].Metric);_0xa398x2b[_0xeccd[101]](Metric[_0xeccd[76]](_0xa398x31[0].Metric,{include:[{model:ReportField,as:_0xeccd[114]}],transaction:_0xa398x23}))}else {_0xa398x31[_0xeccd[58]](function(_0xa398x2c){if(_[_0xeccd[104]](_0xa398x29,_0xa398x2c[_0xeccd[99]])){_0xa398x2c[_0xeccd[96]]=_0xa398x17[_0xeccd[44]];_0xa398x2b[_0xeccd[101]](ReportField[_0xeccd[76]](_0xa398x2c,{transaction:_0xa398x23}))}else {throw  new sequelize.Error(_0xeccd[105]+_0xa398x2c[_0xeccd[99]]+_0xeccd[106])}})}});return _0xa398x2b})[_0xeccd[26]]()}else {throw  new sequelize.Error(_0xeccd[110])}}}}function getTable(_0xa398x33){var _0xa398x28;switch(_0xa398x33){case _0xeccd[118]:_0xa398x28=require(_0xeccd[4])[_0xeccd[117]][_0xeccd[116]];break;case _0xeccd[120]:_0xa398x28=require(_0xeccd[4])[_0xeccd[117]][_0xeccd[119]];break;case _0xeccd[122]:_0xa398x28=require(_0xeccd[4])[_0xeccd[117]][_0xeccd[121]];break;case _0xeccd[124]:_0xa398x28=require(_0xeccd[4])[_0xeccd[117]][_0xeccd[123]];break;case _0xeccd[126]:_0xa398x28=require(_0xeccd[4])[_0xeccd[117]][_0xeccd[125]];break;case _0xeccd[128]:_0xa398x28=require(_0xeccd[4])[_0xeccd[117]][_0xeccd[127]];break;case _0xeccd[130]:_0xa398x28=require(_0xeccd[4])[_0xeccd[117]][_0xeccd[129]];break;case _0xeccd[132]:_0xa398x28=require(_0xeccd[4])[_0xeccd[117]][_0xeccd[131]];break;case _0xeccd[134]:_0xa398x28=require(_0xeccd[4])[_0xeccd[133]];break;case _0xeccd[136]:_0xa398x28=require(_0xeccd[4])[_0xeccd[135]];break;default:};return _0xa398x28}exports[_0xeccd[92]]=function(_0xa398xe,_0xa398xf){return CustomReport[_0xeccd[46]](_0xa398xe[_0xeccd[45]][_0xeccd[44]])[_0xeccd[19]](function(_0xa398x17){if(!_0xa398x17){return _0xa398xf[_0xeccd[32]](404)};return _0xa398x17[_0xeccd[92]]()})[_0xeccd[19]](function(){return _0xa398xf[_0xeccd[32]](204)})[_0xeccd[16]](function(_0xa398x11){return handleError(_0xa398xf,_0xa398x11)})};exports[_0xeccd[137]]=function(_0xa398xe,_0xa398xf){return CustomReport[_0xeccd[92]]({where:{id:_0xa398xe[_0xeccd[20]][_0xeccd[138]]},individualHooks:true})[_0xeccd[19]](function(){return _0xa398xf[_0xeccd[32]](204)})[_0xeccd[16]](function(_0xa398x11){return handleError(_0xa398xf,_0xa398x11)})};function handleError(_0xa398xf,_0xa398x11){return _0xa398xf[_0xeccd[18]](500)[_0xeccd[17]](_0xa398x11)}
\ No newline at end of file