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 _0xa8cb=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x556c0b,_0x10238c){var _0x354a90=function(_0x5314b6){while(--_0x5314b6){_0x556c0b['push'](_0x556c0b['shift']());}};_0x354a90(++_0x10238c);}(_0xa8cb,0x1c3));var _0xba8c=function(_0x24a65d,_0x5112bc){_0x24a65d=_0x24a65d-0x0;var _0x1a7a42=_0xa8cb[_0x24a65d];return _0x1a7a42;};'use strict';var EventEmitter=require(_0xba8c('0x0'));var ChatQueue=require(_0xba8c('0x1'))['db'][_0xba8c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xba8c('0x3')](0x0);var events={'afterCreate':_0xba8c('0x4'),'afterUpdate':_0xba8c('0x5'),'afterDestroy':_0xba8c('0x6')};function emitEvent(_0x4aad5c){return function(_0x561818,_0x15c8dc,_0x50257b){ChatQueueEvents[_0xba8c('0x7')](_0x4aad5c+':'+_0x561818['id'],_0x561818);ChatQueueEvents[_0xba8c('0x7')](_0x4aad5c,_0x561818);_0x50257b(null);};}for(var e in events){if(events[_0xba8c('0x8')](e)){var event=events[e];ChatQueue[_0xba8c('0x9')](e,emitEvent(event));}}module[_0xba8c('0xa')]=ChatQueueEvents;