From: Andrea Amorese
Date: Tue, 10 Aug 2021 15:48:16 +0000 (+0200)
Subject: Built motion from commit 4b1d1c16.|2.5.33
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=350d4b31dd1a965989e5ed9ff1198b79032f0e10;p=motion2.git
Built motion from commit 4b1d1c16.|2.5.33
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index e0ad44f..5ab6d0d 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-08-10T15:24:50.802Z",
+ "time": "2021-08-10T15:36:55.605Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 89c5067..5477467 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-08-10T15:24:50.802Z",
+ "time": "2021-08-10T15:36:55.605Z",
"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 5add016..8a5539f 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 _0x4c00=['action','STRING','contactManager','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x213881,_0x5375eb){var _0x2f6527=function(_0x4b4bbf){while(--_0x4b4bbf){_0x213881['push'](_0x213881['shift']());}};_0x2f6527(++_0x5375eb);}(_0x4c00,0x1cc));var _0x04c0=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x4c00[_0x67f95e];return _0x538f5a;};'use strict';var Sequelize=require(_0x04c0('0x0'));module[_0x04c0('0x1')]={'name':{'type':Sequelize[_0x04c0('0x2')],'get':function(_0x26780b){return this[_0x04c0('0x3')](_0x04c0('0x4'));}},'action':{'type':Sequelize[_0x04c0('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x04c0('0x6'),'integration','motionbar',_0x04c0('0x7'),_0x04c0('0x8'),'browser',_0x04c0('0x9'),_0x04c0('0xa')]],'msg':_0x04c0('0xb')}},'comment':_0x04c0('0xb')},'data1':{'type':Sequelize[_0x04c0('0x5')](0x1000),'comment':_0x04c0('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x04c0('0xd')},'data3':{'type':Sequelize[_0x04c0('0x5')](0x1000),'comment':_0x04c0('0xe')},'data4':{'type':Sequelize[_0x04c0('0x5')](0x1000)},'data5':{'type':Sequelize[_0x04c0('0x5')](0x1000)},'data6':{'type':Sequelize[_0x04c0('0x5')]},'data7':{'type':Sequelize[_0x04c0('0xf')]}};
\ No newline at end of file
+var _0xd696=['bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','exports','VIRTUAL','action','contactManager','integration','motionbar','jscripty','urlForward','browser'];(function(_0x3f5b62,_0x5cc596){var _0x1c6ea4=function(_0x953815){while(--_0x953815){_0x3f5b62['push'](_0x3f5b62['shift']());}};_0x1c6ea4(++_0x5cc596);}(_0xd696,0x1d6));var _0x6d69=function(_0x310ca4,_0x195e91){_0x310ca4=_0x310ca4-0x0;var _0x303c6f=_0xd696[_0x310ca4];return _0x303c6f;};'use strict';var Sequelize=require(_0x6d69('0x0'));module[_0x6d69('0x1')]={'name':{'type':Sequelize[_0x6d69('0x2')],'get':function(_0x42d6f3){return this['getDataValue'](_0x6d69('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x6d69('0x4'),_0x6d69('0x5'),_0x6d69('0x6'),_0x6d69('0x7'),_0x6d69('0x8'),_0x6d69('0x9'),_0x6d69('0xa'),'script']],'msg':_0x6d69('0xb')}},'comment':_0x6d69('0xb')},'data1':{'type':Sequelize[_0x6d69('0xc')](0x1000),'comment':_0x6d69('0xd')},'data2':{'type':Sequelize[_0x6d69('0xc')](0x1000),'comment':_0x6d69('0xe')},'data3':{'type':Sequelize[_0x6d69('0xc')](0x1000),'comment':_0x6d69('0xf')},'data4':{'type':Sequelize[_0x6d69('0xc')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x6d69('0xc')]},'data7':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 35b1004..a0a69ce 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 _0x874e=['send','update','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','sendStatus','stack','name'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x874e,0x109));var _0xe874=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x874e[_0xdd2bfa];return _0x55397e;};'use strict';var emlformat=require(_0xe874('0x0'));var rimraf=require(_0xe874('0x1'));var zipdir=require(_0xe874('0x2'));var jsonpatch=require(_0xe874('0x3'));var rp=require('request-promise');var moment=require(_0xe874('0x4'));var BPromise=require(_0xe874('0x5'));var Mustache=require(_0xe874('0x6'));var util=require(_0xe874('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe874('0x8'));var ejs=require(_0xe874('0x9'));var fs=require('fs');var fs_extra=require(_0xe874('0xa'));var _=require(_0xe874('0xb'));var squel=require(_0xe874('0xc'));var crypto=require(_0xe874('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe874('0xe'));var toCsv=require(_0xe874('0x8'));var querystring=require(_0xe874('0xf'));var Papa=require(_0xe874('0x10'));var Redis=require('ioredis');var authService=require(_0xe874('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe874('0x12'));var logger=require(_0xe874('0x13'))(_0xe874('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe874('0x15'))['db'];function respondWithStatusCode(_0x2f878d,_0x822b6b){_0x822b6b=_0x822b6b||0xcc;return function(_0x6de07a){if(_0x6de07a){return _0x2f878d['sendStatus'](_0x822b6b);}return _0x2f878d['status'](_0x822b6b)[_0xe874('0x16')]();};}function respondWithResult(_0x4ce41a,_0x2fb84c){_0x2fb84c=_0x2fb84c||0xc8;return function(_0x1db77e){if(_0x1db77e){return _0x4ce41a[_0xe874('0x17')](_0x2fb84c)[_0xe874('0x18')](_0x1db77e);}};}function respondWithFilteredResult(_0x25e4a3,_0x24a0c7){return function(_0x2277a0){if(_0x2277a0){var _0xb3238f=typeof _0x24a0c7[_0xe874('0x19')]===_0xe874('0x1a')&&typeof _0x24a0c7[_0xe874('0x1b')]==='undefined';var _0x4dd5dd=_0x2277a0[_0xe874('0x1c')];var _0x358333=_0xb3238f?0x0:_0x24a0c7[_0xe874('0x19')];var _0x981775=_0xb3238f?_0x2277a0[_0xe874('0x1c')]:_0x24a0c7['offset']+_0x24a0c7[_0xe874('0x1b')];var _0x135595;if(_0x981775>=_0x4dd5dd){_0x981775=_0x4dd5dd;_0x135595=0xc8;}else{_0x135595=0xce;}_0x25e4a3[_0xe874('0x17')](_0x135595);return _0x25e4a3['set'](_0xe874('0x1d'),_0x358333+'-'+_0x981775+'/'+_0x4dd5dd)[_0xe874('0x18')](_0x2277a0);}return null;};}function patchUpdates(_0x3e3ed0){return function(_0x1b5c69){try{jsonpatch[_0xe874('0x1e')](_0x1b5c69,_0x3e3ed0,!![]);}catch(_0x41050b){return BPromise['reject'](_0x41050b);}return _0x1b5c69[_0xe874('0x1f')]();};}function saveUpdates(_0x40342e,_0x515fb8){return function(_0x54dd45){if(_0x54dd45){return _0x54dd45['update'](_0x40342e)[_0xe874('0x20')](function(_0x173dcb){return _0x173dcb;});}return null;};}function removeEntity(_0x15f890,_0x36f89c){return function(_0x2fce79){if(_0x2fce79){return _0x2fce79['destroy']()[_0xe874('0x20')](function(){_0x15f890[_0xe874('0x17')](0xcc)[_0xe874('0x16')]();});}};}function handleEntityNotFound(_0xa61603,_0x5c1a02){return function(_0x579f53){if(!_0x579f53){_0xa61603[_0xe874('0x21')](0x194);}return _0x579f53;};}function handleError(_0x43fad7,_0x119851){_0x119851=_0x119851||0x1f4;return function(_0x42d5fb){logger['error'](_0x42d5fb[_0xe874('0x22')]);if(_0x42d5fb[_0xe874('0x23')]){delete _0x42d5fb['name'];}_0x43fad7[_0xe874('0x17')](_0x119851)[_0xe874('0x24')](_0x42d5fb);};}exports[_0xe874('0x25')]=function(_0x2c5b84,_0x197167){if(_0x2c5b84[_0xe874('0x26')]['id']){delete _0x2c5b84[_0xe874('0x26')]['id'];}return db[_0xe874('0x27')][_0xe874('0x28')]({'where':{'id':_0x2c5b84['params']['id']}})[_0xe874('0x20')](handleEntityNotFound(_0x197167,null))['then'](saveUpdates(_0x2c5b84[_0xe874('0x26')],null))[_0xe874('0x20')](respondWithResult(_0x197167,null))[_0xe874('0x29')](handleError(_0x197167,null));};exports['destroy']=function(_0x52f56a,_0x55942c){return db[_0xe874('0x27')][_0xe874('0x28')]({'where':{'id':_0x52f56a[_0xe874('0x2a')]['id']}})[_0xe874('0x20')](handleEntityNotFound(_0x55942c,null))[_0xe874('0x20')](removeEntity(_0x55942c,null))[_0xe874('0x29')](handleError(_0x55942c,null));};
\ No newline at end of file
+var _0x9f96=['send','body','Action','find','params','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','update','then','destroy','error','stack','name'];(function(_0x3e7122,_0x40e109){var _0x13480f=function(_0x499da4){while(--_0x499da4){_0x3e7122['push'](_0x3e7122['shift']());}};_0x13480f(++_0x40e109);}(_0x9f96,0xef));var _0x69f9=function(_0x209aa2,_0x23094d){_0x209aa2=_0x209aa2-0x0;var _0x1526ad=_0x9f96[_0x209aa2];return _0x1526ad;};'use strict';var emlformat=require(_0x69f9('0x0'));var rimraf=require(_0x69f9('0x1'));var zipdir=require(_0x69f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x69f9('0x3'));var BPromise=require(_0x69f9('0x4'));var Mustache=require('mustache');var util=require(_0x69f9('0x5'));var path=require(_0x69f9('0x6'));var sox=require(_0x69f9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69f9('0x8'));var squel=require(_0x69f9('0x9'));var crypto=require(_0x69f9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x69f9('0xb'));var toCsv=require(_0x69f9('0xc'));var querystring=require(_0x69f9('0xd'));var Papa=require('papaparse');var Redis=require(_0x69f9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x69f9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x69f9('0x10'));var utils=require(_0x69f9('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x69f9('0x12'))['db'];function respondWithStatusCode(_0x35b908,_0x57c084){_0x57c084=_0x57c084||0xcc;return function(_0x3f0dd4){if(_0x3f0dd4){return _0x35b908[_0x69f9('0x13')](_0x57c084);}return _0x35b908['status'](_0x57c084)[_0x69f9('0x14')]();};}function respondWithResult(_0x3e532d,_0x2ada5e){_0x2ada5e=_0x2ada5e||0xc8;return function(_0x285dd8){if(_0x285dd8){return _0x3e532d[_0x69f9('0x15')](_0x2ada5e)[_0x69f9('0x16')](_0x285dd8);}};}function respondWithFilteredResult(_0x4c7bd3,_0x21a6b0){return function(_0x4ab28c){if(_0x4ab28c){var _0x8c3b76=typeof _0x21a6b0[_0x69f9('0x17')]===_0x69f9('0x18')&&typeof _0x21a6b0[_0x69f9('0x19')]===_0x69f9('0x18');var _0x3f2153=_0x4ab28c['count'];var _0x273bd8=_0x8c3b76?0x0:_0x21a6b0[_0x69f9('0x17')];var _0x396d16=_0x8c3b76?_0x4ab28c[_0x69f9('0x1a')]:_0x21a6b0[_0x69f9('0x17')]+_0x21a6b0['limit'];var _0x154c0;if(_0x396d16>=_0x3f2153){_0x396d16=_0x3f2153;_0x154c0=0xc8;}else{_0x154c0=0xce;}_0x4c7bd3[_0x69f9('0x15')](_0x154c0);return _0x4c7bd3['set']('Content-Range',_0x273bd8+'-'+_0x396d16+'/'+_0x3f2153)[_0x69f9('0x16')](_0x4ab28c);}return null;};}function patchUpdates(_0x35694f){return function(_0x36e4f7){try{jsonpatch[_0x69f9('0x1b')](_0x36e4f7,_0x35694f,!![]);}catch(_0x488ffe){return BPromise['reject'](_0x488ffe);}return _0x36e4f7['save']();};}function saveUpdates(_0x1a0e86,_0xfa0afe){return function(_0x5be662){if(_0x5be662){return _0x5be662[_0x69f9('0x1c')](_0x1a0e86)[_0x69f9('0x1d')](function(_0x339cde){return _0x339cde;});}return null;};}function removeEntity(_0x4699a6,_0x366295){return function(_0x145271){if(_0x145271){return _0x145271[_0x69f9('0x1e')]()[_0x69f9('0x1d')](function(){_0x4699a6['status'](0xcc)[_0x69f9('0x14')]();});}};}function handleEntityNotFound(_0x25317f,_0x29ebd6){return function(_0x54a95b){if(!_0x54a95b){_0x25317f[_0x69f9('0x13')](0x194);}return _0x54a95b;};}function handleError(_0x21d876,_0x40cfb0){_0x40cfb0=_0x40cfb0||0x1f4;return function(_0x1c45db){logger[_0x69f9('0x1f')](_0x1c45db[_0x69f9('0x20')]);if(_0x1c45db[_0x69f9('0x21')]){delete _0x1c45db[_0x69f9('0x21')];}_0x21d876[_0x69f9('0x15')](_0x40cfb0)[_0x69f9('0x22')](_0x1c45db);};}exports['update']=function(_0x27f05a,_0x41c4c4){if(_0x27f05a[_0x69f9('0x23')]['id']){delete _0x27f05a[_0x69f9('0x23')]['id'];}return db[_0x69f9('0x24')][_0x69f9('0x25')]({'where':{'id':_0x27f05a[_0x69f9('0x26')]['id']}})[_0x69f9('0x1d')](handleEntityNotFound(_0x41c4c4,null))[_0x69f9('0x1d')](saveUpdates(_0x27f05a[_0x69f9('0x23')],null))[_0x69f9('0x1d')](respondWithResult(_0x41c4c4,null))['catch'](handleError(_0x41c4c4,null));};exports[_0x69f9('0x1e')]=function(_0x57aba3,_0x1fd214){return db[_0x69f9('0x24')][_0x69f9('0x25')]({'where':{'id':_0x57aba3[_0x69f9('0x26')]['id']}})['then'](handleEntityNotFound(_0x1fd214,null))[_0x69f9('0x1d')](removeEntity(_0x1fd214,null))['catch'](handleError(_0x1fd214,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 7742dc6..36c4feb 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 _0xf3f2=['bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment'];(function(_0x79ed02,_0x35045f){var _0x801a1=function(_0x11bb9c){while(--_0x11bb9c){_0x79ed02['push'](_0x79ed02['shift']());}};_0x801a1(++_0x35045f);}(_0xf3f2,0x140));var _0x2f3f=function(_0x20117b,_0x453b59){_0x20117b=_0x20117b-0x0;var _0x271dc6=_0xf3f2[_0x20117b];return _0x271dc6;};'use strict';var _=require(_0x2f3f('0x0'));var util=require(_0x2f3f('0x1'));var logger=require(_0x2f3f('0x2'))(_0x2f3f('0x3'));var moment=require(_0x2f3f('0x4'));var BPromise=require(_0x2f3f('0x5'));var rp=require(_0x2f3f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f3f('0x7'));var config=require(_0x2f3f('0x8'));var attributes=require(_0x2f3f('0x9'));module[_0x2f3f('0xa')]=function(_0x361aff,_0x47d0d4){return _0x361aff['define'](_0x2f3f('0xb'),attributes,{'tableName':_0x2f3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48b6=['tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./action.attributes','exports','define','Action'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48b6,0x1bb));var _0x648b=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x48b6[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0x648b('0x0'));var util=require(_0x648b('0x1'));var logger=require(_0x648b('0x2'))(_0x648b('0x3'));var moment=require(_0x648b('0x4'));var BPromise=require(_0x648b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x648b('0x6'));var rimraf=require(_0x648b('0x7'));var config=require('../../config/environment');var attributes=require(_0x648b('0x8'));module[_0x648b('0x9')]=function(_0x180e64,_0xeaaf5a){return _0x180e64[_0x648b('0xa')](_0x648b('0xb'),attributes,{'tableName':_0x648b('0xc'),'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 8a82702..d07f797 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 _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(_0x4b5fb9,_0x1772fd){var _0x149e32=function(_0x4a5bfe){while(--_0x4a5bfe){_0x4b5fb9['push'](_0x4b5fb9['shift']());}};_0x149e32(++_0x1772fd);}(_0xabce,0x103));var _0xeabc=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xabce[_0x4bb66f];return _0xf2772f;};'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
+var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0xf494,0x1c6));var _0x4f49=function(_0x1db5d9,_0x53c693){_0x1db5d9=_0x1db5d9-0x0;var _0x4bf4b4=_0xf494[_0x1db5d9];return _0x4bf4b4;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 53ffb08..225d9be 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 _0x92ee=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2b8d99,_0x452592){var _0x9938c1=function(_0x58453b){while(--_0x58453b){_0x2b8d99['push'](_0x2b8d99['shift']());}};_0x9938c1(++_0x452592);}(_0x92ee,0x126));var _0xe92e=function(_0x1b3a09,_0x20c774){_0x1b3a09=_0x1b3a09-0x0;var _0x357bb8=_0x92ee[_0x1b3a09];return _0x357bb8;};'use strict';var multer=require(_0xe92e('0x0'));var util=require('util');var path=require(_0xe92e('0x1'));var timeout=require(_0xe92e('0x2'));var express=require(_0xe92e('0x3'));var router=express['Router']();var fs_extra=require(_0xe92e('0x4'));var auth=require(_0xe92e('0x5'));var interaction=require(_0xe92e('0x6'));var config=require(_0xe92e('0x7'));var controller=require(_0xe92e('0x8'));router[_0xe92e('0x9')](_0xe92e('0xa'),auth['isAuthenticated'](),controller[_0xe92e('0xb')]);router[_0xe92e('0xc')](_0xe92e('0xa'),auth['isAuthenticated'](),controller[_0xe92e('0xd')]);module[_0xe92e('0xe')]=router;
\ No newline at end of file
+var _0x042c=['./action.controller','put','isAuthenticated','update','/:id','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5dddf3,_0x3318e5){var _0x1d491c=function(_0x13563a){while(--_0x13563a){_0x5dddf3['push'](_0x5dddf3['shift']());}};_0x1d491c(++_0x3318e5);}(_0x042c,0xf0));var _0xc042=function(_0x2dea7d,_0x2fc0d8){_0x2dea7d=_0x2dea7d-0x0;var _0x13beed=_0x042c[_0x2dea7d];return _0x13beed;};'use strict';var multer=require(_0xc042('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc042('0x1'));var express=require(_0xc042('0x2'));var router=express[_0xc042('0x3')]();var fs_extra=require(_0xc042('0x4'));var auth=require(_0xc042('0x5'));var interaction=require(_0xc042('0x6'));var config=require('../../config/environment');var controller=require(_0xc042('0x7'));router[_0xc042('0x8')]('/:id',auth[_0xc042('0x9')](),controller[_0xc042('0xa')]);router['delete'](_0xc042('0xb'),auth[_0xc042('0x9')](),controller[_0xc042('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 43dd5d1..9ec0b29 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 _0x5d58=['TEXT','STRING'];(function(_0x337df7,_0x5ccce7){var _0x4b519a=function(_0x4ca772){while(--_0x4ca772){_0x337df7['push'](_0x337df7['shift']());}};_0x4b519a(++_0x5ccce7);}(_0x5d58,0x187));var _0x85d5=function(_0x5388fb,_0x546415){_0x5388fb=_0x5388fb-0x0;var _0x5ea57a=_0x5d58[_0x5388fb];return _0x5ea57a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x186244,_0x412e23){var _0xc2a1e2=function(_0x402ba1){while(--_0x402ba1){_0x186244['push'](_0x186244['shift']());}};_0xc2a1e2(++_0x412e23);}(_0xeff8,0x186));var _0x8eff=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xeff8[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f1153a6..e944495 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 _0xf24a=['join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','ROUND(%s)','IS\x20NOT\x20EMPTY','AnalyticMetric','metric','output','web','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','sendStatus','error','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview'];(function(_0x4af21a,_0x584374){var _0x4f2331=function(_0x373abe){while(--_0x373abe){_0x4af21a['push'](_0x4af21a['shift']());}};_0x4f2331(++_0x584374);}(_0xf24a,0xf5));var _0xaf24=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf24a[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf24('0x0'));var zipdir=require(_0xaf24('0x1'));var jsonpatch=require(_0xaf24('0x2'));var rp=require(_0xaf24('0x3'));var moment=require(_0xaf24('0x4'));var BPromise=require(_0xaf24('0x5'));var Mustache=require(_0xaf24('0x6'));var util=require(_0xaf24('0x7'));var path=require(_0xaf24('0x8'));var sox=require('sox');var csv=require(_0xaf24('0x9'));var ejs=require(_0xaf24('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf24('0xb'));var squel=require('squel');var crypto=require(_0xaf24('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaf24('0xd'));var toCsv=require(_0xaf24('0x9'));var querystring=require('querystring');var Papa=require(_0xaf24('0xe'));var Redis=require(_0xaf24('0xf'));var authService=require(_0xaf24('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaf24('0x11'));var hardwareService=require(_0xaf24('0x12'));var logger=require(_0xaf24('0x13'))('api');var utils=require(_0xaf24('0x14'));var config=require(_0xaf24('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf24('0x16'))['db'];var dbH=require(_0xaf24('0x16'))[_0xaf24('0x17')];function respondWithStatusCode(_0x34f1bb,_0x14e8c0){_0x14e8c0=_0x14e8c0||0xcc;return function(_0x95ea8e){if(_0x95ea8e){return _0x34f1bb['sendStatus'](_0x14e8c0);}return _0x34f1bb[_0xaf24('0x18')](_0x14e8c0)[_0xaf24('0x19')]();};}function respondWithResult(_0x104a80,_0x4aecd1){_0x4aecd1=_0x4aecd1||0xc8;return function(_0x4aea1b){if(_0x4aea1b){return _0x104a80[_0xaf24('0x18')](_0x4aecd1)[_0xaf24('0x1a')](_0x4aea1b);}};}function respondWithFilteredResult(_0x35e724,_0x5d14f3){return function(_0x47f5f6){if(_0x47f5f6){var _0x358083=typeof _0x5d14f3[_0xaf24('0x1b')]===_0xaf24('0x1c')&&typeof _0x5d14f3[_0xaf24('0x1d')]===_0xaf24('0x1c');var _0x151546=_0x47f5f6[_0xaf24('0x1e')];var _0x216d59=_0x358083?0x0:_0x5d14f3['offset'];var _0x4c5565=_0x358083?_0x47f5f6[_0xaf24('0x1e')]:_0x5d14f3[_0xaf24('0x1b')]+_0x5d14f3[_0xaf24('0x1d')];var _0x4f7a0b;if(_0x4c5565>=_0x151546){_0x4c5565=_0x151546;_0x4f7a0b=0xc8;}else{_0x4f7a0b=0xce;}_0x35e724['status'](_0x4f7a0b);return _0x35e724[_0xaf24('0x1f')](_0xaf24('0x20'),_0x216d59+'-'+_0x4c5565+'/'+_0x151546)[_0xaf24('0x1a')](_0x47f5f6);}return null;};}function patchUpdates(_0x255f9f){return function(_0x5e96ec){try{jsonpatch[_0xaf24('0x21')](_0x5e96ec,_0x255f9f,!![]);}catch(_0x9e0527){return BPromise[_0xaf24('0x22')](_0x9e0527);}return _0x5e96ec[_0xaf24('0x23')]();};}function saveUpdates(_0xc7f826,_0x1298d5){return function(_0x3cc1cb){if(_0x3cc1cb){return _0x3cc1cb[_0xaf24('0x24')](_0xc7f826)[_0xaf24('0x25')](function(_0x389b41){return _0x389b41;});}return null;};}function removeEntity(_0x1eb12c,_0x3ebcc6){return function(_0x478550){if(_0x478550){return _0x478550[_0xaf24('0x26')]()[_0xaf24('0x25')](function(){var _0x66c68d=_0x478550[_0xaf24('0x27')]({'plain':!![]});var _0x418bda='CustomReports';return db['UserProfileResource'][_0xaf24('0x26')]({'where':{'type':_0x418bda,'resourceId':_0x66c68d['id']}})['then'](function(){return _0x478550;});})[_0xaf24('0x25')](function(){_0x1eb12c[_0xaf24('0x18')](0xcc)[_0xaf24('0x19')]();});}};}function handleEntityNotFound(_0x23ec38,_0x3ec28c){return function(_0x21eb8c){if(!_0x21eb8c){_0x23ec38[_0xaf24('0x28')](0x194);}return _0x21eb8c;};}function handleError(_0x16814b,_0x3f3513){_0x3f3513=_0x3f3513||0x1f4;return function(_0x1876d6){logger[_0xaf24('0x29')](_0x1876d6['stack']);if(_0x1876d6['name']){delete _0x1876d6[_0xaf24('0x2a')];}_0x16814b[_0xaf24('0x18')](_0x3f3513)['send'](_0x1876d6);};}exports[_0xaf24('0x2b')]=function(_0x5a4d20,_0x2069c9){var _0x5d2166={},_0x2001d4={},_0x4a01f3={'count':0x0,'rows':[]};var _0x9649bc=_[_0xaf24('0x2c')](db[_0xaf24('0x2d')][_0xaf24('0x2e')],function(_0x5e7c59){return{'name':_0x5e7c59[_0xaf24('0x2f')],'type':_0x5e7c59['type'][_0xaf24('0x30')]};});_0x2001d4[_0xaf24('0x31')]=_[_0xaf24('0x2c')](_0x9649bc,_0xaf24('0x2a'));_0x2001d4[_0xaf24('0x32')]=_[_0xaf24('0x33')](_0x5a4d20[_0xaf24('0x32')]);_0x2001d4[_0xaf24('0x34')]=_[_0xaf24('0x35')](_0x2001d4[_0xaf24('0x31')],_0x2001d4[_0xaf24('0x32')]);_0x5d2166['attributes']=_[_0xaf24('0x35')](_0x2001d4['model'],qs['fields'](_0x5a4d20[_0xaf24('0x32')]['fields']));_0x5d2166[_0xaf24('0x36')]=_0x5d2166[_0xaf24('0x36')][_0xaf24('0x37')]?_0x5d2166['attributes']:_0x2001d4['model'];if(!_0x5a4d20[_0xaf24('0x32')][_0xaf24('0x38')](_0xaf24('0x39'))){_0x5d2166[_0xaf24('0x1d')]=qs[_0xaf24('0x1d')](_0x5a4d20[_0xaf24('0x32')][_0xaf24('0x1d')]);_0x5d2166[_0xaf24('0x1b')]=qs[_0xaf24('0x1b')](_0x5a4d20['query'][_0xaf24('0x1b')]);}_0x5d2166[_0xaf24('0x3a')]=qs['sort'](_0x5a4d20[_0xaf24('0x32')][_0xaf24('0x3b')]);_0x5d2166['where']=qs[_0xaf24('0x34')](_[_0xaf24('0x3c')](_0x5a4d20[_0xaf24('0x32')],_0x2001d4[_0xaf24('0x34')]),_0x9649bc);if(_0x5a4d20['query']['filter']){_0x5d2166[_0xaf24('0x3d')]=_[_0xaf24('0x3e')](_0x5d2166[_0xaf24('0x3d')],{'$or':_[_0xaf24('0x2c')](_0x9649bc,function(_0x3f7b28){if(_0x3f7b28[_0xaf24('0x3f')]!==_0xaf24('0x40')){var _0x162097={};_0x162097[_0x3f7b28[_0xaf24('0x2a')]]={'$like':'%'+_0x5a4d20[_0xaf24('0x32')]['filter']+'%'};return _0x162097;}})});}_0x5d2166=_['merge']({},_0x5d2166,_0x5a4d20[_0xaf24('0x41')]);var _0x3c918d={'where':_0x5d2166[_0xaf24('0x3d')]};return db[_0xaf24('0x2d')][_0xaf24('0x1e')](_0x3c918d)[_0xaf24('0x25')](function(_0x2f659c){_0x4a01f3['count']=_0x2f659c;if(_0x5a4d20['query'][_0xaf24('0x42')]){_0x5d2166[_0xaf24('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xaf24('0x44')](_0x5d2166);})[_0xaf24('0x25')](function(_0x499778){_0x4a01f3[_0xaf24('0x45')]=_0x499778;return _0x4a01f3;})[_0xaf24('0x25')](respondWithFilteredResult(_0x2069c9,_0x5d2166))[_0xaf24('0x46')](handleError(_0x2069c9,null));};exports[_0xaf24('0x47')]=function(_0xe8c4db,_0x49b06a){var _0x1b468a={'raw':![],'where':{'id':_0xe8c4db[_0xaf24('0x48')]['id']}},_0x4f40ff={};_0x4f40ff[_0xaf24('0x31')]=_[_0xaf24('0x33')](db[_0xaf24('0x2d')]['rawAttributes']);_0x4f40ff[_0xaf24('0x32')]=_[_0xaf24('0x33')](_0xe8c4db[_0xaf24('0x32')]);_0x4f40ff[_0xaf24('0x34')]=_[_0xaf24('0x35')](_0x4f40ff[_0xaf24('0x31')],_0x4f40ff[_0xaf24('0x32')]);_0x1b468a[_0xaf24('0x36')]=_['intersection'](_0x4f40ff[_0xaf24('0x31')],qs[_0xaf24('0x49')](_0xe8c4db[_0xaf24('0x32')]['fields']));_0x1b468a['attributes']=_0x1b468a[_0xaf24('0x36')][_0xaf24('0x37')]?_0x1b468a[_0xaf24('0x36')]:_0x4f40ff[_0xaf24('0x31')];if(_0xe8c4db[_0xaf24('0x32')][_0xaf24('0x42')]){_0x1b468a[_0xaf24('0x43')]=[{'all':!![]}];}_0x1b468a=_[_0xaf24('0x3e')]({},_0x1b468a,_0xe8c4db[_0xaf24('0x41')]);return db[_0xaf24('0x2d')][_0xaf24('0x4a')](_0x1b468a)[_0xaf24('0x25')](handleEntityNotFound(_0x49b06a,null))['then'](respondWithResult(_0x49b06a,null))[_0xaf24('0x46')](handleError(_0x49b06a,null));};exports[_0xaf24('0x4b')]=function(_0x4f9e16,_0x669b5e){return db[_0xaf24('0x2d')]['create'](_0x4f9e16['body'],{})[_0xaf24('0x25')](function(_0x12ebe3){var _0x586311=_0x4f9e16['user'][_0xaf24('0x27')]({'plain':!![]});if(!_0x586311)throw new Error(_0xaf24('0x4c'));if(_0x586311[_0xaf24('0x4d')]===_0xaf24('0x4e')){var _0x21d03c=_0x12ebe3[_0xaf24('0x27')]({'plain':!![]});var _0xae32a=_0xaf24('0x4f');return db[_0xaf24('0x50')]['find']({'where':{'name':_0xae32a,'userProfileId':_0x586311[_0xaf24('0x51')]},'raw':!![]})[_0xaf24('0x25')](function(_0x37fb97){if(_0x37fb97&&_0x37fb97[_0xaf24('0x52')]===0x0){return db['UserProfileResource'][_0xaf24('0x4b')]({'name':_0x21d03c[_0xaf24('0x2a')],'resourceId':_0x21d03c['id'],'type':_0xaf24('0x53'),'sectionId':_0x37fb97['id']},{})[_0xaf24('0x25')](function(){return _0x12ebe3;});}else{return _0x12ebe3;}})[_0xaf24('0x46')](function(_0x1cd123){logger[_0xaf24('0x29')](_0xaf24('0x54'),_0x1cd123);throw _0x1cd123;});}return _0x12ebe3;})['then'](respondWithResult(_0x669b5e,0xc9))[_0xaf24('0x46')](handleError(_0x669b5e,null));};exports[_0xaf24('0x24')]=function(_0x2f2863,_0x2dbfdc){if(_0x2f2863[_0xaf24('0x55')]['id']){delete _0x2f2863['body']['id'];}return db[_0xaf24('0x2d')][_0xaf24('0x4a')]({'where':{'id':_0x2f2863[_0xaf24('0x48')]['id']}})['then'](handleEntityNotFound(_0x2dbfdc,null))[_0xaf24('0x25')](saveUpdates(_0x2f2863[_0xaf24('0x55')],null))['then'](respondWithResult(_0x2dbfdc,null))[_0xaf24('0x46')](handleError(_0x2dbfdc,null));};exports[_0xaf24('0x26')]=function(_0x42a620,_0x24af3b){return db[_0xaf24('0x2d')]['find']({'where':{'id':_0x42a620[_0xaf24('0x48')]['id']}})[_0xaf24('0x25')](handleEntityNotFound(_0x24af3b,null))[_0xaf24('0x25')](removeEntity(_0x24af3b,null))[_0xaf24('0x46')](handleError(_0x24af3b,null));};exports[_0xaf24('0x56')]=function(_0x294657,_0x121d06){var _0x476db9=0xa;var _0x1debe0=[_0xaf24('0x57'),_0xaf24('0x58'),_0xaf24('0x59'),_0xaf24('0x5a')];var _0x41efbd={'SUM':_0xaf24('0x5b'),'COUNT':_0xaf24('0x5c'),'COUNT DISTINCT':_0xaf24('0x5d'),'MAX':_0xaf24('0x5e'),'MIN':_0xaf24('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xaf24('0x60')};var _0x3d877a={'SEC_TO_TIME':_0xaf24('0x61'),'DATE':_0xaf24('0x62'),'HOUR':_0xaf24('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5ba29b=function(_0x5a078b){return!_[_0xaf24('0x64')]([_0xaf24('0x65'),_0xaf24('0x66'),_0xaf24('0x67'),'IS\x20NOT\x20EMPTY'],_0x5a078b);};var _0xe52dd9=function(_0x1f62d7){if(!_0x1f62d7||!_0x1f62d7[_0xaf24('0x68')][_0xaf24('0x37')]){return'';}for(var _0x16d12d='(',_0xb5d7a4=0x0;_0xb5d7a4<_0x1f62d7[_0xaf24('0x68')][_0xaf24('0x37')];_0xb5d7a4+=0x1){_0xb5d7a4>0x0&&(_0x16d12d+='\x20'+_0x1f62d7[_0xaf24('0x69')]+'\x20');_0x16d12d+=_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6a')]?_0xe52dd9(_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6a')]):_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6b')]+'\x20'+_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4]['condition']+(_0x5ba29b(_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6c')])?'\x20'+_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6d')]:'');}return _0x16d12d+')';};var _0x211bc3={'where':{'id':_0x294657['params']['id']}},_0x3036e9,_0x5de122,_0xd3e34e,_0x589593,_0x53b23b;_0x211bc3=_[_0xaf24('0x3e')]({},_0x211bc3,_0x294657[_0xaf24('0x41')]);return db[_0xaf24('0x2d')][_0xaf24('0x4a')](_0x211bc3)[_0xaf24('0x25')](function(_0x5175a2){if(_0x5175a2){_0x3036e9=_0x5175a2;return _0x5175a2[_0xaf24('0x6e')]();}return null;})['then'](function(_0x267d2e){if(_0x267d2e){if(!_0x267d2e[_0xaf24('0x37')]){throw new db[(_0xaf24('0x6f'))][(_0xaf24('0x70'))](_0xaf24('0x71'),0x193);}_0x5de122=_0x267d2e;return db['AnalyticMetric'][_0xaf24('0x44')]({'raw':!![]});}return null;})[_0xaf24('0x25')](function(_0x170f77){if(_0x170f77){_0xd3e34e=_[_0xaf24('0x72')](_0x170f77,'id');var _0xbae24e;var _0x2c3833=squel[_0xaf24('0x73')]();_0x2c3833[_0xaf24('0x74')](_0x3036e9[_0xaf24('0x75')]);for(var _0x443550=0x0;_0x443550<_0x5de122[_0xaf24('0x37')];_0x443550+=0x1){_0xbae24e=_0x5de122[_0x443550][_0xaf24('0x76')]?_0xd3e34e[_0x5de122[_0x443550][_0xaf24('0x76')]]['metric']:_0x5de122[_0x443550][_0xaf24('0x6b')];_0xbae24e=_0x5de122[_0x443550][_0xaf24('0x77')]?_[_0xaf24('0x78')](_0x41efbd[_0x5de122[_0x443550]['function']],'%s',_0xbae24e):_0xbae24e;_0xbae24e=_0x5de122[_0x443550][_0xaf24('0x79')]?_[_0xaf24('0x78')](_0x3d877a[_0x5de122[_0x443550][_0xaf24('0x79')]],'%s',_0xbae24e):_0xbae24e;if(_0x5de122[_0x443550][_0xaf24('0x7a')]){_0x2c3833[_0xaf24('0x6a')](_0xbae24e);}_0x5de122[_0x443550][_0xaf24('0x7b')]&&_0x2c3833['order'](_0xbae24e,_0x5de122[_0x443550][_0xaf24('0x7b')]===_0xaf24('0x7c')?![]:!![]);_0x2c3833[_0xaf24('0x6b')](_0xbae24e,_0x5de122[_0x443550][_0xaf24('0x7d')]||_0xbae24e);}if(_0x3036e9[_0xaf24('0x7e')]){_0x3036e9[_0xaf24('0x7e')]=JSON[_0xaf24('0x7f')](_0x3036e9[_0xaf24('0x7e')]);for(var _0x5ea3b3=0x0;_0x5ea3b3<_0x3036e9['joins'][_0xaf24('0x37')];_0x5ea3b3+=0x1){if(_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x3f')]&&_[_0xaf24('0x64')](_0x1debe0,_0x3036e9['joins'][_0x5ea3b3][_0xaf24('0x3f')])&&_0x3036e9['joins'][_0x5ea3b3][_0xaf24('0x80')]&&_0x3036e9['joins'][_0x5ea3b3][_0xaf24('0x81')]&&_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3]['foreignKey']){_0x2c3833[_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x3f')]](_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x81')],null,util[_0xaf24('0x79')](_0xaf24('0x82'),_0x3036e9[_0xaf24('0x75')],_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x80')],_0x3036e9['joins'][_0x5ea3b3][_0xaf24('0x81')],_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x83')]));}}}if(_0x3036e9['conditions']){_0x3036e9[_0xaf24('0x84')]=JSON['parse'](_0x3036e9[_0xaf24('0x84')]);_0x2c3833[_0xaf24('0x3d')](_0xe52dd9(_0x3036e9[_0xaf24('0x84')][_0xaf24('0x6a')]));}_0x53b23b=_0x2c3833[_0xaf24('0x85')]();_0x2c3833[_0xaf24('0x1d')](_0x476db9);_0x2c3833['offset'](0x0);logger[_0xaf24('0x86')]('Limited\x20Query:',_0x2c3833[_0xaf24('0x87')]());return dbH[_0xaf24('0x88')][_0xaf24('0x32')](_0x2c3833[_0xaf24('0x87')](),{'type':dbH['sequelize'][_0xaf24('0x89')][_0xaf24('0x8a')]});}})[_0xaf24('0x25')](respondWithResult(_0x121d06,null))[_0xaf24('0x46')](handleError(_0x121d06,null));};function runReport(_0xaa0e7d,_0x5bcbcf,_0x2e4f11){var _0xfd6b67=_0x5bcbcf[_0xaf24('0x2a')];var _0x22200f=0xa;var _0x4dea40=[_0xaf24('0x57'),_0xaf24('0x58'),'right_join','cross_join'];var _0x383cb3={'SUM':_0xaf24('0x5b'),'COUNT':_0xaf24('0x5c'),'COUNT DISTINCT':_0xaf24('0x5d'),'MAX':_0xaf24('0x5e'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xaf24('0x8b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x13b8ed={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xaf24('0x62'),'HOUR':_0xaf24('0x63'),'ROUND':_0xaf24('0x8c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4e1c28=function(_0x28e967){return!_[_0xaf24('0x64')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xaf24('0x67'),_0xaf24('0x8d')],_0x28e967);};var _0x214a79=function(_0x16cf37){if(!_0x16cf37||!_0x16cf37['rules'][_0xaf24('0x37')]){return'';}for(var _0x3b3882='(',_0x3620d4=0x0;_0x3620d4<_0x16cf37[_0xaf24('0x68')][_0xaf24('0x37')];_0x3620d4+=0x1){_0x3620d4>0x0&&(_0x3b3882+='\x20'+_0x16cf37[_0xaf24('0x69')]+'\x20');_0x3b3882+=_0x16cf37[_0xaf24('0x68')][_0x3620d4][_0xaf24('0x6a')]?_0x214a79(_0x16cf37[_0xaf24('0x68')][_0x3620d4][_0xaf24('0x6a')]):_0x16cf37[_0xaf24('0x68')][_0x3620d4][_0xaf24('0x6b')]+'\x20'+_0x16cf37[_0xaf24('0x68')][_0x3620d4]['condition']+(_0x4e1c28(_0x16cf37[_0xaf24('0x68')][_0x3620d4]['condition'])?'\x20'+_0x16cf37[_0xaf24('0x68')][_0x3620d4]['value']:'');}return _0x3b3882+')';};var _0xbfd56c={'where':{'id':_0xaa0e7d['id']}},_0x58adb8,_0x2710bb,_0x173d23,_0x2a773e,_0x15baaf;_0xbfd56c=_[_0xaf24('0x3e')]({},_0xbfd56c,_0x2e4f11);return db[_0xaf24('0x2d')][_0xaf24('0x4a')](_0xbfd56c)[_0xaf24('0x25')](function(_0x31ed68){if(_0x31ed68){_0x58adb8=_0x31ed68;return _0x31ed68[_0xaf24('0x6e')]();}return null;})[_0xaf24('0x25')](function(_0x5ac55c){if(_0x5ac55c){if(!_0x5ac55c['length']){throw new db[(_0xaf24('0x6f'))][(_0xaf24('0x70'))](_0xaf24('0x71'),0x193);}_0x2710bb=_0x5ac55c;return db[_0xaf24('0x8e')][_0xaf24('0x44')]({'raw':!![]});}return null;})[_0xaf24('0x25')](function(_0x3410cf){if(_0x3410cf){_0x173d23=_['keyBy'](_0x3410cf,'id');var _0x2ad727;var _0x2f7f0d=squel['select']();_0x2f7f0d['from'](_0x58adb8[_0xaf24('0x75')]);for(var _0x3c5d5e=0x0;_0x3c5d5e<_0x2710bb[_0xaf24('0x37')];_0x3c5d5e+=0x1){_0x2ad727=_0x2710bb[_0x3c5d5e][_0xaf24('0x76')]?_0x173d23[_0x2710bb[_0x3c5d5e][_0xaf24('0x76')]][_0xaf24('0x8f')]:_0x2710bb[_0x3c5d5e][_0xaf24('0x6b')];_0x2ad727=_0x2710bb[_0x3c5d5e]['function']?_[_0xaf24('0x78')](_0x383cb3[_0x2710bb[_0x3c5d5e]['function']],'%s',_0x2ad727):_0x2ad727;_0x2ad727=_0x2710bb[_0x3c5d5e]['format']?_[_0xaf24('0x78')](_0x13b8ed[_0x2710bb[_0x3c5d5e]['format']],'%s',_0x2ad727):_0x2ad727;if(_0x2710bb[_0x3c5d5e]['groupBy']){_0x2f7f0d[_0xaf24('0x6a')](_0x2ad727);}_0x2710bb[_0x3c5d5e]['orderBy']&&_0x2f7f0d[_0xaf24('0x3a')](_0x2ad727,_0x2710bb[_0x3c5d5e][_0xaf24('0x7b')]===_0xaf24('0x7c')?![]:!![]);_0x2f7f0d[_0xaf24('0x6b')](_0x2ad727,_0x2710bb[_0x3c5d5e]['alias']||_0x2ad727);}if(_0x58adb8[_0xaf24('0x7e')]){_0x58adb8[_0xaf24('0x7e')]=JSON[_0xaf24('0x7f')](_0x58adb8[_0xaf24('0x7e')]);for(var _0x44d00b=0x0;_0x44d00b<_0x58adb8['joins'][_0xaf24('0x37')];_0x44d00b+=0x1){if(_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x3f')]&&_[_0xaf24('0x64')](_0x4dea40,_0x58adb8[_0xaf24('0x7e')][_0x44d00b]['type'])&&_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x80')]&&_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x81')]&&_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x83')]){_0x2f7f0d[_0x58adb8['joins'][_0x44d00b][_0xaf24('0x3f')]](_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x81')],null,util[_0xaf24('0x79')](_0xaf24('0x82'),_0x58adb8['table'],_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x80')],_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x81')],_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x83')]));}}}if(_0x58adb8['conditions']){_0x58adb8['conditions']=JSON[_0xaf24('0x7f')](_0x58adb8[_0xaf24('0x84')]);_0x2f7f0d[_0xaf24('0x3d')](_0x214a79(_0x58adb8['conditions'][_0xaf24('0x6a')]));}_0x15baaf=_0x2f7f0d[_0xaf24('0x85')]();_0x2f7f0d['limit'](_0x22200f);_0x2f7f0d[_0xaf24('0x1b')](0x0);return;}})[_0xaf24('0x25')](function(){if(_0x5bcbcf[_0xaf24('0x90')]===_0xaf24('0x91')){return null;}var _0x4574f7=_['merge'](_0x5bcbcf,{'name':_0x5bcbcf['fullPath']||_0x5bcbcf[_0xaf24('0x2a')]||_0x58adb8[_0xaf24('0x2a')],'basename':_0xfd6b67,'savename':util[_0xaf24('0x79')](_0xaf24('0x92'),_0x5bcbcf[_0xaf24('0x2a')]||_0x58adb8[_0xaf24('0x2a')],require(_0xaf24('0x93'))[_0xaf24('0x94')](0x4),_0x5bcbcf[_0xaf24('0x90')]||'csv'),'reportId':_0x58adb8['id'],'reportType':_0xaf24('0x95')});return db[_0xaf24('0x96')][_0xaf24('0x4b')](_0x4574f7,{'raw':!![]});})[_0xaf24('0x25')](function(_0x59eca9){if(_0x58adb8[_0xaf24('0x75')]==='cdr'){_0x15baaf[_0xaf24('0x3d')](_0x58adb8['table']+_0xaf24('0x97'),_0x5bcbcf['startDate'],_0x5bcbcf['endDate']);}else{_0x15baaf[_0xaf24('0x3d')](_0x58adb8['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5bcbcf[_0xaf24('0x98')],_0x5bcbcf[_0xaf24('0x99')]);}if(_0x59eca9){logger[_0xaf24('0x9a')](_0xaf24('0x9b'),_0x15baaf['toString']());require('child_process')['fork'](path[_0xaf24('0x57')](__dirname,_0xaf24('0x9c'),_0x59eca9['output']),[_0x59eca9['id'],_0x15baaf['toString'](),path[_0xaf24('0x57')](__dirname,_0xaf24('0x9d'),_0x59eca9[_0xaf24('0x9e')]),_0xfd6b67]);return _0x59eca9;}else{var _0x567585=squel['select']();_0x567585['from']('('+_0x15baaf['toString']()+')',_0xaf24('0x9f'));_0x567585[_0xaf24('0x6b')](_0xaf24('0xa0'),_0xaf24('0x1e'));_0x15baaf[_0xaf24('0x1d')](_0x5bcbcf[_0xaf24('0x1d')]||_0x22200f);_0x15baaf['offset'](_0x5bcbcf[_0xaf24('0x1b')]||0x0);return dbH[_0xaf24('0x88')][_0xaf24('0x32')](_0x567585[_0xaf24('0x87')](),{'type':dbH[_0xaf24('0x88')][_0xaf24('0x89')]['SELECT']})[_0xaf24('0x25')](function(_0x2f0f56){if(!_0x2f0f56['length']){_0x2a773e=0x0;}else{_0x2a773e=_0x2f0f56[0x0][_0xaf24('0x1e')]||0x0;}return dbH[_0xaf24('0x88')][_0xaf24('0x32')](_0x15baaf[_0xaf24('0x87')](),{'type':dbH[_0xaf24('0x88')][_0xaf24('0x89')][_0xaf24('0x8a')]});})[_0xaf24('0x25')](function(_0x11fcaf){return{'rows':_0x11fcaf||[],'count':_0x2a773e};});}});}exports['run']=function(_0x35ff50,_0x263f51){return runReport(_0x35ff50[_0xaf24('0x48')],_0x35ff50['query'],_0x35ff50[_0xaf24('0x41')])[_0xaf24('0x25')](respondWithResult(_0x263f51,null))['catch'](handleError(_0x263f51,null));};exports[_0xaf24('0xa1')]=runReport;exports[_0xaf24('0x32')]=function(_0x2344af,_0x3b4d8f){var _0x5ce8e6=0xa;var _0x5af126=[_0xaf24('0x57'),_0xaf24('0x58'),_0xaf24('0x59'),_0xaf24('0x5a')];var _0x179ee9={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xaf24('0x5e'),'MIN':_0xaf24('0x5f'),'AVG':_0xaf24('0xa2'),'GROUP_CONCAT':_0xaf24('0x8b'),'GROUP_CONCAT ASC':_0xaf24('0xa3'),'GROUP_CONCAT DESC':_0xaf24('0x60')};var _0x416380={'SEC_TO_TIME':_0xaf24('0x61'),'DATE':'DATE(%s)','HOUR':_0xaf24('0x63'),'ROUND':_0xaf24('0x8c'),'UNIX_TIMESTAMP':_0xaf24('0xa4')};var _0x3c2041=function(_0x26a220){return!_[_0xaf24('0x64')]([_0xaf24('0x65'),_0xaf24('0x66'),_0xaf24('0x67'),_0xaf24('0x8d')],_0x26a220);};var _0x2ae2d9=function(_0x5ae012){if(!_0x5ae012||!_0x5ae012[_0xaf24('0x68')]['length']){return'';}for(var _0x2ccf58='(',_0x10eea6=0x0;_0x10eea6<_0x5ae012['rules'][_0xaf24('0x37')];_0x10eea6+=0x1){_0x10eea6>0x0&&(_0x2ccf58+='\x20'+_0x5ae012[_0xaf24('0x69')]+'\x20');_0x2ccf58+=_0x5ae012['rules'][_0x10eea6][_0xaf24('0x6a')]?_0x2ae2d9(_0x5ae012[_0xaf24('0x68')][_0x10eea6][_0xaf24('0x6a')]):_0x5ae012[_0xaf24('0x68')][_0x10eea6][_0xaf24('0x6b')]+'\x20'+_0x5ae012[_0xaf24('0x68')][_0x10eea6][_0xaf24('0x6c')]+(_0x3c2041(_0x5ae012['rules'][_0x10eea6][_0xaf24('0x6c')])?'\x20'+_0x5ae012[_0xaf24('0x68')][_0x10eea6][_0xaf24('0x6d')]:'');}return _0x2ccf58+')';};var _0x499209={'where':{'id':_0x2344af[_0xaf24('0x48')]['id']}},_0x1652ae,_0x1b7f02,_0x47f66a,_0x56311e,_0x58ec26;_0x499209=_[_0xaf24('0x3e')]({},_0x499209,_0x2344af[_0xaf24('0x41')]);return db[_0xaf24('0x2d')][_0xaf24('0x4a')](_0x499209)[_0xaf24('0x25')](function(_0x309b43){if(_0x309b43){_0x1652ae=_0x309b43;return _0x309b43[_0xaf24('0x6e')]();}return null;})[_0xaf24('0x25')](function(_0xee8041){if(_0xee8041){if(!_0xee8041[_0xaf24('0x37')]){throw new db[(_0xaf24('0x6f'))]['ValidationErrorItem'](_0xaf24('0x71'),0x193);}_0x1b7f02=_0xee8041;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xaf24('0x25')](function(_0x248d54){if(_0x248d54){_0x47f66a=_['keyBy'](_0x248d54,'id');var _0x5221b4;var _0x381739=squel[_0xaf24('0x73')]();_0x381739[_0xaf24('0x74')](_0x1652ae['table']);for(var _0x4d72ec=0x0;_0x4d72ec<_0x1b7f02[_0xaf24('0x37')];_0x4d72ec+=0x1){_0x5221b4=_0x1b7f02[_0x4d72ec][_0xaf24('0x76')]?_0x47f66a[_0x1b7f02[_0x4d72ec]['MetricId']][_0xaf24('0x8f')]:_0x1b7f02[_0x4d72ec]['field'];_0x5221b4=_0x1b7f02[_0x4d72ec][_0xaf24('0x77')]?_['replace'](_0x179ee9[_0x1b7f02[_0x4d72ec][_0xaf24('0x77')]],'%s',_0x5221b4):_0x5221b4;_0x5221b4=_0x1b7f02[_0x4d72ec]['format']?_[_0xaf24('0x78')](_0x416380[_0x1b7f02[_0x4d72ec][_0xaf24('0x79')]],'%s',_0x5221b4):_0x5221b4;if(_0x1b7f02[_0x4d72ec]['groupBy']){_0x381739[_0xaf24('0x6a')](_0x5221b4);}_0x1b7f02[_0x4d72ec][_0xaf24('0x7b')]&&_0x381739['order'](_0x5221b4,_0x1b7f02[_0x4d72ec][_0xaf24('0x7b')]===_0xaf24('0x7c')?![]:!![]);_0x381739[_0xaf24('0x6b')](_0x5221b4,_0x1b7f02[_0x4d72ec][_0xaf24('0x7d')]||_0x5221b4);}if(_0x1652ae['joins']){_0x1652ae[_0xaf24('0x7e')]=JSON[_0xaf24('0x7f')](_0x1652ae[_0xaf24('0x7e')]);for(var _0x257860=0x0;_0x257860<_0x1652ae[_0xaf24('0x7e')][_0xaf24('0x37')];_0x257860+=0x1){if(_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x3f')]&&_[_0xaf24('0x64')](_0x5af126,_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x3f')])&&_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x80')]&&_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x81')]&&_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x83')]){_0x381739[_0x1652ae['joins'][_0x257860][_0xaf24('0x3f')]](_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x81')],null,util['format'](_0xaf24('0x82'),_0x1652ae[_0xaf24('0x75')],_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x80')],_0x1652ae['joins'][_0x257860][_0xaf24('0x81')],_0x1652ae['joins'][_0x257860][_0xaf24('0x83')]));}}}if(_0x1652ae[_0xaf24('0x84')]){_0x1652ae[_0xaf24('0x84')]=JSON[_0xaf24('0x7f')](_0x1652ae[_0xaf24('0x84')]);_0x381739[_0xaf24('0x3d')](_0x2ae2d9(_0x1652ae[_0xaf24('0x84')]['group']));}_0x58ec26=_0x381739['clone']();_0x381739[_0xaf24('0x1d')](_0x5ce8e6);_0x381739[_0xaf24('0x1b')](0x0);logger[_0xaf24('0x86')](_0xaf24('0xa5'),_0x381739['toString']());return dbH['sequelize']['query'](_0x381739[_0xaf24('0x87')](),{'type':dbH[_0xaf24('0x88')][_0xaf24('0x89')][_0xaf24('0x8a')]});}})[_0xaf24('0x25')](function(){return{'sql':_0x58ec26[_0xaf24('0x87')]()};})[_0xaf24('0x25')](respondWithResult(_0x3b4d8f,null))[_0xaf24('0x46')](handleError(_0x3b4d8f,null));};
\ No newline at end of file
+var _0xbecf=['generate','csv','custom','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','savename','countTable','COUNT(*)','run','runReport','IS\x20EMPTY','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','CustomReports','end','error','stack','name','send','rawAttributes','fieldName','type','key','map','keys','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','COUNT(DISTINCT\x20%s)','DATE(%s)','IS\x20NULL','operator','value','Sequelize','ValidationErrorItem','AnalyticMetric','groupBy','output','web','fullPath','%s-%s.%s'];(function(_0x22b430,_0x1aede5){var _0x338d2a=function(_0x1335f7){while(--_0x1335f7){_0x22b430['push'](_0x22b430['shift']());}};_0x338d2a(++_0x1aede5);}(_0xbecf,0x15c));var _0xfbec=function(_0x234095,_0x5771a2){_0x234095=_0x234095-0x0;var _0x5b4889=_0xbecf[_0x234095];return _0x5b4889;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfbec('0x0'));var jsonpatch=require(_0xfbec('0x1'));var rp=require(_0xfbec('0x2'));var moment=require(_0xfbec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfbec('0x4'));var util=require(_0xfbec('0x5'));var path=require(_0xfbec('0x6'));var sox=require(_0xfbec('0x7'));var csv=require(_0xfbec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbec('0x9'));var _=require(_0xfbec('0xa'));var squel=require(_0xfbec('0xb'));var crypto=require(_0xfbec('0xc'));var jsforce=require(_0xfbec('0xd'));var deskjs=require(_0xfbec('0xe'));var toCsv=require(_0xfbec('0x8'));var querystring=require(_0xfbec('0xf'));var Papa=require(_0xfbec('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfbec('0x11'));var hardwareService=require(_0xfbec('0x12'));var logger=require(_0xfbec('0x13'))(_0xfbec('0x14'));var utils=require(_0xfbec('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfbec('0x16'));var db=require(_0xfbec('0x17'))['db'];var dbH=require(_0xfbec('0x17'))[_0xfbec('0x18')];function respondWithStatusCode(_0x4859ea,_0x276713){_0x276713=_0x276713||0xcc;return function(_0x411562){if(_0x411562){return _0x4859ea[_0xfbec('0x19')](_0x276713);}return _0x4859ea[_0xfbec('0x1a')](_0x276713)['end']();};}function respondWithResult(_0x93609b,_0x5e021e){_0x5e021e=_0x5e021e||0xc8;return function(_0x8b2f89){if(_0x8b2f89){return _0x93609b['status'](_0x5e021e)[_0xfbec('0x1b')](_0x8b2f89);}};}function respondWithFilteredResult(_0x923681,_0x171721){return function(_0x4aa49e){if(_0x4aa49e){var _0xe91fb8=typeof _0x171721[_0xfbec('0x1c')]===_0xfbec('0x1d')&&typeof _0x171721['limit']===_0xfbec('0x1d');var _0x267a4b=_0x4aa49e[_0xfbec('0x1e')];var _0x6fc8f=_0xe91fb8?0x0:_0x171721[_0xfbec('0x1c')];var _0x265534=_0xe91fb8?_0x4aa49e[_0xfbec('0x1e')]:_0x171721['offset']+_0x171721['limit'];var _0x5da567;if(_0x265534>=_0x267a4b){_0x265534=_0x267a4b;_0x5da567=0xc8;}else{_0x5da567=0xce;}_0x923681[_0xfbec('0x1a')](_0x5da567);return _0x923681[_0xfbec('0x1f')](_0xfbec('0x20'),_0x6fc8f+'-'+_0x265534+'/'+_0x267a4b)['json'](_0x4aa49e);}return null;};}function patchUpdates(_0x315e9b){return function(_0x383405){try{jsonpatch['apply'](_0x383405,_0x315e9b,!![]);}catch(_0x3150f1){return BPromise[_0xfbec('0x21')](_0x3150f1);}return _0x383405['save']();};}function saveUpdates(_0xe1f8d6,_0x4048b7){return function(_0x3e28ef){if(_0x3e28ef){return _0x3e28ef[_0xfbec('0x22')](_0xe1f8d6)[_0xfbec('0x23')](function(_0x57b3ce){return _0x57b3ce;});}return null;};}function removeEntity(_0x2e172e,_0x4bc10a){return function(_0x1bed47){if(_0x1bed47){return _0x1bed47[_0xfbec('0x24')]()['then'](function(){var _0x50e0ef=_0x1bed47['get']({'plain':!![]});var _0x10f5d3=_0xfbec('0x25');return db['UserProfileResource'][_0xfbec('0x24')]({'where':{'type':_0x10f5d3,'resourceId':_0x50e0ef['id']}})[_0xfbec('0x23')](function(){return _0x1bed47;});})[_0xfbec('0x23')](function(){_0x2e172e['status'](0xcc)[_0xfbec('0x26')]();});}};}function handleEntityNotFound(_0x2d9acb,_0x437b7e){return function(_0x14aa8a){if(!_0x14aa8a){_0x2d9acb[_0xfbec('0x19')](0x194);}return _0x14aa8a;};}function handleError(_0x5b359b,_0x4aff99){_0x4aff99=_0x4aff99||0x1f4;return function(_0x163987){logger[_0xfbec('0x27')](_0x163987[_0xfbec('0x28')]);if(_0x163987[_0xfbec('0x29')]){delete _0x163987[_0xfbec('0x29')];}_0x5b359b[_0xfbec('0x1a')](_0x4aff99)[_0xfbec('0x2a')](_0x163987);};}exports['index']=function(_0xa0084a,_0x55ffd2){var _0x5260b2={},_0x5a3829={},_0x22a487={'count':0x0,'rows':[]};var _0x49cc9a=_['map'](db['AnalyticCustomReport'][_0xfbec('0x2b')],function(_0xab9f46){return{'name':_0xab9f46[_0xfbec('0x2c')],'type':_0xab9f46[_0xfbec('0x2d')][_0xfbec('0x2e')]};});_0x5a3829['model']=_[_0xfbec('0x2f')](_0x49cc9a,_0xfbec('0x29'));_0x5a3829['query']=_[_0xfbec('0x30')](_0xa0084a['query']);_0x5a3829['filters']=_[_0xfbec('0x31')](_0x5a3829[_0xfbec('0x32')],_0x5a3829[_0xfbec('0x33')]);_0x5260b2[_0xfbec('0x34')]=_['intersection'](_0x5a3829[_0xfbec('0x32')],qs[_0xfbec('0x35')](_0xa0084a[_0xfbec('0x33')]['fields']));_0x5260b2['attributes']=_0x5260b2[_0xfbec('0x34')]['length']?_0x5260b2[_0xfbec('0x34')]:_0x5a3829[_0xfbec('0x32')];if(!_0xa0084a[_0xfbec('0x33')][_0xfbec('0x36')](_0xfbec('0x37'))){_0x5260b2[_0xfbec('0x38')]=qs['limit'](_0xa0084a['query'][_0xfbec('0x38')]);_0x5260b2[_0xfbec('0x1c')]=qs[_0xfbec('0x1c')](_0xa0084a[_0xfbec('0x33')]['offset']);}_0x5260b2[_0xfbec('0x39')]=qs['sort'](_0xa0084a['query'][_0xfbec('0x3a')]);_0x5260b2[_0xfbec('0x3b')]=qs[_0xfbec('0x3c')](_[_0xfbec('0x3d')](_0xa0084a[_0xfbec('0x33')],_0x5a3829[_0xfbec('0x3c')]),_0x49cc9a);if(_0xa0084a[_0xfbec('0x33')][_0xfbec('0x3e')]){_0x5260b2[_0xfbec('0x3b')]=_[_0xfbec('0x3f')](_0x5260b2['where'],{'$or':_['map'](_0x49cc9a,function(_0x3b2b41){if(_0x3b2b41[_0xfbec('0x2d')]!==_0xfbec('0x40')){var _0x36f2b4={};_0x36f2b4[_0x3b2b41['name']]={'$like':'%'+_0xa0084a[_0xfbec('0x33')][_0xfbec('0x3e')]+'%'};return _0x36f2b4;}})});}_0x5260b2=_[_0xfbec('0x3f')]({},_0x5260b2,_0xa0084a[_0xfbec('0x41')]);var _0x1f6a31={'where':_0x5260b2[_0xfbec('0x3b')]};return db[_0xfbec('0x42')]['count'](_0x1f6a31)[_0xfbec('0x23')](function(_0x40bb85){_0x22a487['count']=_0x40bb85;if(_0xa0084a[_0xfbec('0x33')][_0xfbec('0x43')]){_0x5260b2[_0xfbec('0x44')]=[{'all':!![]}];}return db[_0xfbec('0x42')][_0xfbec('0x45')](_0x5260b2);})[_0xfbec('0x23')](function(_0x154de6){_0x22a487['rows']=_0x154de6;return _0x22a487;})[_0xfbec('0x23')](respondWithFilteredResult(_0x55ffd2,_0x5260b2))[_0xfbec('0x46')](handleError(_0x55ffd2,null));};exports['show']=function(_0x18eb22,_0x5e7d1c){var _0x117fd3={'raw':![],'where':{'id':_0x18eb22[_0xfbec('0x47')]['id']}},_0x5e94a7={};_0x5e94a7[_0xfbec('0x32')]=_[_0xfbec('0x30')](db[_0xfbec('0x42')][_0xfbec('0x2b')]);_0x5e94a7[_0xfbec('0x33')]=_[_0xfbec('0x30')](_0x18eb22['query']);_0x5e94a7[_0xfbec('0x3c')]=_[_0xfbec('0x31')](_0x5e94a7[_0xfbec('0x32')],_0x5e94a7[_0xfbec('0x33')]);_0x117fd3['attributes']=_[_0xfbec('0x31')](_0x5e94a7[_0xfbec('0x32')],qs[_0xfbec('0x35')](_0x18eb22[_0xfbec('0x33')][_0xfbec('0x35')]));_0x117fd3[_0xfbec('0x34')]=_0x117fd3[_0xfbec('0x34')]['length']?_0x117fd3[_0xfbec('0x34')]:_0x5e94a7[_0xfbec('0x32')];if(_0x18eb22['query'][_0xfbec('0x43')]){_0x117fd3[_0xfbec('0x44')]=[{'all':!![]}];}_0x117fd3=_[_0xfbec('0x3f')]({},_0x117fd3,_0x18eb22[_0xfbec('0x41')]);return db[_0xfbec('0x42')]['find'](_0x117fd3)[_0xfbec('0x23')](handleEntityNotFound(_0x5e7d1c,null))[_0xfbec('0x23')](respondWithResult(_0x5e7d1c,null))[_0xfbec('0x46')](handleError(_0x5e7d1c,null));};exports[_0xfbec('0x48')]=function(_0x2bed4c,_0x5c05a3){return db[_0xfbec('0x42')][_0xfbec('0x48')](_0x2bed4c[_0xfbec('0x49')],{})[_0xfbec('0x23')](function(_0x458ee4){var _0x4e79ff=_0x2bed4c[_0xfbec('0x4a')][_0xfbec('0x4b')]({'plain':!![]});if(!_0x4e79ff)throw new Error(_0xfbec('0x4c'));if(_0x4e79ff[_0xfbec('0x4d')]===_0xfbec('0x4a')){var _0x4e87ea=_0x458ee4[_0xfbec('0x4b')]({'plain':!![]});var _0x30fe9b=_0xfbec('0x4e');return db[_0xfbec('0x4f')][_0xfbec('0x50')]({'where':{'name':_0x30fe9b,'userProfileId':_0x4e79ff[_0xfbec('0x51')]},'raw':!![]})[_0xfbec('0x23')](function(_0x3cb620){if(_0x3cb620&&_0x3cb620[_0xfbec('0x52')]===0x0){return db[_0xfbec('0x53')][_0xfbec('0x48')]({'name':_0x4e87ea[_0xfbec('0x29')],'resourceId':_0x4e87ea['id'],'type':_0xfbec('0x25'),'sectionId':_0x3cb620['id']},{})['then'](function(){return _0x458ee4;});}else{return _0x458ee4;}})[_0xfbec('0x46')](function(_0x358adf){logger[_0xfbec('0x27')](_0xfbec('0x54'),_0x358adf);throw _0x358adf;});}return _0x458ee4;})[_0xfbec('0x23')](respondWithResult(_0x5c05a3,0xc9))[_0xfbec('0x46')](handleError(_0x5c05a3,null));};exports[_0xfbec('0x22')]=function(_0x4a6c0d,_0x4e7a08){if(_0x4a6c0d[_0xfbec('0x49')]['id']){delete _0x4a6c0d[_0xfbec('0x49')]['id'];}return db[_0xfbec('0x42')][_0xfbec('0x50')]({'where':{'id':_0x4a6c0d[_0xfbec('0x47')]['id']}})[_0xfbec('0x23')](handleEntityNotFound(_0x4e7a08,null))['then'](saveUpdates(_0x4a6c0d[_0xfbec('0x49')],null))[_0xfbec('0x23')](respondWithResult(_0x4e7a08,null))[_0xfbec('0x46')](handleError(_0x4e7a08,null));};exports[_0xfbec('0x24')]=function(_0x15e9a0,_0x2296c4){return db[_0xfbec('0x42')]['find']({'where':{'id':_0x15e9a0[_0xfbec('0x47')]['id']}})[_0xfbec('0x23')](handleEntityNotFound(_0x2296c4,null))['then'](removeEntity(_0x2296c4,null))[_0xfbec('0x46')](handleError(_0x2296c4,null));};exports[_0xfbec('0x55')]=function(_0x19cc60,_0x3c587e){var _0x2ca934=0xa;var _0x4fbf88=[_0xfbec('0x56'),_0xfbec('0x57'),_0xfbec('0x58'),_0xfbec('0x59')];var _0x2b8f02={'SUM':_0xfbec('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfbec('0x5b'),'MIN':_0xfbec('0x5c'),'AVG':_0xfbec('0x5d'),'GROUP_CONCAT':_0xfbec('0x5e'),'GROUP_CONCAT ASC':_0xfbec('0x5f'),'GROUP_CONCAT DESC':_0xfbec('0x60')};var _0x3c2b99={'SEC_TO_TIME':_0xfbec('0x61'),'DATE':'DATE(%s)','HOUR':_0xfbec('0x62'),'ROUND':_0xfbec('0x63'),'UNIX_TIMESTAMP':_0xfbec('0x64')};var _0x3aca57=function(_0x4e77e4){return!_[_0xfbec('0x65')](['IS\x20NULL',_0xfbec('0x66'),'IS\x20EMPTY',_0xfbec('0x67')],_0x4e77e4);};var _0x5ec95b=function(_0x139660){if(!_0x139660||!_0x139660[_0xfbec('0x68')]['length']){return'';}for(var _0x1ee9a5='(',_0x644902=0x0;_0x644902<_0x139660['rules'][_0xfbec('0x69')];_0x644902+=0x1){_0x644902>0x0&&(_0x1ee9a5+='\x20'+_0x139660['operator']+'\x20');_0x1ee9a5+=_0x139660['rules'][_0x644902][_0xfbec('0x6a')]?_0x5ec95b(_0x139660[_0xfbec('0x68')][_0x644902][_0xfbec('0x6a')]):_0x139660['rules'][_0x644902][_0xfbec('0x6b')]+'\x20'+_0x139660[_0xfbec('0x68')][_0x644902][_0xfbec('0x6c')]+(_0x3aca57(_0x139660[_0xfbec('0x68')][_0x644902][_0xfbec('0x6c')])?'\x20'+_0x139660[_0xfbec('0x68')][_0x644902]['value']:'');}return _0x1ee9a5+')';};var _0x2b4c76={'where':{'id':_0x19cc60[_0xfbec('0x47')]['id']}},_0xc0356a,_0x23d302,_0xa5849e,_0x576fc6,_0x53ca19;_0x2b4c76=_[_0xfbec('0x3f')]({},_0x2b4c76,_0x19cc60[_0xfbec('0x41')]);return db[_0xfbec('0x42')][_0xfbec('0x50')](_0x2b4c76)['then'](function(_0x2654e1){if(_0x2654e1){_0xc0356a=_0x2654e1;return _0x2654e1[_0xfbec('0x6d')]();}return null;})[_0xfbec('0x23')](function(_0x3e4c0c){if(_0x3e4c0c){if(!_0x3e4c0c[_0xfbec('0x69')]){throw new db['Sequelize']['ValidationErrorItem'](_0xfbec('0x6e'),0x193);}_0x23d302=_0x3e4c0c;return db['AnalyticMetric'][_0xfbec('0x45')]({'raw':!![]});}return null;})[_0xfbec('0x23')](function(_0x5c6269){if(_0x5c6269){_0xa5849e=_[_0xfbec('0x6f')](_0x5c6269,'id');var _0x4c3844;var _0x1e2187=squel[_0xfbec('0x70')]();_0x1e2187[_0xfbec('0x71')](_0xc0356a['table']);for(var _0x5dcd8a=0x0;_0x5dcd8a<_0x23d302['length'];_0x5dcd8a+=0x1){_0x4c3844=_0x23d302[_0x5dcd8a][_0xfbec('0x72')]?_0xa5849e[_0x23d302[_0x5dcd8a][_0xfbec('0x72')]]['metric']:_0x23d302[_0x5dcd8a][_0xfbec('0x6b')];_0x4c3844=_0x23d302[_0x5dcd8a][_0xfbec('0x73')]?_['replace'](_0x2b8f02[_0x23d302[_0x5dcd8a][_0xfbec('0x73')]],'%s',_0x4c3844):_0x4c3844;_0x4c3844=_0x23d302[_0x5dcd8a]['format']?_[_0xfbec('0x74')](_0x3c2b99[_0x23d302[_0x5dcd8a][_0xfbec('0x75')]],'%s',_0x4c3844):_0x4c3844;if(_0x23d302[_0x5dcd8a]['groupBy']){_0x1e2187[_0xfbec('0x6a')](_0x4c3844);}_0x23d302[_0x5dcd8a][_0xfbec('0x76')]&&_0x1e2187['order'](_0x4c3844,_0x23d302[_0x5dcd8a]['orderBy']===_0xfbec('0x77')?![]:!![]);_0x1e2187[_0xfbec('0x6b')](_0x4c3844,_0x23d302[_0x5dcd8a][_0xfbec('0x78')]||_0x4c3844);}if(_0xc0356a[_0xfbec('0x79')]){_0xc0356a[_0xfbec('0x79')]=JSON[_0xfbec('0x7a')](_0xc0356a[_0xfbec('0x79')]);for(var _0x53475a=0x0;_0x53475a<_0xc0356a[_0xfbec('0x79')][_0xfbec('0x69')];_0x53475a+=0x1){if(_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x2d')]&&_['includes'](_0x4fbf88,_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x2d')])&&_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x7b')]&&_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x7c')]&&_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x7d')]){_0x1e2187[_0xc0356a['joins'][_0x53475a][_0xfbec('0x2d')]](_0xc0356a[_0xfbec('0x79')][_0x53475a]['foreignTable'],null,util[_0xfbec('0x75')](_0xfbec('0x7e'),_0xc0356a[_0xfbec('0x7f')],_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x7b')],_0xc0356a[_0xfbec('0x79')][_0x53475a]['foreignTable'],_0xc0356a['joins'][_0x53475a][_0xfbec('0x7d')]));}}}if(_0xc0356a['conditions']){_0xc0356a['conditions']=JSON['parse'](_0xc0356a[_0xfbec('0x80')]);_0x1e2187['where'](_0x5ec95b(_0xc0356a[_0xfbec('0x80')]['group']));}_0x53ca19=_0x1e2187[_0xfbec('0x81')]();_0x1e2187['limit'](_0x2ca934);_0x1e2187[_0xfbec('0x1c')](0x0);logger[_0xfbec('0x82')](_0xfbec('0x83'),_0x1e2187[_0xfbec('0x84')]());return dbH[_0xfbec('0x85')][_0xfbec('0x33')](_0x1e2187[_0xfbec('0x84')](),{'type':dbH['sequelize'][_0xfbec('0x86')][_0xfbec('0x87')]});}})[_0xfbec('0x23')](respondWithResult(_0x3c587e,null))['catch'](handleError(_0x3c587e,null));};function runReport(_0x43d9bb,_0x4bc655,_0xdd9aa){var _0x9f2c3a=_0x4bc655['name'];var _0x59db5b=0xa;var _0x2d8fbd=[_0xfbec('0x56'),_0xfbec('0x57'),_0xfbec('0x58'),'cross_join'];var _0x2e7287={'SUM':_0xfbec('0x5a'),'COUNT':_0xfbec('0x88'),'COUNT DISTINCT':_0xfbec('0x89'),'MAX':_0xfbec('0x5b'),'MIN':'MIN(%s)','AVG':_0xfbec('0x5d'),'GROUP_CONCAT':_0xfbec('0x5e'),'GROUP_CONCAT ASC':_0xfbec('0x5f'),'GROUP_CONCAT DESC':_0xfbec('0x60')};var _0x5b2364={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfbec('0x8a'),'HOUR':_0xfbec('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c05e4=function(_0x2d340e){return!_['includes']([_0xfbec('0x8b'),_0xfbec('0x66'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2d340e);};var _0x40713a=function(_0x52d71f){if(!_0x52d71f||!_0x52d71f['rules']['length']){return'';}for(var _0x2b3aa3='(',_0x224751=0x0;_0x224751<_0x52d71f[_0xfbec('0x68')][_0xfbec('0x69')];_0x224751+=0x1){_0x224751>0x0&&(_0x2b3aa3+='\x20'+_0x52d71f[_0xfbec('0x8c')]+'\x20');_0x2b3aa3+=_0x52d71f[_0xfbec('0x68')][_0x224751]['group']?_0x40713a(_0x52d71f[_0xfbec('0x68')][_0x224751][_0xfbec('0x6a')]):_0x52d71f[_0xfbec('0x68')][_0x224751][_0xfbec('0x6b')]+'\x20'+_0x52d71f[_0xfbec('0x68')][_0x224751]['condition']+(_0x1c05e4(_0x52d71f[_0xfbec('0x68')][_0x224751]['condition'])?'\x20'+_0x52d71f[_0xfbec('0x68')][_0x224751][_0xfbec('0x8d')]:'');}return _0x2b3aa3+')';};var _0x148cb9={'where':{'id':_0x43d9bb['id']}},_0x27d921,_0x10e58f,_0x5e70d6,_0x4bf568,_0x79e2f4;_0x148cb9=_[_0xfbec('0x3f')]({},_0x148cb9,_0xdd9aa);return db[_0xfbec('0x42')][_0xfbec('0x50')](_0x148cb9)[_0xfbec('0x23')](function(_0x1e6a4e){if(_0x1e6a4e){_0x27d921=_0x1e6a4e;return _0x1e6a4e[_0xfbec('0x6d')]();}return null;})['then'](function(_0x5d748c){if(_0x5d748c){if(!_0x5d748c[_0xfbec('0x69')]){throw new db[(_0xfbec('0x8e'))][(_0xfbec('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10e58f=_0x5d748c;return db[_0xfbec('0x90')][_0xfbec('0x45')]({'raw':!![]});}return null;})[_0xfbec('0x23')](function(_0x27fb9a){if(_0x27fb9a){_0x5e70d6=_[_0xfbec('0x6f')](_0x27fb9a,'id');var _0x102dcf;var _0x144ba8=squel[_0xfbec('0x70')]();_0x144ba8[_0xfbec('0x71')](_0x27d921[_0xfbec('0x7f')]);for(var _0x563295=0x0;_0x563295<_0x10e58f['length'];_0x563295+=0x1){_0x102dcf=_0x10e58f[_0x563295]['MetricId']?_0x5e70d6[_0x10e58f[_0x563295][_0xfbec('0x72')]]['metric']:_0x10e58f[_0x563295][_0xfbec('0x6b')];_0x102dcf=_0x10e58f[_0x563295][_0xfbec('0x73')]?_['replace'](_0x2e7287[_0x10e58f[_0x563295][_0xfbec('0x73')]],'%s',_0x102dcf):_0x102dcf;_0x102dcf=_0x10e58f[_0x563295]['format']?_['replace'](_0x5b2364[_0x10e58f[_0x563295][_0xfbec('0x75')]],'%s',_0x102dcf):_0x102dcf;if(_0x10e58f[_0x563295][_0xfbec('0x91')]){_0x144ba8[_0xfbec('0x6a')](_0x102dcf);}_0x10e58f[_0x563295]['orderBy']&&_0x144ba8[_0xfbec('0x39')](_0x102dcf,_0x10e58f[_0x563295][_0xfbec('0x76')]===_0xfbec('0x77')?![]:!![]);_0x144ba8[_0xfbec('0x6b')](_0x102dcf,_0x10e58f[_0x563295]['alias']||_0x102dcf);}if(_0x27d921[_0xfbec('0x79')]){_0x27d921['joins']=JSON[_0xfbec('0x7a')](_0x27d921['joins']);for(var _0x345f61=0x0;_0x345f61<_0x27d921[_0xfbec('0x79')][_0xfbec('0x69')];_0x345f61+=0x1){if(_0x27d921['joins'][_0x345f61][_0xfbec('0x2d')]&&_[_0xfbec('0x65')](_0x2d8fbd,_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x2d')])&&_0x27d921['joins'][_0x345f61][_0xfbec('0x7b')]&&_0x27d921[_0xfbec('0x79')][_0x345f61]['foreignTable']&&_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x7d')]){_0x144ba8[_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x2d')]](_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x7c')],null,util['format'](_0xfbec('0x7e'),_0x27d921['table'],_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x7b')],_0x27d921[_0xfbec('0x79')][_0x345f61]['foreignTable'],_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x7d')]));}}}if(_0x27d921[_0xfbec('0x80')]){_0x27d921[_0xfbec('0x80')]=JSON[_0xfbec('0x7a')](_0x27d921[_0xfbec('0x80')]);_0x144ba8['where'](_0x40713a(_0x27d921['conditions'][_0xfbec('0x6a')]));}_0x79e2f4=_0x144ba8['clone']();_0x144ba8[_0xfbec('0x38')](_0x59db5b);_0x144ba8['offset'](0x0);return;}})['then'](function(){if(_0x4bc655[_0xfbec('0x92')]===_0xfbec('0x93')){return null;}var _0xce0709=_[_0xfbec('0x3f')](_0x4bc655,{'name':_0x4bc655[_0xfbec('0x94')]||_0x4bc655[_0xfbec('0x29')]||_0x27d921['name'],'basename':_0x9f2c3a,'savename':util[_0xfbec('0x75')](_0xfbec('0x95'),_0x4bc655['name']||_0x27d921['name'],require('randomstring')[_0xfbec('0x96')](0x4),_0x4bc655[_0xfbec('0x92')]||_0xfbec('0x97')),'reportId':_0x27d921['id'],'reportType':_0xfbec('0x98')});return db['AnalyticExtractedReport']['create'](_0xce0709,{'raw':!![]});})['then'](function(_0x54890d){if(_0x27d921[_0xfbec('0x7f')]==='cdr'){_0x79e2f4[_0xfbec('0x3b')](_0x27d921[_0xfbec('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4bc655[_0xfbec('0x99')],_0x4bc655[_0xfbec('0x9a')]);}else{_0x79e2f4[_0xfbec('0x3b')](_0x27d921['table']+_0xfbec('0x9b'),_0x4bc655[_0xfbec('0x99')],_0x4bc655[_0xfbec('0x9a')]);}if(_0x54890d){logger[_0xfbec('0x9c')](_0xfbec('0x9d'),_0x79e2f4[_0xfbec('0x84')]());require(_0xfbec('0x9e'))[_0xfbec('0x9f')](path[_0xfbec('0x56')](__dirname,'../../components/export/',_0x54890d[_0xfbec('0x92')]),[_0x54890d['id'],_0x79e2f4[_0xfbec('0x84')](),path[_0xfbec('0x56')](__dirname,'../../files/reports',_0x54890d[_0xfbec('0xa0')]),_0x9f2c3a]);return _0x54890d;}else{var _0x3cde63=squel[_0xfbec('0x70')]();_0x3cde63['from']('('+_0x79e2f4[_0xfbec('0x84')]()+')',_0xfbec('0xa1'));_0x3cde63['field'](_0xfbec('0xa2'),_0xfbec('0x1e'));_0x79e2f4[_0xfbec('0x38')](_0x4bc655[_0xfbec('0x38')]||_0x59db5b);_0x79e2f4[_0xfbec('0x1c')](_0x4bc655[_0xfbec('0x1c')]||0x0);return dbH['sequelize'][_0xfbec('0x33')](_0x3cde63[_0xfbec('0x84')](),{'type':dbH[_0xfbec('0x85')][_0xfbec('0x86')][_0xfbec('0x87')]})[_0xfbec('0x23')](function(_0x10bca6){if(!_0x10bca6[_0xfbec('0x69')]){_0x4bf568=0x0;}else{_0x4bf568=_0x10bca6[0x0]['count']||0x0;}return dbH['sequelize'][_0xfbec('0x33')](_0x79e2f4[_0xfbec('0x84')](),{'type':dbH[_0xfbec('0x85')][_0xfbec('0x86')][_0xfbec('0x87')]});})[_0xfbec('0x23')](function(_0x182965){return{'rows':_0x182965||[],'count':_0x4bf568};});}});}exports[_0xfbec('0xa3')]=function(_0x3cd51d,_0x3e4c53){return runReport(_0x3cd51d[_0xfbec('0x47')],_0x3cd51d[_0xfbec('0x33')],_0x3cd51d[_0xfbec('0x41')])[_0xfbec('0x23')](respondWithResult(_0x3e4c53,null))['catch'](handleError(_0x3e4c53,null));};exports[_0xfbec('0xa4')]=runReport;exports['query']=function(_0x5dd751,_0x3712df){var _0x3aa1f2=0xa;var _0x52ea04=[_0xfbec('0x56'),_0xfbec('0x57'),_0xfbec('0x58'),_0xfbec('0x59')];var _0x37ed45={'SUM':'SUM(%s)','COUNT':_0xfbec('0x88'),'COUNT DISTINCT':_0xfbec('0x89'),'MAX':_0xfbec('0x5b'),'MIN':_0xfbec('0x5c'),'AVG':_0xfbec('0x5d'),'GROUP_CONCAT':_0xfbec('0x5e'),'GROUP_CONCAT ASC':_0xfbec('0x5f'),'GROUP_CONCAT DESC':_0xfbec('0x60')};var _0x42e5ed={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfbec('0x8a'),'HOUR':_0xfbec('0x62'),'ROUND':_0xfbec('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x14fc6f=function(_0x28e4f5){return!_['includes']([_0xfbec('0x8b'),_0xfbec('0x66'),_0xfbec('0xa5'),'IS\x20NOT\x20EMPTY'],_0x28e4f5);};var _0x39f7b8=function(_0x1bf11e){if(!_0x1bf11e||!_0x1bf11e[_0xfbec('0x68')]['length']){return'';}for(var _0x474a30='(',_0x49c3c1=0x0;_0x49c3c1<_0x1bf11e[_0xfbec('0x68')]['length'];_0x49c3c1+=0x1){_0x49c3c1>0x0&&(_0x474a30+='\x20'+_0x1bf11e[_0xfbec('0x8c')]+'\x20');_0x474a30+=_0x1bf11e['rules'][_0x49c3c1]['group']?_0x39f7b8(_0x1bf11e['rules'][_0x49c3c1]['group']):_0x1bf11e[_0xfbec('0x68')][_0x49c3c1][_0xfbec('0x6b')]+'\x20'+_0x1bf11e[_0xfbec('0x68')][_0x49c3c1][_0xfbec('0x6c')]+(_0x14fc6f(_0x1bf11e[_0xfbec('0x68')][_0x49c3c1][_0xfbec('0x6c')])?'\x20'+_0x1bf11e[_0xfbec('0x68')][_0x49c3c1][_0xfbec('0x8d')]:'');}return _0x474a30+')';};var _0x105556={'where':{'id':_0x5dd751['params']['id']}},_0x1c14d8,_0x477080,_0x12d0e7,_0x31ef74,_0x2cc5c4;_0x105556=_['merge']({},_0x105556,_0x5dd751[_0xfbec('0x41')]);return db[_0xfbec('0x42')]['find'](_0x105556)[_0xfbec('0x23')](function(_0x37e273){if(_0x37e273){_0x1c14d8=_0x37e273;return _0x37e273[_0xfbec('0x6d')]();}return null;})[_0xfbec('0x23')](function(_0x126df9){if(_0x126df9){if(!_0x126df9[_0xfbec('0x69')]){throw new db['Sequelize'][(_0xfbec('0x8f'))](_0xfbec('0x6e'),0x193);}_0x477080=_0x126df9;return db[_0xfbec('0x90')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x25cf73){if(_0x25cf73){_0x12d0e7=_[_0xfbec('0x6f')](_0x25cf73,'id');var _0x5df29a;var _0x145086=squel[_0xfbec('0x70')]();_0x145086[_0xfbec('0x71')](_0x1c14d8[_0xfbec('0x7f')]);for(var _0x52445c=0x0;_0x52445c<_0x477080[_0xfbec('0x69')];_0x52445c+=0x1){_0x5df29a=_0x477080[_0x52445c][_0xfbec('0x72')]?_0x12d0e7[_0x477080[_0x52445c]['MetricId']]['metric']:_0x477080[_0x52445c]['field'];_0x5df29a=_0x477080[_0x52445c][_0xfbec('0x73')]?_[_0xfbec('0x74')](_0x37ed45[_0x477080[_0x52445c]['function']],'%s',_0x5df29a):_0x5df29a;_0x5df29a=_0x477080[_0x52445c][_0xfbec('0x75')]?_[_0xfbec('0x74')](_0x42e5ed[_0x477080[_0x52445c]['format']],'%s',_0x5df29a):_0x5df29a;if(_0x477080[_0x52445c][_0xfbec('0x91')]){_0x145086[_0xfbec('0x6a')](_0x5df29a);}_0x477080[_0x52445c][_0xfbec('0x76')]&&_0x145086[_0xfbec('0x39')](_0x5df29a,_0x477080[_0x52445c][_0xfbec('0x76')]===_0xfbec('0x77')?![]:!![]);_0x145086['field'](_0x5df29a,_0x477080[_0x52445c]['alias']||_0x5df29a);}if(_0x1c14d8[_0xfbec('0x79')]){_0x1c14d8[_0xfbec('0x79')]=JSON[_0xfbec('0x7a')](_0x1c14d8[_0xfbec('0x79')]);for(var _0x39372d=0x0;_0x39372d<_0x1c14d8[_0xfbec('0x79')]['length'];_0x39372d+=0x1){if(_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x2d')]&&_['includes'](_0x52ea04,_0x1c14d8['joins'][_0x39372d][_0xfbec('0x2d')])&&_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x7b')]&&_0x1c14d8['joins'][_0x39372d][_0xfbec('0x7c')]&&_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x7d')]){_0x145086[_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x2d')]](_0x1c14d8['joins'][_0x39372d][_0xfbec('0x7c')],null,util['format'](_0xfbec('0x7e'),_0x1c14d8[_0xfbec('0x7f')],_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x7b')],_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x7c')],_0x1c14d8['joins'][_0x39372d][_0xfbec('0x7d')]));}}}if(_0x1c14d8[_0xfbec('0x80')]){_0x1c14d8['conditions']=JSON[_0xfbec('0x7a')](_0x1c14d8[_0xfbec('0x80')]);_0x145086[_0xfbec('0x3b')](_0x39f7b8(_0x1c14d8[_0xfbec('0x80')][_0xfbec('0x6a')]));}_0x2cc5c4=_0x145086['clone']();_0x145086[_0xfbec('0x38')](_0x3aa1f2);_0x145086[_0xfbec('0x1c')](0x0);logger[_0xfbec('0x82')](_0xfbec('0x83'),_0x145086[_0xfbec('0x84')]());return dbH[_0xfbec('0x85')]['query'](_0x145086['toString'](),{'type':dbH['sequelize'][_0xfbec('0x86')][_0xfbec('0x87')]});}})[_0xfbec('0x23')](function(){return{'sql':_0x2cc5c4[_0xfbec('0x84')]()};})[_0xfbec('0x23')](respondWithResult(_0x3712df,null))[_0xfbec('0x46')](handleError(_0x3712df,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index db5b021..0ce6c60 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 _0x51b5=['api','moment','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x14fd8d,_0x2619a8){var _0x4b3548=function(_0xa32e46){while(--_0xa32e46){_0x14fd8d['push'](_0x14fd8d['shift']());}};_0x4b3548(++_0x2619a8);}(_0x51b5,0x11b));var _0x551b=function(_0x1b5edd,_0x2aab3c){_0x1b5edd=_0x1b5edd-0x0;var _0x3076a3=_0x51b5[_0x1b5edd];return _0x3076a3;};'use strict';var _=require(_0x551b('0x0'));var util=require(_0x551b('0x1'));var logger=require(_0x551b('0x2'))(_0x551b('0x3'));var moment=require(_0x551b('0x4'));var BPromise=require('bluebird');var rp=require(_0x551b('0x5'));var fs=require('fs');var path=require(_0x551b('0x6'));var rimraf=require(_0x551b('0x7'));var config=require('../../config/environment');var attributes=require(_0x551b('0x8'));module[_0x551b('0x9')]=function(_0x53a106,_0x14e847){return _0x53a106[_0x551b('0xa')](_0x551b('0xb'),attributes,{'tableName':_0x551b('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5be=['define','AnalyticCustomReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0xd5be,0xd3));var _0xed5b=function(_0x4de1b5,_0x2a7626){_0x4de1b5=_0x4de1b5-0x0;var _0xed55cf=_0xd5be[_0x4de1b5];return _0xed55cf;};'use strict';var _=require(_0xed5b('0x0'));var util=require('util');var logger=require(_0xed5b('0x1'))(_0xed5b('0x2'));var moment=require(_0xed5b('0x3'));var BPromise=require(_0xed5b('0x4'));var rp=require(_0xed5b('0x5'));var fs=require('fs');var path=require(_0xed5b('0x6'));var rimraf=require(_0xed5b('0x7'));var config=require('../../config/environment');var attributes=require(_0xed5b('0x8'));module['exports']=function(_0x4735f1,_0xd04360){return _0x4735f1[_0xed5b('0x9')](_0xed5b('0xa'),attributes,{'tableName':'analytics_custom_reports','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 cf9d6a6..a10b22b 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 _0xfe27=['error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify'];(function(_0x34f7f8,_0x2a3a03){var _0x3a5c8c=function(_0x58d180){while(--_0x58d180){_0x34f7f8['push'](_0x34f7f8['shift']());}};_0x3a5c8c(++_0x2a3a03);}(_0xfe27,0x175));var _0x7fe2=function(_0x1eb2b7,_0x37c80f){_0x1eb2b7=_0x1eb2b7-0x0;var _0x3284ad=_0xfe27[_0x1eb2b7];return _0x3284ad;};'use strict';var _=require(_0x7fe2('0x0'));var util=require(_0x7fe2('0x1'));var moment=require(_0x7fe2('0x2'));var BPromise=require(_0x7fe2('0x3'));var rs=require(_0x7fe2('0x4'));var fs=require('fs');var Redis=require(_0x7fe2('0x5'));var db=require(_0x7fe2('0x6'))['db'];var utils=require(_0x7fe2('0x7'));var logger=require(_0x7fe2('0x8'))(_0x7fe2('0x9'));var config=require(_0x7fe2('0xa'));var jayson=require(_0x7fe2('0xb'));var client=jayson[_0x7fe2('0xc')][_0x7fe2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28a7e0,_0x554131,_0x43792a){return new BPromise(function(_0x56caa1,_0x5ea6c3){return client['request'](_0x28a7e0,_0x43792a)['then'](function(_0x418a45){logger[_0x7fe2('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x554131,_0x7fe2('0xf'));logger[_0x7fe2('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x554131,_0x7fe2('0xf'),JSON[_0x7fe2('0x11')](_0x418a45));if(_0x418a45[_0x7fe2('0x12')]){if(_0x418a45[_0x7fe2('0x12')]['code']===0x1f4){logger[_0x7fe2('0x12')](_0x7fe2('0x13'),_0x554131,_0x418a45[_0x7fe2('0x12')][_0x7fe2('0x14')]);return _0x5ea6c3(_0x418a45['error']['message']);}logger[_0x7fe2('0x12')](_0x7fe2('0x13'),_0x554131,_0x418a45[_0x7fe2('0x12')]['message']);return _0x56caa1(_0x418a45[_0x7fe2('0x12')][_0x7fe2('0x14')]);}else{logger[_0x7fe2('0xe')](_0x7fe2('0x13'),_0x554131,_0x7fe2('0xf'));_0x56caa1(_0x418a45[_0x7fe2('0x15')][_0x7fe2('0x14')]);}})[_0x7fe2('0x16')](function(_0x3de449){logger[_0x7fe2('0x12')](_0x7fe2('0x13'),_0x554131,_0x3de449);_0x5ea6c3(_0x3de449);});});}
\ No newline at end of file
+var _0x2f82=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2f82,0xf9));var _0x22f8=function(_0x416d75,_0x2c8e81){_0x416d75=_0x416d75-0x0;var _0x10af66=_0x2f82[_0x416d75];return _0x10af66;};'use strict';var _=require('lodash');var util=require(_0x22f8('0x0'));var moment=require(_0x22f8('0x1'));var BPromise=require(_0x22f8('0x2'));var rs=require(_0x22f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22f8('0x4'))['db'];var utils=require(_0x22f8('0x5'));var logger=require(_0x22f8('0x6'))('rpc');var config=require(_0x22f8('0x7'));var jayson=require(_0x22f8('0x8'));var client=jayson[_0x22f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x336aad,_0x268449,_0xdf18e6){return new BPromise(function(_0x399bd4,_0x5b92a1){return client[_0x22f8('0xa')](_0x336aad,_0xdf18e6)[_0x22f8('0xb')](function(_0x469870){logger[_0x22f8('0xc')](_0x22f8('0xd'),_0x268449,_0x22f8('0xe'));logger['debug'](_0x22f8('0xf'),_0x268449,_0x22f8('0xe'),JSON[_0x22f8('0x10')](_0x469870));if(_0x469870[_0x22f8('0x11')]){if(_0x469870[_0x22f8('0x11')][_0x22f8('0x12')]===0x1f4){logger[_0x22f8('0x11')](_0x22f8('0xd'),_0x268449,_0x469870[_0x22f8('0x11')][_0x22f8('0x13')]);return _0x5b92a1(_0x469870[_0x22f8('0x11')][_0x22f8('0x13')]);}logger[_0x22f8('0x11')](_0x22f8('0xd'),_0x268449,_0x469870['error'][_0x22f8('0x13')]);return _0x399bd4(_0x469870[_0x22f8('0x11')][_0x22f8('0x13')]);}else{logger['info'](_0x22f8('0xd'),_0x268449,_0x22f8('0xe'));_0x399bd4(_0x469870[_0x22f8('0x14')][_0x22f8('0x13')]);}})[_0x22f8('0x15')](function(_0x146e6c){logger[_0x22f8('0x11')](_0x22f8('0xd'),_0x268449,_0x146e6c);_0x5b92a1(_0x146e6c);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 92fec7f..b327569 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 _0x024b=['create','/:id','update','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query','query','post'];(function(_0x33ea2d,_0x1a39f7){var _0x461e0c=function(_0x49f2ee){while(--_0x49f2ee){_0x33ea2d['push'](_0x33ea2d['shift']());}};_0x461e0c(++_0x1a39f7);}(_0x024b,0x10d));var _0xb024=function(_0x30fb50,_0x48e0f6){_0x30fb50=_0x30fb50-0x0;var _0x33a79f=_0x024b[_0x30fb50];return _0x33a79f;};'use strict';var multer=require(_0xb024('0x0'));var util=require(_0xb024('0x1'));var path=require(_0xb024('0x2'));var timeout=require(_0xb024('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb024('0x4'));var config=require(_0xb024('0x5'));var controller=require(_0xb024('0x6'));router[_0xb024('0x7')]('/',auth[_0xb024('0x8')](),controller[_0xb024('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb024('0xa')]);router[_0xb024('0x7')](_0xb024('0xb'),auth[_0xb024('0x8')](),controller['preview']);router[_0xb024('0x7')](_0xb024('0xc'),auth[_0xb024('0x8')](),controller[_0xb024('0xd')]);router[_0xb024('0x7')](_0xb024('0xe'),auth[_0xb024('0x8')](),controller[_0xb024('0xf')]);router[_0xb024('0x10')]('/',auth[_0xb024('0x8')](),controller[_0xb024('0x11')]);router['put'](_0xb024('0x12'),auth[_0xb024('0x8')](),controller[_0xb024('0x13')]);router['delete'](_0xb024('0x12'),auth['isAuthenticated'](),controller[_0xb024('0x14')]);module[_0xb024('0x15')]=router;
\ No newline at end of file
+var _0xa4cd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','run','query','post','create','put','/:id','update','delete','exports','multer','util','express'];(function(_0x47b5e0,_0x273723){var _0x128d60=function(_0x5dc543){while(--_0x5dc543){_0x47b5e0['push'](_0x47b5e0['shift']());}};_0x128d60(++_0x273723);}(_0xa4cd,0x1b2));var _0xda4c=function(_0x59c06d,_0x50f5bf){_0x59c06d=_0x59c06d-0x0;var _0x96bdc4=_0xa4cd[_0x59c06d];return _0x96bdc4;};'use strict';var multer=require(_0xda4c('0x0'));var util=require(_0xda4c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xda4c('0x2'));var router=express['Router']();var fs_extra=require(_0xda4c('0x3'));var auth=require(_0xda4c('0x4'));var interaction=require(_0xda4c('0x5'));var config=require(_0xda4c('0x6'));var controller=require(_0xda4c('0x7'));router[_0xda4c('0x8')]('/',auth[_0xda4c('0x9')](),controller[_0xda4c('0xa')]);router[_0xda4c('0x8')]('/:id',auth[_0xda4c('0x9')](),controller[_0xda4c('0xb')]);router[_0xda4c('0x8')](_0xda4c('0xc'),auth[_0xda4c('0x9')](),controller[_0xda4c('0xd')]);router[_0xda4c('0x8')]('/:id/run',auth[_0xda4c('0x9')](),controller[_0xda4c('0xe')]);router[_0xda4c('0x8')]('/:id/query',auth[_0xda4c('0x9')](),controller[_0xda4c('0xf')]);router[_0xda4c('0x10')]('/',auth[_0xda4c('0x9')](),controller[_0xda4c('0x11')]);router[_0xda4c('0x12')](_0xda4c('0x13'),auth[_0xda4c('0x9')](),controller[_0xda4c('0x14')]);router[_0xda4c('0x15')](_0xda4c('0x13'),auth[_0xda4c('0x9')](),controller['destroy']);module[_0xda4c('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 2f9aa3a..9732304 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x29b851,_0x3591d3){_0x29b851=_0x29b851-0x0;var _0x2c8db6=_0xdc97[_0x29b851];return _0x2c8db6;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xafc4,0x69));var _0x4afc=function(_0x1a11b9,_0x346d4d){_0x1a11b9=_0x1a11b9-0x0;var _0x21c4b3=_0xafc4[_0x1a11b9];return _0x21c4b3;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index e9e2b99..8174487 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 _0xdbf5=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20EMPTY','ValidationErrorItem','metric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','run','Sequelize','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','end','status','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','update','join','left_join','right_join','MAX(%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)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x7ace97,_0x3b5780){_0x7ace97=_0x7ace97-0x0;var _0x22e0ac=_0xdbf5[_0x7ace97];return _0x22e0ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5dbf('0x16'))[_0x5dbf('0x17')];function respondWithStatusCode(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xcc;return function(_0x14493a){if(_0x14493a){return _0x1453a9['sendStatus'](_0x7cb848);}return _0x1453a9['status'](_0x7cb848)[_0x5dbf('0x18')]();};}function respondWithResult(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xc8;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x19')](_0x48e7fd)[_0x5dbf('0x1a')](_0x19624e);}};}function respondWithFilteredResult(_0x2dfa44,_0x181816){return function(_0x472eb9){if(_0x472eb9){var _0x2d32cc=typeof _0x181816['offset']==='undefined'&&typeof _0x181816[_0x5dbf('0x1b')]===_0x5dbf('0x1c');var _0x39c7aa=_0x472eb9[_0x5dbf('0x1d')];var _0x20c2b0=_0x2d32cc?0x0:_0x181816['offset'];var _0x11cd00=_0x2d32cc?_0x472eb9['count']:_0x181816['offset']+_0x181816['limit'];var _0x23d1e7;if(_0x11cd00>=_0x39c7aa){_0x11cd00=_0x39c7aa;_0x23d1e7=0xc8;}else{_0x23d1e7=0xce;}_0x2dfa44[_0x5dbf('0x19')](_0x23d1e7);return _0x2dfa44[_0x5dbf('0x1e')](_0x5dbf('0x1f'),_0x20c2b0+'-'+_0x11cd00+'/'+_0x39c7aa)[_0x5dbf('0x1a')](_0x472eb9);}return null;};}function patchUpdates(_0x5b2518){return function(_0x2764ea){try{jsonpatch['apply'](_0x2764ea,_0x5b2518,!![]);}catch(_0xb68f92){return BPromise[_0x5dbf('0x20')](_0xb68f92);}return _0x2764ea[_0x5dbf('0x21')]();};}function saveUpdates(_0x43a612,_0x3b763c){return function(_0x2f154e){if(_0x2f154e){return _0x2f154e['update'](_0x43a612)[_0x5dbf('0x22')](function(_0x3e3a2d){return _0x3e3a2d;});}return null;};}function removeEntity(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x23')]()[_0x5dbf('0x22')](function(){var _0x20ab1b=_0x2763ec[_0x5dbf('0x24')]({'plain':!![]});var _0x15a790=_0x5dbf('0x25');return db[_0x5dbf('0x26')][_0x5dbf('0x23')]({'where':{'type':_0x15a790,'resourceId':_0x20ab1b['id']}})[_0x5dbf('0x22')](function(){return _0x2763ec;});})[_0x5dbf('0x22')](function(){_0x2d3e1b[_0x5dbf('0x19')](0xcc)[_0x5dbf('0x18')]();});}};}function handleEntityNotFound(_0x3f8341,_0x159e61){return function(_0x22ec42){if(!_0x22ec42){_0x3f8341[_0x5dbf('0x27')](0x194);}return _0x22ec42;};}function handleError(_0x471027,_0x21cd00){_0x21cd00=_0x21cd00||0x1f4;return function(_0x5768b7){logger[_0x5dbf('0x28')](_0x5768b7[_0x5dbf('0x29')]);if(_0x5768b7[_0x5dbf('0x2a')]){delete _0x5768b7[_0x5dbf('0x2a')];}_0x471027[_0x5dbf('0x19')](_0x21cd00)[_0x5dbf('0x2b')](_0x5768b7);};}exports[_0x5dbf('0x2c')]=function(_0x31d57a,_0x406ce6){var _0x273b63={},_0x294dd7={},_0x50a307={'count':0x0,'rows':[]};var _0x4c1587=_[_0x5dbf('0x2d')](db[_0x5dbf('0x2e')][_0x5dbf('0x2f')],function(_0x3b73ad){return{'name':_0x3b73ad[_0x5dbf('0x30')],'type':_0x3b73ad['type']['key']};});_0x294dd7[_0x5dbf('0x31')]=_[_0x5dbf('0x2d')](_0x4c1587,'name');_0x294dd7[_0x5dbf('0x32')]=_[_0x5dbf('0x33')](_0x31d57a[_0x5dbf('0x32')]);_0x294dd7[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x294dd7['model'],_0x294dd7[_0x5dbf('0x32')]);_0x273b63[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x294dd7[_0x5dbf('0x31')],qs[_0x5dbf('0x37')](_0x31d57a['query'][_0x5dbf('0x37')]));_0x273b63[_0x5dbf('0x36')]=_0x273b63[_0x5dbf('0x36')][_0x5dbf('0x38')]?_0x273b63['attributes']:_0x294dd7[_0x5dbf('0x31')];if(!_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x39')](_0x5dbf('0x3a'))){_0x273b63[_0x5dbf('0x1b')]=qs[_0x5dbf('0x1b')](_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x1b')]);_0x273b63[_0x5dbf('0x3b')]=qs[_0x5dbf('0x3b')](_0x31d57a[_0x5dbf('0x32')]['offset']);}_0x273b63[_0x5dbf('0x3c')]=qs[_0x5dbf('0x3d')](_0x31d57a[_0x5dbf('0x32')]['sort']);_0x273b63[_0x5dbf('0x3e')]=qs[_0x5dbf('0x34')](_[_0x5dbf('0x3f')](_0x31d57a['query'],_0x294dd7[_0x5dbf('0x34')]),_0x4c1587);if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x40')]){_0x273b63['where']=_[_0x5dbf('0x41')](_0x273b63[_0x5dbf('0x3e')],{'$or':_[_0x5dbf('0x2d')](_0x4c1587,function(_0x260c9f){if(_0x260c9f[_0x5dbf('0x42')]!==_0x5dbf('0x43')){var _0x321ae3={};_0x321ae3[_0x260c9f[_0x5dbf('0x2a')]]={'$like':'%'+_0x31d57a['query']['filter']+'%'};return _0x321ae3;}})});}_0x273b63=_['merge']({},_0x273b63,_0x31d57a['options']);var _0x28b28f={'where':_0x273b63[_0x5dbf('0x3e')]};return db['AnalyticDefaultReport'][_0x5dbf('0x1d')](_0x28b28f)[_0x5dbf('0x22')](function(_0x5a60e8){_0x50a307[_0x5dbf('0x1d')]=_0x5a60e8;if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x44')]){_0x273b63[_0x5dbf('0x45')]=[{'all':!![]}];}return db[_0x5dbf('0x2e')][_0x5dbf('0x46')](_0x273b63);})[_0x5dbf('0x22')](function(_0x1c020a){_0x50a307[_0x5dbf('0x47')]=_0x1c020a;return _0x50a307;})[_0x5dbf('0x22')](respondWithFilteredResult(_0x406ce6,_0x273b63))['catch'](handleError(_0x406ce6,null));};exports[_0x5dbf('0x48')]=function(_0x22f958,_0xec1d28){var _0x50880d={'raw':!![],'where':{'id':_0x22f958[_0x5dbf('0x49')]['id']}},_0x16b0ff={};_0x16b0ff[_0x5dbf('0x31')]=_[_0x5dbf('0x33')](db['AnalyticDefaultReport'][_0x5dbf('0x2f')]);_0x16b0ff['query']=_[_0x5dbf('0x33')](_0x22f958[_0x5dbf('0x32')]);_0x16b0ff[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x16b0ff['model'],_0x16b0ff['query']);_0x50880d[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x16b0ff[_0x5dbf('0x31')],qs['fields'](_0x22f958[_0x5dbf('0x32')]['fields']));_0x50880d['attributes']=_0x50880d['attributes']['length']?_0x50880d[_0x5dbf('0x36')]:_0x16b0ff[_0x5dbf('0x31')];if(_0x22f958['query'][_0x5dbf('0x44')]){_0x50880d[_0x5dbf('0x45')]=[{'all':!![]}];}_0x50880d=_['merge']({},_0x50880d,_0x22f958[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')]['find'](_0x50880d)[_0x5dbf('0x22')](handleEntityNotFound(_0xec1d28,null))['then'](respondWithResult(_0xec1d28,null))['catch'](handleError(_0xec1d28,null));};exports[_0x5dbf('0x4b')]=function(_0x2a3d30,_0x17a1c0){return db['AnalyticDefaultReport']['create'](_0x2a3d30[_0x5dbf('0x4c')],{})[_0x5dbf('0x22')](function(_0x21f477){var _0x307a00=_0x2a3d30[_0x5dbf('0x4d')][_0x5dbf('0x24')]({'plain':!![]});if(!_0x307a00)throw new Error(_0x5dbf('0x4e'));if(_0x307a00[_0x5dbf('0x4f')]==='user'){var _0x3f38a0=_0x21f477[_0x5dbf('0x24')]({'plain':!![]});var _0x2927a3=_0x5dbf('0x50');return db[_0x5dbf('0x51')][_0x5dbf('0x52')]({'where':{'name':_0x2927a3,'userProfileId':_0x307a00[_0x5dbf('0x53')]},'raw':!![]})['then'](function(_0x1b0b13){if(_0x1b0b13&&_0x1b0b13['autoAssociation']===0x0){return db[_0x5dbf('0x26')][_0x5dbf('0x4b')]({'name':_0x3f38a0[_0x5dbf('0x2a')],'resourceId':_0x3f38a0['id'],'type':_0x5dbf('0x25'),'sectionId':_0x1b0b13['id']},{})[_0x5dbf('0x22')](function(){return _0x21f477;});}else{return _0x21f477;}})[_0x5dbf('0x54')](function(_0x353d0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353d0f);throw _0x353d0f;});}return _0x21f477;})['then'](respondWithResult(_0x17a1c0,0xc9))[_0x5dbf('0x54')](handleError(_0x17a1c0,null));};exports[_0x5dbf('0x55')]=function(_0x36a787,_0x56c8b2){if(_0x36a787['body']['id']){delete _0x36a787[_0x5dbf('0x4c')]['id'];}return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x36a787['params']['id']}})[_0x5dbf('0x22')](handleEntityNotFound(_0x56c8b2,null))['then'](saveUpdates(_0x36a787[_0x5dbf('0x4c')],null))[_0x5dbf('0x22')](respondWithResult(_0x56c8b2,null))[_0x5dbf('0x54')](handleError(_0x56c8b2,null));};exports['destroy']=function(_0x55fd51,_0x1b316d){return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x55fd51[_0x5dbf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b316d,null))[_0x5dbf('0x22')](removeEntity(_0x1b316d,null))[_0x5dbf('0x54')](handleError(_0x1b316d,null));};exports['preview']=function(_0x5485f3,_0x19ec03){var _0x14bdb1=0xa;var _0x197e8c=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),'cross_join'];var _0x4107f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5dbf('0x59'),'MIN':'MIN(%s)','AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x461ffb={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x3a84c2=function(_0x2ca889){return!_[_0x5dbf('0x63')]([_0x5dbf('0x64'),_0x5dbf('0x65'),'IS\x20EMPTY',_0x5dbf('0x66')],_0x2ca889);};var _0x553be4=function(_0xb0a9bf){if(!_0xb0a9bf||!_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x110224='(',_0x5a975a=0x0;_0x5a975a<_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')];_0x5a975a+=0x1){_0x5a975a>0x0&&(_0x110224+='\x20'+_0xb0a9bf[_0x5dbf('0x68')]+'\x20');_0x110224+=_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x69')]?_0x553be4(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a]['group']):_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6a')]+'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')]+(_0x3a84c2(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')])?'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6c')]:'');}return _0x110224+')';};var _0x12d69b={'where':{'id':_0x5485f3[_0x5dbf('0x49')]['id']}},_0x3b53da,_0x13c8ab,_0x2997a8,_0x5d7a37,_0x52109d;_0x12d69b=_[_0x5dbf('0x41')]({},_0x12d69b,_0x5485f3[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x12d69b)[_0x5dbf('0x22')](function(_0x1b42cf){if(_0x1b42cf){_0x3b53da=_0x1b42cf;return _0x1b42cf[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x57c568){if(_0x57c568){if(!_0x57c568['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5dbf('0x6e'),0x193);}_0x13c8ab=_0x57c568;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x29c4d9){if(_0x29c4d9){_0x2997a8=_[_0x5dbf('0x70')](_0x29c4d9,'id');var _0x5331ff;var _0x5bb990=squel[_0x5dbf('0x71')]();_0x5bb990[_0x5dbf('0x72')](_0x3b53da['table']);for(var _0x1728b9=0x0;_0x1728b9<_0x13c8ab[_0x5dbf('0x38')];_0x1728b9+=0x1){_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]?_0x2997a8[_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]]['metric']:_0x13c8ab[_0x1728b9][_0x5dbf('0x6a')];_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4107f1[_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]],'%s',_0x5331ff):_0x5331ff;_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]?_['replace'](_0x461ffb[_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]],'%s',_0x5331ff):_0x5331ff;if(_0x13c8ab[_0x1728b9][_0x5dbf('0x77')]){_0x5bb990[_0x5dbf('0x69')](_0x5331ff);}_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]&&_0x5bb990['order'](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]==='DESC'?![]:!![]);_0x5bb990[_0x5dbf('0x6a')](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x79')]||_0x5331ff);}if(_0x3b53da[_0x5dbf('0x7a')]){_0x3b53da['joins']=JSON[_0x5dbf('0x7b')](_0x3b53da[_0x5dbf('0x7a')]);for(var _0x4166ce=0x0;_0x4166ce<_0x3b53da[_0x5dbf('0x7a')]['length'];_0x4166ce+=0x1){if(_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x197e8c,_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')])&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce]['parentKey']&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')]&&_0x3b53da['joins'][_0x4166ce][_0x5dbf('0x7d')]){_0x5bb990[_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]](_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')](_0x5dbf('0x7e'),_0x3b53da[_0x5dbf('0x7f')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x80')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7d')]));}}}if(_0x3b53da[_0x5dbf('0x81')]){_0x3b53da[_0x5dbf('0x81')]=JSON['parse'](_0x3b53da[_0x5dbf('0x81')]);_0x5bb990[_0x5dbf('0x3e')](_0x553be4(_0x3b53da[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x52109d=_0x5bb990['clone']();_0x5bb990[_0x5dbf('0x1b')](_0x14bdb1);_0x5bb990[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')](_0x5dbf('0x83'),_0x5bb990[_0x5dbf('0x84')]());return dbH['sequelize'][_0x5dbf('0x32')](_0x5bb990[_0x5dbf('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x5dbf('0x85')]});}})[_0x5dbf('0x22')](respondWithResult(_0x19ec03,null))[_0x5dbf('0x54')](handleError(_0x19ec03,null));};function runReport(_0x8ca7de,_0x14b21b,_0x23ec75){var _0x22339b=_0x14b21b['name'];var _0x310078=0xa;var _0x3b01c0=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x4cceb1={'SUM':_0x5dbf('0x87'),'COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5924d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x4333db=function(_0x4cb92d){return!_['includes']([_0x5dbf('0x64'),'IS\x20NOT\x20NULL',_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x4cb92d);};var _0x541241=function(_0x3c7eaa){if(!_0x3c7eaa||!_0x3c7eaa['rules'][_0x5dbf('0x38')]){return'';}for(var _0x24d90a='(',_0xa3e94f=0x0;_0xa3e94f<_0x3c7eaa[_0x5dbf('0x67')][_0x5dbf('0x38')];_0xa3e94f+=0x1){_0xa3e94f>0x0&&(_0x24d90a+='\x20'+_0x3c7eaa['operator']+'\x20');_0x24d90a+=_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]?_0x541241(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]):_0x3c7eaa['rules'][_0xa3e94f][_0x5dbf('0x6a')]+'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')]+(_0x4333db(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')])?'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6c')]:'');}return _0x24d90a+')';};var _0x334f63={'where':{'id':_0x8ca7de['id']}},_0x5ac29f,_0x533fdd,_0x5bf068,_0x1bd06b,_0x274497;_0x334f63=_['merge']({},_0x334f63,_0x23ec75);return db['AnalyticDefaultReport']['find'](_0x334f63)[_0x5dbf('0x22')](function(_0x20bda9){if(_0x20bda9){_0x5ac29f=_0x20bda9;return _0x20bda9[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x12757d){if(_0x12757d){if(!_0x12757d[_0x5dbf('0x38')]){throw new db['Sequelize'][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x533fdd=_0x12757d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x5722b3){if(_0x5722b3){_0x5bf068=_['keyBy'](_0x5722b3,'id');var _0x3a27c4;var _0x3620d2=squel[_0x5dbf('0x71')]();_0x3620d2['from'](_0x5ac29f[_0x5dbf('0x7f')]);for(var _0x447259=0x0;_0x447259<_0x533fdd['length'];_0x447259+=0x1){_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x73')]?_0x5bf068[_0x533fdd[_0x447259][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x533fdd[_0x447259][_0x5dbf('0x6a')];_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4cceb1[_0x533fdd[_0x447259][_0x5dbf('0x74')]],'%s',_0x3a27c4):_0x3a27c4;_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x76')]?_['replace'](_0x5924d2[_0x533fdd[_0x447259]['format']],'%s',_0x3a27c4):_0x3a27c4;if(_0x533fdd[_0x447259]['groupBy']){_0x3620d2[_0x5dbf('0x69')](_0x3a27c4);}_0x533fdd[_0x447259][_0x5dbf('0x78')]&&_0x3620d2[_0x5dbf('0x3c')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x78')]===_0x5dbf('0x8e')?![]:!![]);_0x3620d2[_0x5dbf('0x6a')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x79')]||_0x3a27c4);}if(_0x5ac29f[_0x5dbf('0x7a')]){_0x5ac29f[_0x5dbf('0x7a')]=JSON[_0x5dbf('0x7b')](_0x5ac29f['joins']);for(var _0x2ded2b=0x0;_0x2ded2b<_0x5ac29f[_0x5dbf('0x7a')][_0x5dbf('0x38')];_0x2ded2b+=0x1){if(_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x3b01c0,_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')])&&_0x5ac29f['joins'][_0x2ded2b]['parentKey']&&_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b]['foreignTable']&&_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7d')]){_0x3620d2[_0x5ac29f['joins'][_0x2ded2b]['type']](_0x5ac29f['joins'][_0x2ded2b]['foreignTable'],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x5ac29f[_0x5dbf('0x7f')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x80')],_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7c')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x7d')]));}}}if(_0x5ac29f['conditions']){_0x5ac29f[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x5ac29f[_0x5dbf('0x81')]);_0x3620d2['where'](_0x541241(_0x5ac29f[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x274497=_0x3620d2[_0x5dbf('0x8f')]();_0x3620d2['limit'](_0x310078);_0x3620d2[_0x5dbf('0x3b')](0x0);return;}})[_0x5dbf('0x22')](function(){if(_0x14b21b[_0x5dbf('0x90')]==='web'){return null;}var _0x48a8c5=_['merge'](_0x14b21b,{'name':_0x14b21b[_0x5dbf('0x91')]||_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f[_0x5dbf('0x2a')],'basename':_0x22339b,'savename':util[_0x5dbf('0x76')](_0x5dbf('0x92'),_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f['name'],require(_0x5dbf('0x93'))[_0x5dbf('0x94')](0x4),_0x14b21b[_0x5dbf('0x90')]||'csv'),'reportId':_0x5ac29f['id'],'reportType':_0x5dbf('0x95')});return db[_0x5dbf('0x96')][_0x5dbf('0x4b')](_0x48a8c5,{'raw':!![]});})[_0x5dbf('0x22')](function(_0x2afbd4){if(_0x5ac29f[_0x5dbf('0x7f')]===_0x5dbf('0x97')){_0x274497['where'](_0x5ac29f[_0x5dbf('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b[_0x5dbf('0x98')],_0x14b21b[_0x5dbf('0x99')]);}else{_0x274497[_0x5dbf('0x3e')](_0x5ac29f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b['startDate'],_0x14b21b[_0x5dbf('0x99')]);}if(_0x2afbd4){logger[_0x5dbf('0x9a')]('Run\x20Query:',_0x274497[_0x5dbf('0x84')]());require('child_process')[_0x5dbf('0x9b')](path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9c'),_0x2afbd4['output']),[_0x2afbd4['id'],_0x274497[_0x5dbf('0x84')](),path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9d'),_0x2afbd4[_0x5dbf('0x9e')]),_0x22339b]);return _0x2afbd4;}else{var _0x4bc5af=squel[_0x5dbf('0x71')]();_0x4bc5af[_0x5dbf('0x72')]('('+_0x274497['toString']()+')',_0x5dbf('0x9f'));_0x4bc5af['field'](_0x5dbf('0xa0'),_0x5dbf('0x1d'));_0x274497[_0x5dbf('0x1b')](_0x14b21b['limit']||_0x310078);_0x274497[_0x5dbf('0x3b')](_0x14b21b[_0x5dbf('0x3b')]||0x0);return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x4bc5af[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')]['QueryTypes'][_0x5dbf('0x85')]})['then'](function(_0x6cfb82){if(!_0x6cfb82[_0x5dbf('0x38')]){_0x1bd06b=0x0;}else{_0x1bd06b=_0x6cfb82[0x0][_0x5dbf('0x1d')]||0x0;}return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x274497[_0x5dbf('0x84')](),{'type':dbH['sequelize'][_0x5dbf('0xa2')][_0x5dbf('0x85')]});})[_0x5dbf('0x22')](function(_0x4d68f6){return{'rows':_0x4d68f6||[],'count':_0x1bd06b};});}});}exports[_0x5dbf('0xa3')]=function(_0x47ac95,_0x51b241){return runReport(_0x47ac95[_0x5dbf('0x49')],_0x47ac95[_0x5dbf('0x32')],_0x47ac95[_0x5dbf('0x4a')])[_0x5dbf('0x22')](respondWithResult(_0x51b241,null))[_0x5dbf('0x54')](handleError(_0x51b241,null));};exports['runReport']=runReport;exports['query']=function(_0x4f38a0,_0x144300){var _0x1da1e3=0xa;var _0x25e681=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x236754={'SUM':'SUM(%s)','COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x191a16={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x51b0df=function(_0x48ea8a){return!_['includes']([_0x5dbf('0x64'),_0x5dbf('0x65'),_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x48ea8a);};var _0x3de263=function(_0x4f8dde){if(!_0x4f8dde||!_0x4f8dde[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x19effa='(',_0x29177e=0x0;_0x29177e<_0x4f8dde[_0x5dbf('0x67')]['length'];_0x29177e+=0x1){_0x29177e>0x0&&(_0x19effa+='\x20'+_0x4f8dde[_0x5dbf('0x68')]+'\x20');_0x19effa+=_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x69')]?_0x3de263(_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['group']):_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6a')]+'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')]+(_0x51b0df(_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')])?'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['value']:'');}return _0x19effa+')';};var _0x4899ac={'where':{'id':_0x4f38a0['params']['id']}},_0x51864c,_0x4562a4,_0x240304,_0x5df275,_0xc588a2;_0x4899ac=_[_0x5dbf('0x41')]({},_0x4899ac,_0x4f38a0['options']);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x4899ac)[_0x5dbf('0x22')](function(_0x2eafe0){if(_0x2eafe0){_0x51864c=_0x2eafe0;return _0x2eafe0[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x414859){if(_0x414859){if(!_0x414859['length']){throw new db[(_0x5dbf('0xa4'))][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x4562a4=_0x414859;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x153401){if(_0x153401){_0x240304=_[_0x5dbf('0x70')](_0x153401,'id');var _0xbe0ca0;var _0x521c72=squel[_0x5dbf('0x71')]();_0x521c72[_0x5dbf('0x72')](_0x51864c[_0x5dbf('0x7f')]);for(var _0x6b4262=0x0;_0x6b4262<_0x4562a4[_0x5dbf('0x38')];_0x6b4262+=0x1){_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x73')]?_0x240304[_0x4562a4[_0x6b4262][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x4562a4[_0x6b4262][_0x5dbf('0x6a')];_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x236754[_0x4562a4[_0x6b4262][_0x5dbf('0x74')]],'%s',_0xbe0ca0):_0xbe0ca0;_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x76')]?_[_0x5dbf('0x75')](_0x191a16[_0x4562a4[_0x6b4262][_0x5dbf('0x76')]],'%s',_0xbe0ca0):_0xbe0ca0;if(_0x4562a4[_0x6b4262][_0x5dbf('0x77')]){_0x521c72[_0x5dbf('0x69')](_0xbe0ca0);}_0x4562a4[_0x6b4262][_0x5dbf('0x78')]&&_0x521c72[_0x5dbf('0x3c')](_0xbe0ca0,_0x4562a4[_0x6b4262]['orderBy']===_0x5dbf('0x8e')?![]:!![]);_0x521c72['field'](_0xbe0ca0,_0x4562a4[_0x6b4262][_0x5dbf('0x79')]||_0xbe0ca0);}if(_0x51864c['joins']){_0x51864c[_0x5dbf('0x7a')]=JSON['parse'](_0x51864c[_0x5dbf('0x7a')]);for(var _0x417869=0x0;_0x417869<_0x51864c[_0x5dbf('0x7a')]['length'];_0x417869+=0x1){if(_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x25e681,_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')])&&_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x80')]&&_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')]&&_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignKey']){_0x521c72[_0x51864c[_0x5dbf('0x7a')][_0x417869]['type']](_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x51864c[_0x5dbf('0x7f')],_0x51864c['joins'][_0x417869]['parentKey'],_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignTable'],_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x7d')]));}}}if(_0x51864c[_0x5dbf('0x81')]){_0x51864c[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x51864c[_0x5dbf('0x81')]);_0x521c72[_0x5dbf('0x3e')](_0x3de263(_0x51864c[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0xc588a2=_0x521c72[_0x5dbf('0x8f')]();_0x521c72[_0x5dbf('0x1b')](_0x1da1e3);_0x521c72[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')]('Limited\x20Query:',_0x521c72[_0x5dbf('0x84')]());return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x521c72[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')][_0x5dbf('0xa2')]['SELECT']});}})[_0x5dbf('0x22')](function(){return{'sql':_0xc588a2[_0x5dbf('0x84')]()};})[_0x5dbf('0x22')](respondWithResult(_0x144300,null))[_0x5dbf('0x54')](handleError(_0x144300,null));};
\ No newline at end of file
+var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2ef3,0xba));var _0x32ef=function(_0x520580,_0x3b5fc4){_0x520580=_0x520580-0x0;var _0x4e0965=_0x2ef3[_0x520580];return _0x4e0965;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 367d402..a6967a3 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 _0x134a=['define','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','request-promise','path','../../config/environment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x134a,0x1f2));var _0xa134=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x134a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa134('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa134('0x1'));var moment=require(_0xa134('0x2'));var BPromise=require('bluebird');var rp=require(_0xa134('0x3'));var fs=require('fs');var path=require(_0xa134('0x4'));var rimraf=require('rimraf');var config=require(_0xa134('0x5'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x45c3a0,_0x3d7e1d){return _0x45c3a0[_0xa134('0x6')](_0xa134('0x7'),attributes,{'tableName':_0xa134('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0296=['define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports'];(function(_0x56ee15,_0x1effd1){var _0x94991f=function(_0x5018fa){while(--_0x5018fa){_0x56ee15['push'](_0x56ee15['shift']());}};_0x94991f(++_0x1effd1);}(_0x0296,0x121));var _0x6029=function(_0x530c53,_0x546020){_0x530c53=_0x530c53-0x0;var _0x5408ca=_0x0296[_0x530c53];return _0x5408ca;};'use strict';var _=require(_0x6029('0x0'));var util=require(_0x6029('0x1'));var logger=require('../../config/logger')(_0x6029('0x2'));var moment=require(_0x6029('0x3'));var BPromise=require(_0x6029('0x4'));var rp=require(_0x6029('0x5'));var fs=require('fs');var path=require(_0x6029('0x6'));var rimraf=require(_0x6029('0x7'));var config=require('../../config/environment');var attributes=require(_0x6029('0x8'));module[_0x6029('0x9')]=function(_0x23b434,_0x4d03dc){return _0x23b434[_0x6029('0xa')](_0x6029('0xb'),attributes,{'tableName':_0x6029('0xc'),'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 db6138f..9ce93cf 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 _0x7a12=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','moment','ioredis'];(function(_0x339e28,_0x341e2c){var _0x1605dd=function(_0x3c6006){while(--_0x3c6006){_0x339e28['push'](_0x339e28['shift']());}};_0x1605dd(++_0x341e2c);}(_0x7a12,0x12f));var _0x27a1=function(_0x2f81d6,_0x23325d){_0x2f81d6=_0x2f81d6-0x0;var _0x283317=_0x7a12[_0x2f81d6];return _0x283317;};'use strict';var _=require(_0x27a1('0x0'));var util=require('util');var moment=require(_0x27a1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27a1('0x2'));var db=require(_0x27a1('0x3'))['db'];var utils=require(_0x27a1('0x4'));var logger=require(_0x27a1('0x5'))(_0x27a1('0x6'));var config=require('../../config/environment');var jayson=require(_0x27a1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dfa9c,_0x112c32,_0x1d79bf){return new BPromise(function(_0xb4f175,_0x11ea72){return client['request'](_0x1dfa9c,_0x1d79bf)['then'](function(_0x2234ff){logger[_0x27a1('0x8')](_0x27a1('0x9'),_0x112c32,'request\x20sent');logger[_0x27a1('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x112c32,_0x27a1('0xb'),JSON[_0x27a1('0xc')](_0x2234ff));if(_0x2234ff['error']){if(_0x2234ff['error'][_0x27a1('0xd')]===0x1f4){logger[_0x27a1('0xe')](_0x27a1('0x9'),_0x112c32,_0x2234ff[_0x27a1('0xe')][_0x27a1('0xf')]);return _0x11ea72(_0x2234ff['error'][_0x27a1('0xf')]);}logger[_0x27a1('0xe')](_0x27a1('0x9'),_0x112c32,_0x2234ff[_0x27a1('0xe')]['message']);return _0xb4f175(_0x2234ff[_0x27a1('0xe')][_0x27a1('0xf')]);}else{logger[_0x27a1('0x8')](_0x27a1('0x9'),_0x112c32,_0x27a1('0xb'));_0xb4f175(_0x2234ff[_0x27a1('0x10')]['message']);}})[_0x27a1('0x11')](function(_0x1918b0){logger[_0x27a1('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x112c32,_0x1918b0);_0x11ea72(_0x1918b0);});});}
\ No newline at end of file
+var _0xefb0=['error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify'];(function(_0x4d5f65,_0x56e4c0){var _0x833d00=function(_0x1a426d){while(--_0x1a426d){_0x4d5f65['push'](_0x4d5f65['shift']());}};_0x833d00(++_0x56e4c0);}(_0xefb0,0x141));var _0x0efb=function(_0x88e4ae,_0x2dcc9d){_0x88e4ae=_0x88e4ae-0x0;var _0x4a9e6a=_0xefb0[_0x88e4ae];return _0x4a9e6a;};'use strict';var _=require(_0x0efb('0x0'));var util=require(_0x0efb('0x1'));var moment=require(_0x0efb('0x2'));var BPromise=require('bluebird');var rs=require(_0x0efb('0x3'));var fs=require('fs');var Redis=require(_0x0efb('0x4'));var db=require(_0x0efb('0x5'))['db'];var utils=require(_0x0efb('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0efb('0x7'));var jayson=require(_0x0efb('0x8'));var client=jayson['client'][_0x0efb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2986d2,_0x402244,_0x1c7bac){return new BPromise(function(_0x4d02db,_0x1b1f7b){return client['request'](_0x2986d2,_0x1c7bac)[_0x0efb('0xa')](function(_0x110d2d){logger[_0x0efb('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x402244,_0x0efb('0xc'));logger[_0x0efb('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x402244,'request\x20sent',JSON[_0x0efb('0xe')](_0x110d2d));if(_0x110d2d[_0x0efb('0xf')]){if(_0x110d2d[_0x0efb('0xf')][_0x0efb('0x10')]===0x1f4){logger['error'](_0x0efb('0x11'),_0x402244,_0x110d2d['error'][_0x0efb('0x12')]);return _0x1b1f7b(_0x110d2d[_0x0efb('0xf')]['message']);}logger[_0x0efb('0xf')](_0x0efb('0x11'),_0x402244,_0x110d2d['error'][_0x0efb('0x12')]);return _0x4d02db(_0x110d2d[_0x0efb('0xf')][_0x0efb('0x12')]);}else{logger[_0x0efb('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x402244,'request\x20sent');_0x4d02db(_0x110d2d[_0x0efb('0x13')][_0x0efb('0x12')]);}})[_0x0efb('0x14')](function(_0x49a749){logger[_0x0efb('0xf')](_0x0efb('0x11'),_0x402244,_0x49a749);_0x1b1f7b(_0x49a749);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 3850354..2f8fe97 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 _0xa9f8=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xa9f8,0xe0));var _0x8a9f=function(_0x186b12,_0x174b36){_0x186b12=_0x186b12-0x0;var _0x3177f4=_0xa9f8[_0x186b12];return _0x3177f4;};'use strict';var multer=require(_0x8a9f('0x0'));var util=require(_0x8a9f('0x1'));var path=require(_0x8a9f('0x2'));var timeout=require(_0x8a9f('0x3'));var express=require('express');var router=express[_0x8a9f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8a9f('0x5'));var interaction=require(_0x8a9f('0x6'));var config=require(_0x8a9f('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x8a9f('0x8')]('/',auth[_0x8a9f('0x9')](),controller[_0x8a9f('0xa')]);router[_0x8a9f('0x8')](_0x8a9f('0xb'),auth['isAuthenticated'](),controller[_0x8a9f('0xc')]);router[_0x8a9f('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0x8a9f('0xd')]);router[_0x8a9f('0x8')](_0x8a9f('0xe'),auth[_0x8a9f('0x9')](),controller[_0x8a9f('0xf')]);router[_0x8a9f('0x8')](_0x8a9f('0x10'),auth[_0x8a9f('0x9')](),controller[_0x8a9f('0x11')]);router[_0x8a9f('0x12')]('/',auth[_0x8a9f('0x9')](),controller[_0x8a9f('0x13')]);router[_0x8a9f('0x14')](_0x8a9f('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8a9f('0xb'),auth['isAuthenticated'](),controller[_0x8a9f('0x15')]);module[_0x8a9f('0x16')]=router;
\ No newline at end of file
+var _0x8212=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','query','put','update','destroy','exports','multer','util'];(function(_0x1ffa99,_0x2de160){var _0x58d2d8=function(_0x31c824){while(--_0x31c824){_0x1ffa99['push'](_0x1ffa99['shift']());}};_0x58d2d8(++_0x2de160);}(_0x8212,0xbb));var _0x2821=function(_0x5957f0,_0x530235){_0x5957f0=_0x5957f0-0x0;var _0x53cb51=_0x8212[_0x5957f0];return _0x53cb51;};'use strict';var multer=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var path=require(_0x2821('0x2'));var timeout=require(_0x2821('0x3'));var express=require('express');var router=express[_0x2821('0x4')]();var fs_extra=require(_0x2821('0x5'));var auth=require(_0x2821('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2821('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x2821('0x8')]('/',auth[_0x2821('0x9')](),controller[_0x2821('0xa')]);router[_0x2821('0x8')](_0x2821('0xb'),auth[_0x2821('0x9')](),controller[_0x2821('0xc')]);router[_0x2821('0x8')](_0x2821('0xd'),auth[_0x2821('0x9')](),controller['preview']);router[_0x2821('0x8')](_0x2821('0xe'),auth['isAuthenticated'](),controller[_0x2821('0xf')]);router['get']('/:id/query',auth[_0x2821('0x9')](),controller[_0x2821('0x10')]);router['post']('/',auth[_0x2821('0x9')](),controller['create']);router[_0x2821('0x11')](_0x2821('0xb'),auth['isAuthenticated'](),controller[_0x2821('0x12')]);router['delete']('/:id',auth[_0x2821('0x9')](),controller[_0x2821('0x13')]);module[_0x2821('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 1856521..aad0411 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 _0x0077=['moment','exports','STRING','csv','pdf','xlsx','Loading','ENUM','manual','scheduled','UNSIGNED','sequelize'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x0077,0xbf));var _0x7007=function(_0x51255b,_0x3cfa7a){_0x51255b=_0x51255b-0x0;var _0x56d770=_0x0077[_0x51255b];return _0x56d770;};'use strict';var Sequelize=require(_0x7007('0x0'));var moment=require(_0x7007('0x1'));module[_0x7007('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x7007('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x7007('0x4'),_0x7007('0x5'),_0x7007('0x6')),'allowNull':![],'defaultValue':_0x7007('0x4')},'savename':{'type':Sequelize[_0x7007('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x7007('0x3')],'defaultValue':_0x7007('0x7')},'type':{'type':Sequelize[_0x7007('0x8')](_0x7007('0x9'),_0x7007('0xa')),'allowNull':![],'defaultValue':_0x7007('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x7007('0xb')]},'reportType':{'type':Sequelize[_0x7007('0x3')]}};
\ No newline at end of file
+var _0x88b0=['DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','STRING','ENUM','csv','pdf','xlsx'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x88b0,0x170));var _0x088b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x88b0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x088b('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x088b('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x088b('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x088b('0x2')](_0x088b('0x3'),_0x088b('0x4'),_0x088b('0x5')),'allowNull':![],'defaultValue':_0x088b('0x3')},'savename':{'type':Sequelize[_0x088b('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x088b('0x6')]},'endDate':{'type':Sequelize[_0x088b('0x6')]},'status':{'type':Sequelize[_0x088b('0x1')],'defaultValue':_0x088b('0x7')},'type':{'type':Sequelize[_0x088b('0x2')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x088b('0x8')},'reportId':{'type':Sequelize[_0x088b('0x9')](0xb)[_0x088b('0xa')]},'reportType':{'type':Sequelize[_0x088b('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 16721e7..7c8a1fd 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 _0xcd67=['status','end','offset','limit','undefined','count','apply','save','update','destroy','then','ExtractedReports','UserProfileResource','error','name','index','AnalyticExtractedReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xcd67,0xa7));var _0x7cd6=function(_0x2bed47,_0x4fa9ae){_0x2bed47=_0x2bed47-0x0;var _0x11ca23=_0xcd67[_0x2bed47];return _0x11ca23;};'use strict';var emlformat=require(_0x7cd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7cd6('0x1'));var jsonpatch=require(_0x7cd6('0x2'));var rp=require(_0x7cd6('0x3'));var moment=require(_0x7cd6('0x4'));var BPromise=require(_0x7cd6('0x5'));var Mustache=require(_0x7cd6('0x6'));var util=require('util');var path=require(_0x7cd6('0x7'));var sox=require(_0x7cd6('0x8'));var csv=require(_0x7cd6('0x9'));var ejs=require(_0x7cd6('0xa'));var fs=require('fs');var fs_extra=require(_0x7cd6('0xb'));var _=require(_0x7cd6('0xc'));var squel=require(_0x7cd6('0xd'));var crypto=require(_0x7cd6('0xe'));var jsforce=require(_0x7cd6('0xf'));var deskjs=require(_0x7cd6('0x10'));var toCsv=require(_0x7cd6('0x9'));var querystring=require(_0x7cd6('0x11'));var Papa=require(_0x7cd6('0x12'));var Redis=require(_0x7cd6('0x13'));var authService=require(_0x7cd6('0x14'));var qs=require(_0x7cd6('0x15'));var as=require(_0x7cd6('0x16'));var hardwareService=require(_0x7cd6('0x17'));var logger=require('../../config/logger')(_0x7cd6('0x18'));var utils=require(_0x7cd6('0x19'));var config=require(_0x7cd6('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x7cd6('0x1b'))['db'];function respondWithStatusCode(_0x5a28f7,_0x546fd3){_0x546fd3=_0x546fd3||0xcc;return function(_0x4506f1){if(_0x4506f1){return _0x5a28f7[_0x7cd6('0x1c')](_0x546fd3);}return _0x5a28f7[_0x7cd6('0x1d')](_0x546fd3)[_0x7cd6('0x1e')]();};}function respondWithResult(_0x20a20a,_0x10efb4){_0x10efb4=_0x10efb4||0xc8;return function(_0x433941){if(_0x433941){return _0x20a20a[_0x7cd6('0x1d')](_0x10efb4)['json'](_0x433941);}};}function respondWithFilteredResult(_0x562b8f,_0x573af3){return function(_0x3fe196){if(_0x3fe196){var _0x163a88=typeof _0x573af3[_0x7cd6('0x1f')]==='undefined'&&typeof _0x573af3[_0x7cd6('0x20')]===_0x7cd6('0x21');var _0x36cb3a=_0x3fe196['count'];var _0x3482bb=_0x163a88?0x0:_0x573af3[_0x7cd6('0x1f')];var _0x4ee093=_0x163a88?_0x3fe196[_0x7cd6('0x22')]:_0x573af3[_0x7cd6('0x1f')]+_0x573af3[_0x7cd6('0x20')];var _0x4971bf;if(_0x4ee093>=_0x36cb3a){_0x4ee093=_0x36cb3a;_0x4971bf=0xc8;}else{_0x4971bf=0xce;}_0x562b8f['status'](_0x4971bf);return _0x562b8f['set']('Content-Range',_0x3482bb+'-'+_0x4ee093+'/'+_0x36cb3a)['json'](_0x3fe196);}return null;};}function patchUpdates(_0x40fce6){return function(_0x5a9e62){try{jsonpatch[_0x7cd6('0x23')](_0x5a9e62,_0x40fce6,!![]);}catch(_0xf5a298){return BPromise['reject'](_0xf5a298);}return _0x5a9e62[_0x7cd6('0x24')]();};}function saveUpdates(_0x464029,_0x4f8c47){return function(_0x288b07){if(_0x288b07){return _0x288b07[_0x7cd6('0x25')](_0x464029)['then'](function(_0x3e1c8a){return _0x3e1c8a;});}return null;};}function removeEntity(_0x1f9732,_0x5a98e1){return function(_0x414ca7){if(_0x414ca7){return _0x414ca7[_0x7cd6('0x26')]()[_0x7cd6('0x27')](function(){var _0x10ff07=_0x414ca7['get']({'plain':!![]});var _0x53e89d=_0x7cd6('0x28');return db[_0x7cd6('0x29')][_0x7cd6('0x26')]({'where':{'type':_0x53e89d,'resourceId':_0x10ff07['id']}})['then'](function(){return _0x414ca7;});})[_0x7cd6('0x27')](function(){_0x1f9732[_0x7cd6('0x1d')](0xcc)[_0x7cd6('0x1e')]();});}};}function handleEntityNotFound(_0x293c51,_0x29e83a){return function(_0x32b39d){if(!_0x32b39d){_0x293c51[_0x7cd6('0x1c')](0x194);}return _0x32b39d;};}function handleError(_0x481cf0,_0x37ddd3){_0x37ddd3=_0x37ddd3||0x1f4;return function(_0x475f95){logger[_0x7cd6('0x2a')](_0x475f95['stack']);if(_0x475f95[_0x7cd6('0x2b')]){delete _0x475f95[_0x7cd6('0x2b')];}_0x481cf0['status'](_0x37ddd3)['send'](_0x475f95);};}exports[_0x7cd6('0x2c')]=function(_0x41fb88,_0xa76a5c){var _0x232e98={},_0x238bcc={},_0x21b24c={'count':0x0,'rows':[]};var _0x2954bb=_['map'](db[_0x7cd6('0x2d')][_0x7cd6('0x2e')],function(_0x1687d4){return{'name':_0x1687d4[_0x7cd6('0x2f')],'type':_0x1687d4['type'][_0x7cd6('0x30')]};});_0x238bcc[_0x7cd6('0x31')]=_[_0x7cd6('0x32')](_0x2954bb,_0x7cd6('0x2b'));_0x238bcc[_0x7cd6('0x33')]=_[_0x7cd6('0x34')](_0x41fb88[_0x7cd6('0x33')]);_0x238bcc[_0x7cd6('0x35')]=_['intersection'](_0x238bcc[_0x7cd6('0x31')],_0x238bcc['query']);_0x232e98[_0x7cd6('0x36')]=_[_0x7cd6('0x37')](_0x238bcc['model'],qs[_0x7cd6('0x38')](_0x41fb88[_0x7cd6('0x33')]['fields']));_0x232e98['attributes']=_0x232e98[_0x7cd6('0x36')]['length']?_0x232e98['attributes']:_0x238bcc[_0x7cd6('0x31')];if(!_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x39')](_0x7cd6('0x3a'))){_0x232e98[_0x7cd6('0x20')]=qs[_0x7cd6('0x20')](_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x20')]);_0x232e98[_0x7cd6('0x1f')]=qs[_0x7cd6('0x1f')](_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x1f')]);}_0x232e98[_0x7cd6('0x3b')]=qs[_0x7cd6('0x3c')](_0x41fb88['query']['sort']);_0x232e98[_0x7cd6('0x3d')]=qs[_0x7cd6('0x35')](_[_0x7cd6('0x3e')](_0x41fb88[_0x7cd6('0x33')],_0x238bcc[_0x7cd6('0x35')]),_0x2954bb);if(_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x3f')]){_0x232e98[_0x7cd6('0x3d')]=_[_0x7cd6('0x40')](_0x232e98[_0x7cd6('0x3d')],{'$or':_[_0x7cd6('0x32')](_0x2954bb,function(_0x503d00){if(_0x503d00['type']!==_0x7cd6('0x41')){var _0x42c593={};_0x42c593[_0x503d00['name']]={'$like':'%'+_0x41fb88[_0x7cd6('0x33')]['filter']+'%'};return _0x42c593;}})});}_0x232e98=_['merge']({},_0x232e98,_0x41fb88[_0x7cd6('0x42')]);var _0x16b04b={'where':_0x232e98[_0x7cd6('0x3d')]};return db['AnalyticExtractedReport'][_0x7cd6('0x22')](_0x16b04b)[_0x7cd6('0x27')](function(_0x5e6706){_0x21b24c[_0x7cd6('0x22')]=_0x5e6706;if(_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x43')]){_0x232e98[_0x7cd6('0x44')]=[{'all':!![]}];}return db[_0x7cd6('0x2d')]['findAll'](_0x232e98);})[_0x7cd6('0x27')](function(_0x25529d){_0x21b24c[_0x7cd6('0x45')]=_0x25529d;return _0x21b24c;})[_0x7cd6('0x27')](respondWithFilteredResult(_0xa76a5c,_0x232e98))[_0x7cd6('0x46')](handleError(_0xa76a5c,null));};exports[_0x7cd6('0x47')]=function(_0x40fae3,_0x39de4c){var _0x61ef2c={'raw':!![],'where':{'id':_0x40fae3['params']['id']}},_0x54e222={};_0x54e222[_0x7cd6('0x31')]=_[_0x7cd6('0x34')](db[_0x7cd6('0x2d')][_0x7cd6('0x2e')]);_0x54e222[_0x7cd6('0x33')]=_[_0x7cd6('0x34')](_0x40fae3[_0x7cd6('0x33')]);_0x54e222['filters']=_[_0x7cd6('0x37')](_0x54e222[_0x7cd6('0x31')],_0x54e222[_0x7cd6('0x33')]);_0x61ef2c[_0x7cd6('0x36')]=_['intersection'](_0x54e222[_0x7cd6('0x31')],qs[_0x7cd6('0x38')](_0x40fae3[_0x7cd6('0x33')]['fields']));_0x61ef2c[_0x7cd6('0x36')]=_0x61ef2c[_0x7cd6('0x36')][_0x7cd6('0x48')]?_0x61ef2c[_0x7cd6('0x36')]:_0x54e222[_0x7cd6('0x31')];if(_0x40fae3['query'][_0x7cd6('0x43')]){_0x61ef2c['include']=[{'all':!![]}];}_0x61ef2c=_['merge']({},_0x61ef2c,_0x40fae3['options']);return db[_0x7cd6('0x2d')][_0x7cd6('0x49')](_0x61ef2c)[_0x7cd6('0x27')](handleEntityNotFound(_0x39de4c,null))[_0x7cd6('0x27')](respondWithResult(_0x39de4c,null))[_0x7cd6('0x46')](handleError(_0x39de4c,null));};exports[_0x7cd6('0x4a')]=function(_0x458706,_0x27eceb){return db[_0x7cd6('0x2d')][_0x7cd6('0x4a')](_0x458706[_0x7cd6('0x4b')],{})[_0x7cd6('0x27')](function(_0x54acae){var _0x328373=_0x458706[_0x7cd6('0x4c')][_0x7cd6('0x4d')]({'plain':!![]});if(!_0x328373)throw new Error(_0x7cd6('0x4e'));if(_0x328373['role']===_0x7cd6('0x4c')){var _0x225401=_0x54acae[_0x7cd6('0x4d')]({'plain':!![]});var _0x1bb9e1=_0x7cd6('0x28');return db[_0x7cd6('0x4f')][_0x7cd6('0x49')]({'where':{'name':_0x1bb9e1,'userProfileId':_0x328373[_0x7cd6('0x50')]},'raw':!![]})['then'](function(_0xd231af){if(_0xd231af&&_0xd231af[_0x7cd6('0x51')]===0x0){return db[_0x7cd6('0x29')][_0x7cd6('0x4a')]({'name':_0x225401[_0x7cd6('0x2b')],'resourceId':_0x225401['id'],'type':_0xd231af['name'],'sectionId':_0xd231af['id']},{})['then'](function(){return _0x54acae;});}else{return _0x54acae;}})['catch'](function(_0x587eb0){logger[_0x7cd6('0x2a')](_0x7cd6('0x52'),_0x587eb0);throw _0x587eb0;});}return _0x54acae;})[_0x7cd6('0x27')](respondWithResult(_0x27eceb,0xc9))[_0x7cd6('0x46')](handleError(_0x27eceb,null));};exports['update']=function(_0x4879b1,_0x2eba42){if(_0x4879b1[_0x7cd6('0x4b')]['id']){delete _0x4879b1['body']['id'];}return db[_0x7cd6('0x2d')][_0x7cd6('0x49')]({'where':{'id':_0x4879b1[_0x7cd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x2eba42,null))['then'](saveUpdates(_0x4879b1[_0x7cd6('0x4b')],null))['then'](respondWithResult(_0x2eba42,null))[_0x7cd6('0x46')](handleError(_0x2eba42,null));};exports[_0x7cd6('0x26')]=function(_0xa98b44,_0x1400a4){return db[_0x7cd6('0x2d')]['find']({'where':{'id':_0xa98b44[_0x7cd6('0x53')]['id']}})[_0x7cd6('0x27')](handleEntityNotFound(_0x1400a4,null))['then'](removeEntity(_0x1400a4,null))[_0x7cd6('0x46')](handleError(_0x1400a4,null));};exports[_0x7cd6('0x54')]=function(_0x4b81a1,_0x565e8c,_0x396703){return db[_0x7cd6('0x2d')][_0x7cd6('0x49')]({'where':{'id':_0x4b81a1[_0x7cd6('0x53')]['id']},'attributes':[_0x7cd6('0x2b'),_0x7cd6('0x55'),'savename',_0x7cd6('0x56')],'raw':!![]})[_0x7cd6('0x27')](handleEntityNotFound(_0x565e8c,null))[_0x7cd6('0x27')](function(_0x504e73){if(_0x504e73){if(!fs[_0x7cd6('0x57')](path[_0x7cd6('0x58')](config[_0x7cd6('0x59')],_0x7cd6('0x5a'),_0x504e73[_0x7cd6('0x5b')]))){throw new db['Sequelize'][(_0x7cd6('0x5c'))](_0x7cd6('0x5d'));}if(_0x4b81a1[_0x7cd6('0x33')][_0x7cd6('0x5e')]){return _0x565e8c[_0x7cd6('0x1c')](0xc8);}return _0x565e8c[_0x7cd6('0x54')](path[_0x7cd6('0x58')](config[_0x7cd6('0x59')],'server/files/reports',_0x504e73['savename']),util[_0x7cd6('0x5f')](_0x7cd6('0x60'),_0x504e73[_0x7cd6('0x55')]||_0x504e73[_0x7cd6('0x2b')],_0x504e73[_0x7cd6('0x56')][_0x7cd6('0x61')]()));}})[_0x7cd6('0x46')](handleError(_0x565e8c,null));};
\ No newline at end of file
+var _0xf675=['server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync'];(function(_0x1033d7,_0x2a0b11){var _0x491d46=function(_0xd8a62f){while(--_0xd8a62f){_0x1033d7['push'](_0x1033d7['shift']());}};_0x491d46(++_0x2a0b11);}(_0xf675,0xc4));var _0x5f67=function(_0x10a8d8,_0x28f292){_0x10a8d8=_0x10a8d8-0x0;var _0x3b2b79=_0xf675[_0x10a8d8];return _0x3b2b79;};'use strict';var emlformat=require(_0x5f67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f67('0x1'));var jsonpatch=require(_0x5f67('0x2'));var rp=require(_0x5f67('0x3'));var moment=require(_0x5f67('0x4'));var BPromise=require(_0x5f67('0x5'));var Mustache=require('mustache');var util=require(_0x5f67('0x6'));var path=require(_0x5f67('0x7'));var sox=require(_0x5f67('0x8'));var csv=require(_0x5f67('0x9'));var ejs=require(_0x5f67('0xa'));var fs=require('fs');var fs_extra=require(_0x5f67('0xb'));var _=require(_0x5f67('0xc'));var squel=require(_0x5f67('0xd'));var crypto=require('crypto');var jsforce=require(_0x5f67('0xe'));var deskjs=require(_0x5f67('0xf'));var toCsv=require(_0x5f67('0x9'));var querystring=require(_0x5f67('0x10'));var Papa=require(_0x5f67('0x11'));var Redis=require('ioredis');var authService=require(_0x5f67('0x12'));var qs=require(_0x5f67('0x13'));var as=require(_0x5f67('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f67('0x15'))(_0x5f67('0x16'));var utils=require(_0x5f67('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x321e25,_0x4b83d0){_0x4b83d0=_0x4b83d0||0xcc;return function(_0x505c05){if(_0x505c05){return _0x321e25['sendStatus'](_0x4b83d0);}return _0x321e25['status'](_0x4b83d0)[_0x5f67('0x18')]();};}function respondWithResult(_0x3d35e7,_0x22da55){_0x22da55=_0x22da55||0xc8;return function(_0x1239c0){if(_0x1239c0){return _0x3d35e7[_0x5f67('0x19')](_0x22da55)[_0x5f67('0x1a')](_0x1239c0);}};}function respondWithFilteredResult(_0x1913f8,_0x3d7b1f){return function(_0x17c03b){if(_0x17c03b){var _0x24134f=typeof _0x3d7b1f['offset']===_0x5f67('0x1b')&&typeof _0x3d7b1f[_0x5f67('0x1c')]===_0x5f67('0x1b');var _0x18a531=_0x17c03b['count'];var _0x1c414e=_0x24134f?0x0:_0x3d7b1f[_0x5f67('0x1d')];var _0x47e7f3=_0x24134f?_0x17c03b[_0x5f67('0x1e')]:_0x3d7b1f['offset']+_0x3d7b1f[_0x5f67('0x1c')];var _0x2c318a;if(_0x47e7f3>=_0x18a531){_0x47e7f3=_0x18a531;_0x2c318a=0xc8;}else{_0x2c318a=0xce;}_0x1913f8[_0x5f67('0x19')](_0x2c318a);return _0x1913f8[_0x5f67('0x1f')](_0x5f67('0x20'),_0x1c414e+'-'+_0x47e7f3+'/'+_0x18a531)[_0x5f67('0x1a')](_0x17c03b);}return null;};}function patchUpdates(_0x1b1dac){return function(_0x4cc426){try{jsonpatch[_0x5f67('0x21')](_0x4cc426,_0x1b1dac,!![]);}catch(_0x3b87d6){return BPromise['reject'](_0x3b87d6);}return _0x4cc426['save']();};}function saveUpdates(_0x254cdd,_0x3a455d){return function(_0x3427f6){if(_0x3427f6){return _0x3427f6[_0x5f67('0x22')](_0x254cdd)[_0x5f67('0x23')](function(_0x2baf38){return _0x2baf38;});}return null;};}function removeEntity(_0x39ae42,_0xe42fb9){return function(_0x17d014){if(_0x17d014){return _0x17d014[_0x5f67('0x24')]()[_0x5f67('0x23')](function(){var _0x2dfc38=_0x17d014[_0x5f67('0x25')]({'plain':!![]});var _0x3602f0=_0x5f67('0x26');return db[_0x5f67('0x27')][_0x5f67('0x24')]({'where':{'type':_0x3602f0,'resourceId':_0x2dfc38['id']}})['then'](function(){return _0x17d014;});})[_0x5f67('0x23')](function(){_0x39ae42[_0x5f67('0x19')](0xcc)[_0x5f67('0x18')]();});}};}function handleEntityNotFound(_0x111c9f,_0x25b618){return function(_0x59bbde){if(!_0x59bbde){_0x111c9f[_0x5f67('0x28')](0x194);}return _0x59bbde;};}function handleError(_0x393b79,_0x3d0e90){_0x3d0e90=_0x3d0e90||0x1f4;return function(_0x57e331){logger[_0x5f67('0x29')](_0x57e331[_0x5f67('0x2a')]);if(_0x57e331[_0x5f67('0x2b')]){delete _0x57e331[_0x5f67('0x2b')];}_0x393b79[_0x5f67('0x19')](_0x3d0e90)[_0x5f67('0x2c')](_0x57e331);};}exports[_0x5f67('0x2d')]=function(_0x19cd6b,_0x116139){var _0x5afbb4={},_0xd3e34e={},_0x5f3a13={'count':0x0,'rows':[]};var _0x492494=_[_0x5f67('0x2e')](db[_0x5f67('0x2f')][_0x5f67('0x30')],function(_0x571a61){return{'name':_0x571a61[_0x5f67('0x31')],'type':_0x571a61[_0x5f67('0x32')][_0x5f67('0x33')]};});_0xd3e34e[_0x5f67('0x34')]=_[_0x5f67('0x2e')](_0x492494,_0x5f67('0x2b'));_0xd3e34e[_0x5f67('0x35')]=_[_0x5f67('0x36')](_0x19cd6b['query']);_0xd3e34e['filters']=_[_0x5f67('0x37')](_0xd3e34e[_0x5f67('0x34')],_0xd3e34e[_0x5f67('0x35')]);_0x5afbb4[_0x5f67('0x38')]=_[_0x5f67('0x37')](_0xd3e34e[_0x5f67('0x34')],qs[_0x5f67('0x39')](_0x19cd6b[_0x5f67('0x35')]['fields']));_0x5afbb4[_0x5f67('0x38')]=_0x5afbb4[_0x5f67('0x38')][_0x5f67('0x3a')]?_0x5afbb4[_0x5f67('0x38')]:_0xd3e34e[_0x5f67('0x34')];if(!_0x19cd6b[_0x5f67('0x35')]['hasOwnProperty'](_0x5f67('0x3b'))){_0x5afbb4[_0x5f67('0x1c')]=qs[_0x5f67('0x1c')](_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x1c')]);_0x5afbb4[_0x5f67('0x1d')]=qs['offset'](_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x1d')]);}_0x5afbb4[_0x5f67('0x3c')]=qs[_0x5f67('0x3d')](_0x19cd6b['query'][_0x5f67('0x3d')]);_0x5afbb4[_0x5f67('0x3e')]=qs['filters'](_[_0x5f67('0x3f')](_0x19cd6b[_0x5f67('0x35')],_0xd3e34e[_0x5f67('0x40')]),_0x492494);if(_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x41')]){_0x5afbb4[_0x5f67('0x3e')]=_['merge'](_0x5afbb4[_0x5f67('0x3e')],{'$or':_['map'](_0x492494,function(_0x37bfc0){if(_0x37bfc0[_0x5f67('0x32')]!==_0x5f67('0x42')){var _0x25f253={};_0x25f253[_0x37bfc0[_0x5f67('0x2b')]]={'$like':'%'+_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x41')]+'%'};return _0x25f253;}})});}_0x5afbb4=_['merge']({},_0x5afbb4,_0x19cd6b[_0x5f67('0x43')]);var _0x22cb54={'where':_0x5afbb4[_0x5f67('0x3e')]};return db['AnalyticExtractedReport'][_0x5f67('0x1e')](_0x22cb54)['then'](function(_0x16a3f6){_0x5f3a13['count']=_0x16a3f6;if(_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x44')]){_0x5afbb4[_0x5f67('0x45')]=[{'all':!![]}];}return db[_0x5f67('0x2f')][_0x5f67('0x46')](_0x5afbb4);})[_0x5f67('0x23')](function(_0x343422){_0x5f3a13[_0x5f67('0x47')]=_0x343422;return _0x5f3a13;})[_0x5f67('0x23')](respondWithFilteredResult(_0x116139,_0x5afbb4))[_0x5f67('0x48')](handleError(_0x116139,null));};exports[_0x5f67('0x49')]=function(_0x487045,_0x19423c){var _0xd94e13={'raw':!![],'where':{'id':_0x487045[_0x5f67('0x4a')]['id']}},_0x201840={};_0x201840[_0x5f67('0x34')]=_[_0x5f67('0x36')](db[_0x5f67('0x2f')][_0x5f67('0x30')]);_0x201840[_0x5f67('0x35')]=_[_0x5f67('0x36')](_0x487045['query']);_0x201840['filters']=_['intersection'](_0x201840['model'],_0x201840[_0x5f67('0x35')]);_0xd94e13[_0x5f67('0x38')]=_[_0x5f67('0x37')](_0x201840['model'],qs['fields'](_0x487045[_0x5f67('0x35')][_0x5f67('0x39')]));_0xd94e13[_0x5f67('0x38')]=_0xd94e13[_0x5f67('0x38')][_0x5f67('0x3a')]?_0xd94e13[_0x5f67('0x38')]:_0x201840[_0x5f67('0x34')];if(_0x487045[_0x5f67('0x35')]['includeAll']){_0xd94e13[_0x5f67('0x45')]=[{'all':!![]}];}_0xd94e13=_[_0x5f67('0x4b')]({},_0xd94e13,_0x487045[_0x5f67('0x43')]);return db[_0x5f67('0x2f')][_0x5f67('0x4c')](_0xd94e13)[_0x5f67('0x23')](handleEntityNotFound(_0x19423c,null))[_0x5f67('0x23')](respondWithResult(_0x19423c,null))[_0x5f67('0x48')](handleError(_0x19423c,null));};exports[_0x5f67('0x4d')]=function(_0xd48572,_0x466ea1){return db[_0x5f67('0x2f')][_0x5f67('0x4d')](_0xd48572[_0x5f67('0x4e')],{})[_0x5f67('0x23')](function(_0x22094e){var _0x52a3af=_0xd48572[_0x5f67('0x4f')][_0x5f67('0x25')]({'plain':!![]});if(!_0x52a3af)throw new Error(_0x5f67('0x50'));if(_0x52a3af[_0x5f67('0x51')]===_0x5f67('0x4f')){var _0x5f3242=_0x22094e[_0x5f67('0x25')]({'plain':!![]});var _0x4f5721=_0x5f67('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x4f5721,'userProfileId':_0x52a3af[_0x5f67('0x52')]},'raw':!![]})[_0x5f67('0x23')](function(_0x204c10){if(_0x204c10&&_0x204c10[_0x5f67('0x53')]===0x0){return db[_0x5f67('0x27')][_0x5f67('0x4d')]({'name':_0x5f3242[_0x5f67('0x2b')],'resourceId':_0x5f3242['id'],'type':_0x204c10[_0x5f67('0x2b')],'sectionId':_0x204c10['id']},{})[_0x5f67('0x23')](function(){return _0x22094e;});}else{return _0x22094e;}})[_0x5f67('0x48')](function(_0x3517c9){logger[_0x5f67('0x29')](_0x5f67('0x54'),_0x3517c9);throw _0x3517c9;});}return _0x22094e;})[_0x5f67('0x23')](respondWithResult(_0x466ea1,0xc9))[_0x5f67('0x48')](handleError(_0x466ea1,null));};exports[_0x5f67('0x22')]=function(_0x4f26bb,_0x497890){if(_0x4f26bb['body']['id']){delete _0x4f26bb[_0x5f67('0x4e')]['id'];}return db[_0x5f67('0x2f')][_0x5f67('0x4c')]({'where':{'id':_0x4f26bb['params']['id']}})[_0x5f67('0x23')](handleEntityNotFound(_0x497890,null))[_0x5f67('0x23')](saveUpdates(_0x4f26bb['body'],null))[_0x5f67('0x23')](respondWithResult(_0x497890,null))[_0x5f67('0x48')](handleError(_0x497890,null));};exports[_0x5f67('0x24')]=function(_0x20bbf1,_0x4b0778){return db[_0x5f67('0x2f')]['find']({'where':{'id':_0x20bbf1['params']['id']}})['then'](handleEntityNotFound(_0x4b0778,null))[_0x5f67('0x23')](removeEntity(_0x4b0778,null))[_0x5f67('0x48')](handleError(_0x4b0778,null));};exports['download']=function(_0x16da2d,_0x2d2bf7,_0x4da449){return db[_0x5f67('0x2f')][_0x5f67('0x4c')]({'where':{'id':_0x16da2d[_0x5f67('0x4a')]['id']},'attributes':[_0x5f67('0x2b'),_0x5f67('0x55'),_0x5f67('0x56'),_0x5f67('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x2d2bf7,null))['then'](function(_0x1ceccc){if(_0x1ceccc){if(!fs[_0x5f67('0x58')](path['join'](config['root'],_0x5f67('0x59'),_0x1ceccc[_0x5f67('0x56')]))){throw new db['Sequelize']['ValidationError'](_0x5f67('0x5a'));}if(_0x16da2d['query'][_0x5f67('0x5b')]){return _0x2d2bf7['sendStatus'](0xc8);}return _0x2d2bf7['download'](path[_0x5f67('0x5c')](config['root'],_0x5f67('0x59'),_0x1ceccc[_0x5f67('0x56')]),util[_0x5f67('0x5d')](_0x5f67('0x5e'),_0x1ceccc[_0x5f67('0x55')]||_0x1ceccc['name'],_0x1ceccc['output']['toLowerCase']()));}})[_0x5f67('0x48')](handleError(_0x2d2bf7,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 97bf8ac..3929c44 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 _0x517c=['api','bluebird','path','rimraf','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x3bae5c,_0x455be9){var _0xb3c166=function(_0x284d5a){while(--_0x284d5a){_0x3bae5c['push'](_0x3bae5c['shift']());}};_0xb3c166(++_0x455be9);}(_0x517c,0x9d));var _0xc517=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0x517c[_0x4cf8d4];return _0x2c1beb;};'use strict';var _=require(_0xc517('0x0'));var util=require(_0xc517('0x1'));var logger=require(_0xc517('0x2'))(_0xc517('0x3'));var moment=require('moment');var BPromise=require(_0xc517('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc517('0x5'));var rimraf=require(_0xc517('0x6'));var config=require('../../config/environment');var attributes=require(_0xc517('0x7'));module['exports']=function(_0xa7ec30,_0x4cc58d){return _0xa7ec30['define'](_0xc517('0x8'),attributes,{'tableName':_0xc517('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa2a4=['analytics_extracted_reports','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa2a4,0x1cf));var _0x4a2a=function(_0x53b6c9,_0xbf731){_0x53b6c9=_0x53b6c9-0x0;var _0x1d8e8c=_0xa2a4[_0x53b6c9];return _0x1d8e8c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4a2a('0x0'))(_0x4a2a('0x1'));var moment=require('moment');var BPromise=require(_0x4a2a('0x2'));var rp=require(_0x4a2a('0x3'));var fs=require('fs');var path=require(_0x4a2a('0x4'));var rimraf=require(_0x4a2a('0x5'));var config=require('../../config/environment');var attributes=require(_0x4a2a('0x6'));module[_0x4a2a('0x7')]=function(_0x5cbe30,_0xff2c25){return _0x5cbe30[_0x4a2a('0x8')](_0x4a2a('0x9'),attributes,{'tableName':_0x4a2a('0xa'),'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 bc0b58a..882cff2 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 _0x0f03=['request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x21f7d4,_0x3fb9df){var _0x143fa7=function(_0x4ace03){while(--_0x4ace03){_0x21f7d4['push'](_0x21f7d4['shift']());}};_0x143fa7(++_0x3fb9df);}(_0x0f03,0x113));var _0x30f0=function(_0x44078f,_0x3616df){_0x44078f=_0x44078f-0x0;var _0x4d3d13=_0x0f03[_0x44078f];return _0x4d3d13;};'use strict';var _=require(_0x30f0('0x0'));var util=require('util');var moment=require(_0x30f0('0x1'));var BPromise=require(_0x30f0('0x2'));var rs=require(_0x30f0('0x3'));var fs=require('fs');var Redis=require(_0x30f0('0x4'));var db=require(_0x30f0('0x5'))['db'];var utils=require(_0x30f0('0x6'));var logger=require(_0x30f0('0x7'))('rpc');var config=require(_0x30f0('0x8'));var jayson=require(_0x30f0('0x9'));var client=jayson[_0x30f0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21ffcb,_0xf443d,_0x3cdd7b){return new BPromise(function(_0x1e6ee2,_0x366948){return client[_0x30f0('0xb')](_0x21ffcb,_0x3cdd7b)['then'](function(_0x4d6b9c){logger[_0x30f0('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xf443d,_0x30f0('0xd'));logger[_0x30f0('0xe')](_0x30f0('0xf'),_0xf443d,_0x30f0('0xd'),JSON['stringify'](_0x4d6b9c));if(_0x4d6b9c[_0x30f0('0x10')]){if(_0x4d6b9c['error'][_0x30f0('0x11')]===0x1f4){logger['error'](_0x30f0('0x12'),_0xf443d,_0x4d6b9c['error'][_0x30f0('0x13')]);return _0x366948(_0x4d6b9c[_0x30f0('0x10')][_0x30f0('0x13')]);}logger[_0x30f0('0x10')](_0x30f0('0x12'),_0xf443d,_0x4d6b9c[_0x30f0('0x10')]['message']);return _0x1e6ee2(_0x4d6b9c[_0x30f0('0x10')][_0x30f0('0x13')]);}else{logger[_0x30f0('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xf443d,_0x30f0('0xd'));_0x1e6ee2(_0x4d6b9c[_0x30f0('0x14')][_0x30f0('0x13')]);}})[_0x30f0('0x15')](function(_0x58f674){logger[_0x30f0('0x10')](_0x30f0('0x12'),_0xf443d,_0x58f674);_0x366948(_0x58f674);});});}
\ No newline at end of file
+var _0x0b3a=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x58fe01,_0x42ccdf){var _0x758a11=function(_0xf6b2d){while(--_0xf6b2d){_0x58fe01['push'](_0x58fe01['shift']());}};_0x758a11(++_0x42ccdf);}(_0x0b3a,0x114));var _0xa0b3=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x0b3a[_0x3f4891];return _0x54f2d8;};'use strict';var _=require(_0xa0b3('0x0'));var util=require('util');var moment=require(_0xa0b3('0x1'));var BPromise=require(_0xa0b3('0x2'));var rs=require(_0xa0b3('0x3'));var fs=require('fs');var Redis=require(_0xa0b3('0x4'));var db=require(_0xa0b3('0x5'))['db'];var utils=require(_0xa0b3('0x6'));var logger=require(_0xa0b3('0x7'))(_0xa0b3('0x8'));var config=require(_0xa0b3('0x9'));var jayson=require(_0xa0b3('0xa'));var client=jayson['client'][_0xa0b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30c907,_0x5726db,_0x439b52){return new BPromise(function(_0x343701,_0x5b0ffc){return client[_0xa0b3('0xc')](_0x30c907,_0x439b52)[_0xa0b3('0xd')](function(_0xd2478b){logger[_0xa0b3('0xe')](_0xa0b3('0xf'),_0x5726db,_0xa0b3('0x10'));logger[_0xa0b3('0x11')](_0xa0b3('0x12'),_0x5726db,_0xa0b3('0x10'),JSON['stringify'](_0xd2478b));if(_0xd2478b[_0xa0b3('0x13')]){if(_0xd2478b[_0xa0b3('0x13')][_0xa0b3('0x14')]===0x1f4){logger['error'](_0xa0b3('0xf'),_0x5726db,_0xd2478b['error'][_0xa0b3('0x15')]);return _0x5b0ffc(_0xd2478b[_0xa0b3('0x13')][_0xa0b3('0x15')]);}logger[_0xa0b3('0x13')](_0xa0b3('0xf'),_0x5726db,_0xd2478b[_0xa0b3('0x13')]['message']);return _0x343701(_0xd2478b[_0xa0b3('0x13')][_0xa0b3('0x15')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5726db,_0xa0b3('0x10'));_0x343701(_0xd2478b[_0xa0b3('0x16')][_0xa0b3('0x15')]);}})[_0xa0b3('0x17')](function(_0x5d38ae){logger[_0xa0b3('0x13')](_0xa0b3('0xf'),_0x5726db,_0x5d38ae);_0x5b0ffc(_0x5d38ae);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 5680d8b..eebfb3a 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 _0xdea2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','download','post','put','update','delete','destroy','exports','multer','util'];(function(_0x222866,_0x3d2de9){var _0x146b45=function(_0x5451a0){while(--_0x5451a0){_0x222866['push'](_0x222866['shift']());}};_0x146b45(++_0x3d2de9);}(_0xdea2,0x1ec));var _0x2dea=function(_0x52ea48,_0x14f622){_0x52ea48=_0x52ea48-0x0;var _0x1f8e44=_0xdea2[_0x52ea48];return _0x1f8e44;};'use strict';var multer=require(_0x2dea('0x0'));var util=require(_0x2dea('0x1'));var path=require('path');var timeout=require(_0x2dea('0x2'));var express=require(_0x2dea('0x3'));var router=express[_0x2dea('0x4')]();var fs_extra=require(_0x2dea('0x5'));var auth=require(_0x2dea('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2dea('0x7'));router[_0x2dea('0x8')]('/',auth[_0x2dea('0x9')](),controller[_0x2dea('0xa')]);router[_0x2dea('0x8')](_0x2dea('0xb'),auth[_0x2dea('0x9')](),controller['show']);router[_0x2dea('0x8')]('/:id/download',auth[_0x2dea('0x9')](),controller[_0x2dea('0xc')]);router[_0x2dea('0xd')]('/',auth[_0x2dea('0x9')](),controller['create']);router[_0x2dea('0xe')]('/:id',auth[_0x2dea('0x9')](),controller[_0x2dea('0xf')]);router[_0x2dea('0x10')](_0x2dea('0xb'),auth['isAuthenticated'](),controller[_0x2dea('0x11')]);module[_0x2dea('0x12')]=router;
\ No newline at end of file
+var _0x5ee2=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/download','post','create','update','delete','destroy'];(function(_0xcdc0af,_0x37976b){var _0x4b6511=function(_0x4cf4bf){while(--_0x4cf4bf){_0xcdc0af['push'](_0xcdc0af['shift']());}};_0x4b6511(++_0x37976b);}(_0x5ee2,0xd9));var _0x25ee=function(_0x482b17,_0x2d5741){_0x482b17=_0x482b17-0x0;var _0x1b8773=_0x5ee2[_0x482b17];return _0x1b8773;};'use strict';var multer=require('multer');var util=require(_0x25ee('0x0'));var path=require(_0x25ee('0x1'));var timeout=require(_0x25ee('0x2'));var express=require(_0x25ee('0x3'));var router=express[_0x25ee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x25ee('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x25ee('0x6')](),controller[_0x25ee('0x7')]);router[_0x25ee('0x8')](_0x25ee('0x9'),auth[_0x25ee('0x6')](),controller[_0x25ee('0xa')]);router[_0x25ee('0x8')](_0x25ee('0xb'),auth[_0x25ee('0x6')](),controller['download']);router[_0x25ee('0xc')]('/',auth[_0x25ee('0x6')](),controller[_0x25ee('0xd')]);router['put'](_0x25ee('0x9'),auth[_0x25ee('0x6')](),controller[_0x25ee('0xe')]);router[_0x25ee('0xf')]('/:id',auth[_0x25ee('0x6')](),controller[_0x25ee('0x10')]);module[_0x25ee('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 663c597..446108d 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 _0xae49=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xae49,0x1ab));var _0x9ae4=function(_0x2351a2,_0x5bef28){_0x2351a2=_0x2351a2-0x0;var _0x1117e5=_0xae49[_0x2351a2];return _0x1117e5;};'use strict';var Sequelize=require(_0x9ae4('0x0'));module[_0x9ae4('0x1')]={'field':{'type':Sequelize[_0x9ae4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x9ae4('0x3')]},'format':{'type':Sequelize[_0x9ae4('0x3')]},'groupBy':{'type':Sequelize[_0x9ae4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9ae4('0x3')]},'custom':{'type':Sequelize[_0x9ae4('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x91ad=['STRING','BOOLEAN','exports','TEXT'];(function(_0x55fc43,_0x1b3456){var _0x4dbc18=function(_0x4e1ab8){while(--_0x4e1ab8){_0x55fc43['push'](_0x55fc43['shift']());}};_0x4dbc18(++_0x1b3456);}(_0x91ad,0xd2));var _0xd91a=function(_0x1d1d34,_0x49c0ec){_0x1d1d34=_0x1d1d34-0x0;var _0x4d8023=_0x91ad[_0x1d1d34];return _0x4d8023;};'use strict';var Sequelize=require('sequelize');module[_0xd91a('0x0')]={'field':{'type':Sequelize[_0xd91a('0x1')]},'alias':{'type':Sequelize[_0xd91a('0x2')]},'function':{'type':Sequelize[_0xd91a('0x2')]},'format':{'type':Sequelize[_0xd91a('0x2')]},'groupBy':{'type':Sequelize[_0xd91a('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd91a('0x2')]},'custom':{'type':Sequelize[_0xd91a('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 7f282a1..123253c 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 _0xbaee=['bulkDestroy','AnalyticCustomReport','findOne','transaction','CustomReportId','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','AnalyticFieldReport','catch','params','keys','find','create','bulkCreate','body'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xbaee,0x9e));var _0xebae=function(_0xd1ea47,_0x3d489d){_0xd1ea47=_0xd1ea47-0x0;var _0x1a399d=_0xbaee[_0xd1ea47];return _0x1a399d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebae('0x0'));var zipdir=require(_0xebae('0x1'));var jsonpatch=require(_0xebae('0x2'));var rp=require(_0xebae('0x3'));var moment=require(_0xebae('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xebae('0x5'));var path=require('path');var sox=require(_0xebae('0x6'));var csv=require(_0xebae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebae('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xebae('0x9'));var jsforce=require(_0xebae('0xa'));var deskjs=require(_0xebae('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xebae('0xc'));var Redis=require('ioredis');var authService=require(_0xebae('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xebae('0xe'));var hardwareService=require(_0xebae('0xf'));var logger=require(_0xebae('0x10'))(_0xebae('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xebae('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x198562,_0x23885c){_0x23885c=_0x23885c||0xcc;return function(_0x570982){if(_0x570982){return _0x198562[_0xebae('0x13')](_0x23885c);}return _0x198562[_0xebae('0x14')](_0x23885c)[_0xebae('0x15')]();};}function respondWithResult(_0x30c097,_0x449970){_0x449970=_0x449970||0xc8;return function(_0x29fa11){if(_0x29fa11){return _0x30c097[_0xebae('0x14')](_0x449970)[_0xebae('0x16')](_0x29fa11);}};}function respondWithFilteredResult(_0x5c9a0e,_0x1e01b6){return function(_0x47d91f){if(_0x47d91f){var _0x133bcb=typeof _0x1e01b6[_0xebae('0x17')]===_0xebae('0x18')&&typeof _0x1e01b6[_0xebae('0x19')]===_0xebae('0x18');var _0x21de04=_0x47d91f[_0xebae('0x1a')];var _0x2e0817=_0x133bcb?0x0:_0x1e01b6[_0xebae('0x17')];var _0xb43a53=_0x133bcb?_0x47d91f[_0xebae('0x1a')]:_0x1e01b6[_0xebae('0x17')]+_0x1e01b6[_0xebae('0x19')];var _0x1856cd;if(_0xb43a53>=_0x21de04){_0xb43a53=_0x21de04;_0x1856cd=0xc8;}else{_0x1856cd=0xce;}_0x5c9a0e[_0xebae('0x14')](_0x1856cd);return _0x5c9a0e[_0xebae('0x1b')](_0xebae('0x1c'),_0x2e0817+'-'+_0xb43a53+'/'+_0x21de04)['json'](_0x47d91f);}return null;};}function patchUpdates(_0xc3c6ed){return function(_0xf3acaa){try{jsonpatch[_0xebae('0x1d')](_0xf3acaa,_0xc3c6ed,!![]);}catch(_0x5257fc){return BPromise[_0xebae('0x1e')](_0x5257fc);}return _0xf3acaa[_0xebae('0x1f')]();};}function saveUpdates(_0x296b7b,_0x48d902){return function(_0x234d61){if(_0x234d61){return _0x234d61[_0xebae('0x20')](_0x296b7b)[_0xebae('0x21')](function(_0x189788){return _0x189788;});}return null;};}function removeEntity(_0x2e1022,_0x46c1e8){return function(_0x41938a){if(_0x41938a){return _0x41938a[_0xebae('0x22')]()[_0xebae('0x21')](function(){_0x2e1022[_0xebae('0x14')](0xcc)[_0xebae('0x15')]();});}};}function handleEntityNotFound(_0x48c90f,_0x170999){return function(_0x509cf4){if(!_0x509cf4){_0x48c90f['sendStatus'](0x194);}return _0x509cf4;};}function handleError(_0x9f9df3,_0x51db89){_0x51db89=_0x51db89||0x1f4;return function(_0x236bc1){logger[_0xebae('0x23')](_0x236bc1[_0xebae('0x24')]);if(_0x236bc1[_0xebae('0x25')]){delete _0x236bc1[_0xebae('0x25')];}_0x9f9df3[_0xebae('0x14')](_0x51db89)[_0xebae('0x26')](_0x236bc1);};}exports[_0xebae('0x27')]=function(_0x47e8f5,_0x3f022a){var _0x28cdac={},_0x4574ba={},_0xbb8b14={'count':0x0,'rows':[]};var _0x315ae6=_[_0xebae('0x28')](db['AnalyticFieldReport'][_0xebae('0x29')],function(_0x2fa7cd){return{'name':_0x2fa7cd[_0xebae('0x2a')],'type':_0x2fa7cd[_0xebae('0x2b')]['key']};});_0x4574ba[_0xebae('0x2c')]=_[_0xebae('0x28')](_0x315ae6,_0xebae('0x25'));_0x4574ba['query']=_['keys'](_0x47e8f5[_0xebae('0x2d')]);_0x4574ba[_0xebae('0x2e')]=_[_0xebae('0x2f')](_0x4574ba[_0xebae('0x2c')],_0x4574ba['query']);_0x28cdac[_0xebae('0x30')]=_[_0xebae('0x2f')](_0x4574ba[_0xebae('0x2c')],qs[_0xebae('0x31')](_0x47e8f5[_0xebae('0x2d')][_0xebae('0x31')]));_0x28cdac[_0xebae('0x30')]=_0x28cdac[_0xebae('0x30')][_0xebae('0x32')]?_0x28cdac[_0xebae('0x30')]:_0x4574ba['model'];if(!_0x47e8f5['query'][_0xebae('0x33')](_0xebae('0x34'))){_0x28cdac['limit']=qs['limit'](_0x47e8f5[_0xebae('0x2d')]['limit']);_0x28cdac[_0xebae('0x17')]=qs[_0xebae('0x17')](_0x47e8f5['query'][_0xebae('0x17')]);}_0x28cdac[_0xebae('0x35')]=qs['sort'](_0x47e8f5[_0xebae('0x2d')][_0xebae('0x36')]);_0x28cdac[_0xebae('0x37')]=qs[_0xebae('0x2e')](_[_0xebae('0x38')](_0x47e8f5['query'],_0x4574ba[_0xebae('0x2e')]),_0x315ae6);if(_0x47e8f5[_0xebae('0x2d')][_0xebae('0x39')]){_0x28cdac[_0xebae('0x37')]=_[_0xebae('0x3a')](_0x28cdac[_0xebae('0x37')],{'$or':_[_0xebae('0x28')](_0x315ae6,function(_0x176b98){if(_0x176b98[_0xebae('0x2b')]!=='VIRTUAL'){var _0x3e0e16={};_0x3e0e16[_0x176b98['name']]={'$like':'%'+_0x47e8f5[_0xebae('0x2d')][_0xebae('0x39')]+'%'};return _0x3e0e16;}})});}_0x28cdac=_[_0xebae('0x3a')]({},_0x28cdac,_0x47e8f5[_0xebae('0x3b')]);var _0x18bf17={'where':_0x28cdac[_0xebae('0x37')]};return db['AnalyticFieldReport']['count'](_0x18bf17)[_0xebae('0x21')](function(_0x184579){_0xbb8b14[_0xebae('0x1a')]=_0x184579;if(_0x47e8f5['query'][_0xebae('0x3c')]){_0x28cdac[_0xebae('0x3d')]=[{'all':!![]}];}return db[_0xebae('0x3e')]['findAll'](_0x28cdac);})[_0xebae('0x21')](function(_0x2e905e){_0xbb8b14['rows']=_0x2e905e;return _0xbb8b14;})[_0xebae('0x21')](respondWithFilteredResult(_0x3f022a,_0x28cdac))[_0xebae('0x3f')](handleError(_0x3f022a,null));};exports['show']=function(_0xe8bd31,_0x2e3b3b){var _0x50f5bf={'raw':![],'where':{'id':_0xe8bd31[_0xebae('0x40')]['id']}},_0x4c6106={};_0x4c6106[_0xebae('0x2c')]=_[_0xebae('0x41')](db[_0xebae('0x3e')][_0xebae('0x29')]);_0x4c6106[_0xebae('0x2d')]=_[_0xebae('0x41')](_0xe8bd31['query']);_0x4c6106[_0xebae('0x2e')]=_[_0xebae('0x2f')](_0x4c6106[_0xebae('0x2c')],_0x4c6106[_0xebae('0x2d')]);_0x50f5bf[_0xebae('0x30')]=_[_0xebae('0x2f')](_0x4c6106['model'],qs[_0xebae('0x31')](_0xe8bd31[_0xebae('0x2d')][_0xebae('0x31')]));_0x50f5bf[_0xebae('0x30')]=_0x50f5bf[_0xebae('0x30')]['length']?_0x50f5bf[_0xebae('0x30')]:_0x4c6106[_0xebae('0x2c')];if(_0xe8bd31[_0xebae('0x2d')][_0xebae('0x3c')]){_0x50f5bf[_0xebae('0x3d')]=[{'all':!![]}];}_0x50f5bf=_[_0xebae('0x3a')]({},_0x50f5bf,_0xe8bd31['options']);return db[_0xebae('0x3e')][_0xebae('0x42')](_0x50f5bf)[_0xebae('0x21')](handleEntityNotFound(_0x2e3b3b,null))[_0xebae('0x21')](respondWithResult(_0x2e3b3b,null))[_0xebae('0x3f')](handleError(_0x2e3b3b,null));};exports[_0xebae('0x43')]=function(_0x5968cb,_0x61a2b5){return db[_0xebae('0x3e')][_0xebae('0x43')](_0x5968cb['body'],{})[_0xebae('0x21')](respondWithResult(_0x61a2b5,0xc9))[_0xebae('0x3f')](handleError(_0x61a2b5,null));};exports['bulkCreate']=function(_0x4936cb,_0x38f666){return db[_0xebae('0x3e')][_0xebae('0x44')](_0x4936cb[_0xebae('0x45')],{'raw':![],'individualHooks':!![]})[_0xebae('0x21')](respondWithResult(_0x38f666,0xc9))[_0xebae('0x3f')](handleError(_0x38f666,null));};exports['update']=function(_0x3be9f7,_0x3751bd){if(_0x3be9f7[_0xebae('0x45')]['id']){delete _0x3be9f7['body']['id'];}return db[_0xebae('0x3e')][_0xebae('0x42')]({'where':{'id':_0x3be9f7['params']['id']}})[_0xebae('0x21')](handleEntityNotFound(_0x3751bd,null))[_0xebae('0x21')](saveUpdates(_0x3be9f7[_0xebae('0x45')],null))[_0xebae('0x21')](respondWithResult(_0x3751bd,null))[_0xebae('0x3f')](handleError(_0x3751bd,null));};exports['destroy']=function(_0x2889cd,_0x451723){return db[_0xebae('0x3e')][_0xebae('0x42')]({'where':{'id':_0x2889cd[_0xebae('0x40')]['id']}})[_0xebae('0x21')](handleEntityNotFound(_0x451723,null))[_0xebae('0x21')](removeEntity(_0x451723,null))[_0xebae('0x3f')](handleError(_0x451723,null));};exports[_0xebae('0x46')]=function(_0x3bbe1e,_0x5507f7){return db[_0xebae('0x3e')][_0xebae('0x22')]({'where':{'id':_0x3bbe1e[_0xebae('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5507f7,0xcc))['catch'](handleError(_0x5507f7,null));};exports['addFields']=function(_0x41bc5d,_0x45730b,_0x188a62){return db[_0xebae('0x47')][_0xebae('0x48')]({'where':{'id':_0x41bc5d['params']['id']}})[_0xebae('0x21')](handleEntityNotFound(_0x45730b,null))['then'](function(_0x33f59c){if(_0x33f59c){return db['sequelize'][_0xebae('0x49')](function(_0x408420){return db[_0xebae('0x3e')][_0xebae('0x22')]({'where':{'CustomReportId':_0x41bc5d[_0xebae('0x40')]['id']},'transaction':_0x408420})[_0xebae('0x21')](function(_0x4e3af3){var _0x408a1b=_[_0xebae('0x28')](_0x41bc5d[_0xebae('0x45')],function(_0x16e999){delete _0x16e999['id'];_0x16e999[_0xebae('0x4a')]=_0x41bc5d[_0xebae('0x40')]['id'];return _0x16e999;});return db['AnalyticFieldReport'][_0xebae('0x44')](_0x408a1b,{'transaction':_0x408420});});})[_0xebae('0x21')](function(){return db[_0xebae('0x3e')][_0xebae('0x4b')]({'where':{'CustomReportId':_0x41bc5d['params']['id']}});});}})[_0xebae('0x21')](respondWithResult(_0x45730b,null))[_0xebae('0x3f')](handleError(_0x45730b,null));};
\ No newline at end of file
+var _0xacc8=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','AnalyticFieldReport','findAll','rows','catch','show','params','rawAttributes','include','find','create','bulkCreate','body','update','bulkDestroy','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','save','then','destroy','error','name','index','map'];(function(_0x5d921e,_0x9565ff){var _0x901487=function(_0x16cd62){while(--_0x16cd62){_0x5d921e['push'](_0x5d921e['shift']());}};_0x901487(++_0x9565ff);}(_0xacc8,0x1ba));var _0x8acc=function(_0x20be7e,_0x56db99){_0x20be7e=_0x20be7e-0x0;var _0x43728c=_0xacc8[_0x20be7e];return _0x43728c;};'use strict';var emlformat=require(_0x8acc('0x0'));var rimraf=require(_0x8acc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8acc('0x2'));var rp=require(_0x8acc('0x3'));var moment=require(_0x8acc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8acc('0x5'));var util=require(_0x8acc('0x6'));var path=require(_0x8acc('0x7'));var sox=require('sox');var csv=require(_0x8acc('0x8'));var ejs=require(_0x8acc('0x9'));var fs=require('fs');var fs_extra=require(_0x8acc('0xa'));var _=require(_0x8acc('0xb'));var squel=require('squel');var crypto=require(_0x8acc('0xc'));var jsforce=require(_0x8acc('0xd'));var deskjs=require(_0x8acc('0xe'));var toCsv=require(_0x8acc('0x8'));var querystring=require(_0x8acc('0xf'));var Papa=require(_0x8acc('0x10'));var Redis=require(_0x8acc('0x11'));var authService=require(_0x8acc('0x12'));var qs=require(_0x8acc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8acc('0x14'));var logger=require(_0x8acc('0x15'))(_0x8acc('0x16'));var utils=require(_0x8acc('0x17'));var config=require(_0x8acc('0x18'));var licenseUtil=require(_0x8acc('0x19'));var db=require(_0x8acc('0x1a'))['db'];function respondWithStatusCode(_0x4b12ad,_0x59b697){_0x59b697=_0x59b697||0xcc;return function(_0x1feb8d){if(_0x1feb8d){return _0x4b12ad[_0x8acc('0x1b')](_0x59b697);}return _0x4b12ad['status'](_0x59b697)[_0x8acc('0x1c')]();};}function respondWithResult(_0x2f6d3f,_0x52cd4f){_0x52cd4f=_0x52cd4f||0xc8;return function(_0x50f84a){if(_0x50f84a){return _0x2f6d3f[_0x8acc('0x1d')](_0x52cd4f)['json'](_0x50f84a);}};}function respondWithFilteredResult(_0x2f0ceb,_0x1f1b54){return function(_0x24f348){if(_0x24f348){var _0x19556f=typeof _0x1f1b54[_0x8acc('0x1e')]===_0x8acc('0x1f')&&typeof _0x1f1b54['limit']===_0x8acc('0x1f');var _0x11685b=_0x24f348['count'];var _0xc77b57=_0x19556f?0x0:_0x1f1b54[_0x8acc('0x1e')];var _0x46b8a9=_0x19556f?_0x24f348[_0x8acc('0x20')]:_0x1f1b54[_0x8acc('0x1e')]+_0x1f1b54['limit'];var _0x33b457;if(_0x46b8a9>=_0x11685b){_0x46b8a9=_0x11685b;_0x33b457=0xc8;}else{_0x33b457=0xce;}_0x2f0ceb[_0x8acc('0x1d')](_0x33b457);return _0x2f0ceb[_0x8acc('0x21')](_0x8acc('0x22'),_0xc77b57+'-'+_0x46b8a9+'/'+_0x11685b)[_0x8acc('0x23')](_0x24f348);}return null;};}function patchUpdates(_0x42ae7a){return function(_0x5da64f){try{jsonpatch[_0x8acc('0x24')](_0x5da64f,_0x42ae7a,!![]);}catch(_0xc83a56){return BPromise['reject'](_0xc83a56);}return _0x5da64f[_0x8acc('0x25')]();};}function saveUpdates(_0x5ee85d,_0x1ca276){return function(_0x32f773){if(_0x32f773){return _0x32f773['update'](_0x5ee85d)[_0x8acc('0x26')](function(_0x1f3c8b){return _0x1f3c8b;});}return null;};}function removeEntity(_0x470e1a,_0x164650){return function(_0x35407f){if(_0x35407f){return _0x35407f[_0x8acc('0x27')]()[_0x8acc('0x26')](function(){_0x470e1a[_0x8acc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf374da,_0x30ac83){return function(_0x1b1443){if(!_0x1b1443){_0xf374da['sendStatus'](0x194);}return _0x1b1443;};}function handleError(_0x3b5bce,_0x2aa2ef){_0x2aa2ef=_0x2aa2ef||0x1f4;return function(_0x545d85){logger[_0x8acc('0x28')](_0x545d85['stack']);if(_0x545d85[_0x8acc('0x29')]){delete _0x545d85[_0x8acc('0x29')];}_0x3b5bce[_0x8acc('0x1d')](_0x2aa2ef)['send'](_0x545d85);};}exports[_0x8acc('0x2a')]=function(_0x4c5828,_0x40e2fb){var _0x1d4f7e={},_0x1b4307={},_0x13385d={'count':0x0,'rows':[]};var _0x17f7a0=_[_0x8acc('0x2b')](db['AnalyticFieldReport']['rawAttributes'],function(_0x3153bf){return{'name':_0x3153bf[_0x8acc('0x2c')],'type':_0x3153bf[_0x8acc('0x2d')][_0x8acc('0x2e')]};});_0x1b4307[_0x8acc('0x2f')]=_['map'](_0x17f7a0,_0x8acc('0x29'));_0x1b4307[_0x8acc('0x30')]=_[_0x8acc('0x31')](_0x4c5828[_0x8acc('0x30')]);_0x1b4307[_0x8acc('0x32')]=_[_0x8acc('0x33')](_0x1b4307['model'],_0x1b4307[_0x8acc('0x30')]);_0x1d4f7e[_0x8acc('0x34')]=_[_0x8acc('0x33')](_0x1b4307[_0x8acc('0x2f')],qs[_0x8acc('0x35')](_0x4c5828['query'][_0x8acc('0x35')]));_0x1d4f7e[_0x8acc('0x34')]=_0x1d4f7e[_0x8acc('0x34')]['length']?_0x1d4f7e[_0x8acc('0x34')]:_0x1b4307[_0x8acc('0x2f')];if(!_0x4c5828[_0x8acc('0x30')]['hasOwnProperty'](_0x8acc('0x36'))){_0x1d4f7e[_0x8acc('0x37')]=qs[_0x8acc('0x37')](_0x4c5828[_0x8acc('0x30')][_0x8acc('0x37')]);_0x1d4f7e[_0x8acc('0x1e')]=qs[_0x8acc('0x1e')](_0x4c5828[_0x8acc('0x30')]['offset']);}_0x1d4f7e['order']=qs[_0x8acc('0x38')](_0x4c5828['query'][_0x8acc('0x38')]);_0x1d4f7e[_0x8acc('0x39')]=qs[_0x8acc('0x32')](_[_0x8acc('0x3a')](_0x4c5828[_0x8acc('0x30')],_0x1b4307[_0x8acc('0x32')]),_0x17f7a0);if(_0x4c5828[_0x8acc('0x30')][_0x8acc('0x3b')]){_0x1d4f7e[_0x8acc('0x39')]=_[_0x8acc('0x3c')](_0x1d4f7e['where'],{'$or':_['map'](_0x17f7a0,function(_0x1b1480){if(_0x1b1480['type']!=='VIRTUAL'){var _0x529b62={};_0x529b62[_0x1b1480[_0x8acc('0x29')]]={'$like':'%'+_0x4c5828[_0x8acc('0x30')][_0x8acc('0x3b')]+'%'};return _0x529b62;}})});}_0x1d4f7e=_['merge']({},_0x1d4f7e,_0x4c5828[_0x8acc('0x3d')]);var _0x4805d9={'where':_0x1d4f7e['where']};return db['AnalyticFieldReport'][_0x8acc('0x20')](_0x4805d9)['then'](function(_0x4afbb6){_0x13385d['count']=_0x4afbb6;if(_0x4c5828[_0x8acc('0x30')][_0x8acc('0x3e')]){_0x1d4f7e['include']=[{'all':!![]}];}return db[_0x8acc('0x3f')][_0x8acc('0x40')](_0x1d4f7e);})['then'](function(_0x4e5f87){_0x13385d[_0x8acc('0x41')]=_0x4e5f87;return _0x13385d;})[_0x8acc('0x26')](respondWithFilteredResult(_0x40e2fb,_0x1d4f7e))[_0x8acc('0x42')](handleError(_0x40e2fb,null));};exports[_0x8acc('0x43')]=function(_0x1977ad,_0x47b405){var _0x33b853={'raw':![],'where':{'id':_0x1977ad[_0x8acc('0x44')]['id']}},_0x364b7e={};_0x364b7e['model']=_[_0x8acc('0x31')](db['AnalyticFieldReport'][_0x8acc('0x45')]);_0x364b7e['query']=_[_0x8acc('0x31')](_0x1977ad[_0x8acc('0x30')]);_0x364b7e[_0x8acc('0x32')]=_[_0x8acc('0x33')](_0x364b7e[_0x8acc('0x2f')],_0x364b7e['query']);_0x33b853[_0x8acc('0x34')]=_[_0x8acc('0x33')](_0x364b7e[_0x8acc('0x2f')],qs[_0x8acc('0x35')](_0x1977ad['query'][_0x8acc('0x35')]));_0x33b853[_0x8acc('0x34')]=_0x33b853[_0x8acc('0x34')]['length']?_0x33b853[_0x8acc('0x34')]:_0x364b7e['model'];if(_0x1977ad[_0x8acc('0x30')]['includeAll']){_0x33b853[_0x8acc('0x46')]=[{'all':!![]}];}_0x33b853=_[_0x8acc('0x3c')]({},_0x33b853,_0x1977ad[_0x8acc('0x3d')]);return db['AnalyticFieldReport'][_0x8acc('0x47')](_0x33b853)['then'](handleEntityNotFound(_0x47b405,null))[_0x8acc('0x26')](respondWithResult(_0x47b405,null))[_0x8acc('0x42')](handleError(_0x47b405,null));};exports['create']=function(_0x4c55d1,_0x1d6c5a){return db['AnalyticFieldReport'][_0x8acc('0x48')](_0x4c55d1['body'],{})['then'](respondWithResult(_0x1d6c5a,0xc9))['catch'](handleError(_0x1d6c5a,null));};exports[_0x8acc('0x49')]=function(_0x91104b,_0x15925d){return db[_0x8acc('0x3f')][_0x8acc('0x49')](_0x91104b[_0x8acc('0x4a')],{'raw':![],'individualHooks':!![]})[_0x8acc('0x26')](respondWithResult(_0x15925d,0xc9))[_0x8acc('0x42')](handleError(_0x15925d,null));};exports[_0x8acc('0x4b')]=function(_0x9f543a,_0x2628be){if(_0x9f543a[_0x8acc('0x4a')]['id']){delete _0x9f543a[_0x8acc('0x4a')]['id'];}return db[_0x8acc('0x3f')][_0x8acc('0x47')]({'where':{'id':_0x9f543a['params']['id']}})[_0x8acc('0x26')](handleEntityNotFound(_0x2628be,null))['then'](saveUpdates(_0x9f543a[_0x8acc('0x4a')],null))[_0x8acc('0x26')](respondWithResult(_0x2628be,null))[_0x8acc('0x42')](handleError(_0x2628be,null));};exports[_0x8acc('0x27')]=function(_0x17a278,_0x1a9fc5){return db[_0x8acc('0x3f')][_0x8acc('0x47')]({'where':{'id':_0x17a278[_0x8acc('0x44')]['id']}})[_0x8acc('0x26')](handleEntityNotFound(_0x1a9fc5,null))[_0x8acc('0x26')](removeEntity(_0x1a9fc5,null))[_0x8acc('0x42')](handleError(_0x1a9fc5,null));};exports[_0x8acc('0x4c')]=function(_0x41f53c,_0x2d7bf8){return db[_0x8acc('0x3f')][_0x8acc('0x27')]({'where':{'id':_0x41f53c[_0x8acc('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2d7bf8,0xcc))[_0x8acc('0x42')](handleError(_0x2d7bf8,null));};exports['addFields']=function(_0x18e6f7,_0x2d147e,_0x513abd){return db[_0x8acc('0x4d')]['findOne']({'where':{'id':_0x18e6f7[_0x8acc('0x44')]['id']}})[_0x8acc('0x26')](handleEntityNotFound(_0x2d147e,null))[_0x8acc('0x26')](function(_0x437aad){if(_0x437aad){return db[_0x8acc('0x4e')][_0x8acc('0x4f')](function(_0x549ac3){return db[_0x8acc('0x3f')][_0x8acc('0x27')]({'where':{'CustomReportId':_0x18e6f7['params']['id']},'transaction':_0x549ac3})['then'](function(_0x12b2c3){var _0x37940=_[_0x8acc('0x2b')](_0x18e6f7[_0x8acc('0x4a')],function(_0x21c382){delete _0x21c382['id'];_0x21c382[_0x8acc('0x50')]=_0x18e6f7[_0x8acc('0x44')]['id'];return _0x21c382;});return db['AnalyticFieldReport'][_0x8acc('0x49')](_0x37940,{'transaction':_0x549ac3});});})[_0x8acc('0x26')](function(){return db[_0x8acc('0x3f')][_0x8acc('0x40')]({'where':{'CustomReportId':_0x18e6f7[_0x8acc('0x44')]['id']}});});}})['then'](respondWithResult(_0x2d147e,null))[_0x8acc('0x42')](handleError(_0x2d147e,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index c0ea8d4..4349808 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 _0xf58a=['exports','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xbe1068,_0x5ab0e6){var _0x2003fc=function(_0x42cd9){while(--_0x42cd9){_0xbe1068['push'](_0xbe1068['shift']());}};_0x2003fc(++_0x5ab0e6);}(_0xf58a,0x174));var _0xaf58=function(_0x25cb81,_0x1c3f72){_0x25cb81=_0x25cb81-0x0;var _0x377b87=_0xf58a[_0x25cb81];return _0x377b87;};'use strict';var _=require(_0xaf58('0x0'));var util=require(_0xaf58('0x1'));var logger=require(_0xaf58('0x2'))(_0xaf58('0x3'));var moment=require(_0xaf58('0x4'));var BPromise=require(_0xaf58('0x5'));var rp=require(_0xaf58('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf58('0x7'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0xaf58('0x8')]=function(_0x16d4f2,_0x32cd17){return _0x16d4f2['define'](_0xaf58('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c7d=['AnalyticFieldReport','analytics_report_fields','lodash','util','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8c7d,0x1df));var _0xd8c7=function(_0x4462b8,_0x600dc6){_0x4462b8=_0x4462b8-0x0;var _0x54873=_0x8c7d[_0x4462b8];return _0x54873;};'use strict';var _=require(_0xd8c7('0x0'));var util=require(_0xd8c7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd8c7('0x2'));var rp=require(_0xd8c7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8c7('0x4'));var attributes=require('./analyticFieldReport.attributes');module[_0xd8c7('0x5')]=function(_0x2d44b0,_0x2e877b){return _0x2d44b0[_0xd8c7('0x6')](_0xd8c7('0x7'),attributes,{'tableName':_0xd8c7('0x8'),'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 f6b3f31..c636821 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 _0x937a=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x470950,_0x579a9){var _0x44ecf6=function(_0x44148d){while(--_0x44148d){_0x470950['push'](_0x470950['shift']());}};_0x44ecf6(++_0x579a9);}(_0x937a,0xbe));var _0xa937=function(_0x238b9a,_0x4fcbb8){_0x238b9a=_0x238b9a-0x0;var _0x59ebf3=_0x937a[_0x238b9a];return _0x59ebf3;};'use strict';var _=require(_0xa937('0x0'));var util=require('util');var moment=require(_0xa937('0x1'));var BPromise=require(_0xa937('0x2'));var rs=require(_0xa937('0x3'));var fs=require('fs');var Redis=require(_0xa937('0x4'));var db=require(_0xa937('0x5'))['db'];var utils=require(_0xa937('0x6'));var logger=require(_0xa937('0x7'))('rpc');var config=require(_0xa937('0x8'));var jayson=require(_0xa937('0x9'));var client=jayson[_0xa937('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c23d8,_0x4b059c,_0x46c8ad){return new BPromise(function(_0x224846,_0x69ce28){return client[_0xa937('0xb')](_0x5c23d8,_0x46c8ad)[_0xa937('0xc')](function(_0x2ebde8){logger['info'](_0xa937('0xd'),_0x4b059c,_0xa937('0xe'));logger[_0xa937('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4b059c,_0xa937('0xe'),JSON['stringify'](_0x2ebde8));if(_0x2ebde8[_0xa937('0x10')]){if(_0x2ebde8['error'][_0xa937('0x11')]===0x1f4){logger[_0xa937('0x10')](_0xa937('0xd'),_0x4b059c,_0x2ebde8[_0xa937('0x10')]['message']);return _0x69ce28(_0x2ebde8[_0xa937('0x10')]['message']);}logger[_0xa937('0x10')](_0xa937('0xd'),_0x4b059c,_0x2ebde8[_0xa937('0x10')]['message']);return _0x224846(_0x2ebde8[_0xa937('0x10')][_0xa937('0x12')]);}else{logger[_0xa937('0x13')](_0xa937('0xd'),_0x4b059c,_0xa937('0xe'));_0x224846(_0x2ebde8[_0xa937('0x14')][_0xa937('0x12')]);}})['catch'](function(_0x10e67d){logger[_0xa937('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4b059c,_0x10e67d);_0x69ce28(_0x10e67d);});});}
\ No newline at end of file
+var _0x40ad=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x40ad,0x1f0));var _0xd40a=function(_0x368682,_0x56698f){_0x368682=_0x368682-0x0;var _0x2bc428=_0x40ad[_0x368682];return _0x2bc428;};'use strict';var _=require(_0xd40a('0x0'));var util=require(_0xd40a('0x1'));var moment=require(_0xd40a('0x2'));var BPromise=require(_0xd40a('0x3'));var rs=require(_0xd40a('0x4'));var fs=require('fs');var Redis=require(_0xd40a('0x5'));var db=require(_0xd40a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd40a('0x7'))('rpc');var config=require(_0xd40a('0x8'));var jayson=require(_0xd40a('0x9'));var client=jayson[_0xd40a('0xa')][_0xd40a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x342b3f,_0x4a9820,_0x42ebde){return new BPromise(function(_0x28b7e0,_0x109613){return client[_0xd40a('0xc')](_0x342b3f,_0x42ebde)[_0xd40a('0xd')](function(_0x5d41f6){logger[_0xd40a('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4a9820,_0xd40a('0xf'));logger[_0xd40a('0x10')](_0xd40a('0x11'),_0x4a9820,_0xd40a('0xf'),JSON['stringify'](_0x5d41f6));if(_0x5d41f6[_0xd40a('0x12')]){if(_0x5d41f6[_0xd40a('0x12')][_0xd40a('0x13')]===0x1f4){logger[_0xd40a('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4a9820,_0x5d41f6[_0xd40a('0x12')][_0xd40a('0x14')]);return _0x109613(_0x5d41f6['error'][_0xd40a('0x14')]);}logger['error'](_0xd40a('0x15'),_0x4a9820,_0x5d41f6[_0xd40a('0x12')][_0xd40a('0x14')]);return _0x28b7e0(_0x5d41f6['error'][_0xd40a('0x14')]);}else{logger[_0xd40a('0xe')](_0xd40a('0x15'),_0x4a9820,'request\x20sent');_0x28b7e0(_0x5d41f6[_0xd40a('0x16')]['message']);}})[_0xd40a('0x17')](function(_0x24aeb5){logger['error'](_0xd40a('0x15'),_0x4a9820,_0x24aeb5);_0x109613(_0x24aeb5);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 58ad183..a4a33b4 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(_0x83d29f,_0x208c3d){var _0x2c64ff=function(_0x7ae1be){while(--_0x7ae1be){_0x83d29f['push'](_0x83d29f['shift']());}};_0x2c64ff(++_0x208c3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x3c1ff7,_0xc3be74){var _0x59830a=function(_0x31b96a){while(--_0x31b96a){_0x3c1ff7['push'](_0x3c1ff7['shift']());}};_0x59830a(++_0xc3be74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 5f24d4b..5cde57a 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 _0x8ec7=['STRING','sequelize','exports','name'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x8ec7[_0x934425];return _0x31d596;};'use strict';var Sequelize=require(_0x78ec('0x0'));module[_0x78ec('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x78ec('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x78ec('0x3')]}};
\ No newline at end of file
+var _0xd957=['exports','name','STRING','sequelize'];(function(_0x3aa05d,_0x42007f){var _0x2f53bc=function(_0x5e1651){while(--_0x5e1651){_0x3aa05d['push'](_0x3aa05d['shift']());}};_0x2f53bc(++_0x42007f);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d95('0x2')},'table':{'type':Sequelize[_0x7d95('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d95('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 66c2f6c..eb68198 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 _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x2680af,_0x28626d){var _0x2f065c=function(_0x1e6f99){while(--_0x1e6f99){_0x2680af['push'](_0x2680af['shift']());}};_0x2f065c(++_0x28626d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x00bb[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x494afb,_0x55e447){var _0x2cf98d=function(_0xa082b4){while(--_0xa082b4){_0x494afb['push'](_0x494afb['shift']());}};_0x2cf98d(++_0x55e447);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x7f3667,_0x30c3f1){_0x7f3667=_0x7f3667-0x0;var _0x2c4c24=_0xf2ca[_0x7f3667];return _0x2c4c24;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 519a1b8..7ec021c 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 _0xe6e9=['define','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports'];(function(_0x1359c9,_0x553c03){var _0x352cc3=function(_0x4cc25b){while(--_0x4cc25b){_0x1359c9['push'](_0x1359c9['shift']());}};_0x352cc3(++_0x553c03);}(_0xe6e9,0x182));var _0x9e6e=function(_0x3f5004,_0x21773a){_0x3f5004=_0x3f5004-0x0;var _0x2085ca=_0xe6e9[_0x3f5004];return _0x2085ca;};'use strict';var _=require(_0x9e6e('0x0'));var util=require(_0x9e6e('0x1'));var logger=require(_0x9e6e('0x2'))('api');var moment=require(_0x9e6e('0x3'));var BPromise=require(_0x9e6e('0x4'));var rp=require(_0x9e6e('0x5'));var fs=require('fs');var path=require(_0x9e6e('0x6'));var rimraf=require(_0x9e6e('0x7'));var config=require('../../config/environment');var attributes=require(_0x9e6e('0x8'));module[_0x9e6e('0x9')]=function(_0x206572,_0x1e8e5e){return _0x206572[_0x9e6e('0xa')]('AnalyticMetric',attributes,{'tableName':_0x9e6e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x05bc=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','api','moment','request-promise','path','rimraf'];(function(_0x3f8bac,_0xaefd0a){var _0x3322ab=function(_0x21ae3c){while(--_0x21ae3c){_0x3f8bac['push'](_0x3f8bac['shift']());}};_0x3322ab(++_0xaefd0a);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc05b('0x0'));var logger=require('../../config/logger')(_0xc05b('0x1'));var moment=require(_0xc05b('0x2'));var BPromise=require('bluebird');var rp=require(_0xc05b('0x3'));var fs=require('fs');var path=require(_0xc05b('0x4'));var rimraf=require(_0xc05b('0x5'));var config=require(_0xc05b('0x6'));var attributes=require(_0xc05b('0x7'));module[_0xc05b('0x8')]=function(_0x2514a1,_0x22c8db){return _0x2514a1[_0xc05b('0x9')](_0xc05b('0xa'),attributes,{'tableName':_0xc05b('0xb'),'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 fbeb232..afc7ca2 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 _0x8e49=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring'];(function(_0x51543d,_0x204989){var _0x4a62cb=function(_0x369871){while(--_0x369871){_0x51543d['push'](_0x51543d['shift']());}};_0x4a62cb(++_0x204989);}(_0x8e49,0x1ac));var _0x98e4=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x8e49[_0x16de68];return _0x1c277e;};'use strict';var _=require(_0x98e4('0x0'));var util=require(_0x98e4('0x1'));var moment=require('moment');var BPromise=require(_0x98e4('0x2'));var rs=require(_0x98e4('0x3'));var fs=require('fs');var Redis=require(_0x98e4('0x4'));var db=require(_0x98e4('0x5'))['db'];var utils=require(_0x98e4('0x6'));var logger=require(_0x98e4('0x7'))('rpc');var config=require(_0x98e4('0x8'));var jayson=require(_0x98e4('0x9'));var client=jayson[_0x98e4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x88112a,_0x27542e,_0x13f068){return new BPromise(function(_0x59f5a4,_0x2bec41){return client[_0x98e4('0xb')](_0x88112a,_0x13f068)[_0x98e4('0xc')](function(_0x572468){logger[_0x98e4('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x27542e,_0x98e4('0xe'));logger[_0x98e4('0xf')](_0x98e4('0x10'),_0x27542e,'request\x20sent',JSON[_0x98e4('0x11')](_0x572468));if(_0x572468['error']){if(_0x572468[_0x98e4('0x12')][_0x98e4('0x13')]===0x1f4){logger[_0x98e4('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x27542e,_0x572468[_0x98e4('0x12')][_0x98e4('0x14')]);return _0x2bec41(_0x572468[_0x98e4('0x12')][_0x98e4('0x14')]);}logger[_0x98e4('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x27542e,_0x572468['error'][_0x98e4('0x14')]);return _0x59f5a4(_0x572468['error'][_0x98e4('0x14')]);}else{logger[_0x98e4('0xd')](_0x98e4('0x15'),_0x27542e,'request\x20sent');_0x59f5a4(_0x572468[_0x98e4('0x16')]['message']);}})[_0x98e4('0x17')](function(_0x28ad3e){logger[_0x98e4('0x12')](_0x98e4('0x15'),_0x27542e,_0x28ad3e);_0x2bec41(_0x28ad3e);});});}
\ No newline at end of file
+var _0x3b4b=['then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1abec9,_0xc63957){var _0x3e46d6=function(_0x159f1b){while(--_0x159f1b){_0x1abec9['push'](_0x1abec9['shift']());}};_0x3e46d6(++_0xc63957);}(_0x3b4b,0x11a));var _0xb3b4=function(_0x416862,_0x5f29d3){_0x416862=_0x416862-0x0;var _0x42a554=_0x3b4b[_0x416862];return _0x42a554;};'use strict';var _=require(_0xb3b4('0x0'));var util=require(_0xb3b4('0x1'));var moment=require(_0xb3b4('0x2'));var BPromise=require(_0xb3b4('0x3'));var rs=require(_0xb3b4('0x4'));var fs=require('fs');var Redis=require(_0xb3b4('0x5'));var db=require(_0xb3b4('0x6'))['db'];var utils=require(_0xb3b4('0x7'));var logger=require(_0xb3b4('0x8'))(_0xb3b4('0x9'));var config=require(_0xb3b4('0xa'));var jayson=require(_0xb3b4('0xb'));var client=jayson[_0xb3b4('0xc')][_0xb3b4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xadd742,_0x46101c,_0x4c79e0){return new BPromise(function(_0x5b3efd,_0x4c15d2){return client[_0xb3b4('0xe')](_0xadd742,_0x4c79e0)[_0xb3b4('0xf')](function(_0x3eaa7e){logger[_0xb3b4('0x10')](_0xb3b4('0x11'),_0x46101c,'request\x20sent');logger[_0xb3b4('0x12')](_0xb3b4('0x13'),_0x46101c,_0xb3b4('0x14'),JSON[_0xb3b4('0x15')](_0x3eaa7e));if(_0x3eaa7e[_0xb3b4('0x16')]){if(_0x3eaa7e[_0xb3b4('0x16')][_0xb3b4('0x17')]===0x1f4){logger[_0xb3b4('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x46101c,_0x3eaa7e['error'][_0xb3b4('0x18')]);return _0x4c15d2(_0x3eaa7e[_0xb3b4('0x16')][_0xb3b4('0x18')]);}logger[_0xb3b4('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x46101c,_0x3eaa7e['error'][_0xb3b4('0x18')]);return _0x5b3efd(_0x3eaa7e['error'][_0xb3b4('0x18')]);}else{logger[_0xb3b4('0x10')](_0xb3b4('0x11'),_0x46101c,_0xb3b4('0x14'));_0x5b3efd(_0x3eaa7e[_0xb3b4('0x19')]['message']);}})[_0xb3b4('0x1a')](function(_0x2e7e21){logger[_0xb3b4('0x16')](_0xb3b4('0x11'),_0x46101c,_0x2e7e21);_0x4c15d2(_0x2e7e21);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 55fef6c..c1457b1 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 _0xe9e8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x37aee9,_0x3a88c4){var _0x5ca958=function(_0x1e88ca){while(--_0x1e88ca){_0x37aee9['push'](_0x37aee9['shift']());}};_0x5ca958(++_0x3a88c4);}(_0xe9e8,0x179));var _0x8e9e=function(_0x421f01,_0x38db8b){_0x421f01=_0x421f01-0x0;var _0x490011=_0xe9e8[_0x421f01];return _0x490011;};'use strict';var multer=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var path=require(_0x8e9e('0x2'));var timeout=require(_0x8e9e('0x3'));var express=require(_0x8e9e('0x4'));var router=express[_0x8e9e('0x5')]();var fs_extra=require(_0x8e9e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8e9e('0x7'));var config=require('../../config/environment');var controller=require(_0x8e9e('0x8'));router[_0x8e9e('0x9')]('/',auth[_0x8e9e('0xa')](),controller['index']);router['get'](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xc')]);router[_0x8e9e('0xd')]('/',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xe')]);router['put']('/:id',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xf')]);router[_0x8e9e('0x10')](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x11')]);module[_0x8e9e('0x12')]=router;
\ No newline at end of file
+var _0x8ef6=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','post','create','put','update','delete'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2ad9a7,_0x40b99d){_0x2ad9a7=_0x2ad9a7-0x0;var _0x64083d=_0x8ef6[_0x2ad9a7];return _0x64083d;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['show']);router[_0x68ef('0xd')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);module[_0x68ef('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 9e64afb..3bcfc00 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. *
// * *
// *************************************************************************
-'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x3fa7=['exports','TEXT','sequelize'];(function(_0x557173,_0x2604c3){var _0x4f0ed6=function(_0x53d953){while(--_0x53d953){_0x557173['push'](_0x557173['shift']());}};_0x4f0ed6(++_0x2604c3);}(_0x3fa7,0x10a));var _0x73fa=function(_0x309789,_0x3ae347){_0x309789=_0x309789-0x0;var _0x12b9b6=_0x3fa7[_0x309789];return _0x12b9b6;};'use strict';var Sequelize=require(_0x73fa('0x0'));module[_0x73fa('0x1')]={'tree':{'type':Sequelize[_0x73fa('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 2a2f11a..75747ea 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 _0x432b=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','sort','where','pick','merge','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x5cfb3a,_0x203aa8){var _0xad66a0=function(_0x56078e){while(--_0x56078e){_0x5cfb3a['push'](_0x5cfb3a['shift']());}};_0xad66a0(++_0x203aa8);}(_0x432b,0xd4));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb432('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb432('0x1'));var rp=require('request-promise');var moment=require(_0xb432('0x2'));var BPromise=require(_0xb432('0x3'));var Mustache=require(_0xb432('0x4'));var util=require(_0xb432('0x5'));var path=require(_0xb432('0x6'));var sox=require(_0xb432('0x7'));var csv=require(_0xb432('0x8'));var ejs=require(_0xb432('0x9'));var fs=require('fs');var fs_extra=require(_0xb432('0xa'));var _=require(_0xb432('0xb'));var squel=require(_0xb432('0xc'));var crypto=require('crypto');var jsforce=require(_0xb432('0xd'));var deskjs=require(_0xb432('0xe'));var toCsv=require(_0xb432('0x8'));var querystring=require(_0xb432('0xf'));var Papa=require(_0xb432('0x10'));var Redis=require(_0xb432('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb432('0x12'));var as=require(_0xb432('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb432('0x14'));var utils=require('../../config/utils');var config=require(_0xb432('0x15'));var licenseUtil=require(_0xb432('0x16'));var db=require(_0xb432('0x17'))['db'];function respondWithStatusCode(_0x500ea9,_0x3fe594){_0x3fe594=_0x3fe594||0xcc;return function(_0x2b7783){if(_0x2b7783){return _0x500ea9['sendStatus'](_0x3fe594);}return _0x500ea9[_0xb432('0x18')](_0x3fe594)[_0xb432('0x19')]();};}function respondWithResult(_0x3e35ec,_0x3ddf4c){_0x3ddf4c=_0x3ddf4c||0xc8;return function(_0x277d65){if(_0x277d65){return _0x3e35ec[_0xb432('0x18')](_0x3ddf4c)[_0xb432('0x1a')](_0x277d65);}};}function respondWithFilteredResult(_0x58fb38,_0x3134d0){return function(_0x292df6){if(_0x292df6){var _0x22a573=typeof _0x3134d0['offset']===_0xb432('0x1b')&&typeof _0x3134d0[_0xb432('0x1c')]===_0xb432('0x1b');var _0x134070=_0x292df6[_0xb432('0x1d')];var _0x47e8ff=_0x22a573?0x0:_0x3134d0[_0xb432('0x1e')];var _0x2a71cb=_0x22a573?_0x292df6[_0xb432('0x1d')]:_0x3134d0[_0xb432('0x1e')]+_0x3134d0[_0xb432('0x1c')];var _0x122441;if(_0x2a71cb>=_0x134070){_0x2a71cb=_0x134070;_0x122441=0xc8;}else{_0x122441=0xce;}_0x58fb38['status'](_0x122441);return _0x58fb38[_0xb432('0x1f')](_0xb432('0x20'),_0x47e8ff+'-'+_0x2a71cb+'/'+_0x134070)[_0xb432('0x1a')](_0x292df6);}return null;};}function patchUpdates(_0x4abfec){return function(_0x545b6a){try{jsonpatch[_0xb432('0x21')](_0x545b6a,_0x4abfec,!![]);}catch(_0x4d0594){return BPromise[_0xb432('0x22')](_0x4d0594);}return _0x545b6a[_0xb432('0x23')]();};}function saveUpdates(_0x61c577,_0x35a98b){return function(_0x4b2908){if(_0x4b2908){return _0x4b2908[_0xb432('0x24')](_0x61c577)[_0xb432('0x25')](function(_0x415e66){return _0x415e66;});}return null;};}function removeEntity(_0x5ae8de,_0x3e8d10){return function(_0x57c1c6){if(_0x57c1c6){return _0x57c1c6[_0xb432('0x26')]()['then'](function(){_0x5ae8de[_0xb432('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e55ca,_0x693e45){return function(_0x483f9){if(!_0x483f9){_0x3e55ca[_0xb432('0x27')](0x194);}return _0x483f9;};}function handleError(_0x37397d,_0x2665e0){_0x2665e0=_0x2665e0||0x1f4;return function(_0x8fc45){logger[_0xb432('0x28')](_0x8fc45[_0xb432('0x29')]);if(_0x8fc45[_0xb432('0x2a')]){delete _0x8fc45[_0xb432('0x2a')];}_0x37397d[_0xb432('0x18')](_0x2665e0)[_0xb432('0x2b')](_0x8fc45);};}exports[_0xb432('0x2c')]=function(_0x168dbf,_0x30a56e){var _0x2e5d6d={},_0x46701b={},_0x54c33e={'count':0x0,'rows':[]};var _0x4198b3=_[_0xb432('0x2d')](db[_0xb432('0x2e')][_0xb432('0x2f')],function(_0x262fbf){return{'name':_0x262fbf[_0xb432('0x30')],'type':_0x262fbf[_0xb432('0x31')][_0xb432('0x32')]};});_0x46701b[_0xb432('0x33')]=_[_0xb432('0x2d')](_0x4198b3,_0xb432('0x2a'));_0x46701b[_0xb432('0x34')]=_[_0xb432('0x35')](_0x168dbf['query']);_0x46701b[_0xb432('0x36')]=_[_0xb432('0x37')](_0x46701b[_0xb432('0x33')],_0x46701b['query']);_0x2e5d6d[_0xb432('0x38')]=_['intersection'](_0x46701b[_0xb432('0x33')],qs[_0xb432('0x39')](_0x168dbf['query'][_0xb432('0x39')]));_0x2e5d6d[_0xb432('0x38')]=_0x2e5d6d[_0xb432('0x38')]['length']?_0x2e5d6d[_0xb432('0x38')]:_0x46701b[_0xb432('0x33')];if(!_0x168dbf['query']['hasOwnProperty']('nolimit')){_0x2e5d6d[_0xb432('0x1c')]=qs[_0xb432('0x1c')](_0x168dbf[_0xb432('0x34')]['limit']);_0x2e5d6d['offset']=qs[_0xb432('0x1e')](_0x168dbf[_0xb432('0x34')][_0xb432('0x1e')]);}_0x2e5d6d['order']=qs[_0xb432('0x3a')](_0x168dbf['query'][_0xb432('0x3a')]);_0x2e5d6d[_0xb432('0x3b')]=qs[_0xb432('0x36')](_[_0xb432('0x3c')](_0x168dbf['query'],_0x46701b[_0xb432('0x36')]),_0x4198b3);if(_0x168dbf[_0xb432('0x34')]['filter']){_0x2e5d6d[_0xb432('0x3b')]=_[_0xb432('0x3d')](_0x2e5d6d['where'],{'$or':_[_0xb432('0x2d')](_0x4198b3,function(_0x4be860){if(_0x4be860['type']!=='VIRTUAL'){var _0x5794fb={};_0x5794fb[_0x4be860[_0xb432('0x2a')]]={'$like':'%'+_0x168dbf[_0xb432('0x34')]['filter']+'%'};return _0x5794fb;}})});}_0x2e5d6d=_['merge']({},_0x2e5d6d,_0x168dbf['options']);var _0x5c9349={'where':_0x2e5d6d[_0xb432('0x3b')]};return db[_0xb432('0x2e')][_0xb432('0x1d')](_0x5c9349)[_0xb432('0x25')](function(_0xaa17e1){_0x54c33e['count']=_0xaa17e1;if(_0x168dbf[_0xb432('0x34')][_0xb432('0x3e')]){_0x2e5d6d[_0xb432('0x3f')]=[{'all':!![]}];}return db[_0xb432('0x2e')][_0xb432('0x40')](_0x2e5d6d);})['then'](function(_0x286a04){_0x54c33e[_0xb432('0x41')]=_0x286a04;return _0x54c33e;})[_0xb432('0x25')](respondWithFilteredResult(_0x30a56e,_0x2e5d6d))[_0xb432('0x42')](handleError(_0x30a56e,null));};exports['show']=function(_0x5b67bd,_0x2dce0a){var _0x471bbc={'raw':!![],'where':{'id':_0x5b67bd[_0xb432('0x43')]['id']}},_0x3dc693={};_0x3dc693['model']=_[_0xb432('0x35')](db[_0xb432('0x2e')][_0xb432('0x2f')]);_0x3dc693[_0xb432('0x34')]=_[_0xb432('0x35')](_0x5b67bd[_0xb432('0x34')]);_0x3dc693[_0xb432('0x36')]=_[_0xb432('0x37')](_0x3dc693[_0xb432('0x33')],_0x3dc693[_0xb432('0x34')]);_0x471bbc[_0xb432('0x38')]=_[_0xb432('0x37')](_0x3dc693[_0xb432('0x33')],qs['fields'](_0x5b67bd[_0xb432('0x34')][_0xb432('0x39')]));_0x471bbc[_0xb432('0x38')]=_0x471bbc[_0xb432('0x38')][_0xb432('0x44')]?_0x471bbc[_0xb432('0x38')]:_0x3dc693[_0xb432('0x33')];if(_0x5b67bd[_0xb432('0x34')][_0xb432('0x3e')]){_0x471bbc[_0xb432('0x3f')]=[{'all':!![]}];}_0x471bbc=_['merge']({},_0x471bbc,_0x5b67bd[_0xb432('0x45')]);return db[_0xb432('0x2e')][_0xb432('0x46')](_0x471bbc)[_0xb432('0x25')](handleEntityNotFound(_0x2dce0a,null))['then'](respondWithResult(_0x2dce0a,null))[_0xb432('0x42')](handleError(_0x2dce0a,null));};exports['create']=function(_0x360e99,_0x1e09ba){return db['AnalyticTreeReport'][_0xb432('0x47')](_0x360e99['body'],{})['then'](respondWithResult(_0x1e09ba,0xc9))['catch'](handleError(_0x1e09ba,null));};exports[_0xb432('0x24')]=function(_0x123389,_0x314fb2){if(_0x123389[_0xb432('0x48')]['id']){delete _0x123389[_0xb432('0x48')]['id'];}return db[_0xb432('0x2e')][_0xb432('0x46')]({'where':{'id':_0x123389['params']['id']}})[_0xb432('0x25')](handleEntityNotFound(_0x314fb2,null))[_0xb432('0x25')](saveUpdates(_0x123389['body'],null))[_0xb432('0x25')](respondWithResult(_0x314fb2,null))[_0xb432('0x42')](handleError(_0x314fb2,null));};exports['destroy']=function(_0x4e32ed,_0xfa147c){return db[_0xb432('0x2e')][_0xb432('0x46')]({'where':{'id':_0x4e32ed[_0xb432('0x43')]['id']}})[_0xb432('0x25')](handleEntityNotFound(_0xfa147c,null))['then'](removeEntity(_0xfa147c,null))['catch'](handleError(_0xfa147c,null));};
\ No newline at end of file
+var _0x257f=['offset','undefined','limit','count','status','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json'];(function(_0x362e4a,_0x26eaa5){var _0xad52fd=function(_0x10cda3){while(--_0x10cda3){_0x362e4a['push'](_0x362e4a['shift']());}};_0xad52fd(++_0x26eaa5);}(_0x257f,0x117));var _0xf257=function(_0x2b42a9,_0x3c7aed){_0x2b42a9=_0x2b42a9-0x0;var _0x215ec1=_0x257f[_0x2b42a9];return _0x215ec1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf257('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf257('0x1'));var rp=require(_0xf257('0x2'));var moment=require(_0xf257('0x3'));var BPromise=require(_0xf257('0x4'));var Mustache=require(_0xf257('0x5'));var util=require('util');var path=require(_0xf257('0x6'));var sox=require(_0xf257('0x7'));var csv=require(_0xf257('0x8'));var ejs=require(_0xf257('0x9'));var fs=require('fs');var fs_extra=require(_0xf257('0xa'));var _=require(_0xf257('0xb'));var squel=require(_0xf257('0xc'));var crypto=require(_0xf257('0xd'));var jsforce=require(_0xf257('0xe'));var deskjs=require(_0xf257('0xf'));var toCsv=require(_0xf257('0x8'));var querystring=require(_0xf257('0x10'));var Papa=require(_0xf257('0x11'));var Redis=require('ioredis');var authService=require(_0xf257('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf257('0x13'));var hardwareService=require(_0xf257('0x14'));var logger=require(_0xf257('0x15'))('api');var utils=require(_0xf257('0x16'));var config=require(_0xf257('0x17'));var licenseUtil=require(_0xf257('0x18'));var db=require(_0xf257('0x19'))['db'];function respondWithStatusCode(_0x19e683,_0x5dc46f){_0x5dc46f=_0x5dc46f||0xcc;return function(_0xf8a772){if(_0xf8a772){return _0x19e683[_0xf257('0x1a')](_0x5dc46f);}return _0x19e683['status'](_0x5dc46f)[_0xf257('0x1b')]();};}function respondWithResult(_0xc0ca27,_0x3f8d7a){_0x3f8d7a=_0x3f8d7a||0xc8;return function(_0x318f04){if(_0x318f04){return _0xc0ca27['status'](_0x3f8d7a)[_0xf257('0x1c')](_0x318f04);}};}function respondWithFilteredResult(_0x4a0e3f,_0x164d89){return function(_0x10ac04){if(_0x10ac04){var _0x5802cc=typeof _0x164d89[_0xf257('0x1d')]===_0xf257('0x1e')&&typeof _0x164d89[_0xf257('0x1f')]===_0xf257('0x1e');var _0x199e77=_0x10ac04[_0xf257('0x20')];var _0x37c62a=_0x5802cc?0x0:_0x164d89[_0xf257('0x1d')];var _0x295648=_0x5802cc?_0x10ac04[_0xf257('0x20')]:_0x164d89[_0xf257('0x1d')]+_0x164d89[_0xf257('0x1f')];var _0x10b72c;if(_0x295648>=_0x199e77){_0x295648=_0x199e77;_0x10b72c=0xc8;}else{_0x10b72c=0xce;}_0x4a0e3f[_0xf257('0x21')](_0x10b72c);return _0x4a0e3f['set']('Content-Range',_0x37c62a+'-'+_0x295648+'/'+_0x199e77)['json'](_0x10ac04);}return null;};}function patchUpdates(_0xb3ae0a){return function(_0x518099){try{jsonpatch[_0xf257('0x22')](_0x518099,_0xb3ae0a,!![]);}catch(_0x1bbb5c){return BPromise[_0xf257('0x23')](_0x1bbb5c);}return _0x518099[_0xf257('0x24')]();};}function saveUpdates(_0x56038d,_0x529429){return function(_0x54aa9e){if(_0x54aa9e){return _0x54aa9e['update'](_0x56038d)[_0xf257('0x25')](function(_0x3faca5){return _0x3faca5;});}return null;};}function removeEntity(_0x14b858,_0x472870){return function(_0x1afc03){if(_0x1afc03){return _0x1afc03[_0xf257('0x26')]()[_0xf257('0x25')](function(){_0x14b858[_0xf257('0x21')](0xcc)[_0xf257('0x1b')]();});}};}function handleEntityNotFound(_0x3c84c6,_0x797368){return function(_0x377201){if(!_0x377201){_0x3c84c6[_0xf257('0x1a')](0x194);}return _0x377201;};}function handleError(_0x1a5532,_0x5aaa93){_0x5aaa93=_0x5aaa93||0x1f4;return function(_0x1ad9d1){logger[_0xf257('0x27')](_0x1ad9d1[_0xf257('0x28')]);if(_0x1ad9d1[_0xf257('0x29')]){delete _0x1ad9d1[_0xf257('0x29')];}_0x1a5532[_0xf257('0x21')](_0x5aaa93)[_0xf257('0x2a')](_0x1ad9d1);};}exports[_0xf257('0x2b')]=function(_0x45a81a,_0x29e345){var _0x3c128d={},_0x3d6c20={},_0x86bd85={'count':0x0,'rows':[]};var _0x57e675=_['map'](db[_0xf257('0x2c')][_0xf257('0x2d')],function(_0x5139db){return{'name':_0x5139db[_0xf257('0x2e')],'type':_0x5139db[_0xf257('0x2f')]['key']};});_0x3d6c20[_0xf257('0x30')]=_[_0xf257('0x31')](_0x57e675,_0xf257('0x29'));_0x3d6c20[_0xf257('0x32')]=_[_0xf257('0x33')](_0x45a81a['query']);_0x3d6c20[_0xf257('0x34')]=_[_0xf257('0x35')](_0x3d6c20[_0xf257('0x30')],_0x3d6c20[_0xf257('0x32')]);_0x3c128d['attributes']=_[_0xf257('0x35')](_0x3d6c20['model'],qs[_0xf257('0x36')](_0x45a81a[_0xf257('0x32')][_0xf257('0x36')]));_0x3c128d[_0xf257('0x37')]=_0x3c128d['attributes'][_0xf257('0x38')]?_0x3c128d[_0xf257('0x37')]:_0x3d6c20[_0xf257('0x30')];if(!_0x45a81a[_0xf257('0x32')][_0xf257('0x39')]('nolimit')){_0x3c128d[_0xf257('0x1f')]=qs['limit'](_0x45a81a[_0xf257('0x32')][_0xf257('0x1f')]);_0x3c128d[_0xf257('0x1d')]=qs[_0xf257('0x1d')](_0x45a81a['query'][_0xf257('0x1d')]);}_0x3c128d[_0xf257('0x3a')]=qs[_0xf257('0x3b')](_0x45a81a[_0xf257('0x32')][_0xf257('0x3b')]);_0x3c128d[_0xf257('0x3c')]=qs[_0xf257('0x34')](_[_0xf257('0x3d')](_0x45a81a[_0xf257('0x32')],_0x3d6c20[_0xf257('0x34')]),_0x57e675);if(_0x45a81a[_0xf257('0x32')][_0xf257('0x3e')]){_0x3c128d[_0xf257('0x3c')]=_[_0xf257('0x3f')](_0x3c128d[_0xf257('0x3c')],{'$or':_[_0xf257('0x31')](_0x57e675,function(_0x394826){if(_0x394826[_0xf257('0x2f')]!==_0xf257('0x40')){var _0x43b17e={};_0x43b17e[_0x394826['name']]={'$like':'%'+_0x45a81a['query'][_0xf257('0x3e')]+'%'};return _0x43b17e;}})});}_0x3c128d=_[_0xf257('0x3f')]({},_0x3c128d,_0x45a81a[_0xf257('0x41')]);var _0x3714d7={'where':_0x3c128d['where']};return db[_0xf257('0x2c')][_0xf257('0x20')](_0x3714d7)['then'](function(_0xec0437){_0x86bd85['count']=_0xec0437;if(_0x45a81a[_0xf257('0x32')][_0xf257('0x42')]){_0x3c128d[_0xf257('0x43')]=[{'all':!![]}];}return db[_0xf257('0x2c')][_0xf257('0x44')](_0x3c128d);})[_0xf257('0x25')](function(_0x161d79){_0x86bd85[_0xf257('0x45')]=_0x161d79;return _0x86bd85;})['then'](respondWithFilteredResult(_0x29e345,_0x3c128d))[_0xf257('0x46')](handleError(_0x29e345,null));};exports[_0xf257('0x47')]=function(_0x408a73,_0x170b71){var _0x176357={'raw':!![],'where':{'id':_0x408a73[_0xf257('0x48')]['id']}},_0x2a9cc1={};_0x2a9cc1['model']=_[_0xf257('0x33')](db[_0xf257('0x2c')][_0xf257('0x2d')]);_0x2a9cc1[_0xf257('0x32')]=_[_0xf257('0x33')](_0x408a73['query']);_0x2a9cc1[_0xf257('0x34')]=_[_0xf257('0x35')](_0x2a9cc1[_0xf257('0x30')],_0x2a9cc1[_0xf257('0x32')]);_0x176357[_0xf257('0x37')]=_[_0xf257('0x35')](_0x2a9cc1[_0xf257('0x30')],qs[_0xf257('0x36')](_0x408a73[_0xf257('0x32')][_0xf257('0x36')]));_0x176357['attributes']=_0x176357[_0xf257('0x37')][_0xf257('0x38')]?_0x176357[_0xf257('0x37')]:_0x2a9cc1[_0xf257('0x30')];if(_0x408a73[_0xf257('0x32')][_0xf257('0x42')]){_0x176357['include']=[{'all':!![]}];}_0x176357=_[_0xf257('0x3f')]({},_0x176357,_0x408a73['options']);return db[_0xf257('0x2c')][_0xf257('0x49')](_0x176357)[_0xf257('0x25')](handleEntityNotFound(_0x170b71,null))[_0xf257('0x25')](respondWithResult(_0x170b71,null))[_0xf257('0x46')](handleError(_0x170b71,null));};exports[_0xf257('0x4a')]=function(_0x161d20,_0x384a1b){return db['AnalyticTreeReport'][_0xf257('0x4a')](_0x161d20[_0xf257('0x4b')],{})[_0xf257('0x25')](respondWithResult(_0x384a1b,0xc9))[_0xf257('0x46')](handleError(_0x384a1b,null));};exports[_0xf257('0x4c')]=function(_0x456ed0,_0x37b02b){if(_0x456ed0[_0xf257('0x4b')]['id']){delete _0x456ed0[_0xf257('0x4b')]['id'];}return db[_0xf257('0x2c')]['find']({'where':{'id':_0x456ed0[_0xf257('0x48')]['id']}})[_0xf257('0x25')](handleEntityNotFound(_0x37b02b,null))['then'](saveUpdates(_0x456ed0[_0xf257('0x4b')],null))[_0xf257('0x25')](respondWithResult(_0x37b02b,null))[_0xf257('0x46')](handleError(_0x37b02b,null));};exports[_0xf257('0x26')]=function(_0x2ba585,_0x487de9){return db[_0xf257('0x2c')][_0xf257('0x49')]({'where':{'id':_0x2ba585[_0xf257('0x48')]['id']}})[_0xf257('0x25')](handleEntityNotFound(_0x487de9,null))[_0xf257('0x25')](removeEntity(_0x487de9,null))[_0xf257('0x46')](handleError(_0x487de9,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index fdb396a..814beac 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 _0x7fde=['api','moment','request-promise','path','rimraf','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0x7fde,0x1e9));var _0xe7fd=function(_0x5386a6,_0x373c00){_0x5386a6=_0x5386a6-0x0;var _0x105201=_0x7fde[_0x5386a6];return _0x105201;};'use strict';var _=require(_0xe7fd('0x0'));var util=require(_0xe7fd('0x1'));var logger=require(_0xe7fd('0x2'))(_0xe7fd('0x3'));var moment=require(_0xe7fd('0x4'));var BPromise=require('bluebird');var rp=require(_0xe7fd('0x5'));var fs=require('fs');var path=require(_0xe7fd('0x6'));var rimraf=require(_0xe7fd('0x7'));var config=require(_0xe7fd('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0xe7fd('0x9')]=function(_0x3415c1,_0x3955dc){return _0x3415c1['define'](_0xe7fd('0xa'),attributes,{'tableName':_0xe7fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x505b=['../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x126eaf,_0x525848){var _0x58fc38=function(_0x247025){while(--_0x247025){_0x126eaf['push'](_0x126eaf['shift']());}};_0x58fc38(++_0x525848);}(_0x505b,0x139));var _0xb505=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x505b[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xb505('0x0'));var util=require('util');var logger=require(_0xb505('0x1'))(_0xb505('0x2'));var moment=require(_0xb505('0x3'));var BPromise=require(_0xb505('0x4'));var rp=require(_0xb505('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb505('0x6'));var attributes=require(_0xb505('0x7'));module[_0xb505('0x8')]=function(_0x55219b,_0x106a8a){return _0x55219b[_0xb505('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xb505('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 8d66223..c5c2fd2 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(_0x365a13,_0x4c4410){var _0x56dc58=function(_0x49bc70){while(--_0x49bc70){_0x365a13['push'](_0x365a13['shift']());}};_0x56dc58(++_0x4c4410);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x483461,_0x3a7690){var _0x1c851f=function(_0x3683ca){while(--_0x3683ca){_0x483461['push'](_0x483461['shift']());}};_0x1c851f(++_0x3a7690);}(_0x2ef3,0xba));var _0x32ef=function(_0x27b22e,_0x2c7ba4){_0x27b22e=_0x27b22e-0x0;var _0x228375=_0x2ef3[_0x27b22e];return _0x228375;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 4cda695..c18ed84 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 _0xf2dd=['show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','index','/:id','isAuthenticated'];(function(_0x422994,_0x99047b){var _0x43ad8f=function(_0x5ae30d){while(--_0x5ae30d){_0x422994['push'](_0x422994['shift']());}};_0x43ad8f(++_0x99047b);}(_0xf2dd,0x1cf));var _0xdf2d=function(_0x24618a,_0x2cd0f4){_0x24618a=_0x24618a-0x0;var _0x2e3d64=_0xf2dd[_0x24618a];return _0x2e3d64;};'use strict';var multer=require('multer');var util=require(_0xdf2d('0x0'));var path=require(_0xdf2d('0x1'));var timeout=require(_0xdf2d('0x2'));var express=require('express');var router=express[_0xdf2d('0x3')]();var fs_extra=require(_0xdf2d('0x4'));var auth=require(_0xdf2d('0x5'));var interaction=require(_0xdf2d('0x6'));var config=require('../../config/environment');var controller=require(_0xdf2d('0x7'));router[_0xdf2d('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf2d('0x9')]);router[_0xdf2d('0x8')](_0xdf2d('0xa'),auth[_0xdf2d('0xb')](),controller[_0xdf2d('0xc')]);router[_0xdf2d('0xd')]('/',auth['isAuthenticated'](),controller[_0xdf2d('0xe')]);router[_0xdf2d('0xf')](_0xdf2d('0xa'),auth[_0xdf2d('0xb')](),controller[_0xdf2d('0x10')]);router[_0xdf2d('0x11')]('/:id',auth[_0xdf2d('0xb')](),controller[_0xdf2d('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x4b79=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util'];(function(_0x188443,_0x2890df){var _0x44e29e=function(_0x3d3c85){while(--_0x3d3c85){_0x188443['push'](_0x188443['shift']());}};_0x44e29e(++_0x2890df);}(_0x4b79,0xa0));var _0x94b7=function(_0x20c82e,_0x4cdc3c){_0x20c82e=_0x20c82e-0x0;var _0x4fca3d=_0x4b79[_0x20c82e];return _0x4fca3d;};'use strict';var multer=require(_0x94b7('0x0'));var util=require(_0x94b7('0x1'));var path=require('path');var timeout=require(_0x94b7('0x2'));var express=require(_0x94b7('0x3'));var router=express[_0x94b7('0x4')]();var fs_extra=require(_0x94b7('0x5'));var auth=require(_0x94b7('0x6'));var interaction=require(_0x94b7('0x7'));var config=require(_0x94b7('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x94b7('0x9')]('/',auth[_0x94b7('0xa')](),controller[_0x94b7('0xb')]);router[_0x94b7('0x9')](_0x94b7('0xc'),auth[_0x94b7('0xa')](),controller[_0x94b7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x94b7('0xe')]);router['put'](_0x94b7('0xc'),auth[_0x94b7('0xa')](),controller[_0x94b7('0xf')]);router[_0x94b7('0x10')](_0x94b7('0xc'),auth[_0x94b7('0xa')](),controller[_0x94b7('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index ac99c13..bf004fa 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 _0xce9b=['sequelize','exports','STRING'];(function(_0x42fd64,_0x2cd273){var _0x4365e5=function(_0x187657){while(--_0x187657){_0x42fd64['push'](_0x42fd64['shift']());}};_0x4365e5(++_0x2cd273);}(_0xce9b,0xc6));var _0xbce9=function(_0x49f71f,_0x2e05e5){_0x49f71f=_0x49f71f-0x0;var _0x44487f=_0xce9b[_0x49f71f];return _0x44487f;};'use strict';var Sequelize=require(_0xbce9('0x0'));module[_0xbce9('0x1')]={'name':{'type':Sequelize[_0xbce9('0x2')]},'basename':{'type':Sequelize[_0xbce9('0x2')]},'type':{'type':Sequelize[_0xbce9('0x2')]}};
\ No newline at end of file
+var _0x4abf=['STRING','sequelize','exports'];(function(_0x46cb35,_0x2b92ab){var _0x847507=function(_0x29b091){while(--_0x29b091){_0x46cb35['push'](_0x46cb35['shift']());}};_0x847507(++_0x2b92ab);}(_0x4abf,0xac));var _0xf4ab=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x4abf[_0x2a8c21];return _0x5f3061;};'use strict';var Sequelize=require(_0xf4ab('0x0'));module[_0xf4ab('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xf4ab('0x2')]},'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 a3143d9..b151314 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 _0xd441=['originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','error','name','send','index','map','Attachment','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','then','include','findAll','rows','catch','show','includeAll','clone','params','find','get','omit','createdAt','updatedAt','body','create','destroy','file'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xd441,0x6a));var _0x1d44=function(_0x21ff08,_0x238443){_0x21ff08=_0x21ff08-0x0;var _0x5450e9=_0xd441[_0x21ff08];return _0x5450e9;};'use strict';var emlformat=require(_0x1d44('0x0'));var rimraf=require(_0x1d44('0x1'));var zipdir=require(_0x1d44('0x2'));var jsonpatch=require(_0x1d44('0x3'));var rp=require(_0x1d44('0x4'));var moment=require(_0x1d44('0x5'));var BPromise=require(_0x1d44('0x6'));var Mustache=require(_0x1d44('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1d44('0x8'));var csv=require(_0x1d44('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d44('0xa'));var _=require(_0x1d44('0xb'));var squel=require('squel');var crypto=require(_0x1d44('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1d44('0xd'));var toCsv=require(_0x1d44('0x9'));var querystring=require(_0x1d44('0xe'));var Papa=require(_0x1d44('0xf'));var Redis=require(_0x1d44('0x10'));var authService=require(_0x1d44('0x11'));var qs=require(_0x1d44('0x12'));var as=require(_0x1d44('0x13'));var hardwareService=require(_0x1d44('0x14'));var logger=require(_0x1d44('0x15'))(_0x1d44('0x16'));var utils=require('../../config/utils');var config=require(_0x1d44('0x17'));var licenseUtil=require(_0x1d44('0x18'));var db=require(_0x1d44('0x19'))['db'];function respondWithStatusCode(_0x1c3f51,_0x4e8c1e){_0x4e8c1e=_0x4e8c1e||0xcc;return function(_0x87a294){if(_0x87a294){return _0x1c3f51[_0x1d44('0x1a')](_0x4e8c1e);}return _0x1c3f51[_0x1d44('0x1b')](_0x4e8c1e)[_0x1d44('0x1c')]();};}function respondWithResult(_0x3fcca2,_0x46029a){_0x46029a=_0x46029a||0xc8;return function(_0x683bbd){if(_0x683bbd){return _0x3fcca2[_0x1d44('0x1b')](_0x46029a)[_0x1d44('0x1d')](_0x683bbd);}};}function respondWithFilteredResult(_0x20dffb,_0xa3c2a0){return function(_0x8f6138){if(_0x8f6138){var _0x286dcc=typeof _0xa3c2a0[_0x1d44('0x1e')]===_0x1d44('0x1f')&&typeof _0xa3c2a0[_0x1d44('0x20')]==='undefined';var _0x7f804a=_0x8f6138[_0x1d44('0x21')];var _0x34ed33=_0x286dcc?0x0:_0xa3c2a0[_0x1d44('0x1e')];var _0x1b300a=_0x286dcc?_0x8f6138[_0x1d44('0x21')]:_0xa3c2a0[_0x1d44('0x1e')]+_0xa3c2a0[_0x1d44('0x20')];var _0x41fd60;if(_0x1b300a>=_0x7f804a){_0x1b300a=_0x7f804a;_0x41fd60=0xc8;}else{_0x41fd60=0xce;}_0x20dffb[_0x1d44('0x1b')](_0x41fd60);return _0x20dffb[_0x1d44('0x22')](_0x1d44('0x23'),_0x34ed33+'-'+_0x1b300a+'/'+_0x7f804a)[_0x1d44('0x1d')](_0x8f6138);}return null;};}function patchUpdates(_0x105be8){return function(_0x18b939){try{jsonpatch['apply'](_0x18b939,_0x105be8,!![]);}catch(_0x115c5c){return BPromise[_0x1d44('0x24')](_0x115c5c);}return _0x18b939[_0x1d44('0x25')]();};}function saveUpdates(_0x13c175,_0x318990){return function(_0x548088){if(_0x548088){return _0x548088[_0x1d44('0x26')](_0x13c175)['then'](function(_0x25dbd7){return _0x25dbd7;});}return null;};}function removeEntity(_0x124c6d,_0xff56eb){return function(_0x49b677){if(_0x49b677){return _0x49b677['destroy']()['then'](function(){_0x124c6d[_0x1d44('0x1b')](0xcc)[_0x1d44('0x1c')]();});}};}function handleEntityNotFound(_0x53dc43,_0x21d46a){return function(_0x26d1c5){if(!_0x26d1c5){_0x53dc43[_0x1d44('0x1a')](0x194);}return _0x26d1c5;};}function handleError(_0x24da95,_0x59ec7a){_0x59ec7a=_0x59ec7a||0x1f4;return function(_0x365678){logger[_0x1d44('0x27')](_0x365678['stack']);if(_0x365678['name']){delete _0x365678[_0x1d44('0x28')];}_0x24da95[_0x1d44('0x1b')](_0x59ec7a)[_0x1d44('0x29')](_0x365678);};}exports[_0x1d44('0x2a')]=function(_0x39502a,_0x454a2e){var _0x2fe0f6={},_0x5238a1={},_0x323c67={'count':0x0,'rows':[]};var _0x21d3f9=_[_0x1d44('0x2b')](db[_0x1d44('0x2c')][_0x1d44('0x2d')],function(_0x5edf2d){return{'name':_0x5edf2d[_0x1d44('0x2e')],'type':_0x5edf2d['type'][_0x1d44('0x2f')]};});_0x5238a1['model']=_[_0x1d44('0x2b')](_0x21d3f9,_0x1d44('0x28'));_0x5238a1[_0x1d44('0x30')]=_[_0x1d44('0x31')](_0x39502a[_0x1d44('0x30')]);_0x5238a1[_0x1d44('0x32')]=_[_0x1d44('0x33')](_0x5238a1[_0x1d44('0x34')],_0x5238a1['query']);_0x2fe0f6[_0x1d44('0x35')]=_[_0x1d44('0x33')](_0x5238a1[_0x1d44('0x34')],qs[_0x1d44('0x36')](_0x39502a['query']['fields']));_0x2fe0f6[_0x1d44('0x35')]=_0x2fe0f6['attributes'][_0x1d44('0x37')]?_0x2fe0f6[_0x1d44('0x35')]:_0x5238a1[_0x1d44('0x34')];if(!_0x39502a[_0x1d44('0x30')][_0x1d44('0x38')](_0x1d44('0x39'))){_0x2fe0f6['limit']=qs[_0x1d44('0x20')](_0x39502a[_0x1d44('0x30')]['limit']);_0x2fe0f6[_0x1d44('0x1e')]=qs[_0x1d44('0x1e')](_0x39502a[_0x1d44('0x30')][_0x1d44('0x1e')]);}_0x2fe0f6[_0x1d44('0x3a')]=qs[_0x1d44('0x3b')](_0x39502a[_0x1d44('0x30')][_0x1d44('0x3b')]);_0x2fe0f6[_0x1d44('0x3c')]=qs['filters'](_['pick'](_0x39502a['query'],_0x5238a1[_0x1d44('0x32')]),_0x21d3f9);if(_0x39502a['query']['filter']){_0x2fe0f6[_0x1d44('0x3c')]=_[_0x1d44('0x3d')](_0x2fe0f6['where'],{'$or':_[_0x1d44('0x2b')](_0x21d3f9,function(_0x2f56e5){if(_0x2f56e5[_0x1d44('0x3e')]!==_0x1d44('0x3f')){var _0x12439d={};_0x12439d[_0x2f56e5[_0x1d44('0x28')]]={'$like':'%'+_0x39502a[_0x1d44('0x30')][_0x1d44('0x40')]+'%'};return _0x12439d;}})});}_0x2fe0f6=_['merge']({},_0x2fe0f6,_0x39502a[_0x1d44('0x41')]);var _0x1d7683={'where':_0x2fe0f6['where']};return db[_0x1d44('0x2c')][_0x1d44('0x21')](_0x1d7683)[_0x1d44('0x42')](function(_0x5d31b9){_0x323c67[_0x1d44('0x21')]=_0x5d31b9;if(_0x39502a['query']['includeAll']){_0x2fe0f6[_0x1d44('0x43')]=[{'all':!![]}];}return db['Attachment'][_0x1d44('0x44')](_0x2fe0f6);})['then'](function(_0xaa1b39){_0x323c67[_0x1d44('0x45')]=_0xaa1b39;return _0x323c67;})[_0x1d44('0x42')](respondWithFilteredResult(_0x454a2e,_0x2fe0f6))[_0x1d44('0x46')](handleError(_0x454a2e,null));};exports[_0x1d44('0x47')]=function(_0x9cfc32,_0x4450bd){var _0x3a1303={'raw':!![],'where':{'id':_0x9cfc32['params']['id']}},_0x205cf9={};_0x205cf9['model']=_[_0x1d44('0x31')](db[_0x1d44('0x2c')][_0x1d44('0x2d')]);_0x205cf9[_0x1d44('0x30')]=_[_0x1d44('0x31')](_0x9cfc32[_0x1d44('0x30')]);_0x205cf9[_0x1d44('0x32')]=_[_0x1d44('0x33')](_0x205cf9[_0x1d44('0x34')],_0x205cf9['query']);_0x3a1303[_0x1d44('0x35')]=_[_0x1d44('0x33')](_0x205cf9[_0x1d44('0x34')],qs[_0x1d44('0x36')](_0x9cfc32[_0x1d44('0x30')]['fields']));_0x3a1303[_0x1d44('0x35')]=_0x3a1303[_0x1d44('0x35')][_0x1d44('0x37')]?_0x3a1303['attributes']:_0x205cf9[_0x1d44('0x34')];if(_0x9cfc32[_0x1d44('0x30')][_0x1d44('0x48')]){_0x3a1303[_0x1d44('0x43')]=[{'all':!![]}];}_0x3a1303=_[_0x1d44('0x3d')]({},_0x3a1303,_0x9cfc32[_0x1d44('0x41')]);return db[_0x1d44('0x2c')]['find'](_0x3a1303)['then'](handleEntityNotFound(_0x4450bd,null))[_0x1d44('0x42')](respondWithResult(_0x4450bd,null))[_0x1d44('0x46')](handleError(_0x4450bd,null));};exports[_0x1d44('0x49')]=function(_0x568f1f,_0x2c2972){var _0x185bd0={'where':{'id':_0x568f1f[_0x1d44('0x4a')]['id']}},_0x11ad6b={};_0x11ad6b['model']=_['keys'](db['Attachment'][_0x1d44('0x2d')]);_0x185bd0[_0x1d44('0x35')]=_[_0x1d44('0x33')](_0x11ad6b[_0x1d44('0x34')],qs[_0x1d44('0x36')](_0x568f1f[_0x1d44('0x30')][_0x1d44('0x36')]));_0x185bd0[_0x1d44('0x35')]=_0x185bd0[_0x1d44('0x35')][_0x1d44('0x37')]?_0x185bd0[_0x1d44('0x35')]:_0x11ad6b[_0x1d44('0x34')];if(_0x568f1f['query'][_0x1d44('0x48')]){_0x185bd0[_0x1d44('0x43')]=[{'all':!![]}];}_0x185bd0=_['merge']({},_0x185bd0,_0x568f1f[_0x1d44('0x41')]);return db[_0x1d44('0x2c')][_0x1d44('0x4b')](_0x185bd0)[_0x1d44('0x42')](handleEntityNotFound(_0x2c2972,null))['then'](function(_0x8b03a7){if(_0x8b03a7){var _0x2578b3=_0x8b03a7[_0x1d44('0x4c')]({'plain':!![]});_0x2578b3=qs[_0x1d44('0x4d')](_0x2578b3,['id',_0x1d44('0x4e'),_0x1d44('0x4f')]);_0x568f1f[_0x1d44('0x50')]=_[_0x1d44('0x4d')](_0x568f1f[_0x1d44('0x50')],['id',_0x1d44('0x4e'),_0x1d44('0x4f')]);return db[_0x1d44('0x2c')][_0x1d44('0x51')](_['merge'](_0x2578b3,_0x568f1f[_0x1d44('0x50')]),{'include':_0x568f1f['query'][_0x1d44('0x48')]?[{'all':!![]}]:undefined});}})[_0x1d44('0x42')](respondWithResult(_0x2c2972,0xc9))[_0x1d44('0x46')](handleError(_0x2c2972,null));};exports[_0x1d44('0x26')]=function(_0x437b8f,_0x3a6491){if(_0x437b8f[_0x1d44('0x50')]['id']){delete _0x437b8f['body']['id'];}return db[_0x1d44('0x2c')][_0x1d44('0x4b')]({'where':{'id':_0x437b8f['params']['id']}})['then'](handleEntityNotFound(_0x3a6491,null))['then'](saveUpdates(_0x437b8f[_0x1d44('0x50')],null))[_0x1d44('0x42')](respondWithResult(_0x3a6491,null))[_0x1d44('0x46')](handleError(_0x3a6491,null));};exports[_0x1d44('0x52')]=function(_0x46bb26,_0x205650){return db[_0x1d44('0x2c')][_0x1d44('0x4b')]({'where':{'id':_0x46bb26[_0x1d44('0x4a')]['id']}})[_0x1d44('0x42')](handleEntityNotFound(_0x205650,null))[_0x1d44('0x42')](removeEntity(_0x205650,null))[_0x1d44('0x46')](handleError(_0x205650,null));};exports[_0x1d44('0x51')]=function(_0x2c26d5,_0x3f2966,_0x4e893d){_0x2c26d5[_0x1d44('0x50')][_0x1d44('0x28')]=_0x2c26d5[_0x1d44('0x53')][_0x1d44('0x54')];_0x2c26d5['body'][_0x1d44('0x55')]=_0x2c26d5[_0x1d44('0x53')][_0x1d44('0x56')];_0x2c26d5[_0x1d44('0x50')][_0x1d44('0x3e')]=_0x2c26d5['file'][_0x1d44('0x57')];return db[_0x1d44('0x2c')][_0x1d44('0x51')](_0x2c26d5['body'])['then'](respondWithResult(_0x3f2966,0xc9))[_0x1d44('0x46')](handleError(_0x3f2966,null));};exports[_0x1d44('0x58')]=function(_0x2296aa,_0x4e0d1b,_0x303001){return db[_0x1d44('0x2c')][_0x1d44('0x59')]({'where':{'id':_0x2296aa['params']['id']},'raw':!![]})[_0x1d44('0x42')](handleEntityNotFound(_0x4e0d1b,null))['then'](function(_0x32bcaa){if(_0x32bcaa){var _0x304b0e=_0x32bcaa[_0x1d44('0x5a')]!==null;var _0x353aca=path[_0x1d44('0x5b')](config[_0x1d44('0x5c')],_0x1d44('0x5d'));if(_0x304b0e){_0x353aca=path['join'](_0x353aca,_0x1d44('0x5e'));}var _0x579b26=path[_0x1d44('0x5b')](_0x353aca,_0x32bcaa[_0x1d44('0x55')]);return _0x4e0d1b[_0x1d44('0x58')](_0x579b26);}})[_0x1d44('0x46')](handleError(_0x4e0d1b,null));};
\ No newline at end of file
+var _0xd638=['model','attributes','fields','length','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','rows','catch','show','params','keys','intersection','find','get','updatedAt','omit','body','createdAt','create','update','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','query','filters'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0xd638,0x16d));var _0x8d63=function(_0x40e3e6,_0x141bc1){_0x40e3e6=_0x40e3e6-0x0;var _0x601283=_0xd638[_0x40e3e6];return _0x601283;};'use strict';var emlformat=require(_0x8d63('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d63('0x1'));var rp=require(_0x8d63('0x2'));var moment=require(_0x8d63('0x3'));var BPromise=require(_0x8d63('0x4'));var Mustache=require(_0x8d63('0x5'));var util=require(_0x8d63('0x6'));var path=require('path');var sox=require(_0x8d63('0x7'));var csv=require(_0x8d63('0x8'));var ejs=require(_0x8d63('0x9'));var fs=require('fs');var fs_extra=require(_0x8d63('0xa'));var _=require(_0x8d63('0xb'));var squel=require(_0x8d63('0xc'));var crypto=require(_0x8d63('0xd'));var jsforce=require(_0x8d63('0xe'));var deskjs=require(_0x8d63('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8d63('0x10'));var Papa=require('papaparse');var Redis=require(_0x8d63('0x11'));var authService=require(_0x8d63('0x12'));var qs=require(_0x8d63('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d63('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8d63('0x15'));var db=require(_0x8d63('0x16'))['db'];function respondWithStatusCode(_0x1cb026,_0x3c284f){_0x3c284f=_0x3c284f||0xcc;return function(_0x1e7a4c){if(_0x1e7a4c){return _0x1cb026[_0x8d63('0x17')](_0x3c284f);}return _0x1cb026[_0x8d63('0x18')](_0x3c284f)[_0x8d63('0x19')]();};}function respondWithResult(_0x4d50cc,_0xcd86dd){_0xcd86dd=_0xcd86dd||0xc8;return function(_0x5c75f9){if(_0x5c75f9){return _0x4d50cc[_0x8d63('0x18')](_0xcd86dd)[_0x8d63('0x1a')](_0x5c75f9);}};}function respondWithFilteredResult(_0x4e83ed,_0x5b5e8e){return function(_0x4d9eac){if(_0x4d9eac){var _0x47ccac=typeof _0x5b5e8e[_0x8d63('0x1b')]===_0x8d63('0x1c')&&typeof _0x5b5e8e[_0x8d63('0x1d')]===_0x8d63('0x1c');var _0x33687a=_0x4d9eac['count'];var _0x46fa15=_0x47ccac?0x0:_0x5b5e8e[_0x8d63('0x1b')];var _0x30957b=_0x47ccac?_0x4d9eac[_0x8d63('0x1e')]:_0x5b5e8e['offset']+_0x5b5e8e[_0x8d63('0x1d')];var _0x57ffab;if(_0x30957b>=_0x33687a){_0x30957b=_0x33687a;_0x57ffab=0xc8;}else{_0x57ffab=0xce;}_0x4e83ed[_0x8d63('0x18')](_0x57ffab);return _0x4e83ed[_0x8d63('0x1f')]('Content-Range',_0x46fa15+'-'+_0x30957b+'/'+_0x33687a)[_0x8d63('0x1a')](_0x4d9eac);}return null;};}function patchUpdates(_0x4edb5e){return function(_0x584577){try{jsonpatch[_0x8d63('0x20')](_0x584577,_0x4edb5e,!![]);}catch(_0xcb56d7){return BPromise['reject'](_0xcb56d7);}return _0x584577['save']();};}function saveUpdates(_0x22bf85,_0x1642d2){return function(_0x40a77a){if(_0x40a77a){return _0x40a77a['update'](_0x22bf85)[_0x8d63('0x21')](function(_0x26c76b){return _0x26c76b;});}return null;};}function removeEntity(_0x21b633,_0x50d7e1){return function(_0x5bede5){if(_0x5bede5){return _0x5bede5[_0x8d63('0x22')]()[_0x8d63('0x21')](function(){_0x21b633[_0x8d63('0x18')](0xcc)[_0x8d63('0x19')]();});}};}function handleEntityNotFound(_0x153f58,_0x53201f){return function(_0x413cf6){if(!_0x413cf6){_0x153f58[_0x8d63('0x17')](0x194);}return _0x413cf6;};}function handleError(_0x2239d9,_0x49643c){_0x49643c=_0x49643c||0x1f4;return function(_0x52b581){logger[_0x8d63('0x23')](_0x52b581['stack']);if(_0x52b581[_0x8d63('0x24')]){delete _0x52b581['name'];}_0x2239d9[_0x8d63('0x18')](_0x49643c)[_0x8d63('0x25')](_0x52b581);};}exports[_0x8d63('0x26')]=function(_0x2f7797,_0x259f69){var _0x3eeb96={},_0x339f3c={},_0x295a7a={'count':0x0,'rows':[]};var _0x4f82f0=_[_0x8d63('0x27')](db['Attachment'][_0x8d63('0x28')],function(_0x14644b){return{'name':_0x14644b[_0x8d63('0x29')],'type':_0x14644b[_0x8d63('0x2a')]['key']};});_0x339f3c['model']=_[_0x8d63('0x27')](_0x4f82f0,_0x8d63('0x24'));_0x339f3c['query']=_['keys'](_0x2f7797[_0x8d63('0x2b')]);_0x339f3c[_0x8d63('0x2c')]=_['intersection'](_0x339f3c[_0x8d63('0x2d')],_0x339f3c[_0x8d63('0x2b')]);_0x3eeb96[_0x8d63('0x2e')]=_['intersection'](_0x339f3c[_0x8d63('0x2d')],qs[_0x8d63('0x2f')](_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x2f')]));_0x3eeb96[_0x8d63('0x2e')]=_0x3eeb96[_0x8d63('0x2e')][_0x8d63('0x30')]?_0x3eeb96[_0x8d63('0x2e')]:_0x339f3c['model'];if(!_0x2f7797['query']['hasOwnProperty']('nolimit')){_0x3eeb96[_0x8d63('0x1d')]=qs[_0x8d63('0x1d')](_0x2f7797[_0x8d63('0x2b')]['limit']);_0x3eeb96['offset']=qs['offset'](_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x1b')]);}_0x3eeb96['order']=qs['sort'](_0x2f7797[_0x8d63('0x2b')]['sort']);_0x3eeb96[_0x8d63('0x31')]=qs[_0x8d63('0x2c')](_[_0x8d63('0x32')](_0x2f7797[_0x8d63('0x2b')],_0x339f3c['filters']),_0x4f82f0);if(_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x33')]){_0x3eeb96['where']=_[_0x8d63('0x34')](_0x3eeb96['where'],{'$or':_[_0x8d63('0x27')](_0x4f82f0,function(_0x2f6f5d){if(_0x2f6f5d[_0x8d63('0x2a')]!==_0x8d63('0x35')){var _0x3b4fb6={};_0x3b4fb6[_0x2f6f5d[_0x8d63('0x24')]]={'$like':'%'+_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x33')]+'%'};return _0x3b4fb6;}})});}_0x3eeb96=_[_0x8d63('0x34')]({},_0x3eeb96,_0x2f7797[_0x8d63('0x36')]);var _0x50aeba={'where':_0x3eeb96[_0x8d63('0x31')]};return db[_0x8d63('0x37')][_0x8d63('0x1e')](_0x50aeba)[_0x8d63('0x21')](function(_0x331695){_0x295a7a[_0x8d63('0x1e')]=_0x331695;if(_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x38')]){_0x3eeb96[_0x8d63('0x39')]=[{'all':!![]}];}return db[_0x8d63('0x37')]['findAll'](_0x3eeb96);})['then'](function(_0x304f0a){_0x295a7a[_0x8d63('0x3a')]=_0x304f0a;return _0x295a7a;})['then'](respondWithFilteredResult(_0x259f69,_0x3eeb96))[_0x8d63('0x3b')](handleError(_0x259f69,null));};exports[_0x8d63('0x3c')]=function(_0x56e713,_0x4b7dc6){var _0xeff46d={'raw':!![],'where':{'id':_0x56e713[_0x8d63('0x3d')]['id']}},_0x3ee488={};_0x3ee488[_0x8d63('0x2d')]=_[_0x8d63('0x3e')](db[_0x8d63('0x37')][_0x8d63('0x28')]);_0x3ee488[_0x8d63('0x2b')]=_[_0x8d63('0x3e')](_0x56e713[_0x8d63('0x2b')]);_0x3ee488[_0x8d63('0x2c')]=_[_0x8d63('0x3f')](_0x3ee488['model'],_0x3ee488[_0x8d63('0x2b')]);_0xeff46d['attributes']=_[_0x8d63('0x3f')](_0x3ee488['model'],qs['fields'](_0x56e713['query']['fields']));_0xeff46d[_0x8d63('0x2e')]=_0xeff46d[_0x8d63('0x2e')]['length']?_0xeff46d['attributes']:_0x3ee488[_0x8d63('0x2d')];if(_0x56e713[_0x8d63('0x2b')][_0x8d63('0x38')]){_0xeff46d[_0x8d63('0x39')]=[{'all':!![]}];}_0xeff46d=_[_0x8d63('0x34')]({},_0xeff46d,_0x56e713[_0x8d63('0x36')]);return db[_0x8d63('0x37')][_0x8d63('0x40')](_0xeff46d)[_0x8d63('0x21')](handleEntityNotFound(_0x4b7dc6,null))[_0x8d63('0x21')](respondWithResult(_0x4b7dc6,null))[_0x8d63('0x3b')](handleError(_0x4b7dc6,null));};exports['clone']=function(_0x210d53,_0x382cfc){var _0x17ef29={'where':{'id':_0x210d53[_0x8d63('0x3d')]['id']}},_0x1f9c07={};_0x1f9c07[_0x8d63('0x2d')]=_['keys'](db[_0x8d63('0x37')][_0x8d63('0x28')]);_0x17ef29['attributes']=_[_0x8d63('0x3f')](_0x1f9c07[_0x8d63('0x2d')],qs[_0x8d63('0x2f')](_0x210d53[_0x8d63('0x2b')][_0x8d63('0x2f')]));_0x17ef29[_0x8d63('0x2e')]=_0x17ef29[_0x8d63('0x2e')][_0x8d63('0x30')]?_0x17ef29[_0x8d63('0x2e')]:_0x1f9c07[_0x8d63('0x2d')];if(_0x210d53[_0x8d63('0x2b')][_0x8d63('0x38')]){_0x17ef29[_0x8d63('0x39')]=[{'all':!![]}];}_0x17ef29=_[_0x8d63('0x34')]({},_0x17ef29,_0x210d53[_0x8d63('0x36')]);return db['Attachment']['find'](_0x17ef29)[_0x8d63('0x21')](handleEntityNotFound(_0x382cfc,null))[_0x8d63('0x21')](function(_0x5421b0){if(_0x5421b0){var _0x17711a=_0x5421b0[_0x8d63('0x41')]({'plain':!![]});_0x17711a=qs['omit'](_0x17711a,['id','createdAt',_0x8d63('0x42')]);_0x210d53['body']=_[_0x8d63('0x43')](_0x210d53[_0x8d63('0x44')],['id',_0x8d63('0x45'),_0x8d63('0x42')]);return db['Attachment'][_0x8d63('0x46')](_[_0x8d63('0x34')](_0x17711a,_0x210d53['body']),{'include':_0x210d53[_0x8d63('0x2b')][_0x8d63('0x38')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x382cfc,0xc9))[_0x8d63('0x3b')](handleError(_0x382cfc,null));};exports[_0x8d63('0x47')]=function(_0x12ef60,_0x4cce52){if(_0x12ef60['body']['id']){delete _0x12ef60[_0x8d63('0x44')]['id'];}return db['Attachment'][_0x8d63('0x40')]({'where':{'id':_0x12ef60[_0x8d63('0x3d')]['id']}})[_0x8d63('0x21')](handleEntityNotFound(_0x4cce52,null))[_0x8d63('0x21')](saveUpdates(_0x12ef60[_0x8d63('0x44')],null))[_0x8d63('0x21')](respondWithResult(_0x4cce52,null))[_0x8d63('0x3b')](handleError(_0x4cce52,null));};exports[_0x8d63('0x22')]=function(_0x260422,_0x149f80){return db[_0x8d63('0x37')][_0x8d63('0x40')]({'where':{'id':_0x260422[_0x8d63('0x3d')]['id']}})[_0x8d63('0x21')](handleEntityNotFound(_0x149f80,null))[_0x8d63('0x21')](removeEntity(_0x149f80,null))[_0x8d63('0x3b')](handleError(_0x149f80,null));};exports[_0x8d63('0x46')]=function(_0x38e4b1,_0x1792ea,_0x5bd4b1){_0x38e4b1[_0x8d63('0x44')]['name']=_0x38e4b1[_0x8d63('0x48')][_0x8d63('0x49')];_0x38e4b1[_0x8d63('0x44')][_0x8d63('0x4a')]=_0x38e4b1[_0x8d63('0x48')][_0x8d63('0x4b')];_0x38e4b1[_0x8d63('0x44')][_0x8d63('0x2a')]=_0x38e4b1[_0x8d63('0x48')][_0x8d63('0x4c')];return db['Attachment'][_0x8d63('0x46')](_0x38e4b1[_0x8d63('0x44')])['then'](respondWithResult(_0x1792ea,0xc9))[_0x8d63('0x3b')](handleError(_0x1792ea,null));};exports[_0x8d63('0x4d')]=function(_0x2e9101,_0xc4be29,_0x15afaf){return db[_0x8d63('0x37')]['findOne']({'where':{'id':_0x2e9101[_0x8d63('0x3d')]['id']},'raw':!![]})[_0x8d63('0x21')](handleEntityNotFound(_0xc4be29,null))[_0x8d63('0x21')](function(_0xe518b6){if(_0xe518b6){var _0x47dfcb=_0xe518b6[_0x8d63('0x4e')]!==null;var _0x325ea3=path[_0x8d63('0x4f')](config['root'],_0x8d63('0x50'));if(_0x47dfcb){_0x325ea3=path[_0x8d63('0x4f')](_0x325ea3,_0x8d63('0x51'));}var _0x28dc4a=path[_0x8d63('0x4f')](_0x325ea3,_0xe518b6[_0x8d63('0x4a')]);return _0xc4be29[_0x8d63('0x4d')](_0x28dc4a);}})[_0x8d63('0x3b')](handleError(_0xc4be29,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index e11d1d4..67edb7f 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 _0x876d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Attachment','attachments','util'];(function(_0x549d71,_0x3c9e68){var _0x2b2251=function(_0x302bf4){while(--_0x302bf4){_0x549d71['push'](_0x549d71['shift']());}};_0x2b2251(++_0x3c9e68);}(_0x876d,0x11d));var _0xd876=function(_0xac7a3f,_0x42f746){_0xac7a3f=_0xac7a3f-0x0;var _0x2d62a1=_0x876d[_0xac7a3f];return _0x2d62a1;};'use strict';var _=require('lodash');var util=require(_0xd876('0x0'));var logger=require('../../config/logger')(_0xd876('0x1'));var moment=require(_0xd876('0x2'));var BPromise=require(_0xd876('0x3'));var rp=require(_0xd876('0x4'));var fs=require('fs');var path=require(_0xd876('0x5'));var rimraf=require(_0xd876('0x6'));var config=require(_0xd876('0x7'));var attributes=require('./attachment.attributes');module[_0xd876('0x8')]=function(_0x1255c9,_0x3dc247){return _0x1255c9['define'](_0xd876('0x9'),attributes,{'tableName':_0xd876('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf48a=['./attachment.attributes','define','Attachment','attachments','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf48a,0x1d2));var _0xaf48=function(_0x5b1f65,_0x1b5cb4){_0x5b1f65=_0x5b1f65-0x0;var _0x290cc6=_0xf48a[_0x5b1f65];return _0x290cc6;};'use strict';var _=require(_0xaf48('0x0'));var util=require('util');var logger=require(_0xaf48('0x1'))('api');var moment=require(_0xaf48('0x2'));var BPromise=require(_0xaf48('0x3'));var rp=require(_0xaf48('0x4'));var fs=require('fs');var path=require(_0xaf48('0x5'));var rimraf=require('rimraf');var config=require(_0xaf48('0x6'));var attributes=require(_0xaf48('0x7'));module['exports']=function(_0x4b41df,_0x5c4139){return _0x4b41df[_0xaf48('0x8')](_0xaf48('0x9'),attributes,{'tableName':_0xaf48('0xa'),'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 ee49075..2e7e465 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 _0x34b2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then','lodash','util','moment','bluebird'];(function(_0x5b3ed2,_0x26a389){var _0x2601cb=function(_0xd26ef3){while(--_0xd26ef3){_0x5b3ed2['push'](_0x5b3ed2['shift']());}};_0x2601cb(++_0x26a389);}(_0x34b2,0x11c));var _0x234b=function(_0x1057cb,_0x7b8162){_0x1057cb=_0x1057cb-0x0;var _0x7fbf7e=_0x34b2[_0x1057cb];return _0x7fbf7e;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var moment=require(_0x234b('0x2'));var BPromise=require(_0x234b('0x3'));var rs=require(_0x234b('0x4'));var fs=require('fs');var Redis=require(_0x234b('0x5'));var db=require(_0x234b('0x6'))['db'];var utils=require(_0x234b('0x7'));var logger=require(_0x234b('0x8'))(_0x234b('0x9'));var config=require(_0x234b('0xa'));var jayson=require(_0x234b('0xb'));var client=jayson[_0x234b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fac7,_0x5e71ac,_0x2eb07e){return new BPromise(function(_0x84f1f0,_0x153974){return client[_0x234b('0xd')](_0x52fac7,_0x2eb07e)['then'](function(_0x4f4899){logger[_0x234b('0xe')](_0x234b('0xf'),_0x5e71ac,_0x234b('0x10'));logger[_0x234b('0x11')](_0x234b('0x12'),_0x5e71ac,_0x234b('0x10'),JSON[_0x234b('0x13')](_0x4f4899));if(_0x4f4899[_0x234b('0x14')]){if(_0x4f4899[_0x234b('0x14')][_0x234b('0x15')]===0x1f4){logger[_0x234b('0x14')](_0x234b('0xf'),_0x5e71ac,_0x4f4899[_0x234b('0x14')]['message']);return _0x153974(_0x4f4899[_0x234b('0x14')][_0x234b('0x16')]);}logger['error'](_0x234b('0xf'),_0x5e71ac,_0x4f4899[_0x234b('0x14')]['message']);return _0x84f1f0(_0x4f4899[_0x234b('0x14')][_0x234b('0x16')]);}else{logger[_0x234b('0xe')](_0x234b('0xf'),_0x5e71ac,_0x234b('0x10'));_0x84f1f0(_0x4f4899[_0x234b('0x17')][_0x234b('0x16')]);}})[_0x234b('0x18')](function(_0x1fb3d8){logger['error'](_0x234b('0xf'),_0x5e71ac,_0x1fb3d8);_0x153974(_0x1fb3d8);});});}exports[_0x234b('0x19')]=function(_0x18153a){var _0x22696d=this;return new Promise(function(_0x4424a1,_0x530e4a){return db[_0x234b('0x1a')][_0x234b('0x1b')](_0x18153a[_0x234b('0x1c')],{'raw':_0x18153a[_0x234b('0x1d')]?_0x18153a['options'][_0x234b('0x1e')]===undefined?!![]:![]:!![]})[_0x234b('0x1f')](function(_0x2a47e1){logger[_0x234b('0xe')](_0x234b('0x19'),_0x18153a);logger['debug'](_0x234b('0x19'),_0x18153a,JSON[_0x234b('0x13')](_0x2a47e1));_0x4424a1(_0x2a47e1);})['catch'](function(_0x184e98){logger[_0x234b('0x14')](_0x234b('0x19'),_0x184e98[_0x234b('0x16')],_0x18153a);_0x530e4a(_0x22696d[_0x234b('0x14')](0x1f4,_0x184e98[_0x234b('0x16')]));});});};
\ No newline at end of file
+var _0x3eec=['../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x976c8a,_0x4a871d){_0x976c8a=_0x976c8a-0x0;var _0x31245f=_0x3eec[_0x976c8a];return _0x31245f;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('Attachment,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('Attachment,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});}exports[_0xc3ee('0x18')]=function(_0x219db0){var _0x304889=this;return new Promise(function(_0x3acb0c,_0xd4b414){return db[_0xc3ee('0x19')][_0xc3ee('0x1a')](_0x219db0[_0xc3ee('0x1b')],{'raw':_0x219db0[_0xc3ee('0x1c')]?_0x219db0[_0xc3ee('0x1c')][_0xc3ee('0x1d')]===undefined?!![]:![]:!![]})[_0xc3ee('0xd')](function(_0x3e7224){logger[_0xc3ee('0x15')](_0xc3ee('0x18'),_0x219db0);logger[_0xc3ee('0xf')](_0xc3ee('0x18'),_0x219db0,JSON[_0xc3ee('0x1e')](_0x3e7224));_0x3acb0c(_0x3e7224);})[_0xc3ee('0x17')](function(_0x493fea){logger['error'](_0xc3ee('0x18'),_0x493fea[_0xc3ee('0x13')],_0x219db0);_0xd4b414(_0x304889[_0xc3ee('0x11')](0x1f4,_0x493fea[_0xc3ee('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index c112044..02ff724 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x4d8d99,_0x19221a){var _0x4fef99=function(_0x3edef3){while(--_0x3edef3){_0x4d8d99['push'](_0x4d8d99['shift']());}};_0x4fef99(++_0x19221a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x24dbff,_0x2e1b9a){_0x24dbff=_0x24dbff-0x0;var _0x1ba25c=_0x5f2f[_0x24dbff];return _0x1ba25c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0xfd7c42,_0x185abf){var _0x3e8dc9=function(_0x11112a){while(--_0x11112a){_0xfd7c42['push'](_0xfd7c42['shift']());}};_0x3e8dc9(++_0x185abf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x898a1,_0x3b50f2){_0x898a1=_0x898a1-0x0;var _0x3564d2=_0x5f2f[_0x898a1];return _0x3564d2;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 6074bea..e07222d 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 _0x0460=['agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','add','minutes','clearBlockUser','getLicense','catch','lodash','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','google','/login','profile','email','use','clientSecret','secret','findOne','then','find','map','emails','value','admin','user'];(function(_0x297569,_0x22e70c){var _0x2fd1ee=function(_0x5ec20d){while(--_0x5ec20d){_0x297569['push'](_0x297569['shift']());}};_0x2fd1ee(++_0x22e70c);}(_0x0460,0xd0));var _0x0046=function(_0x5b4e1b,_0x4fcde1){_0x5b4e1b=_0x5b4e1b-0x0;var _0x119e2=_0x0460[_0x5b4e1b];return _0x119e2;};'use strict';var _=require(_0x0046('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x0046('0x1')];var moment=require(_0x0046('0x2'));var db=require(_0x0046('0x3'))['db'];var config=require(_0x0046('0x4'));var signToken=require('../../components/auth/service')[_0x0046('0x5')];var utils=require(_0x0046('0x6'));exports['login']=passport[_0x0046('0x7')](_0x0046('0x8'),{'failureRedirect':_0x0046('0x9'),'scope':[_0x0046('0xa'),_0x0046('0xb')],'session':![]});exports['callback']=passport['authenticate'](_0x0046('0x8'),{'failureRedirect':_0x0046('0x9'),'session':![]});passport[_0x0046('0xc')](new GoogleStrategy({'clientID':config[_0x0046('0x8')]?config['google']['clientID']:'id','clientSecret':config['google']?config[_0x0046('0x8')][_0x0046('0xd')]:_0x0046('0xe'),'callbackURL':config[_0x0046('0x8')]?config['google']['callbackURL']:''},function(_0x3ab42b,_0xa07686,_0x153d3e,_0x11b766){var _0x1e67f2,_0x45e97e;return db['Setting'][_0x0046('0xf')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x0046('0x10')](function(_0x4a3cdc){_0x1e67f2=_0x4a3cdc;return db['User'][_0x0046('0x11')]({'where':{'email':_[_0x0046('0x12')](_0x153d3e[_0x0046('0x13')],_0x0046('0x14')),'role':{'$or':[_0x0046('0x15'),_0x0046('0x16'),_0x0046('0x17')]}}});})[_0x0046('0x10')](function(_0xb55224){_0x45e97e=_0xb55224;if(_0x45e97e){if(_0x45e97e[_0x0046('0x18')]){return _0x11b766(_0x0046('0x19'));}else if(_0x1e67f2[_0x0046('0x1a')]>0x0){if(_0x45e97e[_0x0046('0x1b')]){if(moment(_0x45e97e['blockedAt'])[_0x0046('0x1c')](_0x1e67f2['blockDuration'],_0x0046('0x1d'))>moment()){return _0x11b766(_0x0046('0x19'));}else{return utils[_0x0046('0x1e')](_0x45e97e,0x0,![],null)['then'](function(){return utils['getLicense'](_0x45e97e);})[_0x0046('0x10')](function(){return _0x11b766(null,_0x45e97e);});}}else{return utils[_0x0046('0x1f')](_0x45e97e)['then'](function(){return _0x11b766(null,_0x45e97e);});}}else{return utils[_0x0046('0x1f')](_0x45e97e)[_0x0046('0x10')](function(){return _0x11b766(null,_0x45e97e);});}}return _0x11b766(_0x0046('0x19'));})[_0x0046('0x20')](function(_0x2df8e5){_0x11b766(_0x2df8e5);});}));
\ No newline at end of file
+var _0x3b27=['blocked','blockedAt','add','minutes','getLicense','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','authenticate','google','/login','profile','use','clientID','clientSecret','secret','findOne','blockDuration','User','find','emails','value','admin','user','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x3b27,0x11c));var _0x73b2=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x3b27[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x73b2('0x0'))['Strategy'];var moment=require(_0x73b2('0x1'));var db=require(_0x73b2('0x2'))['db'];var config=require(_0x73b2('0x3'));var signToken=require(_0x73b2('0x4'))[_0x73b2('0x5')];var utils=require('../../config/utils');exports['login']=passport[_0x73b2('0x6')](_0x73b2('0x7'),{'failureRedirect':_0x73b2('0x8'),'scope':[_0x73b2('0x9'),'email'],'session':![]});exports['callback']=passport[_0x73b2('0x6')](_0x73b2('0x7'),{'failureRedirect':_0x73b2('0x8'),'session':![]});passport[_0x73b2('0xa')](new GoogleStrategy({'clientID':config[_0x73b2('0x7')]?config[_0x73b2('0x7')][_0x73b2('0xb')]:'id','clientSecret':config[_0x73b2('0x7')]?config[_0x73b2('0x7')][_0x73b2('0xc')]:_0x73b2('0xd'),'callbackURL':config[_0x73b2('0x7')]?config['google']['callbackURL']:''},function(_0x2d85ea,_0x54d3cc,_0xfe585f,_0x20984f){var _0x431aeb,_0x1292e2;return db['Setting'][_0x73b2('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x73b2('0xf')],'raw':!![]})['then'](function(_0xafa2b5){_0x431aeb=_0xafa2b5;return db[_0x73b2('0x10')][_0x73b2('0x11')]({'where':{'email':_['map'](_0xfe585f[_0x73b2('0x12')],_0x73b2('0x13')),'role':{'$or':[_0x73b2('0x14'),_0x73b2('0x15'),_0x73b2('0x16')]}}});})[_0x73b2('0x17')](function(_0x287d02){_0x1292e2=_0x287d02;if(_0x1292e2){if(_0x1292e2[_0x73b2('0x18')]){return _0x20984f(_0x73b2('0x19'));}else if(_0x431aeb[_0x73b2('0xf')]>0x0){if(_0x1292e2[_0x73b2('0x1a')]){if(moment(_0x1292e2[_0x73b2('0x1b')])[_0x73b2('0x1c')](_0x431aeb[_0x73b2('0xf')],_0x73b2('0x1d'))>moment()){return _0x20984f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x1292e2,0x0,![],null)[_0x73b2('0x17')](function(){return utils[_0x73b2('0x1e')](_0x1292e2);})[_0x73b2('0x17')](function(){return _0x20984f(null,_0x1292e2);});}}else{return utils[_0x73b2('0x1e')](_0x1292e2)[_0x73b2('0x17')](function(){return _0x20984f(null,_0x1292e2);});}}else{return utils[_0x73b2('0x1e')](_0x1292e2)[_0x73b2('0x17')](function(){return _0x20984f(null,_0x1292e2);});}}return _0x20984f(_0x73b2('0x19'));})['catch'](function(_0x23e25b){_0x20984f(_0x23e25b);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index faa7ab7..68dc311 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 _0x8511=['login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x5beda8,_0x1e8554){var _0x2aa042=function(_0x510f45){while(--_0x510f45){_0x5beda8['push'](_0x5beda8['shift']());}};_0x2aa042(++_0x1e8554);}(_0x8511,0xf0));var _0x1851=function(_0x183915,_0x1f0e0e){_0x183915=_0x183915-0x0;var _0x1e0e33=_0x8511[_0x183915];return _0x1e0e33;};'use strict';var express=require(_0x1851('0x0'));var passport=require(_0x1851('0x1'));var router=express[_0x1851('0x2')]();var controller=require(_0x1851('0x3'));var userController=require(_0x1851('0x4'));var authService=require(_0x1851('0x5'));router[_0x1851('0x6')]('/',controller[_0x1851('0x7')]);router[_0x1851('0x6')](_0x1851('0x8'),controller[_0x1851('0x9')],authService[_0x1851('0xa')],userController[_0x1851('0x7')],authService[_0x1851('0xb')]);module[_0x1851('0xc')]=router;
\ No newline at end of file
+var _0x94a5=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','login','/callback'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x94a5,0x1b1));var _0x594a=function(_0x840e3e,_0x5a6fef){_0x840e3e=_0x840e3e-0x0;var _0x2b1a9e=_0x94a5[_0x840e3e];return _0x2b1a9e;};'use strict';var express=require(_0x594a('0x0'));var passport=require(_0x594a('0x1'));var router=express[_0x594a('0x2')]();var controller=require(_0x594a('0x3'));var userController=require(_0x594a('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x594a('0x5')]);router['get'](_0x594a('0x6'),controller[_0x594a('0x7')],authService[_0x594a('0x8')],userController[_0x594a('0x5')],authService[_0x594a('0x9')]);module[_0x594a('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 4e6a10a..a8403d9 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 _0x1395=['Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local'];(function(_0x5e1f4b,_0x50b208){var _0x5ce7b4=function(_0x53d04f){while(--_0x53d04f){_0x5e1f4b['push'](_0x5e1f4b['shift']());}};_0x5ce7b4(++_0x50b208);}(_0x1395,0x105));var _0x5139=function(_0x2b7125,_0x58cd69){_0x2b7125=_0x2b7125-0x0;var _0x2fc154=_0x1395[_0x2b7125];return _0x2fc154;};'use strict';var util=require(_0x5139('0x0'));var passport=require(_0x5139('0x1'));var LocalStrategy=require(_0x5139('0x2'))[_0x5139('0x3')];var jayson=require(_0x5139('0x4'));var _=require(_0x5139('0x5'));var rs=require(_0x5139('0x6'));var moment=require(_0x5139('0x7'));var db=require('../../mysqldb')['db'];var authService=require(_0x5139('0x8'));var utils=require('../../config/utils');var client=jayson['client'][_0x5139('0x9')]({'port':0x232b});function localAuthenticate(_0x52051f,_0x463e4f,_0x182f62,_0x3608fb){var _0x5ed9f2,_0x350af6;return db[_0x5139('0xa')][_0x5139('0xb')]({'where':{'id':0x1},'attributes':[_0x5139('0xc'),_0x5139('0xd')],'raw':!![]})['then'](function(_0x1a1fcb){_0x5ed9f2=_0x1a1fcb;return _0x52051f['findOne']({'attributes':['id',_0x5139('0xe'),_0x5139('0xf'),_0x5139('0x10'),_0x5139('0x11'),_0x5139('0x12'),_0x5139('0x13'),'blockedAt',_0x5139('0x14')],'where':{'name':_0x463e4f,'role':{'$or':[_0x5139('0x15'),_0x5139('0x16'),_0x5139('0x17')]}}});})[_0x5139('0x18')](function(_0x51a341){if(!_0x51a341||_0x51a341&&_0x51a341[_0x5139('0xe')]!==_0x463e4f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x350af6=_0x51a341;return _0x350af6;}})[_0x5139('0x18')](function(){_0x350af6[_0x5139('0x19')](_0x182f62,function(_0x2a4a38,_0x22d5bc){var _0x431aed=_0x350af6['loginAttempts']+0x1;if(_0x2a4a38){return _0x3608fb(_0x2a4a38);}else if(!_0x22d5bc){if(_0x350af6[_0x5139('0x12')]){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}else if(_0x5ed9f2[_0x5139('0xc')]>0x0){if(_0x350af6['blocked']){if(_0x5ed9f2['blockDuration']>0x0){if(moment(_0x350af6['blockedAt'])[_0x5139('0x1b')](_0x5ed9f2['blockDuration'],_0x5139('0x1c'))>moment()){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}else{return utils['clearBlockUser'](_0x350af6,_0x431aed,![],null)[_0x5139('0x18')](function(){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});});}}else{return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}}else{if(_0x431aed>=_0x5ed9f2[_0x5139('0xc')]){return utils[_0x5139('0x1d')](_0x350af6,0x0,!![],moment())[_0x5139('0x18')](function(){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});});}else{return utils[_0x5139('0x1d')](_0x350af6,_0x431aed,![],null)['then'](function(){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});});}}}else{return _0x3608fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x350af6[_0x5139('0x12')]){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}else if(_0x5ed9f2['allowedLoginAttempts']>0x0){if(_0x350af6[_0x5139('0x13')]){if(_0x5ed9f2[_0x5139('0xd')]>0x0){if(moment(_0x350af6[_0x5139('0x1e')])[_0x5139('0x1b')](_0x5ed9f2[_0x5139('0xd')],_0x5139('0x1c'))>moment()){return _0x3608fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x350af6,0x0,![],null)[_0x5139('0x18')](function(){return utils['getLicense'](_0x350af6);})['then'](function(){return _0x3608fb(null,_0x350af6);});}}else{return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}}else{return utils['clearBlockUser'](_0x350af6,0x0,![],null)[_0x5139('0x18')](function(){return utils[_0x5139('0x1f')](_0x350af6);})[_0x5139('0x18')](function(){return _0x3608fb(null,_0x350af6);})[_0x5139('0x20')](function(_0x52e772){return _0x3608fb(null,![],_0x52e772);});}}else{if(_0x350af6[_0x5139('0x13')]){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}else{return utils[_0x5139('0x1f')](_0x350af6)[_0x5139('0x18')](function(){return _0x3608fb(null,_0x350af6);});}}}});})[_0x5139('0x20')](function(_0x397002){return _0x3608fb(null,![],_0x397002);});}function sendServiceMail(_0x2e12db){return db[_0x5139('0x21')][_0x5139('0x22')]({'where':{'service':!![]},'attributes':['id',_0x5139('0xe'),_0x5139('0x23')],'include':[{'model':db[_0x5139('0x24')],'as':_0x5139('0x25')}]})[_0x5139('0x18')](function(_0x3b1bde){if(!_0x3b1bde){throw new Error(_0x5139('0x26'));}var _0x834ae5={'tls':{'rejectUnauthorized':![]}};if(_0x3b1bde[_0x5139('0x25')][_0x5139('0x27')]){_0x834ae5[_0x5139('0x27')]=_0x3b1bde[_0x5139('0x25')][_0x5139('0x27')];}else{_0x834ae5[_0x5139('0x28')]=_0x3b1bde[_0x5139('0x25')][_0x5139('0x28')];_0x834ae5[_0x5139('0x29')]=_0x3b1bde[_0x5139('0x25')]['port'];_0x834ae5[_0x5139('0x2a')]=_0x3b1bde[_0x5139('0x25')][_0x5139('0x2a')];}if(_0x3b1bde[_0x5139('0x25')]['authentication']){_0x834ae5['auth']={'user':_0x3b1bde[_0x5139('0x25')][_0x5139('0x16')],'pass':_0x3b1bde[_0x5139('0x25')][_0x5139('0x2b')]};}var _0x338a68={'account':_0x834ae5,'message':_[_0x5139('0x2c')]({'from':util[_0x5139('0x2d')](_0x5139('0x2e'),_0x3b1bde[_0x5139('0xe')],_0x3b1bde[_0x5139('0x23')]||_0x3b1bde[_0x5139('0x25')][_0x5139('0x16')])},_0x2e12db)};return client[_0x5139('0x2f')](_0x5139('0x30'),_0x338a68);})[_0x5139('0x18')](function(_0x585535){if(_0x585535[_0x5139('0x31')]){throw new Error(util[_0x5139('0x2d')](_0x5139('0x32'),_0x585535[_0x5139('0x31')][_0x5139('0x33')]||JSON[_0x5139('0x34')](_0x585535[_0x5139('0x31')])));}return!![];});}function handleError(_0x55535a,_0x296c2f,_0x421958){return _0x55535a[_0x5139('0x35')](_0x296c2f||0x1f4)[_0x5139('0x36')]({'message':_0x421958?_0x421958[_0x5139('0x33')]||_0x421958:''});}exports[_0x5139('0x37')]=function(_0x5ee2cb,_0x2dbaec,_0x333735){passport[_0x5139('0x19')](_0x5139('0x38'),function(_0x1896ae,_0x15746a,_0x18aa29){var _0x3a0598=_0x1896ae||_0x18aa29;if(_0x3a0598){return handleError(_0x2dbaec,0x191,_0x3a0598);}if(!_0x15746a){return handleError(_0x2dbaec,0x194,{'message':_0x5139('0x39')});}else{var _0x53380d={'payload':{'id':_0x15746a['id'],'role':_0x15746a['role']},'options':{'expiresIn':0x15180}};return authService[_0x5139('0x3a')](_0x53380d)[_0x5139('0x18')](function(_0xeda7c1){_0x2dbaec[_0x5139('0x3b')]({'id':_0x15746a['id'],'token':_0xeda7c1,'statusCall':'','isAlreadyLogged':_0x15746a[_0x5139('0x3c')]});});}})(_0x5ee2cb,_0x2dbaec,_0x333735);};exports[_0x5139('0x3d')]=function(_0x326f2a,_0x4144e2,_0x382641){if(!_0x326f2a[_0x5139('0x3e')]['email']){return handleError(_0x4144e2,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x22feb3=rs['generate']();_0x326f2a[_0x5139('0x3e')]['email']=_0x326f2a['body'][_0x5139('0x23')]['trim']()[_0x5139('0x3f')]();var _0x1b893c;return db['Setting'][_0x5139('0xb')]({'where':{'id':0x1},'attributes':[_0x5139('0xc'),_0x5139('0xd')],'raw':!![]})['then'](function(_0xac21d1){_0x1b893c=_0xac21d1;return db[_0x5139('0x40')][_0x5139('0x22')]({'where':{'email':_0x326f2a[_0x5139('0x3e')][_0x5139('0x23')]}});})[_0x5139('0x18')](function(_0x2525a6){if(!_0x2525a6){throw new Error(_0x5139('0x41'));}if(_0x2525a6[_0x5139('0x12')]){throw new Error(_0x5139('0x42'));}if(_0x2525a6[_0x5139('0x13')]){if(moment(_0x2525a6[_0x5139('0x1e')])['add'](_0x1b893c['blockDuration'],_0x5139('0x1c'))>moment()){throw new Error(_0x5139('0x43'));}else{_0x2525a6['blocked']=![];_0x2525a6[_0x5139('0x1e')]=null;}}_0x2525a6['resetPasswordToken']=_0x22feb3;_0x2525a6[_0x5139('0x44')]=Date[_0x5139('0x45')]()+0x36ee80;return _0x2525a6[_0x5139('0x46')]();})[_0x5139('0x18')](function(){return sendServiceMail({'to':_0x326f2a[_0x5139('0x3e')][_0x5139('0x23')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x5139('0x47')+_0x5139('0x48')+_0x5139('0x49')+_0x326f2a[_0x5139('0x4a')][_0x5139('0x28')]+_0x5139('0x4b')+_0x22feb3+'\x0a\x0a'+_0x5139('0x4c')});})[_0x5139('0x18')](function(){_0x4144e2['status'](0xc8)[_0x5139('0x36')]({'message':'Reset\x20Email\x20sent!'});})[_0x5139('0x20')](function(_0x2d3a06){return handleError(_0x4144e2,0x1f4,_0x2d3a06);});};exports[_0x5139('0x4d')]=function(_0x6f311c,_0x545c8f,_0x5f3a0e){return db[_0x5139('0x40')][_0x5139('0x22')]({'where':{'resetPasswordToken':_0x6f311c['params'][_0x5139('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x5139('0x45')]()}}})[_0x5139('0x18')](function(_0x45e3a4){if(!_0x45e3a4){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x5139('0xb')]({'attributes':['id',_0x5139('0x4f'),_0x5139('0x50'),_0x5139('0x51')]})[_0x5139('0x18')](function(_0xfd48e7){if(_0xfd48e7[_0x5139('0x4f')])authService[_0x5139('0x52')](_0x6f311c['body'][_0x5139('0xf')]);if(!_0xfd48e7[_0x5139('0x50')]||!_0x45e3a4['previousPasswords'])return _0x45e3a4;authService[_0x5139('0x53')](_0x6f311c['body']['password'],_0x45e3a4[_0x5139('0x54')],_0xfd48e7['passwordHistoryLimit']);return _0x45e3a4;})[_0x5139('0x18')](function(){_0x45e3a4[_0x5139('0xf')]=_0x6f311c[_0x5139('0x3e')][_0x5139('0xf')];_0x45e3a4[_0x5139('0x55')]=null;_0x45e3a4[_0x5139('0x44')]=null;return _0x45e3a4[_0x5139('0x46')]();});})['then'](function(){_0x545c8f[_0x5139('0x35')](0xc8)['send']({'message':_0x5139('0x56')});})[_0x5139('0x20')](function(_0x3b3483){return handleError(_0x545c8f,0x1f4,_0x3b3483);});};passport[_0x5139('0x57')](new LocalStrategy({'usernameField':_0x5139('0xe'),'passwordField':_0x5139('0xf')},function(_0x1bec7c,_0x19ad3c,_0x338ff9){return localAuthenticate(db[_0x5139('0x40')],_0x1bec7c,_0x19ad3c,_0x338ff9);}));
\ No newline at end of file
+var _0x66cf=['add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','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://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','util','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts'];(function(_0x2e75ad,_0x35a76d){var _0x31fc3b=function(_0x1c8c6c){while(--_0x1c8c6c){_0x2e75ad['push'](_0x2e75ad['shift']());}};_0x31fc3b(++_0x35a76d);}(_0x66cf,0x1a2));var _0xf66c=function(_0x11ed3b,_0x3b2749){_0x11ed3b=_0x11ed3b-0x0;var _0x5066ea=_0x66cf[_0x11ed3b];return _0x5066ea;};'use strict';var util=require(_0xf66c('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf66c('0x1'))[_0xf66c('0x2')];var jayson=require('jayson/promise');var _=require(_0xf66c('0x3'));var rs=require(_0xf66c('0x4'));var moment=require(_0xf66c('0x5'));var db=require(_0xf66c('0x6'))['db'];var authService=require(_0xf66c('0x7'));var utils=require(_0xf66c('0x8'));var client=jayson[_0xf66c('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x56dc7b,_0x470edc,_0x263b9e,_0x12e15e){var _0x4fe300,_0x4d3f77;return db[_0xf66c('0xa')][_0xf66c('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf66c('0xc')],'raw':!![]})[_0xf66c('0xd')](function(_0x22a2a7){_0x4fe300=_0x22a2a7;return _0x56dc7b['findOne']({'attributes':['id','name',_0xf66c('0xe'),_0xf66c('0xf'),'role',_0xf66c('0x10'),_0xf66c('0x11'),_0xf66c('0x12'),_0xf66c('0x13')],'where':{'name':_0x470edc,'role':{'$or':[_0xf66c('0x14'),_0xf66c('0x15'),_0xf66c('0x16')]}}});})[_0xf66c('0xd')](function(_0x10306d){if(!_0x10306d||_0x10306d&&_0x10306d[_0xf66c('0x17')]!==_0x470edc){throw new Error(_0xf66c('0x18'));}else{_0x4d3f77=_0x10306d;return _0x4d3f77;}})['then'](function(){_0x4d3f77[_0xf66c('0x19')](_0x263b9e,function(_0x3c3d90,_0x480ca2){var _0xec645e=_0x4d3f77[_0xf66c('0x13')]+0x1;if(_0x3c3d90){return _0x12e15e(_0x3c3d90);}else if(!_0x480ca2){if(_0x4d3f77[_0xf66c('0x10')]){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else if(_0x4fe300[_0xf66c('0x1a')]>0x0){if(_0x4d3f77[_0xf66c('0x11')]){if(_0x4fe300['blockDuration']>0x0){if(moment(_0x4d3f77[_0xf66c('0x12')])[_0xf66c('0x1b')](_0x4fe300[_0xf66c('0xc')],_0xf66c('0x1c'))>moment()){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else{return utils[_0xf66c('0x1d')](_0x4d3f77,_0xec645e,![],null)[_0xf66c('0xd')](function(){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});});}}else{return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}}else{if(_0xec645e>=_0x4fe300[_0xf66c('0x1a')]){return utils[_0xf66c('0x1d')](_0x4d3f77,0x0,!![],moment())[_0xf66c('0xd')](function(){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});});}else{return utils[_0xf66c('0x1d')](_0x4d3f77,_0xec645e,![],null)[_0xf66c('0xd')](function(){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});});}}}else{return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}}else{if(_0x4d3f77[_0xf66c('0x10')]){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else if(_0x4fe300[_0xf66c('0x1a')]>0x0){if(_0x4d3f77[_0xf66c('0x11')]){if(_0x4fe300[_0xf66c('0xc')]>0x0){if(moment(_0x4d3f77[_0xf66c('0x12')])['add'](_0x4fe300[_0xf66c('0xc')],_0xf66c('0x1c'))>moment()){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else{return utils[_0xf66c('0x1d')](_0x4d3f77,0x0,![],null)[_0xf66c('0xd')](function(){return utils[_0xf66c('0x1e')](_0x4d3f77);})[_0xf66c('0xd')](function(){return _0x12e15e(null,_0x4d3f77);});}}else{return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}}else{return utils[_0xf66c('0x1d')](_0x4d3f77,0x0,![],null)[_0xf66c('0xd')](function(){return utils[_0xf66c('0x1e')](_0x4d3f77);})[_0xf66c('0xd')](function(){return _0x12e15e(null,_0x4d3f77);})['catch'](function(_0x32bf03){return _0x12e15e(null,![],_0x32bf03);});}}else{if(_0x4d3f77[_0xf66c('0x11')]){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else{return utils[_0xf66c('0x1e')](_0x4d3f77)['then'](function(){return _0x12e15e(null,_0x4d3f77);});}}}});})[_0xf66c('0x1f')](function(_0x384602){return _0x12e15e(null,![],_0x384602);});}function sendServiceMail(_0x28ae2e){return db[_0xf66c('0x20')][_0xf66c('0x21')]({'where':{'service':!![]},'attributes':['id',_0xf66c('0x17'),_0xf66c('0x22')],'include':[{'model':db['MailServerOut'],'as':_0xf66c('0x23')}]})[_0xf66c('0xd')](function(_0x27be9e){if(!_0x27be9e){throw new Error(_0xf66c('0x24'));}var _0x22f9fd={'tls':{'rejectUnauthorized':![]}};if(_0x27be9e[_0xf66c('0x23')][_0xf66c('0x25')]){_0x22f9fd[_0xf66c('0x25')]=_0x27be9e[_0xf66c('0x23')]['service'];}else{_0x22f9fd[_0xf66c('0x26')]=_0x27be9e[_0xf66c('0x23')][_0xf66c('0x26')];_0x22f9fd[_0xf66c('0x27')]=_0x27be9e[_0xf66c('0x23')]['port'];_0x22f9fd[_0xf66c('0x28')]=_0x27be9e[_0xf66c('0x23')][_0xf66c('0x28')];}if(_0x27be9e[_0xf66c('0x23')][_0xf66c('0x29')]){_0x22f9fd['auth']={'user':_0x27be9e[_0xf66c('0x23')][_0xf66c('0x15')],'pass':_0x27be9e[_0xf66c('0x23')][_0xf66c('0x2a')]};}var _0x1a4cc4={'account':_0x22f9fd,'message':_['merge']({'from':util[_0xf66c('0x2b')](_0xf66c('0x2c'),_0x27be9e[_0xf66c('0x17')],_0x27be9e[_0xf66c('0x22')]||_0x27be9e[_0xf66c('0x23')][_0xf66c('0x15')])},_0x28ae2e)};return client['request'](_0xf66c('0x2d'),_0x1a4cc4);})[_0xf66c('0xd')](function(_0x50afb3){if(_0x50afb3[_0xf66c('0x2e')]){throw new Error(util['format'](_0xf66c('0x2f'),_0x50afb3[_0xf66c('0x2e')][_0xf66c('0x30')]||JSON[_0xf66c('0x31')](_0x50afb3[_0xf66c('0x2e')])));}return!![];});}function handleError(_0x519650,_0x3637fa,_0x1b2249){return _0x519650[_0xf66c('0x32')](_0x3637fa||0x1f4)[_0xf66c('0x33')]({'message':_0x1b2249?_0x1b2249[_0xf66c('0x30')]||_0x1b2249:''});}exports[_0xf66c('0x34')]=function(_0x54064f,_0x1c0097,_0x20c7fd){passport[_0xf66c('0x19')](_0xf66c('0x35'),function(_0x47b467,_0xf1ee02,_0x41300e){var _0x41a078=_0x47b467||_0x41300e;if(_0x41a078){return handleError(_0x1c0097,0x191,_0x41a078);}if(!_0xf1ee02){return handleError(_0x1c0097,0x194,{'message':_0xf66c('0x36')});}else{var _0x232afe={'payload':{'id':_0xf1ee02['id'],'role':_0xf1ee02[_0xf66c('0x37')]},'options':{'expiresIn':0x15180}};return authService[_0xf66c('0x38')](_0x232afe)['then'](function(_0x4d36e1){_0x1c0097['json']({'id':_0xf1ee02['id'],'token':_0x4d36e1,'statusCall':'','isAlreadyLogged':_0xf1ee02[_0xf66c('0x39')]});});}})(_0x54064f,_0x1c0097,_0x20c7fd);};exports[_0xf66c('0x3a')]=function(_0xb61ad0,_0x55bb10,_0x41a664){if(!_0xb61ad0[_0xf66c('0x3b')][_0xf66c('0x22')]){return handleError(_0x55bb10,0x1f4,{'message':_0xf66c('0x3c')});}var _0x1006d3=rs[_0xf66c('0x3d')]();_0xb61ad0[_0xf66c('0x3b')]['email']=_0xb61ad0['body'][_0xf66c('0x22')][_0xf66c('0x3e')]()[_0xf66c('0x3f')]();var _0x1d54f5;return db[_0xf66c('0xa')][_0xf66c('0xb')]({'where':{'id':0x1},'attributes':[_0xf66c('0x1a'),_0xf66c('0xc')],'raw':!![]})['then'](function(_0x5f1786){_0x1d54f5=_0x5f1786;return db[_0xf66c('0x40')][_0xf66c('0x21')]({'where':{'email':_0xb61ad0[_0xf66c('0x3b')][_0xf66c('0x22')]}});})['then'](function(_0x151e39){if(!_0x151e39){throw new Error(_0xf66c('0x41'));}if(_0x151e39[_0xf66c('0x10')]){throw new Error(_0xf66c('0x42'));}if(_0x151e39['blocked']){if(moment(_0x151e39[_0xf66c('0x12')])[_0xf66c('0x1b')](_0x1d54f5[_0xf66c('0xc')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x151e39[_0xf66c('0x11')]=![];_0x151e39['blockedAt']=null;}}_0x151e39[_0xf66c('0x43')]=_0x1006d3;_0x151e39['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x151e39[_0xf66c('0x44')]();})[_0xf66c('0xd')](function(){return sendServiceMail({'to':_0xb61ad0[_0xf66c('0x3b')][_0xf66c('0x22')],'subject':_0xf66c('0x45'),'text':_0xf66c('0x46')+_0xf66c('0x47')+_0xf66c('0x48')+_0xb61ad0[_0xf66c('0x49')]['host']+'/reset/'+_0x1006d3+'\x0a\x0a'+_0xf66c('0x4a')});})[_0xf66c('0xd')](function(){_0x55bb10['status'](0xc8)[_0xf66c('0x33')]({'message':_0xf66c('0x4b')});})[_0xf66c('0x1f')](function(_0x330263){return handleError(_0x55bb10,0x1f4,_0x330263);});};exports[_0xf66c('0x4c')]=function(_0x3a181c,_0x52771e,_0x12363c){return db['User'][_0xf66c('0x21')]({'where':{'resetPasswordToken':_0x3a181c[_0xf66c('0x4d')][_0xf66c('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xf66c('0x4f')]()}}})[_0xf66c('0xd')](function(_0x865bbf){if(!_0x865bbf){throw new Error(_0xf66c('0x50'));}return db[_0xf66c('0xa')][_0xf66c('0xb')]({'attributes':['id','securePassword',_0xf66c('0x51'),'passwordHistoryLimit']})[_0xf66c('0xd')](function(_0x154d48){if(_0x154d48[_0xf66c('0x52')])authService[_0xf66c('0x53')](_0x3a181c[_0xf66c('0x3b')]['password']);if(!_0x154d48[_0xf66c('0x51')]||!_0x865bbf[_0xf66c('0x54')])return _0x865bbf;authService[_0xf66c('0x55')](_0x3a181c[_0xf66c('0x3b')][_0xf66c('0xe')],_0x865bbf[_0xf66c('0x54')],_0x154d48[_0xf66c('0x56')]);return _0x865bbf;})[_0xf66c('0xd')](function(){_0x865bbf[_0xf66c('0xe')]=_0x3a181c[_0xf66c('0x3b')][_0xf66c('0xe')];_0x865bbf['resetPasswordToken']=null;_0x865bbf[_0xf66c('0x57')]=null;return _0x865bbf[_0xf66c('0x44')]();});})['then'](function(){_0x52771e[_0xf66c('0x32')](0xc8)[_0xf66c('0x33')]({'message':_0xf66c('0x58')});})[_0xf66c('0x1f')](function(_0x3b79f6){return handleError(_0x52771e,0x1f4,_0x3b79f6);});};passport['use'](new LocalStrategy({'usernameField':_0xf66c('0x17'),'passwordField':'password'},function(_0x50d0c2,_0x109853,_0x475dd6){return localAuthenticate(db[_0xf66c('0x40')],_0x50d0c2,_0x109853,_0x475dd6);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 4b3c42d..a201cb5 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 _0x6ddc=['post','login','/forgot','forgot','reset','exports','Router','./authLocal.controller'];(function(_0x23d527,_0x1c4a71){var _0x9e46c1=function(_0x524937){while(--_0x524937){_0x23d527['push'](_0x23d527['shift']());}};_0x9e46c1(++_0x1c4a71);}(_0x6ddc,0x166));var _0xc6dd=function(_0x5865d0,_0x1c948d){_0x5865d0=_0x5865d0-0x0;var _0x5110ae=_0x6ddc[_0x5865d0];return _0x5110ae;};'use strict';var express=require('express');var router=express[_0xc6dd('0x0')]();var controller=require(_0xc6dd('0x1'));router[_0xc6dd('0x2')]('/',controller[_0xc6dd('0x3')]);router[_0xc6dd('0x2')](_0xc6dd('0x4'),controller[_0xc6dd('0x5')]);router[_0xc6dd('0x2')]('/reset/:token',controller[_0xc6dd('0x6')]);module[_0xc6dd('0x7')]=router;
\ No newline at end of file
+var _0xf41a=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x41a013,_0x2bcf00){var _0x320ae3=function(_0x7c7753){while(--_0x7c7753){_0x41a013['push'](_0x41a013['shift']());}};_0x320ae3(++_0x2bcf00);}(_0xf41a,0x11b));var _0xaf41=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0xf41a[_0x2af29a];return _0x5ef02f;};'use strict';var express=require(_0xaf41('0x0'));var router=express[_0xaf41('0x1')]();var controller=require(_0xaf41('0x2'));router[_0xaf41('0x3')]('/',controller[_0xaf41('0x4')]);router[_0xaf41('0x3')](_0xaf41('0x5'),controller[_0xaf41('0x6')]);router['post'](_0xaf41('0x7'),controller[_0xaf41('0x8')]);module[_0xaf41('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 9dd42ca..5e2fe69 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 _0x2768=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x2768,0x16f));var _0x8276=function(_0xff43bd,_0x10a518){_0xff43bd=_0xff43bd-0x0;var _0x264b25=_0x2768[_0xff43bd];return _0x264b25;};'use strict';var Sequelize=require(_0x8276('0x0'));module[_0x8276('0x1')]={'name':{'type':Sequelize[_0x8276('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x8276('0x2')]},'description':{'type':Sequelize[_0x8276('0x2')]},'status':{'type':Sequelize[_0x8276('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8276('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xf12e=['exports','STRING','BOOLEAN','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf12e,0x12b));var _0xef12=function(_0x4b3ec4,_0x3c573c){_0x4b3ec4=_0x4b3ec4-0x0;var _0x192836=_0xf12e[_0x4b3ec4];return _0x192836;};'use strict';var Sequelize=require(_0xef12('0x0'));module[_0xef12('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xef12('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xef12('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 43defaa..35c723f 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 _0xb3ef=['bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','end','error','name','send','map','Automation','type','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','rawAttributes','length','options','find','create','update','body','params','destroy','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x57036b,_0x1a64f2){var _0x4b2423=function(_0x1f21ff){while(--_0x1f21ff){_0x57036b['push'](_0x57036b['shift']());}};_0x4b2423(++_0x1a64f2);}(_0xb3ef,0x143));var _0xfb3e=function(_0x3a7007,_0x23ab68){_0x3a7007=_0x3a7007-0x0;var _0x520076=_0xb3ef[_0x3a7007];return _0x520076;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb3e('0x0'));var zipdir=require(_0xfb3e('0x1'));var jsonpatch=require(_0xfb3e('0x2'));var rp=require(_0xfb3e('0x3'));var moment=require(_0xfb3e('0x4'));var BPromise=require(_0xfb3e('0x5'));var Mustache=require(_0xfb3e('0x6'));var util=require('util');var path=require(_0xfb3e('0x7'));var sox=require('sox');var csv=require(_0xfb3e('0x8'));var ejs=require(_0xfb3e('0x9'));var fs=require('fs');var fs_extra=require(_0xfb3e('0xa'));var _=require('lodash');var squel=require(_0xfb3e('0xb'));var crypto=require(_0xfb3e('0xc'));var jsforce=require(_0xfb3e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfb3e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb3e('0xe'));var authService=require(_0xfb3e('0xf'));var qs=require(_0xfb3e('0x10'));var as=require(_0xfb3e('0x11'));var hardwareService=require(_0xfb3e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xfb3e('0x13'));var config=require(_0xfb3e('0x14'));var licenseUtil=require(_0xfb3e('0x15'));var db=require(_0xfb3e('0x16'))['db'];function respondWithStatusCode(_0x61eec9,_0x460961){_0x460961=_0x460961||0xcc;return function(_0x51cdb7){if(_0x51cdb7){return _0x61eec9[_0xfb3e('0x17')](_0x460961);}return _0x61eec9['status'](_0x460961)['end']();};}function respondWithResult(_0x1b2a02,_0x325468){_0x325468=_0x325468||0xc8;return function(_0x19bf23){if(_0x19bf23){return _0x1b2a02[_0xfb3e('0x18')](_0x325468)[_0xfb3e('0x19')](_0x19bf23);}};}function respondWithFilteredResult(_0x224c9f,_0x1c364b){return function(_0x12e98d){if(_0x12e98d){var _0x380991=typeof _0x1c364b[_0xfb3e('0x1a')]===_0xfb3e('0x1b')&&typeof _0x1c364b[_0xfb3e('0x1c')]===_0xfb3e('0x1b');var _0x5585ce=_0x12e98d['count'];var _0x34eb17=_0x380991?0x0:_0x1c364b['offset'];var _0x125b56=_0x380991?_0x12e98d['count']:_0x1c364b[_0xfb3e('0x1a')]+_0x1c364b['limit'];var _0x230a33;if(_0x125b56>=_0x5585ce){_0x125b56=_0x5585ce;_0x230a33=0xc8;}else{_0x230a33=0xce;}_0x224c9f[_0xfb3e('0x18')](_0x230a33);return _0x224c9f[_0xfb3e('0x1d')](_0xfb3e('0x1e'),_0x34eb17+'-'+_0x125b56+'/'+_0x5585ce)[_0xfb3e('0x19')](_0x12e98d);}return null;};}function patchUpdates(_0xcd5dc0){return function(_0x221e78){try{jsonpatch[_0xfb3e('0x1f')](_0x221e78,_0xcd5dc0,!![]);}catch(_0x23e64a){return BPromise[_0xfb3e('0x20')](_0x23e64a);}return _0x221e78[_0xfb3e('0x21')]();};}function saveUpdates(_0x4e5a4b,_0x3e43f4){return function(_0x354c4b){if(_0x354c4b){return _0x354c4b['update'](_0x4e5a4b)[_0xfb3e('0x22')](function(_0x14b692){return _0x14b692;});}return null;};}function removeEntity(_0x34464e,_0x4152cc){return function(_0x1abc4d){if(_0x1abc4d){return _0x1abc4d['destroy']()[_0xfb3e('0x22')](function(){_0x34464e[_0xfb3e('0x18')](0xcc)[_0xfb3e('0x23')]();});}};}function handleEntityNotFound(_0x35534f,_0x20e85b){return function(_0x544c3f){if(!_0x544c3f){_0x35534f['sendStatus'](0x194);}return _0x544c3f;};}function handleError(_0x1042cc,_0x1266ca){_0x1266ca=_0x1266ca||0x1f4;return function(_0x9c7b69){logger[_0xfb3e('0x24')](_0x9c7b69['stack']);if(_0x9c7b69[_0xfb3e('0x25')]){delete _0x9c7b69[_0xfb3e('0x25')];}_0x1042cc['status'](_0x1266ca)[_0xfb3e('0x26')](_0x9c7b69);};}exports['index']=function(_0x18c45c,_0x3587fd){var _0x4dc39d={},_0x178b76={},_0x3cb0af={'count':0x0,'rows':[]};var _0x5c5103=_[_0xfb3e('0x27')](db[_0xfb3e('0x28')]['rawAttributes'],function(_0x5214b5){return{'name':_0x5214b5['fieldName'],'type':_0x5214b5[_0xfb3e('0x29')]['key']};});_0x178b76[_0xfb3e('0x2a')]=_[_0xfb3e('0x27')](_0x5c5103,'name');_0x178b76['query']=_[_0xfb3e('0x2b')](_0x18c45c[_0xfb3e('0x2c')]);_0x178b76['filters']=_[_0xfb3e('0x2d')](_0x178b76['model'],_0x178b76[_0xfb3e('0x2c')]);_0x4dc39d['attributes']=_['intersection'](_0x178b76[_0xfb3e('0x2a')],qs[_0xfb3e('0x2e')](_0x18c45c[_0xfb3e('0x2c')][_0xfb3e('0x2e')]));_0x4dc39d[_0xfb3e('0x2f')]=_0x4dc39d[_0xfb3e('0x2f')]['length']?_0x4dc39d[_0xfb3e('0x2f')]:_0x178b76[_0xfb3e('0x2a')];if(!_0x18c45c['query'][_0xfb3e('0x30')](_0xfb3e('0x31'))){_0x4dc39d[_0xfb3e('0x1c')]=qs[_0xfb3e('0x1c')](_0x18c45c[_0xfb3e('0x2c')][_0xfb3e('0x1c')]);_0x4dc39d[_0xfb3e('0x1a')]=qs[_0xfb3e('0x1a')](_0x18c45c[_0xfb3e('0x2c')][_0xfb3e('0x1a')]);}_0x4dc39d[_0xfb3e('0x32')]=qs[_0xfb3e('0x33')](_0x18c45c[_0xfb3e('0x2c')]['sort']);_0x4dc39d[_0xfb3e('0x34')]=qs[_0xfb3e('0x35')](_[_0xfb3e('0x36')](_0x18c45c[_0xfb3e('0x2c')],_0x178b76[_0xfb3e('0x35')]),_0x5c5103);if(_0x18c45c['query'][_0xfb3e('0x37')]){_0x4dc39d[_0xfb3e('0x34')]=_[_0xfb3e('0x38')](_0x4dc39d[_0xfb3e('0x34')],{'$or':_[_0xfb3e('0x27')](_0x5c5103,function(_0x72c54e){if(_0x72c54e[_0xfb3e('0x29')]!==_0xfb3e('0x39')){var _0x5d55ae={};_0x5d55ae[_0x72c54e[_0xfb3e('0x25')]]={'$like':'%'+_0x18c45c[_0xfb3e('0x2c')]['filter']+'%'};return _0x5d55ae;}})});}_0x4dc39d=_[_0xfb3e('0x38')]({},_0x4dc39d,_0x18c45c['options']);var _0x3e3bc1={'where':_0x4dc39d['where']};return db[_0xfb3e('0x28')][_0xfb3e('0x3a')](_0x3e3bc1)[_0xfb3e('0x22')](function(_0x518197){_0x3cb0af[_0xfb3e('0x3a')]=_0x518197;if(_0x18c45c['query'][_0xfb3e('0x3b')]){_0x4dc39d[_0xfb3e('0x3c')]=[{'all':!![]}];}return db['Automation'][_0xfb3e('0x3d')](_0x4dc39d);})[_0xfb3e('0x22')](function(_0x59663e){_0x3cb0af[_0xfb3e('0x3e')]=_0x59663e;return _0x3cb0af;})[_0xfb3e('0x22')](respondWithFilteredResult(_0x3587fd,_0x4dc39d))[_0xfb3e('0x3f')](handleError(_0x3587fd,null));};exports[_0xfb3e('0x40')]=function(_0x41bb5d,_0x59ce91){var _0x157fd2={'raw':![],'where':{'id':_0x41bb5d['params']['id']}},_0x4f968b={};_0x4f968b[_0xfb3e('0x2a')]=_[_0xfb3e('0x2b')](db[_0xfb3e('0x28')][_0xfb3e('0x41')]);_0x4f968b[_0xfb3e('0x2c')]=_[_0xfb3e('0x2b')](_0x41bb5d[_0xfb3e('0x2c')]);_0x4f968b['filters']=_[_0xfb3e('0x2d')](_0x4f968b['model'],_0x4f968b['query']);_0x157fd2['attributes']=_[_0xfb3e('0x2d')](_0x4f968b[_0xfb3e('0x2a')],qs[_0xfb3e('0x2e')](_0x41bb5d[_0xfb3e('0x2c')][_0xfb3e('0x2e')]));_0x157fd2[_0xfb3e('0x2f')]=_0x157fd2[_0xfb3e('0x2f')][_0xfb3e('0x42')]?_0x157fd2[_0xfb3e('0x2f')]:_0x4f968b[_0xfb3e('0x2a')];if(_0x41bb5d[_0xfb3e('0x2c')][_0xfb3e('0x3b')]){_0x157fd2[_0xfb3e('0x3c')]=[{'all':!![]}];}_0x157fd2=_[_0xfb3e('0x38')]({},_0x157fd2,_0x41bb5d[_0xfb3e('0x43')]);return db[_0xfb3e('0x28')][_0xfb3e('0x44')](_0x157fd2)[_0xfb3e('0x22')](handleEntityNotFound(_0x59ce91,null))['then'](respondWithResult(_0x59ce91,null))[_0xfb3e('0x3f')](handleError(_0x59ce91,null));};exports[_0xfb3e('0x45')]=function(_0x4b7503,_0x14fc9f){return db[_0xfb3e('0x28')]['create'](_0x4b7503['body'],{})[_0xfb3e('0x22')](respondWithResult(_0x14fc9f,0xc9))[_0xfb3e('0x3f')](handleError(_0x14fc9f,null));};exports[_0xfb3e('0x46')]=function(_0x3ca425,_0x3323b1){if(_0x3ca425[_0xfb3e('0x47')]['id']){delete _0x3ca425[_0xfb3e('0x47')]['id'];}return db[_0xfb3e('0x28')][_0xfb3e('0x44')]({'where':{'id':_0x3ca425[_0xfb3e('0x48')]['id']}})[_0xfb3e('0x22')](handleEntityNotFound(_0x3323b1,null))[_0xfb3e('0x22')](saveUpdates(_0x3ca425[_0xfb3e('0x47')],null))[_0xfb3e('0x22')](respondWithResult(_0x3323b1,null))[_0xfb3e('0x3f')](handleError(_0x3323b1,null));};exports[_0xfb3e('0x49')]=function(_0x3e0ada,_0x487ec1){return db[_0xfb3e('0x28')][_0xfb3e('0x44')]({'where':{'id':_0x3e0ada[_0xfb3e('0x48')]['id']}})[_0xfb3e('0x22')](handleEntityNotFound(_0x487ec1,null))[_0xfb3e('0x22')](removeEntity(_0x487ec1,null))[_0xfb3e('0x3f')](handleError(_0x487ec1,null));};exports[_0xfb3e('0x4a')]=function(_0x395343,_0x1c928f,_0x281c8b){return db[_0xfb3e('0x4b')][_0xfb3e('0x44')]({'where':{'id':_0x395343[_0xfb3e('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c928f,null))['then'](function(_0xabb1e3){if(_0xabb1e3){return _0xabb1e3[_0xfb3e('0x4a')](_0x395343[_0xfb3e('0x47')][_0xfb3e('0x4c')],_[_0xfb3e('0x4d')](_0x395343['body'],['ids','id'])||{});}})[_0xfb3e('0x22')](respondWithResult(_0x1c928f,null))[_0xfb3e('0x3f')](handleError(_0x1c928f,null));};exports[_0xfb3e('0x4e')]=function(_0x4f6c62,_0x1d771b,_0x3dd332){var _0x272ce3={};var _0x48bb90={};var _0x11f60f;var _0x323d24;return db[_0xfb3e('0x28')][_0xfb3e('0x4f')]({'where':{'id':_0x4f6c62[_0xfb3e('0x48')]['id']}})[_0xfb3e('0x22')](handleEntityNotFound(_0x1d771b,null))[_0xfb3e('0x22')](function(_0x493339){if(_0x493339){_0x11f60f=_0x493339;_0x48bb90[_0xfb3e('0x2a')]=_['keys'](db[_0xfb3e('0x4b')][_0xfb3e('0x41')]);_0x48bb90[_0xfb3e('0x2c')]=_[_0xfb3e('0x2b')](_0x4f6c62[_0xfb3e('0x2c')]);_0x48bb90[_0xfb3e('0x35')]=_[_0xfb3e('0x2d')](_0x48bb90[_0xfb3e('0x2a')],_0x48bb90[_0xfb3e('0x2c')]);_0x272ce3[_0xfb3e('0x2f')]=_[_0xfb3e('0x2d')](_0x48bb90['model'],qs[_0xfb3e('0x2e')](_0x4f6c62['query'][_0xfb3e('0x2e')]));_0x272ce3[_0xfb3e('0x2f')]=_0x272ce3[_0xfb3e('0x2f')]['length']?_0x272ce3[_0xfb3e('0x2f')]:_0x48bb90[_0xfb3e('0x2a')];_0x272ce3[_0xfb3e('0x32')]=qs[_0xfb3e('0x33')](_0x4f6c62[_0xfb3e('0x2c')][_0xfb3e('0x33')]);_0x272ce3[_0xfb3e('0x34')]=qs[_0xfb3e('0x35')](_[_0xfb3e('0x36')](_0x4f6c62[_0xfb3e('0x2c')],_0x48bb90[_0xfb3e('0x35')]));if(_0x4f6c62[_0xfb3e('0x2c')][_0xfb3e('0x37')]){_0x272ce3['where']=_[_0xfb3e('0x38')](_0x272ce3['where'],{'$or':_[_0xfb3e('0x27')](_0x272ce3[_0xfb3e('0x2f')],function(_0x5d295c){var _0x1cdcad={};_0x1cdcad[_0x5d295c]={'$like':'%'+_0x4f6c62[_0xfb3e('0x2c')][_0xfb3e('0x37')]+'%'};return _0x1cdcad;})});}_0x272ce3=_[_0xfb3e('0x38')]({},_0x272ce3,_0x4f6c62['options']);return _0x11f60f[_0xfb3e('0x4e')](_0x272ce3);}})[_0xfb3e('0x22')](function(_0x461b5c){if(_0x461b5c){_0x323d24=_0x461b5c[_0xfb3e('0x42')];if(!_0x4f6c62['query'][_0xfb3e('0x30')](_0xfb3e('0x31'))){_0x272ce3[_0xfb3e('0x1c')]=qs[_0xfb3e('0x1c')](_0x4f6c62[_0xfb3e('0x2c')][_0xfb3e('0x1c')]);_0x272ce3[_0xfb3e('0x1a')]=qs['offset'](_0x4f6c62['query'][_0xfb3e('0x1a')]);}return _0x11f60f[_0xfb3e('0x4e')](_0x272ce3);}})[_0xfb3e('0x22')](function(_0x5d1efa){if(_0x5d1efa){return _0x5d1efa?{'count':_0x323d24,'rows':_0x5d1efa}:null;}})['then'](respondWithResult(_0x1d771b,null))[_0xfb3e('0x3f')](handleError(_0x1d771b,null));};exports[_0xfb3e('0x50')]=function(_0x297392,_0x50209a,_0x419d58){return db['Action'][_0xfb3e('0x44')]({'where':{'id':_0x297392[_0xfb3e('0x48')]['id']}})['then'](handleEntityNotFound(_0x50209a,null))[_0xfb3e('0x22')](function(_0x3fb891){if(_0x3fb891){return _0x3fb891[_0xfb3e('0x50')](_0x297392[_0xfb3e('0x47')]['ids'],_[_0xfb3e('0x4d')](_0x297392['body'],[_0xfb3e('0x4c'),'id'])||{});}})[_0xfb3e('0x22')](respondWithResult(_0x50209a,null))[_0xfb3e('0x3f')](handleError(_0x50209a,null));};exports[_0xfb3e('0x51')]=function(_0x4ff6df,_0x26b6da,_0x5e0daf){var _0x20e4de={};var _0x1db686={};var _0x3375ef;var _0x4c7f08;return db[_0xfb3e('0x28')][_0xfb3e('0x4f')]({'where':{'id':_0x4ff6df[_0xfb3e('0x48')]['id']}})[_0xfb3e('0x22')](handleEntityNotFound(_0x26b6da,null))[_0xfb3e('0x22')](function(_0x28ccbb){if(_0x28ccbb){_0x3375ef=_0x28ccbb;_0x1db686[_0xfb3e('0x2a')]=_[_0xfb3e('0x2b')](db['Action'][_0xfb3e('0x41')]);_0x1db686[_0xfb3e('0x2c')]=_[_0xfb3e('0x2b')](_0x4ff6df[_0xfb3e('0x2c')]);_0x1db686[_0xfb3e('0x35')]=_['intersection'](_0x1db686['model'],_0x1db686['query']);_0x20e4de[_0xfb3e('0x2f')]=_[_0xfb3e('0x2d')](_0x1db686['model'],qs['fields'](_0x4ff6df['query'][_0xfb3e('0x2e')]));_0x20e4de[_0xfb3e('0x2f')]=_0x20e4de[_0xfb3e('0x2f')][_0xfb3e('0x42')]?_0x20e4de[_0xfb3e('0x2f')]:_0x1db686['model'];_0x20e4de[_0xfb3e('0x32')]=qs['sort'](_0x4ff6df[_0xfb3e('0x2c')][_0xfb3e('0x33')]);_0x20e4de[_0xfb3e('0x34')]=qs[_0xfb3e('0x35')](_['pick'](_0x4ff6df['query'],_0x1db686[_0xfb3e('0x35')]));if(_0x4ff6df[_0xfb3e('0x2c')][_0xfb3e('0x37')]){_0x20e4de[_0xfb3e('0x34')]=_[_0xfb3e('0x38')](_0x20e4de[_0xfb3e('0x34')],{'$or':_[_0xfb3e('0x27')](_0x20e4de[_0xfb3e('0x2f')],function(_0x521d93){var _0x28fc0e={};_0x28fc0e[_0x521d93]={'$like':'%'+_0x4ff6df[_0xfb3e('0x2c')]['filter']+'%'};return _0x28fc0e;})});}_0x20e4de=_['merge']({},_0x20e4de,_0x4ff6df[_0xfb3e('0x43')]);return _0x3375ef[_0xfb3e('0x51')](_0x20e4de);}})[_0xfb3e('0x22')](function(_0x1e4f31){if(_0x1e4f31){_0x4c7f08=_0x1e4f31['length'];if(!_0x4ff6df[_0xfb3e('0x2c')]['hasOwnProperty'](_0xfb3e('0x31'))){_0x20e4de['limit']=qs[_0xfb3e('0x1c')](_0x4ff6df[_0xfb3e('0x2c')][_0xfb3e('0x1c')]);_0x20e4de['offset']=qs['offset'](_0x4ff6df[_0xfb3e('0x2c')][_0xfb3e('0x1a')]);}return _0x3375ef[_0xfb3e('0x51')](_0x20e4de);}})[_0xfb3e('0x22')](function(_0x685525){if(_0x685525){return _0x685525?{'count':_0x4c7f08,'rows':_0x685525}:null;}})[_0xfb3e('0x22')](respondWithResult(_0x26b6da,null))[_0xfb3e('0x3f')](handleError(_0x26b6da,null));};
\ No newline at end of file
+var _0xf863=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','fields','find','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','Action','omit','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','name','index','map','Automation','rawAttributes','model','query','intersection'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xf863,0x6f));var _0x3f86=function(_0x5e5bb7,_0x53c8f1){_0x5e5bb7=_0x5e5bb7-0x0;var _0x3ec7c2=_0xf863[_0x5e5bb7];return _0x3ec7c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f86('0x0'));var zipdir=require(_0x3f86('0x1'));var jsonpatch=require(_0x3f86('0x2'));var rp=require(_0x3f86('0x3'));var moment=require('moment');var BPromise=require(_0x3f86('0x4'));var Mustache=require(_0x3f86('0x5'));var util=require(_0x3f86('0x6'));var path=require(_0x3f86('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f86('0x8'));var _=require(_0x3f86('0x9'));var squel=require(_0x3f86('0xa'));var crypto=require('crypto');var jsforce=require(_0x3f86('0xb'));var deskjs=require(_0x3f86('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3f86('0xd'));var Papa=require('papaparse');var Redis=require(_0x3f86('0xe'));var authService=require(_0x3f86('0xf'));var qs=require(_0x3f86('0x10'));var as=require(_0x3f86('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f86('0x12'))(_0x3f86('0x13'));var utils=require(_0x3f86('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3f86('0x15'));var db=require(_0x3f86('0x16'))['db'];function respondWithStatusCode(_0x2305c3,_0x4ee597){_0x4ee597=_0x4ee597||0xcc;return function(_0xfc6c49){if(_0xfc6c49){return _0x2305c3['sendStatus'](_0x4ee597);}return _0x2305c3['status'](_0x4ee597)[_0x3f86('0x17')]();};}function respondWithResult(_0x3931e3,_0x44a93e){_0x44a93e=_0x44a93e||0xc8;return function(_0x4dbc63){if(_0x4dbc63){return _0x3931e3[_0x3f86('0x18')](_0x44a93e)[_0x3f86('0x19')](_0x4dbc63);}};}function respondWithFilteredResult(_0x234255,_0x11a177){return function(_0x4c5ac9){if(_0x4c5ac9){var _0x1d1b58=typeof _0x11a177[_0x3f86('0x1a')]===_0x3f86('0x1b')&&typeof _0x11a177[_0x3f86('0x1c')]===_0x3f86('0x1b');var _0x88dc14=_0x4c5ac9[_0x3f86('0x1d')];var _0x48ebd7=_0x1d1b58?0x0:_0x11a177['offset'];var _0x5edeed=_0x1d1b58?_0x4c5ac9['count']:_0x11a177[_0x3f86('0x1a')]+_0x11a177[_0x3f86('0x1c')];var _0x2f8b68;if(_0x5edeed>=_0x88dc14){_0x5edeed=_0x88dc14;_0x2f8b68=0xc8;}else{_0x2f8b68=0xce;}_0x234255[_0x3f86('0x18')](_0x2f8b68);return _0x234255['set'](_0x3f86('0x1e'),_0x48ebd7+'-'+_0x5edeed+'/'+_0x88dc14)[_0x3f86('0x19')](_0x4c5ac9);}return null;};}function patchUpdates(_0x50f627){return function(_0xf82623){try{jsonpatch[_0x3f86('0x1f')](_0xf82623,_0x50f627,!![]);}catch(_0x4b8689){return BPromise['reject'](_0x4b8689);}return _0xf82623[_0x3f86('0x20')]();};}function saveUpdates(_0x567164,_0xbf8d3e){return function(_0xf1093c){if(_0xf1093c){return _0xf1093c[_0x3f86('0x21')](_0x567164)['then'](function(_0x1813bc){return _0x1813bc;});}return null;};}function removeEntity(_0x179586,_0x40cfb8){return function(_0x105af9){if(_0x105af9){return _0x105af9[_0x3f86('0x22')]()[_0x3f86('0x23')](function(){_0x179586[_0x3f86('0x18')](0xcc)[_0x3f86('0x17')]();});}};}function handleEntityNotFound(_0x33f2f0,_0xecdc82){return function(_0x50a3ee){if(!_0x50a3ee){_0x33f2f0['sendStatus'](0x194);}return _0x50a3ee;};}function handleError(_0x310506,_0x56ebf5){_0x56ebf5=_0x56ebf5||0x1f4;return function(_0x144d4c){logger[_0x3f86('0x24')](_0x144d4c['stack']);if(_0x144d4c[_0x3f86('0x25')]){delete _0x144d4c[_0x3f86('0x25')];}_0x310506[_0x3f86('0x18')](_0x56ebf5)['send'](_0x144d4c);};}exports[_0x3f86('0x26')]=function(_0x5d667f,_0x3c31af){var _0x33376d={},_0x132963={},_0x387c06={'count':0x0,'rows':[]};var _0x39f2ad=_[_0x3f86('0x27')](db[_0x3f86('0x28')][_0x3f86('0x29')],function(_0x1af6b7){return{'name':_0x1af6b7['fieldName'],'type':_0x1af6b7['type']['key']};});_0x132963[_0x3f86('0x2a')]=_[_0x3f86('0x27')](_0x39f2ad,'name');_0x132963[_0x3f86('0x2b')]=_['keys'](_0x5d667f['query']);_0x132963['filters']=_[_0x3f86('0x2c')](_0x132963[_0x3f86('0x2a')],_0x132963['query']);_0x33376d[_0x3f86('0x2d')]=_[_0x3f86('0x2c')](_0x132963[_0x3f86('0x2a')],qs['fields'](_0x5d667f[_0x3f86('0x2b')]['fields']));_0x33376d['attributes']=_0x33376d['attributes'][_0x3f86('0x2e')]?_0x33376d[_0x3f86('0x2d')]:_0x132963[_0x3f86('0x2a')];if(!_0x5d667f['query'][_0x3f86('0x2f')](_0x3f86('0x30'))){_0x33376d[_0x3f86('0x1c')]=qs[_0x3f86('0x1c')](_0x5d667f['query'][_0x3f86('0x1c')]);_0x33376d[_0x3f86('0x1a')]=qs['offset'](_0x5d667f['query'][_0x3f86('0x1a')]);}_0x33376d[_0x3f86('0x31')]=qs[_0x3f86('0x32')](_0x5d667f['query']['sort']);_0x33376d[_0x3f86('0x33')]=qs[_0x3f86('0x34')](_[_0x3f86('0x35')](_0x5d667f[_0x3f86('0x2b')],_0x132963[_0x3f86('0x34')]),_0x39f2ad);if(_0x5d667f[_0x3f86('0x2b')][_0x3f86('0x36')]){_0x33376d['where']=_['merge'](_0x33376d[_0x3f86('0x33')],{'$or':_[_0x3f86('0x27')](_0x39f2ad,function(_0x4c7d44){if(_0x4c7d44[_0x3f86('0x37')]!==_0x3f86('0x38')){var _0x4741ee={};_0x4741ee[_0x4c7d44['name']]={'$like':'%'+_0x5d667f[_0x3f86('0x2b')]['filter']+'%'};return _0x4741ee;}})});}_0x33376d=_[_0x3f86('0x39')]({},_0x33376d,_0x5d667f[_0x3f86('0x3a')]);var _0x35e922={'where':_0x33376d[_0x3f86('0x33')]};return db[_0x3f86('0x28')][_0x3f86('0x1d')](_0x35e922)[_0x3f86('0x23')](function(_0x10903f){_0x387c06[_0x3f86('0x1d')]=_0x10903f;if(_0x5d667f[_0x3f86('0x2b')][_0x3f86('0x3b')]){_0x33376d[_0x3f86('0x3c')]=[{'all':!![]}];}return db[_0x3f86('0x28')][_0x3f86('0x3d')](_0x33376d);})[_0x3f86('0x23')](function(_0x1b39fa){_0x387c06['rows']=_0x1b39fa;return _0x387c06;})[_0x3f86('0x23')](respondWithFilteredResult(_0x3c31af,_0x33376d))[_0x3f86('0x3e')](handleError(_0x3c31af,null));};exports['show']=function(_0x5e48a7,_0x1fabde){var _0x105bd4={'raw':![],'where':{'id':_0x5e48a7[_0x3f86('0x3f')]['id']}},_0x508e7d={};_0x508e7d['model']=_[_0x3f86('0x40')](db['Automation'][_0x3f86('0x29')]);_0x508e7d[_0x3f86('0x2b')]=_['keys'](_0x5e48a7['query']);_0x508e7d[_0x3f86('0x34')]=_['intersection'](_0x508e7d[_0x3f86('0x2a')],_0x508e7d[_0x3f86('0x2b')]);_0x105bd4['attributes']=_[_0x3f86('0x2c')](_0x508e7d[_0x3f86('0x2a')],qs[_0x3f86('0x41')](_0x5e48a7[_0x3f86('0x2b')][_0x3f86('0x41')]));_0x105bd4['attributes']=_0x105bd4[_0x3f86('0x2d')]['length']?_0x105bd4[_0x3f86('0x2d')]:_0x508e7d['model'];if(_0x5e48a7[_0x3f86('0x2b')][_0x3f86('0x3b')]){_0x105bd4[_0x3f86('0x3c')]=[{'all':!![]}];}_0x105bd4=_['merge']({},_0x105bd4,_0x5e48a7['options']);return db[_0x3f86('0x28')][_0x3f86('0x42')](_0x105bd4)[_0x3f86('0x23')](handleEntityNotFound(_0x1fabde,null))[_0x3f86('0x23')](respondWithResult(_0x1fabde,null))[_0x3f86('0x3e')](handleError(_0x1fabde,null));};exports['create']=function(_0xc69856,_0x32693e){return db[_0x3f86('0x28')][_0x3f86('0x43')](_0xc69856[_0x3f86('0x44')],{})['then'](respondWithResult(_0x32693e,0xc9))[_0x3f86('0x3e')](handleError(_0x32693e,null));};exports[_0x3f86('0x21')]=function(_0x20ac90,_0x3c18de){if(_0x20ac90['body']['id']){delete _0x20ac90[_0x3f86('0x44')]['id'];}return db[_0x3f86('0x28')][_0x3f86('0x42')]({'where':{'id':_0x20ac90[_0x3f86('0x3f')]['id']}})[_0x3f86('0x23')](handleEntityNotFound(_0x3c18de,null))[_0x3f86('0x23')](saveUpdates(_0x20ac90['body'],null))['then'](respondWithResult(_0x3c18de,null))[_0x3f86('0x3e')](handleError(_0x3c18de,null));};exports['destroy']=function(_0x4a8225,_0x2783de){return db[_0x3f86('0x28')][_0x3f86('0x42')]({'where':{'id':_0x4a8225['params']['id']}})['then'](handleEntityNotFound(_0x2783de,null))[_0x3f86('0x23')](removeEntity(_0x2783de,null))['catch'](handleError(_0x2783de,null));};exports[_0x3f86('0x45')]=function(_0x107ab1,_0x25335e,_0x1db251){return db[_0x3f86('0x46')][_0x3f86('0x42')]({'where':{'id':_0x107ab1[_0x3f86('0x3f')]['id']}})[_0x3f86('0x23')](handleEntityNotFound(_0x25335e,null))[_0x3f86('0x23')](function(_0x564cae){if(_0x564cae){return _0x564cae['addConditions'](_0x107ab1[_0x3f86('0x44')]['ids'],_['omit'](_0x107ab1['body'],[_0x3f86('0x47'),'id'])||{});}})['then'](respondWithResult(_0x25335e,null))[_0x3f86('0x3e')](handleError(_0x25335e,null));};exports[_0x3f86('0x48')]=function(_0x475e5d,_0x1cad9d,_0x150661){var _0x7c3cc6={};var _0x1d9be1={};var _0x3475c3;var _0x2dc241;return db[_0x3f86('0x28')][_0x3f86('0x49')]({'where':{'id':_0x475e5d[_0x3f86('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1cad9d,null))[_0x3f86('0x23')](function(_0x490280){if(_0x490280){_0x3475c3=_0x490280;_0x1d9be1['model']=_[_0x3f86('0x40')](db[_0x3f86('0x46')]['rawAttributes']);_0x1d9be1['query']=_['keys'](_0x475e5d[_0x3f86('0x2b')]);_0x1d9be1[_0x3f86('0x34')]=_[_0x3f86('0x2c')](_0x1d9be1[_0x3f86('0x2a')],_0x1d9be1[_0x3f86('0x2b')]);_0x7c3cc6[_0x3f86('0x2d')]=_['intersection'](_0x1d9be1['model'],qs[_0x3f86('0x41')](_0x475e5d[_0x3f86('0x2b')][_0x3f86('0x41')]));_0x7c3cc6['attributes']=_0x7c3cc6[_0x3f86('0x2d')]['length']?_0x7c3cc6[_0x3f86('0x2d')]:_0x1d9be1[_0x3f86('0x2a')];_0x7c3cc6[_0x3f86('0x31')]=qs[_0x3f86('0x32')](_0x475e5d[_0x3f86('0x2b')][_0x3f86('0x32')]);_0x7c3cc6[_0x3f86('0x33')]=qs[_0x3f86('0x34')](_[_0x3f86('0x35')](_0x475e5d['query'],_0x1d9be1['filters']));if(_0x475e5d[_0x3f86('0x2b')][_0x3f86('0x36')]){_0x7c3cc6[_0x3f86('0x33')]=_['merge'](_0x7c3cc6[_0x3f86('0x33')],{'$or':_['map'](_0x7c3cc6[_0x3f86('0x2d')],function(_0x27fb06){var _0x147fe5={};_0x147fe5[_0x27fb06]={'$like':'%'+_0x475e5d['query']['filter']+'%'};return _0x147fe5;})});}_0x7c3cc6=_[_0x3f86('0x39')]({},_0x7c3cc6,_0x475e5d[_0x3f86('0x3a')]);return _0x3475c3[_0x3f86('0x48')](_0x7c3cc6);}})[_0x3f86('0x23')](function(_0x128426){if(_0x128426){_0x2dc241=_0x128426['length'];if(!_0x475e5d[_0x3f86('0x2b')]['hasOwnProperty'](_0x3f86('0x30'))){_0x7c3cc6[_0x3f86('0x1c')]=qs[_0x3f86('0x1c')](_0x475e5d[_0x3f86('0x2b')]['limit']);_0x7c3cc6['offset']=qs[_0x3f86('0x1a')](_0x475e5d[_0x3f86('0x2b')][_0x3f86('0x1a')]);}return _0x3475c3[_0x3f86('0x48')](_0x7c3cc6);}})[_0x3f86('0x23')](function(_0xa34c1e){if(_0xa34c1e){return _0xa34c1e?{'count':_0x2dc241,'rows':_0xa34c1e}:null;}})[_0x3f86('0x23')](respondWithResult(_0x1cad9d,null))[_0x3f86('0x3e')](handleError(_0x1cad9d,null));};exports[_0x3f86('0x4a')]=function(_0x3e0b0f,_0x1d98a5,_0x1fb0e1){return db[_0x3f86('0x4b')]['find']({'where':{'id':_0x3e0b0f[_0x3f86('0x3f')]['id']}})[_0x3f86('0x23')](handleEntityNotFound(_0x1d98a5,null))[_0x3f86('0x23')](function(_0x46852c){if(_0x46852c){return _0x46852c['addActions'](_0x3e0b0f[_0x3f86('0x44')]['ids'],_[_0x3f86('0x4c')](_0x3e0b0f[_0x3f86('0x44')],['ids','id'])||{});}})[_0x3f86('0x23')](respondWithResult(_0x1d98a5,null))[_0x3f86('0x3e')](handleError(_0x1d98a5,null));};exports['getActions']=function(_0x422156,_0x41289c,_0x3d2571){var _0x20e3be={};var _0x36846b={};var _0x25e1ce;var _0x2de0b6;return db[_0x3f86('0x28')][_0x3f86('0x49')]({'where':{'id':_0x422156['params']['id']}})['then'](handleEntityNotFound(_0x41289c,null))['then'](function(_0x31c457){if(_0x31c457){_0x25e1ce=_0x31c457;_0x36846b[_0x3f86('0x2a')]=_[_0x3f86('0x40')](db['Action'][_0x3f86('0x29')]);_0x36846b[_0x3f86('0x2b')]=_[_0x3f86('0x40')](_0x422156[_0x3f86('0x2b')]);_0x36846b[_0x3f86('0x34')]=_[_0x3f86('0x2c')](_0x36846b['model'],_0x36846b[_0x3f86('0x2b')]);_0x20e3be['attributes']=_[_0x3f86('0x2c')](_0x36846b[_0x3f86('0x2a')],qs[_0x3f86('0x41')](_0x422156[_0x3f86('0x2b')][_0x3f86('0x41')]));_0x20e3be[_0x3f86('0x2d')]=_0x20e3be[_0x3f86('0x2d')][_0x3f86('0x2e')]?_0x20e3be['attributes']:_0x36846b['model'];_0x20e3be[_0x3f86('0x31')]=qs[_0x3f86('0x32')](_0x422156[_0x3f86('0x2b')][_0x3f86('0x32')]);_0x20e3be[_0x3f86('0x33')]=qs[_0x3f86('0x34')](_[_0x3f86('0x35')](_0x422156[_0x3f86('0x2b')],_0x36846b[_0x3f86('0x34')]));if(_0x422156[_0x3f86('0x2b')]['filter']){_0x20e3be[_0x3f86('0x33')]=_[_0x3f86('0x39')](_0x20e3be[_0x3f86('0x33')],{'$or':_[_0x3f86('0x27')](_0x20e3be[_0x3f86('0x2d')],function(_0x204c25){var _0x74c929={};_0x74c929[_0x204c25]={'$like':'%'+_0x422156[_0x3f86('0x2b')][_0x3f86('0x36')]+'%'};return _0x74c929;})});}_0x20e3be=_['merge']({},_0x20e3be,_0x422156[_0x3f86('0x3a')]);return _0x25e1ce[_0x3f86('0x4d')](_0x20e3be);}})[_0x3f86('0x23')](function(_0x2bc38c){if(_0x2bc38c){_0x2de0b6=_0x2bc38c[_0x3f86('0x2e')];if(!_0x422156[_0x3f86('0x2b')][_0x3f86('0x2f')]('nolimit')){_0x20e3be[_0x3f86('0x1c')]=qs[_0x3f86('0x1c')](_0x422156[_0x3f86('0x2b')]['limit']);_0x20e3be[_0x3f86('0x1a')]=qs[_0x3f86('0x1a')](_0x422156[_0x3f86('0x2b')][_0x3f86('0x1a')]);}return _0x25e1ce['getActions'](_0x20e3be);}})[_0x3f86('0x23')](function(_0x24bc4f){if(_0x24bc4f){return _0x24bc4f?{'count':_0x2de0b6,'rows':_0x24bc4f}:null;}})[_0x3f86('0x23')](respondWithResult(_0x41289c,null))[_0x3f86('0x3e')](handleError(_0x41289c,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index f822ed5..badc48c 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 _0x1120=['api','moment','request-promise','path','rimraf','./automation.attributes','define','Automation','lodash','../../config/logger'];(function(_0x31eb3a,_0x35252b){var _0x6a1f37=function(_0x2465c0){while(--_0x2465c0){_0x31eb3a['push'](_0x31eb3a['shift']());}};_0x6a1f37(++_0x35252b);}(_0x1120,0x1e8));var _0x0112=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x1120[_0x26f1b2];return _0x1624a4;};'use strict';var _=require(_0x0112('0x0'));var util=require('util');var logger=require(_0x0112('0x1'))(_0x0112('0x2'));var moment=require(_0x0112('0x3'));var BPromise=require('bluebird');var rp=require(_0x0112('0x4'));var fs=require('fs');var path=require(_0x0112('0x5'));var rimraf=require(_0x0112('0x6'));var config=require('../../config/environment');var attributes=require(_0x0112('0x7'));module['exports']=function(_0x1b8253,_0x44cc3e){return _0x1b8253[_0x0112('0x8')](_0x0112('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x42f2=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Automation','lodash','../../config/logger'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x42f2,0xb2));var _0x242f=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0x42f2[_0x35d59c];return _0x18cd27;};'use strict';var _=require(_0x242f('0x0'));var util=require('util');var logger=require(_0x242f('0x1'))(_0x242f('0x2'));var moment=require(_0x242f('0x3'));var BPromise=require(_0x242f('0x4'));var rp=require(_0x242f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x242f('0x6'));var config=require(_0x242f('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x4f797d,_0x1bab25){return _0x4f797d[_0x242f('0x8')](_0x242f('0x9'),attributes,{'tableName':'tools_automations','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 1d3c581..4244804 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 _0xd232=['then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request'];(function(_0x5c611d,_0x2c7cd1){var _0x33d959=function(_0x530c1e){while(--_0x530c1e){_0x5c611d['push'](_0x5c611d['shift']());}};_0x33d959(++_0x2c7cd1);}(_0xd232,0x74));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2d23('0x0'));var util=require('util');var moment=require(_0x2d23('0x1'));var BPromise=require(_0x2d23('0x2'));var rs=require(_0x2d23('0x3'));var fs=require('fs');var Redis=require(_0x2d23('0x4'));var db=require(_0x2d23('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d23('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2d23('0x7')][_0x2d23('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15c735,_0x53ac18,_0x18cac8){return new BPromise(function(_0x4cf7f4,_0x2c4667){return client[_0x2d23('0x9')](_0x15c735,_0x18cac8)[_0x2d23('0xa')](function(_0x7847cb){logger[_0x2d23('0xb')](_0x2d23('0xc'),_0x53ac18,_0x2d23('0xd'));logger['debug'](_0x2d23('0xe'),_0x53ac18,_0x2d23('0xd'),JSON[_0x2d23('0xf')](_0x7847cb));if(_0x7847cb[_0x2d23('0x10')]){if(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x11')]===0x1f4){logger[_0x2d23('0x10')](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x2c4667(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}logger['error'](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x4cf7f4(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}else{logger['info'](_0x2d23('0xc'),_0x53ac18,'request\x20sent');_0x4cf7f4(_0x7847cb[_0x2d23('0x13')]['message']);}})[_0x2d23('0x14')](function(_0x30b578){logger['error']('Automation,\x20%s,\x20%s',_0x53ac18,_0x30b578);_0x2c4667(_0x30b578);});});}
\ No newline at end of file
+var _0x9512=['rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x30afe5,_0x509ed8){var _0x2a240d=function(_0x5b0f6f){while(--_0x5b0f6f){_0x30afe5['push'](_0x30afe5['shift']());}};_0x2a240d(++_0x509ed8);}(_0x9512,0x75));var _0x2951=function(_0x353f52,_0xe40124){_0x353f52=_0x353f52-0x0;var _0x44e3ec=_0x9512[_0x353f52];return _0x44e3ec;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var moment=require(_0x2951('0x2'));var BPromise=require(_0x2951('0x3'));var rs=require(_0x2951('0x4'));var fs=require('fs');var Redis=require(_0x2951('0x5'));var db=require(_0x2951('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2951('0x7'))(_0x2951('0x8'));var config=require(_0x2951('0x9'));var jayson=require(_0x2951('0xa'));var client=jayson[_0x2951('0xb')][_0x2951('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b50d9,_0x59d947,_0x2c2c11){return new BPromise(function(_0x2c5ad6,_0x3e1a01){return client[_0x2951('0xd')](_0x1b50d9,_0x2c2c11)[_0x2951('0xe')](function(_0x113b97){logger['info'](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));logger[_0x2951('0x11')](_0x2951('0x12'),_0x59d947,'request\x20sent',JSON[_0x2951('0x13')](_0x113b97));if(_0x113b97[_0x2951('0x14')]){if(_0x113b97[_0x2951('0x14')][_0x2951('0x15')]===0x1f4){logger[_0x2951('0x14')]('Automation,\x20%s,\x20%s',_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x3e1a01(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x2c5ad6(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}else{logger[_0x2951('0x17')](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));_0x2c5ad6(_0x113b97['result'][_0x2951('0x16')]);}})[_0x2951('0x18')](function(_0x18e89d){logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x18e89d);_0x3e1a01(_0x18e89d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index f0647d3..bb1b338 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 _0x0eec=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x2b2aad,_0x8c10ec){var _0x5b3d53=function(_0x21d40b){while(--_0x21d40b){_0x2b2aad['push'](_0x2b2aad['shift']());}};_0x5b3d53(++_0x8c10ec);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc0ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc0ee('0x1'));var express=require(_0xc0ee('0x2'));var router=express[_0xc0ee('0x3')]();var fs_extra=require(_0xc0ee('0x4'));var auth=require(_0xc0ee('0x5'));var interaction=require(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var controller=require('./automation.controller');router[_0xc0ee('0x8')]('/',auth['isAuthenticated'](),controller[_0xc0ee('0x9')]);router[_0xc0ee('0x8')](_0xc0ee('0xa'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0xc')]);router[_0xc0ee('0x8')](_0xc0ee('0xd'),auth['isAuthenticated'](),controller[_0xc0ee('0xe')]);router[_0xc0ee('0x8')](_0xc0ee('0xf'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x10')]);router[_0xc0ee('0x11')]('/',auth[_0xc0ee('0xb')](),controller['create']);router[_0xc0ee('0x11')](_0xc0ee('0xd'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x12')]);router[_0xc0ee('0x11')](_0xc0ee('0xf'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x13')]);router[_0xc0ee('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xc0ee('0x15')]);router[_0xc0ee('0x16')](_0xc0ee('0xa'),auth['isAuthenticated'](),controller[_0xc0ee('0x17')]);module[_0xc0ee('0x18')]=router;
\ No newline at end of file
+var _0xd4d1=['/:id/actions','addActions','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./automation.controller','isAuthenticated','index','get','getConditions','getActions','post','create','/:id/conditions','addConditions'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xd4d1,0x123));var _0x1d4d=function(_0x51bb55,_0x336b3f){_0x51bb55=_0x51bb55-0x0;var _0x417ad5=_0xd4d1[_0x51bb55];return _0x417ad5;};'use strict';var multer=require(_0x1d4d('0x0'));var util=require(_0x1d4d('0x1'));var path=require(_0x1d4d('0x2'));var timeout=require(_0x1d4d('0x3'));var express=require(_0x1d4d('0x4'));var router=express['Router']();var fs_extra=require(_0x1d4d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1d4d('0x6'));var config=require('../../config/environment');var controller=require(_0x1d4d('0x7'));router['get']('/',auth[_0x1d4d('0x8')](),controller[_0x1d4d('0x9')]);router[_0x1d4d('0xa')]('/:id',auth[_0x1d4d('0x8')](),controller['show']);router[_0x1d4d('0xa')]('/:id/conditions',auth[_0x1d4d('0x8')](),controller[_0x1d4d('0xb')]);router[_0x1d4d('0xa')]('/:id/actions',auth[_0x1d4d('0x8')](),controller[_0x1d4d('0xc')]);router[_0x1d4d('0xd')]('/',auth['isAuthenticated'](),controller[_0x1d4d('0xe')]);router[_0x1d4d('0xd')](_0x1d4d('0xf'),auth[_0x1d4d('0x8')](),controller[_0x1d4d('0x10')]);router[_0x1d4d('0xd')](_0x1d4d('0x11'),auth[_0x1d4d('0x8')](),controller[_0x1d4d('0x12')]);router[_0x1d4d('0x13')]('/:id',auth[_0x1d4d('0x8')](),controller[_0x1d4d('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1d4d('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 3d5f548..6923b4c 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 _0xecac=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','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\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0xecac,0x100));var _0xceca=function(_0x20503d,_0x330ec7){_0x20503d=_0x20503d-0x0;var _0x4ba008=_0xecac[_0x20503d];return _0x4ba008;};'use strict';var Sequelize=require(_0xceca('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xceca('0x1')](_0xceca('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xceca('0x3')]},'active':{'type':Sequelize[_0xceca('0x4')],'defaultValue':0x0,'comment':_0xceca('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xceca('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xceca('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xceca('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceca('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xceca('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xceca('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xceca('0x1')]('always',_0xceca('0x11'),'onlyIfOpen'),'defaultValue':_0xceca('0x12')},'dialAMDActive':{'type':Sequelize[_0xceca('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xceca('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xceca('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xceca('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceca('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xceca('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xceca('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xceca('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xceca('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xceca('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xceca('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xceca('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceca('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xceca('0x1b')),'defaultValue':_0xceca('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceca('0x1d')},'dialCutDigit':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceca('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xad9f=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#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','never','onlyIfOpen','BOOLEAN','#AMD\x20Greeting'];(function(_0x130421,_0x37aae2){var _0x39ea72=function(_0x5a663c){while(--_0x5a663c){_0x130421['push'](_0x130421['shift']());}};_0x39ea72(++_0x37aae2);}(_0xad9f,0x1be));var _0xfad9=function(_0x1053ba,_0xc98f10){_0x1053ba=_0x1053ba-0x0;var _0x233aae=_0xad9f[_0x1053ba];return _0x233aae;};'use strict';var Sequelize=require(_0xfad9('0x0'));module[_0xfad9('0x1')]={'name':{'type':Sequelize[_0xfad9('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xfad9('0x3')](_0xfad9('0x4')),'allowNull':![],'defaultValue':_0xfad9('0x4')},'description':{'type':Sequelize[_0xfad9('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xfad9('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xfad9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfad9('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfad9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfad9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'comment':_0xfad9('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfad9('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfad9('0x2')],'defaultValue':_0xfad9('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xfad9('0x3')](_0xfad9('0x11'),_0xfad9('0x12'),_0xfad9('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xfad9('0x14')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xfad9('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfad9('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfad9('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfad9('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfad9('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfad9('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfad9('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfad9('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfad9('0x3')](_0xfad9('0x1c'),_0xfad9('0x1d')),'defaultValue':_0xfad9('0x1c')},'dialPrefix':{'type':Sequelize[_0xfad9('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfad9('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfad9('0x1e')},'dialCutDigit':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfad9('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'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 45ac236..3600db9 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 _0x74f6=['error','clone','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmHopper','nolimit','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','COALESCE(phone,\x27\x27)','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','update','then','destroy','get','IvrCampaigns','stack','name','index','Campaign','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','rawAttributes','merge','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x74f6,0x1c7));var _0x674f=function(_0xbc2171,_0x221a0e){_0xbc2171=_0xbc2171-0x0;var _0x136702=_0x74f6[_0xbc2171];return _0x136702;};'use strict';var emlformat=require(_0x674f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x674f('0x1'));var jsonpatch=require(_0x674f('0x2'));var rp=require(_0x674f('0x3'));var moment=require(_0x674f('0x4'));var BPromise=require(_0x674f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x674f('0x6'));var fs=require('fs');var fs_extra=require(_0x674f('0x7'));var _=require(_0x674f('0x8'));var squel=require(_0x674f('0x9'));var crypto=require(_0x674f('0xa'));var jsforce=require(_0x674f('0xb'));var deskjs=require(_0x674f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x674f('0xd'));var Papa=require(_0x674f('0xe'));var Redis=require(_0x674f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x674f('0x10'));var as=require(_0x674f('0x11'));var hardwareService=require(_0x674f('0x12'));var logger=require(_0x674f('0x13'))(_0x674f('0x14'));var utils=require(_0x674f('0x15'));var config=require(_0x674f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x674f('0x17'))['db'];function respondWithStatusCode(_0x40408c,_0x231e64){_0x231e64=_0x231e64||0xcc;return function(_0x1a0f20){if(_0x1a0f20){return _0x40408c[_0x674f('0x18')](_0x231e64);}return _0x40408c[_0x674f('0x19')](_0x231e64)[_0x674f('0x1a')]();};}function respondWithResult(_0x396fdb,_0x3eeac7){_0x3eeac7=_0x3eeac7||0xc8;return function(_0x3fe233){if(_0x3fe233){return _0x396fdb[_0x674f('0x19')](_0x3eeac7)[_0x674f('0x1b')](_0x3fe233);}};}function respondWithFilteredResult(_0x7da3b8,_0x5bd350){return function(_0x40d04d){if(_0x40d04d){var _0xfa05d6=typeof _0x5bd350[_0x674f('0x1c')]===_0x674f('0x1d')&&typeof _0x5bd350['limit']===_0x674f('0x1d');var _0x527741=_0x40d04d[_0x674f('0x1e')];var _0x233f2a=_0xfa05d6?0x0:_0x5bd350[_0x674f('0x1c')];var _0x1edf74=_0xfa05d6?_0x40d04d[_0x674f('0x1e')]:_0x5bd350['offset']+_0x5bd350[_0x674f('0x1f')];var _0x3abc0e;if(_0x1edf74>=_0x527741){_0x1edf74=_0x527741;_0x3abc0e=0xc8;}else{_0x3abc0e=0xce;}_0x7da3b8['status'](_0x3abc0e);return _0x7da3b8['set']('Content-Range',_0x233f2a+'-'+_0x1edf74+'/'+_0x527741)[_0x674f('0x1b')](_0x40d04d);}return null;};}function patchUpdates(_0x55550b){return function(_0x15e388){try{jsonpatch[_0x674f('0x20')](_0x15e388,_0x55550b,!![]);}catch(_0x309521){return BPromise[_0x674f('0x21')](_0x309521);}return _0x15e388['save']();};}function saveUpdates(_0x131c65,_0x386c79){return function(_0x5b26e3){if(_0x5b26e3){return _0x5b26e3[_0x674f('0x22')](_0x131c65)[_0x674f('0x23')](function(_0x704209){return _0x704209;});}return null;};}function removeEntity(_0x5907dd,_0x65be90){return function(_0x7bbdda){if(_0x7bbdda){return _0x7bbdda[_0x674f('0x24')]()['then'](function(){var _0x2356c5=_0x7bbdda[_0x674f('0x25')]({'plain':!![]});var _0x3e0428=_0x674f('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e0428,'resourceId':_0x2356c5['id']}})[_0x674f('0x23')](function(){return _0x7bbdda;});})[_0x674f('0x23')](function(){_0x5907dd['status'](0xcc)[_0x674f('0x1a')]();});}};}function handleEntityNotFound(_0x2f8765,_0x2084d0){return function(_0x328c70){if(!_0x328c70){_0x2f8765['sendStatus'](0x194);}return _0x328c70;};}function handleError(_0x48426c,_0x16a0c8){_0x16a0c8=_0x16a0c8||0x1f4;return function(_0x5678b0){logger['error'](_0x5678b0[_0x674f('0x27')]);if(_0x5678b0[_0x674f('0x28')]){delete _0x5678b0[_0x674f('0x28')];}_0x48426c['status'](_0x16a0c8)['send'](_0x5678b0);};}exports[_0x674f('0x29')]=function(_0x577969,_0x3fe337){var _0x85244e={},_0x176eb3={},_0x3430e3={'count':0x0,'rows':[]};var _0x45ed4f=_['map'](db[_0x674f('0x2a')]['rawAttributes'],function(_0x193466){return{'name':_0x193466['fieldName'],'type':_0x193466[_0x674f('0x2b')][_0x674f('0x2c')]};});_0x176eb3[_0x674f('0x2d')]=_[_0x674f('0x2e')](_0x45ed4f,_0x674f('0x28'));_0x176eb3[_0x674f('0x2f')]=_[_0x674f('0x30')](_0x577969['query']);_0x176eb3['filters']=_[_0x674f('0x31')](_0x176eb3[_0x674f('0x2d')],_0x176eb3[_0x674f('0x2f')]);_0x85244e[_0x674f('0x32')]=_[_0x674f('0x31')](_0x176eb3[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x577969[_0x674f('0x2f')][_0x674f('0x33')]));_0x85244e['attributes']=_0x85244e[_0x674f('0x32')][_0x674f('0x34')]?_0x85244e[_0x674f('0x32')]:_0x176eb3[_0x674f('0x2d')];if(!_0x577969[_0x674f('0x2f')][_0x674f('0x35')]('nolimit')){_0x85244e[_0x674f('0x1f')]=qs[_0x674f('0x1f')](_0x577969[_0x674f('0x2f')][_0x674f('0x1f')]);_0x85244e[_0x674f('0x1c')]=qs[_0x674f('0x1c')](_0x577969[_0x674f('0x2f')][_0x674f('0x1c')]);}_0x85244e[_0x674f('0x36')]=qs[_0x674f('0x37')](_0x577969[_0x674f('0x2f')]['sort']);_0x85244e[_0x674f('0x38')]=qs['filters'](_['pick'](_0x577969[_0x674f('0x2f')],_0x176eb3[_0x674f('0x39')]),_0x45ed4f);if(_0x577969[_0x674f('0x2f')]['filter']){_0x85244e[_0x674f('0x38')]=_['merge'](_0x85244e['where'],{'$or':_[_0x674f('0x2e')](_0x45ed4f,function(_0xed584){if(_0xed584[_0x674f('0x2b')]!==_0x674f('0x3a')){var _0x5419c9={};_0x5419c9[_0xed584[_0x674f('0x28')]]={'$like':'%'+_0x577969[_0x674f('0x2f')][_0x674f('0x3b')]+'%'};return _0x5419c9;}})});}_0x85244e=_['merge']({},_0x85244e,_0x577969[_0x674f('0x3c')]);var _0x38b7f2={'where':_0x85244e[_0x674f('0x38')]};return db[_0x674f('0x2a')][_0x674f('0x1e')](_0x38b7f2)[_0x674f('0x23')](function(_0x52c324){_0x3430e3[_0x674f('0x1e')]=_0x52c324;if(_0x577969[_0x674f('0x2f')][_0x674f('0x3d')]){_0x85244e[_0x674f('0x3e')]=[{'all':!![]}];}return db[_0x674f('0x2a')][_0x674f('0x3f')](_0x85244e);})['then'](function(_0x5e8271){_0x3430e3[_0x674f('0x40')]=_0x5e8271;return _0x3430e3;})['then'](respondWithFilteredResult(_0x3fe337,_0x85244e))['catch'](handleError(_0x3fe337,null));};exports['show']=function(_0x45a242,_0x4f279e){var _0x2800da={'raw':![],'where':{'id':_0x45a242[_0x674f('0x41')]['id']}},_0x369da3={};_0x369da3[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x2a')][_0x674f('0x42')]);_0x369da3['query']=_[_0x674f('0x30')](_0x45a242['query']);_0x369da3['filters']=_[_0x674f('0x31')](_0x369da3[_0x674f('0x2d')],_0x369da3['query']);_0x2800da[_0x674f('0x32')]=_[_0x674f('0x31')](_0x369da3[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x45a242[_0x674f('0x2f')][_0x674f('0x33')]));_0x2800da[_0x674f('0x32')]=_0x2800da[_0x674f('0x32')][_0x674f('0x34')]?_0x2800da[_0x674f('0x32')]:_0x369da3[_0x674f('0x2d')];if(_0x45a242[_0x674f('0x2f')]['includeAll']){_0x2800da[_0x674f('0x3e')]=[{'all':!![]}];}_0x2800da=_[_0x674f('0x43')]({},_0x2800da,_0x45a242[_0x674f('0x3c')]);return db[_0x674f('0x2a')]['find'](_0x2800da)[_0x674f('0x23')](handleEntityNotFound(_0x4f279e,null))[_0x674f('0x23')](respondWithResult(_0x4f279e,null))[_0x674f('0x44')](handleError(_0x4f279e,null));};exports[_0x674f('0x45')]=function(_0x202fc1,_0x1faa27){return db[_0x674f('0x2a')][_0x674f('0x45')](_0x202fc1[_0x674f('0x46')],{})[_0x674f('0x23')](function(_0x2215ff){var _0x2ed990=_0x202fc1[_0x674f('0x47')][_0x674f('0x25')]({'plain':!![]});if(!_0x2ed990)throw new Error(_0x674f('0x48'));if(_0x2ed990[_0x674f('0x49')]==='user'){var _0x37c090=_0x2215ff[_0x674f('0x25')]({'plain':!![]});var _0x533121=_0x674f('0x26');return db[_0x674f('0x4a')][_0x674f('0x4b')]({'where':{'name':_0x533121,'userProfileId':_0x2ed990['userProfileId']},'raw':!![]})[_0x674f('0x23')](function(_0x6d3b81){if(_0x6d3b81&&_0x6d3b81[_0x674f('0x4c')]===0x0){return db['UserProfileResource'][_0x674f('0x45')]({'name':_0x37c090['name'],'resourceId':_0x37c090['id'],'type':_0x6d3b81[_0x674f('0x28')],'sectionId':_0x6d3b81['id']},{})['then'](function(){return _0x2215ff;});}else{return _0x2215ff;}})[_0x674f('0x44')](function(_0x29be8e){logger[_0x674f('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29be8e);throw _0x29be8e;});}return _0x2215ff;})[_0x674f('0x23')](respondWithResult(_0x1faa27,0xc9))[_0x674f('0x44')](handleError(_0x1faa27,null));};exports[_0x674f('0x4e')]=function(_0x187172,_0x61491a){var _0x22fc25={'where':{'id':_0x187172[_0x674f('0x41')]['id']}},_0xe65d92={};_0xe65d92['model']=_[_0x674f('0x30')](db['Campaign']['rawAttributes']);_0x22fc25[_0x674f('0x32')]=_[_0x674f('0x31')](_0xe65d92[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x187172[_0x674f('0x2f')][_0x674f('0x33')]));_0x22fc25['attributes']=_0x22fc25[_0x674f('0x32')][_0x674f('0x34')]?_0x22fc25[_0x674f('0x32')]:_0xe65d92[_0x674f('0x2d')];if(_0x187172[_0x674f('0x2f')]['includeAll']){_0x22fc25[_0x674f('0x3e')]=[{'all':!![]}];}_0x22fc25=_[_0x674f('0x43')]({},_0x22fc25,_0x187172['options']);return db[_0x674f('0x2a')][_0x674f('0x4b')](_0x22fc25)[_0x674f('0x23')](handleEntityNotFound(_0x61491a,null))[_0x674f('0x23')](function(_0x77f76d){if(_0x77f76d){var _0x3b9610=_0x77f76d[_0x674f('0x25')]({'plain':!![]});_0x3b9610=qs[_0x674f('0x4f')](_0x3b9610,['id',_0x674f('0x50'),_0x674f('0x51')]);_0x187172[_0x674f('0x46')]=_['omit'](_0x187172[_0x674f('0x46')],['id',_0x674f('0x50'),_0x674f('0x51')]);return db[_0x674f('0x2a')][_0x674f('0x45')](_[_0x674f('0x43')](_0x3b9610,_0x187172[_0x674f('0x46')]),{'include':_0x187172['query'][_0x674f('0x3d')]?[{'all':!![]}]:undefined})[_0x674f('0x23')](function(_0x4d0e41){var _0x336647=_0x187172['user'][_0x674f('0x25')]({'plain':!![]});if(!_0x336647)throw new Error(_0x674f('0x48'));if(_0x336647[_0x674f('0x49')]===_0x674f('0x47')){var _0x5085d4=_0x4d0e41[_0x674f('0x25')]({'plain':!![]});var _0x27195f=_0x674f('0x26');return db['UserProfileSection'][_0x674f('0x4b')]({'where':{'name':_0x27195f,'userProfileId':_0x336647[_0x674f('0x52')]},'raw':!![]})[_0x674f('0x23')](function(_0x246d88){if(_0x246d88&&_0x246d88[_0x674f('0x4c')]===0x0){return db['UserProfileResource'][_0x674f('0x45')]({'name':_0x5085d4[_0x674f('0x28')],'resourceId':_0x5085d4['id'],'type':_0x246d88[_0x674f('0x28')],'sectionId':_0x246d88['id']},{})[_0x674f('0x23')](function(){return _0x4d0e41;});}else{return _0x4d0e41;}})[_0x674f('0x44')](function(_0x433790){logger[_0x674f('0x4d')](_0x674f('0x53'),_0x433790);throw _0x433790;});}return _0x4d0e41;});}})['then'](respondWithResult(_0x61491a,0xc9))[_0x674f('0x44')](handleError(_0x61491a,null));};exports[_0x674f('0x22')]=function(_0xd8dd01,_0x521f2b){if(_0xd8dd01[_0x674f('0x46')]['id']){delete _0xd8dd01['body']['id'];}return db[_0x674f('0x2a')][_0x674f('0x4b')]({'where':{'id':_0xd8dd01['params']['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x521f2b,null))[_0x674f('0x23')](saveUpdates(_0xd8dd01[_0x674f('0x46')],null))['then'](respondWithResult(_0x521f2b,null))[_0x674f('0x44')](handleError(_0x521f2b,null));};exports[_0x674f('0x24')]=function(_0x368699,_0x3bd855){return db[_0x674f('0x2a')][_0x674f('0x4b')]({'where':{'id':_0x368699[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x3bd855,null))['then'](removeEntity(_0x3bd855,null))[_0x674f('0x44')](handleError(_0x3bd855,null));};exports['getHoppers']=function(_0x220f9f,_0x5e472e,_0x472c4c){var _0x65b646={'raw':!![],'where':{}};var _0x150510={};var _0x74276b={'count':0x0,'rows':[]};return db[_0x674f('0x2a')]['findOne']({'where':{'id':_0x220f9f[_0x674f('0x41')]['id']}})['then'](handleEntityNotFound(_0x5e472e,null))[_0x674f('0x23')](function(_0x28bbfa){if(_0x28bbfa){_0x150510['model']=_[_0x674f('0x30')](db[_0x674f('0x54')][_0x674f('0x42')]);_0x150510[_0x674f('0x2f')]=_[_0x674f('0x30')](_0x220f9f[_0x674f('0x2f')]);_0x150510[_0x674f('0x39')]=_['intersection'](_0x150510['model'],_0x150510[_0x674f('0x2f')]);_0x65b646['attributes']=_[_0x674f('0x31')](_0x150510[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x220f9f[_0x674f('0x2f')][_0x674f('0x33')]));_0x65b646[_0x674f('0x32')]=_0x65b646['attributes'][_0x674f('0x34')]?_0x65b646['attributes']:_0x150510[_0x674f('0x2d')];if(!_0x220f9f[_0x674f('0x2f')][_0x674f('0x35')](_0x674f('0x55'))){_0x65b646[_0x674f('0x1f')]=qs[_0x674f('0x1f')](_0x220f9f[_0x674f('0x2f')][_0x674f('0x1f')]);_0x65b646['offset']=qs['offset'](_0x220f9f[_0x674f('0x2f')]['offset']);}_0x65b646[_0x674f('0x36')]=qs['sort'](_0x220f9f[_0x674f('0x2f')][_0x674f('0x37')]);_0x65b646[_0x674f('0x38')]=qs['filters'](_[_0x674f('0x56')](_0x220f9f[_0x674f('0x2f')],_0x150510[_0x674f('0x39')]));_0x65b646[_0x674f('0x38')][_0x674f('0x57')]=_0x28bbfa['id'];if(_0x220f9f[_0x674f('0x2f')][_0x674f('0x3b')]){_0x65b646[_0x674f('0x38')]=_[_0x674f('0x43')](_0x65b646[_0x674f('0x38')],{'$or':_['map'](_0x65b646['attributes'],function(_0x10ebfe){var _0x37001={};_0x37001[_0x10ebfe]={'$like':'%'+_0x220f9f[_0x674f('0x2f')]['filter']+'%'};return _0x37001;})});}_0x65b646=_[_0x674f('0x43')]({},_0x65b646,_0x220f9f[_0x674f('0x3c')]);return db[_0x674f('0x54')][_0x674f('0x1e')]({'where':_0x65b646[_0x674f('0x38')]})[_0x674f('0x23')](function(_0x3c61d8){_0x74276b[_0x674f('0x1e')]=_0x3c61d8;if(_0x220f9f['query']['includeAll']){_0x65b646[_0x674f('0x3e')]=[{'all':!![]}];}return db['CmHopper'][_0x674f('0x3f')](_0x65b646);})['then'](function(_0x215b2f){_0x74276b['rows']=_0x215b2f;return _0x74276b;});}})['then'](respondWithFilteredResult(_0x5e472e,_0x65b646))['catch'](handleError(_0x5e472e,null));};exports[_0x674f('0x58')]=function(_0x428535,_0x3be4f9,_0x102f1d){var _0x208ee8={'raw':!![],'where':{}};var _0x31f117={};var _0x118dd5={'count':0x0,'rows':[]};return db[_0x674f('0x2a')][_0x674f('0x59')]({'where':{'id':_0x428535[_0x674f('0x41')]['id']}})['then'](handleEntityNotFound(_0x3be4f9,null))[_0x674f('0x23')](function(_0x29b8cc){if(_0x29b8cc){_0x31f117[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x5a')][_0x674f('0x42')]);_0x31f117[_0x674f('0x2f')]=_[_0x674f('0x30')](_0x428535[_0x674f('0x2f')]);_0x31f117[_0x674f('0x39')]=_[_0x674f('0x31')](_0x31f117['model'],_0x31f117['query']);_0x208ee8[_0x674f('0x32')]=_[_0x674f('0x31')](_0x31f117['model'],qs[_0x674f('0x33')](_0x428535[_0x674f('0x2f')][_0x674f('0x33')]));_0x208ee8[_0x674f('0x32')]=_0x208ee8[_0x674f('0x32')][_0x674f('0x34')]?_0x208ee8[_0x674f('0x32')]:_0x31f117['model'];if(!_0x428535[_0x674f('0x2f')]['hasOwnProperty']('nolimit')){_0x208ee8[_0x674f('0x1f')]=qs[_0x674f('0x1f')](_0x428535[_0x674f('0x2f')][_0x674f('0x1f')]);_0x208ee8['offset']=qs[_0x674f('0x1c')](_0x428535[_0x674f('0x2f')][_0x674f('0x1c')]);}_0x208ee8['order']=qs['sort'](_0x428535[_0x674f('0x2f')]['sort']);_0x208ee8['where']=qs[_0x674f('0x39')](_[_0x674f('0x56')](_0x428535['query'],_0x31f117['filters']));_0x208ee8[_0x674f('0x38')]['CampaignId']=_0x29b8cc['id'];if(_0x428535[_0x674f('0x2f')][_0x674f('0x3b')]){_0x208ee8[_0x674f('0x38')]=_[_0x674f('0x43')](_0x208ee8[_0x674f('0x38')],{'$or':_[_0x674f('0x2e')](_0x208ee8['attributes'],function(_0x4e636c){var _0x2aa5db={};_0x2aa5db[_0x4e636c]={'$like':'%'+_0x428535[_0x674f('0x2f')]['filter']+'%'};return _0x2aa5db;})});}_0x208ee8=_[_0x674f('0x43')]({},_0x208ee8,_0x428535[_0x674f('0x3c')]);return db['CmHopperHistory'][_0x674f('0x1e')]({'where':_0x208ee8[_0x674f('0x38')]})[_0x674f('0x23')](function(_0x24611a){_0x118dd5[_0x674f('0x1e')]=_0x24611a;if(_0x428535[_0x674f('0x2f')][_0x674f('0x3d')]){_0x208ee8[_0x674f('0x3e')]=[{'all':!![]}];}return db[_0x674f('0x5a')][_0x674f('0x3f')](_0x208ee8);})[_0x674f('0x23')](function(_0x495b41){_0x118dd5[_0x674f('0x40')]=_0x495b41;return _0x118dd5;});}})['then'](respondWithFilteredResult(_0x3be4f9,_0x208ee8))[_0x674f('0x44')](handleError(_0x3be4f9,null));};exports[_0x674f('0x5b')]=function(_0x5f8457,_0x2e645b,_0x1c3e2b){var _0x528783={'raw':!![],'where':{}};var _0x5ec4fe={};var _0x1c47ad={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x5f8457[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x2e645b,null))[_0x674f('0x23')](function(_0x1dce8e){if(_0x1dce8e){_0x5ec4fe[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x5c')][_0x674f('0x42')]);_0x5ec4fe[_0x674f('0x2f')]=_['keys'](_0x5f8457['query']);_0x5ec4fe[_0x674f('0x39')]=_[_0x674f('0x31')](_0x5ec4fe['model'],_0x5ec4fe[_0x674f('0x2f')]);_0x528783[_0x674f('0x32')]=_['intersection'](_0x5ec4fe[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x5f8457['query'][_0x674f('0x33')]));_0x528783[_0x674f('0x32')]=_0x528783[_0x674f('0x32')]['length']?_0x528783[_0x674f('0x32')]:_0x5ec4fe['model'];if(!_0x5f8457[_0x674f('0x2f')]['hasOwnProperty'](_0x674f('0x55'))){_0x528783['limit']=qs[_0x674f('0x1f')](_0x5f8457[_0x674f('0x2f')][_0x674f('0x1f')]);_0x528783[_0x674f('0x1c')]=qs[_0x674f('0x1c')](_0x5f8457['query'][_0x674f('0x1c')]);}_0x528783['order']=qs[_0x674f('0x37')](_0x5f8457['query']['sort']);_0x528783[_0x674f('0x38')]=qs['filters'](_[_0x674f('0x56')](_0x5f8457[_0x674f('0x2f')],_0x5ec4fe['filters']));_0x528783['where'][_0x674f('0x57')]=_0x1dce8e['id'];if(_0x5f8457['query'][_0x674f('0x3b')]){_0x528783[_0x674f('0x38')]=_[_0x674f('0x43')](_0x528783['where'],{'$or':_[_0x674f('0x2e')](_0x528783[_0x674f('0x32')],function(_0x362dcf){var _0x170de8={};_0x170de8[_0x362dcf]={'$like':'%'+_0x5f8457[_0x674f('0x2f')][_0x674f('0x3b')]+'%'};return _0x170de8;})});}_0x528783=_[_0x674f('0x43')]({},_0x528783,_0x5f8457['options']);return db[_0x674f('0x5c')][_0x674f('0x1e')]({'where':_0x528783[_0x674f('0x38')]})[_0x674f('0x23')](function(_0x566278){_0x1c47ad[_0x674f('0x1e')]=_0x566278;if(_0x5f8457[_0x674f('0x2f')][_0x674f('0x3d')]){_0x528783[_0x674f('0x3e')]=[{'all':!![]}];}return db[_0x674f('0x5c')][_0x674f('0x3f')](_0x528783);})[_0x674f('0x23')](function(_0x4916aa){_0x1c47ad[_0x674f('0x40')]=_0x4916aa;return _0x1c47ad;});}})[_0x674f('0x23')](respondWithFilteredResult(_0x2e645b,_0x528783))[_0x674f('0x44')](handleError(_0x2e645b,null));};exports['getHopperBlacks']=function(_0x57715f,_0x214676,_0xd527d3){var _0x271c41={'raw':!![],'where':{}};var _0x5397b4={};var _0x235aed={'count':0x0,'rows':[]};return db[_0x674f('0x2a')][_0x674f('0x59')]({'where':{'id':_0x57715f[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x214676,null))[_0x674f('0x23')](function(_0x1f5ff4){if(_0x1f5ff4){_0x5397b4['model']=_[_0x674f('0x30')](db[_0x674f('0x5d')][_0x674f('0x42')]);_0x5397b4[_0x674f('0x2f')]=_[_0x674f('0x30')](_0x57715f[_0x674f('0x2f')]);_0x5397b4[_0x674f('0x39')]=_['intersection'](_0x5397b4['model'],_0x5397b4['query']);_0x271c41['attributes']=_[_0x674f('0x31')](_0x5397b4[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x57715f[_0x674f('0x2f')][_0x674f('0x33')]));_0x271c41['attributes']=_0x271c41['attributes']['length']?_0x271c41[_0x674f('0x32')]:_0x5397b4[_0x674f('0x2d')];if(!_0x57715f[_0x674f('0x2f')][_0x674f('0x35')](_0x674f('0x55'))){_0x271c41[_0x674f('0x1f')]=qs['limit'](_0x57715f[_0x674f('0x2f')][_0x674f('0x1f')]);_0x271c41[_0x674f('0x1c')]=qs['offset'](_0x57715f[_0x674f('0x2f')]['offset']);}_0x271c41[_0x674f('0x36')]=qs[_0x674f('0x37')](_0x57715f[_0x674f('0x2f')]['sort']);_0x271c41['where']=qs[_0x674f('0x39')](_[_0x674f('0x56')](_0x57715f[_0x674f('0x2f')],_0x5397b4['filters']));_0x271c41['where'][_0x674f('0x57')]=_0x1f5ff4['id'];if(_0x57715f[_0x674f('0x2f')][_0x674f('0x3b')]){_0x271c41[_0x674f('0x38')]=_[_0x674f('0x43')](_0x271c41[_0x674f('0x38')],{'$or':_[_0x674f('0x2e')](_0x271c41[_0x674f('0x32')],function(_0x1a4946){var _0x3319f9={};_0x3319f9[_0x1a4946]={'$like':'%'+_0x57715f[_0x674f('0x2f')][_0x674f('0x3b')]+'%'};return _0x3319f9;})});}_0x271c41=_['merge']({},_0x271c41,_0x57715f[_0x674f('0x3c')]);return db[_0x674f('0x5d')][_0x674f('0x1e')]({'where':_0x271c41[_0x674f('0x38')]})[_0x674f('0x23')](function(_0x1c9081){_0x235aed[_0x674f('0x1e')]=_0x1c9081;if(_0x57715f['query'][_0x674f('0x3d')]){_0x271c41[_0x674f('0x3e')]=[{'all':!![]}];}return db[_0x674f('0x5d')][_0x674f('0x3f')](_0x271c41);})[_0x674f('0x23')](function(_0x4b7cf6){_0x235aed['rows']=_0x4b7cf6;return _0x235aed;});}})[_0x674f('0x23')](respondWithFilteredResult(_0x214676,_0x271c41))[_0x674f('0x44')](handleError(_0x214676,null));};exports[_0x674f('0x5e')]=function(_0x366cfe,_0x46a9c2,_0x194297){var _0x546544={};var _0x13f10d={};var _0x1f775b;var _0xb8f06c;return db[_0x674f('0x2a')][_0x674f('0x59')]({'where':{'id':_0x366cfe['params']['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x46a9c2,null))['then'](function(_0x51ffca){if(_0x51ffca){_0x1f775b=_0x51ffca;_0x13f10d[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x5f')][_0x674f('0x42')]);_0x13f10d[_0x674f('0x2f')]=_['keys'](_0x366cfe[_0x674f('0x2f')]);_0x13f10d[_0x674f('0x39')]=_[_0x674f('0x31')](_0x13f10d[_0x674f('0x2d')],_0x13f10d['query']);_0x546544[_0x674f('0x32')]=_[_0x674f('0x31')](_0x13f10d[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x366cfe[_0x674f('0x2f')][_0x674f('0x33')]));_0x546544['attributes']=_0x546544['attributes'][_0x674f('0x34')]?_0x546544[_0x674f('0x32')]:_0x13f10d[_0x674f('0x2d')];_0x546544[_0x674f('0x36')]=qs['sort'](_0x366cfe[_0x674f('0x2f')][_0x674f('0x37')]);_0x546544[_0x674f('0x38')]=qs[_0x674f('0x39')](_[_0x674f('0x56')](_0x366cfe['query'],_0x13f10d[_0x674f('0x39')]));if(_0x366cfe[_0x674f('0x2f')][_0x674f('0x3b')]){_0x546544[_0x674f('0x38')]=_[_0x674f('0x43')](_0x546544['where'],{'$or':_['map'](_0x546544[_0x674f('0x32')],function(_0x43df4a){var _0x5bf6dd={};_0x5bf6dd[_0x43df4a]={'$like':'%'+_0x366cfe['query']['filter']+'%'};return _0x5bf6dd;})});}_0x546544=_[_0x674f('0x43')]({},_0x546544,_0x366cfe[_0x674f('0x3c')]);return _0x1f775b[_0x674f('0x5e')](_0x546544);}})[_0x674f('0x23')](function(_0x38c16c){if(_0x38c16c){_0xb8f06c=_0x38c16c['length'];if(!_0x366cfe[_0x674f('0x2f')][_0x674f('0x35')](_0x674f('0x55'))){_0x546544['limit']=qs[_0x674f('0x1f')](_0x366cfe[_0x674f('0x2f')][_0x674f('0x1f')]);_0x546544[_0x674f('0x1c')]=qs[_0x674f('0x1c')](_0x366cfe['query']['offset']);}return _0x1f775b[_0x674f('0x5e')](_0x546544);}})[_0x674f('0x23')](function(_0x261fa3){if(_0x261fa3){return _0x261fa3?{'count':_0xb8f06c,'rows':_0x261fa3}:null;}})['then'](respondWithResult(_0x46a9c2,null))['catch'](handleError(_0x46a9c2,null));};exports[_0x674f('0x60')]=function(_0xe48ab4,_0x3a47ba,_0xc5f4b0){var _0x1573e8,_0x3f499b;return db[_0x674f('0x2a')][_0x674f('0x4b')]({'where':{'id':_0xe48ab4[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x3a47ba,null))[_0x674f('0x23')](function(_0x1d46e5){if(_0x1d46e5){_0x3f499b=_0x1d46e5;return _0x1d46e5[_0x674f('0x60')](_0xe48ab4['body'][_0x674f('0x61')],_[_0x674f('0x4f')](_0xe48ab4[_0x674f('0x46')],[_0x674f('0x61'),'id'])||{});}return null;})[_0x674f('0x62')](function(_0x31141e){var _0x15efe4;_0x1573e8=_0x31141e||[];var _0x41d094=[];if(_0x31141e){for(var _0x23613f=0x0;_0x23613f<_0x31141e[_0x674f('0x34')];_0x23613f+=0x1){var _0x3647b3=_0x31141e[_0x23613f]['get']({'plain':!![]});_0x3f499b[_0x674f('0x63')]=_0xe48ab4[_0x674f('0x46')][_0x674f('0x63')]?_0xe48ab4[_0x674f('0x46')][_0x674f('0x63')]:_0x3f499b[_0x674f('0x63')];switch(_0x3f499b['dialCheckDuplicateType']){case _0x674f('0x64'):_0x15efe4=squel[_0x674f('0x65')]()[_0x674f('0x66')](_0x674f('0x67'))[_0x674f('0x68')]([_0x674f('0x69'),'scheduledAt',_0x674f('0x6a'),_0x674f('0x6b'),_0x674f('0x57'),'createdAt',_0x674f('0x51')],squel[_0x674f('0x6c')]()[_0x674f('0x6d')](_0x674f('0x69'),_0x674f('0x69'))[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x6f'))[_0x674f('0x6d')]('id',_0x674f('0x6a'))['field'](_0x3647b3['CmListId'][_0x674f('0x70')](),_0x674f('0x6b'))[_0x674f('0x6d')](_0xe48ab4[_0x674f('0x41')]['id'][_0x674f('0x70')](),_0x674f('0x57'))[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x50'))[_0x674f('0x6d')](_0x674f('0x6e'),'updatedAt')[_0x674f('0x71')](_0x674f('0x72'))[_0x674f('0x38')](_0x674f('0x73'))[_0x674f('0x38')](_0x674f('0x74'),_0x3647b3[_0x674f('0x75')][_0x674f('0x70')]())[_0x674f('0x38')](_0x674f('0x76'))[_0x674f('0x38')](_0x674f('0x77'),squel['select']()[_0x674f('0x6d')](_0x674f('0x78'))[_0x674f('0x71')](_0x674f('0x79'))['where'](_0x674f('0x7a'),_0xe48ab4['params']['id'][_0x674f('0x70')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x674f('0x6c')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x674f('0x67'))[_0x674f('0x38')]('CampaignId\x20=\x20?',_0xe48ab4[_0x674f('0x41')]['id'][_0x674f('0x70')]())))[_0x674f('0x70')]();break;case _0x674f('0x7b'):_0x15efe4=squel[_0x674f('0x65')]()[_0x674f('0x66')](_0x674f('0x67'))[_0x674f('0x68')]([_0x674f('0x69'),_0x674f('0x6f'),_0x674f('0x6a'),_0x674f('0x6b'),_0x674f('0x57'),_0x674f('0x50'),_0x674f('0x51')],squel[_0x674f('0x6c')]()[_0x674f('0x6d')]('phone',_0x674f('0x69'))[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x6f'))[_0x674f('0x6d')]('id','ContactId')[_0x674f('0x6d')](_0x3647b3['CmListId']['toString'](),_0x674f('0x6b'))[_0x674f('0x6d')](_0xe48ab4['params']['id'][_0x674f('0x70')](),'CampaignId')['field']('NOW()',_0x674f('0x50'))['field'](_0x674f('0x6e'),_0x674f('0x51'))[_0x674f('0x71')](_0x674f('0x72'))[_0x674f('0x38')](_0x674f('0x73'))[_0x674f('0x38')]('ListId\x20=\x20?',_0x3647b3['CmListId'][_0x674f('0x70')]())[_0x674f('0x38')](_0x674f('0x76'))[_0x674f('0x38')](_0x674f('0x77'),squel[_0x674f('0x6c')]()['field'](_0x674f('0x7c'))['from'](_0x674f('0x67'))[_0x674f('0x38')](_0x674f('0x7a'),_0xe48ab4[_0x674f('0x41')]['id'][_0x674f('0x70')]())))['toString']();break;default:_0x15efe4=squel['insert']()[_0x674f('0x66')](_0x674f('0x67'))[_0x674f('0x68')]([_0x674f('0x69'),'scheduledAt','ContactId','ListId','CampaignId','createdAt',_0x674f('0x51')],squel[_0x674f('0x6c')]()[_0x674f('0x6d')](_0x674f('0x69'),_0x674f('0x69'))[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x6f'))[_0x674f('0x6d')]('id',_0x674f('0x6a'))[_0x674f('0x6d')](_0x3647b3[_0x674f('0x75')][_0x674f('0x70')](),_0x674f('0x6b'))[_0x674f('0x6d')](_0xe48ab4[_0x674f('0x41')]['id'][_0x674f('0x70')](),'CampaignId')[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x50'))[_0x674f('0x6d')]('NOW()',_0x674f('0x51'))[_0x674f('0x71')](_0x674f('0x72'))[_0x674f('0x38')](_0x674f('0x73'))[_0x674f('0x38')](_0x674f('0x74'),_0x3647b3[_0x674f('0x75')][_0x674f('0x70')]())[_0x674f('0x38')](_0x674f('0x76')))[_0x674f('0x70')]();}_0x41d094['push'](db[_0x674f('0x7d')][_0x674f('0x2f')](_0x15efe4));}return BPromise[_0x674f('0x7e')](_0x41d094);}})['then'](function(){return _0x1573e8;})['then'](respondWithResult(_0x3a47ba,null))[_0x674f('0x44')](handleError(_0x3a47ba,null));};exports[_0x674f('0x7f')]=function(_0x44b3ed,_0x36c8f3,_0x5ebaa4){return db['Campaign'][_0x674f('0x4b')]({'where':{'id':_0x44b3ed['params']['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x36c8f3,null))['then'](function(_0x6a14c1){if(_0x6a14c1){return _0x6a14c1[_0x674f('0x7f')](_0x44b3ed[_0x674f('0x2f')][_0x674f('0x61')]);}})[_0x674f('0x23')](function(_0x51ba3c){if(_0x51ba3c){return db[_0x674f('0x54')]['destroy']({'where':{'ListId':_0x44b3ed[_0x674f('0x2f')][_0x674f('0x61')],'CampaignId':_0x44b3ed[_0x674f('0x41')]['id']}})[_0x674f('0x23')](function(){return _0x51ba3c;});}})['then'](respondWithStatusCode(_0x36c8f3,null))[_0x674f('0x44')](handleError(_0x36c8f3,null));};exports['getBlackLists']=function(_0x3c0d67,_0x3adf6c,_0x6d1d56){var _0x43a935={};var _0x32ede7={};var _0x2654b7;var _0x23ffd6;return db[_0x674f('0x2a')][_0x674f('0x59')]({'where':{'id':_0x3c0d67[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x3adf6c,null))[_0x674f('0x23')](function(_0x4edcf2){if(_0x4edcf2){_0x2654b7=_0x4edcf2;_0x32ede7[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x5f')]['rawAttributes']);_0x32ede7['query']=_[_0x674f('0x30')](_0x3c0d67[_0x674f('0x2f')]);_0x32ede7['filters']=_[_0x674f('0x31')](_0x32ede7[_0x674f('0x2d')],_0x32ede7[_0x674f('0x2f')]);_0x43a935[_0x674f('0x32')]=_['intersection'](_0x32ede7[_0x674f('0x2d')],qs['fields'](_0x3c0d67[_0x674f('0x2f')]['fields']));_0x43a935[_0x674f('0x32')]=_0x43a935[_0x674f('0x32')][_0x674f('0x34')]?_0x43a935[_0x674f('0x32')]:_0x32ede7[_0x674f('0x2d')];_0x43a935[_0x674f('0x36')]=qs[_0x674f('0x37')](_0x3c0d67[_0x674f('0x2f')][_0x674f('0x37')]);_0x43a935[_0x674f('0x38')]=qs[_0x674f('0x39')](_[_0x674f('0x56')](_0x3c0d67[_0x674f('0x2f')],_0x32ede7[_0x674f('0x39')]));if(_0x3c0d67[_0x674f('0x2f')]['filter']){_0x43a935[_0x674f('0x38')]=_['merge'](_0x43a935[_0x674f('0x38')],{'$or':_[_0x674f('0x2e')](_0x43a935[_0x674f('0x32')],function(_0x54a6c1){var _0x3cc910={};_0x3cc910[_0x54a6c1]={'$like':'%'+_0x3c0d67[_0x674f('0x2f')][_0x674f('0x3b')]+'%'};return _0x3cc910;})});}_0x43a935=_['merge']({},_0x43a935,_0x3c0d67['options']);return _0x2654b7[_0x674f('0x80')](_0x43a935);}})[_0x674f('0x23')](function(_0x119970){if(_0x119970){_0x23ffd6=_0x119970[_0x674f('0x34')];if(!_0x3c0d67[_0x674f('0x2f')][_0x674f('0x35')]('nolimit')){_0x43a935[_0x674f('0x1f')]=qs[_0x674f('0x1f')](_0x3c0d67[_0x674f('0x2f')][_0x674f('0x1f')]);_0x43a935[_0x674f('0x1c')]=qs[_0x674f('0x1c')](_0x3c0d67['query'][_0x674f('0x1c')]);}return _0x2654b7['getBlackLists'](_0x43a935);}})[_0x674f('0x23')](function(_0x677c19){if(_0x677c19){return _0x677c19?{'count':_0x23ffd6,'rows':_0x677c19}:null;}})['then'](respondWithResult(_0x3adf6c,null))[_0x674f('0x44')](handleError(_0x3adf6c,null));};exports[_0x674f('0x81')]=function(_0x264544,_0xe7f6a2,_0x3b7f89){var _0x5aef65,_0x15f942;return db['Campaign'][_0x674f('0x4b')]({'where':{'id':_0x264544[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0xe7f6a2,null))['then'](function(_0x42deca){if(_0x42deca){_0x15f942=_0x42deca;return _0x42deca[_0x674f('0x81')](_0x264544[_0x674f('0x46')][_0x674f('0x61')],_[_0x674f('0x4f')](_0x264544[_0x674f('0x46')],[_0x674f('0x61'),'id'])||{});}return null;})[_0x674f('0x62')](function(_0x2bb03f){var _0x226808;_0x5aef65=_0x2bb03f||[];var _0x1ed27a=[];if(_0x2bb03f){for(var _0x5ef5f7=0x0;_0x5ef5f7<_0x2bb03f[_0x674f('0x34')];_0x5ef5f7+=0x1){var _0x5b7309=_0x2bb03f[_0x5ef5f7]['get']({'plain':!![]});_0x226808=squel[_0x674f('0x65')]()[_0x674f('0x66')](_0x674f('0x82'))['fromQuery']([_0x674f('0x69'),_0x674f('0x6a'),_0x674f('0x6b'),_0x674f('0x57'),_0x674f('0x50'),_0x674f('0x51')],squel[_0x674f('0x6c')]()[_0x674f('0x6d')](_0x674f('0x69'),_0x674f('0x69'))['field']('id',_0x674f('0x6a'))[_0x674f('0x6d')](_0x5b7309['CmListId']['toString'](),_0x674f('0x6b'))[_0x674f('0x6d')](_0x264544[_0x674f('0x41')]['id'][_0x674f('0x70')](),_0x674f('0x57'))[_0x674f('0x6d')](_0x674f('0x6e'),'createdAt')[_0x674f('0x6d')]('NOW()','updatedAt')[_0x674f('0x71')](_0x674f('0x72'))[_0x674f('0x38')](_0x674f('0x73'))[_0x674f('0x38')](_0x674f('0x74'),_0x5b7309[_0x674f('0x75')]['toString']())[_0x674f('0x38')](_0x674f('0x76')))['toString']();_0x1ed27a[_0x674f('0x83')](db[_0x674f('0x7d')][_0x674f('0x2f')](_0x226808));}return BPromise[_0x674f('0x7e')](_0x1ed27a);}})[_0x674f('0x23')](function(){return _0x5aef65;})['then'](respondWithResult(_0xe7f6a2,null))['catch'](handleError(_0xe7f6a2,null));};exports[_0x674f('0x84')]=function(_0xe9a280,_0x145b11,_0x2220a0){return db[_0x674f('0x2a')]['find']({'where':{'id':_0xe9a280[_0x674f('0x41')]['id']}})['then'](handleEntityNotFound(_0x145b11,null))[_0x674f('0x23')](function(_0x5e4071){if(_0x5e4071){return _0x5e4071[_0x674f('0x84')](_0xe9a280[_0x674f('0x2f')][_0x674f('0x61')]);}})['then'](function(_0x15243b){if(_0x15243b){return db[_0x674f('0x5d')]['destroy']({'where':{'ListId':_0xe9a280[_0x674f('0x2f')][_0x674f('0x61')],'CampaignId':_0xe9a280['params']['id']}})[_0x674f('0x23')](function(){return _0x15243b;});}})['then'](respondWithStatusCode(_0x145b11,null))[_0x674f('0x44')](handleError(_0x145b11,null));};
\ No newline at end of file
+var _0x0b99=['end','json','undefined','limit','offset','count','apply','reject','save','update','then','get','IvrCampaigns','destroy','error','name','send','index','map','Campaign','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','order','sort','rows','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','fromQuery','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','cm_contacts','sequelize','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x0b99,0x6c));var _0x90b9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0b99[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x90b9('0x0'));var rimraf=require(_0x90b9('0x1'));var zipdir=require(_0x90b9('0x2'));var jsonpatch=require(_0x90b9('0x3'));var rp=require(_0x90b9('0x4'));var moment=require('moment');var BPromise=require(_0x90b9('0x5'));var Mustache=require(_0x90b9('0x6'));var util=require(_0x90b9('0x7'));var path=require(_0x90b9('0x8'));var sox=require(_0x90b9('0x9'));var csv=require(_0x90b9('0xa'));var ejs=require(_0x90b9('0xb'));var fs=require('fs');var fs_extra=require(_0x90b9('0xc'));var _=require('lodash');var squel=require(_0x90b9('0xd'));var crypto=require(_0x90b9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x90b9('0xf'));var toCsv=require(_0x90b9('0xa'));var querystring=require(_0x90b9('0x10'));var Papa=require('papaparse');var Redis=require(_0x90b9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x90b9('0x12'));var as=require(_0x90b9('0x13'));var hardwareService=require(_0x90b9('0x14'));var logger=require(_0x90b9('0x15'))(_0x90b9('0x16'));var utils=require('../../config/utils');var config=require(_0x90b9('0x17'));var licenseUtil=require(_0x90b9('0x18'));var db=require(_0x90b9('0x19'))['db'];function respondWithStatusCode(_0x605706,_0x32acc6){_0x32acc6=_0x32acc6||0xcc;return function(_0x5708bb){if(_0x5708bb){return _0x605706[_0x90b9('0x1a')](_0x32acc6);}return _0x605706[_0x90b9('0x1b')](_0x32acc6)[_0x90b9('0x1c')]();};}function respondWithResult(_0x4d99aa,_0x1a2fe9){_0x1a2fe9=_0x1a2fe9||0xc8;return function(_0x520abd){if(_0x520abd){return _0x4d99aa[_0x90b9('0x1b')](_0x1a2fe9)[_0x90b9('0x1d')](_0x520abd);}};}function respondWithFilteredResult(_0x357fb7,_0x41bc53){return function(_0x275f29){if(_0x275f29){var _0x26eb7f=typeof _0x41bc53['offset']===_0x90b9('0x1e')&&typeof _0x41bc53[_0x90b9('0x1f')]===_0x90b9('0x1e');var _0x3fa47b=_0x275f29['count'];var _0x20b499=_0x26eb7f?0x0:_0x41bc53[_0x90b9('0x20')];var _0x331cf0=_0x26eb7f?_0x275f29[_0x90b9('0x21')]:_0x41bc53[_0x90b9('0x20')]+_0x41bc53['limit'];var _0xc7cf8a;if(_0x331cf0>=_0x3fa47b){_0x331cf0=_0x3fa47b;_0xc7cf8a=0xc8;}else{_0xc7cf8a=0xce;}_0x357fb7[_0x90b9('0x1b')](_0xc7cf8a);return _0x357fb7['set']('Content-Range',_0x20b499+'-'+_0x331cf0+'/'+_0x3fa47b)[_0x90b9('0x1d')](_0x275f29);}return null;};}function patchUpdates(_0x3823a3){return function(_0x600ff1){try{jsonpatch[_0x90b9('0x22')](_0x600ff1,_0x3823a3,!![]);}catch(_0x57cf56){return BPromise[_0x90b9('0x23')](_0x57cf56);}return _0x600ff1[_0x90b9('0x24')]();};}function saveUpdates(_0xc1e793,_0x53f137){return function(_0x2a6f25){if(_0x2a6f25){return _0x2a6f25[_0x90b9('0x25')](_0xc1e793)[_0x90b9('0x26')](function(_0xca5d5f){return _0xca5d5f;});}return null;};}function removeEntity(_0x2e1dbc,_0x5676a2){return function(_0xdc0c3a){if(_0xdc0c3a){return _0xdc0c3a['destroy']()[_0x90b9('0x26')](function(){var _0x4f9f9a=_0xdc0c3a[_0x90b9('0x27')]({'plain':!![]});var _0x63f8bf=_0x90b9('0x28');return db['UserProfileResource'][_0x90b9('0x29')]({'where':{'type':_0x63f8bf,'resourceId':_0x4f9f9a['id']}})['then'](function(){return _0xdc0c3a;});})[_0x90b9('0x26')](function(){_0x2e1dbc[_0x90b9('0x1b')](0xcc)[_0x90b9('0x1c')]();});}};}function handleEntityNotFound(_0x5ebbb5,_0xe112b7){return function(_0xb4ce67){if(!_0xb4ce67){_0x5ebbb5[_0x90b9('0x1a')](0x194);}return _0xb4ce67;};}function handleError(_0x2aaeb4,_0x93044e){_0x93044e=_0x93044e||0x1f4;return function(_0xecbdb7){logger[_0x90b9('0x2a')](_0xecbdb7['stack']);if(_0xecbdb7[_0x90b9('0x2b')]){delete _0xecbdb7[_0x90b9('0x2b')];}_0x2aaeb4[_0x90b9('0x1b')](_0x93044e)[_0x90b9('0x2c')](_0xecbdb7);};}exports[_0x90b9('0x2d')]=function(_0x587c43,_0x4c5ec3){var _0x5aba6f={},_0x1ff9dd={},_0x295a52={'count':0x0,'rows':[]};var _0x176c98=_[_0x90b9('0x2e')](db[_0x90b9('0x2f')][_0x90b9('0x30')],function(_0x3a703d){return{'name':_0x3a703d['fieldName'],'type':_0x3a703d[_0x90b9('0x31')][_0x90b9('0x32')]};});_0x1ff9dd['model']=_[_0x90b9('0x2e')](_0x176c98,_0x90b9('0x2b'));_0x1ff9dd[_0x90b9('0x33')]=_['keys'](_0x587c43[_0x90b9('0x33')]);_0x1ff9dd[_0x90b9('0x34')]=_[_0x90b9('0x35')](_0x1ff9dd[_0x90b9('0x36')],_0x1ff9dd[_0x90b9('0x33')]);_0x5aba6f[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x1ff9dd[_0x90b9('0x36')],qs[_0x90b9('0x38')](_0x587c43[_0x90b9('0x33')][_0x90b9('0x38')]));_0x5aba6f[_0x90b9('0x37')]=_0x5aba6f[_0x90b9('0x37')][_0x90b9('0x39')]?_0x5aba6f[_0x90b9('0x37')]:_0x1ff9dd['model'];if(!_0x587c43[_0x90b9('0x33')][_0x90b9('0x3a')](_0x90b9('0x3b'))){_0x5aba6f[_0x90b9('0x1f')]=qs['limit'](_0x587c43[_0x90b9('0x33')][_0x90b9('0x1f')]);_0x5aba6f[_0x90b9('0x20')]=qs[_0x90b9('0x20')](_0x587c43[_0x90b9('0x33')][_0x90b9('0x20')]);}_0x5aba6f['order']=qs['sort'](_0x587c43[_0x90b9('0x33')]['sort']);_0x5aba6f['where']=qs['filters'](_[_0x90b9('0x3c')](_0x587c43[_0x90b9('0x33')],_0x1ff9dd[_0x90b9('0x34')]),_0x176c98);if(_0x587c43[_0x90b9('0x33')][_0x90b9('0x3d')]){_0x5aba6f[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0x5aba6f[_0x90b9('0x3e')],{'$or':_[_0x90b9('0x2e')](_0x176c98,function(_0x47a345){if(_0x47a345['type']!==_0x90b9('0x40')){var _0x37993c={};_0x37993c[_0x47a345[_0x90b9('0x2b')]]={'$like':'%'+_0x587c43[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x37993c;}})});}_0x5aba6f=_[_0x90b9('0x3f')]({},_0x5aba6f,_0x587c43[_0x90b9('0x41')]);var _0x2cdd84={'where':_0x5aba6f[_0x90b9('0x3e')]};return db[_0x90b9('0x2f')][_0x90b9('0x21')](_0x2cdd84)[_0x90b9('0x26')](function(_0x21f799){_0x295a52[_0x90b9('0x21')]=_0x21f799;if(_0x587c43['query'][_0x90b9('0x42')]){_0x5aba6f[_0x90b9('0x43')]=[{'all':!![]}];}return db['Campaign'][_0x90b9('0x44')](_0x5aba6f);})['then'](function(_0x19805f){_0x295a52['rows']=_0x19805f;return _0x295a52;})['then'](respondWithFilteredResult(_0x4c5ec3,_0x5aba6f))[_0x90b9('0x45')](handleError(_0x4c5ec3,null));};exports[_0x90b9('0x46')]=function(_0x50204a,_0x443fa7){var _0x3f2233={'raw':![],'where':{'id':_0x50204a[_0x90b9('0x47')]['id']}},_0x410070={};_0x410070[_0x90b9('0x36')]=_[_0x90b9('0x48')](db[_0x90b9('0x2f')]['rawAttributes']);_0x410070['query']=_[_0x90b9('0x48')](_0x50204a[_0x90b9('0x33')]);_0x410070[_0x90b9('0x34')]=_['intersection'](_0x410070[_0x90b9('0x36')],_0x410070['query']);_0x3f2233[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x410070[_0x90b9('0x36')],qs[_0x90b9('0x38')](_0x50204a[_0x90b9('0x33')][_0x90b9('0x38')]));_0x3f2233[_0x90b9('0x37')]=_0x3f2233[_0x90b9('0x37')][_0x90b9('0x39')]?_0x3f2233[_0x90b9('0x37')]:_0x410070['model'];if(_0x50204a[_0x90b9('0x33')]['includeAll']){_0x3f2233[_0x90b9('0x43')]=[{'all':!![]}];}_0x3f2233=_[_0x90b9('0x3f')]({},_0x3f2233,_0x50204a[_0x90b9('0x41')]);return db[_0x90b9('0x2f')][_0x90b9('0x49')](_0x3f2233)['then'](handleEntityNotFound(_0x443fa7,null))['then'](respondWithResult(_0x443fa7,null))[_0x90b9('0x45')](handleError(_0x443fa7,null));};exports[_0x90b9('0x4a')]=function(_0x4629d6,_0x20d05c){return db[_0x90b9('0x2f')][_0x90b9('0x4a')](_0x4629d6[_0x90b9('0x4b')],{})[_0x90b9('0x26')](function(_0xfdcf28){var _0x26eaf6=_0x4629d6[_0x90b9('0x4c')][_0x90b9('0x27')]({'plain':!![]});if(!_0x26eaf6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26eaf6[_0x90b9('0x4d')]==='user'){var _0x47bd07=_0xfdcf28[_0x90b9('0x27')]({'plain':!![]});var _0x567e4a='IvrCampaigns';return db[_0x90b9('0x4e')]['find']({'where':{'name':_0x567e4a,'userProfileId':_0x26eaf6[_0x90b9('0x4f')]},'raw':!![]})[_0x90b9('0x26')](function(_0x31f362){if(_0x31f362&&_0x31f362[_0x90b9('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x47bd07[_0x90b9('0x2b')],'resourceId':_0x47bd07['id'],'type':_0x31f362[_0x90b9('0x2b')],'sectionId':_0x31f362['id']},{})['then'](function(){return _0xfdcf28;});}else{return _0xfdcf28;}})[_0x90b9('0x45')](function(_0x4910c5){logger[_0x90b9('0x2a')](_0x90b9('0x51'),_0x4910c5);throw _0x4910c5;});}return _0xfdcf28;})[_0x90b9('0x26')](respondWithResult(_0x20d05c,0xc9))['catch'](handleError(_0x20d05c,null));};exports['clone']=function(_0x1a5bf6,_0x375e2e){var _0x39d3f5={'where':{'id':_0x1a5bf6[_0x90b9('0x47')]['id']}},_0x343013={};_0x343013[_0x90b9('0x36')]=_['keys'](db[_0x90b9('0x2f')][_0x90b9('0x30')]);_0x39d3f5['attributes']=_[_0x90b9('0x35')](_0x343013[_0x90b9('0x36')],qs[_0x90b9('0x38')](_0x1a5bf6['query']['fields']));_0x39d3f5[_0x90b9('0x37')]=_0x39d3f5[_0x90b9('0x37')][_0x90b9('0x39')]?_0x39d3f5[_0x90b9('0x37')]:_0x343013[_0x90b9('0x36')];if(_0x1a5bf6['query'][_0x90b9('0x42')]){_0x39d3f5[_0x90b9('0x43')]=[{'all':!![]}];}_0x39d3f5=_[_0x90b9('0x3f')]({},_0x39d3f5,_0x1a5bf6[_0x90b9('0x41')]);return db[_0x90b9('0x2f')][_0x90b9('0x49')](_0x39d3f5)[_0x90b9('0x26')](handleEntityNotFound(_0x375e2e,null))[_0x90b9('0x26')](function(_0x112ce9){if(_0x112ce9){var _0x2594dd=_0x112ce9[_0x90b9('0x27')]({'plain':!![]});_0x2594dd=qs[_0x90b9('0x52')](_0x2594dd,['id','createdAt',_0x90b9('0x53')]);_0x1a5bf6['body']=_[_0x90b9('0x52')](_0x1a5bf6[_0x90b9('0x4b')],['id',_0x90b9('0x54'),_0x90b9('0x53')]);return db['Campaign'][_0x90b9('0x4a')](_[_0x90b9('0x3f')](_0x2594dd,_0x1a5bf6[_0x90b9('0x4b')]),{'include':_0x1a5bf6[_0x90b9('0x33')][_0x90b9('0x42')]?[{'all':!![]}]:undefined})[_0x90b9('0x26')](function(_0x121308){var _0x11aef6=_0x1a5bf6[_0x90b9('0x4c')][_0x90b9('0x27')]({'plain':!![]});if(!_0x11aef6)throw new Error(_0x90b9('0x55'));if(_0x11aef6[_0x90b9('0x4d')]===_0x90b9('0x4c')){var _0x1d34a0=_0x121308[_0x90b9('0x27')]({'plain':!![]});var _0x47f693=_0x90b9('0x28');return db['UserProfileSection'][_0x90b9('0x49')]({'where':{'name':_0x47f693,'userProfileId':_0x11aef6[_0x90b9('0x4f')]},'raw':!![]})[_0x90b9('0x26')](function(_0x6863c7){if(_0x6863c7&&_0x6863c7[_0x90b9('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1d34a0['name'],'resourceId':_0x1d34a0['id'],'type':_0x6863c7[_0x90b9('0x2b')],'sectionId':_0x6863c7['id']},{})[_0x90b9('0x26')](function(){return _0x121308;});}else{return _0x121308;}})[_0x90b9('0x45')](function(_0x35eac9){logger[_0x90b9('0x2a')](_0x90b9('0x51'),_0x35eac9);throw _0x35eac9;});}return _0x121308;});}})[_0x90b9('0x26')](respondWithResult(_0x375e2e,0xc9))[_0x90b9('0x45')](handleError(_0x375e2e,null));};exports[_0x90b9('0x25')]=function(_0x459b55,_0x493298){if(_0x459b55[_0x90b9('0x4b')]['id']){delete _0x459b55[_0x90b9('0x4b')]['id'];}return db[_0x90b9('0x2f')][_0x90b9('0x49')]({'where':{'id':_0x459b55[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x493298,null))[_0x90b9('0x26')](saveUpdates(_0x459b55[_0x90b9('0x4b')],null))['then'](respondWithResult(_0x493298,null))[_0x90b9('0x45')](handleError(_0x493298,null));};exports['destroy']=function(_0x574009,_0x2fdcdf){return db[_0x90b9('0x2f')][_0x90b9('0x49')]({'where':{'id':_0x574009[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fdcdf,null))[_0x90b9('0x26')](removeEntity(_0x2fdcdf,null))[_0x90b9('0x45')](handleError(_0x2fdcdf,null));};exports[_0x90b9('0x56')]=function(_0x2b2a0b,_0x12a967,_0x3f19da){var _0xec6d1c={'raw':!![],'where':{}};var _0x3c9098={};var _0x3bed87={'count':0x0,'rows':[]};return db[_0x90b9('0x2f')]['findOne']({'where':{'id':_0x2b2a0b[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x12a967,null))[_0x90b9('0x26')](function(_0x2a1acc){if(_0x2a1acc){_0x3c9098['model']=_[_0x90b9('0x48')](db[_0x90b9('0x57')]['rawAttributes']);_0x3c9098[_0x90b9('0x33')]=_[_0x90b9('0x48')](_0x2b2a0b[_0x90b9('0x33')]);_0x3c9098[_0x90b9('0x34')]=_[_0x90b9('0x35')](_0x3c9098[_0x90b9('0x36')],_0x3c9098[_0x90b9('0x33')]);_0xec6d1c[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x3c9098['model'],qs[_0x90b9('0x38')](_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x38')]));_0xec6d1c[_0x90b9('0x37')]=_0xec6d1c[_0x90b9('0x37')][_0x90b9('0x39')]?_0xec6d1c[_0x90b9('0x37')]:_0x3c9098[_0x90b9('0x36')];if(!_0x2b2a0b['query']['hasOwnProperty'](_0x90b9('0x3b'))){_0xec6d1c['limit']=qs[_0x90b9('0x1f')](_0x2b2a0b[_0x90b9('0x33')]['limit']);_0xec6d1c[_0x90b9('0x20')]=qs[_0x90b9('0x20')](_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x20')]);}_0xec6d1c[_0x90b9('0x58')]=qs[_0x90b9('0x59')](_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x59')]);_0xec6d1c['where']=qs[_0x90b9('0x34')](_['pick'](_0x2b2a0b[_0x90b9('0x33')],_0x3c9098[_0x90b9('0x34')]));_0xec6d1c[_0x90b9('0x3e')]['CampaignId']=_0x2a1acc['id'];if(_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x3d')]){_0xec6d1c[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0xec6d1c[_0x90b9('0x3e')],{'$or':_['map'](_0xec6d1c[_0x90b9('0x37')],function(_0x1198b4){var _0x83f61f={};_0x83f61f[_0x1198b4]={'$like':'%'+_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x83f61f;})});}_0xec6d1c=_[_0x90b9('0x3f')]({},_0xec6d1c,_0x2b2a0b[_0x90b9('0x41')]);return db[_0x90b9('0x57')][_0x90b9('0x21')]({'where':_0xec6d1c[_0x90b9('0x3e')]})[_0x90b9('0x26')](function(_0x1a953a){_0x3bed87[_0x90b9('0x21')]=_0x1a953a;if(_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x42')]){_0xec6d1c[_0x90b9('0x43')]=[{'all':!![]}];}return db[_0x90b9('0x57')][_0x90b9('0x44')](_0xec6d1c);})[_0x90b9('0x26')](function(_0x21138b){_0x3bed87[_0x90b9('0x5a')]=_0x21138b;return _0x3bed87;});}})['then'](respondWithFilteredResult(_0x12a967,_0xec6d1c))['catch'](handleError(_0x12a967,null));};exports[_0x90b9('0x5b')]=function(_0x75305c,_0x411d8e,_0x1ed7b4){var _0xac41d={'raw':!![],'where':{}};var _0x16451f={};var _0x4cb514={'count':0x0,'rows':[]};return db[_0x90b9('0x2f')][_0x90b9('0x5c')]({'where':{'id':_0x75305c[_0x90b9('0x47')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x411d8e,null))[_0x90b9('0x26')](function(_0x44914b){if(_0x44914b){_0x16451f['model']=_[_0x90b9('0x48')](db[_0x90b9('0x5d')][_0x90b9('0x30')]);_0x16451f[_0x90b9('0x33')]=_[_0x90b9('0x48')](_0x75305c[_0x90b9('0x33')]);_0x16451f[_0x90b9('0x34')]=_['intersection'](_0x16451f[_0x90b9('0x36')],_0x16451f[_0x90b9('0x33')]);_0xac41d['attributes']=_['intersection'](_0x16451f[_0x90b9('0x36')],qs['fields'](_0x75305c[_0x90b9('0x33')]['fields']));_0xac41d[_0x90b9('0x37')]=_0xac41d[_0x90b9('0x37')][_0x90b9('0x39')]?_0xac41d[_0x90b9('0x37')]:_0x16451f['model'];if(!_0x75305c[_0x90b9('0x33')][_0x90b9('0x3a')]('nolimit')){_0xac41d[_0x90b9('0x1f')]=qs[_0x90b9('0x1f')](_0x75305c[_0x90b9('0x33')][_0x90b9('0x1f')]);_0xac41d['offset']=qs['offset'](_0x75305c['query'][_0x90b9('0x20')]);}_0xac41d['order']=qs['sort'](_0x75305c[_0x90b9('0x33')][_0x90b9('0x59')]);_0xac41d[_0x90b9('0x3e')]=qs[_0x90b9('0x34')](_[_0x90b9('0x3c')](_0x75305c['query'],_0x16451f[_0x90b9('0x34')]));_0xac41d[_0x90b9('0x3e')][_0x90b9('0x5e')]=_0x44914b['id'];if(_0x75305c[_0x90b9('0x33')]['filter']){_0xac41d[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0xac41d[_0x90b9('0x3e')],{'$or':_['map'](_0xac41d[_0x90b9('0x37')],function(_0x5de29f){var _0x215e6a={};_0x215e6a[_0x5de29f]={'$like':'%'+_0x75305c[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x215e6a;})});}_0xac41d=_['merge']({},_0xac41d,_0x75305c[_0x90b9('0x41')]);return db[_0x90b9('0x5d')]['count']({'where':_0xac41d[_0x90b9('0x3e')]})['then'](function(_0x210b1d){_0x4cb514[_0x90b9('0x21')]=_0x210b1d;if(_0x75305c[_0x90b9('0x33')][_0x90b9('0x42')]){_0xac41d[_0x90b9('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x90b9('0x44')](_0xac41d);})['then'](function(_0x4db380){_0x4cb514[_0x90b9('0x5a')]=_0x4db380;return _0x4cb514;});}})[_0x90b9('0x26')](respondWithFilteredResult(_0x411d8e,_0xac41d))[_0x90b9('0x45')](handleError(_0x411d8e,null));};exports[_0x90b9('0x5f')]=function(_0x37b201,_0x5b5605,_0x212bdb){var _0x54c922={'raw':!![],'where':{}};var _0x10d484={};var _0x3f1c9f={'count':0x0,'rows':[]};return db[_0x90b9('0x2f')][_0x90b9('0x5c')]({'where':{'id':_0x37b201[_0x90b9('0x47')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x5b5605,null))[_0x90b9('0x26')](function(_0x463a04){if(_0x463a04){_0x10d484[_0x90b9('0x36')]=_['keys'](db['CmHopperFinal'][_0x90b9('0x30')]);_0x10d484[_0x90b9('0x33')]=_[_0x90b9('0x48')](_0x37b201[_0x90b9('0x33')]);_0x10d484[_0x90b9('0x34')]=_['intersection'](_0x10d484[_0x90b9('0x36')],_0x10d484[_0x90b9('0x33')]);_0x54c922[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x10d484[_0x90b9('0x36')],qs['fields'](_0x37b201[_0x90b9('0x33')][_0x90b9('0x38')]));_0x54c922[_0x90b9('0x37')]=_0x54c922[_0x90b9('0x37')][_0x90b9('0x39')]?_0x54c922[_0x90b9('0x37')]:_0x10d484[_0x90b9('0x36')];if(!_0x37b201[_0x90b9('0x33')][_0x90b9('0x3a')]('nolimit')){_0x54c922[_0x90b9('0x1f')]=qs[_0x90b9('0x1f')](_0x37b201[_0x90b9('0x33')][_0x90b9('0x1f')]);_0x54c922[_0x90b9('0x20')]=qs[_0x90b9('0x20')](_0x37b201[_0x90b9('0x33')]['offset']);}_0x54c922[_0x90b9('0x58')]=qs['sort'](_0x37b201[_0x90b9('0x33')]['sort']);_0x54c922[_0x90b9('0x3e')]=qs['filters'](_[_0x90b9('0x3c')](_0x37b201['query'],_0x10d484['filters']));_0x54c922[_0x90b9('0x3e')][_0x90b9('0x5e')]=_0x463a04['id'];if(_0x37b201[_0x90b9('0x33')][_0x90b9('0x3d')]){_0x54c922[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0x54c922[_0x90b9('0x3e')],{'$or':_[_0x90b9('0x2e')](_0x54c922[_0x90b9('0x37')],function(_0x15fc95){var _0xeb714a={};_0xeb714a[_0x15fc95]={'$like':'%'+_0x37b201[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0xeb714a;})});}_0x54c922=_['merge']({},_0x54c922,_0x37b201[_0x90b9('0x41')]);return db[_0x90b9('0x60')][_0x90b9('0x21')]({'where':_0x54c922[_0x90b9('0x3e')]})[_0x90b9('0x26')](function(_0x9de99){_0x3f1c9f[_0x90b9('0x21')]=_0x9de99;if(_0x37b201[_0x90b9('0x33')][_0x90b9('0x42')]){_0x54c922[_0x90b9('0x43')]=[{'all':!![]}];}return db[_0x90b9('0x60')][_0x90b9('0x44')](_0x54c922);})['then'](function(_0x26f351){_0x3f1c9f[_0x90b9('0x5a')]=_0x26f351;return _0x3f1c9f;});}})['then'](respondWithFilteredResult(_0x5b5605,_0x54c922))[_0x90b9('0x45')](handleError(_0x5b5605,null));};exports[_0x90b9('0x61')]=function(_0xe601f4,_0x3bd441,_0x367472){var _0x270288={'raw':!![],'where':{}};var _0x2b1e2a={};var _0x50932d={'count':0x0,'rows':[]};return db['Campaign'][_0x90b9('0x5c')]({'where':{'id':_0xe601f4[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bd441,null))['then'](function(_0x59b8c3){if(_0x59b8c3){_0x2b1e2a['model']=_[_0x90b9('0x48')](db[_0x90b9('0x62')][_0x90b9('0x30')]);_0x2b1e2a[_0x90b9('0x33')]=_[_0x90b9('0x48')](_0xe601f4[_0x90b9('0x33')]);_0x2b1e2a[_0x90b9('0x34')]=_['intersection'](_0x2b1e2a[_0x90b9('0x36')],_0x2b1e2a[_0x90b9('0x33')]);_0x270288['attributes']=_['intersection'](_0x2b1e2a[_0x90b9('0x36')],qs[_0x90b9('0x38')](_0xe601f4[_0x90b9('0x33')][_0x90b9('0x38')]));_0x270288[_0x90b9('0x37')]=_0x270288[_0x90b9('0x37')]['length']?_0x270288['attributes']:_0x2b1e2a['model'];if(!_0xe601f4[_0x90b9('0x33')][_0x90b9('0x3a')](_0x90b9('0x3b'))){_0x270288[_0x90b9('0x1f')]=qs['limit'](_0xe601f4['query'][_0x90b9('0x1f')]);_0x270288['offset']=qs['offset'](_0xe601f4['query'][_0x90b9('0x20')]);}_0x270288[_0x90b9('0x58')]=qs['sort'](_0xe601f4[_0x90b9('0x33')][_0x90b9('0x59')]);_0x270288[_0x90b9('0x3e')]=qs[_0x90b9('0x34')](_[_0x90b9('0x3c')](_0xe601f4[_0x90b9('0x33')],_0x2b1e2a[_0x90b9('0x34')]));_0x270288[_0x90b9('0x3e')][_0x90b9('0x5e')]=_0x59b8c3['id'];if(_0xe601f4[_0x90b9('0x33')][_0x90b9('0x3d')]){_0x270288['where']=_[_0x90b9('0x3f')](_0x270288['where'],{'$or':_['map'](_0x270288[_0x90b9('0x37')],function(_0x5ed635){var _0xa8e4b5={};_0xa8e4b5[_0x5ed635]={'$like':'%'+_0xe601f4[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0xa8e4b5;})});}_0x270288=_['merge']({},_0x270288,_0xe601f4['options']);return db['CmHopperBlack']['count']({'where':_0x270288[_0x90b9('0x3e')]})[_0x90b9('0x26')](function(_0x466fb7){_0x50932d[_0x90b9('0x21')]=_0x466fb7;if(_0xe601f4[_0x90b9('0x33')]['includeAll']){_0x270288[_0x90b9('0x43')]=[{'all':!![]}];}return db[_0x90b9('0x62')]['findAll'](_0x270288);})[_0x90b9('0x26')](function(_0x4fad60){_0x50932d[_0x90b9('0x5a')]=_0x4fad60;return _0x50932d;});}})[_0x90b9('0x26')](respondWithFilteredResult(_0x3bd441,_0x270288))[_0x90b9('0x45')](handleError(_0x3bd441,null));};exports[_0x90b9('0x63')]=function(_0x40d0e4,_0x169b87,_0x63b034){var _0x272f0f={};var _0x1e8310={};var _0x22466e;var _0x5171c5;return db[_0x90b9('0x2f')]['findOne']({'where':{'id':_0x40d0e4['params']['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x169b87,null))[_0x90b9('0x26')](function(_0x483e2){if(_0x483e2){_0x22466e=_0x483e2;_0x1e8310[_0x90b9('0x36')]=_[_0x90b9('0x48')](db[_0x90b9('0x64')][_0x90b9('0x30')]);_0x1e8310[_0x90b9('0x33')]=_['keys'](_0x40d0e4[_0x90b9('0x33')]);_0x1e8310[_0x90b9('0x34')]=_[_0x90b9('0x35')](_0x1e8310[_0x90b9('0x36')],_0x1e8310[_0x90b9('0x33')]);_0x272f0f[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x1e8310[_0x90b9('0x36')],qs['fields'](_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x38')]));_0x272f0f[_0x90b9('0x37')]=_0x272f0f[_0x90b9('0x37')]['length']?_0x272f0f[_0x90b9('0x37')]:_0x1e8310[_0x90b9('0x36')];_0x272f0f['order']=qs[_0x90b9('0x59')](_0x40d0e4['query']['sort']);_0x272f0f[_0x90b9('0x3e')]=qs[_0x90b9('0x34')](_['pick'](_0x40d0e4['query'],_0x1e8310[_0x90b9('0x34')]));if(_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x3d')]){_0x272f0f[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0x272f0f[_0x90b9('0x3e')],{'$or':_['map'](_0x272f0f['attributes'],function(_0x52c6bd){var _0x360c4a={};_0x360c4a[_0x52c6bd]={'$like':'%'+_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x360c4a;})});}_0x272f0f=_[_0x90b9('0x3f')]({},_0x272f0f,_0x40d0e4[_0x90b9('0x41')]);return _0x22466e['getLists'](_0x272f0f);}})[_0x90b9('0x26')](function(_0x5d6f49){if(_0x5d6f49){_0x5171c5=_0x5d6f49['length'];if(!_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x3a')](_0x90b9('0x3b'))){_0x272f0f[_0x90b9('0x1f')]=qs[_0x90b9('0x1f')](_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x1f')]);_0x272f0f[_0x90b9('0x20')]=qs[_0x90b9('0x20')](_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x20')]);}return _0x22466e[_0x90b9('0x63')](_0x272f0f);}})[_0x90b9('0x26')](function(_0x99766f){if(_0x99766f){return _0x99766f?{'count':_0x5171c5,'rows':_0x99766f}:null;}})[_0x90b9('0x26')](respondWithResult(_0x169b87,null))[_0x90b9('0x45')](handleError(_0x169b87,null));};exports[_0x90b9('0x65')]=function(_0x52bd13,_0x5653eb,_0x405d87){var _0x3ce141,_0x3e116b;return db[_0x90b9('0x2f')]['find']({'where':{'id':_0x52bd13[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x5653eb,null))[_0x90b9('0x26')](function(_0x82e25){if(_0x82e25){_0x3e116b=_0x82e25;return _0x82e25[_0x90b9('0x65')](_0x52bd13['body']['ids'],_[_0x90b9('0x52')](_0x52bd13[_0x90b9('0x4b')],[_0x90b9('0x66'),'id'])||{});}return null;})[_0x90b9('0x67')](function(_0x193699){var _0x3934c3;_0x3ce141=_0x193699||[];var _0x4d503b=[];if(_0x193699){for(var _0x1e27c7=0x0;_0x1e27c7<_0x193699[_0x90b9('0x39')];_0x1e27c7+=0x1){var _0x38f686=_0x193699[_0x1e27c7][_0x90b9('0x27')]({'plain':!![]});_0x3e116b['dialCheckDuplicateType']=_0x52bd13[_0x90b9('0x4b')][_0x90b9('0x68')]?_0x52bd13[_0x90b9('0x4b')][_0x90b9('0x68')]:_0x3e116b[_0x90b9('0x68')];switch(_0x3e116b['dialCheckDuplicateType']){case'always':_0x3934c3=squel['insert']()[_0x90b9('0x69')](_0x90b9('0x6a'))['fromQuery']([_0x90b9('0x6b'),_0x90b9('0x6c'),_0x90b9('0x6d'),_0x90b9('0x6e'),_0x90b9('0x5e'),_0x90b9('0x54'),_0x90b9('0x53')],squel[_0x90b9('0x6f')]()[_0x90b9('0x70')]('phone',_0x90b9('0x6b'))[_0x90b9('0x70')]('NOW()',_0x90b9('0x6c'))[_0x90b9('0x70')]('id',_0x90b9('0x6d'))['field'](_0x38f686[_0x90b9('0x71')][_0x90b9('0x72')](),_0x90b9('0x6e'))[_0x90b9('0x70')](_0x52bd13[_0x90b9('0x47')]['id'][_0x90b9('0x72')](),'CampaignId')[_0x90b9('0x70')](_0x90b9('0x73'),'createdAt')[_0x90b9('0x70')](_0x90b9('0x73'),'updatedAt')[_0x90b9('0x74')]('cm_contacts')[_0x90b9('0x3e')](_0x90b9('0x75'))['where'](_0x90b9('0x76'),_0x38f686[_0x90b9('0x71')][_0x90b9('0x72')]())[_0x90b9('0x3e')](_0x90b9('0x77'))[_0x90b9('0x3e')](_0x90b9('0x78'),squel['select']()['field'](_0x90b9('0x79'))[_0x90b9('0x74')](_0x90b9('0x7a'))[_0x90b9('0x3e')](_0x90b9('0x7b'),_0x52bd13[_0x90b9('0x47')]['id'][_0x90b9('0x72')]()))[_0x90b9('0x3e')](_0x90b9('0x78'),squel[_0x90b9('0x6f')]()[_0x90b9('0x70')](_0x90b9('0x7c'))[_0x90b9('0x74')](_0x90b9('0x6a'))[_0x90b9('0x3e')](_0x90b9('0x7b'),_0x52bd13['params']['id'][_0x90b9('0x72')]())))[_0x90b9('0x72')]();break;case'onlyIfOpen':_0x3934c3=squel[_0x90b9('0x7d')]()[_0x90b9('0x69')](_0x90b9('0x6a'))['fromQuery'](['phone','scheduledAt',_0x90b9('0x6d'),_0x90b9('0x6e'),_0x90b9('0x5e'),_0x90b9('0x54'),_0x90b9('0x53')],squel['select']()['field']('phone',_0x90b9('0x6b'))['field'](_0x90b9('0x73'),_0x90b9('0x6c'))[_0x90b9('0x70')]('id','ContactId')['field'](_0x38f686[_0x90b9('0x71')][_0x90b9('0x72')](),'ListId')[_0x90b9('0x70')](_0x52bd13['params']['id'][_0x90b9('0x72')](),_0x90b9('0x5e'))[_0x90b9('0x70')](_0x90b9('0x73'),_0x90b9('0x54'))['field']('NOW()',_0x90b9('0x53'))['from']('cm_contacts')[_0x90b9('0x3e')](_0x90b9('0x75'))[_0x90b9('0x3e')](_0x90b9('0x76'),_0x38f686[_0x90b9('0x71')][_0x90b9('0x72')]())[_0x90b9('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x90b9('0x3e')](_0x90b9('0x78'),squel['select']()[_0x90b9('0x70')](_0x90b9('0x7c'))[_0x90b9('0x74')](_0x90b9('0x6a'))[_0x90b9('0x3e')](_0x90b9('0x7b'),_0x52bd13['params']['id'][_0x90b9('0x72')]())))[_0x90b9('0x72')]();break;default:_0x3934c3=squel[_0x90b9('0x7d')]()[_0x90b9('0x69')](_0x90b9('0x6a'))[_0x90b9('0x7e')]([_0x90b9('0x6b'),_0x90b9('0x6c'),_0x90b9('0x6d'),_0x90b9('0x6e'),_0x90b9('0x5e'),_0x90b9('0x54'),_0x90b9('0x53')],squel[_0x90b9('0x6f')]()['field'](_0x90b9('0x6b'),'phone')['field']('NOW()',_0x90b9('0x6c'))['field']('id',_0x90b9('0x6d'))['field'](_0x38f686['CmListId'][_0x90b9('0x72')](),_0x90b9('0x6e'))[_0x90b9('0x70')](_0x52bd13[_0x90b9('0x47')]['id'][_0x90b9('0x72')](),'CampaignId')[_0x90b9('0x70')]('NOW()',_0x90b9('0x54'))[_0x90b9('0x70')](_0x90b9('0x73'),_0x90b9('0x53'))[_0x90b9('0x74')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x90b9('0x3e')]('ListId\x20=\x20?',_0x38f686['CmListId']['toString']())[_0x90b9('0x3e')](_0x90b9('0x77')))['toString']();}_0x4d503b[_0x90b9('0x7f')](db['sequelize']['query'](_0x3934c3));}return BPromise['all'](_0x4d503b);}})[_0x90b9('0x26')](function(){return _0x3ce141;})['then'](respondWithResult(_0x5653eb,null))[_0x90b9('0x45')](handleError(_0x5653eb,null));};exports[_0x90b9('0x80')]=function(_0x524b3d,_0xba7f70,_0x5630db){return db[_0x90b9('0x2f')][_0x90b9('0x49')]({'where':{'id':_0x524b3d['params']['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0xba7f70,null))['then'](function(_0x38e6c2){if(_0x38e6c2){return _0x38e6c2[_0x90b9('0x80')](_0x524b3d['query'][_0x90b9('0x66')]);}})['then'](function(_0xbb8dd9){if(_0xbb8dd9){return db[_0x90b9('0x57')][_0x90b9('0x29')]({'where':{'ListId':_0x524b3d[_0x90b9('0x33')]['ids'],'CampaignId':_0x524b3d['params']['id']}})[_0x90b9('0x26')](function(){return _0xbb8dd9;});}})[_0x90b9('0x26')](respondWithStatusCode(_0xba7f70,null))[_0x90b9('0x45')](handleError(_0xba7f70,null));};exports[_0x90b9('0x81')]=function(_0x1c078d,_0x425fbf,_0x356ae4){var _0x4ac85d={};var _0x2b0ee3={};var _0x456a32;var _0x265b03;return db[_0x90b9('0x2f')]['findOne']({'where':{'id':_0x1c078d[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x425fbf,null))['then'](function(_0x3b3331){if(_0x3b3331){_0x456a32=_0x3b3331;_0x2b0ee3[_0x90b9('0x36')]=_['keys'](db[_0x90b9('0x64')][_0x90b9('0x30')]);_0x2b0ee3['query']=_[_0x90b9('0x48')](_0x1c078d[_0x90b9('0x33')]);_0x2b0ee3[_0x90b9('0x34')]=_[_0x90b9('0x35')](_0x2b0ee3[_0x90b9('0x36')],_0x2b0ee3[_0x90b9('0x33')]);_0x4ac85d[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x2b0ee3[_0x90b9('0x36')],qs['fields'](_0x1c078d['query'][_0x90b9('0x38')]));_0x4ac85d['attributes']=_0x4ac85d[_0x90b9('0x37')][_0x90b9('0x39')]?_0x4ac85d['attributes']:_0x2b0ee3[_0x90b9('0x36')];_0x4ac85d[_0x90b9('0x58')]=qs['sort'](_0x1c078d['query'][_0x90b9('0x59')]);_0x4ac85d[_0x90b9('0x3e')]=qs[_0x90b9('0x34')](_['pick'](_0x1c078d[_0x90b9('0x33')],_0x2b0ee3[_0x90b9('0x34')]));if(_0x1c078d['query'][_0x90b9('0x3d')]){_0x4ac85d['where']=_[_0x90b9('0x3f')](_0x4ac85d[_0x90b9('0x3e')],{'$or':_[_0x90b9('0x2e')](_0x4ac85d[_0x90b9('0x37')],function(_0x467204){var _0x1bbec7={};_0x1bbec7[_0x467204]={'$like':'%'+_0x1c078d[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x1bbec7;})});}_0x4ac85d=_[_0x90b9('0x3f')]({},_0x4ac85d,_0x1c078d[_0x90b9('0x41')]);return _0x456a32[_0x90b9('0x81')](_0x4ac85d);}})[_0x90b9('0x26')](function(_0x26241a){if(_0x26241a){_0x265b03=_0x26241a['length'];if(!_0x1c078d['query']['hasOwnProperty'](_0x90b9('0x3b'))){_0x4ac85d['limit']=qs['limit'](_0x1c078d[_0x90b9('0x33')]['limit']);_0x4ac85d[_0x90b9('0x20')]=qs['offset'](_0x1c078d['query'][_0x90b9('0x20')]);}return _0x456a32[_0x90b9('0x81')](_0x4ac85d);}})[_0x90b9('0x26')](function(_0x35ab2e){if(_0x35ab2e){return _0x35ab2e?{'count':_0x265b03,'rows':_0x35ab2e}:null;}})[_0x90b9('0x26')](respondWithResult(_0x425fbf,null))[_0x90b9('0x45')](handleError(_0x425fbf,null));};exports[_0x90b9('0x82')]=function(_0x3131a6,_0x3c4a45,_0x326a4a){var _0x3b5cde,_0x2a5cce;return db[_0x90b9('0x2f')][_0x90b9('0x49')]({'where':{'id':_0x3131a6['params']['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x3c4a45,null))[_0x90b9('0x26')](function(_0x2fa5aa){if(_0x2fa5aa){_0x2a5cce=_0x2fa5aa;return _0x2fa5aa[_0x90b9('0x82')](_0x3131a6[_0x90b9('0x4b')][_0x90b9('0x66')],_['omit'](_0x3131a6[_0x90b9('0x4b')],[_0x90b9('0x66'),'id'])||{});}return null;})[_0x90b9('0x67')](function(_0x1d4a88){var _0x513b05;_0x3b5cde=_0x1d4a88||[];var _0xea8e37=[];if(_0x1d4a88){for(var _0x5e8e20=0x0;_0x5e8e20<_0x1d4a88[_0x90b9('0x39')];_0x5e8e20+=0x1){var _0x264d82=_0x1d4a88[_0x5e8e20][_0x90b9('0x27')]({'plain':!![]});_0x513b05=squel[_0x90b9('0x7d')]()['into'](_0x90b9('0x83'))[_0x90b9('0x7e')]([_0x90b9('0x6b'),'ContactId',_0x90b9('0x6e'),_0x90b9('0x5e'),'createdAt',_0x90b9('0x53')],squel[_0x90b9('0x6f')]()[_0x90b9('0x70')](_0x90b9('0x6b'),_0x90b9('0x6b'))['field']('id',_0x90b9('0x6d'))[_0x90b9('0x70')](_0x264d82['CmListId'][_0x90b9('0x72')](),_0x90b9('0x6e'))[_0x90b9('0x70')](_0x3131a6['params']['id'][_0x90b9('0x72')](),_0x90b9('0x5e'))[_0x90b9('0x70')]('NOW()','createdAt')[_0x90b9('0x70')]('NOW()','updatedAt')['from'](_0x90b9('0x84'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x90b9('0x76'),_0x264d82[_0x90b9('0x71')][_0x90b9('0x72')]())[_0x90b9('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x90b9('0x72')]();_0xea8e37[_0x90b9('0x7f')](db[_0x90b9('0x85')][_0x90b9('0x33')](_0x513b05));}return BPromise[_0x90b9('0x86')](_0xea8e37);}})['then'](function(){return _0x3b5cde;})[_0x90b9('0x26')](respondWithResult(_0x3c4a45,null))[_0x90b9('0x45')](handleError(_0x3c4a45,null));};exports[_0x90b9('0x87')]=function(_0x47f6f8,_0x3880f9,_0x45fc4f){return db['Campaign'][_0x90b9('0x49')]({'where':{'id':_0x47f6f8[_0x90b9('0x47')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x3880f9,null))[_0x90b9('0x26')](function(_0x2303fc){if(_0x2303fc){return _0x2303fc['removeBlackLists'](_0x47f6f8[_0x90b9('0x33')][_0x90b9('0x66')]);}})['then'](function(_0x43908c){if(_0x43908c){return db[_0x90b9('0x62')][_0x90b9('0x29')]({'where':{'ListId':_0x47f6f8[_0x90b9('0x33')][_0x90b9('0x66')],'CampaignId':_0x47f6f8['params']['id']}})[_0x90b9('0x26')](function(){return _0x43908c;});}})[_0x90b9('0x26')](respondWithStatusCode(_0x3880f9,null))[_0x90b9('0x45')](handleError(_0x3880f9,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5f22172..80560d2 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xc2869e,_0x105457){var _0x243be2=function(_0x4876b6){while(--_0x4876b6){_0xc2869e['push'](_0xc2869e['shift']());}};_0x243be2(++_0x105457);}(_0x7a54,0x106));var _0x47a5=function(_0x3e9be4,_0x59bfd6){_0x3e9be4=_0x3e9be4-0x0;var _0x2c338f=_0x7a54[_0x3e9be4];return _0x2c338f;};'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
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x35d291,_0x1a131b){var _0x370b86=function(_0x52fa2a){while(--_0x52fa2a){_0x35d291['push'](_0x35d291['shift']());}};_0x370b86(++_0x1a131b);}(_0x7a54,0x106));var _0x47a5=function(_0x132428,_0x56dbcc){_0x132428=_0x132428-0x0;var _0x2ed205=_0x7a54[_0x132428];return _0x2ed205;};'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 7fe760b..7ae6e93 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 _0x82b0=['http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','model','attributes','map','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xccb70a,_0x1b6151){var _0x37f620=function(_0x498050){while(--_0x498050){_0xccb70a['push'](_0xccb70a['shift']());}};_0x37f620(++_0x1b6151);}(_0x82b0,0x81));var _0x082b=function(_0x59591b,_0x354045){_0x59591b=_0x59591b-0x0;var _0x576642=_0x82b0[_0x59591b];return _0x576642;};'use strict';var _=require(_0x082b('0x0'));var util=require(_0x082b('0x1'));var moment=require(_0x082b('0x2'));var BPromise=require('bluebird');var rs=require(_0x082b('0x3'));var fs=require('fs');var Redis=require(_0x082b('0x4'));var db=require(_0x082b('0x5'))['db'];var utils=require(_0x082b('0x6'));var logger=require('../../config/logger')(_0x082b('0x7'));var config=require(_0x082b('0x8'));var jayson=require(_0x082b('0x9'));var client=jayson[_0x082b('0xa')][_0x082b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e8485,_0x16b989,_0x3b9c2a){return new BPromise(function(_0x339585,_0x3ff037){return client[_0x082b('0xc')](_0x5e8485,_0x3b9c2a)[_0x082b('0xd')](function(_0xa65fdf){logger[_0x082b('0xe')](_0x082b('0xf'),_0x16b989,_0x082b('0x10'));logger[_0x082b('0x11')](_0x082b('0x12'),_0x16b989,_0x082b('0x10'),JSON[_0x082b('0x13')](_0xa65fdf));if(_0xa65fdf['error']){if(_0xa65fdf['error'][_0x082b('0x14')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x16b989,_0xa65fdf[_0x082b('0x15')][_0x082b('0x16')]);return _0x3ff037(_0xa65fdf['error'][_0x082b('0x16')]);}logger[_0x082b('0x15')](_0x082b('0xf'),_0x16b989,_0xa65fdf[_0x082b('0x15')][_0x082b('0x16')]);return _0x339585(_0xa65fdf['error'][_0x082b('0x16')]);}else{logger[_0x082b('0xe')]('Campaign,\x20%s,\x20%s',_0x16b989,_0x082b('0x10'));_0x339585(_0xa65fdf['result'][_0x082b('0x16')]);}})[_0x082b('0x17')](function(_0x4e5791){logger[_0x082b('0x15')](_0x082b('0xf'),_0x16b989,_0x4e5791);_0x3ff037(_0x4e5791);});});}exports[_0x082b('0x18')]=function(_0x3aa0ed){var _0x4adfc6=this;return new Promise(function(_0x2772e9,_0x2d5cbc){return db[_0x082b('0x19')][_0x082b('0x1a')]({'raw':_0x3aa0ed[_0x082b('0x1b')]?_0x3aa0ed[_0x082b('0x1b')][_0x082b('0x1c')]===undefined?!![]:![]:!![],'where':_0x3aa0ed[_0x082b('0x1b')]?_0x3aa0ed['options'][_0x082b('0x1d')]||null:null,'attributes':_0x3aa0ed[_0x082b('0x1b')]?_0x3aa0ed[_0x082b('0x1b')]['attributes']||null:null,'limit':_0x3aa0ed[_0x082b('0x1b')]?_0x3aa0ed[_0x082b('0x1b')][_0x082b('0x1e')]||null:null,'include':_0x3aa0ed['options']?_0x3aa0ed['options'][_0x082b('0x1f')]?_['map'](_0x3aa0ed['options'][_0x082b('0x1f')],function(_0xaa7eb){return{'model':db[_0xaa7eb[_0x082b('0x20')]],'as':_0xaa7eb['as'],'attributes':_0xaa7eb[_0x082b('0x21')],'include':_0xaa7eb[_0x082b('0x1f')]?_['map'](_0xaa7eb[_0x082b('0x1f')],function(_0x1254fd){return{'model':db[_0x1254fd[_0x082b('0x20')]],'as':_0x1254fd['as'],'attributes':_0x1254fd[_0x082b('0x21')],'include':_0x1254fd[_0x082b('0x1f')]?_[_0x082b('0x22')](_0x1254fd[_0x082b('0x1f')],function(_0x4e30e8){return{'model':db[_0x4e30e8[_0x082b('0x20')]],'as':_0x4e30e8['as'],'attributes':_0x4e30e8['attributes']};}):[]};}):[]};}):[]:[]})[_0x082b('0xd')](function(_0x4d102b){logger[_0x082b('0xe')](_0x082b('0x18'),_0x3aa0ed);logger['debug'](_0x082b('0x18'),_0x3aa0ed,JSON['stringify'](_0x4d102b));_0x2772e9(_0x4d102b);})[_0x082b('0x17')](function(_0x55d059){logger[_0x082b('0x15')](_0x082b('0x18'),_0x55d059[_0x082b('0x16')],_0x3aa0ed);_0x2d5cbc(_0x4adfc6[_0x082b('0x15')](0x1f4,_0x55d059[_0x082b('0x16')]));});});};
\ No newline at end of file
+var _0xafe6=['client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','GetCampaign','options','raw','where','attributes','limit','include','map','model','debug','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2293ed,_0xa62e95){var _0xe780be=function(_0x599d44){while(--_0x599d44){_0x2293ed['push'](_0x2293ed['shift']());}};_0xe780be(++_0xa62e95);}(_0xafe6,0xac));var _0x6afe=function(_0x3d6bab,_0x3242db){_0x3d6bab=_0x3d6bab-0x0;var _0x348415=_0xafe6[_0x3d6bab];return _0x348415;};'use strict';var _=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6afe('0x2'));var fs=require('fs');var Redis=require(_0x6afe('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6afe('0x4'))(_0x6afe('0x5'));var config=require(_0x6afe('0x6'));var jayson=require(_0x6afe('0x7'));var client=jayson[_0x6afe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302747,_0x2fb2c9,_0x59badb){return new BPromise(function(_0x1d3c11,_0x4c4c6f){return client[_0x6afe('0x9')](_0x302747,_0x59badb)[_0x6afe('0xa')](function(_0xd7ebad){logger[_0x6afe('0xb')](_0x6afe('0xc'),_0x2fb2c9,_0x6afe('0xd'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x2fb2c9,_0x6afe('0xd'),JSON[_0x6afe('0xe')](_0xd7ebad));if(_0xd7ebad['error']){if(_0xd7ebad['error'][_0x6afe('0xf')]===0x1f4){logger[_0x6afe('0x10')](_0x6afe('0xc'),_0x2fb2c9,_0xd7ebad[_0x6afe('0x10')][_0x6afe('0x11')]);return _0x4c4c6f(_0xd7ebad[_0x6afe('0x10')][_0x6afe('0x11')]);}logger['error'](_0x6afe('0xc'),_0x2fb2c9,_0xd7ebad[_0x6afe('0x10')][_0x6afe('0x11')]);return _0x1d3c11(_0xd7ebad[_0x6afe('0x10')][_0x6afe('0x11')]);}else{logger[_0x6afe('0xb')](_0x6afe('0xc'),_0x2fb2c9,'request\x20sent');_0x1d3c11(_0xd7ebad[_0x6afe('0x12')]['message']);}})['catch'](function(_0x4296c7){logger[_0x6afe('0x10')](_0x6afe('0xc'),_0x2fb2c9,_0x4296c7);_0x4c4c6f(_0x4296c7);});});}exports[_0x6afe('0x13')]=function(_0x1bc331){var _0x2197c4=this;return new Promise(function(_0x3699e8,_0x1fd5e3){return db['Campaign']['findAll']({'raw':_0x1bc331[_0x6afe('0x14')]?_0x1bc331[_0x6afe('0x14')][_0x6afe('0x15')]===undefined?!![]:![]:!![],'where':_0x1bc331['options']?_0x1bc331['options'][_0x6afe('0x16')]||null:null,'attributes':_0x1bc331[_0x6afe('0x14')]?_0x1bc331[_0x6afe('0x14')][_0x6afe('0x17')]||null:null,'limit':_0x1bc331[_0x6afe('0x14')]?_0x1bc331[_0x6afe('0x14')][_0x6afe('0x18')]||null:null,'include':_0x1bc331[_0x6afe('0x14')]?_0x1bc331[_0x6afe('0x14')][_0x6afe('0x19')]?_[_0x6afe('0x1a')](_0x1bc331[_0x6afe('0x14')][_0x6afe('0x19')],function(_0x23fc00){return{'model':db[_0x23fc00[_0x6afe('0x1b')]],'as':_0x23fc00['as'],'attributes':_0x23fc00['attributes'],'include':_0x23fc00['include']?_[_0x6afe('0x1a')](_0x23fc00['include'],function(_0x4b0399){return{'model':db[_0x4b0399[_0x6afe('0x1b')]],'as':_0x4b0399['as'],'attributes':_0x4b0399[_0x6afe('0x17')],'include':_0x4b0399[_0x6afe('0x19')]?_[_0x6afe('0x1a')](_0x4b0399[_0x6afe('0x19')],function(_0x3bb392){return{'model':db[_0x3bb392[_0x6afe('0x1b')]],'as':_0x3bb392['as'],'attributes':_0x3bb392[_0x6afe('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6afe('0xa')](function(_0x2c6ac3){logger[_0x6afe('0xb')](_0x6afe('0x13'),_0x1bc331);logger[_0x6afe('0x1c')]('GetCampaign',_0x1bc331,JSON[_0x6afe('0xe')](_0x2c6ac3));_0x3699e8(_0x2c6ac3);})[_0x6afe('0x1d')](function(_0x17e5d5){logger['error'](_0x6afe('0x13'),_0x17e5d5['message'],_0x1bc331);_0x1fd5e3(_0x2197c4[_0x6afe('0x10')](0x1f4,_0x17e5d5[_0x6afe('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 6fc16e9..7b5e7c0 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 _0x0c74=['post','/:id/clone','addLists','/:id/blacklists','addBlackLists','put','update','destroy','delete','removeLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_black','/:id/lists','getBlackLists'];(function(_0x1c7daf,_0x39ce94){var _0x44dc88=function(_0x37f698){while(--_0x37f698){_0x1c7daf['push'](_0x1c7daf['shift']());}};_0x44dc88(++_0x39ce94);}(_0x0c74,0x1cd));var _0x40c7=function(_0xf1f2e0,_0x37c415){_0xf1f2e0=_0xf1f2e0-0x0;var _0x991373=_0x0c74[_0xf1f2e0];return _0x991373;};'use strict';var multer=require('multer');var util=require(_0x40c7('0x0'));var path=require(_0x40c7('0x1'));var timeout=require(_0x40c7('0x2'));var express=require(_0x40c7('0x3'));var router=express[_0x40c7('0x4')]();var fs_extra=require(_0x40c7('0x5'));var auth=require(_0x40c7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x40c7('0x7'));var controller=require(_0x40c7('0x8'));router[_0x40c7('0x9')]('/',auth[_0x40c7('0xa')](),controller['index']);router[_0x40c7('0x9')](_0x40c7('0xb'),auth[_0x40c7('0xa')](),controller[_0x40c7('0xc')]);router[_0x40c7('0x9')](_0x40c7('0xd'),auth[_0x40c7('0xa')](),controller[_0x40c7('0xe')]);router[_0x40c7('0x9')](_0x40c7('0xf'),auth[_0x40c7('0xa')](),controller['getHopperHistories']);router[_0x40c7('0x9')]('/:id/hopper_finals',auth[_0x40c7('0xa')](),controller['getHopperFinals']);router[_0x40c7('0x9')](_0x40c7('0x10'),auth[_0x40c7('0xa')](),controller['getHopperBlacks']);router[_0x40c7('0x9')](_0x40c7('0x11'),auth[_0x40c7('0xa')](),controller['getLists']);router[_0x40c7('0x9')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x40c7('0x12')]);router[_0x40c7('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x40c7('0x14'),auth['isAuthenticated'](),controller['clone']);router[_0x40c7('0x13')](_0x40c7('0x11'),auth[_0x40c7('0xa')](),controller[_0x40c7('0x15')]);router['post'](_0x40c7('0x16'),auth[_0x40c7('0xa')](),controller[_0x40c7('0x17')]);router[_0x40c7('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x40c7('0x19')]);router['delete'](_0x40c7('0xb'),auth['isAuthenticated'](),controller[_0x40c7('0x1a')]);router[_0x40c7('0x1b')](_0x40c7('0x11'),auth[_0x40c7('0xa')](),controller[_0x40c7('0x1c')]);router[_0x40c7('0x1b')](_0x40c7('0x16'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x40c7('0x1d')]=router;
\ No newline at end of file
+var _0xe64a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xe64a,0x1e0));var _0xae64=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe64a[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var path=require(_0xae64('0x2'));var timeout=require(_0xae64('0x3'));var express=require(_0xae64('0x4'));var router=express[_0xae64('0x5')]();var fs_extra=require(_0xae64('0x6'));var auth=require(_0xae64('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth[_0xae64('0x8')](),controller[_0xae64('0x9')]);router[_0xae64('0xa')](_0xae64('0xb'),auth[_0xae64('0x8')](),controller[_0xae64('0xc')]);router[_0xae64('0xa')](_0xae64('0xd'),auth[_0xae64('0x8')](),controller[_0xae64('0xe')]);router[_0xae64('0xa')]('/:id/hopper_histories',auth[_0xae64('0x8')](),controller['getHopperHistories']);router['get'](_0xae64('0xf'),auth[_0xae64('0x8')](),controller[_0xae64('0x10')]);router[_0xae64('0xa')]('/:id/hopper_black',auth[_0xae64('0x8')](),controller['getHopperBlacks']);router['get'](_0xae64('0x11'),auth[_0xae64('0x8')](),controller[_0xae64('0x12')]);router['get'](_0xae64('0x13'),auth[_0xae64('0x8')](),controller[_0xae64('0x14')]);router[_0xae64('0x15')]('/',auth[_0xae64('0x8')](),controller['create']);router[_0xae64('0x15')](_0xae64('0x16'),auth[_0xae64('0x8')](),controller[_0xae64('0x17')]);router[_0xae64('0x15')]('/:id/lists',auth[_0xae64('0x8')](),controller[_0xae64('0x18')]);router[_0xae64('0x15')](_0xae64('0x13'),auth[_0xae64('0x8')](),controller[_0xae64('0x19')]);router[_0xae64('0x1a')](_0xae64('0xb'),auth['isAuthenticated'](),controller[_0xae64('0x1b')]);router[_0xae64('0x1c')](_0xae64('0xb'),auth[_0xae64('0x8')](),controller[_0xae64('0x1d')]);router[_0xae64('0x1c')]('/:id/lists',auth[_0xae64('0x8')](),controller['removeLists']);router[_0xae64('0x1c')](_0xae64('0x13'),auth[_0xae64('0x8')](),controller[_0xae64('0x1e')]);module[_0xae64('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index eab99e0..ee71a09 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 _0x50eb=['key','exports','getDataValue'];(function(_0x3a9808,_0x571f06){var _0x442b34=function(_0x289a15){while(--_0x289a15){_0x3a9808['push'](_0x3a9808['shift']());}};_0x442b34(++_0x571f06);}(_0x50eb,0xeb));var _0xb50e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x50eb[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require('sequelize');module[_0xb50e('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb50e('0x1')](_0xb50e('0x2'));}}};
\ No newline at end of file
+var _0x1597=['key','exports','STRING','VIRTUAL'];(function(_0x127003,_0xda7436){var _0x3eb4af=function(_0x2cd918){while(--_0x2cd918){_0x127003['push'](_0x127003['shift']());}};_0x3eb4af(++_0xda7436);}(_0x1597,0xf9));var _0x7159=function(_0x427502,_0x4e6214){_0x427502=_0x427502-0x0;var _0x1baeff=_0x1597[_0x427502];return _0x1baeff;};'use strict';var Sequelize=require('sequelize');module[_0x7159('0x0')]={'key':{'type':Sequelize[_0x7159('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x7159('0x1')]},'name':{'type':Sequelize[_0x7159('0x2')],'get':function(){return this['getDataValue'](_0x7159('0x3'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1b6d862..a1fad30 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 _0xb039=['merge','where','options','include','findAll','rows','catch','show','params','rawAttributes','filters','includeAll','find','body','create','key','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','lodash','squel','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','map','CannedAnswer','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x45c31f,_0xe6cd86){var _0x539e71=function(_0xf58cd5){while(--_0xf58cd5){_0x45c31f['push'](_0x45c31f['shift']());}};_0x539e71(++_0xe6cd86);}(_0xb039,0x120));var _0x9b03=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0xb039[_0x25b24a];return _0x224e68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b03('0x0'));var zipdir=require(_0x9b03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9b03('0x3'));var util=require('util');var path=require(_0x9b03('0x4'));var sox=require(_0x9b03('0x5'));var csv=require(_0x9b03('0x6'));var ejs=require(_0x9b03('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b03('0x8'));var squel=require(_0x9b03('0x9'));var crypto=require(_0x9b03('0xa'));var jsforce=require(_0x9b03('0xb'));var deskjs=require(_0x9b03('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9b03('0xd'));var Papa=require(_0x9b03('0xe'));var Redis=require(_0x9b03('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9b03('0x10'));var as=require(_0x9b03('0x11'));var hardwareService=require(_0x9b03('0x12'));var logger=require(_0x9b03('0x13'))('api');var utils=require(_0x9b03('0x14'));var config=require(_0x9b03('0x15'));var licenseUtil=require(_0x9b03('0x16'));var db=require(_0x9b03('0x17'))['db'];function respondWithStatusCode(_0x450b95,_0x60a204){_0x60a204=_0x60a204||0xcc;return function(_0x53bf54){if(_0x53bf54){return _0x450b95[_0x9b03('0x18')](_0x60a204);}return _0x450b95[_0x9b03('0x19')](_0x60a204)[_0x9b03('0x1a')]();};}function respondWithResult(_0x4d1a6f,_0x406309){_0x406309=_0x406309||0xc8;return function(_0x377648){if(_0x377648){return _0x4d1a6f[_0x9b03('0x19')](_0x406309)[_0x9b03('0x1b')](_0x377648);}};}function respondWithFilteredResult(_0x570485,_0x26e80e){return function(_0xf5f912){if(_0xf5f912){var _0x598e12=typeof _0x26e80e[_0x9b03('0x1c')]===_0x9b03('0x1d')&&typeof _0x26e80e['limit']===_0x9b03('0x1d');var _0x12b181=_0xf5f912[_0x9b03('0x1e')];var _0x5cf16d=_0x598e12?0x0:_0x26e80e[_0x9b03('0x1c')];var _0x222dad=_0x598e12?_0xf5f912[_0x9b03('0x1e')]:_0x26e80e[_0x9b03('0x1c')]+_0x26e80e[_0x9b03('0x1f')];var _0x5b6e18;if(_0x222dad>=_0x12b181){_0x222dad=_0x12b181;_0x5b6e18=0xc8;}else{_0x5b6e18=0xce;}_0x570485[_0x9b03('0x19')](_0x5b6e18);return _0x570485['set'](_0x9b03('0x20'),_0x5cf16d+'-'+_0x222dad+'/'+_0x12b181)[_0x9b03('0x1b')](_0xf5f912);}return null;};}function patchUpdates(_0x12a4e4){return function(_0xad325c){try{jsonpatch[_0x9b03('0x21')](_0xad325c,_0x12a4e4,!![]);}catch(_0x54dede){return BPromise[_0x9b03('0x22')](_0x54dede);}return _0xad325c[_0x9b03('0x23')]();};}function saveUpdates(_0x1d0f86,_0x19dee){return function(_0x49f4ef){if(_0x49f4ef){return _0x49f4ef[_0x9b03('0x24')](_0x1d0f86)[_0x9b03('0x25')](function(_0xb625f7){return _0xb625f7;});}return null;};}function removeEntity(_0x3885c2,_0x322355){return function(_0x2faa28){if(_0x2faa28){return _0x2faa28['destroy']()['then'](function(){var _0x3fffd9=_0x2faa28['get']({'plain':!![]});var _0x263a3e=_0x9b03('0x26');return db[_0x9b03('0x27')][_0x9b03('0x28')]({'where':{'type':_0x263a3e,'resourceId':_0x3fffd9['id']}})[_0x9b03('0x25')](function(){return _0x2faa28;});})[_0x9b03('0x25')](function(){_0x3885c2[_0x9b03('0x19')](0xcc)[_0x9b03('0x1a')]();});}};}function handleEntityNotFound(_0x49ab37,_0x3ac065){return function(_0x42e75b){if(!_0x42e75b){_0x49ab37[_0x9b03('0x18')](0x194);}return _0x42e75b;};}function handleError(_0x2dfd34,_0x1c79fd){_0x1c79fd=_0x1c79fd||0x1f4;return function(_0x4ff64c){logger[_0x9b03('0x29')](_0x4ff64c[_0x9b03('0x2a')]);if(_0x4ff64c[_0x9b03('0x2b')]){delete _0x4ff64c[_0x9b03('0x2b')];}_0x2dfd34[_0x9b03('0x19')](_0x1c79fd)[_0x9b03('0x2c')](_0x4ff64c);};}exports['index']=function(_0x30e0ad,_0x5b2937){var _0x137026={},_0x452781={},_0x2eeb26={'count':0x0,'rows':[]};var _0x1be626=_[_0x9b03('0x2d')](db[_0x9b03('0x2e')]['rawAttributes'],function(_0x4b3a30){return{'name':_0x4b3a30[_0x9b03('0x2f')],'type':_0x4b3a30[_0x9b03('0x30')]['key']};});_0x452781[_0x9b03('0x31')]=_[_0x9b03('0x2d')](_0x1be626,'name');_0x452781[_0x9b03('0x32')]=_[_0x9b03('0x33')](_0x30e0ad['query']);_0x452781['filters']=_[_0x9b03('0x34')](_0x452781[_0x9b03('0x31')],_0x452781[_0x9b03('0x32')]);_0x137026[_0x9b03('0x35')]=_[_0x9b03('0x34')](_0x452781['model'],qs[_0x9b03('0x36')](_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x36')]));_0x137026[_0x9b03('0x35')]=_0x137026[_0x9b03('0x35')]['length']?_0x137026['attributes']:_0x452781[_0x9b03('0x31')];if(!_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x37')](_0x9b03('0x38'))){_0x137026[_0x9b03('0x1f')]=qs['limit'](_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x1f')]);_0x137026['offset']=qs['offset'](_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x1c')]);}_0x137026[_0x9b03('0x39')]=qs[_0x9b03('0x3a')](_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x3a')]);_0x137026['where']=qs['filters'](_['pick'](_0x30e0ad[_0x9b03('0x32')],_0x452781['filters']),_0x1be626);if(_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x3b')]){_0x137026['where']=_[_0x9b03('0x3c')](_0x137026[_0x9b03('0x3d')],{'$or':[{'key':{'$like':'%'+_0x30e0ad[_0x9b03('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x3b')]+'%'}}]});}_0x137026=_[_0x9b03('0x3c')]({},_0x137026,_0x30e0ad[_0x9b03('0x3e')]);var _0x37b650={'where':_0x137026[_0x9b03('0x3d')]};return db[_0x9b03('0x2e')][_0x9b03('0x1e')](_0x37b650)[_0x9b03('0x25')](function(_0x483bef){_0x2eeb26['count']=_0x483bef;if(_0x30e0ad[_0x9b03('0x32')]['includeAll']){_0x137026[_0x9b03('0x3f')]=[{'all':!![]}];}return db[_0x9b03('0x2e')][_0x9b03('0x40')](_0x137026);})['then'](function(_0x5e7cef){_0x2eeb26[_0x9b03('0x41')]=_0x5e7cef;return _0x2eeb26;})['then'](respondWithFilteredResult(_0x5b2937,_0x137026))[_0x9b03('0x42')](handleError(_0x5b2937,null));};exports[_0x9b03('0x43')]=function(_0x15b7d5,_0x224922){var _0x1b6b20={'raw':!![],'where':{'id':_0x15b7d5[_0x9b03('0x44')]['id']}},_0x4abdff={};_0x4abdff[_0x9b03('0x31')]=_[_0x9b03('0x33')](db[_0x9b03('0x2e')][_0x9b03('0x45')]);_0x4abdff[_0x9b03('0x32')]=_[_0x9b03('0x33')](_0x15b7d5['query']);_0x4abdff[_0x9b03('0x46')]=_[_0x9b03('0x34')](_0x4abdff[_0x9b03('0x31')],_0x4abdff[_0x9b03('0x32')]);_0x1b6b20[_0x9b03('0x35')]=_[_0x9b03('0x34')](_0x4abdff['model'],qs['fields'](_0x15b7d5[_0x9b03('0x32')][_0x9b03('0x36')]));_0x1b6b20[_0x9b03('0x35')]=_0x1b6b20[_0x9b03('0x35')]['length']?_0x1b6b20[_0x9b03('0x35')]:_0x4abdff[_0x9b03('0x31')];if(_0x15b7d5['query'][_0x9b03('0x47')]){_0x1b6b20[_0x9b03('0x3f')]=[{'all':!![]}];}_0x1b6b20=_['merge']({},_0x1b6b20,_0x15b7d5[_0x9b03('0x3e')]);return db[_0x9b03('0x2e')][_0x9b03('0x48')](_0x1b6b20)[_0x9b03('0x25')](handleEntityNotFound(_0x224922,null))['then'](respondWithResult(_0x224922,null))[_0x9b03('0x42')](handleError(_0x224922,null));};exports[_0x9b03('0x24')]=function(_0x367aa5,_0x3b58e5){if(_0x367aa5[_0x9b03('0x49')]['id']){delete _0x367aa5[_0x9b03('0x49')]['id'];}return db['CannedAnswer'][_0x9b03('0x48')]({'where':{'id':_0x367aa5[_0x9b03('0x44')]['id']}})[_0x9b03('0x25')](handleEntityNotFound(_0x3b58e5,null))['then'](saveUpdates(_0x367aa5[_0x9b03('0x49')],null))[_0x9b03('0x25')](respondWithResult(_0x3b58e5,null))['catch'](handleError(_0x3b58e5,null));};exports[_0x9b03('0x28')]=function(_0x3fb8a9,_0x171923){return db[_0x9b03('0x2e')][_0x9b03('0x48')]({'where':{'id':_0x3fb8a9[_0x9b03('0x44')]['id']}})[_0x9b03('0x25')](handleEntityNotFound(_0x171923,null))[_0x9b03('0x25')](removeEntity(_0x171923,null))[_0x9b03('0x42')](handleError(_0x171923,null));};exports[_0x9b03('0x4a')]=function(_0x1d8996,_0x334c4b){var _0xba7697={'key':_0x1d8996[_0x9b03('0x49')][_0x9b03('0x4b')]};if(_0x1d8996[_0x9b03('0x49')]['MailAccountId']){_0xba7697[_0x9b03('0x4c')]=_0x1d8996[_0x9b03('0x49')]['MailAccountId'];}else if(_0x1d8996['body'][_0x9b03('0x4d')]){_0xba7697[_0x9b03('0x4d')]=_0x1d8996[_0x9b03('0x49')][_0x9b03('0x4d')];}else if(_0x1d8996['body']['OpenchannelAccountId']){_0xba7697['OpenchannelAccountId']=_0x1d8996[_0x9b03('0x49')]['OpenchannelAccountId'];}else if(_0x1d8996[_0x9b03('0x49')]['ChatWebsiteId']){_0xba7697[_0x9b03('0x4e')]=_0x1d8996['body'][_0x9b03('0x4e')];}return db['CannedAnswer'][_0x9b03('0x48')]({'where':_0xba7697})[_0x9b03('0x25')](function(_0x35e412){if(_0x35e412){throw new db[(_0x9b03('0x4f'))][(_0x9b03('0x50'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x9b03('0x2e')][_0x9b03('0x4a')](_0x1d8996[_0x9b03('0x49')]);})[_0x9b03('0x25')](function(_0x2eb637){var _0x44db8b=_0x1d8996[_0x9b03('0x51')]['get']({'plain':!![]});if(!_0x44db8b)throw new Error(_0x9b03('0x52'));if(_0x44db8b[_0x9b03('0x53')]===_0x9b03('0x51')){var _0x461ecc=_0x2eb637['get']({'plain':!![]});return db[_0x9b03('0x54')][_0x9b03('0x48')]({'where':{'name':_0x9b03('0x26'),'userProfileId':_0x44db8b[_0x9b03('0x55')]},'raw':!![]})[_0x9b03('0x25')](function(_0xf8c9a4){if(_0xf8c9a4&&_0xf8c9a4['autoAssociation']===0x0){return db[_0x9b03('0x27')]['create']({'name':_0x461ecc[_0x9b03('0x2b')],'resourceId':_0x461ecc['id'],'type':_0xf8c9a4[_0x9b03('0x2b')],'sectionId':_0xf8c9a4['id']},{})[_0x9b03('0x25')](function(){return _0x2eb637;});}else{return _0x2eb637;}})[_0x9b03('0x42')](function(_0x5f1820){logger[_0x9b03('0x29')](_0x9b03('0x56'),_0x5f1820);throw _0x5f1820;});}return _0x2eb637;})[_0x9b03('0x25')](respondWithResult(_0x334c4b,0xc9))[_0x9b03('0x42')](handleError(_0x334c4b,null));};
\ No newline at end of file
+var _0xf250=['create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','find','body'];(function(_0xe19c81,_0x2e661a){var _0x16596d=function(_0x3c4382){while(--_0x3c4382){_0xe19c81['push'](_0xe19c81['shift']());}};_0x16596d(++_0x2e661a);}(_0xf250,0x11a));var _0x0f25=function(_0x966478,_0x5b7b09){_0x966478=_0x966478-0x0;var _0x5ec091=_0xf250[_0x966478];return _0x5ec091;};'use strict';var emlformat=require(_0x0f25('0x0'));var rimraf=require(_0x0f25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f25('0x2'));var rp=require(_0x0f25('0x3'));var moment=require(_0x0f25('0x4'));var BPromise=require(_0x0f25('0x5'));var Mustache=require('mustache');var util=require(_0x0f25('0x6'));var path=require(_0x0f25('0x7'));var sox=require(_0x0f25('0x8'));var csv=require(_0x0f25('0x9'));var ejs=require(_0x0f25('0xa'));var fs=require('fs');var fs_extra=require(_0x0f25('0xb'));var _=require(_0x0f25('0xc'));var squel=require(_0x0f25('0xd'));var crypto=require(_0x0f25('0xe'));var jsforce=require(_0x0f25('0xf'));var deskjs=require(_0x0f25('0x10'));var toCsv=require(_0x0f25('0x9'));var querystring=require(_0x0f25('0x11'));var Papa=require(_0x0f25('0x12'));var Redis=require(_0x0f25('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0f25('0x14'));var as=require(_0x0f25('0x15'));var hardwareService=require(_0x0f25('0x16'));var logger=require(_0x0f25('0x17'))(_0x0f25('0x18'));var utils=require(_0x0f25('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0f25('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x323bd9,_0xdbb708){_0xdbb708=_0xdbb708||0xcc;return function(_0x19cf4d){if(_0x19cf4d){return _0x323bd9[_0x0f25('0x1b')](_0xdbb708);}return _0x323bd9['status'](_0xdbb708)[_0x0f25('0x1c')]();};}function respondWithResult(_0x1041c5,_0x4d4292){_0x4d4292=_0x4d4292||0xc8;return function(_0x214245){if(_0x214245){return _0x1041c5[_0x0f25('0x1d')](_0x4d4292)['json'](_0x214245);}};}function respondWithFilteredResult(_0x4a1ec2,_0x120582){return function(_0x3885ca){if(_0x3885ca){var _0xe8aa70=typeof _0x120582[_0x0f25('0x1e')]===_0x0f25('0x1f')&&typeof _0x120582['limit']===_0x0f25('0x1f');var _0x4b1ebb=_0x3885ca[_0x0f25('0x20')];var _0x9c65e=_0xe8aa70?0x0:_0x120582[_0x0f25('0x1e')];var _0x3cbdc4=_0xe8aa70?_0x3885ca[_0x0f25('0x20')]:_0x120582[_0x0f25('0x1e')]+_0x120582[_0x0f25('0x21')];var _0x5305d4;if(_0x3cbdc4>=_0x4b1ebb){_0x3cbdc4=_0x4b1ebb;_0x5305d4=0xc8;}else{_0x5305d4=0xce;}_0x4a1ec2[_0x0f25('0x1d')](_0x5305d4);return _0x4a1ec2['set'](_0x0f25('0x22'),_0x9c65e+'-'+_0x3cbdc4+'/'+_0x4b1ebb)[_0x0f25('0x23')](_0x3885ca);}return null;};}function patchUpdates(_0x569d1c){return function(_0x3c2dbb){try{jsonpatch['apply'](_0x3c2dbb,_0x569d1c,!![]);}catch(_0x3da232){return BPromise['reject'](_0x3da232);}return _0x3c2dbb['save']();};}function saveUpdates(_0x9d4b58,_0x480d48){return function(_0x2ed96d){if(_0x2ed96d){return _0x2ed96d[_0x0f25('0x24')](_0x9d4b58)[_0x0f25('0x25')](function(_0x4c9339){return _0x4c9339;});}return null;};}function removeEntity(_0x536091,_0x4269cc){return function(_0x46529d){if(_0x46529d){return _0x46529d[_0x0f25('0x26')]()['then'](function(){var _0x31589c=_0x46529d[_0x0f25('0x27')]({'plain':!![]});var _0x515ddd='CannedAnswers';return db[_0x0f25('0x28')][_0x0f25('0x26')]({'where':{'type':_0x515ddd,'resourceId':_0x31589c['id']}})[_0x0f25('0x25')](function(){return _0x46529d;});})[_0x0f25('0x25')](function(){_0x536091[_0x0f25('0x1d')](0xcc)[_0x0f25('0x1c')]();});}};}function handleEntityNotFound(_0x473f76,_0x44a68f){return function(_0x175a1){if(!_0x175a1){_0x473f76[_0x0f25('0x1b')](0x194);}return _0x175a1;};}function handleError(_0x3200c0,_0x363c35){_0x363c35=_0x363c35||0x1f4;return function(_0x1d8240){logger[_0x0f25('0x29')](_0x1d8240[_0x0f25('0x2a')]);if(_0x1d8240[_0x0f25('0x2b')]){delete _0x1d8240[_0x0f25('0x2b')];}_0x3200c0[_0x0f25('0x1d')](_0x363c35)[_0x0f25('0x2c')](_0x1d8240);};}exports[_0x0f25('0x2d')]=function(_0x57f72b,_0x15fb0e){var _0x3aa2d4={},_0x242cf4={},_0x58d2d8={'count':0x0,'rows':[]};var _0x2f6974=_['map'](db[_0x0f25('0x2e')][_0x0f25('0x2f')],function(_0x2419c5){return{'name':_0x2419c5[_0x0f25('0x30')],'type':_0x2419c5[_0x0f25('0x31')]['key']};});_0x242cf4[_0x0f25('0x32')]=_[_0x0f25('0x33')](_0x2f6974,_0x0f25('0x2b'));_0x242cf4[_0x0f25('0x34')]=_[_0x0f25('0x35')](_0x57f72b[_0x0f25('0x34')]);_0x242cf4[_0x0f25('0x36')]=_[_0x0f25('0x37')](_0x242cf4['model'],_0x242cf4[_0x0f25('0x34')]);_0x3aa2d4[_0x0f25('0x38')]=_[_0x0f25('0x37')](_0x242cf4[_0x0f25('0x32')],qs[_0x0f25('0x39')](_0x57f72b[_0x0f25('0x34')]['fields']));_0x3aa2d4[_0x0f25('0x38')]=_0x3aa2d4[_0x0f25('0x38')][_0x0f25('0x3a')]?_0x3aa2d4[_0x0f25('0x38')]:_0x242cf4['model'];if(!_0x57f72b[_0x0f25('0x34')][_0x0f25('0x3b')]('nolimit')){_0x3aa2d4[_0x0f25('0x21')]=qs[_0x0f25('0x21')](_0x57f72b[_0x0f25('0x34')]['limit']);_0x3aa2d4[_0x0f25('0x1e')]=qs[_0x0f25('0x1e')](_0x57f72b[_0x0f25('0x34')]['offset']);}_0x3aa2d4['order']=qs[_0x0f25('0x3c')](_0x57f72b['query'][_0x0f25('0x3c')]);_0x3aa2d4[_0x0f25('0x3d')]=qs['filters'](_[_0x0f25('0x3e')](_0x57f72b[_0x0f25('0x34')],_0x242cf4['filters']),_0x2f6974);if(_0x57f72b[_0x0f25('0x34')]['filter']){_0x3aa2d4['where']=_[_0x0f25('0x3f')](_0x3aa2d4[_0x0f25('0x3d')],{'$or':[{'key':{'$like':'%'+_0x57f72b[_0x0f25('0x34')][_0x0f25('0x40')]+'%'}},{'value':{'$like':'%'+_0x57f72b[_0x0f25('0x34')][_0x0f25('0x40')]+'%'}}]});}_0x3aa2d4=_[_0x0f25('0x3f')]({},_0x3aa2d4,_0x57f72b[_0x0f25('0x41')]);var _0x4f95a4={'where':_0x3aa2d4[_0x0f25('0x3d')]};return db[_0x0f25('0x2e')][_0x0f25('0x20')](_0x4f95a4)['then'](function(_0x4aa6a9){_0x58d2d8[_0x0f25('0x20')]=_0x4aa6a9;if(_0x57f72b[_0x0f25('0x34')][_0x0f25('0x42')]){_0x3aa2d4[_0x0f25('0x43')]=[{'all':!![]}];}return db[_0x0f25('0x2e')][_0x0f25('0x44')](_0x3aa2d4);})['then'](function(_0x1c804f){_0x58d2d8['rows']=_0x1c804f;return _0x58d2d8;})['then'](respondWithFilteredResult(_0x15fb0e,_0x3aa2d4))[_0x0f25('0x45')](handleError(_0x15fb0e,null));};exports[_0x0f25('0x46')]=function(_0x30af08,_0x2f2375){var _0x29d465={'raw':!![],'where':{'id':_0x30af08[_0x0f25('0x47')]['id']}},_0x3f422f={};_0x3f422f[_0x0f25('0x32')]=_[_0x0f25('0x35')](db[_0x0f25('0x2e')][_0x0f25('0x2f')]);_0x3f422f['query']=_[_0x0f25('0x35')](_0x30af08[_0x0f25('0x34')]);_0x3f422f[_0x0f25('0x36')]=_[_0x0f25('0x37')](_0x3f422f[_0x0f25('0x32')],_0x3f422f[_0x0f25('0x34')]);_0x29d465[_0x0f25('0x38')]=_['intersection'](_0x3f422f[_0x0f25('0x32')],qs[_0x0f25('0x39')](_0x30af08[_0x0f25('0x34')][_0x0f25('0x39')]));_0x29d465['attributes']=_0x29d465['attributes'][_0x0f25('0x3a')]?_0x29d465['attributes']:_0x3f422f[_0x0f25('0x32')];if(_0x30af08[_0x0f25('0x34')]['includeAll']){_0x29d465[_0x0f25('0x43')]=[{'all':!![]}];}_0x29d465=_[_0x0f25('0x3f')]({},_0x29d465,_0x30af08[_0x0f25('0x41')]);return db[_0x0f25('0x2e')][_0x0f25('0x48')](_0x29d465)[_0x0f25('0x25')](handleEntityNotFound(_0x2f2375,null))[_0x0f25('0x25')](respondWithResult(_0x2f2375,null))[_0x0f25('0x45')](handleError(_0x2f2375,null));};exports[_0x0f25('0x24')]=function(_0x4eff3e,_0x35c876){if(_0x4eff3e[_0x0f25('0x49')]['id']){delete _0x4eff3e['body']['id'];}return db[_0x0f25('0x2e')][_0x0f25('0x48')]({'where':{'id':_0x4eff3e[_0x0f25('0x47')]['id']}})[_0x0f25('0x25')](handleEntityNotFound(_0x35c876,null))[_0x0f25('0x25')](saveUpdates(_0x4eff3e[_0x0f25('0x49')],null))[_0x0f25('0x25')](respondWithResult(_0x35c876,null))[_0x0f25('0x45')](handleError(_0x35c876,null));};exports['destroy']=function(_0x1533d5,_0x29999c){return db['CannedAnswer'][_0x0f25('0x48')]({'where':{'id':_0x1533d5[_0x0f25('0x47')]['id']}})[_0x0f25('0x25')](handleEntityNotFound(_0x29999c,null))[_0x0f25('0x25')](removeEntity(_0x29999c,null))['catch'](handleError(_0x29999c,null));};exports[_0x0f25('0x4a')]=function(_0x1f7047,_0x5b1a38){var _0x5a09a1={'key':_0x1f7047['body'][_0x0f25('0x4b')]};if(_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4c')]){_0x5a09a1[_0x0f25('0x4c')]=_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4c')];}else if(_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4d')]){_0x5a09a1[_0x0f25('0x4d')]=_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4d')];}else if(_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4e')]){_0x5a09a1[_0x0f25('0x4e')]=_0x1f7047['body'][_0x0f25('0x4e')];}else if(_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4f')]){_0x5a09a1['ChatWebsiteId']=_0x1f7047['body'][_0x0f25('0x4f')];}return db[_0x0f25('0x2e')][_0x0f25('0x48')]({'where':_0x5a09a1})['then'](function(_0x24aff1){if(_0x24aff1){throw new db['Sequelize'][(_0x0f25('0x50'))](_0x0f25('0x51'));}return db[_0x0f25('0x2e')][_0x0f25('0x4a')](_0x1f7047[_0x0f25('0x49')]);})[_0x0f25('0x25')](function(_0x4a14ea){var _0xf0354d=_0x1f7047[_0x0f25('0x52')]['get']({'plain':!![]});if(!_0xf0354d)throw new Error(_0x0f25('0x53'));if(_0xf0354d['role']==='user'){var _0x1de210=_0x4a14ea[_0x0f25('0x27')]({'plain':!![]});return db[_0x0f25('0x54')]['find']({'where':{'name':_0x0f25('0x55'),'userProfileId':_0xf0354d[_0x0f25('0x56')]},'raw':!![]})['then'](function(_0x266532){if(_0x266532&&_0x266532[_0x0f25('0x57')]===0x0){return db[_0x0f25('0x28')][_0x0f25('0x4a')]({'name':_0x1de210['name'],'resourceId':_0x1de210['id'],'type':_0x266532[_0x0f25('0x2b')],'sectionId':_0x266532['id']},{})[_0x0f25('0x25')](function(){return _0x4a14ea;});}else{return _0x4a14ea;}})[_0x0f25('0x45')](function(_0x2d6740){logger[_0x0f25('0x29')](_0x0f25('0x58'),_0x2d6740);throw _0x2d6740;});}return _0x4a14ea;})[_0x0f25('0x25')](respondWithResult(_0x5b1a38,0xc9))[_0x0f25('0x45')](handleError(_0x5b1a38,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 2969d37..8c444a4 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 _0x5a6d=['../../config/environment','./cannedAnswer.attributes','tools_canned_answers','utf8mb4','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x5a6d,0x194));var _0xd5a6=function(_0x1c5a73,_0x5b10ac){_0x1c5a73=_0x1c5a73-0x0;var _0x2457a1=_0x5a6d[_0x1c5a73];return _0x2457a1;};'use strict';var _=require(_0xd5a6('0x0'));var util=require('util');var logger=require(_0xd5a6('0x1'))(_0xd5a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd5a6('0x3'));var fs=require('fs');var path=require(_0xd5a6('0x4'));var rimraf=require(_0xd5a6('0x5'));var config=require(_0xd5a6('0x6'));var attributes=require(_0xd5a6('0x7'));module['exports']=function(_0x4150a7,_0x47891e){return _0x4150a7['define']('CannedAnswer',attributes,{'tableName':_0xd5a6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd5a6('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb870=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xb870,0x7a));var _0x0b87=function(_0x3c22f7,_0x1fb12a){_0x3c22f7=_0x3c22f7-0x0;var _0x537f59=_0xb870[_0x3c22f7];return _0x537f59;};'use strict';var _=require(_0x0b87('0x0'));var util=require('util');var logger=require(_0x0b87('0x1'))(_0x0b87('0x2'));var moment=require(_0x0b87('0x3'));var BPromise=require(_0x0b87('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b87('0x5'));var rimraf=require(_0x0b87('0x6'));var config=require(_0x0b87('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x0b87('0x8')]=function(_0x475c54,_0x1316c6){return _0x475c54[_0x0b87('0x9')](_0x0b87('0xa'),attributes,{'tableName':_0x0b87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0b87('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index a7ce556..95efbd8 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(_0x1a227b,_0x59971c){var _0x2ab46e=function(_0x32d82e){while(--_0x32d82e){_0x1a227b['push'](_0x1a227b['shift']());}};_0x2ab46e(++_0x59971c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x2cbb57,_0x369292){var _0x1e9592=function(_0x4ae940){while(--_0x4ae940){_0x2cbb57['push'](_0x2cbb57['shift']());}};_0x1e9592(++_0x369292);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 b072484..516ca24 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 _0xbb44=['destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','post','create','update','delete'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0xbb44,0x11e));var _0x4bb4=function(_0x338a96,_0x11c85a){_0x338a96=_0x338a96-0x0;var _0x5611a0=_0xbb44[_0x338a96];return _0x5611a0;};'use strict';var multer=require('multer');var util=require(_0x4bb4('0x0'));var path=require(_0x4bb4('0x1'));var timeout=require(_0x4bb4('0x2'));var express=require('express');var router=express[_0x4bb4('0x3')]();var fs_extra=require(_0x4bb4('0x4'));var auth=require(_0x4bb4('0x5'));var interaction=require(_0x4bb4('0x6'));var config=require(_0x4bb4('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4bb4('0x8'),auth[_0x4bb4('0x9')](),controller['show']);router[_0x4bb4('0xa')]('/',auth[_0x4bb4('0x9')](),controller[_0x4bb4('0xb')]);router['put'](_0x4bb4('0x8'),auth[_0x4bb4('0x9')](),controller[_0x4bb4('0xc')]);router[_0x4bb4('0xd')](_0x4bb4('0x8'),auth['isAuthenticated'](),controller[_0x4bb4('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x4c0d=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x28b0aa,_0x18e34d){var _0xedceb9=function(_0x484e59){while(--_0x484e59){_0x28b0aa['push'](_0x28b0aa['shift']());}};_0xedceb9(++_0x18e34d);}(_0x4c0d,0x181));var _0xd4c0=function(_0x2749fd,_0x2a9f50){_0x2749fd=_0x2749fd-0x0;var _0x2b0305=_0x4c0d[_0x2749fd];return _0x2b0305;};'use strict';var multer=require(_0xd4c0('0x0'));var util=require('util');var path=require(_0xd4c0('0x1'));var timeout=require(_0xd4c0('0x2'));var express=require(_0xd4c0('0x3'));var router=express['Router']();var fs_extra=require(_0xd4c0('0x4'));var auth=require(_0xd4c0('0x5'));var interaction=require(_0xd4c0('0x6'));var config=require(_0xd4c0('0x7'));var controller=require('./cannedAnswer.controller');router[_0xd4c0('0x8')]('/',auth[_0xd4c0('0x9')](),controller['index']);router['get'](_0xd4c0('0xa'),auth[_0xd4c0('0x9')](),controller[_0xd4c0('0xb')]);router[_0xd4c0('0xc')]('/',auth['isAuthenticated'](),controller[_0xd4c0('0xd')]);router[_0xd4c0('0xe')](_0xd4c0('0xa'),auth[_0xd4c0('0x9')](),controller[_0xd4c0('0xf')]);router[_0xd4c0('0x10')](_0xd4c0('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 9f9e2e1..4d4f09b 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 _0xc3b0=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x19bfbe,_0x3c8193){var _0xd5f62d=function(_0x3f18fa){while(--_0x3f18fa){_0x19bfbe['push'](_0x19bfbe['shift']());}};_0xd5f62d(++_0x3c8193);}(_0xc3b0,0x166));var _0x0c3b=function(_0x3c4928,_0x4e710a){_0x3c4928=_0x3c4928-0x0;var _0xfa275b=_0xc3b0[_0x3c4928];return _0xfa275b;};'use strict';var Sequelize=require(_0x0c3b('0x0'));module[_0x0c3b('0x1')]={'calldate':{'type':Sequelize[_0x0c3b('0x2')],'allowNull':![],'defaultValue':_0x0c3b('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x0c3b('0x4')]},'dcontext':{'type':Sequelize[_0x0c3b('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0c3b('0x4')]},'lastapp':{'type':Sequelize[_0x0c3b('0x4')]},'lastdata':{'type':Sequelize[_0x0c3b('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0c3b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0c3b('0x4')]},'amaflags':{'type':Sequelize[_0x0c3b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0c3b('0x4')]},'sequence':{'type':Sequelize[_0x0c3b('0x4')]},'peeraccount':{'type':Sequelize[_0x0c3b('0x4')]},'type':{'type':Sequelize[_0x0c3b('0x4')]},'tag':{'type':Sequelize[_0x0c3b('0x4')]}};
\ No newline at end of file
+var _0x6988=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x1a0411,_0x19ed45){var _0x2abfd4=function(_0x493e67){while(--_0x493e67){_0x1a0411['push'](_0x1a0411['shift']());}};_0x2abfd4(++_0x19ed45);}(_0x6988,0x81));var _0x8698=function(_0xb9fe51,_0x38f460){_0xb9fe51=_0xb9fe51-0x0;var _0x40257c=_0x6988[_0xb9fe51];return _0x40257c;};'use strict';var Sequelize=require(_0x8698('0x0'));module[_0x8698('0x1')]={'calldate':{'type':Sequelize[_0x8698('0x2')],'allowNull':![],'defaultValue':_0x8698('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8698('0x4')]},'dcontext':{'type':Sequelize[_0x8698('0x4')]},'channel':{'type':Sequelize[_0x8698('0x4')]},'dstchannel':{'type':Sequelize[_0x8698('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8698('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8698('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8698('0x4')]},'amaflags':{'type':Sequelize[_0x8698('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8698('0x4')]},'userfield':{'type':Sequelize[_0x8698('0x4')]},'uniqueid':{'type':Sequelize[_0x8698('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x8698('0x4')]},'peeraccount':{'type':Sequelize[_0x8698('0x4')]},'type':{'type':Sequelize[_0x8698('0x4')]},'tag':{'type':Sequelize[_0x8698('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index b0347c0..e61e5ad 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 _0xbd51=['stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','rows','show','params','keys','length','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x49cf9a,_0x2d6a3f){_0x49cf9a=_0x49cf9a-0x0;var _0x4eeeec=_0xbd51[_0x49cf9a];return _0x4eeeec;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bd5('0x1'));var jsonpatch=require(_0x1bd5('0x2'));var rp=require(_0x1bd5('0x3'));var moment=require(_0x1bd5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1bd5('0x5'));var csv=require(_0x1bd5('0x6'));var ejs=require(_0x1bd5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bd5('0x8'));var squel=require(_0x1bd5('0x9'));var crypto=require(_0x1bd5('0xa'));var jsforce=require(_0x1bd5('0xb'));var deskjs=require(_0x1bd5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1bd5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bd5('0xe'));var authService=require(_0x1bd5('0xf'));var qs=require(_0x1bd5('0x10'));var as=require(_0x1bd5('0x11'));var hardwareService=require(_0x1bd5('0x12'));var logger=require(_0x1bd5('0x13'))('api');var utils=require(_0x1bd5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd5('0x15'));var db=require(_0x1bd5('0x16'))['db'];function respondWithStatusCode(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xcc;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0x17')](_0x14606b);}return _0x37e8e1[_0x1bd5('0x18')](_0x14606b)['end']();};}function respondWithResult(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0xc8;return function(_0x6d2c40){if(_0x6d2c40){return _0x5650b5[_0x1bd5('0x18')](_0x8b2390)[_0x1bd5('0x19')](_0x6d2c40);}};}function respondWithFilteredResult(_0x48d048,_0x5072c2){return function(_0xa63190){if(_0xa63190){var _0xc7277e=typeof _0x5072c2[_0x1bd5('0x1a')]===_0x1bd5('0x1b')&&typeof _0x5072c2[_0x1bd5('0x1c')]===_0x1bd5('0x1b');var _0x13cf34=_0xa63190[_0x1bd5('0x1d')];var _0x4670b5=_0xc7277e?0x0:_0x5072c2['offset'];var _0x53ad5e=_0xc7277e?_0xa63190[_0x1bd5('0x1d')]:_0x5072c2[_0x1bd5('0x1a')]+_0x5072c2[_0x1bd5('0x1c')];var _0xb95d4e;if(_0x53ad5e>=_0x13cf34){_0x53ad5e=_0x13cf34;_0xb95d4e=0xc8;}else{_0xb95d4e=0xce;}_0x48d048[_0x1bd5('0x18')](_0xb95d4e);return _0x48d048[_0x1bd5('0x1e')](_0x1bd5('0x1f'),_0x4670b5+'-'+_0x53ad5e+'/'+_0x13cf34)[_0x1bd5('0x19')](_0xa63190);}return null;};}function patchUpdates(_0x456051){return function(_0xb1ac1e){try{jsonpatch[_0x1bd5('0x20')](_0xb1ac1e,_0x456051,!![]);}catch(_0x2447c4){return BPromise[_0x1bd5('0x21')](_0x2447c4);}return _0xb1ac1e[_0x1bd5('0x22')]();};}function saveUpdates(_0x253d79,_0x46c580){return function(_0x1f13e7){if(_0x1f13e7){return _0x1f13e7[_0x1bd5('0x23')](_0x253d79)['then'](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x50c663,_0x18fd18){return function(_0x1e534e){if(_0x1e534e){return _0x1e534e[_0x1bd5('0x24')]()['then'](function(){_0x50c663[_0x1bd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed551,_0x30676d){return function(_0x3dba4f){if(!_0x3dba4f){_0x2ed551[_0x1bd5('0x17')](0x194);}return _0x3dba4f;};}function handleError(_0x47c84b,_0x202ed3){_0x202ed3=_0x202ed3||0x1f4;return function(_0x69bb17){logger[_0x1bd5('0x25')](_0x69bb17[_0x1bd5('0x26')]);if(_0x69bb17['name']){delete _0x69bb17[_0x1bd5('0x27')];}_0x47c84b[_0x1bd5('0x18')](_0x202ed3)[_0x1bd5('0x28')](_0x69bb17);};}exports[_0x1bd5('0x29')]=function(_0xe54b9f,_0xc73670){var _0x4e72b2={},_0x289097={},_0x472b22={'count':0x0,'rows':[]};var _0x8d53ba=_['map'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')],function(_0x345181){return{'name':_0x345181[_0x1bd5('0x2c')],'type':_0x345181[_0x1bd5('0x2d')][_0x1bd5('0x2e')]};});_0x289097['model']=_['map'](_0x8d53ba,_0x1bd5('0x27'));_0x289097[_0x1bd5('0x2f')]=_['keys'](_0xe54b9f[_0x1bd5('0x2f')]);_0x289097[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],_0x289097['query']);_0x4e72b2[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],qs[_0x1bd5('0x34')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x4e72b2[_0x1bd5('0x33')]=_0x4e72b2[_0x1bd5('0x33')]['length']?_0x4e72b2[_0x1bd5('0x33')]:_0x289097[_0x1bd5('0x32')];if(!_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x35')](_0x1bd5('0x36'))){_0x4e72b2[_0x1bd5('0x1c')]=qs[_0x1bd5('0x1c')](_0xe54b9f['query'][_0x1bd5('0x1c')]);_0x4e72b2[_0x1bd5('0x1a')]=qs[_0x1bd5('0x1a')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x1a')]);}_0x4e72b2[_0x1bd5('0x37')]=qs[_0x1bd5('0x38')](_0xe54b9f['query']['sort']);_0x4e72b2[_0x1bd5('0x39')]=qs[_0x1bd5('0x30')](_[_0x1bd5('0x3a')](_0xe54b9f['query'],_0x289097[_0x1bd5('0x30')]),_0x8d53ba);if(_0xe54b9f['query'][_0x1bd5('0x3b')]){_0x4e72b2[_0x1bd5('0x39')]=_[_0x1bd5('0x3c')](_0x4e72b2[_0x1bd5('0x39')],{'$or':_[_0x1bd5('0x3d')](_0x8d53ba,function(_0x2470ec){if(_0x2470ec[_0x1bd5('0x2d')]!==_0x1bd5('0x3e')){var _0x4bbefc={};_0x4bbefc[_0x2470ec[_0x1bd5('0x27')]]={'$like':'%'+_0xe54b9f[_0x1bd5('0x2f')]['filter']+'%'};return _0x4bbefc;}})});}_0x4e72b2=_[_0x1bd5('0x3c')]({},_0x4e72b2,_0xe54b9f[_0x1bd5('0x3f')]);var _0x20b25c={'where':_0x4e72b2['where']};return db[_0x1bd5('0x2a')][_0x1bd5('0x1d')](_0x20b25c)[_0x1bd5('0x40')](function(_0x4074f1){_0x472b22['count']=_0x4074f1;if(_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x41')]){_0x4e72b2[_0x1bd5('0x42')]=[{'all':!![]}];}return db[_0x1bd5('0x2a')]['findAll'](_0x4e72b2);})['then'](function(_0x40eeff){_0x472b22[_0x1bd5('0x43')]=_0x40eeff;return _0x472b22;})[_0x1bd5('0x40')](respondWithFilteredResult(_0xc73670,_0x4e72b2))['catch'](handleError(_0xc73670,null));};exports[_0x1bd5('0x44')]=function(_0x3b1092,_0x574d95){var _0x1eacac={'raw':!![],'where':{'id':_0x3b1092[_0x1bd5('0x45')]['id']}},_0x5761b8={};_0x5761b8[_0x1bd5('0x32')]=_['keys'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')]);_0x5761b8[_0x1bd5('0x2f')]=_[_0x1bd5('0x46')](_0x3b1092[_0x1bd5('0x2f')]);_0x5761b8[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],_0x5761b8[_0x1bd5('0x2f')]);_0x1eacac[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],qs['fields'](_0x3b1092[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x1eacac[_0x1bd5('0x33')]=_0x1eacac['attributes'][_0x1bd5('0x47')]?_0x1eacac[_0x1bd5('0x33')]:_0x5761b8['model'];if(_0x3b1092[_0x1bd5('0x2f')]['includeAll']){_0x1eacac[_0x1bd5('0x42')]=[{'all':!![]}];}_0x1eacac=_['merge']({},_0x1eacac,_0x3b1092[_0x1bd5('0x3f')]);return db[_0x1bd5('0x2a')]['find'](_0x1eacac)[_0x1bd5('0x40')](handleEntityNotFound(_0x574d95,null))['then'](respondWithResult(_0x574d95,null))[_0x1bd5('0x48')](handleError(_0x574d95,null));};exports[_0x1bd5('0x49')]=function(_0x1a29f3,_0xe71454){return db[_0x1bd5('0x2a')][_0x1bd5('0x49')](_0x1a29f3[_0x1bd5('0x4a')],{})[_0x1bd5('0x40')](respondWithResult(_0xe71454,0xc9))['catch'](handleError(_0xe71454,null));};exports[_0x1bd5('0x23')]=function(_0x227a68,_0x2a1ece){if(_0x227a68[_0x1bd5('0x4a')]['id']){delete _0x227a68[_0x1bd5('0x4a')]['id'];}return db[_0x1bd5('0x2a')]['find']({'where':{'id':_0x227a68[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x2a1ece,null))[_0x1bd5('0x40')](saveUpdates(_0x227a68[_0x1bd5('0x4a')],null))[_0x1bd5('0x40')](respondWithResult(_0x2a1ece,null))[_0x1bd5('0x48')](handleError(_0x2a1ece,null));};exports[_0x1bd5('0x24')]=function(_0x539d0e,_0x587c46){return db[_0x1bd5('0x2a')][_0x1bd5('0x4b')]({'where':{'id':_0x539d0e[_0x1bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x587c46,null))[_0x1bd5('0x40')](removeEntity(_0x587c46,null))[_0x1bd5('0x48')](handleError(_0x587c46,null));};exports[_0x1bd5('0x4c')]=function(_0x1f2d7e,_0x11813d){return db[_0x1bd5('0x2a')][_0x1bd5('0x4c')]()['then'](respondWithResult(_0x11813d,null))[_0x1bd5('0x48')](handleError(_0x11813d,null));};
\ No newline at end of file
+var _0xac9d=['fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac9d,0x14d));var _0xdac9=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0xac9d[_0x547add];return _0x2ed1f3;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b'));_0x3eed7a[_0xdac9('0x34')]=_[_0xdac9('0x35')](_0x170afd[_0xdac9('0x34')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a[_0xdac9('0x34')]);_0x4c4e21[_0xdac9('0x38')]=_['intersection'](_0x3eed7a['model'],qs[_0xdac9('0x39')](_0x170afd[_0xdac9('0x34')][_0xdac9('0x39')]));_0x4c4e21[_0xdac9('0x38')]=_0x4c4e21[_0xdac9('0x38')]['length']?_0x4c4e21[_0xdac9('0x38')]:_0x3eed7a['model'];if(!_0x170afd[_0xdac9('0x34')][_0xdac9('0x3a')]('nolimit')){_0x4c4e21[_0xdac9('0x20')]=qs['limit'](_0x170afd['query'][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x34')][_0xdac9('0x1e')]);}_0x4c4e21[_0xdac9('0x3b')]=qs['sort'](_0x170afd[_0xdac9('0x34')][_0xdac9('0x3c')]);_0x4c4e21['where']=qs[_0xdac9('0x36')](_[_0xdac9('0x3d')](_0x170afd[_0xdac9('0x34')],_0x3eed7a[_0xdac9('0x36')]),_0x13efba);if(_0x170afd[_0xdac9('0x34')][_0xdac9('0x3e')]){_0x4c4e21[_0xdac9('0x3f')]=_['merge'](_0x4c4e21[_0xdac9('0x3f')],{'$or':_[_0xdac9('0x2d')](_0x13efba,function(_0x238769){if(_0x238769['type']!==_0xdac9('0x40')){var _0x338e4a={};_0x338e4a[_0x238769[_0xdac9('0x2b')]]={'$like':'%'+_0x170afd[_0xdac9('0x34')]['filter']+'%'};return _0x338e4a;}})});}_0x4c4e21=_['merge']({},_0x4c4e21,_0x170afd[_0xdac9('0x41')]);var _0xe47a3c={'where':_0x4c4e21[_0xdac9('0x3f')]};return db[_0xdac9('0x2e')][_0xdac9('0x21')](_0xe47a3c)['then'](function(_0x8435e8){_0x3505c5['count']=_0x8435e8;if(_0x170afd[_0xdac9('0x34')][_0xdac9('0x42')]){_0x4c4e21[_0xdac9('0x43')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x44')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x413fb1){_0x3505c5[_0xdac9('0x45')]=_0x413fb1;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x46')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x47')]=function(_0x24b570,_0x278826){var _0x441676={'raw':!![],'where':{'id':_0x24b570[_0xdac9('0x48')]['id']}},_0x5335ae={};_0x5335ae[_0xdac9('0x33')]=_['keys'](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x5335ae[_0xdac9('0x34')]=_[_0xdac9('0x35')](_0x24b570[_0xdac9('0x34')]);_0x5335ae[_0xdac9('0x36')]=_['intersection'](_0x5335ae[_0xdac9('0x33')],_0x5335ae['query']);_0x441676[_0xdac9('0x38')]=_[_0xdac9('0x37')](_0x5335ae[_0xdac9('0x33')],qs[_0xdac9('0x39')](_0x24b570['query']['fields']));_0x441676['attributes']=_0x441676[_0xdac9('0x38')]['length']?_0x441676['attributes']:_0x5335ae[_0xdac9('0x33')];if(_0x24b570[_0xdac9('0x34')]['includeAll']){_0x441676['include']=[{'all':!![]}];}_0x441676=_[_0xdac9('0x49')]({},_0x441676,_0x24b570[_0xdac9('0x41')]);return db[_0xdac9('0x2e')][_0xdac9('0x4a')](_0x441676)[_0xdac9('0x26')](handleEntityNotFound(_0x278826,null))[_0xdac9('0x26')](respondWithResult(_0x278826,null))[_0xdac9('0x46')](handleError(_0x278826,null));};exports[_0xdac9('0x4b')]=function(_0x5c008b,_0x621cf){return db[_0xdac9('0x2e')][_0xdac9('0x4b')](_0x5c008b[_0xdac9('0x4c')],{})[_0xdac9('0x26')](respondWithResult(_0x621cf,0xc9))[_0xdac9('0x46')](handleError(_0x621cf,null));};exports[_0xdac9('0x25')]=function(_0x37b498,_0x140dc5){if(_0x37b498[_0xdac9('0x4c')]['id']){delete _0x37b498[_0xdac9('0x4c')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4a')]({'where':{'id':_0x37b498[_0xdac9('0x48')]['id']}})['then'](handleEntityNotFound(_0x140dc5,null))['then'](saveUpdates(_0x37b498['body'],null))[_0xdac9('0x26')](respondWithResult(_0x140dc5,null))[_0xdac9('0x46')](handleError(_0x140dc5,null));};exports['destroy']=function(_0x2a60bd,_0x2843f2){return db[_0xdac9('0x2e')]['find']({'where':{'id':_0x2a60bd[_0xdac9('0x48')]['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x2843f2,null))['then'](removeEntity(_0x2843f2,null))['catch'](handleError(_0x2843f2,null));};exports[_0xdac9('0x4d')]=function(_0x4469d8,_0x222de9){return db[_0xdac9('0x2e')][_0xdac9('0x4d')]()[_0xdac9('0x26')](respondWithResult(_0x222de9,null))[_0xdac9('0x46')](handleError(_0x222de9,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 208840a..2249e2d 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x168736,_0x405c75){var _0x485b6c=function(_0x56ce95){while(--_0x56ce95){_0x168736['push'](_0x168736['shift']());}};_0x485b6c(++_0x405c75);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x399754,_0x33a1cd){var _0xf3242f=function(_0x3bc264){while(--_0x3bc264){_0x399754['push'](_0x399754['shift']());}};_0xf3242f(++_0x33a1cd);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index c064d19..7c68eef 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 _0x5735=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x1e1e63,_0x5801bb){var _0x169956=function(_0x53dc95){while(--_0x53dc95){_0x1e1e63['push'](_0x1e1e63['shift']());}};_0x169956(++_0x5801bb);}(_0x5735,0x147));var _0x5573=function(_0x47e3ef,_0x551b2c){_0x47e3ef=_0x47e3ef-0x0;var _0x502417=_0x5735[_0x47e3ef];return _0x502417;};'use strict';var _=require(_0x5573('0x0'));var util=require(_0x5573('0x1'));var moment=require('moment');var BPromise=require(_0x5573('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5573('0x3'));var db=require(_0x5573('0x4'))['db'];var utils=require(_0x5573('0x5'));var logger=require(_0x5573('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5573('0x7'));var client=jayson[_0x5573('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa4995d,_0x7ae3a8,_0x592336){return new BPromise(function(_0x37e47c,_0x20b117){return client[_0x5573('0x9')](_0xa4995d,_0x592336)[_0x5573('0xa')](function(_0x394c1c){logger[_0x5573('0xb')](_0x5573('0xc'),_0x7ae3a8,_0x5573('0xd'));logger[_0x5573('0xe')](_0x5573('0xf'),_0x7ae3a8,'request\x20sent',JSON[_0x5573('0x10')](_0x394c1c));if(_0x394c1c[_0x5573('0x11')]){if(_0x394c1c[_0x5573('0x11')][_0x5573('0x12')]===0x1f4){logger[_0x5573('0x11')](_0x5573('0xc'),_0x7ae3a8,_0x394c1c['error']['message']);return _0x20b117(_0x394c1c[_0x5573('0x11')]['message']);}logger['error'](_0x5573('0xc'),_0x7ae3a8,_0x394c1c['error']['message']);return _0x37e47c(_0x394c1c['error'][_0x5573('0x13')]);}else{logger[_0x5573('0xb')](_0x5573('0xc'),_0x7ae3a8,'request\x20sent');_0x37e47c(_0x394c1c[_0x5573('0x14')][_0x5573('0x13')]);}})['catch'](function(_0x36fc5d){logger[_0x5573('0x11')]('Cdr,\x20%s,\x20%s',_0x7ae3a8,_0x36fc5d);_0x20b117(_0x36fc5d);});});}
\ No newline at end of file
+var _0x9f54=['http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x345083,_0x3c2710){var _0x9a76ee=function(_0x594a89){while(--_0x594a89){_0x345083['push'](_0x345083['shift']());}};_0x9a76ee(++_0x3c2710);}(_0x9f54,0x103));var _0x49f5=function(_0xa5f1c4,_0x5ca610){_0xa5f1c4=_0xa5f1c4-0x0;var _0x233570=_0x9f54[_0xa5f1c4];return _0x233570;};'use strict';var _=require(_0x49f5('0x0'));var util=require(_0x49f5('0x1'));var moment=require('moment');var BPromise=require(_0x49f5('0x2'));var rs=require(_0x49f5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x49f5('0x4'));var logger=require(_0x49f5('0x5'))('rpc');var config=require(_0x49f5('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x49f5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1163df,_0x422939,_0x3f0750){return new BPromise(function(_0x4431c3,_0x15d9ca){return client[_0x49f5('0x8')](_0x1163df,_0x3f0750)[_0x49f5('0x9')](function(_0x178f46){logger[_0x49f5('0xa')](_0x49f5('0xb'),_0x422939,_0x49f5('0xc'));logger['debug'](_0x49f5('0xd'),_0x422939,'request\x20sent',JSON[_0x49f5('0xe')](_0x178f46));if(_0x178f46[_0x49f5('0xf')]){if(_0x178f46[_0x49f5('0xf')][_0x49f5('0x10')]===0x1f4){logger['error'](_0x49f5('0xb'),_0x422939,_0x178f46[_0x49f5('0xf')]['message']);return _0x15d9ca(_0x178f46[_0x49f5('0xf')][_0x49f5('0x11')]);}logger[_0x49f5('0xf')](_0x49f5('0xb'),_0x422939,_0x178f46['error'][_0x49f5('0x11')]);return _0x4431c3(_0x178f46['error'][_0x49f5('0x11')]);}else{logger['info'](_0x49f5('0xb'),_0x422939,_0x49f5('0xc'));_0x4431c3(_0x178f46['result']['message']);}})[_0x49f5('0x12')](function(_0x2829e0){logger['error'](_0x49f5('0xb'),_0x422939,_0x2829e0);_0x15d9ca(_0x2829e0);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 54444d0..891c51c 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2d1cf4,_0x2ea9ee){var _0x554a7c=function(_0x55cc39){while(--_0x55cc39){_0x2d1cf4['push'](_0x2d1cf4['shift']());}};_0x554a7c(++_0x2ea9ee);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('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(_0x1ad33a,_0x348ad6){var _0xf0d6d2=function(_0xd099b4){while(--_0xd099b4){_0x1ad33a['push'](_0x1ad33a['shift']());}};_0xf0d6d2(++_0x348ad6);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d9d1e,_0x5d284a){_0x3d9d1e=_0x3d9d1e-0x0;var _0x58a4e2=_0xb10b[_0x3d9d1e];return _0x58a4e2;};'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 f90a3de..bc34ab9 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 _0x5b25=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0xba856b,_0x14ac21){var _0x5dbfa8=function(_0x1a0177){while(--_0x1a0177){_0xba856b['push'](_0xba856b['shift']());}};_0x5dbfa8(++_0x14ac21);}(_0x5b25,0x1d8));var _0x55b2=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x5b25[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x55b2('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x55b2('0x1')],'allowNull':![],'defaultValue':_0x55b2('0x2')},'appdata':{'type':Sequelize[_0x55b2('0x3')]()},'description':{'type':Sequelize[_0x55b2('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x55b2('0x4')}};
\ No newline at end of file
+var _0x99b6=['STRING','TEXT','sequelize','exports'];(function(_0x19776e,_0x3690de){var _0xce4b5f=function(_0x6e04fd){while(--_0x6e04fd){_0x19776e['push'](_0x19776e['shift']());}};_0xce4b5f(++_0x3690de);}(_0x99b6,0x1be));var _0x699b=function(_0x20e229,_0x465679){_0x20e229=_0x20e229-0x0;var _0x186559=_0x99b6[_0x20e229];return _0x186559;};'use strict';var Sequelize=require(_0x699b('0x0'));module[_0x699b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x699b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x699b('0x3')]()},'description':{'type':Sequelize[_0x699b('0x2')]},'interval':{'type':Sequelize[_0x699b('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index e44bed1..b5b5362 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 _0x6ae2=['error','name','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy'];(function(_0x29d9ae,_0x2153a5){var _0x125218=function(_0xc15156){while(--_0xc15156){_0x29d9ae['push'](_0x29d9ae['shift']());}};_0x125218(++_0x2153a5);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x76bb5c,_0x218675){_0x76bb5c=_0x76bb5c-0x0;var _0x50e166=_0x6ae2[_0x76bb5c];return _0x50e166;};'use strict';var emlformat=require(_0x26ae('0x0'));var rimraf=require(_0x26ae('0x1'));var zipdir=require(_0x26ae('0x2'));var jsonpatch=require(_0x26ae('0x3'));var rp=require(_0x26ae('0x4'));var moment=require(_0x26ae('0x5'));var BPromise=require(_0x26ae('0x6'));var Mustache=require(_0x26ae('0x7'));var util=require(_0x26ae('0x8'));var path=require('path');var sox=require(_0x26ae('0x9'));var csv=require(_0x26ae('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26ae('0xb'));var squel=require(_0x26ae('0xc'));var crypto=require(_0x26ae('0xd'));var jsforce=require(_0x26ae('0xe'));var deskjs=require(_0x26ae('0xf'));var toCsv=require(_0x26ae('0xa'));var querystring=require(_0x26ae('0x10'));var Papa=require(_0x26ae('0x11'));var Redis=require(_0x26ae('0x12'));var authService=require(_0x26ae('0x13'));var qs=require(_0x26ae('0x14'));var as=require(_0x26ae('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26ae('0x16'))('api');var utils=require(_0x26ae('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26ae('0x18'))['db'];function respondWithStatusCode(_0x46bc2,_0x21811d){_0x21811d=_0x21811d||0xcc;return function(_0x17f9a6){if(_0x17f9a6){return _0x46bc2[_0x26ae('0x19')](_0x21811d);}return _0x46bc2[_0x26ae('0x1a')](_0x21811d)[_0x26ae('0x1b')]();};}function respondWithResult(_0x1c66b8,_0x2390a7){_0x2390a7=_0x2390a7||0xc8;return function(_0x52d611){if(_0x52d611){return _0x1c66b8[_0x26ae('0x1a')](_0x2390a7)[_0x26ae('0x1c')](_0x52d611);}};}function respondWithFilteredResult(_0x4e5c4e,_0x15d055){return function(_0x32cd9e){if(_0x32cd9e){var _0x497974=typeof _0x15d055[_0x26ae('0x1d')]===_0x26ae('0x1e')&&typeof _0x15d055[_0x26ae('0x1f')]===_0x26ae('0x1e');var _0x13ad43=_0x32cd9e[_0x26ae('0x20')];var _0x250dc0=_0x497974?0x0:_0x15d055[_0x26ae('0x1d')];var _0x28584c=_0x497974?_0x32cd9e[_0x26ae('0x20')]:_0x15d055[_0x26ae('0x1d')]+_0x15d055[_0x26ae('0x1f')];var _0x38102c;if(_0x28584c>=_0x13ad43){_0x28584c=_0x13ad43;_0x38102c=0xc8;}else{_0x38102c=0xce;}_0x4e5c4e[_0x26ae('0x1a')](_0x38102c);return _0x4e5c4e[_0x26ae('0x21')](_0x26ae('0x22'),_0x250dc0+'-'+_0x28584c+'/'+_0x13ad43)[_0x26ae('0x1c')](_0x32cd9e);}return null;};}function patchUpdates(_0xdfcd69){return function(_0x22d535){try{jsonpatch[_0x26ae('0x23')](_0x22d535,_0xdfcd69,!![]);}catch(_0x334153){return BPromise['reject'](_0x334153);}return _0x22d535['save']();};}function saveUpdates(_0x2a2ba5,_0x5d72dc){return function(_0x22c47b){if(_0x22c47b){return _0x22c47b['update'](_0x2a2ba5)[_0x26ae('0x24')](function(_0x2e34d1){return _0x2e34d1;});}return null;};}function removeEntity(_0x19f641,_0x57062e){return function(_0x4ab3f1){if(_0x4ab3f1){return _0x4ab3f1[_0x26ae('0x25')]()[_0x26ae('0x24')](function(){_0x19f641[_0x26ae('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2caf20,_0x295cc2){return function(_0x53e0da){if(!_0x53e0da){_0x2caf20[_0x26ae('0x19')](0x194);}return _0x53e0da;};}function handleError(_0x2658ed,_0x19eacc){_0x19eacc=_0x19eacc||0x1f4;return function(_0x4a0045){logger[_0x26ae('0x26')](_0x4a0045['stack']);if(_0x4a0045[_0x26ae('0x27')]){delete _0x4a0045[_0x26ae('0x27')];}_0x2658ed[_0x26ae('0x1a')](_0x19eacc)['send'](_0x4a0045);};}exports[_0x26ae('0x28')]=function(_0x5a8301,_0x4cddc4){var _0x2f2e9d={'raw':!![],'where':{'id':_0x5a8301['params']['id']}},_0x2fcc89={};_0x2fcc89[_0x26ae('0x29')]=_[_0x26ae('0x2a')](db[_0x26ae('0x2b')][_0x26ae('0x2c')]);_0x2fcc89[_0x26ae('0x2d')]=_['keys'](_0x5a8301[_0x26ae('0x2d')]);_0x2fcc89[_0x26ae('0x2e')]=_[_0x26ae('0x2f')](_0x2fcc89[_0x26ae('0x29')],_0x2fcc89[_0x26ae('0x2d')]);_0x2f2e9d['attributes']=_[_0x26ae('0x2f')](_0x2fcc89[_0x26ae('0x29')],qs[_0x26ae('0x30')](_0x5a8301[_0x26ae('0x2d')][_0x26ae('0x30')]));_0x2f2e9d[_0x26ae('0x31')]=_0x2f2e9d[_0x26ae('0x31')][_0x26ae('0x32')]?_0x2f2e9d['attributes']:_0x2fcc89[_0x26ae('0x29')];if(_0x5a8301['query']['includeAll']){_0x2f2e9d[_0x26ae('0x33')]=[{'all':!![]}];}_0x2f2e9d=_[_0x26ae('0x34')]({},_0x2f2e9d,_0x5a8301[_0x26ae('0x35')]);return db['ChatApplication'][_0x26ae('0x36')](_0x2f2e9d)[_0x26ae('0x24')](handleEntityNotFound(_0x4cddc4,null))[_0x26ae('0x24')](respondWithResult(_0x4cddc4,null))[_0x26ae('0x37')](handleError(_0x4cddc4,null));};exports[_0x26ae('0x38')]=function(_0x20aa74,_0x9ed674){if(_0x20aa74[_0x26ae('0x39')]['id']){delete _0x20aa74[_0x26ae('0x39')]['id'];}return db[_0x26ae('0x2b')][_0x26ae('0x36')]({'where':{'id':_0x20aa74[_0x26ae('0x3a')]['id']}})[_0x26ae('0x24')](handleEntityNotFound(_0x9ed674,null))[_0x26ae('0x24')](saveUpdates(_0x20aa74['body'],null))[_0x26ae('0x24')](respondWithResult(_0x9ed674,null))[_0x26ae('0x37')](handleError(_0x9ed674,null));};exports[_0x26ae('0x25')]=function(_0x484dec,_0x20c60a){return db[_0x26ae('0x2b')][_0x26ae('0x36')]({'where':{'id':_0x484dec[_0x26ae('0x3a')]['id']}})[_0x26ae('0x24')](handleEntityNotFound(_0x20c60a,null))['then'](removeEntity(_0x20c60a,null))[_0x26ae('0x37')](handleError(_0x20c60a,null));};
\ No newline at end of file
+var _0x66d3=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','show','model','keys','ChatApplication','query','filters','intersection','attributes','fields','includeAll','include','merge','find','then','catch','body','params','eml-format','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x66d3,0x10f));var _0x366d=function(_0x214527,_0x4660b2){_0x214527=_0x214527-0x0;var _0x38d24b=_0x66d3[_0x214527];return _0x38d24b;};'use strict';var emlformat=require(_0x366d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x366d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x366d('0x2'));var moment=require(_0x366d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x366d('0x4'));var util=require('util');var path=require(_0x366d('0x5'));var sox=require('sox');var csv=require(_0x366d('0x6'));var ejs=require(_0x366d('0x7'));var fs=require('fs');var fs_extra=require(_0x366d('0x8'));var _=require(_0x366d('0x9'));var squel=require(_0x366d('0xa'));var crypto=require(_0x366d('0xb'));var jsforce=require(_0x366d('0xc'));var deskjs=require(_0x366d('0xd'));var toCsv=require(_0x366d('0x6'));var querystring=require(_0x366d('0xe'));var Papa=require(_0x366d('0xf'));var Redis=require('ioredis');var authService=require(_0x366d('0x10'));var qs=require(_0x366d('0x11'));var as=require(_0x366d('0x12'));var hardwareService=require(_0x366d('0x13'));var logger=require(_0x366d('0x14'))(_0x366d('0x15'));var utils=require(_0x366d('0x16'));var config=require(_0x366d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x210ed0,_0x797ee){_0x797ee=_0x797ee||0xcc;return function(_0x3dd776){if(_0x3dd776){return _0x210ed0[_0x366d('0x18')](_0x797ee);}return _0x210ed0[_0x366d('0x19')](_0x797ee)[_0x366d('0x1a')]();};}function respondWithResult(_0x4fa003,_0x265292){_0x265292=_0x265292||0xc8;return function(_0x2a3fdb){if(_0x2a3fdb){return _0x4fa003['status'](_0x265292)[_0x366d('0x1b')](_0x2a3fdb);}};}function respondWithFilteredResult(_0x287d17,_0x54a1bb){return function(_0x3da66f){if(_0x3da66f){var _0x309dc6=typeof _0x54a1bb[_0x366d('0x1c')]==='undefined'&&typeof _0x54a1bb[_0x366d('0x1d')]==='undefined';var _0xbc2286=_0x3da66f[_0x366d('0x1e')];var _0x5a1c0a=_0x309dc6?0x0:_0x54a1bb[_0x366d('0x1c')];var _0x235ff2=_0x309dc6?_0x3da66f[_0x366d('0x1e')]:_0x54a1bb[_0x366d('0x1c')]+_0x54a1bb[_0x366d('0x1d')];var _0x4ce0c6;if(_0x235ff2>=_0xbc2286){_0x235ff2=_0xbc2286;_0x4ce0c6=0xc8;}else{_0x4ce0c6=0xce;}_0x287d17[_0x366d('0x19')](_0x4ce0c6);return _0x287d17['set'](_0x366d('0x1f'),_0x5a1c0a+'-'+_0x235ff2+'/'+_0xbc2286)['json'](_0x3da66f);}return null;};}function patchUpdates(_0x5cbe3b){return function(_0x219106){try{jsonpatch[_0x366d('0x20')](_0x219106,_0x5cbe3b,!![]);}catch(_0x5a4a75){return BPromise[_0x366d('0x21')](_0x5a4a75);}return _0x219106[_0x366d('0x22')]();};}function saveUpdates(_0x1ed99c,_0x58d16f){return function(_0x3b5c89){if(_0x3b5c89){return _0x3b5c89[_0x366d('0x23')](_0x1ed99c)['then'](function(_0x3d4941){return _0x3d4941;});}return null;};}function removeEntity(_0x47ebf4,_0x1c9ee9){return function(_0x1326c9){if(_0x1326c9){return _0x1326c9[_0x366d('0x24')]()['then'](function(){_0x47ebf4[_0x366d('0x19')](0xcc)[_0x366d('0x1a')]();});}};}function handleEntityNotFound(_0x2a1d96,_0x5254e6){return function(_0x53002e){if(!_0x53002e){_0x2a1d96['sendStatus'](0x194);}return _0x53002e;};}function handleError(_0x199e3b,_0x40f3df){_0x40f3df=_0x40f3df||0x1f4;return function(_0x5d2b67){logger['error'](_0x5d2b67[_0x366d('0x25')]);if(_0x5d2b67[_0x366d('0x26')]){delete _0x5d2b67[_0x366d('0x26')];}_0x199e3b[_0x366d('0x19')](_0x40f3df)['send'](_0x5d2b67);};}exports[_0x366d('0x27')]=function(_0x5dc954,_0x47cc0c){var _0x13a6b2={'raw':!![],'where':{'id':_0x5dc954['params']['id']}},_0x594d42={};_0x594d42[_0x366d('0x28')]=_[_0x366d('0x29')](db[_0x366d('0x2a')]['rawAttributes']);_0x594d42[_0x366d('0x2b')]=_[_0x366d('0x29')](_0x5dc954[_0x366d('0x2b')]);_0x594d42[_0x366d('0x2c')]=_[_0x366d('0x2d')](_0x594d42[_0x366d('0x28')],_0x594d42['query']);_0x13a6b2[_0x366d('0x2e')]=_['intersection'](_0x594d42[_0x366d('0x28')],qs['fields'](_0x5dc954[_0x366d('0x2b')][_0x366d('0x2f')]));_0x13a6b2[_0x366d('0x2e')]=_0x13a6b2[_0x366d('0x2e')]['length']?_0x13a6b2[_0x366d('0x2e')]:_0x594d42[_0x366d('0x28')];if(_0x5dc954[_0x366d('0x2b')][_0x366d('0x30')]){_0x13a6b2[_0x366d('0x31')]=[{'all':!![]}];}_0x13a6b2=_[_0x366d('0x32')]({},_0x13a6b2,_0x5dc954['options']);return db['ChatApplication'][_0x366d('0x33')](_0x13a6b2)[_0x366d('0x34')](handleEntityNotFound(_0x47cc0c,null))[_0x366d('0x34')](respondWithResult(_0x47cc0c,null))[_0x366d('0x35')](handleError(_0x47cc0c,null));};exports['update']=function(_0x2d95eb,_0x3517bc){if(_0x2d95eb[_0x366d('0x36')]['id']){delete _0x2d95eb[_0x366d('0x36')]['id'];}return db[_0x366d('0x2a')][_0x366d('0x33')]({'where':{'id':_0x2d95eb[_0x366d('0x37')]['id']}})[_0x366d('0x34')](handleEntityNotFound(_0x3517bc,null))[_0x366d('0x34')](saveUpdates(_0x2d95eb['body'],null))[_0x366d('0x34')](respondWithResult(_0x3517bc,null))[_0x366d('0x35')](handleError(_0x3517bc,null));};exports[_0x366d('0x24')]=function(_0x5a93f3,_0x7e7460){return db[_0x366d('0x2a')][_0x366d('0x33')]({'where':{'id':_0x5a93f3[_0x366d('0x37')]['id']}})[_0x366d('0x34')](handleEntityNotFound(_0x7e7460,null))[_0x366d('0x34')](removeEntity(_0x7e7460,null))['catch'](handleError(_0x7e7460,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 25a669d..9a88ee4 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 _0x0a4b=['../../config/logger','api','rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x34f7c2,_0x264892){var _0x206ea2=function(_0x1c9f7a){while(--_0x1c9f7a){_0x34f7c2['push'](_0x34f7c2['shift']());}};_0x206ea2(++_0x264892);}(_0x0a4b,0x6d));var _0xb0a4=function(_0x5c3f8a,_0x5410d1){_0x5c3f8a=_0x5c3f8a-0x0;var _0x180dfb=_0x0a4b[_0x5c3f8a];return _0x180dfb;};'use strict';var _=require(_0xb0a4('0x0'));var util=require('util');var logger=require(_0xb0a4('0x1'))(_0xb0a4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0a4('0x3'));var config=require(_0xb0a4('0x4'));var attributes=require(_0xb0a4('0x5'));module[_0xb0a4('0x6')]=function(_0x53091a,_0x44e301){return _0x53091a[_0xb0a4('0x7')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb0a4('0x8'),'collate':_0xb0a4('0x9')});};
\ No newline at end of file
+var _0xdc82=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5761a8,_0x48d34b){var _0x25020c=function(_0x4fe272){while(--_0x4fe272){_0x5761a8['push'](_0x5761a8['shift']());}};_0x25020c(++_0x48d34b);}(_0xdc82,0x104));var _0x2dc8=function(_0x304420,_0x596f86){_0x304420=_0x304420-0x0;var _0x47e829=_0xdc82[_0x304420];return _0x47e829;};'use strict';var _=require(_0x2dc8('0x0'));var util=require(_0x2dc8('0x1'));var logger=require(_0x2dc8('0x2'))('api');var moment=require(_0x2dc8('0x3'));var BPromise=require(_0x2dc8('0x4'));var rp=require(_0x2dc8('0x5'));var fs=require('fs');var path=require(_0x2dc8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2dc8('0x7'));module[_0x2dc8('0x8')]=function(_0x3249e5,_0x39cc09){return _0x3249e5[_0x2dc8('0x9')](_0x2dc8('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dc8('0xb'),'collate':_0x2dc8('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 183312f..eaab4ef 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 _0x8a38=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x5be58a,_0x5e39d4){var _0xadcedb=function(_0x9ba6bb){while(--_0x9ba6bb){_0x5be58a['push'](_0x5be58a['shift']());}};_0xadcedb(++_0x5e39d4);}(_0x8a38,0x11f));var _0x88a3=function(_0x257280,_0x2921df){_0x257280=_0x257280-0x0;var _0xc4550e=_0x8a38[_0x257280];return _0xc4550e;};'use strict';var _=require(_0x88a3('0x0'));var util=require(_0x88a3('0x1'));var moment=require(_0x88a3('0x2'));var BPromise=require(_0x88a3('0x3'));var rs=require(_0x88a3('0x4'));var fs=require('fs');var Redis=require(_0x88a3('0x5'));var db=require(_0x88a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x88a3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x88a3('0x8'));var client=jayson[_0x88a3('0x9')][_0x88a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18aeac,_0x555dec,_0x81115e){return new BPromise(function(_0x1c326b,_0x1d4c73){return client[_0x88a3('0xb')](_0x18aeac,_0x81115e)[_0x88a3('0xc')](function(_0xf8aa29){logger[_0x88a3('0xd')](_0x88a3('0xe'),_0x555dec,_0x88a3('0xf'));logger[_0x88a3('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x555dec,_0x88a3('0xf'),JSON['stringify'](_0xf8aa29));if(_0xf8aa29['error']){if(_0xf8aa29[_0x88a3('0x11')][_0x88a3('0x12')]===0x1f4){logger[_0x88a3('0x11')]('ChatApplication,\x20%s,\x20%s',_0x555dec,_0xf8aa29[_0x88a3('0x11')][_0x88a3('0x13')]);return _0x1d4c73(_0xf8aa29['error'][_0x88a3('0x13')]);}logger['error'](_0x88a3('0xe'),_0x555dec,_0xf8aa29[_0x88a3('0x11')][_0x88a3('0x13')]);return _0x1c326b(_0xf8aa29[_0x88a3('0x11')][_0x88a3('0x13')]);}else{logger['info'](_0x88a3('0xe'),_0x555dec,_0x88a3('0xf'));_0x1c326b(_0xf8aa29[_0x88a3('0x14')][_0x88a3('0x13')]);}})[_0x88a3('0x15')](function(_0x311052){logger[_0x88a3('0x11')]('ChatApplication,\x20%s,\x20%s',_0x555dec,_0x311052);_0x1d4c73(_0x311052);});});}
\ No newline at end of file
+var _0x0a67=['../../config/logger','jayson/promise','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3c373f,_0x41801d){var _0x3a6b1f=function(_0x33c487){while(--_0x33c487){_0x3c373f['push'](_0x3c373f['shift']());}};_0x3a6b1f(++_0x41801d);}(_0x0a67,0x19d));var _0x70a6=function(_0x47ed6c,_0x2386ab){_0x47ed6c=_0x47ed6c-0x0;var _0x491bdf=_0x0a67[_0x47ed6c];return _0x491bdf;};'use strict';var _=require(_0x70a6('0x0'));var util=require(_0x70a6('0x1'));var moment=require('moment');var BPromise=require(_0x70a6('0x2'));var rs=require(_0x70a6('0x3'));var fs=require('fs');var Redis=require(_0x70a6('0x4'));var db=require(_0x70a6('0x5'))['db'];var utils=require(_0x70a6('0x6'));var logger=require(_0x70a6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x70a6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f8a3f,_0x577505,_0x316864){return new BPromise(function(_0x43abc1,_0x444149){return client[_0x70a6('0x9')](_0x1f8a3f,_0x316864)[_0x70a6('0xa')](function(_0xd65d3b){logger[_0x70a6('0xb')]('ChatApplication,\x20%s,\x20%s',_0x577505,_0x70a6('0xc'));logger[_0x70a6('0xd')](_0x70a6('0xe'),_0x577505,_0x70a6('0xc'),JSON[_0x70a6('0xf')](_0xd65d3b));if(_0xd65d3b[_0x70a6('0x10')]){if(_0xd65d3b[_0x70a6('0x10')]['code']===0x1f4){logger[_0x70a6('0x10')](_0x70a6('0x11'),_0x577505,_0xd65d3b[_0x70a6('0x10')][_0x70a6('0x12')]);return _0x444149(_0xd65d3b[_0x70a6('0x10')][_0x70a6('0x12')]);}logger['error'](_0x70a6('0x11'),_0x577505,_0xd65d3b[_0x70a6('0x10')][_0x70a6('0x12')]);return _0x43abc1(_0xd65d3b['error'][_0x70a6('0x12')]);}else{logger[_0x70a6('0xb')](_0x70a6('0x11'),_0x577505,_0x70a6('0xc'));_0x43abc1(_0xd65d3b[_0x70a6('0x13')]['message']);}})[_0x70a6('0x14')](function(_0x1bd023){logger['error'](_0x70a6('0x11'),_0x577505,_0x1bd023);_0x444149(_0x1bd023);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index c96a4b1..6f72957 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 _0x5805=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','show','put','delete','destroy'];(function(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0x5805,0x152));var _0x5580=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5805[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x5580('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5580('0x1'));var express=require(_0x5580('0x2'));var router=express[_0x5580('0x3')]();var fs_extra=require(_0x5580('0x4'));var auth=require(_0x5580('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5580('0x6'));var controller=require('./chatApplication.controller');router['get'](_0x5580('0x7'),auth[_0x5580('0x8')](),controller[_0x5580('0x9')]);router[_0x5580('0xa')]('/:id',auth[_0x5580('0x8')](),controller['update']);router[_0x5580('0xb')](_0x5580('0x7'),auth[_0x5580('0x8')](),controller[_0x5580('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x4c78=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3db750,_0x5d66c2){var _0x5427a=function(_0x41fdb8){while(--_0x41fdb8){_0x3db750['push'](_0x3db750['shift']());}};_0x5427a(++_0x5d66c2);}(_0x4c78,0x14d));var _0x84c7=function(_0x34a378,_0x1509b8){_0x34a378=_0x34a378-0x0;var _0x296df0=_0x4c78[_0x34a378];return _0x296df0;};'use strict';var multer=require(_0x84c7('0x0'));var util=require(_0x84c7('0x1'));var path=require(_0x84c7('0x2'));var timeout=require(_0x84c7('0x3'));var express=require(_0x84c7('0x4'));var router=express[_0x84c7('0x5')]();var fs_extra=require(_0x84c7('0x6'));var auth=require(_0x84c7('0x7'));var interaction=require(_0x84c7('0x8'));var config=require(_0x84c7('0x9'));var controller=require(_0x84c7('0xa'));router[_0x84c7('0xb')](_0x84c7('0xc'),auth[_0x84c7('0xd')](),controller[_0x84c7('0xe')]);router[_0x84c7('0xf')](_0x84c7('0xc'),auth[_0x84c7('0xd')](),controller['update']);router[_0x84c7('0x10')]('/:id',auth[_0x84c7('0xd')](),controller['destroy']);module[_0x84c7('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index e95d9db..c0b277f 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 _0xf068=['STRING'];(function(_0x4fb9ed,_0x187ea0){var _0x263645=function(_0x11c604){while(--_0x11c604){_0x4fb9ed['push'](_0x4fb9ed['shift']());}};_0x263645(++_0x187ea0);}(_0xf068,0x8b));var _0x8f06=function(_0xc99c1d,_0x4ae3ea){_0xc99c1d=_0xc99c1d-0x0;var _0x1adbc6=_0xf068[_0xc99c1d];return _0x1adbc6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8f06('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x8f06('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2237=['sequelize','exports','STRING','BOOLEAN'];(function(_0xe5ee4f,_0x4a6510){var _0x60662b=function(_0x35d981){while(--_0x35d981){_0xe5ee4f['push'](_0xe5ee4f['shift']());}};_0x60662b(++_0x4a6510);}(_0x2237,0x124));var _0x7223=function(_0x4c1b3b,_0x1f8401){_0x4c1b3b=_0x4c1b3b-0x0;var _0x38b5bd=_0x2237[_0x4c1b3b];return _0x38b5bd;};'use strict';var Sequelize=require(_0x7223('0x0'));module[_0x7223('0x1')]={'name':{'type':Sequelize[_0x7223('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7223('0x2')]},'write':{'type':Sequelize[_0x7223('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 0c996f3..8d6d1ed 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 _0x7daa=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','./chatGroup.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','show','params','keys','length','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x221465,_0x4aed6c){var _0x550c92=function(_0x2373d4){while(--_0x2373d4){_0x221465['push'](_0x221465['shift']());}};_0x550c92(++_0x4aed6c);}(_0x7daa,0xb1));var _0xa7da=function(_0x6a5860,_0x14d03e){_0x6a5860=_0x6a5860-0x0;var _0x4c6ad9=_0x7daa[_0x6a5860];return _0x4c6ad9;};'use strict';var emlformat=require(_0xa7da('0x0'));var rimraf=require(_0xa7da('0x1'));var zipdir=require(_0xa7da('0x2'));var jsonpatch=require(_0xa7da('0x3'));var rp=require(_0xa7da('0x4'));var moment=require(_0xa7da('0x5'));var BPromise=require(_0xa7da('0x6'));var Mustache=require(_0xa7da('0x7'));var util=require(_0xa7da('0x8'));var path=require(_0xa7da('0x9'));var sox=require('sox');var csv=require(_0xa7da('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7da('0xb'));var squel=require('squel');var crypto=require(_0xa7da('0xc'));var jsforce=require(_0xa7da('0xd'));var deskjs=require(_0xa7da('0xe'));var toCsv=require(_0xa7da('0xa'));var querystring=require(_0xa7da('0xf'));var Papa=require(_0xa7da('0x10'));var Redis=require(_0xa7da('0x11'));var authService=require(_0xa7da('0x12'));var qs=require(_0xa7da('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7da('0x14'));var logger=require(_0xa7da('0x15'))(_0xa7da('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa7da('0x17'));var db=require(_0xa7da('0x18'))['db'];config['redis']=_['defaults'](config[_0xa7da('0x19')],{'host':_0xa7da('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa7da('0x1b'))[_0xa7da('0x1c')](socket);function respondWithStatusCode(_0xc83064,_0x2ad29d){_0x2ad29d=_0x2ad29d||0xcc;return function(_0xd6493b){if(_0xd6493b){return _0xc83064[_0xa7da('0x1d')](_0x2ad29d);}return _0xc83064['status'](_0x2ad29d)['end']();};}function respondWithResult(_0x4f11a1,_0x44b286){_0x44b286=_0x44b286||0xc8;return function(_0x55b4aa){if(_0x55b4aa){return _0x4f11a1[_0xa7da('0x1e')](_0x44b286)['json'](_0x55b4aa);}};}function respondWithFilteredResult(_0x314a1b,_0x59cdb3){return function(_0x5ba0ce){if(_0x5ba0ce){var _0x281ec6=typeof _0x59cdb3[_0xa7da('0x1f')]===_0xa7da('0x20')&&typeof _0x59cdb3['limit']==='undefined';var _0x2e31e4=_0x5ba0ce[_0xa7da('0x21')];var _0x5bf6a6=_0x281ec6?0x0:_0x59cdb3[_0xa7da('0x1f')];var _0x2a55b9=_0x281ec6?_0x5ba0ce['count']:_0x59cdb3[_0xa7da('0x1f')]+_0x59cdb3[_0xa7da('0x22')];var _0x447948;if(_0x2a55b9>=_0x2e31e4){_0x2a55b9=_0x2e31e4;_0x447948=0xc8;}else{_0x447948=0xce;}_0x314a1b[_0xa7da('0x1e')](_0x447948);return _0x314a1b[_0xa7da('0x23')](_0xa7da('0x24'),_0x5bf6a6+'-'+_0x2a55b9+'/'+_0x2e31e4)[_0xa7da('0x25')](_0x5ba0ce);}return null;};}function patchUpdates(_0x423410){return function(_0x2343a9){try{jsonpatch[_0xa7da('0x26')](_0x2343a9,_0x423410,!![]);}catch(_0x3174ab){return BPromise[_0xa7da('0x27')](_0x3174ab);}return _0x2343a9[_0xa7da('0x28')]();};}function saveUpdates(_0x21456d,_0x272404){return function(_0x117f1e){if(_0x117f1e){return _0x117f1e[_0xa7da('0x29')](_0x21456d)['then'](function(_0x21a926){return _0x21a926;});}return null;};}function removeEntity(_0x4a0bd1,_0x48d04e){return function(_0xa1ab53){if(_0xa1ab53){return _0xa1ab53[_0xa7da('0x2a')]()[_0xa7da('0x2b')](function(){_0x4a0bd1['status'](0xcc)[_0xa7da('0x2c')]();});}};}function handleEntityNotFound(_0x324b30,_0x123917){return function(_0xb55cc4){if(!_0xb55cc4){_0x324b30[_0xa7da('0x1d')](0x194);}return _0xb55cc4;};}function handleError(_0x2f477d,_0x2ab1b1){_0x2ab1b1=_0x2ab1b1||0x1f4;return function(_0x5e183e){logger[_0xa7da('0x2d')](_0x5e183e['stack']);if(_0x5e183e[_0xa7da('0x2e')]){delete _0x5e183e[_0xa7da('0x2e')];}_0x2f477d[_0xa7da('0x1e')](_0x2ab1b1)[_0xa7da('0x2f')](_0x5e183e);};}exports[_0xa7da('0x30')]=function(_0x2a844b,_0x429874){var _0xc80c16={},_0x41d758={},_0x3f3554={'count':0x0,'rows':[]};var _0x1f8f02=_[_0xa7da('0x31')](db[_0xa7da('0x32')][_0xa7da('0x33')],function(_0x393eb8){return{'name':_0x393eb8[_0xa7da('0x34')],'type':_0x393eb8['type'][_0xa7da('0x35')]};});_0x41d758[_0xa7da('0x36')]=_[_0xa7da('0x31')](_0x1f8f02,_0xa7da('0x2e'));_0x41d758[_0xa7da('0x37')]=_['keys'](_0x2a844b['query']);_0x41d758[_0xa7da('0x38')]=_[_0xa7da('0x39')](_0x41d758[_0xa7da('0x36')],_0x41d758[_0xa7da('0x37')]);_0xc80c16[_0xa7da('0x3a')]=_[_0xa7da('0x39')](_0x41d758[_0xa7da('0x36')],qs[_0xa7da('0x3b')](_0x2a844b[_0xa7da('0x37')]['fields']));_0xc80c16[_0xa7da('0x3a')]=_0xc80c16[_0xa7da('0x3a')]['length']?_0xc80c16[_0xa7da('0x3a')]:_0x41d758[_0xa7da('0x36')];if(!_0x2a844b['query'][_0xa7da('0x3c')]('nolimit')){_0xc80c16[_0xa7da('0x22')]=qs[_0xa7da('0x22')](_0x2a844b[_0xa7da('0x37')]['limit']);_0xc80c16[_0xa7da('0x1f')]=qs[_0xa7da('0x1f')](_0x2a844b[_0xa7da('0x37')][_0xa7da('0x1f')]);}_0xc80c16[_0xa7da('0x3d')]=qs[_0xa7da('0x3e')](_0x2a844b[_0xa7da('0x37')][_0xa7da('0x3e')]);_0xc80c16[_0xa7da('0x3f')]=qs[_0xa7da('0x38')](_[_0xa7da('0x40')](_0x2a844b[_0xa7da('0x37')],_0x41d758[_0xa7da('0x38')]),_0x1f8f02);if(_0x2a844b[_0xa7da('0x37')][_0xa7da('0x41')]){_0xc80c16[_0xa7da('0x3f')]=_[_0xa7da('0x42')](_0xc80c16[_0xa7da('0x3f')],{'$or':_[_0xa7da('0x31')](_0x1f8f02,function(_0x13dde5){if(_0x13dde5[_0xa7da('0x43')]!==_0xa7da('0x44')){var _0x38191f={};_0x38191f[_0x13dde5['name']]={'$like':'%'+_0x2a844b[_0xa7da('0x37')][_0xa7da('0x41')]+'%'};return _0x38191f;}})});}_0xc80c16=_[_0xa7da('0x42')]({},_0xc80c16,_0x2a844b['options']);var _0x8bdecd={'where':_0xc80c16[_0xa7da('0x3f')]};return db['ChatGroup'][_0xa7da('0x21')](_0x8bdecd)[_0xa7da('0x2b')](function(_0x3a7171){_0x3f3554[_0xa7da('0x21')]=_0x3a7171;if(_0x2a844b[_0xa7da('0x37')][_0xa7da('0x45')]){_0xc80c16[_0xa7da('0x46')]=[{'all':!![]}];}return db[_0xa7da('0x32')]['findAll'](_0xc80c16);})[_0xa7da('0x2b')](function(_0x3024fa){_0x3f3554['rows']=_0x3024fa;return _0x3f3554;})[_0xa7da('0x2b')](respondWithFilteredResult(_0x429874,_0xc80c16))[_0xa7da('0x47')](handleError(_0x429874,null));};exports[_0xa7da('0x48')]=function(_0x3b1928,_0x50aa5d){var _0x29f8e7={'raw':!![],'where':{'id':_0x3b1928[_0xa7da('0x49')]['id']}},_0x4650cf={};_0x4650cf[_0xa7da('0x36')]=_[_0xa7da('0x4a')](db[_0xa7da('0x32')][_0xa7da('0x33')]);_0x4650cf[_0xa7da('0x37')]=_['keys'](_0x3b1928[_0xa7da('0x37')]);_0x4650cf[_0xa7da('0x38')]=_['intersection'](_0x4650cf['model'],_0x4650cf[_0xa7da('0x37')]);_0x29f8e7[_0xa7da('0x3a')]=_[_0xa7da('0x39')](_0x4650cf[_0xa7da('0x36')],qs[_0xa7da('0x3b')](_0x3b1928[_0xa7da('0x37')]['fields']));_0x29f8e7[_0xa7da('0x3a')]=_0x29f8e7[_0xa7da('0x3a')][_0xa7da('0x4b')]?_0x29f8e7['attributes']:_0x4650cf[_0xa7da('0x36')];if(_0x3b1928[_0xa7da('0x37')][_0xa7da('0x45')]){_0x29f8e7['include']=[{'all':!![]}];}_0x29f8e7=_[_0xa7da('0x42')]({},_0x29f8e7,_0x3b1928[_0xa7da('0x4c')]);return db[_0xa7da('0x32')][_0xa7da('0x4d')](_0x29f8e7)['then'](handleEntityNotFound(_0x50aa5d,null))[_0xa7da('0x2b')](respondWithResult(_0x50aa5d,null))['catch'](handleError(_0x50aa5d,null));};exports[_0xa7da('0x4e')]=function(_0x1a9bdf,_0x8e81b9){return db[_0xa7da('0x32')][_0xa7da('0x4e')](_0x1a9bdf[_0xa7da('0x4f')],{})[_0xa7da('0x2b')](respondWithResult(_0x8e81b9,0xc9))[_0xa7da('0x47')](handleError(_0x8e81b9,null));};exports[_0xa7da('0x29')]=function(_0x565a90,_0x362fce){if(_0x565a90[_0xa7da('0x4f')]['id']){delete _0x565a90[_0xa7da('0x4f')]['id'];}return db['ChatGroup'][_0xa7da('0x4d')]({'where':{'id':_0x565a90[_0xa7da('0x49')]['id']}})[_0xa7da('0x2b')](handleEntityNotFound(_0x362fce,null))[_0xa7da('0x2b')](saveUpdates(_0x565a90[_0xa7da('0x4f')],null))['then'](respondWithResult(_0x362fce,null))[_0xa7da('0x47')](handleError(_0x362fce,null));};exports['destroy']=function(_0x47f713,_0x368ab9){return db[_0xa7da('0x32')][_0xa7da('0x4d')]({'where':{'id':_0x47f713[_0xa7da('0x49')]['id']}})[_0xa7da('0x2b')](handleEntityNotFound(_0x368ab9,null))[_0xa7da('0x2b')](removeEntity(_0x368ab9,null))[_0xa7da('0x47')](handleError(_0x368ab9,null));};exports[_0xa7da('0x50')]=function(_0x123e90,_0x6096fd){return db[_0xa7da('0x32')][_0xa7da('0x50')]()[_0xa7da('0x2b')](respondWithResult(_0x6096fd,null))[_0xa7da('0x47')](handleError(_0x6096fd,null));};exports[_0xa7da('0x51')]=function(_0xd84b48,_0x415d9a,_0x342900){return db[_0xa7da('0x52')][_0xa7da('0x21')]({'where':{'ChatGroupId':_0xd84b48[_0xa7da('0x49')]['id'],'ToId':_0xd84b48[_0xa7da('0x53')]['id'],'read':![]}})[_0xa7da('0x2b')](function(_0x524c0c){return{'id':_[_0xa7da('0x54')](_0xd84b48[_0xa7da('0x49')]['id']),'count':_0x524c0c};})[_0xa7da('0x2b')](respondWithResult(_0x415d9a,null))[_0xa7da('0x47')](handleError(_0x415d9a,null));};exports[_0xa7da('0x55')]=function(_0x36d6cb,_0x40d044,_0xa0bbb5){return db['ChatGroup'][_0xa7da('0x4d')]({'where':{'id':_0x36d6cb[_0xa7da('0x49')]['id']}})['then'](handleEntityNotFound(_0x40d044,null))[_0xa7da('0x2b')](function(_0x57cdb1){if(_0x57cdb1){return _0x57cdb1[_0xa7da('0x55')](_0x36d6cb[_0xa7da('0x4f')][_0xa7da('0x56')],_['omit'](_0x36d6cb[_0xa7da('0x4f')],[_0xa7da('0x56'),'id'])||{});}})[_0xa7da('0x2b')](respondWithResult(_0x40d044,null))[_0xa7da('0x47')](handleError(_0x40d044,null));};exports[_0xa7da('0x57')]=function(_0x544ed6,_0x78a524,_0x99807b){var _0x3e5f8e={};var _0x4f1bbe={};var _0x175f17;var _0x321335;return db[_0xa7da('0x32')][_0xa7da('0x58')]({'where':{'id':_0x544ed6[_0xa7da('0x49')]['id']}})[_0xa7da('0x2b')](handleEntityNotFound(_0x78a524,null))[_0xa7da('0x2b')](function(_0x301ba2){if(_0x301ba2){_0x175f17=_0x301ba2;_0x4f1bbe['model']=_['keys'](db['User'][_0xa7da('0x33')]);_0x4f1bbe[_0xa7da('0x37')]=_['keys'](_0x544ed6[_0xa7da('0x37')]);_0x4f1bbe[_0xa7da('0x38')]=_[_0xa7da('0x39')](_0x4f1bbe['model'],_0x4f1bbe[_0xa7da('0x37')]);_0x3e5f8e[_0xa7da('0x3a')]=_[_0xa7da('0x39')](_0x4f1bbe['model'],qs[_0xa7da('0x3b')](_0x544ed6[_0xa7da('0x37')][_0xa7da('0x3b')]));_0x3e5f8e[_0xa7da('0x3a')]=_0x3e5f8e['attributes'][_0xa7da('0x4b')]?_0x3e5f8e[_0xa7da('0x3a')]:_0x4f1bbe[_0xa7da('0x36')];_0x3e5f8e[_0xa7da('0x3d')]=qs[_0xa7da('0x3e')](_0x544ed6[_0xa7da('0x37')]['sort']);_0x3e5f8e[_0xa7da('0x3f')]=qs[_0xa7da('0x38')](_[_0xa7da('0x40')](_0x544ed6[_0xa7da('0x37')],_0x4f1bbe[_0xa7da('0x38')]));if(_0x544ed6['query'][_0xa7da('0x41')]){_0x3e5f8e['where']=_[_0xa7da('0x42')](_0x3e5f8e['where'],{'$or':_['map'](_0x3e5f8e[_0xa7da('0x3a')],function(_0x8dcd7f){var _0x514be9={};_0x514be9[_0x8dcd7f]={'$like':'%'+_0x544ed6[_0xa7da('0x37')]['filter']+'%'};return _0x514be9;})});}_0x3e5f8e=_[_0xa7da('0x42')]({},_0x3e5f8e,_0x544ed6[_0xa7da('0x4c')]);return _0x175f17[_0xa7da('0x57')](_0x3e5f8e);}})[_0xa7da('0x2b')](function(_0x437dd6){if(_0x437dd6){_0x321335=_0x437dd6['length'];if(!_0x544ed6[_0xa7da('0x37')][_0xa7da('0x3c')]('nolimit')){_0x3e5f8e['limit']=qs['limit'](_0x544ed6['query'][_0xa7da('0x22')]);_0x3e5f8e[_0xa7da('0x1f')]=qs[_0xa7da('0x1f')](_0x544ed6[_0xa7da('0x37')][_0xa7da('0x1f')]);}return _0x175f17[_0xa7da('0x57')](_0x3e5f8e);}})['then'](function(_0x4b2822){if(_0x4b2822){return _0x4b2822?{'count':_0x321335,'rows':_0x4b2822}:null;}})['then'](respondWithResult(_0x78a524,null))[_0xa7da('0x47')](handleError(_0x78a524,null));};exports[_0xa7da('0x59')]=function(_0x1f8d89,_0x3aa69a,_0x294243){return db[_0xa7da('0x32')][_0xa7da('0x4d')]({'where':{'id':_0x1f8d89['params']['id']}})['then'](handleEntityNotFound(_0x3aa69a,null))[_0xa7da('0x2b')](function(_0x61b8d){if(_0x61b8d){return _0x61b8d[_0xa7da('0x59')](_0x1f8d89[_0xa7da('0x37')][_0xa7da('0x56')]);}})[_0xa7da('0x2b')](respondWithStatusCode(_0x3aa69a,null))[_0xa7da('0x47')](handleError(_0x3aa69a,null));};exports[_0xa7da('0x5a')]=function(_0x16926a,_0x511788,_0x5dbf79){if(_0x16926a['body']['id']){delete _0x16926a[_0xa7da('0x4f')]['id'];}return db[_0xa7da('0x32')][_0xa7da('0x4d')]({'where':{'id':_0x16926a[_0xa7da('0x49')]['id']}})['then'](handleEntityNotFound(_0x511788,null))[_0xa7da('0x2b')](function(_0x8bdef0){if(_0x8bdef0){_0x16926a['body']['ChatGroupId']=_0x8bdef0['id'];return db['ChatInternalMessage'][_0xa7da('0x4e')](_0x16926a[_0xa7da('0x4f')]);}})[_0xa7da('0x2b')](respondWithResult(_0x511788,null))['catch'](handleError(_0x511788,null));};exports[_0xa7da('0x5b')]=function(_0x13a726,_0x1922dc,_0x363c4b){var _0x442947={};var _0x3a32f8={};var _0x462e17;var _0x1f30e8;return db[_0xa7da('0x32')][_0xa7da('0x58')]({'where':{'id':_0x13a726[_0xa7da('0x49')]['id']}})[_0xa7da('0x2b')](handleEntityNotFound(_0x1922dc,null))[_0xa7da('0x2b')](function(_0x29240c){if(_0x29240c){_0x462e17=_0x29240c;_0x3a32f8[_0xa7da('0x36')]=_[_0xa7da('0x4a')](db[_0xa7da('0x52')]['rawAttributes']);_0x3a32f8[_0xa7da('0x37')]=_['keys'](_0x13a726[_0xa7da('0x37')]);_0x3a32f8[_0xa7da('0x38')]=_['intersection'](_0x3a32f8[_0xa7da('0x36')],_0x3a32f8[_0xa7da('0x37')]);_0x442947[_0xa7da('0x3a')]=_[_0xa7da('0x39')](_0x3a32f8[_0xa7da('0x36')],qs[_0xa7da('0x3b')](_0x13a726[_0xa7da('0x37')][_0xa7da('0x3b')]));_0x442947[_0xa7da('0x3a')]=_0x442947[_0xa7da('0x3a')]['length']?_0x442947['attributes']:_0x3a32f8['model'];_0x442947[_0xa7da('0x3d')]=qs[_0xa7da('0x3e')](_0x13a726['query']['sort']);_0x442947['where']=qs[_0xa7da('0x38')](_[_0xa7da('0x40')](_0x13a726[_0xa7da('0x37')],_0x3a32f8[_0xa7da('0x38')]));if(_0x13a726['query'][_0xa7da('0x41')]){_0x442947[_0xa7da('0x3f')]=_[_0xa7da('0x42')](_0x442947[_0xa7da('0x3f')],{'$or':_['map'](_0x442947[_0xa7da('0x3a')],function(_0x24d690){var _0x4c9c98={};_0x4c9c98[_0x24d690]={'$like':'%'+_0x13a726[_0xa7da('0x37')][_0xa7da('0x41')]+'%'};return _0x4c9c98;})});}if(_0x13a726['query'][_0xa7da('0x5c')]){var _0x58b43b=_0x13a726[_0xa7da('0x37')][_0xa7da('0x5c')][_0xa7da('0x5d')](',');var _0x42eb81={};_0x42eb81[_0x58b43b[0x0]]={'$gte':moment(_0x58b43b[0x1])[_0xa7da('0x5e')](_0xa7da('0x5f'))};_0x442947['where']=_[_0xa7da('0x42')](_0x442947['where'],_0x42eb81);}_0x442947=_[_0xa7da('0x42')]({},_0x442947,_0x13a726['options']);return _0x462e17[_0xa7da('0x5b')](_0x442947);}})[_0xa7da('0x2b')](function(_0x380091){if(_0x380091){_0x1f30e8=_0x380091[_0xa7da('0x4b')];if(!_0x13a726[_0xa7da('0x37')][_0xa7da('0x3c')](_0xa7da('0x60'))){_0x442947[_0xa7da('0x22')]=qs[_0xa7da('0x22')](_0x13a726['query'][_0xa7da('0x22')]);_0x442947[_0xa7da('0x1f')]=qs[_0xa7da('0x1f')](_0x13a726[_0xa7da('0x37')][_0xa7da('0x1f')]);}return _0x462e17[_0xa7da('0x5b')](_0x442947);}})['then'](function(_0x262b93){if(_0x262b93){return _0x262b93?{'count':_0x1f30e8,'rows':_0x262b93}:null;}})[_0xa7da('0x2b')](respondWithResult(_0x1922dc,null))[_0xa7da('0x47')](handleError(_0x1922dc,null));};
\ No newline at end of file
+var _0x64fb=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','destroy','then','error','stack','name','send','map','ChatGroup','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2c944e,_0x26f659){var _0x2cc529=function(_0x3fbc4b){while(--_0x3fbc4b){_0x2c944e['push'](_0x2c944e['shift']());}};_0x2cc529(++_0x26f659);}(_0x64fb,0x16d));var _0xb64f=function(_0x55b884,_0x2ce62f){_0x55b884=_0x55b884-0x0;var _0x1cc64b=_0x64fb[_0x55b884];return _0x1cc64b;};'use strict';var emlformat=require(_0xb64f('0x0'));var rimraf=require(_0xb64f('0x1'));var zipdir=require(_0xb64f('0x2'));var jsonpatch=require(_0xb64f('0x3'));var rp=require(_0xb64f('0x4'));var moment=require(_0xb64f('0x5'));var BPromise=require(_0xb64f('0x6'));var Mustache=require(_0xb64f('0x7'));var util=require(_0xb64f('0x8'));var path=require('path');var sox=require(_0xb64f('0x9'));var csv=require(_0xb64f('0xa'));var ejs=require(_0xb64f('0xb'));var fs=require('fs');var fs_extra=require(_0xb64f('0xc'));var _=require(_0xb64f('0xd'));var squel=require(_0xb64f('0xe'));var crypto=require(_0xb64f('0xf'));var jsforce=require(_0xb64f('0x10'));var deskjs=require(_0xb64f('0x11'));var toCsv=require(_0xb64f('0xa'));var querystring=require(_0xb64f('0x12'));var Papa=require(_0xb64f('0x13'));var Redis=require(_0xb64f('0x14'));var authService=require(_0xb64f('0x15'));var qs=require(_0xb64f('0x16'));var as=require(_0xb64f('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb64f('0x18'))(_0xb64f('0x19'));var utils=require('../../config/utils');var config=require(_0xb64f('0x1a'));var licenseUtil=require(_0xb64f('0x1b'));var db=require(_0xb64f('0x1c'))['db'];config['redis']=_[_0xb64f('0x1d')](config[_0xb64f('0x1e')],{'host':_0xb64f('0x1f'),'port':0x18eb});var socket=require(_0xb64f('0x20'))(new Redis(config[_0xb64f('0x1e')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x5cf788,_0x307583){_0x307583=_0x307583||0xcc;return function(_0x2ee7ac){if(_0x2ee7ac){return _0x5cf788[_0xb64f('0x21')](_0x307583);}return _0x5cf788['status'](_0x307583)[_0xb64f('0x22')]();};}function respondWithResult(_0x2c86fc,_0x4ba778){_0x4ba778=_0x4ba778||0xc8;return function(_0x479eeb){if(_0x479eeb){return _0x2c86fc[_0xb64f('0x23')](_0x4ba778)['json'](_0x479eeb);}};}function respondWithFilteredResult(_0x23a979,_0x116294){return function(_0x52fcb3){if(_0x52fcb3){var _0x359d99=typeof _0x116294[_0xb64f('0x24')]===_0xb64f('0x25')&&typeof _0x116294[_0xb64f('0x26')]==='undefined';var _0xc33cc9=_0x52fcb3[_0xb64f('0x27')];var _0x5e9a4d=_0x359d99?0x0:_0x116294[_0xb64f('0x24')];var _0x382a89=_0x359d99?_0x52fcb3[_0xb64f('0x27')]:_0x116294[_0xb64f('0x24')]+_0x116294[_0xb64f('0x26')];var _0x35c8b2;if(_0x382a89>=_0xc33cc9){_0x382a89=_0xc33cc9;_0x35c8b2=0xc8;}else{_0x35c8b2=0xce;}_0x23a979[_0xb64f('0x23')](_0x35c8b2);return _0x23a979['set'](_0xb64f('0x28'),_0x5e9a4d+'-'+_0x382a89+'/'+_0xc33cc9)[_0xb64f('0x29')](_0x52fcb3);}return null;};}function patchUpdates(_0x5c7534){return function(_0x88bc24){try{jsonpatch[_0xb64f('0x2a')](_0x88bc24,_0x5c7534,!![]);}catch(_0x5082ee){return BPromise['reject'](_0x5082ee);}return _0x88bc24[_0xb64f('0x2b')]();};}function saveUpdates(_0x4a4ef8,_0x3bdcf3){return function(_0x28d17a){if(_0x28d17a){return _0x28d17a['update'](_0x4a4ef8)['then'](function(_0x31e94c){return _0x31e94c;});}return null;};}function removeEntity(_0x5c5b03,_0x1c97da){return function(_0x5592e3){if(_0x5592e3){return _0x5592e3[_0xb64f('0x2c')]()[_0xb64f('0x2d')](function(){_0x5c5b03[_0xb64f('0x23')](0xcc)[_0xb64f('0x22')]();});}};}function handleEntityNotFound(_0x23c457,_0x1d08c4){return function(_0x47e2e){if(!_0x47e2e){_0x23c457[_0xb64f('0x21')](0x194);}return _0x47e2e;};}function handleError(_0x529d33,_0x2f20a7){_0x2f20a7=_0x2f20a7||0x1f4;return function(_0x4e4ceb){logger[_0xb64f('0x2e')](_0x4e4ceb[_0xb64f('0x2f')]);if(_0x4e4ceb['name']){delete _0x4e4ceb[_0xb64f('0x30')];}_0x529d33['status'](_0x2f20a7)[_0xb64f('0x31')](_0x4e4ceb);};}exports['index']=function(_0x2a2d05,_0xf01027){var _0x539494={},_0x300265={},_0x34b894={'count':0x0,'rows':[]};var _0x41f010=_[_0xb64f('0x32')](db[_0xb64f('0x33')][_0xb64f('0x34')],function(_0x577762){return{'name':_0x577762['fieldName'],'type':_0x577762['type'][_0xb64f('0x35')]};});_0x300265[_0xb64f('0x36')]=_['map'](_0x41f010,_0xb64f('0x30'));_0x300265[_0xb64f('0x37')]=_[_0xb64f('0x38')](_0x2a2d05[_0xb64f('0x37')]);_0x300265['filters']=_['intersection'](_0x300265[_0xb64f('0x36')],_0x300265[_0xb64f('0x37')]);_0x539494[_0xb64f('0x39')]=_[_0xb64f('0x3a')](_0x300265['model'],qs['fields'](_0x2a2d05['query'][_0xb64f('0x3b')]));_0x539494[_0xb64f('0x39')]=_0x539494['attributes'][_0xb64f('0x3c')]?_0x539494['attributes']:_0x300265[_0xb64f('0x36')];if(!_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x3d')](_0xb64f('0x3e'))){_0x539494[_0xb64f('0x26')]=qs[_0xb64f('0x26')](_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x26')]);_0x539494[_0xb64f('0x24')]=qs[_0xb64f('0x24')](_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x24')]);}_0x539494[_0xb64f('0x3f')]=qs[_0xb64f('0x40')](_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x40')]);_0x539494[_0xb64f('0x41')]=qs[_0xb64f('0x42')](_[_0xb64f('0x43')](_0x2a2d05['query'],_0x300265[_0xb64f('0x42')]),_0x41f010);if(_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x44')]){_0x539494['where']=_['merge'](_0x539494[_0xb64f('0x41')],{'$or':_[_0xb64f('0x32')](_0x41f010,function(_0x5da287){if(_0x5da287[_0xb64f('0x45')]!=='VIRTUAL'){var _0x689437={};_0x689437[_0x5da287[_0xb64f('0x30')]]={'$like':'%'+_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x44')]+'%'};return _0x689437;}})});}_0x539494=_['merge']({},_0x539494,_0x2a2d05[_0xb64f('0x46')]);var _0x1e7101={'where':_0x539494[_0xb64f('0x41')]};return db[_0xb64f('0x33')][_0xb64f('0x27')](_0x1e7101)[_0xb64f('0x2d')](function(_0x2cb34a){_0x34b894[_0xb64f('0x27')]=_0x2cb34a;if(_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x47')]){_0x539494[_0xb64f('0x48')]=[{'all':!![]}];}return db['ChatGroup'][_0xb64f('0x49')](_0x539494);})[_0xb64f('0x2d')](function(_0x2427b4){_0x34b894['rows']=_0x2427b4;return _0x34b894;})['then'](respondWithFilteredResult(_0xf01027,_0x539494))[_0xb64f('0x4a')](handleError(_0xf01027,null));};exports[_0xb64f('0x4b')]=function(_0x2d53e6,_0x127355){var _0x3e1a08={'raw':!![],'where':{'id':_0x2d53e6[_0xb64f('0x4c')]['id']}},_0x591410={};_0x591410[_0xb64f('0x36')]=_['keys'](db['ChatGroup'][_0xb64f('0x34')]);_0x591410[_0xb64f('0x37')]=_[_0xb64f('0x38')](_0x2d53e6['query']);_0x591410[_0xb64f('0x42')]=_[_0xb64f('0x3a')](_0x591410[_0xb64f('0x36')],_0x591410[_0xb64f('0x37')]);_0x3e1a08[_0xb64f('0x39')]=_['intersection'](_0x591410[_0xb64f('0x36')],qs['fields'](_0x2d53e6[_0xb64f('0x37')][_0xb64f('0x3b')]));_0x3e1a08[_0xb64f('0x39')]=_0x3e1a08[_0xb64f('0x39')][_0xb64f('0x3c')]?_0x3e1a08['attributes']:_0x591410[_0xb64f('0x36')];if(_0x2d53e6[_0xb64f('0x37')][_0xb64f('0x47')]){_0x3e1a08['include']=[{'all':!![]}];}_0x3e1a08=_[_0xb64f('0x4d')]({},_0x3e1a08,_0x2d53e6['options']);return db[_0xb64f('0x33')][_0xb64f('0x4e')](_0x3e1a08)[_0xb64f('0x2d')](handleEntityNotFound(_0x127355,null))[_0xb64f('0x2d')](respondWithResult(_0x127355,null))['catch'](handleError(_0x127355,null));};exports[_0xb64f('0x4f')]=function(_0xee2f2b,_0x47cb05){return db[_0xb64f('0x33')]['create'](_0xee2f2b['body'],{})[_0xb64f('0x2d')](respondWithResult(_0x47cb05,0xc9))[_0xb64f('0x4a')](handleError(_0x47cb05,null));};exports['update']=function(_0x212624,_0x3e0015){if(_0x212624['body']['id']){delete _0x212624[_0xb64f('0x50')]['id'];}return db[_0xb64f('0x33')]['find']({'where':{'id':_0x212624['params']['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x3e0015,null))[_0xb64f('0x2d')](saveUpdates(_0x212624['body'],null))[_0xb64f('0x2d')](respondWithResult(_0x3e0015,null))[_0xb64f('0x4a')](handleError(_0x3e0015,null));};exports[_0xb64f('0x2c')]=function(_0x43918d,_0x417ccb){return db[_0xb64f('0x33')][_0xb64f('0x4e')]({'where':{'id':_0x43918d['params']['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x417ccb,null))[_0xb64f('0x2d')](removeEntity(_0x417ccb,null))[_0xb64f('0x4a')](handleError(_0x417ccb,null));};exports['describe']=function(_0x1c427f,_0x36de59){return db[_0xb64f('0x33')][_0xb64f('0x51')]()[_0xb64f('0x2d')](respondWithResult(_0x36de59,null))['catch'](handleError(_0x36de59,null));};exports[_0xb64f('0x52')]=function(_0x3334b1,_0x474b3c,_0x1c697a){return db[_0xb64f('0x53')]['count']({'where':{'ChatGroupId':_0x3334b1[_0xb64f('0x4c')]['id'],'ToId':_0x3334b1[_0xb64f('0x54')]['id'],'read':![]}})[_0xb64f('0x2d')](function(_0x5e7ccc){return{'id':_['toInteger'](_0x3334b1[_0xb64f('0x4c')]['id']),'count':_0x5e7ccc};})[_0xb64f('0x2d')](respondWithResult(_0x474b3c,null))['catch'](handleError(_0x474b3c,null));};exports[_0xb64f('0x55')]=function(_0x3dc141,_0x33d4e1,_0x149486){return db[_0xb64f('0x33')][_0xb64f('0x4e')]({'where':{'id':_0x3dc141[_0xb64f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x33d4e1,null))['then'](function(_0x4ea7b2){if(_0x4ea7b2){return _0x4ea7b2[_0xb64f('0x55')](_0x3dc141['body'][_0xb64f('0x56')],_[_0xb64f('0x57')](_0x3dc141[_0xb64f('0x50')],[_0xb64f('0x56'),'id'])||{});}})[_0xb64f('0x2d')](respondWithResult(_0x33d4e1,null))[_0xb64f('0x4a')](handleError(_0x33d4e1,null));};exports[_0xb64f('0x58')]=function(_0x50b675,_0x2af5ab,_0x4f4deb){var _0x3d00f2={};var _0x28d58d={};var _0x1bf95a;var _0x595b9e;return db[_0xb64f('0x33')][_0xb64f('0x59')]({'where':{'id':_0x50b675[_0xb64f('0x4c')]['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x2af5ab,null))[_0xb64f('0x2d')](function(_0x37057c){if(_0x37057c){_0x1bf95a=_0x37057c;_0x28d58d[_0xb64f('0x36')]=_[_0xb64f('0x38')](db[_0xb64f('0x5a')][_0xb64f('0x34')]);_0x28d58d[_0xb64f('0x37')]=_[_0xb64f('0x38')](_0x50b675['query']);_0x28d58d[_0xb64f('0x42')]=_[_0xb64f('0x3a')](_0x28d58d[_0xb64f('0x36')],_0x28d58d['query']);_0x3d00f2[_0xb64f('0x39')]=_[_0xb64f('0x3a')](_0x28d58d['model'],qs[_0xb64f('0x3b')](_0x50b675[_0xb64f('0x37')]['fields']));_0x3d00f2[_0xb64f('0x39')]=_0x3d00f2[_0xb64f('0x39')]['length']?_0x3d00f2['attributes']:_0x28d58d[_0xb64f('0x36')];_0x3d00f2[_0xb64f('0x3f')]=qs[_0xb64f('0x40')](_0x50b675[_0xb64f('0x37')][_0xb64f('0x40')]);_0x3d00f2[_0xb64f('0x41')]=qs[_0xb64f('0x42')](_[_0xb64f('0x43')](_0x50b675[_0xb64f('0x37')],_0x28d58d[_0xb64f('0x42')]));if(_0x50b675[_0xb64f('0x37')][_0xb64f('0x44')]){_0x3d00f2['where']=_[_0xb64f('0x4d')](_0x3d00f2[_0xb64f('0x41')],{'$or':_['map'](_0x3d00f2[_0xb64f('0x39')],function(_0x32a59b){var _0x2c204d={};_0x2c204d[_0x32a59b]={'$like':'%'+_0x50b675[_0xb64f('0x37')]['filter']+'%'};return _0x2c204d;})});}_0x3d00f2=_[_0xb64f('0x4d')]({},_0x3d00f2,_0x50b675[_0xb64f('0x46')]);return _0x1bf95a['getMembers'](_0x3d00f2);}})[_0xb64f('0x2d')](function(_0x518266){if(_0x518266){_0x595b9e=_0x518266[_0xb64f('0x3c')];if(!_0x50b675[_0xb64f('0x37')][_0xb64f('0x3d')](_0xb64f('0x3e'))){_0x3d00f2[_0xb64f('0x26')]=qs[_0xb64f('0x26')](_0x50b675['query'][_0xb64f('0x26')]);_0x3d00f2[_0xb64f('0x24')]=qs[_0xb64f('0x24')](_0x50b675['query'][_0xb64f('0x24')]);}return _0x1bf95a[_0xb64f('0x58')](_0x3d00f2);}})[_0xb64f('0x2d')](function(_0x926615){if(_0x926615){return _0x926615?{'count':_0x595b9e,'rows':_0x926615}:null;}})[_0xb64f('0x2d')](respondWithResult(_0x2af5ab,null))[_0xb64f('0x4a')](handleError(_0x2af5ab,null));};exports[_0xb64f('0x5b')]=function(_0xa56ff6,_0x331ea4,_0x3f9338){return db[_0xb64f('0x33')][_0xb64f('0x4e')]({'where':{'id':_0xa56ff6[_0xb64f('0x4c')]['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x331ea4,null))[_0xb64f('0x2d')](function(_0x30982f){if(_0x30982f){return _0x30982f[_0xb64f('0x5b')](_0xa56ff6[_0xb64f('0x37')][_0xb64f('0x56')]);}})['then'](respondWithStatusCode(_0x331ea4,null))['catch'](handleError(_0x331ea4,null));};exports[_0xb64f('0x5c')]=function(_0x5d0f67,_0x3acab9,_0x4c44eb){if(_0x5d0f67[_0xb64f('0x50')]['id']){delete _0x5d0f67['body']['id'];}return db[_0xb64f('0x33')]['find']({'where':{'id':_0x5d0f67[_0xb64f('0x4c')]['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x3acab9,null))[_0xb64f('0x2d')](function(_0x47cb2a){if(_0x47cb2a){_0x5d0f67['body'][_0xb64f('0x5d')]=_0x47cb2a['id'];return db[_0xb64f('0x53')][_0xb64f('0x4f')](_0x5d0f67[_0xb64f('0x50')]);}})[_0xb64f('0x2d')](respondWithResult(_0x3acab9,null))['catch'](handleError(_0x3acab9,null));};exports[_0xb64f('0x5e')]=function(_0x165682,_0x2099b8,_0x40741c){var _0x2a5455={};var _0x331f0c={};var _0x5a7137;var _0xa890d9;return db[_0xb64f('0x33')][_0xb64f('0x59')]({'where':{'id':_0x165682[_0xb64f('0x4c')]['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x2099b8,null))[_0xb64f('0x2d')](function(_0x3430ad){if(_0x3430ad){_0x5a7137=_0x3430ad;_0x331f0c[_0xb64f('0x36')]=_[_0xb64f('0x38')](db[_0xb64f('0x53')][_0xb64f('0x34')]);_0x331f0c[_0xb64f('0x37')]=_[_0xb64f('0x38')](_0x165682[_0xb64f('0x37')]);_0x331f0c[_0xb64f('0x42')]=_[_0xb64f('0x3a')](_0x331f0c[_0xb64f('0x36')],_0x331f0c['query']);_0x2a5455[_0xb64f('0x39')]=_['intersection'](_0x331f0c[_0xb64f('0x36')],qs[_0xb64f('0x3b')](_0x165682[_0xb64f('0x37')][_0xb64f('0x3b')]));_0x2a5455[_0xb64f('0x39')]=_0x2a5455['attributes'][_0xb64f('0x3c')]?_0x2a5455['attributes']:_0x331f0c['model'];_0x2a5455[_0xb64f('0x3f')]=qs[_0xb64f('0x40')](_0x165682[_0xb64f('0x37')][_0xb64f('0x40')]);_0x2a5455[_0xb64f('0x41')]=qs[_0xb64f('0x42')](_[_0xb64f('0x43')](_0x165682[_0xb64f('0x37')],_0x331f0c[_0xb64f('0x42')]));if(_0x165682[_0xb64f('0x37')][_0xb64f('0x44')]){_0x2a5455[_0xb64f('0x41')]=_['merge'](_0x2a5455[_0xb64f('0x41')],{'$or':_['map'](_0x2a5455[_0xb64f('0x39')],function(_0x3a5bbd){var _0x4b9dd4={};_0x4b9dd4[_0x3a5bbd]={'$like':'%'+_0x165682['query']['filter']+'%'};return _0x4b9dd4;})});}if(_0x165682[_0xb64f('0x37')]['$gte']){var _0x41eeb3=_0x165682[_0xb64f('0x37')][_0xb64f('0x5f')][_0xb64f('0x60')](',');var _0x284765={};_0x284765[_0x41eeb3[0x0]]={'$gte':moment(_0x41eeb3[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2a5455[_0xb64f('0x41')]=_[_0xb64f('0x4d')](_0x2a5455[_0xb64f('0x41')],_0x284765);}_0x2a5455=_[_0xb64f('0x4d')]({},_0x2a5455,_0x165682[_0xb64f('0x46')]);return _0x5a7137[_0xb64f('0x5e')](_0x2a5455);}})[_0xb64f('0x2d')](function(_0x2fc65f){if(_0x2fc65f){_0xa890d9=_0x2fc65f['length'];if(!_0x165682['query']['hasOwnProperty'](_0xb64f('0x3e'))){_0x2a5455[_0xb64f('0x26')]=qs[_0xb64f('0x26')](_0x165682[_0xb64f('0x37')][_0xb64f('0x26')]);_0x2a5455[_0xb64f('0x24')]=qs[_0xb64f('0x24')](_0x165682['query'][_0xb64f('0x24')]);}return _0x5a7137[_0xb64f('0x5e')](_0x2a5455);}})[_0xb64f('0x2d')](function(_0xd4f75b){if(_0xd4f75b){return _0xd4f75b?{'count':_0xa890d9,'rows':_0xd4f75b}:null;}})[_0xb64f('0x2d')](respondWithResult(_0x2099b8,null))[_0xb64f('0x4a')](handleError(_0x2099b8,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index b8e8ee8..8cf12da 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 _0xbd50=['remove','exports','ChatGroup','save','update'];(function(_0x46016f,_0x2d438d){var _0x586d22=function(_0x3c5de0){while(--_0x3c5de0){_0x46016f['push'](_0x46016f['shift']());}};_0x586d22(++_0x2d438d);}(_0xbd50,0x151));var _0x0bd5=function(_0x59c7c2,_0x3c91cb){_0x59c7c2=_0x59c7c2-0x0;var _0x425718=_0xbd50[_0x59c7c2];return _0x425718;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x0bd5('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0bd5('0x1'),'afterUpdate':_0x0bd5('0x2'),'afterDestroy':_0x0bd5('0x3')};function emitEvent(_0x5b5b87){return function(_0x51300f,_0x294c08,_0xd44f35){ChatGroupEvents['emit'](_0x5b5b87+':'+_0x51300f['id'],_0x51300f);ChatGroupEvents['emit'](_0x5b5b87,_0x51300f);_0xd44f35(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x0bd5('0x4')]=ChatGroupEvents;
\ No newline at end of file
+var _0xf230=['save','emit','hook','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x511dfe,_0x2805d4){var _0x419acd=function(_0x16e24b){while(--_0x16e24b){_0x511dfe['push'](_0x511dfe['shift']());}};_0x419acd(++_0x2805d4);}(_0xf230,0xea));var _0x0f23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf230[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0f23('0x0'));var ChatGroup=require(_0x0f23('0x1'))['db'][_0x0f23('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0f23('0x3')](0x0);var events={'afterCreate':_0x0f23('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x16b060){return function(_0x303b10,_0x255aef,_0x59b753){ChatGroupEvents[_0x0f23('0x5')](_0x16b060+':'+_0x303b10['id'],_0x303b10);ChatGroupEvents[_0x0f23('0x5')](_0x16b060,_0x303b10);_0x59b753(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0f23('0x6')](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 b3cc986..27f1143 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 _0x0eab=['chat_groups','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','define'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x0eab,0x140));var _0xb0ea=function(_0x51a8b9,_0x57504b){_0x51a8b9=_0x51a8b9-0x0;var _0x340f53=_0x0eab[_0x51a8b9];return _0x340f53;};'use strict';var _=require(_0xb0ea('0x0'));var util=require('util');var logger=require(_0xb0ea('0x1'))(_0xb0ea('0x2'));var moment=require(_0xb0ea('0x3'));var BPromise=require(_0xb0ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0ea('0x5'));var rimraf=require(_0xb0ea('0x6'));var config=require(_0xb0ea('0x7'));var attributes=require(_0xb0ea('0x8'));module['exports']=function(_0x3a441f,_0x4e1220){return _0x3a441f[_0xb0ea('0x9')]('ChatGroup',attributes,{'tableName':_0xb0ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8843=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','chat_groups','lodash','../../config/logger'];(function(_0x79ba92,_0x564ade){var _0x5a93bf=function(_0x3aa8fc){while(--_0x3aa8fc){_0x79ba92['push'](_0x79ba92['shift']());}};_0x5a93bf(++_0x564ade);}(_0x8843,0x77));var _0x3884=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x8843[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x3884('0x0'));var util=require('util');var logger=require(_0x3884('0x1'))(_0x3884('0x2'));var moment=require(_0x3884('0x3'));var BPromise=require(_0x3884('0x4'));var rp=require(_0x3884('0x5'));var fs=require('fs');var path=require(_0x3884('0x6'));var rimraf=require(_0x3884('0x7'));var config=require(_0x3884('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x47403c,_0x3d527f){return _0x47403c[_0x3884('0x9')]('ChatGroup',attributes,{'tableName':_0x3884('0xa'),'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 99d8bc2..2fd3491 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 _0x2d17=['request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x18c1b1,_0x339237){var _0x4faaea=function(_0x2ccac6){while(--_0x2ccac6){_0x18c1b1['push'](_0x18c1b1['shift']());}};_0x4faaea(++_0x339237);}(_0x2d17,0x17e));var _0x72d1=function(_0x2c4f29,_0x55b27a){_0x2c4f29=_0x2c4f29-0x0;var _0x10a6bf=_0x2d17[_0x2c4f29];return _0x10a6bf;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});config[_0x72d1('0x9')]=_['defaults'](config[_0x72d1('0x9')],{'host':_0x72d1('0xa'),'port':0x18eb});var socket=require(_0x72d1('0xb'))(new Redis(config['redis']));require(_0x72d1('0xc'))[_0x72d1('0xd')](socket);function respondWithRpcPromise(_0x283775,_0x593c91,_0x1d7520){return new BPromise(function(_0x3a35c6,_0x45eb4a){return client[_0x72d1('0xe')](_0x283775,_0x1d7520)[_0x72d1('0xf')](function(_0x3916f2){logger[_0x72d1('0x10')](_0x72d1('0x11'),_0x593c91,_0x72d1('0x12'));logger[_0x72d1('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'),JSON[_0x72d1('0x14')](_0x3916f2));if(_0x3916f2[_0x72d1('0x15')]){if(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x16')]===0x1f4){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);return _0x45eb4a(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);}logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2['error'][_0x72d1('0x17')]);return _0x3a35c6(_0x3916f2['error'][_0x72d1('0x17')]);}else{logger[_0x72d1('0x10')]('ChatGroup,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'));_0x3a35c6(_0x3916f2[_0x72d1('0x18')][_0x72d1('0x17')]);}})['catch'](function(_0x4925f6){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x4925f6);_0x45eb4a(_0x4925f6);});});}
\ No newline at end of file
+var _0x98d3=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent'];(function(_0x38e2fd,_0x80c944){var _0x332db0=function(_0x17a8a1){while(--_0x17a8a1){_0x38e2fd['push'](_0x38e2fd['shift']());}};_0x332db0(++_0x80c944);}(_0x98d3,0x173));var _0x398d=function(_0x7209f9,_0x5ca873){_0x7209f9=_0x7209f9-0x0;var _0x4e829d=_0x98d3[_0x7209f9];return _0x4e829d;};'use strict';var _=require(_0x398d('0x0'));var util=require(_0x398d('0x1'));var moment=require('moment');var BPromise=require(_0x398d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x398d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x398d('0x4'));var logger=require(_0x398d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x398d('0x6'));var client=jayson[_0x398d('0x7')][_0x398d('0x8')]({'port':0x232a});config['redis']=_[_0x398d('0x9')](config[_0x398d('0xa')],{'host':_0x398d('0xb'),'port':0x18eb});var socket=require(_0x398d('0xc'))(new Redis(config[_0x398d('0xa')]));require('./chatGroup.socket')[_0x398d('0xd')](socket);function respondWithRpcPromise(_0x147aec,_0x45d5e3,_0x3841e6){return new BPromise(function(_0x3a8f51,_0x1b144a){return client[_0x398d('0xe')](_0x147aec,_0x3841e6)[_0x398d('0xf')](function(_0x585400){logger[_0x398d('0x10')](_0x398d('0x11'),_0x45d5e3,_0x398d('0x12'));logger[_0x398d('0x13')](_0x398d('0x14'),_0x45d5e3,_0x398d('0x12'),JSON[_0x398d('0x15')](_0x585400));if(_0x585400[_0x398d('0x16')]){if(_0x585400[_0x398d('0x16')][_0x398d('0x17')]===0x1f4){logger[_0x398d('0x16')]('ChatGroup,\x20%s,\x20%s',_0x45d5e3,_0x585400['error'][_0x398d('0x18')]);return _0x1b144a(_0x585400[_0x398d('0x16')][_0x398d('0x18')]);}logger[_0x398d('0x16')](_0x398d('0x11'),_0x45d5e3,_0x585400[_0x398d('0x16')][_0x398d('0x18')]);return _0x3a8f51(_0x585400[_0x398d('0x16')]['message']);}else{logger[_0x398d('0x10')]('ChatGroup,\x20%s,\x20%s',_0x45d5e3,_0x398d('0x12'));_0x3a8f51(_0x585400[_0x398d('0x19')][_0x398d('0x18')]);}})['catch'](function(_0x4c5c9d){logger['error'](_0x398d('0x11'),_0x45d5e3,_0x4c5c9d);_0x1b144a(_0x4c5c9d);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index c1cf54c..1268e89 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 _0x1a96=['remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x5160bf,_0x511947){var _0x1d33a9=function(_0x3b630c){while(--_0x3b630c){_0x5160bf['push'](_0x5160bf['shift']());}};_0x1d33a9(++_0x511947);}(_0x1a96,0x10a));var _0x61a9=function(_0x444be3,_0x49c6ba){_0x444be3=_0x444be3-0x0;var _0xf093f8=_0x1a96[_0x444be3];return _0xf093f8;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x61a9('0x0'),_0x61a9('0x1')];function createListener(_0x3cf8b1,_0x456bf8){return function(_0x196df1){_0x456bf8[_0x61a9('0x2')](_0x3cf8b1,_0x196df1);};}function removeListener(_0x2d1741,_0x51a717){return function(){ChatGroupEvents[_0x61a9('0x3')](_0x2d1741,_0x51a717);};}exports[_0x61a9('0x4')]=function(_0x3c0248){for(var _0x32fe00=0x0,_0x26777a=events[_0x61a9('0x5')];_0x32fe00<_0x26777a;_0x32fe00++){var _0x1c1741=events[_0x32fe00];var _0x5217b1=createListener(_0x61a9('0x6')+_0x1c1741,_0x3c0248);ChatGroupEvents['on'](_0x1c1741,_0x5217b1);}};
\ No newline at end of file
+var _0xc6ee=['chatGroup:','./chatGroup.events','save','remove','emit','removeListener','length'];(function(_0x146e79,_0x2c93aa){var _0x2c009f=function(_0x945b8a){while(--_0x945b8a){_0x146e79['push'](_0x146e79['shift']());}};_0x2c009f(++_0x2c93aa);}(_0xc6ee,0x14a));var _0xec6e=function(_0x240d8c,_0x979f5){_0x240d8c=_0x240d8c-0x0;var _0x4e0720=_0xc6ee[_0x240d8c];return _0x4e0720;};'use strict';var ChatGroupEvents=require(_0xec6e('0x0'));var events=[_0xec6e('0x1'),_0xec6e('0x2'),'update'];function createListener(_0x2aa754,_0xdb4b26){return function(_0x596c6e){_0xdb4b26[_0xec6e('0x3')](_0x2aa754,_0x596c6e);};}function removeListener(_0x31fbbd,_0x915b80){return function(){ChatGroupEvents[_0xec6e('0x4')](_0x31fbbd,_0x915b80);};}exports['register']=function(_0x325889){for(var _0x20998a=0x0,_0x139606=events[_0xec6e('0x5')];_0x20998a<_0x139606;_0x20998a++){var _0x4683a8=events[_0x20998a];var _0x125826=createListener(_0xec6e('0x6')+_0x4683a8,_0x325889);ChatGroupEvents['on'](_0x4683a8,_0x125826);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 5424f89..bff07b2 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 _0x43c3=['update','delete','destroy','removeMembers','exports','multer','util','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','/:id/messages','addMessage'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x43c3,0x118));var _0x343c=function(_0x364731,_0x5aa34c){_0x364731=_0x364731-0x0;var _0x3260d1=_0x43c3[_0x364731];return _0x3260d1;};'use strict';var multer=require(_0x343c('0x0'));var util=require(_0x343c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x343c('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x343c('0x3'));var config=require(_0x343c('0x4'));var controller=require('./chatGroup.controller');router[_0x343c('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x343c('0x5')](_0x343c('0x6'),auth['isAuthenticated'](),controller[_0x343c('0x7')]);router['get'](_0x343c('0x8'),auth[_0x343c('0x9')](),controller['show']);router[_0x343c('0x5')](_0x343c('0xa'),auth[_0x343c('0x9')](),controller[_0x343c('0xb')]);router[_0x343c('0x5')]('/:id/members',auth['isAuthenticated'](),controller[_0x343c('0xc')]);router['get']('/:id/messages',auth[_0x343c('0x9')](),controller[_0x343c('0xd')]);router[_0x343c('0xe')]('/',auth[_0x343c('0x9')](),controller[_0x343c('0xf')]);router[_0x343c('0xe')](_0x343c('0x10'),auth['isAuthenticated'](),controller[_0x343c('0x11')]);router[_0x343c('0xe')](_0x343c('0x12'),auth[_0x343c('0x9')](),controller[_0x343c('0x13')]);router['put'](_0x343c('0x8'),auth[_0x343c('0x9')](),controller[_0x343c('0x14')]);router[_0x343c('0x15')](_0x343c('0x8'),auth[_0x343c('0x9')](),controller[_0x343c('0x16')]);router[_0x343c('0x15')](_0x343c('0x10'),auth[_0x343c('0x9')](),controller[_0x343c('0x17')]);module[_0x343c('0x18')]=router;
\ No newline at end of file
+var _0x843d=['/describe','get','/:id','show','/:id/unread','getUnread','/:id/messages','getMessages','post','/:id/members','addMembers','addMessage','put','destroy','delete','removeMembers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x843d,0x1b5));var _0xd843=function(_0x5d8e76,_0x295bc4){_0x5d8e76=_0x5d8e76-0x0;var _0x4b94f3=_0x843d[_0x5d8e76];return _0x4b94f3;};'use strict';var multer=require(_0xd843('0x0'));var util=require('util');var path=require(_0xd843('0x1'));var timeout=require(_0xd843('0x2'));var express=require(_0xd843('0x3'));var router=express[_0xd843('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd843('0x5'));var interaction=require(_0xd843('0x6'));var config=require(_0xd843('0x7'));var controller=require(_0xd843('0x8'));router['get']('/',auth[_0xd843('0x9')](),controller[_0xd843('0xa')]);router['get'](_0xd843('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xd843('0xc')](_0xd843('0xd'),auth[_0xd843('0x9')](),controller[_0xd843('0xe')]);router[_0xd843('0xc')](_0xd843('0xf'),auth['isAuthenticated'](),controller[_0xd843('0x10')]);router['get']('/:id/members',auth[_0xd843('0x9')](),controller['getMembers']);router[_0xd843('0xc')](_0xd843('0x11'),auth['isAuthenticated'](),controller[_0xd843('0x12')]);router[_0xd843('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd843('0x13')](_0xd843('0x14'),auth[_0xd843('0x9')](),controller[_0xd843('0x15')]);router[_0xd843('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0xd843('0x16')]);router[_0xd843('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xd843('0xd'),auth[_0xd843('0x9')](),controller[_0xd843('0x18')]);router[_0xd843('0x19')](_0xd843('0x14'),auth['isAuthenticated'](),controller[_0xd843('0x1a')]);module[_0xd843('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 69bcd15..9efb14d 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 _0x8a5c=['DATE','long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x305d99,_0x3eb3b2){var _0x36f25a=function(_0x56d383){while(--_0x56d383){_0x305d99['push'](_0x305d99['shift']());}};_0x36f25a(++_0x3eb3b2);}(_0x8a5c,0x136));var _0xc8a5=function(_0x59f512,_0x276914){_0x59f512=_0x59f512-0x0;var _0xfd01d8=_0x8a5c[_0x59f512];return _0xfd01d8;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'closed':{'type':Sequelize[_0xc8a5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc8a5('0x3')]},'ratingType':{'type':Sequelize[_0xc8a5('0x4')](_0xc8a5('0x5'),_0xc8a5('0x6')),'defaultValue':_0xc8a5('0x5')},'ratingMessage':{'type':Sequelize[_0xc8a5('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xc8a5('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc8a5('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc8a5('0x8')]},'thirdDisposition':{'type':Sequelize[_0xc8a5('0x8')]},'note':{'type':Sequelize[_0xc8a5('0x8')]},'browserName':{'type':Sequelize[_0xc8a5('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xc8a5('0x8')]},'osVersion':{'type':Sequelize[_0xc8a5('0x8')]},'deviceModel':{'type':Sequelize[_0xc8a5('0x8')]},'deviceVendor':{'type':Sequelize[_0xc8a5('0x8')]},'deviceType':{'type':Sequelize[_0xc8a5('0x8')]},'referer':{'type':Sequelize[_0xc8a5('0x7')]},'customerIp':{'type':Sequelize[_0xc8a5('0x8')]},'formData':{'type':Sequelize[_0xc8a5('0x7')](_0xc8a5('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc8a5('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc8a5('0x8')]},'customerPort':{'type':Sequelize[_0xc8a5('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xc8a5('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xc8a5('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5423=['thumb','star','TEXT','DATE','STRING','out','BOOLEAN','sequelize','exports','INTEGER','ENUM'];(function(_0x879688,_0x5bec06){var _0x31aca8=function(_0x17c876){while(--_0x17c876){_0x879688['push'](_0x879688['shift']());}};_0x31aca8(++_0x5bec06);}(_0x5423,0xe3));var _0x3542=function(_0x1ce7d5,_0x5198eb){_0x1ce7d5=_0x1ce7d5-0x0;var _0x586b82=_0x5423[_0x1ce7d5];return _0x586b82;};'use strict';var Sequelize=require(_0x3542('0x0'));module[_0x3542('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3542('0x2')]},'ratingType':{'type':Sequelize[_0x3542('0x3')]('star',_0x3542('0x4')),'defaultValue':_0x3542('0x5')},'ratingMessage':{'type':Sequelize[_0x3542('0x6')]},'pathTranscript':{'type':Sequelize[_0x3542('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3542('0x7')]},'disposition':{'type':Sequelize[_0x3542('0x8')]},'secondDisposition':{'type':Sequelize[_0x3542('0x8')]},'thirdDisposition':{'type':Sequelize[_0x3542('0x8')]},'note':{'type':Sequelize[_0x3542('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x3542('0x8')]},'osVersion':{'type':Sequelize[_0x3542('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x3542('0x8')]},'deviceType':{'type':Sequelize[_0x3542('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3542('0x8')]},'formData':{'type':Sequelize[_0x3542('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x3542('0x7')]},'lastMsgAt':{'type':Sequelize[_0x3542('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x3542('0x3')]('in',_0x3542('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3542('0x8')]},'customerPort':{'type':Sequelize[_0x3542('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x3542('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3542('0xa')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 7c7cba7..f7509b0 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 _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x45c396,_0x17a73f){_0x45c396=_0x45c396-0x0;var _0x33cd3f=_0x9ffd[_0x45c396];return _0x33cd3f;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));};
\ No newline at end of file
+var _0x66fa=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','contact','agent','interaction','TagIds','Tags','split','forEach','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','join_url','out','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','offline-chat/','join','basename','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','include','includeAgent','alias','addTags','setTags','findAll','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x469273,_0x337533){var _0x45105a=function(_0x2f9ba6){while(--_0x2f9ba6){_0x469273['push'](_0x469273['shift']());}};_0x45105a(++_0x337533);}(_0x66fa,0x117));var _0xa66f=function(_0x1fcbca,_0x57e993){_0x1fcbca=_0x1fcbca-0x0;var _0xc4db48=_0x66fa[_0x1fcbca];return _0xc4db48;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa66f('0x19'));var client=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232b});var client9004=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x567d4f,_0x5510dc,_0x19b5ac,_0x32d338){return new BPromise(function(_0x295acf,_0x403f4d){var _0x5c67f5=_0x32d338||client;return _0x5c67f5[_0xa66f('0x1c')](_0x567d4f,_0x19b5ac)['then'](function(_0x4a28d4){logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));logger[_0xa66f('0x20')](_0xa66f('0x21'),_0x5510dc,_0xa66f('0x1f'),JSON[_0xa66f('0x22')](_0x4a28d4));if(_0x4a28d4[_0xa66f('0x23')]){if(_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x24')]===0x1f4){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x403f4d(_0x4a28d4[_0xa66f('0x23')]['message']);}logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x295acf(_0x4a28d4['error'][_0xa66f('0x25')]);}else{logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));_0x295acf(_0x4a28d4['result']['message']);}})[_0xa66f('0x26')](function(_0x598942){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x598942);_0x403f4d(_0x598942);});});}function respondWithStatusCode(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0xcc;return function(_0x4683c7){if(_0x4683c7){return _0x384164[_0xa66f('0x27')](_0x57da7f);}return _0x384164[_0xa66f('0x28')](_0x57da7f)[_0xa66f('0x29')]();};}function respondWithResult(_0x17c103,_0x236046){_0x236046=_0x236046||0xc8;return function(_0x1eb86a){if(_0x1eb86a){return _0x17c103[_0xa66f('0x28')](_0x236046)[_0xa66f('0x2a')](_0x1eb86a);}};}function respondWithFilteredResult(_0x117d03,_0x45f71c){return function(_0x63650b){if(_0x63650b){var _0x42b966=typeof _0x45f71c[_0xa66f('0x2b')]==='undefined'&&typeof _0x45f71c['limit']===_0xa66f('0x2c');var _0x27ceae=_0x63650b['count'];var _0x44c79a=_0x42b966?0x0:_0x45f71c[_0xa66f('0x2b')];var _0x4cd7f2=_0x42b966?_0x63650b[_0xa66f('0x2d')]:_0x45f71c[_0xa66f('0x2b')]+_0x45f71c[_0xa66f('0x2e')];var _0x2c2ace;if(_0x4cd7f2>=_0x27ceae){_0x4cd7f2=_0x27ceae;_0x2c2ace=0xc8;}else{_0x2c2ace=0xce;}_0x117d03[_0xa66f('0x28')](_0x2c2ace);return _0x117d03['set'](_0xa66f('0x2f'),_0x44c79a+'-'+_0x4cd7f2+'/'+_0x27ceae)['json'](_0x63650b);}return null;};}function patchUpdates(_0x306b35){return function(_0x35a0a7){try{jsonpatch[_0xa66f('0x30')](_0x35a0a7,_0x306b35,!![]);}catch(_0x486e4e){return BPromise[_0xa66f('0x31')](_0x486e4e);}return _0x35a0a7[_0xa66f('0x32')]();};}function saveUpdates(_0x4f1668,_0x1a5d4a){return function(_0x35a847){if(_0x35a847){return _0x35a847[_0xa66f('0x33')](_0x4f1668)[_0xa66f('0x34')](function(_0x10a782){return _0x10a782;});}return null;};}function removeEntity(_0x2452d2,_0x25c74c){return function(_0x41303c){if(_0x41303c){return _0x41303c[_0xa66f('0x35')]()[_0xa66f('0x34')](function(){_0x2452d2['status'](0xcc)[_0xa66f('0x29')]();});}};}function handleEntityNotFound(_0x5bf736,_0x1c7eda){return function(_0x46f6cc){if(!_0x46f6cc){_0x5bf736[_0xa66f('0x27')](0x194);}return _0x46f6cc;};}function handleError(_0x3b9261,_0x3722d3){_0x3722d3=_0x3722d3||0x1f4;return function(_0x201432){logger[_0xa66f('0x23')](_0x201432[_0xa66f('0x36')]);if(_0x201432['name']){delete _0x201432[_0xa66f('0x37')];}_0x3b9261['status'](_0x3722d3)[_0xa66f('0x38')](_0x201432);};}function getMustacheRender(_0x45eeb8,_0x2ed1fb){return Mustache['render'](_0x45eeb8,_['merge'](_0x2ed1fb[_0xa66f('0x39')],{'contact':_0x2ed1fb[_0xa66f('0x3a')],'message':_0x2ed1fb[_0xa66f('0x25')],'agent':_0x2ed1fb[_0xa66f('0x3b')],'interaction':_0x2ed1fb[_0xa66f('0x3c')],'account':_0x2ed1fb['account']}))||'';}function getInteractionUsers(_0x5cb0a9,_0x49b869){return new BPromise(function(_0x30f7de,_0x4aeeb4){try{if(_0x49b869[_0x5cb0a9['id']]){_0x5cb0a9['Users']=_['map'](_0x49b869[_0x5cb0a9['id']],function(_0x5fdc3e){return{'id':_0x5fdc3e['id'],'fullname':_0x5fdc3e['fullname']};});}}catch(_0x8965d3){_0x4aeeb4(_0x8965d3);}_0x30f7de(_0x5cb0a9);});}function getInteractionTags(_0x17d942,_0x23a546){return new BPromise(function(_0x1647a0,_0xd65c5d){try{if(_0x17d942[_0xa66f('0x3d')]){_0x17d942[_0xa66f('0x3e')]=[];_0x17d942[_0xa66f('0x3d')][_0xa66f('0x3f')](',')[_0xa66f('0x40')](function(_0x3a7929){_0x17d942[_0xa66f('0x3e')][_0xa66f('0x41')](_0x23a546[_0x3a7929]);});}delete _0x17d942[_0xa66f('0x3d')];}catch(_0x4f01b9){_0xd65c5d(_0x4f01b9);}_0x1647a0(_0x17d942);});}function updateChatInteraction(_0x36037c,_0x25c2cb,_0x58c1f2){return new BPromise(function(_0x248587,_0x4b6e6b){return getInteractionUsers(_0x36037c,_0x58c1f2)[_0xa66f('0x34')](function(_0x27adf4){return getInteractionTags(_0x27adf4,_0x25c2cb);})['then'](function(_0x1ddd2f){_0x248587(_0x1ddd2f);})[_0xa66f('0x26')](function(_0x2126e8){_0x4b6e6b(_0x2126e8);});});}exports['index']=function(_0x394b1e,_0x5cdfe2){var _0x276cd5={},_0x33ed23={},_0xb52cc6={'count':0x0,'rows':[]};var _0x3a499e=_[_0xa66f('0x42')](db[_0xa66f('0x43')][_0xa66f('0x44')],function(_0x50cc47){return{'name':_0x50cc47[_0xa66f('0x45')],'type':_0x50cc47[_0xa66f('0x46')][_0xa66f('0x47')]};});_0x33ed23[_0xa66f('0x48')]=_[_0xa66f('0x42')](_0x3a499e,'name');_0x33ed23['query']=_[_0xa66f('0x49')](_0x394b1e[_0xa66f('0x4a')]);_0x33ed23[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],_0x33ed23[_0xa66f('0x4a')]);_0x276cd5['attributes']=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x394b1e['query']['fields']));_0x276cd5[_0xa66f('0x4e')]=_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x276cd5['attributes']:_0x33ed23['model'];if(!_0x394b1e['query'][_0xa66f('0x50')](_0xa66f('0x51'))){_0x276cd5[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x2e')]);_0x276cd5[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x394b1e['query'][_0xa66f('0x2b')]);}_0x276cd5[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x276cd5[_0xa66f('0x54')]=qs['filters'](_[_0xa66f('0x55')](_0x394b1e[_0xa66f('0x4a')],_0x33ed23[_0xa66f('0x4b')]),_0x3a499e);var _0x13848d=[];var _0x20d6be=squel['select']()[_0xa66f('0x56')]('id')['field'](_0xa66f('0x37'))['field']('color')[_0xa66f('0x57')](_0xa66f('0x58'));var _0x12271d=squel[_0xa66f('0x59')]()[_0xa66f('0x56')](_0xa66f('0x5a'))['field'](_0xa66f('0x5b'))[_0xa66f('0x56')](_0xa66f('0x5c'))[_0xa66f('0x57')]('user_has_chat_interactions','ui')[_0xa66f('0x5d')]('users','u',_0xa66f('0x5e'));var _0x10fc75=squel[_0xa66f('0x59')]()[_0xa66f('0x57')](_0xa66f('0x5f'),'i')[_0xa66f('0x5d')](_0xa66f('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa66f('0x5d')](_0xa66f('0x61'),'o',_0xa66f('0x62'))[_0xa66f('0x5d')](_0xa66f('0x63'),'a',_0xa66f('0x64'))[_0xa66f('0x5d')](_0xa66f('0x65'),'me',_0xa66f('0x66'))['left_join']('chat_interaction_has_tags','it',_0xa66f('0x67'))[_0xa66f('0x5d')](_0xa66f('0x58'),'t',_0xa66f('0x68'));var _0x2f1f1e=squel[_0xa66f('0x69')]();var _0x8bea2b=[];var _0x4b10cf=squel[_0xa66f('0x69')]();var _0x11c89e;if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]){_0x11c89e=as['parseSearch'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]);var _0x19ff30=_0x11c89e[_0xa66f('0x6b')];for(var _0x19f4b5=0x0;_0x19f4b5<_0x11c89e[_0xa66f('0x6c')]['length'];_0x19f4b5++){var _0x4b31f7=_0x11c89e[_0xa66f('0x6c')][_0x19f4b5];var _0x31b81b='i';var _0x174aad=_['find'](_0x3a499e,[_0xa66f('0x37'),_0x4b31f7[_0xa66f('0x56')]]);if(!_0x174aad){switch(_0x4b31f7[_0xa66f('0x56')]){case _0xa66f('0x6d'):if(_0x4b31f7[_0xa66f('0x6e')]==0x1){_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7[_0xa66f('0x56')]+_0xa66f('0x70'));}else{_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7['field']+_0xa66f('0x71'));}break;case _0xa66f('0x72'):if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){if(_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')]('\x20')[_0xa66f('0x4f')]>0x1){_0x2f1f1e[_0x19ff30](_0xa66f('0x75'),qs['getFullTextValue'](_0x4b31f7['value']),null);}else{var _0x46327d='%'+_0x4b31f7[_0xa66f('0x6e')]+'%';_0x2f1f1e[_0x19ff30](_0xa66f('0x76'),_0x46327d,_0x46327d,_0x46327d);}}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),'ContactId']);_0x4b31f7[_0xa66f('0x56')]='ContactId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x7a'):var _0x46ea11=_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')](',')[_0xa66f('0x42')](function(_0x2bdb18){return Number(_0x2bdb18);});_0x46ea11[_0xa66f('0x40')](function(_0x36b92f){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x36b92f+',%');});_0x8bea2b=_[_0xa66f('0x7c')](_0x8bea2b,_0x46ea11);break;case'User':if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){_0x2f1f1e[_0x19ff30](_0xa66f('0x7d'),'%'+_0x4b31f7[_0xa66f('0x6e')]+'%',null);}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),_0xa66f('0x7e')]);_0x4b31f7[_0xa66f('0x56')]='UserId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x39'):_0x53b01b=as['buildExpression']('me',null,_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b['text'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')]['end']);break;}}else{var _0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}}}else{var _0x1d4642=_(_0x394b1e[_0xa66f('0x4a')])[_0xa66f('0x49')]()[_0xa66f('0x42')](function(_0x218128){return _[_0xa66f('0x80')](_0x3a499e,['name',_0x218128])?_0x218128:undefined;})[_0xa66f('0x81')]()[_0xa66f('0x6e')]();if(!_['isEmpty'](_0x1d4642)){_0x1d4642['forEach'](function(_0x183155){if(_0x183155===_0xa66f('0x82')){_0x10fc75['where'](_0xa66f('0x83'),[]['concat'](_0x394b1e[_0xa66f('0x4a')][_0x183155]));}else if(_0x183155==='createdAt'){var _0x4feda0=JSON['parse'](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x84')];var _0x1f05bb=JSON[_0xa66f('0x85')](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x86')];_0x10fc75[_0xa66f('0x54')](_0xa66f('0x87'),_0x4feda0,_0x1f05bb);}else{if(_0x394b1e[_0xa66f('0x4a')][_0x183155]===_0xa66f('0x88')){_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x89'));}else{_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x8a'),_0x394b1e[_0xa66f('0x4a')][_0x183155]);}}});}if(_0x394b1e[_0xa66f('0x4a')]['read']){if(_0x394b1e[_0xa66f('0x4a')]['read']==0x1){_0x10fc75[_0xa66f('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x10fc75[_0xa66f('0x6f')](_0xa66f('0x8b'));}}if(_0x394b1e[_0xa66f('0x4a')]['tag']){_0x8bea2b=_['isArray'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')])?_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]:new Array(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]);_0x8bea2b[_0xa66f('0x40')](function(_0x578bff){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x578bff+',%');});}if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')]){var _0x4426d2=_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')][_0xa66f('0x8e')]('\x5c','\x5c\x5c')[_0xa66f('0x8e')](/'/g,'\x27\x27');if(qs[_0xa66f('0x8f')](_0x4426d2)){_0x2f1f1e['or'](_0xa66f('0x90'),_0x4426d2+'%');}else{_0x2f1f1e['or'](_0xa66f('0x91'),qs[_0xa66f('0x92')](_0x4426d2))['or'](_0xa66f('0x93'),_0x4426d2+'%');}}}_0x10fc75['where'](_0x2f1f1e);_0x10fc75[_0xa66f('0x94')](_0xa66f('0x95'));var _0x34ebfd={'type':db[_0xa66f('0x96')][_0xa66f('0x97')][_0xa66f('0x98')],'raw':!![]};var _0x3058aa=_0x10fc75[_0xa66f('0x99')]();_0x3058aa[_0xa66f('0x56')]('i.id');_0x3058aa[_0xa66f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x6d'));if(_0x276cd5['order']){_0x276cd5[_0xa66f('0x52')]['forEach'](function(_0x298bd8){var _0x5a1750=_0x298bd8[0x0]===_0xa66f('0x9a')?_0x298bd8[0x0]:'i.'+_0x298bd8[0x0];_0x10fc75[_0xa66f('0x52')](_0x5a1750,_0x298bd8[0x1]===_0xa66f('0x9b')?![]:!![]);});}if(!_[_0xa66f('0x9c')](_0x8bea2b)){_0x10fc75[_0xa66f('0x6f')](_0x4b10cf);_0x3058aa[_0xa66f('0x54')]('t.id\x20IN\x20?',_0x8bea2b);}BPromise[_0xa66f('0x9d')]()[_0xa66f('0x34')](function(){if(!_0x11c89e){if(_0x394b1e[_0xa66f('0x4a')]['ChatWebsiteId'])return;_0x3058aa[_0xa66f('0x54')](_0xa66f('0x9e'));_0x10fc75['where'](_0xa66f('0x9e'));return;}if(_0x394b1e[_0xa66f('0x9f')]['role']!=='agent')return;return _0x394b1e[_0xa66f('0x9f')][_0xa66f('0xa0')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x34')](function(_0x2929fe){if(_[_0xa66f('0x9c')](_0x2929fe)){_0x3058aa['where'](_0xa66f('0xa1'));_0x10fc75[_0xa66f('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3058aa[_0xa66f('0x54')](_0xa66f('0x83'),_['map'](_0x2929fe,'id'));_0x10fc75[_0xa66f('0x54')](_0xa66f('0x83'),_[_0xa66f('0x42')](_0x2929fe,'id'));}});})[_0xa66f('0x34')](function(){if(_0x394b1e[_0xa66f('0x9f')]['role']===_0xa66f('0x3b')&&!_0x11c89e&&!_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x82')])return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x3058aa[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x2b2c54){_0xb52cc6[_0xa66f('0x2d')]=_0x2b2c54[_0xa66f('0x4f')];if(_0xb52cc6[_0xa66f('0x2d')]===0x0)return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x20d6be[_0xa66f('0xa3')](),_0x34ebfd)['then'](function(_0x5ec355){_0x13848d=_[_0xa66f('0xa4')](_0x5ec355,'id');_0x34ebfd=_['merge'](_0x34ebfd,{'model':db[_0xa66f('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394b1e[_0xa66f('0x4a')]['fields']){_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x40')](function(_0x3f84f9){_0x10fc75['field']('i.'+_0x3f84f9);});}else{_0x10fc75['field'](_0xa66f('0xa5'),'unreadMessages');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa6'),_0xa66f('0xa7'));_0x10fc75['field'](_0xa66f('0xa8'),'Account.mandatoryDisposition');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa9'),_0xa66f('0x9a'));_0x10fc75[_0xa66f('0x56')]('i.*');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xaa'),_0xa66f('0xab'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xac'),_0xa66f('0xad'));_0x10fc75['field'](_0xa66f('0xae'),_0xa66f('0xaf'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb0'),_0xa66f('0xb1'));_0x10fc75['field']('c.mobile',_0xa66f('0xb2'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb3'),_0xa66f('0xb4'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb5'),_0xa66f('0xb6'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb7'),_0xa66f('0xb8'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb9'),'TagIds');}if(_0x276cd5[_0xa66f('0x2e')])_0x10fc75[_0xa66f('0x2e')](_0x276cd5['limit']);if(_0x276cd5[_0xa66f('0x2b')])_0x10fc75[_0xa66f('0x2b')](_0x276cd5[_0xa66f('0x2b')]);return db['sequelize']['query'](_0x10fc75[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x3520e1){if(_0x3520e1[_0xa66f('0x4f')]>0x0)_0x12271d['where'](_0xa66f('0xba'),_[_0xa66f('0x42')](_0x3520e1,'id'));return db['sequelize'][_0xa66f('0x4a')](_0x12271d[_0xa66f('0xa3')](),_0x34ebfd)[_0xa66f('0x34')](function(_0x176b30){var _0x4bc36d=_['groupBy'](_0x176b30,_0xa66f('0xbb'));var _0xdd2d09=[];_0x3520e1[_0xa66f('0x40')](function(_0x1bab2b){_0xdd2d09[_0xa66f('0x41')](updateChatInteraction(_0x1bab2b,_0x13848d,_0x4bc36d));});return BPromise[_0xa66f('0xbc')](_0xdd2d09);});});})[_0xa66f('0x34')](function(_0xac0e98){_0xb52cc6[_0xa66f('0xbd')]=_0xac0e98;return _0xb52cc6;})[_0xa66f('0x34')](respondWithFilteredResult(_0x5cdfe2,_0x276cd5))['catch'](handleError(_0x5cdfe2,null));};exports['show']=function(_0x1d472d,_0x3cbbb6){var _0x3cf40f={'raw':![],'where':{'id':_0x1d472d[_0xa66f('0xbe')]['id']}},_0x4298ca={};_0x4298ca['model']=_[_0xa66f('0x49')](db[_0xa66f('0x43')][_0xa66f('0x44')]);_0x4298ca['query']=_['keys'](_0x1d472d['query']);_0x4298ca[_0xa66f('0x4b')]=_['intersection'](_0x4298ca[_0xa66f('0x48')],_0x4298ca[_0xa66f('0x4a')]);_0x3cf40f[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x4298ca['model'],qs[_0xa66f('0x4d')](_0x1d472d[_0xa66f('0x4a')]['fields']));_0x3cf40f[_0xa66f('0x4e')]=_0x3cf40f[_0xa66f('0x4e')]['length']?_0x3cf40f['attributes']:_0x4298ca[_0xa66f('0x48')];if(_0x1d472d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3cf40f['include']=[{'all':!![]}];}_0x3cf40f=_['merge']({},_0x3cf40f,_0x1d472d['options']);return db['ChatInteraction'][_0xa66f('0x77')](_0x3cf40f)[_0xa66f('0x34')](handleEntityNotFound(_0x3cbbb6,null))[_0xa66f('0x34')](respondWithResult(_0x3cbbb6,null))[_0xa66f('0x26')](handleError(_0x3cbbb6,null));};exports[_0xa66f('0xc0')]=function(_0x46c9b2,_0x580eb7){return db[_0xa66f('0x43')][_0xa66f('0xc0')](_0x46c9b2[_0xa66f('0x39')],{})[_0xa66f('0x34')](respondWithResult(_0x580eb7,0xc9))['catch'](handleError(_0x580eb7,null));};exports['update']=function(_0xd78ede,_0xe11c2d){if(_0xd78ede[_0xa66f('0x39')]['id']){delete _0xd78ede[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd78ede[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0xe11c2d,null))[_0xa66f('0x34')](saveUpdates(_0xd78ede[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0xe11c2d,null))['catch'](handleError(_0xe11c2d,null));};exports[_0xa66f('0x35')]=function(_0x597ae3,_0x1b93e0){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x597ae3[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x1b93e0,null))['then'](removeEntity(_0x1b93e0,null))['catch'](handleError(_0x1b93e0,null));};exports['describe']=function(_0x484c8e,_0x728faa){return db[_0xa66f('0x43')][_0xa66f('0xc1')]()[_0xa66f('0x34')](respondWithResult(_0x728faa,null))['catch'](handleError(_0x728faa,null));};exports[_0xa66f('0xc2')]=function(_0x174510,_0x4f3985){var _0x348e6b=_0x174510[_0xa66f('0xbe')]['id'];var _0x4ed950;var _0xe43d63;var _0x3c2367;return db['ChatInteraction'][_0xa66f('0xc3')]({'where':{'id':_0x348e6b}})[_0xa66f('0x34')](function(_0x32bea5){_0x4ed950=_0x32bea5;return db[_0xa66f('0xc4')][_0xa66f('0xc3')]({'where':{'id':_0x32bea5[_0xa66f('0x82')]},'attributes':['id',_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'),_0xa66f('0xc8'),_0xa66f('0xc9')],'raw':!![]});})['then'](function(_0x4c8386){if(_0x4c8386&&_0x4c8386[_0xa66f('0xc5')]&&_0x4c8386[_0xa66f('0xc6')]){_0xe43d63=_0x4c8386;var _0x12278e={'interaction':{'id':_0x348e6b},'agent':{'id':_0x174510['user']['id'],'name':_0x174510['user'][_0xa66f('0x37')],'fullname':_0x174510[_0xa66f('0x9f')][_0xa66f('0xca')],'email':_0x174510[_0xa66f('0x9f')][_0xa66f('0xcb')]},'contact':_0x174510['body'][_0xa66f('0x3a')],'account':_0x174510[_0xa66f('0x39')][_0xa66f('0xcc')]};var _0xfc01d7={'rejectUnauthorized':![],'method':'POST','url':_0xa66f('0xcd'),'headers':{'X-APIKEY':_0x4c8386[_0xa66f('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x174510['user'][_0xa66f('0xcb')]],'buttons':null,'topic':_0xe43d63[_0xa66f('0xc7')],'note':_['isNull'](_0xe43d63[_0xa66f('0xc8')])?null:getMustacheRender(_0xe43d63[_0xa66f('0xc8')],_0x12278e),'metadata':null},'redirect':_0xa66f('0xce'),'json':!![]};try{if(!_[_0xa66f('0xcf')](_0xe43d63[_0xa66f('0xc9')])){var _0x3c73cc=getMustacheRender(_0xe43d63[_0xa66f('0xc9')],_0x12278e);var _0x4885bb=JSON['parse'](_0x3c73cc);_0xfc01d7[_0xa66f('0x39')][_0xa66f('0xd0')]=_0x4885bb;}}catch(_0x2e7c26){throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xfc01d7);}else{throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa66f('0x34')](function(_0x56198a){_0x3c2367=_0x56198a;if(_0x3c2367['id']){var _0x41ef9a={'body':_0x3c2367[_0xa66f('0xd2')],'ChatWebsiteId':_0xe43d63['id'],'ChatInteractionId':_0x4ed950['id'],'direction':_0xa66f('0xd3'),'UserId':_0x174510[_0xa66f('0x9f')]['id']};return db['ChatMessage']['create'](_0x41ef9a,{});}else{throw new db['Sequelize'][(_0xa66f('0xd1'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa66f('0x34')](function(){return _0x4ed950['updateAttributes']({'vidaooSessionId':_0x3c2367['id']});})[_0xa66f('0x34')](respondWithResult(_0x4f3985,null))[_0xa66f('0x26')](handleError(_0x4f3985,null));};exports['customUpdate']=function(_0x35a2ce,_0x2d3bca){if(_0x35a2ce[_0xa66f('0x39')]['id']){delete _0x35a2ce[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x35a2ce[_0xa66f('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xa66f('0x72')}]})[_0xa66f('0x34')](handleEntityNotFound(_0x2d3bca,null))[_0xa66f('0x34')](saveUpdates(_0x35a2ce[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0x2d3bca,null))[_0xa66f('0x26')](handleError(_0x2d3bca,null));};exports[_0xa66f('0xd4')]=function(_0x3a2c2c,_0x179953,_0x5dcf9d){if(_0x3a2c2c[_0xa66f('0x39')]['id']){delete _0x3a2c2c['body']['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x3a2c2c[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](function(_0x1f4bc4){if(!_0x1f4bc4){logger['error'](_0xa66f('0xd5'),_0xa66f('0xd4'),0x194,_0xa66f('0xd6'));_0x179953[_0xa66f('0x27')](0x194);}else{if(_0x1f4bc4['UserId']){throw new db['Sequelize']['ValidationError'](_0xa66f('0xd7'));}}return _0x1f4bc4;})[_0xa66f('0x34')](function(_0x4be9ae){if(_0x4be9ae){return _0x4be9ae['update']({'closed':_0x3a2c2c[_0xa66f('0x39')][_0xa66f('0xd8')],'disposition':_0x3a2c2c['body'][_0xa66f('0xd9')]})[_0xa66f('0x34')](function(_0x17dc7d){return _0x17dc7d;});}})[_0xa66f('0x34')](function(_0x551c09){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3a2c2c[_0xa66f('0x39')],client9004);})[_0xa66f('0x34')](respondWithResult(_0x179953,null))[_0xa66f('0x26')](handleError(_0x179953,null));};exports[_0xa66f('0xda')]=function(_0x377764,_0x434764,_0x315b27){_0x377764[_0xa66f('0x39')]['name']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdc')];_0x377764[_0xa66f('0x39')]['basename']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdd')];_0x377764[_0xa66f('0x39')]['type']=_0x377764['file'][_0xa66f('0xde')];return db[_0xa66f('0xdf')][_0xa66f('0xc0')](_0x377764[_0xa66f('0x39')])[_0xa66f('0x34')](respondWithResult(_0x434764,0xc9))[_0xa66f('0x26')](handleError(_0x434764,null));};exports[_0xa66f('0xe0')]=function(_0x5c5550,_0x383ce6,_0x4b2702){return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550[_0xa66f('0xbe')]['id']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null))[_0xa66f('0x34')](function(_0x32f7ab){if(_0x32f7ab){if(_0x32f7ab[_0xa66f('0xd8')]){return _0x383ce6[_0xa66f('0x28')](0x193)[_0xa66f('0x2a')]({'status':0x193,'message':_0xa66f('0xe1')});}return db[_0xa66f('0xdf')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550['query']['attachId']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null));}})[_0xa66f('0x34')](function(_0x29ce7f){if(_0x29ce7f){var _0x1248c9=_0x29ce7f[_0xa66f('0xe2')]!==null;var _0x13948a=path['join'](config[_0xa66f('0xe3')],'server/files/attachments/');if(_0x1248c9){_0x13948a=path['join'](_0x13948a,_0xa66f('0xe4'));}var _0x1ce936=path[_0xa66f('0xe5')](_0x13948a,_0x29ce7f[_0xa66f('0xe6')]);return _0x383ce6['download'](_0x1ce936);}})[_0xa66f('0x26')](handleError(_0x383ce6,null));};exports[_0xa66f('0xe7')]=function(_0x1686df,_0x1889f4){var _0x2a03c8=null;var _0x48b16d=null;var _0x5a05e4=null;var _0x1b78fa=null;if(_0x1686df[_0xa66f('0x39')]['id']){delete _0x1686df[_0xa66f('0x39')]['id'];}if(_0x1686df[_0xa66f('0x39')]['mailTranscript']){_0x1b78fa=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0xe8'),util[_0xa66f('0xe9')](_0xa66f('0xea'),Date[_0xa66f('0xeb')]()));_0x1686df[_0xa66f('0x39')][_0xa66f('0xec')]=_0x1b78fa;}return db['ChatInteraction'][_0xa66f('0x77')]({'where':{'id':_0x1686df[_0xa66f('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66f('0xed'),'include':[{'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee')}]}]})[_0xa66f('0x34')](handleEntityNotFound(_0x1889f4,null))[_0xa66f('0x34')](saveUpdates(_0x1686df['body'],null))[_0xa66f('0x34')](function(_0x4153a0){if(_0x4153a0){_0x2a03c8=_0x4153a0;return db[_0xa66f('0xc4')][_0xa66f('0x77')]({'where':{'id':_0x2a03c8[_0xa66f('0x82')]}});}})['then'](function(_0x820ac1){if(_0x820ac1){_0x5a05e4=_0x820ac1;return db[_0xa66f('0xef')]['find']({'where':{'id':_0x2a03c8[_0xa66f('0xf0')]}});}})[_0xa66f('0x34')](function(_0x22d154){if(_0x22d154){_0x48b16d=_0x22d154;if(_0x1b78fa){var _0x31959f=null;for(var _0x2d3123=0x1;_0x2d3123<_0x2a03c8['Messages'][_0xa66f('0x4f')];++_0x2d3123){_0x31959f=_0x2a03c8[_0xa66f('0xed')][_0x2d3123];var _0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f['UserId']):_0xa66f('0xf3');var _0x19fabd=_0x1686df[_0xa66f('0x39')][_0xa66f('0xf4')]||util['format'](_0xa66f('0xf1'),_0xa66f('0xf5'),_0x31959f['ContactId']);switch(_0x5a05e4[_0xa66f('0xf6')]){case _0xa66f('0xf7'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f[_0xa66f('0x7e')]):'System';break;case _0xa66f('0xf8'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f['User']['alias']||_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:'System';break;case _0xa66f('0xf9'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3');break;default:_0x207ea2=_0x31959f['UserId']?util[_0xa66f('0xe9')](_0xa66f('0xf1'),_0x5a05e4['agentAlias'],_0x31959f[_0xa66f('0x7e')]):'System';}var _0x506797=util[_0xa66f('0xe9')](_0xa66f('0xfa'),moment(_0x31959f['createdAt'])[_0xa66f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x31959f[_0xa66f('0xfb')]==='in'?_0x19fabd:_0x207ea2,_0x31959f[_0xa66f('0x39')]);if(!_0x31959f['secret']){fs['appendFileSync'](_0x1b78fa,_0x506797);}}return db['MailAccount'][_0xa66f('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xa66f('0xfc')],'as':_0xa66f('0xfd'),'raw':!![]}]});}}})[_0xa66f('0x34')](function(_0x168d31){if(_0x168d31&&_0x168d31[_0xa66f('0xfd')]&&_0x1686df[_0xa66f('0x39')]){var _0x5a762d={'tls':{'rejectUnauthorized':![]}};if(_0x168d31['Smtp'][_0xa66f('0xfe')]){_0x5a762d[_0xa66f('0xfe')]=_0x168d31[_0xa66f('0xfd')][_0xa66f('0xfe')];}else{_0x5a762d[_0xa66f('0xff')]=_0x168d31[_0xa66f('0xfd')]['host'];_0x5a762d[_0xa66f('0x100')]=_0x168d31[_0xa66f('0xfd')]['port'];_0x5a762d[_0xa66f('0x101')]=_0x168d31['Smtp'][_0xa66f('0x101')];}if(_0x168d31['Smtp']['authentication']){_0x5a762d[_0xa66f('0x102')]={'user':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x9f')],'pass':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x103')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5a762d,'message':{'from':util[_0xa66f('0xe9')](_0xa66f('0x104'),_0x168d31[_0xa66f('0x37')],_0x168d31['email']||_0x168d31['Smtp']['user']),'to':_0x1686df[_0xa66f('0x39')][_0xa66f('0x105')],'subject':_0xa66f('0x106'),'text':util[_0xa66f('0xe9')](_0xa66f('0x107'),_0x1686df[_0xa66f('0x39')]['mailTranscript']),'attachments':[{'path':_0x1b78fa}]}})[_0xa66f('0x34')](function(){return _0x2a03c8;})[_0xa66f('0x26')](function(_0x3215af){console['error'](_0x3215af);});}else{return _0x2a03c8;}})[_0xa66f('0x34')](respondWithStatusCode(_0x1889f4,0xc8))[_0xa66f('0x26')](handleError(_0x1889f4,null));};exports['addMessage']=function(_0x4e4b66,_0x2aaaab,_0x75d882){return db[_0xa66f('0x108')][_0xa66f('0x77')]({'where':{'id':_0x4e4b66['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x2aaaab,null))[_0xa66f('0x34')](function(_0x21e1d1){if(_0x21e1d1){return _0x21e1d1[_0xa66f('0x109')](_0x4e4b66[_0xa66f('0x39')]['ids'],_[_0xa66f('0x10a')](_0x4e4b66[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{});}})['then'](respondWithResult(_0x2aaaab,null))[_0xa66f('0x26')](handleError(_0x2aaaab,null));};exports[_0xa66f('0x10c')]=function(_0x53170d,_0x5d1e51,_0x3c3aff){var _0x3fb295={'raw':![],'where':{}};var _0x57c403={};var _0x31832f={'count':0x0,'rows':[]};return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x53170d[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5d1e51,null))[_0xa66f('0x34')](function(_0x43cc99){if(_0x43cc99){_0x57c403['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x57c403['query']=_['keys'](_0x53170d[_0xa66f('0x4a')]);_0x57c403[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],_0x57c403[_0xa66f('0x4a')]);_0x3fb295['attributes']=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],qs['fields'](_0x53170d['query']['fields']));_0x3fb295[_0xa66f('0x4e')]=_0x3fb295[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x3fb295['attributes']:_0x57c403[_0xa66f('0x48')];if(!_0x53170d[_0xa66f('0x4a')][_0xa66f('0x50')]('nolimit')){_0x3fb295[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x53170d[_0xa66f('0x4a')]['limit']);_0x3fb295[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x3fb295[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x3fb295['where']=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x53170d[_0xa66f('0x4a')],_0x57c403[_0xa66f('0x4b')]));_0x3fb295[_0xa66f('0x54')][_0xa66f('0xbb')]=_0x43cc99['id'];if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]){_0x3fb295[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x3fb295[_0xa66f('0x54')],{'$or':_[_0xa66f('0x42')](_0x3fb295[_0xa66f('0x4e')],function(_0x2b9a3c){var _0x1d688a={};_0x1d688a[_0x2b9a3c]={'$like':'%'+_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x1d688a;})});}if(_0x53170d['query'][_0xa66f('0x84')]){var _0x570a01=_0x53170d['query']['$gte'][_0xa66f('0x3f')](',');var _0x35919e={};_0x35919e[_0x570a01[0x0]]={'$gte':moment(_0x570a01[0x1])[_0xa66f('0xe9')](_0xa66f('0x10e'))};_0x3fb295[_0xa66f('0x54')]=_['merge'](_0x3fb295[_0xa66f('0x54')],_0x35919e);}_0x3fb295=_['merge']({},_0x3fb295,_0x53170d[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x3fb295['where']})[_0xa66f('0x34')](function(_0x3517eb){_0x31832f[_0xa66f('0x2d')]=_0x3517eb;if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3fb295['include']=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x3fb295);})[_0xa66f('0x34')](function(_0x24c209){_0x31832f[_0xa66f('0xbd')]=_0x24c209;return _0x31832f;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x5d1e51,_0x3fb295))[_0xa66f('0x26')](handleError(_0x5d1e51,null));};exports[_0xa66f('0x110')]=function(_0x1ef4c2,_0x21ec7f,_0x32b1c1){var _0x4ee9a3={'where':{}},_0x12889f={},_0xc813ad={'count':0x0,'rows':[]};return db[_0xa66f('0x43')]['findOne']({'where':{'id':_0x1ef4c2['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x21ec7f,null))[_0xa66f('0x34')](function(_0x3a1e4a){if(_0x3a1e4a){_0x12889f['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x12889f[_0xa66f('0x4a')]=_[_0xa66f('0x49')](_0x1ef4c2[_0xa66f('0x4a')]);_0x12889f[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],_0x12889f[_0xa66f('0x4a')]);_0x4ee9a3[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x1ef4c2[_0xa66f('0x4a')]['fields']));_0x4ee9a3[_0xa66f('0x4e')]=_0x4ee9a3[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x4ee9a3[_0xa66f('0x4e')]:_0x12889f['model'];if(!_0x1ef4c2[_0xa66f('0x4a')]['hasOwnProperty'](_0xa66f('0x51'))){_0x4ee9a3[_0xa66f('0x2e')]=qs['limit'](_0x1ef4c2['query'][_0xa66f('0x2e')]);_0x4ee9a3[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x4ee9a3[_0xa66f('0x52')]=qs['sort'](_0x1ef4c2['query']['sort']);_0x4ee9a3[_0xa66f('0x54')]=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x1ef4c2[_0xa66f('0x4a')],_0x12889f[_0xa66f('0x4b')]));_0x4ee9a3['where'][_0xa66f('0xbb')]=_0x3a1e4a['id'];if(_0x1ef4c2['query'][_0xa66f('0x8d')]){_0x4ee9a3[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x4ee9a3['where'],{'$or':_['map'](_0x4ee9a3[_0xa66f('0x4e')],function(_0x2bf349){var _0x211ac6={};_0x211ac6[_0x2bf349]={'$like':'%'+_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x211ac6;})});}_0x4ee9a3[_0xa66f('0x54')]['secret']=![];if(_0x1ef4c2[_0xa66f('0x4a')]['id']){_0x4ee9a3['where']['id']={'$gt':_0x1ef4c2['query']['id']};}_0x4ee9a3=_[_0xa66f('0x10d')]({},_0x4ee9a3,_0x1ef4c2[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x4ee9a3['where']})['then'](function(_0x533dc1){_0xc813ad[_0xa66f('0x2d')]=_0x533dc1;_0x4ee9a3[_0xa66f('0x111')]=[];if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x112')]){_0x4ee9a3[_0xa66f('0x111')][_0xa66f('0x41')]({'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca'),_0xa66f('0x113')]});}if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x4ee9a3[_0xa66f('0x111')]=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x4ee9a3);})['then'](function(_0x554ba6){_0xc813ad[_0xa66f('0xbd')]=_0x554ba6;return _0xc813ad;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x21ec7f,_0x4ee9a3))[_0xa66f('0x26')](handleError(_0x21ec7f,null));};exports[_0xa66f('0x114')]=function(_0x1a3bac,_0x44649c,_0x5e4fbc){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x1a3bac[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x44649c,null))[_0xa66f('0x34')](function(_0x1d2967){if(_0x1d2967){return _0x1d2967[_0xa66f('0x115')](_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')],_[_0xa66f('0x10a')](_0x1a3bac[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{})['spread'](function(){return db[_0xa66f('0x7a')][_0xa66f('0x116')]({'attributes':['id','name',_0xa66f('0x117')],'where':{'id':_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')]}});})['then'](function(_0x367549){socket[_0xa66f('0x118')](_0xa66f('0x119'),{'id':Number(_0x1a3bac['params']['id']),'tags':_0x367549||[]});return{'id':Number(_0x1a3bac[_0xa66f('0xbe')]['id']),'tags':_0x367549||[]};});}})[_0xa66f('0x34')](respondWithResult(_0x44649c,null))[_0xa66f('0x26')](handleError(_0x44649c,null));};exports[_0xa66f('0x11a')]=function(_0x4a1613,_0x324b7e,_0x1d3395){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x4a1613[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x324b7e,null))[_0xa66f('0x34')](function(_0x33f1ea){if(_0x33f1ea){return _0x33f1ea[_0xa66f('0x11a')](_0x4a1613[_0xa66f('0x4a')]['ids']);}})[_0xa66f('0x34')](respondWithStatusCode(_0x324b7e,null))['catch'](handleError(_0x324b7e,null));};exports[_0xa66f('0x11b')]=function(_0xd7dccf,_0x2b4238){var _0x321fa1=moment()['unix']()['toString']();var _0x254599=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),_0xa66f('0x11d'),_0xa66f('0x11e'));var _0x3b9ff3=path['join'](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'files',_0xa66f('0x11f'));var _0x5206a5=path['join'](_0x254599,_0x321fa1);var _0x6b60bd=util[_0xa66f('0xe9')](_0xa66f('0x120'),_0xd7dccf['params']['id'],_0x321fa1);var _0x3709b6=path['join'](_0x254599,_0x6b60bd);var _0x21bda3=[];_0x21bda3[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca')],'raw':!![]});_0x21bda3[_0xa66f('0x41')]({'model':db[_0xa66f('0xef')],'as':_0xa66f('0x72'),'attributes':['id',_0xa66f('0x121'),_0xa66f('0x122')],'raw':!![]});if(_0xd7dccf['query'][_0xa66f('0x11f')]){_0x21bda3[_0xa66f('0x41')]({'model':db['Attachment'],'as':_0xa66f('0xdf'),'raw':!![]});}var _0x22e7a6=[{'model':db[_0xa66f('0x108')],'as':_0xa66f('0xed'),'attributes':['id',_0xa66f('0x39'),_0xa66f('0x123'),_0xa66f('0xfb'),_0xa66f('0x124'),_0xa66f('0x125')],'include':_0x21bda3}];_0x22e7a6[_0xa66f('0x41')]({'model':db[_0xa66f('0xc4')],'as':_0xa66f('0x126'),'attributes':['id','name']});_0x22e7a6[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0x127'),'attributes':['id',_0xa66f('0xca')]});return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd7dccf[_0xa66f('0xbe')]['id']},'include':_0x22e7a6})[_0xa66f('0x34')](handleEntityNotFound(_0x2b4238,null))[_0xa66f('0x34')](function(_0x5efd6c){if(_0x5efd6c){var _0x24ee72=_0x5efd6c['get']({'plain':!![]});fs[_0xa66f('0x128')](_0x5206a5);var _0xdbb792={'channel':_0xa66f('0x129'),'account':_0x24ee72['Account'][_0xa66f('0x37')],'agent':_0x24ee72[_0xa66f('0x127')]?_0x24ee72['Owner']['fullname']:_0xa66f('0x12a'),'createdAt':moment(_0x24ee72[_0xa66f('0x123')])[_0xa66f('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0xa3')](),'closedAt':_0x24ee72[_0xa66f('0xd8')]?moment(_0x24ee72[_0xa66f('0x12b')])['format'](_0xa66f('0x10e'))[_0xa66f('0xa3')]():'','disposition':_0x24ee72[_0xa66f('0xd9')],'chatInfo':{'browser':_0x24ee72[_0xa66f('0x12c')],'os':_0x24ee72[_0xa66f('0x12d')],'referer':_0x24ee72['referer'],'customerIp':_0x24ee72[_0xa66f('0x12e')],'customerPort':_0x24ee72[_0xa66f('0x12f')]?_0x24ee72[_0xa66f('0x12f')]:_0xa66f('0x12a')},'messages':_(_0x24ee72[_0xa66f('0xed')])[_0xa66f('0x130')]()['filter']({'secret':![]})[_0xa66f('0x42')](function(_0x31cc20){if(_0x31cc20['Attachment']){var _0x10a611=path[_0xa66f('0xe5')](_0x3b9ff3,_0x31cc20['Attachment'][_0xa66f('0xe6')]);if(fs[_0xa66f('0x131')](_0x10a611)){fs[_0xa66f('0x132')](_0x10a611)['pipe'](fs[_0xa66f('0x133')](path['join'](_0x5206a5,_0x31cc20['Attachment']['basename'])));}}return{'date':moment(_0x31cc20['createdAt'])['format'](_0xa66f('0x10e'))['toString'](),'sender':_0x31cc20[_0xa66f('0xfb')]===_0xa66f('0xd3')?_0x31cc20[_0xa66f('0xee')]?_0x31cc20[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3'):_0x31cc20[_0xa66f('0x72')][_0xa66f('0x121')]+(_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]?'\x20'+_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]:''),'body':_0x31cc20[_0xa66f('0xdf')]?_0x31cc20[_0xa66f('0xdf')][_0xa66f('0xe6')]:_0x31cc20[_0xa66f('0x39')],'direction':_0x31cc20[_0xa66f('0xfb')]==='out'?'A':'C','secret':_0x31cc20['secret'],'read':_0x31cc20[_0xa66f('0x125')],'attachment':_0x31cc20[_0xa66f('0xdf')]};})[_0xa66f('0x6e')]()};return ejs[_0xa66f('0x134')](path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'views',_0xa66f('0x135')),{'interaction':_0xdbb792})['then'](function(_0x12024d){var _0x4baf59=path[_0xa66f('0xe5')](_0x5206a5,_0xa66f('0x136')+_0x24ee72['id']+'-'+_0x321fa1+'.pdf');var _0x33198c={'path':_0x4baf59,'channel':_0xa66f('0x129'),'interactionId':_0x24ee72['id']};return pdf[_0xa66f('0x137')](_0x12024d,_0x33198c);})[_0xa66f('0x34')](function(){return new BPromise(function(_0x3792b2,_0x5101f8){zipdir(_0x5206a5,{'saveTo':_0x3709b6},function(_0x4ac4b4,_0x171111){if(_0x4ac4b4)return _0x5101f8(_0x4ac4b4);return _0x3792b2(_0x171111);});})[_0xa66f('0x34')](function(){return new BPromise(function(_0x46691d,_0x136518){rimraf(_0x5206a5,function(_0x1404df){if(_0x1404df)_0x136518(_0x1404df);return _0x46691d();});});})[_0xa66f('0x34')](function(){return _0x2b4238[_0xa66f('0x11b')](_0x3709b6,_0x6b60bd,function(_0x58f445){if(_0x58f445){console[_0xa66f('0x138')](_0xa66f('0x139'),_0x58f445);}else{fs['unlinkSync'](_0x3709b6);}});});});}else{return _0x2b4238[_0xa66f('0x27')](0xc8);}})['catch'](handleError(_0x2b4238,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 6c209c5..fbffa52 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 _0xf946=['../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','ChatInteraction'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0xf946,0x1d2));var _0x6f94=function(_0x14a84e,_0xffb06){_0x14a84e=_0x14a84e-0x0;var _0x2aca47=_0xf946[_0x14a84e];return _0x2aca47;};'use strict';var EventEmitter=require(_0x6f94('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x6f94('0x1')];var ChatMessage=require(_0x6f94('0x2'))['db'][_0x6f94('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6f94('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6f94('0x5')};function emitEvent(_0xb3efe6){return function(_0x25ac3e,_0x2708a8,_0x467db0){_0x25ac3e[_0x6f94('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2dedfd){_0x25ac3e[_0x6f94('0x7')](_0x6f94('0x8'),_0x2dedfd[_0x6f94('0x9')](function(_0x481261){return{'id':_0x481261['id']};}));return ChatMessage[_0x6f94('0xa')]({'where':{'ChatInteractionId':_0x25ac3e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6f94('0xb')](function(_0xc10abf){_0x25ac3e[_0x6f94('0x7')](_0x6f94('0xc'),_0xc10abf[_0x6f94('0xd')]);ChatInteractionEvents[_0x6f94('0xe')](_0xb3efe6+':'+_0x25ac3e['id'],_0x25ac3e);ChatInteractionEvents[_0x6f94('0xe')](_0xb3efe6,_0x25ac3e);_0x467db0(null);})[_0x6f94('0xf')](_0x467db0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x6f94('0x10')](e,emitEvent(event));}}module[_0x6f94('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc202=['remove','then','setDataValue','map','findAll','unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update'];(function(_0x1ea9da,_0x565f5c){var _0x7a4c3a=function(_0x43a3c4){while(--_0x43a3c4){_0x1ea9da['push'](_0x1ea9da['shift']());}};_0x7a4c3a(++_0x565f5c);}(_0xc202,0x81));var _0x2c20=function(_0x446216,_0x441943){_0x446216=_0x446216-0x0;var _0x24ecd3=_0xc202[_0x446216];return _0x24ecd3;};'use strict';var EventEmitter=require(_0x2c20('0x0'));var ChatInteraction=require(_0x2c20('0x1'))['db'][_0x2c20('0x2')];var ChatMessage=require(_0x2c20('0x1'))['db'][_0x2c20('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2c20('0x4')](0x0);var events={'afterCreate':_0x2c20('0x5'),'afterUpdate':_0x2c20('0x6'),'afterDestroy':_0x2c20('0x7')};function emitEvent(_0x36163f){return function(_0xc1e0a2,_0x4da95d,_0x2a04cc){_0xc1e0a2['getUsers']({'attributes':['id'],'raw':!![]})[_0x2c20('0x8')](function(_0x580452){_0xc1e0a2[_0x2c20('0x9')]('Users',_0x580452[_0x2c20('0xa')](function(_0x50d3fd){return{'id':_0x50d3fd['id']};}));return ChatMessage[_0x2c20('0xb')]({'where':{'ChatInteractionId':_0xc1e0a2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2c20('0x8')](function(_0x13377c){_0xc1e0a2['setDataValue'](_0x2c20('0xc'),_0x13377c[_0x2c20('0xd')]);ChatInteractionEvents['emit'](_0x36163f+':'+_0xc1e0a2['id'],_0xc1e0a2);ChatInteractionEvents['emit'](_0x36163f,_0xc1e0a2);_0x2a04cc(null);})['catch'](_0x2a04cc(null));};}for(var e in events){if(events[_0x2c20('0xe')](e)){var event=events[e];ChatInteraction[_0x2c20('0xf')](e,emitEvent(event));}}module[_0x2c20('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 02cc261..273cc6e 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 _0x3d50=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x40de9e,_0x5051cd){var _0x3a4e48=function(_0x476ad7){while(--_0x476ad7){_0x40de9e['push'](_0x40de9e['shift']());}};_0x3a4e48(++_0x5051cd);}(_0x3d50,0xbf));var _0x03d5=function(_0x5017b2,_0x2f1d99){_0x5017b2=_0x5017b2-0x0;var _0x1bfbc1=_0x3d50[_0x5017b2];return _0x1bfbc1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x03d5('0x0'))(_0x03d5('0x1'));var moment=require(_0x03d5('0x2'));var BPromise=require(_0x03d5('0x3'));var rp=require(_0x03d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03d5('0x5'));var config=require(_0x03d5('0x6'));var attributes=require(_0x03d5('0x7'));module[_0x03d5('0x8')]=function(_0x2164ff,_0x17a9ea){return _0x2164ff[_0x03d5('0x9')](_0x03d5('0xa'),attributes,{'tableName':_0x03d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa589cc,_0x4e1c2a,_0x123514){if(_0xa589cc[_0x03d5('0xc')](_0x03d5('0xd'))){_0xa589cc[_0x03d5('0xe')]=moment()[_0x03d5('0xf')](_0x03d5('0x10'));}_0x123514(null,_0xa589cc);}},'charset':_0x03d5('0x11'),'collate':_0x03d5('0x12')});};
\ No newline at end of file
+var _0x2b04=['format','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x2b04,0x1d5));var _0x42b0=function(_0x1df561,_0x31fa71){_0x1df561=_0x1df561-0x0;var _0x445716=_0x2b04[_0x1df561];return _0x445716;};'use strict';var _=require(_0x42b0('0x0'));var util=require(_0x42b0('0x1'));var logger=require(_0x42b0('0x2'))(_0x42b0('0x3'));var moment=require('moment');var BPromise=require(_0x42b0('0x4'));var rp=require(_0x42b0('0x5'));var fs=require('fs');var path=require(_0x42b0('0x6'));var rimraf=require(_0x42b0('0x7'));var config=require(_0x42b0('0x8'));var attributes=require(_0x42b0('0x9'));module[_0x42b0('0xa')]=function(_0x4ae8a2,_0x16989d){return _0x4ae8a2[_0x42b0('0xb')](_0x42b0('0xc'),attributes,{'tableName':_0x42b0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eebe0,_0x1e21c4,_0x25c741){if(_0x3eebe0[_0x42b0('0xe')](_0x42b0('0xf'))){_0x3eebe0[_0x42b0('0x10')]=moment()[_0x42b0('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x25c741(null,_0x3eebe0);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 07aa999..07548a2 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 _0xe4ff=['options','raw','where','limit','AddTagsToChatInteraction','ChatInteraction','find','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body'];(function(_0x589914,_0x202fff){var _0x17ef31=function(_0x31ba6b){while(--_0x31ba6b){_0x589914['push'](_0x589914['shift']());}};_0x17ef31(++_0x202fff);}(_0xe4ff,0x1a4));var _0xfe4f=function(_0x517724,_0x51e5c0){_0x517724=_0x517724-0x0;var _0x4c73a5=_0xe4ff[_0x517724];return _0x4c73a5;};'use strict';var _=require(_0xfe4f('0x0'));var util=require(_0xfe4f('0x1'));var moment=require(_0xfe4f('0x2'));var BPromise=require('bluebird');var rs=require(_0xfe4f('0x3'));var fs=require('fs');var Redis=require(_0xfe4f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe4f('0x5'));var logger=require(_0xfe4f('0x6'))(_0xfe4f('0x7'));var config=require(_0xfe4f('0x8'));var jayson=require(_0xfe4f('0x9'));var client=jayson[_0xfe4f('0xa')][_0xfe4f('0xb')]({'port':0x232a});config[_0xfe4f('0xc')]=_[_0xfe4f('0xd')](config[_0xfe4f('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfe4f('0xe'))['register'](socket);function respondWithRpcPromise(_0xb0f9e,_0x466eff,_0x217953){return new BPromise(function(_0x46d79d,_0x500256){return client[_0xfe4f('0xf')](_0xb0f9e,_0x217953)[_0xfe4f('0x10')](function(_0x1006c3){logger[_0xfe4f('0x11')](_0xfe4f('0x12'),_0x466eff,_0xfe4f('0x13'));logger[_0xfe4f('0x14')](_0xfe4f('0x15'),_0x466eff,'request\x20sent',JSON[_0xfe4f('0x16')](_0x1006c3));if(_0x1006c3['error']){if(_0x1006c3[_0xfe4f('0x17')][_0xfe4f('0x18')]===0x1f4){logger['error'](_0xfe4f('0x12'),_0x466eff,_0x1006c3[_0xfe4f('0x17')]['message']);return _0x500256(_0x1006c3[_0xfe4f('0x17')][_0xfe4f('0x19')]);}logger[_0xfe4f('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x466eff,_0x1006c3[_0xfe4f('0x17')]['message']);return _0x46d79d(_0x1006c3['error'][_0xfe4f('0x19')]);}else{logger[_0xfe4f('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x466eff,_0xfe4f('0x13'));_0x46d79d(_0x1006c3[_0xfe4f('0x1a')][_0xfe4f('0x19')]);}})[_0xfe4f('0x1b')](function(_0xfe585f){logger[_0xfe4f('0x17')](_0xfe4f('0x12'),_0x466eff,_0xfe585f);_0x500256(_0xfe585f);});});}exports[_0xfe4f('0x1c')]=function(_0xdfe6d4){var _0x3a268f=this;return new Promise(function(_0x5617be,_0x1a55e3){return db['ChatInteraction'][_0xfe4f('0x1d')](_0xdfe6d4[_0xfe4f('0x1e')],{'raw':_0xdfe6d4[_0xfe4f('0x1f')]?_0xdfe6d4[_0xfe4f('0x1f')][_0xfe4f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdfe6d4[_0xfe4f('0x1f')]?_0xdfe6d4['options'][_0xfe4f('0x21')]||null:null,'attributes':_0xdfe6d4[_0xfe4f('0x1f')]?_0xdfe6d4[_0xfe4f('0x1f')]['attributes']||null:null,'limit':_0xdfe6d4[_0xfe4f('0x1f')]?_0xdfe6d4[_0xfe4f('0x1f')][_0xfe4f('0x22')]||null:null})[_0xfe4f('0x10')](function(_0x1d6120){logger[_0xfe4f('0x11')](_0xfe4f('0x1c'),_0xdfe6d4);logger[_0xfe4f('0x14')](_0xfe4f('0x1c'),_0xdfe6d4,JSON['stringify'](_0x1d6120));_0x5617be(_0x1d6120);})['catch'](function(_0x4d09ad){logger[_0xfe4f('0x17')](_0xfe4f('0x1c'),_0x4d09ad[_0xfe4f('0x19')],_0xdfe6d4);_0x1a55e3(_0x3a268f[_0xfe4f('0x17')](0x1f4,_0x4d09ad['message']));});});};exports[_0xfe4f('0x23')]=function(_0x5ee8f9){return new Promise(function(_0x1030d7,_0x365003){return db[_0xfe4f('0x24')][_0xfe4f('0x25')]({'where':_0x5ee8f9[_0xfe4f('0x1f')]?_0x5ee8f9[_0xfe4f('0x1f')][_0xfe4f('0x21')]||null:null})[_0xfe4f('0x10')](function(_0x368b32){if(_0x368b32){return _0x368b32['addTags'](_0x5ee8f9[_0xfe4f('0x1e')][_0xfe4f('0x26')],_['omit'](_0x5ee8f9[_0xfe4f('0x1e')],[_0xfe4f('0x26'),'id'])||{});}})[_0xfe4f('0x27')](function(_0x2f7c93){logger[_0xfe4f('0x11')]('AddTags',_0x5ee8f9);logger[_0xfe4f('0x14')]('AddTags',_0x5ee8f9,JSON[_0xfe4f('0x16')](_0x2f7c93));_0x1030d7(_0x2f7c93);})[_0xfe4f('0x1b')](function(_0x7f30c4){logger[_0xfe4f('0x17')](_0xfe4f('0x28'),_0x7f30c4[_0xfe4f('0x19')],_0x5ee8f9);_0x365003(_this[_0xfe4f('0x17')](0x1f4,_0x7f30c4['message']));});});};
\ No newline at end of file
+var _0xf892=['attributes','limit','debug','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','localhost','./chatInteraction.socket','request','then','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf892,0x80));var _0x2f89=function(_0x485c9f,_0x399a20){_0x485c9f=_0x485c9f-0x0;var _0x2ba76e=_0xf892[_0x485c9f];return _0x2ba76e;};'use strict';var _=require(_0x2f89('0x0'));var util=require(_0x2f89('0x1'));var moment=require(_0x2f89('0x2'));var BPromise=require(_0x2f89('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f89('0x4'));var db=require(_0x2f89('0x5'))['db'];var utils=require(_0x2f89('0x6'));var logger=require('../../config/logger')(_0x2f89('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f89('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x2f89('0x9')]=_['defaults'](config[_0x2f89('0x9')],{'host':_0x2f89('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f89('0x9')]));require(_0x2f89('0xb'))['register'](socket);function respondWithRpcPromise(_0x4fbc88,_0x136cc5,_0xb2014d){return new BPromise(function(_0x2ff3ea,_0x4b3e54){return client[_0x2f89('0xc')](_0x4fbc88,_0xb2014d)[_0x2f89('0xd')](function(_0x4cf405){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x136cc5,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x136cc5,_0x2f89('0xe'),JSON[_0x2f89('0xf')](_0x4cf405));if(_0x4cf405[_0x2f89('0x10')]){if(_0x4cf405[_0x2f89('0x10')][_0x2f89('0x11')]===0x1f4){logger[_0x2f89('0x10')](_0x2f89('0x12'),_0x136cc5,_0x4cf405[_0x2f89('0x10')][_0x2f89('0x13')]);return _0x4b3e54(_0x4cf405['error']['message']);}logger[_0x2f89('0x10')](_0x2f89('0x12'),_0x136cc5,_0x4cf405[_0x2f89('0x10')]['message']);return _0x2ff3ea(_0x4cf405[_0x2f89('0x10')][_0x2f89('0x13')]);}else{logger[_0x2f89('0x14')](_0x2f89('0x12'),_0x136cc5,'request\x20sent');_0x2ff3ea(_0x4cf405['result']['message']);}})[_0x2f89('0x15')](function(_0x3e84f1){logger[_0x2f89('0x10')](_0x2f89('0x12'),_0x136cc5,_0x3e84f1);_0x4b3e54(_0x3e84f1);});});}exports[_0x2f89('0x16')]=function(_0x274b76){var _0x32c55b=this;return new Promise(function(_0x24a5b9,_0x56abbc){return db[_0x2f89('0x17')][_0x2f89('0x18')](_0x274b76['body'],{'raw':_0x274b76[_0x2f89('0x19')]?_0x274b76[_0x2f89('0x19')][_0x2f89('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x274b76[_0x2f89('0x19')]?_0x274b76['options'][_0x2f89('0x1b')]||null:null,'attributes':_0x274b76[_0x2f89('0x19')]?_0x274b76['options'][_0x2f89('0x1c')]||null:null,'limit':_0x274b76[_0x2f89('0x19')]?_0x274b76[_0x2f89('0x19')][_0x2f89('0x1d')]||null:null})[_0x2f89('0xd')](function(_0x1f791b){logger[_0x2f89('0x14')](_0x2f89('0x16'),_0x274b76);logger[_0x2f89('0x1e')]('UpdateChatInteraction',_0x274b76,JSON['stringify'](_0x1f791b));_0x24a5b9(_0x1f791b);})[_0x2f89('0x15')](function(_0x41e848){logger[_0x2f89('0x10')](_0x2f89('0x16'),_0x41e848[_0x2f89('0x13')],_0x274b76);_0x56abbc(_0x32c55b[_0x2f89('0x10')](0x1f4,_0x41e848['message']));});});};exports[_0x2f89('0x1f')]=function(_0x3361ec){return new Promise(function(_0x3e0d12,_0x3a6880){return db[_0x2f89('0x17')][_0x2f89('0x20')]({'where':_0x3361ec[_0x2f89('0x19')]?_0x3361ec[_0x2f89('0x19')][_0x2f89('0x1b')]||null:null})[_0x2f89('0xd')](function(_0x2f2d88){if(_0x2f2d88){return _0x2f2d88[_0x2f89('0x21')](_0x3361ec[_0x2f89('0x22')][_0x2f89('0x23')],_[_0x2f89('0x24')](_0x3361ec[_0x2f89('0x22')],[_0x2f89('0x23'),'id'])||{});}})[_0x2f89('0x25')](function(_0x132aa6){logger[_0x2f89('0x14')](_0x2f89('0x26'),_0x3361ec);logger['debug']('AddTags',_0x3361ec,JSON[_0x2f89('0xf')](_0x132aa6));_0x3e0d12(_0x132aa6);})[_0x2f89('0x15')](function(_0x4c2fa1){logger[_0x2f89('0x10')](_0x2f89('0x26'),_0x4c2fa1[_0x2f89('0x13')],_0x3361ec);_0x3a6880(_this[_0x2f89('0x10')](0x1f4,_0x4c2fa1[_0x2f89('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 861a4cc..dd3af44 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 _0xccc7=['update','emit','removeListener','register','./chatInteraction.events','save','remove'];(function(_0x2cd160,_0x1824a8){var _0x3174c6=function(_0x19b896){while(--_0x19b896){_0x2cd160['push'](_0x2cd160['shift']());}};_0x3174c6(++_0x1824a8);}(_0xccc7,0x17e));var _0x7ccc=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xccc7[_0x25e7cb];return _0x375d92;};'use strict';var ChatInteractionEvents=require(_0x7ccc('0x0'));var events=[_0x7ccc('0x1'),_0x7ccc('0x2'),_0x7ccc('0x3')];function createListener(_0x56010b,_0x33fa85){return function(_0x531ee4){_0x33fa85[_0x7ccc('0x4')](_0x56010b,_0x531ee4);};}function removeListener(_0xf210d0,_0x190d90){return function(){ChatInteractionEvents[_0x7ccc('0x5')](_0xf210d0,_0x190d90);};}exports[_0x7ccc('0x6')]=function(_0x1b8380){for(var _0x46be05=0x0,_0x3e11b2=events['length'];_0x46be05<_0x3e11b2;_0x46be05++){var _0x34e009=events[_0x46be05];var _0x2eb9d8=createListener('chatInteraction:'+_0x34e009,_0x1b8380);ChatInteractionEvents['on'](_0x34e009,_0x2eb9d8);}};
\ No newline at end of file
+var _0x967c=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x547d66,_0x59652a){var _0x39f84e=function(_0x121c1d){while(--_0x121c1d){_0x547d66['push'](_0x547d66['shift']());}};_0x39f84e(++_0x59652a);}(_0x967c,0xfd));var _0xc967=function(_0x28afb6,_0x3b9984){_0x28afb6=_0x28afb6-0x0;var _0x2710b3=_0x967c[_0x28afb6];return _0x2710b3;};'use strict';var ChatInteractionEvents=require(_0xc967('0x0'));var events=[_0xc967('0x1'),_0xc967('0x2'),'update'];function createListener(_0x250474,_0x38da99){return function(_0x551fa4){_0x38da99[_0xc967('0x3')](_0x250474,_0x551fa4);};}function removeListener(_0x53533a,_0x59e07c){return function(){ChatInteractionEvents[_0xc967('0x4')](_0x53533a,_0x59e07c);};}exports[_0xc967('0x5')]=function(_0x154162){for(var _0x408a54=0x0,_0x45edaf=events[_0xc967('0x6')];_0x408a54<_0x45edaf;_0x408a54++){var _0x57d5cd=events[_0x408a54];var _0x359485=createListener(_0xc967('0x7')+_0x57d5cd,_0x154162);ChatInteractionEvents['on'](_0x57d5cd,_0x359485);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index dbf56eb..37994ce 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 _0x81ea=['attachmentUpload','addMessage','tracked','chat','addTags','chatinteraction:update','update','customUpdate','put','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','format','%s-%s','now','originalname','replace','single'];(function(_0x16d999,_0x1bdfac){var _0x56afe7=function(_0x392493){while(--_0x392493){_0x16d999['push'](_0x16d999['shift']());}};_0x56afe7(++_0x1bdfac);}(_0x81ea,0xe5));var _0xa81e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x81ea[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xa81e('0x0'));var util=require(_0xa81e('0x1'));var path=require(_0xa81e('0x2'));var timeout=require(_0xa81e('0x3'));var express=require(_0xa81e('0x4'));var router=express[_0xa81e('0x5')]();var fs_extra=require(_0xa81e('0x6'));var auth=require(_0xa81e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa81e('0x8'));var controller=require(_0xa81e('0x9'));router[_0xa81e('0xa')]('/',auth[_0xa81e('0xb')](),controller[_0xa81e('0xc')]);router['get'](_0xa81e('0xd'),auth[_0xa81e('0xb')](),controller['describe']);router[_0xa81e('0xa')](_0xa81e('0xe'),auth[_0xa81e('0xf')](),controller[_0xa81e('0x10')]);router[_0xa81e('0xa')](_0xa81e('0x11'),auth[_0xa81e('0xf')](),controller[_0xa81e('0x12')]);router[_0xa81e('0xa')](_0xa81e('0x13'),auth[_0xa81e('0xb')](),controller[_0xa81e('0x14')]);router[_0xa81e('0xa')](_0xa81e('0x15'),auth['isChatInteractionAuthorized'](),controller[_0xa81e('0x16')]);router[_0xa81e('0xa')](_0xa81e('0x17'),auth[_0xa81e('0xb')](),controller[_0xa81e('0x18')]);router[_0xa81e('0x19')]('/',auth['isAuthenticated'](),controller[_0xa81e('0x1a')]);router[_0xa81e('0x19')]('/:id/vidaoo',auth[_0xa81e('0xb')](),controller[_0xa81e('0x1b')]);var upload=multer({'storage':multer[_0xa81e('0x1c')]({'destination':function(_0x561a03,_0xcfab18,_0x488cae){_0x488cae(null,path[_0xa81e('0x1d')](config['root'],'server/files/attachments/'));},'filename':function(_0x2a75d7,_0x41221f,_0x138b3f){_0x138b3f(null,util[_0xa81e('0x1e')](_0xa81e('0x1f'),Date[_0xa81e('0x20')](),_0x41221f[_0xa81e('0x21')][_0xa81e('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa81e('0x19')]('/:id/attachment_upload',upload[_0xa81e('0x23')]('file'),controller[_0xa81e('0x24')]);router[_0xa81e('0x19')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xa81e('0x25')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xa81e('0x26')](_0xa81e('0x27'),'chatinteraction:addtags'),controller[_0xa81e('0x28')]);router['put'](_0xa81e('0xe'),auth[_0xa81e('0xb')](),interaction[_0xa81e('0x26')]('chat',_0xa81e('0x29')),controller[_0xa81e('0x2a')]);router['put']('/:id/custom_update',controller[_0xa81e('0x2b')]);router[_0xa81e('0x2c')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xa81e('0x2c')](_0xa81e('0x2d'),controller[_0xa81e('0x2e')]);router[_0xa81e('0x2f')](_0xa81e('0xe'),auth[_0xa81e('0xb')](),interaction[_0xa81e('0x26')](_0xa81e('0x27'),_0xa81e('0x30')),controller[_0xa81e('0x31')]);router[_0xa81e('0x2f')](_0xa81e('0x32'),auth[_0xa81e('0xb')](),controller[_0xa81e('0x33')]);module[_0xa81e('0x34')]=router;
\ No newline at end of file
+var _0xcab2=['./chatInteraction.controller','get','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','originalname','replace','file','attachmentUpload','addMessage','/:id/tags','chat','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','/:id/abandon','close','tracked','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xed2250,_0x4a7602){var _0x24cdd3=function(_0x1a7b13){while(--_0x1a7b13){_0xed2250['push'](_0xed2250['shift']());}};_0x24cdd3(++_0x4a7602);}(_0xcab2,0x171));var _0x2cab=function(_0x401127,_0x23ae22){_0x401127=_0x401127-0x0;var _0x39c2f1=_0xcab2[_0x401127];return _0x39c2f1;};'use strict';var multer=require(_0x2cab('0x0'));var util=require(_0x2cab('0x1'));var path=require('path');var timeout=require(_0x2cab('0x2'));var express=require(_0x2cab('0x3'));var router=express[_0x2cab('0x4')]();var fs_extra=require(_0x2cab('0x5'));var auth=require(_0x2cab('0x6'));var interaction=require(_0x2cab('0x7'));var config=require(_0x2cab('0x8'));var controller=require(_0x2cab('0x9'));router[_0x2cab('0xa')]('/',auth['isAuthenticated'](),controller[_0x2cab('0xb')]);router[_0x2cab('0xa')](_0x2cab('0xc'),auth['isAuthenticated'](),controller[_0x2cab('0xd')]);router[_0x2cab('0xa')]('/:id',auth[_0x2cab('0xe')](),controller[_0x2cab('0xf')]);router[_0x2cab('0xa')](_0x2cab('0x10'),auth[_0x2cab('0xe')](),controller[_0x2cab('0x11')]);router[_0x2cab('0xa')](_0x2cab('0x12'),auth[_0x2cab('0x13')](),controller[_0x2cab('0x14')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x2cab('0x15')]);router[_0x2cab('0xa')](_0x2cab('0x16'),auth[_0x2cab('0x13')](),controller[_0x2cab('0x17')]);router[_0x2cab('0x18')]('/',auth[_0x2cab('0x13')](),controller[_0x2cab('0x19')]);router[_0x2cab('0x18')](_0x2cab('0x1a'),auth[_0x2cab('0x13')](),controller[_0x2cab('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x375113,_0x54e8d2,_0x485b80){_0x485b80(null,path[_0x2cab('0x1c')](config[_0x2cab('0x1d')],_0x2cab('0x1e')));},'filename':function(_0x549d08,_0x41856f,_0x366009){_0x366009(null,util[_0x2cab('0x1f')](_0x2cab('0x20'),Date['now'](),_0x41856f[_0x2cab('0x21')][_0x2cab('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2cab('0x18')]('/:id/attachment_upload',upload['single'](_0x2cab('0x23')),controller[_0x2cab('0x24')]);router[_0x2cab('0x18')](_0x2cab('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x2cab('0x25')]);router[_0x2cab('0x18')](_0x2cab('0x26'),auth['isAuthenticated'](),interaction['tracked'](_0x2cab('0x27'),'chatinteraction:addtags'),controller[_0x2cab('0x28')]);router[_0x2cab('0x29')](_0x2cab('0x2a'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x2cab('0x2b')),controller[_0x2cab('0x2c')]);router['put'](_0x2cab('0x2d'),controller['customUpdate']);router[_0x2cab('0x29')](_0x2cab('0x2e'),auth[_0x2cab('0xe')](),controller['abandon']);router['put']('/:id/close',controller[_0x2cab('0x2f')]);router['delete'](_0x2cab('0x2a'),auth[_0x2cab('0x13')](),interaction[_0x2cab('0x30')](_0x2cab('0x27'),_0x2cab('0x31')),controller[_0x2cab('0x32')]);router[_0x2cab('0x33')](_0x2cab('0x26'),auth['isAuthenticated'](),controller[_0x2cab('0x34')]);module[_0x2cab('0x35')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 2e6e8e2..e4234fd 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 _0x77dd=['TEXT','BOOLEAN','sequelize','exports'];(function(_0x9dff63,_0x1aa9d8){var _0x19778d=function(_0x246bda){while(--_0x246bda){_0x9dff63['push'](_0x9dff63['shift']());}};_0x19778d(++_0x1aa9d8);}(_0x77dd,0x1da));var _0xd77d=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0x77dd[_0x385eb1];return _0x5d40eb;};'use strict';var Sequelize=require(_0xd77d('0x0'));module[_0xd77d('0x1')]={'body':{'type':Sequelize[_0xd77d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd77d('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4c17=['sequelize','TEXT','BOOLEAN','INTEGER'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x4c17,0x18c));var _0x74c1=function(_0x4d7b32,_0x15bf75){_0x4d7b32=_0x4d7b32-0x0;var _0x43a7c8=_0x4c17[_0x4d7b32];return _0x43a7c8;};'use strict';var Sequelize=require(_0x74c1('0x0'));module['exports']={'body':{'type':Sequelize[_0x74c1('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x74c1('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x74c1('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index fc2de05..e44cc09 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 _0xfad2=['reject','save','update','then','end','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','key','map','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','admin','user','fullname','userpic','internal','showWebBar','-online','VoiceQueues','type','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x291604,_0x16366c){var _0x2361d3=function(_0x35da2a){while(--_0x35da2a){_0x291604['push'](_0x291604['shift']());}};_0x2361d3(++_0x16366c);}(_0xfad2,0x126));var _0x2fad=function(_0x965750,_0x5f1f24){_0x965750=_0x965750-0x0;var _0x1429f5=_0xfad2[_0x965750];return _0x1429f5;};'use strict';var emlformat=require(_0x2fad('0x0'));var rimraf=require(_0x2fad('0x1'));var zipdir=require(_0x2fad('0x2'));var jsonpatch=require(_0x2fad('0x3'));var rp=require(_0x2fad('0x4'));var moment=require(_0x2fad('0x5'));var BPromise=require(_0x2fad('0x6'));var Mustache=require(_0x2fad('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2fad('0x8'));var csv=require('to-csv');var ejs=require(_0x2fad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2fad('0xa'));var squel=require(_0x2fad('0xb'));var crypto=require(_0x2fad('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2fad('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2fad('0xe'));var authService=require(_0x2fad('0xf'));var qs=require(_0x2fad('0x10'));var as=require(_0x2fad('0x11'));var hardwareService=require(_0x2fad('0x12'));var logger=require(_0x2fad('0x13'))(_0x2fad('0x14'));var utils=require('../../config/utils');var config=require(_0x2fad('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2fad('0x16'))['db'];config['redis']=_[_0x2fad('0x17')](config['redis'],{'host':_0x2fad('0x18'),'port':0x18eb});var socket=require(_0x2fad('0x19'))(new Redis(config['redis']));require(_0x2fad('0x1a'))['register'](socket);function respondWithStatusCode(_0x5aec00,_0x23fa06){_0x23fa06=_0x23fa06||0xcc;return function(_0x47fe6b){if(_0x47fe6b){return _0x5aec00[_0x2fad('0x1b')](_0x23fa06);}return _0x5aec00['status'](_0x23fa06)['end']();};}function respondWithResult(_0x313280,_0x181e84){_0x181e84=_0x181e84||0xc8;return function(_0x4569e6){if(_0x4569e6){return _0x313280[_0x2fad('0x1c')](_0x181e84)[_0x2fad('0x1d')](_0x4569e6);}};}function respondWithFilteredResult(_0x17e9d9,_0x35181d){return function(_0x151a16){if(_0x151a16){var _0xa85757=typeof _0x35181d[_0x2fad('0x1e')]===_0x2fad('0x1f')&&typeof _0x35181d[_0x2fad('0x20')]===_0x2fad('0x1f');var _0x24ceb1=_0x151a16[_0x2fad('0x21')];var _0x1e4afd=_0xa85757?0x0:_0x35181d[_0x2fad('0x1e')];var _0x599dcb=_0xa85757?_0x151a16[_0x2fad('0x21')]:_0x35181d[_0x2fad('0x1e')]+_0x35181d[_0x2fad('0x20')];var _0x61c6a1;if(_0x599dcb>=_0x24ceb1){_0x599dcb=_0x24ceb1;_0x61c6a1=0xc8;}else{_0x61c6a1=0xce;}_0x17e9d9[_0x2fad('0x1c')](_0x61c6a1);return _0x17e9d9[_0x2fad('0x22')](_0x2fad('0x23'),_0x1e4afd+'-'+_0x599dcb+'/'+_0x24ceb1)[_0x2fad('0x1d')](_0x151a16);}return null;};}function patchUpdates(_0x121a11){return function(_0x22e572){try{jsonpatch['apply'](_0x22e572,_0x121a11,!![]);}catch(_0xf96bcb){return BPromise[_0x2fad('0x24')](_0xf96bcb);}return _0x22e572[_0x2fad('0x25')]();};}function saveUpdates(_0x504b45,_0x46f44f){return function(_0x4948fe){if(_0x4948fe){return _0x4948fe[_0x2fad('0x26')](_0x504b45)[_0x2fad('0x27')](function(_0x376bf1){return _0x376bf1;});}return null;};}function removeEntity(_0x527e25,_0x1a327f){return function(_0xde4d12){if(_0xde4d12){return _0xde4d12['destroy']()[_0x2fad('0x27')](function(){_0x527e25[_0x2fad('0x1c')](0xcc)[_0x2fad('0x28')]();});}};}function handleEntityNotFound(_0x5e0390,_0x49e66d){return function(_0x162316){if(!_0x162316){_0x5e0390[_0x2fad('0x1b')](0x194);}return _0x162316;};}function handleError(_0x3bf2a1,_0x243fd4){_0x243fd4=_0x243fd4||0x1f4;return function(_0x2c7af6){logger[_0x2fad('0x29')](_0x2c7af6[_0x2fad('0x2a')]);if(_0x2c7af6['name']){delete _0x2c7af6[_0x2fad('0x2b')];}_0x3bf2a1[_0x2fad('0x1c')](_0x243fd4)[_0x2fad('0x2c')](_0x2c7af6);};}exports[_0x2fad('0x2d')]=function(_0x545ab1,_0x48f7d9){var _0x161750={},_0x314963={},_0x3f374c={'count':0x0,'rows':[]};var _0x5d0599=_['map'](db[_0x2fad('0x2e')][_0x2fad('0x2f')],function(_0x85600d){return{'name':_0x85600d[_0x2fad('0x30')],'type':_0x85600d['type'][_0x2fad('0x31')]};});_0x314963['model']=_[_0x2fad('0x32')](_0x5d0599,_0x2fad('0x2b'));_0x314963['query']=_[_0x2fad('0x33')](_0x545ab1[_0x2fad('0x34')]);_0x314963[_0x2fad('0x35')]=_['intersection'](_0x314963[_0x2fad('0x36')],_0x314963[_0x2fad('0x34')]);_0x161750[_0x2fad('0x37')]=_['intersection'](_0x314963[_0x2fad('0x36')],qs[_0x2fad('0x38')](_0x545ab1['query'][_0x2fad('0x38')]));_0x161750['attributes']=_0x161750['attributes'][_0x2fad('0x39')]?_0x161750[_0x2fad('0x37')]:_0x314963[_0x2fad('0x36')];if(!_0x545ab1[_0x2fad('0x34')][_0x2fad('0x3a')]('nolimit')){_0x161750[_0x2fad('0x20')]=qs[_0x2fad('0x20')](_0x545ab1[_0x2fad('0x34')]['limit']);_0x161750[_0x2fad('0x1e')]=qs['offset'](_0x545ab1[_0x2fad('0x34')][_0x2fad('0x1e')]);}_0x161750[_0x2fad('0x3b')]=qs['sort'](_0x545ab1[_0x2fad('0x34')][_0x2fad('0x3c')]);_0x161750[_0x2fad('0x3d')]=qs[_0x2fad('0x35')](_['pick'](_0x545ab1[_0x2fad('0x34')],_0x314963[_0x2fad('0x35')]),_0x5d0599);if(_0x545ab1['query']['filter']){_0x161750[_0x2fad('0x3d')]=_[_0x2fad('0x3e')](_0x161750[_0x2fad('0x3d')],{'$or':_['map'](_0x5d0599,function(_0xad6c1b){if(_0xad6c1b['type']!==_0x2fad('0x3f')){var _0x1d4faa={};_0x1d4faa[_0xad6c1b[_0x2fad('0x2b')]]={'$like':'%'+_0x545ab1[_0x2fad('0x34')][_0x2fad('0x40')]+'%'};return _0x1d4faa;}})});}_0x161750=_['merge']({},_0x161750,_0x545ab1[_0x2fad('0x41')]);var _0x59fe61={'where':_0x161750[_0x2fad('0x3d')]};return db[_0x2fad('0x2e')][_0x2fad('0x21')](_0x59fe61)[_0x2fad('0x27')](function(_0x512d74){_0x3f374c[_0x2fad('0x21')]=_0x512d74;if(_0x545ab1[_0x2fad('0x34')][_0x2fad('0x42')]){_0x161750[_0x2fad('0x43')]=[{'all':!![]}];}return db[_0x2fad('0x2e')][_0x2fad('0x44')](_0x161750);})[_0x2fad('0x27')](function(_0x13090f){_0x3f374c[_0x2fad('0x45')]=_0x13090f;return _0x3f374c;})[_0x2fad('0x27')](respondWithFilteredResult(_0x48f7d9,_0x161750))[_0x2fad('0x46')](handleError(_0x48f7d9,null));};exports[_0x2fad('0x47')]=function(_0x53c786,_0x27707d){var _0x26bb87={'raw':!![],'where':{'id':_0x53c786[_0x2fad('0x48')]['id']}},_0x47f9b2={};_0x47f9b2[_0x2fad('0x36')]=_[_0x2fad('0x33')](db[_0x2fad('0x2e')][_0x2fad('0x2f')]);_0x47f9b2['query']=_[_0x2fad('0x33')](_0x53c786[_0x2fad('0x34')]);_0x47f9b2[_0x2fad('0x35')]=_['intersection'](_0x47f9b2[_0x2fad('0x36')],_0x47f9b2[_0x2fad('0x34')]);_0x26bb87[_0x2fad('0x37')]=_[_0x2fad('0x49')](_0x47f9b2[_0x2fad('0x36')],qs[_0x2fad('0x38')](_0x53c786[_0x2fad('0x34')][_0x2fad('0x38')]));_0x26bb87['attributes']=_0x26bb87['attributes']['length']?_0x26bb87[_0x2fad('0x37')]:_0x47f9b2[_0x2fad('0x36')];if(_0x53c786[_0x2fad('0x34')][_0x2fad('0x42')]){_0x26bb87[_0x2fad('0x43')]=[{'all':!![]}];}_0x26bb87=_['merge']({},_0x26bb87,_0x53c786[_0x2fad('0x41')]);return db['ChatInternalMessage'][_0x2fad('0x4a')](_0x26bb87)['then'](handleEntityNotFound(_0x27707d,null))[_0x2fad('0x27')](respondWithResult(_0x27707d,null))[_0x2fad('0x46')](handleError(_0x27707d,null));};exports[_0x2fad('0x4b')]=function(_0x334d8a,_0x16d609){return db[_0x2fad('0x2e')][_0x2fad('0x4b')](_0x334d8a[_0x2fad('0x4c')],{})[_0x2fad('0x27')](respondWithResult(_0x16d609,0xc9))['catch'](handleError(_0x16d609,null));};exports[_0x2fad('0x26')]=function(_0x38bc6f,_0x23fcef){if(_0x38bc6f[_0x2fad('0x4c')]['id']){delete _0x38bc6f['body']['id'];}return db[_0x2fad('0x2e')][_0x2fad('0x4a')]({'where':{'id':_0x38bc6f[_0x2fad('0x48')]['id']}})[_0x2fad('0x27')](handleEntityNotFound(_0x23fcef,null))['then'](saveUpdates(_0x38bc6f[_0x2fad('0x4c')],null))[_0x2fad('0x27')](respondWithResult(_0x23fcef,null))[_0x2fad('0x46')](handleError(_0x23fcef,null));};exports[_0x2fad('0x4d')]=function(_0x222851,_0x4a3986){return db['ChatInternalMessage']['find']({'where':{'id':_0x222851['params']['id']}})[_0x2fad('0x27')](handleEntityNotFound(_0x4a3986,null))[_0x2fad('0x27')](removeEntity(_0x4a3986,null))[_0x2fad('0x46')](handleError(_0x4a3986,null));};exports['describe']=function(_0x5ee262,_0x3e8365){return db[_0x2fad('0x2e')][_0x2fad('0x4e')]()[_0x2fad('0x27')](respondWithResult(_0x3e8365,null))[_0x2fad('0x46')](handleError(_0x3e8365,null));};function wrapUser(_0x37c0a7){return function(_0x1bad53){var _0x1c8450=_0x37c0a7[_0x2fad('0x4f')]({'plain':!![]});_0x1c8450[_0x2fad('0x50')]=[];if(_0x1bad53){_0x1c8450[_0x2fad('0x51')]=_0x1bad53[_0x2fad('0x52')];_0x1c8450[_0x2fad('0x53')]=_0x1bad53;}else{_0x1c8450[_0x2fad('0x51')]=moment(0x0)[_0x2fad('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c8450[_0x2fad('0x53')]={};}return _0x1c8450;};}exports[_0x2fad('0x55')]=function(_0x4d5997,_0x40bcb8,_0x1cec35){var _0x3fd766=[];return db[_0x2fad('0x56')][_0x2fad('0x44')]({'where':{'role':['agent',_0x2fad('0x57'),_0x2fad('0x58')]},'attributes':['id',_0x2fad('0x59'),_0x2fad('0x2b'),'role',_0x2fad('0x5a'),_0x2fad('0x5b'),'online','lastLoginAt','allowmessenger',_0x2fad('0x5c')],'order':qs['sort'](_0x2fad('0x5d')),'include':[{'model':db['VoiceQueue'],'as':_0x2fad('0x5e'),'attributes':['id','name',_0x2fad('0x5f')],'through':{'attributes':[]}}]})[_0x2fad('0x27')](function(_0x5d06a1){if(_0x5d06a1){var _0x895f0=_0x4d5997[_0x2fad('0x58')][_0x2fad('0x4f')]({'plain':!![]});if(!_0x895f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x895f0[_0x2fad('0x60')]==='user'){return db[_0x2fad('0x61')][_0x2fad('0x4a')]({'where':{'name':'Agents','userProfileId':_0x895f0[_0x2fad('0x62')]},'raw':!![]})[_0x2fad('0x27')](function(_0x4611ad){if(_0x4611ad){if(_0x4611ad[_0x2fad('0x63')]===0x0){return db[_0x2fad('0x64')][_0x2fad('0x44')]({'where':{'sectionId':_0x4611ad['id']},'raw':!![]})[_0x2fad('0x27')](function(_0x5ea110){var _0x563f22=[];if(_[_0x2fad('0x65')](_0x5ea110)){_0x563f22=_[_0x2fad('0x40')](_0x5d06a1,function(_0x165c3a){if(_0x165c3a[_0x2fad('0x60')]!=='agent'){return _0x165c3a;}});return _0x563f22;}else{for(var _0x31a523=0x0;_0x31a523<_0x5d06a1[_0x2fad('0x39')];_0x31a523++){var _0x1e4ce8=_0x5d06a1[_0x31a523];if(_0x1e4ce8['role']===_0x2fad('0x66')){var _0x16364f=_['find'](_0x5ea110,function(_0x2b7b92){return _0x2b7b92[_0x2fad('0x67')]===_0x1e4ce8['id'];});if(_0x16364f)_0x563f22[_0x2fad('0x68')](_0x1e4ce8);}else{_0x563f22[_0x2fad('0x68')](_0x1e4ce8);}}return _0x563f22;}});}else{return _0x5d06a1;}}else{var _0x301234=_[_0x2fad('0x40')](_0x5d06a1,function(_0x10948d){if(_0x10948d['role']!=='agent'){return _0x10948d;}});return _0x301234;}});}else{return _0x5d06a1;}}})[_0x2fad('0x27')](function(_0x5c9eeb){var _0x18d95f=[];if(_0x5c9eeb){_0x3fd766=_0x5c9eeb;for(var _0x1b4751=0x0;_0x1b4751<_0x5c9eeb[_0x2fad('0x39')];_0x1b4751+=0x1){_0x3fd766[_0x1b4751][_0x2fad('0x50')]=[];_0x18d95f[_0x2fad('0x68')](db[_0x2fad('0x2e')]['find']({'where':{'FromId':[_0x4d5997[_0x2fad('0x58')]['id'],_0x5c9eeb[_0x1b4751]['id']],'ToId':[_0x4d5997[_0x2fad('0x58')]['id'],_0x5c9eeb[_0x1b4751]['id']],'ChatGroupId':null},'attributes':['id',_0x2fad('0x52'),_0x2fad('0x69'),_0x2fad('0x6a'),_0x2fad('0x6b'),_0x2fad('0x4c')],'order':qs[_0x2fad('0x3c')](_0x2fad('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5c9eeb[_0x1b4751])));}return BPromise[_0x2fad('0x6d')](_0x18d95f);}return[];})[_0x2fad('0x27')](function(_0x39ea21){return{'rows':_0x39ea21,'count':_0x39ea21[_0x2fad('0x39')]};})[_0x2fad('0x27')](respondWithResult(_0x40bcb8,null))['catch'](handleError(_0x40bcb8,null));};
\ No newline at end of file
+var _0xd70b=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','findAll','rows','catch','show','params','intersection','include','options','create','body','find','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','role','userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','-createdAt','all','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x3bc5af,_0x7aa75a){var _0x4fe7ce=function(_0x29245d){while(--_0x29245d){_0x3bc5af['push'](_0x3bc5af['shift']());}};_0x4fe7ce(++_0x7aa75a);}(_0xd70b,0x142));var _0xbd70=function(_0x1ad9b4,_0x5df9ed){_0x1ad9b4=_0x1ad9b4-0x0;var _0xbbee74=_0xd70b[_0x1ad9b4];return _0xbbee74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd70('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd70('0x1'));var rp=require(_0xbd70('0x2'));var moment=require(_0xbd70('0x3'));var BPromise=require(_0xbd70('0x4'));var Mustache=require(_0xbd70('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbd70('0x6'));var csv=require(_0xbd70('0x7'));var ejs=require(_0xbd70('0x8'));var fs=require('fs');var fs_extra=require(_0xbd70('0x9'));var _=require(_0xbd70('0xa'));var squel=require(_0xbd70('0xb'));var crypto=require(_0xbd70('0xc'));var jsforce=require(_0xbd70('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbd70('0xe'));var Papa=require(_0xbd70('0xf'));var Redis=require(_0xbd70('0x10'));var authService=require(_0xbd70('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbd70('0x12'));var hardwareService=require(_0xbd70('0x13'));var logger=require(_0xbd70('0x14'))('api');var utils=require(_0xbd70('0x15'));var config=require(_0xbd70('0x16'));var licenseUtil=require(_0xbd70('0x17'));var db=require(_0xbd70('0x18'))['db'];config[_0xbd70('0x19')]=_[_0xbd70('0x1a')](config[_0xbd70('0x19')],{'host':_0xbd70('0x1b'),'port':0x18eb});var socket=require(_0xbd70('0x1c'))(new Redis(config[_0xbd70('0x19')]));require(_0xbd70('0x1d'))[_0xbd70('0x1e')](socket);function respondWithStatusCode(_0x22fb80,_0x547d4e){_0x547d4e=_0x547d4e||0xcc;return function(_0x4de051){if(_0x4de051){return _0x22fb80[_0xbd70('0x1f')](_0x547d4e);}return _0x22fb80[_0xbd70('0x20')](_0x547d4e)[_0xbd70('0x21')]();};}function respondWithResult(_0x29359c,_0x25d798){_0x25d798=_0x25d798||0xc8;return function(_0x161ff7){if(_0x161ff7){return _0x29359c['status'](_0x25d798)['json'](_0x161ff7);}};}function respondWithFilteredResult(_0x9e3da0,_0x41381c){return function(_0x303ade){if(_0x303ade){var _0x575e6f=typeof _0x41381c[_0xbd70('0x22')]===_0xbd70('0x23')&&typeof _0x41381c[_0xbd70('0x24')]==='undefined';var _0x3a5cef=_0x303ade['count'];var _0x5d7684=_0x575e6f?0x0:_0x41381c[_0xbd70('0x22')];var _0x5d965c=_0x575e6f?_0x303ade[_0xbd70('0x25')]:_0x41381c[_0xbd70('0x22')]+_0x41381c[_0xbd70('0x24')];var _0x356be4;if(_0x5d965c>=_0x3a5cef){_0x5d965c=_0x3a5cef;_0x356be4=0xc8;}else{_0x356be4=0xce;}_0x9e3da0[_0xbd70('0x20')](_0x356be4);return _0x9e3da0[_0xbd70('0x26')](_0xbd70('0x27'),_0x5d7684+'-'+_0x5d965c+'/'+_0x3a5cef)[_0xbd70('0x28')](_0x303ade);}return null;};}function patchUpdates(_0x2f4ed0){return function(_0x29c1e4){try{jsonpatch[_0xbd70('0x29')](_0x29c1e4,_0x2f4ed0,!![]);}catch(_0x353731){return BPromise[_0xbd70('0x2a')](_0x353731);}return _0x29c1e4[_0xbd70('0x2b')]();};}function saveUpdates(_0x3102e6,_0x4b6f6b){return function(_0x2e1bf0){if(_0x2e1bf0){return _0x2e1bf0[_0xbd70('0x2c')](_0x3102e6)['then'](function(_0x3d6d19){return _0x3d6d19;});}return null;};}function removeEntity(_0x4a5472,_0x55a9ad){return function(_0x59b7a5){if(_0x59b7a5){return _0x59b7a5[_0xbd70('0x2d')]()['then'](function(){_0x4a5472[_0xbd70('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e79d,_0x190737){return function(_0x506204){if(!_0x506204){_0x55e79d[_0xbd70('0x1f')](0x194);}return _0x506204;};}function handleError(_0x2b9412,_0x4814b0){_0x4814b0=_0x4814b0||0x1f4;return function(_0x5ed002){logger[_0xbd70('0x2e')](_0x5ed002[_0xbd70('0x2f')]);if(_0x5ed002[_0xbd70('0x30')]){delete _0x5ed002['name'];}_0x2b9412['status'](_0x4814b0)[_0xbd70('0x31')](_0x5ed002);};}exports[_0xbd70('0x32')]=function(_0x2e45fc,_0x5d185b){var _0x50b66c={},_0x4c23f1={},_0x43cba7={'count':0x0,'rows':[]};var _0x1a334a=_[_0xbd70('0x33')](db[_0xbd70('0x34')][_0xbd70('0x35')],function(_0x25d4ff){return{'name':_0x25d4ff['fieldName'],'type':_0x25d4ff[_0xbd70('0x36')][_0xbd70('0x37')]};});_0x4c23f1[_0xbd70('0x38')]=_[_0xbd70('0x33')](_0x1a334a,_0xbd70('0x30'));_0x4c23f1[_0xbd70('0x39')]=_[_0xbd70('0x3a')](_0x2e45fc[_0xbd70('0x39')]);_0x4c23f1[_0xbd70('0x3b')]=_['intersection'](_0x4c23f1[_0xbd70('0x38')],_0x4c23f1['query']);_0x50b66c[_0xbd70('0x3c')]=_['intersection'](_0x4c23f1[_0xbd70('0x38')],qs[_0xbd70('0x3d')](_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x3d')]));_0x50b66c[_0xbd70('0x3c')]=_0x50b66c[_0xbd70('0x3c')][_0xbd70('0x3e')]?_0x50b66c[_0xbd70('0x3c')]:_0x4c23f1['model'];if(!_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x3f')]('nolimit')){_0x50b66c[_0xbd70('0x24')]=qs[_0xbd70('0x24')](_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x24')]);_0x50b66c[_0xbd70('0x22')]=qs[_0xbd70('0x22')](_0x2e45fc['query'][_0xbd70('0x22')]);}_0x50b66c[_0xbd70('0x40')]=qs[_0xbd70('0x41')](_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x41')]);_0x50b66c[_0xbd70('0x42')]=qs[_0xbd70('0x3b')](_[_0xbd70('0x43')](_0x2e45fc[_0xbd70('0x39')],_0x4c23f1[_0xbd70('0x3b')]),_0x1a334a);if(_0x2e45fc[_0xbd70('0x39')]['filter']){_0x50b66c[_0xbd70('0x42')]=_[_0xbd70('0x44')](_0x50b66c['where'],{'$or':_[_0xbd70('0x33')](_0x1a334a,function(_0x2320f5){if(_0x2320f5['type']!==_0xbd70('0x45')){var _0x5ce1c5={};_0x5ce1c5[_0x2320f5[_0xbd70('0x30')]]={'$like':'%'+_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x46')]+'%'};return _0x5ce1c5;}})});}_0x50b66c=_[_0xbd70('0x44')]({},_0x50b66c,_0x2e45fc['options']);var _0x4da749={'where':_0x50b66c[_0xbd70('0x42')]};return db['ChatInternalMessage'][_0xbd70('0x25')](_0x4da749)[_0xbd70('0x47')](function(_0x389c0f){_0x43cba7['count']=_0x389c0f;if(_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x48')]){_0x50b66c['include']=[{'all':!![]}];}return db[_0xbd70('0x34')][_0xbd70('0x49')](_0x50b66c);})[_0xbd70('0x47')](function(_0x3829dc){_0x43cba7[_0xbd70('0x4a')]=_0x3829dc;return _0x43cba7;})[_0xbd70('0x47')](respondWithFilteredResult(_0x5d185b,_0x50b66c))[_0xbd70('0x4b')](handleError(_0x5d185b,null));};exports[_0xbd70('0x4c')]=function(_0x42a951,_0x6f7f2e){var _0x59cc10={'raw':!![],'where':{'id':_0x42a951[_0xbd70('0x4d')]['id']}},_0x2c2c93={};_0x2c2c93[_0xbd70('0x38')]=_['keys'](db[_0xbd70('0x34')][_0xbd70('0x35')]);_0x2c2c93['query']=_[_0xbd70('0x3a')](_0x42a951['query']);_0x2c2c93[_0xbd70('0x3b')]=_[_0xbd70('0x4e')](_0x2c2c93[_0xbd70('0x38')],_0x2c2c93[_0xbd70('0x39')]);_0x59cc10[_0xbd70('0x3c')]=_[_0xbd70('0x4e')](_0x2c2c93['model'],qs[_0xbd70('0x3d')](_0x42a951[_0xbd70('0x39')][_0xbd70('0x3d')]));_0x59cc10[_0xbd70('0x3c')]=_0x59cc10[_0xbd70('0x3c')][_0xbd70('0x3e')]?_0x59cc10['attributes']:_0x2c2c93[_0xbd70('0x38')];if(_0x42a951[_0xbd70('0x39')][_0xbd70('0x48')]){_0x59cc10[_0xbd70('0x4f')]=[{'all':!![]}];}_0x59cc10=_[_0xbd70('0x44')]({},_0x59cc10,_0x42a951[_0xbd70('0x50')]);return db['ChatInternalMessage']['find'](_0x59cc10)[_0xbd70('0x47')](handleEntityNotFound(_0x6f7f2e,null))[_0xbd70('0x47')](respondWithResult(_0x6f7f2e,null))[_0xbd70('0x4b')](handleError(_0x6f7f2e,null));};exports[_0xbd70('0x51')]=function(_0x1bf660,_0x3121f5){return db[_0xbd70('0x34')][_0xbd70('0x51')](_0x1bf660[_0xbd70('0x52')],{})[_0xbd70('0x47')](respondWithResult(_0x3121f5,0xc9))[_0xbd70('0x4b')](handleError(_0x3121f5,null));};exports[_0xbd70('0x2c')]=function(_0x29ec58,_0x5eaad6){if(_0x29ec58['body']['id']){delete _0x29ec58[_0xbd70('0x52')]['id'];}return db[_0xbd70('0x34')][_0xbd70('0x53')]({'where':{'id':_0x29ec58[_0xbd70('0x4d')]['id']}})[_0xbd70('0x47')](handleEntityNotFound(_0x5eaad6,null))[_0xbd70('0x47')](saveUpdates(_0x29ec58[_0xbd70('0x52')],null))['then'](respondWithResult(_0x5eaad6,null))[_0xbd70('0x4b')](handleError(_0x5eaad6,null));};exports[_0xbd70('0x2d')]=function(_0x3c3e2a,_0x1b2689){return db[_0xbd70('0x34')]['find']({'where':{'id':_0x3c3e2a[_0xbd70('0x4d')]['id']}})[_0xbd70('0x47')](handleEntityNotFound(_0x1b2689,null))[_0xbd70('0x47')](removeEntity(_0x1b2689,null))[_0xbd70('0x4b')](handleError(_0x1b2689,null));};exports[_0xbd70('0x54')]=function(_0x511d20,_0x543e4a){return db[_0xbd70('0x34')][_0xbd70('0x54')]()[_0xbd70('0x47')](respondWithResult(_0x543e4a,null))[_0xbd70('0x4b')](handleError(_0x543e4a,null));};function wrapUser(_0x4e93c4){return function(_0x45079d){var _0x2183b9=_0x4e93c4[_0xbd70('0x55')]({'plain':!![]});_0x2183b9[_0xbd70('0x56')]=[];if(_0x45079d){_0x2183b9[_0xbd70('0x57')]=_0x45079d[_0xbd70('0x58')];_0x2183b9['lastMessage']=_0x45079d;}else{_0x2183b9[_0xbd70('0x57')]=moment(0x0)[_0xbd70('0x59')](_0xbd70('0x5a'));_0x2183b9[_0xbd70('0x5b')]={};}return _0x2183b9;};}exports[_0xbd70('0x5c')]=function(_0x58fe9f,_0x19d4af,_0x30134b){var _0x40c254=[];return db[_0xbd70('0x5d')][_0xbd70('0x49')]({'where':{'role':[_0xbd70('0x5e'),_0xbd70('0x5f'),_0xbd70('0x60')]},'attributes':['id','fullname',_0xbd70('0x30'),_0xbd70('0x61'),_0xbd70('0x62'),_0xbd70('0x63'),_0xbd70('0x64'),'lastLoginAt','allowmessenger',_0xbd70('0x65')],'order':qs[_0xbd70('0x41')](_0xbd70('0x66')),'include':[{'model':db[_0xbd70('0x67')],'as':_0xbd70('0x68'),'attributes':['id','name',_0xbd70('0x36')],'through':{'attributes':[]}}]})[_0xbd70('0x47')](function(_0x70fcc3){if(_0x70fcc3){var _0x578841=_0x58fe9f['user'][_0xbd70('0x55')]({'plain':!![]});if(!_0x578841)throw new Error(_0xbd70('0x69'));if(_0x578841['role']===_0xbd70('0x60')){return db['UserProfileSection'][_0xbd70('0x53')]({'where':{'name':_0xbd70('0x6a'),'userProfileId':_0x578841[_0xbd70('0x6b')]},'raw':!![]})[_0xbd70('0x47')](function(_0x4a724d){if(_0x4a724d){if(_0x4a724d[_0xbd70('0x6c')]===0x0){return db[_0xbd70('0x6d')]['findAll']({'where':{'sectionId':_0x4a724d['id']},'raw':!![]})[_0xbd70('0x47')](function(_0x5d9026){var _0xab5059=[];if(_[_0xbd70('0x6e')](_0x5d9026)){_0xab5059=_[_0xbd70('0x46')](_0x70fcc3,function(_0x399519){if(_0x399519[_0xbd70('0x61')]!==_0xbd70('0x5e')){return _0x399519;}});return _0xab5059;}else{for(var _0x201df5=0x0;_0x201df5<_0x70fcc3[_0xbd70('0x3e')];_0x201df5++){var _0x4a64c8=_0x70fcc3[_0x201df5];if(_0x4a64c8[_0xbd70('0x61')]===_0xbd70('0x5e')){var _0x5cd06d=_['find'](_0x5d9026,function(_0x52a061){return _0x52a061['resourceId']===_0x4a64c8['id'];});if(_0x5cd06d)_0xab5059[_0xbd70('0x6f')](_0x4a64c8);}else{_0xab5059[_0xbd70('0x6f')](_0x4a64c8);}}return _0xab5059;}});}else{return _0x70fcc3;}}else{var _0x3e45d4=_['filter'](_0x70fcc3,function(_0x4ede6f){if(_0x4ede6f[_0xbd70('0x61')]!==_0xbd70('0x5e')){return _0x4ede6f;}});return _0x3e45d4;}});}else{return _0x70fcc3;}}})[_0xbd70('0x47')](function(_0x3ecde4){var _0x5ca682=[];if(_0x3ecde4){_0x40c254=_0x3ecde4;for(var _0x570941=0x0;_0x570941<_0x3ecde4['length'];_0x570941+=0x1){_0x40c254[_0x570941][_0xbd70('0x56')]=[];_0x5ca682[_0xbd70('0x6f')](db[_0xbd70('0x34')][_0xbd70('0x53')]({'where':{'FromId':[_0x58fe9f[_0xbd70('0x60')]['id'],_0x3ecde4[_0x570941]['id']],'ToId':[_0x58fe9f[_0xbd70('0x60')]['id'],_0x3ecde4[_0x570941]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xbd70('0x70'),_0xbd70('0x71'),'read',_0xbd70('0x52')],'order':qs[_0xbd70('0x41')](_0xbd70('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbd70('0x47')](wrapUser(_0x3ecde4[_0x570941])));}return BPromise[_0xbd70('0x73')](_0x5ca682);}return[];})[_0xbd70('0x47')](function(_0x4c0e0f){return{'rows':_0x4c0e0f,'count':_0x4c0e0f[_0xbd70('0x3e')]};})['then'](respondWithResult(_0x19d4af,null))[_0xbd70('0x4b')](handleError(_0x19d4af,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index d7dc8fb..f7157ae 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 _0x3d30=['ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x3d30,0xf1));var _0x03d3=function(_0x30a62a,_0x31c430){_0x30a62a=_0x30a62a-0x0;var _0x18db09=_0x3d30[_0x30a62a];return _0x18db09;};'use strict';var EventEmitter=require(_0x03d3('0x0'));var ChatInternalMessage=require(_0x03d3('0x1'))['db'][_0x03d3('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x03d3('0x3')](0x0);var events={'afterCreate':_0x03d3('0x4'),'afterUpdate':'update','afterDestroy':_0x03d3('0x5')};function emitEvent(_0x1b198c){return function(_0xd03d5e,_0x55c135,_0x437df){ChatInternalMessageEvents[_0x03d3('0x6')](_0x1b198c+':'+_0xd03d5e['id'],_0xd03d5e);ChatInternalMessageEvents[_0x03d3('0x6')](_0x1b198c,_0xd03d5e);_0x437df(null);};}for(var e in events){if(events[_0x03d3('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x03d3('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x9cf9=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x9cf9,0x6d));var _0x99cf=function(_0x4520b0,_0x212a36){_0x4520b0=_0x4520b0-0x0;var _0x53dc0f=_0x9cf9[_0x4520b0];return _0x53dc0f;};'use strict';var EventEmitter=require(_0x99cf('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x99cf('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x99cf('0x2')](0x0);var events={'afterCreate':_0x99cf('0x3'),'afterUpdate':_0x99cf('0x4'),'afterDestroy':_0x99cf('0x5')};function emitEvent(_0x445488){return function(_0x1683f8,_0x170c8d,_0x4192d9){ChatInternalMessageEvents[_0x99cf('0x6')](_0x445488+':'+_0x1683f8['id'],_0x1683f8);ChatInternalMessageEvents[_0x99cf('0x6')](_0x445488,_0x1683f8);_0x4192d9(null);};}for(var e in events){if(events[_0x99cf('0x7')](e)){var event=events[e];ChatInternalMessage[_0x99cf('0x8')](e,emitEvent(event));}}module[_0x99cf('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 1cd9e8d..f83b5b0 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 _0xcbc5=['bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','api','moment'];(function(_0x2cee1c,_0x676f2b){var _0x1b206b=function(_0x7c2895){while(--_0x7c2895){_0x2cee1c['push'](_0x2cee1c['shift']());}};_0x1b206b(++_0x676f2b);}(_0xcbc5,0x184));var _0x5cbc=function(_0x1bce4a,_0x4e33a9){_0x1bce4a=_0x1bce4a-0x0;var _0x5d414d=_0xcbc5[_0x1bce4a];return _0x5d414d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5cbc('0x0'));var moment=require(_0x5cbc('0x1'));var BPromise=require(_0x5cbc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cbc('0x3'));var rimraf=require(_0x5cbc('0x4'));var config=require(_0x5cbc('0x5'));var attributes=require(_0x5cbc('0x6'));module['exports']=function(_0x210471,_0x54fae7){return _0x210471['define'](_0x5cbc('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5cbc('0x8'),'collate':_0x5cbc('0x9')});};
\ No newline at end of file
+var _0x2c57=['path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x477b31,_0x5a343){var _0x2317fe=function(_0x2545c1){while(--_0x2545c1){_0x477b31['push'](_0x477b31['shift']());}};_0x2317fe(++_0x5a343);}(_0x2c57,0x173));var _0x72c5=function(_0x497ee4,_0x2f20fe){_0x497ee4=_0x497ee4-0x0;var _0x113273=_0x2c57[_0x497ee4];return _0x113273;};'use strict';var _=require(_0x72c5('0x0'));var util=require(_0x72c5('0x1'));var logger=require(_0x72c5('0x2'))(_0x72c5('0x3'));var moment=require(_0x72c5('0x4'));var BPromise=require(_0x72c5('0x5'));var rp=require(_0x72c5('0x6'));var fs=require('fs');var path=require(_0x72c5('0x7'));var rimraf=require(_0x72c5('0x8'));var config=require(_0x72c5('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0x72c5('0xa')]=function(_0x2edcb8,_0x679d01){return _0x2edcb8[_0x72c5('0xb')](_0x72c5('0xc'),attributes,{'tableName':_0x72c5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 8f15387..d480500 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 _0x8873=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4c64f0,_0x32b12a){var _0x30ca61=function(_0x19d2f5){while(--_0x19d2f5){_0x4c64f0['push'](_0x4c64f0['shift']());}};_0x30ca61(++_0x32b12a);}(_0x8873,0xad));var _0x3887=function(_0x3789b9,_0x5c2f00){_0x3789b9=_0x3789b9-0x0;var _0x4d020d=_0x8873[_0x3789b9];return _0x4d020d;};'use strict';var _=require(_0x3887('0x0'));var util=require(_0x3887('0x1'));var moment=require(_0x3887('0x2'));var BPromise=require('bluebird');var rs=require(_0x3887('0x3'));var fs=require('fs');var Redis=require(_0x3887('0x4'));var db=require(_0x3887('0x5'))['db'];var utils=require(_0x3887('0x6'));var logger=require('../../config/logger')(_0x3887('0x7'));var config=require(_0x3887('0x8'));var jayson=require(_0x3887('0x9'));var client=jayson[_0x3887('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3887('0xb')](config['redis'],{'host':_0x3887('0xc'),'port':0x18eb});var socket=require(_0x3887('0xd'))(new Redis(config[_0x3887('0xe')]));require(_0x3887('0xf'))[_0x3887('0x10')](socket);function respondWithRpcPromise(_0x508188,_0x2c2d42,_0x3aa6fd){return new BPromise(function(_0x281a40,_0x1d251d){return client[_0x3887('0x11')](_0x508188,_0x3aa6fd)[_0x3887('0x12')](function(_0x5432e4){logger['info'](_0x3887('0x13'),_0x2c2d42,_0x3887('0x14'));logger[_0x3887('0x15')](_0x3887('0x16'),_0x2c2d42,_0x3887('0x14'),JSON[_0x3887('0x17')](_0x5432e4));if(_0x5432e4[_0x3887('0x18')]){if(_0x5432e4['error'][_0x3887('0x19')]===0x1f4){logger['error'](_0x3887('0x13'),_0x2c2d42,_0x5432e4[_0x3887('0x18')][_0x3887('0x1a')]);return _0x1d251d(_0x5432e4['error'][_0x3887('0x1a')]);}logger['error'](_0x3887('0x13'),_0x2c2d42,_0x5432e4[_0x3887('0x18')][_0x3887('0x1a')]);return _0x281a40(_0x5432e4[_0x3887('0x18')]['message']);}else{logger['info'](_0x3887('0x13'),_0x2c2d42,_0x3887('0x14'));_0x281a40(_0x5432e4[_0x3887('0x1b')][_0x3887('0x1a')]);}})[_0x3887('0x1c')](function(_0x1e2093){logger[_0x3887('0x18')](_0x3887('0x13'),_0x2c2d42,_0x1e2093);_0x1d251d(_0x1e2093);});});}
\ No newline at end of file
+var _0x625b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x13125b,_0x169043){var _0x1c3310=function(_0x5ddad2){while(--_0x5ddad2){_0x13125b['push'](_0x13125b['shift']());}};_0x1c3310(++_0x169043);}(_0x625b,0x121));var _0xb625=function(_0x561da8,_0x4c4ab6){_0x561da8=_0x561da8-0x0;var _0x2079d0=_0x625b[_0x561da8];return _0x2079d0;};'use strict';var _=require(_0xb625('0x0'));var util=require(_0xb625('0x1'));var moment=require(_0xb625('0x2'));var BPromise=require(_0xb625('0x3'));var rs=require(_0xb625('0x4'));var fs=require('fs');var Redis=require(_0xb625('0x5'));var db=require(_0xb625('0x6'))['db'];var utils=require(_0xb625('0x7'));var logger=require(_0xb625('0x8'))(_0xb625('0x9'));var config=require(_0xb625('0xa'));var jayson=require(_0xb625('0xb'));var client=jayson[_0xb625('0xc')][_0xb625('0xd')]({'port':0x232a});config[_0xb625('0xe')]=_[_0xb625('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb625('0xe')]));require(_0xb625('0x10'))[_0xb625('0x11')](socket);function respondWithRpcPromise(_0x29bb83,_0x5dcda3,_0x5aff53){return new BPromise(function(_0x426963,_0x61719){return client[_0xb625('0x12')](_0x29bb83,_0x5aff53)[_0xb625('0x13')](function(_0x394830){logger[_0xb625('0x14')](_0xb625('0x15'),_0x5dcda3,'request\x20sent');logger['debug'](_0xb625('0x16'),_0x5dcda3,_0xb625('0x17'),JSON[_0xb625('0x18')](_0x394830));if(_0x394830[_0xb625('0x19')]){if(_0x394830['error']['code']===0x1f4){logger[_0xb625('0x19')](_0xb625('0x15'),_0x5dcda3,_0x394830['error'][_0xb625('0x1a')]);return _0x61719(_0x394830['error']['message']);}logger['error'](_0xb625('0x15'),_0x5dcda3,_0x394830[_0xb625('0x19')][_0xb625('0x1a')]);return _0x426963(_0x394830[_0xb625('0x19')][_0xb625('0x1a')]);}else{logger['info'](_0xb625('0x15'),_0x5dcda3,'request\x20sent');_0x426963(_0x394830['result'][_0xb625('0x1a')]);}})['catch'](function(_0x5b2b84){logger[_0xb625('0x19')](_0xb625('0x15'),_0x5dcda3,_0x5b2b84);_0x61719(_0x5b2b84);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 69302f4..24dcbc0 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 _0x28c9=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','removeListener','length'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x28c9,0xa9));var _0x928c=function(_0x47d4df,_0x437fa4){_0x47d4df=_0x47d4df-0x0;var _0x5e0ec7=_0x28c9[_0x47d4df];return _0x5e0ec7;};'use strict';var ChatInternalMessageEvents=require(_0x928c('0x0'));var events=[_0x928c('0x1'),_0x928c('0x2'),_0x928c('0x3')];function createListener(_0x8f3fc0,_0x3f62cc){return function(_0x3e0fd4){_0x3f62cc['emit'](_0x8f3fc0,_0x3e0fd4);};}function removeListener(_0x599e5a,_0xf2c0ba){return function(){ChatInternalMessageEvents[_0x928c('0x4')](_0x599e5a,_0xf2c0ba);};}exports['register']=function(_0x3fdedd){for(var _0x5ca0b9=0x0,_0xb58678=events[_0x928c('0x5')];_0x5ca0b9<_0xb58678;_0x5ca0b9++){var _0x2dc0d9=events[_0x5ca0b9];var _0x4b6350=createListener(_0x928c('0x6')+_0x2dc0d9,_0x3fdedd);ChatInternalMessageEvents['on'](_0x2dc0d9,_0x4b6350);}};
\ No newline at end of file
+var _0x417c=['update','emit','register','chatInternalMessage:','remove'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x417c,0x199));var _0xc417=function(_0x37b1dd,_0x7bd2cd){_0x37b1dd=_0x37b1dd-0x0;var _0x9641c=_0x417c[_0x37b1dd];return _0x9641c;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xc417('0x0'),_0xc417('0x1')];function createListener(_0xcd9d60,_0x336e57){return function(_0x545e05){_0x336e57[_0xc417('0x2')](_0xcd9d60,_0x545e05);};}function removeListener(_0x17de54,_0x40b070){return function(){ChatInternalMessageEvents['removeListener'](_0x17de54,_0x40b070);};}exports[_0xc417('0x3')]=function(_0x1f1e78){for(var _0x313bac=0x0,_0x59d4f=events['length'];_0x313bac<_0x59d4f;_0x313bac++){var _0x2d0d70=events[_0x313bac];var _0xa9fc35=createListener(_0xc417('0x4')+_0x2d0d70,_0x1f1e78);ChatInternalMessageEvents['on'](_0x2d0d70,_0xa9fc35);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index e450ebc..b2651e4 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 _0xaebf=['describe','getUsers','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x549b29,_0x2e2b00){var _0x2b813f=function(_0x43234f){while(--_0x43234f){_0x549b29['push'](_0x549b29['shift']());}};_0x2b813f(++_0x2e2b00);}(_0xaebf,0x1bf));var _0xfaeb=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xaebf[_0x29d915];return _0x160f86;};'use strict';var multer=require(_0xfaeb('0x0'));var util=require(_0xfaeb('0x1'));var path=require(_0xfaeb('0x2'));var timeout=require(_0xfaeb('0x3'));var express=require(_0xfaeb('0x4'));var router=express[_0xfaeb('0x5')]();var fs_extra=require(_0xfaeb('0x6'));var auth=require(_0xfaeb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfaeb('0x8'));var controller=require('./chatInternalMessage.controller');router[_0xfaeb('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaeb('0xa')]);router['get'](_0xfaeb('0xb'),auth[_0xfaeb('0xc')](),controller[_0xfaeb('0xd')]);router[_0xfaeb('0x9')]('/users',auth[_0xfaeb('0xc')](),controller[_0xfaeb('0xe')]);router[_0xfaeb('0x9')](_0xfaeb('0xf'),auth['isAuthenticated'](),controller[_0xfaeb('0x10')]);router['post']('/',auth[_0xfaeb('0xc')](),controller[_0xfaeb('0x11')]);router[_0xfaeb('0x12')](_0xfaeb('0xf'),controller[_0xfaeb('0x13')]);router[_0xfaeb('0x14')](_0xfaeb('0xf'),auth[_0xfaeb('0xc')](),controller[_0xfaeb('0x15')]);module[_0xfaeb('0x16')]=router;
\ No newline at end of file
+var _0x1b0b=['express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','show','post','create','update','delete','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x49b991,_0x1eeaf0){var _0x6286c3=function(_0x1dc182){while(--_0x1dc182){_0x49b991['push'](_0x49b991['shift']());}};_0x6286c3(++_0x1eeaf0);}(_0x1b0b,0x16d));var _0xb1b0=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x1b0b[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xb1b0('0x0'));var util=require('util');var path=require(_0xb1b0('0x1'));var timeout=require(_0xb1b0('0x2'));var express=require(_0xb1b0('0x3'));var router=express['Router']();var fs_extra=require(_0xb1b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb1b0('0x5'));var config=require(_0xb1b0('0x6'));var controller=require(_0xb1b0('0x7'));router['get']('/',auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x9')]);router[_0xb1b0('0xa')](_0xb1b0('0xb'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0xc')]);router[_0xb1b0('0xa')](_0xb1b0('0xd'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0xe')]);router['get']('/:id',auth[_0xb1b0('0x8')](),controller[_0xb1b0('0xf')]);router[_0xb1b0('0x10')]('/',auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x11')]);router['put']('/:id',controller[_0xb1b0('0x12')]);router[_0xb1b0('0x13')](_0xb1b0('0x14'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x15')]);module[_0xb1b0('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 63610dd..9dbfbb8 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 _0x14b7=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x45d681,_0xe24e62){var _0x34c839=function(_0x8a97f2){while(--_0x8a97f2){_0x45d681['push'](_0x45d681['shift']());}};_0x34c839(++_0xe24e62);}(_0x14b7,0x144));var _0x714b=function(_0x5df3ab,_0x4a0a7e){_0x5df3ab=_0x5df3ab-0x0;var _0x42cce5=_0x14b7[_0x5df3ab];return _0x42cce5;};'use strict';var Sequelize=require(_0x714b('0x0'));module[_0x714b('0x1')]={'body':{'type':Sequelize[_0x714b('0x2')](_0x714b('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x714b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x714b('0x5')]('in',_0x714b('0x6')),'defaultValue':_0x714b('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x714b('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x3870=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x1f79f8,_0x4b68e7){var _0x21baa6=function(_0x4ffa5b){while(--_0x4ffa5b){_0x1f79f8['push'](_0x1f79f8['shift']());}};_0x21baa6(++_0x4b68e7);}(_0x3870,0x146));var _0x0387=function(_0x30a5ef,_0x4c57e7){_0x30a5ef=_0x30a5ef-0x0;var _0xecf35d=_0x3870[_0x30a5ef];return _0xecf35d;};'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 1b4500b..6161458 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x28d5d3,_0x4ea64a){var _0x833539=function(_0x3f4929){while(--_0x3f4929){_0x28d5d3['push'](_0x28d5d3['shift']());}};_0x833539(++_0x4ea64a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x116b01,_0x2a7947){var _0x4fd916=function(_0x1187ab){while(--_0x1187ab){_0x116b01['push'](_0x116b01['shift']());}};_0x4fd916(++_0x2a7947);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index d80ff4f..00db49e 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 _0x175f=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x178cc5,_0x4169af){var _0x1a8380=function(_0x5651ea){while(--_0x5651ea){_0x178cc5['push'](_0x178cc5['shift']());}};_0x1a8380(++_0x4169af);}(_0x175f,0x151));var _0xf175=function(_0x3dda2e,_0x1282d1){_0x3dda2e=_0x3dda2e-0x0;var _0x476246=_0x175f[_0x3dda2e];return _0x476246;};'use strict';var EventEmitter=require(_0xf175('0x0'));var ChatMessage=require(_0xf175('0x1'))['db'][_0xf175('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf175('0x3')](0x0);var events={'afterCreate':_0xf175('0x4'),'afterUpdate':_0xf175('0x5'),'afterDestroy':_0xf175('0x6')};function emitEvent(_0x4d2884){return function(_0x45d0a2,_0x92f396,_0x2b0182){ChatMessageEvents['emit'](_0x4d2884+':'+_0x45d0a2['id'],_0x45d0a2);ChatMessageEvents[_0xf175('0x7')](_0x4d2884,_0x45d0a2);_0x2b0182(null);};}for(var e in events){if(events[_0xf175('0x8')](e)){var event=events[e];ChatMessage[_0xf175('0x9')](e,emitEvent(event));}}module[_0xf175('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x8525=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x456cc2,_0x38cdd8){var _0x5ae9f6=function(_0x3dce11){while(--_0x3dce11){_0x456cc2['push'](_0x456cc2['shift']());}};_0x5ae9f6(++_0x38cdd8);}(_0x8525,0x19b));var _0x5852=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8525[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require(_0x5852('0x0'));var ChatMessage=require(_0x5852('0x1'))['db'][_0x5852('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5852('0x3')](0x0);var events={'afterCreate':_0x5852('0x4'),'afterUpdate':'update','afterDestroy':_0x5852('0x5')};function emitEvent(_0x25280a){return function(_0x1135df,_0x57358f,_0x4d1a58){ChatMessageEvents['emit'](_0x25280a+':'+_0x1135df['id'],_0x1135df);ChatMessageEvents[_0x5852('0x6')](_0x25280a,_0x1135df);_0x4d1a58(null);};}for(var e in events){if(events[_0x5852('0x7')](e)){var event=events[e];ChatMessage[_0x5852('0x8')](e,emitEvent(event));}}module[_0x5852('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index b97c93e..986d72e 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 _0x79f1=['path','rimraf','./chatMessage.attributes','define','chat_messages','body','get','direction','toLowerCase','out','ChatInteraction','findOne','update','createdAt','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79f1,0x73));var _0x179f=function(_0x22cd0c,_0x4040b6){_0x22cd0c=_0x22cd0c-0x0;var _0x439eba=_0x79f1[_0x22cd0c];return _0x439eba;};'use strict';var _=require('lodash');var util=require(_0x179f('0x0'));var logger=require(_0x179f('0x1'))(_0x179f('0x2'));var moment=require(_0x179f('0x3'));var BPromise=require('bluebird');var rp=require(_0x179f('0x4'));var fs=require('fs');var path=require(_0x179f('0x5'));var rimraf=require(_0x179f('0x6'));var config=require('../../config/environment');var attributes=require(_0x179f('0x7'));module['exports']=function(_0x48f90e,_0x4dc38f){return _0x48f90e[_0x179f('0x8')]('ChatMessage',attributes,{'tableName':_0x179f('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x179f('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x375538,_0xbe4344,_0x4829bb){var _0x11c0e7=_0x48f90e['models'];var _0x488fd0=_0x375538[_0x179f('0xb')]({'plain':!![]});if(_0x488fd0['direction']['toLowerCase']()==='in'||_0x488fd0[_0x179f('0xc')][_0x179f('0xd')]()===_0x179f('0xe')&&!_0x488fd0['secret']&&!_['isNil'](_0x488fd0['UserId'])){_0x11c0e7[_0x179f('0xf')][_0x179f('0x10')]({'where':{'id':_0x488fd0['ChatInteractionId']}})['then'](function(_0x5d198e){if(_0x5d198e){_0x5d198e[_0x179f('0x11')]({'lastMsgAt':_0x488fd0[_0x179f('0x12')],'lastMsgDirection':_0x488fd0[_0x179f('0xc')][_0x179f('0xd')]()});}})['catch'](function(_0x240ae2){console['error'](_0x240ae2);});}_0x4829bb();}},'charset':'utf8mb4','collate':_0x179f('0x13')});};
\ No newline at end of file
+var _0x4ab0=['body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','ChatInteraction','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4ab0,0xd5));var _0x04ab=function(_0x435cf4,_0x420327){_0x435cf4=_0x435cf4-0x0;var _0x91f65f=_0x4ab0[_0x435cf4];return _0x91f65f;};'use strict';var _=require('lodash');var util=require(_0x04ab('0x0'));var logger=require(_0x04ab('0x1'))(_0x04ab('0x2'));var moment=require(_0x04ab('0x3'));var BPromise=require(_0x04ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x04ab('0x5'));var config=require(_0x04ab('0x6'));var attributes=require('./chatMessage.attributes');module[_0x04ab('0x7')]=function(_0x2c5730,_0x4edd2e){return _0x2c5730[_0x04ab('0x8')](_0x04ab('0x9'),attributes,{'tableName':_0x04ab('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x04ab('0xb')],'type':_0x04ab('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13fde9,_0x41ce1e,_0x4dc264){var _0x252d00=_0x2c5730[_0x04ab('0xd')];var _0x3d003a=_0x13fde9[_0x04ab('0xe')]({'plain':!![]});if(_0x3d003a['direction'][_0x04ab('0xf')]()==='in'||_0x3d003a[_0x04ab('0x10')][_0x04ab('0xf')]()===_0x04ab('0x11')&&!_0x3d003a[_0x04ab('0x12')]&&!_[_0x04ab('0x13')](_0x3d003a['UserId'])){_0x252d00[_0x04ab('0x14')]['findOne']({'where':{'id':_0x3d003a[_0x04ab('0x15')]}})[_0x04ab('0x16')](function(_0x2abdf8){if(_0x2abdf8){_0x2abdf8[_0x04ab('0x17')]({'lastMsgAt':_0x3d003a['createdAt'],'lastMsgDirection':_0x3d003a['direction']['toLowerCase']()});}})[_0x04ab('0x18')](function(_0x3cee44){console[_0x04ab('0x19')](_0x3cee44);});}_0x4dc264();}},'charset':_0x04ab('0x1a'),'collate':_0x04ab('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 87a617d..f5a485d 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 _0x87f9=['then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateChatMessage','ChatMessage','body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket','register','request'];(function(_0x3847be,_0x39d941){var _0x49b939=function(_0x3e592b){while(--_0x3e592b){_0x3847be['push'](_0x3847be['shift']());}};_0x49b939(++_0x39d941);}(_0x87f9,0xa6));var _0x987f=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x87f9[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x987f('0x0'));var util=require(_0x987f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x987f('0x2'));var fs=require('fs');var Redis=require(_0x987f('0x3'));var db=require(_0x987f('0x4'))['db'];var utils=require(_0x987f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x987f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x987f('0x7')][_0x987f('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x987f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x987f('0xa'))(new Redis(config['redis']));require(_0x987f('0xb'))[_0x987f('0xc')](socket);function respondWithRpcPromise(_0x18e084,_0x33647e,_0x3e69ea){return new BPromise(function(_0x5e1ff9,_0x510210){return client[_0x987f('0xd')](_0x18e084,_0x3e69ea)[_0x987f('0xe')](function(_0x1347d6){logger['info'](_0x987f('0xf'),_0x33647e,_0x987f('0x10'));logger[_0x987f('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x33647e,_0x987f('0x10'),JSON[_0x987f('0x12')](_0x1347d6));if(_0x1347d6[_0x987f('0x13')]){if(_0x1347d6[_0x987f('0x13')][_0x987f('0x14')]===0x1f4){logger[_0x987f('0x13')](_0x987f('0xf'),_0x33647e,_0x1347d6[_0x987f('0x13')][_0x987f('0x15')]);return _0x510210(_0x1347d6[_0x987f('0x13')]['message']);}logger['error'](_0x987f('0xf'),_0x33647e,_0x1347d6['error'][_0x987f('0x15')]);return _0x5e1ff9(_0x1347d6[_0x987f('0x13')][_0x987f('0x15')]);}else{logger[_0x987f('0x16')](_0x987f('0xf'),_0x33647e,_0x987f('0x10'));_0x5e1ff9(_0x1347d6[_0x987f('0x17')][_0x987f('0x15')]);}})['catch'](function(_0x4c78b){logger[_0x987f('0x13')](_0x987f('0xf'),_0x33647e,_0x4c78b);_0x510210(_0x4c78b);});});}exports[_0x987f('0x18')]=function(_0x52b4b4){var _0xc75482=this;return new Promise(function(_0x1466f4,_0x588187){return db[_0x987f('0x19')]['create'](_0x52b4b4[_0x987f('0x1a')],{'raw':_0x52b4b4[_0x987f('0x1b')]?_0x52b4b4[_0x987f('0x1b')][_0x987f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1b74da){logger[_0x987f('0x16')]('CreateChatMessage',_0x52b4b4);logger[_0x987f('0x11')](_0x987f('0x18'),_0x52b4b4,JSON[_0x987f('0x12')](_0x1b74da));_0x1466f4(_0x1b74da);})[_0x987f('0x1d')](function(_0x39d438){logger[_0x987f('0x13')](_0x987f('0x18'),_0x39d438['message'],_0x52b4b4);_0x588187(_0xc75482[_0x987f('0x13')](0x1f4,_0x39d438['message']));});});};
\ No newline at end of file
+var _0x7bc3=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','./chatMessage.socket','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','body','options','raw','CreateChatMessage','lodash'];(function(_0xd87d6c,_0x31c6ab){var _0x7ca857=function(_0x26f469){while(--_0x26f469){_0xd87d6c['push'](_0xd87d6c['shift']());}};_0x7ca857(++_0x31c6ab);}(_0x7bc3,0xbc));var _0x37bc=function(_0x2cace5,_0x515aa7){_0x2cace5=_0x2cace5-0x0;var _0x4083b6=_0x7bc3[_0x2cace5];return _0x4083b6;};'use strict';var _=require(_0x37bc('0x0'));var util=require(_0x37bc('0x1'));var moment=require(_0x37bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x37bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37bc('0x4'))['db'];var utils=require(_0x37bc('0x5'));var logger=require(_0x37bc('0x6'))(_0x37bc('0x7'));var config=require(_0x37bc('0x8'));var jayson=require(_0x37bc('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x37bc('0xa')]=_['defaults'](config[_0x37bc('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37bc('0xa')]));require(_0x37bc('0xb'))['register'](socket);function respondWithRpcPromise(_0x3c16e5,_0x54ef62,_0x4c7900){return new BPromise(function(_0x59f552,_0x276013){return client['request'](_0x3c16e5,_0x4c7900)[_0x37bc('0xc')](function(_0x250095){logger[_0x37bc('0xd')]('ChatMessage,\x20%s,\x20%s',_0x54ef62,_0x37bc('0xe'));logger[_0x37bc('0xf')](_0x37bc('0x10'),_0x54ef62,_0x37bc('0xe'),JSON[_0x37bc('0x11')](_0x250095));if(_0x250095[_0x37bc('0x12')]){if(_0x250095[_0x37bc('0x12')][_0x37bc('0x13')]===0x1f4){logger[_0x37bc('0x12')](_0x37bc('0x14'),_0x54ef62,_0x250095['error'][_0x37bc('0x15')]);return _0x276013(_0x250095[_0x37bc('0x12')][_0x37bc('0x15')]);}logger[_0x37bc('0x12')](_0x37bc('0x14'),_0x54ef62,_0x250095[_0x37bc('0x12')]['message']);return _0x59f552(_0x250095[_0x37bc('0x12')][_0x37bc('0x15')]);}else{logger[_0x37bc('0xd')](_0x37bc('0x14'),_0x54ef62,_0x37bc('0xe'));_0x59f552(_0x250095[_0x37bc('0x16')]['message']);}})['catch'](function(_0xb75ad3){logger[_0x37bc('0x12')](_0x37bc('0x14'),_0x54ef62,_0xb75ad3);_0x276013(_0xb75ad3);});});}exports['CreateChatMessage']=function(_0x12a8c6){var _0x5dfd71=this;return new Promise(function(_0x1a5287,_0x4db419){return db['ChatMessage']['create'](_0x12a8c6[_0x37bc('0x17')],{'raw':_0x12a8c6['options']?_0x12a8c6[_0x37bc('0x18')][_0x37bc('0x19')]===undefined?!![]:![]:!![]})[_0x37bc('0xc')](function(_0x507936){logger['info'](_0x37bc('0x1a'),_0x12a8c6);logger[_0x37bc('0xf')](_0x37bc('0x1a'),_0x12a8c6,JSON[_0x37bc('0x11')](_0x507936));_0x1a5287(_0x507936);})['catch'](function(_0xd749c6){logger['error'](_0x37bc('0x1a'),_0xd749c6[_0x37bc('0x15')],_0x12a8c6);_0x4db419(_0x5dfd71[_0x37bc('0x12')](0x1f4,_0xd749c6['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 7f11952..1759919 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 _0x3645=['emit','removeListener','register','length','save','remove','update'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x3645,0x154));var _0x5364=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x3645[_0x1e393b];return _0x3d0bfe;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5364('0x0'),_0x5364('0x1'),_0x5364('0x2')];function createListener(_0x28eafb,_0x2d71d7){return function(_0x2f629b){_0x2d71d7[_0x5364('0x3')](_0x28eafb,_0x2f629b);};}function removeListener(_0x5a63bf,_0x334a16){return function(){ChatMessageEvents[_0x5364('0x4')](_0x5a63bf,_0x334a16);};}exports[_0x5364('0x5')]=function(_0x1f9c6b){for(var _0x417c44=0x0,_0x7933a5=events[_0x5364('0x6')];_0x417c44<_0x7933a5;_0x417c44++){var _0x43fb3f=events[_0x417c44];var _0x3c1b21=createListener('chatMessage:'+_0x43fb3f,_0x1f9c6b);ChatMessageEvents['on'](_0x43fb3f,_0x3c1b21);}};
\ No newline at end of file
+var _0xc7a3=['remove','update','register','length','save'];(function(_0x57961a,_0x58a928){var _0x299fad=function(_0x28b99f){while(--_0x28b99f){_0x57961a['push'](_0x57961a['shift']());}};_0x299fad(++_0x58a928);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x15aa87,_0x366760){_0x15aa87=_0x15aa87-0x0;var _0x23dceb=_0xc7a3[_0x15aa87];return _0x23dceb;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x3c7a('0x0'),_0x3c7a('0x1'),_0x3c7a('0x2')];function createListener(_0x12f959,_0x283aed){return function(_0x2d6d97){_0x283aed['emit'](_0x12f959,_0x2d6d97);};}function removeListener(_0x44fd47,_0x3e1c47){return function(){ChatMessageEvents['removeListener'](_0x44fd47,_0x3e1c47);};}exports[_0x3c7a('0x3')]=function(_0x2051ce){for(var _0x2736c1=0x0,_0x48e820=events[_0x3c7a('0x4')];_0x2736c1<_0x48e820;_0x2736c1++){var _0x4f0608=events[_0x2736c1];var _0x20d36c=createListener('chatMessage:'+_0x4f0608,_0x2051ce);ChatMessageEvents['on'](_0x4f0608,_0x20d36c);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index c05f086..f38b64c 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 _0x6cde=['isAuthenticated','index','/describe','describe','/:id','tracked','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x559e0f,_0x5cde8f){var _0x485792=function(_0x30a136){while(--_0x30a136){_0x559e0f['push'](_0x559e0f['shift']());}};_0x485792(++_0x5cde8f);}(_0x6cde,0xfa));var _0xe6cd=function(_0x473b3a,_0x4889de){_0x473b3a=_0x473b3a-0x0;var _0x557b97=_0x6cde[_0x473b3a];return _0x557b97;};'use strict';var multer=require(_0xe6cd('0x0'));var util=require(_0xe6cd('0x1'));var path=require(_0xe6cd('0x2'));var timeout=require(_0xe6cd('0x3'));var express=require(_0xe6cd('0x4'));var router=express[_0xe6cd('0x5')]();var fs_extra=require(_0xe6cd('0x6'));var auth=require(_0xe6cd('0x7'));var interaction=require(_0xe6cd('0x8'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0xe6cd('0x9')]('/',auth[_0xe6cd('0xa')](),controller[_0xe6cd('0xb')]);router[_0xe6cd('0x9')](_0xe6cd('0xc'),auth['isAuthenticated'](),controller[_0xe6cd('0xd')]);router[_0xe6cd('0x9')](_0xe6cd('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe6cd('0xa')](),interaction[_0xe6cd('0xf')](_0xe6cd('0x10'),_0xe6cd('0x11')),controller[_0xe6cd('0x12')]);router[_0xe6cd('0x13')]('/:id',controller[_0xe6cd('0x14')]);router['put'](_0xe6cd('0x15'),auth[_0xe6cd('0xa')](),controller['accept']);router['put'](_0xe6cd('0x16'),auth[_0xe6cd('0xa')](),controller['reject']);router[_0xe6cd('0x17')](_0xe6cd('0xe'),auth[_0xe6cd('0xa')](),controller[_0xe6cd('0x18')]);module[_0xe6cd('0x19')]=router;
\ No newline at end of file
+var _0x5216=['show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5216,0x1a5));var _0x6521=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5216[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x6521('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6521('0x1'));var router=express[_0x6521('0x2')]();var fs_extra=require(_0x6521('0x3'));var auth=require(_0x6521('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6521('0x5'));router[_0x6521('0x6')]('/',auth['isAuthenticated'](),controller[_0x6521('0x7')]);router[_0x6521('0x6')](_0x6521('0x8'),auth[_0x6521('0x9')](),controller['describe']);router[_0x6521('0x6')](_0x6521('0xa'),auth[_0x6521('0x9')](),controller[_0x6521('0xb')]);router[_0x6521('0xc')]('/',auth[_0x6521('0x9')](),interaction[_0x6521('0xd')](_0x6521('0xe'),_0x6521('0xf')),controller[_0x6521('0x10')]);router[_0x6521('0x11')](_0x6521('0xa'),controller[_0x6521('0x12')]);router[_0x6521('0x11')]('/:id/accept',auth[_0x6521('0x9')](),controller[_0x6521('0x13')]);router[_0x6521('0x11')](_0x6521('0x14'),auth['isAuthenticated'](),controller[_0x6521('0x15')]);router[_0x6521('0x16')](_0x6521('0xa'),auth[_0x6521('0x9')](),controller[_0x6521('0x17')]);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 5f2f92a..7722dfa 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 _0xe80a=['sequelize','exports','TEXT','medium'];(function(_0x42bd65,_0x588b44){var _0x46da0d=function(_0x49e9f9){while(--_0x49e9f9){_0x42bd65['push'](_0x42bd65['shift']());}};_0x46da0d(++_0x588b44);}(_0xe80a,0x8c));var _0xae80=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xe80a[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0xae80('0x0'));module[_0xae80('0x1')]={'body':{'type':Sequelize[_0xae80('0x2')](_0xae80('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xff71=['sequelize','exports','TEXT','medium'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xff71,0x1b0));var _0x1ff7=function(_0x35faf2,_0x56a899){_0x35faf2=_0x35faf2-0x0;var _0x113601=_0xff71[_0x35faf2];return _0x113601;};'use strict';var Sequelize=require(_0x1ff7('0x0'));module[_0x1ff7('0x1')]={'body':{'type':Sequelize[_0x1ff7('0x2')](_0x1ff7('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index fb16323..8a41e03 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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x29a487,_0x2ef985){var _0x53d47d=function(_0x54f5c9){while(--_0x54f5c9){_0x29a487['push'](_0x29a487['shift']());}};_0x53d47d(++_0x2ef985);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x53edf4,_0x294c57){var _0x1ed494=function(_0x487685){while(--_0x487685){_0x53edf4['push'](_0x53edf4['shift']());}};_0x1ed494(++_0x294c57);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 29cd06a..5a60d8d 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 _0xf44a=['rimraf','../../config/environment','./chatOfflineMessage.attributes','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf44a,0x1bc));var _0xaf44=function(_0x53fe90,_0x443585){_0x53fe90=_0x53fe90-0x0;var _0x15ab23=_0xf44a[_0x53fe90];return _0x15ab23;};'use strict';var _=require(_0xaf44('0x0'));var util=require('util');var logger=require(_0xaf44('0x1'))(_0xaf44('0x2'));var moment=require(_0xaf44('0x3'));var BPromise=require(_0xaf44('0x4'));var rp=require(_0xaf44('0x5'));var fs=require('fs');var path=require(_0xaf44('0x6'));var rimraf=require(_0xaf44('0x7'));var config=require(_0xaf44('0x8'));var attributes=require(_0xaf44('0x9'));module['exports']=function(_0x3d81e3,_0x2b0485){return _0x3d81e3['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xaf44('0xa')});};
\ No newline at end of file
+var _0x4a10=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x4a4328,_0xa97f3){var _0x36ec8e=function(_0x6e94ee){while(--_0x6e94ee){_0x4a4328['push'](_0x4a4328['shift']());}};_0x36ec8e(++_0xa97f3);}(_0x4a10,0xb7));var _0x04a1=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4a10[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x04a1('0x0'));var util=require('util');var logger=require(_0x04a1('0x1'))(_0x04a1('0x2'));var moment=require('moment');var BPromise=require(_0x04a1('0x3'));var rp=require(_0x04a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04a1('0x5'));var config=require('../../config/environment');var attributes=require(_0x04a1('0x6'));module[_0x04a1('0x7')]=function(_0x4c1bb9,_0x39cc7c){return _0x4c1bb9[_0x04a1('0x8')](_0x04a1('0x9'),attributes,{'tableName':_0x04a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x04a1('0xb'),'collate':_0x04a1('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 60af5ab..3a51f9e 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 _0x08e0=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x08e0,0x19d));var _0x008e=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x08e0[_0x3a2a3c];return _0x50ac9a;};'use strict';var _=require(_0x008e('0x0'));var util=require(_0x008e('0x1'));var moment=require(_0x008e('0x2'));var BPromise=require(_0x008e('0x3'));var rs=require(_0x008e('0x4'));var fs=require('fs');var Redis=require(_0x008e('0x5'));var db=require(_0x008e('0x6'))['db'];var utils=require(_0x008e('0x7'));var logger=require(_0x008e('0x8'))('rpc');var config=require(_0x008e('0x9'));var jayson=require(_0x008e('0xa'));var client=jayson[_0x008e('0xb')][_0x008e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f6089,_0x11fa73,_0x55ded4){return new BPromise(function(_0x5e0f1b,_0x22a444){return client[_0x008e('0xd')](_0x2f6089,_0x55ded4)['then'](function(_0x4117af){logger[_0x008e('0xe')](_0x008e('0xf'),_0x11fa73,_0x008e('0x10'));logger[_0x008e('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x11fa73,_0x008e('0x10'),JSON[_0x008e('0x12')](_0x4117af));if(_0x4117af[_0x008e('0x13')]){if(_0x4117af['error'][_0x008e('0x14')]===0x1f4){logger[_0x008e('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x11fa73,_0x4117af[_0x008e('0x13')][_0x008e('0x15')]);return _0x22a444(_0x4117af[_0x008e('0x13')]['message']);}logger[_0x008e('0x13')](_0x008e('0xf'),_0x11fa73,_0x4117af[_0x008e('0x13')][_0x008e('0x15')]);return _0x5e0f1b(_0x4117af['error'][_0x008e('0x15')]);}else{logger[_0x008e('0xe')](_0x008e('0xf'),_0x11fa73,'request\x20sent');_0x5e0f1b(_0x4117af[_0x008e('0x16')]['message']);}})[_0x008e('0x17')](function(_0x39d043){logger[_0x008e('0x13')](_0x008e('0xf'),_0x11fa73,_0x39d043);_0x22a444(_0x39d043);});});}
\ No newline at end of file
+var _0x46fc=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x46fc,0x103));var _0xc46f=function(_0x3aa1f0,_0x3ee7c9){_0x3aa1f0=_0x3aa1f0-0x0;var _0x520581=_0x46fc[_0x3aa1f0];return _0x520581;};'use strict';var _=require(_0xc46f('0x0'));var util=require(_0xc46f('0x1'));var moment=require(_0xc46f('0x2'));var BPromise=require(_0xc46f('0x3'));var rs=require(_0xc46f('0x4'));var fs=require('fs');var Redis=require(_0xc46f('0x5'));var db=require(_0xc46f('0x6'))['db'];var utils=require(_0xc46f('0x7'));var logger=require(_0xc46f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc46f('0x9'));var client=jayson[_0xc46f('0xa')][_0xc46f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15904c,_0x1f5ac8,_0x312101){return new BPromise(function(_0x155a10,_0x327019){return client[_0xc46f('0xc')](_0x15904c,_0x312101)[_0xc46f('0xd')](function(_0x1bd18f){logger[_0xc46f('0xe')](_0xc46f('0xf'),_0x1f5ac8,_0xc46f('0x10'));logger['debug'](_0xc46f('0x11'),_0x1f5ac8,_0xc46f('0x10'),JSON[_0xc46f('0x12')](_0x1bd18f));if(_0x1bd18f[_0xc46f('0x13')]){if(_0x1bd18f['error']['code']===0x1f4){logger['error'](_0xc46f('0xf'),_0x1f5ac8,_0x1bd18f[_0xc46f('0x13')]['message']);return _0x327019(_0x1bd18f[_0xc46f('0x13')][_0xc46f('0x14')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1f5ac8,_0x1bd18f[_0xc46f('0x13')][_0xc46f('0x14')]);return _0x155a10(_0x1bd18f[_0xc46f('0x13')][_0xc46f('0x14')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x1f5ac8,'request\x20sent');_0x155a10(_0x1bd18f[_0xc46f('0x15')][_0xc46f('0x14')]);}})[_0xc46f('0x16')](function(_0x516238){logger[_0xc46f('0x13')](_0xc46f('0xf'),_0x1f5ac8,_0x516238);_0x327019(_0x516238);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index f52ed81..a162f92 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 _0x6f9e=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x114087,_0x815eb5){var _0x1f9db6=function(_0x2fce94){while(--_0x2fce94){_0x114087['push'](_0x114087['shift']());}};_0x1f9db6(++_0x815eb5);}(_0x6f9e,0x199));var _0xe6f9=function(_0x325f51,_0x4cbcdb){_0x325f51=_0x325f51-0x0;var _0x294922=_0x6f9e[_0x325f51];return _0x294922;};'use strict';var multer=require('multer');var util=require(_0xe6f9('0x0'));var path=require(_0xe6f9('0x1'));var timeout=require(_0xe6f9('0x2'));var express=require('express');var router=express[_0xe6f9('0x3')]();var fs_extra=require(_0xe6f9('0x4'));var auth=require(_0xe6f9('0x5'));var interaction=require(_0xe6f9('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0xe6f9('0x7')]('/',auth[_0xe6f9('0x8')](),controller[_0xe6f9('0x9')]);router[_0xe6f9('0x7')](_0xe6f9('0xa'),auth[_0xe6f9('0x8')](),controller['describe']);router[_0xe6f9('0x7')](_0xe6f9('0xb'),auth[_0xe6f9('0x8')](),controller[_0xe6f9('0xc')]);router[_0xe6f9('0xd')]('/',auth[_0xe6f9('0x8')](),controller[_0xe6f9('0xe')]);router['put'](_0xe6f9('0xb'),auth[_0xe6f9('0x8')](),controller[_0xe6f9('0xf')]);router[_0xe6f9('0x10')](_0xe6f9('0xb'),auth[_0xe6f9('0x8')](),controller['destroy']);module[_0xe6f9('0x11')]=router;
\ No newline at end of file
+var _0xc1e2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x1b3d16,_0x298459){var _0x4ab7c5=function(_0x39e9a1){while(--_0x39e9a1){_0x1b3d16['push'](_0x1b3d16['shift']());}};_0x4ab7c5(++_0x298459);}(_0xc1e2,0x14b));var _0x2c1e=function(_0x595929,_0x41cd4c){_0x595929=_0x595929-0x0;var _0x99f274=_0xc1e2[_0x595929];return _0x99f274;};'use strict';var multer=require(_0x2c1e('0x0'));var util=require(_0x2c1e('0x1'));var path=require(_0x2c1e('0x2'));var timeout=require('connect-timeout');var express=require(_0x2c1e('0x3'));var router=express[_0x2c1e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2c1e('0x5'));var interaction=require(_0x2c1e('0x6'));var config=require(_0x2c1e('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x2c1e('0x8')]('/',auth[_0x2c1e('0x9')](),controller[_0x2c1e('0xa')]);router[_0x2c1e('0x8')](_0x2c1e('0xb'),auth[_0x2c1e('0x9')](),controller[_0x2c1e('0xc')]);router[_0x2c1e('0x8')](_0x2c1e('0xd'),auth[_0x2c1e('0x9')](),controller[_0x2c1e('0xe')]);router[_0x2c1e('0xf')]('/',auth['isAuthenticated'](),controller[_0x2c1e('0x10')]);router[_0x2c1e('0x11')](_0x2c1e('0xd'),auth[_0x2c1e('0x9')](),controller[_0x2c1e('0x12')]);router[_0x2c1e('0x13')]('/:id',auth[_0x2c1e('0x9')](),controller['destroy']);module[_0x2c1e('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 1236709..394cf4c 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 _0x1a33=['mouseOver','sequelize','exports','STRING','ENUM'];(function(_0x2f2fb7,_0x25e15d){var _0x2a8295=function(_0x483fd3){while(--_0x483fd3){_0x2f2fb7['push'](_0x2f2fb7['shift']());}};_0x2a8295(++_0x25e15d);}(_0x1a33,0x83));var _0x31a3=function(_0x47e02d,_0x4e667a){_0x47e02d=_0x47e02d-0x0;var _0x95923c=_0x1a33[_0x47e02d];return _0x95923c;};'use strict';var Sequelize=require(_0x31a3('0x0'));module[_0x31a3('0x1')]={'name':{'type':Sequelize[_0x31a3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x31a3('0x3')](_0x31a3('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x31a3('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xb6b4=['sequelize','exports','STRING','ENUM','timeout','mouseOver'];(function(_0x445a8a,_0x924d3f){var _0x49ac3f=function(_0x47cf35){while(--_0x47cf35){_0x445a8a['push'](_0x445a8a['shift']());}};_0x49ac3f(++_0x924d3f);}(_0xb6b4,0xf6));var _0x4b6b=function(_0x294098,_0x39327e){_0x294098=_0x294098-0x0;var _0x1221b3=_0xb6b4[_0x294098];return _0x1221b3;};'use strict';var Sequelize=require(_0x4b6b('0x0'));module[_0x4b6b('0x1')]={'name':{'type':Sequelize[_0x4b6b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4b6b('0x3')]('mouseOver',_0x4b6b('0x4')),'defaultValue':_0x4b6b('0x5')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 7105f69..04ba06c 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 _0x24ca=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','show','params','model','keys','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ca,0x1bc));var _0xa24c=function(_0x58999b,_0xea4695){_0x58999b=_0x58999b-0x0;var _0x5efc3a=_0x24ca[_0x58999b];return _0x5efc3a;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={'raw':!![],'where':{'id':_0x28675f[_0xa24c('0x2e')]['id']}},_0x5e491e={};_0x5e491e[_0xa24c('0x2f')]=_[_0xa24c('0x30')](db['ChatProactiveAction'][_0xa24c('0x31')]);_0x5e491e[_0xa24c('0x32')]=_[_0xa24c('0x30')](_0x28675f['query']);_0x5e491e[_0xa24c('0x33')]=_['intersection'](_0x5e491e[_0xa24c('0x2f')],_0x5e491e[_0xa24c('0x32')]);_0x12dbdc[_0xa24c('0x34')]=_['intersection'](_0x5e491e[_0xa24c('0x2f')],qs[_0xa24c('0x35')](_0x28675f[_0xa24c('0x32')]['fields']));_0x12dbdc[_0xa24c('0x34')]=_0x12dbdc['attributes'][_0xa24c('0x36')]?_0x12dbdc[_0xa24c('0x34')]:_0x5e491e['model'];if(_0x28675f['query'][_0xa24c('0x37')]){_0x12dbdc[_0xa24c('0x38')]=[{'all':!![]}];}_0x12dbdc=_[_0xa24c('0x39')]({},_0x12dbdc,_0x28675f[_0xa24c('0x3a')]);return db[_0xa24c('0x3b')][_0xa24c('0x3c')](_0x12dbdc)[_0xa24c('0x27')](handleEntityNotFound(_0x152120,null))['then'](respondWithResult(_0x152120,null))[_0xa24c('0x3d')](handleError(_0x152120,null));};exports[_0xa24c('0x3e')]=function(_0x12825d,_0xbd24c0){return db[_0xa24c('0x3b')][_0xa24c('0x3e')](_0x12825d[_0xa24c('0x3f')],{})[_0xa24c('0x27')](respondWithResult(_0xbd24c0,0xc9))[_0xa24c('0x3d')](handleError(_0xbd24c0,null));};exports[_0xa24c('0x26')]=function(_0x4c7a30,_0x70a957){if(_0x4c7a30[_0xa24c('0x3f')]['id']){delete _0x4c7a30[_0xa24c('0x3f')]['id'];}return db[_0xa24c('0x3b')]['find']({'where':{'id':_0x4c7a30['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x70a957,null))['then'](saveUpdates(_0x4c7a30[_0xa24c('0x3f')],null))[_0xa24c('0x27')](respondWithResult(_0x70a957,null))[_0xa24c('0x3d')](handleError(_0x70a957,null));};exports[_0xa24c('0x28')]=function(_0x29ca48,_0x4c0fb9){return db['ChatProactiveAction'][_0xa24c('0x3c')]({'where':{'id':_0x29ca48[_0xa24c('0x2e')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x4c0fb9,null))[_0xa24c('0x27')](removeEntity(_0x4c0fb9,null))[_0xa24c('0x3d')](handleError(_0x4c0fb9,null));};
\ No newline at end of file
+var _0xdb4b=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','save','update','then','destroy','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x4f47d0,_0x1aede4){var _0x32c279=function(_0x4be892){while(--_0x4be892){_0x4f47d0['push'](_0x4f47d0['shift']());}};_0x32c279(++_0x1aede4);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x26793a,_0x49cf51){_0x26793a=_0x26793a-0x0;var _0x575efb=_0xdb4b[_0x26793a];return _0x575efb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdb4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbdb4('0x1'));var rp=require(_0xbdb4('0x2'));var moment=require(_0xbdb4('0x3'));var BPromise=require(_0xbdb4('0x4'));var Mustache=require('mustache');var util=require(_0xbdb4('0x5'));var path=require(_0xbdb4('0x6'));var sox=require(_0xbdb4('0x7'));var csv=require(_0xbdb4('0x8'));var ejs=require(_0xbdb4('0x9'));var fs=require('fs');var fs_extra=require(_0xbdb4('0xa'));var _=require(_0xbdb4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbdb4('0xc'));var deskjs=require(_0xbdb4('0xd'));var toCsv=require(_0xbdb4('0x8'));var querystring=require(_0xbdb4('0xe'));var Papa=require('papaparse');var Redis=require(_0xbdb4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbdb4('0x10'));var as=require(_0xbdb4('0x11'));var hardwareService=require(_0xbdb4('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xbdb4('0x13'));var config=require(_0xbdb4('0x14'));var licenseUtil=require(_0xbdb4('0x15'));var db=require(_0xbdb4('0x16'))['db'];function respondWithStatusCode(_0x5f1825,_0x4fadb2){_0x4fadb2=_0x4fadb2||0xcc;return function(_0xd2eaa5){if(_0xd2eaa5){return _0x5f1825[_0xbdb4('0x17')](_0x4fadb2);}return _0x5f1825[_0xbdb4('0x18')](_0x4fadb2)[_0xbdb4('0x19')]();};}function respondWithResult(_0x3e0801,_0x310780){_0x310780=_0x310780||0xc8;return function(_0x4a2ae3){if(_0x4a2ae3){return _0x3e0801['status'](_0x310780)[_0xbdb4('0x1a')](_0x4a2ae3);}};}function respondWithFilteredResult(_0x4386e1,_0x5d84f6){return function(_0x446124){if(_0x446124){var _0x19a69b=typeof _0x5d84f6['offset']==='undefined'&&typeof _0x5d84f6[_0xbdb4('0x1b')]===_0xbdb4('0x1c');var _0x52c7ca=_0x446124[_0xbdb4('0x1d')];var _0x113471=_0x19a69b?0x0:_0x5d84f6['offset'];var _0x2ca1d5=_0x19a69b?_0x446124[_0xbdb4('0x1d')]:_0x5d84f6[_0xbdb4('0x1e')]+_0x5d84f6['limit'];var _0x50d0af;if(_0x2ca1d5>=_0x52c7ca){_0x2ca1d5=_0x52c7ca;_0x50d0af=0xc8;}else{_0x50d0af=0xce;}_0x4386e1[_0xbdb4('0x18')](_0x50d0af);return _0x4386e1[_0xbdb4('0x1f')]('Content-Range',_0x113471+'-'+_0x2ca1d5+'/'+_0x52c7ca)[_0xbdb4('0x1a')](_0x446124);}return null;};}function patchUpdates(_0x2d72d9){return function(_0x21b32d){try{jsonpatch['apply'](_0x21b32d,_0x2d72d9,!![]);}catch(_0x1bbabc){return BPromise['reject'](_0x1bbabc);}return _0x21b32d[_0xbdb4('0x20')]();};}function saveUpdates(_0x182758,_0x40efbe){return function(_0x2320e9){if(_0x2320e9){return _0x2320e9[_0xbdb4('0x21')](_0x182758)[_0xbdb4('0x22')](function(_0x5780ba){return _0x5780ba;});}return null;};}function removeEntity(_0x3db8aa,_0x18b284){return function(_0x2ea4f4){if(_0x2ea4f4){return _0x2ea4f4[_0xbdb4('0x23')]()[_0xbdb4('0x22')](function(){_0x3db8aa['status'](0xcc)[_0xbdb4('0x19')]();});}};}function handleEntityNotFound(_0x18a6f6,_0x3d440a){return function(_0x5b46a1){if(!_0x5b46a1){_0x18a6f6['sendStatus'](0x194);}return _0x5b46a1;};}function handleError(_0x1ab9b1,_0x22ba6c){_0x22ba6c=_0x22ba6c||0x1f4;return function(_0x3b3e0b){logger[_0xbdb4('0x24')](_0x3b3e0b[_0xbdb4('0x25')]);if(_0x3b3e0b[_0xbdb4('0x26')]){delete _0x3b3e0b[_0xbdb4('0x26')];}_0x1ab9b1[_0xbdb4('0x18')](_0x22ba6c)[_0xbdb4('0x27')](_0x3b3e0b);};}exports[_0xbdb4('0x28')]=function(_0x52ebf5,_0x81ec7d){var _0x11a783={'raw':!![],'where':{'id':_0x52ebf5[_0xbdb4('0x29')]['id']}},_0x1246a7={};_0x1246a7[_0xbdb4('0x2a')]=_['keys'](db[_0xbdb4('0x2b')][_0xbdb4('0x2c')]);_0x1246a7[_0xbdb4('0x2d')]=_[_0xbdb4('0x2e')](_0x52ebf5[_0xbdb4('0x2d')]);_0x1246a7[_0xbdb4('0x2f')]=_[_0xbdb4('0x30')](_0x1246a7[_0xbdb4('0x2a')],_0x1246a7['query']);_0x11a783[_0xbdb4('0x31')]=_[_0xbdb4('0x30')](_0x1246a7['model'],qs['fields'](_0x52ebf5[_0xbdb4('0x2d')]['fields']));_0x11a783[_0xbdb4('0x31')]=_0x11a783[_0xbdb4('0x31')][_0xbdb4('0x32')]?_0x11a783[_0xbdb4('0x31')]:_0x1246a7['model'];if(_0x52ebf5[_0xbdb4('0x2d')][_0xbdb4('0x33')]){_0x11a783[_0xbdb4('0x34')]=[{'all':!![]}];}_0x11a783=_[_0xbdb4('0x35')]({},_0x11a783,_0x52ebf5[_0xbdb4('0x36')]);return db[_0xbdb4('0x2b')][_0xbdb4('0x37')](_0x11a783)[_0xbdb4('0x22')](handleEntityNotFound(_0x81ec7d,null))[_0xbdb4('0x22')](respondWithResult(_0x81ec7d,null))[_0xbdb4('0x38')](handleError(_0x81ec7d,null));};exports[_0xbdb4('0x39')]=function(_0x134401,_0x4e15e1){return db[_0xbdb4('0x2b')][_0xbdb4('0x39')](_0x134401[_0xbdb4('0x3a')],{})[_0xbdb4('0x22')](respondWithResult(_0x4e15e1,0xc9))['catch'](handleError(_0x4e15e1,null));};exports[_0xbdb4('0x21')]=function(_0xe25e14,_0x410f96){if(_0xe25e14[_0xbdb4('0x3a')]['id']){delete _0xe25e14[_0xbdb4('0x3a')]['id'];}return db[_0xbdb4('0x2b')][_0xbdb4('0x37')]({'where':{'id':_0xe25e14[_0xbdb4('0x29')]['id']}})[_0xbdb4('0x22')](handleEntityNotFound(_0x410f96,null))[_0xbdb4('0x22')](saveUpdates(_0xe25e14['body'],null))[_0xbdb4('0x22')](respondWithResult(_0x410f96,null))[_0xbdb4('0x38')](handleError(_0x410f96,null));};exports[_0xbdb4('0x23')]=function(_0x49c5db,_0x45952f){return db[_0xbdb4('0x2b')][_0xbdb4('0x37')]({'where':{'id':_0x49c5db[_0xbdb4('0x29')]['id']}})['then'](handleEntityNotFound(_0x45952f,null))[_0xbdb4('0x22')](removeEntity(_0x45952f,null))['catch'](handleError(_0x45952f,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0df24d2..b4857c1 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 _0x71dd=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','util'];(function(_0x3b3cb7,_0x49c02d){var _0x3cbdaf=function(_0x4ecba9){while(--_0x4ecba9){_0x3b3cb7['push'](_0x3b3cb7['shift']());}};_0x3cbdaf(++_0x49c02d);}(_0x71dd,0xef));var _0xd71d=function(_0x5eca50,_0xc1e3f8){_0x5eca50=_0x5eca50-0x0;var _0x41fb84=_0x71dd[_0x5eca50];return _0x41fb84;};'use strict';var _=require('lodash');var util=require(_0xd71d('0x0'));var logger=require(_0xd71d('0x1'))(_0xd71d('0x2'));var moment=require('moment');var BPromise=require(_0xd71d('0x3'));var rp=require(_0xd71d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd71d('0x5'));var config=require(_0xd71d('0x6'));var attributes=require(_0xd71d('0x7'));module['exports']=function(_0x86a7fc,_0x68f5fa){return _0x86a7fc[_0xd71d('0x8')](_0xd71d('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ac1=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','lodash','util'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x5ac1,0x1ed));var _0x15ac=function(_0x3efd79,_0x1113de){_0x3efd79=_0x3efd79-0x0;var _0x1e024b=_0x5ac1[_0x3efd79];return _0x1e024b;};'use strict';var _=require(_0x15ac('0x0'));var util=require(_0x15ac('0x1'));var logger=require(_0x15ac('0x2'))(_0x15ac('0x3'));var moment=require(_0x15ac('0x4'));var BPromise=require(_0x15ac('0x5'));var rp=require(_0x15ac('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15ac('0x7'));var config=require('../../config/environment');var attributes=require(_0x15ac('0x8'));module['exports']=function(_0x4ebe41,_0x2618cc){return _0x4ebe41[_0x15ac('0x9')](_0x15ac('0xa'),attributes,{'tableName':'chat_proactive_actions','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 24d129a..044b313 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 _0x2575=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5982f1,_0x3f5689){var _0x3a1836=function(_0x5a4f85){while(--_0x5a4f85){_0x5982f1['push'](_0x5982f1['shift']());}};_0x3a1836(++_0x3f5689);}(_0x2575,0x1b2));var _0x5257=function(_0xcb5358,_0x46e4ee){_0xcb5358=_0xcb5358-0x0;var _0x2d70f5=_0x2575[_0xcb5358];return _0x2d70f5;};'use strict';var _=require('lodash');var util=require(_0x5257('0x0'));var moment=require(_0x5257('0x1'));var BPromise=require(_0x5257('0x2'));var rs=require(_0x5257('0x3'));var fs=require('fs');var Redis=require(_0x5257('0x4'));var db=require(_0x5257('0x5'))['db'];var utils=require(_0x5257('0x6'));var logger=require(_0x5257('0x7'))('rpc');var config=require(_0x5257('0x8'));var jayson=require(_0x5257('0x9'));var client=jayson['client'][_0x5257('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4001e6,_0x57da79,_0x450a32){return new BPromise(function(_0x408e05,_0x29713d){return client[_0x5257('0xb')](_0x4001e6,_0x450a32)[_0x5257('0xc')](function(_0x724f1b){logger[_0x5257('0xd')](_0x5257('0xe'),_0x57da79,'request\x20sent');logger[_0x5257('0xf')](_0x5257('0x10'),_0x57da79,_0x5257('0x11'),JSON['stringify'](_0x724f1b));if(_0x724f1b[_0x5257('0x12')]){if(_0x724f1b[_0x5257('0x12')]['code']===0x1f4){logger['error'](_0x5257('0xe'),_0x57da79,_0x724f1b[_0x5257('0x12')][_0x5257('0x13')]);return _0x29713d(_0x724f1b[_0x5257('0x12')][_0x5257('0x13')]);}logger['error'](_0x5257('0xe'),_0x57da79,_0x724f1b[_0x5257('0x12')][_0x5257('0x13')]);return _0x408e05(_0x724f1b[_0x5257('0x12')][_0x5257('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x57da79,_0x5257('0x11'));_0x408e05(_0x724f1b['result']['message']);}})[_0x5257('0x14')](function(_0x5b3cf7){logger[_0x5257('0x12')](_0x5257('0xe'),_0x57da79,_0x5b3cf7);_0x29713d(_0x5b3cf7);});});}
\ No newline at end of file
+var _0xb103=['client','http','request','info','request\x20sent','debug','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x37578d,_0x5dc0ee){var _0x481453=function(_0x1c34ab){while(--_0x1c34ab){_0x37578d['push'](_0x37578d['shift']());}};_0x481453(++_0x5dc0ee);}(_0xb103,0xa6));var _0x3b10=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0xb103[_0x255ac0];return _0x437bf1;};'use strict';var _=require(_0x3b10('0x0'));var util=require(_0x3b10('0x1'));var moment=require(_0x3b10('0x2'));var BPromise=require(_0x3b10('0x3'));var rs=require(_0x3b10('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b10('0x5'))['db'];var utils=require(_0x3b10('0x6'));var logger=require(_0x3b10('0x7'))(_0x3b10('0x8'));var config=require(_0x3b10('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3b10('0xa')][_0x3b10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x294c33,_0x29fe7d,_0x2bcd76){return new BPromise(function(_0x5b2ebe,_0x2aff0a){return client[_0x3b10('0xc')](_0x294c33,_0x2bcd76)['then'](function(_0x2445bc){logger[_0x3b10('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x29fe7d,_0x3b10('0xe'));logger[_0x3b10('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x29fe7d,_0x3b10('0xe'),JSON[_0x3b10('0x10')](_0x2445bc));if(_0x2445bc[_0x3b10('0x11')]){if(_0x2445bc[_0x3b10('0x11')]['code']===0x1f4){logger[_0x3b10('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x29fe7d,_0x2445bc[_0x3b10('0x11')]['message']);return _0x2aff0a(_0x2445bc[_0x3b10('0x11')][_0x3b10('0x12')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x29fe7d,_0x2445bc['error'][_0x3b10('0x12')]);return _0x5b2ebe(_0x2445bc['error'][_0x3b10('0x12')]);}else{logger[_0x3b10('0xd')](_0x3b10('0x13'),_0x29fe7d,_0x3b10('0xe'));_0x5b2ebe(_0x2445bc[_0x3b10('0x14')]['message']);}})[_0x3b10('0x15')](function(_0x4e0640){logger[_0x3b10('0x11')](_0x3b10('0x13'),_0x29fe7d,_0x4e0640);_0x2aff0a(_0x4e0640);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 33abd10..7d54896 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 _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4b016b,_0x51dc70){_0x4b016b=_0x4b016b-0x0;var _0x954c64=_0xb4c7[_0x4b016b];return _0x954c64;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router;
\ No newline at end of file
+var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2eb2,0x19f));var _0x22eb=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x2eb2[_0x34021d];return _0x16597b;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index f8aaf7c..5d3d457 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 _0xa86e=['sequelize','exports','STRING','ENUM','beepall','roundrobin'];(function(_0x13bb67,_0x6b0251){var _0xda7c4e=function(_0x3bc1b5){while(--_0x3bc1b5){_0x13bb67['push'](_0x13bb67['shift']());}};_0xda7c4e(++_0x6b0251);}(_0xa86e,0xd8));var _0xea86=function(_0x22e176,_0x55b58b){_0x22e176=_0x22e176-0x0;var _0x3f1695=_0xa86e[_0x22e176];return _0x3f1695;};'use strict';var Sequelize=require(_0xea86('0x0'));module[_0xea86('0x1')]={'name':{'type':Sequelize[_0xea86('0x2')],'unique':'name','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[_0xea86('0x3')]('rrmemory',_0xea86('0x4'),_0xea86('0x5'))}};
\ No newline at end of file
+var _0xfc47=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc47,0x136));var _0x7fc4=function(_0x4e0ab8,_0x401afb){_0x4e0ab8=_0x4e0ab8-0x0;var _0x4c1f40=_0xfc47[_0x4e0ab8];return _0x4c1f40;};'use strict';var Sequelize=require(_0x7fc4('0x0'));module[_0x7fc4('0x1')]={'name':{'type':Sequelize[_0x7fc4('0x2')],'unique':_0x7fc4('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7fc4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7fc4('0x5')](_0x7fc4('0x6'),_0x7fc4('0x7'),_0x7fc4('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index ab7b68e..1d2b90c 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 _0xd3d2=['result','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','hasOwnProperty','order','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','addTeams','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','value','transaction','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x28ef58,_0x453a5d){var _0x496d4c=function(_0xf0e0e9){while(--_0xf0e0e9){_0x28ef58['push'](_0x28ef58['shift']());}};_0x496d4c(++_0x453a5d);}(_0xd3d2,0x102));var _0x2d3d=function(_0x460188,_0x1c9626){_0x460188=_0x460188-0x0;var _0x557573=_0xd3d2[_0x460188];return _0x557573;};'use strict';var emlformat=require(_0x2d3d('0x0'));var rimraf=require(_0x2d3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d3d('0x2'));var rp=require(_0x2d3d('0x3'));var moment=require(_0x2d3d('0x4'));var BPromise=require(_0x2d3d('0x5'));var Mustache=require(_0x2d3d('0x6'));var util=require(_0x2d3d('0x7'));var path=require(_0x2d3d('0x8'));var sox=require(_0x2d3d('0x9'));var csv=require(_0x2d3d('0xa'));var ejs=require(_0x2d3d('0xb'));var fs=require('fs');var fs_extra=require(_0x2d3d('0xc'));var _=require(_0x2d3d('0xd'));var squel=require(_0x2d3d('0xe'));var crypto=require(_0x2d3d('0xf'));var jsforce=require(_0x2d3d('0x10'));var deskjs=require(_0x2d3d('0x11'));var toCsv=require(_0x2d3d('0xa'));var querystring=require(_0x2d3d('0x12'));var Papa=require(_0x2d3d('0x13'));var Redis=require(_0x2d3d('0x14'));var authService=require(_0x2d3d('0x15'));var qs=require(_0x2d3d('0x16'));var as=require(_0x2d3d('0x17'));var hardwareService=require(_0x2d3d('0x18'));var logger=require('../../config/logger')(_0x2d3d('0x19'));var utils=require(_0x2d3d('0x1a'));var config=require(_0x2d3d('0x1b'));var licenseUtil=require(_0x2d3d('0x1c'));var db=require(_0x2d3d('0x1d'))['db'];config['redis']=_['defaults'](config[_0x2d3d('0x1e')],{'host':_0x2d3d('0x1f'),'port':0x18eb});var socket=require(_0x2d3d('0x20'))(new Redis(config[_0x2d3d('0x1e')]));require(_0x2d3d('0x21'))[_0x2d3d('0x22')](socket);var jayson=require(_0x2d3d('0x23'));var client=jayson['client'][_0x2d3d('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x35150d,_0x2bda9e,_0x134167,_0x3cec33){return new BPromise(function(_0x23fe50,_0xb0bdfb){var _0x3183ec=_0x3cec33||client;return _0x3183ec[_0x2d3d('0x25')](_0x35150d,_0x134167)[_0x2d3d('0x26')](function(_0x5a4412){logger[_0x2d3d('0x27')](_0x2d3d('0x28'),_0x2bda9e,_0x2d3d('0x29'));logger[_0x2d3d('0x2a')](_0x2d3d('0x2b'),_0x2bda9e,_0x2d3d('0x29'),JSON[_0x2d3d('0x2c')](_0x5a4412));if(_0x5a4412[_0x2d3d('0x2d')]){if(_0x5a4412[_0x2d3d('0x2d')][_0x2d3d('0x2e')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2bda9e,_0x5a4412[_0x2d3d('0x2d')][_0x2d3d('0x2f')]);return _0xb0bdfb(_0x5a4412['error']['message']);}logger[_0x2d3d('0x2d')](_0x2d3d('0x28'),_0x2bda9e,_0x5a4412[_0x2d3d('0x2d')][_0x2d3d('0x2f')]);return _0x23fe50(_0x5a4412[_0x2d3d('0x2d')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2bda9e,_0x2d3d('0x29'));_0x23fe50(_0x5a4412[_0x2d3d('0x30')][_0x2d3d('0x2f')]);}})['catch'](function(_0x45672d){logger[_0x2d3d('0x2d')](_0x2d3d('0x28'),_0x2bda9e,_0x45672d);_0xb0bdfb(_0x45672d);});});}function respondWithStatusCode(_0x4b69bb,_0x435971){_0x435971=_0x435971||0xcc;return function(_0x2033e5){if(_0x2033e5){return _0x4b69bb[_0x2d3d('0x31')](_0x435971);}return _0x4b69bb[_0x2d3d('0x32')](_0x435971)['end']();};}function respondWithResult(_0x5993e3,_0x51ff1b){_0x51ff1b=_0x51ff1b||0xc8;return function(_0x56568d){if(_0x56568d){return _0x5993e3[_0x2d3d('0x32')](_0x51ff1b)['json'](_0x56568d);}};}function respondWithFilteredResult(_0x528259,_0x14dd29){return function(_0x3a9803){if(_0x3a9803){var _0x1000f1=typeof _0x14dd29[_0x2d3d('0x33')]==='undefined'&&typeof _0x14dd29[_0x2d3d('0x34')]===_0x2d3d('0x35');var _0x432673=_0x3a9803['count'];var _0x534089=_0x1000f1?0x0:_0x14dd29[_0x2d3d('0x33')];var _0x2ac503=_0x1000f1?_0x3a9803[_0x2d3d('0x36')]:_0x14dd29[_0x2d3d('0x33')]+_0x14dd29[_0x2d3d('0x34')];var _0x11c255;if(_0x2ac503>=_0x432673){_0x2ac503=_0x432673;_0x11c255=0xc8;}else{_0x11c255=0xce;}_0x528259['status'](_0x11c255);return _0x528259[_0x2d3d('0x37')](_0x2d3d('0x38'),_0x534089+'-'+_0x2ac503+'/'+_0x432673)['json'](_0x3a9803);}return null;};}function patchUpdates(_0x3cd5a7){return function(_0x2e8ff5){try{jsonpatch[_0x2d3d('0x39')](_0x2e8ff5,_0x3cd5a7,!![]);}catch(_0x725734){return BPromise['reject'](_0x725734);}return _0x2e8ff5[_0x2d3d('0x3a')]();};}function saveUpdates(_0x5436ce,_0x51c5ce){return function(_0x241a23){if(_0x241a23){return _0x241a23[_0x2d3d('0x3b')](_0x5436ce)[_0x2d3d('0x26')](function(_0x5b0373){return _0x5b0373;});}return null;};}function removeEntity(_0x3a8aef,_0x1dfe86){return function(_0x25e58a){if(_0x25e58a){return _0x25e58a[_0x2d3d('0x3c')]()[_0x2d3d('0x26')](function(){var _0xd7880a=_0x25e58a[_0x2d3d('0x3d')]({'plain':!![]});var _0x34751b=_0x2d3d('0x3e');return db[_0x2d3d('0x3f')][_0x2d3d('0x3c')]({'where':{'type':_0x34751b,'resourceId':_0xd7880a['id']}})[_0x2d3d('0x26')](function(){return _0x25e58a;});})['then'](function(){_0x3a8aef['status'](0xcc)[_0x2d3d('0x40')]();});}};}function handleEntityNotFound(_0xd93877,_0x22e054){return function(_0x5bd0c2){if(!_0x5bd0c2){_0xd93877[_0x2d3d('0x31')](0x194);}return _0x5bd0c2;};}function handleError(_0x2ceb07,_0xf36b20){_0xf36b20=_0xf36b20||0x1f4;return function(_0x271fbf){logger[_0x2d3d('0x2d')](_0x271fbf[_0x2d3d('0x41')]);if(_0x271fbf[_0x2d3d('0x42')]){delete _0x271fbf[_0x2d3d('0x42')];}_0x2ceb07[_0x2d3d('0x32')](_0xf36b20)[_0x2d3d('0x43')](_0x271fbf);};}exports[_0x2d3d('0x44')]=function(_0x3b4212,_0x33ab84){var _0x1bc897={},_0x53d4bd={},_0xd258e2={'count':0x0,'rows':[]};var _0xbe3d75=_[_0x2d3d('0x45')](db[_0x2d3d('0x46')][_0x2d3d('0x47')],function(_0x4d367f){return{'name':_0x4d367f[_0x2d3d('0x48')],'type':_0x4d367f[_0x2d3d('0x49')]['key']};});_0x53d4bd[_0x2d3d('0x4a')]=_['map'](_0xbe3d75,_0x2d3d('0x42'));_0x53d4bd['query']=_[_0x2d3d('0x4b')](_0x3b4212[_0x2d3d('0x4c')]);_0x53d4bd[_0x2d3d('0x4d')]=_[_0x2d3d('0x4e')](_0x53d4bd[_0x2d3d('0x4a')],_0x53d4bd[_0x2d3d('0x4c')]);_0x1bc897[_0x2d3d('0x4f')]=_[_0x2d3d('0x4e')](_0x53d4bd['model'],qs[_0x2d3d('0x50')](_0x3b4212[_0x2d3d('0x4c')]['fields']));_0x1bc897[_0x2d3d('0x4f')]=_0x1bc897[_0x2d3d('0x4f')]['length']?_0x1bc897[_0x2d3d('0x4f')]:_0x53d4bd[_0x2d3d('0x4a')];if(!_0x3b4212['query']['hasOwnProperty'](_0x2d3d('0x51'))){_0x1bc897[_0x2d3d('0x34')]=qs[_0x2d3d('0x34')](_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x34')]);_0x1bc897['offset']=qs['offset'](_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x33')]);}_0x1bc897['order']=qs[_0x2d3d('0x52')](_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x52')]);_0x1bc897[_0x2d3d('0x53')]=qs[_0x2d3d('0x4d')](_[_0x2d3d('0x54')](_0x3b4212[_0x2d3d('0x4c')],_0x53d4bd[_0x2d3d('0x4d')]),_0xbe3d75);if(_0x3b4212[_0x2d3d('0x4c')]['filter']){_0x1bc897[_0x2d3d('0x53')]=_[_0x2d3d('0x55')](_0x1bc897[_0x2d3d('0x53')],{'$or':_[_0x2d3d('0x45')](_0xbe3d75,function(_0x5edc17){if(_0x5edc17[_0x2d3d('0x49')]!==_0x2d3d('0x56')){var _0x401587={};_0x401587[_0x5edc17[_0x2d3d('0x42')]]={'$like':'%'+_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x57')]+'%'};return _0x401587;}})});}_0x1bc897=_[_0x2d3d('0x55')]({},_0x1bc897,_0x3b4212['options']);var _0x446573={'where':_0x1bc897[_0x2d3d('0x53')]};return db[_0x2d3d('0x46')][_0x2d3d('0x36')](_0x446573)[_0x2d3d('0x26')](function(_0x5d6082){_0xd258e2[_0x2d3d('0x36')]=_0x5d6082;if(_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x58')]){_0x1bc897['include']=[{'all':!![]}];}return db[_0x2d3d('0x46')][_0x2d3d('0x59')](_0x1bc897);})[_0x2d3d('0x26')](function(_0x1a6841){_0xd258e2[_0x2d3d('0x5a')]=_0x1a6841;return _0xd258e2;})[_0x2d3d('0x26')](respondWithFilteredResult(_0x33ab84,_0x1bc897))[_0x2d3d('0x5b')](handleError(_0x33ab84,null));};exports[_0x2d3d('0x5c')]=function(_0x164152,_0x250244){var _0x5d689d={'raw':!![],'where':{'id':_0x164152[_0x2d3d('0x5d')]['id']}},_0x7329bf={};_0x7329bf[_0x2d3d('0x4a')]=_[_0x2d3d('0x4b')](db[_0x2d3d('0x46')][_0x2d3d('0x47')]);_0x7329bf['query']=_[_0x2d3d('0x4b')](_0x164152['query']);_0x7329bf[_0x2d3d('0x4d')]=_[_0x2d3d('0x4e')](_0x7329bf[_0x2d3d('0x4a')],_0x7329bf['query']);_0x5d689d['attributes']=_[_0x2d3d('0x4e')](_0x7329bf[_0x2d3d('0x4a')],qs[_0x2d3d('0x50')](_0x164152[_0x2d3d('0x4c')]['fields']));_0x5d689d[_0x2d3d('0x4f')]=_0x5d689d[_0x2d3d('0x4f')][_0x2d3d('0x5e')]?_0x5d689d[_0x2d3d('0x4f')]:_0x7329bf[_0x2d3d('0x4a')];if(_0x164152[_0x2d3d('0x4c')][_0x2d3d('0x58')]){_0x5d689d[_0x2d3d('0x5f')]=[{'all':!![]}];}_0x5d689d=_[_0x2d3d('0x55')]({},_0x5d689d,_0x164152[_0x2d3d('0x60')]);return db[_0x2d3d('0x46')][_0x2d3d('0x61')](_0x5d689d)[_0x2d3d('0x26')](handleEntityNotFound(_0x250244,null))[_0x2d3d('0x26')](respondWithResult(_0x250244,null))[_0x2d3d('0x5b')](handleError(_0x250244,null));};exports[_0x2d3d('0x62')]=function(_0x133fbd,_0x3be331){return db['ChatQueue']['create'](_0x133fbd[_0x2d3d('0x63')],{})['then'](function(_0x559f7c){var _0x5a85f2=_0x133fbd[_0x2d3d('0x64')][_0x2d3d('0x3d')]({'plain':!![]});if(!_0x5a85f2)throw new Error(_0x2d3d('0x65'));if(_0x5a85f2[_0x2d3d('0x66')]===_0x2d3d('0x64')){var _0x5d3ab2=_0x559f7c[_0x2d3d('0x3d')]({'plain':!![]});var _0x36fe03=_0x2d3d('0x3e');return db['UserProfileSection'][_0x2d3d('0x61')]({'where':{'name':_0x36fe03,'userProfileId':_0x5a85f2[_0x2d3d('0x67')]},'raw':!![]})[_0x2d3d('0x26')](function(_0x505713){if(_0x505713&&_0x505713[_0x2d3d('0x68')]===0x0){return db['UserProfileResource']['create']({'name':_0x5d3ab2['name'],'resourceId':_0x5d3ab2['id'],'type':_0x505713[_0x2d3d('0x42')],'sectionId':_0x505713['id']},{})[_0x2d3d('0x26')](function(){return _0x559f7c;});}else{return _0x559f7c;}})[_0x2d3d('0x5b')](function(_0x452b7f){logger[_0x2d3d('0x2d')](_0x2d3d('0x69'),_0x452b7f);throw _0x452b7f;});}return _0x559f7c;})[_0x2d3d('0x26')](respondWithResult(_0x3be331,0xc9))[_0x2d3d('0x5b')](handleError(_0x3be331,null));};exports['update']=function(_0x52c294,_0x2bc6e4){if(_0x52c294[_0x2d3d('0x63')]['id']){delete _0x52c294[_0x2d3d('0x63')]['id'];}return db['ChatQueue'][_0x2d3d('0x61')]({'where':{'id':_0x52c294['params']['id']}})['then'](handleEntityNotFound(_0x2bc6e4,null))[_0x2d3d('0x26')](saveUpdates(_0x52c294[_0x2d3d('0x63')],null))[_0x2d3d('0x26')](respondWithResult(_0x2bc6e4,null))['catch'](handleError(_0x2bc6e4,null));};exports[_0x2d3d('0x3c')]=function(_0x58ed93,_0x578ee4){return db[_0x2d3d('0x46')][_0x2d3d('0x61')]({'where':{'id':_0x58ed93[_0x2d3d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x578ee4,null))['then'](removeEntity(_0x578ee4,null))[_0x2d3d('0x5b')](handleError(_0x578ee4,null));};exports[_0x2d3d('0x6a')]=function(_0x1f9834,_0x5b7dab){return db[_0x2d3d('0x46')][_0x2d3d('0x6a')]()[_0x2d3d('0x26')](respondWithResult(_0x5b7dab,null))[_0x2d3d('0x5b')](handleError(_0x5b7dab,null));};exports[_0x2d3d('0x6b')]=function(_0x21c87a,_0x48e3a5,_0x1fd45d){var _0x33010e={'raw':!![],'where':{}},_0x454c49={},_0x8202cf;return db['ChatQueue']['findOne']({'where':{'id':_0x21c87a[_0x2d3d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x48e3a5,null))[_0x2d3d('0x26')](function(_0x31cc61){if(_0x31cc61){_0x8202cf=_0x31cc61[_0x2d3d('0x3d')]({'plain':!![]});_0x454c49['model']=_[_0x2d3d('0x4b')](db[_0x2d3d('0x6c')][_0x2d3d('0x47')]);_0x454c49[_0x2d3d('0x4c')]=_[_0x2d3d('0x4b')](_0x21c87a['query']);_0x454c49['filters']=_[_0x2d3d('0x4e')](_0x454c49[_0x2d3d('0x4a')],_0x454c49[_0x2d3d('0x4c')]);_0x33010e[_0x2d3d('0x4f')]=_[_0x2d3d('0x4e')](_0x454c49['model'],qs[_0x2d3d('0x50')](_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x50')]));_0x33010e[_0x2d3d('0x4f')]=_0x33010e[_0x2d3d('0x4f')][_0x2d3d('0x5e')]?_0x33010e['attributes']:_0x454c49[_0x2d3d('0x4a')];if(!_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x6d')](_0x2d3d('0x51'))){_0x33010e[_0x2d3d('0x34')]=qs['limit'](_0x21c87a[_0x2d3d('0x4c')]['limit']);_0x33010e[_0x2d3d('0x33')]=qs['offset'](_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x33')]);}_0x33010e[_0x2d3d('0x6e')]=qs['sort'](_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x52')]);_0x33010e[_0x2d3d('0x53')]=qs[_0x2d3d('0x4d')](_[_0x2d3d('0x54')](_0x21c87a[_0x2d3d('0x4c')],_0x454c49[_0x2d3d('0x4d')]));_0x33010e[_0x2d3d('0x53')][_0x2d3d('0x6f')]=_0x31cc61['id'];if(_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x57')]){_0x33010e['where']=_['merge'](_0x33010e['where'],{'$or':_['map'](_0x33010e[_0x2d3d('0x4f')],function(_0x22a339){var _0x2f0040={};_0x2f0040[_0x22a339]={'$like':'%'+_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x57')]+'%'};return _0x2f0040;})});}_0x33010e=_['merge']({},_0x33010e,_0x21c87a[_0x2d3d('0x60')]);return db[_0x2d3d('0x6c')][_0x2d3d('0x59')](_0x33010e);}})[_0x2d3d('0x26')](function(_0x2c5fda){if(_0x2c5fda){return db[_0x2d3d('0x70')][_0x2d3d('0x71')]({'where':{'id':_['map'](_0x2c5fda,_0x2d3d('0x72')),'role':'agent'},'attributes':['id',_0x2d3d('0x42'),_0x2d3d('0x73'),_0x2d3d('0x74'),_0x2d3d('0x75')]});}})[_0x2d3d('0x26')](function(_0x22f1cc){if(_0x22f1cc){return{'count':_0x22f1cc[_0x2d3d('0x36')],'rows':_[_0x2d3d('0x45')](_0x22f1cc[_0x2d3d('0x5a')],function(_0x2a8e83){return{'membername':_0x2a8e83[_0x2d3d('0x42')],'UserId':_0x2a8e83['id'],'queue_name':_0x8202cf[_0x2d3d('0x42')],'ChatQueueId':_0x8202cf['id'],'interface':util['format']('%s/%s','SIP',_0x2a8e83['name']),'penalty':0x0,'paused':_0x2a8e83['chatPause'],'createdAt':_0x2a8e83[_0x2d3d('0x75')],'updatedAt':_0x2a8e83['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2d3d('0x26')](respondWithFilteredResult(_0x48e3a5,_0x33010e))[_0x2d3d('0x5b')](handleError(_0x48e3a5,null));};exports[_0x2d3d('0x76')]=function(_0x19c93b,_0x28a085,_0x28f68a){var _0x55083c={};var _0x2b77bd={};var _0x1aefe5;var _0x397634;return db[_0x2d3d('0x46')]['findOne']({'where':{'id':_0x19c93b[_0x2d3d('0x5d')]['id']}})[_0x2d3d('0x26')](handleEntityNotFound(_0x28a085,null))[_0x2d3d('0x26')](function(_0x2271f3){if(_0x2271f3){_0x1aefe5=_0x2271f3;_0x2b77bd[_0x2d3d('0x4a')]=_[_0x2d3d('0x4b')](db[_0x2d3d('0x77')][_0x2d3d('0x47')]);_0x2b77bd[_0x2d3d('0x4c')]=_['keys'](_0x19c93b['query']);_0x2b77bd[_0x2d3d('0x4d')]=_[_0x2d3d('0x4e')](_0x2b77bd[_0x2d3d('0x4a')],_0x2b77bd[_0x2d3d('0x4c')]);_0x55083c[_0x2d3d('0x4f')]=_['intersection'](_0x2b77bd[_0x2d3d('0x4a')],qs[_0x2d3d('0x50')](_0x19c93b['query'][_0x2d3d('0x50')]));_0x55083c['attributes']=_0x55083c[_0x2d3d('0x4f')][_0x2d3d('0x5e')]?_0x55083c[_0x2d3d('0x4f')]:_0x2b77bd[_0x2d3d('0x4a')];_0x55083c[_0x2d3d('0x6e')]=qs[_0x2d3d('0x52')](_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x52')]);_0x55083c[_0x2d3d('0x53')]=qs[_0x2d3d('0x4d')](_[_0x2d3d('0x54')](_0x19c93b[_0x2d3d('0x4c')],_0x2b77bd[_0x2d3d('0x4d')]));if(_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x57')]){_0x55083c[_0x2d3d('0x53')]=_[_0x2d3d('0x55')](_0x55083c['where'],{'$or':_['map'](_0x55083c['attributes'],function(_0x3ec72d){var _0x183701={};_0x183701[_0x3ec72d]={'$like':'%'+_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x57')]+'%'};return _0x183701;})});}_0x55083c=_[_0x2d3d('0x55')]({},_0x55083c,_0x19c93b[_0x2d3d('0x60')]);return _0x1aefe5[_0x2d3d('0x76')](_0x55083c);}})[_0x2d3d('0x26')](function(_0x418e85){if(_0x418e85){_0x397634=_0x418e85[_0x2d3d('0x5e')];if(!_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x6d')]('nolimit')){_0x55083c[_0x2d3d('0x34')]=qs['limit'](_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x34')]);_0x55083c[_0x2d3d('0x33')]=qs[_0x2d3d('0x33')](_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x33')]);}return _0x1aefe5[_0x2d3d('0x76')](_0x55083c);}})[_0x2d3d('0x26')](function(_0x935a77){if(_0x935a77){return _0x935a77?{'count':_0x397634,'rows':_0x935a77}:null;}})[_0x2d3d('0x26')](respondWithResult(_0x28a085,null))[_0x2d3d('0x5b')](handleError(_0x28a085,null));};exports['addTeams']=function(_0x1a4455,_0x37b2f6,_0x158089){var _0x3aced3=_0x1a4455[_0x2d3d('0x63')][_0x2d3d('0x78')];return db[_0x2d3d('0x77')][_0x2d3d('0x59')]({'where':{'id':_0x3aced3},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2d3d('0x79'),'attributes':['id',_0x2d3d('0x42'),_0x2d3d('0x7a'),_0x2d3d('0x7b'),_0x2d3d('0x7c')],'raw':!![]}]})[_0x2d3d('0x26')](function(_0x11d40e){if(_0x11d40e){var _0x4963b3=_['flatMap'](_0x11d40e,function(_0x1144c7){var _0x5a1e40=_0x1144c7['get']({'plain':!![]});return _0x5a1e40[_0x2d3d('0x79')];});return db[_0x2d3d('0x46')][_0x2d3d('0x61')]({'where':{'id':_0x1a4455[_0x2d3d('0x5d')]['id']}})['then'](function(_0x10b05b){return db[_0x2d3d('0x7d')]['transaction'](function(_0x1cf17c){return _0x10b05b[_0x2d3d('0x7e')](_0x3aced3,{'transaction':_0x1cf17c})[_0x2d3d('0x26')](function(){return BPromise['each'](_0x4963b3,function(_0x147c55){return db[_0x2d3d('0x6c')][_0x2d3d('0x7f')]({'where':{'UserId':_0x147c55['id'],'ChatQueueId':_0x1a4455['params']['id']},'transaction':_0x1cf17c});});})['then'](function(){_0x4963b3[_0x2d3d('0x80')](function(_0x487669){socket[_0x2d3d('0x81')]('userChatQueue:save',{'UserId':_0x487669['id'],'ChatQueueId':_0x10b05b['id']});});});});});}})[_0x2d3d('0x26')](respondWithStatusCode(_0x37b2f6,null))[_0x2d3d('0x5b')](handleError(_0x37b2f6,null));};exports[_0x2d3d('0x82')]=function(_0x3b151b,_0x373b60,_0x3544b2){return db[_0x2d3d('0x77')]['findAll']({'where':{'id':_0x3b151b[_0x2d3d('0x4c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2d3d('0x70')],'as':_0x2d3d('0x79'),'attributes':['id'],'raw':!![]}]})[_0x2d3d('0x26')](handleEntityNotFound(_0x373b60,null))['then'](function(_0x1ba51e){var _0x2d9588=_['map'](_0x1ba51e,'id');var _0x4bd3f0=[];var _0x844762=[];var _0x508bdf=squel['select']();_0x508bdf[_0x2d3d('0x83')](_0x2d3d('0x84'))['from'](_0x2d3d('0x85'),'tq')['join']('user_has_teams','ut',_0x2d3d('0x86'))[_0x2d3d('0x53')](_0x2d3d('0x87'),_0x3b151b[_0x2d3d('0x5d')]['id']);for(var _0x213e8c=0x0;_0x213e8c<_0x1ba51e[_0x2d3d('0x5e')];_0x213e8c+=0x1){let _0x167ba5=_0x1ba51e[_0x213e8c];for(var _0x554c3d=0x0;_0x554c3d<_0x167ba5[_0x2d3d('0x79')]['length'];_0x554c3d+=0x1){let _0x28af41=_0x167ba5[_0x2d3d('0x79')][_0x554c3d];var _0x3f22eb=_0x508bdf[_0x2d3d('0x88')]();_0x3f22eb[_0x2d3d('0x53')](_0x2d3d('0x89'),_0x28af41['id']);_0x844762[_0x2d3d('0x8a')](db[_0x2d3d('0x7d')]['query'](_0x3f22eb[_0x2d3d('0x8b')](),{'type':db[_0x2d3d('0x7d')]['QueryTypes'][_0x2d3d('0x8c')]})[_0x2d3d('0x26')](function(_0x2c3896){if(_0x2c3896[_0x2d3d('0x5e')]===0x1){return _0x28af41['id'];}else{var _0x4d0778=_[_0x2d3d('0x8d')](_[_0x2d3d('0x45')](_0x2c3896,'TeamId'),function(_0x1bfb4f){return _[_0x2d3d('0x8e')](_0x2d9588,_0x1bfb4f);});if(_0x4d0778){return _0x28af41['id'];}}}));}}return BPromise['all'](_0x844762)[_0x2d3d('0x26')](function(_0x1a3747){_0x4bd3f0=_(_0x4bd3f0)['union'](_0x1a3747)['compact']()[_0x2d3d('0x8f')]();return db[_0x2d3d('0x46')]['find']({'where':{'id':_0x3b151b[_0x2d3d('0x5d')]['id']}})['then'](function(_0x4353f3){return db[_0x2d3d('0x7d')][_0x2d3d('0x90')](function(_0x952ade){return _0x4353f3[_0x2d3d('0x82')](_0x3b151b['query'][_0x2d3d('0x78')],{'transaction':_0x952ade})[_0x2d3d('0x26')](function(){if(!_['isEmpty'](_0x4bd3f0)){return _0x4353f3['removeAgents'](_0x4bd3f0,{'transaction':_0x952ade});}})[_0x2d3d('0x26')](function(){_0x4bd3f0[_0x2d3d('0x80')](function(_0x57fe34){socket[_0x2d3d('0x81')](_0x2d3d('0x91'),{'UserId':_0x57fe34,'ChatQueueId':_0x4353f3['id']});});});});});});})['then'](respondWithStatusCode(_0x373b60,null))[_0x2d3d('0x5b')](handleError(_0x373b60,null));};exports[_0x2d3d('0x92')]=function(_0x1debd0,_0x12ada7,_0xcb9a4c){return db['ChatQueue'][_0x2d3d('0x61')]({'where':{'id':_0x1debd0[_0x2d3d('0x5d')]['id']}})[_0x2d3d('0x26')](handleEntityNotFound(_0x12ada7,null))['then'](function(_0x55d50d){if(_0x55d50d){return _0x55d50d[_0x2d3d('0x92')](_0x1debd0[_0x2d3d('0x63')][_0x2d3d('0x78')],_[_0x2d3d('0x93')](_0x1debd0['body'],[_0x2d3d('0x78'),'id'])||{})[_0x2d3d('0x94')](function(_0x358a47){for(var _0x397570=0x0;_0x397570<_0x1debd0[_0x2d3d('0x63')][_0x2d3d('0x78')][_0x2d3d('0x5e')];_0x397570+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x1debd0[_0x2d3d('0x63')][_0x2d3d('0x78')][_0x397570]),'ChatQueueId':Number(_0x1debd0[_0x2d3d('0x5d')]['id'])});}return _0x358a47;});}})[_0x2d3d('0x26')](respondWithResult(_0x12ada7,null))[_0x2d3d('0x5b')](handleError(_0x12ada7,null));};exports[_0x2d3d('0x95')]=function(_0x407a92,_0x113e3b,_0x15d505){return db[_0x2d3d('0x46')]['find']({'where':{'id':_0x407a92['params']['id']}})[_0x2d3d('0x26')](handleEntityNotFound(_0x113e3b,null))[_0x2d3d('0x26')](function(_0x2a1d7c){if(_0x2a1d7c){return _0x2a1d7c[_0x2d3d('0x95')](_0x407a92[_0x2d3d('0x4c')][_0x2d3d('0x78')])[_0x2d3d('0x26')](function(){if(_[_0x2d3d('0x96')](_0x407a92[_0x2d3d('0x4c')]['ids'])){for(var _0x5e2c6d=0x0;_0x5e2c6d<_0x407a92['query'][_0x2d3d('0x78')][_0x2d3d('0x5e')];_0x5e2c6d+=0x1){socket[_0x2d3d('0x81')](_0x2d3d('0x91'),{'UserId':Number(_0x407a92[_0x2d3d('0x4c')]['ids'][_0x5e2c6d]),'ChatQueueId':Number(_0x407a92[_0x2d3d('0x5d')]['id'])});}}else{socket['emit'](_0x2d3d('0x91'),{'UserId':Number(_0x407a92['query'][_0x2d3d('0x78')]),'ChatQueueId':Number(_0x407a92[_0x2d3d('0x5d')]['id'])});}});}})[_0x2d3d('0x26')](respondWithStatusCode(_0x113e3b,null))[_0x2d3d('0x5b')](handleError(_0x113e3b,null));};exports[_0x2d3d('0x97')]=function(_0xaebefc,_0x1900ea,_0x140f2){var _0xdfaa86={};var _0x2da6cf={};var _0x33e305;var _0x214ad4;return db[_0x2d3d('0x46')][_0x2d3d('0x98')]({'where':{'id':_0xaebefc[_0x2d3d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1900ea,null))[_0x2d3d('0x26')](function(_0x24430c){if(_0x24430c){_0x33e305=_0x24430c;_0x2da6cf[_0x2d3d('0x4a')]=_[_0x2d3d('0x4b')](db[_0x2d3d('0x70')][_0x2d3d('0x47')]);_0x2da6cf['query']=_[_0x2d3d('0x4b')](_0xaebefc[_0x2d3d('0x4c')]);_0x2da6cf['filters']=_[_0x2d3d('0x4e')](_0x2da6cf[_0x2d3d('0x4a')],_0x2da6cf[_0x2d3d('0x4c')]);_0xdfaa86[_0x2d3d('0x4f')]=_[_0x2d3d('0x4e')](_0x2da6cf[_0x2d3d('0x4a')],qs[_0x2d3d('0x50')](_0xaebefc[_0x2d3d('0x4c')][_0x2d3d('0x50')]));_0xdfaa86[_0x2d3d('0x4f')]=_0xdfaa86['attributes'][_0x2d3d('0x5e')]?_0xdfaa86[_0x2d3d('0x4f')]:_0x2da6cf[_0x2d3d('0x4a')];_0xdfaa86[_0x2d3d('0x6e')]=qs[_0x2d3d('0x52')](_0xaebefc[_0x2d3d('0x4c')][_0x2d3d('0x52')]);_0xdfaa86[_0x2d3d('0x53')]=qs['filters'](_['pick'](_0xaebefc['query'],_0x2da6cf['filters']));if(_0xaebefc['query'][_0x2d3d('0x57')]){_0xdfaa86[_0x2d3d('0x53')]=_[_0x2d3d('0x55')](_0xdfaa86[_0x2d3d('0x53')],{'$or':_[_0x2d3d('0x45')](_0xdfaa86[_0x2d3d('0x4f')],function(_0x8497db){var _0x54ab81={};_0x54ab81[_0x8497db]={'$like':'%'+_0xaebefc[_0x2d3d('0x4c')][_0x2d3d('0x57')]+'%'};return _0x54ab81;})});}_0xdfaa86=_[_0x2d3d('0x55')]({},_0xdfaa86,_0xaebefc[_0x2d3d('0x60')]);return _0x33e305[_0x2d3d('0x97')](_0xdfaa86);}})[_0x2d3d('0x26')](function(_0x410318){if(_0x410318){_0x214ad4=_0x410318[_0x2d3d('0x5e')];if(!_0xaebefc['query']['hasOwnProperty'](_0x2d3d('0x51'))){_0xdfaa86['limit']=qs[_0x2d3d('0x34')](_0xaebefc['query']['limit']);_0xdfaa86[_0x2d3d('0x33')]=qs['offset'](_0xaebefc[_0x2d3d('0x4c')][_0x2d3d('0x33')]);}return _0x33e305[_0x2d3d('0x97')](_0xdfaa86);}})[_0x2d3d('0x26')](function(_0x5d42af){if(_0x5d42af){return _0x5d42af?{'count':_0x214ad4,'rows':_0x5d42af}:null;}})[_0x2d3d('0x26')](respondWithResult(_0x1900ea,null))[_0x2d3d('0x5b')](handleError(_0x1900ea,null));};
\ No newline at end of file
+var _0x4311=['end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','body','describe','getMembers','hasOwnProperty','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','nolimit','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status'];(function(_0x44ee86,_0x32634e){var _0x5b79dc=function(_0x2d36c1){while(--_0x2d36c1){_0x44ee86['push'](_0x44ee86['shift']());}};_0x5b79dc(++_0x32634e);}(_0x4311,0x109));var _0x1431=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4311[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x1431('0x0'));var rimraf=require(_0x1431('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1431('0x2'));var moment=require(_0x1431('0x3'));var BPromise=require(_0x1431('0x4'));var Mustache=require('mustache');var util=require(_0x1431('0x5'));var path=require(_0x1431('0x6'));var sox=require(_0x1431('0x7'));var csv=require(_0x1431('0x8'));var ejs=require(_0x1431('0x9'));var fs=require('fs');var fs_extra=require(_0x1431('0xa'));var _=require(_0x1431('0xb'));var squel=require(_0x1431('0xc'));var crypto=require(_0x1431('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1431('0xe'));var toCsv=require(_0x1431('0x8'));var querystring=require(_0x1431('0xf'));var Papa=require(_0x1431('0x10'));var Redis=require('ioredis');var authService=require(_0x1431('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1431('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1431('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1431('0x14'));var db=require(_0x1431('0x15'))['db'];config[_0x1431('0x16')]=_[_0x1431('0x17')](config[_0x1431('0x16')],{'host':_0x1431('0x18'),'port':0x18eb});var socket=require(_0x1431('0x19'))(new Redis(config[_0x1431('0x16')]));require('./chatQueue.socket')[_0x1431('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5055f1,_0x175f3f,_0x2c1fce,_0x356f9a){return new BPromise(function(_0x256c77,_0x4aece4){var _0x20fd78=_0x356f9a||client;return _0x20fd78[_0x1431('0x1b')](_0x5055f1,_0x2c1fce)[_0x1431('0x1c')](function(_0x5bd43d){logger[_0x1431('0x1d')](_0x1431('0x1e'),_0x175f3f,_0x1431('0x1f'));logger['debug'](_0x1431('0x20'),_0x175f3f,_0x1431('0x1f'),JSON[_0x1431('0x21')](_0x5bd43d));if(_0x5bd43d[_0x1431('0x22')]){if(_0x5bd43d['error'][_0x1431('0x23')]===0x1f4){logger[_0x1431('0x22')](_0x1431('0x1e'),_0x175f3f,_0x5bd43d[_0x1431('0x22')][_0x1431('0x24')]);return _0x4aece4(_0x5bd43d['error'][_0x1431('0x24')]);}logger['error'](_0x1431('0x1e'),_0x175f3f,_0x5bd43d[_0x1431('0x22')][_0x1431('0x24')]);return _0x256c77(_0x5bd43d['error'][_0x1431('0x24')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x175f3f,_0x1431('0x1f'));_0x256c77(_0x5bd43d[_0x1431('0x25')][_0x1431('0x24')]);}})[_0x1431('0x26')](function(_0x2db013){logger[_0x1431('0x22')](_0x1431('0x1e'),_0x175f3f,_0x2db013);_0x4aece4(_0x2db013);});});}function respondWithStatusCode(_0x22ae0c,_0xeb4154){_0xeb4154=_0xeb4154||0xcc;return function(_0x44aa54){if(_0x44aa54){return _0x22ae0c[_0x1431('0x27')](_0xeb4154);}return _0x22ae0c[_0x1431('0x28')](_0xeb4154)[_0x1431('0x29')]();};}function respondWithResult(_0x373161,_0x5a3c46){_0x5a3c46=_0x5a3c46||0xc8;return function(_0x43de92){if(_0x43de92){return _0x373161['status'](_0x5a3c46)[_0x1431('0x2a')](_0x43de92);}};}function respondWithFilteredResult(_0x2e4dad,_0x1ae139){return function(_0x17d911){if(_0x17d911){var _0xa2d27a=typeof _0x1ae139[_0x1431('0x2b')]==='undefined'&&typeof _0x1ae139[_0x1431('0x2c')]===_0x1431('0x2d');var _0x3ff196=_0x17d911['count'];var _0x235664=_0xa2d27a?0x0:_0x1ae139[_0x1431('0x2b')];var _0x4fb299=_0xa2d27a?_0x17d911[_0x1431('0x2e')]:_0x1ae139['offset']+_0x1ae139[_0x1431('0x2c')];var _0x260c28;if(_0x4fb299>=_0x3ff196){_0x4fb299=_0x3ff196;_0x260c28=0xc8;}else{_0x260c28=0xce;}_0x2e4dad[_0x1431('0x28')](_0x260c28);return _0x2e4dad[_0x1431('0x2f')](_0x1431('0x30'),_0x235664+'-'+_0x4fb299+'/'+_0x3ff196)['json'](_0x17d911);}return null;};}function patchUpdates(_0x3d2555){return function(_0x2fea10){try{jsonpatch[_0x1431('0x31')](_0x2fea10,_0x3d2555,!![]);}catch(_0x289b0c){return BPromise['reject'](_0x289b0c);}return _0x2fea10[_0x1431('0x32')]();};}function saveUpdates(_0x2a953b,_0x435f3c){return function(_0x41ad59){if(_0x41ad59){return _0x41ad59[_0x1431('0x33')](_0x2a953b)['then'](function(_0x2901c9){return _0x2901c9;});}return null;};}function removeEntity(_0x18bece,_0x293aae){return function(_0x381701){if(_0x381701){return _0x381701[_0x1431('0x34')]()[_0x1431('0x1c')](function(){var _0x37d177=_0x381701['get']({'plain':!![]});var _0x3cee67=_0x1431('0x35');return db[_0x1431('0x36')][_0x1431('0x34')]({'where':{'type':_0x3cee67,'resourceId':_0x37d177['id']}})[_0x1431('0x1c')](function(){return _0x381701;});})[_0x1431('0x1c')](function(){_0x18bece['status'](0xcc)[_0x1431('0x29')]();});}};}function handleEntityNotFound(_0x2d7fd0,_0x401c0a){return function(_0xe3a545){if(!_0xe3a545){_0x2d7fd0[_0x1431('0x27')](0x194);}return _0xe3a545;};}function handleError(_0x3614d9,_0x2d4a47){_0x2d4a47=_0x2d4a47||0x1f4;return function(_0x4ce7d9){logger[_0x1431('0x22')](_0x4ce7d9[_0x1431('0x37')]);if(_0x4ce7d9[_0x1431('0x38')]){delete _0x4ce7d9[_0x1431('0x38')];}_0x3614d9[_0x1431('0x28')](_0x2d4a47)[_0x1431('0x39')](_0x4ce7d9);};}exports[_0x1431('0x3a')]=function(_0x389501,_0x10208d){var _0x3428d4={},_0x5f58fd={},_0x1bd6cc={'count':0x0,'rows':[]};var _0x396cc2=_['map'](db[_0x1431('0x3b')][_0x1431('0x3c')],function(_0x58b755){return{'name':_0x58b755[_0x1431('0x3d')],'type':_0x58b755[_0x1431('0x3e')][_0x1431('0x3f')]};});_0x5f58fd[_0x1431('0x40')]=_[_0x1431('0x41')](_0x396cc2,_0x1431('0x38'));_0x5f58fd[_0x1431('0x42')]=_[_0x1431('0x43')](_0x389501['query']);_0x5f58fd[_0x1431('0x44')]=_['intersection'](_0x5f58fd[_0x1431('0x40')],_0x5f58fd[_0x1431('0x42')]);_0x3428d4['attributes']=_[_0x1431('0x45')](_0x5f58fd[_0x1431('0x40')],qs[_0x1431('0x46')](_0x389501['query'][_0x1431('0x46')]));_0x3428d4[_0x1431('0x47')]=_0x3428d4[_0x1431('0x47')][_0x1431('0x48')]?_0x3428d4[_0x1431('0x47')]:_0x5f58fd['model'];if(!_0x389501[_0x1431('0x42')]['hasOwnProperty']('nolimit')){_0x3428d4[_0x1431('0x2c')]=qs[_0x1431('0x2c')](_0x389501['query']['limit']);_0x3428d4['offset']=qs[_0x1431('0x2b')](_0x389501[_0x1431('0x42')]['offset']);}_0x3428d4[_0x1431('0x49')]=qs[_0x1431('0x4a')](_0x389501[_0x1431('0x42')]['sort']);_0x3428d4[_0x1431('0x4b')]=qs['filters'](_[_0x1431('0x4c')](_0x389501[_0x1431('0x42')],_0x5f58fd[_0x1431('0x44')]),_0x396cc2);if(_0x389501[_0x1431('0x42')][_0x1431('0x4d')]){_0x3428d4[_0x1431('0x4b')]=_['merge'](_0x3428d4[_0x1431('0x4b')],{'$or':_['map'](_0x396cc2,function(_0x2f03d5){if(_0x2f03d5['type']!==_0x1431('0x4e')){var _0x37ac62={};_0x37ac62[_0x2f03d5[_0x1431('0x38')]]={'$like':'%'+_0x389501[_0x1431('0x42')][_0x1431('0x4d')]+'%'};return _0x37ac62;}})});}_0x3428d4=_[_0x1431('0x4f')]({},_0x3428d4,_0x389501['options']);var _0x49bd0e={'where':_0x3428d4[_0x1431('0x4b')]};return db[_0x1431('0x3b')][_0x1431('0x2e')](_0x49bd0e)[_0x1431('0x1c')](function(_0x42434b){_0x1bd6cc[_0x1431('0x2e')]=_0x42434b;if(_0x389501[_0x1431('0x42')][_0x1431('0x50')]){_0x3428d4[_0x1431('0x51')]=[{'all':!![]}];}return db[_0x1431('0x3b')][_0x1431('0x52')](_0x3428d4);})[_0x1431('0x1c')](function(_0x4ee040){_0x1bd6cc['rows']=_0x4ee040;return _0x1bd6cc;})[_0x1431('0x1c')](respondWithFilteredResult(_0x10208d,_0x3428d4))['catch'](handleError(_0x10208d,null));};exports[_0x1431('0x53')]=function(_0x5ce04c,_0x4eb727){var _0x4dad5f={'raw':!![],'where':{'id':_0x5ce04c[_0x1431('0x54')]['id']}},_0x5624da={};_0x5624da['model']=_[_0x1431('0x43')](db[_0x1431('0x3b')][_0x1431('0x3c')]);_0x5624da[_0x1431('0x42')]=_[_0x1431('0x43')](_0x5ce04c[_0x1431('0x42')]);_0x5624da[_0x1431('0x44')]=_['intersection'](_0x5624da[_0x1431('0x40')],_0x5624da['query']);_0x4dad5f['attributes']=_[_0x1431('0x45')](_0x5624da[_0x1431('0x40')],qs['fields'](_0x5ce04c['query']['fields']));_0x4dad5f['attributes']=_0x4dad5f[_0x1431('0x47')]['length']?_0x4dad5f[_0x1431('0x47')]:_0x5624da[_0x1431('0x40')];if(_0x5ce04c['query'][_0x1431('0x50')]){_0x4dad5f[_0x1431('0x51')]=[{'all':!![]}];}_0x4dad5f=_[_0x1431('0x4f')]({},_0x4dad5f,_0x5ce04c[_0x1431('0x55')]);return db[_0x1431('0x3b')][_0x1431('0x56')](_0x4dad5f)[_0x1431('0x1c')](handleEntityNotFound(_0x4eb727,null))['then'](respondWithResult(_0x4eb727,null))[_0x1431('0x26')](handleError(_0x4eb727,null));};exports[_0x1431('0x57')]=function(_0x56c2f4,_0x53ae0a){return db[_0x1431('0x3b')][_0x1431('0x57')](_0x56c2f4['body'],{})[_0x1431('0x1c')](function(_0x5c7857){var _0x5b3445=_0x56c2f4['user'][_0x1431('0x58')]({'plain':!![]});if(!_0x5b3445)throw new Error(_0x1431('0x59'));if(_0x5b3445[_0x1431('0x5a')]===_0x1431('0x5b')){var _0x2dedae=_0x5c7857[_0x1431('0x58')]({'plain':!![]});var _0x5e4f34=_0x1431('0x35');return db[_0x1431('0x5c')]['find']({'where':{'name':_0x5e4f34,'userProfileId':_0x5b3445['userProfileId']},'raw':!![]})[_0x1431('0x1c')](function(_0x37ba09){if(_0x37ba09&&_0x37ba09[_0x1431('0x5d')]===0x0){return db['UserProfileResource'][_0x1431('0x57')]({'name':_0x2dedae[_0x1431('0x38')],'resourceId':_0x2dedae['id'],'type':_0x37ba09[_0x1431('0x38')],'sectionId':_0x37ba09['id']},{})[_0x1431('0x1c')](function(){return _0x5c7857;});}else{return _0x5c7857;}})[_0x1431('0x26')](function(_0x161941){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x161941);throw _0x161941;});}return _0x5c7857;})[_0x1431('0x1c')](respondWithResult(_0x53ae0a,0xc9))[_0x1431('0x26')](handleError(_0x53ae0a,null));};exports['update']=function(_0x101ec4,_0x2192a7){if(_0x101ec4['body']['id']){delete _0x101ec4[_0x1431('0x5e')]['id'];}return db[_0x1431('0x3b')][_0x1431('0x56')]({'where':{'id':_0x101ec4[_0x1431('0x54')]['id']}})['then'](handleEntityNotFound(_0x2192a7,null))['then'](saveUpdates(_0x101ec4[_0x1431('0x5e')],null))['then'](respondWithResult(_0x2192a7,null))[_0x1431('0x26')](handleError(_0x2192a7,null));};exports['destroy']=function(_0x59b521,_0x13b3cb){return db[_0x1431('0x3b')]['find']({'where':{'id':_0x59b521[_0x1431('0x54')]['id']}})[_0x1431('0x1c')](handleEntityNotFound(_0x13b3cb,null))[_0x1431('0x1c')](removeEntity(_0x13b3cb,null))[_0x1431('0x26')](handleError(_0x13b3cb,null));};exports[_0x1431('0x5f')]=function(_0x3d1d74,_0x315372){return db[_0x1431('0x3b')][_0x1431('0x5f')]()[_0x1431('0x1c')](respondWithResult(_0x315372,null))['catch'](handleError(_0x315372,null));};exports[_0x1431('0x60')]=function(_0x220cee,_0x279fa1,_0x42ea8c){var _0x4d1048={'raw':!![],'where':{}},_0x1f9614={},_0x4d97db;return db[_0x1431('0x3b')]['findOne']({'where':{'id':_0x220cee['params']['id']}})[_0x1431('0x1c')](handleEntityNotFound(_0x279fa1,null))[_0x1431('0x1c')](function(_0xbb61b4){if(_0xbb61b4){_0x4d97db=_0xbb61b4[_0x1431('0x58')]({'plain':!![]});_0x1f9614['model']=_[_0x1431('0x43')](db['UserChatQueue'][_0x1431('0x3c')]);_0x1f9614[_0x1431('0x42')]=_['keys'](_0x220cee['query']);_0x1f9614[_0x1431('0x44')]=_[_0x1431('0x45')](_0x1f9614[_0x1431('0x40')],_0x1f9614[_0x1431('0x42')]);_0x4d1048[_0x1431('0x47')]=_[_0x1431('0x45')](_0x1f9614[_0x1431('0x40')],qs[_0x1431('0x46')](_0x220cee['query'][_0x1431('0x46')]));_0x4d1048['attributes']=_0x4d1048[_0x1431('0x47')][_0x1431('0x48')]?_0x4d1048[_0x1431('0x47')]:_0x1f9614[_0x1431('0x40')];if(!_0x220cee['query'][_0x1431('0x61')]('nolimit')){_0x4d1048[_0x1431('0x2c')]=qs[_0x1431('0x2c')](_0x220cee[_0x1431('0x42')][_0x1431('0x2c')]);_0x4d1048[_0x1431('0x2b')]=qs[_0x1431('0x2b')](_0x220cee['query'][_0x1431('0x2b')]);}_0x4d1048['order']=qs['sort'](_0x220cee['query']['sort']);_0x4d1048[_0x1431('0x4b')]=qs[_0x1431('0x44')](_[_0x1431('0x4c')](_0x220cee[_0x1431('0x42')],_0x1f9614['filters']));_0x4d1048[_0x1431('0x4b')][_0x1431('0x62')]=_0xbb61b4['id'];if(_0x220cee[_0x1431('0x42')][_0x1431('0x4d')]){_0x4d1048[_0x1431('0x4b')]=_[_0x1431('0x4f')](_0x4d1048['where'],{'$or':_[_0x1431('0x41')](_0x4d1048[_0x1431('0x47')],function(_0x59e8d5){var _0x5b864e={};_0x5b864e[_0x59e8d5]={'$like':'%'+_0x220cee[_0x1431('0x42')]['filter']+'%'};return _0x5b864e;})});}_0x4d1048=_['merge']({},_0x4d1048,_0x220cee[_0x1431('0x55')]);return db[_0x1431('0x63')][_0x1431('0x52')](_0x4d1048);}})[_0x1431('0x1c')](function(_0xb95a3c){if(_0xb95a3c){return db[_0x1431('0x64')][_0x1431('0x65')]({'where':{'id':_['map'](_0xb95a3c,_0x1431('0x66')),'role':_0x1431('0x67')},'attributes':['id',_0x1431('0x38'),_0x1431('0x68'),_0x1431('0x69'),_0x1431('0x6a')]});}})[_0x1431('0x1c')](function(_0x3ee39d){if(_0x3ee39d){return{'count':_0x3ee39d[_0x1431('0x2e')],'rows':_[_0x1431('0x41')](_0x3ee39d[_0x1431('0x6b')],function(_0x2804d9){return{'membername':_0x2804d9[_0x1431('0x38')],'UserId':_0x2804d9['id'],'queue_name':_0x4d97db['name'],'ChatQueueId':_0x4d97db['id'],'interface':util['format'](_0x1431('0x6c'),_0x1431('0x6d'),_0x2804d9[_0x1431('0x38')]),'penalty':0x0,'paused':_0x2804d9[_0x1431('0x68')],'createdAt':_0x2804d9[_0x1431('0x6a')],'updatedAt':_0x2804d9[_0x1431('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1431('0x1c')](respondWithFilteredResult(_0x279fa1,_0x4d1048))['catch'](handleError(_0x279fa1,null));};exports[_0x1431('0x6e')]=function(_0x3a6366,_0x5481c2,_0x86c36c){var _0x33de63={};var _0x3a29ec={};var _0x40f7d0;var _0x529670;return db['ChatQueue']['findOne']({'where':{'id':_0x3a6366['params']['id']}})[_0x1431('0x1c')](handleEntityNotFound(_0x5481c2,null))[_0x1431('0x1c')](function(_0x32b5f4){if(_0x32b5f4){_0x40f7d0=_0x32b5f4;_0x3a29ec[_0x1431('0x40')]=_['keys'](db[_0x1431('0x6f')]['rawAttributes']);_0x3a29ec[_0x1431('0x42')]=_[_0x1431('0x43')](_0x3a6366[_0x1431('0x42')]);_0x3a29ec[_0x1431('0x44')]=_[_0x1431('0x45')](_0x3a29ec[_0x1431('0x40')],_0x3a29ec['query']);_0x33de63[_0x1431('0x47')]=_[_0x1431('0x45')](_0x3a29ec[_0x1431('0x40')],qs[_0x1431('0x46')](_0x3a6366[_0x1431('0x42')][_0x1431('0x46')]));_0x33de63[_0x1431('0x47')]=_0x33de63[_0x1431('0x47')][_0x1431('0x48')]?_0x33de63[_0x1431('0x47')]:_0x3a29ec['model'];_0x33de63[_0x1431('0x49')]=qs[_0x1431('0x4a')](_0x3a6366['query'][_0x1431('0x4a')]);_0x33de63[_0x1431('0x4b')]=qs[_0x1431('0x44')](_[_0x1431('0x4c')](_0x3a6366[_0x1431('0x42')],_0x3a29ec['filters']));if(_0x3a6366['query'][_0x1431('0x4d')]){_0x33de63[_0x1431('0x4b')]=_[_0x1431('0x4f')](_0x33de63[_0x1431('0x4b')],{'$or':_['map'](_0x33de63[_0x1431('0x47')],function(_0x43c11c){var _0x28ed82={};_0x28ed82[_0x43c11c]={'$like':'%'+_0x3a6366[_0x1431('0x42')]['filter']+'%'};return _0x28ed82;})});}_0x33de63=_[_0x1431('0x4f')]({},_0x33de63,_0x3a6366['options']);return _0x40f7d0[_0x1431('0x6e')](_0x33de63);}})[_0x1431('0x1c')](function(_0x1351ee){if(_0x1351ee){_0x529670=_0x1351ee[_0x1431('0x48')];if(!_0x3a6366['query']['hasOwnProperty'](_0x1431('0x70'))){_0x33de63[_0x1431('0x2c')]=qs[_0x1431('0x2c')](_0x3a6366[_0x1431('0x42')][_0x1431('0x2c')]);_0x33de63[_0x1431('0x2b')]=qs[_0x1431('0x2b')](_0x3a6366['query'][_0x1431('0x2b')]);}return _0x40f7d0[_0x1431('0x6e')](_0x33de63);}})[_0x1431('0x1c')](function(_0x5e14c3){if(_0x5e14c3){return _0x5e14c3?{'count':_0x529670,'rows':_0x5e14c3}:null;}})[_0x1431('0x1c')](respondWithResult(_0x5481c2,null))['catch'](handleError(_0x5481c2,null));};exports[_0x1431('0x71')]=function(_0x504907,_0x3db37a,_0x542ba7){var _0x651d71=_0x504907[_0x1431('0x5e')][_0x1431('0x72')];return db['Team'][_0x1431('0x52')]({'where':{'id':_0x651d71},'attributes':['id'],'include':[{'model':db[_0x1431('0x64')],'as':_0x1431('0x73'),'attributes':['id','name','online',_0x1431('0x74'),_0x1431('0x75')],'raw':!![]}]})['then'](function(_0x27e6cc){if(_0x27e6cc){var _0x5c8d0b=_[_0x1431('0x76')](_0x27e6cc,function(_0x4eda78){var _0x32e1c6=_0x4eda78[_0x1431('0x58')]({'plain':!![]});return _0x32e1c6[_0x1431('0x73')];});return db[_0x1431('0x3b')][_0x1431('0x56')]({'where':{'id':_0x504907[_0x1431('0x54')]['id']}})[_0x1431('0x1c')](function(_0x111cba){return db[_0x1431('0x77')]['transaction'](function(_0xdfcf64){return _0x111cba['addTeams'](_0x651d71,{'transaction':_0xdfcf64})[_0x1431('0x1c')](function(){return BPromise['each'](_0x5c8d0b,function(_0x549f2d){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x549f2d['id'],'ChatQueueId':_0x504907[_0x1431('0x54')]['id']},'transaction':_0xdfcf64});});})[_0x1431('0x1c')](function(){_0x5c8d0b[_0x1431('0x78')](function(_0xa49cd){socket[_0x1431('0x79')](_0x1431('0x7a'),{'UserId':_0xa49cd['id'],'ChatQueueId':_0x111cba['id']});});});});});}})[_0x1431('0x1c')](respondWithStatusCode(_0x3db37a,null))[_0x1431('0x26')](handleError(_0x3db37a,null));};exports[_0x1431('0x7b')]=function(_0x19a32b,_0x21f4b6,_0x28c323){return db[_0x1431('0x6f')][_0x1431('0x52')]({'where':{'id':_0x19a32b[_0x1431('0x42')][_0x1431('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1431('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21f4b6,null))[_0x1431('0x1c')](function(_0x303e1a){var _0x196cf2=_[_0x1431('0x41')](_0x303e1a,'id');var _0x2d074b=[];var _0x15cfd0=[];var _0x134bd5=squel[_0x1431('0x7c')]();_0x134bd5[_0x1431('0x7d')](_0x1431('0x7e'))[_0x1431('0x7f')](_0x1431('0x80'),'tq')[_0x1431('0x81')]('user_has_teams','ut',_0x1431('0x82'))[_0x1431('0x4b')](_0x1431('0x83'),_0x19a32b['params']['id']);for(var _0x44d150=0x0;_0x44d150<_0x303e1a[_0x1431('0x48')];_0x44d150+=0x1){let _0xfcac92=_0x303e1a[_0x44d150];for(var _0x55edd7=0x0;_0x55edd7<_0xfcac92[_0x1431('0x73')][_0x1431('0x48')];_0x55edd7+=0x1){let _0x159bf3=_0xfcac92[_0x1431('0x73')][_0x55edd7];var _0x56d289=_0x134bd5[_0x1431('0x84')]();_0x56d289[_0x1431('0x4b')](_0x1431('0x85'),_0x159bf3['id']);_0x15cfd0[_0x1431('0x86')](db[_0x1431('0x77')][_0x1431('0x42')](_0x56d289[_0x1431('0x87')](),{'type':db['sequelize'][_0x1431('0x88')][_0x1431('0x89')]})[_0x1431('0x1c')](function(_0x59248c){if(_0x59248c['length']===0x1){return _0x159bf3['id'];}else{var _0x1bec4c=_[_0x1431('0x8a')](_[_0x1431('0x41')](_0x59248c,_0x1431('0x8b')),function(_0x339ab6){return _[_0x1431('0x8c')](_0x196cf2,_0x339ab6);});if(_0x1bec4c){return _0x159bf3['id'];}}}));}}return BPromise['all'](_0x15cfd0)[_0x1431('0x1c')](function(_0x4cc90e){_0x2d074b=_(_0x2d074b)[_0x1431('0x8d')](_0x4cc90e)[_0x1431('0x8e')]()[_0x1431('0x8f')]();return db[_0x1431('0x3b')][_0x1431('0x56')]({'where':{'id':_0x19a32b['params']['id']}})[_0x1431('0x1c')](function(_0x40199e){return db['sequelize']['transaction'](function(_0x5e633a){return _0x40199e[_0x1431('0x7b')](_0x19a32b['query'][_0x1431('0x72')],{'transaction':_0x5e633a})[_0x1431('0x1c')](function(){if(!_[_0x1431('0x90')](_0x2d074b)){return _0x40199e[_0x1431('0x91')](_0x2d074b,{'transaction':_0x5e633a});}})[_0x1431('0x1c')](function(){_0x2d074b[_0x1431('0x78')](function(_0x75af56){socket['emit'](_0x1431('0x92'),{'UserId':_0x75af56,'ChatQueueId':_0x40199e['id']});});});});});});})[_0x1431('0x1c')](respondWithStatusCode(_0x21f4b6,null))['catch'](handleError(_0x21f4b6,null));};exports[_0x1431('0x93')]=function(_0x9da62f,_0x355964,_0x57edb6){return db['ChatQueue'][_0x1431('0x56')]({'where':{'id':_0x9da62f[_0x1431('0x54')]['id']}})['then'](handleEntityNotFound(_0x355964,null))['then'](function(_0x3e85a0){if(_0x3e85a0){return _0x3e85a0[_0x1431('0x93')](_0x9da62f[_0x1431('0x5e')][_0x1431('0x72')],_[_0x1431('0x94')](_0x9da62f[_0x1431('0x5e')],[_0x1431('0x72'),'id'])||{})[_0x1431('0x95')](function(_0xffbee4){for(var _0x21688f=0x0;_0x21688f<_0x9da62f[_0x1431('0x5e')]['ids'][_0x1431('0x48')];_0x21688f+=0x1){socket['emit'](_0x1431('0x7a'),{'UserId':Number(_0x9da62f[_0x1431('0x5e')][_0x1431('0x72')][_0x21688f]),'ChatQueueId':Number(_0x9da62f[_0x1431('0x54')]['id'])});}return _0xffbee4;});}})[_0x1431('0x1c')](respondWithResult(_0x355964,null))[_0x1431('0x26')](handleError(_0x355964,null));};exports['removeAgents']=function(_0x12a55c,_0x2deb3b,_0x5a4952){return db[_0x1431('0x3b')][_0x1431('0x56')]({'where':{'id':_0x12a55c[_0x1431('0x54')]['id']}})[_0x1431('0x1c')](handleEntityNotFound(_0x2deb3b,null))[_0x1431('0x1c')](function(_0x5d5077){if(_0x5d5077){return _0x5d5077[_0x1431('0x91')](_0x12a55c['query']['ids'])['then'](function(){if(_[_0x1431('0x96')](_0x12a55c[_0x1431('0x42')][_0x1431('0x72')])){for(var _0x542e9f=0x0;_0x542e9f<_0x12a55c['query'][_0x1431('0x72')][_0x1431('0x48')];_0x542e9f+=0x1){socket[_0x1431('0x79')](_0x1431('0x92'),{'UserId':Number(_0x12a55c['query'][_0x1431('0x72')][_0x542e9f]),'ChatQueueId':Number(_0x12a55c[_0x1431('0x54')]['id'])});}}else{socket[_0x1431('0x79')]('userChatQueue:remove',{'UserId':Number(_0x12a55c[_0x1431('0x42')][_0x1431('0x72')]),'ChatQueueId':Number(_0x12a55c[_0x1431('0x54')]['id'])});}});}})[_0x1431('0x1c')](respondWithStatusCode(_0x2deb3b,null))[_0x1431('0x26')](handleError(_0x2deb3b,null));};exports[_0x1431('0x97')]=function(_0x4dffaa,_0x3f068a,_0xea0550){var _0x7d834d={};var _0x5c9df4={};var _0x325cd8;var _0x28a607;return db[_0x1431('0x3b')][_0x1431('0x98')]({'where':{'id':_0x4dffaa[_0x1431('0x54')]['id']}})['then'](handleEntityNotFound(_0x3f068a,null))['then'](function(_0x13ffe7){if(_0x13ffe7){_0x325cd8=_0x13ffe7;_0x5c9df4['model']=_[_0x1431('0x43')](db[_0x1431('0x64')][_0x1431('0x3c')]);_0x5c9df4[_0x1431('0x42')]=_[_0x1431('0x43')](_0x4dffaa[_0x1431('0x42')]);_0x5c9df4[_0x1431('0x44')]=_[_0x1431('0x45')](_0x5c9df4['model'],_0x5c9df4[_0x1431('0x42')]);_0x7d834d[_0x1431('0x47')]=_[_0x1431('0x45')](_0x5c9df4[_0x1431('0x40')],qs[_0x1431('0x46')](_0x4dffaa[_0x1431('0x42')][_0x1431('0x46')]));_0x7d834d['attributes']=_0x7d834d[_0x1431('0x47')][_0x1431('0x48')]?_0x7d834d[_0x1431('0x47')]:_0x5c9df4[_0x1431('0x40')];_0x7d834d['order']=qs['sort'](_0x4dffaa[_0x1431('0x42')]['sort']);_0x7d834d[_0x1431('0x4b')]=qs['filters'](_[_0x1431('0x4c')](_0x4dffaa[_0x1431('0x42')],_0x5c9df4[_0x1431('0x44')]));if(_0x4dffaa[_0x1431('0x42')][_0x1431('0x4d')]){_0x7d834d['where']=_[_0x1431('0x4f')](_0x7d834d[_0x1431('0x4b')],{'$or':_[_0x1431('0x41')](_0x7d834d[_0x1431('0x47')],function(_0x319a1c){var _0x28c279={};_0x28c279[_0x319a1c]={'$like':'%'+_0x4dffaa[_0x1431('0x42')][_0x1431('0x4d')]+'%'};return _0x28c279;})});}_0x7d834d=_[_0x1431('0x4f')]({},_0x7d834d,_0x4dffaa[_0x1431('0x55')]);return _0x325cd8[_0x1431('0x97')](_0x7d834d);}})[_0x1431('0x1c')](function(_0x11652e){if(_0x11652e){_0x28a607=_0x11652e['length'];if(!_0x4dffaa[_0x1431('0x42')][_0x1431('0x61')](_0x1431('0x70'))){_0x7d834d[_0x1431('0x2c')]=qs['limit'](_0x4dffaa[_0x1431('0x42')]['limit']);_0x7d834d[_0x1431('0x2b')]=qs[_0x1431('0x2b')](_0x4dffaa[_0x1431('0x42')]['offset']);}return _0x325cd8['getAgents'](_0x7d834d);}})[_0x1431('0x1c')](function(_0x5a6967){if(_0x5a6967){return _0x5a6967?{'count':_0x28a607,'rows':_0x5a6967}:null;}})[_0x1431('0x1c')](respondWithResult(_0x3f068a,null))[_0x1431('0x26')](handleError(_0x3f068a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 28139b8..5bc292c 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 _0x08bb=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x5baae8,_0x55fd88){var _0x57da04=function(_0xcd399){while(--_0xcd399){_0x5baae8['push'](_0x5baae8['shift']());}};_0x57da04(++_0x55fd88);}(_0x08bb,0x177));var _0xb08b=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x08bb[_0x1969a7];return _0x3d665f;};'use strict';var EventEmitter=require(_0xb08b('0x0'));var ChatQueue=require(_0xb08b('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb08b('0x2')](0x0);var events={'afterCreate':_0xb08b('0x3'),'afterUpdate':_0xb08b('0x4'),'afterDestroy':_0xb08b('0x5')};function emitEvent(_0x53b818){return function(_0x35b9ed,_0x3efad3,_0x39dfb3){ChatQueueEvents[_0xb08b('0x6')](_0x53b818+':'+_0x35b9ed['id'],_0x35b9ed);ChatQueueEvents[_0xb08b('0x6')](_0x53b818,_0x35b9ed);_0x39dfb3(null);};}for(var e in events){if(events[_0xb08b('0x7')](e)){var event=events[e];ChatQueue[_0xb08b('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xbb6e=['update','remove','hasOwnProperty','hook','exports','events','ChatQueue','save'];(function(_0x2f2019,_0x57d487){var _0x1a78bf=function(_0x14d40c){while(--_0x14d40c){_0x2f2019['push'](_0x2f2019['shift']());}};_0x1a78bf(++_0x57d487);}(_0xbb6e,0x115));var _0xebb6=function(_0x5099fd,_0xa0192a){_0x5099fd=_0x5099fd-0x0;var _0x38ae34=_0xbb6e[_0x5099fd];return _0x38ae34;};'use strict';var EventEmitter=require(_0xebb6('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xebb6('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xebb6('0x2'),'afterUpdate':_0xebb6('0x3'),'afterDestroy':_0xebb6('0x4')};function emitEvent(_0xfb59e3){return function(_0x3529f9,_0x3a3bc7,_0x4a5186){ChatQueueEvents['emit'](_0xfb59e3+':'+_0x3529f9['id'],_0x3529f9);ChatQueueEvents['emit'](_0xfb59e3,_0x3529f9);_0x4a5186(null);};}for(var e in events){if(events[_0xebb6('0x5')](e)){var event=events[e];ChatQueue[_0xebb6('0x6')](e,emitEvent(event));}}module[_0xebb6('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 12fa5ec..8c3357c 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 _0xe5aa=['define','ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xe5aa,0x91));var _0xae5a=function(_0x19b6fc,_0x463e57){_0x19b6fc=_0x19b6fc-0x0;var _0x4c5006=_0xe5aa[_0x19b6fc];return _0x4c5006;};'use strict';var _=require(_0xae5a('0x0'));var util=require(_0xae5a('0x1'));var logger=require(_0xae5a('0x2'))(_0xae5a('0x3'));var moment=require(_0xae5a('0x4'));var BPromise=require(_0xae5a('0x5'));var rp=require(_0xae5a('0x6'));var fs=require('fs');var path=require(_0xae5a('0x7'));var rimraf=require(_0xae5a('0x8'));var config=require('../../config/environment');var attributes=require(_0xae5a('0x9'));module[_0xae5a('0xa')]=function(_0x251b63,_0x5866ca){return _0x251b63[_0xae5a('0xb')](_0xae5a('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x244b=['request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','../../config/logger','api','moment','bluebird'];(function(_0x31afef,_0x5ae2e0){var _0x70a589=function(_0x353715){while(--_0x353715){_0x31afef['push'](_0x31afef['shift']());}};_0x70a589(++_0x5ae2e0);}(_0x244b,0x158));var _0xb244=function(_0x4ad323,_0x40e25e){_0x4ad323=_0x4ad323-0x0;var _0xe4b67d=_0x244b[_0x4ad323];return _0xe4b67d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb244('0x0'))(_0xb244('0x1'));var moment=require(_0xb244('0x2'));var BPromise=require(_0xb244('0x3'));var rp=require(_0xb244('0x4'));var fs=require('fs');var path=require(_0xb244('0x5'));var rimraf=require('rimraf');var config=require(_0xb244('0x6'));var attributes=require(_0xb244('0x7'));module[_0xb244('0x8')]=function(_0x35cf93,_0x421b16){return _0x35cf93[_0xb244('0x9')](_0xb244('0xa'),attributes,{'tableName':_0xb244('0xb'),'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 aaa262d..7e9943f 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 _0x5388=['code','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','model','map','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','defaults','redis','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','stringify','error'];(function(_0x3146c3,_0x5857ad){var _0x3c1b87=function(_0x503dae){while(--_0x503dae){_0x3146c3['push'](_0x3146c3['shift']());}};_0x3c1b87(++_0x5857ad);}(_0x5388,0xee));var _0x8538=function(_0x4e16fd,_0x28e642){_0x4e16fd=_0x4e16fd-0x0;var _0x258205=_0x5388[_0x4e16fd];return _0x258205;};'use strict';var _=require(_0x8538('0x0'));var util=require(_0x8538('0x1'));var moment=require(_0x8538('0x2'));var BPromise=require(_0x8538('0x3'));var rs=require(_0x8538('0x4'));var fs=require('fs');var Redis=require(_0x8538('0x5'));var db=require(_0x8538('0x6'))['db'];var utils=require(_0x8538('0x7'));var logger=require(_0x8538('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8538('0x9')]['http']({'port':0x232a});config['redis']=_[_0x8538('0xa')](config[_0x8538('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8538('0xc'))(new Redis(config[_0x8538('0xb')]));require('./chatQueue.socket')[_0x8538('0xd')](socket);function respondWithRpcPromise(_0x267c7d,_0x244e9e,_0x8dfc8b){return new BPromise(function(_0x14c272,_0x10f679){return client[_0x8538('0xe')](_0x267c7d,_0x8dfc8b)[_0x8538('0xf')](function(_0x17d607){logger[_0x8538('0x10')](_0x8538('0x11'),_0x244e9e,'request\x20sent');logger[_0x8538('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x244e9e,'request\x20sent',JSON[_0x8538('0x13')](_0x17d607));if(_0x17d607[_0x8538('0x14')]){if(_0x17d607[_0x8538('0x14')][_0x8538('0x15')]===0x1f4){logger[_0x8538('0x14')]('ChatQueue,\x20%s,\x20%s',_0x244e9e,_0x17d607[_0x8538('0x14')][_0x8538('0x16')]);return _0x10f679(_0x17d607[_0x8538('0x14')]['message']);}logger[_0x8538('0x14')](_0x8538('0x11'),_0x244e9e,_0x17d607['error'][_0x8538('0x16')]);return _0x14c272(_0x17d607[_0x8538('0x14')]['message']);}else{logger[_0x8538('0x10')]('ChatQueue,\x20%s,\x20%s',_0x244e9e,'request\x20sent');_0x14c272(_0x17d607[_0x8538('0x17')][_0x8538('0x16')]);}})[_0x8538('0x18')](function(_0x13551){logger[_0x8538('0x14')](_0x8538('0x11'),_0x244e9e,_0x13551);_0x10f679(_0x13551);});});}exports[_0x8538('0x19')]=function(_0x63d759){var _0x553581=this;return new Promise(function(_0x5f02ef,_0x3042eb){return db[_0x8538('0x1a')]['findAll']({'raw':_0x63d759[_0x8538('0x1b')]?_0x63d759[_0x8538('0x1b')][_0x8538('0x1c')]===undefined?!![]:![]:!![],'where':_0x63d759[_0x8538('0x1b')]?_0x63d759['options'][_0x8538('0x1d')]||null:null,'attributes':_0x63d759['options']?_0x63d759[_0x8538('0x1b')][_0x8538('0x1e')]||null:null,'limit':_0x63d759[_0x8538('0x1b')]?_0x63d759[_0x8538('0x1b')][_0x8538('0x1f')]||null:null,'include':_0x63d759[_0x8538('0x1b')]?_0x63d759[_0x8538('0x1b')]['include']?_['map'](_0x63d759[_0x8538('0x1b')][_0x8538('0x20')],function(_0x40bfef){return{'model':db[_0x40bfef[_0x8538('0x21')]],'as':_0x40bfef['as'],'attributes':_0x40bfef[_0x8538('0x1e')],'include':_0x40bfef[_0x8538('0x20')]?_[_0x8538('0x22')](_0x40bfef[_0x8538('0x20')],function(_0x5ae13f){return{'model':db[_0x5ae13f[_0x8538('0x21')]],'as':_0x5ae13f['as'],'attributes':_0x5ae13f['attributes'],'include':_0x5ae13f[_0x8538('0x20')]?_[_0x8538('0x22')](_0x5ae13f[_0x8538('0x20')],function(_0x131eb2){return{'model':db[_0x131eb2['model']],'as':_0x131eb2['as'],'attributes':_0x131eb2[_0x8538('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40ab91){logger[_0x8538('0x10')]('GetChatQueue',_0x63d759);logger[_0x8538('0x12')](_0x8538('0x19'),_0x63d759,JSON[_0x8538('0x13')](_0x40ab91));_0x5f02ef(_0x40ab91);})['catch'](function(_0x47b7ff){logger['error'](_0x8538('0x19'),_0x47b7ff[_0x8538('0x16')],_0x63d759);_0x3042eb(_0x553581['error'](0x1f4,_0x47b7ff[_0x8538('0x16')]));});});};exports[_0x8538('0x23')]=function(_0x115763){var _0x1c1ea2=this;return new Promise(function(_0x1b69ac,_0x324ebb){return db[_0x8538('0x1a')][_0x8538('0x24')]({'raw':_0x115763['options']?_0x115763[_0x8538('0x1b')][_0x8538('0x1c')]===undefined?!![]:![]:!![],'where':_0x115763[_0x8538('0x1b')]?_0x115763['options'][_0x8538('0x1d')]||null:null,'attributes':_0x115763[_0x8538('0x1b')]?_0x115763[_0x8538('0x1b')]['attributes']||null:null,'include':_0x115763[_0x8538('0x1b')]?_0x115763[_0x8538('0x1b')]['include']?_[_0x8538('0x22')](_0x115763[_0x8538('0x1b')][_0x8538('0x20')],function(_0x16a7f2){return{'model':db[_0x16a7f2[_0x8538('0x21')]],'as':_0x16a7f2['as'],'attributes':_0x16a7f2[_0x8538('0x1e')],'include':_0x16a7f2[_0x8538('0x20')]?_[_0x8538('0x22')](_0x16a7f2[_0x8538('0x20')],function(_0x551018){return{'model':db[_0x551018[_0x8538('0x21')]],'as':_0x551018['as'],'attributes':_0x551018[_0x8538('0x1e')],'include':_0x551018[_0x8538('0x20')]?_['map'](_0x551018[_0x8538('0x20')],function(_0x46b048){return{'model':db[_0x46b048[_0x8538('0x21')]],'as':_0x46b048['as'],'attributes':_0x46b048['attributes']};}):[]};}):[]};}):[]:[]})[_0x8538('0xf')](function(_0x5c7173){logger[_0x8538('0x10')](_0x8538('0x23'),_0x115763);logger['debug'](_0x8538('0x23'),_0x115763,JSON['stringify'](_0x5c7173));_0x1b69ac(_0x5c7173);})[_0x8538('0x18')](function(_0x34c256){logger[_0x8538('0x14')](_0x8538('0x23'),_0x34c256[_0x8538('0x16')],_0x115763);_0x324ebb(_0x1c1ea2['error'](0x1f4,_0x34c256[_0x8538('0x16')]));});});};
\ No newline at end of file
+var _0xfb9c=['request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetChatQueue','debug','ShowChatQueue','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s'];(function(_0x157c7b,_0x199a92){var _0x37b43e=function(_0x352a1d){while(--_0x352a1d){_0x157c7b['push'](_0x157c7b['shift']());}};_0x37b43e(++_0x199a92);}(_0xfb9c,0xb2));var _0xcfb9=function(_0x391bce,_0x4dcec1){_0x391bce=_0x391bce-0x0;var _0x14075b=_0xfb9c[_0x391bce];return _0x14075b;};'use strict';var _=require('lodash');var util=require(_0xcfb9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcfb9('0x1'));var fs=require('fs');var Redis=require(_0xcfb9('0x2'));var db=require(_0xcfb9('0x3'))['db'];var utils=require(_0xcfb9('0x4'));var logger=require(_0xcfb9('0x5'))(_0xcfb9('0x6'));var config=require(_0xcfb9('0x7'));var jayson=require(_0xcfb9('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xcfb9('0x9')]=_[_0xcfb9('0xa')](config[_0xcfb9('0x9')],{'host':_0xcfb9('0xb'),'port':0x18eb});var socket=require(_0xcfb9('0xc'))(new Redis(config[_0xcfb9('0x9')]));require('./chatQueue.socket')[_0xcfb9('0xd')](socket);function respondWithRpcPromise(_0x16621a,_0x39fed6,_0x57b0c5){return new BPromise(function(_0xe54889,_0x4857e5){return client[_0xcfb9('0xe')](_0x16621a,_0x57b0c5)['then'](function(_0x208fe2){logger[_0xcfb9('0xf')](_0xcfb9('0x10'),_0x39fed6,_0xcfb9('0x11'));logger['debug'](_0xcfb9('0x12'),_0x39fed6,'request\x20sent',JSON[_0xcfb9('0x13')](_0x208fe2));if(_0x208fe2[_0xcfb9('0x14')]){if(_0x208fe2[_0xcfb9('0x14')][_0xcfb9('0x15')]===0x1f4){logger[_0xcfb9('0x14')](_0xcfb9('0x10'),_0x39fed6,_0x208fe2['error'][_0xcfb9('0x16')]);return _0x4857e5(_0x208fe2[_0xcfb9('0x14')][_0xcfb9('0x16')]);}logger[_0xcfb9('0x14')]('ChatQueue,\x20%s,\x20%s',_0x39fed6,_0x208fe2['error'][_0xcfb9('0x16')]);return _0xe54889(_0x208fe2[_0xcfb9('0x14')][_0xcfb9('0x16')]);}else{logger[_0xcfb9('0xf')](_0xcfb9('0x10'),_0x39fed6,_0xcfb9('0x11'));_0xe54889(_0x208fe2[_0xcfb9('0x17')][_0xcfb9('0x16')]);}})[_0xcfb9('0x18')](function(_0x18cd13){logger['error'](_0xcfb9('0x10'),_0x39fed6,_0x18cd13);_0x4857e5(_0x18cd13);});});}exports['GetChatQueue']=function(_0x1a173c){var _0x1102d2=this;return new Promise(function(_0x493891,_0x4d591e){return db[_0xcfb9('0x19')][_0xcfb9('0x1a')]({'raw':_0x1a173c[_0xcfb9('0x1b')]?_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a173c['options']?_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x1d')]||null:null,'attributes':_0x1a173c[_0xcfb9('0x1b')]?_0x1a173c['options'][_0xcfb9('0x1e')]||null:null,'limit':_0x1a173c[_0xcfb9('0x1b')]?_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x1f')]||null:null,'include':_0x1a173c[_0xcfb9('0x1b')]?_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x20')],function(_0x55ad1f){return{'model':db[_0x55ad1f[_0xcfb9('0x22')]],'as':_0x55ad1f['as'],'attributes':_0x55ad1f[_0xcfb9('0x1e')],'include':_0x55ad1f[_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x55ad1f[_0xcfb9('0x20')],function(_0x1b42e0){return{'model':db[_0x1b42e0['model']],'as':_0x1b42e0['as'],'attributes':_0x1b42e0[_0xcfb9('0x1e')],'include':_0x1b42e0[_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x1b42e0[_0xcfb9('0x20')],function(_0xabf0ab){return{'model':db[_0xabf0ab[_0xcfb9('0x22')]],'as':_0xabf0ab['as'],'attributes':_0xabf0ab[_0xcfb9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcfb9('0x23')](function(_0x24295f){logger['info'](_0xcfb9('0x24'),_0x1a173c);logger[_0xcfb9('0x25')]('GetChatQueue',_0x1a173c,JSON[_0xcfb9('0x13')](_0x24295f));_0x493891(_0x24295f);})['catch'](function(_0x57a0d2){logger['error'](_0xcfb9('0x24'),_0x57a0d2[_0xcfb9('0x16')],_0x1a173c);_0x4d591e(_0x1102d2['error'](0x1f4,_0x57a0d2[_0xcfb9('0x16')]));});});};exports[_0xcfb9('0x26')]=function(_0x1d15c9){var _0x33a3fe=this;return new Promise(function(_0x1a58ba,_0x22e34e){return db['ChatQueue']['find']({'raw':_0x1d15c9['options']?_0x1d15c9[_0xcfb9('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1d15c9[_0xcfb9('0x1b')]?_0x1d15c9['options'][_0xcfb9('0x1d')]||null:null,'attributes':_0x1d15c9[_0xcfb9('0x1b')]?_0x1d15c9[_0xcfb9('0x1b')][_0xcfb9('0x1e')]||null:null,'include':_0x1d15c9[_0xcfb9('0x1b')]?_0x1d15c9['options'][_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x1d15c9['options']['include'],function(_0x3873f4){return{'model':db[_0x3873f4[_0xcfb9('0x22')]],'as':_0x3873f4['as'],'attributes':_0x3873f4[_0xcfb9('0x1e')],'include':_0x3873f4[_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x3873f4[_0xcfb9('0x20')],function(_0x1b52a7){return{'model':db[_0x1b52a7['model']],'as':_0x1b52a7['as'],'attributes':_0x1b52a7[_0xcfb9('0x1e')],'include':_0x1b52a7[_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x1b52a7[_0xcfb9('0x20')],function(_0x110cd0){return{'model':db[_0x110cd0[_0xcfb9('0x22')]],'as':_0x110cd0['as'],'attributes':_0x110cd0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x337af3){logger['info']('ShowChatQueue',_0x1d15c9);logger[_0xcfb9('0x25')](_0xcfb9('0x26'),_0x1d15c9,JSON[_0xcfb9('0x13')](_0x337af3));_0x1a58ba(_0x337af3);})[_0xcfb9('0x18')](function(_0x89d53b){logger['error'](_0xcfb9('0x26'),_0x89d53b[_0xcfb9('0x16')],_0x1d15c9);_0x22e34e(_0x33a3fe['error'](0x1f4,_0x89d53b[_0xcfb9('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 6e7dd98..63c5891 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 _0x4fdb=['removeListener','length','./chatQueue.events','save','remove','update','emit'];(function(_0x478a19,_0x2ff359){var _0x7fd2fa=function(_0x2aeb50){while(--_0x2aeb50){_0x478a19['push'](_0x478a19['shift']());}};_0x7fd2fa(++_0x2ff359);}(_0x4fdb,0x9c));var _0xb4fd=function(_0xd80198,_0xab6a0){_0xd80198=_0xd80198-0x0;var _0x54853a=_0x4fdb[_0xd80198];return _0x54853a;};'use strict';var ChatQueueEvents=require(_0xb4fd('0x0'));var events=[_0xb4fd('0x1'),_0xb4fd('0x2'),_0xb4fd('0x3')];function createListener(_0x3b399e,_0xafe34b){return function(_0x260a35){_0xafe34b[_0xb4fd('0x4')](_0x3b399e,_0x260a35);};}function removeListener(_0x1c0b08,_0x5b73bb){return function(){ChatQueueEvents[_0xb4fd('0x5')](_0x1c0b08,_0x5b73bb);};}exports['register']=function(_0x14052b){for(var _0x5d8b39=0x0,_0x53273f=events[_0xb4fd('0x6')];_0x5d8b39<_0x53273f;_0x5d8b39++){var _0x3af8e3=events[_0x5d8b39];var _0x1151b5=createListener('chatQueue:'+_0x3af8e3,_0x14052b);ChatQueueEvents['on'](_0x3af8e3,_0x1151b5);}};
\ No newline at end of file
+var _0x4b84=['./chatQueue.events','save','emit','length'];(function(_0x540d50,_0x439d8e){var _0x1005ae=function(_0x4c3a22){while(--_0x4c3a22){_0x540d50['push'](_0x540d50['shift']());}};_0x1005ae(++_0x439d8e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0x4b84[_0x3f4dd9];return _0x31c54a;};'use strict';var ChatQueueEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatQueueEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatQueue:'+_0x5947f7,_0x55f25d);ChatQueueEvents['on'](_0x5947f7,_0x3e87c5);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 6d2a47c..efea824 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x401b06,_0x4a7a8e){_0x401b06=_0x401b06-0x0;var _0x253e64=_0x3e74[_0x401b06];return _0x253e64;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x25646a,_0x21bea7){var _0x562d04=function(_0x86ce9a){while(--_0x86ce9a){_0x25646a['push'](_0x25646a['shift']());}};_0x562d04(++_0x21bea7);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 7585ff7..c63fd96 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 _0xb695=['moment','sequelize','exports','STRING','DATE'];(function(_0x289794,_0xa39495){var _0x4c9b2b=function(_0x477bac){while(--_0x477bac){_0x289794['push'](_0x289794['shift']());}};_0x4c9b2b(++_0xa39495);}(_0xb695,0x1d6));var _0x5b69=function(_0xe46fe1,_0x3f8dad){_0xe46fe1=_0xe46fe1-0x0;var _0x16c891=_0xb695[_0xe46fe1];return _0x16c891;};'use strict';var moment=require(_0x5b69('0x0'));var Sequelize=require(_0x5b69('0x1'));module[_0x5b69('0x2')]={'uniqueid':{'type':Sequelize[_0x5b69('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5b69('0x3')]},'joinAt':{'type':Sequelize[_0x5b69('0x4')]},'leaveAt':{'type':Sequelize[_0x5b69('0x4')]},'acceptAt':{'type':Sequelize[_0x5b69('0x4')]},'exitAt':{'type':Sequelize[_0x5b69('0x4')]},'reason':{'type':Sequelize[_0x5b69('0x3')]}};
\ No newline at end of file
+var _0xc01b=['DATE','moment','sequelize','exports','STRING'];(function(_0x561bd8,_0x2458de){var _0x355db5=function(_0x2d221b){while(--_0x2d221b){_0x561bd8['push'](_0x561bd8['shift']());}};_0x355db5(++_0x2458de);}(_0xc01b,0x74));var _0xbc01=function(_0x739cba,_0x2681a7){_0x739cba=_0x739cba-0x0;var _0x2d07d5=_0xc01b[_0x739cba];return _0x2d07d5;};'use strict';var moment=require(_0xbc01('0x0'));var Sequelize=require(_0xbc01('0x1'));module[_0xbc01('0x2')]={'uniqueid':{'type':Sequelize[_0xbc01('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xbc01('0x3')]},'joinAt':{'type':Sequelize[_0xbc01('0x4')]},'leaveAt':{'type':Sequelize[_0xbc01('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbc01('0x4')]},'reason':{'type':Sequelize[_0xbc01('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index bc2b45f..f496d88 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 _0xb7f0=['fields','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0x5e80a1,_0x5558fa){var _0x2290fc=function(_0x28f829){while(--_0x28f829){_0x5e80a1['push'](_0x5e80a1['shift']());}};_0x2290fc(++_0x5558fa);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x56eb89,_0xa70f63){_0x56eb89=_0x56eb89-0x0;var _0x237f9d=_0xb7f0[_0x56eb89];return _0x237f9d;};'use strict';var emlformat=require(_0x0b7f('0x0'));var rimraf=require(_0x0b7f('0x1'));var zipdir=require(_0x0b7f('0x2'));var jsonpatch=require(_0x0b7f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0b7f('0x4'));var Mustache=require(_0x0b7f('0x5'));var util=require(_0x0b7f('0x6'));var path=require(_0x0b7f('0x7'));var sox=require(_0x0b7f('0x8'));var csv=require(_0x0b7f('0x9'));var ejs=require(_0x0b7f('0xa'));var fs=require('fs');var fs_extra=require(_0x0b7f('0xb'));var _=require(_0x0b7f('0xc'));var squel=require(_0x0b7f('0xd'));var crypto=require('crypto');var jsforce=require(_0x0b7f('0xe'));var deskjs=require(_0x0b7f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0b7f('0x10'));var Papa=require(_0x0b7f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b7f('0x12'));var hardwareService=require(_0x0b7f('0x13'));var logger=require(_0x0b7f('0x14'))(_0x0b7f('0x15'));var utils=require(_0x0b7f('0x16'));var config=require(_0x0b7f('0x17'));var licenseUtil=require(_0x0b7f('0x18'));var db=require(_0x0b7f('0x19'))['db'];function respondWithStatusCode(_0x1af907,_0x34121a){_0x34121a=_0x34121a||0xcc;return function(_0x930432){if(_0x930432){return _0x1af907['sendStatus'](_0x34121a);}return _0x1af907[_0x0b7f('0x1a')](_0x34121a)[_0x0b7f('0x1b')]();};}function respondWithResult(_0x1e3f86,_0x19ddf2){_0x19ddf2=_0x19ddf2||0xc8;return function(_0x294db5){if(_0x294db5){return _0x1e3f86[_0x0b7f('0x1a')](_0x19ddf2)[_0x0b7f('0x1c')](_0x294db5);}};}function respondWithFilteredResult(_0x18069a,_0x5a2b0b){return function(_0x20e15d){if(_0x20e15d){var _0x1d223f=typeof _0x5a2b0b[_0x0b7f('0x1d')]===_0x0b7f('0x1e')&&typeof _0x5a2b0b['limit']===_0x0b7f('0x1e');var _0x3f6463=_0x20e15d[_0x0b7f('0x1f')];var _0x168e7e=_0x1d223f?0x0:_0x5a2b0b[_0x0b7f('0x1d')];var _0x50cee2=_0x1d223f?_0x20e15d[_0x0b7f('0x1f')]:_0x5a2b0b['offset']+_0x5a2b0b['limit'];var _0x36a619;if(_0x50cee2>=_0x3f6463){_0x50cee2=_0x3f6463;_0x36a619=0xc8;}else{_0x36a619=0xce;}_0x18069a[_0x0b7f('0x1a')](_0x36a619);return _0x18069a[_0x0b7f('0x20')](_0x0b7f('0x21'),_0x168e7e+'-'+_0x50cee2+'/'+_0x3f6463)[_0x0b7f('0x1c')](_0x20e15d);}return null;};}function patchUpdates(_0x52abc6){return function(_0x55362c){try{jsonpatch[_0x0b7f('0x22')](_0x55362c,_0x52abc6,!![]);}catch(_0x3ca024){return BPromise[_0x0b7f('0x23')](_0x3ca024);}return _0x55362c['save']();};}function saveUpdates(_0xb130f0,_0x1ec1d3){return function(_0x26f974){if(_0x26f974){return _0x26f974[_0x0b7f('0x24')](_0xb130f0)[_0x0b7f('0x25')](function(_0x44a0ae){return _0x44a0ae;});}return null;};}function removeEntity(_0x459389,_0x45ab0e){return function(_0xc74a5d){if(_0xc74a5d){return _0xc74a5d['destroy']()[_0x0b7f('0x25')](function(){_0x459389[_0x0b7f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50776a,_0x4a2841){return function(_0x37a5e5){if(!_0x37a5e5){_0x50776a[_0x0b7f('0x26')](0x194);}return _0x37a5e5;};}function handleError(_0x4e61be,_0xd3cb99){_0xd3cb99=_0xd3cb99||0x1f4;return function(_0x3cda59){logger[_0x0b7f('0x27')](_0x3cda59[_0x0b7f('0x28')]);if(_0x3cda59[_0x0b7f('0x29')]){delete _0x3cda59[_0x0b7f('0x29')];}_0x4e61be[_0x0b7f('0x1a')](_0xd3cb99)[_0x0b7f('0x2a')](_0x3cda59);};}exports[_0x0b7f('0x2b')]=function(_0x4ae467,_0x599bae){var _0x4ada58={},_0x3ea675={},_0x4f7e74={'count':0x0,'rows':[]};var _0x34b54c=_[_0x0b7f('0x2c')](db[_0x0b7f('0x2d')][_0x0b7f('0x2e')],function(_0x2d4727){return{'name':_0x2d4727[_0x0b7f('0x2f')],'type':_0x2d4727[_0x0b7f('0x30')]['key']};});_0x3ea675['model']=_[_0x0b7f('0x2c')](_0x34b54c,'name');_0x3ea675[_0x0b7f('0x31')]=_[_0x0b7f('0x32')](_0x4ae467[_0x0b7f('0x31')]);_0x3ea675[_0x0b7f('0x33')]=_[_0x0b7f('0x34')](_0x3ea675[_0x0b7f('0x35')],_0x3ea675[_0x0b7f('0x31')]);_0x4ada58[_0x0b7f('0x36')]=_[_0x0b7f('0x34')](_0x3ea675['model'],qs['fields'](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x37')]));_0x4ada58[_0x0b7f('0x36')]=_0x4ada58[_0x0b7f('0x36')][_0x0b7f('0x38')]?_0x4ada58[_0x0b7f('0x36')]:_0x3ea675[_0x0b7f('0x35')];if(!_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x39')]('nolimit')){_0x4ada58['limit']=qs[_0x0b7f('0x3a')](_0x4ae467['query'][_0x0b7f('0x3a')]);_0x4ada58['offset']=qs[_0x0b7f('0x1d')](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x1d')]);}_0x4ada58[_0x0b7f('0x3b')]=qs[_0x0b7f('0x3c')](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x3c')]);_0x4ada58[_0x0b7f('0x3d')]=qs[_0x0b7f('0x33')](_['pick'](_0x4ae467['query'],_0x3ea675['filters']),_0x34b54c);if(_0x4ae467[_0x0b7f('0x31')]['filter']){_0x4ada58[_0x0b7f('0x3d')]=_[_0x0b7f('0x3e')](_0x4ada58[_0x0b7f('0x3d')],{'$or':_[_0x0b7f('0x2c')](_0x34b54c,function(_0x1e2f6c){if(_0x1e2f6c['type']!==_0x0b7f('0x3f')){var _0x2eafb6={};_0x2eafb6[_0x1e2f6c[_0x0b7f('0x29')]]={'$like':'%'+_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x40')]+'%'};return _0x2eafb6;}})});}_0x4ada58=_['merge']({},_0x4ada58,_0x4ae467[_0x0b7f('0x41')]);var _0x2f5351={'where':_0x4ada58[_0x0b7f('0x3d')]};return db[_0x0b7f('0x2d')][_0x0b7f('0x1f')](_0x2f5351)[_0x0b7f('0x25')](function(_0x40b1c5){_0x4f7e74[_0x0b7f('0x1f')]=_0x40b1c5;if(_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x42')]){_0x4ada58[_0x0b7f('0x43')]=[{'all':!![]}];}return db[_0x0b7f('0x2d')][_0x0b7f('0x44')](_0x4ada58);})['then'](function(_0x4aaf15){_0x4f7e74[_0x0b7f('0x45')]=_0x4aaf15;return _0x4f7e74;})[_0x0b7f('0x25')](respondWithFilteredResult(_0x599bae,_0x4ada58))[_0x0b7f('0x46')](handleError(_0x599bae,null));};exports[_0x0b7f('0x47')]=function(_0x2c25fc,_0x230c6b){var _0x57c147={'raw':!![],'where':{'id':_0x2c25fc[_0x0b7f('0x48')]['id']}},_0x2176c6={};_0x2176c6[_0x0b7f('0x35')]=_[_0x0b7f('0x32')](db['ChatQueueReport'][_0x0b7f('0x2e')]);_0x2176c6['query']=_[_0x0b7f('0x32')](_0x2c25fc[_0x0b7f('0x31')]);_0x2176c6[_0x0b7f('0x33')]=_[_0x0b7f('0x34')](_0x2176c6[_0x0b7f('0x35')],_0x2176c6['query']);_0x57c147[_0x0b7f('0x36')]=_[_0x0b7f('0x34')](_0x2176c6[_0x0b7f('0x35')],qs[_0x0b7f('0x37')](_0x2c25fc[_0x0b7f('0x31')][_0x0b7f('0x37')]));_0x57c147[_0x0b7f('0x36')]=_0x57c147[_0x0b7f('0x36')][_0x0b7f('0x38')]?_0x57c147[_0x0b7f('0x36')]:_0x2176c6[_0x0b7f('0x35')];if(_0x2c25fc[_0x0b7f('0x31')][_0x0b7f('0x42')]){_0x57c147['include']=[{'all':!![]}];}_0x57c147=_[_0x0b7f('0x3e')]({},_0x57c147,_0x2c25fc[_0x0b7f('0x41')]);return db[_0x0b7f('0x2d')][_0x0b7f('0x49')](_0x57c147)[_0x0b7f('0x25')](handleEntityNotFound(_0x230c6b,null))[_0x0b7f('0x25')](respondWithResult(_0x230c6b,null))[_0x0b7f('0x46')](handleError(_0x230c6b,null));};exports['create']=function(_0x4d432b,_0x562843){return db[_0x0b7f('0x2d')][_0x0b7f('0x4a')](_0x4d432b['body'],{})[_0x0b7f('0x25')](respondWithResult(_0x562843,0xc9))[_0x0b7f('0x46')](handleError(_0x562843,null));};exports['update']=function(_0x2469e2,_0x4a825c){if(_0x2469e2[_0x0b7f('0x4b')]['id']){delete _0x2469e2['body']['id'];}return db[_0x0b7f('0x2d')][_0x0b7f('0x49')]({'where':{'id':_0x2469e2[_0x0b7f('0x48')]['id']}})[_0x0b7f('0x25')](handleEntityNotFound(_0x4a825c,null))[_0x0b7f('0x25')](saveUpdates(_0x2469e2[_0x0b7f('0x4b')],null))[_0x0b7f('0x25')](respondWithResult(_0x4a825c,null))[_0x0b7f('0x46')](handleError(_0x4a825c,null));};exports[_0x0b7f('0x4c')]=function(_0x3cfa81,_0x23e3ef){return db[_0x0b7f('0x2d')][_0x0b7f('0x49')]({'where':{'id':_0x3cfa81[_0x0b7f('0x48')]['id']}})['then'](handleEntityNotFound(_0x23e3ef,null))[_0x0b7f('0x25')](removeEntity(_0x23e3ef,null))[_0x0b7f('0x46')](handleError(_0x23e3ef,null));};exports[_0x0b7f('0x4d')]=function(_0xe820e0,_0xbad1cd){return db[_0x0b7f('0x2d')]['describe']()[_0x0b7f('0x25')](respondWithResult(_0xbad1cd,null))['catch'](handleError(_0xbad1cd,null));};
\ No newline at end of file
+var _0x18af=['sox','to-csv','fs-extra','lodash','squel','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','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','show','length','options','find','catch','create','body','describe','eml-format','zip-dir','request-promise','util','path'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x18af,0x8b));var _0xf18a=function(_0x5329cd,_0x40c336){_0x5329cd=_0x5329cd-0x0;var _0x5d4285=_0x18af[_0x5329cd];return _0x5d4285;};'use strict';var emlformat=require(_0xf18a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf18a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf18a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf18a('0x3'));var path=require(_0xf18a('0x4'));var sox=require(_0xf18a('0x5'));var csv=require(_0xf18a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf18a('0x7'));var _=require(_0xf18a('0x8'));var squel=require(_0xf18a('0x9'));var crypto=require('crypto');var jsforce=require(_0xf18a('0xa'));var deskjs=require(_0xf18a('0xb'));var toCsv=require(_0xf18a('0x6'));var querystring=require(_0xf18a('0xc'));var Papa=require(_0xf18a('0xd'));var Redis=require(_0xf18a('0xe'));var authService=require(_0xf18a('0xf'));var qs=require(_0xf18a('0x10'));var as=require(_0xf18a('0x11'));var hardwareService=require(_0xf18a('0x12'));var logger=require(_0xf18a('0x13'))(_0xf18a('0x14'));var utils=require(_0xf18a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf18a('0x16'));var db=require(_0xf18a('0x17'))['db'];function respondWithStatusCode(_0x252333,_0x12c907){_0x12c907=_0x12c907||0xcc;return function(_0x18901a){if(_0x18901a){return _0x252333['sendStatus'](_0x12c907);}return _0x252333[_0xf18a('0x18')](_0x12c907)[_0xf18a('0x19')]();};}function respondWithResult(_0x4bfc63,_0x13b3cd){_0x13b3cd=_0x13b3cd||0xc8;return function(_0x5a06b5){if(_0x5a06b5){return _0x4bfc63[_0xf18a('0x18')](_0x13b3cd)[_0xf18a('0x1a')](_0x5a06b5);}};}function respondWithFilteredResult(_0x52dc2c,_0x1f35a4){return function(_0x5f2973){if(_0x5f2973){var _0x39fe13=typeof _0x1f35a4[_0xf18a('0x1b')]==='undefined'&&typeof _0x1f35a4['limit']===_0xf18a('0x1c');var _0x23c8f1=_0x5f2973['count'];var _0x5e3da3=_0x39fe13?0x0:_0x1f35a4[_0xf18a('0x1b')];var _0x1aff7c=_0x39fe13?_0x5f2973[_0xf18a('0x1d')]:_0x1f35a4['offset']+_0x1f35a4[_0xf18a('0x1e')];var _0x4a348e;if(_0x1aff7c>=_0x23c8f1){_0x1aff7c=_0x23c8f1;_0x4a348e=0xc8;}else{_0x4a348e=0xce;}_0x52dc2c[_0xf18a('0x18')](_0x4a348e);return _0x52dc2c[_0xf18a('0x1f')]('Content-Range',_0x5e3da3+'-'+_0x1aff7c+'/'+_0x23c8f1)[_0xf18a('0x1a')](_0x5f2973);}return null;};}function patchUpdates(_0x340d94){return function(_0x533acb){try{jsonpatch[_0xf18a('0x20')](_0x533acb,_0x340d94,!![]);}catch(_0x42854d){return BPromise[_0xf18a('0x21')](_0x42854d);}return _0x533acb['save']();};}function saveUpdates(_0x516e7f,_0x43a50a){return function(_0x4438ed){if(_0x4438ed){return _0x4438ed[_0xf18a('0x22')](_0x516e7f)[_0xf18a('0x23')](function(_0x1ad933){return _0x1ad933;});}return null;};}function removeEntity(_0x23d2a7,_0x112466){return function(_0x304bd4){if(_0x304bd4){return _0x304bd4[_0xf18a('0x24')]()['then'](function(){_0x23d2a7[_0xf18a('0x18')](0xcc)[_0xf18a('0x19')]();});}};}function handleEntityNotFound(_0x179b4e,_0x30609e){return function(_0x5dd917){if(!_0x5dd917){_0x179b4e[_0xf18a('0x25')](0x194);}return _0x5dd917;};}function handleError(_0x277677,_0x32c040){_0x32c040=_0x32c040||0x1f4;return function(_0x4f540d){logger[_0xf18a('0x26')](_0x4f540d[_0xf18a('0x27')]);if(_0x4f540d[_0xf18a('0x28')]){delete _0x4f540d[_0xf18a('0x28')];}_0x277677['status'](_0x32c040)[_0xf18a('0x29')](_0x4f540d);};}exports[_0xf18a('0x2a')]=function(_0x53ba5b,_0x49efea){var _0xa8e81c={},_0x14183c={},_0x7e668c={'count':0x0,'rows':[]};var _0xdc0fe9=_['map'](db[_0xf18a('0x2b')][_0xf18a('0x2c')],function(_0x3a70a2){return{'name':_0x3a70a2[_0xf18a('0x2d')],'type':_0x3a70a2[_0xf18a('0x2e')][_0xf18a('0x2f')]};});_0x14183c['model']=_['map'](_0xdc0fe9,_0xf18a('0x28'));_0x14183c[_0xf18a('0x30')]=_[_0xf18a('0x31')](_0x53ba5b['query']);_0x14183c['filters']=_[_0xf18a('0x32')](_0x14183c[_0xf18a('0x33')],_0x14183c[_0xf18a('0x30')]);_0xa8e81c[_0xf18a('0x34')]=_[_0xf18a('0x32')](_0x14183c[_0xf18a('0x33')],qs['fields'](_0x53ba5b[_0xf18a('0x30')][_0xf18a('0x35')]));_0xa8e81c['attributes']=_0xa8e81c[_0xf18a('0x34')]['length']?_0xa8e81c[_0xf18a('0x34')]:_0x14183c[_0xf18a('0x33')];if(!_0x53ba5b['query']['hasOwnProperty'](_0xf18a('0x36'))){_0xa8e81c[_0xf18a('0x1e')]=qs[_0xf18a('0x1e')](_0x53ba5b[_0xf18a('0x30')]['limit']);_0xa8e81c[_0xf18a('0x1b')]=qs[_0xf18a('0x1b')](_0x53ba5b['query'][_0xf18a('0x1b')]);}_0xa8e81c[_0xf18a('0x37')]=qs[_0xf18a('0x38')](_0x53ba5b['query']['sort']);_0xa8e81c[_0xf18a('0x39')]=qs[_0xf18a('0x3a')](_[_0xf18a('0x3b')](_0x53ba5b[_0xf18a('0x30')],_0x14183c[_0xf18a('0x3a')]),_0xdc0fe9);if(_0x53ba5b[_0xf18a('0x30')][_0xf18a('0x3c')]){_0xa8e81c[_0xf18a('0x39')]=_[_0xf18a('0x3d')](_0xa8e81c[_0xf18a('0x39')],{'$or':_['map'](_0xdc0fe9,function(_0x409c31){if(_0x409c31[_0xf18a('0x2e')]!=='VIRTUAL'){var _0x34dd7a={};_0x34dd7a[_0x409c31['name']]={'$like':'%'+_0x53ba5b[_0xf18a('0x30')][_0xf18a('0x3c')]+'%'};return _0x34dd7a;}})});}_0xa8e81c=_[_0xf18a('0x3d')]({},_0xa8e81c,_0x53ba5b['options']);var _0x366399={'where':_0xa8e81c[_0xf18a('0x39')]};return db['ChatQueueReport'][_0xf18a('0x1d')](_0x366399)[_0xf18a('0x23')](function(_0x278b77){_0x7e668c['count']=_0x278b77;if(_0x53ba5b['query'][_0xf18a('0x3e')]){_0xa8e81c[_0xf18a('0x3f')]=[{'all':!![]}];}return db[_0xf18a('0x2b')]['findAll'](_0xa8e81c);})[_0xf18a('0x23')](function(_0x1ddbeb){_0x7e668c['rows']=_0x1ddbeb;return _0x7e668c;})[_0xf18a('0x23')](respondWithFilteredResult(_0x49efea,_0xa8e81c))['catch'](handleError(_0x49efea,null));};exports[_0xf18a('0x40')]=function(_0x2d77d2,_0x356646){var _0x19d080={'raw':!![],'where':{'id':_0x2d77d2['params']['id']}},_0x8564e4={};_0x8564e4[_0xf18a('0x33')]=_[_0xf18a('0x31')](db[_0xf18a('0x2b')][_0xf18a('0x2c')]);_0x8564e4[_0xf18a('0x30')]=_[_0xf18a('0x31')](_0x2d77d2[_0xf18a('0x30')]);_0x8564e4['filters']=_[_0xf18a('0x32')](_0x8564e4[_0xf18a('0x33')],_0x8564e4[_0xf18a('0x30')]);_0x19d080[_0xf18a('0x34')]=_[_0xf18a('0x32')](_0x8564e4['model'],qs[_0xf18a('0x35')](_0x2d77d2[_0xf18a('0x30')]['fields']));_0x19d080[_0xf18a('0x34')]=_0x19d080[_0xf18a('0x34')][_0xf18a('0x41')]?_0x19d080[_0xf18a('0x34')]:_0x8564e4[_0xf18a('0x33')];if(_0x2d77d2['query']['includeAll']){_0x19d080['include']=[{'all':!![]}];}_0x19d080=_['merge']({},_0x19d080,_0x2d77d2[_0xf18a('0x42')]);return db[_0xf18a('0x2b')][_0xf18a('0x43')](_0x19d080)[_0xf18a('0x23')](handleEntityNotFound(_0x356646,null))[_0xf18a('0x23')](respondWithResult(_0x356646,null))[_0xf18a('0x44')](handleError(_0x356646,null));};exports[_0xf18a('0x45')]=function(_0x50e1c0,_0x2410b5){return db[_0xf18a('0x2b')]['create'](_0x50e1c0[_0xf18a('0x46')],{})[_0xf18a('0x23')](respondWithResult(_0x2410b5,0xc9))[_0xf18a('0x44')](handleError(_0x2410b5,null));};exports[_0xf18a('0x22')]=function(_0xad78b2,_0x3688e0){if(_0xad78b2[_0xf18a('0x46')]['id']){delete _0xad78b2['body']['id'];}return db[_0xf18a('0x2b')][_0xf18a('0x43')]({'where':{'id':_0xad78b2['params']['id']}})[_0xf18a('0x23')](handleEntityNotFound(_0x3688e0,null))[_0xf18a('0x23')](saveUpdates(_0xad78b2[_0xf18a('0x46')],null))[_0xf18a('0x23')](respondWithResult(_0x3688e0,null))['catch'](handleError(_0x3688e0,null));};exports[_0xf18a('0x24')]=function(_0x183448,_0xccde4){return db[_0xf18a('0x2b')][_0xf18a('0x43')]({'where':{'id':_0x183448['params']['id']}})[_0xf18a('0x23')](handleEntityNotFound(_0xccde4,null))[_0xf18a('0x23')](removeEntity(_0xccde4,null))[_0xf18a('0x44')](handleError(_0xccde4,null));};exports[_0xf18a('0x47')]=function(_0x3645c2,_0x2b2a4d){return db[_0xf18a('0x2b')][_0xf18a('0x47')]()[_0xf18a('0x23')](respondWithResult(_0x2b2a4d,null))[_0xf18a('0x44')](handleError(_0x2b2a4d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 9dec065..bde68a5 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x4bcf38,_0x3c12be){var _0x4a89be=function(_0x3215a6){while(--_0x3215a6){_0x4bcf38['push'](_0x4bcf38['shift']());}};_0x4a89be(++_0x3c12be);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x55bfd6,_0xdfa6ce){var _0x5e9f68=function(_0x34c77c){while(--_0x34c77c){_0x55bfd6['push'](_0x55bfd6['shift']());}};_0x5e9f68(++_0xdfa6ce);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index d694e56..afc4a81 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 _0x1101=['../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','body','catch','UpdateChatQueueReport','ChatQueueReport','update','options','raw','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x135720,_0x182012){var _0x89c4d2=function(_0x35c57d){while(--_0x35c57d){_0x135720['push'](_0x135720['shift']());}};_0x89c4d2(++_0x182012);}(_0x1101,0x99));var _0x1110=function(_0x4a25d7,_0x15be45){_0x4a25d7=_0x4a25d7-0x0;var _0x40d155=_0x1101[_0x4a25d7];return _0x40d155;};'use strict';var _=require(_0x1110('0x0'));var util=require('util');var moment=require(_0x1110('0x1'));var BPromise=require(_0x1110('0x2'));var rs=require(_0x1110('0x3'));var fs=require('fs');var Redis=require(_0x1110('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1110('0x5'));var logger=require(_0x1110('0x6'))('rpc');var config=require(_0x1110('0x7'));var jayson=require(_0x1110('0x8'));var client=jayson['client'][_0x1110('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x544fff,_0x76bdc0,_0x4372d4){return new BPromise(function(_0x509c14,_0x22c4db){return client[_0x1110('0xa')](_0x544fff,_0x4372d4)[_0x1110('0xb')](function(_0x476e9e){logger[_0x1110('0xc')](_0x1110('0xd'),_0x76bdc0,_0x1110('0xe'));logger[_0x1110('0xf')](_0x1110('0x10'),_0x76bdc0,_0x1110('0xe'),JSON[_0x1110('0x11')](_0x476e9e));if(_0x476e9e[_0x1110('0x12')]){if(_0x476e9e[_0x1110('0x12')][_0x1110('0x13')]===0x1f4){logger[_0x1110('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x76bdc0,_0x476e9e[_0x1110('0x12')][_0x1110('0x14')]);return _0x22c4db(_0x476e9e[_0x1110('0x12')][_0x1110('0x14')]);}logger[_0x1110('0x12')](_0x1110('0xd'),_0x76bdc0,_0x476e9e['error'][_0x1110('0x14')]);return _0x509c14(_0x476e9e[_0x1110('0x12')][_0x1110('0x14')]);}else{logger[_0x1110('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x76bdc0,_0x1110('0xe'));_0x509c14(_0x476e9e[_0x1110('0x15')][_0x1110('0x14')]);}})['catch'](function(_0x13621b){logger[_0x1110('0x12')](_0x1110('0xd'),_0x76bdc0,_0x13621b);_0x22c4db(_0x13621b);});});}exports[_0x1110('0x16')]=function(_0x102287){var _0x52a83e=this;return new Promise(function(_0x2345af,_0x1f7d82){return db['ChatQueueReport']['create'](_0x102287[_0x1110('0x17')],{'raw':_0x102287['options']?_0x102287['options']['raw']===undefined?!![]:![]:!![]})[_0x1110('0xb')](function(_0x577863){logger[_0x1110('0xc')](_0x1110('0x16'),_0x102287);logger[_0x1110('0xf')](_0x1110('0x16'),_0x102287,JSON[_0x1110('0x11')](_0x577863));_0x2345af(_0x577863);})[_0x1110('0x18')](function(_0x61a5b2){logger['error']('CreateChatQueueReport',_0x61a5b2[_0x1110('0x14')],_0x102287);_0x1f7d82(_0x52a83e[_0x1110('0x12')](0x1f4,_0x61a5b2[_0x1110('0x14')]));});});};exports[_0x1110('0x19')]=function(_0x341097){var _0x18d057=this;return new Promise(function(_0x47d3d5,_0xd185c9){return db[_0x1110('0x1a')][_0x1110('0x1b')](_0x341097['body'],{'raw':_0x341097[_0x1110('0x1c')]?_0x341097[_0x1110('0x1c')][_0x1110('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x341097[_0x1110('0x1c')]?_0x341097['options'][_0x1110('0x1e')]||null:null,'attributes':_0x341097[_0x1110('0x1c')]?_0x341097[_0x1110('0x1c')]['attributes']||null:null,'limit':_0x341097[_0x1110('0x1c')]?_0x341097['options'][_0x1110('0x1f')]||null:null})['then'](function(_0x1814c3){logger[_0x1110('0xc')]('UpdateChatQueueReport',_0x341097);logger[_0x1110('0xf')]('UpdateChatQueueReport',_0x341097,JSON[_0x1110('0x11')](_0x1814c3));_0x47d3d5(_0x1814c3);})[_0x1110('0x18')](function(_0x3d10c0){logger[_0x1110('0x12')](_0x1110('0x19'),_0x3d10c0[_0x1110('0x14')],_0x341097);_0xd185c9(_0x18d057['error'](0x1f4,_0x3d10c0[_0x1110('0x14')]));});});};
\ No newline at end of file
+var _0x69af=['where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateChatQueueReport','ChatQueueReport','options','raw','debug','UpdateChatQueueReport','update'];(function(_0x1817e5,_0x5c6b3d){var _0x2dc10c=function(_0x11eff6){while(--_0x11eff6){_0x1817e5['push'](_0x1817e5['shift']());}};_0x2dc10c(++_0x5c6b3d);}(_0x69af,0x17b));var _0xf69a=function(_0x54cbe4,_0x1ecfe8){_0x54cbe4=_0x54cbe4-0x0;var _0x4eba52=_0x69af[_0x54cbe4];return _0x4eba52;};'use strict';var _=require('lodash');var util=require(_0xf69a('0x0'));var moment=require(_0xf69a('0x1'));var BPromise=require(_0xf69a('0x2'));var rs=require(_0xf69a('0x3'));var fs=require('fs');var Redis=require(_0xf69a('0x4'));var db=require(_0xf69a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf69a('0x6'))(_0xf69a('0x7'));var config=require(_0xf69a('0x8'));var jayson=require(_0xf69a('0x9'));var client=jayson[_0xf69a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10c1b0,_0x3669ef,_0xb0233d){return new BPromise(function(_0x4ffe11,_0x4a3496){return client[_0xf69a('0xb')](_0x10c1b0,_0xb0233d)[_0xf69a('0xc')](function(_0x16a06e){logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,'request\x20sent');logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3669ef,_0xf69a('0xf'),JSON[_0xf69a('0x10')](_0x16a06e));if(_0x16a06e[_0xf69a('0x11')]){if(_0x16a06e[_0xf69a('0x11')]['code']===0x1f4){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4a3496(_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);}logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4ffe11(_0x16a06e['error'][_0xf69a('0x12')]);}else{logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,_0xf69a('0xf'));_0x4ffe11(_0x16a06e['result'][_0xf69a('0x12')]);}})[_0xf69a('0x13')](function(_0x17660b){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x17660b);_0x4a3496(_0x17660b);});});}exports[_0xf69a('0x14')]=function(_0x272ad5){var _0x4b44b6=this;return new Promise(function(_0x495b1e,_0x567906){return db[_0xf69a('0x15')]['create'](_0x272ad5['body'],{'raw':_0x272ad5['options']?_0x272ad5[_0xf69a('0x16')][_0xf69a('0x17')]===undefined?!![]:![]:!![]})[_0xf69a('0xc')](function(_0x39c67a){logger['info']('CreateChatQueueReport',_0x272ad5);logger[_0xf69a('0x18')](_0xf69a('0x14'),_0x272ad5,JSON[_0xf69a('0x10')](_0x39c67a));_0x495b1e(_0x39c67a);})[_0xf69a('0x13')](function(_0xdb0def){logger[_0xf69a('0x11')](_0xf69a('0x14'),_0xdb0def[_0xf69a('0x12')],_0x272ad5);_0x567906(_0x4b44b6['error'](0x1f4,_0xdb0def[_0xf69a('0x12')]));});});};exports[_0xf69a('0x19')]=function(_0x223fea){var _0x39111e=this;return new Promise(function(_0x2033c6,_0x451c92){return db[_0xf69a('0x15')][_0xf69a('0x1a')](_0x223fea['body'],{'raw':_0x223fea[_0xf69a('0x16')]?_0x223fea['options'][_0xf69a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x223fea[_0xf69a('0x16')]?_0x223fea[_0xf69a('0x16')][_0xf69a('0x1b')]||null:null,'attributes':_0x223fea[_0xf69a('0x16')]?_0x223fea[_0xf69a('0x16')][_0xf69a('0x1c')]||null:null,'limit':_0x223fea[_0xf69a('0x16')]?_0x223fea[_0xf69a('0x16')]['limit']||null:null})['then'](function(_0x179040){logger['info']('UpdateChatQueueReport',_0x223fea);logger[_0xf69a('0x18')]('UpdateChatQueueReport',_0x223fea,JSON['stringify'](_0x179040));_0x2033c6(_0x179040);})[_0xf69a('0x13')](function(_0x431284){logger[_0xf69a('0x11')](_0xf69a('0x19'),_0x431284[_0xf69a('0x12')],_0x223fea);_0x451c92(_0x39111e[_0xf69a('0x11')](0x1f4,_0x431284[_0xf69a('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index c928de6..b4031f0 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 _0xbae7=['create','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x39064b,_0xda908a){var _0x42d2c1=function(_0xa5c9e6){while(--_0xa5c9e6){_0x39064b['push'](_0x39064b['shift']());}};_0x42d2c1(++_0xda908a);}(_0xbae7,0x1bd));var _0x7bae=function(_0x822c2c,_0x3c76b1){_0x822c2c=_0x822c2c-0x0;var _0x4d43a4=_0xbae7[_0x822c2c];return _0x4d43a4;};'use strict';var multer=require(_0x7bae('0x0'));var util=require(_0x7bae('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7bae('0x2'));var router=express[_0x7bae('0x3')]();var fs_extra=require(_0x7bae('0x4'));var auth=require(_0x7bae('0x5'));var interaction=require(_0x7bae('0x6'));var config=require(_0x7bae('0x7'));var controller=require(_0x7bae('0x8'));router[_0x7bae('0x9')]('/',auth['isAuthenticated'](),controller[_0x7bae('0xa')]);router[_0x7bae('0x9')](_0x7bae('0xb'),auth[_0x7bae('0xc')](),controller[_0x7bae('0xd')]);router[_0x7bae('0x9')]('/:id',auth[_0x7bae('0xc')](),controller[_0x7bae('0xe')]);router['post']('/',auth[_0x7bae('0xc')](),controller[_0x7bae('0xf')]);router['put'](_0x7bae('0x10'),auth['isAuthenticated'](),controller[_0x7bae('0x11')]);router['delete'](_0x7bae('0x10'),auth[_0x7bae('0xc')](),controller[_0x7bae('0x12')]);module[_0x7bae('0x13')]=router;
\ No newline at end of file
+var _0x4acb=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','/:id','destroy','multer','util'];(function(_0x246568,_0x57af04){var _0x19b302=function(_0x4ae034){while(--_0x4ae034){_0x246568['push'](_0x246568['shift']());}};_0x19b302(++_0x57af04);}(_0x4acb,0x67));var _0xb4ac=function(_0x448047,_0x1914c0){_0x448047=_0x448047-0x0;var _0x238b19=_0x4acb[_0x448047];return _0x238b19;};'use strict';var multer=require(_0xb4ac('0x0'));var util=require(_0xb4ac('0x1'));var path=require(_0xb4ac('0x2'));var timeout=require(_0xb4ac('0x3'));var express=require(_0xb4ac('0x4'));var router=express[_0xb4ac('0x5')]();var fs_extra=require(_0xb4ac('0x6'));var auth=require(_0xb4ac('0x7'));var interaction=require(_0xb4ac('0x8'));var config=require('../../config/environment');var controller=require(_0xb4ac('0x9'));router[_0xb4ac('0xa')]('/',auth[_0xb4ac('0xb')](),controller[_0xb4ac('0xc')]);router[_0xb4ac('0xa')](_0xb4ac('0xd'),auth[_0xb4ac('0xb')](),controller['describe']);router[_0xb4ac('0xa')]('/:id',auth[_0xb4ac('0xb')](),controller[_0xb4ac('0xe')]);router[_0xb4ac('0xf')]('/',auth['isAuthenticated'](),controller[_0xb4ac('0x10')]);router[_0xb4ac('0x11')]('/:id',auth[_0xb4ac('0xb')](),controller[_0xb4ac('0x12')]);router['delete'](_0xb4ac('0x13'),auth[_0xb4ac('0xb')](),controller[_0xb4ac('0x14')]);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 a8869d8..88ae05f 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xbbefe,_0x43c85e){var _0xc277d9=function(_0xd280c1){while(--_0xd280c1){_0xbbefe['push'](_0xbbefe['shift']());}};_0xc277d9(++_0x43c85e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x37ef22,_0x348c92){_0x37ef22=_0x37ef22-0x0;var _0x49eeb3=_0xf3cd[_0x37ef22];return _0x49eeb3;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x2a24ed,_0x18b9ee){var _0xefb655=function(_0x2162fa){while(--_0x2162fa){_0x2a24ed['push'](_0x2a24ed['shift']());}};_0xefb655(++_0x18b9ee);}(_0x00bb,0x1d8));var _0xb00b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x00bb[_0xb0f7c3];return _0x28ea68;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index d5c13ee..f2e0e4c 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 _0xc720=['rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','params','keys','find','create','body','catch','destroy','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc720,0x6b));var _0x0c72=function(_0x39925f,_0x3277e7){_0x39925f=_0x39925f-0x0;var _0x3bedb0=_0xc720[_0x39925f];return _0x3bedb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c72('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c72('0x1'));var rp=require(_0x0c72('0x2'));var moment=require(_0x0c72('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0c72('0x4'));var util=require(_0x0c72('0x5'));var path=require('path');var sox=require(_0x0c72('0x6'));var csv=require(_0x0c72('0x7'));var ejs=require(_0x0c72('0x8'));var fs=require('fs');var fs_extra=require(_0x0c72('0x9'));var _=require(_0x0c72('0xa'));var squel=require(_0x0c72('0xb'));var crypto=require(_0x0c72('0xc'));var jsforce=require(_0x0c72('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0c72('0x7'));var querystring=require(_0x0c72('0xe'));var Papa=require(_0x0c72('0xf'));var Redis=require(_0x0c72('0x10'));var authService=require(_0x0c72('0x11'));var qs=require(_0x0c72('0x12'));var as=require(_0x0c72('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c72('0x14'))(_0x0c72('0x15'));var utils=require(_0x0c72('0x16'));var config=require(_0x0c72('0x17'));var licenseUtil=require(_0x0c72('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x126863,_0x4fdbcf){_0x4fdbcf=_0x4fdbcf||0xcc;return function(_0x54125f){if(_0x54125f){return _0x126863[_0x0c72('0x19')](_0x4fdbcf);}return _0x126863[_0x0c72('0x1a')](_0x4fdbcf)[_0x0c72('0x1b')]();};}function respondWithResult(_0x18f26c,_0x50608c){_0x50608c=_0x50608c||0xc8;return function(_0x540175){if(_0x540175){return _0x18f26c['status'](_0x50608c)[_0x0c72('0x1c')](_0x540175);}};}function respondWithFilteredResult(_0xca7497,_0x4f6dc0){return function(_0x338c8d){if(_0x338c8d){var _0x1f8b74=typeof _0x4f6dc0[_0x0c72('0x1d')]==='undefined'&&typeof _0x4f6dc0[_0x0c72('0x1e')]===_0x0c72('0x1f');var _0x50861c=_0x338c8d[_0x0c72('0x20')];var _0x22a5e5=_0x1f8b74?0x0:_0x4f6dc0[_0x0c72('0x1d')];var _0x20aecd=_0x1f8b74?_0x338c8d['count']:_0x4f6dc0[_0x0c72('0x1d')]+_0x4f6dc0[_0x0c72('0x1e')];var _0x825719;if(_0x20aecd>=_0x50861c){_0x20aecd=_0x50861c;_0x825719=0xc8;}else{_0x825719=0xce;}_0xca7497[_0x0c72('0x1a')](_0x825719);return _0xca7497[_0x0c72('0x21')](_0x0c72('0x22'),_0x22a5e5+'-'+_0x20aecd+'/'+_0x50861c)['json'](_0x338c8d);}return null;};}function patchUpdates(_0x5b40f5){return function(_0x1c85e2){try{jsonpatch[_0x0c72('0x23')](_0x1c85e2,_0x5b40f5,!![]);}catch(_0x3904b6){return BPromise[_0x0c72('0x24')](_0x3904b6);}return _0x1c85e2[_0x0c72('0x25')]();};}function saveUpdates(_0x15745a,_0x5738d4){return function(_0x7db1c9){if(_0x7db1c9){return _0x7db1c9[_0x0c72('0x26')](_0x15745a)[_0x0c72('0x27')](function(_0x145020){return _0x145020;});}return null;};}function removeEntity(_0x153bec,_0x4781f9){return function(_0x5ec07b){if(_0x5ec07b){return _0x5ec07b['destroy']()[_0x0c72('0x27')](function(){_0x153bec[_0x0c72('0x1a')](0xcc)[_0x0c72('0x1b')]();});}};}function handleEntityNotFound(_0x1532d1,_0x3dc2f4){return function(_0x3349e1){if(!_0x3349e1){_0x1532d1[_0x0c72('0x19')](0x194);}return _0x3349e1;};}function handleError(_0x332697,_0x1aacf3){_0x1aacf3=_0x1aacf3||0x1f4;return function(_0x192998){logger['error'](_0x192998[_0x0c72('0x28')]);if(_0x192998[_0x0c72('0x29')]){delete _0x192998[_0x0c72('0x29')];}_0x332697[_0x0c72('0x1a')](_0x1aacf3)[_0x0c72('0x2a')](_0x192998);};}exports[_0x0c72('0x2b')]=function(_0xfd6934,_0x5c4d7b){var _0x1d338e={},_0xbe2baa={},_0x17278e={'count':0x0,'rows':[]};var _0x4e0d66=_[_0x0c72('0x2c')](db['ChatTransferReport'][_0x0c72('0x2d')],function(_0x3c4a5a){return{'name':_0x3c4a5a[_0x0c72('0x2e')],'type':_0x3c4a5a[_0x0c72('0x2f')]['key']};});_0xbe2baa[_0x0c72('0x30')]=_['map'](_0x4e0d66,_0x0c72('0x29'));_0xbe2baa[_0x0c72('0x31')]=_['keys'](_0xfd6934['query']);_0xbe2baa[_0x0c72('0x32')]=_[_0x0c72('0x33')](_0xbe2baa[_0x0c72('0x30')],_0xbe2baa['query']);_0x1d338e[_0x0c72('0x34')]=_[_0x0c72('0x33')](_0xbe2baa['model'],qs[_0x0c72('0x35')](_0xfd6934[_0x0c72('0x31')][_0x0c72('0x35')]));_0x1d338e['attributes']=_0x1d338e[_0x0c72('0x34')][_0x0c72('0x36')]?_0x1d338e['attributes']:_0xbe2baa[_0x0c72('0x30')];if(!_0xfd6934[_0x0c72('0x31')][_0x0c72('0x37')](_0x0c72('0x38'))){_0x1d338e['limit']=qs['limit'](_0xfd6934[_0x0c72('0x31')]['limit']);_0x1d338e[_0x0c72('0x1d')]=qs[_0x0c72('0x1d')](_0xfd6934['query'][_0x0c72('0x1d')]);}_0x1d338e[_0x0c72('0x39')]=qs[_0x0c72('0x3a')](_0xfd6934[_0x0c72('0x31')]['sort']);_0x1d338e[_0x0c72('0x3b')]=qs[_0x0c72('0x32')](_[_0x0c72('0x3c')](_0xfd6934[_0x0c72('0x31')],_0xbe2baa[_0x0c72('0x32')]),_0x4e0d66);if(_0xfd6934['query'][_0x0c72('0x3d')]){_0x1d338e[_0x0c72('0x3b')]=_[_0x0c72('0x3e')](_0x1d338e[_0x0c72('0x3b')],{'$or':_['map'](_0x4e0d66,function(_0x7ac297){if(_0x7ac297[_0x0c72('0x2f')]!==_0x0c72('0x3f')){var _0x2ea0f7={};_0x2ea0f7[_0x7ac297['name']]={'$like':'%'+_0xfd6934[_0x0c72('0x31')][_0x0c72('0x3d')]+'%'};return _0x2ea0f7;}})});}_0x1d338e=_[_0x0c72('0x3e')]({},_0x1d338e,_0xfd6934[_0x0c72('0x40')]);var _0x39cf89={'where':_0x1d338e['where']};return db[_0x0c72('0x41')][_0x0c72('0x20')](_0x39cf89)['then'](function(_0x34c729){_0x17278e['count']=_0x34c729;if(_0xfd6934['query'][_0x0c72('0x42')]){_0x1d338e[_0x0c72('0x43')]=[{'all':!![]}];}return db[_0x0c72('0x41')]['findAll'](_0x1d338e);})['then'](function(_0x3e8b05){_0x17278e['rows']=_0x3e8b05;return _0x17278e;})[_0x0c72('0x27')](respondWithFilteredResult(_0x5c4d7b,_0x1d338e))['catch'](handleError(_0x5c4d7b,null));};exports['show']=function(_0x186d32,_0x303708){var _0x338282={'raw':!![],'where':{'id':_0x186d32[_0x0c72('0x44')]['id']}},_0x3fc446={};_0x3fc446[_0x0c72('0x30')]=_[_0x0c72('0x45')](db[_0x0c72('0x41')][_0x0c72('0x2d')]);_0x3fc446[_0x0c72('0x31')]=_[_0x0c72('0x45')](_0x186d32['query']);_0x3fc446[_0x0c72('0x32')]=_[_0x0c72('0x33')](_0x3fc446[_0x0c72('0x30')],_0x3fc446[_0x0c72('0x31')]);_0x338282[_0x0c72('0x34')]=_['intersection'](_0x3fc446[_0x0c72('0x30')],qs[_0x0c72('0x35')](_0x186d32[_0x0c72('0x31')][_0x0c72('0x35')]));_0x338282['attributes']=_0x338282[_0x0c72('0x34')][_0x0c72('0x36')]?_0x338282[_0x0c72('0x34')]:_0x3fc446['model'];if(_0x186d32[_0x0c72('0x31')][_0x0c72('0x42')]){_0x338282[_0x0c72('0x43')]=[{'all':!![]}];}_0x338282=_[_0x0c72('0x3e')]({},_0x338282,_0x186d32[_0x0c72('0x40')]);return db['ChatTransferReport'][_0x0c72('0x46')](_0x338282)[_0x0c72('0x27')](handleEntityNotFound(_0x303708,null))[_0x0c72('0x27')](respondWithResult(_0x303708,null))['catch'](handleError(_0x303708,null));};exports[_0x0c72('0x47')]=function(_0x1da7b2,_0x5f0787){return db[_0x0c72('0x41')][_0x0c72('0x47')](_0x1da7b2[_0x0c72('0x48')],{})[_0x0c72('0x27')](respondWithResult(_0x5f0787,0xc9))[_0x0c72('0x49')](handleError(_0x5f0787,null));};exports['update']=function(_0x500d63,_0x448958){if(_0x500d63['body']['id']){delete _0x500d63[_0x0c72('0x48')]['id'];}return db['ChatTransferReport'][_0x0c72('0x46')]({'where':{'id':_0x500d63[_0x0c72('0x44')]['id']}})['then'](handleEntityNotFound(_0x448958,null))[_0x0c72('0x27')](saveUpdates(_0x500d63[_0x0c72('0x48')],null))[_0x0c72('0x27')](respondWithResult(_0x448958,null))['catch'](handleError(_0x448958,null));};exports[_0x0c72('0x4a')]=function(_0x6f549d,_0x566d38){return db[_0x0c72('0x41')][_0x0c72('0x46')]({'where':{'id':_0x6f549d[_0x0c72('0x44')]['id']}})[_0x0c72('0x27')](handleEntityNotFound(_0x566d38,null))[_0x0c72('0x27')](removeEntity(_0x566d38,null))['catch'](handleError(_0x566d38,null));};exports[_0x0c72('0x4b')]=function(_0x4755d8,_0x246dfe){return db['ChatTransferReport'][_0x0c72('0x4b')]()['then'](respondWithResult(_0x246dfe,null))[_0x0c72('0x49')](handleError(_0x246dfe,null));};
\ No newline at end of file
+var _0x7a62=['update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','include','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x7a62,0xc3));var _0x27a6=function(_0x22b115,_0x27c1d3){_0x22b115=_0x22b115-0x0;var _0x53e73b=_0x7a62[_0x22b115];return _0x53e73b;};'use strict';var emlformat=require(_0x27a6('0x0'));var rimraf=require(_0x27a6('0x1'));var zipdir=require(_0x27a6('0x2'));var jsonpatch=require(_0x27a6('0x3'));var rp=require(_0x27a6('0x4'));var moment=require(_0x27a6('0x5'));var BPromise=require(_0x27a6('0x6'));var Mustache=require(_0x27a6('0x7'));var util=require(_0x27a6('0x8'));var path=require(_0x27a6('0x9'));var sox=require(_0x27a6('0xa'));var csv=require(_0x27a6('0xb'));var ejs=require(_0x27a6('0xc'));var fs=require('fs');var fs_extra=require(_0x27a6('0xd'));var _=require(_0x27a6('0xe'));var squel=require(_0x27a6('0xf'));var crypto=require(_0x27a6('0x10'));var jsforce=require(_0x27a6('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x27a6('0x12'));var Papa=require(_0x27a6('0x13'));var Redis=require(_0x27a6('0x14'));var authService=require(_0x27a6('0x15'));var qs=require(_0x27a6('0x16'));var as=require(_0x27a6('0x17'));var hardwareService=require(_0x27a6('0x18'));var logger=require(_0x27a6('0x19'))(_0x27a6('0x1a'));var utils=require(_0x27a6('0x1b'));var config=require(_0x27a6('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x27a6('0x1d'))['db'];function respondWithStatusCode(_0x1a9fc7,_0x3a0346){_0x3a0346=_0x3a0346||0xcc;return function(_0x252194){if(_0x252194){return _0x1a9fc7[_0x27a6('0x1e')](_0x3a0346);}return _0x1a9fc7[_0x27a6('0x1f')](_0x3a0346)[_0x27a6('0x20')]();};}function respondWithResult(_0x42bf16,_0x30aca8){_0x30aca8=_0x30aca8||0xc8;return function(_0x33afa5){if(_0x33afa5){return _0x42bf16['status'](_0x30aca8)[_0x27a6('0x21')](_0x33afa5);}};}function respondWithFilteredResult(_0x44b37f,_0x31257d){return function(_0x6e9efd){if(_0x6e9efd){var _0x1d572e=typeof _0x31257d[_0x27a6('0x22')]===_0x27a6('0x23')&&typeof _0x31257d[_0x27a6('0x24')]==='undefined';var _0x18a263=_0x6e9efd[_0x27a6('0x25')];var _0x532d42=_0x1d572e?0x0:_0x31257d[_0x27a6('0x22')];var _0x41b5c1=_0x1d572e?_0x6e9efd['count']:_0x31257d[_0x27a6('0x22')]+_0x31257d[_0x27a6('0x24')];var _0x18ad31;if(_0x41b5c1>=_0x18a263){_0x41b5c1=_0x18a263;_0x18ad31=0xc8;}else{_0x18ad31=0xce;}_0x44b37f[_0x27a6('0x1f')](_0x18ad31);return _0x44b37f[_0x27a6('0x26')]('Content-Range',_0x532d42+'-'+_0x41b5c1+'/'+_0x18a263)[_0x27a6('0x21')](_0x6e9efd);}return null;};}function patchUpdates(_0x2a83d2){return function(_0x5378cd){try{jsonpatch[_0x27a6('0x27')](_0x5378cd,_0x2a83d2,!![]);}catch(_0x599331){return BPromise[_0x27a6('0x28')](_0x599331);}return _0x5378cd[_0x27a6('0x29')]();};}function saveUpdates(_0x1e7baf,_0x564c0e){return function(_0x11dec5){if(_0x11dec5){return _0x11dec5[_0x27a6('0x2a')](_0x1e7baf)[_0x27a6('0x2b')](function(_0x405e42){return _0x405e42;});}return null;};}function removeEntity(_0x4f0727,_0x2528ad){return function(_0x2e6366){if(_0x2e6366){return _0x2e6366[_0x27a6('0x2c')]()[_0x27a6('0x2b')](function(){_0x4f0727[_0x27a6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x385d7d,_0x5d8f32){return function(_0x45f0c2){if(!_0x45f0c2){_0x385d7d[_0x27a6('0x1e')](0x194);}return _0x45f0c2;};}function handleError(_0x27e79e,_0x1b2b93){_0x1b2b93=_0x1b2b93||0x1f4;return function(_0x1cf41e){logger[_0x27a6('0x2d')](_0x1cf41e[_0x27a6('0x2e')]);if(_0x1cf41e[_0x27a6('0x2f')]){delete _0x1cf41e[_0x27a6('0x2f')];}_0x27e79e[_0x27a6('0x1f')](_0x1b2b93)['send'](_0x1cf41e);};}exports[_0x27a6('0x30')]=function(_0x51a70b,_0x1c9313){var _0x326693={},_0x22833e={},_0x3cf67a={'count':0x0,'rows':[]};var _0x4ad8c2=_[_0x27a6('0x31')](db[_0x27a6('0x32')][_0x27a6('0x33')],function(_0x27382a){return{'name':_0x27382a['fieldName'],'type':_0x27382a['type'][_0x27a6('0x34')]};});_0x22833e[_0x27a6('0x35')]=_[_0x27a6('0x31')](_0x4ad8c2,'name');_0x22833e[_0x27a6('0x36')]=_[_0x27a6('0x37')](_0x51a70b[_0x27a6('0x36')]);_0x22833e[_0x27a6('0x38')]=_[_0x27a6('0x39')](_0x22833e['model'],_0x22833e[_0x27a6('0x36')]);_0x326693[_0x27a6('0x3a')]=_['intersection'](_0x22833e[_0x27a6('0x35')],qs[_0x27a6('0x3b')](_0x51a70b[_0x27a6('0x36')][_0x27a6('0x3b')]));_0x326693[_0x27a6('0x3a')]=_0x326693[_0x27a6('0x3a')][_0x27a6('0x3c')]?_0x326693[_0x27a6('0x3a')]:_0x22833e['model'];if(!_0x51a70b[_0x27a6('0x36')][_0x27a6('0x3d')](_0x27a6('0x3e'))){_0x326693[_0x27a6('0x24')]=qs[_0x27a6('0x24')](_0x51a70b[_0x27a6('0x36')][_0x27a6('0x24')]);_0x326693[_0x27a6('0x22')]=qs[_0x27a6('0x22')](_0x51a70b[_0x27a6('0x36')][_0x27a6('0x22')]);}_0x326693[_0x27a6('0x3f')]=qs['sort'](_0x51a70b[_0x27a6('0x36')][_0x27a6('0x40')]);_0x326693[_0x27a6('0x41')]=qs[_0x27a6('0x38')](_[_0x27a6('0x42')](_0x51a70b[_0x27a6('0x36')],_0x22833e['filters']),_0x4ad8c2);if(_0x51a70b[_0x27a6('0x36')][_0x27a6('0x43')]){_0x326693[_0x27a6('0x41')]=_['merge'](_0x326693['where'],{'$or':_[_0x27a6('0x31')](_0x4ad8c2,function(_0xa7503a){if(_0xa7503a[_0x27a6('0x44')]!=='VIRTUAL'){var _0x2be05c={};_0x2be05c[_0xa7503a['name']]={'$like':'%'+_0x51a70b[_0x27a6('0x36')][_0x27a6('0x43')]+'%'};return _0x2be05c;}})});}_0x326693=_['merge']({},_0x326693,_0x51a70b[_0x27a6('0x45')]);var _0x2fe926={'where':_0x326693['where']};return db['ChatTransferReport']['count'](_0x2fe926)[_0x27a6('0x2b')](function(_0x17a8ed){_0x3cf67a[_0x27a6('0x25')]=_0x17a8ed;if(_0x51a70b[_0x27a6('0x36')]['includeAll']){_0x326693[_0x27a6('0x46')]=[{'all':!![]}];}return db[_0x27a6('0x32')]['findAll'](_0x326693);})[_0x27a6('0x2b')](function(_0x1f71cb){_0x3cf67a['rows']=_0x1f71cb;return _0x3cf67a;})['then'](respondWithFilteredResult(_0x1c9313,_0x326693))[_0x27a6('0x47')](handleError(_0x1c9313,null));};exports[_0x27a6('0x48')]=function(_0x3acfdd,_0x145f21){var _0x2ebec0={'raw':!![],'where':{'id':_0x3acfdd[_0x27a6('0x49')]['id']}},_0x313d20={};_0x313d20[_0x27a6('0x35')]=_[_0x27a6('0x37')](db['ChatTransferReport'][_0x27a6('0x33')]);_0x313d20[_0x27a6('0x36')]=_[_0x27a6('0x37')](_0x3acfdd[_0x27a6('0x36')]);_0x313d20[_0x27a6('0x38')]=_['intersection'](_0x313d20[_0x27a6('0x35')],_0x313d20[_0x27a6('0x36')]);_0x2ebec0[_0x27a6('0x3a')]=_['intersection'](_0x313d20[_0x27a6('0x35')],qs[_0x27a6('0x3b')](_0x3acfdd[_0x27a6('0x36')][_0x27a6('0x3b')]));_0x2ebec0[_0x27a6('0x3a')]=_0x2ebec0['attributes'][_0x27a6('0x3c')]?_0x2ebec0[_0x27a6('0x3a')]:_0x313d20[_0x27a6('0x35')];if(_0x3acfdd[_0x27a6('0x36')]['includeAll']){_0x2ebec0[_0x27a6('0x46')]=[{'all':!![]}];}_0x2ebec0=_[_0x27a6('0x4a')]({},_0x2ebec0,_0x3acfdd[_0x27a6('0x45')]);return db[_0x27a6('0x32')][_0x27a6('0x4b')](_0x2ebec0)[_0x27a6('0x2b')](handleEntityNotFound(_0x145f21,null))[_0x27a6('0x2b')](respondWithResult(_0x145f21,null))[_0x27a6('0x47')](handleError(_0x145f21,null));};exports[_0x27a6('0x4c')]=function(_0x5edaa0,_0xc3af14){return db[_0x27a6('0x32')][_0x27a6('0x4c')](_0x5edaa0[_0x27a6('0x4d')],{})['then'](respondWithResult(_0xc3af14,0xc9))['catch'](handleError(_0xc3af14,null));};exports[_0x27a6('0x2a')]=function(_0x4aee8e,_0x396398){if(_0x4aee8e['body']['id']){delete _0x4aee8e[_0x27a6('0x4d')]['id'];}return db[_0x27a6('0x32')][_0x27a6('0x4b')]({'where':{'id':_0x4aee8e['params']['id']}})[_0x27a6('0x2b')](handleEntityNotFound(_0x396398,null))[_0x27a6('0x2b')](saveUpdates(_0x4aee8e[_0x27a6('0x4d')],null))[_0x27a6('0x2b')](respondWithResult(_0x396398,null))[_0x27a6('0x47')](handleError(_0x396398,null));};exports[_0x27a6('0x2c')]=function(_0x310eca,_0x4503ee){return db['ChatTransferReport']['find']({'where':{'id':_0x310eca[_0x27a6('0x49')]['id']}})[_0x27a6('0x2b')](handleEntityNotFound(_0x4503ee,null))[_0x27a6('0x2b')](removeEntity(_0x4503ee,null))['catch'](handleError(_0x4503ee,null));};exports[_0x27a6('0x4e')]=function(_0x1dcb48,_0x4d1f01){return db[_0x27a6('0x32')][_0x27a6('0x4e')]()['then'](respondWithResult(_0x4d1f01,null))['catch'](handleError(_0x4d1f01,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 6fcf307..34ac5bd 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 _0xf7b4=['util','../../config/logger','moment','path','rimraf','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x50583c,_0x2d2dee){var _0x358ba5=function(_0x1aa091){while(--_0x1aa091){_0x50583c['push'](_0x50583c['shift']());}};_0x358ba5(++_0x2d2dee);}(_0xf7b4,0xd0));var _0x4f7b=function(_0x236aed,_0x3426bb){_0x236aed=_0x236aed-0x0;var _0x5e3d2e=_0xf7b4[_0x236aed];return _0x5e3d2e;};'use strict';var _=require(_0x4f7b('0x0'));var util=require(_0x4f7b('0x1'));var logger=require(_0x4f7b('0x2'))('api');var moment=require(_0x4f7b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x4'));var rimraf=require(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x4f7b('0x7')]=function(_0x569def,_0x1ea510){return _0x569def['define'](_0x4f7b('0x8'),attributes,{'tableName':_0x4f7b('0x9'),'paranoid':![],'indexes':[{'name':_0x4f7b('0xa'),'fields':[_0x4f7b('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9541=['api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x466e3b,_0x4dd946){var _0x3f7d36=function(_0x3759d9){while(--_0x3759d9){_0x466e3b['push'](_0x466e3b['shift']());}};_0x3f7d36(++_0x4dd946);}(_0x9541,0x1cb));var _0x1954=function(_0xe7d810,_0x4e8efe){_0xe7d810=_0xe7d810-0x0;var _0x1e6cbf=_0x9541[_0xe7d810];return _0x1e6cbf;};'use strict';var _=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var logger=require(_0x1954('0x2'))(_0x1954('0x3'));var moment=require(_0x1954('0x4'));var BPromise=require('bluebird');var rp=require(_0x1954('0x5'));var fs=require('fs');var path=require(_0x1954('0x6'));var rimraf=require(_0x1954('0x7'));var config=require(_0x1954('0x8'));var attributes=require(_0x1954('0x9'));module['exports']=function(_0xe35f4,_0x566504){return _0xe35f4[_0x1954('0xa')](_0x1954('0xb'),attributes,{'tableName':_0x1954('0xc'),'paranoid':![],'indexes':[{'name':_0x1954('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 18c4401..0ae3c1e 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 _0x4532=['ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','code'];(function(_0x4b05f6,_0x57dd81){var _0xbb1a44=function(_0x1dd695){while(--_0x1dd695){_0x4b05f6['push'](_0x4b05f6['shift']());}};_0xbb1a44(++_0x57dd81);}(_0x4532,0x1b9));var _0x2453=function(_0x3fa27f,_0x307c42){_0x3fa27f=_0x3fa27f-0x0;var _0x46e2b3=_0x4532[_0x3fa27f];return _0x46e2b3;};'use strict';var _=require(_0x2453('0x0'));var util=require('util');var moment=require(_0x2453('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2453('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2453('0x3'))(_0x2453('0x4'));var config=require(_0x2453('0x5'));var jayson=require(_0x2453('0x6'));var client=jayson[_0x2453('0x7')][_0x2453('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x369827,_0x4c23de,_0x256ac5){return new BPromise(function(_0x3d892e,_0x3f2a6f){return client[_0x2453('0x9')](_0x369827,_0x256ac5)['then'](function(_0x43644c){logger[_0x2453('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x4c23de,_0x2453('0xb'));logger[_0x2453('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4c23de,'request\x20sent',JSON['stringify'](_0x43644c));if(_0x43644c[_0x2453('0xd')]){if(_0x43644c['error'][_0x2453('0xe')]===0x1f4){logger[_0x2453('0xd')](_0x2453('0xf'),_0x4c23de,_0x43644c['error'][_0x2453('0x10')]);return _0x3f2a6f(_0x43644c[_0x2453('0xd')][_0x2453('0x10')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4c23de,_0x43644c['error'][_0x2453('0x10')]);return _0x3d892e(_0x43644c[_0x2453('0xd')]['message']);}else{logger[_0x2453('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x4c23de,_0x2453('0xb'));_0x3d892e(_0x43644c[_0x2453('0x11')][_0x2453('0x10')]);}})[_0x2453('0x12')](function(_0x463be8){logger[_0x2453('0xd')](_0x2453('0xf'),_0x4c23de,_0x463be8);_0x3f2a6f(_0x463be8);});});}
\ No newline at end of file
+var _0xe812=['jayson/promise','client','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../config/environment'];(function(_0x33d1ea,_0x1ca2ca){var _0x509718=function(_0x1a63dc){while(--_0x1a63dc){_0x33d1ea['push'](_0x33d1ea['shift']());}};_0x509718(++_0x1ca2ca);}(_0xe812,0x193));var _0x2e81=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe812[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x2e81('0x0'));var util=require(_0x2e81('0x1'));var moment=require(_0x2e81('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2e81('0x4'));var jayson=require(_0x2e81('0x5'));var client=jayson[_0x2e81('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e03d6,_0x130c87,_0x48cd25){return new BPromise(function(_0x386b4e,_0x3edba8){return client[_0x2e81('0x7')](_0x3e03d6,_0x48cd25)['then'](function(_0x374c64){logger[_0x2e81('0x8')]('ChatTransferReport,\x20%s,\x20%s',_0x130c87,_0x2e81('0x9'));logger[_0x2e81('0xa')](_0x2e81('0xb'),_0x130c87,_0x2e81('0x9'),JSON['stringify'](_0x374c64));if(_0x374c64[_0x2e81('0xc')]){if(_0x374c64['error']['code']===0x1f4){logger[_0x2e81('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x130c87,_0x374c64['error']['message']);return _0x3edba8(_0x374c64['error'][_0x2e81('0xd')]);}logger['error'](_0x2e81('0xe'),_0x130c87,_0x374c64[_0x2e81('0xc')][_0x2e81('0xd')]);return _0x386b4e(_0x374c64[_0x2e81('0xc')][_0x2e81('0xd')]);}else{logger[_0x2e81('0x8')]('ChatTransferReport,\x20%s,\x20%s',_0x130c87,_0x2e81('0x9'));_0x386b4e(_0x374c64[_0x2e81('0xf')][_0x2e81('0xd')]);}})[_0x2e81('0x10')](function(_0x16fa05){logger[_0x2e81('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x130c87,_0x16fa05);_0x3edba8(_0x16fa05);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index e4c9006..31c091f 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 _0x5bfa=['express','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5bfa,0x155));var _0xa5bf=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0x5bfa[_0x457b64];return _0x437111;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa5bf('0x0'));var timeout=require('connect-timeout');var express=require(_0xa5bf('0x1'));var router=express[_0xa5bf('0x2')]();var fs_extra=require(_0xa5bf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa5bf('0x4'));var config=require('../../config/environment');var controller=require(_0xa5bf('0x5'));router[_0xa5bf('0x6')]('/',auth['isAuthenticated'](),controller[_0xa5bf('0x7')]);router['get'](_0xa5bf('0x8'),auth[_0xa5bf('0x9')](),controller[_0xa5bf('0xa')]);router['get'](_0xa5bf('0xb'),auth['isAuthenticated'](),controller[_0xa5bf('0xc')]);router[_0xa5bf('0xd')]('/',auth[_0xa5bf('0x9')](),controller[_0xa5bf('0xe')]);router[_0xa5bf('0xf')](_0xa5bf('0xb'),auth[_0xa5bf('0x9')](),controller[_0xa5bf('0x10')]);router[_0xa5bf('0x11')](_0xa5bf('0xb'),auth[_0xa5bf('0x9')](),controller[_0xa5bf('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x64be=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout'];(function(_0x478349,_0x4e11b2){var _0x564ad3=function(_0x505853){while(--_0x505853){_0x478349['push'](_0x478349['shift']());}};_0x564ad3(++_0x4e11b2);}(_0x64be,0x75));var _0xe64b=function(_0x4badc1,_0x288f4f){_0x4badc1=_0x4badc1-0x0;var _0x5719b1=_0x64be[_0x4badc1];return _0x5719b1;};'use strict';var multer=require(_0xe64b('0x0'));var util=require('util');var path=require(_0xe64b('0x1'));var timeout=require(_0xe64b('0x2'));var express=require('express');var router=express[_0xe64b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe64b('0x4'));var interaction=require(_0xe64b('0x5'));var config=require(_0xe64b('0x6'));var controller=require(_0xe64b('0x7'));router['get']('/',auth[_0xe64b('0x8')](),controller[_0xe64b('0x9')]);router[_0xe64b('0xa')](_0xe64b('0xb'),auth[_0xe64b('0x8')](),controller[_0xe64b('0xc')]);router[_0xe64b('0xa')](_0xe64b('0xd'),auth[_0xe64b('0x8')](),controller['show']);router[_0xe64b('0xe')]('/',auth['isAuthenticated'](),controller[_0xe64b('0xf')]);router[_0xe64b('0x10')]('/:id',auth[_0xe64b('0x8')](),controller[_0xe64b('0x11')]);router['delete']('/:id',auth[_0xe64b('0x8')](),controller[_0xe64b('0x12')]);module[_0xe64b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 41abcb2..c2faf0b 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 _0x617b=['alternate','#fafafa','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','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','textarea','Comments','offlineForm','parse','setDataValue','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right'];(function(_0x3667f4,_0x352406){var _0x244317=function(_0x5aba01){while(--_0x5aba01){_0x3667f4['push'](_0x3667f4['shift']());}};_0x244317(++_0x352406);}(_0x617b,0x1e7));var _0xb617=function(_0x5dc57d,_0x2d9343){_0x5dc57d=_0x5dc57d-0x0;var _0x2a4499=_0x617b[_0x5dc57d];return _0x2a4499;};'use strict';var Sequelize=require(_0xb617('0x0'));var rs=require(_0xb617('0x1'));module['exports']={'name':{'type':Sequelize[_0xb617('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x3')},'mapKeyOffline':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x3')},'key':{'type':Sequelize[_0xb617('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb617('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb617('0x2')]},'animation':{'type':Sequelize[_0xb617('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb617('0x7'),_0xb617('0x8')),'defaultValue':_0xb617('0x7')},'header_online':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x9')},'start_chat_button':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xb617('0xb')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb617('0x5')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xb617('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0xb617('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb617('0xd')]},'closingQuestion':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0xf')},'noteTitle':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x10')},'placeholderMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb617('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x12')},'ratingType':{'type':Sequelize[_0xb617('0x13')](_0xb617('0x14'),_0xb617('0x15')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb617('0x5')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb617('0xd')],'defaultValue':function(){return JSON[_0xb617('0x16')]({'items':[{'type':_0xb617('0x17'),'variable':null,'config':{'placeholder':_0xb617('0x18'),'type':_0xb617('0x19'),'required':!![]},'props':{'title':_0xb617('0x18'),'helpText':''}},{'type':_0xb617('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb617('0x3'),'type':_0xb617('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb617('0x1a')]('onlineForm')?JSON['parse'](this[_0xb617('0x1a')](_0xb617('0x1b'))):{};},'set':function(_0x78cb1b){return this['setDataValue'](_0xb617('0x1b'),JSON['stringify'](_0x78cb1b));}},'offlineForm':{'type':Sequelize[_0xb617('0xd')],'defaultValue':function(){return JSON[_0xb617('0x16')]({'items':[{'type':_0xb617('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb617('0x3'),'type':_0xb617('0x3')},'variable':null},{'type':_0xb617('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':_0xb617('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb617('0x1a')](_0xb617('0x1e'))?JSON[_0xb617('0x1f')](this[_0xb617('0x1a')](_0xb617('0x1e'))):{};},'set':function(_0xa49062){return this[_0xb617('0x20')](_0xb617('0x1e'),JSON['stringify'](_0xa49062));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb617('0x21')]();}},'autoclose':{'type':Sequelize[_0xb617('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb617('0x2')]},'waitingTitle':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x22')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb617('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xb617('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x25')},'skipUnmanaged':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x26')},'enableCustomerAttachment':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb617('0xd')]},'showAgentAvatar':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb617('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb617('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xb617('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x28')},'verticalAlignment':{'type':Sequelize[_0xb617('0x5')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x29')},'defaultTitle':{'type':Sequelize[_0xb617('0x2')]},'customerAvatar':{'type':Sequelize[_0xb617('0xd')]},'showCustomerAvatar':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':_0xb617('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb617('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb617('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb617('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb617('0x5')],'comment':_0xb617('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![],'comment':_0xb617('0x2c'),'set':function(_0x730d19){if(!_0x730d19)this[_0xb617('0x20')](_0xb617('0x2d'),null);this[_0xb617('0x20')](_0xb617('0x2e'),_0x730d19);}},'vidaooEscalation':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xb617('0x2')],'defaultValue':function(){return _0xb617('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xb617('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8691=['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','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','Chat','Send','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x2ab630,_0x34d07a){var _0x3fe346=function(_0x1314ee){while(--_0x1314ee){_0x2ab630['push'](_0x2ab630['shift']());}};_0x3fe346(++_0x34d07a);}(_0x8691,0x1c5));var _0x1869=function(_0x1b5ad2,_0x476864){_0x1b5ad2=_0x1b5ad2-0x0;var _0x228d69=_0x8691[_0x1b5ad2];return _0x228d69;};'use strict';var Sequelize=require(_0x1869('0x0'));var rs=require(_0x1869('0x1'));module[_0x1869('0x2')]={'name':{'type':Sequelize[_0x1869('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1869('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x5')},'mapKeyOffline':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x5')},'key':{'type':Sequelize[_0x1869('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1869('0x3')],'allowNull':![],'defaultValue':_0x1869('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1869('0x3')],'allowNull':![],'defaultValue':_0x1869('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1869('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1869('0x3')]},'animation':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1869('0xa')](_0x1869('0xb'),_0x1869('0xc')),'defaultValue':_0x1869('0xb')},'header_online':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x1869('0xd')},'offline_chat_button':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0xe')},'header_offline':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1869('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1869('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1869('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1869('0x12')},'noteTitle':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x13')},'closingMessage':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x14')},'ratingType':{'type':Sequelize[_0x1869('0xa')]('star','thumb'),'defaultValue':_0x1869('0x15')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1869('0x10')],'defaultValue':function(){return JSON[_0x1869('0x16')]({'items':[{'type':_0x1869('0x17'),'variable':null,'config':{'placeholder':_0x1869('0x18'),'type':_0x1869('0x19'),'required':!![]},'props':{'title':_0x1869('0x18'),'helpText':''}},{'type':_0x1869('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1869('0x5'),'type':_0x1869('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1869('0x1a'))?JSON[_0x1869('0x1b')](this[_0x1869('0x1c')](_0x1869('0x1a'))):{};},'set':function(_0x123128){return this[_0x1869('0x1d')]('onlineForm',JSON[_0x1869('0x16')](_0x123128));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1869('0x17'),'props':{'title':_0x1869('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x1869('0x1e'),'config':{'placeholder':_0x1869('0x1f')},'props':{'title':_0x1869('0x1f'),'helpText':_0x1869('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1869('0x1c')](_0x1869('0x21'))?JSON['parse'](this[_0x1869('0x1c')](_0x1869('0x21'))):{};},'set':function(_0x592097){return this[_0x1869('0x1d')](_0x1869('0x21'),JSON[_0x1869('0x16')](_0x592097));}},'token':{'type':Sequelize[_0x1869('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1869('0x3')]},'forwardOffline':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1869('0x3')]},'waitingTitle':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x22')},'waitingMessage':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x25')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1869('0x26')},'sendUnmanaged':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1869('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1869('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1869('0x10')],'defaultValue':function(){return _0x1869('0x27');}},'notificationSound':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1869('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x29')},'verticalAlignment':{'type':Sequelize[_0x1869('0xf')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x1869('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1869('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1869('0x3')],'allowNull':![],'defaultValue':_0x1869('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1869('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1869('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![],'comment':_0x1869('0x2d'),'set':function(_0x476904){if(!_0x476904)this['setDataValue'](_0x1869('0x2e'),null);this[_0x1869('0x1d')]('mandatoryDisposition',_0x476904);}},'vidaooEscalation':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1869('0x3')],'allowNull':![],'defaultValue':_0x1869('0x2f')},'vidaooNote':{'type':Sequelize[_0x1869('0x3')],'defaultValue':function(){return _0x1869('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x1869('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1869('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 47f7c63..2bcdfc4 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 _0x514b=['Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','color_button','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','ChatWebsites','name','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','existsSync','getSystemAvatar','systemAvatar','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','offline','files','ListId','send','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','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','sendMail','\x22%s\x22\x20<%s>','MailAccountId','length','originalname','subjectOffline','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions'];(function(_0x1893b9,_0x580534){var _0x4316be=function(_0x2c3a93){while(--_0x2c3a93){_0x1893b9['push'](_0x1893b9['shift']());}};_0x4316be(++_0x580534);}(_0x514b,0x172));var _0xb514=function(_0x3f7e81,_0xc05e07){_0x3f7e81=_0x3f7e81-0x0;var _0x155e2f=_0x514b[_0x3f7e81];return _0x155e2f;};'use strict';var emlformat=require(_0xb514('0x0'));var rimraf=require(_0xb514('0x1'));var zipdir=require(_0xb514('0x2'));var jsonpatch=require(_0xb514('0x3'));var rp=require(_0xb514('0x4'));var moment=require(_0xb514('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb514('0x6'));var path=require(_0xb514('0x7'));var sox=require('sox');var csv=require(_0xb514('0x8'));var ejs=require(_0xb514('0x9'));var fs=require('fs');var fs_extra=require(_0xb514('0xa'));var _=require(_0xb514('0xb'));var squel=require(_0xb514('0xc'));var crypto=require(_0xb514('0xd'));var jsforce=require(_0xb514('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb514('0x8'));var querystring=require(_0xb514('0xf'));var Papa=require('papaparse');var Redis=require(_0xb514('0x10'));var authService=require(_0xb514('0x11'));var qs=require(_0xb514('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb514('0x13'));var logger=require(_0xb514('0x14'))(_0xb514('0x15'));var utils=require(_0xb514('0x16'));var config=require(_0xb514('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb514('0x18')]=_[_0xb514('0x19')](config[_0xb514('0x18')],{'host':_0xb514('0x1a'),'port':0x18eb});var socket=require(_0xb514('0x1b'))(new Redis(config[_0xb514('0x18')]));require(_0xb514('0x1c'))[_0xb514('0x1d')](socket);var jayson=require(_0xb514('0x1e'));var client=jayson['client'][_0xb514('0x1f')]({'port':0x232c});var client9002=jayson[_0xb514('0x20')][_0xb514('0x1f')]({'port':0x232a});var client9003=jayson[_0xb514('0x20')][_0xb514('0x1f')]({'port':0x232b});var client9001=jayson[_0xb514('0x20')][_0xb514('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x5d29e7,_0x555ca6,_0x593c21,_0x487aa4){return new BPromise(function(_0x3dc0c3,_0x2443d3){var _0x18ccd1=_0x487aa4||client;return _0x18ccd1[_0xb514('0x21')](_0x5d29e7,_0x593c21)['then'](function(_0x917580){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x555ca6,_0xb514('0x22'));logger[_0xb514('0x23')](_0xb514('0x24'),_0x555ca6,'request\x20sent',JSON[_0xb514('0x25')](_0x917580));if(_0x917580[_0xb514('0x26')]){if(_0x917580[_0xb514('0x26')]['code']===0x1f4){logger[_0xb514('0x26')](_0xb514('0x27'),_0x555ca6,_0x917580['error']['message']);return _0x2443d3(_0x917580[_0xb514('0x26')][_0xb514('0x28')]);}logger[_0xb514('0x26')](_0xb514('0x27'),_0x555ca6,_0x917580[_0xb514('0x26')][_0xb514('0x28')]);return _0x3dc0c3(_0x917580['error']['message']);}else{logger[_0xb514('0x29')](_0xb514('0x27'),_0x555ca6,_0xb514('0x22'));_0x3dc0c3(_0x917580[_0xb514('0x2a')][_0xb514('0x28')]);}})['catch'](function(_0x5e08b2){logger[_0xb514('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x555ca6,_0x5e08b2);_0x2443d3(_0x5e08b2);});});}function respondWithStatusCode(_0x15dcb6,_0x43e55b){_0x43e55b=_0x43e55b||0xcc;return function(_0x446eb7){if(_0x446eb7){return _0x15dcb6[_0xb514('0x2b')](_0x43e55b);}return _0x15dcb6[_0xb514('0x2c')](_0x43e55b)[_0xb514('0x2d')]();};}function respondWithResult(_0x34bd3c,_0x2ab1c1){_0x2ab1c1=_0x2ab1c1||0xc8;return function(_0x3652a3){if(_0x3652a3){return _0x34bd3c[_0xb514('0x2c')](_0x2ab1c1)[_0xb514('0x2e')](_0x3652a3);}};}function respondWithFilteredResult(_0x3eb725,_0xf61c86){return function(_0x296785){if(_0x296785){var _0x55ff75=typeof _0xf61c86[_0xb514('0x2f')]===_0xb514('0x30')&&typeof _0xf61c86[_0xb514('0x31')]==='undefined';var _0x15129c=_0x296785['count'];var _0x3a7fdf=_0x55ff75?0x0:_0xf61c86[_0xb514('0x2f')];var _0x4f4e81=_0x55ff75?_0x296785[_0xb514('0x32')]:_0xf61c86[_0xb514('0x2f')]+_0xf61c86['limit'];var _0xce437d;if(_0x4f4e81>=_0x15129c){_0x4f4e81=_0x15129c;_0xce437d=0xc8;}else{_0xce437d=0xce;}_0x3eb725[_0xb514('0x2c')](_0xce437d);return _0x3eb725['set'](_0xb514('0x33'),_0x3a7fdf+'-'+_0x4f4e81+'/'+_0x15129c)[_0xb514('0x2e')](_0x296785);}return null;};}function patchUpdates(_0x9e8e2e){return function(_0x2a86e5){try{jsonpatch[_0xb514('0x34')](_0x2a86e5,_0x9e8e2e,!![]);}catch(_0xb7f55){return BPromise[_0xb514('0x35')](_0xb7f55);}return _0x2a86e5[_0xb514('0x36')]();};}function saveUpdates(_0xfd2a26,_0x363ae1){return function(_0x9e21f2){if(_0x9e21f2){return _0x9e21f2[_0xb514('0x37')](_0xfd2a26)[_0xb514('0x38')](function(_0x461ccd){return _0x461ccd;});}return null;};}function removeEntity(_0x4a1739,_0x48e741){return function(_0x9e5fb3){if(_0x9e5fb3){return _0x9e5fb3[_0xb514('0x39')]()[_0xb514('0x38')](function(){var _0x2ccfa7=_0x9e5fb3['get']({'plain':!![]});var _0x33ee89=_0xb514('0x3a');return db['UserProfileResource'][_0xb514('0x39')]({'where':{'type':_0x33ee89,'resourceId':_0x2ccfa7['id']}})[_0xb514('0x38')](function(){return _0x9e5fb3;});})[_0xb514('0x38')](function(){_0x4a1739['status'](0xcc)[_0xb514('0x2d')]();});}};}function handleEntityNotFound(_0x4bef0d,_0x1ecf9d){return function(_0x3b6e6d){if(!_0x3b6e6d){_0x4bef0d[_0xb514('0x2b')](0x194);}return _0x3b6e6d;};}function handleError(_0x3163b0,_0x1f274b){_0x1f274b=_0x1f274b||0x1f4;return function(_0x2fbf7f){logger[_0xb514('0x26')](_0x2fbf7f['stack']);if(_0x2fbf7f[_0xb514('0x3b')]){delete _0x2fbf7f[_0xb514('0x3b')];}_0x3163b0['status'](_0x1f274b)['send'](_0x2fbf7f);};}exports['index']=function(_0x5957ce,_0x460764){var _0x104926={'include':[{'model':db['Pause'],'as':_0xb514('0x3c')}]},_0x34b925={},_0x13893c={'count':0x0,'rows':[]};var _0x10e491=_[_0xb514('0x3d')](db[_0xb514('0x3e')][_0xb514('0x3f')],function(_0x4060a7){return{'name':_0x4060a7[_0xb514('0x40')],'type':_0x4060a7[_0xb514('0x41')][_0xb514('0x42')]};});_0x34b925[_0xb514('0x43')]=_[_0xb514('0x3d')](_0x10e491,'name');_0x34b925[_0xb514('0x44')]=_[_0xb514('0x45')](_0x5957ce[_0xb514('0x44')]);_0x34b925[_0xb514('0x46')]=_[_0xb514('0x47')](_0x34b925['model'],_0x34b925[_0xb514('0x44')]);_0x104926[_0xb514('0x48')]=_[_0xb514('0x47')](_0x34b925[_0xb514('0x43')],qs[_0xb514('0x49')](_0x5957ce['query'][_0xb514('0x49')]));_0x104926[_0xb514('0x48')]=_0x104926[_0xb514('0x48')]['length']?_0x104926[_0xb514('0x48')]:_0x34b925[_0xb514('0x43')];if(!_0x5957ce[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x104926['limit']=qs['limit'](_0x5957ce['query']['limit']);_0x104926[_0xb514('0x2f')]=qs[_0xb514('0x2f')](_0x5957ce['query'][_0xb514('0x2f')]);}_0x104926[_0xb514('0x4c')]=qs[_0xb514('0x4d')](_0x5957ce[_0xb514('0x44')]['sort']);_0x104926[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x5957ce[_0xb514('0x44')],_0x34b925[_0xb514('0x46')]),_0x10e491);if(_0x5957ce[_0xb514('0x44')][_0xb514('0x50')]){_0x104926[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x104926[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x10e491,function(_0x6be647){if(_0x6be647[_0xb514('0x41')]!==_0xb514('0x52')){var _0x4c62b1={};_0x4c62b1[_0x6be647[_0xb514('0x3b')]]={'$like':'%'+_0x5957ce['query'][_0xb514('0x50')]+'%'};return _0x4c62b1;}})});}_0x104926=_[_0xb514('0x51')]({},_0x104926,_0x5957ce[_0xb514('0x53')]);var _0x4aa447={'where':_0x104926[_0xb514('0x4e')]};return db[_0xb514('0x3e')][_0xb514('0x32')](_0x4aa447)[_0xb514('0x38')](function(_0x4f84af){_0x13893c[_0xb514('0x32')]=_0x4f84af;if(_0x5957ce[_0xb514('0x44')][_0xb514('0x54')]){_0x104926[_0xb514('0x55')]=[{'all':!![]}];}return db[_0xb514('0x3e')][_0xb514('0x56')](_0x104926);})[_0xb514('0x38')](function(_0x25a935){_0x13893c[_0xb514('0x57')]=_0x25a935;return _0x13893c;})[_0xb514('0x38')](respondWithFilteredResult(_0x460764,_0x104926))['catch'](handleError(_0x460764,null));};exports[_0xb514('0x58')]=function(_0x1827ab,_0x44104e){var _0x594855={'raw':![],'where':{'id':_0x1827ab[_0xb514('0x59')]['id']},'include':[{'model':db[_0xb514('0x5a')],'as':_0xb514('0x3c')}]},_0x51c766={};_0x51c766[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0x3e')][_0xb514('0x3f')]);_0x51c766[_0xb514('0x44')]=_[_0xb514('0x45')](_0x1827ab['query']);_0x51c766[_0xb514('0x46')]=_[_0xb514('0x47')](_0x51c766[_0xb514('0x43')],_0x51c766[_0xb514('0x44')]);_0x594855[_0xb514('0x48')]=_[_0xb514('0x47')](_0x51c766[_0xb514('0x43')],qs[_0xb514('0x49')](_0x1827ab[_0xb514('0x44')][_0xb514('0x49')]));_0x594855['attributes']=_0x594855[_0xb514('0x48')]['length']?_0x594855['attributes']:_0x51c766[_0xb514('0x43')];if(_0x1827ab[_0xb514('0x44')][_0xb514('0x54')]){_0x594855[_0xb514('0x55')]=[{'all':!![]}];}_0x594855=_[_0xb514('0x51')]({},_0x594855,_0x1827ab[_0xb514('0x53')]);return db[_0xb514('0x3e')][_0xb514('0x5b')](_0x594855)[_0xb514('0x38')](handleEntityNotFound(_0x44104e,null))['then'](respondWithResult(_0x44104e,null))[_0xb514('0x5c')](handleError(_0x44104e,null));};exports[_0xb514('0x5d')]=function(_0x34a906,_0x8c91d3){return db[_0xb514('0x3e')][_0xb514('0x5d')](_0x34a906[_0xb514('0x5e')],{})[_0xb514('0x38')](function(_0x108229){var _0x2923c6=_0x34a906[_0xb514('0x5f')]['get']({'plain':!![]});if(!_0x2923c6)throw new Error(_0xb514('0x60'));if(_0x2923c6['role']===_0xb514('0x5f')){var _0x31a4c5=_0x108229[_0xb514('0x61')]({'plain':!![]});var _0x1a0249=_0xb514('0x3a');return db[_0xb514('0x62')][_0xb514('0x5b')]({'where':{'name':_0x1a0249,'userProfileId':_0x2923c6[_0xb514('0x63')]},'raw':!![]})[_0xb514('0x38')](function(_0x42f039){if(_0x42f039&&_0x42f039[_0xb514('0x64')]===0x0){return db['UserProfileResource'][_0xb514('0x5d')]({'name':_0x31a4c5[_0xb514('0x3b')],'resourceId':_0x31a4c5['id'],'type':_0x42f039[_0xb514('0x3b')],'sectionId':_0x42f039['id']},{})[_0xb514('0x38')](function(){return _0x108229;});}else{return _0x108229;}})[_0xb514('0x5c')](function(_0x53928c){logger[_0xb514('0x26')](_0xb514('0x65'),_0x53928c);throw _0x53928c;});}return _0x108229;})[_0xb514('0x38')](respondWithResult(_0x8c91d3,0xc9))[_0xb514('0x5c')](handleError(_0x8c91d3,null));};exports[_0xb514('0x37')]=function(_0x32b566,_0x380179){if(_0x32b566[_0xb514('0x5e')]['id']){delete _0x32b566[_0xb514('0x5e')]['id'];}return db[_0xb514('0x3e')]['find']({'where':{'id':_0x32b566[_0xb514('0x59')]['id']},'include':[{'model':db[_0xb514('0x5a')],'as':'mandatoryDispositionPause'}]})[_0xb514('0x38')](handleEntityNotFound(_0x380179,null))[_0xb514('0x38')](saveUpdates(_0x32b566['body'],null))[_0xb514('0x38')](respondWithResult(_0x380179,null))[_0xb514('0x5c')](handleError(_0x380179,null));};exports['destroy']=function(_0xb2946b,_0xb77f10){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0xb2946b[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0xb77f10,null))[_0xb514('0x38')](removeEntity(_0xb77f10,null))['catch'](handleError(_0xb77f10,null));};exports[_0xb514('0x66')]=function(_0x385bcc,_0x4f3447){return db[_0xb514('0x3e')][_0xb514('0x66')]()[_0xb514('0x38')](respondWithResult(_0x4f3447,null))[_0xb514('0x5c')](handleError(_0x4f3447,null));};exports['addDisposition']=function(_0x311a02,_0x284ffa,_0x292c5c){if(_0x311a02[_0xb514('0x5e')]['id']){delete _0x311a02[_0xb514('0x5e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x311a02[_0xb514('0x59')]['id']}})['then'](handleEntityNotFound(_0x284ffa,null))['then'](function(_0x3f5c99){if(_0x3f5c99){_0x311a02['body'][_0xb514('0x67')]=_0x3f5c99['id'];return db[_0xb514('0x68')][_0xb514('0x5d')](_0x311a02['body']);}})[_0xb514('0x38')](respondWithResult(_0x284ffa,null))['catch'](handleError(_0x284ffa,null));};exports[_0xb514('0x69')]=function(_0x320112,_0x5b0f9a,_0x2c3567){var _0x3816e9={'raw':![],'where':{}};var _0x97fde={};var _0x9007c8={'count':0x0,'rows':[]};return db[_0xb514('0x3e')][_0xb514('0x6a')]({'where':{'id':_0x320112[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x5b0f9a,null))[_0xb514('0x38')](function(_0x26a935){if(_0x26a935){_0x97fde[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0x68')][_0xb514('0x3f')]);_0x97fde[_0xb514('0x44')]=_[_0xb514('0x45')](_0x320112[_0xb514('0x44')]);_0x97fde[_0xb514('0x46')]=_['intersection'](_0x97fde[_0xb514('0x43')],_0x97fde[_0xb514('0x44')]);_0x3816e9[_0xb514('0x48')]=_[_0xb514('0x47')](_0x97fde[_0xb514('0x43')],qs['fields'](_0x320112[_0xb514('0x44')][_0xb514('0x49')]));_0x3816e9[_0xb514('0x48')]=_0x3816e9[_0xb514('0x48')]['length']?_0x3816e9[_0xb514('0x48')]:_0x97fde[_0xb514('0x43')];if(!_0x320112[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x3816e9[_0xb514('0x31')]=qs[_0xb514('0x31')](_0x320112[_0xb514('0x44')]['limit']);_0x3816e9[_0xb514('0x2f')]=qs['offset'](_0x320112['query']['offset']);}_0x3816e9[_0xb514('0x4c')]=qs[_0xb514('0x4d')](_0x320112[_0xb514('0x44')]['sort']);_0x3816e9[_0xb514('0x4e')]=qs[_0xb514('0x46')](_['pick'](_0x320112['query'],_0x97fde[_0xb514('0x46')]));_0x3816e9[_0xb514('0x4e')][_0xb514('0x67')]=_0x26a935['id'];if(_0x320112[_0xb514('0x44')][_0xb514('0x50')]){_0x3816e9[_0xb514('0x4e')]=_['merge'](_0x3816e9[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x3816e9['attributes'],function(_0x567b08){var _0x1b7bd9={};_0x1b7bd9[_0x567b08]={'$like':'%'+_0x320112[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x1b7bd9;})});}_0x3816e9=_[_0xb514('0x51')]({},_0x3816e9,_0x320112[_0xb514('0x53')]);return db['Disposition']['count']({'where':_0x3816e9[_0xb514('0x4e')]})[_0xb514('0x38')](function(_0x6ce25b){_0x9007c8[_0xb514('0x32')]=_0x6ce25b;if(_0x320112[_0xb514('0x44')]['includeAll']){_0x3816e9[_0xb514('0x55')]=[{'all':!![]}];}return db[_0xb514('0x68')]['findAll'](_0x3816e9);})[_0xb514('0x38')](function(_0x37f1e9){_0x9007c8[_0xb514('0x57')]=_0x37f1e9;return _0x9007c8;});}})[_0xb514('0x38')](respondWithFilteredResult(_0x5b0f9a,_0x3816e9))['catch'](handleError(_0x5b0f9a,null));};exports['removeDispositions']=function(_0x51bdab,_0x369699,_0x344488){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x51bdab[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x369699,null))[_0xb514('0x38')](function(_0xc42cf7){if(_0xc42cf7){return _0xc42cf7[_0xb514('0x6b')](_0x51bdab[_0xb514('0x44')][_0xb514('0x6c')]);}})['then'](respondWithStatusCode(_0x369699,null))['catch'](handleError(_0x369699,null));};exports[_0xb514('0x6d')]=function(_0x2d9c9b,_0x2d6db0,_0x206892){if(_0x2d9c9b[_0xb514('0x5e')]['id']){delete _0x2d9c9b[_0xb514('0x5e')]['id'];}return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x2d9c9b[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x2d6db0,null))[_0xb514('0x38')](function(_0x40bbeb){if(_0x40bbeb){_0x2d9c9b['body'][_0xb514('0x67')]=_0x40bbeb['id'];return db['CannedAnswer'][_0xb514('0x5d')](_0x2d9c9b[_0xb514('0x5e')]);}})[_0xb514('0x38')](respondWithResult(_0x2d6db0,null))[_0xb514('0x5c')](handleError(_0x2d6db0,null));};exports[_0xb514('0x6e')]=function(_0x8fc975,_0x333004,_0x2d3137){var _0x2ec448={'raw':![],'where':{}};var _0xcdc64f={};var _0x5654cf={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x8fc975[_0xb514('0x59')]['id']}})['then'](handleEntityNotFound(_0x333004,null))[_0xb514('0x38')](function(_0x17d1c6){if(_0x17d1c6){_0xcdc64f[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0x6f')][_0xb514('0x3f')]);_0xcdc64f['query']=_[_0xb514('0x45')](_0x8fc975['query']);_0xcdc64f[_0xb514('0x46')]=_['intersection'](_0xcdc64f['model'],_0xcdc64f[_0xb514('0x44')]);_0x2ec448['attributes']=_[_0xb514('0x47')](_0xcdc64f[_0xb514('0x43')],qs[_0xb514('0x49')](_0x8fc975[_0xb514('0x44')]['fields']));_0x2ec448['attributes']=_0x2ec448['attributes']['length']?_0x2ec448['attributes']:_0xcdc64f['model'];if(!_0x8fc975[_0xb514('0x44')]['hasOwnProperty'](_0xb514('0x4b'))){_0x2ec448[_0xb514('0x31')]=qs['limit'](_0x8fc975[_0xb514('0x44')][_0xb514('0x31')]);_0x2ec448[_0xb514('0x2f')]=qs['offset'](_0x8fc975['query'][_0xb514('0x2f')]);}_0x2ec448[_0xb514('0x4c')]=qs['sort'](_0x8fc975[_0xb514('0x44')][_0xb514('0x4d')]);_0x2ec448[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x8fc975[_0xb514('0x44')],_0xcdc64f[_0xb514('0x46')]));_0x2ec448[_0xb514('0x4e')]['ChatWebsiteId']=_0x17d1c6['id'];if(_0x8fc975['query']['filter']){_0x2ec448[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x2ec448[_0xb514('0x4e')],{'$or':_['map'](_0x2ec448[_0xb514('0x48')],function(_0x578288){var _0x53388e={};_0x53388e[_0x578288]={'$like':'%'+_0x8fc975[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x53388e;})});}_0x2ec448=_['merge']({},_0x2ec448,_0x8fc975[_0xb514('0x53')]);return db[_0xb514('0x6f')][_0xb514('0x32')]({'where':_0x2ec448[_0xb514('0x4e')]})['then'](function(_0x4394f6){_0x5654cf[_0xb514('0x32')]=_0x4394f6;if(_0x8fc975[_0xb514('0x44')][_0xb514('0x54')]){_0x2ec448[_0xb514('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb514('0x56')](_0x2ec448);})[_0xb514('0x38')](function(_0x33cdca){_0x5654cf[_0xb514('0x57')]=_0x33cdca;return _0x5654cf;});}})[_0xb514('0x38')](respondWithFilteredResult(_0x333004,_0x2ec448))[_0xb514('0x5c')](handleError(_0x333004,null));};exports[_0xb514('0x70')]=function(_0x19a2ac,_0x5844b3,_0x3b63a8){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x19a2ac['params']['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x5844b3,null))[_0xb514('0x38')](function(_0x5a3c99){if(_0x5a3c99){return _0x5a3c99['removeAnswers'](_0x19a2ac[_0xb514('0x44')][_0xb514('0x6c')]);}})[_0xb514('0x38')](respondWithStatusCode(_0x5844b3,null))['catch'](handleError(_0x5844b3,null));};exports[_0xb514('0x71')]=function(_0xb9555c,_0xfd497d,_0x2e0448){_0xb9555c[_0xb514('0x5e')]['sitepic']=_0xb9555c[_0xb514('0x72')][_0xb514('0x73')];return db[_0xb514('0x3e')]['find']({'where':{'id':_0xb9555c[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0xfd497d,null))[_0xb514('0x38')](saveUpdates(_0xb9555c[_0xb514('0x5e')],null))[_0xb514('0x38')](respondWithResult(_0xfd497d,null))[_0xb514('0x5c')](handleError(_0xfd497d,null));};exports[_0xb514('0x74')]=function(_0x4e7c84,_0x40fb64,_0x22295b){_0x4e7c84[_0xb514('0x5e')]['agentAvatar']=_0x4e7c84[_0xb514('0x72')][_0xb514('0x73')];return db[_0xb514('0x3e')]['find']({'where':{'id':_0x4e7c84[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x40fb64,null))['then'](saveUpdates(_0x4e7c84[_0xb514('0x5e')],null))['then'](respondWithResult(_0x40fb64,null))['catch'](handleError(_0x40fb64,null));};exports[_0xb514('0x75')]=function(_0x4512da,_0x5819dd,_0x43511b){_0x4512da[_0xb514('0x5e')]['customerAvatar']=_0x4512da[_0xb514('0x72')]['filename'];return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x4512da[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x5819dd,null))[_0xb514('0x38')](saveUpdates(_0x4512da[_0xb514('0x5e')],null))['then'](respondWithResult(_0x5819dd,null))['catch'](handleError(_0x5819dd,null));};exports['addSystemAvatar']=function(_0x401753,_0x55b9e8,_0x164e51){_0x401753['body']['systemAvatar']=_0x401753[_0xb514('0x72')]['filename'];return db['ChatWebsite'][_0xb514('0x5b')]({'where':{'id':_0x401753[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x55b9e8,null))[_0xb514('0x38')](saveUpdates(_0x401753[_0xb514('0x5e')],null))['then'](respondWithResult(_0x55b9e8,null))[_0xb514('0x5c')](handleError(_0x55b9e8,null));};exports[_0xb514('0x76')]=function(_0x268c3e,_0xa01d52,_0x5721b5){var _0x20ca6e=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x79'));var _0x403ee1={'where':{'id':_0x268c3e[_0xb514('0x59')]['id']},'attributes':['id',_0xb514('0x7a')],'raw':!![]};var _0x29c604=![];return require(_0xb514('0x7b'))[_0xb514('0x7c')]()[_0xb514('0x38')](function(_0x2e42c0){if(_0x2e42c0){_0x29c604=_0x2e42c0[_0xb514('0x7d')];}})[_0xb514('0x38')](function(){return db[_0xb514('0x3e')]['find'](_0x403ee1);})['then'](handleEntityNotFound(_0xa01d52,null))[_0xb514('0x38')](function(_0x109628){if(_0x109628){if(!_[_0xb514('0x7e')](_0x109628[_0xb514('0x7a')])){if(fs['existsSync'](path[_0xb514('0x77')](config[_0xb514('0x78')],'server/files/images/logos/',_0x109628['sitepic']))&&_0x29c604){_0x20ca6e=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x7f'),_0x109628[_0xb514('0x7a')]);}}return _0xa01d52[_0xb514('0x80')](_0x20ca6e);}})[_0xb514('0x5c')](handleError(_0xa01d52,null));};exports[_0xb514('0x81')]=function(_0x31bb9e,_0x484cf8,_0x51436b){var _0x537207=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x82'));var _0x3e7440={'where':{'id':_0x31bb9e[_0xb514('0x59')]['id']},'attributes':['id',_0xb514('0x83')],'raw':!![]};return db['ChatWebsite'][_0xb514('0x5b')](_0x3e7440)[_0xb514('0x38')](handleEntityNotFound(_0x484cf8,null))[_0xb514('0x38')](function(_0x4cee49){if(_0x4cee49){if(!_['isNil'](_0x4cee49[_0xb514('0x83')])){if(fs['existsSync'](path[_0xb514('0x77')](config[_0xb514('0x78')],'server/files/images/avatars/',_0x4cee49[_0xb514('0x83')]))){_0x537207=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x84'),_0x4cee49[_0xb514('0x83')]);}}return _0x484cf8[_0xb514('0x80')](_0x537207);}})[_0xb514('0x5c')](handleError(_0x484cf8,null));};exports[_0xb514('0x85')]=function(_0x238e91,_0x14de0c,_0xab0f9b){var _0x483032=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x86'));var _0x44d8f5={'where':{'id':_0x238e91[_0xb514('0x59')]['id']},'attributes':['id','customerAvatar',_0xb514('0x87')],'raw':!![]};return db[_0xb514('0x3e')][_0xb514('0x5b')](_0x44d8f5)[_0xb514('0x38')](handleEntityNotFound(_0x14de0c,null))[_0xb514('0x38')](function(_0x1cf1c9){if(_0x1cf1c9){if(!_['isNil'](_0x1cf1c9[_0xb514('0x88')])){if(fs[_0xb514('0x89')](path['join'](config[_0xb514('0x78')],_0xb514('0x84'),_0x1cf1c9[_0xb514('0x88')]))&&_0x1cf1c9[_0xb514('0x87')]){_0x483032=path[_0xb514('0x77')](config[_0xb514('0x78')],'server/files/images/avatars/',_0x1cf1c9[_0xb514('0x88')]);}}return _0x14de0c[_0xb514('0x80')](_0x483032);}})[_0xb514('0x5c')](handleError(_0x14de0c,null));};exports[_0xb514('0x8a')]=function(_0x43ea62,_0x1f81ec,_0x5a18e5){var _0x162284=path[_0xb514('0x77')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x2f22b8={'where':{'id':_0x43ea62[_0xb514('0x59')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xb514('0x3e')][_0xb514('0x5b')](_0x2f22b8)[_0xb514('0x38')](handleEntityNotFound(_0x1f81ec,null))[_0xb514('0x38')](function(_0x18fdae){if(_0x18fdae){if(!_[_0xb514('0x7e')](_0x18fdae[_0xb514('0x8b')])){if(fs[_0xb514('0x89')](path['join'](config[_0xb514('0x78')],_0xb514('0x84'),_0x18fdae[_0xb514('0x8b')]))){_0x162284=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x84'),_0x18fdae['systemAvatar']);}}return _0x1f81ec['download'](_0x162284);}})[_0xb514('0x5c')](handleError(_0x1f81ec,null));};exports['notify']=function(_0x596c20,_0x797e3c,_0x387aab){var _0x16a674=require(_0xb514('0x8c'));var _0xcd9b6d=new _0x16a674();var _0x214701=_0xcd9b6d[_0xb514('0x8d')](_0x596c20[_0xb514('0x8e')][_0xb514('0x8f')])['getResult']();var _0x295cd5={'body':_0x596c20[_0xb514('0x5e')],'channel':'chat'};var _0x34e98c=[];var _0x53caea=[];var _0x56d021={};var _0x10d6ed=![];return db[_0xb514('0x90')][_0xb514('0x66')]()['then'](function(_0x4e2015){if(!_0x4e2015){throw new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0x93'));}_0x34e98c=_['difference'](_[_0xb514('0x45')](_0x4e2015),[_0xb514('0x94'),_0xb514('0x95')]);_0x53caea=_[_0xb514('0x96')](_[_0xb514('0x45')](_0x4e2015),[_0xb514('0x94'),'updatedAt',_0xb514('0x97'),'ListId']);if(_0x596c20['body']['id']){delete _0x596c20[_0xb514('0x5e')]['id'];}if(_[_0xb514('0x7e')](_0x596c20[_0xb514('0x5e')][_0xb514('0x98')])){throw new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0x99'));}if(_['isNil'](_0x596c20['body']['body'])||_0x596c20['body'][_0xb514('0x5e')]===''){throw new db[(_0xb514('0x91'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb514('0x7e')](_0x596c20[_0xb514('0x5e')]['mapKey'])){throw new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0x9a')+_0x53caea);}if(!_[_0xb514('0x9b')](_0x53caea,_0x596c20[_0xb514('0x5e')][_0xb514('0x9c')])){throw new db['Sequelize']['ValidationError'](_0xb514('0x9d')+_0x53caea);}_0x56d021[_0x596c20[_0xb514('0x5e')][_0xb514('0x9c')]]=_0x596c20[_0xb514('0x5e')][_0xb514('0x98')];})['then'](function(){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x596c20[_0xb514('0x59')]['id']},'include':[{'model':db[_0xb514('0x9e')],'as':_0xb514('0x9f'),'include':[{'model':db[_0xb514('0x90')],'as':_0xb514('0xa0'),'where':_0x56d021,'limit':0x1,'order':[[_0xb514('0x95'),_0xb514('0xa1')]]}]},{'model':db[_0xb514('0xa2')],'as':_0xb514('0xa3')}]});})[_0xb514('0x38')](handleEntityNotFound(_0x797e3c,null))[_0xb514('0x38')](function(_0xf442f5){if(_0xf442f5&&_0xf442f5[_0xb514('0x9f')]){_0x295cd5[_0xb514('0xa4')]=_0xf442f5;_0x295cd5[_0xb514('0xa5')]=_0xf442f5[_0xb514('0xa3')];_0x295cd5[_0xb514('0xa6')]=_0xf442f5[_0xb514('0x9f')];_0x295cd5[_0xb514('0xa5')]=_['orderBy'](_0x295cd5[_0xb514('0xa5')],[_0xb514('0xa7')],[_0xb514('0xa8')]);if(_0x295cd5[_0xb514('0xa4')][_0xb514('0xa3')]){delete _0x295cd5[_0xb514('0xa4')][_0xb514('0xa3')];}if(_0x295cd5[_0xb514('0xa4')][_0xb514('0x9f')]&&_0x295cd5[_0xb514('0xa4')][_0xb514('0x9f')][_0xb514('0xa0')]['length']){return _0x295cd5[_0xb514('0xa4')][_0xb514('0x9f')][_0xb514('0xa0')][0x0];}var _0x18f736=_['defaults'](_0x596c20[_0xb514('0x5e')],{'firstName':_0x596c20[_0xb514('0x5e')][_0xb514('0x98')],'ListId':_0xf442f5['ListId']});_0x18f736[_0x596c20['body'][_0xb514('0x9c')]]=_0x596c20[_0xb514('0x5e')][_0xb514('0x98')];return db[_0xb514('0x90')][_0xb514('0x5d')](_0x18f736,{'fields':_0x34e98c,'raw':!![]});}})[_0xb514('0x38')](handleEntityNotFound(_0x797e3c,null))['then'](function(_0x1302bb){_0x295cd5[_0xb514('0xa9')]=_0x1302bb;var _0x226a34=_0x596c20[_0xb514('0x5e')][_0xb514('0xaa')];if(_0x596c20[_0xb514('0x8e')][_0xb514('0xab')]){_0x226a34=_0x596c20[_0xb514('0x8e')][_0xb514('0xab')];}else if(_0x596c20[_0xb514('0x8e')]['x-forwarded-for']){_0x226a34=_[_0xb514('0xac')](_0x596c20[_0xb514('0x8e')][_0xb514('0xad')][_0xb514('0xae')](','));}if(_0x1302bb){var _0x312df5={'ContactId':_0x1302bb['id'],'ChatWebsiteId':_0x596c20['params']['id'],'from':(_0x1302bb[_0xb514('0xaf')]||'')+'\x20'+(_0x1302bb[_0xb514('0xb0')]||''),'customerIp':_0x226a34,'customerPort':_0x596c20[_0xb514('0x8e')][_0xb514('0xb1')]?_0x596c20['headers'][_0xb514('0xb1')]:null,'referer':_0x596c20[_0xb514('0x5e')][_0xb514('0xb2')],'browserName':_0x214701[_0xb514('0xb3')][_0xb514('0x3b')]&&_0x214701[_0xb514('0xb3')][_0xb514('0xb4')]?util[_0xb514('0xb5')](_0xb514('0xb6'),_0x214701[_0xb514('0xb3')][_0xb514('0x3b')],_0x214701[_0xb514('0xb3')][_0xb514('0xb4')]):_0xb514('0xb7'),'browserVersion':_0x214701[_0xb514('0xb3')][_0xb514('0xb4')]||_0xb514('0xb7'),'osName':util['format'](_0xb514('0xb6'),_0x214701['os'][_0xb514('0x3b')],_0x214701['os'][_0xb514('0xb4')]),'osVersion':_0x214701['os'][_0xb514('0xb4')],'deviceModel':_0x214701[_0xb514('0xb8')]['model']&&_0x214701[_0xb514('0xb8')][_0xb514('0xb9')]?util[_0xb514('0xb5')]('%s\x20%s\x20%s',_0x214701[_0xb514('0xb8')][_0xb514('0x43')],_0x214701[_0xb514('0xb8')][_0xb514('0xb9')],_0x214701[_0xb514('0xb8')][_0xb514('0x41')]):null,'deviceVendor':_0x214701[_0xb514('0xb8')][_0xb514('0xb9')],'deviceType':_0x214701['device']['type'],'formData':JSON['stringify'](_0x596c20['body'])};var _0x2134c0={'ChatWebsiteId':_0x596c20['params']['id'],'closed':![]};if(_0x596c20[_0xb514('0x5e')][_0xb514('0xba')]){_0x2134c0[_0xb514('0xba')]=_0x596c20['body'][_0xb514('0xba')];return db[_0xb514('0xbb')][_0xb514('0x5b')]({'where':_0x2134c0})[_0xb514('0x38')](function(_0x1240b9){if(_0x1240b9){return[_0x1240b9,![]];}_0x312df5[_0xb514('0xba')]=_0x596c20['body'][_0xb514('0xba')];_0x312df5[_0xb514('0xbc')]=_0x596c20['body'][_0xb514('0xbc')];return db[_0xb514('0xbb')][_0xb514('0x5d')](_0x312df5)[_0xb514('0x38')](function(_0xfc2de2){return[_0xfc2de2,!![]];});});}_0x2134c0[_0xb514('0xbd')]=_0x1302bb['id'];if(_0x596c20[_0xb514('0x5e')][_0xb514('0xbe')]&&_0x596c20[_0xb514('0x5e')][_0xb514('0xbe')]['id']){_0x2134c0['id']=_0x596c20[_0xb514('0x5e')][_0xb514('0xbe')]['id'];return db[_0xb514('0xbb')][_0xb514('0x5b')]({'where':_0x2134c0})['then'](function(_0x4c4d95){if(_0x4c4d95){return[_0x4c4d95,![]];}return db[_0xb514('0xbb')]['create'](_0x312df5)['then'](function(_0x21cdf4){return[_0x21cdf4,!![]];});});}return db['ChatInteraction'][_0xb514('0x5d')](_0x312df5)[_0xb514('0x38')](function(_0x5edbea){return[_0x5edbea,!![]];});}})[_0xb514('0xbf')](function(_0x4d14e4,_0x31892d){if(_0x4d14e4){_0x10d6ed=_0x31892d;if(!_0x31892d){var _0x41c55d={'from':(_0x295cd5['contact'][_0xb514('0xaf')]||'')+'\x20'+(_0x295cd5['contact'][_0xb514('0xb0')]||'')};if(_0x596c20[_0xb514('0x5e')]['threadId']&&_0x596c20[_0xb514('0x5e')]['messageId']&&_0x596c20[_0xb514('0x5e')][_0xb514('0xba')]!=_0x596c20[_0xb514('0x5e')][_0xb514('0xc0')]){_0x41c55d['threadId']=_0x596c20[_0xb514('0x5e')]['messageId'];}return _0x4d14e4['update'](_0x41c55d);}else{return _0x4d14e4;}}})[_0xb514('0x38')](function(_0x1a82e5){_0x295cd5['interaction']=_0x1a82e5[_0xb514('0x61')]({'plain':!![]});_0x295cd5[_0xb514('0xbe')][_0xb514('0xc1')]=_0x10d6ed;if(_0x295cd5[_0xb514('0xbe')][_0xb514('0xc1')]){if(_0x295cd5['account'][_0xb514('0xc2')]){_0x295cd5[_0xb514('0xa5')][_0xb514('0xc3')]({'id':0x0,'priority':_0x295cd5[_0xb514('0xa5')]['length']+0x1,'app':_0xb514('0xc4'),'appdata':_0xb514('0xc5'),'interval':'*,*,*,*'});}}return db[_0xb514('0xc6')]['create']({'body':_0x596c20['body'][_0xb514('0x5e')],'ChatWebsiteId':_0x596c20['params']['id'],'ChatInteractionId':_0x1a82e5['id'],'direction':'in','ContactId':_0x295cd5[_0xb514('0xa9')]['id'],'AttachmentId':_0x596c20['body']['AttachmentId']});})[_0xb514('0x38')](function(_0x1f6819){_0x295cd5[_0xb514('0x28')]=_0x1f6819;if(_0x295cd5[_0xb514('0xbe')][_0xb514('0xc7')]){return db[_0xb514('0xc8')][_0xb514('0x5b')]({'attributes':['id','name'],'where':{'id':_0x295cd5[_0xb514('0xbe')][_0xb514('0xc7')]}})[_0xb514('0x38')](function(_0x22f8aa){if(_0x22f8aa){_0x295cd5[_0xb514('0xa5')][_0xb514('0xc9')]({'id':0x0,'priority':0x0,'app':_0xb514('0xca'),'appdata':_0x22f8aa['name']+','+(_0x295cd5[_0xb514('0xa4')][_0xb514('0xcb')]||0xa),'interval':_0xb514('0xcc')});_0x295cd5[_0xb514('0xcd')]=!![];}return respondWithRpcPromise(_0xb514('0xce'),_0xb514('0xcf'),_0x295cd5);});}return respondWithRpcPromise(_0xb514('0xce'),'startRouting',_0x295cd5);})[_0xb514('0x38')](function(_0x25bef0){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x25bef0},client9002);return _0x25bef0;})[_0xb514('0x38')](respondWithResult(_0x797e3c,null))[_0xb514('0x5c')](handleError(_0x797e3c,null));};exports[_0xb514('0xd0')]=function(_0x981d6c,_0x3f77a5,_0x55d140){var _0x1dec1c,_0x15834a,_0x4027b0;var _0x4170b6=[];var _0x20ee69=[];var _0x14ff73={};var _0x1dbdbc=_0x981d6c[_0xb514('0xd1')]||[];var _0x2255e0=[];var _0x1b678a;return db[_0xb514('0x90')][_0xb514('0x66')]()[_0xb514('0x38')](function(_0x179dbe){if(!_0x179dbe){throw new db['Sequelize'][(_0xb514('0x92'))](_0xb514('0x93'));}_0x20ee69=_[_0xb514('0x96')](_[_0xb514('0x45')](_0x179dbe),[_0xb514('0x94'),_0xb514('0x95')]);_0x4170b6=_['difference'](_['keys'](_0x179dbe),[_0xb514('0x94'),'updatedAt','CompanyId',_0xb514('0xd2')]);if(_0x981d6c[_0xb514('0x5e')]['id']){delete _0x981d6c[_0xb514('0x5e')]['id'];}if(_[_0xb514('0x7e')](_0x981d6c['body'][_0xb514('0x98')])){throw _0x3f77a5[_0xb514('0x2c')](0x1f4)[_0xb514('0xd3')](new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0x99')));}if(_[_0xb514('0x7e')](_0x981d6c[_0xb514('0x5e')]['body'])||_0x981d6c[_0xb514('0x5e')][_0xb514('0x5e')]===''){throw _0x3f77a5[_0xb514('0x2c')](0x1f4)[_0xb514('0xd3')](new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0xd4')));}if(_[_0xb514('0x7e')](_0x981d6c[_0xb514('0x5e')]['mapKeyOffline'])){throw _0x3f77a5[_0xb514('0x2c')](0x1f4)[_0xb514('0xd3')](new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0xd5')+_0x4170b6));}if(!_[_0xb514('0x9b')](_0x4170b6,_0x981d6c[_0xb514('0x5e')][_0xb514('0xd6')])){throw _0x3f77a5[_0xb514('0x2c')](0x1f4)['send'](new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0xd7')+_0x4170b6));}_0x14ff73[_0x981d6c[_0xb514('0x5e')][_0xb514('0xd6')]]=_0x981d6c[_0xb514('0x5e')][_0xb514('0x98')];})[_0xb514('0x38')](function(){return db[_0xb514('0x3e')]['find']({'where':{'id':_0x981d6c['params']['id']},'include':[{'model':db[_0xb514('0x9e')],'as':_0xb514('0x9f')},{'model':db[_0xb514('0xd8')],'as':'MailAccount'}]});})[_0xb514('0x38')](handleEntityNotFound(_0x3f77a5,null))[_0xb514('0x38')](function(_0x23ee2d){if(_0x23ee2d&&_0x23ee2d['List']){_0x15834a=_0x23ee2d;var _0x2b8645=_[_0xb514('0x19')](_0x981d6c['body'],{'firstName':_0x981d6c['body'][_0xb514('0x98')],'phone':_0x981d6c[_0xb514('0x5e')][_0xb514('0x98')],'ListId':_0x23ee2d[_0xb514('0xd2')]});_0x2b8645[_0x981d6c[_0xb514('0x5e')][_0xb514('0xd6')]]=_0x981d6c[_0xb514('0x5e')][_0xb514('0x98')];return db[_0xb514('0x90')][_0xb514('0xd9')]({'where':_0x14ff73,'defaults':_0x2b8645});}})[_0xb514('0xbf')](function(_0x5a5031){if(_0x5a5031){_0x4027b0=_0x5a5031;var _0x233e04=fs[_0xb514('0xda')](path[_0xb514('0x77')](config['root'],_0xb514('0xdb')),_0xb514('0xdc'));var _0x24e582=ejs[_0xb514('0xdd')](_0x233e04,{'body':_[_0xb514('0xde')](_0x981d6c[_0xb514('0x5e')][_0xb514('0x5e')]),'bodyTitle':_0x15834a[_0xb514('0xdf')]});return db[_0xb514('0xe0')][_0xb514('0x5d')]({'body':_0x24e582,'ContactId':_0x5a5031['id'],'ChatWebsiteId':_0x15834a['id']});}})['then'](function(_0x59942b){_0x1b678a=_0x59942b;if(_0x1dbdbc['length']){var _0xb89ada=_0x1dbdbc['map'](function(_0x5e5299){return{'name':_0x5e5299['originalname'],'basename':_0x5e5299[_0xb514('0x73')],'type':_0x5e5299[_0xb514('0xe1')],'ChatOfflineMessageId':_0x59942b['id']};});_0x2255e0=_0xb89ada[_0xb514('0x3d')](_0x1b7e5f=>{var _0x5cf898={'filename':_0x1b7e5f[_0xb514('0x3b')],'path':path['join'](config[_0xb514('0x78')],_0xb514('0xe2'),_0xb514('0xd1'),_0xb514('0xe3'),_0xb514('0xe4'),_0x1b7e5f[_0xb514('0xe5')])};return _0x5cf898;});if(!_0x15834a[_0xb514('0xe6')]){return db[_0xb514('0xe7')]['transaction'](function(_0xd777d6){return db[_0xb514('0xe8')][_0xb514('0xe9')](_0xb89ada,{'transaction':_0xd777d6});});}}})[_0xb514('0x38')](function(){if(_0x1b678a){_0x1dec1c=_0x1b678a;return db['MailAccount'][_0xb514('0x6a')]({'where':{'active':!![]},'include':[{'model':db[_0xb514('0xea')],'as':_0xb514('0xeb'),'raw':!![]}]});}})[_0xb514('0x38')](function(_0x179c04){if(_0x179c04&&_0x179c04[_0xb514('0xeb')]&&_0x15834a[_0xb514('0xec')]&&_0x15834a[_0xb514('0xed')]){var _0x429da8={'tls':{'rejectUnauthorized':![]}};if(_0x179c04[_0xb514('0xeb')][_0xb514('0xee')]){_0x429da8[_0xb514('0xee')]=_0x179c04[_0xb514('0xeb')]['service'];}else{_0x429da8[_0xb514('0xef')]=_0x179c04['Smtp']['host'];_0x429da8[_0xb514('0xf0')]=_0x179c04[_0xb514('0xeb')][_0xb514('0xf0')];_0x429da8[_0xb514('0xf1')]=_0x179c04[_0xb514('0xeb')][_0xb514('0xf1')];}if(_0x179c04[_0xb514('0xeb')][_0xb514('0xf2')]){_0x429da8[_0xb514('0xf3')]={'user':_0x179c04[_0xb514('0xeb')][_0xb514('0x5f')],'pass':_0x179c04[_0xb514('0xeb')]['pass']};}return respondWithRpcPromise('SendMail',_0xb514('0xf4'),{'account':_0x429da8,'message':{'from':util['format'](_0xb514('0xf5'),_0x179c04['name'],_0x179c04['email']||_0x179c04[_0xb514('0xeb')][_0xb514('0x5f')]),'to':_0x15834a['forwardOfflineAddress'],'subject':_0x15834a['offlineMessageSubject'],'html':_0x1dec1c[_0xb514('0x5e')],'attachments':_0x2255e0}},client9003)[_0xb514('0x38')](function(){return _0x1dec1c;})[_0xb514('0x5c')](function(_0x1aba5c){console[_0xb514('0x26')](_0x1aba5c);});}})['then'](function(){if(_0x15834a&&_0x15834a['openNewInteraction']&&_0x15834a[_0xb514('0xf6')]){var _0xe65525=[];if(_0x1dbdbc[_0xb514('0xf7')]){_0xe65525=_0x1dbdbc[_0xb514('0x3d')](function(_0x15584d){return{'name':_0x15584d[_0xb514('0xf8')],'basename':_0x15584d[_0xb514('0x73')],'type':_0x15584d[_0xb514('0xe1')],'ChatOfflineMessageId':_0x1b678a['id']};});}var _0x53208e;if(!_[_0xb514('0x7e')](_0x15834a[_0xb514('0xf9')])){var _0x2389d5=_[_0xb514('0x3d')](_0x981d6c['body'],function(_0x4786e6){return _0x4786e6;});var _0x14558a=_['toPairsIn'](_0x2389d5)[0x0];var _0x543ffe=_['mapValues'](_0x14558a,function(_0x361b7b){return _0x361b7b;});_0x53208e=_0x543ffe[0x1][_0x15834a[_0xb514('0xf9')]];}var _0x1b3591={'from':_0x4027b0[_0xb514('0xfa')],'firstName':_0x4027b0['firstName'],'lastName':_0x4027b0['lastName'],'mapKey':_0xb514('0xfa'),'message':{'from':_0x4027b0[_0xb514('0xfa')],'to':_0x15834a['MailAccount'][_0xb514('0xfa')],'cc':'','subject':_[_0xb514('0x7e')](_0x53208e)?_0x15834a[_0xb514('0xfb')]:_0x53208e,'messageId':'','sentAt':new Date(),'attach':_0xe65525['length'],'attachments':_0xe65525,'originChannel':_0xb514('0xfc'),'ChatWebsiteId':_0x15834a['id'],'ChatOfflineMessageId':_0x1dec1c['id'],'originTo':_0x15834a['MailAccount']['email']},'body':_0x1dec1c[_0xb514('0x5e')]};var _0x715c1f={'account':{'id':_0x15834a[_0xb514('0xf6')]},'body':_0x1b3591,'log':_0xb514('0xfd')};return respondWithRpcPromise(_0xb514('0xfd'),_0xb514('0xfe'),_0x715c1f,client9001)[_0xb514('0x38')](function(){return _0x1dec1c;})[_0xb514('0x5c')](function(_0x375541){console[_0xb514('0x26')](_0x375541);});}return;})[_0xb514('0x38')](function(){if(_0x1dec1c){return _0x1dec1c;}})[_0xb514('0x38')](respondWithResult(_0x3f77a5,null))[_0xb514('0x5c')](function(_0xcad9ec){console[_0xb514('0x26')](_0xb514('0x5c'),_0xcad9ec);for(var _0x4374da of _0x1dbdbc){var _0x12e8d5=path[_0xb514('0x77')](config['root'],_0xb514('0xe2'),'files',_0xb514('0xe3'),_0xb514('0xe4'),_0x4374da[_0xb514('0x73')]);fs_extra[_0xb514('0xff')](_0x12e8d5)[_0xb514('0x5c')](function(_0x4c9a1f){console[_0xb514('0x26')](_0xb514('0x100'),_0x12e8d5,_0x4c9a1f);});}});};exports[_0xb514('0x101')]=function(_0x1f197e,_0x210553,_0x3fabbc){return db[_0xb514('0xbb')][_0xb514('0x5b')]({'where':{'id':_0x1f197e[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x210553,null))[_0xb514('0x38')](function(_0x427fb1){if(_0x427fb1){return _0x427fb1[_0xb514('0x101')](_0x1f197e[_0xb514('0x5e')]['ids'],_[_0xb514('0x102')](_0x1f197e['body'],[_0xb514('0x6c'),'id'])||{});}})[_0xb514('0x38')](respondWithResult(_0x210553,null))[_0xb514('0x5c')](handleError(_0x210553,null));};exports[_0xb514('0x103')]=function(_0x49edab,_0x59be2d,_0x55f105){var _0x50aa0c={'raw':![],'where':{}};var _0x1c81a3={};var _0x50d8db={'count':0x0,'rows':[]};return db[_0xb514('0x3e')][_0xb514('0x6a')]({'where':{'id':_0x49edab['params']['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x59be2d,null))[_0xb514('0x38')](function(_0x1c1439){if(_0x1c1439){_0x1c81a3[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0xbb')][_0xb514('0x3f')]);_0x1c81a3[_0xb514('0x44')]=_[_0xb514('0x45')](_0x49edab[_0xb514('0x44')]);_0x1c81a3['filters']=_['intersection'](_0x1c81a3[_0xb514('0x43')],_0x1c81a3[_0xb514('0x44')]);_0x50aa0c[_0xb514('0x48')]=_['intersection'](_0x1c81a3['model'],qs[_0xb514('0x49')](_0x49edab[_0xb514('0x44')][_0xb514('0x49')]));_0x50aa0c[_0xb514('0x48')]=_0x50aa0c[_0xb514('0x48')][_0xb514('0xf7')]?_0x50aa0c[_0xb514('0x48')]:_0x1c81a3[_0xb514('0x43')];if(!_0x49edab[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x50aa0c['limit']=qs['limit'](_0x49edab[_0xb514('0x44')][_0xb514('0x31')]);_0x50aa0c[_0xb514('0x2f')]=qs[_0xb514('0x2f')](_0x49edab[_0xb514('0x44')][_0xb514('0x2f')]);}_0x50aa0c[_0xb514('0x4c')]=qs['sort'](_0x49edab[_0xb514('0x44')][_0xb514('0x4d')]);_0x50aa0c[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x49edab[_0xb514('0x44')],_0x1c81a3[_0xb514('0x46')]));_0x50aa0c[_0xb514('0x4e')][_0xb514('0x67')]=_0x1c1439['id'];if(_0x49edab[_0xb514('0x44')][_0xb514('0x50')]){_0x50aa0c[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x50aa0c[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x50aa0c[_0xb514('0x48')],function(_0x354cbf){var _0x389879={};_0x389879[_0x354cbf]={'$like':'%'+_0x49edab[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x389879;})});}_0x50aa0c=_[_0xb514('0x51')]({},_0x50aa0c,_0x49edab[_0xb514('0x53')]);return db['ChatInteraction'][_0xb514('0x32')]({'where':_0x50aa0c[_0xb514('0x4e')]})['then'](function(_0x1f6e8a){_0x50d8db['count']=_0x1f6e8a;if(_0x49edab[_0xb514('0x44')][_0xb514('0x54')]){_0x50aa0c['include']=[{'model':db[_0xb514('0x90')],'as':_0xb514('0x104'),'required':![]},{'model':db['User'],'as':_0xb514('0x105'),'attributes':['name',_0xb514('0x106'),_0xb514('0x107')],'required':![]},{'model':db[_0xb514('0x108')],'as':'Tags','attributes':['id',_0xb514('0x3b'),_0xb514('0x109')],'where':_0x49edab[_0xb514('0x44')][_0xb514('0x10a')]?{'id':_0x49edab[_0xb514('0x44')][_0xb514('0x10a')]}:undefined,'required':_0x49edab['query'][_0xb514('0x10a')]?!![]:![]}];}return db['ChatInteraction'][_0xb514('0x56')](_0x50aa0c);})[_0xb514('0x38')](function(_0x37c145){_0x50d8db['rows']=_0x37c145;return _0x50d8db;});}})['then'](respondWithFilteredResult(_0x59be2d,_0x50aa0c))[_0xb514('0x5c')](handleError(_0x59be2d,null));};function iftimePromise(_0x788d73,_0x492c26){return respondWithRpcPromise(_0xb514('0x10b'),_0xb514('0x10c'),{'command':_0x492c26[_0xb514('0x10d')]?util[_0xb514('0xb5')](_0xb514('0x10e'),_0x788d73['interval'],_0x492c26[_0xb514('0x10d')]):util[_0xb514('0xb5')]('iftime\x20%s',_0x788d73[_0xb514('0x10f')])},client9002)['then'](function(_0x1fd1bd){var _0x334586=_0x1fd1bd&&_0x1fd1bd['indexOf'](_0xb514('0x110'))>=0x0?!![]:![];logger[_0xb514('0x29')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x492c26['id'],_0x788d73['id'],_0x788d73[_0xb514('0x10f')],_0x334586?_0xb514('0x111'):'OFFLINE',_0x492c26[_0xb514('0x10d')]?_0x492c26[_0xb514('0x10d')]:_0xb514('0x112'));return _0x334586;})[_0xb514('0x5c')](function(_0x574543){logger['error'](_0xb514('0x113'),_0x492c26['id'],_0x788d73['id'],_0x788d73[_0xb514('0x10f')],util[_0xb514('0x114')](_0x574543,{'showHidden':![],'depth':null}),_0x492c26[_0xb514('0x10d')]?_0x492c26[_0xb514('0x10d')]:'No\x20timezone');return![];});}exports[_0xb514('0x10c')]=function(_0x3b0387,_0x4eba3e,_0x3ebe67){var _0x250eb9=0x0;var _0x1a24a9=0x0;var _0x310a55=![];var _0x5d4bfc;var _0x5568e4;return db[_0xb514('0x3e')]['find']({'where':{'id':_0x3b0387[_0xb514('0x59')]['id']},'include':[{'model':db['Interval'],'as':_0xb514('0x115'),'include':[{'model':db[_0xb514('0x115')],'as':_0xb514('0x116'),'attributes':['id',_0xb514('0x10f')],'raw':!![]}]}]})[_0xb514('0x38')](handleEntityNotFound(_0x4eba3e,null))['then'](function(_0x294641){if(_0x294641){_0x5d4bfc=_0x294641;return _0x294641[_0xb514('0x117')]({'raw':!![]});}})['then'](function(_0x471ecd){if(_0x5d4bfc){if(_0x471ecd){_0x5568e4=_0x471ecd;}}return require(_0xb514('0x7b'))[_0xb514('0x7c')]();})[_0xb514('0x38')](function(_0x1ff43b){if(_0x1ff43b){_0x1a24a9=_0x1ff43b[_0xb514('0x118')];_0x310a55=_0x1ff43b[_0xb514('0x7d')];}})[_0xb514('0x38')](function(){return db[_0xb514('0xbb')][_0xb514('0x32')]({'where':{'closed':![]}});})[_0xb514('0x38')](function(_0x331055){_0x250eb9=_0x331055;if(_0x1a24a9&&_0x331055>_0x1a24a9){return db[_0xb514('0x119')][_0xb514('0x6a')]({'where':{'id':0x1}})[_0xb514('0x38')](function(_0x515e4f){if(_0x515e4f){_0x515e4f[_0xb514('0x11a')]('chatLicenseExceeded');}});}})[_0xb514('0x38')](function(){if(_0x5d4bfc[_0xb514('0x115')]&&_0x5d4bfc[_0xb514('0x115')][_0xb514('0x116')]){var _0x40997d=[];for(var _0x52db77=0x0;_0x52db77<_0x5d4bfc[_0xb514('0x115')][_0xb514('0x116')]['length'];_0x52db77++){var _0x449e1f=_0x5d4bfc[_0xb514('0x115')][_0xb514('0x116')][_0x52db77][_0xb514('0x61')]({'plain':!![]});_0x40997d[_0xb514('0xc3')](iftimePromise(_0x449e1f,_0x5d4bfc));}return BPromise[_0xb514('0x11b')](_0x40997d)[_0xb514('0x38')](function(_0xcf3572){return _[_0xb514('0x11c')](_0xcf3572);});}else{return!![];}})[_0xb514('0x38')](function(_0x322d87){var _0x35176c=fs[_0xb514('0xda')](path['join'](config[_0xb514('0x78')],_0xb514('0x11d')),_0xb514('0xdc'));var _0x2e3b78={'remote':_0x5d4bfc[_0xb514('0x11e')],'query':querystring[_0xb514('0x25')](_['merge'](_0x5d4bfc[_0xb514('0x61')]({'plain':!![]}),{'customerIp':_0x3b0387[_0xb514('0x8e')][_0xb514('0xad')]||_0x3b0387['headers'][_0xb514('0x11f')]||_0x3b0387[_0xb514('0x120')]['remoteAddress']||_0x3b0387['ip'],'referer':_0x3b0387['headers'][_0xb514('0xb2')],'openedInteractions':_0x250eb9,'maxInteractions':_0x1a24a9,'virtual':_0x310a55[_0xb514('0x118')],'online':_0x322d87,'custom':_0x310a55}))[_0xb514('0x121')](/'/g,'\x5c\x27')};_0x4eba3e['send'](ejs['render'](Mustache[_0xb514('0xdd')](_0x35176c,_0x2e3b78),{'proactiveActions':_0x5568e4,'alignment':_0x5d4bfc[_0xb514('0x122')],'verticalAlignment':_0x5d4bfc[_0xb514('0x123')],'div_color':_0x5d4bfc[_0xb514('0x109')],'text_color':_0x5d4bfc['textColor'],'button_color':_0x5d4bfc[_0xb514('0x124')],'background_color':_0x5d4bfc[_0xb514('0x125')]}));})[_0xb514('0x5c')](handleError(_0x4eba3e,null));};exports[_0xb514('0x126')]=function(_0xf67543,_0x587b4b,_0x587d79){return db['ChatWebsite']['findOne']({'where':{'id':_0xf67543['params']['id']}})['then'](handleEntityNotFound(_0x587b4b,null))[_0xb514('0x38')](function(_0x3796fd){if(_0x3796fd){return db[_0xb514('0xe7')][_0xb514('0x127')](function(_0x57989d){return db[_0xb514('0xa2')][_0xb514('0x39')]({'where':{'ChatWebsiteId':_0xf67543[_0xb514('0x59')]['id']},'transaction':_0x57989d})[_0xb514('0x38')](function(_0x255dbf){var _0xc29c32=_[_0xb514('0x3d')](_0xf67543[_0xb514('0x5e')],function(_0x11db5d){_0x11db5d[_0xb514('0x67')]=_0xf67543[_0xb514('0x59')]['id'];return _0x11db5d;});return db[_0xb514('0xa2')]['bulkCreate'](_0xc29c32,{'transaction':_0x57989d});});})[_0xb514('0x38')](function(){return db[_0xb514('0xa2')][_0xb514('0x128')]({'where':{'ChatWebsiteId':_0xf67543[_0xb514('0x59')]['id']},'order':_0xb514('0xa7')});});}})[_0xb514('0x38')](respondWithResult(_0x587b4b,null))[_0xb514('0x5c')](handleError(_0x587b4b,null));};exports['getApplications']=function(_0x4cf11c,_0x340657,_0x16ae37){var _0x16a91f={};var _0x5c9a92={};var _0x4fd69a;var _0x4ce215;return db['ChatWebsite'][_0xb514('0x6a')]({'where':{'id':_0x4cf11c[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x340657,null))['then'](function(_0xd83305){if(_0xd83305){_0x4fd69a=_0xd83305;_0x5c9a92[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0xa2')][_0xb514('0x3f')]);_0x5c9a92[_0xb514('0x44')]=_[_0xb514('0x45')](_0x4cf11c[_0xb514('0x44')]);_0x5c9a92[_0xb514('0x46')]=_[_0xb514('0x47')](_0x5c9a92[_0xb514('0x43')],_0x5c9a92[_0xb514('0x44')]);_0x16a91f[_0xb514('0x48')]=_[_0xb514('0x47')](_0x5c9a92['model'],qs['fields'](_0x4cf11c['query'][_0xb514('0x49')]));_0x16a91f[_0xb514('0x48')]=_0x16a91f[_0xb514('0x48')][_0xb514('0xf7')]?_0x16a91f[_0xb514('0x48')]:_0x5c9a92[_0xb514('0x43')];_0x16a91f[_0xb514('0x4c')]=qs[_0xb514('0x4d')](_0x4cf11c[_0xb514('0x44')]['sort']);_0x16a91f[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x4cf11c[_0xb514('0x44')],_0x5c9a92[_0xb514('0x46')]));if(_0x4cf11c[_0xb514('0x44')]['filter']){_0x16a91f[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x16a91f['where'],{'$or':_[_0xb514('0x3d')](_0x16a91f['attributes'],function(_0x4b3374){var _0x745a57={};_0x745a57[_0x4b3374]={'$like':'%'+_0x4cf11c[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x745a57;})});}_0x16a91f=_[_0xb514('0x51')]({},_0x16a91f,_0x4cf11c[_0xb514('0x53')]);return _0x4fd69a[_0xb514('0x129')](_0x16a91f);}})[_0xb514('0x38')](function(_0x4e1920){if(_0x4e1920){_0x4ce215=_0x4e1920[_0xb514('0xf7')];if(!_0x4cf11c[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x16a91f[_0xb514('0x31')]=qs[_0xb514('0x31')](_0x4cf11c['query'][_0xb514('0x31')]);_0x16a91f['offset']=qs[_0xb514('0x2f')](_0x4cf11c['query'][_0xb514('0x2f')]);}return _0x4fd69a[_0xb514('0x129')](_0x16a91f);}})[_0xb514('0x38')](function(_0x430ffd){if(_0x430ffd){return _0x430ffd?{'count':_0x4ce215,'rows':_0x430ffd}:null;}})[_0xb514('0x38')](respondWithResult(_0x340657,null))['catch'](handleError(_0x340657,null));};exports[_0xb514('0x12a')]=function(_0x5582e5,_0x4728cb,_0x356cf8){return db[_0xb514('0x12b')][_0xb514('0x5b')]({'where':{'id':_0x5582e5[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x4728cb,null))[_0xb514('0x38')](function(_0xb8397f){if(_0xb8397f){return _0xb8397f[_0xb514('0x12a')](_0x5582e5[_0xb514('0x5e')][_0xb514('0x6c')],_[_0xb514('0x102')](_0x5582e5[_0xb514('0x5e')],[_0xb514('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x4728cb,null))['catch'](handleError(_0x4728cb,null));};exports['getProactiveActions']=function(_0x13d8be,_0x484428,_0x275eff){var _0x5e8008={};var _0x3a6d97={};var _0x561a7e;var _0x187d16;return db[_0xb514('0x3e')]['findOne']({'where':{'id':_0x13d8be[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x484428,null))[_0xb514('0x38')](function(_0x393e7e){if(_0x393e7e){_0x561a7e=_0x393e7e;_0x3a6d97[_0xb514('0x43')]=_[_0xb514('0x45')](db['ChatProactiveAction']['rawAttributes']);_0x3a6d97[_0xb514('0x44')]=_[_0xb514('0x45')](_0x13d8be[_0xb514('0x44')]);_0x3a6d97[_0xb514('0x46')]=_[_0xb514('0x47')](_0x3a6d97[_0xb514('0x43')],_0x3a6d97[_0xb514('0x44')]);_0x5e8008[_0xb514('0x48')]=_['intersection'](_0x3a6d97[_0xb514('0x43')],qs[_0xb514('0x49')](_0x13d8be[_0xb514('0x44')][_0xb514('0x49')]));_0x5e8008[_0xb514('0x48')]=_0x5e8008[_0xb514('0x48')][_0xb514('0xf7')]?_0x5e8008['attributes']:_0x3a6d97[_0xb514('0x43')];_0x5e8008[_0xb514('0x4c')]=qs[_0xb514('0x4d')](_0x13d8be['query'][_0xb514('0x4d')]);_0x5e8008['where']=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x13d8be[_0xb514('0x44')],_0x3a6d97[_0xb514('0x46')]));if(_0x13d8be[_0xb514('0x44')][_0xb514('0x50')]){_0x5e8008['where']=_[_0xb514('0x51')](_0x5e8008[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x5e8008[_0xb514('0x48')],function(_0x877ec1){var _0x5e730a={};_0x5e730a[_0x877ec1]={'$like':'%'+_0x13d8be[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x5e730a;})});}_0x5e8008=_['merge']({},_0x5e8008,_0x13d8be[_0xb514('0x53')]);return _0x561a7e[_0xb514('0x117')](_0x5e8008);}})[_0xb514('0x38')](function(_0x3c4ac5){if(_0x3c4ac5){_0x187d16=_0x3c4ac5[_0xb514('0xf7')];if(!_0x13d8be[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x5e8008[_0xb514('0x31')]=qs[_0xb514('0x31')](_0x13d8be[_0xb514('0x44')]['limit']);_0x5e8008[_0xb514('0x2f')]=qs[_0xb514('0x2f')](_0x13d8be[_0xb514('0x44')]['offset']);}return _0x561a7e[_0xb514('0x117')](_0x5e8008);}})['then'](function(_0x599b91){if(_0x599b91){return _0x599b91?{'count':_0x187d16,'rows':_0x599b91}:null;}})[_0xb514('0x38')](respondWithResult(_0x484428,null))[_0xb514('0x5c')](handleError(_0x484428,null));};exports[_0xb514('0x12c')]=function(_0x66f20b,_0x55c0df,_0x3a1e50){var _0x4c30d4=_0x66f20b['query'][_0xb514('0x12d')]===_0xb514('0x12e')?_0xb514('0x12f'):_0xb514('0x130');return db[_0xb514('0x3e')]['find']({'attributes':['id',_0x4c30d4],'where':{'id':_0x66f20b[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x55c0df,null))[_0xb514('0x38')](function(_0x253778){if(_0x253778){var _0xf81c39=_0x253778[_0x4c30d4];var _0x52a5c7=_0xf81c39&&_0xf81c39[_0xb514('0x131')]?_0xf81c39[_0xb514('0x131')]:[];_0x55c0df[_0xb514('0xd3')]({'fromKey':_[_0xb514('0x7e')](_0xf81c39['fromKey'])?undefined:_0xf81c39['fromKey'],'count':_0x52a5c7[_0xb514('0xf7')],'rows':_0x52a5c7});}})[_0xb514('0x5c')](handleError(_0x55c0df,null));};exports[_0xb514('0x132')]=function(_0xaeb015,_0x1cb8e1,_0x3c70c9){var _0x35d28f={'raw':![],'where':{}};var _0x10e5ac={};var _0x34fec6={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xaeb015[_0xb514('0x59')]['id']}})['then'](handleEntityNotFound(_0x1cb8e1,null))[_0xb514('0x38')](function(_0x17d4b1){if(_0x17d4b1){_0x10e5ac[_0xb514('0x43')]=_[_0xb514('0x45')](db['ChatOfflineMessage']['rawAttributes']);_0x10e5ac[_0xb514('0x44')]=_[_0xb514('0x45')](_0xaeb015[_0xb514('0x44')]);_0x10e5ac[_0xb514('0x46')]=_[_0xb514('0x47')](_0x10e5ac[_0xb514('0x43')],_0x10e5ac[_0xb514('0x44')]);_0x35d28f[_0xb514('0x48')]=_['intersection'](_0x10e5ac[_0xb514('0x43')],qs[_0xb514('0x49')](_0xaeb015[_0xb514('0x44')]['fields']));_0x35d28f[_0xb514('0x48')]=_0x35d28f['attributes'][_0xb514('0xf7')]?_0x35d28f[_0xb514('0x48')]:_0x10e5ac[_0xb514('0x43')];if(!_0xaeb015[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x35d28f['limit']=qs[_0xb514('0x31')](_0xaeb015[_0xb514('0x44')][_0xb514('0x31')]);_0x35d28f['offset']=qs['offset'](_0xaeb015[_0xb514('0x44')][_0xb514('0x2f')]);}_0x35d28f['order']=qs[_0xb514('0x4d')](_0xaeb015['query'][_0xb514('0x4d')]);_0x35d28f[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0xaeb015[_0xb514('0x44')],_0x10e5ac[_0xb514('0x46')]));_0x35d28f[_0xb514('0x4e')][_0xb514('0x67')]=_0x17d4b1['id'];if(_0xaeb015[_0xb514('0x44')][_0xb514('0x50')]){_0x35d28f['where']=_['merge'](_0x35d28f[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x35d28f[_0xb514('0x48')],function(_0x4a9717){var _0x1c8896={};_0x1c8896[_0x4a9717]={'$like':'%'+_0xaeb015[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x1c8896;})});}_0x35d28f=_[_0xb514('0x51')]({},_0x35d28f,_0xaeb015[_0xb514('0x53')]);return db[_0xb514('0xe0')][_0xb514('0x32')]({'where':_0x35d28f[_0xb514('0x4e')]})['then'](function(_0x12db75){_0x34fec6[_0xb514('0x32')]=_0x12db75;if(_0xaeb015[_0xb514('0x44')][_0xb514('0x54')]){_0x35d28f[_0xb514('0x55')]=[{'all':!![]}];}else{_0x35d28f['include']=[{'model':db[_0xb514('0x90')],'as':_0xb514('0x104'),'required':![]},{'model':db[_0xb514('0xe8')],'as':_0xb514('0x133'),'required':![]}];}return db['ChatOfflineMessage'][_0xb514('0x56')](_0x35d28f);})['then'](function(_0x518804){_0x34fec6['rows']=_0x518804;return _0x34fec6;});}})[_0xb514('0x38')](respondWithFilteredResult(_0x1cb8e1,_0x35d28f))['catch'](handleError(_0x1cb8e1,null));};exports[_0xb514('0x134')]=function(_0x4775f2,_0x166a59,_0x490dad){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x4775f2['params']['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x166a59,null))[_0xb514('0x38')](function(_0x3ee0a6){if(_0x3ee0a6){return _0x3ee0a6[_0xb514('0x134')](_0x4775f2[_0xb514('0x5e')][_0xb514('0x6c')],_['omit'](_0x4775f2[_0xb514('0x5e')],['ids','id'])||{})['spread'](function(_0x371f23){for(var _0x256668=0x0;_0x256668<_0x4775f2['body'][_0xb514('0x6c')][_0xb514('0xf7')];_0x256668+=0x1){socket[_0xb514('0x135')](_0xb514('0x136'),{'UserId':Number(_0x4775f2['body'][_0xb514('0x6c')][_0x256668]),'ChatWebsiteId':Number(_0x4775f2[_0xb514('0x59')]['id'])});}return _0x371f23;});}})['then'](respondWithResult(_0x166a59,null))['catch'](handleError(_0x166a59,null));};exports[_0xb514('0x137')]=function(_0xf01c4f,_0x34ef9c,_0x98ea1){return db['ChatWebsite'][_0xb514('0x5b')]({'where':{'id':_0xf01c4f[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x34ef9c,null))[_0xb514('0x38')](function(_0x3835e2){if(_0x3835e2){return _0x3835e2[_0xb514('0x137')](_0xf01c4f[_0xb514('0x44')][_0xb514('0x6c')])[_0xb514('0x38')](function(){if(_[_0xb514('0x138')](_0xf01c4f['query'][_0xb514('0x6c')])){for(var _0x17705f=0x0;_0x17705f<_0xf01c4f[_0xb514('0x44')]['ids'][_0xb514('0xf7')];_0x17705f+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xf01c4f['query'][_0xb514('0x6c')][_0x17705f]),'ChatWebsiteId':Number(_0xf01c4f[_0xb514('0x59')]['id'])});}}else{socket[_0xb514('0x135')](_0xb514('0x139'),{'UserId':Number(_0xf01c4f['query'][_0xb514('0x6c')]),'ChatWebsiteId':Number(_0xf01c4f[_0xb514('0x59')]['id'])});}});}})[_0xb514('0x38')](respondWithStatusCode(_0x34ef9c,null))[_0xb514('0x5c')](handleError(_0x34ef9c,null));};exports[_0xb514('0x13a')]=function(_0x39a9ab,_0x5df804,_0x59bf33){var _0x33a405={};var _0x24b57c={};var _0x21d7de;var _0x128283;return db[_0xb514('0x3e')][_0xb514('0x6a')]({'where':{'id':_0x39a9ab[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x5df804,null))['then'](function(_0x57511d){if(_0x57511d){_0x21d7de=_0x57511d;_0x24b57c[_0xb514('0x43')]=_[_0xb514('0x45')](db['User']['rawAttributes']);_0x24b57c[_0xb514('0x44')]=_[_0xb514('0x45')](_0x39a9ab[_0xb514('0x44')]);_0x24b57c['filters']=_[_0xb514('0x47')](_0x24b57c[_0xb514('0x43')],_0x24b57c[_0xb514('0x44')]);_0x33a405['attributes']=_[_0xb514('0x47')](_0x24b57c[_0xb514('0x43')],qs[_0xb514('0x49')](_0x39a9ab[_0xb514('0x44')][_0xb514('0x49')]));_0x33a405[_0xb514('0x48')]=_0x33a405[_0xb514('0x48')][_0xb514('0xf7')]?_0x33a405[_0xb514('0x48')]:_0x24b57c['model'];_0x33a405['order']=qs['sort'](_0x39a9ab[_0xb514('0x44')][_0xb514('0x4d')]);_0x33a405[_0xb514('0x4e')]=qs['filters'](_[_0xb514('0x4f')](_0x39a9ab[_0xb514('0x44')],_0x24b57c[_0xb514('0x46')]));if(_0x39a9ab[_0xb514('0x44')][_0xb514('0x50')]){_0x33a405[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x33a405['where'],{'$or':_['map'](_0x33a405[_0xb514('0x48')],function(_0x564538){var _0x5d362f={};_0x5d362f[_0x564538]={'$like':'%'+_0x39a9ab[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x5d362f;})});}_0x33a405=_['merge']({},_0x33a405,_0x39a9ab['options']);return _0x21d7de[_0xb514('0x13a')](_0x33a405);}})[_0xb514('0x38')](function(_0x9f5cc9){if(_0x9f5cc9){_0x128283=_0x9f5cc9[_0xb514('0xf7')];if(!_0x39a9ab[_0xb514('0x44')]['hasOwnProperty'](_0xb514('0x4b'))){_0x33a405[_0xb514('0x31')]=qs[_0xb514('0x31')](_0x39a9ab[_0xb514('0x44')][_0xb514('0x31')]);_0x33a405['offset']=qs[_0xb514('0x2f')](_0x39a9ab[_0xb514('0x44')][_0xb514('0x2f')]);}return _0x21d7de[_0xb514('0x13a')](_0x33a405);}})[_0xb514('0x38')](function(_0x285749){if(_0x285749){return _0x285749?{'count':_0x128283,'rows':_0x285749}:null;}})['then'](respondWithResult(_0x5df804,null))[_0xb514('0x5c')](handleError(_0x5df804,null));};
\ No newline at end of file
+var _0xed85=['interval','iftime\x20%s','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','color','textColor','color_button','addApplications','ChatApplication','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','get','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','options','includeAll','findAll','rows','show','params','fields','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','find','describe','addDisposition','Disposition','findOne','pick','ChatWebsiteId','include','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','files','basename','sequelize','transaction','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','tag','Command','getSnippet','timezone'];(function(_0x28f412,_0x58a85c){var _0xe2c715=function(_0xeacc0d){while(--_0xeacc0d){_0x28f412['push'](_0x28f412['shift']());}};_0xe2c715(++_0x58a85c);}(_0xed85,0x160));var _0x5ed8=function(_0x5b64a1,_0x2ec810){_0x5b64a1=_0x5b64a1-0x0;var _0x4b6f55=_0xed85[_0x5b64a1];return _0x4b6f55;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ed8('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ed8('0x1'));var moment=require(_0x5ed8('0x2'));var BPromise=require(_0x5ed8('0x3'));var Mustache=require('mustache');var util=require(_0x5ed8('0x4'));var path=require('path');var sox=require(_0x5ed8('0x5'));var csv=require(_0x5ed8('0x6'));var ejs=require(_0x5ed8('0x7'));var fs=require('fs');var fs_extra=require(_0x5ed8('0x8'));var _=require(_0x5ed8('0x9'));var squel=require(_0x5ed8('0xa'));var crypto=require(_0x5ed8('0xb'));var jsforce=require(_0x5ed8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5ed8('0x6'));var querystring=require(_0x5ed8('0xd'));var Papa=require(_0x5ed8('0xe'));var Redis=require(_0x5ed8('0xf'));var authService=require(_0x5ed8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5ed8('0x11'));var hardwareService=require(_0x5ed8('0x12'));var logger=require(_0x5ed8('0x13'))(_0x5ed8('0x14'));var utils=require(_0x5ed8('0x15'));var config=require(_0x5ed8('0x16'));var licenseUtil=require(_0x5ed8('0x17'));var db=require('../../mysqldb')['db'];config[_0x5ed8('0x18')]=_[_0x5ed8('0x19')](config['redis'],{'host':_0x5ed8('0x1a'),'port':0x18eb});var socket=require(_0x5ed8('0x1b'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5ed8('0x1c')][_0x5ed8('0x1d')]({'port':0x232c});var client9002=jayson[_0x5ed8('0x1c')][_0x5ed8('0x1d')]({'port':0x232a});var client9003=jayson[_0x5ed8('0x1c')][_0x5ed8('0x1d')]({'port':0x232b});var client9001=jayson['client'][_0x5ed8('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x2ccef9,_0x4e6f59,_0x242939,_0x4ab0bc){return new BPromise(function(_0x466ec5,_0x4f7907){var _0x2fa707=_0x4ab0bc||client;return _0x2fa707[_0x5ed8('0x1e')](_0x2ccef9,_0x242939)[_0x5ed8('0x1f')](function(_0x131c44){logger['info'](_0x5ed8('0x20'),_0x4e6f59,_0x5ed8('0x21'));logger['debug'](_0x5ed8('0x22'),_0x4e6f59,_0x5ed8('0x21'),JSON[_0x5ed8('0x23')](_0x131c44));if(_0x131c44[_0x5ed8('0x24')]){if(_0x131c44['error']['code']===0x1f4){logger['error'](_0x5ed8('0x20'),_0x4e6f59,_0x131c44['error'][_0x5ed8('0x25')]);return _0x4f7907(_0x131c44[_0x5ed8('0x24')][_0x5ed8('0x25')]);}logger[_0x5ed8('0x24')](_0x5ed8('0x20'),_0x4e6f59,_0x131c44[_0x5ed8('0x24')]['message']);return _0x466ec5(_0x131c44[_0x5ed8('0x24')]['message']);}else{logger['info'](_0x5ed8('0x20'),_0x4e6f59,_0x5ed8('0x21'));_0x466ec5(_0x131c44[_0x5ed8('0x26')][_0x5ed8('0x25')]);}})[_0x5ed8('0x27')](function(_0x3501ca){logger['error'](_0x5ed8('0x20'),_0x4e6f59,_0x3501ca);_0x4f7907(_0x3501ca);});});}function respondWithStatusCode(_0x21ee86,_0x218913){_0x218913=_0x218913||0xcc;return function(_0x4a433f){if(_0x4a433f){return _0x21ee86['sendStatus'](_0x218913);}return _0x21ee86[_0x5ed8('0x28')](_0x218913)[_0x5ed8('0x29')]();};}function respondWithResult(_0x27eb8a,_0x2978a8){_0x2978a8=_0x2978a8||0xc8;return function(_0x3c0b11){if(_0x3c0b11){return _0x27eb8a[_0x5ed8('0x28')](_0x2978a8)['json'](_0x3c0b11);}};}function respondWithFilteredResult(_0x338da6,_0x26f36d){return function(_0x264abf){if(_0x264abf){var _0x31ec4b=typeof _0x26f36d[_0x5ed8('0x2a')]==='undefined'&&typeof _0x26f36d['limit']===_0x5ed8('0x2b');var _0x39c2bb=_0x264abf[_0x5ed8('0x2c')];var _0xabd56a=_0x31ec4b?0x0:_0x26f36d['offset'];var _0x27904e=_0x31ec4b?_0x264abf[_0x5ed8('0x2c')]:_0x26f36d[_0x5ed8('0x2a')]+_0x26f36d['limit'];var _0x6cf53f;if(_0x27904e>=_0x39c2bb){_0x27904e=_0x39c2bb;_0x6cf53f=0xc8;}else{_0x6cf53f=0xce;}_0x338da6[_0x5ed8('0x28')](_0x6cf53f);return _0x338da6[_0x5ed8('0x2d')](_0x5ed8('0x2e'),_0xabd56a+'-'+_0x27904e+'/'+_0x39c2bb)['json'](_0x264abf);}return null;};}function patchUpdates(_0x4223d9){return function(_0x5142c2){try{jsonpatch[_0x5ed8('0x2f')](_0x5142c2,_0x4223d9,!![]);}catch(_0x492729){return BPromise[_0x5ed8('0x30')](_0x492729);}return _0x5142c2['save']();};}function saveUpdates(_0x2b2dff,_0x30171f){return function(_0x23afb2){if(_0x23afb2){return _0x23afb2[_0x5ed8('0x31')](_0x2b2dff)[_0x5ed8('0x1f')](function(_0x45ae3e){return _0x45ae3e;});}return null;};}function removeEntity(_0x4eca8c,_0x166ecb){return function(_0x1d3845){if(_0x1d3845){return _0x1d3845[_0x5ed8('0x32')]()['then'](function(){var _0x560483=_0x1d3845[_0x5ed8('0x33')]({'plain':!![]});var _0x23e786='ChatWebsites';return db['UserProfileResource'][_0x5ed8('0x32')]({'where':{'type':_0x23e786,'resourceId':_0x560483['id']}})[_0x5ed8('0x1f')](function(){return _0x1d3845;});})[_0x5ed8('0x1f')](function(){_0x4eca8c[_0x5ed8('0x28')](0xcc)[_0x5ed8('0x29')]();});}};}function handleEntityNotFound(_0x283e1e,_0x4b3350){return function(_0x3c647a){if(!_0x3c647a){_0x283e1e[_0x5ed8('0x34')](0x194);}return _0x3c647a;};}function handleError(_0xb1eaff,_0x557349){_0x557349=_0x557349||0x1f4;return function(_0x324d06){logger[_0x5ed8('0x24')](_0x324d06[_0x5ed8('0x35')]);if(_0x324d06[_0x5ed8('0x36')]){delete _0x324d06['name'];}_0xb1eaff[_0x5ed8('0x28')](_0x557349)['send'](_0x324d06);};}exports[_0x5ed8('0x37')]=function(_0x57beb9,_0xb94f4b){var _0x1b7b87={'include':[{'model':db[_0x5ed8('0x38')],'as':_0x5ed8('0x39')}]},_0x35b93d={},_0xaf2717={'count':0x0,'rows':[]};var _0xb610ac=_[_0x5ed8('0x3a')](db[_0x5ed8('0x3b')][_0x5ed8('0x3c')],function(_0x5cab08){return{'name':_0x5cab08[_0x5ed8('0x3d')],'type':_0x5cab08[_0x5ed8('0x3e')][_0x5ed8('0x3f')]};});_0x35b93d['model']=_[_0x5ed8('0x3a')](_0xb610ac,_0x5ed8('0x36'));_0x35b93d[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x57beb9[_0x5ed8('0x40')]);_0x35b93d[_0x5ed8('0x42')]=_[_0x5ed8('0x43')](_0x35b93d['model'],_0x35b93d['query']);_0x1b7b87[_0x5ed8('0x44')]=_['intersection'](_0x35b93d[_0x5ed8('0x45')],qs['fields'](_0x57beb9[_0x5ed8('0x40')]['fields']));_0x1b7b87[_0x5ed8('0x44')]=_0x1b7b87[_0x5ed8('0x44')][_0x5ed8('0x46')]?_0x1b7b87['attributes']:_0x35b93d[_0x5ed8('0x45')];if(!_0x57beb9[_0x5ed8('0x40')][_0x5ed8('0x47')](_0x5ed8('0x48'))){_0x1b7b87['limit']=qs[_0x5ed8('0x49')](_0x57beb9[_0x5ed8('0x40')]['limit']);_0x1b7b87[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x57beb9[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0x1b7b87[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0x57beb9['query']['sort']);_0x1b7b87[_0x5ed8('0x4c')]=qs['filters'](_['pick'](_0x57beb9[_0x5ed8('0x40')],_0x35b93d[_0x5ed8('0x42')]),_0xb610ac);if(_0x57beb9[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x1b7b87[_0x5ed8('0x4c')]=_['merge'](_0x1b7b87['where'],{'$or':_[_0x5ed8('0x3a')](_0xb610ac,function(_0x3ff9a4){if(_0x3ff9a4[_0x5ed8('0x3e')]!=='VIRTUAL'){var _0x41c805={};_0x41c805[_0x3ff9a4['name']]={'$like':'%'+_0x57beb9[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x41c805;}})});}_0x1b7b87=_['merge']({},_0x1b7b87,_0x57beb9[_0x5ed8('0x4e')]);var _0x3244d0={'where':_0x1b7b87[_0x5ed8('0x4c')]};return db['ChatWebsite'][_0x5ed8('0x2c')](_0x3244d0)[_0x5ed8('0x1f')](function(_0x53e6f6){_0xaf2717[_0x5ed8('0x2c')]=_0x53e6f6;if(_0x57beb9['query'][_0x5ed8('0x4f')]){_0x1b7b87['include']=[{'all':!![]}];}return db[_0x5ed8('0x3b')][_0x5ed8('0x50')](_0x1b7b87);})[_0x5ed8('0x1f')](function(_0x4d5ccc){_0xaf2717[_0x5ed8('0x51')]=_0x4d5ccc;return _0xaf2717;})[_0x5ed8('0x1f')](respondWithFilteredResult(_0xb94f4b,_0x1b7b87))[_0x5ed8('0x27')](handleError(_0xb94f4b,null));};exports[_0x5ed8('0x52')]=function(_0x24c587,_0x227fa1){var _0x15ef16={'raw':![],'where':{'id':_0x24c587[_0x5ed8('0x53')]['id']},'include':[{'model':db[_0x5ed8('0x38')],'as':_0x5ed8('0x39')}]},_0x30d13a={};_0x30d13a['model']=_[_0x5ed8('0x41')](db[_0x5ed8('0x3b')]['rawAttributes']);_0x30d13a[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x24c587[_0x5ed8('0x40')]);_0x30d13a[_0x5ed8('0x42')]=_['intersection'](_0x30d13a[_0x5ed8('0x45')],_0x30d13a[_0x5ed8('0x40')]);_0x15ef16[_0x5ed8('0x44')]=_['intersection'](_0x30d13a[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0x24c587[_0x5ed8('0x40')][_0x5ed8('0x54')]));_0x15ef16[_0x5ed8('0x44')]=_0x15ef16[_0x5ed8('0x44')]['length']?_0x15ef16[_0x5ed8('0x44')]:_0x30d13a[_0x5ed8('0x45')];if(_0x24c587[_0x5ed8('0x40')][_0x5ed8('0x4f')]){_0x15ef16['include']=[{'all':!![]}];}_0x15ef16=_[_0x5ed8('0x55')]({},_0x15ef16,_0x24c587[_0x5ed8('0x4e')]);return db[_0x5ed8('0x3b')]['find'](_0x15ef16)[_0x5ed8('0x1f')](handleEntityNotFound(_0x227fa1,null))[_0x5ed8('0x1f')](respondWithResult(_0x227fa1,null))['catch'](handleError(_0x227fa1,null));};exports[_0x5ed8('0x56')]=function(_0x153715,_0x85011){return db['ChatWebsite'][_0x5ed8('0x56')](_0x153715['body'],{})[_0x5ed8('0x1f')](function(_0x83cafe){var _0x23cc5a=_0x153715[_0x5ed8('0x57')]['get']({'plain':!![]});if(!_0x23cc5a)throw new Error(_0x5ed8('0x58'));if(_0x23cc5a[_0x5ed8('0x59')]===_0x5ed8('0x57')){var _0x360253=_0x83cafe[_0x5ed8('0x33')]({'plain':!![]});var _0x236de3='ChatWebsites';return db[_0x5ed8('0x5a')]['find']({'where':{'name':_0x236de3,'userProfileId':_0x23cc5a[_0x5ed8('0x5b')]},'raw':!![]})[_0x5ed8('0x1f')](function(_0x172630){if(_0x172630&&_0x172630[_0x5ed8('0x5c')]===0x0){return db[_0x5ed8('0x5d')][_0x5ed8('0x56')]({'name':_0x360253[_0x5ed8('0x36')],'resourceId':_0x360253['id'],'type':_0x172630[_0x5ed8('0x36')],'sectionId':_0x172630['id']},{})[_0x5ed8('0x1f')](function(){return _0x83cafe;});}else{return _0x83cafe;}})[_0x5ed8('0x27')](function(_0xa7178c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa7178c);throw _0xa7178c;});}return _0x83cafe;})[_0x5ed8('0x1f')](respondWithResult(_0x85011,0xc9))[_0x5ed8('0x27')](handleError(_0x85011,null));};exports[_0x5ed8('0x31')]=function(_0x12ede7,_0x599b17){if(_0x12ede7[_0x5ed8('0x5e')]['id']){delete _0x12ede7['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x12ede7[_0x5ed8('0x53')]['id']},'include':[{'model':db[_0x5ed8('0x38')],'as':_0x5ed8('0x39')}]})[_0x5ed8('0x1f')](handleEntityNotFound(_0x599b17,null))['then'](saveUpdates(_0x12ede7[_0x5ed8('0x5e')],null))[_0x5ed8('0x1f')](respondWithResult(_0x599b17,null))[_0x5ed8('0x27')](handleError(_0x599b17,null));};exports[_0x5ed8('0x32')]=function(_0xa2eb62,_0x84d5ca){return db['ChatWebsite'][_0x5ed8('0x5f')]({'where':{'id':_0xa2eb62[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x84d5ca,null))[_0x5ed8('0x1f')](removeEntity(_0x84d5ca,null))[_0x5ed8('0x27')](handleError(_0x84d5ca,null));};exports['describe']=function(_0x443db5,_0xfa87c3){return db[_0x5ed8('0x3b')][_0x5ed8('0x60')]()[_0x5ed8('0x1f')](respondWithResult(_0xfa87c3,null))[_0x5ed8('0x27')](handleError(_0xfa87c3,null));};exports[_0x5ed8('0x61')]=function(_0xb9778d,_0x3babca,_0x87c099){if(_0xb9778d[_0x5ed8('0x5e')]['id']){delete _0xb9778d['body']['id'];}return db['ChatWebsite'][_0x5ed8('0x5f')]({'where':{'id':_0xb9778d[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x3babca,null))[_0x5ed8('0x1f')](function(_0x255ddd){if(_0x255ddd){_0xb9778d[_0x5ed8('0x5e')]['ChatWebsiteId']=_0x255ddd['id'];return db[_0x5ed8('0x62')][_0x5ed8('0x56')](_0xb9778d[_0x5ed8('0x5e')]);}})[_0x5ed8('0x1f')](respondWithResult(_0x3babca,null))[_0x5ed8('0x27')](handleError(_0x3babca,null));};exports['getDispositions']=function(_0xb279ff,_0x484080,_0x5dd429){var _0xd42e5d={'raw':![],'where':{}};var _0x1890d2={};var _0x2b6e22={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5ed8('0x63')]({'where':{'id':_0xb279ff[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x484080,null))[_0x5ed8('0x1f')](function(_0xe80264){if(_0xe80264){_0x1890d2['model']=_[_0x5ed8('0x41')](db[_0x5ed8('0x62')][_0x5ed8('0x3c')]);_0x1890d2[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0xb279ff['query']);_0x1890d2[_0x5ed8('0x42')]=_['intersection'](_0x1890d2['model'],_0x1890d2[_0x5ed8('0x40')]);_0xd42e5d['attributes']=_[_0x5ed8('0x43')](_0x1890d2[_0x5ed8('0x45')],qs['fields'](_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x54')]));_0xd42e5d[_0x5ed8('0x44')]=_0xd42e5d[_0x5ed8('0x44')]['length']?_0xd42e5d[_0x5ed8('0x44')]:_0x1890d2[_0x5ed8('0x45')];if(!_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x47')]('nolimit')){_0xd42e5d[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0xd42e5d[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0xd42e5d[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x4b')]);_0xd42e5d[_0x5ed8('0x4c')]=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0xb279ff[_0x5ed8('0x40')],_0x1890d2[_0x5ed8('0x42')]));_0xd42e5d[_0x5ed8('0x4c')][_0x5ed8('0x65')]=_0xe80264['id'];if(_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0xd42e5d[_0x5ed8('0x4c')]=_[_0x5ed8('0x55')](_0xd42e5d[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0xd42e5d['attributes'],function(_0x368096){var _0x5b61ea={};_0x5b61ea[_0x368096]={'$like':'%'+_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x5b61ea;})});}_0xd42e5d=_['merge']({},_0xd42e5d,_0xb279ff[_0x5ed8('0x4e')]);return db[_0x5ed8('0x62')][_0x5ed8('0x2c')]({'where':_0xd42e5d['where']})[_0x5ed8('0x1f')](function(_0x2944a3){_0x2b6e22[_0x5ed8('0x2c')]=_0x2944a3;if(_0xb279ff['query'][_0x5ed8('0x4f')]){_0xd42e5d[_0x5ed8('0x66')]=[{'all':!![]}];}return db[_0x5ed8('0x62')][_0x5ed8('0x50')](_0xd42e5d);})[_0x5ed8('0x1f')](function(_0x409b88){_0x2b6e22[_0x5ed8('0x51')]=_0x409b88;return _0x2b6e22;});}})[_0x5ed8('0x1f')](respondWithFilteredResult(_0x484080,_0xd42e5d))[_0x5ed8('0x27')](handleError(_0x484080,null));};exports[_0x5ed8('0x67')]=function(_0x88137e,_0x2f536f,_0x3b2877){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x88137e[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f536f,null))[_0x5ed8('0x1f')](function(_0x16b319){if(_0x16b319){return _0x16b319[_0x5ed8('0x67')](_0x88137e[_0x5ed8('0x40')]['ids']);}})[_0x5ed8('0x1f')](respondWithStatusCode(_0x2f536f,null))[_0x5ed8('0x27')](handleError(_0x2f536f,null));};exports['addAnswer']=function(_0x3aa423,_0x2750f6,_0x5406da){if(_0x3aa423[_0x5ed8('0x5e')]['id']){delete _0x3aa423[_0x5ed8('0x5e')]['id'];}return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x3aa423[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x2750f6,null))[_0x5ed8('0x1f')](function(_0xb39067){if(_0xb39067){_0x3aa423[_0x5ed8('0x5e')][_0x5ed8('0x65')]=_0xb39067['id'];return db[_0x5ed8('0x68')][_0x5ed8('0x56')](_0x3aa423['body']);}})[_0x5ed8('0x1f')](respondWithResult(_0x2750f6,null))[_0x5ed8('0x27')](handleError(_0x2750f6,null));};exports[_0x5ed8('0x69')]=function(_0x3a2437,_0x2bef85,_0x4961de){var _0x362854={'raw':![],'where':{}};var _0x298b3e={};var _0xdf0376={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3a2437['params']['id']}})['then'](handleEntityNotFound(_0x2bef85,null))[_0x5ed8('0x1f')](function(_0x514387){if(_0x514387){_0x298b3e[_0x5ed8('0x45')]=_[_0x5ed8('0x41')](db['CannedAnswer'][_0x5ed8('0x3c')]);_0x298b3e['query']=_[_0x5ed8('0x41')](_0x3a2437[_0x5ed8('0x40')]);_0x298b3e[_0x5ed8('0x42')]=_['intersection'](_0x298b3e[_0x5ed8('0x45')],_0x298b3e[_0x5ed8('0x40')]);_0x362854[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0x298b3e[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0x3a2437[_0x5ed8('0x40')]['fields']));_0x362854[_0x5ed8('0x44')]=_0x362854[_0x5ed8('0x44')][_0x5ed8('0x46')]?_0x362854[_0x5ed8('0x44')]:_0x298b3e[_0x5ed8('0x45')];if(!_0x3a2437['query'][_0x5ed8('0x47')]('nolimit')){_0x362854['limit']=qs[_0x5ed8('0x49')](_0x3a2437[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x362854[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x3a2437[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0x362854['order']=qs[_0x5ed8('0x4b')](_0x3a2437['query'][_0x5ed8('0x4b')]);_0x362854[_0x5ed8('0x4c')]=qs[_0x5ed8('0x42')](_['pick'](_0x3a2437['query'],_0x298b3e['filters']));_0x362854[_0x5ed8('0x4c')]['ChatWebsiteId']=_0x514387['id'];if(_0x3a2437[_0x5ed8('0x40')]['filter']){_0x362854[_0x5ed8('0x4c')]=_['merge'](_0x362854[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0x362854[_0x5ed8('0x44')],function(_0x325c8e){var _0x31c8cd={};_0x31c8cd[_0x325c8e]={'$like':'%'+_0x3a2437[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x31c8cd;})});}_0x362854=_[_0x5ed8('0x55')]({},_0x362854,_0x3a2437['options']);return db['CannedAnswer'][_0x5ed8('0x2c')]({'where':_0x362854[_0x5ed8('0x4c')]})['then'](function(_0x1a3e5c){_0xdf0376[_0x5ed8('0x2c')]=_0x1a3e5c;if(_0x3a2437[_0x5ed8('0x40')]['includeAll']){_0x362854['include']=[{'all':!![]}];}return db[_0x5ed8('0x68')][_0x5ed8('0x50')](_0x362854);})['then'](function(_0x1fb3dc){_0xdf0376[_0x5ed8('0x51')]=_0x1fb3dc;return _0xdf0376;});}})[_0x5ed8('0x1f')](respondWithFilteredResult(_0x2bef85,_0x362854))[_0x5ed8('0x27')](handleError(_0x2bef85,null));};exports[_0x5ed8('0x6a')]=function(_0x14c63e,_0x4badb6,_0x5854c9){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x14c63e[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x4badb6,null))['then'](function(_0x2656ab){if(_0x2656ab){return _0x2656ab[_0x5ed8('0x6a')](_0x14c63e[_0x5ed8('0x40')][_0x5ed8('0x6b')]);}})['then'](respondWithStatusCode(_0x4badb6,null))['catch'](handleError(_0x4badb6,null));};exports['addLogo']=function(_0x165b32,_0x4c5b8a,_0x4a6f55){_0x165b32[_0x5ed8('0x5e')][_0x5ed8('0x6c')]=_0x165b32[_0x5ed8('0x6d')][_0x5ed8('0x6e')];return db[_0x5ed8('0x3b')]['find']({'where':{'id':_0x165b32[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c5b8a,null))[_0x5ed8('0x1f')](saveUpdates(_0x165b32[_0x5ed8('0x5e')],null))['then'](respondWithResult(_0x4c5b8a,null))[_0x5ed8('0x27')](handleError(_0x4c5b8a,null));};exports[_0x5ed8('0x6f')]=function(_0x92c724,_0x33954a,_0x54d24e){_0x92c724[_0x5ed8('0x5e')][_0x5ed8('0x70')]=_0x92c724[_0x5ed8('0x6d')][_0x5ed8('0x6e')];return db[_0x5ed8('0x3b')]['find']({'where':{'id':_0x92c724['params']['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x33954a,null))[_0x5ed8('0x1f')](saveUpdates(_0x92c724[_0x5ed8('0x5e')],null))[_0x5ed8('0x1f')](respondWithResult(_0x33954a,null))['catch'](handleError(_0x33954a,null));};exports['addCustomerAvatar']=function(_0x2ca895,_0x2ea4fb,_0x3a3c95){_0x2ca895[_0x5ed8('0x5e')][_0x5ed8('0x71')]=_0x2ca895[_0x5ed8('0x6d')]['filename'];return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x2ca895[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x2ea4fb,null))[_0x5ed8('0x1f')](saveUpdates(_0x2ca895[_0x5ed8('0x5e')],null))[_0x5ed8('0x1f')](respondWithResult(_0x2ea4fb,null))[_0x5ed8('0x27')](handleError(_0x2ea4fb,null));};exports['addSystemAvatar']=function(_0xe4761f,_0x369159,_0x14f122){_0xe4761f[_0x5ed8('0x5e')][_0x5ed8('0x72')]=_0xe4761f[_0x5ed8('0x6d')][_0x5ed8('0x6e')];return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0xe4761f[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x369159,null))[_0x5ed8('0x1f')](saveUpdates(_0xe4761f[_0x5ed8('0x5e')],null))['then'](respondWithResult(_0x369159,null))[_0x5ed8('0x27')](handleError(_0x369159,null));};exports[_0x5ed8('0x73')]=function(_0x246597,_0x594963,_0x4fb509){var _0x26d3b9=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x76'));var _0x513c38={'where':{'id':_0x246597[_0x5ed8('0x53')]['id']},'attributes':['id',_0x5ed8('0x6c')],'raw':!![]};var _0x3d45b2=![];return require(_0x5ed8('0x17'))['getLicense']()['then'](function(_0xe8bea9){if(_0xe8bea9){_0x3d45b2=_0xe8bea9[_0x5ed8('0x77')];}})[_0x5ed8('0x1f')](function(){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')](_0x513c38);})[_0x5ed8('0x1f')](handleEntityNotFound(_0x594963,null))['then'](function(_0x502310){if(_0x502310){if(!_[_0x5ed8('0x78')](_0x502310[_0x5ed8('0x6c')])){if(fs[_0x5ed8('0x79')](path['join'](config[_0x5ed8('0x75')],_0x5ed8('0x7a'),_0x502310[_0x5ed8('0x6c')]))&&_0x3d45b2){_0x26d3b9=path[_0x5ed8('0x74')](config['root'],_0x5ed8('0x7a'),_0x502310[_0x5ed8('0x6c')]);}}return _0x594963[_0x5ed8('0x7b')](_0x26d3b9);}})[_0x5ed8('0x27')](handleError(_0x594963,null));};exports[_0x5ed8('0x7c')]=function(_0x402cc4,_0x2b1fb5,_0x594288){var _0x2d59e8=path[_0x5ed8('0x74')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x544b7a={'where':{'id':_0x402cc4[_0x5ed8('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x5ed8('0x3b')]['find'](_0x544b7a)['then'](handleEntityNotFound(_0x2b1fb5,null))[_0x5ed8('0x1f')](function(_0x399466){if(_0x399466){if(!_[_0x5ed8('0x78')](_0x399466[_0x5ed8('0x70')])){if(fs[_0x5ed8('0x79')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x7d'),_0x399466['agentAvatar']))){_0x2d59e8=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x7d'),_0x399466[_0x5ed8('0x70')]);}}return _0x2b1fb5[_0x5ed8('0x7b')](_0x2d59e8);}})[_0x5ed8('0x27')](handleError(_0x2b1fb5,null));};exports[_0x5ed8('0x7e')]=function(_0x2ac356,_0x1cfed5,_0x371072){var _0x54d386=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x7f'));var _0x92482e={'where':{'id':_0x2ac356[_0x5ed8('0x53')]['id']},'attributes':['id',_0x5ed8('0x71'),_0x5ed8('0x80')],'raw':!![]};return db['ChatWebsite'][_0x5ed8('0x5f')](_0x92482e)['then'](handleEntityNotFound(_0x1cfed5,null))[_0x5ed8('0x1f')](function(_0x550f8c){if(_0x550f8c){if(!_[_0x5ed8('0x78')](_0x550f8c['customerAvatar'])){if(fs[_0x5ed8('0x79')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x7d'),_0x550f8c['customerAvatar']))&&_0x550f8c[_0x5ed8('0x80')]){_0x54d386=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],'server/files/images/avatars/',_0x550f8c[_0x5ed8('0x71')]);}}return _0x1cfed5[_0x5ed8('0x7b')](_0x54d386);}})[_0x5ed8('0x27')](handleError(_0x1cfed5,null));};exports[_0x5ed8('0x81')]=function(_0x406416,_0x470131,_0x41eded){var _0x2394ff=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x82'));var _0x26fa27={'where':{'id':_0x406416[_0x5ed8('0x53')]['id']},'attributes':['id',_0x5ed8('0x72')],'raw':!![]};return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')](_0x26fa27)['then'](handleEntityNotFound(_0x470131,null))[_0x5ed8('0x1f')](function(_0x27e004){if(_0x27e004){if(!_['isNil'](_0x27e004['systemAvatar'])){if(fs[_0x5ed8('0x79')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],'server/files/images/avatars/',_0x27e004['systemAvatar']))){_0x2394ff=path['join'](config[_0x5ed8('0x75')],'server/files/images/avatars/',_0x27e004[_0x5ed8('0x72')]);}}return _0x470131[_0x5ed8('0x7b')](_0x2394ff);}})[_0x5ed8('0x27')](handleError(_0x470131,null));};exports[_0x5ed8('0x83')]=function(_0x2c0a54,_0x471f53,_0x221967){var _0x560a7d=require('user-agent-parser');var _0xe02f32=new _0x560a7d();var _0x41929f=_0xe02f32['setUA'](_0x2c0a54[_0x5ed8('0x84')][_0x5ed8('0x85')])[_0x5ed8('0x86')]();var _0xbaf6e9={'body':_0x2c0a54['body'],'channel':_0x5ed8('0x87')};var _0x4cea2e=[];var _0x4a76eb=[];var _0x2e2f2a={};var _0x53da9e=![];return db[_0x5ed8('0x88')][_0x5ed8('0x60')]()[_0x5ed8('0x1f')](function(_0x3bcbb9){if(!_0x3bcbb9){throw new db[(_0x5ed8('0x89'))][(_0x5ed8('0x8a'))](_0x5ed8('0x8b'));}_0x4cea2e=_[_0x5ed8('0x8c')](_[_0x5ed8('0x41')](_0x3bcbb9),[_0x5ed8('0x8d'),_0x5ed8('0x8e')]);_0x4a76eb=_['difference'](_['keys'](_0x3bcbb9),['createdAt',_0x5ed8('0x8e'),_0x5ed8('0x8f'),'ListId']);if(_0x2c0a54[_0x5ed8('0x5e')]['id']){delete _0x2c0a54['body']['id'];}if(_[_0x5ed8('0x78')](_0x2c0a54['body']['from'])){throw new db['Sequelize'][(_0x5ed8('0x8a'))](_0x5ed8('0x90'));}if(_[_0x5ed8('0x78')](_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0x5e')])||_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0x5e')]===''){throw new db[(_0x5ed8('0x89'))][(_0x5ed8('0x8a'))](_0x5ed8('0x91'));}if(_[_0x5ed8('0x78')](_0x2c0a54['body'][_0x5ed8('0x92')])){throw new db[(_0x5ed8('0x89'))][(_0x5ed8('0x8a'))](_0x5ed8('0x93')+_0x4a76eb);}if(!_[_0x5ed8('0x94')](_0x4a76eb,_0x2c0a54['body'][_0x5ed8('0x92')])){throw new db['Sequelize'][(_0x5ed8('0x8a'))](_0x5ed8('0x95')+_0x4a76eb);}_0x2e2f2a[_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0x92')]]=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0x96')];})[_0x5ed8('0x1f')](function(){return db[_0x5ed8('0x3b')]['find']({'where':{'id':_0x2c0a54[_0x5ed8('0x53')]['id']},'include':[{'model':db[_0x5ed8('0x97')],'as':_0x5ed8('0x98'),'include':[{'model':db[_0x5ed8('0x88')],'as':_0x5ed8('0x99'),'where':_0x2e2f2a,'limit':0x1,'order':[[_0x5ed8('0x8e'),_0x5ed8('0x9a')]]}]},{'model':db['ChatApplication'],'as':_0x5ed8('0x9b')}]});})[_0x5ed8('0x1f')](handleEntityNotFound(_0x471f53,null))[_0x5ed8('0x1f')](function(_0x4d0d13){if(_0x4d0d13&&_0x4d0d13[_0x5ed8('0x98')]){_0xbaf6e9[_0x5ed8('0x9c')]=_0x4d0d13;_0xbaf6e9[_0x5ed8('0x9d')]=_0x4d0d13['Applications'];_0xbaf6e9[_0x5ed8('0x9e')]=_0x4d0d13[_0x5ed8('0x98')];_0xbaf6e9[_0x5ed8('0x9d')]=_[_0x5ed8('0x9f')](_0xbaf6e9[_0x5ed8('0x9d')],[_0x5ed8('0xa0')],[_0x5ed8('0xa1')]);if(_0xbaf6e9[_0x5ed8('0x9c')]['Applications']){delete _0xbaf6e9[_0x5ed8('0x9c')][_0x5ed8('0x9b')];}if(_0xbaf6e9[_0x5ed8('0x9c')]['List']&&_0xbaf6e9['account']['List']['Contacts']['length']){return _0xbaf6e9['account'][_0x5ed8('0x98')][_0x5ed8('0x99')][0x0];}var _0x548370=_[_0x5ed8('0x19')](_0x2c0a54[_0x5ed8('0x5e')],{'firstName':_0x2c0a54[_0x5ed8('0x5e')]['from'],'ListId':_0x4d0d13[_0x5ed8('0xa2')]});_0x548370[_0x2c0a54['body']['mapKey']]=_0x2c0a54['body'][_0x5ed8('0x96')];return db['CmContact'][_0x5ed8('0x56')](_0x548370,{'fields':_0x4cea2e,'raw':!![]});}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x471f53,null))['then'](function(_0x55831f){_0xbaf6e9['contact']=_0x55831f;var _0x392496=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xa3')];if(_0x2c0a54[_0x5ed8('0x84')][_0x5ed8('0xa4')]){_0x392496=_0x2c0a54[_0x5ed8('0x84')][_0x5ed8('0xa4')];}else if(_0x2c0a54[_0x5ed8('0x84')][_0x5ed8('0xa5')]){_0x392496=_[_0x5ed8('0xa6')](_0x2c0a54['headers'][_0x5ed8('0xa5')][_0x5ed8('0xa7')](','));}if(_0x55831f){var _0x11b6f5={'ContactId':_0x55831f['id'],'ChatWebsiteId':_0x2c0a54[_0x5ed8('0x53')]['id'],'from':(_0x55831f[_0x5ed8('0xa8')]||'')+'\x20'+(_0x55831f[_0x5ed8('0xa9')]||''),'customerIp':_0x392496,'customerPort':_0x2c0a54[_0x5ed8('0x84')]['x-real-port']?_0x2c0a54['headers'][_0x5ed8('0xaa')]:null,'referer':_0x2c0a54[_0x5ed8('0x5e')]['referer'],'browserName':_0x41929f[_0x5ed8('0xab')][_0x5ed8('0x36')]&&_0x41929f[_0x5ed8('0xab')][_0x5ed8('0xac')]?util[_0x5ed8('0xad')]('%s\x20%s',_0x41929f[_0x5ed8('0xab')][_0x5ed8('0x36')],_0x41929f['browser']['version']):_0x5ed8('0xae'),'browserVersion':_0x41929f[_0x5ed8('0xab')][_0x5ed8('0xac')]||_0x5ed8('0xae'),'osName':util['format'](_0x5ed8('0xaf'),_0x41929f['os'][_0x5ed8('0x36')],_0x41929f['os'][_0x5ed8('0xac')]),'osVersion':_0x41929f['os']['version'],'deviceModel':_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0x45')]&&_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0xb1')]?util[_0x5ed8('0xad')](_0x5ed8('0xb2'),_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0x45')],_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0xb1')],_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0x3e')]):null,'deviceVendor':_0x41929f['device'][_0x5ed8('0xb1')],'deviceType':_0x41929f['device']['type'],'formData':JSON[_0x5ed8('0x23')](_0x2c0a54[_0x5ed8('0x5e')])};var _0x110cb9={'ChatWebsiteId':_0x2c0a54[_0x5ed8('0x53')]['id'],'closed':![]};if(_0x2c0a54[_0x5ed8('0x5e')]['threadId']){_0x110cb9['threadId']=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb3')];return db['ChatInteraction'][_0x5ed8('0x5f')]({'where':_0x110cb9})[_0x5ed8('0x1f')](function(_0x293c2a){if(_0x293c2a){return[_0x293c2a,![]];}_0x11b6f5[_0x5ed8('0xb3')]=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb3')];_0x11b6f5[_0x5ed8('0xb4')]=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb4')];return db[_0x5ed8('0xb5')][_0x5ed8('0x56')](_0x11b6f5)[_0x5ed8('0x1f')](function(_0x4006c2){return[_0x4006c2,!![]];});});}_0x110cb9[_0x5ed8('0xb6')]=_0x55831f['id'];if(_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb7')]&&_0x2c0a54[_0x5ed8('0x5e')]['interaction']['id']){_0x110cb9['id']=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb7')]['id'];return db['ChatInteraction'][_0x5ed8('0x5f')]({'where':_0x110cb9})['then'](function(_0x482f1b){if(_0x482f1b){return[_0x482f1b,![]];}return db['ChatInteraction']['create'](_0x11b6f5)[_0x5ed8('0x1f')](function(_0x1acb37){return[_0x1acb37,!![]];});});}return db[_0x5ed8('0xb5')][_0x5ed8('0x56')](_0x11b6f5)[_0x5ed8('0x1f')](function(_0x3f03f7){return[_0x3f03f7,!![]];});}})[_0x5ed8('0xb8')](function(_0x24644c,_0x4485db){if(_0x24644c){_0x53da9e=_0x4485db;if(!_0x4485db){var _0x5dfdf7={'from':(_0xbaf6e9['contact'][_0x5ed8('0xa8')]||'')+'\x20'+(_0xbaf6e9[_0x5ed8('0xb9')][_0x5ed8('0xa9')]||'')};if(_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb3')]&&_0x2c0a54[_0x5ed8('0x5e')]['messageId']&&_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb3')]!=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xba')]){_0x5dfdf7['threadId']=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xba')];}return _0x24644c[_0x5ed8('0x31')](_0x5dfdf7);}else{return _0x24644c;}}})[_0x5ed8('0x1f')](function(_0x53f064){_0xbaf6e9[_0x5ed8('0xb7')]=_0x53f064[_0x5ed8('0x33')]({'plain':!![]});_0xbaf6e9[_0x5ed8('0xb7')]['created']=_0x53da9e;if(_0xbaf6e9[_0x5ed8('0xb7')]['created']){if(_0xbaf6e9[_0x5ed8('0x9c')][_0x5ed8('0xbb')]){_0xbaf6e9['applications'][_0x5ed8('0xbc')]({'id':0x0,'priority':_0xbaf6e9[_0x5ed8('0x9d')][_0x5ed8('0x46')]+0x1,'app':_0x5ed8('0xbd'),'appdata':_0x5ed8('0xbe'),'interval':_0x5ed8('0xbf')});}}return db[_0x5ed8('0xc0')][_0x5ed8('0x56')]({'body':_0x2c0a54[_0x5ed8('0x5e')]['body'],'ChatWebsiteId':_0x2c0a54[_0x5ed8('0x53')]['id'],'ChatInteractionId':_0x53f064['id'],'direction':'in','ContactId':_0xbaf6e9['contact']['id'],'AttachmentId':_0x2c0a54[_0x5ed8('0x5e')]['AttachmentId']});})[_0x5ed8('0x1f')](function(_0x4ef6f9){_0xbaf6e9[_0x5ed8('0x25')]=_0x4ef6f9;if(_0xbaf6e9[_0x5ed8('0xb7')][_0x5ed8('0xc1')]){return db[_0x5ed8('0xc2')][_0x5ed8('0x5f')]({'attributes':['id',_0x5ed8('0x36')],'where':{'id':_0xbaf6e9[_0x5ed8('0xb7')]['UserId']}})['then'](function(_0x1343c0){if(_0x1343c0){_0xbaf6e9[_0x5ed8('0x9d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5ed8('0xc3'),'appdata':_0x1343c0[_0x5ed8('0x36')]+','+(_0xbaf6e9[_0x5ed8('0x9c')][_0x5ed8('0xc4')]||0xa),'interval':_0x5ed8('0xbf')});_0xbaf6e9[_0x5ed8('0xc5')]=!![];}return respondWithRpcPromise(_0x5ed8('0xc6'),'startRouting',_0xbaf6e9);});}return respondWithRpcPromise('Start','startRouting',_0xbaf6e9);})[_0x5ed8('0x1f')](function(_0x454882){respondWithRpcPromise(_0x5ed8('0xc7'),_0x5ed8('0xc7'),{'event':_0x5ed8('0x83'),'message':_0x454882},client9002);return _0x454882;})[_0x5ed8('0x1f')](respondWithResult(_0x471f53,null))[_0x5ed8('0x27')](handleError(_0x471f53,null));};exports[_0x5ed8('0xc8')]=function(_0x208708,_0x525b84,_0x3a3c90){var _0xe527ac,_0x85428,_0x12b5dc;var _0x5624c7=[];var _0x17fa01=[];var _0xd9d8a2={};var _0x48761f=_0x208708['files']||[];var _0x34ac1e=[];var _0x5db2b2;return db['CmContact'][_0x5ed8('0x60')]()['then'](function(_0x484017){if(!_0x484017){throw new db[(_0x5ed8('0x89'))][(_0x5ed8('0x8a'))](_0x5ed8('0x8b'));}_0x17fa01=_['difference'](_[_0x5ed8('0x41')](_0x484017),['createdAt','updatedAt']);_0x5624c7=_[_0x5ed8('0x8c')](_[_0x5ed8('0x41')](_0x484017),['createdAt',_0x5ed8('0x8e'),_0x5ed8('0x8f'),_0x5ed8('0xa2')]);if(_0x208708[_0x5ed8('0x5e')]['id']){delete _0x208708[_0x5ed8('0x5e')]['id'];}if(_[_0x5ed8('0x78')](_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x96')])){throw _0x525b84[_0x5ed8('0x28')](0x1f4)[_0x5ed8('0xc9')](new db[(_0x5ed8('0x89'))]['ValidationError'](_0x5ed8('0x90')));}if(_[_0x5ed8('0x78')](_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x5e')])||_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x5e')]===''){throw _0x525b84[_0x5ed8('0x28')](0x1f4)['send'](new db[(_0x5ed8('0x89'))]['ValidationError'](_0x5ed8('0x91')));}if(_['isNil'](_0x208708[_0x5ed8('0x5e')]['mapKeyOffline'])){throw _0x525b84['status'](0x1f4)[_0x5ed8('0xc9')](new db['Sequelize'][(_0x5ed8('0x8a'))](_0x5ed8('0xca')+_0x5624c7));}if(!_[_0x5ed8('0x94')](_0x5624c7,_0x208708[_0x5ed8('0x5e')][_0x5ed8('0xcb')])){throw _0x525b84[_0x5ed8('0x28')](0x1f4)[_0x5ed8('0xc9')](new db['Sequelize'][(_0x5ed8('0x8a'))](_0x5ed8('0xcc')+_0x5624c7));}_0xd9d8a2[_0x208708[_0x5ed8('0x5e')]['mapKeyOffline']]=_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x96')];})[_0x5ed8('0x1f')](function(){return db['ChatWebsite'][_0x5ed8('0x5f')]({'where':{'id':_0x208708['params']['id']},'include':[{'model':db[_0x5ed8('0x97')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x525b84,null))[_0x5ed8('0x1f')](function(_0x15fae0){if(_0x15fae0&&_0x15fae0[_0x5ed8('0x98')]){_0x85428=_0x15fae0;var _0x8088e3=_[_0x5ed8('0x19')](_0x208708[_0x5ed8('0x5e')],{'firstName':_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x96')],'phone':_0x208708['body']['from'],'ListId':_0x15fae0[_0x5ed8('0xa2')]});_0x8088e3[_0x208708[_0x5ed8('0x5e')][_0x5ed8('0xcb')]]=_0x208708['body'][_0x5ed8('0x96')];return db['CmContact']['findOrCreate']({'where':_0xd9d8a2,'defaults':_0x8088e3});}})['spread'](function(_0x72552d){if(_0x72552d){_0x12b5dc=_0x72552d;var _0x368cc6=fs[_0x5ed8('0xcd')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0xce')),_0x5ed8('0xcf'));var _0x13fd1f=ejs[_0x5ed8('0xd0')](_0x368cc6,{'body':_[_0x5ed8('0xd1')](_0x208708['body'][_0x5ed8('0x5e')]),'bodyTitle':_0x85428[_0x5ed8('0xd2')]});return db[_0x5ed8('0xd3')][_0x5ed8('0x56')]({'body':_0x13fd1f,'ContactId':_0x72552d['id'],'ChatWebsiteId':_0x85428['id']});}})[_0x5ed8('0x1f')](function(_0xfc60b){_0x5db2b2=_0xfc60b;if(_0x48761f[_0x5ed8('0x46')]){var _0xcc6f3c=_0x48761f[_0x5ed8('0x3a')](function(_0x5e601f){return{'name':_0x5e601f[_0x5ed8('0xd4')],'basename':_0x5e601f[_0x5ed8('0x6e')],'type':_0x5e601f[_0x5ed8('0xd5')],'ChatOfflineMessageId':_0xfc60b['id']};});_0x34ac1e=_0xcc6f3c[_0x5ed8('0x3a')](_0x5a5e64=>{var _0x309c49={'filename':_0x5a5e64[_0x5ed8('0x36')],'path':path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0xd6'),_0x5ed8('0xd7'),'attachments','offline-chat',_0x5a5e64[_0x5ed8('0xd8')])};return _0x309c49;});if(!_0x85428['openNewInteraction']){return db[_0x5ed8('0xd9')][_0x5ed8('0xda')](function(_0x419339){return db[_0x5ed8('0xdb')][_0x5ed8('0xdc')](_0xcc6f3c,{'transaction':_0x419339});});}}})[_0x5ed8('0x1f')](function(){if(_0x5db2b2){_0xe527ac=_0x5db2b2;return db[_0x5ed8('0xdd')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x5ed8('0xde')],'as':_0x5ed8('0xdf'),'raw':!![]}]});}})[_0x5ed8('0x1f')](function(_0x26347e){if(_0x26347e&&_0x26347e[_0x5ed8('0xdf')]&&_0x85428[_0x5ed8('0xe0')]&&_0x85428[_0x5ed8('0xe1')]){var _0x8a5462={'tls':{'rejectUnauthorized':![]}};if(_0x26347e[_0x5ed8('0xdf')]['service']){_0x8a5462[_0x5ed8('0xe2')]=_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0xe2')];}else{_0x8a5462[_0x5ed8('0xe3')]=_0x26347e['Smtp'][_0x5ed8('0xe3')];_0x8a5462[_0x5ed8('0xe4')]=_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0xe4')];_0x8a5462[_0x5ed8('0xe5')]=_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0xe5')];}if(_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0xe6')]){_0x8a5462[_0x5ed8('0xe7')]={'user':_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0x57')],'pass':_0x26347e['Smtp'][_0x5ed8('0xe8')]};}return respondWithRpcPromise('SendMail',_0x5ed8('0xe9'),{'account':_0x8a5462,'message':{'from':util[_0x5ed8('0xad')](_0x5ed8('0xea'),_0x26347e['name'],_0x26347e[_0x5ed8('0xeb')]||_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0x57')]),'to':_0x85428['forwardOfflineAddress'],'subject':_0x85428['offlineMessageSubject'],'html':_0xe527ac['body'],'attachments':_0x34ac1e}},client9003)[_0x5ed8('0x1f')](function(){return _0xe527ac;})[_0x5ed8('0x27')](function(_0x1c7b72){console[_0x5ed8('0x24')](_0x1c7b72);});}})[_0x5ed8('0x1f')](function(){if(_0x85428&&_0x85428['openNewInteraction']&&_0x85428[_0x5ed8('0xec')]){var _0x4f2373=[];if(_0x48761f['length']){_0x4f2373=_0x48761f[_0x5ed8('0x3a')](function(_0x17e605){return{'name':_0x17e605[_0x5ed8('0xd4')],'basename':_0x17e605['filename'],'type':_0x17e605[_0x5ed8('0xd5')],'ChatOfflineMessageId':_0x5db2b2['id']};});}var _0x534170;if(!_['isNil'](_0x85428[_0x5ed8('0xed')])){var _0x465332=_[_0x5ed8('0x3a')](_0x208708[_0x5ed8('0x5e')],function(_0x126c12){return _0x126c12;});var _0x163ffc=_[_0x5ed8('0xee')](_0x465332)[0x0];var _0x3bf1e6=_[_0x5ed8('0xef')](_0x163ffc,function(_0x46a522){return _0x46a522;});_0x534170=_0x3bf1e6[0x1][_0x85428[_0x5ed8('0xed')]];}var _0x12c674={'from':_0x12b5dc[_0x5ed8('0xeb')],'firstName':_0x12b5dc[_0x5ed8('0xa8')],'lastName':_0x12b5dc['lastName'],'mapKey':_0x5ed8('0xeb'),'message':{'from':_0x12b5dc[_0x5ed8('0xeb')],'to':_0x85428['MailAccount']['email'],'cc':'','subject':_['isNil'](_0x534170)?_0x85428[_0x5ed8('0xf0')]:_0x534170,'messageId':'','sentAt':new Date(),'attach':_0x4f2373[_0x5ed8('0x46')],'attachments':_0x4f2373,'originChannel':_0x5ed8('0xf1'),'ChatWebsiteId':_0x85428['id'],'ChatOfflineMessageId':_0xe527ac['id'],'originTo':_0x85428[_0x5ed8('0xdd')]['email']},'body':_0xe527ac['body']};var _0x3bb578={'account':{'id':_0x85428[_0x5ed8('0xec')]},'body':_0x12c674,'log':_0x5ed8('0xf2')};return respondWithRpcPromise(_0x5ed8('0xf2'),_0x5ed8('0xf3'),_0x3bb578,client9001)[_0x5ed8('0x1f')](function(){return _0xe527ac;})[_0x5ed8('0x27')](function(_0x49fc7d){console[_0x5ed8('0x24')](_0x49fc7d);});}return;})[_0x5ed8('0x1f')](function(){if(_0xe527ac){return _0xe527ac;}})[_0x5ed8('0x1f')](respondWithResult(_0x525b84,null))[_0x5ed8('0x27')](function(_0x540db1){console[_0x5ed8('0x24')](_0x5ed8('0x27'),_0x540db1);for(var _0x391335 of _0x48761f){var _0x18abb5=path[_0x5ed8('0x74')](config['root'],_0x5ed8('0xd6'),_0x5ed8('0xd7'),_0x5ed8('0xf4'),'offline-chat',_0x391335['filename']);fs_extra[_0x5ed8('0xf5')](_0x18abb5)[_0x5ed8('0x27')](function(_0x39e6fe){console[_0x5ed8('0x24')](_0x5ed8('0xf6'),_0x18abb5,_0x39e6fe);});}});};exports[_0x5ed8('0xf7')]=function(_0x30ec05,_0x49e325,_0x4107c3){return db['ChatInteraction'][_0x5ed8('0x5f')]({'where':{'id':_0x30ec05[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x49e325,null))[_0x5ed8('0x1f')](function(_0x2afc44){if(_0x2afc44){return _0x2afc44['addInteraction'](_0x30ec05[_0x5ed8('0x5e')][_0x5ed8('0x6b')],_[_0x5ed8('0xf8')](_0x30ec05['body'],[_0x5ed8('0x6b'),'id'])||{});}})[_0x5ed8('0x1f')](respondWithResult(_0x49e325,null))['catch'](handleError(_0x49e325,null));};exports[_0x5ed8('0xf9')]=function(_0x298493,_0x2edd7b,_0x495ff7){var _0x271ce0={'raw':![],'where':{}};var _0x540604={};var _0x10232c={'count':0x0,'rows':[]};return db[_0x5ed8('0x3b')]['findOne']({'where':{'id':_0x298493['params']['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x2edd7b,null))[_0x5ed8('0x1f')](function(_0x2dc053){if(_0x2dc053){_0x540604[_0x5ed8('0x45')]=_[_0x5ed8('0x41')](db[_0x5ed8('0xb5')][_0x5ed8('0x3c')]);_0x540604[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x298493['query']);_0x540604['filters']=_[_0x5ed8('0x43')](_0x540604[_0x5ed8('0x45')],_0x540604[_0x5ed8('0x40')]);_0x271ce0[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0x540604[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0x298493[_0x5ed8('0x40')]['fields']));_0x271ce0['attributes']=_0x271ce0[_0x5ed8('0x44')]['length']?_0x271ce0[_0x5ed8('0x44')]:_0x540604[_0x5ed8('0x45')];if(!_0x298493[_0x5ed8('0x40')][_0x5ed8('0x47')](_0x5ed8('0x48'))){_0x271ce0[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0x298493[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x271ce0['offset']=qs[_0x5ed8('0x2a')](_0x298493[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0x271ce0['order']=qs[_0x5ed8('0x4b')](_0x298493['query'][_0x5ed8('0x4b')]);_0x271ce0[_0x5ed8('0x4c')]=qs[_0x5ed8('0x42')](_['pick'](_0x298493[_0x5ed8('0x40')],_0x540604[_0x5ed8('0x42')]));_0x271ce0[_0x5ed8('0x4c')]['ChatWebsiteId']=_0x2dc053['id'];if(_0x298493[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x271ce0[_0x5ed8('0x4c')]=_['merge'](_0x271ce0[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0x271ce0['attributes'],function(_0x3ef873){var _0x12ae5d={};_0x12ae5d[_0x3ef873]={'$like':'%'+_0x298493[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x12ae5d;})});}_0x271ce0=_[_0x5ed8('0x55')]({},_0x271ce0,_0x298493[_0x5ed8('0x4e')]);return db['ChatInteraction'][_0x5ed8('0x2c')]({'where':_0x271ce0[_0x5ed8('0x4c')]})[_0x5ed8('0x1f')](function(_0x127173){_0x10232c[_0x5ed8('0x2c')]=_0x127173;if(_0x298493[_0x5ed8('0x40')][_0x5ed8('0x4f')]){_0x271ce0[_0x5ed8('0x66')]=[{'model':db[_0x5ed8('0x88')],'as':_0x5ed8('0xfa'),'required':![]},{'model':db[_0x5ed8('0xc2')],'as':_0x5ed8('0xfb'),'attributes':[_0x5ed8('0x36'),_0x5ed8('0xfc'),_0x5ed8('0xfd')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x5ed8('0x36'),'color'],'where':_0x298493[_0x5ed8('0x40')][_0x5ed8('0xfe')]?{'id':_0x298493[_0x5ed8('0x40')][_0x5ed8('0xfe')]}:undefined,'required':_0x298493[_0x5ed8('0x40')][_0x5ed8('0xfe')]?!![]:![]}];}return db['ChatInteraction'][_0x5ed8('0x50')](_0x271ce0);})[_0x5ed8('0x1f')](function(_0x13809e){_0x10232c[_0x5ed8('0x51')]=_0x13809e;return _0x10232c;});}})[_0x5ed8('0x1f')](respondWithFilteredResult(_0x2edd7b,_0x271ce0))[_0x5ed8('0x27')](handleError(_0x2edd7b,null));};function iftimePromise(_0xf2cd35,_0x12df1f){return respondWithRpcPromise(_0x5ed8('0xff'),_0x5ed8('0x100'),{'command':_0x12df1f[_0x5ed8('0x101')]?util[_0x5ed8('0xad')]('iftime\x20%s,%s',_0xf2cd35[_0x5ed8('0x102')],_0x12df1f[_0x5ed8('0x101')]):util['format'](_0x5ed8('0x103'),_0xf2cd35[_0x5ed8('0x102')])},client9002)['then'](function(_0x2b6f26){var _0x31def7=_0x2b6f26&&_0x2b6f26[_0x5ed8('0x104')](_0x5ed8('0x105'))>=0x0?!![]:![];logger[_0x5ed8('0x106')](_0x5ed8('0x107'),_0x12df1f['id'],_0xf2cd35['id'],_0xf2cd35[_0x5ed8('0x102')],_0x31def7?_0x5ed8('0x108'):'OFFLINE',_0x12df1f['timezone']?_0x12df1f[_0x5ed8('0x101')]:_0x5ed8('0x109'));return _0x31def7;})[_0x5ed8('0x27')](function(_0x4f4860){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x12df1f['id'],_0xf2cd35['id'],_0xf2cd35['interval'],util[_0x5ed8('0x10a')](_0x4f4860,{'showHidden':![],'depth':null}),_0x12df1f['timezone']?_0x12df1f[_0x5ed8('0x101')]:_0x5ed8('0x109'));return![];});}exports[_0x5ed8('0x100')]=function(_0x2da280,_0x358d5a,_0x40c5e6){var _0x5eb16d=0x0;var _0x329c15=0x0;var _0x4471b2=![];var _0x25b54f;var _0x51a2a5;return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x2da280[_0x5ed8('0x53')]['id']},'include':[{'model':db[_0x5ed8('0x10b')],'as':_0x5ed8('0x10b'),'include':[{'model':db[_0x5ed8('0x10b')],'as':_0x5ed8('0x10c'),'attributes':['id',_0x5ed8('0x102')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x358d5a,null))[_0x5ed8('0x1f')](function(_0x264175){if(_0x264175){_0x25b54f=_0x264175;return _0x264175[_0x5ed8('0x10d')]({'raw':!![]});}})[_0x5ed8('0x1f')](function(_0x589483){if(_0x25b54f){if(_0x589483){_0x51a2a5=_0x589483;}}return require(_0x5ed8('0x17'))[_0x5ed8('0x10e')]();})['then'](function(_0x2c2030){if(_0x2c2030){_0x329c15=_0x2c2030[_0x5ed8('0x10f')];_0x4471b2=_0x2c2030[_0x5ed8('0x77')];}})['then'](function(){return db[_0x5ed8('0xb5')]['count']({'where':{'closed':![]}});})['then'](function(_0x19fe48){_0x5eb16d=_0x19fe48;if(_0x329c15&&_0x19fe48>_0x329c15){return db[_0x5ed8('0x110')][_0x5ed8('0x63')]({'where':{'id':0x1}})[_0x5ed8('0x1f')](function(_0x34e73a){if(_0x34e73a){_0x34e73a[_0x5ed8('0x111')](_0x5ed8('0x112'));}});}})[_0x5ed8('0x1f')](function(){if(_0x25b54f[_0x5ed8('0x10b')]&&_0x25b54f[_0x5ed8('0x10b')][_0x5ed8('0x10c')]){var _0x954885=[];for(var _0xc5606e=0x0;_0xc5606e<_0x25b54f[_0x5ed8('0x10b')][_0x5ed8('0x10c')][_0x5ed8('0x46')];_0xc5606e++){var _0x50218c=_0x25b54f[_0x5ed8('0x10b')]['Intervals'][_0xc5606e]['get']({'plain':!![]});_0x954885[_0x5ed8('0xbc')](iftimePromise(_0x50218c,_0x25b54f));}return BPromise[_0x5ed8('0x113')](_0x954885)['then'](function(_0x2bf98d){return _[_0x5ed8('0x114')](_0x2bf98d);});}else{return!![];}})['then'](function(_0x2001cf){var _0x395ec9=fs[_0x5ed8('0xcd')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x115')),_0x5ed8('0xcf'));var _0x18d0ae={'remote':_0x25b54f[_0x5ed8('0x116')],'query':querystring[_0x5ed8('0x23')](_[_0x5ed8('0x55')](_0x25b54f['get']({'plain':!![]}),{'customerIp':_0x2da280['headers']['x-forwarded-for']||_0x2da280[_0x5ed8('0x84')][_0x5ed8('0x117')]||_0x2da280[_0x5ed8('0x118')]['remoteAddress']||_0x2da280['ip'],'referer':_0x2da280[_0x5ed8('0x84')]['referer'],'openedInteractions':_0x5eb16d,'maxInteractions':_0x329c15,'virtual':_0x4471b2['virtual'],'online':_0x2001cf,'custom':_0x4471b2}))[_0x5ed8('0x119')](/'/g,'\x5c\x27')};_0x358d5a['send'](ejs[_0x5ed8('0xd0')](Mustache[_0x5ed8('0xd0')](_0x395ec9,_0x18d0ae),{'proactiveActions':_0x51a2a5,'alignment':_0x25b54f[_0x5ed8('0x11a')],'verticalAlignment':_0x25b54f[_0x5ed8('0x11b')],'div_color':_0x25b54f[_0x5ed8('0x11c')],'text_color':_0x25b54f[_0x5ed8('0x11d')],'button_color':_0x25b54f[_0x5ed8('0x11e')],'background_color':_0x25b54f['backgroundColor']}));})[_0x5ed8('0x27')](handleError(_0x358d5a,null));};exports[_0x5ed8('0x11f')]=function(_0x40de50,_0x38e266,_0x2347ae){return db[_0x5ed8('0x3b')][_0x5ed8('0x63')]({'where':{'id':_0x40de50[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x38e266,null))[_0x5ed8('0x1f')](function(_0x3911e9){if(_0x3911e9){return db[_0x5ed8('0xd9')][_0x5ed8('0xda')](function(_0x50f307){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x40de50[_0x5ed8('0x53')]['id']},'transaction':_0x50f307})[_0x5ed8('0x1f')](function(_0x303967){var _0x412db6=_[_0x5ed8('0x3a')](_0x40de50[_0x5ed8('0x5e')],function(_0x3a85f0){_0x3a85f0[_0x5ed8('0x65')]=_0x40de50[_0x5ed8('0x53')]['id'];return _0x3a85f0;});return db['ChatApplication'][_0x5ed8('0xdc')](_0x412db6,{'transaction':_0x50f307});});})[_0x5ed8('0x1f')](function(){return db[_0x5ed8('0x120')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x40de50[_0x5ed8('0x53')]['id']},'order':_0x5ed8('0xa0')});});}})[_0x5ed8('0x1f')](respondWithResult(_0x38e266,null))['catch'](handleError(_0x38e266,null));};exports[_0x5ed8('0x121')]=function(_0x3707b6,_0x480626,_0x160c3c){var _0x138d06={};var _0x424031={};var _0x3469b0;var _0x12ac9b;return db['ChatWebsite'][_0x5ed8('0x63')]({'where':{'id':_0x3707b6['params']['id']}})['then'](handleEntityNotFound(_0x480626,null))[_0x5ed8('0x1f')](function(_0x2aa028){if(_0x2aa028){_0x3469b0=_0x2aa028;_0x424031[_0x5ed8('0x45')]=_[_0x5ed8('0x41')](db[_0x5ed8('0x120')][_0x5ed8('0x3c')]);_0x424031[_0x5ed8('0x40')]=_['keys'](_0x3707b6[_0x5ed8('0x40')]);_0x424031['filters']=_[_0x5ed8('0x43')](_0x424031['model'],_0x424031[_0x5ed8('0x40')]);_0x138d06[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0x424031[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x54')]));_0x138d06[_0x5ed8('0x44')]=_0x138d06[_0x5ed8('0x44')][_0x5ed8('0x46')]?_0x138d06[_0x5ed8('0x44')]:_0x424031[_0x5ed8('0x45')];_0x138d06[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x4b')]);_0x138d06['where']=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0x3707b6['query'],_0x424031['filters']));if(_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x138d06['where']=_['merge'](_0x138d06['where'],{'$or':_[_0x5ed8('0x3a')](_0x138d06[_0x5ed8('0x44')],function(_0x4c578b){var _0x247caf={};_0x247caf[_0x4c578b]={'$like':'%'+_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x247caf;})});}_0x138d06=_[_0x5ed8('0x55')]({},_0x138d06,_0x3707b6[_0x5ed8('0x4e')]);return _0x3469b0[_0x5ed8('0x121')](_0x138d06);}})[_0x5ed8('0x1f')](function(_0x11e194){if(_0x11e194){_0x12ac9b=_0x11e194[_0x5ed8('0x46')];if(!_0x3707b6['query']['hasOwnProperty']('nolimit')){_0x138d06[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x138d06[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}return _0x3469b0[_0x5ed8('0x121')](_0x138d06);}})[_0x5ed8('0x1f')](function(_0x5a3e67){if(_0x5a3e67){return _0x5a3e67?{'count':_0x12ac9b,'rows':_0x5a3e67}:null;}})[_0x5ed8('0x1f')](respondWithResult(_0x480626,null))[_0x5ed8('0x27')](handleError(_0x480626,null));};exports[_0x5ed8('0x122')]=function(_0x364dc3,_0x40a8de,_0x32c917){return db[_0x5ed8('0x123')][_0x5ed8('0x5f')]({'where':{'id':_0x364dc3['params']['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x40a8de,null))[_0x5ed8('0x1f')](function(_0x2bfbaa){if(_0x2bfbaa){return _0x2bfbaa['addProactiveActions'](_0x364dc3[_0x5ed8('0x5e')][_0x5ed8('0x6b')],_[_0x5ed8('0xf8')](_0x364dc3[_0x5ed8('0x5e')],[_0x5ed8('0x6b'),'id'])||{});}})[_0x5ed8('0x1f')](respondWithResult(_0x40a8de,null))[_0x5ed8('0x27')](handleError(_0x40a8de,null));};exports[_0x5ed8('0x10d')]=function(_0x579a16,_0x3e5df8,_0x24362e){var _0x22ca7f={};var _0x187a88={};var _0x336afa;var _0x5b629a;return db['ChatWebsite']['findOne']({'where':{'id':_0x579a16[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x3e5df8,null))[_0x5ed8('0x1f')](function(_0x337b6c){if(_0x337b6c){_0x336afa=_0x337b6c;_0x187a88['model']=_[_0x5ed8('0x41')](db[_0x5ed8('0x124')]['rawAttributes']);_0x187a88[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x579a16[_0x5ed8('0x40')]);_0x187a88[_0x5ed8('0x42')]=_[_0x5ed8('0x43')](_0x187a88[_0x5ed8('0x45')],_0x187a88['query']);_0x22ca7f[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0x187a88[_0x5ed8('0x45')],qs['fields'](_0x579a16['query'][_0x5ed8('0x54')]));_0x22ca7f['attributes']=_0x22ca7f[_0x5ed8('0x44')]['length']?_0x22ca7f[_0x5ed8('0x44')]:_0x187a88[_0x5ed8('0x45')];_0x22ca7f[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0x579a16['query'][_0x5ed8('0x4b')]);_0x22ca7f[_0x5ed8('0x4c')]=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0x579a16[_0x5ed8('0x40')],_0x187a88[_0x5ed8('0x42')]));if(_0x579a16[_0x5ed8('0x40')]['filter']){_0x22ca7f['where']=_['merge'](_0x22ca7f[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0x22ca7f[_0x5ed8('0x44')],function(_0x624a0e){var _0x93d0cd={};_0x93d0cd[_0x624a0e]={'$like':'%'+_0x579a16[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x93d0cd;})});}_0x22ca7f=_[_0x5ed8('0x55')]({},_0x22ca7f,_0x579a16[_0x5ed8('0x4e')]);return _0x336afa[_0x5ed8('0x10d')](_0x22ca7f);}})['then'](function(_0x19e526){if(_0x19e526){_0x5b629a=_0x19e526[_0x5ed8('0x46')];if(!_0x579a16['query']['hasOwnProperty'](_0x5ed8('0x48'))){_0x22ca7f['limit']=qs[_0x5ed8('0x49')](_0x579a16[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x22ca7f[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x579a16[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}return _0x336afa[_0x5ed8('0x10d')](_0x22ca7f);}})[_0x5ed8('0x1f')](function(_0xc83fe1){if(_0xc83fe1){return _0xc83fe1?{'count':_0x5b629a,'rows':_0xc83fe1}:null;}})[_0x5ed8('0x1f')](respondWithResult(_0x3e5df8,null))[_0x5ed8('0x27')](handleError(_0x3e5df8,null));};exports[_0x5ed8('0x125')]=function(_0x4a2994,_0x4d42b0,_0x5b83d1){var _0x39b9a1=_0x4a2994[_0x5ed8('0x40')][_0x5ed8('0x126')]==='false'?'offlineForm':_0x5ed8('0x127');return db[_0x5ed8('0x3b')]['find']({'attributes':['id',_0x39b9a1],'where':{'id':_0x4a2994[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x4d42b0,null))[_0x5ed8('0x1f')](function(_0xe41408){if(_0xe41408){var _0x5e86ff=_0xe41408[_0x39b9a1];var _0x10873f=_0x5e86ff&&_0x5e86ff[_0x5ed8('0x128')]?_0x5e86ff[_0x5ed8('0x128')]:[];_0x4d42b0[_0x5ed8('0xc9')]({'fromKey':_[_0x5ed8('0x78')](_0x5e86ff['fromKey'])?undefined:_0x5e86ff[_0x5ed8('0x129')],'count':_0x10873f[_0x5ed8('0x46')],'rows':_0x10873f});}})[_0x5ed8('0x27')](handleError(_0x4d42b0,null));};exports['getOfflineMessages']=function(_0x442acc,_0x54e67f,_0x118c45){var _0x159fc8={'raw':![],'where':{}};var _0x3f0c87={};var _0x460c32={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5ed8('0x63')]({'where':{'id':_0x442acc[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x54e67f,null))[_0x5ed8('0x1f')](function(_0x35188b){if(_0x35188b){_0x3f0c87['model']=_[_0x5ed8('0x41')](db[_0x5ed8('0xd3')][_0x5ed8('0x3c')]);_0x3f0c87[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x442acc[_0x5ed8('0x40')]);_0x3f0c87['filters']=_[_0x5ed8('0x43')](_0x3f0c87[_0x5ed8('0x45')],_0x3f0c87[_0x5ed8('0x40')]);_0x159fc8['attributes']=_['intersection'](_0x3f0c87[_0x5ed8('0x45')],qs['fields'](_0x442acc[_0x5ed8('0x40')]['fields']));_0x159fc8['attributes']=_0x159fc8[_0x5ed8('0x44')]['length']?_0x159fc8[_0x5ed8('0x44')]:_0x3f0c87[_0x5ed8('0x45')];if(!_0x442acc[_0x5ed8('0x40')]['hasOwnProperty'](_0x5ed8('0x48'))){_0x159fc8[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0x442acc['query']['limit']);_0x159fc8[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x442acc[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0x159fc8['order']=qs[_0x5ed8('0x4b')](_0x442acc['query'][_0x5ed8('0x4b')]);_0x159fc8['where']=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0x442acc[_0x5ed8('0x40')],_0x3f0c87['filters']));_0x159fc8[_0x5ed8('0x4c')]['ChatWebsiteId']=_0x35188b['id'];if(_0x442acc[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x159fc8[_0x5ed8('0x4c')]=_[_0x5ed8('0x55')](_0x159fc8[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0x159fc8[_0x5ed8('0x44')],function(_0x2a0b3){var _0x2fa437={};_0x2fa437[_0x2a0b3]={'$like':'%'+_0x442acc[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x2fa437;})});}_0x159fc8=_[_0x5ed8('0x55')]({},_0x159fc8,_0x442acc[_0x5ed8('0x4e')]);return db['ChatOfflineMessage']['count']({'where':_0x159fc8[_0x5ed8('0x4c')]})['then'](function(_0x91a00d){_0x460c32[_0x5ed8('0x2c')]=_0x91a00d;if(_0x442acc[_0x5ed8('0x40')][_0x5ed8('0x4f')]){_0x159fc8[_0x5ed8('0x66')]=[{'all':!![]}];}else{_0x159fc8['include']=[{'model':db[_0x5ed8('0x88')],'as':_0x5ed8('0xfa'),'required':![]},{'model':db[_0x5ed8('0xdb')],'as':_0x5ed8('0x12a'),'required':![]}];}return db['ChatOfflineMessage'][_0x5ed8('0x50')](_0x159fc8);})[_0x5ed8('0x1f')](function(_0x5eb1af){_0x460c32['rows']=_0x5eb1af;return _0x460c32;});}})['then'](respondWithFilteredResult(_0x54e67f,_0x159fc8))[_0x5ed8('0x27')](handleError(_0x54e67f,null));};exports[_0x5ed8('0x12b')]=function(_0x4973a8,_0xcd8553,_0x17f0eb){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x4973a8[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0xcd8553,null))[_0x5ed8('0x1f')](function(_0x126c81){if(_0x126c81){return _0x126c81[_0x5ed8('0x12b')](_0x4973a8[_0x5ed8('0x5e')]['ids'],_[_0x5ed8('0xf8')](_0x4973a8[_0x5ed8('0x5e')],[_0x5ed8('0x6b'),'id'])||{})['spread'](function(_0x95889c){for(var _0x5a7d2b=0x0;_0x5a7d2b<_0x4973a8[_0x5ed8('0x5e')][_0x5ed8('0x6b')][_0x5ed8('0x46')];_0x5a7d2b+=0x1){socket[_0x5ed8('0x12c')](_0x5ed8('0x12d'),{'UserId':Number(_0x4973a8['body'][_0x5ed8('0x6b')][_0x5a7d2b]),'ChatWebsiteId':Number(_0x4973a8['params']['id'])});}return _0x95889c;});}})['then'](respondWithResult(_0xcd8553,null))['catch'](handleError(_0xcd8553,null));};exports[_0x5ed8('0x12e')]=function(_0x303cf8,_0x15c5de,_0x29d66d){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x303cf8[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x15c5de,null))[_0x5ed8('0x1f')](function(_0x42988b){if(_0x42988b){return _0x42988b[_0x5ed8('0x12e')](_0x303cf8[_0x5ed8('0x40')]['ids'])[_0x5ed8('0x1f')](function(){if(_['isArray'](_0x303cf8[_0x5ed8('0x40')]['ids'])){for(var _0x3a94fe=0x0;_0x3a94fe<_0x303cf8['query'][_0x5ed8('0x6b')][_0x5ed8('0x46')];_0x3a94fe+=0x1){socket[_0x5ed8('0x12c')](_0x5ed8('0x12f'),{'UserId':Number(_0x303cf8['query'][_0x5ed8('0x6b')][_0x3a94fe]),'ChatWebsiteId':Number(_0x303cf8[_0x5ed8('0x53')]['id'])});}}else{socket[_0x5ed8('0x12c')](_0x5ed8('0x12f'),{'UserId':Number(_0x303cf8['query'][_0x5ed8('0x6b')]),'ChatWebsiteId':Number(_0x303cf8['params']['id'])});}});}})[_0x5ed8('0x1f')](respondWithStatusCode(_0x15c5de,null))[_0x5ed8('0x27')](handleError(_0x15c5de,null));};exports[_0x5ed8('0x130')]=function(_0xdac0d3,_0x5c960a,_0x161156){var _0x259911={};var _0xa031a2={};var _0x4dc997;var _0x44d051;return db[_0x5ed8('0x3b')]['findOne']({'where':{'id':_0xdac0d3[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x5c960a,null))[_0x5ed8('0x1f')](function(_0x43445d){if(_0x43445d){_0x4dc997=_0x43445d;_0xa031a2[_0x5ed8('0x45')]=_[_0x5ed8('0x41')](db[_0x5ed8('0xc2')][_0x5ed8('0x3c')]);_0xa031a2['query']=_[_0x5ed8('0x41')](_0xdac0d3[_0x5ed8('0x40')]);_0xa031a2['filters']=_['intersection'](_0xa031a2['model'],_0xa031a2[_0x5ed8('0x40')]);_0x259911[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0xa031a2[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0xdac0d3['query']['fields']));_0x259911['attributes']=_0x259911[_0x5ed8('0x44')][_0x5ed8('0x46')]?_0x259911[_0x5ed8('0x44')]:_0xa031a2[_0x5ed8('0x45')];_0x259911[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x4b')]);_0x259911['where']=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0xdac0d3[_0x5ed8('0x40')],_0xa031a2[_0x5ed8('0x42')]));if(_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x259911[_0x5ed8('0x4c')]=_[_0x5ed8('0x55')](_0x259911[_0x5ed8('0x4c')],{'$or':_['map'](_0x259911['attributes'],function(_0x2797e1){var _0x9a94d2={};_0x9a94d2[_0x2797e1]={'$like':'%'+_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x9a94d2;})});}_0x259911=_[_0x5ed8('0x55')]({},_0x259911,_0xdac0d3[_0x5ed8('0x4e')]);return _0x4dc997[_0x5ed8('0x130')](_0x259911);}})[_0x5ed8('0x1f')](function(_0x3585a3){if(_0x3585a3){_0x44d051=_0x3585a3['length'];if(!_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x47')]('nolimit')){_0x259911[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x259911['offset']=qs['offset'](_0xdac0d3['query']['offset']);}return _0x4dc997['getAgents'](_0x259911);}})[_0x5ed8('0x1f')](function(_0x60111b){if(_0x60111b){return _0x60111b?{'count':_0x44d051,'rows':_0x60111b}:null;}})[_0x5ed8('0x1f')](respondWithResult(_0x5c960a,null))['catch'](handleError(_0x5c960a,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 8948b27..ca38f6d 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 _0x4ab0=['save','update','emit','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0x4ab0,0xd5));var _0x04ab=function(_0x309cca,_0x4dd271){_0x309cca=_0x309cca-0x0;var _0x3a5edd=_0x4ab0[_0x309cca];return _0x3a5edd;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x04ab('0x0'))['db'][_0x04ab('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x04ab('0x2')](0x0);var events={'afterCreate':_0x04ab('0x3'),'afterUpdate':_0x04ab('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4c3a53){return function(_0x45dfee,_0xb1bf2d,_0x491958){ChatWebsiteEvents[_0x04ab('0x5')](_0x4c3a53+':'+_0x45dfee['id'],_0x45dfee);ChatWebsiteEvents[_0x04ab('0x5')](_0x4c3a53,_0x45dfee);_0x491958(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x04ab('0x6')](e,emitEvent(event));}}module[_0x04ab('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xbfda=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','save'];(function(_0x188aea,_0x304964){var _0x30509b=function(_0x34b956){while(--_0x34b956){_0x188aea['push'](_0x188aea['shift']());}};_0x30509b(++_0x304964);}(_0xbfda,0x1dc));var _0xabfd=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xbfda[_0x4a747d];return _0x3a5b5c;};'use strict';var EventEmitter=require(_0xabfd('0x0'));var ChatWebsite=require(_0xabfd('0x1'))['db'][_0xabfd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xabfd('0x3'),'afterUpdate':'update','afterDestroy':_0xabfd('0x4')};function emitEvent(_0x138c67){return function(_0x384d8e,_0x3818ef,_0x48aff0){ChatWebsiteEvents[_0xabfd('0x5')](_0x138c67+':'+_0x384d8e['id'],_0x384d8e);ChatWebsiteEvents['emit'](_0x138c67,_0x384d8e);_0x48aff0(null);};}for(var e in events){if(events[_0xabfd('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xabfd('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 0092699..c00156f 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 _0xa8a3=['bluebird','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x408860,_0x132291){var _0xd467bc=function(_0x2e1329){while(--_0x2e1329){_0x408860['push'](_0x408860['shift']());}};_0xd467bc(++_0x132291);}(_0xa8a3,0x167));var _0x3a8a=function(_0x15c97c,_0x47772c){_0x15c97c=_0x15c97c-0x0;var _0x2db36e=_0xa8a3[_0x15c97c];return _0x2db36e;};'use strict';var _=require(_0x3a8a('0x0'));var util=require(_0x3a8a('0x1'));var logger=require(_0x3a8a('0x2'))(_0x3a8a('0x3'));var moment=require(_0x3a8a('0x4'));var BPromise=require(_0x3a8a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a8a('0x6'));var rimraf=require(_0x3a8a('0x7'));var config=require('../../config/environment');var attributes=require(_0x3a8a('0x8'));module[_0x3a8a('0x9')]=function(_0x44f2f0,_0x3f835b){return _0x44f2f0[_0x3a8a('0xa')](_0x3a8a('0xb'),attributes,{'tableName':_0x3a8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf787=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','util'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xf787,0xdc));var _0x7f78=function(_0x590381,_0x5c3948){_0x590381=_0x590381-0x0;var _0xe300df=_0xf787[_0x590381];return _0xe300df;};'use strict';var _=require('lodash');var util=require(_0x7f78('0x0'));var logger=require(_0x7f78('0x1'))(_0x7f78('0x2'));var moment=require(_0x7f78('0x3'));var BPromise=require(_0x7f78('0x4'));var rp=require(_0x7f78('0x5'));var fs=require('fs');var path=require(_0x7f78('0x6'));var rimraf=require(_0x7f78('0x7'));var config=require(_0x7f78('0x8'));var attributes=require(_0x7f78('0x9'));module[_0x7f78('0xa')]=function(_0x2e4434,_0x2d47d9){return _0x2e4434[_0x7f78('0xb')](_0x7f78('0xc'),attributes,{'tableName':'chat_websites','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 5651661..990f10a 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 _0xc956=['socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x1a5751,_0x1e8ea2){var _0x42a70b=function(_0x34727d){while(--_0x34727d){_0x1a5751['push'](_0x1a5751['shift']());}};_0x42a70b(++_0x1e8ea2);}(_0xc956,0x195));var _0x6c95=function(_0x79407b,_0x44ada3){_0x79407b=_0x79407b-0x0;var _0xdd3fb2=_0xc956[_0x79407b];return _0xdd3fb2;};'use strict';var _=require(_0x6c95('0x0'));var util=require(_0x6c95('0x1'));var moment=require(_0x6c95('0x2'));var BPromise=require(_0x6c95('0x3'));var rs=require(_0x6c95('0x4'));var fs=require('fs');var Redis=require(_0x6c95('0x5'));var db=require(_0x6c95('0x6'))['db'];var utils=require(_0x6c95('0x7'));var logger=require(_0x6c95('0x8'))('rpc');var config=require(_0x6c95('0x9'));var jayson=require(_0x6c95('0xa'));var client=jayson[_0x6c95('0xb')]['http']({'port':0x232a});config[_0x6c95('0xc')]=_[_0x6c95('0xd')](config[_0x6c95('0xc')],{'host':_0x6c95('0xe'),'port':0x18eb});var socket=require(_0x6c95('0xf'))(new Redis(config[_0x6c95('0xc')]));require(_0x6c95('0x10'))[_0x6c95('0x11')](socket);function respondWithRpcPromise(_0x5bf0bc,_0x217eb6,_0x5e7932){return new BPromise(function(_0x562c74,_0x35e864){return client['request'](_0x5bf0bc,_0x5e7932)[_0x6c95('0x12')](function(_0x1269c6){logger[_0x6c95('0x13')](_0x6c95('0x14'),_0x217eb6,'request\x20sent');logger['debug'](_0x6c95('0x15'),_0x217eb6,_0x6c95('0x16'),JSON[_0x6c95('0x17')](_0x1269c6));if(_0x1269c6[_0x6c95('0x18')]){if(_0x1269c6[_0x6c95('0x18')][_0x6c95('0x19')]===0x1f4){logger['error'](_0x6c95('0x14'),_0x217eb6,_0x1269c6[_0x6c95('0x18')][_0x6c95('0x1a')]);return _0x35e864(_0x1269c6[_0x6c95('0x18')][_0x6c95('0x1a')]);}logger['error'](_0x6c95('0x14'),_0x217eb6,_0x1269c6[_0x6c95('0x18')]['message']);return _0x562c74(_0x1269c6[_0x6c95('0x18')][_0x6c95('0x1a')]);}else{logger[_0x6c95('0x13')](_0x6c95('0x14'),_0x217eb6,_0x6c95('0x16'));_0x562c74(_0x1269c6['result'][_0x6c95('0x1a')]);}})[_0x6c95('0x1b')](function(_0x279a41){logger[_0x6c95('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x217eb6,_0x279a41);_0x35e864(_0x279a41);});});}
\ No newline at end of file
+var _0x1d8a=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1d8a,0x1f4));var _0xa1d8=function(_0xe84a74,_0xa8cfda){_0xe84a74=_0xe84a74-0x0;var _0x166fd8=_0x1d8a[_0xe84a74];return _0x166fd8;};'use strict';var _=require(_0xa1d8('0x0'));var util=require(_0xa1d8('0x1'));var moment=require(_0xa1d8('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1d8('0x5'))(_0xa1d8('0x6'));var config=require(_0xa1d8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa1d8('0x8')]({'port':0x232a});config[_0xa1d8('0x9')]=_[_0xa1d8('0xa')](config[_0xa1d8('0x9')],{'host':_0xa1d8('0xb'),'port':0x18eb});var socket=require(_0xa1d8('0xc'))(new Redis(config[_0xa1d8('0x9')]));require('./chatWebsite.socket')[_0xa1d8('0xd')](socket);function respondWithRpcPromise(_0x54fd32,_0x38f09b,_0x54ee20){return new BPromise(function(_0x43f2d6,_0x329c9e){return client['request'](_0x54fd32,_0x54ee20)[_0xa1d8('0xe')](function(_0x831683){logger[_0xa1d8('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x38f09b,_0xa1d8('0x10'));logger[_0xa1d8('0x11')](_0xa1d8('0x12'),_0x38f09b,_0xa1d8('0x10'),JSON['stringify'](_0x831683));if(_0x831683[_0xa1d8('0x13')]){if(_0x831683[_0xa1d8('0x13')][_0xa1d8('0x14')]===0x1f4){logger['error'](_0xa1d8('0x15'),_0x38f09b,_0x831683['error'][_0xa1d8('0x16')]);return _0x329c9e(_0x831683[_0xa1d8('0x13')]['message']);}logger['error'](_0xa1d8('0x15'),_0x38f09b,_0x831683['error'][_0xa1d8('0x16')]);return _0x43f2d6(_0x831683[_0xa1d8('0x13')][_0xa1d8('0x16')]);}else{logger[_0xa1d8('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x38f09b,_0xa1d8('0x10'));_0x43f2d6(_0x831683[_0xa1d8('0x17')][_0xa1d8('0x16')]);}})['catch'](function(_0x8e4b05){logger[_0xa1d8('0x13')](_0xa1d8('0x15'),_0x38f09b,_0x8e4b05);_0x329c9e(_0x8e4b05);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index ef4d02f..bf151cc 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 _0xbd32=['remove','update','emit','register','length','./chatWebsite.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd32,0x83));var _0x2bd3=function(_0x2bdf04,_0x5e608e){_0x2bdf04=_0x2bdf04-0x0;var _0x33ce04=_0xbd32[_0x2bdf04];return _0x33ce04;};'use strict';var ChatWebsiteEvents=require(_0x2bd3('0x0'));var events=[_0x2bd3('0x1'),_0x2bd3('0x2'),_0x2bd3('0x3')];function createListener(_0x23059d,_0x8dcafa){return function(_0x348fba){_0x8dcafa[_0x2bd3('0x4')](_0x23059d,_0x348fba);};}function removeListener(_0x550c61,_0x40298b){return function(){ChatWebsiteEvents['removeListener'](_0x550c61,_0x40298b);};}exports[_0x2bd3('0x5')]=function(_0x4649a1){for(var _0x125475=0x0,_0x552f9c=events[_0x2bd3('0x6')];_0x125475<_0x552f9c;_0x125475++){var _0x20ed3e=events[_0x125475];var _0x41621c=createListener('chatWebsite:'+_0x20ed3e,_0x4649a1);ChatWebsiteEvents['on'](_0x20ed3e,_0x41621c);}};
\ No newline at end of file
+var _0x950e=['chatWebsite:','./chatWebsite.events','save','emit','register','length'];(function(_0x5fe5ca,_0x4e92d3){var _0x42f45f=function(_0x2511eb){while(--_0x2511eb){_0x5fe5ca['push'](_0x5fe5ca['shift']());}};_0x42f45f(++_0x4e92d3);}(_0x950e,0x85));var _0xe950=function(_0x56f187,_0x2eec20){_0x56f187=_0x56f187-0x0;var _0x1b8b67=_0x950e[_0x56f187];return _0x1b8b67;};'use strict';var ChatWebsiteEvents=require(_0xe950('0x0'));var events=[_0xe950('0x1'),'remove','update'];function createListener(_0x5c403c,_0x46ccf5){return function(_0x4df08c){_0x46ccf5[_0xe950('0x2')](_0x5c403c,_0x4df08c);};}function removeListener(_0x363422,_0x477f88){return function(){ChatWebsiteEvents['removeListener'](_0x363422,_0x477f88);};}exports[_0xe950('0x3')]=function(_0x36655){for(var _0x515c94=0x0,_0x290204=events[_0xe950('0x4')];_0x515c94<_0x290204;_0x515c94++){var _0x3f3081=events[_0x515c94];var _0x508f75=createListener(_0xe950('0x5')+_0x3f3081,_0x36655);ChatWebsiteEvents['on'](_0x3f3081,_0x508f75);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index abf3ada..b668e9a 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 _0x24e9=['delete','destroy','removeDispositions','removeAnswers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','file','server/files/images/avatars/','format','single','addAvatar','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline-chat','replace','any','/:id/interactions','addApplications','addProactiveActions','addAgents','update'];(function(_0x28098d,_0xdaed8e){var _0xc6a35f=function(_0x57ebff){while(--_0x57ebff){_0x28098d['push'](_0x28098d['shift']());}};_0xc6a35f(++_0xdaed8e);}(_0x24e9,0x159));var _0x924e=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x24e9[_0x1992f1];return _0x413dfe;};'use strict';var multer=require(_0x924e('0x0'));var util=require('util');var path=require(_0x924e('0x1'));var timeout=require(_0x924e('0x2'));var express=require(_0x924e('0x3'));var router=express[_0x924e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x924e('0x5'));var interaction=require(_0x924e('0x6'));var config=require(_0x924e('0x7'));var controller=require('./chatWebsite.controller');router[_0x924e('0x8')]('/',auth[_0x924e('0x9')](),controller[_0x924e('0xa')]);router[_0x924e('0x8')](_0x924e('0xb'),auth[_0x924e('0x9')](),controller['describe']);router[_0x924e('0x8')](_0x924e('0xc'),auth['isAuthenticated'](),controller[_0x924e('0xd')]);router[_0x924e('0x8')](_0x924e('0xe'),auth[_0x924e('0x9')](),controller['getDispositions']);router['get'](_0x924e('0xf'),auth['isAuthenticated'](),controller[_0x924e('0x10')]);router[_0x924e('0x8')](_0x924e('0x11'),controller[_0x924e('0x12')]);router['get'](_0x924e('0x13'),controller[_0x924e('0x14')]);router[_0x924e('0x8')](_0x924e('0x15'),controller[_0x924e('0x16')]);router[_0x924e('0x8')](_0x924e('0x17'),controller[_0x924e('0x18')]);router[_0x924e('0x8')]('/:id/interactions',auth[_0x924e('0x9')](),controller['getInteractions']);router[_0x924e('0x8')](_0x924e('0x19'),controller['getSnippet']);router['get'](_0x924e('0x1a'),auth['isAuthenticated'](),controller[_0x924e('0x1b')]);router[_0x924e('0x8')](_0x924e('0x1c'),auth[_0x924e('0x9')](),controller[_0x924e('0x1d')]);router['get'](_0x924e('0x1e'),controller[_0x924e('0x1f')]);router['get']('/:id/offline_messages',auth[_0x924e('0x9')](),controller[_0x924e('0x20')]);router[_0x924e('0x8')](_0x924e('0x21'),auth['isAuthenticated'](),controller[_0x924e('0x22')]);router[_0x924e('0x23')]('/',auth[_0x924e('0x9')](),controller[_0x924e('0x24')]);router[_0x924e('0x23')](_0x924e('0xe'),auth[_0x924e('0x9')](),controller[_0x924e('0x25')]);router['post'](_0x924e('0xf'),auth[_0x924e('0x9')](),controller[_0x924e('0x26')]);var upload=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x3b8096,_0x235ab3,_0xffcfee){_0xffcfee(null,path[_0x924e('0x28')](config[_0x924e('0x29')],_0x924e('0x2a')));},'filename':function(_0x3468c0,_0x587c9b,_0x29f80e){_0x29f80e(null,util['format'](_0x924e('0x2b'),Date[_0x924e('0x2c')](),_0x587c9b['originalname']));}})});router[_0x924e('0x23')](_0x924e('0x11'),upload['single'](_0x924e('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x3e680d,_0x3e019c,_0x2fb6f3){_0x2fb6f3(null,path['join'](config['root'],_0x924e('0x2e')));},'filename':function(_0xad49c0,_0xe8f3a4,_0x17077b){_0x17077b(null,util[_0x924e('0x2f')]('%s-%s',Date[_0x924e('0x2c')](),_0xe8f3a4['originalname']));}})});router[_0x924e('0x23')]('/:id/avatar',upload[_0x924e('0x30')](_0x924e('0x2d')),controller[_0x924e('0x31')]);var upload=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x37695f,_0x19dc33,_0x343e17){_0x343e17(null,path[_0x924e('0x28')](config[_0x924e('0x29')],_0x924e('0x2e')));},'filename':function(_0x3065a7,_0x41ca26,_0x49a74f){_0x49a74f(null,util[_0x924e('0x2f')](_0x924e('0x2b'),Date[_0x924e('0x2c')](),_0x41ca26[_0x924e('0x32')]));}})});router[_0x924e('0x23')]('/:id/customer_avatar',upload[_0x924e('0x30')](_0x924e('0x2d')),controller[_0x924e('0x33')]);var upload=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x2baf9e,_0x45be55,_0x54a6dc){_0x54a6dc(null,path['join'](config[_0x924e('0x29')],_0x924e('0x2e')));},'filename':function(_0x49706b,_0x5da8d6,_0xcaf44f){_0xcaf44f(null,util['format'](_0x924e('0x2b'),Date[_0x924e('0x2c')](),_0x5da8d6[_0x924e('0x32')]));}})});router[_0x924e('0x23')]('/:id/system_avatar',upload[_0x924e('0x30')](_0x924e('0x2d')),controller[_0x924e('0x34')]);router[_0x924e('0x23')](_0x924e('0x35'),controller[_0x924e('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x48b147,_0x4e1277,_0x3b1f5e){const _0x592d90=path[_0x924e('0x28')](config[_0x924e('0x29')],'server/files','attachments',_0x924e('0x37'));fs_extra['ensureDir'](_0x592d90,function(){_0x3b1f5e(null,_0x592d90);});},'filename':function(_0x3b05b7,_0x5a18ca,_0x10e9fd){const _0x471275=_0x5a18ca[_0x924e('0x32')][_0x924e('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3eeb55=path['extname'](_0x471275);const _0x4b04a5=Date[_0x924e('0x2c')]()+'-'+_0x471275[_0x924e('0x38')](_0x3eeb55,'')+_0x3eeb55;_0x10e9fd(null,_0x4b04a5);}})});router['post']('/:id/offline',offlineUploadMulter[_0x924e('0x39')](),controller['offline']);router['post'](_0x924e('0x3a'),auth[_0x924e('0x9')](),controller['addInteraction']);router[_0x924e('0x23')](_0x924e('0x1a'),auth[_0x924e('0x9')](),controller[_0x924e('0x3b')]);router[_0x924e('0x23')](_0x924e('0x1c'),auth['isAuthenticated'](),controller[_0x924e('0x3c')]);router[_0x924e('0x23')](_0x924e('0x21'),auth[_0x924e('0x9')](),controller[_0x924e('0x3d')]);router['put']('/:id',auth[_0x924e('0x9')](),controller[_0x924e('0x3e')]);router[_0x924e('0x3f')](_0x924e('0xc'),auth[_0x924e('0x9')](),controller[_0x924e('0x40')]);router[_0x924e('0x3f')](_0x924e('0xe'),auth[_0x924e('0x9')](),controller[_0x924e('0x41')]);router['delete'](_0x924e('0xf'),auth['isAuthenticated'](),controller[_0x924e('0x42')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x924e('0x43')]=router;
\ No newline at end of file
+var _0x1f82=['post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','/:id/avatar','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create'];(function(_0x71e7b1,_0x5509c1){var _0x42a61a=function(_0x3e650f){while(--_0x3e650f){_0x71e7b1['push'](_0x71e7b1['shift']());}};_0x42a61a(++_0x5509c1);}(_0x1f82,0x72));var _0x21f8=function(_0x3a3f0c,_0x174f79){_0x3a3f0c=_0x3a3f0c-0x0;var _0x184722=_0x1f82[_0x3a3f0c];return _0x184722;};'use strict';var multer=require(_0x21f8('0x0'));var util=require(_0x21f8('0x1'));var path=require(_0x21f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x21f8('0x3'));var router=express[_0x21f8('0x4')]();var fs_extra=require(_0x21f8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x21f8('0x6'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x21f8('0x7')]);router[_0x21f8('0x8')](_0x21f8('0x9'),auth['isAuthenticated'](),controller[_0x21f8('0xa')]);router[_0x21f8('0x8')](_0x21f8('0xb'),auth[_0x21f8('0xc')](),controller[_0x21f8('0xd')]);router[_0x21f8('0x8')](_0x21f8('0xe'),auth[_0x21f8('0xc')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x21f8('0x8')]('/:id/logo',controller['getLogo']);router[_0x21f8('0x8')]('/:id/avatar',controller[_0x21f8('0xf')]);router[_0x21f8('0x8')](_0x21f8('0x10'),controller['getCustomerAvatar']);router[_0x21f8('0x8')](_0x21f8('0x11'),controller[_0x21f8('0x12')]);router[_0x21f8('0x8')](_0x21f8('0x13'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x14')]);router[_0x21f8('0x8')](_0x21f8('0x15'),controller['getSnippet']);router[_0x21f8('0x8')](_0x21f8('0x16'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x17')]);router[_0x21f8('0x8')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x21f8('0x18'),controller[_0x21f8('0x19')]);router['get'](_0x21f8('0x1a'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x1b')]);router[_0x21f8('0x8')](_0x21f8('0x1c'),auth[_0x21f8('0xc')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x21f8('0x1d')]);router[_0x21f8('0x1e')](_0x21f8('0xe'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x1f')]);router['post']('/:id/canned_answers',auth[_0x21f8('0xc')](),controller[_0x21f8('0x20')]);var upload=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x4c5184,_0x19b61e,_0x14dbdc){_0x14dbdc(null,path[_0x21f8('0x22')](config[_0x21f8('0x23')],_0x21f8('0x24')));},'filename':function(_0xf41814,_0x530fa1,_0x447e19){_0x447e19(null,util[_0x21f8('0x25')](_0x21f8('0x26'),Date[_0x21f8('0x27')](),_0x530fa1[_0x21f8('0x28')]));}})});router[_0x21f8('0x1e')](_0x21f8('0x29'),upload[_0x21f8('0x2a')](_0x21f8('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x57eb44,_0x1d2579,_0x1194b8){_0x1194b8(null,path[_0x21f8('0x22')](config['root'],_0x21f8('0x2c')));},'filename':function(_0x13554f,_0x29a449,_0x47d4bf){_0x47d4bf(null,util['format'](_0x21f8('0x26'),Date[_0x21f8('0x27')](),_0x29a449[_0x21f8('0x28')]));}})});router[_0x21f8('0x1e')](_0x21f8('0x2d'),upload[_0x21f8('0x2a')](_0x21f8('0x2b')),controller[_0x21f8('0x2e')]);var upload=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x542472,_0x289b6b,_0x362a76){_0x362a76(null,path[_0x21f8('0x22')](config[_0x21f8('0x23')],_0x21f8('0x2c')));},'filename':function(_0x3e090d,_0x369feb,_0x55ca35){_0x55ca35(null,util[_0x21f8('0x25')](_0x21f8('0x26'),Date['now'](),_0x369feb[_0x21f8('0x28')]));}})});router['post'](_0x21f8('0x10'),upload[_0x21f8('0x2a')]('file'),controller[_0x21f8('0x2f')]);var upload=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x37a806,_0x4494d5,_0x5cbe81){_0x5cbe81(null,path[_0x21f8('0x22')](config[_0x21f8('0x23')],_0x21f8('0x2c')));},'filename':function(_0x525f6d,_0x1d3228,_0xa1830b){_0xa1830b(null,util[_0x21f8('0x25')](_0x21f8('0x26'),Date[_0x21f8('0x27')](),_0x1d3228[_0x21f8('0x28')]));}})});router[_0x21f8('0x1e')](_0x21f8('0x11'),upload[_0x21f8('0x2a')]('file'),controller[_0x21f8('0x30')]);router[_0x21f8('0x1e')](_0x21f8('0x31'),controller[_0x21f8('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x1b05b2,_0x5dc762,_0x1a53c6){const _0x1c731a=path[_0x21f8('0x22')](config[_0x21f8('0x23')],_0x21f8('0x33'),'attachments',_0x21f8('0x34'));fs_extra[_0x21f8('0x35')](_0x1c731a,function(){_0x1a53c6(null,_0x1c731a);});},'filename':function(_0x289e86,_0x555952,_0x5529d3){const _0x3894bd=_0x555952[_0x21f8('0x28')][_0x21f8('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xf69e2f=path[_0x21f8('0x37')](_0x3894bd);const _0x26231a=Date['now']()+'-'+_0x3894bd[_0x21f8('0x36')](_0xf69e2f,'')+_0xf69e2f;_0x5529d3(null,_0x26231a);}})});router[_0x21f8('0x1e')](_0x21f8('0x38'),offlineUploadMulter[_0x21f8('0x39')](),controller[_0x21f8('0x3a')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x21f8('0x3b')]);router[_0x21f8('0x1e')]('/:id/applications',auth[_0x21f8('0xc')](),controller[_0x21f8('0x3c')]);router[_0x21f8('0x1e')]('/:id/proactive_actions',auth[_0x21f8('0xc')](),controller[_0x21f8('0x3d')]);router[_0x21f8('0x1e')](_0x21f8('0x1c'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x3e')]);router[_0x21f8('0x3f')](_0x21f8('0xb'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x40')]);router[_0x21f8('0x41')](_0x21f8('0xb'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x42')]);router['delete']('/:id/dispositions',auth[_0x21f8('0xc')](),controller[_0x21f8('0x43')]);router[_0x21f8('0x41')](_0x21f8('0x44'),auth['isAuthenticated'](),controller[_0x21f8('0x45')]);router['delete'](_0x21f8('0x1c'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x46')]);module[_0x21f8('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index eedbe7f..3f7b29c 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 _0x96fd=['STRING','exports','ENUM','AmazonAWS'];(function(_0x3c330c,_0xa423b4){var _0x49031b=function(_0x29e852){while(--_0x29e852){_0x3c330c['push'](_0x3c330c['shift']());}};_0x49031b(++_0xa423b4);}(_0x96fd,0x1e9));var _0xd96f=function(_0x54f8c3,_0x15e392){_0x54f8c3=_0x54f8c3-0x0;var _0x2cd1cc=_0x96fd[_0x54f8c3];return _0x2cd1cc;};'use strict';var Sequelize=require('sequelize');module[_0xd96f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd96f('0x1')](_0xd96f('0x2'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xd96f('0x3')]},'data2':{'type':Sequelize[_0xd96f('0x3')]}};
\ No newline at end of file
+var _0xe953=['exports','STRING','AmazonAWS','Google','sequelize'];(function(_0xf9bd0a,_0x123ba0){var _0x1da48e=function(_0x27c74c){while(--_0x27c74c){_0xf9bd0a['push'](_0xf9bd0a['shift']());}};_0x1da48e(++_0x123ba0);}(_0xe953,0xf9));var _0x3e95=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xe953[_0x54edc9];return _0x2ae7a9;};'use strict';var Sequelize=require(_0x3e95('0x0'));module[_0x3e95('0x1')]={'name':{'type':Sequelize[_0x3e95('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x3e95('0x3'),_0x3e95('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3e95('0x2')]},'data2':{'type':Sequelize[_0x3e95('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 0ace70a..0ea2197 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 _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4635dc,_0xe243a8){_0x4635dc=_0x4635dc-0x0;var _0x43a990=_0x5f2f[_0x4635dc];return _0x43a990;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};
\ No newline at end of file
+var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xadb5,0xad));var _0x5adb=function(_0x245129,_0x5f434c){_0x245129=_0x245129-0x0;var _0x29a2e4=_0xadb5[_0x245129];return _0x29a2e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 1346fd7..8ab86ab 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 _0x5a63=['request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','../../config/logger','api'];(function(_0x122979,_0x2a0f9a){var _0x173e85=function(_0x1d4f69){while(--_0x1d4f69){_0x122979['push'](_0x122979['shift']());}};_0x173e85(++_0x2a0f9a);}(_0x5a63,0xd9));var _0x35a6=function(_0x110910,_0x4ffd63){_0x110910=_0x110910-0x0;var _0x221c41=_0x5a63[_0x110910];return _0x221c41;};'use strict';var _=require(_0x35a6('0x0'));var util=require('util');var logger=require(_0x35a6('0x1'))(_0x35a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x35a6('0x3'));var fs=require('fs');var path=require(_0x35a6('0x4'));var rimraf=require(_0x35a6('0x5'));var config=require(_0x35a6('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x35a6('0x7')]=function(_0x27a8ad,_0x1be323){return _0x27a8ad[_0x35a6('0x8')](_0x35a6('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf30c=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2242c9,_0x5a485b){var _0x5ca46a=function(_0x169423){while(--_0x169423){_0x2242c9['push'](_0x2242c9['shift']());}};_0x5ca46a(++_0x5a485b);}(_0xf30c,0x69));var _0xcf30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf30c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf30('0x0'));var util=require(_0xcf30('0x1'));var logger=require(_0xcf30('0x2'))(_0xcf30('0x3'));var moment=require('moment');var BPromise=require(_0xcf30('0x4'));var rp=require(_0xcf30('0x5'));var fs=require('fs');var path=require(_0xcf30('0x6'));var rimraf=require(_0xcf30('0x7'));var config=require(_0xcf30('0x8'));var attributes=require(_0xcf30('0x9'));module[_0xcf30('0xa')]=function(_0x25e894,_0x127ff8){return _0x25e894[_0xcf30('0xb')](_0xcf30('0xc'),attributes,{'tableName':_0xcf30('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 1b5c710..4d80f5d 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 _0x73a1=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result'];(function(_0x12c5b3,_0xa19b5e){var _0x26ea1d=function(_0x4b63f6){while(--_0x4b63f6){_0x12c5b3['push'](_0x12c5b3['shift']());}};_0x26ea1d(++_0xa19b5e);}(_0x73a1,0x161));var _0x173a=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x73a1[_0x25c326];return _0x762452;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x173a('0x0'));var BPromise=require(_0x173a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x173a('0x2'));var db=require(_0x173a('0x3'))['db'];var utils=require(_0x173a('0x4'));var logger=require(_0x173a('0x5'))(_0x173a('0x6'));var config=require('../../config/environment');var jayson=require(_0x173a('0x7'));var client=jayson[_0x173a('0x8')][_0x173a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbd8757,_0x12bb11,_0x550e2b){return new BPromise(function(_0x2b545e,_0x2c7090){return client[_0x173a('0xa')](_0xbd8757,_0x550e2b)[_0x173a('0xb')](function(_0x30ffef){logger[_0x173a('0xc')]('CloudProvider,\x20%s,\x20%s',_0x12bb11,_0x173a('0xd'));logger['debug'](_0x173a('0xe'),_0x12bb11,_0x173a('0xd'),JSON[_0x173a('0xf')](_0x30ffef));if(_0x30ffef[_0x173a('0x10')]){if(_0x30ffef['error'][_0x173a('0x11')]===0x1f4){logger['error'](_0x173a('0x12'),_0x12bb11,_0x30ffef['error'][_0x173a('0x13')]);return _0x2c7090(_0x30ffef[_0x173a('0x10')]['message']);}logger[_0x173a('0x10')](_0x173a('0x12'),_0x12bb11,_0x30ffef[_0x173a('0x10')][_0x173a('0x13')]);return _0x2b545e(_0x30ffef[_0x173a('0x10')][_0x173a('0x13')]);}else{logger[_0x173a('0xc')](_0x173a('0x12'),_0x12bb11,'request\x20sent');_0x2b545e(_0x30ffef[_0x173a('0x14')][_0x173a('0x13')]);}})[_0x173a('0x15')](function(_0x4b323c){logger['error']('CloudProvider,\x20%s,\x20%s',_0x12bb11,_0x4b323c);_0x2c7090(_0x4b323c);});});}
\ No newline at end of file
+var _0xf8f2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x3c2863,_0x1b2cee){var _0x2c3d27=function(_0x4f831b){while(--_0x4f831b){_0x3c2863['push'](_0x3c2863['shift']());}};_0x2c3d27(++_0x1b2cee);}(_0xf8f2,0xc2));var _0x2f8f=function(_0x3418e2,_0x36323d){_0x3418e2=_0x3418e2-0x0;var _0x4ba2e5=_0xf8f2[_0x3418e2];return _0x4ba2e5;};'use strict';var _=require(_0x2f8f('0x0'));var util=require(_0x2f8f('0x1'));var moment=require(_0x2f8f('0x2'));var BPromise=require(_0x2f8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f8f('0x4'));var db=require(_0x2f8f('0x5'))['db'];var utils=require(_0x2f8f('0x6'));var logger=require(_0x2f8f('0x7'))(_0x2f8f('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f8f('0x9'));var client=jayson[_0x2f8f('0xa')][_0x2f8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x107748,_0x590ff4,_0xb4473){return new BPromise(function(_0x10d128,_0x1237d5){return client['request'](_0x107748,_0xb4473)[_0x2f8f('0xc')](function(_0x1ce821){logger[_0x2f8f('0xd')](_0x2f8f('0xe'),_0x590ff4,'request\x20sent');logger[_0x2f8f('0xf')](_0x2f8f('0x10'),_0x590ff4,'request\x20sent',JSON[_0x2f8f('0x11')](_0x1ce821));if(_0x1ce821[_0x2f8f('0x12')]){if(_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x13')]===0x1f4){logger['error'](_0x2f8f('0xe'),_0x590ff4,_0x1ce821[_0x2f8f('0x12')]['message']);return _0x1237d5(_0x1ce821['error'][_0x2f8f('0x14')]);}logger[_0x2f8f('0x12')]('CloudProvider,\x20%s,\x20%s',_0x590ff4,_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x14')]);return _0x10d128(_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x14')]);}else{logger[_0x2f8f('0xd')]('CloudProvider,\x20%s,\x20%s',_0x590ff4,'request\x20sent');_0x10d128(_0x1ce821['result']['message']);}})[_0x2f8f('0x15')](function(_0xee85bb){logger[_0x2f8f('0x12')](_0x2f8f('0xe'),_0x590ff4,_0xee85bb);_0x1237d5(_0xee85bb);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index abe1c37..3059894 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 _0x8bcd=['post','put','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show'];(function(_0x23d022,_0x406eb6){var _0x137cb4=function(_0x4e2614){while(--_0x4e2614){_0x23d022['push'](_0x23d022['shift']());}};_0x137cb4(++_0x406eb6);}(_0x8bcd,0x174));var _0xd8bc=function(_0x37dbe8,_0x4f5f37){_0x37dbe8=_0x37dbe8-0x0;var _0x39c204=_0x8bcd[_0x37dbe8];return _0x39c204;};'use strict';var multer=require(_0xd8bc('0x0'));var util=require('util');var path=require(_0xd8bc('0x1'));var timeout=require(_0xd8bc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd8bc('0x3'));var interaction=require(_0xd8bc('0x4'));var config=require(_0xd8bc('0x5'));var controller=require(_0xd8bc('0x6'));router[_0xd8bc('0x7')]('/',auth[_0xd8bc('0x8')](),controller[_0xd8bc('0x9')]);router[_0xd8bc('0x7')](_0xd8bc('0xa'),auth['isAuthenticated'](),controller[_0xd8bc('0xb')]);router[_0xd8bc('0xc')]('/',auth[_0xd8bc('0x8')](),controller['create']);router[_0xd8bc('0xd')](_0xd8bc('0xa'),auth[_0xd8bc('0x8')](),controller['update']);router[_0xd8bc('0xe')](_0xd8bc('0xa'),auth[_0xd8bc('0x8')](),controller['destroy']);module[_0xd8bc('0xf')]=router;
\ No newline at end of file
+var _0xbfd1=['isAuthenticated','/:id','show','post','create','put','update','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x5ace35,_0xe9d5c9){var _0x5920c1=function(_0x3072f9){while(--_0x3072f9){_0x5ace35['push'](_0x5ace35['shift']());}};_0x5920c1(++_0xe9d5c9);}(_0xbfd1,0x134));var _0x1bfd=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xbfd1[_0x45e98e];return _0x374dba;};'use strict';var multer=require('multer');var util=require(_0x1bfd('0x0'));var path=require('path');var timeout=require(_0x1bfd('0x1'));var express=require('express');var router=express[_0x1bfd('0x2')]();var fs_extra=require(_0x1bfd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1bfd('0x4'));var config=require(_0x1bfd('0x5'));var controller=require('./cloudProvider.controller');router[_0x1bfd('0x6')]('/',auth[_0x1bfd('0x7')](),controller['index']);router[_0x1bfd('0x6')](_0x1bfd('0x8'),auth[_0x1bfd('0x7')](),controller[_0x1bfd('0x9')]);router[_0x1bfd('0xa')]('/',auth[_0x1bfd('0x7')](),controller[_0x1bfd('0xb')]);router[_0x1bfd('0xc')](_0x1bfd('0x8'),auth[_0x1bfd('0x7')](),controller[_0x1bfd('0xd')]);router['delete']('/:id',auth[_0x1bfd('0x7')](),controller['destroy']);module[_0x1bfd('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9e1ea0d..d7d041e 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 _0x4b1d=['exports','STRING','name','sequelize'];(function(_0x4563b6,_0x2611c5){var _0xa7e08c=function(_0x1f3604){while(--_0x1f3604){_0x4563b6['push'](_0x4563b6['shift']());}};_0xa7e08c(++_0x2611c5);}(_0x4b1d,0x16b));var _0xd4b1=function(_0x488c24,_0x325c82){_0x488c24=_0x488c24-0x0;var _0x3843e5=_0x4b1d[_0x488c24];return _0x3843e5;};'use strict';var Sequelize=require(_0xd4b1('0x0'));module[_0xd4b1('0x1')]={'name':{'type':Sequelize[_0xd4b1('0x2')],'unique':_0xd4b1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd4b1('0x2')]},'companyId':{'type':Sequelize[_0xd4b1('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd4b1('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd4b1('0x2')]},'street':{'type':Sequelize[_0xd4b1('0x2')]},'postalCode':{'type':Sequelize[_0xd4b1('0x2')]},'city':{'type':Sequelize[_0xd4b1('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd4b1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd4b1('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xd4b1('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xd4b1('0x2')]},'description':{'type':Sequelize[_0xd4b1('0x2')]}};
\ No newline at end of file
+var _0xc0d2=['STRING','name','exports'];(function(_0x10fc2b,_0x402f7f){var _0x39c8fb=function(_0x44c5ba){while(--_0x44c5ba){_0x10fc2b['push'](_0x10fc2b['shift']());}};_0x39c8fb(++_0x402f7f);}(_0xc0d2,0x98));var _0x2c0d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc0d2[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x2c0d('0x0')]={'name':{'type':Sequelize[_0x2c0d('0x1')],'unique':_0x2c0d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x2c0d('0x1')]},'phone':{'type':Sequelize[_0x2c0d('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2c0d('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2c0d('0x1')]},'city':{'type':Sequelize[_0x2c0d('0x1')]},'country':{'type':Sequelize[_0x2c0d('0x1')]},'email':{'type':Sequelize[_0x2c0d('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2c0d('0x1')]},'sStreet':{'type':Sequelize[_0x2c0d('0x1')]},'sPostalCode':{'type':Sequelize[_0x2c0d('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x2c0d('0x1')]},'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 2f6f265..924224d 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 _0x49d4=['model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','map','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','filters','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','body','describe','addContacts','CmContact','ids','omit','getContacts','findOne','sort','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','offset','undefined','count','limit','set','reject','update','destroy','then','get','Companies','end','sendStatus','error','stack','name','send','index'];(function(_0x227d6f,_0x337bc8){var _0x5f1c5c=function(_0x5ebe5c){while(--_0x5ebe5c){_0x227d6f['push'](_0x227d6f['shift']());}};_0x5f1c5c(++_0x337bc8);}(_0x49d4,0xd4));var _0x449d=function(_0x5ac4c5,_0x59663f){_0x5ac4c5=_0x5ac4c5-0x0;var _0x35d193=_0x49d4[_0x5ac4c5];return _0x35d193;};'use strict';var emlformat=require(_0x449d('0x0'));var rimraf=require(_0x449d('0x1'));var zipdir=require(_0x449d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x449d('0x3'));var moment=require(_0x449d('0x4'));var BPromise=require(_0x449d('0x5'));var Mustache=require('mustache');var util=require(_0x449d('0x6'));var path=require(_0x449d('0x7'));var sox=require(_0x449d('0x8'));var csv=require(_0x449d('0x9'));var ejs=require(_0x449d('0xa'));var fs=require('fs');var fs_extra=require(_0x449d('0xb'));var _=require(_0x449d('0xc'));var squel=require(_0x449d('0xd'));var crypto=require(_0x449d('0xe'));var jsforce=require(_0x449d('0xf'));var deskjs=require(_0x449d('0x10'));var toCsv=require(_0x449d('0x9'));var querystring=require(_0x449d('0x11'));var Papa=require(_0x449d('0x12'));var Redis=require('ioredis');var authService=require(_0x449d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x449d('0x14'))(_0x449d('0x15'));var utils=require(_0x449d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x449d('0x17'));var db=require(_0x449d('0x18'))['db'];function respondWithStatusCode(_0xf774ee,_0x5b9b4a){_0x5b9b4a=_0x5b9b4a||0xcc;return function(_0x12f647){if(_0x12f647){return _0xf774ee['sendStatus'](_0x5b9b4a);}return _0xf774ee['status'](_0x5b9b4a)['end']();};}function respondWithResult(_0x35991f,_0x41a60f){_0x41a60f=_0x41a60f||0xc8;return function(_0x244898){if(_0x244898){return _0x35991f['status'](_0x41a60f)['json'](_0x244898);}};}function respondWithFilteredResult(_0x32f8c8,_0x1b24c6){return function(_0xd8b2be){if(_0xd8b2be){var _0x66114b=typeof _0x1b24c6[_0x449d('0x19')]==='undefined'&&typeof _0x1b24c6['limit']===_0x449d('0x1a');var _0x3b31b0=_0xd8b2be[_0x449d('0x1b')];var _0x3b0019=_0x66114b?0x0:_0x1b24c6[_0x449d('0x19')];var _0x15a6bc=_0x66114b?_0xd8b2be[_0x449d('0x1b')]:_0x1b24c6[_0x449d('0x19')]+_0x1b24c6[_0x449d('0x1c')];var _0x437862;if(_0x15a6bc>=_0x3b31b0){_0x15a6bc=_0x3b31b0;_0x437862=0xc8;}else{_0x437862=0xce;}_0x32f8c8['status'](_0x437862);return _0x32f8c8[_0x449d('0x1d')]('Content-Range',_0x3b0019+'-'+_0x15a6bc+'/'+_0x3b31b0)['json'](_0xd8b2be);}return null;};}function patchUpdates(_0x50aa8b){return function(_0x16938d){try{jsonpatch['apply'](_0x16938d,_0x50aa8b,!![]);}catch(_0x2843da){return BPromise[_0x449d('0x1e')](_0x2843da);}return _0x16938d['save']();};}function saveUpdates(_0x28f3ff,_0xb7aa84){return function(_0x2f83ea){if(_0x2f83ea){return _0x2f83ea[_0x449d('0x1f')](_0x28f3ff)['then'](function(_0x93a30a){return _0x93a30a;});}return null;};}function removeEntity(_0x26dfe6,_0x2ea83b){return function(_0x55fda9){if(_0x55fda9){return _0x55fda9[_0x449d('0x20')]()[_0x449d('0x21')](function(){var _0x44cb2c=_0x55fda9[_0x449d('0x22')]({'plain':!![]});var _0x5acc1b=_0x449d('0x23');return db['UserProfileResource'][_0x449d('0x20')]({'where':{'type':_0x5acc1b,'resourceId':_0x44cb2c['id']}})[_0x449d('0x21')](function(){return _0x55fda9;});})[_0x449d('0x21')](function(){_0x26dfe6['status'](0xcc)[_0x449d('0x24')]();});}};}function handleEntityNotFound(_0xe86856,_0x45d163){return function(_0x4d58b0){if(!_0x4d58b0){_0xe86856[_0x449d('0x25')](0x194);}return _0x4d58b0;};}function handleError(_0x573263,_0x31c523){_0x31c523=_0x31c523||0x1f4;return function(_0x331476){logger[_0x449d('0x26')](_0x331476[_0x449d('0x27')]);if(_0x331476[_0x449d('0x28')]){delete _0x331476['name'];}_0x573263['status'](_0x31c523)[_0x449d('0x29')](_0x331476);};}exports[_0x449d('0x2a')]=function(_0x114bd5,_0x46c7b0){var _0x2bc420={},_0x5c047d={},_0x49727e={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x449d('0x21')](function(_0x552e52){_0x5c047d[_0x449d('0x2b')]=_[_0x449d('0x2c')](_0x552e52);_0x5c047d[_0x449d('0x2d')]=_[_0x449d('0x2c')](_0x114bd5[_0x449d('0x2d')]);_0x5c047d['filters']=_[_0x449d('0x2e')](_0x5c047d[_0x449d('0x2b')],_0x5c047d[_0x449d('0x2d')]);_0x2bc420['attributes']=_[_0x449d('0x2e')](_0x5c047d['model'],qs['fields'](_0x114bd5[_0x449d('0x2d')][_0x449d('0x2f')]));_0x2bc420[_0x449d('0x30')]=_0x2bc420[_0x449d('0x30')][_0x449d('0x31')]?_0x2bc420['attributes']:_0x5c047d[_0x449d('0x2b')];if(!_0x114bd5['query'][_0x449d('0x32')]('nolimit')){_0x2bc420[_0x449d('0x1c')]=qs[_0x449d('0x1c')](_0x114bd5[_0x449d('0x2d')][_0x449d('0x1c')]);_0x2bc420[_0x449d('0x19')]=qs[_0x449d('0x19')](_0x114bd5[_0x449d('0x2d')][_0x449d('0x19')]);}_0x2bc420[_0x449d('0x33')]=qs['sort'](_0x114bd5[_0x449d('0x2d')]['sort']);_0x2bc420[_0x449d('0x34')]=qs['filters'](_[_0x449d('0x35')](_0x114bd5[_0x449d('0x2d')],_0x5c047d['filters']),_0x552e52);if(_0x114bd5[_0x449d('0x2d')][_0x449d('0x36')]){_0x2bc420[_0x449d('0x34')]=_[_0x449d('0x37')](_0x2bc420[_0x449d('0x34')],{'$or':_[_0x449d('0x38')](_0x2bc420['attributes'],function(_0x5aebf3){var _0x4ada7c={};_0x4ada7c[_0x5aebf3]={'$like':'%'+_0x114bd5[_0x449d('0x2d')][_0x449d('0x36')]+'%'};return _0x4ada7c;})});}_0x2bc420=_[_0x449d('0x37')]({},_0x2bc420,_0x114bd5[_0x449d('0x39')]);var _0x18b97b={'where':_0x2bc420[_0x449d('0x34')]};return db[_0x449d('0x3a')][_0x449d('0x1b')](_0x18b97b)[_0x449d('0x21')](function(_0x31da8d){_0x49727e[_0x449d('0x1b')]=_0x31da8d;if(_0x114bd5[_0x449d('0x2d')][_0x449d('0x3b')]){_0x2bc420['include']=[{'all':!![]}];}return db['CmCompany'][_0x449d('0x3c')](_0x2bc420);})['then'](function(_0x3cbe94){_0x49727e[_0x449d('0x3d')]=_0x3cbe94;return _0x49727e;})[_0x449d('0x21')](respondWithFilteredResult(_0x46c7b0,_0x2bc420))['catch'](handleError(_0x46c7b0,null));})[_0x449d('0x3e')](handleError(_0x46c7b0,null));};exports[_0x449d('0x3f')]=function(_0x2d859d,_0x383377){var _0x4d0326={'raw':![],'where':{'id':_0x2d859d[_0x449d('0x40')]['id']}},_0x329634={};_0x329634['model']=_[_0x449d('0x2c')](db[_0x449d('0x3a')][_0x449d('0x41')]);_0x329634[_0x449d('0x2d')]=_[_0x449d('0x2c')](_0x2d859d[_0x449d('0x2d')]);_0x329634[_0x449d('0x42')]=_[_0x449d('0x2e')](_0x329634[_0x449d('0x2b')],_0x329634[_0x449d('0x2d')]);_0x4d0326[_0x449d('0x30')]=_[_0x449d('0x2e')](_0x329634[_0x449d('0x2b')],qs[_0x449d('0x2f')](_0x2d859d[_0x449d('0x2d')][_0x449d('0x2f')]));_0x4d0326[_0x449d('0x30')]=_0x4d0326[_0x449d('0x30')][_0x449d('0x31')]?_0x4d0326['attributes']:_0x329634['model'];if(_0x2d859d['query'][_0x449d('0x3b')]){_0x4d0326['include']=[{'all':!![]}];}_0x4d0326=_[_0x449d('0x37')]({},_0x4d0326,_0x2d859d[_0x449d('0x39')]);return db['CmCompany'][_0x449d('0x43')](_0x4d0326)['then'](handleEntityNotFound(_0x383377,null))[_0x449d('0x21')](respondWithResult(_0x383377,null))[_0x449d('0x3e')](handleError(_0x383377,null));};exports[_0x449d('0x44')]=function(_0x1cfe25,_0x4e3d19){return db[_0x449d('0x3a')]['create'](_0x1cfe25['body'],{})['then'](function(_0x351f0f){var _0xd32ba2=_0x1cfe25[_0x449d('0x45')]['get']({'plain':!![]});if(!_0xd32ba2)throw new Error(_0x449d('0x46'));if(_0xd32ba2[_0x449d('0x47')]==='user'){var _0x395a45=_0x351f0f[_0x449d('0x22')]({'plain':!![]});var _0x1ff479=_0x449d('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x1ff479,'userProfileId':_0xd32ba2[_0x449d('0x48')]},'raw':!![]})['then'](function(_0x13b7d3){if(_0x13b7d3&&_0x13b7d3[_0x449d('0x49')]===0x0){return db[_0x449d('0x4a')]['create']({'name':_0x395a45[_0x449d('0x28')],'resourceId':_0x395a45['id'],'type':_0x13b7d3[_0x449d('0x28')],'sectionId':_0x13b7d3['id']},{})[_0x449d('0x21')](function(){return _0x351f0f;});}else{return _0x351f0f;}})[_0x449d('0x3e')](function(_0x53df7b){logger[_0x449d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53df7b);throw _0x53df7b;});}return _0x351f0f;})[_0x449d('0x21')](respondWithResult(_0x4e3d19,0xc9))['catch'](handleError(_0x4e3d19,null));};exports[_0x449d('0x1f')]=function(_0x3487b3,_0x7ac6c5){if(_0x3487b3['body']['id']){delete _0x3487b3[_0x449d('0x4b')]['id'];}return db[_0x449d('0x3a')][_0x449d('0x43')]({'where':{'id':_0x3487b3['params']['id']}})['then'](handleEntityNotFound(_0x7ac6c5,null))[_0x449d('0x21')](saveUpdates(_0x3487b3[_0x449d('0x4b')],null))[_0x449d('0x21')](respondWithResult(_0x7ac6c5,null))[_0x449d('0x3e')](handleError(_0x7ac6c5,null));};exports['destroy']=function(_0x42bf96,_0x243174){return db[_0x449d('0x3a')][_0x449d('0x43')]({'where':{'id':_0x42bf96[_0x449d('0x40')]['id']}})['then'](handleEntityNotFound(_0x243174,null))[_0x449d('0x21')](removeEntity(_0x243174,null))[_0x449d('0x3e')](handleError(_0x243174,null));};exports[_0x449d('0x4c')]=function(_0x30843f,_0x20c332){return db[_0x449d('0x3a')][_0x449d('0x4c')]()[_0x449d('0x21')](respondWithResult(_0x20c332,null))['catch'](handleError(_0x20c332,null));};exports[_0x449d('0x4d')]=function(_0x3da31b,_0x56a585,_0x5096ad){return db[_0x449d('0x4e')]['find']({'where':{'id':_0x3da31b[_0x449d('0x40')]['id']}})[_0x449d('0x21')](handleEntityNotFound(_0x56a585,null))['then'](function(_0x5f066d){if(_0x5f066d){return _0x5f066d[_0x449d('0x4d')](_0x3da31b[_0x449d('0x4b')][_0x449d('0x4f')],_[_0x449d('0x50')](_0x3da31b[_0x449d('0x4b')],[_0x449d('0x4f'),'id'])||{});}})[_0x449d('0x21')](respondWithResult(_0x56a585,null))[_0x449d('0x3e')](handleError(_0x56a585,null));};exports[_0x449d('0x51')]=function(_0x39a790,_0x45352f,_0x1e62cd){var _0x5f2a59={};var _0x3ee42b={};var _0x325b67;var _0x548165;return db['CmCompany'][_0x449d('0x52')]({'where':{'id':_0x39a790[_0x449d('0x40')]['id']}})[_0x449d('0x21')](handleEntityNotFound(_0x45352f,null))[_0x449d('0x21')](function(_0x527fcf){if(_0x527fcf){_0x325b67=_0x527fcf;_0x3ee42b[_0x449d('0x2b')]=_[_0x449d('0x2c')](db[_0x449d('0x4e')][_0x449d('0x41')]);_0x3ee42b[_0x449d('0x2d')]=_['keys'](_0x39a790[_0x449d('0x2d')]);_0x3ee42b[_0x449d('0x42')]=_['intersection'](_0x3ee42b[_0x449d('0x2b')],_0x3ee42b[_0x449d('0x2d')]);_0x5f2a59[_0x449d('0x30')]=_['intersection'](_0x3ee42b['model'],qs['fields'](_0x39a790[_0x449d('0x2d')][_0x449d('0x2f')]));_0x5f2a59[_0x449d('0x30')]=_0x5f2a59[_0x449d('0x30')][_0x449d('0x31')]?_0x5f2a59[_0x449d('0x30')]:_0x3ee42b[_0x449d('0x2b')];_0x5f2a59[_0x449d('0x33')]=qs[_0x449d('0x53')](_0x39a790['query'][_0x449d('0x53')]);_0x5f2a59[_0x449d('0x34')]=qs[_0x449d('0x42')](_['pick'](_0x39a790[_0x449d('0x2d')],_0x3ee42b[_0x449d('0x42')]));if(_0x39a790[_0x449d('0x2d')][_0x449d('0x36')]){_0x5f2a59['where']=_[_0x449d('0x37')](_0x5f2a59[_0x449d('0x34')],{'$or':_[_0x449d('0x38')](_0x5f2a59[_0x449d('0x30')],function(_0x1e8938){var _0x4e7dd1={};_0x4e7dd1[_0x1e8938]={'$like':'%'+_0x39a790[_0x449d('0x2d')]['filter']+'%'};return _0x4e7dd1;})});}_0x5f2a59=_[_0x449d('0x37')]({},_0x5f2a59,_0x39a790[_0x449d('0x39')]);return _0x325b67[_0x449d('0x51')](_0x5f2a59);}})[_0x449d('0x21')](function(_0x2e20df){if(_0x2e20df){_0x548165=_0x2e20df[_0x449d('0x31')];if(!_0x39a790[_0x449d('0x2d')][_0x449d('0x32')](_0x449d('0x54'))){_0x5f2a59[_0x449d('0x1c')]=qs[_0x449d('0x1c')](_0x39a790[_0x449d('0x2d')][_0x449d('0x1c')]);_0x5f2a59[_0x449d('0x19')]=qs[_0x449d('0x19')](_0x39a790['query'][_0x449d('0x19')]);}return _0x325b67[_0x449d('0x51')](_0x5f2a59);}})[_0x449d('0x21')](function(_0x2c0e4c){if(_0x2c0e4c){return _0x2c0e4c?{'count':_0x548165,'rows':_0x2c0e4c}:null;}})[_0x449d('0x21')](respondWithResult(_0x45352f,null))[_0x449d('0x3e')](handleError(_0x45352f,null));};
\ No newline at end of file
+var _0xd30f=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','ids','omit','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','get','UserProfileResource','stack','name','send','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd30f,0x65));var _0xfd30=function(_0x4fa728,_0x20209b){_0x4fa728=_0x4fa728-0x0;var _0x2b3a76=_0xd30f[_0x4fa728];return _0x2b3a76;};'use strict';var emlformat=require(_0xfd30('0x0'));var rimraf=require(_0xfd30('0x1'));var zipdir=require(_0xfd30('0x2'));var jsonpatch=require(_0xfd30('0x3'));var rp=require('request-promise');var moment=require(_0xfd30('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfd30('0x5'));var path=require('path');var sox=require(_0xfd30('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd30('0x7'));var _=require(_0xfd30('0x8'));var squel=require(_0xfd30('0x9'));var crypto=require('crypto');var jsforce=require(_0xfd30('0xa'));var deskjs=require(_0xfd30('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfd30('0xc'));var Papa=require('papaparse');var Redis=require(_0xfd30('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xfd30('0xe'));var as=require(_0xfd30('0xf'));var hardwareService=require(_0xfd30('0x10'));var logger=require(_0xfd30('0x11'))(_0xfd30('0x12'));var utils=require(_0xfd30('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfd30('0x14'));var db=require(_0xfd30('0x15'))['db'];function respondWithStatusCode(_0x48f35c,_0x3760ad){_0x3760ad=_0x3760ad||0xcc;return function(_0x2f3210){if(_0x2f3210){return _0x48f35c[_0xfd30('0x16')](_0x3760ad);}return _0x48f35c[_0xfd30('0x17')](_0x3760ad)[_0xfd30('0x18')]();};}function respondWithResult(_0x3444f9,_0x14f4c1){_0x14f4c1=_0x14f4c1||0xc8;return function(_0x4dd0a6){if(_0x4dd0a6){return _0x3444f9['status'](_0x14f4c1)[_0xfd30('0x19')](_0x4dd0a6);}};}function respondWithFilteredResult(_0x187da3,_0x5d846b){return function(_0x17a9b3){if(_0x17a9b3){var _0x472e8f=typeof _0x5d846b[_0xfd30('0x1a')]==='undefined'&&typeof _0x5d846b[_0xfd30('0x1b')]==='undefined';var _0xf4bef1=_0x17a9b3['count'];var _0x32013b=_0x472e8f?0x0:_0x5d846b[_0xfd30('0x1a')];var _0x218914=_0x472e8f?_0x17a9b3[_0xfd30('0x1c')]:_0x5d846b[_0xfd30('0x1a')]+_0x5d846b['limit'];var _0x69b95a;if(_0x218914>=_0xf4bef1){_0x218914=_0xf4bef1;_0x69b95a=0xc8;}else{_0x69b95a=0xce;}_0x187da3['status'](_0x69b95a);return _0x187da3['set'](_0xfd30('0x1d'),_0x32013b+'-'+_0x218914+'/'+_0xf4bef1)[_0xfd30('0x19')](_0x17a9b3);}return null;};}function patchUpdates(_0x596a27){return function(_0x3d3422){try{jsonpatch['apply'](_0x3d3422,_0x596a27,!![]);}catch(_0x979fc9){return BPromise[_0xfd30('0x1e')](_0x979fc9);}return _0x3d3422[_0xfd30('0x1f')]();};}function saveUpdates(_0x1f3896,_0x249990){return function(_0x5acf23){if(_0x5acf23){return _0x5acf23[_0xfd30('0x20')](_0x1f3896)[_0xfd30('0x21')](function(_0x548e56){return _0x548e56;});}return null;};}function removeEntity(_0x21e516,_0x43b289){return function(_0x5238a5){if(_0x5238a5){return _0x5238a5['destroy']()[_0xfd30('0x21')](function(){var _0x5d125e=_0x5238a5[_0xfd30('0x22')]({'plain':!![]});var _0x230d38='Companies';return db[_0xfd30('0x23')]['destroy']({'where':{'type':_0x230d38,'resourceId':_0x5d125e['id']}})[_0xfd30('0x21')](function(){return _0x5238a5;});})[_0xfd30('0x21')](function(){_0x21e516[_0xfd30('0x17')](0xcc)[_0xfd30('0x18')]();});}};}function handleEntityNotFound(_0x56988e,_0x4885d2){return function(_0x23f3e2){if(!_0x23f3e2){_0x56988e[_0xfd30('0x16')](0x194);}return _0x23f3e2;};}function handleError(_0x8007a3,_0x5c360e){_0x5c360e=_0x5c360e||0x1f4;return function(_0xdbf5a0){logger['error'](_0xdbf5a0[_0xfd30('0x24')]);if(_0xdbf5a0[_0xfd30('0x25')]){delete _0xdbf5a0[_0xfd30('0x25')];}_0x8007a3[_0xfd30('0x17')](_0x5c360e)[_0xfd30('0x26')](_0xdbf5a0);};}exports['index']=function(_0x1b5a2c,_0x5f1871){var _0x4ff295={},_0x4660e7={},_0x335447={'count':0x0,'rows':[]};return db[_0xfd30('0x27')][_0xfd30('0x28')]()[_0xfd30('0x21')](function(_0xc6ca7){_0x4660e7['model']=_[_0xfd30('0x29')](_0xc6ca7);_0x4660e7[_0xfd30('0x2a')]=_[_0xfd30('0x29')](_0x1b5a2c['query']);_0x4660e7[_0xfd30('0x2b')]=_[_0xfd30('0x2c')](_0x4660e7[_0xfd30('0x2d')],_0x4660e7[_0xfd30('0x2a')]);_0x4ff295[_0xfd30('0x2e')]=_[_0xfd30('0x2c')](_0x4660e7[_0xfd30('0x2d')],qs['fields'](_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x2f')]));_0x4ff295[_0xfd30('0x2e')]=_0x4ff295[_0xfd30('0x2e')][_0xfd30('0x30')]?_0x4ff295['attributes']:_0x4660e7[_0xfd30('0x2d')];if(!_0x1b5a2c['query'][_0xfd30('0x31')](_0xfd30('0x32'))){_0x4ff295[_0xfd30('0x1b')]=qs[_0xfd30('0x1b')](_0x1b5a2c[_0xfd30('0x2a')]['limit']);_0x4ff295[_0xfd30('0x1a')]=qs[_0xfd30('0x1a')](_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x1a')]);}_0x4ff295[_0xfd30('0x33')]=qs[_0xfd30('0x34')](_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x34')]);_0x4ff295[_0xfd30('0x35')]=qs[_0xfd30('0x2b')](_[_0xfd30('0x36')](_0x1b5a2c['query'],_0x4660e7['filters']),_0xc6ca7);if(_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x37')]){_0x4ff295[_0xfd30('0x35')]=_[_0xfd30('0x38')](_0x4ff295[_0xfd30('0x35')],{'$or':_[_0xfd30('0x39')](_0x4ff295[_0xfd30('0x2e')],function(_0x2cb3a8){var _0x2194d6={};_0x2194d6[_0x2cb3a8]={'$like':'%'+_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x37')]+'%'};return _0x2194d6;})});}_0x4ff295=_['merge']({},_0x4ff295,_0x1b5a2c[_0xfd30('0x3a')]);var _0x4518fc={'where':_0x4ff295[_0xfd30('0x35')]};return db[_0xfd30('0x27')][_0xfd30('0x1c')](_0x4518fc)[_0xfd30('0x21')](function(_0x57b9d7){_0x335447['count']=_0x57b9d7;if(_0x1b5a2c['query'][_0xfd30('0x3b')]){_0x4ff295[_0xfd30('0x3c')]=[{'all':!![]}];}return db[_0xfd30('0x27')][_0xfd30('0x3d')](_0x4ff295);})[_0xfd30('0x21')](function(_0x18a760){_0x335447[_0xfd30('0x3e')]=_0x18a760;return _0x335447;})[_0xfd30('0x21')](respondWithFilteredResult(_0x5f1871,_0x4ff295))[_0xfd30('0x3f')](handleError(_0x5f1871,null));})[_0xfd30('0x3f')](handleError(_0x5f1871,null));};exports[_0xfd30('0x40')]=function(_0x38e03a,_0x27667d){var _0x4d4332={'raw':![],'where':{'id':_0x38e03a[_0xfd30('0x41')]['id']}},_0x3db80e={};_0x3db80e[_0xfd30('0x2d')]=_['keys'](db['CmCompany'][_0xfd30('0x42')]);_0x3db80e['query']=_['keys'](_0x38e03a[_0xfd30('0x2a')]);_0x3db80e[_0xfd30('0x2b')]=_['intersection'](_0x3db80e[_0xfd30('0x2d')],_0x3db80e[_0xfd30('0x2a')]);_0x4d4332[_0xfd30('0x2e')]=_['intersection'](_0x3db80e['model'],qs['fields'](_0x38e03a[_0xfd30('0x2a')]['fields']));_0x4d4332['attributes']=_0x4d4332['attributes'][_0xfd30('0x30')]?_0x4d4332['attributes']:_0x3db80e[_0xfd30('0x2d')];if(_0x38e03a['query'][_0xfd30('0x3b')]){_0x4d4332[_0xfd30('0x3c')]=[{'all':!![]}];}_0x4d4332=_[_0xfd30('0x38')]({},_0x4d4332,_0x38e03a['options']);return db[_0xfd30('0x27')]['find'](_0x4d4332)[_0xfd30('0x21')](handleEntityNotFound(_0x27667d,null))[_0xfd30('0x21')](respondWithResult(_0x27667d,null))[_0xfd30('0x3f')](handleError(_0x27667d,null));};exports[_0xfd30('0x43')]=function(_0x4a739a,_0x7dc377){return db[_0xfd30('0x27')]['create'](_0x4a739a[_0xfd30('0x44')],{})[_0xfd30('0x21')](function(_0x4a50d8){var _0x2f6958=_0x4a739a[_0xfd30('0x45')][_0xfd30('0x22')]({'plain':!![]});if(!_0x2f6958)throw new Error(_0xfd30('0x46'));if(_0x2f6958[_0xfd30('0x47')]===_0xfd30('0x45')){var _0x27c33e=_0x4a50d8[_0xfd30('0x22')]({'plain':!![]});var _0x3a1522='Companies';return db[_0xfd30('0x48')][_0xfd30('0x49')]({'where':{'name':_0x3a1522,'userProfileId':_0x2f6958[_0xfd30('0x4a')]},'raw':!![]})[_0xfd30('0x21')](function(_0x3956ac){if(_0x3956ac&&_0x3956ac[_0xfd30('0x4b')]===0x0){return db[_0xfd30('0x23')][_0xfd30('0x43')]({'name':_0x27c33e[_0xfd30('0x25')],'resourceId':_0x27c33e['id'],'type':_0x3956ac['name'],'sectionId':_0x3956ac['id']},{})[_0xfd30('0x21')](function(){return _0x4a50d8;});}else{return _0x4a50d8;}})[_0xfd30('0x3f')](function(_0x2f9727){logger[_0xfd30('0x4c')](_0xfd30('0x4d'),_0x2f9727);throw _0x2f9727;});}return _0x4a50d8;})['then'](respondWithResult(_0x7dc377,0xc9))[_0xfd30('0x3f')](handleError(_0x7dc377,null));};exports[_0xfd30('0x20')]=function(_0xbed1,_0x2bc154){if(_0xbed1[_0xfd30('0x44')]['id']){delete _0xbed1[_0xfd30('0x44')]['id'];}return db[_0xfd30('0x27')][_0xfd30('0x49')]({'where':{'id':_0xbed1[_0xfd30('0x41')]['id']}})[_0xfd30('0x21')](handleEntityNotFound(_0x2bc154,null))[_0xfd30('0x21')](saveUpdates(_0xbed1[_0xfd30('0x44')],null))[_0xfd30('0x21')](respondWithResult(_0x2bc154,null))[_0xfd30('0x3f')](handleError(_0x2bc154,null));};exports[_0xfd30('0x4e')]=function(_0xcef918,_0x5eb256){return db[_0xfd30('0x27')][_0xfd30('0x49')]({'where':{'id':_0xcef918[_0xfd30('0x41')]['id']}})[_0xfd30('0x21')](handleEntityNotFound(_0x5eb256,null))['then'](removeEntity(_0x5eb256,null))['catch'](handleError(_0x5eb256,null));};exports[_0xfd30('0x28')]=function(_0x7c48ea,_0x3bd4a1){return db[_0xfd30('0x27')][_0xfd30('0x28')]()['then'](respondWithResult(_0x3bd4a1,null))[_0xfd30('0x3f')](handleError(_0x3bd4a1,null));};exports[_0xfd30('0x4f')]=function(_0x536a81,_0x58d7bc,_0x598c91){return db['CmContact'][_0xfd30('0x49')]({'where':{'id':_0x536a81['params']['id']}})[_0xfd30('0x21')](handleEntityNotFound(_0x58d7bc,null))[_0xfd30('0x21')](function(_0x83a83b){if(_0x83a83b){return _0x83a83b[_0xfd30('0x4f')](_0x536a81[_0xfd30('0x44')][_0xfd30('0x50')],_[_0xfd30('0x51')](_0x536a81[_0xfd30('0x44')],['ids','id'])||{});}})[_0xfd30('0x21')](respondWithResult(_0x58d7bc,null))[_0xfd30('0x3f')](handleError(_0x58d7bc,null));};exports[_0xfd30('0x52')]=function(_0x1ddfc1,_0x420782,_0x352f5d){var _0x35372d={};var _0x1843a1={};var _0x4c218b;var _0x55de50;return db[_0xfd30('0x27')][_0xfd30('0x53')]({'where':{'id':_0x1ddfc1['params']['id']}})['then'](handleEntityNotFound(_0x420782,null))[_0xfd30('0x21')](function(_0x20831b){if(_0x20831b){_0x4c218b=_0x20831b;_0x1843a1[_0xfd30('0x2d')]=_['keys'](db[_0xfd30('0x54')][_0xfd30('0x42')]);_0x1843a1[_0xfd30('0x2a')]=_[_0xfd30('0x29')](_0x1ddfc1[_0xfd30('0x2a')]);_0x1843a1[_0xfd30('0x2b')]=_['intersection'](_0x1843a1[_0xfd30('0x2d')],_0x1843a1[_0xfd30('0x2a')]);_0x35372d['attributes']=_['intersection'](_0x1843a1[_0xfd30('0x2d')],qs[_0xfd30('0x2f')](_0x1ddfc1['query'][_0xfd30('0x2f')]));_0x35372d[_0xfd30('0x2e')]=_0x35372d[_0xfd30('0x2e')]['length']?_0x35372d[_0xfd30('0x2e')]:_0x1843a1[_0xfd30('0x2d')];_0x35372d['order']=qs[_0xfd30('0x34')](_0x1ddfc1[_0xfd30('0x2a')][_0xfd30('0x34')]);_0x35372d[_0xfd30('0x35')]=qs[_0xfd30('0x2b')](_[_0xfd30('0x36')](_0x1ddfc1[_0xfd30('0x2a')],_0x1843a1['filters']));if(_0x1ddfc1[_0xfd30('0x2a')]['filter']){_0x35372d[_0xfd30('0x35')]=_[_0xfd30('0x38')](_0x35372d['where'],{'$or':_[_0xfd30('0x39')](_0x35372d['attributes'],function(_0x240ce1){var _0x4896e8={};_0x4896e8[_0x240ce1]={'$like':'%'+_0x1ddfc1['query'][_0xfd30('0x37')]+'%'};return _0x4896e8;})});}_0x35372d=_[_0xfd30('0x38')]({},_0x35372d,_0x1ddfc1[_0xfd30('0x3a')]);return _0x4c218b[_0xfd30('0x52')](_0x35372d);}})[_0xfd30('0x21')](function(_0x363c3f){if(_0x363c3f){_0x55de50=_0x363c3f[_0xfd30('0x30')];if(!_0x1ddfc1[_0xfd30('0x2a')]['hasOwnProperty'](_0xfd30('0x32'))){_0x35372d[_0xfd30('0x1b')]=qs['limit'](_0x1ddfc1[_0xfd30('0x2a')][_0xfd30('0x1b')]);_0x35372d[_0xfd30('0x1a')]=qs['offset'](_0x1ddfc1[_0xfd30('0x2a')]['offset']);}return _0x4c218b[_0xfd30('0x52')](_0x35372d);}})['then'](function(_0x5b33d4){if(_0x5b33d4){return _0x5b33d4?{'count':_0x55de50,'rows':_0x5b33d4}:null;}})[_0xfd30('0x21')](respondWithResult(_0x420782,null))['catch'](handleError(_0x420782,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index c688322..c7bc926 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 _0xc172=['request-promise','../../config/environment','./cmCompany.attributes','exports','define','../../config/logger','moment'];(function(_0x566c3a,_0x52ca48){var _0x39b298=function(_0x319185){while(--_0x319185){_0x566c3a['push'](_0x566c3a['shift']());}};_0x39b298(++_0x52ca48);}(_0xc172,0xe5));var _0x2c17=function(_0x5e0bd4,_0x2a97c0){_0x5e0bd4=_0x5e0bd4-0x0;var _0x515113=_0xc172[_0x5e0bd4];return _0x515113;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c17('0x0'))('api');var moment=require(_0x2c17('0x1'));var BPromise=require('bluebird');var rp=require(_0x2c17('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2c17('0x3'));var attributes=require(_0x2c17('0x4'));module[_0x2c17('0x5')]=function(_0xd15b3e,_0x496312){return _0xd15b3e[_0x2c17('0x6')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e3f=['bluebird','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api','moment'];(function(_0x25ab76,_0x596eae){var _0x235145=function(_0xfe005b){while(--_0xfe005b){_0x25ab76['push'](_0x25ab76['shift']());}};_0x235145(++_0x596eae);}(_0x5e3f,0x16f));var _0xf5e3=function(_0x309251,_0x5a6279){_0x309251=_0x309251-0x0;var _0x21426a=_0x5e3f[_0x309251];return _0x21426a;};'use strict';var _=require(_0xf5e3('0x0'));var util=require(_0xf5e3('0x1'));var logger=require(_0xf5e3('0x2'))(_0xf5e3('0x3'));var moment=require(_0xf5e3('0x4'));var BPromise=require(_0xf5e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5e3('0x6'));var rimraf=require('rimraf');var config=require(_0xf5e3('0x7'));var attributes=require(_0xf5e3('0x8'));module[_0xf5e3('0x9')]=function(_0x202d67,_0x3186a6){return _0x202d67[_0xf5e3('0xa')](_0xf5e3('0xb'),attributes,{'tableName':'cm_companies','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 ae822c4..dd95ea5 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 _0xba9f=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x22df4d,_0xa4790a){var _0x6a2020=function(_0x215c88){while(--_0x215c88){_0x22df4d['push'](_0x22df4d['shift']());}};_0x6a2020(++_0xa4790a);}(_0xba9f,0x1ca));var _0xfba9=function(_0x50b2f1,_0x51d38e){_0x50b2f1=_0x50b2f1-0x0;var _0x1fca47=_0xba9f[_0x50b2f1];return _0x1fca47;};'use strict';var _=require(_0xfba9('0x0'));var util=require(_0xfba9('0x1'));var moment=require(_0xfba9('0x2'));var BPromise=require(_0xfba9('0x3'));var rs=require(_0xfba9('0x4'));var fs=require('fs');var Redis=require(_0xfba9('0x5'));var db=require(_0xfba9('0x6'))['db'];var utils=require(_0xfba9('0x7'));var logger=require(_0xfba9('0x8'))(_0xfba9('0x9'));var config=require(_0xfba9('0xa'));var jayson=require(_0xfba9('0xb'));var client=jayson[_0xfba9('0xc')][_0xfba9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2c9fef,_0x4b57a3,_0x465a06){return new BPromise(function(_0x5b380e,_0x220a79){return client[_0xfba9('0xe')](_0x2c9fef,_0x465a06)[_0xfba9('0xf')](function(_0x460316){logger[_0xfba9('0x10')](_0xfba9('0x11'),_0x4b57a3,_0xfba9('0x12'));logger[_0xfba9('0x13')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x4b57a3,_0xfba9('0x12'),JSON[_0xfba9('0x14')](_0x460316));if(_0x460316[_0xfba9('0x15')]){if(_0x460316[_0xfba9('0x15')][_0xfba9('0x16')]===0x1f4){logger[_0xfba9('0x15')](_0xfba9('0x11'),_0x4b57a3,_0x460316[_0xfba9('0x15')][_0xfba9('0x17')]);return _0x220a79(_0x460316[_0xfba9('0x15')]['message']);}logger['error'](_0xfba9('0x11'),_0x4b57a3,_0x460316[_0xfba9('0x15')]['message']);return _0x5b380e(_0x460316['error'][_0xfba9('0x17')]);}else{logger[_0xfba9('0x10')](_0xfba9('0x11'),_0x4b57a3,'request\x20sent');_0x5b380e(_0x460316[_0xfba9('0x18')][_0xfba9('0x17')]);}})['catch'](function(_0x1516b0){logger[_0xfba9('0x15')]('CmCompany,\x20%s,\x20%s',_0x4b57a3,_0x1516b0);_0x220a79(_0x1516b0);});});}
\ No newline at end of file
+var _0xd963=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd963,0x1e7));var _0x3d96=function(_0x6f2ce5,_0x4231eb){_0x6f2ce5=_0x6f2ce5-0x0;var _0x28a54a=_0xd963[_0x6f2ce5];return _0x28a54a;};'use strict';var _=require('lodash');var util=require(_0x3d96('0x0'));var moment=require(_0x3d96('0x1'));var BPromise=require('bluebird');var rs=require(_0x3d96('0x2'));var fs=require('fs');var Redis=require(_0x3d96('0x3'));var db=require(_0x3d96('0x4'))['db'];var utils=require(_0x3d96('0x5'));var logger=require('../../config/logger')(_0x3d96('0x6'));var config=require(_0x3d96('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3d96('0x8')][_0x3d96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a440f,_0x421a2e,_0x23a682){return new BPromise(function(_0x2446b6,_0x5b3004){return client[_0x3d96('0xa')](_0x5a440f,_0x23a682)[_0x3d96('0xb')](function(_0x221871){logger[_0x3d96('0xc')](_0x3d96('0xd'),_0x421a2e,'request\x20sent');logger[_0x3d96('0xe')](_0x3d96('0xf'),_0x421a2e,'request\x20sent',JSON[_0x3d96('0x10')](_0x221871));if(_0x221871['error']){if(_0x221871[_0x3d96('0x11')][_0x3d96('0x12')]===0x1f4){logger[_0x3d96('0x11')](_0x3d96('0xd'),_0x421a2e,_0x221871[_0x3d96('0x11')]['message']);return _0x5b3004(_0x221871['error']['message']);}logger[_0x3d96('0x11')](_0x3d96('0xd'),_0x421a2e,_0x221871[_0x3d96('0x11')][_0x3d96('0x13')]);return _0x2446b6(_0x221871[_0x3d96('0x11')][_0x3d96('0x13')]);}else{logger['info'](_0x3d96('0xd'),_0x421a2e,'request\x20sent');_0x2446b6(_0x221871[_0x3d96('0x14')][_0x3d96('0x13')]);}})[_0x3d96('0x15')](function(_0x3e4649){logger[_0x3d96('0x11')](_0x3d96('0xd'),_0x421a2e,_0x3e4649);_0x5b3004(_0x3e4649);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 5711eb9..2a05de0 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 _0xb037=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/contacts','getContacts','create','post','update','delete','destroy','exports','connect-timeout'];(function(_0x4ee837,_0x4a454d){var _0xae1883=function(_0x57da8a){while(--_0x57da8a){_0x4ee837['push'](_0x4ee837['shift']());}};_0xae1883(++_0x4a454d);}(_0xb037,0x1da));var _0x7b03=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb037[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7b03('0x0'));var express=require(_0x7b03('0x1'));var router=express['Router']();var fs_extra=require(_0x7b03('0x2'));var auth=require(_0x7b03('0x3'));var interaction=require(_0x7b03('0x4'));var config=require(_0x7b03('0x5'));var controller=require('./cmCompany.controller');router[_0x7b03('0x6')]('/',auth[_0x7b03('0x7')](),controller[_0x7b03('0x8')]);router[_0x7b03('0x6')]('/describe',auth[_0x7b03('0x7')](),controller['describe']);router[_0x7b03('0x6')](_0x7b03('0x9'),auth[_0x7b03('0x7')](),controller[_0x7b03('0xa')]);router['get'](_0x7b03('0xb'),auth['isAuthenticated'](),controller[_0x7b03('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b03('0xd')]);router[_0x7b03('0xe')](_0x7b03('0xb'),auth[_0x7b03('0x7')](),controller['addContacts']);router['put'](_0x7b03('0x9'),auth['isAuthenticated'](),controller[_0x7b03('0xf')]);router[_0x7b03('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7b03('0x11')]);module[_0x7b03('0x12')]=router;
\ No newline at end of file
+var _0x4fcf=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','index','/describe','/:id','isAuthenticated','show','create','post','/:id/contacts','addContacts','put','update','exports','multer'];(function(_0x528dd1,_0xf7301c){var _0x553215=function(_0x5845b3){while(--_0x5845b3){_0x528dd1['push'](_0x528dd1['shift']());}};_0x553215(++_0xf7301c);}(_0x4fcf,0x83));var _0xf4fc=function(_0x49536b,_0x2abe5d){_0x49536b=_0x49536b-0x0;var _0x30de59=_0x4fcf[_0x49536b];return _0x30de59;};'use strict';var multer=require(_0xf4fc('0x0'));var util=require(_0xf4fc('0x1'));var path=require(_0xf4fc('0x2'));var timeout=require(_0xf4fc('0x3'));var express=require(_0xf4fc('0x4'));var router=express['Router']();var fs_extra=require(_0xf4fc('0x5'));var auth=require(_0xf4fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf4fc('0x7'));var controller=require(_0xf4fc('0x8'));router[_0xf4fc('0x9')]('/',auth['isAuthenticated'](),controller[_0xf4fc('0xa')]);router[_0xf4fc('0x9')](_0xf4fc('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf4fc('0x9')](_0xf4fc('0xc'),auth[_0xf4fc('0xd')](),controller[_0xf4fc('0xe')]);router[_0xf4fc('0x9')]('/:id/contacts',auth[_0xf4fc('0xd')](),controller['getContacts']);router['post']('/',auth[_0xf4fc('0xd')](),controller[_0xf4fc('0xf')]);router[_0xf4fc('0x10')](_0xf4fc('0x11'),auth[_0xf4fc('0xd')](),controller[_0xf4fc('0x12')]);router[_0xf4fc('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xf4fc('0x14')]);router['delete']('/:id',auth[_0xf4fc('0xd')](),controller['destroy']);module[_0xf4fc('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 31d5da0..3850007 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 _0x9ee5=['DATE','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x9ee5,0xef));var _0x59ee=function(_0x56b891,_0x1c87cd){_0x56b891=_0x56b891-0x0;var _0x4b5e31=_0x9ee5[_0x56b891];return _0x4b5e31;};'use strict';var _=require('lodash');var Sequelize=require(_0x59ee('0x0'));module[_0x59ee('0x1')]={'firstName':{'type':Sequelize[_0x59ee('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x59ee('0x2')]},'postalCode':{'type':Sequelize[_0x59ee('0x2')]},'city':{'type':Sequelize[_0x59ee('0x2')]},'country':{'type':Sequelize[_0x59ee('0x2')]},'dateOfBirth':{'type':Sequelize[_0x59ee('0x2')]},'description':{'type':Sequelize[_0x59ee('0x3')]},'phone':{'type':Sequelize[_0x59ee('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x59ee('0x2')]},'email':{'type':Sequelize[_0x59ee('0x2')]},'url':{'type':Sequelize[_0x59ee('0x2')]},'facebook':{'type':Sequelize[_0x59ee('0x2')]},'fb_data':{'type':Sequelize[_0x59ee('0x2')]},'twitter':{'type':Sequelize[_0x59ee('0x2')]},'skype':{'type':Sequelize[_0x59ee('0x2')]},'teams':{'type':Sequelize[_0x59ee('0x2')]},'viber':{'type':Sequelize[_0x59ee('0x2')]},'line':{'type':Sequelize[_0x59ee('0x2')]},'wechat':{'type':Sequelize[_0x59ee('0x2')]},'telegram':{'type':Sequelize[_0x59ee('0x2')]},'UserId':{'type':Sequelize[_0x59ee('0x4')]},'priority':{'type':Sequelize[_0x59ee('0x4')](0x2)[_0x59ee('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x59ee('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xb328=['TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize','exports','STRING'];(function(_0x5798ac,_0x8edc6c){var _0x25d0e2=function(_0x3d8149){while(--_0x3d8149){_0x5798ac['push'](_0x5798ac['shift']());}};_0x25d0e2(++_0x8edc6c);}(_0xb328,0x16c));var _0x8b32=function(_0xe3f2b3,_0x26f253){_0xe3f2b3=_0xe3f2b3-0x0;var _0x19fbfa=_0xb328[_0xe3f2b3];return _0x19fbfa;};'use strict';var _=require(_0x8b32('0x0'));var Sequelize=require(_0x8b32('0x1'));module[_0x8b32('0x2')]={'firstName':{'type':Sequelize[_0x8b32('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8b32('0x3')]},'street':{'type':Sequelize[_0x8b32('0x3')]},'postalCode':{'type':Sequelize[_0x8b32('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x8b32('0x3')]},'description':{'type':Sequelize[_0x8b32('0x4')]},'phone':{'type':Sequelize[_0x8b32('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8b32('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x8b32('0x3')]},'fb_data':{'type':Sequelize[_0x8b32('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8b32('0x3')]},'teams':{'type':Sequelize[_0x8b32('0x3')]},'viber':{'type':Sequelize[_0x8b32('0x3')]},'line':{'type':Sequelize[_0x8b32('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x8b32('0x3')]},'UserId':{'type':Sequelize[_0x8b32('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8b32('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8b32('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index af499d8..12eb798 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 _0xdae0=['child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','file','parse','import','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','getJourney','chat','openchannel','fax','whatsapp','-createdAt','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','uniqueid','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','startCase','Website','Account','closed','disposition','secondDisposition','key','Owner','push','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','referer','mail','subject','substatus','externalUrl','Interaction','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','CmCustomField','trimStart','all','length','fieldType','type','query','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','where','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','search','parseSearch','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','dateOfBirth','datetime','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','destroy','catch','tags','columnName','displayName','findAll','alias','custom','values','body','get','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','error','show','$and','omit','format','cf_%d','table','setFields','id\x20=\x20?','phone','findOne','params','rawAttributes','sort','pick','getTags','setTags','ids','getHoppers','ContactId','options','includeAll','include','getHopperHistories','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','0777'];(function(_0x3012dd,_0x279e35){var _0x10db1f=function(_0x5bc69f){while(--_0x5bc69f){_0x3012dd['push'](_0x3012dd['shift']());}};_0x10db1f(++_0x279e35);}(_0xdae0,0x173));var _0x0dae=function(_0x8e3e81,_0x243ca2){_0x8e3e81=_0x8e3e81-0x0;var _0x4438d7=_0xdae0[_0x8e3e81];return _0x4438d7;};'use strict';var emlformat=require(_0x0dae('0x0'));var rimraf=require(_0x0dae('0x1'));var zipdir=require(_0x0dae('0x2'));var jsonpatch=require(_0x0dae('0x3'));var rp=require(_0x0dae('0x4'));var moment=require(_0x0dae('0x5'));var BPromise=require(_0x0dae('0x6'));var Mustache=require(_0x0dae('0x7'));var util=require(_0x0dae('0x8'));var path=require(_0x0dae('0x9'));var sox=require(_0x0dae('0xa'));var csv=require(_0x0dae('0xb'));var ejs=require(_0x0dae('0xc'));var fs=require('fs');var fs_extra=require(_0x0dae('0xd'));var _=require(_0x0dae('0xe'));var squel=require(_0x0dae('0xf'));var crypto=require(_0x0dae('0x10'));var jsforce=require(_0x0dae('0x11'));var deskjs=require(_0x0dae('0x12'));var toCsv=require(_0x0dae('0xb'));var querystring=require(_0x0dae('0x13'));var Papa=require(_0x0dae('0x14'));var Redis=require(_0x0dae('0x15'));var authService=require(_0x0dae('0x16'));var qs=require(_0x0dae('0x17'));var as=require(_0x0dae('0x18'));var hardwareService=require(_0x0dae('0x19'));var logger=require('../../config/logger')(_0x0dae('0x1a'));var utils=require(_0x0dae('0x1b'));var config=require(_0x0dae('0x1c'));var licenseUtil=require(_0x0dae('0x1d'));var db=require('../../mysqldb')['db'];config[_0x0dae('0x1e')]=_[_0x0dae('0x1f')](config['redis'],{'host':_0x0dae('0x20'),'port':0x18eb});var socket=require(_0x0dae('0x21'))(new Redis(config[_0x0dae('0x1e')]));require(_0x0dae('0x22'))[_0x0dae('0x23')](socket);function respondWithStatusCode(_0x5da630,_0x2eb866){_0x2eb866=_0x2eb866||0xcc;return function(_0x4d4932){if(_0x4d4932){return _0x5da630[_0x0dae('0x24')](_0x2eb866);}return _0x5da630[_0x0dae('0x25')](_0x2eb866)[_0x0dae('0x26')]();};}function respondWithResult(_0x1ac724,_0x256ea8){_0x256ea8=_0x256ea8||0xc8;return function(_0x373606){if(_0x373606){return _0x1ac724[_0x0dae('0x25')](_0x256ea8)[_0x0dae('0x27')](_0x373606);}};}function respondWithFilteredResult(_0x2bd51f,_0x2a5a9b){return function(_0x276f9f){if(_0x276f9f){var _0xb1965=typeof _0x2a5a9b['offset']===_0x0dae('0x28')&&typeof _0x2a5a9b['limit']===_0x0dae('0x28');var _0x33f4a7=_0x276f9f[_0x0dae('0x29')];var _0x45f6ec=_0xb1965?0x0:_0x2a5a9b[_0x0dae('0x2a')];var _0x458d90=_0xb1965?_0x276f9f['count']:_0x2a5a9b[_0x0dae('0x2a')]+_0x2a5a9b[_0x0dae('0x2b')];var _0x336671;if(_0x458d90>=_0x33f4a7){_0x458d90=_0x33f4a7;_0x336671=0xc8;}else{_0x336671=0xce;}_0x2bd51f[_0x0dae('0x25')](_0x336671);return _0x2bd51f[_0x0dae('0x2c')](_0x0dae('0x2d'),_0x45f6ec+'-'+_0x458d90+'/'+_0x33f4a7)[_0x0dae('0x27')](_0x276f9f);}return null;};}function patchUpdates(_0x553463){return function(_0x3f20d3){try{jsonpatch[_0x0dae('0x2e')](_0x3f20d3,_0x553463,!![]);}catch(_0x3651c1){return BPromise[_0x0dae('0x2f')](_0x3651c1);}return _0x3f20d3[_0x0dae('0x30')]();};}function saveUpdates(_0x1c9bbd,_0x459fe1){return function(_0x3a482d){if(_0x3a482d){return _0x3a482d[_0x0dae('0x31')](_0x1c9bbd)[_0x0dae('0x32')](function(_0x26e160){return _0x26e160;});}return null;};}function removeEntity(_0x5a2dc3,_0x9e31b3){return function(_0xcf0075){if(_0xcf0075){return _0xcf0075['destroy']()['then'](function(){_0x5a2dc3[_0x0dae('0x25')](0xcc)[_0x0dae('0x26')]();});}};}function handleEntityNotFound(_0x407cd9,_0x3a62f8){return function(_0x443527){if(!_0x443527){_0x407cd9[_0x0dae('0x24')](0x194);}return _0x443527;};}function handleError(_0x2c7a3f,_0x3e019e){_0x3e019e=_0x3e019e||0x1f4;return function(_0x253d8f){logger['error'](_0x253d8f[_0x0dae('0x33')]);if(_0x253d8f[_0x0dae('0x34')]){delete _0x253d8f[_0x0dae('0x34')];}_0x2c7a3f[_0x0dae('0x25')](_0x3e019e)[_0x0dae('0x35')](_0x253d8f);};}exports[_0x0dae('0x36')]=function(_0x73b4df,_0x2c9173){var _0x1424e0={},_0xa2b041={},_0x535474={'count':0x0,'rows':[]};return db[_0x0dae('0x37')][_0x0dae('0x38')]()[_0x0dae('0x32')](function(_0x57e3eb){var _0x1bc081=[];for(var _0x3bbddc=0x0;_0x3bbddc
','Attachments','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','lodash','moment','randomstring','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','join','Anonymous','pop','html','replace'];(function(_0x224522,_0x1ad035){var _0xb24e1c=function(_0x268508){while(--_0x268508){_0x224522['push'](_0x224522['shift']());}};_0xb24e1c(++_0x1ad035);}(_0x7334,0x184));var _0x4733=function(_0x3c2af9,_0x2108d8){_0x3c2af9=_0x3c2af9-0x0;var _0x84b9b8=_0x7334[_0x3c2af9];return _0x84b9b8;};'use strict';var _=require(_0x4733('0x0'));var moment=require(_0x4733('0x1'));var random=require(_0x4733('0x2'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x4733('0x3'));var logger=require('../../../config/logger')(_0x4733('0x4'));var config=require(_0x4733('0x5'));function getAddress(_0x3645a2){var _0x29d7da=_[_0x4733('0x6')](_0x3645a2[_0x4733('0x7')]);return _0x29d7da&&_0x29d7da[_0x4733('0x8')]?_0x29d7da[_0x4733('0x8')]:_0x4733('0x9')+random[_0x4733('0xa')](0x6)+_0x4733('0xb');}function getFirstName(_0x3562b7){var _0x4c5c0=_[_0x4733('0x6')](_0x3562b7[_0x4733('0x7')]);if(_0x4c5c0&&_0x4c5c0[_0x4733('0xc')]){var _0x2bafad=_0x4c5c0['name'][_0x4733('0xd')](/\s+/);return _0x2bafad[_0x4733('0xe')]?_0x2bafad['slice'](0x0,-0x1)[_0x4733('0xf')]('\x20'):_0x4c5c0['name'];}return _0x4733('0x10');}function getLastName(_0x380b2e){var _0x44cb92=_[_0x4733('0x6')](_0x380b2e[_0x4733('0x7')]);if(_0x44cb92&&_0x44cb92[_0x4733('0xc')]){var _0x2c0f6b=_0x44cb92['name'][_0x4733('0xd')](/\s+/);return _0x2c0f6b['length']>0x1?_0x2c0f6b[_0x4733('0x11')]():'';}return'';}function getMails(_0x1a22e4,_0x2e5b1b){var _0x22283e='';for(var _0x3813df=0x0;_0x3813df<_0x2e5b1b[_0x4733('0x7')][_0x4733('0xe')];_0x3813df+=0x1){if(_0x2e5b1b[_0x4733('0x7')][_0x3813df][_0x4733('0x8')]!==_0x1a22e4){if(!_['isEmpty'](_0x22283e)){_0x22283e+=',';}_0x22283e+=_0x2e5b1b[_0x4733('0x7')][_0x3813df][_0x4733('0xc')]||_0x2e5b1b['value'][_0x3813df][_0x4733('0x8')]||'';_0x22283e+='\x20<';_0x22283e+=_0x2e5b1b[_0x4733('0x7')][_0x3813df][_0x4733('0x8')]?_0x2e5b1b[_0x4733('0x7')][_0x3813df]['address']:'anonymous'+random[_0x4733('0xa')](0x6)+_0x4733('0xb');_0x22283e+='>';}}return _0x22283e;}function parseEmail(_0x50c585,_0x32f166,_0x1943bc){if(_0x32f166[_0x4733('0x12')]){var _0x7a4e0=/