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 _0x7c74=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x47c1b7,_0x6290e2){var _0x4fb132=function(_0x187b21){while(--_0x187b21){_0x47c1b7['push'](_0x47c1b7['shift']());}};_0x4fb132(++_0x6290e2);}(_0x7c74,0x79));var _0x47c7=function(_0x11f0e3,_0x5170bc){_0x11f0e3=_0x11f0e3-0x0;var _0x2892e8=_0x7c74[_0x11f0e3];return _0x2892e8;};'use strict';var EventEmitter=require(_0x47c7('0x0'));var Dashboard=require(_0x47c7('0x1'))['db'][_0x47c7('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x47c7('0x3')](0x0);var events={'afterCreate':_0x47c7('0x4'),'afterUpdate':_0x47c7('0x5'),'afterDestroy':_0x47c7('0x6')};function emitEvent(_0x3d048d){return function(_0x3e1376,_0x68be71,_0x37b7f4){DashboardEvents[_0x47c7('0x7')](_0x3d048d+':'+_0x3e1376['id'],_0x3e1376);DashboardEvents[_0x47c7('0x7')](_0x3d048d,_0x3e1376);_0x37b7f4(null);};}for(var e in events){if(events[_0x47c7('0x8')](e)){var event=events[e];Dashboard[_0x47c7('0x9')](e,emitEvent(event));}}module[_0x47c7('0xa')]=DashboardEvents;