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 _0x1c9a=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x43ac13,_0x1e0741){var _0x35c5d5=function(_0x531e68){while(--_0x531e68){_0x43ac13['push'](_0x43ac13['shift']());}};_0x35c5d5(++_0x1e0741);}(_0x1c9a,0x11c));var _0xa1c9=function(_0x1924cb,_0x5c6bf1){_0x1924cb=_0x1924cb-0x0;var _0x895947=_0x1c9a[_0x1924cb];return _0x895947;};'use strict';var EventEmitter=require(_0xa1c9('0x0'));var WhatsappAccount=require(_0xa1c9('0x1'))['db'][_0xa1c9('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa1c9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa1c9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x10af79){return function(_0x59bdfc,_0x421415,_0x424e26){WhatsappAccountEvents[_0xa1c9('0x5')](_0x10af79+':'+_0x59bdfc['id'],_0x59bdfc);WhatsappAccountEvents['emit'](_0x10af79,_0x59bdfc);_0x424e26(null);};}for(var e in events){if(events[_0xa1c9('0x6')](e)){var event=events[e];WhatsappAccount[_0xa1c9('0x7')](e,emitEvent(event));}}module[_0xa1c9('0x8')]=WhatsappAccountEvents;