Built motion from commit 2238b68.|1.0.18
[motion.git] / server / config / util / index.js
index 7deca85..12b63b2 100644 (file)
@@ -1 +1 @@
-var _0x6b7f=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x46\x61\x78\x51\x75\x65\x75\x65","\x53\x6D\x73\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x41\x63\x74\x69\x6F\x6E","\x2C","\x73\x70\x6C\x69\x74","\x2A","\x2D","\x74\x5F\x66\x72\x6F\x6D","\x48\x48\x3A\x6D\x6D","\x74\x5F\x74\x6F","\x77\x64\x5F\x66\x72\x6F\x6D","\x77\x64\x5F\x74\x6F","\x6D\x64\x5F\x66\x72\x6F\x6D","\x6D\x64\x5F\x74\x6F","\x6D\x5F\x66\x72\x6F\x6D","\x6D\x5F\x74\x6F","\x66\x6F\x72\x45\x61\x63\x68","\x66\x6F\x72\x6D\x61\x74","\x45","\x44","\x4D","\x70\x75\x73\x68","\x69\x73\x41\x66\x74\x65\x72","\x5B\x5D","\x69\x73\x42\x65\x74\x77\x65\x65\x6E","\x66\x69\x6C\x74\x65\x72","\x69\x6E\x64\x65\x78\x4F\x66","\x54\x69\x6D\x65\x20\x69\x73\x20","\x2C\x20\x57\x65\x65\x6B\x44\x61\x79\x20\x69\x73\x20","\x2C\x20\x4D\x6F\x6E\x74\x68\x44\x61\x79\x20\x69\x73\x20","\x2C\x20\x4D\x6F\x6E\x74\x68\x20\x69\x73\x20","\x6C\x6F\x67","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D","\x69\x73\x56\x61\x6C\x69\x64","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x64\x61\x79\x53\x74\x61\x72\x74","\x65\x6E\x64\x4F\x66","\x64\x61\x79\x45\x6E\x64","\x5F\x75\x69\x46\x72\x6F\x6D","\x69\x6E\x63\x6C\x75\x64\x65\x73","","\x72\x65\x70\x6C\x61\x63\x65","\x5F\x75\x69\x54\x6F","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x6F\x66\x66\x73\x65\x74","\x6C\x69\x6D\x69\x74","\x6F\x72\x64\x65\x72","\x74\x79\x70\x65","\x70\x61\x72\x65\x6E\x74","\x25","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x74\x68\x65\x6E","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x50\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x69\x64","\x67\x65\x74\x50\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x63\x68\x65\x63\x6B\x50\x61\x75\x73\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x51\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x4F\x6E\x6C\x69\x6E\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x53\x69\x70\x53\x74\x61\x74\x75\x73","\x75\x6E\x69\x6F\x6E","\x73\x75\x62\x73\x74\x72","\x2F","\x6C\x65\x6E\x67\x74\x68","\x47\x45\x54","\x50\x4F\x53\x54","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x4D\x65\x74\x68\x6F\x64","\x41\x63\x74\x69\x6F\x6E\x20\x46\x61\x69\x6C\x65\x64","\x63\x61\x74\x63\x68","\x41\x63\x74\x69\x6F\x6E\x20\x53\x75\x63\x63\x65\x73\x73\x66\x75\x6C","\x61\x63\x74\x69\x6F\x6E","\x44\x45\x46\x41\x55\x4C\x54\x20\x50\x41\x55\x53\x45","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x63\x72\x65\x61\x74\x65","\x70\x61\x75\x73\x65","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x41\x63\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x73","\x2E\x2F\x65\x72\x72\x6F\x72"];_0x6b7f[0];var _=require(_0x6b7f[1]);var moment=require(_0x6b7f[2]);var request=require(_0x6b7f[3]);var User=require(_0x6b7f[5])[_0x6b7f[4]];var VoiceQueue=require(_0x6b7f[5])[_0x6b7f[6]];var ChatQueue=require(_0x6b7f[5])[_0x6b7f[7]];var MailQueue=require(_0x6b7f[5])[_0x6b7f[8]];var FaxQueue=require(_0x6b7f[5])[_0x6b7f[9]];var SmsQueue=require(_0x6b7f[5])[_0x6b7f[10]];var OpenchannelQueue=require(_0x6b7f[5])[_0x6b7f[11]];var Action=require(_0x6b7f[5])[_0x6b7f[12]];var weekDaysCollection={mon:1,tue:2,wed:3,thu:4,fri:5,sat:6,sun:7};var monthsCollection={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12};function splitInterval(_0xffc2xf){var _0xffc2x10={};var _0xffc2x11=_0xffc2xf[_0x6b7f[14]](_0x6b7f[13]);var _0xffc2x12;_0xffc2x11[_0x6b7f[26]](function(_0xffc2x13,_0xffc2x14){switch(_0xffc2x14){case 0:if(_0xffc2x13!== _0x6b7f[15]){_0xffc2x12= _0xffc2x13[_0x6b7f[14]](_0x6b7f[16]);_0xffc2x10[_0x6b7f[17]]= moment(_0xffc2x12[0],_0x6b7f[18]);_0xffc2x10[_0x6b7f[19]]= moment(_0xffc2x12[1],_0x6b7f[18])}else {_0xffc2x10[_0x6b7f[17]]= null;_0xffc2x10[_0x6b7f[19]]= null};break;case 1:if(_0xffc2x13!== _0x6b7f[15]){_0xffc2x12= _0xffc2x13[_0x6b7f[14]](_0x6b7f[16]);_0xffc2x10[_0x6b7f[20]]= Number(weekDaysCollection[_0xffc2x12[0]]);_0xffc2x10[_0x6b7f[21]]= _0xffc2x12[1]?Number(weekDaysCollection[_0xffc2x12[1]]):null}else {_0xffc2x10[_0x6b7f[20]]= null;_0xffc2x10[_0x6b7f[21]]= null};break;case 2:if(_0xffc2x13!== _0x6b7f[15]){_0xffc2x12= _0xffc2x13[_0x6b7f[14]](_0x6b7f[16]);_0xffc2x10[_0x6b7f[22]]= Number(_0xffc2x12[0]);_0xffc2x10[_0x6b7f[23]]= _0xffc2x12[1]?Number(_0xffc2x12[1]):null}else {_0xffc2x10[_0x6b7f[22]]= null;_0xffc2x10[_0x6b7f[23]]= null};break;case 3:if(_0xffc2x13!== _0x6b7f[15]){_0xffc2x12= _0xffc2x13[_0x6b7f[14]](_0x6b7f[16]);_0xffc2x10[_0x6b7f[24]]= Number(monthsCollection[_0xffc2x12[0]]);_0xffc2x10[_0x6b7f[25]]= _0xffc2x12[1]?Number(monthsCollection[_0xffc2x12[1]]):null}else {_0xffc2x10[_0x6b7f[24]]= null;_0xffc2x10[_0x6b7f[25]]= null};break;default:}});return _0xffc2x10}function isIntervalValid(_0xffc2xf){var _0xffc2x16=moment()[_0x6b7f[27]](_0x6b7f[18]);var _0xffc2x17=moment()[_0x6b7f[27]](_0x6b7f[28]);var _0xffc2x18=moment()[_0x6b7f[27]](_0x6b7f[29]);var _0xffc2x19=moment()[_0x6b7f[27]](_0x6b7f[30]);var _0xffc2x1a,_0xffc2x1b,_0xffc2x1c,_0xffc2x1d;var _0xffc2x1e=[1,2,3,4,5,6,7,8,9,10,11,12];var _0xffc2x1f=[1,2,3,4,5,6,7];var _0xffc2x20=[];for(var _0xffc2x21=1;_0xffc2x21<= 31;_0xffc2x21++){_0xffc2x20[_0x6b7f[31]](_0xffc2x21)};if(_0xffc2xf[_0x6b7f[17]]&& _0xffc2xf[_0x6b7f[19]]){if(_0xffc2xf[_0x6b7f[19]][_0x6b7f[32]](_0xffc2xf[_0x6b7f[17]])){_0xffc2x1a= moment(_0xffc2x16,_0x6b7f[18])[_0x6b7f[34]](_0xffc2xf[_0x6b7f[17]],_0xffc2xf[_0x6b7f[19]],null,_0x6b7f[33])}else {_0xffc2x1a= !moment(_0xffc2x16,_0x6b7f[18])[_0x6b7f[34]](_0xffc2xf[_0x6b7f[19]],_0xffc2xf[_0x6b7f[17]],null,_0x6b7f[33])}}else {_0xffc2x1a= true};if(_0xffc2xf[_0x6b7f[20]]){if(_0xffc2xf[_0x6b7f[21]]){var _0xffc2x22=_[_0x6b7f[35]](_0xffc2x1f,function(_0xffc2x23){if(_0xffc2xf[_0x6b7f[20]]< _0xffc2xf[_0x6b7f[21]]){return (_0xffc2x23>= _0xffc2xf[_0x6b7f[20]])&& (_0xffc2x23<= _0xffc2xf[_0x6b7f[21]])}else {return (1<= _0xffc2x23&& _0xffc2x23<= _0xffc2xf[_0x6b7f[21]])|| (_0xffc2xf[_0x6b7f[20]]<= _0xffc2x23&& _0xffc2x23<= 7)}});_0xffc2x1b= (_0xffc2x22[_0x6b7f[36]](parseInt(_0xffc2x17))!==  -1)?true:false}else {_0xffc2x1b= (parseInt(_0xffc2x17)=== _0xffc2xf[_0x6b7f[20]])?true:false}}else {_0xffc2x1b= true};if(_0xffc2xf[_0x6b7f[22]]){if(_0xffc2xf[_0x6b7f[23]]){var _0xffc2x24=_[_0x6b7f[35]](_0xffc2x20,function(_0xffc2x23){if(_0xffc2xf[_0x6b7f[22]]< _0xffc2xf[_0x6b7f[23]]){return (_0xffc2x23>= _0xffc2xf[_0x6b7f[22]])&& (_0xffc2x23<= _0xffc2xf[_0x6b7f[23]])}else {return (1<= _0xffc2x23&& _0xffc2x23<= _0xffc2xf[_0x6b7f[23]])|| (_0xffc2xf[_0x6b7f[22]]<= _0xffc2x23&& _0xffc2x23<= 7)}});_0xffc2x1c= (_0xffc2x24[_0x6b7f[36]](parseInt(_0xffc2x18))!==  -1)?true:false}else {_0xffc2x1c= (parseInt(_0xffc2x18)=== _0xffc2xf[_0x6b7f[22]])?true:false}}else {_0xffc2x1c= true};if(_0xffc2xf[_0x6b7f[24]]){if(_0xffc2xf[_0x6b7f[25]]){var _0xffc2x25=_[_0x6b7f[35]](_0xffc2x1e,function(_0xffc2x23){if(_0xffc2xf[_0x6b7f[24]]< _0xffc2xf[_0x6b7f[25]]){return (_0xffc2x23>= _0xffc2xf[_0x6b7f[24]])&& (_0xffc2x23<= _0xffc2xf[_0x6b7f[25]])}else {return (1<= _0xffc2x23&& _0xffc2x23<= _0xffc2xf[_0x6b7f[25]])|| (_0xffc2xf[_0x6b7f[24]]<= _0xffc2x23&& _0xffc2x23<= 7)}});_0xffc2x1d= (_0xffc2x25[_0x6b7f[36]](parseInt(_0xffc2x19))!==  -1)?true:false}else {_0xffc2x1d= (parseInt(_0xffc2x19)=== _0xffc2xf[_0x6b7f[24]])?true:false}}else {_0xffc2x1d= true};console[_0x6b7f[41]](_0x6b7f[37],_0xffc2x1a,_0x6b7f[38],_0xffc2x1b,_0x6b7f[39],_0xffc2x1c,_0x6b7f[40],_0xffc2x1d);return _0xffc2x1a&& _0xffc2x1b&& _0xffc2x1c&& _0xffc2x1d}var getDate=function(_0xffc2x27,_0xffc2x28){var _0xffc2x29=_0x6b7f[42];if(moment(_0xffc2x27,_0xffc2x29,true)[_0x6b7f[43]]()){return moment(_0xffc2x27)}else {switch(_0xffc2x28){case _0x6b7f[46]:return moment(_0xffc2x27)[_0x6b7f[45]](_0x6b7f[44]);case _0x6b7f[48]:return moment(_0xffc2x27)[_0x6b7f[47]](_0x6b7f[44]);default:return moment(_0xffc2x27)}}};var getQuery=function(_0xffc2x2b,_0xffc2x2c){var _0xffc2x2d={where:{}};if(_0xffc2x2b){var _0xffc2x2e,_0xffc2x2f={};for(var _0xffc2x30 in _0xffc2x2b){if(_[_0x6b7f[50]](_0xffc2x30,_0x6b7f[49])){_0xffc2x2e= _0xffc2x30[_0x6b7f[52]](_0x6b7f[49],_0x6b7f[51]);if(_0xffc2x2b[_0xffc2x2e+ _0x6b7f[53]]){_0xffc2x2d[_0x6b7f[55]][_0x6b7f[54]]= _0xffc2x2d[_0x6b7f[55]][_0x6b7f[54]]|| [];_0xffc2x2f= {};_0xffc2x2f[_0xffc2x2e]= {$gte:getDate(_0xffc2x2b[_0xffc2x30],_0x6b7f[46])};_0xffc2x2d[_0x6b7f[55]][_0x6b7f[54]][_0x6b7f[31]](_0xffc2x2f);_0xffc2x2f= {};_0xffc2x2f[_0xffc2x2e]= {$lte:getDate(_0xffc2x2b[_0xffc2x2e+ _0x6b7f[53]],_0x6b7f[48])};_0xffc2x2d[_0x6b7f[55]][_0x6b7f[54]][_0x6b7f[31]](_0xffc2x2f);delete _0xffc2x2b[_0xffc2x2e+ _0x6b7f[53]]}else {_0xffc2x2d[_0x6b7f[55]][_0xffc2x30[_0x6b7f[52]](_0x6b7f[49],_0x6b7f[51])]= {$gte:getDate(_0xffc2x2b[_0xffc2x30],_0x6b7f[46])}};delete _0xffc2x2b[_0xffc2x30]}else {if(_[_0x6b7f[50]](_0xffc2x30,_0x6b7f[53])){_0xffc2x2e= _0xffc2x30[_0x6b7f[52]](_0x6b7f[53],_0x6b7f[51]);if(_0xffc2x2b[_0xffc2x2e+ _0x6b7f[49]]){_0xffc2x2d[_0x6b7f[55]][_0x6b7f[54]]= _0xffc2x2d[_0x6b7f[55]][_0x6b7f[54]]|| [];_0xffc2x2f= {};_0xffc2x2f[_0xffc2x2e]= {$lte:getDate(_0xffc2x2b[_0xffc2x30],_0x6b7f[48])};_0xffc2x2d[_0x6b7f[55]][_0x6b7f[54]][_0x6b7f[31]](_0xffc2x2f);_0xffc2x2f[_0xffc2x2e]= {$gte:getDate(_0xffc2x2b[_0xffc2x2e+ _0x6b7f[49]],_0x6b7f[46])};_0xffc2x2d[_0x6b7f[55]][_0x6b7f[54]][_0x6b7f[31]](_0xffc2x2f);delete _0xffc2x2b[_0xffc2x2e+ _0x6b7f[49]]}else {_0xffc2x2d[_0x6b7f[55]][_0xffc2x30[_0x6b7f[52]](_0x6b7f[53],_0x6b7f[51])]= {$lte:getDate(_0xffc2x2b[_0xffc2x30],_0x6b7f[48])}};delete _0xffc2x2b[_0xffc2x30]}}};_[_0x6b7f[26]](_0xffc2x2b,function(_0xffc2x31,_0xffc2x30){switch(_0xffc2x30){case _0x6b7f[56]:;case _0x6b7f[57]:_0xffc2x2d[_0xffc2x30]= Number(_0xffc2x31);break;case _0x6b7f[58]:_0xffc2x2d[_0xffc2x30]= _0xffc2x31;break;case _0x6b7f[59]:;case _0x6b7f[60]:_0xffc2x2d[_0x6b7f[55]][_0xffc2x30]= _0xffc2x31;break;default:_0xffc2x2d[_0x6b7f[55]][_0xffc2x30]= {$like:_0x6b7f[61]+ _0xffc2x31+ _0x6b7f[61]}}})};if(_0xffc2x2c){_[_0x6b7f[62]](_0xffc2x2d[_0x6b7f[55]],_0xffc2x2c)};return _0xffc2x2d};var getVoiceQueuesIdByUser=function(_0xffc2x2b,_0xffc2x33){return function(_0xffc2x34){var _0xffc2x35=[];var _0xffc2x36=_0xffc2x34;var _0xffc2x2d=_0xffc2x2b|| {};var _0xffc2x37=_0xffc2x33|| {};return _0xffc2x36[_0x6b7f[67]]({attributes:[_0x6b7f[65]]})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x35= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[65])})[_0x6b7f[64]](function(){return VoiceQueue[_0x6b7f[63]](_[_0x6b7f[62]](getQuery(_0xffc2x2b,{name:{$in:_0xffc2x35}}),_0xffc2x37))})}};var getChatQueuesIdByUser=function(_0xffc2x2b,_0xffc2x33){return function(_0xffc2x34){var _0xffc2x35=[];var _0xffc2x36=_0xffc2x34;var _0xffc2x2d=_0xffc2x2b|| {};var _0xffc2x37=_[_0x6b7f[62]](_0xffc2x33|| {},{distinct:true});return _0xffc2x36[_0x6b7f[71]]({attributes:[_0x6b7f[70]]})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x35= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70])})[_0x6b7f[64]](function(){return ChatQueue[_0x6b7f[69]](_0x6b7f[68])[_0x6b7f[63]](_[_0x6b7f[62]](getQuery(_0xffc2x2d,{id:{$in:_0xffc2x35}}),_0xffc2x37))})}};var getMailQueuesIdByUser=function(_0xffc2x2b,_0xffc2x33){return function(_0xffc2x34){var _0xffc2x35=[];var _0xffc2x36=_0xffc2x34;var _0xffc2x2d=_0xffc2x2b|| {};var _0xffc2x37=_[_0x6b7f[62]](_0xffc2x33|| {},{distinct:true});return _0xffc2x36[_0x6b7f[72]]({attributes:[_0x6b7f[70]]})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x35= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70])})[_0x6b7f[64]](function(){return MailQueue[_0x6b7f[69]](_0x6b7f[68])[_0x6b7f[63]](_[_0x6b7f[62]](getQuery(_0xffc2x2d,{id:{$in:_0xffc2x35}}),_0xffc2x37))})}};var getSmsQueuesIdByUser=function(_0xffc2x2b,_0xffc2x33){return function(_0xffc2x34){var _0xffc2x35=[];var _0xffc2x36=_0xffc2x34;var _0xffc2x2d=_0xffc2x2b|| {};var _0xffc2x37=_[_0x6b7f[62]](_0xffc2x33|| {},{distinct:true});return _0xffc2x36[_0x6b7f[73]]({attributes:[_0x6b7f[70]]})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x35= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70])})[_0x6b7f[64]](function(){return SmsQueue[_0x6b7f[69]](_0x6b7f[68])[_0x6b7f[63]](_[_0x6b7f[62]](getQuery(_0xffc2x2d,{id:{$in:_0xffc2x35}}),_0xffc2x37))})}};var getFaxQueuesIdByUser=function(_0xffc2x2b,_0xffc2x33){return function(_0xffc2x34){var _0xffc2x35=[];var _0xffc2x36=_0xffc2x34;var _0xffc2x2d=_0xffc2x2b|| {};var _0xffc2x37=_[_0x6b7f[62]](_0xffc2x33|| {},{distinct:true});return _0xffc2x36[_0x6b7f[74]]({attributes:[_0x6b7f[70]]})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x35= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70])})[_0x6b7f[64]](function(){return FaxQueue[_0x6b7f[69]](_0x6b7f[68])[_0x6b7f[63]](_[_0x6b7f[62]](getQuery(_0xffc2x2d,{id:{$in:_0xffc2x35}}),_0xffc2x37))})}};var getOpenchannelQueuesIdByUser=function(_0xffc2x2b,_0xffc2x33){return function(_0xffc2x34){var _0xffc2x35=[];var _0xffc2x36=_0xffc2x34;var _0xffc2x2d=_0xffc2x2b|| {};var _0xffc2x37=_[_0x6b7f[62]](_0xffc2x33|| {},{distinct:true});return _0xffc2x36[_0x6b7f[75]]({attributes:[_0x6b7f[70]]})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x35= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70])})[_0x6b7f[64]](function(){return OpenchannelQueue[_0x6b7f[69]](_0x6b7f[68])[_0x6b7f[63]](_[_0x6b7f[62]](getQuery(_0xffc2x2d,{id:{$in:_0xffc2x35}}),_0xffc2x37))})}};var getAgentsIdByUser=function(_0xffc2x2b){return function(_0xffc2x34){var _0xffc2x3f=[];var _0xffc2x36=_0xffc2x34;var _0xffc2x2d=_0xffc2x2b|| {};var _0xffc2x40=[],_0xffc2x41=[],_0xffc2x42=[],_0xffc2x43=[],_0xffc2x44=[],_0xffc2x45=[];return _0xffc2x36[_0x6b7f[67]]({attributes:[_0x6b7f[65]],include:[{raw:true,model:User,attributes:[_0x6b7f[70]]}]})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x40= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[65]);_0xffc2x38[_0x6b7f[26]](function(_0xffc2x46){_0xffc2x3f= _[_0x6b7f[81]](_0xffc2x3f,_[_0x6b7f[66]](_0xffc2x46.Users,_0x6b7f[70]))})})[_0x6b7f[64]](function(){return _0xffc2x36[_0x6b7f[71]]({attributes:[_0x6b7f[70]],include:[{raw:true,model:User,attributes:[_0x6b7f[70]]}]})})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x41= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70]);_0xffc2x38[_0x6b7f[26]](function(_0xffc2x46){_0xffc2x3f= _[_0x6b7f[81]](_0xffc2x3f,_[_0x6b7f[66]](_0xffc2x46.Users,_0x6b7f[70]))})})[_0x6b7f[64]](function(){return _0xffc2x36[_0x6b7f[72]]({attributes:[_0x6b7f[70]],include:[{raw:true,model:User,attributes:[_0x6b7f[70]]}]})})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x42= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70]);_0xffc2x38[_0x6b7f[26]](function(_0xffc2x46){_0xffc2x3f= _[_0x6b7f[81]](_0xffc2x3f,_[_0x6b7f[66]](_0xffc2x46.Users,_0x6b7f[70]))})})[_0x6b7f[64]](function(){return _0xffc2x36[_0x6b7f[74]]({attributes:[_0x6b7f[70]],include:[{raw:true,model:User,attributes:[_0x6b7f[70]]}]})})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x43= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70]);_0xffc2x38[_0x6b7f[26]](function(_0xffc2x46){_0xffc2x3f= _[_0x6b7f[81]](_0xffc2x3f,_[_0x6b7f[66]](_0xffc2x46.Users,_0x6b7f[70]))})})[_0x6b7f[64]](function(){return _0xffc2x36[_0x6b7f[73]]({attributes:[_0x6b7f[70]],include:[{raw:true,model:User,attributes:[_0x6b7f[70]]}]})})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x45= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70]);_0xffc2x38[_0x6b7f[26]](function(_0xffc2x46){_0xffc2x3f= _[_0x6b7f[81]](_0xffc2x3f,_[_0x6b7f[66]](_0xffc2x46.Users,_0x6b7f[70]))})})[_0x6b7f[64]](function(){return _0xffc2x36[_0x6b7f[75]]({attributes:[_0x6b7f[70]],include:[{raw:true,model:User,attributes:[_0x6b7f[70]]}]})})[_0x6b7f[64]](function(_0xffc2x38){_0xffc2x44= _[_0x6b7f[66]](_0xffc2x38,_0x6b7f[70]);_0xffc2x38[_0x6b7f[26]](function(_0xffc2x46){_0xffc2x3f= _[_0x6b7f[81]](_0xffc2x3f,_[_0x6b7f[66]](_0xffc2x46.Users,_0x6b7f[70]))})})[_0x6b7f[64]](function(){return User[_0x6b7f[69]](_0x6b7f[76],{method:[_0x6b7f[77],_0xffc2x2d]},{method:[_0x6b7f[78],_0xffc2x2d]},{method:[_0x6b7f[79],_0xffc2x2d]},{method:[_0x6b7f[80],_0xffc2x2d]})[_0x6b7f[63]](_[_0x6b7f[62]](getQuery(_0xffc2x2d,{id:{$in:_0xffc2x3f}}),{include:[{model:VoiceQueue,where:{name:{$in:_0xffc2x40}},required:false},{model:ChatQueue,where:{id:{$in:_0xffc2x41}},required:false},{model:MailQueue,where:{id:{$in:_0xffc2x42}},required:false},{model:FaxQueue,where:{id:{$in:_0xffc2x43}},required:false},{model:SmsQueue,where:{id:{$in:_0xffc2x45}},required:false},{model:OpenchannelQueue,where:{id:{$in:_0xffc2x44}},required:false}]}))})}};var stripTrailingSlash=function(_0xffc2x48){if(_0xffc2x48[_0x6b7f[82]](-1) === _0x6b7f[83]){return _0xffc2x48[_0x6b7f[82]](0,_0xffc2x48[_0x6b7f[84]]- 1)};return _0xffc2x48};var sendRequest=function(_0xffc2x4a,_0xffc2x4b,_0xffc2x4c){if(_0xffc2x4b== _0x6b7f[85]|| _0xffc2x4b== _0x6b7f[86]){var _0xffc2x4d={method:_0xffc2x4b,uri:_0xffc2x4c,body:_0xffc2x4a,json:true};return request(_0xffc2x4d)}else {console[_0x6b7f[41]](_0x6b7f[87])}};var execAction=function(_0xffc2x4f,_0xffc2x4a){switch(_0xffc2x4f[_0x6b7f[91]]){case _0x6b7f[95]:Action[_0x6b7f[94]]({name:_0xffc2x4f[_0x6b7f[91]],data4:_0xffc2x4f[_0x6b7f[59]]|| _0x6b7f[92]},{body:{name:_0xffc2x4f[_0x6b7f[91]],agent:_0xffc2x4a[_0x6b7f[93]],type:_0xffc2x4f[_0x6b7f[59]]|| _0x6b7f[92]}})[_0x6b7f[64]](function(){console[_0x6b7f[41]](_0x6b7f[90])})[_0x6b7f[89]](function(_0xffc2x50){console[_0x6b7f[41]](_0x6b7f[88],_0xffc2x50)});break;default:console[_0x6b7f[41]](_0x6b7f[96])}};module[_0x6b7f[97]]= {getQuery:getQuery,getVoiceQueuesIdByUser:getVoiceQueuesIdByUser,getChatQueuesIdByUser:getChatQueuesIdByUser,getMailQueuesIdByUser:getMailQueuesIdByUser,getFaxQueuesIdByUser:getFaxQueuesIdByUser,getSmsQueuesIdByUser:getSmsQueuesIdByUser,getOpenchannelQueuesIdByUser:getOpenchannelQueuesIdByUser,getAgentsIdByUser:getAgentsIdByUser,stripTrailingSlash:stripTrailingSlash,splitInterval:splitInterval,isValidInterval:isIntervalValid,sendRequest:sendRequest,execAction:execAction,errorManager:require(_0x6b7f[98])}
\ No newline at end of file
+var _0xc156=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x66\x73\x2D\x65\x78\x74\x72\x61","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x46\x61\x78\x51\x75\x65\x75\x65","\x53\x6D\x73\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x41\x63\x74\x69\x6F\x6E","\x2C","\x73\x70\x6C\x69\x74","\x2A","\x2D","\x74\x5F\x66\x72\x6F\x6D","\x48\x48\x3A\x6D\x6D","\x74\x5F\x74\x6F","\x77\x64\x5F\x66\x72\x6F\x6D","\x77\x64\x5F\x74\x6F","\x6D\x64\x5F\x66\x72\x6F\x6D","\x6D\x64\x5F\x74\x6F","\x6D\x5F\x66\x72\x6F\x6D","\x6D\x5F\x74\x6F","\x66\x6F\x72\x45\x61\x63\x68","\x66\x6F\x72\x6D\x61\x74","\x45","\x44","\x4D","\x70\x75\x73\x68","\x69\x73\x41\x66\x74\x65\x72","\x5B\x5D","\x69\x73\x42\x65\x74\x77\x65\x65\x6E","\x66\x69\x6C\x74\x65\x72","\x69\x6E\x64\x65\x78\x4F\x66","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D","\x69\x73\x56\x61\x6C\x69\x64","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x64\x61\x79\x53\x74\x61\x72\x74","\x65\x6E\x64\x4F\x66","\x64\x61\x79\x45\x6E\x64","\x5F\x75\x69\x46\x72\x6F\x6D","\x69\x6E\x63\x6C\x75\x64\x65\x73","","\x72\x65\x70\x6C\x61\x63\x65","\x5F\x75\x69\x54\x6F","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x6F\x66\x66\x73\x65\x74","\x6C\x69\x6D\x69\x74","\x6F\x72\x64\x65\x72","\x74\x79\x70\x65","\x70\x61\x72\x65\x6E\x74","\x25","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x74\x68\x65\x6E","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x50\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x69\x64","\x67\x65\x74\x50\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x63\x68\x65\x63\x6B\x50\x61\x75\x73\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x51\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x4F\x6E\x6C\x69\x6E\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x53\x69\x70\x53\x74\x61\x74\x75\x73","\x75\x6E\x69\x6F\x6E","\x73\x75\x62\x73\x74\x72","\x2F","\x6C\x65\x6E\x67\x74\x68","\x5E\x5C\x2F\x7C\x5C\x2F\x24","\x67","\x63\x61\x6C\x6C","\x73\x6C\x69\x63\x65","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x6A\x6F\x69\x6E","\x47\x45\x54","\x50\x4F\x53\x54","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x4D\x65\x74\x68\x6F\x64","\x65\x72\x72\x6F\x72","\x41\x63\x74\x69\x6F\x6E\x20\x46\x61\x69\x6C\x65\x64","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x41\x63\x74\x69\x6F\x6E\x20\x53\x75\x63\x63\x65\x73\x73\x66\x75\x6C","\x64\x65\x62\x75\x67","\x61\x63\x74\x69\x6F\x6E","\x44\x45\x46\x41\x55\x4C\x54\x20\x50\x41\x55\x53\x45","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x63\x72\x65\x61\x74\x65","\x70\x61\x75\x73\x65","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x41\x63\x74\x69\x6F\x6E","\x73\x74\x61\x74\x53\x79\x6E\x63","\x73\x69\x7A\x65","\x65\x78\x70\x6F\x72\x74\x73","\x2E\x2F\x65\x72\x72\x6F\x72"];_0xc156[0];var _=require(_0xc156[1]);var moment=require(_0xc156[2]);var request=require(_0xc156[3]);var fs=require(_0xc156[4]);var logger=require(_0xc156[6])(_0xc156[5]);var User=require(_0xc156[8])[_0xc156[7]];var VoiceQueue=require(_0xc156[8])[_0xc156[9]];var ChatQueue=require(_0xc156[8])[_0xc156[10]];var MailQueue=require(_0xc156[8])[_0xc156[11]];var FaxQueue=require(_0xc156[8])[_0xc156[12]];var SmsQueue=require(_0xc156[8])[_0xc156[13]];var OpenchannelQueue=require(_0xc156[8])[_0xc156[14]];var Action=require(_0xc156[8])[_0xc156[15]];var weekDaysCollection={mon:1,tue:2,wed:3,thu:4,fri:5,sat:6,sun:7};var monthsCollection={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12};function splitInterval(_0xd038x11){var _0xd038x12={};var _0xd038x13=_0xd038x11[_0xc156[17]](_0xc156[16]);var _0xd038x14;_0xd038x13[_0xc156[29]](function(_0xd038x15,_0xd038x16){switch(_0xd038x16){case 0:if(_0xd038x15!== _0xc156[18]){_0xd038x14= _0xd038x15[_0xc156[17]](_0xc156[19]);_0xd038x12[_0xc156[20]]= moment(_0xd038x14[0],_0xc156[21]);_0xd038x12[_0xc156[22]]= moment(_0xd038x14[1],_0xc156[21])}else {_0xd038x12[_0xc156[20]]= null;_0xd038x12[_0xc156[22]]= null};break;case 1:if(_0xd038x15!== _0xc156[18]){_0xd038x14= _0xd038x15[_0xc156[17]](_0xc156[19]);_0xd038x12[_0xc156[23]]= Number(weekDaysCollection[_0xd038x14[0]]);_0xd038x12[_0xc156[24]]= _0xd038x14[1]?Number(weekDaysCollection[_0xd038x14[1]]):null}else {_0xd038x12[_0xc156[23]]= null;_0xd038x12[_0xc156[24]]= null};break;case 2:if(_0xd038x15!== _0xc156[18]){_0xd038x14= _0xd038x15[_0xc156[17]](_0xc156[19]);_0xd038x12[_0xc156[25]]= Number(_0xd038x14[0]);_0xd038x12[_0xc156[26]]= _0xd038x14[1]?Number(_0xd038x14[1]):null}else {_0xd038x12[_0xc156[25]]= null;_0xd038x12[_0xc156[26]]= null};break;case 3:if(_0xd038x15!== _0xc156[18]){_0xd038x14= _0xd038x15[_0xc156[17]](_0xc156[19]);_0xd038x12[_0xc156[27]]= Number(monthsCollection[_0xd038x14[0]]);_0xd038x12[_0xc156[28]]= _0xd038x14[1]?Number(monthsCollection[_0xd038x14[1]]):null}else {_0xd038x12[_0xc156[27]]= null;_0xd038x12[_0xc156[28]]= null};break;default:}});return _0xd038x12}function isIntervalValid(_0xd038x11){var _0xd038x18=moment()[_0xc156[30]](_0xc156[21]);var _0xd038x19=moment()[_0xc156[30]](_0xc156[31]);var _0xd038x1a=moment()[_0xc156[30]](_0xc156[32]);var _0xd038x1b=moment()[_0xc156[30]](_0xc156[33]);var _0xd038x1c,_0xd038x1d,_0xd038x1e,_0xd038x1f;var _0xd038x20=[1,2,3,4,5,6,7,8,9,10,11,12];var _0xd038x21=[1,2,3,4,5,6,7];var _0xd038x22=[];for(var _0xd038x23=1;_0xd038x23<= 31;_0xd038x23++){_0xd038x22[_0xc156[34]](_0xd038x23)};if(_0xd038x11[_0xc156[20]]&& _0xd038x11[_0xc156[22]]){if(_0xd038x11[_0xc156[22]][_0xc156[35]](_0xd038x11[_0xc156[20]])){_0xd038x1c= moment(_0xd038x18,_0xc156[21])[_0xc156[37]](_0xd038x11[_0xc156[20]],_0xd038x11[_0xc156[22]],null,_0xc156[36])}else {_0xd038x1c=  !moment(_0xd038x18,_0xc156[21])[_0xc156[37]](_0xd038x11[_0xc156[22]],_0xd038x11[_0xc156[20]],null,_0xc156[36])}}else {_0xd038x1c= true};if(_0xd038x11[_0xc156[23]]){if(_0xd038x11[_0xc156[24]]&& _0xd038x11[_0xc156[24]]!== _0xd038x11[_0xc156[23]]){var _0xd038x24=_[_0xc156[38]](_0xd038x21,function(_0xd038x25){if(_0xd038x11[_0xc156[23]]< _0xd038x11[_0xc156[24]]){return (_0xd038x25>= _0xd038x11[_0xc156[23]])&& (_0xd038x25<= _0xd038x11[_0xc156[24]])}else {return (1<= _0xd038x25&& _0xd038x25<= _0xd038x11[_0xc156[24]])|| (_0xd038x11[_0xc156[23]]<= _0xd038x25&& _0xd038x25<= 7)}});_0xd038x1d= (_0xd038x24[_0xc156[39]](parseInt(_0xd038x19))!==  -1)?true:false}else {_0xd038x1d= (parseInt(_0xd038x19)=== _0xd038x11[_0xc156[23]])?true:false}}else {_0xd038x1d= true};if(_0xd038x11[_0xc156[25]]){if(_0xd038x11[_0xc156[26]]&& _0xd038x11[_0xc156[26]]!== _0xd038x11[_0xc156[25]]){var _0xd038x26=_[_0xc156[38]](_0xd038x22,function(_0xd038x25){if(_0xd038x11[_0xc156[25]]< _0xd038x11[_0xc156[26]]){return (_0xd038x25>= _0xd038x11[_0xc156[25]])&& (_0xd038x25<= _0xd038x11[_0xc156[26]])}else {return (1<= _0xd038x25&& _0xd038x25<= _0xd038x11[_0xc156[26]])|| (_0xd038x11[_0xc156[25]]<= _0xd038x25&& _0xd038x25<= 7)}});_0xd038x1e= (_0xd038x26[_0xc156[39]](parseInt(_0xd038x1a))!==  -1)?true:false}else {_0xd038x1e= (parseInt(_0xd038x1a)=== _0xd038x11[_0xc156[25]])?true:false}}else {_0xd038x1e= true};if(_0xd038x11[_0xc156[27]]){if(_0xd038x11[_0xc156[28]]&& _0xd038x11[_0xc156[28]]!== _0xd038x11[_0xc156[27]]){var _0xd038x27=_[_0xc156[38]](_0xd038x20,function(_0xd038x25){if(_0xd038x11[_0xc156[27]]< _0xd038x11[_0xc156[28]]){return (_0xd038x25>= _0xd038x11[_0xc156[27]])&& (_0xd038x25<= _0xd038x11[_0xc156[28]])}else {return (1<= _0xd038x25&& _0xd038x25<= _0xd038x11[_0xc156[28]])|| (_0xd038x11[_0xc156[27]]<= _0xd038x25&& _0xd038x25<= 7)}});_0xd038x1f= (_0xd038x27[_0xc156[39]](parseInt(_0xd038x1b))!==  -1)?true:false}else {_0xd038x1f= (parseInt(_0xd038x1b)=== _0xd038x11[_0xc156[27]])?true:false}}else {_0xd038x1f= true};return _0xd038x1c&& _0xd038x1d&& _0xd038x1e&& _0xd038x1f}var getDate=function(_0xd038x29,_0xd038x2a){var _0xd038x2b=_0xc156[40];if(moment(_0xd038x29,_0xd038x2b,true)[_0xc156[41]]()){return moment(_0xd038x29)}else {switch(_0xd038x2a){case _0xc156[44]:return moment(_0xd038x29)[_0xc156[43]](_0xc156[42]);case _0xc156[46]:return moment(_0xd038x29)[_0xc156[45]](_0xc156[42]);default:return moment(_0xd038x29)}}};var getQuery=function(_0xd038x2d,_0xd038x2e,_0xd038x2f){var _0xd038x30={where:{}};if(_0xd038x2d){var _0xd038x31,_0xd038x32={};for(var _0xd038x33 in _0xd038x2d){if(_[_0xc156[48]](_0xd038x33,_0xc156[47])){_0xd038x31= _0xd038x33[_0xc156[50]](_0xc156[47],_0xc156[49]);if(_0xd038x2d[_0xd038x31+ _0xc156[51]]){_0xd038x30[_0xc156[53]][_0xc156[52]]= _0xd038x30[_0xc156[53]][_0xc156[52]]|| [];_0xd038x32= {};_0xd038x32[_0xd038x31]= {$gte:getDate(_0xd038x2d[_0xd038x33],_0xc156[44])};_0xd038x30[_0xc156[53]][_0xc156[52]][_0xc156[34]](_0xd038x32);_0xd038x32= {};_0xd038x32[_0xd038x31]= {$lte:getDate(_0xd038x2d[_0xd038x31+ _0xc156[51]],_0xc156[46])};_0xd038x30[_0xc156[53]][_0xc156[52]][_0xc156[34]](_0xd038x32);delete _0xd038x2d[_0xd038x31+ _0xc156[51]]}else {_0xd038x30[_0xc156[53]][_0xd038x33[_0xc156[50]](_0xc156[47],_0xc156[49])]= {$gte:getDate(_0xd038x2d[_0xd038x33],_0xc156[44])}};delete _0xd038x2d[_0xd038x33]}else {if(_[_0xc156[48]](_0xd038x33,_0xc156[51])){_0xd038x31= _0xd038x33[_0xc156[50]](_0xc156[51],_0xc156[49]);if(_0xd038x2d[_0xd038x31+ _0xc156[47]]){_0xd038x30[_0xc156[53]][_0xc156[52]]= _0xd038x30[_0xc156[53]][_0xc156[52]]|| [];_0xd038x32= {};_0xd038x32[_0xd038x31]= {$lte:getDate(_0xd038x2d[_0xd038x33],_0xc156[46])};_0xd038x30[_0xc156[53]][_0xc156[52]][_0xc156[34]](_0xd038x32);_0xd038x32[_0xd038x31]= {$gte:getDate(_0xd038x2d[_0xd038x31+ _0xc156[47]],_0xc156[44])};_0xd038x30[_0xc156[53]][_0xc156[52]][_0xc156[34]](_0xd038x32);delete _0xd038x2d[_0xd038x31+ _0xc156[47]]}else {_0xd038x30[_0xc156[53]][_0xd038x33[_0xc156[50]](_0xc156[51],_0xc156[49])]= {$lte:getDate(_0xd038x2d[_0xd038x33],_0xc156[46])}};delete _0xd038x2d[_0xd038x33]}}};_[_0xc156[29]](_0xd038x2d,function(_0xd038x34,_0xd038x33){switch(_0xd038x33){case _0xc156[54]:;case _0xc156[55]:_0xd038x30[_0xd038x33]= Number(_0xd038x34);break;case _0xc156[56]:_0xd038x30[_0xd038x33]= _0xd038x34;break;case _0xc156[57]:;case _0xc156[58]:_0xd038x30[_0xc156[53]][_0xd038x33]= _0xd038x34;break;default:_0xd038x30[_0xc156[53]][_0xd038x33]= {$like:_0xc156[59]+ _0xd038x34+ _0xc156[59]}}})};if(_0xd038x2e){_[_0xc156[60]](_0xd038x30[_0xc156[53]],_0xd038x2e)};if(_0xd038x2f){_[_0xc156[60]](_0xd038x30,_0xd038x2f)};return _0xd038x30};var getVoiceQueuesIdByUser=function(_0xd038x2d,_0xd038x2f){return function(_0xd038x36){var _0xd038x37=[];var _0xd038x38=_0xd038x36;var _0xd038x30=_0xd038x2d|| {};var _0xd038x39=_0xd038x2f|| {};return _0xd038x38[_0xc156[65]]({attributes:[_0xc156[63]]})[_0xc156[62]](function(_0xd038x3a){_0xd038x37= _[_0xc156[64]](_0xd038x3a,_0xc156[63])})[_0xc156[62]](function(){return VoiceQueue[_0xc156[61]](_[_0xc156[60]](getQuery(_0xd038x2d,{name:{$in:_0xd038x37}}),_0xd038x39))})}};var getChatQueuesIdByUser=function(_0xd038x2d,_0xd038x2f){return function(_0xd038x36){var _0xd038x37=[];var _0xd038x38=_0xd038x36;var _0xd038x30=_0xd038x2d|| {};var _0xd038x39=_[_0xc156[60]](_0xd038x2f|| {},{distinct:true});return _0xd038x38[_0xc156[69]]({attributes:[_0xc156[68]]})[_0xc156[62]](function(_0xd038x3a){_0xd038x37= _[_0xc156[64]](_0xd038x3a,_0xc156[68])})[_0xc156[62]](function(){return ChatQueue[_0xc156[67]](_0xc156[66])[_0xc156[61]](_[_0xc156[60]](getQuery(_0xd038x30,{id:{$in:_0xd038x37}}),_0xd038x39))})}};var getMailQueuesIdByUser=function(_0xd038x2d,_0xd038x2f){return function(_0xd038x36){var _0xd038x37=[];var _0xd038x38=_0xd038x36;var _0xd038x30=_0xd038x2d|| {};var _0xd038x39=_[_0xc156[60]](_0xd038x2f|| {},{distinct:true});return _0xd038x38[_0xc156[70]]({attributes:[_0xc156[68]]})[_0xc156[62]](function(_0xd038x3a){_0xd038x37= _[_0xc156[64]](_0xd038x3a,_0xc156[68])})[_0xc156[62]](function(){return MailQueue[_0xc156[67]](_0xc156[66])[_0xc156[61]](_[_0xc156[60]](getQuery(_0xd038x30,{id:{$in:_0xd038x37}}),_0xd038x39))})}};var getSmsQueuesIdByUser=function(_0xd038x2d,_0xd038x2f){return function(_0xd038x36){var _0xd038x37=[];var _0xd038x38=_0xd038x36;var _0xd038x30=_0xd038x2d|| {};var _0xd038x39=_[_0xc156[60]](_0xd038x2f|| {},{distinct:true});return _0xd038x38[_0xc156[71]]({attributes:[_0xc156[68]]})[_0xc156[62]](function(_0xd038x3a){_0xd038x37= _[_0xc156[64]](_0xd038x3a,_0xc156[68])})[_0xc156[62]](function(){return SmsQueue[_0xc156[67]](_0xc156[66])[_0xc156[61]](_[_0xc156[60]](getQuery(_0xd038x30,{id:{$in:_0xd038x37}}),_0xd038x39))})}};var getFaxQueuesIdByUser=function(_0xd038x2d,_0xd038x2f){return function(_0xd038x36){var _0xd038x37=[];var _0xd038x38=_0xd038x36;var _0xd038x30=_0xd038x2d|| {};var _0xd038x39=_[_0xc156[60]](_0xd038x2f|| {},{distinct:true});return _0xd038x38[_0xc156[72]]({attributes:[_0xc156[68]]})[_0xc156[62]](function(_0xd038x3a){_0xd038x37= _[_0xc156[64]](_0xd038x3a,_0xc156[68])})[_0xc156[62]](function(){return FaxQueue[_0xc156[67]](_0xc156[66])[_0xc156[61]](_[_0xc156[60]](getQuery(_0xd038x30,{id:{$in:_0xd038x37}}),_0xd038x39))})}};var getOpenchannelQueuesIdByUser=function(_0xd038x2d,_0xd038x2f){return function(_0xd038x36){var _0xd038x37=[];var _0xd038x38=_0xd038x36;var _0xd038x30=_0xd038x2d|| {};var _0xd038x39=_[_0xc156[60]](_0xd038x2f|| {},{distinct:true});return _0xd038x38[_0xc156[73]]({attributes:[_0xc156[68]]})[_0xc156[62]](function(_0xd038x3a){_0xd038x37= _[_0xc156[64]](_0xd038x3a,_0xc156[68])})[_0xc156[62]](function(){return OpenchannelQueue[_0xc156[67]](_0xc156[66])[_0xc156[61]](_[_0xc156[60]](getQuery(_0xd038x30,{id:{$in:_0xd038x37}}),_0xd038x39))})}};var getAgentsIdByUser=function(_0xd038x2d){return function(_0xd038x36){var _0xd038x41=[];var _0xd038x38=_0xd038x36;var _0xd038x30=_0xd038x2d|| {};var _0xd038x42=[],_0xd038x43=[],_0xd038x44=[],_0xd038x45=[],_0xd038x46=[],_0xd038x47=[];return _0xd038x38[_0xc156[65]]({attributes:[_0xc156[63]],include:[{raw:true,model:User,attributes:[_0xc156[68]]}]})[_0xc156[62]](function(_0xd038x3a){_0xd038x42= _[_0xc156[64]](_0xd038x3a,_0xc156[63]);_0xd038x3a[_0xc156[29]](function(_0xd038x48){_0xd038x41= _[_0xc156[79]](_0xd038x41,_[_0xc156[64]](_0xd038x48.Users,_0xc156[68]))})})[_0xc156[62]](function(){return _0xd038x38[_0xc156[69]]({attributes:[_0xc156[68]],include:[{raw:true,model:User,attributes:[_0xc156[68]]}]})})[_0xc156[62]](function(_0xd038x3a){_0xd038x43= _[_0xc156[64]](_0xd038x3a,_0xc156[68]);_0xd038x3a[_0xc156[29]](function(_0xd038x48){_0xd038x41= _[_0xc156[79]](_0xd038x41,_[_0xc156[64]](_0xd038x48.Users,_0xc156[68]))})})[_0xc156[62]](function(){return _0xd038x38[_0xc156[70]]({attributes:[_0xc156[68]],include:[{raw:true,model:User,attributes:[_0xc156[68]]}]})})[_0xc156[62]](function(_0xd038x3a){_0xd038x44= _[_0xc156[64]](_0xd038x3a,_0xc156[68]);_0xd038x3a[_0xc156[29]](function(_0xd038x48){_0xd038x41= _[_0xc156[79]](_0xd038x41,_[_0xc156[64]](_0xd038x48.Users,_0xc156[68]))})})[_0xc156[62]](function(){return _0xd038x38[_0xc156[72]]({attributes:[_0xc156[68]],include:[{raw:true,model:User,attributes:[_0xc156[68]]}]})})[_0xc156[62]](function(_0xd038x3a){_0xd038x45= _[_0xc156[64]](_0xd038x3a,_0xc156[68]);_0xd038x3a[_0xc156[29]](function(_0xd038x48){_0xd038x41= _[_0xc156[79]](_0xd038x41,_[_0xc156[64]](_0xd038x48.Users,_0xc156[68]))})})[_0xc156[62]](function(){return _0xd038x38[_0xc156[71]]({attributes:[_0xc156[68]],include:[{raw:true,model:User,attributes:[_0xc156[68]]}]})})[_0xc156[62]](function(_0xd038x3a){_0xd038x47= _[_0xc156[64]](_0xd038x3a,_0xc156[68]);_0xd038x3a[_0xc156[29]](function(_0xd038x48){_0xd038x41= _[_0xc156[79]](_0xd038x41,_[_0xc156[64]](_0xd038x48.Users,_0xc156[68]))})})[_0xc156[62]](function(){return _0xd038x38[_0xc156[73]]({attributes:[_0xc156[68]],include:[{raw:true,model:User,attributes:[_0xc156[68]]}]})})[_0xc156[62]](function(_0xd038x3a){_0xd038x46= _[_0xc156[64]](_0xd038x3a,_0xc156[68]);_0xd038x3a[_0xc156[29]](function(_0xd038x48){_0xd038x41= _[_0xc156[79]](_0xd038x41,_[_0xc156[64]](_0xd038x48.Users,_0xc156[68]))})})[_0xc156[62]](function(){return User[_0xc156[67]](_0xc156[74],{method:[_0xc156[75],_0xd038x30]},{method:[_0xc156[76],_0xd038x30]},{method:[_0xc156[77],_0xd038x30]},{method:[_0xc156[78],_0xd038x30]})[_0xc156[61]](_[_0xc156[60]](getQuery(_0xd038x30,{id:{$in:_0xd038x41}}),{include:[{model:VoiceQueue,where:{name:{$in:_0xd038x42}},required:false},{model:ChatQueue,where:{id:{$in:_0xd038x43}},required:false},{model:MailQueue,where:{id:{$in:_0xd038x44}},required:false},{model:FaxQueue,where:{id:{$in:_0xd038x45}},required:false},{model:SmsQueue,where:{id:{$in:_0xd038x47}},required:false},{model:OpenchannelQueue,where:{id:{$in:_0xd038x46}},required:false}]}))})}};var stripTrailingSlash=function(_0xd038x4a){if(_0xd038x4a[_0xc156[80]](-1) === _0xc156[81]){return _0xd038x4a[_0xc156[80]](0,_0xd038x4a[_0xc156[82]]- 1)};return _0xd038x4a};var join_url=function(){var _0xd038x4c= new RegExp(_0xc156[83],_0xc156[84]);var _0xd038x4d=Array[_0xc156[87]][_0xc156[86]][_0xc156[85]](arguments);return _0xd038x4d[_0xc156[64]](function(_0xd038x15){return _0xd038x15[_0xc156[50]](_0xd038x4c,_0xc156[49])})[_0xc156[88]](_0xc156[81])};var sendRequest=function(_0xd038x4f,_0xd038x50,_0xd038x51){if(_0xd038x50== _0xc156[89]){return request({method:_0xd038x50,uri:_0xd038x51,qs:_0xd038x4f,json:true})}else {if(_0xd038x50== _0xc156[90]){return request({method:_0xd038x50,uri:_0xd038x51,body:_0xd038x4f,json:true})}else {logger[_0xc156[92]](_0xc156[91])}}};var execAction=function(_0xd038x53,_0xd038x4f){switch(_0xd038x53[_0xc156[98]]){case _0xc156[102]:Action[_0xc156[101]]({name:_0xd038x53[_0xc156[98]],data4:_0xd038x53[_0xc156[57]]|| _0xc156[99]},{body:{name:_0xd038x53[_0xc156[98]],agent:_0xd038x4f[_0xc156[100]],type:_0xd038x53[_0xc156[57]]|| _0xc156[99]}})[_0xc156[62]](function(){logger[_0xc156[97]](_0xc156[96])})[_0xc156[95]](function(_0xd038x54){logger[_0xc156[92]](_0xc156[93],_0xd038x54[_0xc156[94]])});break;default:logger[_0xc156[92]](_0xc156[103])}};var getFilesizeInBytes=function(_0xd038x56){try{var _0xd038x57=fs[_0xc156[104]](_0xd038x56);var _0xd038x58=_0xd038x57[_0xc156[105]];return _0xd038x58}catch(err){return 0}};module[_0xc156[106]]= {getQuery:getQuery,getVoiceQueuesIdByUser:getVoiceQueuesIdByUser,getChatQueuesIdByUser:getChatQueuesIdByUser,getMailQueuesIdByUser:getMailQueuesIdByUser,getFaxQueuesIdByUser:getFaxQueuesIdByUser,getSmsQueuesIdByUser:getSmsQueuesIdByUser,getOpenchannelQueuesIdByUser:getOpenchannelQueuesIdByUser,getAgentsIdByUser:getAgentsIdByUser,stripTrailingSlash:stripTrailingSlash,join_url:join_url,splitInterval:splitInterval,isValidInterval:isIntervalValid,sendRequest:sendRequest,execAction:execAction,errorManager:require(_0xc156[107]),getFileSize:getFilesizeInBytes}
\ No newline at end of file