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 _0xdd78=['../../mysqldb','VoiceQueue','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5d77e5,_0x414096){var _0x16923a=function(_0x8b869b){while(--_0x8b869b){_0x5d77e5['push'](_0x5d77e5['shift']());}};_0x16923a(++_0x414096);}(_0xdd78,0x15e));var _0x8dd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd78[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8dd7('0x0'));var VoiceQueue=require(_0x8dd7('0x1'))['db'][_0x8dd7('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8dd7('0x3'),'afterUpdate':_0x8dd7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5cf64c){return function(_0x5a1b4a,_0x2d8a95,_0x46ae5a){VoiceQueueEvents[_0x8dd7('0x5')](_0x5cf64c+':'+_0x5a1b4a['id'],_0x5a1b4a);VoiceQueueEvents[_0x8dd7('0x5')](_0x5cf64c,_0x5a1b4a);_0x46ae5a(null);};}for(var e in events){if(events[_0x8dd7('0x6')](e)){var event=events[e];VoiceQueue[_0x8dd7('0x7')](e,emitEvent(event));}}module[_0x8dd7('0x8')]=VoiceQueueEvents;