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 _0x8c15=['exports','events','../../mysqldb','setMaxListeners','update','hasOwnProperty','hook'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8c15,0xb0));var _0x58c1=function(_0x464b9f,_0x4dddce){_0x464b9f=_0x464b9f-0x0;var _0x5603bc=_0x8c15[_0x464b9f];return _0x5603bc;};'use strict';var EventEmitter=require(_0x58c1('0x0'));var Team=require(_0x58c1('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x58c1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x58c1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x18f1f7){return function(_0x1ace18,_0x2b9d83,_0x4992f7){TeamEvents['emit'](_0x18f1f7+':'+_0x1ace18['id'],_0x1ace18);TeamEvents['emit'](_0x18f1f7,_0x1ace18);_0x4992f7(null);};}for(var e in events){if(events[_0x58c1('0x4')](e)){var event=events[e];Team[_0x58c1('0x5')](e,emitEvent(event));}}module[_0x58c1('0x6')]=TeamEvents;