Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / components / realtime / agents.js
index d51d852..228c762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41df=['Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','map','findOne','all','flatten','uniq','value','filter','getAgentIdsByStatus','resolve','includes','User','findAll','name','fullname','faxPause','find','globalStatus','catch','getSortedAgentsIdsByStatus','fields','order','startsWith','DESC','getUpdatedSortOptions','internal','indexOf','validateSortParameter','sort','pauseType','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','whatsappStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','lodash','jayson/promise','client','http','chatPause','mailPause','openchannelPause','smsPause','whatsappPause','every','length','idle','isNil','voiceStatus','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result'];(function(_0x3dc06d,_0x34ec1b){var _0x560f2b=function(_0x22a3d7){while(--_0x22a3d7){_0x3dc06d['push'](_0x3dc06d['shift']());}};_0x560f2b(++_0x34ec1b);}(_0x41df,0x14a));var _0xf41d=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x41df[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0xf41d('0x0'));var jayson=require(_0xf41d('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xf41d('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xf41d('0x2')][_0xf41d('0x3')]({'port':0x232c});function isAgentPaused(_0x2dc4a3,_0x3149d6){var _0x33fad3=[_0x2dc4a3[_0xf41d('0x4')],_0x2dc4a3['faxPause'],_0x2dc4a3[_0xf41d('0x5')],_0x2dc4a3[_0xf41d('0x6')],_0x2dc4a3[_0xf41d('0x7')],_0x2dc4a3['voicePause'],_0x2dc4a3[_0xf41d('0x8')]];if(!_0x3149d6)return _[_0xf41d('0x9')](_0x33fad3);var _0x5e9546=_['filter'](_0x33fad3);return _0x5e9546[_0xf41d('0xa')]>0x0&&_0x5e9546[_0xf41d('0xa')]<_0x33fad3[_0xf41d('0xa')]?!![]:![];}function isIdle(_0x50e303){return _0x50e303===_0xf41d('0xb')||_0x50e303==='unknown'||_0x50e303==='unavailable'||_0x50e303==='ringing'||_[_0xf41d('0xc')](_0x50e303);}function isAgentIdle(_0x4b53d9){if(_0x4b53d9[_0xf41d('0xd')]!==_0xf41d('0xb')&&_0x4b53d9[_0xf41d('0xe')]){_0x4b53d9[_0xf41d('0xd')]=_0xf41d('0xf');return![];}return _['every']([_0x4b53d9[_0xf41d('0x10')],_0x4b53d9[_0xf41d('0x11')],_0x4b53d9[_0xf41d('0x12')],_0x4b53d9[_0xf41d('0x13')],_0x4b53d9[_0xf41d('0x14')],_0x4b53d9['voiceStatus'],_0x4b53d9['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xf41d('0x15')]('Agents',{})[_0xf41d('0x16')](function(_0x4b32da){if(_0x4b32da[_0xf41d('0x17')]){throw new Error(_0xf41d('0x18'));}var _0x165c3d=_0x4b32da[_0xf41d('0x19')];return routingClient[_0xf41d('0x15')]('Agents',{})['then'](function(_0xf22aff){if(_0xf22aff[_0xf41d('0x17')]){throw new Error(_0xf41d('0x1a'));}var _0x2b0a91=_0xf22aff[_0xf41d('0x19')];return _[_0xf41d('0x1b')]({},_0x165c3d,_0x2b0a91);});})['catch'](function(_0x58e4f6){throw _0x58e4f6;});}exports[_0xf41d('0x1c')]=getRealtimeAgents;function getAgentStatus(_0xa8f7ee){var _0x49be93='unknown';if(isAgentPaused(_0xa8f7ee))_0x49be93=_0xf41d('0xf');else if(isAgentPaused(_0xa8f7ee,!![]))_0x49be93=_0xf41d('0x1d');else if(isAgentIdle(_0xa8f7ee))_0x49be93='idle';else _0x49be93=_0xf41d('0x1e');return _0x49be93;}exports[_0xf41d('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x19a2bb,_0x558b13){var _0x15647d=_[_0xf41d('0x20')](_0x19a2bb)?_0x19a2bb:[_0x19a2bb];var _0x5818c9=_[_0xf41d('0x21')](_0x558b13)+'Queue';var _0x33601c=_[_0xf41d('0x22')](_0x15647d,function(_0x5ea24f){return db[_0x5818c9][_0xf41d('0x23')]({'where':{'id':_0x5ea24f}})[_0xf41d('0x16')](function(_0x7e0418){if(!_0x7e0418)return[];return _0x7e0418['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xf41d('0x24')](_0x33601c)['then'](function(_0x414a38){var _0x399029=_(_0x414a38)[_0xf41d('0x25')]()[_0xf41d('0x22')]('id')[_0xf41d('0x26')]()[_0xf41d('0x27')]();return _0x399029;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x55166c,_0x31637c,_0x3a6a84){try{if(_0x31637c[_0xf41d('0xa')]>0x0){_0x55166c=_0x55166c[_0xf41d('0x28')](function(_0x38146e){return _0x31637c['includes'](_0x38146e['id']);});}var _0x3bedf1=_0x55166c[_0xf41d('0x28')](function(_0x43da87){var _0x38e479=_0xf41d('0x1e');if(isAgentIdle(_0x43da87)){_0x38e479=_0xf41d('0xb');}return _0x38e479===_0x3a6a84;});return _[_0xf41d('0x22')](_0x3bedf1,'id');}catch(_0x47ec05){throw _0x47ec05;}}exports[_0xf41d('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4a5a6e,_0x5bcae4,_0x431942){return Promise[_0xf41d('0x2a')]()[_0xf41d('0x16')](function(){if(_0x5bcae4[_0xf41d('0xa')]>0x0){_0x4a5a6e=_0x4a5a6e['filter'](function(_0x4e96e5){return _0x5bcae4[_0xf41d('0x2b')](_0x4e96e5['id']);});}return _0x4a5a6e;})[_0xf41d('0x16')](function(){return db[_0xf41d('0x2c')][_0xf41d('0x2d')]({'attributes':['id',_0xf41d('0x2e'),_0xf41d('0x2f'),_0xf41d('0x4'),_0xf41d('0x30'),'mailPause','openchannelPause','smsPause',_0xf41d('0xe'),_0xf41d('0x8'),'pauseType'],'where':{'id':{'$in':_['map'](_0x4a5a6e,'id')}},'raw':!![]});})[_0xf41d('0x16')](function(_0x26c733){return _0x26c733[_0xf41d('0x22')](function(_0xc26ba8){var _0x593953=_[_0xf41d('0x31')](_0x4a5a6e,['id',_0xc26ba8['id']]);var _0x9e3be3=filterAgentAttributes(_0x593953);_[_0xf41d('0x1b')](_0xc26ba8,_0x9e3be3);_0xc26ba8[_0xf41d('0x32')]=getAgentStatus(_0xc26ba8);return _0xc26ba8;});})[_0xf41d('0x16')](function(_0x52d8d7){var _0x12ed67=sortAgentsByStatus(_0x52d8d7,_0x431942);return _[_0xf41d('0x22')](_0x12ed67,'id');})[_0xf41d('0x33')](function(_0x499eaf){throw _0x499eaf;});}exports[_0xf41d('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x101511){var _0x3ece78={'fields':[],'order':null};var _0x28a875=_0x101511['split'](',');_0x3ece78[_0xf41d('0x35')]=_[_0xf41d('0x28')](_0x28a875,function(_0x2b60bf){if(!_0x2b60bf[_0xf41d('0x2b')]('globalStatus')){return!![];}_0x3ece78[_0xf41d('0x36')]=_[_0xf41d('0x37')](_0x2b60bf,'-')?_0xf41d('0x38'):'ASC';return![];});return _0x3ece78;}exports[_0xf41d('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x26f9b9){if(_0x26f9b9[_0xf41d('0x2b')]('fullname')&&!_0x26f9b9[_0xf41d('0x2b')](_0xf41d('0x3a'))){var _0x9cadc4=_0x26f9b9['substring'](0x0,_0x26f9b9[_0xf41d('0x3b')](_0xf41d('0x2f')));_0x26f9b9+=','+_0x9cadc4+'internal';}return _0x26f9b9;}exports[_0xf41d('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x17fee3,_0x42d268){var _0x2d6bbc=_0x17fee3[_0xf41d('0x3d')](function(_0x4425b7,_0x45fb64){if(_0x4425b7['globalStatus']===_0x45fb64['globalStatus']){if(_0x4425b7['globalStatus']==='pause'){if(_0x42d268===_0xf41d('0x38')){return(_0x4425b7[_0xf41d('0x3e')]||'')<(_0x45fb64[_0xf41d('0x3e')]||'')||_0x4425b7[_0xf41d('0x2f')][_0xf41d('0x3f')]()>_0x45fb64[_0xf41d('0x2f')][_0xf41d('0x3f')]()?0x1:-0x1;}else{return(_0x4425b7[_0xf41d('0x3e')]||'')<(_0x45fb64['pauseType']||'')||_0x4425b7[_0xf41d('0x2f')]['toLowerCase']()>_0x45fb64[_0xf41d('0x2f')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x42d268===_0xf41d('0x38')){return _0x4425b7[_0xf41d('0x2f')]['toLowerCase']()<_0x45fb64[_0xf41d('0x2f')][_0xf41d('0x3f')]()?0x1:-0x1;}else{return _0x4425b7[_0xf41d('0x2f')][_0xf41d('0x3f')]()<_0x45fb64[_0xf41d('0x2f')][_0xf41d('0x3f')]()?-0x1:0x1;}}}else{if(_0x42d268===_0xf41d('0x38')){return _0x4425b7[_0xf41d('0x32')]<_0x45fb64[_0xf41d('0x32')]?0x1:-0x1;}else{return _0x4425b7[_0xf41d('0x32')]<_0x45fb64[_0xf41d('0x32')]?-0x1:0x1;}}});return _0x2d6bbc;}exports[_0xf41d('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x207154){var _0x142cda=['userpic',_0xf41d('0x41'),_0xf41d('0x42'),'lastPauseAt','pauseType',_0xf41d('0x43'),_0xf41d('0x3a'),'address',_0xf41d('0x4'),_0xf41d('0x6'),'mailPause',_0xf41d('0x7'),_0xf41d('0x8'),_0xf41d('0x30'),_0xf41d('0xe'),_0xf41d('0x44'),_0xf41d('0x45'),'mailCapacity',_0xf41d('0x46'),_0xf41d('0x47'),_0xf41d('0x48'),_0xf41d('0x49'),'openchannelCurrentCapacity','mailCurrentCapacity',_0xf41d('0x4a'),_0xf41d('0x4b'),_0xf41d('0x4c'),_0xf41d('0x10'),_0xf41d('0x13'),_0xf41d('0x12'),'smsStatus',_0xf41d('0x4d'),_0xf41d('0x11'),_0xf41d('0xd'),'chatStatusTime',_0xf41d('0x4e'),_0xf41d('0x4f'),_0xf41d('0x50'),_0xf41d('0x51'),_0xf41d('0x52'),_0xf41d('0x53'),_0xf41d('0x54'),'destconnectedlinenum',_0xf41d('0x55'),_0xf41d('0x56'),_0xf41d('0x57'),_0xf41d('0x58')];var _0x25a2d4=[_0xf41d('0x4'),'openchannelPause',_0xf41d('0x5'),_0xf41d('0x7'),_0xf41d('0x8'),_0xf41d('0x30'),_0xf41d('0xe'),_0xf41d('0x41')];var _0x709cbf=_(_0x207154)['omit'](_0x25a2d4)['pick'](_0x142cda)[_0xf41d('0x27')]();return _0x709cbf;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file
+var _0x326f=['faxStatusTime','voiceStatusTime','queue','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','filterAgentAttributes','role','chatStatusTime','whatsappStatusTime','openchannelCurrentCapacity','phoneBarEnableAutomaticScreenRecording','destconnectedlinenum','onhold','screenrecording','getRealtimeAgentsQueryFields','lodash','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','openchannelPause','pauseType','find','merge','getSortedAgentsIdsByStatus','split','filter','globalStatus','startsWith','DESC','ASC','getUpdatedSortOptions','validateSortParameter','toLowerCase','userpic','lastLoginAt','lastPauseAt','internal','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','whatsappStatus','openchannelStatusTime','mailStatusTime','smsStatusTime'];(function(_0x56a245,_0x5e4680){var _0x405de0=function(_0x2fb47c){while(--_0x2fb47c){_0x56a245['push'](_0x56a245['shift']());}};_0x405de0(++_0x5e4680);}(_0x326f,0xd1));var _0xf326=function(_0x52ef59,_0x140a67){_0x52ef59=_0x52ef59-0x0;var _0x5015db=_0x326f[_0x52ef59];return _0x5015db;};'use strict';var _=require(_0xf326('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232a});var routingClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232c});function isAgentPaused(_0x27e8d7,_0x120a26){var _0x9445c6=[_0x27e8d7[_0xf326('0x3')],_0x27e8d7[_0xf326('0x4')],_0x27e8d7[_0xf326('0x5')],_0x27e8d7['openchannelPause'],_0x27e8d7[_0xf326('0x6')],_0x27e8d7[_0xf326('0x7')],_0x27e8d7[_0xf326('0x8')]];if(!_0x120a26)return _[_0xf326('0x9')](_0x9445c6);var _0x515bfa=_['filter'](_0x9445c6);return _0x515bfa['length']>0x0&&_0x515bfa[_0xf326('0xa')]<_0x9445c6[_0xf326('0xa')]?!![]:![];}function isIdle(_0x163416){return _0x163416===_0xf326('0xb')||_0x163416===_0xf326('0xc')||_0x163416==='unavailable'||_0x163416===_0xf326('0xd')||_['isNil'](_0x163416);}function isAgentIdle(_0x1cf441){if(_0x1cf441['voiceStatus']!==_0xf326('0xb')&&_0x1cf441['voicePause']){_0x1cf441[_0xf326('0xe')]=_0xf326('0xf');return![];}return _['every']([_0x1cf441[_0xf326('0x10')],_0x1cf441[_0xf326('0x11')],_0x1cf441[_0xf326('0x12')],_0x1cf441[_0xf326('0x13')],_0x1cf441['smsStatus'],_0x1cf441[_0xf326('0xe')],_0x1cf441['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xf326('0x14'),{})[_0xf326('0x15')](function(_0x1f2e5a){if(_0x1f2e5a[_0xf326('0x16')]){throw new Error(_0xf326('0x17'));}var _0x287a2a=_0x1f2e5a[_0xf326('0x18')];return routingClient[_0xf326('0x19')]('Agents',{})[_0xf326('0x15')](function(_0x453100){if(_0x453100[_0xf326('0x16')]){throw new Error(_0xf326('0x1a'));}var _0xcef2b5=_0x453100[_0xf326('0x18')];return _['merge']({},_0x287a2a,_0xcef2b5);});})['catch'](function(_0x56ad41){throw _0x56ad41;});}exports[_0xf326('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x289f4b){var _0x484cbe='unknown';if(isAgentPaused(_0x289f4b))_0x484cbe=_0xf326('0xf');else if(isAgentPaused(_0x289f4b,!![]))_0x484cbe='*pause';else if(isAgentIdle(_0x289f4b))_0x484cbe='idle';else _0x484cbe=_0xf326('0x1c');return _0x484cbe;}exports[_0xf326('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x549b46,_0x5aa184){var _0x19b8ba=_[_0xf326('0x1e')](_0x549b46)?_0x549b46:[_0x549b46];var _0x5f21a2=_[_0xf326('0x1f')](_0x5aa184)+_0xf326('0x20');var _0x43c53e=_[_0xf326('0x21')](_0x19b8ba,function(_0x17c157){return db[_0x5f21a2][_0xf326('0x22')]({'where':{'id':_0x17c157}})['then'](function(_0x55b9f4){if(!_0x55b9f4)return[];return _0x55b9f4['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xf326('0x23')](_0x43c53e)[_0xf326('0x15')](function(_0x2cd45a){var _0x1ff2b5=_(_0x2cd45a)[_0xf326('0x24')]()[_0xf326('0x21')]('id')['uniq']()[_0xf326('0x25')]();return _0x1ff2b5;});}exports[_0xf326('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x212d5d,_0x581531,_0x1617d2){try{if(_0x581531['length']>0x0){_0x212d5d=_0x212d5d['filter'](function(_0x6a8e89){return _0x581531[_0xf326('0x27')](_0x6a8e89['id']);});}var _0x2fa28e=_0x212d5d['filter'](function(_0xc115d9){var _0x292500='busy';if(isAgentIdle(_0xc115d9)){_0x292500=_0xf326('0xb');}return _0x292500===_0x1617d2;});return _[_0xf326('0x21')](_0x2fa28e,'id');}catch(_0xd77aba){throw _0xd77aba;}}exports[_0xf326('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xa80156,_0x269be9,_0x161143){return Promise[_0xf326('0x29')]()[_0xf326('0x15')](function(){if(_0x269be9[_0xf326('0xa')]>0x0){_0xa80156=_0xa80156['filter'](function(_0x1035ed){return _0x269be9[_0xf326('0x27')](_0x1035ed['id']);});}return _0xa80156;})[_0xf326('0x15')](function(){return db['User'][_0xf326('0x2a')]({'attributes':['id',_0xf326('0x2b'),_0xf326('0x2c'),'chatPause','faxPause',_0xf326('0x5'),_0xf326('0x2d'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x2e')],'where':{'id':{'$in':_[_0xf326('0x21')](_0xa80156,'id')}},'raw':!![]});})[_0xf326('0x15')](function(_0x580374){return _0x580374[_0xf326('0x21')](function(_0x1981bc){var _0x51207a=_[_0xf326('0x2f')](_0xa80156,['id',_0x1981bc['id']]);var _0x4e5d7c=filterAgentAttributes(_0x51207a);_[_0xf326('0x30')](_0x1981bc,_0x4e5d7c);_0x1981bc['globalStatus']=getAgentStatus(_0x1981bc);return _0x1981bc;});})['then'](function(_0xadb020){var _0x4d8eac=sortAgentsByStatus(_0xadb020,_0x161143);return _[_0xf326('0x21')](_0x4d8eac,'id');})['catch'](function(_0x310dbb){throw _0x310dbb;});}exports[_0xf326('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2750ae){var _0x529cbb={'fields':[],'order':null};var _0x3dcc7e=_0x2750ae[_0xf326('0x32')](',');_0x529cbb['fields']=_[_0xf326('0x33')](_0x3dcc7e,function(_0xf64dd0){if(!_0xf64dd0[_0xf326('0x27')](_0xf326('0x34'))){return!![];}_0x529cbb['order']=_[_0xf326('0x35')](_0xf64dd0,'-')?_0xf326('0x36'):_0xf326('0x37');return![];});return _0x529cbb;}exports[_0xf326('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0x1d88ed){if(!_0x1d88ed){_0x1d88ed='fullname,internal';}if(_0x1d88ed[_0xf326('0x27')](_0xf326('0x2c'))&&!_0x1d88ed['includes']('internal')){var _0x40564e=_0x1d88ed['substring'](0x0,_0x1d88ed['indexOf'](_0xf326('0x2c')));_0x1d88ed+=','+_0x40564e+'internal';}return _0x1d88ed;}exports[_0xf326('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x37a95b,_0x2c1e7f){var _0x39611e=_0x37a95b['sort'](function(_0x9dda89,_0x45d344){if(_0x9dda89[_0xf326('0x34')]===_0x45d344[_0xf326('0x34')]){if(_0x9dda89[_0xf326('0x34')]===_0xf326('0xf')){if(_0x2c1e7f===_0xf326('0x36')){return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')]['toLowerCase']()?0x1:-0x1;}else{return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344['fullname'][_0xf326('0x3a')]()?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89['globalStatus']<_0x45d344[_0xf326('0x34')]?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x34')]<_0x45d344['globalStatus']?-0x1:0x1;}}});return _0x39611e;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x8e318d){var _0x269e89=[_0xf326('0x3b'),'online',_0xf326('0x3c'),_0xf326('0x3d'),_0xf326('0x2e'),_0xf326('0x3d'),_0xf326('0x3e'),_0xf326('0x3f'),_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),_0xf326('0x40'),_0xf326('0x41'),'mailCapacity',_0xf326('0x42'),_0xf326('0x43'),_0xf326('0x44'),_0xf326('0x45'),'openchannelCurrentCapacity',_0xf326('0x46'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x49'),'chatStatus',_0xf326('0x13'),_0xf326('0x12'),_0xf326('0x4a'),_0xf326('0x4b'),_0xf326('0x11'),'voiceStatus','chatStatusTime',_0xf326('0x4c'),_0xf326('0x4d'),_0xf326('0x4e'),'whatsappStatusTime',_0xf326('0x4f'),_0xf326('0x50'),_0xf326('0x51'),'destconnectedlinenum','screenrecording',_0xf326('0x52'),'phoneBarEnableAutomaticScreenRecording',_0xf326('0x53')];var _0x554277=[_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),'online'];var _0xcdaf3f=_(_0x8e318d)[_0xf326('0x54')](_0x554277)[_0xf326('0x55')](_0x269e89)['value']();return _0xcdaf3f;}exports[_0xf326('0x56')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xf326('0x2b'),_0xf326('0x2c'),_0xf326('0x57'),_0xf326('0x3e'),'online',_0xf326('0x34'),_0xf326('0x3b'),_0xf326('0x3c'),_0xf326('0x2e'),'lastPauseAt',_0xf326('0x4'),_0xf326('0x3'),_0xf326('0x5'),_0xf326('0x2d'),'smsPause','voicePause',_0xf326('0x8'),_0xf326('0x10'),'faxStatus',_0xf326('0x12'),_0xf326('0x13'),_0xf326('0x4a'),_0xf326('0xe'),'whatsappStatus',_0xf326('0x58'),'faxStatusTime','mailStatusTime',_0xf326('0x4c'),'smsStatusTime',_0xf326('0x50'),_0xf326('0x59'),_0xf326('0x40'),'faxCapacity','mailCapacity',_0xf326('0x41'),_0xf326('0x42'),_0xf326('0x43'),'chatCurrentCapacity',_0xf326('0x49'),'mailCurrentCapacity',_0xf326('0x5a'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x52'),_0xf326('0x5b'),_0xf326('0x5c'),_0xf326('0x5d'),_0xf326('0x51'),_0xf326('0x53'),_0xf326('0x5e')];}exports[_0xf326('0x5f')]=getRealtimeAgentsQueryFields;
\ No newline at end of file