Built motion from commit a11024eac.|1.0.35
[motion.git] / server / utils / report_extraction.js
index fc0d6b9..2b897b1 100644 (file)
@@ -1 +1 @@
-var _0x46a4=["\x74\x6F\x2D\x63\x73\x76","\x70\x64\x66\x6D\x61\x6B\x65","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x66\x73","\x6D\x6F\x6D\x65\x6E\x74","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x70\x61\x74\x68","\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x2E\x2F\x72\x65\x70\x6F\x72\x74\x5F\x62\x75\x69\x6C\x64","\x66\x6F\x6E\x74\x73","\x52\x6F\x62\x6F\x74\x6F\x2D\x52\x65\x67\x75\x6C\x61\x72\x2E\x74\x74\x66","\x6A\x6F\x69\x6E","\x52\x6F\x62\x6F\x74\x6F\x2D\x4D\x65\x64\x69\x75\x6D\x2E\x74\x74\x66","\x52\x6F\x62\x6F\x74\x6F\x2D\x49\x74\x61\x6C\x69\x63\x2E\x74\x74\x66","\x6D\x65\x73\x73\x61\x67\x65","\x6C\x6F\x67","\x72\x65\x70\x6F\x72\x74","\x71\x75\x65\x72\x79","\x65\x78\x74\x72\x61\x63\x74\x65\x64\x49\x64","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x74\x79\x70\x65","\x75\x73\x65\x72","\x6F\x6E","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x66\x6F\x72\x4F\x77\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x70\x64\x66","\x63\x73\x76","\x65\x6D\x70\x74\x79","\x71\x75\x65\x72\x79\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72","\x74\x68\x65\x6E","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x62\x75\x69\x6C\x64\x51\x75\x65\x72\x79","\x73\x70\x72\x65\x61\x64","\x62\x75\x69\x6C\x64\x46\x69\x6C\x74\x65\x72","\x74\x61\x62\x6C\x65","\x61\x6C\x6C","\x72\x65\x70\x6F\x72\x74\x5F","\x6E\x61\x6D\x65","\x5F","\x2E\x70\x64\x66","\x61\x6C\x69\x61\x73","\x74\x61\x62\x6C\x65\x48\x65\x61\x64\x65\x72","\x70\x75\x73\x68","","\x6C\x61\x6E\x64\x73\x63\x61\x70\x65","\x70\x6F\x72\x74\x72\x61\x69\x74","\x68\x65\x61\x64\x65\x72","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x4D\x4D\x2D\x44\x44\x2D\x59\x59\x59\x59\x20\x48\x48\x3A\x6D\x6D","\x20\x2D\x20","\x65\x6E\x64\x44\x61\x74\x65","\x74\x61\x62\x6C\x65\x45\x78\x61\x6D\x70\x6C\x65","\x62\x6C\x61\x63\x6B","\x63\x72\x65\x61\x74\x65\x50\x64\x66\x4B\x69\x74\x44\x6F\x63\x75\x6D\x65\x6E\x74","\x72\x65\x70\x6F\x72\x74\x73","\x63\x72\x65\x61\x74\x65\x57\x72\x69\x74\x65\x53\x74\x72\x65\x61\x6D","\x65\x72\x72\x6F\x72","\x70\x64\x66\x20\x77\x72\x69\x74\x65\x20\x65\x72\x72\x6F\x72","\x66\x69\x6E\x69\x73\x68","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x70\x69\x70\x65","\x65\x6E\x64","\x70\x64\x66\x20\x63\x72\x65\x61\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72","\x2E\x63\x73\x76","\x63\x73\x76\x20\x77\x72\x69\x74\x65\x20\x65\x72\x72\x6F\x72","\x77\x72\x69\x74\x65\x46\x69\x6C\x65","\x63\x73\x76\x20\x63\x72\x65\x61\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72","\x66\x69\x6E\x69\x73\x68\x65\x64","\x73\x65\x6E\x64","\x66\x69\x6E\x61\x6C\x6C\x79","\x2D\x2D\x46\x69\x6E\x69\x73\x68\x65\x64\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74\x20\x77\x69\x74\x68\x20\x65\x72\x72\x6F\x72\x20\x3A\x20","\x2D\x2D\x46\x69\x6E\x69\x73\x68\x65\x64\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74","\x75\x70\x64\x61\x74\x65"];var csv=require(_0x46a4[0]);var pdfMake=require(_0x46a4[1]);var _=require(_0x46a4[2]);var util=require(_0x46a4[3]);var ExtractedReport=require(_0x46a4[5])[_0x46a4[4]];var sequelize=require(_0x46a4[5])[_0x46a4[6]];var fs=require(_0x46a4[7]);var moment=require(_0x46a4[8]);var sr=require(_0x46a4[9]);var path=require(_0x46a4[10]);var config=require(_0x46a4[11]);var Promise=require(_0x46a4[12]);var reportBuildUtils=require(_0x46a4[13]);var fonts={Roboto:{normal:path[_0x46a4[16]](config[_0x46a4[14]],_0x46a4[15]),bold:path[_0x46a4[16]](config[_0x46a4[14]],_0x46a4[17]),italics:path[_0x46a4[16]](config[_0x46a4[14]],_0x46a4[18]),bolditalics:path[_0x46a4[16]](config[_0x46a4[14]],_0x46a4[18])}};process[_0x46a4[27]](_0x46a4[19],function(_0x9588xf){console[_0x46a4[20]](_0x9588xf);general(_0x9588xf[_0x46a4[21]],_0x9588xf[_0x46a4[22]],_0x9588xf[_0x46a4[23]],_0x9588xf[_0x46a4[25]][_0x46a4[24]](),_0x9588xf[_0x46a4[26]])});function general(_0x9588x11,_0x9588x12,_0x9588x13,_0x9588x14,_0x9588x15){extract(_0x9588x11,_0x9588x12,_0x9588x13,_0x9588x14,_0x9588x15)}function extract(_0x9588x11,_0x9588x17,_0x9588x13,_0x9588x14,_0x9588x15){return Promise[_0x46a4[46]]([])[_0x46a4[39]](function(){return _0x9588x11[_0x46a4[45]]})[_0x46a4[39]](reportBuildUtils[_0x46a4[44]](_0x9588x15))[_0x46a4[39]](function(_0x9588x1d){return [_0x9588x1d,_0x9588x11]})[_0x46a4[43]](reportBuildUtils[_0x46a4[42]](_0x9588x17))[_0x46a4[39]](function(_0x9588x12){return _0x9588x12?sequelize[_0x46a4[22]](_0x9588x12,{type:sequelize[_0x46a4[41]][_0x46a4[40]]}):[]})[_0x46a4[39]](function(_0x9588x19){if(_0x9588x19){if(_0x9588x19[_0x46a4[30]]){_[_0x46a4[34]](_0x9588x19,function(_0x9588x1a){_[_0x46a4[33]](_0x9588x1a,function(_0x9588x1b,_0x9588x1c){if(_0x9588x1b instanceof Date){_0x9588x1a[_0x9588x1c]=moment(_0x9588x1b)[_0x46a4[32]](_0x46a4[31]).toString()}})});switch(_0x9588x14){case _0x46a4[35]:createPdf(_0x9588x19,_0x9588x11,_0x9588x17,_0x9588x13);break;case _0x46a4[36]:createCsv(_0x9588x19,_0x9588x11,_0x9588x17,_0x9588x13);break;default:createCsv(_0x9588x19,_0x9588x11,_0x9588x17,_0x9588x13)}}else {updateExtracted(_0x9588x13,null,_0x46a4[37])}}else {updateExtracted(_0x9588x13,null,_0x46a4[38])}})[_0x46a4[29]](function(_0x9588x18){console[_0x46a4[20]](_0x9588x18);updateExtracted(_0x9588x13,null,_0x46a4[28])})}function createPdf(_0x9588x19,_0x9588x11,_0x9588x17,_0x9588x1f){var _0x9588x20=sr({length:20,prefix:_0x46a4[47]+_0x9588x11[_0x46a4[48]]+_0x46a4[49],suffix:_0x46a4[50]});var _0x9588x21=[],_0x9588x22=0;_[_0x46a4[34]](_0x9588x11.Fields,function(_0x9588x23){_0x9588x21[_0x46a4[53]]({text:String(_0x9588x23[_0x46a4[51]]),style:_0x46a4[52]});_0x9588x22++});var _0x9588x24=[_0x9588x21];_[_0x46a4[34]](_0x9588x19,function(_0x9588x23){var _0x9588x1a=[];_[_0x46a4[33]](_0x9588x23,function(_0x9588x25,_0x9588x1c){_0x9588x1a[_0x46a4[53]](_0x9588x25?String(_0x9588x25):_0x46a4[54])});_0x9588x24[_0x46a4[53]](_0x9588x1a)});var _0x9588x26={pageOrientation:_0x9588x22>5?_0x46a4[55]:_0x46a4[56],content:[{text:_0x9588x11[_0x46a4[48]],style:_0x46a4[57]},_0x9588x17[_0x46a4[58]]?moment(_0x9588x17[_0x46a4[58]])[_0x46a4[32]](_0x46a4[59]).toString():_0x46a4[54]+_0x46a4[60]+_0x9588x17[_0x46a4[61]]?moment(_0x9588x17[_0x46a4[61]])[_0x46a4[32]](_0x46a4[59]).toString():_0x46a4[54],{style:_0x46a4[62],table:{headerRows:1,body:_0x9588x24}}],styles:{header:{fontSize:18,bold:true,margin:[0,0,0,10]},tableExample:{margin:[0,5,0,15]},tableHeader:{bold:true,fontSize:13,color:_0x46a4[63]}}};var _0x9588x27= new pdfMake(fonts);var _0x9588x28=_0x9588x27[_0x46a4[64]](_0x9588x26);if(_0x9588x28){var _0x9588x29=fs[_0x46a4[66]](config[_0x46a4[65]]+_0x9588x20);_0x9588x29[_0x46a4[27]](_0x46a4[67],function(){updateExtracted(_0x9588x1f,null,_0x46a4[68])});_0x9588x29[_0x46a4[27]](_0x46a4[69],function(){updateExtracted(_0x9588x1f,_0x9588x20,_0x46a4[70])});_0x9588x28[_0x46a4[71]](_0x9588x29);_0x9588x28[_0x46a4[72]]()}else {updateExtracted(_0x9588x1f,null,_0x46a4[73])}}function createCsv(_0x9588x19,_0x9588x11,_0x9588x17,_0x9588x1f){var _0x9588x20=sr({length:20,prefix:_0x46a4[47]+_0x9588x11[_0x46a4[48]]+_0x46a4[49],suffix:_0x46a4[74]});var _0x9588x2b=csv(_0x9588x19);if(_0x9588x2b){fs[_0x46a4[76]](config[_0x46a4[65]]+_0x9588x20,_0x9588x2b,function(_0x9588x18){if(_0x9588x18){console[_0x46a4[20]](_0x9588x18);updateExtracted(_0x9588x1f,null,_0x46a4[75])}else {updateExtracted(_0x9588x1f,_0x9588x20,_0x46a4[70])}})}else {updateExtracted(_0x9588x1f,null,_0x46a4[77])}}function updateExtracted(_0x9588x1f,_0x9588x20,_0x9588x2d){return ExtractedReport[_0x46a4[83]]({status:_0x9588x2d,savename:_0x9588x20},{where:{id:_0x9588x1f}})[_0x46a4[39]](function(){console[_0x46a4[20]](_0x46a4[82])})[_0x46a4[29]](function(_0x9588x18){console[_0x46a4[20]](_0x46a4[81]+_0x9588x18)})[_0x46a4[80]](function(){process[_0x46a4[79]]({message:_0x46a4[78]})})}
\ No newline at end of file
+var _0xca72=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x74\x6F\x2D\x63\x73\x76","\x70\x64\x66\x6D\x61\x6B\x65","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4C\x69\x63\x65\x6E\x73\x65","\x53\x65\x74\x74\x69\x6E\x67","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x66\x73","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x65\x6E\x63\x6F\x64\x65","\x66\x69\x6C\x65\x2D\x62\x61\x73\x65\x36\x34","\x70\x72\x6F\x6D\x69\x73\x69\x66\x79","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x70\x61\x74\x68","\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2F\x72\x65\x70\x6F\x72\x74\x5F\x62\x75\x69\x6C\x64","\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x69\x63\x65\x6E\x73\x65\x2F\x6C\x69\x63\x65\x6E\x73\x65\x2E\x73\x65\x72\x76\x69\x63\x65","\x66\x6F\x6E\x74\x73","\x52\x6F\x62\x6F\x74\x6F\x2D\x52\x65\x67\x75\x6C\x61\x72\x2E\x74\x74\x66","\x6A\x6F\x69\x6E","\x52\x6F\x62\x6F\x74\x6F\x2D\x4D\x65\x64\x69\x75\x6D\x2E\x74\x74\x66","\x52\x6F\x62\x6F\x74\x6F\x2D\x49\x74\x61\x6C\x69\x63\x2E\x74\x74\x66","\x6D\x65\x73\x73\x61\x67\x65","\x73\x74\x69\x63\x6B\x79\x3A\x62\x61\x6C\x61\x6E\x63\x65","\x72\x65\x70\x6F\x72\x74","\x71\x75\x65\x72\x79","\x65\x78\x74\x72\x61\x63\x74\x65\x64\x49\x64","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x74\x79\x70\x65","\x75\x73\x65\x72","\x6F\x6E","\x6C\x6F\x67","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x66\x6F\x72\x4F\x77\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x6C\x69\x63\x65\x6E\x73\x65","\x64\x61\x74\x61\x31","\x64\x65\x63\x72\x79\x70\x74","\x70\x61\x72\x73\x65","\x64\x65\x66\x61\x75\x6C\x74\x4C\x6F\x67\x69\x6E\x4C\x6F\x67\x6F","\x6C\x6F\x67\x69\x6E\x4C\x6F\x67\x6F","\x63\x75\x73\x74\x6F\x6D","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72","\x66\x69\x6C\x65\x73","\x69\x6D\x61\x67\x65\x73","\x64\x65\x66\x61\x75\x6C\x74","\x6C\x6F\x67\x6F\x2D\x62\x69\x67\x2D\x70\x64\x66\x2E\x70\x6E\x67","\x70\x6F\x70","\x2E","\x73\x70\x6C\x69\x74","\x74\x68\x65\x6E","\x70\x64\x66","\x63\x73\x76","\x65\x6D\x70\x74\x79","\x71\x75\x65\x72\x79\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72","\x63\x68\x65\x63\x6B\x51\x75\x65\x72\x79","\x62\x75\x69\x6C\x64\x51\x75\x65\x72\x79","\x73\x70\x72\x65\x61\x64","\x62\x75\x69\x6C\x64\x46\x69\x6C\x74\x65\x72","\x74\x61\x62\x6C\x65","\x66\x69\x6E\x64\x42\x79\x49\x64","\x6A\x70\x65\x67","\x6A\x70\x67","\x72\x65\x70\x6F\x72\x74\x5F","\x6E\x61\x6D\x65","\x5F","\x2E\x70\x64\x66","\x61\x6C\x69\x61\x73","\x74\x61\x62\x6C\x65\x48\x65\x61\x64\x65\x72","\x70\x75\x73\x68","","\x68\x65\x61\x64\x65\x72","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x23\x38\x32\x38\x36\x38\x32","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x46\x72\x6F\x6D\x3A\x20","\x6C\x61\x62\x65\x6C","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x20\x20\x54\x6F\x3A\x20","\x65\x6E\x64\x4F\x66","\x65\x6E\x64\x44\x61\x74\x65","\x74\x61\x62\x6C\x65\x45\x78\x61\x6D\x70\x6C\x65","\x6C\x61\x6E\x64\x73\x63\x61\x70\x65","\x2A","\x64\x61\x74\x61\x3A\x69\x6D\x61\x67\x65\x2F","\x3B\x62\x61\x73\x65\x36\x34\x2C","\x6E\x6F\x42\x6F\x72\x64\x65\x72\x73","\x20\x6F\x66\x20","\x63\x65\x6E\x74\x65\x72","\x62\x6C\x61\x63\x6B","\x62\x72\x65\x61\x6B\x2D\x77\x6F\x72\x64","\x63\x72\x65\x61\x74\x65\x50\x64\x66\x4B\x69\x74\x44\x6F\x63\x75\x6D\x65\x6E\x74","\x72\x65\x70\x6F\x72\x74\x73","\x63\x72\x65\x61\x74\x65\x57\x72\x69\x74\x65\x53\x74\x72\x65\x61\x6D","\x65\x72\x72\x6F\x72","\x70\x64\x66\x20\x77\x72\x69\x74\x65\x20\x65\x72\x72\x6F\x72","\x66\x69\x6E\x69\x73\x68","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x70\x69\x70\x65","\x65\x6E\x64","\x70\x64\x66\x20\x63\x72\x65\x61\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72","\x2E\x63\x73\x76","\x63\x73\x76\x20\x77\x72\x69\x74\x65\x20\x65\x72\x72\x6F\x72","\x77\x72\x69\x74\x65\x46\x69\x6C\x65","\x63\x73\x76\x20\x63\x72\x65\x61\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72","\x66\x69\x6E\x69\x73\x68\x65\x64","\x73\x65\x6E\x64","\x66\x69\x6E\x61\x6C\x6C\x79","\x2D\x2D\x46\x69\x6E\x69\x73\x68\x65\x64\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74\x20\x77\x69\x74\x68\x20\x65\x72\x72\x6F\x72\x20\x3A\x20","\x2D\x2D\x46\x69\x6E\x69\x73\x68\x65\x64\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74","\x75\x70\x64\x61\x74\x65"];_0xca72[0];var csv=require(_0xca72[1]);var PdfMake=require(_0xca72[2]);var _=require(_0xca72[3]);var util=require(_0xca72[4]);var ExtractedReport=require(_0xca72[6])[_0xca72[5]];var License=require(_0xca72[6])[_0xca72[7]];var Setting=require(_0xca72[6])[_0xca72[8]];var sequelize=require(_0xca72[6])[_0xca72[9]];var fs=require(_0xca72[10]);var moment=require(_0xca72[11]);var Promise=require(_0xca72[12]);var base64=Promise[_0xca72[15]](require(_0xca72[14])[_0xca72[13]]);var sr=require(_0xca72[16]);var path=require(_0xca72[17]);var config=require(_0xca72[18]);var reportBuildUtils=require(_0xca72[19]);var license=require(_0xca72[20]);var fonts={Roboto:{normal:path[_0xca72[23]](config[_0xca72[21]],_0xca72[22]),bold:path[_0xca72[23]](config[_0xca72[21]],_0xca72[24]),italics:path[_0xca72[23]](config[_0xca72[21]],_0xca72[25]),bolditalics:path[_0xca72[23]](config[_0xca72[21]],_0xca72[25])}};process[_0xca72[34]](_0xca72[26],function(_0x62aax13){if(_0x62aax13!== _0xca72[27]){general(_0x62aax13[_0xca72[28]],_0x62aax13[_0xca72[29]],_0x62aax13[_0xca72[30]],_0x62aax13[_0xca72[32]][_0xca72[31]](),_0x62aax13[_0xca72[33]])}});function general(_0x62aax15,_0x62aax16,_0x62aax17,_0x62aax18,_0x62aax19){extract(_0x62aax15,_0x62aax16,_0x62aax17,_0x62aax18,_0x62aax19)}function extract(_0x62aax15,_0x62aax1b,_0x62aax17,_0x62aax18,_0x62aax19){var _0x62aax1c,_0x62aax1d;return License[_0xca72[70]](1)[_0xca72[60]](function(_0x62aax23){_0x62aax1c= _0x62aax23;return Setting[_0xca72[70]](1)})[_0xca72[60]](function(_0x62aax28){_0x62aax1d= _0x62aax28;return _0x62aax15[_0xca72[69]]})[_0xca72[60]](reportBuildUtils[_0xca72[68]](_0x62aax19))[_0xca72[60]](function(_0x62aax27){return [_0x62aax27,_0x62aax15]})[_0xca72[67]](reportBuildUtils[_0xca72[66]](_0x62aax1b))[_0xca72[60]](reportBuildUtils[_0xca72[65]]())[_0xca72[60]](function(_0x62aax1f){if(_0x62aax1f){if(_[_0xca72[38]](_0x62aax1f)){if(_0x62aax1f[_0xca72[39]]){_[_0xca72[43]](_0x62aax1f,function(_0x62aax20){_[_0xca72[42]](_0x62aax20,function(_0x62aax21,_0x62aax22){if(_0x62aax21 instanceof  Date){_0x62aax20[_0x62aax22]= moment(_0x62aax21)[_0xca72[41]](_0xca72[40]).toString()}})});switch(_0x62aax18){case _0xca72[61]:var _0x62aax23=_0x62aax1c?JSON[_0xca72[47]](license[_0xca72[46]](_0x62aax1c[_0xca72[44]],_0x62aax1c[_0xca72[45]])):null;var _0x62aax24=(_0x62aax1d&&  !_0x62aax1d[_0xca72[48]]&& _0x62aax1d[_0xca72[49]]&& _0x62aax23&& _0x62aax23[_0xca72[50]])?path[_0xca72[23]](config[_0xca72[51]],_0xca72[52],_0xca72[53],_0xca72[54],_0x62aax1d[_0xca72[49]]):path[_0xca72[23]](config[_0xca72[51]],_0xca72[52],_0xca72[53],_0xca72[54],_0xca72[55],_0xca72[56]);return base64(_0x62aax24)[_0xca72[60]](function(_0x62aax25){var _0x62aax26=_0x62aax24[_0xca72[59]](_0xca72[58])[_0xca72[57]]();return createPdf(_0x62aax1f,_0x62aax15,_0x62aax1b,_0x62aax17,_0x62aax25,_0x62aax26)});case _0xca72[62]:return createCsv(_0x62aax1f,_0x62aax15,_0x62aax1b,_0x62aax17);default:return createCsv(_0x62aax1f,_0x62aax15,_0x62aax1b,_0x62aax17)}}else {return updateExtracted(_0x62aax17,null,_0xca72[63])}}else {return updateExtracted(_0x62aax17,null,_0x62aax1f)}}else {return updateExtracted(_0x62aax17,null,_0xca72[64])}})[_0xca72[37]](function(_0x62aax1e){console[_0xca72[35]](_0x62aax1e);return updateExtracted(_0x62aax17,null,_0xca72[36])})}function createPdf(_0x62aax1f,_0x62aax15,_0x62aax1b,_0x62aax2a,_0x62aax2b,_0x62aax26){switch(_0x62aax26){case _0xca72[72]:_0x62aax26= _0xca72[71];break;default:};var _0x62aax2c=sr({length:20,prefix:_0xca72[73]+ _0x62aax15[_0xca72[74]]+ _0xca72[75],suffix:_0xca72[76]});var _0x62aax2d=[];_[_0xca72[43]](_0x62aax15.Fields,function(_0x62aax2e){_0x62aax2d[_0xca72[79]]({text:String(_0x62aax2e[_0xca72[77]]),style:_0xca72[78]})});var _0x62aax2f=[_0x62aax2d];_[_0xca72[43]](_0x62aax1f,function(_0x62aax2e){var _0x62aax20=[];_[_0xca72[42]](_0x62aax2e,function(_0x62aax30,_0x62aax22){_0x62aax20[_0xca72[79]](_0x62aax30?String(_0x62aax30):_0xca72[80])});_0x62aax2f[_0xca72[79]](_0x62aax20)});var _0x62aax31=[{text:_0x62aax15[_0xca72[74]],style:_0xca72[81]}];if(_0x62aax15[_0xca72[82]]){_0x62aax31[_0xca72[79]]({text:_0x62aax15[_0xca72[82]]|| _0xca72[80],color:_0xca72[83],margin:[0,0,0,5]})};if(_0x62aax1b[_0xca72[84]]){_0x62aax31[_0xca72[79]]({text:[{text:_0xca72[85],style:_0xca72[86]},moment(_0x62aax1b[_0xca72[84]])[_0xca72[89]](_0xca72[88])[_0xca72[41]](_0xca72[87]).toString(),{text:_0xca72[90],style:_0xca72[86]},moment(_0x62aax1b[_0xca72[92]]|| _0x62aax1b[_0xca72[84]])[_0xca72[91]](_0xca72[88])[_0xca72[41]](_0xca72[87]).toString()]})};var _0x62aax32=[];_0x62aax32[_0xca72[79]]({style:_0xca72[93],table:{headerRows:1,dontBreakRows:true,body:_0x62aax2f}});var _0x62aax33={pageOrientation:_0xca72[94],pageMargins:[15,90,15,25],header:function(){return {margin:[15,15,0,0],columns:[{table:{widths:[100,_0xca72[95]],body:[[{image:_0xca72[96]+ _0x62aax26+ _0xca72[97]+ _0x62aax2b,fit:[100,60]},_0x62aax31]]},layout:_0xca72[98]}]}},content:_0x62aax32,footer:function(_0x62aax34,_0x62aax35){return {columns:[{text:_0x62aax34.toString()+ _0xca72[99]+ _0x62aax35,alignment:_0xca72[100]}]}},styles:{header:{fontSize:18,bold:true,margin:[0,0,0,5]},tableExample:{margin:[0,0,0,5],fontSize:8},tableHeader:{bold:true,fontSize:8,color:_0xca72[101],wordWrap:_0xca72[102]},label:{bold:true,color:_0xca72[101]}}};var _0x62aax36= new PdfMake(fonts);var _0x62aax37=_0x62aax36[_0xca72[103]](_0x62aax33);if(_0x62aax37){var _0x62aax38=fs[_0xca72[105]](config[_0xca72[104]]+ _0x62aax2c);_0x62aax38[_0xca72[34]](_0xca72[106],function(){return updateExtracted(_0x62aax2a,null,_0xca72[107])});_0x62aax38[_0xca72[34]](_0xca72[108],function(){return updateExtracted(_0x62aax2a,_0x62aax2c,_0xca72[109])});_0x62aax37[_0xca72[110]](_0x62aax38);_0x62aax37[_0xca72[111]]()}else {return updateExtracted(_0x62aax2a,null,_0xca72[112])}}function createCsv(_0x62aax1f,_0x62aax15,_0x62aax1b,_0x62aax2a){var _0x62aax2c=sr({length:20,prefix:_0xca72[73]+ _0x62aax15[_0xca72[74]]+ _0xca72[75],suffix:_0xca72[113]});var _0x62aax3a=csv(_0x62aax1f);if(_0x62aax3a){fs[_0xca72[115]](config[_0xca72[104]]+ _0x62aax2c,_0x62aax3a,function(_0x62aax1e){if(_0x62aax1e){console[_0xca72[35]](_0x62aax1e);return updateExtracted(_0x62aax2a,null,_0xca72[114])}else {return updateExtracted(_0x62aax2a,_0x62aax2c,_0xca72[109])}})}else {return updateExtracted(_0x62aax2a,null,_0xca72[116])}}function updateExtracted(_0x62aax2a,_0x62aax2c,_0x62aax3c){return ExtractedReport[_0xca72[122]]({status:_0x62aax3c,savename:_0x62aax2c},{where:{id:_0x62aax2a}})[_0xca72[60]](function(){console[_0xca72[35]](_0xca72[121])})[_0xca72[37]](function(_0x62aax1e){console[_0xca72[35]](_0xca72[120]+ _0x62aax1e)})[_0xca72[119]](function(){process[_0xca72[118]]({message:_0xca72[117],status:_0x62aax3c})})}
\ No newline at end of file