Built motion from commit 683a3d1.|0.0.135
[motion.git] / server / utils / report_extraction.js
index caad58d..d6592d9 100644 (file)
@@ -1 +1 @@
-var _0x9d5c=["\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","\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","\x65\x78\x74\x72\x61\x63\x74\x50\x44\x46","\x70\x64\x66","\x65\x78\x74\x72\x61\x63\x74\x43\x53\x56","\x63\x73\x76","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x62\x75\x69\x6C\x64\x52\x65\x70\x6F\x72\x74","\x6C\x6F\x67","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\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","\x71\x75\x65\x72\x79","\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","\x66\x6F\x72\x45\x61\x63\x68","\x4D\x4D\x2D\x44\x44\x2D\x59\x59\x59\x59\x20\x48\x48\x3A\x6D\x6D","\x66\x6F\x72\x6D\x61\x74","\x66\x6F\x72\x4F\x77\x6E","\x68\x65\x61\x64\x65\x72","\x73\x74\x61\x72\x74\x44\x61\x74\x65","","\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","\x6F\x6E","\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","\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(_0x9d5c[0]);var pdfMake=require(_0x9d5c[1]);var _=require(_0x9d5c[2]);var util=require(_0x9d5c[3]);var ExtractedReport=require(_0x9d5c[5])[_0x9d5c[4]];var sequelize=require(_0x9d5c[5])[_0x9d5c[6]];var fs=require(_0x9d5c[7]);var moment=require(_0x9d5c[8]);var sr=require(_0x9d5c[9]);var path=require(_0x9d5c[10]);var config=require(_0x9d5c[11]);var reportBuildUtils=require(_0x9d5c[12]);var fonts={Roboto:{normal:path[_0x9d5c[15]](config[_0x9d5c[13]],_0x9d5c[14]),bold:path[_0x9d5c[15]](config[_0x9d5c[13]],_0x9d5c[16]),italics:path[_0x9d5c[15]](config[_0x9d5c[13]],_0x9d5c[17]),bolditalics:path[_0x9d5c[15]](config[_0x9d5c[13]],_0x9d5c[17])}};exports[_0x9d5c[18]]=function(_0x911cxe,_0x911cxf,_0x911cx10){general(_0x911cxe,_0x911cxf,_0x911cx10,_0x9d5c[19])};exports[_0x9d5c[20]]=function(_0x911cxe,_0x911cxf,_0x911cx10){general(_0x911cxe,_0x911cxf,_0x911cx10,_0x9d5c[21])};function general(_0x911cxe,_0x911cxf,_0x911cx10,_0x911cx12){extract(_0x911cxe,_0x911cxf,_0x911cx10,_0x911cx12)}function extract(_0x911cxe,_0x911cx14,_0x911cx10,_0x911cx12){var _0x911cxf=reportBuildUtils[_0x9d5c[23]](_0x911cxe[_0x9d5c[22]],_0x911cx14);sequelize[_0x9d5c[33]](_0x911cxf,{type:sequelize[_0x9d5c[32]][_0x9d5c[31]]})[_0x9d5c[30]](function(_0x911cx16){if(_0x911cx16){if(_0x911cx16[_0x9d5c[27]]){switch(_0x911cx12){case _0x9d5c[19]:createPdf(_0x911cx16,_0x911cxe,_0x911cx14,_0x911cx10);break;case _0x9d5c[21]:createCsv(_0x911cx16,_0x911cxe,_0x911cx14,_0x911cx10);break;default:createCsv(_0x911cx16,_0x911cxe,_0x911cx14,_0x911cx10)}}else {updateExtracted(_0x911cx10,null,_0x9d5c[28])}}else {updateExtracted(_0x911cx10,null,_0x9d5c[29])}})[_0x9d5c[26]](function(_0x911cx15){console[_0x9d5c[24]](_0x911cx15);updateExtracted(_0x911cx10,null,_0x9d5c[25])})}function createPdf(_0x911cx16,_0x911cxe,_0x911cx14,_0x911cx18){var _0x911cx19=sr({length:20,prefix:_0x9d5c[34]+_0x911cxe[_0x9d5c[35]]+_0x9d5c[36],suffix:_0x9d5c[37]});var _0x911cx1a=[];_[_0x9d5c[41]](_0x911cxe.Fields,function(_0x911cx1b){_0x911cx1a[_0x9d5c[40]]({text:_0x911cx1b[_0x9d5c[38]],style:_0x9d5c[39]})});var _0x911cx1c=[_0x911cx1a];_[_0x9d5c[41]](_0x911cx16,function(_0x911cx1b){var _0x911cx1d=[];_[_0x9d5c[44]](_0x911cx1b,function(_0x911cx1e,_0x911cx1f){_0x911cx1d[_0x9d5c[40]](_0x911cx1e instanceof Date?moment(_0x911cx1e)[_0x9d5c[43]](_0x9d5c[42]).toString():_0x911cx1e)});_0x911cx1c[_0x9d5c[40]](_0x911cx1d)});var _0x911cx20={content:[{text:_0x911cxe[_0x9d5c[35]],style:_0x9d5c[45]},_0x911cx14[_0x9d5c[46]]?moment(_0x911cx14[_0x9d5c[46]])[_0x9d5c[43]](_0x9d5c[42]).toString():_0x9d5c[47]+_0x9d5c[48]+_0x911cx14[_0x9d5c[49]]?moment(_0x911cx14[_0x9d5c[49]])[_0x9d5c[43]](_0x9d5c[42]).toString():_0x9d5c[47],{style:_0x9d5c[50],table:{headerRows:1,body:_0x911cx1c}}],styles:{header:{fontSize:18,bold:true,margin:[0,0,0,10]},subheader:{fontSize:16,bold:true,margin:[0,10,0,5]},tableExample:{margin:[0,5,0,15]},tableHeader:{bold:true,fontSize:13,color:_0x9d5c[51]}}};var _0x911cx21= new pdfMake(fonts);var _0x911cx22=_0x911cx21[_0x9d5c[52]](_0x911cx20);if(_0x911cx22){var _0x911cx23=fs[_0x9d5c[54]](config[_0x9d5c[53]]+_0x911cx19);_0x911cx23[_0x9d5c[57]](_0x9d5c[55],function(){updateExtracted(_0x911cx18,null,_0x9d5c[56])});_0x911cx23[_0x9d5c[57]](_0x9d5c[58],function(){updateExtracted(_0x911cx18,_0x911cx19,_0x9d5c[59])});_0x911cx22[_0x9d5c[60]](_0x911cx23);_0x911cx22[_0x9d5c[61]]()}else {updateExtracted(_0x911cx18,null,_0x9d5c[62])}}function createCsv(_0x911cx16,_0x911cxe,_0x911cx14,_0x911cx18){var _0x911cx19=sr({length:20,prefix:_0x9d5c[34]+_0x911cxe[_0x9d5c[35]]+_0x9d5c[36],suffix:_0x9d5c[63]});var _0x911cx25=csv(_0x911cx16);if(_0x911cx25){fs[_0x9d5c[65]](config[_0x9d5c[53]]+_0x911cx19,_0x911cx25,function(_0x911cx15){if(_0x911cx15){console[_0x9d5c[24]](_0x911cx15);updateExtracted(_0x911cx18,null,_0x9d5c[64])}else {updateExtracted(_0x911cx18,_0x911cx19,_0x9d5c[59])}})}else {updateExtracted(_0x911cx18,null,_0x9d5c[66])}}function updateExtracted(_0x911cx18,_0x911cx19,_0x911cx27){ExtractedReport[_0x9d5c[69]]({status:_0x911cx27,savename:_0x911cx19},{where:{id:_0x911cx18}})[_0x9d5c[30]](function(){console[_0x9d5c[24]](_0x9d5c[68])})[_0x9d5c[26]](function(_0x911cx15){console[_0x9d5c[24]](_0x9d5c[67]+_0x911cx15)})}
\ No newline at end of file
+var _0xae71=["\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","\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","\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\x56\x61\x6C\x75\x65\x73","\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"];var csv=require(_0xae71[0]);var PdfMake=require(_0xae71[1]);var _=require(_0xae71[2]);var util=require(_0xae71[3]);var ExtractedReport=require(_0xae71[5])[_0xae71[4]];var License=require(_0xae71[5])[_0xae71[6]];var Settings=require(_0xae71[5])[_0xae71[7]];var sequelize=require(_0xae71[5])[_0xae71[8]];var fs=require(_0xae71[9]);var moment=require(_0xae71[10]);var Promise=require(_0xae71[11]);var base64=Promise[_0xae71[14]](require(_0xae71[13])[_0xae71[12]]);var sr=require(_0xae71[15]);var path=require(_0xae71[16]);var config=require(_0xae71[17]);var reportBuildUtils=require(_0xae71[18]);var license=require(_0xae71[19]);var fonts={Roboto:{normal:path[_0xae71[22]](config[_0xae71[20]],_0xae71[21]),bold:path[_0xae71[22]](config[_0xae71[20]],_0xae71[23]),italics:path[_0xae71[22]](config[_0xae71[20]],_0xae71[24]),bolditalics:path[_0xae71[22]](config[_0xae71[20]],_0xae71[24])}};process[_0xae71[32]](_0xae71[25],function(_0x8131x13){general(_0x8131x13[_0xae71[26]],_0x8131x13[_0xae71[27]],_0x8131x13[_0xae71[28]],_0x8131x13[_0xae71[30]][_0xae71[29]](),_0x8131x13[_0xae71[31]])});function general(_0x8131x15,_0x8131x16,_0x8131x17,_0x8131x18,_0x8131x19){extract(_0x8131x15,_0x8131x16,_0x8131x17,_0x8131x18,_0x8131x19)}function extract(_0x8131x15,_0x8131x1b,_0x8131x17,_0x8131x18,_0x8131x19){var _0x8131x1c,_0x8131x1d;return License[_0xae71[68]](1)[_0xae71[58]](function(_0x8131x23){_0x8131x1c= _0x8131x23;return Settings[_0xae71[68]](1)})[_0xae71[58]](function(_0x8131x28){_0x8131x1d= _0x8131x28;return _0x8131x15[_0xae71[67]]})[_0xae71[58]](reportBuildUtils[_0xae71[66]](_0x8131x19))[_0xae71[58]](function(_0x8131x27){return [_0x8131x27,_0x8131x15]})[_0xae71[65]](reportBuildUtils[_0xae71[64]](_0x8131x1b))[_0xae71[58]](reportBuildUtils[_0xae71[63]]())[_0xae71[58]](function(_0x8131x1f){if(_0x8131x1f){if(_[_0xae71[36]](_0x8131x1f)){if(_0x8131x1f[_0xae71[37]]){_[_0xae71[41]](_0x8131x1f,function(_0x8131x20){_[_0xae71[40]](_0x8131x20,function(_0x8131x21,_0x8131x22){if(_0x8131x21 instanceof  Date){_0x8131x20[_0x8131x22]= moment(_0x8131x21)[_0xae71[39]](_0xae71[38]).toString()}})});switch(_0x8131x18){case _0xae71[59]:var _0x8131x23=_0x8131x1c?JSON[_0xae71[45]](license[_0xae71[44]](_0x8131x1c[_0xae71[43]][_0xae71[42]])):null;var _0x8131x24=(_0x8131x1d&& !_0x8131x1d[_0xae71[46]]&& _0x8131x1d[_0xae71[47]]&& _0x8131x23&& _0x8131x23[_0xae71[48]])?path[_0xae71[22]](config[_0xae71[49]],_0xae71[50],_0xae71[51],_0xae71[52],_0x8131x1d[_0xae71[47]]):path[_0xae71[22]](config[_0xae71[49]],_0xae71[50],_0xae71[51],_0xae71[52],_0xae71[53],_0xae71[54]);return base64(_0x8131x24)[_0xae71[58]](function(_0x8131x25){var _0x8131x26=_0x8131x24[_0xae71[57]](_0xae71[56])[_0xae71[55]]();return createPdf(_0x8131x1f,_0x8131x15,_0x8131x1b,_0x8131x17,_0x8131x25,_0x8131x26)});case _0xae71[60]:return createCsv(_0x8131x1f,_0x8131x15,_0x8131x1b,_0x8131x17);default:return createCsv(_0x8131x1f,_0x8131x15,_0x8131x1b,_0x8131x17)}}else {return updateExtracted(_0x8131x17,null,_0xae71[61])}}else {return updateExtracted(_0x8131x17,null,_0x8131x1f)}}else {return updateExtracted(_0x8131x17,null,_0xae71[62])}})[_0xae71[35]](function(_0x8131x1e){console[_0xae71[33]](_0x8131x1e);return updateExtracted(_0x8131x17,null,_0xae71[34])})}function createPdf(_0x8131x1f,_0x8131x15,_0x8131x1b,_0x8131x2a,_0x8131x2b,_0x8131x26){switch(_0x8131x26){case _0xae71[70]:_0x8131x26= _0xae71[69];break;default:};var _0x8131x2c=sr({length:20,prefix:_0xae71[71]+ _0x8131x15[_0xae71[72]]+ _0xae71[73],suffix:_0xae71[74]});var _0x8131x2d=[];_[_0xae71[41]](_0x8131x15.Fields,function(_0x8131x2e){_0x8131x2d[_0xae71[77]]({text:String(_0x8131x2e[_0xae71[75]]),style:_0xae71[76]})});var _0x8131x2f=[_0x8131x2d];_[_0xae71[41]](_0x8131x1f,function(_0x8131x2e){var _0x8131x20=[];_[_0xae71[40]](_0x8131x2e,function(_0x8131x30,_0x8131x22){_0x8131x20[_0xae71[77]](_0x8131x30?String(_0x8131x30):_0xae71[78])});_0x8131x2f[_0xae71[77]](_0x8131x20)});var _0x8131x31=[{text:_0x8131x15[_0xae71[72]],style:_0xae71[79]}];if(_0x8131x15[_0xae71[80]]){_0x8131x31[_0xae71[77]]({text:_0x8131x15[_0xae71[80]]|| _0xae71[78],color:_0xae71[81],margin:[0,0,0,5]})};if(_0x8131x1b[_0xae71[82]]){_0x8131x31[_0xae71[77]]({text:[{text:_0xae71[83],style:_0xae71[84]},moment(_0x8131x1b[_0xae71[82]])[_0xae71[87]](_0xae71[86])[_0xae71[39]](_0xae71[85]).toString(),{text:_0xae71[88],style:_0xae71[84]},moment(_0x8131x1b[_0xae71[90]]|| _0x8131x1b[_0xae71[82]])[_0xae71[89]](_0xae71[86])[_0xae71[39]](_0xae71[85]).toString()]})};var _0x8131x32=[];_0x8131x32[_0xae71[77]]({style:_0xae71[91],table:{headerRows:1,dontBreakRows:true,body:_0x8131x2f}});var _0x8131x33={pageOrientation:_0xae71[92],pageMargins:[15,90,15,25],header:function(){return {margin:[15,15,0,0],columns:[{table:{widths:[100,_0xae71[93]],body:[[{image:_0xae71[94]+ _0x8131x26+ _0xae71[95]+ _0x8131x2b,fit:[100,60]},_0x8131x31]]},layout:_0xae71[96]}]}},content:_0x8131x32,footer:function(_0x8131x34,_0x8131x35){return {columns:[{text:_0x8131x34.toString()+ _0xae71[97]+ _0x8131x35,alignment:_0xae71[98]}]}},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:_0xae71[99],wordWrap:_0xae71[100]},label:{bold:true,color:_0xae71[99]}}};var _0x8131x36= new PdfMake(fonts);var _0x8131x37=_0x8131x36[_0xae71[101]](_0x8131x33);if(_0x8131x37){var _0x8131x38=fs[_0xae71[103]](config[_0xae71[102]]+ _0x8131x2c);_0x8131x38[_0xae71[32]](_0xae71[104],function(){return updateExtracted(_0x8131x2a,null,_0xae71[105])});_0x8131x38[_0xae71[32]](_0xae71[106],function(){return updateExtracted(_0x8131x2a,_0x8131x2c,_0xae71[107])});_0x8131x37[_0xae71[108]](_0x8131x38);_0x8131x37[_0xae71[109]]()}else {return updateExtracted(_0x8131x2a,null,_0xae71[110])}}function createCsv(_0x8131x1f,_0x8131x15,_0x8131x1b,_0x8131x2a){var _0x8131x2c=sr({length:20,prefix:_0xae71[71]+ _0x8131x15[_0xae71[72]]+ _0xae71[73],suffix:_0xae71[111]});var _0x8131x3a=csv(_0x8131x1f);if(_0x8131x3a){fs[_0xae71[113]](config[_0xae71[102]]+ _0x8131x2c,_0x8131x3a,function(_0x8131x1e){if(_0x8131x1e){console[_0xae71[33]](_0x8131x1e);return updateExtracted(_0x8131x2a,null,_0xae71[112])}else {return updateExtracted(_0x8131x2a,_0x8131x2c,_0xae71[107])}})}else {return updateExtracted(_0x8131x2a,null,_0xae71[114])}}function updateExtracted(_0x8131x2a,_0x8131x2c,_0x8131x3c){return ExtractedReport[_0xae71[120]]({status:_0x8131x3c,savename:_0x8131x2c},{where:{id:_0x8131x2a}})[_0xae71[58]](function(){console[_0xae71[33]](_0xae71[119])})[_0xae71[35]](function(_0x8131x1e){console[_0xae71[33]](_0xae71[118]+ _0x8131x1e)})[_0xae71[117]](function(){process[_0xae71[116]]({message:_0xae71[115],status:_0x8131x3c})})}
\ No newline at end of file