Built motion from commit 4d2cf597c.|1.0.26
[motion.git] / server / config / routing / queue.js
index f2bcbbb..adcebf3 100644 (file)
@@ -1 +1 @@
-var _0x5038=["\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"];_0x5038[0];const _=require(_0x5038[1]);const config=require(_0x5038[2]);const structure=require(_0x5038[3]);const cp=require(_0x5038[4]);const util=require(_0x5038[5]);const moment=require(_0x5038[6]);const Agent=require(_0x5038[8])[_0x5038[7]];function Queue(_0xed22x9,_0xed22xa,_0xed22xb){this[_0x5038[9]]= _0xed22x9;this[_0x5038[10]]= _0xed22xa;this[_0x5038[11]]= 0;this[_0x5038[12]]= _0xed22xb;this[_0x5038[13]]= [];this[_0x5038[14]]= []}Queue[_0x5038[16]][_0x5038[15]]= function init(){var _0xed22xd=this;return structure[_0x5038[26]][_0x5038[64]][_0xed22xd[_0x5038[10]][_0x5038[24]]][_0x5038[63]](_0xed22xd[_0x5038[9]][structure[_0x5038[45]][_0x5038[60]][_0xed22xd[_0x5038[10]][_0x5038[24]]]],{attributes:[_0x5038[29],_0x5038[31],_0x5038[27],_0x5038[59],_0x5038[54]],include:[{model:Agent,attributes:[_0x5038[29]],order:[[_0x5038[61],_0x5038[62]]]}]})[_0x5038[21]](function(_0xed22x10){console[_0x5038[40]](util[_0x5038[33]](_0x5038[37],_0xed22xd[_0x5038[10]][_0x5038[24]][_0x5038[38]](),_0xed22xd[_0x5038[10]][_0x5038[39]]));_0xed22xd[_0x5038[30]]= _0xed22x10;_0xed22xd[_0x5038[41]]= _0xed22xd[_0x5038[9]][_0x5038[27]];switch(_0xed22xd[_0x5038[30]][_0x5038[59]]){case _0x5038[48]:console[_0x5038[40]](_0xed22xd[_0x5038[10]][_0x5038[24]][_0x5038[38]](),_0x5038[42],_0xed22xd[_0x5038[9]][_0x5038[27]]);_0xed22xd[_0x5038[43]]= _[_0x5038[47]](_[_0x5038[46]](_0xed22x10.Users,structure[_0x5038[45]][_0x5038[44]][_0xed22xd[_0x5038[10]][_0x5038[24]]]));_0xed22xd[_0x5038[48]]();break;case _0x5038[52]:console[_0x5038[40]](_0xed22xd[_0x5038[10]][_0x5038[24]][_0x5038[38]](),_0x5038[49],_0xed22xd[_0x5038[9]][_0x5038[27]]);_0xed22xd[_0x5038[43]]= _0xed22x10[_0x5038[50]];_0xed22xd[_0x5038[51]]();break;case _0x5038[58]:console[_0x5038[40]](_0xed22xd[_0x5038[10]][_0x5038[24]][_0x5038[38]](),_0x5038[53],_0xed22xd[_0x5038[9]][_0x5038[27]]);_0xed22xd[_0x5038[43]]= _0xed22x10[_0x5038[50]];if(_0xed22xd[_0x5038[30]][_0x5038[54]]){var _0xed22x11;for(var _0xed22x12=0;_0xed22x12< _0xed22xd[_0x5038[43]][_0x5038[55]];_0xed22x12++){_0xed22x11= _0xed22xd[_0x5038[43]][_0x5038[56]]();_0xed22xd[_0x5038[43]][_0x5038[57]](_0xed22x11);if(_0xed22x11[_0x5038[29]]=== _0xed22xd[_0x5038[30]][_0x5038[54]]){break}}};_0xed22xd[_0x5038[51]]();break;default:}})[_0x5038[21]](function(){var _0xed22xf=[_[_0x5038[34]](_0xed22xd[_0x5038[10]],{timeslot:_0xed22xd[_0x5038[9]][_0x5038[27]],application:_0x5038[28],queue:_0xed22xd[_0x5038[30]][_0x5038[29]],queuename:_0xed22xd[_0x5038[30]][_0x5038[31]],calledAt:moment()[_0x5038[33]](_0x5038[32]),joinAt:moment()[_0x5038[33]](_0x5038[32]),membername:null,memberid:null})];return structure[_0x5038[26]][_0x5038[36]][_0xed22xd[_0x5038[10]][_0x5038[24]]][_0x5038[35]](_0xed22xf,{individualHooks:true})})[_0x5038[21]](function(){return structure[_0x5038[26]][_0x5038[25]][_0xed22xd[_0x5038[10]][_0x5038[24]]][_0x5038[23]]({waiting:true},{where:{id:_0xed22xd[_0x5038[10]][_0x5038[22]]},individualHooks:true})[_0x5038[21]](function(){console[_0x5038[20]](_0x5038[19])})[_0x5038[18]](function(_0xed22xe){console[_0x5038[17]]()})})};Queue[_0x5038[16]][_0x5038[48]]= function beepall(){var _0xed22xd=this;var _0xed22x14=_0xed22xd[_0x5038[43]][_0x5038[56]]();_0xed22xd[_0x5038[43]][_0x5038[57]](_0xed22x14);var _0xed22x15={where:{id:{$in:_[_0x5038[65]](_0xed22x14,_0x5038[29])},online:true},include:[{model:structure[_0x5038[26]][_0x5038[25]][_0xed22xd[_0x5038[10]][_0x5038[24]]],attributes:[_0x5038[29],_0x5038[66]]}],attributes:[_0x5038[29],_0x5038[31],_0x5038[67],_0x5038[68],_0x5038[69],_0x5038[70],_0x5038[71],_0x5038[72],_0x5038[73],_0x5038[74],_0x5038[75],_0x5038[76],_0x5038[77],_0x5038[78]]};_0xed22x15[_0x5038[80]][structure[_0x5038[45]][_0x5038[79]][_0xed22xd[_0x5038[10]][_0x5038[24]]]]= false;var _0xed22x16=((_0xed22xd[_0x5038[9]][_0x5038[27]]- _0xed22xd[_0x5038[11]])> _0xed22xd[_0x5038[30]][_0x5038[27]])?_0xed22xd[_0x5038[30]][_0x5038[27]]:(_0xed22xd[_0x5038[9]][_0x5038[27]]- _0xed22xd[_0x5038[11]]);_0xed22xd[_0x5038[27]]= setTimeout(function(){_0xed22xd[_0x5038[11]]+= _0xed22xd[_0x5038[30]][_0x5038[27]];_0xed22xd[_0x5038[48]]()},_0xed22x16* 1000);if(_0xed22x16> 0){Agent[_0x5038[87]](_0xed22x15)[_0x5038[21]](function(_0xed22x17){_0xed22x17= _[_0x5038[84]](_0xed22x17,function(_0xed22x11){if(available(_0xed22x11,_0xed22x11[structure[_0x5038[45]][_0x5038[79]][_0xed22xd[_0x5038[10]][_0x5038[24]]]],_0xed22xd[_0x5038[14]],_[_0x5038[82]](_0xed22x11[structure[_0x5038[45]][_0x5038[25]][_0xed22xd[_0x5038[10]][_0x5038[24]]]],{status:_0x5038[81]}),_0xed22x11[structure[_0x5038[45]][_0x5038[83]][_0xed22xd[_0x5038[10]][_0x5038[24]]]])){return true}else {return false}});var _0xed22xf=_[_0x5038[65]](_0xed22x17,function(_0xed22x11){var _0xed22x18=_[_0x5038[34]](_0xed22xd[_0x5038[10]],{timeslot:_0xed22x16,application:_0x5038[28],membername:_0xed22x11[_0x5038[31]],memberid:_0xed22x11[_0x5038[29]],queue:_0xed22xd[_0x5038[30]][_0x5038[29]],queuename:_0xed22xd[_0x5038[30]][_0x5038[31]],calledAt:moment()[_0x5038[33]](_0x5038[32])});return _[_0x5038[85]](_0xed22x18)});structure[_0x5038[26]][_0x5038[86]][_0xed22xd[_0x5038[10]][_0x5038[24]]][_0x5038[35]](_0xed22xf,{individualHooks:true})[_0x5038[18]](function(_0xed22xe){console[_0x5038[17]](_0xed22xe)})})[_0x5038[18]](function(_0xed22xe){console[_0x5038[17]](_0xed22xe)})}else {clearTimeout(_0xed22xd[_0x5038[27]]);this[_0x5038[12]]()}};Queue[_0x5038[16]][_0x5038[51]]= function rr(){var _0xed22xd=this;var _0xed22x16=((_0xed22xd[_0x5038[9]][_0x5038[27]]- _0xed22xd[_0x5038[11]])> _0xed22xd[_0x5038[30]][_0x5038[27]])?_0xed22xd[_0x5038[30]][_0x5038[27]]:(_0xed22xd[_0x5038[9]][_0x5038[27]]- _0xed22xd[_0x5038[11]]);_0xed22xd[_0x5038[27]]= setTimeout(function(){_0xed22xd[_0x5038[11]]+= _0xed22xd[_0x5038[30]][_0x5038[27]];_0xed22xd[_0x5038[51]]()},_0xed22x16* 1000);var _0xed22x15={where:{id:{$in:_[_0x5038[65]](_0xed22xd._agents,_0x5038[29])}},include:[{model:structure[_0x5038[26]][_0x5038[25]][_0xed22xd[_0x5038[10]][_0x5038[24]]],attributes:[_0x5038[29]]}],attributes:[_0x5038[29],_0x5038[31],_0x5038[67],_0x5038[68],_0x5038[69],_0x5038[70],_0x5038[71],_0x5038[72],_0x5038[73],_0x5038[74],_0x5038[75],_0x5038[76],_0x5038[77],_0x5038[78]]};if(_[_0x5038[65]](_0xed22xd._agents,_0x5038[29])[_0x5038[88]]()[_0x5038[55]]){_0xed22x15[_0x5038[89]]= [[{raw:_0x5038[90]+ _[_0x5038[65]](_0xed22xd._agents,_0x5038[29])[_0x5038[88]]()+ _0x5038[91]}]]};if(_0xed22x16> 0){Agent[_0x5038[87]](_0xed22x15)[_0x5038[21]](function(_0xed22x17){if(_0xed22x17[_0x5038[55]]){_0xed22xd[_0x5038[43]]= _0xed22x17;for(var _0xed22x12=0;_0xed22x12< _0xed22xd[_0x5038[43]][_0x5038[55]];_0xed22x12++){if(available(_0xed22xd[_0x5038[43]][0],_0xed22xd[_0x5038[43]][0][structure[_0x5038[45]][_0x5038[79]][_0xed22xd[_0x5038[10]][_0x5038[24]]]],_0xed22xd[_0x5038[14]],_[_0x5038[82]](_0xed22xd[_0x5038[43]][0][structure[_0x5038[45]][_0x5038[25]][_0xed22xd[_0x5038[10]][_0x5038[24]]]],{status:_0x5038[81]}),_0xed22xd[_0x5038[43]][0][structure[_0x5038[45]][_0x5038[83]][_0xed22xd[_0x5038[10]][_0x5038[24]]]])){var _0xed22xf=[_[_0x5038[34]](_0xed22xd[_0x5038[10]],{timeslot:_0xed22x16,application:_0x5038[28],membername:_0xed22xd[_0x5038[43]][0][_0x5038[31]],memberid:_0xed22xd[_0x5038[43]][0][_0x5038[29]],queue:_0xed22xd[_0x5038[30]][_0x5038[29]],queuename:_0xed22xd[_0x5038[30]][_0x5038[31]],calledAt:moment()[_0x5038[33]](_0x5038[32])})];return structure[_0x5038[26]][_0x5038[86]][_0xed22xd[_0x5038[10]][_0x5038[24]]][_0x5038[35]](_0xed22xf,{individualHooks:true})[_0x5038[21]](function(){return structure[_0x5038[26]][_0x5038[64]][_0xed22xd[_0x5038[10]][_0x5038[24]]][_0x5038[23]]({lastAgent:_0xed22xd[_0x5038[43]][0][_0x5038[29]]},{where:{id:_0xed22xd[_0x5038[30]][_0x5038[29]]}})})[_0x5038[18]](function(_0xed22xe){console[_0x5038[17]](_0xed22xe)})}else {var _0xed22x11=_0xed22xd[_0x5038[43]][_0x5038[56]]();_0xed22xd[_0x5038[43]][_0x5038[57]](_0xed22x11)}}}})[_0x5038[21]](function(){var _0xed22x11=_0xed22xd[_0x5038[43]][_0x5038[56]]();_0xed22xd[_0x5038[43]][_0x5038[57]](_0xed22x11)})[_0x5038[18]](function(_0xed22xe){console[_0x5038[17]](_0xed22xe)})}else {clearTimeout(_0xed22xd[_0x5038[27]]);this[_0x5038[12]]()}};function available(_0xed22x11,_0xed22x1b,_0xed22x1c,_0xed22x1d,_0xed22x1e){var _0xed22x1f=_[_0x5038[92]](_0xed22x1c,{id:_0xed22x11[_0x5038[29]]})?true:false;return _0xed22x11[_0x5038[68]]&& !_0xed22x1b&& !_0xed22x1f&& ((_0xed22x1d[_0x5038[55]]< _0xed22x1e)|| (_0xed22x1e=== 0))}module[_0x5038[93]]= Queue
\ No newline at end of file
+var _0xaa10=["\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"];_0xaa10[0];const _=require(_0xaa10[1]);const config=require(_0xaa10[2]);const structure=require(_0xaa10[3]);const cp=require(_0xaa10[4]);const util=require(_0xaa10[5]);const moment=require(_0xaa10[6]);const Agent=require(_0xaa10[8])[_0xaa10[7]];function Queue(_0x494dx9,_0x494dxa,_0x494dxb){this[_0xaa10[9]]= _0x494dx9;this[_0xaa10[10]]= _0x494dxa;this[_0xaa10[11]]= 0;this[_0xaa10[12]]= _0x494dxb;this[_0xaa10[13]]= [];this[_0xaa10[14]]= []}Queue[_0xaa10[16]][_0xaa10[15]]= function init(){var _0x494dxd=this;return structure[_0xaa10[26]][_0xaa10[64]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]][_0xaa10[63]](_0x494dxd[_0xaa10[9]][structure[_0xaa10[45]][_0xaa10[60]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]]],{attributes:[_0xaa10[29],_0xaa10[31],_0xaa10[27],_0xaa10[59],_0xaa10[54]],include:[{model:Agent,attributes:[_0xaa10[29]],order:[[_0xaa10[61],_0xaa10[62]]]}]})[_0xaa10[21]](function(_0x494dx10){console[_0xaa10[40]](util[_0xaa10[33]](_0xaa10[37],_0x494dxd[_0xaa10[10]][_0xaa10[24]][_0xaa10[38]](),_0x494dxd[_0xaa10[10]][_0xaa10[39]]));_0x494dxd[_0xaa10[30]]= _0x494dx10;_0x494dxd[_0xaa10[41]]= _0x494dxd[_0xaa10[9]][_0xaa10[27]];switch(_0x494dxd[_0xaa10[30]][_0xaa10[59]]){case _0xaa10[48]:console[_0xaa10[40]](_0x494dxd[_0xaa10[10]][_0xaa10[24]][_0xaa10[38]](),_0xaa10[42],_0x494dxd[_0xaa10[9]][_0xaa10[27]]);_0x494dxd[_0xaa10[43]]= _[_0xaa10[47]](_[_0xaa10[46]](_0x494dx10.Users,structure[_0xaa10[45]][_0xaa10[44]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]]));_0x494dxd[_0xaa10[48]]();break;case _0xaa10[52]:console[_0xaa10[40]](_0x494dxd[_0xaa10[10]][_0xaa10[24]][_0xaa10[38]](),_0xaa10[49],_0x494dxd[_0xaa10[9]][_0xaa10[27]]);_0x494dxd[_0xaa10[43]]= _0x494dx10[_0xaa10[50]];_0x494dxd[_0xaa10[51]]();break;case _0xaa10[58]:console[_0xaa10[40]](_0x494dxd[_0xaa10[10]][_0xaa10[24]][_0xaa10[38]](),_0xaa10[53],_0x494dxd[_0xaa10[9]][_0xaa10[27]]);_0x494dxd[_0xaa10[43]]= _0x494dx10[_0xaa10[50]];if(_0x494dxd[_0xaa10[30]][_0xaa10[54]]){var _0x494dx11;for(var _0x494dx12=0;_0x494dx12< _0x494dxd[_0xaa10[43]][_0xaa10[55]];_0x494dx12++){_0x494dx11= _0x494dxd[_0xaa10[43]][_0xaa10[56]]();_0x494dxd[_0xaa10[43]][_0xaa10[57]](_0x494dx11);if(_0x494dx11[_0xaa10[29]]=== _0x494dxd[_0xaa10[30]][_0xaa10[54]]){break}}};_0x494dxd[_0xaa10[51]]();break;default:}})[_0xaa10[21]](function(){var _0x494dxf=[_[_0xaa10[34]](_0x494dxd[_0xaa10[10]],{timeslot:_0x494dxd[_0xaa10[9]][_0xaa10[27]],application:_0xaa10[28],queue:_0x494dxd[_0xaa10[30]][_0xaa10[29]],queuename:_0x494dxd[_0xaa10[30]][_0xaa10[31]],calledAt:moment()[_0xaa10[33]](_0xaa10[32]),joinAt:moment()[_0xaa10[33]](_0xaa10[32]),membername:null,memberid:null})];return structure[_0xaa10[26]][_0xaa10[36]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]][_0xaa10[35]](_0x494dxf,{individualHooks:true})})[_0xaa10[21]](function(){return structure[_0xaa10[26]][_0xaa10[25]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]][_0xaa10[23]]({waiting:true},{where:{id:_0x494dxd[_0xaa10[10]][_0xaa10[22]]},individualHooks:true})[_0xaa10[21]](function(){console[_0xaa10[20]](_0xaa10[19])})[_0xaa10[18]](function(_0x494dxe){console[_0xaa10[17]]()})})};Queue[_0xaa10[16]][_0xaa10[48]]= function beepall(){var _0x494dxd=this;var _0x494dx14=_0x494dxd[_0xaa10[43]][_0xaa10[56]]();_0x494dxd[_0xaa10[43]][_0xaa10[57]](_0x494dx14);var _0x494dx15={where:{id:{$in:_[_0xaa10[65]](_0x494dx14,_0xaa10[29])},online:true},include:[{model:structure[_0xaa10[26]][_0xaa10[25]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]],attributes:[_0xaa10[29],_0xaa10[66]]}],attributes:[_0xaa10[29],_0xaa10[31],_0xaa10[67],_0xaa10[68],_0xaa10[69],_0xaa10[70],_0xaa10[71],_0xaa10[72],_0xaa10[73],_0xaa10[74],_0xaa10[75],_0xaa10[76],_0xaa10[77],_0xaa10[78]]};_0x494dx15[_0xaa10[80]][structure[_0xaa10[45]][_0xaa10[79]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]]]= false;var _0x494dx16=((_0x494dxd[_0xaa10[9]][_0xaa10[27]]- _0x494dxd[_0xaa10[11]])> _0x494dxd[_0xaa10[30]][_0xaa10[27]])?_0x494dxd[_0xaa10[30]][_0xaa10[27]]:(_0x494dxd[_0xaa10[9]][_0xaa10[27]]- _0x494dxd[_0xaa10[11]]);_0x494dxd[_0xaa10[27]]= setTimeout(function(){_0x494dxd[_0xaa10[11]]+= _0x494dxd[_0xaa10[30]][_0xaa10[27]];_0x494dxd[_0xaa10[48]]()},_0x494dx16* 1000);if(_0x494dx16> 0){Agent[_0xaa10[87]](_0x494dx15)[_0xaa10[21]](function(_0x494dx17){_0x494dx17= _[_0xaa10[84]](_0x494dx17,function(_0x494dx11){if(available(_0x494dx11,_0x494dx11[structure[_0xaa10[45]][_0xaa10[79]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]]],_0x494dxd[_0xaa10[14]],_[_0xaa10[82]](_0x494dx11[structure[_0xaa10[45]][_0xaa10[25]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]]],{status:_0xaa10[81]}),_0x494dx11[structure[_0xaa10[45]][_0xaa10[83]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]]])){return true}else {return false}});var _0x494dxf=_[_0xaa10[65]](_0x494dx17,function(_0x494dx11){var _0x494dx18=_[_0xaa10[34]](_0x494dxd[_0xaa10[10]],{timeslot:_0x494dx16,application:_0xaa10[28],membername:_0x494dx11[_0xaa10[31]],memberid:_0x494dx11[_0xaa10[29]],queue:_0x494dxd[_0xaa10[30]][_0xaa10[29]],queuename:_0x494dxd[_0xaa10[30]][_0xaa10[31]],calledAt:moment()[_0xaa10[33]](_0xaa10[32])});return _[_0xaa10[85]](_0x494dx18)});structure[_0xaa10[26]][_0xaa10[86]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]][_0xaa10[35]](_0x494dxf,{individualHooks:true})[_0xaa10[18]](function(_0x494dxe){console[_0xaa10[17]](_0x494dxe)})})[_0xaa10[18]](function(_0x494dxe){console[_0xaa10[17]](_0x494dxe)})}else {clearTimeout(_0x494dxd[_0xaa10[27]]);this[_0xaa10[12]]()}};Queue[_0xaa10[16]][_0xaa10[51]]= function rr(){var _0x494dxd=this;var _0x494dx16=((_0x494dxd[_0xaa10[9]][_0xaa10[27]]- _0x494dxd[_0xaa10[11]])> _0x494dxd[_0xaa10[30]][_0xaa10[27]])?_0x494dxd[_0xaa10[30]][_0xaa10[27]]:(_0x494dxd[_0xaa10[9]][_0xaa10[27]]- _0x494dxd[_0xaa10[11]]);_0x494dxd[_0xaa10[27]]= setTimeout(function(){_0x494dxd[_0xaa10[11]]+= _0x494dxd[_0xaa10[30]][_0xaa10[27]];_0x494dxd[_0xaa10[51]]()},_0x494dx16* 1000);var _0x494dx15={where:{id:{$in:_[_0xaa10[65]](_0x494dxd._agents,_0xaa10[29])}},include:[{model:structure[_0xaa10[26]][_0xaa10[25]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]],attributes:[_0xaa10[29]]}],attributes:[_0xaa10[29],_0xaa10[31],_0xaa10[67],_0xaa10[68],_0xaa10[69],_0xaa10[70],_0xaa10[71],_0xaa10[72],_0xaa10[73],_0xaa10[74],_0xaa10[75],_0xaa10[76],_0xaa10[77],_0xaa10[78]]};if(_[_0xaa10[65]](_0x494dxd._agents,_0xaa10[29])[_0xaa10[88]]()[_0xaa10[55]]){_0x494dx15[_0xaa10[89]]= [[{raw:_0xaa10[90]+ _[_0xaa10[65]](_0x494dxd._agents,_0xaa10[29])[_0xaa10[88]]()+ _0xaa10[91]}]]};if(_0x494dx16> 0){Agent[_0xaa10[87]](_0x494dx15)[_0xaa10[21]](function(_0x494dx17){if(_0x494dx17[_0xaa10[55]]){_0x494dxd[_0xaa10[43]]= _0x494dx17;for(var _0x494dx12=0;_0x494dx12< _0x494dxd[_0xaa10[43]][_0xaa10[55]];_0x494dx12++){if(available(_0x494dxd[_0xaa10[43]][0],_0x494dxd[_0xaa10[43]][0][structure[_0xaa10[45]][_0xaa10[79]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]]],_0x494dxd[_0xaa10[14]],_[_0xaa10[82]](_0x494dxd[_0xaa10[43]][0][structure[_0xaa10[45]][_0xaa10[25]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]]],{status:_0xaa10[81]}),_0x494dxd[_0xaa10[43]][0][structure[_0xaa10[45]][_0xaa10[83]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]]])){var _0x494dxf=[_[_0xaa10[34]](_0x494dxd[_0xaa10[10]],{timeslot:_0x494dx16,application:_0xaa10[28],membername:_0x494dxd[_0xaa10[43]][0][_0xaa10[31]],memberid:_0x494dxd[_0xaa10[43]][0][_0xaa10[29]],queue:_0x494dxd[_0xaa10[30]][_0xaa10[29]],queuename:_0x494dxd[_0xaa10[30]][_0xaa10[31]],calledAt:moment()[_0xaa10[33]](_0xaa10[32])})];return structure[_0xaa10[26]][_0xaa10[86]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]][_0xaa10[35]](_0x494dxf,{individualHooks:true})[_0xaa10[21]](function(){return structure[_0xaa10[26]][_0xaa10[64]][_0x494dxd[_0xaa10[10]][_0xaa10[24]]][_0xaa10[23]]({lastAgent:_0x494dxd[_0xaa10[43]][0][_0xaa10[29]]},{where:{id:_0x494dxd[_0xaa10[30]][_0xaa10[29]]}})})[_0xaa10[18]](function(_0x494dxe){console[_0xaa10[17]](_0x494dxe)})}else {var _0x494dx11=_0x494dxd[_0xaa10[43]][_0xaa10[56]]();_0x494dxd[_0xaa10[43]][_0xaa10[57]](_0x494dx11)}}}})[_0xaa10[21]](function(){var _0x494dx11=_0x494dxd[_0xaa10[43]][_0xaa10[56]]();_0x494dxd[_0xaa10[43]][_0xaa10[57]](_0x494dx11)})[_0xaa10[18]](function(_0x494dxe){console[_0xaa10[17]](_0x494dxe)})}else {clearTimeout(_0x494dxd[_0xaa10[27]]);this[_0xaa10[12]]()}};function available(_0x494dx11,_0x494dx1b,_0x494dx1c,_0x494dx1d,_0x494dx1e){var _0x494dx1f=_[_0xaa10[92]](_0x494dx1c,{id:_0x494dx11[_0xaa10[29]]})?true:false;return _0x494dx11[_0xaa10[68]]&&  !_0x494dx1b&&  !_0x494dx1f&& ((_0x494dx1d[_0xaa10[55]]< _0x494dx1e)|| (_0x494dx1e=== 0))}module[_0xaa10[93]]= Queue
\ No newline at end of file