Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / services / ami / realtime / index.js
index 9a67083..5c6e8ba 100644 (file)
@@ -1 +1 @@
-const a1256_0x40e7=['unmanaged','merge','outboundDropCallsDayTimeout','../model/zendeskAccount','triggers','deskAccounts','initTelephones','outboundDropCallsDayCallersExit','../model/freshdeskAccount','voiceExtensions','isNil','diff','queuecallerleaveAt','outboundRejectCallsDay','lodash','outboundUnknownCallsDay','../model/vtigerAccount','undefined','../model/deskAccount','../model/faxAccount','../model/agent','../model/template','outboundChannels','freshsalesAccounts','disposition','../model/zohoAccount','initCampaigns','length','SquareProject','initDeskAccounts','../model/dynamics365Account','mergeFromDatabase','outboundBusyCallsDay','initTemplates','voiceQueues','billableseconds','outboundBlacklistCallsDay','mapKeys','seconds','faxAccounts','outboundAnswerAgiCallsDay','abandoned','queuecallercompleteAt','initVtigerAccounts','name','initZendeskAccounts','servicenowAccounts','SIP/%s','channels','moment','outboundNoAnswerCallsDay','agents','initVoiceCallReports','../model/servicenowAccount','dynamics365Accounts','uniqueid','sumDuration','sumHoldTime','initFreshsalesAccounts','prototype','util','initFaxAccounts','answered','sugarcrmAccounts','initTrunks','sumBillable','outboundOriginateFailureCallsDay','initDynamics365Accounts','timers','zohoAccounts','ivrAnswerCallsDay','salesforceAccounts','queueStatusComplete','initAgents','vtigerAccounts','queuecallercomplete','zendeskAccounts','trunks','groupBy','outboundReCallsDay','../model/telephone','../model/campaign','outboundCongestionCallsDay','exports','../model/salesforceAccount','templates','duration','ANSWERED','queuecallerjoinAt','interface','isEmpty','dialQueueProject','freshdeskAccounts','initCampaignHopperHistory','queuecallerabandonAt','outbound','telephones','campaigns','isUndefined','initSugarcrmAccounts','ivrTotalCallsDays','total','format','../model/voiceQueue','queuecallerexit'];(function(_0x1999f1,_0x56cece){const _0x40e7a4=function(_0x42a0ce){while(--_0x42a0ce){_0x1999f1['push'](_0x1999f1['shift']());}};_0x40e7a4(++_0x56cece);}(a1256_0x40e7,0xb7));const a1256_0x42a0=function(_0x1999f1,_0x56cece){_0x1999f1=_0x1999f1-0x133;let _0x40e7a4=a1256_0x40e7[_0x1999f1];return _0x40e7a4;};const a1256_0x1f5251=a1256_0x42a0;'use strict';const util=require(a1256_0x1f5251(0x18a)),_=require(a1256_0x1f5251(0x15c)),moment=require(a1256_0x1f5251(0x17f)),Agent=require(a1256_0x1f5251(0x162)),Telephone=require(a1256_0x1f5251(0x135)),Trunk=require('../model/trunk'),VoiceQueue=require(a1256_0x1f5251(0x14c)),Trigger=require('../model/trigger'),Template=require(a1256_0x1f5251(0x163)),Campaign=require(a1256_0x1f5251(0x136)),VoiceExtension=require('../model/voiceExtension'),ZendeskAccount=require(a1256_0x1f5251(0x151)),SalesforceAccount=require(a1256_0x1f5251(0x139)),FreshdeskAccount=require(a1256_0x1f5251(0x156)),SugarcrmAccount=require('../model/sugarcrmAccount'),ZohoAccount=require(a1256_0x1f5251(0x167)),DeskAccount=require(a1256_0x1f5251(0x160)),VtigerAccount=require(a1256_0x1f5251(0x15e)),ServicenowAccount=require(a1256_0x1f5251(0x183)),Dynamics365Account=require(a1256_0x1f5251(0x16c)),FreshsalesAccount=require('../model/freshsalesAccount'),FaxAccount=require(a1256_0x1f5251(0x161)),Realtime=function(){const _0x563b8a=a1256_0x1f5251;this[_0x563b8a(0x181)]={},this[_0x563b8a(0x145)]={},this[_0x563b8a(0x19b)]={},this[_0x563b8a(0x170)]={},this[_0x563b8a(0x152)]={},this[_0x563b8a(0x146)]={},this[_0x563b8a(0x13a)]={},this[_0x563b8a(0x144)]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0},this[_0x563b8a(0x157)]={},this[_0x563b8a(0x17e)]={},this['queueChannels']={},this[_0x563b8a(0x164)]={},this[_0x563b8a(0x192)]={},this[_0x563b8a(0x19a)]={},this[_0x563b8a(0x195)]={},this[_0x563b8a(0x18d)]={},this[_0x563b8a(0x141)]={},this['zohoAccounts']={},this[_0x563b8a(0x153)]={},this['vtigerAccounts']={},this[_0x563b8a(0x17c)]={},this[_0x563b8a(0x184)]={},this[_0x563b8a(0x165)]={},this[_0x563b8a(0x175)]={};};function freeIsNotKey(_0x3a4cab,_0x3596ce,_0x3d8b47){const _0x423851=a1256_0x1f5251,_0x37e234=_['mapKeys'](_0x3a4cab,function(_0x40cde3){return _0x40cde3[_0x3d8b47];});for(const _0x1f871e in _0x3596ce){typeof _0x3596ce[_0x1f871e]!==_0x423851(0x15f)&&(!_0x37e234[_0x1f871e]&&delete _0x3596ce[_0x1f871e]);}}function freeIsNotKeySip(_0x4caa2b,_0x1d6a62){const _0x1f6267=_['mapKeys'](_0x4caa2b,function(_0x19c823){const _0x53eab5=a1256_0x42a0;return util[_0x53eab5(0x14b)](_0x53eab5(0x17d),_0x19c823[_0x53eab5(0x17a)]);});for(const _0x4fd84e in _0x1d6a62){typeof _0x1d6a62[_0x4fd84e]!=='undefined'&&(!_0x1f6267[_0x4fd84e]&&delete _0x1d6a62[_0x4fd84e]);}}function freeIsNotKeyAgent(_0x2d87d9,_0x43c48b){const _0x27cdd6=a1256_0x1f5251,_0x2fa832=_[_0x27cdd6(0x173)](_0x2d87d9,function(_0x222fa9){const _0x65fb14=_0x27cdd6,_0x29406e=_['isNil'](_0x222fa9[_0x65fb14(0x13e)])?util[_0x65fb14(0x14b)](_0x65fb14(0x17d),_0x222fa9['name']):_0x222fa9[_0x65fb14(0x13e)];return _0x29406e;});for(const _0x35a5db in _0x43c48b){typeof _0x43c48b[_0x35a5db]!==_0x27cdd6(0x15f)&&(!_0x2fa832[_0x35a5db]&&delete _0x43c48b[_0x35a5db]);}}function clearVoiceCallReports(_0x36458b){const _0x48d1fc=a1256_0x1f5251;_0x36458b[_0x48d1fc(0x14a)]=0x0,_0x36458b[_0x48d1fc(0x18c)]=0x0,_0x36458b[_0x48d1fc(0x187)]=0x0,_0x36458b[_0x48d1fc(0x186)]=0x0,_0x36458b['sumBillable']=0x0;}function clearCampaigns(_0x2f1d38){const _0xc68620=a1256_0x1f5251;if(!_[_0xc68620(0x13f)](_0x2f1d38))for(const _0x519d44 in _0x2f1d38){typeof _0x2f1d38[_0x519d44]!==_0xc68620(0x15f)&&(_0x2f1d38[_0x519d44][_0xc68620(0x149)]=0x0,_0x2f1d38[_0x519d44][_0xc68620(0x194)]=0x0);}}function clearVoiceQueues(_0x132810){const _0x5787d7=a1256_0x1f5251;if(!_[_0x5787d7(0x13f)](_0x132810))for(const _0x110f14 in _0x132810){typeof _0x132810[_0x110f14]!==_0x5787d7(0x15f)&&(_0x132810[_0x110f14][_0x5787d7(0x14a)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x18c)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x14e)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x177)]=0x0,_0x132810[_0x110f14]['sumHoldTime']=0x0,_0x132810[_0x110f14][_0x5787d7(0x186)]=0x0,_0x132810[_0x110f14]['sumBillable']=0x0,_0x132810[_0x110f14][_0x5787d7(0x176)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x180)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x16e)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x137)]=0x0,_0x132810[_0x110f14]['outboundNoSuchCallsDay']=0x0,_0x132810[_0x110f14][_0x5787d7(0x15d)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x150)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x155)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x172)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x190)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x15b)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x134)]=0x0,_0x132810[_0x110f14][_0x5787d7(0x176)]=0x0,_0x132810[_0x110f14]['outboundAnswerCallsDay']=0x0,_0x132810[_0x110f14][_0x5787d7(0x196)]=!![]);}}Realtime['prototype'][a1256_0x1f5251(0x16d)]=function(_0x20ca6f,_0x3bdf0f){const _0x276496=a1256_0x1f5251;for(const _0x1192f2 in _0x3bdf0f){typeof _0x20ca6f[_0x1192f2]!==_0x276496(0x15f)&&(_0x20ca6f[_0x1192f2]=_0x3bdf0f[_0x1192f2]);}},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x197)]=function(){const _0xb864a=this;return function(_0x31effc){const _0x12fa4d=a1256_0x42a0;if(_0x31effc){freeIsNotKeyAgent(_0x31effc,_0xb864a[_0x12fa4d(0x181)]);for(let _0x150591=0x0,_0x514de2={};_0x150591<_0x31effc[_0x12fa4d(0x169)];_0x150591+=0x1){_0x514de2=_0x31effc[_0x150591];const _0x1e4164=_[_0x12fa4d(0x158)](_0x514de2[_0x12fa4d(0x13e)])?util[_0x12fa4d(0x14b)](_0x12fa4d(0x17d),_0x514de2[_0x12fa4d(0x17a)]):_0x514de2[_0x12fa4d(0x13e)];_[_0x12fa4d(0x147)](_0xb864a[_0x12fa4d(0x181)][_0x1e4164])?_0xb864a[_0x12fa4d(0x181)][_0x1e4164]=new Agent(_0x514de2):_0xb864a[_0x12fa4d(0x16d)](_0xb864a['agents'][_0x1e4164],_0x514de2);}}return _0xb864a['agents'];};},Realtime['prototype'][a1256_0x1f5251(0x154)]=function(){const _0x23e453=this;return function(_0x2dacb8){const _0x19f83b=a1256_0x42a0;if(_0x2dacb8){freeIsNotKeySip(_0x2dacb8,_0x23e453['telephones']);for(let _0x2ffb82=0x0,_0x5d57c7={};_0x2ffb82<_0x2dacb8['length'];_0x2ffb82+=0x1){_0x5d57c7=_0x2dacb8[_0x2ffb82],_[_0x19f83b(0x147)](_0x23e453[_0x19f83b(0x145)][util['format'](_0x19f83b(0x17d),_0x5d57c7[_0x19f83b(0x17a)])])?_0x23e453[_0x19f83b(0x145)][util['format'](_0x19f83b(0x17d),_0x5d57c7[_0x19f83b(0x17a)])]=new Telephone(_0x5d57c7):_0x23e453[_0x19f83b(0x16d)](_0x23e453[_0x19f83b(0x145)][util['format'](_0x19f83b(0x17d),_0x5d57c7[_0x19f83b(0x17a)])],_0x5d57c7);}}return _0x23e453[_0x19f83b(0x145)];};},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x18e)]=function(){const _0x160bce=this;return function(_0xcd11f){const _0x3230f6=a1256_0x42a0;if(_0xcd11f){freeIsNotKeySip(_0xcd11f,_0x160bce[_0x3230f6(0x19b)]);for(let _0x36da10=0x0,_0x570743={};_0x36da10<_0xcd11f[_0x3230f6(0x169)];_0x36da10+=0x1){_0x570743=_0xcd11f[_0x36da10],_['isUndefined'](_0x160bce['trunks'][util[_0x3230f6(0x14b)](_0x3230f6(0x17d),_0x570743[_0x3230f6(0x17a)])])?_0x160bce['trunks'][util[_0x3230f6(0x14b)](_0x3230f6(0x17d),_0x570743['name'])]=new Trunk(_0x570743):_0x160bce['mergeFromDatabase'](_0x160bce[_0x3230f6(0x19b)][util[_0x3230f6(0x14b)](_0x3230f6(0x17d),_0x570743[_0x3230f6(0x17a)])],_0x570743);}}return _0x160bce[_0x3230f6(0x19b)];};},Realtime[a1256_0x1f5251(0x189)]['initVoiceQueues']=function(){const _0x12157d=this;return function(_0x40b52b){const _0x5f01a5=a1256_0x42a0;if(_0x40b52b){freeIsNotKey(_0x40b52b,_0x12157d[_0x5f01a5(0x170)],_0x5f01a5(0x17a));for(let _0xfc5710=0x0,_0x13458b={};_0xfc5710<_0x40b52b[_0x5f01a5(0x169)];_0xfc5710+=0x1){_0x13458b=_0x40b52b[_0xfc5710],_[_0x5f01a5(0x147)](_0x12157d[_0x5f01a5(0x170)][_0x13458b['name']])?_0x12157d[_0x5f01a5(0x170)][_0x13458b['name']]=new VoiceQueue(_0x13458b):_0x12157d[_0x5f01a5(0x16d)](_0x12157d['voiceQueues'][_0x13458b[_0x5f01a5(0x17a)]],_0x13458b);}}return _0x12157d['voiceQueues'];};},Realtime[a1256_0x1f5251(0x189)]['initTriggers']=function(){const _0x5ecb74=this;return function(_0x428736){const _0x54869b=a1256_0x42a0;if(_0x428736){freeIsNotKey(_0x428736,_0x5ecb74[_0x54869b(0x152)],'id');for(let _0x3f5f01=0x0,_0x3c27ec={};_0x3f5f01<_0x428736[_0x54869b(0x169)];_0x3f5f01+=0x1){_0x3c27ec=_0x428736[_0x3f5f01],_['isUndefined'](_0x5ecb74[_0x54869b(0x152)][_0x3c27ec['id']])?_0x5ecb74[_0x54869b(0x152)][_0x3c27ec['id']]=new Trigger(_0x3c27ec):_0x5ecb74[_0x54869b(0x16d)](_0x5ecb74[_0x54869b(0x152)][_0x3c27ec['id']],_0x3c27ec);}}return _0x5ecb74[_0x54869b(0x152)];};},Realtime['prototype'][a1256_0x1f5251(0x16f)]=function(){const _0x5e616f=this;return function(_0x2d3492){const _0x33d86e=a1256_0x42a0;if(_0x2d3492){freeIsNotKey(_0x2d3492,_0x5e616f['templates'],'id');for(let _0x58c861=0x0,_0x47a4cd={};_0x58c861<_0x2d3492[_0x33d86e(0x169)];_0x58c861+=0x1){_0x47a4cd=_0x2d3492[_0x58c861],_[_0x33d86e(0x147)](_0x5e616f[_0x33d86e(0x13a)][_0x47a4cd['id']])?_0x5e616f['templates'][_0x47a4cd['id']]=new Template(_0x47a4cd):_0x5e616f[_0x33d86e(0x16d)](_0x5e616f[_0x33d86e(0x13a)][_0x47a4cd['id']],_0x47a4cd);}}return _0x5e616f['templates'];};},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x17b)]=function(){const _0x40e719=this;return function(_0x307156){const _0x13af1c=a1256_0x42a0;if(_0x307156){freeIsNotKey(_0x307156,_0x40e719[_0x13af1c(0x19a)],'id');for(let _0x41cc05=0x0,_0x2fa4f1={};_0x41cc05<_0x307156[_0x13af1c(0x169)];_0x41cc05+=0x1){_0x2fa4f1=_0x307156[_0x41cc05],_[_0x13af1c(0x147)](_0x40e719[_0x13af1c(0x19a)][_0x2fa4f1['id']])?_0x40e719[_0x13af1c(0x19a)][_0x2fa4f1['id']]=new ZendeskAccount(_0x2fa4f1):_0x40e719[_0x13af1c(0x16d)](_0x40e719[_0x13af1c(0x19a)][_0x2fa4f1['id']],_0x2fa4f1);}}return _0x40e719[_0x13af1c(0x19a)];};},Realtime['prototype']['initSalesforceAccounts']=function(){const _0x2703fd=this;return function(_0x16a0f8){const _0x3b920d=a1256_0x42a0;if(_0x16a0f8){freeIsNotKey(_0x16a0f8,_0x2703fd[_0x3b920d(0x195)],'id');for(let _0x2444bc=0x0,_0x37b5f2={};_0x2444bc<_0x16a0f8[_0x3b920d(0x169)];_0x2444bc+=0x1){_0x37b5f2=_0x16a0f8[_0x2444bc],_[_0x3b920d(0x147)](_0x2703fd[_0x3b920d(0x195)][_0x37b5f2['id']])?_0x2703fd['salesforceAccounts'][_0x37b5f2['id']]=new SalesforceAccount(_0x37b5f2):_0x2703fd[_0x3b920d(0x16d)](_0x2703fd['salesforceAccounts'][_0x37b5f2['id']],_0x37b5f2);}}return _0x2703fd[_0x3b920d(0x195)];};},Realtime[a1256_0x1f5251(0x189)]['initFreshdeskAccounts']=function(){const _0x31166e=this;return function(_0x1e8022){const _0x5900e9=a1256_0x42a0;if(_0x1e8022){freeIsNotKey(_0x1e8022,_0x31166e[_0x5900e9(0x141)],'id');for(let _0x24d3ed=0x0,_0x428944={};_0x24d3ed<_0x1e8022[_0x5900e9(0x169)];_0x24d3ed+=0x1){_0x428944=_0x1e8022[_0x24d3ed],_[_0x5900e9(0x147)](_0x31166e[_0x5900e9(0x141)][_0x428944['id']])?_0x31166e[_0x5900e9(0x141)][_0x428944['id']]=new FreshdeskAccount(_0x428944):_0x31166e['mergeFromDatabase'](_0x31166e[_0x5900e9(0x141)][_0x428944['id']],_0x428944);}}return _0x31166e[_0x5900e9(0x141)];};},Realtime[a1256_0x1f5251(0x189)]['initZohoAccounts']=function(){const _0x563a6d=this;return function(_0x592771){const _0x717424=a1256_0x42a0;if(_0x592771){freeIsNotKey(_0x592771,_0x563a6d[_0x717424(0x193)],'id');for(let _0x35bda4=0x0,_0x464d31={};_0x35bda4<_0x592771[_0x717424(0x169)];_0x35bda4+=0x1){_0x464d31=_0x592771[_0x35bda4],_[_0x717424(0x147)](_0x563a6d[_0x717424(0x193)][_0x464d31['id']])?_0x563a6d[_0x717424(0x193)][_0x464d31['id']]=new ZohoAccount(_0x464d31):_0x563a6d[_0x717424(0x16d)](_0x563a6d[_0x717424(0x193)][_0x464d31['id']],_0x464d31);}}return _0x563a6d[_0x717424(0x193)];};},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x16b)]=function(){const _0x198a03=this;return function(_0x4ab551){const _0x12b61b=a1256_0x42a0;if(_0x4ab551){freeIsNotKey(_0x4ab551,_0x198a03[_0x12b61b(0x153)],'id');for(let _0x539c9b=0x0,_0x28d9a0={};_0x539c9b<_0x4ab551[_0x12b61b(0x169)];_0x539c9b+=0x1){_0x28d9a0=_0x4ab551[_0x539c9b],_[_0x12b61b(0x147)](_0x198a03[_0x12b61b(0x153)][_0x28d9a0['id']])?_0x198a03[_0x12b61b(0x153)][_0x28d9a0['id']]=new DeskAccount(_0x28d9a0):_0x198a03[_0x12b61b(0x16d)](_0x198a03['deskAccounts'][_0x28d9a0['id']],_0x28d9a0);}}return _0x198a03[_0x12b61b(0x153)];};},Realtime['prototype'][a1256_0x1f5251(0x148)]=function(){const _0x217899=this;return function(_0x45419e){const _0x4240f3=a1256_0x42a0;if(_0x45419e){freeIsNotKey(_0x45419e,_0x217899[_0x4240f3(0x18d)],'id');for(let _0x221fcc=0x0,_0x4019bf={};_0x221fcc<_0x45419e['length'];_0x221fcc+=0x1){_0x4019bf=_0x45419e[_0x221fcc],_[_0x4240f3(0x147)](_0x217899[_0x4240f3(0x18d)][_0x4019bf['id']])?_0x217899[_0x4240f3(0x18d)][_0x4019bf['id']]=new SugarcrmAccount(_0x4019bf):_0x217899[_0x4240f3(0x16d)](_0x217899[_0x4240f3(0x18d)][_0x4019bf['id']],_0x4019bf);}}return _0x217899[_0x4240f3(0x18d)];};},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x179)]=function(){const _0x5a3076=this;return function(_0x41ad77){const _0x3269ef=a1256_0x42a0;if(_0x41ad77){freeIsNotKey(_0x41ad77,_0x5a3076['vtigerAccounts'],'id');for(let _0x4a1579=0x0,_0x88b70f={};_0x4a1579<_0x41ad77[_0x3269ef(0x169)];_0x4a1579+=0x1){_0x88b70f=_0x41ad77[_0x4a1579],_[_0x3269ef(0x147)](_0x5a3076['vtigerAccounts'][_0x88b70f['id']])?_0x5a3076[_0x3269ef(0x198)][_0x88b70f['id']]=new VtigerAccount(_0x88b70f):_0x5a3076[_0x3269ef(0x16d)](_0x5a3076[_0x3269ef(0x198)][_0x88b70f['id']],_0x88b70f);}}return _0x5a3076[_0x3269ef(0x198)];};},Realtime[a1256_0x1f5251(0x189)]['initServicenowAccounts']=function(){const _0x289aa8=this;return function(_0x27d407){const _0x538e39=a1256_0x42a0;if(_0x27d407){freeIsNotKey(_0x27d407,_0x289aa8[_0x538e39(0x17c)],'id');for(let _0x287d30=0x0,_0x52b9b8={};_0x287d30<_0x27d407[_0x538e39(0x169)];_0x287d30+=0x1){_0x52b9b8=_0x27d407[_0x287d30],_['isUndefined'](_0x289aa8['servicenowAccounts'][_0x52b9b8['id']])?_0x289aa8[_0x538e39(0x17c)][_0x52b9b8['id']]=new ServicenowAccount(_0x52b9b8):_0x289aa8['mergeFromDatabase'](_0x289aa8[_0x538e39(0x17c)][_0x52b9b8['id']],_0x52b9b8);}}return _0x289aa8[_0x538e39(0x17c)];};},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x191)]=function(){const _0x1b0684=this;return function(_0x33de98){const _0x6f13f2=a1256_0x42a0;if(_0x33de98){freeIsNotKey(_0x33de98,_0x1b0684['dynamics365Accounts'],'id');for(let _0x592e55=0x0,_0x4f3925={};_0x592e55<_0x33de98[_0x6f13f2(0x169)];_0x592e55+=0x1){_0x4f3925=_0x33de98[_0x592e55],_['isUndefined'](_0x1b0684[_0x6f13f2(0x184)][_0x4f3925['id']])?_0x1b0684[_0x6f13f2(0x184)][_0x4f3925['id']]=new Dynamics365Account(_0x4f3925):_0x1b0684['mergeFromDatabase'](_0x1b0684[_0x6f13f2(0x184)][_0x4f3925['id']],_0x4f3925);}}return _0x1b0684['dynamics365Accounts'];};},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x188)]=function(){const _0x326c17=this;return function(_0x360108){const _0x793d4d=a1256_0x42a0;if(_0x360108){freeIsNotKey(_0x360108,_0x326c17['freshsalesAccounts'],'id');for(let _0x4f79a7=0x0,_0x30dbe5={};_0x4f79a7<_0x360108[_0x793d4d(0x169)];_0x4f79a7+=0x1){_0x30dbe5=_0x360108[_0x4f79a7],_[_0x793d4d(0x147)](_0x326c17[_0x793d4d(0x165)][_0x30dbe5['id']])?_0x326c17['freshsalesAccounts'][_0x30dbe5['id']]=new FreshsalesAccount(_0x30dbe5):_0x326c17['mergeFromDatabase'](_0x326c17['freshsalesAccounts'][_0x30dbe5['id']],_0x30dbe5);}}return _0x326c17[_0x793d4d(0x165)];};},Realtime['prototype']['initVoiceQueueHopperHistory']=function(){const _0x534e69=this;return function(_0x5a4173){const _0x19866a=a1256_0x42a0;for(let _0x4b888b=0x0;_0x4b888b<_0x5a4173[_0x19866a(0x169)];_0x4b888b+=0x1){_[_0x19866a(0x14f)](_0x534e69[_0x19866a(0x170)][_0x5a4173[_0x4b888b]['name']],_0x5a4173[_0x4b888b]);}return _0x534e69[_0x19866a(0x170)];};},Realtime[a1256_0x1f5251(0x189)]['initVoiceQueueReports']=function(){const _0x21608b=this;return function(_0x4f6457){const _0xec8bf8=a1256_0x42a0;clearVoiceQueues(_0x21608b[_0xec8bf8(0x170)]);if(_0x4f6457){_0x4f6457=_[_0xec8bf8(0x133)](_0x4f6457,_0xec8bf8(0x185));for(const _0x11a79f in _0x4f6457){if(typeof _0x4f6457[_0x11a79f]!==_0xec8bf8(0x15f))for(let _0x536d5f=0x0;_0x536d5f<_0x4f6457[_0x11a79f][_0xec8bf8(0x169)];_0x536d5f+=0x1){const _0x474e79=_0x4f6457[_0x11a79f][_0x536d5f]['queue'];_0x21608b[_0xec8bf8(0x170)][_0x474e79]&&(_0x4f6457[_0x11a79f][_0x536d5f][_0xec8bf8(0x14d)]&&(_0x21608b[_0xec8bf8(0x170)][_0x474e79][_0xec8bf8(0x14e)]+=0x1),_0x4f6457[_0x11a79f][_0x536d5f]['queuecallerabandon']&&(_0x21608b['voiceQueues'][_0x474e79][_0xec8bf8(0x177)]+=0x1),_0x21608b[_0xec8bf8(0x170)][_0x474e79][_0xec8bf8(0x187)]+=moment(_0x4f6457[_0x11a79f][_0x536d5f][_0xec8bf8(0x15a)])[_0xec8bf8(0x159)](moment(_0x4f6457[_0x11a79f][_0x536d5f][_0xec8bf8(0x13d)]),'seconds')||0x0,_0x536d5f===_0x4f6457[_0x11a79f][_0xec8bf8(0x169)]-0x1?(_0x21608b[_0xec8bf8(0x170)][_0x474e79]['sumDuration']+=moment(_0x4f6457[_0x11a79f][_0x536d5f][_0xec8bf8(0x178)]||_0x4f6457[_0x11a79f][_0x536d5f][_0xec8bf8(0x143)]||_0x4f6457[_0x11a79f][_0x536d5f]['queuecallerexitAt'])[_0xec8bf8(0x159)](moment(_0x4f6457[_0x11a79f][_0x536d5f][_0xec8bf8(0x13d)]),_0xec8bf8(0x174))||0x0,_0x21608b['voiceQueues'][_0x474e79][_0xec8bf8(0x14a)]+=0x1,_0x4f6457[_0x11a79f][_0x536d5f][_0xec8bf8(0x199)]&&(_0x21608b[_0xec8bf8(0x170)][_0x474e79][_0xec8bf8(0x18c)]+=0x1,_0x21608b['voiceQueues'][_0x474e79][_0xec8bf8(0x18f)]+=moment(_0x4f6457[_0x11a79f][_0x536d5f][_0xec8bf8(0x178)])[_0xec8bf8(0x159)](moment(_0x4f6457[_0x11a79f][_0x536d5f][_0xec8bf8(0x15a)]),_0xec8bf8(0x174))||0x0)):_0x21608b[_0xec8bf8(0x170)][_0x474e79][_0xec8bf8(0x186)]+=_0x21608b['voiceQueues'][_0x474e79][_0xec8bf8(0x187)]||0x0);}}}return _0x21608b[_0xec8bf8(0x170)];};},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x182)]=function(){const _0x1168a5=this;return function(_0x5e3c81){const _0x233c34=a1256_0x42a0;clearVoiceCallReports(_0x1168a5[_0x233c34(0x144)]);if(_0x5e3c81)for(let _0x379a64=0x0;_0x379a64<_0x5e3c81[_0x233c34(0x169)];_0x379a64+=0x1){_0x1168a5['outbound'][_0x233c34(0x14a)]+=0x1,_0x1168a5[_0x233c34(0x144)][_0x233c34(0x186)]+=_0x5e3c81[_0x379a64][_0x233c34(0x13b)],_0x5e3c81[_0x379a64][_0x233c34(0x166)]===_0x233c34(0x13c)&&(_0x1168a5['outbound'][_0x233c34(0x18c)]+=0x1,_0x1168a5[_0x233c34(0x144)][_0x233c34(0x187)]+=_0x5e3c81[_0x379a64][_0x233c34(0x13b)]-_0x5e3c81[_0x379a64][_0x233c34(0x171)]||0x0,_0x1168a5['outbound']['sumBillable']+=_0x5e3c81[_0x379a64][_0x233c34(0x171)]);}return _0x1168a5[_0x233c34(0x144)];};},Realtime['prototype'][a1256_0x1f5251(0x168)]=function(){const _0x250d96=this;return function(_0x5dc4fe){const _0x21e3f8=a1256_0x42a0;if(_0x5dc4fe){freeIsNotKey(_0x5dc4fe,_0x250d96[_0x21e3f8(0x146)],_0x21e3f8(0x17a));for(let _0x379af5=0x0,_0x1907cc={};_0x379af5<_0x5dc4fe['length'];_0x379af5+=0x1){_0x1907cc=_0x5dc4fe[_0x379af5],_['isUndefined'](_0x250d96[_0x21e3f8(0x146)][_0x1907cc[_0x21e3f8(0x17a)]])?_0x250d96['campaigns'][_0x1907cc[_0x21e3f8(0x17a)]]=new Campaign(_0x1907cc):(_0x250d96[_0x21e3f8(0x16d)](_0x250d96[_0x21e3f8(0x146)][_0x1907cc[_0x21e3f8(0x17a)]],_0x1907cc),_0x250d96[_0x21e3f8(0x146)][_0x1907cc[_0x21e3f8(0x17a)]][_0x21e3f8(0x140)]=_0x1907cc[_0x21e3f8(0x16a)]?_0x1907cc[_0x21e3f8(0x16a)][_0x21e3f8(0x17a)]:undefined);}}return _0x250d96['campaigns'];};},Realtime['prototype']['initVoiceExtensions']=function(){const _0x2d7e44=this;return function(_0x1a457b){const _0x6f0867=a1256_0x42a0;if(_0x1a457b){freeIsNotKey(_0x1a457b,_0x2d7e44[_0x6f0867(0x157)],'id');for(let _0x7c47c8=0x0,_0x5d2f9f={};_0x7c47c8<_0x1a457b['length'];_0x7c47c8+=0x1){_0x5d2f9f=_0x1a457b[_0x7c47c8],_[_0x6f0867(0x147)](_0x2d7e44[_0x6f0867(0x157)][_0x5d2f9f['id']])?_0x2d7e44['voiceExtensions'][_0x5d2f9f['id']]=new VoiceExtension(_0x5d2f9f):_0x2d7e44['mergeFromDatabase'](_0x2d7e44[_0x6f0867(0x157)][_0x5d2f9f['id']],_0x5d2f9f);}}return _0x2d7e44[_0x6f0867(0x157)];};},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x142)]=function(){const _0x5aae24=this;return function(_0x1a47ab){const _0x3347ff=a1256_0x42a0;clearCampaigns(_0x5aae24[_0x3347ff(0x146)]);for(let _0x3c8b81=0x0;_0x3c8b81<_0x1a47ab[_0x3347ff(0x169)];_0x3c8b81+=0x1){_[_0x3347ff(0x14f)](_0x5aae24[_0x3347ff(0x146)][_0x1a47ab[_0x3c8b81][_0x3347ff(0x17a)]],_0x1a47ab[_0x3c8b81]);}return _0x5aae24[_0x3347ff(0x146)];};},Realtime[a1256_0x1f5251(0x189)][a1256_0x1f5251(0x18b)]=function(){const _0x85f307=this;return function(_0x54fe4d){const _0x57f242=a1256_0x42a0;if(_0x54fe4d){freeIsNotKey(_0x54fe4d,_0x85f307['faxAccounts'],'id');for(let _0x33fe68=0x0,_0x9d9d08={};_0x33fe68<_0x54fe4d['length'];_0x33fe68+=0x1){_0x9d9d08=_0x54fe4d[_0x33fe68],_[_0x57f242(0x147)](_0x85f307[_0x57f242(0x175)][_0x9d9d08['id']])?_0x85f307['faxAccounts'][_0x9d9d08['id']]=new FaxAccount(_0x9d9d08):_0x85f307['mergeFromDatabase'](_0x85f307['faxAccounts'][_0x9d9d08['id']],_0x9d9d08);}}return _0x85f307[_0x57f242(0x175)];};},module[a1256_0x1f5251(0x138)]=Realtime;
\ No newline at end of file
+const a1260_0x11c3=['undefined','trunks','outboundNoSuchCallsDay','timers','queuecallerabandon','initServicenowAccounts','merge','isNil','dynamics365Accounts','../model/template','outboundDropCallsDayCallersExit','isEmpty','../model/servicenowAccount','deskAccounts','name','zendeskAccounts','freshsalesAccounts','../model/freshdeskAccount','unmanaged','../model/zendeskAccount','mergeFromDatabase','outboundDropCallsDayTimeout','exports','salesforceAccounts','length','initDynamics365Accounts','initTrunks','duration','../model/campaign','initTriggers','SquareProject','queuecallerexit','initFreshsalesAccounts','mapKeys','../model/trigger','../model/agent','initCampaignHopperHistory','queuecallercomplete','queueStatusComplete','faxAccounts','outboundAnswerAgiCallsDay','initFreshdeskAccounts','queuecallerjoinAt','voiceQueues','sumHoldTime','seconds','interface','total','campaigns','moment','../model/sugarcrmAccount','queueChannels','initAgents','templates','outboundChannels','servicenowAccounts','outboundAnswerCallsDay','freshdeskAccounts','agents','ivrAnswerCallsDay','initVoiceQueueReports','SIP/%s','initTelephones','isUndefined','sugarcrmAccounts','sumDuration','disposition','zohoAccounts','initSalesforceAccounts','outboundRejectCallsDay','outboundNoAnswerCallsDay','queuecallercompleteAt','abandoned','prototype','format','../model/voiceQueue','initVoiceCallReports','outbound','ANSWERED','../model/deskAccount','outboundOriginateFailureCallsDay','telephones','outboundBusyCallsDay','../model/faxAccount','queuecallerexitAt','initTemplates','../model/trunk','util','sumBillable','answered','diff','queue','voiceExtensions','triggers','initVoiceExtensions','queuecallerleaveAt','ivrTotalCallsDays','uniqueid','initVtigerAccounts','vtigerAccounts','../model/zohoAccount','lodash','../model/vtigerAccount','billableseconds'];(function(_0x218be0,_0x4cc377){const _0x11c3d5=function(_0x4aa310){while(--_0x4aa310){_0x218be0['push'](_0x218be0['shift']());}};_0x11c3d5(++_0x4cc377);}(a1260_0x11c3,0x1c5));const a1260_0x4aa3=function(_0x218be0,_0x4cc377){_0x218be0=_0x218be0-0x83;let _0x11c3d5=a1260_0x11c3[_0x218be0];return _0x11c3d5;};const a1260_0x3bc44c=a1260_0x4aa3;'use strict';const util=require(a1260_0x3bc44c(0xb5)),_=require(a1260_0x3bc44c(0xc3)),moment=require(a1260_0x3bc44c(0x8f)),Agent=require(a1260_0x3bc44c(0xe9)),Telephone=require('../model/telephone'),Trunk=require(a1260_0x3bc44c(0xb4)),VoiceQueue=require(a1260_0x3bc44c(0xa9)),Trigger=require(a1260_0x3bc44c(0xe8)),Template=require(a1260_0x3bc44c(0xcf)),Campaign=require(a1260_0x3bc44c(0xe2)),VoiceExtension=require('../model/voiceExtension'),ZendeskAccount=require(a1260_0x3bc44c(0xd9)),SalesforceAccount=require('../model/salesforceAccount'),FreshdeskAccount=require(a1260_0x3bc44c(0xd7)),SugarcrmAccount=require(a1260_0x3bc44c(0x90)),ZohoAccount=require(a1260_0x3bc44c(0xc2)),DeskAccount=require(a1260_0x3bc44c(0xad)),VtigerAccount=require(a1260_0x3bc44c(0xc4)),ServicenowAccount=require(a1260_0x3bc44c(0xd2)),Dynamics365Account=require('../model/dynamics365Account'),FreshsalesAccount=require('../model/freshsalesAccount'),FaxAccount=require(a1260_0x3bc44c(0xb1)),Realtime=function(){const _0x3b46c6=a1260_0x3bc44c;this[_0x3b46c6(0x98)]={},this[_0x3b46c6(0xaf)]={},this[_0x3b46c6(0xc7)]={},this[_0x3b46c6(0x89)]={},this[_0x3b46c6(0xbb)]={},this[_0x3b46c6(0x8e)]={},this['templates']={},this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0},this[_0x3b46c6(0xba)]={},this['channels']={},this[_0x3b46c6(0x91)]={},this[_0x3b46c6(0x94)]={},this[_0x3b46c6(0xc9)]={},this[_0x3b46c6(0xd5)]={},this['salesforceAccounts']={},this['sugarcrmAccounts']={},this[_0x3b46c6(0x97)]={},this['zohoAccounts']={},this[_0x3b46c6(0xd3)]={},this[_0x3b46c6(0xc1)]={},this[_0x3b46c6(0x95)]={},this[_0x3b46c6(0xce)]={},this[_0x3b46c6(0xd6)]={},this[_0x3b46c6(0x85)]={};};function freeIsNotKey(_0x3cfabe,_0x4c97fd,_0x2f67c1){const _0x48732c=a1260_0x3bc44c,_0x4b107f=_[_0x48732c(0xe7)](_0x3cfabe,function(_0x35311a){return _0x35311a[_0x2f67c1];});for(const _0x1ea92d in _0x4c97fd){typeof _0x4c97fd[_0x1ea92d]!==_0x48732c(0xc6)&&(!_0x4b107f[_0x1ea92d]&&delete _0x4c97fd[_0x1ea92d]);}}function freeIsNotKeySip(_0x25eb94,_0x34fd1c){const _0xb551af=a1260_0x3bc44c,_0xc50652=_[_0xb551af(0xe7)](_0x25eb94,function(_0x4cc35a){const _0x1dca05=_0xb551af;return util[_0x1dca05(0xa8)](_0x1dca05(0x9b),_0x4cc35a[_0x1dca05(0xd4)]);});for(const _0x4ff9e7 in _0x34fd1c){typeof _0x34fd1c[_0x4ff9e7]!==_0xb551af(0xc6)&&(!_0xc50652[_0x4ff9e7]&&delete _0x34fd1c[_0x4ff9e7]);}}function freeIsNotKeyAgent(_0x1d0b9b,_0x52c69f){const _0x14ec2c=_['mapKeys'](_0x1d0b9b,function(_0xd44539){const _0x5180d5=a1260_0x4aa3,_0x362e06=_[_0x5180d5(0xcd)](_0xd44539[_0x5180d5(0x8c)])?util[_0x5180d5(0xa8)](_0x5180d5(0x9b),_0xd44539[_0x5180d5(0xd4)]):_0xd44539['interface'];return _0x362e06;});for(const _0x52cf49 in _0x52c69f){typeof _0x52c69f[_0x52cf49]!=='undefined'&&(!_0x14ec2c[_0x52cf49]&&delete _0x52c69f[_0x52cf49]);}}function clearVoiceCallReports(_0x4dd53e){const _0x26b6d2=a1260_0x3bc44c;_0x4dd53e['total']=0x0,_0x4dd53e[_0x26b6d2(0xb7)]=0x0,_0x4dd53e[_0x26b6d2(0x8a)]=0x0,_0x4dd53e[_0x26b6d2(0x9f)]=0x0,_0x4dd53e[_0x26b6d2(0xb6)]=0x0;}function clearCampaigns(_0x5992b2){const _0x328c23=a1260_0x3bc44c;if(!_[_0x328c23(0xd1)](_0x5992b2))for(const _0x2ae8f7 in _0x5992b2){typeof _0x5992b2[_0x2ae8f7]!==_0x328c23(0xc6)&&(_0x5992b2[_0x2ae8f7][_0x328c23(0xbe)]=0x0,_0x5992b2[_0x2ae8f7][_0x328c23(0x99)]=0x0);}}function clearVoiceQueues(_0x19c77f){const _0x431e87=a1260_0x3bc44c;if(!_[_0x431e87(0xd1)](_0x19c77f))for(const _0x2408c5 in _0x19c77f){typeof _0x19c77f[_0x2408c5]!==_0x431e87(0xc6)&&(_0x19c77f[_0x2408c5][_0x431e87(0x8d)]=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xb7)]=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xd8)]=0x0,_0x19c77f[_0x2408c5]['abandoned']=0x0,_0x19c77f[_0x2408c5][_0x431e87(0x8a)]=0x0,_0x19c77f[_0x2408c5]['sumDuration']=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xb6)]=0x0,_0x19c77f[_0x2408c5][_0x431e87(0x86)]=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xa4)]=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xb0)]=0x0,_0x19c77f[_0x2408c5]['outboundCongestionCallsDay']=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xc8)]=0x0,_0x19c77f[_0x2408c5]['outboundUnknownCallsDay']=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xdb)]=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xd0)]=0x0,_0x19c77f[_0x2408c5]['outboundBlacklistCallsDay']=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xae)]=0x0,_0x19c77f[_0x2408c5][_0x431e87(0xa3)]=0x0,_0x19c77f[_0x2408c5]['outboundReCallsDay']=0x0,_0x19c77f[_0x2408c5][_0x431e87(0x86)]=0x0,_0x19c77f[_0x2408c5][_0x431e87(0x96)]=0x0,_0x19c77f[_0x2408c5][_0x431e87(0x84)]=!![]);}}Realtime[a1260_0x3bc44c(0xa7)]['mergeFromDatabase']=function(_0x57d6ae,_0x5f0937){for(const _0x950934 in _0x5f0937){typeof _0x57d6ae[_0x950934]!=='undefined'&&(_0x57d6ae[_0x950934]=_0x5f0937[_0x950934]);}},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0x92)]=function(){const _0x5c719b=this;return function(_0x2a0adc){const _0x3d0cba=a1260_0x4aa3;if(_0x2a0adc){freeIsNotKeyAgent(_0x2a0adc,_0x5c719b['agents']);for(let _0x552d31=0x0,_0xb5d23a={};_0x552d31<_0x2a0adc[_0x3d0cba(0xde)];_0x552d31+=0x1){_0xb5d23a=_0x2a0adc[_0x552d31];const _0x40979b=_[_0x3d0cba(0xcd)](_0xb5d23a[_0x3d0cba(0x8c)])?util[_0x3d0cba(0xa8)]('SIP/%s',_0xb5d23a[_0x3d0cba(0xd4)]):_0xb5d23a[_0x3d0cba(0x8c)];_[_0x3d0cba(0x9d)](_0x5c719b['agents'][_0x40979b])?_0x5c719b[_0x3d0cba(0x98)][_0x40979b]=new Agent(_0xb5d23a):_0x5c719b[_0x3d0cba(0xda)](_0x5c719b[_0x3d0cba(0x98)][_0x40979b],_0xb5d23a);}}return _0x5c719b[_0x3d0cba(0x98)];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0x9c)]=function(){const _0x5d3c7d=this;return function(_0x435acb){const _0x3fc259=a1260_0x4aa3;if(_0x435acb){freeIsNotKeySip(_0x435acb,_0x5d3c7d[_0x3fc259(0xaf)]);for(let _0x2aa7e3=0x0,_0x395eac={};_0x2aa7e3<_0x435acb['length'];_0x2aa7e3+=0x1){_0x395eac=_0x435acb[_0x2aa7e3],_[_0x3fc259(0x9d)](_0x5d3c7d[_0x3fc259(0xaf)][util[_0x3fc259(0xa8)](_0x3fc259(0x9b),_0x395eac[_0x3fc259(0xd4)])])?_0x5d3c7d[_0x3fc259(0xaf)][util[_0x3fc259(0xa8)]('SIP/%s',_0x395eac[_0x3fc259(0xd4)])]=new Telephone(_0x395eac):_0x5d3c7d[_0x3fc259(0xda)](_0x5d3c7d[_0x3fc259(0xaf)][util[_0x3fc259(0xa8)](_0x3fc259(0x9b),_0x395eac[_0x3fc259(0xd4)])],_0x395eac);}}return _0x5d3c7d[_0x3fc259(0xaf)];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0xe0)]=function(){const _0x485df7=this;return function(_0x5ba946){const _0x35995d=a1260_0x4aa3;if(_0x5ba946){freeIsNotKeySip(_0x5ba946,_0x485df7[_0x35995d(0xc7)]);for(let _0x5de708=0x0,_0x2a336e={};_0x5de708<_0x5ba946['length'];_0x5de708+=0x1){_0x2a336e=_0x5ba946[_0x5de708],_[_0x35995d(0x9d)](_0x485df7[_0x35995d(0xc7)][util['format'](_0x35995d(0x9b),_0x2a336e['name'])])?_0x485df7[_0x35995d(0xc7)][util[_0x35995d(0xa8)](_0x35995d(0x9b),_0x2a336e[_0x35995d(0xd4)])]=new Trunk(_0x2a336e):_0x485df7[_0x35995d(0xda)](_0x485df7['trunks'][util[_0x35995d(0xa8)](_0x35995d(0x9b),_0x2a336e[_0x35995d(0xd4)])],_0x2a336e);}}return _0x485df7['trunks'];};},Realtime['prototype']['initVoiceQueues']=function(){const _0x33365a=this;return function(_0x2d95a5){const _0x45b251=a1260_0x4aa3;if(_0x2d95a5){freeIsNotKey(_0x2d95a5,_0x33365a[_0x45b251(0x89)],'name');for(let _0x1b67c0=0x0,_0x45ce04={};_0x1b67c0<_0x2d95a5[_0x45b251(0xde)];_0x1b67c0+=0x1){_0x45ce04=_0x2d95a5[_0x1b67c0],_[_0x45b251(0x9d)](_0x33365a[_0x45b251(0x89)][_0x45ce04[_0x45b251(0xd4)]])?_0x33365a[_0x45b251(0x89)][_0x45ce04[_0x45b251(0xd4)]]=new VoiceQueue(_0x45ce04):_0x33365a[_0x45b251(0xda)](_0x33365a[_0x45b251(0x89)][_0x45ce04['name']],_0x45ce04);}}return _0x33365a[_0x45b251(0x89)];};},Realtime['prototype'][a1260_0x3bc44c(0xe3)]=function(){const _0x1ec823=this;return function(_0xa435d1){const _0x2bb84f=a1260_0x4aa3;if(_0xa435d1){freeIsNotKey(_0xa435d1,_0x1ec823[_0x2bb84f(0xbb)],'id');for(let _0x3d0bbe=0x0,_0x33242c={};_0x3d0bbe<_0xa435d1[_0x2bb84f(0xde)];_0x3d0bbe+=0x1){_0x33242c=_0xa435d1[_0x3d0bbe],_[_0x2bb84f(0x9d)](_0x1ec823[_0x2bb84f(0xbb)][_0x33242c['id']])?_0x1ec823[_0x2bb84f(0xbb)][_0x33242c['id']]=new Trigger(_0x33242c):_0x1ec823[_0x2bb84f(0xda)](_0x1ec823[_0x2bb84f(0xbb)][_0x33242c['id']],_0x33242c);}}return _0x1ec823[_0x2bb84f(0xbb)];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0xb3)]=function(){const _0x54b41f=this;return function(_0x11cf7f){const _0x24a6f9=a1260_0x4aa3;if(_0x11cf7f){freeIsNotKey(_0x11cf7f,_0x54b41f[_0x24a6f9(0x93)],'id');for(let _0x2a2349=0x0,_0x44ac57={};_0x2a2349<_0x11cf7f[_0x24a6f9(0xde)];_0x2a2349+=0x1){_0x44ac57=_0x11cf7f[_0x2a2349],_[_0x24a6f9(0x9d)](_0x54b41f['templates'][_0x44ac57['id']])?_0x54b41f[_0x24a6f9(0x93)][_0x44ac57['id']]=new Template(_0x44ac57):_0x54b41f[_0x24a6f9(0xda)](_0x54b41f['templates'][_0x44ac57['id']],_0x44ac57);}}return _0x54b41f[_0x24a6f9(0x93)];};},Realtime[a1260_0x3bc44c(0xa7)]['initZendeskAccounts']=function(){const _0x27d779=this;return function(_0x2dbc5e){const _0x4ce237=a1260_0x4aa3;if(_0x2dbc5e){freeIsNotKey(_0x2dbc5e,_0x27d779[_0x4ce237(0xd5)],'id');for(let _0x10055a=0x0,_0x4633f3={};_0x10055a<_0x2dbc5e[_0x4ce237(0xde)];_0x10055a+=0x1){_0x4633f3=_0x2dbc5e[_0x10055a],_[_0x4ce237(0x9d)](_0x27d779[_0x4ce237(0xd5)][_0x4633f3['id']])?_0x27d779[_0x4ce237(0xd5)][_0x4633f3['id']]=new ZendeskAccount(_0x4633f3):_0x27d779[_0x4ce237(0xda)](_0x27d779['zendeskAccounts'][_0x4633f3['id']],_0x4633f3);}}return _0x27d779[_0x4ce237(0xd5)];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0xa2)]=function(){const _0x360ae2=this;return function(_0x16eb16){const _0x4e8ed0=a1260_0x4aa3;if(_0x16eb16){freeIsNotKey(_0x16eb16,_0x360ae2['salesforceAccounts'],'id');for(let _0x5bdd4b=0x0,_0x588d7c={};_0x5bdd4b<_0x16eb16[_0x4e8ed0(0xde)];_0x5bdd4b+=0x1){_0x588d7c=_0x16eb16[_0x5bdd4b],_[_0x4e8ed0(0x9d)](_0x360ae2[_0x4e8ed0(0xdd)][_0x588d7c['id']])?_0x360ae2[_0x4e8ed0(0xdd)][_0x588d7c['id']]=new SalesforceAccount(_0x588d7c):_0x360ae2['mergeFromDatabase'](_0x360ae2[_0x4e8ed0(0xdd)][_0x588d7c['id']],_0x588d7c);}}return _0x360ae2['salesforceAccounts'];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0x87)]=function(){const _0x116c86=this;return function(_0x45533f){const _0x3402b6=a1260_0x4aa3;if(_0x45533f){freeIsNotKey(_0x45533f,_0x116c86[_0x3402b6(0x97)],'id');for(let _0x39f35=0x0,_0x22d4d1={};_0x39f35<_0x45533f['length'];_0x39f35+=0x1){_0x22d4d1=_0x45533f[_0x39f35],_[_0x3402b6(0x9d)](_0x116c86[_0x3402b6(0x97)][_0x22d4d1['id']])?_0x116c86[_0x3402b6(0x97)][_0x22d4d1['id']]=new FreshdeskAccount(_0x22d4d1):_0x116c86[_0x3402b6(0xda)](_0x116c86[_0x3402b6(0x97)][_0x22d4d1['id']],_0x22d4d1);}}return _0x116c86['freshdeskAccounts'];};},Realtime[a1260_0x3bc44c(0xa7)]['initZohoAccounts']=function(){const _0x580e94=this;return function(_0x153473){const _0x35c9da=a1260_0x4aa3;if(_0x153473){freeIsNotKey(_0x153473,_0x580e94[_0x35c9da(0xa1)],'id');for(let _0x4b3546=0x0,_0x29f88c={};_0x4b3546<_0x153473[_0x35c9da(0xde)];_0x4b3546+=0x1){_0x29f88c=_0x153473[_0x4b3546],_[_0x35c9da(0x9d)](_0x580e94['zohoAccounts'][_0x29f88c['id']])?_0x580e94['zohoAccounts'][_0x29f88c['id']]=new ZohoAccount(_0x29f88c):_0x580e94[_0x35c9da(0xda)](_0x580e94['zohoAccounts'][_0x29f88c['id']],_0x29f88c);}}return _0x580e94['zohoAccounts'];};},Realtime[a1260_0x3bc44c(0xa7)]['initDeskAccounts']=function(){const _0x34f5d7=this;return function(_0x4ed642){const _0xfaedbd=a1260_0x4aa3;if(_0x4ed642){freeIsNotKey(_0x4ed642,_0x34f5d7[_0xfaedbd(0xd3)],'id');for(let _0x3d5685=0x0,_0x29e4a2={};_0x3d5685<_0x4ed642[_0xfaedbd(0xde)];_0x3d5685+=0x1){_0x29e4a2=_0x4ed642[_0x3d5685],_[_0xfaedbd(0x9d)](_0x34f5d7['deskAccounts'][_0x29e4a2['id']])?_0x34f5d7[_0xfaedbd(0xd3)][_0x29e4a2['id']]=new DeskAccount(_0x29e4a2):_0x34f5d7[_0xfaedbd(0xda)](_0x34f5d7['deskAccounts'][_0x29e4a2['id']],_0x29e4a2);}}return _0x34f5d7[_0xfaedbd(0xd3)];};},Realtime[a1260_0x3bc44c(0xa7)]['initSugarcrmAccounts']=function(){const _0x813fdf=this;return function(_0x194d78){const _0x2568c7=a1260_0x4aa3;if(_0x194d78){freeIsNotKey(_0x194d78,_0x813fdf['sugarcrmAccounts'],'id');for(let _0x28cb47=0x0,_0x2df7c6={};_0x28cb47<_0x194d78[_0x2568c7(0xde)];_0x28cb47+=0x1){_0x2df7c6=_0x194d78[_0x28cb47],_[_0x2568c7(0x9d)](_0x813fdf['sugarcrmAccounts'][_0x2df7c6['id']])?_0x813fdf['sugarcrmAccounts'][_0x2df7c6['id']]=new SugarcrmAccount(_0x2df7c6):_0x813fdf[_0x2568c7(0xda)](_0x813fdf[_0x2568c7(0x9e)][_0x2df7c6['id']],_0x2df7c6);}}return _0x813fdf[_0x2568c7(0x9e)];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0xc0)]=function(){const _0x2bb61=this;return function(_0x34784d){const _0x34b029=a1260_0x4aa3;if(_0x34784d){freeIsNotKey(_0x34784d,_0x2bb61[_0x34b029(0xc1)],'id');for(let _0x2e5896=0x0,_0x595cb3={};_0x2e5896<_0x34784d[_0x34b029(0xde)];_0x2e5896+=0x1){_0x595cb3=_0x34784d[_0x2e5896],_[_0x34b029(0x9d)](_0x2bb61['vtigerAccounts'][_0x595cb3['id']])?_0x2bb61[_0x34b029(0xc1)][_0x595cb3['id']]=new VtigerAccount(_0x595cb3):_0x2bb61[_0x34b029(0xda)](_0x2bb61[_0x34b029(0xc1)][_0x595cb3['id']],_0x595cb3);}}return _0x2bb61[_0x34b029(0xc1)];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0xcb)]=function(){const _0x2498c0=this;return function(_0x1e022b){const _0x53f715=a1260_0x4aa3;if(_0x1e022b){freeIsNotKey(_0x1e022b,_0x2498c0[_0x53f715(0x95)],'id');for(let _0x2b8932=0x0,_0x3681f2={};_0x2b8932<_0x1e022b[_0x53f715(0xde)];_0x2b8932+=0x1){_0x3681f2=_0x1e022b[_0x2b8932],_['isUndefined'](_0x2498c0[_0x53f715(0x95)][_0x3681f2['id']])?_0x2498c0[_0x53f715(0x95)][_0x3681f2['id']]=new ServicenowAccount(_0x3681f2):_0x2498c0[_0x53f715(0xda)](_0x2498c0[_0x53f715(0x95)][_0x3681f2['id']],_0x3681f2);}}return _0x2498c0[_0x53f715(0x95)];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0xdf)]=function(){const _0x36d793=this;return function(_0xb5b47){const _0x3a102f=a1260_0x4aa3;if(_0xb5b47){freeIsNotKey(_0xb5b47,_0x36d793['dynamics365Accounts'],'id');for(let _0x5f1d30=0x0,_0x1f18b8={};_0x5f1d30<_0xb5b47[_0x3a102f(0xde)];_0x5f1d30+=0x1){_0x1f18b8=_0xb5b47[_0x5f1d30],_['isUndefined'](_0x36d793['dynamics365Accounts'][_0x1f18b8['id']])?_0x36d793['dynamics365Accounts'][_0x1f18b8['id']]=new Dynamics365Account(_0x1f18b8):_0x36d793['mergeFromDatabase'](_0x36d793[_0x3a102f(0xce)][_0x1f18b8['id']],_0x1f18b8);}}return _0x36d793['dynamics365Accounts'];};},Realtime['prototype'][a1260_0x3bc44c(0xe6)]=function(){const _0x4c243e=this;return function(_0xdf2103){const _0x46357c=a1260_0x4aa3;if(_0xdf2103){freeIsNotKey(_0xdf2103,_0x4c243e['freshsalesAccounts'],'id');for(let _0x3fa66e=0x0,_0x3663c5={};_0x3fa66e<_0xdf2103[_0x46357c(0xde)];_0x3fa66e+=0x1){_0x3663c5=_0xdf2103[_0x3fa66e],_[_0x46357c(0x9d)](_0x4c243e[_0x46357c(0xd6)][_0x3663c5['id']])?_0x4c243e[_0x46357c(0xd6)][_0x3663c5['id']]=new FreshsalesAccount(_0x3663c5):_0x4c243e[_0x46357c(0xda)](_0x4c243e[_0x46357c(0xd6)][_0x3663c5['id']],_0x3663c5);}}return _0x4c243e['freshsalesAccounts'];};},Realtime[a1260_0x3bc44c(0xa7)]['initVoiceQueueHopperHistory']=function(){const _0x1380a1=this;return function(_0x57fb43){const _0x2026dd=a1260_0x4aa3;for(let _0x59ad6c=0x0;_0x59ad6c<_0x57fb43['length'];_0x59ad6c+=0x1){_[_0x2026dd(0xcc)](_0x1380a1[_0x2026dd(0x89)][_0x57fb43[_0x59ad6c][_0x2026dd(0xd4)]],_0x57fb43[_0x59ad6c]);}return _0x1380a1[_0x2026dd(0x89)];};},Realtime['prototype'][a1260_0x3bc44c(0x9a)]=function(){const _0x1a4f06=this;return function(_0x4476f3){const _0x307b86=a1260_0x4aa3;clearVoiceQueues(_0x1a4f06['voiceQueues']);if(_0x4476f3){_0x4476f3=_['groupBy'](_0x4476f3,_0x307b86(0xbf));for(const _0x827093 in _0x4476f3){if(typeof _0x4476f3[_0x827093]!==_0x307b86(0xc6))for(let _0x24f8fa=0x0;_0x24f8fa<_0x4476f3[_0x827093]['length'];_0x24f8fa+=0x1){const _0x2ee43c=_0x4476f3[_0x827093][_0x24f8fa][_0x307b86(0xb9)];_0x1a4f06[_0x307b86(0x89)][_0x2ee43c]&&(_0x4476f3[_0x827093][_0x24f8fa][_0x307b86(0xe5)]&&(_0x1a4f06[_0x307b86(0x89)][_0x2ee43c][_0x307b86(0xd8)]+=0x1),_0x4476f3[_0x827093][_0x24f8fa][_0x307b86(0xca)]&&(_0x1a4f06[_0x307b86(0x89)][_0x2ee43c][_0x307b86(0xa6)]+=0x1),_0x1a4f06[_0x307b86(0x89)][_0x2ee43c][_0x307b86(0x8a)]+=moment(_0x4476f3[_0x827093][_0x24f8fa]['queuecallerleaveAt'])[_0x307b86(0xb8)](moment(_0x4476f3[_0x827093][_0x24f8fa][_0x307b86(0x88)]),'seconds')||0x0,_0x24f8fa===_0x4476f3[_0x827093][_0x307b86(0xde)]-0x1?(_0x1a4f06[_0x307b86(0x89)][_0x2ee43c][_0x307b86(0x9f)]+=moment(_0x4476f3[_0x827093][_0x24f8fa][_0x307b86(0xa5)]||_0x4476f3[_0x827093][_0x24f8fa]['queuecallerabandonAt']||_0x4476f3[_0x827093][_0x24f8fa][_0x307b86(0xb2)])['diff'](moment(_0x4476f3[_0x827093][_0x24f8fa][_0x307b86(0x88)]),_0x307b86(0x8b))||0x0,_0x1a4f06[_0x307b86(0x89)][_0x2ee43c][_0x307b86(0x8d)]+=0x1,_0x4476f3[_0x827093][_0x24f8fa][_0x307b86(0x83)]&&(_0x1a4f06['voiceQueues'][_0x2ee43c][_0x307b86(0xb7)]+=0x1,_0x1a4f06[_0x307b86(0x89)][_0x2ee43c][_0x307b86(0xb6)]+=moment(_0x4476f3[_0x827093][_0x24f8fa]['queuecallercompleteAt'])[_0x307b86(0xb8)](moment(_0x4476f3[_0x827093][_0x24f8fa][_0x307b86(0xbd)]),_0x307b86(0x8b))||0x0)):_0x1a4f06[_0x307b86(0x89)][_0x2ee43c][_0x307b86(0x9f)]+=_0x1a4f06[_0x307b86(0x89)][_0x2ee43c][_0x307b86(0x8a)]||0x0);}}}return _0x1a4f06['voiceQueues'];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0xaa)]=function(){const _0x13c563=this;return function(_0x569caa){const _0x4b6865=a1260_0x4aa3;clearVoiceCallReports(_0x13c563[_0x4b6865(0xab)]);if(_0x569caa)for(let _0x67ff57=0x0;_0x67ff57<_0x569caa[_0x4b6865(0xde)];_0x67ff57+=0x1){_0x13c563['outbound']['total']+=0x1,_0x13c563['outbound'][_0x4b6865(0x9f)]+=_0x569caa[_0x67ff57][_0x4b6865(0xe1)],_0x569caa[_0x67ff57][_0x4b6865(0xa0)]===_0x4b6865(0xac)&&(_0x13c563[_0x4b6865(0xab)]['answered']+=0x1,_0x13c563['outbound']['sumHoldTime']+=_0x569caa[_0x67ff57]['duration']-_0x569caa[_0x67ff57][_0x4b6865(0xc5)]||0x0,_0x13c563[_0x4b6865(0xab)][_0x4b6865(0xb6)]+=_0x569caa[_0x67ff57][_0x4b6865(0xc5)]);}return _0x13c563[_0x4b6865(0xab)];};},Realtime[a1260_0x3bc44c(0xa7)]['initCampaigns']=function(){const _0x5858bd=this;return function(_0x2b68ed){const _0x2429df=a1260_0x4aa3;if(_0x2b68ed){freeIsNotKey(_0x2b68ed,_0x5858bd[_0x2429df(0x8e)],_0x2429df(0xd4));for(let _0x4ffaaf=0x0,_0x2da2c4={};_0x4ffaaf<_0x2b68ed['length'];_0x4ffaaf+=0x1){_0x2da2c4=_0x2b68ed[_0x4ffaaf],_[_0x2429df(0x9d)](_0x5858bd[_0x2429df(0x8e)][_0x2da2c4['name']])?_0x5858bd[_0x2429df(0x8e)][_0x2da2c4['name']]=new Campaign(_0x2da2c4):(_0x5858bd[_0x2429df(0xda)](_0x5858bd[_0x2429df(0x8e)][_0x2da2c4['name']],_0x2da2c4),_0x5858bd[_0x2429df(0x8e)][_0x2da2c4[_0x2429df(0xd4)]]['dialQueueProject']=_0x2da2c4[_0x2429df(0xe4)]?_0x2da2c4[_0x2429df(0xe4)]['name']:undefined);}}return _0x5858bd[_0x2429df(0x8e)];};},Realtime['prototype'][a1260_0x3bc44c(0xbc)]=function(){const _0x204e45=this;return function(_0xe1a735){const _0x5277d2=a1260_0x4aa3;if(_0xe1a735){freeIsNotKey(_0xe1a735,_0x204e45[_0x5277d2(0xba)],'id');for(let _0x2711a7=0x0,_0x570f1a={};_0x2711a7<_0xe1a735[_0x5277d2(0xde)];_0x2711a7+=0x1){_0x570f1a=_0xe1a735[_0x2711a7],_['isUndefined'](_0x204e45['voiceExtensions'][_0x570f1a['id']])?_0x204e45[_0x5277d2(0xba)][_0x570f1a['id']]=new VoiceExtension(_0x570f1a):_0x204e45[_0x5277d2(0xda)](_0x204e45['voiceExtensions'][_0x570f1a['id']],_0x570f1a);}}return _0x204e45['voiceExtensions'];};},Realtime[a1260_0x3bc44c(0xa7)][a1260_0x3bc44c(0xea)]=function(){const _0x48bced=this;return function(_0x233bee){const _0x1b4066=a1260_0x4aa3;clearCampaigns(_0x48bced['campaigns']);for(let _0x242c57=0x0;_0x242c57<_0x233bee[_0x1b4066(0xde)];_0x242c57+=0x1){_[_0x1b4066(0xcc)](_0x48bced['campaigns'][_0x233bee[_0x242c57][_0x1b4066(0xd4)]],_0x233bee[_0x242c57]);}return _0x48bced['campaigns'];};},Realtime[a1260_0x3bc44c(0xa7)]['initFaxAccounts']=function(){const _0x23cae1=this;return function(_0x326d7a){const _0x14e933=a1260_0x4aa3;if(_0x326d7a){freeIsNotKey(_0x326d7a,_0x23cae1[_0x14e933(0x85)],'id');for(let _0x313ba1=0x0,_0x47b013={};_0x313ba1<_0x326d7a[_0x14e933(0xde)];_0x313ba1+=0x1){_0x47b013=_0x326d7a[_0x313ba1],_['isUndefined'](_0x23cae1['faxAccounts'][_0x47b013['id']])?_0x23cae1[_0x14e933(0x85)][_0x47b013['id']]=new FaxAccount(_0x47b013):_0x23cae1[_0x14e933(0xda)](_0x23cae1[_0x14e933(0x85)][_0x47b013['id']],_0x47b013);}}return _0x23cae1[_0x14e933(0x85)];};},module[a1260_0x3bc44c(0xdc)]=Realtime;
\ No newline at end of file