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 _0x1d97=['lodash','mailAccounts','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','length','isUndefined','merge','exports'];(function(_0x516770,_0xb9ffc8){var _0x5008f8=function(_0x1a5191){while(--_0x1a5191){_0x516770['push'](_0x516770['shift']());}};_0x5008f8(++_0xb9ffc8);}(_0x1d97,0x155));var _0x71d9=function(_0x19f05f,_0x2c921f){_0x19f05f=_0x19f05f-0x0;var _0x164239=_0x1d97[_0x19f05f];return _0x164239;};'use strict';var _=require(_0x71d9('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x71d9('0x1')]={};};function freeIsNotKey(_0x438696,_0x4e6949,_0x451e33){var _0x421c53=_[_0x71d9('0x2')](_0x438696,function(_0xd4319c,_0x5f0719){return _0xd4319c[_0x451e33];});for(var _0x13d426 in _0x4e6949){if(_0x4e6949['hasOwnProperty'](_0x13d426)){if(!_0x421c53[_0x13d426]){delete _0x4e6949[_0x13d426];}}}}Realtime[_0x71d9('0x3')][_0x71d9('0x4')]=function(_0x3c3210,_0x18f85c){for(var _0x55f5ae in _0x18f85c){if(_0x3c3210[_0x71d9('0x5')](_0x55f5ae)){_0x3c3210[_0x55f5ae]=_0x18f85c[_0x55f5ae];}}};Realtime[_0x71d9('0x3')][_0x71d9('0x6')]=function(){var _0x376e48=this;return function(_0x4a793b){if(_0x4a793b){freeIsNotKey(_0x4a793b,_0x376e48[_0x71d9('0x1')],'id');for(var _0x3380f8=0x0,_0x4941be={},_0x171c79={};_0x3380f8<_0x4a793b[_0x71d9('0x7')];_0x3380f8+=0x1){_0x4941be=_0x4a793b[_0x3380f8];if(_[_0x71d9('0x8')](_0x376e48[_0x71d9('0x1')][_0x4941be['id']])){_0x376e48[_0x71d9('0x1')][_0x4941be['id']]=new MailAccount(_0x4941be);}else{_[_0x71d9('0x9')](_0x376e48[_0x71d9('0x1')][_0x4941be['id']],_0x4941be);}}}return _0x376e48['mailAccounts'];};};module[_0x71d9('0xa')]=Realtime;