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 _0xf5af=['remove','emit','hasOwnProperty','exports','../../mysqldb','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5af,0x142));var _0xff5a=function(_0x21459c,_0x5cab60){_0x21459c=_0x21459c-0x0;var _0x850934=_0xf5af[_0x21459c];return _0x850934;};'use strict';var EventEmitter=require('events');var Team=require(_0xff5a('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xff5a('0x1'),'afterDestroy':_0xff5a('0x2')};function emitEvent(_0x33750e){return function(_0x31bf59,_0x3acaf0,_0x259622){TeamEvents[_0xff5a('0x3')](_0x33750e+':'+_0x31bf59['id'],_0x31bf59);TeamEvents[_0xff5a('0x3')](_0x33750e,_0x31bf59);_0x259622(null);};}for(var e in events){if(events[_0xff5a('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xff5a('0x5')]=TeamEvents;