Built motion from commit 943eae279.|1.0.24
[motion.git] / server / api / contact_manager / contact_manager.controller.js
index b42000e..2499734 100644 (file)
@@ -1 +1 @@
-var _0xac88=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74\x50\x68\x6F\x6E\x65","\x43\x6F\x6E\x74\x61\x63\x74\x45\x6D\x61\x69\x6C","\x43\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x48\x69\x73\x74\x6F\x72\x79","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x6D\x73\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x4C\x69\x73\x74","\x43\x6F\x6D\x70\x61\x6E\x79","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C\x48\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x54\x61\x67","\x54\x64\x55\x70\x64\x61\x74\x65","\x73\x74\x72\x65\x61\x6D","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x61\x73\x79\x6E\x63","\x62\x6C\x75\x65\x62\x69\x72\x64","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\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","\x72\x65\x73\x6F\x6C\x76\x65","\x65\x78\x74\x72\x61\x63\x74\x41\x6C\x6C","\x69\x64","\x66\x69\x72\x73\x74\x4E\x61\x6D\x65","\x46\x69\x72\x73\x74\x20\x4E\x61\x6D\x65","\x6C\x61\x73\x74\x4E\x61\x6D\x65","\x4C\x61\x73\x74\x20\x4E\x61\x6D\x65","\x74\x61\x67\x73","\x54\x61\x67\x73","\x73\x74\x72\x65\x65\x74","\x53\x74\x72\x65\x65\x74","\x70\x6F\x73\x74\x61\x6C\x43\x6F\x64\x65","\x50\x6F\x73\x74\x61\x6C\x20\x43\x6F\x64\x65","\x63\x69\x74\x79","\x43\x69\x74\x79","\x63\x6F\x75\x6E\x74\x72\x79","\x43\x6F\x75\x6E\x74\x72\x79","\x64\x61\x74\x65\x4F\x66\x42\x69\x72\x74\x68","\x44\x61\x74\x65\x20\x6F\x66\x20\x62\x69\x72\x74\x68","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x70\x68\x6F\x6E\x65","\x50\x68\x6F\x6E\x65","\x6D\x6F\x62\x69\x6C\x65","\x4D\x6F\x62\x69\x6C\x65","\x66\x61\x78","\x46\x61\x78","\x65\x6D\x61\x69\x6C","\x45\x6D\x61\x69\x6C","\x75\x72\x6C","\x55\x52\x4C","\x43\x6F\x6D\x70\x61\x6E\x79\x49\x64","\x4C\x69\x73\x74\x49\x64","\x72\x6F\x77\x73","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64","\x6E\x61\x6D\x65","","\x66\x6F\x72\x45\x61\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x2C","\x6A\x6F\x69\x6E","\x20\x61\x73\x20\x27","\x61\x6C\x69\x61\x73","\x27","\x6D\x61\x70","\x53\x45\x4C\x45\x43\x54\x20\x69\x64\x2C\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x20\x49\x4E\x20\x28\x27","\x27\x2C\x27","\x27\x29\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20\x25\x73","\x6F\x72\x64\x65\x72","\x71\x75\x65\x72\x79","\x69\x64\x20\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x6B\x65\x79\x73","\x63\x66\x5F","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x66\x69\x6C\x74\x65\x72","\x24\x6F\x72","\x77\x68\x65\x72\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x64\x65\x73\x63\x72\x69\x62\x65","\x63\x6F\x6E\x63\x61\x74","\x6D\x65\x72\x67\x65\x63\x6F\x6E\x74\x61\x63\x74","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x6C\x69\x73\x74","\x63\x6F\x6D\x70\x61\x6E\x79","\x63\x6F\x6D\x70\x61\x6E\x79\x5F\x6C\x69\x73\x74\x5F\x66\x69\x6C\x74\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x4C\x69\x73\x74\x73","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x67\x65\x6E\x74","\x63\x6F\x75\x6E\x74","\x72\x6F\x6C\x65","\x67\x65\x74\x4C\x6F\x67","\x64\x65\x74\x61\x69\x6C","\x67\x65\x6E\x65\x72\x61\x6C","\x73\x68\x6F\x77","\x6C\x6F\x67\x54\x79\x70\x65","\x6A\x6F\x75\x72\x6E\x61\x6C","\x74\x79\x70\x65","\x69\x6E\x62\x6F\x75\x6E\x64","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x65\x73\x74\x69\x6E\x61\x74\x69\x6F\x6E","\x73\x6F\x75\x72\x63\x65","\x66\x72\x6F\x6D","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x6E\x74\x61\x63\x74","\x63\x68\x61\x74","\x73\x6D\x73","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x71\x75\x65\x75\x65","\x70\x61\x72\x61\x6D\x73","\x6E\x75\x6C\x6C","\x53\x45\x4C\x45\x43\x54\x20\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x67\x65\x74\x43\x6F\x6E\x74\x61\x63\x74\x73","\x73\x75\x62\x74\x79\x70\x65\x43\x68\x61\x6E\x6E\x65\x6C","\x62\x6F\x64\x79","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x76\x6F\x69\x63\x65","\x6D\x61\x69\x6C","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x63\x72\x65\x61\x74\x65\x43\x6F\x6E\x74\x61\x63\x74","\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x63\x6F\x6E\x74\x61\x63\x74\x20\x61\x75\x74\x6F\x20\x63\x72\x65\x61\x74\x69\x6F\x6E","\x65\x72\x72\x6F\x72","\x70\x75\x73\x68","\x67\x65\x74","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x4E\x61\x6D\x65\x20\x6F\x72\x20\x4C\x69\x73\x74\x49\x64\x20\x6D\x69\x73\x73\x69\x6E\x67\x20\x6F\x72\x20\x69\x6E\x76\x61\x6C\x69\x64\x21","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x55\x73\x65\x72\x49\x64","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x3B","\x3B\x27","\x69\x73\x53\x74\x72\x69\x6E\x67","\x66\x6F\x72\x4F\x77\x6E","\x69\x6E\x73\x65\x72\x74\x49\x64","\x49\x4E\x53\x45\x52\x54\x20\x49\x4E\x54\x4F\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x28\x25\x73\x29\x20\x56\x41\x4C\x55\x45\x53\x20\x28\x25\x73\x29","\x63\x6F\x70\x79","\x25\x73\x3D\x27\x25\x73\x27","\x55\x50\x44\x41\x54\x45\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x53\x45\x54\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x63\x6C\x6F\x6E\x65","\x73\x70\x6C\x69\x74","\x70\x6F\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x61\x6C\x6C","\x63\x6F\x6E\x74\x61\x63\x74\x73","\x75\x6E\x69\x6F\x6E","\x73\x74\x61\x63\x6B","\x64\x65\x62\x75\x67","\x6B\x6F","\x66\x61\x69\x6C\x65\x64","\x6F\x6B","\x66\x6F\x72\x45\x61\x63\x68\x4F\x66","\x75\x70\x64\x61\x74\x65","\x6F\x6C\x64\x43\x6F\x6E\x74\x61\x63\x74","\x64\x65\x73\x74\x72\x6F\x79","\x63\x6F\x6E\x74\x61\x63\x74\x2F\x75\x70\x64\x61\x74\x65","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x63\x6F\x6E\x74\x61\x63\x74\x2F\x64\x65\x6C\x65\x74\x65","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xac88[0];var _=require(_0xac88[1]);var moment=require(_0xac88[2]);var Contact=require(_0xac88[4])[_0xac88[3]];var User=require(_0xac88[4])[_0xac88[5]];var ContactPhone=require(_0xac88[4])[_0xac88[6]];var ContactEmail=require(_0xac88[4])[_0xac88[7]];var CustomField=require(_0xac88[4])[_0xac88[8]];var ReportCall=require(_0xac88[4])[_0xac88[9]];var ReportQueue=require(_0xac88[4])[_0xac88[10]];var ReportQueueHistory=require(_0xac88[4])[_0xac88[12]][_0xac88[11]];var ReportChatRoom=require(_0xac88[4])[_0xac88[13]];var ReportChatRoomHistory=require(_0xac88[4])[_0xac88[12]][_0xac88[14]];var ChatRoom=require(_0xac88[4])[_0xac88[15]];var FaxRoom=require(_0xac88[4])[_0xac88[16]];var SmsRoom=require(_0xac88[4])[_0xac88[17]];var ReportIntegration=require(_0xac88[4])[_0xac88[18]];var List=require(_0xac88[4])[_0xac88[19]];var Company=require(_0xac88[4])[_0xac88[20]];var ReportCallHistory=require(_0xac88[4])[_0xac88[12]][_0xac88[21]];var ReportMailSession=require(_0xac88[4])[_0xac88[22]];var MailRoom=require(_0xac88[4])[_0xac88[23]];var ReportMailSessionHistory=require(_0xac88[4])[_0xac88[12]][_0xac88[24]];var Tag=require(_0xac88[4])[_0xac88[25]];var TdUpdate=require(_0xac88[4])[_0xac88[26]];var stream=require(_0xac88[27]);var sequelize=require(_0xac88[4])[_0xac88[28]];var util=require(_0xac88[29]);var Util=require(_0xac88[30]);var Async=require(_0xac88[31]);var Promise=require(_0xac88[32]);var logger=require(_0xac88[34])(_0xac88[33]);exports[_0xac88[35]]= function(_0x1998x20,_0x1998x21,_0x1998x22){return Promise[_0xac88[40]]()[_0xac88[39]](getContacts(_0x1998x20))[_0xac88[39]](function(_0x1998x24){_0x1998x21[_0xac88[38]](200)[_0xac88[37]](_0x1998x24)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};exports[_0xac88[41]]= function(_0x1998x20,_0x1998x21,_0x1998x22){var _0x1998x25=[_0xac88[42],[_0xac88[43],_0xac88[44]],[_0xac88[45],_0xac88[46]],[_0xac88[47],_0xac88[48]],[_0xac88[49],_0xac88[50]],[_0xac88[51],_0xac88[52]],[_0xac88[53],_0xac88[54]],[_0xac88[55],_0xac88[56]],[_0xac88[57],_0xac88[58]],[_0xac88[59],_0xac88[60]],[_0xac88[61],_0xac88[62]],[_0xac88[63],_0xac88[64]],[_0xac88[65],_0xac88[66]],[_0xac88[67],_0xac88[68]],[_0xac88[69],_0xac88[70]],_0xac88[71],_0xac88[72]];return Promise[_0xac88[40]]()[_0xac88[39]](getContacts(_0x1998x20,_0x1998x25))[_0xac88[39]](function(_0x1998x24){_0x1998x21[_0xac88[38]](200)[_0xac88[37]](_0x1998x24)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};function getContacts(_0x1998x20,_0x1998x25){return function(){var _0x1998x27,_0x1998x28,_0x1998x29,_0x1998x2a=[],_0x1998x2b=[];switch(_0x1998x20[_0xac88[113]][_0xac88[117]]){case _0xac88[115]:return User[_0xac88[114]](_0x1998x20[_0xac88[113]][_0xac88[42]])[_0xac88[39]](function(_0x1998x3b){return _0x1998x3b[_0xac88[112]]()})[_0xac88[39]](function(_0x1998x2b){_0x1998x28= _[_0xac88[85]](_0x1998x2b,_0xac88[42]);return Company[_0xac88[101]]({attributes:[_0xac88[42],_0xac88[76]],raw:true})})[_0xac88[39]](function(_0x1998x3a){_0x1998x2a= _0x1998x3a;return List[_0xac88[101]]({attributes:[_0xac88[42],_0xac88[76]],raw:true})})[_0xac88[39]](function(_0x1998x38){_0x1998x2b= _0x1998x38;_0x1998x29= {CompanyId:_0x1998x20[_0xac88[90]][_0xac88[71]]|| null,ListId:_0x1998x20[_0xac88[90]][_0xac88[72]]|| null};delete _0x1998x20[_0xac88[90]][_0xac88[71]];delete _0x1998x20[_0xac88[90]][_0xac88[72]];var _0x1998x39=_0x1998x29[_0xac88[72]]?{}:{ListId:{$in:_0x1998x28[_0xac88[104]](_[_0xac88[85]](_[_0xac88[98]](_0x1998x2b,{defaultEntry:true}),_0xac88[42]))}};if(_0x1998x20[_0xac88[90]][_0xac88[105]]){_0x1998x39[_0xac88[42]]= {$ne:_0x1998x20[_0xac88[90]][_0xac88[105]]};delete _0x1998x20[_0xac88[90]][_0xac88[105]]};return Contact[_0xac88[111]](_0xac88[108],_0xac88[109],{method:[_0xac88[110],_0x1998x29]})[_0xac88[107]](Util[_0xac88[106]](_0x1998x20[_0xac88[90]],_0x1998x39,{attributes:_0x1998x25,order:_0x1998x20[_0xac88[90]][_0xac88[89]]|| _0xac88[91]}))})[_0xac88[39]](function(_0x1998x37){_0x1998x27= {rows:_[_0xac88[85]](_0x1998x37[_0xac88[73]],_0xac88[102]),count:_0x1998x37[_0xac88[73]]};return Contact[_0xac88[103]]()})[_0xac88[39]](function(_0x1998x34){_0x1998x34= _[_0xac88[98]](_[_0xac88[95]](_0x1998x34),function(_0x1998x35){return _[_0xac88[97]](_0x1998x35,_0xac88[96])});var _0x1998x36={where:{name:_0x1998x34}};_0x1998x29[_0xac88[72]]&& (_0x1998x36[_0xac88[100]][_0xac88[99]]= [{ListId:_0x1998x29[_0xac88[72]]},{ListId:null}]);return CustomField[_0xac88[101]](_0x1998x36)})[_0xac88[39]](function(_0x1998x31){if(_0x1998x31[_0xac88[79]]){var _0x1998x32=_[_0xac88[85]](_0x1998x31,function(_0x1998x33){return _0x1998x33[_0xac88[76]]+ _0xac88[82]+ _0x1998x33[_0xac88[83]]+ _0xac88[84]})[_0xac88[81]](_0xac88[80]);return sequelize[_0xac88[90]](util[_0xac88[92]](_0xac88[86]+ _[_0xac88[85]](_0x1998x27[_0xac88[73]],_0xac88[42])[_0xac88[81]](_0xac88[87])+ _0xac88[88],_0x1998x32,_0x1998x20[_0xac88[90]][_0xac88[89]]|| _0xac88[91]),{type:sequelize[_0xac88[94]][_0xac88[93]]})}})[_0xac88[39]](function(_0x1998x2c){var _0x1998x2d,_0x1998x2e;_[_0xac88[78]](_0x1998x27[_0xac88[73]],function(_0x1998x2f,_0x1998x30){_0x1998x2c&& _[_0xac88[74]](_0x1998x2f,_0x1998x2c[_0x1998x30]);_0x1998x2d= _[_0xac88[75]](_0x1998x2a,{id:_0x1998x2f[_0xac88[71]]});_0x1998x2f[_0xac88[20]]= _0x1998x2d?_0x1998x2d[_0xac88[76]]:_0xac88[77];_0x1998x2e= _[_0xac88[75]](_0x1998x2b,{id:_0x1998x2f[_0xac88[72]]});_0x1998x2f[_0xac88[19]]= _0x1998x2e?_0x1998x2e[_0xac88[76]]:_0xac88[77];if(_0x1998x25){delete _0x1998x2f[_0xac88[42]];delete _0x1998x2f[_0xac88[71]];delete _0x1998x2f[_0xac88[72]]}});return _0x1998x27});default:_0x1998x29= {CompanyId:_0x1998x20[_0xac88[90]][_0xac88[71]]|| null,ListId:_0x1998x20[_0xac88[90]][_0xac88[72]]|| null};delete _0x1998x20[_0xac88[90]][_0xac88[71]];delete _0x1998x20[_0xac88[90]][_0xac88[72]];var _0x1998x39={};if(_0x1998x20[_0xac88[90]][_0xac88[105]]){_0x1998x39[_0xac88[42]]= {$ne:_0x1998x20[_0xac88[90]][_0xac88[105]]};delete _0x1998x20[_0xac88[90]][_0xac88[105]]};return Company[_0xac88[101]]({attributes:[_0xac88[42],_0xac88[76]],raw:true})[_0xac88[39]](function(_0x1998x3a){_0x1998x2a= _0x1998x3a;return List[_0xac88[101]]({attributes:[_0xac88[42],_0xac88[76]],raw:true})})[_0xac88[39]](function(_0x1998x38){_0x1998x2b= _0x1998x38;return Contact[_0xac88[111]]({method:[_0xac88[110],_0x1998x29]})[_0xac88[107]](Util[_0xac88[106]](_0x1998x20[_0xac88[90]],_0x1998x39,{attributes:_0x1998x25,order:_0x1998x20[_0xac88[90]][_0xac88[89]]|| _0xac88[91]}))})[_0xac88[39]](function(_0x1998x37){_0x1998x27= {rows:_[_0xac88[85]](_0x1998x37[_0xac88[73]],_0xac88[102]),count:_0x1998x37[_0xac88[116]]};return Contact[_0xac88[103]]()})[_0xac88[39]](function(_0x1998x34){_0x1998x34= _[_0xac88[98]](_[_0xac88[95]](_0x1998x34),function(_0x1998x35){return _[_0xac88[97]](_0x1998x35,_0xac88[96])});var _0x1998x36={where:{name:_0x1998x34}};_0x1998x29[_0xac88[72]]&& (_0x1998x36[_0xac88[100]][_0xac88[99]]= [{ListId:_0x1998x29[_0xac88[72]]},{ListId:null}]);return CustomField[_0xac88[101]](_0x1998x36)})[_0xac88[39]](function(_0x1998x31){if(_0x1998x27[_0xac88[73]][_0xac88[79]]&& _0x1998x31[_0xac88[79]]){var _0x1998x32=_[_0xac88[85]](_0x1998x31,function(_0x1998x33){return _0x1998x33[_0xac88[76]]+ _0xac88[82]+ _0x1998x33[_0xac88[83]]+ _0xac88[84]})[_0xac88[81]](_0xac88[80]);return sequelize[_0xac88[90]](util[_0xac88[92]](_0xac88[86]+ _[_0xac88[85]](_0x1998x27[_0xac88[73]],_0xac88[42])[_0xac88[81]](_0xac88[87])+ _0xac88[88],_0x1998x32,_0x1998x20[_0xac88[90]][_0xac88[89]]|| _0xac88[91]),{type:sequelize[_0xac88[94]][_0xac88[93]]})}})[_0xac88[39]](function(_0x1998x2c){var _0x1998x2d,_0x1998x2e;_[_0xac88[78]](_0x1998x27[_0xac88[73]],function(_0x1998x2f,_0x1998x30){_0x1998x2c&& _[_0xac88[74]](_0x1998x2f,_0x1998x2c[_0x1998x30]);_0x1998x2d= _[_0xac88[75]](_0x1998x2a,{id:_0x1998x2f[_0xac88[71]]});_0x1998x2f[_0xac88[20]]= _0x1998x2d?_0x1998x2d[_0xac88[76]]:_0xac88[77];_0x1998x2e= _[_0xac88[75]](_0x1998x2b,{id:_0x1998x2f[_0xac88[72]]});_0x1998x2f[_0xac88[19]]= _0x1998x2e?_0x1998x2e[_0xac88[76]]:_0xac88[77];if(_0x1998x25){delete _0x1998x2f[_0xac88[42]];delete _0x1998x2f[_0xac88[71]];delete _0x1998x2f[_0xac88[72]]}});return _0x1998x27})}}}exports[_0xac88[103]]= function(_0x1998x20,_0x1998x21){return Contact[_0xac88[103]]()[_0xac88[39]](function(_0x1998x34){return _0x1998x21[_0xac88[38]](200)[_0xac88[37]](_0x1998x34)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};exports[_0xac88[118]]= function(_0x1998x20,_0x1998x21,_0x1998x22){_0x1998x20[_0xac88[90]][_0xac88[119]]= _0x1998x20[_0xac88[90]][_0xac88[119]]|| _0xac88[120];_0x1998x20[_0xac88[90]][_0xac88[121]]= _0x1998x20[_0xac88[90]][_0xac88[121]]|| _0xac88[61];_0x1998x20[_0xac88[90]][_0xac88[122]]= _0x1998x20[_0xac88[90]][_0xac88[122]]|| _0xac88[123];_0x1998x20[_0xac88[90]][_0xac88[124]]= _0x1998x20[_0xac88[90]][_0xac88[124]]|| _0xac88[125];var _0x1998x3c,_0x1998x3d={};return Contact[_0xac88[114]](_0x1998x20[_0xac88[139]][_0xac88[42]])[_0xac88[39]](function(_0x1998x3e){if(!_0x1998x3e){return _0x1998x21[_0xac88[126]](404)};switch(_0x1998x20[_0xac88[90]][_0xac88[119]]){case _0xac88[120]:switch(_0x1998x20[_0xac88[90]][_0xac88[121]]){case _0xac88[61]:_0x1998x3c= (_0x1998x20[_0xac88[90]][_0xac88[122]]=== _0xac88[12])?ReportCallHistory:ReportCall;if(_0x1998x20[_0xac88[90]][_0xac88[124]]=== _0xac88[127]){_0x1998x3d[_0xac88[128]]= [_0x1998x3e[_0xac88[61]],_0x1998x3e[_0xac88[63]]]}else {_0x1998x3d[_0xac88[129]]= [_0x1998x3e[_0xac88[61]],_0x1998x3e[_0xac88[63]]]};break;case _0xac88[67]:_0x1998x3c= MailRoom;_0x1998x3d[_0xac88[130]]= _0x1998x3e[_0xac88[67]];if(_0x1998x20[_0xac88[90]][_0xac88[122]]=== _0xac88[12]){_0x1998x3d[_0xac88[131]]= {$lt:moment()[_0xac88[133]](_0xac88[132])}}else {_0x1998x3d[_0xac88[131]]= {$gte:moment()[_0xac88[133]](_0xac88[132])}};break;case _0xac88[135]:_0x1998x3c= ChatRoom;_0x1998x3d[_0xac88[134]]= _0x1998x3e[_0xac88[67]];if(_0x1998x20[_0xac88[90]][_0xac88[122]]=== _0xac88[12]){_0x1998x3d[_0xac88[131]]= {$lt:moment()[_0xac88[133]](_0xac88[132])}}else {_0x1998x3d[_0xac88[131]]= {$gte:moment()[_0xac88[133]](_0xac88[132])}};break;case _0xac88[65]:_0x1998x3c= FaxRoom;_0x1998x3d[_0xac88[134]]= _0x1998x3e[_0xac88[65]];if(_0x1998x20[_0xac88[90]][_0xac88[122]]=== _0xac88[12]){_0x1998x3d[_0xac88[131]]= {$lt:moment()[_0xac88[133]](_0xac88[132])}}else {_0x1998x3d[_0xac88[131]]= {$gte:moment()[_0xac88[133]](_0xac88[132])}};break;case _0xac88[136]:_0x1998x3c= SmsRoom;_0x1998x3d[_0xac88[134]]= [_0x1998x3e[_0xac88[61]],_0x1998x3e[_0xac88[63]]];if(_0x1998x20[_0xac88[90]][_0xac88[122]]=== _0xac88[12]){_0x1998x3d[_0xac88[131]]= {$lt:moment()[_0xac88[133]](_0xac88[132])}}else {_0x1998x3d[_0xac88[131]]= {$gte:moment()[_0xac88[133]](_0xac88[132])}};break;default:_0x1998x3c= (_0x1998x20[_0xac88[90]][_0xac88[122]]=== _0xac88[12])?ReportCallHistory:ReportCall};break;case _0xac88[138]:switch(_0x1998x20[_0xac88[90]][_0xac88[121]]){case _0xac88[61]:_0x1998x3c= (_0x1998x20[_0xac88[90]][_0xac88[122]]=== _0xac88[12])?ReportQueueHistory:ReportQueue;_0x1998x3d[_0xac88[137]]= [_0x1998x3e[_0xac88[61]],_0x1998x3e[_0xac88[63]]];break;case _0xac88[67]:return _0x1998x21[_0xac88[126]](404);default:_0x1998x3c= (_0x1998x20[_0xac88[90]][_0xac88[122]]=== _0xac88[12])?ReportQueueHistory:ReportQueue};break;default:_0x1998x3c= ReportCall};delete _0x1998x20[_0xac88[90]][_0xac88[119]];delete _0x1998x20[_0xac88[90]][_0xac88[121]];delete _0x1998x20[_0xac88[90]][_0xac88[122]];delete _0x1998x20[_0xac88[90]][_0xac88[124]];return _0x1998x3c[_0xac88[107]](Util[_0xac88[106]](_0x1998x20[_0xac88[90]],_0x1998x3d))})[_0xac88[39]](function(_0x1998x24){_0x1998x21[_0xac88[38]](200)[_0xac88[37]](_0x1998x24)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};exports[_0xac88[121]]= function(_0x1998x20,_0x1998x21){var _0x1998x3f;return Contact[_0xac88[111]](_0xac88[108],_0xac88[113],_0xac88[109])[_0xac88[114]](_0x1998x20[_0xac88[139]][_0xac88[42]])[_0xac88[39]](function(_0x1998x44){if(!_0x1998x44){return _0x1998x21[_0xac88[126]](404)};_0x1998x3f= _0x1998x44;return CustomField[_0xac88[101]]({where:{$or:[{ListId:_0x1998x3f[_0xac88[72]]},{ListId:null}]}})})[_0xac88[39]](function(_0x1998x31){if(_0x1998x31[_0xac88[79]]){var _0x1998x32=_[_0xac88[85]](_0x1998x31,_0xac88[76])[_0xac88[81]](_0xac88[80]);return sequelize[_0xac88[90]](util[_0xac88[92]](_0xac88[141],_0x1998x32,_0x1998x20[_0xac88[139]][_0xac88[42]]),{type:sequelize[_0xac88[94]][_0xac88[93]]})}})[_0xac88[39]](function(_0x1998x40){if(_0x1998x40){_[_0xac88[78]](_0x1998x40[0],function(_0x1998x41,_0x1998x42,_0x1998x43){if(_0x1998x41=== _0xac88[140]){_0x1998x43[_0x1998x42]= null}});_[_0xac88[74]](_0x1998x3f[_0xac88[102]],_0x1998x40[0])}})[_0xac88[39]](function(){return _0x1998x21[_0xac88[38]](200)[_0xac88[37]](_0x1998x3f)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};exports[_0xac88[142]]= function(_0x1998x20,_0x1998x21){var _0x1998x3d={},_0x1998x45;switch(_0x1998x20[_0xac88[144]][_0xac88[148]]){case _0xac88[146]:if(_0x1998x20[_0xac88[144]][_0xac88[143]]=== _0xac88[138]){_0x1998x3d= {$or:{phone:_0x1998x20[_0xac88[144]][_0xac88[137]],mobile:_0x1998x20[_0xac88[144]][_0xac88[137]]}}}else {_0x1998x3d= {$or:{phone:_0x1998x20[_0xac88[144]][_0xac88[145]],mobile:_0x1998x20[_0xac88[144]][_0xac88[145]]}}};break;case _0xac88[147]:_0x1998x3d= {email:_0x1998x20[_0xac88[144]][_0xac88[130]]};break;default:_0x1998x3d= {}};var _0x1998x46=_[_0xac88[85]](_[_0xac88[85]](_0x1998x20[_0xac88[113]].Lists,_0xac88[102]),_0xac88[42]);var _0x1998x47;return List[_0xac88[156]]({where:{defaultEntry:true}})[_0xac88[39]](function(_0x1998x2e){if(_0x1998x2e){_0x1998x46[_0xac88[152]](_0x1998x2e[_0xac88[42]])};if(_0x1998x20[_0xac88[144]][_0xac88[72]]){_0x1998x47= _[_0xac88[97]](_0x1998x46,_0x1998x20[_0xac88[144]].ListId)?{id:_0x1998x20[_0xac88[144]][_0xac88[72]]}:null}else {_0x1998x47= {id:_0x1998x46}};if(_0x1998x47){return Contact[_0xac88[107]]({where:_0x1998x3d,include:[{model:List,where:_0x1998x47}]})};return null})[_0xac88[39]](function(_0x1998x37){if(_0x1998x37&& _0x1998x37[_0xac88[73]][_0xac88[79]]){_0x1998x45= _0x1998x37;return null}else {_0x1998x45= {count:0,rows:[]};if(_0x1998x20[_0xac88[144]][_0xac88[149]]&& _0x1998x20[_0xac88[144]][_0xac88[72]]&& _[_0xac88[97]](_0x1998x46,_0x1998x20[_0xac88[144]].ListId)){var _0x1998x3f={};return Contact[_0xac88[155]]({firstName:_0x1998x20[_0xac88[144]][_0xac88[154]],phone:_0x1998x20[_0xac88[144]][_0xac88[137]],ListId:_0x1998x20[_0xac88[144]][_0xac88[72]]})[_0xac88[39]](function(_0x1998x3e){_0x1998x3f= _0x1998x3e[_0xac88[153]]({plain:true});return List[_0xac88[114]](_0x1998x20[_0xac88[144]].ListId,{raw:true})})[_0xac88[39]](function(_0x1998x2e){_0x1998x3f[_0xac88[19]]= _0x1998x2e;_0x1998x45[_0xac88[73]][_0xac88[152]](_0x1998x3f)})[_0xac88[36]](function(_0x1998x23){logger[_0xac88[151]](_0xac88[150],_0x1998x23)})}}})[_0xac88[39]](function(){return _0x1998x21[_0xac88[38]](200)[_0xac88[37]](_0x1998x45)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};exports[_0xac88[155]]= function(_0x1998x20,_0x1998x21,_0x1998x22){if(!_0x1998x20[_0xac88[144]][_0xac88[43]]||  !_0x1998x20[_0xac88[144]][_0xac88[72]]){return handleError(_0x1998x21,{message:_0xac88[157]})};var _0x1998x3f,_0x1998x48=moment()[_0xac88[92]](_0xac88[158]),_0x1998x49=[],_0x1998x4a=[];_0x1998x20[_0xac88[144]][_0xac88[159]]= _0x1998x20[_0xac88[113]][_0xac88[42]];_0x1998x20[_0xac88[144]][_0xac88[131]]= _0x1998x48;_0x1998x20[_0xac88[144]][_0xac88[160]]= _0x1998x48;_[_0xac88[164]](_0x1998x20[_0xac88[144]],function(_0x1998x41,_0x1998x42){if(_0x1998x41){switch(_0x1998x42){case _0xac88[47]:if(_0x1998x41[_0xac88[79]]){_0x1998x4a[_0xac88[152]](_0xac88[84]+ _0x1998x41[_0xac88[81]](_0xac88[161])+ _0xac88[162]);_0x1998x49[_0xac88[152]](_0x1998x42)};break;default:_0x1998x49[_0xac88[152]](_0x1998x42);_0x1998x4a[_0xac88[152]](_[_0xac88[163]](_0x1998x41)?_0xac88[84]+ _0x1998x41+ _0xac88[84]:_0x1998x41)}}});return sequelize[_0xac88[90]](util[_0xac88[92]](_0xac88[166],_0x1998x49[_0xac88[81]](_0xac88[80]),_0x1998x4a[_0xac88[81]](_0xac88[80])))[_0xac88[39]](function(_0x1998x3e){_0x1998x20[_0xac88[144]][_0xac88[42]]= _0x1998x3e[0][_0xac88[165]];return _0x1998x21[_0xac88[38]](201)[_0xac88[37]](_0x1998x20[_0xac88[144]])})[_0xac88[36]](function(_0x1998x23){return _0x1998x22(_0x1998x23)})};exports[_0xac88[167]]= function(_0x1998x20,_0x1998x21,_0x1998x22){var _0x1998x3f,_0x1998x4b;return Contact[_0xac88[114]](_0x1998x20[_0xac88[139]][_0xac88[42]])[_0xac88[39]](function(_0x1998x3e){_0x1998x3f= _0x1998x3e[_0xac88[102]];_0x1998x4b= _[_0xac88[170]](_0x1998x3e[_0xac88[102]]);delete _0x1998x4b[_0xac88[42]];_0x1998x4b[_0xac88[159]]= _0x1998x20[_0xac88[113]][_0xac88[42]];_0x1998x4b[_0xac88[72]]= _0x1998x20[_0xac88[144]][_0xac88[72]];_0x1998x4b[_0xac88[47]]= _0x1998x4b[_0xac88[47]]?_0x1998x4b[_0xac88[47]][_0xac88[171]](_0xac88[161]):[];if(_0x1998x4b[_0xac88[47]][_0xac88[79]]> 1){_0x1998x4b[_0xac88[47]][_0xac88[172]]()};return Contact[_0xac88[155]](_0x1998x4b)})[_0xac88[39]](function(_0x1998x4c){_0x1998x4b= _0x1998x4c;if(_0x1998x3f[_0xac88[72]]=== _0x1998x20[_0xac88[144]][_0xac88[72]]){return CustomField[_0xac88[101]]({where:{$or:[{ListId:_0x1998x3f[_0xac88[72]]},{ListId:null}]}})}})[_0xac88[39]](function(_0x1998x31){if(_0x1998x31&& _0x1998x31[_0xac88[79]]){var _0x1998x32=_[_0xac88[85]](_0x1998x31,_0xac88[76])[_0xac88[81]](_0xac88[80]);return sequelize[_0xac88[90]](util[_0xac88[92]](_0xac88[141],_0x1998x32,_0x1998x3f[_0xac88[42]]),{type:sequelize[_0xac88[94]][_0xac88[93]]})}})[_0xac88[39]](function(_0x1998x40){if(_0x1998x40){var _0x1998x32=[];_[_0xac88[164]](_0x1998x40[0],function(_0x1998x41,_0x1998x42){_0x1998x32[_0xac88[152]](util[_0xac88[92]](_0xac88[168],_0x1998x42,_0x1998x41))});if(_0x1998x32[_0xac88[79]]){_0x1998x32= _0x1998x32[_0xac88[81]](_0xac88[80]);return sequelize[_0xac88[90]](util[_0xac88[92]](_0xac88[169],_0x1998x32,_0x1998x4b[_0xac88[42]]))}}})[_0xac88[39]](function(){return _0x1998x21[_0xac88[38]](201)[_0xac88[37]](_0x1998x4b)})[_0xac88[36]](function(_0x1998x23){return _0x1998x22(_0x1998x23)})};exports[_0xac88[173]]= function(_0x1998x20,_0x1998x21,_0x1998x22){var _0x1998x45=[],_0x1998x48=moment()[_0xac88[92]](_0xac88[158]),_0x1998x4d=[],_0x1998x49,_0x1998x4a,_0x1998x4e={ok:0,ko:0,failed:[]};return Tag[_0xac88[101]]()[_0xac88[39]](function(_0x1998x4f){var _0x1998x50=[],_0x1998x51=[];var _0x1998x52=_[_0xac88[85]](_[_0xac88[85]](_0x1998x4f,_0xac88[102]),_0xac88[76]);Async[_0xac88[182]](_0x1998x20[_0xac88[144]][_0xac88[175]],function(_0x1998x3e,_0x1998x30){if(_0x1998x3e[_0xac88[43]]&& _0x1998x3e[_0xac88[72]]){_0x1998x3e[_0xac88[159]]= _0x1998x20[_0xac88[113]][_0xac88[42]];_0x1998x3e[_0xac88[131]]= _0x1998x48;_0x1998x3e[_0xac88[160]]= _0x1998x48;_0x1998x3e[_0xac88[47]]&& (_0x1998x51= _[_0xac88[176]](_0x1998x51,_0x1998x3e[_0xac88[47]]));_0x1998x49= [];_0x1998x4a= [];_[_0xac88[164]](_0x1998x3e,function(_0x1998x41,_0x1998x42){if(_0x1998x41){switch(_0x1998x42){case _0xac88[47]:if(_0x1998x41[_0xac88[79]]){_0x1998x4a[_0xac88[152]](_0xac88[84]+ _0x1998x41[_0xac88[81]](_0xac88[161])+ _0xac88[162]);_0x1998x49[_0xac88[152]](_0x1998x42)};break;default:_0x1998x49[_0xac88[152]](_0x1998x42);_0x1998x4a[_0xac88[152]](_[_0xac88[163]](_0x1998x41)?_0xac88[84]+ _0x1998x41+ _0xac88[84]:_0x1998x41)}}});_0x1998x4d[_0xac88[152]](sequelize[_0xac88[90]](util[_0xac88[92]](_0xac88[166],_0x1998x49[_0xac88[81]](_0xac88[80]),_0x1998x4a[_0xac88[81]](_0xac88[80])))[_0xac88[39]](function(_0x1998x4c){_0x1998x3e[_0xac88[42]]= _0x1998x4c[_0xac88[42]];_0x1998x45[_0xac88[152]](_0x1998x3e);_0x1998x4e[_0xac88[181]]++})[_0xac88[36]](function(_0x1998x23){logger[_0xac88[178]](_0x1998x23[_0xac88[177]]);_0x1998x4e[_0xac88[179]]++;_0x1998x4e[_0xac88[180]][_0xac88[152]](_0x1998x30)}))}else {_0x1998x4e[_0xac88[179]]++;_0x1998x4e[_0xac88[180]][_0xac88[152]](_0x1998x30)}});_0x1998x51[_0xac88[79]]&& _[_0xac88[78]](_0x1998x51,function(_0x1998x35){if(!_0x1998x52[_0xac88[79]]||  !_[_0xac88[97]](_0x1998x52,_0x1998x35)){_0x1998x50[_0xac88[152]](Tag[_0xac88[155]]({name:_0x1998x35}))}});return _0x1998x50})[_0xac88[174]]()[_0xac88[39]](function(){return _0x1998x4d})[_0xac88[174]]()[_0xac88[39]](function(){return _0x1998x21[_0xac88[38]](201)[_0xac88[37]](_0x1998x4e)})[_0xac88[36]](function(_0x1998x23){return _0x1998x22(_0x1998x23)})};exports[_0xac88[183]]= function(_0x1998x20,_0x1998x21,_0x1998x22){return Promise[_0xac88[174]]([])[_0xac88[39]](updateContact(_0x1998x20,_0x1998x21))[_0xac88[39]](function(_0x1998x3e){return _0x1998x21[_0xac88[38]](200)[_0xac88[37]](_0x1998x3e)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};exports[_0xac88[74]]= function(_0x1998x20,_0x1998x21,_0x1998x22){var _0x1998x3f;return Promise[_0xac88[174]]([])[_0xac88[39]](updateContact(_0x1998x20,_0x1998x21))[_0xac88[39]](function(_0x1998x3e){_0x1998x3f= _0x1998x3e;if(_0x1998x20[_0xac88[144]][_0xac88[184]]){return Contact[_0xac88[185]]({where:{id:_0x1998x20[_0xac88[144]][_0xac88[184]]},individualHooks:true})}})[_0xac88[39]](function(){return _0x1998x21[_0xac88[38]](200)[_0xac88[37]](_0x1998x3f)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};function updateContact(_0x1998x20,_0x1998x21){return function(){var _0x1998x3f;return Tag[_0xac88[101]]()[_0xac88[39]](function(_0x1998x4f){var _0x1998x50=[];var _0x1998x52=_[_0xac88[85]](_[_0xac88[85]](_0x1998x4f,_0xac88[102]),_0xac88[76]);if(_0x1998x20[_0xac88[144]][_0xac88[47]]){_0x1998x20[_0xac88[144]][_0xac88[47]][_0xac88[78]](function(_0x1998x35){if(!_[_0xac88[97]](_0x1998x52,_0x1998x35)){_0x1998x50[_0xac88[152]](Tag[_0xac88[155]]({name:_0x1998x35}))}})};return _0x1998x50})[_0xac88[39]](function(){return Contact[_0xac88[114]](_0x1998x20[_0xac88[139]][_0xac88[42]])})[_0xac88[39]](function(_0x1998x3e){if(!_0x1998x3e){return _0x1998x21[_0xac88[126]](404)};delete _0x1998x20[_0xac88[144]][_0xac88[42]];return _0x1998x3e[_0xac88[188]](_0x1998x20[_0xac88[144]])})[_0xac88[39]](function(_0x1998x3e){_0x1998x3f= _0x1998x3e;return CustomField[_0xac88[101]]({where:{$or:[{ListId:_0x1998x3f[_0xac88[72]]},{ListId:null}]}})})[_0xac88[39]](function(_0x1998x31){if(_0x1998x31[_0xac88[79]]){var _0x1998x32=[];_0x1998x31[_0xac88[78]](function(_0x1998x35){if(_0x1998x20[_0xac88[144]][_0xac88[187]](_0x1998x35[_0xac88[76]])){_0x1998x32[_0xac88[152]](util[_0xac88[92]](_0xac88[168],_0x1998x35[_0xac88[76]],_0x1998x20[_0xac88[144]][_0x1998x35[_0xac88[76]]]))}});if(_0x1998x32[_0xac88[79]]){_0x1998x32= _0x1998x32[_0xac88[81]](_0xac88[80]);return sequelize[_0xac88[90]](util[_0xac88[92]](_0xac88[169],_0x1998x32,_0x1998x3f[_0xac88[42]]))}}})[_0xac88[39]](function(){return TdUpdate[_0xac88[155]]({action:_0xac88[186],listId:_0x1998x3f[_0xac88[72]],contactId:_0x1998x3f[_0xac88[42]]})})[_0xac88[39]](function(){return _0x1998x3f})}}exports[_0xac88[185]]= function(_0x1998x20,_0x1998x21){return Contact[_0xac88[114]](_0x1998x20[_0xac88[139]][_0xac88[42]])[_0xac88[39]](function(_0x1998x44){if(!_0x1998x44){return _0x1998x21[_0xac88[126]](404)};return _0x1998x44[_0xac88[185]]()})[_0xac88[39]](function(_0x1998x3e){return TdUpdate[_0xac88[155]]({action:_0xac88[189],listId:_0x1998x3e[_0xac88[72]],contactId:_0x1998x3e[_0xac88[42]]})})[_0xac88[39]](function(){return _0x1998x21[_0xac88[126]](204)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};exports[_0xac88[190]]= function(_0x1998x20,_0x1998x21){return Contact[_0xac88[101]]({where:{id:_0x1998x20[_0xac88[90]][_0xac88[191]]}})[_0xac88[39]](function(_0x1998x37){var _0x1998x54=[];if(_0x1998x37&& _0x1998x37[_0xac88[79]]){_[_0xac88[78]](_0x1998x37,function(_0x1998x3e){_0x1998x54[_0xac88[152]](_0x1998x3e[_0xac88[185]]());_0x1998x54[_0xac88[152]](TdUpdate[_0xac88[155]]({action:_0xac88[189],listId:_0x1998x3e[_0xac88[72]],contactId:_0x1998x3e[_0xac88[42]]}))})};return _0x1998x54})[_0xac88[174]]()[_0xac88[39]](function(){return _0x1998x21[_0xac88[126]](204)})[_0xac88[36]](function(_0x1998x23){return handleError(_0x1998x21,_0x1998x23)})};function handleError(_0x1998x21,_0x1998x23){logger[_0xac88[151]](_0x1998x23[_0xac88[177]]);return _0x1998x21[_0xac88[38]](500)[_0xac88[37]](_0x1998x23)}
\ No newline at end of file
+var _0x2958=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74\x50\x68\x6F\x6E\x65","\x43\x6F\x6E\x74\x61\x63\x74\x45\x6D\x61\x69\x6C","\x43\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x48\x69\x73\x74\x6F\x72\x79","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x6D\x73\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x4C\x69\x73\x74","\x43\x6F\x6D\x70\x61\x6E\x79","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C\x48\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x54\x61\x67","\x54\x64\x55\x70\x64\x61\x74\x65","\x73\x74\x72\x65\x61\x6D","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x61\x73\x79\x6E\x63","\x62\x6C\x75\x65\x62\x69\x72\x64","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\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","\x72\x65\x73\x6F\x6C\x76\x65","\x65\x78\x74\x72\x61\x63\x74\x41\x6C\x6C","\x69\x64","\x66\x69\x72\x73\x74\x4E\x61\x6D\x65","\x46\x69\x72\x73\x74\x20\x4E\x61\x6D\x65","\x6C\x61\x73\x74\x4E\x61\x6D\x65","\x4C\x61\x73\x74\x20\x4E\x61\x6D\x65","\x74\x61\x67\x73","\x54\x61\x67\x73","\x73\x74\x72\x65\x65\x74","\x53\x74\x72\x65\x65\x74","\x70\x6F\x73\x74\x61\x6C\x43\x6F\x64\x65","\x50\x6F\x73\x74\x61\x6C\x20\x43\x6F\x64\x65","\x63\x69\x74\x79","\x43\x69\x74\x79","\x63\x6F\x75\x6E\x74\x72\x79","\x43\x6F\x75\x6E\x74\x72\x79","\x64\x61\x74\x65\x4F\x66\x42\x69\x72\x74\x68","\x44\x61\x74\x65\x20\x6F\x66\x20\x62\x69\x72\x74\x68","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x70\x68\x6F\x6E\x65","\x50\x68\x6F\x6E\x65","\x6D\x6F\x62\x69\x6C\x65","\x4D\x6F\x62\x69\x6C\x65","\x66\x61\x78","\x46\x61\x78","\x65\x6D\x61\x69\x6C","\x45\x6D\x61\x69\x6C","\x75\x72\x6C","\x55\x52\x4C","\x43\x6F\x6D\x70\x61\x6E\x79\x49\x64","\x4C\x69\x73\x74\x49\x64","\x72\x6F\x77\x73","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64","\x6E\x61\x6D\x65","","\x66\x6F\x72\x45\x61\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x2C","\x6A\x6F\x69\x6E","\x20\x61\x73\x20\x27","\x61\x6C\x69\x61\x73","\x27","\x6D\x61\x70","\x53\x45\x4C\x45\x43\x54\x20\x69\x64\x2C\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x20\x49\x4E\x20\x28\x27","\x27\x2C\x27","\x27\x29\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20\x25\x73","\x6F\x72\x64\x65\x72","\x71\x75\x65\x72\x79","\x69\x64\x20\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x6B\x65\x79\x73","\x63\x66\x5F","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x66\x69\x6C\x74\x65\x72","\x24\x6F\x72","\x77\x68\x65\x72\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x64\x65\x73\x63\x72\x69\x62\x65","\x63\x6F\x6E\x63\x61\x74","\x6D\x65\x72\x67\x65\x63\x6F\x6E\x74\x61\x63\x74","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x6C\x69\x73\x74","\x63\x6F\x6D\x70\x61\x6E\x79","\x63\x6F\x6D\x70\x61\x6E\x79\x5F\x6C\x69\x73\x74\x5F\x66\x69\x6C\x74\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x4C\x69\x73\x74\x73","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x67\x65\x6E\x74","\x63\x6F\x75\x6E\x74","\x72\x6F\x6C\x65","\x67\x65\x74\x4C\x6F\x67","\x64\x65\x74\x61\x69\x6C","\x67\x65\x6E\x65\x72\x61\x6C","\x73\x68\x6F\x77","\x6C\x6F\x67\x54\x79\x70\x65","\x6A\x6F\x75\x72\x6E\x61\x6C","\x74\x79\x70\x65","\x69\x6E\x62\x6F\x75\x6E\x64","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x65\x73\x74\x69\x6E\x61\x74\x69\x6F\x6E","\x73\x6F\x75\x72\x63\x65","\x66\x72\x6F\x6D","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x6E\x74\x61\x63\x74","\x63\x68\x61\x74","\x73\x6D\x73","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x71\x75\x65\x75\x65","\x70\x61\x72\x61\x6D\x73","\x6E\x75\x6C\x6C","\x53\x45\x4C\x45\x43\x54\x20\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x67\x65\x74\x43\x6F\x6E\x74\x61\x63\x74\x73","\x73\x75\x62\x74\x79\x70\x65\x43\x68\x61\x6E\x6E\x65\x6C","\x62\x6F\x64\x79","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x76\x6F\x69\x63\x65","\x6D\x61\x69\x6C","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x63\x72\x65\x61\x74\x65\x43\x6F\x6E\x74\x61\x63\x74","\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x63\x6F\x6E\x74\x61\x63\x74\x20\x61\x75\x74\x6F\x20\x63\x72\x65\x61\x74\x69\x6F\x6E","\x65\x72\x72\x6F\x72","\x70\x75\x73\x68","\x67\x65\x74","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x4E\x61\x6D\x65\x20\x6F\x72\x20\x4C\x69\x73\x74\x49\x64\x20\x6D\x69\x73\x73\x69\x6E\x67\x20\x6F\x72\x20\x69\x6E\x76\x61\x6C\x69\x64\x21","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x55\x73\x65\x72\x49\x64","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x3B","\x3B\x27","\x69\x73\x53\x74\x72\x69\x6E\x67","\x66\x6F\x72\x4F\x77\x6E","\x69\x6E\x73\x65\x72\x74\x49\x64","\x49\x4E\x53\x45\x52\x54\x20\x49\x4E\x54\x4F\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x28\x25\x73\x29\x20\x56\x41\x4C\x55\x45\x53\x20\x28\x25\x73\x29","\x63\x6F\x70\x79","\x25\x73\x3D\x27\x25\x73\x27","\x55\x50\x44\x41\x54\x45\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x53\x45\x54\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x63\x6C\x6F\x6E\x65","\x73\x70\x6C\x69\x74","\x70\x6F\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x61\x6C\x6C","\x63\x6F\x6E\x74\x61\x63\x74\x73","\x75\x6E\x69\x6F\x6E","\x73\x74\x61\x63\x6B","\x64\x65\x62\x75\x67","\x6B\x6F","\x66\x61\x69\x6C\x65\x64","\x6F\x6B","\x66\x6F\x72\x45\x61\x63\x68\x4F\x66","\x75\x70\x64\x61\x74\x65","\x6F\x6C\x64\x43\x6F\x6E\x74\x61\x63\x74","\x64\x65\x73\x74\x72\x6F\x79","\x63\x6F\x6E\x74\x61\x63\x74\x2F\x75\x70\x64\x61\x74\x65","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x63\x6F\x6E\x74\x61\x63\x74\x2F\x64\x65\x6C\x65\x74\x65","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0x2958[0];var _=require(_0x2958[1]);var moment=require(_0x2958[2]);var Contact=require(_0x2958[4])[_0x2958[3]];var User=require(_0x2958[4])[_0x2958[5]];var ContactPhone=require(_0x2958[4])[_0x2958[6]];var ContactEmail=require(_0x2958[4])[_0x2958[7]];var CustomField=require(_0x2958[4])[_0x2958[8]];var ReportCall=require(_0x2958[4])[_0x2958[9]];var ReportQueue=require(_0x2958[4])[_0x2958[10]];var ReportQueueHistory=require(_0x2958[4])[_0x2958[12]][_0x2958[11]];var ReportChatRoom=require(_0x2958[4])[_0x2958[13]];var ReportChatRoomHistory=require(_0x2958[4])[_0x2958[12]][_0x2958[14]];var ChatRoom=require(_0x2958[4])[_0x2958[15]];var FaxRoom=require(_0x2958[4])[_0x2958[16]];var SmsRoom=require(_0x2958[4])[_0x2958[17]];var ReportIntegration=require(_0x2958[4])[_0x2958[18]];var List=require(_0x2958[4])[_0x2958[19]];var Company=require(_0x2958[4])[_0x2958[20]];var ReportCallHistory=require(_0x2958[4])[_0x2958[12]][_0x2958[21]];var ReportMailSession=require(_0x2958[4])[_0x2958[22]];var MailRoom=require(_0x2958[4])[_0x2958[23]];var ReportMailSessionHistory=require(_0x2958[4])[_0x2958[12]][_0x2958[24]];var Tag=require(_0x2958[4])[_0x2958[25]];var TdUpdate=require(_0x2958[4])[_0x2958[26]];var stream=require(_0x2958[27]);var sequelize=require(_0x2958[4])[_0x2958[28]];var util=require(_0x2958[29]);var Util=require(_0x2958[30]);var Async=require(_0x2958[31]);var Promise=require(_0x2958[32]);var logger=require(_0x2958[34])(_0x2958[33]);exports[_0x2958[35]]= function(_0xeeefx20,_0xeeefx21,_0xeeefx22){return Promise[_0x2958[40]]()[_0x2958[39]](getContacts(_0xeeefx20))[_0x2958[39]](function(_0xeeefx24){_0xeeefx21[_0x2958[38]](200)[_0x2958[37]](_0xeeefx24)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};exports[_0x2958[41]]= function(_0xeeefx20,_0xeeefx21,_0xeeefx22){var _0xeeefx25=[_0x2958[42],[_0x2958[43],_0x2958[44]],[_0x2958[45],_0x2958[46]],[_0x2958[47],_0x2958[48]],[_0x2958[49],_0x2958[50]],[_0x2958[51],_0x2958[52]],[_0x2958[53],_0x2958[54]],[_0x2958[55],_0x2958[56]],[_0x2958[57],_0x2958[58]],[_0x2958[59],_0x2958[60]],[_0x2958[61],_0x2958[62]],[_0x2958[63],_0x2958[64]],[_0x2958[65],_0x2958[66]],[_0x2958[67],_0x2958[68]],[_0x2958[69],_0x2958[70]],_0x2958[71],_0x2958[72]];return Promise[_0x2958[40]]()[_0x2958[39]](getContacts(_0xeeefx20,_0xeeefx25))[_0x2958[39]](function(_0xeeefx24){_0xeeefx21[_0x2958[38]](200)[_0x2958[37]](_0xeeefx24)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};function getContacts(_0xeeefx20,_0xeeefx25){return function(){var _0xeeefx27,_0xeeefx28,_0xeeefx29,_0xeeefx2a=[],_0xeeefx2b=[];switch(_0xeeefx20[_0x2958[113]][_0x2958[117]]){case _0x2958[115]:return User[_0x2958[114]](_0xeeefx20[_0x2958[113]][_0x2958[42]])[_0x2958[39]](function(_0xeeefx3b){return _0xeeefx3b[_0x2958[112]]()})[_0x2958[39]](function(_0xeeefx2b){_0xeeefx28= _[_0x2958[85]](_0xeeefx2b,_0x2958[42]);return Company[_0x2958[101]]({attributes:[_0x2958[42],_0x2958[76]],raw:true})})[_0x2958[39]](function(_0xeeefx3a){_0xeeefx2a= _0xeeefx3a;return List[_0x2958[101]]({attributes:[_0x2958[42],_0x2958[76]],raw:true})})[_0x2958[39]](function(_0xeeefx38){_0xeeefx2b= _0xeeefx38;_0xeeefx29= {CompanyId:_0xeeefx20[_0x2958[90]][_0x2958[71]]|| null,ListId:_0xeeefx20[_0x2958[90]][_0x2958[72]]|| null};delete _0xeeefx20[_0x2958[90]][_0x2958[71]];delete _0xeeefx20[_0x2958[90]][_0x2958[72]];var _0xeeefx39=_0xeeefx29[_0x2958[72]]?{}:{ListId:{$in:_0xeeefx28[_0x2958[104]](_[_0x2958[85]](_[_0x2958[98]](_0xeeefx2b,{defaultEntry:true}),_0x2958[42]))}};if(_0xeeefx20[_0x2958[90]][_0x2958[105]]){_0xeeefx39[_0x2958[42]]= {$ne:_0xeeefx20[_0x2958[90]][_0x2958[105]]};delete _0xeeefx20[_0x2958[90]][_0x2958[105]]};return Contact[_0x2958[111]](_0x2958[108],_0x2958[109],{method:[_0x2958[110],_0xeeefx29]})[_0x2958[107]](Util[_0x2958[106]](_0xeeefx20[_0x2958[90]],_0xeeefx39,{attributes:_0xeeefx25,order:_0xeeefx20[_0x2958[90]][_0x2958[89]]|| _0x2958[91]}))})[_0x2958[39]](function(_0xeeefx37){_0xeeefx27= {rows:_[_0x2958[85]](_0xeeefx37[_0x2958[73]],_0x2958[102]),count:_0xeeefx37[_0x2958[73]]};return Contact[_0x2958[103]]()})[_0x2958[39]](function(_0xeeefx34){_0xeeefx34= _[_0x2958[98]](_[_0x2958[95]](_0xeeefx34),function(_0xeeefx35){return _[_0x2958[97]](_0xeeefx35,_0x2958[96])});var _0xeeefx36={where:{name:_0xeeefx34}};_0xeeefx29[_0x2958[72]]&& (_0xeeefx36[_0x2958[100]][_0x2958[99]]= [{ListId:_0xeeefx29[_0x2958[72]]},{ListId:null}]);return CustomField[_0x2958[101]](_0xeeefx36)})[_0x2958[39]](function(_0xeeefx31){if(_0xeeefx31[_0x2958[79]]){var _0xeeefx32=_[_0x2958[85]](_0xeeefx31,function(_0xeeefx33){return _0xeeefx33[_0x2958[76]]+ _0x2958[82]+ _0xeeefx33[_0x2958[83]]+ _0x2958[84]})[_0x2958[81]](_0x2958[80]);return sequelize[_0x2958[90]](util[_0x2958[92]](_0x2958[86]+ _[_0x2958[85]](_0xeeefx27[_0x2958[73]],_0x2958[42])[_0x2958[81]](_0x2958[87])+ _0x2958[88],_0xeeefx32,_0xeeefx20[_0x2958[90]][_0x2958[89]]|| _0x2958[91]),{type:sequelize[_0x2958[94]][_0x2958[93]]})}})[_0x2958[39]](function(_0xeeefx2c){var _0xeeefx2d,_0xeeefx2e;_[_0x2958[78]](_0xeeefx27[_0x2958[73]],function(_0xeeefx2f,_0xeeefx30){_0xeeefx2c&& _[_0x2958[74]](_0xeeefx2f,_0xeeefx2c[_0xeeefx30]);_0xeeefx2d= _[_0x2958[75]](_0xeeefx2a,{id:_0xeeefx2f[_0x2958[71]]});_0xeeefx2f[_0x2958[20]]= _0xeeefx2d?_0xeeefx2d[_0x2958[76]]:_0x2958[77];_0xeeefx2e= _[_0x2958[75]](_0xeeefx2b,{id:_0xeeefx2f[_0x2958[72]]});_0xeeefx2f[_0x2958[19]]= _0xeeefx2e?_0xeeefx2e[_0x2958[76]]:_0x2958[77];if(_0xeeefx25){delete _0xeeefx2f[_0x2958[42]];delete _0xeeefx2f[_0x2958[71]];delete _0xeeefx2f[_0x2958[72]]}});return _0xeeefx27});default:_0xeeefx29= {CompanyId:_0xeeefx20[_0x2958[90]][_0x2958[71]]|| null,ListId:_0xeeefx20[_0x2958[90]][_0x2958[72]]|| null};delete _0xeeefx20[_0x2958[90]][_0x2958[71]];delete _0xeeefx20[_0x2958[90]][_0x2958[72]];var _0xeeefx39={};if(_0xeeefx20[_0x2958[90]][_0x2958[105]]){_0xeeefx39[_0x2958[42]]= {$ne:_0xeeefx20[_0x2958[90]][_0x2958[105]]};delete _0xeeefx20[_0x2958[90]][_0x2958[105]]};return Company[_0x2958[101]]({attributes:[_0x2958[42],_0x2958[76]],raw:true})[_0x2958[39]](function(_0xeeefx3a){_0xeeefx2a= _0xeeefx3a;return List[_0x2958[101]]({attributes:[_0x2958[42],_0x2958[76]],raw:true})})[_0x2958[39]](function(_0xeeefx38){_0xeeefx2b= _0xeeefx38;return Contact[_0x2958[111]]({method:[_0x2958[110],_0xeeefx29]})[_0x2958[107]](Util[_0x2958[106]](_0xeeefx20[_0x2958[90]],_0xeeefx39,{attributes:_0xeeefx25,order:_0xeeefx20[_0x2958[90]][_0x2958[89]]|| _0x2958[91]}))})[_0x2958[39]](function(_0xeeefx37){_0xeeefx27= {rows:_[_0x2958[85]](_0xeeefx37[_0x2958[73]],_0x2958[102]),count:_0xeeefx37[_0x2958[116]]};return Contact[_0x2958[103]]()})[_0x2958[39]](function(_0xeeefx34){_0xeeefx34= _[_0x2958[98]](_[_0x2958[95]](_0xeeefx34),function(_0xeeefx35){return _[_0x2958[97]](_0xeeefx35,_0x2958[96])});var _0xeeefx36={where:{name:_0xeeefx34}};_0xeeefx29[_0x2958[72]]&& (_0xeeefx36[_0x2958[100]][_0x2958[99]]= [{ListId:_0xeeefx29[_0x2958[72]]},{ListId:null}]);return CustomField[_0x2958[101]](_0xeeefx36)})[_0x2958[39]](function(_0xeeefx31){if(_0xeeefx27[_0x2958[73]][_0x2958[79]]&& _0xeeefx31[_0x2958[79]]){var _0xeeefx32=_[_0x2958[85]](_0xeeefx31,function(_0xeeefx33){return _0xeeefx33[_0x2958[76]]+ _0x2958[82]+ _0xeeefx33[_0x2958[83]]+ _0x2958[84]})[_0x2958[81]](_0x2958[80]);return sequelize[_0x2958[90]](util[_0x2958[92]](_0x2958[86]+ _[_0x2958[85]](_0xeeefx27[_0x2958[73]],_0x2958[42])[_0x2958[81]](_0x2958[87])+ _0x2958[88],_0xeeefx32,_0xeeefx20[_0x2958[90]][_0x2958[89]]|| _0x2958[91]),{type:sequelize[_0x2958[94]][_0x2958[93]]})}})[_0x2958[39]](function(_0xeeefx2c){var _0xeeefx2d,_0xeeefx2e;_[_0x2958[78]](_0xeeefx27[_0x2958[73]],function(_0xeeefx2f,_0xeeefx30){_0xeeefx2c&& _[_0x2958[74]](_0xeeefx2f,_0xeeefx2c[_0xeeefx30]);_0xeeefx2d= _[_0x2958[75]](_0xeeefx2a,{id:_0xeeefx2f[_0x2958[71]]});_0xeeefx2f[_0x2958[20]]= _0xeeefx2d?_0xeeefx2d[_0x2958[76]]:_0x2958[77];_0xeeefx2e= _[_0x2958[75]](_0xeeefx2b,{id:_0xeeefx2f[_0x2958[72]]});_0xeeefx2f[_0x2958[19]]= _0xeeefx2e?_0xeeefx2e[_0x2958[76]]:_0x2958[77];if(_0xeeefx25){delete _0xeeefx2f[_0x2958[42]];delete _0xeeefx2f[_0x2958[71]];delete _0xeeefx2f[_0x2958[72]]}});return _0xeeefx27})}}}exports[_0x2958[103]]= function(_0xeeefx20,_0xeeefx21){return Contact[_0x2958[103]]()[_0x2958[39]](function(_0xeeefx34){return _0xeeefx21[_0x2958[38]](200)[_0x2958[37]](_0xeeefx34)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};exports[_0x2958[118]]= function(_0xeeefx20,_0xeeefx21,_0xeeefx22){_0xeeefx20[_0x2958[90]][_0x2958[119]]= _0xeeefx20[_0x2958[90]][_0x2958[119]]|| _0x2958[120];_0xeeefx20[_0x2958[90]][_0x2958[121]]= _0xeeefx20[_0x2958[90]][_0x2958[121]]|| _0x2958[61];_0xeeefx20[_0x2958[90]][_0x2958[122]]= _0xeeefx20[_0x2958[90]][_0x2958[122]]|| _0x2958[123];_0xeeefx20[_0x2958[90]][_0x2958[124]]= _0xeeefx20[_0x2958[90]][_0x2958[124]]|| _0x2958[125];var _0xeeefx3c,_0xeeefx3d={};return Contact[_0x2958[114]](_0xeeefx20[_0x2958[139]][_0x2958[42]])[_0x2958[39]](function(_0xeeefx3e){if(!_0xeeefx3e){return _0xeeefx21[_0x2958[126]](404)};switch(_0xeeefx20[_0x2958[90]][_0x2958[119]]){case _0x2958[120]:switch(_0xeeefx20[_0x2958[90]][_0x2958[121]]){case _0x2958[61]:_0xeeefx3c= (_0xeeefx20[_0x2958[90]][_0x2958[122]]=== _0x2958[12])?ReportCallHistory:ReportCall;if(_0xeeefx20[_0x2958[90]][_0x2958[124]]=== _0x2958[127]){_0xeeefx3d[_0x2958[128]]= [_0xeeefx3e[_0x2958[61]],_0xeeefx3e[_0x2958[63]]]}else {_0xeeefx3d[_0x2958[129]]= [_0xeeefx3e[_0x2958[61]],_0xeeefx3e[_0x2958[63]]]};break;case _0x2958[67]:_0xeeefx3c= MailRoom;_0xeeefx3d[_0x2958[130]]= _0xeeefx3e[_0x2958[67]];if(_0xeeefx20[_0x2958[90]][_0x2958[122]]=== _0x2958[12]){_0xeeefx3d[_0x2958[131]]= {$lt:moment()[_0x2958[133]](_0x2958[132])}}else {_0xeeefx3d[_0x2958[131]]= {$gte:moment()[_0x2958[133]](_0x2958[132])}};break;case _0x2958[135]:_0xeeefx3c= ChatRoom;_0xeeefx3d[_0x2958[134]]= _0xeeefx3e[_0x2958[67]];if(_0xeeefx20[_0x2958[90]][_0x2958[122]]=== _0x2958[12]){_0xeeefx3d[_0x2958[131]]= {$lt:moment()[_0x2958[133]](_0x2958[132])}}else {_0xeeefx3d[_0x2958[131]]= {$gte:moment()[_0x2958[133]](_0x2958[132])}};break;case _0x2958[65]:_0xeeefx3c= FaxRoom;_0xeeefx3d[_0x2958[134]]= _0xeeefx3e[_0x2958[65]];if(_0xeeefx20[_0x2958[90]][_0x2958[122]]=== _0x2958[12]){_0xeeefx3d[_0x2958[131]]= {$lt:moment()[_0x2958[133]](_0x2958[132])}}else {_0xeeefx3d[_0x2958[131]]= {$gte:moment()[_0x2958[133]](_0x2958[132])}};break;case _0x2958[136]:_0xeeefx3c= SmsRoom;_0xeeefx3d[_0x2958[134]]= [_0xeeefx3e[_0x2958[61]],_0xeeefx3e[_0x2958[63]]];if(_0xeeefx20[_0x2958[90]][_0x2958[122]]=== _0x2958[12]){_0xeeefx3d[_0x2958[131]]= {$lt:moment()[_0x2958[133]](_0x2958[132])}}else {_0xeeefx3d[_0x2958[131]]= {$gte:moment()[_0x2958[133]](_0x2958[132])}};break;default:_0xeeefx3c= (_0xeeefx20[_0x2958[90]][_0x2958[122]]=== _0x2958[12])?ReportCallHistory:ReportCall};break;case _0x2958[138]:switch(_0xeeefx20[_0x2958[90]][_0x2958[121]]){case _0x2958[61]:_0xeeefx3c= (_0xeeefx20[_0x2958[90]][_0x2958[122]]=== _0x2958[12])?ReportQueueHistory:ReportQueue;_0xeeefx3d[_0x2958[137]]= [_0xeeefx3e[_0x2958[61]],_0xeeefx3e[_0x2958[63]]];break;case _0x2958[67]:return _0xeeefx21[_0x2958[126]](404);default:_0xeeefx3c= (_0xeeefx20[_0x2958[90]][_0x2958[122]]=== _0x2958[12])?ReportQueueHistory:ReportQueue};break;default:_0xeeefx3c= ReportCall};delete _0xeeefx20[_0x2958[90]][_0x2958[119]];delete _0xeeefx20[_0x2958[90]][_0x2958[121]];delete _0xeeefx20[_0x2958[90]][_0x2958[122]];delete _0xeeefx20[_0x2958[90]][_0x2958[124]];return _0xeeefx3c[_0x2958[107]](Util[_0x2958[106]](_0xeeefx20[_0x2958[90]],_0xeeefx3d))})[_0x2958[39]](function(_0xeeefx24){_0xeeefx21[_0x2958[38]](200)[_0x2958[37]](_0xeeefx24)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};exports[_0x2958[121]]= function(_0xeeefx20,_0xeeefx21){var _0xeeefx3f;return Contact[_0x2958[111]](_0x2958[108],_0x2958[113],_0x2958[109])[_0x2958[114]](_0xeeefx20[_0x2958[139]][_0x2958[42]])[_0x2958[39]](function(_0xeeefx44){if(!_0xeeefx44){return _0xeeefx21[_0x2958[126]](404)};_0xeeefx3f= _0xeeefx44;return CustomField[_0x2958[101]]({where:{$or:[{ListId:_0xeeefx3f[_0x2958[72]]},{ListId:null}]}})})[_0x2958[39]](function(_0xeeefx31){if(_0xeeefx31[_0x2958[79]]){var _0xeeefx32=_[_0x2958[85]](_0xeeefx31,_0x2958[76])[_0x2958[81]](_0x2958[80]);return sequelize[_0x2958[90]](util[_0x2958[92]](_0x2958[141],_0xeeefx32,_0xeeefx20[_0x2958[139]][_0x2958[42]]),{type:sequelize[_0x2958[94]][_0x2958[93]]})}})[_0x2958[39]](function(_0xeeefx40){if(_0xeeefx40){_[_0x2958[78]](_0xeeefx40[0],function(_0xeeefx41,_0xeeefx42,_0xeeefx43){if(_0xeeefx41=== _0x2958[140]){_0xeeefx43[_0xeeefx42]= null}});_[_0x2958[74]](_0xeeefx3f[_0x2958[102]],_0xeeefx40[0])}})[_0x2958[39]](function(){return _0xeeefx21[_0x2958[38]](200)[_0x2958[37]](_0xeeefx3f)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};exports[_0x2958[142]]= function(_0xeeefx20,_0xeeefx21){var _0xeeefx3d={},_0xeeefx45;switch(_0xeeefx20[_0x2958[144]][_0x2958[148]]){case _0x2958[146]:if(_0xeeefx20[_0x2958[144]][_0x2958[143]]=== _0x2958[138]){_0xeeefx3d= {$or:{phone:_0xeeefx20[_0x2958[144]][_0x2958[137]],mobile:_0xeeefx20[_0x2958[144]][_0x2958[137]]}}}else {_0xeeefx3d= {$or:{phone:_0xeeefx20[_0x2958[144]][_0x2958[145]],mobile:_0xeeefx20[_0x2958[144]][_0x2958[145]]}}};break;case _0x2958[147]:_0xeeefx3d= {email:_0xeeefx20[_0x2958[144]][_0x2958[130]]};break;default:_0xeeefx3d= {}};var _0xeeefx46=_[_0x2958[85]](_[_0x2958[85]](_0xeeefx20[_0x2958[113]].Lists,_0x2958[102]),_0x2958[42]);var _0xeeefx47;return List[_0x2958[156]]({where:{defaultEntry:true}})[_0x2958[39]](function(_0xeeefx2e){if(_0xeeefx2e){_0xeeefx46[_0x2958[152]](_0xeeefx2e[_0x2958[42]])};if(_0xeeefx20[_0x2958[144]][_0x2958[72]]){_0xeeefx47= _[_0x2958[97]](_0xeeefx46,_0xeeefx20[_0x2958[144]].ListId)?{id:_0xeeefx20[_0x2958[144]][_0x2958[72]]}:null}else {_0xeeefx47= {id:_0xeeefx46}};if(_0xeeefx47){return Contact[_0x2958[107]]({where:_0xeeefx3d,include:[{model:List,where:_0xeeefx47}]})};return null})[_0x2958[39]](function(_0xeeefx37){if(_0xeeefx37&& _0xeeefx37[_0x2958[73]][_0x2958[79]]){_0xeeefx45= _0xeeefx37;return null}else {_0xeeefx45= {count:0,rows:[]};if(_0xeeefx20[_0x2958[144]][_0x2958[149]]&& _0xeeefx20[_0x2958[144]][_0x2958[72]]&& _[_0x2958[97]](_0xeeefx46,_0xeeefx20[_0x2958[144]].ListId)){var _0xeeefx3f={};return Contact[_0x2958[155]]({firstName:_0xeeefx20[_0x2958[144]][_0x2958[154]],phone:_0xeeefx20[_0x2958[144]][_0x2958[137]],ListId:_0xeeefx20[_0x2958[144]][_0x2958[72]]})[_0x2958[39]](function(_0xeeefx3e){_0xeeefx3f= _0xeeefx3e[_0x2958[153]]({plain:true});return List[_0x2958[114]](_0xeeefx20[_0x2958[144]].ListId,{raw:true})})[_0x2958[39]](function(_0xeeefx2e){_0xeeefx3f[_0x2958[19]]= _0xeeefx2e;_0xeeefx45[_0x2958[73]][_0x2958[152]](_0xeeefx3f)})[_0x2958[36]](function(_0xeeefx23){logger[_0x2958[151]](_0x2958[150],_0xeeefx23)})}}})[_0x2958[39]](function(){return _0xeeefx21[_0x2958[38]](200)[_0x2958[37]](_0xeeefx45)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};exports[_0x2958[155]]= function(_0xeeefx20,_0xeeefx21,_0xeeefx22){if(!_0xeeefx20[_0x2958[144]][_0x2958[43]]||  !_0xeeefx20[_0x2958[144]][_0x2958[72]]){return handleError(_0xeeefx21,{message:_0x2958[157]})};var _0xeeefx3f,_0xeeefx48=moment()[_0x2958[92]](_0x2958[158]),_0xeeefx49=[],_0xeeefx4a=[];_0xeeefx20[_0x2958[144]][_0x2958[159]]= _0xeeefx20[_0x2958[113]][_0x2958[42]];_0xeeefx20[_0x2958[144]][_0x2958[131]]= _0xeeefx48;_0xeeefx20[_0x2958[144]][_0x2958[160]]= _0xeeefx48;_[_0x2958[164]](_0xeeefx20[_0x2958[144]],function(_0xeeefx41,_0xeeefx42){if(_0xeeefx41){switch(_0xeeefx42){case _0x2958[47]:if(_0xeeefx41[_0x2958[79]]){_0xeeefx4a[_0x2958[152]](_0x2958[84]+ _0xeeefx41[_0x2958[81]](_0x2958[161])+ _0x2958[162]);_0xeeefx49[_0x2958[152]](_0xeeefx42)};break;default:_0xeeefx49[_0x2958[152]](_0xeeefx42);_0xeeefx4a[_0x2958[152]](_[_0x2958[163]](_0xeeefx41)?_0x2958[84]+ _0xeeefx41+ _0x2958[84]:_0xeeefx41)}}});return sequelize[_0x2958[90]](util[_0x2958[92]](_0x2958[166],_0xeeefx49[_0x2958[81]](_0x2958[80]),_0xeeefx4a[_0x2958[81]](_0x2958[80])))[_0x2958[39]](function(_0xeeefx3e){_0xeeefx20[_0x2958[144]][_0x2958[42]]= _0xeeefx3e[0][_0x2958[165]];return _0xeeefx21[_0x2958[38]](201)[_0x2958[37]](_0xeeefx20[_0x2958[144]])})[_0x2958[36]](function(_0xeeefx23){return _0xeeefx22(_0xeeefx23)})};exports[_0x2958[167]]= function(_0xeeefx20,_0xeeefx21,_0xeeefx22){var _0xeeefx3f,_0xeeefx4b;return Contact[_0x2958[114]](_0xeeefx20[_0x2958[139]][_0x2958[42]])[_0x2958[39]](function(_0xeeefx3e){_0xeeefx3f= _0xeeefx3e[_0x2958[102]];_0xeeefx4b= _[_0x2958[170]](_0xeeefx3e[_0x2958[102]]);delete _0xeeefx4b[_0x2958[42]];_0xeeefx4b[_0x2958[159]]= _0xeeefx20[_0x2958[113]][_0x2958[42]];_0xeeefx4b[_0x2958[72]]= _0xeeefx20[_0x2958[144]][_0x2958[72]];_0xeeefx4b[_0x2958[47]]= _0xeeefx4b[_0x2958[47]]?_0xeeefx4b[_0x2958[47]][_0x2958[171]](_0x2958[161]):[];if(_0xeeefx4b[_0x2958[47]][_0x2958[79]]> 1){_0xeeefx4b[_0x2958[47]][_0x2958[172]]()};return Contact[_0x2958[155]](_0xeeefx4b)})[_0x2958[39]](function(_0xeeefx4c){_0xeeefx4b= _0xeeefx4c;if(_0xeeefx3f[_0x2958[72]]=== _0xeeefx20[_0x2958[144]][_0x2958[72]]){return CustomField[_0x2958[101]]({where:{$or:[{ListId:_0xeeefx3f[_0x2958[72]]},{ListId:null}]}})}})[_0x2958[39]](function(_0xeeefx31){if(_0xeeefx31&& _0xeeefx31[_0x2958[79]]){var _0xeeefx32=_[_0x2958[85]](_0xeeefx31,_0x2958[76])[_0x2958[81]](_0x2958[80]);return sequelize[_0x2958[90]](util[_0x2958[92]](_0x2958[141],_0xeeefx32,_0xeeefx3f[_0x2958[42]]),{type:sequelize[_0x2958[94]][_0x2958[93]]})}})[_0x2958[39]](function(_0xeeefx40){if(_0xeeefx40){var _0xeeefx32=[];_[_0x2958[164]](_0xeeefx40[0],function(_0xeeefx41,_0xeeefx42){_0xeeefx32[_0x2958[152]](util[_0x2958[92]](_0x2958[168],_0xeeefx42,_0xeeefx41))});if(_0xeeefx32[_0x2958[79]]){_0xeeefx32= _0xeeefx32[_0x2958[81]](_0x2958[80]);return sequelize[_0x2958[90]](util[_0x2958[92]](_0x2958[169],_0xeeefx32,_0xeeefx4b[_0x2958[42]]))}}})[_0x2958[39]](function(){return _0xeeefx21[_0x2958[38]](201)[_0x2958[37]](_0xeeefx4b)})[_0x2958[36]](function(_0xeeefx23){return _0xeeefx22(_0xeeefx23)})};exports[_0x2958[173]]= function(_0xeeefx20,_0xeeefx21,_0xeeefx22){var _0xeeefx45=[],_0xeeefx48=moment()[_0x2958[92]](_0x2958[158]),_0xeeefx4d=[],_0xeeefx49,_0xeeefx4a,_0xeeefx4e={ok:0,ko:0,failed:[]};return Tag[_0x2958[101]]()[_0x2958[39]](function(_0xeeefx4f){var _0xeeefx50=[],_0xeeefx51=[];var _0xeeefx52=_[_0x2958[85]](_[_0x2958[85]](_0xeeefx4f,_0x2958[102]),_0x2958[76]);Async[_0x2958[182]](_0xeeefx20[_0x2958[144]][_0x2958[175]],function(_0xeeefx3e,_0xeeefx30){if(_0xeeefx3e[_0x2958[43]]&& _0xeeefx3e[_0x2958[72]]){_0xeeefx3e[_0x2958[159]]= _0xeeefx20[_0x2958[113]][_0x2958[42]];_0xeeefx3e[_0x2958[131]]= _0xeeefx48;_0xeeefx3e[_0x2958[160]]= _0xeeefx48;_0xeeefx3e[_0x2958[47]]&& (_0xeeefx51= _[_0x2958[176]](_0xeeefx51,_0xeeefx3e[_0x2958[47]]));_0xeeefx49= [];_0xeeefx4a= [];_[_0x2958[164]](_0xeeefx3e,function(_0xeeefx41,_0xeeefx42){if(_0xeeefx41){switch(_0xeeefx42){case _0x2958[47]:if(_0xeeefx41[_0x2958[79]]){_0xeeefx4a[_0x2958[152]](_0x2958[84]+ _0xeeefx41[_0x2958[81]](_0x2958[161])+ _0x2958[162]);_0xeeefx49[_0x2958[152]](_0xeeefx42)};break;default:_0xeeefx49[_0x2958[152]](_0xeeefx42);_0xeeefx4a[_0x2958[152]](_[_0x2958[163]](_0xeeefx41)?_0x2958[84]+ _0xeeefx41+ _0x2958[84]:_0xeeefx41)}}});_0xeeefx4d[_0x2958[152]](sequelize[_0x2958[90]](util[_0x2958[92]](_0x2958[166],_0xeeefx49[_0x2958[81]](_0x2958[80]),_0xeeefx4a[_0x2958[81]](_0x2958[80])))[_0x2958[39]](function(_0xeeefx4c){_0xeeefx3e[_0x2958[42]]= _0xeeefx4c[_0x2958[42]];_0xeeefx45[_0x2958[152]](_0xeeefx3e);_0xeeefx4e[_0x2958[181]]++})[_0x2958[36]](function(_0xeeefx23){logger[_0x2958[178]](_0xeeefx23[_0x2958[177]]);_0xeeefx4e[_0x2958[179]]++;_0xeeefx4e[_0x2958[180]][_0x2958[152]](_0xeeefx30)}))}else {_0xeeefx4e[_0x2958[179]]++;_0xeeefx4e[_0x2958[180]][_0x2958[152]](_0xeeefx30)}});_0xeeefx51[_0x2958[79]]&& _[_0x2958[78]](_0xeeefx51,function(_0xeeefx35){if(!_0xeeefx52[_0x2958[79]]||  !_[_0x2958[97]](_0xeeefx52,_0xeeefx35)){_0xeeefx50[_0x2958[152]](Tag[_0x2958[155]]({name:_0xeeefx35}))}});return _0xeeefx50})[_0x2958[174]]()[_0x2958[39]](function(){return _0xeeefx4d})[_0x2958[174]]()[_0x2958[39]](function(){return _0xeeefx21[_0x2958[38]](201)[_0x2958[37]](_0xeeefx4e)})[_0x2958[36]](function(_0xeeefx23){return _0xeeefx22(_0xeeefx23)})};exports[_0x2958[183]]= function(_0xeeefx20,_0xeeefx21,_0xeeefx22){return Promise[_0x2958[174]]([])[_0x2958[39]](updateContact(_0xeeefx20,_0xeeefx21))[_0x2958[39]](function(_0xeeefx3e){return _0xeeefx21[_0x2958[38]](200)[_0x2958[37]](_0xeeefx3e)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};exports[_0x2958[74]]= function(_0xeeefx20,_0xeeefx21,_0xeeefx22){var _0xeeefx3f;return Promise[_0x2958[174]]([])[_0x2958[39]](updateContact(_0xeeefx20,_0xeeefx21))[_0x2958[39]](function(_0xeeefx3e){_0xeeefx3f= _0xeeefx3e;if(_0xeeefx20[_0x2958[144]][_0x2958[184]]){return Contact[_0x2958[185]]({where:{id:_0xeeefx20[_0x2958[144]][_0x2958[184]]},individualHooks:true})}})[_0x2958[39]](function(){return _0xeeefx21[_0x2958[38]](200)[_0x2958[37]](_0xeeefx3f)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};function updateContact(_0xeeefx20,_0xeeefx21){return function(){var _0xeeefx3f;return Tag[_0x2958[101]]()[_0x2958[39]](function(_0xeeefx4f){var _0xeeefx50=[];var _0xeeefx52=_[_0x2958[85]](_[_0x2958[85]](_0xeeefx4f,_0x2958[102]),_0x2958[76]);if(_0xeeefx20[_0x2958[144]][_0x2958[47]]){_0xeeefx20[_0x2958[144]][_0x2958[47]][_0x2958[78]](function(_0xeeefx35){if(!_[_0x2958[97]](_0xeeefx52,_0xeeefx35)){_0xeeefx50[_0x2958[152]](Tag[_0x2958[155]]({name:_0xeeefx35}))}})};return _0xeeefx50})[_0x2958[39]](function(){return Contact[_0x2958[114]](_0xeeefx20[_0x2958[139]][_0x2958[42]])})[_0x2958[39]](function(_0xeeefx3e){if(!_0xeeefx3e){return _0xeeefx21[_0x2958[126]](404)};delete _0xeeefx20[_0x2958[144]][_0x2958[42]];return _0xeeefx3e[_0x2958[188]](_0xeeefx20[_0x2958[144]])})[_0x2958[39]](function(_0xeeefx3e){_0xeeefx3f= _0xeeefx3e;return CustomField[_0x2958[101]]({where:{$or:[{ListId:_0xeeefx3f[_0x2958[72]]},{ListId:null}]}})})[_0x2958[39]](function(_0xeeefx31){if(_0xeeefx31[_0x2958[79]]){var _0xeeefx32=[];_0xeeefx31[_0x2958[78]](function(_0xeeefx35){if(_0xeeefx20[_0x2958[144]][_0x2958[187]](_0xeeefx35[_0x2958[76]])){_0xeeefx32[_0x2958[152]](util[_0x2958[92]](_0x2958[168],_0xeeefx35[_0x2958[76]],_0xeeefx20[_0x2958[144]][_0xeeefx35[_0x2958[76]]]))}});if(_0xeeefx32[_0x2958[79]]){_0xeeefx32= _0xeeefx32[_0x2958[81]](_0x2958[80]);return sequelize[_0x2958[90]](util[_0x2958[92]](_0x2958[169],_0xeeefx32,_0xeeefx3f[_0x2958[42]]))}}})[_0x2958[39]](function(){return TdUpdate[_0x2958[155]]({action:_0x2958[186],listId:_0xeeefx3f[_0x2958[72]],contactId:_0xeeefx3f[_0x2958[42]]})})[_0x2958[39]](function(){return _0xeeefx3f})}}exports[_0x2958[185]]= function(_0xeeefx20,_0xeeefx21){return Contact[_0x2958[114]](_0xeeefx20[_0x2958[139]][_0x2958[42]])[_0x2958[39]](function(_0xeeefx44){if(!_0xeeefx44){return _0xeeefx21[_0x2958[126]](404)};return _0xeeefx44[_0x2958[185]]()})[_0x2958[39]](function(_0xeeefx3e){return TdUpdate[_0x2958[155]]({action:_0x2958[189],listId:_0xeeefx3e[_0x2958[72]],contactId:_0xeeefx3e[_0x2958[42]]})})[_0x2958[39]](function(){return _0xeeefx21[_0x2958[126]](204)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};exports[_0x2958[190]]= function(_0xeeefx20,_0xeeefx21){return Contact[_0x2958[101]]({where:{id:_0xeeefx20[_0x2958[90]][_0x2958[191]]}})[_0x2958[39]](function(_0xeeefx37){var _0xeeefx54=[];if(_0xeeefx37&& _0xeeefx37[_0x2958[79]]){_[_0x2958[78]](_0xeeefx37,function(_0xeeefx3e){_0xeeefx54[_0x2958[152]](_0xeeefx3e[_0x2958[185]]());_0xeeefx54[_0x2958[152]](TdUpdate[_0x2958[155]]({action:_0x2958[189],listId:_0xeeefx3e[_0x2958[72]],contactId:_0xeeefx3e[_0x2958[42]]}))})};return _0xeeefx54})[_0x2958[174]]()[_0x2958[39]](function(){return _0xeeefx21[_0x2958[126]](204)})[_0x2958[36]](function(_0xeeefx23){return handleError(_0xeeefx21,_0xeeefx23)})};function handleError(_0xeeefx21,_0xeeefx23){logger[_0x2958[151]](_0xeeefx23[_0x2958[177]]);return _0xeeefx21[_0x2958[38]](500)[_0x2958[37]](_0xeeefx23)}
\ No newline at end of file