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 _0xcfc0=['events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x489191,_0x3c8f9e){var _0x3216bb=function(_0x525401){while(--_0x525401){_0x489191['push'](_0x489191['shift']());}};_0x3216bb(++_0x3c8f9e);}(_0xcfc0,0x132));var _0x0cfc=function(_0x1c43aa,_0xff2696){_0x1c43aa=_0x1c43aa-0x0;var _0x514c3c=_0xcfc0[_0x1c43aa];return _0x514c3c;};'use strict';var EventEmitter=require(_0x0cfc('0x0'));var ChatQueue=require(_0x0cfc('0x1'))['db'][_0x0cfc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0cfc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0cfc('0x4'),'afterDestroy':_0x0cfc('0x5')};function emitEvent(_0x151602){return function(_0x56b789,_0x551d20,_0x4848b3){ChatQueueEvents[_0x0cfc('0x6')](_0x151602+':'+_0x56b789['id'],_0x56b789);ChatQueueEvents[_0x0cfc('0x6')](_0x151602,_0x56b789);_0x4848b3(null);};}for(var e in events){if(events[_0x0cfc('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x0cfc('0x8')]=ChatQueueEvents;