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 _0xe1d3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x7ec937,_0xbe3b08){var _0x150040=function(_0x4a5d8e){while(--_0x4a5d8e){_0x7ec937['push'](_0x7ec937['shift']());}};_0x150040(++_0xbe3b08);}(_0xe1d3,0x159));var _0x3e1d=function(_0xbe62a5,_0x392fff){_0xbe62a5=_0xbe62a5-0x0;var _0x21a774=_0xe1d3[_0xbe62a5];return _0x21a774;};'use strict';var EventEmitter=require(_0x3e1d('0x0'));var UserProfile=require(_0x3e1d('0x1'))['db'][_0x3e1d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3e1d('0x3')](0x0);var events={'afterCreate':_0x3e1d('0x4'),'afterUpdate':'update','afterDestroy':_0x3e1d('0x5')};function emitEvent(_0x4a0768){return function(_0x23f59b,_0x38df15,_0x4f6337){UserProfileEvents['emit'](_0x4a0768+':'+_0x23f59b['id'],_0x23f59b);UserProfileEvents[_0x3e1d('0x6')](_0x4a0768,_0x23f59b);_0x4f6337(null);};}for(var e in events){if(events[_0x3e1d('0x7')](e)){var event=events[e];UserProfile[_0x3e1d('0x8')](e,emitEvent(event));}}module[_0x3e1d('0x9')]=UserProfileEvents;