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 _0x8acb=['hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5d9839,_0x3da611){var _0x1437f0=function(_0xa46e9d){while(--_0xa46e9d){_0x5d9839['push'](_0x5d9839['shift']());}};_0x1437f0(++_0x3da611);}(_0x8acb,0x106));var _0xb8ac=function(_0x32f96f,_0x391cbe){_0x32f96f=_0x32f96f-0x0;var _0x394cd4=_0x8acb[_0x32f96f];return _0x394cd4;};'use strict';var EventEmitter=require(_0xb8ac('0x0'));var Dashboard=require(_0xb8ac('0x1'))['db'][_0xb8ac('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb8ac('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb8ac('0x4'),'afterDestroy':_0xb8ac('0x5')};function emitEvent(_0x4833bd){return function(_0x2abe62,_0x2803fb,_0x2ab9ea){DashboardEvents[_0xb8ac('0x6')](_0x4833bd+':'+_0x2abe62['id'],_0x2abe62);DashboardEvents[_0xb8ac('0x6')](_0x4833bd,_0x2abe62);_0x2ab9ea(null);};}for(var e in events){if(events[_0xb8ac('0x7')](e)){var event=events[e];Dashboard[_0xb8ac('0x8')](e,emitEvent(event));}}module[_0xb8ac('0x9')]=DashboardEvents;