2e849f80cf6994589dac3344e66161c503c986a1
[motion2.git] / server / services / email / realtime / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x021e=['merge','exports','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x021e,0xa7));var _0xe021=function(_0x32ed61,_0x4877cb){_0x32ed61=_0x32ed61-0x0;var _0x4312c7=_0x021e[_0x32ed61];return _0x4312c7;};'use strict';var _=require(_0xe021('0x0'));var MailAccount=require(_0xe021('0x1'));var Realtime=function(){this[_0xe021('0x2')]={};};function freeIsNotKey(_0x15ac05,_0x532221,_0x3e668c){var _0x4175f4=_['mapKeys'](_0x15ac05,function(_0x1e3895,_0x4f4054){return _0x1e3895[_0x3e668c];});for(var _0xa4135c in _0x532221){if(_0x532221[_0xe021('0x3')](_0xa4135c)){if(!_0x4175f4[_0xa4135c]){delete _0x532221[_0xa4135c];}}}}Realtime[_0xe021('0x4')][_0xe021('0x5')]=function(_0x438eb8,_0x1009bc){for(var _0xa75be9 in _0x1009bc){if(_0x438eb8['hasOwnProperty'](_0xa75be9)){_0x438eb8[_0xa75be9]=_0x1009bc[_0xa75be9];}}};Realtime[_0xe021('0x4')][_0xe021('0x6')]=function(){var _0x3656d2=this;return function(_0x25f2cd){if(_0x25f2cd){freeIsNotKey(_0x25f2cd,_0x3656d2[_0xe021('0x2')],'id');for(var _0xe0dddc=0x0,_0x20df11={},_0x55d537={};_0xe0dddc<_0x25f2cd[_0xe021('0x7')];_0xe0dddc+=0x1){_0x20df11=_0x25f2cd[_0xe0dddc];if(_[_0xe021('0x8')](_0x3656d2[_0xe021('0x2')][_0x20df11['id']])){_0x3656d2[_0xe021('0x2')][_0x20df11['id']]=new MailAccount(_0x20df11);}else{_[_0xe021('0x9')](_0x3656d2['mailAccounts'][_0x20df11['id']],_0x20df11);}}}return _0x3656d2[_0xe021('0x2')];};};module[_0xe021('0xa')]=Realtime;