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 _0x4a80=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','ChatWebsite'];(function(_0x239632,_0x472e6a){var _0x2fad25=function(_0x2c7e31){while(--_0x2c7e31){_0x239632['push'](_0x239632['shift']());}};_0x2fad25(++_0x472e6a);}(_0x4a80,0xbe));var _0x04a8=function(_0x3dc88c,_0x2fb4ef){_0x3dc88c=_0x3dc88c-0x0;var _0x2cdd6a=_0x4a80[_0x3dc88c];return _0x2cdd6a;};'use strict';var EventEmitter=require(_0x04a8('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x04a8('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x04a8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x04a8('0x3'),'afterDestroy':_0x04a8('0x4')};function emitEvent(_0x256369){return function(_0x1e36fc,_0x85c22,_0xde2f6a){ChatWebsiteEvents[_0x04a8('0x5')](_0x256369+':'+_0x1e36fc['id'],_0x1e36fc);ChatWebsiteEvents[_0x04a8('0x5')](_0x256369,_0x1e36fc);_0xde2f6a(null);};}for(var e in events){if(events[_0x04a8('0x6')](e)){var event=events[e];ChatWebsite[_0x04a8('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;