Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / components / realtime / agents.js
index 80a7669..a1fd401 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3445=['pauseType','find','globalStatus','catch','fields','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','openchannelPause','whatsappPause','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','openchannelStatus','mailStatus','faxStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','role','faxStatusTime','chatCurrentCapacity','faxCurrentCapacity','smsCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','every','length','idle','unknown','unavailable','ringing','isNil','voicePause','pause','chatStatus','smsStatus','voiceStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','*pause','busy','getAgentStatus','startCase','Queue','map','findOne','getAgents','flatten','value','getAgentIdsByQueues','filter','includes','getAgentIdsByStatus','resolve','User','name','fullname','smsPause'];(function(_0x4254cb,_0x391af5){var _0x2eeaad=function(_0x1850ea){while(--_0x1850ea){_0x4254cb['push'](_0x4254cb['shift']());}};_0x2eeaad(++_0x391af5);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var jayson=require(_0x5344('0x1'));var db=require(_0x5344('0x2'))['db'];var amiClient=jayson[_0x5344('0x3')][_0x5344('0x4')]({'port':0x232a});var routingClient=jayson[_0x5344('0x3')][_0x5344('0x4')]({'port':0x232c});function isAgentPaused(_0x5d75ff,_0x4a8e2b){var _0x3a602c=[_0x5d75ff[_0x5344('0x5')],_0x5d75ff[_0x5344('0x6')],_0x5d75ff[_0x5344('0x7')],_0x5d75ff['openchannelPause'],_0x5d75ff['smsPause'],_0x5d75ff['voicePause'],_0x5d75ff['whatsappPause']];if(!_0x4a8e2b)return _[_0x5344('0x8')](_0x3a602c);var _0x4adb8a=_['filter'](_0x3a602c);return _0x4adb8a[_0x5344('0x9')]>0x0&&_0x4adb8a[_0x5344('0x9')]<_0x3a602c[_0x5344('0x9')]?!![]:![];}function isIdle(_0x50041b){return _0x50041b===_0x5344('0xa')||_0x50041b===_0x5344('0xb')||_0x50041b===_0x5344('0xc')||_0x50041b===_0x5344('0xd')||_[_0x5344('0xe')](_0x50041b);}function isAgentIdle(_0x255763){if(_0x255763['voiceStatus']!==_0x5344('0xa')&&_0x255763[_0x5344('0xf')]){_0x255763['voiceStatus']=_0x5344('0x10');return![];}return _['every']([_0x255763[_0x5344('0x11')],_0x255763['faxStatus'],_0x255763['mailStatus'],_0x255763['openchannelStatus'],_0x255763[_0x5344('0x12')],_0x255763[_0x5344('0x13')],_0x255763[_0x5344('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x5344('0x15')](_0x5344('0x16'),{})[_0x5344('0x17')](function(_0x16f302){if(_0x16f302[_0x5344('0x18')]){throw new Error(_0x5344('0x19'));}var _0x405630=_0x16f302['result'];return routingClient[_0x5344('0x15')](_0x5344('0x16'),{})[_0x5344('0x17')](function(_0x215fbd){if(_0x215fbd['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x508e34=_0x215fbd[_0x5344('0x1a')];return _['merge']({},_0x405630,_0x508e34);});})['catch'](function(_0x4a636e){throw _0x4a636e;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x2630ff){var _0xa623c5=_0x5344('0xb');if(isAgentPaused(_0x2630ff))_0xa623c5=_0x5344('0x10');else if(isAgentPaused(_0x2630ff,!![]))_0xa623c5=_0x5344('0x1b');else if(isAgentIdle(_0x2630ff))_0xa623c5=_0x5344('0xa');else _0xa623c5=_0x5344('0x1c');return _0xa623c5;}exports[_0x5344('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x22caa8,_0xdcf9d1){var _0x52fd4a=_['isArray'](_0x22caa8)?_0x22caa8:[_0x22caa8];var _0x9e5807=_[_0x5344('0x1e')](_0xdcf9d1)+_0x5344('0x1f');var _0x434e0d=_[_0x5344('0x20')](_0x52fd4a,function(_0x49a578){return db[_0x9e5807][_0x5344('0x21')]({'where':{'id':_0x49a578}})[_0x5344('0x17')](function(_0xe1c211){if(!_0xe1c211)return[];return _0xe1c211[_0x5344('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x434e0d)[_0x5344('0x17')](function(_0x2fbe7a){var _0x437162=_(_0x2fbe7a)[_0x5344('0x23')]()['map']('id')['uniq']()[_0x5344('0x24')]();return _0x437162;});}exports[_0x5344('0x25')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3471a9,_0x28b50b,_0x494997){try{if(_0x28b50b[_0x5344('0x9')]>0x0){_0x3471a9=_0x3471a9[_0x5344('0x26')](function(_0xf4eafd){return _0x28b50b[_0x5344('0x27')](_0xf4eafd['id']);});}var _0x1867d6=_0x3471a9[_0x5344('0x26')](function(_0x40a526){var _0x4d87bc=_0x5344('0x1c');if(isAgentIdle(_0x40a526)){_0x4d87bc='idle';}return _0x4d87bc===_0x494997;});return _[_0x5344('0x20')](_0x1867d6,'id');}catch(_0x2ad28e){throw _0x2ad28e;}}exports[_0x5344('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xdaa060,_0x43a1e2,_0x175892){return Promise[_0x5344('0x29')]()[_0x5344('0x17')](function(){if(_0x43a1e2[_0x5344('0x9')]>0x0){_0xdaa060=_0xdaa060['filter'](function(_0x477639){return _0x43a1e2[_0x5344('0x27')](_0x477639['id']);});}return _0xdaa060;})[_0x5344('0x17')](function(){return db[_0x5344('0x2a')]['findAll']({'attributes':['id',_0x5344('0x2b'),_0x5344('0x2c'),'chatPause',_0x5344('0x6'),_0x5344('0x7'),'openchannelPause',_0x5344('0x2d'),_0x5344('0xf'),'whatsappPause',_0x5344('0x2e')],'where':{'id':{'$in':_[_0x5344('0x20')](_0xdaa060,'id')}},'raw':!![]});})['then'](function(_0x4655fa){return _0x4655fa[_0x5344('0x20')](function(_0x32220c){var _0x311198=_[_0x5344('0x2f')](_0xdaa060,['id',_0x32220c['id']]);var _0x593598=filterAgentAttributes(_0x311198);_['merge'](_0x32220c,_0x593598);_0x32220c[_0x5344('0x30')]=getAgentStatus(_0x32220c);return _0x32220c;});})['then'](function(_0x51a9aa){var _0x57a969=sortAgentsByStatus(_0x51a9aa,_0x175892);return _[_0x5344('0x20')](_0x57a969,'id');})[_0x5344('0x31')](function(_0x5e60e3){throw _0x5e60e3;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x25b6cb){var _0x51ca57={'fields':[],'order':null};var _0x5c2d1a=_0x25b6cb['split'](',');_0x51ca57[_0x5344('0x32')]=_[_0x5344('0x26')](_0x5c2d1a,function(_0x363622){if(!_0x363622[_0x5344('0x27')](_0x5344('0x30'))){return!![];}_0x51ca57['order']=_[_0x5344('0x33')](_0x363622,'-')?_0x5344('0x34'):_0x5344('0x35');return![];});return _0x51ca57;}exports[_0x5344('0x36')]=getUpdatedSortOptions;function validateSortParameter(_0x525088){if(!_0x525088){_0x525088=_0x5344('0x37');}if(_0x525088[_0x5344('0x27')](_0x5344('0x2c'))&&!_0x525088[_0x5344('0x27')](_0x5344('0x38'))){var _0x40fe19=_0x525088[_0x5344('0x39')](0x0,_0x525088[_0x5344('0x3a')]('fullname'));_0x525088+=','+_0x40fe19+_0x5344('0x38');}return _0x525088;}exports[_0x5344('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x3f3ce4,_0x1a209e){var _0x5655ce=_0x3f3ce4[_0x5344('0x3c')](function(_0x3b7fd6,_0x51720d){if(_0x3b7fd6[_0x5344('0x30')]===_0x51720d[_0x5344('0x30')]){if(_0x3b7fd6['globalStatus']===_0x5344('0x10')){if(_0x1a209e===_0x5344('0x34')){return(_0x3b7fd6['pauseType']||'')<(_0x51720d[_0x5344('0x2e')]||'')||_0x3b7fd6[_0x5344('0x2c')][_0x5344('0x3d')]()>_0x51720d[_0x5344('0x2c')][_0x5344('0x3d')]()?0x1:-0x1;}else{return(_0x3b7fd6[_0x5344('0x2e')]||'')<(_0x51720d[_0x5344('0x2e')]||'')||_0x3b7fd6[_0x5344('0x2c')]['toLowerCase']()>_0x51720d[_0x5344('0x2c')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x1a209e===_0x5344('0x34')){return _0x3b7fd6['fullname']['toLowerCase']()<_0x51720d[_0x5344('0x2c')]['toLowerCase']()?0x1:-0x1;}else{return _0x3b7fd6['fullname'][_0x5344('0x3d')]()<_0x51720d[_0x5344('0x2c')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x1a209e==='DESC'){return _0x3b7fd6[_0x5344('0x30')]<_0x51720d[_0x5344('0x30')]?0x1:-0x1;}else{return _0x3b7fd6[_0x5344('0x30')]<_0x51720d[_0x5344('0x30')]?-0x1:0x1;}}});return _0x5655ce;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x76e380){var _0x497413=[_0x5344('0x3e'),_0x5344('0x3f'),_0x5344('0x40'),_0x5344('0x41'),_0x5344('0x2e'),'lastPauseAt',_0x5344('0x38'),'address',_0x5344('0x5'),_0x5344('0x42'),'mailPause',_0x5344('0x2d'),_0x5344('0x43'),_0x5344('0x6'),_0x5344('0xf'),'chatCapacity',_0x5344('0x44'),_0x5344('0x45'),_0x5344('0x46'),_0x5344('0x47'),_0x5344('0x48'),'chatCurrentCapacity',_0x5344('0x49'),_0x5344('0x4a'),'smsCurrentCapacity',_0x5344('0x4b'),'faxCurrentCapacity',_0x5344('0x11'),_0x5344('0x4c'),_0x5344('0x4d'),_0x5344('0x12'),_0x5344('0x14'),_0x5344('0x4e'),_0x5344('0x13'),'chatStatusTime',_0x5344('0x4f'),_0x5344('0x50'),_0x5344('0x51'),_0x5344('0x52'),'faxStatusTime',_0x5344('0x53'),_0x5344('0x54'),_0x5344('0x55'),'screenrecording',_0x5344('0x56'),_0x5344('0x57')];var _0x678db5=['chatPause','openchannelPause',_0x5344('0x7'),_0x5344('0x2d'),_0x5344('0x43'),'faxPause',_0x5344('0xf'),_0x5344('0x3f')];var _0x30dc2f=_(_0x76e380)[_0x5344('0x58')](_0x678db5)[_0x5344('0x59')](_0x497413)[_0x5344('0x24')]();return _0x30dc2f;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x5344('0x2b'),_0x5344('0x2c'),_0x5344('0x5a'),_0x5344('0x38'),_0x5344('0x3f'),_0x5344('0x30'),_0x5344('0x3e'),_0x5344('0x40'),'pauseType','lastPauseAt',_0x5344('0x6'),_0x5344('0x5'),_0x5344('0x7'),'openchannelPause',_0x5344('0x2d'),_0x5344('0xf'),'whatsappPause',_0x5344('0x11'),_0x5344('0x4e'),_0x5344('0x4d'),'openchannelStatus','smsStatus',_0x5344('0x13'),'whatsappStatus','chatStatusTime',_0x5344('0x5b'),_0x5344('0x50'),_0x5344('0x4f'),_0x5344('0x51'),_0x5344('0x53'),_0x5344('0x52'),'chatCapacity',_0x5344('0x48'),_0x5344('0x45'),'openchannelCapacity',_0x5344('0x46'),_0x5344('0x47'),_0x5344('0x5c'),_0x5344('0x5d'),_0x5344('0x4a'),'openchannelCurrentCapacity',_0x5344('0x5e'),_0x5344('0x4b'),_0x5344('0x56'),_0x5344('0x57'),_0x5344('0x55'),_0x5344('0x5f'),_0x5344('0x54'),'screenrecording'];}exports[_0x5344('0x60')]=getRealtimeAgentsQueryFields;
\ No newline at end of file
+var _0x24bb=['faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','omit','role','internal','openchannelStatus','faxStatusTime','openchannelStatusTime','onhold','getRealtimeAgentsQueryFields','lodash','../../mysqldb','http','client','chatPause','faxPause','mailPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','pause','faxStatus','mailStatus','smsStatus','whatsappStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue','map','then','all','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','openchannelPause','smsPause','pauseType','find','catch','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','indexOf','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity'];(function(_0x54c05f,_0x30fa51){var _0x57913a=function(_0x182821){while(--_0x182821){_0x54c05f['push'](_0x54c05f['shift']());}};_0x57913a(++_0x30fa51);}(_0x24bb,0x19f));var _0xb24b=function(_0x3a49d0,_0xab8397){_0x3a49d0=_0x3a49d0-0x0;var _0xe4f732=_0x24bb[_0x3a49d0];return _0xe4f732;};'use strict';var _=require(_0xb24b('0x0'));var jayson=require('jayson/promise');var db=require(_0xb24b('0x1'))['db'];var amiClient=jayson['client'][_0xb24b('0x2')]({'port':0x232a});var routingClient=jayson[_0xb24b('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x264025,_0x48ff68){var _0x52eba3=[_0x264025[_0xb24b('0x4')],_0x264025[_0xb24b('0x5')],_0x264025[_0xb24b('0x6')],_0x264025['openchannelPause'],_0x264025['smsPause'],_0x264025[_0xb24b('0x7')],_0x264025[_0xb24b('0x8')]];if(!_0x48ff68)return _[_0xb24b('0x9')](_0x52eba3);var _0x8f07ac=_[_0xb24b('0xa')](_0x52eba3);return _0x8f07ac[_0xb24b('0xb')]>0x0&&_0x8f07ac[_0xb24b('0xb')]<_0x52eba3[_0xb24b('0xb')]?!![]:![];}function isIdle(_0x50acfe){return _0x50acfe===_0xb24b('0xc')||_0x50acfe===_0xb24b('0xd')||_0x50acfe===_0xb24b('0xe')||_0x50acfe===_0xb24b('0xf')||_['isNil'](_0x50acfe);}function isAgentIdle(_0x48b94b){if(_0x48b94b[_0xb24b('0x10')]!==_0xb24b('0xc')&&_0x48b94b['voicePause']){_0x48b94b[_0xb24b('0x10')]=_0xb24b('0x11');return![];}return _[_0xb24b('0x9')]([_0x48b94b['chatStatus'],_0x48b94b[_0xb24b('0x12')],_0x48b94b[_0xb24b('0x13')],_0x48b94b['openchannelStatus'],_0x48b94b[_0xb24b('0x14')],_0x48b94b[_0xb24b('0x10')],_0x48b94b[_0xb24b('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xb24b('0x16')](_0xb24b('0x17'),{})['then'](function(_0x3f3676){if(_0x3f3676[_0xb24b('0x18')]){throw new Error(_0xb24b('0x19'));}var _0x1f7941=_0x3f3676[_0xb24b('0x1a')];return routingClient[_0xb24b('0x16')](_0xb24b('0x17'),{})['then'](function(_0x3285c4){if(_0x3285c4[_0xb24b('0x18')]){throw new Error(_0xb24b('0x1b'));}var _0x594b38=_0x3285c4[_0xb24b('0x1a')];return _[_0xb24b('0x1c')]({},_0x1f7941,_0x594b38);});})['catch'](function(_0x45f623){throw _0x45f623;});}exports[_0xb24b('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x3f76f0){var _0x1a508f=_0xb24b('0xd');if(isAgentPaused(_0x3f76f0))_0x1a508f=_0xb24b('0x11');else if(isAgentPaused(_0x3f76f0,!![]))_0x1a508f='*pause';else if(isAgentIdle(_0x3f76f0))_0x1a508f=_0xb24b('0xc');else _0x1a508f=_0xb24b('0x1e');return _0x1a508f;}exports[_0xb24b('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x2e8664,_0xfc656d){var _0x5cede6=_[_0xb24b('0x20')](_0x2e8664)?_0x2e8664:[_0x2e8664];var _0x44ee07=_[_0xb24b('0x21')](_0xfc656d)+_0xb24b('0x22');var _0x4de9b6=_[_0xb24b('0x23')](_0x5cede6,function(_0x5f560f){return db[_0x44ee07]['findOne']({'where':{'id':_0x5f560f}})[_0xb24b('0x24')](function(_0x360c3e){if(!_0x360c3e)return[];return _0x360c3e['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xb24b('0x25')](_0x4de9b6)[_0xb24b('0x24')](function(_0x1f7045){var _0x10d830=_(_0x1f7045)['flatten']()['map']('id')['uniq']()[_0xb24b('0x26')]();return _0x10d830;});}exports[_0xb24b('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x38975f,_0x5d0435,_0x1f11d5){try{if(_0x5d0435[_0xb24b('0xb')]>0x0){_0x38975f=_0x38975f[_0xb24b('0xa')](function(_0x53888d){return _0x5d0435[_0xb24b('0x28')](_0x53888d['id']);});}var _0x12d30a=_0x38975f[_0xb24b('0xa')](function(_0x5de4f0){var _0xf53d92=_0xb24b('0x1e');if(isAgentIdle(_0x5de4f0)){_0xf53d92=_0xb24b('0xc');}return _0xf53d92===_0x1f11d5;});return _[_0xb24b('0x23')](_0x12d30a,'id');}catch(_0x4561b9){throw _0x4561b9;}}exports[_0xb24b('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1d2b34,_0x508323,_0x1e120b){return Promise[_0xb24b('0x2a')]()[_0xb24b('0x24')](function(){if(_0x508323[_0xb24b('0xb')]>0x0){_0x1d2b34=_0x1d2b34[_0xb24b('0xa')](function(_0x1ee935){return _0x508323[_0xb24b('0x28')](_0x1ee935['id']);});}return _0x1d2b34;})[_0xb24b('0x24')](function(){return db['User'][_0xb24b('0x2b')]({'attributes':['id',_0xb24b('0x2c'),_0xb24b('0x2d'),'chatPause','faxPause',_0xb24b('0x6'),_0xb24b('0x2e'),_0xb24b('0x2f'),_0xb24b('0x7'),_0xb24b('0x8'),_0xb24b('0x30')],'where':{'id':{'$in':_[_0xb24b('0x23')](_0x1d2b34,'id')}},'raw':!![]});})['then'](function(_0x2c2add){return _0x2c2add['map'](function(_0x1d91db){var _0x81e4d9=_[_0xb24b('0x31')](_0x1d2b34,['id',_0x1d91db['id']]);var _0x5c4d2f=filterAgentAttributes(_0x81e4d9);_[_0xb24b('0x1c')](_0x1d91db,_0x5c4d2f);_0x1d91db['globalStatus']=getAgentStatus(_0x1d91db);return _0x1d91db;});})[_0xb24b('0x24')](function(_0x3dfae8){var _0x3e5bc6=sortAgentsByStatus(_0x3dfae8,_0x1e120b);return _[_0xb24b('0x23')](_0x3e5bc6,'id');})[_0xb24b('0x32')](function(_0x572094){throw _0x572094;});}exports[_0xb24b('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x169fae){var _0x5edcf3={'fields':[],'order':null};var _0x13ac86=_0x169fae[_0xb24b('0x34')](',');_0x5edcf3[_0xb24b('0x35')]=_['filter'](_0x13ac86,function(_0x5b2936){if(!_0x5b2936[_0xb24b('0x28')](_0xb24b('0x36'))){return!![];}_0x5edcf3[_0xb24b('0x37')]=_[_0xb24b('0x38')](_0x5b2936,'-')?_0xb24b('0x39'):_0xb24b('0x3a');return![];});return _0x5edcf3;}exports[_0xb24b('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x24bd42){if(!_0x24bd42){_0x24bd42=_0xb24b('0x3c');}if(_0x24bd42[_0xb24b('0x28')](_0xb24b('0x2d'))&&!_0x24bd42[_0xb24b('0x28')]('internal')){var _0x5e97cb=_0x24bd42['substring'](0x0,_0x24bd42[_0xb24b('0x3d')](_0xb24b('0x2d')));_0x24bd42+=','+_0x5e97cb+'internal';}return _0x24bd42;}exports[_0xb24b('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x277420,_0x5008e9){var _0x41c740=_0x277420['sort'](function(_0x191bff,_0x56c7f8){if(_0x191bff[_0xb24b('0x36')]===_0x56c7f8[_0xb24b('0x36')]){if(_0x191bff[_0xb24b('0x36')]==='pause'){if(_0x5008e9==='DESC'){return(_0x191bff[_0xb24b('0x30')]||'')<(_0x56c7f8[_0xb24b('0x30')]||'')||_0x191bff[_0xb24b('0x2d')][_0xb24b('0x3f')]()>_0x56c7f8[_0xb24b('0x2d')]['toLowerCase']()?0x1:-0x1;}else{return(_0x191bff[_0xb24b('0x30')]||'')<(_0x56c7f8['pauseType']||'')||_0x191bff[_0xb24b('0x2d')][_0xb24b('0x3f')]()>_0x56c7f8[_0xb24b('0x2d')][_0xb24b('0x3f')]()?-0x1:0x1;}}else{if(_0x5008e9==='DESC'){return _0x191bff[_0xb24b('0x2d')]['toLowerCase']()<_0x56c7f8[_0xb24b('0x2d')][_0xb24b('0x3f')]()?0x1:-0x1;}else{return _0x191bff['fullname'][_0xb24b('0x3f')]()<_0x56c7f8[_0xb24b('0x2d')][_0xb24b('0x3f')]()?-0x1:0x1;}}}else{if(_0x5008e9===_0xb24b('0x39')){return _0x191bff['globalStatus']<_0x56c7f8[_0xb24b('0x36')]?0x1:-0x1;}else{return _0x191bff[_0xb24b('0x36')]<_0x56c7f8['globalStatus']?-0x1:0x1;}}});return _0x41c740;}exports[_0xb24b('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x7dc8b6){var _0x2f4b43=[_0xb24b('0x41'),_0xb24b('0x42'),_0xb24b('0x43'),'lastPauseAt','pauseType',_0xb24b('0x44'),'internal',_0xb24b('0x45'),'chatPause',_0xb24b('0x2e'),_0xb24b('0x6'),_0xb24b('0x2f'),_0xb24b('0x8'),_0xb24b('0x5'),_0xb24b('0x7'),_0xb24b('0x46'),_0xb24b('0x47'),_0xb24b('0x48'),_0xb24b('0x49'),_0xb24b('0x4a'),_0xb24b('0x4b'),_0xb24b('0x4c'),_0xb24b('0x4d'),_0xb24b('0x4e'),'smsCurrentCapacity',_0xb24b('0x4f'),_0xb24b('0x50'),_0xb24b('0x51'),'openchannelStatus',_0xb24b('0x13'),_0xb24b('0x14'),_0xb24b('0x15'),_0xb24b('0x12'),_0xb24b('0x10'),_0xb24b('0x52'),'openchannelStatusTime','mailStatusTime',_0xb24b('0x53'),_0xb24b('0x54'),'faxStatusTime',_0xb24b('0x55'),_0xb24b('0x56'),_0xb24b('0x57'),_0xb24b('0x58'),_0xb24b('0x59'),'phoneBarEnableAutomaticScreenRecording'];var _0x22fbd1=[_0xb24b('0x4'),_0xb24b('0x2e'),_0xb24b('0x6'),_0xb24b('0x2f'),_0xb24b('0x8'),_0xb24b('0x5'),'voicePause',_0xb24b('0x42')];var _0x421b02=_(_0x7dc8b6)[_0xb24b('0x5a')](_0x22fbd1)['pick'](_0x2f4b43)[_0xb24b('0x26')]();return _0x421b02;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xb24b('0x2c'),_0xb24b('0x2d'),_0xb24b('0x5b'),_0xb24b('0x5c'),_0xb24b('0x42'),'globalStatus',_0xb24b('0x41'),_0xb24b('0x43'),_0xb24b('0x30'),_0xb24b('0x44'),_0xb24b('0x5'),'chatPause',_0xb24b('0x6'),_0xb24b('0x2e'),_0xb24b('0x2f'),'voicePause',_0xb24b('0x8'),_0xb24b('0x51'),_0xb24b('0x12'),_0xb24b('0x13'),_0xb24b('0x5d'),_0xb24b('0x14'),_0xb24b('0x10'),_0xb24b('0x15'),_0xb24b('0x52'),_0xb24b('0x5e'),'mailStatusTime',_0xb24b('0x5f'),_0xb24b('0x53'),_0xb24b('0x55'),_0xb24b('0x54'),'chatCapacity',_0xb24b('0x4b'),_0xb24b('0x48'),_0xb24b('0x47'),_0xb24b('0x49'),_0xb24b('0x4a'),'chatCurrentCapacity','faxCurrentCapacity','mailCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity',_0xb24b('0x4f'),_0xb24b('0x59'),'phoneBarEnableAutomaticScreenRecording',_0xb24b('0x57'),_0xb24b('0x60'),_0xb24b('0x56'),_0xb24b('0x58')];}exports[_0xb24b('0x61')]=getRealtimeAgentsQueryFields;
\ No newline at end of file