1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0x115e=['hasOwnProperty','initMailAccounts','isUndefined','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase'];(function(_0x136201,_0x51d0f0){var _0x410ff0=function(_0x1342e3){while(--_0x1342e3){_0x136201['push'](_0x136201['shift']());}};_0x410ff0(++_0x51d0f0);}(_0x115e,0xa4));var _0xe115=function(_0x2b7ba8,_0x33283b){_0x2b7ba8=_0x2b7ba8-0x0;var _0x470b36=_0x115e[_0x2b7ba8];return _0x470b36;};'use strict';var _=require(_0xe115('0x0'));var MailAccount=require(_0xe115('0x1'));var Realtime=function(){this[_0xe115('0x2')]={};};function freeIsNotKey(_0x5e17d9,_0x127e89,_0x2789e4){var _0xd3ad29=_[_0xe115('0x3')](_0x5e17d9,function(_0x160121,_0x3d04e9){return _0x160121[_0x2789e4];});for(var _0x3ab36e in _0x127e89){if(_0x127e89['hasOwnProperty'](_0x3ab36e)){if(!_0xd3ad29[_0x3ab36e]){delete _0x127e89[_0x3ab36e];}}}}Realtime[_0xe115('0x4')][_0xe115('0x5')]=function(_0xae380f,_0x5dd32c){for(var _0x4560cf in _0x5dd32c){if(_0xae380f[_0xe115('0x6')](_0x4560cf)){_0xae380f[_0x4560cf]=_0x5dd32c[_0x4560cf];}}};Realtime[_0xe115('0x4')][_0xe115('0x7')]=function(){var _0x178726=this;return function(_0x341466){if(_0x341466){freeIsNotKey(_0x341466,_0x178726[_0xe115('0x2')],'id');for(var _0x2a81da=0x0,_0x447b46={},_0x2fbbb4={};_0x2a81da<_0x341466['length'];_0x2a81da+=0x1){_0x447b46=_0x341466[_0x2a81da];if(_[_0xe115('0x8')](_0x178726[_0xe115('0x2')][_0x447b46['id']])){_0x178726[_0xe115('0x2')][_0x447b46['id']]=new MailAccount(_0x447b46);}else{_['merge'](_0x178726['mailAccounts'][_0x447b46['id']],_0x447b46);}}}return _0x178726[_0xe115('0x2')];};};module[_0xe115('0x9')]=Realtime;