Built motion from commit 27af9f03b.|1.0.28
[motion.git] / server / config / routing / queue.js
index e099f17..7d96fe2 100644 (file)
@@ -1 +1 @@
-var _0xc662=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2F\x73\x74\x72\x75\x63\x74\x75\x72\x65","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x61\x70\x70","\x64\x61\x74\x61","\x65\x6C\x61\x70\x73\x65\x64","\x6E\x65\x78\x74","\x63\x61\x6C\x6C\x65\x64","\x72\x65\x6A\x65\x63\x74\x65\x64","\x69\x6E\x69\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x51\x55\x45\x55\x45\x20\x41\x43\x54\x49\x4F\x4E\x20\x53\x54\x41\x52\x54\x45\x44","\x6C\x6F\x67","\x74\x68\x65\x6E","\x72\x6F\x6F\x6D\x69\x64","\x75\x70\x64\x61\x74\x65","\x63\x68\x61\x6E\x6E\x65\x6C","\x72\x6F\x6F\x6D\x73","\x6D\x6F\x64\x65\x6C\x73","\x74\x69\x6D\x65\x6F\x75\x74","\x71\x75\x65\x75\x65","\x69\x64","\x5F\x71\x75\x65\x75\x65","\x6E\x61\x6D\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x6D\x65\x72\x67\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x73\x65\x73\x73\x69\x6F\x6E\x73","\x25\x73\x20\x51\x55\x45\x55\x45\x20\x49\x4E\x53\x54\x41\x4E\x43\x45\x20\x46\x4F\x52\x20\x41\x43\x43\x4F\x55\x4E\x54\x20\x25\x73","\x74\x6F\x55\x70\x70\x65\x72\x43\x61\x73\x65","\x61\x63\x63\x6F\x75\x6E\x74\x6E\x61\x6D\x65","\x69\x6E\x66\x6F","\x5F\x64\x75\x72\x61\x74\x69\x6F\x6E","\x51\x55\x45\x55\x45\x20\x42\x45\x45\x50\x41\x4C\x4C\x20\x53\x54\x52\x41\x54\x45\x47\x59\x2C\x20\x44\x55\x52\x41\x54\x49\x4F\x4E","\x5F\x61\x67\x65\x6E\x74\x73","\x70\x65\x6E\x61\x6C\x74\x79\x54\x61\x62\x6C\x65\x73","\x6C\x61\x62\x65\x6C\x73","\x67\x72\x6F\x75\x70\x42\x79","\x76\x61\x6C\x75\x65\x73","\x62\x65\x65\x70\x61\x6C\x6C","\x51\x55\x45\x55\x45\x20\x52\x4F\x55\x4E\x44\x20\x52\x4F\x42\x49\x4E\x20\x53\x54\x52\x41\x54\x45\x47\x59\x2C\x20\x44\x55\x52\x41\x54\x49\x4F\x4E","\x55\x73\x65\x72\x73","\x72\x72","\x72\x6F\x75\x6E\x64\x72\x6F\x62\x69\x6E","\x51\x55\x45\x55\x45\x20\x52\x52\x20\x4D\x45\x4D\x4F\x52\x59\x20\x53\x54\x52\x41\x54\x45\x47\x59\x2C\x20\x44\x55\x52\x41\x54\x49\x4F\x4E","\x6C\x61\x73\x74\x41\x67\x65\x6E\x74","\x6C\x65\x6E\x67\x74\x68","\x73\x68\x69\x66\x74","\x70\x75\x73\x68","\x72\x72\x6D\x65\x6D\x6F\x72\x79","\x73\x74\x72\x61\x74\x65\x67\x79","\x61\x70\x70\x51\x75\x65\x75\x65\x73","\x70\x65\x6E\x61\x6C\x74\x79","\x41\x53\x43","\x66\x69\x6E\x64\x42\x79\x49\x64","\x71\x75\x65\x75\x65\x73","\x6D\x61\x70","\x73\x74\x61\x74\x75\x73","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x6F\x6E\x6C\x69\x6E\x65","\x6D\x61\x69\x6C\x50\x61\x75\x73\x65","\x63\x68\x61\x74\x50\x61\x75\x73\x65","\x66\x61\x78\x50\x61\x75\x73\x65","\x73\x6D\x73\x50\x61\x75\x73\x65","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x50\x61\x75\x73\x65","\x6D\x61\x69\x6C\x43\x61\x70\x61\x63\x69\x74\x79","\x63\x68\x61\x74\x43\x61\x70\x61\x63\x69\x74\x79","\x66\x61\x78\x43\x61\x70\x61\x63\x69\x74\x79","\x73\x6D\x73\x43\x61\x70\x61\x63\x69\x74\x79","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x43\x61\x70\x61\x63\x69\x74\x79","\x70\x61\x75\x73\x65\x73","\x77\x68\x65\x72\x65","\x4F\x50\x45\x4E","\x66\x69\x6C\x74\x65\x72","\x63\x61\x70\x61\x63\x69\x74\x69\x65\x73","\x72\x65\x6D\x6F\x76\x65","\x63\x6C\x6F\x6E\x65","\x72\x65\x70\x6F\x72\x74\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x6A\x6F\x69\x6E","\x6F\x72\x64\x65\x72","\x46\x49\x45\x4C\x44\x28\x55\x73\x65\x72\x2E\x69\x64\x2C","\x29","\x66\x69\x6E\x64","\x65\x78\x70\x6F\x72\x74\x73"];_0xc662[0];const _=require(_0xc662[1]);const config=require(_0xc662[2]);const structure=require(_0xc662[3]);const cp=require(_0xc662[4]);const util=require(_0xc662[5]);const moment=require(_0xc662[6]);const Agent=require(_0xc662[8])[_0xc662[7]];function Queue(_0x35cax9,_0x35caxa,_0x35caxb){this[_0xc662[9]]= _0x35cax9;this[_0xc662[10]]= _0x35caxa;this[_0xc662[11]]= 0;this[_0xc662[12]]= _0x35caxb;this[_0xc662[13]]= [];this[_0xc662[14]]= []}Queue[_0xc662[16]][_0xc662[15]]= function init(){var _0x35caxd=this;return structure[_0xc662[26]][_0xc662[64]][_0x35caxd[_0xc662[10]][_0xc662[24]]][_0xc662[63]](_0x35caxd[_0xc662[9]][structure[_0xc662[45]][_0xc662[60]][_0x35caxd[_0xc662[10]][_0xc662[24]]]],{attributes:[_0xc662[29],_0xc662[31],_0xc662[27],_0xc662[59],_0xc662[54]],include:[{model:Agent,attributes:[_0xc662[29]],order:[[_0xc662[61],_0xc662[62]]]}]})[_0xc662[21]](function(_0x35cax10){console[_0xc662[40]](util[_0xc662[33]](_0xc662[37],_0x35caxd[_0xc662[10]][_0xc662[24]][_0xc662[38]](),_0x35caxd[_0xc662[10]][_0xc662[39]]));_0x35caxd[_0xc662[30]]= _0x35cax10;_0x35caxd[_0xc662[41]]= _0x35caxd[_0xc662[9]][_0xc662[27]];switch(_0x35caxd[_0xc662[30]][_0xc662[59]]){case _0xc662[48]:console[_0xc662[40]](_0x35caxd[_0xc662[10]][_0xc662[24]][_0xc662[38]](),_0xc662[42],_0x35caxd[_0xc662[9]][_0xc662[27]]);_0x35caxd[_0xc662[43]]= _[_0xc662[47]](_[_0xc662[46]](_0x35cax10.Users,structure[_0xc662[45]][_0xc662[44]][_0x35caxd[_0xc662[10]][_0xc662[24]]]));_0x35caxd[_0xc662[48]]();break;case _0xc662[52]:console[_0xc662[40]](_0x35caxd[_0xc662[10]][_0xc662[24]][_0xc662[38]](),_0xc662[49],_0x35caxd[_0xc662[9]][_0xc662[27]]);_0x35caxd[_0xc662[43]]= _0x35cax10[_0xc662[50]];_0x35caxd[_0xc662[51]]();break;case _0xc662[58]:console[_0xc662[40]](_0x35caxd[_0xc662[10]][_0xc662[24]][_0xc662[38]](),_0xc662[53],_0x35caxd[_0xc662[9]][_0xc662[27]]);_0x35caxd[_0xc662[43]]= _0x35cax10[_0xc662[50]];if(_0x35caxd[_0xc662[30]][_0xc662[54]]){var _0x35cax11;for(var _0x35cax12=0;_0x35cax12< _0x35caxd[_0xc662[43]][_0xc662[55]];_0x35cax12++){_0x35cax11= _0x35caxd[_0xc662[43]][_0xc662[56]]();_0x35caxd[_0xc662[43]][_0xc662[57]](_0x35cax11);if(_0x35cax11[_0xc662[29]]=== _0x35caxd[_0xc662[30]][_0xc662[54]]){break}}};_0x35caxd[_0xc662[51]]();break;default:}})[_0xc662[21]](function(){var _0x35caxf=[_[_0xc662[34]](_0x35caxd[_0xc662[10]],{timeslot:_0x35caxd[_0xc662[9]][_0xc662[27]],application:_0xc662[28],queue:_0x35caxd[_0xc662[30]][_0xc662[29]],queuename:_0x35caxd[_0xc662[30]][_0xc662[31]],calledAt:moment()[_0xc662[33]](_0xc662[32]),joinAt:moment()[_0xc662[33]](_0xc662[32]),membername:null,memberid:null})];return structure[_0xc662[26]][_0xc662[36]][_0x35caxd[_0xc662[10]][_0xc662[24]]][_0xc662[35]](_0x35caxf,{individualHooks:true})})[_0xc662[21]](function(){return structure[_0xc662[26]][_0xc662[25]][_0x35caxd[_0xc662[10]][_0xc662[24]]][_0xc662[23]]({waiting:true},{where:{id:_0x35caxd[_0xc662[10]][_0xc662[22]]},individualHooks:true})[_0xc662[21]](function(){console[_0xc662[20]](_0xc662[19])})[_0xc662[18]](function(_0x35caxe){console[_0xc662[17]]()})})};Queue[_0xc662[16]][_0xc662[48]]= function beepall(){var _0x35caxd=this;var _0x35cax14=_0x35caxd[_0xc662[43]][_0xc662[56]]();_0x35caxd[_0xc662[43]][_0xc662[57]](_0x35cax14);var _0x35cax15={where:{id:{$in:_[_0xc662[65]](_0x35cax14,_0xc662[29])},online:true},include:[{model:structure[_0xc662[26]][_0xc662[25]][_0x35caxd[_0xc662[10]][_0xc662[24]]],attributes:[_0xc662[29],_0xc662[66]]}],attributes:[_0xc662[29],_0xc662[31],_0xc662[67],_0xc662[68],_0xc662[69],_0xc662[70],_0xc662[71],_0xc662[72],_0xc662[73],_0xc662[74],_0xc662[75],_0xc662[76],_0xc662[77],_0xc662[78]]};_0x35cax15[_0xc662[80]][structure[_0xc662[45]][_0xc662[79]][_0x35caxd[_0xc662[10]][_0xc662[24]]]]= false;var _0x35cax16=((_0x35caxd[_0xc662[9]][_0xc662[27]]- _0x35caxd[_0xc662[11]])> _0x35caxd[_0xc662[30]][_0xc662[27]])?_0x35caxd[_0xc662[30]][_0xc662[27]]:(_0x35caxd[_0xc662[9]][_0xc662[27]]- _0x35caxd[_0xc662[11]]);_0x35caxd[_0xc662[27]]= setTimeout(function(){_0x35caxd[_0xc662[11]]+= _0x35caxd[_0xc662[30]][_0xc662[27]];_0x35caxd[_0xc662[51]]()},_0x35cax16* 1000);if(_0x35cax16> 0){Agent[_0xc662[87]](_0x35cax15)[_0xc662[21]](function(_0x35cax17){_0x35cax17= _[_0xc662[84]](_0x35cax17,function(_0x35cax11){if(available(_0x35cax11,_0x35cax11[structure[_0xc662[45]][_0xc662[79]][_0x35caxd[_0xc662[10]][_0xc662[24]]]],_0x35caxd[_0xc662[14]],_[_0xc662[82]](_0x35cax11[structure[_0xc662[45]][_0xc662[25]][_0x35caxd[_0xc662[10]][_0xc662[24]]]],{status:_0xc662[81]}),_0x35cax11[structure[_0xc662[45]][_0xc662[83]][_0x35caxd[_0xc662[10]][_0xc662[24]]]])){return true}else {return false}});var _0x35caxf=_[_0xc662[65]](_0x35cax17,function(_0x35cax11){var _0x35cax18=_[_0xc662[34]](_0x35caxd[_0xc662[10]],{timeslot:_0x35cax16,application:_0xc662[28],membername:_0x35cax11[_0xc662[31]],memberid:_0x35cax11[_0xc662[29]],queue:_0x35caxd[_0xc662[30]][_0xc662[29]],queuename:_0x35caxd[_0xc662[30]][_0xc662[31]],calledAt:moment()[_0xc662[33]](_0xc662[32])});return _[_0xc662[85]](_0x35cax18)});structure[_0xc662[26]][_0xc662[86]][_0x35caxd[_0xc662[10]][_0xc662[24]]][_0xc662[35]](_0x35caxf,{individualHooks:true})[_0xc662[18]](function(_0x35caxe){console[_0xc662[17]](_0x35caxe)})})[_0xc662[18]](function(_0x35caxe){console[_0xc662[17]](_0x35caxe)})}else {clearTimeout(_0x35caxd[_0xc662[27]]);this[_0xc662[12]]()}};Queue[_0xc662[16]][_0xc662[51]]= function rr(){var _0x35caxd=this;var _0x35cax16=((_0x35caxd[_0xc662[9]][_0xc662[27]]- _0x35caxd[_0xc662[11]])> _0x35caxd[_0xc662[30]][_0xc662[27]])?_0x35caxd[_0xc662[30]][_0xc662[27]]:(_0x35caxd[_0xc662[9]][_0xc662[27]]- _0x35caxd[_0xc662[11]]);_0x35caxd[_0xc662[27]]= setTimeout(function(){_0x35caxd[_0xc662[11]]+= _0x35caxd[_0xc662[30]][_0xc662[27]];_0x35caxd[_0xc662[51]]()},_0x35cax16* 1000);var _0x35cax15={where:{id:{$in:_[_0xc662[65]](_0x35caxd._agents,_0xc662[29])}},include:[{model:structure[_0xc662[26]][_0xc662[25]][_0x35caxd[_0xc662[10]][_0xc662[24]]],attributes:[_0xc662[29]]}],attributes:[_0xc662[29],_0xc662[31],_0xc662[67],_0xc662[68],_0xc662[69],_0xc662[70],_0xc662[71],_0xc662[72],_0xc662[73],_0xc662[74],_0xc662[75],_0xc662[76],_0xc662[77],_0xc662[78]]};if(_[_0xc662[65]](_0x35caxd._agents,_0xc662[29])[_0xc662[88]]()[_0xc662[55]]){_0x35cax15[_0xc662[89]]= [[{raw:_0xc662[90]+ _[_0xc662[65]](_0x35caxd._agents,_0xc662[29])[_0xc662[88]]()+ _0xc662[91]}]]};if(_0x35cax16> 0){Agent[_0xc662[87]](_0x35cax15)[_0xc662[21]](function(_0x35cax17){if(_0x35cax17[_0xc662[55]]){_0x35caxd[_0xc662[43]]= _0x35cax17;for(var _0x35cax12=0;_0x35cax12< _0x35caxd[_0xc662[43]][_0xc662[55]];_0x35cax12++){if(available(_0x35caxd[_0xc662[43]][0],_0x35caxd[_0xc662[43]][0][structure[_0xc662[45]][_0xc662[79]][_0x35caxd[_0xc662[10]][_0xc662[24]]]],_0x35caxd[_0xc662[14]],_[_0xc662[82]](_0x35caxd[_0xc662[43]][0][structure[_0xc662[45]][_0xc662[25]][_0x35caxd[_0xc662[10]][_0xc662[24]]]],{status:_0xc662[81]}),_0x35caxd[_0xc662[43]][0][structure[_0xc662[45]][_0xc662[83]][_0x35caxd[_0xc662[10]][_0xc662[24]]]])){var _0x35caxf=[_[_0xc662[34]](_0x35caxd[_0xc662[10]],{timeslot:_0x35cax16,application:_0xc662[28],membername:_0x35caxd[_0xc662[43]][0][_0xc662[31]],memberid:_0x35caxd[_0xc662[43]][0][_0xc662[29]],queue:_0x35caxd[_0xc662[30]][_0xc662[29]],queuename:_0x35caxd[_0xc662[30]][_0xc662[31]],calledAt:moment()[_0xc662[33]](_0xc662[32])})];return structure[_0xc662[26]][_0xc662[86]][_0x35caxd[_0xc662[10]][_0xc662[24]]][_0xc662[35]](_0x35caxf,{individualHooks:true})[_0xc662[21]](function(){return structure[_0xc662[26]][_0xc662[64]][_0x35caxd[_0xc662[10]][_0xc662[24]]][_0xc662[23]]({lastAgent:_0x35caxd[_0xc662[43]][0][_0xc662[29]]},{where:{id:_0x35caxd[_0xc662[30]][_0xc662[29]]}})})[_0xc662[18]](function(_0x35caxe){console[_0xc662[17]](_0x35caxe)})}else {var _0x35cax11=_0x35caxd[_0xc662[43]][_0xc662[56]]();_0x35caxd[_0xc662[43]][_0xc662[57]](_0x35cax11)}}}})[_0xc662[21]](function(){var _0x35cax11=_0x35caxd[_0xc662[43]][_0xc662[56]]();_0x35caxd[_0xc662[43]][_0xc662[57]](_0x35cax11)})[_0xc662[18]](function(_0x35caxe){console[_0xc662[17]](_0x35caxe)})}else {clearTimeout(_0x35caxd[_0xc662[27]]);this[_0xc662[12]]()}};function available(_0x35cax11,_0x35cax1b,_0x35cax1c,_0x35cax1d,_0x35cax1e){var _0x35cax1f=_[_0xc662[92]](_0x35cax1c,{id:_0x35cax11[_0xc662[29]]})?true:false;return _0x35cax11[_0xc662[68]]&& !_0x35cax1b&& !_0x35cax1f&& ((_0x35cax1d[_0xc662[55]]< _0x35cax1e)|| (_0x35cax1e=== 0))}module[_0xc662[93]]= Queue
\ No newline at end of file
+var _0x787f=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2F\x73\x74\x72\x75\x63\x74\x75\x72\x65","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x61\x70\x70","\x64\x61\x74\x61","\x65\x6C\x61\x70\x73\x65\x64","\x6E\x65\x78\x74","\x63\x61\x6C\x6C\x65\x64","\x72\x65\x6A\x65\x63\x74\x65\x64","\x69\x6E\x69\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x51\x55\x45\x55\x45\x20\x41\x43\x54\x49\x4F\x4E\x20\x53\x54\x41\x52\x54\x45\x44","\x6C\x6F\x67","\x74\x68\x65\x6E","\x72\x6F\x6F\x6D\x69\x64","\x75\x70\x64\x61\x74\x65","\x63\x68\x61\x6E\x6E\x65\x6C","\x72\x6F\x6F\x6D\x73","\x6D\x6F\x64\x65\x6C\x73","\x74\x69\x6D\x65\x6F\x75\x74","\x71\x75\x65\x75\x65","\x69\x64","\x5F\x71\x75\x65\x75\x65","\x6E\x61\x6D\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x6D\x65\x72\x67\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x73\x65\x73\x73\x69\x6F\x6E\x73","\x25\x73\x20\x51\x55\x45\x55\x45\x20\x49\x4E\x53\x54\x41\x4E\x43\x45\x20\x46\x4F\x52\x20\x41\x43\x43\x4F\x55\x4E\x54\x20\x25\x73","\x74\x6F\x55\x70\x70\x65\x72\x43\x61\x73\x65","\x61\x63\x63\x6F\x75\x6E\x74\x6E\x61\x6D\x65","\x69\x6E\x66\x6F","\x5F\x64\x75\x72\x61\x74\x69\x6F\x6E","\x51\x55\x45\x55\x45\x20\x42\x45\x45\x50\x41\x4C\x4C\x20\x53\x54\x52\x41\x54\x45\x47\x59\x2C\x20\x44\x55\x52\x41\x54\x49\x4F\x4E","\x5F\x61\x67\x65\x6E\x74\x73","\x70\x65\x6E\x61\x6C\x74\x79\x54\x61\x62\x6C\x65\x73","\x6C\x61\x62\x65\x6C\x73","\x67\x72\x6F\x75\x70\x42\x79","\x76\x61\x6C\x75\x65\x73","\x62\x65\x65\x70\x61\x6C\x6C","\x51\x55\x45\x55\x45\x20\x52\x4F\x55\x4E\x44\x20\x52\x4F\x42\x49\x4E\x20\x53\x54\x52\x41\x54\x45\x47\x59\x2C\x20\x44\x55\x52\x41\x54\x49\x4F\x4E","\x55\x73\x65\x72\x73","\x72\x72","\x72\x6F\x75\x6E\x64\x72\x6F\x62\x69\x6E","\x51\x55\x45\x55\x45\x20\x52\x52\x20\x4D\x45\x4D\x4F\x52\x59\x20\x53\x54\x52\x41\x54\x45\x47\x59\x2C\x20\x44\x55\x52\x41\x54\x49\x4F\x4E","\x6C\x61\x73\x74\x41\x67\x65\x6E\x74","\x6C\x65\x6E\x67\x74\x68","\x73\x68\x69\x66\x74","\x70\x75\x73\x68","\x72\x72\x6D\x65\x6D\x6F\x72\x79","\x73\x74\x72\x61\x74\x65\x67\x79","\x61\x70\x70\x51\x75\x65\x75\x65\x73","\x70\x65\x6E\x61\x6C\x74\x79","\x41\x53\x43","\x66\x69\x6E\x64\x42\x79\x49\x64","\x71\x75\x65\x75\x65\x73","\x6D\x61\x70","\x73\x74\x61\x74\x75\x73","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x6F\x6E\x6C\x69\x6E\x65","\x6D\x61\x69\x6C\x50\x61\x75\x73\x65","\x63\x68\x61\x74\x50\x61\x75\x73\x65","\x66\x61\x78\x50\x61\x75\x73\x65","\x73\x6D\x73\x50\x61\x75\x73\x65","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x50\x61\x75\x73\x65","\x6D\x61\x69\x6C\x43\x61\x70\x61\x63\x69\x74\x79","\x63\x68\x61\x74\x43\x61\x70\x61\x63\x69\x74\x79","\x66\x61\x78\x43\x61\x70\x61\x63\x69\x74\x79","\x73\x6D\x73\x43\x61\x70\x61\x63\x69\x74\x79","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x43\x61\x70\x61\x63\x69\x74\x79","\x70\x61\x75\x73\x65\x73","\x77\x68\x65\x72\x65","\x4F\x50\x45\x4E","\x66\x69\x6C\x74\x65\x72","\x63\x61\x70\x61\x63\x69\x74\x69\x65\x73","\x72\x65\x6D\x6F\x76\x65","\x63\x6C\x6F\x6E\x65","\x72\x65\x70\x6F\x72\x74\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x6A\x6F\x69\x6E","\x6F\x72\x64\x65\x72","\x46\x49\x45\x4C\x44\x28\x55\x73\x65\x72\x2E\x69\x64\x2C","\x29","\x66\x69\x6E\x64","\x65\x78\x70\x6F\x72\x74\x73"];_0x787f[0];const _=require(_0x787f[1]);const config=require(_0x787f[2]);const structure=require(_0x787f[3]);const cp=require(_0x787f[4]);const util=require(_0x787f[5]);const moment=require(_0x787f[6]);const Agent=require(_0x787f[8])[_0x787f[7]];function Queue(_0xb7bfx9,_0xb7bfxa,_0xb7bfxb){this[_0x787f[9]]= _0xb7bfx9;this[_0x787f[10]]= _0xb7bfxa;this[_0x787f[11]]= 0;this[_0x787f[12]]= _0xb7bfxb;this[_0x787f[13]]= [];this[_0x787f[14]]= []}Queue[_0x787f[16]][_0x787f[15]]= function init(){var _0xb7bfxd=this;return structure[_0x787f[26]][_0x787f[64]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]][_0x787f[63]](_0xb7bfxd[_0x787f[9]][structure[_0x787f[45]][_0x787f[60]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]]],{attributes:[_0x787f[29],_0x787f[31],_0x787f[27],_0x787f[59],_0x787f[54]],include:[{model:Agent,attributes:[_0x787f[29]],order:[[_0x787f[61],_0x787f[62]]]}]})[_0x787f[21]](function(_0xb7bfx10){console[_0x787f[40]](util[_0x787f[33]](_0x787f[37],_0xb7bfxd[_0x787f[10]][_0x787f[24]][_0x787f[38]](),_0xb7bfxd[_0x787f[10]][_0x787f[39]]));_0xb7bfxd[_0x787f[30]]= _0xb7bfx10;_0xb7bfxd[_0x787f[41]]= _0xb7bfxd[_0x787f[9]][_0x787f[27]];switch(_0xb7bfxd[_0x787f[30]][_0x787f[59]]){case _0x787f[48]:console[_0x787f[40]](_0xb7bfxd[_0x787f[10]][_0x787f[24]][_0x787f[38]](),_0x787f[42],_0xb7bfxd[_0x787f[9]][_0x787f[27]]);_0xb7bfxd[_0x787f[43]]= _[_0x787f[47]](_[_0x787f[46]](_0xb7bfx10.Users,structure[_0x787f[45]][_0x787f[44]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]]));_0xb7bfxd[_0x787f[48]]();break;case _0x787f[52]:console[_0x787f[40]](_0xb7bfxd[_0x787f[10]][_0x787f[24]][_0x787f[38]](),_0x787f[49],_0xb7bfxd[_0x787f[9]][_0x787f[27]]);_0xb7bfxd[_0x787f[43]]= _0xb7bfx10[_0x787f[50]];_0xb7bfxd[_0x787f[51]]();break;case _0x787f[58]:console[_0x787f[40]](_0xb7bfxd[_0x787f[10]][_0x787f[24]][_0x787f[38]](),_0x787f[53],_0xb7bfxd[_0x787f[9]][_0x787f[27]]);_0xb7bfxd[_0x787f[43]]= _0xb7bfx10[_0x787f[50]];if(_0xb7bfxd[_0x787f[30]][_0x787f[54]]){var _0xb7bfx11;for(var _0xb7bfx12=0;_0xb7bfx12< _0xb7bfxd[_0x787f[43]][_0x787f[55]];_0xb7bfx12++){_0xb7bfx11= _0xb7bfxd[_0x787f[43]][_0x787f[56]]();_0xb7bfxd[_0x787f[43]][_0x787f[57]](_0xb7bfx11);if(_0xb7bfx11[_0x787f[29]]=== _0xb7bfxd[_0x787f[30]][_0x787f[54]]){break}}};_0xb7bfxd[_0x787f[51]]();break;default:}})[_0x787f[21]](function(){var _0xb7bfxf=[_[_0x787f[34]](_0xb7bfxd[_0x787f[10]],{timeslot:_0xb7bfxd[_0x787f[9]][_0x787f[27]],application:_0x787f[28],queue:_0xb7bfxd[_0x787f[30]][_0x787f[29]],queuename:_0xb7bfxd[_0x787f[30]][_0x787f[31]],calledAt:moment()[_0x787f[33]](_0x787f[32]),joinAt:moment()[_0x787f[33]](_0x787f[32]),membername:null,memberid:null})];return structure[_0x787f[26]][_0x787f[36]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]][_0x787f[35]](_0xb7bfxf,{individualHooks:true})})[_0x787f[21]](function(){return structure[_0x787f[26]][_0x787f[25]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]][_0x787f[23]]({waiting:true},{where:{id:_0xb7bfxd[_0x787f[10]][_0x787f[22]]},individualHooks:true})[_0x787f[21]](function(){console[_0x787f[20]](_0x787f[19])})[_0x787f[18]](function(_0xb7bfxe){console[_0x787f[17]]()})})};Queue[_0x787f[16]][_0x787f[48]]= function beepall(){var _0xb7bfxd=this;var _0xb7bfx14=_0xb7bfxd[_0x787f[43]][_0x787f[56]]();_0xb7bfxd[_0x787f[43]][_0x787f[57]](_0xb7bfx14);var _0xb7bfx15={where:{id:{$in:_[_0x787f[65]](_0xb7bfx14,_0x787f[29])},online:true},include:[{model:structure[_0x787f[26]][_0x787f[25]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]],attributes:[_0x787f[29],_0x787f[66]]}],attributes:[_0x787f[29],_0x787f[31],_0x787f[67],_0x787f[68],_0x787f[69],_0x787f[70],_0x787f[71],_0x787f[72],_0x787f[73],_0x787f[74],_0x787f[75],_0x787f[76],_0x787f[77],_0x787f[78]]};_0xb7bfx15[_0x787f[80]][structure[_0x787f[45]][_0x787f[79]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]]]= false;var _0xb7bfx16=((_0xb7bfxd[_0x787f[9]][_0x787f[27]]- _0xb7bfxd[_0x787f[11]])> _0xb7bfxd[_0x787f[30]][_0x787f[27]])?_0xb7bfxd[_0x787f[30]][_0x787f[27]]:(_0xb7bfxd[_0x787f[9]][_0x787f[27]]- _0xb7bfxd[_0x787f[11]]);_0xb7bfxd[_0x787f[27]]= setTimeout(function(){_0xb7bfxd[_0x787f[11]]+= _0xb7bfxd[_0x787f[30]][_0x787f[27]];_0xb7bfxd[_0x787f[48]]()},_0xb7bfx16* 1000);if(_0xb7bfx16> 0){Agent[_0x787f[87]](_0xb7bfx15)[_0x787f[21]](function(_0xb7bfx17){_0xb7bfx17= _[_0x787f[84]](_0xb7bfx17,function(_0xb7bfx11){if(available(_0xb7bfx11,_0xb7bfx11[structure[_0x787f[45]][_0x787f[79]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]]],_0xb7bfxd[_0x787f[14]],_[_0x787f[82]](_0xb7bfx11[structure[_0x787f[45]][_0x787f[25]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]]],{status:_0x787f[81]}),_0xb7bfx11[structure[_0x787f[45]][_0x787f[83]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]]])){return true}else {return false}});var _0xb7bfxf=_[_0x787f[65]](_0xb7bfx17,function(_0xb7bfx11){var _0xb7bfx18=_[_0x787f[34]](_0xb7bfxd[_0x787f[10]],{timeslot:_0xb7bfx16,application:_0x787f[28],membername:_0xb7bfx11[_0x787f[31]],memberid:_0xb7bfx11[_0x787f[29]],queue:_0xb7bfxd[_0x787f[30]][_0x787f[29]],queuename:_0xb7bfxd[_0x787f[30]][_0x787f[31]],calledAt:moment()[_0x787f[33]](_0x787f[32])});return _[_0x787f[85]](_0xb7bfx18)});structure[_0x787f[26]][_0x787f[86]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]][_0x787f[35]](_0xb7bfxf,{individualHooks:true})[_0x787f[18]](function(_0xb7bfxe){console[_0x787f[17]](_0xb7bfxe)})})[_0x787f[18]](function(_0xb7bfxe){console[_0x787f[17]](_0xb7bfxe)})}else {clearTimeout(_0xb7bfxd[_0x787f[27]]);this[_0x787f[12]]()}};Queue[_0x787f[16]][_0x787f[51]]= function rr(){var _0xb7bfxd=this;var _0xb7bfx16=((_0xb7bfxd[_0x787f[9]][_0x787f[27]]- _0xb7bfxd[_0x787f[11]])> _0xb7bfxd[_0x787f[30]][_0x787f[27]])?_0xb7bfxd[_0x787f[30]][_0x787f[27]]:(_0xb7bfxd[_0x787f[9]][_0x787f[27]]- _0xb7bfxd[_0x787f[11]]);_0xb7bfxd[_0x787f[27]]= setTimeout(function(){_0xb7bfxd[_0x787f[11]]+= _0xb7bfxd[_0x787f[30]][_0x787f[27]];_0xb7bfxd[_0x787f[51]]()},_0xb7bfx16* 1000);var _0xb7bfx15={where:{id:{$in:_[_0x787f[65]](_0xb7bfxd._agents,_0x787f[29])}},include:[{model:structure[_0x787f[26]][_0x787f[25]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]],attributes:[_0x787f[29]]}],attributes:[_0x787f[29],_0x787f[31],_0x787f[67],_0x787f[68],_0x787f[69],_0x787f[70],_0x787f[71],_0x787f[72],_0x787f[73],_0x787f[74],_0x787f[75],_0x787f[76],_0x787f[77],_0x787f[78]]};if(_[_0x787f[65]](_0xb7bfxd._agents,_0x787f[29])[_0x787f[88]]()[_0x787f[55]]){_0xb7bfx15[_0x787f[89]]= [[{raw:_0x787f[90]+ _[_0x787f[65]](_0xb7bfxd._agents,_0x787f[29])[_0x787f[88]]()+ _0x787f[91]}]]};if(_0xb7bfx16> 0){Agent[_0x787f[87]](_0xb7bfx15)[_0x787f[21]](function(_0xb7bfx17){if(_0xb7bfx17[_0x787f[55]]){_0xb7bfxd[_0x787f[43]]= _0xb7bfx17;for(var _0xb7bfx12=0;_0xb7bfx12< _0xb7bfxd[_0x787f[43]][_0x787f[55]];_0xb7bfx12++){if(available(_0xb7bfxd[_0x787f[43]][0],_0xb7bfxd[_0x787f[43]][0][structure[_0x787f[45]][_0x787f[79]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]]],_0xb7bfxd[_0x787f[14]],_[_0x787f[82]](_0xb7bfxd[_0x787f[43]][0][structure[_0x787f[45]][_0x787f[25]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]]],{status:_0x787f[81]}),_0xb7bfxd[_0x787f[43]][0][structure[_0x787f[45]][_0x787f[83]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]]])){var _0xb7bfxf=[_[_0x787f[34]](_0xb7bfxd[_0x787f[10]],{timeslot:_0xb7bfx16,application:_0x787f[28],membername:_0xb7bfxd[_0x787f[43]][0][_0x787f[31]],memberid:_0xb7bfxd[_0x787f[43]][0][_0x787f[29]],queue:_0xb7bfxd[_0x787f[30]][_0x787f[29]],queuename:_0xb7bfxd[_0x787f[30]][_0x787f[31]],calledAt:moment()[_0x787f[33]](_0x787f[32])})];return structure[_0x787f[26]][_0x787f[86]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]][_0x787f[35]](_0xb7bfxf,{individualHooks:true})[_0x787f[21]](function(){return structure[_0x787f[26]][_0x787f[64]][_0xb7bfxd[_0x787f[10]][_0x787f[24]]][_0x787f[23]]({lastAgent:_0xb7bfxd[_0x787f[43]][0][_0x787f[29]]},{where:{id:_0xb7bfxd[_0x787f[30]][_0x787f[29]]}})})[_0x787f[18]](function(_0xb7bfxe){console[_0x787f[17]](_0xb7bfxe)})}else {var _0xb7bfx11=_0xb7bfxd[_0x787f[43]][_0x787f[56]]();_0xb7bfxd[_0x787f[43]][_0x787f[57]](_0xb7bfx11)}}}})[_0x787f[21]](function(){var _0xb7bfx11=_0xb7bfxd[_0x787f[43]][_0x787f[56]]();_0xb7bfxd[_0x787f[43]][_0x787f[57]](_0xb7bfx11)})[_0x787f[18]](function(_0xb7bfxe){console[_0x787f[17]](_0xb7bfxe)})}else {clearTimeout(_0xb7bfxd[_0x787f[27]]);this[_0x787f[12]]()}};function available(_0xb7bfx11,_0xb7bfx1b,_0xb7bfx1c,_0xb7bfx1d,_0xb7bfx1e){var _0xb7bfx1f=_[_0x787f[92]](_0xb7bfx1c,{id:_0xb7bfx11[_0x787f[29]]})?true:false;return _0xb7bfx11[_0x787f[68]]&&  !_0xb7bfx1b&&  !_0xb7bfx1f&& ((_0xb7bfx1d[_0x787f[55]]< _0xb7bfx1e)|| (_0xb7bfx1e=== 0))}module[_0x787f[93]]= Queue
\ No newline at end of file