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 _0xcf6e=['../../mysqldb','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0xe0f3ca,_0x12e10a){var _0x5db0fd=function(_0x886938){while(--_0x886938){_0xe0f3ca['push'](_0xe0f3ca['shift']());}};_0x5db0fd(++_0x12e10a);}(_0xcf6e,0x6f));var _0xecf6=function(_0x536a72,_0x2b01b5){_0x536a72=_0x536a72-0x0;var _0x3523d4=_0xcf6e[_0x536a72];return _0x3523d4;};'use strict';var EventEmitter=require(_0xecf6('0x0'));var Team=require(_0xecf6('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xecf6('0x2'),'afterUpdate':_0xecf6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x506720){return function(_0x1e0832,_0x299711,_0x4f2648){TeamEvents['emit'](_0x506720+':'+_0x1e0832['id'],_0x1e0832);TeamEvents[_0xecf6('0x4')](_0x506720,_0x1e0832);_0x4f2648(null);};}for(var e in events){if(events[_0xecf6('0x5')](e)){var event=events[e];Team[_0xecf6('0x6')](e,emitEvent(event));}}module[_0xecf6('0x7')]=TeamEvents;