Built motion from commit 62eaa14.|1.0.10
[motion.git] / server / config / routing / queue.js
index 46acb71..05d06ad 100644 (file)
@@ -1 +1 @@
-var _0xf145=["\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"];_0xf145[0];const _=require(_0xf145[1]);const config=require(_0xf145[2]);const structure=require(_0xf145[3]);const cp=require(_0xf145[4]);const util=require(_0xf145[5]);const moment=require(_0xf145[6]);const Agent=require(_0xf145[8])[_0xf145[7]];function Queue(_0xb119x9,_0xb119xa,_0xb119xb){this[_0xf145[9]]= _0xb119x9;this[_0xf145[10]]= _0xb119xa;this[_0xf145[11]]= 0;this[_0xf145[12]]= _0xb119xb;this[_0xf145[13]]= [];this[_0xf145[14]]= []}Queue[_0xf145[16]][_0xf145[15]]= function init(){var _0xb119xd=this;return structure[_0xf145[26]][_0xf145[64]][_0xb119xd[_0xf145[10]][_0xf145[24]]][_0xf145[63]](_0xb119xd[_0xf145[9]][structure[_0xf145[45]][_0xf145[60]][_0xb119xd[_0xf145[10]][_0xf145[24]]]],{attributes:[_0xf145[29],_0xf145[31],_0xf145[27],_0xf145[59],_0xf145[54]],include:[{model:Agent,attributes:[_0xf145[29]],order:[[_0xf145[61],_0xf145[62]]]}]})[_0xf145[21]](function(_0xb119x10){console[_0xf145[40]](util[_0xf145[33]](_0xf145[37],_0xb119xd[_0xf145[10]][_0xf145[24]][_0xf145[38]](),_0xb119xd[_0xf145[10]][_0xf145[39]]));_0xb119xd[_0xf145[30]]= _0xb119x10;_0xb119xd[_0xf145[41]]= _0xb119xd[_0xf145[9]][_0xf145[27]];switch(_0xb119xd[_0xf145[30]][_0xf145[59]]){case _0xf145[48]:console[_0xf145[40]](_0xb119xd[_0xf145[10]][_0xf145[24]][_0xf145[38]](),_0xf145[42],_0xb119xd[_0xf145[9]][_0xf145[27]]);_0xb119xd[_0xf145[43]]= _[_0xf145[47]](_[_0xf145[46]](_0xb119x10.Users,structure[_0xf145[45]][_0xf145[44]][_0xb119xd[_0xf145[10]][_0xf145[24]]]));_0xb119xd[_0xf145[48]]();break;case _0xf145[52]:console[_0xf145[40]](_0xb119xd[_0xf145[10]][_0xf145[24]][_0xf145[38]](),_0xf145[49],_0xb119xd[_0xf145[9]][_0xf145[27]]);_0xb119xd[_0xf145[43]]= _0xb119x10[_0xf145[50]];_0xb119xd[_0xf145[51]]();break;case _0xf145[58]:console[_0xf145[40]](_0xb119xd[_0xf145[10]][_0xf145[24]][_0xf145[38]](),_0xf145[53],_0xb119xd[_0xf145[9]][_0xf145[27]]);_0xb119xd[_0xf145[43]]= _0xb119x10[_0xf145[50]];if(_0xb119xd[_0xf145[30]][_0xf145[54]]){var _0xb119x11;for(var _0xb119x12=0;_0xb119x12< _0xb119xd[_0xf145[43]][_0xf145[55]];_0xb119x12++){_0xb119x11= _0xb119xd[_0xf145[43]][_0xf145[56]]();_0xb119xd[_0xf145[43]][_0xf145[57]](_0xb119x11);if(_0xb119x11[_0xf145[29]]=== _0xb119xd[_0xf145[30]][_0xf145[54]]){break}}};_0xb119xd[_0xf145[51]]();break;default:}})[_0xf145[21]](function(){var _0xb119xf=[_[_0xf145[34]](_0xb119xd[_0xf145[10]],{timeslot:_0xb119xd[_0xf145[9]][_0xf145[27]],application:_0xf145[28],queue:_0xb119xd[_0xf145[30]][_0xf145[29]],queuename:_0xb119xd[_0xf145[30]][_0xf145[31]],calledAt:moment()[_0xf145[33]](_0xf145[32]),joinAt:moment()[_0xf145[33]](_0xf145[32]),membername:null,memberid:null})];return structure[_0xf145[26]][_0xf145[36]][_0xb119xd[_0xf145[10]][_0xf145[24]]][_0xf145[35]](_0xb119xf,{individualHooks:true})})[_0xf145[21]](function(){return structure[_0xf145[26]][_0xf145[25]][_0xb119xd[_0xf145[10]][_0xf145[24]]][_0xf145[23]]({waiting:true},{where:{id:_0xb119xd[_0xf145[10]][_0xf145[22]]},individualHooks:true})[_0xf145[21]](function(){console[_0xf145[20]](_0xf145[19])})[_0xf145[18]](function(_0xb119xe){console[_0xf145[17]]()})})};Queue[_0xf145[16]][_0xf145[48]]= function beepall(){var _0xb119xd=this;var _0xb119x14=_0xb119xd[_0xf145[43]][_0xf145[56]]();_0xb119xd[_0xf145[43]][_0xf145[57]](_0xb119x14);var _0xb119x15={where:{id:{$in:_[_0xf145[65]](_0xb119x14,_0xf145[29])},online:true},include:[{model:structure[_0xf145[26]][_0xf145[25]][_0xb119xd[_0xf145[10]][_0xf145[24]]],attributes:[_0xf145[29],_0xf145[66]]}],attributes:[_0xf145[29],_0xf145[31],_0xf145[67],_0xf145[68],_0xf145[69],_0xf145[70],_0xf145[71],_0xf145[72],_0xf145[73],_0xf145[74],_0xf145[75],_0xf145[76],_0xf145[77],_0xf145[78]]};_0xb119x15[_0xf145[80]][structure[_0xf145[45]][_0xf145[79]][_0xb119xd[_0xf145[10]][_0xf145[24]]]]= false;var _0xb119x16=((_0xb119xd[_0xf145[9]][_0xf145[27]]- _0xb119xd[_0xf145[11]])> _0xb119xd[_0xf145[30]][_0xf145[27]])?_0xb119xd[_0xf145[30]][_0xf145[27]]:(_0xb119xd[_0xf145[9]][_0xf145[27]]- _0xb119xd[_0xf145[11]]);_0xb119xd[_0xf145[27]]= setTimeout(function(){_0xb119xd[_0xf145[11]]+= _0xb119xd[_0xf145[30]][_0xf145[27]];_0xb119xd[_0xf145[48]]()},_0xb119x16* 1000);if(_0xb119x16> 0){Agent[_0xf145[87]](_0xb119x15)[_0xf145[21]](function(_0xb119x17){_0xb119x17= _[_0xf145[84]](_0xb119x17,function(_0xb119x11){if(available(_0xb119x11,_0xb119x11[structure[_0xf145[45]][_0xf145[79]][_0xb119xd[_0xf145[10]][_0xf145[24]]]],_0xb119xd[_0xf145[14]],_[_0xf145[82]](_0xb119x11[structure[_0xf145[45]][_0xf145[25]][_0xb119xd[_0xf145[10]][_0xf145[24]]]],{status:_0xf145[81]}),_0xb119x11[structure[_0xf145[45]][_0xf145[83]][_0xb119xd[_0xf145[10]][_0xf145[24]]]])){return true}else {return false}});var _0xb119xf=_[_0xf145[65]](_0xb119x17,function(_0xb119x11){var _0xb119x18=_[_0xf145[34]](_0xb119xd[_0xf145[10]],{timeslot:_0xb119x16,application:_0xf145[28],membername:_0xb119x11[_0xf145[31]],memberid:_0xb119x11[_0xf145[29]],queue:_0xb119xd[_0xf145[30]][_0xf145[29]],queuename:_0xb119xd[_0xf145[30]][_0xf145[31]],calledAt:moment()[_0xf145[33]](_0xf145[32])});return _[_0xf145[85]](_0xb119x18)});structure[_0xf145[26]][_0xf145[86]][_0xb119xd[_0xf145[10]][_0xf145[24]]][_0xf145[35]](_0xb119xf,{individualHooks:true})[_0xf145[18]](function(_0xb119xe){console[_0xf145[17]](_0xb119xe)})})[_0xf145[18]](function(_0xb119xe){console[_0xf145[17]](_0xb119xe)})}else {clearTimeout(_0xb119xd[_0xf145[27]]);this[_0xf145[12]]()}};Queue[_0xf145[16]][_0xf145[51]]= function rr(){var _0xb119xd=this;var _0xb119x16=((_0xb119xd[_0xf145[9]][_0xf145[27]]- _0xb119xd[_0xf145[11]])> _0xb119xd[_0xf145[30]][_0xf145[27]])?_0xb119xd[_0xf145[30]][_0xf145[27]]:(_0xb119xd[_0xf145[9]][_0xf145[27]]- _0xb119xd[_0xf145[11]]);_0xb119xd[_0xf145[27]]= setTimeout(function(){_0xb119xd[_0xf145[11]]+= _0xb119xd[_0xf145[30]][_0xf145[27]];_0xb119xd[_0xf145[51]]()},_0xb119x16* 1000);var _0xb119x15={where:{id:{$in:_[_0xf145[65]](_0xb119xd._agents,_0xf145[29])}},include:[{model:structure[_0xf145[26]][_0xf145[25]][_0xb119xd[_0xf145[10]][_0xf145[24]]],attributes:[_0xf145[29]]}],attributes:[_0xf145[29],_0xf145[31],_0xf145[67],_0xf145[68],_0xf145[69],_0xf145[70],_0xf145[71],_0xf145[72],_0xf145[73],_0xf145[74],_0xf145[75],_0xf145[76],_0xf145[77],_0xf145[78]]};if(_[_0xf145[65]](_0xb119xd._agents,_0xf145[29])[_0xf145[88]]()[_0xf145[55]]){_0xb119x15[_0xf145[89]]= [[{raw:_0xf145[90]+ _[_0xf145[65]](_0xb119xd._agents,_0xf145[29])[_0xf145[88]]()+ _0xf145[91]}]]};if(_0xb119x16> 0){Agent[_0xf145[87]](_0xb119x15)[_0xf145[21]](function(_0xb119x17){if(_0xb119x17[_0xf145[55]]){_0xb119xd[_0xf145[43]]= _0xb119x17;for(var _0xb119x12=0;_0xb119x12< _0xb119xd[_0xf145[43]][_0xf145[55]];_0xb119x12++){if(available(_0xb119xd[_0xf145[43]][0],_0xb119xd[_0xf145[43]][0][structure[_0xf145[45]][_0xf145[79]][_0xb119xd[_0xf145[10]][_0xf145[24]]]],_0xb119xd[_0xf145[14]],_[_0xf145[82]](_0xb119xd[_0xf145[43]][0][structure[_0xf145[45]][_0xf145[25]][_0xb119xd[_0xf145[10]][_0xf145[24]]]],{status:_0xf145[81]}),_0xb119xd[_0xf145[43]][0][structure[_0xf145[45]][_0xf145[83]][_0xb119xd[_0xf145[10]][_0xf145[24]]]])){var _0xb119xf=[_[_0xf145[34]](_0xb119xd[_0xf145[10]],{timeslot:_0xb119x16,application:_0xf145[28],membername:_0xb119xd[_0xf145[43]][0][_0xf145[31]],memberid:_0xb119xd[_0xf145[43]][0][_0xf145[29]],queue:_0xb119xd[_0xf145[30]][_0xf145[29]],queuename:_0xb119xd[_0xf145[30]][_0xf145[31]],calledAt:moment()[_0xf145[33]](_0xf145[32])})];return structure[_0xf145[26]][_0xf145[86]][_0xb119xd[_0xf145[10]][_0xf145[24]]][_0xf145[35]](_0xb119xf,{individualHooks:true})[_0xf145[21]](function(){return structure[_0xf145[26]][_0xf145[64]][_0xb119xd[_0xf145[10]][_0xf145[24]]][_0xf145[23]]({lastAgent:_0xb119xd[_0xf145[43]][0][_0xf145[29]]},{where:{id:_0xb119xd[_0xf145[30]][_0xf145[29]]}})})[_0xf145[18]](function(_0xb119xe){console[_0xf145[17]](_0xb119xe)})}else {var _0xb119x11=_0xb119xd[_0xf145[43]][_0xf145[56]]();_0xb119xd[_0xf145[43]][_0xf145[57]](_0xb119x11)}}}})[_0xf145[21]](function(){var _0xb119x11=_0xb119xd[_0xf145[43]][_0xf145[56]]();_0xb119xd[_0xf145[43]][_0xf145[57]](_0xb119x11)})[_0xf145[18]](function(_0xb119xe){console[_0xf145[17]](_0xb119xe)})}else {clearTimeout(_0xb119xd[_0xf145[27]]);this[_0xf145[12]]()}};function available(_0xb119x11,_0xb119x1b,_0xb119x1c,_0xb119x1d,_0xb119x1e){var _0xb119x1f=_[_0xf145[92]](_0xb119x1c,{id:_0xb119x11[_0xf145[29]]})?true:false;return _0xb119x11[_0xf145[68]]&& !_0xb119x1b&& !_0xb119x1f&& ((_0xb119x1d[_0xf145[55]]< _0xb119x1e)|| (_0xb119x1e=== 0))}module[_0xf145[93]]= Queue
\ No newline at end of file
+var _0x2c31=["\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"];_0x2c31[0];const _=require(_0x2c31[1]);const config=require(_0x2c31[2]);const structure=require(_0x2c31[3]);const cp=require(_0x2c31[4]);const util=require(_0x2c31[5]);const moment=require(_0x2c31[6]);const Agent=require(_0x2c31[8])[_0x2c31[7]];function Queue(_0xc322x9,_0xc322xa,_0xc322xb){this[_0x2c31[9]]= _0xc322x9;this[_0x2c31[10]]= _0xc322xa;this[_0x2c31[11]]= 0;this[_0x2c31[12]]= _0xc322xb;this[_0x2c31[13]]= [];this[_0x2c31[14]]= []}Queue[_0x2c31[16]][_0x2c31[15]]= function init(){var _0xc322xd=this;return structure[_0x2c31[26]][_0x2c31[64]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]][_0x2c31[63]](_0xc322xd[_0x2c31[9]][structure[_0x2c31[45]][_0x2c31[60]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]]],{attributes:[_0x2c31[29],_0x2c31[31],_0x2c31[27],_0x2c31[59],_0x2c31[54]],include:[{model:Agent,attributes:[_0x2c31[29]],order:[[_0x2c31[61],_0x2c31[62]]]}]})[_0x2c31[21]](function(_0xc322x10){console[_0x2c31[40]](util[_0x2c31[33]](_0x2c31[37],_0xc322xd[_0x2c31[10]][_0x2c31[24]][_0x2c31[38]](),_0xc322xd[_0x2c31[10]][_0x2c31[39]]));_0xc322xd[_0x2c31[30]]= _0xc322x10;_0xc322xd[_0x2c31[41]]= _0xc322xd[_0x2c31[9]][_0x2c31[27]];switch(_0xc322xd[_0x2c31[30]][_0x2c31[59]]){case _0x2c31[48]:console[_0x2c31[40]](_0xc322xd[_0x2c31[10]][_0x2c31[24]][_0x2c31[38]](),_0x2c31[42],_0xc322xd[_0x2c31[9]][_0x2c31[27]]);_0xc322xd[_0x2c31[43]]= _[_0x2c31[47]](_[_0x2c31[46]](_0xc322x10.Users,structure[_0x2c31[45]][_0x2c31[44]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]]));_0xc322xd[_0x2c31[48]]();break;case _0x2c31[52]:console[_0x2c31[40]](_0xc322xd[_0x2c31[10]][_0x2c31[24]][_0x2c31[38]](),_0x2c31[49],_0xc322xd[_0x2c31[9]][_0x2c31[27]]);_0xc322xd[_0x2c31[43]]= _0xc322x10[_0x2c31[50]];_0xc322xd[_0x2c31[51]]();break;case _0x2c31[58]:console[_0x2c31[40]](_0xc322xd[_0x2c31[10]][_0x2c31[24]][_0x2c31[38]](),_0x2c31[53],_0xc322xd[_0x2c31[9]][_0x2c31[27]]);_0xc322xd[_0x2c31[43]]= _0xc322x10[_0x2c31[50]];if(_0xc322xd[_0x2c31[30]][_0x2c31[54]]){var _0xc322x11;for(var _0xc322x12=0;_0xc322x12< _0xc322xd[_0x2c31[43]][_0x2c31[55]];_0xc322x12++){_0xc322x11= _0xc322xd[_0x2c31[43]][_0x2c31[56]]();_0xc322xd[_0x2c31[43]][_0x2c31[57]](_0xc322x11);if(_0xc322x11[_0x2c31[29]]=== _0xc322xd[_0x2c31[30]][_0x2c31[54]]){break}}};_0xc322xd[_0x2c31[51]]();break;default:}})[_0x2c31[21]](function(){var _0xc322xf=[_[_0x2c31[34]](_0xc322xd[_0x2c31[10]],{timeslot:_0xc322xd[_0x2c31[9]][_0x2c31[27]],application:_0x2c31[28],queue:_0xc322xd[_0x2c31[30]][_0x2c31[29]],queuename:_0xc322xd[_0x2c31[30]][_0x2c31[31]],calledAt:moment()[_0x2c31[33]](_0x2c31[32]),joinAt:moment()[_0x2c31[33]](_0x2c31[32]),membername:null,memberid:null})];return structure[_0x2c31[26]][_0x2c31[36]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]][_0x2c31[35]](_0xc322xf,{individualHooks:true})})[_0x2c31[21]](function(){return structure[_0x2c31[26]][_0x2c31[25]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]][_0x2c31[23]]({waiting:true},{where:{id:_0xc322xd[_0x2c31[10]][_0x2c31[22]]},individualHooks:true})[_0x2c31[21]](function(){console[_0x2c31[20]](_0x2c31[19])})[_0x2c31[18]](function(_0xc322xe){console[_0x2c31[17]]()})})};Queue[_0x2c31[16]][_0x2c31[48]]= function beepall(){var _0xc322xd=this;var _0xc322x14=_0xc322xd[_0x2c31[43]][_0x2c31[56]]();_0xc322xd[_0x2c31[43]][_0x2c31[57]](_0xc322x14);var _0xc322x15={where:{id:{$in:_[_0x2c31[65]](_0xc322x14,_0x2c31[29])},online:true},include:[{model:structure[_0x2c31[26]][_0x2c31[25]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]],attributes:[_0x2c31[29],_0x2c31[66]]}],attributes:[_0x2c31[29],_0x2c31[31],_0x2c31[67],_0x2c31[68],_0x2c31[69],_0x2c31[70],_0x2c31[71],_0x2c31[72],_0x2c31[73],_0x2c31[74],_0x2c31[75],_0x2c31[76],_0x2c31[77],_0x2c31[78]]};_0xc322x15[_0x2c31[80]][structure[_0x2c31[45]][_0x2c31[79]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]]]= false;var _0xc322x16=((_0xc322xd[_0x2c31[9]][_0x2c31[27]]- _0xc322xd[_0x2c31[11]])> _0xc322xd[_0x2c31[30]][_0x2c31[27]])?_0xc322xd[_0x2c31[30]][_0x2c31[27]]:(_0xc322xd[_0x2c31[9]][_0x2c31[27]]- _0xc322xd[_0x2c31[11]]);_0xc322xd[_0x2c31[27]]= setTimeout(function(){_0xc322xd[_0x2c31[11]]+= _0xc322xd[_0x2c31[30]][_0x2c31[27]];_0xc322xd[_0x2c31[48]]()},_0xc322x16* 1000);if(_0xc322x16> 0){Agent[_0x2c31[87]](_0xc322x15)[_0x2c31[21]](function(_0xc322x17){_0xc322x17= _[_0x2c31[84]](_0xc322x17,function(_0xc322x11){if(available(_0xc322x11,_0xc322x11[structure[_0x2c31[45]][_0x2c31[79]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]]],_0xc322xd[_0x2c31[14]],_[_0x2c31[82]](_0xc322x11[structure[_0x2c31[45]][_0x2c31[25]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]]],{status:_0x2c31[81]}),_0xc322x11[structure[_0x2c31[45]][_0x2c31[83]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]]])){return true}else {return false}});var _0xc322xf=_[_0x2c31[65]](_0xc322x17,function(_0xc322x11){var _0xc322x18=_[_0x2c31[34]](_0xc322xd[_0x2c31[10]],{timeslot:_0xc322x16,application:_0x2c31[28],membername:_0xc322x11[_0x2c31[31]],memberid:_0xc322x11[_0x2c31[29]],queue:_0xc322xd[_0x2c31[30]][_0x2c31[29]],queuename:_0xc322xd[_0x2c31[30]][_0x2c31[31]],calledAt:moment()[_0x2c31[33]](_0x2c31[32])});return _[_0x2c31[85]](_0xc322x18)});structure[_0x2c31[26]][_0x2c31[86]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]][_0x2c31[35]](_0xc322xf,{individualHooks:true})[_0x2c31[18]](function(_0xc322xe){console[_0x2c31[17]](_0xc322xe)})})[_0x2c31[18]](function(_0xc322xe){console[_0x2c31[17]](_0xc322xe)})}else {clearTimeout(_0xc322xd[_0x2c31[27]]);this[_0x2c31[12]]()}};Queue[_0x2c31[16]][_0x2c31[51]]= function rr(){var _0xc322xd=this;var _0xc322x16=((_0xc322xd[_0x2c31[9]][_0x2c31[27]]- _0xc322xd[_0x2c31[11]])> _0xc322xd[_0x2c31[30]][_0x2c31[27]])?_0xc322xd[_0x2c31[30]][_0x2c31[27]]:(_0xc322xd[_0x2c31[9]][_0x2c31[27]]- _0xc322xd[_0x2c31[11]]);_0xc322xd[_0x2c31[27]]= setTimeout(function(){_0xc322xd[_0x2c31[11]]+= _0xc322xd[_0x2c31[30]][_0x2c31[27]];_0xc322xd[_0x2c31[51]]()},_0xc322x16* 1000);var _0xc322x15={where:{id:{$in:_[_0x2c31[65]](_0xc322xd._agents,_0x2c31[29])}},include:[{model:structure[_0x2c31[26]][_0x2c31[25]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]],attributes:[_0x2c31[29]]}],attributes:[_0x2c31[29],_0x2c31[31],_0x2c31[67],_0x2c31[68],_0x2c31[69],_0x2c31[70],_0x2c31[71],_0x2c31[72],_0x2c31[73],_0x2c31[74],_0x2c31[75],_0x2c31[76],_0x2c31[77],_0x2c31[78]]};if(_[_0x2c31[65]](_0xc322xd._agents,_0x2c31[29])[_0x2c31[88]]()[_0x2c31[55]]){_0xc322x15[_0x2c31[89]]= [[{raw:_0x2c31[90]+ _[_0x2c31[65]](_0xc322xd._agents,_0x2c31[29])[_0x2c31[88]]()+ _0x2c31[91]}]]};if(_0xc322x16> 0){Agent[_0x2c31[87]](_0xc322x15)[_0x2c31[21]](function(_0xc322x17){if(_0xc322x17[_0x2c31[55]]){_0xc322xd[_0x2c31[43]]= _0xc322x17;for(var _0xc322x12=0;_0xc322x12< _0xc322xd[_0x2c31[43]][_0x2c31[55]];_0xc322x12++){if(available(_0xc322xd[_0x2c31[43]][0],_0xc322xd[_0x2c31[43]][0][structure[_0x2c31[45]][_0x2c31[79]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]]],_0xc322xd[_0x2c31[14]],_[_0x2c31[82]](_0xc322xd[_0x2c31[43]][0][structure[_0x2c31[45]][_0x2c31[25]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]]],{status:_0x2c31[81]}),_0xc322xd[_0x2c31[43]][0][structure[_0x2c31[45]][_0x2c31[83]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]]])){var _0xc322xf=[_[_0x2c31[34]](_0xc322xd[_0x2c31[10]],{timeslot:_0xc322x16,application:_0x2c31[28],membername:_0xc322xd[_0x2c31[43]][0][_0x2c31[31]],memberid:_0xc322xd[_0x2c31[43]][0][_0x2c31[29]],queue:_0xc322xd[_0x2c31[30]][_0x2c31[29]],queuename:_0xc322xd[_0x2c31[30]][_0x2c31[31]],calledAt:moment()[_0x2c31[33]](_0x2c31[32])})];return structure[_0x2c31[26]][_0x2c31[86]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]][_0x2c31[35]](_0xc322xf,{individualHooks:true})[_0x2c31[21]](function(){return structure[_0x2c31[26]][_0x2c31[64]][_0xc322xd[_0x2c31[10]][_0x2c31[24]]][_0x2c31[23]]({lastAgent:_0xc322xd[_0x2c31[43]][0][_0x2c31[29]]},{where:{id:_0xc322xd[_0x2c31[30]][_0x2c31[29]]}})})[_0x2c31[18]](function(_0xc322xe){console[_0x2c31[17]](_0xc322xe)})}else {var _0xc322x11=_0xc322xd[_0x2c31[43]][_0x2c31[56]]();_0xc322xd[_0x2c31[43]][_0x2c31[57]](_0xc322x11)}}}})[_0x2c31[21]](function(){var _0xc322x11=_0xc322xd[_0x2c31[43]][_0x2c31[56]]();_0xc322xd[_0x2c31[43]][_0x2c31[57]](_0xc322x11)})[_0x2c31[18]](function(_0xc322xe){console[_0x2c31[17]](_0xc322xe)})}else {clearTimeout(_0xc322xd[_0x2c31[27]]);this[_0x2c31[12]]()}};function available(_0xc322x11,_0xc322x1b,_0xc322x1c,_0xc322x1d,_0xc322x1e){var _0xc322x1f=_[_0x2c31[92]](_0xc322x1c,{id:_0xc322x11[_0x2c31[29]]})?true:false;return _0xc322x11[_0x2c31[68]]&& !_0xc322x1b&& !_0xc322x1f&& ((_0xc322x1d[_0x2c31[55]]< _0xc322x1e)|| (_0xc322x1e=== 0))}module[_0x2c31[93]]= Queue
\ No newline at end of file