1 var _0x9435=["\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"];_0x9435[0];var _=require(_0x9435[1]);var moment=require(_0x9435[2]);var Contact=require(_0x9435[4])[_0x9435[3]];var User=require(_0x9435[4])[_0x9435[5]];var ContactPhone=require(_0x9435[4])[_0x9435[6]];var ContactEmail=require(_0x9435[4])[_0x9435[7]];var CustomField=require(_0x9435[4])[_0x9435[8]];var ReportCall=require(_0x9435[4])[_0x9435[9]];var ReportQueue=require(_0x9435[4])[_0x9435[10]];var ReportQueueHistory=require(_0x9435[4])[_0x9435[12]][_0x9435[11]];var ReportChatRoom=require(_0x9435[4])[_0x9435[13]];var ReportChatRoomHistory=require(_0x9435[4])[_0x9435[12]][_0x9435[14]];var ChatRoom=require(_0x9435[4])[_0x9435[15]];var FaxRoom=require(_0x9435[4])[_0x9435[16]];var SmsRoom=require(_0x9435[4])[_0x9435[17]];var ReportIntegration=require(_0x9435[4])[_0x9435[18]];var List=require(_0x9435[4])[_0x9435[19]];var Company=require(_0x9435[4])[_0x9435[20]];var ReportCallHistory=require(_0x9435[4])[_0x9435[12]][_0x9435[21]];var ReportMailSession=require(_0x9435[4])[_0x9435[22]];var MailRoom=require(_0x9435[4])[_0x9435[23]];var ReportMailSessionHistory=require(_0x9435[4])[_0x9435[12]][_0x9435[24]];var Tag=require(_0x9435[4])[_0x9435[25]];var TdUpdate=require(_0x9435[4])[_0x9435[26]];var stream=require(_0x9435[27]);var sequelize=require(_0x9435[4])[_0x9435[28]];var util=require(_0x9435[29]);var Util=require(_0x9435[30]);var Async=require(_0x9435[31]);var Promise=require(_0x9435[32]);var logger=require(_0x9435[34])(_0x9435[33]);exports[_0x9435[35]]= function(_0xfd0ax20,_0xfd0ax21,_0xfd0ax22){return Promise[_0x9435[40]]()[_0x9435[39]](getContacts(_0xfd0ax20))[_0x9435[39]](function(_0xfd0ax24){_0xfd0ax21[_0x9435[38]](200)[_0x9435[37]](_0xfd0ax24)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};exports[_0x9435[41]]= function(_0xfd0ax20,_0xfd0ax21,_0xfd0ax22){var _0xfd0ax25=[_0x9435[42],[_0x9435[43],_0x9435[44]],[_0x9435[45],_0x9435[46]],[_0x9435[47],_0x9435[48]],[_0x9435[49],_0x9435[50]],[_0x9435[51],_0x9435[52]],[_0x9435[53],_0x9435[54]],[_0x9435[55],_0x9435[56]],[_0x9435[57],_0x9435[58]],[_0x9435[59],_0x9435[60]],[_0x9435[61],_0x9435[62]],[_0x9435[63],_0x9435[64]],[_0x9435[65],_0x9435[66]],[_0x9435[67],_0x9435[68]],[_0x9435[69],_0x9435[70]],_0x9435[71],_0x9435[72]];return Promise[_0x9435[40]]()[_0x9435[39]](getContacts(_0xfd0ax20,_0xfd0ax25))[_0x9435[39]](function(_0xfd0ax24){_0xfd0ax21[_0x9435[38]](200)[_0x9435[37]](_0xfd0ax24)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};function getContacts(_0xfd0ax20,_0xfd0ax25){return function(){var _0xfd0ax27,_0xfd0ax28,_0xfd0ax29,_0xfd0ax2a=[],_0xfd0ax2b=[];switch(_0xfd0ax20[_0x9435[113]][_0x9435[117]]){case _0x9435[115]:return User[_0x9435[114]](_0xfd0ax20[_0x9435[113]][_0x9435[42]])[_0x9435[39]](function(_0xfd0ax3b){return _0xfd0ax3b[_0x9435[112]]()})[_0x9435[39]](function(_0xfd0ax2b){_0xfd0ax28= _[_0x9435[85]](_0xfd0ax2b,_0x9435[42]);return Company[_0x9435[101]]({attributes:[_0x9435[42],_0x9435[76]],raw:true})})[_0x9435[39]](function(_0xfd0ax3a){_0xfd0ax2a= _0xfd0ax3a;return List[_0x9435[101]]({attributes:[_0x9435[42],_0x9435[76]],raw:true})})[_0x9435[39]](function(_0xfd0ax38){_0xfd0ax2b= _0xfd0ax38;_0xfd0ax29= {CompanyId:_0xfd0ax20[_0x9435[90]][_0x9435[71]]|| null,ListId:_0xfd0ax20[_0x9435[90]][_0x9435[72]]|| null};delete _0xfd0ax20[_0x9435[90]][_0x9435[71]];delete _0xfd0ax20[_0x9435[90]][_0x9435[72]];var _0xfd0ax39=_0xfd0ax29[_0x9435[72]]?{}:{ListId:{$in:_0xfd0ax28[_0x9435[104]](_[_0x9435[85]](_[_0x9435[98]](_0xfd0ax2b,{defaultEntry:true}),_0x9435[42]))}};if(_0xfd0ax20[_0x9435[90]][_0x9435[105]]){_0xfd0ax39[_0x9435[42]]= {$ne:_0xfd0ax20[_0x9435[90]][_0x9435[105]]};delete _0xfd0ax20[_0x9435[90]][_0x9435[105]]};return Contact[_0x9435[111]](_0x9435[108],_0x9435[109],{method:[_0x9435[110],_0xfd0ax29]})[_0x9435[107]](Util[_0x9435[106]](_0xfd0ax20[_0x9435[90]],_0xfd0ax39,{attributes:_0xfd0ax25,order:_0xfd0ax20[_0x9435[90]][_0x9435[89]]|| _0x9435[91]}))})[_0x9435[39]](function(_0xfd0ax37){_0xfd0ax27= {rows:_[_0x9435[85]](_0xfd0ax37[_0x9435[73]],_0x9435[102]),count:_0xfd0ax37[_0x9435[73]]};return Contact[_0x9435[103]]()})[_0x9435[39]](function(_0xfd0ax34){_0xfd0ax34= _[_0x9435[98]](_[_0x9435[95]](_0xfd0ax34),function(_0xfd0ax35){return _[_0x9435[97]](_0xfd0ax35,_0x9435[96])});var _0xfd0ax36={where:{name:_0xfd0ax34}};_0xfd0ax29[_0x9435[72]]&& (_0xfd0ax36[_0x9435[100]][_0x9435[99]]= [{ListId:_0xfd0ax29[_0x9435[72]]},{ListId:null}]);return CustomField[_0x9435[101]](_0xfd0ax36)})[_0x9435[39]](function(_0xfd0ax31){if(_0xfd0ax31[_0x9435[79]]){var _0xfd0ax32=_[_0x9435[85]](_0xfd0ax31,function(_0xfd0ax33){return _0xfd0ax33[_0x9435[76]]+ _0x9435[82]+ _0xfd0ax33[_0x9435[83]]+ _0x9435[84]})[_0x9435[81]](_0x9435[80]);return sequelize[_0x9435[90]](util[_0x9435[92]](_0x9435[86]+ _[_0x9435[85]](_0xfd0ax27[_0x9435[73]],_0x9435[42])[_0x9435[81]](_0x9435[87])+ _0x9435[88],_0xfd0ax32,_0xfd0ax20[_0x9435[90]][_0x9435[89]]|| _0x9435[91]),{type:sequelize[_0x9435[94]][_0x9435[93]]})}})[_0x9435[39]](function(_0xfd0ax2c){var _0xfd0ax2d,_0xfd0ax2e;_[_0x9435[78]](_0xfd0ax27[_0x9435[73]],function(_0xfd0ax2f,_0xfd0ax30){_0xfd0ax2c&& _[_0x9435[74]](_0xfd0ax2f,_0xfd0ax2c[_0xfd0ax30]);_0xfd0ax2d= _[_0x9435[75]](_0xfd0ax2a,{id:_0xfd0ax2f[_0x9435[71]]});_0xfd0ax2f[_0x9435[20]]= _0xfd0ax2d?_0xfd0ax2d[_0x9435[76]]:_0x9435[77];_0xfd0ax2e= _[_0x9435[75]](_0xfd0ax2b,{id:_0xfd0ax2f[_0x9435[72]]});_0xfd0ax2f[_0x9435[19]]= _0xfd0ax2e?_0xfd0ax2e[_0x9435[76]]:_0x9435[77];if(_0xfd0ax25){delete _0xfd0ax2f[_0x9435[42]];delete _0xfd0ax2f[_0x9435[71]];delete _0xfd0ax2f[_0x9435[72]]}});return _0xfd0ax27});default:_0xfd0ax29= {CompanyId:_0xfd0ax20[_0x9435[90]][_0x9435[71]]|| null,ListId:_0xfd0ax20[_0x9435[90]][_0x9435[72]]|| null};delete _0xfd0ax20[_0x9435[90]][_0x9435[71]];delete _0xfd0ax20[_0x9435[90]][_0x9435[72]];var _0xfd0ax39={};if(_0xfd0ax20[_0x9435[90]][_0x9435[105]]){_0xfd0ax39[_0x9435[42]]= {$ne:_0xfd0ax20[_0x9435[90]][_0x9435[105]]};delete _0xfd0ax20[_0x9435[90]][_0x9435[105]]};return Company[_0x9435[101]]({attributes:[_0x9435[42],_0x9435[76]],raw:true})[_0x9435[39]](function(_0xfd0ax3a){_0xfd0ax2a= _0xfd0ax3a;return List[_0x9435[101]]({attributes:[_0x9435[42],_0x9435[76]],raw:true})})[_0x9435[39]](function(_0xfd0ax38){_0xfd0ax2b= _0xfd0ax38;return Contact[_0x9435[111]]({method:[_0x9435[110],_0xfd0ax29]})[_0x9435[107]](Util[_0x9435[106]](_0xfd0ax20[_0x9435[90]],_0xfd0ax39,{attributes:_0xfd0ax25,order:_0xfd0ax20[_0x9435[90]][_0x9435[89]]|| _0x9435[91]}))})[_0x9435[39]](function(_0xfd0ax37){_0xfd0ax27= {rows:_[_0x9435[85]](_0xfd0ax37[_0x9435[73]],_0x9435[102]),count:_0xfd0ax37[_0x9435[116]]};return Contact[_0x9435[103]]()})[_0x9435[39]](function(_0xfd0ax34){_0xfd0ax34= _[_0x9435[98]](_[_0x9435[95]](_0xfd0ax34),function(_0xfd0ax35){return _[_0x9435[97]](_0xfd0ax35,_0x9435[96])});var _0xfd0ax36={where:{name:_0xfd0ax34}};_0xfd0ax29[_0x9435[72]]&& (_0xfd0ax36[_0x9435[100]][_0x9435[99]]= [{ListId:_0xfd0ax29[_0x9435[72]]},{ListId:null}]);return CustomField[_0x9435[101]](_0xfd0ax36)})[_0x9435[39]](function(_0xfd0ax31){if(_0xfd0ax27[_0x9435[73]][_0x9435[79]]&& _0xfd0ax31[_0x9435[79]]){var _0xfd0ax32=_[_0x9435[85]](_0xfd0ax31,function(_0xfd0ax33){return _0xfd0ax33[_0x9435[76]]+ _0x9435[82]+ _0xfd0ax33[_0x9435[83]]+ _0x9435[84]})[_0x9435[81]](_0x9435[80]);return sequelize[_0x9435[90]](util[_0x9435[92]](_0x9435[86]+ _[_0x9435[85]](_0xfd0ax27[_0x9435[73]],_0x9435[42])[_0x9435[81]](_0x9435[87])+ _0x9435[88],_0xfd0ax32,_0xfd0ax20[_0x9435[90]][_0x9435[89]]|| _0x9435[91]),{type:sequelize[_0x9435[94]][_0x9435[93]]})}})[_0x9435[39]](function(_0xfd0ax2c){var _0xfd0ax2d,_0xfd0ax2e;_[_0x9435[78]](_0xfd0ax27[_0x9435[73]],function(_0xfd0ax2f,_0xfd0ax30){_0xfd0ax2c&& _[_0x9435[74]](_0xfd0ax2f,_0xfd0ax2c[_0xfd0ax30]);_0xfd0ax2d= _[_0x9435[75]](_0xfd0ax2a,{id:_0xfd0ax2f[_0x9435[71]]});_0xfd0ax2f[_0x9435[20]]= _0xfd0ax2d?_0xfd0ax2d[_0x9435[76]]:_0x9435[77];_0xfd0ax2e= _[_0x9435[75]](_0xfd0ax2b,{id:_0xfd0ax2f[_0x9435[72]]});_0xfd0ax2f[_0x9435[19]]= _0xfd0ax2e?_0xfd0ax2e[_0x9435[76]]:_0x9435[77];if(_0xfd0ax25){delete _0xfd0ax2f[_0x9435[42]];delete _0xfd0ax2f[_0x9435[71]];delete _0xfd0ax2f[_0x9435[72]]}});return _0xfd0ax27})}}}exports[_0x9435[103]]= function(_0xfd0ax20,_0xfd0ax21){return Contact[_0x9435[103]]()[_0x9435[39]](function(_0xfd0ax34){return _0xfd0ax21[_0x9435[38]](200)[_0x9435[37]](_0xfd0ax34)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};exports[_0x9435[118]]= function(_0xfd0ax20,_0xfd0ax21,_0xfd0ax22){_0xfd0ax20[_0x9435[90]][_0x9435[119]]= _0xfd0ax20[_0x9435[90]][_0x9435[119]]|| _0x9435[120];_0xfd0ax20[_0x9435[90]][_0x9435[121]]= _0xfd0ax20[_0x9435[90]][_0x9435[121]]|| _0x9435[61];_0xfd0ax20[_0x9435[90]][_0x9435[122]]= _0xfd0ax20[_0x9435[90]][_0x9435[122]]|| _0x9435[123];_0xfd0ax20[_0x9435[90]][_0x9435[124]]= _0xfd0ax20[_0x9435[90]][_0x9435[124]]|| _0x9435[125];var _0xfd0ax3c,_0xfd0ax3d={};return Contact[_0x9435[114]](_0xfd0ax20[_0x9435[139]][_0x9435[42]])[_0x9435[39]](function(_0xfd0ax3e){if(!_0xfd0ax3e){return _0xfd0ax21[_0x9435[126]](404)};switch(_0xfd0ax20[_0x9435[90]][_0x9435[119]]){case _0x9435[120]:switch(_0xfd0ax20[_0x9435[90]][_0x9435[121]]){case _0x9435[61]:_0xfd0ax3c= (_0xfd0ax20[_0x9435[90]][_0x9435[122]]=== _0x9435[12])?ReportCallHistory:ReportCall;if(_0xfd0ax20[_0x9435[90]][_0x9435[124]]=== _0x9435[127]){_0xfd0ax3d[_0x9435[128]]= [_0xfd0ax3e[_0x9435[61]],_0xfd0ax3e[_0x9435[63]]]}else {_0xfd0ax3d[_0x9435[129]]= [_0xfd0ax3e[_0x9435[61]],_0xfd0ax3e[_0x9435[63]]]};break;case _0x9435[67]:_0xfd0ax3c= MailRoom;_0xfd0ax3d[_0x9435[130]]= _0xfd0ax3e[_0x9435[67]];if(_0xfd0ax20[_0x9435[90]][_0x9435[122]]=== _0x9435[12]){_0xfd0ax3d[_0x9435[131]]= {$lt:moment()[_0x9435[133]](_0x9435[132])}}else {_0xfd0ax3d[_0x9435[131]]= {$gte:moment()[_0x9435[133]](_0x9435[132])}};break;case _0x9435[135]:_0xfd0ax3c= ChatRoom;_0xfd0ax3d[_0x9435[134]]= _0xfd0ax3e[_0x9435[67]];if(_0xfd0ax20[_0x9435[90]][_0x9435[122]]=== _0x9435[12]){_0xfd0ax3d[_0x9435[131]]= {$lt:moment()[_0x9435[133]](_0x9435[132])}}else {_0xfd0ax3d[_0x9435[131]]= {$gte:moment()[_0x9435[133]](_0x9435[132])}};break;case _0x9435[65]:_0xfd0ax3c= FaxRoom;_0xfd0ax3d[_0x9435[134]]= _0xfd0ax3e[_0x9435[65]];if(_0xfd0ax20[_0x9435[90]][_0x9435[122]]=== _0x9435[12]){_0xfd0ax3d[_0x9435[131]]= {$lt:moment()[_0x9435[133]](_0x9435[132])}}else {_0xfd0ax3d[_0x9435[131]]= {$gte:moment()[_0x9435[133]](_0x9435[132])}};break;case _0x9435[136]:_0xfd0ax3c= SmsRoom;_0xfd0ax3d[_0x9435[134]]= [_0xfd0ax3e[_0x9435[61]],_0xfd0ax3e[_0x9435[63]]];if(_0xfd0ax20[_0x9435[90]][_0x9435[122]]=== _0x9435[12]){_0xfd0ax3d[_0x9435[131]]= {$lt:moment()[_0x9435[133]](_0x9435[132])}}else {_0xfd0ax3d[_0x9435[131]]= {$gte:moment()[_0x9435[133]](_0x9435[132])}};break;default:_0xfd0ax3c= (_0xfd0ax20[_0x9435[90]][_0x9435[122]]=== _0x9435[12])?ReportCallHistory:ReportCall};break;case _0x9435[138]:switch(_0xfd0ax20[_0x9435[90]][_0x9435[121]]){case _0x9435[61]:_0xfd0ax3c= (_0xfd0ax20[_0x9435[90]][_0x9435[122]]=== _0x9435[12])?ReportQueueHistory:ReportQueue;_0xfd0ax3d[_0x9435[137]]= [_0xfd0ax3e[_0x9435[61]],_0xfd0ax3e[_0x9435[63]]];break;case _0x9435[67]:return _0xfd0ax21[_0x9435[126]](404);default:_0xfd0ax3c= (_0xfd0ax20[_0x9435[90]][_0x9435[122]]=== _0x9435[12])?ReportQueueHistory:ReportQueue};break;default:_0xfd0ax3c= ReportCall};delete _0xfd0ax20[_0x9435[90]][_0x9435[119]];delete _0xfd0ax20[_0x9435[90]][_0x9435[121]];delete _0xfd0ax20[_0x9435[90]][_0x9435[122]];delete _0xfd0ax20[_0x9435[90]][_0x9435[124]];return _0xfd0ax3c[_0x9435[107]](Util[_0x9435[106]](_0xfd0ax20[_0x9435[90]],_0xfd0ax3d))})[_0x9435[39]](function(_0xfd0ax24){_0xfd0ax21[_0x9435[38]](200)[_0x9435[37]](_0xfd0ax24)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};exports[_0x9435[121]]= function(_0xfd0ax20,_0xfd0ax21){var _0xfd0ax3f;return Contact[_0x9435[111]](_0x9435[108],_0x9435[113],_0x9435[109])[_0x9435[114]](_0xfd0ax20[_0x9435[139]][_0x9435[42]])[_0x9435[39]](function(_0xfd0ax44){if(!_0xfd0ax44){return _0xfd0ax21[_0x9435[126]](404)};_0xfd0ax3f= _0xfd0ax44;return CustomField[_0x9435[101]]({where:{$or:[{ListId:_0xfd0ax3f[_0x9435[72]]},{ListId:null}]}})})[_0x9435[39]](function(_0xfd0ax31){if(_0xfd0ax31[_0x9435[79]]){var _0xfd0ax32=_[_0x9435[85]](_0xfd0ax31,_0x9435[76])[_0x9435[81]](_0x9435[80]);return sequelize[_0x9435[90]](util[_0x9435[92]](_0x9435[141],_0xfd0ax32,_0xfd0ax20[_0x9435[139]][_0x9435[42]]),{type:sequelize[_0x9435[94]][_0x9435[93]]})}})[_0x9435[39]](function(_0xfd0ax40){if(_0xfd0ax40){_[_0x9435[78]](_0xfd0ax40[0],function(_0xfd0ax41,_0xfd0ax42,_0xfd0ax43){if(_0xfd0ax41=== _0x9435[140]){_0xfd0ax43[_0xfd0ax42]= null}});_[_0x9435[74]](_0xfd0ax3f[_0x9435[102]],_0xfd0ax40[0])}})[_0x9435[39]](function(){return _0xfd0ax21[_0x9435[38]](200)[_0x9435[37]](_0xfd0ax3f)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};exports[_0x9435[142]]= function(_0xfd0ax20,_0xfd0ax21){var _0xfd0ax3d={},_0xfd0ax45;switch(_0xfd0ax20[_0x9435[144]][_0x9435[148]]){case _0x9435[146]:if(_0xfd0ax20[_0x9435[144]][_0x9435[143]]=== _0x9435[138]){_0xfd0ax3d= {$or:{phone:_0xfd0ax20[_0x9435[144]][_0x9435[137]],mobile:_0xfd0ax20[_0x9435[144]][_0x9435[137]]}}}else {_0xfd0ax3d= {$or:{phone:_0xfd0ax20[_0x9435[144]][_0x9435[145]],mobile:_0xfd0ax20[_0x9435[144]][_0x9435[145]]}}};break;case _0x9435[147]:_0xfd0ax3d= {email:_0xfd0ax20[_0x9435[144]][_0x9435[130]]};break;default:_0xfd0ax3d= {}};var _0xfd0ax46=_[_0x9435[85]](_[_0x9435[85]](_0xfd0ax20[_0x9435[113]].Lists,_0x9435[102]),_0x9435[42]);var _0xfd0ax47;return List[_0x9435[156]]({where:{defaultEntry:true}})[_0x9435[39]](function(_0xfd0ax2e){if(_0xfd0ax2e){_0xfd0ax46[_0x9435[152]](_0xfd0ax2e[_0x9435[42]])};if(_0xfd0ax20[_0x9435[144]][_0x9435[72]]){_0xfd0ax47= _[_0x9435[97]](_0xfd0ax46,_0xfd0ax20[_0x9435[144]].ListId)?{id:_0xfd0ax20[_0x9435[144]][_0x9435[72]]}:null}else {_0xfd0ax47= {id:_0xfd0ax46}};if(_0xfd0ax47){return Contact[_0x9435[107]]({where:_0xfd0ax3d,include:[{model:List,where:_0xfd0ax47}]})};return null})[_0x9435[39]](function(_0xfd0ax37){if(_0xfd0ax37&& _0xfd0ax37[_0x9435[73]][_0x9435[79]]){_0xfd0ax45= _0xfd0ax37;return null}else {_0xfd0ax45= {count:0,rows:[]};if(_0xfd0ax20[_0x9435[144]][_0x9435[149]]&& _0xfd0ax20[_0x9435[144]][_0x9435[72]]&& _[_0x9435[97]](_0xfd0ax46,_0xfd0ax20[_0x9435[144]].ListId)){var _0xfd0ax3f={};return Contact[_0x9435[155]]({firstName:_0xfd0ax20[_0x9435[144]][_0x9435[154]],phone:_0xfd0ax20[_0x9435[144]][_0x9435[137]],ListId:_0xfd0ax20[_0x9435[144]][_0x9435[72]]})[_0x9435[39]](function(_0xfd0ax3e){_0xfd0ax3f= _0xfd0ax3e[_0x9435[153]]({plain:true});return List[_0x9435[114]](_0xfd0ax20[_0x9435[144]].ListId,{raw:true})})[_0x9435[39]](function(_0xfd0ax2e){_0xfd0ax3f[_0x9435[19]]= _0xfd0ax2e;_0xfd0ax45[_0x9435[73]][_0x9435[152]](_0xfd0ax3f)})[_0x9435[36]](function(_0xfd0ax23){logger[_0x9435[151]](_0x9435[150],_0xfd0ax23)})}}})[_0x9435[39]](function(){return _0xfd0ax21[_0x9435[38]](200)[_0x9435[37]](_0xfd0ax45)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};exports[_0x9435[155]]= function(_0xfd0ax20,_0xfd0ax21,_0xfd0ax22){if(!_0xfd0ax20[_0x9435[144]][_0x9435[43]]|| !_0xfd0ax20[_0x9435[144]][_0x9435[72]]){return handleError(_0xfd0ax21,{message:_0x9435[157]})};var _0xfd0ax3f,_0xfd0ax48=moment()[_0x9435[92]](_0x9435[158]),_0xfd0ax49=[],_0xfd0ax4a=[];_0xfd0ax20[_0x9435[144]][_0x9435[159]]= _0xfd0ax20[_0x9435[113]][_0x9435[42]];_0xfd0ax20[_0x9435[144]][_0x9435[131]]= _0xfd0ax48;_0xfd0ax20[_0x9435[144]][_0x9435[160]]= _0xfd0ax48;_[_0x9435[164]](_0xfd0ax20[_0x9435[144]],function(_0xfd0ax41,_0xfd0ax42){if(_0xfd0ax41){switch(_0xfd0ax42){case _0x9435[47]:if(_0xfd0ax41[_0x9435[79]]){_0xfd0ax4a[_0x9435[152]](_0x9435[84]+ _0xfd0ax41[_0x9435[81]](_0x9435[161])+ _0x9435[162]);_0xfd0ax49[_0x9435[152]](_0xfd0ax42)};break;default:_0xfd0ax49[_0x9435[152]](_0xfd0ax42);_0xfd0ax4a[_0x9435[152]](_[_0x9435[163]](_0xfd0ax41)?_0x9435[84]+ _0xfd0ax41+ _0x9435[84]:_0xfd0ax41)}}});return sequelize[_0x9435[90]](util[_0x9435[92]](_0x9435[166],_0xfd0ax49[_0x9435[81]](_0x9435[80]),_0xfd0ax4a[_0x9435[81]](_0x9435[80])))[_0x9435[39]](function(_0xfd0ax3e){_0xfd0ax20[_0x9435[144]][_0x9435[42]]= _0xfd0ax3e[0][_0x9435[165]];return _0xfd0ax21[_0x9435[38]](201)[_0x9435[37]](_0xfd0ax20[_0x9435[144]])})[_0x9435[36]](function(_0xfd0ax23){return _0xfd0ax22(_0xfd0ax23)})};exports[_0x9435[167]]= function(_0xfd0ax20,_0xfd0ax21,_0xfd0ax22){var _0xfd0ax3f,_0xfd0ax4b;return Contact[_0x9435[114]](_0xfd0ax20[_0x9435[139]][_0x9435[42]])[_0x9435[39]](function(_0xfd0ax3e){_0xfd0ax3f= _0xfd0ax3e[_0x9435[102]];_0xfd0ax4b= _[_0x9435[170]](_0xfd0ax3e[_0x9435[102]]);delete _0xfd0ax4b[_0x9435[42]];_0xfd0ax4b[_0x9435[159]]= _0xfd0ax20[_0x9435[113]][_0x9435[42]];_0xfd0ax4b[_0x9435[72]]= _0xfd0ax20[_0x9435[144]][_0x9435[72]];_0xfd0ax4b[_0x9435[47]]= _0xfd0ax4b[_0x9435[47]]?_0xfd0ax4b[_0x9435[47]][_0x9435[171]](_0x9435[161]):[];if(_0xfd0ax4b[_0x9435[47]][_0x9435[79]]> 1){_0xfd0ax4b[_0x9435[47]][_0x9435[172]]()};return Contact[_0x9435[155]](_0xfd0ax4b)})[_0x9435[39]](function(_0xfd0ax4c){_0xfd0ax4b= _0xfd0ax4c;if(_0xfd0ax3f[_0x9435[72]]=== _0xfd0ax20[_0x9435[144]][_0x9435[72]]){return CustomField[_0x9435[101]]({where:{$or:[{ListId:_0xfd0ax3f[_0x9435[72]]},{ListId:null}]}})}})[_0x9435[39]](function(_0xfd0ax31){if(_0xfd0ax31&& _0xfd0ax31[_0x9435[79]]){var _0xfd0ax32=_[_0x9435[85]](_0xfd0ax31,_0x9435[76])[_0x9435[81]](_0x9435[80]);return sequelize[_0x9435[90]](util[_0x9435[92]](_0x9435[141],_0xfd0ax32,_0xfd0ax3f[_0x9435[42]]),{type:sequelize[_0x9435[94]][_0x9435[93]]})}})[_0x9435[39]](function(_0xfd0ax40){if(_0xfd0ax40){var _0xfd0ax32=[];_[_0x9435[164]](_0xfd0ax40[0],function(_0xfd0ax41,_0xfd0ax42){_0xfd0ax32[_0x9435[152]](util[_0x9435[92]](_0x9435[168],_0xfd0ax42,_0xfd0ax41))});if(_0xfd0ax32[_0x9435[79]]){_0xfd0ax32= _0xfd0ax32[_0x9435[81]](_0x9435[80]);return sequelize[_0x9435[90]](util[_0x9435[92]](_0x9435[169],_0xfd0ax32,_0xfd0ax4b[_0x9435[42]]))}}})[_0x9435[39]](function(){return _0xfd0ax21[_0x9435[38]](201)[_0x9435[37]](_0xfd0ax4b)})[_0x9435[36]](function(_0xfd0ax23){return _0xfd0ax22(_0xfd0ax23)})};exports[_0x9435[173]]= function(_0xfd0ax20,_0xfd0ax21,_0xfd0ax22){var _0xfd0ax45=[],_0xfd0ax48=moment()[_0x9435[92]](_0x9435[158]),_0xfd0ax4d=[],_0xfd0ax49,_0xfd0ax4a,_0xfd0ax4e={ok:0,ko:0,failed:[]};return Tag[_0x9435[101]]()[_0x9435[39]](function(_0xfd0ax4f){var _0xfd0ax50=[],_0xfd0ax51=[];var _0xfd0ax52=_[_0x9435[85]](_[_0x9435[85]](_0xfd0ax4f,_0x9435[102]),_0x9435[76]);Async[_0x9435[182]](_0xfd0ax20[_0x9435[144]][_0x9435[175]],function(_0xfd0ax3e,_0xfd0ax30){if(_0xfd0ax3e[_0x9435[43]]&& _0xfd0ax3e[_0x9435[72]]){_0xfd0ax3e[_0x9435[159]]= _0xfd0ax20[_0x9435[113]][_0x9435[42]];_0xfd0ax3e[_0x9435[131]]= _0xfd0ax48;_0xfd0ax3e[_0x9435[160]]= _0xfd0ax48;_0xfd0ax3e[_0x9435[47]]&& (_0xfd0ax51= _[_0x9435[176]](_0xfd0ax51,_0xfd0ax3e[_0x9435[47]]));_0xfd0ax49= [];_0xfd0ax4a= [];_[_0x9435[164]](_0xfd0ax3e,function(_0xfd0ax41,_0xfd0ax42){if(_0xfd0ax41){switch(_0xfd0ax42){case _0x9435[47]:if(_0xfd0ax41[_0x9435[79]]){_0xfd0ax4a[_0x9435[152]](_0x9435[84]+ _0xfd0ax41[_0x9435[81]](_0x9435[161])+ _0x9435[162]);_0xfd0ax49[_0x9435[152]](_0xfd0ax42)};break;default:_0xfd0ax49[_0x9435[152]](_0xfd0ax42);_0xfd0ax4a[_0x9435[152]](_[_0x9435[163]](_0xfd0ax41)?_0x9435[84]+ _0xfd0ax41+ _0x9435[84]:_0xfd0ax41)}}});_0xfd0ax4d[_0x9435[152]](sequelize[_0x9435[90]](util[_0x9435[92]](_0x9435[166],_0xfd0ax49[_0x9435[81]](_0x9435[80]),_0xfd0ax4a[_0x9435[81]](_0x9435[80])))[_0x9435[39]](function(_0xfd0ax4c){_0xfd0ax3e[_0x9435[42]]= _0xfd0ax4c[_0x9435[42]];_0xfd0ax45[_0x9435[152]](_0xfd0ax3e);_0xfd0ax4e[_0x9435[181]]++})[_0x9435[36]](function(_0xfd0ax23){logger[_0x9435[178]](_0xfd0ax23[_0x9435[177]]);_0xfd0ax4e[_0x9435[179]]++;_0xfd0ax4e[_0x9435[180]][_0x9435[152]](_0xfd0ax30)}))}else {_0xfd0ax4e[_0x9435[179]]++;_0xfd0ax4e[_0x9435[180]][_0x9435[152]](_0xfd0ax30)}});_0xfd0ax51[_0x9435[79]]&& _[_0x9435[78]](_0xfd0ax51,function(_0xfd0ax35){if(!_0xfd0ax52[_0x9435[79]]|| !_[_0x9435[97]](_0xfd0ax52,_0xfd0ax35)){_0xfd0ax50[_0x9435[152]](Tag[_0x9435[155]]({name:_0xfd0ax35}))}});return _0xfd0ax50})[_0x9435[174]]()[_0x9435[39]](function(){return _0xfd0ax4d})[_0x9435[174]]()[_0x9435[39]](function(){return _0xfd0ax21[_0x9435[38]](201)[_0x9435[37]](_0xfd0ax4e)})[_0x9435[36]](function(_0xfd0ax23){return _0xfd0ax22(_0xfd0ax23)})};exports[_0x9435[183]]= function(_0xfd0ax20,_0xfd0ax21,_0xfd0ax22){return Promise[_0x9435[174]]([])[_0x9435[39]](updateContact(_0xfd0ax20,_0xfd0ax21))[_0x9435[39]](function(_0xfd0ax3e){return _0xfd0ax21[_0x9435[38]](200)[_0x9435[37]](_0xfd0ax3e)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};exports[_0x9435[74]]= function(_0xfd0ax20,_0xfd0ax21,_0xfd0ax22){var _0xfd0ax3f;return Promise[_0x9435[174]]([])[_0x9435[39]](updateContact(_0xfd0ax20,_0xfd0ax21))[_0x9435[39]](function(_0xfd0ax3e){_0xfd0ax3f= _0xfd0ax3e;if(_0xfd0ax20[_0x9435[144]][_0x9435[184]]){return Contact[_0x9435[185]]({where:{id:_0xfd0ax20[_0x9435[144]][_0x9435[184]]},individualHooks:true})}})[_0x9435[39]](function(){return _0xfd0ax21[_0x9435[38]](200)[_0x9435[37]](_0xfd0ax3f)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};function updateContact(_0xfd0ax20,_0xfd0ax21){return function(){var _0xfd0ax3f;return Tag[_0x9435[101]]()[_0x9435[39]](function(_0xfd0ax4f){var _0xfd0ax50=[];var _0xfd0ax52=_[_0x9435[85]](_[_0x9435[85]](_0xfd0ax4f,_0x9435[102]),_0x9435[76]);if(_0xfd0ax20[_0x9435[144]][_0x9435[47]]){_0xfd0ax20[_0x9435[144]][_0x9435[47]][_0x9435[78]](function(_0xfd0ax35){if(!_[_0x9435[97]](_0xfd0ax52,_0xfd0ax35)){_0xfd0ax50[_0x9435[152]](Tag[_0x9435[155]]({name:_0xfd0ax35}))}})};return _0xfd0ax50})[_0x9435[39]](function(){return Contact[_0x9435[114]](_0xfd0ax20[_0x9435[139]][_0x9435[42]])})[_0x9435[39]](function(_0xfd0ax3e){if(!_0xfd0ax3e){return _0xfd0ax21[_0x9435[126]](404)};delete _0xfd0ax20[_0x9435[144]][_0x9435[42]];return _0xfd0ax3e[_0x9435[188]](_0xfd0ax20[_0x9435[144]])})[_0x9435[39]](function(_0xfd0ax3e){_0xfd0ax3f= _0xfd0ax3e;return CustomField[_0x9435[101]]({where:{$or:[{ListId:_0xfd0ax3f[_0x9435[72]]},{ListId:null}]}})})[_0x9435[39]](function(_0xfd0ax31){if(_0xfd0ax31[_0x9435[79]]){var _0xfd0ax32=[];_0xfd0ax31[_0x9435[78]](function(_0xfd0ax35){if(_0xfd0ax20[_0x9435[144]][_0x9435[187]](_0xfd0ax35[_0x9435[76]])){_0xfd0ax32[_0x9435[152]](util[_0x9435[92]](_0x9435[168],_0xfd0ax35[_0x9435[76]],_0xfd0ax20[_0x9435[144]][_0xfd0ax35[_0x9435[76]]]))}});if(_0xfd0ax32[_0x9435[79]]){_0xfd0ax32= _0xfd0ax32[_0x9435[81]](_0x9435[80]);return sequelize[_0x9435[90]](util[_0x9435[92]](_0x9435[169],_0xfd0ax32,_0xfd0ax3f[_0x9435[42]]))}}})[_0x9435[39]](function(){return TdUpdate[_0x9435[155]]({action:_0x9435[186],listId:_0xfd0ax3f[_0x9435[72]],contactId:_0xfd0ax3f[_0x9435[42]]})})[_0x9435[39]](function(){return _0xfd0ax3f})}}exports[_0x9435[185]]= function(_0xfd0ax20,_0xfd0ax21){return Contact[_0x9435[114]](_0xfd0ax20[_0x9435[139]][_0x9435[42]])[_0x9435[39]](function(_0xfd0ax44){if(!_0xfd0ax44){return _0xfd0ax21[_0x9435[126]](404)};return _0xfd0ax44[_0x9435[185]]()})[_0x9435[39]](function(_0xfd0ax3e){return TdUpdate[_0x9435[155]]({action:_0x9435[189],listId:_0xfd0ax3e[_0x9435[72]],contactId:_0xfd0ax3e[_0x9435[42]]})})[_0x9435[39]](function(){return _0xfd0ax21[_0x9435[126]](204)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};exports[_0x9435[190]]= function(_0xfd0ax20,_0xfd0ax21){return Contact[_0x9435[101]]({where:{id:_0xfd0ax20[_0x9435[90]][_0x9435[191]]}})[_0x9435[39]](function(_0xfd0ax37){var _0xfd0ax54=[];if(_0xfd0ax37&& _0xfd0ax37[_0x9435[79]]){_[_0x9435[78]](_0xfd0ax37,function(_0xfd0ax3e){_0xfd0ax54[_0x9435[152]](_0xfd0ax3e[_0x9435[185]]());_0xfd0ax54[_0x9435[152]](TdUpdate[_0x9435[155]]({action:_0x9435[189],listId:_0xfd0ax3e[_0x9435[72]],contactId:_0xfd0ax3e[_0x9435[42]]}))})};return _0xfd0ax54})[_0x9435[174]]()[_0x9435[39]](function(){return _0xfd0ax21[_0x9435[126]](204)})[_0x9435[36]](function(_0xfd0ax23){return handleError(_0xfd0ax21,_0xfd0ax23)})};function handleError(_0xfd0ax21,_0xfd0ax23){logger[_0x9435[151]](_0xfd0ax23[_0x9435[177]]);return _0xfd0ax21[_0x9435[38]](500)[_0x9435[37]](_0xfd0ax23)}