Built motion from commit 15a6d846f.|1.0.20
[motion.git] / server / api / chat_room / chat_room.controller.js
index 3d85136..debd918 100644 (file)
@@ -1 +1 @@
-var _0x2c90=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x64\x35","\x6D\x6F\x6D\x65\x6E\x74","\x74\x6F\x2D\x63\x73\x76","\x75\x74\x69\x6C","\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","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65","\x43\x68\x61\x74\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x4C\x69\x73\x74","\x55\x73\x65\x72\x48\x61\x73\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x69\x64","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x72\x6F\x6C\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x6D\x61\x70","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x74\x61\x67\x73","\x62\x6F\x64\x79","\x2C","\x73\x70\x6C\x69\x74","\x70\x61\x72\x61\x6D\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x75\x70\x64\x61\x74\x65","\x24\x61\x6E\x64","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x25","\x3B\x25","\x70\x75\x73\x68","\x67\x65\x74\x41\x67\x65\x6E\x74\x73","\x67\x65\x74\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x47\x72\x6F\x75\x70\x73","\x67\x72\x6F\x75\x70","\x61\x67\x65\x6E\x74","\x75\x73\x65\x72\x70\x69\x63","\x66\x69\x6E\x64\x41\x6C\x6C","\x67\x65\x74\x45\x78\x74\x65\x72\x6E\x61\x6C\x73","\x65\x78\x74\x65\x72\x6E\x61\x6C","\x69\x6E\x63\x6C\x75\x64\x65","\x67\x65\x74\x41\x67\x65\x6E\x74","\x67\x65\x74\x4F\x6E\x6C\x69\x6E\x65\x52\x6F\x6F\x6D","\x6F\x6E\x6C\x69\x6E\x65","\x6D\x65","\x67\x65\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x73","\x73\x68\x6F\x77","\x61\x64\x64\x72\x65\x73\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x55\x73\x65\x72\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x67\x65\x74\x55\x73\x65\x72\x73","\x75\x73\x65\x72\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x73\x70\x72\x65\x61\x64","\x62\x61\x73\x65\x36\x34","\x73\x6F\x72\x74","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x4F\x50\x45\x4E","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x63\x72\x65\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x63\x72\x65\x61\x74\x65","\x65\x78\x70\x6F\x72\x74","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x66\x6F\x72\x45\x61\x63\x68","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x74\x65\x78\x74\x2F\x63\x73\x76","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x54\x79\x70\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x47\x72\x6F\x75\x70\x73","\x75\x70\x64\x61\x74\x65\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x2c90[0];var _=require(_0x2c90[1]);var md5=require(_0x2c90[2]);var moment=require(_0x2c90[3]);var csv=require(_0x2c90[4]);var util=require(_0x2c90[5]);var logger=require(_0x2c90[7])(_0x2c90[6]);var Util=require(_0x2c90[8]);var User=require(_0x2c90[10])[_0x2c90[9]];var Agent=require(_0x2c90[10])[_0x2c90[9]];var ChatRoom=require(_0x2c90[10])[_0x2c90[11]];var ChatMessage=require(_0x2c90[10])[_0x2c90[12]];var ChatWebsite=require(_0x2c90[10])[_0x2c90[13]];var ChatApplication=require(_0x2c90[10])[_0x2c90[14]];var ChatQueue=require(_0x2c90[10])[_0x2c90[15]];var ChatVisitor=require(_0x2c90[10])[_0x2c90[16]];var List=require(_0x2c90[10])[_0x2c90[17]];var UserHasChatRoom=require(_0x2c90[10])[_0x2c90[18]];exports[_0x2c90[19]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){return ChatRoom[_0x2c90[33]](_[_0x2c90[32]](Util[_0x2c90[25]](_0x45f6x12[_0x2c90[24]]),{include:[{model:User,attributes:[_0x2c90[26],_0x2c90[27],_0x2c90[28],_0x2c90[29],_0x2c90[30],_0x2c90[31]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x2c90[23]](function(_0x45f6x16){_0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_0x45f6x16)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[34]]= function(_0x45f6x12,_0x45f6x13){return ChatRoom[_0x2c90[34]]()[_0x2c90[23]](function(_0x45f6x17){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_0x45f6x17)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};function getChatQueues(_0x45f6x19){return function(){switch(_0x45f6x19[_0x2c90[30]]){case _0x2c90[38]:return User[_0x2c90[37]](_0x45f6x19[_0x2c90[26]],{attributes:[_0x2c90[26]]})[_0x2c90[23]](Util[_0x2c90[36]]({},{attributes:[_0x2c90[26]]}))[_0x2c90[23]](function(_0x45f6x1a){return {include:{model:ChatWebsite,include:{model:ChatApplication,include:{model:ChatQueue,where:{id:_[_0x2c90[35]](_0x45f6x1a,_0x2c90[26])}}}}}});default:return {}}}}exports[_0x2c90[39]]= function(_0x45f6x12,_0x45f6x13){return Promise[_0x2c90[44]]([])[_0x2c90[23]](getChatQueues(_0x45f6x12[_0x2c90[38]]))[_0x2c90[23]](function(_0x45f6x1c){return ChatRoom[_0x2c90[43]](_[_0x2c90[32]](Util[_0x2c90[25]](_0x45f6x12[_0x2c90[24]],{status:_0x2c90[40],updatedAt:{$gte:moment()[_0x2c90[42]](_0x2c90[41])}}),_0x45f6x1c))})[_0x2c90[23]](function(_0x45f6x1b){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]]({value:_0x45f6x1b})})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[45]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){var _0x45f6x1d={tags:_0x45f6x12[_0x2c90[47]][_0x2c90[46]]};var _0x45f6x1e={where:{id:_0x45f6x12[_0x2c90[50]][_0x2c90[26]][_0x2c90[49]](_0x2c90[48])}};return ChatRoom[_0x2c90[52]](_0x45f6x1d,_0x45f6x1e)[_0x2c90[23]](function(_0x45f6x1f){if(!_0x45f6x1f){return _0x45f6x13[_0x2c90[51]](404)};return _0x45f6x1f})[_0x2c90[23]](function(_0x45f6x1f){return _0x45f6x13[_0x2c90[51]](200)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};function checkTags(_0x45f6x21){if(_0x45f6x21){if(_0x45f6x21[_0x2c90[46]]){_0x45f6x21[_0x2c90[53]]= [];if(_[_0x2c90[54]](_0x45f6x21[_0x2c90[46]])){for(var _0x45f6x22=0;_0x45f6x22< _0x45f6x21[_0x2c90[46]][_0x2c90[55]];_0x45f6x22++){_0x45f6x21[_0x2c90[53]][_0x2c90[58]]({tags:{$like:_0x2c90[56]+ _0x45f6x21[_0x2c90[46]][_0x45f6x22]+ _0x2c90[57]}})}}else {_0x45f6x21[_0x2c90[53]][_0x2c90[58]]({tags:{$like:_0x2c90[56]+ _0x45f6x21[_0x2c90[46]]+ _0x2c90[57]}})};delete _0x45f6x21[_0x2c90[46]]}}}exports[_0x2c90[59]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){switch(_0x45f6x12[_0x2c90[38]][_0x2c90[30]]){case _0x2c90[38]:return User[_0x2c90[37]](_0x45f6x12[_0x2c90[38]][_0x2c90[26]],{attributes:[_0x2c90[26]],where:{id:{$ne:_0x45f6x12[_0x2c90[38]][_0x2c90[26]]},online:true}})[_0x2c90[23]](Util[_0x2c90[60]](_[_0x2c90[32]](_0x45f6x12[_0x2c90[24]],{id:{$ne:_0x45f6x12[_0x2c90[38]][_0x2c90[26]]}})))[_0x2c90[23]](function(_0x45f6x16){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_0x45f6x16)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)});default:return User[_0x2c90[61]](_0x2c90[44])[_0x2c90[33]](_[_0x2c90[32]](Util[_0x2c90[25]](_0x45f6x12[_0x2c90[24]]),{where:{id:{$ne:_0x45f6x12[_0x2c90[38]][_0x2c90[26]]},online:true}}))[_0x2c90[23]](function(_0x45f6x16){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_0x45f6x16)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})}};exports[_0x2c90[62]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){checkTags(_0x45f6x12[_0x2c90[24]]);var _0x45f6x23={where:_[_0x2c90[32]]({type:_0x2c90[63]},_0x45f6x12[_0x2c90[24]])};switch(_0x45f6x12[_0x2c90[38]][_0x2c90[30]]){case _0x2c90[64]:_[_0x2c90[32]](_0x45f6x23,{include:[{model:User,attributes:[_0x2c90[26]],where:{id:_0x45f6x12[_0x2c90[38]][_0x2c90[26]]}}]});break;default:};return ChatRoom[_0x2c90[66]](_0x45f6x23)[_0x2c90[23]](function(_0x45f6x1f){return ChatRoom[_0x2c90[66]]({where:{id:{$in:_[_0x2c90[35]](_0x45f6x1f,_0x2c90[26])}},include:[{model:User,attributes:[_0x2c90[26],_0x2c90[27],_0x2c90[28],_0x2c90[30],_0x2c90[65]]},{model:ChatVisitor}]})})[_0x2c90[23]](function(_0x45f6x1f){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]]({rows:_0x45f6x1f,count:_0x45f6x1f[_0x2c90[55]]})})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[67]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){checkTags(_0x45f6x12[_0x2c90[24]]);var _0x45f6x23={where:_[_0x2c90[32]]({type:_0x2c90[68]},_0x45f6x12[_0x2c90[24]]),include:[{model:ChatVisitor,attributes:[_0x2c90[26],_0x2c90[28]]}]};switch(_0x45f6x12[_0x2c90[38]][_0x2c90[30]]){case _0x2c90[64]:_0x45f6x23[_0x2c90[69]][_0x2c90[58]]({model:User,attributes:[_0x2c90[26]],where:{id:_0x45f6x12[_0x2c90[38]][_0x2c90[26]]}});break;default:};return ChatRoom[_0x2c90[66]](_0x45f6x23)[_0x2c90[23]](function(_0x45f6x1f){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]]({rows:_0x45f6x1f,count:_0x45f6x1f[_0x2c90[55]]})})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[70]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){return User[_0x2c90[61]](_0x2c90[44])[_0x2c90[37]](_0x45f6x12[_0x2c90[50]][_0x2c90[26]])[_0x2c90[23]](function(_0x45f6x16){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_0x45f6x16)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[71]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){return ChatRoom[_0x2c90[61]](_0x2c90[72])[_0x2c90[33]](_[_0x2c90[32]](Util[_0x2c90[25]](_0x45f6x12[_0x2c90[24]]),{include:[{model:User,attributes:[_0x2c90[26],_0x2c90[27],_0x2c90[28],_0x2c90[29],_0x2c90[30],_0x2c90[31]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x2c90[23]](function(_0x45f6x16){_0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_0x45f6x16)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[73]]= function(_0x45f6x12,_0x45f6x13){return User[_0x2c90[37]](_0x45f6x12[_0x2c90[38]][_0x2c90[26]])[_0x2c90[23]](function(_0x45f6x19){return _0x45f6x19[_0x2c90[74]]({include:[{model:ChatVisitor,attributes:[_0x2c90[26],_0x2c90[28],_0x2c90[29]]},{model:User,attributes:[_0x2c90[26],_0x2c90[27],_0x2c90[28],_0x2c90[29],_0x2c90[30],_0x2c90[31]]}]})})[_0x2c90[23]](function(_0x45f6x1f){if(!_0x45f6x1f){return _0x45f6x13[_0x2c90[51]](404)};return _0x45f6x13[_0x2c90[21]](_0x45f6x1f)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[75]]= function(_0x45f6x12,_0x45f6x13){return ChatRoom[_0x2c90[37]](_0x45f6x12[_0x2c90[50]][_0x2c90[26]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x2c90[26],_0x2c90[29],_0x2c90[28]]},{model:User,attributes:[_0x2c90[26],_0x2c90[29],_0x2c90[27],_0x2c90[28],_0x2c90[65],_0x2c90[30],_0x2c90[31]]}]},{model:User,attributes:[_0x2c90[26],_0x2c90[29],_0x2c90[27],_0x2c90[28],_0x2c90[65],_0x2c90[30],_0x2c90[31]]},{model:ChatVisitor},{model:ChatWebsite,attributes:[_0x2c90[26],_0x2c90[27],_0x2c90[76]],include:[List]}],order:[[ChatMessage,_0x2c90[26]]]})[_0x2c90[23]](function(_0x45f6x24){if(!_0x45f6x24){return _0x45f6x13[_0x2c90[51]](404)};return _0x45f6x13[_0x2c90[21]](_0x45f6x24)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[77]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){var _0x45f6x25;return ChatRoom[_0x2c90[87]]({where:{token:md5(JSON[_0x2c90[85]](_0x45f6x12[_0x2c90[24]][_0x2c90[80]][_0x2c90[84]]())).toString(_0x2c90[83])},defaults:{type:_0x2c90[31],token:md5(JSON[_0x2c90[85]](_0x45f6x12[_0x2c90[24]][_0x2c90[80]][_0x2c90[84]]())).toString(_0x2c90[83]),status:_0x2c90[86]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x2c90[26],_0x2c90[29],_0x2c90[28]]},{model:User,attributes:[_0x2c90[26],_0x2c90[27],_0x2c90[28],_0x2c90[29],_0x2c90[30],_0x2c90[31]]}]},{model:User,attributes:[_0x2c90[26],_0x2c90[27],_0x2c90[28],_0x2c90[29],_0x2c90[30],_0x2c90[31]]}]})[_0x2c90[82]](function(_0x45f6x24,_0x45f6x27){_0x45f6x25= _0x45f6x24;if(_0x45f6x27){return _0x45f6x25[_0x2c90[81]](_0x45f6x12[_0x2c90[24]][_0x2c90[80]])}})[_0x2c90[23]](function(){return _0x45f6x25[_0x2c90[79]]()})[_0x2c90[23]](function(_0x45f6x26){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_[_0x2c90[32]](_0x45f6x25[_0x2c90[78]],{Users:_0x45f6x26}))})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[88]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){var _0x45f6x25;return ChatRoom[_0x2c90[37]](_0x45f6x12[_0x2c90[50]][_0x2c90[26]])[_0x2c90[23]](function(_0x45f6x24){_0x45f6x25= _0x45f6x24;if(!_0x45f6x25){return _0x45f6x13[_0x2c90[51]](404)}})[_0x2c90[23]](function(){return ChatMessage[_0x2c90[90]](_[_0x2c90[32]](_0x45f6x12[_0x2c90[47]],{type:_0x45f6x25[_0x2c90[89]],ChatRoomId:_0x45f6x12[_0x2c90[50]][_0x2c90[26]],UserId:_0x45f6x12[_0x2c90[38]][_0x2c90[26]]}))})[_0x2c90[23]](function(_0x45f6x28){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_0x45f6x28)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[91]]= function(_0x45f6x12,_0x45f6x13,_0x45f6x14){return ChatRoom[_0x2c90[37]](_0x45f6x12[_0x2c90[50]][_0x2c90[26]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x2c90[26],_0x2c90[28]]},{model:User,attributes:[_0x2c90[26],_0x2c90[28]]}]}]})[_0x2c90[23]](function(_0x45f6x24){var _0x45f6x29=[];_0x45f6x24[_0x2c90[96]][_0x2c90[95]](function(_0x45f6x28){_0x45f6x29[_0x2c90[58]]({name:_0x45f6x28[_0x2c90[9]]?_0x45f6x28[_0x2c90[9]][_0x2c90[28]]:_0x45f6x28[_0x2c90[16]][_0x2c90[28]],text:_0x45f6x28[_0x2c90[47]][_0x2c90[93]](/(\r\n|\n|\r)/gm,_0x2c90[92]),date:_0x45f6x28[_0x2c90[94]]})});return _0x45f6x13[_0x2c90[89]](_0x2c90[97])[_0x2c90[22]](200)[_0x2c90[21]](csv(_0x45f6x29))})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[98]]= function(_0x45f6x12,_0x45f6x13){return User[_0x2c90[37]](_0x45f6x12[_0x2c90[38]][_0x2c90[26]])[_0x2c90[23]](function(_0x45f6x19){return _0x45f6x19[_0x2c90[74]]({where:{type:_0x45f6x12[_0x2c90[50]][_0x2c90[89]]},include:[{model:ChatVisitor,attributes:[_0x2c90[26],_0x2c90[28],_0x2c90[29]]}]})})[_0x2c90[23]](function(_0x45f6x1f){if(!_0x45f6x1f){return _0x45f6x13[_0x2c90[51]](404)};return _0x45f6x13[_0x2c90[21]](_0x45f6x1f)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[99]]= function(_0x45f6x12,_0x45f6x13){return User[_0x2c90[37]](_0x45f6x12[_0x2c90[38]][_0x2c90[26]])[_0x2c90[23]](function(_0x45f6x19){return _0x45f6x19[_0x2c90[74]]({include:[{model:ChatVisitor,attributes:[_0x2c90[26],_0x2c90[28],_0x2c90[29]]},{model:User,attributes:[_0x2c90[26],_0x2c90[27],_0x2c90[28],_0x2c90[29],_0x2c90[30],_0x2c90[31]]}]})})[_0x2c90[23]](function(_0x45f6x1f){if(!_0x45f6x1f){return _0x45f6x13[_0x2c90[51]](404)};return _0x45f6x13[_0x2c90[21]](_0x45f6x1f)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[90]]= function(_0x45f6x12,_0x45f6x13){};exports[_0x2c90[52]]= function(_0x45f6x12,_0x45f6x13){if(_0x45f6x12[_0x2c90[47]][_0x2c90[26]]){delete _0x45f6x12[_0x2c90[47]][_0x2c90[26]]};return ChatRoom[_0x2c90[37]](_0x45f6x12[_0x2c90[50]][_0x2c90[26]])[_0x2c90[23]](function(_0x45f6x24){if(!_0x45f6x24){return _0x45f6x13[_0x2c90[51]](404)};return _0x45f6x24[_0x2c90[52]](_0x45f6x12[_0x2c90[47]])})[_0x2c90[23]](function(_0x45f6x24){return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_0x45f6x24)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[100]]= function(_0x45f6x12,_0x45f6x13){var _0x45f6x25;if(_0x45f6x12[_0x2c90[47]][_0x2c90[26]]){delete _0x45f6x12[_0x2c90[47]][_0x2c90[26]]};return ChatRoom[_0x2c90[37]](_0x45f6x12[_0x2c90[50]][_0x2c90[26]])[_0x2c90[23]](function(_0x45f6x24){if(!_0x45f6x24||  !_0x45f6x12[_0x2c90[47]][_0x2c90[80]]){return _0x45f6x13[_0x2c90[51]](404)};return _0x45f6x24})[_0x2c90[23]](function(_0x45f6x24){return _0x45f6x24[_0x2c90[52]]({type:_0x2c90[63],token:md5(JSON[_0x2c90[85]](_0x45f6x12[_0x2c90[47]][_0x2c90[80]][_0x2c90[84]]())).toString(_0x2c90[83])})})[_0x2c90[23]](function(_0x45f6x24){_0x45f6x25= _0x45f6x24;return _0x45f6x24[_0x2c90[81]](_0x45f6x12[_0x2c90[47]][_0x2c90[80]][_0x2c90[84]](),{individualHooks:true})})[_0x2c90[23]](function(){return _0x45f6x25[_0x2c90[79]]()})[_0x2c90[23]](function(_0x45f6x26){_[_0x2c90[32]](_0x45f6x25[_0x2c90[78]],{Users:_0x45f6x26});return _0x45f6x13[_0x2c90[22]](200)[_0x2c90[21]](_0x45f6x25)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};exports[_0x2c90[101]]= function(_0x45f6x12,_0x45f6x13){return ChatRoom[_0x2c90[37]](_0x45f6x12[_0x2c90[50]][_0x2c90[26]])[_0x2c90[23]](function(_0x45f6x24){if(!_0x45f6x24){return _0x45f6x13[_0x2c90[51]](404)};return _0x45f6x24[_0x2c90[101]]()})[_0x2c90[23]](function(){return _0x45f6x13[_0x2c90[51]](204)})[_0x2c90[20]](function(_0x45f6x15){return handleError(_0x45f6x13,_0x45f6x15)})};function handleError(_0x45f6x13,_0x45f6x15){logger[_0x2c90[103]](_0x45f6x15[_0x2c90[102]]);return _0x45f6x13[_0x2c90[22]](500)[_0x2c90[21]](_0x45f6x15)}
\ No newline at end of file
+var _0x8851=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x64\x35","\x6D\x6F\x6D\x65\x6E\x74","\x74\x6F\x2D\x63\x73\x76","\x75\x74\x69\x6C","\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","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65","\x43\x68\x61\x74\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x4C\x69\x73\x74","\x55\x73\x65\x72\x48\x61\x73\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x63\x61\x74\x63\x68","\x73\x74\x61\x74\x75\x73","\x6B\x65\x79\x42\x79","\x63\x6F\x75\x6E\x74","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x6D\x65\x72\x67\x65","\x73\x65\x6E\x64","\x74\x68\x65\x6E","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x63\x68\x61\x74\x5F\x72\x6F\x6F\x6D\x73\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x71\x75\x65\x72\x79","\x69\x6E\x64\x65\x78","\x67\x65\x74\x51\x75\x65\x72\x79","\x69\x64","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x72\x6F\x6C\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x6D\x61\x70","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x61\x6C\x6C","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x74\x61\x67\x73","\x62\x6F\x64\x79","\x2C","\x73\x70\x6C\x69\x74","\x70\x61\x72\x61\x6D\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x75\x70\x64\x61\x74\x65","\x24\x61\x6E\x64","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x25","\x3B\x25","\x70\x75\x73\x68","\x67\x65\x74\x41\x67\x65\x6E\x74\x73","\x67\x65\x74\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x47\x72\x6F\x75\x70\x73","\x67\x72\x6F\x75\x70","\x61\x67\x65\x6E\x74","\x75\x73\x65\x72\x70\x69\x63","\x66\x69\x6E\x64\x41\x6C\x6C","\x67\x65\x74\x45\x78\x74\x65\x72\x6E\x61\x6C\x73","\x65\x78\x74\x65\x72\x6E\x61\x6C","\x69\x6E\x63\x6C\x75\x64\x65","\x67\x65\x74\x41\x67\x65\x6E\x74","\x67\x65\x74\x4F\x6E\x6C\x69\x6E\x65\x52\x6F\x6F\x6D","\x6F\x6E\x6C\x69\x6E\x65","\x6D\x65","\x67\x65\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x73","\x73\x68\x6F\x77","\x61\x64\x64\x72\x65\x73\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x55\x73\x65\x72\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x67\x65\x74\x55\x73\x65\x72\x73","\x75\x73\x65\x72\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x73\x70\x72\x65\x61\x64","\x62\x61\x73\x65\x36\x34","\x73\x6F\x72\x74","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x4F\x50\x45\x4E","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x63\x72\x65\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x63\x72\x65\x61\x74\x65","\x65\x78\x70\x6F\x72\x74","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x66\x6F\x72\x45\x61\x63\x68","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x74\x65\x78\x74\x2F\x63\x73\x76","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x54\x79\x70\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x47\x72\x6F\x75\x70\x73","\x75\x70\x64\x61\x74\x65\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x8851[0];var _=require(_0x8851[1]);var md5=require(_0x8851[2]);var moment=require(_0x8851[3]);var csv=require(_0x8851[4]);var util=require(_0x8851[5]);var logger=require(_0x8851[7])(_0x8851[6]);var Util=require(_0x8851[8]);var sequelize=require(_0x8851[10])[_0x8851[9]];var User=require(_0x8851[10])[_0x8851[11]];var Agent=require(_0x8851[10])[_0x8851[11]];var ChatRoom=require(_0x8851[10])[_0x8851[12]];var ChatMessage=require(_0x8851[10])[_0x8851[13]];var ChatWebsite=require(_0x8851[10])[_0x8851[14]];var ChatApplication=require(_0x8851[10])[_0x8851[15]];var ChatQueue=require(_0x8851[10])[_0x8851[16]];var ChatVisitor=require(_0x8851[10])[_0x8851[17]];var List=require(_0x8851[10])[_0x8851[18]];var UserHasChatRoom=require(_0x8851[10])[_0x8851[19]];exports[_0x8851[20]]= function(_0xdb17x13,_0xdb17x14){return sequelize[_0x8851[32]](_0x8851[29],{type:sequelize[_0x8851[31]][_0x8851[30]]})[_0x8851[28]](function(_0xdb17x16){var _0xdb17x17=_[_0x8851[26]]({new:0,open:0,closed:0,abandon:0,unmanaged:0},_[_0x8851[25]](_[_0x8851[23]](_0xdb17x16,_0x8851[22]),_0x8851[24]));return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x17)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[33]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){return ChatRoom[_0x8851[41]](_[_0x8851[26]](Util[_0x8851[34]](_0xdb17x13[_0x8851[32]]),{include:[{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x8851[28]](function(_0xdb17x19){_0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[42]]= function(_0xdb17x13,_0xdb17x14){return ChatRoom[_0x8851[42]]()[_0x8851[28]](function(_0xdb17x1a){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x1a)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};function getChatQueues(_0xdb17x1c){return function(){switch(_0xdb17x1c[_0x8851[39]]){case _0x8851[46]:return User[_0x8851[45]](_0xdb17x1c[_0x8851[35]],{attributes:[_0x8851[35]]})[_0x8851[28]](Util[_0x8851[44]]({},{attributes:[_0x8851[35]]}))[_0x8851[28]](function(_0xdb17x1d){return {include:{model:ChatWebsite,include:{model:ChatApplication,include:{model:ChatQueue,where:{id:_[_0x8851[43]](_0xdb17x1d,_0x8851[35])}}}}}});default:return {}}}}exports[_0x8851[47]]= function(_0xdb17x13,_0xdb17x14){return Promise[_0x8851[51]]([])[_0x8851[28]](getChatQueues(_0xdb17x13[_0x8851[46]]))[_0x8851[28]](function(_0xdb17x1f){return ChatRoom[_0x8851[24]](_[_0x8851[26]](Util[_0x8851[34]](_0xdb17x13[_0x8851[32]],{status:_0x8851[48],updatedAt:{$gte:moment()[_0x8851[50]](_0x8851[49])}}),_0xdb17x1f))})[_0x8851[28]](function(_0xdb17x1e){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]]({value:_0xdb17x1e})})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[52]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){var _0xdb17x20={tags:_0xdb17x13[_0x8851[54]][_0x8851[53]]};var _0xdb17x21={where:{id:_0xdb17x13[_0x8851[57]][_0x8851[35]][_0x8851[56]](_0x8851[55])}};return ChatRoom[_0x8851[59]](_0xdb17x20,_0xdb17x21)[_0x8851[28]](function(_0xdb17x22){if(!_0xdb17x22){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x22})[_0x8851[28]](function(_0xdb17x22){return _0xdb17x14[_0x8851[58]](200)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};function checkTags(_0xdb17x24){if(_0xdb17x24){if(_0xdb17x24[_0x8851[53]]){_0xdb17x24[_0x8851[60]]= [];if(_[_0x8851[61]](_0xdb17x24[_0x8851[53]])){for(var _0xdb17x25=0;_0xdb17x25< _0xdb17x24[_0x8851[53]][_0x8851[62]];_0xdb17x25++){_0xdb17x24[_0x8851[60]][_0x8851[65]]({tags:{$like:_0x8851[63]+ _0xdb17x24[_0x8851[53]][_0xdb17x25]+ _0x8851[64]}})}}else {_0xdb17x24[_0x8851[60]][_0x8851[65]]({tags:{$like:_0x8851[63]+ _0xdb17x24[_0x8851[53]]+ _0x8851[64]}})};delete _0xdb17x24[_0x8851[53]]}}}exports[_0x8851[66]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){switch(_0xdb17x13[_0x8851[46]][_0x8851[39]]){case _0x8851[46]:return User[_0x8851[45]](_0xdb17x13[_0x8851[46]][_0x8851[35]],{attributes:[_0x8851[35]],where:{id:{$ne:_0xdb17x13[_0x8851[46]][_0x8851[35]]},online:true}})[_0x8851[28]](Util[_0x8851[67]](_[_0x8851[26]](_0xdb17x13[_0x8851[32]],{id:{$ne:_0xdb17x13[_0x8851[46]][_0x8851[35]]}})))[_0x8851[28]](function(_0xdb17x19){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)});default:return User[_0x8851[68]](_0x8851[51])[_0x8851[41]](_[_0x8851[26]](Util[_0x8851[34]](_0xdb17x13[_0x8851[32]]),{where:{id:{$ne:_0xdb17x13[_0x8851[46]][_0x8851[35]]},online:true}}))[_0x8851[28]](function(_0xdb17x19){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})}};exports[_0x8851[69]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){checkTags(_0xdb17x13[_0x8851[32]]);var _0xdb17x26={where:_[_0x8851[26]]({type:_0x8851[70]},_0xdb17x13[_0x8851[32]])};switch(_0xdb17x13[_0x8851[46]][_0x8851[39]]){case _0x8851[71]:_[_0x8851[26]](_0xdb17x26,{include:[{model:User,attributes:[_0x8851[35]],where:{id:_0xdb17x13[_0x8851[46]][_0x8851[35]]}}]});break;default:};return ChatRoom[_0x8851[73]](_0xdb17x26)[_0x8851[28]](function(_0xdb17x22){return ChatRoom[_0x8851[73]]({where:{id:{$in:_[_0x8851[43]](_0xdb17x22,_0x8851[35])}},include:[{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[39],_0x8851[72]]},{model:ChatVisitor}]})})[_0x8851[28]](function(_0xdb17x22){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]]({rows:_0xdb17x22,count:_0xdb17x22[_0x8851[62]]})})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[74]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){checkTags(_0xdb17x13[_0x8851[32]]);var _0xdb17x26={where:_[_0x8851[26]]({type:_0x8851[75]},_0xdb17x13[_0x8851[32]]),include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37]]}]};switch(_0xdb17x13[_0x8851[46]][_0x8851[39]]){case _0x8851[71]:_0xdb17x26[_0x8851[76]][_0x8851[65]]({model:User,attributes:[_0x8851[35]],where:{id:_0xdb17x13[_0x8851[46]][_0x8851[35]]}});break;default:};return ChatRoom[_0x8851[73]](_0xdb17x26)[_0x8851[28]](function(_0xdb17x22){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]]({rows:_0xdb17x22,count:_0xdb17x22[_0x8851[62]]})})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[77]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){return User[_0x8851[68]](_0x8851[51])[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x19){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[78]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){return ChatRoom[_0x8851[68]](_0x8851[79])[_0x8851[41]](_[_0x8851[26]](Util[_0x8851[34]](_0xdb17x13[_0x8851[32]]),{include:[{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x8851[28]](function(_0xdb17x19){_0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[80]]= function(_0xdb17x13,_0xdb17x14){return User[_0x8851[45]](_0xdb17x13[_0x8851[46]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x1c){return _0xdb17x1c[_0x8851[81]]({include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37],_0x8851[38]]},{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]}]})})[_0x8851[28]](function(_0xdb17x22){if(!_0xdb17x22){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x14[_0x8851[27]](_0xdb17x22)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[82]]= function(_0xdb17x13,_0xdb17x14){return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[38],_0x8851[37]]},{model:User,attributes:[_0x8851[35],_0x8851[38],_0x8851[36],_0x8851[37],_0x8851[72],_0x8851[39],_0x8851[40]]}]},{model:User,attributes:[_0x8851[35],_0x8851[38],_0x8851[36],_0x8851[37],_0x8851[72],_0x8851[39],_0x8851[40]]},{model:ChatVisitor},{model:ChatWebsite,attributes:[_0x8851[35],_0x8851[36],_0x8851[83]],include:[List]}],order:[[ChatMessage,_0x8851[35]]]})[_0x8851[28]](function(_0xdb17x27){if(!_0xdb17x27){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x14[_0x8851[27]](_0xdb17x27)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[84]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){var _0xdb17x28;return ChatRoom[_0x8851[94]]({where:{token:md5(JSON[_0x8851[92]](_0xdb17x13[_0x8851[32]][_0x8851[87]][_0x8851[91]]())).toString(_0x8851[90])},defaults:{type:_0x8851[40],token:md5(JSON[_0x8851[92]](_0xdb17x13[_0x8851[32]][_0x8851[87]][_0x8851[91]]())).toString(_0x8851[90]),status:_0x8851[93]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[38],_0x8851[37]]},{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]}]},{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]}]})[_0x8851[89]](function(_0xdb17x27,_0xdb17x2a){_0xdb17x28= _0xdb17x27;if(_0xdb17x2a){return _0xdb17x28[_0x8851[88]](_0xdb17x13[_0x8851[32]][_0x8851[87]])}})[_0x8851[28]](function(){return _0xdb17x28[_0x8851[86]]()})[_0x8851[28]](function(_0xdb17x29){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_[_0x8851[26]](_0xdb17x28[_0x8851[85]],{Users:_0xdb17x29}))})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[95]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){var _0xdb17x28;return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x27){_0xdb17x28= _0xdb17x27;if(!_0xdb17x28){return _0xdb17x14[_0x8851[58]](404)}})[_0x8851[28]](function(){return ChatMessage[_0x8851[97]](_[_0x8851[26]](_0xdb17x13[_0x8851[54]],{type:_0xdb17x28[_0x8851[96]],ChatRoomId:_0xdb17x13[_0x8851[57]][_0x8851[35]],UserId:_0xdb17x13[_0x8851[46]][_0x8851[35]]}))})[_0x8851[28]](function(_0xdb17x2b){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x2b)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[98]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37]]},{model:User,attributes:[_0x8851[35],_0x8851[37]]}]}]})[_0x8851[28]](function(_0xdb17x27){var _0xdb17x2c=[];_0xdb17x27[_0x8851[103]][_0x8851[102]](function(_0xdb17x2b){_0xdb17x2c[_0x8851[65]]({name:_0xdb17x2b[_0x8851[11]]?_0xdb17x2b[_0x8851[11]][_0x8851[37]]:_0xdb17x2b[_0x8851[17]][_0x8851[37]],text:_0xdb17x2b[_0x8851[54]][_0x8851[100]](/(\r\n|\n|\r)/gm,_0x8851[99]),date:_0xdb17x2b[_0x8851[101]]})});return _0xdb17x14[_0x8851[96]](_0x8851[104])[_0x8851[22]](200)[_0x8851[27]](csv(_0xdb17x2c))})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[105]]= function(_0xdb17x13,_0xdb17x14){return User[_0x8851[45]](_0xdb17x13[_0x8851[46]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x1c){return _0xdb17x1c[_0x8851[81]]({where:{type:_0xdb17x13[_0x8851[57]][_0x8851[96]]},include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37],_0x8851[38]]}]})})[_0x8851[28]](function(_0xdb17x22){if(!_0xdb17x22){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x14[_0x8851[27]](_0xdb17x22)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[106]]= function(_0xdb17x13,_0xdb17x14){return User[_0x8851[45]](_0xdb17x13[_0x8851[46]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x1c){return _0xdb17x1c[_0x8851[81]]({include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37],_0x8851[38]]},{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]}]})})[_0x8851[28]](function(_0xdb17x22){if(!_0xdb17x22){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x14[_0x8851[27]](_0xdb17x22)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[97]]= function(_0xdb17x13,_0xdb17x14){};exports[_0x8851[59]]= function(_0xdb17x13,_0xdb17x14){if(_0xdb17x13[_0x8851[54]][_0x8851[35]]){delete _0xdb17x13[_0x8851[54]][_0x8851[35]]};return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x27){if(!_0xdb17x27){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x27[_0x8851[59]](_0xdb17x13[_0x8851[54]])})[_0x8851[28]](function(_0xdb17x27){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x27)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[107]]= function(_0xdb17x13,_0xdb17x14){var _0xdb17x28;if(_0xdb17x13[_0x8851[54]][_0x8851[35]]){delete _0xdb17x13[_0x8851[54]][_0x8851[35]]};return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x27){if(!_0xdb17x27||  !_0xdb17x13[_0x8851[54]][_0x8851[87]]){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x27})[_0x8851[28]](function(_0xdb17x27){return _0xdb17x27[_0x8851[59]]({type:_0x8851[70],token:md5(JSON[_0x8851[92]](_0xdb17x13[_0x8851[54]][_0x8851[87]][_0x8851[91]]())).toString(_0x8851[90])})})[_0x8851[28]](function(_0xdb17x27){_0xdb17x28= _0xdb17x27;return _0xdb17x27[_0x8851[88]](_0xdb17x13[_0x8851[54]][_0x8851[87]][_0x8851[91]](),{individualHooks:true})})[_0x8851[28]](function(){return _0xdb17x28[_0x8851[86]]()})[_0x8851[28]](function(_0xdb17x29){_[_0x8851[26]](_0xdb17x28[_0x8851[85]],{Users:_0xdb17x29});return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x28)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[108]]= function(_0xdb17x13,_0xdb17x14){return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x27){if(!_0xdb17x27){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x27[_0x8851[108]]()})[_0x8851[28]](function(){return _0xdb17x14[_0x8851[58]](204)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};function handleError(_0xdb17x14,_0xdb17x15){logger[_0x8851[110]](_0xdb17x15[_0x8851[109]]);return _0xdb17x14[_0x8851[22]](500)[_0x8851[27]](_0xdb17x15)}
\ No newline at end of file