Built motion from commit 344422e17.|1.0.22
[motion.git] / server / api / report_chat_session / report_chat_session.socket.js
1 var _0x96c6=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x2E\x2F\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x73\x65\x73\x73\x69\x6F\x6E\x2E\x65\x76\x65\x6E\x74\x73","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6C\x6F\x64\x61\x73\x68","\x62\x6C\x75\x65\x62\x69\x72\x64","\x73\x61\x76\x65","\x72\x65\x6D\x6F\x76\x65","\x72\x65\x67\x69\x73\x74\x65\x72","\x6C\x65\x6E\x67\x74\x68","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x73\x65\x73\x73\x69\x6F\x6E\x3A","\x6F\x6E","\x64\x69\x73\x63\x6F\x6E\x6E\x65\x63\x74","\x72\x65\x6D\x6F\x76\x65\x4C\x69\x73\x74\x65\x6E\x65\x72","\x69\x64","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x72\x6F\x77\x73","\x74\x68\x65\x6E","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x75\x73\x65\x72\x49\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x72\x6F\x6C\x65","\x45\x72\x72\x6F\x72\x20\x66\x69\x6C\x74\x65\x72\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74\x20\x63\x68\x61\x74\x20\x73\x65\x73\x73\x69\x6F\x6E\x73\x20\x61\x66\x74\x65\x72\x20\x73\x61\x76\x65","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x61\x64\x6D\x69\x6E","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x71\x75\x65\x75\x65","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x73\x65\x73\x73\x69\x6F\x6E\x3A\x73\x61\x76\x65","\x65\x6D\x69\x74","\x61\x6C\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x73\x65\x73\x73\x69\x6F\x6E\x3A\x72\x65\x6D\x6F\x76\x65"];_0x96c6[0];const ReportChatSessionEvents=require(_0x96c6[1]);const ReportChatSession=require(_0x96c6[3])[_0x96c6[2]];const User=require(_0x96c6[3])[_0x96c6[4]];const Util=require(_0x96c6[5]);const _=require(_0x96c6[6]);const Promise=require(_0x96c6[7]);var events=[_0x96c6[8],_0x96c6[9]];exports[_0x96c6[10]]= function(_0xe06bx8){for(var _0xe06bx9=0,_0xe06bxa=events[_0x96c6[11]];_0xe06bx9< _0xe06bxa;_0xe06bx9++){var _0xe06bxb=events[_0xe06bx9];var _0xe06bxc=createListener(_0x96c6[12]+ _0xe06bxb,_0xe06bx8);ReportChatSessionEvents[_0x96c6[13]](_0xe06bxb,_0xe06bxc);_0xe06bx8[_0x96c6[13]](_0x96c6[14],removeListener(_0xe06bxb,_0xe06bxc))}};function createListener(_0xe06bxb,_0xe06bx8){return function(_0xe06bxe){onSave(_0xe06bx8,_0xe06bxe)}}function removeListener(_0xe06bxb,_0xe06bxc){return function(){ReportChatSessionEvents[_0x96c6[15]](_0xe06bxb,_0xe06bxc)}}function getChatQueues(_0xe06bx11){return function(){switch(_0xe06bx11[_0x96c6[28]]){case _0x96c6[25]:return User[_0x96c6[24]](_0xe06bx11[_0x96c6[23]],{attributes:[_0x96c6[16]]})[_0x96c6[21]](Util[_0x96c6[22]]({},{attributes:[_0x96c6[16]],include:[{raw:true,model:User,attributes:[_0x96c6[16]]}]}))[_0x96c6[21]](function(_0xe06bx12){var _0xe06bx13=[];_0xe06bx12[_0x96c6[20]][_0x96c6[19]](function(_0xe06bx14){_0xe06bx13= _[_0x96c6[18]](_0xe06bx13,_[_0x96c6[17]](_0xe06bx14.Users,_0x96c6[16]))});return {queue:_[_0x96c6[17]](_0xe06bx12[_0x96c6[20]],_0x96c6[16]),memberid:_0xe06bx13}});case _0x96c6[27]:return User[_0x96c6[24]](_0xe06bx11[_0x96c6[23]],{attributes:[_0x96c6[16]]})[_0x96c6[21]](function(_0xe06bx15){return _0xe06bx15[_0x96c6[26]]({attributes:[_0x96c6[16]]})})[_0x96c6[21]](function(_0xe06bx12){return {queue:_[_0x96c6[17]](_0xe06bx12,_0x96c6[16]),memberid:_0xe06bx11[_0x96c6[23]]}});default:return {}}}}function onSave(_0xe06bx8,_0xe06bxe,_0xe06bx17){return Promise[_0x96c6[38]]([])[_0x96c6[21]](getChatQueues(_0xe06bx8))[_0x96c6[21]](function(_0xe06bx19){if(_0xe06bx8[_0x96c6[28]]=== _0x96c6[32]|| _[_0x96c6[34]](_0xe06bx19[_0x96c6[33]],_0xe06bxe[_0x96c6[33]])|| _[_0x96c6[34]](_0xe06bx19[_0x96c6[35]],_0xe06bxe[_0x96c6[35]])){_0xe06bx8[_0x96c6[37]](_0x96c6[36],_0xe06bxe)}})[_0x96c6[31]](function(_0xe06bx18){console[_0x96c6[30]](_0x96c6[29],_0xe06bx18)})}function onRemove(_0xe06bx8,_0xe06bxe,_0xe06bx17){_0xe06bx8[_0x96c6[37]](_0x96c6[39],_0xe06bxe)}