Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / components / realtime / agents.js
index ab02769..df37dbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea7d=['openchannelPause','whatsappPause','pauseType','find','merge','getSortedAgentsIdsByStatus','split','globalStatus','order','startsWith','DESC','ASC','getUpdatedSortOptions','includes','internal','substring','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','filterAgentAttributes','lodash','../../mysqldb','client','chatPause','faxPause','smsPause','voicePause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','catch','getRealtimeAgents','pause','*pause','busy','getAgentStatus','startCase','map','getAgents','all','flatten','value','getAgentIdsByQueues','getAgentIdsByStatus','User','findAll','name','fullname','mailPause'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0xea7d,0x88));var _0xdea7=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0xea7d[_0x553a87];return _0x12d1e6;};'use strict';var _=require(_0xdea7('0x0'));var jayson=require('jayson/promise');var db=require(_0xdea7('0x1'))['db'];var amiClient=jayson[_0xdea7('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xdea7('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x44f735,_0x45ce06){var _0x17451c=[_0x44f735[_0xdea7('0x3')],_0x44f735[_0xdea7('0x4')],_0x44f735['mailPause'],_0x44f735['openchannelPause'],_0x44f735[_0xdea7('0x5')],_0x44f735[_0xdea7('0x6')],_0x44f735['whatsappPause']];if(!_0x45ce06)return _[_0xdea7('0x7')](_0x17451c);var _0x3734aa=_[_0xdea7('0x8')](_0x17451c);return _0x3734aa[_0xdea7('0x9')]>0x0&&_0x3734aa[_0xdea7('0x9')]<_0x17451c['length']?!![]:![];}function isIdle(_0xdd7a10){return _0xdd7a10===_0xdea7('0xa')||_0xdd7a10===_0xdea7('0xb')||_0xdd7a10===_0xdea7('0xc')||_0xdd7a10===_0xdea7('0xd')||_['isNil'](_0xdd7a10);}function isAgentIdle(_0x33800a){if(_0x33800a[_0xdea7('0xe')]!==_0xdea7('0xa')&&_0x33800a[_0xdea7('0x6')]){_0x33800a[_0xdea7('0xe')]='pause';return![];}return _['every']([_0x33800a[_0xdea7('0xf')],_0x33800a[_0xdea7('0x10')],_0x33800a[_0xdea7('0x11')],_0x33800a[_0xdea7('0x12')],_0x33800a[_0xdea7('0x13')],_0x33800a[_0xdea7('0xe')],_0x33800a[_0xdea7('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xdea7('0x15')](_0xdea7('0x16'),{})['then'](function(_0x55686c){if(_0x55686c[_0xdea7('0x17')]){throw new Error(_0xdea7('0x18'));}var _0x23ec8e=_0x55686c[_0xdea7('0x19')];return routingClient[_0xdea7('0x15')](_0xdea7('0x16'),{})[_0xdea7('0x1a')](function(_0x7e5d82){if(_0x7e5d82[_0xdea7('0x17')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x4d666f=_0x7e5d82['result'];return _['merge']({},_0x23ec8e,_0x4d666f);});})[_0xdea7('0x1b')](function(_0x1d9686){throw _0x1d9686;});}exports[_0xdea7('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x12c280){var _0x4850b5=_0xdea7('0xb');if(isAgentPaused(_0x12c280))_0x4850b5=_0xdea7('0x1d');else if(isAgentPaused(_0x12c280,!![]))_0x4850b5=_0xdea7('0x1e');else if(isAgentIdle(_0x12c280))_0x4850b5=_0xdea7('0xa');else _0x4850b5=_0xdea7('0x1f');return _0x4850b5;}exports[_0xdea7('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x21877c,_0xa24f7d){var _0x24267c=_['isArray'](_0x21877c)?_0x21877c:[_0x21877c];var _0x543e6a=_[_0xdea7('0x21')](_0xa24f7d)+'Queue';var _0x3ccd7d=_[_0xdea7('0x22')](_0x24267c,function(_0x4692ad){return db[_0x543e6a]['findOne']({'where':{'id':_0x4692ad}})[_0xdea7('0x1a')](function(_0x4e1ccd){if(!_0x4e1ccd)return[];return _0x4e1ccd[_0xdea7('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xdea7('0x24')](_0x3ccd7d)[_0xdea7('0x1a')](function(_0x1be059){var _0x2f3da0=_(_0x1be059)[_0xdea7('0x25')]()['map']('id')['uniq']()[_0xdea7('0x26')]();return _0x2f3da0;});}exports[_0xdea7('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1a30d9,_0xead704,_0x4580f0){try{if(_0xead704[_0xdea7('0x9')]>0x0){_0x1a30d9=_0x1a30d9['filter'](function(_0x28a463){return _0xead704['includes'](_0x28a463['id']);});}var _0x24ccbd=_0x1a30d9['filter'](function(_0xec02e8){var _0x54ef01=_0xdea7('0x1f');if(isAgentIdle(_0xec02e8)){_0x54ef01=_0xdea7('0xa');}return _0x54ef01===_0x4580f0;});return _[_0xdea7('0x22')](_0x24ccbd,'id');}catch(_0x3c1846){throw _0x3c1846;}}exports[_0xdea7('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x26a4e1,_0x1a72a1,_0x14ae8b){return Promise['resolve']()['then'](function(){if(_0x1a72a1[_0xdea7('0x9')]>0x0){_0x26a4e1=_0x26a4e1[_0xdea7('0x8')](function(_0x5a18d9){return _0x1a72a1['includes'](_0x5a18d9['id']);});}return _0x26a4e1;})['then'](function(){return db[_0xdea7('0x29')][_0xdea7('0x2a')]({'attributes':['id',_0xdea7('0x2b'),_0xdea7('0x2c'),_0xdea7('0x3'),_0xdea7('0x4'),_0xdea7('0x2d'),_0xdea7('0x2e'),'smsPause','voicePause',_0xdea7('0x2f'),_0xdea7('0x30')],'where':{'id':{'$in':_['map'](_0x26a4e1,'id')}},'raw':!![]});})[_0xdea7('0x1a')](function(_0x5382cf){return _0x5382cf[_0xdea7('0x22')](function(_0x4a17be){var _0x4343f5=_[_0xdea7('0x31')](_0x26a4e1,['id',_0x4a17be['id']]);var _0x43fedc=filterAgentAttributes(_0x4343f5);_[_0xdea7('0x32')](_0x4a17be,_0x43fedc);_0x4a17be['globalStatus']=getAgentStatus(_0x4a17be);return _0x4a17be;});})[_0xdea7('0x1a')](function(_0x21ab81){var _0x5bb676=sortAgentsByStatus(_0x21ab81,_0x14ae8b);return _['map'](_0x5bb676,'id');})[_0xdea7('0x1b')](function(_0x5ca190){throw _0x5ca190;});}exports[_0xdea7('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4860bc){var _0xcbe3de={'fields':[],'order':null};var _0x42a831=_0x4860bc[_0xdea7('0x34')](',');_0xcbe3de['fields']=_[_0xdea7('0x8')](_0x42a831,function(_0x170baf){if(!_0x170baf['includes'](_0xdea7('0x35'))){return!![];}_0xcbe3de[_0xdea7('0x36')]=_[_0xdea7('0x37')](_0x170baf,'-')?_0xdea7('0x38'):_0xdea7('0x39');return![];});return _0xcbe3de;}exports[_0xdea7('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x21d26f){if(_0x21d26f[_0xdea7('0x3b')](_0xdea7('0x2c'))&&!_0x21d26f['includes'](_0xdea7('0x3c'))){var _0x9c99e2=_0x21d26f[_0xdea7('0x3d')](0x0,_0x21d26f['indexOf']('fullname'));_0x21d26f+=','+_0x9c99e2+_0xdea7('0x3c');}return _0x21d26f;}exports[_0xdea7('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x16cfcc,_0x40ab8f){var _0x496142=_0x16cfcc[_0xdea7('0x3f')](function(_0x3d4702,_0x326091){if(_0x3d4702[_0xdea7('0x35')]===_0x326091['globalStatus']){if(_0x3d4702[_0xdea7('0x35')]===_0xdea7('0x1d')){if(_0x40ab8f===_0xdea7('0x38')){return(_0x3d4702[_0xdea7('0x30')]||'')<(_0x326091['pauseType']||'')||_0x3d4702[_0xdea7('0x2c')][_0xdea7('0x40')]()>_0x326091['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x3d4702[_0xdea7('0x30')]||'')<(_0x326091['pauseType']||'')||_0x3d4702[_0xdea7('0x2c')][_0xdea7('0x40')]()>_0x326091['fullname'][_0xdea7('0x40')]()?-0x1:0x1;}}else{if(_0x40ab8f===_0xdea7('0x38')){return _0x3d4702['fullname'][_0xdea7('0x40')]()<_0x326091['fullname']['toLowerCase']()?0x1:-0x1;}else{return _0x3d4702[_0xdea7('0x2c')][_0xdea7('0x40')]()<_0x326091[_0xdea7('0x2c')][_0xdea7('0x40')]()?-0x1:0x1;}}}else{if(_0x40ab8f===_0xdea7('0x38')){return _0x3d4702['globalStatus']<_0x326091[_0xdea7('0x35')]?0x1:-0x1;}else{return _0x3d4702['globalStatus']<_0x326091[_0xdea7('0x35')]?-0x1:0x1;}}});return _0x496142;}exports[_0xdea7('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x58a66a){var _0x38b862=[_0xdea7('0x42'),_0xdea7('0x43'),_0xdea7('0x44'),_0xdea7('0x45'),_0xdea7('0x30'),_0xdea7('0x45'),'internal',_0xdea7('0x46'),_0xdea7('0x3'),_0xdea7('0x2e'),_0xdea7('0x2d'),_0xdea7('0x5'),'whatsappPause',_0xdea7('0x4'),'voicePause','chatCapacity',_0xdea7('0x47'),_0xdea7('0x48'),_0xdea7('0x49'),'whatsappCapacity',_0xdea7('0x4a'),_0xdea7('0x4b'),'openchannelCurrentCapacity',_0xdea7('0x4c'),_0xdea7('0x4d'),_0xdea7('0x4e'),'faxCurrentCapacity',_0xdea7('0xf'),_0xdea7('0x12'),'mailStatus',_0xdea7('0x13'),_0xdea7('0x14'),_0xdea7('0x10'),'voiceStatus',_0xdea7('0x4f'),'openchannelStatusTime',_0xdea7('0x50'),_0xdea7('0x51'),_0xdea7('0x52'),_0xdea7('0x53'),_0xdea7('0x54'),_0xdea7('0x55'),_0xdea7('0x56'),_0xdea7('0x57'),'phoneBarEnableScreenRecordingByAgent',_0xdea7('0x58'),'routealias'];var _0x30fde4=[_0xdea7('0x3'),_0xdea7('0x2e'),_0xdea7('0x2d'),_0xdea7('0x5'),_0xdea7('0x2f'),_0xdea7('0x4'),_0xdea7('0x6'),_0xdea7('0x43')];var _0x7c1209=_(_0x58a66a)[_0xdea7('0x59')](_0x30fde4)['pick'](_0x38b862)[_0xdea7('0x26')]();return _0x7c1209;}exports[_0xdea7('0x5a')]=filterAgentAttributes;
\ No newline at end of file
+var _0xc4aa=['substring','indexOf','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','role','openchannelStatusTime','voiceStatusTime','chatCapacity','whatsappCapacity','smsCurrentCapacity','onhold','routealias','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','ringing','voiceStatus','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','merge','catch','getRealtimeAgents','pause','*pause','busy','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','pauseType','globalStatus','getSortedAgentsIdsByStatus','split','fields','DESC','internal'];(function(_0x46f659,_0x3c2c9d){var _0xbf5e5c=function(_0x6ff5ea){while(--_0x6ff5ea){_0x46f659['push'](_0x46f659['shift']());}};_0xbf5e5c(++_0x3c2c9d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xac4a('0x0'));var jayson=require(_0xac4a('0x1'));var db=require(_0xac4a('0x2'))['db'];var amiClient=jayson[_0xac4a('0x3')][_0xac4a('0x4')]({'port':0x232a});var routingClient=jayson[_0xac4a('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x5cda73,_0x47d4f6){var _0x2f48ed=[_0x5cda73[_0xac4a('0x5')],_0x5cda73[_0xac4a('0x6')],_0x5cda73[_0xac4a('0x7')],_0x5cda73[_0xac4a('0x8')],_0x5cda73[_0xac4a('0x9')],_0x5cda73[_0xac4a('0xa')],_0x5cda73[_0xac4a('0xb')]];if(!_0x47d4f6)return _['every'](_0x2f48ed);var _0x5b8339=_[_0xac4a('0xc')](_0x2f48ed);return _0x5b8339[_0xac4a('0xd')]>0x0&&_0x5b8339[_0xac4a('0xd')]<_0x2f48ed['length']?!![]:![];}function isIdle(_0x1d182e){return _0x1d182e===_0xac4a('0xe')||_0x1d182e===_0xac4a('0xf')||_0x1d182e==='unavailable'||_0x1d182e===_0xac4a('0x10')||_['isNil'](_0x1d182e);}function isAgentIdle(_0x2f062c){if(_0x2f062c['voiceStatus']!==_0xac4a('0xe')&&_0x2f062c[_0xac4a('0xa')]){_0x2f062c[_0xac4a('0x11')]='pause';return![];}return _[_0xac4a('0x12')]([_0x2f062c[_0xac4a('0x13')],_0x2f062c[_0xac4a('0x14')],_0x2f062c[_0xac4a('0x15')],_0x2f062c[_0xac4a('0x16')],_0x2f062c[_0xac4a('0x17')],_0x2f062c[_0xac4a('0x11')],_0x2f062c[_0xac4a('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xac4a('0x19')](_0xac4a('0x1a'),{})[_0xac4a('0x1b')](function(_0x26dbb8){if(_0x26dbb8['error']){throw new Error(_0xac4a('0x1c'));}var _0x34d797=_0x26dbb8[_0xac4a('0x1d')];return routingClient[_0xac4a('0x19')](_0xac4a('0x1a'),{})[_0xac4a('0x1b')](function(_0x28e304){if(_0x28e304[_0xac4a('0x1e')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x5ac21e=_0x28e304[_0xac4a('0x1d')];return _[_0xac4a('0x1f')]({},_0x34d797,_0x5ac21e);});})[_0xac4a('0x20')](function(_0x4d837c){throw _0x4d837c;});}exports[_0xac4a('0x21')]=getRealtimeAgents;function getAgentStatus(_0x15c223){var _0x3752e4=_0xac4a('0xf');if(isAgentPaused(_0x15c223))_0x3752e4=_0xac4a('0x22');else if(isAgentPaused(_0x15c223,!![]))_0x3752e4=_0xac4a('0x23');else if(isAgentIdle(_0x15c223))_0x3752e4=_0xac4a('0xe');else _0x3752e4=_0xac4a('0x24');return _0x3752e4;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x3d8f0a,_0x3204ad){var _0x599787=_[_0xac4a('0x25')](_0x3d8f0a)?_0x3d8f0a:[_0x3d8f0a];var _0x4169c0=_[_0xac4a('0x26')](_0x3204ad)+_0xac4a('0x27');var _0x4d2d6c=_[_0xac4a('0x28')](_0x599787,function(_0x2503d8){return db[_0x4169c0][_0xac4a('0x29')]({'where':{'id':_0x2503d8}})[_0xac4a('0x1b')](function(_0x594f36){if(!_0x594f36)return[];return _0x594f36[_0xac4a('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xac4a('0x2b')](_0x4d2d6c)[_0xac4a('0x1b')](function(_0x3e2c69){var _0x3bc318=_(_0x3e2c69)[_0xac4a('0x2c')]()[_0xac4a('0x28')]('id')[_0xac4a('0x2d')]()[_0xac4a('0x2e')]();return _0x3bc318;});}exports[_0xac4a('0x2f')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x20202c,_0x4e17ce,_0x23b061){try{if(_0x4e17ce[_0xac4a('0xd')]>0x0){_0x20202c=_0x20202c[_0xac4a('0xc')](function(_0x2772fe){return _0x4e17ce[_0xac4a('0x30')](_0x2772fe['id']);});}var _0x4a5a9e=_0x20202c['filter'](function(_0xdb7e){var _0x7a948b=_0xac4a('0x24');if(isAgentIdle(_0xdb7e)){_0x7a948b='idle';}return _0x7a948b===_0x23b061;});return _['map'](_0x4a5a9e,'id');}catch(_0x355755){throw _0x355755;}}exports[_0xac4a('0x31')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x228629,_0x432066,_0x17118e){return Promise['resolve']()[_0xac4a('0x1b')](function(){if(_0x432066['length']>0x0){_0x228629=_0x228629[_0xac4a('0xc')](function(_0x57adcf){return _0x432066[_0xac4a('0x30')](_0x57adcf['id']);});}return _0x228629;})[_0xac4a('0x1b')](function(){return db[_0xac4a('0x32')][_0xac4a('0x33')]({'attributes':['id',_0xac4a('0x34'),_0xac4a('0x35'),_0xac4a('0x5'),_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0x36')],'where':{'id':{'$in':_['map'](_0x228629,'id')}},'raw':!![]});})[_0xac4a('0x1b')](function(_0x1c41fb){return _0x1c41fb['map'](function(_0x2a5419){var _0x1af1c1=_['find'](_0x228629,['id',_0x2a5419['id']]);var _0x58804b=filterAgentAttributes(_0x1af1c1);_[_0xac4a('0x1f')](_0x2a5419,_0x58804b);_0x2a5419[_0xac4a('0x37')]=getAgentStatus(_0x2a5419);return _0x2a5419;});})[_0xac4a('0x1b')](function(_0x3de9e2){var _0x4f5986=sortAgentsByStatus(_0x3de9e2,_0x17118e);return _[_0xac4a('0x28')](_0x4f5986,'id');})[_0xac4a('0x20')](function(_0x4e7630){throw _0x4e7630;});}exports[_0xac4a('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x34f55c){var _0x3ea5c8={'fields':[],'order':null};var _0x5f0eb8=_0x34f55c[_0xac4a('0x39')](',');_0x3ea5c8[_0xac4a('0x3a')]=_[_0xac4a('0xc')](_0x5f0eb8,function(_0x4e0445){if(!_0x4e0445[_0xac4a('0x30')](_0xac4a('0x37'))){return!![];}_0x3ea5c8['order']=_['startsWith'](_0x4e0445,'-')?_0xac4a('0x3b'):'ASC';return![];});return _0x3ea5c8;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x5f0af0){if(!_0x5f0af0){_0x5f0af0='fullname,internal';}if(_0x5f0af0[_0xac4a('0x30')](_0xac4a('0x35'))&&!_0x5f0af0[_0xac4a('0x30')](_0xac4a('0x3c'))){var _0x2bdb21=_0x5f0af0[_0xac4a('0x3d')](0x0,_0x5f0af0[_0xac4a('0x3e')](_0xac4a('0x35')));_0x5f0af0+=','+_0x2bdb21+_0xac4a('0x3c');}return _0x5f0af0;}exports[_0xac4a('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x14f7d5,_0x1c2a87){var _0x4e4994=_0x14f7d5['sort'](function(_0x5cd24f,_0x1e1cc5){if(_0x5cd24f[_0xac4a('0x37')]===_0x1e1cc5[_0xac4a('0x37')]){if(_0x5cd24f[_0xac4a('0x37')]===_0xac4a('0x22')){if(_0x1c2a87===_0xac4a('0x3b')){return(_0x5cd24f[_0xac4a('0x36')]||'')<(_0x1e1cc5[_0xac4a('0x36')]||'')||_0x5cd24f[_0xac4a('0x35')][_0xac4a('0x40')]()>_0x1e1cc5['fullname'][_0xac4a('0x40')]()?0x1:-0x1;}else{return(_0x5cd24f[_0xac4a('0x36')]||'')<(_0x1e1cc5[_0xac4a('0x36')]||'')||_0x5cd24f[_0xac4a('0x35')][_0xac4a('0x40')]()>_0x1e1cc5['fullname'][_0xac4a('0x40')]()?-0x1:0x1;}}else{if(_0x1c2a87===_0xac4a('0x3b')){return _0x5cd24f['fullname'][_0xac4a('0x40')]()<_0x1e1cc5['fullname'][_0xac4a('0x40')]()?0x1:-0x1;}else{return _0x5cd24f[_0xac4a('0x35')][_0xac4a('0x40')]()<_0x1e1cc5[_0xac4a('0x35')][_0xac4a('0x40')]()?-0x1:0x1;}}}else{if(_0x1c2a87===_0xac4a('0x3b')){return _0x5cd24f[_0xac4a('0x37')]<_0x1e1cc5[_0xac4a('0x37')]?0x1:-0x1;}else{return _0x5cd24f[_0xac4a('0x37')]<_0x1e1cc5[_0xac4a('0x37')]?-0x1:0x1;}}});return _0x4e4994;}exports[_0xac4a('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x3b68b3){var _0x569812=[_0xac4a('0x42'),_0xac4a('0x43'),_0xac4a('0x44'),'lastPauseAt',_0xac4a('0x36'),_0xac4a('0x45'),'internal',_0xac4a('0x46'),'chatPause',_0xac4a('0x8'),_0xac4a('0x7'),_0xac4a('0x9'),'whatsappPause','faxPause',_0xac4a('0xa'),'chatCapacity',_0xac4a('0x47'),'mailCapacity',_0xac4a('0x48'),'whatsappCapacity',_0xac4a('0x49'),_0xac4a('0x4a'),_0xac4a('0x4b'),_0xac4a('0x4c'),'smsCurrentCapacity',_0xac4a('0x4d'),_0xac4a('0x4e'),_0xac4a('0x13'),_0xac4a('0x16'),_0xac4a('0x15'),_0xac4a('0x17'),_0xac4a('0x18'),'faxStatus',_0xac4a('0x11'),_0xac4a('0x4f'),'openchannelStatusTime',_0xac4a('0x50'),_0xac4a('0x51'),_0xac4a('0x52'),_0xac4a('0x53'),'voiceStatusTime',_0xac4a('0x54'),_0xac4a('0x55'),_0xac4a('0x56'),_0xac4a('0x57'),_0xac4a('0x58'),'routealias'];var _0x179373=['chatPause',_0xac4a('0x8'),_0xac4a('0x7'),'smsPause','whatsappPause',_0xac4a('0x6'),_0xac4a('0xa'),'online'];var _0x18d29c=_(_0x3b68b3)[_0xac4a('0x59')](_0x179373)[_0xac4a('0x5a')](_0x569812)[_0xac4a('0x2e')]();return _0x18d29c;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xac4a('0x34'),_0xac4a('0x35'),_0xac4a('0x5b'),_0xac4a('0x3c'),_0xac4a('0x43'),_0xac4a('0x37'),_0xac4a('0x42'),'lastLoginAt',_0xac4a('0x36'),_0xac4a('0x45'),_0xac4a('0x6'),_0xac4a('0x5'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0x13'),_0xac4a('0x14'),_0xac4a('0x15'),_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x11'),_0xac4a('0x18'),'chatStatusTime',_0xac4a('0x53'),'mailStatusTime',_0xac4a('0x5c'),'smsStatusTime',_0xac4a('0x5d'),'whatsappStatusTime',_0xac4a('0x5e'),'faxCapacity','mailCapacity',_0xac4a('0x47'),_0xac4a('0x48'),_0xac4a('0x5f'),_0xac4a('0x4a'),_0xac4a('0x4e'),_0xac4a('0x4c'),'openchannelCurrentCapacity',_0xac4a('0x60'),'whatsappCurrentCapacity',_0xac4a('0x57'),'phoneBarEnableAutomaticScreenRecording',_0xac4a('0x55'),_0xac4a('0x61'),_0xac4a('0x54'),_0xac4a('0x62'),_0xac4a('0x56')];}exports[_0xac4a('0x63')]=getRealtimeAgentsQueryFields;
\ No newline at end of file