From: support
Date: Thu, 12 Jan 2023 16:07:59 +0000 (+0000)
Subject: Built motion from commit ac06311e.|2.6.28
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22%7B%7Blicense.openchannel?a=commitdiff_plain;h=b4b589ce17d710436457f9c14e03fafcfd9d5d2b;p=motion2.git
Built motion from commit ac06311e.|2.6.28
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 7b4aac7..c452c35 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-12T15:37:56.892Z",
+ "time": "2023-01-12T15:59:12.322Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 0f3cae6..c450808 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-12T15:37:56.892Z",
+ "time": "2023-01-12T15:59:12.322Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index ed9b08d..97fc0e8 100644
--- a/server/api/action/action.attributes.js
+++ b/server/api/action/action.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe37a=['getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','sequelize','exports','VIRTUAL'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xe37a,0x1bd));var _0xae37=function(_0x48b541,_0x5b7b2c){_0x48b541=_0x48b541-0x0;var _0x48aae3=_0xe37a[_0x48b541];return _0x48aae3;};'use strict';var Sequelize=require(_0xae37('0x0'));module[_0xae37('0x1')]={'name':{'type':Sequelize[_0xae37('0x2')],'get':function(_0x2bb14b){return this[_0xae37('0x3')](_0xae37('0x4'));}},'action':{'type':Sequelize[_0xae37('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xae37('0x6'),'integration',_0xae37('0x7'),_0xae37('0x8'),_0xae37('0x9'),_0xae37('0xa'),_0xae37('0xb'),_0xae37('0xc')]],'msg':_0xae37('0xd')}},'comment':_0xae37('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xae37('0xe')},'data2':{'type':Sequelize[_0xae37('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xae37('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xae37('0x5')](0x1000),'comments':_0xae37('0xf')},'data5':{'type':Sequelize[_0xae37('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x2aa0=['sequelize','exports','getDataValue','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x512ce0,_0xf5e83f){var _0x7118b0=function(_0x26010){while(--_0x26010){_0x512ce0['push'](_0x512ce0['shift']());}};_0x7118b0(++_0xf5e83f);}(_0x2aa0,0x6c));var _0x02aa=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2aa0[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x02aa('0x0'));module[_0x02aa('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x13e896){return this[_0x02aa('0x2')]('action');}},'action':{'type':Sequelize[_0x02aa('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x02aa('0x4'),_0x02aa('0x5'),_0x02aa('0x6'),_0x02aa('0x7'),_0x02aa('0x8'),_0x02aa('0x9'),_0x02aa('0xa')]],'msg':_0x02aa('0xb')}},'comment':_0x02aa('0xb')},'data1':{'type':Sequelize[_0x02aa('0x3')](0x1000),'comment':_0x02aa('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x02aa('0xd')},'data3':{'type':Sequelize[_0x02aa('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x02aa('0x3')](0x1000),'comments':_0x02aa('0xe')},'data5':{'type':Sequelize[_0x02aa('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x02aa('0xf')},'data7':{'type':Sequelize[_0x02aa('0x10')],'comments':_0x02aa('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 12161ae..786fb18 100644
--- a/server/api/action/action.controller.js
+++ b/server/api/action/action.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d36=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','end','error','name','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x58205b,_0x33ef52){var _0x4fda4c=function(_0x10f4e8){while(--_0x10f4e8){_0x58205b['push'](_0x58205b['shift']());}};_0x4fda4c(++_0x33ef52);}(_0x0d36,0x1e8));var _0x60d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d36[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x60d3('0x0'));var rimraf=require(_0x60d3('0x1'));var zipdir=require(_0x60d3('0x2'));var jsonpatch=require(_0x60d3('0x3'));var rp=require('request-promise');var moment=require(_0x60d3('0x4'));var BPromise=require(_0x60d3('0x5'));var Mustache=require('mustache');var util=require(_0x60d3('0x6'));var path=require('path');var sox=require(_0x60d3('0x7'));var csv=require(_0x60d3('0x8'));var ejs=require(_0x60d3('0x9'));var fs=require('fs');var fs_extra=require(_0x60d3('0xa'));var _=require('lodash');var squel=require(_0x60d3('0xb'));var crypto=require(_0x60d3('0xc'));var jsforce=require(_0x60d3('0xd'));var deskjs=require(_0x60d3('0xe'));var toCsv=require(_0x60d3('0x8'));var querystring=require(_0x60d3('0xf'));var Papa=require(_0x60d3('0x10'));var Redis=require(_0x60d3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x60d3('0x12'));var as=require(_0x60d3('0x13'));var hardwareService=require(_0x60d3('0x14'));var logger=require(_0x60d3('0x15'))('api');var utils=require(_0x60d3('0x16'));var config=require(_0x60d3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x60d3('0x18'))['db'];function respondWithStatusCode(_0x284d83,_0xfc75c7){_0xfc75c7=_0xfc75c7||0xcc;return function(_0x340b57){if(_0x340b57){return _0x284d83[_0x60d3('0x19')](_0xfc75c7);}return _0x284d83[_0x60d3('0x1a')](_0xfc75c7)['end']();};}function respondWithResult(_0x1f84e7,_0x524255){_0x524255=_0x524255||0xc8;return function(_0x9cdd1d){if(_0x9cdd1d){return _0x1f84e7[_0x60d3('0x1a')](_0x524255)[_0x60d3('0x1b')](_0x9cdd1d);}};}function respondWithFilteredResult(_0xf36044,_0x299796){return function(_0x3782aa){if(_0x3782aa){var _0x107ab3=typeof _0x299796[_0x60d3('0x1c')]==='undefined'&&typeof _0x299796[_0x60d3('0x1d')]===_0x60d3('0x1e');var _0x150409=_0x3782aa['count'];var _0x4c7b8b=_0x107ab3?0x0:_0x299796[_0x60d3('0x1c')];var _0x3a9141=_0x107ab3?_0x3782aa[_0x60d3('0x1f')]:_0x299796[_0x60d3('0x1c')]+_0x299796[_0x60d3('0x1d')];var _0x3c16a5;if(_0x3a9141>=_0x150409){_0x3a9141=_0x150409;_0x3c16a5=0xc8;}else{_0x3c16a5=0xce;}_0xf36044[_0x60d3('0x1a')](_0x3c16a5);return _0xf36044[_0x60d3('0x20')](_0x60d3('0x21'),_0x4c7b8b+'-'+_0x3a9141+'/'+_0x150409)['json'](_0x3782aa);}return null;};}function patchUpdates(_0x4c8422){return function(_0x44ede5){try{jsonpatch[_0x60d3('0x22')](_0x44ede5,_0x4c8422,!![]);}catch(_0x57b808){return BPromise['reject'](_0x57b808);}return _0x44ede5['save']();};}function saveUpdates(_0x10c61d,_0x47e500){return function(_0xc9c0a5){if(_0xc9c0a5){return _0xc9c0a5[_0x60d3('0x23')](_0x10c61d)['then'](function(_0x560014){return _0x560014;});}return null;};}function removeEntity(_0x25349c,_0x59b471){return function(_0x131d04){if(_0x131d04){return _0x131d04[_0x60d3('0x24')]()[_0x60d3('0x25')](function(){_0x25349c[_0x60d3('0x1a')](0xcc)[_0x60d3('0x26')]();});}};}function handleEntityNotFound(_0x5a552f,_0xcbeaf7){return function(_0x325036){if(!_0x325036){_0x5a552f[_0x60d3('0x19')](0x194);}return _0x325036;};}function handleError(_0x53bef5,_0x249169){_0x249169=_0x249169||0x1f4;return function(_0x3179a9){logger[_0x60d3('0x27')](_0x3179a9['stack']);if(_0x3179a9['name']){delete _0x3179a9[_0x60d3('0x28')];}_0x53bef5[_0x60d3('0x1a')](_0x249169)['send'](_0x3179a9);};}exports[_0x60d3('0x23')]=function(_0x2ef93f,_0x51a066){if(_0x2ef93f[_0x60d3('0x29')]['id']){delete _0x2ef93f['body']['id'];}return db[_0x60d3('0x2a')][_0x60d3('0x2b')]({'where':{'id':_0x2ef93f[_0x60d3('0x2c')]['id']}})[_0x60d3('0x25')](handleEntityNotFound(_0x51a066,null))[_0x60d3('0x25')](saveUpdates(_0x2ef93f[_0x60d3('0x29')],null))[_0x60d3('0x25')](respondWithResult(_0x51a066,null))[_0x60d3('0x2d')](handleError(_0x51a066,null));};exports[_0x60d3('0x24')]=function(_0x286fab,_0x52f611){return db[_0x60d3('0x2a')][_0x60d3('0x2b')]({'where':{'id':_0x286fab[_0x60d3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x52f611,null))[_0x60d3('0x25')](removeEntity(_0x52f611,null))[_0x60d3('0x2d')](handleError(_0x52f611,null));};
\ No newline at end of file
+var _0xda6d=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','body','Action','catch','find','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xa87db6,_0x7fb711){var _0x48ae12=function(_0x5aae8d){while(--_0x5aae8d){_0xa87db6['push'](_0xa87db6['shift']());}};_0x48ae12(++_0x7fb711);}(_0xda6d,0xea));var _0xdda6=function(_0x32a9c4,_0x2d26b5){_0x32a9c4=_0x32a9c4-0x0;var _0x1e5d01=_0xda6d[_0x32a9c4];return _0x1e5d01;};'use strict';var emlformat=require(_0xdda6('0x0'));var rimraf=require(_0xdda6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdda6('0x2'));var rp=require(_0xdda6('0x3'));var moment=require('moment');var BPromise=require(_0xdda6('0x4'));var Mustache=require(_0xdda6('0x5'));var util=require('util');var path=require(_0xdda6('0x6'));var sox=require('sox');var csv=require(_0xdda6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdda6('0x8'));var squel=require('squel');var crypto=require(_0xdda6('0x9'));var jsforce=require(_0xdda6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdda6('0x7'));var querystring=require(_0xdda6('0xb'));var Papa=require(_0xdda6('0xc'));var Redis=require(_0xdda6('0xd'));var authService=require(_0xdda6('0xe'));var qs=require(_0xdda6('0xf'));var as=require(_0xdda6('0x10'));var hardwareService=require(_0xdda6('0x11'));var logger=require(_0xdda6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xdda6('0x13'));var licenseUtil=require(_0xdda6('0x14'));var db=require(_0xdda6('0x15'))['db'];function respondWithStatusCode(_0x33de47,_0x17ef47){_0x17ef47=_0x17ef47||0xcc;return function(_0x26aba7){if(_0x26aba7){return _0x33de47[_0xdda6('0x16')](_0x17ef47);}return _0x33de47[_0xdda6('0x17')](_0x17ef47)[_0xdda6('0x18')]();};}function respondWithResult(_0x4d2f94,_0x50a45e){_0x50a45e=_0x50a45e||0xc8;return function(_0x5d11ed){if(_0x5d11ed){return _0x4d2f94[_0xdda6('0x17')](_0x50a45e)[_0xdda6('0x19')](_0x5d11ed);}};}function respondWithFilteredResult(_0x228a24,_0x20d3a7){return function(_0x4e654e){if(_0x4e654e){var _0x139f4d=typeof _0x20d3a7[_0xdda6('0x1a')]==='undefined'&&typeof _0x20d3a7[_0xdda6('0x1b')]==='undefined';var _0x4f1b99=_0x4e654e[_0xdda6('0x1c')];var _0x1fcd3a=_0x139f4d?0x0:_0x20d3a7['offset'];var _0xd955=_0x139f4d?_0x4e654e[_0xdda6('0x1c')]:_0x20d3a7[_0xdda6('0x1a')]+_0x20d3a7[_0xdda6('0x1b')];var _0x385c82;if(_0xd955>=_0x4f1b99){_0xd955=_0x4f1b99;_0x385c82=0xc8;}else{_0x385c82=0xce;}_0x228a24[_0xdda6('0x17')](_0x385c82);return _0x228a24['set'](_0xdda6('0x1d'),_0x1fcd3a+'-'+_0xd955+'/'+_0x4f1b99)[_0xdda6('0x19')](_0x4e654e);}return null;};}function patchUpdates(_0x1f5239){return function(_0x208b0f){try{jsonpatch[_0xdda6('0x1e')](_0x208b0f,_0x1f5239,!![]);}catch(_0x5d9c84){return BPromise[_0xdda6('0x1f')](_0x5d9c84);}return _0x208b0f[_0xdda6('0x20')]();};}function saveUpdates(_0x3275a5,_0x5957b3){return function(_0x2bfaf4){if(_0x2bfaf4){return _0x2bfaf4[_0xdda6('0x21')](_0x3275a5)[_0xdda6('0x22')](function(_0x147713){return _0x147713;});}return null;};}function removeEntity(_0x98139,_0x3cd2ed){return function(_0x1a108c){if(_0x1a108c){return _0x1a108c[_0xdda6('0x23')]()[_0xdda6('0x22')](function(){_0x98139[_0xdda6('0x17')](0xcc)[_0xdda6('0x18')]();});}};}function handleEntityNotFound(_0x4ba5d1,_0x486a57){return function(_0x1e40fc){if(!_0x1e40fc){_0x4ba5d1['sendStatus'](0x194);}return _0x1e40fc;};}function handleError(_0x490334,_0x500e55){_0x500e55=_0x500e55||0x1f4;return function(_0x41ff31){logger['error'](_0x41ff31['stack']);if(_0x41ff31[_0xdda6('0x24')]){delete _0x41ff31[_0xdda6('0x24')];}_0x490334[_0xdda6('0x17')](_0x500e55)['send'](_0x41ff31);};}exports[_0xdda6('0x21')]=function(_0x143a0a,_0x4e54d2){if(_0x143a0a[_0xdda6('0x25')]['id']){delete _0x143a0a[_0xdda6('0x25')]['id'];}return db[_0xdda6('0x26')]['find']({'where':{'id':_0x143a0a['params']['id']}})[_0xdda6('0x22')](handleEntityNotFound(_0x4e54d2,null))['then'](saveUpdates(_0x143a0a[_0xdda6('0x25')],null))['then'](respondWithResult(_0x4e54d2,null))[_0xdda6('0x27')](handleError(_0x4e54d2,null));};exports[_0xdda6('0x23')]=function(_0x17db3e,_0x1cc766){return db[_0xdda6('0x26')][_0xdda6('0x28')]({'where':{'id':_0x17db3e[_0xdda6('0x29')]['id']}})[_0xdda6('0x22')](handleEntityNotFound(_0x1cc766,null))[_0xdda6('0x22')](removeEntity(_0x1cc766,null))[_0xdda6('0x27')](handleError(_0x1cc766,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 31b5592..5e99ef2 100644
--- a/server/api/action/action.model.js
+++ b/server/api/action/action.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x401f=['moment','bluebird','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api'];(function(_0x18a726,_0x408f55){var _0x9f85cb=function(_0x446d3c){while(--_0x446d3c){_0x18a726['push'](_0x18a726['shift']());}};_0x9f85cb(++_0x408f55);}(_0x401f,0x1b6));var _0xf401=function(_0x38f3db,_0x36d5ff){_0x38f3db=_0x38f3db-0x0;var _0x587bb5=_0x401f[_0x38f3db];return _0x587bb5;};'use strict';var _=require(_0xf401('0x0'));var util=require(_0xf401('0x1'));var logger=require(_0xf401('0x2'))(_0xf401('0x3'));var moment=require(_0xf401('0x4'));var BPromise=require(_0xf401('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf401('0x6'));var config=require(_0xf401('0x7'));var attributes=require(_0xf401('0x8'));module[_0xf401('0x9')]=function(_0x2189f6,_0x1748e6){return _0x2189f6[_0xf401('0xa')](_0xf401('0xb'),attributes,{'tableName':_0xf401('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e2=['../../config/logger','request-promise','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','util'];(function(_0x5dbf67,_0x3d51f2){var _0x18b74d=function(_0x5052dc){while(--_0x5052dc){_0x5dbf67['push'](_0x5dbf67['shift']());}};_0x18b74d(++_0x3d51f2);}(_0xa9e2,0x1e5));var _0x2a9e=function(_0x5b747f,_0x6cdd35){_0x5b747f=_0x5b747f-0x0;var _0x1c42f4=_0xa9e2[_0x5b747f];return _0x1c42f4;};'use strict';var _=require('lodash');var util=require(_0x2a9e('0x0'));var logger=require(_0x2a9e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2a9e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a9e('0x3'));var config=require(_0x2a9e('0x4'));var attributes=require(_0x2a9e('0x5'));module[_0x2a9e('0x6')]=function(_0x1129e8,_0x260776){return _0x1129e8['define'](_0x2a9e('0x7'),attributes,{'tableName':_0x2a9e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index bca1ca2..3d32867 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x27858c,_0x1db761){var _0x326479=function(_0x3464ce){while(--_0x3464ce){_0x27858c['push'](_0x27858c['shift']());}};_0x326479(++_0x1db761);}(_0xe14b,0x93));var _0xbe14=function(_0x3b340f,_0x404d94){_0x3b340f=_0x3b340f-0x0;var _0x245337=_0xe14b[_0x3b340f];return _0x245337;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1b197e,_0x5e7c1b){var _0x21960b=function(_0x4de1d1){while(--_0x4de1d1){_0x1b197e['push'](_0x1b197e['shift']());}};_0x21960b(++_0x5e7c1b);}(_0xabce,0x103));var _0xeabc=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xabce[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 268ddc8..8eb2d13 100644
--- a/server/api/action/index.js
+++ b/server/api/action/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x667d=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1efaea,_0x43e445){var _0x2e5b71=function(_0x5cf7eb){while(--_0x5cf7eb){_0x1efaea['push'](_0x1efaea['shift']());}};_0x2e5b71(++_0x43e445);}(_0x667d,0x86));var _0xd667=function(_0x364f17,_0x31e0e7){_0x364f17=_0x364f17-0x0;var _0x22e2cc=_0x667d[_0x364f17];return _0x22e2cc;};'use strict';var multer=require(_0xd667('0x0'));var util=require(_0xd667('0x1'));var path=require(_0xd667('0x2'));var timeout=require(_0xd667('0x3'));var express=require(_0xd667('0x4'));var router=express[_0xd667('0x5')]();var fs_extra=require(_0xd667('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd667('0x7'));var config=require(_0xd667('0x8'));var controller=require('./action.controller');router['put']('/:id',auth[_0xd667('0x9')](),controller[_0xd667('0xa')]);router[_0xd667('0xb')]('/:id',auth[_0xd667('0x9')](),controller[_0xd667('0xc')]);module[_0xd667('0xd')]=router;
\ No newline at end of file
+var _0x8877=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','update','/:id','destroy','exports'];(function(_0x57c16e,_0x5d275e){var _0x3b3a65=function(_0x2792cd){while(--_0x2792cd){_0x57c16e['push'](_0x57c16e['shift']());}};_0x3b3a65(++_0x5d275e);}(_0x8877,0x1b0));var _0x7887=function(_0x175bc6,_0xd90ea1){_0x175bc6=_0x175bc6-0x0;var _0x47cfc8=_0x8877[_0x175bc6];return _0x47cfc8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7887('0x0'));var router=express[_0x7887('0x1')]();var fs_extra=require(_0x7887('0x2'));var auth=require(_0x7887('0x3'));var interaction=require(_0x7887('0x4'));var config=require(_0x7887('0x5'));var controller=require(_0x7887('0x6'));router[_0x7887('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7887('0x8')]);router['delete'](_0x7887('0x9'),auth['isAuthenticated'](),controller[_0x7887('0xa')]);module[_0x7887('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index ece7732..ea2903c 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x37c570,_0x3a2261){var _0xe4f999=function(_0xf77522){while(--_0xf77522){_0x37c570['push'](_0x37c570['shift']());}};_0xe4f999(++_0x3a2261);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x5fc3[_0x2dc96f];return _0xd012da;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
+var _0x7c09=['exports','STRING','TEXT'];(function(_0x26bc42,_0xe6bb38){var _0xeef8e7=function(_0x3b545a){while(--_0x3b545a){_0x26bc42['push'](_0x26bc42['shift']());}};_0xeef8e7(++_0xe6bb38);}(_0x7c09,0x102));var _0x97c0=function(_0x5af84e,_0x1e4149){_0x5af84e=_0x5af84e-0x0;var _0x3a4389=_0x7c09[_0x5af84e];return _0x3a4389;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index fa1ed2d..b66e74b 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.controller.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a63=['sendStatus','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','condition','value','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','Limited\x20Query:','toString','QueryTypes','SELECT','MAX(%s)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','groupBy','%s-%s.%s','randomstring','generate','output','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','join','../../components/export/','../../files/reports','savename','sequelize','runReport','right_join','debug','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','get','CustomReports'];(function(_0x450fa0,_0x5b14fc){var _0x26f1fe=function(_0x522c2a){while(--_0x522c2a){_0x450fa0['push'](_0x450fa0['shift']());}};_0x26f1fe(++_0x5b14fc);}(_0x3a63,0x11e));var _0x33a6=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x3a63[_0x34bc6c];return _0x168820;};'use strict';var emlformat=require(_0x33a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33a6('0x1'));var rp=require(_0x33a6('0x2'));var moment=require(_0x33a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x33a6('0x4'));var util=require('util');var path=require(_0x33a6('0x5'));var sox=require(_0x33a6('0x6'));var csv=require(_0x33a6('0x7'));var ejs=require(_0x33a6('0x8'));var fs=require('fs');var fs_extra=require(_0x33a6('0x9'));var _=require('lodash');var squel=require(_0x33a6('0xa'));var crypto=require(_0x33a6('0xb'));var jsforce=require(_0x33a6('0xc'));var deskjs=require(_0x33a6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x33a6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x33a6('0xf'));var as=require(_0x33a6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33a6('0x11'))(_0x33a6('0x12'));var utils=require(_0x33a6('0x13'));var config=require(_0x33a6('0x14'));var licenseUtil=require(_0x33a6('0x15'));var db=require(_0x33a6('0x16'))['db'];var dbH=require(_0x33a6('0x16'))[_0x33a6('0x17')];function respondWithStatusCode(_0x59366f,_0x224437){_0x224437=_0x224437||0xcc;return function(_0x5e67e0){if(_0x5e67e0){return _0x59366f['sendStatus'](_0x224437);}return _0x59366f[_0x33a6('0x18')](_0x224437)[_0x33a6('0x19')]();};}function respondWithResult(_0x2cf145,_0x1dcd8f){_0x1dcd8f=_0x1dcd8f||0xc8;return function(_0x26d7ce){if(_0x26d7ce){return _0x2cf145[_0x33a6('0x18')](_0x1dcd8f)['json'](_0x26d7ce);}};}function respondWithFilteredResult(_0x3503c6,_0x4a66d3){return function(_0x30f0b3){if(_0x30f0b3){var _0x464a78=typeof _0x4a66d3[_0x33a6('0x1a')]===_0x33a6('0x1b')&&typeof _0x4a66d3[_0x33a6('0x1c')]===_0x33a6('0x1b');var _0x49bb93=_0x30f0b3['count'];var _0x14e647=_0x464a78?0x0:_0x4a66d3[_0x33a6('0x1a')];var _0x2cfc70=_0x464a78?_0x30f0b3[_0x33a6('0x1d')]:_0x4a66d3[_0x33a6('0x1a')]+_0x4a66d3[_0x33a6('0x1c')];var _0x5541fc;if(_0x2cfc70>=_0x49bb93){_0x2cfc70=_0x49bb93;_0x5541fc=0xc8;}else{_0x5541fc=0xce;}_0x3503c6[_0x33a6('0x18')](_0x5541fc);return _0x3503c6['set'](_0x33a6('0x1e'),_0x14e647+'-'+_0x2cfc70+'/'+_0x49bb93)[_0x33a6('0x1f')](_0x30f0b3);}return null;};}function patchUpdates(_0xd5f8ee){return function(_0x3cdd2f){try{jsonpatch[_0x33a6('0x20')](_0x3cdd2f,_0xd5f8ee,!![]);}catch(_0x16432c){return BPromise[_0x33a6('0x21')](_0x16432c);}return _0x3cdd2f['save']();};}function saveUpdates(_0x190ba8,_0x4ec0d1){return function(_0x147a6b){if(_0x147a6b){return _0x147a6b[_0x33a6('0x22')](_0x190ba8)[_0x33a6('0x23')](function(_0x1673b2){return _0x1673b2;});}return null;};}function removeEntity(_0x3e41ed,_0x4f4b91){return function(_0x1b234e){if(_0x1b234e){return _0x1b234e['destroy']()[_0x33a6('0x23')](function(){var _0x105311=_0x1b234e[_0x33a6('0x24')]({'plain':!![]});var _0x1dfd65=_0x33a6('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x1dfd65,'resourceId':_0x105311['id']}})[_0x33a6('0x23')](function(){return _0x1b234e;});})['then'](function(){_0x3e41ed[_0x33a6('0x18')](0xcc)[_0x33a6('0x19')]();});}};}function handleEntityNotFound(_0x4789d1,_0x5005b5){return function(_0x50bfaf){if(!_0x50bfaf){_0x4789d1[_0x33a6('0x26')](0x194);}return _0x50bfaf;};}function handleError(_0x313ea0,_0x5c2794){_0x5c2794=_0x5c2794||0x1f4;return function(_0x488226){logger[_0x33a6('0x27')](_0x488226['stack']);if(_0x488226[_0x33a6('0x28')]){delete _0x488226[_0x33a6('0x28')];}_0x313ea0[_0x33a6('0x18')](_0x5c2794)[_0x33a6('0x29')](_0x488226);};}exports[_0x33a6('0x2a')]=function(_0x1793b2,_0x38fb55){var _0x3862ae={},_0x5696db={},_0x29b89c={'count':0x0,'rows':[]};var _0x2beb2a=_[_0x33a6('0x2b')](db[_0x33a6('0x2c')][_0x33a6('0x2d')],function(_0x39218c){return{'name':_0x39218c[_0x33a6('0x2e')],'type':_0x39218c[_0x33a6('0x2f')][_0x33a6('0x30')]};});_0x5696db['model']=_[_0x33a6('0x2b')](_0x2beb2a,_0x33a6('0x28'));_0x5696db[_0x33a6('0x31')]=_[_0x33a6('0x32')](_0x1793b2[_0x33a6('0x31')]);_0x5696db[_0x33a6('0x33')]=_['intersection'](_0x5696db[_0x33a6('0x34')],_0x5696db[_0x33a6('0x31')]);_0x3862ae['attributes']=_['intersection'](_0x5696db['model'],qs[_0x33a6('0x35')](_0x1793b2[_0x33a6('0x31')][_0x33a6('0x35')]));_0x3862ae['attributes']=_0x3862ae[_0x33a6('0x36')][_0x33a6('0x37')]?_0x3862ae['attributes']:_0x5696db[_0x33a6('0x34')];if(!_0x1793b2[_0x33a6('0x31')][_0x33a6('0x38')]('nolimit')){_0x3862ae[_0x33a6('0x1c')]=qs[_0x33a6('0x1c')](_0x1793b2[_0x33a6('0x31')][_0x33a6('0x1c')]);_0x3862ae[_0x33a6('0x1a')]=qs[_0x33a6('0x1a')](_0x1793b2[_0x33a6('0x31')][_0x33a6('0x1a')]);}_0x3862ae[_0x33a6('0x39')]=qs['sort'](_0x1793b2[_0x33a6('0x31')][_0x33a6('0x3a')]);_0x3862ae[_0x33a6('0x3b')]=qs[_0x33a6('0x33')](_[_0x33a6('0x3c')](_0x1793b2[_0x33a6('0x31')],_0x5696db['filters']),_0x2beb2a);if(_0x1793b2['query'][_0x33a6('0x3d')]){_0x3862ae[_0x33a6('0x3b')]=_[_0x33a6('0x3e')](_0x3862ae['where'],{'$or':_[_0x33a6('0x2b')](_0x2beb2a,function(_0x31e74e){if(_0x31e74e[_0x33a6('0x2f')]!==_0x33a6('0x3f')){var _0x4727f1={};_0x4727f1[_0x31e74e[_0x33a6('0x28')]]={'$like':'%'+_0x1793b2['query'][_0x33a6('0x3d')]+'%'};return _0x4727f1;}})});}_0x3862ae=_['merge']({},_0x3862ae,_0x1793b2[_0x33a6('0x40')]);var _0x225fca={'where':_0x3862ae[_0x33a6('0x3b')]};return db[_0x33a6('0x2c')][_0x33a6('0x1d')](_0x225fca)[_0x33a6('0x23')](function(_0x3fa482){_0x29b89c[_0x33a6('0x1d')]=_0x3fa482;if(_0x1793b2['query'][_0x33a6('0x41')]){_0x3862ae[_0x33a6('0x42')]=[{'all':!![]}];}return db[_0x33a6('0x2c')][_0x33a6('0x43')](_0x3862ae);})['then'](function(_0x544890){_0x29b89c[_0x33a6('0x44')]=_0x544890;return _0x29b89c;})[_0x33a6('0x23')](respondWithFilteredResult(_0x38fb55,_0x3862ae))[_0x33a6('0x45')](handleError(_0x38fb55,null));};exports[_0x33a6('0x46')]=function(_0x53b73f,_0x35b20b){var _0x1e4fe8={'raw':![],'where':{'id':_0x53b73f[_0x33a6('0x47')]['id']}},_0x66d3={};_0x66d3[_0x33a6('0x34')]=_[_0x33a6('0x32')](db[_0x33a6('0x2c')][_0x33a6('0x2d')]);_0x66d3['query']=_[_0x33a6('0x32')](_0x53b73f[_0x33a6('0x31')]);_0x66d3['filters']=_[_0x33a6('0x48')](_0x66d3[_0x33a6('0x34')],_0x66d3['query']);_0x1e4fe8['attributes']=_[_0x33a6('0x48')](_0x66d3[_0x33a6('0x34')],qs[_0x33a6('0x35')](_0x53b73f[_0x33a6('0x31')]['fields']));_0x1e4fe8['attributes']=_0x1e4fe8[_0x33a6('0x36')]['length']?_0x1e4fe8[_0x33a6('0x36')]:_0x66d3[_0x33a6('0x34')];if(_0x53b73f[_0x33a6('0x31')][_0x33a6('0x41')]){_0x1e4fe8[_0x33a6('0x42')]=[{'all':!![]}];}_0x1e4fe8=_[_0x33a6('0x3e')]({},_0x1e4fe8,_0x53b73f[_0x33a6('0x40')]);return db[_0x33a6('0x2c')][_0x33a6('0x49')](_0x1e4fe8)[_0x33a6('0x23')](handleEntityNotFound(_0x35b20b,null))[_0x33a6('0x23')](respondWithResult(_0x35b20b,null))[_0x33a6('0x45')](handleError(_0x35b20b,null));};exports[_0x33a6('0x4a')]=function(_0x50d2cb,_0x32183f){return db[_0x33a6('0x2c')][_0x33a6('0x4a')](_0x50d2cb[_0x33a6('0x4b')],{})[_0x33a6('0x23')](function(_0x1c8bf3){var _0x28c05b=_0x50d2cb[_0x33a6('0x4c')][_0x33a6('0x24')]({'plain':!![]});if(!_0x28c05b)throw new Error(_0x33a6('0x4d'));if(_0x28c05b[_0x33a6('0x4e')]==='user'){var _0x408b8d=_0x1c8bf3[_0x33a6('0x24')]({'plain':!![]});var _0x5792a3=_0x33a6('0x4f');return db[_0x33a6('0x50')][_0x33a6('0x49')]({'where':{'name':_0x5792a3,'userProfileId':_0x28c05b['userProfileId']},'raw':!![]})[_0x33a6('0x23')](function(_0x42049e){if(_0x42049e&&_0x42049e['autoAssociation']===0x0){return db[_0x33a6('0x51')][_0x33a6('0x4a')]({'name':_0x408b8d['name'],'resourceId':_0x408b8d['id'],'type':'CustomReports','sectionId':_0x42049e['id']},{})[_0x33a6('0x23')](function(){return _0x1c8bf3;});}else{return _0x1c8bf3;}})['catch'](function(_0x544270){logger[_0x33a6('0x27')](_0x33a6('0x52'),_0x544270);throw _0x544270;});}return _0x1c8bf3;})[_0x33a6('0x23')](respondWithResult(_0x32183f,0xc9))['catch'](handleError(_0x32183f,null));};exports['update']=function(_0x46deda,_0x49339c){if(_0x46deda[_0x33a6('0x4b')]['id']){delete _0x46deda[_0x33a6('0x4b')]['id'];}return db[_0x33a6('0x2c')]['find']({'where':{'id':_0x46deda[_0x33a6('0x47')]['id']}})['then'](handleEntityNotFound(_0x49339c,null))[_0x33a6('0x23')](saveUpdates(_0x46deda[_0x33a6('0x4b')],null))[_0x33a6('0x23')](respondWithResult(_0x49339c,null))[_0x33a6('0x45')](handleError(_0x49339c,null));};exports[_0x33a6('0x53')]=function(_0x5d412c,_0x247103){return db['AnalyticCustomReport'][_0x33a6('0x49')]({'where':{'id':_0x5d412c[_0x33a6('0x47')]['id']}})[_0x33a6('0x23')](handleEntityNotFound(_0x247103,null))[_0x33a6('0x23')](removeEntity(_0x247103,null))[_0x33a6('0x45')](handleError(_0x247103,null));};exports[_0x33a6('0x54')]=function(_0x3f6ee6,_0x5d6c39){var _0x3f9388=0xa;var _0x5e73d1=['join',_0x33a6('0x55'),'right_join',_0x33a6('0x56')];var _0x766134={'SUM':_0x33a6('0x57'),'COUNT':_0x33a6('0x58'),'COUNT DISTINCT':_0x33a6('0x59'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x33a6('0x5a'),'GROUP_CONCAT':_0x33a6('0x5b'),'GROUP_CONCAT ASC':_0x33a6('0x5c'),'GROUP_CONCAT DESC':_0x33a6('0x5d')};var _0x2ac3ba={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x33a6('0x5e'),'ROUND':_0x33a6('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x213a4d=function(_0x33649e){return!_[_0x33a6('0x60')]([_0x33a6('0x61'),_0x33a6('0x62'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x33649e);};var _0x4b5c80=function(_0x565e6c){if(!_0x565e6c||!_0x565e6c[_0x33a6('0x63')][_0x33a6('0x37')]){return'';}for(var _0x96a81e='(',_0x2699bf=0x0;_0x2699bf<_0x565e6c[_0x33a6('0x63')][_0x33a6('0x37')];_0x2699bf+=0x1){_0x2699bf>0x0&&(_0x96a81e+='\x20'+_0x565e6c[_0x33a6('0x64')]+'\x20');_0x96a81e+=_0x565e6c[_0x33a6('0x63')][_0x2699bf][_0x33a6('0x65')]?_0x4b5c80(_0x565e6c[_0x33a6('0x63')][_0x2699bf][_0x33a6('0x65')]):_0x565e6c[_0x33a6('0x63')][_0x2699bf]['field']+'\x20'+_0x565e6c[_0x33a6('0x63')][_0x2699bf][_0x33a6('0x66')]+(_0x213a4d(_0x565e6c[_0x33a6('0x63')][_0x2699bf]['condition'])?'\x20'+_0x565e6c[_0x33a6('0x63')][_0x2699bf][_0x33a6('0x67')]:'');}return _0x96a81e+')';};var _0x1e44cb={'where':{'id':_0x3f6ee6[_0x33a6('0x47')]['id']}},_0x55ab84,_0x479ff4,_0x4a4489,_0x18789e,_0x4d497f;_0x1e44cb=_[_0x33a6('0x3e')]({},_0x1e44cb,_0x3f6ee6['options']);return db[_0x33a6('0x2c')][_0x33a6('0x49')](_0x1e44cb)['then'](function(_0x3872d4){if(_0x3872d4){_0x55ab84=_0x3872d4;return _0x3872d4['getFields']();}return null;})[_0x33a6('0x23')](function(_0x234176){if(_0x234176){if(!_0x234176[_0x33a6('0x37')]){throw new db['Sequelize'][(_0x33a6('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x479ff4=_0x234176;return db['AnalyticMetric'][_0x33a6('0x43')]({'raw':!![]});}return null;})[_0x33a6('0x23')](function(_0x4ae312){if(_0x4ae312){_0x4a4489=_[_0x33a6('0x69')](_0x4ae312,'id');var _0x53db50;var _0x3c7f36=squel[_0x33a6('0x6a')]();_0x3c7f36[_0x33a6('0x6b')](_0x55ab84[_0x33a6('0x6c')]);for(var _0x221cf6=0x0;_0x221cf6<_0x479ff4[_0x33a6('0x37')];_0x221cf6+=0x1){_0x53db50=_0x479ff4[_0x221cf6][_0x33a6('0x6d')]?_0x4a4489[_0x479ff4[_0x221cf6][_0x33a6('0x6d')]][_0x33a6('0x6e')]:_0x479ff4[_0x221cf6][_0x33a6('0x6f')];_0x53db50=_0x479ff4[_0x221cf6][_0x33a6('0x70')]?_[_0x33a6('0x71')](_0x766134[_0x479ff4[_0x221cf6][_0x33a6('0x70')]],'%s',_0x53db50):_0x53db50;_0x53db50=_0x479ff4[_0x221cf6][_0x33a6('0x72')]?_[_0x33a6('0x71')](_0x2ac3ba[_0x479ff4[_0x221cf6][_0x33a6('0x72')]],'%s',_0x53db50):_0x53db50;if(_0x479ff4[_0x221cf6]['groupBy']){_0x3c7f36[_0x33a6('0x65')](_0x53db50);}_0x479ff4[_0x221cf6][_0x33a6('0x73')]&&_0x3c7f36[_0x33a6('0x39')](_0x53db50,_0x479ff4[_0x221cf6][_0x33a6('0x73')]===_0x33a6('0x74')?![]:!![]);_0x3c7f36['field'](_0x53db50,_0x479ff4[_0x221cf6][_0x33a6('0x75')]||_0x53db50);}if(_0x55ab84[_0x33a6('0x76')]){_0x55ab84[_0x33a6('0x76')]=JSON['parse'](_0x55ab84[_0x33a6('0x76')]);for(var _0x27ef0d=0x0;_0x27ef0d<_0x55ab84['joins'][_0x33a6('0x37')];_0x27ef0d+=0x1){if(_0x55ab84[_0x33a6('0x76')][_0x27ef0d]['type']&&_[_0x33a6('0x60')](_0x5e73d1,_0x55ab84[_0x33a6('0x76')][_0x27ef0d]['type'])&&_0x55ab84[_0x33a6('0x76')][_0x27ef0d]['parentKey']&&_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x77')]&&_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x78')]){_0x3c7f36[_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x2f')]](_0x55ab84[_0x33a6('0x76')][_0x27ef0d]['foreignTable'],null,util[_0x33a6('0x72')](_0x33a6('0x79'),_0x55ab84[_0x33a6('0x6c')],_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x7a')],_0x55ab84[_0x33a6('0x76')][_0x27ef0d][_0x33a6('0x77')],_0x55ab84['joins'][_0x27ef0d]['foreignKey']));}}}if(_0x55ab84[_0x33a6('0x7b')]){_0x55ab84['conditions']=JSON[_0x33a6('0x7c')](_0x55ab84[_0x33a6('0x7b')]);_0x3c7f36[_0x33a6('0x3b')](_0x4b5c80(_0x55ab84['conditions']['group']));}_0x4d497f=_0x3c7f36[_0x33a6('0x7d')]();_0x3c7f36[_0x33a6('0x1c')](_0x3f9388);_0x3c7f36['offset'](0x0);logger['debug'](_0x33a6('0x7e'),_0x3c7f36[_0x33a6('0x7f')]());return dbH['sequelize'][_0x33a6('0x31')](_0x3c7f36[_0x33a6('0x7f')](),{'type':dbH['sequelize'][_0x33a6('0x80')][_0x33a6('0x81')]});}})[_0x33a6('0x23')](respondWithResult(_0x5d6c39,null))[_0x33a6('0x45')](handleError(_0x5d6c39,null));};function runReport(_0x1a381b,_0x2ee519,_0x11a5e6){var _0x1c2a38=_0x2ee519[_0x33a6('0x28')];var _0x18d0cb=0xa;var _0x32deb0=['join',_0x33a6('0x55'),'right_join',_0x33a6('0x56')];var _0x26d524={'SUM':_0x33a6('0x57'),'COUNT':_0x33a6('0x58'),'COUNT DISTINCT':_0x33a6('0x59'),'MAX':_0x33a6('0x82'),'MIN':'MIN(%s)','AVG':_0x33a6('0x5a'),'GROUP_CONCAT':_0x33a6('0x5b'),'GROUP_CONCAT ASC':_0x33a6('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5c49da={'SEC_TO_TIME':_0x33a6('0x83'),'DATE':_0x33a6('0x84'),'HOUR':_0x33a6('0x5e'),'ROUND':_0x33a6('0x5f'),'UNIX_TIMESTAMP':_0x33a6('0x85')};var _0x279802=function(_0x19cb91){return!_[_0x33a6('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x33a6('0x86'),_0x33a6('0x87')],_0x19cb91);};var _0x5565fc=function(_0x221b64){if(!_0x221b64||!_0x221b64[_0x33a6('0x63')]['length']){return'';}for(var _0x4b01f0='(',_0x574f7e=0x0;_0x574f7e<_0x221b64['rules']['length'];_0x574f7e+=0x1){_0x574f7e>0x0&&(_0x4b01f0+='\x20'+_0x221b64['operator']+'\x20');_0x4b01f0+=_0x221b64['rules'][_0x574f7e]['group']?_0x5565fc(_0x221b64[_0x33a6('0x63')][_0x574f7e][_0x33a6('0x65')]):_0x221b64[_0x33a6('0x63')][_0x574f7e]['field']+'\x20'+_0x221b64[_0x33a6('0x63')][_0x574f7e][_0x33a6('0x66')]+(_0x279802(_0x221b64[_0x33a6('0x63')][_0x574f7e][_0x33a6('0x66')])?'\x20'+_0x221b64[_0x33a6('0x63')][_0x574f7e][_0x33a6('0x67')]:'');}return _0x4b01f0+')';};var _0x5bbbfa={'where':{'id':_0x1a381b['id']}},_0x1a5ace,_0x342694,_0x5b7f77,_0x50878b,_0x3f3582;_0x5bbbfa=_[_0x33a6('0x3e')]({},_0x5bbbfa,_0x11a5e6);return db[_0x33a6('0x2c')][_0x33a6('0x49')](_0x5bbbfa)[_0x33a6('0x23')](function(_0x47c4c5){if(_0x47c4c5){_0x1a5ace=_0x47c4c5;return _0x47c4c5[_0x33a6('0x88')]();}return null;})[_0x33a6('0x23')](function(_0x2aa3c0){if(_0x2aa3c0){if(!_0x2aa3c0[_0x33a6('0x37')]){throw new db[(_0x33a6('0x89'))][(_0x33a6('0x68'))](_0x33a6('0x8a'),0x193);}_0x342694=_0x2aa3c0;return db[_0x33a6('0x8b')][_0x33a6('0x43')]({'raw':!![]});}return null;})[_0x33a6('0x23')](function(_0x219c39){if(_0x219c39){_0x5b7f77=_[_0x33a6('0x69')](_0x219c39,'id');var _0x381f1f;var _0x284ba5=squel[_0x33a6('0x6a')]();_0x284ba5[_0x33a6('0x6b')](_0x1a5ace[_0x33a6('0x6c')]);for(var _0x5217bf=0x0;_0x5217bf<_0x342694['length'];_0x5217bf+=0x1){_0x381f1f=_0x342694[_0x5217bf][_0x33a6('0x6d')]?_0x5b7f77[_0x342694[_0x5217bf]['MetricId']][_0x33a6('0x6e')]:_0x342694[_0x5217bf][_0x33a6('0x6f')];_0x381f1f=_0x342694[_0x5217bf]['function']?_[_0x33a6('0x71')](_0x26d524[_0x342694[_0x5217bf][_0x33a6('0x70')]],'%s',_0x381f1f):_0x381f1f;_0x381f1f=_0x342694[_0x5217bf]['format']?_['replace'](_0x5c49da[_0x342694[_0x5217bf][_0x33a6('0x72')]],'%s',_0x381f1f):_0x381f1f;if(_0x342694[_0x5217bf][_0x33a6('0x8c')]){_0x284ba5[_0x33a6('0x65')](_0x381f1f);}_0x342694[_0x5217bf][_0x33a6('0x73')]&&_0x284ba5['order'](_0x381f1f,_0x342694[_0x5217bf][_0x33a6('0x73')]===_0x33a6('0x74')?![]:!![]);_0x284ba5['field'](_0x381f1f,_0x342694[_0x5217bf][_0x33a6('0x75')]||_0x381f1f);}if(_0x1a5ace[_0x33a6('0x76')]){_0x1a5ace[_0x33a6('0x76')]=JSON[_0x33a6('0x7c')](_0x1a5ace[_0x33a6('0x76')]);for(var _0x575a2f=0x0;_0x575a2f<_0x1a5ace['joins']['length'];_0x575a2f+=0x1){if(_0x1a5ace['joins'][_0x575a2f]['type']&&_[_0x33a6('0x60')](_0x32deb0,_0x1a5ace[_0x33a6('0x76')][_0x575a2f]['type'])&&_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x7a')]&&_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x77')]&&_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x78')]){_0x284ba5[_0x1a5ace[_0x33a6('0x76')][_0x575a2f]['type']](_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x77')],null,util[_0x33a6('0x72')](_0x33a6('0x79'),_0x1a5ace['table'],_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x7a')],_0x1a5ace[_0x33a6('0x76')][_0x575a2f][_0x33a6('0x77')],_0x1a5ace[_0x33a6('0x76')][_0x575a2f]['foreignKey']));}}}if(_0x1a5ace['conditions']){_0x1a5ace[_0x33a6('0x7b')]=JSON[_0x33a6('0x7c')](_0x1a5ace['conditions']);_0x284ba5[_0x33a6('0x3b')](_0x5565fc(_0x1a5ace[_0x33a6('0x7b')][_0x33a6('0x65')]));}_0x3f3582=_0x284ba5[_0x33a6('0x7d')]();_0x284ba5[_0x33a6('0x1c')](_0x18d0cb);_0x284ba5[_0x33a6('0x1a')](0x0);return;}})['then'](function(){if(_0x2ee519['output']==='web'){return null;}var _0x321a13=_[_0x33a6('0x3e')](_0x2ee519,{'name':_0x2ee519['fullPath']||_0x2ee519['name']||_0x1a5ace[_0x33a6('0x28')],'basename':_0x1c2a38,'savename':util[_0x33a6('0x72')](_0x33a6('0x8d'),_0x2ee519['name']||_0x1a5ace[_0x33a6('0x28')],require(_0x33a6('0x8e'))[_0x33a6('0x8f')](0x4),_0x2ee519[_0x33a6('0x90')]||_0x33a6('0x91')),'reportId':_0x1a5ace['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x33a6('0x4a')](_0x321a13,{'raw':!![]});})[_0x33a6('0x23')](function(_0x455f37){if(_0x1a5ace[_0x33a6('0x6c')]==='cdr'){_0x3f3582['where'](_0x1a5ace[_0x33a6('0x6c')]+_0x33a6('0x92'),_0x2ee519[_0x33a6('0x93')],_0x2ee519['endDate']);}else{_0x3f3582['where'](_0x1a5ace[_0x33a6('0x6c')]+_0x33a6('0x94'),_0x2ee519['startDate'],_0x2ee519[_0x33a6('0x95')]);}if(_0x455f37){logger[_0x33a6('0x96')](_0x33a6('0x97'),_0x3f3582[_0x33a6('0x7f')]());require(_0x33a6('0x98'))[_0x33a6('0x99')](path[_0x33a6('0x9a')](__dirname,_0x33a6('0x9b'),_0x455f37[_0x33a6('0x90')]),[_0x455f37['id'],_0x3f3582['toString'](),path['join'](__dirname,_0x33a6('0x9c'),_0x455f37[_0x33a6('0x9d')]),_0x1c2a38]);return _0x455f37;}else{var _0x5482e0=squel[_0x33a6('0x6a')]();_0x5482e0['from']('('+_0x3f3582[_0x33a6('0x7f')]()+')','countTable');_0x5482e0[_0x33a6('0x6f')]('COUNT(*)',_0x33a6('0x1d'));_0x3f3582[_0x33a6('0x1c')](_0x2ee519[_0x33a6('0x1c')]||_0x18d0cb);_0x3f3582[_0x33a6('0x1a')](_0x2ee519[_0x33a6('0x1a')]||0x0);return dbH['sequelize'][_0x33a6('0x31')](_0x5482e0['toString'](),{'type':dbH[_0x33a6('0x9e')][_0x33a6('0x80')]['SELECT']})[_0x33a6('0x23')](function(_0x3e51be){if(!_0x3e51be['length']){_0x50878b=0x0;}else{_0x50878b=_0x3e51be[0x0]['count']||0x0;}return dbH['sequelize'][_0x33a6('0x31')](_0x3f3582[_0x33a6('0x7f')](),{'type':dbH[_0x33a6('0x9e')][_0x33a6('0x80')]['SELECT']});})[_0x33a6('0x23')](function(_0x2527f2){return{'rows':_0x2527f2||[],'count':_0x50878b};});}});}exports['run']=function(_0x5ab24c,_0x52ce28){return runReport(_0x5ab24c[_0x33a6('0x47')],_0x5ab24c[_0x33a6('0x31')],_0x5ab24c['options'])[_0x33a6('0x23')](respondWithResult(_0x52ce28,null))[_0x33a6('0x45')](handleError(_0x52ce28,null));};exports[_0x33a6('0x9f')]=runReport;exports[_0x33a6('0x31')]=function(_0x4e7196,_0x3ce7e3){var _0x11756d=0xa;var _0x4fd9c2=[_0x33a6('0x9a'),_0x33a6('0x55'),_0x33a6('0xa0'),_0x33a6('0x56')];var _0x2b72ca={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x33a6('0x5a'),'GROUP_CONCAT':_0x33a6('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x33a6('0x5d')};var _0x445984={'SEC_TO_TIME':_0x33a6('0x83'),'DATE':_0x33a6('0x84'),'HOUR':'HOUR(%s)','ROUND':_0x33a6('0x5f'),'UNIX_TIMESTAMP':_0x33a6('0x85')};var _0x4e9ac5=function(_0x2d3877){return!_[_0x33a6('0x60')]([_0x33a6('0x61'),'IS\x20NOT\x20NULL',_0x33a6('0x86'),_0x33a6('0x87')],_0x2d3877);};var _0x51e3d7=function(_0x21bb0e){if(!_0x21bb0e||!_0x21bb0e[_0x33a6('0x63')][_0x33a6('0x37')]){return'';}for(var _0x184ccb='(',_0x359632=0x0;_0x359632<_0x21bb0e[_0x33a6('0x63')]['length'];_0x359632+=0x1){_0x359632>0x0&&(_0x184ccb+='\x20'+_0x21bb0e[_0x33a6('0x64')]+'\x20');_0x184ccb+=_0x21bb0e['rules'][_0x359632][_0x33a6('0x65')]?_0x51e3d7(_0x21bb0e[_0x33a6('0x63')][_0x359632]['group']):_0x21bb0e[_0x33a6('0x63')][_0x359632][_0x33a6('0x6f')]+'\x20'+_0x21bb0e[_0x33a6('0x63')][_0x359632]['condition']+(_0x4e9ac5(_0x21bb0e[_0x33a6('0x63')][_0x359632][_0x33a6('0x66')])?'\x20'+_0x21bb0e['rules'][_0x359632][_0x33a6('0x67')]:'');}return _0x184ccb+')';};var _0x60dc1d={'where':{'id':_0x4e7196['params']['id']}},_0x44a76b,_0xd6312e,_0x3cc5ac,_0x57276b,_0x47315c;_0x60dc1d=_['merge']({},_0x60dc1d,_0x4e7196['options']);return db[_0x33a6('0x2c')][_0x33a6('0x49')](_0x60dc1d)[_0x33a6('0x23')](function(_0x22e13c){if(_0x22e13c){_0x44a76b=_0x22e13c;return _0x22e13c[_0x33a6('0x88')]();}return null;})['then'](function(_0x19672c){if(_0x19672c){if(!_0x19672c[_0x33a6('0x37')]){throw new db['Sequelize'][(_0x33a6('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xd6312e=_0x19672c;return db[_0x33a6('0x8b')][_0x33a6('0x43')]({'raw':!![]});}return null;})[_0x33a6('0x23')](function(_0x290e3b){if(_0x290e3b){_0x3cc5ac=_['keyBy'](_0x290e3b,'id');var _0x5f4825;var _0x27604c=squel[_0x33a6('0x6a')]();_0x27604c[_0x33a6('0x6b')](_0x44a76b[_0x33a6('0x6c')]);for(var _0x36c6de=0x0;_0x36c6de<_0xd6312e[_0x33a6('0x37')];_0x36c6de+=0x1){_0x5f4825=_0xd6312e[_0x36c6de][_0x33a6('0x6d')]?_0x3cc5ac[_0xd6312e[_0x36c6de]['MetricId']][_0x33a6('0x6e')]:_0xd6312e[_0x36c6de][_0x33a6('0x6f')];_0x5f4825=_0xd6312e[_0x36c6de][_0x33a6('0x70')]?_[_0x33a6('0x71')](_0x2b72ca[_0xd6312e[_0x36c6de][_0x33a6('0x70')]],'%s',_0x5f4825):_0x5f4825;_0x5f4825=_0xd6312e[_0x36c6de]['format']?_[_0x33a6('0x71')](_0x445984[_0xd6312e[_0x36c6de]['format']],'%s',_0x5f4825):_0x5f4825;if(_0xd6312e[_0x36c6de]['groupBy']){_0x27604c[_0x33a6('0x65')](_0x5f4825);}_0xd6312e[_0x36c6de][_0x33a6('0x73')]&&_0x27604c[_0x33a6('0x39')](_0x5f4825,_0xd6312e[_0x36c6de][_0x33a6('0x73')]===_0x33a6('0x74')?![]:!![]);_0x27604c['field'](_0x5f4825,_0xd6312e[_0x36c6de][_0x33a6('0x75')]||_0x5f4825);}if(_0x44a76b['joins']){_0x44a76b[_0x33a6('0x76')]=JSON[_0x33a6('0x7c')](_0x44a76b['joins']);for(var _0x328ff9=0x0;_0x328ff9<_0x44a76b[_0x33a6('0x76')][_0x33a6('0x37')];_0x328ff9+=0x1){if(_0x44a76b[_0x33a6('0x76')][_0x328ff9][_0x33a6('0x2f')]&&_[_0x33a6('0x60')](_0x4fd9c2,_0x44a76b[_0x33a6('0x76')][_0x328ff9][_0x33a6('0x2f')])&&_0x44a76b[_0x33a6('0x76')][_0x328ff9]['parentKey']&&_0x44a76b[_0x33a6('0x76')][_0x328ff9][_0x33a6('0x77')]&&_0x44a76b[_0x33a6('0x76')][_0x328ff9][_0x33a6('0x78')]){_0x27604c[_0x44a76b['joins'][_0x328ff9][_0x33a6('0x2f')]](_0x44a76b[_0x33a6('0x76')][_0x328ff9]['foreignTable'],null,util[_0x33a6('0x72')](_0x33a6('0x79'),_0x44a76b[_0x33a6('0x6c')],_0x44a76b[_0x33a6('0x76')][_0x328ff9]['parentKey'],_0x44a76b['joins'][_0x328ff9]['foreignTable'],_0x44a76b[_0x33a6('0x76')][_0x328ff9]['foreignKey']));}}}if(_0x44a76b['conditions']){_0x44a76b[_0x33a6('0x7b')]=JSON['parse'](_0x44a76b[_0x33a6('0x7b')]);_0x27604c[_0x33a6('0x3b')](_0x51e3d7(_0x44a76b['conditions'][_0x33a6('0x65')]));}_0x47315c=_0x27604c[_0x33a6('0x7d')]();_0x27604c['limit'](_0x11756d);_0x27604c[_0x33a6('0x1a')](0x0);logger[_0x33a6('0xa1')](_0x33a6('0x7e'),_0x27604c['toString']());return dbH[_0x33a6('0x9e')][_0x33a6('0x31')](_0x27604c[_0x33a6('0x7f')](),{'type':dbH[_0x33a6('0x9e')]['QueryTypes']['SELECT']});}})[_0x33a6('0x23')](function(){return{'sql':_0x47315c['toString']()};})[_0x33a6('0x23')](respondWithResult(_0x3ce7e3,null))[_0x33a6('0x45')](handleError(_0x3ce7e3,null));};
\ No newline at end of file
+var _0xd89e=['QueryTypes','join','right_join','SUM(%s)','COUNT(%s)','IS\x20NOT\x20NULL','operator','Sequelize','from','DESC','web','fullPath','output','csv','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','toString','../../files/reports','savename','countTable','SELECT','run','runReport','Limited\x20Query:','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','VIRTUAL','filter','merge','include','AnalyticCustomReport','findAll','rows','show','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','options','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','sequelize'];(function(_0x1f2b1f,_0x55f153){var _0x1779e3=function(_0x5967be){while(--_0x5967be){_0x1f2b1f['push'](_0x1f2b1f['shift']());}};_0x1779e3(++_0x55f153);}(_0xd89e,0x16b));var _0xed89=function(_0x5bdd6d,_0x10b58e){_0x5bdd6d=_0x5bdd6d-0x0;var _0x293bcc=_0xd89e[_0x5bdd6d];return _0x293bcc;};'use strict';var emlformat=require(_0xed89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xed89('0x1'));var rp=require(_0xed89('0x2'));var moment=require(_0xed89('0x3'));var BPromise=require(_0xed89('0x4'));var Mustache=require(_0xed89('0x5'));var util=require(_0xed89('0x6'));var path=require(_0xed89('0x7'));var sox=require(_0xed89('0x8'));var csv=require(_0xed89('0x9'));var ejs=require(_0xed89('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed89('0xb'));var squel=require(_0xed89('0xc'));var crypto=require(_0xed89('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed89('0xe'));var Papa=require(_0xed89('0xf'));var Redis=require(_0xed89('0x10'));var authService=require(_0xed89('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xed89('0x12'));var hardwareService=require(_0xed89('0x13'));var logger=require(_0xed89('0x14'))(_0xed89('0x15'));var utils=require(_0xed89('0x16'));var config=require(_0xed89('0x17'));var licenseUtil=require(_0xed89('0x18'));var db=require(_0xed89('0x19'))['db'];var dbH=require(_0xed89('0x19'))[_0xed89('0x1a')];function respondWithStatusCode(_0x13d369,_0x46b197){_0x46b197=_0x46b197||0xcc;return function(_0xb10a14){if(_0xb10a14){return _0x13d369[_0xed89('0x1b')](_0x46b197);}return _0x13d369[_0xed89('0x1c')](_0x46b197)['end']();};}function respondWithResult(_0x182dbd,_0x229d6a){_0x229d6a=_0x229d6a||0xc8;return function(_0x5401cb){if(_0x5401cb){return _0x182dbd['status'](_0x229d6a)['json'](_0x5401cb);}};}function respondWithFilteredResult(_0x2545ca,_0x329e6a){return function(_0x35d724){if(_0x35d724){var _0x288531=typeof _0x329e6a['offset']===_0xed89('0x1d')&&typeof _0x329e6a[_0xed89('0x1e')]===_0xed89('0x1d');var _0xb5b127=_0x35d724['count'];var _0x6d9ce2=_0x288531?0x0:_0x329e6a['offset'];var _0x1d89a2=_0x288531?_0x35d724[_0xed89('0x1f')]:_0x329e6a['offset']+_0x329e6a[_0xed89('0x1e')];var _0x5ec113;if(_0x1d89a2>=_0xb5b127){_0x1d89a2=_0xb5b127;_0x5ec113=0xc8;}else{_0x5ec113=0xce;}_0x2545ca[_0xed89('0x1c')](_0x5ec113);return _0x2545ca['set'](_0xed89('0x20'),_0x6d9ce2+'-'+_0x1d89a2+'/'+_0xb5b127)[_0xed89('0x21')](_0x35d724);}return null;};}function patchUpdates(_0x2baf03){return function(_0x51960a){try{jsonpatch['apply'](_0x51960a,_0x2baf03,!![]);}catch(_0x234b2b){return BPromise[_0xed89('0x22')](_0x234b2b);}return _0x51960a[_0xed89('0x23')]();};}function saveUpdates(_0x436235,_0x4ddf30){return function(_0x3de755){if(_0x3de755){return _0x3de755[_0xed89('0x24')](_0x436235)[_0xed89('0x25')](function(_0x8b8c78){return _0x8b8c78;});}return null;};}function removeEntity(_0x490d54,_0x1db0b6){return function(_0x5a810a){if(_0x5a810a){return _0x5a810a[_0xed89('0x26')]()['then'](function(){var _0x228d8f=_0x5a810a[_0xed89('0x27')]({'plain':!![]});var _0x8209c8=_0xed89('0x28');return db[_0xed89('0x29')][_0xed89('0x26')]({'where':{'type':_0x8209c8,'resourceId':_0x228d8f['id']}})[_0xed89('0x25')](function(){return _0x5a810a;});})[_0xed89('0x25')](function(){_0x490d54[_0xed89('0x1c')](0xcc)[_0xed89('0x2a')]();});}};}function handleEntityNotFound(_0xab9e8c,_0x2fea04){return function(_0x3dfff9){if(!_0x3dfff9){_0xab9e8c['sendStatus'](0x194);}return _0x3dfff9;};}function handleError(_0x31f087,_0x1c17f5){_0x1c17f5=_0x1c17f5||0x1f4;return function(_0x282854){logger[_0xed89('0x2b')](_0x282854[_0xed89('0x2c')]);if(_0x282854[_0xed89('0x2d')]){delete _0x282854[_0xed89('0x2d')];}_0x31f087[_0xed89('0x1c')](_0x1c17f5)[_0xed89('0x2e')](_0x282854);};}exports[_0xed89('0x2f')]=function(_0x4b1612,_0x4943d7){var _0x27ba66={},_0x3fded5={},_0x4e8145={'count':0x0,'rows':[]};var _0x5c3afc=_[_0xed89('0x30')](db['AnalyticCustomReport'][_0xed89('0x31')],function(_0x2ad17e){return{'name':_0x2ad17e[_0xed89('0x32')],'type':_0x2ad17e[_0xed89('0x33')]['key']};});_0x3fded5[_0xed89('0x34')]=_[_0xed89('0x30')](_0x5c3afc,_0xed89('0x2d'));_0x3fded5[_0xed89('0x35')]=_[_0xed89('0x36')](_0x4b1612[_0xed89('0x35')]);_0x3fded5[_0xed89('0x37')]=_[_0xed89('0x38')](_0x3fded5['model'],_0x3fded5[_0xed89('0x35')]);_0x27ba66['attributes']=_[_0xed89('0x38')](_0x3fded5[_0xed89('0x34')],qs[_0xed89('0x39')](_0x4b1612[_0xed89('0x35')]['fields']));_0x27ba66[_0xed89('0x3a')]=_0x27ba66[_0xed89('0x3a')]['length']?_0x27ba66[_0xed89('0x3a')]:_0x3fded5[_0xed89('0x34')];if(!_0x4b1612[_0xed89('0x35')][_0xed89('0x3b')](_0xed89('0x3c'))){_0x27ba66[_0xed89('0x1e')]=qs[_0xed89('0x1e')](_0x4b1612[_0xed89('0x35')][_0xed89('0x1e')]);_0x27ba66[_0xed89('0x3d')]=qs['offset'](_0x4b1612['query'][_0xed89('0x3d')]);}_0x27ba66[_0xed89('0x3e')]=qs['sort'](_0x4b1612[_0xed89('0x35')][_0xed89('0x3f')]);_0x27ba66[_0xed89('0x40')]=qs[_0xed89('0x37')](_[_0xed89('0x41')](_0x4b1612[_0xed89('0x35')],_0x3fded5['filters']),_0x5c3afc);if(_0x4b1612[_0xed89('0x35')]['filter']){_0x27ba66[_0xed89('0x40')]=_['merge'](_0x27ba66[_0xed89('0x40')],{'$or':_[_0xed89('0x30')](_0x5c3afc,function(_0x483a8f){if(_0x483a8f[_0xed89('0x33')]!==_0xed89('0x42')){var _0x1c43f4={};_0x1c43f4[_0x483a8f[_0xed89('0x2d')]]={'$like':'%'+_0x4b1612[_0xed89('0x35')][_0xed89('0x43')]+'%'};return _0x1c43f4;}})});}_0x27ba66=_[_0xed89('0x44')]({},_0x27ba66,_0x4b1612['options']);var _0x1a2174={'where':_0x27ba66[_0xed89('0x40')]};return db['AnalyticCustomReport'][_0xed89('0x1f')](_0x1a2174)[_0xed89('0x25')](function(_0x4456ab){_0x4e8145['count']=_0x4456ab;if(_0x4b1612[_0xed89('0x35')]['includeAll']){_0x27ba66[_0xed89('0x45')]=[{'all':!![]}];}return db[_0xed89('0x46')][_0xed89('0x47')](_0x27ba66);})[_0xed89('0x25')](function(_0xbd449c){_0x4e8145[_0xed89('0x48')]=_0xbd449c;return _0x4e8145;})[_0xed89('0x25')](respondWithFilteredResult(_0x4943d7,_0x27ba66))['catch'](handleError(_0x4943d7,null));};exports[_0xed89('0x49')]=function(_0x270f56,_0x205ed9){var _0x3113e8={'raw':![],'where':{'id':_0x270f56['params']['id']}},_0x464bef={};_0x464bef['model']=_[_0xed89('0x36')](db['AnalyticCustomReport']['rawAttributes']);_0x464bef[_0xed89('0x35')]=_[_0xed89('0x36')](_0x270f56[_0xed89('0x35')]);_0x464bef['filters']=_['intersection'](_0x464bef[_0xed89('0x34')],_0x464bef[_0xed89('0x35')]);_0x3113e8['attributes']=_[_0xed89('0x38')](_0x464bef[_0xed89('0x34')],qs[_0xed89('0x39')](_0x270f56['query'][_0xed89('0x39')]));_0x3113e8[_0xed89('0x3a')]=_0x3113e8[_0xed89('0x3a')][_0xed89('0x4a')]?_0x3113e8[_0xed89('0x3a')]:_0x464bef[_0xed89('0x34')];if(_0x270f56[_0xed89('0x35')][_0xed89('0x4b')]){_0x3113e8[_0xed89('0x45')]=[{'all':!![]}];}_0x3113e8=_['merge']({},_0x3113e8,_0x270f56['options']);return db['AnalyticCustomReport'][_0xed89('0x4c')](_0x3113e8)['then'](handleEntityNotFound(_0x205ed9,null))['then'](respondWithResult(_0x205ed9,null))[_0xed89('0x4d')](handleError(_0x205ed9,null));};exports[_0xed89('0x4e')]=function(_0x5e8c49,_0x2b510f){return db[_0xed89('0x46')][_0xed89('0x4e')](_0x5e8c49[_0xed89('0x4f')],{})['then'](function(_0x448689){var _0xb62c0=_0x5e8c49['user'][_0xed89('0x27')]({'plain':!![]});if(!_0xb62c0)throw new Error(_0xed89('0x50'));if(_0xb62c0['role']===_0xed89('0x51')){var _0xbca6fc=_0x448689[_0xed89('0x27')]({'plain':!![]});var _0x5a1562='Reports';return db[_0xed89('0x52')][_0xed89('0x4c')]({'where':{'name':_0x5a1562,'userProfileId':_0xb62c0[_0xed89('0x53')]},'raw':!![]})['then'](function(_0x3029c1){if(_0x3029c1&&_0x3029c1['autoAssociation']===0x0){return db[_0xed89('0x29')][_0xed89('0x4e')]({'name':_0xbca6fc[_0xed89('0x2d')],'resourceId':_0xbca6fc['id'],'type':'CustomReports','sectionId':_0x3029c1['id']},{})[_0xed89('0x25')](function(){return _0x448689;});}else{return _0x448689;}})['catch'](function(_0x4f638d){logger[_0xed89('0x2b')](_0xed89('0x54'),_0x4f638d);throw _0x4f638d;});}return _0x448689;})[_0xed89('0x25')](respondWithResult(_0x2b510f,0xc9))[_0xed89('0x4d')](handleError(_0x2b510f,null));};exports[_0xed89('0x24')]=function(_0x49a952,_0xc87397){if(_0x49a952[_0xed89('0x4f')]['id']){delete _0x49a952[_0xed89('0x4f')]['id'];}return db[_0xed89('0x46')][_0xed89('0x4c')]({'where':{'id':_0x49a952[_0xed89('0x55')]['id']}})['then'](handleEntityNotFound(_0xc87397,null))['then'](saveUpdates(_0x49a952[_0xed89('0x4f')],null))[_0xed89('0x25')](respondWithResult(_0xc87397,null))['catch'](handleError(_0xc87397,null));};exports['destroy']=function(_0x50e204,_0x224dae){return db[_0xed89('0x46')][_0xed89('0x4c')]({'where':{'id':_0x50e204[_0xed89('0x55')]['id']}})[_0xed89('0x25')](handleEntityNotFound(_0x224dae,null))[_0xed89('0x25')](removeEntity(_0x224dae,null))[_0xed89('0x4d')](handleError(_0x224dae,null));};exports[_0xed89('0x56')]=function(_0x200d3a,_0x5d90b8){var _0x291804=0xa;var _0x2dd728=['join',_0xed89('0x57'),'right_join',_0xed89('0x58')];var _0x2b15cc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xed89('0x59'),'MAX':_0xed89('0x5a'),'MIN':_0xed89('0x5b'),'AVG':_0xed89('0x5c'),'GROUP_CONCAT':_0xed89('0x5d'),'GROUP_CONCAT ASC':_0xed89('0x5e'),'GROUP_CONCAT DESC':_0xed89('0x5f')};var _0x309a91={'SEC_TO_TIME':_0xed89('0x60'),'DATE':_0xed89('0x61'),'HOUR':_0xed89('0x62'),'ROUND':_0xed89('0x63'),'UNIX_TIMESTAMP':_0xed89('0x64')};var _0x132727=function(_0x3f0e5f){return!_[_0xed89('0x65')]([_0xed89('0x66'),'IS\x20NOT\x20NULL',_0xed89('0x67'),_0xed89('0x68')],_0x3f0e5f);};var _0x41de04=function(_0x56c5ec){if(!_0x56c5ec||!_0x56c5ec[_0xed89('0x69')][_0xed89('0x4a')]){return'';}for(var _0x2cd0a3='(',_0x25ce08=0x0;_0x25ce08<_0x56c5ec[_0xed89('0x69')][_0xed89('0x4a')];_0x25ce08+=0x1){_0x25ce08>0x0&&(_0x2cd0a3+='\x20'+_0x56c5ec['operator']+'\x20');_0x2cd0a3+=_0x56c5ec['rules'][_0x25ce08][_0xed89('0x6a')]?_0x41de04(_0x56c5ec[_0xed89('0x69')][_0x25ce08]['group']):_0x56c5ec['rules'][_0x25ce08][_0xed89('0x6b')]+'\x20'+_0x56c5ec[_0xed89('0x69')][_0x25ce08][_0xed89('0x6c')]+(_0x132727(_0x56c5ec['rules'][_0x25ce08]['condition'])?'\x20'+_0x56c5ec[_0xed89('0x69')][_0x25ce08][_0xed89('0x6d')]:'');}return _0x2cd0a3+')';};var _0x38e463={'where':{'id':_0x200d3a['params']['id']}},_0x2833f3,_0x50016e,_0x4589e8,_0x38b431,_0x1d1f8f;_0x38e463=_[_0xed89('0x44')]({},_0x38e463,_0x200d3a[_0xed89('0x6e')]);return db[_0xed89('0x46')][_0xed89('0x4c')](_0x38e463)['then'](function(_0x37d68c){if(_0x37d68c){_0x2833f3=_0x37d68c;return _0x37d68c[_0xed89('0x6f')]();}return null;})['then'](function(_0x2e9a03){if(_0x2e9a03){if(!_0x2e9a03[_0xed89('0x4a')]){throw new db['Sequelize'][(_0xed89('0x70'))](_0xed89('0x71'),0x193);}_0x50016e=_0x2e9a03;return db[_0xed89('0x72')][_0xed89('0x47')]({'raw':!![]});}return null;})[_0xed89('0x25')](function(_0x54b4e3){if(_0x54b4e3){_0x4589e8=_[_0xed89('0x73')](_0x54b4e3,'id');var _0x5ed3ae;var _0x776e23=squel[_0xed89('0x74')]();_0x776e23['from'](_0x2833f3[_0xed89('0x75')]);for(var _0x195df=0x0;_0x195df<_0x50016e['length'];_0x195df+=0x1){_0x5ed3ae=_0x50016e[_0x195df][_0xed89('0x76')]?_0x4589e8[_0x50016e[_0x195df][_0xed89('0x76')]][_0xed89('0x77')]:_0x50016e[_0x195df][_0xed89('0x6b')];_0x5ed3ae=_0x50016e[_0x195df][_0xed89('0x78')]?_[_0xed89('0x79')](_0x2b15cc[_0x50016e[_0x195df][_0xed89('0x78')]],'%s',_0x5ed3ae):_0x5ed3ae;_0x5ed3ae=_0x50016e[_0x195df][_0xed89('0x7a')]?_[_0xed89('0x79')](_0x309a91[_0x50016e[_0x195df][_0xed89('0x7a')]],'%s',_0x5ed3ae):_0x5ed3ae;if(_0x50016e[_0x195df]['groupBy']){_0x776e23[_0xed89('0x6a')](_0x5ed3ae);}_0x50016e[_0x195df][_0xed89('0x7b')]&&_0x776e23[_0xed89('0x3e')](_0x5ed3ae,_0x50016e[_0x195df][_0xed89('0x7b')]==='DESC'?![]:!![]);_0x776e23[_0xed89('0x6b')](_0x5ed3ae,_0x50016e[_0x195df][_0xed89('0x7c')]||_0x5ed3ae);}if(_0x2833f3[_0xed89('0x7d')]){_0x2833f3[_0xed89('0x7d')]=JSON['parse'](_0x2833f3['joins']);for(var _0x4ef6bd=0x0;_0x4ef6bd<_0x2833f3[_0xed89('0x7d')][_0xed89('0x4a')];_0x4ef6bd+=0x1){if(_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x33')]&&_[_0xed89('0x65')](_0x2dd728,_0x2833f3['joins'][_0x4ef6bd][_0xed89('0x33')])&&_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x7e')]&&_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x7f')]&&_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x80')]){_0x776e23[_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x33')]](_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x7f')],null,util[_0xed89('0x7a')](_0xed89('0x81'),_0x2833f3['table'],_0x2833f3[_0xed89('0x7d')][_0x4ef6bd][_0xed89('0x7e')],_0x2833f3['joins'][_0x4ef6bd][_0xed89('0x7f')],_0x2833f3[_0xed89('0x7d')][_0x4ef6bd]['foreignKey']));}}}if(_0x2833f3['conditions']){_0x2833f3[_0xed89('0x82')]=JSON[_0xed89('0x83')](_0x2833f3[_0xed89('0x82')]);_0x776e23[_0xed89('0x40')](_0x41de04(_0x2833f3['conditions'][_0xed89('0x6a')]));}_0x1d1f8f=_0x776e23[_0xed89('0x84')]();_0x776e23[_0xed89('0x1e')](_0x291804);_0x776e23['offset'](0x0);logger[_0xed89('0x85')]('Limited\x20Query:',_0x776e23['toString']());return dbH[_0xed89('0x86')][_0xed89('0x35')](_0x776e23['toString'](),{'type':dbH[_0xed89('0x86')][_0xed89('0x87')]['SELECT']});}})[_0xed89('0x25')](respondWithResult(_0x5d90b8,null))[_0xed89('0x4d')](handleError(_0x5d90b8,null));};function runReport(_0x475bd3,_0x45cc83,_0x28b048){var _0x1662c1=_0x45cc83[_0xed89('0x2d')];var _0x32361a=0xa;var _0x3d387d=[_0xed89('0x88'),_0xed89('0x57'),_0xed89('0x89'),_0xed89('0x58')];var _0xfdc145={'SUM':_0xed89('0x8a'),'COUNT':_0xed89('0x8b'),'COUNT DISTINCT':_0xed89('0x59'),'MAX':_0xed89('0x5a'),'MIN':'MIN(%s)','AVG':_0xed89('0x5c'),'GROUP_CONCAT':_0xed89('0x5d'),'GROUP_CONCAT ASC':_0xed89('0x5e'),'GROUP_CONCAT DESC':_0xed89('0x5f')};var _0x37a694={'SEC_TO_TIME':_0xed89('0x60'),'DATE':_0xed89('0x61'),'HOUR':_0xed89('0x62'),'ROUND':_0xed89('0x63'),'UNIX_TIMESTAMP':_0xed89('0x64')};var _0x1b067e=function(_0x3b3dea){return!_[_0xed89('0x65')]([_0xed89('0x66'),_0xed89('0x8c'),'IS\x20EMPTY',_0xed89('0x68')],_0x3b3dea);};var _0x142c72=function(_0x2001a5){if(!_0x2001a5||!_0x2001a5['rules'][_0xed89('0x4a')]){return'';}for(var _0xb4d706='(',_0x29b250=0x0;_0x29b250<_0x2001a5[_0xed89('0x69')]['length'];_0x29b250+=0x1){_0x29b250>0x0&&(_0xb4d706+='\x20'+_0x2001a5[_0xed89('0x8d')]+'\x20');_0xb4d706+=_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6a')]?_0x142c72(_0x2001a5[_0xed89('0x69')][_0x29b250]['group']):_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6b')]+'\x20'+_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6c')]+(_0x1b067e(_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6c')])?'\x20'+_0x2001a5[_0xed89('0x69')][_0x29b250][_0xed89('0x6d')]:'');}return _0xb4d706+')';};var _0x57a6bd={'where':{'id':_0x475bd3['id']}},_0x2bc5ff,_0x14b16d,_0x1d3357,_0x2ab35d,_0x57c417;_0x57a6bd=_['merge']({},_0x57a6bd,_0x28b048);return db[_0xed89('0x46')]['find'](_0x57a6bd)[_0xed89('0x25')](function(_0x5b6b60){if(_0x5b6b60){_0x2bc5ff=_0x5b6b60;return _0x5b6b60['getFields']();}return null;})[_0xed89('0x25')](function(_0x5c7ab4){if(_0x5c7ab4){if(!_0x5c7ab4[_0xed89('0x4a')]){throw new db[(_0xed89('0x8e'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x14b16d=_0x5c7ab4;return db[_0xed89('0x72')][_0xed89('0x47')]({'raw':!![]});}return null;})[_0xed89('0x25')](function(_0x16a956){if(_0x16a956){_0x1d3357=_[_0xed89('0x73')](_0x16a956,'id');var _0x148c49;var _0x5b6b0a=squel['select']();_0x5b6b0a[_0xed89('0x8f')](_0x2bc5ff[_0xed89('0x75')]);for(var _0x8ae587=0x0;_0x8ae587<_0x14b16d['length'];_0x8ae587+=0x1){_0x148c49=_0x14b16d[_0x8ae587][_0xed89('0x76')]?_0x1d3357[_0x14b16d[_0x8ae587][_0xed89('0x76')]][_0xed89('0x77')]:_0x14b16d[_0x8ae587][_0xed89('0x6b')];_0x148c49=_0x14b16d[_0x8ae587]['function']?_[_0xed89('0x79')](_0xfdc145[_0x14b16d[_0x8ae587][_0xed89('0x78')]],'%s',_0x148c49):_0x148c49;_0x148c49=_0x14b16d[_0x8ae587][_0xed89('0x7a')]?_[_0xed89('0x79')](_0x37a694[_0x14b16d[_0x8ae587][_0xed89('0x7a')]],'%s',_0x148c49):_0x148c49;if(_0x14b16d[_0x8ae587]['groupBy']){_0x5b6b0a[_0xed89('0x6a')](_0x148c49);}_0x14b16d[_0x8ae587][_0xed89('0x7b')]&&_0x5b6b0a[_0xed89('0x3e')](_0x148c49,_0x14b16d[_0x8ae587][_0xed89('0x7b')]===_0xed89('0x90')?![]:!![]);_0x5b6b0a[_0xed89('0x6b')](_0x148c49,_0x14b16d[_0x8ae587]['alias']||_0x148c49);}if(_0x2bc5ff[_0xed89('0x7d')]){_0x2bc5ff[_0xed89('0x7d')]=JSON['parse'](_0x2bc5ff['joins']);for(var _0x4ba22b=0x0;_0x4ba22b<_0x2bc5ff[_0xed89('0x7d')][_0xed89('0x4a')];_0x4ba22b+=0x1){if(_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x33')]&&_[_0xed89('0x65')](_0x3d387d,_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x33')])&&_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b]['parentKey']&&_0x2bc5ff['joins'][_0x4ba22b]['foreignTable']&&_0x2bc5ff['joins'][_0x4ba22b][_0xed89('0x80')]){_0x5b6b0a[_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x33')]](_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x7f')],null,util['format'](_0xed89('0x81'),_0x2bc5ff[_0xed89('0x75')],_0x2bc5ff['joins'][_0x4ba22b][_0xed89('0x7e')],_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b]['foreignTable'],_0x2bc5ff[_0xed89('0x7d')][_0x4ba22b][_0xed89('0x80')]));}}}if(_0x2bc5ff[_0xed89('0x82')]){_0x2bc5ff[_0xed89('0x82')]=JSON[_0xed89('0x83')](_0x2bc5ff['conditions']);_0x5b6b0a[_0xed89('0x40')](_0x142c72(_0x2bc5ff[_0xed89('0x82')][_0xed89('0x6a')]));}_0x57c417=_0x5b6b0a[_0xed89('0x84')]();_0x5b6b0a[_0xed89('0x1e')](_0x32361a);_0x5b6b0a[_0xed89('0x3d')](0x0);return;}})[_0xed89('0x25')](function(){if(_0x45cc83['output']===_0xed89('0x91')){return null;}var _0x5f3a35=_[_0xed89('0x44')](_0x45cc83,{'name':_0x45cc83[_0xed89('0x92')]||_0x45cc83[_0xed89('0x2d')]||_0x2bc5ff['name'],'basename':_0x1662c1,'savename':util[_0xed89('0x7a')]('%s-%s.%s',_0x45cc83['name']||_0x2bc5ff[_0xed89('0x2d')],require('randomstring')['generate'](0x4),_0x45cc83[_0xed89('0x93')]||_0xed89('0x94')),'reportId':_0x2bc5ff['id'],'reportType':'custom'});return db[_0xed89('0x95')]['create'](_0x5f3a35,{'raw':!![]});})[_0xed89('0x25')](function(_0x4e3da8){if(_0x2bc5ff[_0xed89('0x75')]===_0xed89('0x96')){_0x57c417[_0xed89('0x40')](_0x2bc5ff[_0xed89('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x45cc83['startDate'],_0x45cc83[_0xed89('0x97')]);}else{_0x57c417[_0xed89('0x40')](_0x2bc5ff[_0xed89('0x75')]+_0xed89('0x98'),_0x45cc83[_0xed89('0x99')],_0x45cc83['endDate']);}if(_0x4e3da8){logger[_0xed89('0x9a')]('Run\x20Query:',_0x57c417['toString']());require(_0xed89('0x9b'))[_0xed89('0x9c')](path[_0xed89('0x88')](__dirname,_0xed89('0x9d'),_0x4e3da8['output']),[_0x4e3da8['id'],_0x57c417[_0xed89('0x9e')](),path[_0xed89('0x88')](__dirname,_0xed89('0x9f'),_0x4e3da8[_0xed89('0xa0')]),_0x1662c1]);return _0x4e3da8;}else{var _0x1c1a62=squel['select']();_0x1c1a62['from']('('+_0x57c417[_0xed89('0x9e')]()+')',_0xed89('0xa1'));_0x1c1a62[_0xed89('0x6b')]('COUNT(*)','count');_0x57c417['limit'](_0x45cc83[_0xed89('0x1e')]||_0x32361a);_0x57c417[_0xed89('0x3d')](_0x45cc83[_0xed89('0x3d')]||0x0);return dbH[_0xed89('0x86')]['query'](_0x1c1a62[_0xed89('0x9e')](),{'type':dbH[_0xed89('0x86')][_0xed89('0x87')]['SELECT']})['then'](function(_0x3be272){if(!_0x3be272[_0xed89('0x4a')]){_0x2ab35d=0x0;}else{_0x2ab35d=_0x3be272[0x0][_0xed89('0x1f')]||0x0;}return dbH[_0xed89('0x86')][_0xed89('0x35')](_0x57c417[_0xed89('0x9e')](),{'type':dbH[_0xed89('0x86')][_0xed89('0x87')][_0xed89('0xa2')]});})[_0xed89('0x25')](function(_0x52c1fe){return{'rows':_0x52c1fe||[],'count':_0x2ab35d};});}});}exports[_0xed89('0xa3')]=function(_0x49c746,_0x2217a5){return runReport(_0x49c746[_0xed89('0x55')],_0x49c746['query'],_0x49c746[_0xed89('0x6e')])[_0xed89('0x25')](respondWithResult(_0x2217a5,null))['catch'](handleError(_0x2217a5,null));};exports[_0xed89('0xa4')]=runReport;exports[_0xed89('0x35')]=function(_0x6a53d8,_0x2a1661){var _0x352967=0xa;var _0x453663=[_0xed89('0x88'),_0xed89('0x57'),_0xed89('0x89'),_0xed89('0x58')];var _0x1cdf80={'SUM':'SUM(%s)','COUNT':_0xed89('0x8b'),'COUNT DISTINCT':_0xed89('0x59'),'MAX':_0xed89('0x5a'),'MIN':_0xed89('0x5b'),'AVG':_0xed89('0x5c'),'GROUP_CONCAT':_0xed89('0x5d'),'GROUP_CONCAT ASC':_0xed89('0x5e'),'GROUP_CONCAT DESC':_0xed89('0x5f')};var _0x165052={'SEC_TO_TIME':_0xed89('0x60'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xed89('0x63'),'UNIX_TIMESTAMP':_0xed89('0x64')};var _0xbc2c24=function(_0x127f12){return!_[_0xed89('0x65')]([_0xed89('0x66'),_0xed89('0x8c'),_0xed89('0x67'),_0xed89('0x68')],_0x127f12);};var _0x10e57b=function(_0x4bcec6){if(!_0x4bcec6||!_0x4bcec6[_0xed89('0x69')][_0xed89('0x4a')]){return'';}for(var _0x2aad1e='(',_0x262bbf=0x0;_0x262bbf<_0x4bcec6[_0xed89('0x69')][_0xed89('0x4a')];_0x262bbf+=0x1){_0x262bbf>0x0&&(_0x2aad1e+='\x20'+_0x4bcec6[_0xed89('0x8d')]+'\x20');_0x2aad1e+=_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6a')]?_0x10e57b(_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6a')]):_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6b')]+'\x20'+_0x4bcec6['rules'][_0x262bbf][_0xed89('0x6c')]+(_0xbc2c24(_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6c')])?'\x20'+_0x4bcec6[_0xed89('0x69')][_0x262bbf][_0xed89('0x6d')]:'');}return _0x2aad1e+')';};var _0x5d23ae={'where':{'id':_0x6a53d8[_0xed89('0x55')]['id']}},_0x247d1d,_0x603808,_0x4ee152,_0x1dd5c0,_0x387454;_0x5d23ae=_[_0xed89('0x44')]({},_0x5d23ae,_0x6a53d8[_0xed89('0x6e')]);return db['AnalyticCustomReport'][_0xed89('0x4c')](_0x5d23ae)['then'](function(_0xe82d60){if(_0xe82d60){_0x247d1d=_0xe82d60;return _0xe82d60['getFields']();}return null;})[_0xed89('0x25')](function(_0x29aa7f){if(_0x29aa7f){if(!_0x29aa7f[_0xed89('0x4a')]){throw new db[(_0xed89('0x8e'))][(_0xed89('0x70'))](_0xed89('0x71'),0x193);}_0x603808=_0x29aa7f;return db[_0xed89('0x72')][_0xed89('0x47')]({'raw':!![]});}return null;})[_0xed89('0x25')](function(_0x25423e){if(_0x25423e){_0x4ee152=_['keyBy'](_0x25423e,'id');var _0x14b907;var _0x9b5b3b=squel[_0xed89('0x74')]();_0x9b5b3b[_0xed89('0x8f')](_0x247d1d[_0xed89('0x75')]);for(var _0x3accc0=0x0;_0x3accc0<_0x603808[_0xed89('0x4a')];_0x3accc0+=0x1){_0x14b907=_0x603808[_0x3accc0][_0xed89('0x76')]?_0x4ee152[_0x603808[_0x3accc0][_0xed89('0x76')]][_0xed89('0x77')]:_0x603808[_0x3accc0]['field'];_0x14b907=_0x603808[_0x3accc0][_0xed89('0x78')]?_[_0xed89('0x79')](_0x1cdf80[_0x603808[_0x3accc0][_0xed89('0x78')]],'%s',_0x14b907):_0x14b907;_0x14b907=_0x603808[_0x3accc0][_0xed89('0x7a')]?_['replace'](_0x165052[_0x603808[_0x3accc0][_0xed89('0x7a')]],'%s',_0x14b907):_0x14b907;if(_0x603808[_0x3accc0]['groupBy']){_0x9b5b3b[_0xed89('0x6a')](_0x14b907);}_0x603808[_0x3accc0][_0xed89('0x7b')]&&_0x9b5b3b[_0xed89('0x3e')](_0x14b907,_0x603808[_0x3accc0]['orderBy']===_0xed89('0x90')?![]:!![]);_0x9b5b3b['field'](_0x14b907,_0x603808[_0x3accc0]['alias']||_0x14b907);}if(_0x247d1d[_0xed89('0x7d')]){_0x247d1d[_0xed89('0x7d')]=JSON[_0xed89('0x83')](_0x247d1d[_0xed89('0x7d')]);for(var _0xd48bd1=0x0;_0xd48bd1<_0x247d1d[_0xed89('0x7d')][_0xed89('0x4a')];_0xd48bd1+=0x1){if(_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x33')]&&_['includes'](_0x453663,_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x33')])&&_0x247d1d[_0xed89('0x7d')][_0xd48bd1]['parentKey']&&_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x7f')]&&_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x80')]){_0x9b5b3b[_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x33')]](_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x7f')],null,util[_0xed89('0x7a')](_0xed89('0x81'),_0x247d1d['table'],_0x247d1d['joins'][_0xd48bd1][_0xed89('0x7e')],_0x247d1d[_0xed89('0x7d')][_0xd48bd1][_0xed89('0x7f')],_0x247d1d[_0xed89('0x7d')][_0xd48bd1]['foreignKey']));}}}if(_0x247d1d[_0xed89('0x82')]){_0x247d1d[_0xed89('0x82')]=JSON[_0xed89('0x83')](_0x247d1d['conditions']);_0x9b5b3b[_0xed89('0x40')](_0x10e57b(_0x247d1d[_0xed89('0x82')]['group']));}_0x387454=_0x9b5b3b[_0xed89('0x84')]();_0x9b5b3b['limit'](_0x352967);_0x9b5b3b[_0xed89('0x3d')](0x0);logger['debug'](_0xed89('0xa5'),_0x9b5b3b[_0xed89('0x9e')]());return dbH[_0xed89('0x86')][_0xed89('0x35')](_0x9b5b3b[_0xed89('0x9e')](),{'type':dbH[_0xed89('0x86')][_0xed89('0x87')]['SELECT']});}})[_0xed89('0x25')](function(){return{'sql':_0x387454['toString']()};})[_0xed89('0x25')](respondWithResult(_0x2a1661,null))[_0xed89('0x4d')](handleError(_0x2a1661,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 000d245..829b017 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.model.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x415b=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','analytics_custom_reports','util','../../config/logger'];(function(_0x37f089,_0x17720d){var _0x46f202=function(_0x50aece){while(--_0x50aece){_0x37f089['push'](_0x37f089['shift']());}};_0x46f202(++_0x17720d);}(_0x415b,0x198));var _0xb415=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x415b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xb415('0x0'));var logger=require(_0xb415('0x1'))(_0xb415('0x2'));var moment=require('moment');var BPromise=require(_0xb415('0x3'));var rp=require(_0xb415('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb415('0x5'));var config=require(_0xb415('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xb415('0x7')]=function(_0x4b6e8a,_0x464c88){return _0x4b6e8a[_0xb415('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xb415('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x74fa=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74fa,0x6e));var _0xa74f=function(_0x3eef73,_0x4d3bfe){_0x3eef73=_0x3eef73-0x0;var _0x1ecb66=_0x74fa[_0x3eef73];return _0x1ecb66;};'use strict';var _=require(_0xa74f('0x0'));var util=require(_0xa74f('0x1'));var logger=require(_0xa74f('0x2'))(_0xa74f('0x3'));var moment=require(_0xa74f('0x4'));var BPromise=require(_0xa74f('0x5'));var rp=require(_0xa74f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa74f('0x7'));var config=require(_0xa74f('0x8'));var attributes=require(_0xa74f('0x9'));module[_0xa74f('0xa')]=function(_0xba83d,_0x4b1057){return _0xba83d[_0xa74f('0xb')](_0xa74f('0xc'),attributes,{'tableName':_0xa74f('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 995be21..780af3b 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd67=['randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird'];(function(_0x3afd0a,_0xa8a228){var _0x26651f=function(_0x301020){while(--_0x301020){_0x3afd0a['push'](_0x3afd0a['shift']());}};_0x26651f(++_0xa8a228);}(_0xcd67,0xa9));var _0x7cd6=function(_0x27e4aa,_0x1e8ce5){_0x27e4aa=_0x27e4aa-0x0;var _0x299c7a=_0xcd67[_0x27e4aa];return _0x299c7a;};'use strict';var _=require(_0x7cd6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7cd6('0x1'));var rs=require(_0x7cd6('0x2'));var fs=require('fs');var Redis=require(_0x7cd6('0x3'));var db=require(_0x7cd6('0x4'))['db'];var utils=require(_0x7cd6('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7cd6('0x6')][_0x7cd6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5bbbfc,_0x115ee3,_0x36c96e){return new BPromise(function(_0x4da491,_0x4ad5ec){return client[_0x7cd6('0x8')](_0x5bbbfc,_0x36c96e)[_0x7cd6('0x9')](function(_0x902e01){logger[_0x7cd6('0xa')](_0x7cd6('0xb'),_0x115ee3,_0x7cd6('0xc'));logger[_0x7cd6('0xd')](_0x7cd6('0xe'),_0x115ee3,_0x7cd6('0xc'),JSON['stringify'](_0x902e01));if(_0x902e01[_0x7cd6('0xf')]){if(_0x902e01[_0x7cd6('0xf')]['code']===0x1f4){logger[_0x7cd6('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x115ee3,_0x902e01[_0x7cd6('0xf')][_0x7cd6('0x10')]);return _0x4ad5ec(_0x902e01[_0x7cd6('0xf')][_0x7cd6('0x10')]);}logger[_0x7cd6('0xf')](_0x7cd6('0xb'),_0x115ee3,_0x902e01['error']['message']);return _0x4da491(_0x902e01[_0x7cd6('0xf')]['message']);}else{logger[_0x7cd6('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x115ee3,'request\x20sent');_0x4da491(_0x902e01[_0x7cd6('0x11')][_0x7cd6('0x10')]);}})[_0x7cd6('0x12')](function(_0x5bb98f){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x115ee3,_0x5bb98f);_0x4ad5ec(_0x5bb98f);});});}
\ No newline at end of file
+var _0x6fcf=['../../config/logger','../../config/environment','jayson/promise','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4edde7,_0x146074){var _0x12d013=function(_0x5d3561){while(--_0x5d3561){_0x4edde7['push'](_0x4edde7['shift']());}};_0x12d013(++_0x146074);}(_0x6fcf,0x11a));var _0xf6fc=function(_0x1f2104,_0x3d1a56){_0x1f2104=_0x1f2104-0x0;var _0x590031=_0x6fcf[_0x1f2104];return _0x590031;};'use strict';var _=require(_0xf6fc('0x0'));var util=require(_0xf6fc('0x1'));var moment=require(_0xf6fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xf6fc('0x3'));var fs=require('fs');var Redis=require(_0xf6fc('0x4'));var db=require(_0xf6fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6fc('0x6'))('rpc');var config=require(_0xf6fc('0x7'));var jayson=require(_0xf6fc('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5813db,_0x5ace55,_0x548e60){return new BPromise(function(_0x1a569c,_0x47e6eb){return client['request'](_0x5813db,_0x548e60)['then'](function(_0xe6a5a){logger[_0xf6fc('0x9')](_0xf6fc('0xa'),_0x5ace55,_0xf6fc('0xb'));logger[_0xf6fc('0xc')](_0xf6fc('0xd'),_0x5ace55,_0xf6fc('0xb'),JSON['stringify'](_0xe6a5a));if(_0xe6a5a[_0xf6fc('0xe')]){if(_0xe6a5a[_0xf6fc('0xe')]['code']===0x1f4){logger[_0xf6fc('0xe')](_0xf6fc('0xa'),_0x5ace55,_0xe6a5a[_0xf6fc('0xe')]['message']);return _0x47e6eb(_0xe6a5a[_0xf6fc('0xe')][_0xf6fc('0xf')]);}logger['error'](_0xf6fc('0xa'),_0x5ace55,_0xe6a5a[_0xf6fc('0xe')][_0xf6fc('0xf')]);return _0x1a569c(_0xe6a5a[_0xf6fc('0xe')][_0xf6fc('0xf')]);}else{logger['info'](_0xf6fc('0xa'),_0x5ace55,_0xf6fc('0xb'));_0x1a569c(_0xe6a5a[_0xf6fc('0x10')][_0xf6fc('0xf')]);}})[_0xf6fc('0x11')](function(_0x736d92){logger[_0xf6fc('0xe')](_0xf6fc('0xa'),_0x5ace55,_0x736d92);_0x47e6eb(_0x736d92);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index b3d3f63..dc9d9d8 100644
--- a/server/api/analyticCustomReport/index.js
+++ b/server/api/analyticCustomReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x52bc=['/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','post','create','put','delete','exports','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x52bc,0xf9));var _0xc52b=function(_0x24f31c,_0x54144e){_0x24f31c=_0x24f31c-0x0;var _0x22cfc4=_0x52bc[_0x24f31c];return _0x22cfc4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc52b('0x0'));var express=require('express');var router=express[_0xc52b('0x1')]();var fs_extra=require(_0xc52b('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc52b('0x3'));var config=require('../../config/environment');var controller=require(_0xc52b('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc52b('0x5')](_0xc52b('0x6'),auth[_0xc52b('0x7')](),controller[_0xc52b('0x8')]);router[_0xc52b('0x5')](_0xc52b('0x9'),auth[_0xc52b('0x7')](),controller[_0xc52b('0xa')]);router['get'](_0xc52b('0xb'),auth[_0xc52b('0x7')](),controller['run']);router[_0xc52b('0x5')]('/:id/query',auth[_0xc52b('0x7')](),controller['query']);router[_0xc52b('0xc')]('/',auth[_0xc52b('0x7')](),controller[_0xc52b('0xd')]);router[_0xc52b('0xe')]('/:id',auth[_0xc52b('0x7')](),controller['update']);router[_0xc52b('0xf')](_0xc52b('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0xc52b('0x10')]=router;
\ No newline at end of file
+var _0x68f0=['/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show'];(function(_0x431baf,_0x22f29d){var _0x20f54e=function(_0x147a49){while(--_0x147a49){_0x431baf['push'](_0x431baf['shift']());}};_0x20f54e(++_0x22f29d);}(_0x68f0,0xb3));var _0x068f=function(_0x36bf1b,_0x1b8bc9){_0x36bf1b=_0x36bf1b-0x0;var _0x49c980=_0x68f0[_0x36bf1b];return _0x49c980;};'use strict';var multer=require(_0x068f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x068f('0x1'));var express=require(_0x068f('0x2'));var router=express['Router']();var fs_extra=require(_0x068f('0x3'));var auth=require(_0x068f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x068f('0x5')]('/',auth['isAuthenticated'](),controller[_0x068f('0x6')]);router[_0x068f('0x5')](_0x068f('0x7'),auth[_0x068f('0x8')](),controller[_0x068f('0x9')]);router[_0x068f('0x5')](_0x068f('0xa'),auth['isAuthenticated'](),controller[_0x068f('0xb')]);router['get'](_0x068f('0xc'),auth[_0x068f('0x8')](),controller[_0x068f('0xd')]);router[_0x068f('0x5')](_0x068f('0xe'),auth[_0x068f('0x8')](),controller[_0x068f('0xf')]);router['post']('/',auth[_0x068f('0x8')](),controller[_0x068f('0x10')]);router[_0x068f('0x11')](_0x068f('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x068f('0x12')](_0x068f('0x7'),auth['isAuthenticated'](),controller[_0x068f('0x13')]);module[_0x068f('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index d4d4e1f..d9203ab 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x2291cb,_0x3d2b79){var _0x53b5d2=function(_0x300c99){while(--_0x300c99){_0x2291cb['push'](_0x2291cb['shift']());}};_0x53b5d2(++_0x3d2b79);}(_0x2bd8,0x130));var _0x82bd=function(_0x4c1a9b,_0x31b98e){_0x4c1a9b=_0x4c1a9b-0x0;var _0x504fba=_0x2bd8[_0x4c1a9b];return _0x504fba;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}};
\ No newline at end of file
+var _0x425d=['sequelize','STRING','TEXT'];(function(_0x1e60bc,_0x45c6c7){var _0x482300=function(_0xf489e9){while(--_0xf489e9){_0x1e60bc['push'](_0x1e60bc['shift']());}};_0x482300(++_0x45c6c7);}(_0x425d,0x1e0));var _0xd425=function(_0x4caf0d,_0x580ea2){_0x4caf0d=_0x4caf0d-0x0;var _0x473297=_0x425d[_0x4caf0d];return _0x473297;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 66cb44b..b68b297 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x44694b,_0x523100){var _0xc6a8a2=function(_0xefdca4){while(--_0xefdca4){_0x44694b['push'](_0x44694b['shift']());}};_0xc6a8a2(++_0x523100);}(_0xda19,0xd5));var _0x9da1=function(_0x5856ec,_0x536dbc){_0x5856ec=_0x5856ec-0x0;var _0x52641f=_0xda19[_0x5856ec];return _0x52641f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
+var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xabce[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index c939e62..5ab5d0a 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb11f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','analytics_default_reports'];(function(_0x3f8572,_0xe61af4){var _0x94e63e=function(_0x45db5e){while(--_0x45db5e){_0x3f8572['push'](_0x3f8572['shift']());}};_0x94e63e(++_0xe61af4);}(_0xb11f,0x1b0));var _0xfb11=function(_0x3f1618,_0x58b2da){_0x3f1618=_0x3f1618-0x0;var _0x1a6baa=_0xb11f[_0x3f1618];return _0x1a6baa;};'use strict';var _=require(_0xfb11('0x0'));var util=require(_0xfb11('0x1'));var logger=require(_0xfb11('0x2'))(_0xfb11('0x3'));var moment=require(_0xfb11('0x4'));var BPromise=require(_0xfb11('0x5'));var rp=require(_0xfb11('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb11('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x22ed5c,_0x59a4f6){return _0x22ed5c['define']('AnalyticDefaultReport',attributes,{'tableName':_0xfb11('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63c4=['api','moment','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','util','../../config/logger'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0x63c4,0x1d4));var _0x463c=function(_0x3a9771,_0x13158c){_0x3a9771=_0x3a9771-0x0;var _0xc5c48c=_0x63c4[_0x3a9771];return _0xc5c48c;};'use strict';var _=require('lodash');var util=require(_0x463c('0x0'));var logger=require(_0x463c('0x1'))(_0x463c('0x2'));var moment=require(_0x463c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x463c('0x4'));var rimraf=require(_0x463c('0x5'));var config=require(_0x463c('0x6'));var attributes=require(_0x463c('0x7'));module[_0x463c('0x8')]=function(_0x2b63ef,_0x87c0c0){return _0x2b63ef[_0x463c('0x9')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 9bbaf32..a85e71c 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x59d6=['rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xc438ce,_0x5eea69){var _0x5d6ef4=function(_0x29be45){while(--_0x29be45){_0xc438ce['push'](_0xc438ce['shift']());}};_0x5d6ef4(++_0x5eea69);}(_0x59d6,0x150));var _0x659d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x59d6[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x659d('0x0'));var util=require(_0x659d('0x1'));var moment=require(_0x659d('0x2'));var BPromise=require(_0x659d('0x3'));var rs=require(_0x659d('0x4'));var fs=require('fs');var Redis=require(_0x659d('0x5'));var db=require(_0x659d('0x6'))['db'];var utils=require(_0x659d('0x7'));var logger=require(_0x659d('0x8'))(_0x659d('0x9'));var config=require(_0x659d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x659d('0xb')][_0x659d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x432dd6,_0x315381,_0x3b929a){return new BPromise(function(_0x428437,_0x394d0a){return client[_0x659d('0xd')](_0x432dd6,_0x3b929a)[_0x659d('0xe')](function(_0x892b50){logger[_0x659d('0xf')](_0x659d('0x10'),_0x315381,'request\x20sent');logger['debug'](_0x659d('0x11'),_0x315381,_0x659d('0x12'),JSON[_0x659d('0x13')](_0x892b50));if(_0x892b50[_0x659d('0x14')]){if(_0x892b50[_0x659d('0x14')][_0x659d('0x15')]===0x1f4){logger[_0x659d('0x14')](_0x659d('0x10'),_0x315381,_0x892b50[_0x659d('0x14')][_0x659d('0x16')]);return _0x394d0a(_0x892b50[_0x659d('0x14')][_0x659d('0x16')]);}logger[_0x659d('0x14')](_0x659d('0x10'),_0x315381,_0x892b50['error'][_0x659d('0x16')]);return _0x428437(_0x892b50[_0x659d('0x14')]['message']);}else{logger[_0x659d('0xf')](_0x659d('0x10'),_0x315381,_0x659d('0x12'));_0x428437(_0x892b50['result'][_0x659d('0x16')]);}})['catch'](function(_0xfa942){logger[_0x659d('0x14')](_0x659d('0x10'),_0x315381,_0xfa942);_0x394d0a(_0xfa942);});});}
\ No newline at end of file
+var _0x255d=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x2c46a3,_0x451b1e){var _0x1873ad=function(_0x223790){while(--_0x223790){_0x2c46a3['push'](_0x2c46a3['shift']());}};_0x1873ad(++_0x451b1e);}(_0x255d,0x1b2));var _0xd255=function(_0x43d3f7,_0x4d09e3){_0x43d3f7=_0x43d3f7-0x0;var _0x30b013=_0x255d[_0x43d3f7];return _0x30b013;};'use strict';var _=require(_0xd255('0x0'));var util=require(_0xd255('0x1'));var moment=require(_0xd255('0x2'));var BPromise=require(_0xd255('0x3'));var rs=require(_0xd255('0x4'));var fs=require('fs');var Redis=require(_0xd255('0x5'));var db=require(_0xd255('0x6'))['db'];var utils=require(_0xd255('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xd255('0x8'));var jayson=require(_0xd255('0x9'));var client=jayson[_0xd255('0xa')][_0xd255('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x170fca,_0x597425,_0x445dca){return new BPromise(function(_0x2b066a,_0x1b51c5){return client[_0xd255('0xc')](_0x170fca,_0x445dca)[_0xd255('0xd')](function(_0x368c26){logger[_0xd255('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x597425,'request\x20sent');logger['debug'](_0xd255('0xf'),_0x597425,'request\x20sent',JSON[_0xd255('0x10')](_0x368c26));if(_0x368c26[_0xd255('0x11')]){if(_0x368c26[_0xd255('0x11')][_0xd255('0x12')]===0x1f4){logger[_0xd255('0x11')](_0xd255('0x13'),_0x597425,_0x368c26['error'][_0xd255('0x14')]);return _0x1b51c5(_0x368c26[_0xd255('0x11')]['message']);}logger[_0xd255('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x597425,_0x368c26[_0xd255('0x11')][_0xd255('0x14')]);return _0x2b066a(_0x368c26[_0xd255('0x11')][_0xd255('0x14')]);}else{logger[_0xd255('0xe')](_0xd255('0x13'),_0x597425,_0xd255('0x15'));_0x2b066a(_0x368c26[_0xd255('0x16')]['message']);}})[_0xd255('0x17')](function(_0x35b69d){logger[_0xd255('0x11')](_0xd255('0x13'),_0x597425,_0x35b69d);_0x1b51c5(_0x35b69d);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index eb86713..278a2e1 100644
--- a/server/api/analyticDefaultReport/index.js
+++ b/server/api/analyticDefaultReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea0e=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xea0e,0x153));var _0xeea0=function(_0x3c1c0b,_0x30f0c5){_0x3c1c0b=_0x3c1c0b-0x0;var _0x40bf23=_0xea0e[_0x3c1c0b];return _0x40bf23;};'use strict';var multer=require(_0xeea0('0x0'));var util=require(_0xeea0('0x1'));var path=require(_0xeea0('0x2'));var timeout=require(_0xeea0('0x3'));var express=require(_0xeea0('0x4'));var router=express['Router']();var fs_extra=require(_0xeea0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeea0('0x6'));var config=require(_0xeea0('0x7'));var controller=require(_0xeea0('0x8'));router[_0xeea0('0x9')]('/',auth[_0xeea0('0xa')](),controller['index']);router[_0xeea0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xeea0('0xb')]);router[_0xeea0('0x9')](_0xeea0('0xc'),auth[_0xeea0('0xa')](),controller[_0xeea0('0xd')]);router[_0xeea0('0x9')](_0xeea0('0xe'),auth[_0xeea0('0xa')](),controller[_0xeea0('0xf')]);router[_0xeea0('0x9')](_0xeea0('0x10'),auth[_0xeea0('0xa')](),controller['query']);router[_0xeea0('0x11')]('/',auth[_0xeea0('0xa')](),controller[_0xeea0('0x12')]);router[_0xeea0('0x13')](_0xeea0('0x14'),auth[_0xeea0('0xa')](),controller[_0xeea0('0x15')]);router[_0xeea0('0x16')](_0xeea0('0x14'),auth[_0xeea0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4aaa=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','/:id/run','run','create','put','update','delete','util','path','connect-timeout'];(function(_0x23ee4e,_0x3ace53){var _0x4df269=function(_0x1701c9){while(--_0x1701c9){_0x23ee4e['push'](_0x23ee4e['shift']());}};_0x4df269(++_0x3ace53);}(_0x4aaa,0x7b));var _0xa4aa=function(_0x4d367f,_0x369a96){_0x4d367f=_0x4d367f-0x0;var _0x33e085=_0x4aaa[_0x4d367f];return _0x33e085;};'use strict';var multer=require('multer');var util=require(_0xa4aa('0x0'));var path=require(_0xa4aa('0x1'));var timeout=require(_0xa4aa('0x2'));var express=require(_0xa4aa('0x3'));var router=express[_0xa4aa('0x4')]();var fs_extra=require(_0xa4aa('0x5'));var auth=require(_0xa4aa('0x6'));var interaction=require(_0xa4aa('0x7'));var config=require(_0xa4aa('0x8'));var controller=require(_0xa4aa('0x9'));router[_0xa4aa('0xa')]('/',auth[_0xa4aa('0xb')](),controller[_0xa4aa('0xc')]);router[_0xa4aa('0xa')](_0xa4aa('0xd'),auth[_0xa4aa('0xb')](),controller['show']);router[_0xa4aa('0xa')]('/:id/preview',auth[_0xa4aa('0xb')](),controller[_0xa4aa('0xe')]);router['get'](_0xa4aa('0xf'),auth[_0xa4aa('0xb')](),controller[_0xa4aa('0x10')]);router['get']('/:id/query',auth[_0xa4aa('0xb')](),controller['query']);router['post']('/',auth[_0xa4aa('0xb')](),controller[_0xa4aa('0x11')]);router[_0xa4aa('0x12')](_0xa4aa('0xd'),auth['isAuthenticated'](),controller[_0xa4aa('0x13')]);router[_0xa4aa('0x14')](_0xa4aa('0xd'),auth[_0xa4aa('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 517108f..7e5fbe1 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8380=['Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x240026,_0x113996){var _0x2a4011=function(_0x1b72f8){while(--_0x1b72f8){_0x240026['push'](_0x240026['shift']());}};_0x2a4011(++_0x113996);}(_0x8380,0xd7));var _0x0838=function(_0x3ee7c5,_0x52b517){_0x3ee7c5=_0x3ee7c5-0x0;var _0x41a97d=_0x8380[_0x3ee7c5];return _0x41a97d;};'use strict';var Sequelize=require(_0x0838('0x0'));var moment=require(_0x0838('0x1'));module[_0x0838('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x0838('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0838('0x4')](_0x0838('0x5'),_0x0838('0x6'),_0x0838('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x0838('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x0838('0x8')]},'status':{'type':Sequelize[_0x0838('0x3')],'defaultValue':_0x0838('0x9')},'type':{'type':Sequelize['ENUM']('manual',_0x0838('0xa')),'allowNull':![],'defaultValue':_0x0838('0xb')},'reportId':{'type':Sequelize[_0x0838('0xc')](0xb)[_0x0838('0xd')]},'reportType':{'type':Sequelize[_0x0838('0x3')]}};
\ No newline at end of file
+var _0x46a9=['csv','pdf','DATE','Loading','manual','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x46a9,0x19d));var _0x946a=function(_0x568d1a,_0x4cfc6a){_0x568d1a=_0x568d1a-0x0;var _0x505881=_0x46a9[_0x568d1a];return _0x505881;};'use strict';var Sequelize=require(_0x946a('0x0'));var moment=require(_0x946a('0x1'));module[_0x946a('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x946a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x946a('0x4')](_0x946a('0x5'),_0x946a('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x946a('0x5')},'savename':{'type':Sequelize[_0x946a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x946a('0x7')]},'endDate':{'type':Sequelize[_0x946a('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x946a('0x8')},'type':{'type':Sequelize['ENUM'](_0x946a('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x946a('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x946a('0xa')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index afc7727..44d6cd4 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8b5f=['query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','include','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','exists','format','%s.%s','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','type','key','model'];(function(_0x3b0598,_0x15100f){var _0x5e2198=function(_0x19aeb7){while(--_0x19aeb7){_0x3b0598['push'](_0x3b0598['shift']());}};_0x5e2198(++_0x15100f);}(_0x8b5f,0x1e7));var _0xf8b5=function(_0x47e8fc,_0x5db630){_0x47e8fc=_0x47e8fc-0x0;var _0x427452=_0x8b5f[_0x47e8fc];return _0x427452;};'use strict';var emlformat=require(_0xf8b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf8b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf8b5('0x2'));var BPromise=require(_0xf8b5('0x3'));var Mustache=require('mustache');var util=require(_0xf8b5('0x4'));var path=require(_0xf8b5('0x5'));var sox=require(_0xf8b5('0x6'));var csv=require(_0xf8b5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8b5('0x8'));var squel=require('squel');var crypto=require(_0xf8b5('0x9'));var jsforce=require(_0xf8b5('0xa'));var deskjs=require(_0xf8b5('0xb'));var toCsv=require(_0xf8b5('0x7'));var querystring=require('querystring');var Papa=require(_0xf8b5('0xc'));var Redis=require('ioredis');var authService=require(_0xf8b5('0xd'));var qs=require(_0xf8b5('0xe'));var as=require(_0xf8b5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf8b5('0x10'));var utils=require(_0xf8b5('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xf8b5('0x12'));var db=require(_0xf8b5('0x13'))['db'];function respondWithStatusCode(_0x32b0ce,_0x24bf33){_0x24bf33=_0x24bf33||0xcc;return function(_0x3fac66){if(_0x3fac66){return _0x32b0ce[_0xf8b5('0x14')](_0x24bf33);}return _0x32b0ce[_0xf8b5('0x15')](_0x24bf33)[_0xf8b5('0x16')]();};}function respondWithResult(_0x2d2f4c,_0x1efe51){_0x1efe51=_0x1efe51||0xc8;return function(_0x44a0c3){if(_0x44a0c3){return _0x2d2f4c[_0xf8b5('0x15')](_0x1efe51)[_0xf8b5('0x17')](_0x44a0c3);}};}function respondWithFilteredResult(_0x3a908e,_0x64f2ac){return function(_0x20c76d){if(_0x20c76d){var _0x2f002e=typeof _0x64f2ac[_0xf8b5('0x18')]==='undefined'&&typeof _0x64f2ac[_0xf8b5('0x19')]===_0xf8b5('0x1a');var _0x303dc8=_0x20c76d[_0xf8b5('0x1b')];var _0x3547da=_0x2f002e?0x0:_0x64f2ac[_0xf8b5('0x18')];var _0x34d838=_0x2f002e?_0x20c76d[_0xf8b5('0x1b')]:_0x64f2ac[_0xf8b5('0x18')]+_0x64f2ac[_0xf8b5('0x19')];var _0x18d33a;if(_0x34d838>=_0x303dc8){_0x34d838=_0x303dc8;_0x18d33a=0xc8;}else{_0x18d33a=0xce;}_0x3a908e[_0xf8b5('0x15')](_0x18d33a);return _0x3a908e[_0xf8b5('0x1c')](_0xf8b5('0x1d'),_0x3547da+'-'+_0x34d838+'/'+_0x303dc8)['json'](_0x20c76d);}return null;};}function patchUpdates(_0x19e560){return function(_0x2b6249){try{jsonpatch[_0xf8b5('0x1e')](_0x2b6249,_0x19e560,!![]);}catch(_0x3198fa){return BPromise[_0xf8b5('0x1f')](_0x3198fa);}return _0x2b6249['save']();};}function saveUpdates(_0x335978,_0x1f56be){return function(_0x44fd60){if(_0x44fd60){return _0x44fd60['update'](_0x335978)[_0xf8b5('0x20')](function(_0x4e53e3){return _0x4e53e3;});}return null;};}function removeEntity(_0x20e1dc,_0x598066){return function(_0x40599a){if(_0x40599a){return _0x40599a[_0xf8b5('0x21')]()[_0xf8b5('0x20')](function(){var _0x5d6b43=_0x40599a[_0xf8b5('0x22')]({'plain':!![]});var _0x12a3fa=_0xf8b5('0x23');return db[_0xf8b5('0x24')][_0xf8b5('0x21')]({'where':{'type':_0x12a3fa,'resourceId':_0x5d6b43['id']}})['then'](function(){return _0x40599a;});})[_0xf8b5('0x20')](function(){_0x20e1dc['status'](0xcc)[_0xf8b5('0x16')]();});}};}function handleEntityNotFound(_0x2e3ebe,_0x4db8e9){return function(_0x416d90){if(!_0x416d90){_0x2e3ebe[_0xf8b5('0x14')](0x194);}return _0x416d90;};}function handleError(_0x1b85f9,_0x225cd3){_0x225cd3=_0x225cd3||0x1f4;return function(_0xa19c8){logger[_0xf8b5('0x25')](_0xa19c8[_0xf8b5('0x26')]);if(_0xa19c8[_0xf8b5('0x27')]){delete _0xa19c8[_0xf8b5('0x27')];}_0x1b85f9[_0xf8b5('0x15')](_0x225cd3)[_0xf8b5('0x28')](_0xa19c8);};}exports['index']=function(_0x4447e2,_0x9e7573){var _0x584005={},_0x5478c2={},_0x4c2868={'count':0x0,'rows':[]};var _0x51f06f=_[_0xf8b5('0x29')](db[_0xf8b5('0x2a')][_0xf8b5('0x2b')],function(_0x2516ea){return{'name':_0x2516ea['fieldName'],'type':_0x2516ea[_0xf8b5('0x2c')][_0xf8b5('0x2d')]};});_0x5478c2[_0xf8b5('0x2e')]=_[_0xf8b5('0x29')](_0x51f06f,_0xf8b5('0x27'));_0x5478c2[_0xf8b5('0x2f')]=_[_0xf8b5('0x30')](_0x4447e2[_0xf8b5('0x2f')]);_0x5478c2[_0xf8b5('0x31')]=_['intersection'](_0x5478c2[_0xf8b5('0x2e')],_0x5478c2[_0xf8b5('0x2f')]);_0x584005['attributes']=_[_0xf8b5('0x32')](_0x5478c2[_0xf8b5('0x2e')],qs[_0xf8b5('0x33')](_0x4447e2[_0xf8b5('0x2f')][_0xf8b5('0x33')]));_0x584005[_0xf8b5('0x34')]=_0x584005['attributes'][_0xf8b5('0x35')]?_0x584005['attributes']:_0x5478c2[_0xf8b5('0x2e')];if(!_0x4447e2[_0xf8b5('0x2f')]['hasOwnProperty'](_0xf8b5('0x36'))){_0x584005[_0xf8b5('0x19')]=qs['limit'](_0x4447e2[_0xf8b5('0x2f')][_0xf8b5('0x19')]);_0x584005[_0xf8b5('0x18')]=qs[_0xf8b5('0x18')](_0x4447e2['query'][_0xf8b5('0x18')]);}_0x584005[_0xf8b5('0x37')]=qs[_0xf8b5('0x38')](_0x4447e2[_0xf8b5('0x2f')][_0xf8b5('0x38')]);_0x584005[_0xf8b5('0x39')]=qs[_0xf8b5('0x31')](_[_0xf8b5('0x3a')](_0x4447e2[_0xf8b5('0x2f')],_0x5478c2['filters']),_0x51f06f);if(_0x4447e2['query'][_0xf8b5('0x3b')]){_0x584005['where']=_[_0xf8b5('0x3c')](_0x584005[_0xf8b5('0x39')],{'$or':_['map'](_0x51f06f,function(_0x1b46af){if(_0x1b46af[_0xf8b5('0x2c')]!==_0xf8b5('0x3d')){var _0x39f4fc={};_0x39f4fc[_0x1b46af[_0xf8b5('0x27')]]={'$like':'%'+_0x4447e2[_0xf8b5('0x2f')]['filter']+'%'};return _0x39f4fc;}})});}_0x584005=_[_0xf8b5('0x3c')]({},_0x584005,_0x4447e2[_0xf8b5('0x3e')]);var _0x132aff={'where':_0x584005[_0xf8b5('0x39')]};return db['AnalyticExtractedReport']['count'](_0x132aff)[_0xf8b5('0x20')](function(_0x53942e){_0x4c2868[_0xf8b5('0x1b')]=_0x53942e;if(_0x4447e2[_0xf8b5('0x2f')][_0xf8b5('0x3f')]){_0x584005['include']=[{'all':!![]}];}return db[_0xf8b5('0x2a')]['findAll'](_0x584005);})['then'](function(_0x29f733){_0x4c2868[_0xf8b5('0x40')]=_0x29f733;return _0x4c2868;})[_0xf8b5('0x20')](respondWithFilteredResult(_0x9e7573,_0x584005))['catch'](handleError(_0x9e7573,null));};exports['show']=function(_0x37e3db,_0x12b82e){var _0x18f6e4={'raw':!![],'where':{'id':_0x37e3db[_0xf8b5('0x41')]['id']}},_0x50c108={};_0x50c108[_0xf8b5('0x2e')]=_[_0xf8b5('0x30')](db['AnalyticExtractedReport']['rawAttributes']);_0x50c108[_0xf8b5('0x2f')]=_[_0xf8b5('0x30')](_0x37e3db[_0xf8b5('0x2f')]);_0x50c108[_0xf8b5('0x31')]=_[_0xf8b5('0x32')](_0x50c108[_0xf8b5('0x2e')],_0x50c108[_0xf8b5('0x2f')]);_0x18f6e4[_0xf8b5('0x34')]=_['intersection'](_0x50c108[_0xf8b5('0x2e')],qs[_0xf8b5('0x33')](_0x37e3db[_0xf8b5('0x2f')][_0xf8b5('0x33')]));_0x18f6e4[_0xf8b5('0x34')]=_0x18f6e4[_0xf8b5('0x34')]['length']?_0x18f6e4[_0xf8b5('0x34')]:_0x50c108[_0xf8b5('0x2e')];if(_0x37e3db[_0xf8b5('0x2f')][_0xf8b5('0x3f')]){_0x18f6e4[_0xf8b5('0x42')]=[{'all':!![]}];}_0x18f6e4=_[_0xf8b5('0x3c')]({},_0x18f6e4,_0x37e3db[_0xf8b5('0x3e')]);return db['AnalyticExtractedReport'][_0xf8b5('0x43')](_0x18f6e4)[_0xf8b5('0x20')](handleEntityNotFound(_0x12b82e,null))['then'](respondWithResult(_0x12b82e,null))[_0xf8b5('0x44')](handleError(_0x12b82e,null));};exports[_0xf8b5('0x45')]=function(_0x4bd456,_0x29cd53){return db[_0xf8b5('0x2a')][_0xf8b5('0x45')](_0x4bd456['body'],{})[_0xf8b5('0x20')](function(_0x61529f){var _0x3bb370=_0x4bd456[_0xf8b5('0x46')][_0xf8b5('0x22')]({'plain':!![]});if(!_0x3bb370)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bb370[_0xf8b5('0x47')]==='user'){var _0x33f4ff=_0x61529f[_0xf8b5('0x22')]({'plain':!![]});var _0xcc1b7a=_0xf8b5('0x23');return db[_0xf8b5('0x48')][_0xf8b5('0x43')]({'where':{'name':_0xcc1b7a,'userProfileId':_0x3bb370[_0xf8b5('0x49')]},'raw':!![]})[_0xf8b5('0x20')](function(_0x4d9cda){if(_0x4d9cda&&_0x4d9cda[_0xf8b5('0x4a')]===0x0){return db[_0xf8b5('0x24')]['create']({'name':_0x33f4ff[_0xf8b5('0x27')],'resourceId':_0x33f4ff['id'],'type':_0x4d9cda[_0xf8b5('0x27')],'sectionId':_0x4d9cda['id']},{})[_0xf8b5('0x20')](function(){return _0x61529f;});}else{return _0x61529f;}})[_0xf8b5('0x44')](function(_0x36fc0d){logger[_0xf8b5('0x25')](_0xf8b5('0x4b'),_0x36fc0d);throw _0x36fc0d;});}return _0x61529f;})[_0xf8b5('0x20')](respondWithResult(_0x29cd53,0xc9))[_0xf8b5('0x44')](handleError(_0x29cd53,null));};exports[_0xf8b5('0x4c')]=function(_0x194d70,_0x154afa){if(_0x194d70['body']['id']){delete _0x194d70[_0xf8b5('0x4d')]['id'];}return db[_0xf8b5('0x2a')]['find']({'where':{'id':_0x194d70[_0xf8b5('0x41')]['id']}})['then'](handleEntityNotFound(_0x154afa,null))[_0xf8b5('0x20')](saveUpdates(_0x194d70[_0xf8b5('0x4d')],null))[_0xf8b5('0x20')](respondWithResult(_0x154afa,null))[_0xf8b5('0x44')](handleError(_0x154afa,null));};exports[_0xf8b5('0x21')]=function(_0xf126f4,_0x13ecf9){return db[_0xf8b5('0x2a')][_0xf8b5('0x43')]({'where':{'id':_0xf126f4[_0xf8b5('0x41')]['id']}})[_0xf8b5('0x20')](handleEntityNotFound(_0x13ecf9,null))[_0xf8b5('0x20')](removeEntity(_0x13ecf9,null))[_0xf8b5('0x44')](handleError(_0x13ecf9,null));};exports[_0xf8b5('0x4e')]=function(_0x580ec6,_0x3bba0b,_0xd1ee5b){return db[_0xf8b5('0x2a')]['find']({'where':{'id':_0x580ec6['params']['id']},'attributes':[_0xf8b5('0x27'),_0xf8b5('0x4f'),_0xf8b5('0x50'),_0xf8b5('0x51')],'raw':!![]})[_0xf8b5('0x20')](handleEntityNotFound(_0x3bba0b,null))[_0xf8b5('0x20')](function(_0x471b66){if(_0x471b66){if(!fs[_0xf8b5('0x52')](path['join'](config[_0xf8b5('0x53')],_0xf8b5('0x54'),_0x471b66['savename']))){throw new db[(_0xf8b5('0x55'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x580ec6['query'][_0xf8b5('0x56')]){return _0x3bba0b[_0xf8b5('0x14')](0xc8);}return _0x3bba0b[_0xf8b5('0x4e')](path['join'](config['root'],_0xf8b5('0x54'),_0x471b66[_0xf8b5('0x50')]),util[_0xf8b5('0x57')](_0xf8b5('0x58'),_0x471b66['basename']||_0x471b66[_0xf8b5('0x27')],_0x471b66[_0xf8b5('0x51')]['toLowerCase']()));}})[_0xf8b5('0x44')](handleError(_0x3bba0b,null));};
\ No newline at end of file
+var _0x6d96=['then','get','ExtractedReports','UserProfileResource','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','params','basename','savename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','save','update','destroy'];(function(_0x29e079,_0x3e1be0){var _0x4fdaca=function(_0x546360){while(--_0x546360){_0x29e079['push'](_0x29e079['shift']());}};_0x4fdaca(++_0x3e1be0);}(_0x6d96,0xeb));var _0x66d9=function(_0x4c38b2,_0x226268){_0x4c38b2=_0x4c38b2-0x0;var _0x598ad5=_0x6d96[_0x4c38b2];return _0x598ad5;};'use strict';var emlformat=require(_0x66d9('0x0'));var rimraf=require(_0x66d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66d9('0x2'));var rp=require(_0x66d9('0x3'));var moment=require('moment');var BPromise=require(_0x66d9('0x4'));var Mustache=require(_0x66d9('0x5'));var util=require('util');var path=require(_0x66d9('0x6'));var sox=require('sox');var csv=require(_0x66d9('0x7'));var ejs=require(_0x66d9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66d9('0x9'));var squel=require(_0x66d9('0xa'));var crypto=require(_0x66d9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x66d9('0x7'));var querystring=require(_0x66d9('0xc'));var Papa=require(_0x66d9('0xd'));var Redis=require(_0x66d9('0xe'));var authService=require(_0x66d9('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66d9('0x10'));var logger=require(_0x66d9('0x11'))(_0x66d9('0x12'));var utils=require(_0x66d9('0x13'));var config=require(_0x66d9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x66d9('0x15'))['db'];function respondWithStatusCode(_0x291fdc,_0x38dc84){_0x38dc84=_0x38dc84||0xcc;return function(_0x5ac72b){if(_0x5ac72b){return _0x291fdc[_0x66d9('0x16')](_0x38dc84);}return _0x291fdc['status'](_0x38dc84)[_0x66d9('0x17')]();};}function respondWithResult(_0x44c24a,_0x278109){_0x278109=_0x278109||0xc8;return function(_0x54b6bd){if(_0x54b6bd){return _0x44c24a[_0x66d9('0x18')](_0x278109)[_0x66d9('0x19')](_0x54b6bd);}};}function respondWithFilteredResult(_0x4d12d7,_0x28c8cd){return function(_0x137da4){if(_0x137da4){var _0x5ceb0a=typeof _0x28c8cd['offset']==='undefined'&&typeof _0x28c8cd[_0x66d9('0x1a')]==='undefined';var _0x160d17=_0x137da4[_0x66d9('0x1b')];var _0x1c7922=_0x5ceb0a?0x0:_0x28c8cd['offset'];var _0x401768=_0x5ceb0a?_0x137da4[_0x66d9('0x1b')]:_0x28c8cd[_0x66d9('0x1c')]+_0x28c8cd[_0x66d9('0x1a')];var _0x218696;if(_0x401768>=_0x160d17){_0x401768=_0x160d17;_0x218696=0xc8;}else{_0x218696=0xce;}_0x4d12d7[_0x66d9('0x18')](_0x218696);return _0x4d12d7[_0x66d9('0x1d')](_0x66d9('0x1e'),_0x1c7922+'-'+_0x401768+'/'+_0x160d17)[_0x66d9('0x19')](_0x137da4);}return null;};}function patchUpdates(_0x17c995){return function(_0x2651e6){try{jsonpatch[_0x66d9('0x1f')](_0x2651e6,_0x17c995,!![]);}catch(_0x239599){return BPromise['reject'](_0x239599);}return _0x2651e6[_0x66d9('0x20')]();};}function saveUpdates(_0x314cf8,_0x4f4157){return function(_0x519a03){if(_0x519a03){return _0x519a03[_0x66d9('0x21')](_0x314cf8)['then'](function(_0x304bf0){return _0x304bf0;});}return null;};}function removeEntity(_0x182625,_0x737f2d){return function(_0x34a706){if(_0x34a706){return _0x34a706[_0x66d9('0x22')]()[_0x66d9('0x23')](function(){var _0x33263e=_0x34a706[_0x66d9('0x24')]({'plain':!![]});var _0x55c096=_0x66d9('0x25');return db[_0x66d9('0x26')][_0x66d9('0x22')]({'where':{'type':_0x55c096,'resourceId':_0x33263e['id']}})[_0x66d9('0x23')](function(){return _0x34a706;});})[_0x66d9('0x23')](function(){_0x182625['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42f6a1,_0x23a11f){return function(_0x470e68){if(!_0x470e68){_0x42f6a1[_0x66d9('0x16')](0x194);}return _0x470e68;};}function handleError(_0x26e01c,_0x26c5ac){_0x26c5ac=_0x26c5ac||0x1f4;return function(_0x5077c4){logger['error'](_0x5077c4[_0x66d9('0x27')]);if(_0x5077c4[_0x66d9('0x28')]){delete _0x5077c4[_0x66d9('0x28')];}_0x26e01c['status'](_0x26c5ac)[_0x66d9('0x29')](_0x5077c4);};}exports['index']=function(_0x31ce1a,_0x5611cf){var _0x715709={},_0x1a4787={},_0x277c81={'count':0x0,'rows':[]};var _0x2e7710=_[_0x66d9('0x2a')](db['AnalyticExtractedReport'][_0x66d9('0x2b')],function(_0x4d6f41){return{'name':_0x4d6f41['fieldName'],'type':_0x4d6f41[_0x66d9('0x2c')][_0x66d9('0x2d')]};});_0x1a4787[_0x66d9('0x2e')]=_['map'](_0x2e7710,_0x66d9('0x28'));_0x1a4787[_0x66d9('0x2f')]=_['keys'](_0x31ce1a[_0x66d9('0x2f')]);_0x1a4787[_0x66d9('0x30')]=_[_0x66d9('0x31')](_0x1a4787[_0x66d9('0x2e')],_0x1a4787[_0x66d9('0x2f')]);_0x715709[_0x66d9('0x32')]=_[_0x66d9('0x31')](_0x1a4787[_0x66d9('0x2e')],qs[_0x66d9('0x33')](_0x31ce1a[_0x66d9('0x2f')]['fields']));_0x715709[_0x66d9('0x32')]=_0x715709['attributes'][_0x66d9('0x34')]?_0x715709[_0x66d9('0x32')]:_0x1a4787[_0x66d9('0x2e')];if(!_0x31ce1a[_0x66d9('0x2f')][_0x66d9('0x35')](_0x66d9('0x36'))){_0x715709[_0x66d9('0x1a')]=qs[_0x66d9('0x1a')](_0x31ce1a[_0x66d9('0x2f')][_0x66d9('0x1a')]);_0x715709['offset']=qs[_0x66d9('0x1c')](_0x31ce1a[_0x66d9('0x2f')]['offset']);}_0x715709['order']=qs[_0x66d9('0x37')](_0x31ce1a['query']['sort']);_0x715709[_0x66d9('0x38')]=qs[_0x66d9('0x30')](_[_0x66d9('0x39')](_0x31ce1a[_0x66d9('0x2f')],_0x1a4787['filters']),_0x2e7710);if(_0x31ce1a[_0x66d9('0x2f')][_0x66d9('0x3a')]){_0x715709[_0x66d9('0x38')]=_[_0x66d9('0x3b')](_0x715709[_0x66d9('0x38')],{'$or':_[_0x66d9('0x2a')](_0x2e7710,function(_0x58d481){if(_0x58d481['type']!==_0x66d9('0x3c')){var _0x216f20={};_0x216f20[_0x58d481[_0x66d9('0x28')]]={'$like':'%'+_0x31ce1a['query'][_0x66d9('0x3a')]+'%'};return _0x216f20;}})});}_0x715709=_[_0x66d9('0x3b')]({},_0x715709,_0x31ce1a[_0x66d9('0x3d')]);var _0x16ce14={'where':_0x715709[_0x66d9('0x38')]};return db[_0x66d9('0x3e')][_0x66d9('0x1b')](_0x16ce14)[_0x66d9('0x23')](function(_0x53ffc7){_0x277c81[_0x66d9('0x1b')]=_0x53ffc7;if(_0x31ce1a[_0x66d9('0x2f')][_0x66d9('0x3f')]){_0x715709[_0x66d9('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x715709);})[_0x66d9('0x23')](function(_0xf4e2e6){_0x277c81['rows']=_0xf4e2e6;return _0x277c81;})[_0x66d9('0x23')](respondWithFilteredResult(_0x5611cf,_0x715709))[_0x66d9('0x41')](handleError(_0x5611cf,null));};exports[_0x66d9('0x42')]=function(_0x546e44,_0x1da7b6){var _0x5b6dbd={'raw':!![],'where':{'id':_0x546e44['params']['id']}},_0x49fe80={};_0x49fe80[_0x66d9('0x2e')]=_[_0x66d9('0x43')](db[_0x66d9('0x3e')][_0x66d9('0x2b')]);_0x49fe80['query']=_['keys'](_0x546e44[_0x66d9('0x2f')]);_0x49fe80[_0x66d9('0x30')]=_[_0x66d9('0x31')](_0x49fe80[_0x66d9('0x2e')],_0x49fe80[_0x66d9('0x2f')]);_0x5b6dbd['attributes']=_[_0x66d9('0x31')](_0x49fe80[_0x66d9('0x2e')],qs['fields'](_0x546e44[_0x66d9('0x2f')]['fields']));_0x5b6dbd[_0x66d9('0x32')]=_0x5b6dbd[_0x66d9('0x32')][_0x66d9('0x34')]?_0x5b6dbd['attributes']:_0x49fe80[_0x66d9('0x2e')];if(_0x546e44[_0x66d9('0x2f')][_0x66d9('0x3f')]){_0x5b6dbd['include']=[{'all':!![]}];}_0x5b6dbd=_['merge']({},_0x5b6dbd,_0x546e44['options']);return db['AnalyticExtractedReport'][_0x66d9('0x44')](_0x5b6dbd)[_0x66d9('0x23')](handleEntityNotFound(_0x1da7b6,null))['then'](respondWithResult(_0x1da7b6,null))[_0x66d9('0x41')](handleError(_0x1da7b6,null));};exports[_0x66d9('0x45')]=function(_0x12a3f9,_0x3b93f7){return db['AnalyticExtractedReport']['create'](_0x12a3f9[_0x66d9('0x46')],{})[_0x66d9('0x23')](function(_0x26f8c6){var _0x4be03e=_0x12a3f9[_0x66d9('0x47')][_0x66d9('0x24')]({'plain':!![]});if(!_0x4be03e)throw new Error(_0x66d9('0x48'));if(_0x4be03e[_0x66d9('0x49')]===_0x66d9('0x47')){var _0x25ae47=_0x26f8c6[_0x66d9('0x24')]({'plain':!![]});var _0x4fa068='ExtractedReports';return db['UserProfileSection'][_0x66d9('0x44')]({'where':{'name':_0x4fa068,'userProfileId':_0x4be03e[_0x66d9('0x4a')]},'raw':!![]})[_0x66d9('0x23')](function(_0x153c04){if(_0x153c04&&_0x153c04['autoAssociation']===0x0){return db[_0x66d9('0x26')][_0x66d9('0x45')]({'name':_0x25ae47[_0x66d9('0x28')],'resourceId':_0x25ae47['id'],'type':_0x153c04[_0x66d9('0x28')],'sectionId':_0x153c04['id']},{})[_0x66d9('0x23')](function(){return _0x26f8c6;});}else{return _0x26f8c6;}})['catch'](function(_0x3d5c9f){logger[_0x66d9('0x4b')](_0x66d9('0x4c'),_0x3d5c9f);throw _0x3d5c9f;});}return _0x26f8c6;})[_0x66d9('0x23')](respondWithResult(_0x3b93f7,0xc9))[_0x66d9('0x41')](handleError(_0x3b93f7,null));};exports[_0x66d9('0x21')]=function(_0x9bf4e3,_0x16cc5d){if(_0x9bf4e3[_0x66d9('0x46')]['id']){delete _0x9bf4e3[_0x66d9('0x46')]['id'];}return db['AnalyticExtractedReport'][_0x66d9('0x44')]({'where':{'id':_0x9bf4e3['params']['id']}})[_0x66d9('0x23')](handleEntityNotFound(_0x16cc5d,null))[_0x66d9('0x23')](saveUpdates(_0x9bf4e3[_0x66d9('0x46')],null))[_0x66d9('0x23')](respondWithResult(_0x16cc5d,null))[_0x66d9('0x41')](handleError(_0x16cc5d,null));};exports[_0x66d9('0x22')]=function(_0x427e64,_0x3477dd){return db[_0x66d9('0x3e')][_0x66d9('0x44')]({'where':{'id':_0x427e64['params']['id']}})[_0x66d9('0x23')](handleEntityNotFound(_0x3477dd,null))['then'](removeEntity(_0x3477dd,null))['catch'](handleError(_0x3477dd,null));};exports[_0x66d9('0x4d')]=function(_0x1b0481,_0x33a16c,_0x520ad2){return db[_0x66d9('0x3e')][_0x66d9('0x44')]({'where':{'id':_0x1b0481[_0x66d9('0x4e')]['id']},'attributes':[_0x66d9('0x28'),_0x66d9('0x4f'),_0x66d9('0x50'),_0x66d9('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x33a16c,null))[_0x66d9('0x23')](function(_0x1bb8f3){if(_0x1bb8f3){if(!fs['existsSync'](path[_0x66d9('0x52')](config[_0x66d9('0x53')],_0x66d9('0x54'),_0x1bb8f3[_0x66d9('0x50')]))){throw new db[(_0x66d9('0x55'))]['ValidationError'](_0x66d9('0x56'));}if(_0x1b0481[_0x66d9('0x2f')][_0x66d9('0x57')]){return _0x33a16c[_0x66d9('0x16')](0xc8);}return _0x33a16c[_0x66d9('0x4d')](path[_0x66d9('0x52')](config['root'],_0x66d9('0x54'),_0x1bb8f3['savename']),util[_0x66d9('0x58')]('%s.%s',_0x1bb8f3['basename']||_0x1bb8f3[_0x66d9('0x28')],_0x1bb8f3[_0x66d9('0x51')][_0x66d9('0x59')]()));}})[_0x66d9('0x41')](handleError(_0x33a16c,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 193efc1..e2cd354 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe38d=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x40ae42,_0xce6d5a){var _0x35132b=function(_0x24b634){while(--_0x24b634){_0x40ae42['push'](_0x40ae42['shift']());}};_0x35132b(++_0xce6d5a);}(_0xe38d,0xe9));var _0xde38=function(_0xb0a064,_0x2535a8){_0xb0a064=_0xb0a064-0x0;var _0x26e680=_0xe38d[_0xb0a064];return _0x26e680;};'use strict';var _=require(_0xde38('0x0'));var util=require(_0xde38('0x1'));var logger=require(_0xde38('0x2'))(_0xde38('0x3'));var moment=require(_0xde38('0x4'));var BPromise=require(_0xde38('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde38('0x6'));var rimraf=require(_0xde38('0x7'));var config=require(_0xde38('0x8'));var attributes=require(_0xde38('0x9'));module[_0xde38('0xa')]=function(_0x3f22f6,_0x1cf7f9){return _0x3f22f6['define'](_0xde38('0xb'),attributes,{'tableName':_0xde38('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x99e8=['analytics_extracted_reports','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x99e8,0x12d));var _0x899e=function(_0x1133b7,_0x4ef9fe){_0x1133b7=_0x1133b7-0x0;var _0x113492=_0x99e8[_0x1133b7];return _0x113492;};'use strict';var _=require(_0x899e('0x0'));var util=require(_0x899e('0x1'));var logger=require('../../config/logger')(_0x899e('0x2'));var moment=require(_0x899e('0x3'));var BPromise=require('bluebird');var rp=require(_0x899e('0x4'));var fs=require('fs');var path=require(_0x899e('0x5'));var rimraf=require(_0x899e('0x6'));var config=require(_0x899e('0x7'));var attributes=require(_0x899e('0x8'));module['exports']=function(_0x4b0b6a,_0x30f585){return _0x4b0b6a[_0x899e('0x9')](_0x899e('0xa'),attributes,{'tableName':_0x899e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index b229292..655bac0 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa4ad=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1bacfe,_0x8de443){var _0x23f634=function(_0x17b63b){while(--_0x17b63b){_0x1bacfe['push'](_0x1bacfe['shift']());}};_0x23f634(++_0x8de443);}(_0xa4ad,0x80));var _0xda4a=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0xa4ad[_0x365e54];return _0x13317a;};'use strict';var _=require(_0xda4a('0x0'));var util=require('util');var moment=require(_0xda4a('0x1'));var BPromise=require(_0xda4a('0x2'));var rs=require(_0xda4a('0x3'));var fs=require('fs');var Redis=require(_0xda4a('0x4'));var db=require(_0xda4a('0x5'))['db'];var utils=require(_0xda4a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xda4a('0x7'));var jayson=require(_0xda4a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33597c,_0x12d5b1,_0x1786c3){return new BPromise(function(_0x392abf,_0x236f49){return client[_0xda4a('0x9')](_0x33597c,_0x1786c3)[_0xda4a('0xa')](function(_0x1bec50){logger[_0xda4a('0xb')](_0xda4a('0xc'),_0x12d5b1,'request\x20sent');logger['debug'](_0xda4a('0xd'),_0x12d5b1,_0xda4a('0xe'),JSON['stringify'](_0x1bec50));if(_0x1bec50[_0xda4a('0xf')]){if(_0x1bec50[_0xda4a('0xf')][_0xda4a('0x10')]===0x1f4){logger[_0xda4a('0xf')](_0xda4a('0xc'),_0x12d5b1,_0x1bec50[_0xda4a('0xf')][_0xda4a('0x11')]);return _0x236f49(_0x1bec50[_0xda4a('0xf')][_0xda4a('0x11')]);}logger[_0xda4a('0xf')](_0xda4a('0xc'),_0x12d5b1,_0x1bec50[_0xda4a('0xf')][_0xda4a('0x11')]);return _0x392abf(_0x1bec50[_0xda4a('0xf')][_0xda4a('0x11')]);}else{logger[_0xda4a('0xb')](_0xda4a('0xc'),_0x12d5b1,_0xda4a('0xe'));_0x392abf(_0x1bec50[_0xda4a('0x12')][_0xda4a('0x11')]);}})['catch'](function(_0x3e9929){logger[_0xda4a('0xf')](_0xda4a('0xc'),_0x12d5b1,_0x3e9929);_0x236f49(_0x3e9929);});});}
\ No newline at end of file
+var _0xae77=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0xae77,0x15d));var _0x7ae7=function(_0x57f8fe,_0x212583){_0x57f8fe=_0x57f8fe-0x0;var _0x109371=_0xae77[_0x57f8fe];return _0x109371;};'use strict';var _=require('lodash');var util=require(_0x7ae7('0x0'));var moment=require(_0x7ae7('0x1'));var BPromise=require(_0x7ae7('0x2'));var rs=require(_0x7ae7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ae7('0x4'))['db'];var utils=require(_0x7ae7('0x5'));var logger=require(_0x7ae7('0x6'))(_0x7ae7('0x7'));var config=require(_0x7ae7('0x8'));var jayson=require(_0x7ae7('0x9'));var client=jayson[_0x7ae7('0xa')][_0x7ae7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40c637,_0x5e199e,_0x32703d){return new BPromise(function(_0x567fe,_0x3ba56a){return client['request'](_0x40c637,_0x32703d)[_0x7ae7('0xc')](function(_0x2b5282){logger['info'](_0x7ae7('0xd'),_0x5e199e,_0x7ae7('0xe'));logger[_0x7ae7('0xf')](_0x7ae7('0x10'),_0x5e199e,_0x7ae7('0xe'),JSON['stringify'](_0x2b5282));if(_0x2b5282[_0x7ae7('0x11')]){if(_0x2b5282[_0x7ae7('0x11')][_0x7ae7('0x12')]===0x1f4){logger[_0x7ae7('0x11')](_0x7ae7('0xd'),_0x5e199e,_0x2b5282['error'][_0x7ae7('0x13')]);return _0x3ba56a(_0x2b5282[_0x7ae7('0x11')]['message']);}logger[_0x7ae7('0x11')](_0x7ae7('0xd'),_0x5e199e,_0x2b5282[_0x7ae7('0x11')]['message']);return _0x567fe(_0x2b5282['error'][_0x7ae7('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5e199e,_0x7ae7('0xe'));_0x567fe(_0x2b5282[_0x7ae7('0x14')][_0x7ae7('0x13')]);}})[_0x7ae7('0x15')](function(_0x35f887){logger[_0x7ae7('0x11')](_0x7ae7('0xd'),_0x5e199e,_0x35f887);_0x3ba56a(_0x35f887);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 1c21014..e944d73 100644
--- a/server/api/analyticExtractedReport/index.js
+++ b/server/api/analyticExtractedReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8fab=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','download','create','update','delete','destroy','multer','connect-timeout','express'];(function(_0x4a35b3,_0x5bc5a1){var _0x4a8136=function(_0x215b0d){while(--_0x215b0d){_0x4a35b3['push'](_0x4a35b3['shift']());}};_0x4a8136(++_0x5bc5a1);}(_0x8fab,0x75));var _0xb8fa=function(_0x46bef8,_0x280566){_0x46bef8=_0x46bef8-0x0;var _0x2379ed=_0x8fab[_0x46bef8];return _0x2379ed;};'use strict';var multer=require(_0xb8fa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb8fa('0x1'));var express=require(_0xb8fa('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb8fa('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb8fa('0x4'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0x6')]);router[_0xb8fa('0x7')](_0xb8fa('0x8'),auth[_0xb8fa('0x5')](),controller[_0xb8fa('0x9')]);router['get']('/:id/download',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0xa')]);router['post']('/',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0xb')]);router['put']('/:id',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0xc')]);router[_0xb8fa('0xd')]('/:id',auth[_0xb8fa('0x5')](),controller[_0xb8fa('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xe14e=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/download','download','post','create','put','/:id','update','delete','destroy'];(function(_0x507597,_0x412525){var _0x110a0f=function(_0x57935a){while(--_0x57935a){_0x507597['push'](_0x507597['shift']());}};_0x110a0f(++_0x412525);}(_0xe14e,0x141));var _0xee14=function(_0x3f2022,_0x18767d){_0x3f2022=_0x3f2022-0x0;var _0x3c3fff=_0xe14e[_0x3f2022];return _0x3c3fff;};'use strict';var multer=require(_0xee14('0x0'));var util=require(_0xee14('0x1'));var path=require(_0xee14('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee14('0x3')]();var fs_extra=require(_0xee14('0x4'));var auth=require(_0xee14('0x5'));var interaction=require(_0xee14('0x6'));var config=require(_0xee14('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xee14('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xee14('0x8')]('/:id',auth[_0xee14('0x9')](),controller['show']);router['get'](_0xee14('0xa'),auth[_0xee14('0x9')](),controller[_0xee14('0xb')]);router[_0xee14('0xc')]('/',auth[_0xee14('0x9')](),controller[_0xee14('0xd')]);router[_0xee14('0xe')](_0xee14('0xf'),auth['isAuthenticated'](),controller[_0xee14('0x10')]);router[_0xee14('0x11')](_0xee14('0xf'),auth['isAuthenticated'](),controller[_0xee14('0x12')]);module[_0xee14('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index cae3072..441f47f 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x16d0=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0xa9a1d8,_0x54279c){var _0x1d7184=function(_0x1acac4){while(--_0x1acac4){_0xa9a1d8['push'](_0xa9a1d8['shift']());}};_0x1d7184(++_0x54279c);}(_0x16d0,0x145));var _0x016d=function(_0x592f78,_0x2638b0){_0x592f78=_0x592f78-0x0;var _0x2fe1ee=_0x16d0[_0x592f78];return _0x2fe1ee;};'use strict';var Sequelize=require(_0x016d('0x0'));module['exports']={'field':{'type':Sequelize[_0x016d('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x016d('0x2')]},'format':{'type':Sequelize[_0x016d('0x2')]},'groupBy':{'type':Sequelize[_0x016d('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x016d('0x2')]},'custom':{'type':Sequelize[_0x016d('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x76e6=['STRING','BOOLEAN','exports','TEXT'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x76e6,0x1c2));var _0x676e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x76e6[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x676e('0x0')]={'field':{'type':Sequelize[_0x676e('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x676e('0x2')]},'groupBy':{'type':Sequelize[_0x676e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x676e('0x2')]},'custom':{'type':Sequelize[_0x676e('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 0448bd0..ed9cec4 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.controller.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x03d8=['hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','params','keys','options','find','catch','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x1c7b8b,_0x2ce52c){var _0x273b99=function(_0x587511){while(--_0x587511){_0x1c7b8b['push'](_0x1c7b8b['shift']());}};_0x273b99(++_0x2ce52c);}(_0x03d8,0x72));var _0x803d=function(_0x24532f,_0x56d15b){_0x24532f=_0x24532f-0x0;var _0x4413dd=_0x03d8[_0x24532f];return _0x4413dd;};'use strict';var emlformat=require(_0x803d('0x0'));var rimraf=require(_0x803d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x803d('0x2'));var rp=require(_0x803d('0x3'));var moment=require(_0x803d('0x4'));var BPromise=require(_0x803d('0x5'));var Mustache=require(_0x803d('0x6'));var util=require(_0x803d('0x7'));var path=require('path');var sox=require(_0x803d('0x8'));var csv=require(_0x803d('0x9'));var ejs=require(_0x803d('0xa'));var fs=require('fs');var fs_extra=require(_0x803d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x803d('0xc'));var jsforce=require(_0x803d('0xd'));var deskjs=require(_0x803d('0xe'));var toCsv=require(_0x803d('0x9'));var querystring=require(_0x803d('0xf'));var Papa=require(_0x803d('0x10'));var Redis=require(_0x803d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x803d('0x12'));var as=require(_0x803d('0x13'));var hardwareService=require(_0x803d('0x14'));var logger=require(_0x803d('0x15'))('api');var utils=require(_0x803d('0x16'));var config=require(_0x803d('0x17'));var licenseUtil=require(_0x803d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56a87b,_0x4ef729){_0x4ef729=_0x4ef729||0xcc;return function(_0x23859e){if(_0x23859e){return _0x56a87b[_0x803d('0x19')](_0x4ef729);}return _0x56a87b[_0x803d('0x1a')](_0x4ef729)[_0x803d('0x1b')]();};}function respondWithResult(_0x1b355d,_0x2ea0b6){_0x2ea0b6=_0x2ea0b6||0xc8;return function(_0x30ad2b){if(_0x30ad2b){return _0x1b355d[_0x803d('0x1a')](_0x2ea0b6)[_0x803d('0x1c')](_0x30ad2b);}};}function respondWithFilteredResult(_0x4dff90,_0x35e52c){return function(_0x281475){if(_0x281475){var _0xbe322e=typeof _0x35e52c['offset']===_0x803d('0x1d')&&typeof _0x35e52c['limit']===_0x803d('0x1d');var _0x1d3e6a=_0x281475[_0x803d('0x1e')];var _0x42ab78=_0xbe322e?0x0:_0x35e52c[_0x803d('0x1f')];var _0x452a65=_0xbe322e?_0x281475[_0x803d('0x1e')]:_0x35e52c[_0x803d('0x1f')]+_0x35e52c[_0x803d('0x20')];var _0x228c22;if(_0x452a65>=_0x1d3e6a){_0x452a65=_0x1d3e6a;_0x228c22=0xc8;}else{_0x228c22=0xce;}_0x4dff90[_0x803d('0x1a')](_0x228c22);return _0x4dff90[_0x803d('0x21')](_0x803d('0x22'),_0x42ab78+'-'+_0x452a65+'/'+_0x1d3e6a)[_0x803d('0x1c')](_0x281475);}return null;};}function patchUpdates(_0x174a0e){return function(_0x23fff1){try{jsonpatch[_0x803d('0x23')](_0x23fff1,_0x174a0e,!![]);}catch(_0x2b1993){return BPromise[_0x803d('0x24')](_0x2b1993);}return _0x23fff1[_0x803d('0x25')]();};}function saveUpdates(_0xf4b811,_0x494baa){return function(_0x2e0b22){if(_0x2e0b22){return _0x2e0b22[_0x803d('0x26')](_0xf4b811)[_0x803d('0x27')](function(_0x3cb1b0){return _0x3cb1b0;});}return null;};}function removeEntity(_0xfb4fdf,_0x2def65){return function(_0x43c322){if(_0x43c322){return _0x43c322['destroy']()[_0x803d('0x27')](function(){_0xfb4fdf[_0x803d('0x1a')](0xcc)[_0x803d('0x1b')]();});}};}function handleEntityNotFound(_0x471e7f,_0x1c6f21){return function(_0x368df2){if(!_0x368df2){_0x471e7f['sendStatus'](0x194);}return _0x368df2;};}function handleError(_0x25d06b,_0x4fe2fa){_0x4fe2fa=_0x4fe2fa||0x1f4;return function(_0x32dfba){logger[_0x803d('0x28')](_0x32dfba['stack']);if(_0x32dfba[_0x803d('0x29')]){delete _0x32dfba['name'];}_0x25d06b[_0x803d('0x1a')](_0x4fe2fa)[_0x803d('0x2a')](_0x32dfba);};}exports[_0x803d('0x2b')]=function(_0xca205b,_0x264fa2){var _0xcbadde={},_0x341bbe={},_0x375043={'count':0x0,'rows':[]};var _0x18775b=_[_0x803d('0x2c')](db[_0x803d('0x2d')][_0x803d('0x2e')],function(_0x176a4b){return{'name':_0x176a4b['fieldName'],'type':_0x176a4b[_0x803d('0x2f')][_0x803d('0x30')]};});_0x341bbe[_0x803d('0x31')]=_[_0x803d('0x2c')](_0x18775b,'name');_0x341bbe[_0x803d('0x32')]=_['keys'](_0xca205b[_0x803d('0x32')]);_0x341bbe[_0x803d('0x33')]=_[_0x803d('0x34')](_0x341bbe[_0x803d('0x31')],_0x341bbe[_0x803d('0x32')]);_0xcbadde[_0x803d('0x35')]=_['intersection'](_0x341bbe[_0x803d('0x31')],qs[_0x803d('0x36')](_0xca205b['query'][_0x803d('0x36')]));_0xcbadde[_0x803d('0x35')]=_0xcbadde[_0x803d('0x35')][_0x803d('0x37')]?_0xcbadde['attributes']:_0x341bbe['model'];if(!_0xca205b[_0x803d('0x32')][_0x803d('0x38')](_0x803d('0x39'))){_0xcbadde[_0x803d('0x20')]=qs[_0x803d('0x20')](_0xca205b[_0x803d('0x32')][_0x803d('0x20')]);_0xcbadde[_0x803d('0x1f')]=qs[_0x803d('0x1f')](_0xca205b[_0x803d('0x32')][_0x803d('0x1f')]);}_0xcbadde[_0x803d('0x3a')]=qs[_0x803d('0x3b')](_0xca205b['query'][_0x803d('0x3b')]);_0xcbadde['where']=qs[_0x803d('0x33')](_[_0x803d('0x3c')](_0xca205b[_0x803d('0x32')],_0x341bbe[_0x803d('0x33')]),_0x18775b);if(_0xca205b[_0x803d('0x32')][_0x803d('0x3d')]){_0xcbadde[_0x803d('0x3e')]=_[_0x803d('0x3f')](_0xcbadde[_0x803d('0x3e')],{'$or':_['map'](_0x18775b,function(_0x3477b6){if(_0x3477b6['type']!==_0x803d('0x40')){var _0x2fcf19={};_0x2fcf19[_0x3477b6[_0x803d('0x29')]]={'$like':'%'+_0xca205b['query']['filter']+'%'};return _0x2fcf19;}})});}_0xcbadde=_['merge']({},_0xcbadde,_0xca205b['options']);var _0x45c79b={'where':_0xcbadde[_0x803d('0x3e')]};return db[_0x803d('0x2d')]['count'](_0x45c79b)[_0x803d('0x27')](function(_0x235730){_0x375043[_0x803d('0x1e')]=_0x235730;if(_0xca205b[_0x803d('0x32')][_0x803d('0x41')]){_0xcbadde[_0x803d('0x42')]=[{'all':!![]}];}return db[_0x803d('0x2d')]['findAll'](_0xcbadde);})[_0x803d('0x27')](function(_0x33f655){_0x375043[_0x803d('0x43')]=_0x33f655;return _0x375043;})[_0x803d('0x27')](respondWithFilteredResult(_0x264fa2,_0xcbadde))['catch'](handleError(_0x264fa2,null));};exports[_0x803d('0x44')]=function(_0x14175d,_0x5b0a55){var _0x29564e={'raw':![],'where':{'id':_0x14175d[_0x803d('0x45')]['id']}},_0xc2f4f4={};_0xc2f4f4[_0x803d('0x31')]=_[_0x803d('0x46')](db[_0x803d('0x2d')][_0x803d('0x2e')]);_0xc2f4f4[_0x803d('0x32')]=_[_0x803d('0x46')](_0x14175d['query']);_0xc2f4f4['filters']=_[_0x803d('0x34')](_0xc2f4f4['model'],_0xc2f4f4[_0x803d('0x32')]);_0x29564e[_0x803d('0x35')]=_[_0x803d('0x34')](_0xc2f4f4[_0x803d('0x31')],qs[_0x803d('0x36')](_0x14175d[_0x803d('0x32')][_0x803d('0x36')]));_0x29564e[_0x803d('0x35')]=_0x29564e[_0x803d('0x35')]['length']?_0x29564e[_0x803d('0x35')]:_0xc2f4f4[_0x803d('0x31')];if(_0x14175d[_0x803d('0x32')]['includeAll']){_0x29564e[_0x803d('0x42')]=[{'all':!![]}];}_0x29564e=_['merge']({},_0x29564e,_0x14175d[_0x803d('0x47')]);return db[_0x803d('0x2d')][_0x803d('0x48')](_0x29564e)[_0x803d('0x27')](handleEntityNotFound(_0x5b0a55,null))['then'](respondWithResult(_0x5b0a55,null))[_0x803d('0x49')](handleError(_0x5b0a55,null));};exports[_0x803d('0x4a')]=function(_0x2e295c,_0x28ba0a){return db[_0x803d('0x2d')]['create'](_0x2e295c[_0x803d('0x4b')],{})[_0x803d('0x27')](respondWithResult(_0x28ba0a,0xc9))[_0x803d('0x49')](handleError(_0x28ba0a,null));};exports[_0x803d('0x4c')]=function(_0x13fb82,_0xb976e7){return db[_0x803d('0x2d')]['bulkCreate'](_0x13fb82[_0x803d('0x4b')],{'raw':![],'individualHooks':!![]})[_0x803d('0x27')](respondWithResult(_0xb976e7,0xc9))[_0x803d('0x49')](handleError(_0xb976e7,null));};exports['update']=function(_0x5b92f9,_0x55d609){if(_0x5b92f9[_0x803d('0x4b')]['id']){delete _0x5b92f9['body']['id'];}return db[_0x803d('0x2d')][_0x803d('0x48')]({'where':{'id':_0x5b92f9['params']['id']}})[_0x803d('0x27')](handleEntityNotFound(_0x55d609,null))[_0x803d('0x27')](saveUpdates(_0x5b92f9[_0x803d('0x4b')],null))[_0x803d('0x27')](respondWithResult(_0x55d609,null))[_0x803d('0x49')](handleError(_0x55d609,null));};exports[_0x803d('0x4d')]=function(_0x4fa295,_0x45d38a){return db['AnalyticFieldReport'][_0x803d('0x48')]({'where':{'id':_0x4fa295[_0x803d('0x45')]['id']}})[_0x803d('0x27')](handleEntityNotFound(_0x45d38a,null))[_0x803d('0x27')](removeEntity(_0x45d38a,null))[_0x803d('0x49')](handleError(_0x45d38a,null));};exports[_0x803d('0x4e')]=function(_0x403b86,_0x1ea016){return db[_0x803d('0x2d')][_0x803d('0x4d')]({'where':{'id':_0x403b86[_0x803d('0x32')][_0x803d('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x803d('0x27')](respondWithResult(_0x1ea016,0xcc))['catch'](handleError(_0x1ea016,null));};exports[_0x803d('0x50')]=function(_0x296f25,_0x5c0e73,_0x420ed8){return db[_0x803d('0x51')][_0x803d('0x52')]({'where':{'id':_0x296f25['params']['id']}})[_0x803d('0x27')](handleEntityNotFound(_0x5c0e73,null))[_0x803d('0x27')](function(_0x29f547){if(_0x29f547){return db[_0x803d('0x53')]['transaction'](function(_0x458876){return db[_0x803d('0x2d')][_0x803d('0x4d')]({'where':{'CustomReportId':_0x296f25['params']['id']},'transaction':_0x458876})[_0x803d('0x27')](function(_0x54ce58){var _0x161ea0=_[_0x803d('0x2c')](_0x296f25['body'],function(_0x3701f8){delete _0x3701f8['id'];_0x3701f8[_0x803d('0x54')]=_0x296f25[_0x803d('0x45')]['id'];return _0x3701f8;});return db[_0x803d('0x2d')]['bulkCreate'](_0x161ea0,{'transaction':_0x458876});});})[_0x803d('0x27')](function(){return db[_0x803d('0x2d')]['findAll']({'where':{'CustomReportId':_0x296f25[_0x803d('0x45')]['id']}});});}})['then'](respondWithResult(_0x5c0e73,null))[_0x803d('0x49')](handleError(_0x5c0e73,null));};
\ No newline at end of file
+var _0xcee5=['update','then','end','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save'];(function(_0x3e0e55,_0x1b446c){var _0x669d7e=function(_0x3ef41b){while(--_0x3ef41b){_0x3e0e55['push'](_0x3e0e55['shift']());}};_0x669d7e(++_0x1b446c);}(_0xcee5,0xcf));var _0x5cee=function(_0x2f9f53,_0x5b7f6d){_0x2f9f53=_0x2f9f53-0x0;var _0x503da8=_0xcee5[_0x2f9f53];return _0x503da8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5cee('0x0'));var zipdir=require(_0x5cee('0x1'));var jsonpatch=require(_0x5cee('0x2'));var rp=require(_0x5cee('0x3'));var moment=require('moment');var BPromise=require(_0x5cee('0x4'));var Mustache=require('mustache');var util=require(_0x5cee('0x5'));var path=require('path');var sox=require(_0x5cee('0x6'));var csv=require(_0x5cee('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5cee('0x8'));var squel=require(_0x5cee('0x9'));var crypto=require(_0x5cee('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5cee('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5cee('0xc'));var Papa=require(_0x5cee('0xd'));var Redis=require(_0x5cee('0xe'));var authService=require(_0x5cee('0xf'));var qs=require(_0x5cee('0x10'));var as=require(_0x5cee('0x11'));var hardwareService=require(_0x5cee('0x12'));var logger=require(_0x5cee('0x13'))(_0x5cee('0x14'));var utils=require('../../config/utils');var config=require(_0x5cee('0x15'));var licenseUtil=require(_0x5cee('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22e0f9,_0x21aec2){_0x21aec2=_0x21aec2||0xcc;return function(_0x75bf17){if(_0x75bf17){return _0x22e0f9[_0x5cee('0x17')](_0x21aec2);}return _0x22e0f9[_0x5cee('0x18')](_0x21aec2)['end']();};}function respondWithResult(_0x37375e,_0x53d6e2){_0x53d6e2=_0x53d6e2||0xc8;return function(_0x933452){if(_0x933452){return _0x37375e[_0x5cee('0x18')](_0x53d6e2)[_0x5cee('0x19')](_0x933452);}};}function respondWithFilteredResult(_0x3b86f4,_0x326f49){return function(_0x306d74){if(_0x306d74){var _0x41242a=typeof _0x326f49[_0x5cee('0x1a')]===_0x5cee('0x1b')&&typeof _0x326f49[_0x5cee('0x1c')]===_0x5cee('0x1b');var _0x23cfe6=_0x306d74[_0x5cee('0x1d')];var _0x799568=_0x41242a?0x0:_0x326f49[_0x5cee('0x1a')];var _0x1c4f0c=_0x41242a?_0x306d74['count']:_0x326f49[_0x5cee('0x1a')]+_0x326f49[_0x5cee('0x1c')];var _0x1900ed;if(_0x1c4f0c>=_0x23cfe6){_0x1c4f0c=_0x23cfe6;_0x1900ed=0xc8;}else{_0x1900ed=0xce;}_0x3b86f4[_0x5cee('0x18')](_0x1900ed);return _0x3b86f4[_0x5cee('0x1e')](_0x5cee('0x1f'),_0x799568+'-'+_0x1c4f0c+'/'+_0x23cfe6)['json'](_0x306d74);}return null;};}function patchUpdates(_0x438de7){return function(_0x8047b8){try{jsonpatch['apply'](_0x8047b8,_0x438de7,!![]);}catch(_0xfac1df){return BPromise['reject'](_0xfac1df);}return _0x8047b8[_0x5cee('0x20')]();};}function saveUpdates(_0xa52b5f,_0x38ffca){return function(_0x4abb69){if(_0x4abb69){return _0x4abb69[_0x5cee('0x21')](_0xa52b5f)[_0x5cee('0x22')](function(_0x2b88f8){return _0x2b88f8;});}return null;};}function removeEntity(_0x2a3beb,_0x231e37){return function(_0x14df3e){if(_0x14df3e){return _0x14df3e['destroy']()[_0x5cee('0x22')](function(){_0x2a3beb[_0x5cee('0x18')](0xcc)[_0x5cee('0x23')]();});}};}function handleEntityNotFound(_0x2f8933,_0x263cb6){return function(_0x21f4c8){if(!_0x21f4c8){_0x2f8933[_0x5cee('0x17')](0x194);}return _0x21f4c8;};}function handleError(_0x417dac,_0x47e60e){_0x47e60e=_0x47e60e||0x1f4;return function(_0x1dedab){logger[_0x5cee('0x24')](_0x1dedab['stack']);if(_0x1dedab[_0x5cee('0x25')]){delete _0x1dedab[_0x5cee('0x25')];}_0x417dac[_0x5cee('0x18')](_0x47e60e)[_0x5cee('0x26')](_0x1dedab);};}exports[_0x5cee('0x27')]=function(_0x5edd57,_0x1eec2d){var _0x58a66f={},_0x49c32a={},_0xec6008={'count':0x0,'rows':[]};var _0x1ca015=_[_0x5cee('0x28')](db[_0x5cee('0x29')][_0x5cee('0x2a')],function(_0x3101e6){return{'name':_0x3101e6[_0x5cee('0x2b')],'type':_0x3101e6['type'][_0x5cee('0x2c')]};});_0x49c32a[_0x5cee('0x2d')]=_['map'](_0x1ca015,_0x5cee('0x25'));_0x49c32a[_0x5cee('0x2e')]=_[_0x5cee('0x2f')](_0x5edd57['query']);_0x49c32a['filters']=_[_0x5cee('0x30')](_0x49c32a['model'],_0x49c32a['query']);_0x58a66f[_0x5cee('0x31')]=_[_0x5cee('0x30')](_0x49c32a[_0x5cee('0x2d')],qs[_0x5cee('0x32')](_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x32')]));_0x58a66f['attributes']=_0x58a66f[_0x5cee('0x31')]['length']?_0x58a66f[_0x5cee('0x31')]:_0x49c32a[_0x5cee('0x2d')];if(!_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x33')](_0x5cee('0x34'))){_0x58a66f[_0x5cee('0x1c')]=qs[_0x5cee('0x1c')](_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x1c')]);_0x58a66f['offset']=qs['offset'](_0x5edd57['query'][_0x5cee('0x1a')]);}_0x58a66f[_0x5cee('0x35')]=qs['sort'](_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x36')]);_0x58a66f[_0x5cee('0x37')]=qs[_0x5cee('0x38')](_[_0x5cee('0x39')](_0x5edd57[_0x5cee('0x2e')],_0x49c32a[_0x5cee('0x38')]),_0x1ca015);if(_0x5edd57[_0x5cee('0x2e')]['filter']){_0x58a66f[_0x5cee('0x37')]=_[_0x5cee('0x3a')](_0x58a66f[_0x5cee('0x37')],{'$or':_[_0x5cee('0x28')](_0x1ca015,function(_0x16bc5f){if(_0x16bc5f[_0x5cee('0x3b')]!==_0x5cee('0x3c')){var _0x4ff3c9={};_0x4ff3c9[_0x16bc5f[_0x5cee('0x25')]]={'$like':'%'+_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x3d')]+'%'};return _0x4ff3c9;}})});}_0x58a66f=_[_0x5cee('0x3a')]({},_0x58a66f,_0x5edd57['options']);var _0x322f1f={'where':_0x58a66f[_0x5cee('0x37')]};return db[_0x5cee('0x29')][_0x5cee('0x1d')](_0x322f1f)[_0x5cee('0x22')](function(_0x15d1d3){_0xec6008[_0x5cee('0x1d')]=_0x15d1d3;if(_0x5edd57[_0x5cee('0x2e')][_0x5cee('0x3e')]){_0x58a66f[_0x5cee('0x3f')]=[{'all':!![]}];}return db[_0x5cee('0x29')][_0x5cee('0x40')](_0x58a66f);})[_0x5cee('0x22')](function(_0x536618){_0xec6008['rows']=_0x536618;return _0xec6008;})[_0x5cee('0x22')](respondWithFilteredResult(_0x1eec2d,_0x58a66f))[_0x5cee('0x41')](handleError(_0x1eec2d,null));};exports[_0x5cee('0x42')]=function(_0x3fbd10,_0x8b1586){var _0x14701c={'raw':![],'where':{'id':_0x3fbd10[_0x5cee('0x43')]['id']}},_0xeff086={};_0xeff086[_0x5cee('0x2d')]=_[_0x5cee('0x2f')](db[_0x5cee('0x29')][_0x5cee('0x2a')]);_0xeff086[_0x5cee('0x2e')]=_[_0x5cee('0x2f')](_0x3fbd10['query']);_0xeff086[_0x5cee('0x38')]=_[_0x5cee('0x30')](_0xeff086[_0x5cee('0x2d')],_0xeff086[_0x5cee('0x2e')]);_0x14701c[_0x5cee('0x31')]=_['intersection'](_0xeff086[_0x5cee('0x2d')],qs[_0x5cee('0x32')](_0x3fbd10[_0x5cee('0x2e')][_0x5cee('0x32')]));_0x14701c[_0x5cee('0x31')]=_0x14701c['attributes']['length']?_0x14701c[_0x5cee('0x31')]:_0xeff086[_0x5cee('0x2d')];if(_0x3fbd10[_0x5cee('0x2e')][_0x5cee('0x3e')]){_0x14701c[_0x5cee('0x3f')]=[{'all':!![]}];}_0x14701c=_[_0x5cee('0x3a')]({},_0x14701c,_0x3fbd10[_0x5cee('0x44')]);return db[_0x5cee('0x29')][_0x5cee('0x45')](_0x14701c)[_0x5cee('0x22')](handleEntityNotFound(_0x8b1586,null))[_0x5cee('0x22')](respondWithResult(_0x8b1586,null))['catch'](handleError(_0x8b1586,null));};exports['create']=function(_0x115461,_0x3d55ed){return db[_0x5cee('0x29')]['create'](_0x115461[_0x5cee('0x46')],{})[_0x5cee('0x22')](respondWithResult(_0x3d55ed,0xc9))[_0x5cee('0x41')](handleError(_0x3d55ed,null));};exports[_0x5cee('0x47')]=function(_0xd564b2,_0x52158f){return db[_0x5cee('0x29')]['bulkCreate'](_0xd564b2[_0x5cee('0x46')],{'raw':![],'individualHooks':!![]})[_0x5cee('0x22')](respondWithResult(_0x52158f,0xc9))['catch'](handleError(_0x52158f,null));};exports[_0x5cee('0x21')]=function(_0x3fd9cb,_0x18408b){if(_0x3fd9cb['body']['id']){delete _0x3fd9cb['body']['id'];}return db[_0x5cee('0x29')][_0x5cee('0x45')]({'where':{'id':_0x3fd9cb[_0x5cee('0x43')]['id']}})[_0x5cee('0x22')](handleEntityNotFound(_0x18408b,null))[_0x5cee('0x22')](saveUpdates(_0x3fd9cb['body'],null))[_0x5cee('0x22')](respondWithResult(_0x18408b,null))[_0x5cee('0x41')](handleError(_0x18408b,null));};exports[_0x5cee('0x48')]=function(_0x104fdc,_0x436ff9){return db[_0x5cee('0x29')][_0x5cee('0x45')]({'where':{'id':_0x104fdc[_0x5cee('0x43')]['id']}})[_0x5cee('0x22')](handleEntityNotFound(_0x436ff9,null))[_0x5cee('0x22')](removeEntity(_0x436ff9,null))[_0x5cee('0x41')](handleError(_0x436ff9,null));};exports[_0x5cee('0x49')]=function(_0x1560ab,_0x82dbbe){return db[_0x5cee('0x29')]['destroy']({'where':{'id':_0x1560ab[_0x5cee('0x2e')][_0x5cee('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x5cee('0x22')](respondWithResult(_0x82dbbe,0xcc))[_0x5cee('0x41')](handleError(_0x82dbbe,null));};exports[_0x5cee('0x4b')]=function(_0x56a798,_0x500bda,_0x48b484){return db[_0x5cee('0x4c')][_0x5cee('0x4d')]({'where':{'id':_0x56a798[_0x5cee('0x43')]['id']}})[_0x5cee('0x22')](handleEntityNotFound(_0x500bda,null))['then'](function(_0x415f35){if(_0x415f35){return db['sequelize'][_0x5cee('0x4e')](function(_0x4529fc){return db[_0x5cee('0x29')][_0x5cee('0x48')]({'where':{'CustomReportId':_0x56a798[_0x5cee('0x43')]['id']},'transaction':_0x4529fc})[_0x5cee('0x22')](function(_0x2386a5){var _0x4c0c86=_[_0x5cee('0x28')](_0x56a798[_0x5cee('0x46')],function(_0xdd11de){delete _0xdd11de['id'];_0xdd11de[_0x5cee('0x4f')]=_0x56a798['params']['id'];return _0xdd11de;});return db[_0x5cee('0x29')]['bulkCreate'](_0x4c0c86,{'transaction':_0x4529fc});});})[_0x5cee('0x22')](function(){return db[_0x5cee('0x29')][_0x5cee('0x40')]({'where':{'CustomReportId':_0x56a798[_0x5cee('0x43')]['id']}});});}})[_0x5cee('0x22')](respondWithResult(_0x500bda,null))[_0x5cee('0x41')](handleError(_0x500bda,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 9c781df..ed57519 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.model.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x10e1=['lodash','../../config/logger','api','moment','bluebird','rimraf','./analyticFieldReport.attributes','exports','AnalyticFieldReport'];(function(_0x117926,_0x268445){var _0xc34604=function(_0x67f9c5){while(--_0x67f9c5){_0x117926['push'](_0x117926['shift']());}};_0xc34604(++_0x268445);}(_0x10e1,0x99));var _0x110e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x10e1[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x110e('0x0'));var util=require('util');var logger=require(_0x110e('0x1'))(_0x110e('0x2'));var moment=require(_0x110e('0x3'));var BPromise=require(_0x110e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x110e('0x5'));var config=require('../../config/environment');var attributes=require(_0x110e('0x6'));module[_0x110e('0x7')]=function(_0xff28cd,_0x3460b3){return _0xff28cd['define'](_0x110e('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7212=['util','../../config/logger','moment','path','rimraf','exports','define','lodash'];(function(_0x4058c7,_0x3c6726){var _0x4cfb88=function(_0xb50c3c){while(--_0xb50c3c){_0x4058c7['push'](_0x4058c7['shift']());}};_0x4cfb88(++_0x3c6726);}(_0x7212,0x87));var _0x2721=function(_0x4a2416,_0x2dbf30){_0x4a2416=_0x4a2416-0x0;var _0x3d4820=_0x7212[_0x4a2416];return _0x3d4820;};'use strict';var _=require(_0x2721('0x0'));var util=require(_0x2721('0x1'));var logger=require(_0x2721('0x2'))('api');var moment=require(_0x2721('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2721('0x4'));var rimraf=require(_0x2721('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x2721('0x6')]=function(_0x58155e,_0x38a96c){return _0x58155e[_0x2721('0x7')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index df927a5..e67e6e7 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b45=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','lodash','util'];(function(_0x40eac1,_0x29f24e){var _0x55321f=function(_0x29208b){while(--_0x29208b){_0x40eac1['push'](_0x40eac1['shift']());}};_0x55321f(++_0x29f24e);}(_0x5b45,0x132));var _0x55b4=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x5b45[_0x3b711c];return _0x2685f0;};'use strict';var _=require(_0x55b4('0x0'));var util=require(_0x55b4('0x1'));var moment=require(_0x55b4('0x2'));var BPromise=require('bluebird');var rs=require(_0x55b4('0x3'));var fs=require('fs');var Redis=require(_0x55b4('0x4'));var db=require(_0x55b4('0x5'))['db'];var utils=require(_0x55b4('0x6'));var logger=require(_0x55b4('0x7'))(_0x55b4('0x8'));var config=require(_0x55b4('0x9'));var jayson=require(_0x55b4('0xa'));var client=jayson[_0x55b4('0xb')][_0x55b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x320369,_0x1a2b8e,_0x3c85a9){return new BPromise(function(_0x5abb05,_0x5c114a){return client['request'](_0x320369,_0x3c85a9)[_0x55b4('0xd')](function(_0x4b1102){logger[_0x55b4('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a2b8e,_0x55b4('0xf'));logger['debug'](_0x55b4('0x10'),_0x1a2b8e,'request\x20sent',JSON[_0x55b4('0x11')](_0x4b1102));if(_0x4b1102[_0x55b4('0x12')]){if(_0x4b1102[_0x55b4('0x12')][_0x55b4('0x13')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x1a2b8e,_0x4b1102['error'][_0x55b4('0x14')]);return _0x5c114a(_0x4b1102[_0x55b4('0x12')][_0x55b4('0x14')]);}logger[_0x55b4('0x12')](_0x55b4('0x15'),_0x1a2b8e,_0x4b1102[_0x55b4('0x12')][_0x55b4('0x14')]);return _0x5abb05(_0x4b1102[_0x55b4('0x12')][_0x55b4('0x14')]);}else{logger[_0x55b4('0xe')](_0x55b4('0x15'),_0x1a2b8e,_0x55b4('0xf'));_0x5abb05(_0x4b1102['result'][_0x55b4('0x14')]);}})['catch'](function(_0x6d04d7){logger[_0x55b4('0x12')](_0x55b4('0x15'),_0x1a2b8e,_0x6d04d7);_0x5c114a(_0x6d04d7);});});}
\ No newline at end of file
+var _0xff6d=['catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result'];(function(_0x3e2480,_0x2eed70){var _0x652c0=function(_0xaae5d2){while(--_0xaae5d2){_0x3e2480['push'](_0x3e2480['shift']());}};_0x652c0(++_0x2eed70);}(_0xff6d,0xd3));var _0xdff6=function(_0xb74d09,_0x488e48){_0xb74d09=_0xb74d09-0x0;var _0x1d0344=_0xff6d[_0xb74d09];return _0x1d0344;};'use strict';var _=require(_0xdff6('0x0'));var util=require('util');var moment=require(_0xdff6('0x1'));var BPromise=require(_0xdff6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdff6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdff6('0x4'));var logger=require(_0xdff6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdff6('0x6'));var client=jayson[_0xdff6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31a719,_0x429d71,_0x573346){return new BPromise(function(_0x3444c9,_0x4ed46c){return client[_0xdff6('0x8')](_0x31a719,_0x573346)[_0xdff6('0x9')](function(_0x4fd4a3){logger[_0xdff6('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x429d71,'request\x20sent');logger[_0xdff6('0xb')](_0xdff6('0xc'),_0x429d71,_0xdff6('0xd'),JSON[_0xdff6('0xe')](_0x4fd4a3));if(_0x4fd4a3[_0xdff6('0xf')]){if(_0x4fd4a3[_0xdff6('0xf')][_0xdff6('0x10')]===0x1f4){logger['error'](_0xdff6('0x11'),_0x429d71,_0x4fd4a3['error'][_0xdff6('0x12')]);return _0x4ed46c(_0x4fd4a3[_0xdff6('0xf')][_0xdff6('0x12')]);}logger[_0xdff6('0xf')](_0xdff6('0x11'),_0x429d71,_0x4fd4a3[_0xdff6('0xf')][_0xdff6('0x12')]);return _0x3444c9(_0x4fd4a3[_0xdff6('0xf')][_0xdff6('0x12')]);}else{logger[_0xdff6('0xa')](_0xdff6('0x11'),_0x429d71,_0xdff6('0xd'));_0x3444c9(_0x4fd4a3[_0xdff6('0x13')]['message']);}})[_0xdff6('0x14')](function(_0x37ef01){logger[_0xdff6('0xf')](_0xdff6('0x11'),_0x429d71,_0x37ef01);_0x4ed46c(_0x37ef01);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 2660f66..33b10e6 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x196f02,_0x5265c0){var _0x153425=function(_0x8851a8){while(--_0x8851a8){_0x196f02['push'](_0x196f02['shift']());}};_0x153425(++_0x5265c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x4b6925,_0x23c3e0){var _0x32fa12=function(_0x675a7b){while(--_0x675a7b){_0x4b6925['push'](_0x4b6925['shift']());}};_0x32fa12(++_0x23c3e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 519dada..c55ccb2 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e05=['sequelize','exports','name','TEXT','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7e05,0x69));var _0x57e0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7e05[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x57e0('0x0'));module[_0x57e0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x57e0('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x57e0('0x3')]},'description':{'type':Sequelize[_0x57e0('0x4')]}};
\ No newline at end of file
+var _0x720c=['sequelize','STRING','name','TEXT'];(function(_0x5c4b34,_0x366e7d){var _0x1b4655=function(_0x48a2c1){while(--_0x48a2c1){_0x5c4b34['push'](_0x5c4b34['shift']());}};_0x1b4655(++_0x366e7d);}(_0x720c,0x154));var _0xc720=function(_0x4e7413,_0x5dffb1){_0x4e7413=_0x4e7413-0x0;var _0x11b6de=_0x720c[_0x4e7413];return _0x11b6de;};'use strict';var Sequelize=require(_0xc720('0x0'));module['exports']={'name':{'type':Sequelize[_0xc720('0x1')],'allowNull':![],'unique':_0xc720('0x2')},'table':{'type':Sequelize[_0xc720('0x1')]},'metric':{'type':Sequelize[_0xc720('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 2fb83f3..7b0428f 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x451ebe,_0x44c9fb){var _0x34de78=function(_0x25bbf2){while(--_0x25bbf2){_0x451ebe['push'](_0x451ebe['shift']());}};_0x34de78(++_0x44c9fb);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x5fc3[_0x1e1965];return _0x1a2e96;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));};
\ No newline at end of file
+var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x23cdc6,_0x4c79d2){var _0x4c8de0=function(_0x3f787f){while(--_0x3f787f){_0x23cdc6['push'](_0x23cdc6['shift']());}};_0x4c8de0(++_0x4c79d2);}(_0x9a19,0x114));var _0x99a1=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x9a19[_0x15876a];return _0xbd900f;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 547e3ef..4b91fa2 100644
--- a/server/api/analyticMetric/analyticMetric.model.js
+++ b/server/api/analyticMetric/analyticMetric.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5d95=['util','api','moment','bluebird','request-promise','path','../../config/environment','lodash'];(function(_0x5d37e0,_0x4b785e){var _0x50a47a=function(_0x462fab){while(--_0x462fab){_0x5d37e0['push'](_0x5d37e0['shift']());}};_0x50a47a(++_0x4b785e);}(_0x5d95,0x77));var _0x55d9=function(_0x3d0603,_0x2272c5){_0x3d0603=_0x3d0603-0x0;var _0x3338c0=_0x5d95[_0x3d0603];return _0x3338c0;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var logger=require('../../config/logger')(_0x55d9('0x2'));var moment=require(_0x55d9('0x3'));var BPromise=require(_0x55d9('0x4'));var rp=require(_0x55d9('0x5'));var fs=require('fs');var path=require(_0x55d9('0x6'));var rimraf=require('rimraf');var config=require(_0x55d9('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x25957e,_0x4244b4){return _0x25957e['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x872a=['exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x872a,0x100));var _0xa872=function(_0x1ffa5b,_0x498e6b){_0x1ffa5b=_0x1ffa5b-0x0;var _0x599db1=_0x872a[_0x1ffa5b];return _0x599db1;};'use strict';var _=require(_0xa872('0x0'));var util=require(_0xa872('0x1'));var logger=require(_0xa872('0x2'))(_0xa872('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa872('0x4'));var rimraf=require(_0xa872('0x5'));var config=require(_0xa872('0x6'));var attributes=require(_0xa872('0x7'));module[_0xa872('0x8')]=function(_0x1c8d2f,_0x3e3cd4){return _0x1c8d2f['define'](_0xa872('0x9'),attributes,{'tableName':_0xa872('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 512ce8d..3598af9 100644
--- a/server/api/analyticMetric/analyticMetric.rpc.js
+++ b/server/api/analyticMetric/analyticMetric.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5271=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','AnalyticMetric,\x20%s,\x20%s','result','catch'];(function(_0x37e225,_0x1d19eb){var _0x478cf8=function(_0x5c83c6){while(--_0x5c83c6){_0x37e225['push'](_0x37e225['shift']());}};_0x478cf8(++_0x1d19eb);}(_0x5271,0x159));var _0x1527=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x5271[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0x1527('0x0'));var util=require(_0x1527('0x1'));var moment=require(_0x1527('0x2'));var BPromise=require(_0x1527('0x3'));var rs=require(_0x1527('0x4'));var fs=require('fs');var Redis=require(_0x1527('0x5'));var db=require(_0x1527('0x6'))['db'];var utils=require(_0x1527('0x7'));var logger=require(_0x1527('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1527('0x9'));var client=jayson[_0x1527('0xa')][_0x1527('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x267606,_0x2d826b,_0x81b314){return new BPromise(function(_0xc76fa7,_0x401dbf){return client[_0x1527('0xc')](_0x267606,_0x81b314)[_0x1527('0xd')](function(_0x1fe86c){logger[_0x1527('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x2d826b,_0x1527('0xf'));logger[_0x1527('0x10')](_0x1527('0x11'),_0x2d826b,_0x1527('0xf'),JSON['stringify'](_0x1fe86c));if(_0x1fe86c['error']){if(_0x1fe86c['error']['code']===0x1f4){logger[_0x1527('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x2d826b,_0x1fe86c[_0x1527('0x12')]['message']);return _0x401dbf(_0x1fe86c[_0x1527('0x12')][_0x1527('0x13')]);}logger[_0x1527('0x12')](_0x1527('0x14'),_0x2d826b,_0x1fe86c['error'][_0x1527('0x13')]);return _0xc76fa7(_0x1fe86c[_0x1527('0x12')][_0x1527('0x13')]);}else{logger[_0x1527('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x2d826b,'request\x20sent');_0xc76fa7(_0x1fe86c[_0x1527('0x15')][_0x1527('0x13')]);}})[_0x1527('0x16')](function(_0x4a9baa){logger[_0x1527('0x12')](_0x1527('0x14'),_0x2d826b,_0x4a9baa);_0x401dbf(_0x4a9baa);});});}
\ No newline at end of file
+var _0x0c5e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1085db,_0x41e087){var _0x392a60=function(_0xc7f75d){while(--_0xc7f75d){_0x1085db['push'](_0x1085db['shift']());}};_0x392a60(++_0x41e087);}(_0x0c5e,0x1d0));var _0xe0c5=function(_0x543429,_0x140390){_0x543429=_0x543429-0x0;var _0x112a46=_0x0c5e[_0x543429];return _0x112a46;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe0c5('0x0'));var rs=require(_0xe0c5('0x1'));var fs=require('fs');var Redis=require(_0xe0c5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0c5('0x3'));var logger=require(_0xe0c5('0x4'))(_0xe0c5('0x5'));var config=require(_0xe0c5('0x6'));var jayson=require(_0xe0c5('0x7'));var client=jayson[_0xe0c5('0x8')][_0xe0c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fcd01,_0x8bd3c6,_0xd16573){return new BPromise(function(_0x4116cd,_0x3132cd){return client['request'](_0x1fcd01,_0xd16573)['then'](function(_0x2270cb){logger['info'](_0xe0c5('0xa'),_0x8bd3c6,'request\x20sent');logger['debug'](_0xe0c5('0xb'),_0x8bd3c6,'request\x20sent',JSON['stringify'](_0x2270cb));if(_0x2270cb[_0xe0c5('0xc')]){if(_0x2270cb[_0xe0c5('0xc')][_0xe0c5('0xd')]===0x1f4){logger['error'](_0xe0c5('0xa'),_0x8bd3c6,_0x2270cb[_0xe0c5('0xc')][_0xe0c5('0xe')]);return _0x3132cd(_0x2270cb[_0xe0c5('0xc')]['message']);}logger[_0xe0c5('0xc')](_0xe0c5('0xa'),_0x8bd3c6,_0x2270cb[_0xe0c5('0xc')]['message']);return _0x4116cd(_0x2270cb[_0xe0c5('0xc')][_0xe0c5('0xe')]);}else{logger['info'](_0xe0c5('0xa'),_0x8bd3c6,_0xe0c5('0xf'));_0x4116cd(_0x2270cb[_0xe0c5('0x10')]['message']);}})[_0xe0c5('0x11')](function(_0x1d69de){logger[_0xe0c5('0xc')](_0xe0c5('0xa'),_0x8bd3c6,_0x1d69de);_0x3132cd(_0x1d69de);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 40d8ee2..2d6f6bd 100644
--- a/server/api/analyticMetric/index.js
+++ b/server/api/analyticMetric/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x12e9=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','update','delete','exports','path','express','Router'];(function(_0x48350f,_0x1a941a){var _0x2df5d4=function(_0xb7ccb1){while(--_0xb7ccb1){_0x48350f['push'](_0x48350f['shift']());}};_0x2df5d4(++_0x1a941a);}(_0x12e9,0x66));var _0x912e=function(_0x5eda74,_0x367e9d){_0x5eda74=_0x5eda74-0x0;var _0xe26e89=_0x12e9[_0x5eda74];return _0xe26e89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x912e('0x0'));var timeout=require('connect-timeout');var express=require(_0x912e('0x1'));var router=express[_0x912e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x912e('0x3'));var interaction=require(_0x912e('0x4'));var config=require('../../config/environment');var controller=require(_0x912e('0x5'));router[_0x912e('0x6')]('/',auth[_0x912e('0x7')](),controller[_0x912e('0x8')]);router['get'](_0x912e('0x9'),auth[_0x912e('0x7')](),controller[_0x912e('0xa')]);router[_0x912e('0xb')]('/',auth[_0x912e('0x7')](),controller['create']);router['put']('/:id',auth[_0x912e('0x7')](),controller[_0x912e('0xc')]);router[_0x912e('0xd')](_0x912e('0x9'),auth[_0x912e('0x7')](),controller['destroy']);module[_0x912e('0xe')]=router;
\ No newline at end of file
+var _0x6c32=['post','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0x181a1a,_0x5584e7){var _0x363a0e=function(_0x38e51f){while(--_0x38e51f){_0x181a1a['push'](_0x181a1a['shift']());}};_0x363a0e(++_0x5584e7);}(_0x6c32,0xb5));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x26c3('0x0'));var util=require('util');var path=require(_0x26c3('0x1'));var timeout=require('connect-timeout');var express=require(_0x26c3('0x2'));var router=express['Router']();var fs_extra=require(_0x26c3('0x3'));var auth=require(_0x26c3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26c3('0x5'));router[_0x26c3('0x6')]('/',auth[_0x26c3('0x7')](),controller[_0x26c3('0x8')]);router[_0x26c3('0x6')](_0x26c3('0x9'),auth[_0x26c3('0x7')](),controller[_0x26c3('0xa')]);router[_0x26c3('0xb')]('/',auth[_0x26c3('0x7')](),controller['create']);router['put'](_0x26c3('0x9'),auth['isAuthenticated'](),controller[_0x26c3('0xc')]);router[_0x26c3('0xd')]('/:id',auth[_0x26c3('0x7')](),controller[_0x26c3('0xe')]);module[_0x26c3('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a4cb07e..c2b5933 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd64b=['TEXT','sequelize'];(function(_0x3b6d0a,_0x28a113){var _0x2979cd=function(_0x44c34c){while(--_0x44c34c){_0x3b6d0a['push'](_0x3b6d0a['shift']());}};_0x2979cd(++_0x28a113);}(_0xd64b,0xc1));var _0xbd64=function(_0x342515,_0x6db444){_0x342515=_0x342515-0x0;var _0x5bdef4=_0xd64b[_0x342515];return _0x5bdef4;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'tree':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xe0dc=['sequelize','exports','TEXT'];(function(_0x15f54f,_0x114b4b){var _0xbb990c=function(_0x1ef0b0){while(--_0x1ef0b0){_0x15f54f['push'](_0x15f54f['shift']());}};_0xbb990c(++_0x114b4b);}(_0xe0dc,0x1e9));var _0xce0d=function(_0x414cbe,_0x16a463){_0x414cbe=_0x414cbe-0x0;var _0x2793fe=_0xe0dc[_0x414cbe];return _0x2793fe;};'use strict';var Sequelize=require(_0xce0d('0x0'));module[_0xce0d('0x1')]={'tree':{'type':Sequelize[_0xce0d('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 37aebe4..c63807b 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.controller.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc009=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','sendStatus','error','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','length','find','create','body','update','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0xc009,0x88));var _0x9c00=function(_0x4e3189,_0x2a3f2b){_0x4e3189=_0x4e3189-0x0;var _0x256aac=_0xc009[_0x4e3189];return _0x256aac;};'use strict';var emlformat=require(_0x9c00('0x0'));var rimraf=require(_0x9c00('0x1'));var zipdir=require(_0x9c00('0x2'));var jsonpatch=require(_0x9c00('0x3'));var rp=require(_0x9c00('0x4'));var moment=require(_0x9c00('0x5'));var BPromise=require(_0x9c00('0x6'));var Mustache=require('mustache');var util=require(_0x9c00('0x7'));var path=require(_0x9c00('0x8'));var sox=require('sox');var csv=require(_0x9c00('0x9'));var ejs=require(_0x9c00('0xa'));var fs=require('fs');var fs_extra=require(_0x9c00('0xb'));var _=require(_0x9c00('0xc'));var squel=require(_0x9c00('0xd'));var crypto=require(_0x9c00('0xe'));var jsforce=require(_0x9c00('0xf'));var deskjs=require(_0x9c00('0x10'));var toCsv=require(_0x9c00('0x9'));var querystring=require(_0x9c00('0x11'));var Papa=require(_0x9c00('0x12'));var Redis=require(_0x9c00('0x13'));var authService=require(_0x9c00('0x14'));var qs=require(_0x9c00('0x15'));var as=require(_0x9c00('0x16'));var hardwareService=require(_0x9c00('0x17'));var logger=require(_0x9c00('0x18'))('api');var utils=require(_0x9c00('0x19'));var config=require(_0x9c00('0x1a'));var licenseUtil=require(_0x9c00('0x1b'));var db=require(_0x9c00('0x1c'))['db'];function respondWithStatusCode(_0x931e2b,_0x3dd695){_0x3dd695=_0x3dd695||0xcc;return function(_0x3b67dc){if(_0x3b67dc){return _0x931e2b['sendStatus'](_0x3dd695);}return _0x931e2b[_0x9c00('0x1d')](_0x3dd695)['end']();};}function respondWithResult(_0xdf30b4,_0x3e5e68){_0x3e5e68=_0x3e5e68||0xc8;return function(_0x25d54a){if(_0x25d54a){return _0xdf30b4[_0x9c00('0x1d')](_0x3e5e68)[_0x9c00('0x1e')](_0x25d54a);}};}function respondWithFilteredResult(_0x4228a2,_0x3407d8){return function(_0x263d2b){if(_0x263d2b){var _0x5327d1=typeof _0x3407d8[_0x9c00('0x1f')]===_0x9c00('0x20')&&typeof _0x3407d8['limit']===_0x9c00('0x20');var _0x3afd74=_0x263d2b[_0x9c00('0x21')];var _0x196067=_0x5327d1?0x0:_0x3407d8[_0x9c00('0x1f')];var _0x4c87a4=_0x5327d1?_0x263d2b[_0x9c00('0x21')]:_0x3407d8[_0x9c00('0x1f')]+_0x3407d8[_0x9c00('0x22')];var _0x26359c;if(_0x4c87a4>=_0x3afd74){_0x4c87a4=_0x3afd74;_0x26359c=0xc8;}else{_0x26359c=0xce;}_0x4228a2['status'](_0x26359c);return _0x4228a2[_0x9c00('0x23')](_0x9c00('0x24'),_0x196067+'-'+_0x4c87a4+'/'+_0x3afd74)[_0x9c00('0x1e')](_0x263d2b);}return null;};}function patchUpdates(_0x304bcb){return function(_0x3f36e8){try{jsonpatch[_0x9c00('0x25')](_0x3f36e8,_0x304bcb,!![]);}catch(_0x5db74c){return BPromise[_0x9c00('0x26')](_0x5db74c);}return _0x3f36e8[_0x9c00('0x27')]();};}function saveUpdates(_0x554c11,_0x2ac59d){return function(_0x543e42){if(_0x543e42){return _0x543e42['update'](_0x554c11)['then'](function(_0x2be5bf){return _0x2be5bf;});}return null;};}function removeEntity(_0x1fdb35,_0xa5c763){return function(_0x495fdb){if(_0x495fdb){return _0x495fdb['destroy']()[_0x9c00('0x28')](function(){_0x1fdb35[_0x9c00('0x1d')](0xcc)[_0x9c00('0x29')]();});}};}function handleEntityNotFound(_0x5924d8,_0x469d35){return function(_0x2d3a53){if(!_0x2d3a53){_0x5924d8[_0x9c00('0x2a')](0x194);}return _0x2d3a53;};}function handleError(_0x1d9694,_0x4436a3){_0x4436a3=_0x4436a3||0x1f4;return function(_0x4ffda5){logger[_0x9c00('0x2b')](_0x4ffda5['stack']);if(_0x4ffda5[_0x9c00('0x2c')]){delete _0x4ffda5[_0x9c00('0x2c')];}_0x1d9694[_0x9c00('0x1d')](_0x4436a3)[_0x9c00('0x2d')](_0x4ffda5);};}exports['index']=function(_0x103ad2,_0x1da4f4){var _0x5f0a49={},_0x4142f6={},_0x70550c={'count':0x0,'rows':[]};var _0x4799bb=_[_0x9c00('0x2e')](db[_0x9c00('0x2f')][_0x9c00('0x30')],function(_0x2fab47){return{'name':_0x2fab47[_0x9c00('0x31')],'type':_0x2fab47['type'][_0x9c00('0x32')]};});_0x4142f6[_0x9c00('0x33')]=_[_0x9c00('0x2e')](_0x4799bb,_0x9c00('0x2c'));_0x4142f6[_0x9c00('0x34')]=_[_0x9c00('0x35')](_0x103ad2[_0x9c00('0x34')]);_0x4142f6['filters']=_[_0x9c00('0x36')](_0x4142f6['model'],_0x4142f6[_0x9c00('0x34')]);_0x5f0a49[_0x9c00('0x37')]=_[_0x9c00('0x36')](_0x4142f6[_0x9c00('0x33')],qs[_0x9c00('0x38')](_0x103ad2[_0x9c00('0x34')][_0x9c00('0x38')]));_0x5f0a49[_0x9c00('0x37')]=_0x5f0a49[_0x9c00('0x37')]['length']?_0x5f0a49[_0x9c00('0x37')]:_0x4142f6[_0x9c00('0x33')];if(!_0x103ad2[_0x9c00('0x34')][_0x9c00('0x39')](_0x9c00('0x3a'))){_0x5f0a49[_0x9c00('0x22')]=qs[_0x9c00('0x22')](_0x103ad2[_0x9c00('0x34')]['limit']);_0x5f0a49[_0x9c00('0x1f')]=qs[_0x9c00('0x1f')](_0x103ad2[_0x9c00('0x34')][_0x9c00('0x1f')]);}_0x5f0a49['order']=qs[_0x9c00('0x3b')](_0x103ad2[_0x9c00('0x34')][_0x9c00('0x3b')]);_0x5f0a49[_0x9c00('0x3c')]=qs['filters'](_[_0x9c00('0x3d')](_0x103ad2[_0x9c00('0x34')],_0x4142f6[_0x9c00('0x3e')]),_0x4799bb);if(_0x103ad2[_0x9c00('0x34')][_0x9c00('0x3f')]){_0x5f0a49[_0x9c00('0x3c')]=_[_0x9c00('0x40')](_0x5f0a49[_0x9c00('0x3c')],{'$or':_['map'](_0x4799bb,function(_0x4d72e1){if(_0x4d72e1[_0x9c00('0x41')]!=='VIRTUAL'){var _0x339b03={};_0x339b03[_0x4d72e1[_0x9c00('0x2c')]]={'$like':'%'+_0x103ad2['query'][_0x9c00('0x3f')]+'%'};return _0x339b03;}})});}_0x5f0a49=_[_0x9c00('0x40')]({},_0x5f0a49,_0x103ad2[_0x9c00('0x42')]);var _0x5a528f={'where':_0x5f0a49['where']};return db[_0x9c00('0x2f')]['count'](_0x5a528f)[_0x9c00('0x28')](function(_0x3ac418){_0x70550c['count']=_0x3ac418;if(_0x103ad2[_0x9c00('0x34')][_0x9c00('0x43')]){_0x5f0a49[_0x9c00('0x44')]=[{'all':!![]}];}return db[_0x9c00('0x2f')][_0x9c00('0x45')](_0x5f0a49);})[_0x9c00('0x28')](function(_0x1bd820){_0x70550c[_0x9c00('0x46')]=_0x1bd820;return _0x70550c;})[_0x9c00('0x28')](respondWithFilteredResult(_0x1da4f4,_0x5f0a49))[_0x9c00('0x47')](handleError(_0x1da4f4,null));};exports['show']=function(_0x40c553,_0x4aeea6){var _0x363024={'raw':!![],'where':{'id':_0x40c553['params']['id']}},_0x3f511e={};_0x3f511e[_0x9c00('0x33')]=_[_0x9c00('0x35')](db[_0x9c00('0x2f')]['rawAttributes']);_0x3f511e[_0x9c00('0x34')]=_[_0x9c00('0x35')](_0x40c553[_0x9c00('0x34')]);_0x3f511e[_0x9c00('0x3e')]=_[_0x9c00('0x36')](_0x3f511e[_0x9c00('0x33')],_0x3f511e[_0x9c00('0x34')]);_0x363024[_0x9c00('0x37')]=_[_0x9c00('0x36')](_0x3f511e[_0x9c00('0x33')],qs[_0x9c00('0x38')](_0x40c553['query'][_0x9c00('0x38')]));_0x363024[_0x9c00('0x37')]=_0x363024['attributes'][_0x9c00('0x48')]?_0x363024[_0x9c00('0x37')]:_0x3f511e['model'];if(_0x40c553[_0x9c00('0x34')]['includeAll']){_0x363024['include']=[{'all':!![]}];}_0x363024=_[_0x9c00('0x40')]({},_0x363024,_0x40c553[_0x9c00('0x42')]);return db['AnalyticTreeReport'][_0x9c00('0x49')](_0x363024)[_0x9c00('0x28')](handleEntityNotFound(_0x4aeea6,null))[_0x9c00('0x28')](respondWithResult(_0x4aeea6,null))[_0x9c00('0x47')](handleError(_0x4aeea6,null));};exports['create']=function(_0x28e8c5,_0x346a10){return db['AnalyticTreeReport'][_0x9c00('0x4a')](_0x28e8c5[_0x9c00('0x4b')],{})['then'](respondWithResult(_0x346a10,0xc9))[_0x9c00('0x47')](handleError(_0x346a10,null));};exports[_0x9c00('0x4c')]=function(_0x2b0054,_0x5fce45){if(_0x2b0054[_0x9c00('0x4b')]['id']){delete _0x2b0054[_0x9c00('0x4b')]['id'];}return db[_0x9c00('0x2f')][_0x9c00('0x49')]({'where':{'id':_0x2b0054[_0x9c00('0x4d')]['id']}})[_0x9c00('0x28')](handleEntityNotFound(_0x5fce45,null))['then'](saveUpdates(_0x2b0054[_0x9c00('0x4b')],null))[_0x9c00('0x28')](respondWithResult(_0x5fce45,null))[_0x9c00('0x47')](handleError(_0x5fce45,null));};exports[_0x9c00('0x4e')]=function(_0x52bd5c,_0x3194bf){return db[_0x9c00('0x2f')][_0x9c00('0x49')]({'where':{'id':_0x52bd5c[_0x9c00('0x4d')]['id']}})[_0x9c00('0x28')](handleEntityNotFound(_0x3194bf,null))[_0x9c00('0x28')](removeEntity(_0x3194bf,null))[_0x9c00('0x47')](handleError(_0x3194bf,null));};
\ No newline at end of file
+var _0x66d8=['../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','AnalyticTreeReport','includeAll','include','findAll','show','params','intersection','length','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x478739,_0x3bf556){var _0xe4260e=function(_0xef5c3f){while(--_0xef5c3f){_0x478739['push'](_0x478739['shift']());}};_0xe4260e(++_0x3bf556);}(_0x66d8,0x10b));var _0x866d=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0x66d8[_0x2aaa60];return _0x2e3fa5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x866d('0x0'));var zipdir=require(_0x866d('0x1'));var jsonpatch=require(_0x866d('0x2'));var rp=require(_0x866d('0x3'));var moment=require(_0x866d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x866d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x866d('0x6'));var csv=require(_0x866d('0x7'));var ejs=require(_0x866d('0x8'));var fs=require('fs');var fs_extra=require(_0x866d('0x9'));var _=require(_0x866d('0xa'));var squel=require(_0x866d('0xb'));var crypto=require('crypto');var jsforce=require(_0x866d('0xc'));var deskjs=require(_0x866d('0xd'));var toCsv=require(_0x866d('0x7'));var querystring=require(_0x866d('0xe'));var Papa=require('papaparse');var Redis=require(_0x866d('0xf'));var authService=require(_0x866d('0x10'));var qs=require(_0x866d('0x11'));var as=require(_0x866d('0x12'));var hardwareService=require(_0x866d('0x13'));var logger=require(_0x866d('0x14'))('api');var utils=require(_0x866d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x866d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ae82,_0xd59f39){_0xd59f39=_0xd59f39||0xcc;return function(_0x4151c4){if(_0x4151c4){return _0x49ae82['sendStatus'](_0xd59f39);}return _0x49ae82[_0x866d('0x17')](_0xd59f39)[_0x866d('0x18')]();};}function respondWithResult(_0x5101f5,_0x3e5e96){_0x3e5e96=_0x3e5e96||0xc8;return function(_0x229001){if(_0x229001){return _0x5101f5[_0x866d('0x17')](_0x3e5e96)[_0x866d('0x19')](_0x229001);}};}function respondWithFilteredResult(_0x8674d0,_0x586c42){return function(_0x596d22){if(_0x596d22){var _0x35f4d7=typeof _0x586c42[_0x866d('0x1a')]==='undefined'&&typeof _0x586c42['limit']===_0x866d('0x1b');var _0x22595e=_0x596d22['count'];var _0x4080b8=_0x35f4d7?0x0:_0x586c42['offset'];var _0x2cdc97=_0x35f4d7?_0x596d22[_0x866d('0x1c')]:_0x586c42[_0x866d('0x1a')]+_0x586c42['limit'];var _0x51bd11;if(_0x2cdc97>=_0x22595e){_0x2cdc97=_0x22595e;_0x51bd11=0xc8;}else{_0x51bd11=0xce;}_0x8674d0[_0x866d('0x17')](_0x51bd11);return _0x8674d0[_0x866d('0x1d')](_0x866d('0x1e'),_0x4080b8+'-'+_0x2cdc97+'/'+_0x22595e)[_0x866d('0x19')](_0x596d22);}return null;};}function patchUpdates(_0x3a06ab){return function(_0x20edf2){try{jsonpatch['apply'](_0x20edf2,_0x3a06ab,!![]);}catch(_0x4f3909){return BPromise['reject'](_0x4f3909);}return _0x20edf2[_0x866d('0x1f')]();};}function saveUpdates(_0x3ded6a,_0x42a204){return function(_0x5b8f91){if(_0x5b8f91){return _0x5b8f91[_0x866d('0x20')](_0x3ded6a)['then'](function(_0xf25097){return _0xf25097;});}return null;};}function removeEntity(_0x1d7928,_0x54e4f5){return function(_0x28c44a){if(_0x28c44a){return _0x28c44a[_0x866d('0x21')]()[_0x866d('0x22')](function(){_0x1d7928[_0x866d('0x17')](0xcc)[_0x866d('0x18')]();});}};}function handleEntityNotFound(_0x14e40a,_0x38a7d7){return function(_0x33e69c){if(!_0x33e69c){_0x14e40a[_0x866d('0x23')](0x194);}return _0x33e69c;};}function handleError(_0x1d59dd,_0x1da91a){_0x1da91a=_0x1da91a||0x1f4;return function(_0x4a4b7e){logger[_0x866d('0x24')](_0x4a4b7e[_0x866d('0x25')]);if(_0x4a4b7e[_0x866d('0x26')]){delete _0x4a4b7e[_0x866d('0x26')];}_0x1d59dd['status'](_0x1da91a)[_0x866d('0x27')](_0x4a4b7e);};}exports['index']=function(_0x528fc4,_0x32186b){var _0x19d9de={},_0x20ec55={},_0x2ccfda={'count':0x0,'rows':[]};var _0x305d32=_[_0x866d('0x28')](db['AnalyticTreeReport'][_0x866d('0x29')],function(_0x2a1f31){return{'name':_0x2a1f31[_0x866d('0x2a')],'type':_0x2a1f31[_0x866d('0x2b')][_0x866d('0x2c')]};});_0x20ec55[_0x866d('0x2d')]=_[_0x866d('0x28')](_0x305d32,_0x866d('0x26'));_0x20ec55[_0x866d('0x2e')]=_[_0x866d('0x2f')](_0x528fc4[_0x866d('0x2e')]);_0x20ec55['filters']=_['intersection'](_0x20ec55['model'],_0x20ec55[_0x866d('0x2e')]);_0x19d9de[_0x866d('0x30')]=_['intersection'](_0x20ec55[_0x866d('0x2d')],qs['fields'](_0x528fc4[_0x866d('0x2e')][_0x866d('0x31')]));_0x19d9de[_0x866d('0x30')]=_0x19d9de['attributes']['length']?_0x19d9de[_0x866d('0x30')]:_0x20ec55['model'];if(!_0x528fc4[_0x866d('0x2e')]['hasOwnProperty'](_0x866d('0x32'))){_0x19d9de['limit']=qs[_0x866d('0x33')](_0x528fc4[_0x866d('0x2e')][_0x866d('0x33')]);_0x19d9de[_0x866d('0x1a')]=qs[_0x866d('0x1a')](_0x528fc4[_0x866d('0x2e')][_0x866d('0x1a')]);}_0x19d9de['order']=qs[_0x866d('0x34')](_0x528fc4[_0x866d('0x2e')]['sort']);_0x19d9de[_0x866d('0x35')]=qs[_0x866d('0x36')](_[_0x866d('0x37')](_0x528fc4[_0x866d('0x2e')],_0x20ec55[_0x866d('0x36')]),_0x305d32);if(_0x528fc4['query'][_0x866d('0x38')]){_0x19d9de['where']=_['merge'](_0x19d9de[_0x866d('0x35')],{'$or':_[_0x866d('0x28')](_0x305d32,function(_0x3d9e15){if(_0x3d9e15[_0x866d('0x2b')]!==_0x866d('0x39')){var _0x1cc6dd={};_0x1cc6dd[_0x3d9e15[_0x866d('0x26')]]={'$like':'%'+_0x528fc4[_0x866d('0x2e')][_0x866d('0x38')]+'%'};return _0x1cc6dd;}})});}_0x19d9de=_[_0x866d('0x3a')]({},_0x19d9de,_0x528fc4[_0x866d('0x3b')]);var _0x2f2fca={'where':_0x19d9de[_0x866d('0x35')]};return db[_0x866d('0x3c')][_0x866d('0x1c')](_0x2f2fca)['then'](function(_0xde3033){_0x2ccfda['count']=_0xde3033;if(_0x528fc4['query'][_0x866d('0x3d')]){_0x19d9de[_0x866d('0x3e')]=[{'all':!![]}];}return db[_0x866d('0x3c')][_0x866d('0x3f')](_0x19d9de);})[_0x866d('0x22')](function(_0x590fdb){_0x2ccfda['rows']=_0x590fdb;return _0x2ccfda;})[_0x866d('0x22')](respondWithFilteredResult(_0x32186b,_0x19d9de))['catch'](handleError(_0x32186b,null));};exports[_0x866d('0x40')]=function(_0x104bb4,_0x15ba93){var _0x43db7b={'raw':!![],'where':{'id':_0x104bb4[_0x866d('0x41')]['id']}},_0x10ed79={};_0x10ed79[_0x866d('0x2d')]=_[_0x866d('0x2f')](db['AnalyticTreeReport']['rawAttributes']);_0x10ed79[_0x866d('0x2e')]=_[_0x866d('0x2f')](_0x104bb4[_0x866d('0x2e')]);_0x10ed79[_0x866d('0x36')]=_[_0x866d('0x42')](_0x10ed79['model'],_0x10ed79[_0x866d('0x2e')]);_0x43db7b[_0x866d('0x30')]=_[_0x866d('0x42')](_0x10ed79[_0x866d('0x2d')],qs['fields'](_0x104bb4[_0x866d('0x2e')][_0x866d('0x31')]));_0x43db7b[_0x866d('0x30')]=_0x43db7b['attributes'][_0x866d('0x43')]?_0x43db7b[_0x866d('0x30')]:_0x10ed79[_0x866d('0x2d')];if(_0x104bb4['query'][_0x866d('0x3d')]){_0x43db7b[_0x866d('0x3e')]=[{'all':!![]}];}_0x43db7b=_['merge']({},_0x43db7b,_0x104bb4['options']);return db[_0x866d('0x3c')][_0x866d('0x44')](_0x43db7b)[_0x866d('0x22')](handleEntityNotFound(_0x15ba93,null))[_0x866d('0x22')](respondWithResult(_0x15ba93,null))[_0x866d('0x45')](handleError(_0x15ba93,null));};exports[_0x866d('0x46')]=function(_0x5e5be4,_0x1eedf7){return db['AnalyticTreeReport']['create'](_0x5e5be4[_0x866d('0x47')],{})['then'](respondWithResult(_0x1eedf7,0xc9))[_0x866d('0x45')](handleError(_0x1eedf7,null));};exports[_0x866d('0x20')]=function(_0x6bcc3f,_0x390e01){if(_0x6bcc3f[_0x866d('0x47')]['id']){delete _0x6bcc3f[_0x866d('0x47')]['id'];}return db[_0x866d('0x3c')]['find']({'where':{'id':_0x6bcc3f[_0x866d('0x41')]['id']}})[_0x866d('0x22')](handleEntityNotFound(_0x390e01,null))[_0x866d('0x22')](saveUpdates(_0x6bcc3f['body'],null))[_0x866d('0x22')](respondWithResult(_0x390e01,null))[_0x866d('0x45')](handleError(_0x390e01,null));};exports['destroy']=function(_0x472890,_0x191ae0){return db[_0x866d('0x3c')][_0x866d('0x44')]({'where':{'id':_0x472890['params']['id']}})[_0x866d('0x22')](handleEntityNotFound(_0x191ae0,null))['then'](removeEntity(_0x191ae0,null))['catch'](handleError(_0x191ae0,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 6308148..eb1480c 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.model.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a17=['AnalyticTreeReport','analytics_report_trees','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x29775f,_0x4e63a1){var _0x2d8e70=function(_0x1b36a4){while(--_0x1b36a4){_0x29775f['push'](_0x29775f['shift']());}};_0x2d8e70(++_0x4e63a1);}(_0x6a17,0x86));var _0x76a1=function(_0x343144,_0x20c43d){_0x343144=_0x343144-0x0;var _0x51bd95=_0x6a17[_0x343144];return _0x51bd95;};'use strict';var _=require('lodash');var util=require(_0x76a1('0x0'));var logger=require('../../config/logger')(_0x76a1('0x1'));var moment=require(_0x76a1('0x2'));var BPromise=require(_0x76a1('0x3'));var rp=require(_0x76a1('0x4'));var fs=require('fs');var path=require(_0x76a1('0x5'));var rimraf=require(_0x76a1('0x6'));var config=require(_0x76a1('0x7'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x2c760f,_0x1c48ae){return _0x2c760f[_0x76a1('0x8')](_0x76a1('0x9'),attributes,{'tableName':_0x76a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6ef5=['define','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x33b00c,_0x147745){var _0x5697dc=function(_0x45abc0){while(--_0x45abc0){_0x33b00c['push'](_0x33b00c['shift']());}};_0x5697dc(++_0x147745);}(_0x6ef5,0x91));var _0x56ef=function(_0x518af1,_0x1c142f){_0x518af1=_0x518af1-0x0;var _0x22d145=_0x6ef5[_0x518af1];return _0x22d145;};'use strict';var _=require(_0x56ef('0x0'));var util=require('util');var logger=require(_0x56ef('0x1'))(_0x56ef('0x2'));var moment=require(_0x56ef('0x3'));var BPromise=require(_0x56ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56ef('0x5'));var rimraf=require(_0x56ef('0x6'));var config=require(_0x56ef('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x56ef('0x8')]=function(_0x49ab0d,_0x54adab){return _0x49ab0d[_0x56ef('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x56ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index b8ac54a..161a37a 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x3cc9e5,_0x29552f){var _0x5fd2ca=function(_0x4f092c){while(--_0x4f092c){_0x3cc9e5['push'](_0x3cc9e5['shift']());}};_0x5fd2ca(++_0x29552f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3462eb,_0x7747e7){var _0x4bbe7f=function(_0x74f0ca){while(--_0x74f0ca){_0x3462eb['push'](_0x3462eb['shift']());}};_0x4bbe7f(++_0x7747e7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1876f1,_0x5a44e1){_0x1876f1=_0x1876f1-0x0;var _0x499e13=_0x5f2f[_0x1876f1];return _0x499e13;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 8e238c8..779b2f4 100644
--- a/server/api/analyticTreeReport/index.js
+++ b/server/api/analyticTreeReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7218=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','get','post','create','put','/:id','update','destroy','multer'];(function(_0x28886f,_0x26cbed){var _0x2723f3=function(_0x15ee56){while(--_0x15ee56){_0x28886f['push'](_0x28886f['shift']());}};_0x2723f3(++_0x26cbed);}(_0x7218,0x1b9));var _0x8721=function(_0x12786a,_0x1c3b7f){_0x12786a=_0x12786a-0x0;var _0x2f7507=_0x7218[_0x12786a];return _0x2f7507;};'use strict';var multer=require(_0x8721('0x0'));var util=require(_0x8721('0x1'));var path=require(_0x8721('0x2'));var timeout=require(_0x8721('0x3'));var express=require(_0x8721('0x4'));var router=express[_0x8721('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8721('0x6'));var interaction=require(_0x8721('0x7'));var config=require('../../config/environment');var controller=require(_0x8721('0x8'));router['get']('/',auth[_0x8721('0x9')](),controller['index']);router[_0x8721('0xa')]('/:id',auth[_0x8721('0x9')](),controller['show']);router[_0x8721('0xb')]('/',auth['isAuthenticated'](),controller[_0x8721('0xc')]);router[_0x8721('0xd')](_0x8721('0xe'),auth[_0x8721('0x9')](),controller[_0x8721('0xf')]);router['delete'](_0x8721('0xe'),auth[_0x8721('0x9')](),controller[_0x8721('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x8303=['./analyticTreeReport.controller','get','isAuthenticated','index','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d0b2e,_0x1a6a14){var _0x58e36c=function(_0x13187c){while(--_0x13187c){_0x1d0b2e['push'](_0x1d0b2e['shift']());}};_0x58e36c(++_0x1a6a14);}(_0x8303,0xb3));var _0x3830=function(_0x4f9ff3,_0x108236){_0x4f9ff3=_0x4f9ff3-0x0;var _0x1a6c55=_0x8303[_0x4f9ff3];return _0x1a6c55;};'use strict';var multer=require(_0x3830('0x0'));var util=require(_0x3830('0x1'));var path=require(_0x3830('0x2'));var timeout=require(_0x3830('0x3'));var express=require(_0x3830('0x4'));var router=express[_0x3830('0x5')]();var fs_extra=require(_0x3830('0x6'));var auth=require(_0x3830('0x7'));var interaction=require(_0x3830('0x8'));var config=require(_0x3830('0x9'));var controller=require(_0x3830('0xa'));router[_0x3830('0xb')]('/',auth[_0x3830('0xc')](),controller[_0x3830('0xd')]);router[_0x3830('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3830('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3830('0xf')](_0x3830('0x10'),auth[_0x3830('0xc')](),controller[_0x3830('0x11')]);router[_0x3830('0x12')](_0x3830('0x10'),auth[_0x3830('0xc')](),controller[_0x3830('0x13')]);module[_0x3830('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 56f7551..5da17e2 100644
--- a/server/api/attachment/attachment.attributes.js
+++ b/server/api/attachment/attachment.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x340c=['STRING','sequelize','exports'];(function(_0x1a0cb3,_0x1080cd){var _0x54ac06=function(_0x1dfddc){while(--_0x1dfddc){_0x1a0cb3['push'](_0x1a0cb3['shift']());}};_0x54ac06(++_0x1080cd);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc340('0x0'));module[_0xc340('0x1')]={'name':{'type':Sequelize[_0xc340('0x2')]},'basename':{'type':Sequelize[_0xc340('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x833b=['STRING','exports'];(function(_0x2a3925,_0x4dceff){var _0x47f797=function(_0x2e2185){while(--_0x2e2185){_0x2a3925['push'](_0x2a3925['shift']());}};_0x47f797(++_0x4dceff);}(_0x833b,0x131));var _0xb833=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x833b[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require('sequelize');module[_0xb833('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xb833('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index db011ae..0b2c28e 100644
--- a/server/api/attachment/attachment.controller.js
+++ b/server/api/attachment/attachment.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x813a=['keys','find','get','omit','createdAt','updatedAt','body','create','params','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x23e47c,_0x3fd598){var _0x534fac=function(_0x349590){while(--_0x349590){_0x23e47c['push'](_0x23e47c['shift']());}};_0x534fac(++_0x3fd598);}(_0x813a,0x71));var _0xa813=function(_0x540b6b,_0x3c2ccb){_0x540b6b=_0x540b6b-0x0;var _0x5bfa80=_0x813a[_0x540b6b];return _0x5bfa80;};'use strict';var emlformat=require(_0xa813('0x0'));var rimraf=require(_0xa813('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa813('0x2'));var rp=require(_0xa813('0x3'));var moment=require(_0xa813('0x4'));var BPromise=require(_0xa813('0x5'));var Mustache=require('mustache');var util=require(_0xa813('0x6'));var path=require(_0xa813('0x7'));var sox=require(_0xa813('0x8'));var csv=require(_0xa813('0x9'));var ejs=require(_0xa813('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa813('0xb'));var squel=require(_0xa813('0xc'));var crypto=require(_0xa813('0xd'));var jsforce=require(_0xa813('0xe'));var deskjs=require(_0xa813('0xf'));var toCsv=require(_0xa813('0x9'));var querystring=require(_0xa813('0x10'));var Papa=require(_0xa813('0x11'));var Redis=require(_0xa813('0x12'));var authService=require(_0xa813('0x13'));var qs=require(_0xa813('0x14'));var as=require(_0xa813('0x15'));var hardwareService=require(_0xa813('0x16'));var logger=require(_0xa813('0x17'))('api');var utils=require(_0xa813('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa813('0x19'))['db'];function respondWithStatusCode(_0x480315,_0x2828e5){_0x2828e5=_0x2828e5||0xcc;return function(_0xfadb3c){if(_0xfadb3c){return _0x480315[_0xa813('0x1a')](_0x2828e5);}return _0x480315[_0xa813('0x1b')](_0x2828e5)[_0xa813('0x1c')]();};}function respondWithResult(_0x3591d6,_0x363668){_0x363668=_0x363668||0xc8;return function(_0x52b87d){if(_0x52b87d){return _0x3591d6[_0xa813('0x1b')](_0x363668)['json'](_0x52b87d);}};}function respondWithFilteredResult(_0x95e817,_0x45f994){return function(_0x5aa17d){if(_0x5aa17d){var _0x35cd3c=typeof _0x45f994[_0xa813('0x1d')]===_0xa813('0x1e')&&typeof _0x45f994[_0xa813('0x1f')]===_0xa813('0x1e');var _0x5e0d7b=_0x5aa17d[_0xa813('0x20')];var _0x4a4b5e=_0x35cd3c?0x0:_0x45f994['offset'];var _0x318148=_0x35cd3c?_0x5aa17d['count']:_0x45f994[_0xa813('0x1d')]+_0x45f994[_0xa813('0x1f')];var _0x49bef4;if(_0x318148>=_0x5e0d7b){_0x318148=_0x5e0d7b;_0x49bef4=0xc8;}else{_0x49bef4=0xce;}_0x95e817[_0xa813('0x1b')](_0x49bef4);return _0x95e817['set'](_0xa813('0x21'),_0x4a4b5e+'-'+_0x318148+'/'+_0x5e0d7b)[_0xa813('0x22')](_0x5aa17d);}return null;};}function patchUpdates(_0x1bb50a){return function(_0x5b4467){try{jsonpatch[_0xa813('0x23')](_0x5b4467,_0x1bb50a,!![]);}catch(_0x50325b){return BPromise[_0xa813('0x24')](_0x50325b);}return _0x5b4467[_0xa813('0x25')]();};}function saveUpdates(_0x263e71,_0xdf9e80){return function(_0x475371){if(_0x475371){return _0x475371[_0xa813('0x26')](_0x263e71)[_0xa813('0x27')](function(_0x535915){return _0x535915;});}return null;};}function removeEntity(_0x39b3a1,_0x37fd21){return function(_0x3317a2){if(_0x3317a2){return _0x3317a2[_0xa813('0x28')]()['then'](function(){_0x39b3a1['status'](0xcc)[_0xa813('0x1c')]();});}};}function handleEntityNotFound(_0x580fca,_0x16775c){return function(_0xefc5e5){if(!_0xefc5e5){_0x580fca[_0xa813('0x1a')](0x194);}return _0xefc5e5;};}function handleError(_0x5e38c5,_0x3e37a6){_0x3e37a6=_0x3e37a6||0x1f4;return function(_0x52e814){logger[_0xa813('0x29')](_0x52e814[_0xa813('0x2a')]);if(_0x52e814[_0xa813('0x2b')]){delete _0x52e814[_0xa813('0x2b')];}_0x5e38c5['status'](_0x3e37a6)['send'](_0x52e814);};}exports[_0xa813('0x2c')]=function(_0xa205f8,_0x11b3d0){var _0x3c45f1={},_0x1ae88b={},_0x703468={'count':0x0,'rows':[]};var _0x2f017a=_[_0xa813('0x2d')](db[_0xa813('0x2e')][_0xa813('0x2f')],function(_0x292f45){return{'name':_0x292f45[_0xa813('0x30')],'type':_0x292f45[_0xa813('0x31')][_0xa813('0x32')]};});_0x1ae88b[_0xa813('0x33')]=_[_0xa813('0x2d')](_0x2f017a,_0xa813('0x2b'));_0x1ae88b[_0xa813('0x34')]=_['keys'](_0xa205f8[_0xa813('0x34')]);_0x1ae88b[_0xa813('0x35')]=_['intersection'](_0x1ae88b['model'],_0x1ae88b[_0xa813('0x34')]);_0x3c45f1['attributes']=_[_0xa813('0x36')](_0x1ae88b[_0xa813('0x33')],qs[_0xa813('0x37')](_0xa205f8[_0xa813('0x34')]['fields']));_0x3c45f1[_0xa813('0x38')]=_0x3c45f1['attributes'][_0xa813('0x39')]?_0x3c45f1[_0xa813('0x38')]:_0x1ae88b[_0xa813('0x33')];if(!_0xa205f8['query'][_0xa813('0x3a')](_0xa813('0x3b'))){_0x3c45f1[_0xa813('0x1f')]=qs['limit'](_0xa205f8[_0xa813('0x34')]['limit']);_0x3c45f1[_0xa813('0x1d')]=qs[_0xa813('0x1d')](_0xa205f8[_0xa813('0x34')][_0xa813('0x1d')]);}_0x3c45f1[_0xa813('0x3c')]=qs[_0xa813('0x3d')](_0xa205f8[_0xa813('0x34')][_0xa813('0x3d')]);_0x3c45f1[_0xa813('0x3e')]=qs[_0xa813('0x35')](_['pick'](_0xa205f8['query'],_0x1ae88b['filters']),_0x2f017a);if(_0xa205f8[_0xa813('0x34')][_0xa813('0x3f')]){_0x3c45f1[_0xa813('0x3e')]=_[_0xa813('0x40')](_0x3c45f1[_0xa813('0x3e')],{'$or':_[_0xa813('0x2d')](_0x2f017a,function(_0x32dda5){if(_0x32dda5[_0xa813('0x31')]!==_0xa813('0x41')){var _0x43d90b={};_0x43d90b[_0x32dda5[_0xa813('0x2b')]]={'$like':'%'+_0xa205f8[_0xa813('0x34')][_0xa813('0x3f')]+'%'};return _0x43d90b;}})});}_0x3c45f1=_[_0xa813('0x40')]({},_0x3c45f1,_0xa205f8[_0xa813('0x42')]);var _0x1b1a12={'where':_0x3c45f1[_0xa813('0x3e')]};return db[_0xa813('0x2e')][_0xa813('0x20')](_0x1b1a12)[_0xa813('0x27')](function(_0x22a7de){_0x703468[_0xa813('0x20')]=_0x22a7de;if(_0xa205f8[_0xa813('0x34')][_0xa813('0x43')]){_0x3c45f1[_0xa813('0x44')]=[{'all':!![]}];}return db['Attachment'][_0xa813('0x45')](_0x3c45f1);})[_0xa813('0x27')](function(_0x1d3a4f){_0x703468[_0xa813('0x46')]=_0x1d3a4f;return _0x703468;})[_0xa813('0x27')](respondWithFilteredResult(_0x11b3d0,_0x3c45f1))[_0xa813('0x47')](handleError(_0x11b3d0,null));};exports[_0xa813('0x48')]=function(_0xc348ea,_0x43140e){var _0x3e475d={'raw':!![],'where':{'id':_0xc348ea['params']['id']}},_0x587376={};_0x587376[_0xa813('0x33')]=_['keys'](db[_0xa813('0x2e')][_0xa813('0x2f')]);_0x587376[_0xa813('0x34')]=_[_0xa813('0x49')](_0xc348ea[_0xa813('0x34')]);_0x587376['filters']=_['intersection'](_0x587376['model'],_0x587376[_0xa813('0x34')]);_0x3e475d['attributes']=_[_0xa813('0x36')](_0x587376['model'],qs['fields'](_0xc348ea[_0xa813('0x34')][_0xa813('0x37')]));_0x3e475d['attributes']=_0x3e475d['attributes']['length']?_0x3e475d[_0xa813('0x38')]:_0x587376[_0xa813('0x33')];if(_0xc348ea[_0xa813('0x34')][_0xa813('0x43')]){_0x3e475d[_0xa813('0x44')]=[{'all':!![]}];}_0x3e475d=_[_0xa813('0x40')]({},_0x3e475d,_0xc348ea[_0xa813('0x42')]);return db[_0xa813('0x2e')][_0xa813('0x4a')](_0x3e475d)[_0xa813('0x27')](handleEntityNotFound(_0x43140e,null))[_0xa813('0x27')](respondWithResult(_0x43140e,null))['catch'](handleError(_0x43140e,null));};exports['clone']=function(_0x1d9a4c,_0x123438){var _0x22377a={'where':{'id':_0x1d9a4c['params']['id']}},_0x3f149c={};_0x3f149c[_0xa813('0x33')]=_[_0xa813('0x49')](db[_0xa813('0x2e')][_0xa813('0x2f')]);_0x22377a[_0xa813('0x38')]=_['intersection'](_0x3f149c[_0xa813('0x33')],qs[_0xa813('0x37')](_0x1d9a4c[_0xa813('0x34')]['fields']));_0x22377a[_0xa813('0x38')]=_0x22377a[_0xa813('0x38')][_0xa813('0x39')]?_0x22377a[_0xa813('0x38')]:_0x3f149c[_0xa813('0x33')];if(_0x1d9a4c[_0xa813('0x34')][_0xa813('0x43')]){_0x22377a['include']=[{'all':!![]}];}_0x22377a=_[_0xa813('0x40')]({},_0x22377a,_0x1d9a4c['options']);return db[_0xa813('0x2e')]['find'](_0x22377a)[_0xa813('0x27')](handleEntityNotFound(_0x123438,null))['then'](function(_0xc44fa8){if(_0xc44fa8){var _0x2e55e5=_0xc44fa8[_0xa813('0x4b')]({'plain':!![]});_0x2e55e5=qs[_0xa813('0x4c')](_0x2e55e5,['id',_0xa813('0x4d'),_0xa813('0x4e')]);_0x1d9a4c[_0xa813('0x4f')]=_[_0xa813('0x4c')](_0x1d9a4c[_0xa813('0x4f')],['id',_0xa813('0x4d'),'updatedAt']);return db[_0xa813('0x2e')][_0xa813('0x50')](_[_0xa813('0x40')](_0x2e55e5,_0x1d9a4c[_0xa813('0x4f')]),{'include':_0x1d9a4c['query']['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x123438,0xc9))[_0xa813('0x47')](handleError(_0x123438,null));};exports[_0xa813('0x26')]=function(_0x132145,_0x505f84){if(_0x132145[_0xa813('0x4f')]['id']){delete _0x132145[_0xa813('0x4f')]['id'];}return db[_0xa813('0x2e')][_0xa813('0x4a')]({'where':{'id':_0x132145[_0xa813('0x51')]['id']}})['then'](handleEntityNotFound(_0x505f84,null))['then'](saveUpdates(_0x132145['body'],null))[_0xa813('0x27')](respondWithResult(_0x505f84,null))[_0xa813('0x47')](handleError(_0x505f84,null));};exports[_0xa813('0x28')]=function(_0x177aaf,_0xa1dc4c){return db[_0xa813('0x2e')][_0xa813('0x4a')]({'where':{'id':_0x177aaf[_0xa813('0x51')]['id']}})['then'](handleEntityNotFound(_0xa1dc4c,null))[_0xa813('0x27')](removeEntity(_0xa1dc4c,null))[_0xa813('0x47')](handleError(_0xa1dc4c,null));};exports['create']=function(_0x2c3e5b,_0x18a963,_0x1e9942){_0x2c3e5b[_0xa813('0x4f')]['name']=_0x2c3e5b[_0xa813('0x52')][_0xa813('0x53')];_0x2c3e5b[_0xa813('0x4f')][_0xa813('0x54')]=_0x2c3e5b['file'][_0xa813('0x55')];_0x2c3e5b[_0xa813('0x4f')][_0xa813('0x31')]=_0x2c3e5b[_0xa813('0x52')][_0xa813('0x56')];return db[_0xa813('0x2e')]['create'](_0x2c3e5b[_0xa813('0x4f')])['then'](respondWithResult(_0x18a963,0xc9))[_0xa813('0x47')](handleError(_0x18a963,null));};exports[_0xa813('0x57')]=function(_0x5828dc,_0x1da8e2,_0x3b139c){return db[_0xa813('0x2e')][_0xa813('0x58')]({'where':{'id':_0x5828dc[_0xa813('0x51')]['id']},'raw':!![]})[_0xa813('0x27')](handleEntityNotFound(_0x1da8e2,null))[_0xa813('0x27')](function(_0x57bc86){if(_0x57bc86){var _0x1e02b5=_0x57bc86[_0xa813('0x59')]!==null;var _0x35e53d=path[_0xa813('0x5a')](config[_0xa813('0x5b')],'server/files/attachments/');if(_0x1e02b5){_0x35e53d=path[_0xa813('0x5a')](_0x35e53d,_0xa813('0x5c'));}var _0x281d44=path['join'](_0x35e53d,_0x57bc86['basename']);return _0x1da8e2[_0xa813('0x57')](_0x281d44);}})[_0xa813('0x47')](handleError(_0x1da8e2,null));};
\ No newline at end of file
+var _0x37bd=['fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','index','Attachment','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','keys','params','find','get','omit','createdAt','updatedAt','body','create','destroy','file','originalname','basename','mimetype','download','findOne','root','server/files/attachments/','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs'];(function(_0x8583e,_0x1f965c){var _0x1ba58a=function(_0x3a1d5e){while(--_0x3a1d5e){_0x8583e['push'](_0x8583e['shift']());}};_0x1ba58a(++_0x1f965c);}(_0x37bd,0x15a));var _0xd37b=function(_0x42764a,_0x546e27){_0x42764a=_0x42764a-0x0;var _0x3fdee0=_0x37bd[_0x42764a];return _0x3fdee0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd37b('0x0'));var zipdir=require(_0xd37b('0x1'));var jsonpatch=require(_0xd37b('0x2'));var rp=require(_0xd37b('0x3'));var moment=require(_0xd37b('0x4'));var BPromise=require(_0xd37b('0x5'));var Mustache=require(_0xd37b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd37b('0x7'));var csv=require(_0xd37b('0x8'));var ejs=require(_0xd37b('0x9'));var fs=require('fs');var fs_extra=require(_0xd37b('0xa'));var _=require(_0xd37b('0xb'));var squel=require(_0xd37b('0xc'));var crypto=require(_0xd37b('0xd'));var jsforce=require(_0xd37b('0xe'));var deskjs=require(_0xd37b('0xf'));var toCsv=require(_0xd37b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd37b('0x10'));var authService=require(_0xd37b('0x11'));var qs=require(_0xd37b('0x12'));var as=require(_0xd37b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd37b('0x14'))(_0xd37b('0x15'));var utils=require(_0xd37b('0x16'));var config=require(_0xd37b('0x17'));var licenseUtil=require(_0xd37b('0x18'));var db=require(_0xd37b('0x19'))['db'];function respondWithStatusCode(_0x21b839,_0x5e95de){_0x5e95de=_0x5e95de||0xcc;return function(_0x23e83d){if(_0x23e83d){return _0x21b839[_0xd37b('0x1a')](_0x5e95de);}return _0x21b839[_0xd37b('0x1b')](_0x5e95de)[_0xd37b('0x1c')]();};}function respondWithResult(_0x192ecf,_0x3f7315){_0x3f7315=_0x3f7315||0xc8;return function(_0x210f25){if(_0x210f25){return _0x192ecf[_0xd37b('0x1b')](_0x3f7315)[_0xd37b('0x1d')](_0x210f25);}};}function respondWithFilteredResult(_0x2b1ae0,_0x3e0917){return function(_0x572152){if(_0x572152){var _0x14c455=typeof _0x3e0917[_0xd37b('0x1e')]===_0xd37b('0x1f')&&typeof _0x3e0917[_0xd37b('0x20')]===_0xd37b('0x1f');var _0x5e44a8=_0x572152[_0xd37b('0x21')];var _0x34aec1=_0x14c455?0x0:_0x3e0917[_0xd37b('0x1e')];var _0x267d3d=_0x14c455?_0x572152[_0xd37b('0x21')]:_0x3e0917[_0xd37b('0x1e')]+_0x3e0917['limit'];var _0x580e22;if(_0x267d3d>=_0x5e44a8){_0x267d3d=_0x5e44a8;_0x580e22=0xc8;}else{_0x580e22=0xce;}_0x2b1ae0['status'](_0x580e22);return _0x2b1ae0[_0xd37b('0x22')](_0xd37b('0x23'),_0x34aec1+'-'+_0x267d3d+'/'+_0x5e44a8)[_0xd37b('0x1d')](_0x572152);}return null;};}function patchUpdates(_0x2e3469){return function(_0x3ecb12){try{jsonpatch[_0xd37b('0x24')](_0x3ecb12,_0x2e3469,!![]);}catch(_0x24d1de){return BPromise['reject'](_0x24d1de);}return _0x3ecb12['save']();};}function saveUpdates(_0x44b779,_0x39f606){return function(_0x18b681){if(_0x18b681){return _0x18b681[_0xd37b('0x25')](_0x44b779)['then'](function(_0x2d74d1){return _0x2d74d1;});}return null;};}function removeEntity(_0x29fe1e,_0x450a90){return function(_0x2d2894){if(_0x2d2894){return _0x2d2894['destroy']()[_0xd37b('0x26')](function(){_0x29fe1e[_0xd37b('0x1b')](0xcc)[_0xd37b('0x1c')]();});}};}function handleEntityNotFound(_0x41b779,_0x2c6d9b){return function(_0x10ab6a){if(!_0x10ab6a){_0x41b779[_0xd37b('0x1a')](0x194);}return _0x10ab6a;};}function handleError(_0x267545,_0x12d8b1){_0x12d8b1=_0x12d8b1||0x1f4;return function(_0x318256){logger[_0xd37b('0x27')](_0x318256[_0xd37b('0x28')]);if(_0x318256[_0xd37b('0x29')]){delete _0x318256[_0xd37b('0x29')];}_0x267545[_0xd37b('0x1b')](_0x12d8b1)['send'](_0x318256);};}exports[_0xd37b('0x2a')]=function(_0x30ae8d,_0x57a608){var _0xe1ebb1={},_0x280b4e={},_0x5390cf={'count':0x0,'rows':[]};var _0x2a36e9=_['map'](db[_0xd37b('0x2b')][_0xd37b('0x2c')],function(_0x1eef0a){return{'name':_0x1eef0a[_0xd37b('0x2d')],'type':_0x1eef0a['type'][_0xd37b('0x2e')]};});_0x280b4e['model']=_['map'](_0x2a36e9,_0xd37b('0x29'));_0x280b4e['query']=_['keys'](_0x30ae8d[_0xd37b('0x2f')]);_0x280b4e[_0xd37b('0x30')]=_[_0xd37b('0x31')](_0x280b4e[_0xd37b('0x32')],_0x280b4e['query']);_0xe1ebb1[_0xd37b('0x33')]=_[_0xd37b('0x31')](_0x280b4e[_0xd37b('0x32')],qs[_0xd37b('0x34')](_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x34')]));_0xe1ebb1[_0xd37b('0x33')]=_0xe1ebb1['attributes'][_0xd37b('0x35')]?_0xe1ebb1[_0xd37b('0x33')]:_0x280b4e['model'];if(!_0x30ae8d[_0xd37b('0x2f')]['hasOwnProperty'](_0xd37b('0x36'))){_0xe1ebb1[_0xd37b('0x20')]=qs[_0xd37b('0x20')](_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x20')]);_0xe1ebb1[_0xd37b('0x1e')]=qs['offset'](_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x1e')]);}_0xe1ebb1[_0xd37b('0x37')]=qs[_0xd37b('0x38')](_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x38')]);_0xe1ebb1[_0xd37b('0x39')]=qs[_0xd37b('0x30')](_[_0xd37b('0x3a')](_0x30ae8d[_0xd37b('0x2f')],_0x280b4e['filters']),_0x2a36e9);if(_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x3b')]){_0xe1ebb1['where']=_['merge'](_0xe1ebb1[_0xd37b('0x39')],{'$or':_[_0xd37b('0x3c')](_0x2a36e9,function(_0x2e4e7d){if(_0x2e4e7d[_0xd37b('0x3d')]!==_0xd37b('0x3e')){var _0x890145={};_0x890145[_0x2e4e7d[_0xd37b('0x29')]]={'$like':'%'+_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x3b')]+'%'};return _0x890145;}})});}_0xe1ebb1=_[_0xd37b('0x3f')]({},_0xe1ebb1,_0x30ae8d[_0xd37b('0x40')]);var _0x4baea7={'where':_0xe1ebb1[_0xd37b('0x39')]};return db['Attachment']['count'](_0x4baea7)[_0xd37b('0x26')](function(_0x140cf7){_0x5390cf[_0xd37b('0x21')]=_0x140cf7;if(_0x30ae8d[_0xd37b('0x2f')][_0xd37b('0x41')]){_0xe1ebb1[_0xd37b('0x42')]=[{'all':!![]}];}return db[_0xd37b('0x2b')][_0xd37b('0x43')](_0xe1ebb1);})[_0xd37b('0x26')](function(_0x3ae61d){_0x5390cf['rows']=_0x3ae61d;return _0x5390cf;})['then'](respondWithFilteredResult(_0x57a608,_0xe1ebb1))[_0xd37b('0x44')](handleError(_0x57a608,null));};exports[_0xd37b('0x45')]=function(_0x5eff0a,_0xe03fc0){var _0x17497b={'raw':!![],'where':{'id':_0x5eff0a['params']['id']}},_0x53258c={};_0x53258c[_0xd37b('0x32')]=_[_0xd37b('0x46')](db[_0xd37b('0x2b')][_0xd37b('0x2c')]);_0x53258c[_0xd37b('0x2f')]=_[_0xd37b('0x46')](_0x5eff0a[_0xd37b('0x2f')]);_0x53258c['filters']=_['intersection'](_0x53258c['model'],_0x53258c[_0xd37b('0x2f')]);_0x17497b[_0xd37b('0x33')]=_[_0xd37b('0x31')](_0x53258c['model'],qs[_0xd37b('0x34')](_0x5eff0a[_0xd37b('0x2f')][_0xd37b('0x34')]));_0x17497b[_0xd37b('0x33')]=_0x17497b[_0xd37b('0x33')][_0xd37b('0x35')]?_0x17497b[_0xd37b('0x33')]:_0x53258c['model'];if(_0x5eff0a[_0xd37b('0x2f')]['includeAll']){_0x17497b['include']=[{'all':!![]}];}_0x17497b=_[_0xd37b('0x3f')]({},_0x17497b,_0x5eff0a['options']);return db['Attachment']['find'](_0x17497b)['then'](handleEntityNotFound(_0xe03fc0,null))[_0xd37b('0x26')](respondWithResult(_0xe03fc0,null))[_0xd37b('0x44')](handleError(_0xe03fc0,null));};exports['clone']=function(_0x371529,_0xdb298f){var _0x53f4fd={'where':{'id':_0x371529[_0xd37b('0x47')]['id']}},_0x2ee369={};_0x2ee369[_0xd37b('0x32')]=_['keys'](db[_0xd37b('0x2b')][_0xd37b('0x2c')]);_0x53f4fd[_0xd37b('0x33')]=_['intersection'](_0x2ee369[_0xd37b('0x32')],qs[_0xd37b('0x34')](_0x371529[_0xd37b('0x2f')][_0xd37b('0x34')]));_0x53f4fd[_0xd37b('0x33')]=_0x53f4fd['attributes'][_0xd37b('0x35')]?_0x53f4fd['attributes']:_0x2ee369[_0xd37b('0x32')];if(_0x371529[_0xd37b('0x2f')][_0xd37b('0x41')]){_0x53f4fd[_0xd37b('0x42')]=[{'all':!![]}];}_0x53f4fd=_[_0xd37b('0x3f')]({},_0x53f4fd,_0x371529['options']);return db[_0xd37b('0x2b')][_0xd37b('0x48')](_0x53f4fd)[_0xd37b('0x26')](handleEntityNotFound(_0xdb298f,null))[_0xd37b('0x26')](function(_0x56a855){if(_0x56a855){var _0x442267=_0x56a855[_0xd37b('0x49')]({'plain':!![]});_0x442267=qs[_0xd37b('0x4a')](_0x442267,['id',_0xd37b('0x4b'),_0xd37b('0x4c')]);_0x371529[_0xd37b('0x4d')]=_[_0xd37b('0x4a')](_0x371529['body'],['id',_0xd37b('0x4b'),'updatedAt']);return db[_0xd37b('0x2b')][_0xd37b('0x4e')](_[_0xd37b('0x3f')](_0x442267,_0x371529[_0xd37b('0x4d')]),{'include':_0x371529['query'][_0xd37b('0x41')]?[{'all':!![]}]:undefined});}})[_0xd37b('0x26')](respondWithResult(_0xdb298f,0xc9))[_0xd37b('0x44')](handleError(_0xdb298f,null));};exports[_0xd37b('0x25')]=function(_0x452754,_0x39a042){if(_0x452754[_0xd37b('0x4d')]['id']){delete _0x452754[_0xd37b('0x4d')]['id'];}return db[_0xd37b('0x2b')][_0xd37b('0x48')]({'where':{'id':_0x452754[_0xd37b('0x47')]['id']}})[_0xd37b('0x26')](handleEntityNotFound(_0x39a042,null))[_0xd37b('0x26')](saveUpdates(_0x452754[_0xd37b('0x4d')],null))[_0xd37b('0x26')](respondWithResult(_0x39a042,null))[_0xd37b('0x44')](handleError(_0x39a042,null));};exports[_0xd37b('0x4f')]=function(_0x4b390c,_0x49e50a){return db['Attachment'][_0xd37b('0x48')]({'where':{'id':_0x4b390c['params']['id']}})['then'](handleEntityNotFound(_0x49e50a,null))[_0xd37b('0x26')](removeEntity(_0x49e50a,null))[_0xd37b('0x44')](handleError(_0x49e50a,null));};exports['create']=function(_0x3ade60,_0x41534d,_0x15c8ef){_0x3ade60[_0xd37b('0x4d')][_0xd37b('0x29')]=_0x3ade60[_0xd37b('0x50')][_0xd37b('0x51')];_0x3ade60[_0xd37b('0x4d')][_0xd37b('0x52')]=_0x3ade60[_0xd37b('0x50')]['filename'];_0x3ade60['body'][_0xd37b('0x3d')]=_0x3ade60[_0xd37b('0x50')][_0xd37b('0x53')];return db['Attachment']['create'](_0x3ade60[_0xd37b('0x4d')])[_0xd37b('0x26')](respondWithResult(_0x41534d,0xc9))[_0xd37b('0x44')](handleError(_0x41534d,null));};exports[_0xd37b('0x54')]=function(_0x40b6bb,_0xe0348f,_0x54d2db){return db[_0xd37b('0x2b')][_0xd37b('0x55')]({'where':{'id':_0x40b6bb[_0xd37b('0x47')]['id']},'raw':!![]})[_0xd37b('0x26')](handleEntityNotFound(_0xe0348f,null))['then'](function(_0x3998ce){if(_0x3998ce){var _0x577dd6=_0x3998ce['ChatOfflineMessageId']!==null;var _0x242d90=path['join'](config[_0xd37b('0x56')],_0xd37b('0x57'));if(_0x577dd6){_0x242d90=path[_0xd37b('0x58')](_0x242d90,'offline-chat/');}var _0x4f3a4f=path[_0xd37b('0x58')](_0x242d90,_0x3998ce[_0xd37b('0x52')]);return _0xe0348f[_0xd37b('0x54')](_0x4f3a4f);}})['catch'](handleError(_0xe0348f,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 5812d44..4c93e00 100644
--- a/server/api/attachment/attachment.model.js
+++ b/server/api/attachment/attachment.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x944f=['./attachment.attributes','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2ff157,_0x2c252a){var _0xe775cf=function(_0x2aebfb){while(--_0x2aebfb){_0x2ff157['push'](_0x2ff157['shift']());}};_0xe775cf(++_0x2c252a);}(_0x944f,0x184));var _0xf944=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0x944f[_0x5c7525];return _0x2e2ec8;};'use strict';var _=require(_0xf944('0x0'));var util=require(_0xf944('0x1'));var logger=require(_0xf944('0x2'))(_0xf944('0x3'));var moment=require(_0xf944('0x4'));var BPromise=require(_0xf944('0x5'));var rp=require(_0xf944('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf944('0x7'));var config=require('../../config/environment');var attributes=require(_0xf944('0x8'));module['exports']=function(_0x3925ce,_0x7a14ec){return _0x3925ce[_0xf944('0x9')](_0xf944('0xa'),attributes,{'tableName':_0xf944('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf765=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x14ae2f,_0x2dd861){var _0x2c2542=function(_0x238369){while(--_0x238369){_0x14ae2f['push'](_0x14ae2f['shift']());}};_0x2c2542(++_0x2dd861);}(_0xf765,0x1ee));var _0x5f76=function(_0x2beada,_0x4c816b){_0x2beada=_0x2beada-0x0;var _0x51a1aa=_0xf765[_0x2beada];return _0x51a1aa;};'use strict';var _=require(_0x5f76('0x0'));var util=require(_0x5f76('0x1'));var logger=require(_0x5f76('0x2'))(_0x5f76('0x3'));var moment=require(_0x5f76('0x4'));var BPromise=require(_0x5f76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f76('0x6'));var rimraf=require(_0x5f76('0x7'));var config=require(_0x5f76('0x8'));var attributes=require(_0x5f76('0x9'));module[_0x5f76('0xa')]=function(_0x5cccdb,_0x4a6475){return _0x5cccdb[_0x5f76('0xb')](_0x5f76('0xc'),attributes,{'tableName':_0x5f76('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 21f137f..c94f929 100644
--- a/server/api/attachment/attachment.rpc.js
+++ b/server/api/attachment/attachment.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x195e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateAttachment','create','body','options','raw','then','lodash'];(function(_0x469393,_0x247969){var _0x5f720d=function(_0x40aeb3){while(--_0x40aeb3){_0x469393['push'](_0x469393['shift']());}};_0x5f720d(++_0x247969);}(_0x195e,0xfb));var _0xe195=function(_0x90be7,_0x213364){_0x90be7=_0x90be7-0x0;var _0x510d22=_0x195e[_0x90be7];return _0x510d22;};'use strict';var _=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var moment=require(_0xe195('0x2'));var BPromise=require(_0xe195('0x3'));var rs=require(_0xe195('0x4'));var fs=require('fs');var Redis=require(_0xe195('0x5'));var db=require(_0xe195('0x6'))['db'];var utils=require(_0xe195('0x7'));var logger=require(_0xe195('0x8'))(_0xe195('0x9'));var config=require(_0xe195('0xa'));var jayson=require(_0xe195('0xb'));var client=jayson[_0xe195('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a1acc,_0x663106,_0x2ead59){return new BPromise(function(_0x28c1a9,_0x3164c3){return client['request'](_0x2a1acc,_0x2ead59)['then'](function(_0x5f333b){logger[_0xe195('0xd')](_0xe195('0xe'),_0x663106,_0xe195('0xf'));logger[_0xe195('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x663106,_0xe195('0xf'),JSON[_0xe195('0x11')](_0x5f333b));if(_0x5f333b[_0xe195('0x12')]){if(_0x5f333b['error'][_0xe195('0x13')]===0x1f4){logger[_0xe195('0x12')]('Attachment,\x20%s,\x20%s',_0x663106,_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);return _0x3164c3(_0x5f333b[_0xe195('0x12')][_0xe195('0x14')]);}logger['error'](_0xe195('0xe'),_0x663106,_0x5f333b[_0xe195('0x12')]['message']);return _0x28c1a9(_0x5f333b['error'][_0xe195('0x14')]);}else{logger['info'](_0xe195('0xe'),_0x663106,'request\x20sent');_0x28c1a9(_0x5f333b['result'][_0xe195('0x14')]);}})[_0xe195('0x15')](function(_0x277362){logger[_0xe195('0x12')](_0xe195('0xe'),_0x663106,_0x277362);_0x3164c3(_0x277362);});});}exports[_0xe195('0x16')]=function(_0x4784b1){var _0x41265d=this;return new Promise(function(_0x9c8ba5,_0x25818c){return db['Attachment'][_0xe195('0x17')](_0x4784b1[_0xe195('0x18')],{'raw':_0x4784b1[_0xe195('0x19')]?_0x4784b1[_0xe195('0x19')][_0xe195('0x1a')]===undefined?!![]:![]:!![]})[_0xe195('0x1b')](function(_0x496722){logger[_0xe195('0xd')](_0xe195('0x16'),_0x4784b1);logger[_0xe195('0x10')](_0xe195('0x16'),_0x4784b1,JSON['stringify'](_0x496722));_0x9c8ba5(_0x496722);})['catch'](function(_0x4e5f13){logger[_0xe195('0x12')](_0xe195('0x16'),_0x4e5f13[_0xe195('0x14')],_0x4784b1);_0x25818c(_0x41265d[_0xe195('0x12')](0x1f4,_0x4e5f13[_0xe195('0x14')]));});});};
\ No newline at end of file
+var _0x0eaa=['rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x7e5ad7,_0x2da255){var _0x1e4e12=function(_0x563ed4){while(--_0x563ed4){_0x7e5ad7['push'](_0x7e5ad7['shift']());}};_0x1e4e12(++_0x2da255);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x3288a2,_0x4ac4be){_0x3288a2=_0x3288a2-0x0;var _0x319f4a=_0x0eaa[_0x3288a2];return _0x319f4a;};'use strict';var _=require(_0xa0ea('0x0'));var util=require(_0xa0ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0ea('0x2'));var fs=require('fs');var Redis=require(_0xa0ea('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0ea('0x4'));var logger=require(_0xa0ea('0x5'))(_0xa0ea('0x6'));var config=require(_0xa0ea('0x7'));var jayson=require(_0xa0ea('0x8'));var client=jayson['client'][_0xa0ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x521881,_0x4b8856,_0x361178){return new BPromise(function(_0x8632a1,_0x5b2adc){return client['request'](_0x521881,_0x361178)[_0xa0ea('0xa')](function(_0x2746f2){logger[_0xa0ea('0xb')](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));logger['debug'](_0xa0ea('0xe'),_0x4b8856,_0xa0ea('0xd'),JSON[_0xa0ea('0xf')](_0x2746f2));if(_0x2746f2[_0xa0ea('0x10')]){if(_0x2746f2['error'][_0xa0ea('0x11')]===0x1f4){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x5b2adc(_0x2746f2['error'][_0xa0ea('0x12')]);}logger[_0xa0ea('0x10')]('Attachment,\x20%s,\x20%s',_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x8632a1(_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);}else{logger['info'](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));_0x8632a1(_0x2746f2[_0xa0ea('0x13')][_0xa0ea('0x12')]);}})[_0xa0ea('0x14')](function(_0x34b94c){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x34b94c);_0x5b2adc(_0x34b94c);});});}exports[_0xa0ea('0x15')]=function(_0x405f7f){var _0x581f59=this;return new Promise(function(_0x4ca082,_0xe116e2){return db[_0xa0ea('0x16')][_0xa0ea('0x17')](_0x405f7f[_0xa0ea('0x18')],{'raw':_0x405f7f[_0xa0ea('0x19')]?_0x405f7f[_0xa0ea('0x19')][_0xa0ea('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x916f1){logger[_0xa0ea('0xb')](_0xa0ea('0x15'),_0x405f7f);logger['debug'](_0xa0ea('0x15'),_0x405f7f,JSON[_0xa0ea('0xf')](_0x916f1));_0x4ca082(_0x916f1);})[_0xa0ea('0x14')](function(_0x12cda2){logger[_0xa0ea('0x10')](_0xa0ea('0x15'),_0x12cda2['message'],_0x405f7f);_0xe116e2(_0x581f59[_0xa0ea('0x10')](0x1f4,_0x12cda2['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 2d981aa..2cf099f 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x1b2cfa,_0x543a6d){var _0xf3151c=function(_0x55e1a7){while(--_0x55e1a7){_0x1b2cfa['push'](_0x1b2cfa['shift']());}};_0xf3151c(++_0x543a6d);}(_0x757a,0xde));var _0xa757=function(_0x363807,_0x112ada){_0x363807=_0x363807-0x0;var _0x1b32ea=_0x757a[_0x363807];return _0x1b32ea;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x1f5f6e,_0x1ef787){_0x1f5f6e=_0x1f5f6e-0x0;var _0x31210d=_0xdb28[_0x1f5f6e];return _0x31210d;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 3188496..fd78fc4 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xecc6=['login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','ad-login','User','passport-local','Strategy','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','blocked','blockedAt','online','user','agent','then','disabled','getLicense','catch','status','send','message'];(function(_0xd89ad8,_0x347fda){var _0x1be90f=function(_0xa8f0ef){while(--_0xa8f0ef){_0xd89ad8['push'](_0xd89ad8['shift']());}};_0x1be90f(++_0x347fda);}(_0xecc6,0x148));var _0x6ecc=function(_0x519d9d,_0x5cc5d0){_0x519d9d=_0x519d9d-0x0;var _0x2c0d4c=_0xecc6[_0x519d9d];return _0x2c0d4c;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x6ecc('0x0'))[_0x6ecc('0x1')];var moment=require(_0x6ecc('0x2'));var ActiveDirectory=require(_0x6ecc('0x3'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x6ecc('0x4'))['db'];var authService=require(_0x6ecc('0x5'));var utils=require(_0x6ecc('0x6'));var config=require(_0x6ecc('0x7'));var logger=require(_0x6ecc('0x8'))(_0x6ecc('0x9'));function isActiveDirectoryConfigured(_0x56a5b5){var _0x450edb=![];if(typeof _0x56a5b5['activedirectory']!==_0x6ecc('0xa')){_0x450edb=_0x56a5b5[_0x6ecc('0xb')]['baseDN']&&_0x56a5b5[_0x6ecc('0xb')][_0x6ecc('0xc')]&&_0x56a5b5[_0x6ecc('0xb')]['domain'];}return _0x450edb;}function adAuthenticate(_0x378c34,_0x59f2db,_0xcedc8f){return new BPromise(function(_0x18c8b1,_0x3082ec){try{var _0x2cb8b3=new ActiveDirectory(_0x378c34);_0x2cb8b3[_0x6ecc('0xd')](_0x59f2db,_0xcedc8f,function(_0x16a124,_0x142ea9){if(_0x16a124){logger[_0x6ecc('0xe')](_0x6ecc('0xf'),_0x59f2db,util[_0x6ecc('0x10')](_0x16a124,{'showHidden':![],'depth':null}));_0x3082ec('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x142ea9){logger[_0x6ecc('0xe')](_0x6ecc('0x11'),_0x59f2db);_0x3082ec(_0x6ecc('0x12'));}else{_0x18c8b1(_0x142ea9);}});}catch(_0xf8d071){_0x3082ec(_0xf8d071);}});}function ActiveDirectoryAuthenticate(_0x4af7d9,_0x16e519,_0x4e106c,_0x332753){var _0x5cd5ab,_0x50590a;if(!isActiveDirectoryConfigured(config)){logger[_0x6ecc('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x16e519);return _0x332753(null,![],{'message':_0x6ecc('0x12')});}return db[_0x6ecc('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0x6ecc('0x14'),_0x6ecc('0x15')],'raw':!![]})['then'](function(_0x1cbdba){_0x5cd5ab=_0x1cbdba;if(!_0x5cd5ab['adSsoEnabled']){logger[_0x6ecc('0xe')](_0x6ecc('0x16'),_0x16e519);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x4af7d9[_0x6ecc('0x17')]({'attributes':['id',_0x6ecc('0x18'),_0x6ecc('0x19'),_0x6ecc('0x1a'),_0x6ecc('0x1b'),'disabled',_0x6ecc('0x1c'),_0x6ecc('0x1d'),_0x6ecc('0x1e')],'where':{'name':_0x16e519,'role':{'$or':['admin',_0x6ecc('0x1f'),_0x6ecc('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x5d86c1){if(!_0x5d86c1||_0x5d86c1&&_0x5d86c1[_0x6ecc('0x18')]!==_0x16e519){throw new Error(_0x6ecc('0x12'));}_0x50590a=_0x5d86c1;var _0x4fa737=_0x50590a[_0x6ecc('0x18')]+'@'+config[_0x6ecc('0xb')]['domain'];return adAuthenticate(config[_0x6ecc('0xb')],_0x4fa737,_0x4e106c);})[_0x6ecc('0x21')](function(_0x49c31a){if(_0x50590a[_0x6ecc('0x22')]){throw new Error(_0x6ecc('0x12'));}if(_0x5cd5ab['blockDuration']>0x0){if(_0x50590a['blocked']){if(moment(_0x50590a[_0x6ecc('0x1d')])['add'](_0x5cd5ab[_0x6ecc('0x15')],'minutes')>moment()){throw new Error(_0x6ecc('0x12'));}return utils['clearBlockUser'](_0x50590a,0x0,![],null)['then'](function(){return utils[_0x6ecc('0x23')](_0x50590a);})[_0x6ecc('0x21')](function(){return _0x332753(null,_0x50590a);});}else{return utils[_0x6ecc('0x23')](_0x50590a)[_0x6ecc('0x21')](function(){return _0x332753(null,_0x50590a);});}}else{return utils[_0x6ecc('0x23')](_0x50590a)[_0x6ecc('0x21')](function(){return _0x332753(null,_0x50590a);});}})[_0x6ecc('0x24')](function(_0x1042f9){return _0x332753(null,![],_0x1042f9);});}function handleError(_0x199a66,_0x151c2c,_0x1ec429){return _0x199a66[_0x6ecc('0x25')](_0x151c2c||0x1f4)[_0x6ecc('0x26')]({'message':_0x1ec429?_0x1ec429[_0x6ecc('0x27')]||_0x1ec429:''});}exports[_0x6ecc('0x28')]=function(_0x234689,_0x2d4be4,_0x4104e5){passport[_0x6ecc('0xd')]('ad-login',function(_0x4a86dc,_0x5da8e0,_0x299609){var _0x3a4fa7=_0x4a86dc||_0x299609;if(_0x3a4fa7){return handleError(_0x2d4be4,0x191,_0x3a4fa7);}if(!_0x5da8e0){return handleError(_0x2d4be4,0x194,{'message':_0x6ecc('0x29')});}else{var _0x4b0d15={'payload':{'id':_0x5da8e0['id'],'role':_0x5da8e0[_0x6ecc('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x6ecc('0x2a')](_0x4b0d15)[_0x6ecc('0x21')](function(_0x47fd22){_0x2d4be4[_0x6ecc('0x2b')]({'id':_0x5da8e0['id'],'token':_0x47fd22,'statusCall':'','isAlreadyLogged':_0x5da8e0[_0x6ecc('0x1e')]});});}})(_0x234689,_0x2d4be4,_0x4104e5);};passport['use'](_0x6ecc('0x2c'),new LocalStrategy({'usernameField':_0x6ecc('0x18'),'passwordField':'password'},function(_0x309afe,_0x304d1b,_0x3ce0cf){return ActiveDirectoryAuthenticate(db[_0x6ecc('0x2d')],_0x309afe,_0x304d1b,_0x3ce0cf);}));
\ No newline at end of file
+var _0x3bcf=['activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','online','admin','agent','domain','blockedAt','getLicense','catch','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','passport','passport-local','Strategy','moment'];(function(_0x1d6824,_0x68b57a){var _0x159815=function(_0x1f7d15){while(--_0x1f7d15){_0x1d6824['push'](_0x1d6824['shift']());}};_0x159815(++_0x68b57a);}(_0x3bcf,0xdd));var _0xf3bc=function(_0x3c19f4,_0x17a81f){_0x3c19f4=_0x3c19f4-0x0;var _0x1d3f26=_0x3bcf[_0x3c19f4];return _0x1d3f26;};'use strict';var passport=require(_0xf3bc('0x0'));var LocalStrategy=require(_0xf3bc('0x1'))[_0xf3bc('0x2')];var moment=require(_0xf3bc('0x3'));var ActiveDirectory=require(_0xf3bc('0x4'));var BPromise=require(_0xf3bc('0x5'));var util=require('util');var db=require(_0xf3bc('0x6'))['db'];var authService=require(_0xf3bc('0x7'));var utils=require(_0xf3bc('0x8'));var config=require(_0xf3bc('0x9'));var logger=require('../../config/logger')(_0xf3bc('0xa'));function isActiveDirectoryConfigured(_0x3456d0){var _0x37bae7=![];if(typeof _0x3456d0[_0xf3bc('0xb')]!==_0xf3bc('0xc')){_0x37bae7=_0x3456d0[_0xf3bc('0xb')]['baseDN']&&_0x3456d0[_0xf3bc('0xb')][_0xf3bc('0xd')]&&_0x3456d0[_0xf3bc('0xb')]['domain'];}return _0x37bae7;}function adAuthenticate(_0x2849f6,_0x180001,_0x33235d){return new BPromise(function(_0x4d74ec,_0x41b436){try{var _0x2a9c12=new ActiveDirectory(_0x2849f6);_0x2a9c12[_0xf3bc('0xe')](_0x180001,_0x33235d,function(_0x2c063f,_0x2916d5){if(_0x2c063f){logger[_0xf3bc('0xf')](_0xf3bc('0x10'),_0x180001,util['inspect'](_0x2c063f,{'showHidden':![],'depth':null}));_0x41b436(_0xf3bc('0x11'));}else if(!_0x2916d5){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x180001);_0x41b436(_0xf3bc('0x11'));}else{_0x4d74ec(_0x2916d5);}});}catch(_0x198604){_0x41b436(_0x198604);}});}function ActiveDirectoryAuthenticate(_0x4cb138,_0x424063,_0x33b2ac,_0x378eed){var _0x4cb6a0,_0x2cc991;if(!isActiveDirectoryConfigured(config)){logger[_0xf3bc('0xf')](_0xf3bc('0x12'),_0x424063);return _0x378eed(null,![],{'message':_0xf3bc('0x11')});}return db[_0xf3bc('0x13')][_0xf3bc('0x14')]({'where':{'id':0x1},'attributes':[_0xf3bc('0x15'),_0xf3bc('0x16')],'raw':!![]})[_0xf3bc('0x17')](function(_0x54e1f0){_0x4cb6a0=_0x54e1f0;if(!_0x4cb6a0[_0xf3bc('0x15')]){logger[_0xf3bc('0xf')](_0xf3bc('0x18'),_0x424063);throw new Error(_0xf3bc('0x11'));}return _0x4cb138[_0xf3bc('0x14')]({'attributes':['id',_0xf3bc('0x19'),'password',_0xf3bc('0x1a'),_0xf3bc('0x1b'),_0xf3bc('0x1c'),_0xf3bc('0x1d'),'blockedAt',_0xf3bc('0x1e')],'where':{'name':_0x424063,'role':{'$or':[_0xf3bc('0x1f'),'user',_0xf3bc('0x20')]},'adSsoEnabled':!![]}});})[_0xf3bc('0x17')](function(_0x30e210){if(!_0x30e210||_0x30e210&&_0x30e210['name']!==_0x424063){throw new Error(_0xf3bc('0x11'));}_0x2cc991=_0x30e210;var _0x1ab9c5=_0x2cc991['name']+'@'+config['activedirectory'][_0xf3bc('0x21')];return adAuthenticate(config[_0xf3bc('0xb')],_0x1ab9c5,_0x33b2ac);})[_0xf3bc('0x17')](function(_0x42ad8e){if(_0x2cc991['disabled']){throw new Error(_0xf3bc('0x11'));}if(_0x4cb6a0[_0xf3bc('0x16')]>0x0){if(_0x2cc991[_0xf3bc('0x1d')]){if(moment(_0x2cc991[_0xf3bc('0x22')])['add'](_0x4cb6a0[_0xf3bc('0x16')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x2cc991,0x0,![],null)[_0xf3bc('0x17')](function(){return utils['getLicense'](_0x2cc991);})[_0xf3bc('0x17')](function(){return _0x378eed(null,_0x2cc991);});}else{return utils[_0xf3bc('0x23')](_0x2cc991)[_0xf3bc('0x17')](function(){return _0x378eed(null,_0x2cc991);});}}else{return utils['getLicense'](_0x2cc991)[_0xf3bc('0x17')](function(){return _0x378eed(null,_0x2cc991);});}})[_0xf3bc('0x24')](function(_0x15559f){return _0x378eed(null,![],_0x15559f);});}function handleError(_0x2f3916,_0x4cf46d,_0x333f87){return _0x2f3916['status'](_0x4cf46d||0x1f4)[_0xf3bc('0x25')]({'message':_0x333f87?_0x333f87[_0xf3bc('0x26')]||_0x333f87:''});}exports['login']=function(_0x4f6476,_0x1e0007,_0x5ca363){passport['authenticate']('ad-login',function(_0x5220e3,_0x558f82,_0x3f3d5a){var _0x2e31a4=_0x5220e3||_0x3f3d5a;if(_0x2e31a4){return handleError(_0x1e0007,0x191,_0x2e31a4);}if(!_0x558f82){return handleError(_0x1e0007,0x194,{'message':_0xf3bc('0x27')});}else{var _0x288f18={'payload':{'id':_0x558f82['id'],'role':_0x558f82[_0xf3bc('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xf3bc('0x28')](_0x288f18)[_0xf3bc('0x17')](function(_0x6c1033){_0x1e0007[_0xf3bc('0x29')]({'id':_0x558f82['id'],'token':_0x6c1033,'statusCall':'','isAlreadyLogged':_0x558f82['online']});});}})(_0x4f6476,_0x1e0007,_0x5ca363);};passport[_0xf3bc('0x2a')](_0xf3bc('0x2b'),new LocalStrategy({'usernameField':_0xf3bc('0x19'),'passwordField':'password'},function(_0x1a7738,_0x572a9b,_0x1811a4){return ActiveDirectoryAuthenticate(db[_0xf3bc('0x2c')],_0x1a7738,_0x572a9b,_0x1811a4);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 059f803..f0435a9 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f92=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7f92,0x1f1));var _0x27f9=function(_0x1bd406,_0x3760bf){_0x1bd406=_0x1bd406-0x0;var _0x4a1ce4=_0x7f92[_0x1bd406];return _0x4a1ce4;};'use strict';var express=require(_0x27f9('0x0'));var router=express[_0x27f9('0x1')]();var controller=require(_0x27f9('0x2'));router['post']('/',controller[_0x27f9('0x3')]);module[_0x27f9('0x4')]=router;
\ No newline at end of file
+var _0x09ce=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x487788,_0x428e9f){var _0x2829ef=function(_0x4ff9dd){while(--_0x4ff9dd){_0x487788['push'](_0x487788['shift']());}};_0x2829ef(++_0x428e9f);}(_0x09ce,0x6c));var _0xe09c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x09ce[_0x122ef9];return _0x42fba0;};'use strict';var express=require(_0xe09c('0x0'));var router=express[_0xe09c('0x1')]();var controller=require(_0xe09c('0x2'));router[_0xe09c('0x3')]('/',controller[_0xe09c('0x4')]);module[_0xe09c('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 9bfe32d..5e7d55b 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x7a54,0x106));var _0x47a5=function(_0x120cc3,_0xf43e10){_0x120cc3=_0x120cc3-0x0;var _0x456157=_0x7a54[_0x120cc3];return _0x456157;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x7a54,0x106));var _0x47a5=function(_0xd01a9a,_0x61feea){_0xd01a9a=_0xd01a9a-0x0;var _0x58f15b=_0x7a54[_0xd01a9a];return _0x58f15b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 6c994b8..6ce2956 100644
--- a/server/api/authGoogle/index.js
+++ b/server/api/authGoogle/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3936=['../user/user.controller.js','get','login','/callback','callback','exports','express','Router','./authGoogle.controller'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x3936,0x1ec));var _0x6393=function(_0x548e64,_0x29e562){_0x548e64=_0x548e64-0x0;var _0x47d34e=_0x3936[_0x548e64];return _0x47d34e;};'use strict';var express=require(_0x6393('0x0'));var passport=require('passport');var router=express[_0x6393('0x1')]();var controller=require(_0x6393('0x2'));var userController=require(_0x6393('0x3'));var authService=require('../../components/auth/service');router[_0x6393('0x4')]('/',controller[_0x6393('0x5')]);router[_0x6393('0x4')](_0x6393('0x6'),controller[_0x6393('0x7')],authService['isMiddleware'],userController[_0x6393('0x5')],authService['setTokenCookie']);module[_0x6393('0x8')]=router;
\ No newline at end of file
+var _0xcf98=['exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','login','setTokenCookie'];(function(_0x5c8e2c,_0x17ccfc){var _0x4301c3=function(_0x2a3a3a){while(--_0x2a3a3a){_0x5c8e2c['push'](_0x5c8e2c['shift']());}};_0x4301c3(++_0x17ccfc);}(_0xcf98,0xf3));var _0x8cf9=function(_0x5699e8,_0x4489f0){_0x5699e8=_0x5699e8-0x0;var _0x5722aa=_0xcf98[_0x5699e8];return _0x5722aa;};'use strict';var express=require(_0x8cf9('0x0'));var passport=require('passport');var router=express[_0x8cf9('0x1')]();var controller=require(_0x8cf9('0x2'));var userController=require(_0x8cf9('0x3'));var authService=require(_0x8cf9('0x4'));router['get']('/',controller['login']);router[_0x8cf9('0x5')]('/callback',controller[_0x8cf9('0x6')],authService[_0x8cf9('0x7')],userController[_0x8cf9('0x8')],authService[_0x8cf9('0x9')]);module[_0x8cf9('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 383db8d..74e577c 100644
--- a/server/api/authLocal/authLocal.controller.js
+++ b/server/api/authLocal/authLocal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc1de=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','Password\x20reset!','util','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','getSmtpOptions','merge','format','email','SendMail','message','stringify','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x443533,_0x523dff){var _0x5b664b=function(_0x407d06){while(--_0x407d06){_0x443533['push'](_0x443533['shift']());}};_0x5b664b(++_0x523dff);}(_0xc1de,0x148));var _0xec1d=function(_0x469bae,_0x492367){_0x469bae=_0x469bae-0x0;var _0x2285bd=_0xc1de[_0x469bae];return _0x2285bd;};'use strict';var util=require(_0xec1d('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xec1d('0x1')];var jayson=require(_0xec1d('0x2'));var _=require(_0xec1d('0x3'));var rs=require(_0xec1d('0x4'));var moment=require(_0xec1d('0x5'));var db=require(_0xec1d('0x6'))['db'];var authService=require(_0xec1d('0x7'));var utils=require(_0xec1d('0x8'));var client=jayson[_0xec1d('0x9')][_0xec1d('0xa')]({'port':0x232b});function localAuthenticate(_0x1cd228,_0x4a73b2,_0x17f996,_0x449ed3){var _0x3e01bc,_0x1a0894;return db[_0xec1d('0xb')][_0xec1d('0xc')]({'where':{'id':0x1},'attributes':[_0xec1d('0xd'),'blockDuration'],'raw':!![]})[_0xec1d('0xe')](function(_0x4b10e1){_0x3e01bc=_0x4b10e1;return _0x1cd228[_0xec1d('0xc')]({'attributes':['id',_0xec1d('0xf'),_0xec1d('0x10'),_0xec1d('0x11'),_0xec1d('0x12'),'disabled',_0xec1d('0x13'),_0xec1d('0x14'),_0xec1d('0x15')],'where':{'name':_0x4a73b2,'role':{'$or':[_0xec1d('0x16'),_0xec1d('0x17'),_0xec1d('0x18')]}}});})[_0xec1d('0xe')](function(_0x4cf0b6){if(!_0x4cf0b6||_0x4cf0b6&&_0x4cf0b6[_0xec1d('0xf')]!==_0x4a73b2){throw new Error(_0xec1d('0x19'));}else{_0x1a0894=_0x4cf0b6;return _0x1a0894;}})[_0xec1d('0xe')](function(){_0x1a0894[_0xec1d('0x1a')](_0x17f996,function(_0x577dcc,_0x5c7a51){var _0x244ce0=_0x1a0894[_0xec1d('0x15')]+0x1;if(_0x577dcc){return _0x449ed3(_0x577dcc);}else if(!_0x5c7a51){if(_0x1a0894['disabled']){return _0x449ed3(null,![],{'message':_0xec1d('0x19')});}else if(_0x3e01bc[_0xec1d('0xd')]>0x0){if(_0x1a0894[_0xec1d('0x13')]){if(_0x3e01bc[_0xec1d('0x1b')]>0x0){if(moment(_0x1a0894[_0xec1d('0x14')])[_0xec1d('0x1c')](_0x3e01bc[_0xec1d('0x1b')],_0xec1d('0x1d'))>moment()){return _0x449ed3(null,![],{'message':_0xec1d('0x19')});}else{return utils['clearBlockUser'](_0x1a0894,_0x244ce0,![],null)[_0xec1d('0xe')](function(){return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x449ed3(null,![],{'message':_0xec1d('0x19')});}}else{if(_0x244ce0>=_0x3e01bc[_0xec1d('0xd')]){return utils[_0xec1d('0x1e')](_0x1a0894,0x0,!![],moment())[_0xec1d('0xe')](function(){return _0x449ed3(null,![],{'message':_0xec1d('0x19')});});}else{return utils[_0xec1d('0x1e')](_0x1a0894,_0x244ce0,![],null)[_0xec1d('0xe')](function(){return _0x449ed3(null,![],{'message':_0xec1d('0x19')});});}}}else{return _0x449ed3(null,![],{'message':_0xec1d('0x19')});}}else{if(_0x1a0894[_0xec1d('0x1f')]){return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3e01bc[_0xec1d('0xd')]>0x0){if(_0x1a0894[_0xec1d('0x13')]){if(_0x3e01bc[_0xec1d('0x1b')]>0x0){if(moment(_0x1a0894['blockedAt'])[_0xec1d('0x1c')](_0x3e01bc[_0xec1d('0x1b')],_0xec1d('0x1d'))>moment()){return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xec1d('0x1e')](_0x1a0894,0x0,![],null)[_0xec1d('0xe')](function(){return utils[_0xec1d('0x20')](_0x1a0894);})[_0xec1d('0xe')](function(){return _0x449ed3(null,_0x1a0894);});}}else{return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x1a0894,0x0,![],null)[_0xec1d('0xe')](function(){return utils['getLicense'](_0x1a0894);})['then'](function(){return _0x449ed3(null,_0x1a0894);})[_0xec1d('0x21')](function(_0x35dcaa){return _0x449ed3(null,![],_0x35dcaa);});}}else{if(_0x1a0894[_0xec1d('0x13')]){return _0x449ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xec1d('0x20')](_0x1a0894)[_0xec1d('0xe')](function(){return _0x449ed3(null,_0x1a0894);});}}}});})[_0xec1d('0x21')](function(_0x4fba7c){return _0x449ed3(null,![],_0x4fba7c);});}function sendServiceMail(_0x47ac1f){return db[_0xec1d('0x22')][_0xec1d('0x23')]({'where':{'service':!![]},'attributes':['id',_0xec1d('0xf'),'email'],'include':[{'model':db[_0xec1d('0x24')],'as':'Smtp','include':[{'model':db[_0xec1d('0x25')],'as':_0xec1d('0x25')}]}]})[_0xec1d('0xe')](function(_0x4840a6){if(!_0x4840a6){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x372997=_0x4840a6[_0xec1d('0x26')]();var _0x3afbf7={'account':_0x372997,'message':_[_0xec1d('0x27')]({'from':util[_0xec1d('0x28')]('\x22%s\x22\x20<%s>',_0x4840a6['name'],_0x4840a6[_0xec1d('0x29')]||_0x4840a6['Smtp']['user'])},_0x47ac1f)};return client['request'](_0xec1d('0x2a'),_0x3afbf7);})[_0xec1d('0xe')](function(_0x3f90f3){if(_0x3f90f3['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3f90f3['error'][_0xec1d('0x2b')]||JSON[_0xec1d('0x2c')](_0x3f90f3['error'])));}return!![];});}function handleError(_0x5cb9b4,_0x389a68,_0x156c63){return _0x5cb9b4['status'](_0x389a68||0x1f4)[_0xec1d('0x2d')]({'message':_0x156c63?_0x156c63[_0xec1d('0x2b')]||_0x156c63:''});}exports['login']=function(_0x4f7b78,_0x3ad5f8,_0x300f9a){passport[_0xec1d('0x1a')](_0xec1d('0x2e'),function(_0x47e994,_0x13792b,_0x4a2786){var _0x4420d3=_0x47e994||_0x4a2786;if(_0x4420d3){return handleError(_0x3ad5f8,0x191,_0x4420d3);}if(!_0x13792b){return handleError(_0x3ad5f8,0x194,{'message':_0xec1d('0x2f')});}else{var _0x4f96a6={'payload':{'id':_0x13792b['id'],'role':_0x13792b['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4f96a6)[_0xec1d('0xe')](function(_0x60242c){_0x3ad5f8[_0xec1d('0x30')]({'id':_0x13792b['id'],'token':_0x60242c,'statusCall':'','isAlreadyLogged':_0x13792b[_0xec1d('0x31')]});});}})(_0x4f7b78,_0x3ad5f8,_0x300f9a);};exports[_0xec1d('0x32')]=function(_0x5029a5,_0x56914b){if(!_0x5029a5[_0xec1d('0x33')]['email']){return handleError(_0x56914b,0x1f4,{'message':_0xec1d('0x34')});}var _0x21a127=rs[_0xec1d('0x35')]();_0x5029a5[_0xec1d('0x33')][_0xec1d('0x29')]=_0x5029a5[_0xec1d('0x33')][_0xec1d('0x29')][_0xec1d('0x36')]()['toLowerCase']();var _0x340774;return db['Setting'][_0xec1d('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xec1d('0x1b')],'raw':!![]})['then'](function(_0x56fc95){_0x340774=_0x56fc95;return db[_0xec1d('0x37')][_0xec1d('0x23')]({'where':{'email':_0x5029a5[_0xec1d('0x33')][_0xec1d('0x29')]}});})[_0xec1d('0xe')](function(_0x56da49){if(!_0x56da49){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x56da49[_0xec1d('0x1f')]){throw new Error(_0xec1d('0x38'));}if(_0x56da49['blocked']){if(moment(_0x56da49[_0xec1d('0x14')])[_0xec1d('0x1c')](_0x340774[_0xec1d('0x1b')],_0xec1d('0x1d'))>moment()){throw new Error(_0xec1d('0x39'));}else{_0x56da49['blocked']=![];_0x56da49[_0xec1d('0x14')]=null;}}_0x56da49[_0xec1d('0x3a')]=_0x21a127;_0x56da49[_0xec1d('0x3b')]=Date[_0xec1d('0x3c')]()+0x36ee80;return _0x56da49[_0xec1d('0x3d')]();})['then'](function(){return sendServiceMail({'to':_0x5029a5[_0xec1d('0x33')][_0xec1d('0x29')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xec1d('0x3e')+_0xec1d('0x3f')+_0xec1d('0x40')+_0x5029a5['headers']['host']+_0xec1d('0x41')+_0x21a127+'\x0a\x0a'+_0xec1d('0x42')});})[_0xec1d('0xe')](function(){_0x56914b[_0xec1d('0x43')](0xc8)['send']({'message':_0xec1d('0x44')});})[_0xec1d('0x21')](function(_0x1ddc15){return handleError(_0x56914b,0x1f4,_0x1ddc15);});};exports['reset']=function(_0x8afe91,_0x2e8221){return db[_0xec1d('0x37')]['find']({'where':{'resetPasswordToken':_0x8afe91[_0xec1d('0x45')][_0xec1d('0x46')],'resetPasswordExpires':{'$gt':Date[_0xec1d('0x3c')]()}}})['then'](function(_0x37aa4e){if(!_0x37aa4e){throw new Error(_0xec1d('0x47'));}return db[_0xec1d('0xb')][_0xec1d('0xc')]({'attributes':['id',_0xec1d('0x48'),_0xec1d('0x49'),_0xec1d('0x4a')]})[_0xec1d('0xe')](function(_0x5c7b47){if(_0x5c7b47[_0xec1d('0x48')])authService['validatePasswordPattern'](_0x8afe91[_0xec1d('0x33')][_0xec1d('0x10')]);if(!_0x5c7b47[_0xec1d('0x49')]||!_0x37aa4e['previousPasswords'])return _0x37aa4e;authService['validatePasswordHistory'](_0x8afe91[_0xec1d('0x33')][_0xec1d('0x10')],_0x37aa4e[_0xec1d('0x4b')],_0x5c7b47['passwordHistoryLimit']);return _0x37aa4e;})[_0xec1d('0xe')](function(){_0x37aa4e[_0xec1d('0x10')]=_0x8afe91[_0xec1d('0x33')][_0xec1d('0x10')];_0x37aa4e[_0xec1d('0x3a')]=null;_0x37aa4e['resetPasswordExpires']=null;return _0x37aa4e[_0xec1d('0x3d')]();});})['then'](function(){_0x2e8221[_0xec1d('0x43')](0xc8)[_0xec1d('0x2d')]({'message':_0xec1d('0x4c')});})[_0xec1d('0x21')](function(_0x3a1db0){return handleError(_0x2e8221,0x1f4,_0x3a1db0);});};passport['use'](_0xec1d('0x2e'),new LocalStrategy({'usernameField':_0xec1d('0xf'),'passwordField':'password'},function(_0x3bc3cb,_0x118ee0,_0x1f30f7){return localAuthenticate(db['User'],_0x3bc3cb,_0x118ee0,_0x1f30f7);}));
\ No newline at end of file
+var _0x5fdb=['MailAccount','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','error','status','send','local-login','role','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','then','findOne','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','minutes','clearBlockUser','getLicense','catch'];(function(_0x52b8aa,_0x2cce69){var _0x5b9832=function(_0x50f585){while(--_0x50f585){_0x52b8aa['push'](_0x52b8aa['shift']());}};_0x5b9832(++_0x2cce69);}(_0x5fdb,0x1b0));var _0xb5fd=function(_0x199721,_0x7ccb0c){_0x199721=_0x199721-0x0;var _0x3fc405=_0x5fdb[_0x199721];return _0x3fc405;};'use strict';var util=require(_0xb5fd('0x0'));var passport=require('passport');var LocalStrategy=require(_0xb5fd('0x1'))[_0xb5fd('0x2')];var jayson=require('jayson/promise');var _=require(_0xb5fd('0x3'));var rs=require(_0xb5fd('0x4'));var moment=require(_0xb5fd('0x5'));var db=require(_0xb5fd('0x6'))['db'];var authService=require(_0xb5fd('0x7'));var utils=require(_0xb5fd('0x8'));var client=jayson['client'][_0xb5fd('0x9')]({'port':0x232b});function localAuthenticate(_0x5b41c2,_0x3ac7f6,_0x13130a,_0x467f67){var _0x4107e1,_0x57bc04;return db[_0xb5fd('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xb5fd('0xb')](function(_0x529cfd){_0x4107e1=_0x529cfd;return _0x5b41c2[_0xb5fd('0xc')]({'attributes':['id',_0xb5fd('0xd'),_0xb5fd('0xe'),_0xb5fd('0xf'),'role',_0xb5fd('0x10'),_0xb5fd('0x11'),_0xb5fd('0x12'),_0xb5fd('0x13')],'where':{'name':_0x3ac7f6,'role':{'$or':[_0xb5fd('0x14'),_0xb5fd('0x15'),'agent']}}});})[_0xb5fd('0xb')](function(_0x37b89a){if(!_0x37b89a||_0x37b89a&&_0x37b89a['name']!==_0x3ac7f6){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x57bc04=_0x37b89a;return _0x57bc04;}})[_0xb5fd('0xb')](function(){_0x57bc04[_0xb5fd('0x16')](_0x13130a,function(_0x3b2b00,_0x5e8e25){var _0x34d24f=_0x57bc04[_0xb5fd('0x13')]+0x1;if(_0x3b2b00){return _0x467f67(_0x3b2b00);}else if(!_0x5e8e25){if(_0x57bc04[_0xb5fd('0x10')]){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}else if(_0x4107e1[_0xb5fd('0x18')]>0x0){if(_0x57bc04['blocked']){if(_0x4107e1[_0xb5fd('0x19')]>0x0){if(moment(_0x57bc04['blockedAt'])['add'](_0x4107e1[_0xb5fd('0x19')],_0xb5fd('0x1a'))>moment()){return _0x467f67(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xb5fd('0x1b')](_0x57bc04,_0x34d24f,![],null)[_0xb5fd('0xb')](function(){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});});}}else{return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}}else{if(_0x34d24f>=_0x4107e1['allowedLoginAttempts']){return utils[_0xb5fd('0x1b')](_0x57bc04,0x0,!![],moment())[_0xb5fd('0xb')](function(){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});});}else{return utils[_0xb5fd('0x1b')](_0x57bc04,_0x34d24f,![],null)[_0xb5fd('0xb')](function(){return _0x467f67(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x467f67(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x57bc04[_0xb5fd('0x10')]){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}else if(_0x4107e1[_0xb5fd('0x18')]>0x0){if(_0x57bc04[_0xb5fd('0x11')]){if(_0x4107e1[_0xb5fd('0x19')]>0x0){if(moment(_0x57bc04[_0xb5fd('0x12')])['add'](_0x4107e1[_0xb5fd('0x19')],_0xb5fd('0x1a'))>moment()){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}else{return utils['clearBlockUser'](_0x57bc04,0x0,![],null)[_0xb5fd('0xb')](function(){return utils[_0xb5fd('0x1c')](_0x57bc04);})[_0xb5fd('0xb')](function(){return _0x467f67(null,_0x57bc04);});}}else{return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}}else{return utils['clearBlockUser'](_0x57bc04,0x0,![],null)[_0xb5fd('0xb')](function(){return utils['getLicense'](_0x57bc04);})['then'](function(){return _0x467f67(null,_0x57bc04);})['catch'](function(_0x597aac){return _0x467f67(null,![],_0x597aac);});}}else{if(_0x57bc04['blocked']){return _0x467f67(null,![],{'message':_0xb5fd('0x17')});}else{return utils[_0xb5fd('0x1c')](_0x57bc04)[_0xb5fd('0xb')](function(){return _0x467f67(null,_0x57bc04);});}}}});})[_0xb5fd('0x1d')](function(_0x5774fb){return _0x467f67(null,![],_0x5774fb);});}function sendServiceMail(_0x7d13aa){return db[_0xb5fd('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xb5fd('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xb5fd('0x1f'),'include':[{'model':db[_0xb5fd('0x20')],'as':_0xb5fd('0x20')}]}]})[_0xb5fd('0xb')](function(_0x23233a){if(!_0x23233a){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x43d271=_0x23233a[_0xb5fd('0x21')]();var _0x7075dd={'account':_0x43d271,'message':_[_0xb5fd('0x22')]({'from':util[_0xb5fd('0x23')](_0xb5fd('0x24'),_0x23233a[_0xb5fd('0xd')],_0x23233a[_0xb5fd('0x25')]||_0x23233a[_0xb5fd('0x1f')]['user'])},_0x7d13aa)};return client[_0xb5fd('0x26')]('SendMail',_0x7075dd);})[_0xb5fd('0xb')](function(_0x56865a){if(_0x56865a['error']){throw new Error(util[_0xb5fd('0x23')](_0xb5fd('0x27'),_0x56865a['error']['message']||JSON[_0xb5fd('0x28')](_0x56865a[_0xb5fd('0x29')])));}return!![];});}function handleError(_0x2f2af5,_0x2f888c,_0x99889d){return _0x2f2af5[_0xb5fd('0x2a')](_0x2f888c||0x1f4)[_0xb5fd('0x2b')]({'message':_0x99889d?_0x99889d['message']||_0x99889d:''});}exports['login']=function(_0x513e16,_0x190cf8,_0x16c1de){passport[_0xb5fd('0x16')](_0xb5fd('0x2c'),function(_0x3f075c,_0x464a2a,_0x1acd9c){var _0x81a5a6=_0x3f075c||_0x1acd9c;if(_0x81a5a6){return handleError(_0x190cf8,0x191,_0x81a5a6);}if(!_0x464a2a){return handleError(_0x190cf8,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1667c7={'payload':{'id':_0x464a2a['id'],'role':_0x464a2a[_0xb5fd('0x2d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1667c7)['then'](function(_0xcaa002){_0x190cf8[_0xb5fd('0x2e')]({'id':_0x464a2a['id'],'token':_0xcaa002,'statusCall':'','isAlreadyLogged':_0x464a2a[_0xb5fd('0x2f')]});});}})(_0x513e16,_0x190cf8,_0x16c1de);};exports['forgot']=function(_0x5c6ad9,_0x2b9b18){if(!_0x5c6ad9[_0xb5fd('0x30')][_0xb5fd('0x25')]){return handleError(_0x2b9b18,0x1f4,{'message':_0xb5fd('0x31')});}var _0x153b90=rs['generate']();_0x5c6ad9[_0xb5fd('0x30')]['email']=_0x5c6ad9['body'][_0xb5fd('0x25')][_0xb5fd('0x32')]()[_0xb5fd('0x33')]();var _0x43aff0;return db[_0xb5fd('0xa')][_0xb5fd('0xc')]({'where':{'id':0x1},'attributes':[_0xb5fd('0x18'),_0xb5fd('0x19')],'raw':!![]})[_0xb5fd('0xb')](function(_0x1a2648){_0x43aff0=_0x1a2648;return db[_0xb5fd('0x34')][_0xb5fd('0x35')]({'where':{'email':_0x5c6ad9[_0xb5fd('0x30')][_0xb5fd('0x25')]}});})[_0xb5fd('0xb')](function(_0x9a9dc2){if(!_0x9a9dc2){throw new Error(_0xb5fd('0x36'));}if(_0x9a9dc2[_0xb5fd('0x10')]){throw new Error(_0xb5fd('0x37'));}if(_0x9a9dc2[_0xb5fd('0x11')]){if(moment(_0x9a9dc2[_0xb5fd('0x12')])['add'](_0x43aff0[_0xb5fd('0x19')],_0xb5fd('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x9a9dc2[_0xb5fd('0x11')]=![];_0x9a9dc2['blockedAt']=null;}}_0x9a9dc2['resetPasswordToken']=_0x153b90;_0x9a9dc2[_0xb5fd('0x38')]=Date['now']()+0x36ee80;return _0x9a9dc2[_0xb5fd('0x39')]();})[_0xb5fd('0xb')](function(){return sendServiceMail({'to':_0x5c6ad9[_0xb5fd('0x30')][_0xb5fd('0x25')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xb5fd('0x3a')+_0xb5fd('0x3b')+_0xb5fd('0x3c')+_0x5c6ad9['headers']['host']+_0xb5fd('0x3d')+_0x153b90+'\x0a\x0a'+_0xb5fd('0x3e')});})[_0xb5fd('0xb')](function(){_0x2b9b18[_0xb5fd('0x2a')](0xc8)[_0xb5fd('0x2b')]({'message':_0xb5fd('0x3f')});})[_0xb5fd('0x1d')](function(_0x4a7372){return handleError(_0x2b9b18,0x1f4,_0x4a7372);});};exports[_0xb5fd('0x40')]=function(_0x531098,_0x4bc382){return db['User'][_0xb5fd('0x35')]({'where':{'resetPasswordToken':_0x531098[_0xb5fd('0x41')][_0xb5fd('0x42')],'resetPasswordExpires':{'$gt':Date[_0xb5fd('0x43')]()}}})['then'](function(_0xcaf415){if(!_0xcaf415){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id',_0xb5fd('0x44'),'enforcePasswordHistory',_0xb5fd('0x45')]})[_0xb5fd('0xb')](function(_0x54c125){if(_0x54c125[_0xb5fd('0x44')])authService[_0xb5fd('0x46')](_0x531098['body']['password']);if(!_0x54c125[_0xb5fd('0x47')]||!_0xcaf415['previousPasswords'])return _0xcaf415;authService[_0xb5fd('0x48')](_0x531098[_0xb5fd('0x30')]['password'],_0xcaf415[_0xb5fd('0x49')],_0x54c125[_0xb5fd('0x45')]);return _0xcaf415;})[_0xb5fd('0xb')](function(){_0xcaf415[_0xb5fd('0xe')]=_0x531098[_0xb5fd('0x30')][_0xb5fd('0xe')];_0xcaf415[_0xb5fd('0x4a')]=null;_0xcaf415[_0xb5fd('0x38')]=null;return _0xcaf415[_0xb5fd('0x39')]();});})[_0xb5fd('0xb')](function(){_0x4bc382[_0xb5fd('0x2a')](0xc8)[_0xb5fd('0x2b')]({'message':_0xb5fd('0x4b')});})['catch'](function(_0x4a40c1){return handleError(_0x4bc382,0x1f4,_0x4a40c1);});};passport[_0xb5fd('0x4c')](_0xb5fd('0x2c'),new LocalStrategy({'usernameField':_0xb5fd('0xd'),'passwordField':_0xb5fd('0xe')},function(_0x2c2784,_0xe66106,_0x26b08e){return localAuthenticate(db['User'],_0x2c2784,_0xe66106,_0x26b08e);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 9202e06..c1ee476 100644
--- a/server/api/authLocal/index.js
+++ b/server/api/authLocal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb786=['post','login','/forgot','forgot','exports','express','./authLocal.controller'];(function(_0x118c30,_0x7eb1eb){var _0x569999=function(_0x550ba2){while(--_0x550ba2){_0x118c30['push'](_0x118c30['shift']());}};_0x569999(++_0x7eb1eb);}(_0xb786,0x19b));var _0x6b78=function(_0x4eabbb,_0x8ac99a){_0x4eabbb=_0x4eabbb-0x0;var _0x1d9d1e=_0xb786[_0x4eabbb];return _0x1d9d1e;};'use strict';var express=require(_0x6b78('0x0'));var router=express['Router']();var controller=require(_0x6b78('0x1'));router[_0x6b78('0x2')]('/',controller[_0x6b78('0x3')]);router[_0x6b78('0x2')](_0x6b78('0x4'),controller[_0x6b78('0x5')]);router[_0x6b78('0x2')]('/reset/:token',controller['reset']);module[_0x6b78('0x6')]=router;
\ No newline at end of file
+var _0x3790=['reset','exports','express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token'];(function(_0x46b764,_0x57765b){var _0x286081=function(_0x194b77){while(--_0x194b77){_0x46b764['push'](_0x46b764['shift']());}};_0x286081(++_0x57765b);}(_0x3790,0x1ba));var _0x0379=function(_0x30c550,_0x20a759){_0x30c550=_0x30c550-0x0;var _0x49d16f=_0x3790[_0x30c550];return _0x49d16f;};'use strict';var express=require(_0x0379('0x0'));var router=express[_0x0379('0x1')]();var controller=require(_0x0379('0x2'));router[_0x0379('0x3')]('/',controller[_0x0379('0x4')]);router[_0x0379('0x3')](_0x0379('0x5'),controller[_0x0379('0x6')]);router[_0x0379('0x3')](_0x0379('0x7'),controller[_0x0379('0x8')]);module[_0x0379('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 9013afd..59ee4fd 100644
--- a/server/api/automation/automation.attributes.js
+++ b/server/api/automation/automation.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf64b=['STRING','INTEGER','exports'];(function(_0xdd2b37,_0x283385){var _0x54deb3=function(_0x57c859){while(--_0x57c859){_0xdd2b37['push'](_0xdd2b37['shift']());}};_0x54deb3(++_0x283385);}(_0xf64b,0x1d6));var _0xbf64=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xf64b[_0x46f1a6];return _0x38429a;};'use strict';var Sequelize=require('sequelize');module[_0xbf64('0x0')]={'name':{'type':Sequelize[_0xbf64('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbf64('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbf64('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xc6f0=['STRING','INTEGER'];(function(_0x123df5,_0x5a535b){var _0x115fc5=function(_0x44e410){while(--_0x44e410){_0x123df5['push'](_0x123df5['shift']());}};_0x115fc5(++_0x5a535b);}(_0xc6f0,0xea));var _0x0c6f=function(_0xb1790f,_0x5f51a4){_0xb1790f=_0xb1790f-0x0;var _0x50c602=_0xc6f0[_0xb1790f];return _0x50c602;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c6f('0x0')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0c6f('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0c6f('0x1')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 2102cf8..c38eee1 100644
--- a/server/api/automation/automation.controller.js
+++ b/server/api/automation/automation.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0b4=['undefined','count','offset','set','Content-Range','json','save','update','then','end','error','stack','name','send','index','map','Automation','rawAttributes','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','addConditions','ids','omit','getConditions','findOne','Condition','order','pick','filter','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x9b2cd3,_0x344955){var _0x56995b=function(_0x46cc75){while(--_0x46cc75){_0x9b2cd3['push'](_0x9b2cd3['shift']());}};_0x56995b(++_0x344955);}(_0xe0b4,0x92));var _0x4e0b=function(_0x2791e3,_0x53720c){_0x2791e3=_0x2791e3-0x0;var _0x50a6f2=_0xe0b4[_0x2791e3];return _0x50a6f2;};'use strict';var emlformat=require(_0x4e0b('0x0'));var rimraf=require(_0x4e0b('0x1'));var zipdir=require(_0x4e0b('0x2'));var jsonpatch=require(_0x4e0b('0x3'));var rp=require(_0x4e0b('0x4'));var moment=require(_0x4e0b('0x5'));var BPromise=require(_0x4e0b('0x6'));var Mustache=require('mustache');var util=require(_0x4e0b('0x7'));var path=require(_0x4e0b('0x8'));var sox=require(_0x4e0b('0x9'));var csv=require('to-csv');var ejs=require(_0x4e0b('0xa'));var fs=require('fs');var fs_extra=require(_0x4e0b('0xb'));var _=require(_0x4e0b('0xc'));var squel=require(_0x4e0b('0xd'));var crypto=require(_0x4e0b('0xe'));var jsforce=require(_0x4e0b('0xf'));var deskjs=require(_0x4e0b('0x10'));var toCsv=require(_0x4e0b('0x11'));var querystring=require(_0x4e0b('0x12'));var Papa=require(_0x4e0b('0x13'));var Redis=require(_0x4e0b('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x4e0b('0x15'));var as=require(_0x4e0b('0x16'));var hardwareService=require(_0x4e0b('0x17'));var logger=require('../../config/logger')(_0x4e0b('0x18'));var utils=require(_0x4e0b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4e0b('0x1a'));var db=require(_0x4e0b('0x1b'))['db'];function respondWithStatusCode(_0x2c5a9f,_0x57fb39){_0x57fb39=_0x57fb39||0xcc;return function(_0x1bcfa0){if(_0x1bcfa0){return _0x2c5a9f[_0x4e0b('0x1c')](_0x57fb39);}return _0x2c5a9f[_0x4e0b('0x1d')](_0x57fb39)['end']();};}function respondWithResult(_0x4d9456,_0x42604f){_0x42604f=_0x42604f||0xc8;return function(_0x324ca2){if(_0x324ca2){return _0x4d9456['status'](_0x42604f)['json'](_0x324ca2);}};}function respondWithFilteredResult(_0x1217e4,_0x5350f2){return function(_0x1862c4){if(_0x1862c4){var _0x3a5589=typeof _0x5350f2['offset']==='undefined'&&typeof _0x5350f2['limit']===_0x4e0b('0x1e');var _0x13c88b=_0x1862c4[_0x4e0b('0x1f')];var _0x3efc08=_0x3a5589?0x0:_0x5350f2['offset'];var _0x1e18c1=_0x3a5589?_0x1862c4['count']:_0x5350f2[_0x4e0b('0x20')]+_0x5350f2['limit'];var _0x21429d;if(_0x1e18c1>=_0x13c88b){_0x1e18c1=_0x13c88b;_0x21429d=0xc8;}else{_0x21429d=0xce;}_0x1217e4[_0x4e0b('0x1d')](_0x21429d);return _0x1217e4[_0x4e0b('0x21')](_0x4e0b('0x22'),_0x3efc08+'-'+_0x1e18c1+'/'+_0x13c88b)[_0x4e0b('0x23')](_0x1862c4);}return null;};}function patchUpdates(_0x5ec2da){return function(_0x1b601c){try{jsonpatch['apply'](_0x1b601c,_0x5ec2da,!![]);}catch(_0x2cf947){return BPromise['reject'](_0x2cf947);}return _0x1b601c[_0x4e0b('0x24')]();};}function saveUpdates(_0x295d95,_0x1f8885){return function(_0x11a974){if(_0x11a974){return _0x11a974[_0x4e0b('0x25')](_0x295d95)[_0x4e0b('0x26')](function(_0x2fc9f1){return _0x2fc9f1;});}return null;};}function removeEntity(_0x3b83a0,_0x3f70a7){return function(_0x481e49){if(_0x481e49){return _0x481e49['destroy']()[_0x4e0b('0x26')](function(){_0x3b83a0[_0x4e0b('0x1d')](0xcc)[_0x4e0b('0x27')]();});}};}function handleEntityNotFound(_0x5d9f29,_0x4d39a5){return function(_0x1f008e){if(!_0x1f008e){_0x5d9f29['sendStatus'](0x194);}return _0x1f008e;};}function handleError(_0x213ecd,_0x4631c4){_0x4631c4=_0x4631c4||0x1f4;return function(_0x324fa7){logger[_0x4e0b('0x28')](_0x324fa7[_0x4e0b('0x29')]);if(_0x324fa7[_0x4e0b('0x2a')]){delete _0x324fa7[_0x4e0b('0x2a')];}_0x213ecd['status'](_0x4631c4)[_0x4e0b('0x2b')](_0x324fa7);};}exports[_0x4e0b('0x2c')]=function(_0x47f163,_0x728e49){var _0x329c00={},_0x2f6cc0={},_0x5cda22={'count':0x0,'rows':[]};var _0x17b8d8=_[_0x4e0b('0x2d')](db[_0x4e0b('0x2e')][_0x4e0b('0x2f')],function(_0x8df4e7){return{'name':_0x8df4e7['fieldName'],'type':_0x8df4e7[_0x4e0b('0x30')]['key']};});_0x2f6cc0[_0x4e0b('0x31')]=_[_0x4e0b('0x2d')](_0x17b8d8,_0x4e0b('0x2a'));_0x2f6cc0[_0x4e0b('0x32')]=_['keys'](_0x47f163[_0x4e0b('0x32')]);_0x2f6cc0['filters']=_['intersection'](_0x2f6cc0[_0x4e0b('0x31')],_0x2f6cc0[_0x4e0b('0x32')]);_0x329c00[_0x4e0b('0x33')]=_[_0x4e0b('0x34')](_0x2f6cc0[_0x4e0b('0x31')],qs[_0x4e0b('0x35')](_0x47f163['query'][_0x4e0b('0x35')]));_0x329c00['attributes']=_0x329c00[_0x4e0b('0x33')][_0x4e0b('0x36')]?_0x329c00['attributes']:_0x2f6cc0[_0x4e0b('0x31')];if(!_0x47f163[_0x4e0b('0x32')][_0x4e0b('0x37')](_0x4e0b('0x38'))){_0x329c00['limit']=qs[_0x4e0b('0x39')](_0x47f163[_0x4e0b('0x32')][_0x4e0b('0x39')]);_0x329c00[_0x4e0b('0x20')]=qs['offset'](_0x47f163[_0x4e0b('0x32')][_0x4e0b('0x20')]);}_0x329c00['order']=qs['sort'](_0x47f163[_0x4e0b('0x32')][_0x4e0b('0x3a')]);_0x329c00[_0x4e0b('0x3b')]=qs['filters'](_['pick'](_0x47f163[_0x4e0b('0x32')],_0x2f6cc0[_0x4e0b('0x3c')]),_0x17b8d8);if(_0x47f163['query']['filter']){_0x329c00[_0x4e0b('0x3b')]=_[_0x4e0b('0x3d')](_0x329c00[_0x4e0b('0x3b')],{'$or':_[_0x4e0b('0x2d')](_0x17b8d8,function(_0xfdbb57){if(_0xfdbb57[_0x4e0b('0x30')]!==_0x4e0b('0x3e')){var _0x51b96d={};_0x51b96d[_0xfdbb57['name']]={'$like':'%'+_0x47f163[_0x4e0b('0x32')]['filter']+'%'};return _0x51b96d;}})});}_0x329c00=_[_0x4e0b('0x3d')]({},_0x329c00,_0x47f163[_0x4e0b('0x3f')]);var _0x304ede={'where':_0x329c00[_0x4e0b('0x3b')]};return db[_0x4e0b('0x2e')][_0x4e0b('0x1f')](_0x304ede)[_0x4e0b('0x26')](function(_0xcc0ce8){_0x5cda22[_0x4e0b('0x1f')]=_0xcc0ce8;if(_0x47f163['query'][_0x4e0b('0x40')]){_0x329c00[_0x4e0b('0x41')]=[{'all':!![]}];}return db[_0x4e0b('0x2e')][_0x4e0b('0x42')](_0x329c00);})[_0x4e0b('0x26')](function(_0xe9d877){_0x5cda22[_0x4e0b('0x43')]=_0xe9d877;return _0x5cda22;})[_0x4e0b('0x26')](respondWithFilteredResult(_0x728e49,_0x329c00))[_0x4e0b('0x44')](handleError(_0x728e49,null));};exports[_0x4e0b('0x45')]=function(_0x4198cb,_0x2e4cf2){var _0x3ac11b={'raw':![],'where':{'id':_0x4198cb[_0x4e0b('0x46')]['id']}},_0x49e1f6={};_0x49e1f6[_0x4e0b('0x31')]=_[_0x4e0b('0x47')](db[_0x4e0b('0x2e')][_0x4e0b('0x2f')]);_0x49e1f6[_0x4e0b('0x32')]=_['keys'](_0x4198cb['query']);_0x49e1f6[_0x4e0b('0x3c')]=_[_0x4e0b('0x34')](_0x49e1f6[_0x4e0b('0x31')],_0x49e1f6[_0x4e0b('0x32')]);_0x3ac11b['attributes']=_[_0x4e0b('0x34')](_0x49e1f6[_0x4e0b('0x31')],qs[_0x4e0b('0x35')](_0x4198cb['query'][_0x4e0b('0x35')]));_0x3ac11b['attributes']=_0x3ac11b['attributes'][_0x4e0b('0x36')]?_0x3ac11b[_0x4e0b('0x33')]:_0x49e1f6[_0x4e0b('0x31')];if(_0x4198cb[_0x4e0b('0x32')][_0x4e0b('0x40')]){_0x3ac11b[_0x4e0b('0x41')]=[{'all':!![]}];}_0x3ac11b=_[_0x4e0b('0x3d')]({},_0x3ac11b,_0x4198cb[_0x4e0b('0x3f')]);return db['Automation'][_0x4e0b('0x48')](_0x3ac11b)[_0x4e0b('0x26')](handleEntityNotFound(_0x2e4cf2,null))[_0x4e0b('0x26')](respondWithResult(_0x2e4cf2,null))[_0x4e0b('0x44')](handleError(_0x2e4cf2,null));};exports[_0x4e0b('0x49')]=function(_0x55d239,_0x373e1d){return db['Automation'][_0x4e0b('0x49')](_0x55d239[_0x4e0b('0x4a')],{})['then'](respondWithResult(_0x373e1d,0xc9))['catch'](handleError(_0x373e1d,null));};exports[_0x4e0b('0x25')]=function(_0x4a5887,_0x2fcda2){if(_0x4a5887['body']['id']){delete _0x4a5887[_0x4e0b('0x4a')]['id'];}return db[_0x4e0b('0x2e')][_0x4e0b('0x48')]({'where':{'id':_0x4a5887[_0x4e0b('0x46')]['id']}})[_0x4e0b('0x26')](handleEntityNotFound(_0x2fcda2,null))[_0x4e0b('0x26')](saveUpdates(_0x4a5887[_0x4e0b('0x4a')],null))[_0x4e0b('0x26')](respondWithResult(_0x2fcda2,null))['catch'](handleError(_0x2fcda2,null));};exports[_0x4e0b('0x4b')]=function(_0x491c6e,_0x552b82){return db[_0x4e0b('0x2e')][_0x4e0b('0x48')]({'where':{'id':_0x491c6e[_0x4e0b('0x46')]['id']}})[_0x4e0b('0x26')](handleEntityNotFound(_0x552b82,null))['then'](removeEntity(_0x552b82,null))['catch'](handleError(_0x552b82,null));};exports[_0x4e0b('0x4c')]=function(_0x2a348f,_0x231796,_0x1720df){return db['Condition']['find']({'where':{'id':_0x2a348f[_0x4e0b('0x46')]['id']}})[_0x4e0b('0x26')](handleEntityNotFound(_0x231796,null))[_0x4e0b('0x26')](function(_0x35de18){if(_0x35de18){return _0x35de18['addConditions'](_0x2a348f[_0x4e0b('0x4a')][_0x4e0b('0x4d')],_[_0x4e0b('0x4e')](_0x2a348f['body'],[_0x4e0b('0x4d'),'id'])||{});}})[_0x4e0b('0x26')](respondWithResult(_0x231796,null))[_0x4e0b('0x44')](handleError(_0x231796,null));};exports[_0x4e0b('0x4f')]=function(_0x153852,_0x5a165a,_0x555f78){var _0x9bfaac={};var _0x507984={};var _0x472bd7;var _0x318576;return db['Automation'][_0x4e0b('0x50')]({'where':{'id':_0x153852[_0x4e0b('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a165a,null))[_0x4e0b('0x26')](function(_0x4a9caa){if(_0x4a9caa){_0x472bd7=_0x4a9caa;_0x507984[_0x4e0b('0x31')]=_[_0x4e0b('0x47')](db[_0x4e0b('0x51')][_0x4e0b('0x2f')]);_0x507984[_0x4e0b('0x32')]=_['keys'](_0x153852[_0x4e0b('0x32')]);_0x507984[_0x4e0b('0x3c')]=_[_0x4e0b('0x34')](_0x507984['model'],_0x507984['query']);_0x9bfaac[_0x4e0b('0x33')]=_[_0x4e0b('0x34')](_0x507984[_0x4e0b('0x31')],qs['fields'](_0x153852[_0x4e0b('0x32')]['fields']));_0x9bfaac['attributes']=_0x9bfaac[_0x4e0b('0x33')][_0x4e0b('0x36')]?_0x9bfaac[_0x4e0b('0x33')]:_0x507984[_0x4e0b('0x31')];_0x9bfaac[_0x4e0b('0x52')]=qs[_0x4e0b('0x3a')](_0x153852['query'][_0x4e0b('0x3a')]);_0x9bfaac[_0x4e0b('0x3b')]=qs[_0x4e0b('0x3c')](_[_0x4e0b('0x53')](_0x153852['query'],_0x507984[_0x4e0b('0x3c')]));if(_0x153852[_0x4e0b('0x32')][_0x4e0b('0x54')]){_0x9bfaac[_0x4e0b('0x3b')]=_[_0x4e0b('0x3d')](_0x9bfaac[_0x4e0b('0x3b')],{'$or':_[_0x4e0b('0x2d')](_0x9bfaac['attributes'],function(_0x46142c){var _0xabfa52={};_0xabfa52[_0x46142c]={'$like':'%'+_0x153852[_0x4e0b('0x32')][_0x4e0b('0x54')]+'%'};return _0xabfa52;})});}_0x9bfaac=_[_0x4e0b('0x3d')]({},_0x9bfaac,_0x153852[_0x4e0b('0x3f')]);return _0x472bd7[_0x4e0b('0x4f')](_0x9bfaac);}})[_0x4e0b('0x26')](function(_0x25cae5){if(_0x25cae5){_0x318576=_0x25cae5[_0x4e0b('0x36')];if(!_0x153852['query'][_0x4e0b('0x37')]('nolimit')){_0x9bfaac[_0x4e0b('0x39')]=qs[_0x4e0b('0x39')](_0x153852['query'][_0x4e0b('0x39')]);_0x9bfaac[_0x4e0b('0x20')]=qs['offset'](_0x153852[_0x4e0b('0x32')]['offset']);}return _0x472bd7[_0x4e0b('0x4f')](_0x9bfaac);}})[_0x4e0b('0x26')](function(_0x1aa662){if(_0x1aa662){return _0x1aa662?{'count':_0x318576,'rows':_0x1aa662}:null;}})['then'](respondWithResult(_0x5a165a,null))[_0x4e0b('0x44')](handleError(_0x5a165a,null));};exports[_0x4e0b('0x55')]=function(_0x29b09b,_0x4aa2f9,_0x2fef51){return db[_0x4e0b('0x56')][_0x4e0b('0x48')]({'where':{'id':_0x29b09b[_0x4e0b('0x46')]['id']}})[_0x4e0b('0x26')](handleEntityNotFound(_0x4aa2f9,null))['then'](function(_0xc2c99a){if(_0xc2c99a){return _0xc2c99a[_0x4e0b('0x55')](_0x29b09b[_0x4e0b('0x4a')][_0x4e0b('0x4d')],_[_0x4e0b('0x4e')](_0x29b09b[_0x4e0b('0x4a')],[_0x4e0b('0x4d'),'id'])||{});}})[_0x4e0b('0x26')](respondWithResult(_0x4aa2f9,null))['catch'](handleError(_0x4aa2f9,null));};exports[_0x4e0b('0x57')]=function(_0x257c13,_0x38ab14,_0xd16dda){var _0xd154a4={};var _0x40fb01={};var _0x1a13ae;var _0x5e91d1;return db[_0x4e0b('0x2e')]['findOne']({'where':{'id':_0x257c13['params']['id']}})['then'](handleEntityNotFound(_0x38ab14,null))['then'](function(_0x18bf27){if(_0x18bf27){_0x1a13ae=_0x18bf27;_0x40fb01['model']=_[_0x4e0b('0x47')](db[_0x4e0b('0x56')][_0x4e0b('0x2f')]);_0x40fb01[_0x4e0b('0x32')]=_['keys'](_0x257c13[_0x4e0b('0x32')]);_0x40fb01[_0x4e0b('0x3c')]=_[_0x4e0b('0x34')](_0x40fb01[_0x4e0b('0x31')],_0x40fb01['query']);_0xd154a4['attributes']=_[_0x4e0b('0x34')](_0x40fb01['model'],qs['fields'](_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x35')]));_0xd154a4[_0x4e0b('0x33')]=_0xd154a4[_0x4e0b('0x33')][_0x4e0b('0x36')]?_0xd154a4['attributes']:_0x40fb01[_0x4e0b('0x31')];_0xd154a4['order']=qs[_0x4e0b('0x3a')](_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x3a')]);_0xd154a4[_0x4e0b('0x3b')]=qs['filters'](_[_0x4e0b('0x53')](_0x257c13['query'],_0x40fb01[_0x4e0b('0x3c')]));if(_0x257c13['query']['filter']){_0xd154a4[_0x4e0b('0x3b')]=_[_0x4e0b('0x3d')](_0xd154a4[_0x4e0b('0x3b')],{'$or':_[_0x4e0b('0x2d')](_0xd154a4[_0x4e0b('0x33')],function(_0x25eebe){var _0x4c9ee4={};_0x4c9ee4[_0x25eebe]={'$like':'%'+_0x257c13[_0x4e0b('0x32')]['filter']+'%'};return _0x4c9ee4;})});}_0xd154a4=_['merge']({},_0xd154a4,_0x257c13[_0x4e0b('0x3f')]);return _0x1a13ae['getActions'](_0xd154a4);}})[_0x4e0b('0x26')](function(_0x4e7555){if(_0x4e7555){_0x5e91d1=_0x4e7555['length'];if(!_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x37')]('nolimit')){_0xd154a4[_0x4e0b('0x39')]=qs['limit'](_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x39')]);_0xd154a4[_0x4e0b('0x20')]=qs['offset'](_0x257c13[_0x4e0b('0x32')][_0x4e0b('0x20')]);}return _0x1a13ae[_0x4e0b('0x57')](_0xd154a4);}})[_0x4e0b('0x26')](function(_0x49e424){if(_0x49e424){return _0x49e424?{'count':_0x5e91d1,'rows':_0x49e424}:null;}})['then'](respondWithResult(_0x38ab14,null))['catch'](handleError(_0x38ab14,null));};
\ No newline at end of file
+var _0xec2c=['zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','show','options','find','catch','create','body','params','Condition','addConditions','ids','omit','getConditions','findOne','order','pick','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf'];(function(_0x3a0e72,_0x5520fd){var _0x2caf78=function(_0x16fa6a){while(--_0x16fa6a){_0x3a0e72['push'](_0x3a0e72['shift']());}};_0x2caf78(++_0x5520fd);}(_0xec2c,0x1a7));var _0xcec2=function(_0x2f31d0,_0x4fce9a){_0x2f31d0=_0x2f31d0-0x0;var _0x1d0256=_0xec2c[_0x2f31d0];return _0x1d0256;};'use strict';var emlformat=require(_0xcec2('0x0'));var rimraf=require(_0xcec2('0x1'));var zipdir=require(_0xcec2('0x2'));var jsonpatch=require(_0xcec2('0x3'));var rp=require('request-promise');var moment=require(_0xcec2('0x4'));var BPromise=require(_0xcec2('0x5'));var Mustache=require(_0xcec2('0x6'));var util=require('util');var path=require(_0xcec2('0x7'));var sox=require(_0xcec2('0x8'));var csv=require(_0xcec2('0x9'));var ejs=require(_0xcec2('0xa'));var fs=require('fs');var fs_extra=require(_0xcec2('0xb'));var _=require(_0xcec2('0xc'));var squel=require(_0xcec2('0xd'));var crypto=require(_0xcec2('0xe'));var jsforce=require(_0xcec2('0xf'));var deskjs=require(_0xcec2('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcec2('0x11'));var Papa=require(_0xcec2('0x12'));var Redis=require(_0xcec2('0x13'));var authService=require(_0xcec2('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcec2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcec2('0x16'));var config=require(_0xcec2('0x17'));var licenseUtil=require(_0xcec2('0x18'));var db=require(_0xcec2('0x19'))['db'];function respondWithStatusCode(_0x33da0e,_0x47add5){_0x47add5=_0x47add5||0xcc;return function(_0x134fa6){if(_0x134fa6){return _0x33da0e[_0xcec2('0x1a')](_0x47add5);}return _0x33da0e[_0xcec2('0x1b')](_0x47add5)[_0xcec2('0x1c')]();};}function respondWithResult(_0x453822,_0x12b66f){_0x12b66f=_0x12b66f||0xc8;return function(_0x383e90){if(_0x383e90){return _0x453822[_0xcec2('0x1b')](_0x12b66f)['json'](_0x383e90);}};}function respondWithFilteredResult(_0x25f578,_0x290ad4){return function(_0x282169){if(_0x282169){var _0x4875ca=typeof _0x290ad4[_0xcec2('0x1d')]==='undefined'&&typeof _0x290ad4[_0xcec2('0x1e')]==='undefined';var _0x43daf0=_0x282169['count'];var _0x10c34e=_0x4875ca?0x0:_0x290ad4[_0xcec2('0x1d')];var _0x6218cd=_0x4875ca?_0x282169[_0xcec2('0x1f')]:_0x290ad4[_0xcec2('0x1d')]+_0x290ad4[_0xcec2('0x1e')];var _0x2367bd;if(_0x6218cd>=_0x43daf0){_0x6218cd=_0x43daf0;_0x2367bd=0xc8;}else{_0x2367bd=0xce;}_0x25f578[_0xcec2('0x1b')](_0x2367bd);return _0x25f578[_0xcec2('0x20')](_0xcec2('0x21'),_0x10c34e+'-'+_0x6218cd+'/'+_0x43daf0)[_0xcec2('0x22')](_0x282169);}return null;};}function patchUpdates(_0x9421f){return function(_0x4bb080){try{jsonpatch[_0xcec2('0x23')](_0x4bb080,_0x9421f,!![]);}catch(_0x2252c4){return BPromise[_0xcec2('0x24')](_0x2252c4);}return _0x4bb080['save']();};}function saveUpdates(_0x57acfc,_0x434d43){return function(_0x2050c9){if(_0x2050c9){return _0x2050c9[_0xcec2('0x25')](_0x57acfc)[_0xcec2('0x26')](function(_0xcf14dc){return _0xcf14dc;});}return null;};}function removeEntity(_0x49cc7d,_0x23c221){return function(_0x33136c){if(_0x33136c){return _0x33136c[_0xcec2('0x27')]()[_0xcec2('0x26')](function(){_0x49cc7d[_0xcec2('0x1b')](0xcc)[_0xcec2('0x1c')]();});}};}function handleEntityNotFound(_0x15e79f,_0x2f0fc7){return function(_0xe933dd){if(!_0xe933dd){_0x15e79f[_0xcec2('0x1a')](0x194);}return _0xe933dd;};}function handleError(_0x404b04,_0x2c7a5d){_0x2c7a5d=_0x2c7a5d||0x1f4;return function(_0x37845c){logger['error'](_0x37845c[_0xcec2('0x28')]);if(_0x37845c['name']){delete _0x37845c[_0xcec2('0x29')];}_0x404b04[_0xcec2('0x1b')](_0x2c7a5d)[_0xcec2('0x2a')](_0x37845c);};}exports[_0xcec2('0x2b')]=function(_0x4bf80f,_0x276b83){var _0x167f1c={},_0x454bcd={},_0x244f59={'count':0x0,'rows':[]};var _0x2b1f50=_[_0xcec2('0x2c')](db[_0xcec2('0x2d')][_0xcec2('0x2e')],function(_0x38ff7b){return{'name':_0x38ff7b[_0xcec2('0x2f')],'type':_0x38ff7b[_0xcec2('0x30')]['key']};});_0x454bcd[_0xcec2('0x31')]=_[_0xcec2('0x2c')](_0x2b1f50,_0xcec2('0x29'));_0x454bcd['query']=_[_0xcec2('0x32')](_0x4bf80f[_0xcec2('0x33')]);_0x454bcd[_0xcec2('0x34')]=_[_0xcec2('0x35')](_0x454bcd[_0xcec2('0x31')],_0x454bcd['query']);_0x167f1c['attributes']=_[_0xcec2('0x35')](_0x454bcd[_0xcec2('0x31')],qs[_0xcec2('0x36')](_0x4bf80f[_0xcec2('0x33')][_0xcec2('0x36')]));_0x167f1c['attributes']=_0x167f1c[_0xcec2('0x37')][_0xcec2('0x38')]?_0x167f1c[_0xcec2('0x37')]:_0x454bcd[_0xcec2('0x31')];if(!_0x4bf80f[_0xcec2('0x33')]['hasOwnProperty'](_0xcec2('0x39'))){_0x167f1c['limit']=qs['limit'](_0x4bf80f[_0xcec2('0x33')]['limit']);_0x167f1c[_0xcec2('0x1d')]=qs[_0xcec2('0x1d')](_0x4bf80f[_0xcec2('0x33')][_0xcec2('0x1d')]);}_0x167f1c['order']=qs[_0xcec2('0x3a')](_0x4bf80f['query'][_0xcec2('0x3a')]);_0x167f1c['where']=qs[_0xcec2('0x34')](_['pick'](_0x4bf80f['query'],_0x454bcd[_0xcec2('0x34')]),_0x2b1f50);if(_0x4bf80f['query']['filter']){_0x167f1c[_0xcec2('0x3b')]=_[_0xcec2('0x3c')](_0x167f1c[_0xcec2('0x3b')],{'$or':_[_0xcec2('0x2c')](_0x2b1f50,function(_0xa112d2){if(_0xa112d2['type']!==_0xcec2('0x3d')){var _0x3608d3={};_0x3608d3[_0xa112d2['name']]={'$like':'%'+_0x4bf80f['query'][_0xcec2('0x3e')]+'%'};return _0x3608d3;}})});}_0x167f1c=_['merge']({},_0x167f1c,_0x4bf80f['options']);var _0x281c03={'where':_0x167f1c['where']};return db[_0xcec2('0x2d')][_0xcec2('0x1f')](_0x281c03)[_0xcec2('0x26')](function(_0x7f2480){_0x244f59[_0xcec2('0x1f')]=_0x7f2480;if(_0x4bf80f[_0xcec2('0x33')][_0xcec2('0x3f')]){_0x167f1c[_0xcec2('0x40')]=[{'all':!![]}];}return db[_0xcec2('0x2d')]['findAll'](_0x167f1c);})[_0xcec2('0x26')](function(_0x379729){_0x244f59[_0xcec2('0x41')]=_0x379729;return _0x244f59;})[_0xcec2('0x26')](respondWithFilteredResult(_0x276b83,_0x167f1c))['catch'](handleError(_0x276b83,null));};exports[_0xcec2('0x42')]=function(_0x2fe87c,_0x291b2f){var _0x1adb7a={'raw':![],'where':{'id':_0x2fe87c['params']['id']}},_0x552c22={};_0x552c22[_0xcec2('0x31')]=_[_0xcec2('0x32')](db['Automation'][_0xcec2('0x2e')]);_0x552c22[_0xcec2('0x33')]=_[_0xcec2('0x32')](_0x2fe87c['query']);_0x552c22[_0xcec2('0x34')]=_[_0xcec2('0x35')](_0x552c22[_0xcec2('0x31')],_0x552c22['query']);_0x1adb7a[_0xcec2('0x37')]=_[_0xcec2('0x35')](_0x552c22[_0xcec2('0x31')],qs[_0xcec2('0x36')](_0x2fe87c[_0xcec2('0x33')]['fields']));_0x1adb7a[_0xcec2('0x37')]=_0x1adb7a['attributes'][_0xcec2('0x38')]?_0x1adb7a['attributes']:_0x552c22[_0xcec2('0x31')];if(_0x2fe87c[_0xcec2('0x33')][_0xcec2('0x3f')]){_0x1adb7a[_0xcec2('0x40')]=[{'all':!![]}];}_0x1adb7a=_[_0xcec2('0x3c')]({},_0x1adb7a,_0x2fe87c[_0xcec2('0x43')]);return db['Automation'][_0xcec2('0x44')](_0x1adb7a)['then'](handleEntityNotFound(_0x291b2f,null))[_0xcec2('0x26')](respondWithResult(_0x291b2f,null))[_0xcec2('0x45')](handleError(_0x291b2f,null));};exports[_0xcec2('0x46')]=function(_0x1d6f57,_0x5770f6){return db['Automation'][_0xcec2('0x46')](_0x1d6f57[_0xcec2('0x47')],{})[_0xcec2('0x26')](respondWithResult(_0x5770f6,0xc9))[_0xcec2('0x45')](handleError(_0x5770f6,null));};exports[_0xcec2('0x25')]=function(_0x59ca0a,_0x4c97d6){if(_0x59ca0a[_0xcec2('0x47')]['id']){delete _0x59ca0a[_0xcec2('0x47')]['id'];}return db['Automation']['find']({'where':{'id':_0x59ca0a[_0xcec2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c97d6,null))['then'](saveUpdates(_0x59ca0a['body'],null))['then'](respondWithResult(_0x4c97d6,null))['catch'](handleError(_0x4c97d6,null));};exports[_0xcec2('0x27')]=function(_0x344ff4,_0x325c7f){return db[_0xcec2('0x2d')][_0xcec2('0x44')]({'where':{'id':_0x344ff4[_0xcec2('0x48')]['id']}})[_0xcec2('0x26')](handleEntityNotFound(_0x325c7f,null))[_0xcec2('0x26')](removeEntity(_0x325c7f,null))['catch'](handleError(_0x325c7f,null));};exports['addConditions']=function(_0x3686a0,_0x247ac7,_0x20fba8){return db[_0xcec2('0x49')][_0xcec2('0x44')]({'where':{'id':_0x3686a0[_0xcec2('0x48')]['id']}})['then'](handleEntityNotFound(_0x247ac7,null))[_0xcec2('0x26')](function(_0x2d4a92){if(_0x2d4a92){return _0x2d4a92[_0xcec2('0x4a')](_0x3686a0[_0xcec2('0x47')][_0xcec2('0x4b')],_[_0xcec2('0x4c')](_0x3686a0[_0xcec2('0x47')],[_0xcec2('0x4b'),'id'])||{});}})[_0xcec2('0x26')](respondWithResult(_0x247ac7,null))[_0xcec2('0x45')](handleError(_0x247ac7,null));};exports[_0xcec2('0x4d')]=function(_0xd1507d,_0x9dd1e8,_0x3b8a27){var _0x4d6f64={};var _0x849c6f={};var _0x3aa694;var _0x5bc9a3;return db[_0xcec2('0x2d')][_0xcec2('0x4e')]({'where':{'id':_0xd1507d['params']['id']}})[_0xcec2('0x26')](handleEntityNotFound(_0x9dd1e8,null))[_0xcec2('0x26')](function(_0x11e555){if(_0x11e555){_0x3aa694=_0x11e555;_0x849c6f[_0xcec2('0x31')]=_[_0xcec2('0x32')](db[_0xcec2('0x49')][_0xcec2('0x2e')]);_0x849c6f[_0xcec2('0x33')]=_[_0xcec2('0x32')](_0xd1507d[_0xcec2('0x33')]);_0x849c6f[_0xcec2('0x34')]=_[_0xcec2('0x35')](_0x849c6f[_0xcec2('0x31')],_0x849c6f[_0xcec2('0x33')]);_0x4d6f64[_0xcec2('0x37')]=_['intersection'](_0x849c6f[_0xcec2('0x31')],qs[_0xcec2('0x36')](_0xd1507d[_0xcec2('0x33')][_0xcec2('0x36')]));_0x4d6f64['attributes']=_0x4d6f64[_0xcec2('0x37')][_0xcec2('0x38')]?_0x4d6f64[_0xcec2('0x37')]:_0x849c6f['model'];_0x4d6f64[_0xcec2('0x4f')]=qs[_0xcec2('0x3a')](_0xd1507d[_0xcec2('0x33')][_0xcec2('0x3a')]);_0x4d6f64[_0xcec2('0x3b')]=qs['filters'](_[_0xcec2('0x50')](_0xd1507d[_0xcec2('0x33')],_0x849c6f[_0xcec2('0x34')]));if(_0xd1507d[_0xcec2('0x33')]['filter']){_0x4d6f64['where']=_['merge'](_0x4d6f64[_0xcec2('0x3b')],{'$or':_['map'](_0x4d6f64[_0xcec2('0x37')],function(_0x2282a7){var _0x4bd7d7={};_0x4bd7d7[_0x2282a7]={'$like':'%'+_0xd1507d[_0xcec2('0x33')]['filter']+'%'};return _0x4bd7d7;})});}_0x4d6f64=_['merge']({},_0x4d6f64,_0xd1507d[_0xcec2('0x43')]);return _0x3aa694[_0xcec2('0x4d')](_0x4d6f64);}})[_0xcec2('0x26')](function(_0x2a43c2){if(_0x2a43c2){_0x5bc9a3=_0x2a43c2[_0xcec2('0x38')];if(!_0xd1507d[_0xcec2('0x33')][_0xcec2('0x51')](_0xcec2('0x39'))){_0x4d6f64[_0xcec2('0x1e')]=qs['limit'](_0xd1507d[_0xcec2('0x33')][_0xcec2('0x1e')]);_0x4d6f64[_0xcec2('0x1d')]=qs[_0xcec2('0x1d')](_0xd1507d['query'][_0xcec2('0x1d')]);}return _0x3aa694[_0xcec2('0x4d')](_0x4d6f64);}})[_0xcec2('0x26')](function(_0x731efa){if(_0x731efa){return _0x731efa?{'count':_0x5bc9a3,'rows':_0x731efa}:null;}})['then'](respondWithResult(_0x9dd1e8,null))[_0xcec2('0x45')](handleError(_0x9dd1e8,null));};exports[_0xcec2('0x52')]=function(_0x1a2505,_0x41a239,_0x1561a8){return db[_0xcec2('0x53')][_0xcec2('0x44')]({'where':{'id':_0x1a2505[_0xcec2('0x48')]['id']}})[_0xcec2('0x26')](handleEntityNotFound(_0x41a239,null))[_0xcec2('0x26')](function(_0x234763){if(_0x234763){return _0x234763[_0xcec2('0x52')](_0x1a2505[_0xcec2('0x47')][_0xcec2('0x4b')],_[_0xcec2('0x4c')](_0x1a2505[_0xcec2('0x47')],[_0xcec2('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x41a239,null))[_0xcec2('0x45')](handleError(_0x41a239,null));};exports[_0xcec2('0x54')]=function(_0x15265e,_0x4351f5,_0x5b3eda){var _0x1b9508={};var _0x28ff52={};var _0xa209b2;var _0xdb4283;return db[_0xcec2('0x2d')][_0xcec2('0x4e')]({'where':{'id':_0x15265e[_0xcec2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4351f5,null))['then'](function(_0x420203){if(_0x420203){_0xa209b2=_0x420203;_0x28ff52[_0xcec2('0x31')]=_['keys'](db[_0xcec2('0x53')]['rawAttributes']);_0x28ff52['query']=_[_0xcec2('0x32')](_0x15265e[_0xcec2('0x33')]);_0x28ff52['filters']=_[_0xcec2('0x35')](_0x28ff52[_0xcec2('0x31')],_0x28ff52[_0xcec2('0x33')]);_0x1b9508['attributes']=_['intersection'](_0x28ff52['model'],qs[_0xcec2('0x36')](_0x15265e[_0xcec2('0x33')]['fields']));_0x1b9508[_0xcec2('0x37')]=_0x1b9508[_0xcec2('0x37')]['length']?_0x1b9508[_0xcec2('0x37')]:_0x28ff52['model'];_0x1b9508['order']=qs[_0xcec2('0x3a')](_0x15265e[_0xcec2('0x33')][_0xcec2('0x3a')]);_0x1b9508['where']=qs['filters'](_[_0xcec2('0x50')](_0x15265e[_0xcec2('0x33')],_0x28ff52[_0xcec2('0x34')]));if(_0x15265e[_0xcec2('0x33')]['filter']){_0x1b9508['where']=_[_0xcec2('0x3c')](_0x1b9508[_0xcec2('0x3b')],{'$or':_['map'](_0x1b9508[_0xcec2('0x37')],function(_0x22f49e){var _0x39be58={};_0x39be58[_0x22f49e]={'$like':'%'+_0x15265e[_0xcec2('0x33')][_0xcec2('0x3e')]+'%'};return _0x39be58;})});}_0x1b9508=_[_0xcec2('0x3c')]({},_0x1b9508,_0x15265e[_0xcec2('0x43')]);return _0xa209b2[_0xcec2('0x54')](_0x1b9508);}})[_0xcec2('0x26')](function(_0x3bcab3){if(_0x3bcab3){_0xdb4283=_0x3bcab3['length'];if(!_0x15265e[_0xcec2('0x33')]['hasOwnProperty'](_0xcec2('0x39'))){_0x1b9508['limit']=qs[_0xcec2('0x1e')](_0x15265e['query'][_0xcec2('0x1e')]);_0x1b9508['offset']=qs[_0xcec2('0x1d')](_0x15265e[_0xcec2('0x33')][_0xcec2('0x1d')]);}return _0xa209b2[_0xcec2('0x54')](_0x1b9508);}})[_0xcec2('0x26')](function(_0x3045ca){if(_0x3045ca){return _0x3045ca?{'count':_0xdb4283,'rows':_0x3045ca}:null;}})[_0xcec2('0x26')](respondWithResult(_0x4351f5,null))[_0xcec2('0x45')](handleError(_0x4351f5,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index ceb36c9..b90b22f 100644
--- a/server/api/automation/automation.model.js
+++ b/server/api/automation/automation.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x000e=['bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation','../../config/logger','api'];(function(_0x16c6d6,_0x237525){var _0x1cf47c=function(_0x7444a6){while(--_0x7444a6){_0x16c6d6['push'](_0x16c6d6['shift']());}};_0x1cf47c(++_0x237525);}(_0x000e,0xee));var _0xe000=function(_0x2d3872,_0x30ccb9){_0x2d3872=_0x2d3872-0x0;var _0x274a11=_0x000e[_0x2d3872];return _0x274a11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe000('0x0'))(_0xe000('0x1'));var moment=require('moment');var BPromise=require(_0xe000('0x2'));var rp=require(_0xe000('0x3'));var fs=require('fs');var path=require(_0xe000('0x4'));var rimraf=require(_0xe000('0x5'));var config=require(_0xe000('0x6'));var attributes=require(_0xe000('0x7'));module['exports']=function(_0x59f993,_0xb4e960){return _0x59f993[_0xe000('0x8')](_0xe000('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7417=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash'];(function(_0x25ded3,_0x21f38f){var _0x20efad=function(_0x5c9ed0){while(--_0x5c9ed0){_0x25ded3['push'](_0x25ded3['shift']());}};_0x20efad(++_0x21f38f);}(_0x7417,0xb5));var _0x7741=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7417[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x7741('0x0'));var util=require('util');var logger=require(_0x7741('0x1'))(_0x7741('0x2'));var moment=require(_0x7741('0x3'));var BPromise=require(_0x7741('0x4'));var rp=require(_0x7741('0x5'));var fs=require('fs');var path=require(_0x7741('0x6'));var rimraf=require(_0x7741('0x7'));var config=require(_0x7741('0x8'));var attributes=require(_0x7741('0x9'));module['exports']=function(_0x6905f7,_0x5be39e){return _0x6905f7[_0x7741('0xa')](_0x7741('0xb'),attributes,{'tableName':_0x7741('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 6cccdd7..5f2f375 100644
--- a/server/api/automation/automation.rpc.js
+++ b/server/api/automation/automation.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfbbb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x113d60,_0x333f34){var _0xc7d380=function(_0x50ae36){while(--_0x50ae36){_0x113d60['push'](_0x113d60['shift']());}};_0xc7d380(++_0x333f34);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x597eb6,_0x4fbdea){_0x597eb6=_0x597eb6-0x0;var _0x58c0fb=_0xfbbb[_0x597eb6];return _0x58c0fb;};'use strict';var _=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var moment=require(_0xbfbb('0x2'));var BPromise=require(_0xbfbb('0x3'));var rs=require(_0xbfbb('0x4'));var fs=require('fs');var Redis=require(_0xbfbb('0x5'));var db=require(_0xbfbb('0x6'))['db'];var utils=require(_0xbfbb('0x7'));var logger=require(_0xbfbb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbfbb('0x9'));var client=jayson['client'][_0xbfbb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c6cc,_0x16a41c,_0x5a69b3){return new BPromise(function(_0x1f2c31,_0x3260a7){return client[_0xbfbb('0xb')](_0x16c6cc,_0x5a69b3)[_0xbfbb('0xc')](function(_0x1baefa){logger[_0xbfbb('0xd')]('Automation,\x20%s,\x20%s',_0x16a41c,_0xbfbb('0xe'));logger[_0xbfbb('0xf')](_0xbfbb('0x10'),_0x16a41c,_0xbfbb('0xe'),JSON['stringify'](_0x1baefa));if(_0x1baefa[_0xbfbb('0x11')]){if(_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x12')]===0x1f4){logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x3260a7(_0x1baefa[_0xbfbb('0x11')]['message']);}logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x1f2c31(_0x1baefa[_0xbfbb('0x11')]['message']);}else{logger[_0xbfbb('0xd')](_0xbfbb('0x13'),_0x16a41c,_0xbfbb('0xe'));_0x1f2c31(_0x1baefa[_0xbfbb('0x15')][_0xbfbb('0x14')]);}})[_0xbfbb('0x16')](function(_0x2f49e5){logger['error']('Automation,\x20%s,\x20%s',_0x16a41c,_0x2f49e5);_0x3260a7(_0x2f49e5);});});}
\ No newline at end of file
+var _0xe797=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xe797,0x12a));var _0x7e79=function(_0x2c96a5,_0x2fbbb0){_0x2c96a5=_0x2c96a5-0x0;var _0x410169=_0xe797[_0x2c96a5];return _0x410169;};'use strict';var _=require(_0x7e79('0x0'));var util=require(_0x7e79('0x1'));var moment=require(_0x7e79('0x2'));var BPromise=require(_0x7e79('0x3'));var rs=require(_0x7e79('0x4'));var fs=require('fs');var Redis=require(_0x7e79('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e79('0x6'));var logger=require(_0x7e79('0x7'))('rpc');var config=require(_0x7e79('0x8'));var jayson=require(_0x7e79('0x9'));var client=jayson[_0x7e79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fdfa1,_0x9dd35a,_0x358bd6){return new BPromise(function(_0x484e66,_0x54aab5){return client[_0x7e79('0xb')](_0x4fdfa1,_0x358bd6)[_0x7e79('0xc')](function(_0x134e89){logger['info'](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));logger[_0x7e79('0xf')](_0x7e79('0x10'),_0x9dd35a,_0x7e79('0xe'),JSON[_0x7e79('0x11')](_0x134e89));if(_0x134e89[_0x7e79('0x12')]){if(_0x134e89[_0x7e79('0x12')][_0x7e79('0x13')]===0x1f4){logger['error'](_0x7e79('0xd'),_0x9dd35a,_0x134e89['error'][_0x7e79('0x14')]);return _0x54aab5(_0x134e89['error'][_0x7e79('0x14')]);}logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x134e89[_0x7e79('0x12')]['message']);return _0x484e66(_0x134e89[_0x7e79('0x12')][_0x7e79('0x14')]);}else{logger[_0x7e79('0x15')](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));_0x484e66(_0x134e89[_0x7e79('0x16')][_0x7e79('0x14')]);}})['catch'](function(_0x2ec0c7){logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x2ec0c7);_0x54aab5(_0x2ec0c7);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index a9cbf71..06a9c6c 100644
--- a/server/api/automation/index.js
+++ b/server/api/automation/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c2b=['/:id/actions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','index','get','/:id','isAuthenticated','show','/:id/conditions'];(function(_0xdaa456,_0x3dbbe5){var _0x288a4a=function(_0x4e4d5d){while(--_0x4e4d5d){_0xdaa456['push'](_0xdaa456['shift']());}};_0x288a4a(++_0x3dbbe5);}(_0x0c2b,0x134));var _0xb0c2=function(_0x22b7b5,_0x71b79){_0x22b7b5=_0x22b7b5-0x0;var _0x219a6d=_0x0c2b[_0x22b7b5];return _0x219a6d;};'use strict';var multer=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0c2('0x2'));var router=express['Router']();var fs_extra=require(_0xb0c2('0x3'));var auth=require(_0xb0c2('0x4'));var interaction=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var controller=require(_0xb0c2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb0c2('0x8')]);router[_0xb0c2('0x9')](_0xb0c2('0xa'),auth[_0xb0c2('0xb')](),controller[_0xb0c2('0xc')]);router[_0xb0c2('0x9')](_0xb0c2('0xd'),auth[_0xb0c2('0xb')](),controller['getConditions']);router[_0xb0c2('0x9')](_0xb0c2('0xe'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0xb0c2('0xb')](),controller['create']);router[_0xb0c2('0xf')](_0xb0c2('0xd'),auth['isAuthenticated'](),controller[_0xb0c2('0x10')]);router[_0xb0c2('0xf')](_0xb0c2('0xe'),auth[_0xb0c2('0xb')](),controller[_0xb0c2('0x11')]);router[_0xb0c2('0x12')](_0xb0c2('0xa'),auth[_0xb0c2('0xb')](),controller[_0xb0c2('0x13')]);router[_0xb0c2('0x14')](_0xb0c2('0xa'),auth['isAuthenticated'](),controller[_0xb0c2('0x15')]);module[_0xb0c2('0x16')]=router;
\ No newline at end of file
+var _0xc678=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/conditions','getActions','post','create','/:id','update','destroy','exports','path'];(function(_0x2d39e1,_0xcdb7d0){var _0x4bcfc6=function(_0x46a1bf){while(--_0x46a1bf){_0x2d39e1['push'](_0x2d39e1['shift']());}};_0x4bcfc6(++_0xcdb7d0);}(_0xc678,0x1b4));var _0x8c67=function(_0x4be6d5,_0x299b85){_0x4be6d5=_0x4be6d5-0x0;var _0x56485d=_0xc678[_0x4be6d5];return _0x56485d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8c67('0x0'));var timeout=require(_0x8c67('0x1'));var express=require(_0x8c67('0x2'));var router=express['Router']();var fs_extra=require(_0x8c67('0x3'));var auth=require(_0x8c67('0x4'));var interaction=require(_0x8c67('0x5'));var config=require(_0x8c67('0x6'));var controller=require('./automation.controller');router[_0x8c67('0x7')]('/',auth['isAuthenticated'](),controller[_0x8c67('0x8')]);router[_0x8c67('0x7')]('/:id',auth[_0x8c67('0x9')](),controller[_0x8c67('0xa')]);router[_0x8c67('0x7')](_0x8c67('0xb'),auth[_0x8c67('0x9')](),controller['getConditions']);router[_0x8c67('0x7')]('/:id/actions',auth[_0x8c67('0x9')](),controller[_0x8c67('0xc')]);router[_0x8c67('0xd')]('/',auth['isAuthenticated'](),controller[_0x8c67('0xe')]);router[_0x8c67('0xd')](_0x8c67('0xb'),auth[_0x8c67('0x9')](),controller['addConditions']);router[_0x8c67('0xd')]('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router['put'](_0x8c67('0xf'),auth['isAuthenticated'](),controller[_0x8c67('0x10')]);router['delete'](_0x8c67('0xf'),auth[_0x8c67('0x9')](),controller[_0x8c67('0x11')]);module[_0x8c67('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 38d320e..49c8ea7 100644
--- a/server/api/campaign/campaign.attributes.js
+++ b/server/api/campaign/campaign.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd3b=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcd3b,0x8b));var _0xbcd3=function(_0x16ded5,_0x56d67c){_0x16ded5=_0x16ded5-0x0;var _0x371b52=_0xcd3b[_0x16ded5];return _0x371b52;};'use strict';var Sequelize=require(_0xbcd3('0x0'));module[_0xbcd3('0x1')]={'name':{'type':Sequelize[_0xbcd3('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbcd3('0x3')](_0xbcd3('0x4')),'allowNull':![],'defaultValue':_0xbcd3('0x4')},'description':{'type':Sequelize[_0xbcd3('0x2')]},'active':{'type':Sequelize[_0xbcd3('0x5')],'defaultValue':0x0,'comment':_0xbcd3('0x6')},'limitCalls':{'type':Sequelize[_0xbcd3('0x7')](0x4)[_0xbcd3('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbcd3('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbcd3('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xbcd3('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'comment':_0xbcd3('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbcd3('0x10')},'dialTimezone':{'type':Sequelize[_0xbcd3('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xbcd3('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xbcd3('0x3')](_0xbcd3('0x12'),'never',_0xbcd3('0x13')),'defaultValue':_0xbcd3('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbcd3('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbcd3('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbcd3('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbcd3('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbcd3('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xbcd3('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbcd3('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbcd3('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbcd3('0x7')](0x9)[_0xbcd3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbcd3('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbcd3('0x3')](_0xbcd3('0x1d'),'ASC'),'defaultValue':_0xbcd3('0x1d')},'dialPrefix':{'type':Sequelize[_0xbcd3('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbcd3('0x1e')},'dialCutDigit':{'type':Sequelize[_0xbcd3('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbcd3('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbcd3('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)[_0xbcd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbcd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbcd3('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbcd3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbcd3('0x27')}};
\ No newline at end of file
+var _0x8997=['#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen'];(function(_0x22f9a3,_0x57a0ae){var _0x4a602d=function(_0x61a010){while(--_0x61a010){_0x22f9a3['push'](_0x22f9a3['shift']());}};_0x4a602d(++_0x57a0ae);}(_0x8997,0x18e));var _0x7899=function(_0x28fec5,_0xad468b){_0x28fec5=_0x28fec5-0x0;var _0xfa47dc=_0x8997[_0x28fec5];return _0xfa47dc;};'use strict';var Sequelize=require(_0x7899('0x0'));module[_0x7899('0x1')]={'name':{'type':Sequelize[_0x7899('0x2')],'unique':_0x7899('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7899('0x4')](_0x7899('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x7899('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7899('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x7899('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7899('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7899('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7899('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7899('0x7')],'defaultValue':0x3,'comment':_0x7899('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7899('0xf')},'dialTimezone':{'type':Sequelize[_0x7899('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7899('0x2')],'defaultValue':_0x7899('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x7899('0x4')](_0x7899('0x11'),_0x7899('0x12'),_0x7899('0x13')),'defaultValue':_0x7899('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x7899('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7899('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7899('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7899('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7899('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7899('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7899('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7899('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7899('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7899('0x9')](0x9)[_0x7899('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7899('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7899('0x4')](_0x7899('0x1c'),_0x7899('0x1d')),'defaultValue':_0x7899('0x1c')},'dialPrefix':{'type':Sequelize[_0x7899('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7899('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7899('0x1e')},'dialCutDigit':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7899('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7899('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7899('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7899('0x9')](0x3)[_0x7899('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7899('0x9')](0x5)[_0x7899('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 41af827..73cc0e8 100644
--- a/server/api/campaign/campaign.controller.js
+++ b/server/api/campaign/campaign.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1177=['fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','deletedAt\x20IS\x20NULL','NOW()','insert','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','end','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','role','userProfileId','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','into','cm_hopper'];(function(_0x55334a,_0x140452){var _0x2945bd=function(_0x2e3617){while(--_0x2e3617){_0x55334a['push'](_0x55334a['shift']());}};_0x2945bd(++_0x140452);}(_0x1177,0x143));var _0x7117=function(_0x26fc6a,_0x1e7f49){_0x26fc6a=_0x26fc6a-0x0;var _0x5bf15c=_0x1177[_0x26fc6a];return _0x5bf15c;};'use strict';var emlformat=require(_0x7117('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7117('0x1'));var jsonpatch=require(_0x7117('0x2'));var rp=require(_0x7117('0x3'));var moment=require('moment');var BPromise=require(_0x7117('0x4'));var Mustache=require(_0x7117('0x5'));var util=require(_0x7117('0x6'));var path=require(_0x7117('0x7'));var sox=require(_0x7117('0x8'));var csv=require(_0x7117('0x9'));var ejs=require(_0x7117('0xa'));var fs=require('fs');var fs_extra=require(_0x7117('0xb'));var _=require(_0x7117('0xc'));var squel=require('squel');var crypto=require(_0x7117('0xd'));var jsforce=require(_0x7117('0xe'));var deskjs=require(_0x7117('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7117('0x10'));var Papa=require(_0x7117('0x11'));var Redis=require(_0x7117('0x12'));var authService=require(_0x7117('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7117('0x14'));var hardwareService=require(_0x7117('0x15'));var logger=require('../../config/logger')(_0x7117('0x16'));var utils=require(_0x7117('0x17'));var config=require(_0x7117('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x165b1a,_0x288cc9){_0x288cc9=_0x288cc9||0xcc;return function(_0x532d3f){if(_0x532d3f){return _0x165b1a[_0x7117('0x19')](_0x288cc9);}return _0x165b1a['status'](_0x288cc9)['end']();};}function respondWithResult(_0x4bf645,_0x244406){_0x244406=_0x244406||0xc8;return function(_0x30342e){if(_0x30342e){return _0x4bf645[_0x7117('0x1a')](_0x244406)[_0x7117('0x1b')](_0x30342e);}};}function respondWithFilteredResult(_0x530040,_0x145e70){return function(_0x5f1be9){if(_0x5f1be9){var _0xe683af=typeof _0x145e70[_0x7117('0x1c')]===_0x7117('0x1d')&&typeof _0x145e70[_0x7117('0x1e')]==='undefined';var _0x227066=_0x5f1be9[_0x7117('0x1f')];var _0x4f32a9=_0xe683af?0x0:_0x145e70['offset'];var _0x3e3163=_0xe683af?_0x5f1be9[_0x7117('0x1f')]:_0x145e70['offset']+_0x145e70[_0x7117('0x1e')];var _0x308e39;if(_0x3e3163>=_0x227066){_0x3e3163=_0x227066;_0x308e39=0xc8;}else{_0x308e39=0xce;}_0x530040[_0x7117('0x1a')](_0x308e39);return _0x530040[_0x7117('0x20')](_0x7117('0x21'),_0x4f32a9+'-'+_0x3e3163+'/'+_0x227066)[_0x7117('0x1b')](_0x5f1be9);}return null;};}function patchUpdates(_0x56b843){return function(_0x10f278){try{jsonpatch['apply'](_0x10f278,_0x56b843,!![]);}catch(_0x458a49){return BPromise[_0x7117('0x22')](_0x458a49);}return _0x10f278[_0x7117('0x23')]();};}function saveUpdates(_0x3098aa,_0x4e9561){return function(_0x45f1e3){if(_0x45f1e3){return _0x45f1e3[_0x7117('0x24')](_0x3098aa)[_0x7117('0x25')](function(_0x296062){return _0x296062;});}return null;};}function removeEntity(_0x52b830,_0x13ed85){return function(_0x15503d){if(_0x15503d){return _0x15503d[_0x7117('0x26')]()[_0x7117('0x25')](function(){var _0x553add=_0x15503d[_0x7117('0x27')]({'plain':!![]});var _0x5e4033=_0x7117('0x28');return db['UserProfileResource'][_0x7117('0x26')]({'where':{'type':_0x5e4033,'resourceId':_0x553add['id']}})[_0x7117('0x25')](function(){return _0x15503d;});})[_0x7117('0x25')](function(){_0x52b830[_0x7117('0x1a')](0xcc)[_0x7117('0x29')]();});}};}function handleEntityNotFound(_0x581570,_0xb28511){return function(_0xdd1b4f){if(!_0xdd1b4f){_0x581570[_0x7117('0x19')](0x194);}return _0xdd1b4f;};}function handleError(_0xc5fb6f,_0x23f3e7){_0x23f3e7=_0x23f3e7||0x1f4;return function(_0x1eb600){logger[_0x7117('0x2a')](_0x1eb600[_0x7117('0x2b')]);if(_0x1eb600[_0x7117('0x2c')]){delete _0x1eb600['name'];}_0xc5fb6f['status'](_0x23f3e7)[_0x7117('0x2d')](_0x1eb600);};}exports[_0x7117('0x2e')]=function(_0x302f6d,_0xa04523){var _0x425a25={},_0x1c1ed1={},_0x412b1d={'count':0x0,'rows':[]};var _0x54c566=_[_0x7117('0x2f')](db[_0x7117('0x30')][_0x7117('0x31')],function(_0x33d762){return{'name':_0x33d762[_0x7117('0x32')],'type':_0x33d762[_0x7117('0x33')][_0x7117('0x34')]};});_0x1c1ed1[_0x7117('0x35')]=_[_0x7117('0x2f')](_0x54c566,_0x7117('0x2c'));_0x1c1ed1[_0x7117('0x36')]=_['keys'](_0x302f6d['query']);_0x1c1ed1[_0x7117('0x37')]=_[_0x7117('0x38')](_0x1c1ed1[_0x7117('0x35')],_0x1c1ed1[_0x7117('0x36')]);_0x425a25[_0x7117('0x39')]=_[_0x7117('0x38')](_0x1c1ed1[_0x7117('0x35')],qs['fields'](_0x302f6d['query'][_0x7117('0x3a')]));_0x425a25[_0x7117('0x39')]=_0x425a25[_0x7117('0x39')][_0x7117('0x3b')]?_0x425a25[_0x7117('0x39')]:_0x1c1ed1[_0x7117('0x35')];if(!_0x302f6d[_0x7117('0x36')]['hasOwnProperty'](_0x7117('0x3c'))){_0x425a25[_0x7117('0x1e')]=qs['limit'](_0x302f6d[_0x7117('0x36')][_0x7117('0x1e')]);_0x425a25['offset']=qs[_0x7117('0x1c')](_0x302f6d[_0x7117('0x36')]['offset']);}_0x425a25[_0x7117('0x3d')]=qs[_0x7117('0x3e')](_0x302f6d['query'][_0x7117('0x3e')]);_0x425a25[_0x7117('0x3f')]=qs['filters'](_[_0x7117('0x40')](_0x302f6d[_0x7117('0x36')],_0x1c1ed1[_0x7117('0x37')]),_0x54c566);if(_0x302f6d[_0x7117('0x36')][_0x7117('0x41')]){_0x425a25[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x425a25[_0x7117('0x3f')],{'$or':_[_0x7117('0x2f')](_0x54c566,function(_0x37777a){if(_0x37777a[_0x7117('0x33')]!=='VIRTUAL'){var _0x21742a={};_0x21742a[_0x37777a[_0x7117('0x2c')]]={'$like':'%'+_0x302f6d[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x21742a;}})});}_0x425a25=_[_0x7117('0x42')]({},_0x425a25,_0x302f6d[_0x7117('0x43')]);var _0xca9ae={'where':_0x425a25[_0x7117('0x3f')]};return db[_0x7117('0x30')]['count'](_0xca9ae)[_0x7117('0x25')](function(_0x4bc8a4){_0x412b1d[_0x7117('0x1f')]=_0x4bc8a4;if(_0x302f6d[_0x7117('0x36')][_0x7117('0x44')]){_0x425a25[_0x7117('0x45')]=[{'all':!![]}];}return db[_0x7117('0x30')][_0x7117('0x46')](_0x425a25);})[_0x7117('0x25')](function(_0x4f3ff0){_0x412b1d[_0x7117('0x47')]=_0x4f3ff0;return _0x412b1d;})[_0x7117('0x25')](respondWithFilteredResult(_0xa04523,_0x425a25))['catch'](handleError(_0xa04523,null));};exports[_0x7117('0x48')]=function(_0xa69ee2,_0x50dfa7){var _0x4f0de8={'raw':![],'where':{'id':_0xa69ee2[_0x7117('0x49')]['id']}},_0x112b47={};_0x112b47[_0x7117('0x35')]=_[_0x7117('0x4a')](db[_0x7117('0x30')][_0x7117('0x31')]);_0x112b47['query']=_[_0x7117('0x4a')](_0xa69ee2[_0x7117('0x36')]);_0x112b47[_0x7117('0x37')]=_['intersection'](_0x112b47[_0x7117('0x35')],_0x112b47[_0x7117('0x36')]);_0x4f0de8[_0x7117('0x39')]=_['intersection'](_0x112b47[_0x7117('0x35')],qs[_0x7117('0x3a')](_0xa69ee2[_0x7117('0x36')]['fields']));_0x4f0de8['attributes']=_0x4f0de8[_0x7117('0x39')][_0x7117('0x3b')]?_0x4f0de8[_0x7117('0x39')]:_0x112b47[_0x7117('0x35')];if(_0xa69ee2[_0x7117('0x36')]['includeAll']){_0x4f0de8['include']=[{'all':!![]}];}_0x4f0de8=_[_0x7117('0x42')]({},_0x4f0de8,_0xa69ee2[_0x7117('0x43')]);return db['Campaign'][_0x7117('0x4b')](_0x4f0de8)['then'](handleEntityNotFound(_0x50dfa7,null))['then'](respondWithResult(_0x50dfa7,null))[_0x7117('0x4c')](handleError(_0x50dfa7,null));};exports['create']=function(_0x33543e,_0x336ac7){return db[_0x7117('0x30')]['create'](_0x33543e[_0x7117('0x4d')],{})[_0x7117('0x25')](function(_0x1d39d3){var _0xcbd125=_0x33543e[_0x7117('0x4e')][_0x7117('0x27')]({'plain':!![]});if(!_0xcbd125)throw new Error(_0x7117('0x4f'));if(_0xcbd125['role']===_0x7117('0x4e')){var _0x161b33=_0x1d39d3[_0x7117('0x27')]({'plain':!![]});var _0x64d8ea=_0x7117('0x28');return db[_0x7117('0x50')][_0x7117('0x4b')]({'where':{'name':_0x64d8ea,'userProfileId':_0xcbd125['userProfileId']},'raw':!![]})[_0x7117('0x25')](function(_0x5e47d0){if(_0x5e47d0&&_0x5e47d0[_0x7117('0x51')]===0x0){return db[_0x7117('0x52')][_0x7117('0x53')]({'name':_0x161b33[_0x7117('0x2c')],'resourceId':_0x161b33['id'],'type':_0x5e47d0[_0x7117('0x2c')],'sectionId':_0x5e47d0['id']},{})['then'](function(){return _0x1d39d3;});}else{return _0x1d39d3;}})['catch'](function(_0x542a73){logger['error'](_0x7117('0x54'),_0x542a73);throw _0x542a73;});}return _0x1d39d3;})['then'](respondWithResult(_0x336ac7,0xc9))['catch'](handleError(_0x336ac7,null));};exports['clone']=function(_0xf35b32,_0x5cd0cd){var _0x2b8cc9={'where':{'id':_0xf35b32[_0x7117('0x49')]['id']}},_0x2f9b08={};_0x2f9b08[_0x7117('0x35')]=_[_0x7117('0x4a')](db[_0x7117('0x30')][_0x7117('0x31')]);_0x2b8cc9[_0x7117('0x39')]=_['intersection'](_0x2f9b08[_0x7117('0x35')],qs['fields'](_0xf35b32['query'][_0x7117('0x3a')]));_0x2b8cc9['attributes']=_0x2b8cc9['attributes'][_0x7117('0x3b')]?_0x2b8cc9[_0x7117('0x39')]:_0x2f9b08[_0x7117('0x35')];if(_0xf35b32['query'][_0x7117('0x44')]){_0x2b8cc9[_0x7117('0x45')]=[{'all':!![]}];}_0x2b8cc9=_[_0x7117('0x42')]({},_0x2b8cc9,_0xf35b32['options']);return db['Campaign'][_0x7117('0x4b')](_0x2b8cc9)[_0x7117('0x25')](handleEntityNotFound(_0x5cd0cd,null))[_0x7117('0x25')](function(_0x1ed9e0){if(_0x1ed9e0){var _0x4e8362=_0x1ed9e0[_0x7117('0x27')]({'plain':!![]});_0x4e8362=qs['omit'](_0x4e8362,['id',_0x7117('0x55'),_0x7117('0x56')]);_0xf35b32[_0x7117('0x4d')]=_[_0x7117('0x57')](_0xf35b32[_0x7117('0x4d')],['id',_0x7117('0x55'),'updatedAt']);return db[_0x7117('0x30')][_0x7117('0x53')](_[_0x7117('0x42')](_0x4e8362,_0xf35b32[_0x7117('0x4d')]),{'include':_0xf35b32['query']['includeAll']?[{'all':!![]}]:undefined})[_0x7117('0x25')](function(_0x46f44b){var _0x55af0d=_0xf35b32[_0x7117('0x4e')][_0x7117('0x27')]({'plain':!![]});if(!_0x55af0d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55af0d[_0x7117('0x58')]===_0x7117('0x4e')){var _0x68a46b=_0x46f44b['get']({'plain':!![]});var _0x41e5df=_0x7117('0x28');return db[_0x7117('0x50')][_0x7117('0x4b')]({'where':{'name':_0x41e5df,'userProfileId':_0x55af0d[_0x7117('0x59')]},'raw':!![]})['then'](function(_0xeb4fad){if(_0xeb4fad&&_0xeb4fad[_0x7117('0x51')]===0x0){return db[_0x7117('0x52')][_0x7117('0x53')]({'name':_0x68a46b[_0x7117('0x2c')],'resourceId':_0x68a46b['id'],'type':_0xeb4fad[_0x7117('0x2c')],'sectionId':_0xeb4fad['id']},{})[_0x7117('0x25')](function(){return _0x46f44b;});}else{return _0x46f44b;}})['catch'](function(_0x1c9c04){logger['error'](_0x7117('0x54'),_0x1c9c04);throw _0x1c9c04;});}return _0x46f44b;});}})[_0x7117('0x25')](respondWithResult(_0x5cd0cd,0xc9))[_0x7117('0x4c')](handleError(_0x5cd0cd,null));};exports[_0x7117('0x24')]=function(_0x1ec9ba,_0xbc1fe5){if(_0x1ec9ba[_0x7117('0x4d')]['id']){delete _0x1ec9ba[_0x7117('0x4d')]['id'];}return db[_0x7117('0x30')][_0x7117('0x4b')]({'where':{'id':_0x1ec9ba[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0xbc1fe5,null))[_0x7117('0x25')](saveUpdates(_0x1ec9ba['body'],null))[_0x7117('0x25')](respondWithResult(_0xbc1fe5,null))[_0x7117('0x4c')](handleError(_0xbc1fe5,null));};exports['destroy']=function(_0x5a4cf0,_0x54f5ff){return db[_0x7117('0x30')]['find']({'where':{'id':_0x5a4cf0[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x54f5ff,null))['then'](removeEntity(_0x54f5ff,null))[_0x7117('0x4c')](handleError(_0x54f5ff,null));};exports[_0x7117('0x5a')]=function(_0x414dc1,_0x1780b8,_0x34758e){var _0x2582a4={'raw':!![],'where':{}};var _0xd3fb4e={};var _0x2d88c8={'count':0x0,'rows':[]};return db[_0x7117('0x30')][_0x7117('0x5b')]({'where':{'id':_0x414dc1[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x1780b8,null))['then'](function(_0x38f25d){if(_0x38f25d){_0xd3fb4e['model']=_[_0x7117('0x4a')](db[_0x7117('0x5c')][_0x7117('0x31')]);_0xd3fb4e[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x414dc1[_0x7117('0x36')]);_0xd3fb4e[_0x7117('0x37')]=_[_0x7117('0x38')](_0xd3fb4e[_0x7117('0x35')],_0xd3fb4e[_0x7117('0x36')]);_0x2582a4[_0x7117('0x39')]=_['intersection'](_0xd3fb4e['model'],qs['fields'](_0x414dc1['query'][_0x7117('0x3a')]));_0x2582a4[_0x7117('0x39')]=_0x2582a4[_0x7117('0x39')][_0x7117('0x3b')]?_0x2582a4[_0x7117('0x39')]:_0xd3fb4e[_0x7117('0x35')];if(!_0x414dc1[_0x7117('0x36')][_0x7117('0x5d')](_0x7117('0x3c'))){_0x2582a4[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x414dc1[_0x7117('0x36')]['limit']);_0x2582a4[_0x7117('0x1c')]=qs[_0x7117('0x1c')](_0x414dc1['query'][_0x7117('0x1c')]);}_0x2582a4[_0x7117('0x3d')]=qs['sort'](_0x414dc1[_0x7117('0x36')]['sort']);_0x2582a4[_0x7117('0x3f')]=qs[_0x7117('0x37')](_[_0x7117('0x40')](_0x414dc1[_0x7117('0x36')],_0xd3fb4e[_0x7117('0x37')]));_0x2582a4[_0x7117('0x3f')][_0x7117('0x5e')]=_0x38f25d['id'];if(_0x414dc1[_0x7117('0x36')]['filter']){_0x2582a4[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x2582a4[_0x7117('0x3f')],{'$or':_[_0x7117('0x2f')](_0x2582a4[_0x7117('0x39')],function(_0x59dcd1){var _0x7286d2={};_0x7286d2[_0x59dcd1]={'$like':'%'+_0x414dc1[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x7286d2;})});}_0x2582a4=_['merge']({},_0x2582a4,_0x414dc1[_0x7117('0x43')]);return db['CmHopper'][_0x7117('0x1f')]({'where':_0x2582a4[_0x7117('0x3f')]})[_0x7117('0x25')](function(_0x383254){_0x2d88c8['count']=_0x383254;if(_0x414dc1[_0x7117('0x36')][_0x7117('0x44')]){_0x2582a4['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2582a4);})['then'](function(_0x111fb8){_0x2d88c8['rows']=_0x111fb8;return _0x2d88c8;});}})[_0x7117('0x25')](respondWithFilteredResult(_0x1780b8,_0x2582a4))[_0x7117('0x4c')](handleError(_0x1780b8,null));};exports[_0x7117('0x5f')]=function(_0x34bf03,_0x5ec748,_0x2d1ce7){var _0x3d092e={'raw':!![],'where':{}};var _0x12833d={};var _0x48a084={'count':0x0,'rows':[]};return db['Campaign'][_0x7117('0x5b')]({'where':{'id':_0x34bf03[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x5ec748,null))[_0x7117('0x25')](function(_0x5be58c){if(_0x5be58c){_0x12833d[_0x7117('0x35')]=_['keys'](db[_0x7117('0x60')][_0x7117('0x31')]);_0x12833d[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x34bf03[_0x7117('0x36')]);_0x12833d[_0x7117('0x37')]=_['intersection'](_0x12833d[_0x7117('0x35')],_0x12833d[_0x7117('0x36')]);_0x3d092e[_0x7117('0x39')]=_[_0x7117('0x38')](_0x12833d[_0x7117('0x35')],qs[_0x7117('0x3a')](_0x34bf03[_0x7117('0x36')]['fields']));_0x3d092e[_0x7117('0x39')]=_0x3d092e[_0x7117('0x39')]['length']?_0x3d092e['attributes']:_0x12833d[_0x7117('0x35')];if(!_0x34bf03[_0x7117('0x36')][_0x7117('0x5d')]('nolimit')){_0x3d092e[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x34bf03[_0x7117('0x36')][_0x7117('0x1e')]);_0x3d092e['offset']=qs[_0x7117('0x1c')](_0x34bf03[_0x7117('0x36')][_0x7117('0x1c')]);}_0x3d092e['order']=qs[_0x7117('0x3e')](_0x34bf03['query'][_0x7117('0x3e')]);_0x3d092e[_0x7117('0x3f')]=qs[_0x7117('0x37')](_['pick'](_0x34bf03['query'],_0x12833d[_0x7117('0x37')]));_0x3d092e[_0x7117('0x3f')][_0x7117('0x5e')]=_0x5be58c['id'];if(_0x34bf03[_0x7117('0x36')][_0x7117('0x41')]){_0x3d092e[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x3d092e['where'],{'$or':_[_0x7117('0x2f')](_0x3d092e['attributes'],function(_0x529c2f){var _0x171629={};_0x171629[_0x529c2f]={'$like':'%'+_0x34bf03[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x171629;})});}_0x3d092e=_['merge']({},_0x3d092e,_0x34bf03[_0x7117('0x43')]);return db[_0x7117('0x60')][_0x7117('0x1f')]({'where':_0x3d092e['where']})[_0x7117('0x25')](function(_0x2ee189){_0x48a084[_0x7117('0x1f')]=_0x2ee189;if(_0x34bf03[_0x7117('0x36')][_0x7117('0x44')]){_0x3d092e[_0x7117('0x45')]=[{'all':!![]}];}return db[_0x7117('0x60')][_0x7117('0x46')](_0x3d092e);})['then'](function(_0x863a84){_0x48a084[_0x7117('0x47')]=_0x863a84;return _0x48a084;});}})['then'](respondWithFilteredResult(_0x5ec748,_0x3d092e))[_0x7117('0x4c')](handleError(_0x5ec748,null));};exports['getHopperFinals']=function(_0x5a7fa7,_0x295ad5,_0x18e6e2){var _0x34b04a={'raw':!![],'where':{}};var _0x4d504a={};var _0x419327={'count':0x0,'rows':[]};return db[_0x7117('0x30')][_0x7117('0x5b')]({'where':{'id':_0x5a7fa7['params']['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x295ad5,null))[_0x7117('0x25')](function(_0x192856){if(_0x192856){_0x4d504a[_0x7117('0x35')]=_[_0x7117('0x4a')](db[_0x7117('0x61')][_0x7117('0x31')]);_0x4d504a[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x5a7fa7[_0x7117('0x36')]);_0x4d504a[_0x7117('0x37')]=_[_0x7117('0x38')](_0x4d504a[_0x7117('0x35')],_0x4d504a[_0x7117('0x36')]);_0x34b04a[_0x7117('0x39')]=_['intersection'](_0x4d504a['model'],qs[_0x7117('0x3a')](_0x5a7fa7[_0x7117('0x36')]['fields']));_0x34b04a[_0x7117('0x39')]=_0x34b04a['attributes'][_0x7117('0x3b')]?_0x34b04a[_0x7117('0x39')]:_0x4d504a[_0x7117('0x35')];if(!_0x5a7fa7[_0x7117('0x36')][_0x7117('0x5d')]('nolimit')){_0x34b04a[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x5a7fa7['query'][_0x7117('0x1e')]);_0x34b04a[_0x7117('0x1c')]=qs[_0x7117('0x1c')](_0x5a7fa7[_0x7117('0x36')][_0x7117('0x1c')]);}_0x34b04a[_0x7117('0x3d')]=qs['sort'](_0x5a7fa7[_0x7117('0x36')]['sort']);_0x34b04a[_0x7117('0x3f')]=qs[_0x7117('0x37')](_[_0x7117('0x40')](_0x5a7fa7[_0x7117('0x36')],_0x4d504a[_0x7117('0x37')]));_0x34b04a['where']['CampaignId']=_0x192856['id'];if(_0x5a7fa7[_0x7117('0x36')]['filter']){_0x34b04a[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x34b04a['where'],{'$or':_[_0x7117('0x2f')](_0x34b04a[_0x7117('0x39')],function(_0x4d957c){var _0x23470d={};_0x23470d[_0x4d957c]={'$like':'%'+_0x5a7fa7[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x23470d;})});}_0x34b04a=_[_0x7117('0x42')]({},_0x34b04a,_0x5a7fa7[_0x7117('0x43')]);return db[_0x7117('0x61')][_0x7117('0x1f')]({'where':_0x34b04a[_0x7117('0x3f')]})['then'](function(_0x5ded33){_0x419327[_0x7117('0x1f')]=_0x5ded33;if(_0x5a7fa7['query'][_0x7117('0x44')]){_0x34b04a[_0x7117('0x45')]=[{'all':!![]}];}return db[_0x7117('0x61')][_0x7117('0x46')](_0x34b04a);})['then'](function(_0x2faa93){_0x419327[_0x7117('0x47')]=_0x2faa93;return _0x419327;});}})[_0x7117('0x25')](respondWithFilteredResult(_0x295ad5,_0x34b04a))[_0x7117('0x4c')](handleError(_0x295ad5,null));};exports[_0x7117('0x62')]=function(_0x328412,_0x2c1ca5,_0x1f3821){var _0x3fdb3b={'raw':!![],'where':{}};var _0x590c9f={};var _0x56bc40={'count':0x0,'rows':[]};return db[_0x7117('0x30')][_0x7117('0x5b')]({'where':{'id':_0x328412[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x2c1ca5,null))['then'](function(_0x1f78b4){if(_0x1f78b4){_0x590c9f['model']=_['keys'](db[_0x7117('0x63')]['rawAttributes']);_0x590c9f[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x328412['query']);_0x590c9f['filters']=_[_0x7117('0x38')](_0x590c9f[_0x7117('0x35')],_0x590c9f[_0x7117('0x36')]);_0x3fdb3b['attributes']=_[_0x7117('0x38')](_0x590c9f[_0x7117('0x35')],qs[_0x7117('0x3a')](_0x328412['query'][_0x7117('0x3a')]));_0x3fdb3b[_0x7117('0x39')]=_0x3fdb3b[_0x7117('0x39')][_0x7117('0x3b')]?_0x3fdb3b[_0x7117('0x39')]:_0x590c9f[_0x7117('0x35')];if(!_0x328412[_0x7117('0x36')][_0x7117('0x5d')]('nolimit')){_0x3fdb3b[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x328412[_0x7117('0x36')][_0x7117('0x1e')]);_0x3fdb3b['offset']=qs['offset'](_0x328412[_0x7117('0x36')][_0x7117('0x1c')]);}_0x3fdb3b[_0x7117('0x3d')]=qs[_0x7117('0x3e')](_0x328412[_0x7117('0x36')][_0x7117('0x3e')]);_0x3fdb3b[_0x7117('0x3f')]=qs[_0x7117('0x37')](_['pick'](_0x328412['query'],_0x590c9f[_0x7117('0x37')]));_0x3fdb3b[_0x7117('0x3f')][_0x7117('0x5e')]=_0x1f78b4['id'];if(_0x328412['query'][_0x7117('0x41')]){_0x3fdb3b[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x3fdb3b['where'],{'$or':_[_0x7117('0x2f')](_0x3fdb3b[_0x7117('0x39')],function(_0x327061){var _0x209a97={};_0x209a97[_0x327061]={'$like':'%'+_0x328412[_0x7117('0x36')]['filter']+'%'};return _0x209a97;})});}_0x3fdb3b=_['merge']({},_0x3fdb3b,_0x328412[_0x7117('0x43')]);return db['CmHopperBlack'][_0x7117('0x1f')]({'where':_0x3fdb3b[_0x7117('0x3f')]})['then'](function(_0xd0e8da){_0x56bc40[_0x7117('0x1f')]=_0xd0e8da;if(_0x328412[_0x7117('0x36')][_0x7117('0x44')]){_0x3fdb3b['include']=[{'all':!![]}];}return db[_0x7117('0x63')][_0x7117('0x46')](_0x3fdb3b);})[_0x7117('0x25')](function(_0x38bcdb){_0x56bc40['rows']=_0x38bcdb;return _0x56bc40;});}})['then'](respondWithFilteredResult(_0x2c1ca5,_0x3fdb3b))[_0x7117('0x4c')](handleError(_0x2c1ca5,null));};exports['getLists']=function(_0xdf403e,_0x3d9739,_0x435291){var _0x396574={};var _0x3fa435={};var _0x46d47f;var _0x5e869e;return db['Campaign'][_0x7117('0x5b')]({'where':{'id':_0xdf403e['params']['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x3d9739,null))['then'](function(_0x499c05){if(_0x499c05){_0x46d47f=_0x499c05;_0x3fa435['model']=_[_0x7117('0x4a')](db[_0x7117('0x64')][_0x7117('0x31')]);_0x3fa435[_0x7117('0x36')]=_['keys'](_0xdf403e[_0x7117('0x36')]);_0x3fa435[_0x7117('0x37')]=_[_0x7117('0x38')](_0x3fa435[_0x7117('0x35')],_0x3fa435[_0x7117('0x36')]);_0x396574['attributes']=_[_0x7117('0x38')](_0x3fa435[_0x7117('0x35')],qs[_0x7117('0x3a')](_0xdf403e[_0x7117('0x36')][_0x7117('0x3a')]));_0x396574['attributes']=_0x396574['attributes'][_0x7117('0x3b')]?_0x396574[_0x7117('0x39')]:_0x3fa435[_0x7117('0x35')];_0x396574[_0x7117('0x3d')]=qs['sort'](_0xdf403e['query']['sort']);_0x396574['where']=qs[_0x7117('0x37')](_[_0x7117('0x40')](_0xdf403e['query'],_0x3fa435[_0x7117('0x37')]));if(_0xdf403e[_0x7117('0x36')][_0x7117('0x41')]){_0x396574[_0x7117('0x3f')]=_['merge'](_0x396574[_0x7117('0x3f')],{'$or':_[_0x7117('0x2f')](_0x396574[_0x7117('0x39')],function(_0x4256e2){var _0x133de3={};_0x133de3[_0x4256e2]={'$like':'%'+_0xdf403e['query']['filter']+'%'};return _0x133de3;})});}_0x396574=_['merge']({},_0x396574,_0xdf403e[_0x7117('0x43')]);return _0x46d47f['getLists'](_0x396574);}})[_0x7117('0x25')](function(_0x43568f){if(_0x43568f){_0x5e869e=_0x43568f[_0x7117('0x3b')];if(!_0xdf403e['query']['hasOwnProperty']('nolimit')){_0x396574[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0xdf403e['query'][_0x7117('0x1e')]);_0x396574[_0x7117('0x1c')]=qs[_0x7117('0x1c')](_0xdf403e[_0x7117('0x36')][_0x7117('0x1c')]);}return _0x46d47f['getLists'](_0x396574);}})[_0x7117('0x25')](function(_0x14221a){if(_0x14221a){return _0x14221a?{'count':_0x5e869e,'rows':_0x14221a}:null;}})['then'](respondWithResult(_0x3d9739,null))[_0x7117('0x4c')](handleError(_0x3d9739,null));};exports[_0x7117('0x65')]=function(_0x4b7f02,_0x23a2fc,_0x1e20e0){var _0x2250df,_0x1637b5;var _0x437abe=[];var _0x2a6ec9=moment()[_0x7117('0x66')](_0x7117('0x67'));return db[_0x7117('0x30')]['find']({'where':{'id':_0x4b7f02[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x23a2fc,null))['then'](function(_0x3d823f){if(_0x3d823f){_0x1637b5=_0x3d823f;return _0x3d823f[_0x7117('0x65')](_0x4b7f02[_0x7117('0x4d')][_0x7117('0x68')],_[_0x7117('0x57')](_0x4b7f02[_0x7117('0x4d')],['ids','id'])||{});}return null;})['spread'](function(_0x498516){var _0x386c59;var _0x3a2d47;_0x2250df=_0x498516||[];var _0x156fa3=[];if(_0x498516){for(var _0x585761=0x0;_0x585761<_0x498516[_0x7117('0x3b')];_0x585761+=0x1){var _0x565d20=_0x498516[_0x585761][_0x7117('0x27')]({'plain':!![]});_0x1637b5['dialCheckDuplicateType']=_0x4b7f02['body']['dialCheckDuplicateType']?_0x4b7f02['body'][_0x7117('0x69')]:_0x1637b5[_0x7117('0x69')];switch(_0x1637b5[_0x7117('0x69')]){case _0x7117('0x6a'):_0x386c59=squel['insert']()[_0x7117('0x6b')](_0x7117('0x6c'))[_0x7117('0x6d')]([_0x7117('0x6e'),_0x7117('0x6f'),_0x7117('0x70'),_0x7117('0x71'),_0x7117('0x5e'),'createdAt','updatedAt'],squel[_0x7117('0x72')]()[_0x7117('0x73')](_0x7117('0x6e'),_0x7117('0x6e'))[_0x7117('0x73')]('NOW()',_0x7117('0x6f'))[_0x7117('0x73')]('id',_0x7117('0x70'))[_0x7117('0x73')](_0x565d20[_0x7117('0x74')][_0x7117('0x75')](),_0x7117('0x71'))[_0x7117('0x73')](_0x4b7f02[_0x7117('0x49')]['id'][_0x7117('0x75')](),_0x7117('0x5e'))[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x55'))[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x56'))[_0x7117('0x76')](_0x7117('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x7117('0x3f')](_0x7117('0x78'),_0x565d20['CmListId'][_0x7117('0x75')]())[_0x7117('0x3f')](_0x7117('0x79'))[_0x7117('0x3f')](_0x7117('0x7a'),squel[_0x7117('0x72')]()[_0x7117('0x73')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x7117('0x7b'))[_0x7117('0x3f')](_0x7117('0x7c'),_0x4b7f02['params']['id'][_0x7117('0x75')]()))[_0x7117('0x3f')](_0x7117('0x7a'),squel[_0x7117('0x72')]()[_0x7117('0x73')]('COALESCE(phone,\x27\x27)')[_0x7117('0x76')](_0x7117('0x6c'))[_0x7117('0x3f')](_0x7117('0x7c'),_0x4b7f02[_0x7117('0x49')]['id']['toString']())))['toString']();break;case _0x7117('0x7d'):_0x386c59=squel['insert']()[_0x7117('0x6b')]('cm_hopper')['fromQuery']([_0x7117('0x6e'),_0x7117('0x6f'),_0x7117('0x70'),_0x7117('0x71'),_0x7117('0x5e'),'createdAt','updatedAt'],squel[_0x7117('0x72')]()[_0x7117('0x73')](_0x7117('0x6e'),_0x7117('0x6e'))[_0x7117('0x73')]('NOW()',_0x7117('0x6f'))[_0x7117('0x73')]('id','ContactId')[_0x7117('0x73')](_0x565d20[_0x7117('0x74')][_0x7117('0x75')](),_0x7117('0x71'))[_0x7117('0x73')](_0x4b7f02[_0x7117('0x49')]['id'][_0x7117('0x75')](),_0x7117('0x5e'))[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x55'))[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27','updatedAt')[_0x7117('0x76')](_0x7117('0x77'))[_0x7117('0x3f')](_0x7117('0x7e'))[_0x7117('0x3f')](_0x7117('0x78'),_0x565d20[_0x7117('0x74')][_0x7117('0x75')]())[_0x7117('0x3f')](_0x7117('0x79'))[_0x7117('0x3f')](_0x7117('0x7a'),squel[_0x7117('0x72')]()[_0x7117('0x73')]('COALESCE(phone,\x27\x27)')['from'](_0x7117('0x6c'))[_0x7117('0x3f')]('CampaignId\x20=\x20?',_0x4b7f02['params']['id'][_0x7117('0x75')]())))[_0x7117('0x75')]();break;default:_0x386c59=squel['insert']()['into'](_0x7117('0x6c'))[_0x7117('0x6d')]([_0x7117('0x6e'),'scheduledAt',_0x7117('0x70'),'ListId','CampaignId',_0x7117('0x55'),_0x7117('0x56')],squel[_0x7117('0x72')]()[_0x7117('0x73')](_0x7117('0x6e'),_0x7117('0x6e'))['field'](_0x7117('0x7f'),_0x7117('0x6f'))[_0x7117('0x73')]('id',_0x7117('0x70'))[_0x7117('0x73')](_0x565d20[_0x7117('0x74')][_0x7117('0x75')](),_0x7117('0x71'))[_0x7117('0x73')](_0x4b7f02['params']['id']['toString'](),_0x7117('0x5e'))['field']('\x27'+_0x2a6ec9+'\x27','createdAt')[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x56'))[_0x7117('0x76')](_0x7117('0x77'))[_0x7117('0x3f')](_0x7117('0x7e'))['where'](_0x7117('0x78'),_0x565d20[_0x7117('0x74')][_0x7117('0x75')]())['where'](_0x7117('0x79')))[_0x7117('0x75')]();}_0x3a2d47=squel[_0x7117('0x80')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x7117('0x81'),_0x7117('0x6f'),_0x7117('0x6e'),_0x7117('0x82'),'createdAt',_0x7117('0x56')],squel[_0x7117('0x72')]()[_0x7117('0x73')](_0x7117('0x83'),'id')[_0x7117('0x73')](_0x7117('0x7f'),'scheduledAt')[_0x7117('0x73')](_0x7117('0x84'),'phone')['field'](_0x7117('0x85'),_0x7117('0x82'))['field']('\x27'+_0x2a6ec9+'\x27','createdAt')[_0x7117('0x73')]('\x27'+_0x2a6ec9+'\x27',_0x7117('0x56'))[_0x7117('0x76')]('cm_contact_has_items','ci')[_0x7117('0x86')](_0x7117('0x6c'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x7117('0x3f')](_0x7117('0x87'),_0x565d20[_0x7117('0x74')][_0x7117('0x75')]())[_0x7117('0x3f')](_0x7117('0x88'),_0x4b7f02['params']['id'][_0x7117('0x75')]())[_0x7117('0x3f')](_0x7117('0x89'),_0x2a6ec9))[_0x7117('0x75')]();_0x156fa3[_0x7117('0x8a')](db[_0x7117('0x8b')][_0x7117('0x36')](_0x386c59));_0x437abe[_0x7117('0x8a')](db['sequelize'][_0x7117('0x36')](_0x3a2d47));}return BPromise[_0x7117('0x8c')](_0x156fa3);}})['then'](function(){return BPromise[_0x7117('0x8c')](_0x437abe);})[_0x7117('0x25')](function(){return _0x2250df;})[_0x7117('0x25')](respondWithResult(_0x23a2fc,null))[_0x7117('0x4c')](handleError(_0x23a2fc,null));};exports[_0x7117('0x8d')]=function(_0x38928e,_0x5e449d,_0x5aec8f){return db[_0x7117('0x30')][_0x7117('0x4b')]({'where':{'id':_0x38928e[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x5e449d,null))['then'](function(_0x2e0eb7){if(_0x2e0eb7){return _0x2e0eb7[_0x7117('0x8d')](_0x38928e[_0x7117('0x36')][_0x7117('0x68')]);}})[_0x7117('0x25')](function(_0xb95f8d){if(_0xb95f8d){return db[_0x7117('0x5c')][_0x7117('0x26')]({'where':{'ListId':_0x38928e[_0x7117('0x36')][_0x7117('0x68')],'CampaignId':_0x38928e[_0x7117('0x49')]['id']}})[_0x7117('0x25')](function(){return _0xb95f8d;});}})[_0x7117('0x25')](respondWithStatusCode(_0x5e449d,null))[_0x7117('0x4c')](handleError(_0x5e449d,null));};exports[_0x7117('0x8e')]=function(_0x469f70,_0x972e2b,_0x5c306c){var _0x49f531={};var _0x320be5={};var _0x5478a5;var _0x2cc047;return db[_0x7117('0x30')][_0x7117('0x5b')]({'where':{'id':_0x469f70[_0x7117('0x49')]['id']}})['then'](handleEntityNotFound(_0x972e2b,null))[_0x7117('0x25')](function(_0x512f11){if(_0x512f11){_0x5478a5=_0x512f11;_0x320be5[_0x7117('0x35')]=_[_0x7117('0x4a')](db['CmList']['rawAttributes']);_0x320be5[_0x7117('0x36')]=_[_0x7117('0x4a')](_0x469f70[_0x7117('0x36')]);_0x320be5[_0x7117('0x37')]=_[_0x7117('0x38')](_0x320be5['model'],_0x320be5[_0x7117('0x36')]);_0x49f531[_0x7117('0x39')]=_[_0x7117('0x38')](_0x320be5[_0x7117('0x35')],qs[_0x7117('0x3a')](_0x469f70[_0x7117('0x36')]['fields']));_0x49f531[_0x7117('0x39')]=_0x49f531[_0x7117('0x39')]['length']?_0x49f531['attributes']:_0x320be5[_0x7117('0x35')];_0x49f531['order']=qs[_0x7117('0x3e')](_0x469f70['query'][_0x7117('0x3e')]);_0x49f531['where']=qs[_0x7117('0x37')](_[_0x7117('0x40')](_0x469f70[_0x7117('0x36')],_0x320be5[_0x7117('0x37')]));if(_0x469f70[_0x7117('0x36')][_0x7117('0x41')]){_0x49f531[_0x7117('0x3f')]=_[_0x7117('0x42')](_0x49f531['where'],{'$or':_['map'](_0x49f531[_0x7117('0x39')],function(_0xe755b3){var _0x1a2786={};_0x1a2786[_0xe755b3]={'$like':'%'+_0x469f70[_0x7117('0x36')][_0x7117('0x41')]+'%'};return _0x1a2786;})});}_0x49f531=_[_0x7117('0x42')]({},_0x49f531,_0x469f70['options']);return _0x5478a5[_0x7117('0x8e')](_0x49f531);}})[_0x7117('0x25')](function(_0x3f136d){if(_0x3f136d){_0x2cc047=_0x3f136d['length'];if(!_0x469f70[_0x7117('0x36')]['hasOwnProperty'](_0x7117('0x3c'))){_0x49f531[_0x7117('0x1e')]=qs[_0x7117('0x1e')](_0x469f70[_0x7117('0x36')][_0x7117('0x1e')]);_0x49f531[_0x7117('0x1c')]=qs['offset'](_0x469f70[_0x7117('0x36')]['offset']);}return _0x5478a5['getBlackLists'](_0x49f531);}})['then'](function(_0x49efe6){if(_0x49efe6){return _0x49efe6?{'count':_0x2cc047,'rows':_0x49efe6}:null;}})[_0x7117('0x25')](respondWithResult(_0x972e2b,null))[_0x7117('0x4c')](handleError(_0x972e2b,null));};exports[_0x7117('0x8f')]=function(_0x240d7f,_0x54a799,_0x2297f1){var _0x555f49,_0x270ba1;var _0x4ebbe8=[];var _0x1c4a08=moment()[_0x7117('0x66')](_0x7117('0x67'));return db[_0x7117('0x30')]['find']({'where':{'id':_0x240d7f[_0x7117('0x49')]['id']}})['then'](handleEntityNotFound(_0x54a799,null))['then'](function(_0x49692e){if(_0x49692e){_0x270ba1=_0x49692e;return _0x49692e[_0x7117('0x8f')](_0x240d7f[_0x7117('0x4d')][_0x7117('0x68')],_[_0x7117('0x57')](_0x240d7f[_0x7117('0x4d')],[_0x7117('0x68'),'id'])||{});}return null;})['spread'](function(_0x4129a5){var _0x543c43;var _0xc587a0;_0x555f49=_0x4129a5||[];var _0x4504b2=[];if(_0x4129a5){for(var _0x36b8f8=0x0;_0x36b8f8<_0x4129a5[_0x7117('0x3b')];_0x36b8f8+=0x1){var _0x997b00=_0x4129a5[_0x36b8f8][_0x7117('0x27')]({'plain':!![]});_0x543c43=squel['insert']()[_0x7117('0x6b')]('cm_hopper_black')['fromQuery']([_0x7117('0x6e'),'ContactId',_0x7117('0x71'),_0x7117('0x5e'),'createdAt',_0x7117('0x56')],squel[_0x7117('0x72')]()[_0x7117('0x73')]('phone','phone')['field']('id',_0x7117('0x70'))[_0x7117('0x73')](_0x997b00['CmListId'][_0x7117('0x75')](),'ListId')['field'](_0x240d7f[_0x7117('0x49')]['id'][_0x7117('0x75')](),_0x7117('0x5e'))[_0x7117('0x73')](_0x7117('0x7f'),_0x7117('0x55'))[_0x7117('0x73')](_0x7117('0x7f'),'updatedAt')['from'](_0x7117('0x77'))['where'](_0x7117('0x7e'))[_0x7117('0x3f')](_0x7117('0x78'),_0x997b00['CmListId']['toString']())[_0x7117('0x3f')](_0x7117('0x79')))['toString']();_0x4504b2[_0x7117('0x8a')](db[_0x7117('0x8b')][_0x7117('0x36')](_0x543c43));}return BPromise[_0x7117('0x8c')](_0x4504b2);}})[_0x7117('0x25')](function(){return _0x555f49;})['then'](respondWithResult(_0x54a799,null))['catch'](handleError(_0x54a799,null));};exports['removeBlackLists']=function(_0x93ac5b,_0x18d998,_0x4c8118){return db[_0x7117('0x30')]['find']({'where':{'id':_0x93ac5b[_0x7117('0x49')]['id']}})[_0x7117('0x25')](handleEntityNotFound(_0x18d998,null))['then'](function(_0x23662a){if(_0x23662a){return _0x23662a['removeBlackLists'](_0x93ac5b['query'][_0x7117('0x68')]);}})[_0x7117('0x25')](function(_0x59dccc){if(_0x59dccc){return db[_0x7117('0x63')][_0x7117('0x26')]({'where':{'ListId':_0x93ac5b[_0x7117('0x36')][_0x7117('0x68')],'CampaignId':_0x93ac5b[_0x7117('0x49')]['id']}})[_0x7117('0x25')](function(){return _0x59dccc;});}})['then'](respondWithStatusCode(_0x18d998,null))[_0x7117('0x4c')](handleError(_0x18d998,null));};
\ No newline at end of file
+var _0x13f6=['ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','error','send','index','map','Campaign','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','get','UserProfileSection','userProfileId','UserProfileResource','omit','createdAt','updatedAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','order','pick','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x13f6,0x124));var _0x613f=function(_0x4c17fb,_0x1d38be){_0x4c17fb=_0x4c17fb-0x0;var _0x4ac2af=_0x13f6[_0x4c17fb];return _0x4ac2af;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];function respondWithStatusCode(_0x542230,_0x4c2a85){_0x4c2a85=_0x4c2a85||0xcc;return function(_0x517f57){if(_0x517f57){return _0x542230[_0x613f('0x16')](_0x4c2a85);}return _0x542230[_0x613f('0x17')](_0x4c2a85)[_0x613f('0x18')]();};}function respondWithResult(_0x375db1,_0x329fcf){_0x329fcf=_0x329fcf||0xc8;return function(_0x4a6fc){if(_0x4a6fc){return _0x375db1[_0x613f('0x17')](_0x329fcf)[_0x613f('0x19')](_0x4a6fc);}};}function respondWithFilteredResult(_0x2eee4d,_0x1d68fd){return function(_0x548218){if(_0x548218){var _0x3c9edf=typeof _0x1d68fd['offset']==='undefined'&&typeof _0x1d68fd[_0x613f('0x1a')]===_0x613f('0x1b');var _0x544eca=_0x548218[_0x613f('0x1c')];var _0x4f9dae=_0x3c9edf?0x0:_0x1d68fd[_0x613f('0x1d')];var _0x1e5a11=_0x3c9edf?_0x548218[_0x613f('0x1c')]:_0x1d68fd[_0x613f('0x1d')]+_0x1d68fd[_0x613f('0x1a')];var _0x1ba35f;if(_0x1e5a11>=_0x544eca){_0x1e5a11=_0x544eca;_0x1ba35f=0xc8;}else{_0x1ba35f=0xce;}_0x2eee4d['status'](_0x1ba35f);return _0x2eee4d['set'](_0x613f('0x1e'),_0x4f9dae+'-'+_0x1e5a11+'/'+_0x544eca)['json'](_0x548218);}return null;};}function patchUpdates(_0x48493c){return function(_0x3c9b58){try{jsonpatch[_0x613f('0x1f')](_0x3c9b58,_0x48493c,!![]);}catch(_0x4f5a5a){return BPromise[_0x613f('0x20')](_0x4f5a5a);}return _0x3c9b58[_0x613f('0x21')]();};}function saveUpdates(_0x2aa14b,_0x48b28a){return function(_0x5401c2){if(_0x5401c2){return _0x5401c2[_0x613f('0x22')](_0x2aa14b)[_0x613f('0x23')](function(_0x2acfcf){return _0x2acfcf;});}return null;};}function removeEntity(_0x51f376,_0x41104e){return function(_0x33e0c6){if(_0x33e0c6){return _0x33e0c6[_0x613f('0x24')]()[_0x613f('0x23')](function(){var _0x3013a1=_0x33e0c6['get']({'plain':!![]});var _0x30fb15=_0x613f('0x25');return db['UserProfileResource'][_0x613f('0x24')]({'where':{'type':_0x30fb15,'resourceId':_0x3013a1['id']}})[_0x613f('0x23')](function(){return _0x33e0c6;});})[_0x613f('0x23')](function(){_0x51f376['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4a8b,_0x379920){return function(_0x594c28){if(!_0x594c28){_0x5a4a8b[_0x613f('0x16')](0x194);}return _0x594c28;};}function handleError(_0x1767db,_0x4ca372){_0x4ca372=_0x4ca372||0x1f4;return function(_0x121241){logger[_0x613f('0x26')](_0x121241['stack']);if(_0x121241['name']){delete _0x121241['name'];}_0x1767db[_0x613f('0x17')](_0x4ca372)[_0x613f('0x27')](_0x121241);};}exports[_0x613f('0x28')]=function(_0x47f4af,_0x23eda8){var _0x439478={},_0xd335a6={},_0x19bb8f={'count':0x0,'rows':[]};var _0x4f8500=_[_0x613f('0x29')](db[_0x613f('0x2a')][_0x613f('0x2b')],function(_0x728f45){return{'name':_0x728f45[_0x613f('0x2c')],'type':_0x728f45[_0x613f('0x2d')]['key']};});_0xd335a6[_0x613f('0x2e')]=_[_0x613f('0x29')](_0x4f8500,_0x613f('0x2f'));_0xd335a6['query']=_[_0x613f('0x30')](_0x47f4af['query']);_0xd335a6[_0x613f('0x31')]=_[_0x613f('0x32')](_0xd335a6[_0x613f('0x2e')],_0xd335a6[_0x613f('0x33')]);_0x439478[_0x613f('0x34')]=_[_0x613f('0x32')](_0xd335a6['model'],qs[_0x613f('0x35')](_0x47f4af[_0x613f('0x33')][_0x613f('0x35')]));_0x439478[_0x613f('0x34')]=_0x439478[_0x613f('0x34')]['length']?_0x439478['attributes']:_0xd335a6['model'];if(!_0x47f4af[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x439478[_0x613f('0x1a')]=qs['limit'](_0x47f4af[_0x613f('0x33')][_0x613f('0x1a')]);_0x439478['offset']=qs[_0x613f('0x1d')](_0x47f4af['query'][_0x613f('0x1d')]);}_0x439478['order']=qs[_0x613f('0x38')](_0x47f4af['query'][_0x613f('0x38')]);_0x439478[_0x613f('0x39')]=qs[_0x613f('0x31')](_['pick'](_0x47f4af[_0x613f('0x33')],_0xd335a6[_0x613f('0x31')]),_0x4f8500);if(_0x47f4af[_0x613f('0x33')][_0x613f('0x3a')]){_0x439478[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x439478[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x4f8500,function(_0x1f71f3){if(_0x1f71f3[_0x613f('0x2d')]!=='VIRTUAL'){var _0x28b1bc={};_0x28b1bc[_0x1f71f3[_0x613f('0x2f')]]={'$like':'%'+_0x47f4af[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x28b1bc;}})});}_0x439478=_[_0x613f('0x3b')]({},_0x439478,_0x47f4af[_0x613f('0x3c')]);var _0xa76fff={'where':_0x439478['where']};return db[_0x613f('0x2a')][_0x613f('0x1c')](_0xa76fff)[_0x613f('0x23')](function(_0x3d2d7b){_0x19bb8f[_0x613f('0x1c')]=_0x3d2d7b;if(_0x47f4af[_0x613f('0x33')][_0x613f('0x3d')]){_0x439478['include']=[{'all':!![]}];}return db[_0x613f('0x2a')][_0x613f('0x3e')](_0x439478);})[_0x613f('0x23')](function(_0x2f584e){_0x19bb8f[_0x613f('0x3f')]=_0x2f584e;return _0x19bb8f;})[_0x613f('0x23')](respondWithFilteredResult(_0x23eda8,_0x439478))[_0x613f('0x40')](handleError(_0x23eda8,null));};exports[_0x613f('0x41')]=function(_0x403feb,_0x2d2574){var _0x12647a={'raw':![],'where':{'id':_0x403feb[_0x613f('0x42')]['id']}},_0x258a71={};_0x258a71['model']=_[_0x613f('0x30')](db[_0x613f('0x2a')][_0x613f('0x2b')]);_0x258a71[_0x613f('0x33')]=_['keys'](_0x403feb[_0x613f('0x33')]);_0x258a71[_0x613f('0x31')]=_[_0x613f('0x32')](_0x258a71[_0x613f('0x2e')],_0x258a71[_0x613f('0x33')]);_0x12647a[_0x613f('0x34')]=_[_0x613f('0x32')](_0x258a71[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x403feb[_0x613f('0x33')]['fields']));_0x12647a['attributes']=_0x12647a[_0x613f('0x34')][_0x613f('0x43')]?_0x12647a['attributes']:_0x258a71[_0x613f('0x2e')];if(_0x403feb[_0x613f('0x33')][_0x613f('0x3d')]){_0x12647a[_0x613f('0x44')]=[{'all':!![]}];}_0x12647a=_[_0x613f('0x3b')]({},_0x12647a,_0x403feb[_0x613f('0x3c')]);return db[_0x613f('0x2a')][_0x613f('0x45')](_0x12647a)[_0x613f('0x23')](handleEntityNotFound(_0x2d2574,null))[_0x613f('0x23')](respondWithResult(_0x2d2574,null))[_0x613f('0x40')](handleError(_0x2d2574,null));};exports[_0x613f('0x46')]=function(_0x174e22,_0x17f8e5){return db[_0x613f('0x2a')][_0x613f('0x46')](_0x174e22[_0x613f('0x47')],{})[_0x613f('0x23')](function(_0x5a4079){var _0x47c84b=_0x174e22[_0x613f('0x48')][_0x613f('0x49')]({'plain':!![]});if(!_0x47c84b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47c84b['role']===_0x613f('0x48')){var _0x51729a=_0x5a4079['get']({'plain':!![]});var _0x6e006b=_0x613f('0x25');return db[_0x613f('0x4a')]['find']({'where':{'name':_0x6e006b,'userProfileId':_0x47c84b[_0x613f('0x4b')]},'raw':!![]})[_0x613f('0x23')](function(_0x4f59b6){if(_0x4f59b6&&_0x4f59b6['autoAssociation']===0x0){return db[_0x613f('0x4c')][_0x613f('0x46')]({'name':_0x51729a[_0x613f('0x2f')],'resourceId':_0x51729a['id'],'type':_0x4f59b6[_0x613f('0x2f')],'sectionId':_0x4f59b6['id']},{})[_0x613f('0x23')](function(){return _0x5a4079;});}else{return _0x5a4079;}})[_0x613f('0x40')](function(_0x24d162){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24d162);throw _0x24d162;});}return _0x5a4079;})[_0x613f('0x23')](respondWithResult(_0x17f8e5,0xc9))['catch'](handleError(_0x17f8e5,null));};exports['clone']=function(_0x387913,_0x52c2a6){var _0x13e3a4={'where':{'id':_0x387913[_0x613f('0x42')]['id']}},_0x59d6bb={};_0x59d6bb[_0x613f('0x2e')]=_[_0x613f('0x30')](db[_0x613f('0x2a')][_0x613f('0x2b')]);_0x13e3a4[_0x613f('0x34')]=_[_0x613f('0x32')](_0x59d6bb['model'],qs[_0x613f('0x35')](_0x387913['query'][_0x613f('0x35')]));_0x13e3a4[_0x613f('0x34')]=_0x13e3a4[_0x613f('0x34')][_0x613f('0x43')]?_0x13e3a4[_0x613f('0x34')]:_0x59d6bb[_0x613f('0x2e')];if(_0x387913[_0x613f('0x33')][_0x613f('0x3d')]){_0x13e3a4[_0x613f('0x44')]=[{'all':!![]}];}_0x13e3a4=_[_0x613f('0x3b')]({},_0x13e3a4,_0x387913[_0x613f('0x3c')]);return db[_0x613f('0x2a')][_0x613f('0x45')](_0x13e3a4)['then'](handleEntityNotFound(_0x52c2a6,null))['then'](function(_0x687e56){if(_0x687e56){var _0x4b6eb3=_0x687e56[_0x613f('0x49')]({'plain':!![]});_0x4b6eb3=qs[_0x613f('0x4d')](_0x4b6eb3,['id',_0x613f('0x4e'),_0x613f('0x4f')]);_0x387913[_0x613f('0x47')]=_[_0x613f('0x4d')](_0x387913[_0x613f('0x47')],['id',_0x613f('0x4e'),_0x613f('0x4f')]);return db[_0x613f('0x2a')][_0x613f('0x46')](_['merge'](_0x4b6eb3,_0x387913[_0x613f('0x47')]),{'include':_0x387913[_0x613f('0x33')][_0x613f('0x3d')]?[{'all':!![]}]:undefined})[_0x613f('0x23')](function(_0x5a3ea1){var _0xacca40=_0x387913[_0x613f('0x48')]['get']({'plain':!![]});if(!_0xacca40)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xacca40[_0x613f('0x50')]==='user'){var _0x50ad7d=_0x5a3ea1['get']({'plain':!![]});var _0x1a1ef2='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x1a1ef2,'userProfileId':_0xacca40[_0x613f('0x4b')]},'raw':!![]})[_0x613f('0x23')](function(_0x5bf4ce){if(_0x5bf4ce&&_0x5bf4ce[_0x613f('0x51')]===0x0){return db[_0x613f('0x4c')][_0x613f('0x46')]({'name':_0x50ad7d[_0x613f('0x2f')],'resourceId':_0x50ad7d['id'],'type':_0x5bf4ce['name'],'sectionId':_0x5bf4ce['id']},{})[_0x613f('0x23')](function(){return _0x5a3ea1;});}else{return _0x5a3ea1;}})[_0x613f('0x40')](function(_0x5d0ab7){logger[_0x613f('0x26')](_0x613f('0x52'),_0x5d0ab7);throw _0x5d0ab7;});}return _0x5a3ea1;});}})[_0x613f('0x23')](respondWithResult(_0x52c2a6,0xc9))[_0x613f('0x40')](handleError(_0x52c2a6,null));};exports[_0x613f('0x22')]=function(_0xdf8993,_0xbead7c){if(_0xdf8993[_0x613f('0x47')]['id']){delete _0xdf8993[_0x613f('0x47')]['id'];}return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0xdf8993[_0x613f('0x42')]['id']}})['then'](handleEntityNotFound(_0xbead7c,null))[_0x613f('0x23')](saveUpdates(_0xdf8993[_0x613f('0x47')],null))[_0x613f('0x23')](respondWithResult(_0xbead7c,null))[_0x613f('0x40')](handleError(_0xbead7c,null));};exports[_0x613f('0x24')]=function(_0x2d9b65,_0x4e2002){return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x2d9b65[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x4e2002,null))[_0x613f('0x23')](removeEntity(_0x4e2002,null))[_0x613f('0x40')](handleError(_0x4e2002,null));};exports['getHoppers']=function(_0x4efc80,_0x42282a,_0x25a550){var _0x7706c7={'raw':!![],'where':{}};var _0xddcd6={};var _0x4f28c7={'count':0x0,'rows':[]};return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0x4efc80[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x42282a,null))['then'](function(_0x282a9f){if(_0x282a9f){_0xddcd6[_0x613f('0x2e')]=_[_0x613f('0x30')](db[_0x613f('0x54')][_0x613f('0x2b')]);_0xddcd6[_0x613f('0x33')]=_[_0x613f('0x30')](_0x4efc80[_0x613f('0x33')]);_0xddcd6['filters']=_[_0x613f('0x32')](_0xddcd6[_0x613f('0x2e')],_0xddcd6[_0x613f('0x33')]);_0x7706c7[_0x613f('0x34')]=_[_0x613f('0x32')](_0xddcd6[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x4efc80[_0x613f('0x33')][_0x613f('0x35')]));_0x7706c7[_0x613f('0x34')]=_0x7706c7['attributes'][_0x613f('0x43')]?_0x7706c7[_0x613f('0x34')]:_0xddcd6[_0x613f('0x2e')];if(!_0x4efc80[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x7706c7[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x4efc80[_0x613f('0x33')][_0x613f('0x1a')]);_0x7706c7[_0x613f('0x1d')]=qs['offset'](_0x4efc80[_0x613f('0x33')][_0x613f('0x1d')]);}_0x7706c7[_0x613f('0x55')]=qs[_0x613f('0x38')](_0x4efc80[_0x613f('0x33')][_0x613f('0x38')]);_0x7706c7[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x56')](_0x4efc80[_0x613f('0x33')],_0xddcd6[_0x613f('0x31')]));_0x7706c7[_0x613f('0x39')]['CampaignId']=_0x282a9f['id'];if(_0x4efc80[_0x613f('0x33')][_0x613f('0x3a')]){_0x7706c7['where']=_[_0x613f('0x3b')](_0x7706c7['where'],{'$or':_[_0x613f('0x29')](_0x7706c7['attributes'],function(_0x49cb13){var _0x2587ad={};_0x2587ad[_0x49cb13]={'$like':'%'+_0x4efc80[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x2587ad;})});}_0x7706c7=_[_0x613f('0x3b')]({},_0x7706c7,_0x4efc80[_0x613f('0x3c')]);return db[_0x613f('0x54')][_0x613f('0x1c')]({'where':_0x7706c7['where']})[_0x613f('0x23')](function(_0x45cf0a){_0x4f28c7[_0x613f('0x1c')]=_0x45cf0a;if(_0x4efc80[_0x613f('0x33')][_0x613f('0x3d')]){_0x7706c7['include']=[{'all':!![]}];}return db[_0x613f('0x54')][_0x613f('0x3e')](_0x7706c7);})['then'](function(_0x188be6){_0x4f28c7[_0x613f('0x3f')]=_0x188be6;return _0x4f28c7;});}})[_0x613f('0x23')](respondWithFilteredResult(_0x42282a,_0x7706c7))['catch'](handleError(_0x42282a,null));};exports['getHopperHistories']=function(_0x5605c9,_0x39ae92,_0x34a375){var _0x574ec4={'raw':!![],'where':{}};var _0x23e150={};var _0x13ae55={'count':0x0,'rows':[]};return db[_0x613f('0x2a')]['findOne']({'where':{'id':_0x5605c9[_0x613f('0x42')]['id']}})['then'](handleEntityNotFound(_0x39ae92,null))[_0x613f('0x23')](function(_0x537763){if(_0x537763){_0x23e150['model']=_[_0x613f('0x30')](db[_0x613f('0x57')][_0x613f('0x2b')]);_0x23e150[_0x613f('0x33')]=_[_0x613f('0x30')](_0x5605c9[_0x613f('0x33')]);_0x23e150[_0x613f('0x31')]=_[_0x613f('0x32')](_0x23e150[_0x613f('0x2e')],_0x23e150[_0x613f('0x33')]);_0x574ec4[_0x613f('0x34')]=_['intersection'](_0x23e150[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x5605c9[_0x613f('0x33')][_0x613f('0x35')]));_0x574ec4[_0x613f('0x34')]=_0x574ec4[_0x613f('0x34')][_0x613f('0x43')]?_0x574ec4['attributes']:_0x23e150[_0x613f('0x2e')];if(!_0x5605c9[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x574ec4['limit']=qs[_0x613f('0x1a')](_0x5605c9[_0x613f('0x33')][_0x613f('0x1a')]);_0x574ec4[_0x613f('0x1d')]=qs[_0x613f('0x1d')](_0x5605c9[_0x613f('0x33')]['offset']);}_0x574ec4[_0x613f('0x55')]=qs[_0x613f('0x38')](_0x5605c9['query'][_0x613f('0x38')]);_0x574ec4[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x56')](_0x5605c9[_0x613f('0x33')],_0x23e150['filters']));_0x574ec4[_0x613f('0x39')][_0x613f('0x58')]=_0x537763['id'];if(_0x5605c9[_0x613f('0x33')][_0x613f('0x3a')]){_0x574ec4[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x574ec4['where'],{'$or':_['map'](_0x574ec4[_0x613f('0x34')],function(_0x491818){var _0x2e7533={};_0x2e7533[_0x491818]={'$like':'%'+_0x5605c9['query'][_0x613f('0x3a')]+'%'};return _0x2e7533;})});}_0x574ec4=_[_0x613f('0x3b')]({},_0x574ec4,_0x5605c9[_0x613f('0x3c')]);return db[_0x613f('0x57')]['count']({'where':_0x574ec4[_0x613f('0x39')]})[_0x613f('0x23')](function(_0x4e69a2){_0x13ae55['count']=_0x4e69a2;if(_0x5605c9['query'][_0x613f('0x3d')]){_0x574ec4['include']=[{'all':!![]}];}return db[_0x613f('0x57')][_0x613f('0x3e')](_0x574ec4);})[_0x613f('0x23')](function(_0x424c12){_0x13ae55['rows']=_0x424c12;return _0x13ae55;});}})[_0x613f('0x23')](respondWithFilteredResult(_0x39ae92,_0x574ec4))[_0x613f('0x40')](handleError(_0x39ae92,null));};exports[_0x613f('0x59')]=function(_0x31762e,_0x22557a,_0x27646c){var _0x293a53={'raw':!![],'where':{}};var _0x5159ab={};var _0x286977={'count':0x0,'rows':[]};return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0x31762e['params']['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x22557a,null))[_0x613f('0x23')](function(_0x7fada0){if(_0x7fada0){_0x5159ab['model']=_[_0x613f('0x30')](db[_0x613f('0x5a')][_0x613f('0x2b')]);_0x5159ab[_0x613f('0x33')]=_[_0x613f('0x30')](_0x31762e[_0x613f('0x33')]);_0x5159ab[_0x613f('0x31')]=_[_0x613f('0x32')](_0x5159ab['model'],_0x5159ab['query']);_0x293a53[_0x613f('0x34')]=_[_0x613f('0x32')](_0x5159ab[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x31762e[_0x613f('0x33')]['fields']));_0x293a53[_0x613f('0x34')]=_0x293a53['attributes'][_0x613f('0x43')]?_0x293a53[_0x613f('0x34')]:_0x5159ab[_0x613f('0x2e')];if(!_0x31762e[_0x613f('0x33')]['hasOwnProperty'](_0x613f('0x37'))){_0x293a53[_0x613f('0x1a')]=qs['limit'](_0x31762e[_0x613f('0x33')]['limit']);_0x293a53[_0x613f('0x1d')]=qs[_0x613f('0x1d')](_0x31762e[_0x613f('0x33')][_0x613f('0x1d')]);}_0x293a53[_0x613f('0x55')]=qs['sort'](_0x31762e[_0x613f('0x33')][_0x613f('0x38')]);_0x293a53['where']=qs[_0x613f('0x31')](_['pick'](_0x31762e[_0x613f('0x33')],_0x5159ab[_0x613f('0x31')]));_0x293a53[_0x613f('0x39')][_0x613f('0x58')]=_0x7fada0['id'];if(_0x31762e[_0x613f('0x33')][_0x613f('0x3a')]){_0x293a53[_0x613f('0x39')]=_['merge'](_0x293a53[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x293a53[_0x613f('0x34')],function(_0x78c992){var _0x2aa59b={};_0x2aa59b[_0x78c992]={'$like':'%'+_0x31762e[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x2aa59b;})});}_0x293a53=_[_0x613f('0x3b')]({},_0x293a53,_0x31762e[_0x613f('0x3c')]);return db[_0x613f('0x5a')]['count']({'where':_0x293a53[_0x613f('0x39')]})[_0x613f('0x23')](function(_0x550975){_0x286977[_0x613f('0x1c')]=_0x550975;if(_0x31762e[_0x613f('0x33')]['includeAll']){_0x293a53[_0x613f('0x44')]=[{'all':!![]}];}return db[_0x613f('0x5a')][_0x613f('0x3e')](_0x293a53);})[_0x613f('0x23')](function(_0x26883c){_0x286977[_0x613f('0x3f')]=_0x26883c;return _0x286977;});}})[_0x613f('0x23')](respondWithFilteredResult(_0x22557a,_0x293a53))[_0x613f('0x40')](handleError(_0x22557a,null));};exports[_0x613f('0x5b')]=function(_0x1f21be,_0x23799d,_0x149325){var _0x2c7de2={'raw':!![],'where':{}};var _0x2112be={};var _0x6110c0={'count':0x0,'rows':[]};return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0x1f21be[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x23799d,null))[_0x613f('0x23')](function(_0x571704){if(_0x571704){_0x2112be[_0x613f('0x2e')]=_['keys'](db[_0x613f('0x5c')][_0x613f('0x2b')]);_0x2112be['query']=_[_0x613f('0x30')](_0x1f21be[_0x613f('0x33')]);_0x2112be[_0x613f('0x31')]=_[_0x613f('0x32')](_0x2112be[_0x613f('0x2e')],_0x2112be[_0x613f('0x33')]);_0x2c7de2['attributes']=_[_0x613f('0x32')](_0x2112be[_0x613f('0x2e')],qs['fields'](_0x1f21be[_0x613f('0x33')][_0x613f('0x35')]));_0x2c7de2[_0x613f('0x34')]=_0x2c7de2[_0x613f('0x34')][_0x613f('0x43')]?_0x2c7de2[_0x613f('0x34')]:_0x2112be['model'];if(!_0x1f21be[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x2c7de2[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x1f21be[_0x613f('0x33')][_0x613f('0x1a')]);_0x2c7de2[_0x613f('0x1d')]=qs['offset'](_0x1f21be[_0x613f('0x33')]['offset']);}_0x2c7de2['order']=qs[_0x613f('0x38')](_0x1f21be[_0x613f('0x33')]['sort']);_0x2c7de2[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x56')](_0x1f21be[_0x613f('0x33')],_0x2112be[_0x613f('0x31')]));_0x2c7de2[_0x613f('0x39')][_0x613f('0x58')]=_0x571704['id'];if(_0x1f21be[_0x613f('0x33')][_0x613f('0x3a')]){_0x2c7de2['where']=_[_0x613f('0x3b')](_0x2c7de2['where'],{'$or':_[_0x613f('0x29')](_0x2c7de2[_0x613f('0x34')],function(_0x581319){var _0xd7c7e0={};_0xd7c7e0[_0x581319]={'$like':'%'+_0x1f21be['query'][_0x613f('0x3a')]+'%'};return _0xd7c7e0;})});}_0x2c7de2=_[_0x613f('0x3b')]({},_0x2c7de2,_0x1f21be[_0x613f('0x3c')]);return db['CmHopperBlack'][_0x613f('0x1c')]({'where':_0x2c7de2[_0x613f('0x39')]})[_0x613f('0x23')](function(_0x22cadd){_0x6110c0[_0x613f('0x1c')]=_0x22cadd;if(_0x1f21be[_0x613f('0x33')][_0x613f('0x3d')]){_0x2c7de2[_0x613f('0x44')]=[{'all':!![]}];}return db[_0x613f('0x5c')]['findAll'](_0x2c7de2);})[_0x613f('0x23')](function(_0x32c451){_0x6110c0[_0x613f('0x3f')]=_0x32c451;return _0x6110c0;});}})['then'](respondWithFilteredResult(_0x23799d,_0x2c7de2))[_0x613f('0x40')](handleError(_0x23799d,null));};exports[_0x613f('0x5d')]=function(_0xcc5140,_0x406937,_0x47014c){var _0x3a2df6={};var _0x36dc8f={};var _0x335135;var _0x58a5a5;return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0xcc5140[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x406937,null))[_0x613f('0x23')](function(_0x339e10){if(_0x339e10){_0x335135=_0x339e10;_0x36dc8f[_0x613f('0x2e')]=_[_0x613f('0x30')](db['CmList']['rawAttributes']);_0x36dc8f[_0x613f('0x33')]=_[_0x613f('0x30')](_0xcc5140[_0x613f('0x33')]);_0x36dc8f['filters']=_[_0x613f('0x32')](_0x36dc8f[_0x613f('0x2e')],_0x36dc8f[_0x613f('0x33')]);_0x3a2df6['attributes']=_[_0x613f('0x32')](_0x36dc8f['model'],qs['fields'](_0xcc5140[_0x613f('0x33')][_0x613f('0x35')]));_0x3a2df6['attributes']=_0x3a2df6[_0x613f('0x34')][_0x613f('0x43')]?_0x3a2df6['attributes']:_0x36dc8f[_0x613f('0x2e')];_0x3a2df6[_0x613f('0x55')]=qs[_0x613f('0x38')](_0xcc5140[_0x613f('0x33')][_0x613f('0x38')]);_0x3a2df6['where']=qs['filters'](_[_0x613f('0x56')](_0xcc5140['query'],_0x36dc8f[_0x613f('0x31')]));if(_0xcc5140['query'][_0x613f('0x3a')]){_0x3a2df6['where']=_[_0x613f('0x3b')](_0x3a2df6['where'],{'$or':_['map'](_0x3a2df6[_0x613f('0x34')],function(_0x453f04){var _0x47c19c={};_0x47c19c[_0x453f04]={'$like':'%'+_0xcc5140[_0x613f('0x33')]['filter']+'%'};return _0x47c19c;})});}_0x3a2df6=_['merge']({},_0x3a2df6,_0xcc5140['options']);return _0x335135[_0x613f('0x5d')](_0x3a2df6);}})[_0x613f('0x23')](function(_0x3c3527){if(_0x3c3527){_0x58a5a5=_0x3c3527['length'];if(!_0xcc5140[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x3a2df6['limit']=qs[_0x613f('0x1a')](_0xcc5140[_0x613f('0x33')][_0x613f('0x1a')]);_0x3a2df6[_0x613f('0x1d')]=qs[_0x613f('0x1d')](_0xcc5140[_0x613f('0x33')][_0x613f('0x1d')]);}return _0x335135['getLists'](_0x3a2df6);}})[_0x613f('0x23')](function(_0xfa404f){if(_0xfa404f){return _0xfa404f?{'count':_0x58a5a5,'rows':_0xfa404f}:null;}})[_0x613f('0x23')](respondWithResult(_0x406937,null))['catch'](handleError(_0x406937,null));};exports[_0x613f('0x5e')]=function(_0x380e1a,_0xcc214f,_0x52de26){var _0x1021f0,_0x15564e;var _0x3b5efa=[];var _0x5e5997=moment()[_0x613f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x380e1a[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0xcc214f,null))[_0x613f('0x23')](function(_0xeb81e){if(_0xeb81e){_0x15564e=_0xeb81e;return _0xeb81e[_0x613f('0x5e')](_0x380e1a['body']['ids'],_['omit'](_0x380e1a[_0x613f('0x47')],[_0x613f('0x60'),'id'])||{});}return null;})[_0x613f('0x61')](function(_0x8611b){var _0x4d35e5;var _0x4b8e0b;_0x1021f0=_0x8611b||[];var _0x39e193=[];if(_0x8611b){for(var _0x3bbab0=0x0;_0x3bbab0<_0x8611b[_0x613f('0x43')];_0x3bbab0+=0x1){var _0x2b66fb=_0x8611b[_0x3bbab0][_0x613f('0x49')]({'plain':!![]});_0x15564e['dialCheckDuplicateType']=_0x380e1a['body'][_0x613f('0x62')]?_0x380e1a[_0x613f('0x47')][_0x613f('0x62')]:_0x15564e[_0x613f('0x62')];switch(_0x15564e[_0x613f('0x62')]){case'always':_0x4d35e5=squel[_0x613f('0x63')]()[_0x613f('0x64')](_0x613f('0x65'))[_0x613f('0x66')]([_0x613f('0x67'),_0x613f('0x68'),_0x613f('0x69'),_0x613f('0x6a'),_0x613f('0x58'),_0x613f('0x4e'),_0x613f('0x4f')],squel[_0x613f('0x6b')]()[_0x613f('0x6c')]('phone',_0x613f('0x67'))[_0x613f('0x6c')](_0x613f('0x6d'),_0x613f('0x68'))['field']('id',_0x613f('0x69'))[_0x613f('0x6c')](_0x2b66fb['CmListId'][_0x613f('0x6e')](),'ListId')[_0x613f('0x6c')](_0x380e1a[_0x613f('0x42')]['id']['toString'](),'CampaignId')[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27','createdAt')['field']('\x27'+_0x5e5997+'\x27',_0x613f('0x4f'))[_0x613f('0x6f')]('cm_contacts')[_0x613f('0x39')]('deletedAt\x20IS\x20NULL')[_0x613f('0x39')]('ListId\x20=\x20?',_0x2b66fb[_0x613f('0x70')][_0x613f('0x6e')]())[_0x613f('0x39')](_0x613f('0x71'))['where'](_0x613f('0x72'),squel[_0x613f('0x6b')]()[_0x613f('0x6c')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0x613f('0x39')]('CampaignId\x20=\x20?',_0x380e1a[_0x613f('0x42')]['id']['toString']()))[_0x613f('0x39')](_0x613f('0x72'),squel[_0x613f('0x6b')]()[_0x613f('0x6c')](_0x613f('0x73'))[_0x613f('0x6f')]('cm_hopper')[_0x613f('0x39')](_0x613f('0x74'),_0x380e1a[_0x613f('0x42')]['id']['toString']())))[_0x613f('0x6e')]();break;case'onlyIfOpen':_0x4d35e5=squel[_0x613f('0x63')]()[_0x613f('0x64')](_0x613f('0x65'))['fromQuery']([_0x613f('0x67'),'scheduledAt',_0x613f('0x69'),'ListId',_0x613f('0x58'),_0x613f('0x4e'),_0x613f('0x4f')],squel[_0x613f('0x6b')]()['field'](_0x613f('0x67'),'phone')[_0x613f('0x6c')](_0x613f('0x6d'),_0x613f('0x68'))['field']('id',_0x613f('0x69'))[_0x613f('0x6c')](_0x2b66fb[_0x613f('0x70')][_0x613f('0x6e')](),_0x613f('0x6a'))[_0x613f('0x6c')](_0x380e1a[_0x613f('0x42')]['id'][_0x613f('0x6e')](),_0x613f('0x58'))[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27','createdAt')['field']('\x27'+_0x5e5997+'\x27',_0x613f('0x4f'))[_0x613f('0x6f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x613f('0x39')]('ListId\x20=\x20?',_0x2b66fb['CmListId'][_0x613f('0x6e')]())[_0x613f('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x613f('0x39')](_0x613f('0x72'),squel[_0x613f('0x6b')]()['field'](_0x613f('0x73'))[_0x613f('0x6f')](_0x613f('0x65'))['where']('CampaignId\x20=\x20?',_0x380e1a[_0x613f('0x42')]['id'][_0x613f('0x6e')]())))[_0x613f('0x6e')]();break;default:_0x4d35e5=squel[_0x613f('0x63')]()[_0x613f('0x64')]('cm_hopper')[_0x613f('0x66')]([_0x613f('0x67'),_0x613f('0x68'),_0x613f('0x69'),_0x613f('0x6a'),_0x613f('0x58'),_0x613f('0x4e'),_0x613f('0x4f')],squel[_0x613f('0x6b')]()[_0x613f('0x6c')](_0x613f('0x67'),_0x613f('0x67'))[_0x613f('0x6c')](_0x613f('0x6d'),'scheduledAt')['field']('id',_0x613f('0x69'))[_0x613f('0x6c')](_0x2b66fb[_0x613f('0x70')][_0x613f('0x6e')](),_0x613f('0x6a'))['field'](_0x380e1a['params']['id'][_0x613f('0x6e')](),_0x613f('0x58'))[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27',_0x613f('0x4e'))['field']('\x27'+_0x5e5997+'\x27',_0x613f('0x4f'))[_0x613f('0x6f')](_0x613f('0x75'))['where'](_0x613f('0x76'))[_0x613f('0x39')](_0x613f('0x77'),_0x2b66fb['CmListId'][_0x613f('0x6e')]())[_0x613f('0x39')](_0x613f('0x71')))[_0x613f('0x6e')]();}_0x4b8e0b=squel['insert']()[_0x613f('0x64')](_0x613f('0x78'))[_0x613f('0x66')](['cmHopperId',_0x613f('0x68'),_0x613f('0x67'),'OrderBy',_0x613f('0x4e'),_0x613f('0x4f')],squel[_0x613f('0x6b')]()['field'](_0x613f('0x79'),'id')['field'](_0x613f('0x6d'),_0x613f('0x68'))['field'](_0x613f('0x7a'),_0x613f('0x67'))[_0x613f('0x6c')]('ci.OrderBY',_0x613f('0x7b'))[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27','createdAt')[_0x613f('0x6c')]('\x27'+_0x5e5997+'\x27',_0x613f('0x4f'))[_0x613f('0x6f')](_0x613f('0x7c'),'ci')['join']('cm_hopper','h',_0x613f('0x7d'))[_0x613f('0x39')](_0x613f('0x7e'),_0x2b66fb['CmListId'][_0x613f('0x6e')]())['where']('h.CampaignId=?',_0x380e1a['params']['id']['toString']())[_0x613f('0x39')](_0x613f('0x7f'),_0x5e5997))[_0x613f('0x6e')]();_0x39e193[_0x613f('0x80')](db[_0x613f('0x81')][_0x613f('0x33')](_0x4d35e5));_0x3b5efa[_0x613f('0x80')](db['sequelize']['query'](_0x4b8e0b));}return BPromise['all'](_0x39e193);}})['then'](function(){return BPromise[_0x613f('0x82')](_0x3b5efa);})['then'](function(){return _0x1021f0;})[_0x613f('0x23')](respondWithResult(_0xcc214f,null))[_0x613f('0x40')](handleError(_0xcc214f,null));};exports[_0x613f('0x83')]=function(_0x189a4a,_0x86a29,_0x520640){return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x189a4a[_0x613f('0x42')]['id']}})['then'](handleEntityNotFound(_0x86a29,null))[_0x613f('0x23')](function(_0x1be64a){if(_0x1be64a){return _0x1be64a[_0x613f('0x83')](_0x189a4a[_0x613f('0x33')][_0x613f('0x60')]);}})[_0x613f('0x23')](function(_0x276db6){if(_0x276db6){return db[_0x613f('0x54')][_0x613f('0x24')]({'where':{'ListId':_0x189a4a['query']['ids'],'CampaignId':_0x189a4a[_0x613f('0x42')]['id']}})[_0x613f('0x23')](function(){return _0x276db6;});}})[_0x613f('0x23')](respondWithStatusCode(_0x86a29,null))[_0x613f('0x40')](handleError(_0x86a29,null));};exports['getBlackLists']=function(_0x85548f,_0x19fcc8,_0x234a6f){var _0x5b0b54={};var _0x38ebf5={};var _0x70f2a8;var _0x53e764;return db[_0x613f('0x2a')][_0x613f('0x53')]({'where':{'id':_0x85548f[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x19fcc8,null))[_0x613f('0x23')](function(_0x5e1d67){if(_0x5e1d67){_0x70f2a8=_0x5e1d67;_0x38ebf5['model']=_['keys'](db['CmList'][_0x613f('0x2b')]);_0x38ebf5[_0x613f('0x33')]=_[_0x613f('0x30')](_0x85548f[_0x613f('0x33')]);_0x38ebf5[_0x613f('0x31')]=_[_0x613f('0x32')](_0x38ebf5[_0x613f('0x2e')],_0x38ebf5[_0x613f('0x33')]);_0x5b0b54[_0x613f('0x34')]=_['intersection'](_0x38ebf5[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x85548f[_0x613f('0x33')][_0x613f('0x35')]));_0x5b0b54[_0x613f('0x34')]=_0x5b0b54[_0x613f('0x34')]['length']?_0x5b0b54[_0x613f('0x34')]:_0x38ebf5['model'];_0x5b0b54[_0x613f('0x55')]=qs['sort'](_0x85548f[_0x613f('0x33')][_0x613f('0x38')]);_0x5b0b54[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x56')](_0x85548f[_0x613f('0x33')],_0x38ebf5['filters']));if(_0x85548f['query'][_0x613f('0x3a')]){_0x5b0b54[_0x613f('0x39')]=_['merge'](_0x5b0b54[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x5b0b54[_0x613f('0x34')],function(_0x5672e2){var _0x35c71e={};_0x35c71e[_0x5672e2]={'$like':'%'+_0x85548f['query'][_0x613f('0x3a')]+'%'};return _0x35c71e;})});}_0x5b0b54=_[_0x613f('0x3b')]({},_0x5b0b54,_0x85548f[_0x613f('0x3c')]);return _0x70f2a8[_0x613f('0x84')](_0x5b0b54);}})['then'](function(_0x91e255){if(_0x91e255){_0x53e764=_0x91e255[_0x613f('0x43')];if(!_0x85548f[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x5b0b54[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x85548f[_0x613f('0x33')][_0x613f('0x1a')]);_0x5b0b54['offset']=qs[_0x613f('0x1d')](_0x85548f[_0x613f('0x33')]['offset']);}return _0x70f2a8[_0x613f('0x84')](_0x5b0b54);}})[_0x613f('0x23')](function(_0x1c3e22){if(_0x1c3e22){return _0x1c3e22?{'count':_0x53e764,'rows':_0x1c3e22}:null;}})[_0x613f('0x23')](respondWithResult(_0x19fcc8,null))[_0x613f('0x40')](handleError(_0x19fcc8,null));};exports[_0x613f('0x85')]=function(_0x265c10,_0x4fb9ae,_0x4db928){var _0x133533,_0x4acd62;var _0x323fb1=[];var _0x2f18e7=moment()[_0x613f('0x5f')](_0x613f('0x86'));return db['Campaign'][_0x613f('0x45')]({'where':{'id':_0x265c10[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x4fb9ae,null))[_0x613f('0x23')](function(_0x1fac19){if(_0x1fac19){_0x4acd62=_0x1fac19;return _0x1fac19[_0x613f('0x85')](_0x265c10[_0x613f('0x47')][_0x613f('0x60')],_[_0x613f('0x4d')](_0x265c10[_0x613f('0x47')],[_0x613f('0x60'),'id'])||{});}return null;})[_0x613f('0x61')](function(_0x8ec949){var _0x4269de;var _0x4835f3;_0x133533=_0x8ec949||[];var _0x22fed1=[];if(_0x8ec949){for(var _0x19ec12=0x0;_0x19ec12<_0x8ec949['length'];_0x19ec12+=0x1){var _0x583652=_0x8ec949[_0x19ec12]['get']({'plain':!![]});_0x4269de=squel[_0x613f('0x63')]()[_0x613f('0x64')](_0x613f('0x87'))[_0x613f('0x66')]([_0x613f('0x67'),_0x613f('0x69'),_0x613f('0x6a'),_0x613f('0x58'),'createdAt',_0x613f('0x4f')],squel['select']()[_0x613f('0x6c')]('phone',_0x613f('0x67'))['field']('id',_0x613f('0x69'))['field'](_0x583652['CmListId'][_0x613f('0x6e')](),'ListId')['field'](_0x265c10[_0x613f('0x42')]['id'][_0x613f('0x6e')](),_0x613f('0x58'))[_0x613f('0x6c')](_0x613f('0x6d'),_0x613f('0x4e'))[_0x613f('0x6c')](_0x613f('0x6d'),'updatedAt')[_0x613f('0x6f')](_0x613f('0x75'))[_0x613f('0x39')](_0x613f('0x76'))[_0x613f('0x39')](_0x613f('0x77'),_0x583652[_0x613f('0x70')][_0x613f('0x6e')]())[_0x613f('0x39')](_0x613f('0x71')))[_0x613f('0x6e')]();_0x22fed1[_0x613f('0x80')](db[_0x613f('0x81')]['query'](_0x4269de));}return BPromise[_0x613f('0x82')](_0x22fed1);}})[_0x613f('0x23')](function(){return _0x133533;})[_0x613f('0x23')](respondWithResult(_0x4fb9ae,null))[_0x613f('0x40')](handleError(_0x4fb9ae,null));};exports[_0x613f('0x88')]=function(_0xcbf137,_0x10db85,_0x57781c){return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0xcbf137[_0x613f('0x42')]['id']}})['then'](handleEntityNotFound(_0x10db85,null))[_0x613f('0x23')](function(_0x10066e){if(_0x10066e){return _0x10066e['removeBlackLists'](_0xcbf137[_0x613f('0x33')]['ids']);}})[_0x613f('0x23')](function(_0x30f3a3){if(_0x30f3a3){return db['CmHopperBlack'][_0x613f('0x24')]({'where':{'ListId':_0xcbf137[_0x613f('0x33')][_0x613f('0x60')],'CampaignId':_0xcbf137['params']['id']}})[_0x613f('0x23')](function(){return _0x30f3a3;});}})[_0x613f('0x23')](respondWithStatusCode(_0x10db85,null))[_0x613f('0x40')](handleError(_0x10db85,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index b9244fa..46eca9c 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4b3d10,_0x3da823){var _0x3f62cc=function(_0x366e9a){while(--_0x366e9a){_0x4b3d10['push'](_0x4b3d10['shift']());}};_0x3f62cc(++_0x3da823);}(_0x7a54,0x106));var _0x47a5=function(_0x170460,_0x5dc758){_0x170460=_0x170460-0x0;var _0x967890=_0x7a54[_0x170460];return _0x967890;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index f5198e7..5effdb4 100644
--- a/server/api/campaign/campaign.rpc.js
+++ b/server/api/campaign/campaign.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x495e=['Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','raw','options','where','attributes','limit','include','map','model','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x51aae8,_0x5a9019){var _0x5c6831=function(_0x4bd810){while(--_0x4bd810){_0x51aae8['push'](_0x51aae8['shift']());}};_0x5c6831(++_0x5a9019);}(_0x495e,0xfb));var _0xe495=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x495e[_0x8ae98b];return _0xc30bd4;};'use strict';var _=require(_0xe495('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe495('0x1'));var rs=require(_0xe495('0x2'));var fs=require('fs');var Redis=require(_0xe495('0x3'));var db=require(_0xe495('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe495('0x5'))(_0xe495('0x6'));var config=require(_0xe495('0x7'));var jayson=require(_0xe495('0x8'));var client=jayson[_0xe495('0x9')][_0xe495('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x101a7e,_0x5745e3,_0x599ab4){return new BPromise(function(_0x5c17d0,_0x16f146){return client['request'](_0x101a7e,_0x599ab4)[_0xe495('0xb')](function(_0x3a9a00){logger[_0xe495('0xc')](_0xe495('0xd'),_0x5745e3,_0xe495('0xe'));logger['debug'](_0xe495('0xf'),_0x5745e3,_0xe495('0xe'),JSON[_0xe495('0x10')](_0x3a9a00));if(_0x3a9a00['error']){if(_0x3a9a00[_0xe495('0x11')][_0xe495('0x12')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x5745e3,_0x3a9a00[_0xe495('0x11')][_0xe495('0x13')]);return _0x16f146(_0x3a9a00['error'][_0xe495('0x13')]);}logger[_0xe495('0x11')](_0xe495('0xd'),_0x5745e3,_0x3a9a00[_0xe495('0x11')][_0xe495('0x13')]);return _0x5c17d0(_0x3a9a00['error'][_0xe495('0x13')]);}else{logger[_0xe495('0xc')](_0xe495('0xd'),_0x5745e3,_0xe495('0xe'));_0x5c17d0(_0x3a9a00[_0xe495('0x14')]['message']);}})['catch'](function(_0x4de730){logger[_0xe495('0x11')](_0xe495('0xd'),_0x5745e3,_0x4de730);_0x16f146(_0x4de730);});});}exports[_0xe495('0x15')]=function(_0x577fb7){var _0x1e602c=this;return new Promise(function(_0x302ca0,_0x3ba8cc){return db[_0xe495('0x16')][_0xe495('0x17')]({'raw':_0x577fb7['options']?_0x577fb7['options'][_0xe495('0x18')]===undefined?!![]:![]:!![],'where':_0x577fb7[_0xe495('0x19')]?_0x577fb7[_0xe495('0x19')][_0xe495('0x1a')]||null:null,'attributes':_0x577fb7['options']?_0x577fb7[_0xe495('0x19')][_0xe495('0x1b')]||null:null,'limit':_0x577fb7[_0xe495('0x19')]?_0x577fb7['options'][_0xe495('0x1c')]||null:null,'include':_0x577fb7[_0xe495('0x19')]?_0x577fb7[_0xe495('0x19')][_0xe495('0x1d')]?_[_0xe495('0x1e')](_0x577fb7['options'][_0xe495('0x1d')],function(_0x4d836b){return{'model':db[_0x4d836b[_0xe495('0x1f')]],'as':_0x4d836b['as'],'attributes':_0x4d836b[_0xe495('0x1b')],'include':_0x4d836b[_0xe495('0x1d')]?_['map'](_0x4d836b[_0xe495('0x1d')],function(_0x2a6fd6){return{'model':db[_0x2a6fd6[_0xe495('0x1f')]],'as':_0x2a6fd6['as'],'attributes':_0x2a6fd6[_0xe495('0x1b')],'include':_0x2a6fd6[_0xe495('0x1d')]?_[_0xe495('0x1e')](_0x2a6fd6[_0xe495('0x1d')],function(_0x48b2eb){return{'model':db[_0x48b2eb['model']],'as':_0x48b2eb['as'],'attributes':_0x48b2eb[_0xe495('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1651d4){logger[_0xe495('0xc')]('GetCampaign',_0x577fb7);logger['debug'](_0xe495('0x15'),_0x577fb7,JSON[_0xe495('0x10')](_0x1651d4));_0x302ca0(_0x1651d4);})[_0xe495('0x20')](function(_0x8623c1){logger[_0xe495('0x11')](_0xe495('0x15'),_0x8623c1[_0xe495('0x13')],_0x577fb7);_0x3ba8cc(_0x1e602c[_0xe495('0x11')](0x1f4,_0x8623c1['message']));});});};
\ No newline at end of file
+var _0x7b6b=['jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetCampaign','Campaign','options','limit','include','map','model','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x367448,_0x3e9deb){var _0x28b046=function(_0x2c9ff8){while(--_0x2c9ff8){_0x367448['push'](_0x367448['shift']());}};_0x28b046(++_0x3e9deb);}(_0x7b6b,0xac));var _0xb7b6=function(_0x2cb530,_0x435826){_0x2cb530=_0x2cb530-0x0;var _0x4930f1=_0x7b6b[_0x2cb530];return _0x4930f1;};'use strict';var _=require(_0xb7b6('0x0'));var util=require('util');var moment=require(_0xb7b6('0x1'));var BPromise=require(_0xb7b6('0x2'));var rs=require(_0xb7b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7b6('0x5'))(_0xb7b6('0x6'));var config=require(_0xb7b6('0x7'));var jayson=require(_0xb7b6('0x8'));var client=jayson[_0xb7b6('0x9')][_0xb7b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e81f,_0x318dfb,_0x36cd51){return new BPromise(function(_0x31809b,_0xb5b26f){return client[_0xb7b6('0xb')](_0x19e81f,_0x36cd51)[_0xb7b6('0xc')](function(_0x313aa8){logger[_0xb7b6('0xd')](_0xb7b6('0xe'),_0x318dfb,_0xb7b6('0xf'));logger[_0xb7b6('0x10')](_0xb7b6('0x11'),_0x318dfb,_0xb7b6('0xf'),JSON['stringify'](_0x313aa8));if(_0x313aa8[_0xb7b6('0x12')]){if(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x13')]===0x1f4){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);return _0xb5b26f(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);}logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')]['message']);return _0x31809b(_0x313aa8['error'][_0xb7b6('0x14')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x318dfb,_0xb7b6('0xf'));_0x31809b(_0x313aa8['result'][_0xb7b6('0x14')]);}})[_0xb7b6('0x15')](function(_0xa99f35){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0xa99f35);_0xb5b26f(_0xa99f35);});});}exports[_0xb7b6('0x16')]=function(_0x3dc0f8){var _0x7bb633=this;return new Promise(function(_0x5667d9,_0x314049){return db[_0xb7b6('0x17')]['findAll']({'raw':_0x3dc0f8[_0xb7b6('0x18')]?_0x3dc0f8[_0xb7b6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3dc0f8[_0xb7b6('0x18')]?_0x3dc0f8[_0xb7b6('0x18')]['where']||null:null,'attributes':_0x3dc0f8['options']?_0x3dc0f8[_0xb7b6('0x18')]['attributes']||null:null,'limit':_0x3dc0f8[_0xb7b6('0x18')]?_0x3dc0f8[_0xb7b6('0x18')][_0xb7b6('0x19')]||null:null,'include':_0x3dc0f8[_0xb7b6('0x18')]?_0x3dc0f8[_0xb7b6('0x18')][_0xb7b6('0x1a')]?_[_0xb7b6('0x1b')](_0x3dc0f8[_0xb7b6('0x18')][_0xb7b6('0x1a')],function(_0x2173c5){return{'model':db[_0x2173c5[_0xb7b6('0x1c')]],'as':_0x2173c5['as'],'attributes':_0x2173c5[_0xb7b6('0x1d')],'include':_0x2173c5[_0xb7b6('0x1a')]?_['map'](_0x2173c5[_0xb7b6('0x1a')],function(_0x551e06){return{'model':db[_0x551e06[_0xb7b6('0x1c')]],'as':_0x551e06['as'],'attributes':_0x551e06['attributes'],'include':_0x551e06['include']?_['map'](_0x551e06[_0xb7b6('0x1a')],function(_0x48ace6){return{'model':db[_0x48ace6['model']],'as':_0x48ace6['as'],'attributes':_0x48ace6[_0xb7b6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb7b6('0xc')](function(_0x4276bd){logger[_0xb7b6('0xd')](_0xb7b6('0x16'),_0x3dc0f8);logger[_0xb7b6('0x10')](_0xb7b6('0x16'),_0x3dc0f8,JSON['stringify'](_0x4276bd));_0x5667d9(_0x4276bd);})['catch'](function(_0x3017f5){logger[_0xb7b6('0x12')](_0xb7b6('0x16'),_0x3017f5[_0xb7b6('0x14')],_0x3dc0f8);_0x314049(_0x7bb633[_0xb7b6('0x12')](0x1f4,_0x3017f5['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index ac05016..8861636 100644
--- a/server/api/campaign/index.js
+++ b/server/api/campaign/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x03fe=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addLists','addBlackLists','put','update','destroy','delete','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x5b6a86,_0x59489c){var _0x425888=function(_0x38fdfd){while(--_0x38fdfd){_0x5b6a86['push'](_0x5b6a86['shift']());}};_0x425888(++_0x59489c);}(_0x03fe,0x73));var _0xe03f=function(_0x273e4c,_0x24c349){_0x273e4c=_0x273e4c-0x0;var _0x11adb4=_0x03fe[_0x273e4c];return _0x11adb4;};'use strict';var multer=require(_0xe03f('0x0'));var util=require(_0xe03f('0x1'));var path=require(_0xe03f('0x2'));var timeout=require(_0xe03f('0x3'));var express=require('express');var router=express[_0xe03f('0x4')]();var fs_extra=require(_0xe03f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe03f('0x6'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xe03f('0x7')]('/',auth[_0xe03f('0x8')](),controller[_0xe03f('0x9')]);router[_0xe03f('0x7')](_0xe03f('0xa'),auth['isAuthenticated'](),controller[_0xe03f('0xb')]);router[_0xe03f('0x7')]('/:id/hoppers',auth[_0xe03f('0x8')](),controller[_0xe03f('0xc')]);router[_0xe03f('0x7')](_0xe03f('0xd'),auth[_0xe03f('0x8')](),controller[_0xe03f('0xe')]);router[_0xe03f('0x7')](_0xe03f('0xf'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x10')]);router['get'](_0xe03f('0x11'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x12')]);router[_0xe03f('0x7')](_0xe03f('0x13'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x14')]);router[_0xe03f('0x7')](_0xe03f('0x15'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x16')]);router['post']('/',auth[_0xe03f('0x8')](),controller['create']);router[_0xe03f('0x17')]('/:id/clone',auth['isAuthenticated'](),controller[_0xe03f('0x18')]);router['post'](_0xe03f('0x13'),auth['isAuthenticated'](),controller[_0xe03f('0x19')]);router[_0xe03f('0x17')](_0xe03f('0x15'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x1a')]);router[_0xe03f('0x1b')](_0xe03f('0xa'),auth[_0xe03f('0x8')](),controller[_0xe03f('0x1c')]);router['delete'](_0xe03f('0xa'),auth['isAuthenticated'](),controller[_0xe03f('0x1d')]);router[_0xe03f('0x1e')](_0xe03f('0x13'),auth[_0xe03f('0x8')](),controller['removeLists']);router[_0xe03f('0x1e')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xe03f('0x1f')]);module[_0xe03f('0x20')]=router;
\ No newline at end of file
+var _0xa5c5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','create','clone','addLists','post','addBlackLists','put','update','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express'];(function(_0x1260a6,_0x1ee131){var _0x197933=function(_0x1ddf0f){while(--_0x1ddf0f){_0x1260a6['push'](_0x1260a6['shift']());}};_0x197933(++_0x1ee131);}(_0xa5c5,0x64));var _0x5a5c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa5c5[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x5a5c('0x0'));var util=require(_0x5a5c('0x1'));var path=require(_0x5a5c('0x2'));var timeout=require(_0x5a5c('0x3'));var express=require(_0x5a5c('0x4'));var router=express[_0x5a5c('0x5')]();var fs_extra=require(_0x5a5c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5a5c('0x7'));var config=require(_0x5a5c('0x8'));var controller=require(_0x5a5c('0x9'));router[_0x5a5c('0xa')]('/',auth[_0x5a5c('0xb')](),controller[_0x5a5c('0xc')]);router[_0x5a5c('0xa')](_0x5a5c('0xd'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0xe')]);router['get'](_0x5a5c('0xf'),auth[_0x5a5c('0xb')](),controller['getHoppers']);router[_0x5a5c('0xa')](_0x5a5c('0x10'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x11')]);router[_0x5a5c('0xa')](_0x5a5c('0x12'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x5a5c('0xa')](_0x5a5c('0x13'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x14')]);router[_0x5a5c('0xa')](_0x5a5c('0x15'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x5a5c('0x16'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x17')]);router['post']('/',auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x18')]);router['post']('/:id/clone',auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x19')]);router['post'](_0x5a5c('0x15'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x1a')]);router[_0x5a5c('0x1b')](_0x5a5c('0x16'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x1c')]);router[_0x5a5c('0x1d')](_0x5a5c('0xd'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x1e')]);router[_0x5a5c('0x1f')](_0x5a5c('0xd'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x20')]);router[_0x5a5c('0x1f')](_0x5a5c('0x15'),auth[_0x5a5c('0xb')](),controller[_0x5a5c('0x21')]);router['delete'](_0x5a5c('0x16'),auth[_0x5a5c('0xb')](),controller['removeBlackLists']);module[_0x5a5c('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index f1ffff2..343939c 100644
--- a/server/api/cannedAnswer/cannedAnswer.attributes.js
+++ b/server/api/cannedAnswer/cannedAnswer.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb8d2=['medium','key','sequelize','STRING','TEXT'];(function(_0x343abb,_0x4d8e75){var _0x2e53f9=function(_0x4d1c9b){while(--_0x4d1c9b){_0x343abb['push'](_0x343abb['shift']());}};_0x2e53f9(++_0x4d8e75);}(_0xb8d2,0x188));var _0x2b8d=function(_0x166294,_0x175bc9){_0x166294=_0x166294-0x0;var _0x304968=_0xb8d2[_0x166294];return _0x304968;};'use strict';var Sequelize=require(_0x2b8d('0x0'));module['exports']={'key':{'type':Sequelize[_0x2b8d('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x2b8d('0x2')],'length':_0x2b8d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2b8d('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x2b8d('0x4'));}}};
\ No newline at end of file
+var _0x9e30=['TEXT','medium','VIRTUAL','getDataValue','key','exports','STRING'];(function(_0xfebf65,_0x2101b7){var _0x14e254=function(_0x568cf3){while(--_0x568cf3){_0xfebf65['push'](_0xfebf65['shift']());}};_0x14e254(++_0x2101b7);}(_0x9e30,0x1b7));var _0x09e3=function(_0x4668a6,_0x4e8a1f){_0x4668a6=_0x4668a6-0x0;var _0x23215d=_0x9e30[_0x4668a6];return _0x23215d;};'use strict';var Sequelize=require('sequelize');module[_0x09e3('0x0')]={'key':{'type':Sequelize[_0x09e3('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x09e3('0x2')],'length':_0x09e3('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x09e3('0x4')],'get':function(){return this[_0x09e3('0x5')](_0x09e3('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index c831b78..dfca12a 100644
--- a/server/api/cannedAnswer/cannedAnswer.controller.js
+++ b/server/api/cannedAnswer/cannedAnswer.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9119=['filter','merge','options','CannedAnswer','includeAll','findAll','catch','show','params','rawAttributes','include','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','CannedAnswers','UserProfileResource','end','error','name','send','index','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x221648,_0x2d46a5){var _0x3afc1f=function(_0x50ee4e){while(--_0x50ee4e){_0x221648['push'](_0x221648['shift']());}};_0x3afc1f(++_0x2d46a5);}(_0x9119,0x185));var _0x9911=function(_0x177b4b,_0x33f146){_0x177b4b=_0x177b4b-0x0;var _0x8ad94d=_0x9119[_0x177b4b];return _0x8ad94d;};'use strict';var emlformat=require(_0x9911('0x0'));var rimraf=require(_0x9911('0x1'));var zipdir=require(_0x9911('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9911('0x3'));var moment=require(_0x9911('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9911('0x5'));var util=require('util');var path=require(_0x9911('0x6'));var sox=require(_0x9911('0x7'));var csv=require(_0x9911('0x8'));var ejs=require(_0x9911('0x9'));var fs=require('fs');var fs_extra=require(_0x9911('0xa'));var _=require(_0x9911('0xb'));var squel=require(_0x9911('0xc'));var crypto=require(_0x9911('0xd'));var jsforce=require(_0x9911('0xe'));var deskjs=require(_0x9911('0xf'));var toCsv=require(_0x9911('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9911('0x10'));var authService=require(_0x9911('0x11'));var qs=require(_0x9911('0x12'));var as=require(_0x9911('0x13'));var hardwareService=require(_0x9911('0x14'));var logger=require(_0x9911('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9911('0x16'));var db=require(_0x9911('0x17'))['db'];function respondWithStatusCode(_0x2aaab2,_0x4ac66c){_0x4ac66c=_0x4ac66c||0xcc;return function(_0x419dac){if(_0x419dac){return _0x2aaab2[_0x9911('0x18')](_0x4ac66c);}return _0x2aaab2[_0x9911('0x19')](_0x4ac66c)['end']();};}function respondWithResult(_0x110ec6,_0xc28913){_0xc28913=_0xc28913||0xc8;return function(_0x38ebad){if(_0x38ebad){return _0x110ec6[_0x9911('0x19')](_0xc28913)[_0x9911('0x1a')](_0x38ebad);}};}function respondWithFilteredResult(_0x5dd660,_0x4c2a8d){return function(_0x56129e){if(_0x56129e){var _0x3f3ea5=typeof _0x4c2a8d[_0x9911('0x1b')]==='undefined'&&typeof _0x4c2a8d[_0x9911('0x1c')]==='undefined';var _0x293b66=_0x56129e[_0x9911('0x1d')];var _0x32af7c=_0x3f3ea5?0x0:_0x4c2a8d['offset'];var _0x16b395=_0x3f3ea5?_0x56129e[_0x9911('0x1d')]:_0x4c2a8d[_0x9911('0x1b')]+_0x4c2a8d['limit'];var _0x38a370;if(_0x16b395>=_0x293b66){_0x16b395=_0x293b66;_0x38a370=0xc8;}else{_0x38a370=0xce;}_0x5dd660[_0x9911('0x19')](_0x38a370);return _0x5dd660[_0x9911('0x1e')](_0x9911('0x1f'),_0x32af7c+'-'+_0x16b395+'/'+_0x293b66)[_0x9911('0x1a')](_0x56129e);}return null;};}function patchUpdates(_0x1d4dab){return function(_0x55a505){try{jsonpatch[_0x9911('0x20')](_0x55a505,_0x1d4dab,!![]);}catch(_0x26b38e){return BPromise[_0x9911('0x21')](_0x26b38e);}return _0x55a505[_0x9911('0x22')]();};}function saveUpdates(_0x4cff7c,_0x2221bc){return function(_0x31fe3c){if(_0x31fe3c){return _0x31fe3c['update'](_0x4cff7c)[_0x9911('0x23')](function(_0x333eb1){return _0x333eb1;});}return null;};}function removeEntity(_0x4a7888,_0x190b94){return function(_0x40117d){if(_0x40117d){return _0x40117d[_0x9911('0x24')]()['then'](function(){var _0x4915ef=_0x40117d['get']({'plain':!![]});var _0x5b8657=_0x9911('0x25');return db[_0x9911('0x26')]['destroy']({'where':{'type':_0x5b8657,'resourceId':_0x4915ef['id']}})[_0x9911('0x23')](function(){return _0x40117d;});})[_0x9911('0x23')](function(){_0x4a7888['status'](0xcc)[_0x9911('0x27')]();});}};}function handleEntityNotFound(_0xc8a03e,_0x1adcc0){return function(_0x5ec66c){if(!_0x5ec66c){_0xc8a03e[_0x9911('0x18')](0x194);}return _0x5ec66c;};}function handleError(_0x4a8bfc,_0x32bb80){_0x32bb80=_0x32bb80||0x1f4;return function(_0x4489f1){logger[_0x9911('0x28')](_0x4489f1['stack']);if(_0x4489f1[_0x9911('0x29')]){delete _0x4489f1[_0x9911('0x29')];}_0x4a8bfc[_0x9911('0x19')](_0x32bb80)[_0x9911('0x2a')](_0x4489f1);};}exports[_0x9911('0x2b')]=function(_0x37104f,_0x437567){var _0x4bc5da={},_0x412f09={},_0x24eeba={'count':0x0,'rows':[]};var _0x4eddbb=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x771f62){return{'name':_0x771f62[_0x9911('0x2c')],'type':_0x771f62[_0x9911('0x2d')][_0x9911('0x2e')]};});_0x412f09['model']=_['map'](_0x4eddbb,_0x9911('0x29'));_0x412f09[_0x9911('0x2f')]=_[_0x9911('0x30')](_0x37104f['query']);_0x412f09[_0x9911('0x31')]=_[_0x9911('0x32')](_0x412f09[_0x9911('0x33')],_0x412f09[_0x9911('0x2f')]);_0x4bc5da['attributes']=_[_0x9911('0x32')](_0x412f09[_0x9911('0x33')],qs[_0x9911('0x34')](_0x37104f[_0x9911('0x2f')][_0x9911('0x34')]));_0x4bc5da['attributes']=_0x4bc5da[_0x9911('0x35')][_0x9911('0x36')]?_0x4bc5da[_0x9911('0x35')]:_0x412f09[_0x9911('0x33')];if(!_0x37104f[_0x9911('0x2f')][_0x9911('0x37')](_0x9911('0x38'))){_0x4bc5da['limit']=qs[_0x9911('0x1c')](_0x37104f[_0x9911('0x2f')][_0x9911('0x1c')]);_0x4bc5da['offset']=qs[_0x9911('0x1b')](_0x37104f[_0x9911('0x2f')][_0x9911('0x1b')]);}_0x4bc5da[_0x9911('0x39')]=qs['sort'](_0x37104f[_0x9911('0x2f')][_0x9911('0x3a')]);_0x4bc5da[_0x9911('0x3b')]=qs[_0x9911('0x31')](_[_0x9911('0x3c')](_0x37104f[_0x9911('0x2f')],_0x412f09[_0x9911('0x31')]),_0x4eddbb);if(_0x37104f[_0x9911('0x2f')][_0x9911('0x3d')]){_0x4bc5da[_0x9911('0x3b')]=_[_0x9911('0x3e')](_0x4bc5da[_0x9911('0x3b')],{'$or':[{'key':{'$like':'%'+_0x37104f[_0x9911('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0x37104f['query'][_0x9911('0x3d')]+'%'}}]});}_0x4bc5da=_[_0x9911('0x3e')]({},_0x4bc5da,_0x37104f[_0x9911('0x3f')]);var _0x8d75f8={'where':_0x4bc5da[_0x9911('0x3b')]};return db[_0x9911('0x40')]['count'](_0x8d75f8)['then'](function(_0x367e02){_0x24eeba[_0x9911('0x1d')]=_0x367e02;if(_0x37104f[_0x9911('0x2f')][_0x9911('0x41')]){_0x4bc5da['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x9911('0x42')](_0x4bc5da);})[_0x9911('0x23')](function(_0x7521e8){_0x24eeba['rows']=_0x7521e8;return _0x24eeba;})['then'](respondWithFilteredResult(_0x437567,_0x4bc5da))[_0x9911('0x43')](handleError(_0x437567,null));};exports[_0x9911('0x44')]=function(_0xc6694e,_0x852582){var _0x212df1={'raw':!![],'where':{'id':_0xc6694e[_0x9911('0x45')]['id']}},_0x52ea2c={};_0x52ea2c[_0x9911('0x33')]=_[_0x9911('0x30')](db['CannedAnswer'][_0x9911('0x46')]);_0x52ea2c[_0x9911('0x2f')]=_[_0x9911('0x30')](_0xc6694e[_0x9911('0x2f')]);_0x52ea2c[_0x9911('0x31')]=_[_0x9911('0x32')](_0x52ea2c['model'],_0x52ea2c[_0x9911('0x2f')]);_0x212df1[_0x9911('0x35')]=_[_0x9911('0x32')](_0x52ea2c[_0x9911('0x33')],qs[_0x9911('0x34')](_0xc6694e[_0x9911('0x2f')][_0x9911('0x34')]));_0x212df1[_0x9911('0x35')]=_0x212df1[_0x9911('0x35')][_0x9911('0x36')]?_0x212df1[_0x9911('0x35')]:_0x52ea2c[_0x9911('0x33')];if(_0xc6694e[_0x9911('0x2f')][_0x9911('0x41')]){_0x212df1[_0x9911('0x47')]=[{'all':!![]}];}_0x212df1=_['merge']({},_0x212df1,_0xc6694e[_0x9911('0x3f')]);return db[_0x9911('0x40')][_0x9911('0x48')](_0x212df1)[_0x9911('0x23')](handleEntityNotFound(_0x852582,null))['then'](respondWithResult(_0x852582,null))['catch'](handleError(_0x852582,null));};exports[_0x9911('0x49')]=function(_0x2a00c5,_0x3db21d){if(_0x2a00c5[_0x9911('0x4a')]['id']){delete _0x2a00c5[_0x9911('0x4a')]['id'];}return db[_0x9911('0x40')][_0x9911('0x48')]({'where':{'id':_0x2a00c5[_0x9911('0x45')]['id']}})[_0x9911('0x23')](handleEntityNotFound(_0x3db21d,null))[_0x9911('0x23')](saveUpdates(_0x2a00c5[_0x9911('0x4a')],null))[_0x9911('0x23')](respondWithResult(_0x3db21d,null))[_0x9911('0x43')](handleError(_0x3db21d,null));};exports[_0x9911('0x24')]=function(_0x23b60e,_0x2eb18a){return db['CannedAnswer'][_0x9911('0x48')]({'where':{'id':_0x23b60e[_0x9911('0x45')]['id']}})[_0x9911('0x23')](handleEntityNotFound(_0x2eb18a,null))[_0x9911('0x23')](removeEntity(_0x2eb18a,null))[_0x9911('0x43')](handleError(_0x2eb18a,null));};exports[_0x9911('0x4b')]=function(_0x579cba,_0x552fd4){var _0x5cae87={'key':_0x579cba[_0x9911('0x4a')][_0x9911('0x2e')]};if(_0x579cba[_0x9911('0x4a')]['MailAccountId']){_0x5cae87[_0x9911('0x4c')]=_0x579cba[_0x9911('0x4a')][_0x9911('0x4c')];}else if(_0x579cba[_0x9911('0x4a')][_0x9911('0x4d')]){_0x5cae87['SmsAccountId']=_0x579cba[_0x9911('0x4a')][_0x9911('0x4d')];}else if(_0x579cba[_0x9911('0x4a')][_0x9911('0x4e')]){_0x5cae87[_0x9911('0x4e')]=_0x579cba['body'][_0x9911('0x4e')];}else if(_0x579cba[_0x9911('0x4a')]['ChatWebsiteId']){_0x5cae87[_0x9911('0x4f')]=_0x579cba[_0x9911('0x4a')][_0x9911('0x4f')];}return db[_0x9911('0x40')][_0x9911('0x48')]({'where':_0x5cae87})[_0x9911('0x23')](function(_0x418326){if(_0x418326){throw new db[(_0x9911('0x50'))][(_0x9911('0x51'))](_0x9911('0x52'));}return db[_0x9911('0x40')][_0x9911('0x4b')](_0x579cba['body']);})['then'](function(_0x4ef15f){var _0x10dbf6=_0x579cba['user']['get']({'plain':!![]});if(!_0x10dbf6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10dbf6[_0x9911('0x53')]===_0x9911('0x54')){var _0x4d2fa0=_0x4ef15f[_0x9911('0x55')]({'plain':!![]});return db[_0x9911('0x56')]['find']({'where':{'name':_0x9911('0x25'),'userProfileId':_0x10dbf6[_0x9911('0x57')]},'raw':!![]})[_0x9911('0x23')](function(_0x54f545){if(_0x54f545&&_0x54f545[_0x9911('0x58')]===0x0){return db[_0x9911('0x26')][_0x9911('0x4b')]({'name':_0x4d2fa0['name'],'resourceId':_0x4d2fa0['id'],'type':_0x54f545[_0x9911('0x29')],'sectionId':_0x54f545['id']},{})[_0x9911('0x23')](function(){return _0x4ef15f;});}else{return _0x4ef15f;}})[_0x9911('0x43')](function(_0x5e3ba2){logger[_0x9911('0x28')](_0x9911('0x59'),_0x5e3ba2);throw _0x5e3ba2;});}return _0x4ef15f;})[_0x9911('0x23')](respondWithResult(_0x552fd4,0xc9))[_0x9911('0x43')](handleError(_0x552fd4,null));};
\ No newline at end of file
+var _0x4994=['The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','get','CannedAnswers','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','options','CannedAnswer','findAll','rows','catch','show','params','includeAll','merge','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError'];(function(_0x41b7bd,_0x2ece4c){var _0x4abfc0=function(_0x26368d){while(--_0x26368d){_0x41b7bd['push'](_0x41b7bd['shift']());}};_0x4abfc0(++_0x2ece4c);}(_0x4994,0x117));var _0x4499=function(_0x384392,_0x46ded5){_0x384392=_0x384392-0x0;var _0x148f47=_0x4994[_0x384392];return _0x148f47;};'use strict';var emlformat=require(_0x4499('0x0'));var rimraf=require(_0x4499('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4499('0x2'));var rp=require(_0x4499('0x3'));var moment=require(_0x4499('0x4'));var BPromise=require(_0x4499('0x5'));var Mustache=require(_0x4499('0x6'));var util=require(_0x4499('0x7'));var path=require(_0x4499('0x8'));var sox=require('sox');var csv=require(_0x4499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4499('0xa'));var crypto=require(_0x4499('0xb'));var jsforce=require(_0x4499('0xc'));var deskjs=require(_0x4499('0xd'));var toCsv=require(_0x4499('0x9'));var querystring=require(_0x4499('0xe'));var Papa=require(_0x4499('0xf'));var Redis=require('ioredis');var authService=require(_0x4499('0x10'));var qs=require(_0x4499('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4499('0x12'));var logger=require(_0x4499('0x13'))('api');var utils=require(_0x4499('0x14'));var config=require(_0x4499('0x15'));var licenseUtil=require(_0x4499('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db1b2,_0x5b04ed){_0x5b04ed=_0x5b04ed||0xcc;return function(_0x53a3c8){if(_0x53a3c8){return _0x4db1b2[_0x4499('0x17')](_0x5b04ed);}return _0x4db1b2['status'](_0x5b04ed)[_0x4499('0x18')]();};}function respondWithResult(_0x5eef37,_0xeb3e99){_0xeb3e99=_0xeb3e99||0xc8;return function(_0x9298ef){if(_0x9298ef){return _0x5eef37[_0x4499('0x19')](_0xeb3e99)[_0x4499('0x1a')](_0x9298ef);}};}function respondWithFilteredResult(_0x5dc9bb,_0x1b5780){return function(_0x2cb249){if(_0x2cb249){var _0x1e0776=typeof _0x1b5780['offset']===_0x4499('0x1b')&&typeof _0x1b5780[_0x4499('0x1c')]===_0x4499('0x1b');var _0x11893c=_0x2cb249['count'];var _0x313d62=_0x1e0776?0x0:_0x1b5780['offset'];var _0x2fb115=_0x1e0776?_0x2cb249[_0x4499('0x1d')]:_0x1b5780[_0x4499('0x1e')]+_0x1b5780['limit'];var _0x1a1fd6;if(_0x2fb115>=_0x11893c){_0x2fb115=_0x11893c;_0x1a1fd6=0xc8;}else{_0x1a1fd6=0xce;}_0x5dc9bb['status'](_0x1a1fd6);return _0x5dc9bb[_0x4499('0x1f')](_0x4499('0x20'),_0x313d62+'-'+_0x2fb115+'/'+_0x11893c)[_0x4499('0x1a')](_0x2cb249);}return null;};}function patchUpdates(_0x51f1f8){return function(_0x2e23b7){try{jsonpatch[_0x4499('0x21')](_0x2e23b7,_0x51f1f8,!![]);}catch(_0x5a13e6){return BPromise[_0x4499('0x22')](_0x5a13e6);}return _0x2e23b7['save']();};}function saveUpdates(_0x2a3bde,_0x207abf){return function(_0x4b9979){if(_0x4b9979){return _0x4b9979['update'](_0x2a3bde)[_0x4499('0x23')](function(_0x265b3f){return _0x265b3f;});}return null;};}function removeEntity(_0x480664,_0x344f96){return function(_0x376862){if(_0x376862){return _0x376862[_0x4499('0x24')]()[_0x4499('0x23')](function(){var _0x527fcf=_0x376862[_0x4499('0x25')]({'plain':!![]});var _0xd161d2=_0x4499('0x26');return db['UserProfileResource'][_0x4499('0x24')]({'where':{'type':_0xd161d2,'resourceId':_0x527fcf['id']}})[_0x4499('0x23')](function(){return _0x376862;});})[_0x4499('0x23')](function(){_0x480664[_0x4499('0x19')](0xcc)[_0x4499('0x18')]();});}};}function handleEntityNotFound(_0x49137a,_0x3ac8d9){return function(_0x4e5aeb){if(!_0x4e5aeb){_0x49137a['sendStatus'](0x194);}return _0x4e5aeb;};}function handleError(_0x93dc8,_0x2759db){_0x2759db=_0x2759db||0x1f4;return function(_0xeaa6b7){logger[_0x4499('0x27')](_0xeaa6b7[_0x4499('0x28')]);if(_0xeaa6b7['name']){delete _0xeaa6b7[_0x4499('0x29')];}_0x93dc8[_0x4499('0x19')](_0x2759db)[_0x4499('0x2a')](_0xeaa6b7);};}exports[_0x4499('0x2b')]=function(_0x3fb9a3,_0x1bda41){var _0x27ce9c={},_0x155d94={},_0x5f2d13={'count':0x0,'rows':[]};var _0x1a1cf5=_[_0x4499('0x2c')](db['CannedAnswer'][_0x4499('0x2d')],function(_0x47bbfe){return{'name':_0x47bbfe[_0x4499('0x2e')],'type':_0x47bbfe[_0x4499('0x2f')][_0x4499('0x30')]};});_0x155d94[_0x4499('0x31')]=_[_0x4499('0x2c')](_0x1a1cf5,_0x4499('0x29'));_0x155d94[_0x4499('0x32')]=_[_0x4499('0x33')](_0x3fb9a3['query']);_0x155d94[_0x4499('0x34')]=_[_0x4499('0x35')](_0x155d94[_0x4499('0x31')],_0x155d94[_0x4499('0x32')]);_0x27ce9c['attributes']=_[_0x4499('0x35')](_0x155d94[_0x4499('0x31')],qs[_0x4499('0x36')](_0x3fb9a3[_0x4499('0x32')][_0x4499('0x36')]));_0x27ce9c[_0x4499('0x37')]=_0x27ce9c[_0x4499('0x37')][_0x4499('0x38')]?_0x27ce9c[_0x4499('0x37')]:_0x155d94[_0x4499('0x31')];if(!_0x3fb9a3[_0x4499('0x32')][_0x4499('0x39')](_0x4499('0x3a'))){_0x27ce9c[_0x4499('0x1c')]=qs[_0x4499('0x1c')](_0x3fb9a3['query'][_0x4499('0x1c')]);_0x27ce9c[_0x4499('0x1e')]=qs[_0x4499('0x1e')](_0x3fb9a3[_0x4499('0x32')][_0x4499('0x1e')]);}_0x27ce9c[_0x4499('0x3b')]=qs[_0x4499('0x3c')](_0x3fb9a3[_0x4499('0x32')][_0x4499('0x3c')]);_0x27ce9c[_0x4499('0x3d')]=qs[_0x4499('0x34')](_['pick'](_0x3fb9a3[_0x4499('0x32')],_0x155d94[_0x4499('0x34')]),_0x1a1cf5);if(_0x3fb9a3[_0x4499('0x32')]['filter']){_0x27ce9c[_0x4499('0x3d')]=_['merge'](_0x27ce9c[_0x4499('0x3d')],{'$or':[{'key':{'$like':'%'+_0x3fb9a3[_0x4499('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x3fb9a3[_0x4499('0x32')][_0x4499('0x3e')]+'%'}}]});}_0x27ce9c=_['merge']({},_0x27ce9c,_0x3fb9a3[_0x4499('0x3f')]);var _0x273ce6={'where':_0x27ce9c[_0x4499('0x3d')]};return db[_0x4499('0x40')][_0x4499('0x1d')](_0x273ce6)[_0x4499('0x23')](function(_0x33034f){_0x5f2d13[_0x4499('0x1d')]=_0x33034f;if(_0x3fb9a3[_0x4499('0x32')]['includeAll']){_0x27ce9c['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x4499('0x41')](_0x27ce9c);})[_0x4499('0x23')](function(_0x3fd6fb){_0x5f2d13[_0x4499('0x42')]=_0x3fd6fb;return _0x5f2d13;})[_0x4499('0x23')](respondWithFilteredResult(_0x1bda41,_0x27ce9c))[_0x4499('0x43')](handleError(_0x1bda41,null));};exports[_0x4499('0x44')]=function(_0x4ae052,_0x18c26f){var _0x4faf3b={'raw':!![],'where':{'id':_0x4ae052[_0x4499('0x45')]['id']}},_0x5928d3={};_0x5928d3[_0x4499('0x31')]=_[_0x4499('0x33')](db[_0x4499('0x40')][_0x4499('0x2d')]);_0x5928d3[_0x4499('0x32')]=_[_0x4499('0x33')](_0x4ae052[_0x4499('0x32')]);_0x5928d3['filters']=_['intersection'](_0x5928d3[_0x4499('0x31')],_0x5928d3[_0x4499('0x32')]);_0x4faf3b[_0x4499('0x37')]=_[_0x4499('0x35')](_0x5928d3[_0x4499('0x31')],qs['fields'](_0x4ae052['query']['fields']));_0x4faf3b[_0x4499('0x37')]=_0x4faf3b[_0x4499('0x37')][_0x4499('0x38')]?_0x4faf3b[_0x4499('0x37')]:_0x5928d3[_0x4499('0x31')];if(_0x4ae052[_0x4499('0x32')][_0x4499('0x46')]){_0x4faf3b['include']=[{'all':!![]}];}_0x4faf3b=_[_0x4499('0x47')]({},_0x4faf3b,_0x4ae052[_0x4499('0x3f')]);return db[_0x4499('0x40')][_0x4499('0x48')](_0x4faf3b)[_0x4499('0x23')](handleEntityNotFound(_0x18c26f,null))[_0x4499('0x23')](respondWithResult(_0x18c26f,null))[_0x4499('0x43')](handleError(_0x18c26f,null));};exports[_0x4499('0x49')]=function(_0x3eb3ab,_0x5b4cdd){if(_0x3eb3ab['body']['id']){delete _0x3eb3ab['body']['id'];}return db[_0x4499('0x40')][_0x4499('0x48')]({'where':{'id':_0x3eb3ab['params']['id']}})[_0x4499('0x23')](handleEntityNotFound(_0x5b4cdd,null))[_0x4499('0x23')](saveUpdates(_0x3eb3ab[_0x4499('0x4a')],null))[_0x4499('0x23')](respondWithResult(_0x5b4cdd,null))['catch'](handleError(_0x5b4cdd,null));};exports[_0x4499('0x24')]=function(_0x4a23b1,_0x200c1b){return db[_0x4499('0x40')][_0x4499('0x48')]({'where':{'id':_0x4a23b1[_0x4499('0x45')]['id']}})[_0x4499('0x23')](handleEntityNotFound(_0x200c1b,null))[_0x4499('0x23')](removeEntity(_0x200c1b,null))[_0x4499('0x43')](handleError(_0x200c1b,null));};exports[_0x4499('0x4b')]=function(_0x38444c,_0x462ea9){var _0x28af17={'key':_0x38444c[_0x4499('0x4a')][_0x4499('0x30')]};if(_0x38444c[_0x4499('0x4a')]['MailAccountId']){_0x28af17[_0x4499('0x4c')]=_0x38444c[_0x4499('0x4a')][_0x4499('0x4c')];}else if(_0x38444c[_0x4499('0x4a')]['SmsAccountId']){_0x28af17[_0x4499('0x4d')]=_0x38444c[_0x4499('0x4a')][_0x4499('0x4d')];}else if(_0x38444c['body'][_0x4499('0x4e')]){_0x28af17[_0x4499('0x4e')]=_0x38444c[_0x4499('0x4a')][_0x4499('0x4e')];}else if(_0x38444c[_0x4499('0x4a')][_0x4499('0x4f')]){_0x28af17[_0x4499('0x4f')]=_0x38444c[_0x4499('0x4a')][_0x4499('0x4f')];}return db[_0x4499('0x40')]['find']({'where':_0x28af17})[_0x4499('0x23')](function(_0x120aeb){if(_0x120aeb){throw new db['Sequelize'][(_0x4499('0x50'))](_0x4499('0x51'));}return db[_0x4499('0x40')][_0x4499('0x4b')](_0x38444c[_0x4499('0x4a')]);})[_0x4499('0x23')](function(_0x99466b){var _0xbf84ad=_0x38444c[_0x4499('0x52')][_0x4499('0x25')]({'plain':!![]});if(!_0xbf84ad)throw new Error(_0x4499('0x53'));if(_0xbf84ad[_0x4499('0x54')]==='user'){var _0x250bfd=_0x99466b[_0x4499('0x25')]({'plain':!![]});return db[_0x4499('0x55')][_0x4499('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0xbf84ad[_0x4499('0x56')]},'raw':!![]})[_0x4499('0x23')](function(_0x43c697){if(_0x43c697&&_0x43c697[_0x4499('0x57')]===0x0){return db[_0x4499('0x58')][_0x4499('0x4b')]({'name':_0x250bfd[_0x4499('0x29')],'resourceId':_0x250bfd['id'],'type':_0x43c697[_0x4499('0x29')],'sectionId':_0x43c697['id']},{})['then'](function(){return _0x99466b;});}else{return _0x99466b;}})[_0x4499('0x43')](function(_0xb2395e){logger[_0x4499('0x27')](_0x4499('0x59'),_0xb2395e);throw _0xb2395e;});}return _0x99466b;})[_0x4499('0x23')](respondWithResult(_0x462ea9,0xc9))[_0x4499('0x43')](handleError(_0x462ea9,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index ad90199..c7f1ae4 100644
--- a/server/api/cannedAnswer/cannedAnswer.model.js
+++ b/server/api/cannedAnswer/cannedAnswer.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2e1=['./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3771eb,_0x2361c7){var _0x3e4a02=function(_0x5eb364){while(--_0x5eb364){_0x3771eb['push'](_0x3771eb['shift']());}};_0x3e4a02(++_0x2361c7);}(_0xc2e1,0x1b3));var _0x1c2e=function(_0x1a3f08,_0x1ac9e0){_0x1a3f08=_0x1a3f08-0x0;var _0x2057f6=_0xc2e1[_0x1a3f08];return _0x2057f6;};'use strict';var _=require(_0x1c2e('0x0'));var util=require('util');var logger=require(_0x1c2e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1c2e('0x2'));var rp=require(_0x1c2e('0x3'));var fs=require('fs');var path=require(_0x1c2e('0x4'));var rimraf=require(_0x1c2e('0x5'));var config=require(_0x1c2e('0x6'));var attributes=require(_0x1c2e('0x7'));module[_0x1c2e('0x8')]=function(_0x237fa8,_0x31a7df){return _0x237fa8[_0x1c2e('0x9')]('CannedAnswer',attributes,{'tableName':_0x1c2e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1c2e('0xb'),'collate':_0x1c2e('0xc')});};
\ No newline at end of file
+var _0x3cab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','utf8mb4_unicode_ci'];(function(_0x2d1290,_0xc13145){var _0x861ae2=function(_0x1abac0){while(--_0x1abac0){_0x2d1290['push'](_0x2d1290['shift']());}};_0x861ae2(++_0xc13145);}(_0x3cab,0x1bc));var _0xb3ca=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x3cab[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xb3ca('0x0'));var util=require(_0xb3ca('0x1'));var logger=require(_0xb3ca('0x2'))(_0xb3ca('0x3'));var moment=require(_0xb3ca('0x4'));var BPromise=require(_0xb3ca('0x5'));var rp=require(_0xb3ca('0x6'));var fs=require('fs');var path=require(_0xb3ca('0x7'));var rimraf=require('rimraf');var config=require(_0xb3ca('0x8'));var attributes=require(_0xb3ca('0x9'));module[_0xb3ca('0xa')]=function(_0x462312,_0x327f7f){return _0x462312['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb3ca('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 31bea5c..6f0cf8e 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x181431,_0x414c32){var _0xc0536=function(_0x26a622){while(--_0x26a622){_0x181431['push'](_0x181431['shift']());}};_0xc0536(++_0x414c32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16c4a5,_0x4ce71c){var _0x454081=function(_0x640fc){while(--_0x640fc){_0x16c4a5['push'](_0x16c4a5['shift']());}};_0x454081(++_0x4ce71c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 0e89e92..537ea29 100644
--- a/server/api/cannedAnswer/index.js
+++ b/server/api/cannedAnswer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9eb9=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x59a0f3,_0x1828e9){var _0x31ea30=function(_0x213711){while(--_0x213711){_0x59a0f3['push'](_0x59a0f3['shift']());}};_0x31ea30(++_0x1828e9);}(_0x9eb9,0x10c));var _0x99eb=function(_0x5a4bf8,_0x131755){_0x5a4bf8=_0x5a4bf8-0x0;var _0x4c0bb3=_0x9eb9[_0x5a4bf8];return _0x4c0bb3;};'use strict';var multer=require(_0x99eb('0x0'));var util=require(_0x99eb('0x1'));var path=require(_0x99eb('0x2'));var timeout=require(_0x99eb('0x3'));var express=require(_0x99eb('0x4'));var router=express[_0x99eb('0x5')]();var fs_extra=require(_0x99eb('0x6'));var auth=require(_0x99eb('0x7'));var interaction=require(_0x99eb('0x8'));var config=require(_0x99eb('0x9'));var controller=require(_0x99eb('0xa'));router[_0x99eb('0xb')]('/',auth[_0x99eb('0xc')](),controller[_0x99eb('0xd')]);router[_0x99eb('0xb')]('/:id',auth[_0x99eb('0xc')](),controller[_0x99eb('0xe')]);router[_0x99eb('0xf')]('/',auth[_0x99eb('0xc')](),controller[_0x99eb('0x10')]);router[_0x99eb('0x11')](_0x99eb('0x12'),auth[_0x99eb('0xc')](),controller[_0x99eb('0x13')]);router[_0x99eb('0x14')](_0x99eb('0x12'),auth[_0x99eb('0xc')](),controller[_0x99eb('0x15')]);module[_0x99eb('0x16')]=router;
\ No newline at end of file
+var _0x5cfa=['exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x299c5d,_0x205212){var _0x1985fe=function(_0x286592){while(--_0x286592){_0x299c5d['push'](_0x299c5d['shift']());}};_0x1985fe(++_0x205212);}(_0x5cfa,0x1d5));var _0xa5cf=function(_0x43bcaf,_0x1f439b){_0x43bcaf=_0x43bcaf-0x0;var _0x5e8ba2=_0x5cfa[_0x43bcaf];return _0x5e8ba2;};'use strict';var multer=require('multer');var util=require(_0xa5cf('0x0'));var path=require(_0xa5cf('0x1'));var timeout=require(_0xa5cf('0x2'));var express=require(_0xa5cf('0x3'));var router=express['Router']();var fs_extra=require(_0xa5cf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa5cf('0x5'));var config=require(_0xa5cf('0x6'));var controller=require(_0xa5cf('0x7'));router['get']('/',auth[_0xa5cf('0x8')](),controller[_0xa5cf('0x9')]);router['get'](_0xa5cf('0xa'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0xb')]);router[_0xa5cf('0xc')]('/',auth[_0xa5cf('0x8')](),controller[_0xa5cf('0xd')]);router[_0xa5cf('0xe')](_0xa5cf('0xa'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0xf')]);router[_0xa5cf('0x10')](_0xa5cf('0xa'),auth[_0xa5cf('0x8')](),controller['destroy']);module[_0xa5cf('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index f43b2b3..f769ef1 100644
--- a/server/api/cdr/cdr.attributes.js
+++ b/server/api/cdr/cdr.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5271=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x553019,_0x5dd7b9){var _0x2bc10e=function(_0x365bd4){while(--_0x365bd4){_0x553019['push'](_0x553019['shift']());}};_0x2bc10e(++_0x5dd7b9);}(_0x5271,0xa0));var _0x1527=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x5271[_0x5cb1af];return _0x8d7940;};'use strict';var Sequelize=require(_0x1527('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x1527('0x1')],'allowNull':![],'defaultValue':_0x1527('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x1527('0x3')]},'dst':{'type':Sequelize[_0x1527('0x3')]},'dcontext':{'type':Sequelize[_0x1527('0x3')]},'channel':{'type':Sequelize[_0x1527('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x1527('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x1527('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1527('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1527('0x3')]},'uniqueid':{'type':Sequelize[_0x1527('0x3')]},'linkedid':{'type':Sequelize[_0x1527('0x3')]},'sequence':{'type':Sequelize[_0x1527('0x3')]},'peeraccount':{'type':Sequelize[_0x1527('0x3')]},'type':{'type':Sequelize[_0x1527('0x3')]},'tag':{'type':Sequelize[_0x1527('0x3')]}};
\ No newline at end of file
+var _0xe1bf=['1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x1e3fb3,_0x156869){var _0x4db740=function(_0x4b5303){while(--_0x4b5303){_0x1e3fb3['push'](_0x1e3fb3['shift']());}};_0x4db740(++_0x156869);}(_0xe1bf,0x67));var _0xfe1b=function(_0x32ae13,_0x8c267a){_0x32ae13=_0x32ae13-0x0;var _0x4b78d8=_0xe1bf[_0x32ae13];return _0x4b78d8;};'use strict';var Sequelize=require('sequelize');module[_0xfe1b('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xfe1b('0x1')},'clid':{'type':Sequelize[_0xfe1b('0x2')]},'src':{'type':Sequelize[_0xfe1b('0x2')]},'dst':{'type':Sequelize[_0xfe1b('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfe1b('0x2')]},'dstchannel':{'type':Sequelize[_0xfe1b('0x2')]},'lastapp':{'type':Sequelize[_0xfe1b('0x2')]},'lastdata':{'type':Sequelize[_0xfe1b('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xfe1b('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfe1b('0x2')]},'amaflags':{'type':Sequelize[_0xfe1b('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xfe1b('0x2')]},'uniqueid':{'type':Sequelize[_0xfe1b('0x2')]},'linkedid':{'type':Sequelize[_0xfe1b('0x2')]},'sequence':{'type':Sequelize[_0xfe1b('0x2')]},'peeraccount':{'type':Sequelize[_0xfe1b('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xfe1b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 80ff259..98425b3 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x86f4=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Cdr','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x17ed0e,_0x266562){var _0x16c92a=function(_0x28b59b){while(--_0x28b59b){_0x17ed0e['push'](_0x17ed0e['shift']());}};_0x16c92a(++_0x266562);}(_0x86f4,0x18a));var _0x486f=function(_0x43c7fa,_0x19eba1){_0x43c7fa=_0x43c7fa-0x0;var _0x42bf81=_0x86f4[_0x43c7fa];return _0x42bf81;};'use strict';var emlformat=require(_0x486f('0x0'));var rimraf=require(_0x486f('0x1'));var zipdir=require(_0x486f('0x2'));var jsonpatch=require(_0x486f('0x3'));var rp=require(_0x486f('0x4'));var moment=require(_0x486f('0x5'));var BPromise=require(_0x486f('0x6'));var Mustache=require('mustache');var util=require(_0x486f('0x7'));var path=require(_0x486f('0x8'));var sox=require('sox');var csv=require(_0x486f('0x9'));var ejs=require(_0x486f('0xa'));var fs=require('fs');var fs_extra=require(_0x486f('0xb'));var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0x9'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var licenseUtil=require(_0x486f('0x1b'));var db=require(_0x486f('0x1c'))['db'];function respondWithStatusCode(_0x4312fb,_0x1c4e55){_0x1c4e55=_0x1c4e55||0xcc;return function(_0x4eb4f9){if(_0x4eb4f9){return _0x4312fb[_0x486f('0x1d')](_0x1c4e55);}return _0x4312fb['status'](_0x1c4e55)[_0x486f('0x1e')]();};}function respondWithResult(_0x2cc608,_0x1ac871){_0x1ac871=_0x1ac871||0xc8;return function(_0x50bee8){if(_0x50bee8){return _0x2cc608['status'](_0x1ac871)[_0x486f('0x1f')](_0x50bee8);}};}function respondWithFilteredResult(_0x3a4fef,_0x51334f){return function(_0x16830e){if(_0x16830e){var _0x2ab753=typeof _0x51334f[_0x486f('0x20')]==='undefined'&&typeof _0x51334f['limit']===_0x486f('0x21');var _0x3eeae0=_0x16830e[_0x486f('0x22')];var _0x39bfac=_0x2ab753?0x0:_0x51334f['offset'];var _0x59deb8=_0x2ab753?_0x16830e[_0x486f('0x22')]:_0x51334f[_0x486f('0x20')]+_0x51334f[_0x486f('0x23')];var _0x20a1f7;if(_0x59deb8>=_0x3eeae0){_0x59deb8=_0x3eeae0;_0x20a1f7=0xc8;}else{_0x20a1f7=0xce;}_0x3a4fef[_0x486f('0x24')](_0x20a1f7);return _0x3a4fef[_0x486f('0x25')](_0x486f('0x26'),_0x39bfac+'-'+_0x59deb8+'/'+_0x3eeae0)[_0x486f('0x1f')](_0x16830e);}return null;};}function patchUpdates(_0xe0b1cc){return function(_0x3d79bc){try{jsonpatch[_0x486f('0x27')](_0x3d79bc,_0xe0b1cc,!![]);}catch(_0x4ccac0){return BPromise[_0x486f('0x28')](_0x4ccac0);}return _0x3d79bc[_0x486f('0x29')]();};}function saveUpdates(_0x26a909,_0x4a0eb5){return function(_0x4d784e){if(_0x4d784e){return _0x4d784e[_0x486f('0x2a')](_0x26a909)[_0x486f('0x2b')](function(_0x16a530){return _0x16a530;});}return null;};}function removeEntity(_0x14b309,_0x351f81){return function(_0x26822b){if(_0x26822b){return _0x26822b[_0x486f('0x2c')]()[_0x486f('0x2b')](function(){_0x14b309[_0x486f('0x24')](0xcc)[_0x486f('0x1e')]();});}};}function handleEntityNotFound(_0x2e983b,_0x71a26f){return function(_0x387462){if(!_0x387462){_0x2e983b[_0x486f('0x1d')](0x194);}return _0x387462;};}function handleError(_0x8b3277,_0x30b322){_0x30b322=_0x30b322||0x1f4;return function(_0x6f1e8e){logger[_0x486f('0x2d')](_0x6f1e8e[_0x486f('0x2e')]);if(_0x6f1e8e[_0x486f('0x2f')]){delete _0x6f1e8e[_0x486f('0x2f')];}_0x8b3277[_0x486f('0x24')](_0x30b322)['send'](_0x6f1e8e);};}exports['index']=function(_0x52fb3a,_0x5b4718){var _0x173512={},_0x5c994a={},_0x2003a3={'count':0x0,'rows':[]};var _0x3ffa45=_['map'](db[_0x486f('0x30')]['rawAttributes'],function(_0x1f9dee){return{'name':_0x1f9dee[_0x486f('0x31')],'type':_0x1f9dee[_0x486f('0x32')][_0x486f('0x33')]};});_0x5c994a[_0x486f('0x34')]=_[_0x486f('0x35')](_0x3ffa45,'name');_0x5c994a[_0x486f('0x36')]=_[_0x486f('0x37')](_0x52fb3a[_0x486f('0x36')]);_0x5c994a[_0x486f('0x38')]=_[_0x486f('0x39')](_0x5c994a[_0x486f('0x34')],_0x5c994a[_0x486f('0x36')]);_0x173512[_0x486f('0x3a')]=_['intersection'](_0x5c994a[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x52fb3a['query'][_0x486f('0x3b')]));_0x173512[_0x486f('0x3a')]=_0x173512[_0x486f('0x3a')][_0x486f('0x3c')]?_0x173512[_0x486f('0x3a')]:_0x5c994a['model'];if(!_0x52fb3a[_0x486f('0x36')][_0x486f('0x3d')](_0x486f('0x3e'))){_0x173512[_0x486f('0x23')]=qs[_0x486f('0x23')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x23')]);_0x173512['offset']=qs[_0x486f('0x20')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x20')]);}_0x173512['order']=qs['sort'](_0x52fb3a[_0x486f('0x36')][_0x486f('0x3f')]);_0x173512['where']=qs[_0x486f('0x38')](_['pick'](_0x52fb3a[_0x486f('0x36')],_0x5c994a[_0x486f('0x38')]),_0x3ffa45);if(_0x52fb3a['query']['filter']){_0x173512[_0x486f('0x40')]=_[_0x486f('0x41')](_0x173512[_0x486f('0x40')],{'$or':_[_0x486f('0x35')](_0x3ffa45,function(_0xdedd85){if(_0xdedd85[_0x486f('0x32')]!==_0x486f('0x42')){var _0x1742e0={};_0x1742e0[_0xdedd85[_0x486f('0x2f')]]={'$like':'%'+_0x52fb3a[_0x486f('0x36')][_0x486f('0x43')]+'%'};return _0x1742e0;}})});}_0x173512=_[_0x486f('0x41')]({},_0x173512,_0x52fb3a[_0x486f('0x44')]);var _0x43d9be={'where':_0x173512['where']};return db[_0x486f('0x30')][_0x486f('0x22')](_0x43d9be)['then'](function(_0x12f7dc){_0x2003a3[_0x486f('0x22')]=_0x12f7dc;if(_0x52fb3a[_0x486f('0x36')][_0x486f('0x45')]){_0x173512[_0x486f('0x46')]=[{'all':!![]}];}return db[_0x486f('0x30')][_0x486f('0x47')](_0x173512);})[_0x486f('0x2b')](function(_0x3205e0){_0x2003a3['rows']=_0x3205e0;return _0x2003a3;})['then'](respondWithFilteredResult(_0x5b4718,_0x173512))[_0x486f('0x48')](handleError(_0x5b4718,null));};exports[_0x486f('0x49')]=function(_0x3cf897,_0x42ef68){var _0x2937a6={'raw':!![],'where':{'id':_0x3cf897[_0x486f('0x4a')]['id']}},_0x250979={};_0x250979[_0x486f('0x34')]=_[_0x486f('0x37')](db['Cdr'][_0x486f('0x4b')]);_0x250979[_0x486f('0x36')]=_[_0x486f('0x37')](_0x3cf897[_0x486f('0x36')]);_0x250979['filters']=_[_0x486f('0x39')](_0x250979['model'],_0x250979[_0x486f('0x36')]);_0x2937a6[_0x486f('0x3a')]=_[_0x486f('0x39')](_0x250979[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x3cf897[_0x486f('0x36')]['fields']));_0x2937a6['attributes']=_0x2937a6[_0x486f('0x3a')][_0x486f('0x3c')]?_0x2937a6[_0x486f('0x3a')]:_0x250979[_0x486f('0x34')];if(_0x3cf897['query'][_0x486f('0x45')]){_0x2937a6[_0x486f('0x46')]=[{'all':!![]}];}_0x2937a6=_[_0x486f('0x41')]({},_0x2937a6,_0x3cf897['options']);return db[_0x486f('0x30')][_0x486f('0x4c')](_0x2937a6)[_0x486f('0x2b')](handleEntityNotFound(_0x42ef68,null))[_0x486f('0x2b')](respondWithResult(_0x42ef68,null))[_0x486f('0x48')](handleError(_0x42ef68,null));};exports[_0x486f('0x4d')]=function(_0xb65e98,_0x21f222){return db['Cdr'][_0x486f('0x4d')](_0xb65e98['body'],{})[_0x486f('0x2b')](respondWithResult(_0x21f222,0xc9))[_0x486f('0x48')](handleError(_0x21f222,null));};exports[_0x486f('0x2a')]=function(_0x1055cf,_0x34033e){if(_0x1055cf[_0x486f('0x4e')]['id']){delete _0x1055cf['body']['id'];}return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x1055cf[_0x486f('0x4a')]['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x34033e,null))[_0x486f('0x2b')](saveUpdates(_0x1055cf[_0x486f('0x4e')],null))[_0x486f('0x2b')](respondWithResult(_0x34033e,null))[_0x486f('0x48')](handleError(_0x34033e,null));};exports[_0x486f('0x2c')]=function(_0x5cd989,_0x300de9){return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x5cd989['params']['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x300de9,null))[_0x486f('0x2b')](removeEntity(_0x300de9,null))[_0x486f('0x48')](handleError(_0x300de9,null));};exports['describe']=function(_0x195c9c,_0x372d2f){return db[_0x486f('0x30')][_0x486f('0x4f')]()['then'](respondWithResult(_0x372d2f,null))['catch'](handleError(_0x372d2f,null));};
\ No newline at end of file
+var _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5292,0xf7));var _0x2529=function(_0x114b54,_0x3ed9bb){_0x114b54=_0x114b54-0x0;var _0x21c37f=_0x5292[_0x114b54];return _0x21c37f;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 1f38ff8..5a96f42 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x52ffc9,_0x3e3b69){var _0x30ea46=function(_0x4875da){while(--_0x4875da){_0x52ffc9['push'](_0x52ffc9['shift']());}};_0x30ea46(++_0x3e3b69);}(_0x7a54,0x106));var _0x47a5=function(_0x2eb3e5,_0x4e7609){_0x2eb3e5=_0x2eb3e5-0x0;var _0x43122d=_0x7a54[_0x2eb3e5];return _0x43122d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3eb755,_0x135c92){var _0x547f03=function(_0x552cf3){while(--_0x552cf3){_0x3eb755['push'](_0x3eb755['shift']());}};_0x547f03(++_0x135c92);}(_0x7a54,0x106));var _0x47a5=function(_0x4933d0,_0x23817d){_0x4933d0=_0x4933d0-0x0;var _0x47c52e=_0x7a54[_0x4933d0];return _0x47c52e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 342903a..b926559 100644
--- a/server/api/cdr/cdr.rpc.js
+++ b/server/api/cdr/cdr.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x934f=['info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x934f,0x17f));var _0xf934=function(_0x294f4d,_0x35032d){_0x294f4d=_0x294f4d-0x0;var _0x3519ce=_0x934f[_0x294f4d];return _0x3519ce;};'use strict';var _=require(_0xf934('0x0'));var util=require(_0xf934('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf934('0x2'));var fs=require('fs');var Redis=require(_0xf934('0x3'));var db=require(_0xf934('0x4'))['db'];var utils=require(_0xf934('0x5'));var logger=require(_0xf934('0x6'))(_0xf934('0x7'));var config=require(_0xf934('0x8'));var jayson=require(_0xf934('0x9'));var client=jayson[_0xf934('0xa')][_0xf934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ff30a,_0x3517ea,_0x2ef897){return new BPromise(function(_0x62ac2c,_0x562ceb){return client[_0xf934('0xc')](_0x1ff30a,_0x2ef897)['then'](function(_0x28e034){logger[_0xf934('0xd')](_0xf934('0xe'),_0x3517ea,_0xf934('0xf'));logger[_0xf934('0x10')](_0xf934('0x11'),_0x3517ea,_0xf934('0xf'),JSON[_0xf934('0x12')](_0x28e034));if(_0x28e034[_0xf934('0x13')]){if(_0x28e034[_0xf934('0x13')]['code']===0x1f4){logger[_0xf934('0x13')]('Cdr,\x20%s,\x20%s',_0x3517ea,_0x28e034[_0xf934('0x13')]['message']);return _0x562ceb(_0x28e034[_0xf934('0x13')]['message']);}logger[_0xf934('0x13')](_0xf934('0xe'),_0x3517ea,_0x28e034[_0xf934('0x13')][_0xf934('0x14')]);return _0x62ac2c(_0x28e034[_0xf934('0x13')][_0xf934('0x14')]);}else{logger[_0xf934('0xd')](_0xf934('0xe'),_0x3517ea,_0xf934('0xf'));_0x62ac2c(_0x28e034['result']['message']);}})[_0xf934('0x15')](function(_0x212ccb){logger[_0xf934('0x13')](_0xf934('0xe'),_0x3517ea,_0x212ccb);_0x562ceb(_0x212ccb);});});}
\ No newline at end of file
+var _0x68e4=['stringify','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xde0a73,_0x4aef8c){var _0x167c5b=function(_0x17e55b){while(--_0x17e55b){_0xde0a73['push'](_0xde0a73['shift']());}};_0x167c5b(++_0x4aef8c);}(_0x68e4,0x16d));var _0x468e=function(_0x33a414,_0x3df1ae){_0x33a414=_0x33a414-0x0;var _0x547b48=_0x68e4[_0x33a414];return _0x547b48;};'use strict';var _=require(_0x468e('0x0'));var util=require('util');var moment=require(_0x468e('0x1'));var BPromise=require(_0x468e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x468e('0x3'))['db'];var utils=require(_0x468e('0x4'));var logger=require('../../config/logger')(_0x468e('0x5'));var config=require(_0x468e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x468e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eb598,_0x588e2c,_0x35ffc5){return new BPromise(function(_0x5a6470,_0x1a93cd){return client[_0x468e('0x8')](_0x5eb598,_0x35ffc5)[_0x468e('0x9')](function(_0x42d1f5){logger[_0x468e('0xa')](_0x468e('0xb'),_0x588e2c,'request\x20sent');logger[_0x468e('0xc')](_0x468e('0xd'),_0x588e2c,_0x468e('0xe'),JSON[_0x468e('0xf')](_0x42d1f5));if(_0x42d1f5['error']){if(_0x42d1f5[_0x468e('0x10')]['code']===0x1f4){logger[_0x468e('0x10')](_0x468e('0xb'),_0x588e2c,_0x42d1f5[_0x468e('0x10')][_0x468e('0x11')]);return _0x1a93cd(_0x42d1f5[_0x468e('0x10')][_0x468e('0x11')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x588e2c,_0x42d1f5['error']['message']);return _0x5a6470(_0x42d1f5['error'][_0x468e('0x11')]);}else{logger[_0x468e('0xa')](_0x468e('0xb'),_0x588e2c,'request\x20sent');_0x5a6470(_0x42d1f5[_0x468e('0x12')]['message']);}})[_0x468e('0x13')](function(_0x2ebf88){logger['error'](_0x468e('0xb'),_0x588e2c,_0x2ebf88);_0x1a93cd(_0x2ebf88);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3871972..c4443ff 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2e0cfd,_0x505a26){var _0x387a04=function(_0x295f8b){while(--_0x295f8b){_0x2e0cfd['push'](_0x2e0cfd['shift']());}};_0x387a04(++_0x505a26);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d07e1,_0x418799){_0x5d07e1=_0x5d07e1-0x0;var _0x21617f=_0xb10b[_0x5d07e1];return _0x21617f;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 88bef2f..6296463 100644
--- a/server/api/chatApplication/chatApplication.attributes.js
+++ b/server/api/chatApplication/chatApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdc42=['*,*,*,*','sequelize','INTEGER','TEXT','STRING'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xdc42,0x1b4));var _0x2dc4=function(_0x40e74c,_0x1883a2){_0x40e74c=_0x40e74c-0x0;var _0x3a8c6b=_0xdc42[_0x40e74c];return _0x3a8c6b;};'use strict';var Sequelize=require(_0x2dc4('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2dc4('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2dc4('0x2')]()},'description':{'type':Sequelize[_0x2dc4('0x3')]},'interval':{'type':Sequelize[_0x2dc4('0x3')],'defaultValue':_0x2dc4('0x4')}};
\ No newline at end of file
+var _0x66b9=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x66b9,0xe5));var _0x966b=function(_0x2b115d,_0x47fd38){_0x2b115d=_0x2b115d-0x0;var _0x38d65a=_0x66b9[_0x2b115d];return _0x38d65a;};'use strict';var Sequelize=require(_0x966b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x966b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x966b('0x2')],'allowNull':![],'defaultValue':_0x966b('0x3')},'appdata':{'type':Sequelize[_0x966b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x966b('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index cdf778e..c4d9856 100644
--- a/server/api/chatApplication/chatApplication.controller.js
+++ b/server/api/chatApplication/chatApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5127=['sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','name','send','model','keys','ChatApplication','rawAttributes','intersection','fields','query','attributes','length','merge','options','find','catch','update','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path'];(function(_0x50aea5,_0x5dd077){var _0x4657f1=function(_0x57fb40){while(--_0x57fb40){_0x50aea5['push'](_0x50aea5['shift']());}};_0x4657f1(++_0x5dd077);}(_0x5127,0x18f));var _0x7512=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x5127[_0x170772];return _0x3ef69c;};'use strict';var emlformat=require(_0x7512('0x0'));var rimraf=require(_0x7512('0x1'));var zipdir=require(_0x7512('0x2'));var jsonpatch=require(_0x7512('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7512('0x4'));var Mustache=require('mustache');var util=require(_0x7512('0x5'));var path=require(_0x7512('0x6'));var sox=require(_0x7512('0x7'));var csv=require(_0x7512('0x8'));var ejs=require(_0x7512('0x9'));var fs=require('fs');var fs_extra=require(_0x7512('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7512('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7512('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7512('0xd'));var Papa=require(_0x7512('0xe'));var Redis=require(_0x7512('0xf'));var authService=require(_0x7512('0x10'));var qs=require(_0x7512('0x11'));var as=require(_0x7512('0x12'));var hardwareService=require(_0x7512('0x13'));var logger=require(_0x7512('0x14'))(_0x7512('0x15'));var utils=require(_0x7512('0x16'));var config=require(_0x7512('0x17'));var licenseUtil=require(_0x7512('0x18'));var db=require(_0x7512('0x19'))['db'];function respondWithStatusCode(_0x599ce4,_0x472323){_0x472323=_0x472323||0xcc;return function(_0x474746){if(_0x474746){return _0x599ce4[_0x7512('0x1a')](_0x472323);}return _0x599ce4['status'](_0x472323)[_0x7512('0x1b')]();};}function respondWithResult(_0x57813c,_0x3069a1){_0x3069a1=_0x3069a1||0xc8;return function(_0x3ef1fc){if(_0x3ef1fc){return _0x57813c[_0x7512('0x1c')](_0x3069a1)[_0x7512('0x1d')](_0x3ef1fc);}};}function respondWithFilteredResult(_0x4968a5,_0x519aad){return function(_0x5a4101){if(_0x5a4101){var _0x219f4c=typeof _0x519aad[_0x7512('0x1e')]===_0x7512('0x1f')&&typeof _0x519aad[_0x7512('0x20')]==='undefined';var _0x82484a=_0x5a4101['count'];var _0x10858d=_0x219f4c?0x0:_0x519aad[_0x7512('0x1e')];var _0x1d357b=_0x219f4c?_0x5a4101[_0x7512('0x21')]:_0x519aad[_0x7512('0x1e')]+_0x519aad[_0x7512('0x20')];var _0x67c45e;if(_0x1d357b>=_0x82484a){_0x1d357b=_0x82484a;_0x67c45e=0xc8;}else{_0x67c45e=0xce;}_0x4968a5[_0x7512('0x1c')](_0x67c45e);return _0x4968a5[_0x7512('0x22')](_0x7512('0x23'),_0x10858d+'-'+_0x1d357b+'/'+_0x82484a)['json'](_0x5a4101);}return null;};}function patchUpdates(_0x3c8b39){return function(_0x41bb33){try{jsonpatch['apply'](_0x41bb33,_0x3c8b39,!![]);}catch(_0x4862d6){return BPromise[_0x7512('0x24')](_0x4862d6);}return _0x41bb33[_0x7512('0x25')]();};}function saveUpdates(_0x16cabb,_0x2279a0){return function(_0x24baaf){if(_0x24baaf){return _0x24baaf['update'](_0x16cabb)[_0x7512('0x26')](function(_0x28aa80){return _0x28aa80;});}return null;};}function removeEntity(_0x101f57,_0x21cb99){return function(_0x14f0e2){if(_0x14f0e2){return _0x14f0e2['destroy']()[_0x7512('0x26')](function(){_0x101f57[_0x7512('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c88dd,_0x5e0cfd){return function(_0x5df068){if(!_0x5df068){_0x2c88dd[_0x7512('0x1a')](0x194);}return _0x5df068;};}function handleError(_0x3ccd5f,_0x1a5985){_0x1a5985=_0x1a5985||0x1f4;return function(_0x5784ba){logger['error'](_0x5784ba['stack']);if(_0x5784ba[_0x7512('0x27')]){delete _0x5784ba['name'];}_0x3ccd5f['status'](_0x1a5985)[_0x7512('0x28')](_0x5784ba);};}exports['show']=function(_0x1c0442,_0x133d18){var _0x2f8df2={'raw':!![],'where':{'id':_0x1c0442['params']['id']}},_0x4c676c={};_0x4c676c[_0x7512('0x29')]=_[_0x7512('0x2a')](db[_0x7512('0x2b')][_0x7512('0x2c')]);_0x4c676c['query']=_[_0x7512('0x2a')](_0x1c0442['query']);_0x4c676c['filters']=_[_0x7512('0x2d')](_0x4c676c[_0x7512('0x29')],_0x4c676c['query']);_0x2f8df2['attributes']=_[_0x7512('0x2d')](_0x4c676c['model'],qs[_0x7512('0x2e')](_0x1c0442[_0x7512('0x2f')][_0x7512('0x2e')]));_0x2f8df2[_0x7512('0x30')]=_0x2f8df2['attributes'][_0x7512('0x31')]?_0x2f8df2['attributes']:_0x4c676c[_0x7512('0x29')];if(_0x1c0442[_0x7512('0x2f')]['includeAll']){_0x2f8df2['include']=[{'all':!![]}];}_0x2f8df2=_[_0x7512('0x32')]({},_0x2f8df2,_0x1c0442[_0x7512('0x33')]);return db['ChatApplication'][_0x7512('0x34')](_0x2f8df2)[_0x7512('0x26')](handleEntityNotFound(_0x133d18,null))[_0x7512('0x26')](respondWithResult(_0x133d18,null))[_0x7512('0x35')](handleError(_0x133d18,null));};exports[_0x7512('0x36')]=function(_0x20e8fb,_0x5b566d){if(_0x20e8fb[_0x7512('0x37')]['id']){delete _0x20e8fb[_0x7512('0x37')]['id'];}return db[_0x7512('0x2b')]['find']({'where':{'id':_0x20e8fb[_0x7512('0x38')]['id']}})[_0x7512('0x26')](handleEntityNotFound(_0x5b566d,null))['then'](saveUpdates(_0x20e8fb[_0x7512('0x37')],null))[_0x7512('0x26')](respondWithResult(_0x5b566d,null))['catch'](handleError(_0x5b566d,null));};exports[_0x7512('0x39')]=function(_0x5cc6a1,_0x325da0){return db[_0x7512('0x2b')]['find']({'where':{'id':_0x5cc6a1[_0x7512('0x38')]['id']}})['then'](handleEntityNotFound(_0x325da0,null))[_0x7512('0x26')](removeEntity(_0x325da0,null))['catch'](handleError(_0x325da0,null));};
\ No newline at end of file
+var _0x4345=['rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','error','stack','name','show','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','then','catch','body','params','eml-format'];(function(_0x143339,_0x17ee42){var _0x3165ea=function(_0x26ccd7){while(--_0x26ccd7){_0x143339['push'](_0x143339['shift']());}};_0x3165ea(++_0x17ee42);}(_0x4345,0x77));var _0x5434=function(_0x2ddf82,_0x3892a8){_0x2ddf82=_0x2ddf82-0x0;var _0x2d2f1c=_0x4345[_0x2ddf82];return _0x2d2f1c;};'use strict';var emlformat=require(_0x5434('0x0'));var rimraf=require(_0x5434('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5434('0x2'));var rp=require(_0x5434('0x3'));var moment=require(_0x5434('0x4'));var BPromise=require(_0x5434('0x5'));var Mustache=require('mustache');var util=require(_0x5434('0x6'));var path=require('path');var sox=require(_0x5434('0x7'));var csv=require(_0x5434('0x8'));var ejs=require(_0x5434('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5434('0xa'));var squel=require('squel');var crypto=require(_0x5434('0xb'));var jsforce=require(_0x5434('0xc'));var deskjs=require(_0x5434('0xd'));var toCsv=require(_0x5434('0x8'));var querystring=require(_0x5434('0xe'));var Papa=require(_0x5434('0xf'));var Redis=require(_0x5434('0x10'));var authService=require(_0x5434('0x11'));var qs=require(_0x5434('0x12'));var as=require(_0x5434('0x13'));var hardwareService=require(_0x5434('0x14'));var logger=require(_0x5434('0x15'))(_0x5434('0x16'));var utils=require(_0x5434('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5434('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36a2d9,_0xf27177){_0xf27177=_0xf27177||0xcc;return function(_0x13a13f){if(_0x13a13f){return _0x36a2d9[_0x5434('0x19')](_0xf27177);}return _0x36a2d9['status'](_0xf27177)[_0x5434('0x1a')]();};}function respondWithResult(_0x223766,_0x5aa606){_0x5aa606=_0x5aa606||0xc8;return function(_0x44ea26){if(_0x44ea26){return _0x223766[_0x5434('0x1b')](_0x5aa606)[_0x5434('0x1c')](_0x44ea26);}};}function respondWithFilteredResult(_0x1a7a2c,_0x48be48){return function(_0x2b88c4){if(_0x2b88c4){var _0x437664=typeof _0x48be48['offset']===_0x5434('0x1d')&&typeof _0x48be48['limit']===_0x5434('0x1d');var _0x42a118=_0x2b88c4[_0x5434('0x1e')];var _0x148b3c=_0x437664?0x0:_0x48be48[_0x5434('0x1f')];var _0x2d60be=_0x437664?_0x2b88c4[_0x5434('0x1e')]:_0x48be48['offset']+_0x48be48[_0x5434('0x20')];var _0x5a4570;if(_0x2d60be>=_0x42a118){_0x2d60be=_0x42a118;_0x5a4570=0xc8;}else{_0x5a4570=0xce;}_0x1a7a2c[_0x5434('0x1b')](_0x5a4570);return _0x1a7a2c['set'](_0x5434('0x21'),_0x148b3c+'-'+_0x2d60be+'/'+_0x42a118)[_0x5434('0x1c')](_0x2b88c4);}return null;};}function patchUpdates(_0x240787){return function(_0x4d34d6){try{jsonpatch[_0x5434('0x22')](_0x4d34d6,_0x240787,!![]);}catch(_0x2513e9){return BPromise[_0x5434('0x23')](_0x2513e9);}return _0x4d34d6[_0x5434('0x24')]();};}function saveUpdates(_0x1da16d,_0x5c43ef){return function(_0x5e92d0){if(_0x5e92d0){return _0x5e92d0[_0x5434('0x25')](_0x1da16d)['then'](function(_0x4524f9){return _0x4524f9;});}return null;};}function removeEntity(_0x85a5a1,_0x464093){return function(_0xd83da2){if(_0xd83da2){return _0xd83da2['destroy']()['then'](function(){_0x85a5a1[_0x5434('0x1b')](0xcc)[_0x5434('0x1a')]();});}};}function handleEntityNotFound(_0x27ea93,_0x417dc1){return function(_0x2c8fb1){if(!_0x2c8fb1){_0x27ea93[_0x5434('0x19')](0x194);}return _0x2c8fb1;};}function handleError(_0xaa9184,_0xa0f1b2){_0xa0f1b2=_0xa0f1b2||0x1f4;return function(_0x1b827f){logger[_0x5434('0x26')](_0x1b827f[_0x5434('0x27')]);if(_0x1b827f[_0x5434('0x28')]){delete _0x1b827f['name'];}_0xaa9184['status'](_0xa0f1b2)['send'](_0x1b827f);};}exports[_0x5434('0x29')]=function(_0x124371,_0x4189f9){var _0x1330ff={'raw':!![],'where':{'id':_0x124371['params']['id']}},_0x4598bd={};_0x4598bd[_0x5434('0x2a')]=_[_0x5434('0x2b')](db['ChatApplication'][_0x5434('0x2c')]);_0x4598bd[_0x5434('0x2d')]=_['keys'](_0x124371['query']);_0x4598bd['filters']=_[_0x5434('0x2e')](_0x4598bd[_0x5434('0x2a')],_0x4598bd[_0x5434('0x2d')]);_0x1330ff[_0x5434('0x2f')]=_[_0x5434('0x2e')](_0x4598bd[_0x5434('0x2a')],qs['fields'](_0x124371[_0x5434('0x2d')][_0x5434('0x30')]));_0x1330ff[_0x5434('0x2f')]=_0x1330ff[_0x5434('0x2f')][_0x5434('0x31')]?_0x1330ff[_0x5434('0x2f')]:_0x4598bd[_0x5434('0x2a')];if(_0x124371['query'][_0x5434('0x32')]){_0x1330ff[_0x5434('0x33')]=[{'all':!![]}];}_0x1330ff=_[_0x5434('0x34')]({},_0x1330ff,_0x124371[_0x5434('0x35')]);return db[_0x5434('0x36')][_0x5434('0x37')](_0x1330ff)['then'](handleEntityNotFound(_0x4189f9,null))[_0x5434('0x38')](respondWithResult(_0x4189f9,null))[_0x5434('0x39')](handleError(_0x4189f9,null));};exports[_0x5434('0x25')]=function(_0x168db5,_0x24f907){if(_0x168db5[_0x5434('0x3a')]['id']){delete _0x168db5[_0x5434('0x3a')]['id'];}return db[_0x5434('0x36')][_0x5434('0x37')]({'where':{'id':_0x168db5[_0x5434('0x3b')]['id']}})['then'](handleEntityNotFound(_0x24f907,null))[_0x5434('0x38')](saveUpdates(_0x168db5[_0x5434('0x3a')],null))[_0x5434('0x38')](respondWithResult(_0x24f907,null))[_0x5434('0x39')](handleError(_0x24f907,null));};exports['destroy']=function(_0x243163,_0x1fe399){return db['ChatApplication']['find']({'where':{'id':_0x243163[_0x5434('0x3b')]['id']}})[_0x5434('0x38')](handleEntityNotFound(_0x1fe399,null))['then'](removeEntity(_0x1fe399,null))[_0x5434('0x39')](handleError(_0x1fe399,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7a81c77..65c2863 100644
--- a/server/api/chatApplication/chatApplication.model.js
+++ b/server/api/chatApplication/chatApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f47=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x20f8bd,_0xcee953){var _0x3d6de3=function(_0x505ba9){while(--_0x505ba9){_0x20f8bd['push'](_0x20f8bd['shift']());}};_0x3d6de3(++_0xcee953);}(_0x3f47,0x10e));var _0x73f4=function(_0x1056c7,_0x279ac5){_0x1056c7=_0x1056c7-0x0;var _0x4ef73e=_0x3f47[_0x1056c7];return _0x4ef73e;};'use strict';var _=require(_0x73f4('0x0'));var util=require(_0x73f4('0x1'));var logger=require('../../config/logger')(_0x73f4('0x2'));var moment=require('moment');var BPromise=require(_0x73f4('0x3'));var rp=require(_0x73f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73f4('0x5'));var config=require(_0x73f4('0x6'));var attributes=require(_0x73f4('0x7'));module[_0x73f4('0x8')]=function(_0x5a852e,_0x101093){return _0x5a852e[_0x73f4('0x9')](_0x73f4('0xa'),attributes,{'tableName':_0x73f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x73f4('0xc'),'collate':_0x73f4('0xd')});};
\ No newline at end of file
+var _0xa3d1=['path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3af54a,_0x2f617d){var _0x220130=function(_0x527465){while(--_0x527465){_0x3af54a['push'](_0x3af54a['shift']());}};_0x220130(++_0x2f617d);}(_0xa3d1,0x126));var _0x1a3d=function(_0x3a12f5,_0x612f29){_0x3a12f5=_0x3a12f5-0x0;var _0x42e50d=_0xa3d1[_0x3a12f5];return _0x42e50d;};'use strict';var _=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var logger=require(_0x1a3d('0x2'))('api');var moment=require(_0x1a3d('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a3d('0x4'));var fs=require('fs');var path=require(_0x1a3d('0x5'));var rimraf=require(_0x1a3d('0x6'));var config=require(_0x1a3d('0x7'));var attributes=require(_0x1a3d('0x8'));module[_0x1a3d('0x9')]=function(_0x3a4a57,_0x144a93){return _0x3a4a57['define'](_0x1a3d('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a3d('0xb'),'collate':_0x1a3d('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 4f2ca39..46d405d 100644
--- a/server/api/chatApplication/chatApplication.rpc.js
+++ b/server/api/chatApplication/chatApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd28=['stringify','error','code','ChatApplication,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2313e0,_0x31716d){var _0x58bd80=function(_0x3317e7){while(--_0x3317e7){_0x2313e0['push'](_0x2313e0['shift']());}};_0x58bd80(++_0x31716d);}(_0xcd28,0x133));var _0x8cd2=function(_0xee1383,_0xac1074){_0xee1383=_0xee1383-0x0;var _0x49f3b3=_0xcd28[_0xee1383];return _0x49f3b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8cd2('0x0'));var BPromise=require(_0x8cd2('0x1'));var rs=require(_0x8cd2('0x2'));var fs=require('fs');var Redis=require(_0x8cd2('0x3'));var db=require(_0x8cd2('0x4'))['db'];var utils=require(_0x8cd2('0x5'));var logger=require(_0x8cd2('0x6'))(_0x8cd2('0x7'));var config=require('../../config/environment');var jayson=require(_0x8cd2('0x8'));var client=jayson[_0x8cd2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26c45c,_0x114db3,_0x2aea94){return new BPromise(function(_0x23baba,_0x45c9be){return client[_0x8cd2('0xa')](_0x26c45c,_0x2aea94)[_0x8cd2('0xb')](function(_0x23043b){logger['info']('ChatApplication,\x20%s,\x20%s',_0x114db3,'request\x20sent');logger[_0x8cd2('0xc')](_0x8cd2('0xd'),_0x114db3,_0x8cd2('0xe'),JSON[_0x8cd2('0xf')](_0x23043b));if(_0x23043b[_0x8cd2('0x10')]){if(_0x23043b['error'][_0x8cd2('0x11')]===0x1f4){logger['error'](_0x8cd2('0x12'),_0x114db3,_0x23043b[_0x8cd2('0x10')][_0x8cd2('0x13')]);return _0x45c9be(_0x23043b['error'][_0x8cd2('0x13')]);}logger[_0x8cd2('0x10')](_0x8cd2('0x12'),_0x114db3,_0x23043b['error']['message']);return _0x23baba(_0x23043b['error'][_0x8cd2('0x13')]);}else{logger[_0x8cd2('0x14')](_0x8cd2('0x12'),_0x114db3,_0x8cd2('0xe'));_0x23baba(_0x23043b[_0x8cd2('0x15')]['message']);}})[_0x8cd2('0x16')](function(_0x19bc8e){logger[_0x8cd2('0x10')](_0x8cd2('0x12'),_0x114db3,_0x19bc8e);_0x45c9be(_0x19bc8e);});});}
\ No newline at end of file
+var _0xcc1d=['request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','randomstring','rpc','../../config/environment','http','request','then','ChatApplication,\x20%s,\x20%s'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0xcc1d,0xba));var _0xdcc1=function(_0x18738e,_0x1e6900){_0x18738e=_0x18738e-0x0;var _0x5809b7=_0xcc1d[_0x18738e];return _0x5809b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdcc1('0x0'));var BPromise=require(_0xdcc1('0x1'));var rs=require(_0xdcc1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdcc1('0x3'));var config=require(_0xdcc1('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdcc1('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x298f3e,_0x9f0bd0,_0x3af621){return new BPromise(function(_0x2ddbe1,_0x980b6c){return client[_0xdcc1('0x6')](_0x298f3e,_0x3af621)[_0xdcc1('0x7')](function(_0x3cb63a){logger['info'](_0xdcc1('0x8'),_0x9f0bd0,_0xdcc1('0x9'));logger['debug'](_0xdcc1('0xa'),_0x9f0bd0,'request\x20sent',JSON['stringify'](_0x3cb63a));if(_0x3cb63a[_0xdcc1('0xb')]){if(_0x3cb63a[_0xdcc1('0xb')][_0xdcc1('0xc')]===0x1f4){logger[_0xdcc1('0xb')](_0xdcc1('0x8'),_0x9f0bd0,_0x3cb63a[_0xdcc1('0xb')][_0xdcc1('0xd')]);return _0x980b6c(_0x3cb63a['error'][_0xdcc1('0xd')]);}logger[_0xdcc1('0xb')](_0xdcc1('0x8'),_0x9f0bd0,_0x3cb63a[_0xdcc1('0xb')]['message']);return _0x2ddbe1(_0x3cb63a[_0xdcc1('0xb')]['message']);}else{logger['info'](_0xdcc1('0x8'),_0x9f0bd0,_0xdcc1('0x9'));_0x2ddbe1(_0x3cb63a['result']['message']);}})[_0xdcc1('0xe')](function(_0x1f8b76){logger['error']('ChatApplication,\x20%s,\x20%s',_0x9f0bd0,_0x1f8b76);_0x980b6c(_0x1f8b76);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 246762b..712f665 100644
--- a/server/api/chatApplication/index.js
+++ b/server/api/chatApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6583=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x6583,0x1b9));var _0x3658=function(_0x34f3c7,_0x393441){_0x34f3c7=_0x34f3c7-0x0;var _0x258767=_0x6583[_0x34f3c7];return _0x258767;};'use strict';var multer=require(_0x3658('0x0'));var util=require(_0x3658('0x1'));var path=require(_0x3658('0x2'));var timeout=require('connect-timeout');var express=require(_0x3658('0x3'));var router=express['Router']();var fs_extra=require(_0x3658('0x4'));var auth=require(_0x3658('0x5'));var interaction=require(_0x3658('0x6'));var config=require(_0x3658('0x7'));var controller=require(_0x3658('0x8'));router[_0x3658('0x9')](_0x3658('0xa'),auth[_0x3658('0xb')](),controller[_0x3658('0xc')]);router[_0x3658('0xd')](_0x3658('0xa'),auth[_0x3658('0xb')](),controller[_0x3658('0xe')]);router[_0x3658('0xf')]('/:id',auth[_0x3658('0xb')](),controller[_0x3658('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x0612=['../../components/interaction/service','./chatApplication.controller','/:id','show','put','isAuthenticated','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0612,0x162));var _0x2061=function(_0x1f4c4a,_0x1de401){_0x1f4c4a=_0x1f4c4a-0x0;var _0x4ca1ef=_0x0612[_0x1f4c4a];return _0x4ca1ef;};'use strict';var multer=require(_0x2061('0x0'));var util=require(_0x2061('0x1'));var path=require('path');var timeout=require(_0x2061('0x2'));var express=require('express');var router=express[_0x2061('0x3')]();var fs_extra=require(_0x2061('0x4'));var auth=require(_0x2061('0x5'));var interaction=require(_0x2061('0x6'));var config=require('../../config/environment');var controller=require(_0x2061('0x7'));router['get'](_0x2061('0x8'),auth['isAuthenticated'](),controller[_0x2061('0x9')]);router[_0x2061('0xa')](_0x2061('0x8'),auth[_0x2061('0xb')](),controller[_0x2061('0xc')]);router['delete'](_0x2061('0x8'),auth[_0x2061('0xb')](),controller[_0x2061('0xd')]);module[_0x2061('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 3ccfbfd..3e8c0df 100644
--- a/server/api/chatGroup/chatGroup.attributes.js
+++ b/server/api/chatGroup/chatGroup.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef18=['STRING','BOOLEAN','exports'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xef18,0xfb));var _0x8ef1=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xef18[_0x24f31b];return _0x488401;};'use strict';var Sequelize=require('sequelize');module[_0x8ef1('0x0')]={'name':{'type':Sequelize[_0x8ef1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8ef1('0x1')]},'write':{'type':Sequelize[_0x8ef1('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x89a1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1189aa,_0x19c03a){var _0x95a2ab=function(_0x115330){while(--_0x115330){_0x1189aa['push'](_0x1189aa['shift']());}};_0x95a2ab(++_0x19c03a);}(_0x89a1,0x1db));var _0x189a=function(_0x512652,_0x5ab9f4){_0x512652=_0x512652-0x0;var _0x6ab93a=_0x89a1[_0x512652];return _0x6ab93a;};'use strict';var Sequelize=require(_0x189a('0x0'));module[_0x189a('0x1')]={'name':{'type':Sequelize[_0x189a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x189a('0x2')]},'write':{'type':Sequelize[_0x189a('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 68e8cfb..cb1acea 100644
--- a/server/api/chatGroup/chatGroup.controller.js
+++ b/server/api/chatGroup/chatGroup.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c94=['save','then','destroy','error','stack','name','send','ChatGroup','type','key','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','options','hasOwnProperty','nolimit','removeMembers','addMessage','getMessages','order','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatGroup.socket','register','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3c94,0x157));var _0x43c9=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x3c94[_0x4cc280];return _0x16ed24;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x43c9('0x0'));var rp=require(_0x43c9('0x1'));var moment=require(_0x43c9('0x2'));var BPromise=require(_0x43c9('0x3'));var Mustache=require(_0x43c9('0x4'));var util=require(_0x43c9('0x5'));var path=require('path');var sox=require(_0x43c9('0x6'));var csv=require('to-csv');var ejs=require(_0x43c9('0x7'));var fs=require('fs');var fs_extra=require(_0x43c9('0x8'));var _=require(_0x43c9('0x9'));var squel=require(_0x43c9('0xa'));var crypto=require(_0x43c9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x43c9('0xc'));var toCsv=require(_0x43c9('0xd'));var querystring=require('querystring');var Papa=require(_0x43c9('0xe'));var Redis=require('ioredis');var authService=require(_0x43c9('0xf'));var qs=require(_0x43c9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43c9('0x11'));var logger=require(_0x43c9('0x12'))(_0x43c9('0x13'));var utils=require(_0x43c9('0x14'));var config=require(_0x43c9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x43c9('0x16'))['db'];config[_0x43c9('0x17')]=_['defaults'](config['redis'],{'host':_0x43c9('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43c9('0x17')]));require(_0x43c9('0x19'))[_0x43c9('0x1a')](socket);function respondWithStatusCode(_0x559273,_0xe87853){_0xe87853=_0xe87853||0xcc;return function(_0x5edec2){if(_0x5edec2){return _0x559273['sendStatus'](_0xe87853);}return _0x559273['status'](_0xe87853)[_0x43c9('0x1b')]();};}function respondWithResult(_0x36bf21,_0x3f854a){_0x3f854a=_0x3f854a||0xc8;return function(_0x5c3345){if(_0x5c3345){return _0x36bf21[_0x43c9('0x1c')](_0x3f854a)[_0x43c9('0x1d')](_0x5c3345);}};}function respondWithFilteredResult(_0x28cbce,_0x1175eb){return function(_0x71c502){if(_0x71c502){var _0x265be4=typeof _0x1175eb[_0x43c9('0x1e')]===_0x43c9('0x1f')&&typeof _0x1175eb['limit']===_0x43c9('0x1f');var _0x3abd97=_0x71c502[_0x43c9('0x20')];var _0x34677f=_0x265be4?0x0:_0x1175eb[_0x43c9('0x1e')];var _0x142a28=_0x265be4?_0x71c502[_0x43c9('0x20')]:_0x1175eb[_0x43c9('0x1e')]+_0x1175eb[_0x43c9('0x21')];var _0x17388a;if(_0x142a28>=_0x3abd97){_0x142a28=_0x3abd97;_0x17388a=0xc8;}else{_0x17388a=0xce;}_0x28cbce[_0x43c9('0x1c')](_0x17388a);return _0x28cbce['set'](_0x43c9('0x22'),_0x34677f+'-'+_0x142a28+'/'+_0x3abd97)['json'](_0x71c502);}return null;};}function patchUpdates(_0x667627){return function(_0x4f25f4){try{jsonpatch[_0x43c9('0x23')](_0x4f25f4,_0x667627,!![]);}catch(_0x339b20){return BPromise[_0x43c9('0x24')](_0x339b20);}return _0x4f25f4[_0x43c9('0x25')]();};}function saveUpdates(_0x2a78a2,_0x566f83){return function(_0x211955){if(_0x211955){return _0x211955['update'](_0x2a78a2)[_0x43c9('0x26')](function(_0x2d0f46){return _0x2d0f46;});}return null;};}function removeEntity(_0x20adcb,_0x3632df){return function(_0x56ba4f){if(_0x56ba4f){return _0x56ba4f[_0x43c9('0x27')]()[_0x43c9('0x26')](function(){_0x20adcb[_0x43c9('0x1c')](0xcc)[_0x43c9('0x1b')]();});}};}function handleEntityNotFound(_0x247ff5,_0x1793c7){return function(_0x4a1898){if(!_0x4a1898){_0x247ff5['sendStatus'](0x194);}return _0x4a1898;};}function handleError(_0x1ba571,_0xdc9ef2){_0xdc9ef2=_0xdc9ef2||0x1f4;return function(_0x3e32e1){logger[_0x43c9('0x28')](_0x3e32e1[_0x43c9('0x29')]);if(_0x3e32e1[_0x43c9('0x2a')]){delete _0x3e32e1[_0x43c9('0x2a')];}_0x1ba571['status'](_0xdc9ef2)[_0x43c9('0x2b')](_0x3e32e1);};}exports['index']=function(_0x5d3b06,_0x221f2d){var _0x57fd07={},_0x555219={},_0x1274b7={'count':0x0,'rows':[]};var _0x5cc5e5=_['map'](db[_0x43c9('0x2c')]['rawAttributes'],function(_0x14f031){return{'name':_0x14f031['fieldName'],'type':_0x14f031[_0x43c9('0x2d')][_0x43c9('0x2e')]};});_0x555219['model']=_['map'](_0x5cc5e5,_0x43c9('0x2a'));_0x555219[_0x43c9('0x2f')]=_[_0x43c9('0x30')](_0x5d3b06[_0x43c9('0x2f')]);_0x555219[_0x43c9('0x31')]=_[_0x43c9('0x32')](_0x555219[_0x43c9('0x33')],_0x555219[_0x43c9('0x2f')]);_0x57fd07[_0x43c9('0x34')]=_[_0x43c9('0x32')](_0x555219[_0x43c9('0x33')],qs['fields'](_0x5d3b06[_0x43c9('0x2f')][_0x43c9('0x35')]));_0x57fd07[_0x43c9('0x34')]=_0x57fd07[_0x43c9('0x34')][_0x43c9('0x36')]?_0x57fd07[_0x43c9('0x34')]:_0x555219[_0x43c9('0x33')];if(!_0x5d3b06['query']['hasOwnProperty']('nolimit')){_0x57fd07[_0x43c9('0x21')]=qs['limit'](_0x5d3b06[_0x43c9('0x2f')][_0x43c9('0x21')]);_0x57fd07[_0x43c9('0x1e')]=qs[_0x43c9('0x1e')](_0x5d3b06[_0x43c9('0x2f')][_0x43c9('0x1e')]);}_0x57fd07['order']=qs[_0x43c9('0x37')](_0x5d3b06[_0x43c9('0x2f')][_0x43c9('0x37')]);_0x57fd07[_0x43c9('0x38')]=qs['filters'](_[_0x43c9('0x39')](_0x5d3b06[_0x43c9('0x2f')],_0x555219[_0x43c9('0x31')]),_0x5cc5e5);if(_0x5d3b06['query'][_0x43c9('0x3a')]){_0x57fd07[_0x43c9('0x38')]=_['merge'](_0x57fd07[_0x43c9('0x38')],{'$or':_['map'](_0x5cc5e5,function(_0x4cec43){if(_0x4cec43[_0x43c9('0x2d')]!==_0x43c9('0x3b')){var _0x5437c2={};_0x5437c2[_0x4cec43[_0x43c9('0x2a')]]={'$like':'%'+_0x5d3b06[_0x43c9('0x2f')]['filter']+'%'};return _0x5437c2;}})});}_0x57fd07=_[_0x43c9('0x3c')]({},_0x57fd07,_0x5d3b06['options']);var _0xee9b03={'where':_0x57fd07[_0x43c9('0x38')]};return db['ChatGroup'][_0x43c9('0x20')](_0xee9b03)[_0x43c9('0x26')](function(_0x3b3c67){_0x1274b7['count']=_0x3b3c67;if(_0x5d3b06['query'][_0x43c9('0x3d')]){_0x57fd07[_0x43c9('0x3e')]=[{'all':!![]}];}return db[_0x43c9('0x2c')][_0x43c9('0x3f')](_0x57fd07);})[_0x43c9('0x26')](function(_0xfd13ea){_0x1274b7[_0x43c9('0x40')]=_0xfd13ea;return _0x1274b7;})[_0x43c9('0x26')](respondWithFilteredResult(_0x221f2d,_0x57fd07))[_0x43c9('0x41')](handleError(_0x221f2d,null));};exports[_0x43c9('0x42')]=function(_0x50c08d,_0x45d619){var _0x48d878={'raw':!![],'where':{'id':_0x50c08d[_0x43c9('0x43')]['id']}},_0x5ba81d={};_0x5ba81d[_0x43c9('0x33')]=_[_0x43c9('0x30')](db[_0x43c9('0x2c')][_0x43c9('0x44')]);_0x5ba81d[_0x43c9('0x2f')]=_['keys'](_0x50c08d[_0x43c9('0x2f')]);_0x5ba81d[_0x43c9('0x31')]=_[_0x43c9('0x32')](_0x5ba81d[_0x43c9('0x33')],_0x5ba81d[_0x43c9('0x2f')]);_0x48d878[_0x43c9('0x34')]=_['intersection'](_0x5ba81d[_0x43c9('0x33')],qs['fields'](_0x50c08d['query'][_0x43c9('0x35')]));_0x48d878['attributes']=_0x48d878[_0x43c9('0x34')][_0x43c9('0x36')]?_0x48d878[_0x43c9('0x34')]:_0x5ba81d[_0x43c9('0x33')];if(_0x50c08d[_0x43c9('0x2f')][_0x43c9('0x3d')]){_0x48d878[_0x43c9('0x3e')]=[{'all':!![]}];}_0x48d878=_[_0x43c9('0x3c')]({},_0x48d878,_0x50c08d['options']);return db[_0x43c9('0x2c')][_0x43c9('0x45')](_0x48d878)['then'](handleEntityNotFound(_0x45d619,null))['then'](respondWithResult(_0x45d619,null))[_0x43c9('0x41')](handleError(_0x45d619,null));};exports['create']=function(_0x27bf81,_0x5169b0){return db[_0x43c9('0x2c')][_0x43c9('0x46')](_0x27bf81[_0x43c9('0x47')],{})['then'](respondWithResult(_0x5169b0,0xc9))[_0x43c9('0x41')](handleError(_0x5169b0,null));};exports[_0x43c9('0x48')]=function(_0x21919e,_0x47bf2d){if(_0x21919e[_0x43c9('0x47')]['id']){delete _0x21919e[_0x43c9('0x47')]['id'];}return db[_0x43c9('0x2c')][_0x43c9('0x45')]({'where':{'id':_0x21919e['params']['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x47bf2d,null))[_0x43c9('0x26')](saveUpdates(_0x21919e[_0x43c9('0x47')],null))[_0x43c9('0x26')](respondWithResult(_0x47bf2d,null))[_0x43c9('0x41')](handleError(_0x47bf2d,null));};exports['destroy']=function(_0x3e2575,_0x19b168){return db['ChatGroup'][_0x43c9('0x45')]({'where':{'id':_0x3e2575[_0x43c9('0x43')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x19b168,null))['then'](removeEntity(_0x19b168,null))[_0x43c9('0x41')](handleError(_0x19b168,null));};exports['describe']=function(_0x236037,_0x3bf7fb){return db[_0x43c9('0x2c')][_0x43c9('0x49')]()['then'](respondWithResult(_0x3bf7fb,null))[_0x43c9('0x41')](handleError(_0x3bf7fb,null));};exports[_0x43c9('0x4a')]=function(_0x29963a,_0x1cb2c2,_0x56a22a){return db[_0x43c9('0x4b')][_0x43c9('0x20')]({'where':{'ChatGroupId':_0x29963a[_0x43c9('0x43')]['id'],'ToId':_0x29963a[_0x43c9('0x4c')]['id'],'read':![]}})[_0x43c9('0x26')](function(_0x566bf5){return{'id':_[_0x43c9('0x4d')](_0x29963a[_0x43c9('0x43')]['id']),'count':_0x566bf5};})[_0x43c9('0x26')](respondWithResult(_0x1cb2c2,null))['catch'](handleError(_0x1cb2c2,null));};exports[_0x43c9('0x4e')]=function(_0x343fef,_0xb8fac5,_0x437d49){return db[_0x43c9('0x2c')][_0x43c9('0x45')]({'where':{'id':_0x343fef['params']['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0xb8fac5,null))[_0x43c9('0x26')](function(_0x305fd6){if(_0x305fd6){return _0x305fd6[_0x43c9('0x4e')](_0x343fef[_0x43c9('0x47')]['ids'],_[_0x43c9('0x4f')](_0x343fef[_0x43c9('0x47')],[_0x43c9('0x50'),'id'])||{});}})[_0x43c9('0x26')](respondWithResult(_0xb8fac5,null))[_0x43c9('0x41')](handleError(_0xb8fac5,null));};exports[_0x43c9('0x51')]=function(_0x136ab3,_0x3d16da,_0x2e3eee){var _0x459322={};var _0x46225b={};var _0x45457f;var _0x5a5bcf;return db['ChatGroup'][_0x43c9('0x52')]({'where':{'id':_0x136ab3[_0x43c9('0x43')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x3d16da,null))[_0x43c9('0x26')](function(_0x261974){if(_0x261974){_0x45457f=_0x261974;_0x46225b['model']=_[_0x43c9('0x30')](db[_0x43c9('0x53')]['rawAttributes']);_0x46225b[_0x43c9('0x2f')]=_[_0x43c9('0x30')](_0x136ab3[_0x43c9('0x2f')]);_0x46225b[_0x43c9('0x31')]=_[_0x43c9('0x32')](_0x46225b[_0x43c9('0x33')],_0x46225b['query']);_0x459322['attributes']=_['intersection'](_0x46225b[_0x43c9('0x33')],qs['fields'](_0x136ab3[_0x43c9('0x2f')][_0x43c9('0x35')]));_0x459322[_0x43c9('0x34')]=_0x459322['attributes'][_0x43c9('0x36')]?_0x459322[_0x43c9('0x34')]:_0x46225b[_0x43c9('0x33')];_0x459322['order']=qs['sort'](_0x136ab3[_0x43c9('0x2f')][_0x43c9('0x37')]);_0x459322[_0x43c9('0x38')]=qs['filters'](_[_0x43c9('0x39')](_0x136ab3['query'],_0x46225b['filters']));if(_0x136ab3['query'][_0x43c9('0x3a')]){_0x459322[_0x43c9('0x38')]=_[_0x43c9('0x3c')](_0x459322['where'],{'$or':_['map'](_0x459322[_0x43c9('0x34')],function(_0x1964aa){var _0xc8116d={};_0xc8116d[_0x1964aa]={'$like':'%'+_0x136ab3[_0x43c9('0x2f')]['filter']+'%'};return _0xc8116d;})});}_0x459322=_['merge']({},_0x459322,_0x136ab3[_0x43c9('0x54')]);return _0x45457f[_0x43c9('0x51')](_0x459322);}})[_0x43c9('0x26')](function(_0xbf43da){if(_0xbf43da){_0x5a5bcf=_0xbf43da[_0x43c9('0x36')];if(!_0x136ab3[_0x43c9('0x2f')][_0x43c9('0x55')](_0x43c9('0x56'))){_0x459322['limit']=qs[_0x43c9('0x21')](_0x136ab3['query'][_0x43c9('0x21')]);_0x459322['offset']=qs[_0x43c9('0x1e')](_0x136ab3['query']['offset']);}return _0x45457f['getMembers'](_0x459322);}})[_0x43c9('0x26')](function(_0x42e2c3){if(_0x42e2c3){return _0x42e2c3?{'count':_0x5a5bcf,'rows':_0x42e2c3}:null;}})[_0x43c9('0x26')](respondWithResult(_0x3d16da,null))[_0x43c9('0x41')](handleError(_0x3d16da,null));};exports['removeMembers']=function(_0x3a3172,_0x3597fc,_0x3068a0){return db[_0x43c9('0x2c')]['find']({'where':{'id':_0x3a3172[_0x43c9('0x43')]['id']}})['then'](handleEntityNotFound(_0x3597fc,null))[_0x43c9('0x26')](function(_0x36f444){if(_0x36f444){return _0x36f444[_0x43c9('0x57')](_0x3a3172[_0x43c9('0x2f')]['ids']);}})[_0x43c9('0x26')](respondWithStatusCode(_0x3597fc,null))[_0x43c9('0x41')](handleError(_0x3597fc,null));};exports[_0x43c9('0x58')]=function(_0x3ba594,_0x3855cc,_0x4a8bb5){if(_0x3ba594['body']['id']){delete _0x3ba594[_0x43c9('0x47')]['id'];}return db[_0x43c9('0x2c')]['find']({'where':{'id':_0x3ba594[_0x43c9('0x43')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x3855cc,null))['then'](function(_0x5d0f87){if(_0x5d0f87){_0x3ba594[_0x43c9('0x47')]['ChatGroupId']=_0x5d0f87['id'];return db['ChatInternalMessage'][_0x43c9('0x46')](_0x3ba594[_0x43c9('0x47')]);}})['then'](respondWithResult(_0x3855cc,null))[_0x43c9('0x41')](handleError(_0x3855cc,null));};exports[_0x43c9('0x59')]=function(_0x1a690f,_0x18b8aa,_0x484e76){var _0x1b9e68={};var _0x1046de={};var _0x53f371;var _0x4075fd;return db[_0x43c9('0x2c')][_0x43c9('0x52')]({'where':{'id':_0x1a690f[_0x43c9('0x43')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x18b8aa,null))[_0x43c9('0x26')](function(_0x83584c){if(_0x83584c){_0x53f371=_0x83584c;_0x1046de[_0x43c9('0x33')]=_[_0x43c9('0x30')](db['ChatInternalMessage'][_0x43c9('0x44')]);_0x1046de[_0x43c9('0x2f')]=_[_0x43c9('0x30')](_0x1a690f[_0x43c9('0x2f')]);_0x1046de[_0x43c9('0x31')]=_['intersection'](_0x1046de[_0x43c9('0x33')],_0x1046de[_0x43c9('0x2f')]);_0x1b9e68[_0x43c9('0x34')]=_[_0x43c9('0x32')](_0x1046de['model'],qs['fields'](_0x1a690f[_0x43c9('0x2f')]['fields']));_0x1b9e68[_0x43c9('0x34')]=_0x1b9e68[_0x43c9('0x34')]['length']?_0x1b9e68[_0x43c9('0x34')]:_0x1046de[_0x43c9('0x33')];_0x1b9e68[_0x43c9('0x5a')]=qs[_0x43c9('0x37')](_0x1a690f['query']['sort']);_0x1b9e68[_0x43c9('0x38')]=qs['filters'](_[_0x43c9('0x39')](_0x1a690f[_0x43c9('0x2f')],_0x1046de[_0x43c9('0x31')]));if(_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x3a')]){_0x1b9e68['where']=_['merge'](_0x1b9e68['where'],{'$or':_[_0x43c9('0x5b')](_0x1b9e68['attributes'],function(_0x4ce8c1){var _0x380855={};_0x380855[_0x4ce8c1]={'$like':'%'+_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x3a')]+'%'};return _0x380855;})});}if(_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x5c')]){var _0x4d47db=_0x1a690f[_0x43c9('0x2f')]['$gte']['split'](',');var _0x208b07={};_0x208b07[_0x4d47db[0x0]]={'$gte':moment(_0x4d47db[0x1])[_0x43c9('0x5d')](_0x43c9('0x5e'))};_0x1b9e68[_0x43c9('0x38')]=_['merge'](_0x1b9e68[_0x43c9('0x38')],_0x208b07);}_0x1b9e68=_[_0x43c9('0x3c')]({},_0x1b9e68,_0x1a690f['options']);return _0x53f371[_0x43c9('0x59')](_0x1b9e68);}})[_0x43c9('0x26')](function(_0x5ce206){if(_0x5ce206){_0x4075fd=_0x5ce206[_0x43c9('0x36')];if(!_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x55')](_0x43c9('0x56'))){_0x1b9e68[_0x43c9('0x21')]=qs[_0x43c9('0x21')](_0x1a690f[_0x43c9('0x2f')]['limit']);_0x1b9e68[_0x43c9('0x1e')]=qs[_0x43c9('0x1e')](_0x1a690f[_0x43c9('0x2f')][_0x43c9('0x1e')]);}return _0x53f371['getMessages'](_0x1b9e68);}})[_0x43c9('0x26')](function(_0x2fecfe){if(_0x2fecfe){return _0x2fecfe?{'count':_0x4075fd,'rows':_0x2fecfe}:null;}})[_0x43c9('0x26')](respondWithResult(_0x18b8aa,null))[_0x43c9('0x41')](handleError(_0x18b8aa,null));};
\ No newline at end of file
+var _0x91df=['query','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','length','nolimit','removeMembers','ChatGroupId','getMessages','keys','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','destroy','name','send','map','rawAttributes','fieldName','key','model'];(function(_0x5dda62,_0x493273){var _0x311c30=function(_0x3a718e){while(--_0x3a718e){_0x5dda62['push'](_0x5dda62['shift']());}};_0x311c30(++_0x493273);}(_0x91df,0xe7));var _0xf91d=function(_0x14f3e5,_0x493260){_0x14f3e5=_0x14f3e5-0x0;var _0x44b556=_0x91df[_0x14f3e5];return _0x44b556;};'use strict';var emlformat=require(_0xf91d('0x0'));var rimraf=require(_0xf91d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf91d('0x2'));var rp=require(_0xf91d('0x3'));var moment=require(_0xf91d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf91d('0x5'));var util=require(_0xf91d('0x6'));var path=require(_0xf91d('0x7'));var sox=require(_0xf91d('0x8'));var csv=require(_0xf91d('0x9'));var ejs=require(_0xf91d('0xa'));var fs=require('fs');var fs_extra=require(_0xf91d('0xb'));var _=require(_0xf91d('0xc'));var squel=require(_0xf91d('0xd'));var crypto=require(_0xf91d('0xe'));var jsforce=require(_0xf91d('0xf'));var deskjs=require(_0xf91d('0x10'));var toCsv=require(_0xf91d('0x9'));var querystring=require(_0xf91d('0x11'));var Papa=require(_0xf91d('0x12'));var Redis=require('ioredis');var authService=require(_0xf91d('0x13'));var qs=require(_0xf91d('0x14'));var as=require(_0xf91d('0x15'));var hardwareService=require(_0xf91d('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf91d('0x17'));var licenseUtil=require(_0xf91d('0x18'));var db=require('../../mysqldb')['db'];config[_0xf91d('0x19')]=_['defaults'](config[_0xf91d('0x19')],{'host':_0xf91d('0x1a'),'port':0x18eb});var socket=require(_0xf91d('0x1b'))(new Redis(config[_0xf91d('0x19')]));require(_0xf91d('0x1c'))['register'](socket);function respondWithStatusCode(_0x15dc95,_0x5cf7ba){_0x5cf7ba=_0x5cf7ba||0xcc;return function(_0x24de90){if(_0x24de90){return _0x15dc95[_0xf91d('0x1d')](_0x5cf7ba);}return _0x15dc95[_0xf91d('0x1e')](_0x5cf7ba)[_0xf91d('0x1f')]();};}function respondWithResult(_0x176931,_0x1196e1){_0x1196e1=_0x1196e1||0xc8;return function(_0x5ed682){if(_0x5ed682){return _0x176931['status'](_0x1196e1)[_0xf91d('0x20')](_0x5ed682);}};}function respondWithFilteredResult(_0x15cae9,_0x4f273e){return function(_0x170bac){if(_0x170bac){var _0x46ae7d=typeof _0x4f273e[_0xf91d('0x21')]==='undefined'&&typeof _0x4f273e[_0xf91d('0x22')]===_0xf91d('0x23');var _0x1c6d81=_0x170bac['count'];var _0x4e358c=_0x46ae7d?0x0:_0x4f273e[_0xf91d('0x21')];var _0x227c67=_0x46ae7d?_0x170bac[_0xf91d('0x24')]:_0x4f273e[_0xf91d('0x21')]+_0x4f273e[_0xf91d('0x22')];var _0x201ec9;if(_0x227c67>=_0x1c6d81){_0x227c67=_0x1c6d81;_0x201ec9=0xc8;}else{_0x201ec9=0xce;}_0x15cae9[_0xf91d('0x1e')](_0x201ec9);return _0x15cae9[_0xf91d('0x25')]('Content-Range',_0x4e358c+'-'+_0x227c67+'/'+_0x1c6d81)[_0xf91d('0x20')](_0x170bac);}return null;};}function patchUpdates(_0x41e934){return function(_0x13db5){try{jsonpatch['apply'](_0x13db5,_0x41e934,!![]);}catch(_0x2212c4){return BPromise['reject'](_0x2212c4);}return _0x13db5['save']();};}function saveUpdates(_0x2ca9a7,_0x4291e3){return function(_0x75dc7e){if(_0x75dc7e){return _0x75dc7e[_0xf91d('0x26')](_0x2ca9a7)[_0xf91d('0x27')](function(_0x58394c){return _0x58394c;});}return null;};}function removeEntity(_0x1bbde2,_0x671ed6){return function(_0x99e8ae){if(_0x99e8ae){return _0x99e8ae[_0xf91d('0x28')]()[_0xf91d('0x27')](function(){_0x1bbde2['status'](0xcc)[_0xf91d('0x1f')]();});}};}function handleEntityNotFound(_0x21225f,_0x48f49a){return function(_0x4d5ed5){if(!_0x4d5ed5){_0x21225f[_0xf91d('0x1d')](0x194);}return _0x4d5ed5;};}function handleError(_0x124af7,_0x1e8dda){_0x1e8dda=_0x1e8dda||0x1f4;return function(_0x562c89){logger['error'](_0x562c89['stack']);if(_0x562c89['name']){delete _0x562c89[_0xf91d('0x29')];}_0x124af7[_0xf91d('0x1e')](_0x1e8dda)[_0xf91d('0x2a')](_0x562c89);};}exports['index']=function(_0x302fe6,_0x50f7bb){var _0x1a3f57={},_0x185629={},_0x4f278e={'count':0x0,'rows':[]};var _0x23afe6=_[_0xf91d('0x2b')](db['ChatGroup'][_0xf91d('0x2c')],function(_0x245556){return{'name':_0x245556[_0xf91d('0x2d')],'type':_0x245556['type'][_0xf91d('0x2e')]};});_0x185629[_0xf91d('0x2f')]=_[_0xf91d('0x2b')](_0x23afe6,_0xf91d('0x29'));_0x185629[_0xf91d('0x30')]=_['keys'](_0x302fe6[_0xf91d('0x30')]);_0x185629[_0xf91d('0x31')]=_[_0xf91d('0x32')](_0x185629[_0xf91d('0x2f')],_0x185629[_0xf91d('0x30')]);_0x1a3f57['attributes']=_[_0xf91d('0x32')](_0x185629['model'],qs['fields'](_0x302fe6[_0xf91d('0x30')]['fields']));_0x1a3f57[_0xf91d('0x33')]=_0x1a3f57['attributes']['length']?_0x1a3f57[_0xf91d('0x33')]:_0x185629[_0xf91d('0x2f')];if(!_0x302fe6['query'][_0xf91d('0x34')]('nolimit')){_0x1a3f57['limit']=qs[_0xf91d('0x22')](_0x302fe6[_0xf91d('0x30')][_0xf91d('0x22')]);_0x1a3f57[_0xf91d('0x21')]=qs[_0xf91d('0x21')](_0x302fe6[_0xf91d('0x30')][_0xf91d('0x21')]);}_0x1a3f57[_0xf91d('0x35')]=qs[_0xf91d('0x36')](_0x302fe6[_0xf91d('0x30')][_0xf91d('0x36')]);_0x1a3f57[_0xf91d('0x37')]=qs['filters'](_[_0xf91d('0x38')](_0x302fe6[_0xf91d('0x30')],_0x185629[_0xf91d('0x31')]),_0x23afe6);if(_0x302fe6[_0xf91d('0x30')][_0xf91d('0x39')]){_0x1a3f57[_0xf91d('0x37')]=_[_0xf91d('0x3a')](_0x1a3f57[_0xf91d('0x37')],{'$or':_['map'](_0x23afe6,function(_0x4343a5){if(_0x4343a5[_0xf91d('0x3b')]!==_0xf91d('0x3c')){var _0x4a92e2={};_0x4a92e2[_0x4343a5['name']]={'$like':'%'+_0x302fe6[_0xf91d('0x30')][_0xf91d('0x39')]+'%'};return _0x4a92e2;}})});}_0x1a3f57=_['merge']({},_0x1a3f57,_0x302fe6[_0xf91d('0x3d')]);var _0x4a0173={'where':_0x1a3f57['where']};return db[_0xf91d('0x3e')][_0xf91d('0x24')](_0x4a0173)[_0xf91d('0x27')](function(_0x212df3){_0x4f278e[_0xf91d('0x24')]=_0x212df3;if(_0x302fe6[_0xf91d('0x30')][_0xf91d('0x3f')]){_0x1a3f57[_0xf91d('0x40')]=[{'all':!![]}];}return db[_0xf91d('0x3e')][_0xf91d('0x41')](_0x1a3f57);})['then'](function(_0x5b5eeb){_0x4f278e[_0xf91d('0x42')]=_0x5b5eeb;return _0x4f278e;})[_0xf91d('0x27')](respondWithFilteredResult(_0x50f7bb,_0x1a3f57))[_0xf91d('0x43')](handleError(_0x50f7bb,null));};exports[_0xf91d('0x44')]=function(_0x2de8fb,_0x40384d){var _0x471ade={'raw':!![],'where':{'id':_0x2de8fb[_0xf91d('0x45')]['id']}},_0x2dc947={};_0x2dc947[_0xf91d('0x2f')]=_['keys'](db['ChatGroup'][_0xf91d('0x2c')]);_0x2dc947[_0xf91d('0x30')]=_['keys'](_0x2de8fb['query']);_0x2dc947['filters']=_['intersection'](_0x2dc947[_0xf91d('0x2f')],_0x2dc947['query']);_0x471ade[_0xf91d('0x33')]=_[_0xf91d('0x32')](_0x2dc947['model'],qs[_0xf91d('0x46')](_0x2de8fb[_0xf91d('0x30')]['fields']));_0x471ade[_0xf91d('0x33')]=_0x471ade[_0xf91d('0x33')]['length']?_0x471ade['attributes']:_0x2dc947['model'];if(_0x2de8fb[_0xf91d('0x30')]['includeAll']){_0x471ade['include']=[{'all':!![]}];}_0x471ade=_[_0xf91d('0x3a')]({},_0x471ade,_0x2de8fb[_0xf91d('0x3d')]);return db[_0xf91d('0x3e')][_0xf91d('0x47')](_0x471ade)[_0xf91d('0x27')](handleEntityNotFound(_0x40384d,null))[_0xf91d('0x27')](respondWithResult(_0x40384d,null))[_0xf91d('0x43')](handleError(_0x40384d,null));};exports['create']=function(_0x1161a4,_0x14f3ee){return db[_0xf91d('0x3e')][_0xf91d('0x48')](_0x1161a4['body'],{})[_0xf91d('0x27')](respondWithResult(_0x14f3ee,0xc9))['catch'](handleError(_0x14f3ee,null));};exports[_0xf91d('0x26')]=function(_0xdd8dfa,_0x1e930f){if(_0xdd8dfa[_0xf91d('0x49')]['id']){delete _0xdd8dfa['body']['id'];}return db[_0xf91d('0x3e')]['find']({'where':{'id':_0xdd8dfa['params']['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x1e930f,null))[_0xf91d('0x27')](saveUpdates(_0xdd8dfa[_0xf91d('0x49')],null))[_0xf91d('0x27')](respondWithResult(_0x1e930f,null))[_0xf91d('0x43')](handleError(_0x1e930f,null));};exports['destroy']=function(_0x1ebb1c,_0x2fc0cf){return db[_0xf91d('0x3e')][_0xf91d('0x47')]({'where':{'id':_0x1ebb1c[_0xf91d('0x45')]['id']}})['then'](handleEntityNotFound(_0x2fc0cf,null))[_0xf91d('0x27')](removeEntity(_0x2fc0cf,null))[_0xf91d('0x43')](handleError(_0x2fc0cf,null));};exports[_0xf91d('0x4a')]=function(_0x5a7bb3,_0x340524){return db[_0xf91d('0x3e')][_0xf91d('0x4a')]()['then'](respondWithResult(_0x340524,null))[_0xf91d('0x43')](handleError(_0x340524,null));};exports[_0xf91d('0x4b')]=function(_0x4b1372,_0x174c5b,_0x2c8075){return db[_0xf91d('0x4c')][_0xf91d('0x24')]({'where':{'ChatGroupId':_0x4b1372[_0xf91d('0x45')]['id'],'ToId':_0x4b1372[_0xf91d('0x4d')]['id'],'read':![]}})[_0xf91d('0x27')](function(_0x1abcc7){return{'id':_['toInteger'](_0x4b1372[_0xf91d('0x45')]['id']),'count':_0x1abcc7};})[_0xf91d('0x27')](respondWithResult(_0x174c5b,null))['catch'](handleError(_0x174c5b,null));};exports[_0xf91d('0x4e')]=function(_0x43c27e,_0x48b1dd,_0x354a23){return db[_0xf91d('0x3e')][_0xf91d('0x47')]({'where':{'id':_0x43c27e['params']['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x48b1dd,null))[_0xf91d('0x27')](function(_0xcf18bd){if(_0xcf18bd){return _0xcf18bd[_0xf91d('0x4e')](_0x43c27e[_0xf91d('0x49')][_0xf91d('0x4f')],_[_0xf91d('0x50')](_0x43c27e['body'],[_0xf91d('0x4f'),'id'])||{});}})[_0xf91d('0x27')](respondWithResult(_0x48b1dd,null))['catch'](handleError(_0x48b1dd,null));};exports[_0xf91d('0x51')]=function(_0x211160,_0x578630,_0x362348){var _0x2ef4b9={};var _0x457394={};var _0x3c0058;var _0x40d9b4;return db[_0xf91d('0x3e')][_0xf91d('0x52')]({'where':{'id':_0x211160['params']['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x578630,null))[_0xf91d('0x27')](function(_0x27d4fc){if(_0x27d4fc){_0x3c0058=_0x27d4fc;_0x457394['model']=_['keys'](db[_0xf91d('0x53')][_0xf91d('0x2c')]);_0x457394[_0xf91d('0x30')]=_['keys'](_0x211160[_0xf91d('0x30')]);_0x457394[_0xf91d('0x31')]=_[_0xf91d('0x32')](_0x457394[_0xf91d('0x2f')],_0x457394[_0xf91d('0x30')]);_0x2ef4b9['attributes']=_[_0xf91d('0x32')](_0x457394['model'],qs[_0xf91d('0x46')](_0x211160[_0xf91d('0x30')][_0xf91d('0x46')]));_0x2ef4b9[_0xf91d('0x33')]=_0x2ef4b9[_0xf91d('0x33')]['length']?_0x2ef4b9['attributes']:_0x457394[_0xf91d('0x2f')];_0x2ef4b9['order']=qs[_0xf91d('0x36')](_0x211160[_0xf91d('0x30')]['sort']);_0x2ef4b9['where']=qs['filters'](_[_0xf91d('0x38')](_0x211160[_0xf91d('0x30')],_0x457394['filters']));if(_0x211160[_0xf91d('0x30')][_0xf91d('0x39')]){_0x2ef4b9[_0xf91d('0x37')]=_[_0xf91d('0x3a')](_0x2ef4b9['where'],{'$or':_[_0xf91d('0x2b')](_0x2ef4b9[_0xf91d('0x33')],function(_0x298749){var _0x4148bf={};_0x4148bf[_0x298749]={'$like':'%'+_0x211160[_0xf91d('0x30')][_0xf91d('0x39')]+'%'};return _0x4148bf;})});}_0x2ef4b9=_[_0xf91d('0x3a')]({},_0x2ef4b9,_0x211160[_0xf91d('0x3d')]);return _0x3c0058['getMembers'](_0x2ef4b9);}})[_0xf91d('0x27')](function(_0x3038ae){if(_0x3038ae){_0x40d9b4=_0x3038ae[_0xf91d('0x54')];if(!_0x211160['query'][_0xf91d('0x34')](_0xf91d('0x55'))){_0x2ef4b9['limit']=qs[_0xf91d('0x22')](_0x211160[_0xf91d('0x30')][_0xf91d('0x22')]);_0x2ef4b9[_0xf91d('0x21')]=qs[_0xf91d('0x21')](_0x211160[_0xf91d('0x30')][_0xf91d('0x21')]);}return _0x3c0058[_0xf91d('0x51')](_0x2ef4b9);}})[_0xf91d('0x27')](function(_0x41540c){if(_0x41540c){return _0x41540c?{'count':_0x40d9b4,'rows':_0x41540c}:null;}})['then'](respondWithResult(_0x578630,null))[_0xf91d('0x43')](handleError(_0x578630,null));};exports[_0xf91d('0x56')]=function(_0x5ed247,_0x363971,_0x3bb1b1){return db[_0xf91d('0x3e')][_0xf91d('0x47')]({'where':{'id':_0x5ed247[_0xf91d('0x45')]['id']}})['then'](handleEntityNotFound(_0x363971,null))[_0xf91d('0x27')](function(_0x383592){if(_0x383592){return _0x383592[_0xf91d('0x56')](_0x5ed247['query']['ids']);}})[_0xf91d('0x27')](respondWithStatusCode(_0x363971,null))[_0xf91d('0x43')](handleError(_0x363971,null));};exports['addMessage']=function(_0x31696b,_0x503fbe,_0x38a92b){if(_0x31696b[_0xf91d('0x49')]['id']){delete _0x31696b[_0xf91d('0x49')]['id'];}return db[_0xf91d('0x3e')][_0xf91d('0x47')]({'where':{'id':_0x31696b[_0xf91d('0x45')]['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x503fbe,null))['then'](function(_0x105f64){if(_0x105f64){_0x31696b[_0xf91d('0x49')][_0xf91d('0x57')]=_0x105f64['id'];return db[_0xf91d('0x4c')][_0xf91d('0x48')](_0x31696b[_0xf91d('0x49')]);}})[_0xf91d('0x27')](respondWithResult(_0x503fbe,null))['catch'](handleError(_0x503fbe,null));};exports[_0xf91d('0x58')]=function(_0x3f3c34,_0x490e9e,_0x3c2856){var _0x2f17d4={};var _0x4c7c13={};var _0x3f1230;var _0x84ce79;return db[_0xf91d('0x3e')][_0xf91d('0x52')]({'where':{'id':_0x3f3c34['params']['id']}})[_0xf91d('0x27')](handleEntityNotFound(_0x490e9e,null))['then'](function(_0x4f0452){if(_0x4f0452){_0x3f1230=_0x4f0452;_0x4c7c13[_0xf91d('0x2f')]=_[_0xf91d('0x59')](db[_0xf91d('0x4c')]['rawAttributes']);_0x4c7c13[_0xf91d('0x30')]=_[_0xf91d('0x59')](_0x3f3c34['query']);_0x4c7c13[_0xf91d('0x31')]=_[_0xf91d('0x32')](_0x4c7c13['model'],_0x4c7c13[_0xf91d('0x30')]);_0x2f17d4[_0xf91d('0x33')]=_[_0xf91d('0x32')](_0x4c7c13[_0xf91d('0x2f')],qs['fields'](_0x3f3c34[_0xf91d('0x30')]['fields']));_0x2f17d4[_0xf91d('0x33')]=_0x2f17d4[_0xf91d('0x33')][_0xf91d('0x54')]?_0x2f17d4[_0xf91d('0x33')]:_0x4c7c13['model'];_0x2f17d4[_0xf91d('0x35')]=qs[_0xf91d('0x36')](_0x3f3c34[_0xf91d('0x30')]['sort']);_0x2f17d4[_0xf91d('0x37')]=qs['filters'](_['pick'](_0x3f3c34[_0xf91d('0x30')],_0x4c7c13['filters']));if(_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x39')]){_0x2f17d4[_0xf91d('0x37')]=_[_0xf91d('0x3a')](_0x2f17d4[_0xf91d('0x37')],{'$or':_[_0xf91d('0x2b')](_0x2f17d4[_0xf91d('0x33')],function(_0x2a876d){var _0x1d2955={};_0x1d2955[_0x2a876d]={'$like':'%'+_0x3f3c34[_0xf91d('0x30')]['filter']+'%'};return _0x1d2955;})});}if(_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x5a')]){var _0x2f37b0=_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x5a')]['split'](',');var _0xfa11c0={};_0xfa11c0[_0x2f37b0[0x0]]={'$gte':moment(_0x2f37b0[0x1])[_0xf91d('0x5b')](_0xf91d('0x5c'))};_0x2f17d4['where']=_['merge'](_0x2f17d4[_0xf91d('0x37')],_0xfa11c0);}_0x2f17d4=_[_0xf91d('0x3a')]({},_0x2f17d4,_0x3f3c34[_0xf91d('0x3d')]);return _0x3f1230['getMessages'](_0x2f17d4);}})[_0xf91d('0x27')](function(_0x542a81){if(_0x542a81){_0x84ce79=_0x542a81[_0xf91d('0x54')];if(!_0x3f3c34['query']['hasOwnProperty'](_0xf91d('0x55'))){_0x2f17d4['limit']=qs['limit'](_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x22')]);_0x2f17d4[_0xf91d('0x21')]=qs[_0xf91d('0x21')](_0x3f3c34[_0xf91d('0x30')][_0xf91d('0x21')]);}return _0x3f1230['getMessages'](_0x2f17d4);}})[_0xf91d('0x27')](function(_0x57d3a9){if(_0x57d3a9){return _0x57d3a9?{'count':_0x84ce79,'rows':_0x57d3a9}:null;}})[_0xf91d('0x27')](respondWithResult(_0x490e9e,null))[_0xf91d('0x43')](handleError(_0x490e9e,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 589a280..904175e 100644
--- a/server/api/chatGroup/chatGroup.events.js
+++ b/server/api/chatGroup/chatGroup.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5950=['ChatGroup','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x5950,0x11e));var _0x0595=function(_0x4c68bc,_0x1957d7){_0x4c68bc=_0x4c68bc-0x0;var _0x17bb71=_0x5950[_0x4c68bc];return _0x17bb71;};'use strict';var EventEmitter=require(_0x0595('0x0'));var ChatGroup=require(_0x0595('0x1'))['db'][_0x0595('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0595('0x3')](0x0);var events={'afterCreate':_0x0595('0x4'),'afterUpdate':_0x0595('0x5'),'afterDestroy':_0x0595('0x6')};function emitEvent(_0x294438){return function(_0x18065f,_0x5ea571,_0x5ba764){ChatGroupEvents[_0x0595('0x7')](_0x294438+':'+_0x18065f['id'],_0x18065f);ChatGroupEvents[_0x0595('0x7')](_0x294438,_0x18065f);_0x5ba764(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x0595('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x3f1f=['events','../../mysqldb','ChatGroup','emit','hasOwnProperty'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x3f1f,0x109));var _0xf3f1=function(_0x3fafac,_0x339db3){_0x3fafac=_0x3fafac-0x0;var _0xde16a3=_0x3f1f[_0x3fafac];return _0xde16a3;};'use strict';var EventEmitter=require(_0xf3f1('0x0'));var ChatGroup=require(_0xf3f1('0x1'))['db'][_0xf3f1('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x53dc9c){return function(_0x37beab,_0x19aacf,_0x57219e){ChatGroupEvents[_0xf3f1('0x3')](_0x53dc9c+':'+_0x37beab['id'],_0x37beab);ChatGroupEvents['emit'](_0x53dc9c,_0x37beab);_0x57219e(null);};}for(var e in events){if(events[_0xf3f1('0x4')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 05ee16f..51f3e01 100644
--- a/server/api/chatGroup/chatGroup.model.js
+++ b/server/api/chatGroup/chatGroup.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x893e=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash'];(function(_0x14ddd4,_0x5b527d){var _0x421616=function(_0x4f0a42){while(--_0x4f0a42){_0x14ddd4['push'](_0x14ddd4['shift']());}};_0x421616(++_0x5b527d);}(_0x893e,0x1a3));var _0xe893=function(_0xcf4560,_0xee698){_0xcf4560=_0xcf4560-0x0;var _0x1f8a96=_0x893e[_0xcf4560];return _0x1f8a96;};'use strict';var _=require(_0xe893('0x0'));var util=require('util');var logger=require(_0xe893('0x1'))(_0xe893('0x2'));var moment=require(_0xe893('0x3'));var BPromise=require(_0xe893('0x4'));var rp=require(_0xe893('0x5'));var fs=require('fs');var path=require(_0xe893('0x6'));var rimraf=require('rimraf');var config=require(_0xe893('0x7'));var attributes=require(_0xe893('0x8'));module[_0xe893('0x9')]=function(_0x2ce5c5,_0x40902a){return _0x2ce5c5['define'](_0xe893('0xa'),attributes,{'tableName':_0xe893('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5340=['chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x55dc9d,_0x5d9546){var _0x9111eb=function(_0x4d2887){while(--_0x4d2887){_0x55dc9d['push'](_0x55dc9d['shift']());}};_0x9111eb(++_0x5d9546);}(_0x5340,0x181));var _0x0534=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5340[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0534('0x0'));var util=require(_0x0534('0x1'));var logger=require(_0x0534('0x2'))(_0x0534('0x3'));var moment=require(_0x0534('0x4'));var BPromise=require('bluebird');var rp=require(_0x0534('0x5'));var fs=require('fs');var path=require(_0x0534('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0534('0x7'));module[_0x0534('0x8')]=function(_0x419007,_0xf96404){return _0x419007[_0x0534('0x9')](_0x0534('0xa'),attributes,{'tableName':_0x0534('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 6fd8e9b..37043dc 100644
--- a/server/api/chatGroup/chatGroup.rpc.js
+++ b/server/api/chatGroup/chatGroup.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd28=['message','info','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x52ca59,_0x279dda){var _0x1ab7e5=function(_0x2b8c74){while(--_0x2b8c74){_0x52ca59['push'](_0x52ca59['shift']());}};_0x1ab7e5(++_0x279dda);}(_0xfd28,0x148));var _0x8fd2=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xfd28[_0x38b14f];return _0x22a324;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});config[_0x8fd2('0xa')]=_['defaults'](config['redis'],{'host':_0x8fd2('0xb'),'port':0x18eb});var socket=require(_0x8fd2('0xc'))(new Redis(config[_0x8fd2('0xa')]));require('./chatGroup.socket')[_0x8fd2('0xd')](socket);function respondWithRpcPromise(_0x49ca87,_0x2842f3,_0x5aabf0){return new BPromise(function(_0x34ae5c,_0x4fdf0b){return client[_0x8fd2('0xe')](_0x49ca87,_0x5aabf0)['then'](function(_0x1b6558){logger['info'](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));logger[_0x8fd2('0x11')](_0x8fd2('0x12'),_0x2842f3,_0x8fd2('0x10'),JSON[_0x8fd2('0x13')](_0x1b6558));if(_0x1b6558[_0x8fd2('0x14')]){if(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x15')]===0x1f4){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);return _0x4fdf0b(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);}logger['error'](_0x8fd2('0xf'),_0x2842f3,_0x1b6558['error']['message']);return _0x34ae5c(_0x1b6558['error'][_0x8fd2('0x16')]);}else{logger[_0x8fd2('0x17')](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));_0x34ae5c(_0x1b6558['result'][_0x8fd2('0x16')]);}})[_0x8fd2('0x18')](function(_0x411943){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x411943);_0x4fdf0b(_0x411943);});});}
\ No newline at end of file
+var _0xc8f3=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0xc8f3,0x1d3));var _0x3c8f=function(_0x35fdff,_0x58bf32){_0x35fdff=_0x35fdff-0x0;var _0x44b12a=_0xc8f3[_0x35fdff];return _0x44b12a;};'use strict';var _=require(_0x3c8f('0x0'));var util=require(_0x3c8f('0x1'));var moment=require(_0x3c8f('0x2'));var BPromise=require(_0x3c8f('0x3'));var rs=require(_0x3c8f('0x4'));var fs=require('fs');var Redis=require(_0x3c8f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c8f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c8f('0x7'));var jayson=require(_0x3c8f('0x8'));var client=jayson[_0x3c8f('0x9')][_0x3c8f('0xa')]({'port':0x232a});config[_0x3c8f('0xb')]=_['defaults'](config[_0x3c8f('0xb')],{'host':_0x3c8f('0xc'),'port':0x18eb});var socket=require(_0x3c8f('0xd'))(new Redis(config[_0x3c8f('0xb')]));require(_0x3c8f('0xe'))[_0x3c8f('0xf')](socket);function respondWithRpcPromise(_0x419518,_0x1ce5c4,_0x3e9156){return new BPromise(function(_0x572141,_0x28fccc){return client[_0x3c8f('0x10')](_0x419518,_0x3e9156)['then'](function(_0x2f31f9){logger[_0x3c8f('0x11')](_0x3c8f('0x12'),_0x1ce5c4,'request\x20sent');logger[_0x3c8f('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1ce5c4,_0x3c8f('0x14'),JSON['stringify'](_0x2f31f9));if(_0x2f31f9[_0x3c8f('0x15')]){if(_0x2f31f9['error'][_0x3c8f('0x16')]===0x1f4){logger[_0x3c8f('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1ce5c4,_0x2f31f9[_0x3c8f('0x15')]['message']);return _0x28fccc(_0x2f31f9[_0x3c8f('0x15')][_0x3c8f('0x17')]);}logger[_0x3c8f('0x15')](_0x3c8f('0x12'),_0x1ce5c4,_0x2f31f9[_0x3c8f('0x15')][_0x3c8f('0x17')]);return _0x572141(_0x2f31f9[_0x3c8f('0x15')][_0x3c8f('0x17')]);}else{logger[_0x3c8f('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1ce5c4,_0x3c8f('0x14'));_0x572141(_0x2f31f9[_0x3c8f('0x18')][_0x3c8f('0x17')]);}})['catch'](function(_0x5ee69e){logger['error'](_0x3c8f('0x12'),_0x1ce5c4,_0x5ee69e);_0x28fccc(_0x5ee69e);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 7ab62ef..1c82f99 100644
--- a/server/api/chatGroup/chatGroup.socket.js
+++ b/server/api/chatGroup/chatGroup.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0573=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x450bfe,_0x5772a8){var _0x20d151=function(_0x3618de){while(--_0x3618de){_0x450bfe['push'](_0x450bfe['shift']());}};_0x20d151(++_0x5772a8);}(_0x0573,0xdc));var _0x3057=function(_0x360819,_0x3e8e07){_0x360819=_0x360819-0x0;var _0x353edf=_0x0573[_0x360819];return _0x353edf;};'use strict';var ChatGroupEvents=require(_0x3057('0x0'));var events=[_0x3057('0x1'),_0x3057('0x2'),_0x3057('0x3')];function createListener(_0xe8e06,_0x471aea){return function(_0x557113){_0x471aea[_0x3057('0x4')](_0xe8e06,_0x557113);};}function removeListener(_0x455bd9,_0x252fa2){return function(){ChatGroupEvents[_0x3057('0x5')](_0x455bd9,_0x252fa2);};}exports[_0x3057('0x6')]=function(_0x2fd4c6){for(var _0x2c1d90=0x0,_0x2ee40f=events[_0x3057('0x7')];_0x2c1d90<_0x2ee40f;_0x2c1d90++){var _0x2ac437=events[_0x2c1d90];var _0x4f5ebc=createListener(_0x3057('0x8')+_0x2ac437,_0x2fd4c6);ChatGroupEvents['on'](_0x2ac437,_0x4f5ebc);}};
\ No newline at end of file
+var _0x5460=['update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5460,0x72));var _0x0546=function(_0x18b7e8,_0x58058c){_0x18b7e8=_0x18b7e8-0x0;var _0x4a8bc0=_0x5460[_0x18b7e8];return _0x4a8bc0;};'use strict';var ChatGroupEvents=require(_0x0546('0x0'));var events=[_0x0546('0x1'),_0x0546('0x2'),_0x0546('0x3')];function createListener(_0x31c47b,_0x35930d){return function(_0x4ba037){_0x35930d[_0x0546('0x4')](_0x31c47b,_0x4ba037);};}function removeListener(_0x260107,_0x2b1e2a){return function(){ChatGroupEvents[_0x0546('0x5')](_0x260107,_0x2b1e2a);};}exports[_0x0546('0x6')]=function(_0x3b0638){for(var _0x56a284=0x0,_0x2a8f2a=events[_0x0546('0x7')];_0x56a284<_0x2a8f2a;_0x56a284++){var _0x171ae2=events[_0x56a284];var _0x292380=createListener(_0x0546('0x8')+_0x171ae2,_0x3b0638);ChatGroupEvents['on'](_0x171ae2,_0x292380);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 745963a..66534e6 100644
--- a/server/api/chatGroup/index.js
+++ b/server/api/chatGroup/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e2b=['post','create','addMembers','addMessage','update','destroy','delete','removeMembers','exports','multer','util','path','Router','fs-extra','../../components/auth/service','./chatGroup.controller','index','get','/describe','describe','/:id','show','/:id/unread','isAuthenticated','getUnread','/:id/members','getMembers','/:id/messages','getMessages'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0x1e2b,0x1d9));var _0xb1e2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1e2b[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xb1e2('0x0'));var util=require(_0xb1e2('0x1'));var path=require(_0xb1e2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1e2('0x3')]();var fs_extra=require(_0xb1e2('0x4'));var auth=require(_0xb1e2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb1e2('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb1e2('0x7')]);router[_0xb1e2('0x8')](_0xb1e2('0x9'),auth['isAuthenticated'](),controller[_0xb1e2('0xa')]);router['get'](_0xb1e2('0xb'),auth['isAuthenticated'](),controller[_0xb1e2('0xc')]);router[_0xb1e2('0x8')](_0xb1e2('0xd'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0xf')]);router[_0xb1e2('0x8')](_0xb1e2('0x10'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x11')]);router[_0xb1e2('0x8')](_0xb1e2('0x12'),auth['isAuthenticated'](),controller[_0xb1e2('0x13')]);router[_0xb1e2('0x14')]('/',auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x15')]);router[_0xb1e2('0x14')](_0xb1e2('0x10'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x16')]);router[_0xb1e2('0x14')](_0xb1e2('0x12'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x17')]);router['put'](_0xb1e2('0xb'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x18')]);router['delete'](_0xb1e2('0xb'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x19')]);router[_0xb1e2('0x1a')](_0xb1e2('0x10'),auth[_0xb1e2('0xe')](),controller[_0xb1e2('0x1b')]);module[_0xb1e2('0x1c')]=router;
\ No newline at end of file
+var _0x9c3f=['addMessage','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create'];(function(_0x48cf29,_0x2a36f3){var _0x4e81ff=function(_0x4f5513){while(--_0x4f5513){_0x48cf29['push'](_0x48cf29['shift']());}};_0x4e81ff(++_0x2a36f3);}(_0x9c3f,0x19c));var _0xf9c3=function(_0x1991fe,_0x2f3b62){_0x1991fe=_0x1991fe-0x0;var _0x1f6b32=_0x9c3f[_0x1991fe];return _0x1f6b32;};'use strict';var multer=require(_0xf9c3('0x0'));var util=require(_0xf9c3('0x1'));var path=require(_0xf9c3('0x2'));var timeout=require(_0xf9c3('0x3'));var express=require(_0xf9c3('0x4'));var router=express[_0xf9c3('0x5')]();var fs_extra=require(_0xf9c3('0x6'));var auth=require(_0xf9c3('0x7'));var interaction=require(_0xf9c3('0x8'));var config=require(_0xf9c3('0x9'));var controller=require('./chatGroup.controller');router[_0xf9c3('0xa')]('/',auth['isAuthenticated'](),controller[_0xf9c3('0xb')]);router['get'](_0xf9c3('0xc'),auth[_0xf9c3('0xd')](),controller['describe']);router[_0xf9c3('0xa')](_0xf9c3('0xe'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0xf')]);router[_0xf9c3('0xa')](_0xf9c3('0x10'),auth['isAuthenticated'](),controller[_0xf9c3('0x11')]);router[_0xf9c3('0xa')](_0xf9c3('0x12'),auth[_0xf9c3('0xd')](),controller['getMembers']);router['get'](_0xf9c3('0x13'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x14')]);router[_0xf9c3('0x15')]('/',auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x16')]);router['post'](_0xf9c3('0x12'),auth[_0xf9c3('0xd')](),controller['addMembers']);router[_0xf9c3('0x15')]('/:id/messages',auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x17')]);router[_0xf9c3('0x18')](_0xf9c3('0xe'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x19')]);router[_0xf9c3('0x1a')](_0xf9c3('0xe'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x1b')]);router[_0xf9c3('0x1a')](_0xf9c3('0x12'),auth[_0xf9c3('0xd')](),controller[_0xf9c3('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f15da3f..2218d46 100644
--- a/server/api/chatInteraction/chatInteraction.attributes.js
+++ b/server/api/chatInteraction/chatInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e61=['DATE','ENUM','sequelize','exports','INTEGER','star','thumb','TEXT','STRING','long'];(function(_0x169318,_0x3b4dfa){var _0x5d07b6=function(_0x1376a8){while(--_0x1376a8){_0x169318['push'](_0x169318['shift']());}};_0x5d07b6(++_0x3b4dfa);}(_0x9e61,0xca));var _0x19e6=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x9e61[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0x19e6('0x0'));module[_0x19e6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x19e6('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x19e6('0x3'),_0x19e6('0x4')),'defaultValue':_0x19e6('0x3')},'ratingMessage':{'type':Sequelize[_0x19e6('0x5')]},'pathTranscript':{'type':Sequelize[_0x19e6('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x19e6('0x6')]},'thirdDisposition':{'type':Sequelize[_0x19e6('0x6')]},'note':{'type':Sequelize[_0x19e6('0x6')]},'browserName':{'type':Sequelize[_0x19e6('0x6')]},'browserVersion':{'type':Sequelize[_0x19e6('0x6')]},'osName':{'type':Sequelize[_0x19e6('0x6')]},'osVersion':{'type':Sequelize[_0x19e6('0x6')]},'deviceModel':{'type':Sequelize[_0x19e6('0x6')]},'deviceVendor':{'type':Sequelize[_0x19e6('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x19e6('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x19e6('0x5')](_0x19e6('0x7'))},'read1stAt':{'type':Sequelize[_0x19e6('0x8')]},'lastMsgAt':{'type':Sequelize[_0x19e6('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x19e6('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x19e6('0x6')]},'customerPort':{'type':Sequelize[_0x19e6('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x19e6('0x2')]}};
\ No newline at end of file
+var _0x6a89=['TEXT','DATE','STRING','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x374226,_0x56ec5c){var _0xb2e1e8=function(_0x3a4412){while(--_0x3a4412){_0x374226['push'](_0x374226['shift']());}};_0xb2e1e8(++_0x56ec5c);}(_0x6a89,0x125));var _0x96a8=function(_0x5cc11e,_0x580887){_0x5cc11e=_0x5cc11e-0x0;var _0x4488a7=_0x6a89[_0x5cc11e];return _0x4488a7;};'use strict';var Sequelize=require(_0x96a8('0x0'));module[_0x96a8('0x1')]={'closed':{'type':Sequelize[_0x96a8('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x96a8('0x3')]},'ratingType':{'type':Sequelize[_0x96a8('0x4')](_0x96a8('0x5'),_0x96a8('0x6')),'defaultValue':_0x96a8('0x5')},'ratingMessage':{'type':Sequelize[_0x96a8('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x96a8('0x8')]},'disposition':{'type':Sequelize[_0x96a8('0x9')]},'secondDisposition':{'type':Sequelize[_0x96a8('0x9')]},'thirdDisposition':{'type':Sequelize[_0x96a8('0x9')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x96a8('0x9')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x96a8('0x9')]},'deviceModel':{'type':Sequelize[_0x96a8('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x96a8('0x9')]},'referer':{'type':Sequelize[_0x96a8('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x96a8('0x7')](_0x96a8('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x96a8('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x96a8('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x96a8('0x9')]},'customerPort':{'type':Sequelize[_0x96a8('0x9')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x96a8('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x96a8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index ff7bc7f..bb41fd8 100644
--- a/server/api/chatInteraction/chatInteraction.controller.js
+++ b/server/api/chatInteraction/chatInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf064=['register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','stack','name','send','render','merge','body','contact','account','ChatInteraction','rawAttributes','type','findAll','chat','user','show','params','query','keys','intersection','model','fields','attributes','include','find','catch','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','Unauthorized','attachId','join','server/files/attachments/','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsiteId','ContactId','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','User','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','hasOwnProperty','nolimit','sort','where','ChatInteractionId','map','$gte','split','options','rows','getMyMessages','filters','length','pick','filter','secret','includeAgent','push','includeAll','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','path','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x346149,_0x38a525){var _0xc2e79d=function(_0x757e0e){while(--_0x757e0e){_0x346149['push'](_0x346149['shift']());}};_0xc2e79d(++_0x38a525);}(_0xf064,0x193));var _0x4f06=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0xf064[_0x492535];return _0x256620;};'use strict';var rimraf=require(_0x4f06('0x0'));var zipdir=require(_0x4f06('0x1'));var rp=require(_0x4f06('0x2'));var moment=require(_0x4f06('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4f06('0x4'));var util=require('util');var path=require(_0x4f06('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f06('0x6'));var Redis=require(_0x4f06('0x7'));var interaction=require(_0x4f06('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x4f06('0x9'));var logger=require(_0x4f06('0xa'))(_0x4f06('0xb'));var config=require(_0x4f06('0xc'));var db=require(_0x4f06('0xd'))['db'];config[_0x4f06('0xe')]=_[_0x4f06('0xf')](config['redis'],{'host':_0x4f06('0x10'),'port':0x18eb});var socket=require(_0x4f06('0x11'))(new Redis(config[_0x4f06('0xe')]));require(_0x4f06('0x12'))[_0x4f06('0x13')](socket);var jayson=require(_0x4f06('0x14'));var client=jayson[_0x4f06('0x15')]['http']({'port':0x232b});var client9004=jayson[_0x4f06('0x15')][_0x4f06('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x3c8d38,_0x407f1c,_0x3628aa,_0x5ddf27){return new BPromise(function(_0x2472a7,_0x30b230){var _0x381c7e=_0x5ddf27||client;return _0x381c7e[_0x4f06('0x17')](_0x3c8d38,_0x3628aa)[_0x4f06('0x18')](function(_0x237924){logger[_0x4f06('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x407f1c,_0x4f06('0x1a'));logger[_0x4f06('0x1b')](_0x4f06('0x1c'),_0x407f1c,_0x4f06('0x1a'),JSON[_0x4f06('0x1d')](_0x237924));if(_0x237924[_0x4f06('0x1e')]){if(_0x237924[_0x4f06('0x1e')][_0x4f06('0x1f')]===0x1f4){logger[_0x4f06('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x407f1c,_0x237924['error'][_0x4f06('0x20')]);return _0x30b230(_0x237924[_0x4f06('0x1e')][_0x4f06('0x20')]);}logger['error'](_0x4f06('0x21'),_0x407f1c,_0x237924[_0x4f06('0x1e')][_0x4f06('0x20')]);return _0x2472a7(_0x237924[_0x4f06('0x1e')][_0x4f06('0x20')]);}else{logger[_0x4f06('0x19')](_0x4f06('0x21'),_0x407f1c,_0x4f06('0x1a'));_0x2472a7(_0x237924[_0x4f06('0x22')][_0x4f06('0x20')]);}})['catch'](function(_0x1c3cce){logger[_0x4f06('0x1e')](_0x4f06('0x21'),_0x407f1c,_0x1c3cce);_0x30b230(_0x1c3cce);});});}function respondWithStatusCode(_0x53d146,_0x37fb71){_0x37fb71=_0x37fb71||0xcc;return function(_0x2a96f6){if(_0x2a96f6){return _0x53d146[_0x4f06('0x23')](_0x37fb71);}return _0x53d146['status'](_0x37fb71)[_0x4f06('0x24')]();};}function respondWithResult(_0x29f8c2,_0x6951f0){_0x6951f0=_0x6951f0||0xc8;return function(_0x3310cd){if(_0x3310cd){return _0x29f8c2[_0x4f06('0x25')](_0x6951f0)[_0x4f06('0x26')](_0x3310cd);}};}function respondWithFilteredResult(_0x207f46,_0x342742){return function(_0x56642a){if(_0x56642a){var _0x5741f3=typeof _0x342742['offset']==='undefined'&&typeof _0x342742[_0x4f06('0x27')]===_0x4f06('0x28');var _0x5620dd=_0x56642a[_0x4f06('0x29')];var _0x9adce4=_0x5741f3?0x0:_0x342742[_0x4f06('0x2a')];var _0x122083=_0x5741f3?_0x56642a[_0x4f06('0x29')]:_0x342742[_0x4f06('0x2a')]+_0x342742[_0x4f06('0x27')];var _0x429657;if(_0x122083>=_0x5620dd){_0x122083=_0x5620dd;_0x429657=0xc8;}else{_0x429657=0xce;}_0x207f46[_0x4f06('0x25')](_0x429657);return _0x207f46[_0x4f06('0x2b')](_0x4f06('0x2c'),_0x9adce4+'-'+_0x122083+'/'+_0x5620dd)['json'](_0x56642a);}return null;};}function saveUpdates(_0x5ce1c1){return function(_0x279e3f){if(_0x279e3f){return _0x279e3f['update'](_0x5ce1c1)[_0x4f06('0x18')](function(_0x2069cb){return _0x2069cb;});}return null;};}function removeEntity(_0x5e11b8){return function(_0x5ea30d){if(_0x5ea30d){return _0x5ea30d['destroy']()[_0x4f06('0x18')](function(){_0x5e11b8[_0x4f06('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x294245){return function(_0x4affb6){if(!_0x4affb6){_0x294245[_0x4f06('0x23')](0x194);}return _0x4affb6;};}function handleError(_0x4a5fcd,_0x43a6d6){_0x43a6d6=_0x43a6d6||0x1f4;return function(_0x86faac){logger['error'](_0x86faac[_0x4f06('0x2d')]);if(_0x86faac[_0x4f06('0x2e')]){delete _0x86faac[_0x4f06('0x2e')];}_0x4a5fcd[_0x4f06('0x25')](_0x43a6d6)[_0x4f06('0x2f')](_0x86faac);};}function getMustacheRender(_0x1ded17,_0x1a1249){return Mustache[_0x4f06('0x30')](_0x1ded17,_[_0x4f06('0x31')](_0x1a1249[_0x4f06('0x32')],{'contact':_0x1a1249[_0x4f06('0x33')],'message':_0x1a1249[_0x4f06('0x20')],'agent':_0x1a1249['agent'],'interaction':_0x1a1249['interaction'],'account':_0x1a1249[_0x4f06('0x34')]}))||'';}exports['index']=function(_0xb40b73,_0xfd5417){var _0x161669={};var _0x2c66b4=_['map'](db[_0x4f06('0x35')][_0x4f06('0x36')],function(_0x42e2b8){return{'name':_0x42e2b8['fieldName'],'type':_0x42e2b8[_0x4f06('0x37')]['key']};});_0x161669=qs['getOptions'](_0x2c66b4,_0xb40b73);return interaction[_0x4f06('0x38')](_0x4f06('0x39'),_0xb40b73['query'],_0xb40b73[_0x4f06('0x3a')],_0x161669,_0x2c66b4)[_0x4f06('0x18')](respondWithFilteredResult(_0xfd5417,_0x161669))['catch'](handleError(_0xfd5417,null));};exports[_0x4f06('0x3b')]=function(_0x1bd786,_0x5af8e6){var _0x16ca31={'raw':![],'where':{'id':_0x1bd786[_0x4f06('0x3c')]['id']}},_0x4cf163={};_0x4cf163['model']=_['keys'](db[_0x4f06('0x35')][_0x4f06('0x36')]);_0x4cf163[_0x4f06('0x3d')]=_[_0x4f06('0x3e')](_0x1bd786[_0x4f06('0x3d')]);_0x4cf163['filters']=_[_0x4f06('0x3f')](_0x4cf163[_0x4f06('0x40')],_0x4cf163[_0x4f06('0x3d')]);_0x16ca31['attributes']=_[_0x4f06('0x3f')](_0x4cf163[_0x4f06('0x40')],qs[_0x4f06('0x41')](_0x1bd786[_0x4f06('0x3d')]['fields']));_0x16ca31['attributes']=_0x16ca31['attributes']['length']?_0x16ca31[_0x4f06('0x42')]:_0x4cf163['model'];if(_0x1bd786[_0x4f06('0x3d')]['includeAll']){_0x16ca31[_0x4f06('0x43')]=[{'all':!![]}];}_0x16ca31=_['merge']({},_0x16ca31,_0x1bd786['options']);return db['ChatInteraction'][_0x4f06('0x44')](_0x16ca31)[_0x4f06('0x18')](handleEntityNotFound(_0x5af8e6,null))['then'](respondWithResult(_0x5af8e6,null))[_0x4f06('0x45')](handleError(_0x5af8e6,null));};exports[_0x4f06('0x46')]=function(_0x3ad316,_0x5e68bd){return db[_0x4f06('0x35')][_0x4f06('0x46')](_0x3ad316[_0x4f06('0x32')],{})[_0x4f06('0x18')](respondWithResult(_0x5e68bd,0xc9))['catch'](handleError(_0x5e68bd,null));};exports[_0x4f06('0x47')]=function(_0x582eb6,_0x3e1987){if(_0x582eb6[_0x4f06('0x32')]['id']){delete _0x582eb6[_0x4f06('0x32')]['id'];}return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x582eb6[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x3e1987,null))[_0x4f06('0x18')](saveUpdates(_0x582eb6[_0x4f06('0x32')],null))[_0x4f06('0x18')](respondWithResult(_0x3e1987,null))['catch'](handleError(_0x3e1987,null));};exports[_0x4f06('0x48')]=function(_0x11dca7,_0x58a8ed){return db[_0x4f06('0x35')]['find']({'where':{'id':_0x11dca7[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x58a8ed,null))[_0x4f06('0x18')](removeEntity(_0x58a8ed,null))[_0x4f06('0x45')](handleError(_0x58a8ed,null));};exports[_0x4f06('0x49')]=function(_0x39a8e7,_0x48efd5){return db[_0x4f06('0x35')][_0x4f06('0x49')]()[_0x4f06('0x18')](respondWithResult(_0x48efd5,null))[_0x4f06('0x45')](handleError(_0x48efd5,null));};exports[_0x4f06('0x4a')]=function(_0x4b492e,_0x31c75c){var _0x33179a=_0x4b492e['params']['id'];var _0x310e34;var _0x273b5a;var _0x3c790c;return db[_0x4f06('0x35')][_0x4f06('0x4b')]({'where':{'id':_0x33179a}})[_0x4f06('0x18')](function(_0x11dea3){_0x310e34=_0x11dea3;return db[_0x4f06('0x4c')][_0x4f06('0x4b')]({'where':{'id':_0x11dea3['ChatWebsiteId']},'attributes':['id',_0x4f06('0x4d'),_0x4f06('0x4e'),'vidaooTopic',_0x4f06('0x4f'),_0x4f06('0x50')],'raw':!![]});})['then'](function(_0x56a13c){if(_0x56a13c&&_0x56a13c[_0x4f06('0x4d')]&&_0x56a13c[_0x4f06('0x4e')]){_0x273b5a=_0x56a13c;var _0x558cc6={'interaction':{'id':_0x33179a},'agent':{'id':_0x4b492e[_0x4f06('0x3a')]['id'],'name':_0x4b492e['user']['name'],'fullname':_0x4b492e['user'][_0x4f06('0x51')],'email':_0x4b492e['user'][_0x4f06('0x52')]},'contact':_0x4b492e['body'][_0x4f06('0x33')],'account':_0x4b492e[_0x4f06('0x32')][_0x4f06('0x34')]};var _0x3d2063={'rejectUnauthorized':![],'method':_0x4f06('0x53'),'url':_0x4f06('0x54'),'headers':{'X-APIKEY':_0x56a13c[_0x4f06('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4b492e[_0x4f06('0x3a')][_0x4f06('0x52')]],'buttons':null,'topic':_0x273b5a[_0x4f06('0x55')],'note':_[_0x4f06('0x56')](_0x273b5a[_0x4f06('0x4f')])?null:getMustacheRender(_0x273b5a[_0x4f06('0x4f')],_0x558cc6),'metadata':null},'redirect':_0x4f06('0x57'),'json':!![]};try{if(!_[_0x4f06('0x56')](_0x273b5a[_0x4f06('0x50')])){var _0x4a316a=getMustacheRender(_0x273b5a['vidaooMetadata'],_0x558cc6);var _0x3156dd=JSON['parse'](_0x4a316a);_0x3d2063['body']['metadata']=_0x3156dd;}}catch(_0x12cb2a){throw new db[(_0x4f06('0x58'))][(_0x4f06('0x59'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x3d2063);}else{throw new db[(_0x4f06('0x58'))][(_0x4f06('0x59'))](_0x4f06('0x5a'));}})[_0x4f06('0x18')](function(_0x6a08a1){_0x3c790c=_0x6a08a1;if(_0x3c790c['id']){var _0x2da217={'body':_0x3c790c[_0x4f06('0x5b')],'ChatWebsiteId':_0x273b5a['id'],'ChatInteractionId':_0x310e34['id'],'direction':_0x4f06('0x5c'),'UserId':_0x4b492e[_0x4f06('0x3a')]['id']};return db[_0x4f06('0x5d')][_0x4f06('0x46')](_0x2da217,{});}else{throw new db[(_0x4f06('0x58'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x4f06('0x18')](function(){return _0x310e34['updateAttributes']({'vidaooSessionId':_0x3c790c['id']});})[_0x4f06('0x18')](respondWithResult(_0x31c75c,null))[_0x4f06('0x45')](handleError(_0x31c75c,null));};exports[_0x4f06('0x5e')]=function(_0x5db13f,_0x3ace76){if(_0x5db13f[_0x4f06('0x32')]['id']){delete _0x5db13f[_0x4f06('0x32')]['id'];}return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x5db13f[_0x4f06('0x3c')]['id']},'include':[{'model':db[_0x4f06('0x5f')],'as':_0x4f06('0x60')}]})[_0x4f06('0x18')](handleEntityNotFound(_0x3ace76,null))['then'](saveUpdates(_0x5db13f[_0x4f06('0x32')],null))[_0x4f06('0x18')](respondWithResult(_0x3ace76,null))[_0x4f06('0x45')](handleError(_0x3ace76,null));};exports[_0x4f06('0x61')]=function(_0x29c64b,_0x16df28){if(_0x29c64b[_0x4f06('0x32')]['id']){delete _0x29c64b['body']['id'];}return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x29c64b[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](function(_0x135d04){if(!_0x135d04){logger[_0x4f06('0x1e')](_0x4f06('0x62'),_0x4f06('0x61'),0x194,_0x4f06('0x63'));_0x16df28[_0x4f06('0x23')](0x194);}else{if(_0x135d04[_0x4f06('0x64')]){throw new db[(_0x4f06('0x58'))][(_0x4f06('0x59'))](_0x4f06('0x65'));}}return _0x135d04;})[_0x4f06('0x18')](function(_0x4c028d){if(_0x4c028d){return _0x4c028d['update']({'closed':_0x29c64b[_0x4f06('0x32')][_0x4f06('0x66')],'disposition':_0x29c64b[_0x4f06('0x32')][_0x4f06('0x67')]})['then'](function(_0x56dd87){return _0x56dd87;});}})[_0x4f06('0x18')](function(){return respondWithRpcPromise(_0x4f06('0x68'),_0x4f06('0x61'),_0x29c64b[_0x4f06('0x32')],client9004);})[_0x4f06('0x18')](respondWithResult(_0x16df28,null))[_0x4f06('0x45')](handleError(_0x16df28,null));};exports[_0x4f06('0x69')]=function(_0x53d82e,_0x326d9f){_0x53d82e['body'][_0x4f06('0x2e')]=_0x53d82e[_0x4f06('0x6a')][_0x4f06('0x6b')];_0x53d82e[_0x4f06('0x32')][_0x4f06('0x6c')]=_0x53d82e[_0x4f06('0x6a')]['filename'];_0x53d82e[_0x4f06('0x32')]['type']=_0x53d82e[_0x4f06('0x6a')][_0x4f06('0x6d')];return db[_0x4f06('0x6e')][_0x4f06('0x46')](_0x53d82e[_0x4f06('0x32')])[_0x4f06('0x18')](respondWithResult(_0x326d9f,0xc9))[_0x4f06('0x45')](handleError(_0x326d9f,null));};exports['attachmentDownload']=function(_0x14093b,_0x2b6452){return db[_0x4f06('0x35')]['findOne']({'where':{'id':_0x14093b['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2b6452,null))[_0x4f06('0x18')](function(_0x5a8ed2){if(_0x5a8ed2){if(_0x5a8ed2[_0x4f06('0x66')]){return _0x2b6452['status'](0x193)[_0x4f06('0x26')]({'status':0x193,'message':_0x4f06('0x6f')});}return db['Attachment'][_0x4f06('0x4b')]({'where':{'id':_0x14093b[_0x4f06('0x3d')][_0x4f06('0x70')]},'raw':!![]})[_0x4f06('0x18')](handleEntityNotFound(_0x2b6452,null));}})['then'](function(_0x5d250f){if(_0x5d250f){var _0x3afa41=_0x5d250f['ChatOfflineMessageId']!==null;var _0x5237e3=path[_0x4f06('0x71')](config['root'],_0x4f06('0x72'));if(_0x3afa41){_0x5237e3=path['join'](_0x5237e3,'offline-chat/');}var _0x4410dc=path[_0x4f06('0x71')](_0x5237e3,_0x5d250f[_0x4f06('0x6c')]);return _0x2b6452[_0x4f06('0x73')](_0x4410dc);}})[_0x4f06('0x45')](handleError(_0x2b6452,null));};exports[_0x4f06('0x74')]=function(_0x49be77,_0x3676d3){var _0x309ac2=null;var _0x158963=null;var _0x46fc4e=null;if(_0x49be77[_0x4f06('0x32')]['id']){delete _0x49be77['body']['id'];}if(_0x49be77[_0x4f06('0x32')][_0x4f06('0x75')]){_0x46fc4e=path[_0x4f06('0x71')](config[_0x4f06('0x76')],_0x4f06('0x77'),util[_0x4f06('0x78')](_0x4f06('0x79'),Date[_0x4f06('0x7a')]()));_0x49be77[_0x4f06('0x32')][_0x4f06('0x7b')]=_0x46fc4e;}return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x49be77[_0x4f06('0x3c')]['id']},'include':[{'model':db[_0x4f06('0x5d')],'as':_0x4f06('0x7c'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x3676d3,null))[_0x4f06('0x18')](saveUpdates(_0x49be77[_0x4f06('0x32')],null))[_0x4f06('0x18')](function(_0x59cedb){if(_0x59cedb){_0x309ac2=_0x59cedb;return db[_0x4f06('0x4c')][_0x4f06('0x44')]({'where':{'id':_0x309ac2[_0x4f06('0x7d')]}});}})[_0x4f06('0x18')](function(_0x2e3978){if(_0x2e3978){_0x158963=_0x2e3978;return db['CmContact'][_0x4f06('0x44')]({'where':{'id':_0x309ac2[_0x4f06('0x7e')]}});}})[_0x4f06('0x18')](function(_0x4d208b){if(_0x4d208b){if(_0x46fc4e){var _0x4c924b=null;for(var _0x3056c7=0x1;_0x3056c7<_0x309ac2['Messages']['length'];++_0x3056c7){_0x4c924b=_0x309ac2[_0x4f06('0x7c')][_0x3056c7];var _0x5e8538=_0x4c924b[_0x4f06('0x64')]?util['format']('%s%d',_0x158963[_0x4f06('0x7f')],_0x4c924b[_0x4f06('0x64')]):'System';var _0x42bc88=_0x49be77[_0x4f06('0x32')][_0x4f06('0x80')]||util[_0x4f06('0x78')](_0x4f06('0x81'),_0x4f06('0x82'),_0x4c924b[_0x4f06('0x7e')]);switch(_0x158963[_0x4f06('0x83')]){case _0x4f06('0x84'):_0x5e8538=_0x4c924b[_0x4f06('0x64')]?util[_0x4f06('0x78')](_0x4f06('0x81'),_0x158963['agentAlias'],_0x4c924b[_0x4f06('0x64')]):_0x4f06('0x85');break;case _0x4f06('0x86'):_0x5e8538=_0x4c924b[_0x4f06('0x64')]?_0x4c924b[_0x4f06('0x87')][_0x4f06('0x88')]||_0x4c924b['User'][_0x4f06('0x51')]:_0x4f06('0x85');break;case'agent_fullname':_0x5e8538=_0x4c924b[_0x4f06('0x64')]?_0x4c924b['User']['fullname']:'System';break;default:_0x5e8538=_0x4c924b['UserId']?util[_0x4f06('0x78')](_0x4f06('0x81'),_0x158963[_0x4f06('0x7f')],_0x4c924b[_0x4f06('0x64')]):_0x4f06('0x85');}var _0x39c1ea=util[_0x4f06('0x78')](_0x4f06('0x89'),moment(_0x4c924b[_0x4f06('0x8a')])[_0x4f06('0x78')](_0x4f06('0x8b')),_0x4c924b[_0x4f06('0x8c')]==='in'?_0x42bc88:_0x5e8538,_0x4c924b[_0x4f06('0x32')]);if(!_0x4c924b['secret']){fs[_0x4f06('0x8d')](_0x46fc4e,_0x39c1ea);}}return db[_0x4f06('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4f06('0x8f'),'raw':!![],'include':[{'model':db[_0x4f06('0x90')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x4f0dd0){if(!_0x4f0dd0||!_0x4f0dd0[_0x4f06('0x8f')]||!_0x49be77[_0x4f06('0x32')])return _0x309ac2;var _0x44d48b=_0x4f0dd0[_0x4f06('0x91')]();return respondWithRpcPromise(_0x4f06('0x92'),_0x4f06('0x93'),{'account':_0x44d48b,'message':{'from':util[_0x4f06('0x78')](_0x4f06('0x94'),_0x4f0dd0['name'],_0x4f0dd0['email']||_0x4f0dd0[_0x4f06('0x8f')][_0x4f06('0x3a')]),'to':_0x49be77['body'][_0x4f06('0x75')],'subject':_0x4f06('0x95'),'text':util[_0x4f06('0x78')](_0x4f06('0x96'),_0x49be77[_0x4f06('0x32')][_0x4f06('0x75')]),'attachments':[{'path':_0x46fc4e}]}})[_0x4f06('0x18')](function(){return _0x309ac2;})[_0x4f06('0x45')](function(_0x58bfe9){logger[_0x4f06('0x1e')](_0x58bfe9);});})[_0x4f06('0x18')](respondWithStatusCode(_0x3676d3,0xc8))[_0x4f06('0x45')](handleError(_0x3676d3,null));};exports['addMessage']=function(_0x392ab8,_0x3c1623){return db[_0x4f06('0x5d')][_0x4f06('0x44')]({'where':{'id':_0x392ab8[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x3c1623,null))['then'](function(_0x4cb3be){if(_0x4cb3be){return _0x4cb3be['addMessage'](_0x392ab8[_0x4f06('0x32')][_0x4f06('0x97')],_[_0x4f06('0x98')](_0x392ab8[_0x4f06('0x32')],['ids','id'])||{});}})[_0x4f06('0x18')](respondWithResult(_0x3c1623,null))[_0x4f06('0x45')](handleError(_0x3c1623,null));};exports['getMessages']=function(_0xdd7c53,_0x4660e5){var _0x5e0416={'raw':![],'where':{}};var _0x3166bd={};var _0x292094={'count':0x0,'rows':[]};return db[_0x4f06('0x35')]['findOne']({'where':{'id':_0xdd7c53['params']['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x4660e5,null))[_0x4f06('0x18')](function(_0x204207){if(_0x204207){_0x3166bd['model']=_['keys'](db[_0x4f06('0x5d')][_0x4f06('0x36')]);_0x3166bd['query']=_[_0x4f06('0x3e')](_0xdd7c53['query']);_0x3166bd['filters']=_[_0x4f06('0x3f')](_0x3166bd[_0x4f06('0x40')],_0x3166bd[_0x4f06('0x3d')]);_0x5e0416[_0x4f06('0x42')]=_[_0x4f06('0x3f')](_0x3166bd['model'],qs[_0x4f06('0x41')](_0xdd7c53[_0x4f06('0x3d')]['fields']));_0x5e0416[_0x4f06('0x42')]=_0x5e0416[_0x4f06('0x42')]['length']?_0x5e0416[_0x4f06('0x42')]:_0x3166bd[_0x4f06('0x40')];if(!_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x99')](_0x4f06('0x9a'))){_0x5e0416[_0x4f06('0x27')]=qs[_0x4f06('0x27')](_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x27')]);_0x5e0416[_0x4f06('0x2a')]=qs[_0x4f06('0x2a')](_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x2a')]);}_0x5e0416['order']=qs[_0x4f06('0x9b')](_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x9b')]);_0x5e0416[_0x4f06('0x9c')]=qs['filters'](_['pick'](_0xdd7c53[_0x4f06('0x3d')],_0x3166bd['filters']));_0x5e0416[_0x4f06('0x9c')][_0x4f06('0x9d')]=_0x204207['id'];if(_0xdd7c53['query']['filter']){_0x5e0416[_0x4f06('0x9c')]=_['merge'](_0x5e0416[_0x4f06('0x9c')],{'$or':_[_0x4f06('0x9e')](_0x5e0416[_0x4f06('0x42')],function(_0x9a8ce7){var _0x181219={};_0x181219[_0x9a8ce7]={'$like':'%'+_0xdd7c53[_0x4f06('0x3d')]['filter']+'%'};return _0x181219;})});}if(_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x9f')]){var _0x30729c=_0xdd7c53[_0x4f06('0x3d')][_0x4f06('0x9f')][_0x4f06('0xa0')](',');var _0x17f31b={};_0x17f31b[_0x30729c[0x0]]={'$gte':moment(_0x30729c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5e0416['where']=_[_0x4f06('0x31')](_0x5e0416[_0x4f06('0x9c')],_0x17f31b);}_0x5e0416=_[_0x4f06('0x31')]({},_0x5e0416,_0xdd7c53[_0x4f06('0xa1')]);return db[_0x4f06('0x5d')]['count']({'where':_0x5e0416[_0x4f06('0x9c')]})[_0x4f06('0x18')](function(_0x4c17b9){_0x292094[_0x4f06('0x29')]=_0x4c17b9;if(_0xdd7c53[_0x4f06('0x3d')]['includeAll']){_0x5e0416['include']=[{'all':!![]}];}return db[_0x4f06('0x5d')]['findAll'](_0x5e0416);})[_0x4f06('0x18')](function(_0x194e8c){_0x292094[_0x4f06('0xa2')]=_0x194e8c;return _0x292094;});}})[_0x4f06('0x18')](respondWithFilteredResult(_0x4660e5,_0x5e0416))[_0x4f06('0x45')](handleError(_0x4660e5,null));};exports[_0x4f06('0xa3')]=function(_0x5d4037,_0x34dbbc){var _0x29d1dd={'where':{}},_0x2f58fd={},_0xcdd8fc={'count':0x0,'rows':[]};return db[_0x4f06('0x35')][_0x4f06('0x4b')]({'where':{'id':_0x5d4037[_0x4f06('0x3c')]['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x34dbbc,null))['then'](function(_0x27e8b9){if(_0x27e8b9){_0x2f58fd[_0x4f06('0x40')]=_[_0x4f06('0x3e')](db['ChatMessage'][_0x4f06('0x36')]);_0x2f58fd['query']=_[_0x4f06('0x3e')](_0x5d4037['query']);_0x2f58fd[_0x4f06('0xa4')]=_[_0x4f06('0x3f')](_0x2f58fd[_0x4f06('0x40')],_0x2f58fd['query']);_0x29d1dd['attributes']=_[_0x4f06('0x3f')](_0x2f58fd[_0x4f06('0x40')],qs[_0x4f06('0x41')](_0x5d4037[_0x4f06('0x3d')]['fields']));_0x29d1dd['attributes']=_0x29d1dd['attributes'][_0x4f06('0xa5')]?_0x29d1dd[_0x4f06('0x42')]:_0x2f58fd[_0x4f06('0x40')];if(!_0x5d4037[_0x4f06('0x3d')][_0x4f06('0x99')](_0x4f06('0x9a'))){_0x29d1dd[_0x4f06('0x27')]=qs[_0x4f06('0x27')](_0x5d4037[_0x4f06('0x3d')][_0x4f06('0x27')]);_0x29d1dd['offset']=qs[_0x4f06('0x2a')](_0x5d4037[_0x4f06('0x3d')]['offset']);}_0x29d1dd['order']=qs[_0x4f06('0x9b')](_0x5d4037[_0x4f06('0x3d')][_0x4f06('0x9b')]);_0x29d1dd['where']=qs[_0x4f06('0xa4')](_[_0x4f06('0xa6')](_0x5d4037[_0x4f06('0x3d')],_0x2f58fd[_0x4f06('0xa4')]));_0x29d1dd['where'][_0x4f06('0x9d')]=_0x27e8b9['id'];if(_0x5d4037[_0x4f06('0x3d')][_0x4f06('0xa7')]){_0x29d1dd[_0x4f06('0x9c')]=_[_0x4f06('0x31')](_0x29d1dd['where'],{'$or':_[_0x4f06('0x9e')](_0x29d1dd[_0x4f06('0x42')],function(_0x70bf48){var _0x569df3={};_0x569df3[_0x70bf48]={'$like':'%'+_0x5d4037[_0x4f06('0x3d')][_0x4f06('0xa7')]+'%'};return _0x569df3;})});}_0x29d1dd[_0x4f06('0x9c')][_0x4f06('0xa8')]=![];if(_0x5d4037[_0x4f06('0x3d')]['id']){_0x29d1dd[_0x4f06('0x9c')]['id']={'$gt':_0x5d4037['query']['id']};}_0x29d1dd=_[_0x4f06('0x31')]({},_0x29d1dd,_0x5d4037[_0x4f06('0xa1')]);return db['ChatMessage'][_0x4f06('0x29')]({'where':_0x29d1dd[_0x4f06('0x9c')]})[_0x4f06('0x18')](function(_0x116a1d){_0xcdd8fc[_0x4f06('0x29')]=_0x116a1d;_0x29d1dd['include']=[];if(_0x5d4037[_0x4f06('0x3d')][_0x4f06('0xa9')]){_0x29d1dd[_0x4f06('0x43')][_0x4f06('0xaa')]({'model':db[_0x4f06('0x87')],'as':'User','attributes':['id',_0x4f06('0x51'),_0x4f06('0x88')]});}if(_0x5d4037[_0x4f06('0x3d')][_0x4f06('0xab')]){_0x29d1dd['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x29d1dd);})[_0x4f06('0x18')](function(_0x8c8b8a){_0xcdd8fc[_0x4f06('0xa2')]=_0x8c8b8a;return _0xcdd8fc;});}})[_0x4f06('0x18')](respondWithFilteredResult(_0x34dbbc,_0x29d1dd))[_0x4f06('0x45')](handleError(_0x34dbbc,null));};exports[_0x4f06('0xac')]=function(_0x655a36,_0x523e20){return db[_0x4f06('0x35')][_0x4f06('0x44')]({'where':{'id':_0x655a36[_0x4f06('0x3c')]['id']}})['then'](handleEntityNotFound(_0x523e20,null))['then'](function(_0x51fc1a){if(_0x51fc1a){return _0x51fc1a[_0x4f06('0xad')](_0x655a36[_0x4f06('0x32')][_0x4f06('0x97')],_[_0x4f06('0x98')](_0x655a36[_0x4f06('0x32')],[_0x4f06('0x97'),'id'])||{})[_0x4f06('0xae')](function(){return db[_0x4f06('0xaf')]['findAll']({'attributes':['id',_0x4f06('0x2e'),_0x4f06('0xb0')],'where':{'id':_0x655a36[_0x4f06('0x32')][_0x4f06('0x97')]}});})['then'](function(_0x306eb1){socket[_0x4f06('0xb1')]('chatInteractionTags:save',{'id':Number(_0x655a36[_0x4f06('0x3c')]['id']),'tags':_0x306eb1||[]});return{'id':Number(_0x655a36['params']['id']),'tags':_0x306eb1||[]};});}})[_0x4f06('0x18')](respondWithResult(_0x523e20,null))[_0x4f06('0x45')](handleError(_0x523e20,null));};exports[_0x4f06('0xb2')]=function(_0xda1fcf,_0x1e9f48){return db[_0x4f06('0x35')]['find']({'where':{'id':_0xda1fcf['params']['id']}})[_0x4f06('0x18')](handleEntityNotFound(_0x1e9f48,null))['then'](function(_0x1ce628){if(_0x1ce628){return _0x1ce628['removeTags'](_0xda1fcf[_0x4f06('0x3d')]['ids']);}})[_0x4f06('0x18')](respondWithStatusCode(_0x1e9f48,null))[_0x4f06('0x45')](handleError(_0x1e9f48,null));};exports[_0x4f06('0x73')]=function(_0x234c96,_0xded0e4){var _0x92e6d4=moment()[_0x4f06('0xb3')]()[_0x4f06('0xb4')]();var _0x2368b8=path[_0x4f06('0x71')](config['root'],_0x4f06('0xb5'),'files',_0x4f06('0xb6'));var _0x3978da=path[_0x4f06('0x71')](config[_0x4f06('0x76')],'server','files',_0x4f06('0xb7'));var _0x21d630=path[_0x4f06('0x71')](_0x2368b8,_0x92e6d4);var _0x1337a0=util[_0x4f06('0x78')](_0x4f06('0xb8'),_0x234c96[_0x4f06('0x3c')]['id'],_0x92e6d4);var _0x19333c=path[_0x4f06('0x71')](_0x2368b8,_0x1337a0);var _0xfb6946=[];_0xfb6946[_0x4f06('0xaa')]({'model':db[_0x4f06('0x87')],'as':_0x4f06('0x87'),'attributes':['id','fullname'],'raw':!![]});_0xfb6946['push']({'model':db[_0x4f06('0x5f')],'as':_0x4f06('0x60'),'attributes':['id',_0x4f06('0xb9'),_0x4f06('0xba')],'raw':!![]});if(_0x234c96[_0x4f06('0x3d')][_0x4f06('0xb7')]){_0xfb6946[_0x4f06('0xaa')]({'model':db[_0x4f06('0x6e')],'as':_0x4f06('0x6e'),'raw':!![]});}var _0x388ef6=[{'model':db[_0x4f06('0x5d')],'as':_0x4f06('0x7c'),'attributes':['id','body',_0x4f06('0x8a'),_0x4f06('0x8c'),'secret',_0x4f06('0xbb')],'include':_0xfb6946}];_0x388ef6['push']({'model':db['ChatWebsite'],'as':_0x4f06('0xbc'),'attributes':['id',_0x4f06('0x2e')]});_0x388ef6['push']({'model':db[_0x4f06('0x87')],'as':_0x4f06('0xbd'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x4f06('0x44')]({'where':{'id':_0x234c96[_0x4f06('0x3c')]['id']},'include':_0x388ef6})[_0x4f06('0x18')](handleEntityNotFound(_0xded0e4,null))[_0x4f06('0x18')](function(_0x58f1db){if(_0x58f1db){var _0x48481a=_0x58f1db[_0x4f06('0xbe')]({'plain':!![]});fs[_0x4f06('0xbf')](_0x21d630);var _0x2d1978={'channel':_0x4f06('0xc0'),'account':_0x48481a[_0x4f06('0xbc')][_0x4f06('0x2e')],'agent':_0x48481a[_0x4f06('0xbd')]?_0x48481a['Owner']['fullname']:'N.A.','createdAt':moment(_0x48481a['createdAt'])['format'](_0x4f06('0xc1'))['toString'](),'closedAt':_0x48481a['closed']?moment(_0x48481a[_0x4f06('0xc2')])[_0x4f06('0x78')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x48481a[_0x4f06('0x67')],'chatInfo':{'browser':_0x48481a[_0x4f06('0xc3')],'os':_0x48481a[_0x4f06('0xc4')],'referer':_0x48481a[_0x4f06('0xc5')],'customerIp':_0x48481a[_0x4f06('0xc6')],'customerPort':_0x48481a['customerPort']?_0x48481a[_0x4f06('0xc7')]:'N.A.'},'messages':_(_0x48481a[_0x4f06('0x7c')])['tail']()[_0x4f06('0xa7')]({'secret':![]})[_0x4f06('0x9e')](function(_0x2b1a5f){if(_0x2b1a5f[_0x4f06('0x6e')]){var _0x1dbff4=path[_0x4f06('0x71')](_0x3978da,_0x2b1a5f[_0x4f06('0x6e')][_0x4f06('0x6c')]);if(fs[_0x4f06('0xc8')](_0x1dbff4)){fs[_0x4f06('0xc9')](_0x1dbff4)[_0x4f06('0xca')](fs[_0x4f06('0xcb')](path[_0x4f06('0x71')](_0x21d630,_0x2b1a5f[_0x4f06('0x6e')][_0x4f06('0x6c')])));}}return{'date':moment(_0x2b1a5f[_0x4f06('0x8a')])[_0x4f06('0x78')](_0x4f06('0xc1'))[_0x4f06('0xb4')](),'sender':_0x2b1a5f[_0x4f06('0x8c')]===_0x4f06('0x5c')?_0x2b1a5f[_0x4f06('0x87')]?_0x2b1a5f[_0x4f06('0x87')][_0x4f06('0x51')]:'System':_0x2b1a5f[_0x4f06('0x60')][_0x4f06('0xb9')]+(_0x2b1a5f[_0x4f06('0x60')]['lastName']?'\x20'+_0x2b1a5f['Contact'][_0x4f06('0xba')]:''),'body':_0x2b1a5f[_0x4f06('0x6e')]?_0x2b1a5f[_0x4f06('0x6e')]['basename']:_0x2b1a5f[_0x4f06('0x32')],'direction':_0x2b1a5f[_0x4f06('0x8c')]===_0x4f06('0x5c')?'A':'C','secret':_0x2b1a5f['secret'],'read':_0x2b1a5f[_0x4f06('0xbb')],'attachment':_0x2b1a5f[_0x4f06('0x6e')]};})[_0x4f06('0xcc')]()};return ejs[_0x4f06('0xcd')](path[_0x4f06('0x71')](config[_0x4f06('0x76')],'server',_0x4f06('0xce'),_0x4f06('0xcf')),{'interaction':_0x2d1978})[_0x4f06('0x18')](function(_0x148474){var _0x125939=path[_0x4f06('0x71')](_0x21d630,'transcript-'+_0x48481a['id']+'-'+_0x92e6d4+'.pdf');var _0x2783c6={'path':_0x125939,'channel':_0x4f06('0xc0'),'interactionId':_0x48481a['id']};return pdf[_0x4f06('0xd0')](_0x148474,_0x2783c6);})[_0x4f06('0x18')](function(){return new Promise(function(_0x2d7806,_0x402aa2){zipdir(_0x21d630,{'saveTo':_0x19333c},function(_0x55ce12,_0xda293e){if(_0x55ce12)return _0x402aa2(_0x55ce12);return _0x2d7806(_0xda293e);});})[_0x4f06('0x18')](function(){return new BPromise(function(_0x511691,_0x5b02ed){rimraf(_0x21d630,function(_0xdb9927){if(_0xdb9927)_0x5b02ed(_0xdb9927);return _0x511691();});});})[_0x4f06('0x18')](function(){return _0xded0e4[_0x4f06('0x73')](_0x19333c,_0x1337a0,function(_0x4d4b20){if(_0x4d4b20){logger['error'](_0x4f06('0xd1'),_0x4d4b20);}else{fs[_0x4f06('0xd2')](_0x19333c);}});});});}else{return _0xded0e4[_0x4f06('0x23')](0xc8);}})[_0x4f06('0x45')](handleError(_0xded0e4,null));};
\ No newline at end of file
+var _0xa6e3=['./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','name','send','render','merge','body','agent','interaction','account','index','map','ChatInteraction','rawAttributes','type','key','findAll','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','find','create','describe','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','join_url','out','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','originalname','file','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','pathTranscript','Messages','User','ChatWebsiteId','%s%d','agentAlias','Visitor','ContactId','website_alias','System','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','sort','pick','where','ChatInteractionId','filter','$gte','split','options','hasOwnProperty','nolimit','secret','includeAgent','rows','addTags','setTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','push','firstName','lastName','direction','read','Account','Owner','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','N.A.','tail','basename','createReadStream','pipe','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter'];(function(_0x3e5c2b,_0x1bf391){var _0x460f3c=function(_0x344d0a){while(--_0x344d0a){_0x3e5c2b['push'](_0x3e5c2b['shift']());}};_0x460f3c(++_0x1bf391);}(_0xa6e3,0x180));var _0x3a6e=function(_0x58e8eb,_0x2ac0c7){_0x58e8eb=_0x58e8eb-0x0;var _0x168540=_0xa6e3[_0x58e8eb];return _0x168540;};'use strict';var rimraf=require(_0x3a6e('0x0'));var zipdir=require(_0x3a6e('0x1'));var rp=require(_0x3a6e('0x2'));var moment=require(_0x3a6e('0x3'));var BPromise=require(_0x3a6e('0x4'));var Mustache=require(_0x3a6e('0x5'));var util=require(_0x3a6e('0x6'));var path=require('path');var ejs=require(_0x3a6e('0x7'));var fs=require('fs');var _=require(_0x3a6e('0x8'));var Redis=require(_0x3a6e('0x9'));var interaction=require(_0x3a6e('0xa'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x3a6e('0xb'))('api');var config=require(_0x3a6e('0xc'));var db=require(_0x3a6e('0xd'))['db'];config['redis']=_[_0x3a6e('0xe')](config[_0x3a6e('0xf')],{'host':_0x3a6e('0x10'),'port':0x18eb});var socket=require(_0x3a6e('0x11'))(new Redis(config[_0x3a6e('0xf')]));require(_0x3a6e('0x12'))[_0x3a6e('0x13')](socket);var jayson=require(_0x3a6e('0x14'));var client=jayson[_0x3a6e('0x15')][_0x3a6e('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x3a6e('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x204ab7,_0x1fb3ca,_0x397c36,_0x22f25f){return new BPromise(function(_0x2a71c2,_0x3ce009){var _0x1d57ef=_0x22f25f||client;return _0x1d57ef[_0x3a6e('0x17')](_0x204ab7,_0x397c36)[_0x3a6e('0x18')](function(_0x2db7f8){logger['info'](_0x3a6e('0x19'),_0x1fb3ca,'request\x20sent');logger[_0x3a6e('0x1a')](_0x3a6e('0x1b'),_0x1fb3ca,_0x3a6e('0x1c'),JSON[_0x3a6e('0x1d')](_0x2db7f8));if(_0x2db7f8[_0x3a6e('0x1e')]){if(_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x1f')]===0x1f4){logger[_0x3a6e('0x1e')](_0x3a6e('0x19'),_0x1fb3ca,_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x20')]);return _0x3ce009(_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x20')]);}logger[_0x3a6e('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x1fb3ca,_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x20')]);return _0x2a71c2(_0x2db7f8[_0x3a6e('0x1e')][_0x3a6e('0x20')]);}else{logger[_0x3a6e('0x21')](_0x3a6e('0x19'),_0x1fb3ca,_0x3a6e('0x1c'));_0x2a71c2(_0x2db7f8[_0x3a6e('0x22')][_0x3a6e('0x20')]);}})['catch'](function(_0x5526ad){logger[_0x3a6e('0x1e')](_0x3a6e('0x19'),_0x1fb3ca,_0x5526ad);_0x3ce009(_0x5526ad);});});}function respondWithStatusCode(_0xab20ae,_0x1681fc){_0x1681fc=_0x1681fc||0xcc;return function(_0x1d0f57){if(_0x1d0f57){return _0xab20ae[_0x3a6e('0x23')](_0x1681fc);}return _0xab20ae[_0x3a6e('0x24')](_0x1681fc)[_0x3a6e('0x25')]();};}function respondWithResult(_0x3e2b60,_0x4ee871){_0x4ee871=_0x4ee871||0xc8;return function(_0x5edfd5){if(_0x5edfd5){return _0x3e2b60[_0x3a6e('0x24')](_0x4ee871)[_0x3a6e('0x26')](_0x5edfd5);}};}function respondWithFilteredResult(_0x5f2e29,_0x52338a){return function(_0x379776){if(_0x379776){var _0x24653a=typeof _0x52338a[_0x3a6e('0x27')]==='undefined'&&typeof _0x52338a[_0x3a6e('0x28')]===_0x3a6e('0x29');var _0x32eef7=_0x379776['count'];var _0x3ada30=_0x24653a?0x0:_0x52338a[_0x3a6e('0x27')];var _0x47543b=_0x24653a?_0x379776[_0x3a6e('0x2a')]:_0x52338a['offset']+_0x52338a['limit'];var _0x39943d;if(_0x47543b>=_0x32eef7){_0x47543b=_0x32eef7;_0x39943d=0xc8;}else{_0x39943d=0xce;}_0x5f2e29[_0x3a6e('0x24')](_0x39943d);return _0x5f2e29['set'](_0x3a6e('0x2b'),_0x3ada30+'-'+_0x47543b+'/'+_0x32eef7)[_0x3a6e('0x26')](_0x379776);}return null;};}function saveUpdates(_0x2a3dc1){return function(_0x124556){if(_0x124556){return _0x124556[_0x3a6e('0x2c')](_0x2a3dc1)[_0x3a6e('0x18')](function(_0x1b78ff){return _0x1b78ff;});}return null;};}function removeEntity(_0x4323ea){return function(_0x5228de){if(_0x5228de){return _0x5228de[_0x3a6e('0x2d')]()['then'](function(){_0x4323ea[_0x3a6e('0x24')](0xcc)[_0x3a6e('0x25')]();});}};}function handleEntityNotFound(_0x598e17){return function(_0x4ef2c2){if(!_0x4ef2c2){_0x598e17[_0x3a6e('0x23')](0x194);}return _0x4ef2c2;};}function handleError(_0xf28a69,_0x3082b2){_0x3082b2=_0x3082b2||0x1f4;return function(_0x657a9a){logger[_0x3a6e('0x1e')](_0x657a9a['stack']);if(_0x657a9a[_0x3a6e('0x2e')]){delete _0x657a9a['name'];}_0xf28a69[_0x3a6e('0x24')](_0x3082b2)[_0x3a6e('0x2f')](_0x657a9a);};}function getMustacheRender(_0x2680ea,_0x1d7e13){return Mustache[_0x3a6e('0x30')](_0x2680ea,_[_0x3a6e('0x31')](_0x1d7e13[_0x3a6e('0x32')],{'contact':_0x1d7e13['contact'],'message':_0x1d7e13[_0x3a6e('0x20')],'agent':_0x1d7e13[_0x3a6e('0x33')],'interaction':_0x1d7e13[_0x3a6e('0x34')],'account':_0x1d7e13[_0x3a6e('0x35')]}))||'';}exports[_0x3a6e('0x36')]=function(_0x4f74c5,_0x52b5e0){var _0x2cb3fb={};var _0x2be13b=_[_0x3a6e('0x37')](db[_0x3a6e('0x38')][_0x3a6e('0x39')],function(_0x289803){return{'name':_0x289803['fieldName'],'type':_0x289803[_0x3a6e('0x3a')][_0x3a6e('0x3b')]};});_0x2cb3fb=qs['getOptions'](_0x2be13b,_0x4f74c5);return interaction[_0x3a6e('0x3c')]('chat',_0x4f74c5[_0x3a6e('0x3d')],_0x4f74c5[_0x3a6e('0x3e')],_0x2cb3fb,_0x2be13b)[_0x3a6e('0x18')](respondWithFilteredResult(_0x52b5e0,_0x2cb3fb))[_0x3a6e('0x3f')](handleError(_0x52b5e0,null));};exports[_0x3a6e('0x40')]=function(_0x1fae97,_0x4306ac){var _0x2b7090={'raw':![],'where':{'id':_0x1fae97[_0x3a6e('0x41')]['id']}},_0x512f10={};_0x512f10[_0x3a6e('0x42')]=_['keys'](db[_0x3a6e('0x38')]['rawAttributes']);_0x512f10[_0x3a6e('0x3d')]=_[_0x3a6e('0x43')](_0x1fae97[_0x3a6e('0x3d')]);_0x512f10[_0x3a6e('0x44')]=_['intersection'](_0x512f10['model'],_0x512f10[_0x3a6e('0x3d')]);_0x2b7090['attributes']=_[_0x3a6e('0x45')](_0x512f10[_0x3a6e('0x42')],qs[_0x3a6e('0x46')](_0x1fae97[_0x3a6e('0x3d')]['fields']));_0x2b7090[_0x3a6e('0x47')]=_0x2b7090[_0x3a6e('0x47')][_0x3a6e('0x48')]?_0x2b7090[_0x3a6e('0x47')]:_0x512f10[_0x3a6e('0x42')];if(_0x1fae97[_0x3a6e('0x3d')][_0x3a6e('0x49')]){_0x2b7090[_0x3a6e('0x4a')]=[{'all':!![]}];}_0x2b7090=_[_0x3a6e('0x31')]({},_0x2b7090,_0x1fae97['options']);return db[_0x3a6e('0x38')][_0x3a6e('0x4b')](_0x2b7090)[_0x3a6e('0x18')](handleEntityNotFound(_0x4306ac,null))[_0x3a6e('0x18')](respondWithResult(_0x4306ac,null))[_0x3a6e('0x3f')](handleError(_0x4306ac,null));};exports[_0x3a6e('0x4c')]=function(_0x1529ec,_0x257a96){return db[_0x3a6e('0x38')][_0x3a6e('0x4c')](_0x1529ec['body'],{})[_0x3a6e('0x18')](respondWithResult(_0x257a96,0xc9))[_0x3a6e('0x3f')](handleError(_0x257a96,null));};exports[_0x3a6e('0x2c')]=function(_0x420a02,_0xc44381){if(_0x420a02[_0x3a6e('0x32')]['id']){delete _0x420a02[_0x3a6e('0x32')]['id'];}return db['ChatInteraction'][_0x3a6e('0x4b')]({'where':{'id':_0x420a02[_0x3a6e('0x41')]['id']}})[_0x3a6e('0x18')](handleEntityNotFound(_0xc44381,null))['then'](saveUpdates(_0x420a02['body'],null))[_0x3a6e('0x18')](respondWithResult(_0xc44381,null))[_0x3a6e('0x3f')](handleError(_0xc44381,null));};exports['destroy']=function(_0x508488,_0x578b95){return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x508488[_0x3a6e('0x41')]['id']}})[_0x3a6e('0x18')](handleEntityNotFound(_0x578b95,null))[_0x3a6e('0x18')](removeEntity(_0x578b95,null))[_0x3a6e('0x3f')](handleError(_0x578b95,null));};exports['describe']=function(_0x3623cb,_0x417786){return db['ChatInteraction'][_0x3a6e('0x4d')]()['then'](respondWithResult(_0x417786,null))[_0x3a6e('0x3f')](handleError(_0x417786,null));};exports['createVidaooSession']=function(_0x402124,_0x13c206){var _0x17109d=_0x402124[_0x3a6e('0x41')]['id'];var _0x27990a;var _0x4d3a74;var _0x292f68;return db['ChatInteraction']['findOne']({'where':{'id':_0x17109d}})[_0x3a6e('0x18')](function(_0x4e8e3c){_0x27990a=_0x4e8e3c;return db[_0x3a6e('0x4e')][_0x3a6e('0x4f')]({'where':{'id':_0x4e8e3c['ChatWebsiteId']},'attributes':['id',_0x3a6e('0x50'),_0x3a6e('0x51'),_0x3a6e('0x52'),_0x3a6e('0x53'),_0x3a6e('0x54')],'raw':!![]});})[_0x3a6e('0x18')](function(_0x1ae02c){if(_0x1ae02c&&_0x1ae02c[_0x3a6e('0x50')]&&_0x1ae02c[_0x3a6e('0x51')]){_0x4d3a74=_0x1ae02c;var _0x1812c8={'interaction':{'id':_0x17109d},'agent':{'id':_0x402124[_0x3a6e('0x3e')]['id'],'name':_0x402124[_0x3a6e('0x3e')][_0x3a6e('0x2e')],'fullname':_0x402124[_0x3a6e('0x3e')]['fullname'],'email':_0x402124[_0x3a6e('0x3e')]['email']},'contact':_0x402124[_0x3a6e('0x32')]['contact'],'account':_0x402124[_0x3a6e('0x32')][_0x3a6e('0x35')]};var _0x4fea08={'rejectUnauthorized':![],'method':'POST','url':_0x3a6e('0x55'),'headers':{'X-APIKEY':_0x1ae02c[_0x3a6e('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x402124[_0x3a6e('0x3e')][_0x3a6e('0x56')]],'buttons':null,'topic':_0x4d3a74[_0x3a6e('0x52')],'note':_[_0x3a6e('0x57')](_0x4d3a74[_0x3a6e('0x53')])?null:getMustacheRender(_0x4d3a74[_0x3a6e('0x53')],_0x1812c8),'metadata':null},'redirect':_0x3a6e('0x58'),'json':!![]};try{if(!_[_0x3a6e('0x57')](_0x4d3a74[_0x3a6e('0x54')])){var _0x2f4ad1=getMustacheRender(_0x4d3a74[_0x3a6e('0x54')],_0x1812c8);var _0x5acb0c=JSON[_0x3a6e('0x59')](_0x2f4ad1);_0x4fea08[_0x3a6e('0x32')]['metadata']=_0x5acb0c;}}catch(_0x56a64a){throw new db['Sequelize']['ValidationError'](_0x3a6e('0x5a'));}return rp(_0x4fea08);}else{throw new db[(_0x3a6e('0x5b'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3a6e('0x18')](function(_0x49e77d){_0x292f68=_0x49e77d;if(_0x292f68['id']){var _0x509baf={'body':_0x292f68[_0x3a6e('0x5c')],'ChatWebsiteId':_0x4d3a74['id'],'ChatInteractionId':_0x27990a['id'],'direction':_0x3a6e('0x5d'),'UserId':_0x402124[_0x3a6e('0x3e')]['id']};return db[_0x3a6e('0x5e')]['create'](_0x509baf,{});}else{throw new db[(_0x3a6e('0x5b'))][(_0x3a6e('0x5f'))](_0x3a6e('0x60'));}})[_0x3a6e('0x18')](function(){return _0x27990a[_0x3a6e('0x61')]({'vidaooSessionId':_0x292f68['id']});})['then'](respondWithResult(_0x13c206,null))['catch'](handleError(_0x13c206,null));};exports[_0x3a6e('0x62')]=function(_0x571f1a,_0x25d86a){if(_0x571f1a['body']['id']){delete _0x571f1a[_0x3a6e('0x32')]['id'];}return db['ChatInteraction'][_0x3a6e('0x4b')]({'where':{'id':_0x571f1a[_0x3a6e('0x41')]['id']},'include':[{'model':db[_0x3a6e('0x63')],'as':_0x3a6e('0x64')}]})[_0x3a6e('0x18')](handleEntityNotFound(_0x25d86a,null))[_0x3a6e('0x18')](saveUpdates(_0x571f1a[_0x3a6e('0x32')],null))[_0x3a6e('0x18')](respondWithResult(_0x25d86a,null))['catch'](handleError(_0x25d86a,null));};exports[_0x3a6e('0x65')]=function(_0x3d2150,_0x44722f){if(_0x3d2150[_0x3a6e('0x32')]['id']){delete _0x3d2150[_0x3a6e('0x32')]['id'];}return db['ChatInteraction'][_0x3a6e('0x4b')]({'where':{'id':_0x3d2150[_0x3a6e('0x41')]['id']}})['then'](function(_0x21e0c8){if(!_0x21e0c8){logger[_0x3a6e('0x1e')](_0x3a6e('0x66'),'abandon',0x194,_0x3a6e('0x67'));_0x44722f['sendStatus'](0x194);}else{if(_0x21e0c8[_0x3a6e('0x68')]){throw new db[(_0x3a6e('0x5b'))][(_0x3a6e('0x5f'))](_0x3a6e('0x69'));}}return _0x21e0c8;})['then'](function(_0x4a6d3b){if(_0x4a6d3b){return _0x4a6d3b['update']({'closed':_0x3d2150[_0x3a6e('0x32')][_0x3a6e('0x6a')],'disposition':_0x3d2150['body'][_0x3a6e('0x6b')]})['then'](function(_0x57faad){return _0x57faad;});}})['then'](function(){return respondWithRpcPromise(_0x3a6e('0x6c'),_0x3a6e('0x65'),_0x3d2150[_0x3a6e('0x32')],client9004);})[_0x3a6e('0x18')](respondWithResult(_0x44722f,null))['catch'](handleError(_0x44722f,null));};exports['attachmentUpload']=function(_0x383f7b,_0x39e019){_0x383f7b[_0x3a6e('0x32')][_0x3a6e('0x2e')]=_0x383f7b['file'][_0x3a6e('0x6d')];_0x383f7b[_0x3a6e('0x32')]['basename']=_0x383f7b[_0x3a6e('0x6e')]['filename'];_0x383f7b[_0x3a6e('0x32')][_0x3a6e('0x3a')]=_0x383f7b[_0x3a6e('0x6e')][_0x3a6e('0x6f')];return db[_0x3a6e('0x70')][_0x3a6e('0x4c')](_0x383f7b[_0x3a6e('0x32')])[_0x3a6e('0x18')](respondWithResult(_0x39e019,0xc9))['catch'](handleError(_0x39e019,null));};exports[_0x3a6e('0x71')]=function(_0x4fefec,_0x5d44fa){return db[_0x3a6e('0x38')][_0x3a6e('0x4f')]({'where':{'id':_0x4fefec['params']['id']},'raw':!![]})[_0x3a6e('0x18')](handleEntityNotFound(_0x5d44fa,null))[_0x3a6e('0x18')](function(_0x4331ca){if(_0x4331ca){if(_0x4331ca[_0x3a6e('0x6a')]){return _0x5d44fa[_0x3a6e('0x24')](0x193)[_0x3a6e('0x26')]({'status':0x193,'message':_0x3a6e('0x72')});}return db['Attachment'][_0x3a6e('0x4f')]({'where':{'id':_0x4fefec['query']['attachId']},'raw':!![]})[_0x3a6e('0x18')](handleEntityNotFound(_0x5d44fa,null));}})[_0x3a6e('0x18')](function(_0x547d07){if(_0x547d07){var _0x36065c=_0x547d07[_0x3a6e('0x73')]!==null;var _0x5ae17b=path['join'](config[_0x3a6e('0x74')],_0x3a6e('0x75'));if(_0x36065c){_0x5ae17b=path[_0x3a6e('0x76')](_0x5ae17b,_0x3a6e('0x77'));}var _0x25ded0=path[_0x3a6e('0x76')](_0x5ae17b,_0x547d07['basename']);return _0x5d44fa[_0x3a6e('0x78')](_0x25ded0);}})['catch'](handleError(_0x5d44fa,null));};exports[_0x3a6e('0x79')]=function(_0x3b169f,_0x3b2888){var _0x28f8cf=null;var _0x59ee6a=null;var _0x3db094=null;if(_0x3b169f[_0x3a6e('0x32')]['id']){delete _0x3b169f[_0x3a6e('0x32')]['id'];}if(_0x3b169f[_0x3a6e('0x32')][_0x3a6e('0x7a')]){_0x3db094=path[_0x3a6e('0x76')](config['root'],_0x3a6e('0x7b'),util[_0x3a6e('0x7c')]('transcript-%s.txt',Date['now']()));_0x3b169f['body'][_0x3a6e('0x7d')]=_0x3db094;}return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x3b169f[_0x3a6e('0x41')]['id']},'include':[{'model':db[_0x3a6e('0x5e')],'as':_0x3a6e('0x7e'),'include':[{'model':db[_0x3a6e('0x7f')],'as':'User'}]}]})[_0x3a6e('0x18')](handleEntityNotFound(_0x3b2888,null))[_0x3a6e('0x18')](saveUpdates(_0x3b169f[_0x3a6e('0x32')],null))[_0x3a6e('0x18')](function(_0x3b043c){if(_0x3b043c){_0x28f8cf=_0x3b043c;return db['ChatWebsite']['find']({'where':{'id':_0x28f8cf[_0x3a6e('0x80')]}});}})[_0x3a6e('0x18')](function(_0x5478c0){if(_0x5478c0){_0x59ee6a=_0x5478c0;return db[_0x3a6e('0x63')][_0x3a6e('0x4b')]({'where':{'id':_0x28f8cf['ContactId']}});}})[_0x3a6e('0x18')](function(_0x19676b){if(_0x19676b){if(_0x3db094){var _0x5aed5a=null;for(var _0x2c547c=0x1;_0x2c547c<_0x28f8cf[_0x3a6e('0x7e')][_0x3a6e('0x48')];++_0x2c547c){_0x5aed5a=_0x28f8cf[_0x3a6e('0x7e')][_0x2c547c];var _0x4295d7=_0x5aed5a[_0x3a6e('0x68')]?util[_0x3a6e('0x7c')](_0x3a6e('0x81'),_0x59ee6a[_0x3a6e('0x82')],_0x5aed5a[_0x3a6e('0x68')]):'System';var _0x392f19=_0x3b169f[_0x3a6e('0x32')]['customer']||util[_0x3a6e('0x7c')](_0x3a6e('0x81'),_0x3a6e('0x83'),_0x5aed5a[_0x3a6e('0x84')]);switch(_0x59ee6a['agentIdentifier']){case _0x3a6e('0x85'):_0x4295d7=_0x5aed5a[_0x3a6e('0x68')]?util[_0x3a6e('0x7c')](_0x3a6e('0x81'),_0x59ee6a[_0x3a6e('0x82')],_0x5aed5a[_0x3a6e('0x68')]):_0x3a6e('0x86');break;case _0x3a6e('0x87'):_0x4295d7=_0x5aed5a[_0x3a6e('0x68')]?_0x5aed5a[_0x3a6e('0x7f')][_0x3a6e('0x88')]||_0x5aed5a['User'][_0x3a6e('0x89')]:'System';break;case _0x3a6e('0x8a'):_0x4295d7=_0x5aed5a[_0x3a6e('0x68')]?_0x5aed5a[_0x3a6e('0x7f')][_0x3a6e('0x89')]:_0x3a6e('0x86');break;default:_0x4295d7=_0x5aed5a['UserId']?util[_0x3a6e('0x7c')]('%s%d',_0x59ee6a[_0x3a6e('0x82')],_0x5aed5a['UserId']):_0x3a6e('0x86');}var _0x555f0d=util[_0x3a6e('0x7c')](_0x3a6e('0x8b'),moment(_0x5aed5a[_0x3a6e('0x8c')])[_0x3a6e('0x7c')](_0x3a6e('0x8d')),_0x5aed5a['direction']==='in'?_0x392f19:_0x4295d7,_0x5aed5a['body']);if(!_0x5aed5a['secret']){fs['appendFileSync'](_0x3db094,_0x555f0d);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x3a6e('0x8e')],'as':_0x3a6e('0x8f'),'raw':!![],'include':[{'model':db[_0x3a6e('0x90')],'as':_0x3a6e('0x90'),'raw':!![]}]}]});}}})[_0x3a6e('0x18')](function(_0x252b97){if(!_0x252b97||!_0x252b97[_0x3a6e('0x8f')]||!_0x3b169f[_0x3a6e('0x32')])return _0x28f8cf;var _0x27957a=_0x252b97[_0x3a6e('0x91')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x27957a,'message':{'from':util[_0x3a6e('0x7c')](_0x3a6e('0x92'),_0x252b97[_0x3a6e('0x2e')],_0x252b97[_0x3a6e('0x56')]||_0x252b97[_0x3a6e('0x8f')][_0x3a6e('0x3e')]),'to':_0x3b169f['body'][_0x3a6e('0x7a')],'subject':'Mail\x20Transcript','text':util['format'](_0x3a6e('0x93'),_0x3b169f[_0x3a6e('0x32')]['mailTranscript']),'attachments':[{'path':_0x3db094}]}})[_0x3a6e('0x18')](function(){return _0x28f8cf;})[_0x3a6e('0x3f')](function(_0x13d46d){logger[_0x3a6e('0x1e')](_0x13d46d);});})['then'](respondWithStatusCode(_0x3b2888,0xc8))['catch'](handleError(_0x3b2888,null));};exports[_0x3a6e('0x94')]=function(_0x23f555,_0xe214b4){return db[_0x3a6e('0x5e')][_0x3a6e('0x4b')]({'where':{'id':_0x23f555[_0x3a6e('0x41')]['id']}})[_0x3a6e('0x18')](handleEntityNotFound(_0xe214b4,null))[_0x3a6e('0x18')](function(_0x2b2112){if(_0x2b2112){return _0x2b2112['addMessage'](_0x23f555['body'][_0x3a6e('0x95')],_['omit'](_0x23f555[_0x3a6e('0x32')],['ids','id'])||{});}})[_0x3a6e('0x18')](respondWithResult(_0xe214b4,null))['catch'](handleError(_0xe214b4,null));};exports[_0x3a6e('0x96')]=function(_0x252c8a,_0x40ef33){var _0x7605fc={'raw':![],'where':{}};var _0x363409={};var _0x2f5591={'count':0x0,'rows':[]};return db[_0x3a6e('0x38')][_0x3a6e('0x4f')]({'where':{'id':_0x252c8a['params']['id']}})['then'](handleEntityNotFound(_0x40ef33,null))[_0x3a6e('0x18')](function(_0x2d5cdf){if(_0x2d5cdf){_0x363409['model']=_['keys'](db[_0x3a6e('0x5e')][_0x3a6e('0x39')]);_0x363409[_0x3a6e('0x3d')]=_['keys'](_0x252c8a[_0x3a6e('0x3d')]);_0x363409[_0x3a6e('0x44')]=_['intersection'](_0x363409['model'],_0x363409[_0x3a6e('0x3d')]);_0x7605fc[_0x3a6e('0x47')]=_[_0x3a6e('0x45')](_0x363409[_0x3a6e('0x42')],qs[_0x3a6e('0x46')](_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x46')]));_0x7605fc[_0x3a6e('0x47')]=_0x7605fc['attributes'][_0x3a6e('0x48')]?_0x7605fc[_0x3a6e('0x47')]:_0x363409[_0x3a6e('0x42')];if(!_0x252c8a[_0x3a6e('0x3d')]['hasOwnProperty']('nolimit')){_0x7605fc[_0x3a6e('0x28')]=qs[_0x3a6e('0x28')](_0x252c8a[_0x3a6e('0x3d')]['limit']);_0x7605fc[_0x3a6e('0x27')]=qs[_0x3a6e('0x27')](_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x27')]);}_0x7605fc['order']=qs[_0x3a6e('0x97')](_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x97')]);_0x7605fc['where']=qs['filters'](_[_0x3a6e('0x98')](_0x252c8a['query'],_0x363409[_0x3a6e('0x44')]));_0x7605fc[_0x3a6e('0x99')][_0x3a6e('0x9a')]=_0x2d5cdf['id'];if(_0x252c8a['query'][_0x3a6e('0x9b')]){_0x7605fc[_0x3a6e('0x99')]=_[_0x3a6e('0x31')](_0x7605fc['where'],{'$or':_[_0x3a6e('0x37')](_0x7605fc['attributes'],function(_0x413bb9){var _0x4c8e4a={};_0x4c8e4a[_0x413bb9]={'$like':'%'+_0x252c8a['query'][_0x3a6e('0x9b')]+'%'};return _0x4c8e4a;})});}if(_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x9c')]){var _0x186bf4=_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x9c')][_0x3a6e('0x9d')](',');var _0x18d87a={};_0x18d87a[_0x186bf4[0x0]]={'$gte':moment(_0x186bf4[0x1])[_0x3a6e('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x7605fc[_0x3a6e('0x99')]=_['merge'](_0x7605fc['where'],_0x18d87a);}_0x7605fc=_[_0x3a6e('0x31')]({},_0x7605fc,_0x252c8a[_0x3a6e('0x9e')]);return db[_0x3a6e('0x5e')][_0x3a6e('0x2a')]({'where':_0x7605fc[_0x3a6e('0x99')]})[_0x3a6e('0x18')](function(_0x40fc4b){_0x2f5591[_0x3a6e('0x2a')]=_0x40fc4b;if(_0x252c8a[_0x3a6e('0x3d')][_0x3a6e('0x49')]){_0x7605fc['include']=[{'all':!![]}];}return db[_0x3a6e('0x5e')][_0x3a6e('0x3c')](_0x7605fc);})['then'](function(_0x4b092a){_0x2f5591['rows']=_0x4b092a;return _0x2f5591;});}})[_0x3a6e('0x18')](respondWithFilteredResult(_0x40ef33,_0x7605fc))[_0x3a6e('0x3f')](handleError(_0x40ef33,null));};exports['getMyMessages']=function(_0x44dbe3,_0x256487){var _0x4c1b30={'where':{}},_0x226988={},_0x462caf={'count':0x0,'rows':[]};return db[_0x3a6e('0x38')][_0x3a6e('0x4f')]({'where':{'id':_0x44dbe3['params']['id']}})[_0x3a6e('0x18')](handleEntityNotFound(_0x256487,null))[_0x3a6e('0x18')](function(_0x19f1ee){if(_0x19f1ee){_0x226988['model']=_[_0x3a6e('0x43')](db['ChatMessage']['rawAttributes']);_0x226988[_0x3a6e('0x3d')]=_['keys'](_0x44dbe3[_0x3a6e('0x3d')]);_0x226988[_0x3a6e('0x44')]=_[_0x3a6e('0x45')](_0x226988[_0x3a6e('0x42')],_0x226988[_0x3a6e('0x3d')]);_0x4c1b30[_0x3a6e('0x47')]=_[_0x3a6e('0x45')](_0x226988[_0x3a6e('0x42')],qs[_0x3a6e('0x46')](_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0x46')]));_0x4c1b30['attributes']=_0x4c1b30[_0x3a6e('0x47')]['length']?_0x4c1b30[_0x3a6e('0x47')]:_0x226988['model'];if(!_0x44dbe3['query'][_0x3a6e('0x9f')](_0x3a6e('0xa0'))){_0x4c1b30[_0x3a6e('0x28')]=qs['limit'](_0x44dbe3['query']['limit']);_0x4c1b30[_0x3a6e('0x27')]=qs['offset'](_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0x27')]);}_0x4c1b30['order']=qs[_0x3a6e('0x97')](_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0x97')]);_0x4c1b30[_0x3a6e('0x99')]=qs[_0x3a6e('0x44')](_[_0x3a6e('0x98')](_0x44dbe3['query'],_0x226988[_0x3a6e('0x44')]));_0x4c1b30['where'][_0x3a6e('0x9a')]=_0x19f1ee['id'];if(_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0x9b')]){_0x4c1b30[_0x3a6e('0x99')]=_[_0x3a6e('0x31')](_0x4c1b30[_0x3a6e('0x99')],{'$or':_[_0x3a6e('0x37')](_0x4c1b30[_0x3a6e('0x47')],function(_0x17d6e0){var _0x413375={};_0x413375[_0x17d6e0]={'$like':'%'+_0x44dbe3['query']['filter']+'%'};return _0x413375;})});}_0x4c1b30['where'][_0x3a6e('0xa1')]=![];if(_0x44dbe3[_0x3a6e('0x3d')]['id']){_0x4c1b30[_0x3a6e('0x99')]['id']={'$gt':_0x44dbe3['query']['id']};}_0x4c1b30=_[_0x3a6e('0x31')]({},_0x4c1b30,_0x44dbe3[_0x3a6e('0x9e')]);return db[_0x3a6e('0x5e')]['count']({'where':_0x4c1b30[_0x3a6e('0x99')]})['then'](function(_0x3bb1b2){_0x462caf[_0x3a6e('0x2a')]=_0x3bb1b2;_0x4c1b30[_0x3a6e('0x4a')]=[];if(_0x44dbe3[_0x3a6e('0x3d')][_0x3a6e('0xa2')]){_0x4c1b30[_0x3a6e('0x4a')]['push']({'model':db[_0x3a6e('0x7f')],'as':'User','attributes':['id',_0x3a6e('0x89'),_0x3a6e('0x88')]});}if(_0x44dbe3[_0x3a6e('0x3d')]['includeAll']){_0x4c1b30[_0x3a6e('0x4a')]=[{'all':!![]}];}return db[_0x3a6e('0x5e')]['findAll'](_0x4c1b30);})['then'](function(_0x1e0cd8){_0x462caf[_0x3a6e('0xa3')]=_0x1e0cd8;return _0x462caf;});}})[_0x3a6e('0x18')](respondWithFilteredResult(_0x256487,_0x4c1b30))[_0x3a6e('0x3f')](handleError(_0x256487,null));};exports[_0x3a6e('0xa4')]=function(_0x1c7977,_0x1978f9){return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x1c7977[_0x3a6e('0x41')]['id']}})['then'](handleEntityNotFound(_0x1978f9,null))['then'](function(_0x4f48c3){if(_0x4f48c3){return _0x4f48c3[_0x3a6e('0xa5')](_0x1c7977[_0x3a6e('0x32')]['ids'],_[_0x3a6e('0xa6')](_0x1c7977['body'],[_0x3a6e('0x95'),'id'])||{})[_0x3a6e('0xa7')](function(){return db['Tag']['findAll']({'attributes':['id',_0x3a6e('0x2e'),_0x3a6e('0xa8')],'where':{'id':_0x1c7977[_0x3a6e('0x32')][_0x3a6e('0x95')]}});})[_0x3a6e('0x18')](function(_0xf9c8ab){socket[_0x3a6e('0xa9')](_0x3a6e('0xaa'),{'id':Number(_0x1c7977['params']['id']),'tags':_0xf9c8ab||[]});return{'id':Number(_0x1c7977[_0x3a6e('0x41')]['id']),'tags':_0xf9c8ab||[]};});}})['then'](respondWithResult(_0x1978f9,null))[_0x3a6e('0x3f')](handleError(_0x1978f9,null));};exports['removeTags']=function(_0x2cae05,_0x580ca3){return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x2cae05[_0x3a6e('0x41')]['id']}})['then'](handleEntityNotFound(_0x580ca3,null))[_0x3a6e('0x18')](function(_0x3b12fd){if(_0x3b12fd){return _0x3b12fd[_0x3a6e('0xab')](_0x2cae05[_0x3a6e('0x3d')][_0x3a6e('0x95')]);}})['then'](respondWithStatusCode(_0x580ca3,null))[_0x3a6e('0x3f')](handleError(_0x580ca3,null));};exports[_0x3a6e('0x78')]=function(_0x3ea852,_0x115822){var _0x1124d7=moment()[_0x3a6e('0xac')]()[_0x3a6e('0xad')]();var _0x247c7b=path[_0x3a6e('0x76')](config[_0x3a6e('0x74')],_0x3a6e('0xae'),_0x3a6e('0xaf'),_0x3a6e('0xb0'));var _0x56efb2=path[_0x3a6e('0x76')](config[_0x3a6e('0x74')],_0x3a6e('0xae'),_0x3a6e('0xaf'),_0x3a6e('0xb1'));var _0x30cefc=path[_0x3a6e('0x76')](_0x247c7b,_0x1124d7);var _0x29da7b=util[_0x3a6e('0x7c')]('transcript-%d-%s.zip',_0x3ea852['params']['id'],_0x1124d7);var _0x4f9b40=path[_0x3a6e('0x76')](_0x247c7b,_0x29da7b);var _0xd4f9ee=[];_0xd4f9ee[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x7f')],'as':_0x3a6e('0x7f'),'attributes':['id',_0x3a6e('0x89')],'raw':!![]});_0xd4f9ee[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x63')],'as':_0x3a6e('0x64'),'attributes':['id',_0x3a6e('0xb3'),_0x3a6e('0xb4')],'raw':!![]});if(_0x3ea852[_0x3a6e('0x3d')][_0x3a6e('0xb1')]){_0xd4f9ee[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x70')],'as':_0x3a6e('0x70'),'raw':!![]});}var _0xfc4f00=[{'model':db[_0x3a6e('0x5e')],'as':'Messages','attributes':['id',_0x3a6e('0x32'),_0x3a6e('0x8c'),_0x3a6e('0xb5'),_0x3a6e('0xa1'),_0x3a6e('0xb6')],'include':_0xd4f9ee}];_0xfc4f00[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x4e')],'as':_0x3a6e('0xb7'),'attributes':['id',_0x3a6e('0x2e')]});_0xfc4f00[_0x3a6e('0xb2')]({'model':db[_0x3a6e('0x7f')],'as':_0x3a6e('0xb8'),'attributes':['id',_0x3a6e('0x89')]});return db[_0x3a6e('0x38')][_0x3a6e('0x4b')]({'where':{'id':_0x3ea852['params']['id']},'include':_0xfc4f00})[_0x3a6e('0x18')](handleEntityNotFound(_0x115822,null))['then'](function(_0x3f0e72){if(_0x3f0e72){var _0x3ea3cc=_0x3f0e72['get']({'plain':!![]});fs[_0x3a6e('0xb9')](_0x30cefc);var _0x42d244={'channel':_0x3a6e('0xba'),'account':_0x3ea3cc[_0x3a6e('0xb7')][_0x3a6e('0x2e')],'agent':_0x3ea3cc['Owner']?_0x3ea3cc[_0x3a6e('0xb8')][_0x3a6e('0x89')]:'N.A.','createdAt':moment(_0x3ea3cc['createdAt'])[_0x3a6e('0x7c')](_0x3a6e('0xbb'))[_0x3a6e('0xad')](),'closedAt':_0x3ea3cc[_0x3a6e('0x6a')]?moment(_0x3ea3cc['closedAt'])[_0x3a6e('0x7c')](_0x3a6e('0xbb'))[_0x3a6e('0xad')]():'','disposition':_0x3ea3cc[_0x3a6e('0x6b')],'chatInfo':{'browser':_0x3ea3cc[_0x3a6e('0xbc')],'os':_0x3ea3cc[_0x3a6e('0xbd')],'referer':_0x3ea3cc[_0x3a6e('0xbe')],'customerIp':_0x3ea3cc['customerIp'],'customerPort':_0x3ea3cc['customerPort']?_0x3ea3cc['customerPort']:_0x3a6e('0xbf')},'messages':_(_0x3ea3cc[_0x3a6e('0x7e')])[_0x3a6e('0xc0')]()[_0x3a6e('0x9b')]({'secret':![]})[_0x3a6e('0x37')](function(_0x5d33a3){if(_0x5d33a3[_0x3a6e('0x70')]){var _0x1ea433=path[_0x3a6e('0x76')](_0x56efb2,_0x5d33a3['Attachment'][_0x3a6e('0xc1')]);if(fs['existsSync'](_0x1ea433)){fs[_0x3a6e('0xc2')](_0x1ea433)[_0x3a6e('0xc3')](fs['createWriteStream'](path[_0x3a6e('0x76')](_0x30cefc,_0x5d33a3[_0x3a6e('0x70')][_0x3a6e('0xc1')])));}}return{'date':moment(_0x5d33a3[_0x3a6e('0x8c')])[_0x3a6e('0x7c')](_0x3a6e('0xbb'))[_0x3a6e('0xad')](),'sender':_0x5d33a3[_0x3a6e('0xb5')]==='out'?_0x5d33a3[_0x3a6e('0x7f')]?_0x5d33a3[_0x3a6e('0x7f')][_0x3a6e('0x89')]:'System':_0x5d33a3[_0x3a6e('0x64')][_0x3a6e('0xb3')]+(_0x5d33a3[_0x3a6e('0x64')]['lastName']?'\x20'+_0x5d33a3['Contact'][_0x3a6e('0xb4')]:''),'body':_0x5d33a3[_0x3a6e('0x70')]?_0x5d33a3[_0x3a6e('0x70')][_0x3a6e('0xc1')]:_0x5d33a3[_0x3a6e('0x32')],'direction':_0x5d33a3[_0x3a6e('0xb5')]===_0x3a6e('0x5d')?'A':'C','secret':_0x5d33a3['secret'],'read':_0x5d33a3['read'],'attachment':_0x5d33a3[_0x3a6e('0x70')]};})['value']()};return ejs['renderFile'](path[_0x3a6e('0x76')](config[_0x3a6e('0x74')],'server','views',_0x3a6e('0xc4')),{'interaction':_0x42d244})['then'](function(_0x311759){var _0x5cb74d=path[_0x3a6e('0x76')](_0x30cefc,_0x3a6e('0xc5')+_0x3ea3cc['id']+'-'+_0x1124d7+_0x3a6e('0xc6'));var _0x1c5c33={'path':_0x5cb74d,'channel':'Chat','interactionId':_0x3ea3cc['id']};return pdf[_0x3a6e('0xc7')](_0x311759,_0x1c5c33);})['then'](function(){return new Promise(function(_0x30e9e4,_0x40dfa6){zipdir(_0x30cefc,{'saveTo':_0x4f9b40},function(_0xd5ae38,_0x11cc7c){if(_0xd5ae38)return _0x40dfa6(_0xd5ae38);return _0x30e9e4(_0x11cc7c);});})[_0x3a6e('0x18')](function(){return new BPromise(function(_0x20d592,_0x366d68){rimraf(_0x30cefc,function(_0x65be1c){if(_0x65be1c)_0x366d68(_0x65be1c);return _0x20d592();});});})[_0x3a6e('0x18')](function(){return _0x115822[_0x3a6e('0x78')](_0x4f9b40,_0x29da7b,function(_0x51ac86){if(_0x51ac86){logger[_0x3a6e('0x1e')]('err',_0x51ac86);}else{fs[_0x3a6e('0xc8')](_0x4f9b40);}});});});}else{return _0x115822['sendStatus'](0xc8);}})[_0x3a6e('0x3f')](handleError(_0x115822,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 69eef7a..5198f6c 100644
--- a/server/api/chatInteraction/chatInteraction.events.js
+++ b/server/api/chatInteraction/chatInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8080=['save','remove','getUsers','then','setDataValue','map','findAll','emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8080,0x175));var _0x0808=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x8080[_0x4ea69d];return _0x5318e0;};'use strict';var EventEmitter=require(_0x0808('0x0'));var ChatInteraction=require(_0x0808('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x0808('0x1'))['db'][_0x0808('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0808('0x3')](0x0);var events={'afterCreate':_0x0808('0x4'),'afterUpdate':'update','afterDestroy':_0x0808('0x5')};function emitEvent(_0x377249){return function(_0x5ded0c,_0x19cd2c,_0xc8f2cc){_0x5ded0c[_0x0808('0x6')]({'attributes':['id'],'raw':!![]})[_0x0808('0x7')](function(_0x5b7ee2){_0x5ded0c[_0x0808('0x8')]('Users',_0x5b7ee2[_0x0808('0x9')](function(_0x3fa7c4){return{'id':_0x3fa7c4['id']};}));return ChatMessage[_0x0808('0xa')]({'where':{'ChatInteractionId':_0x5ded0c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0808('0x7')](function(_0x20776c){_0x5ded0c['setDataValue']('unreadMessages',_0x20776c['length']);ChatInteractionEvents[_0x0808('0xb')](_0x377249+':'+_0x5ded0c['id'],_0x5ded0c);ChatInteractionEvents[_0x0808('0xb')](_0x377249,_0x5ded0c);_0xc8f2cc(null);})['catch'](_0xc8f2cc(null));};}for(var e in events){if(events[_0x0808('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x6335=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6335,0x18f));var _0x5633=function(_0x178995,_0x3ffcb3){_0x178995=_0x178995-0x0;var _0x5ecec3=_0x6335[_0x178995];return _0x5ecec3;};'use strict';var EventEmitter=require(_0x5633('0x0'));var ChatInteraction=require(_0x5633('0x1'))['db'][_0x5633('0x2')];var ChatMessage=require(_0x5633('0x1'))['db'][_0x5633('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5633('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5633('0x5'),'afterDestroy':_0x5633('0x6')};function emitEvent(_0x43089d){return function(_0x56b5f5,_0x4c2647,_0x4de5ee){_0x56b5f5[_0x5633('0x7')]({'attributes':['id'],'raw':!![]})[_0x5633('0x8')](function(_0x5d0b34){_0x56b5f5[_0x5633('0x9')](_0x5633('0xa'),_0x5d0b34[_0x5633('0xb')](function(_0xdaa62f){return{'id':_0xdaa62f['id']};}));return ChatMessage[_0x5633('0xc')]({'where':{'ChatInteractionId':_0x56b5f5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4d924e){_0x56b5f5['setDataValue'](_0x5633('0xd'),_0x4d924e[_0x5633('0xe')]);ChatInteractionEvents[_0x5633('0xf')](_0x43089d+':'+_0x56b5f5['id'],_0x56b5f5);ChatInteractionEvents[_0x5633('0xf')](_0x43089d,_0x56b5f5);_0x4de5ee(null);})[_0x5633('0x10')](_0x4de5ee(null));};}for(var e in events){if(events[_0x5633('0x11')](e)){var event=events[e];ChatInteraction[_0x5633('0x12')](e,emitEvent(event));}}module[_0x5633('0x13')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index e223bef..bf34371 100644
--- a/server/api/chatInteraction/chatInteraction.model.js
+++ b/server/api/chatInteraction/chatInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80d2=['moment','path','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','utf8mb4','utf8mb4_unicode_ci','util','api'];(function(_0xb6f924,_0x2f7346){var _0x5e26a9=function(_0x87cf2f){while(--_0x87cf2f){_0xb6f924['push'](_0xb6f924['shift']());}};_0x5e26a9(++_0x2f7346);}(_0x80d2,0xb4));var _0x280d=function(_0x447e2f,_0x48d0e5){_0x447e2f=_0x447e2f-0x0;var _0x254527=_0x80d2[_0x447e2f];return _0x254527;};'use strict';var _=require('lodash');var util=require(_0x280d('0x0'));var logger=require('../../config/logger')(_0x280d('0x1'));var moment=require(_0x280d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x280d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x280d('0x4'));module[_0x280d('0x5')]=function(_0x5348fb,_0x50972d){return _0x5348fb[_0x280d('0x6')]('ChatInteraction',attributes,{'tableName':_0x280d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57c648,_0x5851be,_0x36ef54){if(_0x57c648[_0x280d('0x8')](_0x280d('0x9'))){_0x57c648[_0x280d('0xa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x36ef54(null,_0x57c648);}},'charset':_0x280d('0xb'),'collate':_0x280d('0xc')});};
\ No newline at end of file
+var _0x8ee5=['path','rimraf','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x417643,_0x48b479){var _0x1caddc=function(_0x4f4bed){while(--_0x4f4bed){_0x417643['push'](_0x417643['shift']());}};_0x1caddc(++_0x48b479);}(_0x8ee5,0x11a));var _0x58ee=function(_0x59701d,_0xe1b1ad){_0x59701d=_0x59701d-0x0;var _0x1265c0=_0x8ee5[_0x59701d];return _0x1265c0;};'use strict';var _=require(_0x58ee('0x0'));var util=require(_0x58ee('0x1'));var logger=require(_0x58ee('0x2'))(_0x58ee('0x3'));var moment=require(_0x58ee('0x4'));var BPromise=require(_0x58ee('0x5'));var rp=require(_0x58ee('0x6'));var fs=require('fs');var path=require(_0x58ee('0x7'));var rimraf=require(_0x58ee('0x8'));var config=require('../../config/environment');var attributes=require(_0x58ee('0x9'));module['exports']=function(_0x3f9c79,_0x4cd4a7){return _0x3f9c79[_0x58ee('0xa')](_0x58ee('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1619fc,_0x5c5d97,_0x4a69ca){if(_0x1619fc[_0x58ee('0xc')](_0x58ee('0xd'))){_0x1619fc[_0x58ee('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4a69ca(null,_0x1619fc);}},'charset':_0x58ee('0xf'),'collate':_0x58ee('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index ff84b09..9567300 100644
--- a/server/api/chatInteraction/chatInteraction.rpc.js
+++ b/server/api/chatInteraction/chatInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ba4=['omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids'];(function(_0x3e2080,_0x567e79){var _0x314d16=function(_0x5c3e3e){while(--_0x5c3e3e){_0x3e2080['push'](_0x3e2080['shift']());}};_0x314d16(++_0x567e79);}(_0x5ba4,0x163));var _0x45ba=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x5ba4[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x45ba('0x0'));var BPromise=require(_0x45ba('0x1'));var rs=require(_0x45ba('0x2'));var fs=require('fs');var Redis=require(_0x45ba('0x3'));var db=require(_0x45ba('0x4'))['db'];var utils=require(_0x45ba('0x5'));var logger=require(_0x45ba('0x6'))('rpc');var config=require(_0x45ba('0x7'));var jayson=require(_0x45ba('0x8'));var client=jayson[_0x45ba('0x9')][_0x45ba('0xa')]({'port':0x232a});config['redis']=_[_0x45ba('0xb')](config[_0x45ba('0xc')],{'host':_0x45ba('0xd'),'port':0x18eb});var socket=require(_0x45ba('0xe'))(new Redis(config[_0x45ba('0xc')]));require(_0x45ba('0xf'))[_0x45ba('0x10')](socket);function respondWithRpcPromise(_0x176ae8,_0x482a5c,_0x495d49){return new BPromise(function(_0xe8aeb0,_0x181dbb){return client['request'](_0x176ae8,_0x495d49)[_0x45ba('0x11')](function(_0x116b06){logger[_0x45ba('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x482a5c,_0x45ba('0x13'));logger[_0x45ba('0x14')](_0x45ba('0x15'),_0x482a5c,_0x45ba('0x13'),JSON['stringify'](_0x116b06));if(_0x116b06[_0x45ba('0x16')]){if(_0x116b06[_0x45ba('0x16')][_0x45ba('0x17')]===0x1f4){logger[_0x45ba('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x482a5c,_0x116b06[_0x45ba('0x16')][_0x45ba('0x18')]);return _0x181dbb(_0x116b06[_0x45ba('0x16')][_0x45ba('0x18')]);}logger['error'](_0x45ba('0x19'),_0x482a5c,_0x116b06[_0x45ba('0x16')][_0x45ba('0x18')]);return _0xe8aeb0(_0x116b06[_0x45ba('0x16')]['message']);}else{logger[_0x45ba('0x12')](_0x45ba('0x19'),_0x482a5c,_0x45ba('0x13'));_0xe8aeb0(_0x116b06[_0x45ba('0x1a')][_0x45ba('0x18')]);}})[_0x45ba('0x1b')](function(_0x2375b5){logger[_0x45ba('0x16')](_0x45ba('0x19'),_0x482a5c,_0x2375b5);_0x181dbb(_0x2375b5);});});}exports[_0x45ba('0x1c')]=function(_0x10520c){var _0x525732=this;return new Promise(function(_0x386ccf,_0x1676df){return db[_0x45ba('0x1d')]['update'](_0x10520c[_0x45ba('0x1e')],{'raw':_0x10520c[_0x45ba('0x1f')]?_0x10520c['options'][_0x45ba('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10520c['options']?_0x10520c[_0x45ba('0x1f')][_0x45ba('0x21')]||null:null,'attributes':_0x10520c[_0x45ba('0x1f')]?_0x10520c[_0x45ba('0x1f')][_0x45ba('0x22')]||null:null,'limit':_0x10520c[_0x45ba('0x1f')]?_0x10520c['options'][_0x45ba('0x23')]||null:null})[_0x45ba('0x11')](function(_0x33f086){logger[_0x45ba('0x12')]('UpdateChatInteraction',_0x10520c);logger[_0x45ba('0x14')]('UpdateChatInteraction',_0x10520c,JSON[_0x45ba('0x24')](_0x33f086));_0x386ccf(_0x33f086);})[_0x45ba('0x1b')](function(_0x5901d9){logger['error'](_0x45ba('0x1c'),_0x5901d9[_0x45ba('0x18')],_0x10520c);_0x1676df(_0x525732[_0x45ba('0x16')](0x1f4,_0x5901d9[_0x45ba('0x18')]));});});};exports[_0x45ba('0x25')]=function(_0x34e395){return new Promise(function(_0x1ddd63,_0x4d2d64){return db[_0x45ba('0x1d')][_0x45ba('0x26')]({'where':_0x34e395[_0x45ba('0x1f')]?_0x34e395[_0x45ba('0x1f')]['where']||null:null})[_0x45ba('0x11')](function(_0x336f5e){if(_0x336f5e){return _0x336f5e[_0x45ba('0x27')](_0x34e395[_0x45ba('0x1e')][_0x45ba('0x28')],_[_0x45ba('0x29')](_0x34e395[_0x45ba('0x1e')],[_0x45ba('0x28'),'id'])||{});}})[_0x45ba('0x2a')](function(_0x3695c2){logger['info'](_0x45ba('0x2b'),_0x34e395);logger[_0x45ba('0x14')](_0x45ba('0x2b'),_0x34e395,JSON[_0x45ba('0x24')](_0x3695c2));_0x1ddd63(_0x3695c2);})[_0x45ba('0x1b')](function(_0x1c5408){logger['error']('AddTags',_0x1c5408['message'],_0x34e395);_0x4d2d64(_this[_0x45ba('0x16')](0x1f4,_0x1c5408[_0x45ba('0x18')]));});});};
\ No newline at end of file
+var _0x63c1=['redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','UpdateChatInteraction','ChatInteraction','update','options','raw','where','stringify','catch','AddTagsToChatInteraction','find','addTags','body','ids','spread','AddTags','lodash','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x21098f,_0x3e5fd1){var _0x2cf331=function(_0x485ce8){while(--_0x485ce8){_0x21098f['push'](_0x21098f['shift']());}};_0x2cf331(++_0x3e5fd1);}(_0x63c1,0x187));var _0x163c=function(_0x14977a,_0x38700a){_0x14977a=_0x14977a-0x0;var _0x59902d=_0x63c1[_0x14977a];return _0x59902d;};'use strict';var _=require(_0x163c('0x0'));var util=require('util');var moment=require(_0x163c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x163c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x163c('0x3'));var logger=require('../../config/logger')(_0x163c('0x4'));var config=require(_0x163c('0x5'));var jayson=require(_0x163c('0x6'));var client=jayson['client'][_0x163c('0x7')]({'port':0x232a});config['redis']=_[_0x163c('0x8')](config[_0x163c('0x9')],{'host':_0x163c('0xa'),'port':0x18eb});var socket=require(_0x163c('0xb'))(new Redis(config[_0x163c('0x9')]));require(_0x163c('0xc'))[_0x163c('0xd')](socket);function respondWithRpcPromise(_0x3bdfe1,_0x5dec2a,_0x4bc7cd){return new BPromise(function(_0x242c20,_0x258d6c){return client[_0x163c('0xe')](_0x3bdfe1,_0x4bc7cd)[_0x163c('0xf')](function(_0x5a70db){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5dec2a,_0x163c('0x10'));logger[_0x163c('0x11')](_0x163c('0x12'),_0x5dec2a,_0x163c('0x10'),JSON['stringify'](_0x5a70db));if(_0x5a70db[_0x163c('0x13')]){if(_0x5a70db['error'][_0x163c('0x14')]===0x1f4){logger['error'](_0x163c('0x15'),_0x5dec2a,_0x5a70db[_0x163c('0x13')][_0x163c('0x16')]);return _0x258d6c(_0x5a70db['error'][_0x163c('0x16')]);}logger[_0x163c('0x13')](_0x163c('0x15'),_0x5dec2a,_0x5a70db[_0x163c('0x13')][_0x163c('0x16')]);return _0x242c20(_0x5a70db[_0x163c('0x13')]['message']);}else{logger[_0x163c('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x5dec2a,'request\x20sent');_0x242c20(_0x5a70db[_0x163c('0x18')]['message']);}})['catch'](function(_0x4f4068){logger[_0x163c('0x13')](_0x163c('0x15'),_0x5dec2a,_0x4f4068);_0x258d6c(_0x4f4068);});});}exports[_0x163c('0x19')]=function(_0x4f7a81){var _0x47cb53=this;return new Promise(function(_0x94f970,_0x48ec8f){return db[_0x163c('0x1a')][_0x163c('0x1b')](_0x4f7a81['body'],{'raw':_0x4f7a81[_0x163c('0x1c')]?_0x4f7a81[_0x163c('0x1c')][_0x163c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7a81[_0x163c('0x1c')]?_0x4f7a81[_0x163c('0x1c')][_0x163c('0x1e')]||null:null,'attributes':_0x4f7a81['options']?_0x4f7a81['options']['attributes']||null:null,'limit':_0x4f7a81[_0x163c('0x1c')]?_0x4f7a81[_0x163c('0x1c')]['limit']||null:null})[_0x163c('0xf')](function(_0x5b7cfc){logger[_0x163c('0x17')]('UpdateChatInteraction',_0x4f7a81);logger[_0x163c('0x11')](_0x163c('0x19'),_0x4f7a81,JSON[_0x163c('0x1f')](_0x5b7cfc));_0x94f970(_0x5b7cfc);})[_0x163c('0x20')](function(_0x4c5ab0){logger[_0x163c('0x13')](_0x163c('0x19'),_0x4c5ab0[_0x163c('0x16')],_0x4f7a81);_0x48ec8f(_0x47cb53[_0x163c('0x13')](0x1f4,_0x4c5ab0[_0x163c('0x16')]));});});};exports[_0x163c('0x21')]=function(_0x59a552){return new Promise(function(_0x85de7f,_0xf48ae4){return db[_0x163c('0x1a')][_0x163c('0x22')]({'where':_0x59a552[_0x163c('0x1c')]?_0x59a552[_0x163c('0x1c')]['where']||null:null})[_0x163c('0xf')](function(_0x3c8d3e){if(_0x3c8d3e){return _0x3c8d3e[_0x163c('0x23')](_0x59a552[_0x163c('0x24')][_0x163c('0x25')],_['omit'](_0x59a552[_0x163c('0x24')],[_0x163c('0x25'),'id'])||{});}})[_0x163c('0x26')](function(_0x3a0130){logger[_0x163c('0x17')](_0x163c('0x27'),_0x59a552);logger[_0x163c('0x11')](_0x163c('0x27'),_0x59a552,JSON['stringify'](_0x3a0130));_0x85de7f(_0x3a0130);})[_0x163c('0x20')](function(_0x34d644){logger[_0x163c('0x13')]('AddTags',_0x34d644[_0x163c('0x16')],_0x59a552);_0xf48ae4(_this[_0x163c('0x13')](0x1f4,_0x34d644[_0x163c('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 594b8de..b9d7c2f 100644
--- a/server/api/chatInteraction/chatInteraction.socket.js
+++ b/server/api/chatInteraction/chatInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x620b=['length','update','emit','removeListener','register'];(function(_0x1d2b4b,_0x1b8974){var _0x54d25f=function(_0x1008e2){while(--_0x1008e2){_0x1d2b4b['push'](_0x1d2b4b['shift']());}};_0x54d25f(++_0x1b8974);}(_0x620b,0x1c3));var _0xb620=function(_0x3c87d6,_0x594412){_0x3c87d6=_0x3c87d6-0x0;var _0x1cc644=_0x620b[_0x3c87d6];return _0x1cc644;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0xb620('0x0')];function createListener(_0x45ff8c,_0x9eb788){return function(_0xb3ec6c){_0x9eb788[_0xb620('0x1')](_0x45ff8c,_0xb3ec6c);};}function removeListener(_0x18d566,_0xa30b3f){return function(){ChatInteractionEvents[_0xb620('0x2')](_0x18d566,_0xa30b3f);};}exports[_0xb620('0x3')]=function(_0x4c73ba){for(var _0x1a2332=0x0,_0x3819f8=events[_0xb620('0x4')];_0x1a2332<_0x3819f8;_0x1a2332++){var _0x4074ad=events[_0x1a2332];var _0x5153a9=createListener('chatInteraction:'+_0x4074ad,_0x4c73ba);ChatInteractionEvents['on'](_0x4074ad,_0x5153a9);}};
\ No newline at end of file
+var _0x6ed3=['save','update','register','./chatInteraction.events'];(function(_0x6fa261,_0x596489){var _0x2938d3=function(_0x51fd60){while(--_0x51fd60){_0x6fa261['push'](_0x6fa261['shift']());}};_0x2938d3(++_0x596489);}(_0x6ed3,0xbb));var _0x36ed=function(_0x2bfa88,_0xc64230){_0x2bfa88=_0x2bfa88-0x0;var _0x2e7039=_0x6ed3[_0x2bfa88];return _0x2e7039;};'use strict';var ChatInteractionEvents=require(_0x36ed('0x0'));var events=[_0x36ed('0x1'),'remove',_0x36ed('0x2')];function createListener(_0x3341a6,_0x11367){return function(_0x4d8531){_0x11367['emit'](_0x3341a6,_0x4d8531);};}function removeListener(_0x18ae74,_0x12ec5a){return function(){ChatInteractionEvents['removeListener'](_0x18ae74,_0x12ec5a);};}exports[_0x36ed('0x3')]=function(_0x13d7f2){for(var _0x1171b9=0x0,_0x3096d5=events['length'];_0x1171b9<_0x3096d5;_0x1171b9++){var _0x50b9a9=events[_0x1171b9];var _0x57748b=createListener('chatInteraction:'+_0x50b9a9,_0x13d7f2);ChatInteractionEvents['on'](_0x50b9a9,_0x57748b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index b65f7ba..56d9c3b 100644
--- a/server/api/chatInteraction/index.js
+++ b/server/api/chatInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f83=['/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','tracked','chat','chatinteraction:addtags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','/:id/my_messages'];(function(_0x27f3b3,_0x456572){var _0x4890b6=function(_0x50eb5b){while(--_0x50eb5b){_0x27f3b3['push'](_0x27f3b3['shift']());}};_0x4890b6(++_0x456572);}(_0x8f83,0xe8));var _0x38f8=function(_0x3f746f,_0xf5194d){_0x3f746f=_0x3f746f-0x0;var _0x40746b=_0x8f83[_0x3f746f];return _0x40746b;};'use strict';var multer=require(_0x38f8('0x0'));var util=require(_0x38f8('0x1'));var path=require(_0x38f8('0x2'));var timeout=require(_0x38f8('0x3'));var express=require(_0x38f8('0x4'));var router=express[_0x38f8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x38f8('0x6'));var interaction=require(_0x38f8('0x7'));var config=require(_0x38f8('0x8'));var controller=require('./chatInteraction.controller');router[_0x38f8('0x9')]('/',auth[_0x38f8('0xa')](),controller['index']);router[_0x38f8('0x9')]('/describe',auth[_0x38f8('0xa')](),controller[_0x38f8('0xb')]);router[_0x38f8('0x9')](_0x38f8('0xc'),auth[_0x38f8('0xd')](),controller[_0x38f8('0xe')]);router[_0x38f8('0x9')](_0x38f8('0xf'),auth[_0x38f8('0xd')](),controller['attachmentDownload']);router[_0x38f8('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x38f8('0x10')]);router[_0x38f8('0x9')](_0x38f8('0x11'),auth[_0x38f8('0xd')](),controller['getMyMessages']);router['get'](_0x38f8('0x12'),auth[_0x38f8('0xa')](),controller[_0x38f8('0x13')]);router[_0x38f8('0x14')]('/',auth[_0x38f8('0xa')](),controller[_0x38f8('0x15')]);router['post'](_0x38f8('0x16'),auth['isAuthenticated'](),controller[_0x38f8('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42e0b6,_0x1e3cd6,_0x48f4ec){_0x48f4ec(null,path['join'](config[_0x38f8('0x18')],'server/files/attachments/'));},'filename':function(_0x5403b8,_0x3d3f69,_0x2708f5){_0x2708f5(null,util[_0x38f8('0x19')](_0x38f8('0x1a'),Date[_0x38f8('0x1b')](),_0x3d3f69[_0x38f8('0x1c')][_0x38f8('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x38f8('0x1e'),upload[_0x38f8('0x1f')](_0x38f8('0x20')),controller[_0x38f8('0x21')]);router[_0x38f8('0x14')](_0x38f8('0x22'),auth[_0x38f8('0xd')](),controller['addMessage']);router[_0x38f8('0x14')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x38f8('0x23')](_0x38f8('0x24'),_0x38f8('0x25')),controller['addTags']);router[_0x38f8('0x26')](_0x38f8('0xc'),auth[_0x38f8('0xa')](),interaction[_0x38f8('0x23')](_0x38f8('0x24'),'chatinteraction:update'),controller[_0x38f8('0x27')]);router[_0x38f8('0x26')](_0x38f8('0x28'),controller[_0x38f8('0x29')]);router[_0x38f8('0x26')](_0x38f8('0x2a'),auth[_0x38f8('0xd')](),controller[_0x38f8('0x2b')]);router[_0x38f8('0x26')](_0x38f8('0x2c'),controller[_0x38f8('0x2d')]);router[_0x38f8('0x2e')]('/:id',auth[_0x38f8('0xa')](),interaction[_0x38f8('0x23')](_0x38f8('0x24'),_0x38f8('0x2f')),controller[_0x38f8('0x30')]);router[_0x38f8('0x2e')]('/:id/tags',auth[_0x38f8('0xa')](),controller['removeTags']);module[_0x38f8('0x31')]=router;
\ No newline at end of file
+var _0x5e38=['/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','destroy','removeTags','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x5e38,0x172));var _0x85e3=function(_0x51d32d,_0x4a87fa){_0x51d32d=_0x51d32d-0x0;var _0x5d422b=_0x5e38[_0x51d32d];return _0x5d422b;};'use strict';var multer=require(_0x85e3('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85e3('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x85e3('0x2'));var interaction=require(_0x85e3('0x3'));var config=require(_0x85e3('0x4'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x85e3('0x5')](),controller['index']);router[_0x85e3('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x85e3('0x7')]);router['get'](_0x85e3('0x8'),auth[_0x85e3('0x9')](),controller[_0x85e3('0xa')]);router[_0x85e3('0x6')](_0x85e3('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x85e3('0xc')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x85e3('0xd')]);router['get'](_0x85e3('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x85e3('0xf')]);router['get']('/:id/download',auth[_0x85e3('0x5')](),controller[_0x85e3('0x10')]);router[_0x85e3('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x85e3('0x11')](_0x85e3('0x12'),auth[_0x85e3('0x5')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x85e3('0x13')]({'destination':function(_0xd3399e,_0x2d8054,_0x5928fc){_0x5928fc(null,path[_0x85e3('0x14')](config[_0x85e3('0x15')],_0x85e3('0x16')));},'filename':function(_0x36f9a0,_0x5ce865,_0x5593c9){_0x5593c9(null,util[_0x85e3('0x17')](_0x85e3('0x18'),Date['now'](),_0x5ce865[_0x85e3('0x19')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x85e3('0x11')](_0x85e3('0x1a'),upload[_0x85e3('0x1b')](_0x85e3('0x1c')),controller[_0x85e3('0x1d')]);router['post'](_0x85e3('0x1e'),auth[_0x85e3('0x9')](),controller[_0x85e3('0x1f')]);router['post'](_0x85e3('0x20'),auth[_0x85e3('0x5')](),interaction[_0x85e3('0x21')](_0x85e3('0x22'),_0x85e3('0x23')),controller[_0x85e3('0x24')]);router['put'](_0x85e3('0x8'),auth[_0x85e3('0x5')](),interaction[_0x85e3('0x21')]('chat',_0x85e3('0x25')),controller['update']);router[_0x85e3('0x26')](_0x85e3('0x27'),controller[_0x85e3('0x28')]);router[_0x85e3('0x26')](_0x85e3('0x29'),auth[_0x85e3('0x9')](),controller[_0x85e3('0x2a')]);router['put'](_0x85e3('0x2b'),controller['close']);router[_0x85e3('0x2c')](_0x85e3('0x8'),auth[_0x85e3('0x5')](),interaction[_0x85e3('0x21')](_0x85e3('0x22'),'chatinteraction:destroy'),controller[_0x85e3('0x2d')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x85e3('0x2e')]);module[_0x85e3('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index cc92ad4..2b75f10 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a35=['sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x271697,_0x6897d6){var _0x426093=function(_0x4d4dfe){while(--_0x4d4dfe){_0x271697['push'](_0x271697['shift']());}};_0x426093(++_0x6897d6);}(_0x2a35,0x15e));var _0x52a3=function(_0x3f4424,_0x227813){_0x3f4424=_0x3f4424-0x0;var _0x13da17=_0x2a35[_0x3f4424];return _0x13da17;};'use strict';var Sequelize=require(_0x52a3('0x0'));module[_0x52a3('0x1')]={'body':{'type':Sequelize[_0x52a3('0x2')](_0x52a3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x52a3('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x7b54=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x56f8de,_0x1bee78){var _0x5df982=function(_0x547402){while(--_0x547402){_0x56f8de['push'](_0x56f8de['shift']());}};_0x5df982(++_0x1bee78);}(_0x7b54,0xa8));var _0x47b5=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x7b54[_0x6a0266];return _0x309e00;};'use strict';var Sequelize=require(_0x47b5('0x0'));module[_0x47b5('0x1')]={'body':{'type':Sequelize[_0x47b5('0x2')](_0x47b5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x47b5('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x47b5('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 62984f2..a82bfb8 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.controller.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb50e=['VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','agent','resourceId','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','save','then','destroy','end','error','stack','name','index','map','ChatInternalMessage','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','user','fullname','role','internal','lastLoginAt','-online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb50e,0x1c0));var _0xeb50=function(_0x58e389,_0x3ab426){_0x58e389=_0x58e389-0x0;var _0x1437df=_0xb50e[_0x58e389];return _0x1437df;};'use strict';var emlformat=require(_0xeb50('0x0'));var rimraf=require(_0xeb50('0x1'));var zipdir=require(_0xeb50('0x2'));var jsonpatch=require(_0xeb50('0x3'));var rp=require(_0xeb50('0x4'));var moment=require(_0xeb50('0x5'));var BPromise=require(_0xeb50('0x6'));var Mustache=require(_0xeb50('0x7'));var util=require(_0xeb50('0x8'));var path=require(_0xeb50('0x9'));var sox=require(_0xeb50('0xa'));var csv=require(_0xeb50('0xb'));var ejs=require(_0xeb50('0xc'));var fs=require('fs');var fs_extra=require(_0xeb50('0xd'));var _=require(_0xeb50('0xe'));var squel=require(_0xeb50('0xf'));var crypto=require(_0xeb50('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeb50('0x11'));var Papa=require('papaparse');var Redis=require(_0xeb50('0x12'));var authService=require(_0xeb50('0x13'));var qs=require(_0xeb50('0x14'));var as=require(_0xeb50('0x15'));var hardwareService=require(_0xeb50('0x16'));var logger=require(_0xeb50('0x17'))(_0xeb50('0x18'));var utils=require(_0xeb50('0x19'));var config=require(_0xeb50('0x1a'));var licenseUtil=require(_0xeb50('0x1b'));var db=require(_0xeb50('0x1c'))['db'];config[_0xeb50('0x1d')]=_[_0xeb50('0x1e')](config[_0xeb50('0x1d')],{'host':_0xeb50('0x1f'),'port':0x18eb});var socket=require(_0xeb50('0x20'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xeb50('0x21')](socket);function respondWithStatusCode(_0x44746b,_0x3a26a1){_0x3a26a1=_0x3a26a1||0xcc;return function(_0x5ca221){if(_0x5ca221){return _0x44746b[_0xeb50('0x22')](_0x3a26a1);}return _0x44746b[_0xeb50('0x23')](_0x3a26a1)['end']();};}function respondWithResult(_0x79a31e,_0x4f761f){_0x4f761f=_0x4f761f||0xc8;return function(_0x559c1a){if(_0x559c1a){return _0x79a31e[_0xeb50('0x23')](_0x4f761f)[_0xeb50('0x24')](_0x559c1a);}};}function respondWithFilteredResult(_0x3809a1,_0x152080){return function(_0x3238e3){if(_0x3238e3){var _0x259e82=typeof _0x152080[_0xeb50('0x25')]==='undefined'&&typeof _0x152080['limit']==='undefined';var _0x11b546=_0x3238e3['count'];var _0x124282=_0x259e82?0x0:_0x152080[_0xeb50('0x25')];var _0x2f64de=_0x259e82?_0x3238e3[_0xeb50('0x26')]:_0x152080[_0xeb50('0x25')]+_0x152080[_0xeb50('0x27')];var _0x3f6651;if(_0x2f64de>=_0x11b546){_0x2f64de=_0x11b546;_0x3f6651=0xc8;}else{_0x3f6651=0xce;}_0x3809a1[_0xeb50('0x23')](_0x3f6651);return _0x3809a1[_0xeb50('0x28')](_0xeb50('0x29'),_0x124282+'-'+_0x2f64de+'/'+_0x11b546)['json'](_0x3238e3);}return null;};}function patchUpdates(_0x3b6860){return function(_0x5c9809){try{jsonpatch[_0xeb50('0x2a')](_0x5c9809,_0x3b6860,!![]);}catch(_0x4da4e4){return BPromise['reject'](_0x4da4e4);}return _0x5c9809[_0xeb50('0x2b')]();};}function saveUpdates(_0x2ec3f8,_0x3cabc2){return function(_0x352dd1){if(_0x352dd1){return _0x352dd1['update'](_0x2ec3f8)[_0xeb50('0x2c')](function(_0x59313b){return _0x59313b;});}return null;};}function removeEntity(_0x301aeb,_0x2747ab){return function(_0x4d652e){if(_0x4d652e){return _0x4d652e[_0xeb50('0x2d')]()[_0xeb50('0x2c')](function(){_0x301aeb[_0xeb50('0x23')](0xcc)[_0xeb50('0x2e')]();});}};}function handleEntityNotFound(_0x19d288,_0x6c8cfc){return function(_0xb9b4db){if(!_0xb9b4db){_0x19d288[_0xeb50('0x22')](0x194);}return _0xb9b4db;};}function handleError(_0x3a7630,_0x252990){_0x252990=_0x252990||0x1f4;return function(_0x254949){logger[_0xeb50('0x2f')](_0x254949[_0xeb50('0x30')]);if(_0x254949[_0xeb50('0x31')]){delete _0x254949[_0xeb50('0x31')];}_0x3a7630[_0xeb50('0x23')](_0x252990)['send'](_0x254949);};}exports[_0xeb50('0x32')]=function(_0x51e92b,_0x22479a){var _0xb20ec3={},_0x2ce348={},_0xf1019c={'count':0x0,'rows':[]};var _0x512acb=_[_0xeb50('0x33')](db[_0xeb50('0x34')]['rawAttributes'],function(_0x1268b6){return{'name':_0x1268b6['fieldName'],'type':_0x1268b6['type'][_0xeb50('0x35')]};});_0x2ce348[_0xeb50('0x36')]=_[_0xeb50('0x33')](_0x512acb,_0xeb50('0x31'));_0x2ce348[_0xeb50('0x37')]=_[_0xeb50('0x38')](_0x51e92b[_0xeb50('0x37')]);_0x2ce348[_0xeb50('0x39')]=_[_0xeb50('0x3a')](_0x2ce348['model'],_0x2ce348[_0xeb50('0x37')]);_0xb20ec3[_0xeb50('0x3b')]=_[_0xeb50('0x3a')](_0x2ce348['model'],qs['fields'](_0x51e92b[_0xeb50('0x37')][_0xeb50('0x3c')]));_0xb20ec3[_0xeb50('0x3b')]=_0xb20ec3[_0xeb50('0x3b')]['length']?_0xb20ec3[_0xeb50('0x3b')]:_0x2ce348[_0xeb50('0x36')];if(!_0x51e92b['query'][_0xeb50('0x3d')](_0xeb50('0x3e'))){_0xb20ec3[_0xeb50('0x27')]=qs[_0xeb50('0x27')](_0x51e92b['query'][_0xeb50('0x27')]);_0xb20ec3[_0xeb50('0x25')]=qs[_0xeb50('0x25')](_0x51e92b['query'][_0xeb50('0x25')]);}_0xb20ec3[_0xeb50('0x3f')]=qs[_0xeb50('0x40')](_0x51e92b[_0xeb50('0x37')]['sort']);_0xb20ec3['where']=qs[_0xeb50('0x39')](_[_0xeb50('0x41')](_0x51e92b[_0xeb50('0x37')],_0x2ce348[_0xeb50('0x39')]),_0x512acb);if(_0x51e92b[_0xeb50('0x37')][_0xeb50('0x42')]){_0xb20ec3[_0xeb50('0x43')]=_[_0xeb50('0x44')](_0xb20ec3['where'],{'$or':_[_0xeb50('0x33')](_0x512acb,function(_0x1514e7){if(_0x1514e7[_0xeb50('0x45')]!=='VIRTUAL'){var _0x562a67={};_0x562a67[_0x1514e7[_0xeb50('0x31')]]={'$like':'%'+_0x51e92b[_0xeb50('0x37')]['filter']+'%'};return _0x562a67;}})});}_0xb20ec3=_[_0xeb50('0x44')]({},_0xb20ec3,_0x51e92b[_0xeb50('0x46')]);var _0x4e8349={'where':_0xb20ec3[_0xeb50('0x43')]};return db[_0xeb50('0x34')]['count'](_0x4e8349)[_0xeb50('0x2c')](function(_0x1ad1dc){_0xf1019c[_0xeb50('0x26')]=_0x1ad1dc;if(_0x51e92b[_0xeb50('0x37')][_0xeb50('0x47')]){_0xb20ec3['include']=[{'all':!![]}];}return db[_0xeb50('0x34')][_0xeb50('0x48')](_0xb20ec3);})[_0xeb50('0x2c')](function(_0x294dcf){_0xf1019c[_0xeb50('0x49')]=_0x294dcf;return _0xf1019c;})[_0xeb50('0x2c')](respondWithFilteredResult(_0x22479a,_0xb20ec3))[_0xeb50('0x4a')](handleError(_0x22479a,null));};exports[_0xeb50('0x4b')]=function(_0x5205af,_0x5c237a){var _0x17cdd0={'raw':!![],'where':{'id':_0x5205af[_0xeb50('0x4c')]['id']}},_0x2d06b1={};_0x2d06b1[_0xeb50('0x36')]=_['keys'](db['ChatInternalMessage'][_0xeb50('0x4d')]);_0x2d06b1[_0xeb50('0x37')]=_['keys'](_0x5205af[_0xeb50('0x37')]);_0x2d06b1['filters']=_[_0xeb50('0x3a')](_0x2d06b1['model'],_0x2d06b1[_0xeb50('0x37')]);_0x17cdd0[_0xeb50('0x3b')]=_[_0xeb50('0x3a')](_0x2d06b1[_0xeb50('0x36')],qs[_0xeb50('0x3c')](_0x5205af[_0xeb50('0x37')][_0xeb50('0x3c')]));_0x17cdd0[_0xeb50('0x3b')]=_0x17cdd0[_0xeb50('0x3b')][_0xeb50('0x4e')]?_0x17cdd0['attributes']:_0x2d06b1[_0xeb50('0x36')];if(_0x5205af[_0xeb50('0x37')]['includeAll']){_0x17cdd0[_0xeb50('0x4f')]=[{'all':!![]}];}_0x17cdd0=_[_0xeb50('0x44')]({},_0x17cdd0,_0x5205af[_0xeb50('0x46')]);return db[_0xeb50('0x34')][_0xeb50('0x50')](_0x17cdd0)[_0xeb50('0x2c')](handleEntityNotFound(_0x5c237a,null))[_0xeb50('0x2c')](respondWithResult(_0x5c237a,null))['catch'](handleError(_0x5c237a,null));};exports[_0xeb50('0x51')]=function(_0x3f45af,_0x3b7841){return db[_0xeb50('0x34')]['create'](_0x3f45af[_0xeb50('0x52')],{})[_0xeb50('0x2c')](respondWithResult(_0x3b7841,0xc9))[_0xeb50('0x4a')](handleError(_0x3b7841,null));};exports['update']=function(_0x17d4b4,_0x2f7576){if(_0x17d4b4['body']['id']){delete _0x17d4b4[_0xeb50('0x52')]['id'];}return db[_0xeb50('0x34')][_0xeb50('0x50')]({'where':{'id':_0x17d4b4['params']['id']}})[_0xeb50('0x2c')](handleEntityNotFound(_0x2f7576,null))[_0xeb50('0x2c')](saveUpdates(_0x17d4b4['body'],null))[_0xeb50('0x2c')](respondWithResult(_0x2f7576,null))[_0xeb50('0x4a')](handleError(_0x2f7576,null));};exports[_0xeb50('0x2d')]=function(_0x4d96c4,_0x55f8c1){return db[_0xeb50('0x34')][_0xeb50('0x50')]({'where':{'id':_0x4d96c4['params']['id']}})[_0xeb50('0x2c')](handleEntityNotFound(_0x55f8c1,null))[_0xeb50('0x2c')](removeEntity(_0x55f8c1,null))[_0xeb50('0x4a')](handleError(_0x55f8c1,null));};exports[_0xeb50('0x53')]=function(_0x61e720,_0x2b1675){return db['ChatInternalMessage'][_0xeb50('0x53')]()[_0xeb50('0x2c')](respondWithResult(_0x2b1675,null))[_0xeb50('0x4a')](handleError(_0x2b1675,null));};function wrapUser(_0x14ca3b){return function(_0x341d17){var _0x37cae6=_0x14ca3b[_0xeb50('0x54')]({'plain':!![]});_0x37cae6[_0xeb50('0x55')]=[];if(_0x341d17){_0x37cae6[_0xeb50('0x56')]=_0x341d17[_0xeb50('0x57')];_0x37cae6[_0xeb50('0x58')]=_0x341d17;}else{_0x37cae6[_0xeb50('0x56')]=moment(0x0)[_0xeb50('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x37cae6[_0xeb50('0x58')]={};}return _0x37cae6;};}exports['getUsers']=function(_0xa69f1c,_0x1e3c58,_0x477e00){var _0x1b4319=[];return db[_0xeb50('0x5a')][_0xeb50('0x48')]({'where':{'role':['agent','admin',_0xeb50('0x5b')]},'attributes':['id',_0xeb50('0x5c'),_0xeb50('0x31'),_0xeb50('0x5d'),'userpic',_0xeb50('0x5e'),'online',_0xeb50('0x5f'),'allowmessenger','showWebBar'],'order':qs[_0xeb50('0x40')](_0xeb50('0x60')),'include':[{'model':db[_0xeb50('0x61')],'as':'VoiceQueues','attributes':['id',_0xeb50('0x31'),_0xeb50('0x45')],'through':{'attributes':[]}}]})[_0xeb50('0x2c')](function(_0x1f1a67){if(_0x1f1a67){var _0x15058b=_0xa69f1c[_0xeb50('0x5b')]['get']({'plain':!![]});if(!_0x15058b)throw new Error(_0xeb50('0x62'));if(_0x15058b[_0xeb50('0x5d')]===_0xeb50('0x5b')){return db[_0xeb50('0x63')][_0xeb50('0x50')]({'where':{'name':'Agents','userProfileId':_0x15058b[_0xeb50('0x64')]},'raw':!![]})[_0xeb50('0x2c')](function(_0x5f07cd){if(_0x5f07cd){if(_0x5f07cd['autoAssociation']===0x0){return db[_0xeb50('0x65')][_0xeb50('0x48')]({'where':{'sectionId':_0x5f07cd['id']},'raw':!![]})[_0xeb50('0x2c')](function(_0xc84453){var _0x56baba=[];if(_['isEmpty'](_0xc84453)){_0x56baba=_[_0xeb50('0x42')](_0x1f1a67,function(_0x532cd7){if(_0x532cd7['role']!==_0xeb50('0x66')){return _0x532cd7;}});return _0x56baba;}else{for(var _0xe0688b=0x0;_0xe0688b<_0x1f1a67[_0xeb50('0x4e')];_0xe0688b++){var _0x12258d=_0x1f1a67[_0xe0688b];if(_0x12258d[_0xeb50('0x5d')]===_0xeb50('0x66')){var _0x3a0e8b=_[_0xeb50('0x50')](_0xc84453,function(_0x49c9da){return _0x49c9da[_0xeb50('0x67')]===_0x12258d['id'];});if(_0x3a0e8b)_0x56baba[_0xeb50('0x68')](_0x12258d);}else{_0x56baba['push'](_0x12258d);}}return _0x56baba;}});}else{return _0x1f1a67;}}else{var _0x26a14e=_[_0xeb50('0x42')](_0x1f1a67,function(_0x5654d3){if(_0x5654d3[_0xeb50('0x5d')]!==_0xeb50('0x66')){return _0x5654d3;}});return _0x26a14e;}});}else{return _0x1f1a67;}}})[_0xeb50('0x2c')](function(_0x5827c0){var _0x4d8da7=[];if(_0x5827c0){_0x1b4319=_0x5827c0;for(var _0x4e8904=0x0;_0x4e8904<_0x5827c0[_0xeb50('0x4e')];_0x4e8904+=0x1){_0x1b4319[_0x4e8904][_0xeb50('0x55')]=[];_0x4d8da7[_0xeb50('0x68')](db[_0xeb50('0x34')][_0xeb50('0x50')]({'where':{'FromId':[_0xa69f1c[_0xeb50('0x5b')]['id'],_0x5827c0[_0x4e8904]['id']],'ToId':[_0xa69f1c[_0xeb50('0x5b')]['id'],_0x5827c0[_0x4e8904]['id']],'ChatGroupId':null},'attributes':['id',_0xeb50('0x57'),_0xeb50('0x69'),_0xeb50('0x6a'),_0xeb50('0x6b'),'body'],'order':qs['sort'](_0xeb50('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5827c0[_0x4e8904])));}return BPromise['all'](_0x4d8da7);}return[];})[_0xeb50('0x2c')](function(_0x55d430){return{'rows':_0x55d430,'count':_0x55d430[_0xeb50('0x4e')]};})[_0xeb50('0x2c')](respondWithResult(_0x1e3c58,null))[_0xeb50('0x4a')](handleError(_0x1e3c58,null));};
\ No newline at end of file
+var _0x197d=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','destroy','describe','get','lastMessageAt','createdAt','lastMessage','format','User','agent','admin','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','push','messages','FromId','ToId','all','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','limit','count','set','apply','save','update','then','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x589da7,_0x165fac){var _0x809a94=function(_0x109c24){while(--_0x109c24){_0x589da7['push'](_0x589da7['shift']());}};_0x809a94(++_0x165fac);}(_0x197d,0x107));var _0xd197=function(_0x30a550,_0x1e4a6e){_0x30a550=_0x30a550-0x0;var _0x494912=_0x197d[_0x30a550];return _0x494912;};'use strict';var emlformat=require(_0xd197('0x0'));var rimraf=require(_0xd197('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd197('0x2'));var rp=require('request-promise');var moment=require(_0xd197('0x3'));var BPromise=require(_0xd197('0x4'));var Mustache=require('mustache');var util=require(_0xd197('0x5'));var path=require(_0xd197('0x6'));var sox=require(_0xd197('0x7'));var csv=require(_0xd197('0x8'));var ejs=require(_0xd197('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd197('0xa'));var crypto=require(_0xd197('0xb'));var jsforce=require(_0xd197('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd197('0x8'));var querystring=require('querystring');var Papa=require(_0xd197('0xd'));var Redis=require(_0xd197('0xe'));var authService=require(_0xd197('0xf'));var qs=require(_0xd197('0x10'));var as=require(_0xd197('0x11'));var hardwareService=require(_0xd197('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xd197('0x13'));var config=require(_0xd197('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd197('0x15'))['db'];config[_0xd197('0x16')]=_[_0xd197('0x17')](config[_0xd197('0x16')],{'host':_0xd197('0x18'),'port':0x18eb});var socket=require(_0xd197('0x19'))(new Redis(config[_0xd197('0x16')]));require(_0xd197('0x1a'))[_0xd197('0x1b')](socket);function respondWithStatusCode(_0x29892f,_0x43216b){_0x43216b=_0x43216b||0xcc;return function(_0x22568a){if(_0x22568a){return _0x29892f[_0xd197('0x1c')](_0x43216b);}return _0x29892f['status'](_0x43216b)[_0xd197('0x1d')]();};}function respondWithResult(_0x25f83b,_0x65d231){_0x65d231=_0x65d231||0xc8;return function(_0x90a76f){if(_0x90a76f){return _0x25f83b[_0xd197('0x1e')](_0x65d231)[_0xd197('0x1f')](_0x90a76f);}};}function respondWithFilteredResult(_0x26a1a1,_0x318c26){return function(_0x3698d3){if(_0x3698d3){var _0x2a9541=typeof _0x318c26[_0xd197('0x20')]==='undefined'&&typeof _0x318c26[_0xd197('0x21')]==='undefined';var _0x2d8e81=_0x3698d3['count'];var _0x22ac55=_0x2a9541?0x0:_0x318c26[_0xd197('0x20')];var _0x590261=_0x2a9541?_0x3698d3[_0xd197('0x22')]:_0x318c26[_0xd197('0x20')]+_0x318c26['limit'];var _0x5f5329;if(_0x590261>=_0x2d8e81){_0x590261=_0x2d8e81;_0x5f5329=0xc8;}else{_0x5f5329=0xce;}_0x26a1a1['status'](_0x5f5329);return _0x26a1a1[_0xd197('0x23')]('Content-Range',_0x22ac55+'-'+_0x590261+'/'+_0x2d8e81)[_0xd197('0x1f')](_0x3698d3);}return null;};}function patchUpdates(_0x275871){return function(_0x40c563){try{jsonpatch[_0xd197('0x24')](_0x40c563,_0x275871,!![]);}catch(_0x39d270){return BPromise['reject'](_0x39d270);}return _0x40c563[_0xd197('0x25')]();};}function saveUpdates(_0x4fb6f4,_0x3d66ce){return function(_0x1ac68b){if(_0x1ac68b){return _0x1ac68b[_0xd197('0x26')](_0x4fb6f4)[_0xd197('0x27')](function(_0xeba565){return _0xeba565;});}return null;};}function removeEntity(_0x264f70,_0x34ece9){return function(_0x1bcb9e){if(_0x1bcb9e){return _0x1bcb9e['destroy']()[_0xd197('0x27')](function(){_0x264f70[_0xd197('0x1e')](0xcc)[_0xd197('0x1d')]();});}};}function handleEntityNotFound(_0x14bef8,_0x569eb3){return function(_0x5beba8){if(!_0x5beba8){_0x14bef8['sendStatus'](0x194);}return _0x5beba8;};}function handleError(_0x36f0ba,_0x1c84a0){_0x1c84a0=_0x1c84a0||0x1f4;return function(_0x155bf0){logger[_0xd197('0x28')](_0x155bf0[_0xd197('0x29')]);if(_0x155bf0[_0xd197('0x2a')]){delete _0x155bf0['name'];}_0x36f0ba[_0xd197('0x1e')](_0x1c84a0)['send'](_0x155bf0);};}exports[_0xd197('0x2b')]=function(_0x52059e,_0x1a25b3){var _0x57884e={},_0x30aebd={},_0x430f13={'count':0x0,'rows':[]};var _0x1d5bb5=_[_0xd197('0x2c')](db['ChatInternalMessage'][_0xd197('0x2d')],function(_0x50bea6){return{'name':_0x50bea6['fieldName'],'type':_0x50bea6['type'][_0xd197('0x2e')]};});_0x30aebd[_0xd197('0x2f')]=_[_0xd197('0x2c')](_0x1d5bb5,_0xd197('0x2a'));_0x30aebd[_0xd197('0x30')]=_[_0xd197('0x31')](_0x52059e[_0xd197('0x30')]);_0x30aebd[_0xd197('0x32')]=_['intersection'](_0x30aebd[_0xd197('0x2f')],_0x30aebd['query']);_0x57884e[_0xd197('0x33')]=_[_0xd197('0x34')](_0x30aebd[_0xd197('0x2f')],qs[_0xd197('0x35')](_0x52059e[_0xd197('0x30')][_0xd197('0x35')]));_0x57884e[_0xd197('0x33')]=_0x57884e[_0xd197('0x33')][_0xd197('0x36')]?_0x57884e[_0xd197('0x33')]:_0x30aebd['model'];if(!_0x52059e[_0xd197('0x30')][_0xd197('0x37')](_0xd197('0x38'))){_0x57884e[_0xd197('0x21')]=qs[_0xd197('0x21')](_0x52059e[_0xd197('0x30')][_0xd197('0x21')]);_0x57884e[_0xd197('0x20')]=qs[_0xd197('0x20')](_0x52059e[_0xd197('0x30')][_0xd197('0x20')]);}_0x57884e[_0xd197('0x39')]=qs[_0xd197('0x3a')](_0x52059e['query']['sort']);_0x57884e[_0xd197('0x3b')]=qs[_0xd197('0x32')](_['pick'](_0x52059e[_0xd197('0x30')],_0x30aebd['filters']),_0x1d5bb5);if(_0x52059e[_0xd197('0x30')][_0xd197('0x3c')]){_0x57884e[_0xd197('0x3b')]=_[_0xd197('0x3d')](_0x57884e[_0xd197('0x3b')],{'$or':_['map'](_0x1d5bb5,function(_0x2ede94){if(_0x2ede94['type']!==_0xd197('0x3e')){var _0x1d0d15={};_0x1d0d15[_0x2ede94[_0xd197('0x2a')]]={'$like':'%'+_0x52059e[_0xd197('0x30')][_0xd197('0x3c')]+'%'};return _0x1d0d15;}})});}_0x57884e=_['merge']({},_0x57884e,_0x52059e['options']);var _0x3789f5={'where':_0x57884e['where']};return db[_0xd197('0x3f')][_0xd197('0x22')](_0x3789f5)[_0xd197('0x27')](function(_0x377486){_0x430f13[_0xd197('0x22')]=_0x377486;if(_0x52059e[_0xd197('0x30')][_0xd197('0x40')]){_0x57884e[_0xd197('0x41')]=[{'all':!![]}];}return db[_0xd197('0x3f')][_0xd197('0x42')](_0x57884e);})['then'](function(_0x112479){_0x430f13[_0xd197('0x43')]=_0x112479;return _0x430f13;})[_0xd197('0x27')](respondWithFilteredResult(_0x1a25b3,_0x57884e))[_0xd197('0x44')](handleError(_0x1a25b3,null));};exports[_0xd197('0x45')]=function(_0x5a7d05,_0xd5cdf7){var _0x3b2cc4={'raw':!![],'where':{'id':_0x5a7d05['params']['id']}},_0x12ea6c={};_0x12ea6c[_0xd197('0x2f')]=_['keys'](db[_0xd197('0x3f')][_0xd197('0x2d')]);_0x12ea6c[_0xd197('0x30')]=_[_0xd197('0x31')](_0x5a7d05[_0xd197('0x30')]);_0x12ea6c[_0xd197('0x32')]=_[_0xd197('0x34')](_0x12ea6c[_0xd197('0x2f')],_0x12ea6c[_0xd197('0x30')]);_0x3b2cc4['attributes']=_[_0xd197('0x34')](_0x12ea6c[_0xd197('0x2f')],qs[_0xd197('0x35')](_0x5a7d05[_0xd197('0x30')]['fields']));_0x3b2cc4[_0xd197('0x33')]=_0x3b2cc4['attributes'][_0xd197('0x36')]?_0x3b2cc4['attributes']:_0x12ea6c['model'];if(_0x5a7d05[_0xd197('0x30')][_0xd197('0x40')]){_0x3b2cc4[_0xd197('0x41')]=[{'all':!![]}];}_0x3b2cc4=_['merge']({},_0x3b2cc4,_0x5a7d05[_0xd197('0x46')]);return db['ChatInternalMessage'][_0xd197('0x47')](_0x3b2cc4)[_0xd197('0x27')](handleEntityNotFound(_0xd5cdf7,null))[_0xd197('0x27')](respondWithResult(_0xd5cdf7,null))[_0xd197('0x44')](handleError(_0xd5cdf7,null));};exports[_0xd197('0x48')]=function(_0x167df3,_0x2c6d83){return db[_0xd197('0x3f')][_0xd197('0x48')](_0x167df3[_0xd197('0x49')],{})['then'](respondWithResult(_0x2c6d83,0xc9))[_0xd197('0x44')](handleError(_0x2c6d83,null));};exports[_0xd197('0x26')]=function(_0x585520,_0x26e850){if(_0x585520[_0xd197('0x49')]['id']){delete _0x585520[_0xd197('0x49')]['id'];}return db['ChatInternalMessage'][_0xd197('0x47')]({'where':{'id':_0x585520[_0xd197('0x4a')]['id']}})[_0xd197('0x27')](handleEntityNotFound(_0x26e850,null))[_0xd197('0x27')](saveUpdates(_0x585520['body'],null))[_0xd197('0x27')](respondWithResult(_0x26e850,null))[_0xd197('0x44')](handleError(_0x26e850,null));};exports[_0xd197('0x4b')]=function(_0x4c340c,_0x242e5d){return db[_0xd197('0x3f')][_0xd197('0x47')]({'where':{'id':_0x4c340c['params']['id']}})[_0xd197('0x27')](handleEntityNotFound(_0x242e5d,null))[_0xd197('0x27')](removeEntity(_0x242e5d,null))[_0xd197('0x44')](handleError(_0x242e5d,null));};exports[_0xd197('0x4c')]=function(_0x496a2a,_0x575879){return db[_0xd197('0x3f')][_0xd197('0x4c')]()[_0xd197('0x27')](respondWithResult(_0x575879,null))['catch'](handleError(_0x575879,null));};function wrapUser(_0x21c710){return function(_0x5ef1a0){var _0x51c8ad=_0x21c710[_0xd197('0x4d')]({'plain':!![]});_0x51c8ad['messages']=[];if(_0x5ef1a0){_0x51c8ad[_0xd197('0x4e')]=_0x5ef1a0[_0xd197('0x4f')];_0x51c8ad[_0xd197('0x50')]=_0x5ef1a0;}else{_0x51c8ad[_0xd197('0x4e')]=moment(0x0)[_0xd197('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x51c8ad[_0xd197('0x50')]={};}return _0x51c8ad;};}exports['getUsers']=function(_0x90f26e,_0x5161d3,_0x18f67b){var _0x1e4b69=[];return db[_0xd197('0x52')]['findAll']({'where':{'role':[_0xd197('0x53'),_0xd197('0x54'),'user']},'attributes':['id',_0xd197('0x55'),_0xd197('0x2a'),_0xd197('0x56'),_0xd197('0x57'),_0xd197('0x58'),'online',_0xd197('0x59'),_0xd197('0x5a'),_0xd197('0x5b')],'order':qs[_0xd197('0x3a')](_0xd197('0x5c')),'include':[{'model':db[_0xd197('0x5d')],'as':_0xd197('0x5e'),'attributes':['id',_0xd197('0x2a'),_0xd197('0x5f')],'through':{'attributes':[]}}]})[_0xd197('0x27')](function(_0x30222e){if(_0x30222e){var _0x231149=_0x90f26e[_0xd197('0x60')][_0xd197('0x4d')]({'plain':!![]});if(!_0x231149)throw new Error(_0xd197('0x61'));if(_0x231149['role']==='user'){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x231149[_0xd197('0x62')]},'raw':!![]})[_0xd197('0x27')](function(_0x563b9a){if(_0x563b9a){if(_0x563b9a[_0xd197('0x63')]===0x0){return db[_0xd197('0x64')][_0xd197('0x42')]({'where':{'sectionId':_0x563b9a['id']},'raw':!![]})[_0xd197('0x27')](function(_0x5f44c6){var _0x3e6fce=[];if(_['isEmpty'](_0x5f44c6)){_0x3e6fce=_[_0xd197('0x3c')](_0x30222e,function(_0x184efe){if(_0x184efe[_0xd197('0x56')]!=='agent'){return _0x184efe;}});return _0x3e6fce;}else{for(var _0x26a3c8=0x0;_0x26a3c8<_0x30222e['length'];_0x26a3c8++){var _0x2a951c=_0x30222e[_0x26a3c8];if(_0x2a951c[_0xd197('0x56')]===_0xd197('0x53')){var _0x384d34=_[_0xd197('0x47')](_0x5f44c6,function(_0x1e66ca){return _0x1e66ca['resourceId']===_0x2a951c['id'];});if(_0x384d34)_0x3e6fce[_0xd197('0x65')](_0x2a951c);}else{_0x3e6fce[_0xd197('0x65')](_0x2a951c);}}return _0x3e6fce;}});}else{return _0x30222e;}}else{var _0x603753=_[_0xd197('0x3c')](_0x30222e,function(_0x40c723){if(_0x40c723['role']!==_0xd197('0x53')){return _0x40c723;}});return _0x603753;}});}else{return _0x30222e;}}})[_0xd197('0x27')](function(_0x1d9b9f){var _0x21e87d=[];if(_0x1d9b9f){_0x1e4b69=_0x1d9b9f;for(var _0x4a4b8a=0x0;_0x4a4b8a<_0x1d9b9f[_0xd197('0x36')];_0x4a4b8a+=0x1){_0x1e4b69[_0x4a4b8a][_0xd197('0x66')]=[];_0x21e87d[_0xd197('0x65')](db[_0xd197('0x3f')]['find']({'where':{'FromId':[_0x90f26e[_0xd197('0x60')]['id'],_0x1d9b9f[_0x4a4b8a]['id']],'ToId':[_0x90f26e[_0xd197('0x60')]['id'],_0x1d9b9f[_0x4a4b8a]['id']],'ChatGroupId':null},'attributes':['id',_0xd197('0x4f'),_0xd197('0x67'),_0xd197('0x68'),'read',_0xd197('0x49')],'order':qs[_0xd197('0x3a')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd197('0x27')](wrapUser(_0x1d9b9f[_0x4a4b8a])));}return BPromise[_0xd197('0x69')](_0x21e87d);}return[];})[_0xd197('0x27')](function(_0x2230d4){return{'rows':_0x2230d4,'count':_0x2230d4['length']};})[_0xd197('0x27')](respondWithResult(_0x5161d3,null))[_0xd197('0x44')](handleError(_0x5161d3,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index a065cd4..0d5fa4c 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.events.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x26fb=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3869c0,_0x293139){var _0x58fed5=function(_0xa44a1d){while(--_0xa44a1d){_0x3869c0['push'](_0x3869c0['shift']());}};_0x58fed5(++_0x293139);}(_0x26fb,0x1f4));var _0xb26f=function(_0x37bf43,_0x5b2339){_0x37bf43=_0x37bf43-0x0;var _0x4101c5=_0x26fb[_0x37bf43];return _0x4101c5;};'use strict';var EventEmitter=require(_0xb26f('0x0'));var ChatInternalMessage=require(_0xb26f('0x1'))['db'][_0xb26f('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb26f('0x3')](0x0);var events={'afterCreate':_0xb26f('0x4'),'afterUpdate':_0xb26f('0x5'),'afterDestroy':_0xb26f('0x6')};function emitEvent(_0x150c69){return function(_0x5ac713,_0xa7193e,_0x1c50e8){ChatInternalMessageEvents[_0xb26f('0x7')](_0x150c69+':'+_0x5ac713['id'],_0x5ac713);ChatInternalMessageEvents[_0xb26f('0x7')](_0x150c69,_0x5ac713);_0x1c50e8(null);};}for(var e in events){if(events[_0xb26f('0x8')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb26f('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x2174=['events','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2174,0x142));var _0x4217=function(_0x266d0f,_0x16a276){_0x266d0f=_0x266d0f-0x0;var _0x23d450=_0x2174[_0x266d0f];return _0x23d450;};'use strict';var EventEmitter=require(_0x4217('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4217('0x1')](0x0);var events={'afterCreate':_0x4217('0x2'),'afterUpdate':'update','afterDestroy':_0x4217('0x3')};function emitEvent(_0x1ae667){return function(_0x3a09e,_0x435b31,_0x175ca8){ChatInternalMessageEvents['emit'](_0x1ae667+':'+_0x3a09e['id'],_0x3a09e);ChatInternalMessageEvents[_0x4217('0x4')](_0x1ae667,_0x3a09e);_0x175ca8(null);};}for(var e in events){if(events[_0x4217('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x4217('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 99e489b..deaabb1 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.model.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1973=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x1973,0x74));var _0x3197=function(_0x34b410,_0x571fe7){_0x34b410=_0x34b410-0x0;var _0x5df540=_0x1973[_0x34b410];return _0x5df540;};'use strict';var _=require(_0x3197('0x0'));var util=require(_0x3197('0x1'));var logger=require(_0x3197('0x2'))(_0x3197('0x3'));var moment=require(_0x3197('0x4'));var BPromise=require(_0x3197('0x5'));var rp=require(_0x3197('0x6'));var fs=require('fs');var path=require(_0x3197('0x7'));var rimraf=require(_0x3197('0x8'));var config=require(_0x3197('0x9'));var attributes=require(_0x3197('0xa'));module[_0x3197('0xb')]=function(_0x62dd41,_0x5307aa){return _0x62dd41[_0x3197('0xc')](_0x3197('0xd'),attributes,{'tableName':_0x3197('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3197('0xf'),'collate':_0x3197('0x10')});};
\ No newline at end of file
+var _0x07d2=['ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','request-promise','rimraf','exports'];(function(_0x57060b,_0xc6ecc){var _0x101612=function(_0x3f2df3){while(--_0x3f2df3){_0x57060b['push'](_0x57060b['shift']());}};_0x101612(++_0xc6ecc);}(_0x07d2,0xb7));var _0x207d=function(_0x5dc0b0,_0x3bb51b){_0x5dc0b0=_0x5dc0b0-0x0;var _0x4af860=_0x07d2[_0x5dc0b0];return _0x4af860;};'use strict';var _=require(_0x207d('0x0'));var util=require(_0x207d('0x1'));var logger=require(_0x207d('0x2'))(_0x207d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x207d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x207d('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x207d('0x6')]=function(_0x2b100c,_0x4a3654){return _0x2b100c['define'](_0x207d('0x7'),attributes,{'tableName':_0x207d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x207d('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9b70b2d..e2b144e 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f4e=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0x8f4e,0x149));var _0xe8f4=function(_0x2954e5,_0x5f04b9){_0x2954e5=_0x2954e5-0x0;var _0x4b4deb=_0x8f4e[_0x2954e5];return _0x4b4deb;};'use strict';var _=require(_0xe8f4('0x0'));var util=require('util');var moment=require(_0xe8f4('0x1'));var BPromise=require(_0xe8f4('0x2'));var rs=require(_0xe8f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8f4('0x4'))['db'];var utils=require(_0xe8f4('0x5'));var logger=require(_0xe8f4('0x6'))(_0xe8f4('0x7'));var config=require(_0xe8f4('0x8'));var jayson=require(_0xe8f4('0x9'));var client=jayson['client'][_0xe8f4('0xa')]({'port':0x232a});config[_0xe8f4('0xb')]=_[_0xe8f4('0xc')](config[_0xe8f4('0xb')],{'host':_0xe8f4('0xd'),'port':0x18eb});var socket=require(_0xe8f4('0xe'))(new Redis(config[_0xe8f4('0xb')]));require(_0xe8f4('0xf'))[_0xe8f4('0x10')](socket);function respondWithRpcPromise(_0x5cce05,_0x5459e4,_0x525340){return new BPromise(function(_0x417426,_0x410a12){return client['request'](_0x5cce05,_0x525340)['then'](function(_0x6a15f){logger[_0xe8f4('0x11')](_0xe8f4('0x12'),_0x5459e4,_0xe8f4('0x13'));logger[_0xe8f4('0x14')](_0xe8f4('0x15'),_0x5459e4,_0xe8f4('0x13'),JSON[_0xe8f4('0x16')](_0x6a15f));if(_0x6a15f['error']){if(_0x6a15f[_0xe8f4('0x17')]['code']===0x1f4){logger[_0xe8f4('0x17')](_0xe8f4('0x12'),_0x5459e4,_0x6a15f[_0xe8f4('0x17')][_0xe8f4('0x18')]);return _0x410a12(_0x6a15f[_0xe8f4('0x17')][_0xe8f4('0x18')]);}logger['error'](_0xe8f4('0x12'),_0x5459e4,_0x6a15f['error']['message']);return _0x417426(_0x6a15f[_0xe8f4('0x17')][_0xe8f4('0x18')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x5459e4,'request\x20sent');_0x417426(_0x6a15f['result'][_0xe8f4('0x18')]);}})['catch'](function(_0x303258){logger['error'](_0xe8f4('0x12'),_0x5459e4,_0x303258);_0x410a12(_0x303258);});});}
\ No newline at end of file
+var _0x7005=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','util','moment'];(function(_0x103206,_0x1fae01){var _0x2e2f53=function(_0x34f7ca){while(--_0x34f7ca){_0x103206['push'](_0x103206['shift']());}};_0x2e2f53(++_0x1fae01);}(_0x7005,0x148));var _0x5700=function(_0x5d8251,_0x633d3){_0x5d8251=_0x5d8251-0x0;var _0x1bff1e=_0x7005[_0x5d8251];return _0x1bff1e;};'use strict';var _=require('lodash');var util=require(_0x5700('0x0'));var moment=require(_0x5700('0x1'));var BPromise=require(_0x5700('0x2'));var rs=require(_0x5700('0x3'));var fs=require('fs');var Redis=require(_0x5700('0x4'));var db=require(_0x5700('0x5'))['db'];var utils=require(_0x5700('0x6'));var logger=require(_0x5700('0x7'))(_0x5700('0x8'));var config=require(_0x5700('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5700('0xa')][_0x5700('0xb')]({'port':0x232a});config[_0x5700('0xc')]=_[_0x5700('0xd')](config[_0x5700('0xc')],{'host':_0x5700('0xe'),'port':0x18eb});var socket=require(_0x5700('0xf'))(new Redis(config[_0x5700('0xc')]));require(_0x5700('0x10'))[_0x5700('0x11')](socket);function respondWithRpcPromise(_0x220c7b,_0x2b1ea4,_0x174106){return new BPromise(function(_0x2924e9,_0x2f09a0){return client[_0x5700('0x12')](_0x220c7b,_0x174106)[_0x5700('0x13')](function(_0x5653b4){logger[_0x5700('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x2b1ea4,_0x5700('0x15'));logger[_0x5700('0x16')](_0x5700('0x17'),_0x2b1ea4,'request\x20sent',JSON[_0x5700('0x18')](_0x5653b4));if(_0x5653b4['error']){if(_0x5653b4[_0x5700('0x19')][_0x5700('0x1a')]===0x1f4){logger['error'](_0x5700('0x1b'),_0x2b1ea4,_0x5653b4['error'][_0x5700('0x1c')]);return _0x2f09a0(_0x5653b4[_0x5700('0x19')][_0x5700('0x1c')]);}logger[_0x5700('0x19')](_0x5700('0x1b'),_0x2b1ea4,_0x5653b4[_0x5700('0x19')][_0x5700('0x1c')]);return _0x2924e9(_0x5653b4['error'][_0x5700('0x1c')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x2b1ea4,_0x5700('0x15'));_0x2924e9(_0x5653b4[_0x5700('0x1d')][_0x5700('0x1c')]);}})['catch'](function(_0x3f6b1d){logger[_0x5700('0x19')](_0x5700('0x1b'),_0x2b1ea4,_0x3f6b1d);_0x2f09a0(_0x3f6b1d);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 375e06d..1cd5da3 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.socket.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f2f=['chatInternalMessage:','save','remove','update','emit','removeListener','length'];(function(_0x27443b,_0x263605){var _0x2e00c0=function(_0x5243d1){while(--_0x5243d1){_0x27443b['push'](_0x27443b['shift']());}};_0x2e00c0(++_0x263605);}(_0x9f2f,0x8d));var _0xf9f2=function(_0x168a17,_0x19e250){_0x168a17=_0x168a17-0x0;var _0x53229d=_0x9f2f[_0x168a17];return _0x53229d;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xf9f2('0x0'),_0xf9f2('0x1'),_0xf9f2('0x2')];function createListener(_0x242e89,_0x45d024){return function(_0x56c904){_0x45d024[_0xf9f2('0x3')](_0x242e89,_0x56c904);};}function removeListener(_0x5cad40,_0x3f11bd){return function(){ChatInternalMessageEvents[_0xf9f2('0x4')](_0x5cad40,_0x3f11bd);};}exports['register']=function(_0x5c8ae0){for(var _0x2dd0f5=0x0,_0x127c9f=events[_0xf9f2('0x5')];_0x2dd0f5<_0x127c9f;_0x2dd0f5++){var _0x3f3da2=events[_0x2dd0f5];var _0x2e556b=createListener(_0xf9f2('0x6')+_0x3f3da2,_0x5c8ae0);ChatInternalMessageEvents['on'](_0x3f3da2,_0x2e556b);}};
\ No newline at end of file
+var _0x0435=['save','remove','update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x339e28,_0x341e2c){var _0x1605dd=function(_0x3c6006){while(--_0x3c6006){_0x339e28['push'](_0x339e28['shift']());}};_0x1605dd(++_0x341e2c);}(_0x0435,0x6f));var _0x5043=function(_0x34ad46,_0x6fbd0c){_0x34ad46=_0x34ad46-0x0;var _0xbdd4ea=_0x0435[_0x34ad46];return _0xbdd4ea;};'use strict';var ChatInternalMessageEvents=require(_0x5043('0x0'));var events=[_0x5043('0x1'),_0x5043('0x2'),_0x5043('0x3')];function createListener(_0x4b54e4,_0xa68eed){return function(_0xfa3dbb){_0xa68eed[_0x5043('0x4')](_0x4b54e4,_0xfa3dbb);};}function removeListener(_0x2791b3,_0x313b2f){return function(){ChatInternalMessageEvents[_0x5043('0x5')](_0x2791b3,_0x313b2f);};}exports[_0x5043('0x6')]=function(_0xeaa8b0){for(var _0x397547=0x0,_0x2a9a4a=events['length'];_0x397547<_0x2a9a4a;_0x397547++){var _0x23ae7d=events[_0x397547];var _0x26dc89=createListener(_0x5043('0x7')+_0x23ae7d,_0xeaa8b0);ChatInternalMessageEvents['on'](_0x23ae7d,_0x26dc89);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index bb38f5e..d54e3fd 100644
--- a/server/api/chatInternalMessage/index.js
+++ b/server/api/chatInternalMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3bb=['getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users'];(function(_0x14bec3,_0x5acbb9){var _0x5e0f53=function(_0x57bcf0){while(--_0x57bcf0){_0x14bec3['push'](_0x14bec3['shift']());}};_0x5e0f53(++_0x5acbb9);}(_0xf3bb,0x129));var _0xbf3b=function(_0x3aff2d,_0xa1cd35){_0x3aff2d=_0x3aff2d-0x0;var _0x410121=_0xf3bb[_0x3aff2d];return _0x410121;};'use strict';var multer=require(_0xbf3b('0x0'));var util=require(_0xbf3b('0x1'));var path=require(_0xbf3b('0x2'));var timeout=require(_0xbf3b('0x3'));var express=require(_0xbf3b('0x4'));var router=express[_0xbf3b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbf3b('0x6'));var interaction=require(_0xbf3b('0x7'));var config=require(_0xbf3b('0x8'));var controller=require(_0xbf3b('0x9'));router[_0xbf3b('0xa')]('/',auth[_0xbf3b('0xb')](),controller[_0xbf3b('0xc')]);router[_0xbf3b('0xa')](_0xbf3b('0xd'),auth[_0xbf3b('0xb')](),controller['describe']);router[_0xbf3b('0xa')](_0xbf3b('0xe'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0xf')]);router['get'](_0xbf3b('0x10'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0x11')]);router[_0xbf3b('0x12')]('/',auth[_0xbf3b('0xb')](),controller[_0xbf3b('0x13')]);router[_0xbf3b('0x14')](_0xbf3b('0x10'),controller[_0xbf3b('0x15')]);router['delete'](_0xbf3b('0x10'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0x16')]);module[_0xbf3b('0x17')]=router;
\ No newline at end of file
+var _0x405f=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/users','getUsers','/:id','post','create','put','delete'];(function(_0xa4cfa2,_0x4fb42d){var _0x4c2f6c=function(_0x5515bf){while(--_0x5515bf){_0xa4cfa2['push'](_0xa4cfa2['shift']());}};_0x4c2f6c(++_0x4fb42d);}(_0x405f,0x127));var _0xf405=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x405f[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require('multer');var util=require(_0xf405('0x0'));var path=require(_0xf405('0x1'));var timeout=require(_0xf405('0x2'));var express=require(_0xf405('0x3'));var router=express[_0xf405('0x4')]();var fs_extra=require(_0xf405('0x5'));var auth=require(_0xf405('0x6'));var interaction=require(_0xf405('0x7'));var config=require(_0xf405('0x8'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0xf405('0x9')](),controller[_0xf405('0xa')]);router[_0xf405('0xb')](_0xf405('0xc'),auth[_0xf405('0x9')](),controller['describe']);router[_0xf405('0xb')](_0xf405('0xd'),auth[_0xf405('0x9')](),controller[_0xf405('0xe')]);router[_0xf405('0xb')](_0xf405('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xf405('0x10')]('/',auth[_0xf405('0x9')](),controller[_0xf405('0x11')]);router[_0xf405('0x12')](_0xf405('0xf'),controller['update']);router[_0xf405('0x13')](_0xf405('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xf405('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 63d7f0f..1662cd9 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1d21=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x1d21,0x158));var _0x11d2=function(_0x57f345,_0x316929){_0x57f345=_0x57f345-0x0;var _0x255e43=_0x1d21[_0x57f345];return _0x255e43;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'body':{'type':Sequelize[_0x11d2('0x2')](_0x11d2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x11d2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11d2('0x5')]('in',_0x11d2('0x6')),'defaultValue':_0x11d2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x11d2('0x7')]},'providerResponse':{'type':Sequelize[_0x11d2('0x2')]}};
\ No newline at end of file
+var _0x3870=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x4bc2ba,_0x537506){var _0xae9c9b=function(_0x1e5bdd){while(--_0x1e5bdd){_0x4bc2ba['push'](_0x4bc2ba['shift']());}};_0xae9c9b(++_0x537506);}(_0x3870,0x146));var _0x0387=function(_0x260114,_0x25294d){_0x260114=_0x260114-0x0;var _0x19da40=_0x3870[_0x260114];return _0x19da40;};'use strict';var Sequelize=require(_0x0387('0x0'));module[_0x0387('0x1')]={'body':{'type':Sequelize[_0x0387('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0387('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0387('0x4')]('in',_0x0387('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x0387('0x6')]},'providerName':{'type':Sequelize[_0x0387('0x7')]},'providerResponse':{'type':Sequelize[_0x0387('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index b7bd341..9406d42 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3333=['message','result','catch','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','show','keys','include','options','find','body','update','params','describe','chat-interactions','accept','chat','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','ChatInteraction','read1stAt','format','get','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','interaction','reject','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','User','interface','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4f72d2,_0x1bbac4){var _0x5709af=function(_0x16d769){while(--_0x16d769){_0x4f72d2['push'](_0x4f72d2['shift']());}};_0x5709af(++_0x1bbac4);}(_0x3333,0x1dd));var _0x3333=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x3333[_0x43b08];return _0x5e05f4;};'use strict';var emlformat=require(_0x3333('0x0'));var rimraf=require(_0x3333('0x1'));var zipdir=require(_0x3333('0x2'));var jsonpatch=require(_0x3333('0x3'));var rp=require(_0x3333('0x4'));var moment=require('moment');var BPromise=require(_0x3333('0x5'));var Mustache=require(_0x3333('0x6'));var util=require(_0x3333('0x7'));var path=require(_0x3333('0x8'));var sox=require(_0x3333('0x9'));var csv=require('to-csv');var ejs=require(_0x3333('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3333('0xb'));var squel=require(_0x3333('0xc'));var crypto=require('crypto');var jsforce=require(_0x3333('0xd'));var deskjs=require(_0x3333('0xe'));var toCsv=require(_0x3333('0xf'));var querystring=require(_0x3333('0x10'));var Papa=require(_0x3333('0x11'));var Redis=require(_0x3333('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3333('0x13'));var as=require(_0x3333('0x14'));var hardwareService=require(_0x3333('0x15'));var logger=require(_0x3333('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x3333('0x17'));var licenseUtil=require(_0x3333('0x18'));var db=require(_0x3333('0x19'))['db'];config[_0x3333('0x1a')]=_[_0x3333('0x1b')](config[_0x3333('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3333('0x1a')]));require(_0x3333('0x1c'))[_0x3333('0x1d')](socket);var jayson=require(_0x3333('0x1e'));var client=jayson[_0x3333('0x1f')][_0x3333('0x20')]({'port':0x232c});var client9002=jayson[_0x3333('0x1f')][_0x3333('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x49aa4e,_0x5df09d,_0x2dfca7,_0x38f50e){return new BPromise(function(_0x17d388,_0x1b8156){var _0x35e47c=_0x38f50e||client;return _0x35e47c[_0x3333('0x21')](_0x49aa4e,_0x2dfca7)[_0x3333('0x22')](function(_0x381a5f){logger[_0x3333('0x23')](_0x3333('0x24'),_0x5df09d,'request\x20sent');logger[_0x3333('0x25')](_0x3333('0x26'),_0x5df09d,_0x3333('0x27'),JSON[_0x3333('0x28')](_0x381a5f));if(_0x381a5f[_0x3333('0x29')]){if(_0x381a5f[_0x3333('0x29')][_0x3333('0x2a')]===0x1f4){logger['error'](_0x3333('0x24'),_0x5df09d,_0x381a5f[_0x3333('0x29')]['message']);return _0x1b8156(_0x381a5f[_0x3333('0x29')][_0x3333('0x2b')]);}logger['error'](_0x3333('0x24'),_0x5df09d,_0x381a5f[_0x3333('0x29')][_0x3333('0x2b')]);return _0x17d388(_0x381a5f[_0x3333('0x29')][_0x3333('0x2b')]);}else{logger[_0x3333('0x23')](_0x3333('0x24'),_0x5df09d,_0x3333('0x27'));_0x17d388(_0x381a5f[_0x3333('0x2c')][_0x3333('0x2b')]);}})[_0x3333('0x2d')](function(_0x20f743){logger['error'](_0x3333('0x24'),_0x5df09d,_0x20f743);_0x1b8156(_0x20f743);});});}function respondWithStatusCode(_0x11595f,_0x36885b){_0x36885b=_0x36885b||0xcc;return function(_0x4a1dcf){if(_0x4a1dcf){return _0x11595f[_0x3333('0x2e')](_0x36885b);}return _0x11595f[_0x3333('0x2f')](_0x36885b)['end']();};}function respondWithResult(_0x5e5fde,_0x3f2695){_0x3f2695=_0x3f2695||0xc8;return function(_0x576c3c){if(_0x576c3c){return _0x5e5fde[_0x3333('0x2f')](_0x3f2695)[_0x3333('0x30')](_0x576c3c);}};}function respondWithFilteredResult(_0xd2c3a1,_0x1658d9){return function(_0x1360e3){if(_0x1360e3){var _0x24d3be=typeof _0x1658d9[_0x3333('0x31')]==='undefined'&&typeof _0x1658d9[_0x3333('0x32')]==='undefined';var _0x2fd94d=_0x1360e3[_0x3333('0x33')];var _0x59547b=_0x24d3be?0x0:_0x1658d9[_0x3333('0x31')];var _0x105648=_0x24d3be?_0x1360e3[_0x3333('0x33')]:_0x1658d9['offset']+_0x1658d9[_0x3333('0x32')];var _0x181bcb;if(_0x105648>=_0x2fd94d){_0x105648=_0x2fd94d;_0x181bcb=0xc8;}else{_0x181bcb=0xce;}_0xd2c3a1[_0x3333('0x2f')](_0x181bcb);return _0xd2c3a1[_0x3333('0x34')](_0x3333('0x35'),_0x59547b+'-'+_0x105648+'/'+_0x2fd94d)[_0x3333('0x30')](_0x1360e3);}return null;};}function patchUpdates(_0x5440d8){return function(_0x4ccbd4){try{jsonpatch[_0x3333('0x36')](_0x4ccbd4,_0x5440d8,!![]);}catch(_0x40200c){return BPromise['reject'](_0x40200c);}return _0x4ccbd4[_0x3333('0x37')]();};}function saveUpdates(_0x7e1dd5,_0x3f58df){return function(_0x530f2b){if(_0x530f2b){return _0x530f2b['update'](_0x7e1dd5)[_0x3333('0x22')](function(_0x2258e7){return _0x2258e7;});}return null;};}function removeEntity(_0x4f7554,_0x315991){return function(_0x38fc50){if(_0x38fc50){return _0x38fc50[_0x3333('0x38')]()[_0x3333('0x22')](function(){_0x4f7554[_0x3333('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4158d5,_0x801bef){return function(_0x2d6617){if(!_0x2d6617){_0x4158d5[_0x3333('0x2e')](0x194);}return _0x2d6617;};}function handleError(_0x522846,_0x2f062e){_0x2f062e=_0x2f062e||0x1f4;return function(_0x492048){logger['error'](_0x492048[_0x3333('0x39')]);if(_0x492048[_0x3333('0x3a')]){delete _0x492048['name'];}_0x522846[_0x3333('0x2f')](_0x2f062e)[_0x3333('0x3b')](_0x492048);};}exports[_0x3333('0x3c')]=function(_0x55d850,_0x4893a4){var _0x564c3f={},_0x3c22e1={},_0x1e75e5={'count':0x0,'rows':[]};var _0x4326f6=_[_0x3333('0x3d')](db[_0x3333('0x3e')][_0x3333('0x3f')],function(_0x34ea14){return{'name':_0x34ea14['fieldName'],'type':_0x34ea14['type'][_0x3333('0x40')]};});_0x3c22e1['model']=_['map'](_0x4326f6,_0x3333('0x3a'));_0x3c22e1[_0x3333('0x41')]=_['keys'](_0x55d850[_0x3333('0x41')]);_0x3c22e1[_0x3333('0x42')]=_[_0x3333('0x43')](_0x3c22e1[_0x3333('0x44')],_0x3c22e1[_0x3333('0x41')]);_0x564c3f[_0x3333('0x45')]=_['intersection'](_0x3c22e1[_0x3333('0x44')],qs[_0x3333('0x46')](_0x55d850[_0x3333('0x41')]['fields']));_0x564c3f[_0x3333('0x45')]=_0x564c3f[_0x3333('0x45')][_0x3333('0x47')]?_0x564c3f['attributes']:_0x3c22e1[_0x3333('0x44')];if(!_0x55d850[_0x3333('0x41')][_0x3333('0x48')]('nolimit')){_0x564c3f[_0x3333('0x32')]=qs[_0x3333('0x32')](_0x55d850[_0x3333('0x41')]['limit']);_0x564c3f[_0x3333('0x31')]=qs[_0x3333('0x31')](_0x55d850[_0x3333('0x41')][_0x3333('0x31')]);}_0x564c3f['order']=qs[_0x3333('0x49')](_0x55d850[_0x3333('0x41')]['sort']);_0x564c3f[_0x3333('0x4a')]=qs[_0x3333('0x42')](_[_0x3333('0x4b')](_0x55d850[_0x3333('0x41')],_0x3c22e1[_0x3333('0x42')]),_0x4326f6);if(_0x55d850[_0x3333('0x41')][_0x3333('0x4c')]){_0x564c3f[_0x3333('0x4a')]=_[_0x3333('0x4d')](_0x564c3f[_0x3333('0x4a')],{'$or':_[_0x3333('0x3d')](_0x4326f6,function(_0x2f92bf){if(_0x2f92bf[_0x3333('0x4e')]!==_0x3333('0x4f')){var _0x336954={};_0x336954[_0x2f92bf[_0x3333('0x3a')]]={'$like':'%'+_0x55d850[_0x3333('0x41')][_0x3333('0x4c')]+'%'};return _0x336954;}})});}_0x564c3f=_['merge']({},_0x564c3f,_0x55d850['options']);var _0x2af8d8={'where':_0x564c3f[_0x3333('0x4a')]};return db[_0x3333('0x3e')][_0x3333('0x33')](_0x2af8d8)['then'](function(_0x3d2199){_0x1e75e5[_0x3333('0x33')]=_0x3d2199;if(_0x55d850[_0x3333('0x41')][_0x3333('0x50')]){_0x564c3f['include']=[{'all':!![]}];}return db[_0x3333('0x3e')]['findAll'](_0x564c3f);})[_0x3333('0x22')](function(_0x36e41c){_0x1e75e5['rows']=_0x36e41c;return _0x1e75e5;})[_0x3333('0x22')](respondWithFilteredResult(_0x4893a4,_0x564c3f))['catch'](handleError(_0x4893a4,null));};exports[_0x3333('0x51')]=function(_0x171ea,_0x26c2f2){var _0x3c54e9={'raw':!![],'where':{'id':_0x171ea['params']['id']}},_0x373a89={};_0x373a89[_0x3333('0x44')]=_[_0x3333('0x52')](db[_0x3333('0x3e')]['rawAttributes']);_0x373a89[_0x3333('0x41')]=_[_0x3333('0x52')](_0x171ea['query']);_0x373a89[_0x3333('0x42')]=_[_0x3333('0x43')](_0x373a89[_0x3333('0x44')],_0x373a89[_0x3333('0x41')]);_0x3c54e9[_0x3333('0x45')]=_[_0x3333('0x43')](_0x373a89['model'],qs['fields'](_0x171ea[_0x3333('0x41')][_0x3333('0x46')]));_0x3c54e9[_0x3333('0x45')]=_0x3c54e9[_0x3333('0x45')]['length']?_0x3c54e9[_0x3333('0x45')]:_0x373a89['model'];if(_0x171ea['query'][_0x3333('0x50')]){_0x3c54e9[_0x3333('0x53')]=[{'all':!![]}];}_0x3c54e9=_[_0x3333('0x4d')]({},_0x3c54e9,_0x171ea[_0x3333('0x54')]);return db[_0x3333('0x3e')][_0x3333('0x55')](_0x3c54e9)['then'](handleEntityNotFound(_0x26c2f2,null))['then'](respondWithResult(_0x26c2f2,null))[_0x3333('0x2d')](handleError(_0x26c2f2,null));};exports['create']=function(_0x3eb1e5,_0x5cb77b){return db[_0x3333('0x3e')]['create'](_0x3eb1e5[_0x3333('0x56')],{})[_0x3333('0x22')](respondWithResult(_0x5cb77b,0xc9))[_0x3333('0x2d')](handleError(_0x5cb77b,null));};exports[_0x3333('0x57')]=function(_0x687e4e,_0x20ea46){if(_0x687e4e[_0x3333('0x56')]['id']){delete _0x687e4e[_0x3333('0x56')]['id'];}return db[_0x3333('0x3e')][_0x3333('0x55')]({'where':{'id':_0x687e4e['params']['id']}})[_0x3333('0x22')](handleEntityNotFound(_0x20ea46,null))[_0x3333('0x22')](saveUpdates(_0x687e4e[_0x3333('0x56')],null))['then'](respondWithResult(_0x20ea46,null))[_0x3333('0x2d')](handleError(_0x20ea46,null));};exports[_0x3333('0x38')]=function(_0x461062,_0xaca69f){return db[_0x3333('0x3e')][_0x3333('0x55')]({'where':{'id':_0x461062[_0x3333('0x58')]['id']}})[_0x3333('0x22')](handleEntityNotFound(_0xaca69f,null))[_0x3333('0x22')](removeEntity(_0xaca69f,null))[_0x3333('0x2d')](handleError(_0xaca69f,null));};exports[_0x3333('0x59')]=function(_0x599234,_0x5024b0){return db[_0x3333('0x3e')][_0x3333('0x59')]()['then'](respondWithResult(_0x5024b0,null))[_0x3333('0x2d')](handleError(_0x5024b0,null));};var interaction_log=require(_0x3333('0x16'))(_0x3333('0x5a'));exports[_0x3333('0x5b')]=function(_0x44194d,_0x4cbb2d,_0x5b3540){var _0x14be2c={'agent':{},'channel':_0x3333('0x5c')};if(_0x44194d['body']['id']){delete _0x44194d[_0x3333('0x56')]['id'];}_0x44194d[_0x3333('0x56')]['read']=!![];_0x44194d[_0x3333('0x56')]['readAt']=moment()['format'](_0x3333('0x5d'));_0x44194d[_0x3333('0x56')]['UserId']=_0x44194d[_0x3333('0x56')]['UserId']||_0x44194d[_0x3333('0x5e')]['id'];_0x14be2c[_0x3333('0x5f')]['id']=_0x44194d['body'][_0x3333('0x60')];return db[_0x3333('0x3e')]['find']({'where':{'id':_0x44194d['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cbb2d,null))[_0x3333('0x22')](saveUpdates(_0x44194d[_0x3333('0x56')],null))[_0x3333('0x22')](function(_0x151084){if(_0x151084){_0x14be2c[_0x3333('0x2b')]=_0x151084['get']({'plain':!![]});return db[_0x3333('0x61')][_0x3333('0x55')]({'where':{'id':_0x151084['ChatInteractionId']}});}return null;})[_0x3333('0x22')](handleEntityNotFound(_0x4cbb2d,null))[_0x3333('0x22')](function(_0x297667){if(_0x297667){return _0x297667['update']({'UserId':_0x44194d[_0x3333('0x56')][_0x3333('0x60')],'read1stAt':_['isNil'](_0x297667[_0x3333('0x62')])?moment()[_0x3333('0x63')](_0x3333('0x5d')):undefined});}return null;})[_0x3333('0x22')](function(_0x38d39b){if(_0x38d39b){_0x14be2c['interaction']=_0x38d39b[_0x3333('0x64')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x44194d[_0x3333('0x5e')]['id'],_0x44194d[_0x3333('0x5e')][_0x3333('0x3a')],_0x44194d[_0x3333('0x5e')][_0x3333('0x65')],_0x14be2c['interaction']['id'],_0x44194d[_0x3333('0x56')]?JSON[_0x3333('0x28')](_0x44194d[_0x3333('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3333('0x66'),_0x14be2c);}return null;})[_0x3333('0x22')](function(_0x29d465){var _0xf7df9c=_0x3333('0x67')+_0x29d465[_0x3333('0x2b')]['ContactId'];return db[_0x3333('0x68')][_0x3333('0x41')](_0xf7df9c,{'type':db[_0x3333('0x69')][_0x3333('0x6a')][_0x3333('0x6b')],'raw':!![]})[_0x3333('0x22')](function(_0x320a16){return _0x320a16;});})[_0x3333('0x22')](function(_0x13def5){if(_0x13def5){_0x14be2c[_0x3333('0x2b')][_0x3333('0x6c')]=_0x13def5[0x0];if(!_0x44194d[_0x3333('0x56')][_0x3333('0x60')])return;return db['User'][_0x3333('0x55')]({'where':{'id':_0x44194d[_0x3333('0x56')][_0x3333('0x60')],'role':_0x3333('0x5f')},'attributes':['id',_0x3333('0x3a'),_0x3333('0x6d'),_0x3333('0x6e'),_0x3333('0x6f')],'raw':!![]});}return null;})[_0x3333('0x22')](function(_0x9ef74f){if(!_0x9ef74f)return null;_0x14be2c['message'][_0x3333('0x5f')]=_0x9ef74f;return _0x14be2c;})[_0x3333('0x22')](function(_0x1d2775){if(_0x1d2775){if(_0x44194d[_0x3333('0x56')][_0x3333('0x70')]){_0x14be2c[_0x3333('0x2b')]['interface']=util['format'](_0x3333('0x71'),_0x44194d[_0x3333('0x5e')][_0x3333('0x3a')]);_0x14be2c[_0x3333('0x2b')][_0x3333('0x72')]=_0x14be2c[_0x3333('0x72')];_0x14be2c[_0x3333('0x2b')]['motionChannel']=_0x14be2c[_0x3333('0x72')];_0x14be2c['message'][_0x3333('0x73')]=_0x3333('0x5b');return respondWithRpcPromise(_0x3333('0x74'),_0x3333('0x74'),{'event':_0x3333('0x75'),'message':_['merge'](_0x14be2c[_0x3333('0x2b')],JSON[_0x3333('0x76')](_0x14be2c[_0x3333('0x77')]['formData']))},client9002)[_0x3333('0x22')](function(){return _0x14be2c;});}return _0x14be2c;}return null;})[_0x3333('0x22')](respondWithResult(_0x4cbb2d,null))[_0x3333('0x2d')](handleError(_0x4cbb2d,null));};var interaction_log=require(_0x3333('0x16'))('chat-interactions');exports[_0x3333('0x78')]=function(_0x9034be,_0x3346fd,_0x4ad004){var _0x3c8b3a={'agent':{},'channel':_0x3333('0x5c')};if(_0x9034be[_0x3333('0x56')]['id']){delete _0x9034be['body']['id'];}_0x9034be[_0x3333('0x56')][_0x3333('0x60')]=_0x9034be[_0x3333('0x56')][_0x3333('0x60')]||_0x9034be[_0x3333('0x5e')]['id'];_0x3c8b3a[_0x3333('0x5f')]['id']=_0x9034be[_0x3333('0x56')][_0x3333('0x60')];return db['ChatMessage'][_0x3333('0x55')]({'where':{'id':_0x9034be[_0x3333('0x58')]['id'],'UserId':null}})[_0x3333('0x22')](handleEntityNotFound(_0x3346fd,null))[_0x3333('0x22')](function(_0x3d3ae0){if(_0x3d3ae0){_0x3c8b3a[_0x3333('0x2b')]=_0x3d3ae0['get']({'plain':!![]});return db[_0x3333('0x61')][_0x3333('0x55')]({'where':{'id':_0x3d3ae0[_0x3333('0x79')]}});}return null;})[_0x3333('0x22')](handleEntityNotFound(_0x3346fd,null))['then'](function(_0x1dec05){if(_0x1dec05){_0x3c8b3a[_0x3333('0x77')]=_0x1dec05['get']({'plain':!![]});interaction_log[_0x3333('0x23')](_0x3333('0x7a'),_0x9034be[_0x3333('0x5e')]['id'],_0x9034be['user'][_0x3333('0x3a')],_0x9034be['user'][_0x3333('0x65')],_0x3c8b3a['interaction']['id'],_0x9034be[_0x3333('0x56')]?JSON[_0x3333('0x28')](_0x9034be[_0x3333('0x56')]):_0x3333('0x7b'));return respondWithRpcPromise(_0x3333('0x7c'),_0x3333('0x7d'),_0x3c8b3a);}return null;})['then'](function(_0x493b61){var _0x1bf187=_0x3333('0x67')+_0x493b61[_0x3333('0x2b')]['ContactId'];return db[_0x3333('0x68')]['query'](_0x1bf187,{'type':db[_0x3333('0x69')][_0x3333('0x6a')][_0x3333('0x6b')],'raw':!![]})[_0x3333('0x22')](function(_0x2a85e0){return _0x2a85e0;});})['then'](function(_0x39625d){if(_0x39625d){_0x3c8b3a['message'][_0x3333('0x6c')]=_0x39625d[0x0];if(!_0x9034be[_0x3333('0x56')][_0x3333('0x60')])return;return db[_0x3333('0x7e')][_0x3333('0x55')]({'where':{'id':_0x9034be[_0x3333('0x56')][_0x3333('0x60')],'role':_0x3333('0x5f')},'attributes':['id',_0x3333('0x3a'),_0x3333('0x6d'),_0x3333('0x6e'),'internal'],'raw':!![]});}return null;})[_0x3333('0x22')](function(_0x24325c){if(!_0x24325c)return null;_0x3c8b3a[_0x3333('0x2b')][_0x3333('0x5f')]=_0x24325c;return _0x3c8b3a;})[_0x3333('0x22')](function(_0x13c752){if(_0x13c752){_0x13c752[_0x3333('0x2b')][_0x3333('0x7f')]=util[_0x3333('0x63')]('SIP/%s',_0x9034be[_0x3333('0x5e')][_0x3333('0x3a')]);_0x13c752[_0x3333('0x2b')][_0x3333('0x72')]=_0x3c8b3a[_0x3333('0x72')];_0x13c752[_0x3333('0x2b')][_0x3333('0x80')]=_0x3c8b3a[_0x3333('0x72')];_0x13c752['message']['event']=_0x3333('0x78');respondWithRpcPromise(_0x3333('0x74'),'EventManager',{'event':_0x3333('0x81'),'message':_[_0x3333('0x4d')](_0x3c8b3a[_0x3333('0x2b')],JSON[_0x3333('0x76')](_0x3c8b3a[_0x3333('0x77')]['formData']))},client9002);return _0x3c8b3a;}return null;})[_0x3333('0x22')](respondWithResult(_0x3346fd,null))[_0x3333('0x2d')](handleError(_0x3346fd,null));};
\ No newline at end of file
+var _0x0c6e=['../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','ChatMessage','includeAll','include','rows','find','create','body','params','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','format','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5c62bb,_0x4bbd42){var _0x5e9ac1=function(_0x32bf15){while(--_0x32bf15){_0x5c62bb['push'](_0x5c62bb['shift']());}};_0x5e9ac1(++_0x4bbd42);}(_0x0c6e,0x6f));var _0xe0c6=function(_0x421bc6,_0x4f57c3){_0x421bc6=_0x421bc6-0x0;var _0x178c24=_0x0c6e[_0x421bc6];return _0x178c24;};'use strict';var emlformat=require(_0xe0c6('0x0'));var rimraf=require(_0xe0c6('0x1'));var zipdir=require(_0xe0c6('0x2'));var jsonpatch=require(_0xe0c6('0x3'));var rp=require('request-promise');var moment=require(_0xe0c6('0x4'));var BPromise=require(_0xe0c6('0x5'));var Mustache=require('mustache');var util=require(_0xe0c6('0x6'));var path=require(_0xe0c6('0x7'));var sox=require('sox');var csv=require(_0xe0c6('0x8'));var ejs=require(_0xe0c6('0x9'));var fs=require('fs');var fs_extra=require(_0xe0c6('0xa'));var _=require(_0xe0c6('0xb'));var squel=require(_0xe0c6('0xc'));var crypto=require(_0xe0c6('0xd'));var jsforce=require(_0xe0c6('0xe'));var deskjs=require(_0xe0c6('0xf'));var toCsv=require(_0xe0c6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe0c6('0x10'));var authService=require(_0xe0c6('0x11'));var qs=require(_0xe0c6('0x12'));var as=require(_0xe0c6('0x13'));var hardwareService=require(_0xe0c6('0x14'));var logger=require(_0xe0c6('0x15'))(_0xe0c6('0x16'));var utils=require(_0xe0c6('0x17'));var config=require(_0xe0c6('0x18'));var licenseUtil=require(_0xe0c6('0x19'));var db=require(_0xe0c6('0x1a'))['db'];config['redis']=_['defaults'](config[_0xe0c6('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0c6('0x1c'))(new Redis(config[_0xe0c6('0x1b')]));require('./chatMessage.socket')[_0xe0c6('0x1d')](socket);var jayson=require(_0xe0c6('0x1e'));var client=jayson[_0xe0c6('0x1f')][_0xe0c6('0x20')]({'port':0x232c});var client9002=jayson[_0xe0c6('0x1f')][_0xe0c6('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xe5bd93,_0x1efa94,_0x5babb2,_0x325239){return new BPromise(function(_0x26a5c3,_0x3684de){var _0x39e221=_0x325239||client;return _0x39e221[_0xe0c6('0x21')](_0xe5bd93,_0x5babb2)[_0xe0c6('0x22')](function(_0x541995){logger[_0xe0c6('0x23')]('ChatMessage,\x20%s,\x20%s',_0x1efa94,_0xe0c6('0x24'));logger[_0xe0c6('0x25')](_0xe0c6('0x26'),_0x1efa94,_0xe0c6('0x24'),JSON['stringify'](_0x541995));if(_0x541995[_0xe0c6('0x27')]){if(_0x541995[_0xe0c6('0x27')][_0xe0c6('0x28')]===0x1f4){logger[_0xe0c6('0x27')](_0xe0c6('0x29'),_0x1efa94,_0x541995[_0xe0c6('0x27')][_0xe0c6('0x2a')]);return _0x3684de(_0x541995['error'][_0xe0c6('0x2a')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x1efa94,_0x541995['error'][_0xe0c6('0x2a')]);return _0x26a5c3(_0x541995[_0xe0c6('0x27')][_0xe0c6('0x2a')]);}else{logger[_0xe0c6('0x23')](_0xe0c6('0x29'),_0x1efa94,_0xe0c6('0x24'));_0x26a5c3(_0x541995[_0xe0c6('0x2b')][_0xe0c6('0x2a')]);}})[_0xe0c6('0x2c')](function(_0x5939fe){logger[_0xe0c6('0x27')](_0xe0c6('0x29'),_0x1efa94,_0x5939fe);_0x3684de(_0x5939fe);});});}function respondWithStatusCode(_0x98adf0,_0xc206b){_0xc206b=_0xc206b||0xcc;return function(_0x409a38){if(_0x409a38){return _0x98adf0[_0xe0c6('0x2d')](_0xc206b);}return _0x98adf0[_0xe0c6('0x2e')](_0xc206b)[_0xe0c6('0x2f')]();};}function respondWithResult(_0x140c9d,_0x45ad48){_0x45ad48=_0x45ad48||0xc8;return function(_0x3dc01f){if(_0x3dc01f){return _0x140c9d[_0xe0c6('0x2e')](_0x45ad48)['json'](_0x3dc01f);}};}function respondWithFilteredResult(_0x5005d1,_0x56bfd5){return function(_0xe2f549){if(_0xe2f549){var _0x2ad4f6=typeof _0x56bfd5[_0xe0c6('0x30')]===_0xe0c6('0x31')&&typeof _0x56bfd5[_0xe0c6('0x32')]===_0xe0c6('0x31');var _0x89a764=_0xe2f549[_0xe0c6('0x33')];var _0x426b1d=_0x2ad4f6?0x0:_0x56bfd5[_0xe0c6('0x30')];var _0x507cbe=_0x2ad4f6?_0xe2f549[_0xe0c6('0x33')]:_0x56bfd5[_0xe0c6('0x30')]+_0x56bfd5[_0xe0c6('0x32')];var _0xa6592d;if(_0x507cbe>=_0x89a764){_0x507cbe=_0x89a764;_0xa6592d=0xc8;}else{_0xa6592d=0xce;}_0x5005d1[_0xe0c6('0x2e')](_0xa6592d);return _0x5005d1[_0xe0c6('0x34')](_0xe0c6('0x35'),_0x426b1d+'-'+_0x507cbe+'/'+_0x89a764)[_0xe0c6('0x36')](_0xe2f549);}return null;};}function patchUpdates(_0x503c4d){return function(_0x37d409){try{jsonpatch[_0xe0c6('0x37')](_0x37d409,_0x503c4d,!![]);}catch(_0x34fb4a){return BPromise[_0xe0c6('0x38')](_0x34fb4a);}return _0x37d409[_0xe0c6('0x39')]();};}function saveUpdates(_0x663c81,_0x2bac13){return function(_0x4930e2){if(_0x4930e2){return _0x4930e2[_0xe0c6('0x3a')](_0x663c81)['then'](function(_0x1bd821){return _0x1bd821;});}return null;};}function removeEntity(_0x2db537,_0x5ca01a){return function(_0x5d240f){if(_0x5d240f){return _0x5d240f[_0xe0c6('0x3b')]()[_0xe0c6('0x22')](function(){_0x2db537[_0xe0c6('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x255d54,_0x4c6969){return function(_0x4d492e){if(!_0x4d492e){_0x255d54['sendStatus'](0x194);}return _0x4d492e;};}function handleError(_0x4311ec,_0x43e36a){_0x43e36a=_0x43e36a||0x1f4;return function(_0xc91c32){logger[_0xe0c6('0x27')](_0xc91c32[_0xe0c6('0x3c')]);if(_0xc91c32['name']){delete _0xc91c32[_0xe0c6('0x3d')];}_0x4311ec[_0xe0c6('0x2e')](_0x43e36a)[_0xe0c6('0x3e')](_0xc91c32);};}exports[_0xe0c6('0x3f')]=function(_0x149738,_0x5569b8){var _0x8972de={},_0x244c33={},_0x574ac8={'count':0x0,'rows':[]};var _0x169797=_[_0xe0c6('0x40')](db['ChatMessage'][_0xe0c6('0x41')],function(_0x16b84a){return{'name':_0x16b84a[_0xe0c6('0x42')],'type':_0x16b84a['type']['key']};});_0x244c33[_0xe0c6('0x43')]=_['map'](_0x169797,'name');_0x244c33[_0xe0c6('0x44')]=_[_0xe0c6('0x45')](_0x149738[_0xe0c6('0x44')]);_0x244c33[_0xe0c6('0x46')]=_['intersection'](_0x244c33[_0xe0c6('0x43')],_0x244c33[_0xe0c6('0x44')]);_0x8972de[_0xe0c6('0x47')]=_[_0xe0c6('0x48')](_0x244c33[_0xe0c6('0x43')],qs[_0xe0c6('0x49')](_0x149738[_0xe0c6('0x44')]['fields']));_0x8972de['attributes']=_0x8972de['attributes'][_0xe0c6('0x4a')]?_0x8972de['attributes']:_0x244c33[_0xe0c6('0x43')];if(!_0x149738[_0xe0c6('0x44')][_0xe0c6('0x4b')]('nolimit')){_0x8972de[_0xe0c6('0x32')]=qs[_0xe0c6('0x32')](_0x149738[_0xe0c6('0x44')][_0xe0c6('0x32')]);_0x8972de['offset']=qs[_0xe0c6('0x30')](_0x149738[_0xe0c6('0x44')][_0xe0c6('0x30')]);}_0x8972de[_0xe0c6('0x4c')]=qs[_0xe0c6('0x4d')](_0x149738['query'][_0xe0c6('0x4d')]);_0x8972de[_0xe0c6('0x4e')]=qs[_0xe0c6('0x46')](_['pick'](_0x149738[_0xe0c6('0x44')],_0x244c33[_0xe0c6('0x46')]),_0x169797);if(_0x149738[_0xe0c6('0x44')][_0xe0c6('0x4f')]){_0x8972de['where']=_['merge'](_0x8972de[_0xe0c6('0x4e')],{'$or':_[_0xe0c6('0x40')](_0x169797,function(_0x4eb6b1){if(_0x4eb6b1['type']!==_0xe0c6('0x50')){var _0x3715e7={};_0x3715e7[_0x4eb6b1[_0xe0c6('0x3d')]]={'$like':'%'+_0x149738[_0xe0c6('0x44')][_0xe0c6('0x4f')]+'%'};return _0x3715e7;}})});}_0x8972de=_[_0xe0c6('0x51')]({},_0x8972de,_0x149738[_0xe0c6('0x52')]);var _0x31071b={'where':_0x8972de[_0xe0c6('0x4e')]};return db[_0xe0c6('0x53')][_0xe0c6('0x33')](_0x31071b)[_0xe0c6('0x22')](function(_0x319aa2){_0x574ac8[_0xe0c6('0x33')]=_0x319aa2;if(_0x149738[_0xe0c6('0x44')][_0xe0c6('0x54')]){_0x8972de[_0xe0c6('0x55')]=[{'all':!![]}];}return db[_0xe0c6('0x53')]['findAll'](_0x8972de);})[_0xe0c6('0x22')](function(_0x25f1e3){_0x574ac8[_0xe0c6('0x56')]=_0x25f1e3;return _0x574ac8;})[_0xe0c6('0x22')](respondWithFilteredResult(_0x5569b8,_0x8972de))['catch'](handleError(_0x5569b8,null));};exports['show']=function(_0x3b2e7b,_0xcc16d5){var _0x2b7e4c={'raw':!![],'where':{'id':_0x3b2e7b['params']['id']}},_0x42bf6f={};_0x42bf6f[_0xe0c6('0x43')]=_['keys'](db[_0xe0c6('0x53')]['rawAttributes']);_0x42bf6f[_0xe0c6('0x44')]=_[_0xe0c6('0x45')](_0x3b2e7b[_0xe0c6('0x44')]);_0x42bf6f[_0xe0c6('0x46')]=_[_0xe0c6('0x48')](_0x42bf6f[_0xe0c6('0x43')],_0x42bf6f[_0xe0c6('0x44')]);_0x2b7e4c[_0xe0c6('0x47')]=_[_0xe0c6('0x48')](_0x42bf6f[_0xe0c6('0x43')],qs['fields'](_0x3b2e7b[_0xe0c6('0x44')]['fields']));_0x2b7e4c[_0xe0c6('0x47')]=_0x2b7e4c[_0xe0c6('0x47')][_0xe0c6('0x4a')]?_0x2b7e4c[_0xe0c6('0x47')]:_0x42bf6f[_0xe0c6('0x43')];if(_0x3b2e7b[_0xe0c6('0x44')][_0xe0c6('0x54')]){_0x2b7e4c[_0xe0c6('0x55')]=[{'all':!![]}];}_0x2b7e4c=_[_0xe0c6('0x51')]({},_0x2b7e4c,_0x3b2e7b[_0xe0c6('0x52')]);return db[_0xe0c6('0x53')][_0xe0c6('0x57')](_0x2b7e4c)[_0xe0c6('0x22')](handleEntityNotFound(_0xcc16d5,null))[_0xe0c6('0x22')](respondWithResult(_0xcc16d5,null))[_0xe0c6('0x2c')](handleError(_0xcc16d5,null));};exports[_0xe0c6('0x58')]=function(_0x12cbf4,_0x517430){return db['ChatMessage'][_0xe0c6('0x58')](_0x12cbf4[_0xe0c6('0x59')],{})[_0xe0c6('0x22')](respondWithResult(_0x517430,0xc9))[_0xe0c6('0x2c')](handleError(_0x517430,null));};exports[_0xe0c6('0x3a')]=function(_0x2e2544,_0x1055fd){if(_0x2e2544[_0xe0c6('0x59')]['id']){delete _0x2e2544[_0xe0c6('0x59')]['id'];}return db['ChatMessage'][_0xe0c6('0x57')]({'where':{'id':_0x2e2544[_0xe0c6('0x5a')]['id']}})[_0xe0c6('0x22')](handleEntityNotFound(_0x1055fd,null))[_0xe0c6('0x22')](saveUpdates(_0x2e2544[_0xe0c6('0x59')],null))[_0xe0c6('0x22')](respondWithResult(_0x1055fd,null))['catch'](handleError(_0x1055fd,null));};exports[_0xe0c6('0x3b')]=function(_0x279c4b,_0x4c7b25){return db[_0xe0c6('0x53')][_0xe0c6('0x57')]({'where':{'id':_0x279c4b[_0xe0c6('0x5a')]['id']}})[_0xe0c6('0x22')](handleEntityNotFound(_0x4c7b25,null))[_0xe0c6('0x22')](removeEntity(_0x4c7b25,null))[_0xe0c6('0x2c')](handleError(_0x4c7b25,null));};exports[_0xe0c6('0x5b')]=function(_0x3174b5,_0x41e5ea){return db[_0xe0c6('0x53')][_0xe0c6('0x5b')]()['then'](respondWithResult(_0x41e5ea,null))[_0xe0c6('0x2c')](handleError(_0x41e5ea,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xe0c6('0x5c')]=function(_0x3ec58b,_0x172c37,_0x5155c3){var _0x194893={'agent':{},'channel':_0xe0c6('0x5d')};if(_0x3ec58b['body']['id']){delete _0x3ec58b['body']['id'];}_0x3ec58b[_0xe0c6('0x59')][_0xe0c6('0x5e')]=!![];_0x3ec58b['body'][_0xe0c6('0x5f')]=moment()['format'](_0xe0c6('0x60'));_0x3ec58b[_0xe0c6('0x59')]['UserId']=_0x3ec58b['body'][_0xe0c6('0x61')]||_0x3ec58b[_0xe0c6('0x62')]['id'];_0x194893[_0xe0c6('0x63')]['id']=_0x3ec58b[_0xe0c6('0x59')][_0xe0c6('0x61')];return db[_0xe0c6('0x53')][_0xe0c6('0x57')]({'where':{'id':_0x3ec58b[_0xe0c6('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x172c37,null))[_0xe0c6('0x22')](saveUpdates(_0x3ec58b[_0xe0c6('0x59')],null))['then'](function(_0x144257){if(_0x144257){_0x194893[_0xe0c6('0x2a')]=_0x144257[_0xe0c6('0x64')]({'plain':!![]});return db[_0xe0c6('0x65')][_0xe0c6('0x57')]({'where':{'id':_0x144257[_0xe0c6('0x66')]}});}return null;})[_0xe0c6('0x22')](handleEntityNotFound(_0x172c37,null))['then'](function(_0x481d50){if(_0x481d50){return _0x481d50['update']({'UserId':_0x3ec58b['body']['UserId'],'read1stAt':_['isNil'](_0x481d50[_0xe0c6('0x67')])?moment()[_0xe0c6('0x68')](_0xe0c6('0x60')):undefined});}return null;})[_0xe0c6('0x22')](function(_0x12bbb8){if(_0x12bbb8){_0x194893[_0xe0c6('0x69')]=_0x12bbb8['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3ec58b[_0xe0c6('0x62')]['id'],_0x3ec58b['user'][_0xe0c6('0x3d')],_0x3ec58b[_0xe0c6('0x62')][_0xe0c6('0x6a')],_0x194893[_0xe0c6('0x69')]['id'],_0x3ec58b[_0xe0c6('0x59')]?JSON[_0xe0c6('0x6b')](_0x3ec58b[_0xe0c6('0x59')]):_0xe0c6('0x6c'));return respondWithRpcPromise(_0xe0c6('0x6d'),_0xe0c6('0x6e'),_0x194893);}return null;})[_0xe0c6('0x22')](function(_0x479432){var _0x1a1d5e=_0xe0c6('0x6f')+_0x479432['message'][_0xe0c6('0x70')];return db['sequelize'][_0xe0c6('0x44')](_0x1a1d5e,{'type':db[_0xe0c6('0x71')][_0xe0c6('0x72')][_0xe0c6('0x73')],'raw':!![]})[_0xe0c6('0x22')](function(_0x13dd9a){return _0x13dd9a;});})[_0xe0c6('0x22')](function(_0x5a5d4c){if(_0x5a5d4c){_0x194893[_0xe0c6('0x2a')][_0xe0c6('0x74')]=_0x5a5d4c[0x0];if(!_0x3ec58b[_0xe0c6('0x59')][_0xe0c6('0x61')])return;return db[_0xe0c6('0x75')][_0xe0c6('0x57')]({'where':{'id':_0x3ec58b['body'][_0xe0c6('0x61')],'role':_0xe0c6('0x63')},'attributes':['id',_0xe0c6('0x3d'),_0xe0c6('0x76'),_0xe0c6('0x77'),_0xe0c6('0x78')],'raw':!![]});}return null;})['then'](function(_0xa26b9e){if(!_0xa26b9e)return null;_0x194893['message'][_0xe0c6('0x63')]=_0xa26b9e;return _0x194893;})['then'](function(_0x13c328){if(_0x13c328){if(_0x3ec58b[_0xe0c6('0x59')]['manual']){_0x194893['message'][_0xe0c6('0x79')]=util[_0xe0c6('0x68')](_0xe0c6('0x7a'),_0x3ec58b[_0xe0c6('0x62')][_0xe0c6('0x3d')]);_0x194893[_0xe0c6('0x2a')][_0xe0c6('0x7b')]=_0x194893[_0xe0c6('0x7b')];_0x194893[_0xe0c6('0x2a')][_0xe0c6('0x7c')]=_0x194893[_0xe0c6('0x7b')];_0x194893['message'][_0xe0c6('0x7d')]='accept';return respondWithRpcPromise(_0xe0c6('0x7e'),'EventManager',{'event':_0xe0c6('0x7f'),'message':_['merge'](_0x194893[_0xe0c6('0x2a')],JSON[_0xe0c6('0x80')](_0x194893[_0xe0c6('0x69')][_0xe0c6('0x81')]))},client9002)[_0xe0c6('0x22')](function(){return _0x194893;});}return _0x194893;}return null;})['then'](respondWithResult(_0x172c37,null))[_0xe0c6('0x2c')](handleError(_0x172c37,null));};var interaction_log=require(_0xe0c6('0x15'))(_0xe0c6('0x82'));exports[_0xe0c6('0x38')]=function(_0x5dbeaa,_0x47889f,_0x36b433){var _0x456c2f={'agent':{},'channel':'chat'};if(_0x5dbeaa['body']['id']){delete _0x5dbeaa['body']['id'];}_0x5dbeaa['body'][_0xe0c6('0x61')]=_0x5dbeaa[_0xe0c6('0x59')][_0xe0c6('0x61')]||_0x5dbeaa[_0xe0c6('0x62')]['id'];_0x456c2f[_0xe0c6('0x63')]['id']=_0x5dbeaa[_0xe0c6('0x59')][_0xe0c6('0x61')];return db[_0xe0c6('0x53')][_0xe0c6('0x57')]({'where':{'id':_0x5dbeaa[_0xe0c6('0x5a')]['id'],'UserId':null}})[_0xe0c6('0x22')](handleEntityNotFound(_0x47889f,null))[_0xe0c6('0x22')](function(_0x3dff5a){if(_0x3dff5a){_0x456c2f[_0xe0c6('0x2a')]=_0x3dff5a[_0xe0c6('0x64')]({'plain':!![]});return db[_0xe0c6('0x65')]['find']({'where':{'id':_0x3dff5a[_0xe0c6('0x66')]}});}return null;})[_0xe0c6('0x22')](handleEntityNotFound(_0x47889f,null))['then'](function(_0x241315){if(_0x241315){_0x456c2f[_0xe0c6('0x69')]=_0x241315[_0xe0c6('0x64')]({'plain':!![]});interaction_log[_0xe0c6('0x23')](_0xe0c6('0x83'),_0x5dbeaa[_0xe0c6('0x62')]['id'],_0x5dbeaa['user'][_0xe0c6('0x3d')],_0x5dbeaa[_0xe0c6('0x62')][_0xe0c6('0x6a')],_0x456c2f[_0xe0c6('0x69')]['id'],_0x5dbeaa[_0xe0c6('0x59')]?JSON[_0xe0c6('0x6b')](_0x5dbeaa[_0xe0c6('0x59')]):_0xe0c6('0x6c'));return respondWithRpcPromise(_0xe0c6('0x84'),_0xe0c6('0x85'),_0x456c2f);}return null;})[_0xe0c6('0x22')](function(_0x27078f){var _0x5e2452=_0xe0c6('0x6f')+_0x27078f[_0xe0c6('0x2a')][_0xe0c6('0x70')];return db[_0xe0c6('0x86')][_0xe0c6('0x44')](_0x5e2452,{'type':db[_0xe0c6('0x71')][_0xe0c6('0x72')][_0xe0c6('0x73')],'raw':!![]})[_0xe0c6('0x22')](function(_0xa9a61e){return _0xa9a61e;});})[_0xe0c6('0x22')](function(_0x1616f7){if(_0x1616f7){_0x456c2f[_0xe0c6('0x2a')][_0xe0c6('0x74')]=_0x1616f7[0x0];if(!_0x5dbeaa[_0xe0c6('0x59')]['UserId'])return;return db['User'][_0xe0c6('0x57')]({'where':{'id':_0x5dbeaa[_0xe0c6('0x59')][_0xe0c6('0x61')],'role':'agent'},'attributes':['id','name',_0xe0c6('0x76'),'email','internal'],'raw':!![]});}return null;})[_0xe0c6('0x22')](function(_0x5dbeb7){if(!_0x5dbeb7)return null;_0x456c2f[_0xe0c6('0x2a')][_0xe0c6('0x63')]=_0x5dbeb7;return _0x456c2f;})[_0xe0c6('0x22')](function(_0x45621d){if(_0x45621d){_0x45621d['message']['interface']=util[_0xe0c6('0x68')](_0xe0c6('0x7a'),_0x5dbeaa[_0xe0c6('0x62')]['name']);_0x45621d['message'][_0xe0c6('0x7b')]=_0x456c2f[_0xe0c6('0x7b')];_0x45621d['message']['motionChannel']=_0x456c2f[_0xe0c6('0x7b')];_0x45621d['message']['event']=_0xe0c6('0x38');respondWithRpcPromise(_0xe0c6('0x7e'),_0xe0c6('0x7e'),{'event':_0xe0c6('0x87'),'message':_[_0xe0c6('0x51')](_0x456c2f[_0xe0c6('0x2a')],JSON['parse'](_0x456c2f[_0xe0c6('0x69')]['formData']))},client9002);return _0x456c2f;}return null;})[_0xe0c6('0x22')](respondWithResult(_0x47889f,null))['catch'](handleError(_0x47889f,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index e8058db..489a807 100644
--- a/server/api/chatMessage/chatMessage.events.js
+++ b/server/api/chatMessage/chatMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x543b=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x568022,_0x3954a8){var _0x3e557c=function(_0x190ef4){while(--_0x190ef4){_0x568022['push'](_0x568022['shift']());}};_0x3e557c(++_0x3954a8);}(_0x543b,0x1d6));var _0xb543=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x543b[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xb543('0x0'));var ChatMessage=require(_0xb543('0x1'))['db'][_0xb543('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb543('0x3')](0x0);var events={'afterCreate':_0xb543('0x4'),'afterUpdate':_0xb543('0x5'),'afterDestroy':_0xb543('0x6')};function emitEvent(_0x531592){return function(_0x47640e,_0x481d94,_0x55b006){ChatMessageEvents[_0xb543('0x7')](_0x531592+':'+_0x47640e['id'],_0x47640e);ChatMessageEvents[_0xb543('0x7')](_0x531592,_0x47640e);_0x55b006(null);};}for(var e in events){if(events[_0xb543('0x8')](e)){var event=events[e];ChatMessage[_0xb543('0x9')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xd9c0=['../../mysqldb','ChatMessage','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0x3340f9,_0x865171){var _0x1e0f47=function(_0x29221a){while(--_0x29221a){_0x3340f9['push'](_0x3340f9['shift']());}};_0x1e0f47(++_0x865171);}(_0xd9c0,0xa1));var _0x0d9c=function(_0x3c8cb9,_0x250f2d){_0x3c8cb9=_0x3c8cb9-0x0;var _0x38ce3d=_0xd9c0[_0x3c8cb9];return _0x38ce3d;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0d9c('0x0'))['db'][_0x0d9c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0d9c('0x2')](0x0);var events={'afterCreate':_0x0d9c('0x3'),'afterUpdate':_0x0d9c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ca37f){return function(_0x524305,_0x2e7381,_0x2d465c){ChatMessageEvents['emit'](_0x4ca37f+':'+_0x524305['id'],_0x524305);ChatMessageEvents['emit'](_0x4ca37f,_0x524305);_0x2d465c(null);};}for(var e in events){if(events[_0x0d9c('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x0d9c('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 5a45a66..821208d 100644
--- a/server/api/chatMessage/chatMessage.model.js
+++ b/server/api/chatMessage/chatMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf890=['bluebird','request-promise','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','FULLTEXT','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','lodash','util','../../config/logger','api','moment'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xf890,0xa3));var _0x0f89=function(_0x327005,_0x3b2608){_0x327005=_0x327005-0x0;var _0x5211d7=_0xf890[_0x327005];return _0x5211d7;};'use strict';var _=require(_0x0f89('0x0'));var util=require(_0x0f89('0x1'));var logger=require(_0x0f89('0x2'))(_0x0f89('0x3'));var moment=require(_0x0f89('0x4'));var BPromise=require(_0x0f89('0x5'));var rp=require(_0x0f89('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0f89('0x7'));var attributes=require(_0x0f89('0x8'));module[_0x0f89('0x9')]=function(_0x5a532e,_0x20e5af){return _0x5a532e[_0x0f89('0xa')](_0x0f89('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x0f89('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5126c1,_0x3ce6e6,_0x421398){var _0x239229=_0x5a532e['models'];var _0x3e8c0f=_0x5126c1['get']({'plain':!![]});if(_0x3e8c0f[_0x0f89('0xd')][_0x0f89('0xe')]()==='in'||_0x3e8c0f[_0x0f89('0xd')][_0x0f89('0xe')]()==='out'&&!_0x3e8c0f[_0x0f89('0xf')]&&!_[_0x0f89('0x10')](_0x3e8c0f[_0x0f89('0x11')])){_0x239229[_0x0f89('0x12')][_0x0f89('0x13')]({'where':{'id':_0x3e8c0f[_0x0f89('0x14')]}})[_0x0f89('0x15')](function(_0x5c0b2e){if(_0x5c0b2e){_0x5c0b2e['update']({'lastMsgAt':_0x3e8c0f[_0x0f89('0x16')],'lastMsgDirection':_0x3e8c0f[_0x0f89('0xd')][_0x0f89('0xe')]()});}})[_0x0f89('0x17')](function(_0x51ea86){console['error'](_0x51ea86);});}_0x421398();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf963=['api','request-promise','path','rimraf','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x29442f,_0x40121f){var _0x32d130=function(_0x32bed6){while(--_0x32bed6){_0x29442f['push'](_0x29442f['shift']());}};_0x32d130(++_0x40121f);}(_0xf963,0x11f));var _0x3f96=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf963[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x3f96('0x0'));var util=require(_0x3f96('0x1'));var logger=require(_0x3f96('0x2'))(_0x3f96('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3f96('0x4'));var fs=require('fs');var path=require(_0x3f96('0x5'));var rimraf=require(_0x3f96('0x6'));var config=require('../../config/environment');var attributes=require(_0x3f96('0x7'));module['exports']=function(_0x5dbaa0,_0x505ca5){return _0x5dbaa0[_0x3f96('0x8')](_0x3f96('0x9'),attributes,{'tableName':_0x3f96('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3f96('0xb')],'type':_0x3f96('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x78f002,_0x479674,_0x45648a){var _0x2bbbfb=_0x5dbaa0[_0x3f96('0xd')];var _0x1fceea=_0x78f002[_0x3f96('0xe')]({'plain':!![]});if(_0x1fceea[_0x3f96('0xf')][_0x3f96('0x10')]()==='in'||_0x1fceea[_0x3f96('0xf')]['toLowerCase']()===_0x3f96('0x11')&&!_0x1fceea[_0x3f96('0x12')]&&!_[_0x3f96('0x13')](_0x1fceea['UserId'])){_0x2bbbfb[_0x3f96('0x14')][_0x3f96('0x15')]({'where':{'id':_0x1fceea[_0x3f96('0x16')]}})['then'](function(_0x3b06af){if(_0x3b06af){_0x3b06af[_0x3f96('0x17')]({'lastMsgAt':_0x1fceea[_0x3f96('0x18')],'lastMsgDirection':_0x1fceea[_0x3f96('0xf')][_0x3f96('0x10')]()});}})[_0x3f96('0x19')](function(_0x5066c2){console[_0x3f96('0x1a')](_0x5066c2);});}_0x45648a();}},'charset':_0x3f96('0x1b'),'collate':_0x3f96('0x1c')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 23f19a6..44c5a68 100644
--- a/server/api/chatMessage/chatMessage.rpc.js
+++ b/server/api/chatMessage/chatMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x23f9=['message','result','catch','CreateChatMessage','ChatMessage','create','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','socket.io-emitter','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x16a2ea,_0x2a26ab){var _0x508a44=function(_0x55e3ee){while(--_0x55e3ee){_0x16a2ea['push'](_0x16a2ea['shift']());}};_0x508a44(++_0x2a26ab);}(_0x23f9,0x1d7));var _0x923f=function(_0x2a55f9,_0x370727){_0x2a55f9=_0x2a55f9-0x0;var _0x5a4454=_0x23f9[_0x2a55f9];return _0x5a4454;};'use strict';var _=require(_0x923f('0x0'));var util=require(_0x923f('0x1'));var moment=require(_0x923f('0x2'));var BPromise=require(_0x923f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x923f('0x4'));var db=require(_0x923f('0x5'))['db'];var utils=require(_0x923f('0x6'));var logger=require(_0x923f('0x7'))(_0x923f('0x8'));var config=require('../../config/environment');var jayson=require(_0x923f('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x923f('0xa')]=_[_0x923f('0xb')](config[_0x923f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x923f('0xc'))(new Redis(config[_0x923f('0xa')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x41c75f,_0x49fa45,_0x2db217){return new BPromise(function(_0x1805c4,_0x4db75b){return client[_0x923f('0xd')](_0x41c75f,_0x2db217)[_0x923f('0xe')](function(_0x32f2eb){logger[_0x923f('0xf')](_0x923f('0x10'),_0x49fa45,_0x923f('0x11'));logger['debug'](_0x923f('0x12'),_0x49fa45,_0x923f('0x11'),JSON[_0x923f('0x13')](_0x32f2eb));if(_0x32f2eb[_0x923f('0x14')]){if(_0x32f2eb[_0x923f('0x14')][_0x923f('0x15')]===0x1f4){logger[_0x923f('0x14')](_0x923f('0x10'),_0x49fa45,_0x32f2eb[_0x923f('0x14')][_0x923f('0x16')]);return _0x4db75b(_0x32f2eb[_0x923f('0x14')][_0x923f('0x16')]);}logger[_0x923f('0x14')](_0x923f('0x10'),_0x49fa45,_0x32f2eb[_0x923f('0x14')][_0x923f('0x16')]);return _0x1805c4(_0x32f2eb[_0x923f('0x14')]['message']);}else{logger[_0x923f('0xf')]('ChatMessage,\x20%s,\x20%s',_0x49fa45,_0x923f('0x11'));_0x1805c4(_0x32f2eb[_0x923f('0x17')][_0x923f('0x16')]);}})[_0x923f('0x18')](function(_0x14c23a){logger[_0x923f('0x14')]('ChatMessage,\x20%s,\x20%s',_0x49fa45,_0x14c23a);_0x4db75b(_0x14c23a);});});}exports[_0x923f('0x19')]=function(_0x105ff4){var _0x410953=this;return new Promise(function(_0x25908f,_0x26c7e5){return db[_0x923f('0x1a')][_0x923f('0x1b')](_0x105ff4['body'],{'raw':_0x105ff4['options']?_0x105ff4['options'][_0x923f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4fdd19){logger[_0x923f('0xf')](_0x923f('0x19'),_0x105ff4);logger['debug']('CreateChatMessage',_0x105ff4,JSON[_0x923f('0x13')](_0x4fdd19));_0x25908f(_0x4fdd19);})[_0x923f('0x18')](function(_0x49c005){logger['error']('CreateChatMessage',_0x49c005[_0x923f('0x16')],_0x105ff4);_0x26c7e5(_0x410953[_0x923f('0x14')](0x1f4,_0x49c005[_0x923f('0x16')]));});});};
\ No newline at end of file
+var _0x1f7e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','create','body','options','raw','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f7e,0xc6));var _0xe1f7=function(_0x415031,_0x32f470){_0x415031=_0x415031-0x0;var _0x22ee53=_0x1f7e[_0x415031];return _0x22ee53;};'use strict';var _=require(_0xe1f7('0x0'));var util=require(_0xe1f7('0x1'));var moment=require(_0xe1f7('0x2'));var BPromise=require(_0xe1f7('0x3'));var rs=require(_0xe1f7('0x4'));var fs=require('fs');var Redis=require(_0xe1f7('0x5'));var db=require(_0xe1f7('0x6'))['db'];var utils=require(_0xe1f7('0x7'));var logger=require(_0xe1f7('0x8'))(_0xe1f7('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe1f7('0xa')][_0xe1f7('0xb')]({'port':0x232a});config[_0xe1f7('0xc')]=_['defaults'](config[_0xe1f7('0xc')],{'host':_0xe1f7('0xd'),'port':0x18eb});var socket=require(_0xe1f7('0xe'))(new Redis(config[_0xe1f7('0xc')]));require(_0xe1f7('0xf'))[_0xe1f7('0x10')](socket);function respondWithRpcPromise(_0x2a425c,_0x5b09a0,_0x367826){return new BPromise(function(_0xac9c2b,_0x178abe){return client['request'](_0x2a425c,_0x367826)[_0xe1f7('0x11')](function(_0x208488){logger[_0xe1f7('0x12')]('ChatMessage,\x20%s,\x20%s',_0x5b09a0,_0xe1f7('0x13'));logger['debug'](_0xe1f7('0x14'),_0x5b09a0,'request\x20sent',JSON['stringify'](_0x208488));if(_0x208488[_0xe1f7('0x15')]){if(_0x208488[_0xe1f7('0x15')][_0xe1f7('0x16')]===0x1f4){logger[_0xe1f7('0x15')](_0xe1f7('0x17'),_0x5b09a0,_0x208488[_0xe1f7('0x15')]['message']);return _0x178abe(_0x208488[_0xe1f7('0x15')][_0xe1f7('0x18')]);}logger[_0xe1f7('0x15')](_0xe1f7('0x17'),_0x5b09a0,_0x208488['error'][_0xe1f7('0x18')]);return _0xac9c2b(_0x208488[_0xe1f7('0x15')][_0xe1f7('0x18')]);}else{logger['info'](_0xe1f7('0x17'),_0x5b09a0,_0xe1f7('0x13'));_0xac9c2b(_0x208488[_0xe1f7('0x19')][_0xe1f7('0x18')]);}})[_0xe1f7('0x1a')](function(_0x1ff8c0){logger['error']('ChatMessage,\x20%s,\x20%s',_0x5b09a0,_0x1ff8c0);_0x178abe(_0x1ff8c0);});});}exports[_0xe1f7('0x1b')]=function(_0x53557f){var _0x662464=this;return new Promise(function(_0x6e7d97,_0x154008){return db['ChatMessage'][_0xe1f7('0x1c')](_0x53557f[_0xe1f7('0x1d')],{'raw':_0x53557f['options']?_0x53557f[_0xe1f7('0x1e')][_0xe1f7('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xc2f8b5){logger['info'](_0xe1f7('0x1b'),_0x53557f);logger[_0xe1f7('0x20')]('CreateChatMessage',_0x53557f,JSON['stringify'](_0xc2f8b5));_0x6e7d97(_0xc2f8b5);})['catch'](function(_0x601a45){logger[_0xe1f7('0x15')](_0xe1f7('0x1b'),_0x601a45[_0xe1f7('0x18')],_0x53557f);_0x154008(_0x662464[_0xe1f7('0x15')](0x1f4,_0x601a45[_0xe1f7('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 8c12ad6..d320a6f 100644
--- a/server/api/chatMessage/chatMessage.socket.js
+++ b/server/api/chatMessage/chatMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1c3b=['removeListener','./chatMessage.events','save','remove','emit'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x1c3b,0xab));var _0xb1c3=function(_0x23c087,_0x1b37e4){_0x23c087=_0x23c087-0x0;var _0x45f28b=_0x1c3b[_0x23c087];return _0x45f28b;};'use strict';var ChatMessageEvents=require(_0xb1c3('0x0'));var events=[_0xb1c3('0x1'),_0xb1c3('0x2'),'update'];function createListener(_0x4eeac2,_0x28a375){return function(_0x89ce0b){_0x28a375[_0xb1c3('0x3')](_0x4eeac2,_0x89ce0b);};}function removeListener(_0x34dbb5,_0x24d4c0){return function(){ChatMessageEvents[_0xb1c3('0x4')](_0x34dbb5,_0x24d4c0);};}exports['register']=function(_0x472813){for(var _0x62da34=0x0,_0x211254=events['length'];_0x62da34<_0x211254;_0x62da34++){var _0x504fc9=events[_0x62da34];var _0x4ed6cf=createListener('chatMessage:'+_0x504fc9,_0x472813);ChatMessageEvents['on'](_0x504fc9,_0x4ed6cf);}};
\ No newline at end of file
+var _0x2eb2=['chatMessage:','save','remove','update','register','length'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x2eb2[_0x4e9628];return _0x27bc8c;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x22eb('0x0'),_0x22eb('0x1'),_0x22eb('0x2')];function createListener(_0x1a002b,_0x1dd079){return function(_0xaf32cf){_0x1dd079['emit'](_0x1a002b,_0xaf32cf);};}function removeListener(_0x27732f,_0x4efe67){return function(){ChatMessageEvents['removeListener'](_0x27732f,_0x4efe67);};}exports[_0x22eb('0x3')]=function(_0x10e116){for(var _0x35dd5b=0x0,_0x2a9850=events[_0x22eb('0x4')];_0x35dd5b<_0x2a9850;_0x35dd5b++){var _0x396806=events[_0x35dd5b];var _0x33ddef=createListener(_0x22eb('0x5')+_0x396806,_0x10e116);ChatMessageEvents['on'](_0x396806,_0x33ddef);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 0f16a2a..216da51 100644
--- a/server/api/chatMessage/index.js
+++ b/server/api/chatMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea88=['reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','/:id/accept','/:id/reject'];(function(_0x193f7c,_0x742fdb){var _0x3b0f95=function(_0x18375e){while(--_0x18375e){_0x193f7c['push'](_0x193f7c['shift']());}};_0x3b0f95(++_0x742fdb);}(_0xea88,0x153));var _0x8ea8=function(_0xbf2b2b,_0x256e96){_0xbf2b2b=_0xbf2b2b-0x0;var _0x5f83ac=_0xea88[_0xbf2b2b];return _0x5f83ac;};'use strict';var multer=require(_0x8ea8('0x0'));var util=require(_0x8ea8('0x1'));var path=require(_0x8ea8('0x2'));var timeout=require(_0x8ea8('0x3'));var express=require(_0x8ea8('0x4'));var router=express[_0x8ea8('0x5')]();var fs_extra=require(_0x8ea8('0x6'));var auth=require(_0x8ea8('0x7'));var interaction=require(_0x8ea8('0x8'));var config=require('../../config/environment');var controller=require(_0x8ea8('0x9'));router[_0x8ea8('0xa')]('/',auth[_0x8ea8('0xb')](),controller[_0x8ea8('0xc')]);router[_0x8ea8('0xa')](_0x8ea8('0xd'),auth[_0x8ea8('0xb')](),controller['describe']);router['get'](_0x8ea8('0xe'),auth[_0x8ea8('0xb')](),controller[_0x8ea8('0xf')]);router[_0x8ea8('0x10')]('/',auth[_0x8ea8('0xb')](),interaction['tracked']('chat','chatmessage:create'),controller['create']);router[_0x8ea8('0x11')](_0x8ea8('0xe'),controller[_0x8ea8('0x12')]);router[_0x8ea8('0x11')](_0x8ea8('0x13'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x8ea8('0x14'),auth['isAuthenticated'](),controller[_0x8ea8('0x15')]);router[_0x8ea8('0x16')](_0x8ea8('0xe'),auth[_0x8ea8('0xb')](),controller[_0x8ea8('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xf8cc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','/describe','describe','get','/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','multer','util','connect-timeout','Router','fs-extra'];(function(_0x7cb97a,_0x363af9){var _0x1bb58e=function(_0x699dea){while(--_0x699dea){_0x7cb97a['push'](_0x7cb97a['shift']());}};_0x1bb58e(++_0x363af9);}(_0xf8cc,0x1ef));var _0xcf8c=function(_0x20c64e,_0xc3e08e){_0x20c64e=_0x20c64e-0x0;var _0x1fc06e=_0xf8cc[_0x20c64e];return _0x1fc06e;};'use strict';var multer=require(_0xcf8c('0x0'));var util=require(_0xcf8c('0x1'));var path=require('path');var timeout=require(_0xcf8c('0x2'));var express=require('express');var router=express[_0xcf8c('0x3')]();var fs_extra=require(_0xcf8c('0x4'));var auth=require(_0xcf8c('0x5'));var interaction=require(_0xcf8c('0x6'));var config=require(_0xcf8c('0x7'));var controller=require(_0xcf8c('0x8'));router['get']('/',auth[_0xcf8c('0x9')](),controller['index']);router['get'](_0xcf8c('0xa'),auth[_0xcf8c('0x9')](),controller[_0xcf8c('0xb')]);router[_0xcf8c('0xc')](_0xcf8c('0xd'),auth['isAuthenticated'](),controller[_0xcf8c('0xe')]);router[_0xcf8c('0xf')]('/',auth[_0xcf8c('0x9')](),interaction[_0xcf8c('0x10')]('chat',_0xcf8c('0x11')),controller[_0xcf8c('0x12')]);router[_0xcf8c('0x13')](_0xcf8c('0xd'),controller[_0xcf8c('0x14')]);router[_0xcf8c('0x13')](_0xcf8c('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0xcf8c('0x13')]('/:id/reject',auth[_0xcf8c('0x9')](),controller[_0xcf8c('0x16')]);router[_0xcf8c('0x17')](_0xcf8c('0xd'),auth[_0xcf8c('0x9')](),controller[_0xcf8c('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 8032123..1f44914 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x1516ad,_0x2d4ee7){var _0x30ee36=function(_0x2c622d){while(--_0x2c622d){_0x1516ad['push'](_0x1516ad['shift']());}};_0x30ee36(++_0x2d4ee7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x48d952,_0x26065d){_0x48d952=_0x48d952-0x0;var _0x594455=_0x5f2f[_0x48d952];return _0x594455;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0x0b0e[_0x46111d];return _0xe82586;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 2fc66ed..261f7ff 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x177a24,_0xcc1afe){_0x177a24=_0x177a24-0x0;var _0x46e21b=_0x7a54[_0x177a24];return _0x46e21b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x7a54,0x106));var _0x47a5=function(_0x6c36f6,_0x5b76b2){_0x6c36f6=_0x6c36f6-0x0;var _0x2d41b2=_0x7a54[_0x6c36f6];return _0x2d41b2;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 0145930..8008d5c 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd08=['save','remove','emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage'];(function(_0x3285a3,_0x42b059){var _0x38221e=function(_0x463c69){while(--_0x463c69){_0x3285a3['push'](_0x3285a3['shift']());}};_0x38221e(++_0x42b059);}(_0xbd08,0x6e));var _0x8bd0=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xbd08[_0x3fba9f];return _0x192cf1;};'use strict';var EventEmitter=require(_0x8bd0('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x8bd0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8bd0('0x2'),'afterUpdate':'update','afterDestroy':_0x8bd0('0x3')};function emitEvent(_0x21dd29){return function(_0x316930,_0x5e9819,_0x2b53bd){ChatOfflineMessageEvents[_0x8bd0('0x4')](_0x21dd29+':'+_0x316930['id'],_0x316930);ChatOfflineMessageEvents['emit'](_0x21dd29,_0x316930);_0x2b53bd(null);};}for(var e in events){if(events[_0x8bd0('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x8bd0('0x6')](e,emitEvent(event));}}module[_0x8bd0('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x0a08=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage'];(function(_0x2703cf,_0x526b31){var _0x28f18a=function(_0x10e33b){while(--_0x10e33b){_0x2703cf['push'](_0x2703cf['shift']());}};_0x28f18a(++_0x526b31);}(_0x0a08,0x153));var _0x80a0=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x0a08[_0x37c22c];return _0x119d79;};'use strict';var EventEmitter=require(_0x80a0('0x0'));var ChatOfflineMessage=require(_0x80a0('0x1'))['db'][_0x80a0('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x80a0('0x3')](0x0);var events={'afterCreate':_0x80a0('0x4'),'afterUpdate':_0x80a0('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd5656d){return function(_0x5b7b12,_0x439409,_0x176232){ChatOfflineMessageEvents[_0x80a0('0x6')](_0xd5656d+':'+_0x5b7b12['id'],_0x5b7b12);ChatOfflineMessageEvents[_0x80a0('0x6')](_0xd5656d,_0x5b7b12);_0x176232(null);};}for(var e in events){if(events[_0x80a0('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x80a0('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f038495..15a8dea 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b3c=['./chatOfflineMessage.attributes','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0xbea524,_0x39555b){var _0x28bc5f=function(_0x2f758d){while(--_0x2f758d){_0xbea524['push'](_0xbea524['shift']());}};_0x28bc5f(++_0x39555b);}(_0x0b3c,0xeb));var _0xc0b3=function(_0x3a5b1f,_0x57ee12){_0x3a5b1f=_0x3a5b1f-0x0;var _0x2e7fe8=_0x0b3c[_0x3a5b1f];return _0x2e7fe8;};'use strict';var attributes=require(_0xc0b3('0x0'));module['exports']=function(_0x27497c){return _0x27497c[_0xc0b3('0x1')](_0xc0b3('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc0b3('0x3'),'collate':_0xc0b3('0x4')});};
\ No newline at end of file
+var _0x7082=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3f7101,_0x536e58){var _0x7be955=function(_0x5f07c2){while(--_0x5f07c2){_0x3f7101['push'](_0x3f7101['shift']());}};_0x7be955(++_0x536e58);}(_0x7082,0xf5));var _0x2708=function(_0x4e47f7,_0x205e52){_0x4e47f7=_0x4e47f7-0x0;var _0x24b111=_0x7082[_0x4e47f7];return _0x24b111;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x1bfd72){return _0x1bfd72[_0x2708('0x0')](_0x2708('0x1'),attributes,{'tableName':_0x2708('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2708('0x3'),'collate':_0x2708('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 8d1b889..2055c45 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd241=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x5a0cfb,_0x299792){var _0x3a3558=function(_0x50a1cc){while(--_0x50a1cc){_0x5a0cfb['push'](_0x5a0cfb['shift']());}};_0x3a3558(++_0x299792);}(_0xd241,0x101));var _0x1d24=function(_0x1e5313,_0x4a63ea){_0x1e5313=_0x1e5313-0x0;var _0x41ba4d=_0xd241[_0x1e5313];return _0x41ba4d;};'use strict';var _=require(_0x1d24('0x0'));var util=require('util');var moment=require(_0x1d24('0x1'));var BPromise=require(_0x1d24('0x2'));var rs=require(_0x1d24('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d24('0x4'))['db'];var utils=require(_0x1d24('0x5'));var logger=require(_0x1d24('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1d24('0x7'));var client=jayson['client'][_0x1d24('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b9f94,_0x238cdf,_0x556a43){return new BPromise(function(_0x25479b,_0x215dad){return client[_0x1d24('0x9')](_0x4b9f94,_0x556a43)['then'](function(_0x59e191){logger[_0x1d24('0xa')](_0x1d24('0xb'),_0x238cdf,_0x1d24('0xc'));logger[_0x1d24('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x238cdf,_0x1d24('0xc'),JSON[_0x1d24('0xe')](_0x59e191));if(_0x59e191[_0x1d24('0xf')]){if(_0x59e191[_0x1d24('0xf')][_0x1d24('0x10')]===0x1f4){logger[_0x1d24('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x238cdf,_0x59e191[_0x1d24('0xf')][_0x1d24('0x11')]);return _0x215dad(_0x59e191[_0x1d24('0xf')][_0x1d24('0x11')]);}logger[_0x1d24('0xf')](_0x1d24('0xb'),_0x238cdf,_0x59e191[_0x1d24('0xf')][_0x1d24('0x11')]);return _0x25479b(_0x59e191[_0x1d24('0xf')]['message']);}else{logger[_0x1d24('0xa')](_0x1d24('0xb'),_0x238cdf,'request\x20sent');_0x25479b(_0x59e191[_0x1d24('0x12')][_0x1d24('0x11')]);}})[_0x1d24('0x13')](function(_0x5c5135){logger['error'](_0x1d24('0xb'),_0x238cdf,_0x5c5135);_0x215dad(_0x5c5135);});});}
\ No newline at end of file
+var _0x7513=['bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','lodash','util','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7513,0x101));var _0x3751=function(_0x44af93,_0x45fa15){_0x44af93=_0x44af93-0x0;var _0x22eef3=_0x7513[_0x44af93];return _0x22eef3;};'use strict';var _=require(_0x3751('0x0'));var util=require(_0x3751('0x1'));var moment=require(_0x3751('0x2'));var BPromise=require(_0x3751('0x3'));var rs=require(_0x3751('0x4'));var fs=require('fs');var Redis=require(_0x3751('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3751('0x6'));var logger=require('../../config/logger')(_0x3751('0x7'));var config=require('../../config/environment');var jayson=require(_0x3751('0x8'));var client=jayson[_0x3751('0x9')][_0x3751('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52b3fe,_0x584340,_0x13073a){return new BPromise(function(_0x58795d,_0x2ae940){return client[_0x3751('0xb')](_0x52b3fe,_0x13073a)['then'](function(_0x2dc662){logger['info'](_0x3751('0xc'),_0x584340,_0x3751('0xd'));logger[_0x3751('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x584340,_0x3751('0xd'),JSON['stringify'](_0x2dc662));if(_0x2dc662[_0x3751('0xf')]){if(_0x2dc662[_0x3751('0xf')]['code']===0x1f4){logger[_0x3751('0xf')](_0x3751('0xc'),_0x584340,_0x2dc662[_0x3751('0xf')][_0x3751('0x10')]);return _0x2ae940(_0x2dc662[_0x3751('0xf')]['message']);}logger[_0x3751('0xf')](_0x3751('0xc'),_0x584340,_0x2dc662[_0x3751('0xf')][_0x3751('0x10')]);return _0x58795d(_0x2dc662[_0x3751('0xf')][_0x3751('0x10')]);}else{logger[_0x3751('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x584340,_0x3751('0xd'));_0x58795d(_0x2dc662[_0x3751('0x12')][_0x3751('0x10')]);}})[_0x3751('0x13')](function(_0xe36b89){logger['error'](_0x3751('0xc'),_0x584340,_0xe36b89);_0x2ae940(_0xe36b89);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 56c5805..bfe456f 100644
--- a/server/api/chatOfflineMessage/index.js
+++ b/server/api/chatOfflineMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e7e=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','path'];(function(_0x2064c8,_0x168039){var _0x23af73=function(_0x2a2d10){while(--_0x2a2d10){_0x2064c8['push'](_0x2064c8['shift']());}};_0x23af73(++_0x168039);}(_0x1e7e,0xda));var _0xe1e7=function(_0x173672,_0x8bc880){_0x173672=_0x173672-0x0;var _0x201e46=_0x1e7e[_0x173672];return _0x201e46;};'use strict';var multer=require(_0xe1e7('0x0'));var util=require('util');var path=require(_0xe1e7('0x1'));var timeout=require(_0xe1e7('0x2'));var express=require('express');var router=express[_0xe1e7('0x3')]();var fs_extra=require(_0xe1e7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe1e7('0x5'));var config=require(_0xe1e7('0x6'));var controller=require(_0xe1e7('0x7'));router[_0xe1e7('0x8')]('/',auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xa')]);router['get'](_0xe1e7('0xb'),auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xc')]);router['get'](_0xe1e7('0xd'),auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xe')]);router[_0xe1e7('0xf')]('/',auth[_0xe1e7('0x9')](),controller[_0xe1e7('0x10')]);router[_0xe1e7('0x11')](_0xe1e7('0xd'),auth[_0xe1e7('0x9')](),controller[_0xe1e7('0x12')]);router['delete'](_0xe1e7('0xd'),auth[_0xe1e7('0x9')](),controller[_0xe1e7('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x2525=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','get','/describe','isAuthenticated','describe'];(function(_0x1302e6,_0x41dcb9){var _0x17a8b9=function(_0x283ecf){while(--_0x283ecf){_0x1302e6['push'](_0x1302e6['shift']());}};_0x17a8b9(++_0x41dcb9);}(_0x2525,0x162));var _0x5252=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x2525[_0x1b5aea];return _0x15cfc6;};'use strict';var multer=require(_0x5252('0x0'));var util=require('util');var path=require(_0x5252('0x1'));var timeout=require('connect-timeout');var express=require(_0x5252('0x2'));var router=express[_0x5252('0x3')]();var fs_extra=require(_0x5252('0x4'));var auth=require(_0x5252('0x5'));var interaction=require(_0x5252('0x6'));var config=require(_0x5252('0x7'));var controller=require(_0x5252('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5252('0x9')]);router[_0x5252('0xa')](_0x5252('0xb'),auth[_0x5252('0xc')](),controller[_0x5252('0xd')]);router['get'](_0x5252('0xe'),auth['isAuthenticated'](),controller[_0x5252('0xf')]);router[_0x5252('0x10')]('/',auth[_0x5252('0xc')](),controller[_0x5252('0x11')]);router[_0x5252('0x12')]('/:id',auth[_0x5252('0xc')](),controller[_0x5252('0x13')]);router[_0x5252('0x14')](_0x5252('0xe'),auth[_0x5252('0xc')](),controller[_0x5252('0x15')]);module[_0x5252('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index cb56845..398c3a1 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef41=['STRING','INTEGER','sequelize','exports','ENUM','mouseOver','timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xef41,0x121));var _0x1ef4=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0xef41[_0xfb0cfd];return _0x2fd8aa;};'use strict';var Sequelize=require(_0x1ef4('0x0'));module[_0x1ef4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1ef4('0x2')](_0x1ef4('0x3'),_0x1ef4('0x4')),'defaultValue':_0x1ef4('0x3')},'selector':{'type':Sequelize[_0x1ef4('0x5')]},'timeout':{'type':Sequelize[_0x1ef4('0x6')]}};
\ No newline at end of file
+var _0xaaff=['INTEGER','exports','STRING','mouseOver','timeout'];(function(_0x382642,_0x2a2aea){var _0x5f33ed=function(_0x36d4e4){while(--_0x36d4e4){_0x382642['push'](_0x382642['shift']());}};_0x5f33ed(++_0x2a2aea);}(_0xaaff,0x100));var _0xfaaf=function(_0x405022,_0x2377a8){_0x405022=_0x405022-0x0;var _0x3b29e7=_0xaaff[_0x405022];return _0x3b29e7;};'use strict';var Sequelize=require('sequelize');module[_0xfaaf('0x0')]={'name':{'type':Sequelize[_0xfaaf('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfaaf('0x2'),_0xfaaf('0x3')),'defaultValue':_0xfaaf('0x2')},'selector':{'type':Sequelize[_0xfaaf('0x1')]},'timeout':{'type':Sequelize[_0xfaaf('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 8568f59..df55f0f 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc9b0=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','then','catch','create','body','params','eml-format','rimraf'];(function(_0x1ae78b,_0x289a17){var _0x2046c9=function(_0x3f61a1){while(--_0x3f61a1){_0x1ae78b['push'](_0x1ae78b['shift']());}};_0x2046c9(++_0x289a17);}(_0xc9b0,0x143));var _0x0c9b=function(_0x316e51,_0x2be274){_0x316e51=_0x316e51-0x0;var _0x2ae55c=_0xc9b0[_0x316e51];return _0x2ae55c;};'use strict';var emlformat=require(_0x0c9b('0x0'));var rimraf=require(_0x0c9b('0x1'));var zipdir=require(_0x0c9b('0x2'));var jsonpatch=require(_0x0c9b('0x3'));var rp=require(_0x0c9b('0x4'));var moment=require(_0x0c9b('0x5'));var BPromise=require(_0x0c9b('0x6'));var Mustache=require(_0x0c9b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0c9b('0x8'));var csv=require(_0x0c9b('0x9'));var ejs=require(_0x0c9b('0xa'));var fs=require('fs');var fs_extra=require(_0x0c9b('0xb'));var _=require(_0x0c9b('0xc'));var squel=require(_0x0c9b('0xd'));var crypto=require(_0x0c9b('0xe'));var jsforce=require(_0x0c9b('0xf'));var deskjs=require(_0x0c9b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0c9b('0x11'));var authService=require(_0x0c9b('0x12'));var qs=require(_0x0c9b('0x13'));var as=require(_0x0c9b('0x14'));var hardwareService=require(_0x0c9b('0x15'));var logger=require(_0x0c9b('0x16'))('api');var utils=require(_0x0c9b('0x17'));var config=require(_0x0c9b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c9b('0x19'))['db'];function respondWithStatusCode(_0x4acc77,_0x273644){_0x273644=_0x273644||0xcc;return function(_0xe55deb){if(_0xe55deb){return _0x4acc77[_0x0c9b('0x1a')](_0x273644);}return _0x4acc77[_0x0c9b('0x1b')](_0x273644)[_0x0c9b('0x1c')]();};}function respondWithResult(_0x2bc058,_0x291aeb){_0x291aeb=_0x291aeb||0xc8;return function(_0x41603d){if(_0x41603d){return _0x2bc058[_0x0c9b('0x1b')](_0x291aeb)[_0x0c9b('0x1d')](_0x41603d);}};}function respondWithFilteredResult(_0x4daf5e,_0x5967a6){return function(_0x518486){if(_0x518486){var _0x3ac356=typeof _0x5967a6[_0x0c9b('0x1e')]==='undefined'&&typeof _0x5967a6[_0x0c9b('0x1f')]===_0x0c9b('0x20');var _0x3279cd=_0x518486[_0x0c9b('0x21')];var _0x2b2f65=_0x3ac356?0x0:_0x5967a6[_0x0c9b('0x1e')];var _0x39218d=_0x3ac356?_0x518486['count']:_0x5967a6['offset']+_0x5967a6[_0x0c9b('0x1f')];var _0x49d499;if(_0x39218d>=_0x3279cd){_0x39218d=_0x3279cd;_0x49d499=0xc8;}else{_0x49d499=0xce;}_0x4daf5e[_0x0c9b('0x1b')](_0x49d499);return _0x4daf5e[_0x0c9b('0x22')](_0x0c9b('0x23'),_0x2b2f65+'-'+_0x39218d+'/'+_0x3279cd)[_0x0c9b('0x1d')](_0x518486);}return null;};}function patchUpdates(_0x1bf9f1){return function(_0x3d335c){try{jsonpatch[_0x0c9b('0x24')](_0x3d335c,_0x1bf9f1,!![]);}catch(_0x2269d4){return BPromise[_0x0c9b('0x25')](_0x2269d4);}return _0x3d335c[_0x0c9b('0x26')]();};}function saveUpdates(_0x4cc5cc,_0x19f6e2){return function(_0x3dfd64){if(_0x3dfd64){return _0x3dfd64[_0x0c9b('0x27')](_0x4cc5cc)['then'](function(_0x428a74){return _0x428a74;});}return null;};}function removeEntity(_0x37ee51,_0x2409c6){return function(_0x5c83c8){if(_0x5c83c8){return _0x5c83c8[_0x0c9b('0x28')]()['then'](function(){_0x37ee51[_0x0c9b('0x1b')](0xcc)[_0x0c9b('0x1c')]();});}};}function handleEntityNotFound(_0x2d1ce5,_0x1824d2){return function(_0xd0733f){if(!_0xd0733f){_0x2d1ce5[_0x0c9b('0x1a')](0x194);}return _0xd0733f;};}function handleError(_0x29e457,_0x21748a){_0x21748a=_0x21748a||0x1f4;return function(_0x476c59){logger[_0x0c9b('0x29')](_0x476c59[_0x0c9b('0x2a')]);if(_0x476c59['name']){delete _0x476c59['name'];}_0x29e457[_0x0c9b('0x1b')](_0x21748a)[_0x0c9b('0x2b')](_0x476c59);};}exports[_0x0c9b('0x2c')]=function(_0x2c9f63,_0x4ca17d){var _0x361d03={'raw':!![],'where':{'id':_0x2c9f63['params']['id']}},_0x1391d1={};_0x1391d1[_0x0c9b('0x2d')]=_[_0x0c9b('0x2e')](db[_0x0c9b('0x2f')][_0x0c9b('0x30')]);_0x1391d1[_0x0c9b('0x31')]=_[_0x0c9b('0x2e')](_0x2c9f63['query']);_0x1391d1[_0x0c9b('0x32')]=_[_0x0c9b('0x33')](_0x1391d1['model'],_0x1391d1[_0x0c9b('0x31')]);_0x361d03[_0x0c9b('0x34')]=_[_0x0c9b('0x33')](_0x1391d1[_0x0c9b('0x2d')],qs[_0x0c9b('0x35')](_0x2c9f63[_0x0c9b('0x31')][_0x0c9b('0x35')]));_0x361d03[_0x0c9b('0x34')]=_0x361d03[_0x0c9b('0x34')][_0x0c9b('0x36')]?_0x361d03[_0x0c9b('0x34')]:_0x1391d1['model'];if(_0x2c9f63['query'][_0x0c9b('0x37')]){_0x361d03[_0x0c9b('0x38')]=[{'all':!![]}];}_0x361d03=_[_0x0c9b('0x39')]({},_0x361d03,_0x2c9f63[_0x0c9b('0x3a')]);return db[_0x0c9b('0x2f')][_0x0c9b('0x3b')](_0x361d03)[_0x0c9b('0x3c')](handleEntityNotFound(_0x4ca17d,null))[_0x0c9b('0x3c')](respondWithResult(_0x4ca17d,null))[_0x0c9b('0x3d')](handleError(_0x4ca17d,null));};exports[_0x0c9b('0x3e')]=function(_0x535ab7,_0x1a4513){return db['ChatProactiveAction'][_0x0c9b('0x3e')](_0x535ab7[_0x0c9b('0x3f')],{})[_0x0c9b('0x3c')](respondWithResult(_0x1a4513,0xc9))[_0x0c9b('0x3d')](handleError(_0x1a4513,null));};exports[_0x0c9b('0x27')]=function(_0x5b300a,_0x430db5){if(_0x5b300a['body']['id']){delete _0x5b300a['body']['id'];}return db[_0x0c9b('0x2f')]['find']({'where':{'id':_0x5b300a[_0x0c9b('0x40')]['id']}})[_0x0c9b('0x3c')](handleEntityNotFound(_0x430db5,null))[_0x0c9b('0x3c')](saveUpdates(_0x5b300a[_0x0c9b('0x3f')],null))[_0x0c9b('0x3c')](respondWithResult(_0x430db5,null))[_0x0c9b('0x3d')](handleError(_0x430db5,null));};exports[_0x0c9b('0x28')]=function(_0xa12618,_0x26e3ef){return db[_0x0c9b('0x2f')][_0x0c9b('0x3b')]({'where':{'id':_0xa12618[_0x0c9b('0x40')]['id']}})['then'](handleEntityNotFound(_0x26e3ef,null))[_0x0c9b('0x3c')](removeEntity(_0x26e3ef,null))[_0x0c9b('0x3d')](handleError(_0x26e3ef,null));};
\ No newline at end of file
+var _0xdd0c=['moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','fields','attributes','length','include','merge','find','then','create','body','catch','rimraf','zip-dir','fast-json-patch'];(function(_0x2bb882,_0x1db026){var _0x3b190a=function(_0x390bd3){while(--_0x390bd3){_0x2bb882['push'](_0x2bb882['shift']());}};_0x3b190a(++_0x1db026);}(_0xdd0c,0x165));var _0xcdd0=function(_0x5b16ea,_0x1dc0d6){_0x5b16ea=_0x5b16ea-0x0;var _0x13b4f0=_0xdd0c[_0x5b16ea];return _0x13b4f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdd0('0x0'));var zipdir=require(_0xcdd0('0x1'));var jsonpatch=require(_0xcdd0('0x2'));var rp=require('request-promise');var moment=require(_0xcdd0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdd0('0x4'));var util=require(_0xcdd0('0x5'));var path=require(_0xcdd0('0x6'));var sox=require(_0xcdd0('0x7'));var csv=require(_0xcdd0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdd0('0x9'));var _=require(_0xcdd0('0xa'));var squel=require(_0xcdd0('0xb'));var crypto=require(_0xcdd0('0xc'));var jsforce=require(_0xcdd0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdd0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdd0('0xe'));var authService=require(_0xcdd0('0xf'));var qs=require(_0xcdd0('0x10'));var as=require(_0xcdd0('0x11'));var hardwareService=require(_0xcdd0('0x12'));var logger=require(_0xcdd0('0x13'))(_0xcdd0('0x14'));var utils=require(_0xcdd0('0x15'));var config=require(_0xcdd0('0x16'));var licenseUtil=require(_0xcdd0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1ff6,_0x356501){_0x356501=_0x356501||0xcc;return function(_0x14c775){if(_0x14c775){return _0x4a1ff6['sendStatus'](_0x356501);}return _0x4a1ff6[_0xcdd0('0x18')](_0x356501)[_0xcdd0('0x19')]();};}function respondWithResult(_0x4f4aa4,_0x1fc89a){_0x1fc89a=_0x1fc89a||0xc8;return function(_0x1d5bff){if(_0x1d5bff){return _0x4f4aa4[_0xcdd0('0x18')](_0x1fc89a)[_0xcdd0('0x1a')](_0x1d5bff);}};}function respondWithFilteredResult(_0xc1c3d5,_0x52aef5){return function(_0x5b5c06){if(_0x5b5c06){var _0x189f54=typeof _0x52aef5[_0xcdd0('0x1b')]===_0xcdd0('0x1c')&&typeof _0x52aef5[_0xcdd0('0x1d')]===_0xcdd0('0x1c');var _0x3b07a1=_0x5b5c06[_0xcdd0('0x1e')];var _0x2c199f=_0x189f54?0x0:_0x52aef5[_0xcdd0('0x1b')];var _0x14d55b=_0x189f54?_0x5b5c06['count']:_0x52aef5[_0xcdd0('0x1b')]+_0x52aef5[_0xcdd0('0x1d')];var _0x5060fa;if(_0x14d55b>=_0x3b07a1){_0x14d55b=_0x3b07a1;_0x5060fa=0xc8;}else{_0x5060fa=0xce;}_0xc1c3d5['status'](_0x5060fa);return _0xc1c3d5[_0xcdd0('0x1f')](_0xcdd0('0x20'),_0x2c199f+'-'+_0x14d55b+'/'+_0x3b07a1)['json'](_0x5b5c06);}return null;};}function patchUpdates(_0x12128e){return function(_0x4f7325){try{jsonpatch['apply'](_0x4f7325,_0x12128e,!![]);}catch(_0x4d038f){return BPromise[_0xcdd0('0x21')](_0x4d038f);}return _0x4f7325[_0xcdd0('0x22')]();};}function saveUpdates(_0x4afcfa,_0x2ab7e4){return function(_0x31a3e6){if(_0x31a3e6){return _0x31a3e6[_0xcdd0('0x23')](_0x4afcfa)['then'](function(_0x9d4727){return _0x9d4727;});}return null;};}function removeEntity(_0x7be0ac,_0x509e9c){return function(_0x3c81b1){if(_0x3c81b1){return _0x3c81b1[_0xcdd0('0x24')]()['then'](function(){_0x7be0ac[_0xcdd0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3797c2,_0x64b52){return function(_0x476018){if(!_0x476018){_0x3797c2['sendStatus'](0x194);}return _0x476018;};}function handleError(_0x22fd47,_0x10cba2){_0x10cba2=_0x10cba2||0x1f4;return function(_0x5e5cc){logger[_0xcdd0('0x25')](_0x5e5cc[_0xcdd0('0x26')]);if(_0x5e5cc[_0xcdd0('0x27')]){delete _0x5e5cc[_0xcdd0('0x27')];}_0x22fd47[_0xcdd0('0x18')](_0x10cba2)[_0xcdd0('0x28')](_0x5e5cc);};}exports[_0xcdd0('0x29')]=function(_0x4074e0,_0x49cfe0){var _0x28084c={'raw':!![],'where':{'id':_0x4074e0[_0xcdd0('0x2a')]['id']}},_0xd6d64f={};_0xd6d64f['model']=_[_0xcdd0('0x2b')](db[_0xcdd0('0x2c')][_0xcdd0('0x2d')]);_0xd6d64f[_0xcdd0('0x2e')]=_[_0xcdd0('0x2b')](_0x4074e0['query']);_0xd6d64f[_0xcdd0('0x2f')]=_[_0xcdd0('0x30')](_0xd6d64f[_0xcdd0('0x31')],_0xd6d64f['query']);_0x28084c['attributes']=_[_0xcdd0('0x30')](_0xd6d64f[_0xcdd0('0x31')],qs[_0xcdd0('0x32')](_0x4074e0['query'][_0xcdd0('0x32')]));_0x28084c[_0xcdd0('0x33')]=_0x28084c['attributes'][_0xcdd0('0x34')]?_0x28084c[_0xcdd0('0x33')]:_0xd6d64f[_0xcdd0('0x31')];if(_0x4074e0[_0xcdd0('0x2e')]['includeAll']){_0x28084c[_0xcdd0('0x35')]=[{'all':!![]}];}_0x28084c=_[_0xcdd0('0x36')]({},_0x28084c,_0x4074e0['options']);return db[_0xcdd0('0x2c')][_0xcdd0('0x37')](_0x28084c)[_0xcdd0('0x38')](handleEntityNotFound(_0x49cfe0,null))[_0xcdd0('0x38')](respondWithResult(_0x49cfe0,null))['catch'](handleError(_0x49cfe0,null));};exports[_0xcdd0('0x39')]=function(_0x358139,_0x95d87f){return db[_0xcdd0('0x2c')][_0xcdd0('0x39')](_0x358139['body'],{})[_0xcdd0('0x38')](respondWithResult(_0x95d87f,0xc9))['catch'](handleError(_0x95d87f,null));};exports['update']=function(_0x4fd705,_0x407725){if(_0x4fd705[_0xcdd0('0x3a')]['id']){delete _0x4fd705[_0xcdd0('0x3a')]['id'];}return db[_0xcdd0('0x2c')][_0xcdd0('0x37')]({'where':{'id':_0x4fd705[_0xcdd0('0x2a')]['id']}})[_0xcdd0('0x38')](handleEntityNotFound(_0x407725,null))['then'](saveUpdates(_0x4fd705[_0xcdd0('0x3a')],null))[_0xcdd0('0x38')](respondWithResult(_0x407725,null))[_0xcdd0('0x3b')](handleError(_0x407725,null));};exports[_0xcdd0('0x24')]=function(_0x4e6d31,_0x4934a5){return db[_0xcdd0('0x2c')][_0xcdd0('0x37')]({'where':{'id':_0x4e6d31['params']['id']}})[_0xcdd0('0x38')](handleEntityNotFound(_0x4934a5,null))[_0xcdd0('0x38')](removeEntity(_0x4934a5,null))['catch'](handleError(_0x4934a5,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 1fb7609..e14a680 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.model.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe700=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xe700,0x1e4));var _0x0e70=function(_0xd76c91,_0x15257d){_0xd76c91=_0xd76c91-0x0;var _0x245e91=_0xe700[_0xd76c91];return _0x245e91;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var logger=require(_0x0e70('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0e70('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e70('0x4'));var rimraf=require(_0x0e70('0x5'));var config=require(_0x0e70('0x6'));var attributes=require(_0x0e70('0x7'));module[_0x0e70('0x8')]=function(_0x5210af,_0x11188f){return _0x5210af[_0x0e70('0x9')](_0x0e70('0xa'),attributes,{'tableName':_0x0e70('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb3c=['ChatProactiveAction','chat_proactive_actions','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x348cac,_0x2758d2){var _0x5b139a=function(_0x4ef0e1){while(--_0x4ef0e1){_0x348cac['push'](_0x348cac['shift']());}};_0x5b139a(++_0x2758d2);}(_0xfb3c,0x1c9));var _0xcfb3=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfb3c[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xcfb3('0x0'));var util=require(_0xcfb3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcfb3('0x2'));var BPromise=require(_0xcfb3('0x3'));var rp=require(_0xcfb3('0x4'));var fs=require('fs');var path=require(_0xcfb3('0x5'));var rimraf=require(_0xcfb3('0x6'));var config=require(_0xcfb3('0x7'));var attributes=require(_0xcfb3('0x8'));module[_0xcfb3('0x9')]=function(_0x174208,_0x893b3){return _0x174208[_0xcfb3('0xa')](_0xcfb3('0xb'),attributes,{'tableName':_0xcfb3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 0bdd05e..86a3145 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ad4=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x4ad4,0xb4));var _0x44ad=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x4ad4[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x44ad('0x0'));var moment=require(_0x44ad('0x1'));var BPromise=require(_0x44ad('0x2'));var rs=require(_0x44ad('0x3'));var fs=require('fs');var Redis=require(_0x44ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x44ad('0x5'));var logger=require(_0x44ad('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x44ad('0x7'));var client=jayson['client'][_0x44ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a6602,_0x4fa4cb,_0x3f5938){return new BPromise(function(_0x1d234d,_0x1ed16a){return client['request'](_0x1a6602,_0x3f5938)[_0x44ad('0x9')](function(_0x442cff){logger['info'](_0x44ad('0xa'),_0x4fa4cb,'request\x20sent');logger[_0x44ad('0xb')](_0x44ad('0xc'),_0x4fa4cb,_0x44ad('0xd'),JSON[_0x44ad('0xe')](_0x442cff));if(_0x442cff[_0x44ad('0xf')]){if(_0x442cff[_0x44ad('0xf')][_0x44ad('0x10')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4fa4cb,_0x442cff[_0x44ad('0xf')][_0x44ad('0x11')]);return _0x1ed16a(_0x442cff[_0x44ad('0xf')]['message']);}logger['error'](_0x44ad('0xa'),_0x4fa4cb,_0x442cff[_0x44ad('0xf')]['message']);return _0x1d234d(_0x442cff[_0x44ad('0xf')][_0x44ad('0x11')]);}else{logger[_0x44ad('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x4fa4cb,_0x44ad('0xd'));_0x1d234d(_0x442cff[_0x44ad('0x13')][_0x44ad('0x11')]);}})['catch'](function(_0x29afbb){logger[_0x44ad('0xf')](_0x44ad('0xa'),_0x4fa4cb,_0x29afbb);_0x1ed16a(_0x29afbb);});});}
\ No newline at end of file
+var _0xe193=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x154dd2,_0x2b9849){var _0x3ec877=function(_0x40db1c){while(--_0x40db1c){_0x154dd2['push'](_0x154dd2['shift']());}};_0x3ec877(++_0x2b9849);}(_0xe193,0x1e5));var _0x3e19=function(_0x5ad5c6,_0x3ae098){_0x5ad5c6=_0x5ad5c6-0x0;var _0xda0deb=_0xe193[_0x5ad5c6];return _0xda0deb;};'use strict';var _=require(_0x3e19('0x0'));var util=require(_0x3e19('0x1'));var moment=require(_0x3e19('0x2'));var BPromise=require(_0x3e19('0x3'));var rs=require(_0x3e19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e19('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3e19('0x6'));var config=require(_0x3e19('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3e19('0x8')][_0x3e19('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9684e9,_0x1eb784,_0x2a2cc1){return new BPromise(function(_0x4f24c4,_0x59736f){return client[_0x3e19('0xa')](_0x9684e9,_0x2a2cc1)[_0x3e19('0xb')](function(_0xec5324){logger[_0x3e19('0xc')](_0x3e19('0xd'),_0x1eb784,'request\x20sent');logger[_0x3e19('0xe')](_0x3e19('0xf'),_0x1eb784,'request\x20sent',JSON[_0x3e19('0x10')](_0xec5324));if(_0xec5324[_0x3e19('0x11')]){if(_0xec5324['error'][_0x3e19('0x12')]===0x1f4){logger[_0x3e19('0x11')](_0x3e19('0xd'),_0x1eb784,_0xec5324[_0x3e19('0x11')][_0x3e19('0x13')]);return _0x59736f(_0xec5324[_0x3e19('0x11')][_0x3e19('0x13')]);}logger[_0x3e19('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1eb784,_0xec5324['error'][_0x3e19('0x13')]);return _0x4f24c4(_0xec5324['error'][_0x3e19('0x13')]);}else{logger[_0x3e19('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x1eb784,_0x3e19('0x14'));_0x4f24c4(_0xec5324['result'][_0x3e19('0x13')]);}})[_0x3e19('0x15')](function(_0x31da5e){logger[_0x3e19('0x11')](_0x3e19('0xd'),_0x1eb784,_0x31da5e);_0x59736f(_0x31da5e);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 208371b..3660300 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x1e2343,_0x47bf9f){var _0x19c248=function(_0x1346d9){while(--_0x1346d9){_0x1e2343['push'](_0x1e2343['shift']());}};_0x19c248(++_0x47bf9f);}(_0x814b,0x1a2));var _0xb814=function(_0x189d3c,_0x5efebf){_0x189d3c=_0x189d3c-0x0;var _0x485959=_0x814b[_0x189d3c];return _0x485959;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')](_0xb814('0xb'),auth['isAuthenticated'](),controller[_0xb814('0xc')]);router[_0xb814('0xd')]('/',auth['isAuthenticated'](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router;
\ No newline at end of file
+var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xb138,0x1dd));var _0x8b13=function(_0x2083d3,_0x2983bc){_0x2083d3=_0x2083d3-0x0;var _0x5b5591=_0xb138[_0x2083d3];return _0x5b5591;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 9281d71..a2de393 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x71a6=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x3ab313,_0x4d6b91){var _0x52e13f=function(_0x3e20e9){while(--_0x3e20e9){_0x3ab313['push'](_0x3ab313['shift']());}};_0x52e13f(++_0x4d6b91);}(_0x71a6,0x10e));var _0x671a=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0x71a6[_0x380af2];return _0x1789dc;};'use strict';var Sequelize=require('sequelize');module[_0x671a('0x0')]={'name':{'type':Sequelize[_0x671a('0x1')],'unique':_0x671a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x671a('0x1')]},'timeout':{'type':Sequelize[_0x671a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x671a('0x4')](_0x671a('0x5'),_0x671a('0x6'),_0x671a('0x7'))}};
\ No newline at end of file
+var _0x8e6e=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x8e6e,0x10b));var _0xe8e6=function(_0x58a058,_0x5965eb){_0x58a058=_0x58a058-0x0;var _0x347664=_0x8e6e[_0x58a058];return _0x347664;};'use strict';var Sequelize=require(_0xe8e6('0x0'));module[_0xe8e6('0x1')]={'name':{'type':Sequelize[_0xe8e6('0x2')],'unique':_0xe8e6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe8e6('0x4')](_0xe8e6('0x5'),_0xe8e6('0x6'),_0xe8e6('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index fa6ed34..1aa52df 100644
--- a/server/api/chatQueue/chatQueue.controller.js
+++ b/server/api/chatQueue/chatQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd35e=['userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','value','removeAgents','forEach','addAgents','spread','isArray','userChatQueue:remove','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','UserProfileResource','destroy','stack','name','index','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','catch','show','params','model','filters','intersection','attributes','fields','length','includeAll','merge','create','get','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','keys','UserChatQueue','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','map','options','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','getTeams','findOne','Team','order','ids','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','emit'];(function(_0x510bd8,_0x46c1e6){var _0xcd6e09=function(_0x4adabe){while(--_0x4adabe){_0x510bd8['push'](_0x510bd8['shift']());}};_0xcd6e09(++_0x46c1e6);}(_0xd35e,0x17e));var _0xed35=function(_0x49d48d,_0xf1fdaa){_0x49d48d=_0x49d48d-0x0;var _0x46e093=_0xd35e[_0x49d48d];return _0x46e093;};'use strict';var BPromise=require('bluebird');var util=require(_0xed35('0x0'));var _=require(_0xed35('0x1'));var squel=require(_0xed35('0x2'));var Redis=require(_0xed35('0x3'));var qs=require(_0xed35('0x4'));var logger=require(_0xed35('0x5'))('api');var config=require(_0xed35('0x6'));var db=require('../../mysqldb')['db'];config[_0xed35('0x7')]=_[_0xed35('0x8')](config[_0xed35('0x7')],{'host':_0xed35('0x9'),'port':0x18eb});var socket=require(_0xed35('0xa'))(new Redis(config[_0xed35('0x7')]));require(_0xed35('0xb'))[_0xed35('0xc')](socket);function respondWithStatusCode(_0x5f387d,_0x297a68){_0x297a68=_0x297a68||0xcc;return function(_0x30e0ad){if(_0x30e0ad){return _0x5f387d[_0xed35('0xd')](_0x297a68);}return _0x5f387d[_0xed35('0xe')](_0x297a68)['end']();};}function respondWithResult(_0x1a66b9,_0x57e36a){_0x57e36a=_0x57e36a||0xc8;return function(_0x2337c9){if(_0x2337c9){return _0x1a66b9[_0xed35('0xe')](_0x57e36a)[_0xed35('0xf')](_0x2337c9);}};}function respondWithFilteredResult(_0x334059,_0x54acfe){return function(_0x42c087){if(_0x42c087){var _0x5818b8=typeof _0x54acfe['offset']===_0xed35('0x10')&&typeof _0x54acfe[_0xed35('0x11')]===_0xed35('0x10');var _0x9f5209=_0x42c087[_0xed35('0x12')];var _0x24b36d=_0x5818b8?0x0:_0x54acfe[_0xed35('0x13')];var _0x496021=_0x5818b8?_0x42c087[_0xed35('0x12')]:_0x54acfe[_0xed35('0x13')]+_0x54acfe['limit'];var _0xfe4249;if(_0x496021>=_0x9f5209){_0x496021=_0x9f5209;_0xfe4249=0xc8;}else{_0xfe4249=0xce;}_0x334059[_0xed35('0xe')](_0xfe4249);return _0x334059[_0xed35('0x14')](_0xed35('0x15'),_0x24b36d+'-'+_0x496021+'/'+_0x9f5209)['json'](_0x42c087);}return null;};}function saveUpdates(_0x7f651e){return function(_0x29f9a0){if(_0x29f9a0){return _0x29f9a0[_0xed35('0x16')](_0x7f651e)[_0xed35('0x17')](function(_0x52b4a6){return _0x52b4a6;});}return null;};}function removeEntity(_0x36cec5){return function(_0x18c61e){if(_0x18c61e){return _0x18c61e['destroy']()[_0xed35('0x17')](function(){var _0x54b4cc=_0x18c61e['get']({'plain':!![]});var _0x2321f5='ChatQueues';return db[_0xed35('0x18')][_0xed35('0x19')]({'where':{'type':_0x2321f5,'resourceId':_0x54b4cc['id']}})['then'](function(){return _0x18c61e;});})[_0xed35('0x17')](function(){_0x36cec5[_0xed35('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x474e2f){return function(_0x594af3){if(!_0x594af3){_0x474e2f[_0xed35('0xd')](0x194);}return _0x594af3;};}function handleError(_0x5d19a9,_0x3a4b82){_0x3a4b82=_0x3a4b82||0x1f4;return function(_0x31accf){logger['error'](_0x31accf[_0xed35('0x1a')]);if(_0x31accf['name']){delete _0x31accf[_0xed35('0x1b')];}_0x5d19a9[_0xed35('0xe')](_0x3a4b82)['send'](_0x31accf);};}exports[_0xed35('0x1c')]=function(_0x4c30cd,_0x5156b2){var _0x2170c3={};var _0x2edd46={'count':0x0,'rows':[]};var _0x5992b4=_['map'](db[_0xed35('0x1d')][_0xed35('0x1e')],function(_0x1ccc0e){return{'name':_0x1ccc0e[_0xed35('0x1f')],'type':_0x1ccc0e[_0xed35('0x20')][_0xed35('0x21')]};});_0x2170c3=qs[_0xed35('0x22')](_0x5992b4,_0x4c30cd);var _0x301bdb={'where':_0x2170c3[_0xed35('0x23')]};return db[_0xed35('0x1d')][_0xed35('0x12')](_0x301bdb)[_0xed35('0x17')](function(_0x1d1427){_0x2edd46[_0xed35('0x12')]=_0x1d1427;_0x2170c3[_0xed35('0x24')]=qs['include'](_0x4c30cd[_0xed35('0x25')]);return db[_0xed35('0x1d')]['findAll'](_0x2170c3);})[_0xed35('0x17')](function(_0x3d3c1a){_0x2edd46[_0xed35('0x26')]=_0x3d3c1a;return _0x2edd46;})['then'](respondWithFilteredResult(_0x5156b2,_0x2170c3))[_0xed35('0x27')](handleError(_0x5156b2,null));};exports[_0xed35('0x28')]=function(_0x4a2e3a,_0x3e1560){var _0x41ce87={'raw':!![],'where':{'id':_0x4a2e3a[_0xed35('0x29')]['id']}},_0x38a400={};_0x38a400[_0xed35('0x2a')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x38a400[_0xed35('0x25')]=_['keys'](_0x4a2e3a['query']);_0x38a400[_0xed35('0x2b')]=_[_0xed35('0x2c')](_0x38a400[_0xed35('0x2a')],_0x38a400[_0xed35('0x25')]);_0x41ce87[_0xed35('0x2d')]=_[_0xed35('0x2c')](_0x38a400['model'],qs['fields'](_0x4a2e3a['query'][_0xed35('0x2e')]));_0x41ce87[_0xed35('0x2d')]=_0x41ce87[_0xed35('0x2d')][_0xed35('0x2f')]?_0x41ce87[_0xed35('0x2d')]:_0x38a400[_0xed35('0x2a')];if(_0x4a2e3a[_0xed35('0x25')][_0xed35('0x30')]){_0x41ce87['include']=[{'all':!![]}];}_0x41ce87=_[_0xed35('0x31')]({},_0x41ce87,_0x4a2e3a['options']);return db[_0xed35('0x1d')]['find'](_0x41ce87)[_0xed35('0x17')](handleEntityNotFound(_0x3e1560,null))[_0xed35('0x17')](respondWithResult(_0x3e1560,null))[_0xed35('0x27')](handleError(_0x3e1560,null));};exports[_0xed35('0x32')]=function(_0xb779c9,_0x14c2a1){return db[_0xed35('0x1d')][_0xed35('0x32')](_0xb779c9['body'],{})['then'](function(_0x55c303){var _0x3885d8=_0xb779c9['user'][_0xed35('0x33')]({'plain':!![]});if(!_0x3885d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3885d8[_0xed35('0x34')]===_0xed35('0x35')){var _0x4ea937=_0x55c303[_0xed35('0x33')]({'plain':!![]});var _0x45750d=_0xed35('0x36');return db[_0xed35('0x37')]['find']({'where':{'name':_0x45750d,'userProfileId':_0x3885d8[_0xed35('0x38')]},'raw':!![]})['then'](function(_0x1205a8){if(_0x1205a8&&_0x1205a8[_0xed35('0x39')]===0x0){return db['UserProfileResource'][_0xed35('0x32')]({'name':_0x4ea937[_0xed35('0x1b')],'resourceId':_0x4ea937['id'],'type':_0x1205a8['name'],'sectionId':_0x1205a8['id']},{})[_0xed35('0x17')](function(){return _0x55c303;});}else{return _0x55c303;}})[_0xed35('0x27')](function(_0x5e5d43){logger['error'](_0xed35('0x3a'),_0x5e5d43);throw _0x5e5d43;});}return _0x55c303;})[_0xed35('0x17')](respondWithResult(_0x14c2a1,0xc9))[_0xed35('0x27')](handleError(_0x14c2a1,null));};exports[_0xed35('0x16')]=function(_0x3a00de,_0x1e103e){if(_0x3a00de[_0xed35('0x3b')]['id']){delete _0x3a00de[_0xed35('0x3b')]['id'];}return db[_0xed35('0x1d')][_0xed35('0x3c')]({'where':{'id':_0x3a00de['params']['id']}})['then'](handleEntityNotFound(_0x1e103e,null))[_0xed35('0x17')](saveUpdates(_0x3a00de[_0xed35('0x3b')],null))[_0xed35('0x17')](respondWithResult(_0x1e103e,null))[_0xed35('0x27')](handleError(_0x1e103e,null));};exports[_0xed35('0x19')]=function(_0x3ee5d1,_0x358066){return db[_0xed35('0x1d')][_0xed35('0x3c')]({'where':{'id':_0x3ee5d1[_0xed35('0x29')]['id']}})['then'](handleEntityNotFound(_0x358066,null))['then'](removeEntity(_0x358066,null))[_0xed35('0x27')](handleError(_0x358066,null));};exports['describe']=function(_0x29563d,_0x4fff9b){return db[_0xed35('0x1d')][_0xed35('0x3d')]()[_0xed35('0x17')](respondWithResult(_0x4fff9b,null))[_0xed35('0x27')](handleError(_0x4fff9b,null));};exports[_0xed35('0x3e')]=function(_0xb70763,_0x34d9f7){var _0x42b777={'raw':!![],'where':{}},_0x52d589={},_0x574819;return db[_0xed35('0x1d')]['findOne']({'where':{'id':_0xb70763[_0xed35('0x29')]['id']}})[_0xed35('0x17')](handleEntityNotFound(_0x34d9f7,null))[_0xed35('0x17')](function(_0x4263a3){if(_0x4263a3){_0x574819=_0x4263a3['get']({'plain':!![]});_0x52d589['model']=_[_0xed35('0x3f')](db[_0xed35('0x40')][_0xed35('0x1e')]);_0x52d589[_0xed35('0x25')]=_[_0xed35('0x3f')](_0xb70763['query']);_0x52d589[_0xed35('0x2b')]=_[_0xed35('0x2c')](_0x52d589[_0xed35('0x2a')],_0x52d589[_0xed35('0x25')]);_0x42b777[_0xed35('0x2d')]=_['intersection'](_0x52d589['model'],qs[_0xed35('0x2e')](_0xb70763[_0xed35('0x25')][_0xed35('0x2e')]));_0x42b777['attributes']=_0x42b777[_0xed35('0x2d')][_0xed35('0x2f')]?_0x42b777[_0xed35('0x2d')]:_0x52d589[_0xed35('0x2a')];if(!_0xb70763[_0xed35('0x25')][_0xed35('0x41')](_0xed35('0x42'))){_0x42b777[_0xed35('0x11')]=qs[_0xed35('0x11')](_0xb70763[_0xed35('0x25')][_0xed35('0x11')]);_0x42b777['offset']=qs['offset'](_0xb70763[_0xed35('0x25')]['offset']);}_0x42b777['order']=qs[_0xed35('0x43')](_0xb70763[_0xed35('0x25')][_0xed35('0x43')]);_0x42b777['where']=qs[_0xed35('0x2b')](_[_0xed35('0x44')](_0xb70763[_0xed35('0x25')],_0x52d589[_0xed35('0x2b')]));_0x42b777[_0xed35('0x23')][_0xed35('0x45')]=_0x4263a3['id'];if(_0xb70763[_0xed35('0x25')][_0xed35('0x46')]){_0x42b777['where']=_[_0xed35('0x31')](_0x42b777[_0xed35('0x23')],{'$or':_[_0xed35('0x47')](_0x42b777['attributes'],function(_0x10a8fb){var _0x111ac4={};_0x111ac4[_0x10a8fb]={'$like':'%'+_0xb70763[_0xed35('0x25')][_0xed35('0x46')]+'%'};return _0x111ac4;})});}_0x42b777=_['merge']({},_0x42b777,_0xb70763[_0xed35('0x48')]);return db['UserChatQueue'][_0xed35('0x49')](_0x42b777);}})[_0xed35('0x17')](function(_0x1a35ac){if(_0x1a35ac){return db[_0xed35('0x4a')]['findAndCountAll']({'where':{'id':_['map'](_0x1a35ac,_0xed35('0x4b')),'role':_0xed35('0x4c')},'attributes':['id','name',_0xed35('0x4d'),_0xed35('0x4e'),_0xed35('0x4f')]});}})[_0xed35('0x17')](function(_0x2d9699){if(_0x2d9699){return{'count':_0x2d9699[_0xed35('0x12')],'rows':_[_0xed35('0x47')](_0x2d9699[_0xed35('0x26')],function(_0x2fd9ec){return{'membername':_0x2fd9ec[_0xed35('0x1b')],'UserId':_0x2fd9ec['id'],'queue_name':_0x574819[_0xed35('0x1b')],'ChatQueueId':_0x574819['id'],'interface':util['format'](_0xed35('0x50'),'SIP',_0x2fd9ec[_0xed35('0x1b')]),'penalty':0x0,'paused':_0x2fd9ec[_0xed35('0x4d')],'createdAt':_0x2fd9ec[_0xed35('0x4f')],'updatedAt':_0x2fd9ec[_0xed35('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xed35('0x17')](respondWithFilteredResult(_0x34d9f7,_0x42b777))[_0xed35('0x27')](handleError(_0x34d9f7,null));};exports[_0xed35('0x51')]=function(_0xcb7fae,_0x11df9b){var _0x75782={};var _0x5d99f0={};var _0x1e2db8;var _0x430020;return db[_0xed35('0x1d')][_0xed35('0x52')]({'where':{'id':_0xcb7fae[_0xed35('0x29')]['id']}})[_0xed35('0x17')](handleEntityNotFound(_0x11df9b,null))['then'](function(_0x17b984){if(_0x17b984){_0x1e2db8=_0x17b984;_0x5d99f0[_0xed35('0x2a')]=_['keys'](db[_0xed35('0x53')][_0xed35('0x1e')]);_0x5d99f0[_0xed35('0x25')]=_[_0xed35('0x3f')](_0xcb7fae[_0xed35('0x25')]);_0x5d99f0[_0xed35('0x2b')]=_[_0xed35('0x2c')](_0x5d99f0['model'],_0x5d99f0['query']);_0x75782[_0xed35('0x2d')]=_['intersection'](_0x5d99f0[_0xed35('0x2a')],qs[_0xed35('0x2e')](_0xcb7fae['query'][_0xed35('0x2e')]));_0x75782[_0xed35('0x2d')]=_0x75782[_0xed35('0x2d')][_0xed35('0x2f')]?_0x75782['attributes']:_0x5d99f0[_0xed35('0x2a')];_0x75782[_0xed35('0x54')]=qs[_0xed35('0x43')](_0xcb7fae[_0xed35('0x25')][_0xed35('0x43')]);_0x75782[_0xed35('0x23')]=qs[_0xed35('0x2b')](_[_0xed35('0x44')](_0xcb7fae[_0xed35('0x25')],_0x5d99f0[_0xed35('0x2b')]));if(_0xcb7fae[_0xed35('0x25')][_0xed35('0x46')]){_0x75782[_0xed35('0x23')]=_[_0xed35('0x31')](_0x75782[_0xed35('0x23')],{'$or':_[_0xed35('0x47')](_0x75782[_0xed35('0x2d')],function(_0x1ea043){var _0x6a3cb5={};_0x6a3cb5[_0x1ea043]={'$like':'%'+_0xcb7fae['query'][_0xed35('0x46')]+'%'};return _0x6a3cb5;})});}_0x75782=_[_0xed35('0x31')]({},_0x75782,_0xcb7fae[_0xed35('0x48')]);return _0x1e2db8[_0xed35('0x51')](_0x75782);}})[_0xed35('0x17')](function(_0x3cdbb7){if(_0x3cdbb7){_0x430020=_0x3cdbb7['length'];if(!_0xcb7fae['query'][_0xed35('0x41')](_0xed35('0x42'))){_0x75782[_0xed35('0x11')]=qs[_0xed35('0x11')](_0xcb7fae['query'][_0xed35('0x11')]);_0x75782[_0xed35('0x13')]=qs[_0xed35('0x13')](_0xcb7fae[_0xed35('0x25')][_0xed35('0x13')]);}return _0x1e2db8[_0xed35('0x51')](_0x75782);}})[_0xed35('0x17')](function(_0x30e243){if(_0x30e243){return _0x30e243?{'count':_0x430020,'rows':_0x30e243}:null;}})[_0xed35('0x17')](respondWithResult(_0x11df9b,null))[_0xed35('0x27')](handleError(_0x11df9b,null));};exports['addTeams']=function(_0x3ca422,_0x57ae88){var _0x153923=_0x3ca422[_0xed35('0x3b')][_0xed35('0x55')];return db[_0xed35('0x53')][_0xed35('0x49')]({'where':{'id':_0x153923},'attributes':['id'],'include':[{'model':db[_0xed35('0x4a')],'as':_0xed35('0x56'),'attributes':['id',_0xed35('0x1b'),_0xed35('0x57'),_0xed35('0x58'),'interface'],'raw':!![]}]})['then'](function(_0x32fa1e){if(_0x32fa1e){var _0x2a8bb2=_['flatMap'](_0x32fa1e,function(_0x527027){var _0x3a531e=_0x527027[_0xed35('0x33')]({'plain':!![]});return _0x3a531e[_0xed35('0x56')];});return db['ChatQueue'][_0xed35('0x3c')]({'where':{'id':_0x3ca422[_0xed35('0x29')]['id']}})['then'](function(_0x370b2d){return db[_0xed35('0x59')][_0xed35('0x5a')](function(_0xdaf078){return _0x370b2d['addTeams'](_0x153923,{'transaction':_0xdaf078})[_0xed35('0x17')](function(){return BPromise[_0xed35('0x5b')](_0x2a8bb2,function(_0x4dff47){return db[_0xed35('0x40')][_0xed35('0x5c')]({'where':{'UserId':_0x4dff47['id'],'ChatQueueId':_0x3ca422['params']['id']},'transaction':_0xdaf078});});})[_0xed35('0x17')](function(){_0x2a8bb2['forEach'](function(_0x1b0f1e){socket[_0xed35('0x5d')](_0xed35('0x5e'),{'UserId':_0x1b0f1e['id'],'ChatQueueId':_0x370b2d['id']});});});});});}})['then'](respondWithStatusCode(_0x57ae88,null))[_0xed35('0x27')](handleError(_0x57ae88,null));};exports[_0xed35('0x5f')]=function(_0x18069f,_0x413565){return db[_0xed35('0x53')]['findAll']({'where':{'id':_0x18069f['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xed35('0x4a')],'as':_0xed35('0x56'),'attributes':['id'],'raw':!![]}]})[_0xed35('0x17')](handleEntityNotFound(_0x413565,null))['then'](function(_0x134818){var _0x47c2b1=_[_0xed35('0x47')](_0x134818,'id');var _0x14a1df=[];var _0x29f54f=[];var _0x32246c=squel[_0xed35('0x60')]();_0x32246c[_0xed35('0x61')](_0xed35('0x62'))['from'](_0xed35('0x63'),'tq')['join']('user_has_teams','ut',_0xed35('0x64'))[_0xed35('0x23')](_0xed35('0x65'),_0x18069f['params']['id']);for(var _0x3fb64e=0x0;_0x3fb64e<_0x134818[_0xed35('0x2f')];_0x3fb64e+=0x1){let _0x5f2b30=_0x134818[_0x3fb64e];for(var _0x206c96=0x0;_0x206c96<_0x5f2b30[_0xed35('0x56')][_0xed35('0x2f')];_0x206c96+=0x1){let _0x7fd552=_0x5f2b30['Agents'][_0x206c96];var _0x2794ad=_0x32246c[_0xed35('0x66')]();_0x2794ad[_0xed35('0x23')](_0xed35('0x67'),_0x7fd552['id']);_0x29f54f[_0xed35('0x68')](db[_0xed35('0x59')][_0xed35('0x25')](_0x2794ad[_0xed35('0x69')](),{'type':db[_0xed35('0x59')][_0xed35('0x6a')]['SELECT']})[_0xed35('0x17')](function(_0x2f73a7){if(_0x2f73a7[_0xed35('0x2f')]===0x1){return _0x7fd552['id'];}else{var _0x38be96=_[_0xed35('0x6b')](_[_0xed35('0x47')](_0x2f73a7,_0xed35('0x6c')),function(_0xf8f4b7){return _['includes'](_0x47c2b1,_0xf8f4b7);});if(_0x38be96){return _0x7fd552['id'];}}}));}}return BPromise[_0xed35('0x6d')](_0x29f54f)['then'](function(_0x55e697){_0x14a1df=_(_0x14a1df)[_0xed35('0x6e')](_0x55e697)['compact']()[_0xed35('0x6f')]();return db[_0xed35('0x1d')][_0xed35('0x3c')]({'where':{'id':_0x18069f['params']['id']}})[_0xed35('0x17')](function(_0x2cd00a){return db['sequelize'][_0xed35('0x5a')](function(_0x5c31ce){return _0x2cd00a[_0xed35('0x5f')](_0x18069f['query'][_0xed35('0x55')],{'transaction':_0x5c31ce})[_0xed35('0x17')](function(){if(!_['isEmpty'](_0x14a1df)){return _0x2cd00a[_0xed35('0x70')](_0x14a1df,{'transaction':_0x5c31ce});}})['then'](function(){_0x14a1df[_0xed35('0x71')](function(_0x3c2d8b){socket['emit']('userChatQueue:remove',{'UserId':_0x3c2d8b,'ChatQueueId':_0x2cd00a['id']});});});});});});})[_0xed35('0x17')](respondWithStatusCode(_0x413565,null))['catch'](handleError(_0x413565,null));};exports[_0xed35('0x72')]=function(_0x21a0db,_0x52acd0){return db[_0xed35('0x1d')]['find']({'where':{'id':_0x21a0db[_0xed35('0x29')]['id']}})['then'](handleEntityNotFound(_0x52acd0,null))['then'](function(_0x3dcc48){if(_0x3dcc48){return _0x3dcc48[_0xed35('0x72')](_0x21a0db[_0xed35('0x3b')][_0xed35('0x55')],_['omit'](_0x21a0db[_0xed35('0x3b')],[_0xed35('0x55'),'id'])||{})[_0xed35('0x73')](function(_0xc58052){for(var _0x448b8c=0x0;_0x448b8c<_0x21a0db[_0xed35('0x3b')][_0xed35('0x55')]['length'];_0x448b8c+=0x1){socket[_0xed35('0x5d')](_0xed35('0x5e'),{'UserId':Number(_0x21a0db[_0xed35('0x3b')][_0xed35('0x55')][_0x448b8c]),'ChatQueueId':Number(_0x21a0db['params']['id'])});}return _0xc58052;});}})['then'](respondWithResult(_0x52acd0,null))['catch'](handleError(_0x52acd0,null));};exports[_0xed35('0x70')]=function(_0x3f83f1,_0x250106){return db[_0xed35('0x1d')][_0xed35('0x3c')]({'where':{'id':_0x3f83f1[_0xed35('0x29')]['id']}})['then'](handleEntityNotFound(_0x250106,null))[_0xed35('0x17')](function(_0x5d407d){if(_0x5d407d){return _0x5d407d['removeAgents'](_0x3f83f1['query'][_0xed35('0x55')])[_0xed35('0x17')](function(){if(_[_0xed35('0x74')](_0x3f83f1[_0xed35('0x25')][_0xed35('0x55')])){for(var _0x3596a0=0x0;_0x3596a0<_0x3f83f1['query'][_0xed35('0x55')]['length'];_0x3596a0+=0x1){socket[_0xed35('0x5d')](_0xed35('0x75'),{'UserId':Number(_0x3f83f1['query']['ids'][_0x3596a0]),'ChatQueueId':Number(_0x3f83f1[_0xed35('0x29')]['id'])});}}else{socket[_0xed35('0x5d')](_0xed35('0x75'),{'UserId':Number(_0x3f83f1[_0xed35('0x25')][_0xed35('0x55')]),'ChatQueueId':Number(_0x3f83f1[_0xed35('0x29')]['id'])});}});}})[_0xed35('0x17')](respondWithStatusCode(_0x250106,null))[_0xed35('0x27')](handleError(_0x250106,null));};exports[_0xed35('0x76')]=function(_0x517e9a,_0x190e62){var _0x3ed7d3={};var _0x1a5a31={};var _0x1c7c55;var _0x1e4481;return db[_0xed35('0x1d')][_0xed35('0x52')]({'where':{'id':_0x517e9a['params']['id']}})[_0xed35('0x17')](handleEntityNotFound(_0x190e62,null))['then'](function(_0x1f014b){if(_0x1f014b){_0x1c7c55=_0x1f014b;_0x1a5a31[_0xed35('0x2a')]=_[_0xed35('0x3f')](db[_0xed35('0x4a')][_0xed35('0x1e')]);_0x1a5a31[_0xed35('0x25')]=_[_0xed35('0x3f')](_0x517e9a[_0xed35('0x25')]);_0x1a5a31['filters']=_['intersection'](_0x1a5a31[_0xed35('0x2a')],_0x1a5a31[_0xed35('0x25')]);_0x3ed7d3[_0xed35('0x2d')]=_[_0xed35('0x2c')](_0x1a5a31[_0xed35('0x2a')],qs[_0xed35('0x2e')](_0x517e9a[_0xed35('0x25')][_0xed35('0x2e')]));_0x3ed7d3['attributes']=_0x3ed7d3['attributes'][_0xed35('0x2f')]?_0x3ed7d3[_0xed35('0x2d')]:_0x1a5a31[_0xed35('0x2a')];_0x3ed7d3['order']=qs['sort'](_0x517e9a['query'][_0xed35('0x43')]);_0x3ed7d3[_0xed35('0x23')]=qs['filters'](_[_0xed35('0x44')](_0x517e9a['query'],_0x1a5a31[_0xed35('0x2b')]));if(_0x517e9a['query'][_0xed35('0x46')]){_0x3ed7d3[_0xed35('0x23')]=_['merge'](_0x3ed7d3['where'],{'$or':_['map'](_0x3ed7d3[_0xed35('0x2d')],function(_0x2ef8b5){var _0x1c3893={};_0x1c3893[_0x2ef8b5]={'$like':'%'+_0x517e9a[_0xed35('0x25')][_0xed35('0x46')]+'%'};return _0x1c3893;})});}_0x3ed7d3=_[_0xed35('0x31')]({},_0x3ed7d3,_0x517e9a[_0xed35('0x48')]);return _0x1c7c55['getAgents'](_0x3ed7d3);}})[_0xed35('0x17')](function(_0x517e14){if(_0x517e14){_0x1e4481=_0x517e14[_0xed35('0x2f')];if(!_0x517e9a['query'][_0xed35('0x41')](_0xed35('0x42'))){_0x3ed7d3['limit']=qs[_0xed35('0x11')](_0x517e9a[_0xed35('0x25')][_0xed35('0x11')]);_0x3ed7d3[_0xed35('0x13')]=qs[_0xed35('0x13')](_0x517e9a[_0xed35('0x25')][_0xed35('0x13')]);}return _0x1c7c55[_0xed35('0x76')](_0x3ed7d3);}})[_0xed35('0x17')](function(_0x5a5ede){if(_0x5a5ede){return _0x5a5ede?{'count':_0x1e4481,'rows':_0x5a5ede}:null;}})['then'](respondWithResult(_0x190e62,null))[_0xed35('0x27')](handleError(_0x190e62,null));};
\ No newline at end of file
+var _0x5906=['status','end','json','undefined','count','offset','limit','Content-Range','update','then','destroy','get','ChatQueues','error','stack','send','index','map','ChatQueue','rawAttributes','fieldName','type','getOptions','include','query','rows','catch','params','keys','filters','model','attributes','fields','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','intersection','nolimit','order','sort','where','pick','ChatQueueId','filter','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:remove','getAgents','hasOwnProperty','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus'];(function(_0x5e8897,_0x299e79){var _0x271b50=function(_0x74267a){while(--_0x74267a){_0x5e8897['push'](_0x5e8897['shift']());}};_0x271b50(++_0x299e79);}(_0x5906,0x162));var _0x6590=function(_0x3fed18,_0x5cd50d){_0x3fed18=_0x3fed18-0x0;var _0x1b9e1d=_0x5906[_0x3fed18];return _0x1b9e1d;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0x6590('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x6590('0x1'))(_0x6590('0x2'));var config=require(_0x6590('0x3'));var db=require(_0x6590('0x4'))['db'];config[_0x6590('0x5')]=_[_0x6590('0x6')](config[_0x6590('0x5')],{'host':_0x6590('0x7'),'port':0x18eb});var socket=require(_0x6590('0x8'))(new Redis(config[_0x6590('0x5')]));require(_0x6590('0x9'))[_0x6590('0xa')](socket);function respondWithStatusCode(_0x385817,_0x3392cb){_0x3392cb=_0x3392cb||0xcc;return function(_0x17abd6){if(_0x17abd6){return _0x385817[_0x6590('0xb')](_0x3392cb);}return _0x385817[_0x6590('0xc')](_0x3392cb)[_0x6590('0xd')]();};}function respondWithResult(_0x241224,_0x44f300){_0x44f300=_0x44f300||0xc8;return function(_0x5ac623){if(_0x5ac623){return _0x241224[_0x6590('0xc')](_0x44f300)[_0x6590('0xe')](_0x5ac623);}};}function respondWithFilteredResult(_0x1d30e4,_0x3dd8cf){return function(_0x1fd720){if(_0x1fd720){var _0x3df1be=typeof _0x3dd8cf['offset']===_0x6590('0xf')&&typeof _0x3dd8cf['limit']===_0x6590('0xf');var _0x282776=_0x1fd720[_0x6590('0x10')];var _0x5739e3=_0x3df1be?0x0:_0x3dd8cf[_0x6590('0x11')];var _0x3da431=_0x3df1be?_0x1fd720['count']:_0x3dd8cf[_0x6590('0x11')]+_0x3dd8cf[_0x6590('0x12')];var _0x4317c3;if(_0x3da431>=_0x282776){_0x3da431=_0x282776;_0x4317c3=0xc8;}else{_0x4317c3=0xce;}_0x1d30e4[_0x6590('0xc')](_0x4317c3);return _0x1d30e4['set'](_0x6590('0x13'),_0x5739e3+'-'+_0x3da431+'/'+_0x282776)[_0x6590('0xe')](_0x1fd720);}return null;};}function saveUpdates(_0x314110){return function(_0x44f760){if(_0x44f760){return _0x44f760[_0x6590('0x14')](_0x314110)[_0x6590('0x15')](function(_0x34cc9b){return _0x34cc9b;});}return null;};}function removeEntity(_0x38ff2e){return function(_0x2483db){if(_0x2483db){return _0x2483db[_0x6590('0x16')]()['then'](function(){var _0x4ac289=_0x2483db[_0x6590('0x17')]({'plain':!![]});var _0x484804=_0x6590('0x18');return db['UserProfileResource'][_0x6590('0x16')]({'where':{'type':_0x484804,'resourceId':_0x4ac289['id']}})[_0x6590('0x15')](function(){return _0x2483db;});})[_0x6590('0x15')](function(){_0x38ff2e[_0x6590('0xc')](0xcc)[_0x6590('0xd')]();});}};}function handleEntityNotFound(_0x4669da){return function(_0x5a7191){if(!_0x5a7191){_0x4669da[_0x6590('0xb')](0x194);}return _0x5a7191;};}function handleError(_0x2e2c2c,_0x154b1d){_0x154b1d=_0x154b1d||0x1f4;return function(_0x273c76){logger[_0x6590('0x19')](_0x273c76[_0x6590('0x1a')]);if(_0x273c76['name']){delete _0x273c76['name'];}_0x2e2c2c[_0x6590('0xc')](_0x154b1d)[_0x6590('0x1b')](_0x273c76);};}exports[_0x6590('0x1c')]=function(_0x5e359d,_0x5c1b81){var _0x5c8218={};var _0x4346ab={'count':0x0,'rows':[]};var _0x50b437=_[_0x6590('0x1d')](db[_0x6590('0x1e')][_0x6590('0x1f')],function(_0x44198b){return{'name':_0x44198b[_0x6590('0x20')],'type':_0x44198b[_0x6590('0x21')]['key']};});_0x5c8218=qs[_0x6590('0x22')](_0x50b437,_0x5e359d);var _0x841688={'where':_0x5c8218['where']};return db[_0x6590('0x1e')][_0x6590('0x10')](_0x841688)[_0x6590('0x15')](function(_0x65b5b7){_0x4346ab[_0x6590('0x10')]=_0x65b5b7;_0x5c8218[_0x6590('0x23')]=qs['include'](_0x5e359d[_0x6590('0x24')]);return db['ChatQueue']['findAll'](_0x5c8218);})[_0x6590('0x15')](function(_0x1550ae){_0x4346ab[_0x6590('0x25')]=_0x1550ae;return _0x4346ab;})['then'](respondWithFilteredResult(_0x5c1b81,_0x5c8218))[_0x6590('0x26')](handleError(_0x5c1b81,null));};exports['show']=function(_0x251bb8,_0x24f1cd){var _0x7d1b0f={'raw':!![],'where':{'id':_0x251bb8[_0x6590('0x27')]['id']}},_0x1fd4b7={};_0x1fd4b7['model']=_[_0x6590('0x28')](db['ChatQueue']['rawAttributes']);_0x1fd4b7[_0x6590('0x24')]=_['keys'](_0x251bb8[_0x6590('0x24')]);_0x1fd4b7[_0x6590('0x29')]=_['intersection'](_0x1fd4b7[_0x6590('0x2a')],_0x1fd4b7[_0x6590('0x24')]);_0x7d1b0f[_0x6590('0x2b')]=_['intersection'](_0x1fd4b7['model'],qs[_0x6590('0x2c')](_0x251bb8['query'][_0x6590('0x2c')]));_0x7d1b0f['attributes']=_0x7d1b0f[_0x6590('0x2b')][_0x6590('0x2d')]?_0x7d1b0f[_0x6590('0x2b')]:_0x1fd4b7[_0x6590('0x2a')];if(_0x251bb8['query']['includeAll']){_0x7d1b0f[_0x6590('0x23')]=[{'all':!![]}];}_0x7d1b0f=_[_0x6590('0x2e')]({},_0x7d1b0f,_0x251bb8[_0x6590('0x2f')]);return db[_0x6590('0x1e')][_0x6590('0x30')](_0x7d1b0f)[_0x6590('0x15')](handleEntityNotFound(_0x24f1cd,null))['then'](respondWithResult(_0x24f1cd,null))[_0x6590('0x26')](handleError(_0x24f1cd,null));};exports[_0x6590('0x31')]=function(_0x3848fc,_0x49c7f8){return db['ChatQueue']['create'](_0x3848fc[_0x6590('0x32')],{})[_0x6590('0x15')](function(_0x1cbe39){var _0x4e8b06=_0x3848fc[_0x6590('0x33')][_0x6590('0x17')]({'plain':!![]});if(!_0x4e8b06)throw new Error(_0x6590('0x34'));if(_0x4e8b06[_0x6590('0x35')]===_0x6590('0x33')){var _0x2956b5=_0x1cbe39['get']({'plain':!![]});var _0x16b0ec=_0x6590('0x18');return db[_0x6590('0x36')][_0x6590('0x30')]({'where':{'name':_0x16b0ec,'userProfileId':_0x4e8b06[_0x6590('0x37')]},'raw':!![]})[_0x6590('0x15')](function(_0xef5cea){if(_0xef5cea&&_0xef5cea[_0x6590('0x38')]===0x0){return db[_0x6590('0x39')]['create']({'name':_0x2956b5[_0x6590('0x3a')],'resourceId':_0x2956b5['id'],'type':_0xef5cea[_0x6590('0x3a')],'sectionId':_0xef5cea['id']},{})[_0x6590('0x15')](function(){return _0x1cbe39;});}else{return _0x1cbe39;}})[_0x6590('0x26')](function(_0x237b33){logger['error'](_0x6590('0x3b'),_0x237b33);throw _0x237b33;});}return _0x1cbe39;})['then'](respondWithResult(_0x49c7f8,0xc9))[_0x6590('0x26')](handleError(_0x49c7f8,null));};exports[_0x6590('0x14')]=function(_0xb55e3a,_0x42ebeb){if(_0xb55e3a[_0x6590('0x32')]['id']){delete _0xb55e3a[_0x6590('0x32')]['id'];}return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0xb55e3a[_0x6590('0x27')]['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x42ebeb,null))[_0x6590('0x15')](saveUpdates(_0xb55e3a['body'],null))[_0x6590('0x15')](respondWithResult(_0x42ebeb,null))[_0x6590('0x26')](handleError(_0x42ebeb,null));};exports[_0x6590('0x16')]=function(_0x946426,_0x4164fb){return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0x946426[_0x6590('0x27')]['id']}})['then'](handleEntityNotFound(_0x4164fb,null))[_0x6590('0x15')](removeEntity(_0x4164fb,null))['catch'](handleError(_0x4164fb,null));};exports[_0x6590('0x3c')]=function(_0x3dcc64,_0x5d2bf9){return db[_0x6590('0x1e')][_0x6590('0x3c')]()[_0x6590('0x15')](respondWithResult(_0x5d2bf9,null))['catch'](handleError(_0x5d2bf9,null));};exports['getMembers']=function(_0x172ea4,_0x120e0f){var _0x5daa0a={'raw':!![],'where':{}},_0x1a1b99={},_0x3889db;return db[_0x6590('0x1e')][_0x6590('0x3d')]({'where':{'id':_0x172ea4[_0x6590('0x27')]['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x120e0f,null))[_0x6590('0x15')](function(_0x439fd1){if(_0x439fd1){_0x3889db=_0x439fd1[_0x6590('0x17')]({'plain':!![]});_0x1a1b99[_0x6590('0x2a')]=_[_0x6590('0x28')](db[_0x6590('0x3e')]['rawAttributes']);_0x1a1b99[_0x6590('0x24')]=_[_0x6590('0x28')](_0x172ea4[_0x6590('0x24')]);_0x1a1b99['filters']=_[_0x6590('0x3f')](_0x1a1b99[_0x6590('0x2a')],_0x1a1b99['query']);_0x5daa0a[_0x6590('0x2b')]=_[_0x6590('0x3f')](_0x1a1b99[_0x6590('0x2a')],qs[_0x6590('0x2c')](_0x172ea4[_0x6590('0x24')][_0x6590('0x2c')]));_0x5daa0a[_0x6590('0x2b')]=_0x5daa0a[_0x6590('0x2b')][_0x6590('0x2d')]?_0x5daa0a['attributes']:_0x1a1b99[_0x6590('0x2a')];if(!_0x172ea4[_0x6590('0x24')]['hasOwnProperty'](_0x6590('0x40'))){_0x5daa0a['limit']=qs['limit'](_0x172ea4['query'][_0x6590('0x12')]);_0x5daa0a[_0x6590('0x11')]=qs[_0x6590('0x11')](_0x172ea4[_0x6590('0x24')][_0x6590('0x11')]);}_0x5daa0a[_0x6590('0x41')]=qs[_0x6590('0x42')](_0x172ea4['query'][_0x6590('0x42')]);_0x5daa0a[_0x6590('0x43')]=qs[_0x6590('0x29')](_[_0x6590('0x44')](_0x172ea4[_0x6590('0x24')],_0x1a1b99[_0x6590('0x29')]));_0x5daa0a[_0x6590('0x43')][_0x6590('0x45')]=_0x439fd1['id'];if(_0x172ea4[_0x6590('0x24')][_0x6590('0x46')]){_0x5daa0a[_0x6590('0x43')]=_[_0x6590('0x2e')](_0x5daa0a['where'],{'$or':_[_0x6590('0x1d')](_0x5daa0a[_0x6590('0x2b')],function(_0x4391eb){var _0x10703f={};_0x10703f[_0x4391eb]={'$like':'%'+_0x172ea4[_0x6590('0x24')][_0x6590('0x46')]+'%'};return _0x10703f;})});}_0x5daa0a=_[_0x6590('0x2e')]({},_0x5daa0a,_0x172ea4[_0x6590('0x2f')]);return db[_0x6590('0x3e')]['findAll'](_0x5daa0a);}})[_0x6590('0x15')](function(_0x2d4183){if(_0x2d4183){return db[_0x6590('0x47')][_0x6590('0x48')]({'where':{'id':_[_0x6590('0x1d')](_0x2d4183,'UserId'),'role':_0x6590('0x49')},'attributes':['id','name',_0x6590('0x4a'),_0x6590('0x4b'),_0x6590('0x4c')]});}})[_0x6590('0x15')](function(_0x332ffd){if(_0x332ffd){return{'count':_0x332ffd[_0x6590('0x10')],'rows':_[_0x6590('0x1d')](_0x332ffd['rows'],function(_0x3cc85e){return{'membername':_0x3cc85e['name'],'UserId':_0x3cc85e['id'],'queue_name':_0x3889db[_0x6590('0x3a')],'ChatQueueId':_0x3889db['id'],'interface':util[_0x6590('0x4d')](_0x6590('0x4e'),'SIP',_0x3cc85e[_0x6590('0x3a')]),'penalty':0x0,'paused':_0x3cc85e['chatPause'],'createdAt':_0x3cc85e[_0x6590('0x4c')],'updatedAt':_0x3cc85e[_0x6590('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6590('0x15')](respondWithFilteredResult(_0x120e0f,_0x5daa0a))[_0x6590('0x26')](handleError(_0x120e0f,null));};exports[_0x6590('0x4f')]=function(_0x4b9a47,_0x31c2dc){var _0x54768a={};var _0x19c5f8={};var _0x22ef9a;var _0x3500c9;return db[_0x6590('0x1e')][_0x6590('0x3d')]({'where':{'id':_0x4b9a47[_0x6590('0x27')]['id']}})['then'](handleEntityNotFound(_0x31c2dc,null))[_0x6590('0x15')](function(_0x336931){if(_0x336931){_0x22ef9a=_0x336931;_0x19c5f8[_0x6590('0x2a')]=_['keys'](db[_0x6590('0x50')][_0x6590('0x1f')]);_0x19c5f8[_0x6590('0x24')]=_[_0x6590('0x28')](_0x4b9a47[_0x6590('0x24')]);_0x19c5f8['filters']=_[_0x6590('0x3f')](_0x19c5f8[_0x6590('0x2a')],_0x19c5f8[_0x6590('0x24')]);_0x54768a['attributes']=_['intersection'](_0x19c5f8['model'],qs[_0x6590('0x2c')](_0x4b9a47[_0x6590('0x24')][_0x6590('0x2c')]));_0x54768a[_0x6590('0x2b')]=_0x54768a[_0x6590('0x2b')][_0x6590('0x2d')]?_0x54768a[_0x6590('0x2b')]:_0x19c5f8['model'];_0x54768a[_0x6590('0x41')]=qs[_0x6590('0x42')](_0x4b9a47[_0x6590('0x24')]['sort']);_0x54768a[_0x6590('0x43')]=qs[_0x6590('0x29')](_[_0x6590('0x44')](_0x4b9a47[_0x6590('0x24')],_0x19c5f8['filters']));if(_0x4b9a47[_0x6590('0x24')][_0x6590('0x46')]){_0x54768a['where']=_['merge'](_0x54768a[_0x6590('0x43')],{'$or':_[_0x6590('0x1d')](_0x54768a['attributes'],function(_0x7c38cb){var _0x2d18cb={};_0x2d18cb[_0x7c38cb]={'$like':'%'+_0x4b9a47[_0x6590('0x24')][_0x6590('0x46')]+'%'};return _0x2d18cb;})});}_0x54768a=_[_0x6590('0x2e')]({},_0x54768a,_0x4b9a47[_0x6590('0x2f')]);return _0x22ef9a[_0x6590('0x4f')](_0x54768a);}})[_0x6590('0x15')](function(_0x57d7e3){if(_0x57d7e3){_0x3500c9=_0x57d7e3[_0x6590('0x2d')];if(!_0x4b9a47[_0x6590('0x24')]['hasOwnProperty']('nolimit')){_0x54768a[_0x6590('0x12')]=qs[_0x6590('0x12')](_0x4b9a47[_0x6590('0x24')][_0x6590('0x12')]);_0x54768a[_0x6590('0x11')]=qs[_0x6590('0x11')](_0x4b9a47[_0x6590('0x24')][_0x6590('0x11')]);}return _0x22ef9a[_0x6590('0x4f')](_0x54768a);}})[_0x6590('0x15')](function(_0x54fbb6){if(_0x54fbb6){return _0x54fbb6?{'count':_0x3500c9,'rows':_0x54fbb6}:null;}})[_0x6590('0x15')](respondWithResult(_0x31c2dc,null))['catch'](handleError(_0x31c2dc,null));};exports[_0x6590('0x51')]=function(_0x4e0ece,_0x1019fe){var _0x53faa9=_0x4e0ece[_0x6590('0x32')][_0x6590('0x52')];return db[_0x6590('0x50')][_0x6590('0x53')]({'where':{'id':_0x53faa9},'attributes':['id'],'include':[{'model':db[_0x6590('0x47')],'as':_0x6590('0x54'),'attributes':['id',_0x6590('0x3a'),_0x6590('0x55'),_0x6590('0x56'),_0x6590('0x57')],'raw':!![]}]})['then'](function(_0x1cda91){if(_0x1cda91){var _0x5333f0=_['flatMap'](_0x1cda91,function(_0x7bde74){var _0x198654=_0x7bde74[_0x6590('0x17')]({'plain':!![]});return _0x198654[_0x6590('0x54')];});return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0x4e0ece[_0x6590('0x27')]['id']}})['then'](function(_0xf6d823){return db[_0x6590('0x58')][_0x6590('0x59')](function(_0x393550){return _0xf6d823[_0x6590('0x51')](_0x53faa9,{'transaction':_0x393550})[_0x6590('0x15')](function(){return BPromise[_0x6590('0x5a')](_0x5333f0,function(_0x2a8e9a){return db[_0x6590('0x3e')][_0x6590('0x5b')]({'where':{'UserId':_0x2a8e9a['id'],'ChatQueueId':_0x4e0ece[_0x6590('0x27')]['id']},'transaction':_0x393550});});})[_0x6590('0x15')](function(){_0x5333f0[_0x6590('0x5c')](function(_0x119fe6){socket[_0x6590('0x5d')](_0x6590('0x5e'),{'UserId':_0x119fe6['id'],'ChatQueueId':_0xf6d823['id']});});});});});}})[_0x6590('0x15')](respondWithStatusCode(_0x1019fe,null))[_0x6590('0x26')](handleError(_0x1019fe,null));};exports[_0x6590('0x5f')]=function(_0x5cec8e,_0x3b9b5f){return db['Team'][_0x6590('0x53')]({'where':{'id':_0x5cec8e[_0x6590('0x24')][_0x6590('0x52')]},'attributes':['id'],'include':[{'model':db[_0x6590('0x47')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6590('0x15')](handleEntityNotFound(_0x3b9b5f,null))['then'](function(_0x23b801){var _0x31296b=_[_0x6590('0x1d')](_0x23b801,'id');var _0x161306=[];var _0x38989f=[];var _0x1a6ca0=squel[_0x6590('0x60')]();_0x1a6ca0[_0x6590('0x61')](_0x6590('0x62'))['from'](_0x6590('0x63'),'tq')[_0x6590('0x64')](_0x6590('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x6590('0x66'),_0x5cec8e[_0x6590('0x27')]['id']);for(var _0x3cb3a6=0x0;_0x3cb3a6<_0x23b801[_0x6590('0x2d')];_0x3cb3a6+=0x1){let _0x561129=_0x23b801[_0x3cb3a6];for(var _0x1e41b=0x0;_0x1e41b<_0x561129['Agents'][_0x6590('0x2d')];_0x1e41b+=0x1){let _0x2837d6=_0x561129['Agents'][_0x1e41b];var _0x40545d=_0x1a6ca0[_0x6590('0x67')]();_0x40545d[_0x6590('0x43')](_0x6590('0x68'),_0x2837d6['id']);_0x38989f[_0x6590('0x69')](db[_0x6590('0x58')]['query'](_0x40545d[_0x6590('0x6a')](),{'type':db['sequelize'][_0x6590('0x6b')][_0x6590('0x6c')]})[_0x6590('0x15')](function(_0x41cda1){if(_0x41cda1[_0x6590('0x2d')]===0x1){return _0x2837d6['id'];}else{var _0x3a2285=_[_0x6590('0x6d')](_[_0x6590('0x1d')](_0x41cda1,_0x6590('0x6e')),function(_0x576da7){return _[_0x6590('0x6f')](_0x31296b,_0x576da7);});if(_0x3a2285){return _0x2837d6['id'];}}}));}}return BPromise['all'](_0x38989f)['then'](function(_0x491037){_0x161306=_(_0x161306)['union'](_0x491037)[_0x6590('0x70')]()[_0x6590('0x71')]();return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0x5cec8e[_0x6590('0x27')]['id']}})[_0x6590('0x15')](function(_0x3b8421){return db['sequelize'][_0x6590('0x59')](function(_0x19ead3){return _0x3b8421['removeTeams'](_0x5cec8e['query']['ids'],{'transaction':_0x19ead3})[_0x6590('0x15')](function(){if(!_[_0x6590('0x72')](_0x161306)){return _0x3b8421[_0x6590('0x73')](_0x161306,{'transaction':_0x19ead3});}})[_0x6590('0x15')](function(){_0x161306[_0x6590('0x5c')](function(_0x846eab){socket[_0x6590('0x5d')]('userChatQueue:remove',{'UserId':_0x846eab,'ChatQueueId':_0x3b8421['id']});});});});});});})[_0x6590('0x15')](respondWithStatusCode(_0x3b9b5f,null))[_0x6590('0x26')](handleError(_0x3b9b5f,null));};exports[_0x6590('0x74')]=function(_0x139b6a,_0x30c4dd){return db[_0x6590('0x1e')]['find']({'where':{'id':_0x139b6a[_0x6590('0x27')]['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x30c4dd,null))[_0x6590('0x15')](function(_0x473393){if(_0x473393){return _0x473393[_0x6590('0x74')](_0x139b6a['body'][_0x6590('0x52')],_[_0x6590('0x75')](_0x139b6a[_0x6590('0x32')],['ids','id'])||{})[_0x6590('0x76')](function(_0x560e54){for(var _0x2013c7=0x0;_0x2013c7<_0x139b6a[_0x6590('0x32')][_0x6590('0x52')][_0x6590('0x2d')];_0x2013c7+=0x1){socket['emit'](_0x6590('0x5e'),{'UserId':Number(_0x139b6a[_0x6590('0x32')][_0x6590('0x52')][_0x2013c7]),'ChatQueueId':Number(_0x139b6a[_0x6590('0x27')]['id'])});}return _0x560e54;});}})[_0x6590('0x15')](respondWithResult(_0x30c4dd,null))['catch'](handleError(_0x30c4dd,null));};exports[_0x6590('0x73')]=function(_0x3c3e68,_0x2574ec){return db[_0x6590('0x1e')][_0x6590('0x30')]({'where':{'id':_0x3c3e68[_0x6590('0x27')]['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x2574ec,null))[_0x6590('0x15')](function(_0x1f9947){if(_0x1f9947){return _0x1f9947[_0x6590('0x73')](_0x3c3e68[_0x6590('0x24')][_0x6590('0x52')])['then'](function(){if(_['isArray'](_0x3c3e68[_0x6590('0x24')]['ids'])){for(var _0x5dd064=0x0;_0x5dd064<_0x3c3e68[_0x6590('0x24')][_0x6590('0x52')][_0x6590('0x2d')];_0x5dd064+=0x1){socket[_0x6590('0x5d')](_0x6590('0x77'),{'UserId':Number(_0x3c3e68['query'][_0x6590('0x52')][_0x5dd064]),'ChatQueueId':Number(_0x3c3e68[_0x6590('0x27')]['id'])});}}else{socket[_0x6590('0x5d')](_0x6590('0x77'),{'UserId':Number(_0x3c3e68[_0x6590('0x24')][_0x6590('0x52')]),'ChatQueueId':Number(_0x3c3e68['params']['id'])});}});}})[_0x6590('0x15')](respondWithStatusCode(_0x2574ec,null))[_0x6590('0x26')](handleError(_0x2574ec,null));};exports[_0x6590('0x78')]=function(_0x449931,_0x3b8839){var _0x47562f={};var _0x18b747={};var _0x4cb5ef;var _0x3eb36c;return db[_0x6590('0x1e')]['findOne']({'where':{'id':_0x449931['params']['id']}})[_0x6590('0x15')](handleEntityNotFound(_0x3b8839,null))['then'](function(_0x3a731f){if(_0x3a731f){_0x4cb5ef=_0x3a731f;_0x18b747['model']=_[_0x6590('0x28')](db[_0x6590('0x47')][_0x6590('0x1f')]);_0x18b747[_0x6590('0x24')]=_[_0x6590('0x28')](_0x449931['query']);_0x18b747['filters']=_['intersection'](_0x18b747[_0x6590('0x2a')],_0x18b747[_0x6590('0x24')]);_0x47562f[_0x6590('0x2b')]=_['intersection'](_0x18b747[_0x6590('0x2a')],qs[_0x6590('0x2c')](_0x449931['query']['fields']));_0x47562f['attributes']=_0x47562f[_0x6590('0x2b')]['length']?_0x47562f[_0x6590('0x2b')]:_0x18b747['model'];_0x47562f[_0x6590('0x41')]=qs[_0x6590('0x42')](_0x449931[_0x6590('0x24')][_0x6590('0x42')]);_0x47562f[_0x6590('0x43')]=qs['filters'](_['pick'](_0x449931[_0x6590('0x24')],_0x18b747[_0x6590('0x29')]));if(_0x449931[_0x6590('0x24')][_0x6590('0x46')]){_0x47562f[_0x6590('0x43')]=_[_0x6590('0x2e')](_0x47562f[_0x6590('0x43')],{'$or':_[_0x6590('0x1d')](_0x47562f['attributes'],function(_0x368de2){var _0x1e2125={};_0x1e2125[_0x368de2]={'$like':'%'+_0x449931[_0x6590('0x24')][_0x6590('0x46')]+'%'};return _0x1e2125;})});}_0x47562f=_[_0x6590('0x2e')]({},_0x47562f,_0x449931[_0x6590('0x2f')]);return _0x4cb5ef[_0x6590('0x78')](_0x47562f);}})[_0x6590('0x15')](function(_0x1d5e0c){if(_0x1d5e0c){_0x3eb36c=_0x1d5e0c[_0x6590('0x2d')];if(!_0x449931[_0x6590('0x24')][_0x6590('0x79')](_0x6590('0x40'))){_0x47562f[_0x6590('0x12')]=qs[_0x6590('0x12')](_0x449931['query'][_0x6590('0x12')]);_0x47562f[_0x6590('0x11')]=qs[_0x6590('0x11')](_0x449931[_0x6590('0x24')]['offset']);}return _0x4cb5ef[_0x6590('0x78')](_0x47562f);}})[_0x6590('0x15')](function(_0x57d6ca){if(_0x57d6ca){return _0x57d6ca?{'count':_0x3eb36c,'rows':_0x57d6ca}:null;}})[_0x6590('0x15')](respondWithResult(_0x3b8839,null))[_0x6590('0x26')](handleError(_0x3b8839,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 56845b2..59ccc50 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a78=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x2202cc,_0x2a5a73){var _0x4213c7=function(_0x569056){while(--_0x569056){_0x2202cc['push'](_0x2202cc['shift']());}};_0x4213c7(++_0x2a5a73);}(_0x5a78,0x1ac));var _0x85a7=function(_0x391c38,_0x43bc3d){_0x391c38=_0x391c38-0x0;var _0xbd82e4=_0x5a78[_0x391c38];return _0xbd82e4;};'use strict';var EventEmitter=require(_0x85a7('0x0'));var ChatQueue=require(_0x85a7('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x85a7('0x2')](0x0);var events={'afterCreate':_0x85a7('0x3'),'afterUpdate':'update','afterDestroy':_0x85a7('0x4')};function emitEvent(_0x4d19f4){return function(_0x580f7e,_0x40ad75,_0x3f675b){ChatQueueEvents[_0x85a7('0x5')](_0x4d19f4+':'+_0x580f7e['id'],_0x580f7e);ChatQueueEvents[_0x85a7('0x5')](_0x4d19f4,_0x580f7e);_0x3f675b(null);};}for(var e in events){if(events[_0x85a7('0x6')](e)){var event=events[e];ChatQueue[_0x85a7('0x7')](e,emitEvent(event));}}module[_0x85a7('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xc2a5=['hook','exports','events','ChatQueue','setMaxListeners','emit'];(function(_0x470d01,_0x7729a5){var _0x10be53=function(_0x177e3f){while(--_0x177e3f){_0x470d01['push'](_0x470d01['shift']());}};_0x10be53(++_0x7729a5);}(_0xc2a5,0x1d6));var _0x5c2a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc2a5[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x5c2a('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x5c2a('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5c2a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x40570d){return function(_0x44e218,_0x19ddda,_0x25c6c8){ChatQueueEvents[_0x5c2a('0x3')](_0x40570d+':'+_0x44e218['id'],_0x44e218);ChatQueueEvents[_0x5c2a('0x3')](_0x40570d,_0x44e218);_0x25c6c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x5c2a('0x4')](e,emitEvent(event));}}module[_0x5c2a('0x5')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index adc4ba3..23161a9 100644
--- a/server/api/chatQueue/chatQueue.model.js
+++ b/server/api/chatQueue/chatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfe1a=['exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatQueue.attributes'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0xfe1a,0x1cb));var _0xafe1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfe1a[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xafe1('0x0'));var util=require(_0xafe1('0x1'));var logger=require(_0xafe1('0x2'))(_0xafe1('0x3'));var moment=require(_0xafe1('0x4'));var BPromise=require(_0xafe1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xafe1('0x6'));var rimraf=require(_0xafe1('0x7'));var config=require('../../config/environment');var attributes=require(_0xafe1('0x8'));module[_0xafe1('0x9')]=function(_0x5217f3,_0x2a0b83){return _0x5217f3[_0xafe1('0xa')](_0xafe1('0xb'),attributes,{'tableName':_0xafe1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e91=['request-promise','../../config/environment','exports','define','chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5db6fd,_0x265729){var _0x218d95=function(_0x29bff1){while(--_0x29bff1){_0x5db6fd['push'](_0x5db6fd['shift']());}};_0x218d95(++_0x265729);}(_0x6e91,0x73));var _0x16e9=function(_0x3fd6cb,_0xbc9b0c){_0x3fd6cb=_0x3fd6cb-0x0;var _0x20c189=_0x6e91[_0x3fd6cb];return _0x20c189;};'use strict';var _=require(_0x16e9('0x0'));var util=require(_0x16e9('0x1'));var logger=require(_0x16e9('0x2'))(_0x16e9('0x3'));var moment=require(_0x16e9('0x4'));var BPromise=require(_0x16e9('0x5'));var rp=require(_0x16e9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x16e9('0x7'));var attributes=require('./chatQueue.attributes');module[_0x16e9('0x8')]=function(_0x4ecde4,_0x6a63f1){return _0x4ecde4[_0x16e9('0x9')]('ChatQueue',attributes,{'tableName':_0x16e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 656c8cf..bc2a979 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d5d=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','include','map','model','attributes','ShowChatQueue','find','lodash','moment'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x3d5d,0xe2));var _0xd3d5=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x3d5d[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require(_0xd3d5('0x0'));var util=require('util');var moment=require(_0xd3d5('0x1'));var BPromise=require(_0xd3d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3d5('0x3'))['db'];var utils=require(_0xd3d5('0x4'));var logger=require(_0xd3d5('0x5'))(_0xd3d5('0x6'));var config=require(_0xd3d5('0x7'));var jayson=require(_0xd3d5('0x8'));var client=jayson['client'][_0xd3d5('0x9')]({'port':0x232a});config[_0xd3d5('0xa')]=_[_0xd3d5('0xb')](config[_0xd3d5('0xa')],{'host':_0xd3d5('0xc'),'port':0x18eb});var socket=require(_0xd3d5('0xd'))(new Redis(config['redis']));require(_0xd3d5('0xe'))['register'](socket);function respondWithRpcPromise(_0x6b10a5,_0x3dd64e,_0x561ca9){return new BPromise(function(_0x30a079,_0x43308d){return client['request'](_0x6b10a5,_0x561ca9)[_0xd3d5('0xf')](function(_0x381d57){logger[_0xd3d5('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3dd64e,'request\x20sent');logger[_0xd3d5('0x11')](_0xd3d5('0x12'),_0x3dd64e,'request\x20sent',JSON[_0xd3d5('0x13')](_0x381d57));if(_0x381d57['error']){if(_0x381d57[_0xd3d5('0x14')][_0xd3d5('0x15')]===0x1f4){logger[_0xd3d5('0x14')]('ChatQueue,\x20%s,\x20%s',_0x3dd64e,_0x381d57['error'][_0xd3d5('0x16')]);return _0x43308d(_0x381d57[_0xd3d5('0x14')]['message']);}logger[_0xd3d5('0x14')]('ChatQueue,\x20%s,\x20%s',_0x3dd64e,_0x381d57[_0xd3d5('0x14')][_0xd3d5('0x16')]);return _0x30a079(_0x381d57[_0xd3d5('0x14')]['message']);}else{logger[_0xd3d5('0x10')](_0xd3d5('0x17'),_0x3dd64e,'request\x20sent');_0x30a079(_0x381d57[_0xd3d5('0x18')]['message']);}})[_0xd3d5('0x19')](function(_0x3c9b37){logger[_0xd3d5('0x14')](_0xd3d5('0x17'),_0x3dd64e,_0x3c9b37);_0x43308d(_0x3c9b37);});});}exports[_0xd3d5('0x1a')]=function(_0x104367){var _0x5d10e4=this;return new Promise(function(_0x4053c5,_0x4893f6){return db[_0xd3d5('0x1b')][_0xd3d5('0x1c')]({'raw':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')][_0xd3d5('0x1e')]===undefined?!![]:![]:!![],'where':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')][_0xd3d5('0x1f')]||null:null,'attributes':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')]['attributes']||null:null,'limit':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')]['limit']||null:null,'include':_0x104367[_0xd3d5('0x1d')]?_0x104367[_0xd3d5('0x1d')][_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0x104367[_0xd3d5('0x1d')][_0xd3d5('0x20')],function(_0x5dcd2d){return{'model':db[_0x5dcd2d[_0xd3d5('0x22')]],'as':_0x5dcd2d['as'],'attributes':_0x5dcd2d['attributes'],'include':_0x5dcd2d[_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0x5dcd2d['include'],function(_0x49270d){return{'model':db[_0x49270d[_0xd3d5('0x22')]],'as':_0x49270d['as'],'attributes':_0x49270d[_0xd3d5('0x23')],'include':_0x49270d[_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0x49270d[_0xd3d5('0x20')],function(_0x41b882){return{'model':db[_0x41b882[_0xd3d5('0x22')]],'as':_0x41b882['as'],'attributes':_0x41b882[_0xd3d5('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3167a8){logger['info'](_0xd3d5('0x1a'),_0x104367);logger['debug'](_0xd3d5('0x1a'),_0x104367,JSON['stringify'](_0x3167a8));_0x4053c5(_0x3167a8);})[_0xd3d5('0x19')](function(_0x472d6c){logger[_0xd3d5('0x14')](_0xd3d5('0x1a'),_0x472d6c[_0xd3d5('0x16')],_0x104367);_0x4893f6(_0x5d10e4[_0xd3d5('0x14')](0x1f4,_0x472d6c[_0xd3d5('0x16')]));});});};exports[_0xd3d5('0x24')]=function(_0x49f071){var _0x25e3ad=this;return new Promise(function(_0x58bb06,_0x274f99){return db[_0xd3d5('0x1b')][_0xd3d5('0x25')]({'raw':_0x49f071[_0xd3d5('0x1d')]?_0x49f071[_0xd3d5('0x1d')][_0xd3d5('0x1e')]===undefined?!![]:![]:!![],'where':_0x49f071['options']?_0x49f071[_0xd3d5('0x1d')][_0xd3d5('0x1f')]||null:null,'attributes':_0x49f071[_0xd3d5('0x1d')]?_0x49f071['options'][_0xd3d5('0x23')]||null:null,'include':_0x49f071['options']?_0x49f071[_0xd3d5('0x1d')][_0xd3d5('0x20')]?_['map'](_0x49f071[_0xd3d5('0x1d')][_0xd3d5('0x20')],function(_0xffa54){return{'model':db[_0xffa54[_0xd3d5('0x22')]],'as':_0xffa54['as'],'attributes':_0xffa54[_0xd3d5('0x23')],'include':_0xffa54[_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0xffa54[_0xd3d5('0x20')],function(_0x4b3a1b){return{'model':db[_0x4b3a1b['model']],'as':_0x4b3a1b['as'],'attributes':_0x4b3a1b['attributes'],'include':_0x4b3a1b[_0xd3d5('0x20')]?_[_0xd3d5('0x21')](_0x4b3a1b[_0xd3d5('0x20')],function(_0x12fd1d){return{'model':db[_0x12fd1d[_0xd3d5('0x22')]],'as':_0x12fd1d['as'],'attributes':_0x12fd1d['attributes']};}):[]};}):[]};}):[]:[]})[_0xd3d5('0xf')](function(_0xb0e19e){logger[_0xd3d5('0x10')](_0xd3d5('0x24'),_0x49f071);logger[_0xd3d5('0x11')](_0xd3d5('0x24'),_0x49f071,JSON[_0xd3d5('0x13')](_0xb0e19e));_0x58bb06(_0xb0e19e);})[_0xd3d5('0x19')](function(_0x123884){logger[_0xd3d5('0x14')](_0xd3d5('0x24'),_0x123884['message'],_0x49f071);_0x274f99(_0x25e3ad[_0xd3d5('0x14')](0x1f4,_0x123884[_0xd3d5('0x16')]));});});};
\ No newline at end of file
+var _0x9c1d=['result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','model','map','debug','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x5a24fa,_0x18621c){_0x5a24fa=_0x5a24fa-0x0;var _0x267651=_0x9c1d[_0x5a24fa];return _0x267651;};'use strict';var _=require(_0xd9c1('0x0'));var util=require(_0xd9c1('0x1'));var moment=require(_0xd9c1('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9c1('0x3'));var fs=require('fs');var Redis=require(_0xd9c1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd9c1('0x5'));var logger=require(_0xd9c1('0x6'))('rpc');var config=require(_0xd9c1('0x7'));var jayson=require(_0xd9c1('0x8'));var client=jayson[_0xd9c1('0x9')][_0xd9c1('0xa')]({'port':0x232a});config[_0xd9c1('0xb')]=_[_0xd9c1('0xc')](config[_0xd9c1('0xb')],{'host':_0xd9c1('0xd'),'port':0x18eb});var socket=require(_0xd9c1('0xe'))(new Redis(config['redis']));require(_0xd9c1('0xf'))[_0xd9c1('0x10')](socket);function respondWithRpcPromise(_0x1b0050,_0x19bc13,_0x2f75da){return new BPromise(function(_0x9592c8,_0x3c57e7){return client['request'](_0x1b0050,_0x2f75da)[_0xd9c1('0x11')](function(_0x27336b){logger[_0xd9c1('0x12')]('ChatQueue,\x20%s,\x20%s',_0x19bc13,_0xd9c1('0x13'));logger['debug'](_0xd9c1('0x14'),_0x19bc13,_0xd9c1('0x13'),JSON[_0xd9c1('0x15')](_0x27336b));if(_0x27336b[_0xd9c1('0x16')]){if(_0x27336b[_0xd9c1('0x16')][_0xd9c1('0x17')]===0x1f4){logger[_0xd9c1('0x16')](_0xd9c1('0x18'),_0x19bc13,_0x27336b[_0xd9c1('0x16')][_0xd9c1('0x19')]);return _0x3c57e7(_0x27336b[_0xd9c1('0x16')][_0xd9c1('0x19')]);}logger[_0xd9c1('0x16')](_0xd9c1('0x18'),_0x19bc13,_0x27336b[_0xd9c1('0x16')]['message']);return _0x9592c8(_0x27336b['error'][_0xd9c1('0x19')]);}else{logger[_0xd9c1('0x12')](_0xd9c1('0x18'),_0x19bc13,_0xd9c1('0x13'));_0x9592c8(_0x27336b[_0xd9c1('0x1a')][_0xd9c1('0x19')]);}})[_0xd9c1('0x1b')](function(_0x332f19){logger[_0xd9c1('0x16')]('ChatQueue,\x20%s,\x20%s',_0x19bc13,_0x332f19);_0x3c57e7(_0x332f19);});});}exports[_0xd9c1('0x1c')]=function(_0x11611d){var _0x37701d=this;return new Promise(function(_0x2aea78,_0x4643ad){return db[_0xd9c1('0x1d')]['findAll']({'raw':_0x11611d[_0xd9c1('0x1e')]?_0x11611d[_0xd9c1('0x1e')][_0xd9c1('0x1f')]===undefined?!![]:![]:!![],'where':_0x11611d['options']?_0x11611d['options'][_0xd9c1('0x20')]||null:null,'attributes':_0x11611d[_0xd9c1('0x1e')]?_0x11611d[_0xd9c1('0x1e')][_0xd9c1('0x21')]||null:null,'limit':_0x11611d[_0xd9c1('0x1e')]?_0x11611d[_0xd9c1('0x1e')][_0xd9c1('0x22')]||null:null,'include':_0x11611d['options']?_0x11611d[_0xd9c1('0x1e')][_0xd9c1('0x23')]?_['map'](_0x11611d['options'][_0xd9c1('0x23')],function(_0x45b15d){return{'model':db[_0x45b15d[_0xd9c1('0x24')]],'as':_0x45b15d['as'],'attributes':_0x45b15d['attributes'],'include':_0x45b15d[_0xd9c1('0x23')]?_[_0xd9c1('0x25')](_0x45b15d['include'],function(_0x4dcc10){return{'model':db[_0x4dcc10[_0xd9c1('0x24')]],'as':_0x4dcc10['as'],'attributes':_0x4dcc10[_0xd9c1('0x21')],'include':_0x4dcc10[_0xd9c1('0x23')]?_[_0xd9c1('0x25')](_0x4dcc10[_0xd9c1('0x23')],function(_0x7373cb){return{'model':db[_0x7373cb[_0xd9c1('0x24')]],'as':_0x7373cb['as'],'attributes':_0x7373cb['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9c1('0x11')](function(_0x223b88){logger[_0xd9c1('0x12')](_0xd9c1('0x1c'),_0x11611d);logger[_0xd9c1('0x26')](_0xd9c1('0x1c'),_0x11611d,JSON[_0xd9c1('0x15')](_0x223b88));_0x2aea78(_0x223b88);})[_0xd9c1('0x1b')](function(_0x5a1a5c){logger['error']('GetChatQueue',_0x5a1a5c[_0xd9c1('0x19')],_0x11611d);_0x4643ad(_0x37701d['error'](0x1f4,_0x5a1a5c[_0xd9c1('0x19')]));});});};exports[_0xd9c1('0x27')]=function(_0x587ac9){var _0x337761=this;return new Promise(function(_0x3e128b,_0x108422){return db[_0xd9c1('0x1d')][_0xd9c1('0x28')]({'raw':_0x587ac9[_0xd9c1('0x1e')]?_0x587ac9[_0xd9c1('0x1e')][_0xd9c1('0x1f')]===undefined?!![]:![]:!![],'where':_0x587ac9[_0xd9c1('0x1e')]?_0x587ac9[_0xd9c1('0x1e')][_0xd9c1('0x20')]||null:null,'attributes':_0x587ac9[_0xd9c1('0x1e')]?_0x587ac9['options']['attributes']||null:null,'include':_0x587ac9[_0xd9c1('0x1e')]?_0x587ac9[_0xd9c1('0x1e')][_0xd9c1('0x23')]?_['map'](_0x587ac9[_0xd9c1('0x1e')][_0xd9c1('0x23')],function(_0x5905be){return{'model':db[_0x5905be[_0xd9c1('0x24')]],'as':_0x5905be['as'],'attributes':_0x5905be[_0xd9c1('0x21')],'include':_0x5905be['include']?_['map'](_0x5905be[_0xd9c1('0x23')],function(_0xbdfa7){return{'model':db[_0xbdfa7[_0xd9c1('0x24')]],'as':_0xbdfa7['as'],'attributes':_0xbdfa7[_0xd9c1('0x21')],'include':_0xbdfa7[_0xd9c1('0x23')]?_[_0xd9c1('0x25')](_0xbdfa7['include'],function(_0x2cd0eb){return{'model':db[_0x2cd0eb[_0xd9c1('0x24')]],'as':_0x2cd0eb['as'],'attributes':_0x2cd0eb[_0xd9c1('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe0d4a5){logger[_0xd9c1('0x12')](_0xd9c1('0x27'),_0x587ac9);logger[_0xd9c1('0x26')](_0xd9c1('0x27'),_0x587ac9,JSON[_0xd9c1('0x15')](_0xe0d4a5));_0x3e128b(_0xe0d4a5);})[_0xd9c1('0x1b')](function(_0x2fa7c4){logger[_0xd9c1('0x16')](_0xd9c1('0x27'),_0x2fa7c4['message'],_0x587ac9);_0x108422(_0x337761[_0xd9c1('0x16')](0x1f4,_0x2fa7c4[_0xd9c1('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index f71919a..6d35a7b 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ad3=['register','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x5ad3[_0x513047];return _0x15b779;};'use strict';var ChatQueueEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){ChatQueueEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);ChatQueueEvents['on'](_0x292521,_0x3cec3e);}};
\ No newline at end of file
+var _0x4ea3=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x4d3b77,_0x3c789c){var _0x1a716a=function(_0x10707c){while(--_0x10707c){_0x4d3b77['push'](_0x4d3b77['shift']());}};_0x1a716a(++_0x3c789c);}(_0x4ea3,0x70));var _0x34ea=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4ea3[_0x5b644e];return _0x49c6bf;};'use strict';var ChatQueueEvents=require(_0x34ea('0x0'));var events=[_0x34ea('0x1'),_0x34ea('0x2'),_0x34ea('0x3')];function createListener(_0x588172,_0x374ec1){return function(_0x494b56){_0x374ec1[_0x34ea('0x4')](_0x588172,_0x494b56);};}function removeListener(_0x571f1b,_0x5e5a84){return function(){ChatQueueEvents[_0x34ea('0x5')](_0x571f1b,_0x5e5a84);};}exports[_0x34ea('0x6')]=function(_0x962596){for(var _0x123d48=0x0,_0x40434e=events[_0x34ea('0x7')];_0x123d48<_0x40434e;_0x123d48++){var _0x22b09e=events[_0x123d48];var _0x5bec7c=createListener(_0x34ea('0x8')+_0x22b09e,_0x962596);ChatQueueEvents['on'](_0x22b09e,_0x5bec7c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 10ccf04..7d9cbb3 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x587183,_0x56a369){var _0x3b6591=function(_0x585dc9){while(--_0x585dc9){_0x587183['push'](_0x587183['shift']());}};_0x3b6591(++_0x56a369);}(_0x55ca,0x126));var _0xa55c=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x55ca[_0x1fc18b];return _0x16a351;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x5fc3[_0x3fd3a3];return _0xa3e4d5;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 3e95d41..6a5f941 100644
--- a/server/api/chatQueueReport/chatQueueReport.attributes.js
+++ b/server/api/chatQueueReport/chatQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a24=['exports','STRING','DATE','moment','sequelize'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x6a24,0xb7));var _0x46a2=function(_0x36fcfb,_0x2e95df){_0x36fcfb=_0x36fcfb-0x0;var _0x545820=_0x6a24[_0x36fcfb];return _0x545820;};'use strict';var moment=require(_0x46a2('0x0'));var Sequelize=require(_0x46a2('0x1'));module[_0x46a2('0x2')]={'uniqueid':{'type':Sequelize[_0x46a2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x46a2('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x46a2('0x4')]},'exitAt':{'type':Sequelize[_0x46a2('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2791=['STRING','DATE','moment','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2791,0x66));var _0x1279=function(_0x2df819,_0x366130){_0x2df819=_0x2df819-0x0;var _0x29be16=_0x2791[_0x2df819];return _0x29be16;};'use strict';var moment=require(_0x1279('0x0'));var Sequelize=require(_0x1279('0x1'));module[_0x1279('0x2')]={'uniqueid':{'type':Sequelize[_0x1279('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1279('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1279('0x4')]},'acceptAt':{'type':Sequelize[_0x1279('0x4')]},'exitAt':{'type':Sequelize[_0x1279('0x4')]},'reason':{'type':Sequelize[_0x1279('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 50e332d..f36abdd 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1a61=['json','offset','limit','undefined','count','set','Content-Range','apply','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','includeAll','findAll','rows','catch','params','merge','find','create','body','update','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1a61,0x1e6));var _0x11a6=function(_0x244969,_0x3c218c){_0x244969=_0x244969-0x0;var _0x4fd27a=_0x1a61[_0x244969];return _0x4fd27a;};'use strict';var emlformat=require(_0x11a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11a6('0x2'));var moment=require(_0x11a6('0x3'));var BPromise=require(_0x11a6('0x4'));var Mustache=require(_0x11a6('0x5'));var util=require('util');var path=require('path');var sox=require(_0x11a6('0x6'));var csv=require(_0x11a6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11a6('0x8'));var _=require(_0x11a6('0x9'));var squel=require(_0x11a6('0xa'));var crypto=require(_0x11a6('0xb'));var jsforce=require(_0x11a6('0xc'));var deskjs=require(_0x11a6('0xd'));var toCsv=require(_0x11a6('0x7'));var querystring=require(_0x11a6('0xe'));var Papa=require(_0x11a6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x11a6('0x10'));var hardwareService=require(_0x11a6('0x11'));var logger=require('../../config/logger')(_0x11a6('0x12'));var utils=require(_0x11a6('0x13'));var config=require(_0x11a6('0x14'));var licenseUtil=require(_0x11a6('0x15'));var db=require(_0x11a6('0x16'))['db'];function respondWithStatusCode(_0x41c4aa,_0x52f39a){_0x52f39a=_0x52f39a||0xcc;return function(_0x52c999){if(_0x52c999){return _0x41c4aa[_0x11a6('0x17')](_0x52f39a);}return _0x41c4aa[_0x11a6('0x18')](_0x52f39a)['end']();};}function respondWithResult(_0x1d3123,_0x15d140){_0x15d140=_0x15d140||0xc8;return function(_0x5158ea){if(_0x5158ea){return _0x1d3123[_0x11a6('0x18')](_0x15d140)[_0x11a6('0x19')](_0x5158ea);}};}function respondWithFilteredResult(_0x5b8e51,_0x345c70){return function(_0x2c79f4){if(_0x2c79f4){var _0x1fec24=typeof _0x345c70[_0x11a6('0x1a')]==='undefined'&&typeof _0x345c70[_0x11a6('0x1b')]===_0x11a6('0x1c');var _0xe8ed8=_0x2c79f4[_0x11a6('0x1d')];var _0x1a9d43=_0x1fec24?0x0:_0x345c70[_0x11a6('0x1a')];var _0x2449bf=_0x1fec24?_0x2c79f4[_0x11a6('0x1d')]:_0x345c70[_0x11a6('0x1a')]+_0x345c70[_0x11a6('0x1b')];var _0x2516a4;if(_0x2449bf>=_0xe8ed8){_0x2449bf=_0xe8ed8;_0x2516a4=0xc8;}else{_0x2516a4=0xce;}_0x5b8e51[_0x11a6('0x18')](_0x2516a4);return _0x5b8e51[_0x11a6('0x1e')](_0x11a6('0x1f'),_0x1a9d43+'-'+_0x2449bf+'/'+_0xe8ed8)['json'](_0x2c79f4);}return null;};}function patchUpdates(_0x485a4f){return function(_0xbd4c49){try{jsonpatch[_0x11a6('0x20')](_0xbd4c49,_0x485a4f,!![]);}catch(_0x3d1efd){return BPromise['reject'](_0x3d1efd);}return _0xbd4c49['save']();};}function saveUpdates(_0x7120c0,_0x521f50){return function(_0x707dd2){if(_0x707dd2){return _0x707dd2['update'](_0x7120c0)['then'](function(_0x51fe97){return _0x51fe97;});}return null;};}function removeEntity(_0x5b3a27,_0x111a63){return function(_0x55a043){if(_0x55a043){return _0x55a043[_0x11a6('0x21')]()[_0x11a6('0x22')](function(){_0x5b3a27['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ffd7f,_0x144cc5){return function(_0x34e230){if(!_0x34e230){_0x2ffd7f[_0x11a6('0x17')](0x194);}return _0x34e230;};}function handleError(_0x14f510,_0x407ae0){_0x407ae0=_0x407ae0||0x1f4;return function(_0x40e3b4){logger[_0x11a6('0x23')](_0x40e3b4[_0x11a6('0x24')]);if(_0x40e3b4[_0x11a6('0x25')]){delete _0x40e3b4[_0x11a6('0x25')];}_0x14f510[_0x11a6('0x18')](_0x407ae0)[_0x11a6('0x26')](_0x40e3b4);};}exports[_0x11a6('0x27')]=function(_0x304ad8,_0x453453){var _0x1ddbb2={},_0x1b7f4e={},_0x44c92d={'count':0x0,'rows':[]};var _0x2bfdf6=_[_0x11a6('0x28')](db[_0x11a6('0x29')][_0x11a6('0x2a')],function(_0x1ec7aa){return{'name':_0x1ec7aa[_0x11a6('0x2b')],'type':_0x1ec7aa['type'][_0x11a6('0x2c')]};});_0x1b7f4e['model']=_[_0x11a6('0x28')](_0x2bfdf6,_0x11a6('0x25'));_0x1b7f4e[_0x11a6('0x2d')]=_[_0x11a6('0x2e')](_0x304ad8[_0x11a6('0x2d')]);_0x1b7f4e['filters']=_[_0x11a6('0x2f')](_0x1b7f4e[_0x11a6('0x30')],_0x1b7f4e['query']);_0x1ddbb2['attributes']=_['intersection'](_0x1b7f4e[_0x11a6('0x30')],qs[_0x11a6('0x31')](_0x304ad8['query'][_0x11a6('0x31')]));_0x1ddbb2[_0x11a6('0x32')]=_0x1ddbb2[_0x11a6('0x32')][_0x11a6('0x33')]?_0x1ddbb2[_0x11a6('0x32')]:_0x1b7f4e['model'];if(!_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x34')](_0x11a6('0x35'))){_0x1ddbb2[_0x11a6('0x1b')]=qs[_0x11a6('0x1b')](_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x1b')]);_0x1ddbb2[_0x11a6('0x1a')]=qs[_0x11a6('0x1a')](_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x1a')]);}_0x1ddbb2[_0x11a6('0x36')]=qs[_0x11a6('0x37')](_0x304ad8['query'][_0x11a6('0x37')]);_0x1ddbb2[_0x11a6('0x38')]=qs[_0x11a6('0x39')](_[_0x11a6('0x3a')](_0x304ad8[_0x11a6('0x2d')],_0x1b7f4e[_0x11a6('0x39')]),_0x2bfdf6);if(_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x3b')]){_0x1ddbb2[_0x11a6('0x38')]=_['merge'](_0x1ddbb2[_0x11a6('0x38')],{'$or':_[_0x11a6('0x28')](_0x2bfdf6,function(_0x5f38c1){if(_0x5f38c1[_0x11a6('0x3c')]!==_0x11a6('0x3d')){var _0x38aaa7={};_0x38aaa7[_0x5f38c1['name']]={'$like':'%'+_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x3b')]+'%'};return _0x38aaa7;}})});}_0x1ddbb2=_['merge']({},_0x1ddbb2,_0x304ad8['options']);var _0x10c485={'where':_0x1ddbb2['where']};return db[_0x11a6('0x29')][_0x11a6('0x1d')](_0x10c485)['then'](function(_0x275aa0){_0x44c92d['count']=_0x275aa0;if(_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x3e')]){_0x1ddbb2['include']=[{'all':!![]}];}return db[_0x11a6('0x29')][_0x11a6('0x3f')](_0x1ddbb2);})[_0x11a6('0x22')](function(_0xd769e4){_0x44c92d[_0x11a6('0x40')]=_0xd769e4;return _0x44c92d;})[_0x11a6('0x22')](respondWithFilteredResult(_0x453453,_0x1ddbb2))[_0x11a6('0x41')](handleError(_0x453453,null));};exports['show']=function(_0x1d3a8b,_0x382182){var _0x5f44c1={'raw':!![],'where':{'id':_0x1d3a8b[_0x11a6('0x42')]['id']}},_0x588b96={};_0x588b96['model']=_[_0x11a6('0x2e')](db[_0x11a6('0x29')][_0x11a6('0x2a')]);_0x588b96['query']=_['keys'](_0x1d3a8b['query']);_0x588b96['filters']=_[_0x11a6('0x2f')](_0x588b96['model'],_0x588b96[_0x11a6('0x2d')]);_0x5f44c1[_0x11a6('0x32')]=_['intersection'](_0x588b96['model'],qs['fields'](_0x1d3a8b[_0x11a6('0x2d')][_0x11a6('0x31')]));_0x5f44c1['attributes']=_0x5f44c1[_0x11a6('0x32')]['length']?_0x5f44c1[_0x11a6('0x32')]:_0x588b96['model'];if(_0x1d3a8b[_0x11a6('0x2d')][_0x11a6('0x3e')]){_0x5f44c1['include']=[{'all':!![]}];}_0x5f44c1=_[_0x11a6('0x43')]({},_0x5f44c1,_0x1d3a8b['options']);return db[_0x11a6('0x29')][_0x11a6('0x44')](_0x5f44c1)[_0x11a6('0x22')](handleEntityNotFound(_0x382182,null))[_0x11a6('0x22')](respondWithResult(_0x382182,null))['catch'](handleError(_0x382182,null));};exports[_0x11a6('0x45')]=function(_0x18feb7,_0x25f137){return db[_0x11a6('0x29')][_0x11a6('0x45')](_0x18feb7[_0x11a6('0x46')],{})['then'](respondWithResult(_0x25f137,0xc9))[_0x11a6('0x41')](handleError(_0x25f137,null));};exports[_0x11a6('0x47')]=function(_0x41afe9,_0x5b8bbf){if(_0x41afe9[_0x11a6('0x46')]['id']){delete _0x41afe9[_0x11a6('0x46')]['id'];}return db[_0x11a6('0x29')][_0x11a6('0x44')]({'where':{'id':_0x41afe9[_0x11a6('0x42')]['id']}})[_0x11a6('0x22')](handleEntityNotFound(_0x5b8bbf,null))[_0x11a6('0x22')](saveUpdates(_0x41afe9[_0x11a6('0x46')],null))[_0x11a6('0x22')](respondWithResult(_0x5b8bbf,null))[_0x11a6('0x41')](handleError(_0x5b8bbf,null));};exports[_0x11a6('0x21')]=function(_0x2e105f,_0x1febf1){return db[_0x11a6('0x29')][_0x11a6('0x44')]({'where':{'id':_0x2e105f[_0x11a6('0x42')]['id']}})[_0x11a6('0x22')](handleEntityNotFound(_0x1febf1,null))[_0x11a6('0x22')](removeEntity(_0x1febf1,null))['catch'](handleError(_0x1febf1,null));};exports[_0x11a6('0x48')]=function(_0x5e7235,_0x27c59a){return db['ChatQueueReport'][_0x11a6('0x48')]()[_0x11a6('0x22')](respondWithResult(_0x27c59a,null))[_0x11a6('0x41')](handleError(_0x27c59a,null));};
\ No newline at end of file
+var _0xfd20=['map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','create','body','find','destroy','describe','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','then','end','error','stack','name','send'];(function(_0x2b272b,_0x1af4e3){var _0x2b23ef=function(_0x89a945){while(--_0x89a945){_0x2b272b['push'](_0x2b272b['shift']());}};_0x2b23ef(++_0x1af4e3);}(_0xfd20,0x66));var _0x0fd2=function(_0x332924,_0x240c1c){_0x332924=_0x332924-0x0;var _0x4440e9=_0xfd20[_0x332924];return _0x4440e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fd2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fd2('0x3'));var util=require('util');var path=require(_0x0fd2('0x4'));var sox=require(_0x0fd2('0x5'));var csv=require(_0x0fd2('0x6'));var ejs=require(_0x0fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x0fd2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd2('0x9'));var jsforce=require(_0x0fd2('0xa'));var deskjs=require(_0x0fd2('0xb'));var toCsv=require(_0x0fd2('0x6'));var querystring=require(_0x0fd2('0xc'));var Papa=require(_0x0fd2('0xd'));var Redis=require(_0x0fd2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fd2('0xf'));var as=require(_0x0fd2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd2('0x11'))('api');var utils=require(_0x0fd2('0x12'));var config=require(_0x0fd2('0x13'));var licenseUtil=require(_0x0fd2('0x14'));var db=require(_0x0fd2('0x15'))['db'];function respondWithStatusCode(_0xdf592d,_0x3504cf){_0x3504cf=_0x3504cf||0xcc;return function(_0x1f7a6e){if(_0x1f7a6e){return _0xdf592d[_0x0fd2('0x16')](_0x3504cf);}return _0xdf592d['status'](_0x3504cf)['end']();};}function respondWithResult(_0x1a9acb,_0x99de24){_0x99de24=_0x99de24||0xc8;return function(_0x21dcc5){if(_0x21dcc5){return _0x1a9acb[_0x0fd2('0x17')](_0x99de24)['json'](_0x21dcc5);}};}function respondWithFilteredResult(_0x280253,_0x4f074a){return function(_0x50b723){if(_0x50b723){var _0x2b6254=typeof _0x4f074a['offset']===_0x0fd2('0x18')&&typeof _0x4f074a['limit']===_0x0fd2('0x18');var _0x4cd2bf=_0x50b723[_0x0fd2('0x19')];var _0x15c9de=_0x2b6254?0x0:_0x4f074a['offset'];var _0x2b25d2=_0x2b6254?_0x50b723['count']:_0x4f074a[_0x0fd2('0x1a')]+_0x4f074a[_0x0fd2('0x1b')];var _0x3fb07e;if(_0x2b25d2>=_0x4cd2bf){_0x2b25d2=_0x4cd2bf;_0x3fb07e=0xc8;}else{_0x3fb07e=0xce;}_0x280253[_0x0fd2('0x17')](_0x3fb07e);return _0x280253[_0x0fd2('0x1c')](_0x0fd2('0x1d'),_0x15c9de+'-'+_0x2b25d2+'/'+_0x4cd2bf)[_0x0fd2('0x1e')](_0x50b723);}return null;};}function patchUpdates(_0x1a72ca){return function(_0x1b848d){try{jsonpatch[_0x0fd2('0x1f')](_0x1b848d,_0x1a72ca,!![]);}catch(_0x5c50ad){return BPromise['reject'](_0x5c50ad);}return _0x1b848d['save']();};}function saveUpdates(_0x4156d2,_0x36072a){return function(_0x53ab17){if(_0x53ab17){return _0x53ab17['update'](_0x4156d2)[_0x0fd2('0x20')](function(_0x25563c){return _0x25563c;});}return null;};}function removeEntity(_0x6be8d8,_0x29398f){return function(_0x25cdd2){if(_0x25cdd2){return _0x25cdd2['destroy']()[_0x0fd2('0x20')](function(){_0x6be8d8[_0x0fd2('0x17')](0xcc)[_0x0fd2('0x21')]();});}};}function handleEntityNotFound(_0x54cce1,_0x4c77a8){return function(_0x11bb10){if(!_0x11bb10){_0x54cce1[_0x0fd2('0x16')](0x194);}return _0x11bb10;};}function handleError(_0x4d0924,_0x400133){_0x400133=_0x400133||0x1f4;return function(_0x429fef){logger[_0x0fd2('0x22')](_0x429fef[_0x0fd2('0x23')]);if(_0x429fef[_0x0fd2('0x24')]){delete _0x429fef[_0x0fd2('0x24')];}_0x4d0924[_0x0fd2('0x17')](_0x400133)[_0x0fd2('0x25')](_0x429fef);};}exports['index']=function(_0x37d519,_0x434018){var _0x235c90={},_0x1ca259={},_0x33cf1a={'count':0x0,'rows':[]};var _0x564419=_[_0x0fd2('0x26')](db[_0x0fd2('0x27')][_0x0fd2('0x28')],function(_0x1a7a98){return{'name':_0x1a7a98[_0x0fd2('0x29')],'type':_0x1a7a98[_0x0fd2('0x2a')][_0x0fd2('0x2b')]};});_0x1ca259[_0x0fd2('0x2c')]=_['map'](_0x564419,_0x0fd2('0x24'));_0x1ca259['query']=_['keys'](_0x37d519[_0x0fd2('0x2d')]);_0x1ca259['filters']=_[_0x0fd2('0x2e')](_0x1ca259['model'],_0x1ca259[_0x0fd2('0x2d')]);_0x235c90['attributes']=_['intersection'](_0x1ca259[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x37d519[_0x0fd2('0x2d')]['fields']));_0x235c90['attributes']=_0x235c90[_0x0fd2('0x30')]['length']?_0x235c90[_0x0fd2('0x30')]:_0x1ca259[_0x0fd2('0x2c')];if(!_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x31')](_0x0fd2('0x32'))){_0x235c90[_0x0fd2('0x1b')]=qs[_0x0fd2('0x1b')](_0x37d519['query'][_0x0fd2('0x1b')]);_0x235c90[_0x0fd2('0x1a')]=qs['offset'](_0x37d519['query'][_0x0fd2('0x1a')]);}_0x235c90['order']=qs['sort'](_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x33')]);_0x235c90[_0x0fd2('0x34')]=qs[_0x0fd2('0x35')](_[_0x0fd2('0x36')](_0x37d519[_0x0fd2('0x2d')],_0x1ca259[_0x0fd2('0x35')]),_0x564419);if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]){_0x235c90[_0x0fd2('0x34')]=_[_0x0fd2('0x38')](_0x235c90[_0x0fd2('0x34')],{'$or':_[_0x0fd2('0x26')](_0x564419,function(_0x3a3986){if(_0x3a3986[_0x0fd2('0x2a')]!==_0x0fd2('0x39')){var _0x50643e={};_0x50643e[_0x3a3986[_0x0fd2('0x24')]]={'$like':'%'+_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]+'%'};return _0x50643e;}})});}_0x235c90=_[_0x0fd2('0x38')]({},_0x235c90,_0x37d519['options']);var _0x286543={'where':_0x235c90['where']};return db[_0x0fd2('0x27')][_0x0fd2('0x19')](_0x286543)['then'](function(_0x43e585){_0x33cf1a[_0x0fd2('0x19')]=_0x43e585;if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x3a')]){_0x235c90[_0x0fd2('0x3b')]=[{'all':!![]}];}return db[_0x0fd2('0x27')]['findAll'](_0x235c90);})[_0x0fd2('0x20')](function(_0x409321){_0x33cf1a[_0x0fd2('0x3c')]=_0x409321;return _0x33cf1a;})[_0x0fd2('0x20')](respondWithFilteredResult(_0x434018,_0x235c90))[_0x0fd2('0x3d')](handleError(_0x434018,null));};exports['show']=function(_0x258569,_0x2e804d){var _0x554476={'raw':!![],'where':{'id':_0x258569[_0x0fd2('0x3e')]['id']}},_0x252fb1={};_0x252fb1[_0x0fd2('0x2c')]=_[_0x0fd2('0x3f')](db[_0x0fd2('0x27')][_0x0fd2('0x28')]);_0x252fb1[_0x0fd2('0x2d')]=_[_0x0fd2('0x3f')](_0x258569['query']);_0x252fb1['filters']=_[_0x0fd2('0x2e')](_0x252fb1[_0x0fd2('0x2c')],_0x252fb1['query']);_0x554476[_0x0fd2('0x30')]=_['intersection'](_0x252fb1[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x258569[_0x0fd2('0x2d')][_0x0fd2('0x2f')]));_0x554476[_0x0fd2('0x30')]=_0x554476[_0x0fd2('0x30')]['length']?_0x554476['attributes']:_0x252fb1[_0x0fd2('0x2c')];if(_0x258569['query'][_0x0fd2('0x3a')]){_0x554476[_0x0fd2('0x3b')]=[{'all':!![]}];}_0x554476=_[_0x0fd2('0x38')]({},_0x554476,_0x258569[_0x0fd2('0x40')]);return db[_0x0fd2('0x27')]['find'](_0x554476)[_0x0fd2('0x20')](handleEntityNotFound(_0x2e804d,null))['then'](respondWithResult(_0x2e804d,null))[_0x0fd2('0x3d')](handleError(_0x2e804d,null));};exports[_0x0fd2('0x41')]=function(_0x5352cc,_0x337daa){return db['ChatQueueReport']['create'](_0x5352cc[_0x0fd2('0x42')],{})[_0x0fd2('0x20')](respondWithResult(_0x337daa,0xc9))[_0x0fd2('0x3d')](handleError(_0x337daa,null));};exports['update']=function(_0x30ac02,_0x119e21){if(_0x30ac02[_0x0fd2('0x42')]['id']){delete _0x30ac02[_0x0fd2('0x42')]['id'];}return db['ChatQueueReport'][_0x0fd2('0x43')]({'where':{'id':_0x30ac02[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x119e21,null))[_0x0fd2('0x20')](saveUpdates(_0x30ac02[_0x0fd2('0x42')],null))[_0x0fd2('0x20')](respondWithResult(_0x119e21,null))[_0x0fd2('0x3d')](handleError(_0x119e21,null));};exports[_0x0fd2('0x44')]=function(_0x2377bd,_0x4322b4){return db[_0x0fd2('0x27')]['find']({'where':{'id':_0x2377bd[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x4322b4,null))['then'](removeEntity(_0x4322b4,null))[_0x0fd2('0x3d')](handleError(_0x4322b4,null));};exports['describe']=function(_0x19650c,_0x5193b7){return db[_0x0fd2('0x27')][_0x0fd2('0x45')]()[_0x0fd2('0x20')](respondWithResult(_0x5193b7,null))['catch'](handleError(_0x5193b7,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 4c7410c..4d8e2ca 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x478ecf,_0x5887bb){var _0x54ebc8=function(_0x23effb){while(--_0x23effb){_0x478ecf['push'](_0x478ecf['shift']());}};_0x54ebc8(++_0x5887bb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x2b3e7e,_0x37c887){var _0x1e24b2=function(_0x5a761f){while(--_0x5a761f){_0x2b3e7e['push'](_0x2b3e7e['shift']());}};_0x1e24b2(++_0x37c887);}(_0xe706,0xa3));var _0x6e70=function(_0x48f038,_0x2bde84){_0x48f038=_0x48f038-0x0;var _0x2edc62=_0xe706[_0x48f038];return _0x2edc62;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c4590d5..3c19339 100644
--- a/server/api/chatQueueReport/chatQueueReport.rpc.js
+++ b/server/api/chatQueueReport/chatQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2454=['../../config/logger','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','update','body','attributes','UpdateChatQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xba4220,_0x5217a7){var _0x4cdb9d=function(_0x32cae1){while(--_0x32cae1){_0xba4220['push'](_0xba4220['shift']());}};_0x4cdb9d(++_0x5217a7);}(_0x2454,0xea));var _0x4245=function(_0x124810,_0x158e53){_0x124810=_0x124810-0x0;var _0x48d191=_0x2454[_0x124810];return _0x48d191;};'use strict';var _=require('lodash');var util=require(_0x4245('0x0'));var moment=require(_0x4245('0x1'));var BPromise=require(_0x4245('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4245('0x3'));var db=require(_0x4245('0x4'))['db'];var utils=require(_0x4245('0x5'));var logger=require(_0x4245('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4245('0x7')][_0x4245('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fd457,_0x3cc444,_0x117de7){return new BPromise(function(_0xe0fcec,_0x409026){return client[_0x4245('0x9')](_0x2fd457,_0x117de7)[_0x4245('0xa')](function(_0x1193ec){logger['info'](_0x4245('0xb'),_0x3cc444,'request\x20sent');logger[_0x4245('0xc')](_0x4245('0xd'),_0x3cc444,_0x4245('0xe'),JSON[_0x4245('0xf')](_0x1193ec));if(_0x1193ec[_0x4245('0x10')]){if(_0x1193ec[_0x4245('0x10')][_0x4245('0x11')]===0x1f4){logger[_0x4245('0x10')](_0x4245('0xb'),_0x3cc444,_0x1193ec[_0x4245('0x10')][_0x4245('0x12')]);return _0x409026(_0x1193ec[_0x4245('0x10')][_0x4245('0x12')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3cc444,_0x1193ec[_0x4245('0x10')][_0x4245('0x12')]);return _0xe0fcec(_0x1193ec[_0x4245('0x10')][_0x4245('0x12')]);}else{logger[_0x4245('0x13')](_0x4245('0xb'),_0x3cc444,_0x4245('0xe'));_0xe0fcec(_0x1193ec['result'][_0x4245('0x12')]);}})[_0x4245('0x14')](function(_0x3d4dbb){logger['error'](_0x4245('0xb'),_0x3cc444,_0x3d4dbb);_0x409026(_0x3d4dbb);});});}exports[_0x4245('0x15')]=function(_0x4d75bf){var _0x500299=this;return new Promise(function(_0x229f68,_0x4e0c19){return db[_0x4245('0x16')][_0x4245('0x17')](_0x4d75bf['body'],{'raw':_0x4d75bf[_0x4245('0x18')]?_0x4d75bf[_0x4245('0x18')][_0x4245('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x520022){logger[_0x4245('0x13')](_0x4245('0x15'),_0x4d75bf);logger['debug']('CreateChatQueueReport',_0x4d75bf,JSON[_0x4245('0xf')](_0x520022));_0x229f68(_0x520022);})[_0x4245('0x14')](function(_0x58f389){logger[_0x4245('0x10')](_0x4245('0x15'),_0x58f389[_0x4245('0x12')],_0x4d75bf);_0x4e0c19(_0x500299[_0x4245('0x10')](0x1f4,_0x58f389[_0x4245('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x35eb47){var _0x4a0514=this;return new Promise(function(_0x513933,_0x242eb7){return db['ChatQueueReport'][_0x4245('0x1a')](_0x35eb47[_0x4245('0x1b')],{'raw':_0x35eb47[_0x4245('0x18')]?_0x35eb47[_0x4245('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35eb47[_0x4245('0x18')]?_0x35eb47[_0x4245('0x18')]['where']||null:null,'attributes':_0x35eb47['options']?_0x35eb47[_0x4245('0x18')][_0x4245('0x1c')]||null:null,'limit':_0x35eb47[_0x4245('0x18')]?_0x35eb47['options']['limit']||null:null})[_0x4245('0xa')](function(_0x210dc7){logger['info']('UpdateChatQueueReport',_0x35eb47);logger[_0x4245('0xc')](_0x4245('0x1d'),_0x35eb47,JSON['stringify'](_0x210dc7));_0x513933(_0x210dc7);})[_0x4245('0x14')](function(_0x10df76){logger['error'](_0x4245('0x1d'),_0x10df76[_0x4245('0x12')],_0x35eb47);_0x242eb7(_0x4a0514[_0x4245('0x10')](0x1f4,_0x10df76[_0x4245('0x12')]));});});};
\ No newline at end of file
+var _0x477c=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','where','limit','UpdateChatQueueReport','lodash','bluebird'];(function(_0x49ad15,_0x3fa5a3){var _0x4326bc=function(_0x4533ae){while(--_0x4533ae){_0x49ad15['push'](_0x49ad15['shift']());}};_0x4326bc(++_0x3fa5a3);}(_0x477c,0xe6));var _0xc477=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x477c[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xc477('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc477('0x1'));var rs=require(_0xc477('0x2'));var fs=require('fs');var Redis=require(_0xc477('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc477('0x4'));var logger=require(_0xc477('0x5'))(_0xc477('0x6'));var config=require(_0xc477('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc477('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54247b,_0x4a6afa,_0x32abb6){return new BPromise(function(_0x1203bc,_0x259fe9){return client[_0xc477('0x9')](_0x54247b,_0x32abb6)['then'](function(_0x2fbfb3){logger[_0xc477('0xa')](_0xc477('0xb'),_0x4a6afa,_0xc477('0xc'));logger[_0xc477('0xd')](_0xc477('0xe'),_0x4a6afa,_0xc477('0xc'),JSON[_0xc477('0xf')](_0x2fbfb3));if(_0x2fbfb3[_0xc477('0x10')]){if(_0x2fbfb3[_0xc477('0x10')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x4a6afa,_0x2fbfb3[_0xc477('0x10')][_0xc477('0x11')]);return _0x259fe9(_0x2fbfb3[_0xc477('0x10')]['message']);}logger['error'](_0xc477('0xb'),_0x4a6afa,_0x2fbfb3['error'][_0xc477('0x11')]);return _0x1203bc(_0x2fbfb3['error'][_0xc477('0x11')]);}else{logger[_0xc477('0xa')](_0xc477('0xb'),_0x4a6afa,_0xc477('0xc'));_0x1203bc(_0x2fbfb3[_0xc477('0x12')]['message']);}})['catch'](function(_0x4f85fa){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x4a6afa,_0x4f85fa);_0x259fe9(_0x4f85fa);});});}exports[_0xc477('0x13')]=function(_0x47f45d){var _0x598f6b=this;return new Promise(function(_0x329c76,_0x18fa31){return db[_0xc477('0x14')][_0xc477('0x15')](_0x47f45d[_0xc477('0x16')],{'raw':_0x47f45d[_0xc477('0x17')]?_0x47f45d[_0xc477('0x17')][_0xc477('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x13fb99){logger[_0xc477('0xa')](_0xc477('0x13'),_0x47f45d);logger[_0xc477('0xd')](_0xc477('0x13'),_0x47f45d,JSON[_0xc477('0xf')](_0x13fb99));_0x329c76(_0x13fb99);})[_0xc477('0x19')](function(_0x2e88ce){logger[_0xc477('0x10')]('CreateChatQueueReport',_0x2e88ce['message'],_0x47f45d);_0x18fa31(_0x598f6b[_0xc477('0x10')](0x1f4,_0x2e88ce[_0xc477('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x27484b){var _0x24be99=this;return new Promise(function(_0x4b73ba,_0x36da45){return db[_0xc477('0x14')]['update'](_0x27484b[_0xc477('0x16')],{'raw':_0x27484b['options']?_0x27484b[_0xc477('0x17')][_0xc477('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27484b['options']?_0x27484b[_0xc477('0x17')][_0xc477('0x1a')]||null:null,'attributes':_0x27484b[_0xc477('0x17')]?_0x27484b[_0xc477('0x17')]['attributes']||null:null,'limit':_0x27484b['options']?_0x27484b[_0xc477('0x17')][_0xc477('0x1b')]||null:null})['then'](function(_0x28870d){logger[_0xc477('0xa')](_0xc477('0x1c'),_0x27484b);logger[_0xc477('0xd')]('UpdateChatQueueReport',_0x27484b,JSON[_0xc477('0xf')](_0x28870d));_0x4b73ba(_0x28870d);})['catch'](function(_0x330d25){logger['error']('UpdateChatQueueReport',_0x330d25['message'],_0x27484b);_0x36da45(_0x24be99[_0xc477('0x10')](0x1f4,_0x330d25[_0xc477('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 69a95c4..64e4d87 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe3cc=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra'];(function(_0x535246,_0xb9ab72){var _0x43d339=function(_0x41e19d){while(--_0x41e19d){_0x535246['push'](_0x535246['shift']());}};_0x43d339(++_0xb9ab72);}(_0xe3cc,0x9b));var _0xce3c=function(_0x4edae9,_0xc9cdc1){_0x4edae9=_0x4edae9-0x0;var _0x180f85=_0xe3cc[_0x4edae9];return _0x180f85;};'use strict';var multer=require(_0xce3c('0x0'));var util=require('util');var path=require(_0xce3c('0x1'));var timeout=require('connect-timeout');var express=require(_0xce3c('0x2'));var router=express[_0xce3c('0x3')]();var fs_extra=require(_0xce3c('0x4'));var auth=require(_0xce3c('0x5'));var interaction=require(_0xce3c('0x6'));var config=require(_0xce3c('0x7'));var controller=require('./chatQueueReport.controller');router[_0xce3c('0x8')]('/',auth['isAuthenticated'](),controller[_0xce3c('0x9')]);router['get'](_0xce3c('0xa'),auth[_0xce3c('0xb')](),controller[_0xce3c('0xc')]);router[_0xce3c('0x8')](_0xce3c('0xd'),auth[_0xce3c('0xb')](),controller['show']);router[_0xce3c('0xe')]('/',auth['isAuthenticated'](),controller[_0xce3c('0xf')]);router[_0xce3c('0x10')](_0xce3c('0xd'),auth[_0xce3c('0xb')](),controller[_0xce3c('0x11')]);router[_0xce3c('0x12')](_0xce3c('0xd'),auth[_0xce3c('0xb')](),controller[_0xce3c('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x2e9d=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','/:id','isAuthenticated','show','post','create','update','delete','destroy','multer','util'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x2e9d,0x18a));var _0xd2e9=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2e9d[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0xd2e9('0x0'));var util=require(_0xd2e9('0x1'));var path=require('path');var timeout=require(_0xd2e9('0x2'));var express=require(_0xd2e9('0x3'));var router=express['Router']();var fs_extra=require(_0xd2e9('0x4'));var auth=require(_0xd2e9('0x5'));var interaction=require(_0xd2e9('0x6'));var config=require(_0xd2e9('0x7'));var controller=require('./chatQueueReport.controller');router[_0xd2e9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd2e9('0x8')](_0xd2e9('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xd2e9('0x8')](_0xd2e9('0xa'),auth[_0xd2e9('0xb')](),controller[_0xd2e9('0xc')]);router[_0xd2e9('0xd')]('/',auth['isAuthenticated'](),controller[_0xd2e9('0xe')]);router['put'](_0xd2e9('0xa'),auth[_0xd2e9('0xb')](),controller[_0xd2e9('0xf')]);router[_0xd2e9('0x10')](_0xd2e9('0xa'),auth[_0xd2e9('0xb')](),controller[_0xd2e9('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index cc4a286..06b5655 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1fe085,_0x43bea5){var _0x3a87aa=function(_0x17f072){while(--_0x17f072){_0x1fe085['push'](_0x1fe085['shift']());}};_0x3a87aa(++_0x43bea5);}(_0x70e0,0x17b));var _0x070e=function(_0x24d37b,_0x2bd674){_0x24d37b=_0x24d37b-0x0;var _0x3331f5=_0x70e0[_0x24d37b];return _0x3331f5;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3da144,_0x578cbd){var _0x13fdc7=function(_0x2d2919){while(--_0x2d2919){_0x3da144['push'](_0x3da144['shift']());}};_0x13fdc7(++_0x578cbd);}(_0x54ef,0x112));var _0xf54e=function(_0x33f3a0,_0x2f0f49){_0x33f3a0=_0x33f3a0-0x0;var _0xd33834=_0x54ef[_0x33f3a0];return _0xd33834;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 1e1be1c..ddfffe4 100644
--- a/server/api/chatTransferReport/chatTransferReport.controller.js
+++ b/server/api/chatTransferReport/chatTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7121=['name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','length','includeAll','catch','create','body','find','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x17901f,_0x4dba8c){var _0x22aaba=function(_0x2a3574){while(--_0x2a3574){_0x17901f['push'](_0x17901f['shift']());}};_0x22aaba(++_0x4dba8c);}(_0x7121,0x1c1));var _0x1712=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7121[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0x1712('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1712('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1712('0x2'));var moment=require('moment');var BPromise=require(_0x1712('0x3'));var Mustache=require(_0x1712('0x4'));var util=require(_0x1712('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1712('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1712('0x7'));var deskjs=require(_0x1712('0x8'));var toCsv=require(_0x1712('0x9'));var querystring=require(_0x1712('0xa'));var Papa=require(_0x1712('0xb'));var Redis=require(_0x1712('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1712('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1712('0xe'))(_0x1712('0xf'));var utils=require(_0x1712('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x169606,_0x42467f){_0x42467f=_0x42467f||0xcc;return function(_0x1d4bb6){if(_0x1d4bb6){return _0x169606['sendStatus'](_0x42467f);}return _0x169606['status'](_0x42467f)['end']();};}function respondWithResult(_0x37c455,_0x19242f){_0x19242f=_0x19242f||0xc8;return function(_0xd0b00d){if(_0xd0b00d){return _0x37c455[_0x1712('0x11')](_0x19242f)[_0x1712('0x12')](_0xd0b00d);}};}function respondWithFilteredResult(_0x1dcf6a,_0x564389){return function(_0x47a93d){if(_0x47a93d){var _0x552ba7=typeof _0x564389[_0x1712('0x13')]==='undefined'&&typeof _0x564389[_0x1712('0x14')]===_0x1712('0x15');var _0x505d3e=_0x47a93d[_0x1712('0x16')];var _0x4fee71=_0x552ba7?0x0:_0x564389['offset'];var _0x2e2eeb=_0x552ba7?_0x47a93d[_0x1712('0x16')]:_0x564389[_0x1712('0x13')]+_0x564389[_0x1712('0x14')];var _0x28068b;if(_0x2e2eeb>=_0x505d3e){_0x2e2eeb=_0x505d3e;_0x28068b=0xc8;}else{_0x28068b=0xce;}_0x1dcf6a[_0x1712('0x11')](_0x28068b);return _0x1dcf6a[_0x1712('0x17')](_0x1712('0x18'),_0x4fee71+'-'+_0x2e2eeb+'/'+_0x505d3e)[_0x1712('0x12')](_0x47a93d);}return null;};}function patchUpdates(_0x4169ed){return function(_0x3029d6){try{jsonpatch[_0x1712('0x19')](_0x3029d6,_0x4169ed,!![]);}catch(_0x490e84){return BPromise['reject'](_0x490e84);}return _0x3029d6[_0x1712('0x1a')]();};}function saveUpdates(_0x2e7b45,_0x41083b){return function(_0x4488be){if(_0x4488be){return _0x4488be[_0x1712('0x1b')](_0x2e7b45)[_0x1712('0x1c')](function(_0x1c79a2){return _0x1c79a2;});}return null;};}function removeEntity(_0x545ac2,_0x5de94d){return function(_0x143660){if(_0x143660){return _0x143660[_0x1712('0x1d')]()[_0x1712('0x1c')](function(){_0x545ac2['status'](0xcc)[_0x1712('0x1e')]();});}};}function handleEntityNotFound(_0x59e57f,_0x2feef5){return function(_0x197639){if(!_0x197639){_0x59e57f[_0x1712('0x1f')](0x194);}return _0x197639;};}function handleError(_0x49b366,_0x5d566d){_0x5d566d=_0x5d566d||0x1f4;return function(_0x1b057b){logger[_0x1712('0x20')](_0x1b057b[_0x1712('0x21')]);if(_0x1b057b['name']){delete _0x1b057b[_0x1712('0x22')];}_0x49b366[_0x1712('0x11')](_0x5d566d)[_0x1712('0x23')](_0x1b057b);};}exports[_0x1712('0x24')]=function(_0x33b28d,_0x483ecf){var _0xcb8553={},_0x489d70={},_0x1adb16={'count':0x0,'rows':[]};var _0x238567=_[_0x1712('0x25')](db[_0x1712('0x26')][_0x1712('0x27')],function(_0x2fdeb4){return{'name':_0x2fdeb4[_0x1712('0x28')],'type':_0x2fdeb4[_0x1712('0x29')][_0x1712('0x2a')]};});_0x489d70[_0x1712('0x2b')]=_[_0x1712('0x25')](_0x238567,_0x1712('0x22'));_0x489d70[_0x1712('0x2c')]=_[_0x1712('0x2d')](_0x33b28d[_0x1712('0x2c')]);_0x489d70[_0x1712('0x2e')]=_['intersection'](_0x489d70[_0x1712('0x2b')],_0x489d70[_0x1712('0x2c')]);_0xcb8553[_0x1712('0x2f')]=_[_0x1712('0x30')](_0x489d70['model'],qs[_0x1712('0x31')](_0x33b28d[_0x1712('0x2c')][_0x1712('0x31')]));_0xcb8553[_0x1712('0x2f')]=_0xcb8553['attributes']['length']?_0xcb8553[_0x1712('0x2f')]:_0x489d70['model'];if(!_0x33b28d['query']['hasOwnProperty'](_0x1712('0x32'))){_0xcb8553[_0x1712('0x14')]=qs[_0x1712('0x14')](_0x33b28d[_0x1712('0x2c')][_0x1712('0x14')]);_0xcb8553[_0x1712('0x13')]=qs[_0x1712('0x13')](_0x33b28d[_0x1712('0x2c')]['offset']);}_0xcb8553[_0x1712('0x33')]=qs['sort'](_0x33b28d[_0x1712('0x2c')][_0x1712('0x34')]);_0xcb8553[_0x1712('0x35')]=qs['filters'](_[_0x1712('0x36')](_0x33b28d['query'],_0x489d70['filters']),_0x238567);if(_0x33b28d[_0x1712('0x2c')][_0x1712('0x37')]){_0xcb8553['where']=_['merge'](_0xcb8553[_0x1712('0x35')],{'$or':_['map'](_0x238567,function(_0x294a64){if(_0x294a64[_0x1712('0x29')]!==_0x1712('0x38')){var _0x12601c={};_0x12601c[_0x294a64[_0x1712('0x22')]]={'$like':'%'+_0x33b28d[_0x1712('0x2c')]['filter']+'%'};return _0x12601c;}})});}_0xcb8553=_[_0x1712('0x39')]({},_0xcb8553,_0x33b28d[_0x1712('0x3a')]);var _0x103570={'where':_0xcb8553[_0x1712('0x35')]};return db[_0x1712('0x26')][_0x1712('0x16')](_0x103570)[_0x1712('0x1c')](function(_0x15675b){_0x1adb16[_0x1712('0x16')]=_0x15675b;if(_0x33b28d[_0x1712('0x2c')]['includeAll']){_0xcb8553[_0x1712('0x3b')]=[{'all':!![]}];}return db[_0x1712('0x26')]['findAll'](_0xcb8553);})['then'](function(_0x59e6fd){_0x1adb16[_0x1712('0x3c')]=_0x59e6fd;return _0x1adb16;})[_0x1712('0x1c')](respondWithFilteredResult(_0x483ecf,_0xcb8553))['catch'](handleError(_0x483ecf,null));};exports[_0x1712('0x3d')]=function(_0x292995,_0x3098e8){var _0x5d714f={'raw':!![],'where':{'id':_0x292995['params']['id']}},_0x5095ef={};_0x5095ef['model']=_[_0x1712('0x2d')](db[_0x1712('0x26')]['rawAttributes']);_0x5095ef[_0x1712('0x2c')]=_[_0x1712('0x2d')](_0x292995[_0x1712('0x2c')]);_0x5095ef[_0x1712('0x2e')]=_[_0x1712('0x30')](_0x5095ef[_0x1712('0x2b')],_0x5095ef[_0x1712('0x2c')]);_0x5d714f[_0x1712('0x2f')]=_[_0x1712('0x30')](_0x5095ef[_0x1712('0x2b')],qs[_0x1712('0x31')](_0x292995[_0x1712('0x2c')][_0x1712('0x31')]));_0x5d714f[_0x1712('0x2f')]=_0x5d714f[_0x1712('0x2f')][_0x1712('0x3e')]?_0x5d714f[_0x1712('0x2f')]:_0x5095ef[_0x1712('0x2b')];if(_0x292995[_0x1712('0x2c')][_0x1712('0x3f')]){_0x5d714f['include']=[{'all':!![]}];}_0x5d714f=_['merge']({},_0x5d714f,_0x292995[_0x1712('0x3a')]);return db['ChatTransferReport']['find'](_0x5d714f)[_0x1712('0x1c')](handleEntityNotFound(_0x3098e8,null))[_0x1712('0x1c')](respondWithResult(_0x3098e8,null))[_0x1712('0x40')](handleError(_0x3098e8,null));};exports['create']=function(_0x5ae2dd,_0x4c16a9){return db[_0x1712('0x26')][_0x1712('0x41')](_0x5ae2dd[_0x1712('0x42')],{})[_0x1712('0x1c')](respondWithResult(_0x4c16a9,0xc9))[_0x1712('0x40')](handleError(_0x4c16a9,null));};exports[_0x1712('0x1b')]=function(_0x3f61a3,_0x5f4d83){if(_0x3f61a3[_0x1712('0x42')]['id']){delete _0x3f61a3[_0x1712('0x42')]['id'];}return db['ChatTransferReport'][_0x1712('0x43')]({'where':{'id':_0x3f61a3['params']['id']}})[_0x1712('0x1c')](handleEntityNotFound(_0x5f4d83,null))['then'](saveUpdates(_0x3f61a3[_0x1712('0x42')],null))[_0x1712('0x1c')](respondWithResult(_0x5f4d83,null))[_0x1712('0x40')](handleError(_0x5f4d83,null));};exports[_0x1712('0x1d')]=function(_0x243e5f,_0x5dd471){return db[_0x1712('0x26')][_0x1712('0x43')]({'where':{'id':_0x243e5f['params']['id']}})['then'](handleEntityNotFound(_0x5dd471,null))[_0x1712('0x1c')](removeEntity(_0x5dd471,null))[_0x1712('0x40')](handleError(_0x5dd471,null));};exports[_0x1712('0x44')]=function(_0x5cef41,_0x208d99){return db['ChatTransferReport'][_0x1712('0x44')]()[_0x1712('0x1c')](respondWithResult(_0x208d99,null))[_0x1712('0x40')](handleError(_0x208d99,null));};
\ No newline at end of file
+var _0x3b38=['findAll','rows','catch','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include'];(function(_0x2f19d1,_0x2867df){var _0x9fd241=function(_0x181c13){while(--_0x181c13){_0x2f19d1['push'](_0x2f19d1['shift']());}};_0x9fd241(++_0x2867df);}(_0x3b38,0xa2));var _0x83b3=function(_0x19f6ac,_0x508c58){_0x19f6ac=_0x19f6ac-0x0;var _0xcac7da=_0x3b38[_0x19f6ac];return _0xcac7da;};'use strict';var emlformat=require(_0x83b3('0x0'));var rimraf=require(_0x83b3('0x1'));var zipdir=require(_0x83b3('0x2'));var jsonpatch=require(_0x83b3('0x3'));var rp=require(_0x83b3('0x4'));var moment=require(_0x83b3('0x5'));var BPromise=require(_0x83b3('0x6'));var Mustache=require(_0x83b3('0x7'));var util=require('util');var path=require(_0x83b3('0x8'));var sox=require(_0x83b3('0x9'));var csv=require(_0x83b3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83b3('0xb'));var _=require(_0x83b3('0xc'));var squel=require(_0x83b3('0xd'));var crypto=require(_0x83b3('0xe'));var jsforce=require(_0x83b3('0xf'));var deskjs=require(_0x83b3('0x10'));var toCsv=require(_0x83b3('0xa'));var querystring=require(_0x83b3('0x11'));var Papa=require(_0x83b3('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x83b3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x83b3('0x14'))(_0x83b3('0x15'));var utils=require(_0x83b3('0x16'));var config=require(_0x83b3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x83b3('0x18'))['db'];function respondWithStatusCode(_0x81abb,_0xf54d4e){_0xf54d4e=_0xf54d4e||0xcc;return function(_0x39a8d2){if(_0x39a8d2){return _0x81abb[_0x83b3('0x19')](_0xf54d4e);}return _0x81abb[_0x83b3('0x1a')](_0xf54d4e)[_0x83b3('0x1b')]();};}function respondWithResult(_0x48453c,_0x332059){_0x332059=_0x332059||0xc8;return function(_0x29f9ad){if(_0x29f9ad){return _0x48453c[_0x83b3('0x1a')](_0x332059)[_0x83b3('0x1c')](_0x29f9ad);}};}function respondWithFilteredResult(_0x3ea6a7,_0x14918e){return function(_0x4cc6ba){if(_0x4cc6ba){var _0x4b90ff=typeof _0x14918e['offset']===_0x83b3('0x1d')&&typeof _0x14918e[_0x83b3('0x1e')]==='undefined';var _0x436bfc=_0x4cc6ba['count'];var _0x51ebba=_0x4b90ff?0x0:_0x14918e[_0x83b3('0x1f')];var _0xf0fbee=_0x4b90ff?_0x4cc6ba[_0x83b3('0x20')]:_0x14918e[_0x83b3('0x1f')]+_0x14918e[_0x83b3('0x1e')];var _0x5aa7c8;if(_0xf0fbee>=_0x436bfc){_0xf0fbee=_0x436bfc;_0x5aa7c8=0xc8;}else{_0x5aa7c8=0xce;}_0x3ea6a7[_0x83b3('0x1a')](_0x5aa7c8);return _0x3ea6a7[_0x83b3('0x21')](_0x83b3('0x22'),_0x51ebba+'-'+_0xf0fbee+'/'+_0x436bfc)[_0x83b3('0x1c')](_0x4cc6ba);}return null;};}function patchUpdates(_0x5e3d53){return function(_0x7bd0e1){try{jsonpatch[_0x83b3('0x23')](_0x7bd0e1,_0x5e3d53,!![]);}catch(_0x32a442){return BPromise['reject'](_0x32a442);}return _0x7bd0e1[_0x83b3('0x24')]();};}function saveUpdates(_0x5cbcd6,_0x419852){return function(_0xf7c76){if(_0xf7c76){return _0xf7c76[_0x83b3('0x25')](_0x5cbcd6)[_0x83b3('0x26')](function(_0x402373){return _0x402373;});}return null;};}function removeEntity(_0x414af3,_0x17310a){return function(_0x28dd42){if(_0x28dd42){return _0x28dd42[_0x83b3('0x27')]()['then'](function(){_0x414af3[_0x83b3('0x1a')](0xcc)[_0x83b3('0x1b')]();});}};}function handleEntityNotFound(_0x45230b,_0x258d37){return function(_0x38a2b4){if(!_0x38a2b4){_0x45230b[_0x83b3('0x19')](0x194);}return _0x38a2b4;};}function handleError(_0x315e40,_0x3aba73){_0x3aba73=_0x3aba73||0x1f4;return function(_0x522f61){logger[_0x83b3('0x28')](_0x522f61[_0x83b3('0x29')]);if(_0x522f61[_0x83b3('0x2a')]){delete _0x522f61[_0x83b3('0x2a')];}_0x315e40[_0x83b3('0x1a')](_0x3aba73)['send'](_0x522f61);};}exports[_0x83b3('0x2b')]=function(_0x56fab6,_0x542531){var _0xa7f2b8={},_0x107ee7={},_0x4762ed={'count':0x0,'rows':[]};var _0x57dad7=_[_0x83b3('0x2c')](db[_0x83b3('0x2d')][_0x83b3('0x2e')],function(_0x49f306){return{'name':_0x49f306[_0x83b3('0x2f')],'type':_0x49f306[_0x83b3('0x30')][_0x83b3('0x31')]};});_0x107ee7[_0x83b3('0x32')]=_[_0x83b3('0x2c')](_0x57dad7,'name');_0x107ee7[_0x83b3('0x33')]=_['keys'](_0x56fab6['query']);_0x107ee7[_0x83b3('0x34')]=_[_0x83b3('0x35')](_0x107ee7[_0x83b3('0x32')],_0x107ee7[_0x83b3('0x33')]);_0xa7f2b8[_0x83b3('0x36')]=_[_0x83b3('0x35')](_0x107ee7[_0x83b3('0x32')],qs[_0x83b3('0x37')](_0x56fab6[_0x83b3('0x33')][_0x83b3('0x37')]));_0xa7f2b8['attributes']=_0xa7f2b8[_0x83b3('0x36')][_0x83b3('0x38')]?_0xa7f2b8[_0x83b3('0x36')]:_0x107ee7[_0x83b3('0x32')];if(!_0x56fab6[_0x83b3('0x33')][_0x83b3('0x39')](_0x83b3('0x3a'))){_0xa7f2b8[_0x83b3('0x1e')]=qs[_0x83b3('0x1e')](_0x56fab6[_0x83b3('0x33')][_0x83b3('0x1e')]);_0xa7f2b8['offset']=qs[_0x83b3('0x1f')](_0x56fab6[_0x83b3('0x33')][_0x83b3('0x1f')]);}_0xa7f2b8['order']=qs[_0x83b3('0x3b')](_0x56fab6['query'][_0x83b3('0x3b')]);_0xa7f2b8[_0x83b3('0x3c')]=qs[_0x83b3('0x34')](_['pick'](_0x56fab6['query'],_0x107ee7[_0x83b3('0x34')]),_0x57dad7);if(_0x56fab6[_0x83b3('0x33')][_0x83b3('0x3d')]){_0xa7f2b8['where']=_[_0x83b3('0x3e')](_0xa7f2b8[_0x83b3('0x3c')],{'$or':_['map'](_0x57dad7,function(_0x58b1b5){if(_0x58b1b5['type']!==_0x83b3('0x3f')){var _0x34b44d={};_0x34b44d[_0x58b1b5[_0x83b3('0x2a')]]={'$like':'%'+_0x56fab6['query']['filter']+'%'};return _0x34b44d;}})});}_0xa7f2b8=_[_0x83b3('0x3e')]({},_0xa7f2b8,_0x56fab6[_0x83b3('0x40')]);var _0x30461e={'where':_0xa7f2b8[_0x83b3('0x3c')]};return db[_0x83b3('0x2d')][_0x83b3('0x20')](_0x30461e)[_0x83b3('0x26')](function(_0x2bb4db){_0x4762ed[_0x83b3('0x20')]=_0x2bb4db;if(_0x56fab6[_0x83b3('0x33')]['includeAll']){_0xa7f2b8[_0x83b3('0x41')]=[{'all':!![]}];}return db[_0x83b3('0x2d')][_0x83b3('0x42')](_0xa7f2b8);})['then'](function(_0x4df9c6){_0x4762ed[_0x83b3('0x43')]=_0x4df9c6;return _0x4762ed;})['then'](respondWithFilteredResult(_0x542531,_0xa7f2b8))[_0x83b3('0x44')](handleError(_0x542531,null));};exports['show']=function(_0x5a28dc,_0x4138bb){var _0x4a297b={'raw':!![],'where':{'id':_0x5a28dc[_0x83b3('0x45')]['id']}},_0x121893={};_0x121893['model']=_[_0x83b3('0x46')](db[_0x83b3('0x2d')][_0x83b3('0x2e')]);_0x121893[_0x83b3('0x33')]=_[_0x83b3('0x46')](_0x5a28dc['query']);_0x121893[_0x83b3('0x34')]=_[_0x83b3('0x35')](_0x121893[_0x83b3('0x32')],_0x121893[_0x83b3('0x33')]);_0x4a297b['attributes']=_[_0x83b3('0x35')](_0x121893[_0x83b3('0x32')],qs[_0x83b3('0x37')](_0x5a28dc[_0x83b3('0x33')][_0x83b3('0x37')]));_0x4a297b[_0x83b3('0x36')]=_0x4a297b['attributes'][_0x83b3('0x38')]?_0x4a297b[_0x83b3('0x36')]:_0x121893['model'];if(_0x5a28dc[_0x83b3('0x33')][_0x83b3('0x47')]){_0x4a297b['include']=[{'all':!![]}];}_0x4a297b=_[_0x83b3('0x3e')]({},_0x4a297b,_0x5a28dc['options']);return db[_0x83b3('0x2d')][_0x83b3('0x48')](_0x4a297b)[_0x83b3('0x26')](handleEntityNotFound(_0x4138bb,null))['then'](respondWithResult(_0x4138bb,null))[_0x83b3('0x44')](handleError(_0x4138bb,null));};exports[_0x83b3('0x49')]=function(_0xbe121f,_0x138b55){return db[_0x83b3('0x2d')][_0x83b3('0x49')](_0xbe121f[_0x83b3('0x4a')],{})[_0x83b3('0x26')](respondWithResult(_0x138b55,0xc9))[_0x83b3('0x44')](handleError(_0x138b55,null));};exports[_0x83b3('0x25')]=function(_0x6c11bd,_0x7cf904){if(_0x6c11bd['body']['id']){delete _0x6c11bd['body']['id'];}return db[_0x83b3('0x2d')][_0x83b3('0x48')]({'where':{'id':_0x6c11bd[_0x83b3('0x45')]['id']}})[_0x83b3('0x26')](handleEntityNotFound(_0x7cf904,null))[_0x83b3('0x26')](saveUpdates(_0x6c11bd[_0x83b3('0x4a')],null))['then'](respondWithResult(_0x7cf904,null))[_0x83b3('0x44')](handleError(_0x7cf904,null));};exports[_0x83b3('0x27')]=function(_0x253938,_0x10e2f5){return db[_0x83b3('0x2d')][_0x83b3('0x48')]({'where':{'id':_0x253938[_0x83b3('0x45')]['id']}})[_0x83b3('0x26')](handleEntityNotFound(_0x10e2f5,null))[_0x83b3('0x26')](removeEntity(_0x10e2f5,null))[_0x83b3('0x44')](handleError(_0x10e2f5,null));};exports['describe']=function(_0x270dc2,_0x83adf9){return db[_0x83b3('0x2d')][_0x83b3('0x4b')]()[_0x83b3('0x26')](respondWithResult(_0x83adf9,null))['catch'](handleError(_0x83adf9,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 17dbf2b..fd588c3 100644
--- a/server/api/chatTransferReport/chatTransferReport.model.js
+++ b/server/api/chatTransferReport/chatTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc16b=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x5460e5,_0x13d3d3){var _0x3c327b=function(_0x52c43f){while(--_0x52c43f){_0x5460e5['push'](_0x5460e5['shift']());}};_0x3c327b(++_0x13d3d3);}(_0xc16b,0xa0));var _0xbc16=function(_0x5b3b3b,_0x245a9f){_0x5b3b3b=_0x5b3b3b-0x0;var _0x50cacf=_0xc16b[_0x5b3b3b];return _0x50cacf;};'use strict';var _=require(_0xbc16('0x0'));var util=require(_0xbc16('0x1'));var logger=require('../../config/logger')(_0xbc16('0x2'));var moment=require(_0xbc16('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc16('0x4'));var rimraf=require(_0xbc16('0x5'));var config=require(_0xbc16('0x6'));var attributes=require(_0xbc16('0x7'));module[_0xbc16('0x8')]=function(_0x4b98ba,_0x1a4e19){return _0x4b98ba[_0xbc16('0x9')](_0xbc16('0xa'),attributes,{'tableName':_0xbc16('0xb'),'paranoid':![],'indexes':[{'name':_0xbc16('0xc'),'fields':[_0xbc16('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc447=['../../config/environment','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5cbd8b,_0x2e7a74){var _0xd53d8f=function(_0x2e0eeb){while(--_0x2e0eeb){_0x5cbd8b['push'](_0x5cbd8b['shift']());}};_0xd53d8f(++_0x2e7a74);}(_0xc447,0xa4));var _0x7c44=function(_0x573f8b,_0x34a870){_0x573f8b=_0x573f8b-0x0;var _0x28dd4a=_0xc447[_0x573f8b];return _0x28dd4a;};'use strict';var _=require(_0x7c44('0x0'));var util=require(_0x7c44('0x1'));var logger=require(_0x7c44('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7c44('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c44('0x4'));var rimraf=require(_0x7c44('0x5'));var config=require(_0x7c44('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x31f922,_0x281fd3){return _0x31f922[_0x7c44('0x7')]('ChatTransferReport',attributes,{'tableName':_0x7c44('0x8'),'paranoid':![],'indexes':[{'name':_0x7c44('0x9'),'fields':[_0x7c44('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index da49f48..9c45700 100644
--- a/server/api/chatTransferReport/chatTransferReport.rpc.js
+++ b/server/api/chatTransferReport/chatTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ab1=['debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6ab1,0xfc));var _0x16ab=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0x6ab1[_0x273f77];return _0x71e147;};'use strict';var _=require(_0x16ab('0x0'));var util=require(_0x16ab('0x1'));var moment=require(_0x16ab('0x2'));var BPromise=require(_0x16ab('0x3'));var rs=require(_0x16ab('0x4'));var fs=require('fs');var Redis=require(_0x16ab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x16ab('0x6'));var logger=require(_0x16ab('0x7'))('rpc');var config=require(_0x16ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x16ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f28dc,_0x47be60,_0x5ee303){return new BPromise(function(_0x1b8e08,_0x47271e){return client['request'](_0x2f28dc,_0x5ee303)[_0x16ab('0xa')](function(_0x199628){logger[_0x16ab('0xb')](_0x16ab('0xc'),_0x47be60,_0x16ab('0xd'));logger[_0x16ab('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x47be60,_0x16ab('0xd'),JSON[_0x16ab('0xf')](_0x199628));if(_0x199628[_0x16ab('0x10')]){if(_0x199628[_0x16ab('0x10')]['code']===0x1f4){logger[_0x16ab('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x47be60,_0x199628[_0x16ab('0x10')][_0x16ab('0x11')]);return _0x47271e(_0x199628[_0x16ab('0x10')][_0x16ab('0x11')]);}logger[_0x16ab('0x10')](_0x16ab('0xc'),_0x47be60,_0x199628[_0x16ab('0x10')]['message']);return _0x1b8e08(_0x199628[_0x16ab('0x10')][_0x16ab('0x11')]);}else{logger[_0x16ab('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x47be60,_0x16ab('0xd'));_0x1b8e08(_0x199628[_0x16ab('0x12')][_0x16ab('0x11')]);}})['catch'](function(_0x3fb621){logger[_0x16ab('0x10')](_0x16ab('0xc'),_0x47be60,_0x3fb621);_0x47271e(_0x3fb621);});});}
\ No newline at end of file
+var _0xe14f=['../../config/environment','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x249f8c,_0xfb3946){var _0x5e224a=function(_0xd4c5a1){while(--_0xd4c5a1){_0x249f8c['push'](_0x249f8c['shift']());}};_0x5e224a(++_0xfb3946);}(_0xe14f,0x1db));var _0xfe14=function(_0x22cabc,_0x39776d){_0x22cabc=_0x22cabc-0x0;var _0x28a8dc=_0xe14f[_0x22cabc];return _0x28a8dc;};'use strict';var _=require(_0xfe14('0x0'));var util=require(_0xfe14('0x1'));var moment=require(_0xfe14('0x2'));var BPromise=require(_0xfe14('0x3'));var rs=require(_0xfe14('0x4'));var fs=require('fs');var Redis=require(_0xfe14('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfe14('0x6'))(_0xfe14('0x7'));var config=require(_0xfe14('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfe14('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45141c,_0x56408b,_0x3a0409){return new BPromise(function(_0x38e52b,_0x3e68c0){return client[_0xfe14('0xa')](_0x45141c,_0x3a0409)['then'](function(_0x5a3c48){logger[_0xfe14('0xb')](_0xfe14('0xc'),_0x56408b,_0xfe14('0xd'));logger[_0xfe14('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x56408b,_0xfe14('0xd'),JSON[_0xfe14('0xf')](_0x5a3c48));if(_0x5a3c48[_0xfe14('0x10')]){if(_0x5a3c48[_0xfe14('0x10')][_0xfe14('0x11')]===0x1f4){logger['error'](_0xfe14('0xc'),_0x56408b,_0x5a3c48['error'][_0xfe14('0x12')]);return _0x3e68c0(_0x5a3c48[_0xfe14('0x10')][_0xfe14('0x12')]);}logger[_0xfe14('0x10')](_0xfe14('0xc'),_0x56408b,_0x5a3c48[_0xfe14('0x10')][_0xfe14('0x12')]);return _0x38e52b(_0x5a3c48[_0xfe14('0x10')][_0xfe14('0x12')]);}else{logger['info'](_0xfe14('0xc'),_0x56408b,_0xfe14('0xd'));_0x38e52b(_0x5a3c48[_0xfe14('0x13')][_0xfe14('0x12')]);}})[_0xfe14('0x14')](function(_0x41c9ab){logger['error'](_0xfe14('0xc'),_0x56408b,_0x41c9ab);_0x3e68c0(_0x41c9ab);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 4334230..3e608ad 100644
--- a/server/api/chatTransferReport/index.js
+++ b/server/api/chatTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5062=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy','exports','path','connect-timeout'];(function(_0x27793a,_0x1bf59a){var _0x4dc325=function(_0x2ccf27){while(--_0x2ccf27){_0x27793a['push'](_0x27793a['shift']());}};_0x4dc325(++_0x1bf59a);}(_0x5062,0xcf));var _0x2506=function(_0x3d6d0e,_0x5f5141){_0x3d6d0e=_0x3d6d0e-0x0;var _0xebbe34=_0x5062[_0x3d6d0e];return _0xebbe34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2506('0x0'));var timeout=require(_0x2506('0x1'));var express=require('express');var router=express[_0x2506('0x2')]();var fs_extra=require(_0x2506('0x3'));var auth=require(_0x2506('0x4'));var interaction=require(_0x2506('0x5'));var config=require(_0x2506('0x6'));var controller=require(_0x2506('0x7'));router[_0x2506('0x8')]('/',auth[_0x2506('0x9')](),controller[_0x2506('0xa')]);router[_0x2506('0x8')]('/describe',auth[_0x2506('0x9')](),controller[_0x2506('0xb')]);router[_0x2506('0x8')](_0x2506('0xc'),auth['isAuthenticated'](),controller[_0x2506('0xd')]);router[_0x2506('0xe')]('/',auth[_0x2506('0x9')](),controller['create']);router[_0x2506('0xf')](_0x2506('0xc'),auth[_0x2506('0x9')](),controller['update']);router[_0x2506('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2506('0x11')]);module[_0x2506('0x12')]=router;
\ No newline at end of file
+var _0xcbaf=['index','/describe','describe','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x507892,_0x54710d){var _0x2fed57=function(_0x2ed4f0){while(--_0x2ed4f0){_0x507892['push'](_0x507892['shift']());}};_0x2fed57(++_0x54710d);}(_0xcbaf,0x171));var _0xfcba=function(_0x1cab98,_0x1bd8a6){_0x1cab98=_0x1cab98-0x0;var _0x3bef4b=_0xcbaf[_0x1cab98];return _0x3bef4b;};'use strict';var multer=require('multer');var util=require(_0xfcba('0x0'));var path=require(_0xfcba('0x1'));var timeout=require(_0xfcba('0x2'));var express=require(_0xfcba('0x3'));var router=express[_0xfcba('0x4')]();var fs_extra=require(_0xfcba('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfcba('0x6'));var controller=require('./chatTransferReport.controller');router[_0xfcba('0x7')]('/',auth[_0xfcba('0x8')](),controller[_0xfcba('0x9')]);router[_0xfcba('0x7')](_0xfcba('0xa'),auth['isAuthenticated'](),controller[_0xfcba('0xb')]);router[_0xfcba('0x7')]('/:id',auth[_0xfcba('0x8')](),controller['show']);router['post']('/',auth[_0xfcba('0x8')](),controller[_0xfcba('0xc')]);router[_0xfcba('0xd')](_0xfcba('0xe'),auth[_0xfcba('0x8')](),controller[_0xfcba('0xf')]);router[_0xfcba('0x10')]('/:id',auth[_0xfcba('0x8')](),controller['destroy']);module[_0xfcba('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index e453a40..970cb48 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ce1=['ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','onlineForm','parse','getDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#011F6A','INTEGER'];(function(_0x5a0fde,_0x1e9a29){var _0x4816db=function(_0x4af880){while(--_0x4af880){_0x5a0fde['push'](_0x5a0fde['shift']());}};_0x4816db(++_0x1e9a29);}(_0x2ce1,0x1df));var _0x12ce=function(_0x4e2a0a,_0x3ec730){_0x4e2a0a=_0x4e2a0a-0x0;var _0x1f063d=_0x2ce1[_0x4e2a0a];return _0x1f063d;};'use strict';var Sequelize=require(_0x12ce('0x0'));var rs=require(_0x12ce('0x1'));module['exports']={'name':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x12ce('0x2')]},'mapKey':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x3')},'mapKeyOffline':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':_0x12ce('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':_0x12ce('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x12ce('0x7')]('rounded',_0x12ce('0x8')),'defaultValue':_0x12ce('0x9')},'header_online':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xa')},'start_chat_button':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xb')},'offline_chat_button':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xc')},'header_offline':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xd')},'download_transcript':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x12ce('0x10')]},'closingQuestion':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x13')},'noteTitle':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x14')},'placeholderMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x15')},'closingMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x17')},'conditionAgreement':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x18')},'ratingType':{'type':Sequelize[_0x12ce('0x7')](_0x12ce('0x19'),'thumb'),'defaultValue':_0x12ce('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x12ce('0x10')],'defaultValue':function(){return JSON[_0x12ce('0x1a')]({'items':[{'type':_0x12ce('0x1b'),'variable':null,'config':{'placeholder':_0x12ce('0x1c'),'type':_0x12ce('0x1d'),'required':!![]},'props':{'title':_0x12ce('0x1c'),'helpText':''}},{'type':_0x12ce('0x1b'),'props':{'title':_0x12ce('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x12ce('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x12ce('0x1e'))?JSON[_0x12ce('0x1f')](this[_0x12ce('0x20')](_0x12ce('0x1e'))):{};},'set':function(_0x440aa4){return this['setDataValue'](_0x12ce('0x1e'),JSON['stringify'](_0x440aa4));}},'offlineForm':{'type':Sequelize[_0x12ce('0x10')],'defaultValue':function(){return JSON[_0x12ce('0x1a')]({'items':[{'type':_0x12ce('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x12ce('0x3'),'type':_0x12ce('0x3')},'variable':null},{'type':_0x12ce('0x21'),'config':{'placeholder':_0x12ce('0x22')},'props':{'title':_0x12ce('0x22'),'helpText':_0x12ce('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x12ce('0x1f')](this['getDataValue'](_0x12ce('0x24'))):{};},'set':function(_0x303092){return this[_0x12ce('0x25')](_0x12ce('0x24'),JSON['stringify'](_0x303092));}},'token':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':function(){return rs[_0x12ce('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x12ce('0x2')]},'forwardOffline':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x12ce('0x2')]},'waitingTitle':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x17')},'sendUnmanaged':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x12ce('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x12ce('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x12ce('0x2b');}},'notificationSound':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x12ce('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x2d')},'verticalAlignment':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x12ce('0x2e')},'messagesAlignment':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x12ce('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x12ce('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':_0x12ce('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x12ce('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x12ce('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':_0x12ce('0x30')},'systemAvatar':{'type':Sequelize[_0x12ce('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x12ce('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x12ce('0xe')],'defaultValue':![],'comment':_0x12ce('0x32'),'set':function(_0x5cc6d8){if(!_0x5cc6d8)this[_0x12ce('0x25')](_0x12ce('0x33'),null);this[_0x12ce('0x25')](_0x12ce('0x34'),_0x5cc6d8);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x12ce('0x2')]},'vidaooTopic':{'type':Sequelize[_0x12ce('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x12ce('0x2')],'defaultValue':function(){return _0x12ce('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x12ce('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x12ce('0x10')]}};
\ No newline at end of file
+var _0x00b4=['Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','star','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x00b4,0x76));var _0x400b=function(_0x28db96,_0x1bdda9){_0x28db96=_0x28db96-0x0;var _0x51acc6=_0x00b4[_0x28db96];return _0x51acc6;};'use strict';var Sequelize=require(_0x400b('0x0'));var rs=require('randomstring');module[_0x400b('0x1')]={'name':{'type':Sequelize[_0x400b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'unique':_0x400b('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x4')},'mapKeyOffline':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x4')},'key':{'type':Sequelize[_0x400b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x400b('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':_0x400b('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':_0x400b('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x400b('0x2')]},'animation':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x400b('0x9')]('rounded','squared'),'defaultValue':_0x400b('0xa')},'header_online':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0xb')},'offline_chat_button':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0xd')},'download_transcript':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x400b('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x12')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x13')},'ratingType':{'type':Sequelize[_0x400b('0x9')]('star',_0x400b('0x14')),'defaultValue':_0x400b('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x400b('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x400b('0x16')],'defaultValue':function(){return JSON[_0x400b('0x17')]({'items':[{'type':_0x400b('0x18'),'variable':null,'config':{'placeholder':_0x400b('0x19'),'type':_0x400b('0x1a'),'required':!![]},'props':{'title':_0x400b('0x19'),'helpText':''}},{'type':_0x400b('0x18'),'props':{'title':_0x400b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x400b('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x400b('0x1b')](_0x400b('0x1c'))?JSON[_0x400b('0x1d')](this['getDataValue'](_0x400b('0x1c'))):{};},'set':function(_0x395325){return this[_0x400b('0x1e')]('onlineForm',JSON['stringify'](_0x395325));}},'offlineForm':{'type':Sequelize[_0x400b('0x16')],'defaultValue':function(){return JSON[_0x400b('0x17')]({'items':[{'type':_0x400b('0x18'),'props':{'title':_0x400b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x400b('0x4'),'type':_0x400b('0x4')},'variable':null},{'type':_0x400b('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x400b('0x20'),'helpText':_0x400b('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x400b('0x1b')](_0x400b('0x22'))?JSON['parse'](this[_0x400b('0x1b')](_0x400b('0x22'))):{};},'set':function(_0x43963e){return this[_0x400b('0x1e')](_0x400b('0x22'),JSON[_0x400b('0x17')](_0x43963e));}},'token':{'type':Sequelize[_0x400b('0x2')],'defaultValue':function(){return rs[_0x400b('0x23')]();}},'autoclose':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x400b('0x2')]},'forwardOffline':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x400b('0x2')]},'waitingTitle':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x24')},'waitingMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x27')},'sendUnmanaged':{'type':Sequelize[_0x400b('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x400b('0x16')]},'showAgentAvatar':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x400b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x400b('0x16')],'defaultValue':function(){return _0x400b('0x28');}},'notificationSound':{'type':Sequelize[_0x400b('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x400b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x2a')},'verticalAlignment':{'type':Sequelize[_0x400b('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x2b')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x400b('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x400b('0x16')]},'showCustomerAvatar':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x400b('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':_0x400b('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x400b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x400b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x400b('0x2')],'defaultValue':_0x400b('0x2e')},'systemAvatar':{'type':Sequelize[_0x400b('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x400b('0xe')],'comment':_0x400b('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x400b('0x8')],'defaultValue':![],'comment':_0x400b('0x30'),'set':function(_0x43df8a){if(!_0x43df8a)this['setDataValue'](_0x400b('0x31'),null);this['setDataValue'](_0x400b('0x32'),_0x43df8a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x400b('0x2')]},'vidaooTopic':{'type':Sequelize[_0x400b('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x400b('0x2')],'defaultValue':function(){return _0x400b('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x400b('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 81eb114..7d6be0e 100644
--- a/server/api/chatWebsite/chatWebsite.controller.js
+++ b/server/api/chatWebsite/chatWebsite.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5096=['params','length','find','catch','create','testWildcardValidity','body','address','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','order','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','resolve','timezone','ifTime','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','CmContact','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','Interval','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','ListId','from','contact','headers','threadId','closed','ChatInteraction','externalUrl','interaction','firstName','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','*,*,*,*','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','offline','files','ValidationError','difference','send','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','fromString','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','tag','getSnippet','interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','3.9.0','origin','remote','connection','remoteAddress','replace','alignment','color','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','json','getApplications','chatProactiveAction','addProactiveActions','getFields','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','User','getAgents','mustache','util','path','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','URL','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','info','sendStatus','status','end','offset','undefined','count','update','get','ChatWebsites','destroy','stack','name','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','stringify','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','map','query','keys','intersection','attributes','fields','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show'];(function(_0x17aa2e,_0x15508a){var _0x11bee9=function(_0x2a6a99){while(--_0x2a6a99){_0x17aa2e['push'](_0x17aa2e['shift']());}};_0x11bee9(++_0x15508a);}(_0x5096,0xd6));var _0x6509=function(_0x65ff6c,_0x4c2da3){_0x65ff6c=_0x65ff6c-0x0;var _0x238215=_0x5096[_0x65ff6c];return _0x238215;};'use strict';var Mustache=require(_0x6509('0x0'));var util=require(_0x6509('0x1'));var path=require(_0x6509('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6509('0x3'));var _=require(_0x6509('0x4'));var querystring=require(_0x6509('0x5'));var htmlToText=require(_0x6509('0x6'));var Redis=require(_0x6509('0x7'));var jayson=require(_0x6509('0x8'));var qs=require(_0x6509('0x9'));var logger=require('../../config/logger')(_0x6509('0xa'));var config=require(_0x6509('0xb'));var APIBadRequestError=require(_0x6509('0xc'))[_0x6509('0xd')];var APINotFoundError=require(_0x6509('0xc'))[_0x6509('0xe')];var APIOutOfIntervalError=require(_0x6509('0xc'))[_0x6509('0xf')];var APIHandleError=require(_0x6509('0xc'))[_0x6509('0x10')];var APIConflictError=require(_0x6509('0xc'))['APIConflictError'];var wildcardUtils=require(_0x6509('0x11'));var URL=require(_0x6509('0x12'))[_0x6509('0x13')];var db=require(_0x6509('0x14'))['db'];config['redis']=_[_0x6509('0x15')](config[_0x6509('0x16')],{'host':_0x6509('0x17'),'port':0x18eb});var socket=require(_0x6509('0x18'))(new Redis(config[_0x6509('0x16')]));require(_0x6509('0x19'))[_0x6509('0x1a')](socket);var client=jayson[_0x6509('0x1b')][_0x6509('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client'][_0x6509('0x1c')]({'port':0x232b});var client9001=jayson['client'][_0x6509('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x35df2b,_0xdb3430,_0x3b9978,_0x4ef411){return new Promise(function(_0x2acec6,_0x44bb20){var _0x53c174=_0x4ef411||client;return _0x53c174['request'](_0x35df2b,_0x3b9978)[_0x6509('0x1d')](function(_0x39267d){logger['info']('ChatWebsite,\x20%s,\x20%s',_0xdb3430,_0x6509('0x1e'));logger[_0x6509('0x1f')](_0x6509('0x20'),_0xdb3430,_0x6509('0x1e'),JSON['stringify'](_0x39267d));if(_0x39267d[_0x6509('0x21')]){if(_0x39267d[_0x6509('0x21')][_0x6509('0x22')]===0x1f4){logger[_0x6509('0x21')](_0x6509('0x23'),_0xdb3430,_0x39267d[_0x6509('0x21')][_0x6509('0x24')]);return _0x44bb20(_0x39267d[_0x6509('0x21')][_0x6509('0x24')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0xdb3430,_0x39267d[_0x6509('0x21')][_0x6509('0x24')]);return _0x2acec6(_0x39267d['error'][_0x6509('0x24')]);}else{logger[_0x6509('0x25')](_0x6509('0x23'),_0xdb3430,_0x6509('0x1e'));_0x2acec6(_0x39267d['result']['message']);}})['catch'](function(_0x3015d1){logger[_0x6509('0x21')]('ChatWebsite,\x20%s,\x20%s',_0xdb3430,_0x3015d1);_0x44bb20(_0x3015d1);});});}function respondWithStatusCode(_0x3bc27b,_0x590948){_0x590948=_0x590948||0xcc;return function(_0x1ecc8b){if(_0x1ecc8b){return _0x3bc27b[_0x6509('0x26')](_0x590948);}return _0x3bc27b[_0x6509('0x27')](_0x590948)[_0x6509('0x28')]();};}function respondWithResult(_0x4287c6,_0xa7adf1){_0xa7adf1=_0xa7adf1||0xc8;return function(_0x261130){if(_0x261130){return _0x4287c6[_0x6509('0x27')](_0xa7adf1)['json'](_0x261130);}};}function respondWithFilteredResult(_0x37e9ef,_0x3f517e){return function(_0xcb9d99){if(_0xcb9d99){var _0xa91505=typeof _0x3f517e[_0x6509('0x29')]===_0x6509('0x2a')&&typeof _0x3f517e['limit']===_0x6509('0x2a');var _0x5733c8=_0xcb9d99[_0x6509('0x2b')];var _0x5ac1a8=_0xa91505?0x0:_0x3f517e[_0x6509('0x29')];var _0xbee06f=_0xa91505?_0xcb9d99[_0x6509('0x2b')]:_0x3f517e[_0x6509('0x29')]+_0x3f517e['limit'];var _0x3bb344;if(_0xbee06f>=_0x5733c8){_0xbee06f=_0x5733c8;_0x3bb344=0xc8;}else{_0x3bb344=0xce;}_0x37e9ef[_0x6509('0x27')](_0x3bb344);return _0x37e9ef['set']('Content-Range',_0x5ac1a8+'-'+_0xbee06f+'/'+_0x5733c8)['json'](_0xcb9d99);}return null;};}function saveUpdates(_0x27bd34){return function(_0x20713a){if(_0x20713a){return _0x20713a[_0x6509('0x2c')](_0x27bd34)[_0x6509('0x1d')](function(_0x34871d){return _0x34871d;});}return null;};}function removeEntity(_0x32db78){return function(_0x320b57){if(_0x320b57){return _0x320b57['destroy']()['then'](function(){var _0x3c9e0e=_0x320b57[_0x6509('0x2d')]({'plain':!![]});var _0x43760a=_0x6509('0x2e');return db['UserProfileResource'][_0x6509('0x2f')]({'where':{'type':_0x43760a,'resourceId':_0x3c9e0e['id']}})[_0x6509('0x1d')](function(){return _0x320b57;});})[_0x6509('0x1d')](function(){_0x32db78[_0x6509('0x27')](0xcc)[_0x6509('0x28')]();});}};}function handleEntityNotFound(_0x952bae){return function(_0x2229f9){if(!_0x2229f9){_0x952bae['sendStatus'](0x194);}return _0x2229f9;};}function handleError(_0x3165fa,_0x3613b2){_0x3613b2=_0x3613b2||0x1f4;return function(_0xdd0147){logger[_0x6509('0x21')](_0xdd0147[_0x6509('0x30')]);if(_0xdd0147[_0x6509('0x31')]){delete _0xdd0147[_0x6509('0x31')];}_0x3165fa[_0x6509('0x27')](_0x3613b2)['send'](_0xdd0147);};}function createInteractionObject(_0x1045f1,_0x3b4cb4,_0x14d81c,_0x5ab77f){var _0x19aab7=require(_0x6509('0x32'));var _0x2c1697=new _0x19aab7();var _0x3b6953=_0x2c1697[_0x6509('0x33')](_0x14d81c[_0x6509('0x34')])[_0x6509('0x35')]();var _0x30700b=_0x3b4cb4[_0x6509('0x36')];if(_0x14d81c[_0x6509('0x37')]){_0x30700b=_0x14d81c[_0x6509('0x37')];}else if(_0x14d81c['x-forwarded-for']){_0x30700b=_[_0x6509('0x38')](_0x14d81c[_0x6509('0x39')][_0x6509('0x3a')](','));}return{'ContactId':_0x5ab77f['id'],'ChatWebsiteId':_0x1045f1,'from':(_0x5ab77f['firstName']||'')+'\x20'+(_0x5ab77f[_0x6509('0x3b')]||''),'customerIp':_0x30700b,'customerPort':_0x14d81c['x-real-port']?_0x14d81c[_0x6509('0x3c')]:null,'referer':_0x3b4cb4[_0x6509('0x3d')],'browserName':_0x3b6953['browser']['name']&&_0x3b6953[_0x6509('0x3e')][_0x6509('0x3f')]?util[_0x6509('0x40')](_0x6509('0x41'),_0x3b6953[_0x6509('0x3e')]['name'],_0x3b6953['browser'][_0x6509('0x3f')]):_0x6509('0x42'),'browserVersion':_0x3b6953[_0x6509('0x3e')][_0x6509('0x3f')]||_0x6509('0x42'),'osName':util[_0x6509('0x40')](_0x6509('0x41'),_0x3b6953['os'][_0x6509('0x31')],_0x3b6953['os'][_0x6509('0x3f')]),'osVersion':_0x3b6953['os'][_0x6509('0x3f')],'deviceModel':_0x3b6953[_0x6509('0x43')][_0x6509('0x44')]&&_0x3b6953[_0x6509('0x43')][_0x6509('0x45')]?util[_0x6509('0x40')](_0x6509('0x46'),_0x3b6953[_0x6509('0x43')]['model'],_0x3b6953['device'][_0x6509('0x45')],_0x3b6953[_0x6509('0x43')][_0x6509('0x47')]):null,'deviceVendor':_0x3b6953[_0x6509('0x43')][_0x6509('0x45')],'deviceType':_0x3b6953[_0x6509('0x43')]['type'],'formData':JSON[_0x6509('0x48')](_0x3b4cb4)};}exports['index']=function(_0x480d57,_0x193757){var _0x52c02b={'include':[{'model':db[_0x6509('0x49')],'as':_0x6509('0x4a')}]},_0x4e475c={},_0x40f1d9={'count':0x0,'rows':[]};var _0x3b1303=_['map'](db[_0x6509('0x4b')][_0x6509('0x4c')],function(_0x296a44){return{'name':_0x296a44[_0x6509('0x4d')],'type':_0x296a44['type']['key']};});_0x4e475c['model']=_[_0x6509('0x4e')](_0x3b1303,_0x6509('0x31'));_0x4e475c[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x480d57[_0x6509('0x4f')]);_0x4e475c['filters']=_[_0x6509('0x51')](_0x4e475c[_0x6509('0x44')],_0x4e475c[_0x6509('0x4f')]);_0x52c02b[_0x6509('0x52')]=_[_0x6509('0x51')](_0x4e475c['model'],qs[_0x6509('0x53')](_0x480d57[_0x6509('0x4f')][_0x6509('0x53')]));_0x52c02b[_0x6509('0x52')]=_0x52c02b[_0x6509('0x52')]['length']?_0x52c02b[_0x6509('0x52')]:_0x4e475c['model'];if(!_0x480d57[_0x6509('0x4f')]['hasOwnProperty'](_0x6509('0x54'))){_0x52c02b[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x480d57['query'][_0x6509('0x55')]);_0x52c02b[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x480d57['query'][_0x6509('0x29')]);}_0x52c02b['order']=qs[_0x6509('0x56')](_0x480d57[_0x6509('0x4f')]['sort']);_0x52c02b[_0x6509('0x57')]=qs[_0x6509('0x58')](_[_0x6509('0x59')](_0x480d57['query'],_0x4e475c[_0x6509('0x58')]),_0x3b1303);if(_0x480d57['query'][_0x6509('0x5a')]){_0x52c02b['where']=_[_0x6509('0x5b')](_0x52c02b[_0x6509('0x57')],{'$or':_['map'](_0x3b1303,function(_0x548b5e){if(_0x548b5e['type']!==_0x6509('0x5c')){var _0x21ef44={};_0x21ef44[_0x548b5e[_0x6509('0x31')]]={'$like':'%'+_0x480d57['query'][_0x6509('0x5a')]+'%'};return _0x21ef44;}})});}_0x52c02b=_['merge']({},_0x52c02b,_0x480d57[_0x6509('0x5d')]);var _0x1b60a3={'where':_0x52c02b[_0x6509('0x57')]};return db[_0x6509('0x4b')][_0x6509('0x2b')](_0x1b60a3)[_0x6509('0x1d')](function(_0x3fb67a){_0x40f1d9[_0x6509('0x2b')]=_0x3fb67a;if(_0x480d57[_0x6509('0x4f')][_0x6509('0x5e')]){_0x52c02b[_0x6509('0x5f')]=[{'all':!![]}];}return db[_0x6509('0x4b')]['findAll'](_0x52c02b);})[_0x6509('0x1d')](function(_0x4a91eb){_0x40f1d9[_0x6509('0x60')]=_0x4a91eb;return _0x40f1d9;})[_0x6509('0x1d')](respondWithFilteredResult(_0x193757,_0x52c02b))['catch'](handleError(_0x193757,null));};exports[_0x6509('0x61')]=function(_0x353847,_0x13a567){var _0x443ace={'raw':![],'where':{'id':_0x353847[_0x6509('0x62')]['id']},'include':[{'model':db[_0x6509('0x49')],'as':_0x6509('0x4a')}]},_0x1f3178={};_0x1f3178[_0x6509('0x44')]=_[_0x6509('0x50')](db[_0x6509('0x4b')][_0x6509('0x4c')]);_0x1f3178[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x353847['query']);_0x1f3178['filters']=_[_0x6509('0x51')](_0x1f3178['model'],_0x1f3178[_0x6509('0x4f')]);_0x443ace['attributes']=_[_0x6509('0x51')](_0x1f3178[_0x6509('0x44')],qs[_0x6509('0x53')](_0x353847[_0x6509('0x4f')][_0x6509('0x53')]));_0x443ace[_0x6509('0x52')]=_0x443ace[_0x6509('0x52')][_0x6509('0x63')]?_0x443ace['attributes']:_0x1f3178['model'];if(_0x353847['query'][_0x6509('0x5e')]){_0x443ace[_0x6509('0x5f')]=[{'all':!![]}];}_0x443ace=_[_0x6509('0x5b')]({},_0x443ace,_0x353847[_0x6509('0x5d')]);return db[_0x6509('0x4b')][_0x6509('0x64')](_0x443ace)[_0x6509('0x1d')](handleEntityNotFound(_0x13a567,null))[_0x6509('0x1d')](respondWithResult(_0x13a567,null))[_0x6509('0x65')](handleError(_0x13a567,null));};exports[_0x6509('0x66')]=function(_0x5cb310,_0x114ef2){if(!wildcardUtils[_0x6509('0x67')](_0x5cb310[_0x6509('0x68')][_0x6509('0x69')])){return handleError(_0x114ef2,null)(new APIBadRequestError('\x22'+_0x5cb310['body'][_0x6509('0x69')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}return db[_0x6509('0x4b')][_0x6509('0x66')](_0x5cb310['body'],{})[_0x6509('0x1d')](function(_0x3899de){var _0xf3143a=_0x5cb310['user'][_0x6509('0x2d')]({'plain':!![]});if(!_0xf3143a)throw new Error(_0x6509('0x6a'));if(_0xf3143a[_0x6509('0x6b')]==='user'){var _0x5a1e8e=_0x3899de[_0x6509('0x2d')]({'plain':!![]});var _0x5a0820=_0x6509('0x2e');return db['UserProfileSection']['find']({'where':{'name':_0x5a0820,'userProfileId':_0xf3143a['userProfileId']},'raw':!![]})[_0x6509('0x1d')](function(_0x8cb18b){if(_0x8cb18b&&_0x8cb18b[_0x6509('0x6c')]===0x0){return db[_0x6509('0x6d')]['create']({'name':_0x5a1e8e['name'],'resourceId':_0x5a1e8e['id'],'type':_0x8cb18b['name'],'sectionId':_0x8cb18b['id']},{})[_0x6509('0x1d')](function(){return _0x3899de;});}else{return _0x3899de;}})['catch'](function(_0x59d131){logger[_0x6509('0x21')](_0x6509('0x6e'),_0x59d131);throw _0x59d131;});}return _0x3899de;})[_0x6509('0x1d')](respondWithResult(_0x114ef2,0xc9))[_0x6509('0x65')](handleError(_0x114ef2,null));};exports['update']=function(_0x2774b4,_0x46a69a){if(!wildcardUtils[_0x6509('0x67')](_0x2774b4[_0x6509('0x68')][_0x6509('0x69')])){return handleError(_0x46a69a,null)(new APIBadRequestError('\x22'+_0x2774b4[_0x6509('0x68')][_0x6509('0x69')]+_0x6509('0x6f')));}if(_0x2774b4[_0x6509('0x68')]['id']){delete _0x2774b4[_0x6509('0x68')]['id'];}return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x2774b4['params']['id']},'include':[{'model':db[_0x6509('0x49')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x46a69a,null))[_0x6509('0x1d')](saveUpdates(_0x2774b4[_0x6509('0x68')],null))['then'](respondWithResult(_0x46a69a,null))[_0x6509('0x65')](handleError(_0x46a69a,null));};exports[_0x6509('0x2f')]=function(_0x3276e5,_0xb85645){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x3276e5[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0xb85645,null))[_0x6509('0x1d')](removeEntity(_0xb85645,null))[_0x6509('0x65')](handleError(_0xb85645,null));};exports[_0x6509('0x70')]=function(_0x2de805,_0x56e9e7){return db['ChatWebsite'][_0x6509('0x70')]()[_0x6509('0x1d')](respondWithResult(_0x56e9e7,null))[_0x6509('0x65')](handleError(_0x56e9e7,null));};exports[_0x6509('0x71')]=function(_0x52757a,_0x33daa8){if(_0x52757a[_0x6509('0x68')]['id']){delete _0x52757a[_0x6509('0x68')]['id'];}return db[_0x6509('0x4b')]['find']({'where':{'id':_0x52757a[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x33daa8,null))[_0x6509('0x1d')](function(_0x3152ff){if(_0x3152ff){_0x52757a[_0x6509('0x68')][_0x6509('0x72')]=_0x3152ff['id'];return db[_0x6509('0x73')][_0x6509('0x66')](_0x52757a[_0x6509('0x68')]);}})[_0x6509('0x1d')](respondWithResult(_0x33daa8,null))[_0x6509('0x65')](handleError(_0x33daa8,null));};exports[_0x6509('0x74')]=function(_0x3f5412,_0x521bef){var _0x2ac517={'raw':![],'where':{}};var _0x2feaf7={};var _0x3cd9bd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6509('0x75')]({'where':{'id':_0x3f5412[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x521bef,null))[_0x6509('0x1d')](function(_0x2938ba){if(_0x2938ba){_0x2feaf7[_0x6509('0x44')]=_['keys'](db[_0x6509('0x73')][_0x6509('0x4c')]);_0x2feaf7[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x3f5412['query']);_0x2feaf7[_0x6509('0x58')]=_[_0x6509('0x51')](_0x2feaf7[_0x6509('0x44')],_0x2feaf7['query']);_0x2ac517[_0x6509('0x52')]=_[_0x6509('0x51')](_0x2feaf7[_0x6509('0x44')],qs['fields'](_0x3f5412['query'][_0x6509('0x53')]));_0x2ac517['attributes']=_0x2ac517['attributes']['length']?_0x2ac517[_0x6509('0x52')]:_0x2feaf7['model'];if(!_0x3f5412['query'][_0x6509('0x76')](_0x6509('0x54'))){_0x2ac517[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x3f5412[_0x6509('0x4f')]['limit']);_0x2ac517[_0x6509('0x29')]=qs['offset'](_0x3f5412[_0x6509('0x4f')][_0x6509('0x29')]);}_0x2ac517[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x3f5412['query']['sort']);_0x2ac517[_0x6509('0x57')]=qs[_0x6509('0x58')](_[_0x6509('0x59')](_0x3f5412['query'],_0x2feaf7[_0x6509('0x58')]));_0x2ac517[_0x6509('0x57')][_0x6509('0x72')]=_0x2938ba['id'];if(_0x3f5412['query'][_0x6509('0x5a')]){_0x2ac517[_0x6509('0x57')]=_['merge'](_0x2ac517[_0x6509('0x57')],{'$or':_['map'](_0x2ac517['attributes'],function(_0x37554f){var _0x599a2f={};_0x599a2f[_0x37554f]={'$like':'%'+_0x3f5412[_0x6509('0x4f')][_0x6509('0x5a')]+'%'};return _0x599a2f;})});}_0x2ac517=_[_0x6509('0x5b')]({},_0x2ac517,_0x3f5412[_0x6509('0x5d')]);return db['Disposition'][_0x6509('0x2b')]({'where':_0x2ac517['where']})[_0x6509('0x1d')](function(_0x43fd3f){_0x3cd9bd[_0x6509('0x2b')]=_0x43fd3f;if(_0x3f5412[_0x6509('0x4f')]['includeAll']){_0x2ac517[_0x6509('0x5f')]=[{'all':!![]}];}return db[_0x6509('0x73')][_0x6509('0x78')](_0x2ac517);})[_0x6509('0x1d')](function(_0x3e22e6){_0x3cd9bd[_0x6509('0x60')]=_0x3e22e6;return _0x3cd9bd;});}})['then'](respondWithFilteredResult(_0x521bef,_0x2ac517))[_0x6509('0x65')](handleError(_0x521bef,null));};exports[_0x6509('0x79')]=function(_0x3e0b09,_0x2f9c6b){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x3e0b09[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x2f9c6b,null))['then'](function(_0x3381f3){if(_0x3381f3){return _0x3381f3[_0x6509('0x79')](_0x3e0b09['query']['ids']);}})['then'](respondWithStatusCode(_0x2f9c6b,null))[_0x6509('0x65')](handleError(_0x2f9c6b,null));};exports[_0x6509('0x7a')]=function(_0x37e5ed,_0x3ce243){if(_0x37e5ed['body']['id']){delete _0x37e5ed[_0x6509('0x68')]['id'];}return db[_0x6509('0x4b')]['find']({'where':{'id':_0x37e5ed[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x3ce243,null))[_0x6509('0x1d')](function(_0x2aa56b){if(_0x2aa56b){_0x37e5ed[_0x6509('0x68')][_0x6509('0x72')]=_0x2aa56b['id'];return db[_0x6509('0x7b')][_0x6509('0x66')](_0x37e5ed[_0x6509('0x68')]);}})[_0x6509('0x1d')](respondWithResult(_0x3ce243,null))[_0x6509('0x65')](handleError(_0x3ce243,null));};exports[_0x6509('0x7c')]=function(_0x49a3f0,_0x3aefbb){var _0x3047c9={'raw':![],'where':{}};var _0x5b0749={};var _0x5c8212={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6509('0x75')]({'where':{'id':_0x49a3f0[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x3aefbb,null))['then'](function(_0x2dcfd7){if(_0x2dcfd7){_0x5b0749['model']=_[_0x6509('0x50')](db['CannedAnswer'][_0x6509('0x4c')]);_0x5b0749['query']=_[_0x6509('0x50')](_0x49a3f0['query']);_0x5b0749[_0x6509('0x58')]=_[_0x6509('0x51')](_0x5b0749[_0x6509('0x44')],_0x5b0749[_0x6509('0x4f')]);_0x3047c9[_0x6509('0x52')]=_['intersection'](_0x5b0749['model'],qs[_0x6509('0x53')](_0x49a3f0[_0x6509('0x4f')][_0x6509('0x53')]));_0x3047c9[_0x6509('0x52')]=_0x3047c9['attributes']['length']?_0x3047c9[_0x6509('0x52')]:_0x5b0749[_0x6509('0x44')];if(!_0x49a3f0[_0x6509('0x4f')][_0x6509('0x76')]('nolimit')){_0x3047c9[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x49a3f0[_0x6509('0x4f')][_0x6509('0x55')]);_0x3047c9[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x49a3f0[_0x6509('0x4f')]['offset']);}_0x3047c9['order']=qs[_0x6509('0x56')](_0x49a3f0['query'][_0x6509('0x56')]);_0x3047c9['where']=qs['filters'](_[_0x6509('0x59')](_0x49a3f0[_0x6509('0x4f')],_0x5b0749[_0x6509('0x58')]));_0x3047c9[_0x6509('0x57')][_0x6509('0x72')]=_0x2dcfd7['id'];if(_0x49a3f0[_0x6509('0x4f')][_0x6509('0x5a')]){_0x3047c9[_0x6509('0x57')]=_[_0x6509('0x5b')](_0x3047c9[_0x6509('0x57')],{'$or':_['map'](_0x3047c9['attributes'],function(_0x50270a){var _0x58c68d={};_0x58c68d[_0x50270a]={'$like':'%'+_0x49a3f0['query'][_0x6509('0x5a')]+'%'};return _0x58c68d;})});}_0x3047c9=_['merge']({},_0x3047c9,_0x49a3f0[_0x6509('0x5d')]);return db[_0x6509('0x7b')][_0x6509('0x2b')]({'where':_0x3047c9[_0x6509('0x57')]})[_0x6509('0x1d')](function(_0x130f11){_0x5c8212[_0x6509('0x2b')]=_0x130f11;if(_0x49a3f0['query'][_0x6509('0x5e')]){_0x3047c9[_0x6509('0x5f')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3047c9);})['then'](function(_0x1c8f7e){_0x5c8212[_0x6509('0x60')]=_0x1c8f7e;return _0x5c8212;});}})[_0x6509('0x1d')](respondWithFilteredResult(_0x3aefbb,_0x3047c9))['catch'](handleError(_0x3aefbb,null));};exports[_0x6509('0x7d')]=function(_0x5b91d4,_0x5a077f){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x5b91d4[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x5a077f,null))[_0x6509('0x1d')](function(_0xacd415){if(_0xacd415){return _0xacd415[_0x6509('0x7d')](_0x5b91d4[_0x6509('0x4f')][_0x6509('0x7e')]);}})[_0x6509('0x1d')](respondWithStatusCode(_0x5a077f,null))['catch'](handleError(_0x5a077f,null));};exports[_0x6509('0x7f')]=function(_0x3ee6cf,_0x5c20a1){_0x3ee6cf[_0x6509('0x68')][_0x6509('0x80')]=_0x3ee6cf[_0x6509('0x81')]['filename'];return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x3ee6cf[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x5c20a1,null))[_0x6509('0x1d')](saveUpdates(_0x3ee6cf[_0x6509('0x68')],null))[_0x6509('0x1d')](respondWithResult(_0x5c20a1,null))['catch'](handleError(_0x5c20a1,null));};exports[_0x6509('0x82')]=function(_0x207b0f,_0x33cded){_0x207b0f[_0x6509('0x68')][_0x6509('0x83')]=_0x207b0f[_0x6509('0x81')][_0x6509('0x84')];return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x207b0f[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x33cded,null))[_0x6509('0x1d')](saveUpdates(_0x207b0f['body'],null))[_0x6509('0x1d')](respondWithResult(_0x33cded,null))[_0x6509('0x65')](handleError(_0x33cded,null));};exports['addCustomerAvatar']=function(_0x158232,_0x4b2421){_0x158232[_0x6509('0x68')][_0x6509('0x85')]=_0x158232[_0x6509('0x81')][_0x6509('0x84')];return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x158232[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x4b2421,null))[_0x6509('0x1d')](saveUpdates(_0x158232[_0x6509('0x68')],null))['then'](respondWithResult(_0x4b2421,null))[_0x6509('0x65')](handleError(_0x4b2421,null));};exports[_0x6509('0x86')]=function(_0xafdfc7,_0x32e990){_0xafdfc7[_0x6509('0x68')][_0x6509('0x87')]=_0xafdfc7[_0x6509('0x81')][_0x6509('0x84')];return db[_0x6509('0x4b')]['find']({'where':{'id':_0xafdfc7[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x32e990,null))['then'](saveUpdates(_0xafdfc7[_0x6509('0x68')],null))['then'](respondWithResult(_0x32e990,null))[_0x6509('0x65')](handleError(_0x32e990,null));};exports[_0x6509('0x88')]=function(_0x595926,_0x52b59e){var _0x578686=path[_0x6509('0x89')](config[_0x6509('0x8a')],'server/files/images/logos/default_logo.svg');var _0x89fb0e={'where':{'id':_0x595926[_0x6509('0x62')]['id']},'attributes':['id',_0x6509('0x80')],'raw':!![]};var _0x1b952a=![];return require(_0x6509('0x8b'))[_0x6509('0x8c')]()['then'](function(_0x1ded52){if(_0x1ded52){_0x1b952a=_0x1ded52[_0x6509('0x8d')];}})[_0x6509('0x1d')](function(){return db[_0x6509('0x4b')][_0x6509('0x64')](_0x89fb0e);})[_0x6509('0x1d')](handleEntityNotFound(_0x52b59e,null))[_0x6509('0x1d')](function(_0x4988a1){if(_0x4988a1){if(!_[_0x6509('0x8e')](_0x4988a1[_0x6509('0x80')])){if(fs['existsSync'](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x8f'),_0x4988a1[_0x6509('0x80')]))&&_0x1b952a){_0x578686=path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x8f'),_0x4988a1[_0x6509('0x80')]);}}return _0x52b59e[_0x6509('0x90')](_0x578686);}})[_0x6509('0x65')](handleError(_0x52b59e,null));};exports[_0x6509('0x91')]=function(_0x87e938,_0x340011){var _0x1dd3a0=path[_0x6509('0x89')](config[_0x6509('0x8a')],'server/files/images/avatars/default_avatar.png');var _0x485a63={'where':{'id':_0x87e938['params']['id']},'attributes':['id',_0x6509('0x83')],'raw':!![]};return db['ChatWebsite']['find'](_0x485a63)[_0x6509('0x1d')](handleEntityNotFound(_0x340011,null))['then'](function(_0x450ee7){if(_0x450ee7){if(!_[_0x6509('0x8e')](_0x450ee7[_0x6509('0x83')])){if(fs[_0x6509('0x92')](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x93'),_0x450ee7['agentAvatar']))){_0x1dd3a0=path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x93'),_0x450ee7[_0x6509('0x83')]);}}return _0x340011[_0x6509('0x90')](_0x1dd3a0);}})['catch'](handleError(_0x340011,null));};exports[_0x6509('0x94')]=function(_0x12f6b4,_0x30f3fa){var _0x1e0f90=path[_0x6509('0x89')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x599754={'where':{'id':_0x12f6b4[_0x6509('0x62')]['id']},'attributes':['id',_0x6509('0x85'),_0x6509('0x95')],'raw':!![]};return db[_0x6509('0x4b')][_0x6509('0x64')](_0x599754)['then'](handleEntityNotFound(_0x30f3fa,null))[_0x6509('0x1d')](function(_0x10f74e){if(_0x10f74e){if(!_[_0x6509('0x8e')](_0x10f74e[_0x6509('0x85')])){if(fs[_0x6509('0x92')](path['join'](config[_0x6509('0x8a')],_0x6509('0x93'),_0x10f74e['customerAvatar']))&&_0x10f74e['showCustomerAvatar']){_0x1e0f90=path[_0x6509('0x89')](config['root'],_0x6509('0x93'),_0x10f74e['customerAvatar']);}}return _0x30f3fa[_0x6509('0x90')](_0x1e0f90);}})[_0x6509('0x65')](handleError(_0x30f3fa,null));};exports[_0x6509('0x96')]=function(_0x3a74a4,_0x218ba1){var _0xc09a63=path['join'](config[_0x6509('0x8a')],'server/files/images/avatars/system_avatar.png');var _0x242a2d={'where':{'id':_0x3a74a4[_0x6509('0x62')]['id']},'attributes':['id',_0x6509('0x87')],'raw':!![]};return db[_0x6509('0x4b')][_0x6509('0x64')](_0x242a2d)['then'](handleEntityNotFound(_0x218ba1,null))[_0x6509('0x1d')](function(_0x573b7c){if(_0x573b7c){if(!_[_0x6509('0x8e')](_0x573b7c[_0x6509('0x87')])){if(fs[_0x6509('0x92')](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x93'),_0x573b7c[_0x6509('0x87')]))){_0xc09a63=path[_0x6509('0x89')](config['root'],_0x6509('0x93'),_0x573b7c['systemAvatar']);}}return _0x218ba1[_0x6509('0x90')](_0xc09a63);}})[_0x6509('0x65')](handleError(_0x218ba1,null));};function checkWebsiteInterval(_0x40df56){var _0x51c35c=_0x40df56['Interval'];if(!_0x51c35c){return Promise[_0x6509('0x97')](_0x40df56);}var _0x21c7f9=_0x40df56[_0x6509('0x98')]||undefined;return _0x51c35c[_0x6509('0x99')](_0x21c7f9)[_0x6509('0x1d')](function(_0x134b8d){if(!_0x134b8d){throw new APIOutOfIntervalError();}return _0x40df56;});}exports[_0x6509('0x9a')]=function(_0x20c370,_0x193d70){var _0x278d45={'body':_0x20c370[_0x6509('0x68')],'channel':_0x6509('0x9b')};var _0x170635=[];var _0x5460a4=[];var _0x572bf7={};var _0x169938=![];if(_0x20c370['body']['id']){delete _0x20c370['body']['id'];}if(_[_0x6509('0x8e')](_0x20c370['body']['from'])){throw new APIBadRequestError(_0x6509('0x9c'));}if(_[_0x6509('0x8e')](_0x20c370[_0x6509('0x68')][_0x6509('0x9d')])){throw new APIBadRequestError(_0x6509('0x9e'));}if(_[_0x6509('0x9f')](_0x20c370[_0x6509('0x68')][_0x6509('0x68')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x1c264e=_0x20c370[_0x6509('0x68')][_0x6509('0x36')]&&_0x20c370[_0x6509('0x68')][_0x6509('0x3d')];return db[_0x6509('0xa0')][_0x6509('0x70')]()['then'](function(_0x314b77){if(!_0x314b77){throw new Error(_0x6509('0xa1'));}_0x170635=Object['keys'](_0x314b77)['filter'](function(_0x1f3923){return![_0x6509('0xa2'),_0x6509('0xa3')]['includes'](_0x1f3923);});_0x5460a4=Object['keys'](_0x314b77)[_0x6509('0x5a')](function(_0x31860d){return![_0x6509('0xa2'),_0x6509('0xa3'),_0x6509('0xa4'),'ListId'][_0x6509('0xa5')](_0x31860d);});if(!_[_0x6509('0xa5')](_0x5460a4,_0x20c370[_0x6509('0x68')]['mapKey'])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x5460a4['join'](',\x20'));}_0x572bf7[_0x20c370[_0x6509('0x68')][_0x6509('0x9d')]]=_0x20c370[_0x6509('0x68')]['from'];})[_0x6509('0x1d')](function(){return db[_0x6509('0x4b')]['find']({'where':{'id':_0x20c370['params']['id']},'include':[{'model':db[_0x6509('0xa6')],'as':_0x6509('0xa7'),'include':[{'model':db[_0x6509('0xa0')],'as':_0x6509('0xa8'),'where':_0x572bf7,'limit':0x1,'order':[[_0x6509('0xa3'),_0x6509('0xa9')]]}]},{'model':db[_0x6509('0xaa')],'as':_0x6509('0xab')},{'model':db[_0x6509('0xac')],'as':'Interval','include':[{'model':db[_0x6509('0xac')],'as':_0x6509('0xad'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x6509('0x1d')](function(_0x4344f2){if(!_0x4344f2){throw new APINotFoundError(util[_0x6509('0x40')](_0x6509('0xae'),_0x20c370[_0x6509('0x62')]['id']));}if(_0x1c264e){return checkWebsiteInterval(_0x4344f2);}return _0x4344f2;})['then'](function(_0x2bc776){_0x278d45[_0x6509('0xaf')]=_0x2bc776;_0x278d45[_0x6509('0xb0')]=_[_0x6509('0xb1')](_0x2bc776[_0x6509('0xab')],[_0x6509('0xb2')],[_0x6509('0xb3')]);if(_0x278d45[_0x6509('0xaf')]['Applications']){delete _0x278d45[_0x6509('0xaf')][_0x6509('0xab')];}_0x278d45[_0x6509('0xb4')]=_0x2bc776['List']||{'id':_0x2bc776[_0x6509('0xb5')]};if(_0x278d45[_0x6509('0xb4')]&&_0x278d45[_0x6509('0xb4')]['Contacts'][_0x6509('0x63')]){return _0x278d45['list']['Contacts'][0x0];}var _0xb1613f=_[_0x6509('0x15')](_0x20c370[_0x6509('0x68')],{'firstName':_0x20c370[_0x6509('0x68')][_0x6509('0xb6')],'ListId':_0x2bc776[_0x6509('0xb5')]});_0xb1613f[_0x20c370['body'][_0x6509('0x9d')]]=_0x20c370[_0x6509('0x68')]['from'];return db['CmContact'][_0x6509('0x66')](_0xb1613f,{'fields':_0x170635,'raw':!![]});})['then'](function(_0x54b063){_0x278d45[_0x6509('0xb7')]=_0x54b063;var _0x3595b6=createInteractionObject(_0x20c370[_0x6509('0x62')]['id'],_0x20c370['body'],_0x20c370[_0x6509('0xb8')],_0x54b063);var _0x5d6f0e={'ChatWebsiteId':_0x20c370[_0x6509('0x62')]['id']};if(_0x20c370[_0x6509('0x68')][_0x6509('0xb9')]){_0x5d6f0e['threadId']=_0x20c370[_0x6509('0x68')][_0x6509('0xb9')];_0x5d6f0e[_0x6509('0xba')]=![];return db[_0x6509('0xbb')][_0x6509('0x64')]({'where':_0x5d6f0e})['then'](function(_0x1372be){var _0x4057e0=_0x20c370[_0x6509('0x68')][_0x6509('0x36')]&&_0x20c370[_0x6509('0x68')][_0x6509('0x3d')];if(_0x1372be){_0x169938=!![];return _0x1372be;}else if(!_0x4057e0&&_0x1372be&&_0x1372be['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x3595b6[_0x6509('0xb9')]=_0x20c370[_0x6509('0x68')]['threadId'];_0x3595b6[_0x6509('0xbc')]=_0x20c370[_0x6509('0x68')]['externalUrl'];return db['ChatInteraction'][_0x6509('0x66')](_0x3595b6);});}_0x5d6f0e['ContactId']=_0x54b063['id'];if(_0x20c370[_0x6509('0x68')]['interaction']&&_0x20c370[_0x6509('0x68')][_0x6509('0xbd')]['id']){_0x5d6f0e['id']=_0x20c370[_0x6509('0x68')][_0x6509('0xbd')]['id'];return db['ChatInteraction']['find']({'where':_0x5d6f0e})['then'](function(_0x4f0357){var _0x3667c3=_0x20c370[_0x6509('0x68')][_0x6509('0x36')]&&_0x20c370[_0x6509('0x68')]['referer'];if(!_0x3667c3&&_0x4f0357&&_0x4f0357[_0x6509('0xba')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x4f0357){_0x169938=!![];return _0x4f0357;}else{return db[_0x6509('0xbb')][_0x6509('0x66')](_0x3595b6);}});}return db[_0x6509('0xbb')]['create'](_0x3595b6);})[_0x6509('0x1d')](function(_0x28f24d){if(!_0x169938){return _0x28f24d;}var _0x524f73={'from':(_0x278d45[_0x6509('0xb7')][_0x6509('0xbe')]||'')+'\x20'+(_0x278d45['contact']['lastName']||'')};if(_0x20c370[_0x6509('0x68')][_0x6509('0xb9')]&&_0x20c370[_0x6509('0x68')][_0x6509('0xbf')]&&_0x20c370[_0x6509('0x68')][_0x6509('0xb9')]!=_0x20c370[_0x6509('0x68')][_0x6509('0xbf')]){_0x524f73['threadId']=_0x20c370[_0x6509('0x68')][_0x6509('0xbf')];}return _0x28f24d['update'](_0x524f73);})[_0x6509('0x1d')](function(_0x42d891){_0x278d45[_0x6509('0xbd')]=_0x42d891[_0x6509('0x2d')]({'plain':!![]});_0x278d45[_0x6509('0xbd')][_0x6509('0xc0')]=!_0x169938;if(_0x278d45[_0x6509('0xbd')][_0x6509('0xc0')]){if(_0x278d45[_0x6509('0xaf')][_0x6509('0xc1')]){_0x278d45['applications']['push']({'id':0x0,'priority':_0x278d45[_0x6509('0xb0')]['length']+0x1,'app':_0x6509('0xc2'),'appdata':_0x6509('0xc3'),'interval':'*,*,*,*'});}}return db[_0x6509('0xc4')][_0x6509('0x66')]({'body':_0x20c370[_0x6509('0x68')]['body'],'ChatWebsiteId':_0x20c370[_0x6509('0x62')]['id'],'ChatInteractionId':_0x42d891['id'],'direction':'in','ContactId':_0x278d45[_0x6509('0xb7')]['id'],'AttachmentId':_0x20c370['body'][_0x6509('0xc5')]});})[_0x6509('0x1d')](function(_0x16e17c){_0x278d45[_0x6509('0x24')]=_0x16e17c;if(!_0x278d45[_0x6509('0xbd')][_0x6509('0xc6')]){return;}return db['User']['find']({'attributes':['id',_0x6509('0x31')],'where':{'id':_0x278d45[_0x6509('0xbd')]['UserId']}});})['then'](function(_0x15ef3c){if(_0x15ef3c){_0x278d45['applications'][_0x6509('0xc7')]({'id':0x0,'priority':0x0,'app':_0x6509('0xc8'),'appdata':_0x15ef3c[_0x6509('0x31')]+','+(_0x278d45[_0x6509('0xaf')]['waitForTheAssignedAgent']||0xa),'interval':_0x6509('0xc9')});_0x278d45[_0x6509('0xca')]=!![];}if(!_0x278d45[_0x6509('0xbd')][_0x6509('0xcb')]){return;}return db[_0x6509('0xcc')][_0x6509('0x64')]({'attributes':['id','name'],'where':{'id':_0x278d45[_0x6509('0xbd')]['queueId']}});})[_0x6509('0x1d')](function(_0x4adf80){if(_0x4adf80){_0x278d45[_0x6509('0xb0')]['unshift']({'id':0x0,'priority':0x1,'app':_0x6509('0xcd'),'appdata':_0x4adf80[_0x6509('0x31')]+','+(_0x278d45['account'][_0x6509('0xce')]||0x12c),'interval':_0x6509('0xc9')});}return respondWithRpcPromise(_0x6509('0xcf'),'startRouting',_0x278d45);})[_0x6509('0x1d')](function(_0x3179f2){respondWithRpcPromise('EventManager',_0x6509('0xd0'),{'event':'notify','message':_0x3179f2},client9002);return _0x3179f2;})['then'](respondWithResult(_0x193d70,null))[_0x6509('0x65')](APIHandleError(_0x193d70));};exports[_0x6509('0xd1')]=function(_0x2a3f9a,_0x56aeea){var _0x110e2c,_0x278975,_0x1c13e0;var _0x40aaa1=[];var _0x436b4b={};var _0x57866f=_0x2a3f9a[_0x6509('0xd2')]||[];var _0x5c390a=[];var _0x1de4b8;return db['CmContact'][_0x6509('0x70')]()['then'](function(_0x27cf36){if(!_0x27cf36){throw new db['Sequelize'][(_0x6509('0xd3'))]('no\x20available\x20attributes');}_0x40aaa1=_[_0x6509('0xd4')](_['keys'](_0x27cf36),[_0x6509('0xa2'),_0x6509('0xa3'),_0x6509('0xa4'),_0x6509('0xb5')]);if(_0x2a3f9a[_0x6509('0x68')]['id']){delete _0x2a3f9a[_0x6509('0x68')]['id'];}if(_[_0x6509('0x8e')](_0x2a3f9a[_0x6509('0x68')][_0x6509('0xb6')])){throw _0x56aeea[_0x6509('0x27')](0x1f4)[_0x6509('0xd5')](new db[(_0x6509('0xd6'))][(_0x6509('0xd3'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x2a3f9a['body'][_0x6509('0x68')])||_0x2a3f9a['body'][_0x6509('0x68')]===''){throw _0x56aeea[_0x6509('0x27')](0x1f4)[_0x6509('0xd5')](new db[(_0x6509('0xd6'))][(_0x6509('0xd3'))](_0x6509('0xd7')));}if(_[_0x6509('0x8e')](_0x2a3f9a[_0x6509('0x68')]['mapKeyOffline'])){throw _0x56aeea['status'](0x1f4)[_0x6509('0xd5')](new db['Sequelize'][(_0x6509('0xd3'))](_0x6509('0xd8')+_0x40aaa1));}if(!_[_0x6509('0xa5')](_0x40aaa1,_0x2a3f9a[_0x6509('0x68')][_0x6509('0xd9')])){throw _0x56aeea['status'](0x1f4)[_0x6509('0xd5')](new db[(_0x6509('0xd6'))][(_0x6509('0xd3'))](_0x6509('0xda')+_0x40aaa1));}_0x436b4b[_0x2a3f9a['body'][_0x6509('0xd9')]]=_0x2a3f9a['body'][_0x6509('0xb6')];})[_0x6509('0x1d')](function(){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x2a3f9a['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x6509('0xdb')],'as':_0x6509('0xdb')}]});})['then'](handleEntityNotFound(_0x56aeea,null))[_0x6509('0x1d')](function(_0x49172e){if(_0x49172e&&_0x49172e[_0x6509('0xa7')]){_0x278975=_0x49172e;var _0x55d74e=_[_0x6509('0x15')](_0x2a3f9a[_0x6509('0x68')],{'firstName':_0x2a3f9a[_0x6509('0x68')][_0x6509('0xb6')],'phone':_0x2a3f9a[_0x6509('0x68')][_0x6509('0xb6')],'ListId':_0x49172e[_0x6509('0xb5')]});_0x55d74e[_0x2a3f9a[_0x6509('0x68')]['mapKeyOffline']]=_0x2a3f9a[_0x6509('0x68')][_0x6509('0xb6')];return db[_0x6509('0xa0')][_0x6509('0xdc')]({'where':_0x436b4b,'defaults':_0x55d74e});}})[_0x6509('0xdd')](function(_0xb45f5d){if(_0xb45f5d){_0x1c13e0=_0xb45f5d;var _0x52cc3b=fs[_0x6509('0xde')](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0xdf')),'utf8');var _0x4bc48b=ejs[_0x6509('0xe0')](_0x52cc3b,{'body':_[_0x6509('0xe1')](_0x2a3f9a['body']['body']),'bodyTitle':_0x278975[_0x6509('0xe2')]});return db['ChatOfflineMessage'][_0x6509('0x66')]({'body':_0x4bc48b,'plainBody':htmlToText[_0x6509('0xe3')](_0x4bc48b),'ContactId':_0xb45f5d['id'],'ChatWebsiteId':_0x278975['id']});}})['then'](function(_0x114439){_0x1de4b8=_0x114439;if(_0x57866f[_0x6509('0x63')]){var _0x568d63=_0x57866f[_0x6509('0x4e')](function(_0x4a7359){return{'name':_0x4a7359[_0x6509('0xe4')],'basename':_0x4a7359[_0x6509('0x84')],'type':_0x4a7359['mimetype'],'ChatOfflineMessageId':_0x114439['id']};});_0x5c390a=_0x568d63[_0x6509('0x4e')](_0x45d749=>{var _0x50e1a4={'filename':_0x45d749[_0x6509('0x31')],'path':path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0xe5'),'files',_0x6509('0xe6'),_0x6509('0xe7'),_0x45d749[_0x6509('0xe8')])};return _0x50e1a4;});if(!_0x278975[_0x6509('0xe9')]){return db[_0x6509('0xea')][_0x6509('0xeb')](function(_0x54e3b9){return db[_0x6509('0xec')][_0x6509('0xed')](_0x568d63,{'transaction':_0x54e3b9});});}}})[_0x6509('0x1d')](function(){if(_0x1de4b8){_0x110e2c=_0x1de4b8;return db[_0x6509('0xdb')][_0x6509('0x75')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x6509('0xee'),'raw':!![],'include':[{'model':db[_0x6509('0xef')],'as':_0x6509('0xef'),'raw':!![]}]}]});}})[_0x6509('0x1d')](function(_0x3e5565){if(_0x3e5565&&_0x3e5565[_0x6509('0xee')]&&_0x278975[_0x6509('0xf0')]&&_0x278975[_0x6509('0xf1')]){var _0x172e8f=_0x3e5565['getSmtpOptions']();return respondWithRpcPromise(_0x6509('0xf2'),_0x6509('0xf3'),{'account':_0x172e8f,'message':{'from':util[_0x6509('0x40')](_0x6509('0xf4'),_0x3e5565[_0x6509('0x31')],_0x3e5565[_0x6509('0xf5')]||_0x3e5565[_0x6509('0xee')]['user']),'to':_0x278975[_0x6509('0xf1')],'subject':_0x278975[_0x6509('0xf6')],'html':_0x110e2c[_0x6509('0x68')],'attachments':_0x5c390a}},client9003)[_0x6509('0x1d')](function(){return _0x110e2c;})[_0x6509('0x65')](function(_0x1494d4){logger[_0x6509('0x21')](_0x1494d4);});}})[_0x6509('0x1d')](function(){if(_0x278975&&_0x278975[_0x6509('0xe9')]&&_0x278975['MailAccountId']){var _0x13c12d=[];if(_0x57866f[_0x6509('0x63')]){_0x13c12d=_0x57866f[_0x6509('0x4e')](function(_0x4f7d4b){return{'name':_0x4f7d4b[_0x6509('0xe4')],'basename':_0x4f7d4b[_0x6509('0x84')],'type':_0x4f7d4b[_0x6509('0xf7')],'ChatOfflineMessageId':_0x1de4b8['id']};});}var _0x1d6026;if(!_[_0x6509('0x8e')](_0x278975[_0x6509('0xf8')])){var _0x5fc214=_[_0x6509('0x4e')](_0x2a3f9a[_0x6509('0x68')],function(_0x5d71e7){return _0x5d71e7;});var _0x488e99=_[_0x6509('0xf9')](_0x5fc214)[0x0];var _0x372a76=_[_0x6509('0xfa')](_0x488e99,function(_0x2b52ce){return _0x2b52ce;});_0x1d6026=_0x372a76[0x1][_0x278975[_0x6509('0xf8')]];}var _0x310a9c={'from':_0x1c13e0[_0x6509('0xf5')],'firstName':_0x1c13e0[_0x6509('0xbe')],'lastName':_0x1c13e0['lastName'],'mapKey':_0x6509('0xf5'),'message':{'from':_0x1c13e0[_0x6509('0xf5')],'to':_0x278975[_0x6509('0xdb')][_0x6509('0xf5')],'cc':'','subject':_['isNil'](_0x1d6026)?_0x278975[_0x6509('0xf6')]:_0x1d6026,'messageId':'','sentAt':new Date(),'attach':_0x13c12d[_0x6509('0x63')],'attachments':_0x13c12d,'originChannel':_0x6509('0xfb'),'ChatWebsiteId':_0x278975['id'],'ChatOfflineMessageId':_0x110e2c['id'],'originTo':_0x278975[_0x6509('0xdb')][_0x6509('0xf5')]},'body':_0x110e2c['body']};var _0x841651={'account':{'id':_0x278975[_0x6509('0xfc')]},'body':_0x310a9c,'log':_0x6509('0xfd')};return respondWithRpcPromise('NotifyMailAccount',_0x6509('0xfe'),_0x841651,client9001)[_0x6509('0x1d')](function(){return _0x110e2c;})[_0x6509('0x65')](function(_0x34d250){logger[_0x6509('0x21')](_0x34d250);});}return;})['then'](function(){if(_0x110e2c){return _0x110e2c;}})['then'](respondWithResult(_0x56aeea,null))[_0x6509('0x65')](function(){for(var _0x1cc558 of _0x57866f){var _0x210e0d=path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0xe5'),_0x6509('0xd2'),_0x6509('0xe6'),_0x6509('0xe7'),_0x1cc558[_0x6509('0x84')]);fs_extra['remove'](_0x210e0d)[_0x6509('0x65')](function(_0x9532cc){logger['error'](_0x6509('0xff'),_0x210e0d,_0x9532cc);});}});};exports['addInteraction']=function(_0x5c2bd8,_0x468dd2){return db[_0x6509('0xbb')][_0x6509('0x64')]({'where':{'id':_0x5c2bd8[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x468dd2,null))[_0x6509('0x1d')](function(_0x4ed066){if(_0x4ed066){return _0x4ed066[_0x6509('0x100')](_0x5c2bd8[_0x6509('0x68')][_0x6509('0x7e')],_[_0x6509('0x101')](_0x5c2bd8[_0x6509('0x68')],[_0x6509('0x7e'),'id'])||{});}})[_0x6509('0x1d')](respondWithResult(_0x468dd2,null))[_0x6509('0x65')](handleError(_0x468dd2,null));};exports[_0x6509('0x102')]=function(_0x33266a,_0x28a9ad){var _0x58677d={'raw':![],'where':{}};var _0x27db56={};var _0x2e12e3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6509('0x75')]({'where':{'id':_0x33266a['params']['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x28a9ad,null))[_0x6509('0x1d')](function(_0x211fd7){if(_0x211fd7){_0x27db56[_0x6509('0x44')]=_[_0x6509('0x50')](db[_0x6509('0xbb')][_0x6509('0x4c')]);_0x27db56[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x33266a[_0x6509('0x4f')]);_0x27db56[_0x6509('0x58')]=_[_0x6509('0x51')](_0x27db56['model'],_0x27db56['query']);_0x58677d[_0x6509('0x52')]=_[_0x6509('0x51')](_0x27db56[_0x6509('0x44')],qs['fields'](_0x33266a[_0x6509('0x4f')][_0x6509('0x53')]));_0x58677d[_0x6509('0x52')]=_0x58677d['attributes'][_0x6509('0x63')]?_0x58677d[_0x6509('0x52')]:_0x27db56[_0x6509('0x44')];if(!_0x33266a[_0x6509('0x4f')][_0x6509('0x76')](_0x6509('0x54'))){_0x58677d[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x33266a['query'][_0x6509('0x55')]);_0x58677d['offset']=qs[_0x6509('0x29')](_0x33266a[_0x6509('0x4f')][_0x6509('0x29')]);}_0x58677d[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x33266a['query'][_0x6509('0x56')]);_0x58677d['where']=qs[_0x6509('0x58')](_[_0x6509('0x59')](_0x33266a[_0x6509('0x4f')],_0x27db56['filters']));_0x58677d[_0x6509('0x57')][_0x6509('0x72')]=_0x211fd7['id'];if(_0x33266a[_0x6509('0x4f')][_0x6509('0x5a')]){_0x58677d[_0x6509('0x57')]=_[_0x6509('0x5b')](_0x58677d[_0x6509('0x57')],{'$or':_[_0x6509('0x4e')](_0x58677d[_0x6509('0x52')],function(_0x538ebe){var _0x3ec479={};_0x3ec479[_0x538ebe]={'$like':'%'+_0x33266a['query']['filter']+'%'};return _0x3ec479;})});}_0x58677d=_[_0x6509('0x5b')]({},_0x58677d,_0x33266a['options']);return db['ChatInteraction'][_0x6509('0x2b')]({'where':_0x58677d[_0x6509('0x57')]})[_0x6509('0x1d')](function(_0x542701){_0x2e12e3[_0x6509('0x2b')]=_0x542701;if(_0x33266a['query'][_0x6509('0x5e')]){_0x58677d[_0x6509('0x5f')]=[{'model':db['CmContact'],'as':_0x6509('0x103'),'required':![]},{'model':db['User'],'as':_0x6509('0x104'),'attributes':[_0x6509('0x31'),'fullname',_0x6509('0x105')],'required':![]},{'model':db[_0x6509('0x106')],'as':_0x6509('0x107'),'attributes':['id',_0x6509('0x31'),'color'],'where':_0x33266a[_0x6509('0x4f')][_0x6509('0x108')]?{'id':_0x33266a[_0x6509('0x4f')][_0x6509('0x108')]}:undefined,'required':_0x33266a[_0x6509('0x4f')]['tag']?!![]:![]}];}return db[_0x6509('0xbb')][_0x6509('0x78')](_0x58677d);})[_0x6509('0x1d')](function(_0x4642b8){_0x2e12e3[_0x6509('0x60')]=_0x4642b8;return _0x2e12e3;});}})[_0x6509('0x1d')](respondWithFilteredResult(_0x28a9ad,_0x58677d))[_0x6509('0x65')](handleError(_0x28a9ad,null));};exports[_0x6509('0x109')]=function(_0x3d1db9,_0x2e2292){var _0x3a84dd=0x0;var _0x69f4=0x0;var _0x1821f5=![];var _0x7fa3de;var _0x293af9;return db['ChatWebsite'][_0x6509('0x64')]({'where':{'id':_0x3d1db9[_0x6509('0x62')]['id']},'include':[{'model':db[_0x6509('0xac')],'as':_0x6509('0xac'),'include':[{'model':db[_0x6509('0xac')],'as':_0x6509('0xad'),'attributes':['id',_0x6509('0x10a')]}]}]})[_0x6509('0x1d')](handleEntityNotFound(_0x2e2292,null))[_0x6509('0x1d')](function(_0x388a4f){if(_0x388a4f){_0x7fa3de=_0x388a4f;return _0x388a4f[_0x6509('0x10b')]({'raw':!![]});}})[_0x6509('0x1d')](function(_0x298039){if(_0x7fa3de){if(_0x298039){_0x293af9=_0x298039;}}return require(_0x6509('0x8b'))[_0x6509('0x8c')]();})[_0x6509('0x1d')](function(_0x39b762){if(_0x39b762){_0x69f4=_0x39b762[_0x6509('0x10c')];_0x1821f5=_0x39b762[_0x6509('0x8d')];}})[_0x6509('0x1d')](function(){return db[_0x6509('0xbb')][_0x6509('0x2b')]({'where':{'closed':![]}});})[_0x6509('0x1d')](function(_0x18ad10){_0x3a84dd=_0x18ad10;if(_0x69f4&&_0x18ad10>_0x69f4){return db[_0x6509('0x10d')][_0x6509('0x75')]({'where':{'id':0x1}})['then'](function(_0x146353){if(_0x146353){_0x146353[_0x6509('0x10e')](_0x6509('0x10f'));}});}})[_0x6509('0x1d')](function(){var _0x3ee6a9=_0x7fa3de[_0x6509('0xac')];var _0x4bb759=_0x7fa3de[_0x6509('0x98')]||undefined;return _0x3ee6a9?_0x3ee6a9[_0x6509('0x99')](_0x4bb759):!![];})['then'](function(_0x3525dc){var _0x2cc222=fs[_0x6509('0xde')](path[_0x6509('0x89')](config[_0x6509('0x8a')],_0x6509('0x110')),_0x6509('0x111'));var _0x222a5f=_0x6509('0x112');var _0x19d233=![];try{const _0x249f86=new URL(_0x7fa3de['address']);_0x7fa3de[_0x6509('0x69')]=_0x249f86[_0x6509('0x113')];}catch(_0x5332b2){}var _0x160fe8;if(_0x3d1db9[_0x6509('0xb8')][_0x6509('0x3d')]){_0x3d1db9[_0x6509('0xb8')][_0x6509('0x3d')]=_0x3d1db9[_0x6509('0xb8')][_0x6509('0x3d')]['replace'](/\/$/,'');_0x160fe8=wildcardUtils['testWebsiteWithWildcard'](_0x7fa3de['address'],_0x3d1db9['headers'][_0x6509('0x3d')]);}else{_0x3d1db9[_0x6509('0xb8')][_0x6509('0x3d')]=_0x7fa3de['address'];_0x160fe8=!![];}var _0x3f22af={'chatVersion':_0x222a5f,'chatWebsiteAddressOrigin':_0x160fe8?_0x3d1db9[_0x6509('0xb8')]['referer']:_0x7fa3de['address'],'remote':_0x7fa3de[_0x6509('0x114')],'query':querystring[_0x6509('0x48')](_[_0x6509('0x5b')](_0x7fa3de[_0x6509('0x2d')]({'plain':!![]}),{'customerIp':_0x3d1db9[_0x6509('0xb8')]['x-forwarded-for']||_0x3d1db9[_0x6509('0xb8')]['x-real-ip']||_0x3d1db9[_0x6509('0x115')][_0x6509('0x116')]||_0x3d1db9['ip'],'referer':_0x3d1db9[_0x6509('0xb8')]['referer'],'openedInteractions':_0x3a84dd,'maxInteractions':_0x69f4,'virtual':_0x1821f5[_0x6509('0x10c')],'online':_0x3525dc,'custom':_0x1821f5,'address':_0x160fe8?_0x3d1db9['headers'][_0x6509('0x3d')]:null}))[_0x6509('0x117')](/'/g,'\x5c\x27')};_0x2e2292[_0x6509('0xd5')](ejs[_0x6509('0xe0')](Mustache[_0x6509('0xe0')](_0x2cc222,_0x3f22af),{'proactiveActions':_0x293af9,'alignment':_0x7fa3de[_0x6509('0x118')],'verticalAlignment':_0x7fa3de['verticalAlignment'],'div_color':_0x7fa3de[_0x6509('0x119')],'labelText':_0x7fa3de[_0x6509('0x11a')],'text_color':_0x7fa3de[_0x6509('0x11b')],'text_button_color':_0x7fa3de[_0x6509('0x11c')],'button_color':_0x7fa3de[_0x6509('0x11d')],'background_color':_0x7fa3de['backgroundColor'],'hideWhenOffline':_0x7fa3de[_0x6509('0x11e')],'intervalId':_0x7fa3de[_0x6509('0x11f')],'isDevelopment':_0x19d233,'chatVersion':_0x222a5f}));})[_0x6509('0x65')](handleError(_0x2e2292,null));};exports[_0x6509('0x120')]=function(_0x54afd6,_0x4069e2){var _0x3afc9d=_0x54afd6['params']['id'];var _0x46c887=_0x54afd6[_0x6509('0x68')];var _0x4240a3=0xc8;var _0xa8a847=null;return db[_0x6509('0xea')][_0x6509('0xeb')]({'isolationLevel':db[_0x6509('0xea')][_0x6509('0x121')][_0x6509('0x122')][_0x6509('0x123')]},function(_0x4c8c87){return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x3afc9d},'transaction':_0x4c8c87})[_0x6509('0x1d')](function(_0x3b4458){if(_0x3b4458){return db[_0x6509('0xaa')]['destroy']({'where':{'ChatWebsiteId':_0x3afc9d},'transaction':_0x4c8c87})[_0x6509('0x1d')](function(){var _0x21bd8b=_[_0x6509('0x4e')](_0x46c887,function(_0x56a0ea){_0x56a0ea['ChatWebsiteId']=_0x3afc9d;return _0x56a0ea;});return db[_0x6509('0xaa')][_0x6509('0xed')](_0x21bd8b,{'transaction':_0x4c8c87});});}else{_0x4240a3=0x194;_0xa8a847=[];}});})[_0x6509('0x1d')](function(){if(_0x4240a3!==0x194){return db['ChatApplication'][_0x6509('0x124')]({'where':{'ChatWebsiteId':_0x3afc9d},'order':_0x6509('0xb2')})[_0x6509('0x1d')](function(_0x42bb2c){_0xa8a847=_0x42bb2c;});}})[_0x6509('0x65')](function(_0x4688b0){_0x4240a3=0x1f4;logger[_0x6509('0x21')](_0x4688b0[_0x6509('0x30')]);if(_0x4688b0[_0x6509('0x31')]){delete _0x4688b0[_0x6509('0x31')];}_0xa8a847=_0x4688b0;})[_0x6509('0x125')](function(){if(_0xa8a847===null){_0x4069e2[_0x6509('0x26')](_0x4240a3);}else{if(_0x4240a3===0x1f4){_0x4069e2['status'](_0x4240a3)[_0x6509('0xd5')](_0xa8a847);}else{_0x4069e2[_0x6509('0x27')](_0x4240a3)[_0x6509('0x126')](_0xa8a847);}}});};exports['getApplications']=function(_0x3889d4,_0x17a289){var _0xbf786f={};var _0x2bcec4={};var _0x343aad;var _0x48ff9a;return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x3889d4['params']['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x17a289,null))[_0x6509('0x1d')](function(_0x4ccd96){if(_0x4ccd96){_0x343aad=_0x4ccd96;_0x2bcec4['model']=_[_0x6509('0x50')](db[_0x6509('0xaa')][_0x6509('0x4c')]);_0x2bcec4[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x3889d4['query']);_0x2bcec4[_0x6509('0x58')]=_[_0x6509('0x51')](_0x2bcec4['model'],_0x2bcec4['query']);_0xbf786f[_0x6509('0x52')]=_[_0x6509('0x51')](_0x2bcec4[_0x6509('0x44')],qs[_0x6509('0x53')](_0x3889d4[_0x6509('0x4f')]['fields']));_0xbf786f[_0x6509('0x52')]=_0xbf786f['attributes'][_0x6509('0x63')]?_0xbf786f[_0x6509('0x52')]:_0x2bcec4[_0x6509('0x44')];_0xbf786f['order']=qs[_0x6509('0x56')](_0x3889d4['query'][_0x6509('0x56')]);_0xbf786f[_0x6509('0x57')]=qs[_0x6509('0x58')](_[_0x6509('0x59')](_0x3889d4['query'],_0x2bcec4[_0x6509('0x58')]));if(_0x3889d4[_0x6509('0x4f')][_0x6509('0x5a')]){_0xbf786f['where']=_['merge'](_0xbf786f['where'],{'$or':_[_0x6509('0x4e')](_0xbf786f[_0x6509('0x52')],function(_0x3d02bf){var _0x4ba35e={};_0x4ba35e[_0x3d02bf]={'$like':'%'+_0x3889d4['query'][_0x6509('0x5a')]+'%'};return _0x4ba35e;})});}_0xbf786f=_[_0x6509('0x5b')]({},_0xbf786f,_0x3889d4['options']);return _0x343aad[_0x6509('0x127')](_0xbf786f);}})[_0x6509('0x1d')](function(_0x4dabf6){if(_0x4dabf6){_0x48ff9a=_0x4dabf6['length'];if(!_0x3889d4[_0x6509('0x4f')][_0x6509('0x76')](_0x6509('0x54'))){_0xbf786f['limit']=qs[_0x6509('0x55')](_0x3889d4['query'][_0x6509('0x55')]);_0xbf786f[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x3889d4[_0x6509('0x4f')][_0x6509('0x29')]);}return _0x343aad[_0x6509('0x127')](_0xbf786f);}})[_0x6509('0x1d')](function(_0x5ce3f4){if(_0x5ce3f4){return _0x5ce3f4?{'count':_0x48ff9a,'rows':_0x5ce3f4}:null;}})['then'](respondWithResult(_0x17a289,null))[_0x6509('0x65')](handleError(_0x17a289,null));};exports['addProactiveActions']=function(_0x46f155,_0x4329c0){return db[_0x6509('0x128')]['find']({'where':{'id':_0x46f155[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x4329c0,null))[_0x6509('0x1d')](function(_0x585285){if(_0x585285){return _0x585285[_0x6509('0x129')](_0x46f155[_0x6509('0x68')][_0x6509('0x7e')],_[_0x6509('0x101')](_0x46f155[_0x6509('0x68')],[_0x6509('0x7e'),'id'])||{});}})['then'](respondWithResult(_0x4329c0,null))[_0x6509('0x65')](handleError(_0x4329c0,null));};exports['getProactiveActions']=function(_0x3802d1,_0x2c7179){var _0x5c4108={};var _0x131a49={};var _0x2da7b4;var _0x1806be;return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x3802d1['params']['id']}})['then'](handleEntityNotFound(_0x2c7179,null))[_0x6509('0x1d')](function(_0x5cc69b){if(_0x5cc69b){_0x2da7b4=_0x5cc69b;_0x131a49[_0x6509('0x44')]=_[_0x6509('0x50')](db['ChatProactiveAction'][_0x6509('0x4c')]);_0x131a49[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x3802d1[_0x6509('0x4f')]);_0x131a49[_0x6509('0x58')]=_[_0x6509('0x51')](_0x131a49[_0x6509('0x44')],_0x131a49['query']);_0x5c4108[_0x6509('0x52')]=_[_0x6509('0x51')](_0x131a49[_0x6509('0x44')],qs[_0x6509('0x53')](_0x3802d1[_0x6509('0x4f')][_0x6509('0x53')]));_0x5c4108[_0x6509('0x52')]=_0x5c4108[_0x6509('0x52')][_0x6509('0x63')]?_0x5c4108[_0x6509('0x52')]:_0x131a49['model'];_0x5c4108[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x3802d1[_0x6509('0x4f')][_0x6509('0x56')]);_0x5c4108['where']=qs[_0x6509('0x58')](_['pick'](_0x3802d1[_0x6509('0x4f')],_0x131a49[_0x6509('0x58')]));if(_0x3802d1['query'][_0x6509('0x5a')]){_0x5c4108[_0x6509('0x57')]=_[_0x6509('0x5b')](_0x5c4108[_0x6509('0x57')],{'$or':_[_0x6509('0x4e')](_0x5c4108[_0x6509('0x52')],function(_0x26a972){var _0x2aa41c={};_0x2aa41c[_0x26a972]={'$like':'%'+_0x3802d1[_0x6509('0x4f')]['filter']+'%'};return _0x2aa41c;})});}_0x5c4108=_['merge']({},_0x5c4108,_0x3802d1[_0x6509('0x5d')]);return _0x2da7b4['getProactiveActions'](_0x5c4108);}})[_0x6509('0x1d')](function(_0x45cea7){if(_0x45cea7){_0x1806be=_0x45cea7[_0x6509('0x63')];if(!_0x3802d1[_0x6509('0x4f')]['hasOwnProperty'](_0x6509('0x54'))){_0x5c4108[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x3802d1[_0x6509('0x4f')][_0x6509('0x55')]);_0x5c4108[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x3802d1[_0x6509('0x4f')][_0x6509('0x29')]);}return _0x2da7b4[_0x6509('0x10b')](_0x5c4108);}})['then'](function(_0x2de5c0){if(_0x2de5c0){return _0x2de5c0?{'count':_0x1806be,'rows':_0x2de5c0}:null;}})[_0x6509('0x1d')](respondWithResult(_0x2c7179,null))[_0x6509('0x65')](handleError(_0x2c7179,null));};exports[_0x6509('0x12a')]=function(_0x3cd06a,_0xd7fc00){var _0x51e175=_0x3cd06a[_0x6509('0x4f')]['online']==='false'?'offlineForm':_0x6509('0x12b');return db[_0x6509('0x4b')][_0x6509('0x64')]({'attributes':['id',_0x51e175],'where':{'id':_0x3cd06a[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0xd7fc00,null))['then'](function(_0x4fe515){if(_0x4fe515){var _0x535c3d=_0x4fe515[_0x51e175];var _0x161674=_0x535c3d&&_0x535c3d['items']?_0x535c3d[_0x6509('0x12c')]:[];_0xd7fc00[_0x6509('0xd5')]({'fromKey':_[_0x6509('0x8e')](_0x535c3d[_0x6509('0x12d')])?undefined:_0x535c3d['fromKey'],'count':_0x161674['length'],'rows':_0x161674});}})[_0x6509('0x65')](handleError(_0xd7fc00,null));};exports[_0x6509('0x12e')]=function(_0x5f004a,_0x59213b){var _0x2bc98b={'raw':![],'where':{}};var _0xf91ab6={};var _0x5df9fa={'count':0x0,'rows':[]};return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x5f004a[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x59213b,null))[_0x6509('0x1d')](function(_0x967928){if(_0x967928){_0xf91ab6[_0x6509('0x44')]=_[_0x6509('0x50')](db['ChatOfflineMessage'][_0x6509('0x4c')]);_0xf91ab6[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x5f004a[_0x6509('0x4f')]);_0xf91ab6[_0x6509('0x58')]=_[_0x6509('0x51')](_0xf91ab6['model'],_0xf91ab6[_0x6509('0x4f')]);_0x2bc98b[_0x6509('0x52')]=_[_0x6509('0x51')](_0xf91ab6[_0x6509('0x44')],qs[_0x6509('0x53')](_0x5f004a['query']['fields']));_0x2bc98b[_0x6509('0x52')]=_0x2bc98b[_0x6509('0x52')][_0x6509('0x63')]?_0x2bc98b[_0x6509('0x52')]:_0xf91ab6[_0x6509('0x44')];if(!_0x5f004a['query'][_0x6509('0x76')](_0x6509('0x54'))){_0x2bc98b['limit']=qs[_0x6509('0x55')](_0x5f004a['query'][_0x6509('0x55')]);_0x2bc98b[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x5f004a[_0x6509('0x4f')][_0x6509('0x29')]);}_0x2bc98b[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x5f004a['query']['sort']);_0x2bc98b[_0x6509('0x57')]=qs[_0x6509('0x58')](_['pick'](_0x5f004a[_0x6509('0x4f')],_0xf91ab6[_0x6509('0x58')]));_0x2bc98b['where'][_0x6509('0x72')]=_0x967928['id'];if(_0x5f004a['query'][_0x6509('0x5a')]){_0x2bc98b['where']=_[_0x6509('0x5b')](_0x2bc98b[_0x6509('0x57')],{'$or':_[_0x6509('0x4e')](_0x2bc98b['attributes'],function(_0x2624d8){var _0x7f5a7c={};_0x7f5a7c[_0x2624d8]={'$like':'%'+_0x5f004a['query'][_0x6509('0x5a')]+'%'};return _0x7f5a7c;})});}_0x2bc98b=_[_0x6509('0x5b')]({},_0x2bc98b,_0x5f004a[_0x6509('0x5d')]);return db[_0x6509('0x12f')][_0x6509('0x2b')]({'where':_0x2bc98b[_0x6509('0x57')]})[_0x6509('0x1d')](function(_0x49b16d){_0x5df9fa[_0x6509('0x2b')]=_0x49b16d;if(_0x5f004a[_0x6509('0x4f')]['includeAll']){_0x2bc98b[_0x6509('0x5f')]=[{'all':!![]}];}else{_0x2bc98b[_0x6509('0x5f')]=[{'model':db[_0x6509('0xa0')],'as':_0x6509('0x103'),'required':![]},{'model':db['Attachment'],'as':_0x6509('0x130'),'required':![]}];}return db[_0x6509('0x12f')][_0x6509('0x78')](_0x2bc98b);})[_0x6509('0x1d')](function(_0x46c055){_0x5df9fa[_0x6509('0x60')]=_0x46c055;return _0x5df9fa;});}})[_0x6509('0x1d')](respondWithFilteredResult(_0x59213b,_0x2bc98b))['catch'](handleError(_0x59213b,null));};exports[_0x6509('0x131')]=function(_0x5e92af,_0x55cb59){return db[_0x6509('0x4b')][_0x6509('0x64')]({'where':{'id':_0x5e92af[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x55cb59,null))[_0x6509('0x1d')](function(_0x52fa05){if(_0x52fa05){return _0x52fa05[_0x6509('0x131')](_0x5e92af[_0x6509('0x68')][_0x6509('0x7e')],_[_0x6509('0x101')](_0x5e92af['body'],[_0x6509('0x7e'),'id'])||{})['spread'](function(_0x3e1a15){for(var _0x30de87=0x0;_0x30de87<_0x5e92af[_0x6509('0x68')]['ids']['length'];_0x30de87+=0x1){socket[_0x6509('0x132')](_0x6509('0x133'),{'UserId':Number(_0x5e92af[_0x6509('0x68')][_0x6509('0x7e')][_0x30de87]),'ChatWebsiteId':Number(_0x5e92af[_0x6509('0x62')]['id'])});}return _0x3e1a15;});}})['then'](respondWithResult(_0x55cb59,null))[_0x6509('0x65')](handleError(_0x55cb59,null));};exports[_0x6509('0x134')]=function(_0x4c2302,_0x23725f){return db['ChatWebsite'][_0x6509('0x64')]({'where':{'id':_0x4c2302[_0x6509('0x62')]['id']}})['then'](handleEntityNotFound(_0x23725f,null))[_0x6509('0x1d')](function(_0x214ba6){if(_0x214ba6){return _0x214ba6[_0x6509('0x134')](_0x4c2302['query'][_0x6509('0x7e')])[_0x6509('0x1d')](function(){if(_['isArray'](_0x4c2302[_0x6509('0x4f')][_0x6509('0x7e')])){for(var _0x1b3d6a=0x0;_0x1b3d6a<_0x4c2302[_0x6509('0x4f')][_0x6509('0x7e')][_0x6509('0x63')];_0x1b3d6a+=0x1){socket[_0x6509('0x132')](_0x6509('0x135'),{'UserId':Number(_0x4c2302[_0x6509('0x4f')][_0x6509('0x7e')][_0x1b3d6a]),'ChatWebsiteId':Number(_0x4c2302['params']['id'])});}}else{socket['emit'](_0x6509('0x135'),{'UserId':Number(_0x4c2302['query'][_0x6509('0x7e')]),'ChatWebsiteId':Number(_0x4c2302[_0x6509('0x62')]['id'])});}});}})[_0x6509('0x1d')](respondWithStatusCode(_0x23725f,null))[_0x6509('0x65')](handleError(_0x23725f,null));};exports['getAgents']=function(_0x4fd797,_0x2611d7){var _0x206bcb={};var _0x16460a={};var _0x1f6462;var _0x374fda;return db[_0x6509('0x4b')][_0x6509('0x75')]({'where':{'id':_0x4fd797[_0x6509('0x62')]['id']}})[_0x6509('0x1d')](handleEntityNotFound(_0x2611d7,null))[_0x6509('0x1d')](function(_0x5ce300){if(_0x5ce300){_0x1f6462=_0x5ce300;_0x16460a[_0x6509('0x44')]=_[_0x6509('0x50')](db[_0x6509('0x136')][_0x6509('0x4c')]);_0x16460a[_0x6509('0x4f')]=_[_0x6509('0x50')](_0x4fd797[_0x6509('0x4f')]);_0x16460a[_0x6509('0x58')]=_[_0x6509('0x51')](_0x16460a[_0x6509('0x44')],_0x16460a[_0x6509('0x4f')]);_0x206bcb[_0x6509('0x52')]=_[_0x6509('0x51')](_0x16460a[_0x6509('0x44')],qs['fields'](_0x4fd797[_0x6509('0x4f')][_0x6509('0x53')]));_0x206bcb[_0x6509('0x52')]=_0x206bcb[_0x6509('0x52')]['length']?_0x206bcb[_0x6509('0x52')]:_0x16460a[_0x6509('0x44')];_0x206bcb[_0x6509('0x77')]=qs[_0x6509('0x56')](_0x4fd797[_0x6509('0x4f')][_0x6509('0x56')]);_0x206bcb['where']=qs[_0x6509('0x58')](_['pick'](_0x4fd797['query'],_0x16460a[_0x6509('0x58')]));if(_0x4fd797[_0x6509('0x4f')][_0x6509('0x5a')]){_0x206bcb[_0x6509('0x57')]=_[_0x6509('0x5b')](_0x206bcb[_0x6509('0x57')],{'$or':_[_0x6509('0x4e')](_0x206bcb[_0x6509('0x52')],function(_0x55fba5){var _0x1451dd={};_0x1451dd[_0x55fba5]={'$like':'%'+_0x4fd797['query'][_0x6509('0x5a')]+'%'};return _0x1451dd;})});}_0x206bcb=_[_0x6509('0x5b')]({},_0x206bcb,_0x4fd797[_0x6509('0x5d')]);return _0x1f6462[_0x6509('0x137')](_0x206bcb);}})[_0x6509('0x1d')](function(_0x5d0055){if(_0x5d0055){_0x374fda=_0x5d0055[_0x6509('0x63')];if(!_0x4fd797[_0x6509('0x4f')][_0x6509('0x76')](_0x6509('0x54'))){_0x206bcb[_0x6509('0x55')]=qs[_0x6509('0x55')](_0x4fd797['query'][_0x6509('0x55')]);_0x206bcb[_0x6509('0x29')]=qs[_0x6509('0x29')](_0x4fd797[_0x6509('0x4f')][_0x6509('0x29')]);}return _0x1f6462['getAgents'](_0x206bcb);}})[_0x6509('0x1d')](function(_0x15d848){if(_0x15d848){return _0x15d848?{'count':_0x374fda,'rows':_0x15d848}:null;}})['then'](respondWithResult(_0x2611d7,null))['catch'](handleError(_0x2611d7,null));};
\ No newline at end of file
+var _0x2d99=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','setUA','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','model','device','vendor','%s\x20%s\x20%s','type','mandatoryDispositionPause','ChatWebsite','rawAttributes','key','map','query','keys','filters','intersection','attributes','fields','length','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','show','params','create','testWildcardValidity','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','Pause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','order','pick','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','systemAvatar','Interval','resolve','timezone','ifTime','notify','chat','from','mapKey','isEmpty','CmContact','createdAt','updatedAt','CompanyId','ListId','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','Applications','priority','list','contact','headers','threadId','closed','ChatInteraction','customerIp','Writing\x20on\x20closed\x20interaction','ContactId','interaction','messageId','created','autoclose','applications','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','ChatQueue','queueId','waitForTheAssignedQueue','Start','EventManager','offline','Sequelize','ValidationError','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','fromString','mimetype','server','files','attachments','sequelize','transaction','Attachment','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','openNewInteraction','MailAccountId','originalname','subjectOffline','mapValues','lastName','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','testWebsiteWithWildcard','remote','remoteAddress','replace','textColor','textButtonColor','color_button','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','querystring','html-to-text','ioredis','jayson/promise','../../config/logger','api','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0x2d99,0x11b));var _0x92d9=function(_0x2d08c6,_0x3347ee){_0x2d08c6=_0x2d08c6-0x0;var _0x47f4ed=_0x2d99[_0x2d08c6];return _0x47f4ed;};'use strict';var Mustache=require(_0x92d9('0x0'));var util=require(_0x92d9('0x1'));var path=require(_0x92d9('0x2'));var ejs=require(_0x92d9('0x3'));var fs=require('fs');var fs_extra=require(_0x92d9('0x4'));var _=require('lodash');var querystring=require(_0x92d9('0x5'));var htmlToText=require(_0x92d9('0x6'));var Redis=require(_0x92d9('0x7'));var jayson=require(_0x92d9('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x92d9('0x9'))(_0x92d9('0xa'));var config=require('../../config/environment');var APIBadRequestError=require(_0x92d9('0xb'))[_0x92d9('0xc')];var APINotFoundError=require(_0x92d9('0xb'))[_0x92d9('0xd')];var APIOutOfIntervalError=require(_0x92d9('0xb'))[_0x92d9('0xe')];var APIHandleError=require(_0x92d9('0xb'))['handleError'];var APIConflictError=require(_0x92d9('0xb'))[_0x92d9('0xf')];var wildcardUtils=require(_0x92d9('0x10'));var URL=require(_0x92d9('0x11'))[_0x92d9('0x12')];var db=require(_0x92d9('0x13'))['db'];config[_0x92d9('0x14')]=_[_0x92d9('0x15')](config[_0x92d9('0x14')],{'host':_0x92d9('0x16'),'port':0x18eb});var socket=require(_0x92d9('0x17'))(new Redis(config[_0x92d9('0x14')]));require(_0x92d9('0x18'))['register'](socket);var client=jayson[_0x92d9('0x19')][_0x92d9('0x1a')]({'port':0x232c});var client9002=jayson[_0x92d9('0x19')][_0x92d9('0x1a')]({'port':0x232a});var client9003=jayson[_0x92d9('0x19')]['http']({'port':0x232b});var client9001=jayson[_0x92d9('0x19')][_0x92d9('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x1e4b47,_0xa0ebf5,_0x598a9a,_0x58dca1){return new Promise(function(_0x348d3c,_0x33d856){var _0x3b33cc=_0x58dca1||client;return _0x3b33cc[_0x92d9('0x1b')](_0x1e4b47,_0x598a9a)[_0x92d9('0x1c')](function(_0xd83e4c){logger['info'](_0x92d9('0x1d'),_0xa0ebf5,_0x92d9('0x1e'));logger['debug'](_0x92d9('0x1f'),_0xa0ebf5,_0x92d9('0x1e'),JSON[_0x92d9('0x20')](_0xd83e4c));if(_0xd83e4c['error']){if(_0xd83e4c['error'][_0x92d9('0x21')]===0x1f4){logger['error'](_0x92d9('0x1d'),_0xa0ebf5,_0xd83e4c['error'][_0x92d9('0x22')]);return _0x33d856(_0xd83e4c['error']['message']);}logger[_0x92d9('0x23')](_0x92d9('0x1d'),_0xa0ebf5,_0xd83e4c[_0x92d9('0x23')][_0x92d9('0x22')]);return _0x348d3c(_0xd83e4c[_0x92d9('0x23')][_0x92d9('0x22')]);}else{logger[_0x92d9('0x24')](_0x92d9('0x1d'),_0xa0ebf5,_0x92d9('0x1e'));_0x348d3c(_0xd83e4c[_0x92d9('0x25')][_0x92d9('0x22')]);}})[_0x92d9('0x26')](function(_0x478f9f){logger[_0x92d9('0x23')]('ChatWebsite,\x20%s,\x20%s',_0xa0ebf5,_0x478f9f);_0x33d856(_0x478f9f);});});}function respondWithStatusCode(_0x3b3bea,_0x19eff1){_0x19eff1=_0x19eff1||0xcc;return function(_0x363266){if(_0x363266){return _0x3b3bea[_0x92d9('0x27')](_0x19eff1);}return _0x3b3bea[_0x92d9('0x28')](_0x19eff1)[_0x92d9('0x29')]();};}function respondWithResult(_0x29e211,_0xd1d160){_0xd1d160=_0xd1d160||0xc8;return function(_0x17fb89){if(_0x17fb89){return _0x29e211['status'](_0xd1d160)[_0x92d9('0x2a')](_0x17fb89);}};}function respondWithFilteredResult(_0x524db5,_0x54f4f2){return function(_0x365536){if(_0x365536){var _0x546b85=typeof _0x54f4f2[_0x92d9('0x2b')]===_0x92d9('0x2c')&&typeof _0x54f4f2['limit']===_0x92d9('0x2c');var _0x367b90=_0x365536['count'];var _0x3e4fba=_0x546b85?0x0:_0x54f4f2[_0x92d9('0x2b')];var _0x1626c4=_0x546b85?_0x365536['count']:_0x54f4f2[_0x92d9('0x2b')]+_0x54f4f2[_0x92d9('0x2d')];var _0x41f288;if(_0x1626c4>=_0x367b90){_0x1626c4=_0x367b90;_0x41f288=0xc8;}else{_0x41f288=0xce;}_0x524db5[_0x92d9('0x28')](_0x41f288);return _0x524db5[_0x92d9('0x2e')](_0x92d9('0x2f'),_0x3e4fba+'-'+_0x1626c4+'/'+_0x367b90)[_0x92d9('0x2a')](_0x365536);}return null;};}function saveUpdates(_0x22ba32){return function(_0x3cbcc0){if(_0x3cbcc0){return _0x3cbcc0[_0x92d9('0x30')](_0x22ba32)['then'](function(_0x218168){return _0x218168;});}return null;};}function removeEntity(_0x16f2a0){return function(_0x44a777){if(_0x44a777){return _0x44a777[_0x92d9('0x31')]()[_0x92d9('0x1c')](function(){var _0x365afb=_0x44a777[_0x92d9('0x32')]({'plain':!![]});var _0x541631=_0x92d9('0x33');return db[_0x92d9('0x34')][_0x92d9('0x31')]({'where':{'type':_0x541631,'resourceId':_0x365afb['id']}})[_0x92d9('0x1c')](function(){return _0x44a777;});})['then'](function(){_0x16f2a0[_0x92d9('0x28')](0xcc)[_0x92d9('0x29')]();});}};}function handleEntityNotFound(_0x2f5ad5){return function(_0x38afaf){if(!_0x38afaf){_0x2f5ad5[_0x92d9('0x27')](0x194);}return _0x38afaf;};}function handleError(_0x372d0f,_0x38f62d){_0x38f62d=_0x38f62d||0x1f4;return function(_0x49e935){logger[_0x92d9('0x23')](_0x49e935[_0x92d9('0x35')]);if(_0x49e935['name']){delete _0x49e935[_0x92d9('0x36')];}_0x372d0f[_0x92d9('0x28')](_0x38f62d)[_0x92d9('0x37')](_0x49e935);};}function createInteractionObject(_0x3937ca,_0x24096d,_0x5d7ebf,_0x50ae13){var _0x3f4443=require(_0x92d9('0x38'));var _0xd3429c=new _0x3f4443();var _0x3acbe3=_0xd3429c[_0x92d9('0x39')](_0x5d7ebf['user-agent'])['getResult']();var _0x20f575=_0x24096d['customerIp'];if(_0x5d7ebf[_0x92d9('0x3a')]){_0x20f575=_0x5d7ebf['cf-connecting-ip'];}else if(_0x5d7ebf[_0x92d9('0x3b')]){_0x20f575=_[_0x92d9('0x3c')](_0x5d7ebf[_0x92d9('0x3b')][_0x92d9('0x3d')](','));}return{'ContactId':_0x50ae13['id'],'ChatWebsiteId':_0x3937ca,'from':(_0x50ae13[_0x92d9('0x3e')]||'')+'\x20'+(_0x50ae13['lastName']||''),'customerIp':_0x20f575,'customerPort':_0x5d7ebf['x-real-port']?_0x5d7ebf[_0x92d9('0x3f')]:null,'referer':_0x24096d[_0x92d9('0x40')],'browserName':_0x3acbe3['browser'][_0x92d9('0x36')]&&_0x3acbe3[_0x92d9('0x41')][_0x92d9('0x42')]?util[_0x92d9('0x43')](_0x92d9('0x44'),_0x3acbe3['browser']['name'],_0x3acbe3[_0x92d9('0x41')][_0x92d9('0x42')]):'unknown','browserVersion':_0x3acbe3['browser'][_0x92d9('0x42')]||'unknown','osName':util[_0x92d9('0x43')](_0x92d9('0x44'),_0x3acbe3['os'][_0x92d9('0x36')],_0x3acbe3['os'][_0x92d9('0x42')]),'osVersion':_0x3acbe3['os'][_0x92d9('0x42')],'deviceModel':_0x3acbe3['device'][_0x92d9('0x45')]&&_0x3acbe3[_0x92d9('0x46')][_0x92d9('0x47')]?util[_0x92d9('0x43')](_0x92d9('0x48'),_0x3acbe3[_0x92d9('0x46')][_0x92d9('0x45')],_0x3acbe3[_0x92d9('0x46')][_0x92d9('0x47')],_0x3acbe3['device']['type']):null,'deviceVendor':_0x3acbe3[_0x92d9('0x46')]['vendor'],'deviceType':_0x3acbe3[_0x92d9('0x46')][_0x92d9('0x49')],'formData':JSON[_0x92d9('0x20')](_0x24096d)};}exports['index']=function(_0x2fe93f,_0x2ccae3){var _0x499dd0={'include':[{'model':db['Pause'],'as':_0x92d9('0x4a')}]},_0x468473={},_0x58eab7={'count':0x0,'rows':[]};var _0x106fed=_['map'](db[_0x92d9('0x4b')][_0x92d9('0x4c')],function(_0x40e019){return{'name':_0x40e019['fieldName'],'type':_0x40e019[_0x92d9('0x49')][_0x92d9('0x4d')]};});_0x468473[_0x92d9('0x45')]=_[_0x92d9('0x4e')](_0x106fed,_0x92d9('0x36'));_0x468473[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x2fe93f[_0x92d9('0x4f')]);_0x468473[_0x92d9('0x51')]=_[_0x92d9('0x52')](_0x468473['model'],_0x468473[_0x92d9('0x4f')]);_0x499dd0[_0x92d9('0x53')]=_['intersection'](_0x468473['model'],qs['fields'](_0x2fe93f[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x499dd0['attributes']=_0x499dd0[_0x92d9('0x53')][_0x92d9('0x55')]?_0x499dd0['attributes']:_0x468473[_0x92d9('0x45')];if(!_0x2fe93f[_0x92d9('0x4f')]['hasOwnProperty']('nolimit')){_0x499dd0['limit']=qs[_0x92d9('0x2d')](_0x2fe93f['query'][_0x92d9('0x2d')]);_0x499dd0[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x2fe93f['query'][_0x92d9('0x2b')]);}_0x499dd0['order']=qs[_0x92d9('0x56')](_0x2fe93f[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x499dd0[_0x92d9('0x57')]=qs['filters'](_['pick'](_0x2fe93f[_0x92d9('0x4f')],_0x468473[_0x92d9('0x51')]),_0x106fed);if(_0x2fe93f[_0x92d9('0x4f')]['filter']){_0x499dd0[_0x92d9('0x57')]=_['merge'](_0x499dd0[_0x92d9('0x57')],{'$or':_[_0x92d9('0x4e')](_0x106fed,function(_0x569449){if(_0x569449[_0x92d9('0x49')]!==_0x92d9('0x58')){var _0x22f675={};_0x22f675[_0x569449['name']]={'$like':'%'+_0x2fe93f['query'][_0x92d9('0x59')]+'%'};return _0x22f675;}})});}_0x499dd0=_[_0x92d9('0x5a')]({},_0x499dd0,_0x2fe93f[_0x92d9('0x5b')]);var _0x552588={'where':_0x499dd0['where']};return db[_0x92d9('0x4b')]['count'](_0x552588)[_0x92d9('0x1c')](function(_0x558775){_0x58eab7[_0x92d9('0x5c')]=_0x558775;if(_0x2fe93f[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x499dd0[_0x92d9('0x5e')]=[{'all':!![]}];}return db[_0x92d9('0x4b')][_0x92d9('0x5f')](_0x499dd0);})['then'](function(_0x549f38){_0x58eab7[_0x92d9('0x60')]=_0x549f38;return _0x58eab7;})[_0x92d9('0x1c')](respondWithFilteredResult(_0x2ccae3,_0x499dd0))[_0x92d9('0x26')](handleError(_0x2ccae3,null));};exports[_0x92d9('0x61')]=function(_0x4d6e10,_0x439acc){var _0x43e62d={'raw':![],'where':{'id':_0x4d6e10[_0x92d9('0x62')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x44bc2b={};_0x44bc2b[_0x92d9('0x45')]=_['keys'](db['ChatWebsite'][_0x92d9('0x4c')]);_0x44bc2b[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x4d6e10[_0x92d9('0x4f')]);_0x44bc2b[_0x92d9('0x51')]=_['intersection'](_0x44bc2b[_0x92d9('0x45')],_0x44bc2b['query']);_0x43e62d['attributes']=_[_0x92d9('0x52')](_0x44bc2b[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x4d6e10['query'][_0x92d9('0x54')]));_0x43e62d[_0x92d9('0x53')]=_0x43e62d['attributes'][_0x92d9('0x55')]?_0x43e62d['attributes']:_0x44bc2b['model'];if(_0x4d6e10[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x43e62d[_0x92d9('0x5e')]=[{'all':!![]}];}_0x43e62d=_[_0x92d9('0x5a')]({},_0x43e62d,_0x4d6e10[_0x92d9('0x5b')]);return db[_0x92d9('0x4b')]['find'](_0x43e62d)[_0x92d9('0x1c')](handleEntityNotFound(_0x439acc,null))[_0x92d9('0x1c')](respondWithResult(_0x439acc,null))[_0x92d9('0x26')](handleError(_0x439acc,null));};exports[_0x92d9('0x63')]=function(_0xabc1ef,_0x596d48){if(!wildcardUtils[_0x92d9('0x64')](_0xabc1ef[_0x92d9('0x65')][_0x92d9('0x66')])){return handleError(_0x596d48,null)(new APIBadRequestError('\x22'+_0xabc1ef['body'][_0x92d9('0x66')]+_0x92d9('0x67')));}return db[_0x92d9('0x4b')][_0x92d9('0x63')](_0xabc1ef['body'],{})[_0x92d9('0x1c')](function(_0x351acb){var _0x48861d=_0xabc1ef[_0x92d9('0x68')][_0x92d9('0x32')]({'plain':!![]});if(!_0x48861d)throw new Error(_0x92d9('0x69'));if(_0x48861d[_0x92d9('0x6a')]===_0x92d9('0x68')){var _0x445de4=_0x351acb[_0x92d9('0x32')]({'plain':!![]});var _0x276439=_0x92d9('0x33');return db[_0x92d9('0x6b')]['find']({'where':{'name':_0x276439,'userProfileId':_0x48861d[_0x92d9('0x6c')]},'raw':!![]})[_0x92d9('0x1c')](function(_0x134f9e){if(_0x134f9e&&_0x134f9e['autoAssociation']===0x0){return db[_0x92d9('0x34')]['create']({'name':_0x445de4[_0x92d9('0x36')],'resourceId':_0x445de4['id'],'type':_0x134f9e[_0x92d9('0x36')],'sectionId':_0x134f9e['id']},{})['then'](function(){return _0x351acb;});}else{return _0x351acb;}})[_0x92d9('0x26')](function(_0x15f25b){logger['error'](_0x92d9('0x6d'),_0x15f25b);throw _0x15f25b;});}return _0x351acb;})[_0x92d9('0x1c')](respondWithResult(_0x596d48,0xc9))['catch'](handleError(_0x596d48,null));};exports[_0x92d9('0x30')]=function(_0x222812,_0x4b2047){if(!wildcardUtils[_0x92d9('0x64')](_0x222812[_0x92d9('0x65')]['address'])){return handleError(_0x4b2047,null)(new APIBadRequestError('\x22'+_0x222812['body'][_0x92d9('0x66')]+_0x92d9('0x67')));}if(_0x222812['body']['id']){delete _0x222812['body']['id'];}return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x222812[_0x92d9('0x62')]['id']},'include':[{'model':db[_0x92d9('0x6f')],'as':_0x92d9('0x4a')}]})[_0x92d9('0x1c')](handleEntityNotFound(_0x4b2047,null))[_0x92d9('0x1c')](saveUpdates(_0x222812[_0x92d9('0x65')],null))['then'](respondWithResult(_0x4b2047,null))[_0x92d9('0x26')](handleError(_0x4b2047,null));};exports[_0x92d9('0x31')]=function(_0x50c9d6,_0x4c23bb){return db[_0x92d9('0x4b')]['find']({'where':{'id':_0x50c9d6['params']['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x4c23bb,null))[_0x92d9('0x1c')](removeEntity(_0x4c23bb,null))[_0x92d9('0x26')](handleError(_0x4c23bb,null));};exports[_0x92d9('0x70')]=function(_0x22ddaa,_0xf2c9e3){return db[_0x92d9('0x4b')][_0x92d9('0x70')]()['then'](respondWithResult(_0xf2c9e3,null))['catch'](handleError(_0xf2c9e3,null));};exports[_0x92d9('0x71')]=function(_0x1dd740,_0x48b1b1){if(_0x1dd740['body']['id']){delete _0x1dd740[_0x92d9('0x65')]['id'];}return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x1dd740[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x48b1b1,null))[_0x92d9('0x1c')](function(_0x11dad1){if(_0x11dad1){_0x1dd740[_0x92d9('0x65')][_0x92d9('0x72')]=_0x11dad1['id'];return db[_0x92d9('0x73')][_0x92d9('0x63')](_0x1dd740[_0x92d9('0x65')]);}})[_0x92d9('0x1c')](respondWithResult(_0x48b1b1,null))[_0x92d9('0x26')](handleError(_0x48b1b1,null));};exports[_0x92d9('0x74')]=function(_0x44b69a,_0x3982d6){var _0x2bd543={'raw':![],'where':{}};var _0x5efd61={};var _0xdc58ef={'count':0x0,'rows':[]};return db[_0x92d9('0x4b')][_0x92d9('0x75')]({'where':{'id':_0x44b69a['params']['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x3982d6,null))[_0x92d9('0x1c')](function(_0x142861){if(_0x142861){_0x5efd61[_0x92d9('0x45')]=_[_0x92d9('0x50')](db[_0x92d9('0x73')][_0x92d9('0x4c')]);_0x5efd61['query']=_[_0x92d9('0x50')](_0x44b69a[_0x92d9('0x4f')]);_0x5efd61[_0x92d9('0x51')]=_['intersection'](_0x5efd61[_0x92d9('0x45')],_0x5efd61['query']);_0x2bd543[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x5efd61[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x44b69a['query'][_0x92d9('0x54')]));_0x2bd543[_0x92d9('0x53')]=_0x2bd543[_0x92d9('0x53')][_0x92d9('0x55')]?_0x2bd543['attributes']:_0x5efd61['model'];if(!_0x44b69a[_0x92d9('0x4f')][_0x92d9('0x76')](_0x92d9('0x77'))){_0x2bd543['limit']=qs[_0x92d9('0x2d')](_0x44b69a[_0x92d9('0x4f')][_0x92d9('0x2d')]);_0x2bd543[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x44b69a[_0x92d9('0x4f')][_0x92d9('0x2b')]);}_0x2bd543['order']=qs['sort'](_0x44b69a[_0x92d9('0x4f')]['sort']);_0x2bd543['where']=qs[_0x92d9('0x51')](_['pick'](_0x44b69a[_0x92d9('0x4f')],_0x5efd61[_0x92d9('0x51')]));_0x2bd543['where'][_0x92d9('0x72')]=_0x142861['id'];if(_0x44b69a['query'][_0x92d9('0x59')]){_0x2bd543['where']=_[_0x92d9('0x5a')](_0x2bd543['where'],{'$or':_[_0x92d9('0x4e')](_0x2bd543['attributes'],function(_0x192cbb){var _0x1470ba={};_0x1470ba[_0x192cbb]={'$like':'%'+_0x44b69a['query']['filter']+'%'};return _0x1470ba;})});}_0x2bd543=_[_0x92d9('0x5a')]({},_0x2bd543,_0x44b69a[_0x92d9('0x5b')]);return db[_0x92d9('0x73')]['count']({'where':_0x2bd543[_0x92d9('0x57')]})[_0x92d9('0x1c')](function(_0x5248c5){_0xdc58ef[_0x92d9('0x5c')]=_0x5248c5;if(_0x44b69a[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x2bd543['include']=[{'all':!![]}];}return db[_0x92d9('0x73')]['findAll'](_0x2bd543);})['then'](function(_0x5eaf47){_0xdc58ef[_0x92d9('0x60')]=_0x5eaf47;return _0xdc58ef;});}})[_0x92d9('0x1c')](respondWithFilteredResult(_0x3982d6,_0x2bd543))['catch'](handleError(_0x3982d6,null));};exports[_0x92d9('0x78')]=function(_0x22b173,_0x21a274){return db[_0x92d9('0x4b')]['find']({'where':{'id':_0x22b173[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x21a274,null))['then'](function(_0x5135a9){if(_0x5135a9){return _0x5135a9[_0x92d9('0x78')](_0x22b173[_0x92d9('0x4f')][_0x92d9('0x79')]);}})[_0x92d9('0x1c')](respondWithStatusCode(_0x21a274,null))['catch'](handleError(_0x21a274,null));};exports[_0x92d9('0x7a')]=function(_0x10a2e5,_0x57c17e){if(_0x10a2e5[_0x92d9('0x65')]['id']){delete _0x10a2e5[_0x92d9('0x65')]['id'];}return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x10a2e5[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x57c17e,null))[_0x92d9('0x1c')](function(_0x13c854){if(_0x13c854){_0x10a2e5[_0x92d9('0x65')][_0x92d9('0x72')]=_0x13c854['id'];return db[_0x92d9('0x7b')]['create'](_0x10a2e5[_0x92d9('0x65')]);}})[_0x92d9('0x1c')](respondWithResult(_0x57c17e,null))[_0x92d9('0x26')](handleError(_0x57c17e,null));};exports['getAnswers']=function(_0xd74615,_0x2b52b7){var _0x11d419={'raw':![],'where':{}};var _0x39a038={};var _0xdd8102={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x92d9('0x75')]({'where':{'id':_0xd74615[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x2b52b7,null))[_0x92d9('0x1c')](function(_0x5ef5a6){if(_0x5ef5a6){_0x39a038['model']=_['keys'](db['CannedAnswer'][_0x92d9('0x4c')]);_0x39a038[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0xd74615[_0x92d9('0x4f')]);_0x39a038[_0x92d9('0x51')]=_['intersection'](_0x39a038['model'],_0x39a038[_0x92d9('0x4f')]);_0x11d419[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x39a038[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0xd74615[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x11d419[_0x92d9('0x53')]=_0x11d419['attributes'][_0x92d9('0x55')]?_0x11d419[_0x92d9('0x53')]:_0x39a038['model'];if(!_0xd74615['query'][_0x92d9('0x76')](_0x92d9('0x77'))){_0x11d419[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0xd74615[_0x92d9('0x4f')][_0x92d9('0x2d')]);_0x11d419[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0xd74615[_0x92d9('0x4f')][_0x92d9('0x2b')]);}_0x11d419[_0x92d9('0x7c')]=qs['sort'](_0xd74615[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x11d419[_0x92d9('0x57')]=qs[_0x92d9('0x51')](_[_0x92d9('0x7d')](_0xd74615['query'],_0x39a038[_0x92d9('0x51')]));_0x11d419['where'][_0x92d9('0x72')]=_0x5ef5a6['id'];if(_0xd74615['query'][_0x92d9('0x59')]){_0x11d419[_0x92d9('0x57')]=_[_0x92d9('0x5a')](_0x11d419[_0x92d9('0x57')],{'$or':_['map'](_0x11d419[_0x92d9('0x53')],function(_0x17ad79){var _0xd00490={};_0xd00490[_0x17ad79]={'$like':'%'+_0xd74615[_0x92d9('0x4f')][_0x92d9('0x59')]+'%'};return _0xd00490;})});}_0x11d419=_[_0x92d9('0x5a')]({},_0x11d419,_0xd74615[_0x92d9('0x5b')]);return db[_0x92d9('0x7b')]['count']({'where':_0x11d419[_0x92d9('0x57')]})[_0x92d9('0x1c')](function(_0x360c91){_0xdd8102['count']=_0x360c91;if(_0xd74615[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x11d419[_0x92d9('0x5e')]=[{'all':!![]}];}return db[_0x92d9('0x7b')][_0x92d9('0x5f')](_0x11d419);})['then'](function(_0x14d27f){_0xdd8102['rows']=_0x14d27f;return _0xdd8102;});}})[_0x92d9('0x1c')](respondWithFilteredResult(_0x2b52b7,_0x11d419))['catch'](handleError(_0x2b52b7,null));};exports[_0x92d9('0x7e')]=function(_0x843e58,_0x2b2479){return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x843e58[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x2b2479,null))['then'](function(_0x2db909){if(_0x2db909){return _0x2db909[_0x92d9('0x7e')](_0x843e58[_0x92d9('0x4f')]['ids']);}})['then'](respondWithStatusCode(_0x2b2479,null))[_0x92d9('0x26')](handleError(_0x2b2479,null));};exports[_0x92d9('0x7f')]=function(_0x2aaa3f,_0x787fa3){_0x2aaa3f[_0x92d9('0x65')][_0x92d9('0x80')]=_0x2aaa3f[_0x92d9('0x81')][_0x92d9('0x82')];return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x2aaa3f[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x787fa3,null))[_0x92d9('0x1c')](saveUpdates(_0x2aaa3f[_0x92d9('0x65')],null))[_0x92d9('0x1c')](respondWithResult(_0x787fa3,null))[_0x92d9('0x26')](handleError(_0x787fa3,null));};exports['addAvatar']=function(_0x35f5b0,_0x612466){_0x35f5b0['body']['agentAvatar']=_0x35f5b0['file']['filename'];return db[_0x92d9('0x4b')]['find']({'where':{'id':_0x35f5b0[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x612466,null))[_0x92d9('0x1c')](saveUpdates(_0x35f5b0[_0x92d9('0x65')],null))[_0x92d9('0x1c')](respondWithResult(_0x612466,null))[_0x92d9('0x26')](handleError(_0x612466,null));};exports[_0x92d9('0x83')]=function(_0x1c027e,_0x39483e){_0x1c027e['body'][_0x92d9('0x84')]=_0x1c027e[_0x92d9('0x81')][_0x92d9('0x82')];return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x1c027e[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x39483e,null))[_0x92d9('0x1c')](saveUpdates(_0x1c027e[_0x92d9('0x65')],null))['then'](respondWithResult(_0x39483e,null))['catch'](handleError(_0x39483e,null));};exports['addSystemAvatar']=function(_0x30c062,_0x58c536){_0x30c062[_0x92d9('0x65')]['systemAvatar']=_0x30c062['file']['filename'];return db[_0x92d9('0x4b')][_0x92d9('0x6e')]({'where':{'id':_0x30c062[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x58c536,null))[_0x92d9('0x1c')](saveUpdates(_0x30c062[_0x92d9('0x65')],null))['then'](respondWithResult(_0x58c536,null))['catch'](handleError(_0x58c536,null));};exports['getLogo']=function(_0x1f9273,_0x2cce24){var _0x4a1b05=path['join'](config[_0x92d9('0x85')],_0x92d9('0x86'));var _0x4724fa={'where':{'id':_0x1f9273[_0x92d9('0x62')]['id']},'attributes':['id',_0x92d9('0x80')],'raw':!![]};var _0x426886=![];return require(_0x92d9('0x87'))['getLicense']()[_0x92d9('0x1c')](function(_0x4653df){if(_0x4653df){_0x426886=_0x4653df[_0x92d9('0x88')];}})[_0x92d9('0x1c')](function(){return db[_0x92d9('0x4b')][_0x92d9('0x6e')](_0x4724fa);})[_0x92d9('0x1c')](handleEntityNotFound(_0x2cce24,null))[_0x92d9('0x1c')](function(_0x348cb4){if(_0x348cb4){if(!_[_0x92d9('0x89')](_0x348cb4[_0x92d9('0x80')])){if(fs['existsSync'](path['join'](config[_0x92d9('0x85')],_0x92d9('0x8a'),_0x348cb4[_0x92d9('0x80')]))&&_0x426886){_0x4a1b05=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/images/logos/',_0x348cb4[_0x92d9('0x80')]);}}return _0x2cce24[_0x92d9('0x8c')](_0x4a1b05);}})[_0x92d9('0x26')](handleError(_0x2cce24,null));};exports[_0x92d9('0x8d')]=function(_0x454c17,_0x2aac60){var _0x1d198e=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0x8e'));var _0xfbb9ee={'where':{'id':_0x454c17[_0x92d9('0x62')]['id']},'attributes':['id',_0x92d9('0x8f')],'raw':!![]};return db[_0x92d9('0x4b')]['find'](_0xfbb9ee)[_0x92d9('0x1c')](handleEntityNotFound(_0x2aac60,null))['then'](function(_0x1e0df5){if(_0x1e0df5){if(!_[_0x92d9('0x89')](_0x1e0df5[_0x92d9('0x8f')])){if(fs[_0x92d9('0x90')](path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0x91'),_0x1e0df5[_0x92d9('0x8f')]))){_0x1d198e=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0x91'),_0x1e0df5['agentAvatar']);}}return _0x2aac60[_0x92d9('0x8c')](_0x1d198e);}})[_0x92d9('0x26')](handleError(_0x2aac60,null));};exports['getCustomerAvatar']=function(_0x2c028d,_0x3bfa58){var _0x452b1f=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/images/avatars/customer_avatar.png');var _0x46fd3e={'where':{'id':_0x2c028d[_0x92d9('0x62')]['id']},'attributes':['id',_0x92d9('0x84'),_0x92d9('0x92')],'raw':!![]};return db[_0x92d9('0x4b')]['find'](_0x46fd3e)['then'](handleEntityNotFound(_0x3bfa58,null))[_0x92d9('0x1c')](function(_0x2fec38){if(_0x2fec38){if(!_[_0x92d9('0x89')](_0x2fec38[_0x92d9('0x84')])){if(fs[_0x92d9('0x90')](path[_0x92d9('0x8b')](config['root'],_0x92d9('0x91'),_0x2fec38['customerAvatar']))&&_0x2fec38[_0x92d9('0x92')]){_0x452b1f=path[_0x92d9('0x8b')](config['root'],_0x92d9('0x91'),_0x2fec38[_0x92d9('0x84')]);}}return _0x3bfa58[_0x92d9('0x8c')](_0x452b1f);}})[_0x92d9('0x26')](handleError(_0x3bfa58,null));};exports[_0x92d9('0x93')]=function(_0x42785e,_0xa51505){var _0x443faa=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/images/avatars/system_avatar.png');var _0x2b0b45={'where':{'id':_0x42785e[_0x92d9('0x62')]['id']},'attributes':['id',_0x92d9('0x94')],'raw':!![]};return db[_0x92d9('0x4b')][_0x92d9('0x6e')](_0x2b0b45)[_0x92d9('0x1c')](handleEntityNotFound(_0xa51505,null))[_0x92d9('0x1c')](function(_0x5dd80c){if(_0x5dd80c){if(!_[_0x92d9('0x89')](_0x5dd80c[_0x92d9('0x94')])){if(fs[_0x92d9('0x90')](path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0x91'),_0x5dd80c[_0x92d9('0x94')]))){_0x443faa=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/images/avatars/',_0x5dd80c[_0x92d9('0x94')]);}}return _0xa51505['download'](_0x443faa);}})[_0x92d9('0x26')](handleError(_0xa51505,null));};function checkWebsiteInterval(_0x4df746){var _0x4893af=_0x4df746[_0x92d9('0x95')];if(!_0x4893af){return Promise[_0x92d9('0x96')](_0x4df746);}var _0x11f33c=_0x4df746[_0x92d9('0x97')]||undefined;return _0x4893af[_0x92d9('0x98')](_0x11f33c)[_0x92d9('0x1c')](function(_0x4add15){if(!_0x4add15){throw new APIOutOfIntervalError();}return _0x4df746;});}exports[_0x92d9('0x99')]=function(_0x1b328a,_0x35ea79){var _0x1d6bb5={'body':_0x1b328a[_0x92d9('0x65')],'channel':_0x92d9('0x9a')};var _0x2035ef=[];var _0x2d4856=[];var _0x14849f={};var _0x527567=![];if(_0x1b328a[_0x92d9('0x65')]['id']){delete _0x1b328a[_0x92d9('0x65')]['id'];}if(_[_0x92d9('0x89')](_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9b')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_['isNil'](_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9c')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x92d9('0x9d')](_0x1b328a['body'][_0x92d9('0x65')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0xe51afa=_0x1b328a[_0x92d9('0x65')]['customerIp']&&_0x1b328a[_0x92d9('0x65')]['referer'];return db[_0x92d9('0x9e')][_0x92d9('0x70')]()[_0x92d9('0x1c')](function(_0x5ef99c){if(!_0x5ef99c){throw new Error('No\x20available\x20attributes');}_0x2035ef=Object[_0x92d9('0x50')](_0x5ef99c)[_0x92d9('0x59')](function(_0x16e0af){return![_0x92d9('0x9f'),'updatedAt']['includes'](_0x16e0af);});_0x2d4856=Object[_0x92d9('0x50')](_0x5ef99c)['filter'](function(_0xdf392a){return!['createdAt',_0x92d9('0xa0'),_0x92d9('0xa1'),_0x92d9('0xa2')][_0x92d9('0xa3')](_0xdf392a);});if(!_[_0x92d9('0xa3')](_0x2d4856,_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9c')])){throw new APIBadRequestError(_0x92d9('0xa4')+_0x2d4856['join'](',\x20'));}_0x14849f[_0x1b328a[_0x92d9('0x65')]['mapKey']]=_0x1b328a[_0x92d9('0x65')]['from'];})[_0x92d9('0x1c')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1b328a[_0x92d9('0x62')]['id']},'include':[{'model':db[_0x92d9('0xa5')],'as':_0x92d9('0xa6'),'include':[{'model':db[_0x92d9('0x9e')],'as':_0x92d9('0xa7'),'where':_0x14849f,'limit':0x1,'order':[[_0x92d9('0xa0'),_0x92d9('0xa8')]]}]},{'model':db[_0x92d9('0xa9')],'as':'Applications'},{'model':db[_0x92d9('0x95')],'as':_0x92d9('0x95'),'include':[{'model':db['Interval'],'as':_0x92d9('0xaa'),'attributes':['id',_0x92d9('0xab')],'raw':!![]}]}]});})[_0x92d9('0x1c')](function(_0x355353){if(!_0x355353){throw new APINotFoundError(util[_0x92d9('0x43')](_0x92d9('0xac'),_0x1b328a[_0x92d9('0x62')]['id']));}if(_0xe51afa){return checkWebsiteInterval(_0x355353);}return _0x355353;})['then'](function(_0x3205c1){_0x1d6bb5[_0x92d9('0xad')]=_0x3205c1;_0x1d6bb5['applications']=_['orderBy'](_0x3205c1[_0x92d9('0xae')],[_0x92d9('0xaf')],['asc']);if(_0x1d6bb5[_0x92d9('0xad')][_0x92d9('0xae')]){delete _0x1d6bb5[_0x92d9('0xad')]['Applications'];}_0x1d6bb5['list']=_0x3205c1['List']||{'id':_0x3205c1['ListId']};if(_0x1d6bb5[_0x92d9('0xb0')]&&_0x1d6bb5['list']['Contacts'][_0x92d9('0x55')]){return _0x1d6bb5[_0x92d9('0xb0')]['Contacts'][0x0];}var _0x3b1ac2=_[_0x92d9('0x15')](_0x1b328a[_0x92d9('0x65')],{'firstName':_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9b')],'ListId':_0x3205c1[_0x92d9('0xa2')]});_0x3b1ac2[_0x1b328a[_0x92d9('0x65')]['mapKey']]=_0x1b328a[_0x92d9('0x65')][_0x92d9('0x9b')];return db[_0x92d9('0x9e')][_0x92d9('0x63')](_0x3b1ac2,{'fields':_0x2035ef,'raw':!![]});})[_0x92d9('0x1c')](function(_0x318f60){_0x1d6bb5[_0x92d9('0xb1')]=_0x318f60;var _0x56b564=createInteractionObject(_0x1b328a[_0x92d9('0x62')]['id'],_0x1b328a[_0x92d9('0x65')],_0x1b328a[_0x92d9('0xb2')],_0x318f60);var _0x24123a={'ChatWebsiteId':_0x1b328a[_0x92d9('0x62')]['id']};if(_0x1b328a[_0x92d9('0x65')][_0x92d9('0xb3')]){_0x24123a['threadId']=_0x1b328a[_0x92d9('0x65')]['threadId'];_0x24123a[_0x92d9('0xb4')]=![];return db[_0x92d9('0xb5')][_0x92d9('0x6e')]({'where':_0x24123a})['then'](function(_0x170687){var _0x57c135=_0x1b328a['body'][_0x92d9('0xb6')]&&_0x1b328a[_0x92d9('0x65')]['referer'];if(_0x170687){_0x527567=!![];return _0x170687;}else if(!_0x57c135&&_0x170687&&_0x170687[_0x92d9('0xb4')]){throw new APIConflictError(_0x92d9('0xb7'));}_0x56b564[_0x92d9('0xb3')]=_0x1b328a[_0x92d9('0x65')][_0x92d9('0xb3')];_0x56b564['externalUrl']=_0x1b328a[_0x92d9('0x65')]['externalUrl'];return db[_0x92d9('0xb5')]['create'](_0x56b564);});}_0x24123a[_0x92d9('0xb8')]=_0x318f60['id'];if(_0x1b328a['body']['interaction']&&_0x1b328a['body'][_0x92d9('0xb9')]['id']){_0x24123a['id']=_0x1b328a[_0x92d9('0x65')]['interaction']['id'];return db['ChatInteraction'][_0x92d9('0x6e')]({'where':_0x24123a})[_0x92d9('0x1c')](function(_0x87727c){var _0x4dfb82=_0x1b328a[_0x92d9('0x65')][_0x92d9('0xb6')]&&_0x1b328a[_0x92d9('0x65')][_0x92d9('0x40')];if(!_0x4dfb82&&_0x87727c&&_0x87727c[_0x92d9('0xb4')]){throw new APIConflictError(_0x92d9('0xb7'));}else if(_0x87727c){_0x527567=!![];return _0x87727c;}else{return db[_0x92d9('0xb5')][_0x92d9('0x63')](_0x56b564);}});}return db[_0x92d9('0xb5')][_0x92d9('0x63')](_0x56b564);})['then'](function(_0x511482){if(!_0x527567){return _0x511482;}var _0x35d23d={'from':(_0x1d6bb5[_0x92d9('0xb1')][_0x92d9('0x3e')]||'')+'\x20'+(_0x1d6bb5[_0x92d9('0xb1')]['lastName']||'')};if(_0x1b328a['body'][_0x92d9('0xb3')]&&_0x1b328a[_0x92d9('0x65')]['messageId']&&_0x1b328a[_0x92d9('0x65')][_0x92d9('0xb3')]!=_0x1b328a[_0x92d9('0x65')][_0x92d9('0xba')]){_0x35d23d[_0x92d9('0xb3')]=_0x1b328a[_0x92d9('0x65')]['messageId'];}return _0x511482[_0x92d9('0x30')](_0x35d23d);})['then'](function(_0x947df7){_0x1d6bb5['interaction']=_0x947df7['get']({'plain':!![]});_0x1d6bb5['interaction']['created']=!_0x527567;if(_0x1d6bb5[_0x92d9('0xb9')][_0x92d9('0xbb')]){if(_0x1d6bb5[_0x92d9('0xad')][_0x92d9('0xbc')]){_0x1d6bb5[_0x92d9('0xbd')][_0x92d9('0xbe')]({'id':0x0,'priority':_0x1d6bb5[_0x92d9('0xbd')][_0x92d9('0x55')]+0x1,'app':_0x92d9('0xbf'),'appdata':_0x92d9('0xc0'),'interval':_0x92d9('0xc1')});}}return db[_0x92d9('0xc2')][_0x92d9('0x63')]({'body':_0x1b328a[_0x92d9('0x65')][_0x92d9('0x65')],'ChatWebsiteId':_0x1b328a[_0x92d9('0x62')]['id'],'ChatInteractionId':_0x947df7['id'],'direction':'in','ContactId':_0x1d6bb5[_0x92d9('0xb1')]['id'],'AttachmentId':_0x1b328a[_0x92d9('0x65')][_0x92d9('0xc3')]});})[_0x92d9('0x1c')](function(_0x3ed67f){_0x1d6bb5['message']=_0x3ed67f;if(!_0x1d6bb5[_0x92d9('0xb9')][_0x92d9('0xc4')]){return;}return db[_0x92d9('0xc5')]['find']({'attributes':['id','name'],'where':{'id':_0x1d6bb5[_0x92d9('0xb9')][_0x92d9('0xc4')]}});})[_0x92d9('0x1c')](function(_0x335337){if(_0x335337){_0x1d6bb5[_0x92d9('0xbd')][_0x92d9('0xc6')]({'id':0x0,'priority':0x0,'app':_0x92d9('0xc7'),'appdata':_0x335337['name']+','+(_0x1d6bb5[_0x92d9('0xad')]['waitForTheAssignedAgent']||0xa),'interval':_0x92d9('0xc1')});_0x1d6bb5[_0x92d9('0xc8')]=!![];}if(!_0x1d6bb5[_0x92d9('0xb9')]['queueId']){return;}return db[_0x92d9('0xc9')]['find']({'attributes':['id',_0x92d9('0x36')],'where':{'id':_0x1d6bb5[_0x92d9('0xb9')][_0x92d9('0xca')]}});})[_0x92d9('0x1c')](function(_0x252879){if(_0x252879){_0x1d6bb5[_0x92d9('0xbd')][_0x92d9('0xc6')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x252879[_0x92d9('0x36')]+','+(_0x1d6bb5['account'][_0x92d9('0xcb')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x92d9('0xcc'),'startRouting',_0x1d6bb5);})[_0x92d9('0x1c')](function(_0x924cbc){respondWithRpcPromise(_0x92d9('0xcd'),_0x92d9('0xcd'),{'event':_0x92d9('0x99'),'message':_0x924cbc},client9002);return _0x924cbc;})['then'](respondWithResult(_0x35ea79,null))['catch'](APIHandleError(_0x35ea79));};exports[_0x92d9('0xce')]=function(_0x3d616c,_0x1bcd73){var _0xcd2ce9,_0x523fa0,_0x10cb0b;var _0x311576=[];var _0x4793da={};var _0x176479=_0x3d616c['files']||[];var _0xa9e0b0=[];var _0xb1d5ea;return db[_0x92d9('0x9e')][_0x92d9('0x70')]()[_0x92d9('0x1c')](function(_0x5a3368){if(!_0x5a3368){throw new db[(_0x92d9('0xcf'))][(_0x92d9('0xd0'))](_0x92d9('0xd1'));}_0x311576=_['difference'](_['keys'](_0x5a3368),['createdAt',_0x92d9('0xa0'),_0x92d9('0xa1'),_0x92d9('0xa2')]);if(_0x3d616c[_0x92d9('0x65')]['id']){delete _0x3d616c['body']['id'];}if(_[_0x92d9('0x89')](_0x3d616c[_0x92d9('0x65')][_0x92d9('0x9b')])){throw _0x1bcd73[_0x92d9('0x28')](0x1f4)['send'](new db[(_0x92d9('0xcf'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x92d9('0x89')](_0x3d616c['body'][_0x92d9('0x65')])||_0x3d616c[_0x92d9('0x65')][_0x92d9('0x65')]===''){throw _0x1bcd73[_0x92d9('0x28')](0x1f4)['send'](new db[(_0x92d9('0xcf'))][(_0x92d9('0xd0'))](_0x92d9('0xd2')));}if(_[_0x92d9('0x89')](_0x3d616c[_0x92d9('0x65')]['mapKeyOffline'])){throw _0x1bcd73[_0x92d9('0x28')](0x1f4)[_0x92d9('0x37')](new db[(_0x92d9('0xcf'))][(_0x92d9('0xd0'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x311576));}if(!_[_0x92d9('0xa3')](_0x311576,_0x3d616c[_0x92d9('0x65')][_0x92d9('0xd3')])){throw _0x1bcd73['status'](0x1f4)[_0x92d9('0x37')](new db[(_0x92d9('0xcf'))][(_0x92d9('0xd0'))](_0x92d9('0xd4')+_0x311576));}_0x4793da[_0x3d616c[_0x92d9('0x65')][_0x92d9('0xd3')]]=_0x3d616c[_0x92d9('0x65')][_0x92d9('0x9b')];})['then'](function(){return db['ChatWebsite'][_0x92d9('0x6e')]({'where':{'id':_0x3d616c[_0x92d9('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x92d9('0xa6')},{'model':db[_0x92d9('0xd5')],'as':_0x92d9('0xd5')}]});})[_0x92d9('0x1c')](handleEntityNotFound(_0x1bcd73,null))[_0x92d9('0x1c')](function(_0x2b5c3e){if(_0x2b5c3e&&_0x2b5c3e[_0x92d9('0xa6')]){_0x523fa0=_0x2b5c3e;var _0x29caea=_[_0x92d9('0x15')](_0x3d616c[_0x92d9('0x65')],{'firstName':_0x3d616c[_0x92d9('0x65')][_0x92d9('0x9b')],'phone':_0x3d616c[_0x92d9('0x65')][_0x92d9('0x9b')],'ListId':_0x2b5c3e[_0x92d9('0xa2')]});_0x29caea[_0x3d616c[_0x92d9('0x65')]['mapKeyOffline']]=_0x3d616c['body'][_0x92d9('0x9b')];return db['CmContact'][_0x92d9('0xd6')]({'where':_0x4793da,'defaults':_0x29caea});}})[_0x92d9('0xd7')](function(_0x1c202a){if(_0x1c202a){_0x10cb0b=_0x1c202a;var _0x4fa159=fs[_0x92d9('0xd8')](path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server/files/templates/chatOfflineMessage.ejs'),_0x92d9('0xd9'));var _0x1c554a=ejs[_0x92d9('0xda')](_0x4fa159,{'body':_[_0x92d9('0xdb')](_0x3d616c['body'][_0x92d9('0x65')]),'bodyTitle':_0x523fa0[_0x92d9('0xdc')]});return db['ChatOfflineMessage'][_0x92d9('0x63')]({'body':_0x1c554a,'plainBody':htmlToText[_0x92d9('0xdd')](_0x1c554a),'ContactId':_0x1c202a['id'],'ChatWebsiteId':_0x523fa0['id']});}})[_0x92d9('0x1c')](function(_0x13a765){_0xb1d5ea=_0x13a765;if(_0x176479[_0x92d9('0x55')]){var _0x477128=_0x176479[_0x92d9('0x4e')](function(_0x5de1a1){return{'name':_0x5de1a1['originalname'],'basename':_0x5de1a1['filename'],'type':_0x5de1a1[_0x92d9('0xde')],'ChatOfflineMessageId':_0x13a765['id']};});_0xa9e0b0=_0x477128[_0x92d9('0x4e')](_0x4ad04f=>{var _0x56f8d6={'filename':_0x4ad04f[_0x92d9('0x36')],'path':path[_0x92d9('0x8b')](config[_0x92d9('0x85')],_0x92d9('0xdf'),_0x92d9('0xe0'),_0x92d9('0xe1'),'offline-chat',_0x4ad04f['basename'])};return _0x56f8d6;});if(!_0x523fa0['openNewInteraction']){return db[_0x92d9('0xe2')][_0x92d9('0xe3')](function(_0x3540a9){return db[_0x92d9('0xe4')]['bulkCreate'](_0x477128,{'transaction':_0x3540a9});});}}})[_0x92d9('0x1c')](function(){if(_0xb1d5ea){_0xcd2ce9=_0xb1d5ea;return db[_0x92d9('0xd5')][_0x92d9('0x75')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x92d9('0xe5'),'raw':!![],'include':[{'model':db[_0x92d9('0xe6')],'as':_0x92d9('0xe6'),'raw':!![]}]}]});}})[_0x92d9('0x1c')](function(_0x4ce013){if(_0x4ce013&&_0x4ce013[_0x92d9('0xe5')]&&_0x523fa0[_0x92d9('0xe7')]&&_0x523fa0[_0x92d9('0xe8')]){var _0x51f2b2=_0x4ce013[_0x92d9('0xe9')]();return respondWithRpcPromise(_0x92d9('0xea'),'sendMail',{'account':_0x51f2b2,'message':{'from':util[_0x92d9('0x43')](_0x92d9('0xeb'),_0x4ce013[_0x92d9('0x36')],_0x4ce013['email']||_0x4ce013['Smtp'][_0x92d9('0x68')]),'to':_0x523fa0['forwardOfflineAddress'],'subject':_0x523fa0[_0x92d9('0xec')],'html':_0xcd2ce9[_0x92d9('0x65')],'attachments':_0xa9e0b0}},client9003)['then'](function(){return _0xcd2ce9;})['catch'](function(_0x3db0a6){logger[_0x92d9('0x23')](_0x3db0a6);});}})[_0x92d9('0x1c')](function(){if(_0x523fa0&&_0x523fa0[_0x92d9('0xed')]&&_0x523fa0[_0x92d9('0xee')]){var _0x1b70be=[];if(_0x176479['length']){_0x1b70be=_0x176479[_0x92d9('0x4e')](function(_0x21c813){return{'name':_0x21c813[_0x92d9('0xef')],'basename':_0x21c813[_0x92d9('0x82')],'type':_0x21c813[_0x92d9('0xde')],'ChatOfflineMessageId':_0xb1d5ea['id']};});}var _0x362b97;if(!_[_0x92d9('0x89')](_0x523fa0[_0x92d9('0xf0')])){var _0x327b44=_[_0x92d9('0x4e')](_0x3d616c[_0x92d9('0x65')],function(_0x26754e){return _0x26754e;});var _0x3d2b5d=_['toPairsIn'](_0x327b44)[0x0];var _0x3d0201=_[_0x92d9('0xf1')](_0x3d2b5d,function(_0xf1d504){return _0xf1d504;});_0x362b97=_0x3d0201[0x1][_0x523fa0[_0x92d9('0xf0')]];}var _0x3a8405={'from':_0x10cb0b['email'],'firstName':_0x10cb0b[_0x92d9('0x3e')],'lastName':_0x10cb0b[_0x92d9('0xf2')],'mapKey':'email','message':{'from':_0x10cb0b[_0x92d9('0xf3')],'to':_0x523fa0[_0x92d9('0xd5')][_0x92d9('0xf3')],'cc':'','subject':_[_0x92d9('0x89')](_0x362b97)?_0x523fa0['offlineMessageSubject']:_0x362b97,'messageId':'','sentAt':new Date(),'attach':_0x1b70be['length'],'attachments':_0x1b70be,'originChannel':'Chat','ChatWebsiteId':_0x523fa0['id'],'ChatOfflineMessageId':_0xcd2ce9['id'],'originTo':_0x523fa0[_0x92d9('0xd5')]['email']},'body':_0xcd2ce9[_0x92d9('0x65')]};var _0x359974={'account':{'id':_0x523fa0[_0x92d9('0xee')]},'body':_0x3a8405,'log':_0x92d9('0xf4')};return respondWithRpcPromise(_0x92d9('0xf4'),_0x92d9('0xf5'),_0x359974,client9001)[_0x92d9('0x1c')](function(){return _0xcd2ce9;})[_0x92d9('0x26')](function(_0xb7c57e){logger[_0x92d9('0x23')](_0xb7c57e);});}return;})[_0x92d9('0x1c')](function(){if(_0xcd2ce9){return _0xcd2ce9;}})[_0x92d9('0x1c')](respondWithResult(_0x1bcd73,null))['catch'](function(){for(var _0x1627a5 of _0x176479){var _0x3f2480=path[_0x92d9('0x8b')](config[_0x92d9('0x85')],'server','files',_0x92d9('0xe1'),'offline-chat',_0x1627a5[_0x92d9('0x82')]);fs_extra[_0x92d9('0xf6')](_0x3f2480)[_0x92d9('0x26')](function(_0x78cf01){logger[_0x92d9('0x23')](_0x92d9('0xf7'),_0x3f2480,_0x78cf01);});}});};exports['addInteraction']=function(_0x2a1afa,_0x5b08e5){return db['ChatInteraction'][_0x92d9('0x6e')]({'where':{'id':_0x2a1afa[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x5b08e5,null))['then'](function(_0x8a642d){if(_0x8a642d){return _0x8a642d[_0x92d9('0xf8')](_0x2a1afa[_0x92d9('0x65')]['ids'],_[_0x92d9('0xf9')](_0x2a1afa[_0x92d9('0x65')],['ids','id'])||{});}})[_0x92d9('0x1c')](respondWithResult(_0x5b08e5,null))[_0x92d9('0x26')](handleError(_0x5b08e5,null));};exports[_0x92d9('0xfa')]=function(_0x3cb0df,_0x26fb8c){var _0x4fe48d={'raw':![],'where':{}};var _0x36b0df={};var _0x394866={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3cb0df[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x26fb8c,null))[_0x92d9('0x1c')](function(_0xe3e064){if(_0xe3e064){_0x36b0df[_0x92d9('0x45')]=_[_0x92d9('0x50')](db['ChatInteraction'][_0x92d9('0x4c')]);_0x36b0df[_0x92d9('0x4f')]=_['keys'](_0x3cb0df['query']);_0x36b0df[_0x92d9('0x51')]=_[_0x92d9('0x52')](_0x36b0df[_0x92d9('0x45')],_0x36b0df[_0x92d9('0x4f')]);_0x4fe48d[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x36b0df['model'],qs[_0x92d9('0x54')](_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x4fe48d[_0x92d9('0x53')]=_0x4fe48d[_0x92d9('0x53')][_0x92d9('0x55')]?_0x4fe48d[_0x92d9('0x53')]:_0x36b0df['model'];if(!_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x76')](_0x92d9('0x77'))){_0x4fe48d[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0x3cb0df['query']['limit']);_0x4fe48d[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x2b')]);}_0x4fe48d[_0x92d9('0x7c')]=qs[_0x92d9('0x56')](_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x4fe48d[_0x92d9('0x57')]=qs['filters'](_[_0x92d9('0x7d')](_0x3cb0df['query'],_0x36b0df[_0x92d9('0x51')]));_0x4fe48d[_0x92d9('0x57')][_0x92d9('0x72')]=_0xe3e064['id'];if(_0x3cb0df['query']['filter']){_0x4fe48d[_0x92d9('0x57')]=_['merge'](_0x4fe48d[_0x92d9('0x57')],{'$or':_[_0x92d9('0x4e')](_0x4fe48d[_0x92d9('0x53')],function(_0x5d4d63){var _0x4caca1={};_0x4caca1[_0x5d4d63]={'$like':'%'+_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x59')]+'%'};return _0x4caca1;})});}_0x4fe48d=_[_0x92d9('0x5a')]({},_0x4fe48d,_0x3cb0df[_0x92d9('0x5b')]);return db[_0x92d9('0xb5')]['count']({'where':_0x4fe48d[_0x92d9('0x57')]})[_0x92d9('0x1c')](function(_0x4b9d57){_0x394866[_0x92d9('0x5c')]=_0x4b9d57;if(_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x4fe48d[_0x92d9('0x5e')]=[{'model':db[_0x92d9('0x9e')],'as':_0x92d9('0xfb'),'required':![]},{'model':db[_0x92d9('0xc5')],'as':_0x92d9('0xfc'),'attributes':[_0x92d9('0x36'),_0x92d9('0xfd'),_0x92d9('0xfe')],'required':![]},{'model':db[_0x92d9('0xff')],'as':_0x92d9('0x100'),'attributes':['id','name',_0x92d9('0x101')],'where':_0x3cb0df[_0x92d9('0x4f')]['tag']?{'id':_0x3cb0df[_0x92d9('0x4f')]['tag']}:undefined,'required':_0x3cb0df[_0x92d9('0x4f')][_0x92d9('0x102')]?!![]:![]}];}return db[_0x92d9('0xb5')][_0x92d9('0x5f')](_0x4fe48d);})[_0x92d9('0x1c')](function(_0x528244){_0x394866['rows']=_0x528244;return _0x394866;});}})[_0x92d9('0x1c')](respondWithFilteredResult(_0x26fb8c,_0x4fe48d))[_0x92d9('0x26')](handleError(_0x26fb8c,null));};exports[_0x92d9('0x103')]=function(_0xd67e72,_0x201676){var _0x419a7a=0x0;var _0x29fcbf=0x0;var _0x241805=![];var _0x2a7197;var _0xe2e6bb;return db[_0x92d9('0x4b')]['find']({'where':{'id':_0xd67e72[_0x92d9('0x62')]['id']},'include':[{'model':db[_0x92d9('0x95')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x92d9('0xab')]}]}]})[_0x92d9('0x1c')](handleEntityNotFound(_0x201676,null))['then'](function(_0x2cffba){if(_0x2cffba){_0x2a7197=_0x2cffba;return _0x2cffba[_0x92d9('0x104')]({'raw':!![]});}})['then'](function(_0x45c66c){if(_0x2a7197){if(_0x45c66c){_0xe2e6bb=_0x45c66c;}}return require('../../config/license/util')[_0x92d9('0x105')]();})['then'](function(_0x431515){if(_0x431515){_0x29fcbf=_0x431515[_0x92d9('0x106')];_0x241805=_0x431515[_0x92d9('0x88')];}})[_0x92d9('0x1c')](function(){return db[_0x92d9('0xb5')]['count']({'where':{'closed':![]}});})[_0x92d9('0x1c')](function(_0x88e397){_0x419a7a=_0x88e397;if(_0x29fcbf&&_0x88e397>_0x29fcbf){return db[_0x92d9('0x107')][_0x92d9('0x75')]({'where':{'id':0x1}})[_0x92d9('0x1c')](function(_0xefac7b){if(_0xefac7b){_0xefac7b[_0x92d9('0x108')](_0x92d9('0x109'));}});}})[_0x92d9('0x1c')](function(){var _0x3d2393=_0x2a7197[_0x92d9('0x95')];var _0x18d143=_0x2a7197[_0x92d9('0x97')]||undefined;return _0x3d2393?_0x3d2393[_0x92d9('0x98')](_0x18d143):!![];})[_0x92d9('0x1c')](function(_0x29ac61){var _0x4e408c=fs[_0x92d9('0xd8')](path[_0x92d9('0x8b')](config['root'],_0x92d9('0x10a')),_0x92d9('0xd9'));var _0x29b19b=_0x92d9('0x10b');var _0x29fb68=![];try{const _0x4591d8=new URL(_0x2a7197['address']);_0x2a7197[_0x92d9('0x66')]=_0x4591d8['origin'];}catch(_0x7c1ed8){}var _0x4ff9d5;if(_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]){_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]=_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]['replace'](/\/$/,'');_0x4ff9d5=wildcardUtils[_0x92d9('0x10c')](_0x2a7197[_0x92d9('0x66')],_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]);}else{_0xd67e72['headers'][_0x92d9('0x40')]=_0x2a7197[_0x92d9('0x66')];_0x4ff9d5=!![];}var _0x5f331c={'chatVersion':_0x29b19b,'chatWebsiteAddressOrigin':_0x4ff9d5?_0xd67e72['headers'][_0x92d9('0x40')]:_0x2a7197['address'],'remote':_0x2a7197[_0x92d9('0x10d')],'query':querystring[_0x92d9('0x20')](_[_0x92d9('0x5a')](_0x2a7197[_0x92d9('0x32')]({'plain':!![]}),{'customerIp':_0xd67e72[_0x92d9('0xb2')]['x-forwarded-for']||_0xd67e72['headers']['x-real-ip']||_0xd67e72['connection'][_0x92d9('0x10e')]||_0xd67e72['ip'],'referer':_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')],'openedInteractions':_0x419a7a,'maxInteractions':_0x29fcbf,'virtual':_0x241805[_0x92d9('0x106')],'online':_0x29ac61,'custom':_0x241805,'address':_0x4ff9d5?_0xd67e72[_0x92d9('0xb2')][_0x92d9('0x40')]:null}))[_0x92d9('0x10f')](/'/g,'\x5c\x27')};_0x201676[_0x92d9('0x37')](ejs[_0x92d9('0xda')](Mustache[_0x92d9('0xda')](_0x4e408c,_0x5f331c),{'proactiveActions':_0xe2e6bb,'alignment':_0x2a7197['alignment'],'verticalAlignment':_0x2a7197['verticalAlignment'],'div_color':_0x2a7197[_0x92d9('0x101')],'labelText':_0x2a7197['labelText'],'text_color':_0x2a7197[_0x92d9('0x110')],'text_button_color':_0x2a7197[_0x92d9('0x111')],'button_color':_0x2a7197[_0x92d9('0x112')],'background_color':_0x2a7197['backgroundColor'],'hideWhenOffline':_0x2a7197['hideWhenOffline'],'intervalId':_0x2a7197['IntervalId'],'isDevelopment':_0x29fb68,'chatVersion':_0x29b19b}));})[_0x92d9('0x26')](handleError(_0x201676,null));};exports[_0x92d9('0x113')]=function(_0x1be47d,_0xd0dc15){var _0x22338a=_0x1be47d['params']['id'];var _0x3a936a=_0x1be47d[_0x92d9('0x65')];var _0x15c7fd=0xc8;var _0x171bea=null;return db[_0x92d9('0xe2')][_0x92d9('0xe3')]({'isolationLevel':db[_0x92d9('0xe2')][_0x92d9('0x114')][_0x92d9('0x115')][_0x92d9('0x116')]},function(_0x40f51c){return db['ChatWebsite']['findOne']({'where':{'id':_0x22338a},'transaction':_0x40f51c})[_0x92d9('0x1c')](function(_0x46b609){if(_0x46b609){return db[_0x92d9('0xa9')][_0x92d9('0x31')]({'where':{'ChatWebsiteId':_0x22338a},'transaction':_0x40f51c})['then'](function(){var _0x498b2c=_['map'](_0x3a936a,function(_0x2cdb75){_0x2cdb75[_0x92d9('0x72')]=_0x22338a;return _0x2cdb75;});return db[_0x92d9('0xa9')][_0x92d9('0x117')](_0x498b2c,{'transaction':_0x40f51c});});}else{_0x15c7fd=0x194;_0x171bea=[];}});})['then'](function(){if(_0x15c7fd!==0x194){return db[_0x92d9('0xa9')][_0x92d9('0x118')]({'where':{'ChatWebsiteId':_0x22338a},'order':_0x92d9('0xaf')})[_0x92d9('0x1c')](function(_0x487380){_0x171bea=_0x487380;});}})['catch'](function(_0x204bfa){_0x15c7fd=0x1f4;logger[_0x92d9('0x23')](_0x204bfa['stack']);if(_0x204bfa['name']){delete _0x204bfa[_0x92d9('0x36')];}_0x171bea=_0x204bfa;})[_0x92d9('0x119')](function(){if(_0x171bea===null){_0xd0dc15['sendStatus'](_0x15c7fd);}else{if(_0x15c7fd===0x1f4){_0xd0dc15[_0x92d9('0x28')](_0x15c7fd)[_0x92d9('0x37')](_0x171bea);}else{_0xd0dc15[_0x92d9('0x28')](_0x15c7fd)[_0x92d9('0x2a')](_0x171bea);}}});};exports[_0x92d9('0x11a')]=function(_0x36ab1a,_0x420668){var _0x4adae5={};var _0x34abe8={};var _0x142264;var _0x59c646;return db['ChatWebsite']['findOne']({'where':{'id':_0x36ab1a[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x420668,null))[_0x92d9('0x1c')](function(_0x4dd168){if(_0x4dd168){_0x142264=_0x4dd168;_0x34abe8['model']=_['keys'](db[_0x92d9('0xa9')]['rawAttributes']);_0x34abe8[_0x92d9('0x4f')]=_['keys'](_0x36ab1a[_0x92d9('0x4f')]);_0x34abe8[_0x92d9('0x51')]=_['intersection'](_0x34abe8['model'],_0x34abe8['query']);_0x4adae5[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x34abe8[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x4adae5[_0x92d9('0x53')]=_0x4adae5['attributes'][_0x92d9('0x55')]?_0x4adae5[_0x92d9('0x53')]:_0x34abe8[_0x92d9('0x45')];_0x4adae5[_0x92d9('0x7c')]=qs['sort'](_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x4adae5[_0x92d9('0x57')]=qs['filters'](_[_0x92d9('0x7d')](_0x36ab1a[_0x92d9('0x4f')],_0x34abe8[_0x92d9('0x51')]));if(_0x36ab1a['query'][_0x92d9('0x59')]){_0x4adae5['where']=_[_0x92d9('0x5a')](_0x4adae5[_0x92d9('0x57')],{'$or':_['map'](_0x4adae5[_0x92d9('0x53')],function(_0x3953a4){var _0x364cf6={};_0x364cf6[_0x3953a4]={'$like':'%'+_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x59')]+'%'};return _0x364cf6;})});}_0x4adae5=_['merge']({},_0x4adae5,_0x36ab1a[_0x92d9('0x5b')]);return _0x142264[_0x92d9('0x11a')](_0x4adae5);}})['then'](function(_0x119632){if(_0x119632){_0x59c646=_0x119632[_0x92d9('0x55')];if(!_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x76')]('nolimit')){_0x4adae5[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0x36ab1a['query']['limit']);_0x4adae5[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x36ab1a[_0x92d9('0x4f')][_0x92d9('0x2b')]);}return _0x142264['getApplications'](_0x4adae5);}})[_0x92d9('0x1c')](function(_0x59fd97){if(_0x59fd97){return _0x59fd97?{'count':_0x59c646,'rows':_0x59fd97}:null;}})[_0x92d9('0x1c')](respondWithResult(_0x420668,null))[_0x92d9('0x26')](handleError(_0x420668,null));};exports[_0x92d9('0x11b')]=function(_0x1258e7,_0x4651b3){return db[_0x92d9('0x11c')][_0x92d9('0x6e')]({'where':{'id':_0x1258e7[_0x92d9('0x62')]['id']}})['then'](handleEntityNotFound(_0x4651b3,null))['then'](function(_0x1183b6){if(_0x1183b6){return _0x1183b6[_0x92d9('0x11b')](_0x1258e7[_0x92d9('0x65')][_0x92d9('0x79')],_[_0x92d9('0xf9')](_0x1258e7[_0x92d9('0x65')],[_0x92d9('0x79'),'id'])||{});}})[_0x92d9('0x1c')](respondWithResult(_0x4651b3,null))[_0x92d9('0x26')](handleError(_0x4651b3,null));};exports['getProactiveActions']=function(_0x4d1dfa,_0xd083da){var _0x5d803e={};var _0x868b6c={};var _0x57f091;var _0x20b30f;return db[_0x92d9('0x4b')]['findOne']({'where':{'id':_0x4d1dfa['params']['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0xd083da,null))[_0x92d9('0x1c')](function(_0x2a8449){if(_0x2a8449){_0x57f091=_0x2a8449;_0x868b6c[_0x92d9('0x45')]=_[_0x92d9('0x50')](db[_0x92d9('0x11d')][_0x92d9('0x4c')]);_0x868b6c[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x4d1dfa[_0x92d9('0x4f')]);_0x868b6c['filters']=_[_0x92d9('0x52')](_0x868b6c['model'],_0x868b6c[_0x92d9('0x4f')]);_0x5d803e[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x868b6c[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x5d803e[_0x92d9('0x53')]=_0x5d803e[_0x92d9('0x53')]['length']?_0x5d803e[_0x92d9('0x53')]:_0x868b6c['model'];_0x5d803e[_0x92d9('0x7c')]=qs['sort'](_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x5d803e['where']=qs[_0x92d9('0x51')](_[_0x92d9('0x7d')](_0x4d1dfa[_0x92d9('0x4f')],_0x868b6c['filters']));if(_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x59')]){_0x5d803e['where']=_[_0x92d9('0x5a')](_0x5d803e['where'],{'$or':_[_0x92d9('0x4e')](_0x5d803e[_0x92d9('0x53')],function(_0x30d4a0){var _0x57f908={};_0x57f908[_0x30d4a0]={'$like':'%'+_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x59')]+'%'};return _0x57f908;})});}_0x5d803e=_[_0x92d9('0x5a')]({},_0x5d803e,_0x4d1dfa[_0x92d9('0x5b')]);return _0x57f091[_0x92d9('0x104')](_0x5d803e);}})['then'](function(_0x5f54ae){if(_0x5f54ae){_0x20b30f=_0x5f54ae[_0x92d9('0x55')];if(!_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x76')](_0x92d9('0x77'))){_0x5d803e[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0x4d1dfa[_0x92d9('0x4f')]['limit']);_0x5d803e['offset']=qs[_0x92d9('0x2b')](_0x4d1dfa[_0x92d9('0x4f')][_0x92d9('0x2b')]);}return _0x57f091[_0x92d9('0x104')](_0x5d803e);}})[_0x92d9('0x1c')](function(_0x4749fc){if(_0x4749fc){return _0x4749fc?{'count':_0x20b30f,'rows':_0x4749fc}:null;}})['then'](respondWithResult(_0xd083da,null))[_0x92d9('0x26')](handleError(_0xd083da,null));};exports[_0x92d9('0x11e')]=function(_0x509cbf,_0xf01061){var _0x1c0215=_0x509cbf[_0x92d9('0x4f')][_0x92d9('0x11f')]===_0x92d9('0x120')?_0x92d9('0x121'):_0x92d9('0x122');return db['ChatWebsite'][_0x92d9('0x6e')]({'attributes':['id',_0x1c0215],'where':{'id':_0x509cbf[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0xf01061,null))['then'](function(_0x12df27){if(_0x12df27){var _0x438b21=_0x12df27[_0x1c0215];var _0x532e56=_0x438b21&&_0x438b21[_0x92d9('0x123')]?_0x438b21['items']:[];_0xf01061[_0x92d9('0x37')]({'fromKey':_[_0x92d9('0x89')](_0x438b21['fromKey'])?undefined:_0x438b21[_0x92d9('0x124')],'count':_0x532e56[_0x92d9('0x55')],'rows':_0x532e56});}})[_0x92d9('0x26')](handleError(_0xf01061,null));};exports[_0x92d9('0x125')]=function(_0x3530a7,_0x3bb83b){var _0x292e7c={'raw':![],'where':{}};var _0x4b0c3e={};var _0x2cf33e={'count':0x0,'rows':[]};return db[_0x92d9('0x4b')][_0x92d9('0x75')]({'where':{'id':_0x3530a7[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x3bb83b,null))[_0x92d9('0x1c')](function(_0x242943){if(_0x242943){_0x4b0c3e[_0x92d9('0x45')]=_[_0x92d9('0x50')](db[_0x92d9('0x126')][_0x92d9('0x4c')]);_0x4b0c3e[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x3530a7[_0x92d9('0x4f')]);_0x4b0c3e[_0x92d9('0x51')]=_[_0x92d9('0x52')](_0x4b0c3e[_0x92d9('0x45')],_0x4b0c3e['query']);_0x292e7c[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x4b0c3e[_0x92d9('0x45')],qs[_0x92d9('0x54')](_0x3530a7['query'][_0x92d9('0x54')]));_0x292e7c['attributes']=_0x292e7c[_0x92d9('0x53')][_0x92d9('0x55')]?_0x292e7c[_0x92d9('0x53')]:_0x4b0c3e[_0x92d9('0x45')];if(!_0x3530a7[_0x92d9('0x4f')]['hasOwnProperty'](_0x92d9('0x77'))){_0x292e7c[_0x92d9('0x2d')]=qs[_0x92d9('0x2d')](_0x3530a7['query']['limit']);_0x292e7c[_0x92d9('0x2b')]=qs['offset'](_0x3530a7[_0x92d9('0x4f')][_0x92d9('0x2b')]);}_0x292e7c['order']=qs['sort'](_0x3530a7['query'][_0x92d9('0x56')]);_0x292e7c[_0x92d9('0x57')]=qs[_0x92d9('0x51')](_[_0x92d9('0x7d')](_0x3530a7[_0x92d9('0x4f')],_0x4b0c3e['filters']));_0x292e7c[_0x92d9('0x57')][_0x92d9('0x72')]=_0x242943['id'];if(_0x3530a7[_0x92d9('0x4f')][_0x92d9('0x59')]){_0x292e7c[_0x92d9('0x57')]=_[_0x92d9('0x5a')](_0x292e7c[_0x92d9('0x57')],{'$or':_['map'](_0x292e7c[_0x92d9('0x53')],function(_0x4365f6){var _0x2d07e9={};_0x2d07e9[_0x4365f6]={'$like':'%'+_0x3530a7[_0x92d9('0x4f')]['filter']+'%'};return _0x2d07e9;})});}_0x292e7c=_[_0x92d9('0x5a')]({},_0x292e7c,_0x3530a7[_0x92d9('0x5b')]);return db[_0x92d9('0x126')][_0x92d9('0x5c')]({'where':_0x292e7c[_0x92d9('0x57')]})['then'](function(_0x29d9f8){_0x2cf33e['count']=_0x29d9f8;if(_0x3530a7[_0x92d9('0x4f')][_0x92d9('0x5d')]){_0x292e7c[_0x92d9('0x5e')]=[{'all':!![]}];}else{_0x292e7c[_0x92d9('0x5e')]=[{'model':db[_0x92d9('0x9e')],'as':_0x92d9('0xfb'),'required':![]},{'model':db[_0x92d9('0xe4')],'as':_0x92d9('0x127'),'required':![]}];}return db[_0x92d9('0x126')]['findAll'](_0x292e7c);})['then'](function(_0x10caaf){_0x2cf33e['rows']=_0x10caaf;return _0x2cf33e;});}})[_0x92d9('0x1c')](respondWithFilteredResult(_0x3bb83b,_0x292e7c))[_0x92d9('0x26')](handleError(_0x3bb83b,null));};exports[_0x92d9('0x128')]=function(_0x1b0cfc,_0x50e9e9){return db['ChatWebsite'][_0x92d9('0x6e')]({'where':{'id':_0x1b0cfc[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x50e9e9,null))[_0x92d9('0x1c')](function(_0x2832af){if(_0x2832af){return _0x2832af['addAgents'](_0x1b0cfc['body']['ids'],_['omit'](_0x1b0cfc[_0x92d9('0x65')],[_0x92d9('0x79'),'id'])||{})['spread'](function(_0x3addb5){for(var _0x3ef666=0x0;_0x3ef666<_0x1b0cfc[_0x92d9('0x65')][_0x92d9('0x79')][_0x92d9('0x55')];_0x3ef666+=0x1){socket[_0x92d9('0x129')]('userChatWebsite:save',{'UserId':Number(_0x1b0cfc[_0x92d9('0x65')]['ids'][_0x3ef666]),'ChatWebsiteId':Number(_0x1b0cfc[_0x92d9('0x62')]['id'])});}return _0x3addb5;});}})[_0x92d9('0x1c')](respondWithResult(_0x50e9e9,null))['catch'](handleError(_0x50e9e9,null));};exports[_0x92d9('0x12a')]=function(_0x307f0f,_0x241220){return db[_0x92d9('0x4b')]['find']({'where':{'id':_0x307f0f[_0x92d9('0x62')]['id']}})[_0x92d9('0x1c')](handleEntityNotFound(_0x241220,null))[_0x92d9('0x1c')](function(_0x445954){if(_0x445954){return _0x445954[_0x92d9('0x12a')](_0x307f0f[_0x92d9('0x4f')]['ids'])[_0x92d9('0x1c')](function(){if(_[_0x92d9('0x12b')](_0x307f0f[_0x92d9('0x4f')][_0x92d9('0x79')])){for(var _0x277733=0x0;_0x277733<_0x307f0f[_0x92d9('0x4f')]['ids']['length'];_0x277733+=0x1){socket[_0x92d9('0x129')](_0x92d9('0x12c'),{'UserId':Number(_0x307f0f[_0x92d9('0x4f')][_0x92d9('0x79')][_0x277733]),'ChatWebsiteId':Number(_0x307f0f[_0x92d9('0x62')]['id'])});}}else{socket[_0x92d9('0x129')](_0x92d9('0x12c'),{'UserId':Number(_0x307f0f[_0x92d9('0x4f')][_0x92d9('0x79')]),'ChatWebsiteId':Number(_0x307f0f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x241220,null))['catch'](handleError(_0x241220,null));};exports['getAgents']=function(_0x3cfdf0,_0x172f64){var _0x5880eb={};var _0x2e08dd={};var _0xd437e1;var _0x2a0dff;return db[_0x92d9('0x4b')]['findOne']({'where':{'id':_0x3cfdf0['params']['id']}})['then'](handleEntityNotFound(_0x172f64,null))[_0x92d9('0x1c')](function(_0x375162){if(_0x375162){_0xd437e1=_0x375162;_0x2e08dd[_0x92d9('0x45')]=_['keys'](db[_0x92d9('0xc5')]['rawAttributes']);_0x2e08dd[_0x92d9('0x4f')]=_[_0x92d9('0x50')](_0x3cfdf0[_0x92d9('0x4f')]);_0x2e08dd[_0x92d9('0x51')]=_[_0x92d9('0x52')](_0x2e08dd['model'],_0x2e08dd[_0x92d9('0x4f')]);_0x5880eb[_0x92d9('0x53')]=_[_0x92d9('0x52')](_0x2e08dd[_0x92d9('0x45')],qs['fields'](_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x54')]));_0x5880eb[_0x92d9('0x53')]=_0x5880eb[_0x92d9('0x53')][_0x92d9('0x55')]?_0x5880eb[_0x92d9('0x53')]:_0x2e08dd[_0x92d9('0x45')];_0x5880eb['order']=qs[_0x92d9('0x56')](_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x56')]);_0x5880eb['where']=qs['filters'](_[_0x92d9('0x7d')](_0x3cfdf0[_0x92d9('0x4f')],_0x2e08dd[_0x92d9('0x51')]));if(_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x59')]){_0x5880eb['where']=_['merge'](_0x5880eb['where'],{'$or':_[_0x92d9('0x4e')](_0x5880eb[_0x92d9('0x53')],function(_0x25f0d0){var _0x297aee={};_0x297aee[_0x25f0d0]={'$like':'%'+_0x3cfdf0['query']['filter']+'%'};return _0x297aee;})});}_0x5880eb=_['merge']({},_0x5880eb,_0x3cfdf0['options']);return _0xd437e1[_0x92d9('0x12d')](_0x5880eb);}})[_0x92d9('0x1c')](function(_0x15b3d4){if(_0x15b3d4){_0x2a0dff=_0x15b3d4[_0x92d9('0x55')];if(!_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x76')](_0x92d9('0x77'))){_0x5880eb['limit']=qs[_0x92d9('0x2d')](_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x2d')]);_0x5880eb[_0x92d9('0x2b')]=qs[_0x92d9('0x2b')](_0x3cfdf0[_0x92d9('0x4f')][_0x92d9('0x2b')]);}return _0xd437e1[_0x92d9('0x12d')](_0x5880eb);}})[_0x92d9('0x1c')](function(_0x2fa851){if(_0x2fa851){return _0x2fa851?{'count':_0x2a0dff,'rows':_0x2fa851}:null;}})[_0x92d9('0x1c')](respondWithResult(_0x172f64,null))[_0x92d9('0x26')](handleError(_0x172f64,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index e6ecbdc..763c067 100644
--- a/server/api/chatWebsite/chatWebsite.events.js
+++ b/server/api/chatWebsite/chatWebsite.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ad3=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x29ec38,_0x179d68){var _0x4e1ba3=function(_0x4341b6){while(--_0x4341b6){_0x29ec38['push'](_0x29ec38['shift']());}};_0x4e1ba3(++_0x179d68);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x39cc8f,_0xb60cd8){_0x39cc8f=_0x39cc8f-0x0;var _0x15e616=_0x5ad3[_0x39cc8f];return _0x15e616;};'use strict';var EventEmitter=require(_0x35ad('0x0'));var ChatWebsite=require(_0x35ad('0x1'))['db'][_0x35ad('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x35ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x35ad('0x4'),'afterDestroy':_0x35ad('0x5')};function emitEvent(_0xc77352){return function(_0x69a0b3,_0x450f55,_0x1fed0d){ChatWebsiteEvents[_0x35ad('0x6')](_0xc77352+':'+_0x69a0b3['id'],_0x69a0b3);ChatWebsiteEvents[_0x35ad('0x6')](_0xc77352,_0x69a0b3);_0x1fed0d(null);};}for(var e in events){if(events[_0x35ad('0x7')](e)){var event=events[e];ChatWebsite[_0x35ad('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xedd9=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xedd9,0xfc));var _0x9edd=function(_0x115dfa,_0xa32a7b){_0x115dfa=_0x115dfa-0x0;var _0x358464=_0xedd9[_0x115dfa];return _0x358464;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x9edd('0x0'))['db'][_0x9edd('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9edd('0x2')](0x0);var events={'afterCreate':_0x9edd('0x3'),'afterUpdate':_0x9edd('0x4'),'afterDestroy':_0x9edd('0x5')};function emitEvent(_0x3e6d3a){return function(_0x36b53f,_0x5943b3,_0x33679f){ChatWebsiteEvents[_0x9edd('0x6')](_0x3e6d3a+':'+_0x36b53f['id'],_0x36b53f);ChatWebsiteEvents[_0x9edd('0x6')](_0x3e6d3a,_0x36b53f);_0x33679f(null);};}for(var e in events){if(events[_0x9edd('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9edd('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 549a9ec..965628e 100644
--- a/server/api/chatWebsite/chatWebsite.model.js
+++ b/server/api/chatWebsite/chatWebsite.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x44b2=['define','ChatWebsite','lodash','util','bluebird','path','../../config/environment','exports'];(function(_0x15e83d,_0x31f55d){var _0x35c8d3=function(_0x5cc854){while(--_0x5cc854){_0x15e83d['push'](_0x15e83d['shift']());}};_0x35c8d3(++_0x31f55d);}(_0x44b2,0x182));var _0x244b=function(_0x16c263,_0x2b7e51){_0x16c263=_0x16c263-0x0;var _0x4f1434=_0x44b2[_0x16c263];return _0x4f1434;};'use strict';var _=require(_0x244b('0x0'));var util=require(_0x244b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x244b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x244b('0x3'));var rimraf=require('rimraf');var config=require(_0x244b('0x4'));var attributes=require('./chatWebsite.attributes');module[_0x244b('0x5')]=function(_0x541c2f,_0x2ec1a4){return _0x541c2f[_0x244b('0x6')](_0x244b('0x7'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef49=['api','bluebird','request-promise','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x3806e6,_0x2f55d1){var _0x43aea8=function(_0x3c9928){while(--_0x3c9928){_0x3806e6['push'](_0x3806e6['shift']());}};_0x43aea8(++_0x2f55d1);}(_0xef49,0x152));var _0x9ef4=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xef49[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x9ef4('0x0'));var util=require(_0x9ef4('0x1'));var logger=require(_0x9ef4('0x2'))(_0x9ef4('0x3'));var moment=require('moment');var BPromise=require(_0x9ef4('0x4'));var rp=require(_0x9ef4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ef4('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ef4('0x7'));module['exports']=function(_0x6621c3,_0x34a36d){return _0x6621c3[_0x9ef4('0x8')](_0x9ef4('0x9'),attributes,{'tableName':_0x9ef4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index a48528e..08d8026 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2bb3=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x10a66c,_0x2ffcbc){var _0x5e51f9=function(_0x5396fe){while(--_0x5396fe){_0x10a66c['push'](_0x10a66c['shift']());}};_0x5e51f9(++_0x2ffcbc);}(_0x2bb3,0x1ba));var _0x32bb=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x2bb3[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0x32bb('0x0'));var util=require(_0x32bb('0x1'));var moment=require(_0x32bb('0x2'));var BPromise=require(_0x32bb('0x3'));var rs=require(_0x32bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32bb('0x5'))['db'];var utils=require(_0x32bb('0x6'));var logger=require(_0x32bb('0x7'))('rpc');var config=require(_0x32bb('0x8'));var jayson=require(_0x32bb('0x9'));var client=jayson[_0x32bb('0xa')]['http']({'port':0x232a});config[_0x32bb('0xb')]=_[_0x32bb('0xc')](config[_0x32bb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x32bb('0xd'))(new Redis(config['redis']));require(_0x32bb('0xe'))[_0x32bb('0xf')](socket);function respondWithRpcPromise(_0x3d4145,_0xe7df81,_0x1dc223){return new BPromise(function(_0x578d11,_0x454196){return client['request'](_0x3d4145,_0x1dc223)[_0x32bb('0x10')](function(_0x23bd0a){logger[_0x32bb('0x11')](_0x32bb('0x12'),_0xe7df81,_0x32bb('0x13'));logger['debug'](_0x32bb('0x14'),_0xe7df81,'request\x20sent',JSON[_0x32bb('0x15')](_0x23bd0a));if(_0x23bd0a[_0x32bb('0x16')]){if(_0x23bd0a[_0x32bb('0x16')]['code']===0x1f4){logger[_0x32bb('0x16')](_0x32bb('0x12'),_0xe7df81,_0x23bd0a[_0x32bb('0x16')][_0x32bb('0x17')]);return _0x454196(_0x23bd0a[_0x32bb('0x16')][_0x32bb('0x17')]);}logger[_0x32bb('0x16')](_0x32bb('0x12'),_0xe7df81,_0x23bd0a[_0x32bb('0x16')][_0x32bb('0x17')]);return _0x578d11(_0x23bd0a['error'][_0x32bb('0x17')]);}else{logger['info'](_0x32bb('0x12'),_0xe7df81,'request\x20sent');_0x578d11(_0x23bd0a[_0x32bb('0x18')]['message']);}})[_0x32bb('0x19')](function(_0x5d9bd2){logger[_0x32bb('0x16')](_0x32bb('0x12'),_0xe7df81,_0x5d9bd2);_0x454196(_0x5d9bd2);});});}
\ No newline at end of file
+var _0xe28e=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s'];(function(_0x5bb257,_0x2ac141){var _0x1c3de2=function(_0x45882d){while(--_0x45882d){_0x5bb257['push'](_0x5bb257['shift']());}};_0x1c3de2(++_0x2ac141);}(_0xe28e,0xcc));var _0xee28=function(_0x440547,_0x1c21ed){_0x440547=_0x440547-0x0;var _0x2f0d05=_0xe28e[_0x440547];return _0x2f0d05;};'use strict';var _=require(_0xee28('0x0'));var util=require('util');var moment=require(_0xee28('0x1'));var BPromise=require(_0xee28('0x2'));var rs=require(_0xee28('0x3'));var fs=require('fs');var Redis=require(_0xee28('0x4'));var db=require(_0xee28('0x5'))['db'];var utils=require(_0xee28('0x6'));var logger=require(_0xee28('0x7'))(_0xee28('0x8'));var config=require(_0xee28('0x9'));var jayson=require(_0xee28('0xa'));var client=jayson['client'][_0xee28('0xb')]({'port':0x232a});config[_0xee28('0xc')]=_[_0xee28('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xee28('0xe'))(new Redis(config[_0xee28('0xc')]));require(_0xee28('0xf'))[_0xee28('0x10')](socket);function respondWithRpcPromise(_0x198939,_0x2d9337,_0x977c58){return new BPromise(function(_0xe388a5,_0x11f985){return client[_0xee28('0x11')](_0x198939,_0x977c58)[_0xee28('0x12')](function(_0x12b6ad){logger['info'](_0xee28('0x13'),_0x2d9337,_0xee28('0x14'));logger[_0xee28('0x15')](_0xee28('0x16'),_0x2d9337,_0xee28('0x14'),JSON[_0xee28('0x17')](_0x12b6ad));if(_0x12b6ad[_0xee28('0x18')]){if(_0x12b6ad[_0xee28('0x18')]['code']===0x1f4){logger['error'](_0xee28('0x13'),_0x2d9337,_0x12b6ad[_0xee28('0x18')]['message']);return _0x11f985(_0x12b6ad['error'][_0xee28('0x19')]);}logger[_0xee28('0x18')](_0xee28('0x13'),_0x2d9337,_0x12b6ad[_0xee28('0x18')][_0xee28('0x19')]);return _0xe388a5(_0x12b6ad['error'][_0xee28('0x19')]);}else{logger[_0xee28('0x1a')](_0xee28('0x13'),_0x2d9337,'request\x20sent');_0xe388a5(_0x12b6ad[_0xee28('0x1b')]['message']);}})['catch'](function(_0x5f2902){logger['error'](_0xee28('0x13'),_0x2d9337,_0x5f2902);_0x11f985(_0x5f2902);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 3833ecd..e6afd08 100644
--- a/server/api/chatWebsite/chatWebsite.socket.js
+++ b/server/api/chatWebsite/chatWebsite.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0383=['remove','update','emit','removeListener','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x6e6589,_0x2fb432){var _0x105522=function(_0x3da193){while(--_0x3da193){_0x6e6589['push'](_0x6e6589['shift']());}};_0x105522(++_0x2fb432);}(_0x0383,0xf6));var _0x3038=function(_0x12dcc2,_0x213ca4){_0x12dcc2=_0x12dcc2-0x0;var _0x337017=_0x0383[_0x12dcc2];return _0x337017;};'use strict';var ChatWebsiteEvents=require(_0x3038('0x0'));var events=[_0x3038('0x1'),_0x3038('0x2'),_0x3038('0x3')];function createListener(_0x457a33,_0x164031){return function(_0x2e390d){_0x164031[_0x3038('0x4')](_0x457a33,_0x2e390d);};}function removeListener(_0x27ca42,_0x44d702){return function(){ChatWebsiteEvents[_0x3038('0x5')](_0x27ca42,_0x44d702);};}exports['register']=function(_0x3fd684){for(var _0x15f9a2=0x0,_0x594738=events[_0x3038('0x6')];_0x15f9a2<_0x594738;_0x15f9a2++){var _0xd55ce3=events[_0x15f9a2];var _0x1f2987=createListener(_0x3038('0x7')+_0xd55ce3,_0x3fd684);ChatWebsiteEvents['on'](_0xd55ce3,_0x1f2987);}};
\ No newline at end of file
+var _0x3a12=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x3a12,0x125));var _0x23a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a12[_0x20a584];return _0x4b41a8;};'use strict';var ChatWebsiteEvents=require(_0x23a1('0x0'));var events=[_0x23a1('0x1'),_0x23a1('0x2'),_0x23a1('0x3')];function createListener(_0x3080bc,_0x1f99f9){return function(_0x545b7a){_0x1f99f9[_0x23a1('0x4')](_0x3080bc,_0x545b7a);};}function removeListener(_0xcdc00c,_0x2e059d){return function(){ChatWebsiteEvents[_0x23a1('0x5')](_0xcdc00c,_0x2e059d);};}exports[_0x23a1('0x6')]=function(_0x331c17){for(var _0x5bc7c9=0x0,_0x22f2fa=events[_0x23a1('0x7')];_0x5bc7c9<_0x22f2fa;_0x5bc7c9++){var _0x1b2a4a=events[_0x5bc7c9];var _0x198659=createListener(_0x23a1('0x8')+_0x1b2a4a,_0x331c17);ChatWebsiteEvents['on'](_0x1b2a4a,_0x198659);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 512d070..6e5505d 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf290=['replace','localhost','test','([\x5cw]+)','exports','escapeRegExp','URL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf290,0xde));var _0x0f29=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0xf290[_0x3c4a7c];return _0xf13d1e;};var escapeRegExp=require('../../../utils/misc')[_0x0f29('0x0')];var URL=require('url')[_0x0f29('0x1')];function testWildcardValidity(_0x4b16e4){let _0xb8a620=!![];try{new URL(_0x4b16e4[_0x0f29('0x2')]('*',_0x0f29('0x3')));}catch(_0x28b644){_0xb8a620=![];}return _0xb8a620&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x0f29('0x4')](_0x4b16e4);}function testWebsiteWithWildcard(_0x5984ba,_0x45d37d){let _0x4911fb;const _0x2d5350=escapeRegExp(_0x5984ba)[_0x0f29('0x2')]('\x5c*',_0x0f29('0x5'));try{new URL(_0x5984ba[_0x0f29('0x2')]('\x5c*',_0x0f29('0x3')));_0x4911fb=new RegExp(_0x2d5350)[_0x0f29('0x4')](_0x45d37d);}catch(_0x2be26e){_0x4911fb=![];}return _0x4911fb;}module[_0x0f29('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x5c4a=['url','localhost','test','replace','([\x5cw]+)','exports','escapeRegExp'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x498aaa,_0x5b4e79){_0x498aaa=_0x498aaa-0x0;var _0x4f226e=_0x5c4a[_0x498aaa];return _0x4f226e;};var escapeRegExp=require('../../../utils/misc')[_0xa5c4('0x0')];var URL=require(_0xa5c4('0x1'))['URL'];function testWildcardValidity(_0x1972e1){let _0x2ff2f2=!![];try{new URL(_0x1972e1['replace']('*',_0xa5c4('0x2')));}catch(_0x180239){_0x2ff2f2=![];}return _0x2ff2f2&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xa5c4('0x3')](_0x1972e1);}function testWebsiteWithWildcard(_0x3864c4,_0x747b24){let _0x49af82;const _0x2410cf=escapeRegExp(_0x3864c4)[_0xa5c4('0x4')]('\x5c*',_0xa5c4('0x5'));try{new URL(_0x3864c4[_0xa5c4('0x4')]('\x5c*',_0xa5c4('0x2')));_0x49af82=new RegExp(_0x2410cf)[_0xa5c4('0x3')](_0x747b24);}catch(_0x4cd657){_0x49af82=![];}return _0x49af82;}module[_0xa5c4('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index fc3922a..6fe1ae5 100644
--- a/server/api/chatWebsite/index.js
+++ b/server/api/chatWebsite/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8626=['originalname','single','file','addLogo','root','addAvatar','server/files/images/avatars/','now','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','any','addInteraction','addApplications','addProactiveActions','/:id/users','put','update','delete','/:id','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getAgents','create','post','addDisposition','diskStorage','join','server/files/images/logos/','format','%s-%s'];(function(_0x11a008,_0x5474ab){var _0x42aff0=function(_0x8495a8){while(--_0x8495a8){_0x11a008['push'](_0x11a008['shift']());}};_0x42aff0(++_0x5474ab);}(_0x8626,0x1be));var _0x6862=function(_0x406c8a,_0x14e83e){_0x406c8a=_0x406c8a-0x0;var _0x2ba7e6=_0x8626[_0x406c8a];return _0x2ba7e6;};'use strict';var multer=require(_0x6862('0x0'));var util=require(_0x6862('0x1'));var path=require(_0x6862('0x2'));var timeout=require(_0x6862('0x3'));var express=require(_0x6862('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6862('0x5'));var interaction=require(_0x6862('0x6'));var config=require(_0x6862('0x7'));var controller=require(_0x6862('0x8'));router['get']('/',auth[_0x6862('0x9')](),controller[_0x6862('0xa')]);router[_0x6862('0xb')]('/describe',auth[_0x6862('0x9')](),controller[_0x6862('0xc')]);router[_0x6862('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6862('0xb')](_0x6862('0xd'),auth[_0x6862('0x9')](),controller[_0x6862('0xe')]);router[_0x6862('0xb')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6862('0xf')]);router[_0x6862('0xb')](_0x6862('0x10'),controller[_0x6862('0x11')]);router[_0x6862('0xb')](_0x6862('0x12'),controller[_0x6862('0x13')]);router[_0x6862('0xb')](_0x6862('0x14'),controller[_0x6862('0x15')]);router[_0x6862('0xb')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x6862('0xb')](_0x6862('0x16'),auth[_0x6862('0x9')](),controller['getInteractions']);router[_0x6862('0xb')]('/:id/snippet',controller[_0x6862('0x17')]);router[_0x6862('0xb')](_0x6862('0x18'),auth[_0x6862('0x9')](),controller['getApplications']);router[_0x6862('0xb')](_0x6862('0x19'),auth['isAuthenticated'](),controller[_0x6862('0x1a')]);router[_0x6862('0xb')](_0x6862('0x1b'),controller['getFields']);router[_0x6862('0xb')]('/:id/offline_messages',auth[_0x6862('0x9')](),controller['getOfflineMessages']);router[_0x6862('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0x6862('0x1c')]);router['post']('/',auth[_0x6862('0x9')](),controller[_0x6862('0x1d')]);router[_0x6862('0x1e')](_0x6862('0xd'),auth[_0x6862('0x9')](),controller[_0x6862('0x1f')]);router[_0x6862('0x1e')]('/:id/canned_answers',auth[_0x6862('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x6862('0x20')]({'destination':function(_0x31f4c2,_0x5239e0,_0xb1f6c3){_0xb1f6c3(null,path[_0x6862('0x21')](config['root'],_0x6862('0x22')));},'filename':function(_0xdc856a,_0x3252b7,_0x3ca963){_0x3ca963(null,util[_0x6862('0x23')](_0x6862('0x24'),Date['now'](),_0x3252b7[_0x6862('0x25')]));}})});router[_0x6862('0x1e')]('/:id/logo',upload[_0x6862('0x26')](_0x6862('0x27')),controller[_0x6862('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c8e0f,_0x373b60,_0xf4eec9){_0xf4eec9(null,path['join'](config[_0x6862('0x29')],'server/files/images/avatars/'));},'filename':function(_0x506f8f,_0x137645,_0x33cf0a){_0x33cf0a(null,util[_0x6862('0x23')]('%s-%s',Date['now'](),_0x137645[_0x6862('0x25')]));}})});router[_0x6862('0x1e')](_0x6862('0x12'),upload[_0x6862('0x26')](_0x6862('0x27')),controller[_0x6862('0x2a')]);var upload=multer({'storage':multer[_0x6862('0x20')]({'destination':function(_0x43153c,_0x23f962,_0x2ef709){_0x2ef709(null,path['join'](config['root'],_0x6862('0x2b')));},'filename':function(_0x4fabcf,_0x1ee7d1,_0x2498e8){_0x2498e8(null,util[_0x6862('0x23')](_0x6862('0x24'),Date[_0x6862('0x2c')](),_0x1ee7d1[_0x6862('0x25')]));}})});router['post']('/:id/customer_avatar',upload[_0x6862('0x26')](_0x6862('0x27')),controller[_0x6862('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x203d29,_0x21b8ab,_0x53f885){_0x53f885(null,path[_0x6862('0x21')](config[_0x6862('0x29')],_0x6862('0x2b')));},'filename':function(_0x90fab7,_0x81be14,_0x22f5b1){_0x22f5b1(null,util[_0x6862('0x23')](_0x6862('0x24'),Date['now'](),_0x81be14[_0x6862('0x25')]));}})});router[_0x6862('0x1e')](_0x6862('0x2e'),upload[_0x6862('0x26')](_0x6862('0x27')),controller[_0x6862('0x2f')]);router[_0x6862('0x1e')](_0x6862('0x30'),controller[_0x6862('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0x6862('0x20')]({'destination':function(_0x28d3dc,_0x2b8af5,_0xcccac7){const _0x13e7b5=path[_0x6862('0x21')](config[_0x6862('0x29')],_0x6862('0x32'),_0x6862('0x33'),_0x6862('0x34'));fs_extra[_0x6862('0x35')](_0x13e7b5,function(){_0xcccac7(null,_0x13e7b5);});},'filename':function(_0x9911f0,_0x86f412,_0x55ecbc){const _0x5cfc3b=_0x86f412['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x204c95=path['extname'](_0x5cfc3b);const _0x44352f=Date[_0x6862('0x2c')]()+'-'+_0x5cfc3b[_0x6862('0x36')](_0x204c95,'')+_0x204c95;_0x55ecbc(null,_0x44352f);}})});router[_0x6862('0x1e')]('/:id/offline',offlineUploadMulter[_0x6862('0x37')](),controller['offline']);router[_0x6862('0x1e')]('/:id/interactions',auth[_0x6862('0x9')](),controller[_0x6862('0x38')]);router[_0x6862('0x1e')](_0x6862('0x18'),auth[_0x6862('0x9')](),controller[_0x6862('0x39')]);router['post'](_0x6862('0x19'),auth[_0x6862('0x9')](),controller[_0x6862('0x3a')]);router[_0x6862('0x1e')](_0x6862('0x3b'),auth[_0x6862('0x9')](),controller['addAgents']);router[_0x6862('0x3c')]('/:id',auth[_0x6862('0x9')](),controller[_0x6862('0x3d')]);router[_0x6862('0x3e')](_0x6862('0x3f'),auth['isAuthenticated'](),controller[_0x6862('0x40')]);router[_0x6862('0x3e')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x6862('0x3e')](_0x6862('0x41'),auth['isAuthenticated'](),controller[_0x6862('0x42')]);router[_0x6862('0x3e')](_0x6862('0x3b'),auth[_0x6862('0x9')](),controller[_0x6862('0x43')]);module[_0x6862('0x44')]=router;
\ No newline at end of file
+var _0xd239=['file','addLogo','server/files/images/avatars/','now','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','join','server/files','attachments','offline-chat','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','single'];(function(_0x178c72,_0x8c3f70){var _0x45f63f=function(_0x32be15){while(--_0x32be15){_0x178c72['push'](_0x178c72['shift']());}};_0x45f63f(++_0x8c3f70);}(_0xd239,0xb8));var _0x9d23=function(_0x8c7ccf,_0xe3f870){_0x8c7ccf=_0x8c7ccf-0x0;var _0x54f922=_0xd239[_0x8c7ccf];return _0x54f922;};'use strict';var multer=require('multer');var util=require(_0x9d23('0x0'));var path=require(_0x9d23('0x1'));var timeout=require(_0x9d23('0x2'));var express=require(_0x9d23('0x3'));var router=express[_0x9d23('0x4')]();var fs_extra=require(_0x9d23('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9d23('0x6'));var config=require(_0x9d23('0x7'));var controller=require(_0x9d23('0x8'));router[_0x9d23('0x9')]('/',auth[_0x9d23('0xa')](),controller[_0x9d23('0xb')]);router[_0x9d23('0x9')]('/describe',auth[_0x9d23('0xa')](),controller[_0x9d23('0xc')]);router['get']('/:id',auth[_0x9d23('0xa')](),controller[_0x9d23('0xd')]);router[_0x9d23('0x9')](_0x9d23('0xe'),auth[_0x9d23('0xa')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9d23('0xf')]);router['get'](_0x9d23('0x10'),controller[_0x9d23('0x11')]);router[_0x9d23('0x9')](_0x9d23('0x12'),controller[_0x9d23('0x13')]);router[_0x9d23('0x9')](_0x9d23('0x14'),controller[_0x9d23('0x15')]);router['get'](_0x9d23('0x16'),controller[_0x9d23('0x17')]);router[_0x9d23('0x9')]('/:id/interactions',auth[_0x9d23('0xa')](),controller[_0x9d23('0x18')]);router[_0x9d23('0x9')](_0x9d23('0x19'),controller[_0x9d23('0x1a')]);router['get'](_0x9d23('0x1b'),auth[_0x9d23('0xa')](),controller['getApplications']);router[_0x9d23('0x9')]('/:id/proactive_actions',auth[_0x9d23('0xa')](),controller['getProactiveActions']);router[_0x9d23('0x9')]('/:id/fields',controller[_0x9d23('0x1c')]);router[_0x9d23('0x9')](_0x9d23('0x1d'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x1e')]);router[_0x9d23('0x9')](_0x9d23('0x1f'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x20')]);router[_0x9d23('0x21')]('/',auth[_0x9d23('0xa')](),controller[_0x9d23('0x22')]);router[_0x9d23('0x21')](_0x9d23('0xe'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x23')]);router[_0x9d23('0x21')]('/:id/canned_answers',auth[_0x9d23('0xa')](),controller[_0x9d23('0x24')]);var upload=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x5a06ba,_0x4e04d4,_0x5d8dbf){_0x5d8dbf(null,path['join'](config[_0x9d23('0x26')],_0x9d23('0x27')));},'filename':function(_0x3562c0,_0x3a814a,_0x302b62){_0x302b62(null,util[_0x9d23('0x28')](_0x9d23('0x29'),Date['now'](),_0x3a814a[_0x9d23('0x2a')]));}})});router[_0x9d23('0x21')](_0x9d23('0x10'),upload[_0x9d23('0x2b')](_0x9d23('0x2c')),controller[_0x9d23('0x2d')]);var upload=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x43066a,_0x381191,_0x4a4f56){_0x4a4f56(null,path['join'](config[_0x9d23('0x26')],_0x9d23('0x2e')));},'filename':function(_0x33abf0,_0x1a9a62,_0x6a8d76){_0x6a8d76(null,util[_0x9d23('0x28')](_0x9d23('0x29'),Date[_0x9d23('0x2f')](),_0x1a9a62[_0x9d23('0x2a')]));}})});router[_0x9d23('0x21')](_0x9d23('0x12'),upload[_0x9d23('0x2b')](_0x9d23('0x2c')),controller[_0x9d23('0x30')]);var upload=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x2aabd5,_0x566781,_0x2471d9){_0x2471d9(null,path['join'](config[_0x9d23('0x26')],_0x9d23('0x2e')));},'filename':function(_0x5e8efe,_0x2df4f8,_0x437d95){_0x437d95(null,util[_0x9d23('0x28')](_0x9d23('0x29'),Date[_0x9d23('0x2f')](),_0x2df4f8['originalname']));}})});router[_0x9d23('0x21')](_0x9d23('0x14'),upload[_0x9d23('0x2b')]('file'),controller[_0x9d23('0x31')]);var upload=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x4192e4,_0x5d602c,_0x37298f){_0x37298f(null,path['join'](config[_0x9d23('0x26')],_0x9d23('0x2e')));},'filename':function(_0x4b2c3b,_0x316b59,_0x3238e9){_0x3238e9(null,util[_0x9d23('0x28')]('%s-%s',Date['now'](),_0x316b59['originalname']));}})});router[_0x9d23('0x21')](_0x9d23('0x16'),upload[_0x9d23('0x2b')](_0x9d23('0x2c')),controller[_0x9d23('0x32')]);router[_0x9d23('0x21')](_0x9d23('0x33'),controller[_0x9d23('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x9d23('0x25')]({'destination':function(_0x1301ff,_0x406d73,_0x401284){const _0x26d103=path[_0x9d23('0x35')](config[_0x9d23('0x26')],_0x9d23('0x36'),_0x9d23('0x37'),_0x9d23('0x38'));fs_extra['ensureDir'](_0x26d103,function(){_0x401284(null,_0x26d103);});},'filename':function(_0x9d6bd,_0x555c00,_0x3ddb7a){const _0x26e086=_0x555c00[_0x9d23('0x2a')][_0x9d23('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x31308f=path['extname'](_0x26e086);const _0x3b40a8=Date[_0x9d23('0x2f')]()+'-'+_0x26e086[_0x9d23('0x39')](_0x31308f,'')+_0x31308f;_0x3ddb7a(null,_0x3b40a8);}})});router[_0x9d23('0x21')](_0x9d23('0x3a'),offlineUploadMulter[_0x9d23('0x3b')](),controller[_0x9d23('0x3c')]);router[_0x9d23('0x21')](_0x9d23('0x3d'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x3e')]);router[_0x9d23('0x21')]('/:id/applications',auth[_0x9d23('0xa')](),controller[_0x9d23('0x3f')]);router[_0x9d23('0x21')](_0x9d23('0x40'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x41')]);router[_0x9d23('0x21')](_0x9d23('0x1f'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x42')]);router[_0x9d23('0x43')](_0x9d23('0x44'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x45')]);router[_0x9d23('0x46')](_0x9d23('0x44'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x47')]);router['delete'](_0x9d23('0xe'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x48')]);router['delete'](_0x9d23('0x49'),auth[_0x9d23('0xa')](),controller[_0x9d23('0x4a')]);router[_0x9d23('0x46')](_0x9d23('0x1f'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x9d23('0x4b')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index a04d3ff..458eecc 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe90d=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger'];(function(_0x53c2ec,_0x56b6f8){var _0xbd4cd0=function(_0x3640d1){while(--_0x3640d1){_0x53c2ec['push'](_0x53c2ec['shift']());}};_0xbd4cd0(++_0x56b6f8);}(_0xe90d,0x10e));var _0xde90=function(_0x1063d4,_0x483c4d){_0x1063d4=_0x1063d4-0x0;var _0x408256=_0xe90d[_0x1063d4];return _0x408256;};var beaverLogger=require(_0xde90('0x0'));var express=require(_0xde90('0x1'));var auth=require(_0xde90('0x2'));var config=require(_0xde90('0x3'));var router=express[_0xde90('0x4')]();var isProduction=config[_0xde90('0x5')]===_0xde90('0x6')||![];function clientSideLogs(_0x2b7d29,_0x232229,_0x2b4d70){var _0x51e360=_0x2b7d29[_0xde90('0x7')][_0xde90('0x8')](_0xde90('0x9'));if(!_0x51e360){throw new Error(_0xde90('0xa'));}return beaverLogger[_0xde90('0xb')]({'uri':_0xde90('0xc'),'logger':_0x51e360,'enableCors':!isProduction})(_0x2b7d29,_0x232229,_0x2b4d70);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xde90('0xd')]=router;
\ No newline at end of file
+var _0xb35b=['Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','../components/auth/service','../config/environment'];(function(_0x4057f9,_0x17c5b5){var _0x5552b7=function(_0xeb792f){while(--_0xeb792f){_0x4057f9['push'](_0x4057f9['shift']());}};_0x5552b7(++_0x17c5b5);}(_0xb35b,0x124));var _0xbb35=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xb35b[_0x397cfb];return _0x15fed9;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0xbb35('0x0'));var config=require(_0xbb35('0x1'));var router=express[_0xbb35('0x2')]();var isProduction=config[_0xbb35('0x3')]===_0xbb35('0x4')||![];function clientSideLogs(_0x3fcf5d,_0x6863ac,_0x1b79cc){var _0x213373=_0x3fcf5d[_0xbb35('0x5')][_0xbb35('0x6')](_0xbb35('0x7'));if(!_0x213373){throw new Error(_0xbb35('0x8'));}return beaverLogger[_0xbb35('0x9')]({'uri':_0xbb35('0xa'),'logger':_0x213373,'enableCors':!isProduction})(_0x3fcf5d,_0x6863ac,_0x1b79cc);}router[_0xbb35('0xb')](auth[_0xbb35('0xc')](),clientSideLogs);module[_0xbb35('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e3048b7..a2abaa3 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3843=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x20d3a2,_0x267ce1){var _0x259ff=function(_0x6645c){while(--_0x6645c){_0x20d3a2['push'](_0x20d3a2['shift']());}};_0x259ff(++_0x267ce1);}(_0x3843,0x1a5));var _0x3384=function(_0x424e46,_0x45de83){_0x424e46=_0x424e46-0x0;var _0x17b7f1=_0x3843[_0x424e46];return _0x17b7f1;};'use strict';var Sequelize=require(_0x3384('0x0'));module[_0x3384('0x1')]={'name':{'type':Sequelize[_0x3384('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3384('0x3')](_0x3384('0x4'),_0x3384('0x5'),_0x3384('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3384('0x3')](_0x3384('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x3384('0x2')],'comment':_0x3384('0x8')},'data2':{'type':Sequelize[_0x3384('0x2')],'comment':_0x3384('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0x3384('0xa')},'data4':{'type':Sequelize[_0x3384('0x2')],'comment':_0x3384('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x3384('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x3384('0xd')}};
\ No newline at end of file
+var _0x3f8f=['STRING','ENUM','AmazonAWS','Google','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x3f8f,0x1c5));var _0xf3f8=function(_0x1cd6f6,_0x4bfec7){_0x1cd6f6=_0x1cd6f6-0x0;var _0x1a93e5=_0x3f8f[_0x1cd6f6];return _0x1a93e5;};'use strict';var Sequelize=require(_0xf3f8('0x0'));module[_0xf3f8('0x1')]={'name':{'type':Sequelize[_0xf3f8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf3f8('0x3')](_0xf3f8('0x4'),_0xf3f8('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf3f8('0x3')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0xf3f8('0x2')],'comment':_0xf3f8('0x6')},'data2':{'type':Sequelize[_0xf3f8('0x2')],'comment':_0xf3f8('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0xf3f8('0x8')},'data4':{'type':Sequelize[_0xf3f8('0x2')],'comment':_0xf3f8('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0xf3f8('0xa')},'data6':{'type':Sequelize[_0xf3f8('0xb')],'comment':_0xf3f8('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index b83beb6..1e21ea3 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0135=['isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','stringify','ioredis','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','error','stack','name','send','padEnd','map','CloudProvider','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','then','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','length','options','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii'];(function(_0x1556da,_0x3d9ba9){var _0x4ba1ef=function(_0x2ed733){while(--_0x2ed733){_0x1556da['push'](_0x1556da['shift']());}};_0x4ba1ef(++_0x3d9ba9);}(_0x0135,0x71));var _0x5013=function(_0x556720,_0x43fcdc){_0x556720=_0x556720-0x0;var _0x25e3aa=_0x0135[_0x556720];return _0x25e3aa;};'use strict';var _=require('lodash');var Redis=require(_0x5013('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x5013('0x1'));var config=require(_0x5013('0x2'));var logger=require('../../config/logger')('api');var db=require(_0x5013('0x3'))['db'];var oauth=require(_0x5013('0x4'));config[_0x5013('0x5')]=_[_0x5013('0x6')](config[_0x5013('0x5')],{'host':_0x5013('0x7'),'port':0x18eb});var socket=require(_0x5013('0x8'))(new Redis(config[_0x5013('0x5')]));var redis=new Redis(config[_0x5013('0x5')]);function respondWithStatusCode(_0x32e58d,_0x8c0092){_0x8c0092=_0x8c0092||0xcc;return function(_0x32923b){if(_0x32923b){return _0x32e58d[_0x5013('0x9')](_0x8c0092);}return _0x32e58d[_0x5013('0xa')](_0x8c0092)[_0x5013('0xb')]();};}function respondWithResult(_0xfcf6cf,_0x32f617){_0x32f617=_0x32f617||0xc8;return function(_0x1a6469){if(_0x1a6469){return _0xfcf6cf[_0x5013('0xa')](_0x32f617)[_0x5013('0xc')](_0x1a6469);}};}function respondWithFilteredResult(_0x1bc574,_0x5534f4){return function(_0x3d7326){if(_0x3d7326){var _0x529430=typeof _0x5534f4['offset']===_0x5013('0xd')&&typeof _0x5534f4[_0x5013('0xe')]==='undefined';var _0x41d4bb=_0x3d7326[_0x5013('0xf')];var _0x31769d=_0x529430?0x0:_0x5534f4['offset'];var _0x8dc781=_0x529430?_0x3d7326['count']:_0x5534f4[_0x5013('0x10')]+_0x5534f4['limit'];var _0x2b3af6;if(_0x8dc781>=_0x41d4bb){_0x8dc781=_0x41d4bb;_0x2b3af6=0xc8;}else{_0x2b3af6=0xce;}_0x1bc574[_0x5013('0xa')](_0x2b3af6);return _0x1bc574['set'](_0x5013('0x11'),_0x31769d+'-'+_0x8dc781+'/'+_0x41d4bb)[_0x5013('0xc')](_0x3d7326);}return null;};}function saveUpdates(_0x122a18){return function(_0x4590c0){if(_0x4590c0){return _0x4590c0[_0x5013('0x12')](_0x122a18)['then'](function(_0xfccfd4){return _0xfccfd4;});}return null;};}function removeEntity(_0x1d6f18){return function(_0x5eb037){if(_0x5eb037){return _0x5eb037['destroy']()['then'](function(){_0x1d6f18[_0x5013('0xa')](0xcc)[_0x5013('0xb')]();});}};}function handleEntityNotFound(_0x558c74){return function(_0x4c04da){if(!_0x4c04da){_0x558c74['sendStatus'](0x194);}return _0x4c04da;};}function handleError(_0x1c6425,_0x2d4e66){_0x2d4e66=_0x2d4e66||0x1f4;return function(_0x5a17ca){logger[_0x5013('0x13')](_0x5a17ca[_0x5013('0x14')]);if(_0x5a17ca[_0x5013('0x15')]){delete _0x5a17ca[_0x5013('0x15')];}_0x1c6425['status'](_0x2d4e66)[_0x5013('0x16')](_0x5a17ca);};}function maskClientSecret(_0x3d74bd){return _[_0x5013('0x17')](_0x3d74bd['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x451543,_0x339beb){var _0x5a7bc8={},_0x231a07={},_0x614f83={'count':0x0,'rows':[]};var _0x49ec8d=_[_0x5013('0x18')](db[_0x5013('0x19')][_0x5013('0x1a')],function(_0x17d86e){return{'name':_0x17d86e[_0x5013('0x1b')],'type':_0x17d86e['type'][_0x5013('0x1c')]};});_0x231a07['model']=_['map'](_0x49ec8d,_0x5013('0x15'));_0x231a07['query']=_[_0x5013('0x1d')](_0x451543[_0x5013('0x1e')]);_0x231a07[_0x5013('0x1f')]=_[_0x5013('0x20')](_0x231a07[_0x5013('0x21')],_0x231a07[_0x5013('0x1e')]);_0x5a7bc8[_0x5013('0x22')]=_[_0x5013('0x20')](_0x231a07['model'],qs[_0x5013('0x23')](_0x451543[_0x5013('0x1e')][_0x5013('0x23')]));_0x5a7bc8[_0x5013('0x22')]=_0x5a7bc8[_0x5013('0x22')]['length']?_0x5a7bc8[_0x5013('0x22')]:_0x231a07['model'];if(!_0x451543[_0x5013('0x1e')][_0x5013('0x24')](_0x5013('0x25'))){_0x5a7bc8[_0x5013('0xe')]=qs[_0x5013('0xe')](_0x451543['query'][_0x5013('0xe')]);_0x5a7bc8[_0x5013('0x10')]=qs[_0x5013('0x10')](_0x451543['query'][_0x5013('0x10')]);}_0x5a7bc8[_0x5013('0x26')]=qs['sort'](_0x451543[_0x5013('0x1e')][_0x5013('0x27')]);_0x5a7bc8[_0x5013('0x28')]=qs[_0x5013('0x1f')](_[_0x5013('0x29')](_0x451543[_0x5013('0x1e')],_0x231a07[_0x5013('0x1f')]),_0x49ec8d);if(_0x451543['query'][_0x5013('0x2a')]){_0x5a7bc8[_0x5013('0x28')]=_[_0x5013('0x2b')](_0x5a7bc8['where'],{'$or':_[_0x5013('0x18')](_0x49ec8d,function(_0x262e46){if(_0x262e46[_0x5013('0x2c')]!=='VIRTUAL'){var _0x154bcd={};_0x154bcd[_0x262e46['name']]={'$like':'%'+_0x451543[_0x5013('0x1e')][_0x5013('0x2a')]+'%'};return _0x154bcd;}})});}_0x5a7bc8=_['merge']({},_0x5a7bc8,_0x451543['options']);var _0x481c8a={'where':_0x5a7bc8['where']};return db[_0x5013('0x19')]['count'](_0x481c8a)[_0x5013('0x2d')](function(_0x2786ba){_0x614f83[_0x5013('0xf')]=_0x2786ba;if(_0x451543['query'][_0x5013('0x2e')]){_0x5a7bc8[_0x5013('0x2f')]=[{'all':!![]}];}return db[_0x5013('0x19')][_0x5013('0x30')](_0x5a7bc8);})[_0x5013('0x2d')](function(_0xbd05e6){_0x614f83[_0x5013('0x31')]=_[_0x5013('0x18')](_0xbd05e6,function(_0x5108a8){if(_0x5108a8['service']===_0x5013('0x32')){var _0x15b537=encryptor[_0x5013('0x33')](_0x5108a8[_0x5013('0x34')]);_0x5108a8[_0x5013('0x34')]=maskClientSecret(_0x15b537);}return _0x5108a8;});return _0x614f83;})[_0x5013('0x2d')](respondWithFilteredResult(_0x339beb,_0x5a7bc8))[_0x5013('0x35')](handleError(_0x339beb,null));};exports[_0x5013('0x36')]=function(_0x507329,_0x50a2b6){var _0x4e85fd={'raw':!![],'where':{'id':_0x507329[_0x5013('0x37')]['id']}},_0x56ef52={};_0x56ef52[_0x5013('0x21')]=_['keys'](db['CloudProvider']['rawAttributes']);_0x56ef52[_0x5013('0x1e')]=_[_0x5013('0x1d')](_0x507329[_0x5013('0x1e')]);_0x56ef52['filters']=_[_0x5013('0x20')](_0x56ef52[_0x5013('0x21')],_0x56ef52[_0x5013('0x1e')]);_0x4e85fd['attributes']=_[_0x5013('0x20')](_0x56ef52[_0x5013('0x21')],qs['fields'](_0x507329[_0x5013('0x1e')][_0x5013('0x23')]));_0x4e85fd[_0x5013('0x22')]=_0x4e85fd[_0x5013('0x22')][_0x5013('0x38')]?_0x4e85fd[_0x5013('0x22')]:_0x56ef52[_0x5013('0x21')];if(_0x507329['query'][_0x5013('0x2e')]){_0x4e85fd[_0x5013('0x2f')]=[{'all':!![]}];}_0x4e85fd=_[_0x5013('0x2b')]({},_0x4e85fd,_0x507329[_0x5013('0x39')]);return db[_0x5013('0x19')][_0x5013('0x3a')](_0x4e85fd)['then'](handleEntityNotFound(_0x50a2b6,null))['then'](function(_0x4c0927){if(_0x4c0927[_0x5013('0x3b')]===_0x5013('0x32')){var _0x36a410=encryptor['decryptString'](_0x4c0927[_0x5013('0x34')]);_0x4c0927[_0x5013('0x34')]=maskClientSecret(_0x36a410);}return _0x4c0927;})[_0x5013('0x2d')](respondWithResult(_0x50a2b6,null))[_0x5013('0x35')](handleError(_0x50a2b6,null));};exports[_0x5013('0x3c')]=function(_0x4694e3,_0xb419fa){if(!_0x4694e3[_0x5013('0x3d')][_0x5013('0x15')])throw new Error(_0x5013('0x3e'));if(!_0x4694e3[_0x5013('0x3d')][_0x5013('0x3b')])throw new Error(_0x5013('0x3f'));var _0x3e47b0=db[_0x5013('0x19')]['rawAttributes'][_0x5013('0x3b')][_0x5013('0x40')];if(!_0x3e47b0[_0x5013('0x41')](_0x4694e3[_0x5013('0x3d')]['service']))throw new Error(_0x5013('0x42')+_0x3e47b0[_0x5013('0x43')](',\x20'));if(_0x4694e3[_0x5013('0x3d')]['service']===_0x5013('0x32')&&_0x4694e3[_0x5013('0x3d')][_0x5013('0x34')]){_0x4694e3[_0x5013('0x3d')][_0x5013('0x34')]=encryptor[_0x5013('0x44')](_0x4694e3[_0x5013('0x3d')][_0x5013('0x34')]);}return db[_0x5013('0x19')][_0x5013('0x3c')](_0x4694e3['body'],{})['then'](respondWithResult(_0xb419fa,0xc9))[_0x5013('0x35')](handleError(_0xb419fa,null));};exports[_0x5013('0x12')]=function(_0x470eb8,_0x38e3a7){if(_0x470eb8[_0x5013('0x3d')]['id']){delete _0x470eb8[_0x5013('0x3d')]['id'];}return db['CloudProvider'][_0x5013('0x3a')]({'where':{'id':_0x470eb8[_0x5013('0x37')]['id']}})[_0x5013('0x2d')](handleEntityNotFound(_0x38e3a7,null))['then'](function(_0x59de17){if(_0x59de17['service']==='MicrosoftAzure'&&_0x470eb8[_0x5013('0x3d')][_0x5013('0x34')]){_0x470eb8[_0x5013('0x3d')][_0x5013('0x34')]=encryptor[_0x5013('0x44')](_0x470eb8[_0x5013('0x3d')]['data3']);}return _0x59de17;})[_0x5013('0x2d')](saveUpdates(_0x470eb8[_0x5013('0x3d')],null))[_0x5013('0x2d')](respondWithResult(_0x38e3a7,null))['catch'](handleError(_0x38e3a7,null));};exports['destroy']=function(_0x3f2d53,_0x328625){return db['CloudProvider'][_0x5013('0x3a')]({'where':{'id':_0x3f2d53['params']['id']}})['then'](handleEntityNotFound(_0x328625,null))[_0x5013('0x2d')](removeEntity(_0x328625,null))[_0x5013('0x35')](handleError(_0x328625,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4da103,_0x5cdfbd){return db[_0x5013('0x19')][_0x5013('0x45')]({'where':{'id':_0x4da103[_0x5013('0x37')]['id']},'raw':!![]})[_0x5013('0x2d')](function(_0x56786d){if(!_0x56786d)return _0x5cdfbd[_0x5013('0x9')](0x194);return{'url':oauth[_0x5013('0x46')](_0x56786d,_0x4da103[_0x5013('0x47')]['id'])};})[_0x5013('0x2d')](respondWithResult(_0x5cdfbd,null))[_0x5013('0x35')](handleError(_0x5cdfbd,null));};exports[_0x5013('0x48')]=function(_0x3b8fa1,_0x2e096a){var _0x417ba7=_0x3b8fa1[_0x5013('0x3d')];var _0x4750a2;var _0x3a5ec4;if(_0x417ba7['error'])throw _0x417ba7;redis[_0x5013('0x49')](_0x417ba7['state'])[_0x5013('0x2d')](function(_0x29d87a){if(!_0x29d87a)throw new Error(_0x5013('0x4a'));_0x4750a2=JSON[_0x5013('0x4b')](_0x29d87a);var _0x4be7e8=Buffer[_0x5013('0x4c')](_0x417ba7[_0x5013('0x4d')],_0x5013('0x4e'))[_0x5013('0x4f')](_0x5013('0x50'));_0x3a5ec4=JSON['parse'](_0x4be7e8);if(!oauth[_0x5013('0x51')](_0x417ba7[_0x5013('0x52')],_0x4750a2[_0x5013('0x53')]))throw new Error(_0x5013('0x54'));redis[_0x5013('0x55')](_0x417ba7[_0x5013('0x4d')]);return oauth[_0x5013('0x56')](_0x417ba7[_0x5013('0x57')],_0x4750a2);})[_0x5013('0x2d')](function(_0x1c22dc){_0x4750a2['data5']=_0x1c22dc[_0x5013('0x58')];_0x4750a2[_0x5013('0x59')]=_0x1c22dc[_0x5013('0x5a')];return db[_0x5013('0x19')]['update']({'data5':_0x4750a2[_0x5013('0x5b')],'data6':_0x4750a2[_0x5013('0x59')]},{'where':{'id':_0x4750a2['id']}});})[_0x5013('0x2d')](function(){oauth[_0x5013('0x5c')](_0x4750a2);socket[_0x5013('0x5d')](_0x5013('0x5e'),{'id':_0x3a5ec4['id']});return;})[_0x5013('0x2d')](respondWithStatusCode(_0x2e096a,null))[_0x5013('0x35')](function(_0x3af067){if(_0x3a5ec4){socket[_0x5013('0x5d')](_0x5013('0x5f'),{'id':_0x3a5ec4['id']});}if(!_0x4750a2){logger[_0x5013('0x13')]('Invalid\x20authentication\x20state\x20parameter',_0x3af067);return _0x2e096a[_0x5013('0xa')](0x1f4)[_0x5013('0x16')](_0x3af067['message']);}logger[_0x5013('0x13')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4750a2['id'],JSON[_0x5013('0x60')](_0x3af067));});};
\ No newline at end of file
+var _0x7539=['message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','Content-Range','update','destroy','then','sendStatus','name','send','padEnd','slice','map','CloudProvider','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','rawAttributes','decryptString','body','Name\x20parameter\x20not\x20specified','values','includes','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x7539,0xc3));var _0x9753=function(_0x517d9e,_0x214a0a){_0x517d9e=_0x517d9e-0x0;var _0x2da8ac=_0x7539[_0x517d9e];return _0x2da8ac;};'use strict';var _=require(_0x9753('0x0'));var Redis=require(_0x9753('0x1'));var qs=require(_0x9753('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x9753('0x3'));var logger=require(_0x9753('0x4'))(_0x9753('0x5'));var db=require(_0x9753('0x6'))['db'];var oauth=require(_0x9753('0x7'));config[_0x9753('0x8')]=_[_0x9753('0x9')](config['redis'],{'host':_0x9753('0xa'),'port':0x18eb});var socket=require(_0x9753('0xb'))(new Redis(config[_0x9753('0x8')]));var redis=new Redis(config[_0x9753('0x8')]);function respondWithStatusCode(_0x3b7676,_0x5249fa){_0x5249fa=_0x5249fa||0xcc;return function(_0x18f283){if(_0x18f283){return _0x3b7676['sendStatus'](_0x5249fa);}return _0x3b7676[_0x9753('0xc')](_0x5249fa)[_0x9753('0xd')]();};}function respondWithResult(_0x59747e,_0x67a90f){_0x67a90f=_0x67a90f||0xc8;return function(_0x23b0ff){if(_0x23b0ff){return _0x59747e[_0x9753('0xc')](_0x67a90f)[_0x9753('0xe')](_0x23b0ff);}};}function respondWithFilteredResult(_0x3fecfd,_0x10ef3b){return function(_0xda86fb){if(_0xda86fb){var _0x357189=typeof _0x10ef3b[_0x9753('0xf')]===_0x9753('0x10')&&typeof _0x10ef3b['limit']==='undefined';var _0x47f812=_0xda86fb['count'];var _0x534b7d=_0x357189?0x0:_0x10ef3b[_0x9753('0xf')];var _0x17024f=_0x357189?_0xda86fb['count']:_0x10ef3b[_0x9753('0xf')]+_0x10ef3b['limit'];var _0x51cef7;if(_0x17024f>=_0x47f812){_0x17024f=_0x47f812;_0x51cef7=0xc8;}else{_0x51cef7=0xce;}_0x3fecfd['status'](_0x51cef7);return _0x3fecfd['set'](_0x9753('0x11'),_0x534b7d+'-'+_0x17024f+'/'+_0x47f812)[_0x9753('0xe')](_0xda86fb);}return null;};}function saveUpdates(_0x321af6){return function(_0x42c87d){if(_0x42c87d){return _0x42c87d[_0x9753('0x12')](_0x321af6)['then'](function(_0x5a7031){return _0x5a7031;});}return null;};}function removeEntity(_0x33ab60){return function(_0x25acfd){if(_0x25acfd){return _0x25acfd[_0x9753('0x13')]()[_0x9753('0x14')](function(){_0x33ab60['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1218a7){return function(_0x4e06a3){if(!_0x4e06a3){_0x1218a7[_0x9753('0x15')](0x194);}return _0x4e06a3;};}function handleError(_0x573f4c,_0x14b8af){_0x14b8af=_0x14b8af||0x1f4;return function(_0xba7762){logger['error'](_0xba7762['stack']);if(_0xba7762[_0x9753('0x16')]){delete _0xba7762['name'];}_0x573f4c[_0x9753('0xc')](_0x14b8af)[_0x9753('0x17')](_0xba7762);};}function maskClientSecret(_0x1348bf){return _[_0x9753('0x18')](_0x1348bf[_0x9753('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x50d7df,_0x2123dc){var _0x82166a={},_0x3a1278={},_0x5922b4={'count':0x0,'rows':[]};var _0x177e8f=_[_0x9753('0x1a')](db[_0x9753('0x1b')]['rawAttributes'],function(_0x3766f2){return{'name':_0x3766f2[_0x9753('0x1c')],'type':_0x3766f2[_0x9753('0x1d')]['key']};});_0x3a1278[_0x9753('0x1e')]=_[_0x9753('0x1a')](_0x177e8f,_0x9753('0x16'));_0x3a1278[_0x9753('0x1f')]=_[_0x9753('0x20')](_0x50d7df[_0x9753('0x1f')]);_0x3a1278[_0x9753('0x21')]=_[_0x9753('0x22')](_0x3a1278[_0x9753('0x1e')],_0x3a1278[_0x9753('0x1f')]);_0x82166a[_0x9753('0x23')]=_['intersection'](_0x3a1278[_0x9753('0x1e')],qs['fields'](_0x50d7df[_0x9753('0x1f')][_0x9753('0x24')]));_0x82166a[_0x9753('0x23')]=_0x82166a[_0x9753('0x23')][_0x9753('0x25')]?_0x82166a[_0x9753('0x23')]:_0x3a1278[_0x9753('0x1e')];if(!_0x50d7df[_0x9753('0x1f')][_0x9753('0x26')](_0x9753('0x27'))){_0x82166a[_0x9753('0x28')]=qs[_0x9753('0x28')](_0x50d7df[_0x9753('0x1f')][_0x9753('0x28')]);_0x82166a[_0x9753('0xf')]=qs[_0x9753('0xf')](_0x50d7df['query'][_0x9753('0xf')]);}_0x82166a[_0x9753('0x29')]=qs['sort'](_0x50d7df[_0x9753('0x1f')][_0x9753('0x2a')]);_0x82166a['where']=qs[_0x9753('0x21')](_[_0x9753('0x2b')](_0x50d7df[_0x9753('0x1f')],_0x3a1278[_0x9753('0x21')]),_0x177e8f);if(_0x50d7df[_0x9753('0x1f')][_0x9753('0x2c')]){_0x82166a[_0x9753('0x2d')]=_[_0x9753('0x2e')](_0x82166a[_0x9753('0x2d')],{'$or':_[_0x9753('0x1a')](_0x177e8f,function(_0x5d1eee){if(_0x5d1eee[_0x9753('0x1d')]!==_0x9753('0x2f')){var _0x83167={};_0x83167[_0x5d1eee[_0x9753('0x16')]]={'$like':'%'+_0x50d7df[_0x9753('0x1f')]['filter']+'%'};return _0x83167;}})});}_0x82166a=_[_0x9753('0x2e')]({},_0x82166a,_0x50d7df[_0x9753('0x30')]);var _0x48c01a={'where':_0x82166a[_0x9753('0x2d')]};return db[_0x9753('0x1b')][_0x9753('0x31')](_0x48c01a)[_0x9753('0x14')](function(_0x4b85b0){_0x5922b4[_0x9753('0x31')]=_0x4b85b0;if(_0x50d7df[_0x9753('0x1f')][_0x9753('0x32')]){_0x82166a[_0x9753('0x33')]=[{'all':!![]}];}return db['CloudProvider'][_0x9753('0x34')](_0x82166a);})[_0x9753('0x14')](function(_0x4b1d07){_0x5922b4[_0x9753('0x35')]=_['map'](_0x4b1d07,function(_0x5cf2bb){if(_0x5cf2bb[_0x9753('0x36')]===_0x9753('0x37')){var _0x19a5c0=encryptor['decryptString'](_0x5cf2bb[_0x9753('0x38')]);_0x5cf2bb[_0x9753('0x38')]=maskClientSecret(_0x19a5c0);}return _0x5cf2bb;});return _0x5922b4;})[_0x9753('0x14')](respondWithFilteredResult(_0x2123dc,_0x82166a))[_0x9753('0x39')](handleError(_0x2123dc,null));};exports[_0x9753('0x3a')]=function(_0xf0e0d5,_0xf58611){var _0x3e23f5={'raw':!![],'where':{'id':_0xf0e0d5[_0x9753('0x3b')]['id']}},_0x109994={};_0x109994[_0x9753('0x1e')]=_['keys'](db[_0x9753('0x1b')][_0x9753('0x3c')]);_0x109994[_0x9753('0x1f')]=_['keys'](_0xf0e0d5[_0x9753('0x1f')]);_0x109994['filters']=_[_0x9753('0x22')](_0x109994[_0x9753('0x1e')],_0x109994[_0x9753('0x1f')]);_0x3e23f5[_0x9753('0x23')]=_['intersection'](_0x109994['model'],qs['fields'](_0xf0e0d5[_0x9753('0x1f')][_0x9753('0x24')]));_0x3e23f5[_0x9753('0x23')]=_0x3e23f5['attributes'][_0x9753('0x25')]?_0x3e23f5[_0x9753('0x23')]:_0x109994[_0x9753('0x1e')];if(_0xf0e0d5[_0x9753('0x1f')][_0x9753('0x32')]){_0x3e23f5[_0x9753('0x33')]=[{'all':!![]}];}_0x3e23f5=_['merge']({},_0x3e23f5,_0xf0e0d5[_0x9753('0x30')]);return db[_0x9753('0x1b')]['find'](_0x3e23f5)[_0x9753('0x14')](handleEntityNotFound(_0xf58611,null))['then'](function(_0x43bcf7){if(_0x43bcf7[_0x9753('0x36')]==='MicrosoftAzure'){var _0x2090c9=encryptor[_0x9753('0x3d')](_0x43bcf7[_0x9753('0x38')]);_0x43bcf7[_0x9753('0x38')]=maskClientSecret(_0x2090c9);}return _0x43bcf7;})['then'](respondWithResult(_0xf58611,null))[_0x9753('0x39')](handleError(_0xf58611,null));};exports['create']=function(_0x43e402,_0x49d842){if(!_0x43e402[_0x9753('0x3e')][_0x9753('0x16')])throw new Error(_0x9753('0x3f'));if(!_0x43e402[_0x9753('0x3e')][_0x9753('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0xe4f5c3=db[_0x9753('0x1b')]['rawAttributes']['service'][_0x9753('0x40')];if(!_0xe4f5c3[_0x9753('0x41')](_0x43e402[_0x9753('0x3e')][_0x9753('0x36')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0xe4f5c3['join'](',\x20'));if(_0x43e402[_0x9753('0x3e')][_0x9753('0x36')]===_0x9753('0x37')&&_0x43e402[_0x9753('0x3e')][_0x9753('0x38')]){_0x43e402['body']['data3']=encryptor[_0x9753('0x42')](_0x43e402[_0x9753('0x3e')][_0x9753('0x38')]);}return db['CloudProvider']['create'](_0x43e402[_0x9753('0x3e')],{})[_0x9753('0x14')](respondWithResult(_0x49d842,0xc9))[_0x9753('0x39')](handleError(_0x49d842,null));};exports[_0x9753('0x12')]=function(_0x5f343a,_0x3160c7){if(_0x5f343a[_0x9753('0x3e')]['id']){delete _0x5f343a[_0x9753('0x3e')]['id'];}return db[_0x9753('0x1b')]['find']({'where':{'id':_0x5f343a['params']['id']}})[_0x9753('0x14')](handleEntityNotFound(_0x3160c7,null))['then'](function(_0x2907c5){if(_0x2907c5[_0x9753('0x36')]==='MicrosoftAzure'&&_0x5f343a['body'][_0x9753('0x38')]){_0x5f343a[_0x9753('0x3e')][_0x9753('0x38')]=encryptor[_0x9753('0x42')](_0x5f343a['body']['data3']);}return _0x2907c5;})[_0x9753('0x14')](saveUpdates(_0x5f343a[_0x9753('0x3e')],null))[_0x9753('0x14')](respondWithResult(_0x3160c7,null))['catch'](handleError(_0x3160c7,null));};exports['destroy']=function(_0x3732ef,_0x451ed9){return db[_0x9753('0x1b')][_0x9753('0x43')]({'where':{'id':_0x3732ef['params']['id']}})[_0x9753('0x14')](handleEntityNotFound(_0x451ed9,null))['then'](removeEntity(_0x451ed9,null))[_0x9753('0x39')](handleError(_0x451ed9,null));};exports['oauth2MicrosoftAuthorize']=function(_0x53d128,_0x16b4a6){return db['CloudProvider'][_0x9753('0x44')]({'where':{'id':_0x53d128[_0x9753('0x3b')]['id']},'raw':!![]})[_0x9753('0x14')](function(_0xe4113f){if(!_0xe4113f)return _0x16b4a6[_0x9753('0x15')](0x194);return{'url':oauth[_0x9753('0x45')](_0xe4113f,_0x53d128['user']['id'])};})[_0x9753('0x14')](respondWithResult(_0x16b4a6,null))[_0x9753('0x39')](handleError(_0x16b4a6,null));};exports[_0x9753('0x46')]=function(_0x457db7,_0x4ee671){var _0x2adc53=_0x457db7['body'];var _0x3761cb;var _0x42fc69;if(_0x2adc53[_0x9753('0x47')])throw _0x2adc53;redis[_0x9753('0x48')](_0x2adc53['state'])['then'](function(_0x37d298){if(!_0x37d298)throw new Error(_0x9753('0x49'));_0x3761cb=JSON[_0x9753('0x4a')](_0x37d298);var _0x3cc3d0=Buffer[_0x9753('0x4b')](_0x2adc53[_0x9753('0x4c')],_0x9753('0x4d'))[_0x9753('0x4e')](_0x9753('0x4f'));_0x42fc69=JSON[_0x9753('0x4a')](_0x3cc3d0);if(!oauth[_0x9753('0x50')](_0x2adc53['id_token'],_0x3761cb[_0x9753('0x51')]))throw new Error(_0x9753('0x52'));redis[_0x9753('0x53')](_0x2adc53['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x2adc53[_0x9753('0x54')],_0x3761cb);})[_0x9753('0x14')](function(_0x1849e2){_0x3761cb[_0x9753('0x55')]=_0x1849e2[_0x9753('0x56')];_0x3761cb[_0x9753('0x57')]=_0x1849e2[_0x9753('0x58')];return db[_0x9753('0x1b')][_0x9753('0x12')]({'data5':_0x3761cb[_0x9753('0x55')],'data6':_0x3761cb[_0x9753('0x57')]},{'where':{'id':_0x3761cb['id']}});})[_0x9753('0x14')](function(){oauth[_0x9753('0x59')](_0x3761cb);socket[_0x9753('0x5a')]('microsoftAuthorization:success',{'id':_0x42fc69['id']});return;})[_0x9753('0x14')](respondWithStatusCode(_0x4ee671,null))[_0x9753('0x39')](function(_0x44b93b){if(_0x42fc69){socket['emit'](_0x9753('0x5b'),{'id':_0x42fc69['id']});}if(!_0x3761cb){logger[_0x9753('0x47')](_0x9753('0x5c'),_0x44b93b);return _0x4ee671[_0x9753('0xc')](0x1f4)['send'](_0x44b93b[_0x9753('0x5d')]);}logger['error'](_0x9753('0x5e'),_0x3761cb['id'],JSON[_0x9753('0x5f')](_0x44b93b));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 2942b4e..e16193f 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe4a1=['exports','define','cloud_providers','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe4a1,0x93));var _0x1e4a=function(_0x436b5a,_0x37433f){_0x436b5a=_0x436b5a-0x0;var _0x4e9145=_0xe4a1[_0x436b5a];return _0x4e9145;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e4a('0x0'))(_0x1e4a('0x1'));var moment=require(_0x1e4a('0x2'));var BPromise=require(_0x1e4a('0x3'));var rp=require(_0x1e4a('0x4'));var fs=require('fs');var path=require(_0x1e4a('0x5'));var rimraf=require(_0x1e4a('0x6'));var config=require(_0x1e4a('0x7'));var attributes=require(_0x1e4a('0x8'));module[_0x1e4a('0x9')]=function(_0x2ef4c3,_0x3d2611){return _0x2ef4c3[_0x1e4a('0xa')]('CloudProvider',attributes,{'tableName':_0x1e4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5732=['exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x29e7b8,_0x3b733f){var _0x2c6699=function(_0x1f1267){while(--_0x1f1267){_0x29e7b8['push'](_0x29e7b8['shift']());}};_0x2c6699(++_0x3b733f);}(_0x5732,0x1b0));var _0x2573=function(_0x5c4939,_0x39bc44){_0x5c4939=_0x5c4939-0x0;var _0x389665=_0x5732[_0x5c4939];return _0x389665;};'use strict';var _=require(_0x2573('0x0'));var util=require(_0x2573('0x1'));var logger=require(_0x2573('0x2'))(_0x2573('0x3'));var moment=require('moment');var BPromise=require(_0x2573('0x4'));var rp=require(_0x2573('0x5'));var fs=require('fs');var path=require(_0x2573('0x6'));var rimraf=require(_0x2573('0x7'));var config=require(_0x2573('0x8'));var attributes=require(_0x2573('0x9'));module[_0x2573('0xa')]=function(_0x538918,_0x53d1e7){return _0x538918['define'](_0x2573('0xb'),attributes,{'tableName':_0x2573('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 82a6a68..1ba6a95 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaae=['code','from','base64','randomBytes','toString','hex','data1','response_type','redirect_uri','data4','response_mode','form_post','nonce','login','key','value','oauth2Claims','oauth2/','set','payload','iss','issuer','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','decryptString','POST','data2','data5','access_token','data6','refresh_token','catch','bind','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}'];(function(_0x1b9306,_0x585dbe){var _0x3e0a1b=function(_0x3e7ae2){while(--_0x3e7ae2){_0x1b9306['push'](_0x1b9306['shift']());}};_0x3e0a1b(++_0x585dbe);}(_0xbaae,0x1a3));var _0xebaa=function(_0x1b4f29,_0x157eac){_0x1b4f29=_0x1b4f29-0x0;var _0x544af=_0xbaae[_0x1b4f29];return _0x544af;};'use strict';var _=require(_0xebaa('0x0'));var crypto=require(_0xebaa('0x1'));var jwt=require(_0xebaa('0x2'));var moment=require('moment');var Redis=require(_0xebaa('0x3'));var rp=require(_0xebaa('0x4'));var util=require(_0xebaa('0x5'));var encryptor=require(_0xebaa('0x6'));var config=require('../../config/environment');var logger=require(_0xebaa('0x7'))(_0xebaa('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xebaa('0x9'))['db'];config['redis']=_[_0xebaa('0xa')](config[_0xebaa('0xb')],{'host':_0xebaa('0xc'),'port':0x18eb});var redis=new Redis(config[_0xebaa('0xb')]);var MICROSOFT_AUTH_URL=_0xebaa('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xebaa('0xe'),_0xebaa('0xf'),_0xebaa('0x10'),_0xebaa('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xebaa('0x12'),_0xebaa('0x13')],'Dynamics365':[_0xebaa('0xe'),_0xebaa('0x11')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xebaa('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x558426){var _0x413630=_[_0xebaa('0x15')](AZURE_AUTH_SCOPES[_0x558426[_0xebaa('0x16')]]);if(_0x558426[_0xebaa('0x16')]===_0xebaa('0x17'))_0x413630[_0xebaa('0x18')](_0x558426['data7']+_0xebaa('0x19'));return _0x413630[_0xebaa('0x1a')]('\x20');}function getAccessTokenScope(_0x5f3bd8){if(_0x5f3bd8[_0xebaa('0x16')]===_0xebaa('0x1b'))return _0xebaa('0x1c');if(_0x5f3bd8[_0xebaa('0x16')]===_0xebaa('0x17'))return _0x5f3bd8['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x9b00a2,_0x31290b){var _0x5dab6e=MICROSOFT_AUTH_URL[_0xebaa('0x1d')](_0xebaa('0x1e'),_0x9b00a2['data2']);var _0x3eb0d3=[_0xebaa('0x1f'),'id_token'];var _0x2040d0=Buffer[_0xebaa('0x20')](JSON['stringify']({'id':_0x31290b}))['toString'](_0xebaa('0x21'));var _0x27c62e=crypto[_0xebaa('0x22')](0x10)[_0xebaa('0x23')](_0xebaa('0x24'));var _0x41203a=getAuthorizationScopes(_0x9b00a2);var _0x209e96=[{'key':'client_id','value':_0x9b00a2[_0xebaa('0x25')]},{'key':_0xebaa('0x26'),'value':encodeURIComponent(_0x3eb0d3['join']('\x20'))},{'key':_0xebaa('0x27'),'value':_0x9b00a2[_0xebaa('0x28')]},{'key':_0xebaa('0x29'),'value':_0xebaa('0x2a')},{'key':'scope','value':encodeURIComponent(_0x41203a)},{'key':'state','value':_0x2040d0},{'key':_0xebaa('0x2b'),'value':_0x27c62e},{'key':'prompt','value':_0xebaa('0x2c')}];var _0x3c6dc4=_0x5dab6e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xebaa('0x15')](_0x209e96,function(_0x22da3f){return _0x22da3f[_0xebaa('0x2d')]+'='+_0x22da3f[_0xebaa('0x2e')];})['join']('&');_0x9b00a2[_0xebaa('0x2f')]={'issuer':_0x5dab6e[_0xebaa('0x1d')](_0xebaa('0x30'),''),'audience':_0x9b00a2['data1'],'state':_0x2040d0,'nonce':_0x27c62e};redis[_0xebaa('0x31')](_0x2040d0,JSON['stringify'](_0x9b00a2));return _0x3c6dc4;}function isValidIdToken(_0x381da2,_0x110834){try{var _0x447188=jwt['decode'](_0x381da2,{'complete':!![]});var _0x3ca0ee=_0x447188[_0xebaa('0x32')];if(_0x3ca0ee[_0xebaa('0x33')]!==_0x110834[_0xebaa('0x34')])return![];if(_0x3ca0ee['aud']!==_0x110834[_0xebaa('0x35')])return![];if(_0x3ca0ee['nonce']!==_0x110834[_0xebaa('0x2b')])return![];if(moment()[_0xebaa('0x36')](moment[_0xebaa('0x37')](_0x3ca0ee[_0xebaa('0x38')])))return![];return!![];}catch(_0x2258b4){throw _0x2258b4;}}function refreshOauth2MicrosoftAccessToken(_0x11b40e){return Promise[_0xebaa('0x39')]()[_0xebaa('0x3a')](function(){if(_0x11b40e[_0xebaa('0x3b')])return _0x11b40e;return db[_0xebaa('0x3c')]['findOne']({'where':{'id':_0x11b40e['id']},'raw':!![]});})[_0xebaa('0x3a')](function(_0x38f76f){var _0x157f03={'grant_type':'refresh_token','refresh_token':_0x38f76f['data6'],'scope':getAccessTokenScope(_0x38f76f),'redirect_uri':_0x38f76f[_0xebaa('0x28')],'client_id':_0x38f76f[_0xebaa('0x25')],'client_secret':encryptor[_0xebaa('0x3d')](_0x38f76f[_0xebaa('0x3b')])};var _0x43c5d1={'method':_0xebaa('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xebaa('0x1d')](_0xebaa('0x1e'),_0x38f76f[_0xebaa('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x157f03,'json':!![]};return rp(_0x43c5d1);})[_0xebaa('0x3a')](function(_0xe36e5a){_0x11b40e[_0xebaa('0x40')]=_0xe36e5a[_0xebaa('0x41')];_0x11b40e[_0xebaa('0x42')]=_0xe36e5a[_0xebaa('0x43')];return db[_0xebaa('0x3c')]['update']({'data5':_0x11b40e[_0xebaa('0x40')],'data6':_0x11b40e[_0xebaa('0x42')]},{'where':{'id':_0x11b40e['id']}});})[_0xebaa('0x3a')](function(){return _0x11b40e;})[_0xebaa('0x44')](function(_0x44f86c){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x11b40e['id'],_0x44f86c);});}function getOauth2MicrosoftAccessToken(_0x568c54,_0x2d58e2){var _0x3f0d07={'grant_type':'authorization_code','code':_0x568c54,'scope':getAccessTokenScope(_0x2d58e2),'redirect_uri':_0x2d58e2[_0xebaa('0x28')],'client_id':_0x2d58e2[_0xebaa('0x25')],'client_secret':encryptor['decryptString'](_0x2d58e2['data3'])};var _0x3b717b={'method':_0xebaa('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xebaa('0x1d')]('{TENANT_ID}',_0x2d58e2[_0xebaa('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f0d07,'json':!![]};return rp(_0x3b717b);}function startRefreshInterval(_0x85e9aa){var _0x5751d2=schedule['intervals'];if(_0x5751d2[_0x85e9aa['id']])clearInterval(_0x5751d2[_0x85e9aa['id']]);_0x5751d2[_0x85e9aa['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xebaa('0x45')](this,{'id':_0x85e9aa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5751d2;}function startAllRefreshIntervals(){return db[_0xebaa('0x3c')][_0xebaa('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x51e13f){var _0x5f3052=_0x51e13f[_0xebaa('0x15')](function(_0xc68884){return refreshOauth2MicrosoftAccessToken(_0xc68884)[_0xebaa('0x3a')](function(_0x5aa804){startRefreshInterval(_0x5aa804);});});return Promise['all'](_0x5f3052);})[_0xebaa('0x44')](function(_0x5220c3){var _0xe732b0=_0x5220c3?util[_0xebaa('0x47')](_0x5220c3,{'showHidden':![],'depth':null}):'';logger[_0xebaa('0x48')](_0xebaa('0x49'),_0xe732b0);});}module[_0xebaa('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x5a44=['base64','randomBytes','hex','data1','redirect_uri','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','iss','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','data4','decryptString','POST','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','{TENANT_ID}','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','code','from','stringify','toString'];(function(_0xe54e68,_0x2163a5){var _0x515cd3=function(_0xa0b062){while(--_0xa0b062){_0xe54e68['push'](_0xe54e68['shift']());}};_0x515cd3(++_0x2163a5);}(_0x5a44,0x1f4));var _0x45a4=function(_0x45bc03,_0x3e130c){_0x45bc03=_0x45bc03-0x0;var _0x4a403b=_0x5a44[_0x45bc03];return _0x4a403b;};'use strict';var _=require('lodash');var crypto=require(_0x45a4('0x0'));var jwt=require(_0x45a4('0x1'));var moment=require(_0x45a4('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0x45a4('0x3'));var logger=require(_0x45a4('0x4'))(_0x45a4('0x5'));var schedule=require(_0x45a4('0x6'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x45a4('0x7')](config[_0x45a4('0x8')],{'host':_0x45a4('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x45a4('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x45a4('0xb'),_0x45a4('0xc'),_0x45a4('0xd'),_0x45a4('0xe'),_0x45a4('0xf'),_0x45a4('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x45a4('0xb'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x45a4('0x11');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4a7f56){var _0x3b8f3e=_[_0x45a4('0x12')](AZURE_AUTH_SCOPES[_0x4a7f56[_0x45a4('0x13')]]);if(_0x4a7f56[_0x45a4('0x13')]===_0x45a4('0x14'))_0x3b8f3e[_0x45a4('0x15')](_0x4a7f56[_0x45a4('0x16')]+_0x45a4('0x17'));return _0x3b8f3e[_0x45a4('0x18')]('\x20');}function getAccessTokenScope(_0x12e834){if(_0x12e834[_0x45a4('0x13')]===_0x45a4('0x19'))return _0x45a4('0xf');if(_0x12e834['type']===_0x45a4('0x14'))return _0x12e834['data7']+_0x45a4('0x17');}function generateMicrosoftAuthorizationUrl(_0x373426,_0x215ac1){var _0xa4e610=MICROSOFT_AUTH_URL[_0x45a4('0x1a')]('{TENANT_ID}',_0x373426[_0x45a4('0x1b')]);var _0x49adef=[_0x45a4('0x1c'),'id_token'];var _0x31086d=Buffer[_0x45a4('0x1d')](JSON[_0x45a4('0x1e')]({'id':_0x215ac1}))[_0x45a4('0x1f')](_0x45a4('0x20'));var _0x4e042c=crypto[_0x45a4('0x21')](0x10)[_0x45a4('0x1f')](_0x45a4('0x22'));var _0x5aeb24=getAuthorizationScopes(_0x373426);var _0x4d4c66=[{'key':'client_id','value':_0x373426[_0x45a4('0x23')]},{'key':'response_type','value':encodeURIComponent(_0x49adef['join']('\x20'))},{'key':_0x45a4('0x24'),'value':_0x373426['data4']},{'key':'response_mode','value':_0x45a4('0x25')},{'key':_0x45a4('0x26'),'value':encodeURIComponent(_0x5aeb24)},{'key':_0x45a4('0x27'),'value':_0x31086d},{'key':_0x45a4('0x28'),'value':_0x4e042c},{'key':_0x45a4('0x29'),'value':_0x45a4('0x2a')}];var _0x279e98=_0xa4e610+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x45a4('0x12')](_0x4d4c66,function(_0x2ba248){return _0x2ba248[_0x45a4('0x2b')]+'='+_0x2ba248[_0x45a4('0x2c')];})[_0x45a4('0x18')]('&');_0x373426[_0x45a4('0x2d')]={'issuer':_0xa4e610['replace'](_0x45a4('0x2e'),''),'audience':_0x373426[_0x45a4('0x23')],'state':_0x31086d,'nonce':_0x4e042c};redis['set'](_0x31086d,JSON[_0x45a4('0x1e')](_0x373426));return _0x279e98;}function isValidIdToken(_0x565c33,_0x29b5e2){try{var _0xe9fcdb=jwt[_0x45a4('0x2f')](_0x565c33,{'complete':!![]});var _0x4fbf33=_0xe9fcdb[_0x45a4('0x30')];if(_0x4fbf33[_0x45a4('0x31')]!==_0x29b5e2['issuer'])return![];if(_0x4fbf33['aud']!==_0x29b5e2[_0x45a4('0x32')])return![];if(_0x4fbf33[_0x45a4('0x28')]!==_0x29b5e2[_0x45a4('0x28')])return![];if(moment()[_0x45a4('0x33')](moment[_0x45a4('0x34')](_0x4fbf33[_0x45a4('0x35')])))return![];return!![];}catch(_0xc2a8f6){throw _0xc2a8f6;}}function refreshOauth2MicrosoftAccessToken(_0x1f5609){return Promise[_0x45a4('0x36')]()[_0x45a4('0x37')](function(){if(_0x1f5609[_0x45a4('0x38')])return _0x1f5609;return db[_0x45a4('0x39')][_0x45a4('0x3a')]({'where':{'id':_0x1f5609['id']},'raw':!![]});})['then'](function(_0x39d0bb){var _0x54f75c={'grant_type':_0x45a4('0x3b'),'refresh_token':_0x39d0bb[_0x45a4('0x3c')],'scope':getAccessTokenScope(_0x39d0bb),'redirect_uri':_0x39d0bb[_0x45a4('0x3d')],'client_id':_0x39d0bb[_0x45a4('0x23')],'client_secret':encryptor[_0x45a4('0x3e')](_0x39d0bb[_0x45a4('0x38')])};var _0x48ff32={'method':_0x45a4('0x3f'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x39d0bb[_0x45a4('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x54f75c,'json':!![]};return rp(_0x48ff32);})[_0x45a4('0x37')](function(_0x1db2b3){_0x1f5609[_0x45a4('0x40')]=_0x1db2b3[_0x45a4('0x41')];_0x1f5609[_0x45a4('0x3c')]=_0x1db2b3[_0x45a4('0x3b')];return db[_0x45a4('0x39')][_0x45a4('0x42')]({'data5':_0x1f5609[_0x45a4('0x40')],'data6':_0x1f5609[_0x45a4('0x3c')]},{'where':{'id':_0x1f5609['id']}});})['then'](function(){return _0x1f5609;})[_0x45a4('0x43')](function(_0x593ea9){logger['error'](_0x45a4('0x44'),_0x1f5609['id'],_0x593ea9);});}function getOauth2MicrosoftAccessToken(_0x52cb61,_0x4fc032){var _0x3f8288={'grant_type':_0x45a4('0x45'),'code':_0x52cb61,'scope':getAccessTokenScope(_0x4fc032),'redirect_uri':_0x4fc032[_0x45a4('0x3d')],'client_id':_0x4fc032[_0x45a4('0x23')],'client_secret':encryptor['decryptString'](_0x4fc032[_0x45a4('0x38')])};var _0x57bd5e={'method':_0x45a4('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x45a4('0x1a')](_0x45a4('0x46'),_0x4fc032['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f8288,'json':!![]};return rp(_0x57bd5e);}function startRefreshInterval(_0x11d7c3){var _0xe97f2e=schedule['intervals'];if(_0xe97f2e[_0x11d7c3['id']])clearInterval(_0xe97f2e[_0x11d7c3['id']]);_0xe97f2e[_0x11d7c3['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x11d7c3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xe97f2e;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x45a4('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x45a4('0x37')](function(_0x3b3a22){var _0xa64181=_0x3b3a22[_0x45a4('0x12')](function(_0x3c7e95){return refreshOauth2MicrosoftAccessToken(_0x3c7e95)[_0x45a4('0x37')](function(_0x535876){startRefreshInterval(_0x535876);});});return Promise[_0x45a4('0x48')](_0xa64181);})[_0x45a4('0x43')](function(_0x3b643d){var _0x127a34=_0x3b643d?util[_0x45a4('0x49')](_0x3b643d,{'showHidden':![],'depth':null}):'';logger['error'](_0x45a4('0x4a'),_0x127a34);});}module[_0x45a4('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 06c4ec6..de05622 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x87bc=['http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','client'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x87bc,0x189));var _0xc87b=function(_0x56f292,_0x113fc9){_0x56f292=_0x56f292-0x0;var _0x117ee9=_0x87bc[_0x56f292];return _0x117ee9;};'use strict';var _=require(_0xc87b('0x0'));var util=require(_0xc87b('0x1'));var moment=require('moment');var BPromise=require(_0xc87b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc87b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc87b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc87b('0x5')][_0xc87b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x402aac,_0x5d1813,_0x50b19b){return new BPromise(function(_0x4ed0c5,_0x1999f8){return client[_0xc87b('0x7')](_0x402aac,_0x50b19b)[_0xc87b('0x8')](function(_0x19b571){logger[_0xc87b('0x9')](_0xc87b('0xa'),_0x5d1813,_0xc87b('0xb'));logger[_0xc87b('0xc')](_0xc87b('0xd'),_0x5d1813,'request\x20sent',JSON['stringify'](_0x19b571));if(_0x19b571[_0xc87b('0xe')]){if(_0x19b571['error'][_0xc87b('0xf')]===0x1f4){logger[_0xc87b('0xe')](_0xc87b('0xa'),_0x5d1813,_0x19b571[_0xc87b('0xe')]['message']);return _0x1999f8(_0x19b571[_0xc87b('0xe')]['message']);}logger[_0xc87b('0xe')](_0xc87b('0xa'),_0x5d1813,_0x19b571['error'][_0xc87b('0x10')]);return _0x4ed0c5(_0x19b571[_0xc87b('0xe')]['message']);}else{logger[_0xc87b('0x9')](_0xc87b('0xa'),_0x5d1813,_0xc87b('0xb'));_0x4ed0c5(_0x19b571[_0xc87b('0x11')][_0xc87b('0x10')]);}})[_0xc87b('0x12')](function(_0x4009ef){logger[_0xc87b('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5d1813,_0x4009ef);_0x1999f8(_0x4009ef);});});}
\ No newline at end of file
+var _0xfb11=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x47d4fc,_0x51d987){var _0x3f3027=function(_0x4e2de6){while(--_0x4e2de6){_0x47d4fc['push'](_0x47d4fc['shift']());}};_0x3f3027(++_0x51d987);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xfb11[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index ce91ee8..9f77370 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x24e1f3,_0x424234){var _0x34fe3f=function(_0x32b238){while(--_0x32b238){_0x24e1f3['push'](_0x24e1f3['shift']());}};_0x34fe3f(++_0x424234);}(_0x2ef3,0xba));var _0x32ef=function(_0x2575d9,_0x7fade9){_0x2575d9=_0x2575d9-0x0;var _0x2fae9e=_0x2ef3[_0x2575d9];return _0x2fae9e;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x5adef4,_0x2d3e65){var _0x3672ad=function(_0x1825f8){while(--_0x1825f8){_0x5adef4['push'](_0x5adef4['shift']());}};_0x3672ad(++_0x2d3e65);}(_0x2ef3,0xba));var _0x32ef=function(_0x3f8d68,_0x1918bd){_0x3f8d68=_0x3f8d68-0x0;var _0xfb3ba8=_0x2ef3[_0x3f8d68];return _0xfb3ba8;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 2a0880b..aea90f7 100644
--- a/server/api/cmCompany/cmCompany.attributes.js
+++ b/server/api/cmCompany/cmCompany.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd28=['exports','STRING'];(function(_0x5cc666,_0x4607f3){var _0x379fd0=function(_0x3918af){while(--_0x3918af){_0x5cc666['push'](_0x5cc666['shift']());}};_0x379fd0(++_0x4607f3);}(_0xfd28,0x148));var _0x8fd2=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xfd28[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'name':{'type':Sequelize[_0x8fd2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8fd2('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x8fd2('0x1')]},'phone':{'type':Sequelize[_0x8fd2('0x1')]},'fax':{'type':Sequelize[_0x8fd2('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8fd2('0x1')]},'postalCode':{'type':Sequelize[_0x8fd2('0x1')]},'city':{'type':Sequelize[_0x8fd2('0x1')]},'country':{'type':Sequelize[_0x8fd2('0x1')]},'email':{'type':Sequelize[_0x8fd2('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x8fd2('0x1')]},'sCity':{'type':Sequelize[_0x8fd2('0x1')]},'sCountry':{'type':Sequelize[_0x8fd2('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x59ad=['STRING','name','sequelize','exports'];(function(_0x4b9050,_0x1d9044){var _0x13aa59=function(_0x40545d){while(--_0x40545d){_0x4b9050['push'](_0x4b9050['shift']());}};_0x13aa59(++_0x1d9044);}(_0x59ad,0xee));var _0xd59a=function(_0xf14432,_0x4b0ed0){_0xf14432=_0xf14432-0x0;var _0x35d0e4=_0x59ad[_0xf14432];return _0x35d0e4;};'use strict';var Sequelize=require(_0xd59a('0x0'));module[_0xd59a('0x1')]={'name':{'type':Sequelize[_0xd59a('0x2')],'unique':_0xd59a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd59a('0x2')]},'companyId':{'type':Sequelize[_0xd59a('0x2')]},'website':{'type':Sequelize[_0xd59a('0x2')]},'phone':{'type':Sequelize[_0xd59a('0x2')]},'fax':{'type':Sequelize[_0xd59a('0x2')]},'type':{'type':Sequelize[_0xd59a('0x2')]},'street':{'type':Sequelize[_0xd59a('0x2')]},'postalCode':{'type':Sequelize[_0xd59a('0x2')]},'city':{'type':Sequelize[_0xd59a('0x2')]},'country':{'type':Sequelize[_0xd59a('0x2')]},'email':{'type':Sequelize[_0xd59a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd59a('0x2')]},'sPostalCode':{'type':Sequelize[_0xd59a('0x2')]},'sCity':{'type':Sequelize[_0xd59a('0x2')]},'sCountry':{'type':Sequelize[_0xd59a('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index c4a2fe2..8bc0b2e 100644
--- a/server/api/cmCompany/cmCompany.controller.js
+++ b/server/api/cmCompany/cmCompany.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1171=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','ids','omit','findOne','order','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','count','limit','set','update','then','destroy','get','Companies','end','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','options','includeAll','include','rows','catch','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource'];(function(_0x57c235,_0x3e998f){var _0x46bdc2=function(_0x43db6b){while(--_0x43db6b){_0x57c235['push'](_0x57c235['shift']());}};_0x46bdc2(++_0x3e998f);}(_0x1171,0x15f));var _0x1117=function(_0x5b8646,_0x3e1589){_0x5b8646=_0x5b8646-0x0;var _0x363e4c=_0x1171[_0x5b8646];return _0x363e4c;};'use strict';var emlformat=require(_0x1117('0x0'));var rimraf=require(_0x1117('0x1'));var zipdir=require(_0x1117('0x2'));var jsonpatch=require(_0x1117('0x3'));var rp=require(_0x1117('0x4'));var moment=require(_0x1117('0x5'));var BPromise=require(_0x1117('0x6'));var Mustache=require(_0x1117('0x7'));var util=require(_0x1117('0x8'));var path=require(_0x1117('0x9'));var sox=require('sox');var csv=require(_0x1117('0xa'));var ejs=require(_0x1117('0xb'));var fs=require('fs');var fs_extra=require(_0x1117('0xc'));var _=require(_0x1117('0xd'));var squel=require('squel');var crypto=require(_0x1117('0xe'));var jsforce=require(_0x1117('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1117('0x10'));var Papa=require(_0x1117('0x11'));var Redis=require(_0x1117('0x12'));var authService=require(_0x1117('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1117('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1117('0x15'))('api');var utils=require(_0x1117('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1117('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f6cc9,_0x19e013){_0x19e013=_0x19e013||0xcc;return function(_0x48302f){if(_0x48302f){return _0x4f6cc9[_0x1117('0x18')](_0x19e013);}return _0x4f6cc9[_0x1117('0x19')](_0x19e013)['end']();};}function respondWithResult(_0xd97153,_0x212b1d){_0x212b1d=_0x212b1d||0xc8;return function(_0x4e53dd){if(_0x4e53dd){return _0xd97153[_0x1117('0x19')](_0x212b1d)[_0x1117('0x1a')](_0x4e53dd);}};}function respondWithFilteredResult(_0x4cbc80,_0x2e6b5f){return function(_0x4c51ca){if(_0x4c51ca){var _0x40718b=typeof _0x2e6b5f[_0x1117('0x1b')]==='undefined'&&typeof _0x2e6b5f['limit']==='undefined';var _0xda8d86=_0x4c51ca[_0x1117('0x1c')];var _0x15eb78=_0x40718b?0x0:_0x2e6b5f[_0x1117('0x1b')];var _0x812fbf=_0x40718b?_0x4c51ca['count']:_0x2e6b5f[_0x1117('0x1b')]+_0x2e6b5f[_0x1117('0x1d')];var _0x14ba55;if(_0x812fbf>=_0xda8d86){_0x812fbf=_0xda8d86;_0x14ba55=0xc8;}else{_0x14ba55=0xce;}_0x4cbc80['status'](_0x14ba55);return _0x4cbc80[_0x1117('0x1e')]('Content-Range',_0x15eb78+'-'+_0x812fbf+'/'+_0xda8d86)[_0x1117('0x1a')](_0x4c51ca);}return null;};}function patchUpdates(_0x5c480b){return function(_0x340388){try{jsonpatch['apply'](_0x340388,_0x5c480b,!![]);}catch(_0x5df12b){return BPromise['reject'](_0x5df12b);}return _0x340388['save']();};}function saveUpdates(_0x53c82f,_0x5a377a){return function(_0x4dec7d){if(_0x4dec7d){return _0x4dec7d[_0x1117('0x1f')](_0x53c82f)[_0x1117('0x20')](function(_0x33ae68){return _0x33ae68;});}return null;};}function removeEntity(_0x474f7c,_0x4494f5){return function(_0x540aa6){if(_0x540aa6){return _0x540aa6[_0x1117('0x21')]()[_0x1117('0x20')](function(){var _0x2b8bf1=_0x540aa6[_0x1117('0x22')]({'plain':!![]});var _0x4bced6=_0x1117('0x23');return db['UserProfileResource'][_0x1117('0x21')]({'where':{'type':_0x4bced6,'resourceId':_0x2b8bf1['id']}})[_0x1117('0x20')](function(){return _0x540aa6;});})['then'](function(){_0x474f7c[_0x1117('0x19')](0xcc)[_0x1117('0x24')]();});}};}function handleEntityNotFound(_0x1e4cac,_0x5e160c){return function(_0x3e6d69){if(!_0x3e6d69){_0x1e4cac['sendStatus'](0x194);}return _0x3e6d69;};}function handleError(_0x339639,_0x135b4c){_0x135b4c=_0x135b4c||0x1f4;return function(_0x1859dd){logger[_0x1117('0x25')](_0x1859dd[_0x1117('0x26')]);if(_0x1859dd[_0x1117('0x27')]){delete _0x1859dd[_0x1117('0x27')];}_0x339639[_0x1117('0x19')](_0x135b4c)[_0x1117('0x28')](_0x1859dd);};}exports[_0x1117('0x29')]=function(_0x968d67,_0x1044b9){var _0x45b55a={},_0x222f85={},_0x451533={'count':0x0,'rows':[]};return db[_0x1117('0x2a')][_0x1117('0x2b')]()[_0x1117('0x20')](function(_0x8233fe){_0x222f85[_0x1117('0x2c')]=_[_0x1117('0x2d')](_0x8233fe);_0x222f85[_0x1117('0x2e')]=_[_0x1117('0x2d')](_0x968d67[_0x1117('0x2e')]);_0x222f85['filters']=_[_0x1117('0x2f')](_0x222f85[_0x1117('0x2c')],_0x222f85[_0x1117('0x2e')]);_0x45b55a[_0x1117('0x30')]=_['intersection'](_0x222f85[_0x1117('0x2c')],qs[_0x1117('0x31')](_0x968d67[_0x1117('0x2e')]['fields']));_0x45b55a[_0x1117('0x30')]=_0x45b55a['attributes'][_0x1117('0x32')]?_0x45b55a[_0x1117('0x30')]:_0x222f85['model'];if(!_0x968d67[_0x1117('0x2e')][_0x1117('0x33')](_0x1117('0x34'))){_0x45b55a[_0x1117('0x1d')]=qs['limit'](_0x968d67[_0x1117('0x2e')]['limit']);_0x45b55a[_0x1117('0x1b')]=qs[_0x1117('0x1b')](_0x968d67['query'][_0x1117('0x1b')]);}_0x45b55a['order']=qs[_0x1117('0x35')](_0x968d67['query'][_0x1117('0x35')]);_0x45b55a['where']=qs['filters'](_[_0x1117('0x36')](_0x968d67[_0x1117('0x2e')],_0x222f85[_0x1117('0x37')]),_0x8233fe);if(_0x968d67['query'][_0x1117('0x38')]){_0x45b55a[_0x1117('0x39')]=_[_0x1117('0x3a')](_0x45b55a[_0x1117('0x39')],{'$or':_['map'](_0x45b55a['attributes'],function(_0x28074c){var _0x409284={};_0x409284[_0x28074c]={'$like':'%'+_0x968d67[_0x1117('0x2e')][_0x1117('0x38')]+'%'};return _0x409284;})});}_0x45b55a=_[_0x1117('0x3a')]({},_0x45b55a,_0x968d67[_0x1117('0x3b')]);var _0x2ab875={'where':_0x45b55a[_0x1117('0x39')]};return db['CmCompany'][_0x1117('0x1c')](_0x2ab875)[_0x1117('0x20')](function(_0x5e2f58){_0x451533['count']=_0x5e2f58;if(_0x968d67[_0x1117('0x2e')][_0x1117('0x3c')]){_0x45b55a[_0x1117('0x3d')]=[{'all':!![]}];}return db[_0x1117('0x2a')]['findAll'](_0x45b55a);})[_0x1117('0x20')](function(_0x356aa8){_0x451533[_0x1117('0x3e')]=_0x356aa8;return _0x451533;})[_0x1117('0x20')](respondWithFilteredResult(_0x1044b9,_0x45b55a))['catch'](handleError(_0x1044b9,null));})[_0x1117('0x3f')](handleError(_0x1044b9,null));};exports[_0x1117('0x40')]=function(_0x48c238,_0x12dead){var _0x56c142={'raw':![],'where':{'id':_0x48c238['params']['id']}},_0x2468f5={};_0x2468f5[_0x1117('0x2c')]=_[_0x1117('0x2d')](db[_0x1117('0x2a')][_0x1117('0x41')]);_0x2468f5[_0x1117('0x2e')]=_[_0x1117('0x2d')](_0x48c238[_0x1117('0x2e')]);_0x2468f5[_0x1117('0x37')]=_[_0x1117('0x2f')](_0x2468f5[_0x1117('0x2c')],_0x2468f5[_0x1117('0x2e')]);_0x56c142[_0x1117('0x30')]=_[_0x1117('0x2f')](_0x2468f5[_0x1117('0x2c')],qs[_0x1117('0x31')](_0x48c238[_0x1117('0x2e')][_0x1117('0x31')]));_0x56c142[_0x1117('0x30')]=_0x56c142[_0x1117('0x30')]['length']?_0x56c142['attributes']:_0x2468f5[_0x1117('0x2c')];if(_0x48c238[_0x1117('0x2e')]['includeAll']){_0x56c142['include']=[{'all':!![]}];}_0x56c142=_[_0x1117('0x3a')]({},_0x56c142,_0x48c238[_0x1117('0x3b')]);return db['CmCompany'][_0x1117('0x42')](_0x56c142)['then'](handleEntityNotFound(_0x12dead,null))[_0x1117('0x20')](respondWithResult(_0x12dead,null))[_0x1117('0x3f')](handleError(_0x12dead,null));};exports['create']=function(_0x233e8a,_0x2457dc){return db[_0x1117('0x2a')][_0x1117('0x43')](_0x233e8a['body'],{})[_0x1117('0x20')](function(_0x3875d3){var _0x3a78b0=_0x233e8a[_0x1117('0x44')][_0x1117('0x22')]({'plain':!![]});if(!_0x3a78b0)throw new Error(_0x1117('0x45'));if(_0x3a78b0[_0x1117('0x46')]===_0x1117('0x44')){var _0x4c78e7=_0x3875d3[_0x1117('0x22')]({'plain':!![]});var _0x5f1dff=_0x1117('0x23');return db[_0x1117('0x47')][_0x1117('0x42')]({'where':{'name':_0x5f1dff,'userProfileId':_0x3a78b0['userProfileId']},'raw':!![]})[_0x1117('0x20')](function(_0x13fcc1){if(_0x13fcc1&&_0x13fcc1[_0x1117('0x48')]===0x0){return db[_0x1117('0x49')][_0x1117('0x43')]({'name':_0x4c78e7[_0x1117('0x27')],'resourceId':_0x4c78e7['id'],'type':_0x13fcc1[_0x1117('0x27')],'sectionId':_0x13fcc1['id']},{})[_0x1117('0x20')](function(){return _0x3875d3;});}else{return _0x3875d3;}})[_0x1117('0x3f')](function(_0x5a8b4a){logger[_0x1117('0x25')](_0x1117('0x4a'),_0x5a8b4a);throw _0x5a8b4a;});}return _0x3875d3;})[_0x1117('0x20')](respondWithResult(_0x2457dc,0xc9))[_0x1117('0x3f')](handleError(_0x2457dc,null));};exports['update']=function(_0x21e231,_0x1e04f9){if(_0x21e231[_0x1117('0x4b')]['id']){delete _0x21e231[_0x1117('0x4b')]['id'];}return db[_0x1117('0x2a')][_0x1117('0x42')]({'where':{'id':_0x21e231['params']['id']}})['then'](handleEntityNotFound(_0x1e04f9,null))[_0x1117('0x20')](saveUpdates(_0x21e231[_0x1117('0x4b')],null))[_0x1117('0x20')](respondWithResult(_0x1e04f9,null))['catch'](handleError(_0x1e04f9,null));};exports[_0x1117('0x21')]=function(_0x3df7cf,_0x28e879){return db[_0x1117('0x2a')]['find']({'where':{'id':_0x3df7cf[_0x1117('0x4c')]['id']}})[_0x1117('0x20')](handleEntityNotFound(_0x28e879,null))[_0x1117('0x20')](removeEntity(_0x28e879,null))[_0x1117('0x3f')](handleError(_0x28e879,null));};exports[_0x1117('0x2b')]=function(_0x332d21,_0x532f0d){return db[_0x1117('0x2a')]['describe']()[_0x1117('0x20')](respondWithResult(_0x532f0d,null))[_0x1117('0x3f')](handleError(_0x532f0d,null));};exports[_0x1117('0x4d')]=function(_0x3456ca,_0x203eaf,_0x481ef2){return db[_0x1117('0x4e')][_0x1117('0x42')]({'where':{'id':_0x3456ca[_0x1117('0x4c')]['id']}})[_0x1117('0x20')](handleEntityNotFound(_0x203eaf,null))[_0x1117('0x20')](function(_0x58a63e){if(_0x58a63e){return _0x58a63e[_0x1117('0x4d')](_0x3456ca[_0x1117('0x4b')][_0x1117('0x4f')],_[_0x1117('0x50')](_0x3456ca[_0x1117('0x4b')],[_0x1117('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x203eaf,null))['catch'](handleError(_0x203eaf,null));};exports['getContacts']=function(_0x25c0ed,_0x85a3c,_0x2c5896){var _0x122230={};var _0x448420={};var _0x5080b1;var _0x4eb8ba;return db[_0x1117('0x2a')][_0x1117('0x51')]({'where':{'id':_0x25c0ed[_0x1117('0x4c')]['id']}})[_0x1117('0x20')](handleEntityNotFound(_0x85a3c,null))[_0x1117('0x20')](function(_0x13def3){if(_0x13def3){_0x5080b1=_0x13def3;_0x448420['model']=_[_0x1117('0x2d')](db[_0x1117('0x4e')][_0x1117('0x41')]);_0x448420[_0x1117('0x2e')]=_['keys'](_0x25c0ed[_0x1117('0x2e')]);_0x448420['filters']=_['intersection'](_0x448420[_0x1117('0x2c')],_0x448420[_0x1117('0x2e')]);_0x122230[_0x1117('0x30')]=_[_0x1117('0x2f')](_0x448420[_0x1117('0x2c')],qs[_0x1117('0x31')](_0x25c0ed[_0x1117('0x2e')][_0x1117('0x31')]));_0x122230[_0x1117('0x30')]=_0x122230['attributes'][_0x1117('0x32')]?_0x122230['attributes']:_0x448420['model'];_0x122230[_0x1117('0x52')]=qs[_0x1117('0x35')](_0x25c0ed['query']['sort']);_0x122230[_0x1117('0x39')]=qs[_0x1117('0x37')](_[_0x1117('0x36')](_0x25c0ed[_0x1117('0x2e')],_0x448420['filters']));if(_0x25c0ed['query'][_0x1117('0x38')]){_0x122230[_0x1117('0x39')]=_[_0x1117('0x3a')](_0x122230[_0x1117('0x39')],{'$or':_[_0x1117('0x53')](_0x122230[_0x1117('0x30')],function(_0x2871c9){var _0x5376a1={};_0x5376a1[_0x2871c9]={'$like':'%'+_0x25c0ed[_0x1117('0x2e')][_0x1117('0x38')]+'%'};return _0x5376a1;})});}_0x122230=_[_0x1117('0x3a')]({},_0x122230,_0x25c0ed[_0x1117('0x3b')]);return _0x5080b1['getContacts'](_0x122230);}})[_0x1117('0x20')](function(_0x5198e5){if(_0x5198e5){_0x4eb8ba=_0x5198e5[_0x1117('0x32')];if(!_0x25c0ed[_0x1117('0x2e')][_0x1117('0x33')]('nolimit')){_0x122230[_0x1117('0x1d')]=qs['limit'](_0x25c0ed[_0x1117('0x2e')][_0x1117('0x1d')]);_0x122230['offset']=qs['offset'](_0x25c0ed[_0x1117('0x2e')][_0x1117('0x1b')]);}return _0x5080b1[_0x1117('0x54')](_0x122230);}})['then'](function(_0x58143d){if(_0x58143d){return _0x58143d?{'count':_0x4eb8ba,'rows':_0x58143d}:null;}})[_0x1117('0x20')](respondWithResult(_0x85a3c,null))[_0x1117('0x3f')](handleError(_0x85a3c,null));};
\ No newline at end of file
+var _0xbbef=['index','describe','model','keys','query','filters','intersection','attributes','length','nolimit','where','merge','map','filter','options','includeAll','include','CmCompany','rows','catch','params','rawAttributes','fields','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','findOne','order','sort','pick','hasOwnProperty','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send'];(function(_0x54a73a,_0x5f3b71){var _0x453a79=function(_0x356086){while(--_0x356086){_0x54a73a['push'](_0x54a73a['shift']());}};_0x453a79(++_0x5f3b71);}(_0xbbef,0x82));var _0xfbbe=function(_0x58da0a,_0x44ff15){_0x58da0a=_0x58da0a-0x0;var _0x255e3e=_0xbbef[_0x58da0a];return _0x255e3e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfbbe('0x0'));var jsonpatch=require(_0xfbbe('0x1'));var rp=require(_0xfbbe('0x2'));var moment=require(_0xfbbe('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfbbe('0x4'));var util=require(_0xfbbe('0x5'));var path=require(_0xfbbe('0x6'));var sox=require(_0xfbbe('0x7'));var csv=require(_0xfbbe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfbbe('0x9'));var squel=require(_0xfbbe('0xa'));var crypto=require('crypto');var jsforce=require(_0xfbbe('0xb'));var deskjs=require(_0xfbbe('0xc'));var toCsv=require(_0xfbbe('0x8'));var querystring=require(_0xfbbe('0xd'));var Papa=require('papaparse');var Redis=require(_0xfbbe('0xe'));var authService=require(_0xfbbe('0xf'));var qs=require(_0xfbbe('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbbe('0x11'));var logger=require(_0xfbbe('0x12'))(_0xfbbe('0x13'));var utils=require('../../config/utils');var config=require(_0xfbbe('0x14'));var licenseUtil=require(_0xfbbe('0x15'));var db=require(_0xfbbe('0x16'))['db'];function respondWithStatusCode(_0x5c90c9,_0xa5a7f2){_0xa5a7f2=_0xa5a7f2||0xcc;return function(_0x3da5ef){if(_0x3da5ef){return _0x5c90c9['sendStatus'](_0xa5a7f2);}return _0x5c90c9['status'](_0xa5a7f2)[_0xfbbe('0x17')]();};}function respondWithResult(_0x9cba0f,_0x3a9121){_0x3a9121=_0x3a9121||0xc8;return function(_0x36996c){if(_0x36996c){return _0x9cba0f[_0xfbbe('0x18')](_0x3a9121)['json'](_0x36996c);}};}function respondWithFilteredResult(_0x1ff678,_0x276882){return function(_0x490076){if(_0x490076){var _0x5b1724=typeof _0x276882['offset']===_0xfbbe('0x19')&&typeof _0x276882[_0xfbbe('0x1a')]===_0xfbbe('0x19');var _0x49096e=_0x490076[_0xfbbe('0x1b')];var _0x2ba3dd=_0x5b1724?0x0:_0x276882[_0xfbbe('0x1c')];var _0x50f9e4=_0x5b1724?_0x490076[_0xfbbe('0x1b')]:_0x276882[_0xfbbe('0x1c')]+_0x276882[_0xfbbe('0x1a')];var _0x397c67;if(_0x50f9e4>=_0x49096e){_0x50f9e4=_0x49096e;_0x397c67=0xc8;}else{_0x397c67=0xce;}_0x1ff678['status'](_0x397c67);return _0x1ff678[_0xfbbe('0x1d')](_0xfbbe('0x1e'),_0x2ba3dd+'-'+_0x50f9e4+'/'+_0x49096e)[_0xfbbe('0x1f')](_0x490076);}return null;};}function patchUpdates(_0x2989a8){return function(_0x4a7b3c){try{jsonpatch[_0xfbbe('0x20')](_0x4a7b3c,_0x2989a8,!![]);}catch(_0x4cc50a){return BPromise[_0xfbbe('0x21')](_0x4cc50a);}return _0x4a7b3c[_0xfbbe('0x22')]();};}function saveUpdates(_0x395740,_0x3730f2){return function(_0x5472cb){if(_0x5472cb){return _0x5472cb[_0xfbbe('0x23')](_0x395740)[_0xfbbe('0x24')](function(_0x112e14){return _0x112e14;});}return null;};}function removeEntity(_0x2314cb,_0x49f5d1){return function(_0x44f761){if(_0x44f761){return _0x44f761[_0xfbbe('0x25')]()['then'](function(){var _0x4994f0=_0x44f761[_0xfbbe('0x26')]({'plain':!![]});var _0x409a4c='Companies';return db[_0xfbbe('0x27')][_0xfbbe('0x25')]({'where':{'type':_0x409a4c,'resourceId':_0x4994f0['id']}})[_0xfbbe('0x24')](function(){return _0x44f761;});})[_0xfbbe('0x24')](function(){_0x2314cb[_0xfbbe('0x18')](0xcc)[_0xfbbe('0x17')]();});}};}function handleEntityNotFound(_0x39f2ee,_0x3ab778){return function(_0x233461){if(!_0x233461){_0x39f2ee[_0xfbbe('0x28')](0x194);}return _0x233461;};}function handleError(_0x33722e,_0xacb1ec){_0xacb1ec=_0xacb1ec||0x1f4;return function(_0x5ebb42){logger['error'](_0x5ebb42[_0xfbbe('0x29')]);if(_0x5ebb42[_0xfbbe('0x2a')]){delete _0x5ebb42['name'];}_0x33722e['status'](_0xacb1ec)[_0xfbbe('0x2b')](_0x5ebb42);};}exports[_0xfbbe('0x2c')]=function(_0x376ed6,_0x2dfeb8){var _0x3733c5={},_0x3b10ac={},_0xdd1131={'count':0x0,'rows':[]};return db['CmCompany'][_0xfbbe('0x2d')]()['then'](function(_0x17ea90){_0x3b10ac[_0xfbbe('0x2e')]=_[_0xfbbe('0x2f')](_0x17ea90);_0x3b10ac[_0xfbbe('0x30')]=_[_0xfbbe('0x2f')](_0x376ed6['query']);_0x3b10ac[_0xfbbe('0x31')]=_[_0xfbbe('0x32')](_0x3b10ac[_0xfbbe('0x2e')],_0x3b10ac[_0xfbbe('0x30')]);_0x3733c5[_0xfbbe('0x33')]=_[_0xfbbe('0x32')](_0x3b10ac['model'],qs['fields'](_0x376ed6['query']['fields']));_0x3733c5[_0xfbbe('0x33')]=_0x3733c5[_0xfbbe('0x33')][_0xfbbe('0x34')]?_0x3733c5[_0xfbbe('0x33')]:_0x3b10ac[_0xfbbe('0x2e')];if(!_0x376ed6[_0xfbbe('0x30')]['hasOwnProperty'](_0xfbbe('0x35'))){_0x3733c5['limit']=qs[_0xfbbe('0x1a')](_0x376ed6['query'][_0xfbbe('0x1a')]);_0x3733c5['offset']=qs['offset'](_0x376ed6[_0xfbbe('0x30')][_0xfbbe('0x1c')]);}_0x3733c5['order']=qs['sort'](_0x376ed6['query']['sort']);_0x3733c5[_0xfbbe('0x36')]=qs[_0xfbbe('0x31')](_['pick'](_0x376ed6[_0xfbbe('0x30')],_0x3b10ac[_0xfbbe('0x31')]),_0x17ea90);if(_0x376ed6['query']['filter']){_0x3733c5[_0xfbbe('0x36')]=_[_0xfbbe('0x37')](_0x3733c5[_0xfbbe('0x36')],{'$or':_[_0xfbbe('0x38')](_0x3733c5[_0xfbbe('0x33')],function(_0x5b71fd){var _0x2cf1ff={};_0x2cf1ff[_0x5b71fd]={'$like':'%'+_0x376ed6['query'][_0xfbbe('0x39')]+'%'};return _0x2cf1ff;})});}_0x3733c5=_[_0xfbbe('0x37')]({},_0x3733c5,_0x376ed6[_0xfbbe('0x3a')]);var _0x282054={'where':_0x3733c5[_0xfbbe('0x36')]};return db['CmCompany']['count'](_0x282054)[_0xfbbe('0x24')](function(_0x1542ee){_0xdd1131[_0xfbbe('0x1b')]=_0x1542ee;if(_0x376ed6[_0xfbbe('0x30')][_0xfbbe('0x3b')]){_0x3733c5[_0xfbbe('0x3c')]=[{'all':!![]}];}return db[_0xfbbe('0x3d')]['findAll'](_0x3733c5);})[_0xfbbe('0x24')](function(_0x11edd9){_0xdd1131[_0xfbbe('0x3e')]=_0x11edd9;return _0xdd1131;})[_0xfbbe('0x24')](respondWithFilteredResult(_0x2dfeb8,_0x3733c5))['catch'](handleError(_0x2dfeb8,null));})[_0xfbbe('0x3f')](handleError(_0x2dfeb8,null));};exports['show']=function(_0x582ae5,_0x51c0eb){var _0x2425d0={'raw':![],'where':{'id':_0x582ae5[_0xfbbe('0x40')]['id']}},_0x26a9d0={};_0x26a9d0[_0xfbbe('0x2e')]=_[_0xfbbe('0x2f')](db['CmCompany'][_0xfbbe('0x41')]);_0x26a9d0['query']=_[_0xfbbe('0x2f')](_0x582ae5[_0xfbbe('0x30')]);_0x26a9d0[_0xfbbe('0x31')]=_[_0xfbbe('0x32')](_0x26a9d0[_0xfbbe('0x2e')],_0x26a9d0['query']);_0x2425d0[_0xfbbe('0x33')]=_[_0xfbbe('0x32')](_0x26a9d0['model'],qs['fields'](_0x582ae5[_0xfbbe('0x30')][_0xfbbe('0x42')]));_0x2425d0[_0xfbbe('0x33')]=_0x2425d0[_0xfbbe('0x33')][_0xfbbe('0x34')]?_0x2425d0['attributes']:_0x26a9d0[_0xfbbe('0x2e')];if(_0x582ae5['query'][_0xfbbe('0x3b')]){_0x2425d0[_0xfbbe('0x3c')]=[{'all':!![]}];}_0x2425d0=_['merge']({},_0x2425d0,_0x582ae5[_0xfbbe('0x3a')]);return db['CmCompany'][_0xfbbe('0x43')](_0x2425d0)[_0xfbbe('0x24')](handleEntityNotFound(_0x51c0eb,null))['then'](respondWithResult(_0x51c0eb,null))[_0xfbbe('0x3f')](handleError(_0x51c0eb,null));};exports[_0xfbbe('0x44')]=function(_0x46ac9a,_0x3517d8){return db[_0xfbbe('0x3d')]['create'](_0x46ac9a['body'],{})['then'](function(_0x1a97d4){var _0x333979=_0x46ac9a[_0xfbbe('0x45')]['get']({'plain':!![]});if(!_0x333979)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x333979[_0xfbbe('0x46')]===_0xfbbe('0x45')){var _0x31a74a=_0x1a97d4[_0xfbbe('0x26')]({'plain':!![]});var _0x2b24c7='Companies';return db[_0xfbbe('0x47')][_0xfbbe('0x43')]({'where':{'name':_0x2b24c7,'userProfileId':_0x333979[_0xfbbe('0x48')]},'raw':!![]})['then'](function(_0xd66fad){if(_0xd66fad&&_0xd66fad[_0xfbbe('0x49')]===0x0){return db[_0xfbbe('0x27')][_0xfbbe('0x44')]({'name':_0x31a74a[_0xfbbe('0x2a')],'resourceId':_0x31a74a['id'],'type':_0xd66fad[_0xfbbe('0x2a')],'sectionId':_0xd66fad['id']},{})[_0xfbbe('0x24')](function(){return _0x1a97d4;});}else{return _0x1a97d4;}})['catch'](function(_0x5d47f8){logger[_0xfbbe('0x4a')](_0xfbbe('0x4b'),_0x5d47f8);throw _0x5d47f8;});}return _0x1a97d4;})[_0xfbbe('0x24')](respondWithResult(_0x3517d8,0xc9))['catch'](handleError(_0x3517d8,null));};exports[_0xfbbe('0x23')]=function(_0x26599d,_0x36482d){if(_0x26599d[_0xfbbe('0x4c')]['id']){delete _0x26599d['body']['id'];}return db[_0xfbbe('0x3d')][_0xfbbe('0x43')]({'where':{'id':_0x26599d[_0xfbbe('0x40')]['id']}})[_0xfbbe('0x24')](handleEntityNotFound(_0x36482d,null))[_0xfbbe('0x24')](saveUpdates(_0x26599d[_0xfbbe('0x4c')],null))['then'](respondWithResult(_0x36482d,null))[_0xfbbe('0x3f')](handleError(_0x36482d,null));};exports['destroy']=function(_0x463a32,_0x3ebef8){return db['CmCompany'][_0xfbbe('0x43')]({'where':{'id':_0x463a32[_0xfbbe('0x40')]['id']}})[_0xfbbe('0x24')](handleEntityNotFound(_0x3ebef8,null))[_0xfbbe('0x24')](removeEntity(_0x3ebef8,null))[_0xfbbe('0x3f')](handleError(_0x3ebef8,null));};exports[_0xfbbe('0x2d')]=function(_0xd6dcc0,_0x19de48){return db[_0xfbbe('0x3d')][_0xfbbe('0x2d')]()[_0xfbbe('0x24')](respondWithResult(_0x19de48,null))[_0xfbbe('0x3f')](handleError(_0x19de48,null));};exports[_0xfbbe('0x4d')]=function(_0x1d5e97,_0x49dc84,_0x12ca1e){return db[_0xfbbe('0x4e')][_0xfbbe('0x43')]({'where':{'id':_0x1d5e97[_0xfbbe('0x40')]['id']}})[_0xfbbe('0x24')](handleEntityNotFound(_0x49dc84,null))['then'](function(_0x2ddbfa){if(_0x2ddbfa){return _0x2ddbfa[_0xfbbe('0x4d')](_0x1d5e97[_0xfbbe('0x4c')][_0xfbbe('0x4f')],_[_0xfbbe('0x50')](_0x1d5e97[_0xfbbe('0x4c')],[_0xfbbe('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x49dc84,null))[_0xfbbe('0x3f')](handleError(_0x49dc84,null));};exports[_0xfbbe('0x51')]=function(_0x407e0b,_0x416b92,_0x1be856){var _0x4f0f76={};var _0x3dd67e={};var _0x38acfe;var _0x1ec3bd;return db[_0xfbbe('0x3d')][_0xfbbe('0x52')]({'where':{'id':_0x407e0b[_0xfbbe('0x40')]['id']}})[_0xfbbe('0x24')](handleEntityNotFound(_0x416b92,null))[_0xfbbe('0x24')](function(_0x5e9ec3){if(_0x5e9ec3){_0x38acfe=_0x5e9ec3;_0x3dd67e[_0xfbbe('0x2e')]=_[_0xfbbe('0x2f')](db[_0xfbbe('0x4e')][_0xfbbe('0x41')]);_0x3dd67e[_0xfbbe('0x30')]=_['keys'](_0x407e0b[_0xfbbe('0x30')]);_0x3dd67e[_0xfbbe('0x31')]=_[_0xfbbe('0x32')](_0x3dd67e[_0xfbbe('0x2e')],_0x3dd67e[_0xfbbe('0x30')]);_0x4f0f76['attributes']=_[_0xfbbe('0x32')](_0x3dd67e[_0xfbbe('0x2e')],qs['fields'](_0x407e0b['query'][_0xfbbe('0x42')]));_0x4f0f76[_0xfbbe('0x33')]=_0x4f0f76['attributes'][_0xfbbe('0x34')]?_0x4f0f76[_0xfbbe('0x33')]:_0x3dd67e[_0xfbbe('0x2e')];_0x4f0f76[_0xfbbe('0x53')]=qs['sort'](_0x407e0b[_0xfbbe('0x30')][_0xfbbe('0x54')]);_0x4f0f76['where']=qs[_0xfbbe('0x31')](_[_0xfbbe('0x55')](_0x407e0b[_0xfbbe('0x30')],_0x3dd67e[_0xfbbe('0x31')]));if(_0x407e0b[_0xfbbe('0x30')][_0xfbbe('0x39')]){_0x4f0f76[_0xfbbe('0x36')]=_['merge'](_0x4f0f76[_0xfbbe('0x36')],{'$or':_['map'](_0x4f0f76[_0xfbbe('0x33')],function(_0x5f241e){var _0x10e7fc={};_0x10e7fc[_0x5f241e]={'$like':'%'+_0x407e0b[_0xfbbe('0x30')][_0xfbbe('0x39')]+'%'};return _0x10e7fc;})});}_0x4f0f76=_['merge']({},_0x4f0f76,_0x407e0b[_0xfbbe('0x3a')]);return _0x38acfe['getContacts'](_0x4f0f76);}})[_0xfbbe('0x24')](function(_0x459c1e){if(_0x459c1e){_0x1ec3bd=_0x459c1e['length'];if(!_0x407e0b['query'][_0xfbbe('0x56')](_0xfbbe('0x35'))){_0x4f0f76[_0xfbbe('0x1a')]=qs['limit'](_0x407e0b[_0xfbbe('0x30')][_0xfbbe('0x1a')]);_0x4f0f76[_0xfbbe('0x1c')]=qs[_0xfbbe('0x1c')](_0x407e0b['query']['offset']);}return _0x38acfe[_0xfbbe('0x51')](_0x4f0f76);}})['then'](function(_0x55d93d){if(_0x55d93d){return _0x55d93d?{'count':_0x1ec3bd,'rows':_0x55d93d}:null;}})[_0xfbbe('0x24')](respondWithResult(_0x416b92,null))[_0xfbbe('0x3f')](handleError(_0x416b92,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 088be2d..10fffce 100644
--- a/server/api/cmCompany/cmCompany.model.js
+++ b/server/api/cmCompany/cmCompany.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1a58=['moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','CmCompany','cm_companies','lodash','../../config/logger'];(function(_0x5108f0,_0x3a8263){var _0x7157df=function(_0x442b03){while(--_0x442b03){_0x5108f0['push'](_0x5108f0['shift']());}};_0x7157df(++_0x3a8263);}(_0x1a58,0x12a));var _0x81a5=function(_0x410ccc,_0x53359f){_0x410ccc=_0x410ccc-0x0;var _0x3472f5=_0x1a58[_0x410ccc];return _0x3472f5;};'use strict';var _=require(_0x81a5('0x0'));var util=require('util');var logger=require(_0x81a5('0x1'))('api');var moment=require(_0x81a5('0x2'));var BPromise=require(_0x81a5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x81a5('0x4'));var rimraf=require(_0x81a5('0x5'));var config=require(_0x81a5('0x6'));var attributes=require(_0x81a5('0x7'));module['exports']=function(_0x19312c,_0x3def88){return _0x19312c['define'](_0x81a5('0x8'),attributes,{'tableName':_0x81a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2baf=['util','api','moment','bluebird','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0x422e79,_0x4e7a2f){var _0x4560ad=function(_0xeaa377){while(--_0xeaa377){_0x422e79['push'](_0x422e79['shift']());}};_0x4560ad(++_0x4e7a2f);}(_0x2baf,0xbc));var _0xf2ba=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0x2baf[_0x21205e];return _0x136ebb;};'use strict';var _=require(_0xf2ba('0x0'));var util=require(_0xf2ba('0x1'));var logger=require('../../config/logger')(_0xf2ba('0x2'));var moment=require(_0xf2ba('0x3'));var BPromise=require(_0xf2ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf2ba('0x5'));module['exports']=function(_0x3785f3,_0x3ea093){return _0x3785f3[_0xf2ba('0x6')](_0xf2ba('0x7'),attributes,{'tableName':_0xf2ba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 4dad229..15027ff 100644
--- a/server/api/cmCompany/cmCompany.rpc.js
+++ b/server/api/cmCompany/cmCompany.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9268=['../../config/utils','../../config/logger','../../config/environment','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0x9268,0x10b));var _0x8926=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0x9268[_0x1bb812];return _0x372adb;};'use strict';var _=require(_0x8926('0x0'));var util=require(_0x8926('0x1'));var moment=require(_0x8926('0x2'));var BPromise=require(_0x8926('0x3'));var rs=require(_0x8926('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8926('0x5'))['db'];var utils=require(_0x8926('0x6'));var logger=require(_0x8926('0x7'))('rpc');var config=require(_0x8926('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c2abd,_0x54f988,_0x20c783){return new BPromise(function(_0x31f2b6,_0x1215b9){return client[_0x8926('0x9')](_0x1c2abd,_0x20c783)[_0x8926('0xa')](function(_0xe2bb31){logger[_0x8926('0xb')](_0x8926('0xc'),_0x54f988,_0x8926('0xd'));logger[_0x8926('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x54f988,_0x8926('0xd'),JSON[_0x8926('0xf')](_0xe2bb31));if(_0xe2bb31[_0x8926('0x10')]){if(_0xe2bb31[_0x8926('0x10')][_0x8926('0x11')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x54f988,_0xe2bb31[_0x8926('0x10')][_0x8926('0x12')]);return _0x1215b9(_0xe2bb31[_0x8926('0x10')]['message']);}logger[_0x8926('0x10')](_0x8926('0xc'),_0x54f988,_0xe2bb31[_0x8926('0x10')][_0x8926('0x12')]);return _0x31f2b6(_0xe2bb31[_0x8926('0x10')][_0x8926('0x12')]);}else{logger['info'](_0x8926('0xc'),_0x54f988,_0x8926('0xd'));_0x31f2b6(_0xe2bb31[_0x8926('0x13')][_0x8926('0x12')]);}})[_0x8926('0x14')](function(_0x576674){logger[_0x8926('0x10')]('CmCompany,\x20%s,\x20%s',_0x54f988,_0x576674);_0x1215b9(_0x576674);});});}
\ No newline at end of file
+var _0x493c=['../../config/utils','../../config/environment','client','http','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0x42decb,_0x576852){var _0x14e3f2=function(_0x1ab70b){while(--_0x1ab70b){_0x42decb['push'](_0x42decb['shift']());}};_0x14e3f2(++_0x576852);}(_0x493c,0x13f));var _0xc493=function(_0x4c0ba0,_0x1f9a1b){_0x4c0ba0=_0x4c0ba0-0x0;var _0x10be64=_0x493c[_0x4c0ba0];return _0x10be64;};'use strict';var _=require(_0xc493('0x0'));var util=require(_0xc493('0x1'));var moment=require('moment');var BPromise=require(_0xc493('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc493('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc493('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc493('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc493('0x6')][_0xc493('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x9050f,_0x3b38a8,_0x311711){return new BPromise(function(_0x16d901,_0x49c485){return client[_0xc493('0x8')](_0x9050f,_0x311711)['then'](function(_0x12f1ff){logger[_0xc493('0x9')]('CmCompany,\x20%s,\x20%s',_0x3b38a8,_0xc493('0xa'));logger[_0xc493('0xb')](_0xc493('0xc'),_0x3b38a8,'request\x20sent',JSON[_0xc493('0xd')](_0x12f1ff));if(_0x12f1ff[_0xc493('0xe')]){if(_0x12f1ff[_0xc493('0xe')]['code']===0x1f4){logger[_0xc493('0xe')](_0xc493('0xf'),_0x3b38a8,_0x12f1ff[_0xc493('0xe')][_0xc493('0x10')]);return _0x49c485(_0x12f1ff[_0xc493('0xe')][_0xc493('0x10')]);}logger[_0xc493('0xe')](_0xc493('0xf'),_0x3b38a8,_0x12f1ff[_0xc493('0xe')][_0xc493('0x10')]);return _0x16d901(_0x12f1ff[_0xc493('0xe')][_0xc493('0x10')]);}else{logger[_0xc493('0x9')]('CmCompany,\x20%s,\x20%s',_0x3b38a8,_0xc493('0xa'));_0x16d901(_0x12f1ff[_0xc493('0x11')]['message']);}})[_0xc493('0x12')](function(_0x205fa3){logger[_0xc493('0xe')](_0xc493('0xf'),_0x3b38a8,_0x205fa3);_0x49c485(_0x205fa3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 8f876fe..f5ca38a 100644
--- a/server/api/cmCompany/index.js
+++ b/server/api/cmCompany/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9ab2=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id/contacts','post','create','addContacts','/:id','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ab2,0x192));var _0x29ab=function(_0x138c60,_0x437d9a){_0x138c60=_0x138c60-0x0;var _0xfc850b=_0x9ab2[_0x138c60];return _0xfc850b;};'use strict';var multer=require(_0x29ab('0x0'));var util=require(_0x29ab('0x1'));var path=require('path');var timeout=require(_0x29ab('0x2'));var express=require(_0x29ab('0x3'));var router=express[_0x29ab('0x4')]();var fs_extra=require(_0x29ab('0x5'));var auth=require(_0x29ab('0x6'));var interaction=require(_0x29ab('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x29ab('0x8')]('/',auth[_0x29ab('0x9')](),controller['index']);router['get'](_0x29ab('0xa'),auth[_0x29ab('0x9')](),controller['describe']);router[_0x29ab('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x29ab('0x8')](_0x29ab('0xb'),auth['isAuthenticated'](),controller['getContacts']);router[_0x29ab('0xc')]('/',auth[_0x29ab('0x9')](),controller[_0x29ab('0xd')]);router[_0x29ab('0xc')](_0x29ab('0xb'),auth[_0x29ab('0x9')](),controller[_0x29ab('0xe')]);router['put'](_0x29ab('0xf'),auth['isAuthenticated'](),controller[_0x29ab('0x10')]);router[_0x29ab('0x11')](_0x29ab('0xf'),auth[_0x29ab('0x9')](),controller[_0x29ab('0x12')]);module[_0x29ab('0x13')]=router;
\ No newline at end of file
+var _0x1094=['getContacts','create','post','update','destroy','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts'];(function(_0x4a8d77,_0x376df2){var _0xac3836=function(_0xadaa7e){while(--_0xadaa7e){_0x4a8d77['push'](_0x4a8d77['shift']());}};_0xac3836(++_0x376df2);}(_0x1094,0x101));var _0x4109=function(_0x3b4d1b,_0x12517b){_0x3b4d1b=_0x3b4d1b-0x0;var _0x5a2ffd=_0x1094[_0x3b4d1b];return _0x5a2ffd;};'use strict';var multer=require(_0x4109('0x0'));var util=require('util');var path=require(_0x4109('0x1'));var timeout=require('connect-timeout');var express=require(_0x4109('0x2'));var router=express['Router']();var fs_extra=require(_0x4109('0x3'));var auth=require(_0x4109('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4109('0x5'));var controller=require('./cmCompany.controller');router[_0x4109('0x6')]('/',auth[_0x4109('0x7')](),controller[_0x4109('0x8')]);router[_0x4109('0x6')](_0x4109('0x9'),auth['isAuthenticated'](),controller[_0x4109('0xa')]);router[_0x4109('0x6')](_0x4109('0xb'),auth[_0x4109('0x7')](),controller['show']);router['get'](_0x4109('0xc'),auth[_0x4109('0x7')](),controller[_0x4109('0xd')]);router['post']('/',auth[_0x4109('0x7')](),controller[_0x4109('0xe')]);router[_0x4109('0xf')](_0x4109('0xc'),auth[_0x4109('0x7')](),controller['addContacts']);router['put'](_0x4109('0xb'),auth[_0x4109('0x7')](),controller[_0x4109('0x10')]);router['delete'](_0x4109('0xb'),auth[_0x4109('0x7')](),controller[_0x4109('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 04e8bd5..54698c4 100644
--- a/server/api/cmContact/cmContact.attributes.js
+++ b/server/api/cmContact/cmContact.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b5e=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x4b96b4,_0x9041f1){var _0x10222b=function(_0x470cf7){while(--_0x470cf7){_0x4b96b4['push'](_0x4b96b4['shift']());}};_0x10222b(++_0x9041f1);}(_0x0b5e,0xd0));var _0xe0b5=function(_0x2a0078,_0x44254d){_0x2a0078=_0x2a0078-0x0;var _0x485cc2=_0x0b5e[_0x2a0078];return _0x485cc2;};'use strict';var _=require(_0xe0b5('0x0'));var Sequelize=require(_0xe0b5('0x1'));module[_0xe0b5('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0b5('0x3')]},'street':{'type':Sequelize[_0xe0b5('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe0b5('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe0b5('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xe0b5('0x3')]},'fax':{'type':Sequelize[_0xe0b5('0x3')]},'email':{'type':Sequelize[_0xe0b5('0x3')]},'url':{'type':Sequelize[_0xe0b5('0x3')]},'facebook':{'type':Sequelize[_0xe0b5('0x3')]},'fb_data':{'type':Sequelize[_0xe0b5('0x3')]},'twitter':{'type':Sequelize[_0xe0b5('0x3')]},'skype':{'type':Sequelize[_0xe0b5('0x3')]},'teams':{'type':Sequelize[_0xe0b5('0x3')]},'viber':{'type':Sequelize[_0xe0b5('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe0b5('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xe0b5('0x3')]},'priority':{'type':Sequelize[_0xe0b5('0x5')](0x2)[_0xe0b5('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe0b5('0x7')],'defaultValue':Sequelize[_0xe0b5('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xf168=['UNSIGNED','NOW','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xf168,0x11a));var _0x8f16=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xf168[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x8f16('0x0'));var Sequelize=require('sequelize');module[_0x8f16('0x1')]={'firstName':{'type':Sequelize[_0x8f16('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8f16('0x2')]},'postalCode':{'type':Sequelize[_0x8f16('0x2')]},'city':{'type':Sequelize[_0x8f16('0x2')]},'country':{'type':Sequelize[_0x8f16('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8f16('0x2')]},'description':{'type':Sequelize[_0x8f16('0x3')]},'phone':{'type':Sequelize[_0x8f16('0x2')]},'mobile':{'type':Sequelize[_0x8f16('0x2')]},'fax':{'type':Sequelize[_0x8f16('0x2')]},'email':{'type':Sequelize[_0x8f16('0x2')]},'url':{'type':Sequelize[_0x8f16('0x2')]},'facebook':{'type':Sequelize[_0x8f16('0x2')]},'fb_data':{'type':Sequelize[_0x8f16('0x2')]},'twitter':{'type':Sequelize[_0x8f16('0x2')]},'skype':{'type':Sequelize[_0x8f16('0x2')]},'teams':{'type':Sequelize[_0x8f16('0x2')]},'viber':{'type':Sequelize[_0x8f16('0x2')]},'line':{'type':Sequelize[_0x8f16('0x2')]},'wechat':{'type':Sequelize[_0x8f16('0x2')]},'telegram':{'type':Sequelize[_0x8f16('0x2')]},'UserId':{'type':Sequelize[_0x8f16('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8f16('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8f16('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8f16('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x8f16('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index e860084..0871e65 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb95=['ids','setAdditionalPhones','all','ContactItemType','OrderBy','item_types','ItemTypeId','items','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','fromContactId','CmContactId','rescheduleAdditionalPhones','hopperId','getHoppers','rawAttributes','order','ContactId','includeAll','include','getHopperHistories','rows','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','split','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','socket_timestamp','File\x20uploaded\x20correctly!','upload','createReadStream','parse','meta','import','User','agent','No\x20ListId\x20specified','binding','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','mail','chat','sms','fax','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','voice','uniqueid','source','destination','callerid','endtime','duration','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','Website','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','key','Owner','Tags','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','threadId','findAndCountAll','reverse','slice','moment','bluebird','util','lodash','papaparse','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','json','undefined','offset','count','limit','set','Content-Range','then','status','sendStatus','error','name','send','index','describe','user','catch','destroy','CmContact','find','params','tags','keys','length','startsWith','cf_','columnName','query','analytics','CmCustomField','displayName','alias','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','findAll','from','get','mergeWith','isArray','join','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','create','isNil','dialTimezone','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','push','where','ListId','findOrCreate','contact','show','Tag','color','tag','Phones','ItemType','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','timezones','isEmpty','table','setFields','toParam','text','phone','filters','intersection','model','attributes','fields','sort','pick','filter','options','nolimit','setTags','findOne'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xeb95,0x176));var _0x5eb9=function(_0x3adcf4,_0x5d78f8){_0x3adcf4=_0x3adcf4-0x0;var _0x495984=_0xeb95[_0x3adcf4];return _0x495984;};'use strict';var moment=require(_0x5eb9('0x0'));var BPromise=require(_0x5eb9('0x1'));var util=require(_0x5eb9('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x5eb9('0x3'));var squel=require('squel');var Papa=require(_0x5eb9('0x4'));var Redis=require('ioredis');var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x5eb9('0x5'));var shared=require('../../config/environment/shared');var db=require(_0x5eb9('0x6'))['db'];config[_0x5eb9('0x7')]=_[_0x5eb9('0x8')](config['redis'],{'host':_0x5eb9('0x9'),'port':0x18eb});var socket=require(_0x5eb9('0xa'))(new Redis(config[_0x5eb9('0x7')]));require(_0x5eb9('0xb'))['register'](socket);function respondWithResult(_0x38d0ee,_0x3aa7e6){_0x3aa7e6=_0x3aa7e6||0xc8;return function(_0x4c5149){if(_0x4c5149){return _0x38d0ee['status'](_0x3aa7e6)[_0x5eb9('0xc')](_0x4c5149);}};}function respondWithFilteredResult(_0x5f1f31,_0x4f0618){return function(_0x443969){if(_0x443969){var _0x319bb3=typeof _0x4f0618['offset']==='undefined'&&typeof _0x4f0618['limit']===_0x5eb9('0xd');var _0x55969d=_0x443969['count'];var _0x1782f3=_0x319bb3?0x0:_0x4f0618[_0x5eb9('0xe')];var _0x3cff1c=_0x319bb3?_0x443969[_0x5eb9('0xf')]:_0x4f0618[_0x5eb9('0xe')]+_0x4f0618[_0x5eb9('0x10')];var _0x228803;if(_0x3cff1c>=_0x55969d){_0x3cff1c=_0x55969d;_0x228803=0xc8;}else{_0x228803=0xce;}_0x5f1f31['status'](_0x228803);return _0x5f1f31[_0x5eb9('0x11')](_0x5eb9('0x12'),_0x1782f3+'-'+_0x3cff1c+'/'+_0x55969d)[_0x5eb9('0xc')](_0x443969);}return null;};}function saveUpdates(_0x11ee6){return function(_0x669600){if(_0x669600){return _0x669600['update'](_0x11ee6)[_0x5eb9('0x13')](function(_0x570c74){return _0x570c74;});}return null;};}function removeEntity(_0x2381ff){return function(_0x346437){if(_0x346437){return _0x346437['destroy']()['then'](function(){_0x2381ff[_0x5eb9('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c6689){return function(_0x456f14){if(!_0x456f14){_0x9c6689[_0x5eb9('0x15')](0x194);}return _0x456f14;};}function handleError(_0x3539cc,_0x7b8cb3){_0x7b8cb3=_0x7b8cb3||0x1f4;return function(_0x13bd39){logger[_0x5eb9('0x16')](_0x13bd39['stack']);if(_0x13bd39[_0x5eb9('0x17')]){delete _0x13bd39[_0x5eb9('0x17')];}_0x3539cc[_0x5eb9('0x14')](_0x7b8cb3)[_0x5eb9('0x18')](_0x13bd39);};}exports[_0x5eb9('0x19')]=function(_0x27d9d6,_0x2daf82){var _0x329aab={};return contacts[_0x5eb9('0x1a')]()['then'](function(_0x3e3cb7){_0x329aab=qs['getOptions'](_0x3e3cb7,_0x27d9d6);return contacts['findAll'](_0x27d9d6['query'],_0x27d9d6[_0x5eb9('0x1b')],_0x329aab,_0x3e3cb7);})[_0x5eb9('0x13')](respondWithFilteredResult(_0x2daf82,_0x329aab))[_0x5eb9('0x1c')](handleError(_0x2daf82,null));};exports[_0x5eb9('0x1d')]=function(_0x2c89f2,_0x4c0405){return db[_0x5eb9('0x1e')][_0x5eb9('0x1f')]({'where':{'id':_0x2c89f2[_0x5eb9('0x20')]['id']}})[_0x5eb9('0x13')](handleEntityNotFound(_0x4c0405,null))['then'](removeEntity(_0x4c0405,null))[_0x5eb9('0x1c')](handleError(_0x4c0405,null));};exports[_0x5eb9('0x1a')]=function(_0x1898a6,_0x44ce75){return db[_0x5eb9('0x1e')][_0x5eb9('0x1a')]()['then'](function(_0x155282){delete _0x155282[_0x5eb9('0x21')];for(var _0x38d416=0x0;_0x38d416
','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','randomstring','path','util','node-tnef','email','value','address','anonymous','generate','@xcally.com','head','name','indexOf','split','length','join','Anonymous','pop','html','test','replace','includes','attachments','forEach','filename','_SRC','_IMG','\x20[Attachment:\x20','body','textAsHtml'];(function(_0x1b41e1,_0x52d286){var _0x35279d=function(_0x585ae1){while(--_0x585ae1){_0x1b41e1['push'](_0x1b41e1['shift']());}};_0x35279d(++_0x52d286);}(_0xbe77,0x14e));var _0x7be7=function(_0x22bd55,_0x253d99){_0x22bd55=_0x22bd55-0x0;var _0x529e6d=_0xbe77[_0x22bd55];return _0x529e6d;};'use strict';var _=require(_0x7be7('0x0'));var moment=require('moment');var random=require(_0x7be7('0x1'));var fs=require('fs');var path=require(_0x7be7('0x2'));var util=require(_0x7be7('0x3'));var tnef=require(_0x7be7('0x4'));var logger=require('../../../config/logger')(_0x7be7('0x5'));var config=require('../../../config/environment');function getAddress(_0x38de4e){var _0x188e30=_['head'](_0x38de4e[_0x7be7('0x6')]);return _0x188e30&&_0x188e30[_0x7be7('0x7')]?_0x188e30[_0x7be7('0x7')]:_0x7be7('0x8')+random[_0x7be7('0x9')](0x6)+_0x7be7('0xa');}function getFirstName(_0x33034c){var _0x4ede00=_[_0x7be7('0xb')](_0x33034c[_0x7be7('0x6')]);if(_0x4ede00&&_0x4ede00[_0x7be7('0xc')]){if(_0x4ede00[_0x7be7('0xc')]==_0x4ede00[_0x7be7('0x7')]){return _0x4ede00['name']['substring'](0x0,_0x4ede00[_0x7be7('0xc')][_0x7be7('0xd')]('@'));}var _0x3dfd7d=_0x4ede00[_0x7be7('0xc')][_0x7be7('0xe')](/\s+/);return _0x3dfd7d[_0x7be7('0xf')]>0x1?_0x3dfd7d['slice'](0x0,-0x1)[_0x7be7('0x10')]('\x20'):_0x4ede00[_0x7be7('0xc')];}return _0x7be7('0x11');}function getLastName(_0x2ed08d){var _0x1196d9=_[_0x7be7('0xb')](_0x2ed08d['value']);if(_0x1196d9&&_0x1196d9['name']){var _0x43d2fb=_0x1196d9[_0x7be7('0xc')]['split'](/\s+/);return _0x43d2fb[_0x7be7('0xf')]>0x1?_0x43d2fb[_0x7be7('0x12')]():'';}return'';}function getMails(_0x4ead22,_0xd09bc){var _0x7be6fd='';for(var _0x5581a5=0x0;_0x5581a5<_0xd09bc[_0x7be7('0x6')][_0x7be7('0xf')];_0x5581a5+=0x1){if(_0xd09bc['value'][_0x5581a5]['address']!==_0x4ead22){if(!_['isEmpty'](_0x7be6fd)){_0x7be6fd+=',';}_0x7be6fd+=_0xd09bc[_0x7be7('0x6')][_0x5581a5][_0x7be7('0xc')]||_0xd09bc[_0x7be7('0x6')][_0x5581a5][_0x7be7('0x7')]||'';_0x7be6fd+='\x20<';_0x7be6fd+=_0xd09bc[_0x7be7('0x6')][_0x5581a5]['address']?_0xd09bc[_0x7be7('0x6')][_0x5581a5][_0x7be7('0x7')]:_0x7be7('0x8')+random[_0x7be7('0x9')](0x6)+'@xcally.com';_0x7be6fd+='>';}}return _0x7be6fd;}function parseEmail(_0x3659df,_0x3ad305,_0x148c7d){if(_0x3ad305[_0x7be7('0x13')]){var _0xd50312=/