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 _0xdfda=['remove','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x55f549,_0x4f90ac){var _0x589a78=function(_0x4b2cc3){while(--_0x4b2cc3){_0x55f549['push'](_0x55f549['shift']());}};_0x589a78(++_0x4f90ac);}(_0xdfda,0x103));var _0xadfd=function(_0x5563bb,_0x3dd8b4){_0x5563bb=_0x5563bb-0x0;var _0x1e0cef=_0xdfda[_0x5563bb];return _0x1e0cef;};'use strict';var EventEmitter=require(_0xadfd('0x0'));var UserProfile=require(_0xadfd('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xadfd('0x2')](0x0);var events={'afterCreate':_0xadfd('0x3'),'afterUpdate':_0xadfd('0x4'),'afterDestroy':_0xadfd('0x5')};function emitEvent(_0x114afc){return function(_0xf49045,_0x3648e1,_0x2b34e7){UserProfileEvents['emit'](_0x114afc+':'+_0xf49045['id'],_0xf49045);UserProfileEvents['emit'](_0x114afc,_0xf49045);_0x2b34e7(null);};}for(var e in events){if(events[_0xadfd('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xadfd('0x7')]=UserProfileEvents;