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 _0x56a6=['emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','remove'];(function(_0x3f7294,_0x5bb5f6){var _0x1ee06=function(_0x52bf89){while(--_0x52bf89){_0x3f7294['push'](_0x3f7294['shift']());}};_0x1ee06(++_0x5bb5f6);}(_0x56a6,0x17b));var _0x656a=function(_0x56eb35,_0xc5375b){_0x56eb35=_0x56eb35-0x0;var _0x247a2e=_0x56a6[_0x56eb35];return _0x247a2e;};'use strict';var EventEmitter=require(_0x656a('0x0'));var ChatWebsite=require(_0x656a('0x1'))['db'][_0x656a('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x656a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x656a('0x4')};function emitEvent(_0x257391){return function(_0x67844b,_0x4d764b,_0x373d4c){ChatWebsiteEvents[_0x656a('0x5')](_0x257391+':'+_0x67844b['id'],_0x67844b);ChatWebsiteEvents[_0x656a('0x5')](_0x257391,_0x67844b);_0x373d4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x656a('0x6')](e,emitEvent(event));}}module[_0x656a('0x7')]=ChatWebsiteEvents;