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 _0x1b9b=['exports','events','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2716c6,_0x38dd17){var _0x518dc2=function(_0x36e9e9){while(--_0x36e9e9){_0x2716c6['push'](_0x2716c6['shift']());}};_0x518dc2(++_0x38dd17);}(_0x1b9b,0x89));var _0xb1b9=function(_0x1e1692,_0x201551){_0x1e1692=_0x1e1692-0x0;var _0x2585ff=_0x1b9b[_0x1e1692];return _0x2585ff;};'use strict';var EventEmitter=require(_0xb1b9('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xb1b9('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb1b9('0x2')](0x0);var events={'afterCreate':_0xb1b9('0x3'),'afterUpdate':_0xb1b9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x38f77a){return function(_0x411464,_0x597f8f,_0x5c24be){UserProfileEvents['emit'](_0x38f77a+':'+_0x411464['id'],_0x411464);UserProfileEvents[_0xb1b9('0x5')](_0x38f77a,_0x411464);_0x5c24be(null);};}for(var e in events){if(events[_0xb1b9('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xb1b9('0x7')]=UserProfileEvents;